@graview/guest 0.1.9 → 0.1.12

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.
Files changed (173) hide show
  1. package/README.md +353 -3
  2. package/client.js +2 -0
  3. package/dist/channel.d.ts +11 -3
  4. package/dist/channel.d.ts.map +1 -1
  5. package/dist/channel.js +5 -1
  6. package/dist/channel.js.map +1 -1
  7. package/dist/cli.d.ts +16 -0
  8. package/dist/cli.d.ts.map +1 -0
  9. package/dist/cli.js +75 -0
  10. package/dist/cli.js.map +1 -0
  11. package/dist/client-script.d.ts +3 -0
  12. package/dist/client-script.d.ts.map +1 -0
  13. package/dist/client-script.js +21 -0
  14. package/dist/client-script.js.map +1 -0
  15. package/dist/client.d.ts +2 -0
  16. package/dist/client.d.ts.map +1 -0
  17. package/dist/client.generated.d.ts +4 -0
  18. package/dist/client.generated.d.ts.map +1 -0
  19. package/dist/client.generated.js +9 -0
  20. package/dist/client.generated.js.map +1 -0
  21. package/dist/client.js +12 -0
  22. package/dist/client.js.map +1 -0
  23. package/dist/headless/describe.d.ts +19 -0
  24. package/dist/headless/describe.d.ts.map +1 -0
  25. package/dist/headless/describe.js +255 -0
  26. package/dist/headless/describe.js.map +1 -0
  27. package/dist/headless/draw.d.ts +17 -0
  28. package/dist/headless/draw.d.ts.map +1 -0
  29. package/dist/headless/draw.js +25 -0
  30. package/dist/headless/draw.js.map +1 -0
  31. package/dist/headless/index.d.ts +99 -0
  32. package/dist/headless/index.d.ts.map +1 -0
  33. package/dist/headless/index.js +143 -0
  34. package/dist/headless/index.js.map +1 -0
  35. package/dist/headless/judge.d.ts +16 -0
  36. package/dist/headless/judge.d.ts.map +1 -0
  37. package/dist/headless/judge.js +52 -0
  38. package/dist/headless/judge.js.map +1 -0
  39. package/dist/headless/node.d.ts +8 -0
  40. package/dist/headless/node.d.ts.map +1 -0
  41. package/dist/headless/node.js +80 -0
  42. package/dist/headless/node.js.map +1 -0
  43. package/dist/headless/protocol.d.ts +75 -0
  44. package/dist/headless/protocol.d.ts.map +1 -0
  45. package/dist/headless/protocol.js +14 -0
  46. package/dist/headless/protocol.js.map +1 -0
  47. package/dist/headless/runtime.d.ts +2 -0
  48. package/dist/headless/runtime.d.ts.map +1 -0
  49. package/dist/headless/runtime.generated.d.ts +2 -0
  50. package/dist/headless/runtime.generated.d.ts.map +1 -0
  51. package/dist/headless/runtime.generated.js +8 -0
  52. package/dist/headless/runtime.generated.js.map +1 -0
  53. package/dist/headless/runtime.js +171 -0
  54. package/dist/headless/runtime.js.map +1 -0
  55. package/dist/headless/tree.d.ts +54 -0
  56. package/dist/headless/tree.d.ts.map +1 -0
  57. package/dist/headless/tree.js +128 -0
  58. package/dist/headless/tree.js.map +1 -0
  59. package/dist/host/css.d.ts +118 -0
  60. package/dist/host/css.d.ts.map +1 -0
  61. package/dist/host/css.js +963 -0
  62. package/dist/host/css.js.map +1 -0
  63. package/dist/host/draw-budget.d.ts +10 -0
  64. package/dist/host/draw-budget.d.ts.map +1 -0
  65. package/dist/host/draw-budget.js +29 -0
  66. package/dist/host/draw-budget.js.map +1 -0
  67. package/dist/host/frame.d.ts +19 -1
  68. package/dist/host/frame.d.ts.map +1 -1
  69. package/dist/host/frame.js +21 -2
  70. package/dist/host/frame.js.map +1 -1
  71. package/dist/host/index.d.ts +4 -3
  72. package/dist/host/index.d.ts.map +1 -1
  73. package/dist/host/index.js +7 -1
  74. package/dist/host/index.js.map +1 -1
  75. package/dist/host/kit.d.ts +6 -2
  76. package/dist/host/kit.d.ts.map +1 -1
  77. package/dist/host/kit.js +12 -5
  78. package/dist/host/kit.js.map +1 -1
  79. package/dist/host/links.d.ts +24 -0
  80. package/dist/host/links.d.ts.map +1 -0
  81. package/dist/host/links.js +35 -0
  82. package/dist/host/links.js.map +1 -0
  83. package/dist/host/manifest.d.ts +50 -0
  84. package/dist/host/manifest.d.ts.map +1 -0
  85. package/dist/host/manifest.js +103 -0
  86. package/dist/host/manifest.js.map +1 -0
  87. package/dist/host/open-draw.d.ts +44 -0
  88. package/dist/host/open-draw.d.ts.map +1 -0
  89. package/dist/host/open-draw.js +108 -0
  90. package/dist/host/open-draw.js.map +1 -0
  91. package/dist/host/open-judge.d.ts +53 -0
  92. package/dist/host/open-judge.d.ts.map +1 -0
  93. package/dist/host/open-judge.js +95 -0
  94. package/dist/host/open-judge.js.map +1 -0
  95. package/dist/host/open-render.d.ts +32 -0
  96. package/dist/host/open-render.d.ts.map +1 -0
  97. package/dist/host/open-render.js +262 -0
  98. package/dist/host/open-render.js.map +1 -0
  99. package/dist/host/press.d.ts +15 -0
  100. package/dist/host/press.d.ts.map +1 -0
  101. package/dist/host/press.js +156 -0
  102. package/dist/host/press.js.map +1 -0
  103. package/dist/host/react.d.ts +15 -2
  104. package/dist/host/react.d.ts.map +1 -1
  105. package/dist/host/react.js +13 -5
  106. package/dist/host/react.js.map +1 -1
  107. package/dist/host/session.d.ts +94 -1
  108. package/dist/host/session.d.ts.map +1 -1
  109. package/dist/host/session.js +103 -14
  110. package/dist/host/session.js.map +1 -1
  111. package/dist/host/theme.d.ts +14 -0
  112. package/dist/host/theme.d.ts.map +1 -0
  113. package/dist/host/theme.js +51 -0
  114. package/dist/host/theme.js.map +1 -0
  115. package/dist/host/view-runtime.generated.d.ts +2 -0
  116. package/dist/host/view-runtime.generated.d.ts.map +1 -0
  117. package/dist/host/view-runtime.generated.js +7 -0
  118. package/dist/host/view-runtime.generated.js.map +1 -0
  119. package/dist/host/view-source.d.ts +10 -0
  120. package/dist/host/view-source.d.ts.map +1 -0
  121. package/dist/host/view-source.js +44 -0
  122. package/dist/host/view-source.js.map +1 -0
  123. package/dist/host/view.d.ts +138 -0
  124. package/dist/host/view.d.ts.map +1 -0
  125. package/dist/host/view.js +381 -0
  126. package/dist/host/view.js.map +1 -0
  127. package/dist/host/views.d.ts +10 -0
  128. package/dist/host/views.d.ts.map +1 -0
  129. package/dist/host/views.js +15 -0
  130. package/dist/host/views.js.map +1 -0
  131. package/dist/host/worker-react.d.ts +57 -0
  132. package/dist/host/worker-react.d.ts.map +1 -0
  133. package/dist/host/worker-react.js +129 -0
  134. package/dist/host/worker-react.js.map +1 -0
  135. package/dist/host/worker-start.d.ts +66 -0
  136. package/dist/host/worker-start.d.ts.map +1 -0
  137. package/dist/host/worker-start.js +188 -0
  138. package/dist/host/worker-start.js.map +1 -0
  139. package/dist/host/worker.d.ts +28 -19
  140. package/dist/host/worker.d.ts.map +1 -1
  141. package/dist/host/worker.js +60 -119
  142. package/dist/host/worker.js.map +1 -1
  143. package/dist/host/writes.d.ts +49 -0
  144. package/dist/host/writes.d.ts.map +1 -0
  145. package/dist/host/writes.js +76 -0
  146. package/dist/host/writes.js.map +1 -0
  147. package/dist/index.d.ts +1 -1
  148. package/dist/index.d.ts.map +1 -1
  149. package/dist/open-kit.d.ts +148 -0
  150. package/dist/open-kit.d.ts.map +1 -0
  151. package/dist/open-kit.js +321 -0
  152. package/dist/open-kit.js.map +1 -0
  153. package/dist/protocol.d.ts +109 -3
  154. package/dist/protocol.d.ts.map +1 -1
  155. package/dist/protocol.js +13 -0
  156. package/dist/protocol.js.map +1 -1
  157. package/dist/worker/harden.d.ts +13 -2
  158. package/dist/worker/harden.d.ts.map +1 -1
  159. package/dist/worker/harden.js +10 -4
  160. package/dist/worker/harden.js.map +1 -1
  161. package/dist/worker/natives.d.ts +1 -0
  162. package/dist/worker/natives.d.ts.map +1 -1
  163. package/dist/worker/natives.js +4 -0
  164. package/dist/worker/natives.js.map +1 -1
  165. package/dist/worker/view-global.d.ts +70 -0
  166. package/dist/worker/view-global.d.ts.map +1 -0
  167. package/dist/worker/view-global.js +264 -0
  168. package/dist/worker/view-global.js.map +1 -0
  169. package/dist/worker/view.d.ts +14 -0
  170. package/dist/worker/view.d.ts.map +1 -0
  171. package/dist/worker/view.js +64 -0
  172. package/dist/worker/view.js.map +1 -0
  173. package/package.json +30 -4
