@drawbridge/components 0.1.12 → 0.1.14

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 (236) hide show
  1. package/components/styles.css +364 -2
  2. package/dist/advertisement.js +3 -1
  3. package/dist/advertisement.mjs +3 -1
  4. package/dist/bridge/advertisements.js +2 -0
  5. package/dist/bridge/advertisements.mjs +2 -0
  6. package/dist/bridge/countdown.js +2 -1
  7. package/dist/bridge/countdown.mjs +2 -1
  8. package/dist/bridge/form-subdomain-embed.js +18 -20
  9. package/dist/bridge/form-subdomain-embed.mjs +18 -20
  10. package/dist/bridge/form-subdomain-header.js +24 -1
  11. package/dist/bridge/form-subdomain-header.mjs +24 -1
  12. package/dist/bridge/form-subdomain-missions.js +538 -0
  13. package/dist/bridge/form-subdomain-missions.mjs +502 -0
  14. package/dist/bridge/form-subdomain.js +530 -220
  15. package/dist/bridge/form-subdomain.mjs +533 -222
  16. package/dist/bridge/lib/entry.js +59 -0
  17. package/dist/bridge/lib/entry.mjs +29 -0
  18. package/dist/bridge/lib/location.js +38 -0
  19. package/dist/bridge/lib/location.mjs +13 -0
  20. package/dist/bridge/lib/order.js +71 -0
  21. package/dist/bridge/lib/order.mjs +44 -0
  22. package/dist/bridge/lib/url.js +9 -0
  23. package/dist/bridge/lib/url.mjs +7 -0
  24. package/dist/bridge/share-button.js +5 -3
  25. package/dist/bridge/share-button.mjs +5 -3
  26. package/dist/bridge/subdomain-content.js +7 -6
  27. package/dist/bridge/subdomain-content.mjs +7 -6
  28. package/dist/bridge/template-layout.js +59 -21
  29. package/dist/bridge/template-layout.mjs +59 -21
  30. package/dist/bridge/template-modal.js +42 -76
  31. package/dist/bridge/template-modal.mjs +39 -73
  32. package/dist/bridge/template-preview.js +208 -0
  33. package/dist/bridge/template-preview.mjs +173 -0
  34. package/dist/bridge/template-subdomain-gallery.js +6 -2
  35. package/dist/bridge/template-subdomain-gallery.mjs +6 -2
  36. package/dist/bridge/template-subdomain-link.js +6 -1
  37. package/dist/bridge/template-subdomain-link.mjs +6 -1
  38. package/dist/bridge/template-subdomain.js +20 -15
  39. package/dist/bridge/template-subdomain.mjs +20 -15
  40. package/dist/dashboard/accordion.js +74 -39
  41. package/dist/dashboard/accordion.mjs +74 -39
  42. package/dist/dashboard/avatar.js +109 -3
  43. package/dist/dashboard/avatar.mjs +106 -4
  44. package/dist/dashboard/buttons-subscription.js +384 -0
  45. package/dist/dashboard/buttons-subscription.mjs +349 -0
  46. package/dist/dashboard/card-campaign-switch.js +265 -0
  47. package/dist/dashboard/card-campaign-switch.mjs +231 -0
  48. package/dist/dashboard/card-order.js +28 -11
  49. package/dist/dashboard/card-order.mjs +28 -11
  50. package/dist/dashboard/card-section.js +26 -2
  51. package/dist/dashboard/card-section.mjs +26 -2
  52. package/dist/dashboard/card-tile.js +6 -7
  53. package/dist/dashboard/card-tile.mjs +6 -7
  54. package/dist/dashboard/connection-workflows.js +196 -0
  55. package/dist/dashboard/connection-workflows.mjs +162 -0
  56. package/dist/dashboard/device.js +95 -0
  57. package/dist/dashboard/device.mjs +72 -0
  58. package/dist/dashboard/form-admin-campaign.js +19 -50
  59. package/dist/dashboard/form-admin-campaign.mjs +20 -51
  60. package/dist/dashboard/form-ai.js +9 -6
  61. package/dist/dashboard/form-ai.mjs +9 -6
  62. package/dist/dashboard/form-auth.js +35 -25
  63. package/dist/dashboard/form-auth.mjs +36 -26
  64. package/dist/dashboard/form-file.js +10 -1
  65. package/dist/dashboard/form-file.mjs +10 -1
  66. package/dist/dashboard/form-filters-analytics.js +14 -1
  67. package/dist/dashboard/form-filters-analytics.mjs +15 -2
  68. package/dist/dashboard/form-organization-campaign-advertisement.js +15 -1
  69. package/dist/dashboard/form-organization-campaign-advertisement.mjs +16 -2
  70. package/dist/dashboard/form-organization-campaign-agreement.js +215 -164
  71. package/dist/dashboard/form-organization-campaign-agreement.mjs +215 -164
  72. package/dist/dashboard/form-organization-campaign-field-email.js +0 -34
  73. package/dist/dashboard/form-organization-campaign-field-email.mjs +0 -34
  74. package/dist/dashboard/form-organization-campaign-field-list.js +466 -0
  75. package/dist/dashboard/form-organization-campaign-field-list.mjs +437 -0
  76. package/dist/dashboard/form-organization-campaign-field-phone.js +0 -34
  77. package/dist/dashboard/form-organization-campaign-field-phone.mjs +0 -34
  78. package/dist/dashboard/form-organization-campaign-field-remove.js +66 -0
  79. package/dist/dashboard/form-organization-campaign-field-remove.mjs +33 -0
  80. package/dist/dashboard/form-organization-campaign-integration-age.js +6 -12
  81. package/dist/dashboard/form-organization-campaign-integration-age.mjs +6 -12
  82. package/dist/dashboard/form-organization-campaign-integration-enable.js +52 -24
  83. package/dist/dashboard/form-organization-campaign-integration-enable.mjs +54 -26
  84. package/dist/dashboard/form-organization-campaign-integration-geocode.js +6 -12
  85. package/dist/dashboard/form-organization-campaign-integration-geocode.mjs +6 -12
  86. package/dist/dashboard/form-organization-campaign-integration-gtm.js +6 -12
  87. package/dist/dashboard/form-organization-campaign-integration-gtm.mjs +6 -12
  88. package/dist/dashboard/form-organization-campaign-link.js +7 -1
  89. package/dist/dashboard/form-organization-campaign-link.mjs +7 -1
  90. package/dist/dashboard/form-organization-campaign-mission.js +291 -0
  91. package/dist/dashboard/form-organization-campaign-mission.mjs +258 -0
  92. package/dist/dashboard/form-organization-campaign-page-embed.js +13 -2
  93. package/dist/dashboard/form-organization-campaign-page-embed.mjs +12 -1
  94. package/dist/dashboard/form-organization-campaign-page.js +20 -11
  95. package/dist/dashboard/form-organization-campaign-page.mjs +20 -11
  96. package/dist/dashboard/form-organization-campaign-prize-edit.js +12 -1
  97. package/dist/dashboard/form-organization-campaign-prize-edit.mjs +12 -1
  98. package/dist/dashboard/form-organization-campaign-section.js +223 -0
  99. package/dist/dashboard/form-organization-campaign-section.mjs +194 -0
  100. package/dist/dashboard/form-organization-campaign.js +114 -469
  101. package/dist/dashboard/form-organization-campaign.mjs +113 -467
  102. package/dist/dashboard/form-organization-export.js +4 -7
  103. package/dist/dashboard/form-organization-export.mjs +4 -7
  104. package/dist/dashboard/form-organization-identity.js +46 -51
  105. package/dist/dashboard/form-organization-identity.mjs +46 -51
  106. package/dist/dashboard/form-organization-workflow.js +518 -686
  107. package/dist/dashboard/form-organization-workflow.mjs +517 -682
  108. package/dist/dashboard/form-organization.js +82 -110
  109. package/dist/dashboard/form-organization.mjs +81 -109
  110. package/dist/dashboard/form-otc.js +4 -5
  111. package/dist/dashboard/form-otc.mjs +4 -5
  112. package/dist/dashboard/form-payment-methods.js +20 -9
  113. package/dist/dashboard/form-payment-methods.mjs +20 -9
  114. package/dist/dashboard/form-stripe.js +30 -0
  115. package/dist/dashboard/form-stripe.mjs +26 -0
  116. package/dist/dashboard/input-array.js +4 -2
  117. package/dist/dashboard/input-array.mjs +4 -2
  118. package/dist/dashboard/input-combobox.js +7 -3
  119. package/dist/dashboard/input-combobox.mjs +7 -3
  120. package/dist/dashboard/input-date.js +7 -0
  121. package/dist/dashboard/input-date.mjs +7 -0
  122. package/dist/dashboard/input-fields.js +80 -20
  123. package/dist/dashboard/input-fields.mjs +80 -20
  124. package/dist/dashboard/input-file.js +21 -1
  125. package/dist/dashboard/input-file.mjs +21 -1
  126. package/dist/dashboard/input-font.js +10 -1
  127. package/dist/dashboard/input-font.mjs +10 -1
  128. package/dist/dashboard/lib/item-list.js +57 -0
  129. package/dist/dashboard/lib/item-list.mjs +33 -0
  130. package/dist/dashboard/lib/menu.js +50 -0
  131. package/dist/dashboard/lib/menu.mjs +26 -0
  132. package/dist/dashboard/locked.js +82 -0
  133. package/dist/dashboard/locked.mjs +53 -0
  134. package/dist/dashboard/menu.js +72 -19
  135. package/dist/dashboard/menu.mjs +72 -19
  136. package/dist/dashboard/note-ai.js +69 -0
  137. package/dist/dashboard/note-ai.mjs +36 -0
  138. package/dist/dashboard/preview.js +419 -0
  139. package/dist/dashboard/preview.mjs +384 -0
  140. package/dist/dashboard/steps.js +39 -13
  141. package/dist/dashboard/steps.mjs +37 -12
  142. package/dist/dashboard/table-contacts.js +136 -0
  143. package/dist/dashboard/table-contacts.mjs +103 -0
  144. package/dist/dashboard/template-not-found.js +4 -2
  145. package/dist/dashboard/template-not-found.mjs +4 -2
  146. package/dist/dashboard/template-socket.js +51 -7
  147. package/dist/dashboard/template-socket.mjs +51 -7
  148. package/dist/icons/desktop.js +46 -0
  149. package/dist/icons/desktop.mjs +27 -0
  150. package/dist/icons/phone.js +46 -0
  151. package/dist/icons/phone.mjs +27 -0
  152. package/dist/icons/puzzle-piece.js +46 -0
  153. package/dist/icons/puzzle-piece.mjs +27 -0
  154. package/dist/icons/tablet.js +46 -0
  155. package/dist/icons/tablet.mjs +27 -0
  156. package/dist/icons/users.js +46 -0
  157. package/dist/icons/users.mjs +27 -0
  158. package/dist/input-checkbox.js +1 -0
  159. package/dist/input-checkbox.mjs +1 -0
  160. package/dist/input-code.js +101 -0
  161. package/dist/input-code.mjs +78 -0
  162. package/dist/input-text.js +2 -1
  163. package/dist/input-text.mjs +2 -1
  164. package/dist/shared/input-checkbox-list.js +0 -1
  165. package/dist/shared/input-checkbox-list.mjs +0 -1
  166. package/dist/shared/input-switch.js +6 -1
  167. package/dist/shared/input-switch.mjs +6 -1
  168. package/dist/shared/lib/campaign.js +117 -0
  169. package/dist/shared/lib/campaign.mjs +91 -0
  170. package/dist/shared/lib/helpers.js +14 -2
  171. package/dist/shared/lib/helpers.mjs +13 -2
  172. package/package.json +133 -13
  173. package/types/bridge/form-subdomain-header.d.ts +2 -0
  174. package/types/bridge/form-subdomain-missions.d.ts +36 -0
  175. package/types/bridge/form-subdomain.d.ts +23 -1
  176. package/types/bridge/lib/entry.d.ts +26 -0
  177. package/types/bridge/lib/location.d.ts +13 -0
  178. package/types/bridge/lib/order.d.ts +30 -0
  179. package/types/bridge/lib/url.d.ts +19 -0
  180. package/types/bridge/template-modal.d.ts +1 -1
  181. package/types/bridge/template-preview.d.ts +10 -0
  182. package/types/bridge/template-subdomain-link.d.ts +2 -0
  183. package/types/dashboard/accordion.d.ts +2 -0
  184. package/types/dashboard/avatar.d.ts +18 -2
  185. package/types/dashboard/buttons-subscription.d.ts +22 -0
  186. package/types/dashboard/card-campaign-switch.d.ts +32 -0
  187. package/types/dashboard/card-order.d.ts +11 -0
  188. package/types/dashboard/card-section.d.ts +2 -0
  189. package/types/dashboard/connection-workflows.d.ts +33 -0
  190. package/types/dashboard/device.d.ts +12 -0
  191. package/types/dashboard/form-admin-campaign.d.ts +3 -2
  192. package/types/dashboard/form-ai.d.ts +2 -2
  193. package/types/dashboard/form-organization-campaign-agreement.d.ts +18 -12
  194. package/types/dashboard/form-organization-campaign-field-email.d.ts +1 -2
  195. package/types/dashboard/form-organization-campaign-field-list.d.ts +36 -0
  196. package/types/dashboard/form-organization-campaign-field-phone.d.ts +1 -2
  197. package/types/dashboard/form-organization-campaign-field-remove.d.ts +22 -0
  198. package/types/dashboard/form-organization-campaign-field-select.d.ts +2 -1
  199. package/types/dashboard/form-organization-campaign-field-textarea.d.ts +2 -1
  200. package/types/dashboard/form-organization-campaign-integration-age.d.ts +3 -3
  201. package/types/dashboard/form-organization-campaign-integration-enable.d.ts +3 -3
  202. package/types/dashboard/form-organization-campaign-mission.d.ts +40 -0
  203. package/types/dashboard/form-organization-campaign-section.d.ts +27 -0
  204. package/types/dashboard/form-organization-campaign.d.ts +27 -17
  205. package/types/dashboard/form-organization-identity.d.ts +2 -0
  206. package/types/dashboard/form-organization-workflow.d.ts +43 -47
  207. package/types/dashboard/form-organization.d.ts +7 -2
  208. package/types/dashboard/form-stripe.d.ts +3 -0
  209. package/types/dashboard/input-combobox.d.ts +2 -0
  210. package/types/dashboard/input-date.d.ts +2 -0
  211. package/types/dashboard/input-fields.d.ts +3 -2
  212. package/types/dashboard/input-file.d.ts +4 -0
  213. package/types/dashboard/lib/item-list.d.ts +14 -0
  214. package/types/dashboard/lib/menu.d.ts +17 -0
  215. package/types/dashboard/locked.d.ts +10 -0
  216. package/types/dashboard/menu.d.ts +10 -2
  217. package/types/dashboard/note-ai.d.ts +15 -0
  218. package/types/dashboard/preview.d.ts +33 -0
  219. package/types/dashboard/steps.d.ts +19 -4
  220. package/types/dashboard/table-cell-title.d.ts +2 -2
  221. package/types/dashboard/table-contacts.d.ts +2 -0
  222. package/types/icons/desktop.d.ts +5 -0
  223. package/types/icons/phone.d.ts +5 -0
  224. package/types/icons/puzzle-piece.d.ts +5 -0
  225. package/types/icons/tablet.d.ts +5 -0
  226. package/types/icons/users.d.ts +5 -0
  227. package/types/input-code.d.ts +23 -0
  228. package/types/shared/input-switch.d.ts +2 -0
  229. package/types/shared/lib/campaign.d.ts +35 -0
  230. package/types/shared/lib/helpers.d.ts +3 -0
  231. package/dist/dashboard/card-integration.js +0 -187
  232. package/dist/dashboard/card-integration.mjs +0 -158
  233. package/dist/dashboard/iframe.js +0 -159
  234. package/dist/dashboard/iframe.mjs +0 -130
  235. package/types/dashboard/card-integration.d.ts +0 -24
  236. package/types/dashboard/iframe.d.ts +0 -18
