@asheeui/puck 0.0.0-stage → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +29 -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 +119 -3
  125. package/src/index.native.ts +22 -0
  126. package/src/index.ts +24 -0
  127. package/src/native/blocks/content.tsx +55 -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 +35 -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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/web/config.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EACV,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,EACf,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,iBAAiB,EAEvB,MAAM,iBAAiB,CAAC;AAYzB;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,oDAAoD;IACpD,OAAO,EAAE,iBAAiB,CAAC;IAE3B,+DAA+D;IAC/D,OAAO,EAAE,iBAAiB,CAAC;IAE3B,yBAAyB;IACzB,OAAO,EAAE,iBAAiB,CAAC;IAE3B,gCAAgC;IAChC,IAAI,EAAE,cAAc,CAAC;IAErB,oCAAoC;IACpC,MAAM,EAAE,gBAAgB,CAAC;IAEzB,4BAA4B;IAC5B,MAAM,EAAE,gBAAgB,CAAC;IAEzB,uCAAuC;IACvC,IAAI,EAAE,cAAc,CAAC;IAErB,4CAA4C;IAC5C,GAAG,EAAE,aAAa,CAAC;IAEnB,+CAA+C;IAC/C,WAAW,EAAE,qBAAqB,CAAC;IAEnC,4CAA4C;IAC5C,YAAY,EAAE,sBAAsB,CAAC;IAErC,mCAAmC;IACnC,WAAW,EAAE,qBAAqB,CAAC;IAEnC,mCAAmC;IACnC,UAAU,EAAE,oBAAoB,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GACzB,QAAQ,GACR,YAAY,GACZ,MAAM,GACN,SAAS,GACT,UAAU,GACV,KAAK,GACL,SAAS,GACT,cAAc,GACd,SAAS,CAAC;AAEd;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC;IACnC,UAAU,EAAE,mBAAmB,CAAC;IAChC,IAAI,EAAE,kBAAkB,CAAC;IACzB,UAAU,EAAE,iBAAiB,EAAE,CAAC;CACjC,CAAC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,eAqB7B,CAAC"}
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { PUCK_CATEGORIES } from "../shared";
4
+ import { headingBlock, textBlock } from "./blocks/content";
5
+ import { columnsBlock, sectionBlock, } from "./blocks/layout";
6
+ import { footerBlock, navbarBlock } from "./blocks/navigation";
7
+ import { ctaBlock, featureGridBlock, heroBlock, pricingCardBlock, testimonialsBlock, } from "./blocks/sections";
8
+ import { emptyStateBlock } from "./blocks/utility";
9
+ import { PuckRoot } from "./root";
10
+ /**
11
+ * The AsheeUI blocks, filed under the categories the builder shows.
12
+ */
13
+ export const asheePuckConfig = {
14
+ components: {
15
+ Section: sectionBlock,
16
+ Columns: columnsBlock,
17
+ Heading: headingBlock,
18
+ Text: textBlock,
19
+ Navbar: navbarBlock,
20
+ Footer: footerBlock,
21
+ Hero: heroBlock,
22
+ CTA: ctaBlock,
23
+ FeatureGrid: featureGridBlock,
24
+ Testimonials: testimonialsBlock,
25
+ PricingCard: pricingCardBlock,
26
+ EmptyState: emptyStateBlock,
27
+ },
28
+ categories: PUCK_CATEGORIES,
29
+ root: {
30
+ fields: {},
31
+ defaultProps: {},
32
+ render: ({ children }) => _jsx(PuckRoot, { children: children }),
33
+ },
34
+ };
35
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/web/config.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAiCb,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAEL,YAAY,EAEZ,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAkElC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAoB;IAC9C,UAAU,EAAE;QACV,OAAO,EAAE,YAAY;QACrB,OAAO,EAAE,YAAY;QACrB,OAAO,EAAE,YAAY;QACrB,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,WAAW;QACnB,MAAM,EAAE,WAAW;QACnB,IAAI,EAAE,SAAS;QACf,GAAG,EAAE,QAAQ;QACb,WAAW,EAAE,gBAAgB;QAC7B,YAAY,EAAE,iBAAiB;QAC/B,WAAW,EAAE,gBAAgB;QAC7B,UAAU,EAAE,eAAe;KACgB;IAC7C,UAAU,EAAE,eAA2D;IACvE,IAAI,EAAE;QACJ,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,EAAE;QAChB,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,KAAC,QAAQ,cAAE,QAAQ,GAAY;KAC1D;CACF,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The web half of the Puck integration.
3
+ *
4
+ * It is the shared layer plus this platform's drawings: the block specs, the field
5
+ * builders and the adapters are re-exported unchanged, and the block registrations and
6
+ * the page renderer are the web's own. Nothing here imports React Native, and nothing
7
+ * here imports the native half of the package, so a browser bundle reaches only the DOM
8
+ * renderer.
9
+ */
10
+ export * from "../shared";
11
+ export * from "./blocks/content";
12
+ export * from "./blocks/layout";
13
+ export * from "./blocks/navigation";
14
+ export * from "./blocks/sections";
15
+ export * from "./blocks/utility";
16
+ export * from "./config";
17
+ export * from "./page";
18
+ export * from "./root";
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/web/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ /**
3
+ * The web half of the Puck integration.
4
+ *
5
+ * It is the shared layer plus this platform's drawings: the block specs, the field
6
+ * builders and the adapters are re-exported unchanged, and the block registrations and
7
+ * the page renderer are the web's own. Nothing here imports React Native, and nothing
8
+ * here imports the native half of the package, so a browser bundle reaches only the DOM
9
+ * renderer.
10
+ */
11
+ export * from "../shared";
12
+ export * from "./blocks/content";
13
+ export * from "./blocks/layout";
14
+ export * from "./blocks/navigation";
15
+ export * from "./blocks/sections";
16
+ export * from "./blocks/utility";
17
+ export * from "./config";
18
+ export * from "./page";
19
+ export * from "./root";
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/web/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb;;;;;;;;GAQG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { AsheePuckData } from "../shared";
2
+ import { type AsheePuckConfig } from "./config";
3
+ /**
4
+ * Props of {@link PuckPage}.
5
+ */
6
+ export interface PuckPageProps {
7
+ /** The page the builder published. */
8
+ data: AsheePuckData;
9
+ /** The block registry to render with. Defaults to the AsheeUI configuration. */
10
+ config?: AsheePuckConfig;
11
+ }
12
+ /**
13
+ * Render a stored page.
14
+ *
15
+ * @param props - The stored page, and optionally the registry to render it with.
16
+ * @returns The rendered page.
17
+ *
18
+ * @example
19
+ * ```tsx
20
+ * <PuckPage data={page} />
21
+ * ```
22
+ */
23
+ export declare function PuckPage({ data, config }: PuckPageProps): import("react").JSX.Element;
24
+ //# sourceMappingURL=page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/web/page.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,KAAK,eAAe,EAAmB,MAAM,UAAU,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,sCAAsC;IACtC,IAAI,EAAE,aAAa,CAAC;IAEpB,gFAAgF;IAChF,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAwB,EAAE,EAAE,aAAa,+BAEzE"}
@@ -0,0 +1,27 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ /**
4
+ * Rendering a stored page, on the web.
5
+ *
6
+ * A published page renders through the editor's own renderer, which needs no editor:
7
+ * the same block registry the builder reads is what a live site renders, so the two
8
+ * cannot drift. The native entry offers a component of the same name, so an application
9
+ * writes one import and one call and gets each platform's own renderer.
10
+ */
11
+ import { Render } from "@puckeditor/core";
12
+ import { asheePuckConfig } from "./config";
13
+ /**
14
+ * Render a stored page.
15
+ *
16
+ * @param props - The stored page, and optionally the registry to render it with.
17
+ * @returns The rendered page.
18
+ *
19
+ * @example
20
+ * ```tsx
21
+ * <PuckPage data={page} />
22
+ * ```
23
+ */
24
+ export function PuckPage({ data, config = asheePuckConfig }) {
25
+ return _jsx(Render, { config: config, data: data });
26
+ }
27
+ //# sourceMappingURL=page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page.js","sourceRoot":"","sources":["../../src/web/page.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;GAOG;AAEH,OAAO,EAAa,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAwB,eAAe,EAAE,MAAM,UAAU,CAAC;AAajE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,eAAe,EAAiB;IACxE,OAAO,KAAC,MAAM,IAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAuB,GAAI,CAAC;AACnE,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { AsheePuckRootProps } from "../shared";
2
+ /**
3
+ * The published page's root.
4
+ *
5
+ * @param props - The page the builder composed.
6
+ * @returns The page, inside the framework's provider when the application has none.
7
+ */
8
+ export declare function PuckRoot({ children }: AsheePuckRootProps): import("react").JSX.Element;
9
+ //# sourceMappingURL=root.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../src/web/root.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE,kBAAkB,+BAUxD"}
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ /**
4
+ * The page shell a published page renders into, on the web.
5
+ *
6
+ * A block resolves its theme through the framework provider, so the shell supplies one
7
+ * when the consumer has not. An existing provider is respected rather than nested, so a
8
+ * consumer's own configuration — a default theme, a component override — keeps applying
9
+ * to a built page. That is the whole reason this reads the context instead of always
10
+ * rendering a provider: a second provider would replace the resolved configuration with
11
+ * the framework's own defaults.
12
+ */
13
+ import { AsheeConfigContext, AsheeUIProvider } from "@asheeui/web";
14
+ import { useContext } from "react";
15
+ /**
16
+ * The published page's root.
17
+ *
18
+ * @param props - The page the builder composed.
19
+ * @returns The page, inside the framework's provider when the application has none.
20
+ */
21
+ export function PuckRoot({ children }) {
22
+ const existingConfig = useContext(AsheeConfigContext);
23
+ const page = (_jsx("div", { className: "flex min-h-dvh w-full flex-col bg-background text-foreground", children: children }));
24
+ return existingConfig ? page : _jsx(AsheeUIProvider, { children: page });
25
+ }
26
+ //# sourceMappingURL=root.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root.js","sourceRoot":"","sources":["../../src/web/root.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;;GASG;AAEH,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,QAAQ,EAAsB;IACvD,MAAM,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAEtD,MAAM,IAAI,GAAG,CACX,cAAK,SAAS,EAAC,8DAA8D,YAC1E,QAAQ,GACL,CACP,CAAC;IAEF,OAAO,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAC,eAAe,cAAE,IAAI,GAAmB,CAAC;AAC3E,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,122 @@
1
1
  {
2
2
  "name": "@asheeui/puck",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "2.3.0",
4
+ "description": "The AsheeUI Puck integration: one block registry behind one import, routed by the bundler so an editor composes a page on the web and a device renders the stored page with the native components.",
5
+ "author": "Ashee Softworks <asheesoftworks@gmail.com>",
6
+ "homepage": "https://asheeui.com",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/AsheeSoftworks/AsheeUI.git",
10
+ "directory": "packages/puck"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/AsheeSoftworks/AsheeUI/issues"
14
+ },
15
+ "keywords": [
16
+ "react",
17
+ "react-native",
18
+ "expo",
19
+ "puck",
20
+ "page-builder",
21
+ "visual-editor",
22
+ "component-library",
23
+ "design-system",
24
+ "tailwindcss",
25
+ "nativewind",
26
+ "typescript"
27
+ ],
28
+ "license": "Apache-2.0",
29
+ "type": "module",
30
+ "main": "./dist/index.js",
31
+ "module": "./dist/index.js",
32
+ "types": "./dist/index.d.ts",
33
+ "react-native": "./src/index.native.ts",
34
+ "exports": {
35
+ ".": {
36
+ "react-native": {
37
+ "types": "./dist/index.native.d.ts",
38
+ "default": "./dist/index.native.js"
39
+ },
40
+ "types": "./dist/index.d.ts",
41
+ "import": "./dist/index.js",
42
+ "default": "./dist/index.js"
43
+ }
44
+ },
45
+ "publishConfig": {
46
+ "provenance": true
47
+ },
48
+ "files": [
49
+ "dist",
50
+ "src/index.ts",
51
+ "src/index.native.ts",
52
+ "src/shared",
53
+ "src/web",
54
+ "src/native",
55
+ "!src/**/*.test.ts",
56
+ "!src/**/*.test.tsx",
57
+ "LICENSE",
58
+ "NOTICE"
59
+ ],
60
+ "dependencies": {
61
+ "@asheeui/native": "^2.3.0",
62
+ "@asheeui/core": "^2.2.0",
63
+ "@asheeui/web": "^2.3.0"
64
+ },
65
+ "peerDependencies": {
66
+ "@puckeditor/core": "^0.23.0",
67
+ "nativewind": ">=4.2.0",
68
+ "react": "^18.0.0 || ^19.0.0",
69
+ "react-dom": "^18.0.0 || ^19.0.0",
70
+ "react-native": ">=0.78.0",
71
+ "tailwindcss": ">=4.0.0"
72
+ },
73
+ "peerDependenciesMeta": {
74
+ "@puckeditor/core": {
75
+ "optional": true
76
+ },
77
+ "nativewind": {
78
+ "optional": true
79
+ },
80
+ "react-dom": {
81
+ "optional": true
82
+ },
83
+ "react-native": {
84
+ "optional": true
85
+ },
86
+ "tailwindcss": {
87
+ "optional": true
88
+ }
89
+ },
90
+ "devDependencies": {
91
+ "@babel/core": "^7.28.5",
92
+ "@babel/runtime": "^7.29.7",
93
+ "@puckeditor/core": "^0.23.0",
94
+ "@react-native/babel-preset": "^0.86.3",
95
+ "@react-native/jest-preset": "^0.86.3",
96
+ "@testing-library/jest-dom": "^7.0.1",
97
+ "@testing-library/react": "^16.3.3",
98
+ "@testing-library/react-native": "^14.0.1",
99
+ "@types/jest": "^30.0.0",
100
+ "@types/node": "^26.5.0",
101
+ "@types/react": "^19.3.0",
102
+ "@types/react-dom": "^19.3.0",
103
+ "@vitejs/plugin-react": "^6.1.1",
104
+ "babel-jest": "^30.2.0",
105
+ "jest": "^30.2.0",
106
+ "jsdom": "^30.0.1",
107
+ "nativewind": "^4.2.7",
108
+ "react": "^19.3.0",
109
+ "react-dom": "^19.3.0",
110
+ "react-native": "0.86.3",
111
+ "tailwindcss": "^4.3.3",
112
+ "typescript": "^7.0.2",
113
+ "vitest": "^5.0.0"
114
+ },
115
+ "scripts": {
116
+ "build": "tsc -p tsconfig.build.json",
117
+ "test": "vitest run && jest",
118
+ "test:web": "vitest run",
119
+ "test:native": "jest",
120
+ "test:watch": "vitest"
121
+ }
6
122
  }