@@ -0,0 +1,321 @@
1
+ /**
2
+ * THE OPEN KIT (FR-90): what a worker view may draw, declared once.
3
+ *
4
+ * Graview Cloud's ADR 0007 put it in one line: safety comes from what a
5
+ * view can REACH, not from what it can DRAW. So the kit is broad — most of
6
+ * HTML's sectioning, text, lists, tables, disclosure and form controls,
7
+ * images, SVG's shapes, paths, text and gradients, and CSS for layout,
8
+ * colour, type, transitions, keyframes and media queries — and what is left
9
+ * out is exactly what could fetch, escape the region, or speak for the app:
10
+ *
11
+ * fetch `<script>`, `<iframe>`, `<object>`, `<embed>`, `<link>`, `<meta>`,
12
+ * `<base>`, `<style>` outside the view's own stylesheet, media and
13
+ * canvas, SVG `<image>`, `<feImage>`, `<foreignObject>`, SVG `<a>`,
14
+ * SMIL (which can rewrite an `href`), every `src`/`href`/`srcset`
15
+ * but an image's `data:` or same-origin `blob:` source and an SVG
16
+ * reference to `#id` in the view's own drawing, and in CSS every
17
+ * `url()` but `url(#id)` on a paint, `@import`, `@font-face`,
18
+ * `@namespace`, and every function not on `CSS_FUNCTIONS`
19
+ * (`image-set()`, `cross-fade()`, `element()`, `paint()`,
20
+ * `attr()`, `expression()`, …).
21
+ * escape `position: fixed` and `sticky`, `:host` and `::slotted`, the
22
+ * top layer (`popover`, `<dialog>`), `autofocus`, `accesskey`,
23
+ * and `<form>`, whose submission is a navigation.
24
+ * speak `role="alert"`, the landmark roles the app's own chrome uses
25
+ * and the elements that carry them (`<nav>`, `<header>`,
26
+ * `<footer>`, `<aside>`, `<search>` are drawn as `<div>`, `<output>`
27
+ * as `<span>`, and a `<section>` is never named),
28
+ * `aria-live="assertive"`, and password and file inputs.
29
+ *
30
+ * The host draws from this declaration (host/open-render.ts, with
31
+ * host/css.ts for every stylesheet, style attribute and SVG paint), and the
32
+ * worker's runtime reads the same tables to tell an author at once what the
33
+ * host will not draw (worker/view.ts). Adding an element or an attribute
34
+ * here makes it drawable on both sides; nothing else changes.
35
+ *
36
+ * This module has no imports: a view's runtime carries it and nothing of
37
+ * the framework.
38
+ */
39
+ const none = {};
40
+ const empty = { empty: true };
41
+ /** Attributes every HTML element takes. `aria-*` and `data-*` are read by pattern (`isAriaAttribute`, `isDataAttribute`). */
42
+ export const HTML_GLOBAL_ATTRIBUTES = {
43
+ id: "text",
44
+ class: "text",
45
+ title: "text",
46
+ lang: "text",
47
+ dir: { oneOf: ["ltr", "rtl", "auto"] },
48
+ hidden: "text",
49
+ /* -1 or 0: a view orders its own controls by where it draws them, never ahead of the app's. */
50
+ tabindex: { oneOf: ["-1", "0"] },
51
+ role: "text",
52
+ style: "style",
53
+ translate: { oneOf: ["yes", "no"] },
54
+ spellcheck: { oneOf: ["true", "false"] },
55
+ draggable: { oneOf: ["true", "false"] },
56
+ inert: "boolean",
57
+ };
58
+ /** The HTML elements a view may draw, by name. */
59
+ export const HTML_ELEMENTS = {
60
+ // sectioning and grouping
61
+ div: none, section: none, article: none, aside: none, header: none, footer: none, nav: none, hgroup: none, search: none, address: none,
62
+ figure: none, figcaption: none, blockquote: none, p: none, pre: none, hr: empty, br: empty, wbr: empty,
63
+ h1: none, h2: none, h3: none, h4: none, h5: none, h6: none,
64
+ // text
65
+ span: none, strong: none, em: none, b: none, i: none, u: none, s: none, small: none, mark: none, abbr: none, cite: none, q: none,
66
+ code: none, kbd: none, samp: none, var: none, sub: none, sup: none, dfn: none, bdi: none, bdo: none, ruby: none, rt: none, rp: none,
67
+ time: { attributes: { datetime: "text" } },
68
+ data: { attributes: { value: "text" } },
69
+ del: { attributes: { datetime: "text" } },
70
+ ins: { attributes: { datetime: "text" } },
71
+ /* A link goes to a record or a place of this app, never to an address (FR-93): it has no `href` to give. */
72
+ a: none,
73
+ // lists
74
+ ul: none, menu: none, dl: none, dt: none, dd: none,
75
+ ol: { attributes: { start: "number", reversed: "boolean", type: { oneOf: ["1", "a", "A", "i", "I"] } } },
76
+ li: { attributes: { value: "number" } },
77
+ // tables
78
+ table: none, caption: none, thead: none, tbody: none, tfoot: none, tr: none,
79
+ colgroup: { attributes: { span: "number" } },
80
+ col: { attributes: { span: "number" }, empty: true },
81
+ th: { attributes: { colspan: "number", rowspan: "number", headers: "text", scope: { oneOf: ["row", "col", "rowgroup", "colgroup"] }, abbr: "text" } },
82
+ td: { attributes: { colspan: "number", rowspan: "number", headers: "text" } },
83
+ // disclosure
84
+ details: { attributes: { open: "boolean", name: "text" } },
85
+ summary: none,
86
+ // controls: no form, so nothing is ever submitted
87
+ button: { attributes: { type: { oneOf: ["button"] }, disabled: "boolean", name: "text", value: "text" } },
88
+ input: {
89
+ empty: true,
90
+ attributes: {
91
+ /*
92
+ * Never password or file (a view does not ask for either), image (it has a src), hidden or submit.
93
+ * No `list`: a suggestion the person picks from a view's `<datalist>` is typed by the browser, trusted,
94
+ * and would pass the view's words off as theirs (FR-92).
95
+ */
96
+ type: { oneOf: ["text", "search", "number", "range", "checkbox", "radio", "date", "time", "datetime-local", "month", "week", "color", "email", "tel", "url"] },
97
+ name: "text", value: "text", placeholder: "text", min: "text", max: "text", step: "text", checked: "boolean", disabled: "boolean",
98
+ readonly: "boolean", required: "boolean", maxlength: "number", minlength: "number", size: "number", pattern: "text",
99
+ multiple: "boolean", inputmode: "text", enterkeyhint: "text",
100
+ },
101
+ },
102
+ select: { attributes: { name: "text", disabled: "boolean", multiple: "boolean", required: "boolean", size: "number" } },
103
+ option: { attributes: { value: "text", selected: "boolean", disabled: "boolean", label: "text" } },
104
+ optgroup: { attributes: { label: "text", disabled: "boolean" } },
105
+ textarea: { attributes: { name: "text", placeholder: "text", rows: "number", cols: "number", disabled: "boolean", readonly: "boolean", required: "boolean", maxlength: "number", minlength: "number", wrap: { oneOf: ["soft", "hard", "off"] } } },
106
+ label: { attributes: { for: "text" } },
107
+ fieldset: { attributes: { disabled: "boolean", name: "text" } },
108
+ legend: none,
109
+ output: none,
110
+ meter: { attributes: { value: "number", min: "number", max: "number", low: "number", high: "number", optimum: "number" } },
111
+ progress: { attributes: { value: "number", max: "number" } },
112
+ // images, held in the drawing: data: or the host's own blob:
113
+ img: { empty: true, attributes: { src: "image", alt: "text", width: "number", height: "number", decoding: { oneOf: ["async", "sync", "auto"] } } },
114
+ };
115
+ /** SVG's presentation attributes: CSS properties, sanitised as a stylesheet's are. */
116
+ const PRESENTATION = [
117
+ "fill", "fill-opacity", "fill-rule", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin", "stroke-dasharray", "stroke-dashoffset",
118
+ "stroke-opacity", "stroke-miterlimit", "opacity", "color", "display", "visibility", "transform-origin", "clip-path", "clip-rule",
119
+ "marker-start", "marker-mid", "marker-end", "font-family", "font-size", "font-weight", "font-style", "text-anchor", "dominant-baseline",
120
+ "alignment-baseline", "letter-spacing", "text-decoration", "paint-order", "vector-effect", "shape-rendering", "pointer-events",
121
+ "stop-color", "stop-opacity", "overflow", "mask",
122
+ ];
123
+ /** Attributes every SVG element takes. */
124
+ export const SVG_GLOBAL_ATTRIBUTES = {
125
+ id: "text",
126
+ class: "text",
127
+ style: "style",
128
+ lang: "text",
129
+ role: "text",
130
+ tabindex: { oneOf: ["-1", "0"] },
131
+ transform: "geometry",
132
+ ...Object.fromEntries(PRESENTATION.map((name) => [name, "css"])),
133
+ };
134
+ const box = { x: "geometry", y: "geometry", width: "geometry", height: "geometry" };
135
+ const viewport = { viewBox: "geometry", preserveAspectRatio: "geometry" };
136
+ const gradient = { gradientUnits: { oneOf: ["userSpaceOnUse", "objectBoundingBox"] }, gradientTransform: "geometry", spreadMethod: { oneOf: ["pad", "reflect", "repeat"] }, href: "fragment" };
137
+ /** The SVG elements a view may draw, by canonical (camel-cased) name. */
138
+ export const SVG_ELEMENTS = {
139
+ svg: { attributes: { ...box, ...viewport } },
140
+ g: none,
141
+ defs: none,
142
+ symbol: { attributes: { ...box, ...viewport, refX: "geometry", refY: "geometry" } },
143
+ /* `use` within the drawing only: `#id`, never a document of its own. */
144
+ use: { attributes: { ...box, href: "fragment" } },
145
+ title: none,
146
+ desc: none,
147
+ path: { attributes: { d: "geometry", pathLength: "number" } },
148
+ rect: { attributes: { ...box, rx: "geometry", ry: "geometry", pathLength: "number" } },
149
+ circle: { attributes: { cx: "geometry", cy: "geometry", r: "geometry", pathLength: "number" } },
150
+ ellipse: { attributes: { cx: "geometry", cy: "geometry", rx: "geometry", ry: "geometry", pathLength: "number" } },
151
+ line: { attributes: { x1: "geometry", y1: "geometry", x2: "geometry", y2: "geometry", pathLength: "number" } },
152
+ polyline: { attributes: { points: "geometry", pathLength: "number" } },
153
+ polygon: { attributes: { points: "geometry", pathLength: "number" } },
154
+ text: { attributes: { x: "geometry", y: "geometry", dx: "geometry", dy: "geometry", rotate: "geometry", textLength: "geometry", lengthAdjust: { oneOf: ["spacing", "spacingAndGlyphs"] } } },
155
+ tspan: { attributes: { x: "geometry", y: "geometry", dx: "geometry", dy: "geometry", rotate: "geometry", textLength: "geometry" } },
156
+ textPath: { attributes: { href: "fragment", startOffset: "geometry", method: { oneOf: ["align", "stretch"] }, spacing: { oneOf: ["auto", "exact"] }, side: { oneOf: ["left", "right"] } } },
157
+ linearGradient: { attributes: { x1: "geometry", y1: "geometry", x2: "geometry", y2: "geometry", ...gradient } },
158
+ radialGradient: { attributes: { cx: "geometry", cy: "geometry", r: "geometry", fx: "geometry", fy: "geometry", fr: "geometry", ...gradient } },
159
+ stop: { attributes: { offset: "geometry" } },
160
+ clipPath: { attributes: { clipPathUnits: { oneOf: ["userSpaceOnUse", "objectBoundingBox"] } } },
161
+ mask: { attributes: { ...box, maskUnits: { oneOf: ["userSpaceOnUse", "objectBoundingBox"] }, maskContentUnits: { oneOf: ["userSpaceOnUse", "objectBoundingBox"] } } },
162
+ pattern: { attributes: { ...box, ...viewport, patternUnits: { oneOf: ["userSpaceOnUse", "objectBoundingBox"] }, patternContentUnits: { oneOf: ["userSpaceOnUse", "objectBoundingBox"] }, patternTransform: "geometry", href: "fragment" } },
163
+ marker: { attributes: { ...viewport, markerWidth: "geometry", markerHeight: "geometry", refX: "geometry", refY: "geometry", orient: "geometry", markerUnits: { oneOf: ["strokeWidth", "userSpaceOnUse"] } } },
164
+ };
165
+ /**
166
+ * What is refused, and why, for an author and for the tests: none of these
167
+ * is in the tables above, and a test holds them out. Not the allowlist —
168
+ * anything not above is refused — but the names a reader looks for.
169
+ */
170
+ export const NEVER_DRAWN = {
171
+ html: ["script", "iframe", "frame", "frameset", "object", "embed", "applet", "portal", "link", "meta", "base", "style", "form", "template", "slot", "noscript", "audio", "video", "source", "track", "picture", "canvas", "dialog", "datalist", "main", "html", "head", "body", "title"],
172
+ svg: ["image", "feImage", "filter", "foreignObject", "a", "script", "style", "animate", "animateMotion", "animateTransform", "set", "discard", "view", "switch", "cursor", "font-face"],
173
+ attributes: ["src (outside img)", "href", "xlink:href (outside a #fragment)", "srcset", "sizes", "action", "formaction", "ping", "poster", "background", "on*", "popover", "popovertarget", "autofocus", "accesskey", "contenteditable", "is", "nonce", "autocomplete", "form", "list"],
174
+ };
175
+ /** Roles that would make a view speak as the app's own chrome or notices. */
176
+ export const REFUSED_ROLES = ["alert", "alertdialog", "dialog", "banner", "main", "navigation", "contentinfo", "complementary", "search", "form", "region", "application", "status", "log", "marquee", "timer"];
177
+ /**
178
+ * Elements whose own role is a landmark or a notice's, drawn as an element
179
+ * with none: what they hold is drawn, but they speak as the app's chrome
180
+ * (`<nav>` is a navigation landmark, `<header>` a banner, `<output>` a
181
+ * status) to assistive technology. Setting a role on them cannot cover it:
182
+ * `role="none"` on a focusable or named element is ignored, and the
183
+ * landmark comes back. A view's stylesheet reaches them by class, not by
184
+ * these names.
185
+ */
186
+ export const HTML_DRAWN_AS = { nav: "div", header: "div", footer: "div", aside: "div", search: "div", output: "span" };
187
+ /** Attributes that would name an element: a named `<section>` is a region landmark, so a section is never named. */
188
+ export const UNNAMED_ELEMENTS = { section: ["aria-label", "aria-labelledby", "title"] };
189
+ /** `aria-*`, by pattern. */
190
+ export function isAriaAttribute(name) {
191
+ return /^aria-[a-z]+$/.test(name);
192
+ }
193
+ /** `data-*`, by pattern. */
194
+ export function isDataAttribute(name) {
195
+ return /^data-[a-z0-9][a-z0-9_.-]*$/.test(name);
196
+ }
197
+ /**
198
+ * THE CSS A VIEW MAY WRITE: an allowlist of properties, so a property a
199
+ * browser ships tomorrow that takes an image is refused until somebody adds
200
+ * it here, rather than drawn until somebody notices.
201
+ */
202
+ export const CSS_PROPERTIES = [
203
+ // box and layout
204
+ "display", "position", "top", "right", "bottom", "left", "inset", "inset-block", "inset-inline", "inset-block-start", "inset-block-end", "inset-inline-start", "inset-inline-end",
205
+ "width", "height", "min-width", "min-height", "max-width", "max-height", "inline-size", "block-size", "min-inline-size", "min-block-size", "max-inline-size", "max-block-size",
206
+ "margin", "margin-top", "margin-right", "margin-bottom", "margin-left", "margin-block", "margin-inline", "margin-block-start", "margin-block-end", "margin-inline-start", "margin-inline-end",
207
+ "padding", "padding-top", "padding-right", "padding-bottom", "padding-left", "padding-block", "padding-inline", "padding-block-start", "padding-block-end", "padding-inline-start", "padding-inline-end",
208
+ "box-sizing", "overflow", "overflow-x", "overflow-y", "overflow-wrap", "float", "clear", "z-index", "aspect-ratio", "object-fit", "object-position", "vertical-align",
209
+ "isolation", "contain", "container", "container-type", "container-name", "content-visibility",
210
+ // flex and grid
211
+ "flex", "flex-direction", "flex-wrap", "flex-flow", "flex-grow", "flex-shrink", "flex-basis", "order",
212
+ "grid", "grid-template", "grid-template-columns", "grid-template-rows", "grid-template-areas", "grid-auto-columns", "grid-auto-rows", "grid-auto-flow",
213
+ "grid-area", "grid-column", "grid-row", "grid-column-start", "grid-column-end", "grid-row-start", "grid-row-end",
214
+ "gap", "row-gap", "column-gap", "align-items", "align-content", "align-self", "justify-items", "justify-content", "justify-self", "place-items", "place-content", "place-self",
215
+ "columns", "column-count", "column-width", "column-rule", "column-rule-color", "column-rule-style", "column-rule-width", "column-span", "column-fill",
216
+ // colour and surface
217
+ "color", "background", "background-color", "background-image", "background-position", "background-position-x", "background-position-y", "background-size", "background-repeat",
218
+ "background-origin", "background-clip", "background-attachment", "background-blend-mode",
219
+ "border", "border-top", "border-right", "border-bottom", "border-left", "border-block", "border-inline", "border-block-start", "border-block-end", "border-inline-start", "border-inline-end",
220
+ "border-width", "border-style", "border-color", "border-top-width", "border-right-width", "border-bottom-width", "border-left-width",
221
+ "border-top-style", "border-right-style", "border-bottom-style", "border-left-style", "border-top-color", "border-right-color", "border-bottom-color", "border-left-color",
222
+ "border-radius", "border-top-left-radius", "border-top-right-radius", "border-bottom-right-radius", "border-bottom-left-radius",
223
+ "border-start-start-radius", "border-start-end-radius", "border-end-start-radius", "border-end-end-radius", "border-collapse", "border-spacing",
224
+ "outline", "outline-width", "outline-style", "outline-color", "outline-offset", "box-shadow", "opacity", "visibility", "mix-blend-mode", "filter", "backdrop-filter",
225
+ "clip-path", "accent-color", "caret-color", "color-scheme", "appearance", "-webkit-appearance",
226
+ // type
227
+ "font", "font-family", "font-size", "font-weight", "font-style", "font-stretch", "font-variant", "font-variant-numeric", "font-variant-caps", "font-variant-ligatures",
228
+ "font-feature-settings", "font-variation-settings", "font-kerning", "font-optical-sizing", "font-size-adjust", "font-synthesis",
229
+ "line-height", "letter-spacing", "word-spacing", "text-align", "text-align-last", "text-indent", "text-transform", "text-decoration", "text-decoration-line",
230
+ "text-decoration-color", "text-decoration-style", "text-decoration-thickness", "text-underline-offset", "text-underline-position", "text-shadow", "text-overflow",
231
+ "text-wrap", "text-wrap-mode", "text-wrap-style", "white-space", "white-space-collapse", "word-break", "line-break", "hyphens", "tab-size", "direction", "unicode-bidi", "writing-mode",
232
+ "text-orientation", "text-rendering", "-webkit-font-smoothing", "-webkit-line-clamp", "-webkit-box-orient", "line-clamp", "-webkit-text-fill-color", "-webkit-background-clip",
233
+ "list-style", "list-style-type", "list-style-position", "content", "quotes", "counter-reset", "counter-increment", "counter-set",
234
+ "table-layout", "caption-side", "empty-cells",
235
+ // motion
236
+ "transform", "transform-origin", "transform-box", "transform-style", "translate", "rotate", "scale", "perspective", "perspective-origin", "backface-visibility",
237
+ "transition", "transition-property", "transition-duration", "transition-timing-function", "transition-delay", "transition-behavior",
238
+ "animation", "animation-name", "animation-duration", "animation-timing-function", "animation-delay", "animation-iteration-count", "animation-direction",
239
+ "animation-fill-mode", "animation-play-state", "animation-composition", "will-change",
240
+ // interaction
241
+ "cursor", "pointer-events", "user-select", "-webkit-user-select", "touch-action", "resize", "scroll-behavior", "overscroll-behavior", "overscroll-behavior-x", "overscroll-behavior-y",
242
+ "scroll-snap-type", "scroll-snap-align", "scroll-snap-stop", "scroll-margin", "scroll-padding", "scrollbar-width", "scrollbar-color", "scrollbar-gutter",
243
+ // SVG
244
+ "fill", "fill-opacity", "fill-rule", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin", "stroke-dasharray", "stroke-dashoffset", "stroke-opacity", "stroke-miterlimit",
245
+ "stop-color", "stop-opacity", "clip-rule", "marker", "marker-start", "marker-mid", "marker-end", "paint-order", "vector-effect", "shape-rendering", "text-anchor",
246
+ "dominant-baseline", "alignment-baseline", "r", "cx", "cy", "rx", "ry", "x", "y", "d", "mask",
247
+ ];
248
+ /**
249
+ * The CSS functions a value may call. Every one makes a value of its own
250
+ * arguments; none names a resource. `url()` is not here: it is read apart,
251
+ * and kept only as `url(#id)` on a property in `CSS_FRAGMENT_PROPERTIES`.
252
+ */
253
+ export const CSS_FUNCTIONS = [
254
+ "var", "env", "calc", "min", "max", "clamp", "round", "mod", "rem", "abs", "sign", "sin", "cos", "tan", "asin", "acos", "atan", "atan2", "pow", "sqrt", "hypot", "log", "exp",
255
+ "rgb", "rgba", "hsl", "hsla", "hwb", "lab", "lch", "oklab", "oklch", "color", "color-mix", "light-dark",
256
+ "linear-gradient", "radial-gradient", "conic-gradient", "repeating-linear-gradient", "repeating-radial-gradient", "repeating-conic-gradient",
257
+ "translate", "translatex", "translatey", "translatez", "translate3d", "rotate", "rotatex", "rotatey", "rotatez", "rotate3d", "scale", "scalex", "scaley", "scalez", "scale3d",
258
+ "skew", "skewx", "skewy", "matrix", "matrix3d", "perspective",
259
+ "cubic-bezier", "steps", "linear",
260
+ "repeat", "minmax", "fit-content",
261
+ "blur", "brightness", "contrast", "drop-shadow", "grayscale", "hue-rotate", "invert", "saturate", "sepia", "opacity",
262
+ "circle", "ellipse", "inset", "polygon", "path", "xywh", "rect",
263
+ "counter", "counters",
264
+ ];
265
+ /**
266
+ * Where `url(#id)` stays: the paints and references an SVG drawing makes
267
+ * to its own gradients, clip paths, masks and markers. A fragment of the
268
+ * view's own drawing is resolved in the view's own tree and fetches
269
+ * nothing; anything else in a `url()` is refused wherever it is written.
270
+ */
271
+ export const CSS_FRAGMENT_PROPERTIES = ["fill", "stroke", "clip-path", "mask", "marker", "marker-start", "marker-mid", "marker-end"];
272
+ /** The at-rules a stylesheet may hold. `@import`, `@font-face`, `@namespace`, `@property`, `@layer` and the rest are refused. */
273
+ export const CSS_AT_RULES = ["media", "supports", "container", "keyframes"];
274
+ /**
275
+ * The values a property may take when it may take only some: `position`
276
+ * stays in the region (no `fixed`, no `sticky`), and so does `var()` — a
277
+ * property held to a list is held to a keyword, so a custom property
278
+ * cannot carry `fixed` into it.
279
+ */
280
+ export const CSS_KEYWORD_PROPERTIES = {
281
+ position: ["static", "relative", "absolute"],
282
+ /* Never `base-select`: a customizable select's picker is drawn in the top layer, over the whole page, styled by the view (Chrome 135+). */
283
+ appearance: ["auto", "none", "menulist-button", "textfield"],
284
+ "-webkit-appearance": ["auto", "none", "menulist-button", "textfield"],
285
+ };
286
+ /** Selectors a view's stylesheet may not write: each reaches past the view's own tree. */
287
+ export const CSS_REFUSED_SELECTORS = ["host", "host-context", "slotted", "part", "backdrop", "picker", "view-transition", "view-transition-group", "view-transition-image-pair", "view-transition-old", "view-transition-new"];
288
+ /** The largest stylesheet, in characters, a view may give. */
289
+ export const OPEN_MAX_STYLESHEET = 64_000;
290
+ /** The longest attribute value, in characters; geometry (`d`, `points`) may be longer. */
291
+ export const OPEN_MAX_ATTRIBUTE = 4_000;
292
+ export const OPEN_MAX_GEOMETRY = 100_000;
293
+ /** The largest image a view may hold, as its `data:` URL's length. */
294
+ export const OPEN_MAX_IMAGE = 512_000;
295
+ /** The longest text a node may hold, in characters; longer is cut. */
296
+ export const OPEN_MAX_TEXT = 10_000;
297
+ export const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
298
+ export const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
299
+ /** An SVG element's canonical name from any casing of it (`lineargradient` → `linearGradient`). */
300
+ const SVG_NAMES = new Map(Object.keys(SVG_ELEMENTS).map((name) => [name.toLowerCase(), name]));
301
+ export function svgElementName(name) {
302
+ return SVG_NAMES.get(name.toLowerCase());
303
+ }
304
+ /** The canonical name of an attribute an element takes, from any casing (`viewbox` → `viewBox`), with what it may hold; or undefined. */
305
+ export function openAttribute(namespace, element, name) {
306
+ const lower = name.toLowerCase();
307
+ const tables = namespace === "html" ? [HTML_ELEMENTS[element]?.attributes, HTML_GLOBAL_ATTRIBUTES] : [SVG_ELEMENTS[element]?.attributes, SVG_GLOBAL_ATTRIBUTES];
308
+ /* `xlink:href` is SVG 1's `href`; it is drawn as SVG 2's. */
309
+ const asked = namespace === "svg" && lower === "xlink:href" ? "href" : lower;
310
+ for (const table of tables) {
311
+ if (!table)
312
+ continue;
313
+ for (const [canonical, kind] of Object.entries(table))
314
+ if (canonical.toLowerCase() === asked)
315
+ return { name: canonical, kind };
316
+ }
317
+ if (isAriaAttribute(lower) || isDataAttribute(lower))
318
+ return { name: lower, kind: "text" };
319
+ return undefined;
320
+ }
321
+ //# sourceMappingURL=open-kit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-kit.js","sourceRoot":"","sources":["../src/open-kit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AA4BH,MAAM,IAAI,GAAgB,EAAE,CAAC;AAC7B,MAAM,KAAK,GAAgB,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAE3C,6HAA6H;AAC7H,MAAM,CAAC,MAAM,sBAAsB,GAA4C;IAC7E,EAAE,EAAE,MAAM;IACV,KAAK,EAAE,MAAM;IACb,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AAC,SAAyB,EAAE,OAAe,EAAE,IAAY;IACpF,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IACjC,MAAM,MAAM,GAAG,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,qBAAqB,CAAC,CAAC;IAChK,6DAA6D;IAC7D,MAAM,KAAK,GAAG,SAAS,KAAK,KAAK,IAAI,KAAK,KAAK,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;IAC7E,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,CAAC,KAAK;YAAE,SAAS;QACrB,KAAK,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;YAAE,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,KAAK;gBAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IACjI,CAAC;IACD,IAAI,eAAe,CAAC,KAAK,CAAC,IAAI,eAAe,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC3F,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -12,6 +12,7 @@
12
12
  * host → guest { type: "props", props } (over the port, whenever what it sees moves)
