@fluid-app/widget-runtime 0.1.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.
Files changed (46) hide show
  1. package/README.md +77 -0
  2. package/dist/Thread-0eUyc0Hw.cjs +591 -0
  3. package/dist/Thread-0eUyc0Hw.cjs.map +1 -0
  4. package/dist/Thread-BiW7rXts.mjs +574 -0
  5. package/dist/Thread-BiW7rXts.mjs.map +1 -0
  6. package/dist/index.cjs +6 -0
  7. package/dist/index.d.cts +3 -0
  8. package/dist/index.d.mts +3 -0
  9. package/dist/index.mjs +3 -0
  10. package/dist/remote-dom-renderer-BU-73KvK.d.mts +90 -0
  11. package/dist/remote-dom-renderer-BU-73KvK.d.mts.map +1 -0
  12. package/dist/remote-dom-renderer-DSHFetvm.d.cts +90 -0
  13. package/dist/remote-dom-renderer-DSHFetvm.d.cts.map +1 -0
  14. package/dist/remote-dom-renderer-DUQf80Nu.cjs +2116 -0
  15. package/dist/remote-dom-renderer-DUQf80Nu.cjs.map +1 -0
  16. package/dist/remote-dom-renderer-DcwcNPsu.mjs +2081 -0
  17. package/dist/remote-dom-renderer-DcwcNPsu.mjs.map +1 -0
  18. package/dist/remote-dom-values-BSAxrOE7.mjs +238 -0
  19. package/dist/remote-dom-values-BSAxrOE7.mjs.map +1 -0
  20. package/dist/remote-dom-values-D4AgBNWr.d.cts +32 -0
  21. package/dist/remote-dom-values-D4AgBNWr.d.cts.map +1 -0
  22. package/dist/remote-dom-values-DbgIedSg.cjs +297 -0
  23. package/dist/remote-dom-values-DbgIedSg.cjs.map +1 -0
  24. package/dist/remote-dom-values-EwoLXnSn.d.mts +32 -0
  25. package/dist/remote-dom-values-EwoLXnSn.d.mts.map +1 -0
  26. package/dist/remote-dom.cjs +6 -0
  27. package/dist/remote-dom.d.cts +3 -0
  28. package/dist/remote-dom.d.mts +3 -0
  29. package/dist/remote-dom.mjs +3 -0
  30. package/dist/worker-react-bootstrap-C7tCMYGA.mjs +13 -0
  31. package/dist/worker-react-bootstrap-C7tCMYGA.mjs.map +1 -0
  32. package/dist/worker-react-bootstrap-N8jcWZ3L.cjs +13 -0
  33. package/dist/worker-react-bootstrap-N8jcWZ3L.cjs.map +1 -0
  34. package/dist/worker-react-renderer-BKzig_Vy.mjs +185 -0
  35. package/dist/worker-react-renderer-BKzig_Vy.mjs.map +1 -0
  36. package/dist/worker-react-renderer-BSFxMMf7.cjs +186 -0
  37. package/dist/worker-react-renderer-BSFxMMf7.cjs.map +1 -0
  38. package/dist/worker.cjs +325 -0
  39. package/dist/worker.cjs.map +1 -0
  40. package/dist/worker.d.cts +46 -0
  41. package/dist/worker.d.cts.map +1 -0
  42. package/dist/worker.d.mts +46 -0
  43. package/dist/worker.d.mts.map +1 -0
  44. package/dist/worker.mjs +319 -0
  45. package/dist/worker.mjs.map +1 -0
  46. package/package.json +68 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-dom-values-BSAxrOE7.mjs","names":[],"sources":["../src/remote-dom-values.ts"],"sourcesContent":["import type {\n RemoteMutationRecord,\n RemoteNodeSerialization,\n} from \"@remote-dom/core\";\n\nexport const REMOTE_DOM_FULLSCREEN_CAPABILITY = \"fullscreen\";\nexport const FLUID_SEARCH_SORT_TAG_NAME = \"fluid-ui-search-sort\";\nexport const FLUID_SPACER_WIDGET_TAG_NAME = \"fluid-spacer-widget\";\n\n/** Canonical element allowlist shared by the worker registration and host sanitizer. */\nexport const REMOTE_DOM_ALLOWED_TAG_NAMES = [\n \"a\",\n \"abbr\",\n \"address\",\n \"article\",\n \"aside\",\n \"audio\",\n \"b\",\n \"bdi\",\n \"bdo\",\n \"blockquote\",\n \"br\",\n \"button\",\n \"caption\",\n \"cite\",\n \"code\",\n \"col\",\n \"colgroup\",\n \"data\",\n \"dd\",\n \"del\",\n \"details\",\n \"dfn\",\n \"dialog\",\n \"div\",\n \"dl\",\n \"dt\",\n \"em\",\n \"fieldset\",\n \"figcaption\",\n \"figure\",\n \"footer\",\n \"form\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\",\n \"header\",\n \"hr\",\n \"i\",\n \"img\",\n \"input\",\n \"ins\",\n \"kbd\",\n \"label\",\n \"legend\",\n \"li\",\n \"main\",\n \"mark\",\n \"meter\",\n \"nav\",\n \"ol\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"p\",\n \"picture\",\n \"pre\",\n \"progress\",\n \"q\",\n \"rp\",\n \"rt\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"section\",\n \"select\",\n \"small\",\n \"source\",\n \"span\",\n \"strong\",\n \"sub\",\n \"summary\",\n \"sup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"textarea\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"time\",\n \"tr\",\n \"track\",\n \"u\",\n \"ul\",\n \"var\",\n \"video\",\n \"wbr\",\n FLUID_SEARCH_SORT_TAG_NAME,\n FLUID_SPACER_WIDGET_TAG_NAME,\n] as const;\n\n/** Canonical event allowlist shared by worker elements and host forwarding. */\nexport const SUPPORTED_REMOTE_DOM_EVENTS = [\n \"blur\",\n \"change\",\n \"click\",\n \"contextmenu\",\n \"dblclick\",\n \"focus\",\n \"input\",\n \"keydown\",\n \"keypress\",\n \"keyup\",\n \"mousedown\",\n \"mouseenter\",\n \"mouseleave\",\n \"mousemove\",\n \"mouseout\",\n \"mouseover\",\n \"mouseup\",\n \"pointercancel\",\n \"pointerdown\",\n \"pointerenter\",\n \"pointerleave\",\n \"pointermove\",\n \"pointerout\",\n \"pointerover\",\n \"pointerup\",\n \"submit\",\n] as const;\nexport const REMOTE_DOM_SEARCH_SORT_EVENTS = [\n \"search-change\",\n \"sort-change\",\n] as const;\n\nexport type RemoteDomRemoteNode = RemoteNodeSerialization;\nexport type RemoteDomRemoteMutationRecord = RemoteMutationRecord;\n\nexport type RemoteDomSerializableValue =\n | null\n | boolean\n | number\n | string\n | readonly RemoteDomSerializableValue[]\n | { readonly [key: string]: RemoteDomSerializableValue };\n\nconst REMOTE_DOM_UNSAFE_PROPERTY_KEYS = new Set([\n \"__proto__\",\n \"constructor\",\n \"prototype\",\n]);\nconst MAX_REMOTE_DOM_SERIALIZATION_DEPTH = 50;\n\nexport function isSafeRemoteDomPropertyKey(key: string): boolean {\n return !REMOTE_DOM_UNSAFE_PROPERTY_KEYS.has(key);\n}\n\n/** Converts an arbitrary value into a structured-clone-safe Remote DOM value. */\nexport function toRemoteDomSerializableValue(\n value: unknown,\n): RemoteDomSerializableValue | undefined {\n return serializeRemoteDomValue(value, new WeakSet<object>(), 0);\n}\n\nfunction serializeRemoteDomValue(\n value: unknown,\n ancestors: WeakSet<object>,\n depth: number,\n): RemoteDomSerializableValue | undefined {\n if (\n value === undefined ||\n typeof value === \"function\" ||\n typeof value === \"symbol\"\n ) {\n return undefined;\n }\n if (typeof value === \"bigint\") return value.toString();\n if (\n value === null ||\n typeof value === \"string\" ||\n typeof value === \"boolean\"\n ) {\n return value;\n }\n if (typeof value === \"number\") {\n return Number.isFinite(value) ? value : null;\n }\n if (typeof value !== \"object\") return null;\n if (depth > MAX_REMOTE_DOM_SERIALIZATION_DEPTH || ancestors.has(value)) {\n return null;\n }\n if (value instanceof Date) {\n return Number.isFinite(value.getTime()) ? value.toISOString() : null;\n }\n if (value instanceof Error) {\n return { name: value.name, message: value.message };\n }\n\n ancestors.add(value);\n try {\n if (Array.isArray(value)) {\n return value.map(\n (item) => serializeRemoteDomValue(item, ancestors, depth + 1) ?? null,\n );\n }\n\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null) return null;\n\n const serialized: Record<string, RemoteDomSerializableValue> = {};\n for (const [key, item] of Object.entries(value)) {\n if (!isSafeRemoteDomPropertyKey(key)) continue;\n\n const serializedItem = serializeRemoteDomValue(\n item,\n ancestors,\n depth + 1,\n );\n if (serializedItem !== undefined) serialized[key] = serializedItem;\n }\n return serialized;\n } finally {\n ancestors.delete(value);\n }\n}\n\nexport function isRemoteDomSerializableValue(\n value: unknown,\n): value is RemoteDomSerializableValue {\n return isRemoteDomSerializableValueInternal(value, new WeakSet<object>(), 0);\n}\n\nfunction isRemoteDomSerializableValueInternal(\n value: unknown,\n seen: WeakSet<object>,\n depth: number,\n): value is RemoteDomSerializableValue {\n if (value === null) return true;\n\n switch (typeof value) {\n case \"boolean\":\n case \"string\":\n return true;\n case \"number\":\n return Number.isFinite(value);\n case \"object\":\n return isRemoteDomSerializableObject(value, seen, depth);\n default:\n return false;\n }\n}\n\nfunction isRemoteDomSerializableObject(\n value: object,\n ancestors: WeakSet<object>,\n depth: number,\n): value is\n | readonly RemoteDomSerializableValue[]\n | { readonly [key: string]: RemoteDomSerializableValue } {\n if (depth > 50 || ancestors.has(value)) return false;\n\n const prototype = Object.getPrototypeOf(value);\n if (\n !Array.isArray(value) &&\n prototype !== Object.prototype &&\n prototype !== null\n ) {\n return false;\n }\n\n ancestors.add(value);\n try {\n if (Array.isArray(value)) {\n return value.every((item) =>\n isRemoteDomSerializableValueInternal(item, ancestors, depth + 1),\n );\n }\n\n return Object.entries(value).every(\n ([key, item]) =>\n isSafeRemoteDomPropertyKey(key) &&\n isRemoteDomSerializableValueInternal(item, ancestors, depth + 1),\n );\n } finally {\n ancestors.delete(value);\n }\n}\n\nexport type RemoteDomNodeProperties = Readonly<\n Record<string, RemoteDomSerializableValue | undefined>\n>;\n\nexport interface RemoteDomNavigationIntent {\n readonly href: string;\n readonly url: string;\n readonly targetId?: string;\n readonly source: \"anchor\";\n readonly altKey: boolean;\n readonly ctrlKey: boolean;\n readonly metaKey: boolean;\n readonly shiftKey: boolean;\n readonly button: number;\n}\n\nexport const DEFAULT_REMOTE_DOM_MEDIA_ORIGINS = [\n \"https://assets.fluid.app\",\n \"https://cdn.fluid.app\",\n \"https://ik.imagekit.io\",\n \"https://media.fluid.app\",\n] as const;\n\nexport interface RemoteDomUrlOriginPolicy {\n readonly artifactOrigins: readonly string[];\n readonly artifactBaseUrl?: string;\n readonly mediaOrigins: readonly string[];\n readonly navigationOrigin?: string;\n}\n\nexport interface RemoteDomUrlOriginPolicyInput {\n readonly artifactUrls: readonly string[];\n readonly mediaOrigins?: readonly string[];\n readonly navigationOrigin?: string;\n}\n\nexport function createRemoteDomUrlOriginPolicy({\n artifactUrls,\n mediaOrigins = DEFAULT_REMOTE_DOM_MEDIA_ORIGINS,\n navigationOrigin,\n}: RemoteDomUrlOriginPolicyInput): RemoteDomUrlOriginPolicy {\n const artifactOriginSet = new Set<string>();\n let artifactBaseUrl: string | undefined;\n for (const artifactUrl of artifactUrls) {\n const normalizedUrl = normalizeRemoteDomHttpUrl(artifactUrl);\n if (!normalizedUrl) continue;\n artifactOriginSet.add(normalizedUrl.origin);\n artifactBaseUrl ??= normalizedUrl.href;\n }\n\n const mediaOriginSet = new Set<string>();\n for (const mediaOrigin of mediaOrigins) {\n const origin = normalizeRemoteDomHttpOrigin(mediaOrigin);\n if (origin) mediaOriginSet.add(origin);\n }\n\n const navigationHttpOrigin = navigationOrigin\n ? normalizeRemoteDomHttpOrigin(navigationOrigin)\n : undefined;\n\n return {\n artifactOrigins: Array.from(artifactOriginSet),\n ...(artifactBaseUrl ? { artifactBaseUrl } : {}),\n mediaOrigins: Array.from(mediaOriginSet),\n ...(navigationHttpOrigin === undefined\n ? {}\n : { navigationOrigin: navigationHttpOrigin }),\n };\n}\n\nfunction normalizeRemoteDomHttpOrigin(value: string): string | undefined {\n return normalizeRemoteDomHttpUrl(value)?.origin;\n}\n\nfunction normalizeRemoteDomHttpUrl(value: string): URL | undefined {\n try {\n const parsedUrl = new URL(value);\n return parsedUrl.protocol === \"http:\" || parsedUrl.protocol === \"https:\"\n ? parsedUrl\n : undefined;\n } catch {\n return undefined;\n }\n}\n\nexport interface RemoteDomProtocolError {\n readonly code: string;\n readonly message: string;\n readonly details?: RemoteDomSerializableValue;\n}\n"],"mappings":";AAKA,MAAa,mCAAmC;AAChD,MAAa,6BAA6B;AAC1C,MAAa,+BAA+B;;AAG5C,MAAa,+BAA+B;CAC1C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;AAGD,MAAa,8BAA8B;CACzC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AACD,MAAa,gCAAgC,CAC3C,iBACA,cACD;AAaD,MAAM,kCAAkC,IAAI,IAAI;CAC9C;CACA;CACA;CACD,CAAC;AACF,MAAM,qCAAqC;AAE3C,SAAgB,2BAA2B,KAAsB;AAC/D,QAAO,CAAC,gCAAgC,IAAI,IAAI;;;AAIlD,SAAgB,6BACd,OACwC;AACxC,QAAO,wBAAwB,uBAAO,IAAI,SAAiB,EAAE,EAAE;;AAGjE,SAAS,wBACP,OACA,WACA,OACwC;AACxC,KACE,UAAU,KAAA,KACV,OAAO,UAAU,cACjB,OAAO,UAAU,SAEjB;AAEF,KAAI,OAAO,UAAU,SAAU,QAAO,MAAM,UAAU;AACtD,KACE,UAAU,QACV,OAAO,UAAU,YACjB,OAAO,UAAU,UAEjB,QAAO;AAET,KAAI,OAAO,UAAU,SACnB,QAAO,OAAO,SAAS,MAAM,GAAG,QAAQ;AAE1C,KAAI,OAAO,UAAU,SAAU,QAAO;AACtC,KAAI,QAAQ,sCAAsC,UAAU,IAAI,MAAM,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teDomSerializableValue[] | {
