streetui 1.6.0 → 1.7.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.
@@ -1,4 +1,4 @@
1
- import { C as CompiledApplication } from './compile-CEom4hkp.cjs';
1
+ import { C as CompiledApplication } from './compile-Cte0nf06.cjs';
2
2
 
3
3
  /**
4
4
  * DOMAdapter — framework-owned abstraction over DOM operations.
@@ -11,6 +11,13 @@ interface DOMAdapter {
11
11
  createTextNode(data: string): Text;
12
12
  createComment(data: string): Comment;
13
13
  createFragment(): DocumentFragment;
14
+ /**
15
+ * Optional, server-only: create a verbatim pre-serialized HTML node used by
16
+ * the v1.7 static SSR plan. The browser adapter does not implement it; the
17
+ * renderer only calls it when a static SSR plan is active (i.e. during SSR),
18
+ * so client builds never reach this path and it stays tree-shakeable.
19
+ */
20
+ createRawHTML?(html: string): Node;
14
21
  appendChild(parent: Node, child: Node): void;
15
22
  insertBefore(parent: Node, child: Node, reference: Node | null): void;
16
23
  removeChild(parent: Node, child: Node): void;
@@ -31,6 +38,18 @@ interface DOMAdapter {
31
38
  * focus) this is a safe no-op, keeping focus management SSR-compatible.
32
39
  */
33
40
  focus(element: Element): void;
41
+ /**
42
+ * The document body — the default mount target for portals/overlays. Returns
43
+ * null on the server (no document), which is what makes portal SSR degrade to
44
+ * inline rendering and focus management degrade to a no-op.
45
+ */
46
+ body(): Element | null;
47
+ /** The currently focused element, or null on the server / when none is focused. */
48
+ activeElement(): Element | null;
49
+ /** True if `ancestor` contains `node` (inclusive). Always false on the server. */
50
+ contains(ancestor: Element, node: Node): boolean;
51
+ /** True if `element` matches the given CSS selector. Always false on the server. */
52
+ matches(element: Element, selector: string): boolean;
34
53
  isElement(node: Node): node is Element;
35
54
  isTextNode(node: Node): node is Text;
36
55
  /** Lower-cased tag name of an element (e.g. "div", "h1"). */