13
13
  * guest → host { type: "act", nonce, id, name, args } (over the port: ask for an act)
14
14
  * guest → host { type: "navigate", nonce, to } (over the port: go to a record)
15
+ * guest → host { type: "navigate", nonce, place } (over the port: go to a named place of the app, by its slug)
15
16
  * guest → host { type: "size", nonce, height } (over the port: the height it wants)
16
17
  * host → guest { type: "answer", id, ok, … } (over the port: what became of an act)
17
18
  *
@@ -27,6 +28,18 @@
27
28
  * A frame guest never sends `render`; a host that is not drawing a worker
28
29
  * drops it unread.
29
30
  *
31
+ * A WORKER VIEW ON THE OPEN KIT (FR-90) draws HTML, SVG and CSS rather than
32
+ * the kit's components, so its records name native elements and their
33
+ * attributes, and it says two things more and hears one:
34
+ *
35
+ * guest → host { type: "style", nonce, css } (over the port: its one stylesheet)
36
+ * guest → host { type: "pushed", nonce, push, ms } (over the port: the runtime has drawn push `push`, in `ms`)
37
+ * host → guest { type: "dom-event", target, event, … } (over the port: the viewer clicked, typed or chose on what it drew)
38
+ *
39
+ * The host draws a stylesheet only as the open kit allows (host/css.ts),
40
+ * and numbers each props push (`push`) so the runtime can say when it has
41
+ * drawn it.
42
+ *
30
43
  * A worker's host also watches that the worker is alive. Its runtime — not
