@raphy-js/dom 0.0.0-stage → 1.0.0-dev.88

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 (175) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +187 -2
  3. package/dist/DOMBlueprintMaterializer-C-icNhvm.cjs +1 -0
  4. package/dist/DOMBlueprintMaterializer-CxzM_TX5.js +201 -0
  5. package/dist/FullDOMOperations-BOlf0_0L.js +2781 -0
  6. package/dist/FullDOMOperations-Dschwj33.cjs +1 -0
  7. package/dist/api/renderer.d.ts +12 -0
  8. package/dist/applicationIdentity-CHbuUlsE.cjs +1 -0
  9. package/dist/applicationIdentity-DjVgpsQq.js +11 -0
  10. package/dist/bind-BEmkQdaL.cjs +1 -0
  11. package/dist/bind-OakIMWpC.js +52 -0
  12. package/dist/binding/DOMValueWriter.d.ts +59 -0
  13. package/dist/binding/materializeComponentProps.d.ts +38 -0
  14. package/dist/binding/mountDOMBinding.d.ts +9 -0
  15. package/dist/binding/mountDOMProps.d.ts +22 -0
  16. package/dist/capture.cjs +1 -0
  17. package/dist/capture.d.ts +7 -0
  18. package/dist/capture.js +166 -0
  19. package/dist/channels-Bs8GHVWn.cjs +1 -0
  20. package/dist/channels-DqAQt-NH.js +33 -0
  21. package/dist/compact/hydration.cjs +1 -0
  22. package/dist/compact/hydration.d.ts +9 -0
  23. package/dist/compact/hydration.js +12 -0
  24. package/dist/compact/index.d.ts +19 -0
  25. package/dist/compact/targetRuntime.d.ts +1 -0
  26. package/dist/compact.cjs +1 -0
  27. package/dist/compact.js +34 -0
  28. package/dist/contracts/freezeGeneratedContract.d.ts +5 -0
  29. package/dist/contracts/manifest.json +25 -0
  30. package/dist/contracts/node.cjs +1 -0
  31. package/dist/contracts/node.contract.json +36889 -0
  32. package/dist/contracts/node.d.ts +6 -0
  33. package/dist/contracts/node.js +19 -0
  34. package/dist/contracts/stylesheet.cjs +1 -0
  35. package/dist/contracts/stylesheet.contract.json +11887 -0
  36. package/dist/contracts/stylesheet.d.ts +6 -0
  37. package/dist/contracts/stylesheet.js +22 -0
  38. package/dist/createDOMDataEventInput-B82pnIav.cjs +1 -0
  39. package/dist/createDOMDataEventInput-BDX50jhu.js +3010 -0
  40. package/dist/createDOMNodeRuntime-BHcsbeO1.cjs +1 -0
  41. package/dist/createDOMNodeRuntime-DIKOUQP7.js +3006 -0
  42. package/dist/createHydrationRenderer-C7srF-66.js +289 -0
  43. package/dist/createHydrationRenderer-DKybWTj4.cjs +1 -0
  44. package/dist/elementRef-D8Ir8tXA.cjs +1 -0
  45. package/dist/elementRef-YPBBElV9.js +32 -0
  46. package/dist/event/DOMEventHub.d.ts +303 -0
  47. package/dist/freezeGeneratedContract-0EZt85o4.js +10 -0
  48. package/dist/freezeGeneratedContract-g_Op1hGY.cjs +1 -0
  49. package/dist/hydration/HydrationEvents.d.ts +20 -0
  50. package/dist/hydration/HydrationSession.d.ts +107 -0
  51. package/dist/hydration/HydrationStream.d.ts +30 -0
  52. package/dist/hydration/activateHydration.d.ts +2 -0
  53. package/dist/hydration/createHydrationRenderer.d.ts +25 -0
  54. package/dist/hydration/index.d.ts +8 -0
  55. package/dist/hydration.cjs +1 -0
  56. package/dist/hydration.js +12 -0
  57. package/dist/index.cjs +1 -0
  58. package/dist/index.d.ts +22 -0
  59. package/dist/index.js +24 -0
  60. package/dist/interaction/clipboard.d.ts +2 -0
  61. package/dist/interaction/contextAction.d.ts +3 -0
  62. package/dist/interaction/contracts/node.cjs +1 -0
  63. package/dist/interaction/contracts/node.d.ts +15 -0
  64. package/dist/interaction/contracts/node.js +60 -0
  65. package/dist/interaction/dragDrop.d.ts +13 -0
  66. package/dist/interaction/focus.d.ts +4 -0
  67. package/dist/interaction/geometry.d.ts +39 -0
  68. package/dist/interaction/hover.d.ts +4 -0
  69. package/dist/interaction/index.d.ts +2 -0
  70. package/dist/interaction/interaction.d.ts +4 -0
  71. package/dist/interaction/internal/DOMInputModality.d.ts +20 -0
  72. package/dist/interaction/internal/DOMInteraction.types.d.ts +29 -0
  73. package/dist/interaction/internal/applicationIdentity.d.ts +3 -0
  74. package/dist/interaction/internal/dragDataTransfer.d.ts +4 -0
  75. package/dist/interaction/internal/solvePosition.d.ts +5 -0
  76. package/dist/interaction/keyboard.d.ts +3 -0
  77. package/dist/interaction/move.d.ts +3 -0
  78. package/dist/interaction/nativeDragDrop.d.ts +18 -0
  79. package/dist/interaction/outside.d.ts +3 -0
  80. package/dist/interaction/press.d.ts +3 -0
  81. package/dist/interaction/profile.cjs +1 -0
  82. package/dist/interaction/profile.d.ts +2 -0
  83. package/dist/interaction/profile.js +48 -0
  84. package/dist/interaction/rovingFocus.d.ts +4 -0
  85. package/dist/interaction/runtime.d.ts +7 -0
  86. package/dist/interaction/textEditing.d.ts +4 -0
  87. package/dist/interaction.cjs +1 -0
  88. package/dist/interaction.js +1603 -0
  89. package/dist/internal/dev.d.ts +20 -0
  90. package/dist/motion/channels.d.ts +5 -0
  91. package/dist/motion/index.d.ts +8 -0
  92. package/dist/motion-scroll/index.d.ts +19 -0
  93. package/dist/motion-scroll.cjs +1 -0
  94. package/dist/motion-scroll.js +169 -0
  95. package/dist/motion.cjs +1 -0
  96. package/dist/motion.js +187 -0
  97. package/dist/operations.cjs +1 -0
  98. package/dist/operations.d.ts +3 -0
  99. package/dist/operations.js +10 -0
  100. package/dist/profile/DOMProfile.d.ts +4 -0
  101. package/dist/profile/index.d.ts +1 -0
  102. package/dist/profile.cjs +1 -0
  103. package/dist/profile.js +23 -0
  104. package/dist/renderer/DOMEffectScope.d.ts +13 -0
  105. package/dist/renderer/DOMPresentation.d.ts +8 -0
  106. package/dist/renderer/DOMRenderer.d.ts +35 -0
  107. package/dist/renderer/DOMRenderer.types.d.ts +12 -0
  108. package/dist/renderer/DOMRendererExtension.types.d.ts +33 -0
  109. package/dist/renderer/DOMRuntimeProfile.d.ts +15 -0
  110. package/dist/renderer/DOMTargetRuntime.d.ts +1 -0
  111. package/dist/renderer/createDOMTargetRuntime.d.ts +3 -0
  112. package/dist/renderer/installAuxiliaryViews.d.ts +8 -0
  113. package/dist/renderer/installDOMRendererExtensions.d.ts +10 -0
  114. package/dist/renderer/resolveDOMMountTarget.d.ts +7 -0
  115. package/dist/renderer-4Wbid5nE.js +30 -0
  116. package/dist/renderer-DHK3lLG-.cjs +1 -0
  117. package/dist/resolveDOMMountTarget-C75JWc5x.cjs +1 -0
  118. package/dist/resolveDOMMountTarget-D944H05N.js +19 -0
  119. package/dist/runtime.cjs +1 -0
  120. package/dist/runtime.d.ts +21 -0
  121. package/dist/runtime.js +25 -0
  122. package/dist/serialization.cjs +1 -0
  123. package/dist/serialization.d.ts +4 -0
  124. package/dist/serialization.js +118 -0
  125. package/dist/stylesheet/DOMStyleManager.d.ts +95 -0
  126. package/dist/stylesheet/DOMStyleReferenceName.d.ts +2 -0
  127. package/dist/stylesheet/DOMStylesheetRuntime.d.ts +25 -0
  128. package/dist/stylesheet/acquireInstanceStylesheets.d.ts +4 -0
  129. package/dist/stylesheet/scopeDOMSelector.d.ts +2 -0
  130. package/dist/stylesheet/serializeDOMStyleValue.d.ts +3 -0
  131. package/dist/targetRuntime-C67QmOgE.cjs +1 -0
  132. package/dist/targetRuntime-C_OdmS5w.js +5 -0
  133. package/dist/template/AdvancedDOMMaterializer.d.ts +14 -0
  134. package/dist/template/AsyncDOMMaterializer.d.ts +4 -0
  135. package/dist/template/BoundaryDOMMaterializer.d.ts +10 -0
  136. package/dist/template/DOMHostPlan.d.ts +4 -0
  137. package/dist/template/DOMNode.types.d.ts +192 -0
  138. package/dist/template/DOMNodeRuntime.d.ts +1 -0
  139. package/dist/template/binding/DOMBinding.types.d.ts +44 -0
  140. package/dist/template/binding/bind.d.ts +16 -0
  141. package/dist/template/blueprint/DOMBlueprintAddressing.d.ts +23 -0
  142. package/dist/template/blueprint/DOMBlueprintMaterializer.d.ts +3 -0
  143. package/dist/template/blueprint/DOMBlueprintMaterializer.types.d.ts +15 -0
  144. package/dist/template/blueprint/DOMHostBlueprint.d.ts +102 -0
  145. package/dist/template/blueprint/DOMHostBlueprintCache.d.ts +86 -0
  146. package/dist/template/blueprint/createDOMDataEventInput.d.ts +5 -0
  147. package/dist/template/blueprint/mountDOMHostBlueprint.d.ts +45 -0
  148. package/dist/template/createDOMNodeRuntime.d.ts +3 -0
  149. package/dist/template/each/mountEach.d.ts +5 -0
  150. package/dist/template/each/mountPureEach.d.ts +22 -0
  151. package/dist/template/error/DOMInvocation.d.ts +58 -0
  152. package/dist/template/error/DOMOperationError.d.ts +25 -0
  153. package/dist/template/html/DOMRawHtmlNode.types.d.ts +21 -0
  154. package/dist/template/html/rawHtml.d.ts +5 -0
  155. package/dist/template/keep-alive/DOMKeepAliveNode.types.d.ts +10 -0
  156. package/dist/template/keep-alive/keepAlive.d.ts +4 -0
  157. package/dist/template/mount/DOMMountTransaction.d.ts +63 -0
  158. package/dist/template/mountNode.d.ts +173 -0
  159. package/dist/template/normalizeChildren.d.ts +5 -0
  160. package/dist/template/operations/DOMOperations.d.ts +56 -0
  161. package/dist/template/operations/FullDOMOperations.d.ts +6 -0
  162. package/dist/template/page/DOMHead.d.ts +7 -0
  163. package/dist/template/page/PageNodePlan.d.ts +31 -0
  164. package/dist/template/ref/DOMElementRef.types.d.ts +7 -0
  165. package/dist/template/ref/componentRefGuard.d.ts +6 -0
  166. package/dist/template/ref/elementRef.d.ts +9 -0
  167. package/dist/template/structural/range/DOMRange.d.ts +145 -0
  168. package/dist/template/teleport/DOMTeleportNode.types.d.ts +8 -0
  169. package/dist/template/teleport/teleport.d.ts +4 -0
  170. package/dist/template/transition/DOMTransitionCoordinator.d.ts +32 -0
  171. package/dist/template/transition/DOMTransitionNode.types.d.ts +30 -0
  172. package/dist/template/transition/transition.d.ts +4 -0
  173. package/dist/template/value/DOMValueDescriptor.types.d.ts +34 -0
  174. package/dist/template/value/valueDescriptors.d.ts +13 -0
  175. package/package.json +157 -4
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,188 @@
1
- # Temporary Holding Version
1
+ # `@raphy-js/dom`
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ ## Optional video frame capture
4
+
5
+ `@raphy-js/dom/capture` rasterizes a connected, already laid-out element into a
6
+ same-sized Canvas2D target. The caller supplies `ownsCanvas` so only registered
7
+ session surfaces enter the frame. Images are fetched with CORS and inlined under
8
+ per-resource and per-frame limits; fonts must finish loading. Cross-origin
9
+ resources without CORS, tainted/unregistered canvas, Shadow DOM, live video/iframe elements,
10
+ external SVG `<use>`, external CSS URLs, CSS animations and pseudo-content fail
11
+ explicitly. The capability is source-only until the Linux browser fixture passes;
12
+ arbitrary HTML/CSS equivalence is not promised.
13
+
14
+ ## Compact rendering
15
+
16
+ `@raphy-js/dom/compact` uses the same DOM materializer with an explicit set of
17
+ optional operations. The normal `@raphy-js/dom` renderer keeps the Full profile.
18
+
19
+ ```ts
20
+ import { renderer } from '@raphy-js/dom/compact'
21
+ import { BINDING_OPERATION, EACH_OPERATION } from '@raphy-js/dom/operations'
22
+
23
+ const definition = renderer({ target }, [EACH_OPERATION, BINDING_OPERATION])
24
+ ```
25
+
26
+ `withDOMOperations(Component, operations)` returns an immutable component variant
27
+ with the same setup/template functions. It preserves earlier declarations and
28
+ leaves the original definition untouched. A lazily loaded variant installs its
29
+ operations separately in every renderer; disposing an application releases its
30
+ table. Missing or conflicting operations produce diagnostics.
31
+ Annotate the resolved definition inside an async loader; the Core lazy descriptor
32
+ retains its original loading/cache identity.
33
+
34
+ `ADVANCED_OPERATION` provides Teleport, transitions, KeepAlive, regions and
35
+ contributions; `BOUNDARY_OPERATION` provides ClientOnly, error boundaries and
36
+ deferred hydration. Async component boundaries remain shared. Compact host
37
+ blueprints replay through the ordinary Core/DOM path. Hydration is available at
38
+ `@raphy-js/dom/compact/hydration` with the same manifest and adoption contract.
39
+
40
+ ## Application style presets
41
+
42
+ Validated application stylesheets are installed once per application. Zero-specificity ownership guards, namespaced keyframes/property registrations, component/application layers, portals and shadow roots preserve isolation. Dispose and failed creation remove owned artifacts.
43
+
44
+ Teleported content inherits providers from its logical source, including the application default without an explicit scope. Shared outlets cannot mix applications' token values: refcounted projections mark logical content roots and reuse the existing application binding subscriptions.
45
+
46
+ ## Extension event lifecycle
47
+
48
+ Extension event delivery checks the event scope and runtime lifecycle before entering a runtime action. Browser blur during teardown and retained callbacks after cleanup cannot invoke disposed owners. Listener cleanup remains idempotent; live handler errors keep the ordinary runtime error boundary.
49
+
50
+ The optional Interaction native transfer capability normalizes both `dragenter`
51
+ and `dragover` to semantic `over`. A target can accept an entering child before
52
+ an immediate release, including while scrolling moves the text underneath the
53
+ pointer. Unaccepted entry retains the browser default, and protected transfer
54
+ data is read only at `drop`. Internal child transitions keep the nearest target's
55
+ ownership; unsubscribe and application disposal remove all native subscriptions.
56
+
57
+ DOM renderer and materializer for `@raphy-js/core`.
58
+
59
+ ```ts
60
+ import { createRaphy } from '@raphy-js/core'
61
+ import App from './App.raphy'
62
+
63
+ const application = createRaphy(App).mount('#app')
64
+ ```
65
+
66
+ The DOM Target Profile points to `@raphy-js/dom/runtime`. The Vite integration
67
+ loads that small adapter for the configured root Target; `mount()` accepts a
68
+ selector, `Element` or `ShadowRoot`. Direct `renderer({ target })` remains a
69
+ low-level integration API for custom hosts and package tests.
70
+
71
+ The DOM `NodeAdapter` implements Core host-node, input and primitive
72
+ dispatch using the same DOM plans as manual Node Notation authoring. This package has no
73
+ compiler subpath or Compiler Core peer dependency; `.raphy` compilation remains
74
+ target-neutral.
75
+
76
+ The static browser DOM target description is published separately:
77
+
78
+ ```ts
79
+ import { RAPHY_DOM_TARGET_PROFILE } from '@raphy-js/dom/profile'
80
+ ```
81
+
82
+ This subpath describes support for Core Node and Style notations and contains a
83
+ string module reference to the runtime adapter. Importing the profile itself
84
+ does not create a DOM target or run `renderer()`.
85
+
86
+ Motion support is opt-in through `@raphy-js/dom/motion`; importing the default
87
+ DOM entrypoint does not load it:
88
+
89
+ ```ts
90
+ import { defineComponent, node, onMount, template } from '@raphy-js/core'
91
+ import { elementRef, type DOMElementRef } from '@raphy-js/dom'
92
+ import { DOM_MOTION_ADAPTER } from '@raphy-js/dom/motion'
93
+ import { defineMotion, playMotion, tween } from '@raphy-js/motion'
94
+
95
+ const enter = defineMotion<{ target: DOMElementRef<HTMLDivElement> }>(
96
+ ({ target }) => tween(target, { 'paint.opacity': [0, 1] }, { duration: 180 }),
97
+ )
98
+
99
+ const Panel = defineComponent({
100
+ setup({ owner }) {
101
+ const target = elementRef<HTMLDivElement>()
102
+ onMount(() => {
103
+ playMotion(enter, { target }, { adapter: DOM_MOTION_ADAPTER, owner })
104
+ })
105
+ return { target }
106
+ },
107
+ template: template(({ state }) => node('div', {
108
+ ref: state.target,
109
+ style: { opacity: '1' },
110
+ }, 'Panel')),
111
+ })
112
+ ```
113
+
114
+ `elementRef` resolves only after mount. The adapter uses Web Animations for
115
+ opacity, X/Y translation (CSS pixels) and scale; unsupported channels throw.
116
+ Motion effects are transient and released after completion or owner disposal,
117
+ so authored Style must provide the final visual state. A reduced-motion
118
+ preference skips the visual effect and completes immediately. The static DOM
119
+ Target Profile remains limited to its Node/Style support; Motion is not
120
+ automatically wired into `transition()`.
121
+
122
+ Live Spring reuses `DOM_MOTION_ADAPTER`. Scroll-driven effects use the separate
123
+ `@raphy-js/dom/motion-scroll` adapter together with opt-in `interaction()`:
124
+
125
+ ```ts
126
+ import { DOM_SCROLL_MOTION_ADAPTER } from '@raphy-js/dom/motion-scroll'
127
+ import { bindMotion, scrub, viewProgress } from '@raphy-js/motion/scroll'
128
+ import { defineMotion } from '@raphy-js/motion'
129
+
130
+ const parallax = defineMotion(({ layer }) => scrub(layer, [
131
+ { at: 0, 'transform.translateY': -24 },
132
+ { at: 1, 'transform.translateY': 24 },
133
+ ]))
134
+ const binding = bindMotion(parallax, { layer }, {
135
+ progress: viewProgress(section, { scroller, axis: 'y' }),
136
+ adapter: DOM_SCROLL_MOTION_ADAPTER,
137
+ owner,
138
+ })
139
+ ```
140
+
141
+ All refs must be mounted in the same application. Browser scroll timelines are
142
+ used when compatible with the explicit scroller; otherwise a paused Web
143
+ Animation follows Interaction scroll/geometry observations. Reduced motion
144
+ leaves authored Style visible. `binding.dispose()` removes the effect and its
145
+ observers; `binding.ended` resolves on disposal.
146
+
147
+ DOM also publishes generated, immutable target contracts without importing the
148
+ renderer entrypoint:
149
+
150
+ ```ts
151
+ import nodeContract from '@raphy-js/dom/contracts/node'
152
+ import stylesheetContract from '@raphy-js/dom/contracts/stylesheet'
153
+ ```
154
+
155
+ The readable JSON artifacts are available as `@raphy-js/dom/contracts/node.json`
156
+ and `@raphy-js/dom/contracts/stylesheet.json`. Package authors can regenerate
157
+ and inspect them locally:
158
+
159
+ ```sh
160
+ pnpm contract:generate
161
+ pnpm contract:inspect node button
162
+ pnpm contract:inspect stylesheet background
163
+ ```
164
+
165
+ Generation uses pinned WebRef datasets, the package TypeScript `lib.dom.d.ts`
166
+ and a small explicit Raphy overlay for bindings, refs and custom elements. It is
167
+ a development/release operation and never runs in an application runtime.
168
+
169
+ DOM also implements Core's application-local auxiliary view capability through
170
+ its existing template/transaction/stylesheet pipeline. Lazy content preserves
171
+ its source context; replacement rollback and cleanup failures do not orphan
172
+ the retained view or newly mounted content. This host contains no Tooltip
173
+ registry and does not create a second application.
174
+
175
+ ## Runtime profiles and hydration
176
+
177
+ DOM and hydration renderer definitions preserve the runtime chosen by Core. Existing calls use the full runtime by default. An execution application can use the same DOM renderer, bindings, events and hydration protocol; extension owners and diagnostics retain the execution type. The target adapter creates a renderer for the selected profile too.
178
+
179
+ `@raphy-js/dom/hydration` adopts server nodes and connects the ordinary update paths. Browser refs and mount hooks commit after adoption. Zero-slot host blueprints materialize their literal tree once without cloning; scoped styles and ordinary slotted blueprints retain their ownership and cleanup paths.
180
+
181
+ ### Optional foreign targets
182
+
183
+ A Full-renderer extension may implement `resolveTarget(name,parentRuntime)` using
184
+ Core's existing NodeTargetRoute. The parent bridge owns foreign placement; two
185
+ matching resolvers are an error. Compact rendering rejects foreign target
186
+ extensions explicitly. Extensions receive `trackRenderWork(owner,promise)` for
187
+ renderer-owned asynchronous materialization participating in Core afterRender.
188
+ The optional compiled Nova bridge is provided by the separate `@nova-lab/raphy`.
@@ -0,0 +1 @@
1
+ "use strict";const y=require("./createDOMNodeRuntime-BHcsbeO1.cjs"),n=require("./FullDOMOperations-Dschwj33.cjs"),O=require("./createDOMDataEventInput-B82pnIav.cjs"),z=require("@raphy-js/core"),j=y.createDOMNodeRuntime(n.createDOMBlueprintInstance),q=y.createDOMTargetRuntime(j,y.DOM_STYLESHEET_RUNTIME),m=0,g=1,W=2,B=3,h=0,p=1,A=2,U=3;function Y(o,s,l,r,a,t,e,E,N){const I=o.kinds,P=o.modes,v=o.slots,T=o.steps,b=o.stepEnds,d=o.undeclared===0?o.getters:F(o,l);let c,M,S=0;d!==0&&(c=new Array(B+d*U),c[m]=e,c[g]=E,c[W]=N);let i=s,w=s,G=s,k=0;for(let _=0;_<I.length;_++){const X=b[_];for(;k<X;){switch(T[k++]){case n.DOM_BLUEPRINT_FIRST_CHILD:i=i.firstChild;break;case n.DOM_BLUEPRINT_NEXT_SIBLING:i=i.nextSibling;break;case n.DOM_BLUEPRINT_PARENT:i=i.parentNode;break;case n.DOM_BLUEPRINT_SAVE_1:w=i;break;case n.DOM_BLUEPRINT_LOAD_1:i=w;break;case n.DOM_BLUEPRINT_SAVE_2:G=i;break;case n.DOM_BLUEPRINT_LOAD_2:i=G;break;default:i=s}if(O.DEV&&i===null)throw new Error("[RaphyDOM] Host blueprint clone does not match its definition.")}const f=I[_];if(O.DEV&&i.nodeType!==(f===n.DOM_BLUEPRINT_TEXT?3:1))throw new Error("[RaphyDOM] Host blueprint clone does not match its definition.");const u=l[v[_]],L=P[_];if(f===n.DOM_BLUEPRINT_TEXT){const D=L===n.DOM_BLUEPRINT_MODE_GETTER?u:L===n.DOM_BLUEPRINT_MODE_ANY&&typeof u=="object"?H(u):void 0;if(D!==void 0){const R=B+S*U;c[R+h]=i,c[R+p]=D,c[R+A]=null,M??=a._registerEffectGroup(O.DOM_WRITE_PHASE,d,C,c),O.startDOMGroupSlot(M,S++)}else i.data=String(u);continue}const V=L===n.DOM_BLUEPRINT_MODE_GETTER?u:L===n.DOM_BLUEPRINT_MODE_ANY&&z.isNodeDynamicValue(u)?H(u):void 0;if(V!==void 0){const D=B+S*U;c[D+h]=i,c[D+p]=V,c[D+A]=f===n.DOM_BLUEPRINT_CLASS?"":Z(i,o.names[_],r,t,e,E),M??=a._registerEffectGroup(O.DOM_WRITE_PHASE,d,C,c),O.startDOMGroupSlot(M,S++)}else if(f===n.DOM_BLUEPRINT_CLASS){const D=O.normalizeDOMClass(u);D.length!==0&&i.setAttribute("class",D)}else if(f===n.DOM_BLUEPRINT_EVENT){const D=o.dataSlots[_];if(D<0)t.registerStatic(i,o.eventNames[_],u,r,e,E,o.options[_]);else{const R=l[D];t.registerStatic(i,o.eventNames[_],u,r,e,E,o.options[_],R===void 0?O.DOM_EVENT_UNDEFINED_DATA:R)}}else O.writeStaticDOMValue(i,o.names[_],u,r,t,e,E,null)}}function F(o,s){const l=o.kinds,r=o.modes,a=o.slots;let t=0;for(let e=0;e<l.length;e++){const E=r[e];if(E===n.DOM_BLUEPRINT_MODE_GETTER)t++;else if(E===n.DOM_BLUEPRINT_MODE_ANY){const N=s[a[e]];(l[e]===n.DOM_BLUEPRINT_TEXT?typeof N=="object":z.isNodeDynamicValue(N))&&t++}}return t}function H(o){return()=>o.read()}function Z(o,s,l,r,a,t){return{name:s,writer:O.createDOMValueWriter(o,s,l,r,a,t,null)}}function C(o){const s=o[0],l=B+o[1]*U,r=s[l+p],a=s[l+A];if(a===null){try{const t=r(),e=t==null?"":String(t),E=s[l+h];E.data!==e&&(E.data=e)}catch(t){const e=s[W];e(s[m],t,"text-write")}return}if(typeof a=="string"){try{const t=O.normalizeDOMClass(r());if(a===t)return;const e=s[l+h];t.length===0?e.removeAttribute("class"):e.setAttribute("class",t),s[l+A]=t}catch(t){const e=s[g];if(!e(s[m],t,"element-prop:class"))throw t}return}try{a.writer.write(r())}catch(t){const e=s[g];if(!e(s[m],t,`element-prop:${a.name}`))throw t}}const $=Object.freeze({create(o,s,l){const r=new n.DOMHostBlueprintCache(o,s,l);function a(t,e,E){const{materializeElement:N,appendStyleScope:I,captureDOMWriteError:P,rethrowUnhandledDOMOperationError:v}=E,T=e.env;if(T.namespace!=="html"||O.activeHydration(T.document)!==void 0)return N(n.replayDOMHostBlueprint(t),e);const d=t.definition.slotCount===0?void 0:r.get(t.definition,T.styleScopeId),c=d===void 0?r.materializeLiteral(t.definition,T.styleScopeId):d.prototype.cloneNode(!0);if(T.styleValueBoundary?.attach(c),T.componentRoot===!0){for(const M of T.inheritedStyleScopeIds??[])I(c,"data-r-scope",M);for(const M of T.slottedStyleScopeIds??[])I(c,"data-r-slotted",M)}return d!==void 0&&Y(d,c,t.values,e.ownerNode,e.effectScope,T.eventHub,e,P,v),c}return Object.freeze({materialize:a,prepare:(t,e)=>t.slotCount===0?void 0:r.get(t,e),dispose:()=>r.dispose()})}});exports.DOM_BLUEPRINT_MATERIALIZER=$;exports.DOM_TARGET_RUNTIME=q;
@@ -0,0 +1,201 @@
1
+ import { e as $, d as J, a as K } from "./createDOMNodeRuntime-DIKOUQP7.js";
2
+ import { c as Q, D as x, b as tt, d as et, e as v, f as y, g as A, h as V, i as st, j as ot, k as nt, l as it, m as ct, n as at, r as rt } from "./FullDOMOperations-BOlf0_0L.js";
3
+ import { i as j, a as z, j as C, n as F, k as lt, m as dt, o as Et, q as _t } from "./createDOMDataEventInput-BDX50jhu.js";
4
+ import { isNodeDynamicValue as Y } from "@raphy-js/core";
5
+ const ut = /* @__PURE__ */ $(Q), It = /* @__PURE__ */ J(ut, K), M = 0, U = 1, q = 2, R = 3, h = 0, b = 1, B = 2, L = 3;
6
+ function ft(s, o, a, c, r, t, e, l, O) {
7
+ const N = s.kinds, p = s.modes, g = s.slots, _ = s.steps, w = s.stepEnds, f = s.undeclared === 0 ? s.getters : Dt(s, a);
8
+ let i, D, m = 0;
9
+ f !== 0 && (i = new Array(R + f * L), i[M] = e, i[U] = l, i[q] = O);
10
+ let n = o, P = o, k = o, G = 0;
11
+ for (let d = 0; d < N.length; d++) {
12
+ const Z = w[d];
13
+ for (; G < Z; ) {
14
+ switch (_[G++]) {
15
+ case et:
16
+ n = n.firstChild;
17
+ break;
18
+ case tt:
19
+ n = n.nextSibling;
20
+ break;
21
+ case x:
22
+ n = n.parentNode;
23
+ break;
24
+ case ct:
25
+ P = n;
26
+ break;
27
+ case it:
28
+ n = P;
29
+ break;
30
+ case nt:
31
+ k = n;
32
+ break;
33
+ case ot:
34
+ n = k;
35
+ break;
36
+ default:
37
+ n = o;
38
+ }
39
+ if (j && n === null)
40
+ throw new Error("[RaphyDOM] Host blueprint clone does not match its definition.");
41
+ }
42
+ const S = N[d];
43
+ if (j && n.nodeType !== (S === v ? 3 : 1))
44
+ throw new Error("[RaphyDOM] Host blueprint clone does not match its definition.");
45
+ const u = a[g[d]], I = p[d];
46
+ if (S === v) {
47
+ const E = I === y ? u : I === A && typeof u == "object" ? W(u) : void 0;
48
+ if (E !== void 0) {
49
+ const T = R + m * L;
50
+ i[T + h] = n, i[T + b] = E, i[T + B] = null, D ??= r._registerEffectGroup(z, f, X, i), C(D, m++);
51
+ } else
52
+ n.data = String(u);
53
+ continue;
54
+ }
55
+ const H = I === y ? u : I === A && Y(u) ? W(u) : void 0;
56
+ if (H !== void 0) {
57
+ const E = R + m * L;
58
+ i[E + h] = n, i[E + b] = H, i[E + B] = S === V ? "" : Ot(
59
+ n,
60
+ s.names[d],
61
+ c,
62
+ t,
63
+ e,
64
+ l
65
+ ), D ??= r._registerEffectGroup(z, f, X, i), C(D, m++);
66
+ } else if (S === V) {
67
+ const E = F(u);
68
+ E.length !== 0 && n.setAttribute("class", E);
69
+ } else if (S === st) {
70
+ const E = s.dataSlots[d];
71
+ if (E < 0)
72
+ t.registerStatic(
73
+ n,
74
+ s.eventNames[d],
75
+ u,
76
+ c,
77
+ e,
78
+ l,
79
+ // Статические options объявляет mode записи; без них hub берёт пустые.
80
+ s.options[d]
81
+ );
82
+ else {
83
+ const T = a[E];
84
+ t.registerStatic(
85
+ n,
86
+ s.eventNames[d],
87
+ u,
88
+ c,
89
+ e,
90
+ l,
91
+ s.options[d],
92
+ T === void 0 ? lt : T
93
+ );
94
+ }
95
+ } else
96
+ dt(
97
+ n,
98
+ s.names[d],
99
+ u,
100
+ c,
101
+ t,
102
+ e,
103
+ l,
104
+ null
105
+ );
106
+ }
107
+ }
108
+ function Dt(s, o) {
109
+ const a = s.kinds, c = s.modes, r = s.slots;
110
+ let t = 0;
111
+ for (let e = 0; e < a.length; e++) {
112
+ const l = c[e];
113
+ if (l === y)
114
+ t++;
115
+ else if (l === A) {
116
+ const O = o[r[e]];
117
+ (a[e] === v ? typeof O == "object" : Y(O)) && t++;
118
+ }
119
+ }
120
+ return t;
121
+ }
122
+ function W(s) {
123
+ return () => s.read();
124
+ }
125
+ function Ot(s, o, a, c, r, t) {
126
+ return {
127
+ name: o,
128
+ writer: Et(s, o, a, c, r, t, null)
129
+ };
130
+ }
131
+ function X(s) {
132
+ const o = s[0], a = R + s[1] * L, c = o[a + b], r = o[a + B];
133
+ if (r === null) {
134
+ try {
135
+ const t = c(), e = t == null ? "" : String(t), l = o[a + h];
136
+ l.data !== e && (l.data = e);
137
+ } catch (t) {
138
+ const e = o[q];
139
+ e(o[M], t, "text-write");
140
+ }
141
+ return;
142
+ }
143
+ if (typeof r == "string") {
144
+ try {
145
+ const t = F(c());
146
+ if (r === t)
147
+ return;
148
+ const e = o[a + h];
149
+ t.length === 0 ? e.removeAttribute("class") : e.setAttribute("class", t), o[a + B] = t;
150
+ } catch (t) {
151
+ const e = o[U];
152
+ if (!e(o[M], t, "element-prop:class"))
153
+ throw t;
154
+ }
155
+ return;
156
+ }
157
+ try {
158
+ r.writer.write(c());
159
+ } catch (t) {
160
+ const e = o[U];
161
+ if (!e(o[M], t, `element-prop:${r.name}`))
162
+ throw t;
163
+ }
164
+ }
165
+ const Mt = /* @__PURE__ */ Object.freeze({
166
+ create(s, o, a) {
167
+ const c = new at(s, o, a);
168
+ function r(t, e, l) {
169
+ const { materializeElement: O, appendStyleScope: N, captureDOMWriteError: p, rethrowUnhandledDOMOperationError: g } = l, _ = e.env;
170
+ if (_.namespace !== "html" || _t(_.document) !== void 0)
171
+ return O(rt(t), e);
172
+ const f = t.definition.slotCount === 0 ? void 0 : c.get(t.definition, _.styleScopeId), i = f === void 0 ? c.materializeLiteral(t.definition, _.styleScopeId) : f.prototype.cloneNode(!0);
173
+ if (_.styleValueBoundary?.attach(i), _.componentRoot === !0) {
174
+ for (const D of _.inheritedStyleScopeIds ?? [])
175
+ N(i, "data-r-scope", D);
176
+ for (const D of _.slottedStyleScopeIds ?? [])
177
+ N(i, "data-r-slotted", D);
178
+ }
179
+ return f !== void 0 && ft(
180
+ f,
181
+ i,
182
+ t.values,
183
+ e.ownerNode,
184
+ e.effectScope,
185
+ _.eventHub,
186
+ e,
187
+ p,
188
+ g
189
+ ), i;
190
+ }
191
+ return Object.freeze({
192
+ materialize: r,
193
+ prepare: (t, e) => t.slotCount === 0 ? void 0 : c.get(t, e),
194
+ dispose: () => c.dispose()
195
+ });
196
+ }
197
+ });
198
+ export {
199
+ It as D,
200
+ Mt as a
201
+ };