From 6a322e9217ed8fa71062bbbc610378d67b0ac0ae Mon Sep 17 00:00:00 2001 From: Quorafind Date: Thu, 7 Sep 2023 16:51:16 +0800 Subject: [PATCH] feat: support save current settings --- manifest.json | 2 +- pnpm-lock.yaml | 836 ++++++++++++++++++++++++++++++++++------ src/floatSearchIndex.ts | 402 ++++++++++--------- 3 files changed, 936 insertions(+), 304 deletions(-) diff --git a/manifest.json b/manifest.json index 82f1bd9..703ebac 100644 --- a/manifest.json +++ b/manifest.json @@ -12,4 +12,4 @@ "支付宝": "https://cdn.jsdelivr.net/gh/Quorafind/.github@main/IMAGE/%E6%94%AF%E4%BB%98%E5%AE%9D%E4%BB%98%E6%AC%BE%E7%A0%81.jpg" }, "isDesktopOnly": false -} +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1dfb892..74dc5a6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,32 +1,117 @@ -lockfileVersion: 5.4 +lockfileVersion: '6.0' -specifiers: - '@types/node': ^16.11.6 - '@typescript-eslint/eslint-plugin': 5.29.0 - '@typescript-eslint/parser': 5.29.0 - builtin-modules: 3.3.0 - esbuild: 0.14.47 - monkey-around: ^2.3.0 - obsidian: latest - tslib: 2.4.0 - typescript: 4.7.4 +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false dependencies: - monkey-around: 2.3.0 + monkey-around: + specifier: ^2.3.0 + version: 2.3.0 devDependencies: - '@types/node': 16.18.13 - '@typescript-eslint/eslint-plugin': 5.29.0_treee22277sh3yq6pnqeflwlmi - '@typescript-eslint/parser': 5.29.0_typescript@4.7.4 - builtin-modules: 3.3.0 - esbuild: 0.14.47 - obsidian: 1.1.1 - tslib: 2.4.0 - typescript: 4.7.4 + '@types/node': + specifier: ^16.11.6 + version: 16.18.13 + '@typescript-eslint/eslint-plugin': + specifier: 5.29.0 + version: 5.29.0(@typescript-eslint/parser@5.29.0)(eslint@8.48.0)(typescript@4.7.4) + '@typescript-eslint/parser': + specifier: 5.29.0 + version: 5.29.0(eslint@8.48.0)(typescript@4.7.4) + builtin-modules: + specifier: 3.3.0 + version: 3.3.0 + esbuild: + specifier: 0.14.47 + version: 0.14.47 + obsidian: + specifier: latest + version: 1.4.4(@codemirror/state@6.2.1)(@codemirror/view@6.18.0) + tslib: + specifier: 2.4.0 + version: 2.4.0 + typescript: + specifier: 4.7.4 + version: 4.7.4 packages: - /@nodelib/fs.scandir/2.1.5: + /@aashutoshrathi/word-wrap@1.2.6: + resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} + engines: {node: '>=0.10.0'} + dev: true + + /@codemirror/state@6.2.1: + resolution: {integrity: sha512-RupHSZ8+OjNT38zU9fKH2sv+Dnlr8Eb8sl4NOnnqz95mCFTZUaiRP8Xv5MeeaG0px2b8Bnfe7YGwCV3nsBhbuw==} + dev: true + + /@codemirror/view@6.18.0: + resolution: {integrity: sha512-T6q1yYAoU+gSWfJFR4ryvDQcyOqS+Mw5RCvh26y0KiNksOOLYhNvdB3BTyLz8vy4fKaYlzbAOyBU7OQPUGHzjQ==} + dependencies: + '@codemirror/state': 6.2.1 + style-mod: 4.1.0 + w3c-keyname: 2.2.8 + dev: true + + /@eslint-community/eslint-utils@4.4.0(eslint@8.48.0): + resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + dependencies: + eslint: 8.48.0 + eslint-visitor-keys: 3.4.3 + dev: true + + /@eslint-community/regexpp@4.8.0: + resolution: {integrity: sha512-JylOEEzDiOryeUnFbQz+oViCXS0KsvR1mvHkoMiu5+UiBvy+RYX7tzlIIIEstF/gVa2tj9AQXk3dgnxv6KxhFg==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + dev: true + + /@eslint/eslintrc@2.1.2: + resolution: {integrity: sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + ajv: 6.12.6 + debug: 4.3.4 + espree: 9.6.1 + globals: 13.21.0 + ignore: 5.2.4 + import-fresh: 3.3.0 + js-yaml: 4.1.0 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + dev: true + + /@eslint/js@8.48.0: + resolution: {integrity: sha512-ZSjtmelB7IJfWD2Fvb7+Z+ChTIKWq6kjda95fLcQKNS5aheVHn4IkfgRQE3sIIzTcSLwLcLZUD9UBt+V7+h+Pw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + + /@humanwhocodes/config-array@0.11.11: + resolution: {integrity: sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==} + engines: {node: '>=10.10.0'} + dependencies: + '@humanwhocodes/object-schema': 1.2.1 + debug: 4.3.4 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@humanwhocodes/module-importer@1.0.1: + resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} + engines: {node: '>=12.22'} + dev: true + + /@humanwhocodes/object-schema@1.2.1: + resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} + dev: true + + /@nodelib/fs.scandir@2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} dependencies: @@ -34,12 +119,12 @@ packages: run-parallel: 1.2.0 dev: true - /@nodelib/fs.stat/2.0.5: + /@nodelib/fs.stat@2.0.5: resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} engines: {node: '>= 8'} dev: true - /@nodelib/fs.walk/1.2.8: + /@nodelib/fs.walk@1.2.8: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} dependencies: @@ -47,31 +132,31 @@ packages: fastq: 1.15.0 dev: true - /@types/codemirror/0.0.108: - resolution: {integrity: sha512-3FGFcus0P7C2UOGCNUVENqObEb4SFk+S8Dnxq7K6aIsLVs/vDtlangl3PEO0ykaKXyK56swVF6Nho7VsA44uhw==} + /@types/codemirror@5.60.8: + resolution: {integrity: sha512-VjFgDF/eB+Aklcy15TtOTLQeMjTo07k7KAjql8OK5Dirr7a6sJY4T1uVBDuTVG9VEmn1uUsohOpYnVfgC6/jyw==} dependencies: '@types/tern': 0.23.4 dev: true - /@types/estree/1.0.0: + /@types/estree@1.0.0: resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==} dev: true - /@types/json-schema/7.0.11: + /@types/json-schema@7.0.11: resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==} dev: true - /@types/node/16.18.13: + /@types/node@16.18.13: resolution: {integrity: sha512-l0/3XZ153UTlNOnZK8xSNoJlQda9/WnYgiTdcKKPJSZjdjI9MU+A9oMXOesAWLSnqAaaJhj3qfQsU07Dr8OUwg==} dev: true - /@types/tern/0.23.4: + /@types/tern@0.23.4: resolution: {integrity: sha512-JAUw1iXGO1qaWwEOzxTKJZ/5JxVeON9kvGZ/osgZaJImBnyjyn0cjovPsf6FNLmyGY8Vw9DoXZCMlfMkMwHRWg==} dependencies: '@types/estree': 1.0.0 dev: true - /@typescript-eslint/eslint-plugin/5.29.0_treee22277sh3yq6pnqeflwlmi: + /@typescript-eslint/eslint-plugin@5.29.0(@typescript-eslint/parser@5.29.0)(eslint@8.48.0)(typescript@4.7.4): resolution: {integrity: sha512-kgTsISt9pM53yRFQmLZ4npj99yGl3x3Pl7z4eA66OuTzAGC4bQB5H5fuLwPnqTKU3yyrrg4MIhjF17UYnL4c0w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -82,22 +167,23 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.29.0_typescript@4.7.4 + '@typescript-eslint/parser': 5.29.0(eslint@8.48.0)(typescript@4.7.4) '@typescript-eslint/scope-manager': 5.29.0 - '@typescript-eslint/type-utils': 5.29.0_typescript@4.7.4 - '@typescript-eslint/utils': 5.29.0_typescript@4.7.4 + '@typescript-eslint/type-utils': 5.29.0(eslint@8.48.0)(typescript@4.7.4) + '@typescript-eslint/utils': 5.29.0(eslint@8.48.0)(typescript@4.7.4) debug: 4.3.4 + eslint: 8.48.0 functional-red-black-tree: 1.0.1 ignore: 5.2.4 regexpp: 3.2.0 semver: 7.3.8 - tsutils: 3.21.0_typescript@4.7.4 + tsutils: 3.21.0(typescript@4.7.4) typescript: 4.7.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser/5.29.0_typescript@4.7.4: + /@typescript-eslint/parser@5.29.0(eslint@8.48.0)(typescript@4.7.4): resolution: {integrity: sha512-ruKWTv+x0OOxbzIw9nW5oWlUopvP/IQDjB5ZqmTglLIoDTctLlAJpAQFpNPJP/ZI7hTT9sARBosEfaKbcFuECw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -109,14 +195,15 @@ packages: dependencies: '@typescript-eslint/scope-manager': 5.29.0 '@typescript-eslint/types': 5.29.0 - '@typescript-eslint/typescript-estree': 5.29.0_typescript@4.7.4 + '@typescript-eslint/typescript-estree': 5.29.0(typescript@4.7.4) debug: 4.3.4 + eslint: 8.48.0 typescript: 4.7.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/scope-manager/5.29.0: + /@typescript-eslint/scope-manager@5.29.0: resolution: {integrity: sha512-etbXUT0FygFi2ihcxDZjz21LtC+Eps9V2xVx09zFoN44RRHPrkMflidGMI+2dUs821zR1tDS6Oc9IXxIjOUZwA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: @@ -124,7 +211,7 @@ packages: '@typescript-eslint/visitor-keys': 5.29.0 dev: true - /@typescript-eslint/type-utils/5.29.0_typescript@4.7.4: + /@typescript-eslint/type-utils@5.29.0(eslint@8.48.0)(typescript@4.7.4): resolution: {integrity: sha512-JK6bAaaiJozbox3K220VRfCzLa9n0ib/J+FHIwnaV3Enw/TO267qe0pM1b1QrrEuy6xun374XEAsRlA86JJnyg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -134,20 +221,21 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/utils': 5.29.0_typescript@4.7.4 + '@typescript-eslint/utils': 5.29.0(eslint@8.48.0)(typescript@4.7.4) debug: 4.3.4 - tsutils: 3.21.0_typescript@4.7.4 + eslint: 8.48.0 + tsutils: 3.21.0(typescript@4.7.4) typescript: 4.7.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/types/5.29.0: + /@typescript-eslint/types@5.29.0: resolution: {integrity: sha512-X99VbqvAXOMdVyfFmksMy3u8p8yoRGITgU1joBJPzeYa0rhdf5ok9S56/itRoUSh99fiDoMtarSIJXo7H/SnOg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree/5.29.0_typescript@4.7.4: + /@typescript-eslint/typescript-estree@5.29.0(typescript@4.7.4): resolution: {integrity: sha512-mQvSUJ/JjGBdvo+1LwC+GY2XmSYjK1nAaVw2emp/E61wEVYEyibRHCqm1I1vEKbXCpUKuW4G7u9ZCaZhJbLoNQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -162,13 +250,13 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.3.8 - tsutils: 3.21.0_typescript@4.7.4 + tsutils: 3.21.0(typescript@4.7.4) typescript: 4.7.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils/5.29.0_typescript@4.7.4: + /@typescript-eslint/utils@5.29.0(eslint@8.48.0)(typescript@4.7.4): resolution: {integrity: sha512-3Eos6uP1nyLOBayc/VUdKZikV90HahXE5Dx9L5YlSd/7ylQPXhLk1BYb29SDgnBnTp+jmSZUU0QxUiyHgW4p7A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -177,15 +265,16 @@ packages: '@types/json-schema': 7.0.11 '@typescript-eslint/scope-manager': 5.29.0 '@typescript-eslint/types': 5.29.0 - '@typescript-eslint/typescript-estree': 5.29.0_typescript@4.7.4 + '@typescript-eslint/typescript-estree': 5.29.0(typescript@4.7.4) + eslint: 8.48.0 eslint-scope: 5.1.1 - eslint-utils: 3.0.0 + eslint-utils: 3.0.0(eslint@8.48.0) transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/visitor-keys/5.29.0: + /@typescript-eslint/visitor-keys@5.29.0: resolution: {integrity: sha512-Hpb/mCWsjILvikMQoZIE3voc9wtQcS0A9FUw3h8bhr9UxBdtI/tw1ZDZUOXHXLOVMedKCH5NxyzATwnU78bWCQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: @@ -193,24 +282,111 @@ packages: eslint-visitor-keys: 3.3.0 dev: true - /array-union/2.1.0: + /acorn-jsx@5.3.2(acorn@8.10.0): + resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + acorn: 8.10.0 + dev: true + + /acorn@8.10.0: + resolution: {integrity: sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + + /ajv@6.12.6: + resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + dev: true + + /ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + dev: true + + /ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + dependencies: + color-convert: 2.0.1 + dev: true + + /argparse@2.0.1: + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + dev: true + + /array-union@2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} dev: true - /braces/3.0.2: + /balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + dev: true + + /brace-expansion@1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + dev: true + + /braces@3.0.2: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} engines: {node: '>=8'} dependencies: fill-range: 7.0.1 dev: true - /builtin-modules/3.3.0: + /builtin-modules@3.3.0: resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} engines: {node: '>=6'} dev: true - /debug/4.3.4: + /callsites@3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} + dev: true + + /chalk@4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + dev: true + + /color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + dependencies: + color-name: 1.1.4 + dev: true + + /color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + dev: true + + /concat-map@0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + dev: true + + /cross-spawn@7.0.3: + resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + engines: {node: '>= 8'} + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + dev: true + + /debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} peerDependencies: @@ -222,14 +398,25 @@ packages: ms: 2.1.2 dev: true - /dir-glob/3.0.1: + /deep-is@0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + dev: true + + /dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} dependencies: path-type: 4.0.0 dev: true - /esbuild-android-64/0.14.47: + /doctrine@3.0.0: + resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} + engines: {node: '>=6.0.0'} + dependencies: + esutils: 2.0.3 + dev: true + + /esbuild-android-64@0.14.47: resolution: {integrity: sha512-R13Bd9+tqLVFndncMHssZrPWe6/0Kpv2/dt4aA69soX4PRxlzsVpCvoJeFE8sOEoeVEiBkI0myjlkDodXlHa0g==} engines: {node: '>=12'} cpu: [x64] @@ -238,7 +425,7 @@ packages: dev: true optional: true - /esbuild-android-arm64/0.14.47: + /esbuild-android-arm64@0.14.47: resolution: {integrity: sha512-OkwOjj7ts4lBp/TL6hdd8HftIzOy/pdtbrNA4+0oVWgGG64HrdVzAF5gxtJufAPOsEjkyh1oIYvKAUinKKQRSQ==} engines: {node: '>=12'} cpu: [arm64] @@ -247,7 +434,7 @@ packages: dev: true optional: true - /esbuild-darwin-64/0.14.47: + /esbuild-darwin-64@0.14.47: resolution: {integrity: sha512-R6oaW0y5/u6Eccti/TS6c/2c1xYTb1izwK3gajJwi4vIfNs1s8B1dQzI1UiC9T61YovOQVuePDcfqHLT3mUZJA==} engines: {node: '>=12'} cpu: [x64] @@ -256,7 +443,7 @@ packages: dev: true optional: true - /esbuild-darwin-arm64/0.14.47: + /esbuild-darwin-arm64@0.14.47: resolution: {integrity: sha512-seCmearlQyvdvM/noz1L9+qblC5vcBrhUaOoLEDDoLInF/VQ9IkobGiLlyTPYP5dW1YD4LXhtBgOyevoIHGGnw==} engines: {node: '>=12'} cpu: [arm64] @@ -265,7 +452,7 @@ packages: dev: true optional: true - /esbuild-freebsd-64/0.14.47: + /esbuild-freebsd-64@0.14.47: resolution: {integrity: sha512-ZH8K2Q8/Ux5kXXvQMDsJcxvkIwut69KVrYQhza/ptkW50DC089bCVrJZZ3sKzIoOx+YPTrmsZvqeZERjyYrlvQ==} engines: {node: '>=12'} cpu: [x64] @@ -274,7 +461,7 @@ packages: dev: true optional: true - /esbuild-freebsd-arm64/0.14.47: + /esbuild-freebsd-arm64@0.14.47: resolution: {integrity: sha512-ZJMQAJQsIOhn3XTm7MPQfCzEu5b9STNC+s90zMWe2afy9EwnHV7Ov7ohEMv2lyWlc2pjqLW8QJnz2r0KZmeAEQ==} engines: {node: '>=12'} cpu: [arm64] @@ -283,7 +470,7 @@ packages: dev: true optional: true - /esbuild-linux-32/0.14.47: + /esbuild-linux-32@0.14.47: resolution: {integrity: sha512-FxZOCKoEDPRYvq300lsWCTv1kcHgiiZfNrPtEhFAiqD7QZaXrad8LxyJ8fXGcWzIFzRiYZVtB3ttvITBvAFhKw==} engines: {node: '>=12'} cpu: [ia32] @@ -292,7 +479,7 @@ packages: dev: true optional: true - /esbuild-linux-64/0.14.47: + /esbuild-linux-64@0.14.47: resolution: {integrity: sha512-nFNOk9vWVfvWYF9YNYksZptgQAdstnDCMtR6m42l5Wfugbzu11VpMCY9XrD4yFxvPo9zmzcoUL/88y0lfJZJJw==} engines: {node: '>=12'} cpu: [x64] @@ -301,16 +488,7 @@ packages: dev: true optional: true - /esbuild-linux-arm/0.14.47: - resolution: {integrity: sha512-ZGE1Bqg/gPRXrBpgpvH81tQHpiaGxa8c9Rx/XOylkIl2ypLuOcawXEAo8ls+5DFCcRGt/o3sV+PzpAFZobOsmA==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-arm64/0.14.47: + /esbuild-linux-arm64@0.14.47: resolution: {integrity: sha512-ywfme6HVrhWcevzmsufjd4iT3PxTfCX9HOdxA7Hd+/ZM23Y9nXeb+vG6AyA6jgq/JovkcqRHcL9XwRNpWG6XRw==} engines: {node: '>=12'} cpu: [arm64] @@ -319,7 +497,16 @@ packages: dev: true optional: true - /esbuild-linux-mips64le/0.14.47: + /esbuild-linux-arm@0.14.47: + resolution: {integrity: sha512-ZGE1Bqg/gPRXrBpgpvH81tQHpiaGxa8c9Rx/XOylkIl2ypLuOcawXEAo8ls+5DFCcRGt/o3sV+PzpAFZobOsmA==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-mips64le@0.14.47: resolution: {integrity: sha512-mg3D8YndZ1LvUiEdDYR3OsmeyAew4MA/dvaEJxvyygahWmpv1SlEEnhEZlhPokjsUMfRagzsEF/d/2XF+kTQGg==} engines: {node: '>=12'} cpu: [mips64el] @@ -328,7 +515,7 @@ packages: dev: true optional: true - /esbuild-linux-ppc64le/0.14.47: + /esbuild-linux-ppc64le@0.14.47: resolution: {integrity: sha512-WER+f3+szmnZiWoK6AsrTKGoJoErG2LlauSmk73LEZFQ/iWC+KhhDsOkn1xBUpzXWsxN9THmQFltLoaFEH8F8w==} engines: {node: '>=12'} cpu: [ppc64] @@ -337,7 +524,7 @@ packages: dev: true optional: true - /esbuild-linux-riscv64/0.14.47: + /esbuild-linux-riscv64@0.14.47: resolution: {integrity: sha512-1fI6bP3A3rvI9BsaaXbMoaOjLE3lVkJtLxsgLHqlBhLlBVY7UqffWBvkrX/9zfPhhVMd9ZRFiaqXnB1T7BsL2g==} engines: {node: '>=12'} cpu: [riscv64] @@ -346,7 +533,7 @@ packages: dev: true optional: true - /esbuild-linux-s390x/0.14.47: + /esbuild-linux-s390x@0.14.47: resolution: {integrity: sha512-eZrWzy0xFAhki1CWRGnhsHVz7IlSKX6yT2tj2Eg8lhAwlRE5E96Hsb0M1mPSE1dHGpt1QVwwVivXIAacF/G6mw==} engines: {node: '>=12'} cpu: [s390x] @@ -355,7 +542,7 @@ packages: dev: true optional: true - /esbuild-netbsd-64/0.14.47: + /esbuild-netbsd-64@0.14.47: resolution: {integrity: sha512-Qjdjr+KQQVH5Q2Q1r6HBYswFTToPpss3gqCiSw2Fpq/ua8+eXSQyAMG+UvULPqXceOwpnPo4smyZyHdlkcPppQ==} engines: {node: '>=12'} cpu: [x64] @@ -364,7 +551,7 @@ packages: dev: true optional: true - /esbuild-openbsd-64/0.14.47: + /esbuild-openbsd-64@0.14.47: resolution: {integrity: sha512-QpgN8ofL7B9z8g5zZqJE+eFvD1LehRlxr25PBkjyyasakm4599iroUpaj96rdqRlO2ShuyqwJdr+oNqWwTUmQw==} engines: {node: '>=12'} cpu: [x64] @@ -373,7 +560,7 @@ packages: dev: true optional: true - /esbuild-sunos-64/0.14.47: + /esbuild-sunos-64@0.14.47: resolution: {integrity: sha512-uOeSgLUwukLioAJOiGYm3kNl+1wJjgJA8R671GYgcPgCx7QR73zfvYqXFFcIO93/nBdIbt5hd8RItqbbf3HtAQ==} engines: {node: '>=12'} cpu: [x64] @@ -382,7 +569,7 @@ packages: dev: true optional: true - /esbuild-windows-32/0.14.47: + /esbuild-windows-32@0.14.47: resolution: {integrity: sha512-H0fWsLTp2WBfKLBgwYT4OTfFly4Im/8B5f3ojDv1Kx//kiubVY0IQunP2Koc/fr/0wI7hj3IiBDbSrmKlrNgLQ==} engines: {node: '>=12'} cpu: [ia32] @@ -391,7 +578,7 @@ packages: dev: true optional: true - /esbuild-windows-64/0.14.47: + /esbuild-windows-64@0.14.47: resolution: {integrity: sha512-/Pk5jIEH34T68r8PweKRi77W49KwanZ8X6lr3vDAtOlH5EumPE4pBHqkCUdELanvsT14yMXLQ/C/8XPi1pAtkQ==} engines: {node: '>=12'} cpu: [x64] @@ -400,7 +587,7 @@ packages: dev: true optional: true - /esbuild-windows-arm64/0.14.47: + /esbuild-windows-arm64@0.14.47: resolution: {integrity: sha512-HFSW2lnp62fl86/qPQlqw6asIwCnEsEoNIL1h2uVMgakddf+vUuMcCbtUY1i8sst7KkgHrVKCJQB33YhhOweCQ==} engines: {node: '>=12'} cpu: [arm64] @@ -409,7 +596,7 @@ packages: dev: true optional: true - /esbuild/0.14.47: + /esbuild@0.14.47: resolution: {integrity: sha512-wI4ZiIfFxpkuxB8ju4MHrGwGLyp1+awEHAHVpx6w7a+1pmYIq8T9FGEVVwFo0iFierDoMj++Xq69GXWYn2EiwA==} engines: {node: '>=12'} hasBin: true @@ -437,7 +624,12 @@ packages: esbuild-windows-arm64: 0.14.47 dev: true - /eslint-scope/5.1.1: + /escape-string-regexp@4.0.0: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + engines: {node: '>=10'} + dev: true + + /eslint-scope@5.1.1: resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} engines: {node: '>=8.0.0'} dependencies: @@ -445,43 +637,128 @@ packages: estraverse: 4.3.0 dev: true - /eslint-utils/3.0.0: + /eslint-scope@7.2.2: + resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + dev: true + + /eslint-utils@3.0.0(eslint@8.48.0): resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} peerDependencies: eslint: '>=5' dependencies: + eslint: 8.48.0 eslint-visitor-keys: 2.1.0 dev: true - /eslint-visitor-keys/2.1.0: + /eslint-visitor-keys@2.1.0: resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==} engines: {node: '>=10'} dev: true - /eslint-visitor-keys/3.3.0: + /eslint-visitor-keys@3.3.0: resolution: {integrity: sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /esrecurse/4.3.0: + /eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + + /eslint@8.48.0: + resolution: {integrity: sha512-sb6DLeIuRXxeM1YljSe1KEx9/YYeZFQWcV8Rq9HfigmdDEugjLEVEa1ozDjL6YDjBpQHPJxJzze+alxi4T3OLg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + hasBin: true + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.48.0) + '@eslint-community/regexpp': 4.8.0 + '@eslint/eslintrc': 2.1.2 + '@eslint/js': 8.48.0 + '@humanwhocodes/config-array': 0.11.11 + '@humanwhocodes/module-importer': 1.0.1 + '@nodelib/fs.walk': 1.2.8 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.3 + debug: 4.3.4 + doctrine: 3.0.0 + escape-string-regexp: 4.0.0 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 + esquery: 1.5.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 6.0.1 + find-up: 5.0.0 + glob-parent: 6.0.2 + globals: 13.21.0 + graphemer: 1.4.0 + ignore: 5.2.4 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + is-path-inside: 3.0.3 + js-yaml: 4.1.0 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.4.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.3 + strip-ansi: 6.0.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + dev: true + + /espree@9.6.1: + resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + acorn: 8.10.0 + acorn-jsx: 5.3.2(acorn@8.10.0) + eslint-visitor-keys: 3.4.3 + dev: true + + /esquery@1.5.0: + resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} + engines: {node: '>=0.10'} + dependencies: + estraverse: 5.3.0 + dev: true + + /esrecurse@4.3.0: resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} engines: {node: '>=4.0'} dependencies: estraverse: 5.3.0 dev: true - /estraverse/4.3.0: + /estraverse@4.3.0: resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} engines: {node: '>=4.0'} dev: true - /estraverse/5.3.0: + /estraverse@5.3.0: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} dev: true - /fast-glob/3.2.12: + /esutils@2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + dev: true + + /fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + dev: true + + /fast-glob@3.2.12: resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} engines: {node: '>=8.6.0'} dependencies: @@ -492,31 +769,96 @@ packages: micromatch: 4.0.5 dev: true - /fastq/1.15.0: + /fast-json-stable-stringify@2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + dev: true + + /fast-levenshtein@2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + dev: true + + /fastq@1.15.0: resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} dependencies: reusify: 1.0.4 dev: true - /fill-range/7.0.1: + /file-entry-cache@6.0.1: + resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} + engines: {node: ^10.12.0 || >=12.0.0} + dependencies: + flat-cache: 3.1.0 + dev: true + + /fill-range@7.0.1: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} engines: {node: '>=8'} dependencies: to-regex-range: 5.0.1 dev: true - /functional-red-black-tree/1.0.1: + /find-up@5.0.0: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + dev: true + + /flat-cache@3.1.0: + resolution: {integrity: sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew==} + engines: {node: '>=12.0.0'} + dependencies: + flatted: 3.2.7 + keyv: 4.5.3 + rimraf: 3.0.2 + dev: true + + /flatted@3.2.7: + resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} + dev: true + + /fs.realpath@1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + dev: true + + /functional-red-black-tree@1.0.1: resolution: {integrity: sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==} dev: true - /glob-parent/5.1.2: + /glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} dependencies: is-glob: 4.0.3 dev: true - /globby/11.1.0: + /glob-parent@6.0.2: + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} + engines: {node: '>=10.13.0'} + dependencies: + is-glob: 4.0.3 + dev: true + + /glob@7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + + /globals@13.21.0: + resolution: {integrity: sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==} + engines: {node: '>=8'} + dependencies: + type-fest: 0.20.2 + dev: true + + /globby@11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} engines: {node: '>=10'} dependencies: @@ -528,41 +870,127 @@ packages: slash: 3.0.0 dev: true - /ignore/5.2.4: + /graphemer@1.4.0: + resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + dev: true + + /has-flag@4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + dev: true + + /ignore@5.2.4: resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} engines: {node: '>= 4'} dev: true - /is-extglob/2.1.1: + /import-fresh@3.3.0: + resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} + engines: {node: '>=6'} + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + dev: true + + /imurmurhash@0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + dev: true + + /inflight@1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + dev: true + + /inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + dev: true + + /is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} dev: true - /is-glob/4.0.3: + /is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} dependencies: is-extglob: 2.1.1 dev: true - /is-number/7.0.0: + /is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} dev: true - /lru-cache/6.0.0: + /is-path-inside@3.0.3: + resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} + engines: {node: '>=8'} + dev: true + + /isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + dev: true + + /js-yaml@4.1.0: + resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} + hasBin: true + dependencies: + argparse: 2.0.1 + dev: true + + /json-buffer@3.0.1: + resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + dev: true + + /json-schema-traverse@0.4.1: + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + dev: true + + /json-stable-stringify-without-jsonify@1.0.1: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + dev: true + + /keyv@4.5.3: + resolution: {integrity: sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==} + dependencies: + json-buffer: 3.0.1 + dev: true + + /levn@0.4.1: + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.2.1 + type-check: 0.4.0 + dev: true + + /locate-path@6.0.0: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} + dependencies: + p-locate: 5.0.0 + dev: true + + /lodash.merge@4.6.2: + resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + dev: true + + /lru-cache@6.0.0: resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} engines: {node: '>=10'} dependencies: yallist: 4.0.0 dev: true - /merge2/1.4.1: + /merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} dev: true - /micromatch/4.0.5: + /micromatch@4.0.5: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} engines: {node: '>=8.6'} dependencies: @@ -570,59 +998,147 @@ packages: picomatch: 2.3.1 dev: true - /moment/2.29.4: + /minimatch@3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + dependencies: + brace-expansion: 1.1.11 + dev: true + + /moment@2.29.4: resolution: {integrity: sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==} dev: true - /monkey-around/2.3.0: + /monkey-around@2.3.0: resolution: {integrity: sha512-QWcCUWjqE/MCk9cXlSKZ1Qc486LD439xw/Ak8Nt6l2PuL9+yrc9TJakt7OHDuOqPRYY4nTWBAEFKn32PE/SfXA==} dev: false - /ms/2.1.2: + /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} dev: true - /obsidian/1.1.1: - resolution: {integrity: sha512-GcxhsHNkPEkwHEjeyitfYNBcQuYGeAHFs1pEpZIv0CnzSfui8p8bPLm2YKLgcg20B764770B1sYGtxCvk9ptxg==} + /natural-compare@1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + dev: true + + /obsidian@1.4.4(@codemirror/state@6.2.1)(@codemirror/view@6.18.0): + resolution: {integrity: sha512-q2V5GNT/M40uYOENdVw5kovPSoaO6vppiiyBCkIqWgKp4oN654jA/GQ0OaNBA7p5NdfS245QCeRgCFQ42wOZiw==} peerDependencies: '@codemirror/state': ^6.0.0 '@codemirror/view': ^6.0.0 dependencies: - '@types/codemirror': 0.0.108 + '@codemirror/state': 6.2.1 + '@codemirror/view': 6.18.0 + '@types/codemirror': 5.60.8 moment: 2.29.4 dev: true - /path-type/4.0.0: + /once@1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + dependencies: + wrappy: 1.0.2 + dev: true + + /optionator@0.9.3: + resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} + engines: {node: '>= 0.8.0'} + dependencies: + '@aashutoshrathi/word-wrap': 1.2.6 + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + dev: true + + /p-limit@3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + dependencies: + yocto-queue: 0.1.0 + dev: true + + /p-locate@5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} + dependencies: + p-limit: 3.1.0 + dev: true + + /parent-module@1.0.1: + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} + engines: {node: '>=6'} + dependencies: + callsites: 3.1.0 + dev: true + + /path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + dev: true + + /path-is-absolute@1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + dev: true + + /path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + dev: true + + /path-type@4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} dev: true - /picomatch/2.3.1: + /picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} dev: true - /queue-microtask/1.2.3: + /prelude-ls@1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + engines: {node: '>= 0.8.0'} + dev: true + + /punycode@2.3.0: + resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} + engines: {node: '>=6'} + dev: true + + /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} dev: true - /regexpp/3.2.0: + /regexpp@3.2.0: resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} engines: {node: '>=8'} dev: true - /reusify/1.0.4: + /resolve-from@4.0.0: + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} + engines: {node: '>=4'} + dev: true + + /reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} dev: true - /run-parallel/1.2.0: + /rimraf@3.0.2: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + hasBin: true + dependencies: + glob: 7.2.3 + dev: true + + /run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: queue-microtask: 1.2.3 dev: true - /semver/7.3.8: + /semver@7.3.8: resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==} engines: {node: '>=10'} hasBin: true @@ -630,27 +1146,66 @@ packages: lru-cache: 6.0.0 dev: true - /slash/3.0.0: + /shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + dependencies: + shebang-regex: 3.0.0 + dev: true + + /shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + dev: true + + /slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} dev: true - /to-regex-range/5.0.1: + /strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + dependencies: + ansi-regex: 5.0.1 + dev: true + + /strip-json-comments@3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} + dev: true + + /style-mod@4.1.0: + resolution: {integrity: sha512-Ca5ib8HrFn+f+0n4N4ScTIA9iTOQ7MaGS1ylHcoVqW9J7w2w8PzN6g9gKmTYgGEBH8e120+RCmhpje6jC5uGWA==} + dev: true + + /supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + dependencies: + has-flag: 4.0.0 + dev: true + + /text-table@0.2.0: + resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} + dev: true + + /to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} dependencies: is-number: 7.0.0 dev: true - /tslib/1.14.1: + /tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: true - /tslib/2.4.0: + /tslib@2.4.0: resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==} dev: true - /tsutils/3.21.0_typescript@4.7.4: + /tsutils@3.21.0(typescript@4.7.4): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: @@ -660,12 +1215,51 @@ packages: typescript: 4.7.4 dev: true - /typescript/4.7.4: + /type-check@0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.2.1 + dev: true + + /type-fest@0.20.2: + resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} + engines: {node: '>=10'} + dev: true + + /typescript@4.7.4: resolution: {integrity: sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==} engines: {node: '>=4.2.0'} hasBin: true dev: true - /yallist/4.0.0: + /uri-js@4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + dependencies: + punycode: 2.3.0 + dev: true + + /w3c-keyname@2.2.8: + resolution: {integrity: sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==} + dev: true + + /which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + dependencies: + isexe: 2.0.0 + dev: true + + /wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + dev: true + + /yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} dev: true + + /yocto-queue@0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + dev: true diff --git a/src/floatSearchIndex.ts b/src/floatSearchIndex.ts index 4ce4347..3458cea 100644 --- a/src/floatSearchIndex.ts +++ b/src/floatSearchIndex.ts @@ -1,11 +1,8 @@ import { - apiVersion, - App, Editor, - MarkdownView, Menu, - Modal, Notice, OpenViewState, - Plugin, requireApiVersion, SearchView, + Modal, OpenViewState, + Plugin, SearchView, TAbstractFile, TFile, Workspace, @@ -15,14 +12,59 @@ import { import { EmbeddedView, isEmebeddedLeaf, spawnLeafView } from "./leafView"; import { around } from "monkey-around"; +type sortOrder = + "alphabetical" + | "alphabeticalReverse" + | "byModifiedTime" + | "byModifiedTimeReverse" + | "byCreatedTime" + | "byCreatedTimeReverse"; + +interface searchState { + collapseAll?: boolean; + explainSearch?: boolean; + extraContext?: boolean; + matchingCase?: boolean; + query: string; + sortOrder?: sortOrder; + current?: boolean; +} + +interface FloatSearchSettings { + searchViewState: searchState; +} + + +const DEFAULT_SETTINGS: FloatSearchSettings = { + searchViewState: { + collapseAll: false, + explainSearch: false, + extraContext: false, + matchingCase: false, + query: "", + sortOrder: "alphabetical", + } +} + export default class FloatSearchPlugin extends Plugin { + settings: FloatSearchSettings; private state: any; - private applyDebounceTimer = 0; private modal: FloatSearchModal; + private applyStateDebounceTimer = 0; + private applySettingsDebounceTimer = 0; + + public applySettingsUpdate() { - clearTimeout(this.applyDebounceTimer); - this.applyDebounceTimer = window.setTimeout(() => { + clearTimeout(this.applySettingsDebounceTimer); + this.applySettingsDebounceTimer = window.setTimeout(async () => { + await this.saveSettings(); + }, 1000); + } + + private applyStateUpdate() { + this.applyStateDebounceTimer = window.setTimeout(() => { + clearTimeout(this.applyStateDebounceTimer); this.state = { ...this.state, query: "", @@ -31,6 +73,9 @@ export default class FloatSearchPlugin extends Plugin { } async onload() { + await this.loadSettings(); + this.initState(); + this.patchWorkspace(); this.patchWorkspaceLeaf(); @@ -39,40 +84,48 @@ export default class FloatSearchPlugin extends Plugin { this.registerEditorMenuHandler(); this.registerContextMenuHandler(); - this.addRibbonIcon('search', 'Search Obsidian In Modal', () => { - this.modal = new FloatSearchModal((state)=>{ - this.state = state; - this.applySettingsUpdate(); - },this.app, this, this.state); - this.modal.open(); - }); + this.addRibbonIcon('search', 'Search Obsidian In Modal', () => this.initModal(this.state, true, true)); } onunload() { this.state = undefined; } + initState() { + this.state = this.settings.searchViewState as searchState; + } + + initModal(state: searchState, stateSave: boolean = false, clearQuery: boolean = false) { + this.modal = new FloatSearchModal((state) => { + this.state = state; + if (stateSave) this.applyStateUpdate(); + this.settings.searchViewState = state as searchState; + this.applySettingsUpdate(); + }, this, {...state, query: clearQuery ? "" : state.query}); + this.modal.open(); + } + patchWorkspace() { let layoutChanging = false; const uninstaller = around(Workspace.prototype, { getLeaf: (next) => function (...args) { const activeLeaf = this.activeLeaf; - if(activeLeaf) { + if (activeLeaf) { const fsCtnEl = (activeLeaf.parent.containerEl as HTMLElement).parentElement; - if(fsCtnEl?.classList.contains("fs-content")) { - if(activeLeaf.view.getViewType() === "markdown") { + if (fsCtnEl?.classList.contains("fs-content")) { + if (activeLeaf.view.getViewType() === "markdown") { return activeLeaf; } const newLeaf = app.workspace.getUnpinnedLeaf(); - if(newLeaf) { + if (newLeaf) { this.setActiveLeaf(newLeaf); } } return next.call(this, ...args); } return next.call(this, ...args); - }, + }, changeLayout(old) { return async function (workspace: unknown) { layoutChanging = true; @@ -91,7 +144,7 @@ export default class FloatSearchPlugin extends Plugin { if (old.call(this, arg1, arg2)) return true; // Handle old/new API parameter swap - const cb: leafIterator = (typeof arg1 === "function" ? arg1 : arg2) as leafIterator; + const cb: leafIterator = (typeof arg1 === "function" ? arg1 : arg2) as leafIterator; const parent: WorkspaceItem = (typeof arg1 === "function" ? arg2 : arg1) as WorkspaceItem; if (!parent) return false; // <- during app startup, rootSplit can be null @@ -99,7 +152,7 @@ export default class FloatSearchPlugin extends Plugin { // 0.14.x doesn't have WorkspaceContainer; this can just be an instanceof check once 15.x is mandatory: if (parent === app.workspace.rootSplit || (WorkspaceContainer && parent instanceof WorkspaceContainer)) { - for(const popover of EmbeddedView.popoversForWindow((parent as WorkspaceContainer).win)) { + for (const popover of EmbeddedView.popoversForWindow((parent as WorkspaceContainer).win)) { // Use old API here for compat w/0.14.x if (old.call(this, cb, popover.rootSplit)) return true; } @@ -129,7 +182,7 @@ export default class FloatSearchPlugin extends Plugin { setPinned(old) { return function (pinned: boolean) { old.call(this, pinned); - if(isEmebeddedLeaf(this) && !pinned) this.setPinned(true); + if (isEmebeddedLeaf(this) && !pinned) this.setPinned(true); } }, openFile(old) { @@ -166,21 +219,21 @@ export default class FloatSearchPlugin extends Plugin { } const view = old.call(this, file, openState); - setTimeout(()=>{ + setTimeout(() => { const fsCtnEl = (this.parent.containerEl as HTMLElement).parentElement; - if(!(fsCtnEl?.classList.contains("fs-content"))) return; - if(file.extension != "canvas" ) return; + if (!(fsCtnEl?.classList.contains("fs-content"))) return; + if (file.extension != "canvas") return; const canvas = this.view.canvas; - setTimeout(()=>{ - if(canvas && openState?.eState?.match) { - let node = canvas.data.nodes?.find((e: any)=> e.text === openState.eState.match.content); + setTimeout(() => { + if (canvas && openState?.eState?.match) { + let node = canvas.data.nodes?.find((e: any) => e.text === openState.eState.match.content); node = canvas.nodes.get(node.id); canvas.selectOnly(node); canvas.zoomToSelection(); - } - },20); + } + }, 20); }, 1); return view; @@ -191,94 +244,78 @@ export default class FloatSearchPlugin extends Plugin { } registerObsidianURIHandler() { - this.registerObsidianProtocolHandler("fs", (path)=>{ - this.modal = new FloatSearchModal((state)=>{ - this.state = state; - this.applySettingsUpdate(); - },this.app, this, { query: path.query, current: false }); - this.modal.open(); - }); + this.registerObsidianProtocolHandler("fs", (path) => this.initModal({ + ...this.state, + query: path.query, + current: false + }, true, true)); } registerObsidianCommands() { this.addCommand({ id: 'search-obsidian-globally', name: 'Search Obsidian Globally', - callback: () => { - this.modal = new FloatSearchModal((state)=>{ - this.state = state; - },this.app, this, {...this.state, query: "", current: false}); - this.modal.open(); - } + callback: () => this.initModal({...this.state, query: "", current: false}, false, true) }); this.addCommand({ id: 'search-obsidian-globally-state', name: 'Search Obsidian Globally (With Last State)', - callback: () => { - this.modal = new FloatSearchModal((state)=>{ - this.state = state; - },this.app, this, {...this.state, current: false}); - this.modal.open(); - } + callback: () => this.initModal({...this.state, query: "", current: false}, true, false) }); this.addCommand({ - id: 'search-in-backlink', - name: 'Search In Backlink Of Current File', - checkCallback: (checking: boolean) => { - // Conditions to check + id: 'search-in-backlink', + name: 'Search In Backlink Of Current File', + checkCallback: (checking: boolean) => { + // Conditions to check const activeLeaf = this.app.workspace.activeLeaf; - if(!activeLeaf) return; + if (!activeLeaf) return; const viewType = activeLeaf.view.getViewType(); if (viewType === "markdown" || viewType === "canvas") { if (!checking) { const currentFile = activeLeaf.view.file; - this.modal = new FloatSearchModal((state)=>{ - this.state = state; - this.applySettingsUpdate(); - },this.app, this, {...this.state, query: " /\\[\\[" + (currentFile.extension === "canvas" ? currentFile.name : currentFile.basename) + "(\\|[^\\]]*)?\\]\\]/", current: true }); - this.modal.open(); + this.initModal({ + ...this.state, + query: " /\\[\\[" + (currentFile.extension === "canvas" ? currentFile.name : currentFile.basename) + "(\\|[^\\]]*)?\\]\\]/", + current: true + }, true, false); } return true; } - } + } }); this.addCommand({ - id: 'search-in-current-file', - name: 'Search In Current File', - checkCallback: (checking: boolean) => { - // Conditions to check + id: 'search-in-current-file', + name: 'Search In Current File', + checkCallback: (checking: boolean) => { + // Conditions to check const activeLeaf = this.app.workspace.activeLeaf; - if(!activeLeaf) return; + if (!activeLeaf) return; const viewType = activeLeaf.view.getViewType(); - if (viewType === "markdown" || viewType === "canvas") { - if (!checking) { + if (viewType === "markdown" || viewType === "canvas") { + if (!checking) { const currentFile = activeLeaf.view.file; - this.modal = new FloatSearchModal((state)=>{ - this.state = state; - this.applySettingsUpdate(); - },this.app, this, {...this.state, query: " path:" + currentFile.path, current: true }); - this.modal.open(); - } + this.initModal({...this.state, query: " path:" + currentFile.path, current: true}, true, false); + } - return true; - } - } + return true; + } + } }); this.addCommand({ - id: 'open-search-view', - name: 'Open Search View', - callback: async () => { + id: 'open-search-view', + name: 'Open Search View', + callback: async () => { const leaf = app.workspace.getLeaf(); leaf.setPinned(true); await leaf.setViewState({ @@ -302,7 +339,7 @@ export default class FloatSearchPlugin extends Plugin { registerEditorMenuHandler() { this.registerEvent( - this.app.workspace.on('editor-menu', (menu: Menu, editor: Editor, view: MarkdownView) => { + this.app.workspace.on('editor-menu', (menu: Menu, editor: Editor) => { if (!editor) { return; } @@ -312,7 +349,7 @@ export default class FloatSearchPlugin extends Plugin { const selection = editor.getSelection().trim(); let searchWord = selection; - if(selection.length > 8) { + if (selection.length > 8) { searchWord = selection.substring(0, 3) + "..." + selection.substring(selection.length - 3, selection.length); } else { searchWord = selection; @@ -321,48 +358,46 @@ export default class FloatSearchPlugin extends Plugin { menu.addItem((item) => { // Add sub menu item.setTitle('Search "' + searchWord + '"' + " in Float Search").setIcon("search") - .onClick(()=>{ - this.modal = new FloatSearchModal((state)=>{ - this.state = state; - this.applySettingsUpdate(); - },this.app, this, { query: selection, current: false }); - this.modal.open(); - }) + .onClick(() => this.initModal({...this.state, query: selection, current: false}, true, false)) }) })) } registerContextMenuHandler() { this.registerEvent( - this.app.workspace.on("file-menu", (menu: Menu, file: TAbstractFile, source: string, leaf?: WorkspaceLeaf) => { - const popover = leaf ? EmbeddedView.forLeaf(leaf) : undefined; - if (file instanceof TFile && !popover && !leaf) { - menu.addItem(item => { - item - .setIcon("popup-open") - .setTitle("Open in Float Preview") - .onClick(async () => { - if(this.modal) { - await this.modal.initFileView(file, undefined); + this.app.workspace.on("file-menu", (menu: Menu, file: TAbstractFile, source: string, leaf?: WorkspaceLeaf) => { + const popover = leaf ? EmbeddedView.forLeaf(leaf) : undefined; + if (file instanceof TFile && !popover && !leaf) { + menu.addItem(item => { + item + .setIcon("popup-open") + .setTitle("Open in Float Preview") + .onClick(async () => { + if (this.modal) { + await this.modal.initFileView(file, undefined); - return; - } + return; + } - this.modal = new FloatSearchModal((state)=>{ - this.state = state; - this.applySettingsUpdate(); - },this.app, this, { query: "", current: false }); - this.modal.open(); - setTimeout(async ()=>{ - await this.modal.initFileView(file, undefined); - }, 20); - }) - .setSection?.("open"); - }); - } - }), + this.initModal({...this.state, current: false}, true, true); + setTimeout(async () => { + await this.modal.initFileView(file, undefined); + }, 20); + }) + .setSection?.("open"); + }); + } + }), ); - } + } + + async loadSettings() { + this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData()); + } + + async saveSettings() { + await this.saveData(this.settings); + } } @@ -374,7 +409,7 @@ class FloatSearchModal extends Modal { searchLeaf: WorkspaceLeaf; fileLeaf: WorkspaceLeaf | undefined; - private cb: (state: any)=> void; + private cb: (state: any) => void; private state: any; private fileState: any; @@ -384,8 +419,8 @@ class FloatSearchModal extends Modal { private fileEl: HTMLElement; private viewType: string; - constructor(cb: (state: any)=> void, app: App, plugin: FloatSearchPlugin, state: any, viewType: string = "search") { - super(app); + constructor(cb: (state: any) => void, plugin: FloatSearchPlugin, state: any, viewType: string = "search") { + super(plugin.app); this.plugin = plugin; this.cb = cb; this.state = state; @@ -393,20 +428,20 @@ class FloatSearchModal extends Modal { } async onOpen() { - const { contentEl, containerEl, modalEl } = this; + const {contentEl, containerEl, modalEl} = this; - this.searchCtnEl = contentEl.createDiv({ cls: "float-search-modal-search-ctn" }); - this.instructionsEl = modalEl.createDiv({ cls: "float-search-modal-instructions" }); + this.searchCtnEl = contentEl.createDiv({cls: "float-search-modal-search-ctn"}); + this.instructionsEl = modalEl.createDiv({cls: "float-search-modal-instructions"}); this.initInstructions(this.instructionsEl); this.initCss(contentEl, modalEl, containerEl); - await this.initSearchView(this.searchCtnEl, this.viewType); + await this.initSearchView(this.searchCtnEl); this.initInput(); this.initContent(); } onClose() { - const { contentEl } = this; + const {contentEl} = this; this.cb(this.searchLeaf.view.getState()); @@ -418,47 +453,47 @@ class FloatSearchModal extends Modal { } initInstructions(instructionsEl: HTMLElement) { - const navigateInstructionsEl = instructionsEl.createDiv({ cls: "float-search-modal-instructions-navigate" }); - const collapseInstructionsEl = instructionsEl.createDiv({ cls: "float-search-modal-instructions-collapse" }); - const enterInstructionsEl = instructionsEl.createDiv({ cls: "float-search-modal-instructions-enter" }); - const altEnterInstructionsEl = instructionsEl.createDiv({ cls: "float-search-modal-instructions-alt-enter" }); + const navigateInstructionsEl = instructionsEl.createDiv({cls: "float-search-modal-instructions-navigate"}); + const collapseInstructionsEl = instructionsEl.createDiv({cls: "float-search-modal-instructions-collapse"}); + const enterInstructionsEl = instructionsEl.createDiv({cls: "float-search-modal-instructions-enter"}); + const altEnterInstructionsEl = instructionsEl.createDiv({cls: "float-search-modal-instructions-alt-enter"}); - const tabInstructionsEl = instructionsEl.createDiv({ cls: "float-search-modal-instructions-tab" }); - const switchInstructionsEl = instructionsEl.createDiv({ cls: "float-search-modal-instructions-switch" }); + const tabInstructionsEl = instructionsEl.createDiv({cls: "float-search-modal-instructions-tab"}); + const switchInstructionsEl = instructionsEl.createDiv({cls: "float-search-modal-instructions-switch"}); - const navigateIconEl = navigateInstructionsEl.createSpan({ cls: "float-search-modal-instructions-key" }); - const navigateTextEl = navigateInstructionsEl.createSpan({ cls: "float-search-modal-instructions-text" }); + const navigateIconEl = navigateInstructionsEl.createSpan({cls: "float-search-modal-instructions-key"}); + const navigateTextEl = navigateInstructionsEl.createSpan({cls: "float-search-modal-instructions-text"}); navigateIconEl.setText("↑↓"); navigateTextEl.setText("Navigate"); - const collapseIconEl = collapseInstructionsEl.createSpan({ cls: "float-search-modal-instructions-key" }); - const collapseTextEl = collapseInstructionsEl.createSpan({ cls: "float-search-modal-instructions-text" }); + const collapseIconEl = collapseInstructionsEl.createSpan({cls: "float-search-modal-instructions-key"}); + const collapseTextEl = collapseInstructionsEl.createSpan({cls: "float-search-modal-instructions-text"}); collapseIconEl.setText("Shift+↑↓"); collapseTextEl.setText("Collapse/Expand"); - const enterIconEl = enterInstructionsEl.createSpan({ cls: "float-search-modal-instructions-key" }); - const enterTextEl = enterInstructionsEl.createSpan({ cls: "float-search-modal-instructions-text" }); + const enterIconEl = enterInstructionsEl.createSpan({cls: "float-search-modal-instructions-key"}); + const enterTextEl = enterInstructionsEl.createSpan({cls: "float-search-modal-instructions-text"}); enterIconEl.setText("↵"); enterTextEl.setText("Open in background"); - const altEnterIconEl = altEnterInstructionsEl.createSpan({ cls: "float-search-modal-instructions-key" }); - const altEnterTextEl = altEnterInstructionsEl.createSpan({ cls: "float-search-modal-instructions-text" }); + const altEnterIconEl = altEnterInstructionsEl.createSpan({cls: "float-search-modal-instructions-key"}); + const altEnterTextEl = altEnterInstructionsEl.createSpan({cls: "float-search-modal-instructions-text"}); altEnterIconEl.setText("Alt+↵"); altEnterTextEl.setText("Open File and Close"); - const tabIconEl = tabInstructionsEl.createSpan({ cls: "float-search-modal-instructions-key" }); - const tabTextEl = tabInstructionsEl.createSpan({ cls: "float-search-modal-instructions-text" }); + const tabIconEl = tabInstructionsEl.createSpan({cls: "float-search-modal-instructions-key"}); + const tabTextEl = tabInstructionsEl.createSpan({cls: "float-search-modal-instructions-text"}); tabIconEl.setText("Tab/Shift+Tab"); tabTextEl.setText("Preview/Close Preview"); - const switchIconEl = switchInstructionsEl.createSpan({ cls: "float-search-modal-instructions-key" }); - const switchTextEl = switchInstructionsEl.createSpan({ cls: "float-search-modal-instructions-text" }); + const switchIconEl = switchInstructionsEl.createSpan({cls: "float-search-modal-instructions-key"}); + const switchTextEl = switchInstructionsEl.createSpan({cls: "float-search-modal-instructions-text"}); switchIconEl.setText("Ctrl+G"); switchTextEl.setText("Switch Between Search and File View"); - const clickInstructionsEl = instructionsEl.createDiv({ cls: "float-search-modal-instructions-click" }); - const clickIconEl = clickInstructionsEl.createSpan({ cls: "float-search-modal-instructions-key" }); - const clickTextEl = clickInstructionsEl.createSpan({ cls: "float-search-modal-instructions-text" }); + const clickInstructionsEl = instructionsEl.createDiv({cls: "float-search-modal-instructions-click"}); + const clickIconEl = clickInstructionsEl.createSpan({cls: "float-search-modal-instructions-key"}); + const clickTextEl = clickInstructionsEl.createSpan({cls: "float-search-modal-instructions-text"}); clickIconEl.setText("Alt+Click"); clickTextEl.setText("Close Modal While In File View"); } @@ -469,7 +504,7 @@ class FloatSearchModal extends Modal { containerEl.classList.add("float-search-modal-container"); } - async initSearchView(contentEl: HTMLElement, viewType: string) { + async initSearchView(contentEl: HTMLElement) { const [createdLeaf, embeddedView] = spawnLeafView(this.plugin, contentEl); this.searchLeaf = createdLeaf; this.searchEmbeddedView = embeddedView; @@ -479,7 +514,7 @@ class FloatSearchModal extends Modal { type: "search", }); - setTimeout(async ()=>{ + setTimeout(async () => { await this.searchLeaf.view.setState(this.state, true); this.state?.current ? (this.searchLeaf.view as SearchView).searchComponent.inputEl.setSelectionRange(0, 0) : (this.searchLeaf.view as SearchView).searchComponent.inputEl.setSelectionRange(0, this.state?.query?.length); }, 0); @@ -496,8 +531,8 @@ class FloatSearchModal extends Modal { case "ArrowDown": if (e.shiftKey) { currentView.onKeyShowMoreAfter(e); - if(currentView.dom.focusedItem) { - if(currentView.dom.focusedItem.collapsible) { + if (currentView.dom.focusedItem) { + if (currentView.dom.focusedItem.collapsible) { currentView.dom.focusedItem.setCollapse(false); } } @@ -509,8 +544,8 @@ class FloatSearchModal extends Modal { case "ArrowUp": if (e.shiftKey) { currentView.onKeyShowMoreBefore(e); - if(currentView.dom.focusedItem) { - if(currentView.dom.focusedItem.collapseEl) { + if (currentView.dom.focusedItem) { + if (currentView.dom.focusedItem.collapseEl) { currentView.dom.focusedItem.setCollapse(true); } } @@ -527,14 +562,14 @@ class FloatSearchModal extends Modal { break; case "Enter": currentView.onKeyEnterInFocus(e); - if(e.altKey && currentView.dom.focusedItem) { + if (e.altKey && currentView.dom.focusedItem) { this.close(); } break; case "Tab": e.preventDefault(); - if(e.shiftKey) { - if(this.fileLeaf) { + if (e.shiftKey) { + if (this.fileLeaf) { this.fileLeaf?.detach(); this.fileLeaf = undefined; this.fileEmbeddedView?.unload(); @@ -545,33 +580,35 @@ class FloatSearchModal extends Modal { } } - if(currentView.dom.focusedItem) { + if (currentView.dom.focusedItem) { const item = currentView.dom.focusedItem; const file = item.parent.file instanceof TFile ? item.parent.file : item.file; - item.parent.file instanceof TFile ? this.initFileView(file, {match: { - content: item.content, - matches: item.matches - }}) : this.initFileView(file, undefined); + item.parent.file instanceof TFile ? this.initFileView(file, { + match: { + content: item.content, + matches: item.matches + } + }) : this.initFileView(file, undefined); } break; case "e": - if(e.ctrlKey) { + if (e.ctrlKey) { e.preventDefault(); - if(this.fileLeaf) { + if (this.fileLeaf) { const estate = this.fileLeaf.getViewState(); - estate.state.mode = "preview" === estate.state.mode ? "source" : "preview"; + estate.state.mode = "preview" === estate.state.mode ? "source" : "preview"; this.fileLeaf.setViewState(estate, { focus: !0 }); - setTimeout(()=>{ + setTimeout(() => { (this.searchLeaf.view as SearchView).searchComponent.inputEl.focus(); }, 0); } - break; } + break; case "g": - if(this.fileLeaf && e.ctrlKey) { + if (this.fileLeaf && e.ctrlKey) { e.preventDefault(); app.workspace.setActiveLeaf(this.fileLeaf, { focus: true, @@ -579,27 +616,28 @@ class FloatSearchModal extends Modal { } break; case "C": - if(e.ctrlKey && e.shiftKey) { + if (e.ctrlKey && e.shiftKey) { e.preventDefault(); const text = currentView.dom.focusedItem.el.innerText; navigator.clipboard.writeText(text); } + break; } } } initContent() { - const { contentEl } = this; + const {contentEl} = this; contentEl.onclick = (e) => { const resultElement = contentEl.getElementsByClassName('search-results-children')[0]; - if(resultElement.children.length < 2) { + if (resultElement.children.length < 2) { return; } let targetElement = e.target as HTMLElement | null; - if(e.altKey || !this.fileLeaf) { + if (e.altKey || !this.fileLeaf) { while (targetElement) { if (targetElement.classList.contains('tree-item-icon')) { break; @@ -613,23 +651,23 @@ class FloatSearchModal extends Modal { return; } - if(this.fileLeaf) { + if (this.fileLeaf) { const currentView = this.searchLeaf.view as SearchView; - if((this.searchCtnEl as Node).contains(targetElement as Node)) { + if ((this.searchCtnEl as Node).contains(targetElement as Node)) { while (targetElement) { if (targetElement.classList.contains('tree-item')) { break; } targetElement = targetElement.parentElement; } - if(!targetElement) return; + if (!targetElement) return; const fileInnerEl = targetElement?.getElementsByClassName("tree-item-inner")[0] as HTMLElement; const innerText = fileInnerEl.innerText; const file = app.metadataCache.getFirstLinkpathDest(innerText, ""); - if(file) { + if (file) { const item = currentView.dom.resultDomLookup.get(file); currentView.dom.setFocusedItem(item); this.initFileView(file, undefined); @@ -644,16 +682,16 @@ class FloatSearchModal extends Modal { } async initFileView(file: TFile, state: any) { - if(this.fileLeaf) { + if (this.fileLeaf) { await this.fileLeaf.openFile(file, { active: false, eState: state }); - if(this.fileState?.match?.matches[0] === state?.match?.matches[0] && state && this.fileState) { - setTimeout(()=>{ - if(this.fileLeaf) { - app.workspace.setActiveLeaf(this.fileLeaf, { + if (this.fileState?.match?.matches[0] === state?.match?.matches[0] && state && this.fileState) { + setTimeout(() => { + if (this.fileLeaf) { + this.plugin.app.workspace.setActiveLeaf(this.fileLeaf, { focus: true, }); } @@ -668,18 +706,18 @@ class FloatSearchModal extends Modal { return; } - const { contentEl } = this; - this.fileEl = contentEl.createDiv({ cls: "float-search-modal-file-ctn" }); + const {contentEl} = this; + this.fileEl = contentEl.createDiv({cls: "float-search-modal-file-ctn"}); this.modalEl.toggleClass("float-search-width", true); this.fileEl.onkeydown = (e) => { - if(e.ctrlKey && e.key === "g") { + if (e.ctrlKey && e.key === "g") { e.preventDefault(); e.stopPropagation(); (this.searchLeaf.view as SearchView).searchComponent.inputEl.focus(); } - if(e.key === "Tab" && e.ctrlKey) { + if (e.key === "Tab" && e.ctrlKey) { e.preventDefault(); e.stopPropagation(); @@ -687,7 +725,7 @@ class FloatSearchModal extends Modal { } } - if(!this.fileEl) return; + if (!this.fileEl) return; const [createdLeaf, embeddedView] = spawnLeafView(this.plugin, this.fileEl); this.fileLeaf = createdLeaf;