@openelement/protocol 1.0.0-alpha.14 → 1.0.0-alpha.16

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,7 +1,7 @@
1
1
  //#region src/stream-frame-policy.d.ts
2
2
  /**
3
3
  * Streamed-frame admission policy — the canonical deny lists a deferred
4
- * text/Region Part frame must satisfy for the browser installer to accept it.
4
+ * text/Block Part frame must satisfy for the browser installer to accept it.
5
5
  *
6
6
  * This module is import-free and host-free by design (same base-of-graph
7
7
  * contract as forbidden-sinks.ts) and is the single policy source for every
@@ -1,7 +1,7 @@
1
1
  //#region src/stream-frame-policy.ts
2
2
  /**
3
3
  * Streamed-frame admission policy — the canonical deny lists a deferred
4
- * text/Region Part frame must satisfy for the browser installer to accept it.
4
+ * text/Block Part frame must satisfy for the browser installer to accept it.
5
5
  *
6
6
  * This module is import-free and host-free by design (same base-of-graph
7
7
  * contract as forbidden-sinks.ts) and is the single policy source for every
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * In browsers this delegates to the native CSSStyleSheet API. In SSR runtimes
6
6
  * it falls back to a minimal in-memory implementation that exposes the subset
7
- * used by OpenElement and renderDsd().
7
+ * used by OpenElement and renderToString().
8
8
  */
