streetui 1.8.0 → 2.0.0
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/dist/bin.cjs +1 -1
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +1 -1
- package/dist/bin.js.map +1 -1
- package/dist/create-bin.cjs +1 -1
- package/dist/create-bin.cjs.map +1 -1
- package/dist/create-bin.js +1 -1
- package/dist/create-bin.js.map +1 -1
- package/dist/{compile-CJJQYi71.d.cts → hydration-diagnostics-CFYDXBlm.d.cts} +471 -5
- package/dist/{compile-CJJQYi71.d.ts → hydration-diagnostics-CFYDXBlm.d.ts} +471 -5
- package/dist/index.cjs +1401 -47
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +598 -147
- package/dist/index.d.ts +598 -147
- package/dist/index.js +1379 -47
- package/dist/index.js.map +1 -1
- package/dist/renderer-interface-BUhHV7ja.d.cts +26 -0
- package/dist/renderer-interface-B_-hWnKk.d.ts +26 -0
- package/dist/{server-CnLEnlYU.d.cts → server-C0PvFBzD.d.ts} +181 -2
- package/dist/{server-DNlg7ou2.d.ts → server-DnAOFpMP.d.cts} +181 -2
- package/dist/server.cjs +482 -32
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +481 -32
- package/dist/server.js.map +1 -1
- package/dist/testing.cjs +754 -41
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +42 -4
- package/dist/testing.d.ts +42 -4
- package/dist/testing.js +746 -40
- package/dist/testing.js.map +1 -1
- package/package.json +1 -1
- package/dist/hydration-diagnostics-BQeehq3i.d.cts +0 -89
- package/dist/hydration-diagnostics-DNAJumYF.d.ts +0 -89
package/dist/testing.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as StreetApp, a as ComponentDefinition, b as ContainerBuilder } from './
|
|
2
|
-
export { V as VERSION } from './
|
|
3
|
-
import { R as RenderHandle
|
|
1
|
+
import { S as StreetApp, H as HydrationDiagnostic, a as ComponentDefinition, b as ContainerBuilder } from './hydration-diagnostics-CFYDXBlm.cjs';
|
|
2
|
+
export { V as VERSION } from './hydration-diagnostics-CFYDXBlm.cjs';
|
|
3
|
+
import { R as RenderHandle } from './renderer-interface-BUhHV7ja.cjs';
|
|
4
4
|
export * from 'streetui/diagnostics';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -71,6 +71,44 @@ interface WaitForOptions {
|
|
|
71
71
|
* deadline. Use for assertions that become true only after async work settles.
|
|
72
72
|
*/
|
|
73
73
|
declare function waitFor<T>(check: () => T, options?: WaitForOptions): Promise<T>;
|
|
74
|
+
/** A minimal writable-boolean seam (an overlay `open` signal, typically). */
|
|
75
|
+
interface BooleanControl {
|
|
76
|
+
set(value: boolean): void;
|
|
77
|
+
}
|
|
78
|
+
/** Focus `el` (no-op if it exposes no `focus`). Intentful wrapper for tests. */
|
|
79
|
+
declare function focus(el: Element): void;
|
|
80
|
+
/** Blur `el` (no-op if it exposes no `blur`). */
|
|
81
|
+
declare function blur(el: Element): void;
|
|
82
|
+
/**
|
|
83
|
+
* Dispatch a bubbling, cancelable `keydown` for `key` on `el` (defaulting to the
|
|
84
|
+
* currently-focused element). Extra `init` fields (e.g. `{ shiftKey: true }`)
|
|
85
|
+
* are forwarded. Use for keyboard-interaction assertions (Escape, Tab, arrows).
|
|
86
|
+
*/
|
|
87
|
+
declare function pressKey(key: string, el?: Element | null, init?: KeyboardEventInit): void;
|
|
88
|
+
/**
|
|
89
|
+
* Simulate a pointer interaction OUTSIDE `container` — a `mousedown` + `click`
|
|
90
|
+
* on `document.body` (or `target` if given). Drives "click-away to dismiss"
|
|
91
|
+
* behaviour without the test constructing events by hand. If `target` is inside
|
|
92
|
+
* `container` this throws, so a mistake is loud rather than a silent no-op.
|
|
93
|
+
*/
|
|
94
|
+
declare function clickOutside(container: Element, target?: Element): void;
|
|
95
|
+
/**
|
|
96
|
+
* Open an overlay by flipping its `open` control to `true`, then flush so the
|
|
97
|
+
* panel mounts and its enter/focus wiring runs. Overlay visibility is app-owned
|
|
98
|
+
* state (§18) — a plain signal — so this is a thin, intentful wrapper over
|
|
99
|
+
* `set(true)` + {@link flushUpdates}.
|
|
100
|
+
*/
|
|
101
|
+
declare function openOverlay(open: BooleanControl): Promise<void>;
|
|
102
|
+
/** Close an overlay by flipping its `open` control to `false`, then flush. */
|
|
103
|
+
declare function closeOverlay(open: BooleanControl): Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* Settle a CSS transition on `el` deterministically: dispatch the
|
|
106
|
+
* `transitionend` the controller listens for (happy-dom fires none of its own),
|
|
107
|
+
* then flush pending work so any deferred leave-teardown (DOM removal, dispose,
|
|
108
|
+
* detach) completes. Await this after toggling a transitioned element to assert
|
|
109
|
+
* its post-animation state without depending on the fallback timeout.
|
|
110
|
+
*/
|
|
111
|
+
declare function waitForTransition(el: Element): Promise<void>;
|
|
74
112
|
/** Find the first leaf element whose text content includes `text`. */
|
|
75
113
|
declare function findByText(container: Element, text: string): Element;
|
|
76
114
|
interface ByRoleOptions {
|
|
@@ -170,4 +208,4 @@ declare function getComponentName(el: Element): string | null;
|
|
|
170
208
|
*/
|
|
171
209
|
declare function trigger(el: Element, type: string, init?: Record<string, unknown>): void;
|
|
172
210
|
|
|
173
|
-
export { type ByRoleOptions, type HydrateTestOptions, type HydrateTestResult, type RenderComponentResult, type RenderResult, type WaitForOptions, findAllByRole, findAllComponents, findByRole, findByText, findComponent, flushUpdates, getComponentName, hydrateComponent, render, renderComponent, renderOnce, renderServerThenHydrate, trigger, waitFor };
|
|
211
|
+
export { type BooleanControl, type ByRoleOptions, type HydrateTestOptions, type HydrateTestResult, type RenderComponentResult, type RenderResult, type WaitForOptions, blur, clickOutside, closeOverlay, findAllByRole, findAllComponents, findByRole, findByText, findComponent, flushUpdates, focus, getComponentName, hydrateComponent, openOverlay, pressKey, render, renderComponent, renderOnce, renderServerThenHydrate, trigger, waitFor, waitForTransition };
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as StreetApp, a as ComponentDefinition, b as ContainerBuilder } from './
|
|
2
|
-
export { V as VERSION } from './
|
|
3
|
-
import { R as RenderHandle
|
|
1
|
+
import { S as StreetApp, H as HydrationDiagnostic, a as ComponentDefinition, b as ContainerBuilder } from './hydration-diagnostics-CFYDXBlm.js';
|
|
2
|
+
export { V as VERSION } from './hydration-diagnostics-CFYDXBlm.js';
|
|
3
|
+
import { R as RenderHandle } from './renderer-interface-B_-hWnKk.js';
|
|
4
4
|
export * from 'streetui/diagnostics';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -71,6 +71,44 @@ interface WaitForOptions {
|
|
|
71
71
|
* deadline. Use for assertions that become true only after async work settles.
|
|
72
72
|
*/
|
|
73
73
|
declare function waitFor<T>(check: () => T, options?: WaitForOptions): Promise<T>;
|
|
74
|
+
/** A minimal writable-boolean seam (an overlay `open` signal, typically). */
|
|
75
|
+
interface BooleanControl {
|
|
76
|
+
set(value: boolean): void;
|
|
77
|
+
}
|
|
78
|
+
/** Focus `el` (no-op if it exposes no `focus`). Intentful wrapper for tests. */
|
|
79
|
+
declare function focus(el: Element): void;
|
|
80
|
+
/** Blur `el` (no-op if it exposes no `blur`). */
|
|
81
|
+
declare function blur(el: Element): void;
|
|
82
|
+
/**
|
|
83
|
+
* Dispatch a bubbling, cancelable `keydown` for `key` on `el` (defaulting to the
|
|
84
|
+
* currently-focused element). Extra `init` fields (e.g. `{ shiftKey: true }`)
|
|
85
|
+
* are forwarded. Use for keyboard-interaction assertions (Escape, Tab, arrows).
|
|
86
|
+
*/
|
|
87
|
+
declare function pressKey(key: string, el?: Element | null, init?: KeyboardEventInit): void;
|
|
88
|
+
/**
|
|
89
|
+
* Simulate a pointer interaction OUTSIDE `container` — a `mousedown` + `click`
|
|
90
|
+
* on `document.body` (or `target` if given). Drives "click-away to dismiss"
|
|
91
|
+
* behaviour without the test constructing events by hand. If `target` is inside
|
|
92
|
+
* `container` this throws, so a mistake is loud rather than a silent no-op.
|
|
93
|
+
*/
|
|
94
|
+
declare function clickOutside(container: Element, target?: Element): void;
|
|
95
|
+
/**
|
|
96
|
+
* Open an overlay by flipping its `open` control to `true`, then flush so the
|
|
97
|
+
* panel mounts and its enter/focus wiring runs. Overlay visibility is app-owned
|
|
98
|
+
* state (§18) — a plain signal — so this is a thin, intentful wrapper over
|
|
99
|
+
* `set(true)` + {@link flushUpdates}.
|
|
100
|
+
*/
|
|
101
|
+
declare function openOverlay(open: BooleanControl): Promise<void>;
|
|
102
|
+
/** Close an overlay by flipping its `open` control to `false`, then flush. */
|
|
103
|
+
declare function closeOverlay(open: BooleanControl): Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* Settle a CSS transition on `el` deterministically: dispatch the
|
|
106
|
+
* `transitionend` the controller listens for (happy-dom fires none of its own),
|
|
107
|
+
* then flush pending work so any deferred leave-teardown (DOM removal, dispose,
|
|
108
|
+
* detach) completes. Await this after toggling a transitioned element to assert
|
|
109
|
+
* its post-animation state without depending on the fallback timeout.
|
|
110
|
+
*/
|
|
111
|
+
declare function waitForTransition(el: Element): Promise<void>;
|
|
74
112
|
/** Find the first leaf element whose text content includes `text`. */
|
|
75
113
|
declare function findByText(container: Element, text: string): Element;
|
|
76
114
|
interface ByRoleOptions {
|
|
@@ -170,4 +208,4 @@ declare function getComponentName(el: Element): string | null;
|
|
|
170
208
|
*/
|
|
171
209
|
declare function trigger(el: Element, type: string, init?: Record<string, unknown>): void;
|
|
172
210
|
|
|
173
|
-
export { type ByRoleOptions, type HydrateTestOptions, type HydrateTestResult, type RenderComponentResult, type RenderResult, type WaitForOptions, findAllByRole, findAllComponents, findByRole, findByText, findComponent, flushUpdates, getComponentName, hydrateComponent, render, renderComponent, renderOnce, renderServerThenHydrate, trigger, waitFor };
|
|
211
|
+
export { type BooleanControl, type ByRoleOptions, type HydrateTestOptions, type HydrateTestResult, type RenderComponentResult, type RenderResult, type WaitForOptions, blur, clickOutside, closeOverlay, findAllByRole, findAllComponents, findByRole, findByText, findComponent, flushUpdates, focus, getComponentName, hydrateComponent, openOverlay, pressKey, render, renderComponent, renderOnce, renderServerThenHydrate, trigger, waitFor, waitForTransition };
|