@happyvertical/smrt-svelte 0.53.0 → 0.53.2
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,25 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* Test harness — invokes liveCollection() inside a component init scope so the
|
|
4
|
-
* `$effect` that `useLiveQuery` installs wires up correctly, then hands the
|
|
5
|
-
* returned reactive view back to the test via the `onReady` callback prop.
|
|
6
|
-
*/
|
|
7
|
-
import type { SmrtWebCollection } from '@happyvertical/smrt-web';
|
|
8
|
-
import {
|
|
9
|
-
type LiveCollection,
|
|
10
|
-
liveCollection,
|
|
11
|
-
} from '../live-collection.svelte.js';
|
|
12
|
-
|
|
13
|
-
interface Props {
|
|
14
|
-
handle: SmrtWebCollection<Record<string, unknown>>;
|
|
15
|
-
onReady: (view: LiveCollection<Record<string, unknown>>) => void;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const props: Props = $props();
|
|
19
|
-
// This harness intentionally snapshots the handle during setup.
|
|
20
|
-
// svelte-ignore state_referenced_locally
|
|
21
|
-
const view = liveCollection(props.handle);
|
|
22
|
-
// This harness intentionally snapshots the callback during setup.
|
|
23
|
-
// svelte-ignore state_referenced_locally
|
|
24
|
-
props.onReady(view);
|
|
25
|
-
</script>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Test harness — invokes liveCollection() inside a component init scope so the
|
|
3
|
-
* `$effect` that `useLiveQuery` installs wires up correctly, then hands the
|
|
4
|
-
* returned reactive view back to the test via the `onReady` callback prop.
|
|
5
|
-
*/
|
|
6
|
-
import type { SmrtWebCollection } from '@happyvertical/smrt-web';
|
|
7
|
-
import { type LiveCollection } from '../live-collection.svelte.js';
|
|
8
|
-
interface Props {
|
|
9
|
-
handle: SmrtWebCollection<Record<string, unknown>>;
|
|
10
|
-
onReady: (view: LiveCollection<Record<string, unknown>>) => void;
|
|
11
|
-
}
|
|
12
|
-
declare const Harness: import("svelte").Component<Props, {}, "">;
|
|
13
|
-
type Harness = ReturnType<typeof Harness>;
|
|
14
|
-
export default Harness;
|
|
15
|
-
//# sourceMappingURL=harness.svelte.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"harness.svelte.d.ts","sourceRoot":"","sources":["../../../src/web/__tests__/harness.svelte.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,8BAA8B,CAAC;AAGtC,UAAU,KAAK;IACb,MAAM,EAAE,iBAAiB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACnD,OAAO,EAAE,CAAC,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC;CAClE;AAkBD,QAAA,MAAM,OAAO,2CAAwC,CAAC;AACtD,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAC1C,eAAe,OAAO,CAAC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type {
|
|
3
|
-
DataSurfaceDescriptor,
|
|
4
|
-
DataSurfaceRegistry,
|
|
5
|
-
DataTableController,
|
|
6
|
-
} from '@happyvertical/smrt-ui/data';
|
|
7
|
-
import {
|
|
8
|
-
type ListDataSurfaceContext,
|
|
9
|
-
mountListDataSurface,
|
|
10
|
-
} from '../list-data-surface.svelte.js';
|
|
11
|
-
|
|
12
|
-
let {
|
|
13
|
-
registry,
|
|
14
|
-
descriptor,
|
|
15
|
-
controller,
|
|
16
|
-
context,
|
|
17
|
-
onRefresh,
|
|
18
|
-
onStar,
|
|
19
|
-
}: {
|
|
20
|
-
registry: DataSurfaceRegistry;
|
|
21
|
-
descriptor: DataSurfaceDescriptor;
|
|
22
|
-
controller: DataTableController;
|
|
23
|
-
context: ListDataSurfaceContext;
|
|
24
|
-
onRefresh?: () => boolean | Promise<boolean>;
|
|
25
|
-
onStar?: (payload: unknown) => boolean;
|
|
26
|
-
} = $props();
|
|
27
|
-
|
|
28
|
-
let starredCount = $state(0);
|
|
29
|
-
let filterText = $state('');
|
|
30
|
-
|
|
31
|
-
$effect(() => {
|
|
32
|
-
const handle = mountListDataSurface({
|
|
33
|
-
registry,
|
|
34
|
-
descriptor,
|
|
35
|
-
controller,
|
|
36
|
-
context,
|
|
37
|
-
refresh: onRefresh,
|
|
38
|
-
onControl: (controlId, payload) => {
|
|
39
|
-
if (controlId === 'star') {
|
|
40
|
-
starredCount += 1;
|
|
41
|
-
return onStar ? onStar(payload) : true;
|
|
42
|
-
}
|
|
43
|
-
return false;
|
|
44
|
-
},
|
|
45
|
-
});
|
|
46
|
-
const unsubscribe = controller.subscribe(() => {
|
|
47
|
-
filterText = String(controller.getState().filters[0]?.value ?? '');
|
|
48
|
-
});
|
|
49
|
-
return () => {
|
|
50
|
-
unsubscribe();
|
|
51
|
-
handle.destroy();
|
|
52
|
-
};
|
|
53
|
-
});
|
|
54
|
-
</script>
|
|
55
|
-
|
|
56
|
-
<ul data-testid="custom-list">
|
|
57
|
-
<li data-testid="filter-text">{filterText}</li>
|
|
58
|
-
</ul>
|
|
59
|
-
<p data-testid="starred-count">{starredCount}</p>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { DataSurfaceDescriptor, DataSurfaceRegistry, DataTableController } from '@happyvertical/smrt-ui/data';
|
|
2
|
-
import { type ListDataSurfaceContext } from '../list-data-surface.svelte.js';
|
|
3
|
-
type $$ComponentProps = {
|
|
4
|
-
registry: DataSurfaceRegistry;
|
|
5
|
-
descriptor: DataSurfaceDescriptor;
|
|
6
|
-
controller: DataTableController;
|
|
7
|
-
context: ListDataSurfaceContext;
|
|
8
|
-
onRefresh?: () => boolean | Promise<boolean>;
|
|
9
|
-
onStar?: (payload: unknown) => boolean;
|
|
10
|
-
};
|
|
11
|
-
declare const ListDataSurface: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
12
|
-
type ListDataSurface = ReturnType<typeof ListDataSurface>;
|
|
13
|
-
export default ListDataSurface;
|
|
14
|
-
//# sourceMappingURL=list-data-surface.fixture.svelte.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-data-surface.fixture.svelte.d.ts","sourceRoot":"","sources":["../../../src/web/__tests__/list-data-surface.fixture.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,KAAK,sBAAsB,EAE5B,MAAM,gCAAgC,CAAC;AAEvC,KAAK,gBAAgB,GAAI;IACxB,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,UAAU,EAAE,qBAAqB,CAAC;IAClC,UAAU,EAAE,mBAAmB,CAAC;IAChC,OAAO,EAAE,sBAAsB,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC;CACxC,CAAC;AAiDF,QAAA,MAAM,eAAe,sDAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Component-lifecycle proof for `mountListDataSurface` (#2906), in the same
|
|
3
|
-
* conformance style as `data-surface-conformance.integration.svelte.test.ts`:
|
|
4
|
-
* a real Svelte component mounts a custom (non-DataTable) list, the registry
|
|
5
|
-
* drives it with commands, and unmounting the component tears the
|
|
6
|
-
* registration down. The registration/translation logic itself is unit
|
|
7
|
-
* tested directly against the registry in `list-data-surface.test.ts`.
|
|
8
|
-
*/
|
|
9
|
-
import { createDataSurfaceRegistry, createDataTableController, } from '@happyvertical/smrt-ui/data';
|
|
10
|
-
import { render, screen } from '@testing-library/svelte';
|
|
11
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
12
|
-
import Fixture from './list-data-surface.fixture.svelte';
|
|
13
|
-
const identity = {
|
|
14
|
-
surfaceId: 'fixture-list',
|
|
15
|
-
kind: 'list',
|
|
16
|
-
};
|
|
17
|
-
function descriptor() {
|
|
18
|
-
return {
|
|
19
|
-
version: 1,
|
|
20
|
-
identity,
|
|
21
|
-
schemaVersion: 1,
|
|
22
|
-
label: 'Fixture list',
|
|
23
|
-
rowKey: 'id',
|
|
24
|
-
columns: [
|
|
25
|
-
{ id: 'id', label: 'ID', capabilities: ['read', 'project'] },
|
|
26
|
-
{
|
|
27
|
-
id: 'title',
|
|
28
|
-
label: 'Title',
|
|
29
|
-
capabilities: ['read', 'search', 'filter', 'sort', 'project'],
|
|
30
|
-
operators: { filter: ['contains'] },
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
query: {
|
|
34
|
-
modes: ['rows', 'count'],
|
|
35
|
-
projectableColumnIds: ['id', 'title'],
|
|
36
|
-
filterableColumnIds: ['title'],
|
|
37
|
-
sortableColumnIds: ['title'],
|
|
38
|
-
},
|
|
39
|
-
controls: [
|
|
40
|
-
{ id: 'set-filters', label: 'Filter' },
|
|
41
|
-
{ id: 'refresh', label: 'Refresh' },
|
|
42
|
-
{ id: 'star', label: 'Star selected' },
|
|
43
|
-
],
|
|
44
|
-
actions: [],
|
|
45
|
-
limits: { maxQueryRows: 50, maxQueryBytes: 10_000, maxSelectionSize: 5 },
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
describe('mountListDataSurface (component integration)', () => {
|
|
49
|
-
it('drives a mounted custom list from the registry and tears down on unmount', async () => {
|
|
50
|
-
const registry = createDataSurfaceRegistry();
|
|
51
|
-
const controller = createDataTableController();
|
|
52
|
-
const onRefresh = vi.fn().mockResolvedValue(true);
|
|
53
|
-
const { unmount } = render(Fixture, {
|
|
54
|
-
props: {
|
|
55
|
-
registry,
|
|
56
|
-
descriptor: descriptor(),
|
|
57
|
-
controller,
|
|
58
|
-
context: { totalRows: 3, queryFingerprint: 'fixture-1' },
|
|
59
|
-
onRefresh,
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
expect(screen.getByTestId('filter-text').textContent).toBe('');
|
|
63
|
-
const before = registry.inspect(identity);
|
|
64
|
-
expect(before?.state.totalRows).toBe(3);
|
|
65
|
-
const filtered = await registry.execute({
|
|
66
|
-
version: 1,
|
|
67
|
-
commandId: 'filter-1',
|
|
68
|
-
identity,
|
|
69
|
-
expectedRevision: before?.revision ?? 0,
|
|
70
|
-
controlId: 'set-filters',
|
|
71
|
-
payload: {
|
|
72
|
-
filters: [{ columnId: 'title', operator: 'contains', value: 'draft' }],
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
expect(filtered.ok).toBe(true);
|
|
76
|
-
expect(screen.getByTestId('filter-text').textContent).toBe('draft');
|
|
77
|
-
const refreshed = await registry.execute({
|
|
78
|
-
version: 1,
|
|
79
|
-
commandId: 'refresh-1',
|
|
80
|
-
identity,
|
|
81
|
-
expectedRevision: registry.inspect(identity)?.revision ?? 0,
|
|
82
|
-
controlId: 'refresh',
|
|
83
|
-
});
|
|
84
|
-
expect(refreshed.ok).toBe(true);
|
|
85
|
-
expect(onRefresh).toHaveBeenCalledOnce();
|
|
86
|
-
const starred = await registry.execute({
|
|
87
|
-
version: 1,
|
|
88
|
-
commandId: 'star-1',
|
|
89
|
-
identity,
|
|
90
|
-
expectedRevision: registry.inspect(identity)?.revision ?? 0,
|
|
91
|
-
controlId: 'star',
|
|
92
|
-
});
|
|
93
|
-
expect(starred.ok).toBe(true);
|
|
94
|
-
expect(screen.getByTestId('starred-count').textContent).toBe('1');
|
|
95
|
-
unmount();
|
|
96
|
-
// Unmounting tore down the mounted surface — the identity is gone.
|
|
97
|
-
expect(registry.inspect(identity)).toBeUndefined();
|
|
98
|
-
await expect(registry.execute({
|
|
99
|
-
version: 1,
|
|
100
|
-
commandId: 'after-unmount',
|
|
101
|
-
identity,
|
|
102
|
-
expectedRevision: 0,
|
|
103
|
-
controlId: 'refresh',
|
|
104
|
-
})).resolves.toMatchObject({ ok: false, reason: 'not_found' });
|
|
105
|
-
});
|
|
106
|
-
});
|