@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,108 +0,0 @@
|
|
|
1
|
-
/** ShellNavToggle, ShellTitle, PhoneTopBar and PhoneBottomBar. */
|
|
2
|
-
import { fireEvent, render, screen } from '@testing-library/svelte';
|
|
3
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
4
|
-
import PhoneBottomBar from '../admin-shell/PhoneBottomBar.svelte';
|
|
5
|
-
import PhoneTopBar from '../admin-shell/PhoneTopBar.svelte';
|
|
6
|
-
import ShellNavToggle from '../admin-shell/ShellNavToggle.svelte';
|
|
7
|
-
import TestIcon from './test-icon.svelte';
|
|
8
|
-
describe('ShellNavToggle', () => {
|
|
9
|
-
it('collapses an open nav and expands a closed one', async () => {
|
|
10
|
-
const onclick = vi.fn();
|
|
11
|
-
const { rerender } = render(ShellNavToggle, {
|
|
12
|
-
props: { expanded: true, onclick, label: 'site navigation' },
|
|
13
|
-
});
|
|
14
|
-
const toggle = screen.getByRole('button', {
|
|
15
|
-
name: 'Collapse site navigation',
|
|
16
|
-
});
|
|
17
|
-
expect(toggle).toHaveAttribute('aria-expanded', 'true');
|
|
18
|
-
expect(toggle).toHaveAttribute('aria-controls', 'smrt-admin-shell-left-panel');
|
|
19
|
-
await fireEvent.click(toggle);
|
|
20
|
-
expect(onclick).toHaveBeenCalledTimes(1);
|
|
21
|
-
await rerender({ expanded: false, onclick });
|
|
22
|
-
expect(screen.getByRole('button', { name: 'Expand site navigation' })).toHaveAttribute('aria-expanded', 'false');
|
|
23
|
-
});
|
|
24
|
-
it('defaults its label', () => {
|
|
25
|
-
render(ShellNavToggle, { props: { expanded: false, onclick: () => { } } });
|
|
26
|
-
expect(screen.getByRole('button', { name: 'Expand navigation' })).toBeInTheDocument();
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
describe('PhoneTopBar', () => {
|
|
30
|
-
it('links the workspace name home on section homes', () => {
|
|
31
|
-
render(PhoneTopBar, {
|
|
32
|
-
props: {
|
|
33
|
-
model: { kind: 'home', title: 'Alpha Times' },
|
|
34
|
-
homeHref: '/sites/alpha',
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
const link = screen.getByRole('link', { name: 'Alpha Times' });
|
|
38
|
-
expect(link).toHaveAttribute('href', '/sites/alpha');
|
|
39
|
-
});
|
|
40
|
-
it('shows a named back link and the page title on detail pages', () => {
|
|
41
|
-
render(PhoneTopBar, {
|
|
42
|
-
props: {
|
|
43
|
-
model: {
|
|
44
|
-
kind: 'detail',
|
|
45
|
-
title: 'Fair opens Friday',
|
|
46
|
-
backHref: '/sites/alpha/articles',
|
|
47
|
-
backLabel: 'Articles',
|
|
48
|
-
},
|
|
49
|
-
homeHref: '/sites/alpha',
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
expect(screen.getByRole('link', { name: 'Back to Articles' })).toHaveAttribute('href', '/sites/alpha/articles');
|
|
53
|
-
expect(screen.getByTestId('phone-top-bar').textContent).toContain('Fair opens Friday');
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
describe('PhoneBottomBar', () => {
|
|
57
|
-
it('renders links and buttons with states, badges and dots', async () => {
|
|
58
|
-
const onMenu = vi.fn();
|
|
59
|
-
render(PhoneBottomBar, {
|
|
60
|
-
props: {
|
|
61
|
-
items: [
|
|
62
|
-
{
|
|
63
|
-
id: 'menu',
|
|
64
|
-
label: 'Menu',
|
|
65
|
-
icon: TestIcon,
|
|
66
|
-
onclick: onMenu,
|
|
67
|
-
expanded: false,
|
|
68
|
-
controls: 'nav',
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
id: 'home',
|
|
72
|
-
label: 'Home',
|
|
73
|
-
icon: TestIcon,
|
|
74
|
-
href: '/',
|
|
75
|
-
active: true,
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
id: 'notifications',
|
|
79
|
-
label: 'Notifications',
|
|
80
|
-
icon: TestIcon,
|
|
81
|
-
onclick: () => { },
|
|
82
|
-
badge: 12,
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
id: 'assistant',
|
|
86
|
-
label: 'Assistant',
|
|
87
|
-
icon: TestIcon,
|
|
88
|
-
onclick: () => { },
|
|
89
|
-
dot: true,
|
|
90
|
-
dotLabel: 'new reply',
|
|
91
|
-
},
|
|
92
|
-
],
|
|
93
|
-
},
|
|
94
|
-
});
|
|
95
|
-
expect(screen.getByRole('navigation', { name: 'Main' })).toBeInTheDocument();
|
|
96
|
-
const menu = screen.getByRole('button', { name: 'Menu' });
|
|
97
|
-
expect(menu).toHaveAttribute('aria-expanded', 'false');
|
|
98
|
-
expect(menu).toHaveAttribute('aria-controls', 'nav');
|
|
99
|
-
await fireEvent.click(menu);
|
|
100
|
-
expect(onMenu).toHaveBeenCalledTimes(1);
|
|
101
|
-
expect(screen.getByRole('link', { name: 'Home' })).toHaveAttribute('aria-current', 'page');
|
|
102
|
-
const notifications = screen.getByRole('button', {
|
|
103
|
-
name: 'Notifications, 12 unread',
|
|
104
|
-
});
|
|
105
|
-
expect(notifications.textContent).toContain('9+');
|
|
106
|
-
expect(screen.getByRole('button', { name: 'Assistant, new reply' })).toBeInTheDocument();
|
|
107
|
-
});
|
|
108
|
-
});
|
|
@@ -1,327 +0,0 @@
|
|
|
1
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
-
import { systemFeed } from '../live/system-feed.svelte.js';
|
|
3
|
-
/**
|
|
4
|
-
* Lifecycle tests for the `systemFeed` polling helper (#1774). Real Svelte
|
|
5
|
-
* `$state` reactivity + vitest fake timers; only the external `fetch` is
|
|
6
|
-
* mocked. Each `dispose()`s its feed in `afterEach` to avoid leaked intervals.
|
|
7
|
-
*/
|
|
8
|
-
const disposers = [];
|
|
9
|
-
function track(controller) {
|
|
10
|
-
disposers.push(() => controller.dispose());
|
|
11
|
-
return controller;
|
|
12
|
-
}
|
|
13
|
-
/** Flush the interval + the async tick's microtasks. */
|
|
14
|
-
async function advance(ms) {
|
|
15
|
-
await vi.advanceTimersByTimeAsync(ms);
|
|
16
|
-
}
|
|
17
|
-
function panel(id, itemCount) {
|
|
18
|
-
return {
|
|
19
|
-
id,
|
|
20
|
-
label: id,
|
|
21
|
-
items: Array.from({ length: itemCount }, (_, index) => ({
|
|
22
|
-
id: `${id}-${index}`,
|
|
23
|
-
label: `${id} ${index}`,
|
|
24
|
-
status: 'running',
|
|
25
|
-
})),
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
beforeEach(() => {
|
|
29
|
-
vi.useFakeTimers();
|
|
30
|
-
});
|
|
31
|
-
afterEach(() => {
|
|
32
|
-
while (disposers.length > 0)
|
|
33
|
-
disposers.pop()?.();
|
|
34
|
-
vi.useRealTimers();
|
|
35
|
-
// Restore any spies (e.g. document.hidden / addEventListener) so they cannot
|
|
36
|
-
// leak into later tests or files.
|
|
37
|
-
vi.restoreAllMocks();
|
|
38
|
-
});
|
|
39
|
-
describe('systemFeed', () => {
|
|
40
|
-
it('fetches immediately and maps the response into panels and chips', async () => {
|
|
41
|
-
const fetch = vi.fn().mockResolvedValue({ jobs: 2 });
|
|
42
|
-
const feed = track(systemFeed({
|
|
43
|
-
fetch,
|
|
44
|
-
intervalMs: 1000,
|
|
45
|
-
pauseWhenHidden: false,
|
|
46
|
-
map: (data) => ({
|
|
47
|
-
panels: [panel('jobs', data.jobs)],
|
|
48
|
-
chips: [{ id: 'jobs', label: 'Jobs', value: data.jobs }],
|
|
49
|
-
}),
|
|
50
|
-
}));
|
|
51
|
-
// Immediate tick is queued synchronously; flush its microtasks.
|
|
52
|
-
await advance(0);
|
|
53
|
-
expect(fetch).toHaveBeenCalledTimes(1);
|
|
54
|
-
expect(feed.status).toBe('success');
|
|
55
|
-
expect(feed.panels).toHaveLength(1);
|
|
56
|
-
expect(feed.panels[0]?.items).toHaveLength(2);
|
|
57
|
-
expect(feed.chips[0]?.value).toBe(2);
|
|
58
|
-
expect(feed.running).toBe(true);
|
|
59
|
-
});
|
|
60
|
-
it('polls again on each interval tick', async () => {
|
|
61
|
-
const fetch = vi.fn().mockResolvedValue({ ok: true });
|
|
62
|
-
track(systemFeed({
|
|
63
|
-
fetch,
|
|
64
|
-
intervalMs: 1000,
|
|
65
|
-
pauseWhenHidden: false,
|
|
66
|
-
map: () => ({}),
|
|
67
|
-
}));
|
|
68
|
-
await advance(0); // immediate
|
|
69
|
-
expect(fetch).toHaveBeenCalledTimes(1);
|
|
70
|
-
await advance(1000);
|
|
71
|
-
expect(fetch).toHaveBeenCalledTimes(2);
|
|
72
|
-
await advance(3000);
|
|
73
|
-
expect(fetch).toHaveBeenCalledTimes(5);
|
|
74
|
-
});
|
|
75
|
-
it('stops polling after the disposer runs', async () => {
|
|
76
|
-
const fetch = vi.fn().mockResolvedValue({ ok: true });
|
|
77
|
-
const feed = systemFeed({
|
|
78
|
-
fetch,
|
|
79
|
-
intervalMs: 1000,
|
|
80
|
-
pauseWhenHidden: false,
|
|
81
|
-
map: () => ({}),
|
|
82
|
-
});
|
|
83
|
-
await advance(0);
|
|
84
|
-
expect(fetch).toHaveBeenCalledTimes(1);
|
|
85
|
-
feed.dispose();
|
|
86
|
-
expect(feed.running).toBe(false);
|
|
87
|
-
expect(feed.status).toBe('stopped');
|
|
88
|
-
await advance(5000);
|
|
89
|
-
// No further ticks after disposal.
|
|
90
|
-
expect(fetch).toHaveBeenCalledTimes(1);
|
|
91
|
-
});
|
|
92
|
-
it('stop() halts the timer while start() re-arms it', async () => {
|
|
93
|
-
const fetch = vi.fn().mockResolvedValue({ ok: true });
|
|
94
|
-
const feed = track(systemFeed({
|
|
95
|
-
fetch,
|
|
96
|
-
intervalMs: 1000,
|
|
97
|
-
pauseWhenHidden: false,
|
|
98
|
-
map: () => ({}),
|
|
99
|
-
}));
|
|
100
|
-
await advance(0);
|
|
101
|
-
expect(fetch).toHaveBeenCalledTimes(1);
|
|
102
|
-
feed.stop();
|
|
103
|
-
expect(feed.running).toBe(false);
|
|
104
|
-
await advance(3000);
|
|
105
|
-
expect(fetch).toHaveBeenCalledTimes(1);
|
|
106
|
-
feed.start();
|
|
107
|
-
expect(feed.running).toBe(true);
|
|
108
|
-
await advance(1000);
|
|
109
|
-
expect(fetch).toHaveBeenCalledTimes(2);
|
|
110
|
-
});
|
|
111
|
-
it('tolerates a rejected fetch without stopping the loop and keeps prior data', async () => {
|
|
112
|
-
const onError = vi.fn();
|
|
113
|
-
const fetch = vi
|
|
114
|
-
.fn()
|
|
115
|
-
.mockResolvedValueOnce({ n: 1 })
|
|
116
|
-
.mockRejectedValueOnce(new Error('boom'))
|
|
117
|
-
.mockResolvedValue({ n: 3 });
|
|
118
|
-
const feed = track(systemFeed({
|
|
119
|
-
fetch,
|
|
120
|
-
intervalMs: 1000,
|
|
121
|
-
pauseWhenHidden: false,
|
|
122
|
-
onError,
|
|
123
|
-
map: (data) => ({
|
|
124
|
-
chips: [{ id: 'n', label: 'N', value: data.n }],
|
|
125
|
-
}),
|
|
126
|
-
}));
|
|
127
|
-
await advance(0);
|
|
128
|
-
expect(feed.chips[0]?.value).toBe(1);
|
|
129
|
-
expect(feed.status).toBe('success');
|
|
130
|
-
// Second tick rejects.
|
|
131
|
-
await advance(1000);
|
|
132
|
-
expect(onError).toHaveBeenCalledTimes(1);
|
|
133
|
-
expect(feed.status).toBe('error');
|
|
134
|
-
expect(feed.error).toBeInstanceOf(Error);
|
|
135
|
-
// Last good data stays on screen.
|
|
136
|
-
expect(feed.chips[0]?.value).toBe(1);
|
|
137
|
-
// Third tick recovers.
|
|
138
|
-
await advance(1000);
|
|
139
|
-
expect(feed.status).toBe('success');
|
|
140
|
-
expect(feed.error).toBeNull();
|
|
141
|
-
expect(feed.chips[0]?.value).toBe(3);
|
|
142
|
-
});
|
|
143
|
-
it('tolerates a throwing mapper as a failed tick', async () => {
|
|
144
|
-
const fetch = vi.fn().mockResolvedValue({ bad: true });
|
|
145
|
-
const feed = track(systemFeed({
|
|
146
|
-
fetch,
|
|
147
|
-
intervalMs: 1000,
|
|
148
|
-
pauseWhenHidden: false,
|
|
149
|
-
map: () => {
|
|
150
|
-
throw new Error('map failed');
|
|
151
|
-
},
|
|
152
|
-
}));
|
|
153
|
-
await advance(0);
|
|
154
|
-
expect(feed.status).toBe('error');
|
|
155
|
-
expect(feed.error).toBeInstanceOf(Error);
|
|
156
|
-
// Loop survives.
|
|
157
|
-
await advance(1000);
|
|
158
|
-
expect(fetch).toHaveBeenCalledTimes(2);
|
|
159
|
-
});
|
|
160
|
-
it('does not fetch on creation when immediate is false', async () => {
|
|
161
|
-
const fetch = vi.fn().mockResolvedValue({ ok: true });
|
|
162
|
-
const feed = track(systemFeed({
|
|
163
|
-
fetch,
|
|
164
|
-
intervalMs: 1000,
|
|
165
|
-
immediate: false,
|
|
166
|
-
pauseWhenHidden: false,
|
|
167
|
-
map: () => ({}),
|
|
168
|
-
}));
|
|
169
|
-
await advance(0);
|
|
170
|
-
expect(fetch).not.toHaveBeenCalled();
|
|
171
|
-
expect(feed.status).toBe('idle');
|
|
172
|
-
// First real load is the timer tick.
|
|
173
|
-
await advance(1000);
|
|
174
|
-
expect(fetch).toHaveBeenCalledTimes(1);
|
|
175
|
-
});
|
|
176
|
-
it('runs a single fetch with no timer when intervalMs <= 0', async () => {
|
|
177
|
-
const fetch = vi.fn().mockResolvedValue({ ok: true });
|
|
178
|
-
const feed = track(systemFeed({
|
|
179
|
-
fetch,
|
|
180
|
-
intervalMs: 0,
|
|
181
|
-
pauseWhenHidden: false,
|
|
182
|
-
map: () => ({}),
|
|
183
|
-
}));
|
|
184
|
-
await advance(0);
|
|
185
|
-
expect(fetch).toHaveBeenCalledTimes(1);
|
|
186
|
-
// No timer is armed, so `running` stays false (it tracks an armed timer).
|
|
187
|
-
expect(feed.running).toBe(false);
|
|
188
|
-
await advance(10_000);
|
|
189
|
-
expect(fetch).toHaveBeenCalledTimes(1);
|
|
190
|
-
// Manual refresh still works.
|
|
191
|
-
await feed.refresh();
|
|
192
|
-
expect(fetch).toHaveBeenCalledTimes(2);
|
|
193
|
-
});
|
|
194
|
-
it('refresh() fetches once off-schedule', async () => {
|
|
195
|
-
const fetch = vi.fn().mockResolvedValue({ ok: true });
|
|
196
|
-
const feed = track(systemFeed({
|
|
197
|
-
fetch,
|
|
198
|
-
intervalMs: 0,
|
|
199
|
-
immediate: false,
|
|
200
|
-
pauseWhenHidden: false,
|
|
201
|
-
map: () => ({}),
|
|
202
|
-
}));
|
|
203
|
-
await advance(0);
|
|
204
|
-
expect(fetch).not.toHaveBeenCalled();
|
|
205
|
-
await feed.refresh();
|
|
206
|
-
expect(fetch).toHaveBeenCalledTimes(1);
|
|
207
|
-
});
|
|
208
|
-
it('skips ticks while the document is hidden and refreshes on becoming visible', async () => {
|
|
209
|
-
let hidden = false;
|
|
210
|
-
const listeners = [];
|
|
211
|
-
vi.spyOn(document, 'hidden', 'get').mockImplementation(() => hidden);
|
|
212
|
-
const addSpy = vi
|
|
213
|
-
.spyOn(document, 'addEventListener')
|
|
214
|
-
.mockImplementation((type, cb) => {
|
|
215
|
-
if (type === 'visibilitychange')
|
|
216
|
-
listeners.push(cb);
|
|
217
|
-
});
|
|
218
|
-
const removeSpy = vi
|
|
219
|
-
.spyOn(document, 'removeEventListener')
|
|
220
|
-
.mockImplementation(() => { });
|
|
221
|
-
const fetch = vi.fn().mockResolvedValue({ ok: true });
|
|
222
|
-
const feed = track(systemFeed({
|
|
223
|
-
fetch,
|
|
224
|
-
intervalMs: 1000,
|
|
225
|
-
// pauseWhenHidden defaults to true.
|
|
226
|
-
map: () => ({}),
|
|
227
|
-
}));
|
|
228
|
-
// Immediate tick while visible.
|
|
229
|
-
await advance(0);
|
|
230
|
-
expect(fetch).toHaveBeenCalledTimes(1);
|
|
231
|
-
// Go hidden — timer ticks are skipped.
|
|
232
|
-
hidden = true;
|
|
233
|
-
await advance(3000);
|
|
234
|
-
expect(fetch).toHaveBeenCalledTimes(1);
|
|
235
|
-
// Back to visible — the visibilitychange listener refreshes once.
|
|
236
|
-
hidden = false;
|
|
237
|
-
for (const cb of listeners)
|
|
238
|
-
cb();
|
|
239
|
-
await advance(0);
|
|
240
|
-
expect(fetch).toHaveBeenCalledTimes(2);
|
|
241
|
-
feed.dispose();
|
|
242
|
-
expect(removeSpy).toHaveBeenCalledWith('visibilitychange', expect.any(Function));
|
|
243
|
-
addSpy.mockRestore();
|
|
244
|
-
removeSpy.mockRestore();
|
|
245
|
-
});
|
|
246
|
-
it('supersedes an in-flight fetch so a stale response cannot clobber newer data', async () => {
|
|
247
|
-
let resolveFirst;
|
|
248
|
-
const fetch = vi
|
|
249
|
-
.fn()
|
|
250
|
-
.mockImplementationOnce(() => new Promise((resolve) => {
|
|
251
|
-
resolveFirst = resolve;
|
|
252
|
-
}))
|
|
253
|
-
.mockResolvedValue({ n: 2 });
|
|
254
|
-
const feed = track(systemFeed({
|
|
255
|
-
fetch,
|
|
256
|
-
intervalMs: 0,
|
|
257
|
-
immediate: false,
|
|
258
|
-
pauseWhenHidden: false,
|
|
259
|
-
map: (data) => ({
|
|
260
|
-
chips: [{ id: 'n', label: 'N', value: data.n }],
|
|
261
|
-
}),
|
|
262
|
-
}));
|
|
263
|
-
// Start a slow first fetch (never resolved yet).
|
|
264
|
-
const first = feed.refresh();
|
|
265
|
-
// Start a second fetch that resolves immediately; it supersedes the first.
|
|
266
|
-
await feed.refresh();
|
|
267
|
-
expect(feed.chips[0]?.value).toBe(2);
|
|
268
|
-
// Now let the stale first fetch resolve — it must be ignored.
|
|
269
|
-
resolveFirst?.({ n: 1 });
|
|
270
|
-
await first;
|
|
271
|
-
expect(feed.chips[0]?.value).toBe(2);
|
|
272
|
-
});
|
|
273
|
-
it('contains a throwing onError callback (no unhandled rejection)', async () => {
|
|
274
|
-
const unhandled = vi.fn();
|
|
275
|
-
process.on('unhandledRejection', unhandled);
|
|
276
|
-
const onError = vi.fn(() => {
|
|
277
|
-
throw new Error('consumer onError blew up');
|
|
278
|
-
});
|
|
279
|
-
const fetch = vi.fn().mockRejectedValue(new Error('fetch failed'));
|
|
280
|
-
const feed = track(systemFeed({
|
|
281
|
-
fetch,
|
|
282
|
-
intervalMs: 0,
|
|
283
|
-
immediate: false,
|
|
284
|
-
pauseWhenHidden: false,
|
|
285
|
-
onError,
|
|
286
|
-
map: () => ({}),
|
|
287
|
-
}));
|
|
288
|
-
// The failing fetch invokes the throwing onError; the tick must still
|
|
289
|
-
// resolve rather than reject.
|
|
290
|
-
await expect(feed.refresh()).resolves.toBeUndefined();
|
|
291
|
-
expect(onError).toHaveBeenCalled();
|
|
292
|
-
expect(feed.status).toBe('error');
|
|
293
|
-
// Give any stray rejection a chance to surface, then assert none did.
|
|
294
|
-
await advance(0);
|
|
295
|
-
process.off('unhandledRejection', unhandled);
|
|
296
|
-
expect(unhandled).not.toHaveBeenCalled();
|
|
297
|
-
});
|
|
298
|
-
it('does not refresh on becoming visible after stop()', async () => {
|
|
299
|
-
let hidden = false;
|
|
300
|
-
const listeners = [];
|
|
301
|
-
vi.spyOn(document, 'hidden', 'get').mockImplementation(() => hidden);
|
|
302
|
-
vi.spyOn(document, 'addEventListener').mockImplementation((type, cb) => {
|
|
303
|
-
if (type === 'visibilitychange')
|
|
304
|
-
listeners.push(cb);
|
|
305
|
-
});
|
|
306
|
-
vi.spyOn(document, 'removeEventListener').mockImplementation(() => { });
|
|
307
|
-
const fetch = vi.fn().mockResolvedValue({ ok: true });
|
|
308
|
-
const feed = track(systemFeed({
|
|
309
|
-
fetch,
|
|
310
|
-
intervalMs: 1000,
|
|
311
|
-
map: () => ({}),
|
|
312
|
-
}));
|
|
313
|
-
await advance(0);
|
|
314
|
-
expect(fetch).toHaveBeenCalledTimes(1);
|
|
315
|
-
// Pause polling (but the visibility listener is still attached — only
|
|
316
|
-
// dispose() detaches it).
|
|
317
|
-
feed.stop();
|
|
318
|
-
expect(feed.running).toBe(false);
|
|
319
|
-
// A hidden -> visible transition must NOT resurrect polling while stopped.
|
|
320
|
-
hidden = true;
|
|
321
|
-
hidden = false;
|
|
322
|
-
for (const cb of listeners)
|
|
323
|
-
cb();
|
|
324
|
-
await advance(0);
|
|
325
|
-
expect(fetch).toHaveBeenCalledTimes(1);
|
|
326
|
-
});
|
|
327
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* Trivial icon component used by render-tools-dock tests to verify that
|
|
4
|
-
* `ToolDef.iconComponent` is rendered inside `.tools-dock__rail-glyph`
|
|
5
|
-
* instead of the first-letter fallback.
|
|
6
|
-
*/
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<svg
|
|
10
|
-
data-testid="custom-icon"
|
|
11
|
-
width="18"
|
|
12
|
-
height="18"
|
|
13
|
-
viewBox="0 0 24 24"
|
|
14
|
-
aria-hidden="true"
|
|
15
|
-
>
|
|
16
|
-
<circle cx="12" cy="12" r="10" />
|
|
17
|
-
</svg>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
-
$$bindings?: Bindings;
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
declare const TestIcon: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
}, {}, {}, string>;
|
|
17
|
-
type TestIcon = InstanceType<typeof TestIcon>;
|
|
18
|
-
export default TestIcon;
|
|
19
|
-
//# sourceMappingURL=test-icon.svelte.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-icon.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/workspace/__tests__/test-icon.svelte.ts"],"names":[],"mappings":"AAiBA,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IACtG,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,QAAQ;;kBAA+E,CAAC;AAC5E,KAAK,QAAQ,GAAG,YAAY,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChD,eAAe,QAAQ,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* Fixture for the typed tool-component pattern documented on
|
|
4
|
-
* `ToolDef.component`. The dock erases tool-specific types at registration,
|
|
5
|
-
* but the tool component itself locally annotates `context` with the
|
|
6
|
-
* narrowed `ToolsDockContext<TData, TActions>` shape — see
|
|
7
|
-
* `register-typed-tool.ts` for the registration site that must accept this
|
|
8
|
-
* component without a cast.
|
|
9
|
-
*
|
|
10
|
-
* If any of the type assertions below fail at `svelte-check` / `tsc` time,
|
|
11
|
-
* either the `ToolDef.component` erasure relaxation or the
|
|
12
|
-
* `ToolsDockContext` action-map constraint regressed.
|
|
13
|
-
*/
|
|
14
|
-
import type { ToolsDockApi, ToolsDockContext } from '../../types.js';
|
|
15
|
-
import type { MyActions, MyData } from './typed-tool-types.js';
|
|
16
|
-
|
|
17
|
-
let {
|
|
18
|
-
context,
|
|
19
|
-
dock,
|
|
20
|
-
}: {
|
|
21
|
-
context: ToolsDockContext<MyData, MyActions> | null;
|
|
22
|
-
dock: ToolsDockApi;
|
|
23
|
-
} = $props();
|
|
24
|
-
|
|
25
|
-
// These reads must compile — they exercise the typed `data` / `actions`
|
|
26
|
-
// surface that motivated the U3/U4/U5 work.
|
|
27
|
-
const slug = $derived(context?.data?.siteSlug ?? '');
|
|
28
|
-
const onSave = () => context?.actions?.triggerSave();
|
|
29
|
-
const onReview = () => context?.actions?.triggerReview('manual');
|
|
30
|
-
|
|
31
|
-
// Dock reference must still be usable.
|
|
32
|
-
const isOpen = $derived(dock.isOpen);
|
|
33
|
-
</script>
|
|
34
|
-
|
|
35
|
-
<section data-tool="typed-tool" data-slug={slug} data-open={isOpen}>
|
|
36
|
-
<button type="button" onclick={onSave}>Save</button>
|
|
37
|
-
<button type="button" onclick={onReview}>Review</button>
|
|
38
|
-
</section>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fixture for the typed tool-component pattern documented on
|
|
3
|
-
* `ToolDef.component`. The dock erases tool-specific types at registration,
|
|
4
|
-
* but the tool component itself locally annotates `context` with the
|
|
5
|
-
* narrowed `ToolsDockContext<TData, TActions>` shape — see
|
|
6
|
-
* `register-typed-tool.ts` for the registration site that must accept this
|
|
7
|
-
* component without a cast.
|
|
8
|
-
*
|
|
9
|
-
* If any of the type assertions below fail at `svelte-check` / `tsc` time,
|
|
10
|
-
* either the `ToolDef.component` erasure relaxation or the
|
|
11
|
-
* `ToolsDockContext` action-map constraint regressed.
|
|
12
|
-
*/
|
|
13
|
-
import type { ToolsDockApi, ToolsDockContext } from '../../types.js';
|
|
14
|
-
import type { MyActions, MyData } from './typed-tool-types.js';
|
|
15
|
-
type $$ComponentProps = {
|
|
16
|
-
context: ToolsDockContext<MyData, MyActions> | null;
|
|
17
|
-
dock: ToolsDockApi;
|
|
18
|
-
};
|
|
19
|
-
declare const TypedTool: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
20
|
-
type TypedTool = ReturnType<typeof TypedTool>;
|
|
21
|
-
export default TypedTool;
|
|
22
|
-
//# sourceMappingURL=TypedTool.svelte.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TypedTool.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/workspace/__tests__/typed-tool-fixture/TypedTool.svelte.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE9D,KAAK,gBAAgB,GAAI;IACxB,OAAO,EAAE,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAI,CAAC;IACpD,IAAI,EAAE,YAAY,CAAC;CACpB,CAAC;AA4BF,QAAA,MAAM,SAAS,sDAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Registration site for the typed-tool fixture. This file is the contract
|
|
3
|
-
* the workspace ergonomics PR (#1239) is restoring:
|
|
4
|
-
*
|
|
5
|
-
* - `TypedTool.svelte` declares its own typed `context` prop of shape
|
|
6
|
-
* `ToolsDockContext<MyData, MyActions> | null`.
|
|
7
|
-
* - It must be assignable to `ToolDef.component` without a registration-
|
|
8
|
-
* site cast — but this assertion is only meaningful under
|
|
9
|
-
* `svelte-check`. Under `tsc --noEmit`, `.svelte` imports resolve to
|
|
10
|
-
* `Component<any>` via the ambient `declare module '*.svelte'`
|
|
11
|
-
* declaration, so the assignment compiles regardless of what
|
|
12
|
-
* `ToolDef.component` is typed as. CI runs both `typecheck` and `check`
|
|
13
|
-
* (which invokes `svelte-check`) for this reason — see the JSDoc on
|
|
14
|
-
* `../typed-tool-fixture.test.ts` for the full split.
|
|
15
|
-
* - `defineToolsDock<MyData, MyActions>(...)` must accept an interface
|
|
16
|
-
* `MyActions` (no string index signature) under the factory generic.
|
|
17
|
-
* - `dock.setContext({ actions: { triggerSave } })` must still compile
|
|
18
|
-
* with no generic arguments (back-compat for the untyped pattern).
|
|
19
|
-
* - The factory's `<TData, TActions>` generics must flow through to the
|
|
20
|
-
* returned `ToolsDockInstance<TData, TActions>` — see
|
|
21
|
-
* `_assertTypedDockFlow` below for the load-bearing assertion.
|
|
22
|
-
*
|
|
23
|
-
* If TypeScript ever rejects this file under strict checks, the regression
|
|
24
|
-
* from review thread #1239/PRRT_kwDOQDruXs6CbBcK has returned.
|
|
25
|
-
*/
|
|
26
|
-
import { type DefineToolsDockOptions, type ToolsDockInstance } from '../../tools-dock/define-tools-dock.svelte.js';
|
|
27
|
-
import type { ToolDef, ToolsDockApi, ToolsDockContext } from '../../types.js';
|
|
28
|
-
import type { MyActions, MyData } from './typed-tool-types.js';
|
|
29
|
-
/** Type-only export: a tool registry that uses the typed component. */
|
|
30
|
-
export declare const typedTool: ToolDef;
|
|
31
|
-
/** Type-only export: options that pass the typed action map through. */
|
|
32
|
-
export declare const typedOptions: DefineToolsDockOptions<MyData, MyActions>;
|
|
33
|
-
/**
|
|
34
|
-
* Type-only export: a typed context literal. This must compile under the
|
|
35
|
-
* relaxed `TActions extends { [K in keyof TActions]: (...args: any[]) => any }`
|
|
36
|
-
* constraint — `MyActions` is an interface (no string index signature) and
|
|
37
|
-
* would fail a `Record<string, ...>` constraint.
|
|
38
|
-
*/
|
|
39
|
-
export declare const typedContext: ToolsDockContext<MyData, MyActions>;
|
|
40
|
-
/**
|
|
41
|
-
* Type-only export: the untyped (back-compat) setContext shape — passing
|
|
42
|
-
* `actions` with no factory generic. This caught a previous regression
|
|
43
|
-
* where `TActions = Record<string, never>` defaulted the action map to
|
|
44
|
-
* "no keys", rejecting `{ triggerSave }` outright.
|
|
45
|
-
*/
|
|
46
|
-
export declare const untypedContext: ToolsDockContext;
|
|
47
|
-
/** Type-only assertion: typed instance preserves the action shape. */
|
|
48
|
-
export type _AssertTypedActions = ToolsDockApi['context'] extends infer C ? C : never;
|
|
49
|
-
/**
|
|
50
|
-
* Type-only fixture: exercises the end-to-end generic flow on the public
|
|
51
|
-
* surface returned by `defineToolsDock<TData, TActions>(...)`. This is the
|
|
52
|
-
* regression Codex flagged in PR #1239 round-2 — the factory accepts the
|
|
53
|
-
* generics but erases them on the return type, so `dock.setContext(...)` and
|
|
54
|
-
* `dock.context?.data` fall back to the default-typed shape.
|
|
55
|
-
*
|
|
56
|
-
* The function below is never called at runtime. Its body has to compile,
|
|
57
|
-
* which is the load-bearing assertion: if `ToolsDockApi` / `ToolsDockInstance`
|
|
58
|
-
* ever stop parameterizing their `context` / `setContext` signatures, the
|
|
59
|
-
* lines marked TYPED below would fail to assign `MyData` / `MyActions` into
|
|
60
|
-
* the default-typed shape (no string index signature).
|
|
61
|
-
*
|
|
62
|
-
* Lives inline rather than at module scope because `defineToolsDock` calls
|
|
63
|
-
* `setContext`, which is only legal inside a component init scope.
|
|
64
|
-
*/
|
|
65
|
-
export declare function _assertTypedDockFlow(): ToolsDockInstance<MyData, MyActions>;
|
|
66
|
-
//# sourceMappingURL=register-typed-tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"register-typed-tool.d.ts","sourceRoot":"","sources":["../../../../../src/components/workspace/__tests__/typed-tool-fixture/register-typed-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EACL,KAAK,sBAAsB,EAE3B,KAAK,iBAAiB,EACvB,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAE9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/D,uEAAuE;AACvE,eAAO,MAAM,SAAS,EAAE,OAQvB,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,YAAY,EAAE,sBAAsB,CAAC,MAAM,EAAE,SAAS,CAElE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAO5D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,gBAK5B,CAAC;AAEF,sEAAsE;AACtE,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC,SAAS,CAAC,SAAS,MAAM,CAAC,GACrE,CAAC,GACD,KAAK,CAAC;AAEV;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,IAAI,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,CAmC3E"}
|