@pagehub/sdk 0.1.5 → 0.1.7

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 (142) hide show
  1. package/README.md +1 -1
  2. package/dist/chrome/viewport/Viewport/hooks/usePageLoadIndicator.d.ts +2 -2
  3. package/dist/chrome/viewport/design-system/hooks/useDesignSystem.d.ts +2 -2
  4. package/dist/chrome/viewport/design-system/hooks/usePaletteState.d.ts +2 -2
  5. package/dist/chunks/ActionEditorPanel-9v50QUwu.js +89 -0
  6. package/dist/chunks/ActionInput-CTt7sOs6.js +929 -0
  7. package/dist/chunks/ActionsAddPicker-BeTPUUor.js +51 -0
  8. package/dist/chunks/ActionsInput-D0h-zLYj.js +174 -0
  9. package/dist/chunks/AnchoredPopover-CckPTxXu.js +2676 -0
  10. package/dist/chunks/AnimationEditorPanel-CXNmsTqV.js +26 -0
  11. package/dist/chunks/AnimationsInput-Djyz0uXG.js +292 -0
  12. package/dist/chunks/AnimationsInputPopover-B2-oNebx.js +71 -0
  13. package/dist/chunks/AnimationsPanel-DungA9qb.js +25 -0
  14. package/dist/chunks/Audio.render-CsR69fZ9.js +22 -0
  15. package/dist/chunks/AudioMainTab-BljM2NMQ.js +70 -0
  16. package/dist/chunks/BackdropEditorPanel-CA2k-6SR.js +26 -0
  17. package/dist/chunks/BackgroundImageInputPopover-vB_217Ig.js +94 -0
  18. package/dist/chunks/BackgroundImagePanel-BvMhF9eU.js +100 -0
  19. package/dist/chunks/BackgroundMainTab-CI4c5DEF.js +10 -0
  20. package/dist/chunks/BundleRowPanel-BcYfyfGQ.js +33 -0
  21. package/dist/chunks/ButtonMainTab-Civy_DoA.js +43 -0
  22. package/dist/chunks/CSSEditorInput-C1ITwAh3.js +73 -0
  23. package/dist/chunks/ClassNameInput-Ce0fGQES.js +720 -0
  24. package/dist/chunks/CodeEditor-axBXmPH8.js +33370 -0
  25. package/dist/chunks/ColorInput-BSfMNt86.js +187 -0
  26. package/dist/chunks/ColorPanel-DOLrT-gS.js +562 -0
  27. package/dist/chunks/ComponentImportExportPanel-DVcnGhGx.js +161 -0
  28. package/dist/chunks/ComponentImportExportPopover-BY1_oxU8.js +26 -0
  29. package/dist/chunks/ConditionEditorPanel-DLbqYaSF.js +43 -0
  30. package/dist/chunks/ConditionsAddPicker-SsHJlc1E.js +54 -0
  31. package/dist/chunks/ConditionsInput-B_5Nge8o.js +474 -0
  32. package/dist/chunks/ContainerMainTab-kkktm1Ns.js +1107 -0
  33. package/dist/chunks/ContainerOverflowSectionPanel-ibKXf-1N.js +120 -0
  34. package/dist/chunks/ContainerOverflowSectionPopover-CRQ9EPsn.js +24 -0
  35. package/dist/chunks/ContainerPaddingOverlay-Cd3xOv-S.js +340 -0
  36. package/dist/chunks/ContainerScrollEffectSection-Dbztqdnr.js +123 -0
  37. package/dist/chunks/ContainerStateSection-DY_gjBJL.js +478 -0
  38. package/dist/chunks/ConversionFields-Bpfl-SGP.js +135 -0
  39. package/dist/chunks/CraftListEditor-_TIy1ogW.js +73 -0
  40. package/dist/chunks/CreateTokenDialog-DNWtWqJd.js +147 -0
  41. package/dist/chunks/Data.render-DTmaqSyz.js +10 -0
  42. package/dist/chunks/DataAttributesPanel-mYhisO_O.js +125 -0
  43. package/dist/chunks/DataMainTab-Batm515E.js +23 -0
  44. package/dist/chunks/DataSourceSectionSlot-BKoO6Vxn.js +10 -0
  45. package/dist/chunks/EditorEmptyLeafHintView-D3E3UN_0.js +78 -0
  46. package/dist/chunks/EffectRowInputPopover-CYhfjFwJ.js +323 -0
  47. package/dist/chunks/EffectsClassInput-Yujuchwy.js +315 -0
  48. package/dist/chunks/Embed.render-BgKpUV8n.js +17 -0
  49. package/dist/chunks/EmbedMainTab-d_-Bnkug.js +225 -0
  50. package/dist/chunks/FilterEditorPanel-CRa0IpLr.js +26 -0
  51. package/dist/chunks/FlexDirectionInput-C5gYjk5W.js +78 -0
  52. package/dist/chunks/FloatingPanel-DJP5Vhua.js +553 -0
  53. package/dist/chunks/FontFamilyInput-CVNnVylt.js +111 -0
  54. package/dist/chunks/Form.render-6GjcmL2u.js +54 -0
  55. package/dist/chunks/FormElement.render-DWrG-2ID.js +36 -0
  56. package/dist/chunks/FormElementMainTab-DSbF3F6e.js +470 -0
  57. package/dist/chunks/FormMainTab-SHny1HxF.js +240 -0
  58. package/dist/chunks/GradientInputPopover-1K6O9jBq.js +103 -0
  59. package/dist/chunks/GradientPanel-DSRQKkaB.js +194 -0
  60. package/dist/chunks/HTMLCodeInput-CCe4Bj5z.js +69 -0
  61. package/dist/chunks/HandlerEditorPanel-DiOXobsl.js +93 -0
  62. package/dist/chunks/HandlersAddPicker-DWTgjKgo.js +101 -0
  63. package/dist/chunks/HandlersInput-p49STTn8.js +132 -0
  64. package/dist/chunks/IconDialogInput-C-81_L2n.js +105 -0
  65. package/dist/chunks/IconInput-D2Gy7Hvf.js +182 -0
  66. package/dist/chunks/IconMainTab-CNrVjDWP.js +26 -0
  67. package/dist/chunks/IconPickerPanel-BjNOlCh6.js +670 -0
  68. package/dist/chunks/ImageMainTab-C4O7RjX0.js +66 -0
  69. package/dist/chunks/ImageSettingsPanel-dvOmGg3C.js +485 -0
  70. package/dist/chunks/LayoutPresetPanel-CNAVAcvw.js +81 -0
  71. package/dist/chunks/LayoutPresetSlot-BqMTdE33.js +16 -0
  72. package/dist/chunks/LinkMainTab-BfFZx0AU.js +13 -0
  73. package/dist/chunks/ListEditor-mD-CmRNE.js +178 -0
  74. package/dist/chunks/Map.render-DFkmncHz.js +82 -0
  75. package/dist/chunks/MapLeaflet-DOfmZ3Pk.js +6588 -0
  76. package/dist/chunks/MapMainTab-CxI7IS1_.js +165 -0
  77. package/dist/chunks/MapPoint.render-0OAfCZTp.js +16 -0
  78. package/dist/chunks/MapPointMainTab-CmLcaSR5.js +60 -0
  79. package/dist/chunks/MediaInput-DHs3D8TJ.js +672 -0
  80. package/dist/chunks/MediaManagerModal-Dc5PK3dn.js +240 -0
  81. package/dist/chunks/MiniPreviewTile-B4zxTj9Y.js +32 -0
  82. package/dist/chunks/ModifierChipList-CwsWklih.js +33 -0
  83. package/dist/chunks/ModifiersAddPicker-D-vSYw7O.js +74 -0
  84. package/dist/chunks/ModifiersPickerPanel-CTefidBx.js +243 -0
  85. package/dist/chunks/NodeAiContextInputPopover-D5bn5o_T.js +66 -0
  86. package/dist/chunks/NodeAiContextPanel-Bx4rcjiM.js +81 -0
  87. package/dist/chunks/NumberSettingsPanel-DASi_l6V.js +56 -0
  88. package/dist/chunks/PageSettingsModal-D6o450IR.js +2678 -0
  89. package/dist/chunks/PatternInputPopover-qMWBv_nl.js +100 -0
  90. package/dist/chunks/PatternPanel-D2fgWDd-.js +352 -0
  91. package/dist/chunks/PeekTargetButton-ClrJX7zh.js +26 -0
  92. package/dist/chunks/PermissionsSection-DwobrV40.js +82 -0
  93. package/dist/chunks/PresetAddChildList-D6a0xdt8.js +35 -0
  94. package/dist/chunks/PropertiesInput-9O39ngbb.js +125 -0
  95. package/dist/chunks/PropertiesPanel-DO0RlalO.js +76 -0
  96. package/dist/chunks/SaveModifierPanel-B6mjKyrT.js +130 -0
  97. package/dist/chunks/ScrollEffectEditorPanel-CllGUhui.js +26 -0
  98. package/dist/chunks/SearchInput-DRUztbM0.js +76 -0
  99. package/dist/chunks/SearchableMenuPopover-DZKVXiEl.js +1251 -0
  100. package/dist/chunks/SlotRenderer-CaLf_2_C.js +38 -0
  101. package/dist/chunks/StateBindingEditorPanel-DKdcG5py.js +101 -0
  102. package/dist/chunks/StateBindingsAddPicker-DxMNAWAD.js +91 -0
  103. package/dist/chunks/StateBindingsInput-iWiqvAVB.js +103 -0
  104. package/dist/chunks/TailwindInput-660FZtyK.js +24 -0
  105. package/dist/chunks/TextEditor-B2O7DlN8.js +22032 -0
  106. package/dist/chunks/TextMainTab-B5udsXsk.js +260 -0
  107. package/dist/chunks/TextStyleEditorPanel-GRNPGzUL.js +381 -0
  108. package/dist/chunks/TextStylePickerPanel-l108SmGQ.js +140 -0
  109. package/dist/chunks/TextareaSettingsPanel-C1rQuF1O.js +50 -0
  110. package/dist/chunks/TokenPicker-Q0LToF_p.js +291 -0
  111. package/dist/chunks/ToolbarDashedButton-DbUxGmDg.js +23 -0
  112. package/dist/chunks/TransformEditorPanel-BGwyznZ6.js +26 -0
  113. package/dist/chunks/TransitionEditorPanel-BSvk58Ow.js +26 -0
  114. package/dist/chunks/TypographyPresetInput-DqnGSgR2.js +296 -0
  115. package/dist/chunks/ValidationPanel-CmA9SfoF.js +56 -0
  116. package/dist/chunks/Video.render-Dg6xvis4.js +21 -0
  117. package/dist/chunks/VideoMainTab-v5UFhUm-.js +174 -0
  118. package/dist/chunks/YouTube.esm-EbHnLU1Z.js +744 -0
  119. package/dist/chunks/dialogAtoms-CeQ2G05l.js +59 -0
  120. package/dist/chunks/extends-hS2Bh-Yp.js +12 -0
  121. package/dist/chunks/formatStorage-C3o2s3dk.js +22 -0
  122. package/dist/chunks/googleFonts-Dj4AntNi.js +323 -0
  123. package/dist/chunks/helpers-Cll72tMn.js +18 -0
  124. package/dist/chunks/index-B-GJd039.js +2875 -0
  125. package/dist/chunks/index-C66dAl3Q.js +32177 -0
  126. package/dist/chunks/index.esm-mqFx3NOs.js +644 -0
  127. package/dist/chunks/popoverOpenRequestAtom-hBS_siXv.js +22 -0
  128. package/dist/chunks/propertyRegistry-CMhVNOgl.js +38 -0
  129. package/dist/chunks/resolveAnchorsViaCraft-Cixm6ZyJ.js +31 -0
  130. package/dist/chunks/toolboxUtils-DjTMslSn.js +370 -0
  131. package/dist/chunks/uiPrimitives-BtohldWg.js +15 -0
  132. package/dist/chunks/use-event-listener-DO3Sk7g0.js +15 -0
  133. package/dist/chunks/useElementPicker-DoNuXNMQ.js +41 -0
  134. package/dist/chunks/useLayoutPreset-wOMV5YnO.js +528 -0
  135. package/dist/chunks/useMediaManager-CmKDbFfw.js +4629 -0
  136. package/dist/chunks/usePopoverAutoOpen-CxIjt0ez.js +25 -0
  137. package/dist/chunks/usePopoverPosition-83Vti7Aw.js +15 -0
  138. package/dist/render/static/index.js +9 -0
  139. package/dist/theme.css +168 -0
  140. package/package.json +25 -14
  141. package/dist/pagehub-viewer.umd.cjs +0 -574
  142. package/dist/pagehub.umd.cjs +0 -1130
