@vidact/runtime 0.2.0-beta.0 → 0.2.0-beta.5

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 (244) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/README.md +1 -1
  3. package/dist/actions.d.ts +32 -30
  4. package/dist/actions.d.ts.map +1 -1
  5. package/dist/actions.js +251 -266
  6. package/dist/actions.js.map +1 -1
  7. package/dist/async.d.ts +20 -17
  8. package/dist/async.d.ts.map +1 -1
  9. package/dist/async.js +18 -17
  10. package/dist/async.js.map +1 -1
  11. package/dist/compiled/async-resource.d.ts +9 -6
  12. package/dist/compiled/async-resource.d.ts.map +1 -1
  13. package/dist/compiled/async-resource.js +69 -77
  14. package/dist/compiled/async-resource.js.map +1 -1
  15. package/dist/compiled/core.d.ts +136 -147
  16. package/dist/compiled/core.d.ts.map +1 -1
  17. package/dist/compiled/core.js +2672 -2985
  18. package/dist/compiled/core.js.map +1 -1
  19. package/dist/compiled/types.d.ts +44 -56
  20. package/dist/compiled/types.d.ts.map +1 -1
  21. package/dist/compiled/types.js +10 -6
  22. package/dist/compiled/types.js.map +1 -1
  23. package/dist/compiled/validation.d.ts +4 -1
  24. package/dist/compiled/validation.d.ts.map +1 -1
  25. package/dist/compiled/validation.js +17 -20
  26. package/dist/compiled/validation.js.map +1 -1
  27. package/dist/component-spread.d.ts +5 -3
  28. package/dist/component-spread.d.ts.map +1 -1
  29. package/dist/component-spread.js +49 -67
  30. package/dist/component-spread.js.map +1 -1
  31. package/dist/concurrent.d.ts +20 -18
  32. package/dist/concurrent.d.ts.map +1 -1
  33. package/dist/concurrent.js +191 -210
  34. package/dist/concurrent.js.map +1 -1
  35. package/dist/direct-dom.d.ts +17 -12
  36. package/dist/direct-dom.d.ts.map +1 -1
  37. package/dist/direct-dom.js +187 -221
  38. package/dist/direct-dom.js.map +1 -1
  39. package/dist/dom/attributes.d.ts +9 -6
  40. package/dist/dom/attributes.d.ts.map +1 -1
  41. package/dist/dom/attributes.js +65 -47
  42. package/dist/dom/attributes.js.map +1 -1
  43. package/dist/dom/events.d.ts +5 -2
  44. package/dist/dom/events.d.ts.map +1 -1
  45. package/dist/dom/events.js +53 -65
  46. package/dist/dom/events.js.map +1 -1
  47. package/dist/dom/forms.d.ts +9 -6
  48. package/dist/dom/forms.d.ts.map +1 -1
  49. package/dist/dom/forms.js +152 -198
  50. package/dist/dom/forms.js.map +1 -1
  51. package/dist/dom/intrinsic.d.ts +17 -15
  52. package/dist/dom/intrinsic.d.ts.map +1 -1
  53. package/dist/dom/intrinsic.js +48 -50
  54. package/dist/dom/intrinsic.js.map +1 -1
  55. package/dist/dom/namespace.d.ts +4 -1
  56. package/dist/dom/namespace.d.ts.map +1 -1
  57. package/dist/dom/namespace.js +25 -28
  58. package/dist/dom/namespace.js.map +1 -1
  59. package/dist/dom/namespaces.d.ts +11 -8
  60. package/dist/dom/namespaces.d.ts.map +1 -1
  61. package/dist/dom/namespaces.js +14 -12
  62. package/dist/dom/namespaces.js.map +1 -1
  63. package/dist/dom/properties.d.ts +18 -16
  64. package/dist/dom/properties.d.ts.map +1 -1
  65. package/dist/dom/properties.js +273 -296
  66. package/dist/dom/properties.js.map +1 -1
  67. package/dist/dom/style-properties.d.ts +4 -1
  68. package/dist/dom/style-properties.d.ts.map +1 -1
  69. package/dist/dom/style-properties.js +49 -45
  70. package/dist/dom/style-properties.js.map +1 -1
  71. package/dist/dom/styles.d.ts +5 -2
  72. package/dist/dom/styles.d.ts.map +1 -1
  73. package/dist/dom/styles.js +47 -67
  74. package/dist/dom/styles.js.map +1 -1
  75. package/dist/dom-forms.d.ts +4 -1
  76. package/dist/dom-forms.d.ts.map +1 -1
  77. package/dist/dom-forms.js +16 -13
  78. package/dist/dom-forms.js.map +1 -1
  79. package/dist/dom-styles.d.ts +4 -1
  80. package/dist/dom-styles.d.ts.map +1 -1
  81. package/dist/dom-styles.js +10 -7
  82. package/dist/dom-styles.js.map +1 -1
  83. package/dist/framework-hydrate.d.ts +20 -17
  84. package/dist/framework-hydrate.d.ts.map +1 -1
  85. package/dist/framework-hydrate.js +128 -146
  86. package/dist/framework-hydrate.js.map +1 -1
  87. package/dist/framework-protocol.d.ts +27 -25
  88. package/dist/framework-protocol.d.ts.map +1 -1
  89. package/dist/framework-protocol.js +173 -211
  90. package/dist/framework-protocol.js.map +1 -1
  91. package/dist/framework.d.ts +34 -32
  92. package/dist/framework.d.ts.map +1 -1
  93. package/dist/framework.js +74 -93
  94. package/dist/framework.js.map +1 -1
  95. package/dist/hydrate.d.ts +11 -8
  96. package/dist/hydrate.d.ts.map +1 -1
  97. package/dist/hydrate.js +13 -9
  98. package/dist/hydrate.js.map +1 -1
  99. package/dist/hydration-bridge.d.ts +70 -58
  100. package/dist/hydration-bridge.d.ts.map +1 -1
  101. package/dist/hydration-bridge.js +77 -66
  102. package/dist/hydration-bridge.js.map +1 -1
  103. package/dist/hydration.d.ts +54 -28
  104. package/dist/hydration.d.ts.map +1 -1
  105. package/dist/hydration.js +450 -463
  106. package/dist/hydration.js.map +1 -1
  107. package/dist/index.d.ts +13 -13
  108. package/dist/index.js +11 -13
  109. package/dist/indexed-list.d.ts +8 -5
  110. package/dist/indexed-list.d.ts.map +1 -1
  111. package/dist/indexed-list.js +14 -7
  112. package/dist/indexed-list.js.map +1 -1
  113. package/dist/jsx-runtime.d.ts +10 -8
  114. package/dist/jsx-runtime.d.ts.map +1 -1
  115. package/dist/jsx-runtime.js +28 -23
  116. package/dist/jsx-runtime.js.map +1 -1
  117. package/dist/keyed-list.d.ts +13 -14
  118. package/dist/keyed-list.d.ts.map +1 -1
  119. package/dist/keyed-list.js +132 -160
  120. package/dist/keyed-list.js.map +1 -1
  121. package/dist/metadata.d.ts +6 -3
  122. package/dist/metadata.d.ts.map +1 -1
  123. package/dist/metadata.js +131 -164
  124. package/dist/metadata.js.map +1 -1
  125. package/dist/nested-prop.d.ts +4 -2
  126. package/dist/nested-prop.d.ts.map +1 -1
  127. package/dist/nested-prop.js +17 -16
  128. package/dist/nested-prop.js.map +1 -1
  129. package/dist/profiling.d.ts +11 -8
  130. package/dist/profiling.d.ts.map +1 -1
  131. package/dist/profiling.js +17 -17
  132. package/dist/profiling.js.map +1 -1
  133. package/dist/protocol.d.ts +5 -2
  134. package/dist/protocol.d.ts.map +1 -1
  135. package/dist/protocol.js +8 -5
  136. package/dist/protocol.js.map +1 -1
  137. package/dist/raw-html.d.ts +5 -2
  138. package/dist/raw-html.d.ts.map +1 -1
  139. package/dist/raw-html.js +86 -146
  140. package/dist/raw-html.js.map +1 -1
  141. package/dist/ref.d.ts +8 -3
  142. package/dist/ref.d.ts.map +1 -1
  143. package/dist/ref.js +10 -2
  144. package/dist/ref.js.map +1 -1
  145. package/dist/renderable-protocol.d.ts +26 -8
  146. package/dist/renderable-protocol.d.ts.map +1 -1
  147. package/dist/renderable-protocol.js +30 -9
  148. package/dist/renderable-protocol.js.map +1 -1
  149. package/dist/renderable.d.ts +27 -22
  150. package/dist/renderable.d.ts.map +1 -1
  151. package/dist/renderable.js +141 -133
  152. package/dist/renderable.js.map +1 -1
  153. package/dist/retained-ui.d.ts +9 -6
  154. package/dist/retained-ui.d.ts.map +1 -1
  155. package/dist/retained-ui.js +12 -10
  156. package/dist/retained-ui.js.map +1 -1
  157. package/dist/root.d.ts +18 -15
  158. package/dist/root.d.ts.map +1 -1
  159. package/dist/root.js +73 -85
  160. package/dist/root.js.map +1 -1
  161. package/dist/scheduler.d.ts +10 -8
  162. package/dist/scheduler.d.ts.map +1 -1
  163. package/dist/scheduler.js +97 -105
  164. package/dist/scheduler.js.map +1 -1
  165. package/dist/server-framework.d.ts +45 -42
  166. package/dist/server-framework.d.ts.map +1 -1
  167. package/dist/server-framework.js +209 -217
  168. package/dist/server-framework.js.map +1 -1
  169. package/dist/server.d.ts +130 -128
  170. package/dist/server.d.ts.map +1 -1
  171. package/dist/server.js +603 -710
  172. package/dist/server.js.map +1 -1
  173. package/dist/shared/promise.d.ts +6 -3
  174. package/dist/shared/promise.d.ts.map +1 -1
  175. package/dist/shared/promise.js +21 -19
  176. package/dist/shared/promise.js.map +1 -1
  177. package/dist/source-mask.d.ts +9 -6
  178. package/dist/source-mask.d.ts.map +1 -1
  179. package/dist/source-mask.js +45 -63
  180. package/dist/source-mask.js.map +1 -1
  181. package/dist/spread.d.ts +5 -2
  182. package/dist/spread.d.ts.map +1 -1
  183. package/dist/spread.js +79 -99
  184. package/dist/spread.js.map +1 -1
  185. package/dist/state-slot.d.ts +18 -15
  186. package/dist/state-slot.d.ts.map +1 -1
  187. package/dist/state-slot.js +43 -42
  188. package/dist/state-slot.js.map +1 -1
  189. package/dist/testing.d.ts +9 -6
  190. package/dist/testing.d.ts.map +1 -1
  191. package/dist/testing.js +16 -12
  192. package/dist/testing.js.map +1 -1
  193. package/package.json +8 -7
  194. package/src/actions.ts +415 -0
  195. package/src/async.ts +78 -0
  196. package/src/compiled/async-resource.ts +113 -0
  197. package/src/compiled/core.ts +4041 -0
  198. package/src/compiled/types.ts +96 -0
  199. package/src/compiled/validation.ts +23 -0
  200. package/src/component-spread.ts +86 -0
  201. package/src/concurrent.ts +310 -0
  202. package/src/direct-dom.ts +365 -0
  203. package/src/dom/attributes.ts +55 -0
  204. package/src/dom/events.ts +93 -0
  205. package/src/dom/forms.ts +220 -0
  206. package/src/dom/intrinsic.ts +94 -0
  207. package/src/dom/namespace.ts +30 -0
  208. package/src/dom/namespaces.ts +14 -0
  209. package/src/dom/properties.ts +355 -0
  210. package/src/dom/style-properties.ts +46 -0
  211. package/src/dom/styles.ts +86 -0
  212. package/src/dom-forms.ts +23 -0
  213. package/src/dom-styles.ts +11 -0
  214. package/src/env.d.ts +6 -0
  215. package/src/framework-hydrate.ts +224 -0
  216. package/src/framework-protocol.ts +335 -0
  217. package/src/framework.ts +161 -0
  218. package/src/hydrate.ts +38 -0
  219. package/src/hydration-bridge.ts +196 -0
  220. package/src/hydration.ts +642 -0
  221. package/src/index.ts +92 -0
  222. package/src/indexed-list.ts +20 -0
  223. package/src/jsx-runtime.ts +55 -0
  224. package/src/keyed-list.ts +233 -0
  225. package/src/metadata.ts +212 -0
  226. package/src/nested-prop.ts +27 -0
  227. package/src/profiling.ts +43 -0
  228. package/src/protocol.ts +8 -0
  229. package/src/raw-html.ts +206 -0
  230. package/src/ref.ts +13 -0
  231. package/src/renderable-protocol.ts +63 -0
  232. package/src/renderable.ts +283 -0
  233. package/src/retained-ui.ts +19 -0
  234. package/src/root.ts +122 -0
  235. package/src/scheduler.ts +136 -0
  236. package/src/server-framework.ts +397 -0
  237. package/src/server.ts +1160 -0
  238. package/src/shared/promise.ts +28 -0
  239. package/src/source-mask.ts +83 -0
  240. package/src/spread.ts +131 -0
  241. package/src/state-slot.ts +76 -0
  242. package/src/testing.ts +27 -0
  243. package/dist/index.d.ts.map +0 -1
  244. package/dist/index.js.map +0 -1
