@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,38 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * The platform navigation blocks.
4
+ *
5
+ * A bar and a footer, with the navigation as data: link lists a non-developer can edit
6
+ * and no application state. The bar's action region is the framework's own action group,
7
+ * so a configured action renders exactly as a hand-written button does and follows the
8
+ * destination through the platform's own URL handler. The fields and the defaults come
9
+ * from `src/shared`.
10
+ */
11
+ import { Footer, Navbar } from "@asheeui/native";
12
+ import { ActionGroup } from "@asheeui/native/section-kit";
13
+ import { FOOTER_SPEC, NAVBAR_SPEC, toAction } from "../../shared";
14
+ /**
15
+ * The navigation bar of a page.
16
+ */
17
+ export const navbarBlock = {
18
+ ...NAVBAR_SPEC,
19
+ render: ({ brand, brandHref, align, links, primaryAction, secondaryAction, }) => (_jsx(Navbar, { brand: brand || undefined, brandHref: brandHref || undefined, align: align ?? "center", links: (links ?? []).map((link) => ({
20
+ label: link.label ?? "",
21
+ href: link.href,
22
+ })), actions: _jsx(ActionGroup, { primaryAction: toAction(primaryAction), secondaryAction: toAction(secondaryAction) }) })),
23
+ };
24
+ /**
25
+ * The footer of a page.
26
+ */
27
+ export const footerBlock = {
28
+ ...FOOTER_SPEC,
29
+ render: ({ brand, description, groups, copyright }) => (_jsx(Footer, { brand: brand || undefined, description: description || undefined, copyright: copyright || undefined, groups: (groups ?? []).map((group, index) => ({
30
+ id: index,
31
+ title: group.title ?? "Links",
32
+ links: (group.links ?? []).map((item) => ({
33
+ label: item.label ?? "",
34
+ href: item.href,
35
+ })),
36
+ })) })),
37
+ };
38
+ //# sourceMappingURL=navigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../../src/native/blocks/navigation.tsx"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAM1D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAElE;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAiC;IACvD,GAAG,WAAW;IACd,MAAM,EAAE,CAAC,EACP,KAAK,EACL,SAAS,EACT,KAAK,EACL,KAAK,EACL,aAAa,EACb,eAAe,GAChB,EAAE,EAAE,CAAC,CACJ,KAAC,MAAM,IACL,KAAK,EAAE,KAAK,IAAI,SAAS,EACzB,SAAS,EAAE,SAAS,IAAI,SAAS,EACjC,KAAK,EAAE,KAAK,IAAI,QAAQ,EACxB,KAAK,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAClC,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,EAAE;YACvB,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC,CAAC,EACH,OAAO,EACL,KAAC,WAAW,IACV,aAAa,EAAE,QAAQ,CAAC,aAAa,CAAC,EACtC,eAAe,EAAE,QAAQ,CAAC,eAAe,CAAC,GAC1C,GAEJ,CACH;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAiC;IACvD,GAAG,WAAW;IACd,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CACrD,KAAC,MAAM,IACL,KAAK,EAAE,KAAK,IAAI,SAAS,EACzB,WAAW,EAAE,WAAW,IAAI,SAAS,EACrC,SAAS,EAAE,SAAS,IAAI,SAAS,EACjC,MAAM,EAAE,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;YAC5C,EAAE,EAAE,KAAK;YACT,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,OAAO;YAC7B,KAAK,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;gBACxC,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,EAAE;gBACvB,IAAI,EAAE,IAAI,CAAC,IAAI;aAChB,CAAC,CAAC;SACJ,CAAC,CAAC,GACH,CACH;CACF,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * The platform marketing section blocks.
3
+ *
4
+ * Each one is a thin adapter over the framework component of the same name, so the
5
+ * builder edits the component's own props rather than a parallel model of them — and it
6
+ * edits them once, for both platforms: the label, the fields and the defaults come from
7
+ * `src/shared`, and what is written here is only how the component is drawn on a device.
8
+ */
9
+ import type { AsheeBlock, CtaBlockProps, FeatureGridBlockProps, HeroBlockProps, PricingCardBlockProps, TestimonialsBlockProps } from "../../shared";
10
+ /**
11
+ * The leading statement of a page.
12
+ */
13
+ export declare const heroBlock: AsheeBlock<HeroBlockProps>;
14
+ /**
15
+ * The closing call to action of a page.
16
+ */
17
+ export declare const ctaBlock: AsheeBlock<CtaBlockProps>;
18
+ /**
19
+ * A band of features laid out in a responsive grid.
20
+ */
21
+ export declare const featureGridBlock: AsheeBlock<FeatureGridBlockProps>;
22
+ /**
23
+ * A band of attributed customer quotes.
24
+ */
25
+ export declare const testimonialsBlock: AsheeBlock<TestimonialsBlockProps>;
26
+ /**
27
+ * One plan in a pricing table.
28
+ */
29
+ export declare const pricingCardBlock: AsheeBlock<PricingCardBlockProps>;
30
+ //# sourceMappingURL=sections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sections.d.ts","sourceRoot":"","sources":["../../../src/native/blocks/sections.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AASH,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EACb,qBAAqB,EACrB,cAAc,EACd,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,cAAc,CAAC;AAWtB;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,UAAU,CAAC,cAAc,CAuBhD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,UAAU,CAAC,aAAa,CAuB9C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,UAAU,CAAC,qBAAqB,CA2B9D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,UAAU,CAAC,sBAAsB,CAgBhE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,UAAU,CAAC,qBAAqB,CA2B9D,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * The platform marketing section blocks.
4
+ *
5
+ * Each one is a thin adapter over the framework component of the same name, so the
6
+ * builder edits the component's own props rather than a parallel model of them — and it
7
+ * edits them once, for both platforms: the label, the fields and the defaults come from
8
+ * `src/shared`, and what is written here is only how the component is drawn on a device.
9
+ */
10
+ import { CTA, FeatureGrid, Hero, PricingCard, Testimonials, } from "@asheeui/native";
11
+ import { CTA_SPEC, FEATURE_GRID_SPEC, HERO_SPEC, PRICING_CARD_SPEC, TESTIMONIALS_SPEC, toAction, toColumns, } from "../../shared";
12
+ /**
13
+ * The leading statement of a page.
14
+ */
15
+ export const heroBlock = {
16
+ ...HERO_SPEC,
17
+ render: ({ eyebrow, title, description, primaryAction, secondaryAction, align, background, contentWidth, }) => (_jsx(Hero, { eyebrow: eyebrow || undefined, title: title ?? "", description: description || undefined, primaryAction: toAction(primaryAction), secondaryAction: toAction(secondaryAction), align: align ?? "start", background: background ?? "none", containerSize: contentWidth ?? "lg" })),
18
+ };
19
+ /**
20
+ * The closing call to action of a page.
21
+ */
22
+ export const ctaBlock = {
23
+ ...CTA_SPEC,
24
+ render: ({ eyebrow, title, description, primaryAction, secondaryAction, align, background, panel, }) => (_jsx(CTA, { eyebrow: eyebrow || undefined, title: title ?? "", description: description || undefined, primaryAction: toAction(primaryAction), secondaryAction: toAction(secondaryAction), align: align ?? "center", background: background ?? "none", panel: panel ?? "bordered" })),
25
+ };
26
+ /**
27
+ * A band of features laid out in a responsive grid.
28
+ */
29
+ export const featureGridBlock = {
30
+ ...FEATURE_GRID_SPEC,
31
+ render: ({ eyebrow, title, description, items, columnsMd, columnsLg, align, background, }) => (_jsx(FeatureGrid, { eyebrow: eyebrow || undefined, title: title || undefined, description: description || undefined, align: align ?? "center", background: background ?? "none", columnsMd: toColumns(columnsMd), columnsLg: toColumns(columnsLg), items: (items ?? []).map((item, index) => ({
32
+ id: index,
33
+ title: item.title ?? "",
34
+ description: item.description || undefined,
35
+ })) })),
36
+ };
37
+ /**
38
+ * A band of attributed customer quotes.
39
+ */
40
+ export const testimonialsBlock = {
41
+ ...TESTIMONIALS_SPEC,
42
+ render: ({ eyebrow, title, description, items, align }) => (_jsx(Testimonials, { eyebrow: eyebrow || undefined, title: title || undefined, description: description || undefined, align: align ?? "center", items: (items ?? []).map((item, index) => ({
43
+ id: index,
44
+ quote: item.quote ?? "",
45
+ name: item.name ?? "",
46
+ role: item.role || undefined,
47
+ })) })),
48
+ };
49
+ /**
50
+ * One plan in a pricing table.
51
+ */
52
+ export const pricingCardBlock = {
53
+ ...PRICING_CARD_SPEC,
54
+ render: ({ badge, name, price, period, description, features, highlighted, primaryAction, }) => (_jsx(PricingCard, { badge: badge || undefined, name: name ?? "", price: price ?? "", period: period || undefined, description: description || undefined, highlighted: highlighted ?? false, features: (features ?? []).map((feature, index) => ({
55
+ id: index,
56
+ label: feature.label ?? "",
57
+ included: feature.included !== false,
58
+ })), primaryAction: toAction(primaryAction) })),
59
+ };
60
+ //# sourceMappingURL=sections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sections.js","sourceRoot":"","sources":["../../../src/native/blocks/sections.tsx"],"names":[],"mappings":";AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,GAAG,EACH,WAAW,EACX,IAAI,EACJ,WAAW,EACX,YAAY,GACb,MAAM,iBAAiB,CAAC;AASzB,OAAO,EACL,QAAQ,EACR,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,iBAAiB,EACjB,QAAQ,EACR,SAAS,GACV,MAAM,cAAc,CAAC;AAEtB;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAA+B;IACnD,GAAG,SAAS;IACZ,MAAM,EAAE,CAAC,EACP,OAAO,EACP,KAAK,EACL,WAAW,EACX,aAAa,EACb,eAAe,EACf,KAAK,EACL,UAAU,EACV,YAAY,GACb,EAAE,EAAE,CAAC,CACJ,KAAC,IAAI,IACH,OAAO,EAAE,OAAO,IAAI,SAAS,EAC7B,KAAK,EAAE,KAAK,IAA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AW,IACV,KAAK,EAAE,KAAK,IAAI,SAAS,EACzB,IAAI,EAAE,IAAI,IAAI,EAAE,EAChB,KAAK,EAAE,KAAK,IAAI,EAAE,EAClB,MAAM,EAAE,MAAM,IAAI,SAAS,EAC3B,WAAW,EAAE,WAAW,IAAI,SAAS,EACrC,WAAW,EAAE,WAAW,IAAI,KAAK,EACjC,QAAQ,EAAE,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;YAClD,EAAE,EAAE,KAAK;YACT,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,EAAE;YAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ,KAAK,KAAK;SACrC,CAAC,CAAC,EACH,aAAa,EAAE,QAAQ,CAAC,aAAa,CAAC,GACtC,CACH;CACF,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The platform utility blocks.
3
+ *
4
+ * The empty state is the one utility block a marketing or application page needs from a
5
+ * builder: a region that has nothing in it yet, which a non-developer can word and
6
+ * justify without touching code. The fields and the defaults come from `src/shared`.
7
+ */
8
+ import type { AsheeBlock, EmptyStateBlockProps } from "../../shared";
9
+ /**
10
+ * A region with nothing in it.
11
+ */
12
+ export declare const emptyStateBlock: AsheeBlock<EmptyStateBlockProps>;
13
+ //# sourceMappingURL=utility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utility.d.ts","sourceRoot":"","sources":["../../../src/native/blocks/utility.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGrE;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,UAAU,CAAC,oBAAoB,CAW5D,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * The platform utility blocks.
4
+ *
5
+ * The empty state is the one utility block a marketing or application page needs from a
6
+ * builder: a region that has nothing in it yet, which a non-developer can word and
7
+ * justify without touching code. The fields and the defaults come from `src/shared`.
8
+ */
9
+ import { EmptyState } from "@asheeui/native";
10
+ import { EMPTY_STATE_SPEC, toAction } from "../../shared";
11
+ /**
12
+ * A region with nothing in it.
13
+ */
14
+ export const emptyStateBlock = {
15
+ ...EMPTY_STATE_SPEC,
16
+ render: ({ title, description, type, panel, primaryAction }) => (_jsx(EmptyState, { title: title ?? "", description: description || undefined, type: type ?? "info", panel: panel ?? false, primaryAction: toAction(primaryAction) })),
17
+ };
18
+ //# sourceMappingURL=utility.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utility.js","sourceRoot":"","sources":["../../../src/native/blocks/utility.tsx"],"names":[],"mappings":";AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE1D;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAqC;IAC/D,GAAG,gBAAgB;IACnB,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,CAC9D,KAAC,UAAU,IACT,KAAK,EAAE,KAAK,IAAI,EAAE,EAClB,WAAW,EAAE,WAAW,IAAI,SAAS,EACrC,IAAI,EAAE,IAAI,IAAI,MAAM,EACpB,KAAK,EAAE,KAAK,IAAI,KAAK,EACrB,aAAa,EAAE,QAAQ,CAAC,aAAa,CAAC,GACtC,CACH;CACF,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The AsheeUI registry, on the platform.
3
+ *
4
+ * The native twin of the web configuration: every block a stored page can name, the
5
+ * categories they are filed under, and the page shell a stored page renders into. It
6
+ * exists so that a device renders the page the editor composed — not a second page
7
+ * model of it — and so that adding a block is one addition in `src/shared` plus one
8
+ * drawing per platform.
9
+ *
10
+ * The category map and the block labels come from `src/shared`, which is what keeps the
11
+ * two registries honest: neither can offer a category the other does not, and neither
12
+ * can offer a block the other has not.
13
+ */
14
+ import type { AsheeNativePuckConfig } from "../shared";
15
+ /**
16
+ * The native registry a stored page is rendered with.
17
+ */
18
+ export declare const asheeNativePuckConfig: AsheeNativePuckConfig;
19
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/native/config.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAuCvD;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,qBASnC,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { PUCK_CATEGORIES } from "../shared";
3
+ import { headingBlock, textBlock } from "./blocks/content";
4
+ import { columnsBlock, sectionBlock } from "./blocks/layout";
5
+ import { footerBlock, navbarBlock } from "./blocks/navigation";
6
+ import { ctaBlock, featureGridBlock, heroBlock, pricingCardBlock, testimonialsBlock, } from "./blocks/sections";
7
+ import { emptyStateBlock } from "./blocks/utility";
8
+ import { PuckRoot } from "./root";
9
+ /**
10
+ * The blocks a stored page can name.
11
+ *
12
+ * The assertion is deliberate and it is the one place this package asserts rather than
13
+ * checks: a registry holds blocks of different props, so the collection's type is the
14
+ * open one, while each entry keeps its own type where it is declared. The package's own
15
+ * tests assert the two properties that matter here — that every block in the registry
16
+ * renders, and that the category map names exactly the blocks that exist.
17
+ */
18
+ const components = {
19
+ Section: sectionBlock,
20
+ Columns: columnsBlock,
21
+ Heading: headingBlock,
22
+ Text: textBlock,
23
+ Navbar: navbarBlock,
24
+ Footer: footerBlock,
25
+ Hero: heroBlock,
26
+ CTA: ctaBlock,
27
+ FeatureGrid: featureGridBlock,
28
+ Testimonials: testimonialsBlock,
29
+ PricingCard: pricingCardBlock,
30
+ EmptyState: emptyStateBlock,
31
+ };
32
+ /**
33
+ * The native registry a stored page is rendered with.
34
+ */
35
+ export const asheeNativePuckConfig = {
36
+ components,
37
+ categories: PUCK_CATEGORIES,
38
+ root: {
39
+ label: "Page",
40
+ fields: {},
41
+ defaultProps: {},
42
+ render: ({ children }) => _jsx(PuckRoot, { children: children }),
43
+ },
44
+ };
45
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/native/config.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC7D,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;AAElC;;;;;;;;GAQG;AACH,MAAM,UAAU,GAAG;IACjB,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,YAAY;IACrB,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,WAAW;IACnB,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,QAAQ;IACb,WAAW,EAAE,gBAAgB;IAC7B,YAAY,EAAE,iBAAiB;IAC/B,WAAW,EAAE,gBAAgB;IAC7B,UAAU,EAAE,eAAe;CACsB,CAAC;AAEpD;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAA0B;IAC1D,UAAU;IACV,UAAU,EAAE,eAAe;IAC3B,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM;QACb,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,18 @@
1
+ /**
2
+ * The platform half of the Puck integration.
3
+ *
4
+ * It is the shared layer plus this platform's drawings, and the renderer that turns a
5
+ * stored page into a screen. Nothing here imports React DOM, Tailwind or the editor: a
6
+ * device reaches this file without loading a single byte of the web edition, which is
7
+ * the property the whole split exists for.
8
+ */
9
+ export * from "../shared";
10
+ export * from "./blocks/content";
11
+ export * from "./blocks/layout";
12
+ export * from "./blocks/navigation";
13
+ export * from "./blocks/sections";
14
+ export * from "./blocks/utility";
15
+ export * from "./config";
16
+ export * from "./render";
17
+ export * from "./root";
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/native/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;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,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The platform half of the Puck integration.
3
+ *
4
+ * It is the shared layer plus this platform's drawings, and the renderer that turns a
5
+ * stored page into a screen. Nothing here imports React DOM, Tailwind or the editor: a
6
+ * device reaches this file without loading a single byte of the web edition, which is
7
+ * the property the whole split exists for.
8
+ */
9
+ export * from "../shared";
10
+ export * from "./blocks/content";
11
+ export * from "./blocks/layout";
12
+ export * from "./blocks/navigation";
13
+ export * from "./blocks/sections";
14
+ export * from "./blocks/utility";
15
+ export * from "./config";
16
+ export * from "./render";
17
+ export * from "./root";
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/native/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;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,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Rendering a stored page, on the platform.
3
+ *
4
+ * A device has no editor, so what it needs from a published document is a renderer:
5
+ * walk the blocks the editor stored, resolve each drop zone into the nodes that belong
6
+ * there, and draw each block through the registry the two platforms share. That is all
7
+ * this is — the platform's counterpart of the editor's own `Render`, which is why the
8
+ * two entries export a component of the same name and an application calls one.
9
+ *
10
+ * Two properties are worth stating. A block the registry does not know is dropped rather
11
+ * than thrown on, because a page saved by a newer editor should not crash an older
12
+ * application. And a key the document omits resolves to the block's default value, so a
13
+ * partial payload — a page saved before a field existed — renders the same way the
14
+ * editor would have shown it.
15
+ */
16
+ import { type ReactNode } from "react";
17
+ import type { AsheeNativePuckConfig, AsheePuckData } from "../shared";
18
+ /**
19
+ * Props of {@link PuckPage}.
20
+ */
21
+ export interface PuckPageProps {
22
+ /** The page the builder published. */
23
+ data: AsheePuckData;
24
+ /** The registry to render it with. Defaults to the AsheeUI configuration. */
25
+ config?: AsheeNativePuckConfig;
26
+ }
27
+ /**
28
+ * Render a stored page.
29
+ *
30
+ * @param props - The stored page, and optionally the registry to render it with.
31
+ * @returns The rendered page.
32
+ *
33
+ * @example
34
+ * ```tsx
35
+ * <PuckPage data={page} />
36
+ * ```
37
+ */
38
+ export declare function PuckPage({ data, config, }: PuckPageProps): ReactNode;
39
+ //# sourceMappingURL=render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/native/render.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,KAAK,EAEV,qBAAqB,EAErB,aAAa,EACd,MAAM,WAAW,CAAC;AA6DnB;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,sCAAsC;IACtC,IAAI,EAAE,aAAa,CAAC;IAEpB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,qBAAqB,CAAC;CAChC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,MAA8B,GAC/B,EAAE,aAAa,GAAG,SAAS,CAI3B"}
@@ -0,0 +1,71 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * Rendering a stored page, on the platform.
4
+ *
5
+ * A device has no editor, so what it needs from a published document is a renderer:
6
+ * walk the blocks the editor stored, resolve each drop zone into the nodes that belong
7
+ * there, and draw each block through the registry the two platforms share. That is all
8
+ * this is — the platform's counterpart of the editor's own `Render`, which is why the
9
+ * two entries export a component of the same name and an application calls one.
10
+ *
11
+ * Two properties are worth stating. A block the registry does not know is dropped rather
12
+ * than thrown on, because a page saved by a newer editor should not crash an older
13
+ * application. And a key the document omits resolves to the block's default value, so a
14
+ * partial payload — a page saved before a field existed — renders the same way the
15
+ * editor would have shown it.
16
+ */
17
+ import { Fragment } from "react";
18
+ import { asheeNativePuckConfig } from "./config";
19
+ /**
20
+ * Render a list of blocks.
21
+ *
22
+ * @param content - The blocks, in order.
23
+ * @param config - The registry to render them with.
24
+ * @param keyPrefix - A prefix that keeps a nested block's key unique among its siblings.
25
+ * @returns The rendered blocks.
26
+ */
27
+ function renderBlocks(content, config, keyPrefix) {
28
+ return content.map((item, index) => renderBlock(item, config, `${keyPrefix}-${index}`));
29
+ }
30
+ /**
31
+ * Render one block, resolving its drop zones first.
32
+ *
33
+ * @param item - The block as the document stored it.
34
+ * @param config - The registry to render it with.
35
+ * @param key - A key unique among the block's siblings.
36
+ * @returns The rendered block, or null when the registry does not know its type.
37
+ */
38
+ function renderBlock(item, config, key) {
39
+ const block = config.components[item.type];
40
+ if (!block)
41
+ return null;
42
+ const props = {
43
+ ...block.defaultProps,
44
+ ...item.props,
45
+ };
46
+ // A drop zone's children are stored under the zone's own key, so the fields are what
47
+ // says which keys hold blocks rather than values.
48
+ for (const [name, field] of Object.entries(block.fields ?? {})) {
49
+ if (field?.type !== "slot")
50
+ continue;
51
+ const children = item.props?.[name];
52
+ props[name] = renderBlocks(Array.isArray(children) ? children : [], config, `${key}-${name}`);
53
+ }
54
+ return _jsx(Fragment, { children: block.render(props) }, key);
55
+ }
56
+ /**
57
+ * Render a stored page.
58
+ *
59
+ * @param props - The stored page, and optionally the registry to render it with.
60
+ * @returns The rendered page.
61
+ *
62
+ * @example
63
+ * ```tsx
64
+ * <PuckPage data={page} />
65
+ * ```
66
+ */
67
+ export function PuckPage({ data, config = asheeNativePuckConfig, }) {
68
+ const children = renderBlocks(data.content ?? [], config, "root");
69
+ return config.root.render({ children });
70
+ }
71
+ //# sourceMappingURL=render.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/native/render.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAOjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEjD;;;;;;;GAOG;AACH,SAAS,YAAY,CACnB,OAA6B,EAC7B,MAA6B,EAC7B,SAAiB;IAEjB,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CACjC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,IAAI,KAAK,EAAE,C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 @@
1
+ /**
2
+ * The page shell a stored page renders into, on the platform.
3
+ *
4
+ * A block resolves its theme through the framework provider, so the shell supplies one
5
+ * when the application has not. An existing provider is respected rather than nested, so
6
+ * an application's own configuration keeps applying to a built page — a second provider
7
+ * would replace the resolved configuration with the framework's own defaults.
8
+ *
9
+ * The shell is the platform's own view rather than a re-implementation of the web's
10
+ * `<div>`: a page fills the screen it is drawn in, and the background it paints is the
11
+ * framework's background role.
12
+ */
13
+ import type { AsheePuckRootProps } from "../shared";
14
+ /**
15
+ * The published page's root.
16
+ *
17
+ * @param props - The page the builder composed.
18
+ * @returns The page, inside the framework's provider when the application has none.
19
+ */
20
+ export declare function PuckRoot({ children }: AsheePuckRootProps): import("react").JSX.Element;
21
+ //# sourceMappingURL=root.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../src/native/root.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE,kBAAkB,+BAUxD"}
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * The page shell a stored page renders into, on the platform.
4
+ *
5
+ * A block resolves its theme through the framework provider, so the shell supplies one
6
+ * when the application has not. An existing provider is respected rather than nested, so
7
+ * an application's own configuration keeps applying to a built page — a second provider
8
+ * would replace the resolved configuration with the framework's own defaults.
9
+ *
10
+ * The shell is the platform's own view rather than a re-implementation of the web's
11
+ * `<div>`: a page fills the screen it is drawn in, and the background it paints is the
12
+ * framework's background role.
13
+ */
14
+ import { AsheeNativeConfigContext, AsheeNativeProvider } from "@asheeui/native";
15
+ import { useContext } from "react";
16
+ import { View } from "react-native";
17
+ /**
18
+ * The published page's root.
19
+ *
20
+ * @param props - The page the builder composed.
21
+ * @returns The page, inside the framework's provider when the application has none.
22
+ */
23
+ export function PuckRoot({ children }) {
24
+ const existingConfig = useContext(AsheeNativeConfigContext);
25
+ const page = _jsx(View, { className: "bg-background flex-1 w-full", children: children });
26
+ return existingConfig ? (page) : (_jsx(AsheeNativeProvider, { children: page }));
27
+ }
28
+ //# sourceMappingURL=root.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root.js","sourceRoot":"","sources":["../../src/native/root.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,QAAQ,EAAsB;IACvD,MAAM,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC,CAAC;IAE5D,MAAM,IAAI,GAAG,KAAC,IAAI,IAAC,SAAS,EAAC,6BAA6B,YAAE,QAAQ,GAAQ,CAAC;IAE7E,OAAO,cAAc,CAAC,CAAC,CAAC,CACtB,IAAI,CACL,CAAC,CAAC,CAAC,CACF,KAAC,mBAAmB,cAAE,IAAI,GAAuB,CAClD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Adapters between builder values and framework props.
3
+ *
4
+ * A builder holds plain strings, because that is what a form control produces. The
5
+ * framework's props are unions of named tokens. These adapters are the single place
6
+ * where one becomes the other, so a block's render function stays a mapping of names
7
+ * rather than a parsing exercise, and a value that is not accepted by the component
8
+ * resolves to undefined rather than to a wrong class.
9
+ *
10
+ * Both renderers use them, which is why they live with the specs rather than with
11
+ * either platform: a value the web accepts and the platform rejects would be two
12
+ * different pages built from one document.
13
+ */
14
+ import type { GridColumns } from "@asheeui/core";
15
+ /**
16
+ * One action as a builder holds it.
17
+ *
18
+ * The keys are required because a field set is a form the builder fills in, and
19
+ * `defaultProps` supplies a complete value for every block that offers one. A
20
+ * published payload can still arrive with a key missing, which is why the adapter that
21
+ * reads it accepts a partial value.
22
+ */
23
+ export type BuilderAction = {
24
+ /** Wording of the action. */
25
+ label: string;
26
+ /** Destination of the action. */
27
+ href: string;
28
+ /** Emphasis of the action. */
29
+ variant: string;
30
+ };
31
+ /**
32
+ * Turn a builder action into a configured action.
33
+ *
34
+ * @param action - The action the builder holds, which may be missing a key when it
35
+ * comes from a stored page rather than from the editor.
36
+ * @returns The action the framework renders, or undefined when it has no wording,
37
+ * because an action without a name cannot be read or clicked.
38
+ */
39
+ export declare function toAction(action: Partial<BuilderAction> | undefined): {
40
+ label: string;
41
+ href: string | undefined;
42
+ variant: "bordered" | "faded" | "ghost" | "solid" | "underlined" | undefined;
43
+ } | undefined;
44
+ /**
45
+ * Turn a builder column count into a grid column count.
46
+ *
47
+ * @param value - The column count as a string, which is what a select field holds.
48
+ * @returns The numeric column count, or undefined when the value is not one the grid
49
+ * accepts.
50
+ */
51
+ export declare function toColumns(value: string | undefined): GridColumns | undefined;
52
+ //# sourceMappingURL=adapters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapters.d.ts","sourceRoot":"","sources":["../../src/shared/adapters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAW,MAAM,eAAe,CAAC;AAE1D;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IAEd,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IAEb,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAWF;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,SAAS;;;;cAalE;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAO5E"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Adapters between builder values and framework props.
3
+ *
4
+ * A builder holds plain strings, because that is what a form control produces. The
5
+ * framework's props are unions of named tokens. These adapters are the single place
6
+ * where one becomes the other, so a block's render function stays a mapping of names
7
+ * rather than a parsing exercise, and a value that is not accepted by the component
8
+ * resolves to undefined rather than to a wrong class.
9
+ *
10
+ * Both renderers use them, which is why they live with the specs rather than with
11
+ * either platform: a value the web accepts and the platform rejects would be two
12
+ * different pages built from one document.
13
+ */
14
+ /** The variants an action accepts, used to validate a builder value. */
15
+ const ACTION_VARIANTS = [
16
+ "solid",
17
+ "faded",
18
+ "bordered",
19
+ "ghost",
20
+ "underlined",
21
+ ];
22
+ /**
23
+ * Turn a builder action into a configured action.
24
+ *
25
+ * @param action - The action the builder holds, which may be missing a key when it
26
+ * comes from a stored page rather than from the editor.
27
+ * @returns The action the framework renders, or undefined when it has no wording,
28
+ * because an action without a name cannot be read or clicked.
29
+ */
30
+ export function toAction(action) {
31
+ if (!action?.label) {
32
+ return undefined;
33
+ }
34
+ return {
35
+ label: action.label,
36
+ href: action.href,
37
+ variant: action.variant && ACTION_VARIANTS.includes(action.variant)
38
+ ? action.variant
39
+ : undefined,
40
+ };
41
+ }
42
+ /**
43
+ * Turn a builder column count into a grid column count.
44
+ *
45
+ * @param value - The column count as a string, which is what a select field holds.
46
+ * @returns The numeric column count, or undefined when the value is not one the grid
47
+ * accepts.
48
+ */
49
+ export function toColumns(value) {
50
+ if (!value)
51
+ return undefined;
52
+ const parsed = Number(value);
53
+ if (![1, 2, 3, 4, 6, 12].includes(parsed))
54
+ return undefined;
55
+ return parsed;
56
+ }
57
+ //# sourceMappingURL=adapters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapters.js","sourceRoot":"","sources":["../../src/shared/adapters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAuBH,wEAAwE;AACxE,MAAM,eAAe,GAAsB;IACzC,OAAO;IACP,OAAO;IACP,UAAU;IACV,OAAO;IACP,YAAY;CACb,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CAAC,MAA0C;IACjE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC;QACnB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,OAAO,EACL,MAAM,CAAC,OAAO,IAAI,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC;YACxD,CAAC,CAAE,MAAM,CAAC,OAAmB;YAC7B,CAAC,CAAC,SAAS;KAChB,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,KAAyB;IACjD,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAE7B,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7B,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,SAAS,CAAC;IAE5D,OAAO,MAAqB,CAAC;AAC/B,CAAC"}