@@ -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
+
22
+ export * from "./native";
package/src/index.ts ADDED
@@ -0,0 +1,24 @@
1
+ "use client";
2
+
3
+ /**
4
+ * The AsheeUI Puck integration.
5
+ *
6
+ * One import, two renderers. An application installs `@asheeui/puck` and writes the same
7
+ * specifiers whether it runs in a browser or on a device; the resolver decides which half
8
+ * answers:
9
+ *
10
+ * - On the web, it reads `main` (and the `import` condition) and reaches this file,
11
+ * which is the editor's block registry, the editor's page renderer and the shared
12
+ * specs behind them.
13
+ * - Under Expo and Metro, it reads the manifest's `react-native` field, then the
14
+ * `react-native` condition of the exports map, and finally Metro's platform extension
15
+ * (`.native.ts` beside `.ts`), and reaches `./index.native`, which renders a stored
16
+ * page with the native components.
17
+ *
18
+ * The routing is a property of the file name and the manifest rather than of a runtime
19
+ * check, which is what keeps a browser bundle free of React Native and a device bundle
20
+ * free of the DOM edition of the framework. This module is the web branch, and it
21
+ * imports no native renderer.
22
+ */
23
+
24
+ export * from "./web";
@@ -0,0 +1,55 @@
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 `Text` rather than a class on a paragraph element, so the shared
8
+ * alignment vocabulary is what reaches the component.
9
+ */
10
+
11
+ import { SECTION_BLOCK_TEXT_ALIGN } from "@asheeui/core";
12
+ import { Container, Section, Text } from "@asheeui/native";
13
+ import { SectionHeading } from "@asheeui/native/section-kit";
14
+ import type {
15
+ AsheeBlock,
16
+ HeadingBlockProps,
17
+ TextBlockProps,
18
+ } from "../../shared";
19
+ import { HEADING_SPEC, TEXT_SPEC } from "../../shared";
20
+
21
+ /**
22
+ * A section heading with an optional eyebrow and description.
23
+ */
24
+ export const headingBlock: AsheeBlock<HeadingBlockProps> = {
25
+ ...HEADING_SPEC,
26
+ render: ({ eyebrow, title, description, align }) => (
27
+ <Section spacing="md">
28
+ <Container>
29
+ <SectionHeading
30
+ eyebrow={eyebrow || undefined}
31
+ title={title || undefined}
32
+ description={description || undefined}
33
+ align={align ?? "start"}
34
+ size="lg"
35
+ />
36
+ </Container>
37
+ </Section>
38
+ ),
39
+ };
40
+
41
+ /**
42
+ * A paragraph of body text.
43
+ */
44
+ export const textBlock: AsheeBlock<TextBlockProps> = {
45
+ ...TEXT_SPEC,
46
+ render: ({ text, align }) => (
47
+ <Section spacing="sm">
48
+ <Container>
49
+ <Text role="body-lg" align={SECTION_BLOCK_TEXT_ALIGN[align ?? "start"]}>
50
+ {text}
51
+ </Text>
52
+ </Container>
53
+ </Section>
54
+ ),
55
+ };
@@ -0,0 +1,72 @@
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
+
17
+ import { Container, Grid, Section } from "@asheeui/native";
18
+ import type { ReactNode } from "react";
19
+ import type {
20
+ AsheeBlock,
21
+ ColumnsBandProps,
22
+ SectionBandProps,
23
+ } from "../../shared";
24
+ import { COLUMNS_SPEC, SECTION_SPEC } from "../../shared";
25
+
26
+ /**
27
+ * The props of the band block.
28
+ */
29
+ export type SectionBlockProps = SectionBandProps & {
30
+ /** Content dropped into the band, already rendered. */
31
+ content?: ReactNode;
32
+ };
33
+
34
+ /**
35
+ * A band with its own vertical rhythm and background.
36
+ */
37
+ export const sectionBlock: AsheeBlock<SectionBlockProps> = {
38
+ ...SECTION_SPEC,
39
+ render: ({ spacing, background, content }) => (
40
+ <Section spacing={spacing ?? "lg"} background={background ?? "none"}>
41
+ <Container>{content}</Container>
42
+ </Section>
43
+ ),
44
+ };
45
+
46
+ /**
47
+ * The props of the two-column block.
48
+ */
49
+ export type ColumnsBlockProps = ColumnsBandProps & {
50
+ /** Content of the first column, already rendered. */
51
+ start?: ReactNode;
52
+
53
+ /** Content of the second column, already rendered. */
54
+ end?: ReactNode;
55
+ };
56
+
57
+ /**
58
+ * Two columns that stack on a narrow screen.
59
+ */
60
+ export const columnsBlock: AsheeBlock<ColumnsBlockProps> = {
61
+ ...COLUMNS_SPEC,
62
+ render: ({ spacing, start, end }) => (
63
+ <Section spacing={spacing ?? "lg"}>
64
+ <Container>
65
+ <Grid columns={1} columnsLg={2} gap="lg">
66
+ {start}
67
+ {end}
68
+ </Grid>
69
+ </Container>
70
+ </Section>
71
+ ),
72
+ };
@@ -0,0 +1,71 @@
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
+
11
+ import { Footer, Navbar } from "@asheeui/native";
12
+ import { ActionGroup } from "@asheeui/native/section-kit";
13
+ import type {
14
+ AsheeBlock,
15
+ FooterBlockProps,
16
+ NavbarBlockProps,
17
+ } from "../../shared";
18
+ import { FOOTER_SPEC, NAVBAR_SPEC, toAction } from "../../shared";
19
+
20
+ /**
21
+ * The navigation bar of a page.
22
+ */
23
+ export const navbarBlock: AsheeBlock<NavbarBlockProps> = {
24
+ ...NAVBAR_SPEC,
25
+ render: ({
26
+ brand,
27
+ brandHref,
28
+ align,
29
+ links,
30
+ primaryAction,
31
+ secondaryAction,
32
+ }) => (
33
+ <Navbar
34
+ brand={brand || undefined}
35
+ brandHref={brandHref || undefined}
36
+ align={align ?? "center"}
37
+ links={(links ?? []).map((link) => ({
38
+ label: link.label ?? "",
39
+ href: link.href,
40
+ }))}
41
+ actions={
42
+ <ActionGroup
43
+ primaryAction={toAction(primaryAction)}
44
+ secondaryAction={toAction(secondaryAction)}
45
+ />
46
+ }
47
+ />
48
+ ),
49
+ };
50
+
51
+ /**
52
+ * The footer of a page.
53
+ */
54
+ export const footerBlock: AsheeBlock<FooterBlockProps> = {
55
+ ...FOOTER_SPEC,
56
+ render: ({ brand, description, groups, copyright }) => (
57
+ <Footer
58
+ brand={brand || undefined}
59
+ description={description || undefined}
60
+ copyright={copyright || undefined}
61
+ groups={(groups ?? []).map((group, index) => ({
62
+ id: index,
63
+ title: group.title ?? "Links",
64
+ links: (group.links ?? []).map((item) => ({
65
+ label: item.label ?? "",
66
+ href: item.href,
67
+ })),
68
+ }))}
69
+ />
70
+ ),
71
+ };