@@ -1,147 +1,155 @@
1
- import { binding, isCompiledBinding } from './compiled/core.js';
2
- import { Fragment, h } from './direct-dom.js';
3
- import { isRenderableProtocol, RENDERABLE } from './renderable-protocol.js';
4
- import { unionSources } from './source-mask.js';
5
- import { compiledSpread } from './spread.js';
6
- const DEV = typeof __VIDACT_DEV__ === 'undefined' || __VIDACT_DEV__;
7
- const SPECIAL_PROPS = new Set(['children', 'key', 'ref']);
8
- export function createRenderable(input, construct) {
9
- readPropsInput(input);
10
- const capability = {
11
- props: propsView(input),
12
- };
13
- Object.defineProperty(capability, RENDERABLE, {
14
- configurable: false,
15
- enumerable: false,
16
- value: { input, construct },
17
- });
18
- return capability;
19
- }
20
- export function isRenderable(value) {
21
- return isRenderableProtocol(value);
22
- }
23
- export function createReactElement(type, props, ...children) {
24
- const input = { ...props };
25
- if (children.length === 1)
26
- input.children = children[0];
27
- else if (children.length > 1)
28
- input.children = children;
29
- return createRenderable(input, (currentInput) => {
30
- if (isRenderable(type))
31
- return cloneRenderable(type, currentInput);
32
- const resolved = readPropsInput(currentInput);
33
- const { children: currentChildren, key: _key, ...currentProps } = resolved;
34
- return Object.hasOwn(resolved, 'children')
35
- ? h(type, currentProps, currentChildren)
36
- : h(type, currentProps);
37
- });
38
- }
39
- export function renderableToArray(value) {
40
- if (!isRenderable(value)) {
41
- throw new TypeError(DEV ? 'Children.toArray requires one compiled renderable capability' : 'V107');
42
- }
43
- return [value];
44
- }
45
- export function renderableMarker(value) {
46
- if (!isRenderable(value)) {
47
- throw new TypeError(DEV ? 'React element metadata requires a compiled renderable capability' : 'V107');
48
- }
49
- return undefined;
50
- }
51
- export function cloneRenderable(value, overrides) {
52
- if (!isRenderable(value)) {
53
- throw new TypeError(DEV ? 'cloneRenderable requires a compiled renderable capability' : 'V107');
54
- }
55
- const internals = value[RENDERABLE];
56
- return internals.construct(mergeInputs(internals.input, overrides));
57
- }
58
- export function cloneRenderableComponent(props) {
59
- const value = isCompiledBinding(props.value) ? props.value[1]() : props.value;
60
- return cloneRenderable(value, props.overrides);
61
- }
62
- export function renderableProps(input) {
63
- const ordinary = projectInput(input, (props) => Object.fromEntries(Object.entries(props).filter(([name]) => !SPECIAL_PROPS.has(name))));
64
- return isCompiledBinding(ordinary) ? compiledSpread(ordinary, []) : ordinary;
65
- }
66
- export function renderableChildren(input) {
67
- return projectInput(input, (props) => props.children);
68
- }
69
- export function renderableRef(input) {
70
- return projectInput(input, (props) => props.ref);
71
- }
72
- export function forwardedRef(props) {
73
- return props.ref;
74
- }
75
- export function dynamicIntrinsicComponent(props) {
76
- const tag = isCompiledBinding(props.tag) ? props.tag[1]() : props.tag;
77
- if (typeof tag !== 'string') {
78
- throw new TypeError(DEV ? 'dynamic intrinsic construction requires a string tag' : 'V107');
79
- }
80
- const input = props.props;
81
- return h(tag, { ...renderableProps(input), ref: renderableRef(input) }, renderableChildren(input));
1
+ import { RENDERABLE, installRenderableClone, isRenderableProtocol } from "./renderable-protocol.js";
2
+ import { unionSources } from "./source-mask.js";
3
+ import { binding, isCompiledBinding } from "./compiled/core.js";
4
+ import { h } from "./direct-dom.js";
5
+ import { compiledSpread } from "./spread.js";
6
+ //#region src/renderable.ts
7
+ const DEV = typeof __VIDACT_DEV__ === "undefined" || __VIDACT_DEV__;
8
+ const SPECIAL_PROPS = /* @__PURE__ */ new Set([
9
+ "children",
10
+ "key",
11
+ "ref"
12
+ ]);
13
+ function createRenderable(input, construct, identity = construct, reconcile = false) {
14
+ installRenderableClone(cloneRenderable);
15
+ readPropsInput(input);
16
+ const capability = { props: propsView(input) };
17
+ Object.defineProperty(capability, RENDERABLE, {
18
+ configurable: false,
19
+ enumerable: false,
20
+ value: {
21
+ identity,
22
+ input,
23
+ reconcile,
24
+ construct
25
+ }
26
+ });
27
+ return capability;
28
+ }
29
+ function isRenderable(value) {
30
+ return isRenderableProtocol(value);
31
+ }
32
+ function createReactElement(type, props, ...children) {
33
+ const input = { ...props };
34
+ if (children.length === 1) input.children = children[0];
35
+ else if (children.length > 1) input.children = children;
36
+ if (typeof type === "string") return createIntrinsicRenderable(type, input);
37
+ return createRenderable(input, (currentInput) => {
38
+ if (isRenderable(type)) return cloneRenderable(type, currentInput);
39
+ const resolved = readPropsInput(currentInput);
40
+ const { children: currentChildren, key: _key, ...currentProps } = resolved;
41
+ return Object.hasOwn(resolved, "children") ? h(type, currentProps, currentChildren) : h(type, currentProps);
42
+ }, type, false);
43
+ }
44
+ function renderableToArray(value) {
45
+ if (!isRenderable(value)) throw new TypeError(DEV ? "Children.toArray requires one compiled renderable capability" : "V107");
46
+ return [value];
47
+ }
48
+ function renderableMarker(value) {
49
+ if (!isRenderable(value)) throw new TypeError(DEV ? "React element metadata requires a compiled renderable capability" : "V107");
50
+ }
51
+ function cloneRenderable(value, overrides, childrenOverride) {
52
+ if (!isRenderable(value)) throw new TypeError(DEV ? "cloneRenderable requires a compiled renderable capability" : "V107");
53
+ const internals = value[RENDERABLE];
54
+ let input = mergeInputs(internals.input, overrides);
55
+ if (arguments.length >= 3) input = mergeInputs(input, childrenInput(childrenOverride));
56
+ return createRenderable(input, internals.construct, internals.identity, internals.reconcile);
57
+ }
58
+ function cloneRenderableComponent(props) {
59
+ const value = isCompiledBinding(props.value) ? props.value[1]() : props.value;
60
+ if (Object.hasOwn(props, "childrenOverride")) return cloneRenderable(value, props.overrides, props.childrenOverride);
61
+ return cloneRenderable(value, props.overrides);
62
+ }
63
+ function keyedFragmentComponent(props) {
64
+ return props.children;
65
+ }
66
+ function renderableProps(input) {
67
+ const ordinary = projectInput(input, (props) => Object.fromEntries(Reflect.ownKeys(props).filter((name) => typeof name !== "string" || !SPECIAL_PROPS.has(name)).map((name) => [name, Reflect.get(props, name)])));
68
+ return isCompiledBinding(ordinary) ? compiledSpread(ordinary, []) : ordinary;
69
+ }
70
+ function renderableChildren(input) {
71
+ return projectInput(input, (props) => props.children);
72
+ }
73
+ function renderableRef(input) {
74
+ return projectInput(input, (props) => props.ref);
75
+ }
76
+ function forwardedRef(props) {
77
+ return props.ref;
78
+ }
79
+ function dynamicIntrinsicComponent(props) {
80
+ const tag = isCompiledBinding(props.tag) ? props.tag[1]() : props.tag;
81
+ if (typeof tag !== "string") throw new TypeError(DEV ? "dynamic intrinsic construction requires a string tag" : "V107");
82
+ let input = props.props;
83
+ if (Object.hasOwn(props, "childrenOverride")) input = mergeInputs(input, childrenInput(props.childrenOverride));
84
+ return createIntrinsicRenderable(tag, input);
85
+ }
86
+ function createIntrinsicRenderable(tag, input) {
87
+ return createRenderable(input, (currentInput) => h(tag, {
88
+ ...renderableProps(currentInput),
89
+ ref: renderableRef(currentInput)
90
+ }, renderableChildren(currentInput)), tag, true);
82
91
  }
83
92
  function propsView(input) {
84
- return new Proxy({}, {
85
- get(_target, property) {
86
- const value = Reflect.get(readPropsInput(input), property);
87
- return isCompiledBinding(value) ? value[1]() : value;
88
- },
89
- getOwnPropertyDescriptor(_target, property) {
90
- return Object.hasOwn(readPropsInput(input), property)
91
- ? { configurable: true, enumerable: true }
92
- : undefined;
93
- },
94
- has(_target, property) {
95
- return Reflect.has(readPropsInput(input), property);
96
- },
97
- ownKeys() {
98
- return Reflect.ownKeys(readPropsInput(input));
99
- },
100
- });
93
+ return new Proxy({}, {
94
+ get(_target, property) {
95
+ const value = Reflect.get(readPropsInput(input), property);
96
+ return isCompiledBinding(value) ? value[1]() : value;
97
+ },
98
+ getOwnPropertyDescriptor(_target, property) {
99
+ return Object.hasOwn(readPropsInput(input), property) ? {
100
+ configurable: true,
101
+ enumerable: true
102
+ } : void 0;
103
+ },
104
+ has(_target, property) {
105
+ return Reflect.has(readPropsInput(input), property);
106
+ },
107
+ ownKeys() {
108
+ return Reflect.ownKeys(readPropsInput(input));
109
+ }
110
+ });
111
+ }
112
+ function childrenInput(value) {
113
+ if (!isCompiledBinding(value)) return { children: value };
114
+ return binding(value[2], value[3], () => ({ children: value[1]() }), value[4], value[5]);
101
115
  }
102
116
  function mergeInputs(authored, overrides) {
103
- if (overrides === undefined)
104
- return authored;
105
- if (!isCompiledBinding(authored) && !isCompiledBinding(overrides)) {
106
- return { ...readPropsInput(authored), ...readPropsInput(overrides) };
107
- }
108
- const inputs = [authored, overrides];
109
- const subscriptions = collectSubscriptions(inputs);
110
- const evaluate = () => ({
111
- ...readPropsInput(authored),
112
- ...readPropsInput(overrides),
113
- });
114
- return binding(subscriptions[0][0], subscriptions[0][1], evaluate, subscriptions[1]?.[0], subscriptions[1]?.[1]);
117
+ if (overrides == null) return authored;
118
+ if (!isCompiledBinding(authored) && !isCompiledBinding(overrides)) return {
119
+ ...readPropsInput(authored),
120
+ ...readPropsInput(overrides)
121
+ };
122
+ const subscriptions = collectSubscriptions([authored, overrides]);
123
+ const evaluate = () => ({
124
+ ...readPropsInput(authored),
125
+ ...readPropsInput(overrides)
126
+ });
127
+ return binding(subscriptions[0][0], subscriptions[0][1], evaluate, subscriptions[1]?.[0], subscriptions[1]?.[1]);
115
128
  }
116
129
  function projectInput(input, project) {
117
- if (!isCompiledBinding(input))
118
- return project(readPropsInput(input));
119
- return binding(input[2], input[3], () => project(readPropsInput(input)), input[4], input[5]);
130
+ if (!isCompiledBinding(input)) return project(readPropsInput(input));
131
+ return binding(input[2], input[3], () => project(readPropsInput(input)), input[4], input[5]);
120
132
  }
121
133
  function collectSubscriptions(inputs) {
122
- const subscriptions = new Map();
123
- for (const input of inputs) {
124
- if (!isCompiledBinding(input))
125
- continue;
126
- addSubscription(subscriptions, input[2], input[3]);
127
- if (input[4] !== undefined && input[5] !== undefined) {
128
- addSubscription(subscriptions, input[4], input[5]);
129
- }
130
- }
131
- if (subscriptions.size > 2) {
132
- throw new TypeError(DEV ? 'a compiled renderable can combine reactive props from at most two scopes' : 'V107');
133
- }
134
- return [...subscriptions];
134
+ const subscriptions = /* @__PURE__ */ new Map();
135
+ for (const input of inputs) {
136
+ if (!isCompiledBinding(input)) continue;
137
+ addSubscription(subscriptions, input[2], input[3]);
138
+ if (input[4] !== void 0 && input[5] !== void 0) addSubscription(subscriptions, input[4], input[5]);
139
+ }
140
+ if (subscriptions.size > 2) throw new TypeError(DEV ? "a compiled renderable can combine reactive props from at most two scopes" : "V107");
141
+ return [...subscriptions];
135
142
  }
136
143
  function addSubscription(subscriptions, scope, reads) {
137
- const current = subscriptions.get(scope);
138
- subscriptions.set(scope, current === undefined ? reads : unionSources(current, reads));
144
+ const current = subscriptions.get(scope);
145
+ subscriptions.set(scope, current === void 0 ? reads : unionSources(current, reads));
139
146
  }
140
147
  function readPropsInput(input) {
141
- const value = isCompiledBinding(input) ? input[1]() : input;
142
- if (typeof value !== 'object' || value === null || Array.isArray(value)) {
143
- throw new TypeError(DEV ? 'compiled renderable props must evaluate to an object' : 'V107');
144
- }
145
- return value;
148
+ const value = isCompiledBinding(input) ? input[1]() : input;
149
+ if (typeof value !== "object" || value === null || Array.isArray(value)) throw new TypeError(DEV ? "compiled renderable props must evaluate to an object" : "V107");
150
+ return value;
146
151
  }
152
+ //#endregion
153
+ export { cloneRenderable, cloneRenderableComponent, createReactElement, createRenderable, dynamicIntrinsicComponent, forwardedRef, isRenderable, keyedFragmentComponent, renderableChildren, renderableMarker, renderableProps, renderableRef, renderableToArray };
154
+
147
155
  //# sourceMappingURL=renderable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderable.js","sourceRoot":"","sources":["../src/renderable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAE/D,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAwB,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAE3E,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,MAAM,GAAG,GAAG,OAAO,cAAc,KAAK,WAAW,IAAI,cAAc,CAAA;AACnE,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;AAezD,MAAM,UAAU,gBAAgB,CAC9B,KAA2B,EAC3B,SAA+D;IAE/D,cAAc,CAAC,KAAK,CAAC,CAAA;IACrB,MAAM,UAAU,GAAG;QACjB,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC;KACF,CAAA;IACvB,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,UAAU,EAAE;QAC5C,YAAY,EAAE,KAAK;QACnB,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAgC;KAC1D,CAAC,CAAA;IACF,OAAO,UAAU,CAAA;AACnB,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAA;AACpC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,IAAqE,EACrE,KAAmB,EACnB,GAAG,QAA+B;IAElC,MAAM,KAAK,GAAU,EAAE,GAAG,KAAK,EAAE,CAAA;IACjC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,KAAK,CAAC,Q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M,IAAI,MAAM,EAAE;EACjD,IAAI,MAAM,OAAO,KAAA,KAAa,MAAM,OAAO,KAAA,GACzC,gBAAgB,eAAe,MAAM,IAAI,MAAM,EAAE;CAErD;CACA,IAAI,cAAc,OAAO,GACvB,MAAM,IAAI,UACR,MAAM,6EAA6E,MACrF;CAEF,OAAO,CAAC,GAAG,aAAa;AAC1B;AAEA,SAAS,gBACP,eACA,OACA,OACM;CACN,MAAM,UAAU,cAAc,IAAI,KAAK;CACvC,cAAc,IAAI,OAAO,YAAY,KAAA,IAAY,QAAQ,aAAa,SAAS,KAAK,CAAC;AACvF;AAEA,SAAS,eAAe,OAAoC;CAC1D,MAAM,QAAQ,kBAAkB,KAAK,IAAI,MAAM,EAAE,CAAC,IAAI;CACtD,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,QAAQ,KAAK,GACpE,MAAM,IAAI,UAAU,MAAM,yDAAyD,MAAM;CAE3F,OAAO;AACT"}
@@ -1,8 +1,11 @@
1
- import type { CompiledBinding, CompiledRenderValue, StructuralBinding } from './compiled/types.js';
2
- export interface ActivityProps {
3
- readonly children?: (() => CompiledRenderValue) | readonly [() => CompiledRenderValue];
4
- readonly mode: 'visible' | 'hidden' | CompiledBinding<'visible' | 'hidden'>;
5
- readonly name?: string;
1
+ import { CompiledBinding, CompiledRenderValue, StructuralBinding } from "./compiled/types.js";
2
+ //#region src/retained-ui.d.ts
3
+ interface ActivityProps {
4
+ readonly children?: (() => CompiledRenderValue) | readonly [() => CompiledRenderValue];
5
+ readonly mode: 'visible' | 'hidden' | CompiledBinding<'visible' | 'hidden'>;
6
+ readonly name?: string;
6
7
  }
7
- export declare function Activity(props: ActivityProps): StructuralBinding;
8
+ declare function Activity(props: ActivityProps): StructuralBinding;
9
+ //#endregion
10
+ export { Activity, ActivityProps };
8
11
  //# sourceMappingURL=retained-ui.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"retained-ui.d.ts","sourceRoot":"","sources":["../src/retained-ui.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGlG,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,mBAAmB,CAAC,GAAG,SAAS,CAAC,MAAM,mBAAmB,CAAC,CAAA;IACtF,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,eAAe,CAAC,SAAS,GAAG,QAAQ,CAAC,CAAA;IAC3E,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,iBAAiB,CAQhE"}
1
+ {"version":3,"file":"retained-ui.d.ts","names":[],"sources":["../src/retained-ui.ts"],"mappings":";;UAIiB;WACN,kBAAkB,uCAAuC;WACzD,6BAA6B;WAC7B;;iBAGK,SAAS,OAAO,gBAAgB"}
@@ -1,12 +1,14 @@
1
- import { enableRetainedUi, retainedActivity } from './compiled/core.js';
2
- import { enableRetainedUiStyles } from './dom/styles.js';
3
- export function Activity(props) {
4
- const render = Array.isArray(props.children) ? props.children[0] : props.children;
5
- if (typeof render !== 'function') {
6
- throw new TypeError('Activity children must be a compiler-generated render function');
7
- }
8
- enableRetainedUi();
9
- enableRetainedUiStyles();
10
- return retainedActivity(props.mode, render);
1
+ import { enableRetainedUi, retainedActivity } from "./compiled/core.js";
2
+ import { enableRetainedUiStyles } from "./dom/styles.js";
3
+ //#region src/retained-ui.ts
4
+ function Activity(props) {
5
+ const render = Array.isArray(props.children) ? props.children[0] : props.children;
6
+ if (typeof render !== "function") throw new TypeError("Activity children must be a compiler-generated render function");
7
+ enableRetainedUi();
8
+ enableRetainedUiStyles();
9
+ return retainedActivity(props.mode, render);
11
10
  }
11
+ //#endregion
12
+ export { Activity };
13
+
12
14
  //# sourceMappingURL=retained-ui.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"retained-ui.js","sourceRoot":"","sources":["../src/retained-ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAEvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAQxD,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAA;IACjF,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE,CAAC;QACjC,MAAM,IAAI,SAAS,CAAC,gEAAgE,CAAC,CAAA;IACvF,CAAC;IACD,gBAAgB,EAAE,CAAA;IAClB,sBAAsB,EAAE,CAAA;IACxB,OAAO,gBAAgB,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;AAC7C,CAAC"}
1
+ {"version":3,"file":"retained-ui.js","names":[],"sources":["../src/retained-ui.ts"],"mappings":";;;AAUA,SAAgB,SAAS,OAAyC;CAChE,MAAM,SAAS,MAAM,QAAQ,MAAM,QAAQ,IAAI,MAAM,SAAS,KAAK,MAAM;CACzE,IAAI,OAAO,WAAW,YACpB,MAAM,IAAI,UAAU,gEAAgE;CAEtF,iBAAiB;CACjB,uBAAuB;CACvB,OAAO,iBAAiB,MAAM,MAAM,MAAM;AAC5C"}
package/dist/root.d.ts CHANGED
@@ -1,18 +1,21 @@
1
- import { type MountCompiledOptions } from './compiled/core.js';
2
- import type { CompiledComponentResult } from './compiled/types.js';
3
- export interface CompiledRoot {
4
- readonly mount: (application: () => CompiledComponentResult) => void;
5
- readonly replace: (application: () => CompiledComponentResult) => void;
6
- readonly unmount: () => void;
1
+ import { CompiledComponentResult } from "./compiled/types.js";
2
+ import { MountCompiledOptions } from "./compiled/core.js";
3
+ //#region src/root.d.ts
4
+ interface CompiledRoot {
5
+ readonly mount: (application: () => CompiledComponentResult) => void;
6
+ readonly replace: (application: () => CompiledComponentResult) => void;
7
+ readonly unmount: () => void;
7
8
  }
8
- export interface HotContext {
9
- readonly data: Record<string, unknown>;
10
- readonly accept: () => void;
11
- readonly dispose: (callback: (data: Record<string, unknown>) => void) => void;
12
- readonly prune: (callback: () => void) => void;
9
+ interface HotContext {
10
+ readonly data: Record<string, unknown>;
11
+ readonly accept: () => void;
12
+ readonly dispose: (callback: (data: Record<string, unknown>) => void) => void;
13
+ readonly prune: (callback: () => void) => void;
13
14
  }
14
- export declare function createRoot(host: ParentNode, options?: MountCompiledOptions): CompiledRoot;
15
- export declare function hydrateRoot(host: ParentNode, application: () => CompiledComponentResult, options?: MountCompiledOptions): CompiledRoot;
16
- export declare function mountHotRoot(hot: HotContext, host: ParentNode, application: () => CompiledComponentResult, options?: MountCompiledOptions): CompiledRoot;
17
- export declare function hydrateHotRoot(hot: HotContext, host: ParentNode, application: () => CompiledComponentResult, options?: MountCompiledOptions): CompiledRoot;
15
+ declare function createRoot(host: ParentNode, options?: MountCompiledOptions): CompiledRoot;
16
+ declare function hydrateRoot(host: ParentNode, application: () => CompiledComponentResult, options?: MountCompiledOptions): CompiledRoot;
17
+ declare function mountHotRoot(hot: HotContext, host: ParentNode, application: () => CompiledComponentResult, options?: MountCompiledOptions): CompiledRoot;
18
+ declare function hydrateHotRoot(hot: HotContext, host: ParentNode, application: () => CompiledComponentResult, options?: MountCompiledOptions): CompiledRoot;
19
+ //#endregion
20
+ export { CompiledRoot, HotContext, createRoot, hydrateHotRoot, hydrateRoot, mountHotRoot };
18
21
  //# sourceMappingURL=root.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../src/root.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAC9F,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAA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AAmB;WAC3B,UAAU,mBAAmB;WAC7B;;UAGM;WACN,MAAM;WACN;WACA,UAAU,WAAW,MAAM;WAC3B,QAAQ;;iBAKH,WAAW,MAAM,YAAY,UAAU,uBAAuB;iBA2B9D,YACd,MAAM,YACN,mBAAmB,yBACnB,UAAU,uBACT;iBAuBa,aACd,KAAK,YACL,MAAM,YACN,mBAAmB,yBACnB,UAAU,uBACT;iBASa,eACd,KAAK,YACL,MAAM,YACN,mBAAmB,yBACnB,UAAU,uBACT"}
package/dist/root.js CHANGED
@@ -1,94 +1,82 @@
1
- import { hydrateCompiled, mountCompiled } from './compiled/core.js';
2
- const DEV = typeof __VIDACT_DEV__ === 'undefined' || __VIDACT_DEV__;
3
- const HOT_ROOT = '__vidactHotRoot';
4
- export function createRoot(host, options) {
5
- let dispose;
6
- let terminal = false;
7
- return {
8
- mount(application) {
9
- if (terminal)
10
- throw new Error(DEV ? 'cannot mount an unmounted root' : 'V024');
11
- if (dispose !== undefined) {
12
- throw new Error(DEV ? 'compiled root already has a mounted application' : 'V025');
13
- }
14
- dispose = mountCompiled(application, host, options).dispose;
15
- },
16
- replace(nextApplication) {
17
- if (terminal)
18
- throw new Error(DEV ? 'cannot replace an unmounted root' : 'V030');
19
- const previous = dispose;
20
- const next = mountCompiled(nextApplication, host, options).dispose;
21
- dispose = next;
22
- previous?.();
23
- },
24
- unmount() {
25
- if (terminal)
26
- return;
27
- terminal = true;
28
- dispose?.();
29
- dispose = undefined;
30
- },
31
- };
1
+ import { hydrateCompiled, mountCompiled } from "./compiled/core.js";
2
+ //#region src/root.ts
3
+ const DEV = typeof __VIDACT_DEV__ === "undefined" || __VIDACT_DEV__;
4
+ const HOT_ROOT = "__vidactHotRoot";
5
+ function createRoot(host, options) {
6
+ let dispose;
7
+ let terminal = false;
8
+ return {
9
+ mount(application) {
10
+ if (terminal) throw new Error(DEV ? "cannot mount an unmounted root" : "V024");
11
+ if (dispose !== void 0) throw new Error(DEV ? "compiled root already has a mounted application" : "V025");
12
+ dispose = mountCompiled(application, host, options).dispose;
13
+ },
14
+ replace(nextApplication) {
15
+ if (terminal) throw new Error(DEV ? "cannot replace an unmounted root" : "V030");
16
+ const previous = dispose;
17
+ dispose = mountCompiled(nextApplication, host, options).dispose;
18
+ previous?.();
19
+ },
20
+ unmount() {
21
+ if (terminal) return;
22
+ terminal = true;
23
+ dispose?.();
24
+ dispose = void 0;
25
+ }
26
+ };
32
27
  }
33
- export function hydrateRoot(host, application, options) {
34
- let dispose = hydrateCompiled(application, host, options).dispose;
35
- let terminal = false;
36
- return {
37
- mount() {
38
- throw new Error(DEV ? 'hydration roots are mounted during creation' : 'V029');
39
- },
40
- replace(nextApplication) {
41
- if (terminal)
42
- throw new Error(DEV ? 'cannot replace an unmounted root' : 'V030');
43
- const previous = dispose;
44
- const next = mountCompiled(nextApplication, host, options).dispose;
45
- dispose = next;
46
- previous?.();
47
- },
48
- unmount() {
49
- if (terminal)
50
- return;
51
- terminal = true;
52
- dispose?.();
53
- dispose = undefined;
54
- },
55
- };
28
+ function hydrateRoot(host, application, options) {
29
+ let dispose = hydrateCompiled(application, host, options).dispose;
30
+ let terminal = false;
31
+ return {
32
+ mount() {
33
+ throw new Error(DEV ? "hydration roots are mounted during creation" : "V029");
34
+ },
35
+ replace(nextApplication) {
36
+ if (terminal) throw new Error(DEV ? "cannot replace an unmounted root" : "V030");
37
+ const previous = dispose;
38
+ dispose = mountCompiled(nextApplication, host, options).dispose;
39
+ previous?.();
40
+ },
41
+ unmount() {
42
+ if (terminal) return;
43
+ terminal = true;
44
+ dispose?.();
45
+ dispose = void 0;
46
+ }
47
+ };
56
48
  }
57
- export function mountHotRoot(hot, host, application, options) {
58
- const previous = hot.data[HOT_ROOT];
59
- const root = isCompiledRoot(previous) ? previous : createRoot(host, options);
60
- if (isCompiledRoot(previous))
61
- root.replace(application);
62
- else
63
- root.mount(application);
64
- registerHotRoot(hot, root);
65
- return root;
49
+ function mountHotRoot(hot, host, application, options) {
50
+ const previous = hot.data[HOT_ROOT];
51
+ const root = isCompiledRoot(previous) ? previous : createRoot(host, options);
52
+ if (isCompiledRoot(previous)) root.replace(application);
53
+ else root.mount(application);
54
+ registerHotRoot(hot, root);
55
+ return root;
66
56
  }
67
- export function hydrateHotRoot(hot, host, application, options) {
68
- const previous = hot.data[HOT_ROOT];
69
- const root = isCompiledRoot(previous) ? previous : hydrateRoot(host, application, options);
70
- if (isCompiledRoot(previous))
71
- root.replace(application);
72
- registerHotRoot(hot, root);
73
- return root;
57
+ function hydrateHotRoot(hot, host, application, options) {
58
+ const previous = hot.data[HOT_ROOT];
59
+ const root = isCompiledRoot(previous) ? previous : hydrateRoot(host, application, options);
60
+ if (isCompiledRoot(previous)) root.replace(application);
61
+ registerHotRoot(hot, root);
62
+ return root;
74
63
  }
75
64
  function registerHotRoot(hot, root) {
76
- hot.data[HOT_ROOT] = root;
77
- hot.accept();
78
- hot.dispose((data) => {
79
- data[HOT_ROOT] = root;
80
- });
81
- hot.prune(() => {
82
- if (hot.data[HOT_ROOT] !== root)
83
- return;
84
- delete hot.data[HOT_ROOT];
85
- root.unmount();
86
- });
65
+ hot.data[HOT_ROOT] = root;
66
+ hot.accept();
67
+ hot.dispose((data) => {
68
+ data[HOT_ROOT] = root;
69
+ });
70
+ hot.prune(() => {
71
+ if (hot.data[HOT_ROOT] !== root) return;
72
+ delete hot.data[HOT_ROOT];
73
+ root.unmount();
74
+ });
87
75
  }
88
76
  function isCompiledRoot(value) {
89
- return (typeof value === 'object' &&
90
- value !== null &&
91
- typeof Reflect.get(value, 'replace') === 'function' &&
92
- typeof Reflect.get(value, 'unmount') === 'function');
77
+ return typeof value === "object" && value !== null && typeof Reflect.get(value, "replace") === "function" && typeof Reflect.get(value, "unmount") === "function";
93
78
  }
79
+ //#endregion
80
+ export { createRoot, hydrateHotRoot, hydrateRoot, mountHotRoot };
81
+
94
82
  //# sourceMappingURL=root.js.map