streetui 1.7.0 → 1.9.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/{compile-Cte0nf06.d.cts → compile-DqsMQVJk.d.cts} +255 -4
- package/dist/{compile-Cte0nf06.d.ts → compile-DqsMQVJk.d.ts} +255 -4
- 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/{hydration-diagnostics-zK-fihvd.d.cts → hydration-diagnostics-4pwt6v7b.d.cts} +1 -1
- package/dist/{hydration-diagnostics-Ddgs3Puu.d.ts → hydration-diagnostics-B2FmY05M.d.ts} +1 -1
- package/dist/index.cjs +639 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +294 -18
- package/dist/index.d.ts +294 -18
- package/dist/index.js +627 -41
- package/dist/index.js.map +1 -1
- package/dist/{server-cgmCiPsz.d.ts → server-BYnmb_hR.d.ts} +1 -1
- package/dist/{server-D4A8eunr.d.cts → server-DnwqBTfE.d.cts} +1 -1
- package/dist/server.cjs +274 -31
- 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 +274 -31
- package/dist/server.js.map +1 -1
- package/dist/testing.cjs +1470 -33
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +101 -4
- package/dist/testing.d.ts +101 -4
- package/dist/testing.js +1456 -32
- package/dist/testing.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { R as RenderHandle, S as StreetRenderer, a as HydrationDiagnosticSink } from './hydration-diagnostics-
|
|
4
|
-
export { H as HydrationDiagnostic, b as HydrationMismatchType, c as consoleHydrationDiagnosticSink, d as createHydrationDiagnosticCollector, f as formatHydrationDiagnostic } from './hydration-diagnostics-
|
|
5
|
-
import { D as DOMAdapter } from './server-
|
|
6
|
-
export { R as RenderToStringOptions, S as STATE_MARKER_ATTR, a as ServerDOMAdapter, r as readState, b as renderToString, s as serializeState, c as serverDOMAdapter } from './server-
|
|
1
|
+
import { c as Signal, d as Subscriber, U as Unsubscribe, R as ReadonlySignal, A as ApplicationId, D as DiagnosticCollector, e as ApplicationGraph, G as GraphNode, C as CompiledApplication, f as SemanticNodeType, P as PageDSL, T as TransitionConfig, g as ContainerDSL, h as SignalKind } from './compile-DqsMQVJk.js';
|
|
2
|
+
export { i as A11yOptions, j as AppBuilder, k as AppDSL, l as AppOptions, m as ApplicationGraphOptions, B as BaseNode, n as Bindable, o as BindableText, p as BoundInputOptions, q as ButtonOptions, r as CompileOptions, b as ComponentChildren, s as ComponentContext, a as ComponentDefinition, t as ComponentRender, u as ComponentSetup, b as ContainerBuilder, v as ContainerBuilderImpl, w as ContainerOptions, x as ContentDSL, y as ControlledInputOptions, z as DerivedSignal, E as Diagnostic, F as DiagnosticError, H as DiagnosticLocation, I as DiagnosticSeverity, J as ErrorBoundaryOptions, K as ErrorFallbackBuilder, L as ErrorSource, M as EventDescriptor, N as FormBuilder, O as FormBuilderImpl, Q as FormDSL, W as FormOptions, X as GraphNodeData, Y as HandlerFn, Z as HeadingOptions, _ as ImageOptions, $ as InputOptions, a0 as InputOptionsBase, a1 as LinkOptions, a2 as ListBuilder, a3 as ListBuilderImpl, a4 as ListDSL, a5 as ListOptions, a6 as ListPlanEntry, a7 as NodeId, a8 as NodeMetadata, a9 as OverlayOptions, aa as PageBuilder, ab as PageBuilderImpl, ac as PortalOptions, ad as PropValue, ae as Props, af as ReactiveConsumer, ag as ReactiveSource, ah as ResolvedTransition, ai as SectionBuilder, aj as SectionBuilderImpl, ak as SectionDSL, al as SectionOptions, am as SerializedGraph, an as SerializedNode, ao as StateRef, S as StreetApp, ap as StreetUI, aq as TextOptions, ar as TextValue, V as VERSION, as as WhenOptions, at as batch, au as compile, av as compileGraph, aw as component, ax as createNodeId, ay as derived, az as effect, aA as formatDiagnostic, aB as generateApplicationId, aC as generateNodeId, aD as isBatching, aE as isComponentDefinition, aF as isTransitionConfig, aG as nextId, aH as nodeIdPrefix, aI as observerCount, aJ as reactiveListItemKey, aK as reactiveListItemSignature, aL as resetIdCounter, aM as resolveTransition, aN as signal, aO as signalKind, aP as streetui } from './compile-DqsMQVJk.js';
|
|
3
|
+
import { R as RenderHandle, S as StreetRenderer, a as HydrationDiagnosticSink } from './hydration-diagnostics-B2FmY05M.js';
|
|
4
|
+
export { H as HydrationDiagnostic, b as HydrationMismatchType, c as consoleHydrationDiagnosticSink, d as createHydrationDiagnosticCollector, f as formatHydrationDiagnostic } from './hydration-diagnostics-B2FmY05M.js';
|
|
5
|
+
import { D as DOMAdapter } from './server-BYnmb_hR.js';
|
|
6
|
+
export { R as RenderToStringOptions, S as STATE_MARKER_ATTR, a as ServerDOMAdapter, r as readState, b as renderToString, s as serializeState, c as serverDOMAdapter } from './server-BYnmb_hR.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* A simple reactive store built on top of signals.
|
|
@@ -124,14 +124,24 @@ interface A11yIds {
|
|
|
124
124
|
readonly base: string;
|
|
125
125
|
/** Id for the primary interactive element (e.g. the input). */
|
|
126
126
|
readonly input: string;
|
|
127
|
-
/** Id for a label element / labelling text. */
|
|
127
|
+
/** Id for a label element / labelling text (target of `aria-labelledby`). */
|
|
128
128
|
readonly label: string;
|
|
129
|
-
/** Id for descriptive/help text. */
|
|
129
|
+
/** Id for descriptive/help text (target of `aria-describedby`). */
|
|
130
130
|
readonly description: string;
|
|
131
131
|
/** Id for an error message element. */
|
|
132
132
|
readonly error: string;
|
|
133
|
-
/** Id for a title element (e.g. a dialog title). */
|
|
133
|
+
/** Id for a title element (e.g. a dialog title; target of `aria-labelledby`). */
|
|
134
134
|
readonly title: string;
|
|
135
|
+
/**
|
|
136
|
+
* Id for a control that triggers a popup (button/summary). Pair with
|
|
137
|
+
* `controls` on the popup it opens (`ariaControls: ids.controls`,
|
|
138
|
+
* `ariaExpanded: open`).
|
|
139
|
+
*/
|
|
140
|
+
readonly trigger: string;
|
|
141
|
+
/** Id for a popup/region a `trigger` controls (target of `aria-controls`). */
|
|
142
|
+
readonly controls: string;
|
|
143
|
+
/** Id for a subtree owned out-of-DOM-order (target of `aria-owns`). */
|
|
144
|
+
readonly owns: string;
|
|
135
145
|
/** Derive an arbitrary suffixed id from the same base. */
|
|
136
146
|
id(suffix: string): string;
|
|
137
147
|
}
|
|
@@ -143,6 +153,12 @@ interface A11yIds {
|
|
|
143
153
|
* // ids.input === 'email-input', ids.label === 'email-label', ...
|
|
144
154
|
* input({ bind: value, id: ids.input, ariaLabelledBy: ids.label, ariaDescribedBy: ids.error });
|
|
145
155
|
* text('Email', { id: ids.label });
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* // A menu button that controls its popup, wired by shared ids:
|
|
159
|
+
* const m = a11yIds('actions');
|
|
160
|
+
* button('Actions', { id: m.trigger, ariaControls: m.controls, ariaExpanded: open });
|
|
161
|
+
* page.dropdown('menu', { open, id: m.controls }, (d) => { … });
|
|
146
162
|
*/
|
|
147
163
|
declare function a11yIds(base: string): A11yIds;
|
|
148
164
|
|
|
@@ -703,17 +719,65 @@ declare function focusInitial(dom: DOMAdapter, container: Element, initialFocusI
|
|
|
703
719
|
* cleanup is still callable.
|
|
704
720
|
*/
|
|
705
721
|
declare function trapFocus(dom: DOMAdapter, container: Element): () => void;
|
|
706
|
-
/**
|
|
707
|
-
* Modal containment: if focus moves to an element outside `container`, redirect
|
|
708
|
-
* it back inside. Listens on the document body (focusin bubbles there) and
|
|
709
|
-
* returns a cleanup function. Server-safe no-op (body() is null).
|
|
710
|
-
*/
|
|
711
722
|
declare function containFocus(dom: DOMAdapter, container: Element): () => void;
|
|
712
723
|
/**
|
|
713
724
|
* Invoke `handler` when Escape is pressed while focus is within `target`.
|
|
714
725
|
* Returns a cleanup function. Server-safe no-op.
|
|
715
726
|
*/
|
|
716
727
|
declare function onEscape(dom: DOMAdapter, target: Element, handler: () => void): () => void;
|
|
728
|
+
/**
|
|
729
|
+
* Roving-focus keyboard navigation for a menu (role="menu") container: the
|
|
730
|
+
* arrow keys move focus between the container's focusable items (wrap-around at
|
|
731
|
+
* both ends), Home/End jump to the first/last item, and Enter/Space activate
|
|
732
|
+
* the currently-focused item (a native `click`, so an item's `onClick` fires).
|
|
733
|
+
* `Tab` and `Escape` are deliberately left alone — the overlay layer wires
|
|
734
|
+
* Escape-to-close separately and a menu does not trap Tab.
|
|
735
|
+
*
|
|
736
|
+
* Items are re-queried on every key (via {@link getFocusable}) so a menu whose
|
|
737
|
+
* items change reactively is always navigated against the live set, and items
|
|
738
|
+
* disabled after mount are skipped. Attaches a keydown listener to the
|
|
739
|
+
* container and returns a cleanup function. Server-safe: `addEventListener` is
|
|
740
|
+
* a no-op and the returned cleanup is still callable.
|
|
741
|
+
*/
|
|
742
|
+
declare function rovingMenu(dom: DOMAdapter, container: Element, selector?: string): () => void;
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* ARIA live-region announcer (§15).
|
|
746
|
+
*
|
|
747
|
+
* Screen readers announce text that appears inside an `aria-live` region. The
|
|
748
|
+
* naive approach — append a fresh `<div aria-live>` per message — leaks a
|
|
749
|
+
* growing pile of stale nodes and (because a node inserted *already carrying*
|
|
750
|
+
* its text is often not re-announced) is unreliable. This announcer instead
|
|
751
|
+
* keeps exactly TWO persistent regions on `<body>` — one `polite`, one
|
|
752
|
+
* `assertive` — and mutates their text to speak. Announcing clears the region
|
|
753
|
+
* first and writes on a microtask so that repeating the same string still
|
|
754
|
+
* triggers a DOM mutation the AT will pick up.
|
|
755
|
+
*
|
|
756
|
+
* Built entirely on the {@link DOMAdapter}, so it is server-safe: when
|
|
757
|
+
* `dom.body()` is null (SSR / headless) construction returns an inert announcer
|
|
758
|
+
* whose `announce`/`clear`/`destroy` are no-ops. There is never any SSR markup
|
|
759
|
+
* for a live region — announcements are a runtime-only concept.
|
|
760
|
+
*/
|
|
761
|
+
|
|
762
|
+
interface Announcer {
|
|
763
|
+
/**
|
|
764
|
+
* Announce `message`. `assertive` (default false) routes to the assertive
|
|
765
|
+
* region (interrupts the user) instead of the polite one (waits for a pause).
|
|
766
|
+
*/
|
|
767
|
+
announce(message: string, options?: {
|
|
768
|
+
assertive?: boolean;
|
|
769
|
+
}): void;
|
|
770
|
+
/** Clear both regions without announcing anything. */
|
|
771
|
+
clear(): void;
|
|
772
|
+
/** Remove both regions from the DOM. Idempotent. */
|
|
773
|
+
destroy(): void;
|
|
774
|
+
}
|
|
775
|
+
/**
|
|
776
|
+
* Create a live-region announcer bound to `dom`. Idempotent per call — each
|
|
777
|
+
* call owns its own pair of regions, so an app that wants a single shared
|
|
778
|
+
* announcer should create one and reuse it (and `destroy()` it on teardown).
|
|
779
|
+
*/
|
|
780
|
+
declare function createAnnouncer(dom: DOMAdapter): Announcer;
|
|
717
781
|
|
|
718
782
|
/**
|
|
719
783
|
* NodeInstance — the renderer's live counterpart to a GraphNode.
|
|
@@ -824,7 +888,7 @@ declare function wireSignalBindings(ctx: RenderContext, graphNode: GraphNode, in
|
|
|
824
888
|
* (spec §15). A `conditional` node has no plan handler and falls back to the
|
|
825
889
|
* eager build factory (it only ever renders 0..1 branch, so eager is fine).
|
|
826
890
|
*/
|
|
827
|
-
declare function wireReactiveList(ctx: RenderContext, graphNode: GraphNode, instance: NodeInstance, el: Element): void;
|
|
891
|
+
declare function wireReactiveList(ctx: RenderContext, graphNode: GraphNode, instance: NodeInstance, el: Element, runAppear?: boolean): void;
|
|
828
892
|
/**
|
|
829
893
|
* Attach overlay focus/keyboard behavior to a mounted portal. Server-safe: on
|
|
830
894
|
* the server `dom.body()` is null so this returns immediately (SSR emits inert
|
|
@@ -839,6 +903,16 @@ declare function wireReactiveList(ctx: RenderContext, graphNode: GraphNode, inst
|
|
|
839
903
|
* focus. All listeners are tracked on the instance and torn down on unmount.
|
|
840
904
|
*/
|
|
841
905
|
declare function wireOverlayBehavior(ctx: RenderContext, graphNode: GraphNode, instance: NodeInstance, target: Element): void;
|
|
906
|
+
/**
|
|
907
|
+
* Wire a component instance's lifecycle (§9). Reads the optional
|
|
908
|
+
* `__component__<id>` descriptor — an array of teardown callbacks the DSL's
|
|
909
|
+
* `component()` collected from the setup's `ctx.effect`/`ctx.onCleanup` — and
|
|
910
|
+
* routes each into `NodeInstance.trackCleanup`, so they run (children-first)
|
|
911
|
+
* when the component leaves the graph. Shared by the mount and hydrate paths so
|
|
912
|
+
* both attach identical ownership. A `'component'` node with no cleanups (no
|
|
913
|
+
* effects/resources) registers no descriptor and this is a no-op.
|
|
914
|
+
*/
|
|
915
|
+
declare function wireComponentBehavior(ctx: RenderContext, graphNode: GraphNode, instance: NodeInstance): void;
|
|
842
916
|
|
|
843
917
|
/**
|
|
844
918
|
* Patch — targeted DOM updates driven by signal changes.
|
|
@@ -849,6 +923,122 @@ declare function wireOverlayBehavior(ctx: RenderContext, graphNode: GraphNode, i
|
|
|
849
923
|
|
|
850
924
|
declare function patchNode(ctx: RenderContext, graphNode: GraphNode, propKey: string, newValue: unknown): void;
|
|
851
925
|
|
|
926
|
+
/**
|
|
927
|
+
* CSS class-based enter/leave transition controller (§2–§8).
|
|
928
|
+
*
|
|
929
|
+
* This is the browser-only runtime that consumes the `__transition__<nodeId>`
|
|
930
|
+
* descriptor the DSL registers (a pre-resolved {@link ResolvedTransitionLike}).
|
|
931
|
+
* It is deliberately structural about that descriptor — like the renderer's
|
|
932
|
+
* `__overlay__`/`__component__` handling — so the renderer takes NO compile-time
|
|
933
|
+
* dependency on the DSL package.
|
|
934
|
+
*
|
|
935
|
+
* Engine (confirmed decision): CSS classes, no Web Animations API, no
|
|
936
|
+
* browser-only API referenced at module scope. Every timer / rAF / event
|
|
937
|
+
* binding is reached lazily through `globalThis` and only ever runs when
|
|
938
|
+
* `dom.body() !== null` (the same SSR guard `wireOverlayBehavior` uses), so:
|
|
939
|
+
* - server output is byte-identical (nothing here runs during SSR — §21);
|
|
940
|
+
* - happy-dom, which dispatches no `transitionend`/`animationend`, still
|
|
941
|
+
* completes deterministically via the fallback timeout (§24).
|
|
942
|
+
*
|
|
943
|
+
* The controller is created once per reactive container instance (reactive-list
|
|
944
|
+
* or conditional) so its `leaving` map survives across reconcile passes — that
|
|
945
|
+
* is what makes leave→enter reclaim (§6) and keyed-identity list leave (§7)
|
|
946
|
+
* correct.
|
|
947
|
+
*/
|
|
948
|
+
|
|
949
|
+
/**
|
|
950
|
+
* The renderer's structural view of the resolved transition the DSL stores in
|
|
951
|
+
* `__transition__<id>`. Mirrors `streetui`'s `ResolvedTransition` without
|
|
952
|
+
* importing it (no renderer→dsl dependency).
|
|
953
|
+
*/
|
|
954
|
+
interface ResolvedTransitionLike {
|
|
955
|
+
readonly enterActive: readonly string[];
|
|
956
|
+
readonly enterFrom: readonly string[];
|
|
957
|
+
readonly enterTo: readonly string[];
|
|
958
|
+
readonly leaveActive: readonly string[];
|
|
959
|
+
readonly leaveFrom: readonly string[];
|
|
960
|
+
readonly leaveTo: readonly string[];
|
|
961
|
+
readonly appear: boolean;
|
|
962
|
+
readonly duration: number;
|
|
963
|
+
}
|
|
964
|
+
/**
|
|
965
|
+
* Hooks handed to the reconciler so it can (a) reclaim an instance that is
|
|
966
|
+
* mid-leave when its key re-enters (leave→enter cancellation), (b) defer the
|
|
967
|
+
* remove/dispose/forget/detach chain for a leaving instance until its animation
|
|
968
|
+
* ends, and (c) play the enter animation for a freshly-inserted instance. When
|
|
969
|
+
* no transition applies (or we are on the server) every hook degrades to the
|
|
970
|
+
* pre-transition synchronous behaviour.
|
|
971
|
+
*/
|
|
972
|
+
interface TransitionHooks {
|
|
973
|
+
/**
|
|
974
|
+
* If an instance for `key` is currently animating out, cancel its leave and
|
|
975
|
+
* return it for reuse; otherwise undefined. The caller re-mounts nothing and
|
|
976
|
+
* reuses the returned instance's live DOM node.
|
|
977
|
+
*/
|
|
978
|
+
takeLeaving(key: string): NodeInstance | undefined;
|
|
979
|
+
/**
|
|
980
|
+
* Begin a leave animation for a removed instance. Returns true when the whole
|
|
981
|
+
* teardown chain has been deferred to animation-end (caller must NOT remove,
|
|
982
|
+
* dispose, forget or detach it), or false when there is no transition / no
|
|
983
|
+
* browser and the caller should tear it down synchronously as before.
|
|
984
|
+
*/
|
|
985
|
+
beginLeave(inst: NodeInstance): boolean;
|
|
986
|
+
/** Play the enter animation for a freshly-inserted (or reclaimed) instance. */
|
|
987
|
+
onEnter(inst: NodeInstance): void;
|
|
988
|
+
}
|
|
989
|
+
/** Read the pre-resolved transition descriptor for a node, if any. */
|
|
990
|
+
declare function getResolvedTransition(graph: ApplicationGraph, nodeId: string): ResolvedTransitionLike | undefined;
|
|
991
|
+
/** Which half of a transition to play on a bare element. */
|
|
992
|
+
type TransitionPhase = 'enter' | 'leave';
|
|
993
|
+
/**
|
|
994
|
+
* Play one enter/leave transition on a bare DOM element, outside the keyed
|
|
995
|
+
* reconciler — the seam the router uses for route leave/enter (§9) and any other
|
|
996
|
+
* consumer that owns a single host element rather than a reactive container.
|
|
997
|
+
*
|
|
998
|
+
* Reuses the exact same {@link startRun} mechanics as list/conditional
|
|
999
|
+
* transitions (from+active applied immediately, next-frame flip to `to`,
|
|
1000
|
+
* completion on transitionend/animationend or the fallback timer), so there is
|
|
1001
|
+
* one transition engine, not two. The returned handle's `cancel()` settles the
|
|
1002
|
+
* run immediately WITHOUT invoking `onDone` — the caller uses it to abort an
|
|
1003
|
+
* in-flight enter when the same host is about to start leaving (rapid
|
|
1004
|
+
* navigation), avoiding overlapping runs/duplicate listeners on one element.
|
|
1005
|
+
*
|
|
1006
|
+
* On the server (or any non-element target) there is nothing to animate, so
|
|
1007
|
+
* `onDone` runs synchronously and `cancel()` is a no-op — the caller's teardown
|
|
1008
|
+
* still happens exactly once.
|
|
1009
|
+
*/
|
|
1010
|
+
declare function runElementTransition(dom: DOMAdapter, el: Element, rt: ResolvedTransitionLike, phase: TransitionPhase, onDone: () => void): {
|
|
1011
|
+
cancel(): void;
|
|
1012
|
+
};
|
|
1013
|
+
/**
|
|
1014
|
+
* Per-container transition controller. One instance is created for each
|
|
1015
|
+
* reactive-list / conditional NodeInstance in {@link wireReactiveList}; its
|
|
1016
|
+
* `leaving` map persists across every reconcile of that container.
|
|
1017
|
+
*/
|
|
1018
|
+
declare class TransitionController {
|
|
1019
|
+
private readonly dom;
|
|
1020
|
+
private readonly graph;
|
|
1021
|
+
/** Full teardown of a leaving instance (remove + dispose + forget + detach). */
|
|
1022
|
+
private readonly finalize;
|
|
1023
|
+
private readonly leaving;
|
|
1024
|
+
constructor(dom: DOMAdapter, graph: ApplicationGraph,
|
|
1025
|
+
/** Full teardown of a leaving instance (remove + dispose + forget + detach). */
|
|
1026
|
+
finalize: (inst: NodeInstance) => void);
|
|
1027
|
+
/** True only in a real DOM environment (browser). */
|
|
1028
|
+
private get browser();
|
|
1029
|
+
private keyOf;
|
|
1030
|
+
private resolved;
|
|
1031
|
+
/** Run the enter animation for `inst` if it carries a transition (browser only). */
|
|
1032
|
+
enter(inst: NodeInstance): void;
|
|
1033
|
+
/**
|
|
1034
|
+
* Play `appear` for any initial child that opted into it (fresh browser mount
|
|
1035
|
+
* only — hydration must never animate appear, §22, and this is called only on
|
|
1036
|
+
* the mount path).
|
|
1037
|
+
*/
|
|
1038
|
+
appear(children: readonly NodeInstance[]): void;
|
|
1039
|
+
hooks(): TransitionHooks;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
852
1042
|
/**
|
|
853
1043
|
* Reconciliation — diff-based child list updates.
|
|
854
1044
|
*
|
|
@@ -901,7 +1091,7 @@ interface PlanEntry {
|
|
|
901
1091
|
* @param newNodes New graph children (in desired order)
|
|
902
1092
|
* @param mountFn Factory to create a new NodeInstance for a graph node
|
|
903
1093
|
*/
|
|
904
|
-
declare function reconcileChildren(ctx: RenderContext, parentDom: Element, oldInstances: NodeInstance[], newNodes: readonly GraphNode[], mountFn: MountFn): ReconcileResult;
|
|
1094
|
+
declare function reconcileChildren(ctx: RenderContext, parentDom: Element, oldInstances: NodeInstance[], newNodes: readonly GraphNode[], mountFn: MountFn, hooks?: TransitionHooks): ReconcileResult;
|
|
905
1095
|
/**
|
|
906
1096
|
* Plan-based keyed reconciliation (spec §15 — the optimised reactive-list path).
|
|
907
1097
|
*
|
|
@@ -920,7 +1110,7 @@ declare function reconcileChildren(ctx: RenderContext, parentDom: Element, oldIn
|
|
|
920
1110
|
* DOM reordering uses a longest-increasing-subsequence pass so the number of
|
|
921
1111
|
* moves is minimal (e.g. a prepend into a 10k list moves 1 node, not 10k).
|
|
922
1112
|
*/
|
|
923
|
-
declare function reconcileChildrenByPlan(ctx: RenderContext, parentDom: Element, oldInstances: NodeInstance[], plan: readonly PlanEntry[], mountFn: MountFn): ReconcileResult;
|
|
1113
|
+
declare function reconcileChildrenByPlan(ctx: RenderContext, parentDom: Element, oldInstances: NodeInstance[], plan: readonly PlanEntry[], mountFn: MountFn, hooks?: TransitionHooks): ReconcileResult;
|
|
924
1114
|
|
|
925
1115
|
/**
|
|
926
1116
|
* StreetUI Renderer — framework-owned DOM renderer.
|
|
@@ -1243,6 +1433,17 @@ interface MountRouterOptions {
|
|
|
1243
1433
|
* subsequent client-side navigations mount normally. Defaults to false.
|
|
1244
1434
|
*/
|
|
1245
1435
|
readonly hydrate?: boolean;
|
|
1436
|
+
/**
|
|
1437
|
+
* Optional enter/leave transition played on client-side navigations (§9). When
|
|
1438
|
+
* set, each navigation mounts the incoming route into its own host wrapper,
|
|
1439
|
+
* plays the enter animation on it, and defers the outgoing route's disposal
|
|
1440
|
+
* (route-scoped cleanup + DOM removal) until its leave animation ends — so
|
|
1441
|
+
* resources stay alive exactly as long as the departing DOM. History is
|
|
1442
|
+
* untouched (the router already navigated), and the initial mount/hydration is
|
|
1443
|
+
* NOT animated (§22-style: the first paint must match the server). Reuses the
|
|
1444
|
+
* single CSS-class transition engine — no second animation system.
|
|
1445
|
+
*/
|
|
1446
|
+
readonly transition?: TransitionConfig;
|
|
1246
1447
|
}
|
|
1247
1448
|
interface MountedRouter {
|
|
1248
1449
|
/** The element route content is rendered into. */
|
|
@@ -1457,6 +1658,81 @@ declare function printGraph(graph: ApplicationGraph): string;
|
|
|
1457
1658
|
declare function printDiagnostics(compiled: CompiledApplication): string;
|
|
1458
1659
|
/** Returns node counts per type. */
|
|
1459
1660
|
declare function nodeTypeStats(graph: ApplicationGraph): Record<string, number>;
|
|
1661
|
+
/** A single component instance surfaced for DevTools inspection (§21). */
|
|
1662
|
+
interface InspectedComponent {
|
|
1663
|
+
/** The build-order node id (churns across rebuilds — not stable identity). */
|
|
1664
|
+
id: string;
|
|
1665
|
+
/** The stable, author-provided identity key passed at the call site. */
|
|
1666
|
+
key: string | undefined;
|
|
1667
|
+
/** The definition's human-readable name (from `data-streetui-component`). */
|
|
1668
|
+
name: string;
|
|
1669
|
+
/** Depth of the component node in the graph. */
|
|
1670
|
+
depth: number;
|
|
1671
|
+
/** Number of direct child nodes the component rendered. */
|
|
1672
|
+
childCount: number;
|
|
1673
|
+
}
|
|
1674
|
+
/**
|
|
1675
|
+
* List every `component()` instance in the graph, in document order, with its
|
|
1676
|
+
* stable `key`, human-readable `name` and location. Components are ordinary
|
|
1677
|
+
* `'component'` GraphNodes (they flow through `inspectGraph`/`printGraph`
|
|
1678
|
+
* already); this is the first-class, component-aware view for DevTools — it
|
|
1679
|
+
* reads the inspectable `data-streetui-component` name attribute the DSL sets,
|
|
1680
|
+
* never any internal `_`-prefixed metadata. Names/keys are stable across
|
|
1681
|
+
* fine-grained prop updates (which never rebuild the node).
|
|
1682
|
+
*/
|
|
1683
|
+
declare function inspectComponents(graph: ApplicationGraph): InspectedComponent[];
|
|
1684
|
+
/** An overlay currently wired in the graph (dialog/popover/tooltip/…). */
|
|
1685
|
+
interface InspectedOverlay {
|
|
1686
|
+
/** The build-order node id of the overlay's portal host. */
|
|
1687
|
+
id: string;
|
|
1688
|
+
/** The stable author-provided key, if any. */
|
|
1689
|
+
key: string | undefined;
|
|
1690
|
+
/** Whether the overlay is open right now (peeked, no subscription). */
|
|
1691
|
+
open: boolean;
|
|
1692
|
+
/** Modal (focus-trapping) overlay? */
|
|
1693
|
+
modal: boolean;
|
|
1694
|
+
/** Does it move focus into itself on open? */
|
|
1695
|
+
takesFocus: boolean;
|
|
1696
|
+
/** Is it a roving-focus menu (role="menu")? */
|
|
1697
|
+
menu: boolean;
|
|
1698
|
+
/** Does Escape close it? */
|
|
1699
|
+
closeOnEscape: boolean;
|
|
1700
|
+
/** Does it restore focus to the opener on close? */
|
|
1701
|
+
restoreFocus: boolean;
|
|
1702
|
+
/** Depth of the portal host node in the graph. */
|
|
1703
|
+
depth: number;
|
|
1704
|
+
}
|
|
1705
|
+
/** A transition currently wired on a graph node. */
|
|
1706
|
+
interface InspectedTransition {
|
|
1707
|
+
/** The build-order node id the transition is attached to. */
|
|
1708
|
+
id: string;
|
|
1709
|
+
/** The stable author-provided key, if any. */
|
|
1710
|
+
key: string | undefined;
|
|
1711
|
+
/** The node type the transition animates (element/portal/list-item/…). */
|
|
1712
|
+
nodeType: string;
|
|
1713
|
+
/** Fallback completion timeout in ms (the resolved `duration`). */
|
|
1714
|
+
duration: number;
|
|
1715
|
+
/** Does it animate the very first appearance (initial mount)? */
|
|
1716
|
+
appear: boolean;
|
|
1717
|
+
/** Depth of the node in the graph. */
|
|
1718
|
+
depth: number;
|
|
1719
|
+
}
|
|
1720
|
+
/** A prod-safe snapshot of the graph's interaction wiring. */
|
|
1721
|
+
interface InspectedInteractions {
|
|
1722
|
+
overlays: InspectedOverlay[];
|
|
1723
|
+
transitions: InspectedTransition[];
|
|
1724
|
+
}
|
|
1725
|
+
/**
|
|
1726
|
+
* Snapshot every overlay and transition currently wired in the graph, in
|
|
1727
|
+
* document order. This is the interaction-aware companion to
|
|
1728
|
+
* {@link inspectComponents}: it reads only the `__overlay__<id>` /
|
|
1729
|
+
* `__transition__<id>` handler descriptors and public graph structure — it
|
|
1730
|
+
* peeks the `open` signal without subscribing, retains no DOM nodes, mutates
|
|
1731
|
+
* nothing, and is safe to call in production. Because a departing overlay's
|
|
1732
|
+
* handler is pruned on detach (`_unregisterNodeHandlers`), a closed-and-removed
|
|
1733
|
+
* overlay simply no longer appears here.
|
|
1734
|
+
*/
|
|
1735
|
+
declare function inspectInteractions(graph: ApplicationGraph): InspectedInteractions;
|
|
1460
1736
|
|
|
1461
1737
|
/**
|
|
1462
1738
|
* DevTools foundation (v0.6, Phase 18). A single read-only entry point that
|
|
@@ -1890,4 +2166,4 @@ interface ResolvedConfig {
|
|
|
1890
2166
|
/** Identity helper that gives `streetui.config.ts` full type-checking + inference. */
|
|
1891
2167
|
declare function defineConfig(config: StreetUIConfig): StreetUIConfig;
|
|
1892
2168
|
|
|
1893
|
-
export { type A11yIds, Application, ApplicationGraph, ApplicationId, type ApplicationIdentity, type ApplicationInspection, type ApplicationOptions, type ApplicationPanel, BrowserDOMAdapter, CleanupRegistry, CompiledApplication, ContainerDSL, type Context, type ContextInspection, type ContextLike, DEFAULT_PERF_THRESHOLDS, DOMAdapter, type DevToolsOptions, type DevToolsSession, type DevToolsSnapshot, type DevToolsSources, DiagnosticCollector, type DiagnosticContext, type DiagnosticSink, type DiagnosticsSummary, type DomBinding, DomEventRegistry, Environment, type EnvironmentCapabilities, type EnvironmentKind, EventBus, type EventHandler, FOCUSABLE_SELECTOR, type Field, type Form, type FormConfig, type FormInspection, type FormLike, type FormValidators, type FormValues, GraphNode, HydrationDiagnosticSink, type I18n, type I18nConfig, type I18nInspection, type I18nLike, type InspectFormOptions, type InspectI18nOptions, type InspectResourceOptions, type InspectSignalOptions, type InspectedNode, type InspectedPage, type InterpolationParams, type IsActiveOptions, type Job, Lifecycle, type LifecycleHook, type LifecyclePhase, type MatchResult, type MessageMap, type MountFn, type MountRouterOptions, type MountedApplication, type MountedRouter, type NavigateOptions, NodeInstance, type NodeInstanceOptions, PageDSL, type PerfDiagnostic, type PerfDiagnosticCode, type PerfSnapshot, type PerfThresholds, type PerformancePanel, type PlanEntry, type Priority, ROUTER_OUTLET_ID, ReadonlySignal, type ReconcileResult, type RenderContext, RenderHandle, type ResolvedConfig, type Resource, type ResourceInspection, type ResourceLike, type ResourceLoader, type ResourceLoaderContext, type ResourceOptions, type ResourceStatus, type RouteBuilder, type RouteContext, type RouteDefinition, type RouteMatch, type RouteMatchLike, type Router, type RouterHistory, type RouterInspection, type RouterLike, type RouterLocation, type RouterOptions, Runtime, RuntimeNodeInstance, type RuntimeOptions, Scheduler, type SchedulerDiagnostics, SemanticNodeType, ServerComment, ServerElement, ServerFragment, type ServerNode, type ServerNodeKind, type ServerParent, ServerRawHTML, ServerStyle, ServerText, type ShellBuilder, Signal, type SignalInspection, SignalKind, type SignalsPanel, Store, type StoreState, type StreetEvent, type StreetEventType, StreetFrameworkError, StreetRenderHandle, StreetRenderer, StreetRendererImpl, type StreetRendererOptions, type StreetUIConfig, type SubmitStatus, Subscriber, Unsubscribe, type Validator, a11yIds, applyNodeProps, applyProp, bindDomEvent, browserDOMAdapter, buttonUpdate, consoleDiagnosticSink, containFocus, createApplication, createBrowserHistory, createContext, createDevTools, createForm, createI18n, createMemoryHistory, createRenderContext, createRenderer, createRouter, createRuntime, createStore, createStreetEvent, defineConfig, diagnosePerformance, email, environment, escapeHtmlAttr, escapeHtmlText, flushSync, focusById, focusFirst, focusInitial, formatDiagnosticContext, frameworkError, getFocusable, globalEventBus, headingUpdate, hydrateGraph, inputUpdate, inspectApplication, inspectContext, inspectForm, inspectGraph, inspectI18n, inspectResource, inspectRouter, inspectSignal, interpolate, matchPattern, matchRoutes, maxLength, minLength, mountGraph, mountNode, mountRouter, nodeTypeStats, normalizePath, onEscape, patchNode, patchProp, pattern, printDiagnostics, printGraph, reconcileChildren, reconcileChildrenByPlan, reportDiagnostic, required, resolveTag, resource, restoreFocus, routerOutlet, runValidators, saveFocus, scheduleImmediate, scheduleUpdate, scheduler, serializeChildren, serializeServerNode, splitTarget, textUpdate, toIdToken, transformGraph, trapFocus, validateGraph, wireEvents, wireOverlayBehavior, wireReactiveList, wireSignalBindings };
|
|
2169
|
+
export { type A11yIds, type Announcer, Application, ApplicationGraph, ApplicationId, type ApplicationIdentity, type ApplicationInspection, type ApplicationOptions, type ApplicationPanel, BrowserDOMAdapter, CleanupRegistry, CompiledApplication, ContainerDSL, type Context, type ContextInspection, type ContextLike, DEFAULT_PERF_THRESHOLDS, DOMAdapter, type DevToolsOptions, type DevToolsSession, type DevToolsSnapshot, type DevToolsSources, DiagnosticCollector, type DiagnosticContext, type DiagnosticSink, type DiagnosticsSummary, type DomBinding, DomEventRegistry, Environment, type EnvironmentCapabilities, type EnvironmentKind, EventBus, type EventHandler, FOCUSABLE_SELECTOR, type Field, type Form, type FormConfig, type FormInspection, type FormLike, type FormValidators, type FormValues, GraphNode, HydrationDiagnosticSink, type I18n, type I18nConfig, type I18nInspection, type I18nLike, type InspectFormOptions, type InspectI18nOptions, type InspectResourceOptions, type InspectSignalOptions, type InspectedComponent, type InspectedInteractions, type InspectedNode, type InspectedOverlay, type InspectedPage, type InspectedTransition, type InterpolationParams, type IsActiveOptions, type Job, Lifecycle, type LifecycleHook, type LifecyclePhase, type MatchResult, type MessageMap, type MountFn, type MountRouterOptions, type MountedApplication, type MountedRouter, type NavigateOptions, NodeInstance, type NodeInstanceOptions, PageDSL, type PerfDiagnostic, type PerfDiagnosticCode, type PerfSnapshot, type PerfThresholds, type PerformancePanel, type PlanEntry, type Priority, ROUTER_OUTLET_ID, ReadonlySignal, type ReconcileResult, type RenderContext, RenderHandle, type ResolvedConfig, type ResolvedTransitionLike, type Resource, type ResourceInspection, type ResourceLike, type ResourceLoader, type ResourceLoaderContext, type ResourceOptions, type ResourceStatus, type RouteBuilder, type RouteContext, type RouteDefinition, type RouteMatch, type RouteMatchLike, type Router, type RouterHistory, type RouterInspection, type RouterLike, type RouterLocation, type RouterOptions, Runtime, RuntimeNodeInstance, type RuntimeOptions, Scheduler, type SchedulerDiagnostics, SemanticNodeType, ServerComment, ServerElement, ServerFragment, type ServerNode, type ServerNodeKind, type ServerParent, ServerRawHTML, ServerStyle, ServerText, type ShellBuilder, Signal, type SignalInspection, SignalKind, type SignalsPanel, Store, type StoreState, type StreetEvent, type StreetEventType, StreetFrameworkError, StreetRenderHandle, StreetRenderer, StreetRendererImpl, type StreetRendererOptions, type StreetUIConfig, type SubmitStatus, Subscriber, TransitionConfig, TransitionController, type TransitionHooks, type TransitionPhase, Unsubscribe, type Validator, a11yIds, applyNodeProps, applyProp, bindDomEvent, browserDOMAdapter, buttonUpdate, consoleDiagnosticSink, containFocus, createAnnouncer, createApplication, createBrowserHistory, createContext, createDevTools, createForm, createI18n, createMemoryHistory, createRenderContext, createRenderer, createRouter, createRuntime, createStore, createStreetEvent, defineConfig, diagnosePerformance, email, environment, escapeHtmlAttr, escapeHtmlText, flushSync, focusById, focusFirst, focusInitial, formatDiagnosticContext, frameworkError, getFocusable, getResolvedTransition, globalEventBus, headingUpdate, hydrateGraph, inputUpdate, inspectApplication, inspectComponents, inspectContext, inspectForm, inspectGraph, inspectI18n, inspectInteractions, inspectResource, inspectRouter, inspectSignal, interpolate, matchPattern, matchRoutes, maxLength, minLength, mountGraph, mountNode, mountRouter, nodeTypeStats, normalizePath, onEscape, patchNode, patchProp, pattern, printDiagnostics, printGraph, reconcileChildren, reconcileChildrenByPlan, reportDiagnostic, required, resolveTag, resource, restoreFocus, routerOutlet, rovingMenu, runElementTransition, runValidators, saveFocus, scheduleImmediate, scheduleUpdate, scheduler, serializeChildren, serializeServerNode, splitTarget, textUpdate, toIdToken, transformGraph, trapFocus, validateGraph, wireComponentBehavior, wireEvents, wireOverlayBehavior, wireReactiveList, wireSignalBindings };
|