From a80b710aa93fb15ff800ba3cba48a48f904a7c8d Mon Sep 17 00:00:00 2001 From: Moritz Jung Date: Sun, 4 Aug 2024 19:56:23 +0200 Subject: [PATCH] various fixes including #390 --- bun.lockb | Bin 163368 -> 163808 bytes exampleVault/Buttons/Button Example.md | 17 ++++-- package.json | 14 ++--- .../src/fields/button/ButtonGroupMountable.ts | 44 +++++++++------- .../core/src/fields/button/ButtonMountable.ts | 49 +++++++++++------- .../fields/metaBindTable/TableMountable.ts | 13 +++-- .../errors/ErrorIndicatorComponent.svelte | 5 ++ .../ButtonTemplatesSettingComponent.svelte | 2 - .../ButtonTemplatesSettingModal.ts | 10 ++-- .../ExcludedFoldersSettingModal.ts | 10 ++-- .../InputFieldTemplatesSettingModal.ts | 10 ++-- ....199.patch => svelte@5.0.0-next.208.patch} | 2 +- tests/__preload__/svelteLoader.ts | 2 +- 13 files changed, 110 insertions(+), 68 deletions(-) rename patches/{svelte@5.0.0-next.199.patch => svelte@5.0.0-next.208.patch} (90%) diff --git a/bun.lockb b/bun.lockb index 5718a456199348742938fffc42f7b4450f794d2b..e2742f22f75c6dd6638b45481e42390a114649e2 100755 GIT binary patch delta 24487 zcmeHvd3;UR*Z0{sxk(N}A|dnCn1VzGauXrfOk5Fj3`HYCu4a0-fJpU6Lw+Ujyn4nwpmvnxC7NHj#HV1O(YZS_RV0?y6Q^c5Z4~ z?ieXAC2Me6t|YzBXBs>bdeoF87ieW?rJ@H(8kL)plQTw=ERf5Pcl3~?YM{$Osjmf~ zRY9#;>1nyv{5)&ckPPe4^!yh5roqGOof?u<8MW;}sqedRmpuEO2icjrZtziU#)B$0 z@8#{a_VhJMoNBu+F+?FziICgQKO-%otBq_(Uzo#L6YPKt?7`H zFW147=VL=v{y2{{2K3nvDcKs8ZcR;xZEIfIXd3b}VQReJG*ZVZCnY~U6b_`Or)0d2 z`qAN9wo~##;m6QS@MNb&gsMNCuQUeO{39g^6Rp4=)Ejgidc#yHCv+^ZLH~1;!?x=Tes@loP&dbM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buttons/Button Example.md b/exampleVault/Buttons/Button Example.md index b26d4812..aade5788 100644 --- a/exampleVault/Buttons/Button Example.md +++ b/exampleVault/Buttons/Button Example.md @@ -1,5 +1,5 @@ --- -count: 0 +count: 10 someList: - 1708945050652 - 1709918700548 @@ -216,7 +216,7 @@ actions: - type: updateMetadata bindTarget: count evaluate: true - value: x + 1 + value: Math.min(10, x + 1) ``` @@ -229,7 +229,7 @@ actions: - type: updateMetadata bindTarget: count evaluate: true - value: x - 1 + value: Math.max(0, x - 1) ``` @@ -318,3 +318,14 @@ actions: ``` +```meta-bind-button +label: This is a button +icon: "" +hidden: false +class: "" +tooltip: "" +id: test-id +style: default +actions: [] + +``` diff --git a/package.json b/package.json index f0d624c6..12c12511 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "test": "LOG_TESTS=false bun test", "test:log": "LOG_TESTS=true bun test", "format": "prettier --write --plugin prettier-plugin-svelte .", - "format:check": "prettier --check --plugin prettier-plugin-svelte.", + "format:check": "prettier --check --plugin prettier-plugin-svelte .", "lint": "eslint --max-warnings=0 packages/**", "lint:fix": "eslint --max-warnings=0 --fix packages/**", "svelte-check": "svelte-check --compiler-warnings \"unused-export-let:ignore\"", @@ -33,10 +33,10 @@ "@happy-dom/global-registrator": "^14.12.3", "@tsconfig/svelte": "^5.0.4", "@types/bun": "^1.1.6", - "@typescript-eslint/eslint-plugin": "^7.17.0", - "@typescript-eslint/parser": "^7.17.0", + "@typescript-eslint/eslint-plugin": "^7.18.0", + "@typescript-eslint/parser": "^7.18.0", "builtin-modules": "^4.0.0", - "elysia": "^1.1.4", + "elysia": "^1.1.5", "esbuild": "^0.23.0", "esbuild-plugin-copy-watch": "^2.3.1", "esbuild-svelte": "^0.8.1", @@ -49,7 +49,7 @@ "prettier": "^3.3.3", "prettier-plugin-svelte": "^3.2.6", "string-argv": "^0.3.2", - "svelte-check": "^3.8.4", + "svelte-check": "^3.8.5", "svelte-preprocess": "^6.0.2", "tslib": "^2.6.3", "typescript": "^5.5.4", @@ -61,7 +61,7 @@ "itertools-ts": "^1.27.1", "mathjs": "^12.4.3", "moment": "^2.30.1", - "svelte": "5.0.0-next.199", + "svelte": "5.0.0-next.208", "zod": "^3.23.8", "zod-validation-error": "^2.1.0" }, @@ -71,6 +71,6 @@ "svelte-preprocess" ], "patchedDependencies": { - "svelte@5.0.0-next.199": "patches/svelte@5.0.0-next.199.patch" + "svelte@5.0.0-next.208": "patches/svelte@5.0.0-next.208.patch" } } diff --git a/packages/core/src/fields/button/ButtonGroupMountable.ts b/packages/core/src/fields/button/ButtonGroupMountable.ts index a4320668..5d29c07c 100644 --- a/packages/core/src/fields/button/ButtonGroupMountable.ts +++ b/packages/core/src/fields/button/ButtonGroupMountable.ts @@ -40,26 +40,34 @@ export class ButtonGroupMountable extends FieldMountable { DomHelpers.removeAllClasses(targetEl); - if (!this.declaration.errorCollection.isEmpty()) { - this.plugin.internal.createErrorIndicator(targetEl, { - errorCollection: this.declaration.errorCollection, - errorText: - 'Errors caused the creation of the field to fail. Sometimes one error only occurs because of another.', - warningText: - 'Warnings will not cause the creation of a field to fail, but they indicate that a part of the declaration was invalid or uses deprecated functionality.', - code: this.declaration.declarationString, - }); - return; + if (this.declaration.errorCollection.isEmpty()) { + try { + this.buttonField = new ButtonGroupField( + this.plugin, + this.declaration.referencedButtonIds, + this.getFilePath(), + this.renderChildType, + this.position, + ); + this.buttonField.mount(targetEl); + } catch (e) { + this.errorCollection.add(e); + this.renderErrorIndicator(targetEl); + } + } else { + this.renderErrorIndicator(targetEl); } + } - this.buttonField = new ButtonGroupField( - this.plugin, - this.declaration.referencedButtonIds, - this.getFilePath(), - this.renderChildType, - this.position, - ); - this.buttonField.mount(targetEl); + private renderErrorIndicator(targetEl: HTMLElement): void { + this.plugin.internal.createErrorIndicator(targetEl, { + errorCollection: this.errorCollection, + errorText: + 'Errors caused the creation of the field to fail. Sometimes one error only occurs because of another.', + warningText: + 'Warnings will not cause the creation of a field to fail, but they indicate that a part of the declaration was invalid or uses deprecated functionality.', + code: this.declaration.declarationString, + }); } protected onUnmount(targetEl: HTMLElement): void { diff --git a/packages/core/src/fields/button/ButtonMountable.ts b/packages/core/src/fields/button/ButtonMountable.ts index a07f6ca2..3e0dc2ba 100644 --- a/packages/core/src/fields/button/ButtonMountable.ts +++ b/packages/core/src/fields/button/ButtonMountable.ts @@ -30,6 +30,7 @@ export class ButtonMountable extends FieldMountable { this.isPreview = isPreview; this.errorCollection = new ErrorCollection(this.getUuid()); + this.errorCollection.merge(declaration.errorCollection); } protected onMount(targetEl: HTMLElement): void { @@ -38,28 +39,36 @@ export class ButtonMountable extends FieldMountable { DomHelpers.removeAllClasses(targetEl); - if (!this.declaration.config || !this.declaration.errorCollection.isEmpty()) { - this.plugin.internal.createErrorIndicator(targetEl, { - errorCollection: this.declaration.errorCollection, - errorText: - 'Errors caused the creation of the field to fail. Sometimes one error only occurs because of another.', - warningText: - 'Warnings will not cause the creation of a field to fail, but they indicate that a part of the declaration was invalid or uses deprecated functionality.', - code: this.declaration.declarationString, - }); - return; + if (this.declaration.config && this.declaration.errorCollection.isEmpty()) { + try { + this.buttonField = new ButtonField( + this.plugin, + this.declaration.config, + this.getFilePath(), + RenderChildType.BLOCK, + this.position, + false, + this.isPreview, + ); + this.buttonField.mount(targetEl); + } catch (e) { + this.errorCollection.add(e); + this.renderErrorIndicator(targetEl); + } + } else { + this.renderErrorIndicator(targetEl); } + } - this.buttonField = new ButtonField( - this.plugin, - this.declaration.config, - this.getFilePath(), - RenderChildType.BLOCK, - this.position, - false, - this.isPreview, - ); - this.buttonField.mount(targetEl); + private renderErrorIndicator(targetEl: HTMLElement): void { + this.plugin.internal.createErrorIndicator(targetEl, { + errorCollection: this.errorCollection, + errorText: + 'Errors caused the creation of the field to fail. Sometimes one error only occurs because of another.', + warningText: + 'Warnings will not cause the creation of a field to fail, but they indicate that a part of the declaration was invalid or uses deprecated functionality.', + code: this.declaration.declarationString, + }); } protected onUnmount(targetEl: HTMLElement): void { diff --git a/packages/core/src/fields/metaBindTable/TableMountable.ts b/packages/core/src/fields/metaBindTable/TableMountable.ts index a952cb3a..7fd748ba 100644 --- a/packages/core/src/fields/metaBindTable/TableMountable.ts +++ b/packages/core/src/fields/metaBindTable/TableMountable.ts @@ -12,6 +12,8 @@ import { parsePropPath } from 'packages/core/src/utils/prop/PropParser'; import type { Listener } from 'packages/core/src/utils/Signal'; import { Signal } from 'packages/core/src/utils/Signal'; import { showUnloadedMessage } from 'packages/core/src/utils/Utils'; +import type { Component as SvelteComponent } from 'svelte'; +import { mount, unmount } from 'svelte'; // export type MetaBindTableCell = // | { @@ -38,11 +40,13 @@ export interface MetaBindTableRow { type T = Record[]; +type TableComponent = SvelteComponent; + export class TableMountable extends FieldMountable { bindTarget: BindTargetDeclaration; tableHead: string[]; columns: MetaBindColumnDeclaration[]; - tableComponent: MetaBindTableComponent | undefined; + tableComponent: ReturnType | undefined; private metadataManagerOutputSignalListener: Listener | undefined; @@ -157,7 +161,6 @@ export class TableMountable extends FieldMountable { } } - // eslint-disable-next-line @typescript-eslint/no-unsafe-call this.tableComponent?.updateTable(tableRows); } @@ -183,7 +186,7 @@ export class TableMountable extends FieldMountable { protected onMount(targetEl: HTMLElement): void { super.onMount(targetEl); - this.tableComponent = new MetaBindTableComponent({ + this.tableComponent = mount(MetaBindTableComponent as unknown as TableComponent, { target: targetEl, props: { table: this, @@ -205,7 +208,9 @@ export class TableMountable extends FieldMountable { super.onUnmount(targetEl); this.unregisterSelfFromMetadataManager(); - this.tableComponent?.$destroy(); + if (this.tableComponent) { + unmount(this.tableComponent); + } showUnloadedMessage(targetEl, 'table'); } diff --git a/packages/core/src/utils/errors/ErrorIndicatorComponent.svelte b/packages/core/src/utils/errors/ErrorIndicatorComponent.svelte index 6c8fd8cf..409e46b6 100644 --- a/packages/core/src/utils/errors/ErrorIndicatorComponent.svelte +++ b/packages/core/src/utils/errors/ErrorIndicatorComponent.svelte @@ -1,6 +1,7 @@