3
+ readonly [key: string]: RemoteDomSerializableValue;
4
+ };
5
+ /** Converts an arbitrary value into a structured-clone-safe Remote DOM value. */
6
+ declare function toRemoteDomSerializableValue(value: unknown): RemoteDomSerializableValue | undefined;
7
+ declare function isRemoteDomSerializableValue(value: unknown): value is RemoteDomSerializableValue;
8
+ interface RemoteDomNavigationIntent {
9
+ readonly href: string;
10
+ readonly url: string;
11
+ readonly targetId?: string;
12
+ readonly source: "anchor";
13
+ readonly altKey: boolean;
14
+ readonly ctrlKey: boolean;
15
+ readonly metaKey: boolean;
16
+ readonly shiftKey: boolean;
17
+ readonly button: number;
18
+ }
19
+ interface RemoteDomUrlOriginPolicy {
20
+ readonly artifactOrigins: readonly string[];
21
+ readonly artifactBaseUrl?: string;
22
+ readonly mediaOrigins: readonly string[];
23
+ readonly navigationOrigin?: string;
24
+ }
25
+ interface RemoteDomUrlOriginPolicyInput {
26
+ readonly artifactUrls: readonly string[];
27
+ readonly mediaOrigins?: readonly string[];
28
+ readonly navigationOrigin?: string;
29
+ }
30
+ //#endregion
31
+ export { isRemoteDomSerializableValue as a, RemoteDomUrlOriginPolicyInput as i, RemoteDomSerializableValue as n, toRemoteDomSerializableValue as o, RemoteDomUrlOriginPolicy as r, RemoteDomNavigationIntent as t };
32
+ //# sourceMappingURL=remote-dom-values-D4AgBNWr.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-dom-values-D4AgBNWr.d.cts","names":[],"sources":["../src/remote-dom-values.ts"],"mappings":";KA8IY,0BAAA,+CAKC,0BAAA;EAAA,UACG,GAAA,WAAc,0BAAA;AAAA;;iBAcd,4BAAA,CACd,KAAA,YACC,0BAAA;AAAA,iBAkEa,4BAAA,CACd,KAAA,YACC,KAAA,IAAS,0BAAA;AAAA,UAgEK,yBAAA;EAAA,SACN,IAAA;EAAA,SACA,GAAA;EAAA,SACA,QAAA;EAAA,SACA,MAAA;EAAA,SACA,MAAA;EAAA,SACA,OAAA;EAAA,SACA,OAAA;EAAA,SACA,QAAA;EAAA,SACA,MAAA;AAAA;AAAA,UAUM,wBAAA;EAAA,SACN,eAAA;EAAA,SACA,eAAA;EAAA,SACA,YAAA;EAAA,SACA,gBAAA;AAAA;AAAA,UAGM,6BAAA;EAAA,SACN,YAAA;EAAA,SACA,YAAA;EAAA,SACA,gBAAA;AAAA"}
@@ -0,0 +1,297 @@
1
+ //#region src/remote-dom-values.ts
2
+ const REMOTE_DOM_FULLSCREEN_CAPABILITY = "fullscreen";
3
+ const FLUID_SEARCH_SORT_TAG_NAME = "fluid-ui-search-sort";
4
+ const FLUID_SPACER_WIDGET_TAG_NAME = "fluid-spacer-widget";
5
+ /** Canonical element allowlist shared by the worker registration and host sanitizer. */
6
+ const REMOTE_DOM_ALLOWED_TAG_NAMES = [
7
+ "a",
8
+ "abbr",
9
+ "address",
10
+ "article",
11
+ "aside",
12
+ "audio",
13
+ "b",
14
+ "bdi",
15
+ "bdo",
16
+ "blockquote",
17
+ "br",
18
+ "button",
19
+ "caption",
20
+ "cite",
21
+ "code",
22
+ "col",
23
+ "colgroup",
24
+ "data",
25
+ "dd",
26
+ "del",
27
+ "details",
28
+ "dfn",
29
+ "dialog",
30
+ "div",
31
+ "dl",
32
+ "dt",
33
+ "em",
34
+ "fieldset",
35
+ "figcaption",
36
+ "figure",
37
+ "footer",
38
+ "form",
39
+ "h1",
40
+ "h2",
41
+ "h3",
42
+ "h4",
43
+ "h5",
44
+ "h6",
45
+ "header",
46
+ "hr",
47
+ "i",
48
+ "img",
49
+ "input",
50
+ "ins",
51
+ "kbd",
52
+ "label",
53
+ "legend",
54
+ "li",
55
+ "main",
56
+ "mark",
57
+ "meter",
58
+ "nav",
59
+ "ol",
60
+ "optgroup",
61
+ "option",
62
+ "output",
63
+ "p",
64
+ "picture",
65
+ "pre",
66
+ "progress",
67
+ "q",
68
+ "rp",
69
+ "rt",
70
+ "ruby",
71
+ "s",
72
+ "samp",
73
+ "section",
74
+ "select",
75
+ "small",
76
+ "source",
77
+ "span",
78
+ "strong",
79
+ "sub",
80
+ "summary",
81
+ "sup",
82
+ "table",
83
+ "tbody",
84
+ "td",
85
+ "textarea",
86
+ "tfoot",
87
+ "th",
88
+ "thead",
89
+ "time",
90
+ "tr",
91
+ "track",
92
+ "u",
93
+ "ul",
94
+ "var",
95
+ "video",
96
+ "wbr",
97
+ FLUID_SEARCH_SORT_TAG_NAME,
98
+ FLUID_SPACER_WIDGET_TAG_NAME
99
+ ];
100
+ /** Canonical event allowlist shared by worker elements and host forwarding. */
101
+ const SUPPORTED_REMOTE_DOM_EVENTS = [
102
+ "blur",
103
+ "change",
104
+ "click",
105
+ "contextmenu",
106
+ "dblclick",
107
+ "focus",
108
+ "input",
109
+ "keydown",
110
+ "keypress",
111
+ "keyup",
112
+ "mousedown",
113
+ "mouseenter",
114
+ "mouseleave",
115
+ "mousemove",
116
+ "mouseout",
117
+ "mouseover",
118
+ "mouseup",
119
+ "pointercancel",
120
+ "pointerdown",
121
+ "pointerenter",
122
+ "pointerleave",
123
+ "pointermove",
124
+ "pointerout",
125
+ "pointerover",
126
+ "pointerup",
127
+ "submit"
128
+ ];
129
+ const REMOTE_DOM_SEARCH_SORT_EVENTS = ["search-change", "sort-change"];
130
+ const REMOTE_DOM_UNSAFE_PROPERTY_KEYS = new Set([
131
+ "__proto__",
132
+ "constructor",
133
+ "prototype"
134
+ ]);
135
+ const MAX_REMOTE_DOM_SERIALIZATION_DEPTH = 50;
136
+ function isSafeRemoteDomPropertyKey(key) {
137
+ return !REMOTE_DOM_UNSAFE_PROPERTY_KEYS.has(key);
138
+ }
139
+ /** Converts an arbitrary value into a structured-clone-safe Remote DOM value. */
140
+ function toRemoteDomSerializableValue(value) {
141
+ return serializeRemoteDomValue(value, /* @__PURE__ */ new WeakSet(), 0);
142
+ }
143
+ function serializeRemoteDomValue(value, ancestors, depth) {
144
+ if (value === void 0 || typeof value === "function" || typeof value === "symbol") return;
145
+ if (typeof value === "bigint") return value.toString();
146
+ if (value === null || typeof value === "string" || typeof value === "boolean") return value;
147
+ if (typeof value === "number") return Number.isFinite(value) ? value : null;
148
+ if (typeof value !== "object") return null;
149
+ if (depth > MAX_REMOTE_DOM_SERIALIZATION_DEPTH || ancestors.has(value)) return null;
150
+ if (value instanceof Date) return Number.isFinite(value.getTime()) ? value.toISOString() : null;
151
+ if (value instanceof Error) return {
152
+ name: value.name,
153
+ message: value.message
154
+ };
155
+ ancestors.add(value);
156
+ try {
157
+ if (Array.isArray(value)) return value.map((item) => serializeRemoteDomValue(item, ancestors, depth + 1) ?? null);
158
+ const prototype = Object.getPrototypeOf(value);
159
+ if (prototype !== Object.prototype && prototype !== null) return null;
160
+ const serialized = {};
161
+ for (const [key, item] of Object.entries(value)) {
162
+ if (!isSafeRemoteDomPropertyKey(key)) continue;
163
+ const serializedItem = serializeRemoteDomValue(item, ancestors, depth + 1);
164
+ if (serializedItem !== void 0) serialized[key] = serializedItem;
165
+ }
166
+ return serialized;
167
+ } finally {
168
+ ancestors.delete(value);
169
+ }
170
+ }
171
+ function isRemoteDomSerializableValue(value) {
172
+ return isRemoteDomSerializableValueInternal(value, /* @__PURE__ */ new WeakSet(), 0);
173
+ }
174
+ function isRemoteDomSerializableValueInternal(value, seen, depth) {
175
+ if (value === null) return true;
176
+ switch (typeof value) {
177
+ case "boolean":
178
+ case "string": return true;
179
+ case "number": return Number.isFinite(value);
180
+ case "object": return isRemoteDomSerializableObject(value, seen, depth);
181
+ default: return false;
182
+ }
183
+ }
184
+ function isRemoteDomSerializableObject(value, ancestors, depth) {
185
+ if (depth > 50 || ancestors.has(value)) return false;
186
+ const prototype = Object.getPrototypeOf(value);
187
+ if (!Array.isArray(value) && prototype !== Object.prototype && prototype !== null) return false;
188
+ ancestors.add(value);
189
+ try {
190
+ if (Array.isArray(value)) return value.every((item) => isRemoteDomSerializableValueInternal(item, ancestors, depth + 1));
191
+ return Object.entries(value).every(([key, item]) => isSafeRemoteDomPropertyKey(key) && isRemoteDomSerializableValueInternal(item, ancestors, depth + 1));
192
+ } finally {
193
+ ancestors.delete(value);
194
+ }
195
+ }
196
+ const DEFAULT_REMOTE_DOM_MEDIA_ORIGINS = [
197
+ "https://assets.fluid.app",
198
+ "https://cdn.fluid.app",
199
+ "https://ik.imagekit.io",
200
+ "https://media.fluid.app"
201
+ ];
202
+ function createRemoteDomUrlOriginPolicy({ artifactUrls, mediaOrigins = DEFAULT_REMOTE_DOM_MEDIA_ORIGINS, navigationOrigin }) {
203
+ const artifactOriginSet = /* @__PURE__ */ new Set();
204
+ let artifactBaseUrl;
205
+ for (const artifactUrl of artifactUrls) {
206
+ const normalizedUrl = normalizeRemoteDomHttpUrl(artifactUrl);
207
+ if (!normalizedUrl) continue;
208
+ artifactOriginSet.add(normalizedUrl.origin);
209
+ artifactBaseUrl ??= normalizedUrl.href;
210
+ }
211
+ const mediaOriginSet = /* @__PURE__ */ new Set();
212
+ for (const mediaOrigin of mediaOrigins) {
213
+ const origin = normalizeRemoteDomHttpOrigin(mediaOrigin);
214
+ if (origin) mediaOriginSet.add(origin);
215
+ }
216
+ const navigationHttpOrigin = navigationOrigin ? normalizeRemoteDomHttpOrigin(navigationOrigin) : void 0;
217
+ return {
218
+ artifactOrigins: Array.from(artifactOriginSet),
219
+ ...artifactBaseUrl ? { artifactBaseUrl } : {},
220
+ mediaOrigins: Array.from(mediaOriginSet),
221
+ ...navigationHttpOrigin === void 0 ? {} : { navigationOrigin: navigationHttpOrigin }
222
+ };
223
+ }
224
+ function normalizeRemoteDomHttpOrigin(value) {
225
+ return normalizeRemoteDomHttpUrl(value)?.origin;
226
+ }
227
+ function normalizeRemoteDomHttpUrl(value) {
228
+ try {
229
+ const parsedUrl = new URL(value);
230
+ return parsedUrl.protocol === "http:" || parsedUrl.protocol === "https:" ? parsedUrl : void 0;
231
+ } catch {
232
+ return;
233
+ }
234
+ }
235
+ //#endregion
236
+ Object.defineProperty(exports, "FLUID_SEARCH_SORT_TAG_NAME", {
237
+ enumerable: true,
238
+ get: function() {
239
+ return FLUID_SEARCH_SORT_TAG_NAME;
240
+ }
241
+ });
242
+ Object.defineProperty(exports, "FLUID_SPACER_WIDGET_TAG_NAME", {
243
+ enumerable: true,
244
+ get: function() {
245
+ return FLUID_SPACER_WIDGET_TAG_NAME;
246
+ }
247
+ });
248
+ Object.defineProperty(exports, "REMOTE_DOM_ALLOWED_TAG_NAMES", {
249
+ enumerable: true,
250
+ get: function() {
251
+ return REMOTE_DOM_ALLOWED_TAG_NAMES;
252
+ }
253
+ });
254
+ Object.defineProperty(exports, "REMOTE_DOM_FULLSCREEN_CAPABILITY", {
255
+ enumerable: true,
256
+ get: function() {
257
+ return REMOTE_DOM_FULLSCREEN_CAPABILITY;
258
+ }
259
+ });
260
+ Object.defineProperty(exports, "REMOTE_DOM_SEARCH_SORT_EVENTS", {
261
+ enumerable: true,
262
+ get: function() {
263
+ return REMOTE_DOM_SEARCH_SORT_EVENTS;
264
+ }
265
+ });
266
+ Object.defineProperty(exports, "SUPPORTED_REMOTE_DOM_EVENTS", {
267
+ enumerable: true,
268
+ get: function() {
269
+ return SUPPORTED_REMOTE_DOM_EVENTS;
270
+ }
271
+ });
272
+ Object.defineProperty(exports, "createRemoteDomUrlOriginPolicy", {
273
+ enumerable: true,
274
+ get: function() {
275
+ return createRemoteDomUrlOriginPolicy;
276
+ }
277
+ });
278
+ Object.defineProperty(exports, "isRemoteDomSerializableValue", {
279
+ enumerable: true,
280
+ get: function() {
281
+ return isRemoteDomSerializableValue;
282
+ }
283
+ });
284
+ Object.defineProperty(exports, "isSafeRemoteDomPropertyKey", {
285
+ enumerable: true,
286
+ get: function() {
287
+ return isSafeRemoteDomPropertyKey;
288
+ }
289
+ });
290
+ Object.defineProperty(exports, "toRemoteDomSerializableValue", {
291
+ enumerable: true,
292
+ get: function() {
293
+ return toRemoteDomSerializableValue;
294
+ }
295
+ });
296
+
297
+ //# sourceMappingURL=remote-dom-values-DbgIedSg.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-dom-values-DbgIedSg.cjs","names":[],"sources":["../src/remote-dom-values.ts"],"sourcesContent":["import type {\n RemoteMutationRecord,\n RemoteNodeSerialization,\n} from \"@remote-dom/core\";\n\nexport const REMOTE_DOM_FULLSCREEN_CAPABILITY = \"fullscreen\";\nexport const FLUID_SEARCH_SORT_TAG_NAME = \"fluid-ui-search-sort\";\nexport const FLUID_SPACER_WIDGET_TAG_NAME = \"fluid-spacer-widget\";\n\n/** Canonical element allowlist shared by the worker registration and host sanitizer. */\nexport const REMOTE_DOM_ALLOWED_TAG_NAMES = [\n \"a\",\n \"abbr\",\n \"address\",\n \"article\",\n \"aside\",\n \"audio\",\n \"b\",\n \"bdi\",\n \"bdo\",\n \"blockquote\",\n \"br\",\n \"button\",\n \"caption\",\n \"cite\",\n \"code\",\n \"col\",\n \"colgroup\",\n \"data\",\n \"dd\",\n \"del\",\n \"details\",\n \"dfn\",\n \"dialog\",\n \"div\",\n \"dl\",\n \"dt\",\n \"em\",\n \"fieldset\",\n \"figcaption\",\n \"figure\",\n \"footer\",\n \"form\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\",\n \"header\",\n \"hr\",\n \"i\",\n \"img\",\n \"input\",\n \"ins\",\n \"kbd\",\n \"label\",\n \"legend\",\n \"li\",\n \"main\",\n \"mark\",\n \"meter\",\n \"nav\",\n \"ol\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"p\",\n \"picture\",\n \"pre\",\n \"progress\",\n \"q\",\n \"rp\",\n \"rt\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"section\",\n \"select\",\n \"small\",\n \"source\",\n \"span\",\n \"strong\",\n \"sub\",\n \"summary\",\n \"sup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"textarea\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"time\",\n \"tr\",\n \"track\",\n \"u\",\n \"ul\",\n \"var\",\n \"video\",\n \"wbr\",\n FLUID_SEARCH_SORT_TAG_NAME,\n FLUID_SPACER_WIDGET_TAG_NAME,\n] as const;\n\n/** Canonical event allowlist shared by worker elements and host forwarding. */\nexport const SUPPORTED_REMOTE_DOM_EVENTS = [\n \"blur\",\n \"change\",\n \"click\",\n \"contextmenu\",\n \"dblclick\",\n \"focus\",\n \"input\",\n \"keydown\",\n \"keypress\",\n \"keyup\",\n \"mousedown\",\n \"mouseenter\",\n \"mouseleave\",\n \"mousemove\",\n \"mouseout\",\n \"mouseover\",\n \"mouseup\",\n \"pointercancel\",\n \"pointerdown\",\n \"pointerenter\",\n \"pointerleave\",\n \"pointermove\",\n \"pointerout\",\n \"pointerover\",\n \"pointerup\",\n \"submit\",\n] as const;\nexport const REMOTE_DOM_SEARCH_SORT_EVENTS = [\n \"search-change\",\n \"sort-change\",\n] as const;\n\nexport type RemoteDomRemoteNode = RemoteNodeSerialization;\nexport type RemoteDomRemoteMutationRecord = RemoteMutationRecord;\n\nexport type RemoteDomSerializableValue =\n | null\n | boolean\n | number\n | string\n | readonly RemoteDomSerializableValue[]\n | { readonly [key: string]: RemoteDomSerializableValue };\n\nconst REMOTE_DOM_UNSAFE_PROPERTY_KEYS = new Set([\n \"__proto__\",\n \"constructor\",\n \"prototype\",\n]);\nconst MAX_REMOTE_DOM_SERIALIZATION_DEPTH = 50;\n\nexport function isSafeRemoteDomPropertyKey(key: string): boolean {\n return !REMOTE_DOM_UNSAFE_PROPERTY_KEYS.has(key);\n}\n\n/** Converts an arbitrary value into a structured-clone-safe Remote DOM value. */\nexport function toRemoteDomSerializableValue(\n value: unknown,\n): RemoteDomSerializableValue | undefined {\n return serializeRemoteDomValue(value, new WeakSet<object>(), 0);\n}\n\nfunction serializeRemoteDomValue(\n value: unknown,\n ancestors: WeakSet<object>,\n depth: number,\n): RemoteDomSerializableValue | undefined {\n if (\n value === undefined ||\n typeof value === \"function\" ||\n typeof value === \"symbol\"\n ) {\n return undefined;\n }\n if (typeof value === \"bigint\") return value.toString();\n if (\n value === null ||\n typeof value === \"string\" ||\n typeof value === \"boolean\"\n ) {\n return value;\n }\n if (typeof value === \"number\") {\n return Number.isFinite(value) ? value : null;\n }\n if (typeof value !== \"object\") return null;\n if (depth > MAX_REMOTE_DOM_SERIALIZATION_DEPTH || ancestors.has(value)) {\n return null;\n }\n if (value instanceof Date) {\n return Number.isFinite(value.getTime()) ? value.toISOString() : null;\n }\n if (value instanceof Error) {\n return { name: value.name, message: value.message };\n }\n\n ancestors.add(value);\n try {\n if (Array.isArray(value)) {\n return value.map(\n (item) => serializeRemoteDomValue(item, ancestors, depth + 1) ?? null,\n );\n }\n\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null) return null;\n\n const serialized: Record<string, RemoteDomSerializableValue> = {};\n for (const [key, item] of Object.entries(value)) {\n if (!isSafeRemoteDomPropertyKey(key)) continue;\n\n const serializedItem = serializeRemoteDomValue(\n item,\n ancestors,\n depth + 1,\n );\n if (serializedItem !== undefined) serialized[key] = serializedItem;\n }\n return serialized;\n } finally {\n ancestors.delete(value);\n }\n}\n\nexport function isRemoteDomSerializableValue(\n value: unknown,\n): value is RemoteDomSerializableValue {\n return isRemoteDomSerializableValueInternal(value, new WeakSet<object>(), 0);\n}\n\nfunction isRemoteDomSerializableValueInternal(\n value: unknown,\n seen: WeakSet<object>,\n depth: number,\n): value is RemoteDomSerializableValue {\n if (value === null) return true;\n\n switch (typeof value) {\n case \"boolean\":\n case \"string\":\n return true;\n case \"number\":\n return Number.isFinite(value);\n case \"object\":\n return isRemoteDomSerializableObject(value, seen, depth);\n default:\n return false;\n }\n}\n\nfunction isRemoteDomSerializableObject(\n value: object,\n ancestors: WeakSet<object>,\n depth: number,\n): value is\n | readonly RemoteDomSerializableValue[]\n | { readonly [key: string]: RemoteDomSerializableValue } {\n if (depth > 50 || ancestors.has(value)) return false;\n\n const prototype = Object.getPrototypeOf(value);\n if (\n !Array.isArray(value) &&\n prototype !== Object.prototype &&\n prototype !== null\n ) {\n return false;\n }\n\n ancestors.add(value);\n try {\n if (Array.isArray(value)) {\n return value.every((item) =>\n isRemoteDomSerializableValueInternal(item, ancestors, depth + 1),\n );\n }\n\n return Object.entries(value).every(\n ([key, item]) =>\n isSafeRemoteDomPropertyKey(key) &&\n isRemoteDomSerializableValueInternal(item, ancestors, depth + 1),\n );\n } finally {\n ancestors.delete(value);\n }\n}\n\nexport type RemoteDomNodeProperties = Readonly<\n Record<string, RemoteDomSerializableValue | undefined>\n>;\n\nexport interface RemoteDomNavigationIntent {\n readonly href: string;\n readonly url: string;\n readonly targetId?: string;\n readonly source: \"anchor\";\n readonly altKey: boolean;\n readonly ctrlKey: boolean;\n readonly metaKey: boolean;\n readonly shiftKey: boolean;\n readonly button: number;\n}\n\nexport const DEFAULT_REMOTE_DOM_MEDIA_ORIGINS = [\n \"https://assets.fluid.app\",\n \"https://cdn.fluid.app\",\n \"https://ik.imagekit.io\",\n \"https://media.fluid.app\",\n] as const;\n\nexport interface RemoteDomUrlOriginPolicy {\n readonly artifactOrigins: readonly string[];\n readonly artifactBaseUrl?: string;\n readonly mediaOrigins: readonly string[];\n readonly navigationOrigin?: string;\n}\n\nexport interface RemoteDomUrlOriginPolicyInput {\n readonly artifactUrls: readonly string[];\n readonly mediaOrigins?: readonly string[];\n readonly navigationOrigin?: string;\n}\n\nexport function createRemoteDomUrlOriginPolicy({\n artifactUrls,\n mediaOrigins = DEFAULT_REMOTE_DOM_MEDIA_ORIGINS,\n navigationOrigin,\n}: RemoteDomUrlOriginPolicyInput): RemoteDomUrlOriginPolicy {\n const artifactOriginSet = new Set<string>();\n let artifactBaseUrl: string | undefined;\n for (const artifactUrl of artifactUrls) {\n const normalizedUrl = normalizeRemoteDomHttpUrl(artifactUrl);\n if (!normalizedUrl) continue;\n artifactOriginSet.add(normalizedUrl.origin);\n artifactBaseUrl ??= normalizedUrl.href;\n }\n\n const mediaOriginSet = new Set<string>();\n for (const mediaOrigin of mediaOrigins) {\n const origin = normalizeRemoteDomHttpOrigin(mediaOrigin);\n if (origin) mediaOriginSet.add(origin);\n }\n\n const navigationHttpOrigin = navigationOrigin\n ? normalizeRemoteDomHttpOrigin(navigationOrigin)\n : undefined;\n\n return {\n artifactOrigins: Array.from(artifactOriginSet),\n ...(artifactBaseUrl ? { artifactBaseUrl } : {}),\n mediaOrigins: Array.from(mediaOriginSet),\n ...(navigationHttpOrigin === undefined\n ? {}\n : { navigationOrigin: navigationHttpOrigin }),\n };\n}\n\nfunction normalizeRemoteDomHttpOrigin(value: string): string | undefined {\n return normalizeRemoteDomHttpUrl(value)?.origin;\n}\n\nfunction normalizeRemoteDomHttpUrl(value: string): URL | undefined {\n try {\n const parsedUrl = new URL(value);\n return parsedUrl.protocol === \"http:\" || parsedUrl.protocol === \"https:\"\n ? parsedUrl\n : undefined;\n } catch {\n return undefined;\n }\n}\n\nexport interface RemoteDomProtocolError {\n readonly code: string;\n readonly message: string;\n readonly details?: RemoteDomSerializableValue;\n}\n"],"mappings":";AAKA,MAAa,mCAAmC;AAChD,MAAa,6BAA6B;AAC1C,MAAa,+BAA+B;;AAG5C,MAAa,+BAA+B;CAC1C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;AAGD,MAAa,8BAA8B;CACzC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;C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AAM,eAAe,cAAc;EACtC,MAAM,SAAS,6BAA6B,YAAY;AACxD,MAAI,OAAQ,gBAAe,IAAI,OAAO;;CAGxC,MAAM,uBAAuB,mBACzB,6BAA6B,iBAAiB,GAC9C,KAAA;AAEJ,QAAO;EACL,iBAAiB,MAAM,KAAK,kBAAkB;EAC9C,GAAI,kBAAkB,EAAE,iBAAiB,GAAG,EAAE;EAC9C,cAAc,MAAM,KAAK,eAAe;EACxC,GAAI,yBAAyB,KAAA,IACzB,EAAE,GACF,EAAE,kBAAkB,sBAAsB;EAC/C;;AAGH,SAAS,6BAA6B,OAAmC;AACvE,QAAO,0BAA0B,MAAM,EAAE;;AAG3C,SAAS,0BAA0B,OAAgC;AACjE,KAAI;EACF,MAAM,YAAY,IAAI,IAAI,MAAM;AAChC,SAAO,UAAU,aAAa,WAAW,UAAU,aAAa,WAC5D,YACA,KAAA;SACE;AACN"}
@@ -0,0 +1,32 @@
1
+ //#region src/remote-dom-values.d.ts
2
+ type RemoteDomSerializableValue = null | boolean | number | string | readonly RemoteDomSerializableValue[] | {
3
+ readonly [key: string]: RemoteDomSerializableValue;
4
+ };
5
+ /** Converts an arbitrary value into a structured-clone-safe Remote DOM value. */
6
+ declare function toRemoteDomSerializableValue(value: unknown): RemoteDomSerializableValue | undefined;
7
+ declare function isRemoteDomSerializableValue(value: unknown): value is RemoteDomSerializableValue;
8
+ interface RemoteDomNavigationIntent {
9
+ readonly href: string;
10
+ readonly url: string;
11
+ readonly targetId?: string;
12
+ readonly source: "anchor";
13
+ readonly altKey: boolean;
14
+ readonly ctrlKey: boolean;
15
+ readonly metaKey: boolean;
16
+ readonly shiftKey: boolean;
17
+ readonly button: number;
18
+ }
19
+ interface RemoteDomUrlOriginPolicy {
20
+ readonly artifactOrigins: readonly string[];
21
+ readonly artifactBaseUrl?: string;
22
+ readonly mediaOrigins: readonly string[];
23
+ readonly navigationOrigin?: string;
24
+ }
25
+ interface RemoteDomUrlOriginPolicyInput {
26
+ readonly artifactUrls: readonly string[];
27
+ readonly mediaOrigins?: readonly string[];
28
+ readonly navigationOrigin?: string;
29
+ }
30
+ //#endregion
31
+ export { isRemoteDomSerializableValue as a, RemoteDomUrlOriginPolicyInput as i, RemoteDomSerializableValue as n, toRemoteDomSerializableValue as o, RemoteDomUrlOriginPolicy as r, RemoteDomNavigationIntent as t };
32
+ //# sourceMappingURL=remote-dom-values-EwoLXnSn.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-dom-values-EwoLXnSn.d.mts","names":[],"sources":["../src/remote-dom-values.ts"],"mappings":";KA8IY,0BAAA,+CAKC,0BAAA;EAAA,UACG,GAAA,WAAc,0BAAA;AAAA;;iBAcd,4BAAA,CACd,KAAA,YACC,0BAAA;AAAA,iBAkEa,4BAAA,CACd,KAAA,YACC,KAAA,IAAS,0BAAA;AAAA,UAgEK,yBAAA;EAAA,SACN,IAAA;EAAA,SACA,GAAA;EAAA,SACA,QAAA;EAAA,SACA,MAAA;EAAA,SACA,MAAA;EAAA,SACA,OAAA;EAAA,SACA,OAAA;EAAA,SACA,QAAA;EAAA,SACA,MAAA;AAAA;AAAA,UAUM,wBAAA;EAAA,SACN,eAAA;EAAA,SACA,eAAA;EAAA,SACA,YAAA;EAAA,SACA,gBAAA;AAAA;AAAA,UAGM,6BAAA;EAAA,SACN,YAAA;EAAA,SACA,YAAA;EAAA,SACA,gBAAA;AAAA"}
@@ -0,0 +1,6 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_remote_dom_renderer = require("./remote-dom-renderer-DUQf80Nu.cjs");
3
+ const require_remote_dom_values = require("./remote-dom-values-DbgIedSg.cjs");
4
+ exports.isRemoteDomSerializableValue = require_remote_dom_values.isRemoteDomSerializableValue;
5
+ exports.mountRemoteDomWidget = require_remote_dom_renderer.mountRemoteDomWidget;
6
+ exports.toRemoteDomSerializableValue = require_remote_dom_values.toRemoteDomSerializableValue;
@@ -0,0 +1,3 @@
1
+ import { a as isRemoteDomSerializableValue, i as RemoteDomUrlOriginPolicyInput, n as RemoteDomSerializableValue, o as toRemoteDomSerializableValue, r as RemoteDomUrlOriginPolicy, t as RemoteDomNavigationIntent } from "./remote-dom-values-D4AgBNWr.cjs";
2
+ import { a as RemoteDomWidgetHandle, c as mountRemoteDomWidget, d as RemoteDomStyleAttachment, f as RemoteDomThemeBridgeOptions, i as RemoteDomWidgetArtifact, l as RemoteDomCssFetcher, n as RemoteDomCapabilityDeclaration, o as RemoteDomWorkerFactory, r as RemoteDomFullscreenRequest, s as RemoteDomWorkerLike, t as MountRemoteDomWidgetOptions, u as RemoteDomCssUrlInput } from "./remote-dom-renderer-DSHFetvm.cjs";
3
+ export { type MountRemoteDomWidgetOptions, type RemoteDomCapabilityDeclaration, type RemoteDomCssFetcher, type RemoteDomCssUrlInput, type RemoteDomFullscreenRequest, type RemoteDomNavigationIntent, type RemoteDomSerializableValue, type RemoteDomStyleAttachment, type RemoteDomThemeBridgeOptions, type RemoteDomUrlOriginPolicy, type RemoteDomUrlOriginPolicyInput, type RemoteDomWidgetArtifact, type RemoteDomWidgetHandle, type RemoteDomWorkerFactory, type RemoteDomWorkerLike, isRemoteDomSerializableValue, mountRemoteDomWidget, toRemoteDomSerializableValue };
@@ -0,0 +1,3 @@
1
+ import { a as isRemoteDomSerializableValue, i as RemoteDomUrlOriginPolicyInput, n as RemoteDomSerializableValue, o as toRemoteDomSerializableValue, r as RemoteDomUrlOriginPolicy, t as RemoteDomNavigationIntent } from "./remote-dom-values-EwoLXnSn.mjs";
2
+ import { a as RemoteDomWidgetHandle, c as mountRemoteDomWidget, d as RemoteDomStyleAttachment, f as RemoteDomThemeBridgeOptions, i as RemoteDomWidgetArtifact, l as RemoteDomCssFetcher, n as RemoteDomCapabilityDeclaration, o as RemoteDomWorkerFactory, r as RemoteDomFullscreenRequest, s as RemoteDomWorkerLike, t as MountRemoteDomWidgetOptions, u as RemoteDomCssUrlInput } from "./remote-dom-renderer-BU-73KvK.mjs";
3
+ export { type MountRemoteDomWidgetOptions, type RemoteDomCapabilityDeclaration, type RemoteDomCssFetcher, type RemoteDomCssUrlInput, type RemoteDomFullscreenRequest, type RemoteDomNavigationIntent, type RemoteDomSerializableValue, type RemoteDomStyleAttachment, type RemoteDomThemeBridgeOptions, type RemoteDomUrlOriginPolicy, type RemoteDomUrlOriginPolicyInput, type RemoteDomWidgetArtifact, type RemoteDomWidgetHandle, type RemoteDomWorkerFactory, type RemoteDomWorkerLike, isRemoteDomSerializableValue, mountRemoteDomWidget, toRemoteDomSerializableValue };
@@ -0,0 +1,3 @@
1
+ import { c as isRemoteDomSerializableValue, u as toRemoteDomSerializableValue } from "./remote-dom-values-BSAxrOE7.mjs";
2
+ import { t as mountRemoteDomWidget } from "./remote-dom-renderer-DcwcNPsu.mjs";
3
+ export { isRemoteDomSerializableValue, mountRemoteDomWidget, toRemoteDomSerializableValue };
@@ -0,0 +1,13 @@
1
+ import "@remote-dom/core/polyfill";
2
+ import "@remote-dom/react/polyfill";
3
+ //#region src/worker-react-bootstrap.ts
4
+ const remoteDocument = globalThis.document;
5
+ if (!("oninput" in remoteDocument)) Object.defineProperty(remoteDocument, "oninput", {
6
+ configurable: true,
7
+ enumerable: true,
8
+ value: null,
9
+ writable: true
10
+ });
11
+ //#endregion
12
+
13
+ //# sourceMappingURL=worker-react-bootstrap-C7tCMYGA.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worker-react-bootstrap-C7tCMYGA.mjs","names":[],"sources":["../src/worker-react-bootstrap.ts"],"sourcesContent":["import \"@remote-dom/core/polyfill\";\nimport \"@remote-dom/react/polyfill\";\n\n// React checks for native input event support when react-dom initializes.\n// Remote DOM supplies input events but its synthetic document does not expose\n// the browser's oninput feature marker, which selects React's incompatible\n// legacy input fallback unless we declare that capability first.\nconst remoteDocument = globalThis.document as Document & { oninput?: unknown };\n\nif (!(\"oninput\" in remoteDocument)) {\n Object.defineProperty(remoteDocument, \"oninput\", {\n configurable: true,\n enumerable: true,\n value: null,\n writable: true,\n });\n}\n"],"mappings":";;;AAOA,MAAM,iBAAiB,WAAW;AAElC,IAAI,EAAE,aAAa,gBACjB,QAAO,eAAe,gBAAgB,WAAW;CAC/C,cAAc;CACd,YAAY;CACZ,OAAO;CACP,UAAU;CACX,CAAC"}
@@ -0,0 +1,13 @@
1
+ require("@remote-dom/core/polyfill");
2
+ require("@remote-dom/react/polyfill");
3
+ //#region src/worker-react-bootstrap.ts
4
+ const remoteDocument = globalThis.document;
5
+ if (!("oninput" in remoteDocument)) Object.defineProperty(remoteDocument, "oninput", {
6
+ configurable: true,
7
+ enumerable: true,
8
+ value: null,
9
+ writable: true
10
+ });
11
+ //#endregion
12
+
13
+ //# sourceMappingURL=worker-react-bootstrap-N8jcWZ3L.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worker-react-bootstrap-N8jcWZ3L.cjs","names":[],"sources":["../src/worker-react-bootstrap.ts"],"sourcesContent":["import \"@remote-dom/core/polyfill\";\nimport \"@remote-dom/react/polyfill\";\n\n// React checks for native input event support when react-dom initializes.\n// Remote DOM supplies input events but its synthetic document does not expose\n// the browser's oninput feature marker, which selects React's incompatible\n// legacy input fallback unless we declare that capability first.\nconst remoteDocument = globalThis.document as Document & { oninput?: unknown };\n\nif (!(\"oninput\" in remoteDocument)) {\n Object.defineProperty(remoteDocument, \"oninput\", {\n configurable: true,\n enumerable: true,\n value: null,\n writable: true,\n });\n}\n"],"mappings":";;;AAOA,MAAM,iBAAiB,WAAW;AAElC,IAAI,EAAE,aAAa,gBACjB,QAAO,eAAe,gBAAgB,WAAW;CAC/C,cAAc;CACd,YAAY;CACZ,OAAO;CACP,UAAU;CACX,CAAC"}