@asheeui/puck 0.0.0-stage → 2.3.1

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 (154) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +10 -0
  3. package/README.md +126 -3
  4. package/dist/index.d.ts +22 -0
  5. package/dist/index.d.ts.map +1 -0
  6. package/dist/index.js +23 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/index.native.d.ts +22 -0
  9. package/dist/index.native.d.ts.map +1 -0
  10. package/dist/index.native.js +22 -0
  11. package/dist/index.native.js.map +1 -0
  12. package/dist/native/blocks/content.d.ts +19 -0
  13. package/dist/native/blocks/content.d.ts.map +1 -0
  14. package/dist/native/blocks/content.js +28 -0
  15. package/dist/native/blocks/content.js.map +1 -0
  16. package/dist/native/blocks/layout.d.ts +42 -0
  17. package/dist/native/blocks/layout.d.ts.map +1 -0
  18. package/dist/native/blocks/layout.js +33 -0
  19. package/dist/native/blocks/layout.js.map +1 -0
  20. package/dist/native/blocks/navigation.d.ts +19 -0
  21. package/dist/native/blocks/navigation.d.ts.map +1 -0
  22. package/dist/native/blocks/navigation.js +38 -0
  23. package/dist/native/blocks/navigation.js.map +1 -0
  24. package/dist/native/blocks/sections.d.ts +30 -0
  25. package/dist/native/blocks/sections.d.ts.map +1 -0
  26. package/dist/native/blocks/sections.js +60 -0
  27. package/dist/native/blocks/sections.js.map +1 -0
  28. package/dist/native/blocks/utility.d.ts +13 -0
  29. package/dist/native/blocks/utility.d.ts.map +1 -0
  30. package/dist/native/blocks/utility.js +18 -0
  31. package/dist/native/blocks/utility.js.map +1 -0
  32. package/dist/native/config.d.ts +19 -0
  33. package/dist/native/config.d.ts.map +1 -0
  34. package/dist/native/config.js +45 -0
  35. package/dist/native/config.js.map +1 -0
  36. package/dist/native/index.d.ts +18 -0
  37. package/dist/native/index.d.ts.map +1 -0
  38. package/dist/native/index.js +18 -0
  39. package/dist/native/index.js.map +1 -0
  40. package/dist/native/render.d.ts +39 -0
  41. package/dist/native/render.d.ts.map +1 -0
  42. package/dist/native/render.js +71 -0
  43. package/dist/native/render.js.map +1 -0
  44. package/dist/native/root.d.ts +21 -0
  45. package/dist/native/root.d.ts.map +1 -0
  46. package/dist/native/root.js +28 -0
  47. package/dist/native/root.js.map +1 -0
  48. package/dist/shared/adapters.d.ts +52 -0
  49. package/dist/shared/adapters.d.ts.map +1 -0
  50. package/dist/shared/adapters.js +57 -0
  51. package/dist/shared/adapters.js.map +1 -0
  52. package/dist/shared/blocks/content.d.ts +42 -0
  53. package/dist/shared/blocks/content.d.ts.map +1 -0
  54. package/dist/shared/blocks/content.js +44 -0
  55. package/dist/shared/blocks/content.js.map +1 -0
  56. package/dist/shared/blocks/index.d.ts +42 -0
  57. package/dist/shared/blocks/index.d.ts.map +1 -0
  58. package/dist/shared/blocks/index.js +81 -0
  59. package/dist/shared/blocks/index.js.map +1 -0
  60. package/dist/shared/blocks/layout.d.ts +52 -0
  61. package/dist/shared/blocks/layout.d.ts.map +1 -0
  62. package/dist/shared/blocks/layout.js +51 -0
  63. package/dist/shared/blocks/layout.js.map +1 -0
  64. package/dist/shared/blocks/navigation.d.ts +74 -0
  65. package/dist/shared/blocks/navigation.d.ts.map +1 -0
  66. package/dist/shared/blocks/navigation.js +86 -0
  67. package/dist/shared/blocks/navigation.js.map +1 -0
  68. package/dist/shared/blocks/sections.d.ts +142 -0
  69. package/dist/shared/blocks/sections.d.ts.map +1 -0
  70. package/dist/shared/blocks/sections.js +166 -0
  71. package/dist/shared/blocks/sections.js.map +1 -0
  72. package/dist/shared/blocks/utility.d.ts +31 -0
  73. package/dist/shared/blocks/utility.d.ts.map +1 -0
  74. package/dist/shared/blocks/utility.js +36 -0
  75. package/dist/shared/blocks/utility.js.map +1 -0
  76. package/dist/shared/fields.d.ts +103 -0
  77. package/dist/shared/fields.d.ts.map +1 -0
  78. package/dist/shared/fields.js +162 -0
  79. package/dist/shared/fields.js.map +1 -0
  80. package/dist/shared/index.d.ts +14 -0
  81. package/dist/shared/index.d.ts.map +1 -0
  82. package/dist/shared/index.js +14 -0
  83. package/dist/shared/index.js.map +1 -0
  84. package/dist/shared/types.d.ts +235 -0
  85. package/dist/shared/types.d.ts.map +1 -0
  86. package/dist/shared/types.js +20 -0
  87. package/dist/shared/types.js.map +1 -0
  88. package/dist/web/blocks/content.d.ts +10 -0
  89. package/dist/web/blocks/content.d.ts.map +1 -0
  90. package/dist/web/blocks/content.js +28 -0
  91. package/dist/web/blocks/content.js.map +1 -0
  92. package/dist/web/blocks/layout.d.ts +27 -0
  93. package/dist/web/blocks/layout.d.ts.map +1 -0
  94. package/dist/web/blocks/layout.js +28 -0
  95. package/dist/web/blocks/layout.js.map +1 -0
  96. package/dist/web/blocks/navigation.d.ts +10 -0
  97. package/dist/web/blocks/navigation.d.ts.map +1 -0
  98. package/dist/web/blocks/navigation.js +38 -0
  99. package/dist/web/blocks/navigation.js.map +1 -0
  100. package/dist/web/blocks/sections.d.ts +22 -0
  101. package/dist/web/blocks/sections.d.ts.map +1 -0
  102. package/dist/web/blocks/sections.js +60 -0
  103. package/dist/web/blocks/sections.js.map +1 -0
  104. package/dist/web/blocks/utility.d.ts +6 -0
  105. package/dist/web/blocks/utility.d.ts.map +1 -0
  106. package/dist/web/blocks/utility.js +19 -0
  107. package/dist/web/blocks/utility.js.map +1 -0
  108. package/dist/web/config.d.ts +65 -0
  109. package/dist/web/config.d.ts.map +1 -0
  110. package/dist/web/config.js +35 -0
  111. package/dist/web/config.js.map +1 -0
  112. package/dist/web/index.d.ts +19 -0
  113. package/dist/web/index.d.ts.map +1 -0
  114. package/dist/web/index.js +20 -0
  115. package/dist/web/index.js.map +1 -0
  116. package/dist/web/page.d.ts +24 -0
  117. package/dist/web/page.d.ts.map +1 -0
  118. package/dist/web/page.js +27 -0
  119. package/dist/web/page.js.map +1 -0
  120. package/dist/web/root.d.ts +9 -0
  121. package/dist/web/root.d.ts.map +1 -0
  122. package/dist/web/root.js +26 -0
  123. package/dist/web/root.js.map +1 -0
  124. package/package.json +120 -3
  125. package/src/index.native.ts +22 -0
  126. package/src/index.ts +24 -0
  127. package/src/native/blocks/content.tsx +61 -0
  128. package/src/native/blocks/layout.tsx +72 -0
  129. package/src/native/blocks/navigation.tsx +71 -0
  130. package/src/native/blocks/sections.tsx +174 -0
  131. package/src/native/blocks/utility.tsx +27 -0
  132. package/src/native/config.tsx +66 -0
  133. package/src/native/index.ts +18 -0
  134. package/src/native/render.tsx +113 -0
  135. package/src/native/root.tsx +31 -0
  136. package/src/shared/adapters.ts +82 -0
  137. package/src/shared/blocks/content.ts +80 -0
  138. package/src/shared/blocks/index.ts +100 -0
  139. package/src/shared/blocks/layout.ts +82 -0
  140. package/src/shared/blocks/navigation.ts +168 -0
  141. package/src/shared/blocks/sections.ts +322 -0
  142. package/src/shared/blocks/utility.ts +65 -0
  143. package/src/shared/fields.ts +199 -0
  144. package/src/shared/index.ts +14 -0
  145. package/src/shared/types.ts +278 -0
  146. package/src/web/blocks/content.tsx +55 -0
  147. package/src/web/blocks/layout.tsx +73 -0
  148. package/src/web/blocks/navigation.tsx +72 -0
  149. package/src/web/blocks/sections.tsx +177 -0
  150. package/src/web/blocks/utility.tsx +31 -0
  151. package/src/web/config.tsx +141 -0
  152. package/src/web/index.ts +21 -0
  153. package/src/web/page.tsx +40 -0
  154. package/src/web/root.tsx +34 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Ashee Softworks
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,10 @@
1
+ AsheeUI
2
+ Copyright 2026 Ashee Softworks
3
+
4
+ This product includes software developed at Ashee Softworks
5
+ (https://github.com/AsheeSoftworks/AsheeUI).
6
+
7
+ The framework's design system, component contracts and development
8
+ methodology are documented in this repository. The AI Test Driven
9
+ Development methodology that the project is developed with is created by
10
+ Ashee Softworks.
package/README.md CHANGED
@@ -1,3 +1,126 @@
1
- # Temporary Holding Version
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.
1
+ # @asheeui/puck
2
+
3
+ The AsheeUI [Puck](https://puckeditor.com) integration: one block registry behind one
4
+ import, usable by a web application and by a React Native one.
5
+
6
+ A page composed in a visual builder has to mean the same thing on a browser and on a
7
+ device. This package is arranged so that it does: the block **specs** — the label a
8
+ builder shows, the fields it fills in, the value each block starts as — live once, and
9
+ each platform supplies only the drawing.
10
+
11
+ ```bash
12
+ npm install @asheeui/puck @puckeditor/core
13
+ ```
14
+
15
+ `@puckeditor/core` is an optional peer. It is needed by the web half alone; the native
16
+ half loads without it.
17
+
18
+ ## What each platform gets
19
+
20
+ | Platform | The package is | You write |
21
+ | --- | --- | --- |
22
+ | Web | the editor's block registry (`asheePuckConfig`) and the editor's page renderer | `<Puck config={asheePuckConfig} … />` to compose, `<PuckPage data={page} />` to show |
23
+ | React Native | the same specs, plus a renderer that draws a stored page with the native components | `<PuckPage data={page} />` |
24
+
25
+ There is no editor on native, and none is planned: a device **shows** a page. What
26
+ composes one is the web editor, which is where authoring happens.
27
+
28
+ ## Usage
29
+
30
+ The editor, on the web:
31
+
32
+ ```tsx
33
+ import { Puck } from "@puckeditor/core";
34
+ import { asheePuckConfig } from "@asheeui/puck";
35
+ import "@puckeditor/core/puck.css";
36
+ import "@asheeui/web/styles";
37
+
38
+ export function Editor() {
39
+ return <Puck config={asheePuckConfig} data={savedPage} onPublish={save} />;
40
+ }
41
+ ```
42
+
43
+ A published page, on either platform — the same import, the same call:
44
+
45
+ ```tsx
46
+ import { PuckPage } from "@asheeui/puck";
47
+
48
+ export function PublishedPage({ page }) {
49
+ return <PuckPage data={page} />;
50
+ }
51
+ ```
52
+
53
+ Blocks resolve their theme through the framework provider. The page shell supplies one
54
+ when the application has not, and respects the one it already has, so a `defaultTheme`
55
+ or a component override in your own provider keeps applying to a built page.
56
+
57
+ ## Blocks
58
+
59
+ | Category | Blocks |
60
+ | --- | --- |
61
+ | Layout | `Section`, `Columns` |
62
+ | Navigation | `Navbar`, `Footer` |
63
+ | Hero | `Hero` |
64
+ | Content | `Heading`, `Text` |
65
+ | Features | `FeatureGrid` |
66
+ | CTA | `CTA` |
67
+ | Pricing | `PricingCard` |
68
+ | Testimonials | `Testimonials` |
69
+ | Utility | `EmptyState` |
70
+
71
+ There are no `PuckHero`, `PuckNavbar` or `PuckFooter` components. Each block is the
72
+ framework component plus the configuration a builder can own, so a block cannot drift
73
+ away from the component an application renders — and a block added once is offered by
74
+ both platforms.
75
+
76
+ ## The configuration boundary
77
+
78
+ A block exposes its **visual configuration**, not its React API. The boundary is the
79
+ same for every block:
80
+
81
+ | In the configuration | Out of the configuration |
82
+ | --- | --- |
83
+ | Wording, alignment, spacing, background, columns | Icons and arbitrary React nodes |
84
+ | Destinations and action wording | Click handlers and functions |
85
+ | Repeatable content (features, quotes, links) | Data from an application, a database or a request |
86
+
87
+ Everything inside the configuration survives a JSON round trip, which is what a saved
88
+ page is. A block that needed a runtime value would be a component problem rather than a
89
+ builder problem.
90
+
91
+ ## Layout
92
+
93
+ ```text
94
+ src/
95
+ shared/ the specs, the field builders and the adapters — no renderer, no editor
96
+ web/ the editor's registry, its page renderer and the DOM drawings
97
+ native/ the native registry, the stored-page renderer and the platform drawings
98
+ index.ts the web entry (`@asheeui/puck`)
99
+ index.native.ts the native entry (Metro's `react-native` field)
100
+ ```
101
+
102
+ The split is the reason the package can be used on both platforms: a browser bundle
103
+ reaches `web/` alone, and a device bundle reaches `native/` without loading React DOM,
104
+ Tailwind or the editor.
105
+
106
+ ## Adding a block
107
+
108
+ A block is one entry in `src/shared/blocks` plus one drawing per platform. State the
109
+ specs — the label, the fields and the default value — and then render the component on
110
+ each platform, reading the props the spec describes. A test in the same change asserts
111
+ what `src/shared/spec.test.ts` asserts for every block: that the block is labelled, that
112
+ its fields are types a builder understands, that it is filed under a category, and that
113
+ its defaults survive a JSON round trip.
114
+
115
+ ## Requirements
116
+
117
+ - React 18 or 19.
118
+ - `@puckeditor/core` `^0.23.0` for the web half.
119
+ - `react-native` and `nativewind` for the native half, configured the way
120
+ [the native package](https://github.com/AsheeSoftworks/AsheeUI/blob/main/docs/native.md)
121
+ documents. Add `@asheeui/puck` to the Tailwind content globs as well, so the classes
122
+ the native drawings name are compiled.
123
+
124
+ ---
125
+
126
+ Built with AI. See [Ashee Softworks](https://asheesoftworks.com).
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The AsheeUI Puck integration.
3
+ *
4
+ * One import, two renderers. An application installs `@asheeui/puck` and writes the same
5
+ * specifiers whether it runs in a browser or on a device; the resolver decides which half
6
+ * answers:
7
+ *
8
+ * - On the web, it reads `main` (and the `import` condition) and reaches this file,
9
+ * which is the editor's block registry, the editor's page renderer and the shared
10
+ * specs behind them.
11
+ * - Under Expo and Metro, it reads the manifest's `react-native` field, then the
12
+ * `react-native` condition of the exports map, and finally Metro's platform extension
13
+ * (`.native.ts` beside `.ts`), and reaches `./index.native`, which renders a stored
14
+ * page with the native components.
15
+ *
16
+ * The routing is a property of the file name and the manifest rather than of a runtime
17
+ * check, which is what keeps a browser bundle free of React Native and a device bundle
18
+ * free of the DOM edition of the framework. This module is the web branch, and it
19
+ * imports no native renderer.
20
+ */
21
+ export * from "./web";
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,OAAO,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ /**
3
+ * The AsheeUI Puck integration.
4
+ *
5
+ * One import, two renderers. An application installs `@asheeui/puck` and writes the same
6
+ * specifiers whether it runs in a browser or on a device; the resolver decides which half
7
+ * answers:
8
+ *
9
+ * - On the web, it reads `main` (and the `import` condition) and reaches this file,
10
+ * which is the editor's block registry, the editor's page renderer and the shared
11
+ * specs behind them.
12
+ * - Under Expo and Metro, it reads the manifest's `react-native` field, then the
13
+ * `react-native` condition of the exports map, and finally Metro's platform extension
14
+ * (`.native.ts` beside `.ts`), and reaches `./index.native`, which renders a stored
15
+ * page with the native components.
16
+ *
17
+ * The routing is a property of the file name and the manifest rather than of a runtime
18
+ * check, which is what keeps a browser bundle free of React Native and a device bundle
19
+ * free of the DOM edition of the framework. This module is the web branch, and it
20
+ * imports no native renderer.
21
+ */
22
+ export * from "./web";
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,OAAO,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The AsheeUI Puck integration, native branch.
3
+ *
4
+ * Metro reaches this file for a React Native platform — through the manifest's
5
+ * `react-native` field, through the `react-native` condition of the exports map, or by
6
+ * resolving the platform extension (`.native`) beside `index.ts` — so an application's
7
+ * import specifiers do not change between the web and a device.
8
+ *
9
+ * It exports the native registry and the native page renderer alongside the same shared
10
+ * specs the web branch exports, because the point of the package is that the import a
11
+ * developer writes is the same one on both platforms. It imports no DOM renderer and
12
+ * nothing from the editor: resolving this file must not pull Tailwind, React DOM or
13
+ * `@puckeditor/core` into a native bundle.
14
+ *
15
+ * The file is published as source rather than only as a build, and so are the modules it
16
+ * imports, because the manifest's `react-native` field cannot be redirected at publish
17
+ * time the way `main` and `types` are: whatever that field names has to exist in the
18
+ * tarball, and a resolver that reads the field instead of the exports map has to be able
19
+ * to compile it and everything it reaches.
20
+ */
21
+ export * from "./native";
22
+ //# sourceMappingURL=index.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,UAAU,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The AsheeUI Puck integration, native branch.
3
+ *
4
+ * Metro reaches this file for a React Native platform — through the manifest's
5
+ * `react-native` field, through the `react-native` condition of the exports map, or by
6
+ * resolving the platform extension (`.native`) beside `index.ts` — so an application's
7
+ * import specifiers do not change between the web and a device.
8
+ *
9
+ * It exports the native registry and the native page renderer alongside the same shared
10
+ * specs the web branch exports, because the point of the package is that the import a
11
+ * developer writes is the same one on both platforms. It imports no DOM renderer and
12
+ * nothing from the editor: resolving this file must not pull Tailwind, React DOM or
13
+ * `@puckeditor/core` into a native bundle.
14
+ *
15
+ * The file is published as source rather than only as a build, and so are the modules it
16
+ * imports, because the manifest's `react-native` field cannot be redirected at publish
17
+ * time the way `main` and `types` are: whatever that field names has to exist in the
18
+ * tarball, and a resolver that reads the field instead of the exports map has to be able
19
+ * to compile it and everything it reaches.
20
+ */
21
+ export * from "./native";
22
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.native.js","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,UAAU,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The platform content blocks.
3
+ *
4
+ * Each block is the framework component plus the shared spec: the label, the fields and
5
+ * the defaults come from `src/shared`, and only the drawing is written here. What the
6
+ * platform draws differently is stated in the block: a paragraph's alignment is a
7
+ * property of its `Typography` rather than a class on a paragraph element, so the shared
8
+ * alignment vocabulary is what reaches the component.
9
+ */
10
+ import type { AsheeBlock, HeadingBlockProps, TextBlockProps } from "../../shared";
11
+ /**
12
+ * A section heading with an optional eyebrow and description.
13
+ */
14
+ export declare const headingBlock: AsheeBlock<HeadingBlockProps>;
15
+ /**
16
+ * A paragraph of body text.
17
+ */
18
+ export declare const textBlock: AsheeBlock<TextBlockProps>;
19
+ //# sourceMappingURL=content.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/native/blocks/content.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AASH,OAAO,KAAK,EACV,UAAU,EACV,iBAAiB,EACjB,cAAc,EACf,MAAM,cAAc,CAAC;AAGtB;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,UAAU,CAAC,iBAAiB,CAetD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,UAAU,CAAC,cAAc,CAahD,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * The platform content blocks.
4
+ *
5
+ * Each block is the framework component plus the shared spec: the label, the fields and
6
+ * the defaults come from `src/shared`, and only the drawing is written here. What the
7
+ * platform draws differently is stated in the block: a paragraph's alignment is a
8
+ * property of its `Typography` rather than a class on a paragraph element, so the shared
9
+ * alignment vocabulary is what reaches the component.
10
+ */
11
+ import { Container, SECTION_BLOCK_TEXT_ALIGN, Section, Typography, } from "@asheeui/native";
12
+ import { SectionHeading } from "@asheeui/native/section-kit";
13
+ import { HEADING_SPEC, TEXT_SPEC } from "../../shared";
14
+ /**
15
+ * A section heading with an optional eyebrow and description.
16
+ */
17
+ export const headingBlock = {
18
+ ...HEADING_SPEC,
19
+ render: ({ eyebrow, title, description, align }) => (_jsx(Section, { spacing: "md", children: _jsx(Container, { children: _jsx(SectionHeading, { eyebrow: eyebrow || undefined, title: title || undefined, description: description || undefined, align: align ?? "start", size: "lg" }) }) })),
20
+ };
21
+ /**
22
+ * A paragraph of body text.
23
+ */
24
+ export const textBlock = {
25
+ ...TEXT_SPEC,
26
+ render: ({ text, align }) => (_jsx(Section, { spacing: "sm", children: _jsx(Container, { children: _jsx(Typography, { role: "body-lg", align: SECTION_BLOCK_TEXT_ALIGN[align ?? "start"], children: text }) }) })),
27
+ };
28
+ //# sourceMappingURL=content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.js","sourceRoot":"","sources":["../../../src/native/blocks/content.tsx"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,SAAS,EACT,wBAAwB,EACxB,OAAO,EACP,UAAU,GACX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAM7D,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEvD;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAkC;IACzD,GAAG,YAAY;IACf,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAClD,KAAC,OAAO,IAAC,OAAO,EAAC,IAAI,YACnB,KAAC,SAAS,cACR,KAAC,cAAc,IACb,OAAO,EAAE,OAAO,IAAI,SAAS,EAC7B,KAAK,EAAE,KAAK,IAAI,SAAS,EACzB,WAAW,EAAE,WAAW,IAAI,SAAS,EACrC,KAAK,EAAE,KAAK,IAAI,OAAO,EACvB,IAAI,EAAC,IAAI,GACT,GACQ,GACJ,CACX;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAA+B;IACnD,GAAG,SAAS;IACZ,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAC3B,KAAC,OAAO,IAAC,OAAO,EAAC,IAAI,YACnB,KAAC,SAAS,cACR,KAAC,UAAU,IACT,IAAI,EAAC,SAAS,EACd,KAAK,EAAE,wBAAwB,CAAC,KAAK,IAAI,OAAO,CAAC,YAChD,IAAI,GACM,GACH,GACJ,CACX;CACF,CAAC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * The platform layout blocks.
3
+ *
4
+ * A band and a two-column arrangement. Both are the only blocks whose props hold a drop
5
+ * zone, and on the platform a drop zone is a rendered node rather than a component to
6
+ * place: the page renderer resolves a stored page's children before it calls a block, so
7
+ * the block receives what to draw. That is why these two props are declared here while
8
+ * every other block's come from the shared spec.
9
+ *
10
+ * One difference between the platforms is deliberate and stated rather than hidden. A
11
+ * two-column block offers a ratio on the web, where a stylesheet expresses one; the
12
+ * platform's grid resolves its own window and offers whole column counts, so the ratio
13
+ * resolves to the framework's two columns once there is room for them and the block
14
+ * draws the same arrangement at every width below that.
15
+ */
16
+ import type { ReactNode } from "react";
17
+ import type { AsheeBlock, ColumnsBandProps, SectionBandProps } from "../../shared";
18
+ /**
19
+ * The props of the band block.
20
+ */
21
+ export type SectionBlockProps = SectionBandProps & {
22
+ /** Content dropped into the band, already rendered. */
23
+ content?: ReactNode;
24
+ };
25
+ /**
26
+ * A band with its own vertical rhythm and background.
27
+ */
28
+ export declare const sectionBlock: AsheeBlock<SectionBlockProps>;
29
+ /**
30
+ * The props of the two-column block.
31
+ */
32
+ export type ColumnsBlockProps = ColumnsBandProps & {
33
+ /** Content of the first column, already rendered. */
34
+ start?: ReactNode;
35
+ /** Content of the second column, already rendered. */
36
+ end?: ReactNode;
37
+ };
38
+ /**
39
+ * Two columns that stack on a narrow screen.
40
+ */
41
+ export declare const columnsBlock: AsheeBlock<ColumnsBlockProps>;
42
+ //# sourceMappingURL=layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/native/blocks/layout.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAGtB;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,GAAG;IACjD,uDAAuD;IACvD,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,UAAU,CAAC,iBAAiB,CAOtD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,GAAG;IACjD,qDAAqD;IACrD,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB,sDAAsD;IACtD,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,UAAU,CAAC,iBAAiB,CAYtD,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * The platform layout blocks.
4
+ *
5
+ * A band and a two-column arrangement. Both are the only blocks whose props hold a drop
6
+ * zone, and on the platform a drop zone is a rendered node rather than a component to
7
+ * place: the page renderer resolves a stored page's children before it calls a block, so
8
+ * the block receives what to draw. That is why these two props are declared here while
9
+ * every other block's come from the shared spec.
10
+ *
11
+ * One difference between the platforms is deliberate and stated rather than hidden. A
12
+ * two-column block offers a ratio on the web, where a stylesheet expresses one; the
13
+ * platform's grid resolves its own window and offers whole column counts, so the ratio
14
+ * resolves to the framework's two columns once there is room for them and the block
15
+ * draws the same arrangement at every width below that.
16
+ */
17
+ import { Container, Grid, Section } from "@asheeui/native";
18
+ import { COLUMNS_SPEC, SECTION_SPEC } from "../../shared";
19
+ /**
20
+ * A band with its own vertical rhythm and background.
21
+ */
22
+ export const sectionBlock = {
23
+ ...SECTION_SPEC,
24
+ render: ({ spacing, background, content }) => (_jsx(Section, { spacing: spacing ?? "lg", background: background ?? "none", children: _jsx(Container, { children: content }) })),
25
+ };
26
+ /**
27
+ * Two columns that stack on a narrow screen.
28
+ */
29
+ export const columnsBlock = {
30
+ ...COLUMNS_SPEC,
31
+ render: ({ spacing, start, end }) => (_jsx(Section, { spacing: spacing ?? "lg", children: _jsx(Container, { children: _jsxs(Grid, { columns: 1, columnsLg: 2, gap: "lg", children: [start, end] }) }) })),
32
+ };
33
+ //# sourceMappingURL=layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../src/native/blocks/layout.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAO3D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAU1D;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAkC;IACzD,GAAG,YAAY;IACf,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAC5C,KAAC,OAAO,IAAC,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,UAAU,EAAE,UAAU,IAAI,MAAM,YACjE,KAAC,SAAS,cAAE,OAAO,GAAa,GACxB,CACX;CACF,CAAC;AAaF;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAkC;IACzD,GAAG,YAAY;IACf,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CACnC,KAAC,OAAO,IAAC,OAAO,EAAE,OAAO,IAAI,IAAI,YAC/B,KAAC,SAAS,cACR,MAAC,IAAI,IAAC,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,GAAG,EAAC,IAAI,aACrC,KAAK,EACL,GAAG,IACC,GACG,GACJ,CACX;CACF,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The platform navigation blocks.
3
+ *
4
+ * A bar and a footer, with the navigation as data: link lists a non-developer can edit
5
+ * and no application state. The bar's action region is the framework's own action group,
6
+ * so a configured action renders exactly as a hand-written button does and follows the
7
+ * destination through the platform's own URL handler. The fields and the defaults come
8
+ * from `src/shared`.
9
+ */
10
+ import type { AsheeBlock, FooterBlockProps, NavbarBlockProps } from "../../shared";
11
+ /**
12
+ * The navigation bar of a page.
13
+ */
14
+ export declare const navbarBlock: AsheeBlock<NavbarBlockProps>;
15
+ /**
16
+ * The footer of a page.
17
+ */
18
+ export declare const footerBlock: AsheeBlock<FooterBlockProps>;
19
+ //# sourceMappingURL=navigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../src/native/blocks/navigation.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAGtB;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,UAAU,CAAC,gBAAgB,CA0BpD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,UAAU,CAAC,gBAAgB,CAiBpD,CAAC"}