31
44
  * the guest's code, which can stop it only by blocking its own event loop —
32
45
  * answers each heartbeat with the beat it was asked, and a worker that goes
@@ -74,6 +87,24 @@ export interface GuestAct {
74
87
  readonly arg: string;
75
88
  };
76
89
  }
90
+ /**
91
+ * THE APP'S LOOK, AS A WORKER VIEW IS HANDED IT (FR-91): the scheme the app
92
+ * is drawn in now — the app's own toggle, not the system's preference —
93
+ * and the tokens a view draws with, as CSS colours and font stacks. The
94
+ * same tokens reach a view's stylesheet as `--graview-*` custom
95
+ * properties; these are for what a view computes.
96
+ */
97
+ export interface GuestTheme {
98
+ readonly scheme: "light" | "dark";
99
+ readonly accent: string;
100
+ readonly ground: string;
101
+ readonly panel: string;
102
+ readonly ink: string;
103
+ readonly inkMuted: string;
104
+ readonly edge: string;
105
+ readonly fontBody: string;
106
+ readonly fontMono: string;
107
+ }
77
108
  /**
78
109
  * WHAT A GUEST VIEW IS HANDED: the plain-data half of `ViewProps`, read
79
110
  * from the store as the viewer sees it. A record the viewer may not see is
@@ -97,6 +128,16 @@ export interface GuestProps {
97
128
  readonly flagged?: readonly string[];
98
129
  /** The acts the viewer may run here: what the guest may ask for. */