@@ -0,0 +1,478 @@
1
+ import { jsxs as n, Fragment as f, jsx as t } from "react/jsx-runtime";
2
+ import { useNode as S } from "@craftjs/core";
3
+ import { useState as b } from "react";
4
+ import { C as v, as as A, W as N, P as x, aO as P, eG as T } from "./index-C66dAl3Q.js";
5
+ import { F as C } from "./FloatingPanel-DJP5Vhua.js";
6
+ import { u as k } from "./usePopoverPosition-83Vti7Aw.js";
7
+ const O = 380, g = [
8
+ {
9
+ value: "all-truthy",
10
+ label: "All truthy",
11
+ description: "Output 'on' when every input key has a non-empty value. Use as an Add-to-Cart gate."
12
+ },
13
+ {
14
+ value: "first-truthy",
15
+ label: "First truthy",
16
+ description: "Output the value of the first non-empty input. Useful for fallback copy."
17
+ },
18
+ {
19
+ value: "join",
20
+ label: "Join",
21
+ description: "Concatenate all input values with a separator. Default separator is ','."
22
+ },
23
+ {
24
+ value: "variant-match",
25
+ label: "Variant match",
26
+ description: "Match axis selections against a variant map JSON and emit the matched variant. Use on a PDP wrapper."
27
+ },
28
+ {
29
+ value: "variant-axis-availability",
30
+ label: "Axis availability",
31
+ description: "Emit a CSV of axis values that have no in-stock variant given the currently selected other axes."
32
+ }
33
+ ];
34
+ function V({
35
+ binding: i,
36
+ onChange: r,
37
+ initialPosition: p,
38
+ onClose: o
39
+ }) {
40
+ var m;
41
+ const a = i.compute, s = (e) => {
42
+ r({ ...i, compute: { ...a, ...e } });
43
+ }, d = (e) => {
44
+ r({
45
+ ...i,
46
+ from: e.split(`
47
+ `).map((l) => l.trim()).filter(Boolean)
48
+ });
49
+ }, u = a.type === "variant-match" || a.type === "variant-axis-availability";
50
+ return /* @__PURE__ */ t(
51
+ C,
52
+ {
53
+ isOpen: !0,
54
+ onClose: o,
55
+ title: "Computed binding",
56
+ storageKey: "computed-binding-editor",
57
+ minWidth: 320,
58
+ maxWidth: 480,
59
+ minHeight: 300,
60
+ initialPosition: p,
61
+ zIndex: N,
62
+ scrollable: !0,
63
+ children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-3", children: [
64
+ /* @__PURE__ */ n("label", { className: "flex flex-col gap-0.5", children: [
65
+ /* @__PURE__ */ t(
66
+ "span",
67
+ {
68
+ className: "text-base-content text-[11px] font-medium",
69
+ "data-tooltip-id": x,
70
+ "data-tooltip-content": "State key to write the computed result to. Anchor tokens ({{anchor.X}}) are supported.",
71
+ "data-tooltip-place": "left",
72
+ children: "Output key"
73
+ }
74
+ ),
75
+ /* @__PURE__ */ t(
76
+ "input",
77
+ {
78
+ type: "text",
79
+ className: "input input-xs font-mono",
80
+ value: i.key,
81
+ placeholder: "pdp:matching-variant",
82
+ onChange: (e) => r({ ...i, key: e.target.value }),
83
+ "aria-label": "Output state key"
84
+ }
85
+ )
86
+ ] }),
87
+ /* @__PURE__ */ n("label", { className: "flex flex-col gap-0.5", children: [
88
+ /* @__PURE__ */ t("span", { className: "text-base-content text-[11px] font-medium", children: "Compute type" }),
89
+ /* @__PURE__ */ t(
90
+ P,
91
+ {
92
+ value: a.type,
93
+ onChange: (e) => {
94
+ r({ ...i, compute: { type: e } });
95
+ },
96
+ chevron: !0,
97
+ children: g.map((e) => /* @__PURE__ */ t("option", { value: e.value, children: e.label }, e.value))
98
+ }
99
+ ),
100
+ /* @__PURE__ */ t("p", { className: "text-neutral-content text-[9px]", children: (m = g.find((e) => e.value === a.type)) == null ? void 0 : m.description })
101
+ ] }),
102
+ !u && /* @__PURE__ */ n("label", { className: "flex flex-col gap-0.5", children: [
103
+ /* @__PURE__ */ t(
104
+ "span",
105
+ {
106
+ className: "text-base-content text-[11px] font-medium",
107
+ "data-tooltip-id": x,
108
+ "data-tooltip-content": "Input state keys — one per line. The computer reads each key from the registry and combines them per the selected type.",
109
+ "data-tooltip-place": "left",
110
+ children: "Input keys (one per line)"
111
+ }
112
+ ),
113
+ /* @__PURE__ */ t(
114
+ "textarea",
115
+ {
116
+ className: "textarea textarea-xs font-mono text-[10px]",
117
+ rows: 3,
118
+ value: (i.from ?? []).join(`
119
+ `),
120
+ onChange: (e) => d(e.target.value),
121
+ placeholder: `url:q
122
+ url:category`,
123
+ "aria-label": "Input state keys"
124
+ }
125
+ )
126
+ ] }),
127
+ a.type === "join" && /* @__PURE__ */ n("label", { className: "flex flex-col gap-0.5", children: [
128
+ /* @__PURE__ */ t("span", { className: "text-base-content text-[11px] font-medium", children: "Separator" }),
129
+ /* @__PURE__ */ t(
130
+ "input",
131
+ {
132
+ type: "text",
133
+ className: "input input-xs font-mono",
134
+ value: a.separator ?? ",",
135
+ onChange: (e) => s({
136
+ separator: e.target.value
137
+ }),
138
+ placeholder: ",",
139
+ "aria-label": "Join separator"
140
+ }
141
+ )
142
+ ] }),
143
+ a.type === "variant-match" && /* @__PURE__ */ n(f, { children: [
144
+ /* @__PURE__ */ n("label", { className: "flex flex-col gap-0.5", children: [
145
+ /* @__PURE__ */ t(
146
+ "span",
147
+ {
148
+ className: "text-base-content text-[11px] font-medium",
149
+ "data-tooltip-id": x,
150
+ "data-tooltip-content": "State key containing the serialised variant map JSON array. Typically {{item.variants}} inside a Data repeater.",
151
+ "data-tooltip-place": "left",
152
+ children: "Variant map (state key or JSON)"
153
+ }
154
+ ),
155
+ /* @__PURE__ */ t(
156
+ "input",
157
+ {
158
+ type: "text",
159
+ className: "input input-xs font-mono",
160
+ value: a.variantMap ?? "",
161
+ onChange: (e) => s({
162
+ variantMap: e.target.value
163
+ }),
164
+ placeholder: "{{item.variants}}",
165
+ "aria-label": "Variant map"
166
+ }
167
+ )
168
+ ] }),
169
+ /* @__PURE__ */ n("label", { className: "flex flex-col gap-0.5", children: [
170
+ /* @__PURE__ */ t(
171
+ "span",
172
+ {
173
+ className: "text-base-content text-[11px] font-medium",
174
+ "data-tooltip-id": x,
175
+ "data-tooltip-content": 'Comma-separated axis names, e.g. "Size,Color". Must match the keys in the variant map.',
176
+ "data-tooltip-place": "left",
177
+ children: "Axes (CSV)"
178
+ }
179
+ ),
180
+ /* @__PURE__ */ t(
181
+ "input",
182
+ {
183
+ type: "text",
184
+ className: "input input-xs font-mono",
185
+ value: Array.isArray(a.axes) ? a.axes.join(",") : a.axes ?? "",
186
+ onChange: (e) => s({
187
+ axes: e.target.value
188
+ }),
189
+ placeholder: "Size,Color",
190
+ "aria-label": "Axes"
191
+ }
192
+ )
193
+ ] }),
194
+ /* @__PURE__ */ n("label", { className: "flex flex-col gap-0.5", children: [
195
+ /* @__PURE__ */ t(
196
+ "span",
197
+ {
198
+ className: "text-base-content text-[11px] font-medium",
199
+ "data-tooltip-id": x,
200
+ "data-tooltip-content": "Template for the per-axis state key. %axis% is replaced with the axis name. E.g. pdp:axis:%axis% → pdp:axis:Size, pdp:axis:Color.",
201
+ "data-tooltip-place": "left",
202
+ children: "Axis key template"
203
+ }
204
+ ),
205
+ /* @__PURE__ */ t(
206
+ "input",
207
+ {
208
+ type: "text",
209
+ className: "input input-xs font-mono",
210
+ value: a.axisKeyTemplate ?? "",
211
+ onChange: (e) => s({
212
+ axisKeyTemplate: e.target.value
213
+ }),
214
+ placeholder: "pdp:axis:%axis%",
215
+ "aria-label": "Axis key template"
216
+ }
217
+ )
218
+ ] })
219
+ ] }),
220
+ a.type === "variant-axis-availability" && /* @__PURE__ */ n(f, { children: [
221
+ /* @__PURE__ */ n("label", { className: "flex flex-col gap-0.5", children: [
222
+ /* @__PURE__ */ t("span", { className: "text-base-content text-[11px] font-medium", children: "Variant map (state key or JSON)" }),
223
+ /* @__PURE__ */ t(
224
+ "input",
225
+ {
226
+ type: "text",
227
+ className: "input input-xs font-mono",
228
+ value: a.variantMap ?? "",
229
+ onChange: (e) => s(
230
+ { variantMap: e.target.value }
231
+ ),
232
+ placeholder: "{{item.variants}}",
233
+ "aria-label": "Variant map"
234
+ }
235
+ )
236
+ ] }),
237
+ /* @__PURE__ */ n("label", { className: "flex flex-col gap-0.5", children: [
238
+ /* @__PURE__ */ t(
239
+ "span",
240
+ {
241
+ className: "text-base-content text-[11px] font-medium",
242
+ "data-tooltip-id": x,
243
+ "data-tooltip-content": "The axis whose availability you are computing, e.g. Color.",
244
+ "data-tooltip-place": "left",
245
+ children: "Axis"
246
+ }
247
+ ),
248
+ /* @__PURE__ */ t(
249
+ "input",
250
+ {
251
+ type: "text",
252
+ className: "input input-xs font-mono",
253
+ value: a.axis ?? "",
254
+ onChange: (e) => s(
255
+ { axis: e.target.value }
256
+ ),
257
+ placeholder: "Color",
258
+ "aria-label": "Axis"
259
+ }
260
+ )
261
+ ] }),
262
+ /* @__PURE__ */ n("label", { className: "flex flex-col gap-0.5", children: [
263
+ /* @__PURE__ */ t(
264
+ "span",
265
+ {
266
+ className: "text-base-content text-[11px] font-medium",
267
+ "data-tooltip-id": x,
268
+ "data-tooltip-content": 'CSV of the other axes to consider when determining availability, e.g. "Size".',
269
+ "data-tooltip-place": "left",
270
+ children: "Other axes (CSV)"
271
+ }
272
+ ),
273
+ /* @__PURE__ */ t(
274
+ "input",
275
+ {
276
+ type: "text",
277
+ className: "input input-xs font-mono",
278
+ value: Array.isArray(a.otherAxes) ? a.otherAxes.join(",") : a.otherAxes ?? "",
279
+ onChange: (e) => s(
280
+ { otherAxes: e.target.value }
281
+ ),
282
+ placeholder: "Size",
283
+ "aria-label": "Other axes"
284
+ }
285
+ )
286
+ ] }),
287
+ /* @__PURE__ */ n("label", { className: "flex flex-col gap-0.5", children: [
288
+ /* @__PURE__ */ t("span", { className: "text-base-content text-[11px] font-medium", children: "Axis key template" }),
289
+ /* @__PURE__ */ t(
290
+ "input",
291
+ {
292
+ type: "text",
293
+ className: "input input-xs font-mono",
294
+ value: a.axisKeyTemplate ?? "",
295
+ onChange: (e) => s(
296
+ { axisKeyTemplate: e.target.value }
297
+ ),
298
+ placeholder: "pdp:axis:%axis%",
299
+ "aria-label": "Axis key template"
300
+ }
301
+ )
302
+ ] })
303
+ ] })
304
+ ] })
305
+ }
306
+ );
307
+ }
308
+ function B({
309
+ binding: i,
310
+ onChange: r,
311
+ onRemove: p
312
+ }) {
313
+ var h;
314
+ const [o, a] = b(!1), { triggerRef: s, initialPos: d, setInitialPos: u, computePosition: m } = k(O), e = () => {
315
+ u(m()), a(!0);
316
+ }, l = ((h = g.find((y) => y.value === i.compute.type)) == null ? void 0 : h.label) ?? i.compute.type, c = `${i.key || "(no output key)"} ← ${l}`;
317
+ return /* @__PURE__ */ n(f, { children: [
318
+ /* @__PURE__ */ t(
319
+ v,
320
+ {
321
+ mode: "popover",
322
+ ref: s,
323
+ label: "Computed",
324
+ open: o,
325
+ onTriggerClick: () => o ? a(!1) : e(),
326
+ onClear: () => {
327
+ o && a(!1), p();
328
+ },
329
+ triggerAriaLabel: "Edit computed binding",
330
+ clearAriaLabel: "Remove computed binding",
331
+ leading: /* @__PURE__ */ t(A, { className: "size-3.5", "aria-hidden": !0 }),
332
+ summary: c
333
+ }
334
+ ),
335
+ o && /* @__PURE__ */ t(
336
+ V,
337
+ {
338
+ binding: i,
339
+ onChange: r,
340
+ initialPosition: d,
341
+ onClose: () => a(!1)
342
+ }
343
+ )
344
+ ] });
345
+ }
346
+ const K = 380;
347
+ function L({
348
+ value: i,
349
+ onChange: r,
350
+ initialPosition: p,
351
+ onClose: o
352
+ }) {
353
+ return /* @__PURE__ */ t(
354
+ C,
355
+ {
356
+ isOpen: !0,
357
+ onClose: o,
358
+ title: "Visibility state key",
359
+ storageKey: "visibility-state-key-editor",
360
+ minWidth: 380,
361
+ maxWidth: 520,
362
+ minHeight: 180,
363
+ initialPosition: p,
364
+ zIndex: N,
365
+ scrollable: !0,
366
+ children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: [
367
+ /* @__PURE__ */ n("p", { className: "text-neutral-content text-[11px] leading-snug", children: [
368
+ "The key in the state registry that controls this container's visibility. Defaults to the container's DOM id. Anchor tokens like",
369
+ " ",
370
+ /* @__PURE__ */ t("code", { className: "font-mono", children: "{{anchor.X}}" }),
371
+ " are supported."
372
+ ] }),
373
+ /* @__PURE__ */ t(v, { children: /* @__PURE__ */ t(
374
+ "input",
375
+ {
376
+ type: "text",
377
+ className: "input-plain w-full font-mono",
378
+ value: i,
379
+ placeholder: "e.g. cart:open",
380
+ onChange: (a) => r(a.target.value),
381
+ "aria-label": "Visibility state key",
382
+ autoComplete: "off",
383
+ spellCheck: !1,
384
+ autoFocus: !0
385
+ }
386
+ ) })
387
+ ] })
388
+ }
389
+ );
390
+ }
391
+ function w({
392
+ value: i,
393
+ onChange: r,
394
+ onClear: p
395
+ }) {
396
+ const [o, a] = b(!1), { triggerRef: s, initialPos: d, setInitialPos: u, computePosition: m } = k(K), e = () => {
397
+ u(m()), a(!0);
398
+ };
399
+ return /* @__PURE__ */ n(f, { children: [
400
+ /* @__PURE__ */ t(
401
+ v,
402
+ {
403
+ mode: "popover",
404
+ ref: s,
405
+ label: "Visibility",
406
+ open: o,
407
+ onTriggerClick: () => o ? a(!1) : e(),
408
+ onClear: () => {
409
+ o && a(!1), p();
410
+ },
411
+ triggerAriaLabel: "Edit visibility state key",
412
+ clearAriaLabel: "Clear visibility state key",
413
+ leading: /* @__PURE__ */ t(T, { className: "size-3.5", "aria-hidden": !0 }),
414
+ summary: i || "(uses element id)"
415
+ }
416
+ ),
417
+ o && /* @__PURE__ */ t(
418
+ L,
419
+ {
420
+ value: i,
421
+ onChange: r,
422
+ initialPosition: d,
423
+ onClose: () => a(!1)
424
+ }
425
+ )
426
+ ] });
427
+ }
428
+ const _ = () => {
429
+ const {
430
+ actions: { setProp: i },
431
+ visibilityStateKey: r,
432
+ computedStateBindings: p
433
+ } = S((e) => {
434
+ var l, c, h, y;
435
+ return {
436
+ visibilityStateKey: (c = (l = e.data) == null ? void 0 : l.props) == null ? void 0 : c.visibilityStateKey,
437
+ computedStateBindings: (y = (h = e.data) == null ? void 0 : h.props) == null ? void 0 : y.computedStateBindings
438
+ };
439
+ }), o = p ?? [], a = typeof r == "string", s = (e) => {
440
+ i((l) => {
441
+ l.visibilityStateKey = e;
442
+ });
443
+ }, d = () => {
444
+ i((e) => {
445
+ delete e.visibilityStateKey;
446
+ });
447
+ }, u = (e, l) => {
448
+ i((c) => {
449
+ c.computedStateBindings && (c.computedStateBindings[e] = l);
450
+ });
451
+ }, m = (e) => {
452
+ i((l) => {
453
+ l.computedStateBindings && (l.computedStateBindings.splice(e, 1), l.computedStateBindings.length === 0 && delete l.computedStateBindings);
454
+ });
455
+ };
456
+ return !a && o.length === 0 ? null : /* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
457
+ a && /* @__PURE__ */ t(
458
+ w,
459
+ {
460
+ value: r ?? "",
461
+ onChange: s,
462
+ onClear: d
463
+ }
464
+ ),
465
+ o.map((e, l) => /* @__PURE__ */ t(
466
+ B,
467
+ {
468
+ binding: e,
469
+ onChange: (c) => u(l, c),
470
+ onRemove: () => m(l)
471
+ },
472
+ l
473
+ ))
474
+ ] });
475
+ };
476
+ export {
477
+ _ as ContainerStateBody
478
+ };
@@ -0,0 +1,135 @@
1
+ import { jsxs as r, jsx as a } from "react/jsx-runtime";
2
+ import { useEditor as C } from "@craftjs/core";
3
+ import { ROOT_NODE as N } from "@craftjs/utils";
4
+ import { C as u } from "./index-C66dAl3Q.js";
5
+ function w(t, n, p = "Click") {
6
+ if (n) {
7
+ const o = n.toLowerCase();
8
+ if (o.startsWith("tel:")) return "Phone Call";
9
+ if (o.startsWith("mailto:")) return "Contact";
10
+ if (/maps\.(google|apple)|google\.com\/maps/.test(o)) return "Get Directions";
11
+ }
12
+ return t === "add-to-cart" ? "AddToCart" : t === "download-file" ? "Download" : t === "cart-checkout" ? "InitiateCheckout" : p;
13
+ }
14
+ const g = {
15
+ "google-ads": "Google Ads",
16
+ ga4: "Google Analytics (GA4)",
17
+ meta: "Meta Pixel"
18
+ };
19
+ function O({
20
+ conversion: t,
21
+ onChange: n,
22
+ actionType: p,
23
+ href: o,
24
+ fallbackEventName: v = "Click"
25
+ }) {
26
+ const s = C((e) => {
27
+ var d, c, m, f, h, x;
28
+ const l = ((m = (c = (d = e.nodes[N]) == null ? void 0 : d.data) == null ? void 0 : c.props) == null ? void 0 : m.integrations) || {};
29
+ return {
30
+ "google-ads": !!((f = l.googleAds) != null && f.conversionId),
31
+ ga4: !!((h = l.googleAnalytics) != null && h.measurementId),
32
+ meta: !!((x = l.metaPixel) != null && x.pixelId)
33
+ };
34
+ }), b = () => {
35
+ n({
36
+ provider: s.ga4 ? "ga4" : s["google-ads"] ? "google-ads" : "ga4",
37
+ eventName: w(p, o, v)
38
+ });
39
+ }, i = (e) => {
40
+ t && n({ ...t, ...e });
41
+ };
42
+ return /* @__PURE__ */ r(
43
+ "details",
44
+ {
45
+ open: !!t,
46
+ className: "border-base-300 mt-1 overflow-hidden rounded-md border",
47
+ onToggle: (e) => {
48
+ const l = e.currentTarget;
49
+ l.open && !t ? b() : !l.open && t && n(void 0);
50
+ },
51
+ children: [
52
+ /* @__PURE__ */ r("summary", { className: "bg-base-200/40 hover:bg-base-200 text-base-content cursor-pointer px-2 py-1.5 text-xs font-semibold select-none", children: [
53
+ "Track conversion ",
54
+ t ? "· on" : ""
55
+ ] }),
56
+ t ? /* @__PURE__ */ r("div", { className: "flex flex-col gap-1.5 p-2", children: [
57
+ /* @__PURE__ */ a(u, { children: /* @__PURE__ */ a(
58
+ "select",
59
+ {
60
+ value: t.provider,
61
+ onChange: (e) => {
62
+ const l = e.target.value, d = { provider: l };
63
+ l !== "google-ads" && (d.sendTo = void 0), i(d);
64
+ },
65
+ className: "h-full w-full bg-transparent px-1 text-xs outline-none",
66
+ "aria-label": "Conversion provider",
67
+ children: Object.keys(g).map((e) => /* @__PURE__ */ r("option", { value: e, disabled: !s[e], children: [
68
+ g[e],
69
+ s[e] ? "" : " (set up first)"
70
+ ] }, e))
71
+ }
72
+ ) }),
73
+ t.provider === "google-ads" ? /* @__PURE__ */ a(u, { children: /* @__PURE__ */ a(
74
+ "input",
75
+ {
76
+ type: "text",
77
+ defaultValue: t.sendTo || "",
78
+ onChange: (e) => i({ sendTo: e.target.value }),
79
+ placeholder: "AW-XXXXXXXXXX/AbCdEfGhIj",
80
+ className: "h-full w-full bg-transparent px-1 text-xs outline-none",
81
+ "aria-label": "Conversion send-to label",
82
+ pattern: "^AW-\\d+/[\\w-]+$"
83
+ }
84
+ ) }) : null,
85
+ t.provider !== "google-ads" ? /* @__PURE__ */ a(u, { children: /* @__PURE__ */ a(
86
+ "input",
87
+ {
88
+ type: "text",
89
+ defaultValue: t.eventName,
90
+ onChange: (e) => i({ eventName: e.target.value }),
91
+ placeholder: "Event name",
92
+ className: "h-full w-full bg-transparent px-1 text-xs outline-none",
93
+ "aria-label": "Event name"
94
+ }
95
+ ) }) : null,
96
+ /* @__PURE__ */ r("div", { className: "flex gap-1.5", children: [
97
+ /* @__PURE__ */ a(u, { children: /* @__PURE__ */ a(
98
+ "input",
99
+ {
100
+ type: "number",
101
+ step: "0.01",
102
+ defaultValue: t.value ?? "",
103
+ onChange: (e) => i({
104
+ value: e.target.value === "" ? void 0 : Number(e.target.value)
105
+ }),
106
+ placeholder: "Value (optional)",
107
+ className: "h-full w-full bg-transparent px-1 text-xs outline-none",
108
+ "aria-label": "Conversion value"
109
+ }
110
+ ) }),
111
+ /* @__PURE__ */ a(u, { children: /* @__PURE__ */ a(
112
+ "input",
113
+ {
114
+ type: "text",
115
+ defaultValue: t.currency || "",
116
+ onChange: (e) => i({ currency: e.target.value ? e.target.value.toUpperCase() : void 0 }),
117
+ placeholder: "USD",
118
+ maxLength: 3,
119
+ className: "h-full w-full bg-transparent px-1 text-xs uppercase outline-none",
120
+ "aria-label": "Currency"
121
+ }
122
+ ) })
123
+ ] }),
124
+ s[t.provider] ? null : /* @__PURE__ */ r("p", { className: "text-warning text-[10px] leading-snug", children: [
125
+ g[t.provider],
126
+ " isn’t set up at the site level. Add its integration ID in your site’s settings or this conversion won’t fire."
127
+ ] })
128
+ ] }) : null
129
+ ]
130
+ }
131
+ );
132
+ }
133
+ export {
134
+ O as C
135
+ };
@@ -0,0 +1,73 @@
1
+ import { jsx as g } from "react/jsx-runtime";
2
+ import { useEditor as L } from "@craftjs/core";
3
+ import { dS as R, I as S, P as h, dl as j } from "./index-C66dAl3Q.js";
4
+ import { L as w } from "./ListEditor-mD-CmRNE.js";
5
+ function q({
6
+ parentId: r,
7
+ childTypeName: s,
8
+ filterChild: b,
9
+ mapItem: B,
10
+ activeIndex: O,
11
+ setActiveIndex: d,
12
+ addLabel: A,
13
+ onAdd: _,
14
+ renderLabel: p,
15
+ renderPopover: C,
16
+ editTooltip: x
17
+ }) {
18
+ const { actions: a, query: l } = L(), E = R(S), { items: u } = L((e, t) => {
19
+ try {
20
+ return { items: (t.node(r).get().data.nodes ?? []).map((n, i) => {
21
+ try {
22
+ const f = t.node(n).get();
23
+ return s && f.data.name !== s || b && !b(f) ? null : { id: n, ...B(f, n, i) };
24
+ } catch {
25
+ return null;
26
+ }
27
+ }).filter(Boolean) };
28
+ } catch {
29
+ return { items: [] };
30
+ }
31
+ }), N = (e) => {
32
+ E.setState(!0);
33
+ const t = l.parseReactElement(e).toNodeTree();
34
+ return a.addNodeTree(t, r), d(u.length), requestAnimationFrame(() => E.setState(!1)), t == null ? void 0 : t.rootNodeId;
35
+ }, c = x === null ? null : x ?? `Edit ${(s == null ? void 0 : s.toLowerCase()) ?? "item"}`;
36
+ return /* @__PURE__ */ g(
37
+ w,
38
+ {
39
+ items: u,
40
+ activeIndex: O,
41
+ setActiveIndex: d,
42
+ addLabel: A,
43
+ renderLabel: p,
44
+ renderPopover: C,
45
+ onDelete: (e) => a.delete(e.id),
46
+ onAdd: () => _({ parentId: r, query: l, actions: a, addNode: N }),
47
+ onReorder: (e, t) => {
48
+ const o = u, m = o[e];
49
+ if (!m) return;
50
+ const n = l.node(r).get().data.nodes ?? [], i = t >= o.length - 1 ? n.indexOf(o[o.length - 1].id) + 1 : n.indexOf(o[t].id);
51
+ i < 0 || (a.move(m.id, r, i), d(t));
52
+ },
53
+ extraButtons: c ? (e) => [
54
+ /* @__PURE__ */ g(
55
+ "button",
56
+ {
57
+ type: "button",
58
+ className: "text-base-content hover:text-primary flex items-center justify-center transition-colors",
59
+ "data-tooltip-id": h,
60
+ "data-tooltip-content": c,
61
+ onClick: () => a.selectNode(e.id),
62
+ "aria-label": c,
63
+ children: /* @__PURE__ */ g(j, { className: "h-3.5 w-3.5" })
64
+ },
65
+ "edit"
66
+ )
67
+ ] : void 0
68
+ }
69
+ );
70
+ }
71
+ export {
72
+ q as C
73
+ };