9
9
  export interface StyleSheetRule {
10
10
  cssText: string;
@@ -14,4 +14,63 @@ export interface StyleSheetLike {
14
14
  replaceSync(text: string): void;
15
15
  readonly cssRules: StyleSheetRule[];
16
16
  }
17
+ /**
18
+ * The one key under which a sheet carries its readiness promise: the generated
19
+ * client style adapter records it on the sheet it exports, and the element
20
+ * runtime reads the same key to hand styles to roots that are already
21
+ * connected. Build-time and runtime cannot drift because the adapter generator
22
+ * interpolates this exact name.
23
+ *
24
+ * The promise settles once. Fulfillment means the rules were installed through
25
+ * `replace()`; rejection carries the load or replacement failure and keeps its
26
+ * rejected state — an observer may attach its own catch, it must never convert
27
+ * the promise into a fulfilled one.
28
+ */
29
+ export declare const STYLE_SHEET_READY = "__openElementStyleReady";
30
+ /**
31
+ * The one key under which a sheet carries the URL of the external CSS resource
32
+ * that delivers its rules: the generated client style adapter records the
33
+ * emitted asset URL on the sheet it exports, and the element runtime compares
34
+ * it against the declarative `<link rel="stylesheet" data-oe-static-styles>`
35
+ * nodes an SSR/DSD template already carries (alpha15 S lane). A root whose
36
+ * serialized markup already references the sheet's URL keeps that link as the
37
+ * delivery and does NOT adopt a second constructable copy — one stylesheet
38
+ * resource, one delivery, no duplicate application. Build-time and runtime
39
+ * cannot drift because the adapter generator interpolates this exact name.
40
+ */
41
+ export declare const STYLE_SHEET_URL = "__openElementStyleSheetUrl";
42
+ /**
43
+ * The one key marking a sheet whose bytes are a LIVE resource rather than an
44
+ * immutable one (alpha15 S lane, S-C1.3).
45
+ *
46
+ * The dev server serves an authored sheet from a mutable endpoint that
47
+ * hot-updates: the sheet object is the copy the live resource re-fills through
48
+ * `replace()`, so every root that adopted it re-renders on an edit. A root
49
+ * whose serialized markup declares the same URL therefore still ADOPTS this
50
+ * sheet — the declarative `<link>` stays the first-paint / no-JavaScript
51
+ * delivery, and the adopted object is the one an edit reaches. Without that,
52
+ * a CSS-only edit could only be delivered by re-fetching the link, which is a
53
+ * DOM write this protocol does not perform.
54
+ *
55
+ * Production sheets never carry this key: their URL is content-addressed, so
56
+ * the link and the sheet can never disagree and one delivery is the whole
57
+ * story. Build-time and runtime cannot drift because the dev adapter generator
58
+ * interpolates this exact name.
59
+ */
60
+ export declare const STYLE_SHEET_LIVE = "__openElementStyleSheetLive";
61
+ /**
62
+ * The compiler-private field a render's host record carries the nested-host
63
+ * expander under (P-6, 2026-11-21).
64
+ *
65
+ * A generated component's SSR producer routes every custom-element tag through
66
+ * the runtime's ONE `nestedHost` helper, which reads the expander off this
67
+ * record. The LIGHT root's producer has always supplied it; the SHADOW host
68
+ * producer did not, so a shadow page's inner components stayed bare tags while
69
+ * the class lane and the light lane both expanded theirs.
70
+ *
71
+ * It lives in the protocol for the same reason the sheet keys above do: the
72
+ * COMPILER emits the record and the RUNTIME reads it, and the compiler must not
73
+ * depend on an element-internal subpath to spell it. One literal, two ends.
74
+ */
75
+ export declare const NESTED_HOST_EXPANDER = "__oe_nestedHost";
17
76
  //#endregion
@@ -1 +1,62 @@
1
- export {};
1
+ //#region src/style-sheet.ts
2
+ /**
3
+ * The one key under which a sheet carries its readiness promise: the generated
4
+ * client style adapter records it on the sheet it exports, and the element
5
+ * runtime reads the same key to hand styles to roots that are already
6
+ * connected. Build-time and runtime cannot drift because the adapter generator
7
+ * interpolates this exact name.
8
+ *
9
+ * The promise settles once. Fulfillment means the rules were installed through
10
+ * `replace()`; rejection carries the load or replacement failure and keeps its
11
+ * rejected state — an observer may attach its own catch, it must never convert
12
+ * the promise into a fulfilled one.
13
+ */
14
+ const STYLE_SHEET_READY = "__openElementStyleReady";
15
+ /**
16
+ * The one key under which a sheet carries the URL of the external CSS resource
17
+ * that delivers its rules: the generated client style adapter records the
18
+ * emitted asset URL on the sheet it exports, and the element runtime compares
19
+ * it against the declarative `<link rel="stylesheet" data-oe-static-styles>`
20
+ * nodes an SSR/DSD template already carries (alpha15 S lane). A root whose
21
+ * serialized markup already references the sheet's URL keeps that link as the
22
+ * delivery and does NOT adopt a second constructable copy — one stylesheet
23
+ * resource, one delivery, no duplicate application. Build-time and runtime
24
+ * cannot drift because the adapter generator interpolates this exact name.
25
+ */
26
+ const STYLE_SHEET_URL = "__openElementStyleSheetUrl";
27
+ /**
28
+ * The one key marking a sheet whose bytes are a LIVE resource rather than an
29
+ * immutable one (alpha15 S lane, S-C1.3).
30
+ *
31
+ * The dev server serves an authored sheet from a mutable endpoint that
32
+ * hot-updates: the sheet object is the copy the live resource re-fills through
33
+ * `replace()`, so every root that adopted it re-renders on an edit. A root
34
+ * whose serialized markup declares the same URL therefore still ADOPTS this
35
+ * sheet — the declarative `<link>` stays the first-paint / no-JavaScript
36
+ * delivery, and the adopted object is the one an edit reaches. Without that,
37
+ * a CSS-only edit could only be delivered by re-fetching the link, which is a
38
+ * DOM write this protocol does not perform.
39
+ *
40
+ * Production sheets never carry this key: their URL is content-addressed, so
41
+ * the link and the sheet can never disagree and one delivery is the whole
42
+ * story. Build-time and runtime cannot drift because the dev adapter generator
43
+ * interpolates this exact name.
44
+ */
45
+ const STYLE_SHEET_LIVE = "__openElementStyleSheetLive";
46
+ /**
47
+ * The compiler-private field a render's host record carries the nested-host
48
+ * expander under (P-6, 2026-11-21).
49
+ *
50
+ * A generated component's SSR producer routes every custom-element tag through
51
+ * the runtime's ONE `nestedHost` helper, which reads the expander off this
52
+ * record. The LIGHT root's producer has always supplied it; the SHADOW host
53
+ * producer did not, so a shadow page's inner components stayed bare tags while
54
+ * the class lane and the light lane both expanded theirs.
55
+ *
56
+ * It lives in the protocol for the same reason the sheet keys above do: the
57
+ * COMPILER emits the record and the RUNTIME reads it, and the compiler must not
58
+ * depend on an element-internal subpath to spell it. One literal, two ends.
59
+ */
60
+ const NESTED_HOST_EXPANDER = "__oe_nestedHost";
61
+ //#endregion
62
+ export { NESTED_HOST_EXPANDER, STYLE_SHEET_LIVE, STYLE_SHEET_READY, STYLE_SHEET_URL };