@happyvertical/smrt-svelte 0.53.1 → 0.53.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +15 -15
- package/dist/__tests__/app-state.test.js +0 -156
- package/dist/__tests__/data-surface-bridge.test.js +0 -351
- package/dist/__tests__/provider-mode-harness.svelte +0 -14
- package/dist/__tests__/provider-mode-harness.svelte.d.ts +0 -11
- package/dist/__tests__/provider-mode-harness.svelte.d.ts.map +0 -1
- package/dist/__tests__/provider-mode-probe.svelte +0 -13
- package/dist/__tests__/provider-mode-probe.svelte.d.ts +0 -8
- package/dist/__tests__/provider-mode-probe.svelte.d.ts.map +0 -1
- package/dist/__tests__/provider-webmcp-harness.svelte +0 -14
- package/dist/__tests__/provider-webmcp-harness.svelte.d.ts +0 -8
- package/dist/__tests__/provider-webmcp-harness.svelte.d.ts.map +0 -1
- package/dist/__tests__/success-never-text.test.js +0 -100
- package/dist/__tests__/warm-clients.test.js +0 -186
- package/dist/browser-ai/adapters/llm/bitgpu-inference-backend.test.js +0 -464
- package/dist/browser-ai/adapters/llm/webllm-inference-backend.test.js +0 -646
- package/dist/browser-ai/adapters/stt/browser-speech.test.js +0 -113
- package/dist/browser-ai/adapters/stt/dictation-source.test.js +0 -52
- package/dist/browser-ai/svelte/components/__tests__/ModelStatusControl.test.js +0 -172
- package/dist/components/board/__tests__/Board.test.js +0 -498
- package/dist/components/board/__tests__/BoardSsrHarness.svelte +0 -30
- package/dist/components/board/__tests__/BoardSsrHarness.svelte.d.ts +0 -19
- package/dist/components/board/__tests__/BoardSsrHarness.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/AddressInput.behavior.test.js +0 -216
- package/dist/components/forms/__tests__/CheckboxInput.test.js +0 -92
- package/dist/components/forms/__tests__/DateRangeInput.behavior.test.js +0 -135
- package/dist/components/forms/__tests__/DateTimeInput.behavior.test.js +0 -113
- package/dist/components/forms/__tests__/FileUpload.error-alert.test.js +0 -37
- package/dist/components/forms/__tests__/FileUpload.native-form.test.js +0 -249
- package/dist/components/forms/__tests__/FileUpload.test.js +0 -90
- package/dist/components/forms/__tests__/FileUploadReset.fixture.svelte +0 -24
- package/dist/components/forms/__tests__/FileUploadReset.fixture.svelte.d.ts +0 -10
- package/dist/components/forms/__tests__/FileUploadReset.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/Form.behavior.test.js +0 -137
- package/dist/components/forms/__tests__/Form.extraction.test.js +0 -68
- package/dist/components/forms/__tests__/Form.stt-error.test.js +0 -57
- package/dist/components/forms/__tests__/Form.test.js +0 -86
- package/dist/components/forms/__tests__/Form.ui-controls.test.js +0 -119
- package/dist/components/forms/__tests__/Form.webmcp.test.js +0 -2336
- package/dist/components/forms/__tests__/FormMicButton.test.js +0 -92
- package/dist/components/forms/__tests__/FormScope.test.js +0 -39
- package/dist/components/forms/__tests__/MeasurementInput.behavior.test.js +0 -129
- package/dist/components/forms/__tests__/MoneyInput.behavior.test.js +0 -124
- package/dist/components/forms/__tests__/NumberInput.behavior.test.js +0 -151
- package/dist/components/forms/__tests__/PhoneInput.behavior.test.js +0 -96
- package/dist/components/forms/__tests__/SearchInput.test.js +0 -79
- package/dist/components/forms/__tests__/SelectInput.behavior.test.js +0 -132
- package/dist/components/forms/__tests__/TextInput.behavior.test.js +0 -131
- package/dist/components/forms/__tests__/TextareaInput.behavior.test.js +0 -96
- package/dist/components/forms/__tests__/async-invalid-field.fixture.svelte +0 -30
- package/dist/components/forms/__tests__/async-invalid-field.fixture.svelte.d.ts +0 -7
- package/dist/components/forms/__tests__/async-invalid-field.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/async-validation-form.fixture.svelte +0 -19
- package/dist/components/forms/__tests__/async-validation-form.fixture.svelte.d.ts +0 -9
- package/dist/components/forms/__tests__/async-validation-form.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/async-validation-snapshot-form.fixture.svelte +0 -21
- package/dist/components/forms/__tests__/async-validation-snapshot-form.fixture.svelte.d.ts +0 -8
- package/dist/components/forms/__tests__/async-validation-snapshot-form.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/composite-inputs-a11y.test.js +0 -69
- package/dist/components/forms/__tests__/compound-registration-wrapper.fixture.svelte +0 -27
- package/dist/components/forms/__tests__/compound-registration-wrapper.fixture.svelte.d.ts +0 -9
- package/dist/components/forms/__tests__/compound-registration-wrapper.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/custom-registration-field.fixture.svelte +0 -48
- package/dist/components/forms/__tests__/custom-registration-field.fixture.svelte.d.ts +0 -10
- package/dist/components/forms/__tests__/custom-registration-field.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/form-extraction-values.fixture.svelte +0 -26
- package/dist/components/forms/__tests__/form-extraction-values.fixture.svelte.d.ts +0 -13
- package/dist/components/forms/__tests__/form-extraction-values.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/form-registration-lifecycle.fixture.svelte +0 -52
- package/dist/components/forms/__tests__/form-registration-lifecycle.fixture.svelte.d.ts +0 -16
- package/dist/components/forms/__tests__/form-registration-lifecycle.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/form-scope.fixture.svelte +0 -30
- package/dist/components/forms/__tests__/form-scope.fixture.svelte.d.ts +0 -10
- package/dist/components/forms/__tests__/form-scope.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/form-with-fields.fixture.svelte +0 -158
- package/dist/components/forms/__tests__/form-with-fields.fixture.svelte.d.ts +0 -51
- package/dist/components/forms/__tests__/form-with-fields.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/form-with-policy-field.fixture.svelte +0 -24
- package/dist/components/forms/__tests__/form-with-policy-field.fixture.svelte.d.ts +0 -11
- package/dist/components/forms/__tests__/form-with-policy-field.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/form-with-structured-fields.fixture.svelte +0 -105
- package/dist/components/forms/__tests__/form-with-structured-fields.fixture.svelte.d.ts +0 -42
- package/dist/components/forms/__tests__/form-with-structured-fields.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/form-with-ui-controls.fixture.svelte +0 -84
- package/dist/components/forms/__tests__/form-with-ui-controls.fixture.svelte.d.ts +0 -14
- package/dist/components/forms/__tests__/form-with-ui-controls.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/legacy-form-context.fixture.svelte +0 -44
- package/dist/components/forms/__tests__/legacy-form-context.fixture.svelte.d.ts +0 -9
- package/dist/components/forms/__tests__/legacy-form-context.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/mic-keyboard-a11y.test.js +0 -74
- package/dist/components/forms/__tests__/policy-field.fixture.svelte +0 -35
- package/dist/components/forms/__tests__/policy-field.fixture.svelte.d.ts +0 -8
- package/dist/components/forms/__tests__/policy-field.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/rich-inputs-a11y.test.js +0 -87
- package/dist/components/settings/__tests__/SettingsCatalog.test.js +0 -69
- package/dist/components/settings/__tests__/catalog.test.js +0 -46
- package/dist/components/workspace/__tests__/AdminShell.responsive.test.js +0 -597
- package/dist/components/workspace/__tests__/AdminShell.test.js +0 -572
- package/dist/components/workspace/__tests__/RoleShell.test.js +0 -772
- package/dist/components/workspace/__tests__/TenantNav.test.js +0 -208
- package/dist/components/workspace/__tests__/WorkspaceAccountMenu.test.js +0 -79
- package/dist/components/workspace/__tests__/WorkspaceShell.test.js +0 -630
- package/dist/components/workspace/__tests__/admin-shell-header-overflow.test.js +0 -25
- package/dist/components/workspace/__tests__/admin-shell-hotkeys.test.js +0 -34
- package/dist/components/workspace/__tests__/admin-shell-mobile.test.js +0 -217
- package/dist/components/workspace/__tests__/admin-shell-mutation-effect-harness.svelte +0 -52
- package/dist/components/workspace/__tests__/admin-shell-mutation-effect-harness.svelte.d.ts +0 -23
- package/dist/components/workspace/__tests__/admin-shell-mutation-effect-harness.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/admin-shell-page-contracts.test.js +0 -30
- package/dist/components/workspace/__tests__/admin-shell-responsive-state.test.js +0 -184
- package/dist/components/workspace/__tests__/admin-shell-settings.test.js +0 -25
- package/dist/components/workspace/__tests__/admin-shell-state.test.js +0 -286
- package/dist/components/workspace/__tests__/admin-shell-theme-hooks.test.js +0 -36
- package/dist/components/workspace/__tests__/breadcrumbs-helpers.test.js +0 -141
- package/dist/components/workspace/__tests__/context-forwarding-harness.svelte +0 -45
- package/dist/components/workspace/__tests__/context-forwarding-harness.svelte.d.ts +0 -21
- package/dist/components/workspace/__tests__/context-forwarding-harness.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/define-tools-dock.test.js +0 -1188
- package/dist/components/workspace/__tests__/harness.svelte +0 -25
- package/dist/components/workspace/__tests__/harness.svelte.d.ts +0 -14
- package/dist/components/workspace/__tests__/harness.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/index.test.js +0 -28
- package/dist/components/workspace/__tests__/legacy-index.test.js +0 -9
- package/dist/components/workspace/__tests__/manifest-nav-helpers.test.js +0 -24
- package/dist/components/workspace/__tests__/manifest-nav.test.js +0 -599
- package/dist/components/workspace/__tests__/nav-helpers.test.js +0 -95
- package/dist/components/workspace/__tests__/render-harness.svelte +0 -66
- package/dist/components/workspace/__tests__/render-harness.svelte.d.ts +0 -32
- package/dist/components/workspace/__tests__/render-harness.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/render-tools-dock.test.js +0 -260
- package/dist/components/workspace/__tests__/role-shell-bind-harness.svelte +0 -58
- package/dist/components/workspace/__tests__/role-shell-bind-harness.svelte.d.ts +0 -16
- package/dist/components/workspace/__tests__/role-shell-bind-harness.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/role-shell-switch-harness.svelte +0 -41
- package/dist/components/workspace/__tests__/role-shell-switch-harness.svelte.d.ts +0 -13
- package/dist/components/workspace/__tests__/role-shell-switch-harness.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/shell-chrome-components.test.js +0 -108
- package/dist/components/workspace/__tests__/system-feed.test.js +0 -327
- package/dist/components/workspace/__tests__/test-icon.svelte +0 -17
- package/dist/components/workspace/__tests__/test-icon.svelte.d.ts +0 -19
- package/dist/components/workspace/__tests__/test-icon.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/typed-tool-fixture/TypedTool.svelte +0 -38
- package/dist/components/workspace/__tests__/typed-tool-fixture/TypedTool.svelte.d.ts +0 -22
- package/dist/components/workspace/__tests__/typed-tool-fixture/TypedTool.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/typed-tool-fixture/register-typed-tool.d.ts +0 -66
- package/dist/components/workspace/__tests__/typed-tool-fixture/register-typed-tool.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/typed-tool-fixture/register-typed-tool.js +0 -115
- package/dist/components/workspace/__tests__/typed-tool-fixture/typed-tool-types.d.ts +0 -15
- package/dist/components/workspace/__tests__/typed-tool-fixture/typed-tool-types.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/typed-tool-fixture/typed-tool-types.js +0 -7
- package/dist/components/workspace/__tests__/typed-tool-fixture.test.js +0 -115
- package/dist/components/workspace/__tests__/use-harness-orphan.svelte +0 -9
- package/dist/components/workspace/__tests__/use-harness-orphan.svelte.d.ts +0 -19
- package/dist/components/workspace/__tests__/use-harness-orphan.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/use-harness.svelte +0 -23
- package/dist/components/workspace/__tests__/use-harness.svelte.d.ts +0 -8
- package/dist/components/workspace/__tests__/use-harness.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/use-tools-dock.test.js +0 -33
- package/dist/components/workspace/__tests__/workspace-shell-bind-harness.svelte +0 -43
- package/dist/components/workspace/__tests__/workspace-shell-bind-harness.svelte.d.ts +0 -11
- package/dist/components/workspace/__tests__/workspace-shell-bind-harness.svelte.d.ts.map +0 -1
- package/dist/components/workspace/server/__tests__/compose-availability.test.js +0 -383
- package/dist/components/workspace/server/__tests__/typed-context-fixture.d.ts +0 -78
- package/dist/components/workspace/server/__tests__/typed-context-fixture.d.ts.map +0 -1
- package/dist/components/workspace/server/__tests__/typed-context-fixture.js +0 -104
- package/dist/hooks/__tests__/stt-consumer.fixture.svelte +0 -25
- package/dist/hooks/__tests__/stt-consumer.fixture.svelte.d.ts +0 -15
- package/dist/hooks/__tests__/stt-consumer.fixture.svelte.d.ts.map +0 -1
- package/dist/hooks/__tests__/stt-ownership-harness.svelte +0 -42
- package/dist/hooks/__tests__/stt-ownership-harness.svelte.d.ts +0 -20
- package/dist/hooks/__tests__/stt-ownership-harness.svelte.d.ts.map +0 -1
- package/dist/hooks/__tests__/useSTT-ownership.test.js +0 -102
- package/dist/i18n/__tests__/server.spec.js +0 -57
- package/dist/internal/logger.test.js +0 -54
- package/dist/provider-mode.test.js +0 -86
- package/dist/provider-webmcp.test.js +0 -244
- package/dist/state/__tests__/app-state-ai-lifecycle.test.js +0 -240
- package/dist/state/__tests__/warm-clients.test.js +0 -40
- package/dist/web/__tests__/activity-feed-harness.svelte +0 -32
- package/dist/web/__tests__/activity-feed-harness.svelte.d.ts +0 -18
- package/dist/web/__tests__/activity-feed-harness.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/activity-feed.integration.svelte.test.js +0 -190
- package/dist/web/__tests__/activity-feed.svelte.test.js +0 -235
- package/dist/web/__tests__/assistant-dock.integration.svelte.test.js +0 -204
- package/dist/web/__tests__/data-surface-conformance.integration.svelte.test.js +0 -1392
- package/dist/web/__tests__/harness.svelte +0 -25
- package/dist/web/__tests__/harness.svelte.d.ts +0 -15
- package/dist/web/__tests__/harness.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/list-data-surface.fixture.svelte +0 -59
- package/dist/web/__tests__/list-data-surface.fixture.svelte.d.ts +0 -14
- package/dist/web/__tests__/list-data-surface.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/list-data-surface.svelte.test.js +0 -106
- package/dist/web/__tests__/list-data-surface.test.js +0 -651
- package/dist/web/__tests__/list-sort-surface.fixture.svelte +0 -41
- package/dist/web/__tests__/list-sort-surface.fixture.svelte.d.ts +0 -15
- package/dist/web/__tests__/list-sort-surface.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/list-sort-surface.svelte.test.js +0 -59
- package/dist/web/__tests__/live-collection.svelte.test.js +0 -185
- package/dist/web/__tests__/provider-ui-registry.fixture.svelte +0 -43
- package/dist/web/__tests__/provider-ui-registry.fixture.svelte.d.ts +0 -13
- package/dist/web/__tests__/provider-ui-registry.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/provider-ui-registry.test.js +0 -235
- package/dist/web/__tests__/remote-query-harness.svelte +0 -27
- package/dist/web/__tests__/remote-query-harness.svelte.d.ts +0 -11
- package/dist/web/__tests__/remote-query-harness.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/remote-query.svelte.test.js +0 -101
- package/dist/web/__tests__/surfaces.child.fixture.svelte +0 -69
- package/dist/web/__tests__/surfaces.child.fixture.svelte.d.ts +0 -16
- package/dist/web/__tests__/surfaces.child.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/surfaces.fixture.svelte +0 -26
- package/dist/web/__tests__/surfaces.fixture.svelte.d.ts +0 -18
- package/dist/web/__tests__/surfaces.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/surfaces.svelte.test.js +0 -140
- package/dist/web/__tests__/update-available-harness.svelte +0 -46
- package/dist/web/__tests__/update-available-harness.svelte.d.ts +0 -22
- package/dist/web/__tests__/update-available-harness.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/update-available.svelte.test.js +0 -137
- package/dist/web/__tests__/view-intent-provider.fixture.svelte +0 -28
- package/dist/web/__tests__/view-intent-provider.fixture.svelte.d.ts +0 -13
- package/dist/web/__tests__/view-intent-provider.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/view-intent.fixture.svelte +0 -33
- package/dist/web/__tests__/view-intent.fixture.svelte.d.ts +0 -15
- package/dist/web/__tests__/view-intent.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/view-intent.intents.d.ts +0 -14
- package/dist/web/__tests__/view-intent.intents.d.ts.map +0 -1
- package/dist/web/__tests__/view-intent.intents.js +0 -38
- package/dist/web/__tests__/view-intent.svelte.test.js +0 -244
- package/dist/web/__tests__/webmcp-composed.child.fixture.svelte +0 -73
- package/dist/web/__tests__/webmcp-composed.child.fixture.svelte.d.ts +0 -8
- package/dist/web/__tests__/webmcp-composed.child.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/webmcp-composed.fixture.svelte +0 -52
- package/dist/web/__tests__/webmcp-composed.fixture.svelte.d.ts +0 -12
- package/dist/web/__tests__/webmcp-composed.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/webmcp-composed.integration.svelte.test.js +0 -251
- package/dist/web/__tests__/webmcp-effects-reactivity.child.fixture.svelte +0 -16
- package/dist/web/__tests__/webmcp-effects-reactivity.child.fixture.svelte.d.ts +0 -19
- package/dist/web/__tests__/webmcp-effects-reactivity.child.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/webmcp-effects-reactivity.fixture.svelte +0 -11
- package/dist/web/__tests__/webmcp-effects-reactivity.fixture.svelte.d.ts +0 -8
- package/dist/web/__tests__/webmcp-effects-reactivity.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/webmcp-harness-reactive-samename.svelte +0 -20
- package/dist/web/__tests__/webmcp-harness-reactive-samename.svelte.d.ts +0 -7
- package/dist/web/__tests__/webmcp-harness-reactive-samename.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/webmcp-harness-unannotated.svelte +0 -14
- package/dist/web/__tests__/webmcp-harness-unannotated.svelte.d.ts +0 -19
- package/dist/web/__tests__/webmcp-harness-unannotated.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/webmcp-harness.svelte +0 -18
- package/dist/web/__tests__/webmcp-harness.svelte.d.ts +0 -7
- package/dist/web/__tests__/webmcp-harness.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/webmcp-ssr.fixture.svelte +0 -13
- package/dist/web/__tests__/webmcp-ssr.fixture.svelte.d.ts +0 -19
- package/dist/web/__tests__/webmcp-ssr.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/webmcp-ui.test.js +0 -723
- package/dist/web/__tests__/webmcp.test.js +0 -234
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { DataSurfaceRegistry, ListSort } from '@happyvertical/smrt-ui/data';
|
|
2
|
-
type $$ComponentProps = {
|
|
3
|
-
registry: DataSurfaceRegistry;
|
|
4
|
-
rows: Array<{
|
|
5
|
-
id: string;
|
|
6
|
-
title: string;
|
|
7
|
-
published: string;
|
|
8
|
-
}>;
|
|
9
|
-
sort?: ListSort;
|
|
10
|
-
deny?: boolean;
|
|
11
|
-
};
|
|
12
|
-
declare const ListSortSurface: import("svelte").Component<$$ComponentProps, {}, "sort">;
|
|
13
|
-
type ListSortSurface = ReturnType<typeof ListSortSurface>;
|
|
14
|
-
export default ListSortSurface;
|
|
15
|
-
//# sourceMappingURL=list-sort-surface.fixture.svelte.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-sort-surface.fixture.svelte.d.ts","sourceRoot":"","sources":["../../../src/web/__tests__/list-sort-surface.fixture.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,mBAAmB,EACnB,QAAQ,EACT,MAAM,6BAA6B,CAAC;AAGpC,KAAK,gBAAgB,GAAI;IACxB,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,IAAI,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9D,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAqCF,QAAA,MAAM,eAAe,0DAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { createDataSurfaceRegistry } from '@happyvertical/smrt-ui/data';
|
|
2
|
-
import { render, screen } from '@testing-library/svelte';
|
|
3
|
-
import { tick } from 'svelte';
|
|
4
|
-
import { describe, expect, it } from 'vitest';
|
|
5
|
-
import Fixture from './list-sort-surface.fixture.svelte';
|
|
6
|
-
const rows = [
|
|
7
|
-
{ id: 's1', title: 'Budget passes', published: '2026-09-01' },
|
|
8
|
-
{ id: 's2', title: 'Arena opens', published: '2026-09-20' },
|
|
9
|
-
];
|
|
10
|
-
const identity = { surfaceId: 'stories-ui', kind: 'list' };
|
|
11
|
-
let sequence = 0;
|
|
12
|
-
function setSorting(expectedRevision, sorting) {
|
|
13
|
-
sequence += 1;
|
|
14
|
-
return {
|
|
15
|
-
version: 1,
|
|
16
|
-
commandId: `sort-${sequence}`,
|
|
17
|
-
identity,
|
|
18
|
-
expectedRevision,
|
|
19
|
-
controlId: 'set-sorting',
|
|
20
|
-
payload: { sorting },
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
describe('useListSurface sorting', () => {
|
|
24
|
-
it('reports the page sort and applies an agent sort through onSort', async () => {
|
|
25
|
-
const registry = createDataSurfaceRegistry();
|
|
26
|
-
render(Fixture, { props: { registry, rows } });
|
|
27
|
-
await tick();
|
|
28
|
-
const before = registry.inspect(identity);
|
|
29
|
-
expect([...(before?.descriptor.query.sortableColumnIds ?? [])].sort()).toEqual(['published', 'title']);
|
|
30
|
-
expect(before?.descriptor.controls.map((control) => control.id)).toContain('set-sorting');
|
|
31
|
-
expect(before?.state.sort).toEqual({
|
|
32
|
-
columnId: 'published',
|
|
33
|
-
direction: 'desc',
|
|
34
|
-
});
|
|
35
|
-
const result = await registry.execute(setSorting(before?.revision ?? 0, [
|
|
36
|
-
{ columnId: 'title', direction: 'asc' },
|
|
37
|
-
]));
|
|
38
|
-
expect(result.ok).toBe(true);
|
|
39
|
-
await tick();
|
|
40
|
-
expect(screen.getByTestId('sort').textContent).toBe('title:asc');
|
|
41
|
-
expect(registry.inspect(identity)?.state.sort).toEqual({
|
|
42
|
-
columnId: 'title',
|
|
43
|
-
direction: 'asc',
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
it('refuses unsortable columns, multiple rules, and a denied onSort', async () => {
|
|
47
|
-
const registry = createDataSurfaceRegistry();
|
|
48
|
-
render(Fixture, { props: { registry, rows, deny: true } });
|
|
49
|
-
await tick();
|
|
50
|
-
const revision = () => registry.inspect(identity)?.revision ?? 0;
|
|
51
|
-
expect((await registry.execute(setSorting(revision(), [{ columnId: 'id', direction: 'asc' }]))).ok).toBe(false);
|
|
52
|
-
expect((await registry.execute(setSorting(revision(), [
|
|
53
|
-
{ columnId: 'title', direction: 'asc' },
|
|
54
|
-
{ columnId: 'published', direction: 'desc' },
|
|
55
|
-
]))).ok).toBe(false);
|
|
56
|
-
expect((await registry.execute(setSorting(revision(), [{ columnId: 'title', direction: 'asc' }]))).ok).toBe(false);
|
|
57
|
-
expect(screen.getByTestId('sort').textContent).toBe('published:desc');
|
|
58
|
-
});
|
|
59
|
-
});
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Behavior tests for the Svelte 5 live-query binding over `@happyvertical/smrt-web`
|
|
3
|
-
* (#1761, slice A).
|
|
4
|
-
*
|
|
5
|
-
* Per repo policy only the network boundary is mocked: the generated REST
|
|
6
|
-
* client fetchers passed to `createSmrtCollection`. Everything else — the
|
|
7
|
-
* client-data engine collection, the real `useLiveQuery` live view, its
|
|
8
|
-
* transactions, and the runes reactivity — is real. The binding is exercised
|
|
9
|
-
* through a thin host component (`harness.svelte`) so `useLiveQuery`'s internal
|
|
10
|
-
* `$effect` has a genuine component-init scope, matching this package's other
|
|
11
|
-
* runes-composable tests.
|
|
12
|
-
*/
|
|
13
|
-
import { createSmrtCollection, } from '@happyvertical/smrt-web';
|
|
14
|
-
import { flushSync, mount, unmount } from 'svelte';
|
|
15
|
-
import { afterEach, describe, expect, it } from 'vitest';
|
|
16
|
-
import Harness from './harness.svelte';
|
|
17
|
-
function productDefinition(name) {
|
|
18
|
-
return {
|
|
19
|
-
name,
|
|
20
|
-
objectRef: '@test/smrt-svelte:Product',
|
|
21
|
-
className: 'Product',
|
|
22
|
-
endpoint: `/${name}`,
|
|
23
|
-
idField: 'id',
|
|
24
|
-
actions: ['create', 'get', 'list', 'update'],
|
|
25
|
-
fields: {
|
|
26
|
-
name: { type: 'text', required: true },
|
|
27
|
-
price: { type: 'decimal' },
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Scripted stand-in for `createClient('/api/v1').products`: resolves like the
|
|
33
|
-
* generated fetchers (JSON payloads, `{ error }` bodies on failure, never
|
|
34
|
-
* rejects on HTTP status) so the engine's optimistic/rollback path is real.
|
|
35
|
-
*/
|
|
36
|
-
function makeScriptedFetchers(initialRows) {
|
|
37
|
-
const serverRows = [...initialRows];
|
|
38
|
-
let failNextCreate = null;
|
|
39
|
-
const fetchers = {
|
|
40
|
-
list: async () => serverRows.map((row) => ({ ...row })),
|
|
41
|
-
create: async (data) => {
|
|
42
|
-
if (failNextCreate) {
|
|
43
|
-
const error = failNextCreate;
|
|
44
|
-
failNextCreate = null;
|
|
45
|
-
return { error };
|
|
46
|
-
}
|
|
47
|
-
const created = { ...data, id: `server-${serverRows.length + 1}` };
|
|
48
|
-
serverRows.push(created);
|
|
49
|
-
return { ...created };
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
return {
|
|
53
|
-
fetchers,
|
|
54
|
-
failCreateWith(message) {
|
|
55
|
-
failNextCreate = message;
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
function mountView(handle) {
|
|
60
|
-
const target = document.createElement('div');
|
|
61
|
-
document.body.appendChild(target);
|
|
62
|
-
let exposed = undefined;
|
|
63
|
-
const component = mount(Harness, {
|
|
64
|
-
target,
|
|
65
|
-
props: {
|
|
66
|
-
// The harness is typed against the base object shape; ProductData is a
|
|
67
|
-
// structural subtype, so this cross-cast is purely nominal.
|
|
68
|
-
handle: handle,
|
|
69
|
-
onReady: (view) => {
|
|
70
|
-
exposed = view;
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
});
|
|
74
|
-
return {
|
|
75
|
-
view: exposed,
|
|
76
|
-
teardown: () => {
|
|
77
|
-
unmount(component);
|
|
78
|
-
target.remove();
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
describe('liveCollection', () => {
|
|
83
|
-
const cleanup = [];
|
|
84
|
-
afterEach(async () => {
|
|
85
|
-
for (const fn of cleanup.splice(0))
|
|
86
|
-
fn();
|
|
87
|
-
});
|
|
88
|
-
function track(mounted) {
|
|
89
|
-
cleanup.push(mounted.teardown);
|
|
90
|
-
return mounted.view;
|
|
91
|
-
}
|
|
92
|
-
it('exposes live rows that reflect the collection as plain DTOs (no $-prefixed keys)', async () => {
|
|
93
|
-
const scripted = makeScriptedFetchers([
|
|
94
|
-
{ id: 'p1', name: 'Widget', price: 9.99 },
|
|
95
|
-
]);
|
|
96
|
-
const collection = createSmrtCollection(productDefinition('live-dto'), {
|
|
97
|
-
fetchers: scripted.fetchers,
|
|
98
|
-
staleTimeMs: 60_000,
|
|
99
|
-
});
|
|
100
|
-
const view = track(mountView(collection));
|
|
101
|
-
await collection.preload();
|
|
102
|
-
flushSync();
|
|
103
|
-
expect(view.isReady).toBe(true);
|
|
104
|
-
expect(view.status).toBe('ready');
|
|
105
|
-
expect(view.rows).toHaveLength(1);
|
|
106
|
-
const [row] = view.rows;
|
|
107
|
-
// Exact equality (not toMatchObject): must be a plain DTO — no
|
|
108
|
-
// $synced/$origin/$key/$collectionId leaking through the engine live view.
|
|
109
|
-
expect(row).toEqual({ id: 'p1', name: 'Widget', price: 9.99 });
|
|
110
|
-
expect(Object.keys(row).some((key) => key.startsWith('$'))).toBe(false);
|
|
111
|
-
expect(JSON.stringify(row)).not.toContain('$');
|
|
112
|
-
});
|
|
113
|
-
it('reports loading before the first read resolves', () => {
|
|
114
|
-
const scripted = makeScriptedFetchers([{ id: 'p1', name: 'Widget' }]);
|
|
115
|
-
const collection = createSmrtCollection(productDefinition('live-loading'), {
|
|
116
|
-
fetchers: scripted.fetchers,
|
|
117
|
-
staleTimeMs: 60_000,
|
|
118
|
-
// Do not eagerly preload — observe the initial loading status.
|
|
119
|
-
});
|
|
120
|
-
const view = track(mountView(collection));
|
|
121
|
-
flushSync();
|
|
122
|
-
expect(view.isLoading).toBe(true);
|
|
123
|
-
expect(view.status).toBe('loading');
|
|
124
|
-
expect(view.error).toBeNull();
|
|
125
|
-
});
|
|
126
|
-
it('reflects an optimistic insert reactively and settles its pending state', async () => {
|
|
127
|
-
const scripted = makeScriptedFetchers([{ id: 'p1', name: 'Widget' }]);
|
|
128
|
-
const collection = createSmrtCollection(productDefinition('live-insert'), {
|
|
129
|
-
fetchers: scripted.fetchers,
|
|
130
|
-
staleTimeMs: 60_000,
|
|
131
|
-
});
|
|
132
|
-
const view = track(mountView(collection));
|
|
133
|
-
await collection.preload();
|
|
134
|
-
flushSync();
|
|
135
|
-
expect(view.rows).toHaveLength(1);
|
|
136
|
-
const mutation = view.insert({
|
|
137
|
-
id: 'local-1',
|
|
138
|
-
name: 'Gadget',
|
|
139
|
-
price: 19.99,
|
|
140
|
-
});
|
|
141
|
-
flushSync();
|
|
142
|
-
// Optimistic row is visible in the live rows synchronously, and pending.
|
|
143
|
-
expect(view.rows.map((row) => row.name).sort()).toEqual([
|
|
144
|
-
'Gadget',
|
|
145
|
-
'Widget',
|
|
146
|
-
]);
|
|
147
|
-
expect(mutation.pending).toBe(true);
|
|
148
|
-
expect(mutation.settled).toBe(false);
|
|
149
|
-
await mutation.done;
|
|
150
|
-
flushSync();
|
|
151
|
-
// Persisted: pending cleared, no error, and the server-assigned row is in.
|
|
152
|
-
expect(mutation.pending).toBe(false);
|
|
153
|
-
expect(mutation.settled).toBe(true);
|
|
154
|
-
expect(mutation.error).toBeNull();
|
|
155
|
-
const gadget = view.rows.find((row) => row.name === 'Gadget');
|
|
156
|
-
expect(gadget?.id).toBe('server-2');
|
|
157
|
-
// Still plain DTOs after the mutation reconciles.
|
|
158
|
-
expect(Object.keys(gadget ?? {}).some((key) => key.startsWith('$'))).toBe(false);
|
|
159
|
-
});
|
|
160
|
-
it('rolls the optimistic row back and surfaces the error when the create fails', async () => {
|
|
161
|
-
const scripted = makeScriptedFetchers([{ id: 'p1', name: 'Widget' }]);
|
|
162
|
-
const collection = createSmrtCollection(productDefinition('live-rollback'), {
|
|
163
|
-
fetchers: scripted.fetchers,
|
|
164
|
-
staleTimeMs: 60_000,
|
|
165
|
-
});
|
|
166
|
-
const view = track(mountView(collection));
|
|
167
|
-
await collection.preload();
|
|
168
|
-
flushSync();
|
|
169
|
-
scripted.failCreateWith('Validation failed: name is reserved');
|
|
170
|
-
const mutation = view.insert({ id: 'local-2', name: 'FAIL Gadget' });
|
|
171
|
-
flushSync();
|
|
172
|
-
expect(view.rows.some((row) => row.name === 'FAIL Gadget')).toBe(true);
|
|
173
|
-
// `done` resolves (never rejects) on settle — the failure is surfaced only
|
|
174
|
-
// reactively via `error`, so a reactive-only consumer risks no unhandled
|
|
175
|
-
// rejection.
|
|
176
|
-
await expect(mutation.done).resolves.toBeUndefined();
|
|
177
|
-
flushSync();
|
|
178
|
-
// Optimistic state rolled back reactively; the mutation carries the error.
|
|
179
|
-
expect(view.rows.some((row) => row.name === 'FAIL Gadget')).toBe(false);
|
|
180
|
-
expect(view.rows).toHaveLength(1);
|
|
181
|
-
expect(mutation.pending).toBe(false);
|
|
182
|
-
expect(mutation.settled).toBe(true);
|
|
183
|
-
expect(String(mutation.error?.message)).toContain('Validation failed: name is reserved');
|
|
184
|
-
});
|
|
185
|
-
});
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type {
|
|
3
|
-
ControlInteractionEvent,
|
|
4
|
-
ControlInteractionRegistry,
|
|
5
|
-
} from '@happyvertical/smrt-ui/forms';
|
|
6
|
-
import Form from '../../components/forms/Form.svelte';
|
|
7
|
-
import TextInput from '../../components/forms/TextInput.svelte';
|
|
8
|
-
import Provider from '../../Provider.svelte';
|
|
9
|
-
|
|
10
|
-
let {
|
|
11
|
-
providerRegistry,
|
|
12
|
-
explicitRegistry,
|
|
13
|
-
enableUi = true,
|
|
14
|
-
onSharedInteraction,
|
|
15
|
-
onSiblingInteraction,
|
|
16
|
-
showSibling = true,
|
|
17
|
-
}: {
|
|
18
|
-
providerRegistry: ControlInteractionRegistry;
|
|
19
|
-
explicitRegistry: ControlInteractionRegistry;
|
|
20
|
-
enableUi?: boolean;
|
|
21
|
-
onSharedInteraction?: (event: ControlInteractionEvent) => void;
|
|
22
|
-
onSiblingInteraction?: (event: ControlInteractionEvent) => void;
|
|
23
|
-
showSibling?: boolean;
|
|
24
|
-
} = $props();
|
|
25
|
-
</script>
|
|
26
|
-
|
|
27
|
-
<Provider
|
|
28
|
-
webmcp={enableUi
|
|
29
|
-
? { ui: { controlRegistry: providerRegistry } }
|
|
30
|
-
: { definitions: [] }}
|
|
31
|
-
>
|
|
32
|
-
<Form formId="shared-form" oninteraction={onSharedInteraction}>
|
|
33
|
-
<TextInput name="shared-name" label="Shared name" />
|
|
34
|
-
</Form>
|
|
35
|
-
{#if showSibling}
|
|
36
|
-
<Form formId="sibling-form" oninteraction={onSiblingInteraction}>
|
|
37
|
-
<TextInput name="sibling-name" label="Sibling name" />
|
|
38
|
-
</Form>
|
|
39
|
-
{/if}
|
|
40
|
-
<Form formId="explicit-form" interactionRegistry={explicitRegistry}>
|
|
41
|
-
<TextInput name="explicit-name" label="Explicit name" />
|
|
42
|
-
</Form>
|
|
43
|
-
</Provider>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ControlInteractionEvent, ControlInteractionRegistry } from '@happyvertical/smrt-ui/forms';
|
|
2
|
-
type $$ComponentProps = {
|
|
3
|
-
providerRegistry: ControlInteractionRegistry;
|
|
4
|
-
explicitRegistry: ControlInteractionRegistry;
|
|
5
|
-
enableUi?: boolean;
|
|
6
|
-
onSharedInteraction?: (event: ControlInteractionEvent) => void;
|
|
7
|
-
onSiblingInteraction?: (event: ControlInteractionEvent) => void;
|
|
8
|
-
showSibling?: boolean;
|
|
9
|
-
};
|
|
10
|
-
declare const ProviderUiRegistry: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
11
|
-
type ProviderUiRegistry = ReturnType<typeof ProviderUiRegistry>;
|
|
12
|
-
export default ProviderUiRegistry;
|
|
13
|
-
//# sourceMappingURL=provider-ui-registry.fixture.svelte.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provider-ui-registry.fixture.svelte.d.ts","sourceRoot":"","sources":["../../../src/web/__tests__/provider-ui-registry.fixture.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,uBAAuB,EACvB,0BAA0B,EAC3B,MAAM,8BAA8B,CAAC;AAKrC,KAAK,gBAAgB,GAAI;IACxB,gBAAgB,EAAE,0BAA0B,CAAC;IAC7C,gBAAgB,EAAE,0BAA0B,CAAC;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAC/D,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAChE,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAmCF,QAAA,MAAM,kBAAkB,sDAAwC,CAAC;AACjE,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAChE,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
import { createControlInteractionRegistry } from '@happyvertical/smrt-ui/forms';
|
|
2
|
-
import { render } from '@testing-library/svelte';
|
|
3
|
-
import { tick } from 'svelte';
|
|
4
|
-
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
5
|
-
import Fixture from './provider-ui-registry.fixture.svelte';
|
|
6
|
-
afterEach(() => {
|
|
7
|
-
delete document.modelContext;
|
|
8
|
-
});
|
|
9
|
-
describe('Provider WebMCP UI registry context', () => {
|
|
10
|
-
it('aggregates descendant forms while preserving explicit registry overrides', async () => {
|
|
11
|
-
const providerRegistry = createControlInteractionRegistry();
|
|
12
|
-
const explicitRegistry = createControlInteractionRegistry();
|
|
13
|
-
const signals = [];
|
|
14
|
-
const names = [];
|
|
15
|
-
document.modelContext = {
|
|
16
|
-
async registerTool(tool, options) {
|
|
17
|
-
names.push(tool.name);
|
|
18
|
-
if (options?.signal)
|
|
19
|
-
signals.push(options.signal);
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
const view = render(Fixture, {
|
|
23
|
-
props: { providerRegistry, explicitRegistry },
|
|
24
|
-
});
|
|
25
|
-
await tick();
|
|
26
|
-
expect(names).toEqual([
|
|
27
|
-
'smrt_ui_list_form_controls',
|
|
28
|
-
'smrt_ui_inspect_form_control',
|
|
29
|
-
'smrt_ui_execute_form_control',
|
|
30
|
-
'smrt_ui_list_data_surfaces',
|
|
31
|
-
'smrt_ui_inspect_data_surface',
|
|
32
|
-
'smrt_ui_execute_data_surface_control',
|
|
33
|
-
]);
|
|
34
|
-
expect(providerRegistry.list().map((entry) => entry.identity)).toEqual([
|
|
35
|
-
{ formId: 'shared-form', controlId: 'shared-name' },
|
|
36
|
-
{ formId: 'sibling-form', controlId: 'sibling-name' },
|
|
37
|
-
]);
|
|
38
|
-
expect(explicitRegistry.list().map((entry) => entry.identity)).toEqual([
|
|
39
|
-
{ formId: 'explicit-form', controlId: 'explicit-name' },
|
|
40
|
-
]);
|
|
41
|
-
view.unmount();
|
|
42
|
-
expect(providerRegistry.list()).toEqual([]);
|
|
43
|
-
expect(explicitRegistry.list()).toEqual([]);
|
|
44
|
-
expect(signals).toHaveLength(6);
|
|
45
|
-
expect(signals.every((signal) => signal.aborted)).toBe(true);
|
|
46
|
-
});
|
|
47
|
-
it('keeps form interaction callbacks scoped when forms share a Provider registry', async () => {
|
|
48
|
-
const providerRegistry = createControlInteractionRegistry();
|
|
49
|
-
const onSharedInteraction = vi.fn();
|
|
50
|
-
const onSiblingInteraction = vi.fn();
|
|
51
|
-
const view = render(Fixture, {
|
|
52
|
-
props: {
|
|
53
|
-
providerRegistry,
|
|
54
|
-
explicitRegistry: createControlInteractionRegistry(),
|
|
55
|
-
onSharedInteraction,
|
|
56
|
-
onSiblingInteraction,
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
await tick();
|
|
60
|
-
onSharedInteraction.mockClear();
|
|
61
|
-
onSiblingInteraction.mockClear();
|
|
62
|
-
await providerRegistry.execute({
|
|
63
|
-
action: 'stage',
|
|
64
|
-
identity: { formId: 'sibling-form', controlId: 'sibling-name' },
|
|
65
|
-
value: 'private sibling value',
|
|
66
|
-
});
|
|
67
|
-
expect(onSharedInteraction).not.toHaveBeenCalled();
|
|
68
|
-
expect(onSiblingInteraction).toHaveBeenCalled();
|
|
69
|
-
expect(onSiblingInteraction.mock.calls.every(([event]) => event.identity.formId === 'sibling-form')).toBe(true);
|
|
70
|
-
view.unmount();
|
|
71
|
-
});
|
|
72
|
-
it('moves mounted controls when the Provider registry changes', async () => {
|
|
73
|
-
const firstRegistry = createControlInteractionRegistry();
|
|
74
|
-
const secondRegistry = createControlInteractionRegistry();
|
|
75
|
-
const explicitRegistry = createControlInteractionRegistry();
|
|
76
|
-
const view = render(Fixture, {
|
|
77
|
-
props: { providerRegistry: firstRegistry, explicitRegistry },
|
|
78
|
-
});
|
|
79
|
-
await tick();
|
|
80
|
-
expect(firstRegistry.list()).toHaveLength(2);
|
|
81
|
-
await view.rerender({
|
|
82
|
-
providerRegistry: secondRegistry,
|
|
83
|
-
explicitRegistry,
|
|
84
|
-
});
|
|
85
|
-
await tick();
|
|
86
|
-
expect(firstRegistry.list()).toEqual([]);
|
|
87
|
-
expect(secondRegistry.list()).toHaveLength(2);
|
|
88
|
-
view.unmount();
|
|
89
|
-
});
|
|
90
|
-
it('preserves staged sibling state when another field unmounts', async () => {
|
|
91
|
-
const providerRegistry = createControlInteractionRegistry();
|
|
92
|
-
const explicitRegistry = createControlInteractionRegistry();
|
|
93
|
-
const view = render(Fixture, {
|
|
94
|
-
props: { providerRegistry, explicitRegistry },
|
|
95
|
-
});
|
|
96
|
-
await tick();
|
|
97
|
-
await providerRegistry.execute({
|
|
98
|
-
action: 'stage',
|
|
99
|
-
identity: { formId: 'shared-form', controlId: 'shared-name' },
|
|
100
|
-
value: 'keep staged',
|
|
101
|
-
});
|
|
102
|
-
await view.rerender({
|
|
103
|
-
providerRegistry,
|
|
104
|
-
explicitRegistry,
|
|
105
|
-
showSibling: false,
|
|
106
|
-
});
|
|
107
|
-
await tick();
|
|
108
|
-
expect(providerRegistry.get({
|
|
109
|
-
formId: 'shared-form',
|
|
110
|
-
controlId: 'shared-name',
|
|
111
|
-
})?.state.stagedValue).toBe('keep staged');
|
|
112
|
-
view.unmount();
|
|
113
|
-
});
|
|
114
|
-
it('retries a shared identity after the existing registration unmounts', async () => {
|
|
115
|
-
const providerRegistry = createControlInteractionRegistry();
|
|
116
|
-
const unregisterExisting = providerRegistry.register({
|
|
117
|
-
identity: { formId: 'shared-form', controlId: 'shared-name' },
|
|
118
|
-
metadata: { kind: 'text', label: 'Existing' },
|
|
119
|
-
getValue: () => 'existing value',
|
|
120
|
-
});
|
|
121
|
-
const view = render(Fixture, {
|
|
122
|
-
props: {
|
|
123
|
-
providerRegistry,
|
|
124
|
-
explicitRegistry: createControlInteractionRegistry(),
|
|
125
|
-
},
|
|
126
|
-
});
|
|
127
|
-
await tick();
|
|
128
|
-
expect(providerRegistry.get({
|
|
129
|
-
formId: 'shared-form',
|
|
130
|
-
controlId: 'shared-name',
|
|
131
|
-
})?.state.value).toBe('existing value');
|
|
132
|
-
unregisterExisting();
|
|
133
|
-
await tick();
|
|
134
|
-
expect(providerRegistry.get({
|
|
135
|
-
formId: 'shared-form',
|
|
136
|
-
controlId: 'shared-name',
|
|
137
|
-
})?.metadata.label).toBe('Shared name');
|
|
138
|
-
view.unmount();
|
|
139
|
-
expect(providerRegistry.get({
|
|
140
|
-
formId: 'shared-form',
|
|
141
|
-
controlId: 'shared-name',
|
|
142
|
-
})).toBeUndefined();
|
|
143
|
-
});
|
|
144
|
-
it('recovers after its shared identity is displaced and removed', async () => {
|
|
145
|
-
const providerRegistry = createControlInteractionRegistry();
|
|
146
|
-
const view = render(Fixture, {
|
|
147
|
-
props: {
|
|
148
|
-
providerRegistry,
|
|
149
|
-
explicitRegistry: createControlInteractionRegistry(),
|
|
150
|
-
},
|
|
151
|
-
});
|
|
152
|
-
await tick();
|
|
153
|
-
const unregisterReplacement = providerRegistry.register({
|
|
154
|
-
identity: { formId: 'shared-form', controlId: 'shared-name' },
|
|
155
|
-
metadata: { kind: 'text', label: 'Replacement' },
|
|
156
|
-
getValue: () => 'replacement value',
|
|
157
|
-
});
|
|
158
|
-
await tick();
|
|
159
|
-
expect(providerRegistry.get({
|
|
160
|
-
formId: 'shared-form',
|
|
161
|
-
controlId: 'shared-name',
|
|
162
|
-
})?.state.value).toBe('replacement value');
|
|
163
|
-
unregisterReplacement();
|
|
164
|
-
await tick();
|
|
165
|
-
expect(providerRegistry.get({
|
|
166
|
-
formId: 'shared-form',
|
|
167
|
-
controlId: 'shared-name',
|
|
168
|
-
})?.metadata.label).toBe('Shared name');
|
|
169
|
-
view.unmount();
|
|
170
|
-
});
|
|
171
|
-
it('contains duplicate Provider prefixes without crashing the app', async () => {
|
|
172
|
-
const names = [];
|
|
173
|
-
document.modelContext = {
|
|
174
|
-
async registerTool(tool) {
|
|
175
|
-
names.push(tool.name);
|
|
176
|
-
},
|
|
177
|
-
};
|
|
178
|
-
const first = render(Fixture, {
|
|
179
|
-
props: {
|
|
180
|
-
providerRegistry: createControlInteractionRegistry(),
|
|
181
|
-
explicitRegistry: createControlInteractionRegistry(),
|
|
182
|
-
},
|
|
183
|
-
});
|
|
184
|
-
await tick();
|
|
185
|
-
const second = render(Fixture, {
|
|
186
|
-
props: {
|
|
187
|
-
providerRegistry: createControlInteractionRegistry(),
|
|
188
|
-
explicitRegistry: createControlInteractionRegistry(),
|
|
189
|
-
},
|
|
190
|
-
});
|
|
191
|
-
await tick();
|
|
192
|
-
expect(names).toHaveLength(6);
|
|
193
|
-
second.unmount();
|
|
194
|
-
first.unmount();
|
|
195
|
-
});
|
|
196
|
-
it('isolates throwing interaction observers from registry command outcomes', async () => {
|
|
197
|
-
const providerRegistry = createControlInteractionRegistry();
|
|
198
|
-
const view = render(Fixture, {
|
|
199
|
-
props: {
|
|
200
|
-
providerRegistry,
|
|
201
|
-
explicitRegistry: createControlInteractionRegistry(),
|
|
202
|
-
onSiblingInteraction: () => {
|
|
203
|
-
throw new Error('observer failed');
|
|
204
|
-
},
|
|
205
|
-
},
|
|
206
|
-
});
|
|
207
|
-
await tick();
|
|
208
|
-
await expect(providerRegistry.execute({
|
|
209
|
-
action: 'stage',
|
|
210
|
-
identity: { formId: 'sibling-form', controlId: 'sibling-name' },
|
|
211
|
-
value: 'still staged',
|
|
212
|
-
})).resolves.toMatchObject({ ok: true, action: 'stage' });
|
|
213
|
-
view.unmount();
|
|
214
|
-
});
|
|
215
|
-
it('preserves legacy object configs that did not opt into UI tools', async () => {
|
|
216
|
-
const names = [];
|
|
217
|
-
const providerRegistry = createControlInteractionRegistry();
|
|
218
|
-
document.modelContext = {
|
|
219
|
-
async registerTool(tool) {
|
|
220
|
-
names.push(tool.name);
|
|
221
|
-
},
|
|
222
|
-
};
|
|
223
|
-
const view = render(Fixture, {
|
|
224
|
-
props: {
|
|
225
|
-
providerRegistry,
|
|
226
|
-
explicitRegistry: createControlInteractionRegistry(),
|
|
227
|
-
enableUi: false,
|
|
228
|
-
},
|
|
229
|
-
});
|
|
230
|
-
await tick();
|
|
231
|
-
expect(names).toEqual([]);
|
|
232
|
-
expect(providerRegistry.list()).toEqual([]);
|
|
233
|
-
view.unmount();
|
|
234
|
-
});
|
|
235
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type {
|
|
3
|
-
SmrtWebCollection,
|
|
4
|
-
SmrtWebQueryTransport,
|
|
5
|
-
} from '@happyvertical/smrt-web';
|
|
6
|
-
import {
|
|
7
|
-
type RemoteQueryBinding,
|
|
8
|
-
remoteQuery,
|
|
9
|
-
} from '../remote-query.svelte.js';
|
|
10
|
-
|
|
11
|
-
interface Props {
|
|
12
|
-
collection: SmrtWebCollection<Record<string, unknown>>;
|
|
13
|
-
transport: SmrtWebQueryTransport;
|
|
14
|
-
onReady: (view: RemoteQueryBinding<Record<string, unknown>>) => void;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const props: Props = $props();
|
|
18
|
-
// The harness intentionally creates one binding for its component lifetime.
|
|
19
|
-
// svelte-ignore state_referenced_locally
|
|
20
|
-
const view = remoteQuery(props.collection, props.transport);
|
|
21
|
-
// svelte-ignore state_referenced_locally
|
|
22
|
-
props.onReady(view);
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<output data-testid="remote-query-state">
|
|
26
|
-
{view.request?.requestId ?? 'none'}:{view.rows.map((row) => row.id).join(',')}
|
|
27
|
-
</output>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { SmrtWebCollection, SmrtWebQueryTransport } from '@happyvertical/smrt-web';
|
|
2
|
-
import { type RemoteQueryBinding } from '../remote-query.svelte.js';
|
|
3
|
-
interface Props {
|
|
4
|
-
collection: SmrtWebCollection<Record<string, unknown>>;
|
|
5
|
-
transport: SmrtWebQueryTransport;
|
|
6
|
-
onReady: (view: RemoteQueryBinding<Record<string, unknown>>) => void;
|
|
7
|
-
}
|
|
8
|
-
declare const RemoteQueryHarness: import("svelte").Component<Props, {}, "">;
|
|
9
|
-
type RemoteQueryHarness = ReturnType<typeof RemoteQueryHarness>;
|
|
10
|
-
export default RemoteQueryHarness;
|
|
11
|
-
//# sourceMappingURL=remote-query-harness.svelte.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remote-query-harness.svelte.d.ts","sourceRoot":"","sources":["../../../src/web/__tests__/remote-query-harness.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,2BAA2B,CAAC;AAGnC,UAAU,KAAK;IACb,UAAU,EAAE,iBAAiB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACvD,SAAS,EAAE,qBAAqB,CAAC;IACjC,OAAO,EAAE,CAAC,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC;CACtE;AAoBD,QAAA,MAAM,kBAAkB,2CAAwC,CAAC;AACjE,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAChE,eAAe,kBAAkB,CAAC"}
|