@@ -62,6 +81,13 @@ declare class ServerDOMAdapter implements DOMAdapter {
62
81
  createTextNode(data: string): Text;
63
82
  createComment(data: string): Comment;
64
83
  createFragment(): DocumentFragment;
84
+ /**
85
+ * Create a verbatim pre-serialized HTML node (v1.7 static SSR plan, §6).
86
+ * Server-only: the browser adapter does not implement this, and the renderer
87
+ * fast path only invokes it when a static SSR plan is present (SSR). The
88
+ * stored HTML was produced by this same serializer, so it is emitted as-is.
89
+ */
90
+ createRawHTML(html: string): Node;
65
91
  appendChild(parent: Node, child: Node): void;
66
92
  insertBefore(parent: Node, child: Node, reference: Node | null): void;
67
93
  removeChild(parent: Node, child: Node): void;
@@ -79,6 +105,10 @@ declare class ServerDOMAdapter implements DOMAdapter {
79
105
  querySelectorAll(): NodeListOf<Element>;
80
106
  getElementById(): Element | null;
81
107
  focus(): void;
108
+ body(): Element | null;
109
+ activeElement(): Element | null;
110
+ contains(_ancestor: Element, _node: Node): boolean;
111
+ matches(_element: Element, _selector: string): boolean;
82
112
  isElement(node: Node): node is Element;
83
113
  isTextNode(node: Node): node is Text;
84
114
  tagName(element: Element): string;
@@ -152,6 +182,18 @@ interface RenderToStringOptions {
152
182
  * `ServerDOMAdapter` per call so concurrent renders never share state.
153
183
  */
154
184
  readonly domAdapter?: ServerDOMAdapter;
185
+ /**
186
+ * @internal — testing/benchmark knob for the v1.7 static SSR plan.
187
+ *
188
+ * `undefined` (default): use the per-app cached plan (build once, reuse).
189
+ * `null`: disable the plan entirely — the exact v1.6 runtime mount path, used
190
+ * by the byte-identity gate and A/B benchmark as the "legacy" baseline.
191
+ * a map: use this explicit plan.
192
+ *
193
+ * Not part of the supported public API; output is byte-identical regardless
194
+ * of this value (§8).
195
+ */
196
+ readonly staticPlan?: ReadonlyMap<string, string> | null;
155
197
  }
156
198
  /**
157
199
  * Render a compiled StreetUI application to an HTML string.
@@ -1,4 +1,4 @@
1
- import { C as CompiledApplication } from './compile-CEom4hkp.js';
1
+ import { C as CompiledApplication } from './compile-Cte0nf06.js';
2
2
 
3
3
  /**
4
4
  * DOMAdapter — framework-owned abstraction over DOM operations.
@@ -11,6 +11,13 @@ interface DOMAdapter {
11
11
  createTextNode(data: string): Text;
12
12
  createComment(data: string): Comment;
13
13
  createFragment(): DocumentFragment;
14
+ /**
15
+ * Optional, server-only: create a verbatim pre-serialized HTML node used by
16
+ * the v1.7 static SSR plan. The browser adapter does not implement it; the
17
+ * renderer only calls it when a static SSR plan is active (i.e. during SSR),
18
+ * so client builds never reach this path and it stays tree-shakeable.
19
+ */
20
+ createRawHTML?(html: string): Node;
14
21
  appendChild(parent: Node, child: Node): void;
15
22
  insertBefore(parent: Node, child: Node, reference: Node | null): void;
16
23
  removeChild(parent: Node, child: Node): void;
@@ -31,6 +38,18 @@ interface DOMAdapter {
31
38
  * focus) this is a safe no-op, keeping focus management SSR-compatible.
32
39
  */
33
40
  focus(element: Element): void;
41
+ /**
42
+ * The document body — the default mount target for portals/overlays. Returns
43
+ * null on the server (no document), which is what makes portal SSR degrade to
44
+ * inline rendering and focus management degrade to a no-op.
45
+ */
46
+ body(): Element | null;
47
+ /** The currently focused element, or null on the server / when none is focused. */
48
+ activeElement(): Element | null;
49
+ /** True if `ancestor` contains `node` (inclusive). Always false on the server. */
50
+ contains(ancestor: Element, node: Node): boolean;
51
+ /** True if `element` matches the given CSS selector. Always false on the server. */
52
+ matches(element: Element, selector: string): boolean;
34
53
  isElement(node: Node): node is Element;
35
54
  isTextNode(node: Node): node is Text;
36
55
  /** Lower-cased tag name of an element (e.g. "div", "h1"). */
@@ -62,6 +81,13 @@ declare class ServerDOMAdapter implements DOMAdapter {
62
81
  createTextNode(data: string): Text;
63
82
  createComment(data: string): Comment;
64
83
  createFragment(): DocumentFragment;
84
+ /**
85
+ * Create a verbatim pre-serialized HTML node (v1.7 static SSR plan, §6).
86
+ * Server-only: the browser adapter does not implement this, and the renderer
87
+ * fast path only invokes it when a static SSR plan is present (SSR). The
88
+ * stored HTML was produced by this same serializer, so it is emitted as-is.
89
+ */
90
+ createRawHTML(html: string): Node;
65
91
  appendChild(parent: Node, child: Node): void;
66
92
  insertBefore(parent: Node, child: Node, reference: Node | null): void;
67
93
  removeChild(parent: Node, child: Node): void;
@@ -79,6 +105,10 @@ declare class ServerDOMAdapter implements DOMAdapter {
79
105
  querySelectorAll(): NodeListOf<Element>;
80
106
  getElementById(): Element | null;
81
107
  focus(): void;
108
+ body(): Element | null;
109
+ activeElement(): Element | null;
110
+ contains(_ancestor: Element, _node: Node): boolean;
111
+ matches(_element: Element, _selector: string): boolean;
82
112
  isElement(node: Node): node is Element;
83
113
  isTextNode(node: Node): node is Text;
84
114
  tagName(element: Element): string;
@@ -152,6 +182,18 @@ interface RenderToStringOptions {
152
182
  * `ServerDOMAdapter` per call so concurrent renders never share state.
153
183
  */
154
184
  readonly domAdapter?: ServerDOMAdapter;
185
+ /**
186
+ * @internal — testing/benchmark knob for the v1.7 static SSR plan.
187
+ *
188
+ * `undefined` (default): use the per-app cached plan (build once, reuse).
189
+ * `null`: disable the plan entirely — the exact v1.6 runtime mount path, used
190
+ * by the byte-identity gate and A/B benchmark as the "legacy" baseline.
191
+ * a map: use this explicit plan.
192
+ *
193
+ * Not part of the supported public API; output is byte-identical regardless
194
+ * of this value (§8).
195
+ */
196
+ readonly staticPlan?: ReadonlyMap<string, string> | null;
155
197
  }
156
198
  /**
157
199
  * Render a compiled StreetUI application to an HTML string.