99
130
  readonly acts: readonly GuestAct[];
131
+ /** The app's look now, for a worker view (FR-91): pushed again when the app's scheme changes. */
132
+ readonly theme?: GuestTheme;
133
+ /** The app's named places, for a worker view to link to by slug (FR-93): never an address outside the app. */
134
+ readonly places?: readonly GuestPlace[];
135
+ }
136
+ /** A named place of the app: a picture by its title, and the slug a link names it by. */
137
+ export interface GuestPlace {
138
+ readonly as: string;
139
+ readonly title: string;
140
+ readonly kind: string;
100
141
  }
101
142
  /** Why the host did not apply an act the guest asked for. */
102
143
  export type GuestRefusal =
@@ -109,7 +150,19 @@ export type GuestRefusal =
109
150
  /** The request was not one the protocol knows. */
110
151
  | "malformed"
111
152
  /** The act ran and threw: its arguments did not fit, or its own rule said no. */
112
- | "failed";
153
+ | "failed"
154
+ /** A worker view asked for an act its manifest does not name (FR-92). */
155
+ | "undeclared"
156
+ /**
157
+ * A worker view asked for an act from its own code, in an app where some
158
+ * members may not see some records: there, an act applies only from the
159
+ * viewer's own press on what the view drew (FR-92).
160
+ */
161
+ | "press-only"
162
+ /** A press would have carried a field's value the view filled in, not one the viewer typed (FR-92). */
163
+ | "untyped"
164
+ /** A press was bound (`data-record`) to a record the view was not shown, or to an act that takes none (FR-92). */
165
+ | "unbound";
113
166
  export type GuestAnswer = {
114
167
  readonly type: "answer";
115
168
  readonly id: string | number;
@@ -147,10 +200,44 @@ export interface HostHeartbeat {
147
200
  readonly type: "heartbeat";
148
201
  readonly beat: number;
149
202
  }
150
- export type HostMessage = {
203
+ /**
204
+ * What the viewer did on something an open-kit view drew (FR-90): which
205
+ * node (the view's own id for it), and what the host read off it — a
206
+ * field's `value` and `checked`, a key's name — never anything of the
207
+ * host's page.
208
+ */
209
+ export interface GuestDomEvent {
210
+ readonly type: "dom-event";
211
+ /** The view's id for the node it happened on. */
212
+ readonly target: string;
213
+ /** `click`, `input`, `change`, `keydown` or `toggle`. */
214
+ readonly event: string;
215
+ readonly value?: string;
216
+ readonly checked?: boolean;
217
+ readonly key?: string;
218
+ /**
219
+ * What became of the act the press was bound to (`data-act`), when it
220
+ * was: applied by the host in the press's own handler, before the view
221
+ * heard of it (FR-92).
222
+ */
223
+ readonly pressed?: GuestPressed;
224
+ }
225
+ /** The answer to a press bound to an act: the act's name, and whether it applied or why not. */
226
+ export interface GuestPressed {
227
+ /** What the view called it (`data-act`). */
228
+ readonly as: string;
229
+ readonly ok: boolean;
230
+ readonly intent?: string;
231
+ readonly reason?: GuestRefusal;
232
+ readonly message?: string;
233
+ }
234
+ export type HostMessage =
235
+ /** `push` numbers it, for a worker view's runtime to say when it has drawn it (FR-94). */
236
+ {
151
237
  readonly type: "props";
152
238
  readonly props: GuestProps;
153
- } | GuestAnswer | GuestEvent | HostHeartbeat;
239
+ readonly push?: number;
240
+ } | GuestAnswer | GuestEvent | GuestDomEvent | HostHeartbeat;
154
241
  export type GuestRequest = {
155
242
  readonly type: "act";
156
243
  readonly nonce: string;
@@ -161,6 +248,12 @@ export type GuestRequest = {
161
248
  readonly type: "navigate";
162
249
  readonly nonce: string;
163
250
  readonly to: string;
251
+ }
252
+ /** Go to a named place of this app, by its slug (FR-93): a worker view's links stay in the app. */
253
+ | {
254
+ readonly type: "navigate";
255
+ readonly nonce: string;
256
+ readonly place: string;
164
257
  } | {
165
258
  readonly type: "size";
166
259
  readonly nonce: string;
@@ -177,6 +270,19 @@ export type GuestRequest = {
177
270
  readonly type: "heartbeat";
178
271
  readonly nonce: string;
179
272
  readonly beat: number;
273
+ }
274
+ /** An open-kit view's one stylesheet (FR-90): the host draws what the open kit allows of it. */
275
+ | {
276
+ readonly type: "style";
277
+ readonly nonce: string;
278
+ readonly css: string;
279
+ }
280
+ /** An open-kit view's runtime has drawn props push `push`, its listeners taking `ms` (FR-94). */
281
+ | {
282
+ readonly type: "pushed";
283
+ readonly nonce: string;
284
+ readonly push: number;
285
+ readonly ms: number;
180
286
  };
181
287
  /** Whether a window message is a guest saying it is ready. */
182
288
  export declare function isGuestReady(data: unknown): data is GuestReady;
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],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protocol.js CHANGED
@@ -12,6 +12,7 @@
12
12
  * host → guest { type: "props", props } (over the port, whenever what it sees moves)
13
13
  * guest → host { type: "act", nonce, id, name, args } (over the port: ask for an act)
14
14
  * guest → host { type: "navigate", nonce, to } (over the port: go to a record)
15
+ * guest → host { type: "navigate", nonce, place } (over the port: go to a named place of the app, by its slug)
15
16
  * guest → host { type: "size", nonce, height } (over the port: the height it wants)
16
17
  * host → guest { type: "answer", id, ok, … } (over the port: what became of an act)
17
18
  *
@@ -27,6 +28,18 @@
27
28
  * A frame guest never sends `render`; a host that is not drawing a worker
28
29
  * drops it unread.
29
30
  *
31
+ * A WORKER VIEW ON THE OPEN KIT (FR-90) draws HTML, SVG and CSS rather than
32
+ * the kit's components, so its records name native elements and their
33
+ * attributes, and it says two things more and hears one:
34
+ *
35
+ * guest → host { type: "style", nonce, css } (over the port: its one stylesheet)
36
+ * guest → host { type: "pushed", nonce, push, ms } (over the port: the runtime has drawn push `push`, in `ms`)
37
+ * host → guest { type: "dom-event", target, event, … } (over the port: the viewer clicked, typed or chose on what it drew)
38
+ *
39
+ * The host draws a stylesheet only as the open kit allows (host/css.ts),
40
+ * and numbers each props push (`push`) so the runtime can say when it has
41
+ * drawn it.
42
+ *
30
43
  * A worker's host also watches that the worker is alive. Its runtime — not
31
44
  * the guest's code, which can stop it only by blocking its own event loop —
32
45
  * answers each heartbeat with the beat it was asked, and a worker that goes
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,gFAAgF;AAChF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC;AAEhC,gFAAgF;AAChF,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC;AAE7C,2EAA2E;AAC3E,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC;AA4GpC,8DAA8D;AAC9D,MAAM,UAAU,YAAY,CAAC,IAAa;IACxC,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAK,IAAmB,CAAC,OAAO,KAAK,aAAa,CAAC;AACrG,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,WAAW,CAAC,IAAa;IACvC,MAAM,KAAK,GAAG,IAAiB,CAAC;IAChC,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,KAAK,YAAY,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,CAAC;AACxH,CAAC"}
1
+ {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAEH,gFAAgF;AAChF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC;AAEhC,gFAAgF;AAChF,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC;AAE7C,2EAA2E;AAC3E,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC;AAmMpC,8DAA8D;AAC9D,MAAM,UAAU,YAAY,CAAC,IAAa;IACxC,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAK,IAAmB,CAAC,OAAO,KAAK,aAAa,CAAC;AACrG,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,WAAW,CAAC,IAAa;IACvC,MAAM,KAAK,GAAG,IAAiB,CAAC;IAChC,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,KAAK,YAAY,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,CAAC;AACxH,CAAC"}
@@ -31,9 +31,20 @@ export interface Hardening {
31
31
  /** False when the runtime is not in a worker, and so hardened nothing. */
32
32
  readonly worker?: false;
33
33
  }
34
+ export interface HardenOptions {
35
+ /**
36
+ * A symbol-keyed property an engine will not let go may stay when it
37
+ * holds a primitive that cannot change: it hands back nothing. workerd
38
+ * marks its global's classes so (`[cloudflare:internal-class]`, a
39
+ * symbol); a headless run there keeps them (FR-95). A worker in a page
40
+ * keeps none: its engines have none, and the sandbox suite says so.
41
+ */
42
+ readonly primitivesStay?: boolean;
43
+ }
34
44
  /**
35
45
  * HARDEN A WORKER'S GLOBAL before guest code runs. Called once by the
36
- * worker entry, after Remote DOM's polyfill and the kit are in place.
46
+ * worker entry, after Remote DOM's polyfill and the kit are in place; an
47
+ * open-kit view's runtime (worker/view.ts) keeps its `graview` too.
37
48
  */
38
- export declare function harden(scope?: typeof globalThis): Hardening;
49
+ export declare function harden(scope?: typeof globalThis, kept?: readonly string[], options?: HardenOptions): Hardening;
39
50
  //# sourceMappingURL=harden.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"harden.d.ts","sourceRoot":"","sources":["../../src/worker/harden.ts"],"names":[],"mappings":"AA0CA,6FAA6F;AAC7F,eAAO,MAAM,QAAQ,y2BAQX,CAAC;AAEX,gHAAgH;AAChH,eAAO,MAAM,cAAc,2XAIjB,CAAC;AAEX,8EAA8E;AAC9E,eAAO,MAAM,QAAQ,0KAA2K,CAAC;AAEjM;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,sCAAuC,CAAC;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,MAAM,EAA2E,CAAC;AAEvH,2GAA2G;AAC3G,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAG5C,CAAC;AAEH,oEAAoE;AACpE,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,mGAAmG;IACnG,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,6HAA6H;IAC7H,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC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