@pagehub/sdk 0.1.5 → 0.1.6

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 (141) 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/package.json +22 -13
  140. package/dist/pagehub-viewer.umd.cjs +0 -574
  141. package/dist/pagehub.umd.cjs +0 -1130
@@ -0,0 +1,38 @@
1
+ const i = [], y = [];
2
+ let o = null, u = null;
3
+ function h() {
4
+ return u || (u = new Map(y.map((e) => [e.id, e]))), u;
5
+ }
6
+ function g() {
7
+ if (!o) {
8
+ o = /* @__PURE__ */ new Map();
9
+ for (const e of i) {
10
+ const n = o.get(e.section);
11
+ n ? n.push(e) : o.set(e.section, [e]);
12
+ }
13
+ }
14
+ return o;
15
+ }
16
+ function w(e) {
17
+ return h().get(e);
18
+ }
19
+ function I(e) {
20
+ var d, r;
21
+ let n;
22
+ if (e != null && e.section ? n = [...g().get(e.section) || []] : n = [...i], !(e != null && e.search) && !(e != null && e.includeSearchOnly) && (n = n.filter((s) => !s.searchOnly)), (d = e == null ? void 0 : e.hidden) != null && d.size && (n = n.filter((s) => !s.hideKey || !e.hidden.has(s.hideKey))), (r = e == null ? void 0 : e.hiddenIds) != null && r.size && (n = n.filter((s) => !e.hiddenIds.has(s.id))), e != null && e.search) {
23
+ const s = e.search.toLowerCase().trim();
24
+ if (s) {
25
+ const t = h();
26
+ n = n.filter((c) => {
27
+ if (c.label.toLowerCase().includes(s) || c.id.toLowerCase().includes(s) || c.keywords.some((p) => p.includes(s))) return !0;
28
+ const a = t.get(c.section);
29
+ return !!(a && a.title.toLowerCase().includes(s));
30
+ });
31
+ }
32
+ }
33
+ return n.sort((s, t) => (s.sortOrder ?? 100) - (t.sortOrder ?? 100)), n;
34
+ }
35
+ export {
36
+ I as a,
37
+ w as g
38
+ };
@@ -0,0 +1,31 @@
1
+ function g(n, e) {
2
+ var o, i, f;
3
+ const c = {};
4
+ let r = n;
5
+ const s = /* @__PURE__ */ new Set();
6
+ for (; r && !s.has(r); ) {
7
+ s.add(r);
8
+ let t;
9
+ try {
10
+ t = e.node(r).get();
11
+ } catch {
12
+ break;
13
+ }
14
+ const a = (i = (o = t == null ? void 0 : t.data) == null ? void 0 : o.custom) == null ? void 0 : i.anchors;
15
+ if (a)
16
+ for (const h in a)
17
+ h in c || (c[h] = a[h]);
18
+ r = (f = t == null ? void 0 : t.data) == null ? void 0 : f.parent;
19
+ }
20
+ return c;
21
+ }
22
+ const u = /\{\{anchor\.([a-zA-Z0-9_-]+)\}\}/g;
23
+ function d(n, e, c) {
24
+ if (!n || !n.includes("{{anchor.") || !e) return n;
25
+ const r = g(e, c);
26
+ return n.replace(u, (s, o) => r[o] ?? "");
27
+ }
28
+ export {
29
+ g,
30
+ d as r
31
+ };
@@ -0,0 +1,370 @@
1
+ import "react/jsx-runtime";
2
+ import { ROOT_NODE as S } from "@craftjs/utils";
3
+ import { Element as L } from "@craftjs/core";
4
+ import $ from "react";
5
+ import { a_ as I, cP as G, cQ as w, b_ as z, aE as K } from "./index-C66dAl3Q.js";
6
+ function H(e) {
7
+ const t = e.history.merge();
8
+ let n = !0;
9
+ const r = () => n ? (n = !1, e) : t;
10
+ return {
11
+ addNodeTree: (o, s, i) => r().addNodeTree(o, s, i),
12
+ move: (o, s, i) => r().move(o, s, i),
13
+ delete: (o) => r().delete(o),
14
+ setProp: (o, s) => r().setProp(o, s),
15
+ setCustom: (o, s) => r().setCustom(o, s)
16
+ };
17
+ }
18
+ function _(e) {
19
+ return e.classes ? e.classes.split(/\s+/).filter(Boolean) : e.expands ? e.expands.split(/\s+/).filter(Boolean) : [e.name];
20
+ }
21
+ function Q(e, t) {
22
+ if (!(t != null && t.trim())) return !0;
23
+ const n = new Set(e.split(/\s+/).filter(Boolean));
24
+ return t.split(/\s+/).filter(Boolean).every((r) => n.has(r));
25
+ }
26
+ function U(e, t) {
27
+ if (!Q(e, t.requires)) return !1;
28
+ const n = e.split(/\s+/).filter(Boolean), r = new Set(n);
29
+ return _(t).every((s) => r.has(s));
30
+ }
31
+ function D(e) {
32
+ return e.peerInherit === !1 ? !1 : e.peerInherit === !0 ? !0 : e.category !== "State";
33
+ }
34
+ function V(e, t) {
35
+ var n;
36
+ return (n = t.removes) != null && n.length ? e.filter((r) => {
37
+ for (const o of t.removes)
38
+ if (o.endsWith("*")) {
39
+ const s = o.slice(0, -1);
40
+ if (r.startsWith(s)) return !1;
41
+ } else if (r === o) return !1;
42
+ return !0;
43
+ }) : e;
44
+ }
45
+ function X(e, t, n) {
46
+ if (t.exclusive && t.category) {
47
+ const s = n.filter(
48
+ (i) => i.category === t.category && i.exclusive && i.name !== t.name && D(i)
49
+ );
50
+ for (const i of s) {
51
+ const a = _(i);
52
+ for (let f = e.length - 1; f >= 0; f--)
53
+ a.includes(e[f]) && e.splice(f, 1);
54
+ }
55
+ }
56
+ let r = V([...e], t);
57
+ if (t.requires)
58
+ for (const s of t.requires.split(/\s+/).filter(Boolean))
59
+ r.includes(s) || r.push(s);
60
+ const o = _(t);
61
+ for (const s of o)
62
+ r.includes(s) || r.push(s);
63
+ e.length = 0, e.push(...r);
64
+ }
65
+ function W(e) {
66
+ return e.startsWith("btn") ? !1 : !!(e.startsWith("rounded") || e.startsWith("!rounded") || e === "border" || e.startsWith("border-") || e === "uppercase" || e === "lowercase" || e === "capitalize" || e.startsWith("tracking-") || /^font-(bold|semibold|medium|normal|black)$/.test(e) || /^text-(xs|sm|base|lg|xl|2xl)$/.test(e) || e.startsWith("px-") || e.startsWith("py-") || e.startsWith("min-h-") || e.startsWith("min-w-") || e.startsWith("self-") || e === "w-full" || /^md:w-/.test(e) || /^sm:w-/.test(e) || /^lg:w-/.test(e) || e.startsWith("gap-"));
67
+ }
68
+ function Y(e, t) {
69
+ const r = e.split(/\s+/).filter(Boolean).filter(W);
70
+ if (r.length === 0) return;
71
+ const o = t.filter((s) => !W(s));
72
+ t.length = 0, t.push(...o);
73
+ for (const s of r)
74
+ t.includes(s) || t.push(s);
75
+ }
76
+ function J(e, t, n, r) {
77
+ var k, P, O, B, R;
78
+ const o = t.node(n).get(), s = (k = o == null ? void 0 : o.data) == null ? void 0 : k.name;
79
+ if (!s) return;
80
+ const i = w(s), a = i == null ? void 0 : i.peerInherit;
81
+ if (!a) {
82
+ I.log(`[peerInherit] skip ${s} ${n}: no peerInherit config on def`);
83
+ return;
84
+ }
85
+ const f = t.node(r).get(), u = (P = f == null ? void 0 : f.data) == null ? void 0 : P.name;
86
+ if (!u || !a.whenParentIs.includes(u)) {
87
+ I.log(
88
+ `[peerInherit] skip ${s} ${n}: parent ${u} not in [${a.whenParentIs.join(",")}]`
89
+ );
90
+ return;
91
+ }
92
+ const c = ((O = f.data) == null ? void 0 : O.nodes) || [], m = c.indexOf(n);
93
+ if (m < 0) return;
94
+ const C = (g) => {
95
+ var N, p;
96
+ try {
97
+ return ((p = (N = t.node(g).get()) == null ? void 0 : N.data) == null ? void 0 : p.name) === s;
98
+ } catch {
99
+ return !1;
100
+ }
101
+ };
102
+ let d = null;
103
+ const y = (g, N) => {
104
+ let p = g;
105
+ for (; p >= 0 && p < c.length; ) {
106
+ if (p !== m && C(c[p])) return c[p];
107
+ p += N;
108
+ }
109
+ return null;
110
+ };
111
+ if (a.reference === "left-neighbor" ? d = y(m - 1, -1) ?? y(m + 1, 1) : d = y(m + 1, 1) ?? y(m - 1, -1), !d || d === n) {
112
+ I.log(
113
+ `[peerInherit] skip ${s} ${n}: no same-kind sibling in parent ${r}`
114
+ );
115
+ return;
116
+ }
117
+ const l = t.node(d).get(), T = ((R = (B = l == null ? void 0 : l.data) == null ? void 0 : B.props) == null ? void 0 : R.className) || "";
118
+ if (!T.trim()) {
119
+ I.log(
120
+ `[peerInherit] skip ${s} ${n}: reference sibling ${d} has empty className`
121
+ );
122
+ return;
123
+ }
124
+ const b = G(i.name).filter(D);
125
+ e.setProp(n, (g) => {
126
+ if (!g || typeof g != "object") return;
127
+ const N = g.className || "";
128
+ let p = N.split(/\s+/).filter(Boolean);
129
+ const E = [];
130
+ for (const A of b)
131
+ U(T, A) && (X(p, A, b), E.includes(A.name) || E.push(A.name));
132
+ Y(T, p), g.className = p.join(" ").replace(/\s+/g, " ").trim(), g.root || (g.root = {}), g.root.activeModifiers = E, I.log(
133
+ `[peerInherit] applied ${s} ${n} ← ref ${d}
134
+ ref: ${T}
135
+ before: ${N}
136
+ after: ${g.className}
137
+ mods: [${E.join(", ")}]`
138
+ );
139
+ });
140
+ }
141
+ const Z = "bg-base-100 text-base-content w-full flex flex-col items-center gap-space-md py-space-lg px-container-x", F = "flex flex-row flex-wrap gap-space-md w-full max-w-page mx-auto", q = "flex flex-col gap-space-md flex-1 min-w-0 bg-base-200 text-base-content rounded-xl p-space-md shadow-sm", ee = "flex flex-col gap-space-xs w-full";
142
+ function te(e) {
143
+ return e.parseReactElement(
144
+ $.createElement(L, {
145
+ canvas: !0,
146
+ is: z,
147
+ canDelete: !0,
148
+ canEditName: !0,
149
+ className: F,
150
+ custom: { displayName: "Content" }
151
+ })
152
+ ).toNodeTree();
153
+ }
154
+ function ne(e, t, n) {
155
+ var s;
156
+ const r = ((s = t == null ? void 0 : t.data) == null ? void 0 : s.nodes) || [], o = [];
157
+ for (const i of r) {
158
+ if (i === n) continue;
159
+ const a = e.node(i).get();
160
+ a && o.push(a);
161
+ }
162
+ return o;
163
+ }
164
+ function re(e, t, n) {
165
+ var f, u, c, m, C, d, y;
166
+ const r = e.node(t).get();
167
+ if (!r) return null;
168
+ const o = e.node(n).get();
169
+ if (!o) return null;
170
+ const s = (f = o.data) == null ? void 0 : f.parent, i = s ? e.node(s).get() : null, a = ne(e, o, t);
171
+ return {
172
+ nodeId: t,
173
+ parentId: n,
174
+ node: r,
175
+ parent: o,
176
+ parentType: (c = (u = o.data) == null ? void 0 : u.props) == null ? void 0 : c.type,
177
+ parentClassName: ((C = (m = o.data) == null ? void 0 : m.props) == null ? void 0 : C.className) || "",
178
+ grandparent: i,
179
+ grandparentType: (y = (d = i == null ? void 0 : i.data) == null ? void 0 : d.props) == null ? void 0 : y.type,
180
+ siblings: a,
181
+ siblingCount: a.length,
182
+ isEmptyParent: a.length === 0,
183
+ query: e
184
+ };
185
+ }
186
+ const oe = (e) => {
187
+ var n, r;
188
+ const t = (r = (n = e.node.data) == null ? void 0 : n.props) == null ? void 0 : r.type;
189
+ return t === "section" || t === "page" || t === "header" || t === "footer" ? null : e.parentType === "page" ? { kind: "section", parentId: e.parentId } : e.parentType === "section" ? { kind: "content", parentId: e.parentId } : null;
190
+ }, se = (e) => e.parentType === "page" || e.parentType === "section" ? null : e.grandparentType === "section" || e.grandparentType === "page" ? { kind: "card", parentId: e.parentId } : null, ie = (e) => {
191
+ var n, r, o;
192
+ const t = (o = (r = (n = e.parent) == null ? void 0 : n.data) == null ? void 0 : r.custom) == null ? void 0 : o.displayName;
193
+ return t === "Card" || t === "Segment" ? { kind: "segment", parentId: e.parentId } : null;
194
+ }, ae = (e) => ({
195
+ kind: "plainContainer",
196
+ parentId: e.parentId
197
+ }), fe = (e, t, n) => {
198
+ t.setProp(n.nodeId, (o) => {
199
+ o.type = "section", o.className = Z;
200
+ }), t.setCustom(n.nodeId, (o) => {
201
+ o.displayName = "Section";
202
+ });
203
+ const r = te(n.query);
204
+ t.addNodeTree(r, n.nodeId);
205
+ }, ce = (e, t, n) => {
206
+ t.setProp(n.nodeId, (r) => {
207
+ r.className = F;
208
+ }), t.setCustom(n.nodeId, (r) => {
209
+ r.displayName = "Content";
210
+ });
211
+ }, le = (e, t, n) => {
212
+ t.setProp(n.nodeId, (r) => {
213
+ const o = r.className || "";
214
+ !o.includes("card") && !o.includes("bg-base-200") && (r.className = q);
215
+ }), t.setCustom(n.nodeId, (r) => {
216
+ r.displayName = "Card";
217
+ });
218
+ }, ue = (e, t, n) => {
219
+ t.setProp(n.nodeId, (r) => {
220
+ r.className = ee;
221
+ }), t.setCustom(n.nodeId, (r) => {
222
+ r.displayName = "Segment";
223
+ });
224
+ }, h = (e, t, n) => {
225
+ t.setCustom(n.nodeId, (r) => {
226
+ r.displayName = "Container";
227
+ });
228
+ }, de = [
229
+ oe,
230
+ se,
231
+ ie,
232
+ ae
233
+ ], pe = {
234
+ section: fe,
235
+ content: ce,
236
+ card: le,
237
+ segment: ue,
238
+ plainContainer: h,
239
+ // Remaining kinds are wired up as their executors land.
240
+ hero: h,
241
+ cardBody: h,
242
+ stat: h,
243
+ alertBody: h,
244
+ tabItem: h,
245
+ menuItem: h,
246
+ carouselItem: h,
247
+ navbarSegment: h,
248
+ headerGroup: h,
249
+ footerColumn: h,
250
+ formGroup: h
251
+ };
252
+ function me(e, t, n, r) {
253
+ var i, a;
254
+ const o = t.node(n).get();
255
+ if (!o || ((a = (i = o.data) == null ? void 0 : i.custom) == null ? void 0 : a.displayName) !== "Automatic") return;
256
+ const s = re(t, n, r);
257
+ if (s)
258
+ for (const f of de) {
259
+ const u = f(s);
260
+ if (!u) continue;
261
+ const c = pe[u.kind];
262
+ c(u, e, s);
263
+ return;
264
+ }
265
+ }
266
+ const M = "phPendingBlockModifiers";
267
+ function ge(e, t) {
268
+ if (!(!t || typeof t != "object")) {
269
+ e.modifiers || (e.modifiers = {});
270
+ for (const [n, r] of Object.entries(t)) {
271
+ if (!Array.isArray(r)) continue;
272
+ e.modifiers[n] || (e.modifiers[n] = []);
273
+ const o = e.modifiers[n];
274
+ for (const s of r) {
275
+ if (!(s != null && s.name)) continue;
276
+ const i = o.findIndex((a) => (a == null ? void 0 : a.name) === s.name);
277
+ i >= 0 ? o[i] = s : o.push(s);
278
+ }
279
+ }
280
+ }
281
+ }
282
+ function he(e, t) {
283
+ var s, i, a, f;
284
+ if (!((s = e == null ? void 0 : e.nodes) != null && s[t])) return null;
285
+ const n = e.nodes[t], r = (a = (i = n == null ? void 0 : n.data) == null ? void 0 : i.custom) == null ? void 0 : a[M];
286
+ if (r && typeof r == "object") return r;
287
+ const o = (f = n == null ? void 0 : n.custom) == null ? void 0 : f[M];
288
+ return o && typeof o == "object" ? o : null;
289
+ }
290
+ function ye(e, t, n, r, o) {
291
+ var i, a;
292
+ let s = he(o == null ? void 0 : o.insertedTree, n);
293
+ if (!s)
294
+ try {
295
+ const f = t.node(n).get(), u = (a = (i = f == null ? void 0 : f.data) == null ? void 0 : i.custom) == null ? void 0 : a[M];
296
+ u && typeof u == "object" && (s = u);
297
+ } catch {
298
+ }
299
+ s && Object.keys(s).length > 0 && (e.setProp(S, (f) => {
300
+ ge(f, s);
301
+ }), e.setCustom(n, (f) => {
302
+ f && typeof f == "object" && delete f[M];
303
+ })), me(e, t, n, r), J(e, t, n, r);
304
+ }
305
+ K("selectedNode", { id: null, position: "" });
306
+ function j(e) {
307
+ var t, n;
308
+ if (e)
309
+ return typeof e == "string" ? e : ((t = e.craft) == null ? void 0 : t.name) || ((n = e.craft) == null ? void 0 : n.displayName) || e.resolvedName || e.displayName || e.name;
310
+ }
311
+ function x(e, t) {
312
+ if (Array.isArray(e))
313
+ return e.map((c) => x(c, t));
314
+ if (!$.isValidElement(e)) return e;
315
+ const n = e.props ?? {}, { is: r, children: o, ...s } = n;
316
+ let i = e.type;
317
+ if (typeof i == "function") {
318
+ const c = j(i);
319
+ c && t[c] && (i = t[c]);
320
+ }
321
+ let a = r;
322
+ if (r !== void 0) {
323
+ const c = j(r);
324
+ c && t[c] && (a = t[c]);
325
+ }
326
+ const f = o !== void 0 ? Array.isArray(o) ? o.map((c) => x(c, t)) : x(o, t) : o, u = { ...s };
327
+ return a !== void 0 && (u.is = a), f !== void 0 && (u.children = f), i !== e.type ? $.createElement(i, { key: e.key, ...u }) : $.cloneElement(e, u);
328
+ }
329
+ const ke = ({
330
+ element: e,
331
+ actions: t,
332
+ query: n,
333
+ index: r = 1,
334
+ addTo: o = null,
335
+ selected: s = null,
336
+ position: i = ""
337
+ }) => {
338
+ var u, c, m, C;
339
+ if (!e) return;
340
+ let a;
341
+ if (s && !["afterParent", "beforeParent"].includes(i)) {
342
+ const d = n.node(s).get();
343
+ a = ((u = d == null ? void 0 : d.data) == null ? void 0 : u.parent) || S;
344
+ } else
345
+ a = n.getEvent("selected").first() || S, ["afterParent", "beforeParent"].includes(i) && a !== S && (a = n.node(a).get().data.parent);
346
+ const f = n.node(a).get();
347
+ if (!f) return !1;
348
+ s && (r = f.data.nodes.indexOf(s), ["after", "afterParent"].includes(i) ? r += 1 : r -= 1);
349
+ try {
350
+ const d = n.getOptions().resolver, y = d ? x(e, d) : e, l = n.parseReactElement(y).toNodeTree();
351
+ (((C = (m = (c = l == null ? void 0 : l.nodes[l == null ? void 0 : l.rootNodeId]) == null ? void 0 : c.data) == null ? void 0 : m.props) == null ? void 0 : C.type) || "") === "page" && (o = S);
352
+ const v = o ? n.node(o).get() : f;
353
+ if (!v) return !1;
354
+ if (!v.rules.canMoveIn([l == null ? void 0 : l.nodes[l == null ? void 0 : l.rootNodeId]]))
355
+ return I.error("Cant move in.", v, l), !1;
356
+ const b = o || f.id, k = H(t);
357
+ k.addNodeTree(l, b, r);
358
+ const P = l == null ? void 0 : l.rootNodeId;
359
+ return P && ye(k, n, P, b, {
360
+ insertedTree: l
361
+ }), l;
362
+ } catch (d) {
363
+ I.error(d);
364
+ }
365
+ return !1;
366
+ };
367
+ export {
368
+ ke as A,
369
+ H as c
370
+ };
@@ -0,0 +1,15 @@
1
+ const e = {
2
+ backgroundImage: "linear-gradient(45deg, var(--color-base-300, #d4d4d8) 25%, transparent 25%, transparent 75%, var(--color-base-300, #d4d4d8) 75%), linear-gradient(45deg, var(--color-base-300, #d4d4d8) 25%, transparent 25%, transparent 75%, var(--color-base-300, #d4d4d8) 75%)",
3
+ backgroundSize: "8px 8px",
4
+ backgroundPosition: "0 0, 4px 4px"
5
+ };
6
+ function n(s) {
7
+ const r = s.trim().toLowerCase();
8
+ if (r === "transparent") return !0;
9
+ const a = r.match(/^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)/i);
10
+ return !!(a && parseFloat(a[4]) < 1 - 1e-5);
11
+ }
12
+ export {
13
+ e as T,
14
+ n as c
15
+ };
@@ -0,0 +1,15 @@
1
+ import { useEffect as u } from "react";
2
+ import { bF as m } from "./index-C66dAl3Q.js";
3
+ function E(r, e, i, t) {
4
+ let n = m(i);
5
+ u(() => {
6
+ r = r ?? window;
7
+ function o(f) {
8
+ n.current(f);
9
+ }
10
+ return r.addEventListener(e, o, t), () => r.removeEventListener(e, o, t);
11
+ }, [r, e, t]);
12
+ }
13
+ export {
14
+ E
15
+ };
@@ -0,0 +1,41 @@
1
+ import { useEditor as l } from "@craftjs/core";
2
+ function y(t) {
3
+ var s, n, o, i;
4
+ return ((n = (s = t == null ? void 0 : t.data) == null ? void 0 : s.custom) == null ? void 0 : n.displayName) || ((o = t == null ? void 0 : t.data) == null ? void 0 : o.displayName) || ((i = t == null ? void 0 : t.data) == null ? void 0 : i.name) || "Unnamed";
5
+ }
6
+ function g(t) {
7
+ var c, e, a;
8
+ if (!(t != null && t.data)) return;
9
+ const s = ((c = t.data) == null ? void 0 : c.props) || {}, n = ((e = t.data.custom) == null ? void 0 : e.overlay) === !0, o = typeof ((a = s.attrs) == null ? void 0 : a.id) == "string" ? s.attrs.id : void 0, i = typeof s.id == "string" ? s.id : void 0, r = typeof s.anchor == "string" ? s.anchor : void 0;
10
+ return n ? r || o || i : o || i || r;
11
+ }
12
+ function h(t) {
13
+ const { options: s } = l((n) => {
14
+ var i, r, c;
15
+ const o = [];
16
+ for (const [e, a] of Object.entries(n.nodes)) {
17
+ if (!(a != null && a.data)) continue;
18
+ const m = a.data.displayName || a.data.name || "", d = ((i = a.data.custom) == null ? void 0 : i.overlay) === !0, u = g(a), f = y(a);
19
+ if (u) {
20
+ if (t === "modal") {
21
+ if (!d) continue;
22
+ } else if (t === "section") {
23
+ const p = a.data.parent ? n.nodes[a.data.parent] : null;
24
+ if (((c = (r = p == null ? void 0 : p.data) == null ? void 0 : r.props) == null ? void 0 : c.type) !== "page") continue;
25
+ }
26
+ o.push({
27
+ nodeId: e,
28
+ label: f,
29
+ anchor: u,
30
+ componentType: t === "section" ? "Section" : m
31
+ });
32
+ }
33
+ }
34
+ return { options: o };
35
+ });
36
+ return s;
37
+ }
38
+ export {
39
+ g,
40
+ h as u
41
+ };