@@ -2,21 +2,21 @@
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { Fragment, useCallback } from "react";
4
4
  import { Dialog, DialogPanel, Transition } from "@headlessui/react";
5
- import FormSubdomain, { FormSubdomainMessage, FormSubdomainSubmission, FormSubdomainHeader } from "./form-subdomain.mjs";
5
+ import FormSubdomain, { FormSubdomainMessage, FormSubdomainSubmission } from "./form-subdomain.mjs";
6
+ import FormSubdomainHeader from "./form-subdomain-header.mjs";
6
7
  import FormSubdomainIssue from "./form-subdomain-issue.mjs";
7
8
  import FormSubdomainPrize from "./form-subdomain-prize.mjs";
8
9
  import ProviderRecaptcha from "../shared/provider-recaptcha.mjs";
9
10
  import { FormSubdomainCart, FormSubdomainProduct } from "./form-subdomain-shop-modal.mjs";
10
11
  import TemplateSubdomainLink from "./template-subdomain-link.mjs";
11
- import CopyToClipboard from "../shared/copy-to-clipboard.mjs";
12
- import ShareButton from "./share-button.mjs";
12
+ import FormSubdomainMissions from "./form-subdomain-missions.mjs";
13
13
  import Tabs from "../shared/tabs.mjs";
