@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,333 +1,310 @@
1
- import { validateRawHtmlRelatedProp } from '../raw-html.js';
2
- import { MATHML_NAMESPACE, SVG_NAMESPACE, XLINK_NAMESPACE, XML_NAMESPACE, XMLNS_NAMESPACE, } from './namespaces.js';
3
- const DEV = typeof __VIDACT_DEV__ === 'undefined' || __VIDACT_DEV__;
4
- const UNSAFE_HTML = typeof __VIDACT_UNSAFE_HTML__ === 'undefined' || __VIDACT_UNSAFE_HTML__;
5
- const booleanAttributes = new Set([
6
- 'allowFullScreen',
7
- 'async',
8
- 'autoFocus',
9
- 'autoPlay',
10
- 'controls',
11
- 'default',
12
- 'defer',
13
- 'disabled',
14
- 'disablePictureInPicture',
15
- 'disableRemotePlayback',
16
- 'formNoValidate',
17
- 'hidden',
18
- 'inert',
19
- 'itemScope',
20
- 'loop',
21
- 'noModule',
22
- 'noValidate',
23
- 'open',
24
- 'playsInline',
25
- 'readOnly',
26
- 'required',
27
- 'reversed',
1
+ import { validateRawHtmlRelatedProp } from "../raw-html.js";
2
+ import { XLINK_NAMESPACE, XMLNS_NAMESPACE, XML_NAMESPACE } from "./namespaces.js";
3
+ //#region src/dom/properties.ts
4
+ const DEV = typeof __VIDACT_DEV__ === "undefined" || __VIDACT_DEV__;
5
+ const UNSAFE_HTML = typeof __VIDACT_UNSAFE_HTML__ === "undefined" || __VIDACT_UNSAFE_HTML__;
6
+ const booleanAttributes = /* @__PURE__ */ new Set([
7
+ "allowFullScreen",
8
+ "async",
9
+ "autoFocus",
10
+ "autoPlay",
11
+ "controls",
12
+ "default",
13
+ "defer",
14
+ "disabled",
15
+ "disablePictureInPicture",
16
+ "disableRemotePlayback",
17
+ "formNoValidate",
18
+ "hidden",
19
+ "inert",
20
+ "itemScope",
21
+ "loop",
22
+ "noModule",
23
+ "noValidate",
24
+ "open",
25
+ "playsInline",
26
+ "readOnly",
27
+ "required",
28
+ "reversed"
28
29
  ]);
29
- const booleanishStringAttributes = new Set(['contentEditable', 'draggable', 'spellCheck']);
30
- const overloadedBooleanAttributes = new Set(['capture', 'download']);
31
- const mathBooleanishStringAttributes = new Set([
32
- 'accent',
33
- 'accentunder',
34
- 'displaystyle',
35
- 'fence',
36
- 'largeop',
37
- 'movablelimits',
38
- 'separator',
39
- 'stretchy',
40
- 'symmetric',
30
+ const booleanishStringAttributes = /* @__PURE__ */ new Set([
31
+ "contentEditable",
32
+ "draggable",
33
+ "spellCheck"
41
34
  ]);
42
- const svgBooleanishStringAttributes = new Set(['focusable', 'preserveAlpha']);
43
- const kebabCaseSvgAttributes = new Set([
44
- 'accentHeight',
45
- 'alignmentBaseline',
46
- 'arabicForm',
47
- 'baselineShift',
48
- 'capHeight',
49
- 'clipPath',
50
- 'clipRule',
51
- 'colorInterpolation',
52
- 'colorInterpolationFilters',
53
- 'colorProfile',
54
- 'colorRendering',
55
- 'dominantBaseline',
56
- 'enableBackground',
57
- 'fillOpacity',
58
- 'fillRule',
59
- 'floodColor',
60
- 'floodOpacity',
61
- 'fontFamily',
62
- 'fontSize',
63
- 'fontSizeAdjust',
64
- 'fontStretch',
65
- 'fontStyle',
66
- 'fontVariant',
67
- 'fontWeight',
68
- 'glyphName',
69
- 'glyphOrientationHorizontal',
70
- 'glyphOrientationVertical',
71
- 'horizAdvX',
72
- 'horizOriginX',
73
- 'imageRendering',
74
- 'letterSpacing',
75
- 'lightingColor',
76
- 'markerEnd',
77
- 'markerMid',
78
- 'markerStart',
79
- 'overlinePosition',
80
- 'overlineThickness',
81
- 'paintOrder',
82
- 'pointerEvents',
83
- 'renderingIntent',
84
- 'shapeRendering',
85
- 'stopColor',
86
- 'stopOpacity',
87
- 'strikethroughPosition',
88
- 'strikethroughThickness',
89
- 'strokeDasharray',
90
- 'strokeDashoffset',
91
- 'strokeLinecap',
92
- 'strokeLinejoin',
93
- 'strokeMiterlimit',
94
- 'strokeOpacity',
95
- 'strokeWidth',
96
- 'textAnchor',
97
- 'textDecoration',
98
- 'textRendering',
99
- 'transformOrigin',
100
- 'underlinePosition',
101
- 'underlineThickness',
102
- 'unicodeBidi',
103
- 'unicodeRange',
104
- 'unitsPerEm',
105
- 'vAlphabetic',
106
- 'vHanging',
107
- 'vIdeographic',
108
- 'vMathematical',
109
- 'vectorEffect',
110
- 'vertAdvY',
111
- 'vertOriginX',
112
- 'vertOriginY',
113
- 'wordSpacing',
114
- 'writingMode',
115
- 'xHeight',
35
+ const overloadedBooleanAttributes = /* @__PURE__ */ new Set(["capture", "download"]);
36
+ const mathBooleanishStringAttributes = /* @__PURE__ */ new Set([
37
+ "accent",
38
+ "accentunder",
39
+ "displaystyle",
40
+ "fence",
41
+ "largeop",
42
+ "movablelimits",
43
+ "separator",
44
+ "stretchy",
45
+ "symmetric"
46
+ ]);
47
+ const svgBooleanishStringAttributes = /* @__PURE__ */ new Set(["focusable", "preserveAlpha"]);
48
+ const kebabCaseSvgAttributes = /* @__PURE__ */ new Set([
49
+ "accentHeight",
50
+ "alignmentBaseline",
51
+ "arabicForm",
52
+ "baselineShift",
53
+ "capHeight",
54
+ "clipPath",
55
+ "clipRule",
56
+ "colorInterpolation",
57
+ "colorInterpolationFilters",
58
+ "colorProfile",
59
+ "colorRendering",
60
+ "dominantBaseline",
61
+ "enableBackground",
62
+ "fillOpacity",
63
+ "fillRule",
64
+ "floodColor",
65
+ "floodOpacity",
66
+ "fontFamily",
67
+ "fontSize",
68
+ "fontSizeAdjust",
69
+ "fontStretch",
70
+ "fontStyle",
71
+ "fontVariant",
72
+ "fontWeight",
73
+ "glyphName",
74
+ "glyphOrientationHorizontal",
75
+ "glyphOrientationVertical",
76
+ "horizAdvX",
77
+ "horizOriginX",
78
+ "imageRendering",
79
+ "letterSpacing",
80
+ "lightingColor",
81
+ "markerEnd",
82
+ "markerMid",
83
+ "markerStart",
84
+ "overlinePosition",
85
+ "overlineThickness",
86
+ "paintOrder",
87
+ "pointerEvents",
88
+ "renderingIntent",
89
+ "shapeRendering",
90
+ "stopColor",
91
+ "stopOpacity",
92
+ "strikethroughPosition",
93
+ "strikethroughThickness",
94
+ "strokeDasharray",
95
+ "strokeDashoffset",
96
+ "strokeLinecap",
97
+ "strokeLinejoin",
98
+ "strokeMiterlimit",
99
+ "strokeOpacity",
100
+ "strokeWidth",
101
+ "textAnchor",
102
+ "textDecoration",
103
+ "textRendering",
104
+ "transformOrigin",
105
+ "underlinePosition",
106
+ "underlineThickness",
107
+ "unicodeBidi",
108
+ "unicodeRange",
109
+ "unitsPerEm",
110
+ "vAlphabetic",
111
+ "vHanging",
112
+ "vIdeographic",
113
+ "vMathematical",
114
+ "vectorEffect",
115
+ "vertAdvY",
116
+ "vertOriginX",
117
+ "vertOriginY",
118
+ "wordSpacing",
119
+ "writingMode",
120
+ "xHeight"
116
121
  ]);
117
122
  let formCapability;
118
123
  let styleCapability;
119
- const NOOP = () => { };
124
+ const NOOP = () => {};
120
125
  /** @internal */
121
- export function installFormDomCapability(capability) {
122
- formCapability = capability;
126
+ function installFormDomCapability(capability) {
127
+ formCapability = capability;
123
128
  }
124
129
  /** @internal */
125
- export function installStyleDomCapability(capability) {
126
- styleCapability = capability;
130
+ function installStyleDomCapability(capability) {
131
+ styleCapability = capability;
127
132
  }
128
133
  /** @internal */
129
- export function ensureControlledFormRestoration(element) {
130
- return formCapability?.ensureControlledRestoration(element) ?? NOOP;
134
+ function ensureControlledFormRestoration(element) {
135
+ return formCapability?.ensureControlledRestoration(element) ?? NOOP;
131
136
  }
132
137
  /** @internal */
133
- export function isControlledFormProp(element, name) {
134
- return formCapability?.isControlledProp(element, name) ?? false;
138
+ function isControlledFormProp(element, name) {
139
+ return formCapability?.isControlledProp(element, name) ?? false;
135
140
  }
136
141
  /** @internal */
137
- export function isReactFormChangeEvent(element, eventName) {
138
- return formCapability?.isReactChangeEvent(element, eventName) ?? false;
142
+ function isReactFormChangeEvent(element, eventName) {
143
+ return formCapability?.isReactChangeEvent(element, eventName) ?? false;
139
144
  }
140
145
  /** @internal */
141
- export function restoreControlledFormState(element) {
142
- formCapability?.restoreControlledState(element);
146
+ function restoreControlledFormState(element) {
147
+ formCapability?.restoreControlledState(element);
143
148
  }
144
- export let applyDomProp = applyBaseDomProp;
145
- export function installDomPropHandler(handler) {
146
- const fallback = applyDomProp;
147
- applyDomProp = (element, name, value) => {
148
- if (!handler(element, name, value))
149
- fallback(element, name, value);
150
- };
149
+ let applyDomProp = applyBaseDomProp;
150
+ function installDomPropHandler(handler) {
151
+ const fallback = applyDomProp;
152
+ applyDomProp = (element, name, value) => {
153
+ if (!handler(element, name, value)) fallback(element, name, value);
154
+ };
151
155
  }
152
156
  /** @internal Specialized capabilities may own a prop while reusing the base policy. */
153
- export function applyBaseDomProp(element, name, value) {
154
- if (typeof value === 'symbol') {
155
- throw new TypeError(DEV ? `DOM prop ${name} cannot receive a symbol value` : 'V105');
156
- }
157
- if (name === 'dangerouslySetInnerHTML') {
158
- throw new Error(DEV ? 'dangerouslySetInnerHTML must be handled as an owned opaque subtree' : 'V401');
159
- }
160
- if (name === 'style') {
161
- if (styleCapability === undefined) {
162
- throw new Error(DEV ? 'style prop requires the DOM style capability' : 'V503');
163
- }
164
- styleCapability(element, value);
165
- return;
166
- }
167
- if (formCapability?.applyProp(element, name, value))
168
- return;
169
- if (name.startsWith('data-') || name.startsWith('aria-')) {
170
- applyStringAttribute(element, name, value);
171
- return;
172
- }
173
- if (element.namespaceURI === SVG_NAMESPACE || element.namespaceURI === MATHML_NAMESPACE) {
174
- applyNamespacedAttribute(element, name, value);
175
- return;
176
- }
177
- const attribute = htmlAttributeName(name);
178
- if (value === null || value === undefined) {
179
- element.removeAttribute(attribute);
180
- if (isCustomElement(element) && name in element)
181
- Reflect.set(element, name, null);
182
- validateRawHtmlProp(element, name);
183
- return;
184
- }
185
- if (booleanishStringAttributes.has(name)) {
186
- element.setAttribute(attribute, String(value));
187
- return;
188
- }
189
- if (overloadedBooleanAttributes.has(name)) {
190
- if (value === false)
191
- element.removeAttribute(attribute);
192
- else
193
- element.setAttribute(attribute, value === true ? '' : String(value));
194
- return;
195
- }
196
- if (booleanAttributes.has(name)) {
197
- if (name in element) {
198
- const next = Boolean(value);
199
- if (!Object.is(Reflect.get(element, name), next))
200
- Reflect.set(element, name, next);
201
- }
202
- else if (value)
203
- element.setAttribute(attribute, '');
204
- else
205
- element.removeAttribute(attribute);
206
- return;
207
- }
208
- if (typeof value === 'boolean') {
209
- element.removeAttribute(attribute);
210
- return;
211
- }
212
- const serialized = String(value);
213
- if (element.getAttribute(attribute) === serialized) {
214
- validateRawHtmlProp(element, name);
215
- return;
216
- }
217
- if (name in element) {
218
- const current = Reflect.get(element, name);
219
- if (!isCustomElement(element) &&
220
- (Object.is(current, value) || String(current) === serialized)) {
221
- validateRawHtmlProp(element, name);
222
- return;
223
- }
224
- if (Reflect.set(element, name, value)) {
225
- validateRawHtmlProp(element, name);
226
- return;
227
- }
228
- }
229
- if (element.getAttribute(attribute) !== serialized) {
230
- element.setAttribute(attribute, serialized);
231
- }
232
- validateRawHtmlProp(element, name);
157
+ function applyBaseDomProp(element, name, value) {
158
+ if (typeof value === "symbol") throw new TypeError(DEV ? `DOM prop ${name} cannot receive a symbol value` : "V105");
159
+ if (name === "dangerouslySetInnerHTML") throw new Error(DEV ? "dangerouslySetInnerHTML must be handled as an owned opaque subtree" : "V401");
160
+ if (name === "style") {
161
+ if (styleCapability === void 0) throw new Error(DEV ? "style prop requires the DOM style capability" : "V503");
162
+ styleCapability(element, value);
163
+ return;
164
+ }
165
+ if (formCapability?.applyProp(element, name, value)) return;
166
+ if (name.startsWith("data-") || name.startsWith("aria-")) {
167
+ applyStringAttribute(element, name, value);
168
+ return;
169
+ }
170
+ if (element.namespaceURI === "http://www.w3.org/2000/svg" || element.namespaceURI === "http://www.w3.org/1998/Math/MathML") {
171
+ applyNamespacedAttribute(element, name, value);
172
+ return;
173
+ }
174
+ const attribute = htmlAttributeName(name);
175
+ if (value === null || value === void 0) {
176
+ element.removeAttribute(attribute);
177
+ if (isCustomElement(element) && name in element) Reflect.set(element, name, null);
178
+ validateRawHtmlProp(element, name);
179
+ return;
180
+ }
181
+ if (booleanishStringAttributes.has(name)) {
182
+ element.setAttribute(attribute, String(value));
183
+ return;
184
+ }
185
+ if (overloadedBooleanAttributes.has(name)) {
186
+ if (value === false) element.removeAttribute(attribute);
187
+ else element.setAttribute(attribute, value === true ? "" : String(value));
188
+ return;
189
+ }
190
+ if (booleanAttributes.has(name)) {
191
+ if (name in element) {
192
+ const next = Boolean(value);
193
+ if (!Object.is(Reflect.get(element, name), next)) Reflect.set(element, name, next);
194
+ } else if (value) element.setAttribute(attribute, "");
195
+ else element.removeAttribute(attribute);
196
+ return;
197
+ }
198
+ if (typeof value === "boolean") {
199
+ element.removeAttribute(attribute);
200
+ return;
201
+ }
202
+ const serialized = String(value);
203
+ if (element.getAttribute(attribute) === serialized) {
204
+ validateRawHtmlProp(element, name);
205
+ return;
206
+ }
207
+ if (name in element) {
208
+ const current = Reflect.get(element, name);
209
+ if (!isCustomElement(element) && (Object.is(current, value) || String(current) === serialized)) {
210
+ validateRawHtmlProp(element, name);
211
+ return;
212
+ }
213
+ if (Reflect.set(element, name, value)) {
214
+ validateRawHtmlProp(element, name);
215
+ return;
216
+ }
217
+ }
218
+ if (element.getAttribute(attribute) !== serialized) element.setAttribute(attribute, serialized);
219
+ validateRawHtmlProp(element, name);
233
220
  }
234
221
  function applyStringAttribute(element, name, value) {
235
- if (value === null || value === undefined)
236
- element.removeAttribute(name);
237
- else {
238
- if (typeof value === 'symbol') {
239
- throw new TypeError(`cannot apply a Symbol value to DOM attribute ${name}`);
240
- }
241
- let serialized;
242
- try {
243
- serialized = String(value);
244
- }
245
- catch (cause) {
246
- const detail = Array.isArray(value)
247
- ? value.map((item) => (typeof item === 'symbol' ? String(item) : typeof item)).join(',')
248
- : typeof value;
249
- throw new TypeError(`cannot serialize DOM attribute ${name} from ${detail}`, { cause });
250
- }
251
- if (element.getAttribute(name) !== serialized)
252
- element.setAttribute(name, serialized);
253
- }
222
+ if (value === null || value === void 0) element.removeAttribute(name);
223
+ else {
224
+ if (typeof value === "symbol") throw new TypeError(`cannot apply a Symbol value to DOM attribute ${name}`);
225
+ let serialized;
226
+ try {
227
+ serialized = String(value);
228
+ } catch (cause) {
229
+ const detail = Array.isArray(value) ? value.map((item) => typeof item === "symbol" ? String(item) : typeof item).join(",") : typeof value;
230
+ throw new TypeError(`cannot serialize DOM attribute ${name} from ${detail}`, { cause });
231
+ }
232
+ if (element.getAttribute(name) !== serialized) element.setAttribute(name, serialized);
233
+ }
254
234
  }
255
235
  function applyNamespacedAttribute(element, name, value) {
256
- const descriptor = namespacedAttribute(name);
257
- if (value === null || value === undefined) {
258
- if (descriptor.namespace === null)
259
- element.removeAttribute(descriptor.qualifiedName);
260
- else
261
- element.removeAttributeNS(descriptor.namespace, descriptor.localName);
262
- return;
263
- }
264
- if ((element.namespaceURI === MATHML_NAMESPACE && mathBooleanishStringAttributes.has(name)) ||
265
- (element.namespaceURI === SVG_NAMESPACE && svgBooleanishStringAttributes.has(name))) {
266
- element.setAttribute(descriptor.qualifiedName, String(value));
267
- return;
268
- }
269
- if (value === false) {
270
- if (descriptor.namespace === null)
271
- element.removeAttribute(descriptor.qualifiedName);
272
- else
273
- element.removeAttributeNS(descriptor.namespace, descriptor.localName);
274
- return;
275
- }
276
- const serialized = value === true ? '' : String(value);
277
- if (descriptor.namespace === null)
278
- element.setAttribute(descriptor.qualifiedName, serialized);
279
- else
280
- element.setAttributeNS(descriptor.namespace, descriptor.qualifiedName, serialized);
236
+ const descriptor = namespacedAttribute(name);
237
+ if (value === null || value === void 0) {
238
+ if (descriptor.namespace === null) element.removeAttribute(descriptor.qualifiedName);
239
+ else element.removeAttributeNS(descriptor.namespace, descriptor.localName);
240
+ return;
241
+ }
242
+ if (element.namespaceURI === "http://www.w3.org/1998/Math/MathML" && mathBooleanishStringAttributes.has(name) || element.namespaceURI === "http://www.w3.org/2000/svg" && svgBooleanishStringAttributes.has(name)) {
243
+ element.setAttribute(descriptor.qualifiedName, String(value));
244
+ return;
245
+ }
246
+ if (value === false) {
247
+ if (descriptor.namespace === null) element.removeAttribute(descriptor.qualifiedName);
248
+ else element.removeAttributeNS(descriptor.namespace, descriptor.localName);
249
+ return;
250
+ }
251
+ const serialized = value === true ? "" : String(value);
252
+ if (descriptor.namespace === null) element.setAttribute(descriptor.qualifiedName, serialized);
253
+ else element.setAttributeNS(descriptor.namespace, descriptor.qualifiedName, serialized);
281
254
  }
282
255
  function namespacedAttribute(name) {
283
- if (name.startsWith('xlink') && name.length > 5) {
284
- const localName = lowerInitial(name.slice(5));
285
- return { namespace: XLINK_NAMESPACE, qualifiedName: `xlink:${localName}`, localName };
286
- }
287
- if (name === 'xmlnsXlink') {
288
- return {
289
- namespace: XMLNS_NAMESPACE,
290
- qualifiedName: 'xmlns:xlink',
291
- localName: 'xlink',
292
- };
293
- }
294
- if (name.startsWith('xml') && name.length > 3) {
295
- const localName = lowerInitial(name.slice(3));
296
- return { namespace: XML_NAMESPACE, qualifiedName: `xml:${localName}`, localName };
297
- }
298
- const qualifiedName = svgAttributeName(name);
299
- return { namespace: null, qualifiedName, localName: qualifiedName };
256
+ if (name.startsWith("xlink") && name.length > 5) {
257
+ const localName = lowerInitial(name.slice(5));
258
+ return {
259
+ namespace: XLINK_NAMESPACE,
260
+ qualifiedName: `xlink:${localName}`,
261
+ localName
262
+ };
263
+ }
264
+ if (name === "xmlnsXlink") return {
265
+ namespace: XMLNS_NAMESPACE,
266
+ qualifiedName: "xmlns:xlink",
267
+ localName: "xlink"
268
+ };
269
+ if (name.startsWith("xml") && name.length > 3) {
270
+ const localName = lowerInitial(name.slice(3));
271
+ return {
272
+ namespace: XML_NAMESPACE,
273
+ qualifiedName: `xml:${localName}`,
274
+ localName
275
+ };
276
+ }
277
+ const qualifiedName = svgAttributeName(name);
278
+ return {
279
+ namespace: null,
280
+ qualifiedName,
281
+ localName: qualifiedName
282
+ };
300
283
  }
301
284
  function svgAttributeName(name) {
302
- if (name === 'className')
303
- return 'class';
304
- if (name === 'crossOrigin')
305
- return 'crossorigin';
306
- if (name === 'tabIndex')
307
- return 'tabindex';
308
- if (!kebabCaseSvgAttributes.has(name))
309
- return name;
310
- return name.replace(/[A-Z]/g, (character) => `-${character.toLowerCase()}`);
285
+ if (name === "className") return "class";
286
+ if (name === "crossOrigin") return "crossorigin";
287
+ if (name === "tabIndex") return "tabindex";
288
+ if (!kebabCaseSvgAttributes.has(name)) return name;
289
+ return name.replace(/[A-Z]/g, (character) => `-${character.toLowerCase()}`);
311
290
  }
312
291
  function htmlAttributeName(name) {
313
- if (name === 'className')
314
- return 'class';
315
- if (name === 'htmlFor')
316
- return 'for';
317
- if (name === 'acceptCharset')
318
- return 'accept-charset';
319
- if (name === 'httpEquiv')
320
- return 'http-equiv';
321
- return name;
292
+ if (name === "className") return "class";
293
+ if (name === "htmlFor") return "for";
294
+ if (name === "acceptCharset") return "accept-charset";
295
+ if (name === "httpEquiv") return "http-equiv";
296
+ return name;
322
297
  }
323
298
  function isCustomElement(element) {
324
- return element instanceof HTMLElement && element.localName.includes('-');
299
+ return element instanceof HTMLElement && element.localName.includes("-");
325
300
  }
326
301
  function validateRawHtmlProp(element, name) {
327
- if (UNSAFE_HTML && element instanceof HTMLElement)
328
- validateRawHtmlRelatedProp(element, name);
302
+ if (UNSAFE_HTML && element instanceof HTMLElement) validateRawHtmlRelatedProp(element, name);
329
303
  }
330
304
  function lowerInitial(value) {
331
- return `${value.charAt(0).toLowerCase()}${value.slice(1)}`;
305
+ return `${value.charAt(0).toLowerCase()}${value.slice(1)}`;
332
306
  }
307
+ //#endregion
308
+ export { applyBaseDomProp, applyDomProp, ensureControlledFormRestoration, installDomPropHandler, installFormDomCapability, installStyleDomCapability, isControlledFormProp, isReactFormChangeEvent, restoreControlledFormState };
309
+
333
310
  //# sourceMappingURL=properties.js.map