diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b6a88bd5b..e9cbcfff34 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,3 +71,6 @@ jobs: run: npm run check:circular-dependencies -w packages/core - name: Ensure no lint errors run: npm run lint + # See https://github.com/arethetypeswrong/arethetypeswrong.github.io/tree/main/packages/cli + - name: Check npm package + run: npm run check:npm-package -w packages/core diff --git a/eslint.config.mjs b/eslint.config.mjs index 253cef4c18..2ca13810b1 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -16,6 +16,7 @@ limitations under the License. import eslintJs from '@eslint/js'; import importPlugin from 'eslint-plugin-import'; +import nodePlugin from 'eslint-plugin-n'; import prettierRecommendedConfig from 'eslint-plugin-prettier/recommended'; import tsEslint from 'typescript-eslint'; @@ -89,5 +90,15 @@ export default tsEslint.config( }, }, + { + files: ['packages/core/src/**/*'], + ...nodePlugin.configs['flat/recommended-script'], + rules: { + ...nodePlugin.configs['flat/recommended-script'].rules, // without this line, the rules are not applied when specifying custom rules + 'n/file-extension-in-import': ['error', 'always'], + 'n/no-unsupported-features/node-builtins': 'off', // we don't use node in this package, and most errors are due to "navigator.xxx is still an experimental feature and is not supported until Node.js yyy" + }, + }, + prettierRecommendedConfig // Enables eslint-plugin-prettier, eslint-config-prettier and prettier/prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration. ); diff --git a/package-lock.json b/package-lock.json index 93530958eb..d9c810f6ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "eslint": "~9.30.0", "eslint-config-prettier": "~10.1.5", "eslint-plugin-import": "~2.32.0", + "eslint-plugin-n": "~17.20.0", "eslint-plugin-prettier": "~5.5.1", "prettier": "~3.6.2", "typescript": "~5.8.2", @@ -272,6 +273,177 @@ "node": ">=6.0.0" } }, + "node_modules/@andrewbranch/untar.js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@andrewbranch/untar.js/-/untar.js-1.0.3.tgz", + "integrity": "sha512-Jh15/qVmrLGhkKJBdXlK1+9tY4lZruYjsgkDFj08ZmDiWVBLJcqkok7Z0/R0In+i1rScBpJlSvrTS2Lm41Pbnw==", + "dev": true + }, + "node_modules/@arethetypeswrong/cli": { + "version": "0.18.2", + "resolved": "https://registry.npmjs.org/@arethetypeswrong/cli/-/cli-0.18.2.tgz", + "integrity": "sha512-PcFM20JNlevEDKBg4Re29Rtv2xvjvQZzg7ENnrWFSS0PHgdP2njibVFw+dRUhNkPgNfac9iUqO0ohAXqQL4hbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@arethetypeswrong/core": "0.18.2", + "chalk": "^4.1.2", + "cli-table3": "^0.6.3", + "commander": "^10.0.1", + "marked": "^9.1.2", + "marked-terminal": "^7.1.0", + "semver": "^7.5.4" + }, + "bin": { + "attw": "dist/index.js" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@arethetypeswrong/cli/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@arethetypeswrong/cli/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@arethetypeswrong/cli/node_modules/commander": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/@arethetypeswrong/cli/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@arethetypeswrong/cli/node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@arethetypeswrong/cli/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@arethetypeswrong/core": { + "version": "0.18.2", + "resolved": "https://registry.npmjs.org/@arethetypeswrong/core/-/core-0.18.2.tgz", + "integrity": "sha512-GiwTmBFOU1/+UVNqqCGzFJYfBXEytUkiI+iRZ6Qx7KmUVtLm00sYySkfe203C9QtPG11yOz1ZaMek8dT/xnlgg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@andrewbranch/untar.js": "^1.0.3", + "@loaderkit/resolve": "^1.0.2", + "cjs-module-lexer": "^1.2.3", + "fflate": "^0.8.2", + "lru-cache": "^11.0.1", + "semver": "^7.5.4", + "typescript": "5.6.1-rc", + "validate-npm-package-name": "^5.0.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@arethetypeswrong/core/node_modules/cjs-module-lexer": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz", + "integrity": "sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@arethetypeswrong/core/node_modules/lru-cache": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.1.0.tgz", + "integrity": "sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==", + "dev": true, + "license": "ISC", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/@arethetypeswrong/core/node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@arethetypeswrong/core/node_modules/typescript": { + "version": "5.6.1-rc", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.1-rc.tgz", + "integrity": "sha512-E3b2+1zEFu84jB0YQi9BORDjz9+jGbwwy1Zi3G0LUNw7a7cePUrHMRNy8aPh53nXpkFGVHSxIZo5vKTfYaFiBQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/@asamuzakjp/css-color": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-3.2.0.tgz", @@ -2323,6 +2495,12 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "node_modules/@braidai/lang": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@braidai/lang/-/lang-1.1.1.tgz", + "integrity": "sha512-5uM+no3i3DafVgkoW7ayPhEGHNNBZCSj5TrGDQt0ayEKQda5f3lAXlmQg0MR5E0gKgmTzUUEtSWHsEC3h9jUcg==", + "dev": true + }, "node_modules/@colors/colors": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", @@ -7797,6 +7975,16 @@ "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz", "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==" }, + "node_modules/@loaderkit/resolve": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@loaderkit/resolve/-/resolve-1.0.4.tgz", + "integrity": "sha512-rJzYKVcV4dxJv+vW6jlvagF8zvGxHJ2+HTr1e2qOejfmGhAApgJHl8Aog4mMszxceTRiKTTbnpgmTO1bEZHV/A==", + "dev": true, + "license": "ISC", + "dependencies": { + "@braidai/lang": "^1.0.0" + } + }, "node_modules/@maxgraph/core": { "resolved": "packages/core", "link": true @@ -15914,6 +16102,189 @@ "node": ">=8" } }, + "node_modules/cli-highlight": { + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", + "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", + "dev": true, + "license": "ISC", + "dependencies": { + "chalk": "^4.0.0", + "highlight.js": "^10.7.1", + "mz": "^2.4.0", + "parse5": "^5.1.1", + "parse5-htmlparser2-tree-adapter": "^6.0.0", + "yargs": "^16.0.0" + }, + "bin": { + "highlight": "bin/highlight" + }, + "engines": { + "node": ">=8.0.0", + "npm": ">=5.0.0" + } + }, + "node_modules/cli-highlight/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/cli-highlight/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/cli-highlight/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/cli-highlight/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/cli-highlight/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-highlight/node_modules/parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", + "dev": true, + "license": "MIT" + }, + "node_modules/cli-highlight/node_modules/parse5-htmlparser2-tree-adapter": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", + "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", + "dev": true, + "license": "MIT", + "dependencies": { + "parse5": "^6.0.1" + } + }, + "node_modules/cli-highlight/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", + "dev": true, + "license": "MIT" + }, + "node_modules/cli-highlight/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-highlight/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-highlight/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/cli-highlight/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cli-highlight/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, "node_modules/cli-spinners": { "version": "2.9.2", "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", @@ -15927,9 +16298,10 @@ } }, "node_modules/cli-table3": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz", - "integrity": "sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==", + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz", + "integrity": "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==", + "license": "MIT", "dependencies": { "string-width": "^4.2.0" }, @@ -18098,6 +18470,19 @@ "node": ">=4" } }, + "node_modules/environment": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", + "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -18473,6 +18858,35 @@ } } }, + "node_modules/eslint-compat-utils": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.5.1.tgz", + "integrity": "sha512-3z3vFexKIEnjHE3zCMRo6fn/e44U7T1khUjg+Hp0ZQMCigh28rALD0nPFBcGZuiLC5rLZa2ubQHDRln09JfU2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "eslint": ">=6.0.0" + } + }, + "node_modules/eslint-compat-utils/node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/eslint-config-prettier": { "version": "10.1.5", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.5.tgz", @@ -18535,6 +18949,28 @@ "ms": "^2.1.1" } }, + "node_modules/eslint-plugin-es-x": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es-x/-/eslint-plugin-es-x-7.8.0.tgz", + "integrity": "sha512-7Ds8+wAAoV3T+LAKeu39Y5BzXCrGKrcISfgKEqTS4BDN8SFEDQd0S43jiQ8vIa3wUKD07qitZdfzlenSi8/0qQ==", + "dev": true, + "funding": [ + "https://github.com/sponsors/ota-meshi", + "https://opencollective.com/eslint" + ], + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.1.2", + "@eslint-community/regexpp": "^4.11.0", + "eslint-compat-utils": "^0.5.1" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": ">=8" + } + }, "node_modules/eslint-plugin-import": { "version": "2.32.0", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.32.0.tgz", @@ -18611,6 +19047,60 @@ "node": "*" } }, + "node_modules/eslint-plugin-n": { + "version": "17.20.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-17.20.0.tgz", + "integrity": "sha512-IRSoatgB/NQJZG5EeTbv/iAx1byOGdbbyhQrNvWdCfTnmPxUT0ao9/eGOeG7ljD8wJBsxwE8f6tES5Db0FRKEw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.5.0", + "@typescript-eslint/utils": "^8.26.1", + "enhanced-resolve": "^5.17.1", + "eslint-plugin-es-x": "^7.8.0", + "get-tsconfig": "^4.8.1", + "globals": "^15.11.0", + "ignore": "^5.3.2", + "minimatch": "^9.0.5", + "semver": "^7.6.3", + "ts-declaration-location": "^1.0.6" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": ">=8.23.0" + } + }, + "node_modules/eslint-plugin-n/node_modules/globals": { + "version": "15.15.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.15.0.tgz", + "integrity": "sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint-plugin-n/node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/eslint-plugin-prettier": { "version": "5.5.1", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.1.tgz", @@ -19419,6 +19909,13 @@ "dev": true, "license": "MIT" }, + "node_modules/fflate": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", + "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", + "dev": true, + "license": "MIT" + }, "node_modules/figures": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", @@ -20158,6 +20655,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-tsconfig": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.10.1.tgz", + "integrity": "sha512-auHyJ4AgMz7vgS8Hp3N6HXSmlMdUyhSUrfBF16w153rxtLIEOE+HGqaBppczZvnHLqQJfiHotCYpNhl0lUROFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/giget": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/giget/-/giget-1.2.5.tgz", @@ -20760,6 +21270,16 @@ "he": "bin/he" } }, + "node_modules/highlight.js": { + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": "*" + } + }, "node_modules/history": { "version": "4.10.1", "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", @@ -21258,9 +21778,10 @@ ] }, "node_modules/ignore": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", - "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "license": "MIT", "engines": { "node": ">= 4" } @@ -26997,6 +27518,83 @@ "react": ">= 0.14.0" } }, + "node_modules/marked": { + "version": "9.1.6", + "resolved": "https://registry.npmjs.org/marked/-/marked-9.1.6.tgz", + "integrity": "sha512-jcByLnIFkd5gSXZmjNvS1TlmRhCXZjIzHYlaGkPlLIekG55JDR2Z4va9tZwCiP+/RDERiNhMOFu01xd6O5ct1Q==", + "dev": true, + "license": "MIT", + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 16" + } + }, + "node_modules/marked-terminal": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/marked-terminal/-/marked-terminal-7.3.0.tgz", + "integrity": "sha512-t4rBvPsHc57uE/2nJOLmMbZCQ4tgAccAED3ngXQqW6g+TxA488JzJ+FK3lQkzBQOI1mRV/r/Kq+1ZlJ4D0owQw==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^7.0.0", + "ansi-regex": "^6.1.0", + "chalk": "^5.4.1", + "cli-highlight": "^2.1.11", + "cli-table3": "^0.6.5", + "node-emoji": "^2.2.0", + "supports-hyperlinks": "^3.1.0" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "marked": ">=1 <16" + } + }, + "node_modules/marked-terminal/node_modules/ansi-escapes": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.0.0.tgz", + "integrity": "sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "environment": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/marked-terminal/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/marked-terminal/node_modules/chalk": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz", + "integrity": "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, "node_modules/math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", @@ -29642,6 +30240,18 @@ "multicast-dns": "cli.js" } }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, "node_modules/nanoid": { "version": "3.3.11", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", @@ -34115,6 +34725,16 @@ "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/responselike": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", @@ -35673,6 +36293,46 @@ "node": ">=4" } }, + "node_modules/supports-hyperlinks": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-3.2.0.tgz", + "integrity": "sha512-zFObLMyZeEwzAoKCyu1B91U79K2t7ApXuQfo8OuxwXLDgcKxuwM+YvcbIhm6QWqz7mHUH1TVytR1PwVVjEuMig==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">=14.18" + }, + "funding": { + "url": "https://github.com/chalk/supports-hyperlinks?sponsor=1" + } + }, + "node_modules/supports-hyperlinks/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-hyperlinks/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", @@ -36130,6 +36790,29 @@ "node": "*" } }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/thingies": { "version": "1.21.0", "resolved": "https://registry.npmjs.org/thingies/-/thingies-1.21.0.tgz", @@ -36393,6 +37076,42 @@ "typescript": ">=4.8.4" } }, + "node_modules/ts-declaration-location": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/ts-declaration-location/-/ts-declaration-location-1.0.7.tgz", + "integrity": "sha512-EDyGAwH1gO0Ausm9gV6T2nUvBgXT5kGoCMJPllOaooZ+4VvJiKBdZE7wK18N1deEowhcUptS+5GXZK8U/fvpwA==", + "dev": true, + "funding": [ + { + "type": "ko-fi", + "url": "https://ko-fi.com/rebeccastevens" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/ts-declaration-location" + } + ], + "license": "BSD-3-Clause", + "dependencies": { + "picomatch": "^4.0.2" + }, + "peerDependencies": { + "typescript": ">=4.0.0" + } + }, + "node_modules/ts-declaration-location/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/ts-dedent": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/ts-dedent/-/ts-dedent-2.2.0.tgz", @@ -37341,6 +38060,16 @@ "spdx-expression-parse": "^3.0.0" } }, + "node_modules/validate-npm-package-name": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.1.tgz", + "integrity": "sha512-OljLrQ9SQdOUqTaQxqL5dEfZWrXExyyWsozYlAWFawPVNuD83igl7uJD2RTkNMbniIYgt8l81eCJGIdQF7avLQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/value-equal": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", @@ -38560,6 +39289,7 @@ "version": "0.20.0", "license": "Apache-2.0", "devDependencies": { + "@arethetypeswrong/cli": "~0.18.2", "@swc/core": "~1.12.9", "@swc/jest": "~0.2.38", "jest": "~30.0.3", diff --git a/package.json b/package.json index 57d7e79dff..e89dd1ec5b 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "eslint": "~9.30.0", "eslint-config-prettier": "~10.1.5", "eslint-plugin-import": "~2.32.0", + "eslint-plugin-n": "~17.20.0", "eslint-plugin-prettier": "~5.5.1", "prettier": "~3.6.2", "typescript": "~5.8.2", diff --git a/packages/core/jest.config.cjs b/packages/core/jest.config.cjs index 6166ffc042..60a493e43a 100644 --- a/packages/core/jest.config.cjs +++ b/packages/core/jest.config.cjs @@ -36,4 +36,10 @@ module.exports = { }, ], }, + // maxGraph imports include a "js" extension which makes jest unable to resolve the imports + // So use this workaround to remove the ".js" extension from the module names + // Taken from https://github.com/swc-project/jest/issues/64#issuecomment-1029753225 + moduleNameMapper: { + '^(\\.{1,2}/.*)\\.js$': '$1', + }, }; diff --git a/packages/core/package.json b/packages/core/package.json index 1098387dba..93861c4e18 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -57,12 +57,14 @@ "build:esm": "tsc --version && tsc", "build:cjs": "tsc --version && tsc --outDir lib/cjs --module commonjs && node scripts/generate-cjs-package-json.mjs", "check:circular-dependencies": "madge --circular --extensions js lib", + "check:npm-package": "attw --pack", "docs:api": "typedoc src/index.ts", "prepack": "run-s clean build", "test": "jest --runInBand", "test-check": "tsc --noEmit --project tsconfig.test.json" }, "devDependencies": { + "@arethetypeswrong/cli": "~0.18.2", "@swc/core": "~1.12.9", "@swc/jest": "~0.2.38", "jest": "~30.0.3", diff --git a/packages/core/src/Client.ts b/packages/core/src/Client.ts index 398d363a96..2557a3e047 100644 --- a/packages/core/src/Client.ts +++ b/packages/core/src/Client.ts @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { NS_SVG } from './util/Constants'; +import { NS_SVG } from './util/Constants.js'; /** * @category Configuration diff --git a/packages/core/src/editor/Editor.ts b/packages/core/src/editor/Editor.ts index 36e21ac3f2..b04bd0e31d 100644 --- a/packages/core/src/editor/Editor.ts +++ b/packages/core/src/editor/Editor.ts @@ -16,51 +16,51 @@ See the License for the specific language governing permissions and limitations under the License. */ -import EditorPopupMenu from './EditorPopupMenu'; -import UndoManager from '../view/undoable_changes/UndoManager'; -import EditorKeyHandler from './EditorKeyHandler'; -import EventSource from '../view/event/EventSource'; -import Client from '../Client'; -import CompactTreeLayout from '../view/layout/CompactTreeLayout'; -import { EditorToolbar } from './EditorToolbar'; -import StackLayout from '../view/layout/StackLayout'; -import EventObject from '../view/event/EventObject'; -import { getOffset } from '../util/styleUtils'; -import Codec from '../serialization/Codec'; -import { ModelXmlSerializer } from '../serialization/ModelXmlSerializer'; -import MaxWindow from '../gui/MaxWindow'; -import MaxForm from '../gui/MaxForm'; -import Outline from '../view/other/Outline'; -import Cell from '../view/cell/Cell'; -import Geometry from '../view/geometry/Geometry'; -import { FONT_STYLE_MASK } from '../util/Constants'; -import type { AbstractGraph } from '../view/AbstractGraph'; -import { Graph } from '../view/Graph'; -import SwimlaneManager from '../view/layout/SwimlaneManager'; -import LayoutManager from '../view/layout/LayoutManager'; -import RootChange from '../view/undoable_changes/RootChange'; -import ValueChange from '../view/undoable_changes/ValueChange'; -import CellAttributeChange from '../view/undoable_changes/CellAttributeChange'; -import PrintPreview from '../view/other/PrintPreview'; -import Clipboard from '../util/Clipboard'; -import MaxLog from '../gui/MaxLog'; -import { isNode } from '../util/domUtils'; -import { getViewXml, getXml } from '../util/xmlUtils'; -import { load, post, submit } from '../util/requestUtils'; -import type PopupMenuHandler from '../view/plugins/PopupMenuHandler'; -import RubberBandHandler from '../view/plugins/RubberBandHandler'; -import InternalEvent from '../view/event/InternalEvent'; -import InternalMouseEvent from '../view/event/InternalMouseEvent'; -import { CellStateStyle, MouseListenerSet } from '../types'; -import type ConnectionHandler from '../view/plugins/ConnectionHandler'; -import { show } from '../util/printUtils'; -import type PanningHandler from '../view/plugins/PanningHandler'; -import { cloneCell } from '../util/cellArrayUtils'; -import type MaxPopupMenu from '../gui/MaxPopupMenu'; -import { isNullish } from '../internal/utils'; -import { isI18nEnabled, translate } from '../internal/i18n-utils'; -import { error } from '../gui/guiUtils'; -import type { FitPlugin } from '../view/plugins'; +import EditorPopupMenu from './EditorPopupMenu.js'; +import UndoManager from '../view/undoable_changes/UndoManager.js'; +import EditorKeyHandler from './EditorKeyHandler.js'; +import EventSource from '../view/event/EventSource.js'; +import Client from '../Client.js'; +import CompactTreeLayout from '../view/layout/CompactTreeLayout.js'; +import { EditorToolbar } from './EditorToolbar.js'; +import StackLayout from '../view/layout/StackLayout.js'; +import EventObject from '../view/event/EventObject.js'; +import { getOffset } from '../util/styleUtils.js'; +import Codec from '../serialization/Codec.js'; +import { ModelXmlSerializer } from '../serialization/ModelXmlSerializer.js'; +import MaxWindow from '../gui/MaxWindow.js'; +import MaxForm from '../gui/MaxForm.js'; +import Outline from '../view/other/Outline.js'; +import Cell from '../view/cell/Cell.js'; +import Geometry from '../view/geometry/Geometry.js'; +import { FONT_STYLE_MASK } from '../util/Constants.js'; +import type { AbstractGraph } from '../view/AbstractGraph.js'; +import { Graph } from '../view/Graph.js'; +import SwimlaneManager from '../view/layout/SwimlaneManager.js'; +import LayoutManager from '../view/layout/LayoutManager.js'; +import RootChange from '../view/undoable_changes/RootChange.js'; +import ValueChange from '../view/undoable_changes/ValueChange.js'; +import CellAttributeChange from '../view/undoable_changes/CellAttributeChange.js'; +import PrintPreview from '../view/other/PrintPreview.js'; +import Clipboard from '../util/Clipboard.js'; +import MaxLog from '../gui/MaxLog.js'; +import { isNode } from '../util/domUtils.js'; +import { getViewXml, getXml } from '../util/xmlUtils.js'; +import { load, post, submit } from '../util/requestUtils.js'; +import type PopupMenuHandler from '../view/plugins/PopupMenuHandler.js'; +import RubberBandHandler from '../view/plugins/RubberBandHandler.js'; +import InternalEvent from '../view/event/InternalEvent.js'; +import InternalMouseEvent from '../view/event/InternalMouseEvent.js'; +import { CellStateStyle, MouseListenerSet } from '../types.js'; +import type ConnectionHandler from '../view/plugins/ConnectionHandler.js'; +import { show } from '../util/printUtils.js'; +import type PanningHandler from '../view/plugins/PanningHandler.js'; +import { cloneCell } from '../util/cellArrayUtils.js'; +import type MaxPopupMenu from '../gui/MaxPopupMenu.js'; +import { isNullish } from '../internal/utils.js'; +import { isI18nEnabled, translate } from '../internal/i18n-utils.js'; +import { error } from '../gui/guiUtils.js'; +import type { FitPlugin } from '../view/plugins/index.js'; /** * Extends {@link EventSource} to implement an application wrapper for a graph that diff --git a/packages/core/src/editor/EditorKeyHandler.ts b/packages/core/src/editor/EditorKeyHandler.ts index 154745068d..a8d34fde1e 100644 --- a/packages/core/src/editor/EditorKeyHandler.ts +++ b/packages/core/src/editor/EditorKeyHandler.ts @@ -16,10 +16,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import InternalEvent from '../view/event/InternalEvent'; -import EventObject from '../view/event/EventObject'; -import KeyHandler from '../view/handler/KeyHandler'; -import Editor from './Editor'; +import InternalEvent from '../view/event/InternalEvent.js'; +import EventObject from '../view/event/EventObject.js'; +import KeyHandler from '../view/handler/KeyHandler.js'; +import Editor from './Editor.js'; /** * Binds keycodes to action names in an editor. diff --git a/packages/core/src/editor/EditorPopupMenu.ts b/packages/core/src/editor/EditorPopupMenu.ts index 9ea6295d51..4694fb1ad6 100644 --- a/packages/core/src/editor/EditorPopupMenu.ts +++ b/packages/core/src/editor/EditorPopupMenu.ts @@ -16,13 +16,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Cell from '../view/cell/Cell'; -import MaxPopupMenu from '../gui/MaxPopupMenu'; -import { getTextContent } from '../util/domUtils'; -import Editor from './Editor'; -import { PopupMenuItem } from '../types'; -import { doEval, isNullish } from '../internal/utils'; -import { translate } from '../internal/i18n-utils'; +import Cell from '../view/cell/Cell.js'; +import MaxPopupMenu from '../gui/MaxPopupMenu.js'; +import { getTextContent } from '../util/domUtils.js'; +import Editor from './Editor.js'; +import { PopupMenuItem } from '../types.js'; +import { doEval, isNullish } from '../internal/utils.js'; +import { translate } from '../internal/i18n-utils.js'; /** * Creates popupmenus for mouse events. diff --git a/packages/core/src/editor/EditorToolbar.ts b/packages/core/src/editor/EditorToolbar.ts index ee9fcc7461..137ac7c066 100644 --- a/packages/core/src/editor/EditorToolbar.ts +++ b/packages/core/src/editor/EditorToolbar.ts @@ -16,19 +16,18 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Client from '../Client'; -import MaxToolbar from '../gui/MaxToolbar'; -import Geometry from '../view/geometry/Geometry'; -import { convertPoint } from '../util/styleUtils'; -import InternalEvent from '../view/event/InternalEvent'; -import { getClientX, getClientY } from '../util/EventUtils'; -import { makeDraggable } from '../util/gestureUtils'; -import Editor from './Editor'; -import type Cell from '../view/cell/Cell'; -import type { AbstractGraph } from '../view/AbstractGraph'; -import EventObject from '../view/event/EventObject'; - -import type { DropHandler } from '../types'; +import Client from '../Client.js'; +import MaxToolbar from '../gui/MaxToolbar.js'; +import Geometry from '../view/geometry/Geometry.js'; +import { convertPoint } from '../util/styleUtils.js'; +import InternalEvent from '../view/event/InternalEvent.js'; +import { getClientX, getClientY } from '../util/EventUtils.js'; +import { makeDraggable } from '../util/gestureUtils.js'; +import Editor from './Editor.js'; +import type Cell from '../view/cell/Cell.js'; +import type { AbstractGraph } from '../view/AbstractGraph.js'; +import EventObject from '../view/event/EventObject.js'; +import type { DropHandler } from '../types.js'; /** * Toolbar for the editor. diff --git a/packages/core/src/gui/MaxForm.ts b/packages/core/src/gui/MaxForm.ts index db3238cbe5..bc5ac383fb 100644 --- a/packages/core/src/gui/MaxForm.ts +++ b/packages/core/src/gui/MaxForm.ts @@ -16,11 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Client from '../Client'; -import InternalEvent from '../view/event/InternalEvent'; -import { write, writeln } from '../util/domUtils'; +import Client from '../Client.js'; +import InternalEvent from '../view/event/InternalEvent.js'; +import { write, writeln } from '../util/domUtils.js'; -import { translate } from '../internal/i18n-utils'; +import { translate } from '../internal/i18n-utils.js'; /** * A simple class for creating HTML forms. diff --git a/packages/core/src/gui/MaxLog.ts b/packages/core/src/gui/MaxLog.ts index 9d996fa551..eed57a85f1 100644 --- a/packages/core/src/gui/MaxLog.ts +++ b/packages/core/src/gui/MaxLog.ts @@ -16,16 +16,16 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Client from '../Client'; -import InternalEvent from '../view/event/InternalEvent'; -import { getInnerHtml, write } from '../util/domUtils'; -import { toString } from '../util/StringUtils'; -import MaxWindow from './MaxWindow'; -import { KeyboardEventListener, MouseEventListener } from '../types'; -import { getElapseMillisecondsMessage } from '../internal/time-utils'; -import { VERSION } from '../util/Constants'; -import { GlobalConfig } from '../util/config'; -import { popup } from './guiUtils'; +import Client from '../Client.js'; +import InternalEvent from '../view/event/InternalEvent.js'; +import { getInnerHtml, write } from '../util/domUtils.js'; +import { toString } from '../util/StringUtils.js'; +import MaxWindow from './MaxWindow.js'; +import { KeyboardEventListener, MouseEventListener } from '../types.js'; +import { getElapseMillisecondsMessage } from '../internal/time-utils.js'; +import { VERSION } from '../util/Constants.js'; +import { GlobalConfig } from '../util/config.js'; +import { popup } from './guiUtils.js'; const copyTextToClipboard = (text: string): void => { navigator.clipboard.writeText(text).then( diff --git a/packages/core/src/gui/MaxLogAsLogger.ts b/packages/core/src/gui/MaxLogAsLogger.ts index 9ad9e3d80f..ce6860a6a8 100644 --- a/packages/core/src/gui/MaxLogAsLogger.ts +++ b/packages/core/src/gui/MaxLogAsLogger.ts @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { Logger } from '../types'; -import MaxLog from './MaxLog'; +import { Logger } from '../types.js'; +import MaxLog from './MaxLog.js'; /** * A {@link Logger} that uses {@link MaxLog} to log messages. diff --git a/packages/core/src/gui/MaxPopupMenu.ts b/packages/core/src/gui/MaxPopupMenu.ts index ec3d23e1b2..584242dd49 100644 --- a/packages/core/src/gui/MaxPopupMenu.ts +++ b/packages/core/src/gui/MaxPopupMenu.ts @@ -16,16 +16,16 @@ See the License for the specific language governing permissions and limitations under the License. */ -import EventSource from '../view/event/EventSource'; -import { fit, getDocumentScrollOrigin } from '../util/styleUtils'; -import EventObject from '../view/event/EventObject'; -import Client from '../Client'; -import InternalEvent from '../view/event/InternalEvent'; -import { write } from '../util/domUtils'; -import { isLeftMouseButton } from '../util/EventUtils'; -import Cell from '../view/cell/Cell'; -import InternalMouseEvent from '../view/event/InternalMouseEvent'; -import type { PopupMenuItem } from '../types'; +import EventSource from '../view/event/EventSource.js'; +import { fit, getDocumentScrollOrigin } from '../util/styleUtils.js'; +import EventObject from '../view/event/EventObject.js'; +import Client from '../Client.js'; +import InternalEvent from '../view/event/InternalEvent.js'; +import { write } from '../util/domUtils.js'; +import { isLeftMouseButton } from '../util/EventUtils.js'; +import Cell from '../view/cell/Cell.js'; +import InternalMouseEvent from '../view/event/InternalMouseEvent.js'; +import type { PopupMenuItem } from '../types.js'; /** * Basic popup menu. diff --git a/packages/core/src/gui/MaxToolbar.ts b/packages/core/src/gui/MaxToolbar.ts index b3cbc8ec0b..b0b6bc12e2 100644 --- a/packages/core/src/gui/MaxToolbar.ts +++ b/packages/core/src/gui/MaxToolbar.ts @@ -16,15 +16,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -import InternalEvent from '../view/event/InternalEvent'; -import Point from '../view/geometry/Point'; -import MaxPopupMenu from './MaxPopupMenu'; -import EventSource from '../view/event/EventSource'; -import EventObject from '../view/event/EventObject'; -import Client from '../Client'; -import { br, write, writeln } from '../util/domUtils'; -import Cell from '../view/cell/Cell'; -import { KeyboardEventListener, MouseEventListener, PopupMenuItem } from '../types'; +import InternalEvent from '../view/event/InternalEvent.js'; +import Point from '../view/geometry/Point.js'; +import MaxPopupMenu from './MaxPopupMenu.js'; +import EventSource from '../view/event/EventSource.js'; +import EventObject from '../view/event/EventObject.js'; +import Client from '../Client.js'; +import { br, write, writeln } from '../util/domUtils.js'; +import Cell from '../view/cell/Cell.js'; +import { KeyboardEventListener, MouseEventListener, PopupMenuItem } from '../types.js'; interface HTMLSelectOptionWithFunct extends HTMLOptionElement { funct?: (evt: any) => void; diff --git a/packages/core/src/gui/MaxWindow.ts b/packages/core/src/gui/MaxWindow.ts index 0b6d9408eb..bc93f41396 100644 --- a/packages/core/src/gui/MaxWindow.ts +++ b/packages/core/src/gui/MaxWindow.ts @@ -16,15 +16,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Rectangle from '../view/geometry/Rectangle'; -import EventObject from '../view/event/EventObject'; -import EventSource from '../view/event/EventSource'; -import { fit, getCurrentStyle } from '../util/styleUtils'; -import InternalEvent from '../view/event/InternalEvent'; -import Client from '../Client'; -import { NODE_TYPE } from '../util/Constants'; -import { write } from '../util/domUtils'; -import { getClientX, getClientY } from '../util/EventUtils'; +import Rectangle from '../view/geometry/Rectangle.js'; +import EventObject from '../view/event/EventObject.js'; +import EventSource from '../view/event/EventSource.js'; +import { fit, getCurrentStyle } from '../util/styleUtils.js'; +import InternalEvent from '../view/event/InternalEvent.js'; +import Client from '../Client.js'; +import { NODE_TYPE } from '../util/Constants.js'; +import { write } from '../util/domUtils.js'; +import { getClientX, getClientY } from '../util/EventUtils.js'; let activeWindow: MaxWindow | null = null; diff --git a/packages/core/src/gui/guiUtils.ts b/packages/core/src/gui/guiUtils.ts index 2eff96f1a3..250201322c 100644 --- a/packages/core/src/gui/guiUtils.ts +++ b/packages/core/src/gui/guiUtils.ts @@ -16,12 +16,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { htmlEntities } from '../util/StringUtils'; -import Client from '../Client'; -import { br, write } from '../util/domUtils'; -import { translate } from '../internal/i18n-utils'; -import InternalEvent from '../view/event/InternalEvent'; -import MaxWindow from './MaxWindow'; +import { htmlEntities } from '../util/StringUtils.js'; +import Client from '../Client.js'; +import { br, write } from '../util/domUtils.js'; +import { translate } from '../internal/i18n-utils.js'; +import InternalEvent from '../view/event/InternalEvent.js'; +import MaxWindow from './MaxWindow.js'; /** * Shows the specified text content in a new {@link MaxWindow} or a new browser window if `isInternalWindow` is `false`. diff --git a/packages/core/src/i18n/Translations.ts b/packages/core/src/i18n/Translations.ts index 43361128c7..a3dbdb0da2 100644 --- a/packages/core/src/i18n/Translations.ts +++ b/packages/core/src/i18n/Translations.ts @@ -16,13 +16,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Client from '../Client'; -import { NONE } from '../util/Constants'; -import type MaxXmlRequest from '../util/MaxXmlRequest'; -import { get, load } from '../util/requestUtils'; -import { TranslationsConfig } from './config'; -import { isNullish } from '../internal/utils'; -import { I18nProvider } from '../types'; +import Client from '../Client.js'; +import { NONE } from '../util/Constants.js'; +import type MaxXmlRequest from '../util/MaxXmlRequest.js'; +import { get, load } from '../util/requestUtils.js'; +import { TranslationsConfig } from './config.js'; +import { isNullish } from '../internal/utils.js'; +import { I18nProvider } from '../types.js'; // mxGraph source code: https://github.com/jgraph/mxgraph/blob/v4.2.2/javascript/src/js/util/mxResources.js diff --git a/packages/core/src/i18n/config.ts b/packages/core/src/i18n/config.ts index 28968f3672..57e7a368d1 100644 --- a/packages/core/src/i18n/config.ts +++ b/packages/core/src/i18n/config.ts @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { isNullish } from '../internal/utils'; -import { shallowCopy } from '../internal/clone-utils'; +import { isNullish } from '../internal/utils.js'; +import { shallowCopy } from '../internal/clone-utils.js'; function getNavigatorLanguage() { return typeof window !== 'undefined' ? navigator.language : 'en'; diff --git a/packages/core/src/i18n/provider.ts b/packages/core/src/i18n/provider.ts index 6fa57ac214..69945664d3 100644 --- a/packages/core/src/i18n/provider.ts +++ b/packages/core/src/i18n/provider.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { I18nProvider } from '../types'; +import { I18nProvider } from '../types.js'; /** * A {@link I18nProvider} that does nothing. diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 445c20a47e..1c1e05b3f7 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -15,245 +15,245 @@ limitations under the License. */ // Contribution of Mixins to the Graph type (no side effects, types only) -import './view/mixins/_graph-mixins-types'; - -export { AbstractGraph } from './view/AbstractGraph'; -export { BaseGraph } from './view/BaseGraph'; -export { Graph } from './view/Graph'; -export * from './view/plugins'; - -export { GraphDataModel } from './view/GraphDataModel'; -export { GraphView } from './view/GraphView'; -export { default as LayoutManager } from './view/layout/LayoutManager'; -export { default as Outline } from './view/other/Outline'; -export { default as PrintPreview } from './view/other/PrintPreview'; -export { default as SwimlaneManager } from './view/layout/SwimlaneManager'; -export { default as Client } from './Client'; - -export { default as CellAttributeChange } from './view/undoable_changes/CellAttributeChange'; -export { ChildChange } from './view/undoable_changes/ChildChange'; -export { default as CollapseChange } from './view/undoable_changes/CollapseChange'; -export { default as CurrentRootChange } from './view/undoable_changes/CurrentRootChange'; -export { default as GeometryChange } from './view/undoable_changes/GeometryChange'; -export { RootChange } from './view/undoable_changes/RootChange'; -export { default as SelectionChange } from './view/undoable_changes/SelectionChange'; -export { default as StyleChange } from './view/undoable_changes/StyleChange'; -export { TerminalChange } from './view/undoable_changes/TerminalChange'; -export { default as ValueChange } from './view/undoable_changes/ValueChange'; -export { default as VisibleChange } from './view/undoable_changes/VisibleChange'; - -export { EditorKeyHandler } from './editor/EditorKeyHandler'; -export { EditorPopupMenu } from './editor/EditorPopupMenu'; -export { EditorToolbar } from './editor/EditorToolbar'; -export { Editor } from './editor/Editor'; - -export { default as CellHighlight } from './view/cell/CellHighlight'; -export { default as CellMarker } from './view/cell/CellMarker'; -export { default as CellTracker } from './view/cell/CellTracker'; -export { default as ConstraintHandler } from './view/handler/ConstraintHandler'; -export { default as EdgeHandler } from './view/handler/EdgeHandler'; -export { default as EdgeSegmentHandler } from './view/handler/EdgeSegmentHandler'; -export { default as ElbowEdgeHandler } from './view/handler/ElbowEdgeHandler'; -export { default as VertexHandle } from './view/cell/VertexHandle'; -export { default as KeyHandler } from './view/handler/KeyHandler'; -export { default as VertexHandler } from './view/handler/VertexHandler'; -export * from './view/handler/config'; - -export { default as CircleLayout } from './view/layout/CircleLayout'; -export { default as CompactTreeLayout } from './view/layout/CompactTreeLayout'; -export { default as CompositeLayout } from './view/layout/CompositeLayout'; -export { default as EdgeLabelLayout } from './view/layout/EdgeLabelLayout'; -export { default as FastOrganicLayout } from './view/layout/FastOrganicLayout'; -export { default as GraphLayout } from './view/layout/GraphLayout'; -export { default as ParallelEdgeLayout } from './view/layout/ParallelEdgeLayout'; -export { default as PartitionLayout } from './view/layout/PartitionLayout'; -export { default as RadialTreeLayout } from './view/layout/RadialTreeLayout'; -export { default as StackLayout } from './view/layout/StackLayout'; - -export { default as HierarchicalEdgeStyle } from './view/layout/datatypes/HierarchicalEdgeStyle'; -export { default as HierarchicalLayout } from './view/layout/HierarchicalLayout'; -export { default as SwimlaneLayout } from './view/layout/SwimlaneLayout'; - -export { default as GraphAbstractHierarchyCell } from './view/layout/datatypes/GraphAbstractHierarchyCell'; -export { default as GraphHierarchyEdge } from './view/layout/datatypes/GraphHierarchyEdge'; -export { default as GraphHierarchyModel } from './view/layout/hierarchical/GraphHierarchyModel'; -export { default as GraphHierarchyNode } from './view/layout/datatypes/GraphHierarchyNode'; -export { default as SwimlaneModel } from './view/layout/hierarchical/SwimlaneModel'; - -export { default as CoordinateAssignment } from './view/layout/hierarchical/CoordinateAssignment'; -export { default as HierarchicalLayoutStage } from './view/layout/hierarchical/HierarchicalLayoutStage'; -export { default as MedianHybridCrossingReduction } from './view/layout/hierarchical/MedianHybridCrossingReduction'; -export { default as MinimumCycleRemover } from './view/layout/hierarchical/MinimumCycleRemover'; -export { default as SwimlaneOrdering } from './view/layout/hierarchical/SwimlaneOrdering'; - -export { default as Codec } from './serialization/Codec'; -export { default as CodecRegistry } from './serialization/CodecRegistry'; -export { default as ObjectCodec } from './serialization/ObjectCodec'; -export * from './serialization/ModelXmlSerializer'; -export * from './serialization/codecs/_model-codecs'; -export * from './serialization/codecs/_other-codecs'; -export * from './serialization/register-model-codecs'; -export * from './serialization/register-other-codecs'; - -export { default as ActorShape } from './view/shape/node/ActorShape'; -export { default as LabelShape } from './view/shape/node/LabelShape'; -export { default as Shape } from './view/shape/Shape'; -export { default as SwimlaneShape } from './view/shape/node/SwimlaneShape'; -export { default as TextShape } from './view/shape/node/TextShape'; -export { default as TriangleShape } from './view/shape/node/TriangleShape'; - -export { default as ArrowShape } from './view/shape/edge/ArrowShape'; -export { default as ArrowConnectorShape } from './view/shape/edge/ArrowConnectorShape'; -export { default as ConnectorShape } from './view/shape/edge/ConnectorShape'; -export { default as LineShape } from './view/shape/edge/LineShape'; -export { default as PolylineShape } from './view/shape/edge/PolylineShape'; - -export { default as CloudShape } from './view/shape/node/CloudShape'; -export { default as CylinderShape } from './view/shape/node/CylinderShape'; -export { default as DoubleEllipseShape } from './view/shape/node/DoubleEllipseShape'; -export { default as EllipseShape } from './view/shape/node/EllipseShape'; -export { default as HexagonShape } from './view/shape/node/HexagonShape'; -export { default as ImageShape } from './view/shape/node/ImageShape'; -export { default as RectangleShape } from './view/shape/node/RectangleShape'; -export { default as RhombusShape } from './view/shape/node/RhombusShape'; -export * from './view/shape/ShapeRegistry'; -export * from './view/shape/register-shapes'; - -export { unregisterAllStencilShapes } from './view/shape/stencil/register'; +import './view/mixins/_graph-mixins-types.js'; + +export { AbstractGraph } from './view/AbstractGraph.js'; +export { BaseGraph } from './view/BaseGraph.js'; +export { Graph } from './view/Graph.js'; +export * from './view/plugins/index.js'; + +export { GraphDataModel } from './view/GraphDataModel.js'; +export { GraphView } from './view/GraphView.js'; +export { default as LayoutManager } from './view/layout/LayoutManager.js'; +export { default as Outline } from './view/other/Outline.js'; +export { default as PrintPreview } from './view/other/PrintPreview.js'; +export { default as SwimlaneManager } from './view/layout/SwimlaneManager.js'; +export { default as Client } from './Client.js'; + +export { default as CellAttributeChange } from './view/undoable_changes/CellAttributeChange.js'; +export { ChildChange } from './view/undoable_changes/ChildChange.js'; +export { default as CollapseChange } from './view/undoable_changes/CollapseChange.js'; +export { default as CurrentRootChange } from './view/undoable_changes/CurrentRootChange.js'; +export { default as GeometryChange } from './view/undoable_changes/GeometryChange.js'; +export { RootChange } from './view/undoable_changes/RootChange.js'; +export { default as SelectionChange } from './view/undoable_changes/SelectionChange.js'; +export { default as StyleChange } from './view/undoable_changes/StyleChange.js'; +export { TerminalChange } from './view/undoable_changes/TerminalChange.js'; +export { default as ValueChange } from './view/undoable_changes/ValueChange.js'; +export { default as VisibleChange } from './view/undoable_changes/VisibleChange.js'; + +export { EditorKeyHandler } from './editor/EditorKeyHandler.js'; +export { EditorPopupMenu } from './editor/EditorPopupMenu.js'; +export { EditorToolbar } from './editor/EditorToolbar.js'; +export { Editor } from './editor/Editor.js'; + +export { default as CellHighlight } from './view/cell/CellHighlight.js'; +export { default as CellMarker } from './view/cell/CellMarker.js'; +export { default as CellTracker } from './view/cell/CellTracker.js'; +export { default as ConstraintHandler } from './view/handler/ConstraintHandler.js'; +export { default as EdgeHandler } from './view/handler/EdgeHandler.js'; +export { default as EdgeSegmentHandler } from './view/handler/EdgeSegmentHandler.js'; +export { default as ElbowEdgeHandler } from './view/handler/ElbowEdgeHandler.js'; +export { default as VertexHandle } from './view/cell/VertexHandle.js'; +export { default as KeyHandler } from './view/handler/KeyHandler.js'; +export { default as VertexHandler } from './view/handler/VertexHandler.js'; +export * from './view/handler/config.js'; + +export { default as CircleLayout } from './view/layout/CircleLayout.js'; +export { default as CompactTreeLayout } from './view/layout/CompactTreeLayout.js'; +export { default as CompositeLayout } from './view/layout/CompositeLayout.js'; +export { default as EdgeLabelLayout } from './view/layout/EdgeLabelLayout.js'; +export { default as FastOrganicLayout } from './view/layout/FastOrganicLayout.js'; +export { default as GraphLayout } from './view/layout/GraphLayout.js'; +export { default as ParallelEdgeLayout } from './view/layout/ParallelEdgeLayout.js'; +export { default as PartitionLayout } from './view/layout/PartitionLayout.js'; +export { default as RadialTreeLayout } from './view/layout/RadialTreeLayout.js'; +export { default as StackLayout } from './view/layout/StackLayout.js'; + +export { default as HierarchicalEdgeStyle } from './view/layout/datatypes/HierarchicalEdgeStyle.js'; +export { default as HierarchicalLayout } from './view/layout/HierarchicalLayout.js'; +export { default as SwimlaneLayout } from './view/layout/SwimlaneLayout.js'; + +export { default as GraphAbstractHierarchyCell } from './view/layout/datatypes/GraphAbstractHierarchyCell.js'; +export { default as GraphHierarchyEdge } from './view/layout/datatypes/GraphHierarchyEdge.js'; +export { default as GraphHierarchyModel } from './view/layout/hierarchical/GraphHierarchyModel.js'; +export { default as GraphHierarchyNode } from './view/layout/datatypes/GraphHierarchyNode.js'; +export { default as SwimlaneModel } from './view/layout/hierarchical/SwimlaneModel.js'; + +export { default as CoordinateAssignment } from './view/layout/hierarchical/CoordinateAssignment.js'; +export { default as HierarchicalLayoutStage } from './view/layout/hierarchical/HierarchicalLayoutStage.js'; +export { default as MedianHybridCrossingReduction } from './view/layout/hierarchical/MedianHybridCrossingReduction.js'; +export { default as MinimumCycleRemover } from './view/layout/hierarchical/MinimumCycleRemover.js'; +export { default as SwimlaneOrdering } from './view/layout/hierarchical/SwimlaneOrdering.js'; + +export { default as Codec } from './serialization/Codec.js'; +export { default as CodecRegistry } from './serialization/CodecRegistry.js'; +export { default as ObjectCodec } from './serialization/ObjectCodec.js'; +export * from './serialization/ModelXmlSerializer.js'; +export * from './serialization/codecs/_model-codecs.js'; +export * from './serialization/codecs/_other-codecs.js'; +export * from './serialization/register-model-codecs.js'; +export * from './serialization/register-other-codecs.js'; + +export { default as ActorShape } from './view/shape/node/ActorShape.js'; +export { default as LabelShape } from './view/shape/node/LabelShape.js'; +export { default as Shape } from './view/shape/Shape.js'; +export { default as SwimlaneShape } from './view/shape/node/SwimlaneShape.js'; +export { default as TextShape } from './view/shape/node/TextShape.js'; +export { default as TriangleShape } from './view/shape/node/TriangleShape.js'; + +export { default as ArrowShape } from './view/shape/edge/ArrowShape.js'; +export { default as ArrowConnectorShape } from './view/shape/edge/ArrowConnectorShape.js'; +export { default as ConnectorShape } from './view/shape/edge/ConnectorShape.js'; +export { default as LineShape } from './view/shape/edge/LineShape.js'; +export { default as PolylineShape } from './view/shape/edge/PolylineShape.js'; + +export { default as CloudShape } from './view/shape/node/CloudShape.js'; +export { default as CylinderShape } from './view/shape/node/CylinderShape.js'; +export { default as DoubleEllipseShape } from './view/shape/node/DoubleEllipseShape.js'; +export { default as EllipseShape } from './view/shape/node/EllipseShape.js'; +export { default as HexagonShape } from './view/shape/node/HexagonShape.js'; +export { default as ImageShape } from './view/shape/node/ImageShape.js'; +export { default as RectangleShape } from './view/shape/node/RectangleShape.js'; +export { default as RhombusShape } from './view/shape/node/RhombusShape.js'; +export * from './view/shape/ShapeRegistry.js'; +export * from './view/shape/register-shapes.js'; + +export { unregisterAllStencilShapes } from './view/shape/stencil/register.js'; export { default as StencilShape, StencilShapeConfig, -} from './view/shape/stencil/StencilShape'; -export * from './view/shape/stencil/StencilShapeRegistry'; +} from './view/shape/stencil/StencilShape.js'; +export * from './view/shape/stencil/StencilShapeRegistry.js'; -export { default as Guide } from './view/other/Guide'; +export { default as Guide } from './view/other/Guide.js'; -export { default as Translations, TranslationsAsI18n } from './i18n/Translations'; -export * from './i18n/config'; -export * from './i18n/provider'; +export { default as Translations, TranslationsAsI18n } from './i18n/Translations.js'; +export * from './i18n/config.js'; +export * from './i18n/provider.js'; /** * @category Utils */ -export * as cellArrayUtils from './util/cellArrayUtils'; +export * as cellArrayUtils from './util/cellArrayUtils.js'; /** * @category Utils */ -export * as cloneUtils from './util/cloneUtils'; +export * as cloneUtils from './util/cloneUtils.js'; /** * @category Utils */ -export * as constants from './util/Constants'; +export * as constants from './util/Constants.js'; /** * @category GUI * @category Utils */ -export * as DomHelpers from './util/domHelpers'; +export * as DomHelpers from './util/domHelpers.js'; /** * @category Utils */ -export * as domUtils from './util/domUtils'; +export * as domUtils from './util/domUtils.js'; /** * @category Event * @category Utils */ -export * as eventUtils from './util/EventUtils'; +export * as eventUtils from './util/EventUtils.js'; /** * @category Utils */ -export * as gestureUtils from './util/gestureUtils'; +export * as gestureUtils from './util/gestureUtils.js'; /** * @category Utils */ -export * as mathUtils from './util/mathUtils'; +export * as mathUtils from './util/mathUtils.js'; /** * @category Utils */ -export * as printUtils from './util/printUtils'; +export * as printUtils from './util/printUtils.js'; /** * @category Utils */ -export * as stringUtils from './util/StringUtils'; +export * as stringUtils from './util/StringUtils.js'; /** * @category Utils */ -export * as styleUtils from './util/styleUtils'; +export * as styleUtils from './util/styleUtils.js'; /** * @category Utils */ -export * as xmlUtils from './util/xmlUtils'; - -export * from './util/config'; -export * from './util/logger'; - -export { default as Animation } from './view/animate/Animation'; -export { default as Effects } from './view/animate/Effects'; -export { default as Morphing } from './view/animate/Morphing'; - -export { default as AbstractCanvas2D } from './view/canvas/AbstractCanvas2D'; -export { default as SvgCanvas2D } from './view/canvas/SvgCanvas2D'; -export { default as XmlCanvas2D } from './view/canvas/XmlCanvas2D'; - -export { default as Geometry } from './view/geometry/Geometry'; -export { default as ObjectIdentity } from './util/ObjectIdentity'; -export { default as Point } from './view/geometry/Point'; -export { default as Rectangle } from './view/geometry/Rectangle'; - -export * from './view/style/builtin-style-elements'; -export * from './view/style/config'; -export * from './view/style/register'; -export * from './view/style/edge/EdgeStyleRegistry'; -export { EdgeMarkerRegistry } from './view/style/marker/EdgeMarkerRegistry'; -export { PerimeterRegistry } from './view/style/perimeter/PerimeterRegistry'; -export { Stylesheet } from './view/style/Stylesheet'; - -export { default as DragSource } from './view/other/DragSource'; -export { default as PanningManager } from './view/other/PanningManager'; - -export { default as InternalEvent } from './view/event/InternalEvent'; -export { default as EventObject } from './view/event/EventObject'; -export { default as EventSource } from './view/event/EventSource'; -export { default as InternalMouseEvent } from './view/event/InternalMouseEvent'; - -export { default as MaxForm } from './gui/MaxForm'; -export { default as MaxLog } from './gui/MaxLog'; -export { MaxLogAsLogger } from './gui/MaxLogAsLogger'; -export { default as MaxPopupMenu } from './gui/MaxPopupMenu'; -export { default as MaxToolbar } from './gui/MaxToolbar'; -export { default as MaxWindow } from './gui/MaxWindow'; +export * as xmlUtils from './util/xmlUtils.js'; + +export * from './util/config.js'; +export * from './util/logger.js'; + +export { default as Animation } from './view/animate/Animation.js'; +export { default as Effects } from './view/animate/Effects.js'; +export { default as Morphing } from './view/animate/Morphing.js'; + +export { default as AbstractCanvas2D } from './view/canvas/AbstractCanvas2D.js'; +export { default as SvgCanvas2D } from './view/canvas/SvgCanvas2D.js'; +export { default as XmlCanvas2D } from './view/canvas/XmlCanvas2D.js'; + +export { default as Geometry } from './view/geometry/Geometry.js'; +export { default as ObjectIdentity } from './util/ObjectIdentity.js'; +export { default as Point } from './view/geometry/Point.js'; +export { default as Rectangle } from './view/geometry/Rectangle.js'; + +export * from './view/style/builtin-style-elements.js'; +export * from './view/style/config.js'; +export * from './view/style/register.js'; +export * from './view/style/edge/EdgeStyleRegistry.js'; +export { EdgeMarkerRegistry } from './view/style/marker/EdgeMarkerRegistry.js'; +export { PerimeterRegistry } from './view/style/perimeter/PerimeterRegistry.js'; +export { Stylesheet } from './view/style/Stylesheet.js'; + +export { default as DragSource } from './view/other/DragSource.js'; +export { default as PanningManager } from './view/other/PanningManager.js'; + +export { default as InternalEvent } from './view/event/InternalEvent.js'; +export { default as EventObject } from './view/event/EventObject.js'; +export { default as EventSource } from './view/event/EventSource.js'; +export { default as InternalMouseEvent } from './view/event/InternalMouseEvent.js'; + +export { default as MaxForm } from './gui/MaxForm.js'; +export { default as MaxLog } from './gui/MaxLog.js'; +export { MaxLogAsLogger } from './gui/MaxLogAsLogger.js'; +export { default as MaxPopupMenu } from './gui/MaxPopupMenu.js'; +export { default as MaxToolbar } from './gui/MaxToolbar.js'; +export { default as MaxWindow } from './gui/MaxWindow.js'; /** * @category GUI * @category Utils */ -export * as guiUtils from './gui/guiUtils'; +export * as guiUtils from './gui/guiUtils.js'; -export { default as ImageBox } from './view/image/ImageBox'; -export { default as ImageBundle } from './view/image/ImageBundle'; -export { default as ImageExport } from './view/image/ImageExport'; +export { default as ImageBox } from './view/image/ImageBox.js'; +export { default as ImageBundle } from './view/image/ImageBundle.js'; +export { default as ImageExport } from './view/image/ImageExport.js'; -export { default as UrlConverter } from './util/UrlConverter'; -export { default as MaxXmlRequest } from './util/MaxXmlRequest'; +export { default as UrlConverter } from './util/UrlConverter.js'; +export { default as MaxXmlRequest } from './util/MaxXmlRequest.js'; /** * @category Utils */ -export * as requestUtils from './util/requestUtils'; +export * as requestUtils from './util/requestUtils.js'; -export { default as AutoSaveManager } from './view/other/AutoSaveManager'; -export { default as Clipboard } from './util/Clipboard'; +export { default as AutoSaveManager } from './view/other/AutoSaveManager.js'; +export { default as Clipboard } from './util/Clipboard.js'; -export { default as UndoableEdit } from './view/undoable_changes/UndoableEdit'; -export { default as UndoManager } from './view/undoable_changes/UndoManager'; +export { default as UndoableEdit } from './view/undoable_changes/UndoableEdit.js'; +export { default as UndoManager } from './view/undoable_changes/UndoManager.js'; -export { Cell } from './view/cell/Cell'; -export { default as CellOverlay } from './view/cell/CellOverlay'; -export { default as CellPath } from './view/cell/CellPath'; -export { default as CellRenderer } from './view/cell/CellRenderer'; -export { default as CellState } from './view/cell/CellState'; -export { default as CellStatePreview } from './view/cell/CellStatePreview'; -export { default as TemporaryCellStates } from './view/cell/TemporaryCellStates'; -export { default as ConnectionConstraint } from './view/other/ConnectionConstraint'; -export { default as Multiplicity } from './view/other/Multiplicity'; +export { Cell } from './view/cell/Cell.js'; +export { default as CellOverlay } from './view/cell/CellOverlay.js'; +export { default as CellPath } from './view/cell/CellPath.js'; +export { default as CellRenderer } from './view/cell/CellRenderer.js'; +export { default as CellState } from './view/cell/CellState.js'; +export { default as CellStatePreview } from './view/cell/CellStatePreview.js'; +export { default as TemporaryCellStates } from './view/cell/TemporaryCellStates.js'; +export { default as ConnectionConstraint } from './view/other/ConnectionConstraint.js'; +export { default as Multiplicity } from './view/other/Multiplicity.js'; // Ensure types are exported in the type definitions -export type { HTMLImageElementWithProps } from './gui/MaxToolbar'; -export * from './types'; +export type { HTMLImageElementWithProps } from './gui/MaxToolbar.js'; +export * from './types.js'; diff --git a/packages/core/src/internal/BaseRegistry.ts b/packages/core/src/internal/BaseRegistry.ts index 7df25b7f13..8b7c967e7a 100644 --- a/packages/core/src/internal/BaseRegistry.ts +++ b/packages/core/src/internal/BaseRegistry.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type { Registry } from '../types'; +import type { Registry } from '../types.js'; /** * Base implementation for all registries storing "style" configuration. diff --git a/packages/core/src/internal/i18n-utils.ts b/packages/core/src/internal/i18n-utils.ts index fd493ddd7e..aaafa7e711 100644 --- a/packages/core/src/internal/i18n-utils.ts +++ b/packages/core/src/internal/i18n-utils.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { GlobalConfig } from '../util/config'; +import { GlobalConfig } from '../util/config.js'; /** * @private diff --git a/packages/core/src/internal/utils.ts b/packages/core/src/internal/utils.ts index 73267a8c94..fb5b2beac0 100644 --- a/packages/core/src/internal/utils.ts +++ b/packages/core/src/internal/utils.ts @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { NODE_TYPE } from '../util/Constants'; -import { UserObject } from './types'; -import { GlobalConfig } from '../util/config'; +import { NODE_TYPE } from '../util/Constants.js'; +import { UserObject } from './types.js'; +import { GlobalConfig } from '../util/config.js'; /** * @private diff --git a/packages/core/src/serialization/Codec.ts b/packages/core/src/serialization/Codec.ts index 42e7aaef8c..bc71ab0233 100644 --- a/packages/core/src/serialization/Codec.ts +++ b/packages/core/src/serialization/Codec.ts @@ -16,13 +16,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -import CellPath from '../view/cell/CellPath'; -import CodecRegistry from './CodecRegistry'; -import Cell from '../view/cell/Cell'; -import { GlobalConfig } from '../util/config'; -import { getFunctionName } from '../util/StringUtils'; -import { importNode, isNode } from '../util/domUtils'; -import { isElement } from '../internal/utils'; +import CellPath from '../view/cell/CellPath.js'; +import CodecRegistry from './CodecRegistry.js'; +import Cell from '../view/cell/Cell.js'; +import { GlobalConfig } from '../util/config.js'; +import { getFunctionName } from '../util/StringUtils.js'; +import { importNode, isNode } from '../util/domUtils.js'; +import { isElement } from '../internal/utils.js'; const createXmlDocument = () => { return document.implementation.createDocument('', '', null); diff --git a/packages/core/src/serialization/CodecRegistry.ts b/packages/core/src/serialization/CodecRegistry.ts index 01eeb76fba..cad5486535 100644 --- a/packages/core/src/serialization/CodecRegistry.ts +++ b/packages/core/src/serialization/CodecRegistry.ts @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import ObjectCodec from './ObjectCodec'; +import ObjectCodec from './ObjectCodec.js'; /** * Singleton class that acts as a global registry for codecs. diff --git a/packages/core/src/serialization/ModelXmlSerializer.ts b/packages/core/src/serialization/ModelXmlSerializer.ts index eb04b6cb99..79f627c4fe 100644 --- a/packages/core/src/serialization/ModelXmlSerializer.ts +++ b/packages/core/src/serialization/ModelXmlSerializer.ts @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { registerModelCodecs } from './register-model-codecs'; -import { getPrettyXml, getXml, parseXml } from '../util/xmlUtils'; -import Codec from './Codec'; -import type GraphDataModel from '../view/GraphDataModel'; +import { registerModelCodecs } from './register-model-codecs.js'; +import { getPrettyXml, getXml, parseXml } from '../util/xmlUtils.js'; +import Codec from './Codec.js'; +import type GraphDataModel from '../view/GraphDataModel.js'; /** * Export options of {@link ModelXmlSerializer}. diff --git a/packages/core/src/serialization/ObjectCodec.ts b/packages/core/src/serialization/ObjectCodec.ts index d8b1f7a7ab..7c89b7d688 100644 --- a/packages/core/src/serialization/ObjectCodec.ts +++ b/packages/core/src/serialization/ObjectCodec.ts @@ -16,15 +16,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -import ObjectIdentity from '../util/ObjectIdentity'; -import { GlobalConfig } from '../util/config'; -import Geometry from '../view/geometry/Geometry'; -import Point from '../view/geometry/Point'; -import { isInteger, isNumeric } from '../util/mathUtils'; -import { getTextContent } from '../util/domUtils'; -import { load } from '../util/requestUtils'; -import type Codec from './Codec'; -import { doEval, isElement } from '../internal/utils'; +import ObjectIdentity from '../util/ObjectIdentity.js'; +import { GlobalConfig } from '../util/config.js'; +import Geometry from '../view/geometry/Geometry.js'; +import Point from '../view/geometry/Point.js'; +import { isInteger, isNumeric } from '../util/mathUtils.js'; +import { getTextContent } from '../util/domUtils.js'; +import { load } from '../util/requestUtils.js'; +import type Codec from './Codec.js'; +import { doEval, isElement } from '../internal/utils.js'; /** * Generic codec for JavaScript objects that implements a mapping between diff --git a/packages/core/src/serialization/codecs/BaseGraphCodec.ts b/packages/core/src/serialization/codecs/BaseGraphCodec.ts index f0b458b3dd..8e5fe260c7 100644 --- a/packages/core/src/serialization/codecs/BaseGraphCodec.ts +++ b/packages/core/src/serialization/codecs/BaseGraphCodec.ts @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { BaseGraph } from '../../view/BaseGraph'; -import ObjectCodec from '../ObjectCodec'; -import { excludedFields } from './GraphCodec'; +import { BaseGraph } from '../../view/BaseGraph.js'; +import ObjectCodec from '../ObjectCodec.js'; +import { excludedFields } from './GraphCodec.js'; /** * Codec for {@link BaseGraph}s. diff --git a/packages/core/src/serialization/codecs/CellCodec.ts b/packages/core/src/serialization/codecs/CellCodec.ts index 42f10ad48f..12e3be7b76 100644 --- a/packages/core/src/serialization/codecs/CellCodec.ts +++ b/packages/core/src/serialization/codecs/CellCodec.ts @@ -14,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -import CodecRegistry from '../CodecRegistry'; -import ObjectCodec from '../ObjectCodec'; -import Cell from '../../view/cell/Cell'; -import type Codec from '../Codec'; -import { importNode } from '../../util/domUtils'; -import { removeWhitespace } from '../../util/StringUtils'; -import { isElement } from '../../internal/utils'; +import CodecRegistry from '../CodecRegistry.js'; +import ObjectCodec from '../ObjectCodec.js'; +import Cell from '../../view/cell/Cell.js'; +import type Codec from '../Codec.js'; +import { importNode } from '../../util/domUtils.js'; +import { removeWhitespace } from '../../util/StringUtils.js'; +import { isElement } from '../../internal/utils.js'; /** * Codec for {@link Cell}s. diff --git a/packages/core/src/serialization/codecs/ChildChangeCodec.ts b/packages/core/src/serialization/codecs/ChildChangeCodec.ts index 39a62106e0..b79d3ff83b 100644 --- a/packages/core/src/serialization/codecs/ChildChangeCodec.ts +++ b/packages/core/src/serialization/codecs/ChildChangeCodec.ts @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import ObjectCodec from '../ObjectCodec'; -import ChildChange from '../../view/undoable_changes/ChildChange'; -import type Codec from '../Codec'; -import { isElement } from '../../internal/utils'; +import ObjectCodec from '../ObjectCodec.js'; +import ChildChange from '../../view/undoable_changes/ChildChange.js'; +import type Codec from '../Codec.js'; +import { isElement } from '../../internal/utils.js'; /** * Codec for {@link ChildChange}s. diff --git a/packages/core/src/serialization/codecs/GenericChangeCodec.ts b/packages/core/src/serialization/codecs/GenericChangeCodec.ts index e95351b124..c4ed0354bf 100644 --- a/packages/core/src/serialization/codecs/GenericChangeCodec.ts +++ b/packages/core/src/serialization/codecs/GenericChangeCodec.ts @@ -16,9 +16,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import ObjectCodec from '../ObjectCodec'; -import { isNode } from '../../util/domUtils'; -import type Codec from '../Codec'; +import ObjectCodec from '../ObjectCodec.js'; +import { isNode } from '../../util/domUtils.js'; +import type Codec from '../Codec.js'; /** * Codec for {@link ValueChange}s, {@link StyleChange}s, {@link GeometryChange}s, {@link CollapseChange}s and {@link VisibleChange}s. diff --git a/packages/core/src/serialization/codecs/GraphCodec.ts b/packages/core/src/serialization/codecs/GraphCodec.ts index caa42554d8..7b84cc7bd4 100644 --- a/packages/core/src/serialization/codecs/GraphCodec.ts +++ b/packages/core/src/serialization/codecs/GraphCodec.ts @@ -16,8 +16,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import ObjectCodec from '../ObjectCodec'; -import { Graph } from '../../view/Graph'; +import ObjectCodec from '../ObjectCodec.js'; +import { Graph } from '../../view/Graph.js'; export const excludedFields = [ 'graphListeners', diff --git a/packages/core/src/serialization/codecs/GraphViewCodec.ts b/packages/core/src/serialization/codecs/GraphViewCodec.ts index 57d1bc8242..8bd815862d 100644 --- a/packages/core/src/serialization/codecs/GraphViewCodec.ts +++ b/packages/core/src/serialization/codecs/GraphViewCodec.ts @@ -14,11 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import ObjectCodec from '../ObjectCodec'; -import { getNameFromRegistries } from './utils'; -import GraphView from '../../view/GraphView'; -import Cell from '../../view/cell/Cell'; -import Point from '../../view/geometry/Point'; +import ObjectCodec from '../ObjectCodec.js'; +import { getNameFromRegistries } from './utils.js'; +import GraphView from '../../view/GraphView.js'; +import Cell from '../../view/cell/Cell.js'; +import Point from '../../view/geometry/Point.js'; /** * Custom encoder for {@link GraphView}s. diff --git a/packages/core/src/serialization/codecs/ModelCodec.ts b/packages/core/src/serialization/codecs/ModelCodec.ts index e1a6947499..66f9cb8540 100644 --- a/packages/core/src/serialization/codecs/ModelCodec.ts +++ b/packages/core/src/serialization/codecs/ModelCodec.ts @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import ObjectCodec from '../ObjectCodec'; -import GraphDataModel from '../../view/GraphDataModel'; -import Cell from '../../view/cell/Cell'; -import type Codec from '../Codec'; +import ObjectCodec from '../ObjectCodec.js'; +import GraphDataModel from '../../view/GraphDataModel.js'; +import Cell from '../../view/cell/Cell.js'; +import type Codec from '../Codec.js'; /** * Codec for {@link GraphDataModel}s. diff --git a/packages/core/src/serialization/codecs/RootChangeCodec.ts b/packages/core/src/serialization/codecs/RootChangeCodec.ts index 676ab0e887..370912c8c3 100644 --- a/packages/core/src/serialization/codecs/RootChangeCodec.ts +++ b/packages/core/src/serialization/codecs/RootChangeCodec.ts @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import ObjectCodec from '../ObjectCodec'; -import RootChange from '../../view/undoable_changes/RootChange'; -import type Codec from '../Codec'; -import { isElement } from '../../internal/utils'; +import ObjectCodec from '../ObjectCodec.js'; +import RootChange from '../../view/undoable_changes/RootChange.js'; +import type Codec from '../Codec.js'; +import { isElement } from '../../internal/utils.js'; /** * Codec for {@link RootChange}s. diff --git a/packages/core/src/serialization/codecs/StylesheetCodec.ts b/packages/core/src/serialization/codecs/StylesheetCodec.ts index 289f142631..7d441bde22 100644 --- a/packages/core/src/serialization/codecs/StylesheetCodec.ts +++ b/packages/core/src/serialization/codecs/StylesheetCodec.ts @@ -14,15 +14,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -import ObjectCodec from '../ObjectCodec'; -import { getNameFromRegistries } from './utils'; -import { Stylesheet } from '../../view/style/Stylesheet'; -import type Codec from '../Codec'; -import { clone } from '../../util/cloneUtils'; -import { GlobalConfig } from '../../util/config'; -import { isNumeric } from '../../util/mathUtils'; -import { getTextContent } from '../../util/domUtils'; -import { doEval, isElement } from '../../internal/utils'; +import ObjectCodec from '../ObjectCodec.js'; +import { getNameFromRegistries } from './utils.js'; +import { Stylesheet } from '../../view/style/Stylesheet.js'; +import type Codec from '../Codec.js'; +import { clone } from '../../util/cloneUtils.js'; +import { GlobalConfig } from '../../util/config.js'; +import { isNumeric } from '../../util/mathUtils.js'; +import { getTextContent } from '../../util/domUtils.js'; +import { doEval, isElement } from '../../internal/utils.js'; /** * Codec for {@link Stylesheet}s. diff --git a/packages/core/src/serialization/codecs/TerminalChangeCodec.ts b/packages/core/src/serialization/codecs/TerminalChangeCodec.ts index 4800a58cf1..aeb892deb1 100644 --- a/packages/core/src/serialization/codecs/TerminalChangeCodec.ts +++ b/packages/core/src/serialization/codecs/TerminalChangeCodec.ts @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import ObjectCodec from '../ObjectCodec'; -import TerminalChange from '../../view/undoable_changes/TerminalChange'; -import type Codec from '../Codec'; +import ObjectCodec from '../ObjectCodec.js'; +import TerminalChange from '../../view/undoable_changes/TerminalChange.js'; +import type Codec from '../Codec.js'; /** * Codec for {@link TerminalChange}s. diff --git a/packages/core/src/serialization/codecs/_model-codecs.ts b/packages/core/src/serialization/codecs/_model-codecs.ts index 9fc7d7e52f..96bd2b59f5 100644 --- a/packages/core/src/serialization/codecs/_model-codecs.ts +++ b/packages/core/src/serialization/codecs/_model-codecs.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -export * from './CellCodec'; -export * from './ModelCodec'; -export * from './mxGraph/mxCellCodec'; -export * from './mxGraph/mxGeometryCodec'; +export * from './CellCodec.js'; +export * from './ModelCodec.js'; +export * from './mxGraph/mxCellCodec.js'; +export * from './mxGraph/mxGeometryCodec.js'; diff --git a/packages/core/src/serialization/codecs/_other-codecs.ts b/packages/core/src/serialization/codecs/_other-codecs.ts index 8d7787c645..9a260b96f7 100644 --- a/packages/core/src/serialization/codecs/_other-codecs.ts +++ b/packages/core/src/serialization/codecs/_other-codecs.ts @@ -14,12 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -export * from './editor'; -export * from './BaseGraphCodec'; -export * from './ChildChangeCodec'; -export * from './GenericChangeCodec'; -export { GraphCodec } from './GraphCodec'; -export * from './GraphViewCodec'; -export * from './RootChangeCodec'; -export * from './StylesheetCodec'; -export * from './TerminalChangeCodec'; +export * from './editor/index.js'; +export * from './BaseGraphCodec.js'; +export * from './ChildChangeCodec.js'; +export * from './GenericChangeCodec.js'; +export { GraphCodec } from './GraphCodec.js'; +export * from './GraphViewCodec.js'; +export * from './RootChangeCodec.js'; +export * from './StylesheetCodec.js'; +export * from './TerminalChangeCodec.js'; diff --git a/packages/core/src/serialization/codecs/editor/EditorCodec.ts b/packages/core/src/serialization/codecs/editor/EditorCodec.ts index 2e7222ada5..540c122b5c 100644 --- a/packages/core/src/serialization/codecs/editor/EditorCodec.ts +++ b/packages/core/src/serialization/codecs/editor/EditorCodec.ts @@ -14,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -import ObjectCodec from '../../ObjectCodec'; -import Editor from '../../../editor/Editor'; -import type Codec from '../../Codec'; -import MaxWindow from '../../../gui/MaxWindow'; -import { addLinkToHead, getChildNodes } from '../../../util/domUtils'; -import { GlobalConfig } from '../../../util/config'; -import { translate } from '../../../internal/i18n-utils'; +import ObjectCodec from '../../ObjectCodec.js'; +import Editor from '../../../editor/Editor.js'; +import type Codec from '../../Codec.js'; +import MaxWindow from '../../../gui/MaxWindow.js'; +import { addLinkToHead, getChildNodes } from '../../../util/domUtils.js'; +import { GlobalConfig } from '../../../util/config.js'; +import { translate } from '../../../internal/i18n-utils.js'; /** * Codec for {@link Editor}s. diff --git a/packages/core/src/serialization/codecs/editor/EditorKeyHandlerCodec.ts b/packages/core/src/serialization/codecs/editor/EditorKeyHandlerCodec.ts index 64ae2ecdc7..54824812b0 100644 --- a/packages/core/src/serialization/codecs/editor/EditorKeyHandlerCodec.ts +++ b/packages/core/src/serialization/codecs/editor/EditorKeyHandlerCodec.ts @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import ObjectCodec from '../../ObjectCodec'; -import type Codec from '../../Codec'; -import EditorKeyHandler from '../../../editor/EditorKeyHandler'; +import ObjectCodec from '../../ObjectCodec.js'; +import type Codec from '../../Codec.js'; +import EditorKeyHandler from '../../../editor/EditorKeyHandler.js'; /** * Custom codec for configuring {@link EditorKeyHandler}s. diff --git a/packages/core/src/serialization/codecs/editor/EditorPopupMenuCodec.ts b/packages/core/src/serialization/codecs/editor/EditorPopupMenuCodec.ts index 820667e2b9..4b60f25dde 100644 --- a/packages/core/src/serialization/codecs/editor/EditorPopupMenuCodec.ts +++ b/packages/core/src/serialization/codecs/editor/EditorPopupMenuCodec.ts @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import ObjectCodec from '../../ObjectCodec'; -import type Codec from '../../Codec'; -import EditorPopupMenu from '../../../editor/EditorPopupMenu'; +import ObjectCodec from '../../ObjectCodec.js'; +import type Codec from '../../Codec.js'; +import EditorPopupMenu from '../../../editor/EditorPopupMenu.js'; /** * Custom codec for configuring {@link EditorPopupMenu}s. diff --git a/packages/core/src/serialization/codecs/editor/EditorToolbarCodec.ts b/packages/core/src/serialization/codecs/editor/EditorToolbarCodec.ts index 2475fa48b1..e3b6ed6727 100644 --- a/packages/core/src/serialization/codecs/editor/EditorToolbarCodec.ts +++ b/packages/core/src/serialization/codecs/editor/EditorToolbarCodec.ts @@ -14,17 +14,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -import ObjectCodec from '../../ObjectCodec'; -import { EditorToolbar } from '../../../editor/EditorToolbar'; -import type Codec from '../../Codec'; -import type Editor from '../../../editor/Editor'; -import { GlobalConfig } from '../../../util/config'; -import { convertPoint } from '../../../util/styleUtils'; -import { getClientX, getClientY } from '../../../util/EventUtils'; -import InternalEvent from '../../../view/event/InternalEvent'; -import { getChildNodes, getTextContent } from '../../../util/domUtils'; -import { doEval, isElement } from '../../../internal/utils'; -import { translate } from '../../../internal/i18n-utils'; +import ObjectCodec from '../../ObjectCodec.js'; +import { EditorToolbar } from '../../../editor/EditorToolbar.js'; +import type Codec from '../../Codec.js'; +import type Editor from '../../../editor/Editor.js'; +import { GlobalConfig } from '../../../util/config.js'; +import { convertPoint } from '../../../util/styleUtils.js'; +import { getClientX, getClientY } from '../../../util/EventUtils.js'; +import InternalEvent from '../../../view/event/InternalEvent.js'; +import { getChildNodes, getTextContent } from '../../../util/domUtils.js'; +import { doEval, isElement } from '../../../internal/utils.js'; +import { translate } from '../../../internal/i18n-utils.js'; /** * Custom codec for configuring {@link EditorToolbar}s. diff --git a/packages/core/src/serialization/codecs/editor/index.ts b/packages/core/src/serialization/codecs/editor/index.ts index 915aebf609..5b556ca310 100644 --- a/packages/core/src/serialization/codecs/editor/index.ts +++ b/packages/core/src/serialization/codecs/editor/index.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -export * from './EditorCodec'; -export * from './EditorKeyHandlerCodec'; -export * from './EditorPopupMenuCodec'; -export * from './EditorToolbarCodec'; +export * from './EditorCodec.js'; +export * from './EditorKeyHandlerCodec.js'; +export * from './EditorPopupMenuCodec.js'; +export * from './EditorToolbarCodec.js'; diff --git a/packages/core/src/serialization/codecs/mxGraph/mxCellCodec.ts b/packages/core/src/serialization/codecs/mxGraph/mxCellCodec.ts index 04db245eec..34b82cfd40 100644 --- a/packages/core/src/serialization/codecs/mxGraph/mxCellCodec.ts +++ b/packages/core/src/serialization/codecs/mxGraph/mxCellCodec.ts @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { convertStyleFromString } from './utils'; -import { CellCodec } from '../CellCodec'; -import type Codec from '../../Codec'; +import { convertStyleFromString } from './utils.js'; +import { CellCodec } from '../CellCodec.js'; +import type Codec from '../../Codec.js'; /** * Add support for the legacy `mxGraph` format of {@link Cell}. diff --git a/packages/core/src/serialization/codecs/mxGraph/mxGeometryCodec.ts b/packages/core/src/serialization/codecs/mxGraph/mxGeometryCodec.ts index 5f71229480..6760baec52 100644 --- a/packages/core/src/serialization/codecs/mxGraph/mxGeometryCodec.ts +++ b/packages/core/src/serialization/codecs/mxGraph/mxGeometryCodec.ts @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Codec from '../../Codec'; -import ObjectCodec from '../../ObjectCodec'; -import Geometry from '../../../view/geometry/Geometry'; -import Point from '../../../view/geometry/Point'; +import type Codec from '../../Codec.js'; +import ObjectCodec from '../../ObjectCodec.js'; +import Geometry from '../../../view/geometry/Geometry.js'; +import Point from '../../../view/geometry/Point.js'; /** * Add support for the legacy `mxGraph` format of {@link Geometry}. diff --git a/packages/core/src/serialization/codecs/mxGraph/utils.ts b/packages/core/src/serialization/codecs/mxGraph/utils.ts index 7a26b4e593..e6698453a2 100644 --- a/packages/core/src/serialization/codecs/mxGraph/utils.ts +++ b/packages/core/src/serialization/codecs/mxGraph/utils.ts @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { isNumeric } from '../../../util/mathUtils'; -import type { CellStyle } from '../../../types'; +import { isNumeric } from '../../../util/mathUtils.js'; +import type { CellStyle } from '../../../types.js'; // from mxGraph to maxGraph const fieldMapping = new Map([['autosize', 'autoSize']]); diff --git a/packages/core/src/serialization/codecs/utils.ts b/packages/core/src/serialization/codecs/utils.ts index 401f39cee7..316d4d5e92 100644 --- a/packages/core/src/serialization/codecs/utils.ts +++ b/packages/core/src/serialization/codecs/utils.ts @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { EdgeStyleRegistry } from '../../view/style/edge/EdgeStyleRegistry'; -import { PerimeterRegistry } from '../../view/style/perimeter/PerimeterRegistry'; +import { EdgeStyleRegistry } from '../../view/style/edge/EdgeStyleRegistry.js'; +import { PerimeterRegistry } from '../../view/style/perimeter/PerimeterRegistry.js'; const registries = [EdgeStyleRegistry, PerimeterRegistry]; diff --git a/packages/core/src/serialization/register-model-codecs.ts b/packages/core/src/serialization/register-model-codecs.ts index 5b84cfc8ff..dd330d2481 100644 --- a/packages/core/src/serialization/register-model-codecs.ts +++ b/packages/core/src/serialization/register-model-codecs.ts @@ -14,20 +14,20 @@ See the License for the specific language governing permissions and limitations under the License. */ -import CodecRegistry from './CodecRegistry'; +import CodecRegistry from './CodecRegistry.js'; import { CellCodec, ModelCodec, mxCellCodec, mxGeometryCodec, -} from './codecs/_model-codecs'; -import Geometry from '../view/geometry/Geometry'; -import Point from '../view/geometry/Point'; +} from './codecs/_model-codecs.js'; +import Geometry from '../view/geometry/Geometry.js'; +import Point from '../view/geometry/Point.js'; import { CodecRegistrationStates, createObjectCodec, registerBaseCodecs, -} from './register-shared'; +} from './register-shared.js'; /** * Register model codecs i.e. codecs used to import/export the Graph Model, see {@link GraphDataModel}. diff --git a/packages/core/src/serialization/register-other-codecs.ts b/packages/core/src/serialization/register-other-codecs.ts index 07fb2e668d..904b41119b 100644 --- a/packages/core/src/serialization/register-other-codecs.ts +++ b/packages/core/src/serialization/register-other-codecs.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import CodecRegistry from './CodecRegistry'; +import CodecRegistry from './CodecRegistry.js'; import { BaseGraphCodec, ChildChangeCodec, @@ -28,21 +28,21 @@ import { RootChangeCodec, StylesheetCodec, TerminalChangeCodec, -} from './codecs/_other-codecs'; -import Rectangle from '../view/geometry/Rectangle'; -import ImageBox from '../view/image/ImageBox'; -import CellAttributeChange from '../view/undoable_changes/CellAttributeChange'; -import CollapseChange from '../view/undoable_changes/CollapseChange'; -import GeometryChange from '../view/undoable_changes/GeometryChange'; -import StyleChange from '../view/undoable_changes/StyleChange'; -import ValueChange from '../view/undoable_changes/ValueChange'; -import VisibleChange from '../view/undoable_changes/VisibleChange'; +} from './codecs/_other-codecs.js'; +import Rectangle from '../view/geometry/Rectangle.js'; +import ImageBox from '../view/image/ImageBox.js'; +import CellAttributeChange from '../view/undoable_changes/CellAttributeChange.js'; +import CollapseChange from '../view/undoable_changes/CollapseChange.js'; +import GeometryChange from '../view/undoable_changes/GeometryChange.js'; +import StyleChange from '../view/undoable_changes/StyleChange.js'; +import ValueChange from '../view/undoable_changes/ValueChange.js'; +import VisibleChange from '../view/undoable_changes/VisibleChange.js'; import { CodecRegistrationStates, createObjectCodec, registerBaseCodecs, -} from './register-shared'; -import { registerModelCodecs } from './register-model-codecs'; +} from './register-shared.js'; +import { registerModelCodecs } from './register-model-codecs.js'; const registerGenericChangeCodecs = () => { const __dummy: any = undefined; diff --git a/packages/core/src/serialization/register-shared.ts b/packages/core/src/serialization/register-shared.ts index af2a95cecd..0b3dabca55 100644 --- a/packages/core/src/serialization/register-shared.ts +++ b/packages/core/src/serialization/register-shared.ts @@ -16,8 +16,8 @@ limitations under the License. // The elements in this file are private and are not intended to be exported by the npm package -import CodecRegistry from './CodecRegistry'; -import ObjectCodec from './ObjectCodec'; +import CodecRegistry from './CodecRegistry.js'; +import ObjectCodec from './ObjectCodec.js'; /** * @private diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index b8c921f8ac..0cb17fadd9 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -14,23 +14,23 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type { IDENTITY_FIELD_NAME } from './util/Constants'; -import type { AbstractGraph } from './view/AbstractGraph'; -import type AbstractCanvas2D from './view/canvas/AbstractCanvas2D'; -import type Cell from './view/cell/Cell'; -import type CellState from './view/cell/CellState'; -import type EventSource from './view/event/EventSource'; -import type InternalMouseEvent from './view/event/InternalMouseEvent'; -import type Geometry from './view/geometry/Geometry'; -import type Point from './view/geometry/Point'; -import type Rectangle from './view/geometry/Rectangle'; -import type Shape from './view/shape/Shape'; -import type ImageBox from './view/image/ImageBox'; -import type CellRenderer from './view/cell/CellRenderer'; -import type GraphDataModel from './view/GraphDataModel'; -import type { Stylesheet } from './view/style/Stylesheet'; -import type GraphSelectionModel from './view/GraphSelectionModel'; -import type GraphView from './view/GraphView'; +import type { IDENTITY_FIELD_NAME } from './util/Constants.js'; +import type { AbstractGraph } from './view/AbstractGraph.js'; +import type AbstractCanvas2D from './view/canvas/AbstractCanvas2D.js'; +import type Cell from './view/cell/Cell.js'; +import type CellState from './view/cell/CellState.js'; +import type EventSource from './view/event/EventSource.js'; +import type InternalMouseEvent from './view/event/InternalMouseEvent.js'; +import type Geometry from './view/geometry/Geometry.js'; +import type Point from './view/geometry/Point.js'; +import type Rectangle from './view/geometry/Rectangle.js'; +import type Shape from './view/shape/Shape.js'; +import type ImageBox from './view/image/ImageBox.js'; +import type CellRenderer from './view/cell/CellRenderer.js'; +import type GraphDataModel from './view/GraphDataModel.js'; +import type { Stylesheet } from './view/style/Stylesheet.js'; +import type GraphSelectionModel from './view/GraphSelectionModel.js'; +import type GraphView from './view/GraphView.js'; export type FilterFunction = (cell: Cell) => boolean; diff --git a/packages/core/src/util/Clipboard.ts b/packages/core/src/util/Clipboard.ts index d67828486d..2df08f0721 100644 --- a/packages/core/src/util/Clipboard.ts +++ b/packages/core/src/util/Clipboard.ts @@ -16,9 +16,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Cell from '../view/cell/Cell'; -import type { AbstractGraph } from '../view/AbstractGraph'; -import { getTopmostCells } from './cellArrayUtils'; +import type Cell from '../view/cell/Cell.js'; +import type { AbstractGraph } from '../view/AbstractGraph.js'; +import { getTopmostCells } from './cellArrayUtils.js'; /** * @class diff --git a/packages/core/src/util/EventUtils.ts b/packages/core/src/util/EventUtils.ts index bf52dcc3fb..a782eef276 100644 --- a/packages/core/src/util/EventUtils.ts +++ b/packages/core/src/util/EventUtils.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Client from '../Client'; +import Client from '../Client.js'; /** * Returns the touch or mouse event that contains the mouse coordinates. diff --git a/packages/core/src/util/MaxXmlRequest.ts b/packages/core/src/util/MaxXmlRequest.ts index 961f0d98ed..4ea562d547 100644 --- a/packages/core/src/util/MaxXmlRequest.ts +++ b/packages/core/src/util/MaxXmlRequest.ts @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { write } from './domUtils'; +import { write } from './domUtils.js'; /** * This class provides a cross-browser abstraction for Ajax requests. It is an XML HTTP request wrapper. diff --git a/packages/core/src/util/ObjectIdentity.ts b/packages/core/src/util/ObjectIdentity.ts index bb0459587e..08115637d0 100644 --- a/packages/core/src/util/ObjectIdentity.ts +++ b/packages/core/src/util/ObjectIdentity.ts @@ -16,9 +16,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { IdentityFunction, IdentityObject } from '../types'; -import { IDENTITY_FIELD_NAME } from './Constants'; -import { getFunctionName } from './StringUtils'; +import { IdentityFunction, IdentityObject } from '../types.js'; +import { IDENTITY_FIELD_NAME } from './Constants.js'; +import { getFunctionName } from './StringUtils.js'; /** * @class diff --git a/packages/core/src/util/StringUtils.ts b/packages/core/src/util/StringUtils.ts index 43eb2ddbc4..3da6821ec0 100644 --- a/packages/core/src/util/StringUtils.ts +++ b/packages/core/src/util/StringUtils.ts @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { NODE_TYPE } from './Constants'; -import { getTextContent } from './domUtils'; +import { NODE_TYPE } from './Constants.js'; +import { getTextContent } from './domUtils.js'; -import type { Properties } from '../types'; +import type { Properties } from '../types.js'; /** * Strips all whitespaces from the beginning of the string. Without the diff --git a/packages/core/src/util/arrayUtils.ts b/packages/core/src/util/arrayUtils.ts index bc15eed4db..142ed58264 100644 --- a/packages/core/src/util/arrayUtils.ts +++ b/packages/core/src/util/arrayUtils.ts @@ -16,9 +16,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Point from '../view/geometry/Point'; +import Point from '../view/geometry/Point.js'; -import type { Properties } from '../types'; +import type { Properties } from '../types.js'; /** * Removes all occurrences of the given object in the given array or diff --git a/packages/core/src/util/cellArrayUtils.ts b/packages/core/src/util/cellArrayUtils.ts index ed2bc105ca..0454ad262c 100644 --- a/packages/core/src/util/cellArrayUtils.ts +++ b/packages/core/src/util/cellArrayUtils.ts @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Cell from '../view/cell/Cell'; -import ObjectIdentity from './ObjectIdentity'; +import Cell from '../view/cell/Cell.js'; +import ObjectIdentity from './ObjectIdentity.js'; /** * Returns all opposite vertices terminal for the given edges, only returning sources and/or targets as specified. diff --git a/packages/core/src/util/cloneUtils.ts b/packages/core/src/util/cloneUtils.ts index f3fb33bb43..751ce8f651 100644 --- a/packages/core/src/util/cloneUtils.ts +++ b/packages/core/src/util/cloneUtils.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import ObjectIdentity from './ObjectIdentity'; +import ObjectIdentity from './ObjectIdentity.js'; /** * Recursively clones the specified object ignoring all field names in the diff --git a/packages/core/src/util/config.ts b/packages/core/src/util/config.ts index 46c89abf9f..1e1c0e7b32 100644 --- a/packages/core/src/util/config.ts +++ b/packages/core/src/util/config.ts @@ -14,16 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type { I18nProvider, Logger } from '../types'; -import { NoOpLogger } from './logger'; +import type { I18nProvider, Logger } from '../types.js'; +import { NoOpLogger } from './logger.js'; import { SHADOW_OFFSET_X, SHADOW_OFFSET_Y, SHADOW_OPACITY, SHADOWCOLOR, -} from './Constants'; -import { shallowCopy } from '../internal/clone-utils'; -import { NoOpI18n } from '../i18n/provider'; +} from './Constants.js'; +import { shallowCopy } from '../internal/clone-utils.js'; +import { NoOpI18n } from '../i18n/provider.js'; /** * Global configuration for maxGraph. diff --git a/packages/core/src/util/domHelpers.ts b/packages/core/src/util/domHelpers.ts index f676de2535..d41e831cdc 100644 --- a/packages/core/src/util/domHelpers.ts +++ b/packages/core/src/util/domHelpers.ts @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Editor from '../editor/Editor'; -import { KeyboardEventListener, MouseEventListener } from '../types'; -import InternalEvent from '../view/event/InternalEvent'; -import { write } from './domUtils'; +import Editor from '../editor/Editor.js'; +import { KeyboardEventListener, MouseEventListener } from '../types.js'; +import InternalEvent from '../view/event/InternalEvent.js'; +import { write } from './domUtils.js'; /** * Adds a hyperlink to the specified parent that invokes action on the diff --git a/packages/core/src/util/domUtils.ts b/packages/core/src/util/domUtils.ts index aa39dbb521..a2037c0707 100644 --- a/packages/core/src/util/domUtils.ts +++ b/packages/core/src/util/domUtils.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { NODE_TYPE } from './Constants'; +import { NODE_TYPE } from './Constants.js'; /** * Returns the text content of the specified node. diff --git a/packages/core/src/util/gestureUtils.ts b/packages/core/src/util/gestureUtils.ts index b203398265..0ce1d94eeb 100644 --- a/packages/core/src/util/gestureUtils.ts +++ b/packages/core/src/util/gestureUtils.ts @@ -14,12 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import DragSource from '../view/other/DragSource'; -import Point from '../view/geometry/Point'; -import { TOOLTIP_VERTICAL_OFFSET } from './Constants'; -import type { AbstractGraph } from '../view/AbstractGraph'; -import type Cell from '../view/cell/Cell'; -import type { DropHandler } from '../types'; +import DragSource from '../view/other/DragSource.js'; +import Point from '../view/geometry/Point.js'; +import { TOOLTIP_VERTICAL_OFFSET } from './Constants.js'; +import type { AbstractGraph } from '../view/AbstractGraph.js'; +import type Cell from '../view/cell/Cell.js'; +import type { DropHandler } from '../types.js'; /** * Configures the given DOM element to act as a drag source for the diff --git a/packages/core/src/util/logger.ts b/packages/core/src/util/logger.ts index a65763c81a..3afb3e12bb 100644 --- a/packages/core/src/util/logger.ts +++ b/packages/core/src/util/logger.ts @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type { Logger } from '../types'; +import type { Logger } from '../types.js'; -import { getElapseMillisecondsMessage } from '../internal/time-utils'; +import { getElapseMillisecondsMessage } from '../internal/time-utils.js'; /** * A {@link Logger} that does nothing. diff --git a/packages/core/src/util/mathUtils.ts b/packages/core/src/util/mathUtils.ts index 7c4c9a49d0..1ce0116275 100644 --- a/packages/core/src/util/mathUtils.ts +++ b/packages/core/src/util/mathUtils.ts @@ -16,12 +16,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { DIRECTION_MASK } from './Constants'; -import Point from '../view/geometry/Point'; -import Rectangle from '../view/geometry/Rectangle'; -import CellState from '../view/cell/CellState'; -import type { CellStateStyle } from '../types'; -import { isNullish } from '../internal/utils'; +import { DIRECTION_MASK } from './Constants.js'; +import Point from '../view/geometry/Point.js'; +import Rectangle from '../view/geometry/Rectangle.js'; +import CellState from '../view/cell/CellState.js'; +import type { CellStateStyle } from '../types.js'; +import { isNullish } from '../internal/utils.js'; /** * Converts the given degree to radians. diff --git a/packages/core/src/util/printUtils.ts b/packages/core/src/util/printUtils.ts index e9081fc51b..7ef78a7ce3 100644 --- a/packages/core/src/util/printUtils.ts +++ b/packages/core/src/util/printUtils.ts @@ -16,12 +16,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Client from '../Client'; -import { PAGE_FORMAT_A4_PORTRAIT } from './Constants'; -import Rectangle from '../view/geometry/Rectangle'; -import { getOuterHtml } from './domUtils'; -import type { AbstractGraph } from '../view/AbstractGraph'; -import { removeCursors } from './styleUtils'; +import Client from '../Client.js'; +import { PAGE_FORMAT_A4_PORTRAIT } from './Constants.js'; +import Rectangle from '../view/geometry/Rectangle.js'; +import { getOuterHtml } from './domUtils.js'; +import type { AbstractGraph } from '../view/AbstractGraph.js'; +import { removeCursors } from './styleUtils.js'; /** * Returns the scale to be used for printing the graph with the given diff --git a/packages/core/src/util/requestUtils.ts b/packages/core/src/util/requestUtils.ts index dc1a44c5d3..c82ac63cde 100644 --- a/packages/core/src/util/requestUtils.ts +++ b/packages/core/src/util/requestUtils.ts @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import MaxXmlRequest from './MaxXmlRequest'; +import MaxXmlRequest from './MaxXmlRequest.js'; /** * Loads the specified URL *synchronously* and returns the {@link MaxXmlRequest}. diff --git a/packages/core/src/util/styleUtils.ts b/packages/core/src/util/styleUtils.ts index 86fa7e476e..8c032829a7 100644 --- a/packages/core/src/util/styleUtils.ts +++ b/packages/core/src/util/styleUtils.ts @@ -16,26 +16,26 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Client from '../Client'; +import Client from '../Client.js'; import { DEFAULT_FONTFAMILY, DEFAULT_FONTSIZE, FONT_STYLE_MASK, LINE_HEIGHT, -} from './Constants'; -import Point from '../view/geometry/Point'; -import CellPath from '../view/cell/CellPath'; -import Rectangle from '../view/geometry/Rectangle'; -import Cell from '../view/cell/Cell'; -import GraphDataModel from '../view/GraphDataModel'; +} from './Constants.js'; +import Point from '../view/geometry/Point.js'; +import CellPath from '../view/cell/CellPath.js'; +import Rectangle from '../view/geometry/Rectangle.js'; +import Cell from '../view/cell/Cell.js'; +import GraphDataModel from '../view/GraphDataModel.js'; import type { AlignValue, CellStateStyle, CellStyle, NumericCellStateStyleKeys, VAlignValue, -} from '../types'; -import { matchBinaryMask } from '../internal/utils'; +} from '../types.js'; +import { matchBinaryMask } from '../internal/utils.js'; /** * Removes the cursors from the style of the given DOM node and its descendants. diff --git a/packages/core/src/util/treeTraversal.ts b/packages/core/src/util/treeTraversal.ts index de7a8fe8ed..bc0ae90f0b 100644 --- a/packages/core/src/util/treeTraversal.ts +++ b/packages/core/src/util/treeTraversal.ts @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Cell from '../view/cell/Cell'; -import type { AbstractGraph } from '../view/AbstractGraph'; +import type Cell from '../view/cell/Cell.js'; +import type { AbstractGraph } from '../view/AbstractGraph.js'; /***************************************************************************** * Group: Tree and traversal-related diff --git a/packages/core/src/util/xmlUtils.ts b/packages/core/src/util/xmlUtils.ts index 68b365f851..8057d8581c 100644 --- a/packages/core/src/util/xmlUtils.ts +++ b/packages/core/src/util/xmlUtils.ts @@ -16,16 +16,16 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { NODE_TYPE, NS_SVG } from './Constants'; -import Point from '../view/geometry/Point'; -import type Cell from '../view/cell/Cell'; -import type { AbstractGraph } from '../view/AbstractGraph'; -import { htmlEntities, trim } from './StringUtils'; -import TemporaryCellStates from '../view/cell/TemporaryCellStates'; -import type { StyleValue } from '../types'; -import { getTextContent } from './domUtils'; -import Codec from '../serialization/Codec'; -import { isElement } from '../internal/utils'; +import { NODE_TYPE, NS_SVG } from './Constants.js'; +import Point from '../view/geometry/Point.js'; +import type Cell from '../view/cell/Cell.js'; +import type { AbstractGraph } from '../view/AbstractGraph.js'; +import { htmlEntities, trim } from './StringUtils.js'; +import TemporaryCellStates from '../view/cell/TemporaryCellStates.js'; +import type { StyleValue } from '../types.js'; +import { getTextContent } from './domUtils.js'; +import Codec from '../serialization/Codec.js'; +import { isElement } from '../internal/utils.js'; /** * Returns a new, empty XML document. diff --git a/packages/core/src/view/AbstractGraph.ts b/packages/core/src/view/AbstractGraph.ts index e923af3645..3cdb0494c3 100644 --- a/packages/core/src/view/AbstractGraph.ts +++ b/packages/core/src/view/AbstractGraph.ts @@ -16,35 +16,35 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Image from './image/ImageBox'; -import EventObject from './event/EventObject'; -import EventSource from './event/EventSource'; -import InternalEvent from './event/InternalEvent'; -import Rectangle from './geometry/Rectangle'; -import Client from '../Client'; -import type PanningHandler from './plugins/PanningHandler'; -import GraphView from './GraphView'; -import CellRenderer from './cell/CellRenderer'; -import Point from './geometry/Point'; -import { getCurrentStyle, hasScrollbars, parseCssNumber } from '../util/styleUtils'; -import Cell from './cell/Cell'; -import GraphDataModel from './GraphDataModel'; -import { Stylesheet } from './style/Stylesheet'; -import { PAGE_FORMAT_A4_PORTRAIT } from '../util/Constants'; -import ChildChange from './undoable_changes/ChildChange'; -import GeometryChange from './undoable_changes/GeometryChange'; -import RootChange from './undoable_changes/RootChange'; -import StyleChange from './undoable_changes/StyleChange'; -import TerminalChange from './undoable_changes/TerminalChange'; -import ValueChange from './undoable_changes/ValueChange'; -import CellState from './cell/CellState'; -import { isNode } from '../util/domUtils'; -import { EdgeStyle } from './style/builtin-style-elements'; -import { EdgeStyleRegistry } from './style/edge/EdgeStyleRegistry'; -import EdgeHandler from './handler/EdgeHandler'; -import VertexHandler from './handler/VertexHandler'; -import EdgeSegmentHandler from './handler/EdgeSegmentHandler'; -import ElbowEdgeHandler from './handler/ElbowEdgeHandler'; +import Image from './image/ImageBox.js'; +import EventObject from './event/EventObject.js'; +import EventSource from './event/EventSource.js'; +import InternalEvent from './event/InternalEvent.js'; +import Rectangle from './geometry/Rectangle.js'; +import Client from '../Client.js'; +import type PanningHandler from './plugins/PanningHandler.js'; +import GraphView from './GraphView.js'; +import CellRenderer from './cell/CellRenderer.js'; +import Point from './geometry/Point.js'; +import { getCurrentStyle, hasScrollbars, parseCssNumber } from '../util/styleUtils.js'; +import Cell from './cell/Cell.js'; +import GraphDataModel from './GraphDataModel.js'; +import { Stylesheet } from './style/Stylesheet.js'; +import { PAGE_FORMAT_A4_PORTRAIT } from '../util/Constants.js'; +import ChildChange from './undoable_changes/ChildChange.js'; +import GeometryChange from './undoable_changes/GeometryChange.js'; +import RootChange from './undoable_changes/RootChange.js'; +import StyleChange from './undoable_changes/StyleChange.js'; +import TerminalChange from './undoable_changes/TerminalChange.js'; +import ValueChange from './undoable_changes/ValueChange.js'; +import CellState from './cell/CellState.js'; +import { isNode } from '../util/domUtils.js'; +import { EdgeStyle } from './style/builtin-style-elements.js'; +import { EdgeStyleRegistry } from './style/edge/EdgeStyleRegistry.js'; +import EdgeHandler from './handler/EdgeHandler.js'; +import VertexHandler from './handler/VertexHandler.js'; +import EdgeSegmentHandler from './handler/EdgeSegmentHandler.js'; +import ElbowEdgeHandler from './handler/ElbowEdgeHandler.js'; import type { DialectValue, EdgeStyleFunction, @@ -54,12 +54,12 @@ import type { GraphPlugin, MouseListenerSet, PluginId, -} from '../types'; -import Multiplicity from './other/Multiplicity'; -import ImageBundle from './image/ImageBundle'; -import { applyGraphMixins } from './mixins/_graph-mixins-apply'; -import { isNullish } from '../internal/utils'; -import { isI18nEnabled } from '../internal/i18n-utils'; +} from '../types.js'; +import Multiplicity from './other/Multiplicity.js'; +import ImageBundle from './image/ImageBundle.js'; +import { applyGraphMixins } from './mixins/_graph-mixins-apply.js'; +import { isNullish } from '../internal/utils.js'; +import { isI18nEnabled } from '../internal/i18n-utils.js'; /** * Extends {@link EventSource} to implement a graph component for the browser. This is the entry point class of the package. diff --git a/packages/core/src/view/BaseGraph.ts b/packages/core/src/view/BaseGraph.ts index 6eb6cd89f0..0aaf2af2c4 100644 --- a/packages/core/src/view/BaseGraph.ts +++ b/packages/core/src/view/BaseGraph.ts @@ -14,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type { GraphCollaboratorsOptions } from '../types'; -import { AbstractGraph } from './AbstractGraph'; -import GraphDataModel from './GraphDataModel'; -import CellRenderer from './cell/CellRenderer'; -import { Stylesheet } from './style/Stylesheet'; -import GraphSelectionModel from './GraphSelectionModel'; -import GraphView from './GraphView'; +import type { GraphCollaboratorsOptions } from '../types.js'; +import { AbstractGraph } from './AbstractGraph.js'; +import GraphDataModel from './GraphDataModel.js'; +import CellRenderer from './cell/CellRenderer.js'; +import { Stylesheet } from './style/Stylesheet.js'; +import GraphSelectionModel from './GraphSelectionModel.js'; +import GraphView from './GraphView.js'; /** * An implementation of {@link AbstractGraph} that does not load any default built-ins (plugins, style elements). diff --git a/packages/core/src/view/Graph.ts b/packages/core/src/view/Graph.ts index 571773ada5..27acf6a049 100644 --- a/packages/core/src/view/Graph.ts +++ b/packages/core/src/view/Graph.ts @@ -16,20 +16,20 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type { GraphCollaboratorsOptions, GraphPluginConstructor } from '../types'; -import { AbstractGraph } from './AbstractGraph'; -import GraphView from './GraphView'; -import CellRenderer from './cell/CellRenderer'; -import GraphDataModel from './GraphDataModel'; -import { Stylesheet } from './style/Stylesheet'; -import GraphSelectionModel from './GraphSelectionModel'; -import { registerDefaultShapes } from './shape/register-shapes'; +import type { GraphCollaboratorsOptions, GraphPluginConstructor } from '../types.js'; +import { AbstractGraph } from './AbstractGraph.js'; +import GraphView from './GraphView.js'; +import CellRenderer from './cell/CellRenderer.js'; +import GraphDataModel from './GraphDataModel.js'; +import { Stylesheet } from './style/Stylesheet.js'; +import GraphSelectionModel from './GraphSelectionModel.js'; +import { registerDefaultShapes } from './shape/register-shapes.js'; import { registerDefaultEdgeMarkers, registerDefaultEdgeStyles, registerDefaultPerimeters, -} from './style/register'; -import { getDefaultPlugins } from './plugins'; +} from './style/register.js'; +import { getDefaultPlugins } from './plugins/index.js'; /** * An implementation of {@link AbstractGraph} that automatically loads some default built-ins (plugins, style elements). diff --git a/packages/core/src/view/GraphDataModel.ts b/packages/core/src/view/GraphDataModel.ts index 657bd422c6..1a45b6e0d3 100644 --- a/packages/core/src/view/GraphDataModel.ts +++ b/packages/core/src/view/GraphDataModel.ts @@ -16,23 +16,23 @@ See the License for the specific language governing permissions and limitations under the License. */ -import EventSource from './event/EventSource'; -import UndoableEdit from './undoable_changes/UndoableEdit'; -import CellPath from './cell/CellPath'; -import Cell from './cell/Cell'; -import { isNumeric } from '../util/mathUtils'; -import EventObject from './event/EventObject'; -import InternalEvent from './event/InternalEvent'; -import ChildChange from './undoable_changes/ChildChange'; -import CollapseChange from './undoable_changes/CollapseChange'; -import GeometryChange from './undoable_changes/GeometryChange'; -import RootChange from './undoable_changes/RootChange'; -import StyleChange from './undoable_changes/StyleChange'; -import TerminalChange from './undoable_changes/TerminalChange'; -import ValueChange from './undoable_changes/ValueChange'; -import VisibleChange from './undoable_changes/VisibleChange'; -import Geometry from './geometry/Geometry'; -import type { CellStyle, FilterFunction } from '../types'; +import EventSource from './event/EventSource.js'; +import UndoableEdit from './undoable_changes/UndoableEdit.js'; +import CellPath from './cell/CellPath.js'; +import Cell from './cell/Cell.js'; +import { isNumeric } from '../util/mathUtils.js'; +import EventObject from './event/EventObject.js'; +import InternalEvent from './event/InternalEvent.js'; +import ChildChange from './undoable_changes/ChildChange.js'; +import CollapseChange from './undoable_changes/CollapseChange.js'; +import GeometryChange from './undoable_changes/GeometryChange.js'; +import RootChange from './undoable_changes/RootChange.js'; +import StyleChange from './undoable_changes/StyleChange.js'; +import TerminalChange from './undoable_changes/TerminalChange.js'; +import ValueChange from './undoable_changes/ValueChange.js'; +import VisibleChange from './undoable_changes/VisibleChange.js'; +import Geometry from './geometry/Geometry.js'; +import type { CellStyle, FilterFunction } from '../types.js'; /** * Extends {@link EventSource} to implement a graph model. The graph model acts as diff --git a/packages/core/src/view/GraphSelectionModel.ts b/packages/core/src/view/GraphSelectionModel.ts index 3bc3b786bd..89e1ea8871 100644 --- a/packages/core/src/view/GraphSelectionModel.ts +++ b/packages/core/src/view/GraphSelectionModel.ts @@ -16,14 +16,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -import EventSource from '../view/event/EventSource'; -import type { AbstractGraph } from './AbstractGraph'; -import type Cell from './cell/Cell'; -import SelectionChange from './undoable_changes/SelectionChange'; -import UndoableEdit from './undoable_changes/UndoableEdit'; -import EventObject from './event/EventObject'; -import InternalEvent from './event/InternalEvent'; -import { isI18nEnabled } from '../internal/i18n-utils'; +import EventSource from '../view/event/EventSource.js'; +import type { AbstractGraph } from './AbstractGraph.js'; +import type Cell from './cell/Cell.js'; +import SelectionChange from './undoable_changes/SelectionChange.js'; +import UndoableEdit from './undoable_changes/UndoableEdit.js'; +import EventObject from './event/EventObject.js'; +import InternalEvent from './event/InternalEvent.js'; +import { isI18nEnabled } from '../internal/i18n-utils.js'; /** * Implements the selection model for a graph. diff --git a/packages/core/src/view/GraphView.ts b/packages/core/src/view/GraphView.ts index 23994449e0..79e95de9fa 100644 --- a/packages/core/src/view/GraphView.ts +++ b/packages/core/src/view/GraphView.ts @@ -16,37 +16,42 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Point from './geometry/Point'; -import Rectangle from './geometry/Rectangle'; -import EventSource from './event/EventSource'; -import EventObject from './event/EventObject'; -import RectangleShape from './shape/node/RectangleShape'; -import { NS_SVG } from '../util/Constants'; -import Client from '../Client'; -import InternalEvent from './event/InternalEvent'; -import { convertPoint, getCurrentStyle, getOffset } from '../util/styleUtils'; -import { getRotatedPoint, ptSegDistSq, relativeCcw, toRadians } from '../util/mathUtils'; -import { GlobalConfig } from '../util/config'; -import CellState from './cell/CellState'; -import UndoableEdit from './undoable_changes/UndoableEdit'; -import ImageShape from './shape/node/ImageShape'; -import InternalMouseEvent from './event/InternalMouseEvent'; -import Cell from './cell/Cell'; -import Image from './image/ImageBox'; -import CurrentRootChange from './undoable_changes/CurrentRootChange'; -import Shape from './shape/Shape'; -import Geometry from './geometry/Geometry'; -import ConnectionConstraint from './other/ConnectionConstraint'; -import type PopupMenuHandler from './plugins/PopupMenuHandler'; -import { getClientX, getClientY, getSource, isConsumed } from '../util/EventUtils'; -import { clone } from '../util/cloneUtils'; -import type { AbstractGraph } from './AbstractGraph'; -import { EdgeStyleRegistry } from './style/edge/EdgeStyleRegistry'; -import { PerimeterRegistry } from './style/perimeter/PerimeterRegistry'; -import type TooltipHandler from './plugins/TooltipHandler'; -import type { EdgeStyleFunction, MouseEventListener } from '../types'; -import { doEval } from '../internal/utils'; -import { isI18nEnabled } from '../internal/i18n-utils'; +import Point from './geometry/Point.js'; +import Rectangle from './geometry/Rectangle.js'; +import EventSource from './event/EventSource.js'; +import EventObject from './event/EventObject.js'; +import RectangleShape from './shape/node/RectangleShape.js'; +import { NS_SVG } from '../util/Constants.js'; +import Client from '../Client.js'; +import InternalEvent from './event/InternalEvent.js'; +import { convertPoint, getCurrentStyle, getOffset } from '../util/styleUtils.js'; +import { + getRotatedPoint, + ptSegDistSq, + relativeCcw, + toRadians, +} from '../util/mathUtils.js'; +import { GlobalConfig } from '../util/config.js'; +import CellState from './cell/CellState.js'; +import UndoableEdit from './undoable_changes/UndoableEdit.js'; +import ImageShape from './shape/node/ImageShape.js'; +import InternalMouseEvent from './event/InternalMouseEvent.js'; +import Cell from './cell/Cell.js'; +import Image from './image/ImageBox.js'; +import CurrentRootChange from './undoable_changes/CurrentRootChange.js'; +import Shape from './shape/Shape.js'; +import Geometry from './geometry/Geometry.js'; +import ConnectionConstraint from './other/ConnectionConstraint.js'; +import type PopupMenuHandler from './plugins/PopupMenuHandler.js'; +import { getClientX, getClientY, getSource, isConsumed } from '../util/EventUtils.js'; +import { clone } from '../util/cloneUtils.js'; +import type { AbstractGraph } from './AbstractGraph.js'; +import { EdgeStyleRegistry } from './style/edge/EdgeStyleRegistry.js'; +import { PerimeterRegistry } from './style/perimeter/PerimeterRegistry.js'; +import type TooltipHandler from './plugins/TooltipHandler.js'; +import type { EdgeStyleFunction, MouseEventListener } from '../types.js'; +import { doEval } from '../internal/utils.js'; +import { isI18nEnabled } from '../internal/i18n-utils.js'; /** * @class GraphView diff --git a/packages/core/src/view/animate/Animation.ts b/packages/core/src/view/animate/Animation.ts index 0dc00f5dcf..dc6f6a442d 100644 --- a/packages/core/src/view/animate/Animation.ts +++ b/packages/core/src/view/animate/Animation.ts @@ -16,9 +16,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import EventSource from '../event/EventSource'; -import EventObject from '../event/EventObject'; -import InternalEvent from '../event/InternalEvent'; +import EventSource from '../event/EventSource.js'; +import EventObject from '../event/EventObject.js'; +import InternalEvent from '../event/InternalEvent.js'; /** * Implements a basic animation in JavaScript. diff --git a/packages/core/src/view/animate/Effects.ts b/packages/core/src/view/animate/Effects.ts index 5b64532a3e..f842aae2f0 100644 --- a/packages/core/src/view/animate/Effects.ts +++ b/packages/core/src/view/animate/Effects.ts @@ -16,16 +16,16 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { setOpacity } from '../../util/styleUtils'; -import GeometryChange from '../undoable_changes/GeometryChange'; -import TerminalChange from '../undoable_changes/TerminalChange'; -import ValueChange from '../undoable_changes/ValueChange'; -import ChildChange from '../undoable_changes/ChildChange'; -import StyleChange from '../undoable_changes/StyleChange'; -import type { AbstractGraph } from '../AbstractGraph'; -import type Cell from '../../view/cell/Cell'; -import { UndoableChange } from '../../types'; -import Geometry from '../geometry/Geometry'; +import { setOpacity } from '../../util/styleUtils.js'; +import GeometryChange from '../undoable_changes/GeometryChange.js'; +import TerminalChange from '../undoable_changes/TerminalChange.js'; +import ValueChange from '../undoable_changes/ValueChange.js'; +import ChildChange from '../undoable_changes/ChildChange.js'; +import StyleChange from '../undoable_changes/StyleChange.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import type Cell from '../../view/cell/Cell.js'; +import { UndoableChange } from '../../types.js'; +import Geometry from '../geometry/Geometry.js'; /** * Provides animation effects. diff --git a/packages/core/src/view/animate/Morphing.ts b/packages/core/src/view/animate/Morphing.ts index f03252047d..1f850d7b3b 100644 --- a/packages/core/src/view/animate/Morphing.ts +++ b/packages/core/src/view/animate/Morphing.ts @@ -16,12 +16,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Point from '../geometry/Point'; -import CellStatePreview from '../cell/CellStatePreview'; -import Animation from './Animation'; -import type CellState from '../cell/CellState'; -import type Cell from '../cell/Cell'; -import type { AbstractGraph } from '../AbstractGraph'; +import Point from '../geometry/Point.js'; +import CellStatePreview from '../cell/CellStatePreview.js'; +import Animation from './Animation.js'; +import type CellState from '../cell/CellState.js'; +import type Cell from '../cell/Cell.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; /** * Implements animation for morphing cells. diff --git a/packages/core/src/view/canvas/AbstractCanvas2D.ts b/packages/core/src/view/canvas/AbstractCanvas2D.ts index 1e0454f7bb..7d387cd587 100644 --- a/packages/core/src/view/canvas/AbstractCanvas2D.ts +++ b/packages/core/src/view/canvas/AbstractCanvas2D.ts @@ -16,11 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { arcToCurves, getRotatedPoint } from '../../util/mathUtils'; -import { DEFAULT_FONTFAMILY, DEFAULT_FONTSIZE, NONE } from '../../util/Constants'; -import UrlConverter from '../../util/UrlConverter'; -import Point from '../geometry/Point'; -import { clone } from '../../util/cloneUtils'; +import { arcToCurves, getRotatedPoint } from '../../util/mathUtils.js'; +import { DEFAULT_FONTFAMILY, DEFAULT_FONTSIZE, NONE } from '../../util/Constants.js'; +import UrlConverter from '../../util/UrlConverter.js'; +import Point from '../geometry/Point.js'; +import { clone } from '../../util/cloneUtils.js'; import type { AlignValue, @@ -30,8 +30,8 @@ import type { OverflowValue, TextDirectionValue, VAlignValue, -} from '../../types'; -import { StyleDefaultsConfig } from '../../util/config'; +} from '../../types.js'; +import { StyleDefaultsConfig } from '../../util/config.js'; /** * Base class for all canvases. diff --git a/packages/core/src/view/canvas/SvgCanvas2D.ts b/packages/core/src/view/canvas/SvgCanvas2D.ts index 34e85ef221..024ffff7d8 100644 --- a/packages/core/src/view/canvas/SvgCanvas2D.ts +++ b/packages/core/src/view/canvas/SvgCanvas2D.ts @@ -16,10 +16,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { isNullish, matchBinaryMask } from '../../internal/utils'; -import { mod } from '../../util/mathUtils'; -import { getAlignmentAsPoint } from '../../util/styleUtils'; -import Client from '../../Client'; +import { isNullish, matchBinaryMask } from '../../internal/utils.js'; +import { mod } from '../../util/mathUtils.js'; +import { getAlignmentAsPoint } from '../../util/styleUtils.js'; +import Client from '../../Client.js'; import { ABSOLUTE_LINE_HEIGHT, DEFAULT_FONTFAMILY, @@ -30,12 +30,12 @@ import { NS_SVG, NS_XLINK, WORD_WRAP, -} from '../../util/Constants'; -import Rectangle from '../geometry/Rectangle'; -import AbstractCanvas2D from './AbstractCanvas2D'; -import { getXml } from '../../util/xmlUtils'; -import { isNode, write } from '../../util/domUtils'; -import { htmlEntities, trim } from '../../util/StringUtils'; +} from '../../util/Constants.js'; +import Rectangle from '../geometry/Rectangle.js'; +import AbstractCanvas2D from './AbstractCanvas2D.js'; +import { getXml } from '../../util/xmlUtils.js'; +import { isNode, write } from '../../util/domUtils.js'; +import { htmlEntities, trim } from '../../util/StringUtils.js'; import { AlignValue, ColorValue, @@ -45,7 +45,7 @@ import { OverflowValue, TextDirectionValue, VAlignValue, -} from '../../types'; +} from '../../types.js'; // Activates workaround for gradient ID resolution if base tag is used. const useAbsoluteIds = diff --git a/packages/core/src/view/canvas/XmlCanvas2D.ts b/packages/core/src/view/canvas/XmlCanvas2D.ts index 7b50becc4a..0d524aa448 100644 --- a/packages/core/src/view/canvas/XmlCanvas2D.ts +++ b/packages/core/src/view/canvas/XmlCanvas2D.ts @@ -16,11 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import AbstractCanvas2D from './AbstractCanvas2D'; -import { DEFAULT_FONTFAMILY, DEFAULT_FONTSIZE, NONE } from '../../util/Constants'; -import { getOuterHtml, isNode } from '../../util/domUtils'; -import { DirectionValue, TextDirectionValue } from '../../types'; -import { StyleDefaultsConfig } from '../../util/config'; +import AbstractCanvas2D from './AbstractCanvas2D.js'; +import { DEFAULT_FONTFAMILY, DEFAULT_FONTSIZE, NONE } from '../../util/Constants.js'; +import { getOuterHtml, isNode } from '../../util/domUtils.js'; +import { DirectionValue, TextDirectionValue } from '../../types.js'; +import { StyleDefaultsConfig } from '../../util/config.js'; /** * @category Serialization diff --git a/packages/core/src/view/cell/Cell.ts b/packages/core/src/view/cell/Cell.ts index 671aed83f9..97476d08ad 100644 --- a/packages/core/src/view/cell/Cell.ts +++ b/packages/core/src/view/cell/Cell.ts @@ -16,14 +16,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Geometry from '../geometry/Geometry'; -import CellOverlay from './CellOverlay'; -import { clone } from '../../util/cloneUtils'; -import Point from '../geometry/Point'; -import CellPath from './CellPath'; -import type { CellStyle, FilterFunction, IdentityObject } from '../../types'; -import type { UserObject } from '../../internal/types'; -import { isElement, isNullish } from '../../internal/utils'; +import Geometry from '../geometry/Geometry.js'; +import CellOverlay from './CellOverlay.js'; +import { clone } from '../../util/cloneUtils.js'; +import Point from '../geometry/Point.js'; +import CellPath from './CellPath.js'; +import type { CellStyle, FilterFunction, IdentityObject } from '../../types.js'; +import type { UserObject } from '../../internal/types.js'; +import { isElement, isNullish } from '../../internal/utils.js'; /** * Cells are the elements of the graph model. They represent the state diff --git a/packages/core/src/view/cell/CellHighlight.ts b/packages/core/src/view/cell/CellHighlight.ts index c181ea2d41..ce57ac80f6 100644 --- a/packages/core/src/view/cell/CellHighlight.ts +++ b/packages/core/src/view/cell/CellHighlight.ts @@ -20,14 +20,14 @@ import { DEFAULT_VALID_COLOR, HIGHLIGHT_OPACITY, HIGHLIGHT_STROKEWIDTH, -} from '../../util/Constants'; -import InternalEvent from '../event/InternalEvent'; -import Rectangle from '../geometry/Rectangle'; -import type CellState from './CellState'; -import type { AbstractGraph } from '../AbstractGraph'; -import type Shape from '../shape/Shape'; - -import type { ColorValue } from '../../types'; +} from '../../util/Constants.js'; +import InternalEvent from '../event/InternalEvent.js'; +import Rectangle from '../geometry/Rectangle.js'; +import type CellState from './CellState.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import type Shape from '../shape/Shape.js'; + +import type { ColorValue } from '../../types.js'; /** * A helper class to highlight cells. Here is an example for a given cell. diff --git a/packages/core/src/view/cell/CellMarker.ts b/packages/core/src/view/cell/CellMarker.ts index c36d714495..e2f60777a1 100644 --- a/packages/core/src/view/cell/CellMarker.ts +++ b/packages/core/src/view/cell/CellMarker.ts @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import EventSource from '../event/EventSource'; +import EventSource from '../event/EventSource.js'; import { DEFAULT_HOTSPOT, DEFAULT_INVALID_COLOR, @@ -24,16 +24,16 @@ import { MAX_HOTSPOT_SIZE, MIN_HOTSPOT_SIZE, NONE, -} from '../../util/Constants'; -import CellHighlight from './CellHighlight'; -import EventObject from '../event/EventObject'; -import InternalEvent from '../event/InternalEvent'; -import { intersectsHotspot } from '../../util/mathUtils'; -import type { AbstractGraph } from '../AbstractGraph'; -import { ColorValue } from '../../types'; -import type CellState from './CellState'; -import InternalMouseEvent from '../event/InternalMouseEvent'; -import type Cell from './Cell'; +} from '../../util/Constants.js'; +import CellHighlight from './CellHighlight.js'; +import EventObject from '../event/EventObject.js'; +import InternalEvent from '../event/InternalEvent.js'; +import { intersectsHotspot } from '../../util/mathUtils.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import { ColorValue } from '../../types.js'; +import type CellState from './CellState.js'; +import InternalMouseEvent from '../event/InternalMouseEvent.js'; +import type Cell from './Cell.js'; /** * A helper class to process mouse locations and highlight cells. diff --git a/packages/core/src/view/cell/CellOverlay.ts b/packages/core/src/view/cell/CellOverlay.ts index a27613bc54..d246e27350 100644 --- a/packages/core/src/view/cell/CellOverlay.ts +++ b/packages/core/src/view/cell/CellOverlay.ts @@ -16,13 +16,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Point from '../geometry/Point'; -import Rectangle from '../geometry/Rectangle'; -import EventSource from '../event/EventSource'; -import ImageBox from '../image/ImageBox'; -import CellState from './CellState'; -import ObjectIdentity from '../../util/ObjectIdentity'; -import { AlignValue, VAlignValue } from '../../types'; +import Point from '../geometry/Point.js'; +import Rectangle from '../geometry/Rectangle.js'; +import EventSource from '../event/EventSource.js'; +import ImageBox from '../image/ImageBox.js'; +import CellState from './CellState.js'; +import ObjectIdentity from '../../util/ObjectIdentity.js'; +import { AlignValue, VAlignValue } from '../../types.js'; /** * Extends {@link EventSource} to implement a graph overlay, represented by an icon and a tooltip. diff --git a/packages/core/src/view/cell/CellPath.ts b/packages/core/src/view/cell/CellPath.ts index c7d006c335..68d4a640a9 100644 --- a/packages/core/src/view/cell/CellPath.ts +++ b/packages/core/src/view/cell/CellPath.ts @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Cell from './Cell'; +import Cell from './Cell.js'; /** * Implements a mechanism for temporary cell Ids. diff --git a/packages/core/src/view/cell/CellRenderer.ts b/packages/core/src/view/cell/CellRenderer.ts index 228f837047..1274959c3d 100644 --- a/packages/core/src/view/cell/CellRenderer.ts +++ b/packages/core/src/view/cell/CellRenderer.ts @@ -16,36 +16,36 @@ See the License for the specific language governing permissions and limitations under the License. */ -import RectangleShape from '../shape/node/RectangleShape'; -import ConnectorShape from '../shape/edge/ConnectorShape'; -import ImageShape from '../shape/node/ImageShape'; -import TextShape from '../shape/node/TextShape'; +import RectangleShape from '../shape/node/RectangleShape.js'; +import ConnectorShape from '../shape/edge/ConnectorShape.js'; +import ImageShape from '../shape/node/ImageShape.js'; +import TextShape from '../shape/node/TextShape.js'; import { DEFAULT_FONTFAMILY, DEFAULT_FONTSIZE, DEFAULT_FONTSTYLE, DEFAULT_TEXT_DIRECTION, NONE, -} from '../../util/Constants'; -import { getRotatedPoint, mod, toRadians } from '../../util/mathUtils'; -import { convertPoint } from '../../util/styleUtils'; -import { equalEntries, equalPoints } from '../../util/arrayUtils'; -import Rectangle from '../geometry/Rectangle'; -import { ShapeRegistry } from '../shape/ShapeRegistry'; -import { StencilShapeRegistry } from '../shape/stencil/StencilShapeRegistry'; -import InternalEvent from '../event/InternalEvent'; -import Client from '../../Client'; -import InternalMouseEvent from '../event/InternalMouseEvent'; -import EventObject from '../event/EventObject'; -import Point from '../geometry/Point'; -import Shape from '../shape/Shape'; -import CellState from './CellState'; -import Cell from './Cell'; -import CellOverlay from './CellOverlay'; -import { getClientX, getClientY, getSource } from '../../util/EventUtils'; -import { isNode } from '../../util/domUtils'; -import type { CellStateStyle, ShapeConstructor } from '../../types'; -import type SelectionCellsHandler from '../plugins/SelectionCellsHandler'; +} from '../../util/Constants.js'; +import { getRotatedPoint, mod, toRadians } from '../../util/mathUtils.js'; +import { convertPoint } from '../../util/styleUtils.js'; +import { equalEntries, equalPoints } from '../../util/arrayUtils.js'; +import Rectangle from '../geometry/Rectangle.js'; +import { ShapeRegistry } from '../shape/ShapeRegistry.js'; +import { StencilShapeRegistry } from '../shape/stencil/StencilShapeRegistry.js'; +import InternalEvent from '../event/InternalEvent.js'; +import Client from '../../Client.js'; +import InternalMouseEvent from '../event/InternalMouseEvent.js'; +import EventObject from '../event/EventObject.js'; +import Point from '../geometry/Point.js'; +import Shape from '../shape/Shape.js'; +import CellState from './CellState.js'; +import Cell from './Cell.js'; +import CellOverlay from './CellOverlay.js'; +import { getClientX, getClientY, getSource } from '../../util/EventUtils.js'; +import { isNode } from '../../util/domUtils.js'; +import type { CellStateStyle, ShapeConstructor } from '../../types.js'; +import type SelectionCellsHandler from '../plugins/SelectionCellsHandler.js'; const placeholderStyleValues = ['inherit', 'swimlane', 'indicated']; const placeholderStyleProperties: (keyof CellStateStyle)[] = [ diff --git a/packages/core/src/view/cell/CellState.ts b/packages/core/src/view/cell/CellState.ts index 9069dd89ee..445ed03aa5 100644 --- a/packages/core/src/view/cell/CellState.ts +++ b/packages/core/src/view/cell/CellState.ts @@ -16,16 +16,16 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Point from '../geometry/Point'; -import Rectangle from '../geometry/Rectangle'; -import type Cell from './Cell'; -import type GraphView from '../../view/GraphView'; -import type Shape from '../shape/Shape'; -import TextShape from '../shape/node/TextShape'; -import { NONE } from '../../util/Constants'; -import { CellStateStyle } from '../../types'; -import RectangleShape from '../shape/node/RectangleShape'; -import CellOverlay from './CellOverlay'; +import Point from '../geometry/Point.js'; +import Rectangle from '../geometry/Rectangle.js'; +import type Cell from './Cell.js'; +import type GraphView from '../../view/GraphView.js'; +import type Shape from '../shape/Shape.js'; +import TextShape from '../shape/node/TextShape.js'; +import { NONE } from '../../util/Constants.js'; +import { CellStateStyle } from '../../types.js'; +import RectangleShape from '../shape/node/RectangleShape.js'; +import CellOverlay from './CellOverlay.js'; /** * Represents the current state of a cell in a given {@link GraphView}. diff --git a/packages/core/src/view/cell/CellStatePreview.ts b/packages/core/src/view/cell/CellStatePreview.ts index c4b8997bff..9f26f26e28 100644 --- a/packages/core/src/view/cell/CellStatePreview.ts +++ b/packages/core/src/view/cell/CellStatePreview.ts @@ -16,11 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Point from '../geometry/Point'; -import type CellState from './CellState'; -import type Cell from './Cell'; -import type { AbstractGraph } from '../AbstractGraph'; -import type GraphView from '../GraphView'; +import Point from '../geometry/Point.js'; +import type CellState from './CellState.js'; +import type Cell from './Cell.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import type GraphView from '../GraphView.js'; // only used by the deltas property which is not supposed to be accessed directly (should be private) interface CellDelta { diff --git a/packages/core/src/view/cell/CellTracker.ts b/packages/core/src/view/cell/CellTracker.ts index bed31eee6c..4f626f1686 100644 --- a/packages/core/src/view/cell/CellTracker.ts +++ b/packages/core/src/view/cell/CellTracker.ts @@ -16,12 +16,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import CellMarker from './CellMarker'; -import InternalMouseEvent from '../event/InternalMouseEvent'; -import type { AbstractGraph } from '../AbstractGraph'; -import type Cell from './Cell'; -import EventSource from '../event/EventSource'; -import type { ColorValue, MouseListenerSet } from '../../types'; +import CellMarker from './CellMarker.js'; +import InternalMouseEvent from '../event/InternalMouseEvent.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import type Cell from './Cell.js'; +import EventSource from '../event/EventSource.js'; +import type { ColorValue, MouseListenerSet } from '../../types.js'; /** * Event handler that highlights cells diff --git a/packages/core/src/view/cell/TemporaryCellStates.ts b/packages/core/src/view/cell/TemporaryCellStates.ts index 31a94d7e01..ef1ff9c172 100644 --- a/packages/core/src/view/cell/TemporaryCellStates.ts +++ b/packages/core/src/view/cell/TemporaryCellStates.ts @@ -16,11 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Rectangle from '../geometry/Rectangle'; -import type GraphView from '../GraphView'; -import type Cell from './Cell'; -import type CellState from './CellState'; -import type Shape from '../shape/Shape'; +import Rectangle from '../geometry/Rectangle.js'; +import type GraphView from '../GraphView.js'; +import type Cell from './Cell.js'; +import type CellState from './CellState.js'; +import type Shape from '../shape/Shape.js'; /** * Creates a temporary set of cell states. diff --git a/packages/core/src/view/cell/VertexHandle.ts b/packages/core/src/view/cell/VertexHandle.ts index fe2f9eb04c..4badc8a41a 100644 --- a/packages/core/src/view/cell/VertexHandle.ts +++ b/packages/core/src/view/cell/VertexHandle.ts @@ -16,20 +16,20 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { getRotatedPoint, toRadians } from '../../util/mathUtils'; -import Point from '../geometry/Point'; -import ImageShape from '../shape/node/ImageShape'; -import Rectangle from '../geometry/Rectangle'; -import RectangleShape from '../shape/node/RectangleShape'; -import InternalEvent from '../event/InternalEvent'; -import type Shape from '../shape/Shape'; -import InternalMouseEvent from '../event/InternalMouseEvent'; -import ImageBox from '../image/ImageBox'; -import CellState from './CellState'; - -import type { AbstractGraph } from '../AbstractGraph'; -import type { CellHandle, CellStateStyle } from '../../types'; -import { HandleConfig } from '../handler/config'; +import { getRotatedPoint, toRadians } from '../../util/mathUtils.js'; +import Point from '../geometry/Point.js'; +import ImageShape from '../shape/node/ImageShape.js'; +import Rectangle from '../geometry/Rectangle.js'; +import RectangleShape from '../shape/node/RectangleShape.js'; +import InternalEvent from '../event/InternalEvent.js'; +import type Shape from '../shape/Shape.js'; +import InternalMouseEvent from '../event/InternalMouseEvent.js'; +import ImageBox from '../image/ImageBox.js'; +import CellState from './CellState.js'; + +import type { AbstractGraph } from '../AbstractGraph.js'; +import type { CellHandle, CellStateStyle } from '../../types.js'; +import { HandleConfig } from '../handler/config.js'; /** * Implements a single custom handle for vertices. diff --git a/packages/core/src/view/event/EventSource.ts b/packages/core/src/view/event/EventSource.ts index 7fa1907f51..f8bd3c1ba2 100644 --- a/packages/core/src/view/event/EventSource.ts +++ b/packages/core/src/view/event/EventSource.ts @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import EventObject from './EventObject'; +import EventObject from './EventObject.js'; type EventListenerObject = { funct: Function; diff --git a/packages/core/src/view/event/InternalEvent.ts b/packages/core/src/view/event/InternalEvent.ts index a5b2516df5..cc50fc94f1 100644 --- a/packages/core/src/view/event/InternalEvent.ts +++ b/packages/core/src/view/event/InternalEvent.ts @@ -16,18 +16,18 @@ See the License for the specific language governing permissions and limitations under the License. */ -import InternalMouseEvent from './InternalMouseEvent'; -import Client from '../../Client'; -import { isConsumed, isMouseEvent } from '../../util/EventUtils'; -import type CellState from '../cell/CellState'; +import InternalMouseEvent from './InternalMouseEvent.js'; +import Client from '../../Client.js'; +import { isConsumed, isMouseEvent } from '../../util/EventUtils.js'; +import type CellState from '../cell/CellState.js'; import type { EventCache, GestureEvent, KeyboardEventListener, Listenable, MouseEventListener, -} from '../../types'; -import type { AbstractGraph } from '../AbstractGraph'; +} from '../../types.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; // Checks if passive event listeners are supported // see https://github.com/Modernizr/Modernizr/issues/1894 diff --git a/packages/core/src/view/event/InternalMouseEvent.ts b/packages/core/src/view/event/InternalMouseEvent.ts index 121dcac522..d2725274d6 100644 --- a/packages/core/src/view/event/InternalMouseEvent.ts +++ b/packages/core/src/view/event/InternalMouseEvent.ts @@ -22,10 +22,10 @@ import { getSource, isMouseEvent, isPopupTrigger, -} from '../../util/EventUtils'; -import { isAncestorNode } from '../../util/domUtils'; -import CellState from '../cell/CellState'; -import Shape from '../shape/Shape'; +} from '../../util/EventUtils.js'; +import { isAncestorNode } from '../../util/domUtils.js'; +import CellState from '../cell/CellState.js'; +import Shape from '../shape/Shape.js'; /** * Base class for all mouse events in mxGraph. A listener for this event should diff --git a/packages/core/src/view/geometry/Geometry.ts b/packages/core/src/view/geometry/Geometry.ts index fd22d06d7d..90af305cc9 100644 --- a/packages/core/src/view/geometry/Geometry.ts +++ b/packages/core/src/view/geometry/Geometry.ts @@ -16,11 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Point from './Point'; -import Rectangle from './Rectangle'; -import { getRotatedPoint, toRadians } from '../../util/mathUtils'; -import { equalPoints } from '../../util/arrayUtils'; -import { clone } from '../../util/cloneUtils'; +import Point from './Point.js'; +import Rectangle from './Rectangle.js'; +import { getRotatedPoint, toRadians } from '../../util/mathUtils.js'; +import { equalPoints } from '../../util/arrayUtils.js'; +import { clone } from '../../util/cloneUtils.js'; /** * For vertices, the geometry consists of the x- and y-location, and the width diff --git a/packages/core/src/view/geometry/Rectangle.ts b/packages/core/src/view/geometry/Rectangle.ts index 8d4264e20f..d96230bb3c 100644 --- a/packages/core/src/view/geometry/Rectangle.ts +++ b/packages/core/src/view/geometry/Rectangle.ts @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Point from './Point'; +import Point from './Point.js'; /** * Extends {@link Point} to implement a 2-dimensional rectangle with double precision coordinates. diff --git a/packages/core/src/view/handler/ConstraintHandler.ts b/packages/core/src/view/handler/ConstraintHandler.ts index 8578b36254..b55830357e 100644 --- a/packages/core/src/view/handler/ConstraintHandler.ts +++ b/packages/core/src/view/handler/ConstraintHandler.ts @@ -16,26 +16,26 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Image from '../image/ImageBox'; -import Client from '../../Client'; +import Image from '../image/ImageBox.js'; +import Client from '../../Client.js'; import { DEFAULT_VALID_COLOR, HIGHLIGHT_OPACITY, HIGHLIGHT_SIZE, HIGHLIGHT_STROKEWIDTH, -} from '../../util/Constants'; -import InternalEvent from '../event/InternalEvent'; -import { intersects } from '../../util/mathUtils'; -import Rectangle from '../geometry/Rectangle'; -import ImageShape from '../shape/node/ImageShape'; -import RectangleShape from '../shape/node/RectangleShape'; -import { isShiftDown } from '../../util/EventUtils'; -import type { AbstractGraph } from '../AbstractGraph'; -import CellState from '../cell/CellState'; -import InternalMouseEvent from '../event/InternalMouseEvent'; -import ConnectionConstraint from '../other/ConnectionConstraint'; -import Point from '../geometry/Point'; -import type Cell from '../cell/Cell'; +} from '../../util/Constants.js'; +import InternalEvent from '../event/InternalEvent.js'; +import { intersects } from '../../util/mathUtils.js'; +import Rectangle from '../geometry/Rectangle.js'; +import ImageShape from '../shape/node/ImageShape.js'; +import RectangleShape from '../shape/node/RectangleShape.js'; +import { isShiftDown } from '../../util/EventUtils.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import CellState from '../cell/CellState.js'; +import InternalMouseEvent from '../event/InternalMouseEvent.js'; +import ConnectionConstraint from '../other/ConnectionConstraint.js'; +import Point from '../geometry/Point.js'; +import type Cell from '../cell/Cell.js'; /** * Handles constraints on connection targets. This class is in charge of diff --git a/packages/core/src/view/handler/EdgeHandler.ts b/packages/core/src/view/handler/EdgeHandler.ts index 2f9665b565..cbfd129481 100644 --- a/packages/core/src/view/handler/EdgeHandler.ts +++ b/packages/core/src/view/handler/EdgeHandler.ts @@ -16,8 +16,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import CellMarker from '../cell/CellMarker'; -import Point from '../geometry/Point'; +import CellMarker from '../cell/CellMarker.js'; +import Point from '../geometry/Point.js'; import { DEFAULT_HOTSPOT, DEFAULT_INVALID_COLOR, @@ -27,41 +27,46 @@ import { NONE, OUTLINE_HIGHLIGHT_COLOR, OUTLINE_HIGHLIGHT_STROKEWIDTH, -} from '../../util/Constants'; +} from '../../util/Constants.js'; import { contains, findNearestSegment, intersects, ptSegDistSq, -} from '../../util/mathUtils'; -import { convertPoint, getOffset, setOpacity } from '../../util/styleUtils'; -import EllipseShape from '../shape/node/EllipseShape'; -import ImageShape from '../shape/node/ImageShape'; -import RectangleShape from '../shape/node/RectangleShape'; -import ConnectionConstraint from '../other/ConnectionConstraint'; -import InternalEvent from '../event/InternalEvent'; -import ConstraintHandler from './ConstraintHandler'; -import Rectangle from '../geometry/Rectangle'; -import Client from '../../Client'; -import { EdgeStyle } from '../style/builtin-style-elements'; +} from '../../util/mathUtils.js'; +import { convertPoint, getOffset, setOpacity } from '../../util/styleUtils.js'; +import EllipseShape from '../shape/node/EllipseShape.js'; +import ImageShape from '../shape/node/ImageShape.js'; +import RectangleShape from '../shape/node/RectangleShape.js'; +import ConnectionConstraint from '../other/ConnectionConstraint.js'; +import InternalEvent from '../event/InternalEvent.js'; +import ConstraintHandler from './ConstraintHandler.js'; +import Rectangle from '../geometry/Rectangle.js'; +import Client from '../../Client.js'; +import { EdgeStyle } from '../style/builtin-style-elements.js'; import { getClientX, getClientY, isAltDown, isMouseEvent, isShiftDown, -} from '../../util/EventUtils'; -import type { AbstractGraph } from '../AbstractGraph'; -import CellState from '../cell/CellState'; -import Shape from '../shape/Shape'; -import type { CellHandle, ColorValue, Listenable, MouseListenerSet } from '../../types'; -import InternalMouseEvent from '../event/InternalMouseEvent'; -import Cell from '../cell/Cell'; -import ImageBox from '../image/ImageBox'; -import EventSource from '../event/EventSource'; -import type SelectionHandler from '../plugins/SelectionHandler'; -import { equalPoints } from '../../util/arrayUtils'; -import { EdgeHandlerConfig, HandleConfig } from './config'; +} from '../../util/EventUtils.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import CellState from '../cell/CellState.js'; +import Shape from '../shape/Shape.js'; +import type { + CellHandle, + ColorValue, + Listenable, + MouseListenerSet, +} from '../../types.js'; +import InternalMouseEvent from '../event/InternalMouseEvent.js'; +import Cell from '../cell/Cell.js'; +import ImageBox from '../image/ImageBox.js'; +import EventSource from '../event/EventSource.js'; +import type SelectionHandler from '../plugins/SelectionHandler.js'; +import { equalPoints } from '../../util/arrayUtils.js'; +import { EdgeHandlerConfig, HandleConfig } from './config.js'; /** * Graph event handler that reconnects edges, modifies control points and the edge label location. diff --git a/packages/core/src/view/handler/EdgeSegmentHandler.ts b/packages/core/src/view/handler/EdgeSegmentHandler.ts index 75f7cbfdb8..0d50d20874 100644 --- a/packages/core/src/view/handler/EdgeSegmentHandler.ts +++ b/packages/core/src/view/handler/EdgeSegmentHandler.ts @@ -16,15 +16,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Point from '../geometry/Point'; -import Rectangle from '../geometry/Rectangle'; -import { contains } from '../../util/mathUtils'; -import { setOpacity } from '../../util/styleUtils'; -import ElbowEdgeHandler from './ElbowEdgeHandler'; -import CellState from '../cell/CellState'; -import Cell from '../cell/Cell'; -import InternalMouseEvent from '../event/InternalMouseEvent'; -import { EdgeHandlerConfig } from './config'; +import Point from '../geometry/Point.js'; +import Rectangle from '../geometry/Rectangle.js'; +import { contains } from '../../util/mathUtils.js'; +import { setOpacity } from '../../util/styleUtils.js'; +import ElbowEdgeHandler from './ElbowEdgeHandler.js'; +import CellState from '../cell/CellState.js'; +import Cell from '../cell/Cell.js'; +import InternalMouseEvent from '../event/InternalMouseEvent.js'; +import { EdgeHandlerConfig } from './config.js'; class EdgeSegmentHandler extends ElbowEdgeHandler { constructor(state: CellState) { diff --git a/packages/core/src/view/handler/ElbowEdgeHandler.ts b/packages/core/src/view/handler/ElbowEdgeHandler.ts index a12d04d9d6..dace4e0529 100644 --- a/packages/core/src/view/handler/ElbowEdgeHandler.ts +++ b/packages/core/src/view/handler/ElbowEdgeHandler.ts @@ -16,15 +16,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -import EdgeHandler from './EdgeHandler'; -import InternalEvent from '../event/InternalEvent'; -import Point from '../geometry/Point'; -import Rectangle from '../geometry/Rectangle'; -import { intersects } from '../../util/mathUtils'; -import { isConsumed } from '../../util/EventUtils'; -import CellState from '../cell/CellState'; -import { EdgeHandlerConfig, HandleConfig } from './config'; -import { isI18nEnabled, translate } from '../../internal/i18n-utils'; +import EdgeHandler from './EdgeHandler.js'; +import InternalEvent from '../event/InternalEvent.js'; +import Point from '../geometry/Point.js'; +import Rectangle from '../geometry/Rectangle.js'; +import { intersects } from '../../util/mathUtils.js'; +import { isConsumed } from '../../util/EventUtils.js'; +import CellState from '../cell/CellState.js'; +import { EdgeHandlerConfig, HandleConfig } from './config.js'; +import { isI18nEnabled, translate } from '../../internal/i18n-utils.js'; /** * Graph event handler that reconnects edges and modifies control points and diff --git a/packages/core/src/view/handler/KeyHandler.ts b/packages/core/src/view/handler/KeyHandler.ts index 46b51e44e1..325ed78f82 100644 --- a/packages/core/src/view/handler/KeyHandler.ts +++ b/packages/core/src/view/handler/KeyHandler.ts @@ -16,17 +16,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type { AbstractGraph } from '../AbstractGraph'; -import InternalEvent from '../event/InternalEvent'; -import { isAncestorNode } from '../../util/domUtils'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import InternalEvent from '../event/InternalEvent.js'; +import { isAncestorNode } from '../../util/domUtils.js'; import { getSource, isAltDown, isConsumed, isControlDown as _isControlDown, isShiftDown, -} from '../../util/EventUtils'; -import type CellEditorHandler from '../plugins/CellEditorHandler'; +} from '../../util/EventUtils.js'; +import type CellEditorHandler from '../plugins/CellEditorHandler.js'; /** * Event handler that listens to keystroke events. This is not a singleton, diff --git a/packages/core/src/view/handler/VertexHandler.ts b/packages/core/src/view/handler/VertexHandler.ts index 7416b3c159..0c281a9f29 100644 --- a/packages/core/src/view/handler/VertexHandler.ts +++ b/packages/core/src/view/handler/VertexHandler.ts @@ -16,28 +16,28 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Rectangle from '../geometry/Rectangle'; -import { NONE } from '../../util/Constants'; -import InternalEvent from '../event/InternalEvent'; -import RectangleShape from '../shape/node/RectangleShape'; -import ImageShape from '../shape/node/ImageShape'; -import EllipseShape from '../shape/node/EllipseShape'; -import Point from '../geometry/Point'; -import { getRotatedPoint, intersects, mod, toRadians } from '../../util/mathUtils'; -import Client from '../../Client'; -import { isMouseEvent, isShiftDown } from '../../util/EventUtils'; -import type { AbstractGraph } from '../AbstractGraph'; -import CellState from '../cell/CellState'; -import Image from '../image/ImageBox'; -import type Cell from '../cell/Cell'; -import type { CellHandle, Listenable, MouseListenerSet } from '../../types'; -import Shape from '../shape/Shape'; -import InternalMouseEvent from '../event/InternalMouseEvent'; -import EdgeHandler from './EdgeHandler'; -import EventSource from '../event/EventSource'; -import type SelectionHandler from '../plugins/SelectionHandler'; -import type SelectionCellsHandler from '../plugins/SelectionCellsHandler'; -import { HandleConfig, VertexHandlerConfig } from './config'; +import Rectangle from '../geometry/Rectangle.js'; +import { NONE } from '../../util/Constants.js'; +import InternalEvent from '../event/InternalEvent.js'; +import RectangleShape from '../shape/node/RectangleShape.js'; +import ImageShape from '../shape/node/ImageShape.js'; +import EllipseShape from '../shape/node/EllipseShape.js'; +import Point from '../geometry/Point.js'; +import { getRotatedPoint, intersects, mod, toRadians } from '../../util/mathUtils.js'; +import Client from '../../Client.js'; +import { isMouseEvent, isShiftDown } from '../../util/EventUtils.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import CellState from '../cell/CellState.js'; +import Image from '../image/ImageBox.js'; +import type Cell from '../cell/Cell.js'; +import type { CellHandle, Listenable, MouseListenerSet } from '../../types.js'; +import Shape from '../shape/Shape.js'; +import InternalMouseEvent from '../event/InternalMouseEvent.js'; +import EdgeHandler from './EdgeHandler.js'; +import EventSource from '../event/EventSource.js'; +import type SelectionHandler from '../plugins/SelectionHandler.js'; +import type SelectionCellsHandler from '../plugins/SelectionCellsHandler.js'; +import { HandleConfig, VertexHandlerConfig } from './config.js'; /** * Event handler for resizing cells. diff --git a/packages/core/src/view/handler/config.ts b/packages/core/src/view/handler/config.ts index 4cdab40941..96e02a9056 100644 --- a/packages/core/src/view/handler/config.ts +++ b/packages/core/src/view/handler/config.ts @@ -27,8 +27,8 @@ import { VERTEX_SELECTION_COLOR, VERTEX_SELECTION_DASHED, VERTEX_SELECTION_STROKEWIDTH, -} from '../../util/Constants'; -import { shallowCopy } from '../../internal/clone-utils'; +} from '../../util/Constants.js'; +import { shallowCopy } from '../../internal/clone-utils.js'; /** * Describes {@link EdgeHandlerConfig}. diff --git a/packages/core/src/view/image/ImageExport.ts b/packages/core/src/view/image/ImageExport.ts index a71524a7e9..7d0868ad84 100644 --- a/packages/core/src/view/image/ImageExport.ts +++ b/packages/core/src/view/image/ImageExport.ts @@ -16,9 +16,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import AbstractCanvas2D from '../canvas/AbstractCanvas2D'; -import CellState from '../cell/CellState'; -import Shape from '../shape/Shape'; +import AbstractCanvas2D from '../canvas/AbstractCanvas2D.js'; +import CellState from '../cell/CellState.js'; +import Shape from '../shape/Shape.js'; /** * Creates a new image export instance to be used with an export canvas. diff --git a/packages/core/src/view/layout/CircleLayout.ts b/packages/core/src/view/layout/CircleLayout.ts index 716b8c91c8..bff3d1c40e 100644 --- a/packages/core/src/view/layout/CircleLayout.ts +++ b/packages/core/src/view/layout/CircleLayout.ts @@ -16,9 +16,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import GraphLayout from './GraphLayout'; -import type { AbstractGraph } from '../AbstractGraph'; -import type Cell from '../cell/Cell'; +import GraphLayout from './GraphLayout.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import type Cell from '../cell/Cell.js'; /** * Extends {@link GraphLayout} to implement a circular layout for a given radius. diff --git a/packages/core/src/view/layout/CompactTreeLayout.ts b/packages/core/src/view/layout/CompactTreeLayout.ts index 2b03a75caa..1992bf7cfb 100644 --- a/packages/core/src/view/layout/CompactTreeLayout.ts +++ b/packages/core/src/view/layout/CompactTreeLayout.ts @@ -16,15 +16,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Point from '../geometry/Point'; -import GraphLayout from './GraphLayout'; -import CellPath from '../cell/CellPath'; -import Rectangle from '../geometry/Rectangle'; -import { sortCells } from '../../util/styleUtils'; -import WeightedCellSorter from './util/WeightedCellSorter'; -import type Cell from '../cell/Cell'; -import type { AbstractGraph } from '../AbstractGraph'; -import { findTreeRoots } from '../../util/treeTraversal'; +import Point from '../geometry/Point.js'; +import GraphLayout from './GraphLayout.js'; +import CellPath from '../cell/CellPath.js'; +import Rectangle from '../geometry/Rectangle.js'; +import { sortCells } from '../../util/styleUtils.js'; +import WeightedCellSorter from './util/WeightedCellSorter.js'; +import type Cell from '../cell/Cell.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import { findTreeRoots } from '../../util/treeTraversal.js'; /** * @category Layout diff --git a/packages/core/src/view/layout/CompositeLayout.ts b/packages/core/src/view/layout/CompositeLayout.ts index 4c0943c6b1..719863db1d 100644 --- a/packages/core/src/view/layout/CompositeLayout.ts +++ b/packages/core/src/view/layout/CompositeLayout.ts @@ -16,9 +16,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Cell from '../cell/Cell'; -import type { AbstractGraph } from '../AbstractGraph'; -import GraphLayout from './GraphLayout'; +import type Cell from '../cell/Cell.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import GraphLayout from './GraphLayout.js'; /** * Allows to compose multiple layouts into a single layout. diff --git a/packages/core/src/view/layout/EdgeLabelLayout.ts b/packages/core/src/view/layout/EdgeLabelLayout.ts index 75ad7e5e2d..10c1e063cb 100644 --- a/packages/core/src/view/layout/EdgeLabelLayout.ts +++ b/packages/core/src/view/layout/EdgeLabelLayout.ts @@ -16,14 +16,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Point from '../geometry/Point'; -import GraphLayout from './GraphLayout'; -import { intersects } from '../../util/mathUtils'; -import type Cell from '../cell/Cell'; -import type { AbstractGraph } from '../AbstractGraph'; -import CellState from '../cell/CellState'; -import TextShape from '../shape/node/TextShape'; -import Rectangle from '../geometry/Rectangle'; +import Point from '../geometry/Point.js'; +import GraphLayout from './GraphLayout.js'; +import { intersects } from '../../util/mathUtils.js'; +import type Cell from '../cell/Cell.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import CellState from '../cell/CellState.js'; +import TextShape from '../shape/node/TextShape.js'; +import Rectangle from '../geometry/Rectangle.js'; /** * Extends {@link GraphLayout} to implement an edge label layout. This layout diff --git a/packages/core/src/view/layout/FastOrganicLayout.ts b/packages/core/src/view/layout/FastOrganicLayout.ts index dd01d082a7..b8e8a69d49 100644 --- a/packages/core/src/view/layout/FastOrganicLayout.ts +++ b/packages/core/src/view/layout/FastOrganicLayout.ts @@ -15,10 +15,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import ObjectIdentity from '../../util/ObjectIdentity'; -import GraphLayout from './GraphLayout'; -import type { AbstractGraph } from '../AbstractGraph'; -import type Cell from '../cell/Cell'; +import ObjectIdentity from '../../util/ObjectIdentity.js'; +import GraphLayout from './GraphLayout.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import type Cell from '../cell/Cell.js'; /** * Extends {@link GraphLayout} to implement a fast organic layout algorithm. diff --git a/packages/core/src/view/layout/GraphLayout.ts b/packages/core/src/view/layout/GraphLayout.ts index 66a9d16c85..0847d3b69b 100644 --- a/packages/core/src/view/layout/GraphLayout.ts +++ b/packages/core/src/view/layout/GraphLayout.ts @@ -16,12 +16,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Rectangle from '../geometry/Rectangle'; -import Geometry from '../geometry/Geometry'; -import Point from '../geometry/Point'; -import type { AbstractGraph } from '../AbstractGraph'; -import type Cell from '../cell/Cell'; -import { GraphLayoutTraverseArgs } from './types'; +import Rectangle from '../geometry/Rectangle.js'; +import Geometry from '../geometry/Geometry.js'; +import Point from '../geometry/Point.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import type Cell from '../cell/Cell.js'; +import { GraphLayoutTraverseArgs } from './types.js'; /** * Base class for all layout algorithms in maxGraph. diff --git a/packages/core/src/view/layout/HierarchicalLayout.ts b/packages/core/src/view/layout/HierarchicalLayout.ts index dce60816c3..d5c99458b8 100644 --- a/packages/core/src/view/layout/HierarchicalLayout.ts +++ b/packages/core/src/view/layout/HierarchicalLayout.ts @@ -16,17 +16,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -import GraphLayout from './GraphLayout'; -import type { DirectionValue } from '../../types'; -import HierarchicalEdgeStyle from './datatypes/HierarchicalEdgeStyle'; -import GraphHierarchyModel from './hierarchical/GraphHierarchyModel'; -import ObjectIdentity from '../../util/ObjectIdentity'; -import MinimumCycleRemover from './hierarchical/MinimumCycleRemover'; -import MedianHybridCrossingReduction from './hierarchical/MedianHybridCrossingReduction'; -import CoordinateAssignment from './hierarchical/CoordinateAssignment'; -import type { AbstractGraph } from '../AbstractGraph'; -import type Cell from '../cell/Cell'; -import { HierarchicalGraphLayoutTraverseArgs } from './types'; +import GraphLayout from './GraphLayout.js'; +import type { DirectionValue } from '../../types.js'; +import HierarchicalEdgeStyle from './datatypes/HierarchicalEdgeStyle.js'; +import GraphHierarchyModel from './hierarchical/GraphHierarchyModel.js'; +import ObjectIdentity from '../../util/ObjectIdentity.js'; +import MinimumCycleRemover from './hierarchical/MinimumCycleRemover.js'; +import MedianHybridCrossingReduction from './hierarchical/MedianHybridCrossingReduction.js'; +import CoordinateAssignment from './hierarchical/CoordinateAssignment.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import type Cell from '../cell/Cell.js'; +import { HierarchicalGraphLayoutTraverseArgs } from './types.js'; /** * A hierarchical layout algorithm. diff --git a/packages/core/src/view/layout/LayoutManager.ts b/packages/core/src/view/layout/LayoutManager.ts index 32051c788f..130045bd4e 100644 --- a/packages/core/src/view/layout/LayoutManager.ts +++ b/packages/core/src/view/layout/LayoutManager.ts @@ -16,22 +16,22 @@ See the License for the specific language governing permissions and limitations under the License. */ -import EventSource from '../event/EventSource'; -import InternalEvent from '../event/InternalEvent'; -import { convertPoint, sortCells } from '../../util/styleUtils'; -import RootChange from '../undoable_changes/RootChange'; -import ChildChange from '../undoable_changes/ChildChange'; -import TerminalChange from '../undoable_changes/TerminalChange'; -import GeometryChange from '../undoable_changes/GeometryChange'; -import VisibleChange from '../undoable_changes/VisibleChange'; -import StyleChange from '../undoable_changes/StyleChange'; -import EventObject from '../event/EventObject'; -import type Cell from '../cell/Cell'; -import Rectangle from '../geometry/Rectangle'; -import { getClientX, getClientY } from '../../util/EventUtils'; -import type { AbstractGraph } from '../AbstractGraph'; -import GraphLayout from './GraphLayout'; -import UndoableEdit from '../undoable_changes/UndoableEdit'; +import EventSource from '../event/EventSource.js'; +import InternalEvent from '../event/InternalEvent.js'; +import { convertPoint, sortCells } from '../../util/styleUtils.js'; +import RootChange from '../undoable_changes/RootChange.js'; +import ChildChange from '../undoable_changes/ChildChange.js'; +import TerminalChange from '../undoable_changes/TerminalChange.js'; +import GeometryChange from '../undoable_changes/GeometryChange.js'; +import VisibleChange from '../undoable_changes/VisibleChange.js'; +import StyleChange from '../undoable_changes/StyleChange.js'; +import EventObject from '../event/EventObject.js'; +import type Cell from '../cell/Cell.js'; +import Rectangle from '../geometry/Rectangle.js'; +import { getClientX, getClientY } from '../../util/EventUtils.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import GraphLayout from './GraphLayout.js'; +import UndoableEdit from '../undoable_changes/UndoableEdit.js'; /** * Implements a layout manager that runs a given layout after any changes to the graph: diff --git a/packages/core/src/view/layout/ParallelEdgeLayout.ts b/packages/core/src/view/layout/ParallelEdgeLayout.ts index ea27477f2b..cf9b25fec6 100644 --- a/packages/core/src/view/layout/ParallelEdgeLayout.ts +++ b/packages/core/src/view/layout/ParallelEdgeLayout.ts @@ -16,12 +16,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Point from '../geometry/Point'; -import GraphLayout from './GraphLayout'; -import ObjectIdentity from '../../util/ObjectIdentity'; -import type { AbstractGraph } from '../AbstractGraph'; -import type Cell from '../cell/Cell'; -import Geometry from '../geometry/Geometry'; +import Point from '../geometry/Point.js'; +import GraphLayout from './GraphLayout.js'; +import ObjectIdentity from '../../util/ObjectIdentity.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import type Cell from '../cell/Cell.js'; +import Geometry from '../geometry/Geometry.js'; /** * Extends {@link GraphLayout} for arranging parallel edges. This layout works diff --git a/packages/core/src/view/layout/PartitionLayout.ts b/packages/core/src/view/layout/PartitionLayout.ts index 6f75b810d3..d124a2ff5c 100644 --- a/packages/core/src/view/layout/PartitionLayout.ts +++ b/packages/core/src/view/layout/PartitionLayout.ts @@ -16,10 +16,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Rectangle from '../geometry/Rectangle'; -import GraphLayout from './GraphLayout'; -import type { AbstractGraph } from '../AbstractGraph'; -import type Cell from '../cell/Cell'; +import Rectangle from '../geometry/Rectangle.js'; +import GraphLayout from './GraphLayout.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import type Cell from '../cell/Cell.js'; /** * Extends {@link GraphLayout} for partitioning the parent cell vertically or diff --git a/packages/core/src/view/layout/RadialTreeLayout.ts b/packages/core/src/view/layout/RadialTreeLayout.ts index 4fbac515b6..c297db0081 100644 --- a/packages/core/src/view/layout/RadialTreeLayout.ts +++ b/packages/core/src/view/layout/RadialTreeLayout.ts @@ -20,9 +20,9 @@ import { CompactTreeLayout, _mxCompactTreeLayoutLine, _mxCompactTreeLayoutNode, -} from './CompactTreeLayout'; -import type Cell from '../cell/Cell'; -import type { AbstractGraph } from '../AbstractGraph'; +} from './CompactTreeLayout.js'; +import type Cell from '../cell/Cell.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; /** * Extends {@link CompactTreeLayout} to implement a radial tree algorithm. This diff --git a/packages/core/src/view/layout/StackLayout.ts b/packages/core/src/view/layout/StackLayout.ts index c0a36d5691..98fcb00912 100644 --- a/packages/core/src/view/layout/StackLayout.ts +++ b/packages/core/src/view/layout/StackLayout.ts @@ -16,11 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import GraphLayout from './GraphLayout'; -import { DEFAULT_STARTSIZE } from '../../util/Constants'; -import type { AbstractGraph } from '../AbstractGraph'; -import type Cell from '../cell/Cell'; -import Geometry from '../geometry/Geometry'; +import GraphLayout from './GraphLayout.js'; +import { DEFAULT_STARTSIZE } from '../../util/Constants.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import type Cell from '../cell/Cell.js'; +import Geometry from '../geometry/Geometry.js'; /** * Extends {@link GraphLayout} to create a horizontal or vertical stack of the child vertices. diff --git a/packages/core/src/view/layout/SwimlaneLayout.ts b/packages/core/src/view/layout/SwimlaneLayout.ts index 1df10c8e62..e389586760 100644 --- a/packages/core/src/view/layout/SwimlaneLayout.ts +++ b/packages/core/src/view/layout/SwimlaneLayout.ts @@ -16,19 +16,19 @@ See the License for the specific language governing permissions and limitations under the License. */ -import GraphLayout from './GraphLayout'; -import type { DirectionValue } from '../../types'; -import HierarchicalEdgeStyle from './datatypes/HierarchicalEdgeStyle'; -import Rectangle from '../geometry/Rectangle'; -import SwimlaneModel from './hierarchical/SwimlaneModel'; -import ObjectIdentity from '../../util/ObjectIdentity'; -import SwimlaneOrdering from './hierarchical/SwimlaneOrdering'; -import MedianHybridCrossingReduction from './hierarchical/MedianHybridCrossingReduction'; -import CoordinateAssignment from './hierarchical/CoordinateAssignment'; -import type { AbstractGraph } from '../AbstractGraph'; -import type Cell from '../cell/Cell'; -import Geometry from '../../view/geometry/Geometry'; -import { SwimlaneGraphLayoutTraverseArgs } from './types'; +import GraphLayout from './GraphLayout.js'; +import type { DirectionValue } from '../../types.js'; +import HierarchicalEdgeStyle from './datatypes/HierarchicalEdgeStyle.js'; +import Rectangle from '../geometry/Rectangle.js'; +import SwimlaneModel from './hierarchical/SwimlaneModel.js'; +import ObjectIdentity from '../../util/ObjectIdentity.js'; +import SwimlaneOrdering from './hierarchical/SwimlaneOrdering.js'; +import MedianHybridCrossingReduction from './hierarchical/MedianHybridCrossingReduction.js'; +import CoordinateAssignment from './hierarchical/CoordinateAssignment.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import type Cell from '../cell/Cell.js'; +import Geometry from '../../view/geometry/Geometry.js'; +import { SwimlaneGraphLayoutTraverseArgs } from './types.js'; /** * A hierarchical layout algorithm. diff --git a/packages/core/src/view/layout/SwimlaneManager.ts b/packages/core/src/view/layout/SwimlaneManager.ts index e3d6989ec6..f3ed22a70d 100644 --- a/packages/core/src/view/layout/SwimlaneManager.ts +++ b/packages/core/src/view/layout/SwimlaneManager.ts @@ -16,12 +16,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import EventSource from '../event/EventSource'; -import InternalEvent from '../event/InternalEvent'; -import Rectangle from '../geometry/Rectangle'; -import type { AbstractGraph } from '../AbstractGraph'; -import EventObject from '../event/EventObject'; -import type Cell from '../cell/Cell'; +import EventSource from '../event/EventSource.js'; +import InternalEvent from '../event/InternalEvent.js'; +import Rectangle from '../geometry/Rectangle.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import EventObject from '../event/EventObject.js'; +import type Cell from '../cell/Cell.js'; /** * Manager for swimlanes and nested swimlanes that sets the size of newly added diff --git a/packages/core/src/view/layout/datatypes/GraphAbstractHierarchyCell.ts b/packages/core/src/view/layout/datatypes/GraphAbstractHierarchyCell.ts index e0349af38f..dbe33505f4 100644 --- a/packages/core/src/view/layout/datatypes/GraphAbstractHierarchyCell.ts +++ b/packages/core/src/view/layout/datatypes/GraphAbstractHierarchyCell.ts @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Cell from '../../cell/Cell'; +import Cell from '../../cell/Cell.js'; /** * An abstraction of an internal hierarchy node or edge. diff --git a/packages/core/src/view/layout/datatypes/GraphHierarchyEdge.ts b/packages/core/src/view/layout/datatypes/GraphHierarchyEdge.ts index 733292792c..5953473e17 100644 --- a/packages/core/src/view/layout/datatypes/GraphHierarchyEdge.ts +++ b/packages/core/src/view/layout/datatypes/GraphHierarchyEdge.ts @@ -16,10 +16,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import GraphAbstractHierarchyCell from './GraphAbstractHierarchyCell'; -import ObjectIdentity from '../../../util/ObjectIdentity'; -import Cell from '../../cell/Cell'; -import GraphHierarchyNode from './GraphHierarchyNode'; +import GraphAbstractHierarchyCell from './GraphAbstractHierarchyCell.js'; +import ObjectIdentity from '../../../util/ObjectIdentity.js'; +import Cell from '../../cell/Cell.js'; +import GraphHierarchyNode from './GraphHierarchyNode.js'; /** * An abstraction of a hierarchical edge for the hierarchy layout diff --git a/packages/core/src/view/layout/datatypes/GraphHierarchyNode.ts b/packages/core/src/view/layout/datatypes/GraphHierarchyNode.ts index 596e5396cc..022557a95f 100644 --- a/packages/core/src/view/layout/datatypes/GraphHierarchyNode.ts +++ b/packages/core/src/view/layout/datatypes/GraphHierarchyNode.ts @@ -16,10 +16,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import GraphAbstractHierarchyCell from './GraphAbstractHierarchyCell'; -import ObjectIdentity from '../../../util/ObjectIdentity'; -import Cell from '../../cell/Cell'; -import GraphHierarchyEdge from './GraphHierarchyEdge'; +import GraphAbstractHierarchyCell from './GraphAbstractHierarchyCell.js'; +import ObjectIdentity from '../../../util/ObjectIdentity.js'; +import Cell from '../../cell/Cell.js'; +import GraphHierarchyEdge from './GraphHierarchyEdge.js'; /** * An abstraction of a hierarchical edge for the hierarchy layout diff --git a/packages/core/src/view/layout/hierarchical/CoordinateAssignment.ts b/packages/core/src/view/layout/hierarchical/CoordinateAssignment.ts index 0fa0bc8129..7253a2d18c 100644 --- a/packages/core/src/view/layout/hierarchical/CoordinateAssignment.ts +++ b/packages/core/src/view/layout/hierarchical/CoordinateAssignment.ts @@ -16,21 +16,21 @@ See the License for the specific language governing permissions and limitations under the License. */ -import HierarchicalLayoutStage from './HierarchicalLayoutStage'; -import type { DirectionValue } from '../../../types'; -import { GlobalConfig } from '../../../util/config'; -import WeightedCellSorter from '../util/WeightedCellSorter'; -import Point from '../../geometry/Point'; -import HierarchicalEdgeStyle from '../datatypes/HierarchicalEdgeStyle'; -import HierarchicalLayout from '../HierarchicalLayout'; -import GraphHierarchyModel from './GraphHierarchyModel'; -import Cell from '../../../view/cell/Cell'; -import GraphHierarchyNode from '../datatypes/GraphHierarchyNode'; -import GraphAbstractHierarchyCell from '../datatypes/GraphAbstractHierarchyCell'; -import type { AbstractGraph } from '../../AbstractGraph'; -import Geometry from '../../../view/geometry/Geometry'; -import GraphHierarchyEdge from '../datatypes/GraphHierarchyEdge'; -import SwimlaneLayout from '../SwimlaneLayout'; +import HierarchicalLayoutStage from './HierarchicalLayoutStage.js'; +import type { DirectionValue } from '../../../types.js'; +import { GlobalConfig } from '../../../util/config.js'; +import WeightedCellSorter from '../util/WeightedCellSorter.js'; +import Point from '../../geometry/Point.js'; +import HierarchicalEdgeStyle from '../datatypes/HierarchicalEdgeStyle.js'; +import HierarchicalLayout from '../HierarchicalLayout.js'; +import GraphHierarchyModel from './GraphHierarchyModel.js'; +import Cell from '../../../view/cell/Cell.js'; +import GraphHierarchyNode from '../datatypes/GraphHierarchyNode.js'; +import GraphAbstractHierarchyCell from '../datatypes/GraphAbstractHierarchyCell.js'; +import type { AbstractGraph } from '../../AbstractGraph.js'; +import Geometry from '../../../view/geometry/Geometry.js'; +import GraphHierarchyEdge from '../datatypes/GraphHierarchyEdge.js'; +import SwimlaneLayout from '../SwimlaneLayout.js'; /** * Sets the horizontal locations of node and edge dummy nodes on each layer. diff --git a/packages/core/src/view/layout/hierarchical/GraphHierarchyModel.ts b/packages/core/src/view/layout/hierarchical/GraphHierarchyModel.ts index 118f3480ed..d2f23dbeed 100644 --- a/packages/core/src/view/layout/hierarchical/GraphHierarchyModel.ts +++ b/packages/core/src/view/layout/hierarchical/GraphHierarchyModel.ts @@ -16,11 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import GraphHierarchyNode from '../datatypes/GraphHierarchyNode'; -import GraphHierarchyEdge from '../datatypes/GraphHierarchyEdge'; -import Cell from '../../cell/Cell'; -import HierarchicalLayout from '../HierarchicalLayout'; -import GraphAbstractHierarchyCell from '../datatypes/GraphAbstractHierarchyCell'; +import GraphHierarchyNode from '../datatypes/GraphHierarchyNode.js'; +import GraphHierarchyEdge from '../datatypes/GraphHierarchyEdge.js'; +import Cell from '../../cell/Cell.js'; +import HierarchicalLayout from '../HierarchicalLayout.js'; +import GraphAbstractHierarchyCell from '../datatypes/GraphAbstractHierarchyCell.js'; /** * Internal model of a hierarchical graph. This model stores nodes and edges diff --git a/packages/core/src/view/layout/hierarchical/MedianHybridCrossingReduction.ts b/packages/core/src/view/layout/hierarchical/MedianHybridCrossingReduction.ts index 51644f8f6c..8785d301b3 100644 --- a/packages/core/src/view/layout/hierarchical/MedianHybridCrossingReduction.ts +++ b/packages/core/src/view/layout/hierarchical/MedianHybridCrossingReduction.ts @@ -16,12 +16,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import HierarchicalLayout from '../HierarchicalLayout'; -import GraphAbstractHierarchyCell from '../datatypes/GraphAbstractHierarchyCell'; -import GraphHierarchyModel from './GraphHierarchyModel'; -import HierarchicalLayoutStage from './HierarchicalLayoutStage'; -import MedianCellSorter from '../util/MedianCellSorter'; -import SwimlaneLayout from '../SwimlaneLayout'; +import HierarchicalLayout from '../HierarchicalLayout.js'; +import GraphAbstractHierarchyCell from '../datatypes/GraphAbstractHierarchyCell.js'; +import GraphHierarchyModel from './GraphHierarchyModel.js'; +import HierarchicalLayoutStage from './HierarchicalLayoutStage.js'; +import MedianCellSorter from '../util/MedianCellSorter.js'; +import SwimlaneLayout from '../SwimlaneLayout.js'; /** * Sets the horizontal locations of node and edge dummy nodes on each layer. diff --git a/packages/core/src/view/layout/hierarchical/MinimumCycleRemover.ts b/packages/core/src/view/layout/hierarchical/MinimumCycleRemover.ts index d17b0ea058..aa737db659 100644 --- a/packages/core/src/view/layout/hierarchical/MinimumCycleRemover.ts +++ b/packages/core/src/view/layout/hierarchical/MinimumCycleRemover.ts @@ -16,14 +16,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -import HierarchicalLayoutStage from './HierarchicalLayoutStage'; -import { remove } from '../../../util/arrayUtils'; -import { clone } from '../../../util/cloneUtils'; -import Cell from '../../cell/Cell'; -import GraphHierarchyNode from '../datatypes/GraphHierarchyNode'; -import GraphHierarchyEdge from '../datatypes/GraphHierarchyEdge'; -import HierarchicalLayout from '../HierarchicalLayout'; -import GraphHierarchyModel from './GraphHierarchyModel'; +import HierarchicalLayoutStage from './HierarchicalLayoutStage.js'; +import { remove } from '../../../util/arrayUtils.js'; +import { clone } from '../../../util/cloneUtils.js'; +import Cell from '../../cell/Cell.js'; +import GraphHierarchyNode from '../datatypes/GraphHierarchyNode.js'; +import GraphHierarchyEdge from '../datatypes/GraphHierarchyEdge.js'; +import HierarchicalLayout from '../HierarchicalLayout.js'; +import GraphHierarchyModel from './GraphHierarchyModel.js'; /** * An implementation of the first stage of the Sugiyama layout. Straightforward diff --git a/packages/core/src/view/layout/hierarchical/SwimlaneModel.ts b/packages/core/src/view/layout/hierarchical/SwimlaneModel.ts index 5218e85949..8fe797ef1d 100644 --- a/packages/core/src/view/layout/hierarchical/SwimlaneModel.ts +++ b/packages/core/src/view/layout/hierarchical/SwimlaneModel.ts @@ -16,12 +16,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import GraphHierarchyNode from '../datatypes/GraphHierarchyNode'; -import GraphHierarchyEdge from '../datatypes/GraphHierarchyEdge'; -import CellPath from '../../cell/CellPath'; -import Cell from '../../cell/Cell'; -import { clone } from '../../../util/cloneUtils'; -import SwimlaneLayout from '../SwimlaneLayout'; +import GraphHierarchyNode from '../datatypes/GraphHierarchyNode.js'; +import GraphHierarchyEdge from '../datatypes/GraphHierarchyEdge.js'; +import CellPath from '../../cell/CellPath.js'; +import Cell from '../../cell/Cell.js'; +import { clone } from '../../../util/cloneUtils.js'; +import SwimlaneLayout from '../SwimlaneLayout.js'; /** * Internal model of a hierarchical graph. This model stores nodes and edges diff --git a/packages/core/src/view/layout/hierarchical/SwimlaneOrdering.ts b/packages/core/src/view/layout/hierarchical/SwimlaneOrdering.ts index feaa9ba9cf..314e89609b 100644 --- a/packages/core/src/view/layout/hierarchical/SwimlaneOrdering.ts +++ b/packages/core/src/view/layout/hierarchical/SwimlaneOrdering.ts @@ -16,15 +16,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -import HierarchicalLayoutStage from './HierarchicalLayoutStage'; -import { remove } from '../../../util/arrayUtils'; -import CellPath from '../../cell/CellPath'; -import { clone } from '../../../util/cloneUtils'; -import Cell from '../../../view/cell/Cell'; -import GraphHierarchyNode from '../datatypes/GraphHierarchyNode'; -import GraphHierarchyEdge from '../datatypes/GraphHierarchyEdge'; -import SwimlaneLayout from '../SwimlaneLayout'; -import SwimlaneModel from './SwimlaneModel'; +import HierarchicalLayoutStage from './HierarchicalLayoutStage.js'; +import { remove } from '../../../util/arrayUtils.js'; +import CellPath from '../../cell/CellPath.js'; +import { clone } from '../../../util/cloneUtils.js'; +import Cell from '../../../view/cell/Cell.js'; +import GraphHierarchyNode from '../datatypes/GraphHierarchyNode.js'; +import GraphHierarchyEdge from '../datatypes/GraphHierarchyEdge.js'; +import SwimlaneLayout from '../SwimlaneLayout.js'; +import SwimlaneModel from './SwimlaneModel.js'; /** * An implementation of the first stage of the Sugiyama layout. Straightforward diff --git a/packages/core/src/view/layout/types.ts b/packages/core/src/view/layout/types.ts index 02297d7553..2b669f27fe 100644 --- a/packages/core/src/view/layout/types.ts +++ b/packages/core/src/view/layout/types.ts @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Cell from '../cell/Cell'; -import type GraphHierarchyNode from './datatypes/GraphHierarchyNode'; +import type Cell from '../cell/Cell.js'; +import type GraphHierarchyNode from './datatypes/GraphHierarchyNode.js'; /** * @category Layout diff --git a/packages/core/src/view/layout/util/MedianCellSorter.ts b/packages/core/src/view/layout/util/MedianCellSorter.ts index 31610dba48..b82ae8b8d3 100644 --- a/packages/core/src/view/layout/util/MedianCellSorter.ts +++ b/packages/core/src/view/layout/util/MedianCellSorter.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import GraphAbstractHierarchyCell from '../datatypes/GraphAbstractHierarchyCell'; +import GraphAbstractHierarchyCell from '../datatypes/GraphAbstractHierarchyCell.js'; /** * A utility class used to track cells whilst sorting occurs on the median diff --git a/packages/core/src/view/layout/util/WeightedCellSorter.ts b/packages/core/src/view/layout/util/WeightedCellSorter.ts index bb65404b04..6ac9ebbed1 100644 --- a/packages/core/src/view/layout/util/WeightedCellSorter.ts +++ b/packages/core/src/view/layout/util/WeightedCellSorter.ts @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { _mxCompactTreeLayoutNode } from '../CompactTreeLayout'; -import GraphAbstractHierarchyCell from '../datatypes/GraphAbstractHierarchyCell'; +import { _mxCompactTreeLayoutNode } from '../CompactTreeLayout.js'; +import GraphAbstractHierarchyCell from '../datatypes/GraphAbstractHierarchyCell.js'; /** * A utility class used to track cells whilst sorting occurs on the weighted diff --git a/packages/core/src/view/mixins/CellsMixin.ts b/packages/core/src/view/mixins/CellsMixin.ts index 2805dd4a43..26b26f2a00 100644 --- a/packages/core/src/view/mixins/CellsMixin.ts +++ b/packages/core/src/view/mixins/CellsMixin.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Cell from '../cell/Cell'; +import Cell from '../cell/Cell.js'; import { contains, getBoundingBox, @@ -22,22 +22,22 @@ import { intersects, ptSegDistSq, toRadians, -} from '../../util/mathUtils'; +} from '../../util/mathUtils.js'; import { getSizeForString, setCellStyleFlags, setCellStyles, -} from '../../util/styleUtils'; -import { DEFAULT_FONTSIZE, DEFAULT_IMAGESIZE } from '../../util/Constants'; -import Geometry from '../geometry/Geometry'; -import EventObject from '../event/EventObject'; -import InternalEvent from '../event/InternalEvent'; -import Rectangle from '../geometry/Rectangle'; -import Point from '../geometry/Point'; -import { htmlEntities } from '../../util/StringUtils'; -import CellState from '../cell/CellState'; -import type { AbstractGraph } from '../AbstractGraph'; -import { cloneCells, getTopmostCells } from '../../util/cellArrayUtils'; +} from '../../util/styleUtils.js'; +import { DEFAULT_FONTSIZE, DEFAULT_IMAGESIZE } from '../../util/Constants.js'; +import Geometry from '../geometry/Geometry.js'; +import EventObject from '../event/EventObject.js'; +import InternalEvent from '../event/InternalEvent.js'; +import Rectangle from '../geometry/Rectangle.js'; +import Point from '../geometry/Point.js'; +import { htmlEntities } from '../../util/StringUtils.js'; +import CellState from '../cell/CellState.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import { cloneCells, getTopmostCells } from '../../util/cellArrayUtils.js'; type PartialGraph = Pick< AbstractGraph, diff --git a/packages/core/src/view/mixins/CellsMixin.type.ts b/packages/core/src/view/mixins/CellsMixin.type.ts index 9ce7ccd813..c58310349c 100644 --- a/packages/core/src/view/mixins/CellsMixin.type.ts +++ b/packages/core/src/view/mixins/CellsMixin.type.ts @@ -14,17 +14,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Cell from '../cell/Cell'; -import type Rectangle from '../geometry/Rectangle'; +import type Cell from '../cell/Cell.js'; +import type Rectangle from '../geometry/Rectangle.js'; import type { AlignValue, CellStateStyle, CellStyle, NumericCellStateStyleKeys, VAlignValue, -} from '../../types'; -import type Geometry from '../geometry/Geometry'; -import type CellState from '../cell/CellState'; +} from '../../types.js'; +import type Geometry from '../geometry/Geometry.js'; +import type CellState from '../cell/CellState.js'; declare module '../AbstractGraph' { interface AbstractGraph { diff --git a/packages/core/src/view/mixins/ConnectionsMixin.ts b/packages/core/src/view/mixins/ConnectionsMixin.ts index 03ea1ded02..b2dea9fd49 100644 --- a/packages/core/src/view/mixins/ConnectionsMixin.ts +++ b/packages/core/src/view/mixins/ConnectionsMixin.ts @@ -14,14 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Point from '../geometry/Point'; -import ConnectionConstraint from '../other/ConnectionConstraint'; -import { getRotatedPoint, toRadians } from '../../util/mathUtils'; -import Cell from '../cell/Cell'; -import EventObject from '../event/EventObject'; -import InternalEvent from '../event/InternalEvent'; -import type { AbstractGraph } from '../AbstractGraph'; -import type ConnectionHandler from '../plugins/ConnectionHandler'; +import Point from '../geometry/Point.js'; +import ConnectionConstraint from '../other/ConnectionConstraint.js'; +import { getRotatedPoint, toRadians } from '../../util/mathUtils.js'; +import Cell from '../cell/Cell.js'; +import EventObject from '../event/EventObject.js'; +import InternalEvent from '../event/InternalEvent.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import type ConnectionHandler from '../plugins/ConnectionHandler.js'; type PartialGraph = Pick; type PartialConnections = Pick< diff --git a/packages/core/src/view/mixins/ConnectionsMixin.type.ts b/packages/core/src/view/mixins/ConnectionsMixin.type.ts index c74d9de7f8..d88e1cf316 100644 --- a/packages/core/src/view/mixins/ConnectionsMixin.type.ts +++ b/packages/core/src/view/mixins/ConnectionsMixin.type.ts @@ -14,11 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Point from '../geometry/Point'; -import type CellState from '../cell/CellState'; -import type InternalMouseEvent from '../event/InternalMouseEvent'; -import type ConnectionConstraint from '../other/ConnectionConstraint'; -import type Cell from '../cell/Cell'; +import type Point from '../geometry/Point.js'; +import type CellState from '../cell/CellState.js'; +import type InternalMouseEvent from '../event/InternalMouseEvent.js'; +import type ConnectionConstraint from '../other/ConnectionConstraint.js'; +import type Cell from '../cell/Cell.js'; declare module '../AbstractGraph' { interface AbstractGraph { diff --git a/packages/core/src/view/mixins/DragDropMixin.ts b/packages/core/src/view/mixins/DragDropMixin.ts index 62a13d3252..6e41f0dc5d 100644 --- a/packages/core/src/view/mixins/DragDropMixin.ts +++ b/packages/core/src/view/mixins/DragDropMixin.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type { AbstractGraph } from '../AbstractGraph'; +import type { AbstractGraph } from '../AbstractGraph.js'; type PartialGraph = Pick; type PartialDragDrop = Pick< diff --git a/packages/core/src/view/mixins/DragDropMixin.type.ts b/packages/core/src/view/mixins/DragDropMixin.type.ts index cd6056a371..e4fa9e94ac 100644 --- a/packages/core/src/view/mixins/DragDropMixin.type.ts +++ b/packages/core/src/view/mixins/DragDropMixin.type.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Cell from '../cell/Cell'; +import type Cell from '../cell/Cell.js'; declare module '../AbstractGraph' { interface AbstractGraph { diff --git a/packages/core/src/view/mixins/EdgeMixin.ts b/packages/core/src/view/mixins/EdgeMixin.ts index 16cd270b32..c39a1e8d48 100644 --- a/packages/core/src/view/mixins/EdgeMixin.ts +++ b/packages/core/src/view/mixins/EdgeMixin.ts @@ -14,15 +14,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type { CellStyle } from '../../types'; -import { removeDuplicates } from '../../util/arrayUtils'; -import { findNearestSegment } from '../../util/mathUtils'; -import type { AbstractGraph } from '../AbstractGraph'; -import Cell from '../cell/Cell'; -import EventObject from '../event/EventObject'; -import InternalEvent from '../event/InternalEvent'; -import Geometry from '../geometry/Geometry'; -import type Point from '../geometry/Point'; +import type { CellStyle } from '../../types.js'; +import { removeDuplicates } from '../../util/arrayUtils.js'; +import { findNearestSegment } from '../../util/mathUtils.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import Cell from '../cell/Cell.js'; +import EventObject from '../event/EventObject.js'; +import InternalEvent from '../event/InternalEvent.js'; +import Geometry from '../geometry/Geometry.js'; +import type Point from '../geometry/Point.js'; type PartialGraph = Pick< AbstractGraph, diff --git a/packages/core/src/view/mixins/EdgeMixin.type.ts b/packages/core/src/view/mixins/EdgeMixin.type.ts index ffb89e5a9d..e11fbb6f9e 100644 --- a/packages/core/src/view/mixins/EdgeMixin.type.ts +++ b/packages/core/src/view/mixins/EdgeMixin.type.ts @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type { CellStyle, EdgeParameters, EdgeParametersValue } from '../../types'; -import type Cell from '../cell/Cell'; +import type { CellStyle, EdgeParameters, EdgeParametersValue } from '../../types.js'; +import type Cell from '../cell/Cell.js'; declare module '../AbstractGraph' { interface AbstractGraph { diff --git a/packages/core/src/view/mixins/EditingMixin.ts b/packages/core/src/view/mixins/EditingMixin.ts index 6b6149a1d8..1265eaad91 100644 --- a/packages/core/src/view/mixins/EditingMixin.ts +++ b/packages/core/src/view/mixins/EditingMixin.ts @@ -14,11 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { isMultiTouchEvent } from '../../util/EventUtils'; -import EventObject from '../event/EventObject'; -import InternalEvent from '../event/InternalEvent'; -import type { AbstractGraph } from '../AbstractGraph'; -import type CellEditorHandler from '../plugins/CellEditorHandler'; +import { isMultiTouchEvent } from '../../util/EventUtils.js'; +import EventObject from '../event/EventObject.js'; +import InternalEvent from '../event/InternalEvent.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import type CellEditorHandler from '../plugins/CellEditorHandler.js'; type PartialGraph = Pick< AbstractGraph, diff --git a/packages/core/src/view/mixins/EditingMixin.type.ts b/packages/core/src/view/mixins/EditingMixin.type.ts index 31cb004e9a..4ec710d326 100644 --- a/packages/core/src/view/mixins/EditingMixin.type.ts +++ b/packages/core/src/view/mixins/EditingMixin.type.ts @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Cell from '../cell/Cell'; -import type InternalMouseEvent from '../event/InternalMouseEvent'; -import type EventObject from '../event/EventObject'; +import type Cell from '../cell/Cell.js'; +import type InternalMouseEvent from '../event/InternalMouseEvent.js'; +import type EventObject from '../event/EventObject.js'; declare module '../AbstractGraph' { interface AbstractGraph { diff --git a/packages/core/src/view/mixins/EventsMixin.ts b/packages/core/src/view/mixins/EventsMixin.ts index 2c3e5189fe..30a317f7cd 100644 --- a/packages/core/src/view/mixins/EventsMixin.ts +++ b/packages/core/src/view/mixins/EventsMixin.ts @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import InternalMouseEvent from '../event/InternalMouseEvent'; -import EventObject from '../event/EventObject'; -import InternalEvent from '../event/InternalEvent'; +import InternalMouseEvent from '../event/InternalMouseEvent.js'; +import EventObject from '../event/EventObject.js'; +import InternalEvent from '../event/InternalEvent.js'; import { getClientX, getClientY, @@ -31,18 +31,18 @@ import { isPopupTrigger, isShiftDown, isTouchEvent, -} from '../../util/EventUtils'; -import CellState from '../cell/CellState'; -import Cell from '../cell/Cell'; -import type PanningHandler from '../plugins/PanningHandler'; -import type ConnectionHandler from '../plugins/ConnectionHandler'; -import Point from '../geometry/Point'; -import { convertPoint } from '../../util/styleUtils'; -import { NONE } from '../../util/Constants'; -import Client from '../../Client'; -import type CellEditorHandler from '../plugins/CellEditorHandler'; -import type { AbstractGraph } from '../AbstractGraph'; -import type TooltipHandler from '../plugins/TooltipHandler'; +} from '../../util/EventUtils.js'; +import CellState from '../cell/CellState.js'; +import Cell from '../cell/Cell.js'; +import type PanningHandler from '../plugins/PanningHandler.js'; +import type ConnectionHandler from '../plugins/ConnectionHandler.js'; +import Point from '../geometry/Point.js'; +import { convertPoint } from '../../util/styleUtils.js'; +import { NONE } from '../../util/Constants.js'; +import Client from '../../Client.js'; +import type CellEditorHandler from '../plugins/CellEditorHandler.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import type TooltipHandler from '../plugins/TooltipHandler.js'; type PartialGraph = Pick< AbstractGraph, diff --git a/packages/core/src/view/mixins/EventsMixin.type.ts b/packages/core/src/view/mixins/EventsMixin.type.ts index 32762d5205..f7ba847b77 100644 --- a/packages/core/src/view/mixins/EventsMixin.type.ts +++ b/packages/core/src/view/mixins/EventsMixin.type.ts @@ -14,12 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type { MouseEventListener, MouseListenerSet } from '../../types'; -import type Cell from '../cell/Cell'; -import type InternalMouseEvent from '../event/InternalMouseEvent'; -import type CellState from '../cell/CellState'; -import type EventSource from '../event/EventSource'; -import type Point from '../geometry/Point'; +import type { MouseEventListener, MouseListenerSet } from '../../types.js'; +import type Cell from '../cell/Cell.js'; +import type InternalMouseEvent from '../event/InternalMouseEvent.js'; +import type CellState from '../cell/CellState.js'; +import type EventSource from '../event/EventSource.js'; +import type Point from '../geometry/Point.js'; declare module '../AbstractGraph' { interface AbstractGraph { diff --git a/packages/core/src/view/mixins/FoldingMixin.ts b/packages/core/src/view/mixins/FoldingMixin.ts index 421d373974..60e9930b08 100644 --- a/packages/core/src/view/mixins/FoldingMixin.ts +++ b/packages/core/src/view/mixins/FoldingMixin.ts @@ -14,14 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Cell from '../cell/Cell'; -import EventObject from '../event/EventObject'; -import InternalEvent from '../event/InternalEvent'; -import Geometry from '../geometry/Geometry'; -import { toRadians } from '../../util/mathUtils'; -import Rectangle from '../geometry/Rectangle'; -import type { AbstractGraph } from '../AbstractGraph'; -import { isI18nEnabled } from '../../internal/i18n-utils'; +import Cell from '../cell/Cell.js'; +import EventObject from '../event/EventObject.js'; +import InternalEvent from '../event/InternalEvent.js'; +import Geometry from '../geometry/Geometry.js'; +import { toRadians } from '../../util/mathUtils.js'; +import Rectangle from '../geometry/Rectangle.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import { isI18nEnabled } from '../../internal/i18n-utils.js'; type PartialGraph = Pick< AbstractGraph, diff --git a/packages/core/src/view/mixins/FoldingMixin.type.ts b/packages/core/src/view/mixins/FoldingMixin.type.ts index bc1506a2b2..0af10ca98a 100644 --- a/packages/core/src/view/mixins/FoldingMixin.type.ts +++ b/packages/core/src/view/mixins/FoldingMixin.type.ts @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Cell from '../cell/Cell'; -import type CellState from '../cell/CellState'; -import type ImageBox from '../image/ImageBox'; -import type Geometry from '../geometry/Geometry'; +import type Cell from '../cell/Cell.js'; +import type CellState from '../cell/CellState.js'; +import type ImageBox from '../image/ImageBox.js'; +import type Geometry from '../geometry/Geometry.js'; declare module '../AbstractGraph' { interface AbstractGraph { diff --git a/packages/core/src/view/mixins/GroupingMixin.ts b/packages/core/src/view/mixins/GroupingMixin.ts index f4eec9d6b8..1a1256a5f4 100644 --- a/packages/core/src/view/mixins/GroupingMixin.ts +++ b/packages/core/src/view/mixins/GroupingMixin.ts @@ -14,14 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Cell from '../cell/Cell'; -import { sortCells } from '../../util/styleUtils'; -import Geometry from '../geometry/Geometry'; -import EventObject from '../event/EventObject'; -import InternalEvent from '../event/InternalEvent'; -import Rectangle from '../geometry/Rectangle'; -import type Point from '../geometry/Point'; -import type { AbstractGraph } from '../AbstractGraph'; +import Cell from '../cell/Cell.js'; +import { sortCells } from '../../util/styleUtils.js'; +import Geometry from '../geometry/Geometry.js'; +import EventObject from '../event/EventObject.js'; +import InternalEvent from '../event/InternalEvent.js'; +import Rectangle from '../geometry/Rectangle.js'; +import type Point from '../geometry/Point.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; type PartialGraph = Pick< AbstractGraph, diff --git a/packages/core/src/view/mixins/GroupingMixin.type.ts b/packages/core/src/view/mixins/GroupingMixin.type.ts index 163c9b04f2..1586f2cb3e 100644 --- a/packages/core/src/view/mixins/GroupingMixin.type.ts +++ b/packages/core/src/view/mixins/GroupingMixin.type.ts @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Cell from '../cell/Cell'; -import type Rectangle from '../geometry/Rectangle'; +import type Cell from '../cell/Cell.js'; +import type Rectangle from '../geometry/Rectangle.js'; declare module '../AbstractGraph' { interface AbstractGraph { diff --git a/packages/core/src/view/mixins/ImageMixin.ts b/packages/core/src/view/mixins/ImageMixin.ts index e17c94362b..a8f15f2a7a 100644 --- a/packages/core/src/view/mixins/ImageMixin.ts +++ b/packages/core/src/view/mixins/ImageMixin.ts @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type { AbstractGraph } from '../AbstractGraph'; -import type ImageBundle from '../image/ImageBundle'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import type ImageBundle from '../image/ImageBundle.js'; type PartialImage = Pick< AbstractGraph, diff --git a/packages/core/src/view/mixins/ImageMixin.type.ts b/packages/core/src/view/mixins/ImageMixin.type.ts index eaab8f1b3b..bf70228a09 100644 --- a/packages/core/src/view/mixins/ImageMixin.type.ts +++ b/packages/core/src/view/mixins/ImageMixin.type.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type ImageBundle from '../image/ImageBundle'; +import type ImageBundle from '../image/ImageBundle.js'; declare module '../AbstractGraph' { interface AbstractGraph { diff --git a/packages/core/src/view/mixins/LabelMixin.ts b/packages/core/src/view/mixins/LabelMixin.ts index e40aa25694..5002cd3400 100644 --- a/packages/core/src/view/mixins/LabelMixin.ts +++ b/packages/core/src/view/mixins/LabelMixin.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type { AbstractGraph } from '../AbstractGraph'; +import type { AbstractGraph } from '../AbstractGraph.js'; type PartialGraph = Pick< AbstractGraph, diff --git a/packages/core/src/view/mixins/LabelMixin.type.ts b/packages/core/src/view/mixins/LabelMixin.type.ts index bb86bd45e6..985510b67f 100644 --- a/packages/core/src/view/mixins/LabelMixin.type.ts +++ b/packages/core/src/view/mixins/LabelMixin.type.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Cell from '../cell/Cell'; +import type Cell from '../cell/Cell.js'; declare module '../AbstractGraph' { interface AbstractGraph { diff --git a/packages/core/src/view/mixins/OrderMixin.ts b/packages/core/src/view/mixins/OrderMixin.ts index 09eab6790e..4420fd3587 100644 --- a/packages/core/src/view/mixins/OrderMixin.ts +++ b/packages/core/src/view/mixins/OrderMixin.ts @@ -14,11 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { sortCells } from '../../util/styleUtils'; -import EventObject from '../event/EventObject'; -import InternalEvent from '../event/InternalEvent'; -import type { AbstractGraph } from '../AbstractGraph'; -import type Cell from '../cell/Cell'; +import { sortCells } from '../../util/styleUtils.js'; +import EventObject from '../event/EventObject.js'; +import InternalEvent from '../event/InternalEvent.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import type Cell from '../cell/Cell.js'; type PartialGraph = Pick< AbstractGraph, diff --git a/packages/core/src/view/mixins/OrderMixin.type.ts b/packages/core/src/view/mixins/OrderMixin.type.ts index 1fb7ecf79f..2ad11844f6 100644 --- a/packages/core/src/view/mixins/OrderMixin.type.ts +++ b/packages/core/src/view/mixins/OrderMixin.type.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Cell from '../cell/Cell'; +import type Cell from '../cell/Cell.js'; declare module '../AbstractGraph' { interface AbstractGraph { diff --git a/packages/core/src/view/mixins/OverlaysMixin.ts b/packages/core/src/view/mixins/OverlaysMixin.ts index 4d11227fd4..dce166fcc8 100644 --- a/packages/core/src/view/mixins/OverlaysMixin.ts +++ b/packages/core/src/view/mixins/OverlaysMixin.ts @@ -14,11 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import CellOverlay from '../cell/CellOverlay'; -import EventObject from '../event/EventObject'; -import InternalEvent from '../event/InternalEvent'; -import type InternalMouseEvent from '../event/InternalMouseEvent'; -import type { AbstractGraph } from '../AbstractGraph'; +import CellOverlay from '../cell/CellOverlay.js'; +import EventObject from '../event/EventObject.js'; +import InternalEvent from '../event/InternalEvent.js'; +import type InternalMouseEvent from '../event/InternalMouseEvent.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; type PartialGraph = Pick< AbstractGraph, diff --git a/packages/core/src/view/mixins/OverlaysMixin.type.ts b/packages/core/src/view/mixins/OverlaysMixin.type.ts index e5c5a265b4..1439fcdf90 100644 --- a/packages/core/src/view/mixins/OverlaysMixin.type.ts +++ b/packages/core/src/view/mixins/OverlaysMixin.type.ts @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Cell from '../cell/Cell'; -import type CellOverlay from '../cell/CellOverlay'; -import type Image from '../image/ImageBox'; +import type Cell from '../cell/Cell.js'; +import type CellOverlay from '../cell/CellOverlay.js'; +import type Image from '../image/ImageBox.js'; declare module '../AbstractGraph' { interface AbstractGraph { diff --git a/packages/core/src/view/mixins/PageBreaksMixin.ts b/packages/core/src/view/mixins/PageBreaksMixin.ts index c22fd12482..8c68092395 100644 --- a/packages/core/src/view/mixins/PageBreaksMixin.ts +++ b/packages/core/src/view/mixins/PageBreaksMixin.ts @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Rectangle from '../geometry/Rectangle'; -import Point from '../geometry/Point'; -import PolylineShape from '../shape/edge/PolylineShape'; -import type { AbstractGraph } from '../AbstractGraph'; +import Rectangle from '../geometry/Rectangle.js'; +import Point from '../geometry/Point.js'; +import PolylineShape from '../shape/edge/PolylineShape.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; type PartialGraph = Pick< AbstractGraph, diff --git a/packages/core/src/view/mixins/PanningMixin.ts b/packages/core/src/view/mixins/PanningMixin.ts index 2b24926cb2..8a10b258d4 100644 --- a/packages/core/src/view/mixins/PanningMixin.ts +++ b/packages/core/src/view/mixins/PanningMixin.ts @@ -14,14 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { hasScrollbars } from '../../util/styleUtils'; -import EventObject from '../event/EventObject'; -import InternalEvent from '../event/InternalEvent'; -import type PanningHandler from '../plugins/PanningHandler'; -import type { AbstractGraph } from '../AbstractGraph'; -import Rectangle from '../geometry/Rectangle'; -import Point from '../geometry/Point'; -import type SelectionCellsHandler from '../plugins/SelectionCellsHandler'; +import { hasScrollbars } from '../../util/styleUtils.js'; +import EventObject from '../event/EventObject.js'; +import InternalEvent from '../event/InternalEvent.js'; +import type PanningHandler from '../plugins/PanningHandler.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import Rectangle from '../geometry/Rectangle.js'; +import Point from '../geometry/Point.js'; +import type SelectionCellsHandler from '../plugins/SelectionCellsHandler.js'; type PartialGraph = Pick< AbstractGraph, diff --git a/packages/core/src/view/mixins/PanningMixin.type.ts b/packages/core/src/view/mixins/PanningMixin.type.ts index fc965942c6..2dd3a347bd 100644 --- a/packages/core/src/view/mixins/PanningMixin.type.ts +++ b/packages/core/src/view/mixins/PanningMixin.type.ts @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Cell from '../cell/Cell'; -import type Rectangle from '../geometry/Rectangle'; +import type Cell from '../cell/Cell.js'; +import type Rectangle from '../geometry/Rectangle.js'; declare module '../AbstractGraph' { interface AbstractGraph { diff --git a/packages/core/src/view/mixins/PortsMixin.ts b/packages/core/src/view/mixins/PortsMixin.ts index b19fef9be8..d3dd2a4ed2 100644 --- a/packages/core/src/view/mixins/PortsMixin.ts +++ b/packages/core/src/view/mixins/PortsMixin.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type { AbstractGraph } from '../AbstractGraph'; +import type { AbstractGraph } from '../AbstractGraph.js'; type PartialPorts = Pick< AbstractGraph, diff --git a/packages/core/src/view/mixins/PortsMixin.type.ts b/packages/core/src/view/mixins/PortsMixin.type.ts index b39fbbe3b2..95d8baef90 100644 --- a/packages/core/src/view/mixins/PortsMixin.type.ts +++ b/packages/core/src/view/mixins/PortsMixin.type.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Cell from '../cell/Cell'; +import type Cell from '../cell/Cell.js'; declare module '../AbstractGraph' { interface AbstractGraph { diff --git a/packages/core/src/view/mixins/SelectionMixin.ts b/packages/core/src/view/mixins/SelectionMixin.ts index 729fa2bc44..307a56715c 100644 --- a/packages/core/src/view/mixins/SelectionMixin.ts +++ b/packages/core/src/view/mixins/SelectionMixin.ts @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Cell from '../cell/Cell'; -import RootChange from '../undoable_changes/RootChange'; -import ChildChange from '../undoable_changes/ChildChange'; -import type { AbstractGraph } from '../AbstractGraph'; +import Cell from '../cell/Cell.js'; +import RootChange from '../undoable_changes/RootChange.js'; +import ChildChange from '../undoable_changes/ChildChange.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; type PartialGraph = Pick< AbstractGraph, diff --git a/packages/core/src/view/mixins/SelectionMixin.type.ts b/packages/core/src/view/mixins/SelectionMixin.type.ts index 651b591116..9b51ded5e7 100644 --- a/packages/core/src/view/mixins/SelectionMixin.type.ts +++ b/packages/core/src/view/mixins/SelectionMixin.type.ts @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Cell from '../cell/Cell'; -import type GraphSelectionModel from '../GraphSelectionModel'; -import type Rectangle from '../geometry/Rectangle'; +import type Cell from '../cell/Cell.js'; +import type GraphSelectionModel from '../GraphSelectionModel.js'; +import type Rectangle from '../geometry/Rectangle.js'; declare module '../AbstractGraph' { interface AbstractGraph { diff --git a/packages/core/src/view/mixins/SnapMixin.ts b/packages/core/src/view/mixins/SnapMixin.ts index a50983cbb0..91a175e6e0 100644 --- a/packages/core/src/view/mixins/SnapMixin.ts +++ b/packages/core/src/view/mixins/SnapMixin.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type { AbstractGraph } from '../AbstractGraph'; +import type { AbstractGraph } from '../AbstractGraph.js'; type PartialGraph = Pick; type PartialSnap = Pick< diff --git a/packages/core/src/view/mixins/SnapMixin.type.ts b/packages/core/src/view/mixins/SnapMixin.type.ts index 92a440dc87..e53286949c 100644 --- a/packages/core/src/view/mixins/SnapMixin.type.ts +++ b/packages/core/src/view/mixins/SnapMixin.type.ts @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Point from '../geometry/Point'; -import type Rectangle from '../geometry/Rectangle'; +import type Point from '../geometry/Point.js'; +import type Rectangle from '../geometry/Rectangle.js'; declare module '../AbstractGraph' { interface AbstractGraph { diff --git a/packages/core/src/view/mixins/SwimlaneMixin.ts b/packages/core/src/view/mixins/SwimlaneMixin.ts index dcd268c7ad..36814255c4 100644 --- a/packages/core/src/view/mixins/SwimlaneMixin.ts +++ b/packages/core/src/view/mixins/SwimlaneMixin.ts @@ -14,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Rectangle from '../geometry/Rectangle'; -import { convertPoint } from '../../util/styleUtils'; -import { mod } from '../../util/mathUtils'; -import { DEFAULT_STARTSIZE } from '../../util/Constants'; -import { getClientX, getClientY } from '../../util/EventUtils'; -import type { AbstractGraph } from '../AbstractGraph'; -import type { DirectionValue } from '../../types'; +import Rectangle from '../geometry/Rectangle.js'; +import { convertPoint } from '../../util/styleUtils.js'; +import { mod } from '../../util/mathUtils.js'; +import { DEFAULT_STARTSIZE } from '../../util/Constants.js'; +import { getClientX, getClientY } from '../../util/EventUtils.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import type { DirectionValue } from '../../types.js'; type PartialGraph = Pick< AbstractGraph, diff --git a/packages/core/src/view/mixins/SwimlaneMixin.type.ts b/packages/core/src/view/mixins/SwimlaneMixin.type.ts index 1418949a17..4fa898f982 100644 --- a/packages/core/src/view/mixins/SwimlaneMixin.type.ts +++ b/packages/core/src/view/mixins/SwimlaneMixin.type.ts @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Cell from '../cell/Cell'; -import type Rectangle from '../geometry/Rectangle'; -import type { CellStateStyle, DirectionValue } from '../../types'; +import type Cell from '../cell/Cell.js'; +import type Rectangle from '../geometry/Rectangle.js'; +import type { CellStateStyle, DirectionValue } from '../../types.js'; declare module '../AbstractGraph' { interface AbstractGraph { diff --git a/packages/core/src/view/mixins/TerminalMixin.ts b/packages/core/src/view/mixins/TerminalMixin.ts index a0ce175cc9..1ebfb2c17b 100644 --- a/packages/core/src/view/mixins/TerminalMixin.ts +++ b/packages/core/src/view/mixins/TerminalMixin.ts @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Cell from '../cell/Cell'; -import type { AbstractGraph } from '../AbstractGraph'; +import type Cell from '../cell/Cell.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; type PartialGraph = Pick; type PartialTerminal = Pick; diff --git a/packages/core/src/view/mixins/TerminalMixin.type.ts b/packages/core/src/view/mixins/TerminalMixin.type.ts index e2af2ef62a..559a8fb200 100644 --- a/packages/core/src/view/mixins/TerminalMixin.type.ts +++ b/packages/core/src/view/mixins/TerminalMixin.type.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Cell from '../cell/Cell'; +import type Cell from '../cell/Cell.js'; declare module '../AbstractGraph' { interface AbstractGraph { diff --git a/packages/core/src/view/mixins/TooltipMixin.ts b/packages/core/src/view/mixins/TooltipMixin.ts index 69ef4044c8..f9f923fe46 100644 --- a/packages/core/src/view/mixins/TooltipMixin.ts +++ b/packages/core/src/view/mixins/TooltipMixin.ts @@ -14,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { htmlEntities } from '../../util/StringUtils'; -import type Shape from '../shape/Shape'; -import type Cell from '../cell/Cell'; -import type { AbstractGraph } from '../AbstractGraph'; -import type SelectionCellsHandler from '../plugins/SelectionCellsHandler'; -import type TooltipHandler from '../plugins/TooltipHandler'; -import { translate } from '../../internal/i18n-utils'; +import { htmlEntities } from '../../util/StringUtils.js'; +import type Shape from '../shape/Shape.js'; +import type Cell from '../cell/Cell.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import type SelectionCellsHandler from '../plugins/SelectionCellsHandler.js'; +import type TooltipHandler from '../plugins/TooltipHandler.js'; +import { translate } from '../../internal/i18n-utils.js'; type PartialGraph = Pick< AbstractGraph, diff --git a/packages/core/src/view/mixins/TooltipMixin.type.ts b/packages/core/src/view/mixins/TooltipMixin.type.ts index 1cd5b1e4a2..882822f4fe 100644 --- a/packages/core/src/view/mixins/TooltipMixin.type.ts +++ b/packages/core/src/view/mixins/TooltipMixin.type.ts @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type CellState from '../cell/CellState'; -import type Cell from '../cell/Cell'; +import type CellState from '../cell/CellState.js'; +import type Cell from '../cell/Cell.js'; declare module '../AbstractGraph' { interface AbstractGraph { diff --git a/packages/core/src/view/mixins/ValidationMixin.ts b/packages/core/src/view/mixins/ValidationMixin.ts index 457ec240bd..e2f79ebc9d 100644 --- a/packages/core/src/view/mixins/ValidationMixin.ts +++ b/packages/core/src/view/mixins/ValidationMixin.ts @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Cell from '../cell/Cell'; -import { isNode } from '../../util/domUtils'; -import type { AbstractGraph } from '../AbstractGraph'; -import { translate } from '../../internal/i18n-utils'; +import type Cell from '../cell/Cell.js'; +import { isNode } from '../../util/domUtils.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import { translate } from '../../internal/i18n-utils.js'; type PartialGraph = Pick< AbstractGraph, diff --git a/packages/core/src/view/mixins/ValidationMixin.type.ts b/packages/core/src/view/mixins/ValidationMixin.type.ts index 6d11efda66..a545380ed9 100644 --- a/packages/core/src/view/mixins/ValidationMixin.type.ts +++ b/packages/core/src/view/mixins/ValidationMixin.type.ts @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Multiplicity from '../other/Multiplicity'; -import type Cell from '../cell/Cell'; -import type CellState from '../cell/CellState'; +import type Multiplicity from '../other/Multiplicity.js'; +import type Cell from '../cell/Cell.js'; +import type CellState from '../cell/CellState.js'; declare module '../AbstractGraph' { interface AbstractGraph { diff --git a/packages/core/src/view/mixins/VertexMixin.ts b/packages/core/src/view/mixins/VertexMixin.ts index 57c4dccd1f..366d302e05 100644 --- a/packages/core/src/view/mixins/VertexMixin.ts +++ b/packages/core/src/view/mixins/VertexMixin.ts @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Cell from '../cell/Cell'; -import Geometry from '../geometry/Geometry'; -import type { AbstractGraph } from '../AbstractGraph'; -import type { CellStyle } from '../../types'; +import Cell from '../cell/Cell.js'; +import Geometry from '../geometry/Geometry.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import type { CellStyle } from '../../types.js'; type PartialGraph = Pick; type PartialVertex = Pick< diff --git a/packages/core/src/view/mixins/VertexMixin.type.ts b/packages/core/src/view/mixins/VertexMixin.type.ts index ec9d90382d..df9320ac57 100644 --- a/packages/core/src/view/mixins/VertexMixin.type.ts +++ b/packages/core/src/view/mixins/VertexMixin.type.ts @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Cell from '../cell/Cell'; -import type { CellStyle, VertexParameters } from '../../types'; -import type Geometry from '../geometry/Geometry'; +import type Cell from '../cell/Cell.js'; +import type { CellStyle, VertexParameters } from '../../types.js'; +import type Geometry from '../geometry/Geometry.js'; declare module '../AbstractGraph' { interface AbstractGraph { diff --git a/packages/core/src/view/mixins/ZoomMixin.ts b/packages/core/src/view/mixins/ZoomMixin.ts index c82634e00c..3ddeb25ab6 100644 --- a/packages/core/src/view/mixins/ZoomMixin.ts +++ b/packages/core/src/view/mixins/ZoomMixin.ts @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Rectangle from '../geometry/Rectangle'; -import { hasScrollbars } from '../../util/styleUtils'; -import type { AbstractGraph } from '../AbstractGraph'; +import Rectangle from '../geometry/Rectangle.js'; +import { hasScrollbars } from '../../util/styleUtils.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; type PartialGraph = Pick< AbstractGraph, diff --git a/packages/core/src/view/mixins/ZoomMixin.type.ts b/packages/core/src/view/mixins/ZoomMixin.type.ts index 0cc6e491f3..592e38c270 100644 --- a/packages/core/src/view/mixins/ZoomMixin.type.ts +++ b/packages/core/src/view/mixins/ZoomMixin.type.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Rectangle from '../geometry/Rectangle'; +import type Rectangle from '../geometry/Rectangle.js'; declare module '../AbstractGraph' { interface AbstractGraph { diff --git a/packages/core/src/view/mixins/_graph-mixins-apply.ts b/packages/core/src/view/mixins/_graph-mixins-apply.ts index a4bee47a13..1de41d2d75 100644 --- a/packages/core/src/view/mixins/_graph-mixins-apply.ts +++ b/packages/core/src/view/mixins/_graph-mixins-apply.ts @@ -14,31 +14,31 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { mixInto } from '../../internal/utils'; -import type { AbstractGraph } from '../AbstractGraph'; -import { CellsMixin } from './CellsMixin'; -import { ConnectionsMixin } from './ConnectionsMixin'; -import { DragDropMixin } from './DragDropMixin'; -import { EdgeMixin } from './EdgeMixin'; -import { EditingMixin } from './EditingMixin'; -import { EventsMixin } from './EventsMixin'; -import { FoldingMixin } from './FoldingMixin'; -import { GroupingMixin } from './GroupingMixin'; -import { ImageMixin } from './ImageMixin'; -import { LabelMixin } from './LabelMixin'; -import { OrderMixin } from './OrderMixin'; -import { OverlaysMixin } from './OverlaysMixin'; -import { PageBreaksMixin } from './PageBreaksMixin'; -import { PanningMixin } from './PanningMixin'; -import { PortsMixin } from './PortsMixin'; -import { SelectionMixin } from './SelectionMixin'; -import { SnapMixin } from './SnapMixin'; -import { SwimlaneMixin } from './SwimlaneMixin'; -import { TerminalMixin } from './TerminalMixin'; -import { TooltipMixin } from './TooltipMixin'; -import { ValidationMixin } from './ValidationMixin'; -import { VertexMixin } from './VertexMixin'; -import { ZoomMixin } from './ZoomMixin'; +import { mixInto } from '../../internal/utils.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import { CellsMixin } from './CellsMixin.js'; +import { ConnectionsMixin } from './ConnectionsMixin.js'; +import { DragDropMixin } from './DragDropMixin.js'; +import { EdgeMixin } from './EdgeMixin.js'; +import { EditingMixin } from './EditingMixin.js'; +import { EventsMixin } from './EventsMixin.js'; +import { FoldingMixin } from './FoldingMixin.js'; +import { GroupingMixin } from './GroupingMixin.js'; +import { ImageMixin } from './ImageMixin.js'; +import { LabelMixin } from './LabelMixin.js'; +import { OrderMixin } from './OrderMixin.js'; +import { OverlaysMixin } from './OverlaysMixin.js'; +import { PageBreaksMixin } from './PageBreaksMixin.js'; +import { PanningMixin } from './PanningMixin.js'; +import { PortsMixin } from './PortsMixin.js'; +import { SelectionMixin } from './SelectionMixin.js'; +import { SnapMixin } from './SnapMixin.js'; +import { SwimlaneMixin } from './SwimlaneMixin.js'; +import { TerminalMixin } from './TerminalMixin.js'; +import { TooltipMixin } from './TooltipMixin.js'; +import { ValidationMixin } from './ValidationMixin.js'; +import { VertexMixin } from './VertexMixin.js'; +import { ZoomMixin } from './ZoomMixin.js'; export const applyGraphMixins = (target: typeof AbstractGraph) => { const mixIntoGraph = mixInto(target); diff --git a/packages/core/src/view/mixins/_graph-mixins-types.ts b/packages/core/src/view/mixins/_graph-mixins-types.ts index c4b3fca6f4..e4782543a5 100644 --- a/packages/core/src/view/mixins/_graph-mixins-types.ts +++ b/packages/core/src/view/mixins/_graph-mixins-types.ts @@ -16,26 +16,26 @@ limitations under the License. // Provide a single input to import all types provided by Graph mixins -import './CellsMixin.type'; -import './ConnectionsMixin.type'; -import './DragDropMixin.type'; -import './EdgeMixin.type'; -import './EditingMixin.type'; -import './EventsMixin.type'; -import './FoldingMixin.type'; -import './GroupingMixin.type'; -import './ImageMixin.type'; -import './LabelMixin.type'; -import './OverlaysMixin.type'; -import './OrderMixin.type'; -import './PageBreaksMixin.type'; -import './PanningMixin.type'; -import './PortsMixin.type'; -import './SelectionMixin.type'; -import './SnapMixin.type'; -import './SwimlaneMixin.type'; -import './TerminalMixin.type'; -import './TooltipMixin.type'; -import './ValidationMixin.type'; -import './VertexMixin.type'; -import './ZoomMixin.type'; +import './CellsMixin.type.js'; +import './ConnectionsMixin.type.js'; +import './DragDropMixin.type.js'; +import './EdgeMixin.type.js'; +import './EditingMixin.type.js'; +import './EventsMixin.type.js'; +import './FoldingMixin.type.js'; +import './GroupingMixin.type.js'; +import './ImageMixin.type.js'; +import './LabelMixin.type.js'; +import './OverlaysMixin.type.js'; +import './OrderMixin.type.js'; +import './PageBreaksMixin.type.js'; +import './PanningMixin.type.js'; +import './PortsMixin.type.js'; +import './SelectionMixin.type.js'; +import './SnapMixin.type.js'; +import './SwimlaneMixin.type.js'; +import './TerminalMixin.type.js'; +import './TooltipMixin.type.js'; +import './ValidationMixin.type.js'; +import './VertexMixin.type.js'; +import './ZoomMixin.type.js'; diff --git a/packages/core/src/view/other/AutoSaveManager.ts b/packages/core/src/view/other/AutoSaveManager.ts index 54f42046b9..60b6eee638 100644 --- a/packages/core/src/view/other/AutoSaveManager.ts +++ b/packages/core/src/view/other/AutoSaveManager.ts @@ -16,9 +16,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import EventSource from '../event/EventSource'; -import InternalEvent from '../event/InternalEvent'; -import type { AbstractGraph } from '../AbstractGraph'; +import EventSource from '../event/EventSource.js'; +import InternalEvent from '../event/InternalEvent.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; /** * Manager for automatically saving diagrams. The hook must be diff --git a/packages/core/src/view/other/ConnectionConstraint.ts b/packages/core/src/view/other/ConnectionConstraint.ts index 6885867cc5..8b01112631 100644 --- a/packages/core/src/view/other/ConnectionConstraint.ts +++ b/packages/core/src/view/other/ConnectionConstraint.ts @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Point from '../geometry/Point'; +import Point from '../geometry/Point.js'; /** * Defines an object that contains the constraints about how to connect one side of an edge to its terminal. diff --git a/packages/core/src/view/other/DragSource.ts b/packages/core/src/view/other/DragSource.ts index 175763ddbf..00cef18738 100644 --- a/packages/core/src/view/other/DragSource.ts +++ b/packages/core/src/view/other/DragSource.ts @@ -16,19 +16,19 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Rectangle from '../geometry/Rectangle'; -import CellHighlight from '../cell/CellHighlight'; +import Rectangle from '../geometry/Rectangle.js'; +import CellHighlight from '../cell/CellHighlight.js'; import { getDocumentScrollOrigin, getOffset, getScrollOrigin, setOpacity, -} from '../../util/styleUtils'; -import InternalEvent from '../event/InternalEvent'; -import Client from '../../Client'; -import Guide from './Guide'; -import { DROP_TARGET_COLOR } from '../../util/Constants'; -import Point from '../geometry/Point'; +} from '../../util/styleUtils.js'; +import InternalEvent from '../event/InternalEvent.js'; +import Client from '../../Client.js'; +import Guide from './Guide.js'; +import { DROP_TARGET_COLOR } from '../../util/Constants.js'; +import Point from '../geometry/Point.js'; import { getClientX, getClientY, @@ -37,13 +37,13 @@ import { isMouseEvent, isPenEvent, isTouchEvent, -} from '../../util/EventUtils'; -import EventSource from '../event/EventSource'; -import EventObject from '../event/EventObject'; -import type { AbstractGraph } from '../AbstractGraph'; -import type Cell from '../cell/Cell'; -import type SelectionHandler from '../plugins/SelectionHandler'; -import type { DropHandler } from '../../types'; +} from '../../util/EventUtils.js'; +import EventSource from '../event/EventSource.js'; +import EventObject from '../event/EventObject.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import type Cell from '../cell/Cell.js'; +import type SelectionHandler from '../plugins/SelectionHandler.js'; +import type { DropHandler } from '../../types.js'; /** * Wrapper to create a drag source from a DOM element so that the element can be dragged over a graph and dropped into the graph as a new cell. diff --git a/packages/core/src/view/other/Guide.ts b/packages/core/src/view/other/Guide.ts index 8deeaf3265..3c2c07bcf2 100644 --- a/packages/core/src/view/other/Guide.ts +++ b/packages/core/src/view/other/Guide.ts @@ -16,13 +16,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { GUIDE_COLOR, GUIDE_STROKEWIDTH } from '../../util/Constants'; -import Point from '../geometry/Point'; -import PolylineShape from '../shape/edge/PolylineShape'; -import type CellState from '../cell/CellState'; -import Shape from '../shape/Shape'; -import Rectangle from '../geometry/Rectangle'; -import type { AbstractGraph } from '../AbstractGraph'; +import { GUIDE_COLOR, GUIDE_STROKEWIDTH } from '../../util/Constants.js'; +import Point from '../geometry/Point.js'; +import PolylineShape from '../shape/edge/PolylineShape.js'; +import type CellState from '../cell/CellState.js'; +import Shape from '../shape/Shape.js'; +import Rectangle from '../geometry/Rectangle.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; /** * Implements the alignment of selection cells to other cells in the graph. diff --git a/packages/core/src/view/other/Multiplicity.ts b/packages/core/src/view/other/Multiplicity.ts index ee5d40eb7c..ef050bcd58 100644 --- a/packages/core/src/view/other/Multiplicity.ts +++ b/packages/core/src/view/other/Multiplicity.ts @@ -16,10 +16,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { isNode } from '../../util/domUtils'; -import type Cell from '../cell/Cell'; -import type { AbstractGraph } from '../AbstractGraph'; -import { translate } from '../../internal/i18n-utils'; +import { isNode } from '../../util/domUtils.js'; +import type Cell from '../cell/Cell.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import { translate } from '../../internal/i18n-utils.js'; /** * @class Multiplicity diff --git a/packages/core/src/view/other/Outline.ts b/packages/core/src/view/other/Outline.ts index 0d881c8f1b..247f4a540a 100644 --- a/packages/core/src/view/other/Outline.ts +++ b/packages/core/src/view/other/Outline.ts @@ -16,28 +16,28 @@ See the License for the specific language governing permissions and limitations under the License. */ -import InternalMouseEvent from '../event/InternalMouseEvent'; +import InternalMouseEvent from '../event/InternalMouseEvent.js'; import { NONE, OUTLINE_COLOR, OUTLINE_HANDLE_FILLCOLOR, OUTLINE_HANDLE_STROKECOLOR, OUTLINE_STROKEWIDTH, -} from '../../util/Constants'; -import Point from '../geometry/Point'; -import Rectangle from '../geometry/Rectangle'; -import RectangleShape from '../shape/node/RectangleShape'; -import type { AbstractGraph } from '../AbstractGraph'; -import { BaseGraph } from '../BaseGraph'; -import ImageShape from '../shape/node/ImageShape'; -import InternalEvent from '../event/InternalEvent'; -import Image from '../image/ImageBox'; -import EventObject from '../event/EventObject'; -import { getSource, isMouseEvent } from '../../util/EventUtils'; -import EventSource from '../event/EventSource'; -import { hasScrollbars } from '../../util/styleUtils'; -import type { Listenable, MouseListenerSet } from '../../types'; -import { getDefaultPlugins } from '../plugins'; +} from '../../util/Constants.js'; +import Point from '../geometry/Point.js'; +import Rectangle from '../geometry/Rectangle.js'; +import RectangleShape from '../shape/node/RectangleShape.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import { BaseGraph } from '../BaseGraph.js'; +import ImageShape from '../shape/node/ImageShape.js'; +import InternalEvent from '../event/InternalEvent.js'; +import Image from '../image/ImageBox.js'; +import EventObject from '../event/EventObject.js'; +import { getSource, isMouseEvent } from '../../util/EventUtils.js'; +import EventSource from '../event/EventSource.js'; +import { hasScrollbars } from '../../util/styleUtils.js'; +import type { Listenable, MouseListenerSet } from '../../types.js'; +import { getDefaultPlugins } from '../plugins/index.js'; /** * Implements an outline (aka overview or minimap) for a `Graph`. diff --git a/packages/core/src/view/other/PanningManager.ts b/packages/core/src/view/other/PanningManager.ts index 07f1f97beb..e5749342a2 100644 --- a/packages/core/src/view/other/PanningManager.ts +++ b/packages/core/src/view/other/PanningManager.ts @@ -16,11 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { MouseEventListener, MouseListenerSet } from '../../types'; -import { hasScrollbars } from '../../util/styleUtils'; -import EventObject from '../event/EventObject'; -import InternalEvent from '../event/InternalEvent'; -import type { AbstractGraph } from '../AbstractGraph'; +import { MouseEventListener, MouseListenerSet } from '../../types.js'; +import { hasScrollbars } from '../../util/styleUtils.js'; +import EventObject from '../event/EventObject.js'; +import InternalEvent from '../event/InternalEvent.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; /** * Implements a handler for panning. diff --git a/packages/core/src/view/other/PrintPreview.ts b/packages/core/src/view/other/PrintPreview.ts index bc6e85d6c9..51f317aebc 100644 --- a/packages/core/src/view/other/PrintPreview.ts +++ b/packages/core/src/view/other/PrintPreview.ts @@ -16,17 +16,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Point from '../geometry/Point'; -import Rectangle from '../geometry/Rectangle'; -import TemporaryCellStates from '../cell/TemporaryCellStates'; -import InternalEvent from '../event/InternalEvent'; -import Client from '../../Client'; -import { intersects } from '../../util/mathUtils'; -import { addLinkToHead, write } from '../../util/domUtils'; -import type { AbstractGraph } from '../AbstractGraph'; -import type CellState from '../cell/CellState'; -import type Cell from '../cell/Cell'; -import { GlobalConfig } from '../../util/config'; +import Point from '../geometry/Point.js'; +import Rectangle from '../geometry/Rectangle.js'; +import TemporaryCellStates from '../cell/TemporaryCellStates.js'; +import InternalEvent from '../event/InternalEvent.js'; +import Client from '../../Client.js'; +import { intersects } from '../../util/mathUtils.js'; +import { addLinkToHead, write } from '../../util/domUtils.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import type CellState from '../cell/CellState.js'; +import type Cell from '../cell/Cell.js'; +import { GlobalConfig } from '../../util/config.js'; /** * Implements printing of a diagram across multiple pages. diff --git a/packages/core/src/view/plugins/CellEditorHandler.ts b/packages/core/src/view/plugins/CellEditorHandler.ts index 4b7ff263f1..34f1b4fb99 100644 --- a/packages/core/src/view/plugins/CellEditorHandler.ts +++ b/packages/core/src/view/plugins/CellEditorHandler.ts @@ -16,10 +16,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { getAlignmentAsPoint, setPrefixedStyle } from '../../util/styleUtils'; -import Rectangle from '../geometry/Rectangle'; -import InternalEvent from '../event/InternalEvent'; -import Client from '../../Client'; +import { getAlignmentAsPoint, setPrefixedStyle } from '../../util/styleUtils.js'; +import Rectangle from '../geometry/Rectangle.js'; +import InternalEvent from '../event/InternalEvent.js'; +import Client from '../../Client.js'; import { ABSOLUTE_LINE_HEIGHT, DEFAULT_FONTFAMILY, @@ -29,26 +29,30 @@ import { LINE_HEIGHT, NONE, WORD_WRAP, -} from '../../util/Constants'; -import TextShape from '../shape/node/TextShape'; -import Cell from '../cell/Cell'; -import InternalMouseEvent from '../event/InternalMouseEvent'; -import CellState from '../cell/CellState'; -import Shape from '../shape/Shape'; -import { clearSelection, extractTextWithWhitespace, isNode } from '../../util/domUtils'; -import { htmlEntities, replaceTrailingNewlines } from '../../util/StringUtils'; +} from '../../util/Constants.js'; +import TextShape from '../shape/node/TextShape.js'; +import Cell from '../cell/Cell.js'; +import InternalMouseEvent from '../event/InternalMouseEvent.js'; +import CellState from '../cell/CellState.js'; +import Shape from '../shape/Shape.js'; +import { + clearSelection, + extractTextWithWhitespace, + isNode, +} from '../../util/domUtils.js'; +import { htmlEntities, replaceTrailingNewlines } from '../../util/StringUtils.js'; import { getSource, isConsumed, isControlDown, isMetaDown, isShiftDown, -} from '../../util/EventUtils'; -import EventSource from '../event/EventSource'; -import { matchBinaryMask } from '../../internal/utils'; -import type { AbstractGraph } from '../AbstractGraph'; -import type { AlignValue, GraphPlugin } from '../../types'; -import type TooltipHandler from './TooltipHandler'; +} from '../../util/EventUtils.js'; +import EventSource from '../event/EventSource.js'; +import { matchBinaryMask } from '../../internal/utils.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import type { AlignValue, GraphPlugin } from '../../types.js'; +import type TooltipHandler from './TooltipHandler.js'; /** * In-place editor for the graph. diff --git a/packages/core/src/view/plugins/ConnectionHandler.ts b/packages/core/src/view/plugins/ConnectionHandler.ts index d058c73026..3306c19c78 100644 --- a/packages/core/src/view/plugins/ConnectionHandler.ts +++ b/packages/core/src/view/plugins/ConnectionHandler.ts @@ -16,11 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Geometry from '../geometry/Geometry'; -import Cell from '../cell/Cell'; -import Point from '../geometry/Point'; -import EventObject from '../event/EventObject'; -import InternalEvent from '../event/InternalEvent'; +import Geometry from '../geometry/Geometry.js'; +import Cell from '../cell/Cell.js'; +import Point from '../geometry/Point.js'; +import EventObject from '../event/EventObject.js'; +import InternalEvent from '../event/InternalEvent.js'; import { DEFAULT_HOTSPOT, DEFAULT_INVALID_COLOR, @@ -32,36 +32,36 @@ import { OUTLINE_HIGHLIGHT_STROKEWIDTH, TOOLTIP_VERTICAL_OFFSET, VALID_COLOR, -} from '../../util/Constants'; -import { getRotatedPoint, toRadians } from '../../util/mathUtils'; -import { convertPoint, getOffset } from '../../util/styleUtils'; -import InternalMouseEvent from '../event/InternalMouseEvent'; -import ImageShape from '../shape/node/ImageShape'; -import CellMarker from '../cell/CellMarker'; -import ConstraintHandler from '../handler/ConstraintHandler'; -import PolylineShape from '../shape/edge/PolylineShape'; -import EventSource from '../event/EventSource'; -import Rectangle from '../geometry/Rectangle'; -import { GlobalConfig } from '../../util/config'; +} from '../../util/Constants.js'; +import { getRotatedPoint, toRadians } from '../../util/mathUtils.js'; +import { convertPoint, getOffset } from '../../util/styleUtils.js'; +import InternalMouseEvent from '../event/InternalMouseEvent.js'; +import ImageShape from '../shape/node/ImageShape.js'; +import CellMarker from '../cell/CellMarker.js'; +import ConstraintHandler from '../handler/ConstraintHandler.js'; +import PolylineShape from '../shape/edge/PolylineShape.js'; +import EventSource from '../event/EventSource.js'; +import Rectangle from '../geometry/Rectangle.js'; +import { GlobalConfig } from '../../util/config.js'; import { getClientX, getClientY, isAltDown, isConsumed, isShiftDown, -} from '../../util/EventUtils'; -import Image from '../image/ImageBox'; -import CellState from '../cell/CellState'; -import type { AbstractGraph } from '../AbstractGraph'; -import ConnectionConstraint from '../other/ConnectionConstraint'; -import Shape from '../shape/Shape'; +} from '../../util/EventUtils.js'; +import Image from '../image/ImageBox.js'; +import CellState from '../cell/CellState.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import ConnectionConstraint from '../other/ConnectionConstraint.js'; +import Shape from '../shape/Shape.js'; import type { CellStyle, ColorValue, GraphPlugin, Listenable, MouseListenerSet, -} from '../../types'; +} from '../../types.js'; type FactoryMethod = ( source: Cell | null, diff --git a/packages/core/src/view/plugins/FitPlugin.ts b/packages/core/src/view/plugins/FitPlugin.ts index 0043ba0970..410fafa354 100644 --- a/packages/core/src/view/plugins/FitPlugin.ts +++ b/packages/core/src/view/plugins/FitPlugin.ts @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type { GraphPlugin } from '../../types'; -import type { AbstractGraph } from '../AbstractGraph'; -import { hasScrollbars } from '../../util/styleUtils'; +import type { GraphPlugin } from '../../types.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import { hasScrollbars } from '../../util/styleUtils.js'; function keep2digits(value: number): number { return Number(value.toFixed(2)); diff --git a/packages/core/src/view/plugins/PanningHandler.ts b/packages/core/src/view/plugins/PanningHandler.ts index 5f62d1adf4..68c062af52 100644 --- a/packages/core/src/view/plugins/PanningHandler.ts +++ b/packages/core/src/view/plugins/PanningHandler.ts @@ -16,10 +16,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import EventSource from '../event/EventSource'; -import { hasScrollbars } from '../../util/styleUtils'; -import EventObject from '../event/EventObject'; -import InternalEvent from '../event/InternalEvent'; +import EventSource from '../event/EventSource.js'; +import { hasScrollbars } from '../../util/styleUtils.js'; +import EventObject from '../event/EventObject.js'; +import InternalEvent from '../event/InternalEvent.js'; import { isConsumed, isControlDown, @@ -27,12 +27,12 @@ import { isMultiTouchEvent, isPopupTrigger, isShiftDown, -} from '../../util/EventUtils'; -import PanningManager from '../other/PanningManager'; -import InternalMouseEvent from '../event/InternalMouseEvent'; +} from '../../util/EventUtils.js'; +import PanningManager from '../other/PanningManager.js'; +import InternalMouseEvent from '../event/InternalMouseEvent.js'; -import type { GraphPlugin, MouseEventListener, MouseListenerSet } from '../../types'; -import type { AbstractGraph } from '../AbstractGraph'; +import type { GraphPlugin, MouseEventListener, MouseListenerSet } from '../../types.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; /** * Event handler that pans and creates popupmenus. diff --git a/packages/core/src/view/plugins/PopupMenuHandler.ts b/packages/core/src/view/plugins/PopupMenuHandler.ts index 1136c03f49..cc38249a4e 100644 --- a/packages/core/src/view/plugins/PopupMenuHandler.ts +++ b/packages/core/src/view/plugins/PopupMenuHandler.ts @@ -16,16 +16,16 @@ See the License for the specific language governing permissions and limitations under the License. */ -import MaxPopupMenu from '../../gui/MaxPopupMenu'; -import InternalEvent from '../event/InternalEvent'; -import { getScrollOrigin } from '../../util/styleUtils'; -import { getMainEvent, isMultiTouchEvent } from '../../util/EventUtils'; -import type { AbstractGraph } from '../AbstractGraph'; -import InternalMouseEvent from '../event/InternalMouseEvent'; -import type { GraphPlugin, MouseListenerSet } from '../../types'; -import type TooltipHandler from './TooltipHandler'; -import EventSource from '../event/EventSource'; -import EventObject from '../event/EventObject'; +import MaxPopupMenu from '../../gui/MaxPopupMenu.js'; +import InternalEvent from '../event/InternalEvent.js'; +import { getScrollOrigin } from '../../util/styleUtils.js'; +import { getMainEvent, isMultiTouchEvent } from '../../util/EventUtils.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import InternalMouseEvent from '../event/InternalMouseEvent.js'; +import type { GraphPlugin, MouseListenerSet } from '../../types.js'; +import type TooltipHandler from './TooltipHandler.js'; +import EventSource from '../event/EventSource.js'; +import EventObject from '../event/EventObject.js'; /** * Event handler that creates popupmenus. diff --git a/packages/core/src/view/plugins/RubberBandHandler.ts b/packages/core/src/view/plugins/RubberBandHandler.ts index cd381726d6..fdd86bcce7 100644 --- a/packages/core/src/view/plugins/RubberBandHandler.ts +++ b/packages/core/src/view/plugins/RubberBandHandler.ts @@ -22,18 +22,18 @@ import { getScrollOrigin, setOpacity, setPrefixedStyle, -} from '../../util/styleUtils'; -import InternalEvent from '../event/InternalEvent'; -import Point from '../geometry/Point'; -import InternalMouseEvent from '../event/InternalMouseEvent'; -import Client from '../../Client'; -import Rectangle from '../geometry/Rectangle'; -import { isAltDown, isMultiTouchEvent } from '../../util/EventUtils'; -import { clearSelection } from '../../util/domUtils'; -import type { AbstractGraph } from '../AbstractGraph'; -import type { GraphPlugin, MouseListenerSet } from '../../types'; -import EventObject from '../event/EventObject'; -import EventSource from '../event/EventSource'; +} from '../../util/styleUtils.js'; +import InternalEvent from '../event/InternalEvent.js'; +import Point from '../geometry/Point.js'; +import InternalMouseEvent from '../event/InternalMouseEvent.js'; +import Client from '../../Client.js'; +import Rectangle from '../geometry/Rectangle.js'; +import { isAltDown, isMultiTouchEvent } from '../../util/EventUtils.js'; +import { clearSelection } from '../../util/domUtils.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import type { GraphPlugin, MouseListenerSet } from '../../types.js'; +import EventObject from '../event/EventObject.js'; +import EventSource from '../event/EventSource.js'; /** * Event handler that selects rectangular regions. diff --git a/packages/core/src/view/plugins/SelectionCellsHandler.ts b/packages/core/src/view/plugins/SelectionCellsHandler.ts index cfbaa8c500..da97a0c94a 100644 --- a/packages/core/src/view/plugins/SelectionCellsHandler.ts +++ b/packages/core/src/view/plugins/SelectionCellsHandler.ts @@ -16,17 +16,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -import EventSource from '../event/EventSource'; -import EventObject from '../event/EventObject'; -import InternalEvent from '../event/InternalEvent'; -import { sortCells } from '../../util/styleUtils'; -import type { AbstractGraph } from '../AbstractGraph'; -import Cell from '../cell/Cell'; -import CellState from '../cell/CellState'; -import type { GraphPlugin, MouseListenerSet } from '../../types'; -import type EdgeHandler from '../handler/EdgeHandler'; -import type VertexHandler from '../handler/VertexHandler'; -import InternalMouseEvent from '../event/InternalMouseEvent'; +import EventSource from '../event/EventSource.js'; +import EventObject from '../event/EventObject.js'; +import InternalEvent from '../event/InternalEvent.js'; +import { sortCells } from '../../util/styleUtils.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import Cell from '../cell/Cell.js'; +import CellState from '../cell/CellState.js'; +import type { GraphPlugin, MouseListenerSet } from '../../types.js'; +import type EdgeHandler from '../handler/EdgeHandler.js'; +import type VertexHandler from '../handler/VertexHandler.js'; +import InternalMouseEvent from '../event/InternalMouseEvent.js'; type Handler = EdgeHandler | VertexHandler; diff --git a/packages/core/src/view/plugins/SelectionHandler.ts b/packages/core/src/view/plugins/SelectionHandler.ts index f86351ade3..f1d74e009f 100644 --- a/packages/core/src/view/plugins/SelectionHandler.ts +++ b/packages/core/src/view/plugins/SelectionHandler.ts @@ -16,40 +16,40 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Client from '../../Client'; -import InternalEvent from '../event/InternalEvent'; -import { contains, getRotatedPoint, isNumeric, toRadians } from '../../util/mathUtils'; -import { convertPoint } from '../../util/styleUtils'; -import RectangleShape from '../shape/node/RectangleShape'; -import Guide from '../other/Guide'; -import Point from '../geometry/Point'; +import Client from '../../Client.js'; +import InternalEvent from '../event/InternalEvent.js'; +import { contains, getRotatedPoint, isNumeric, toRadians } from '../../util/mathUtils.js'; +import { convertPoint } from '../../util/styleUtils.js'; +import RectangleShape from '../shape/node/RectangleShape.js'; +import Guide from '../other/Guide.js'; +import Point from '../geometry/Point.js'; import { DROP_TARGET_COLOR, INVALID_CONNECT_TARGET_COLOR, NONE, VALID_COLOR, -} from '../../util/Constants'; -import CellHighlight from '../cell/CellHighlight'; -import Rectangle from '../geometry/Rectangle'; +} from '../../util/Constants.js'; +import CellHighlight from '../cell/CellHighlight.js'; +import Rectangle from '../geometry/Rectangle.js'; import { getClientX, getClientY, isAltDown, isMultiTouchEvent, -} from '../../util/EventUtils'; -import type { AbstractGraph } from '../AbstractGraph'; -import Shape from '../shape/Shape'; -import InternalMouseEvent from '../event/InternalMouseEvent'; -import type SelectionCellsHandler from './SelectionCellsHandler'; -import Cell from '../cell/Cell'; -import type PopupMenuHandler from './PopupMenuHandler'; -import EventSource from '../event/EventSource'; -import CellState from '../cell/CellState'; -import EventObject from '../event/EventObject'; -import type ConnectionHandler from './ConnectionHandler'; -import { EdgeHandlerConfig, VertexHandlerConfig } from '../handler/config'; -import type CellEditorHandler from './CellEditorHandler'; -import type { ColorValue, GraphPlugin, MouseListenerSet } from '../../types'; +} from '../../util/EventUtils.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import Shape from '../shape/Shape.js'; +import InternalMouseEvent from '../event/InternalMouseEvent.js'; +import type SelectionCellsHandler from './SelectionCellsHandler.js'; +import Cell from '../cell/Cell.js'; +import type PopupMenuHandler from './PopupMenuHandler.js'; +import EventSource from '../event/EventSource.js'; +import CellState from '../cell/CellState.js'; +import EventObject from '../event/EventObject.js'; +import type ConnectionHandler from './ConnectionHandler.js'; +import { EdgeHandlerConfig, VertexHandlerConfig } from '../handler/config.js'; +import type CellEditorHandler from './CellEditorHandler.js'; +import type { ColorValue, GraphPlugin, MouseListenerSet } from '../../types.js'; /** * Graph event handler that handles selection. diff --git a/packages/core/src/view/plugins/TooltipHandler.ts b/packages/core/src/view/plugins/TooltipHandler.ts index c43e8f1369..6cf870edbb 100644 --- a/packages/core/src/view/plugins/TooltipHandler.ts +++ b/packages/core/src/view/plugins/TooltipHandler.ts @@ -16,17 +16,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -import InternalEvent from '../event/InternalEvent'; -import { fit, getScrollOrigin } from '../../util/styleUtils'; -import { TOOLTIP_VERTICAL_OFFSET } from '../../util/Constants'; -import { getSource, isMouseEvent } from '../../util/EventUtils'; -import { isNode } from '../../util/domUtils'; -import type { AbstractGraph } from '../AbstractGraph'; -import CellState from '../cell/CellState'; -import InternalMouseEvent from '../event/InternalMouseEvent'; -import type PopupMenuHandler from './PopupMenuHandler'; -import type { GraphPlugin, MouseListenerSet } from '../../types'; -import EventSource from '../event/EventSource'; +import InternalEvent from '../event/InternalEvent.js'; +import { fit, getScrollOrigin } from '../../util/styleUtils.js'; +import { TOOLTIP_VERTICAL_OFFSET } from '../../util/Constants.js'; +import { getSource, isMouseEvent } from '../../util/EventUtils.js'; +import { isNode } from '../../util/domUtils.js'; +import type { AbstractGraph } from '../AbstractGraph.js'; +import CellState from '../cell/CellState.js'; +import InternalMouseEvent from '../event/InternalMouseEvent.js'; +import type PopupMenuHandler from './PopupMenuHandler.js'; +import type { GraphPlugin, MouseListenerSet } from '../../types.js'; +import EventSource from '../event/EventSource.js'; /** * Graph event handler that displays tooltips. diff --git a/packages/core/src/view/plugins/index.ts b/packages/core/src/view/plugins/index.ts index 5fe539029d..8469327adf 100644 --- a/packages/core/src/view/plugins/index.ts +++ b/packages/core/src/view/plugins/index.ts @@ -14,26 +14,26 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type { GraphPluginConstructor } from '../../types'; -import CellEditorHandler from './CellEditorHandler'; -import TooltipHandler from './TooltipHandler'; -import SelectionCellsHandler from './SelectionCellsHandler'; -import PopupMenuHandler from './PopupMenuHandler'; -import ConnectionHandler from './ConnectionHandler'; -import SelectionHandler from './SelectionHandler'; -import PanningHandler from './PanningHandler'; -import { FitPlugin } from './FitPlugin'; +import type { GraphPluginConstructor } from '../../types.js'; +import CellEditorHandler from './CellEditorHandler.js'; +import TooltipHandler from './TooltipHandler.js'; +import SelectionCellsHandler from './SelectionCellsHandler.js'; +import PopupMenuHandler from './PopupMenuHandler.js'; +import ConnectionHandler from './ConnectionHandler.js'; +import SelectionHandler from './SelectionHandler.js'; +import PanningHandler from './PanningHandler.js'; +import { FitPlugin } from './FitPlugin.js'; // Export all plugins and types to have them in the root barrel file -export { default as CellEditorHandler } from './CellEditorHandler'; -export { default as ConnectionHandler } from './ConnectionHandler'; -export * from './FitPlugin'; -export { default as PanningHandler } from './PanningHandler'; -export { default as PopupMenuHandler } from './PopupMenuHandler'; -export { default as RubberBandHandler } from './RubberBandHandler'; -export { default as SelectionCellsHandler } from './SelectionCellsHandler'; -export { default as SelectionHandler } from './SelectionHandler'; -export { default as TooltipHandler } from './TooltipHandler'; +export { default as CellEditorHandler } from './CellEditorHandler.js'; +export { default as ConnectionHandler } from './ConnectionHandler.js'; +export * from './FitPlugin.js'; +export { default as PanningHandler } from './PanningHandler.js'; +export { default as PopupMenuHandler } from './PopupMenuHandler.js'; +export { default as RubberBandHandler } from './RubberBandHandler.js'; +export { default as SelectionCellsHandler } from './SelectionCellsHandler.js'; +export { default as SelectionHandler } from './SelectionHandler.js'; +export { default as TooltipHandler } from './TooltipHandler.js'; /** * Returns the list of plugins used by default in `maxGraph`. diff --git a/packages/core/src/view/shape/Shape.ts b/packages/core/src/view/shape/Shape.ts index d95bc5377e..bbbf346fc4 100644 --- a/packages/core/src/view/shape/Shape.ts +++ b/packages/core/src/view/shape/Shape.ts @@ -16,24 +16,24 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Rectangle from '../geometry/Rectangle'; -import { isNullish } from '../../internal/utils'; -import { getBoundingBox, getDirectedBounds, mod } from '../../util/mathUtils'; +import Rectangle from '../geometry/Rectangle.js'; +import { isNullish } from '../../internal/utils.js'; +import { getBoundingBox, getDirectedBounds, mod } from '../../util/mathUtils.js'; import { LINE_ARCSIZE, NONE, NS_SVG, RECTANGLE_ROUNDING_FACTOR, -} from '../../util/Constants'; -import Point from '../geometry/Point'; -import type AbstractCanvas2D from '../canvas/AbstractCanvas2D'; -import SvgCanvas2D from '../canvas/SvgCanvas2D'; -import InternalEvent from '../event/InternalEvent'; -import Client from '../../Client'; -import type CellState from '../cell/CellState'; -import type StencilShape from './stencil/StencilShape'; -import type CellOverlay from '../cell/CellOverlay'; -import type ImageBox from '../image/ImageBox'; +} from '../../util/Constants.js'; +import Point from '../geometry/Point.js'; +import type AbstractCanvas2D from '../canvas/AbstractCanvas2D.js'; +import SvgCanvas2D from '../canvas/SvgCanvas2D.js'; +import InternalEvent from '../event/InternalEvent.js'; +import Client from '../../Client.js'; +import type CellState from '../cell/CellState.js'; +import type StencilShape from './stencil/StencilShape.js'; +import type CellOverlay from '../cell/CellOverlay.js'; +import type ImageBox from '../image/ImageBox.js'; import type { ArrowValue, CellStateStyle, @@ -41,8 +41,8 @@ import type { DialectValue, DirectionValue, GradientMap, -} from '../../types'; -import { StyleDefaultsConfig } from '../../util/config'; +} from '../../types.js'; +import { StyleDefaultsConfig } from '../../util/config.js'; /** * Base class for all shapes. diff --git a/packages/core/src/view/shape/ShapeRegistry.ts b/packages/core/src/view/shape/ShapeRegistry.ts index fed81b1bde..1e3ad4db24 100644 --- a/packages/core/src/view/shape/ShapeRegistry.ts +++ b/packages/core/src/view/shape/ShapeRegistry.ts @@ -16,8 +16,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type { Registry, ShapeConstructor } from '../../types'; -import { BaseRegistry } from '../../internal/BaseRegistry'; +import type { Registry, ShapeConstructor } from '../../types.js'; +import { BaseRegistry } from '../../internal/BaseRegistry.js'; /** * A registry that stores the {@link ShapeConstructor}s and their configuration. diff --git a/packages/core/src/view/shape/edge/ArrowConnectorShape.ts b/packages/core/src/view/shape/edge/ArrowConnectorShape.ts index 2f5651b47e..f8645b5455 100644 --- a/packages/core/src/view/shape/edge/ArrowConnectorShape.ts +++ b/packages/core/src/view/shape/edge/ArrowConnectorShape.ts @@ -16,14 +16,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Shape from '../Shape'; -import { ARROW_SIZE, ARROW_SPACING, ARROW_WIDTH, NONE } from '../../../util/Constants'; -import { relativeCcw } from '../../../util/mathUtils'; -import AbstractCanvas2D from '../../canvas/AbstractCanvas2D'; -import Point from '../../geometry/Point'; -import Rectangle from '../../geometry/Rectangle'; -import CellState from '../../cell/CellState'; -import { ColorValue } from '../../../types'; +import Shape from '../Shape.js'; +import { ARROW_SIZE, ARROW_SPACING, ARROW_WIDTH, NONE } from '../../../util/Constants.js'; +import { relativeCcw } from '../../../util/mathUtils.js'; +import AbstractCanvas2D from '../../canvas/AbstractCanvas2D.js'; +import Point from '../../geometry/Point.js'; +import Rectangle from '../../geometry/Rectangle.js'; +import CellState from '../../cell/CellState.js'; +import { ColorValue } from '../../../types.js'; /** * Extends {@link Shape} to implement a new rounded arrow shape with support for waypoints and double arrows. diff --git a/packages/core/src/view/shape/edge/ArrowShape.ts b/packages/core/src/view/shape/edge/ArrowShape.ts index fc32e32610..5ecd7a7922 100644 --- a/packages/core/src/view/shape/edge/ArrowShape.ts +++ b/packages/core/src/view/shape/edge/ArrowShape.ts @@ -16,12 +16,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Shape from '../Shape'; -import { ARROW_SIZE, ARROW_SPACING, ARROW_WIDTH } from '../../../util/Constants'; -import Rectangle from '../../geometry/Rectangle'; -import AbstractCanvas2D from '../../canvas/AbstractCanvas2D'; -import Point from '../../geometry/Point'; -import { ColorValue } from '../../../types'; +import Shape from '../Shape.js'; +import { ARROW_SIZE, ARROW_SPACING, ARROW_WIDTH } from '../../../util/Constants.js'; +import Rectangle from '../../geometry/Rectangle.js'; +import AbstractCanvas2D from '../../canvas/AbstractCanvas2D.js'; +import Point from '../../geometry/Point.js'; +import { ColorValue } from '../../../types.js'; /** * Extends {@link Shape} to implement an arrow shape. diff --git a/packages/core/src/view/shape/edge/ConnectorShape.ts b/packages/core/src/view/shape/edge/ConnectorShape.ts index f36add3ea5..949285e4e2 100644 --- a/packages/core/src/view/shape/edge/ConnectorShape.ts +++ b/packages/core/src/view/shape/edge/ConnectorShape.ts @@ -16,13 +16,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { DEFAULT_MARKERSIZE, NONE } from '../../../util/Constants'; -import PolylineShape from './PolylineShape'; -import { EdgeMarkerRegistry } from '../../style/marker/EdgeMarkerRegistry'; -import Point from '../../geometry/Point'; -import AbstractCanvas2D from '../../canvas/AbstractCanvas2D'; -import Rectangle from '../../geometry/Rectangle'; -import { ArrowValue, ColorValue } from '../../../types'; +import { DEFAULT_MARKERSIZE, NONE } from '../../../util/Constants.js'; +import PolylineShape from './PolylineShape.js'; +import { EdgeMarkerRegistry } from '../../style/marker/EdgeMarkerRegistry.js'; +import Point from '../../geometry/Point.js'; +import AbstractCanvas2D from '../../canvas/AbstractCanvas2D.js'; +import Rectangle from '../../geometry/Rectangle.js'; +import { ArrowValue, ColorValue } from '../../../types.js'; /** * Extends {@link PolylineShape} to implement a connector shape including a polyline (a line with multiple points) diff --git a/packages/core/src/view/shape/edge/LineShape.ts b/packages/core/src/view/shape/edge/LineShape.ts index 52da67c4ac..dd694a0228 100644 --- a/packages/core/src/view/shape/edge/LineShape.ts +++ b/packages/core/src/view/shape/edge/LineShape.ts @@ -16,10 +16,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Shape from '../Shape'; -import AbstractCanvas2D from '../../canvas/AbstractCanvas2D'; -import Rectangle from '../../geometry/Rectangle'; -import { ColorValue } from '../../../types'; +import Shape from '../Shape.js'; +import AbstractCanvas2D from '../../canvas/AbstractCanvas2D.js'; +import Rectangle from '../../geometry/Rectangle.js'; +import { ColorValue } from '../../../types.js'; /** * Extends {@link Shape} to implement a horizontal line shape. diff --git a/packages/core/src/view/shape/edge/PolylineShape.ts b/packages/core/src/view/shape/edge/PolylineShape.ts index 15c7fbf845..f88b62bf88 100644 --- a/packages/core/src/view/shape/edge/PolylineShape.ts +++ b/packages/core/src/view/shape/edge/PolylineShape.ts @@ -16,11 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Shape from '../Shape'; -import { LINE_ARCSIZE } from '../../../util/Constants'; -import Point from '../../geometry/Point'; -import AbstractCanvas2D from '../../canvas/AbstractCanvas2D'; -import { ColorValue } from '../../../types'; +import Shape from '../Shape.js'; +import { LINE_ARCSIZE } from '../../../util/Constants.js'; +import Point from '../../geometry/Point.js'; +import AbstractCanvas2D from '../../canvas/AbstractCanvas2D.js'; +import { ColorValue } from '../../../types.js'; /** * Extends {@link Shape} to implement a polyline (a line with multiple points). diff --git a/packages/core/src/view/shape/node/ActorShape.ts b/packages/core/src/view/shape/node/ActorShape.ts index f044540165..a194b110ba 100644 --- a/packages/core/src/view/shape/node/ActorShape.ts +++ b/packages/core/src/view/shape/node/ActorShape.ts @@ -16,11 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Rectangle from '../../geometry/Rectangle'; -import Shape from '../Shape'; -import type AbstractCanvas2D from '../../canvas/AbstractCanvas2D'; -import { ColorValue } from '../../../types'; -import { NONE } from '../../../util/Constants'; +import type Rectangle from '../../geometry/Rectangle.js'; +import Shape from '../Shape.js'; +import type AbstractCanvas2D from '../../canvas/AbstractCanvas2D.js'; +import { ColorValue } from '../../../types.js'; +import { NONE } from '../../../util/Constants.js'; /** * Extends {@link Shape} to implement an actor shape. diff --git a/packages/core/src/view/shape/node/CloudShape.ts b/packages/core/src/view/shape/node/CloudShape.ts index 66790fca44..1f53a86f82 100644 --- a/packages/core/src/view/shape/node/CloudShape.ts +++ b/packages/core/src/view/shape/node/CloudShape.ts @@ -16,9 +16,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import ActorShape from './ActorShape'; -import AbstractCanvas2D from '../../canvas/AbstractCanvas2D'; -import Rectangle from '../../geometry/Rectangle'; +import ActorShape from './ActorShape.js'; +import AbstractCanvas2D from '../../canvas/AbstractCanvas2D.js'; +import Rectangle from '../../geometry/Rectangle.js'; /** * Extends {@link ActorShape} to implement a cloud shape. diff --git a/packages/core/src/view/shape/node/CylinderShape.ts b/packages/core/src/view/shape/node/CylinderShape.ts index fc86952ccd..9e26ab5af0 100644 --- a/packages/core/src/view/shape/node/CylinderShape.ts +++ b/packages/core/src/view/shape/node/CylinderShape.ts @@ -16,10 +16,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Shape from '../Shape'; -import AbstractCanvas2D from '../../canvas/AbstractCanvas2D'; -import Rectangle from '../../geometry/Rectangle'; -import { NONE } from '../../../util/Constants'; +import Shape from '../Shape.js'; +import AbstractCanvas2D from '../../canvas/AbstractCanvas2D.js'; +import Rectangle from '../../geometry/Rectangle.js'; +import { NONE } from '../../../util/Constants.js'; /** * Extends {@link Shape} to implement a cylinder shape. diff --git a/packages/core/src/view/shape/node/DoubleEllipseShape.ts b/packages/core/src/view/shape/node/DoubleEllipseShape.ts index d664b25c6d..31e8a86b30 100644 --- a/packages/core/src/view/shape/node/DoubleEllipseShape.ts +++ b/packages/core/src/view/shape/node/DoubleEllipseShape.ts @@ -16,9 +16,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Rectangle from '../../geometry/Rectangle'; -import Shape from '../Shape'; -import AbstractCanvas2D from '../../canvas/AbstractCanvas2D'; +import Rectangle from '../../geometry/Rectangle.js'; +import Shape from '../Shape.js'; +import AbstractCanvas2D from '../../canvas/AbstractCanvas2D.js'; /** * Extends {@link Shape} to implement a double ellipse shape. diff --git a/packages/core/src/view/shape/node/EllipseShape.ts b/packages/core/src/view/shape/node/EllipseShape.ts index 9f00600a22..4ffb14c09b 100644 --- a/packages/core/src/view/shape/node/EllipseShape.ts +++ b/packages/core/src/view/shape/node/EllipseShape.ts @@ -16,9 +16,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Shape from '../Shape'; -import AbstractCanvas2D from '../../canvas/AbstractCanvas2D'; -import Rectangle from '../../geometry/Rectangle'; +import Shape from '../Shape.js'; +import AbstractCanvas2D from '../../canvas/AbstractCanvas2D.js'; +import Rectangle from '../../geometry/Rectangle.js'; /** * Extends {@link Shape} to implement an ellipse shape. diff --git a/packages/core/src/view/shape/node/HexagonShape.ts b/packages/core/src/view/shape/node/HexagonShape.ts index 8b476b7dd3..4ff0bc1597 100644 --- a/packages/core/src/view/shape/node/HexagonShape.ts +++ b/packages/core/src/view/shape/node/HexagonShape.ts @@ -16,10 +16,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import ActorShape from './ActorShape'; -import Point from '../../geometry/Point'; -import { LINE_ARCSIZE } from '../../../util/Constants'; -import AbstractCanvas2D from '../../canvas/AbstractCanvas2D'; +import ActorShape from './ActorShape.js'; +import Point from '../../geometry/Point.js'; +import { LINE_ARCSIZE } from '../../../util/Constants.js'; +import AbstractCanvas2D from '../../canvas/AbstractCanvas2D.js'; /** * Implementation of the hexagon shape. diff --git a/packages/core/src/view/shape/node/ImageShape.ts b/packages/core/src/view/shape/node/ImageShape.ts index 21dc260480..a4f4899c9b 100644 --- a/packages/core/src/view/shape/node/ImageShape.ts +++ b/packages/core/src/view/shape/node/ImageShape.ts @@ -16,12 +16,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import RectangleShape from './RectangleShape'; -import type Rectangle from '../../geometry/Rectangle'; -import CellState from '../../cell/CellState'; -import type AbstractCanvas2D from '../../canvas/AbstractCanvas2D'; -import { NONE } from '../../../util/Constants'; -import { ColorValue } from '../../../types'; +import RectangleShape from './RectangleShape.js'; +import type Rectangle from '../../geometry/Rectangle.js'; +import CellState from '../../cell/CellState.js'; +import type AbstractCanvas2D from '../../canvas/AbstractCanvas2D.js'; +import { NONE } from '../../../util/Constants.js'; +import { ColorValue } from '../../../types.js'; /** * Extends {@link RectangleShape} to implement an image shape. diff --git a/packages/core/src/view/shape/node/LabelShape.ts b/packages/core/src/view/shape/node/LabelShape.ts index 4eefec1ea4..a27735f352 100644 --- a/packages/core/src/view/shape/node/LabelShape.ts +++ b/packages/core/src/view/shape/node/LabelShape.ts @@ -16,11 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Rectangle from '../../geometry/Rectangle'; -import { DEFAULT_IMAGESIZE, NONE } from '../../../util/Constants'; -import RectangleShape from './RectangleShape'; -import { ColorValue } from '../../../types'; -import AbstractCanvas2D from '../../canvas/AbstractCanvas2D'; +import Rectangle from '../../geometry/Rectangle.js'; +import { DEFAULT_IMAGESIZE, NONE } from '../../../util/Constants.js'; +import RectangleShape from './RectangleShape.js'; +import { ColorValue } from '../../../types.js'; +import AbstractCanvas2D from '../../canvas/AbstractCanvas2D.js'; /** * Extends {@link RectangleShape} to implement an image shape with a label. diff --git a/packages/core/src/view/shape/node/RectangleShape.ts b/packages/core/src/view/shape/node/RectangleShape.ts index f5f2e90e28..91b8f3c29f 100644 --- a/packages/core/src/view/shape/node/RectangleShape.ts +++ b/packages/core/src/view/shape/node/RectangleShape.ts @@ -16,11 +16,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { LINE_ARCSIZE, NONE, RECTANGLE_ROUNDING_FACTOR } from '../../../util/Constants'; -import Shape from '../Shape'; -import AbstractCanvas2D from '../../canvas/AbstractCanvas2D'; -import Rectangle from '../../geometry/Rectangle'; -import { ColorValue } from '../../../types'; +import { + LINE_ARCSIZE, + NONE, + RECTANGLE_ROUNDING_FACTOR, +} from '../../../util/Constants.js'; +import Shape from '../Shape.js'; +import AbstractCanvas2D from '../../canvas/AbstractCanvas2D.js'; +import Rectangle from '../../geometry/Rectangle.js'; +import { ColorValue } from '../../../types.js'; /** * Extends {@link Shape} to implement a rectangle shape. diff --git a/packages/core/src/view/shape/node/RhombusShape.ts b/packages/core/src/view/shape/node/RhombusShape.ts index fb93096c82..513038af38 100644 --- a/packages/core/src/view/shape/node/RhombusShape.ts +++ b/packages/core/src/view/shape/node/RhombusShape.ts @@ -16,11 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Shape from '../Shape'; -import Point from '../../geometry/Point'; -import { LINE_ARCSIZE } from '../../../util/Constants'; -import Rectangle from '../../geometry/Rectangle'; -import AbstractCanvas2D from '../../canvas/AbstractCanvas2D'; +import Shape from '../Shape.js'; +import Point from '../../geometry/Point.js'; +import { LINE_ARCSIZE } from '../../../util/Constants.js'; +import Rectangle from '../../geometry/Rectangle.js'; +import AbstractCanvas2D from '../../canvas/AbstractCanvas2D.js'; /** * Extends {@link Shape} to implement a rhombus (aka diamond) shape. diff --git a/packages/core/src/view/shape/node/SwimlaneShape.ts b/packages/core/src/view/shape/node/SwimlaneShape.ts index f398d18bde..3b5a319374 100644 --- a/packages/core/src/view/shape/node/SwimlaneShape.ts +++ b/packages/core/src/view/shape/node/SwimlaneShape.ts @@ -15,16 +15,16 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import Shape from '../Shape'; -import Rectangle from '../../geometry/Rectangle'; +import Shape from '../Shape.js'; +import Rectangle from '../../geometry/Rectangle.js'; import { DEFAULT_STARTSIZE, LINE_ARCSIZE, NONE, RECTANGLE_ROUNDING_FACTOR, -} from '../../../util/Constants'; -import { ColorValue } from '../../../types'; -import AbstractCanvas2D from '../../canvas/AbstractCanvas2D'; +} from '../../../util/Constants.js'; +import { ColorValue } from '../../../types.js'; +import AbstractCanvas2D from '../../canvas/AbstractCanvas2D.js'; /** * Extends {@link Shape} to implement a swimlane shape. diff --git a/packages/core/src/view/shape/node/TextShape.ts b/packages/core/src/view/shape/node/TextShape.ts index 70153dd797..67f7b4e3bb 100644 --- a/packages/core/src/view/shape/node/TextShape.ts +++ b/packages/core/src/view/shape/node/TextShape.ts @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Client from '../../../Client'; +import Client from '../../../Client.js'; import { ABSOLUTE_LINE_HEIGHT, DEFAULT_FONTFAMILY, @@ -27,25 +27,29 @@ import { NONE, WORD_WRAP, LINE_HEIGHT, -} from '../../../util/Constants'; -import { getBoundingBox } from '../../../util/mathUtils'; -import { getAlignmentAsPoint } from '../../../util/styleUtils'; -import Point from '../../geometry/Point'; -import AbstractCanvas2D from '../../canvas/AbstractCanvas2D'; -import Shape from '../Shape'; -import Rectangle from '../../geometry/Rectangle'; -import CellState from '../../cell/CellState'; -import { htmlEntities, replaceTrailingNewlines, trim } from '../../../util/StringUtils'; -import { isNode } from '../../../util/domUtils'; +} from '../../../util/Constants.js'; +import { getBoundingBox } from '../../../util/mathUtils.js'; +import { getAlignmentAsPoint } from '../../../util/styleUtils.js'; +import Point from '../../geometry/Point.js'; +import AbstractCanvas2D from '../../canvas/AbstractCanvas2D.js'; +import Shape from '../Shape.js'; +import Rectangle from '../../geometry/Rectangle.js'; +import CellState from '../../cell/CellState.js'; +import { + htmlEntities, + replaceTrailingNewlines, + trim, +} from '../../../util/StringUtils.js'; +import { isNode } from '../../../util/domUtils.js'; import { AlignValue, ColorValue, OverflowValue, TextDirectionValue, VAlignValue, -} from '../../../types'; -import SvgCanvas2D from '../../canvas/SvgCanvas2D'; -import { matchBinaryMask } from '../../../internal/utils'; +} from '../../../types.js'; +import SvgCanvas2D from '../../canvas/SvgCanvas2D.js'; +import { matchBinaryMask } from '../../../internal/utils.js'; /** * Extends {@link Shape} to implement a text shape. diff --git a/packages/core/src/view/shape/node/TriangleShape.ts b/packages/core/src/view/shape/node/TriangleShape.ts index 3d3c0528d3..27be6b35d6 100644 --- a/packages/core/src/view/shape/node/TriangleShape.ts +++ b/packages/core/src/view/shape/node/TriangleShape.ts @@ -16,10 +16,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Point from '../../geometry/Point'; -import ActorShape from './ActorShape'; -import { LINE_ARCSIZE } from '../../../util/Constants'; -import AbstractCanvas2D from '../../canvas/AbstractCanvas2D'; +import Point from '../../geometry/Point.js'; +import ActorShape from './ActorShape.js'; +import { LINE_ARCSIZE } from '../../../util/Constants.js'; +import AbstractCanvas2D from '../../canvas/AbstractCanvas2D.js'; /** * Implementation of the triangle shape. diff --git a/packages/core/src/view/shape/register-shapes.ts b/packages/core/src/view/shape/register-shapes.ts index 4612411a6e..f26cce4746 100644 --- a/packages/core/src/view/shape/register-shapes.ts +++ b/packages/core/src/view/shape/register-shapes.ts @@ -14,24 +14,24 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { ShapeRegistry } from './ShapeRegistry'; -import type { ShapeConstructor, ShapeValue } from '../../types'; -import RectangleShape from './node/RectangleShape'; -import EllipseShape from './node/EllipseShape'; -import RhombusShape from './node/RhombusShape'; -import CylinderShape from './node/CylinderShape'; -import ConnectorShape from './edge/ConnectorShape'; -import ActorShape from './node/ActorShape'; -import TriangleShape from './node/TriangleShape'; -import HexagonShape from './node/HexagonShape'; -import CloudShape from './node/CloudShape'; -import LineShape from './edge/LineShape'; -import ArrowShape from './edge/ArrowShape'; -import ArrowConnectorShape from './edge/ArrowConnectorShape'; -import DoubleEllipseShape from './node/DoubleEllipseShape'; -import SwimlaneShape from './node/SwimlaneShape'; -import ImageShape from './node/ImageShape'; -import LabelShape from './node/LabelShape'; +import { ShapeRegistry } from './ShapeRegistry.js'; +import type { ShapeConstructor, ShapeValue } from '../../types.js'; +import RectangleShape from './node/RectangleShape.js'; +import EllipseShape from './node/EllipseShape.js'; +import RhombusShape from './node/RhombusShape.js'; +import CylinderShape from './node/CylinderShape.js'; +import ConnectorShape from './edge/ConnectorShape.js'; +import ActorShape from './node/ActorShape.js'; +import TriangleShape from './node/TriangleShape.js'; +import HexagonShape from './node/HexagonShape.js'; +import CloudShape from './node/CloudShape.js'; +import LineShape from './edge/LineShape.js'; +import ArrowShape from './edge/ArrowShape.js'; +import ArrowConnectorShape from './edge/ArrowConnectorShape.js'; +import DoubleEllipseShape from './node/DoubleEllipseShape.js'; +import SwimlaneShape from './node/SwimlaneShape.js'; +import ImageShape from './node/ImageShape.js'; +import LabelShape from './node/LabelShape.js'; let isDefaultElementsRegistered = false; diff --git a/packages/core/src/view/shape/stencil/StencilShape.ts b/packages/core/src/view/shape/stencil/StencilShape.ts index 5808de37d3..37ac343c36 100644 --- a/packages/core/src/view/shape/stencil/StencilShape.ts +++ b/packages/core/src/view/shape/stencil/StencilShape.ts @@ -16,17 +16,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -import ConnectionConstraint from '../../other/ConnectionConstraint'; -import Rectangle from '../../geometry/Rectangle'; -import Shape from '../Shape'; -import { NONE, RECTANGLE_ROUNDING_FACTOR } from '../../../util/Constants'; -import { StencilShapeRegistry } from './StencilShapeRegistry'; -import { getChildNodes, getTextContent } from '../../../util/domUtils'; -import Point from '../../geometry/Point'; -import AbstractCanvas2D from '../../canvas/AbstractCanvas2D'; -import { AlignValue, ColorValue, VAlignValue } from '../../../types'; -import { doEval, isElement, isNullish } from '../../../internal/utils'; -import { translate } from '../../../internal/i18n-utils'; +import ConnectionConstraint from '../../other/ConnectionConstraint.js'; +import Rectangle from '../../geometry/Rectangle.js'; +import Shape from '../Shape.js'; +import { NONE, RECTANGLE_ROUNDING_FACTOR } from '../../../util/Constants.js'; +import { StencilShapeRegistry } from './StencilShapeRegistry.js'; +import { getChildNodes, getTextContent } from '../../../util/domUtils.js'; +import Point from '../../geometry/Point.js'; +import AbstractCanvas2D from '../../canvas/AbstractCanvas2D.js'; +import { AlignValue, ColorValue, VAlignValue } from '../../../types.js'; +import { doEval, isElement, isNullish } from '../../../internal/utils.js'; +import { translate } from '../../../internal/i18n-utils.js'; /** * Configure global settings for stencil shapes. diff --git a/packages/core/src/view/shape/stencil/StencilShapeRegistry.ts b/packages/core/src/view/shape/stencil/StencilShapeRegistry.ts index 1cd3afb22e..f323cc6710 100644 --- a/packages/core/src/view/shape/stencil/StencilShapeRegistry.ts +++ b/packages/core/src/view/shape/stencil/StencilShapeRegistry.ts @@ -16,9 +16,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type StencilShape from './StencilShape'; -import { BaseRegistry } from '../../../internal/BaseRegistry'; -import type { Registry } from '../../../types'; +import type StencilShape from './StencilShape.js'; +import { BaseRegistry } from '../../../internal/BaseRegistry.js'; +import type { Registry } from '../../../types.js'; /** * A registry that stores the {@link StencilShape}s and their configuration. diff --git a/packages/core/src/view/shape/stencil/register.ts b/packages/core/src/view/shape/stencil/register.ts index e7aa3b2ad2..e1ae3db18f 100644 --- a/packages/core/src/view/shape/stencil/register.ts +++ b/packages/core/src/view/shape/stencil/register.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { StencilShapeRegistry } from './StencilShapeRegistry'; +import { StencilShapeRegistry } from './StencilShapeRegistry.js'; /** * Unregister all {@link StencilShape}s from {@link StencilShapeRegistry}. diff --git a/packages/core/src/view/style/Stylesheet.ts b/packages/core/src/view/style/Stylesheet.ts index c020b553e5..ba38033e89 100644 --- a/packages/core/src/view/style/Stylesheet.ts +++ b/packages/core/src/view/style/Stylesheet.ts @@ -16,9 +16,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { NONE } from '../../util/Constants'; -import { clone } from '../../util/cloneUtils'; -import type { CellStateStyle, CellStyle } from '../../types'; +import { NONE } from '../../util/Constants.js'; +import { clone } from '../../util/cloneUtils.js'; +import type { CellStateStyle, CellStyle } from '../../types.js'; /** * Defines the appearance of the cells in a graph. See {@link putCellStyle} for an example diff --git a/packages/core/src/view/style/builtin-style-elements.ts b/packages/core/src/view/style/builtin-style-elements.ts index 3a3a39c1a6..67efc8e24e 100644 --- a/packages/core/src/view/style/builtin-style-elements.ts +++ b/packages/core/src/view/style/builtin-style-elements.ts @@ -19,14 +19,14 @@ limitations under the License. * * @category EdgeStyle */ -export * as EdgeStyle from './edge'; +export * as EdgeStyle from './edge/index.js'; /** * Provides various perimeter functions to be used in a style as the value of {@link CellStateStyle.perimeter}. * * @category Perimeter */ -export * as Perimeter from './perimeter'; +export * as Perimeter from './perimeter/index.js'; /** * Includes all builtins edge markers which can be registered in {@link EdgeMarkerRegistry}. @@ -36,4 +36,4 @@ export * as Perimeter from './perimeter'; * @since 0.18.0 * @category Style */ -export * as EdgeMarker from './marker/edge-markers'; +export * as EdgeMarker from './marker/edge-markers.js'; diff --git a/packages/core/src/view/style/config.ts b/packages/core/src/view/style/config.ts index e804880487..81094cbfbc 100644 --- a/packages/core/src/view/style/config.ts +++ b/packages/core/src/view/style/config.ts @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { ENTITY_SEGMENT } from '../../util/Constants'; -import { shallowCopy } from '../../internal/clone-utils'; -import type { DirectionValue } from '../../types'; +import { ENTITY_SEGMENT } from '../../util/Constants.js'; +import { shallowCopy } from '../../internal/clone-utils.js'; +import type { DirectionValue } from '../../types.js'; /** * Configure the {@link EntityRelation} connector. diff --git a/packages/core/src/view/style/edge/EdgeStyleRegistry.ts b/packages/core/src/view/style/edge/EdgeStyleRegistry.ts index d4d7eab450..8d2313882a 100644 --- a/packages/core/src/view/style/edge/EdgeStyleRegistry.ts +++ b/packages/core/src/view/style/edge/EdgeStyleRegistry.ts @@ -19,9 +19,9 @@ import type { EdgeStyleHandlerKind, EdgeStyleMetaData, EdgeStyleRegistryInterface, -} from '../../../types'; -import { isNullish } from '../../../internal/utils'; -import { BaseRegistry } from '../../../internal/BaseRegistry'; +} from '../../../types.js'; +import { isNullish } from '../../../internal/utils.js'; +import { BaseRegistry } from '../../../internal/BaseRegistry.js'; /** * @private diff --git a/packages/core/src/view/style/edge/Elbow.ts b/packages/core/src/view/style/edge/Elbow.ts index 98000afe2c..5add0ee8f2 100644 --- a/packages/core/src/view/style/edge/Elbow.ts +++ b/packages/core/src/view/style/edge/Elbow.ts @@ -16,12 +16,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { SideToSide } from './SideToSide'; -import { TopToBottom } from './TopToBottom'; -import CellState from '../../cell/CellState'; -import Point from '../../geometry/Point'; +import { SideToSide } from './SideToSide.js'; +import { TopToBottom } from './TopToBottom.js'; +import CellState from '../../cell/CellState.js'; +import Point from '../../geometry/Point.js'; -import type { EdgeStyleFunction } from '../../../types'; +import type { EdgeStyleFunction } from '../../../types.js'; /** * Uses either {@link SideToSide} or {@link TopToBottom} depending on the horizontal flag in the cell style. diff --git a/packages/core/src/view/style/edge/EntityRelation.ts b/packages/core/src/view/style/edge/EntityRelation.ts index fb9c960207..9276cd3f56 100644 --- a/packages/core/src/view/style/edge/EntityRelation.ts +++ b/packages/core/src/view/style/edge/EntityRelation.ts @@ -16,13 +16,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -import CellState from '../../cell/CellState'; -import Geometry from '../../geometry/Geometry'; -import Point from '../../geometry/Point'; -import { DIRECTION_MASK } from '../../../util/Constants'; -import { getPortConstraints } from '../../../util/mathUtils'; -import type { EdgeStyleFunction } from '../../../types'; -import { EntityRelationConnectorConfig } from '../config'; +import CellState from '../../cell/CellState.js'; +import Geometry from '../../geometry/Geometry.js'; +import Point from '../../geometry/Point.js'; +import { DIRECTION_MASK } from '../../../util/Constants.js'; +import { getPortConstraints } from '../../../util/mathUtils.js'; +import type { EdgeStyleFunction } from '../../../types.js'; +import { EntityRelationConnectorConfig } from '../config.js'; /** * Implements an entity relation style for edges (as used in database schema diagrams). diff --git a/packages/core/src/view/style/edge/Loop.ts b/packages/core/src/view/style/edge/Loop.ts index d333716dfb..d8b523159b 100644 --- a/packages/core/src/view/style/edge/Loop.ts +++ b/packages/core/src/view/style/edge/Loop.ts @@ -16,11 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import CellState from '../../cell/CellState'; -import Point from '../../geometry/Point'; -import { contains } from '../../../util/mathUtils'; +import CellState from '../../cell/CellState.js'; +import Point from '../../geometry/Point.js'; +import { contains } from '../../../util/mathUtils.js'; -import type { EdgeStyleFunction } from '../../../types'; +import type { EdgeStyleFunction } from '../../../types.js'; /** * Implements a self-reference, aka. loop. diff --git a/packages/core/src/view/style/edge/Manhattan.ts b/packages/core/src/view/style/edge/Manhattan.ts index fbb60eceb8..8affa89887 100644 --- a/packages/core/src/view/style/edge/Manhattan.ts +++ b/packages/core/src/view/style/edge/Manhattan.ts @@ -14,14 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type { DirectionValue, EdgeStyleFunction } from '../../../types'; -import type CellState from '../../cell/CellState'; -import Point from '../../geometry/Point'; -import Rectangle from '../../geometry/Rectangle'; -import { ManhattanConnectorConfig } from '../config'; -import Geometry from '../../geometry/Geometry'; -import { OrthogonalConnector } from './Orthogonal'; -import { SegmentConnector } from './Segment'; +import type { DirectionValue, EdgeStyleFunction } from '../../../types.js'; +import type CellState from '../../cell/CellState.js'; +import Point from '../../geometry/Point.js'; +import Rectangle from '../../geometry/Rectangle.js'; +import { ManhattanConnectorConfig } from '../config.js'; +import Geometry from '../../geometry/Geometry.js'; +import { OrthogonalConnector } from './Orthogonal.js'; +import { SegmentConnector } from './Segment.js'; /** * ManhattanConnector code is based on code from https://github.com/mwangm/mxgraph-manhattan-connector diff --git a/packages/core/src/view/style/edge/Orthogonal.ts b/packages/core/src/view/style/edge/Orthogonal.ts index 004e2c5ab8..b37f63c1c4 100644 --- a/packages/core/src/view/style/edge/Orthogonal.ts +++ b/packages/core/src/view/style/edge/Orthogonal.ts @@ -16,19 +16,19 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { scaleCellState, scalePointArray } from './shared'; -import { DEFAULT_MARKERSIZE, DIRECTION_MASK, NONE } from '../../../util/Constants'; +import { scaleCellState, scalePointArray } from './shared.js'; +import { DEFAULT_MARKERSIZE, DIRECTION_MASK, NONE } from '../../../util/Constants.js'; import { getBoundingBox, getPortConstraints, reversePortConstraints, -} from '../../../util/mathUtils'; -import type CellState from '../../cell/CellState'; -import { OrthogonalConnectorConfig } from '../config'; -import type { EdgeStyleFunction } from '../../../types'; -import Point from '../../geometry/Point'; -import Rectangle from '../../geometry/Rectangle'; -import { SegmentConnector } from './Segment'; +} from '../../../util/mathUtils.js'; +import type CellState from '../../cell/CellState.js'; +import { OrthogonalConnectorConfig } from '../config.js'; +import type { EdgeStyleFunction } from '../../../types.js'; +import Point from '../../geometry/Point.js'; +import Rectangle from '../../geometry/Rectangle.js'; +import { SegmentConnector } from './Segment.js'; const dirVectors = [ [-1, 0], diff --git a/packages/core/src/view/style/edge/Segment.ts b/packages/core/src/view/style/edge/Segment.ts index 6ec0fce8cb..334db42ee5 100644 --- a/packages/core/src/view/style/edge/Segment.ts +++ b/packages/core/src/view/style/edge/Segment.ts @@ -16,12 +16,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import CellState from '../../cell/CellState'; -import Point from '../../geometry/Point'; -import { contains } from '../../../util/mathUtils'; -import { scaleCellState, scalePointArray } from './shared'; +import CellState from '../../cell/CellState.js'; +import Point from '../../geometry/Point.js'; +import { contains } from '../../../util/mathUtils.js'; +import { scaleCellState, scalePointArray } from './shared.js'; -import type { EdgeStyleFunction } from '../../../types'; +import type { EdgeStyleFunction } from '../../../types.js'; /** * Implements an orthogonal edge style. diff --git a/packages/core/src/view/style/edge/SideToSide.ts b/packages/core/src/view/style/edge/SideToSide.ts index 0b5e76f8d2..cc04fb106f 100644 --- a/packages/core/src/view/style/edge/SideToSide.ts +++ b/packages/core/src/view/style/edge/SideToSide.ts @@ -16,11 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import CellState from '../../cell/CellState'; -import Point from '../../geometry/Point'; -import { contains } from '../../../util/mathUtils'; +import CellState from '../../cell/CellState.js'; +import Point from '../../geometry/Point.js'; +import { contains } from '../../../util/mathUtils.js'; -import type { EdgeStyleFunction } from '../../../types'; +import type { EdgeStyleFunction } from '../../../types.js'; /** * Implements a horizontal elbow edge. diff --git a/packages/core/src/view/style/edge/TopToBottom.ts b/packages/core/src/view/style/edge/TopToBottom.ts index 7f5e6ff659..2be3b29246 100644 --- a/packages/core/src/view/style/edge/TopToBottom.ts +++ b/packages/core/src/view/style/edge/TopToBottom.ts @@ -16,11 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import CellState from '../../cell/CellState'; -import Point from '../../geometry/Point'; -import { contains } from '../../../util/mathUtils'; +import CellState from '../../cell/CellState.js'; +import Point from '../../geometry/Point.js'; +import { contains } from '../../../util/mathUtils.js'; -import type { EdgeStyleFunction } from '../../../types'; +import type { EdgeStyleFunction } from '../../../types.js'; /** * Implements a vertical elbow edge. diff --git a/packages/core/src/view/style/edge/index.ts b/packages/core/src/view/style/edge/index.ts index dc82908fae..7e5b585d8a 100644 --- a/packages/core/src/view/style/edge/index.ts +++ b/packages/core/src/view/style/edge/index.ts @@ -16,11 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -export { ElbowConnector } from './Elbow'; -export { EntityRelation } from './EntityRelation'; -export { Loop } from './Loop'; -export { ManhattanConnector } from './Manhattan'; -export { OrthogonalConnector as OrthConnector } from './Orthogonal'; -export { SegmentConnector } from './Segment'; -export { SideToSide } from './SideToSide'; -export { TopToBottom } from './TopToBottom'; +export { ElbowConnector } from './Elbow.js'; +export { EntityRelation } from './EntityRelation.js'; +export { Loop } from './Loop.js'; +export { ManhattanConnector } from './Manhattan.js'; +export { OrthogonalConnector as OrthConnector } from './Orthogonal.js'; +export { SegmentConnector } from './Segment.js'; +export { SideToSide } from './SideToSide.js'; +export { TopToBottom } from './TopToBottom.js'; diff --git a/packages/core/src/view/style/edge/shared.ts b/packages/core/src/view/style/edge/shared.ts index 241c4f3bbc..28b26e147e 100644 --- a/packages/core/src/view/style/edge/shared.ts +++ b/packages/core/src/view/style/edge/shared.ts @@ -16,8 +16,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Point from '../../geometry/Point'; -import type CellState from '../../cell/CellState'; +import Point from '../../geometry/Point.js'; +import type CellState from '../../cell/CellState.js'; /** * Scales an array of {@link Point} diff --git a/packages/core/src/view/style/marker/EdgeMarkerRegistry.ts b/packages/core/src/view/style/marker/EdgeMarkerRegistry.ts index 3a80a15d8c..ddd79597e4 100644 --- a/packages/core/src/view/style/marker/EdgeMarkerRegistry.ts +++ b/packages/core/src/view/style/marker/EdgeMarkerRegistry.ts @@ -21,11 +21,11 @@ import type { MarkerFactoryFunction, MarkerFunction, StyleArrowValue, -} from '../../../types'; -import type AbstractCanvas2D from '../../canvas/AbstractCanvas2D'; -import type Point from '../../geometry/Point'; -import type Shape from '../../shape/Shape'; -import { BaseRegistry } from '../../../internal/BaseRegistry'; +} from '../../../types.js'; +import type AbstractCanvas2D from '../../canvas/AbstractCanvas2D.js'; +import type Point from '../../geometry/Point.js'; +import type Shape from '../../shape/Shape.js'; +import { BaseRegistry } from '../../../internal/BaseRegistry.js'; class EdgeMarkerRegistryImpl extends BaseRegistry diff --git a/packages/core/src/view/style/marker/edge-markers.ts b/packages/core/src/view/style/marker/edge-markers.ts index bc3f98150f..24eded7c39 100644 --- a/packages/core/src/view/style/marker/edge-markers.ts +++ b/packages/core/src/view/style/marker/edge-markers.ts @@ -16,10 +16,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type { StyleArrowValue } from '../../../types'; -import type AbstractCanvas2D from '../../canvas/AbstractCanvas2D'; -import type Shape from '../../shape/Shape'; -import type Point from '../../geometry/Point'; +import type { StyleArrowValue } from '../../../types.js'; +import type AbstractCanvas2D from '../../canvas/AbstractCanvas2D.js'; +import type Shape from '../../shape/Shape.js'; +import type Point from '../../geometry/Point.js'; const isClassicOrClassicThin = (type: StyleArrowValue): boolean => type === 'classic' || type === 'classicThin'; diff --git a/packages/core/src/view/style/perimeter/EllipsePerimeter.ts b/packages/core/src/view/style/perimeter/EllipsePerimeter.ts index cc2496ec4e..7b9623a240 100644 --- a/packages/core/src/view/style/perimeter/EllipsePerimeter.ts +++ b/packages/core/src/view/style/perimeter/EllipsePerimeter.ts @@ -16,10 +16,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Rectangle from '../../geometry/Rectangle'; -import type CellState from '../../cell/CellState'; -import Point from '../../geometry/Point'; -import type { PerimeterFunction } from '../../../types'; +import type Rectangle from '../../geometry/Rectangle.js'; +import type CellState from '../../cell/CellState.js'; +import Point from '../../geometry/Point.js'; +import type { PerimeterFunction } from '../../../types.js'; /** * This perimeter is registered under `ellipsePerimeter` in {@link PerimeterRegistry} when using {@link Graph} or calling {@link registerDefaultPerimeters}. diff --git a/packages/core/src/view/style/perimeter/HexagonPerimeter.ts b/packages/core/src/view/style/perimeter/HexagonPerimeter.ts index 672693b011..5a1e2e8955 100644 --- a/packages/core/src/view/style/perimeter/HexagonPerimeter.ts +++ b/packages/core/src/view/style/perimeter/HexagonPerimeter.ts @@ -16,11 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Rectangle from '../../geometry/Rectangle'; -import type CellState from '../../cell/CellState'; -import Point from '../../geometry/Point'; -import type { PerimeterFunction } from '../../../types'; -import { intersection } from '../../../util/mathUtils'; +import type Rectangle from '../../geometry/Rectangle.js'; +import type CellState from '../../cell/CellState.js'; +import Point from '../../geometry/Point.js'; +import type { PerimeterFunction } from '../../../types.js'; +import { intersection } from '../../../util/mathUtils.js'; /** * This perimeter is registered under `hexagonPerimeter` in {@link PerimeterRegistry} when using {@link Graph} or calling {@link registerDefaultPerimeters}. diff --git a/packages/core/src/view/style/perimeter/PerimeterRegistry.ts b/packages/core/src/view/style/perimeter/PerimeterRegistry.ts index be22000989..20921c84f1 100644 --- a/packages/core/src/view/style/perimeter/PerimeterRegistry.ts +++ b/packages/core/src/view/style/perimeter/PerimeterRegistry.ts @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { BaseRegistry } from '../../../internal/BaseRegistry'; -import type { PerimeterFunction, Registry } from '../../../types'; +import { BaseRegistry } from '../../../internal/BaseRegistry.js'; +import type { PerimeterFunction, Registry } from '../../../types.js'; /** * A registry that stores the {@link PerimeterFunction}s. diff --git a/packages/core/src/view/style/perimeter/RectanglePerimeter.ts b/packages/core/src/view/style/perimeter/RectanglePerimeter.ts index ca197b2005..4024862b23 100644 --- a/packages/core/src/view/style/perimeter/RectanglePerimeter.ts +++ b/packages/core/src/view/style/perimeter/RectanglePerimeter.ts @@ -16,10 +16,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Rectangle from '../../geometry/Rectangle'; -import type CellState from '../../cell/CellState'; -import Point from '../../geometry/Point'; -import type { PerimeterFunction } from '../../../types'; +import type Rectangle from '../../geometry/Rectangle.js'; +import type CellState from '../../cell/CellState.js'; +import Point from '../../geometry/Point.js'; +import type { PerimeterFunction } from '../../../types.js'; /** * Describes a rectangular perimeter for the given bounds. diff --git a/packages/core/src/view/style/perimeter/RhombusPerimeter.ts b/packages/core/src/view/style/perimeter/RhombusPerimeter.ts index fbda2b6c3f..de33709a13 100644 --- a/packages/core/src/view/style/perimeter/RhombusPerimeter.ts +++ b/packages/core/src/view/style/perimeter/RhombusPerimeter.ts @@ -16,11 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Rectangle from '../../geometry/Rectangle'; -import type CellState from '../../cell/CellState'; -import Point from '../../geometry/Point'; -import type { PerimeterFunction } from '../../../types'; -import { intersection } from '../../../util/mathUtils'; +import type Rectangle from '../../geometry/Rectangle.js'; +import type CellState from '../../cell/CellState.js'; +import Point from '../../geometry/Point.js'; +import type { PerimeterFunction } from '../../../types.js'; +import { intersection } from '../../../util/mathUtils.js'; /** * This perimeter is registered under `rhombusPerimeter` in {@link PerimeterRegistry} when using {@link Graph} or calling {@link registerDefaultPerimeters}. diff --git a/packages/core/src/view/style/perimeter/TrianglePerimeter.ts b/packages/core/src/view/style/perimeter/TrianglePerimeter.ts index 4a0452b3e0..29a41566be 100644 --- a/packages/core/src/view/style/perimeter/TrianglePerimeter.ts +++ b/packages/core/src/view/style/perimeter/TrianglePerimeter.ts @@ -16,11 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type Rectangle from '../../geometry/Rectangle'; -import type CellState from '../../cell/CellState'; -import Point from '../../geometry/Point'; -import type { PerimeterFunction } from '../../../types'; -import { intersection } from '../../../util/mathUtils'; +import type Rectangle from '../../geometry/Rectangle.js'; +import type CellState from '../../cell/CellState.js'; +import Point from '../../geometry/Point.js'; +import type { PerimeterFunction } from '../../../types.js'; +import { intersection } from '../../../util/mathUtils.js'; /** * This perimeter is registered under `trianglePerimeter` in {@link PerimeterRegistry} when using {@link Graph} or calling {@link registerDefaultPerimeters}. diff --git a/packages/core/src/view/style/perimeter/index.ts b/packages/core/src/view/style/perimeter/index.ts index d2ec4f3e61..04873d819d 100644 --- a/packages/core/src/view/style/perimeter/index.ts +++ b/packages/core/src/view/style/perimeter/index.ts @@ -16,8 +16,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -export { EllipsePerimeter } from './EllipsePerimeter'; -export { HexagonPerimeter } from './HexagonPerimeter'; -export { RectanglePerimeter } from './RectanglePerimeter'; -export { RhombusPerimeter } from './RhombusPerimeter'; -export { TrianglePerimeter } from './TrianglePerimeter'; +export { EllipsePerimeter } from './EllipsePerimeter.js'; +export { HexagonPerimeter } from './HexagonPerimeter.js'; +export { RectanglePerimeter } from './RectanglePerimeter.js'; +export { RhombusPerimeter } from './RhombusPerimeter.js'; +export { TrianglePerimeter } from './TrianglePerimeter.js'; diff --git a/packages/core/src/view/style/register.ts b/packages/core/src/view/style/register.ts index f704c6f6e0..ecf212f82b 100644 --- a/packages/core/src/view/style/register.ts +++ b/packages/core/src/view/style/register.ts @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { EdgeStyle, EdgeMarker, Perimeter } from './builtin-style-elements'; -import { EdgeStyleRegistry } from './edge/EdgeStyleRegistry'; -import { EdgeMarkerRegistry } from './marker/EdgeMarkerRegistry'; -import { PerimeterRegistry } from './perimeter/PerimeterRegistry'; +import { EdgeStyle, EdgeMarker, Perimeter } from './builtin-style-elements.js'; +import { EdgeStyleRegistry } from './edge/EdgeStyleRegistry.js'; +import { EdgeMarkerRegistry } from './marker/EdgeMarkerRegistry.js'; +import { PerimeterRegistry } from './perimeter/PerimeterRegistry.js'; import type { ArrowValue, EdgeStyleFunction, @@ -26,7 +26,7 @@ import type { MarkerFactoryFunction, PerimeterFunction, PerimeterValue, -} from '../../types'; +} from '../../types.js'; let isDefaultEdgeStylesRegistered = false; diff --git a/packages/core/src/view/undoable_changes/CellAttributeChange.ts b/packages/core/src/view/undoable_changes/CellAttributeChange.ts index 606cb0cc75..25789e4f6c 100644 --- a/packages/core/src/view/undoable_changes/CellAttributeChange.ts +++ b/packages/core/src/view/undoable_changes/CellAttributeChange.ts @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { isNullish } from '../../internal/utils'; -import Cell from '../cell/Cell'; -import type { UndoableChange } from '../../types'; +import { isNullish } from '../../internal/utils.js'; +import Cell from '../cell/Cell.js'; +import type { UndoableChange } from '../../types.js'; /** * Action to change the attribute of a cell's user object. diff --git a/packages/core/src/view/undoable_changes/ChildChange.ts b/packages/core/src/view/undoable_changes/ChildChange.ts index 07d287e9e9..40efcbd0af 100644 --- a/packages/core/src/view/undoable_changes/ChildChange.ts +++ b/packages/core/src/view/undoable_changes/ChildChange.ts @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import GraphDataModel from '../GraphDataModel'; -import Cell from '../cell/Cell'; +import GraphDataModel from '../GraphDataModel.js'; +import Cell from '../cell/Cell.js'; -import type { UndoableChange } from '../../types'; +import type { UndoableChange } from '../../types.js'; /** * Action to add or remove a child in a model. diff --git a/packages/core/src/view/undoable_changes/CollapseChange.ts b/packages/core/src/view/undoable_changes/CollapseChange.ts index 3b216ef79f..6cdeaa9493 100644 --- a/packages/core/src/view/undoable_changes/CollapseChange.ts +++ b/packages/core/src/view/undoable_changes/CollapseChange.ts @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Cell from '../cell/Cell'; -import GraphDataModel from '../GraphDataModel'; +import Cell from '../cell/Cell.js'; +import GraphDataModel from '../GraphDataModel.js'; -import type { UndoableChange } from '../../types'; +import type { UndoableChange } from '../../types.js'; /** * Action to change a cell's collapsed state in a model. diff --git a/packages/core/src/view/undoable_changes/CurrentRootChange.ts b/packages/core/src/view/undoable_changes/CurrentRootChange.ts index c173a7dbef..2f5bb46594 100644 --- a/packages/core/src/view/undoable_changes/CurrentRootChange.ts +++ b/packages/core/src/view/undoable_changes/CurrentRootChange.ts @@ -14,12 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type GraphView from '../GraphView'; -import EventObject from '../event/EventObject'; -import Point from '../geometry/Point'; -import type Cell from '../cell/Cell'; -import InternalEvent from '../event/InternalEvent'; -import type { UndoableChange } from '../../types'; +import type GraphView from '../GraphView.js'; +import EventObject from '../event/EventObject.js'; +import Point from '../geometry/Point.js'; +import type Cell from '../cell/Cell.js'; +import InternalEvent from '../event/InternalEvent.js'; +import type { UndoableChange } from '../../types.js'; /** * Action to change the current root in a view. diff --git a/packages/core/src/view/undoable_changes/GeometryChange.ts b/packages/core/src/view/undoable_changes/GeometryChange.ts index cb676e9e83..444b7b5562 100644 --- a/packages/core/src/view/undoable_changes/GeometryChange.ts +++ b/packages/core/src/view/undoable_changes/GeometryChange.ts @@ -14,11 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Geometry from '../geometry/Geometry'; -import Cell from '../cell/Cell'; -import GraphDataModel from '../GraphDataModel'; +import Geometry from '../geometry/Geometry.js'; +import Cell from '../cell/Cell.js'; +import GraphDataModel from '../GraphDataModel.js'; -import type { UndoableChange } from '../../types'; +import type { UndoableChange } from '../../types.js'; /** * Action to change a cell's geometry in a model. diff --git a/packages/core/src/view/undoable_changes/RootChange.ts b/packages/core/src/view/undoable_changes/RootChange.ts index a3930f8192..084132a26c 100644 --- a/packages/core/src/view/undoable_changes/RootChange.ts +++ b/packages/core/src/view/undoable_changes/RootChange.ts @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Cell from '../cell/Cell'; -import GraphDataModel from '../GraphDataModel'; +import Cell from '../cell/Cell.js'; +import GraphDataModel from '../GraphDataModel.js'; -import type { UndoableChange } from '../../types'; +import type { UndoableChange } from '../../types.js'; /** * Action to change the root in a model. diff --git a/packages/core/src/view/undoable_changes/SelectionChange.ts b/packages/core/src/view/undoable_changes/SelectionChange.ts index e948d2d2a3..e888e3a185 100644 --- a/packages/core/src/view/undoable_changes/SelectionChange.ts +++ b/packages/core/src/view/undoable_changes/SelectionChange.ts @@ -14,12 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import EventObject from '../event/EventObject'; -import InternalEvent from '../event/InternalEvent'; +import EventObject from '../event/EventObject.js'; +import InternalEvent from '../event/InternalEvent.js'; -import type { UndoableChange } from '../../types'; -import { AbstractGraph } from '../AbstractGraph'; -import Cell from '../cell/Cell'; +import type { UndoableChange } from '../../types.js'; +import { AbstractGraph } from '../AbstractGraph.js'; +import Cell from '../cell/Cell.js'; /** * Action to change the current root in a view. diff --git a/packages/core/src/view/undoable_changes/StyleChange.ts b/packages/core/src/view/undoable_changes/StyleChange.ts index 7d1a127922..dd9730e135 100644 --- a/packages/core/src/view/undoable_changes/StyleChange.ts +++ b/packages/core/src/view/undoable_changes/StyleChange.ts @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Cell from '../cell/Cell'; -import GraphDataModel from '../GraphDataModel'; +import Cell from '../cell/Cell.js'; +import GraphDataModel from '../GraphDataModel.js'; -import type { CellStyle, UndoableChange } from '../../types'; +import type { CellStyle, UndoableChange } from '../../types.js'; /** * Action to change a cell's style in a model. diff --git a/packages/core/src/view/undoable_changes/TerminalChange.ts b/packages/core/src/view/undoable_changes/TerminalChange.ts index 74f7793fea..96c0e546a2 100644 --- a/packages/core/src/view/undoable_changes/TerminalChange.ts +++ b/packages/core/src/view/undoable_changes/TerminalChange.ts @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Cell from '../cell/Cell'; -import GraphDataModel from '../GraphDataModel'; +import Cell from '../cell/Cell.js'; +import GraphDataModel from '../GraphDataModel.js'; -import type { UndoableChange } from '../../types'; +import type { UndoableChange } from '../../types.js'; /** * Action to change a terminal in a model. diff --git a/packages/core/src/view/undoable_changes/UndoManager.ts b/packages/core/src/view/undoable_changes/UndoManager.ts index aaf49bb0d9..f468d7c7d3 100644 --- a/packages/core/src/view/undoable_changes/UndoManager.ts +++ b/packages/core/src/view/undoable_changes/UndoManager.ts @@ -16,10 +16,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import InternalEvent from '../event/InternalEvent'; -import EventObject from '../event/EventObject'; -import EventSource from '../event/EventSource'; -import UndoableEdit from './UndoableEdit'; +import InternalEvent from '../event/InternalEvent.js'; +import EventObject from '../event/EventObject.js'; +import EventSource from '../event/EventSource.js'; +import UndoableEdit from './UndoableEdit.js'; /** * @class UndoManager diff --git a/packages/core/src/view/undoable_changes/UndoableEdit.ts b/packages/core/src/view/undoable_changes/UndoableEdit.ts index bf6e358dea..1a7d572d00 100644 --- a/packages/core/src/view/undoable_changes/UndoableEdit.ts +++ b/packages/core/src/view/undoable_changes/UndoableEdit.ts @@ -16,11 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import InternalEvent from '../event/InternalEvent'; -import EventObject from '../event/EventObject'; -import EventSource from '../event/EventSource'; +import InternalEvent from '../event/InternalEvent.js'; +import EventObject from '../event/EventObject.js'; +import EventSource from '../event/EventSource.js'; -import type { UndoableChange } from '../../types'; +import type { UndoableChange } from '../../types.js'; /** * Implements a composite undoable edit. Here is an example for a custom change diff --git a/packages/core/src/view/undoable_changes/ValueChange.ts b/packages/core/src/view/undoable_changes/ValueChange.ts index db22ffd89a..e8db282baf 100644 --- a/packages/core/src/view/undoable_changes/ValueChange.ts +++ b/packages/core/src/view/undoable_changes/ValueChange.ts @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Cell from '../cell/Cell'; -import GraphDataModel from '../GraphDataModel'; +import Cell from '../cell/Cell.js'; +import GraphDataModel from '../GraphDataModel.js'; -import type { UndoableChange } from '../../types'; +import type { UndoableChange } from '../../types.js'; /** * Action to change a user object in a model. diff --git a/packages/core/src/view/undoable_changes/VisibleChange.ts b/packages/core/src/view/undoable_changes/VisibleChange.ts index f6e89639c0..ca05cc0af0 100644 --- a/packages/core/src/view/undoable_changes/VisibleChange.ts +++ b/packages/core/src/view/undoable_changes/VisibleChange.ts @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Cell from '../cell/Cell'; -import GraphDataModel from '../GraphDataModel'; +import Cell from '../cell/Cell.js'; +import GraphDataModel from '../GraphDataModel.js'; -import type { UndoableChange } from '../../types'; +import type { UndoableChange } from '../../types.js'; /** * Action to change a cell's visible state in a model. diff --git a/packages/js-example-nodejs/README.md b/packages/js-example-nodejs/README.md index fdcc33a49b..73415dac75 100644 --- a/packages/js-example-nodejs/README.md +++ b/packages/js-example-nodejs/README.md @@ -6,12 +6,8 @@ In this example, `jsdom` is used to provide an implementation of the browser obj These objects are not provided by Node.js. The example provides a script using CommonJS and another one using ESM. - -The CommonJS example creates a Graph, exports its model to an XML file and to an SVG file. - -**IMPORTANT**: the ESM script is currently not working because `maxGraph` doesn't yet provide ESM compatibility for Node.js. -This will be implemented in the future with [#827](https://github.com/maxGraph/maxGraph/issues/827). - +- Contents: creates a Graph, exports its model to an XML file and to an SVG file. +- They use same shared code to perform the operations. ## Setup diff --git a/packages/js-example-nodejs/package.json b/packages/js-example-nodejs/package.json index 9509b4cf55..a58f915362 100644 --- a/packages/js-example-nodejs/package.json +++ b/packages/js-example-nodejs/package.json @@ -4,7 +4,7 @@ "private": true, "type": "commonjs", "scripts": { - "build": "run-s build:cjs", + "build": "run-s build:*", "build:esm": "node src/index.mjs", "build:cjs": "node src/index.cjs" }, diff --git a/packages/js-example-nodejs/src/_shared.js b/packages/js-example-nodejs/src/_shared.js new file mode 100644 index 0000000000..03272547a7 --- /dev/null +++ b/packages/js-example-nodejs/src/_shared.js @@ -0,0 +1,111 @@ +/* +Copyright 2025-present The maxGraph project Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +require('jsdom-global')(); // This is needed to create a DOM environment for Node.js +const fs = require('node:fs'); +const { constants, Graph, ModelXmlSerializer, Rectangle } = require('@maxgraph/core'); + +function createGraphAndExport(moduleType, outputDirectoryName) { + const graph = new Graph(); + // Adds cells to the model in a single step + graph.batchUpdate(() => { + const vertex01 = graph.insertVertex({ + position: [10, 10], + size: [100, 100], + value: 'rectangle', + }); + const vertex02 = graph.insertVertex({ + position: [350, 90], + size: [50, 50], + style: { + fillColor: 'orange', + shape: 'ellipse', + verticalAlign: 'top', + verticalLabelPosition: 'bottom', + }, + value: 'ellipse', + }); + graph.insertEdge({ + source: vertex01, + target: vertex02, + value: 'edge', + style: { + edgeStyle: 'orthogonalEdgeStyle', + rounded: true, + }, + }); + }); + + const generationDate = + new Date().toISOString().replace(/T/, ' ').replace(/\..+/, '') + ' UTC'; + + const xmlFileHeader = ` +`; + + console.info('Exporting maxGraph model...'); + const modelAsXml = new ModelXmlSerializer(graph.getDataModel()).export(); + const xml = `${xmlFileHeader} +${modelAsXml}`; + + // create the build directory if it doesn't exist + const outputDirectory = `build/${outputDirectoryName}`; + if (!fs.existsSync(outputDirectory)) { + fs.mkdirSync(outputDirectory, { recursive: true }); + } + fs.writeFileSync(`${outputDirectory}/graph.xml`, xml, 'utf8'); + + console.info('Export done.'); + + /** + * This exporter only works when not using `htmlLabels` i.e. the labels are rendered as HTML markup. + * `htmlLabels` are rendered with foreignObject elements in the SVG including HTML that correctly display the labels when the SVG is included in the HTML page. + * + * See {@link Graph.htmlLabels}. + */ + class SimpleSvgExporter { + constructor(graph) { + this.graph = graph; + } + + export(options) { + const margin = options?.margin ?? 10; + const graphBounds = this.graph.getGraphBounds(); + const bounds = new Rectangle( + graphBounds.x - margin, + graphBounds.y - margin, + graphBounds.width + 2 * margin, + graphBounds.height + 2 * margin + ); + + // we are sure that we have an SVG node here, it is always created at Graph creation + // Notice that for now, the SVG is not pretty printed, so it is not indented + const svgNode = this.graph.container.querySelector('svg'); + return `${xmlFileHeader} + + +${svgNode.innerHTML} +`; + } + } + + console.info('Exporting SVG...'); + const svg = new SimpleSvgExporter(graph).export(); + fs.writeFileSync(`${outputDirectory}/graph.svg`, svg, 'utf8'); + console.info('Export done.'); +} + +exports.createGraphAndExport = createGraphAndExport; diff --git a/packages/js-example-nodejs/src/index.cjs b/packages/js-example-nodejs/src/index.cjs index 4c675cbe4a..865de0084b 100644 --- a/packages/js-example-nodejs/src/index.cjs +++ b/packages/js-example-nodejs/src/index.cjs @@ -14,95 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -require('jsdom-global')(); // This is needed to create a DOM environment for Node.js -const fs = require('node:fs'); -const { constants, Graph, ModelXmlSerializer, Rectangle } = require('@maxgraph/core'); +const { createGraphAndExport } = require('./_shared'); console.info('maxGraph example with Node.js using CommonJS'); - -const graph = new Graph(); -// Adds cells to the model in a single step -graph.batchUpdate(() => { - const vertex01 = graph.insertVertex({ - position: [10, 10], - size: [100, 100], - value: 'rectangle', - }); - const vertex02 = graph.insertVertex({ - position: [350, 90], - size: [50, 50], - style: { - fillColor: 'orange', - shape: 'ellipse', - verticalAlign: 'top', - verticalLabelPosition: 'bottom', - }, - value: 'ellipse', - }); - graph.insertEdge({ - source: vertex01, - target: vertex02, - value: 'edge', - style: { - edgeStyle: 'orthogonalEdgeStyle', - rounded: true, - }, - }); -}); - -const generationDate = - new Date().toISOString().replace(/T/, ' ').replace(/\..+/, '') + ' UTC'; - -const xmlFileHeader = ` -`; - -console.info('Exporting maxGraph model...'); -const modelAsXml = new ModelXmlSerializer(graph.getDataModel()).export(); -const xml = `${xmlFileHeader} -${modelAsXml}`; - -// create the build directory if it doesn't exist -const outputDirectory = 'build/cjs'; -if (!fs.existsSync(outputDirectory)) { - fs.mkdirSync(outputDirectory, { recursive: true }); -} -fs.writeFileSync(`${outputDirectory}/graph.xml`, xml, 'utf8'); - -console.info('Export done.'); - -/** - * This exporter only works when not using `htmlLabels` i.e. the labels are rendered as HTML markup. - * `htmlLabels` are rendered with foreignObject elements in the SVG including HTML that correctly display the labels when the SVG is included in the HTML page. - * - * See {@link Graph.htmlLabels}. - */ -class SimpleSvgExporter { - constructor(graph) { - this.graph = graph; - } - - export(options) { - const margin = options?.margin ?? 10; - const graphBounds = this.graph.getGraphBounds(); - const bounds = new Rectangle( - graphBounds.x - margin, - graphBounds.y - margin, - graphBounds.width + 2 * margin, - graphBounds.height + 2 * margin - ); - - // we are sure that we have an SVG node here, it is always created at Graph creation - const svgNode = this.graph.container.querySelector('svg'); - return `${xmlFileHeader} - - -${svgNode.innerHTML} -`; - } -} - -console.info('Exporting SVG...'); -const svg = new SimpleSvgExporter(graph).export(); -fs.writeFileSync(`${outputDirectory}/graph.svg`, svg, 'utf8'); -console.info('Export done.'); +createGraphAndExport('CommonJS', 'cjs'); diff --git a/packages/js-example-nodejs/src/index.mjs b/packages/js-example-nodejs/src/index.mjs index a8f3e4be78..148ad84a2d 100644 --- a/packages/js-example-nodejs/src/index.mjs +++ b/packages/js-example-nodejs/src/index.mjs @@ -14,10 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This fails because the import statements in the files of the maxGraph package doesn't add the "js" file extension -// Node.js requires such extensions. This should be fixed when implementing https://github.com/maxGraph/maxGraph/issues/827 -import { BaseGraph } from '@maxgraph/core'; +// This is needed to create a DOM environment for Node.js, required when importing from maxGraph ESM +// Must be placed before importing any maxGraph code +import 'jsdom-global/register.js'; +// import directly from ESM to ensure everything works. See https://github.com/maxGraph/maxGraph/issues/827 +// the shared code in the _shared.js file is CommonJS, so it is not able to detect errors in the ESM code +import { constants } from '@maxgraph/core'; +import { createGraphAndExport } from './_shared.js'; -console.info('maxGraph example with Node.js using ESM'); - -const graph = new BaseGraph(); +console.info(`maxGraph example with Node.js using ESM of maxGraph ${constants.VERSION}`); +createGraphAndExport('ESM', 'esm'); diff --git a/packages/js-example-selected-features/webpack.config.js b/packages/js-example-selected-features/webpack.config.js index 30d9ddeddc..4731dbffe9 100644 --- a/packages/js-example-selected-features/webpack.config.js +++ b/packages/js-example-selected-features/webpack.config.js @@ -24,14 +24,6 @@ module.exports = { test: /\.css$/i, use: [isDevMode ? 'style-loader' : MiniCssExtractPlugin.loader, 'css-loader'], }, - // @maxgraph/core is a dependency of this project but don't declare imports with js extension - // use this workaround to make webpack happy: https://github.com/webpack/webpack/issues/11467#issuecomment-691873586 - { - test: /\.m?js/, - resolve: { - fullySpecified: false, - }, - }, ], }, plugins: [ diff --git a/packages/js-example-without-defaults/webpack.config.js b/packages/js-example-without-defaults/webpack.config.js index 30d9ddeddc..4731dbffe9 100644 --- a/packages/js-example-without-defaults/webpack.config.js +++ b/packages/js-example-without-defaults/webpack.config.js @@ -24,14 +24,6 @@ module.exports = { test: /\.css$/i, use: [isDevMode ? 'style-loader' : MiniCssExtractPlugin.loader, 'css-loader'], }, - // @maxgraph/core is a dependency of this project but don't declare imports with js extension - // use this workaround to make webpack happy: https://github.com/webpack/webpack/issues/11467#issuecomment-691873586 - { - test: /\.m?js/, - resolve: { - fullySpecified: false, - }, - }, ], }, plugins: [ diff --git a/packages/js-example/webpack.config.js b/packages/js-example/webpack.config.js index 30d9ddeddc..4731dbffe9 100644 --- a/packages/js-example/webpack.config.js +++ b/packages/js-example/webpack.config.js @@ -24,14 +24,6 @@ module.exports = { test: /\.css$/i, use: [isDevMode ? 'style-loader' : MiniCssExtractPlugin.loader, 'css-loader'], }, - // @maxgraph/core is a dependency of this project but don't declare imports with js extension - // use this workaround to make webpack happy: https://github.com/webpack/webpack/issues/11467#issuecomment-691873586 - { - test: /\.m?js/, - resolve: { - fullySpecified: false, - }, - }, ], }, plugins: [