14
14
  import Empty from "../shared/empty.mjs";
15
15
  import CardPrize from "../shared/card-prize.mjs";
16
16
  import ArrowRight from "../icons/arrow-right.mjs";
17
17
  import Flag from "../icons/flag.mjs";
18
- import Link from "../icons/link.mjs";
19
18
  import Warning from "../icons/warning.mjs";
19
+ import { copy, formOn, giveawayOn, panelTitle } from "./lib/entry.mjs";
20
20
  const TemplateModal = ({
21
21
  buttons,
22
22
  cart,
@@ -42,7 +42,7 @@ const TemplateModal = ({
42
42
  var _a, _b, _c, _d, _e, _f;
43
43
  const renderPanel = useCallback(
44
44
  () => {
45
- var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
45
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
46
46
  const agreements = (data == null ? void 0 : data.agreements) || {};
47
47
  switch (panel == null ? void 0 : panel.name) {
48
48
  case "cart":
@@ -67,6 +67,7 @@ const TemplateModal = ({
67
67
  }
68
68
  );
69
69
  case "enter":
70
+ if (!formOn(data)) return null;
70
71
  return /* @__PURE__ */ jsxs(Fragment, { children: [
71
72
  /* @__PURE__ */ jsx(
72
73
  FormSubdomain,
@@ -81,12 +82,18 @@ const TemplateModal = ({
81
82
  message
82
83
  }
83
84
  }),
84
- onSuccess: ({ message, result }) => {
85
- var _a3, _b3;
85
+ onSuccess: ({ created, message, result }) => {
86
+ var _a3;
86
87
  return submission({
87
88
  id: (_a3 = result == null ? void 0 : result.submission) == null ? void 0 : _a3.id,
88
- message: message || ((_b3 = data == null ? void 0 : data.defaults) == null ? void 0 : _b3.confirmation),
89
- title: "Entry submitted"
89
+ message: message || copy(data, "confirmation"),
90
+ // @story public-entry/submit
91
+ // The panel's ads and missions ride on the answer: nothing more to ask.
92
+ panel: result == null ? void 0 : result.panel,
93
+ // The api answers a submitter at the limit with created false.
94
+ repeat: created === false,
95
+ // @story public-entry/submit
96
+ title: panelTitle(data)
90
97
  });
91
98
  },
92
99
  disabled: !preview && !(data == null ? void 0 : data.valid),
@@ -117,6 +124,28 @@ const TemplateModal = ({
117
124
  }
118
125
  }
119
126
  );
127
+ // @story public-entry/lead-link
128
+ // Opened by the lead's own link while entries are being awarded:
129
+ // the missions panel, at the mission a `&mission=` asked for. With
130
+ // no missions the link opens no panel (template-layout.js).
131
+ case "lead":
132
+ return /* @__PURE__ */ jsx(
133
+ FormSubdomainMissions,
134
+ {
135
+ ...{
136
+ button: buttons.close("lead"),
137
+ contact: panel.data.contact,
138
+ initial: panel.data.mission,
139
+ missions: panel.data.missions,
140
+ shareLink: panel.data.shareLink,
141
+ slug: params == null ? void 0 : params.slug,
142
+ style,
143
+ subdomain: params == null ? void 0 : params.subdomain,
144
+ title: "Your entries",
145
+ token: panel.data.token
146
+ }
147
+ }
148
+ );
120
149
  case "menu":
121
150
  return /* @__PURE__ */ jsxs(Fragment, { children: [
122
151
  /* @__PURE__ */ jsx(
@@ -141,7 +170,7 @@ const TemplateModal = ({
141
170
  }
142
171
  },
143
172
  children: [
144
- ((_e2 = (_d2 = data == null ? void 0 : data.prizes) == null ? void 0 : _d2.pageInfo) == null ? void 0 : _e2.total) > 0 && /* @__PURE__ */ jsx(
173
+ giveawayOn(data) && ((_e2 = (_d2 = data == null ? void 0 : data.prizes) == null ? void 0 : _d2.pageInfo) == null ? void 0 : _e2.total) > 0 && /* @__PURE__ */ jsx(
145
174
  TemplateSubdomainLink,
146
175
  {
147
176
  ...{
@@ -160,25 +189,6 @@ const TemplateModal = ({
160
189
  }
161
190
  }
162
191
  ),
163
- /* @__PURE__ */ jsx(
164
- TemplateSubdomainLink,
165
- {
166
- ...{
167
- disabled: iframe,
168
- onClick: () => {
169
- setPanel({
170
- name: "share"
171
- });
172
- tracking.track({
173
- name: "link-share"
174
- });
175
- },
176
- svg: ArrowRight,
177
- text: "Share link",
178
- "aria-label": "Open to share this link"
179
- }
180
- }
181
- ),
182
192
  /* @__PURE__ */ jsx(
183
193
  TemplateSubdomainLink,
184
194
  {
@@ -464,50 +474,6 @@ const TemplateModal = ({
464
474
  ),
465
475
  buttons.recaptcha()
466
476
  ] });
467
- case "share":
468
- return /* @__PURE__ */ jsxs(Fragment, { children: [
469
- /* @__PURE__ */ jsx(
470
- FormSubdomainHeader,
471
- {
472
- ...{
473
- back: {
474
- onClick: () => setPanel({
475
- name: "menu"
476
- })
477
- },
478
- button: buttons.close("menu"),
479
- style,
480
- title: "Share link"
481
- }
482
- }
483
- ),
484
- /* @__PURE__ */ jsx(
485
- ShareButton,
486
- {
487
- ...{
488
- style,
489
- values: {
490
- description: data == null ? void 0 : data.description,
491
- headline: data == null ? void 0 : data.headline,
492
- image: (_v = data == null ? void 0 : data.images) == null ? void 0 : _v.preview,
493
- url: data == null ? void 0 : data.url
494
- }
495
- }
496
- }
497
- ),
498
- /* @__PURE__ */ jsx(
499
- CopyToClipboard,
500
- {
501
- ...{
502
- className: "justify-between w-full pt-5 pr-3 border-t border-inherit",
503
- icon: Link,
504
- style,
505
- value: data == null ? void 0 : data.url
506
- },
507
- children: "Copy link"
508
- }
509
- )
510
- ] });
511
477
  case "submission":
512
478
  return /* @__PURE__ */ jsx(
513
479
  FormSubdomainSubmission,
@@ -0,0 +1,208 @@
1
+ "use client";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var template_preview_exports = {};
30
+ __export(template_preview_exports, {
31
+ Close: () => Close,
32
+ SharePage: () => SharePage,
33
+ ShareSheet: () => ShareSheet
34
+ });
35
+ module.exports = __toCommonJS(template_preview_exports);
36
+ var import_jsx_runtime = require("react/jsx-runtime");
37
+ var import_provider_font = __toESM(require("../provider-font"));
38
+ var import_template_subdomain = __toESM(require("./template-subdomain"));
39
+ var import_overlay = __toESM(require("../shared/overlay"));
40
+ var import_button = __toESM(require("../shared/button"));
41
+ var import_powered_by = __toESM(require("../icons/powered-by"));
42
+ var import_times = __toESM(require("../icons/times"));
43
+ var import_entry = require("./lib/entry");
44
+ const Close = ({ style }) => {
45
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
46
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
47
+ "span",
48
+ {
49
+ ...{
50
+ className: "flex items-center justify-center w-6 h-6 rounded-full",
51
+ style: {
52
+ backgroundColor: ((_c = (_b = (_a = style == null ? void 0 : style.button) == null ? void 0 : _a.background) == null ? void 0 : _b.color) == null ? void 0 : _c.rgb) || ((_e = (_d = style == null ? void 0 : style.text) == null ? void 0 : _d.color) == null ? void 0 : _e.rgb),
53
+ borderRadius: ((_f = style == null ? void 0 : style.button) == null ? void 0 : _f.radius) != null ? style.button.radius / 4 + "px" : void 0,
54
+ color: ((_i = (_h = (_g = style == null ? void 0 : style.button) == null ? void 0 : _g.text) == null ? void 0 : _h.color) == null ? void 0 : _i.rgb) || ((_k = (_j = style == null ? void 0 : style.background) == null ? void 0 : _j.color) == null ? void 0 : _k.rgb)
55
+ }
56
+ },
57
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
58
+ import_times.default,
59
+ {
60
+ ...{
61
+ "aria-hidden": true,
62
+ className: "w-4 h-4"
63
+ }
64
+ }
65
+ )
66
+ }
67
+ );
68
+ };
69
+ const branding = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
70
+ "div",
71
+ {
72
+ ...{
73
+ className: "flex justify-center"
74
+ },
75
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
76
+ import_powered_by.default,
77
+ {
78
+ ...{
79
+ className: "w-full max-w-[180px] lg:max-w-[200px]"
80
+ }
81
+ }
82
+ )
83
+ }
84
+ );
85
+ const Page = ({ button, data, fonts, style }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
86
+ import_template_subdomain.default,
87
+ {
88
+ ...{
89
+ buttons: {
90
+ branding,
91
+ brandingCompact: branding,
92
+ close: () => null,
93
+ enter: button,
94
+ menu: null,
95
+ shop: () => null
96
+ },
97
+ cart: null,
98
+ data,
99
+ fonts,
100
+ iframe: false,
101
+ modal: false,
102
+ preview: false,
103
+ setModal: () => {
104
+ },
105
+ setPanel: () => {
106
+ },
107
+ style,
108
+ tracking: {
109
+ track: () => {
110
+ }
111
+ }
112
+ }
113
+ }
114
+ );
115
+ const SharePage = ({ button, data, style }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
116
+ import_provider_font.default,
117
+ {
118
+ ...style,
119
+ children: (fonts) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
120
+ Page,
121
+ {
122
+ ...{
123
+ button,
124
+ data,
125
+ fonts,
126
+ style
127
+ }
128
+ }
129
+ )
130
+ }
131
+ );
132
+ const ShareSheet = ({ children, data, style }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
133
+ import_provider_font.default,
134
+ {
135
+ ...style,
136
+ children: (fonts) => {
137
+ var _a, _b, _c, _d, _e, _f;
138
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
139
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
140
+ Page,
141
+ {
142
+ ...{
143
+ button: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
144
+ import_button.default,
145
+ {
146
+ ...{
147
+ style
148
+ },
149
+ children: (0, import_entry.buttonText)(data, true)
150
+ }
151
+ ),
152
+ data,
153
+ fonts,
154
+ style
155
+ }
156
+ }
157
+ ),
158
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
159
+ import_overlay.default,
160
+ {
161
+ ...{
162
+ className: "z-30 fixed inset-0",
163
+ show: true,
164
+ style
165
+ }
166
+ }
167
+ ),
168
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
169
+ "div",
170
+ {
171
+ ...{
172
+ className: "z-40 fixed inset-0 flex flex-col w-full overflow-y-auto pt-6 lg:p-6"
173
+ },
174
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
175
+ "div",
176
+ {
177
+ ...{
178
+ className: "relative w-full bg-white border-current rounded-t-xl mt-auto overflow-hidden lg:m-auto lg:max-w-md lg:rounded-xl flex flex-col",
179
+ style: {
180
+ ...fonts.body,
181
+ backgroundColor: (_b = (_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb,
182
+ borderColor: (_d = (_c = style == null ? void 0 : style.text) == null ? void 0 : _c.color) == null ? void 0 : _d.rgb,
183
+ color: (_f = (_e = style == null ? void 0 : style.text) == null ? void 0 : _e.color) == null ? void 0 : _f.rgb
184
+ }
185
+ },
186
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
187
+ "div",
188
+ {
189
+ ...{
190
+ className: "p-6 space-y-6"
191
+ },
192
+ children
193
+ }
194
+ )
195
+ }
196
+ )
197
+ }
198
+ )
199
+ ] });
200
+ }
201
+ }
202
+ );
203
+ // Annotate the CommonJS export names for ESM import in node:
204
+ 0 && (module.exports = {
205
+ Close,
206
+ SharePage,
207
+ ShareSheet
208
+ });
@@ -0,0 +1,173 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import ProviderFont from "../provider-font.mjs";
4
+ import TemplateSubdomain from "./template-subdomain.mjs";
5
+ import Overlay from "../shared/overlay.mjs";
6
+ import Button from "../shared/button.mjs";
7
+ import PoweredBy from "../icons/powered-by.mjs";
8
+ import Times from "../icons/times.mjs";
9
+ import { buttonText } from "./lib/entry.mjs";
10
+ const Close = ({ style }) => {
11
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
12
+ return /* @__PURE__ */ jsx(
13
+ "span",
14
+ {
15
+ ...{
16
+ className: "flex items-center justify-center w-6 h-6 rounded-full",
17
+ style: {
18
+ backgroundColor: ((_c = (_b = (_a = style == null ? void 0 : style.button) == null ? void 0 : _a.background) == null ? void 0 : _b.color) == null ? void 0 : _c.rgb) || ((_e = (_d = style == null ? void 0 : style.text) == null ? void 0 : _d.color) == null ? void 0 : _e.rgb),
19
+ borderRadius: ((_f = style == null ? void 0 : style.button) == null ? void 0 : _f.radius) != null ? style.button.radius / 4 + "px" : void 0,
20
+ color: ((_i = (_h = (_g = style == null ? void 0 : style.button) == null ? void 0 : _g.text) == null ? void 0 : _h.color) == null ? void 0 : _i.rgb) || ((_k = (_j = style == null ? void 0 : style.background) == null ? void 0 : _j.color) == null ? void 0 : _k.rgb)
21
+ }
22
+ },
23
+ children: /* @__PURE__ */ jsx(
24
+ Times,
25
+ {
26
+ ...{
27
+ "aria-hidden": true,
28
+ className: "w-4 h-4"
29
+ }
30
+ }
31
+ )
32
+ }
33
+ );
34
+ };
35
+ const branding = /* @__PURE__ */ jsx(
36
+ "div",
37
+ {
38
+ ...{
39
+ className: "flex justify-center"
40
+ },
41
+ children: /* @__PURE__ */ jsx(
42
+ PoweredBy,
43
+ {
44
+ ...{
45
+ className: "w-full max-w-[180px] lg:max-w-[200px]"
46
+ }
47
+ }
48
+ )
49
+ }
50
+ );
51
+ const Page = ({ button, data, fonts, style }) => /* @__PURE__ */ jsx(
52
+ TemplateSubdomain,
53
+ {
54
+ ...{
55
+ buttons: {
56
+ branding,
57
+ brandingCompact: branding,
58
+ close: () => null,
59
+ enter: button,
60
+ menu: null,
61
+ shop: () => null
62
+ },
63
+ cart: null,
64
+ data,
65
+ fonts,
66
+ iframe: false,
67
+ modal: false,
68
+ preview: false,
69
+ setModal: () => {
70
+ },
71
+ setPanel: () => {
72
+ },
73
+ style,
74
+ tracking: {
75
+ track: () => {
76
+ }
77
+ }
78
+ }
79
+ }
80
+ );
81
+ const SharePage = ({ button, data, style }) => /* @__PURE__ */ jsx(
82
+ ProviderFont,
83
+ {
84
+ ...style,
85
+ children: (fonts) => /* @__PURE__ */ jsx(
86
+ Page,
87
+ {
88
+ ...{
89
+ button,
90
+ data,
91
+ fonts,
92
+ style
93
+ }
94
+ }
95
+ )
96
+ }
97
+ );
98
+ const ShareSheet = ({ children, data, style }) => /* @__PURE__ */ jsx(
99
+ ProviderFont,
100
+ {
101
+ ...style,
102
+ children: (fonts) => {
103
+ var _a, _b, _c, _d, _e, _f;
104
+ return /* @__PURE__ */ jsxs("div", { children: [
105
+ /* @__PURE__ */ jsx(
106
+ Page,
107
+ {
108
+ ...{
109
+ button: /* @__PURE__ */ jsx(
110
+ Button,
111
+ {
112
+ ...{
113
+ style
114
+ },
115
+ children: buttonText(data, true)
116
+ }
117
+ ),
118
+ data,
119
+ fonts,
120
+ style
121
+ }
122
+ }
123
+ ),
124
+ /* @__PURE__ */ jsx(
125
+ Overlay,
126
+ {
127
+ ...{
128
+ className: "z-30 fixed inset-0",
129
+ show: true,
130
+ style
131
+ }
132
+ }
133
+ ),
134
+ /* @__PURE__ */ jsx(
135
+ "div",
136
+ {
137
+ ...{
138
+ className: "z-40 fixed inset-0 flex flex-col w-full overflow-y-auto pt-6 lg:p-6"
139
+ },
140
+ children: /* @__PURE__ */ jsx(
141
+ "div",
142
+ {
143
+ ...{
144
+ className: "relative w-full bg-white border-current rounded-t-xl mt-auto overflow-hidden lg:m-auto lg:max-w-md lg:rounded-xl flex flex-col",
145
+ style: {
146
+ ...fonts.body,
147
+ backgroundColor: (_b = (_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb,
148
+ borderColor: (_d = (_c = style == null ? void 0 : style.text) == null ? void 0 : _c.color) == null ? void 0 : _d.rgb,
149
+ color: (_f = (_e = style == null ? void 0 : style.text) == null ? void 0 : _e.color) == null ? void 0 : _f.rgb
150
+ }
151
+ },
152
+ children: /* @__PURE__ */ jsx(
153
+ "div",
154
+ {
155
+ ...{
156
+ className: "p-6 space-y-6"
157
+ },
158
+ children
159
+ }
160
+ )
161
+ }
162
+ )
163
+ }
164
+ )
165
+ ] });
166
+ }
167
+ }
168
+ );
169
+ export {
170
+ Close,
171
+ SharePage,
172
+ ShareSheet
173
+ };
@@ -40,6 +40,7 @@ var import_button = __toESM(require("../shared/button"));
40
40
  var import_loader = __toESM(require("../icons/loader"));
41
41
  var import_warning = __toESM(require("../icons/warning"));
42
42
  var import_styles = require("../styles");
43
+ var import_helpers = require("../shared/lib/helpers");
43
44
  const ms = 1e4;
44
45
  const GalleryImage = ({
45
46
  alt,
@@ -142,6 +143,7 @@ const GalleryImage = ({
142
143
  const TemplateSubdomainGallery = ({
143
144
  children,
144
145
  compact,
146
+ descriptions,
145
147
  gallery,
146
148
  modal,
147
149
  overlay,
@@ -321,7 +323,8 @@ const TemplateSubdomainGallery = ({
321
323
  GalleryImage,
322
324
  {
323
325
  ...{
324
- alt: filename,
326
+ // Keyed by file id: each gallery item has its own.
327
+ alt: (0, import_helpers.imageAlt)({ filename }, descriptions == null ? void 0 : descriptions[id]),
325
328
  className: "object-cover object-top transition duration-200",
326
329
  fill: true,
327
330
  // Only the visible first slide is the LCP candidate;
@@ -438,7 +441,6 @@ const TemplateSubdomainGallery = ({
438
441
  {
439
442
  ...{
440
443
  className: classes.gallery.join(" "),
441
- "aria-hidden": true,
442
444
  // No frame in this padding: a 40% text-colour one drew here until share's
443
445
  // 2026-06-01 layout fix broke it, and Darren decided against bringing it back.
444
446
  style: {
@@ -462,6 +464,8 @@ const TemplateSubdomainGallery = ({
462
464
  ...{
463
465
  // @story public-entry/view-page
464
466
  // Above the skip buttons and holds no control: taps pass through to them.
467
+ // The bars are decoration; each item's own alt text is what a screen reader reads.
468
+ "aria-hidden": true,
465
469
  className: "items-center absolute top-0 left-0 z-50 flex w-full px-3 py-5 lg:p-5 pointer-events-none " + (length > 1 ? "flex" : "hidden")
466
470
  },
467
471
  children: gallery.map(({ id }, key) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -8,6 +8,7 @@ import Button from "../shared/button.mjs";
8
8
  import Loader from "../icons/loader.mjs";
9
9
  import Warning from "../icons/warning.mjs";
10
10
  import { backgroundStyle } from "../styles.mjs";
11
+ import { imageAlt } from "../shared/lib/helpers.mjs";
11
12
  const ms = 1e4;
12
13
  const GalleryImage = ({
13
14
  alt,
@@ -110,6 +111,7 @@ const GalleryImage = ({
110
111
  const TemplateSubdomainGallery = ({
111
112
  children,
112
113
  compact,
114
+ descriptions,
113
115
  gallery,
114
116
  modal,
115
117
  overlay,
@@ -289,7 +291,8 @@ const TemplateSubdomainGallery = ({
289
291
  GalleryImage,
290
292
  {
291
293
  ...{
292
- alt: filename,
294
+ // Keyed by file id: each gallery item has its own.
295
+ alt: imageAlt({ filename }, descriptions == null ? void 0 : descriptions[id]),
293
296
  className: "object-cover object-top transition duration-200",
294
297
  fill: true,
295
298
  // Only the visible first slide is the LCP candidate;
@@ -406,7 +409,6 @@ const TemplateSubdomainGallery = ({
406
409
  {
407
410
  ...{
408
411
  className: classes.gallery.join(" "),
409
- "aria-hidden": true,
410
412
  // No frame in this padding: a 40% text-colour one drew here until share's
411
413
  // 2026-06-01 layout fix broke it, and Darren decided against bringing it back.
412
414
  style: {
@@ -430,6 +432,8 @@ const TemplateSubdomainGallery = ({
430
432
  ...{
431
433
  // @story public-entry/view-page
432
434
  // Above the skip buttons and holds no control: taps pass through to them.
435
+ // The bars are decoration; each item's own alt text is what a screen reader reads.
436
+ "aria-hidden": true,
433
437
  className: "items-center absolute top-0 left-0 z-50 flex w-full px-3 py-5 lg:p-5 pointer-events-none " + (length > 1 ? "flex" : "hidden")
434
438
  },
435
439
  children: gallery.map(({ id }, key) => /* @__PURE__ */ jsx(
@@ -34,9 +34,11 @@ module.exports = __toCommonJS(template_subdomain_link_exports);
34
34
  var import_jsx_runtime = require("react/jsx-runtime");
35
35
  var import_image = __toESM(require("next/image"));
36
36
  var import_button = __toESM(require("../shared/button"));
37
+ var import_helpers = require("../shared/lib/helpers");
37
38
  const TemplateSubdomainLink = ({
38
39
  element: Element,
39
40
  className = "py-4 pr-3",
41
+ description,
40
42
  icon: Icon,
41
43
  image,
42
44
  buttonWithImageHeight,
@@ -78,7 +80,10 @@ const TemplateSubdomainLink = ({
78
80
  import_image.default,
79
81
  {
80
82
  ...{
81
- alt: text,
83
+ // @story public-entry/view-page
84
+ // The image's own description, else the link's title
85
+ // (Darren 2026-10-30): never the file's name.
86
+ alt: (0, import_helpers.imageAlt)(null, description) || text,
82
87
  className: "object-cover",
83
88
  fill: true,
84
89
  sizes: "40px",
@@ -2,9 +2,11 @@
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import Image from "next/image";
4
4
  import Button from "../shared/button.mjs";
5
+ import { imageAlt } from "../shared/lib/helpers.mjs";
5
6
  const TemplateSubdomainLink = ({
6
7
  element: Element,
7
8
  className = "py-4 pr-3",
9
+ description,
8
10
  icon: Icon,
9
11
  image,
10
12
  buttonWithImageHeight,
@@ -46,7 +48,10 @@ const TemplateSubdomainLink = ({
46
48
  Image,
47
49
  {
48
50
  ...{
49
- alt: text,
51
+ // @story public-entry/view-page
52
+ // The image's own description, else the link's title
53
+ // (Darren 2026-10-30): never the file's name.
54
+ alt: imageAlt(null, description) || text,
50
55
  className: "object-cover",
51
56
  fill: true,
52
57
  sizes: "40px",