@pagehub/sdk 0.1.4 → 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,720 @@
1
+ import { jsx as n, jsxs as c, Fragment as j } from "react/jsx-runtime";
2
+ import me, { useState as $, useEffect as Ne, useCallback as re } from "react";
3
+ import { L as ye } from "./ContainerMainTab-kkktm1Ns.js";
4
+ import { useNode as ke, useEditor as Ce } from "@craftjs/core";
5
+ import { f as pe, P as X, a_ as Te, s as Y, eT as De, eU as be, ax as Se, ay as le, a3 as Be, ca as Ae, aB as G, aA as se, al as oe, eV as Ve, u as H, V as we, E as ue, C as Ee, d as $e, M as Pe, J as _e, c as W, t as ie, y as Ie, e as Le } from "./index-C66dAl3Q.js";
6
+ import { S as ze } from "./SearchInput-DRUztbM0.js";
7
+ import { T as Me } from "./ToolbarDashedButton-DbUxGmDg.js";
8
+ function Oe({
9
+ children: e,
10
+ pill: r = !1,
11
+ className: a = "",
12
+ onClick: l,
13
+ onContextMenu: t
14
+ }) {
15
+ const p = r || (typeof e == "number" ? e > 1 : String(e).length > 2);
16
+ return /* @__PURE__ */ n(
17
+ l ? "button" : "span",
18
+ {
19
+ type: l ? "button" : void 0,
20
+ onClick: l,
21
+ onContextMenu: t,
22
+ className: `inline-flex items-center justify-center text-[9px] leading-tight font-semibold transition-colors ${p ? "rounded-full px-1.5 py-0.5" : "rounded-md px-1 py-0.5"} ${a}`,
23
+ children: e
24
+ }
25
+ );
26
+ }
27
+ const fe = ({
28
+ value: e,
29
+ displayValue: r,
30
+ onClick: a,
31
+ bgColor: l = "bg-primary text-primary-content",
32
+ onDragStart: t,
33
+ onDragEnd: p,
34
+ draggable: x = !0,
35
+ tooltipValue: y
36
+ }) => {
37
+ if (!e)
38
+ return null;
39
+ const k = r || pe(e), i = y || e, m = () => {
40
+ const s = k.split("--");
41
+ return s.length > 1 ? /* @__PURE__ */ c(j, { children: [
42
+ s[0],
43
+ /* @__PURE__ */ c("span", { className: "font-bold", children: [
44
+ "--",
45
+ s[1]
46
+ ] })
47
+ ] }) : k;
48
+ };
49
+ return /* @__PURE__ */ n(
50
+ "button",
51
+ {
52
+ draggable: x,
53
+ onClick: (s) => {
54
+ s.preventDefault(), s.stopPropagation(), s.shiftKey ? t && t(s, { value: e, type: "copy" }) : navigator.clipboard.writeText(e).then(() => {
55
+ }).catch((g) => {
56
+ Te.error("Failed to copy:", g);
57
+ });
58
+ },
59
+ onContextMenu: (s) => {
60
+ s.preventDefault(), s.stopPropagation(), s.ctrlKey ? a && a(s, { deleteLinked: !0 }) : a && a(s, { deleteLinked: !1 });
61
+ },
62
+ onDragStart: (s) => {
63
+ t && t(s, { value: e, type: "move" }), s.dataTransfer.effectAllowed = "move", s.dataTransfer.setData("text/plain", e);
64
+ },
65
+ onDragEnd: (s) => {
66
+ p && p(s);
67
+ },
68
+ className: `${l} inline-flex rounded-md px-1.5 py-0.5 text-xs font-medium whitespace-nowrap hover:brightness-110 ${x ? "cursor-grab transition-transform hover:scale-105 active:cursor-grabbing" : "cursor-pointer"}`,
69
+ "data-tooltip-id": X,
70
+ "data-tooltip-content": i,
71
+ "data-tooltip-place": "top",
72
+ "data-tooltip-offset": 10,
73
+ children: m()
74
+ }
75
+ );
76
+ }, Ke = ({ value: e, onClick: r, className: a = "" }) => {
77
+ if (!e)
78
+ return null;
79
+ const l = pe(e), t = () => {
80
+ const p = l.split("--");
81
+ return p.length > 1 ? /* @__PURE__ */ c(j, { children: [
82
+ p[0],
83
+ /* @__PURE__ */ c("span", { className: "font-bold", children: [
84
+ "--",
85
+ p[1]
86
+ ] })
87
+ ] }) : l;
88
+ };
89
+ return /* @__PURE__ */ n(
90
+ "button",
91
+ {
92
+ onClick: r,
93
+ className: `bg-base-200 text-base-content inline-flex cursor-pointer rounded-md px-1 py-0.5 text-xs font-medium ${a}`,
94
+ "data-tooltip-id": X,
95
+ "data-tooltip-content": `Add ${e}`,
96
+ "data-tooltip-place": "top",
97
+ "data-tooltip-offset": 10,
98
+ children: t()
99
+ }
100
+ );
101
+ }, Re = (e) => !!be(e) || Se(e), je = /* @__PURE__ */ new Set(["sm", "md", "lg", "xl", "2xl", "dark", "hover"]), F = (e) => {
102
+ if (!e || typeof e != "string") return !1;
103
+ const { segments: r, base: a } = Y(e);
104
+ for (const l of r)
105
+ if (!je.has(l)) return !1;
106
+ return !a.includes(":");
107
+ };
108
+ function Ue(e) {
109
+ const { segments: r } = Y(e), a = De(r);
110
+ if (a.includes("hover")) return "other";
111
+ const l = a.find((t) => t === "sm" || t === "md" || t === "lg" || t === "xl" || t === "2xl");
112
+ return l === "sm" ? "sm" : l === "md" ? "desktop" : l === "lg" ? "lg" : l === "xl" ? "xl" : l === "2xl" ? "2xl" : "mobile";
113
+ }
114
+ function We(e, r) {
115
+ const a = {
116
+ mobile: [],
117
+ sm: [],
118
+ desktop: [],
119
+ lg: [],
120
+ xl: [],
121
+ "2xl": [],
122
+ other: []
123
+ }, l = (e || "").split(/\s+/).filter(Boolean);
124
+ for (const t of l) {
125
+ if (r != null && r.includes(t)) continue;
126
+ const p = Ue(t);
127
+ a[p].push(t);
128
+ }
129
+ return a;
130
+ }
131
+ function de(e) {
132
+ const r = e || "desktop";
133
+ return r === "mobile" ? "mobile" : r === "sm" || r === "tablet" ? "sm" : r === "desktop" ? "mobile" : r === "md" ? "desktop" : r === "lg" ? "lg" : r === "xl" ? "xl" : r === "2xl" ? "2xl" : "mobile";
134
+ }
135
+ const ce = {
136
+ mobile: "base",
137
+ sm: "sm",
138
+ md: "md",
139
+ desktop: "md",
140
+ lg: "lg",
141
+ xl: "xl",
142
+ "2xl": "2xl"
143
+ }, Fe = "border border-sidebar-border bg-sidebar-accent text-sidebar-foreground shadow-sm", Ge = "border border-transparent text-neutral-content hover:border-sidebar-border hover:bg-sidebar-accent/80", I = "border-2 border-dashed border-base-content/35 bg-base-content/10", He = [
144
+ {
145
+ id: "mobile",
146
+ label: "Base",
147
+ hint: "default",
148
+ icon: "mobile",
149
+ dropValid: I,
150
+ dropInvalid: "border-2 border-dashed border-error bg-error/10",
151
+ borderIdle: "border-base-300"
152
+ },
153
+ {
154
+ id: "sm",
155
+ label: "SM",
156
+ hint: "640px+",
157
+ icon: "badge",
158
+ dropValid: I,
159
+ dropInvalid: "border-2 border-dashed border-error bg-error/10",
160
+ borderIdle: "border-base-300"
161
+ },
162
+ {
163
+ id: "desktop",
164
+ label: "MD",
165
+ hint: "768px+",
166
+ icon: "desktop",
167
+ dropValid: I,
168
+ dropInvalid: "border-2 border-dashed border-error bg-error/10",
169
+ borderIdle: "border-base-300"
170
+ },
171
+ {
172
+ id: "lg",
173
+ label: "LG",
174
+ hint: "1024px+",
175
+ icon: "badge",
176
+ dropValid: I,
177
+ dropInvalid: "border-2 border-dashed border-error bg-error/10",
178
+ borderIdle: "border-base-300"
179
+ },
180
+ {
181
+ id: "xl",
182
+ label: "XL",
183
+ hint: "1280px+",
184
+ icon: "badge",
185
+ dropValid: I,
186
+ dropInvalid: "border-2 border-dashed border-error bg-error/10",
187
+ borderIdle: "border-base-300"
188
+ },
189
+ {
190
+ id: "2xl",
191
+ label: "2XL",
192
+ hint: "1536px+",
193
+ icon: "badge",
194
+ dropValid: I,
195
+ dropInvalid: "border-2 border-dashed border-error bg-error/10",
196
+ borderIdle: "border-base-300"
197
+ }
198
+ ], L = "bg-base-200 text-base-content border border-base-300/60", Xe = {
199
+ mobile: L,
200
+ sm: L,
201
+ desktop: L,
202
+ lg: L,
203
+ xl: L,
204
+ "2xl": L
205
+ }, z = ["sm:", "md:", "lg:", "xl:", "2xl:"];
206
+ function Ye({
207
+ classes: e,
208
+ onSave: r,
209
+ classInput: a,
210
+ setClassInput: l
211
+ }) {
212
+ const [t, p] = $([]), [x, y] = $(0);
213
+ Ne(() => {
214
+ if (a.length < 2) return;
215
+ const i = z.some((u) => a.startsWith(u));
216
+ let m;
217
+ if (i) {
218
+ const u = z.find((f) => a.startsWith(f)), v = a.substring(u.length);
219
+ m = le.filter((f) => f == null ? void 0 : f.includes(v)).map((f) => `${u}${f}`);
220
+ } else {
221
+ const u = le.filter((f) => f == null ? void 0 : f.includes(a)), v = u.slice(0, 5).flatMap((f) => z.map((D) => `${D}${f}`));
222
+ m = [...u, ...v];
223
+ }
224
+ p(m.filter((u) => !(e != null && e.includes(u))).slice(0, 4)), y(0);
225
+ }, [a]);
226
+ const k = !!(a && t.length);
227
+ return /* @__PURE__ */ c(j, { children: [
228
+ /* @__PURE__ */ n("label", { htmlFor: "class-search-input", className: "text-base-content sr-only text-sm font-medium", children: "Search" }),
229
+ /* @__PURE__ */ c("div", { className: "relative w-full", children: [
230
+ /* @__PURE__ */ n(
231
+ ze,
232
+ {
233
+ value: a,
234
+ onChange: l,
235
+ placeholder: "Class Search",
236
+ size: "slim",
237
+ inputProps: {
238
+ id: "class-search-input",
239
+ role: "searchbox",
240
+ required: !0,
241
+ ...Be
242
+ },
243
+ onKeyDown: (i) => {
244
+ if (i.key === "Tab" && t.length > 0)
245
+ if (i.preventDefault(), z.some((u) => a.startsWith(u))) {
246
+ const u = t.find((v) => v.startsWith(a.split(":")[0] + ":"));
247
+ l(u || t[0]);
248
+ } else
249
+ l(t[0]);
250
+ i.key === "ArrowDown" && t.length > 0 && (i.preventDefault(), y((m) => Math.min(m + 1, t.length - 1))), i.key === "ArrowUp" && t.length > 0 && (i.preventDefault(), y((m) => Math.max(m - 1, 0))), i.key === "Enter" && (i.preventDefault(), t.length > 0 && x > 0 ? l(t[x]) : r());
251
+ }
252
+ }
253
+ ),
254
+ (a == null ? void 0 : a.length) > 0 && t.length > 0 && t[0].startsWith(a) && /* @__PURE__ */ c("div", { className: "pointer-events-none absolute inset-0 z-0 flex items-center pr-7 pl-7 text-xs", children: [
255
+ /* @__PURE__ */ n("span", { className: "invisible", children: a }),
256
+ /* @__PURE__ */ n("span", { className: "text-neutral-content font-mono", children: t[0].slice(a.length) })
257
+ ] })
258
+ ] }),
259
+ k && /* @__PURE__ */ c("div", { className: "ph-panel-soft absolute top-9 z-50 w-full overflow-hidden", children: [
260
+ /* @__PURE__ */ n("div", { className: "scrollbar-light flex max-h-60 w-full flex-wrap gap-2 overflow-auto p-2", children: t.map((i, m) => /* @__PURE__ */ n(
261
+ Ke,
262
+ {
263
+ value: i,
264
+ onClick: () => r(i),
265
+ className: m === x ? "bg-accent text-accent-content ring-accent rounded-lg ring-2" : ""
266
+ },
267
+ m
268
+ )) }),
269
+ t.length > 0 && /* @__PURE__ */ c("div", { className: "border-base-300 bg-neutral/50 text-neutral-content border-t p-2 text-xs", children: [
270
+ /* @__PURE__ */ c("div", { className: "flex flex-wrap gap-1", children: [
271
+ /* @__PURE__ */ c("span", { children: [
272
+ "Press",
273
+ " ",
274
+ /* @__PURE__ */ n("kbd", { className: "bg-base-200 text-base-content rounded-md border px-1.5 py-0.5", children: "Tab" }),
275
+ " ",
276
+ "to complete"
277
+ ] }),
278
+ /* @__PURE__ */ c("span", { children: [
279
+ "Use",
280
+ " ",
281
+ /* @__PURE__ */ n("kbd", { className: "bg-base-200 text-base-content rounded-md border px-1.5 py-0.5", children: "↑↓" }),
282
+ " ",
283
+ "to navigate"
284
+ ] }),
285
+ /* @__PURE__ */ c("span", { children: [
286
+ "Press",
287
+ " ",
288
+ /* @__PURE__ */ n("kbd", { className: "bg-base-200 text-base-content rounded-md border px-1.5 py-0.5", children: "Enter" }),
289
+ " ",
290
+ "to select"
291
+ ] })
292
+ ] }),
293
+ /* @__PURE__ */ c("div", { className: "mt-1", children: [
294
+ "Unprefixed classes are the base layer (mobile-first). Prefix with",
295
+ " ",
296
+ ["sm:", "md:", "lg:", "xl:", "2xl:"].map((i, m, u) => /* @__PURE__ */ c("span", { children: [
297
+ /* @__PURE__ */ n("kbd", { className: "bg-base-200 text-base-content rounded-md border px-1.5 py-0.5", children: i }),
298
+ m < u.length - 1 ? ", " : " "
299
+ ] }, i)),
300
+ "for overrides from that min-width breakpoint and up."
301
+ ] })
302
+ ] })
303
+ ] })
304
+ ] });
305
+ }
306
+ function R({
307
+ icon: e,
308
+ tooltip: r,
309
+ onClick: a,
310
+ className: l
311
+ }) {
312
+ return /* @__PURE__ */ n(
313
+ "button",
314
+ {
315
+ type: "button",
316
+ onClick: (t) => {
317
+ t.stopPropagation(), a();
318
+ },
319
+ className: `rounded p-1 transition-all hover:scale-110 ${l}`,
320
+ "data-tooltip-id": X,
321
+ "data-tooltip-content": r,
322
+ "data-tooltip-place": "top",
323
+ "data-tooltip-offset": 10,
324
+ children: e
325
+ }
326
+ );
327
+ }
328
+ function qe({
329
+ id: e,
330
+ classes: r,
331
+ rawTokenDisplay: a = !1,
332
+ dragOverCategory: l,
333
+ isDragging: t,
334
+ borderIdle: p,
335
+ dropValid: x,
336
+ dropInvalid: y,
337
+ onDragOver: k,
338
+ onDragLeave: i,
339
+ onDrop: m,
340
+ onDragStart: u,
341
+ onDragEnd: v,
342
+ onDelete: f
343
+ }) {
344
+ const D = l === e, s = l === `invalid-${e}`, g = D ? `${x} ring-1 ring-base-content/25 scale-[1.01]` : s ? y : t ? "ring-1 ring-base-content/20" : "";
345
+ return /* @__PURE__ */ n(
346
+ "div",
347
+ {
348
+ role: "presentation",
349
+ className: `flex flex-wrap gap-1.5 rounded-lg border border-dashed p-2 transition-all ${p} ${g}`,
350
+ onDragOver: (h) => k(h, e),
351
+ onDragLeave: i,
352
+ onDrop: (h) => m(h, e),
353
+ children: r.map((h, S) => /* @__PURE__ */ n(
354
+ fe,
355
+ {
356
+ value: h,
357
+ displayValue: a ? h : void 0,
358
+ onClick: (P, A) => f(h, e, A == null ? void 0 : A.deleteLinked),
359
+ bgColor: Xe[e] || "bg-neutral text-base-content",
360
+ onDragStart: (P, A) => u(P, { ...A, sourceCategory: e }),
361
+ onDragEnd: v
362
+ },
363
+ `${e}-${h}-${S}`
364
+ ))
365
+ }
366
+ );
367
+ }
368
+ function he({ onClick: e }) {
369
+ return /* @__PURE__ */ n(Me, { onClick: e, icon: /* @__PURE__ */ n(G, { size: 12, "aria-hidden": !0 }), children: "Clear All Styles" });
370
+ }
371
+ function Je({
372
+ bucketLists: e,
373
+ otherClasses: r,
374
+ rawTokenDisplay: a = !1,
375
+ selectedViews: l,
376
+ toggleView: t,
377
+ dragOverCategory: p,
378
+ onDragOver: x,
379
+ onDragLeave: y,
380
+ onDrop: k,
381
+ onDragStart: i,
382
+ onDragEnd: m,
383
+ onDelete: u,
384
+ onClearBucket: v,
385
+ onClearAll: f,
386
+ draggedItem: D,
387
+ showClearAllButton: s = !0
388
+ }) {
389
+ const [g, h] = $(null), [S, P] = $({ mobile: !0 }), A = [...Object.values(e).flat(), ...r], M = re((o, N) => {
390
+ o.length !== 0 && (navigator.clipboard.writeText(o.join(" ")), h(N), setTimeout(() => h(null), 2e3));
391
+ }, []), O = re((o) => {
392
+ P((N) => ({ ...N, [o]: !N[o] }));
393
+ }, []), U = (o, N) => N.length > 0 || S[o] || p === o || p === `invalid-${o}`, K = !!D;
394
+ return /* @__PURE__ */ c(j, { children: [
395
+ He.map((o) => {
396
+ const N = e[o.id] || [], _ = l[o.id], T = U(o.id, N) || K;
397
+ return /* @__PURE__ */ c("div", { className: "w-full space-y-2", children: [
398
+ /* @__PURE__ */ c("div", { className: "flex w-full min-w-0 items-stretch gap-1", children: [
399
+ /* @__PURE__ */ n("div", { className: "flex w-7 shrink-0 items-start justify-center pt-2", children: /* @__PURE__ */ n(
400
+ "button",
401
+ {
402
+ type: "button",
403
+ onClick: () => O(o.id),
404
+ className: "text-neutral-content hover:text-base-content rounded p-0.5 transition-colors",
405
+ "aria-label": T ? "Collapse bucket" : "Expand bucket",
406
+ "aria-expanded": T,
407
+ children: /* @__PURE__ */ n(
408
+ Ae,
409
+ {
410
+ className: `size-3 transition-transform ${T ? "rotate-90" : ""}`
411
+ }
412
+ )
413
+ }
414
+ ) }),
415
+ /* @__PURE__ */ c(
416
+ "button",
417
+ {
418
+ type: "button",
419
+ onClick: () => t(o.id),
420
+ className: `flex min-w-0 flex-1 items-center justify-between gap-3 rounded-md px-3 py-2 text-xs font-medium transition-colors ${_ ? Fe : Ge}`,
421
+ children: [
422
+ /* @__PURE__ */ c("span", { className: "flex min-w-0 items-center gap-1.5", children: [
423
+ /* @__PURE__ */ n("span", { className: "truncate", children: o.label }),
424
+ !T && N.length > 0 && /* @__PURE__ */ n(Oe, { children: N.length })
425
+ ] }),
426
+ /* @__PURE__ */ n("span", { className: "shrink-0 text-end text-[10px] font-normal tabular-nums opacity-70", children: o.hint })
427
+ ]
428
+ }
429
+ ),
430
+ N.length > 0 && /* @__PURE__ */ c("div", { className: "flex shrink-0 items-center self-center", children: [
431
+ /* @__PURE__ */ n(
432
+ R,
433
+ {
434
+ icon: /* @__PURE__ */ n(G, { className: "size-3.5" }),
435
+ tooltip: "Clear",
436
+ onClick: () => v(N),
437
+ className: "text-neutral-content hover:bg-error/10 hover:text-error"
438
+ }
439
+ ),
440
+ /* @__PURE__ */ n(
441
+ R,
442
+ {
443
+ icon: g === o.id ? /* @__PURE__ */ n(se, { className: "size-3.5" }) : /* @__PURE__ */ n(oe, { className: "size-3.5" }),
444
+ tooltip: g === o.id ? "Copied!" : `Copy ${o.id} classes`,
445
+ onClick: () => M(N, o.id),
446
+ className: "text-neutral-content hover:bg-accent/10 hover:text-base-content"
447
+ }
448
+ )
449
+ ] })
450
+ ] }),
451
+ T && /* @__PURE__ */ n(
452
+ qe,
453
+ {
454
+ id: o.id,
455
+ classes: N,
456
+ rawTokenDisplay: a,
457
+ dragOverCategory: p,
458
+ isDragging: K,
459
+ borderIdle: o.borderIdle,
460
+ dropValid: o.dropValid,
461
+ dropInvalid: o.dropInvalid,
462
+ onDragOver: x,
463
+ onDragLeave: y,
464
+ onDrop: k,
465
+ onDragStart: i,
466
+ onDragEnd: m,
467
+ onDelete: u
468
+ }
469
+ )
470
+ ] }, o.id);
471
+ }),
472
+ r.length > 0 && /* @__PURE__ */ c("div", { className: "space-y-2", children: [
473
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
474
+ /* @__PURE__ */ c("div", { className: "text-neutral-content flex items-center gap-1.5 rounded-lg px-2 py-1 text-xs font-medium", children: [
475
+ /* @__PURE__ */ n(Ve, { className: "size-3.5 shrink-0 opacity-80" }),
476
+ /* @__PURE__ */ c("span", { className: "flex flex-col items-start leading-tight", children: [
477
+ /* @__PURE__ */ n("span", { children: "Other variants" }),
478
+ /* @__PURE__ */ n("span", { className: "text-[10px] font-normal opacity-80", children: "hover, max-, etc." })
479
+ ] })
480
+ ] }),
481
+ /* @__PURE__ */ c("div", { className: "ml-auto flex items-center", children: [
482
+ /* @__PURE__ */ n(
483
+ R,
484
+ {
485
+ icon: /* @__PURE__ */ n(G, { className: "size-3.5" }),
486
+ tooltip: "Clear",
487
+ onClick: () => v(r),
488
+ className: "text-neutral-content hover:bg-error/10 hover:text-error"
489
+ }
490
+ ),
491
+ /* @__PURE__ */ n(
492
+ R,
493
+ {
494
+ icon: g === "other" ? /* @__PURE__ */ n(se, { className: "size-3.5" }) : /* @__PURE__ */ n(oe, { className: "size-3.5" }),
495
+ tooltip: g === "other" ? "Copied!" : "Copy other classes",
496
+ onClick: () => M(r, "other"),
497
+ className: "text-neutral-content hover:bg-accent/10 hover:text-base-content"
498
+ }
499
+ )
500
+ ] })
501
+ ] }),
502
+ /* @__PURE__ */ n(
503
+ "div",
504
+ {
505
+ role: "presentation",
506
+ className: `border-base-300 flex flex-wrap gap-1.5 rounded-lg border border-dashed p-2 transition-colors ${p === "invalid-other" ? "border-error bg-error/10 border-2 border-dashed" : ""}`,
507
+ onDragOver: (o) => {
508
+ o.preventDefault(), D && x(o, "other");
509
+ },
510
+ onDragLeave: y,
511
+ children: r.map((o, N) => /* @__PURE__ */ n(
512
+ fe,
513
+ {
514
+ value: o,
515
+ displayValue: a ? o : void 0,
516
+ onClick: (_, T) => u(o, "other", T == null ? void 0 : T.deleteLinked),
517
+ bgColor: "bg-neutral text-base-content",
518
+ onDragStart: (_, T) => i(_, { ...T, sourceCategory: "other" }),
519
+ onDragEnd: m
520
+ },
521
+ `other-${o}-${N}`
522
+ ))
523
+ }
524
+ )
525
+ ] }),
526
+ s && A.length > 0 && /* @__PURE__ */ n(he, { onClick: f })
527
+ ] });
528
+ }
529
+ const Ze = ({
530
+ value: e,
531
+ changed: r,
532
+ nodeProps: a,
533
+ setProp: l,
534
+ canvasView: t,
535
+ children: p,
536
+ clearAllPlacement: x = "in-buckets",
537
+ rawTokenDisplay: y = !1
538
+ }) => {
539
+ const [k, i] = $e(ue), m = H(Pe), u = k.dark ?? !1, v = Array.isArray(e) ? e : [], [f, D] = $(""), [s, g] = $(null), [h, S] = $(null), P = (b) => {
540
+ i((d) => ({ ...d, [b]: !d[b] }));
541
+ }, A = (b = null) => {
542
+ const d = (b || f).split(" ").filter((B) => !v.includes(B));
543
+ if (!d.length) return;
544
+ const C = d.filter((B) => z.some((V) => B.startsWith(V))), w = d.filter((B) => !z.some((V) => B.startsWith(V)));
545
+ C.forEach((B) => {
546
+ l((V) => {
547
+ V.className = ie(V.className || "", B);
548
+ }, 0);
549
+ }), w.length > 0 && r([...v, ...w]), D("");
550
+ }, M = (b) => {
551
+ l((d) => {
552
+ d.className && (d.className = (d.className || "").split(/\s+/).filter(Boolean).filter((C) => C !== b).join(" "));
553
+ });
554
+ }, O = (b) => Y(b).base, U = (b, d) => {
555
+ g({ ...d, type: b.shiftKey ? "copy" : "move" }), b.dataTransfer && (b.dataTransfer.effectAllowed = b.shiftKey ? "copy" : "move");
556
+ }, K = () => {
557
+ g(null), S(null);
558
+ }, o = (b, d) => {
559
+ if (b.preventDefault(), s) {
560
+ const C = O(s.value), w = d !== "other" && (F(s.value) || d === "mobile") && Re(C);
561
+ S(w ? d : `invalid-${d}`);
562
+ }
563
+ }, N = (b, d) => {
564
+ if (b.preventDefault(), S(null), !s) return;
565
+ const { value: C, type: w, sourceCategory: B } = s;
566
+ if (B === d || d === "other") return;
567
+ const V = O(C);
568
+ if (!F(C) && d !== "mobile") return;
569
+ const xe = F(C) ? (() => {
570
+ const E = Ie(d, u);
571
+ return E ? `${E}${V}` : V;
572
+ })() : C;
573
+ w !== "copy" && B && l((E) => {
574
+ E.className = (E.className || "").split(/\s+/).filter(Boolean).filter((ve) => ve !== C).join(" ");
575
+ }, 0), l((E) => {
576
+ E.className = ie(E.className || "", xe);
577
+ }, 0), g(null);
578
+ }, _ = a ? { ...a } : {}, {
579
+ mobile: T,
580
+ sm: q,
581
+ desktop: J,
582
+ lg: Z,
583
+ xl: Q,
584
+ "2xl": ee,
585
+ other: te
586
+ } = We(_.className || "", v || []), ne = [T, q, J, Z, Q, ee, te].flat(), ge = (b) => {
587
+ l((d) => {
588
+ if (!d.className) return;
589
+ const C = (d.className || "").split(/\s+/).filter(Boolean).filter((w) => !b.includes(w));
590
+ d.className = C.join(" ");
591
+ }, 0);
592
+ }, ae = () => {
593
+ l((b) => {
594
+ if (!b.className) return;
595
+ const d = (b.className || "").split(/\s+/).filter(Boolean).filter((C) => !ne.includes(C));
596
+ b.className = d.join(" ");
597
+ }, 0), r([]);
598
+ };
599
+ return /* @__PURE__ */ c("div", { className: "relative z-10 flex w-full min-w-0 flex-col gap-6", children: [
600
+ /* @__PURE__ */ n(
601
+ Ye,
602
+ {
603
+ classes: v,
604
+ onSave: A,
605
+ classInput: f,
606
+ setClassInput: D
607
+ }
608
+ ),
609
+ /* @__PURE__ */ c("div", { className: "text-xxs text-neutral-content -mt-5 flex flex-wrap items-baseline gap-x-1 pl-1", children: [
610
+ /* @__PURE__ */ n("span", { children: "Apply to:" }),
611
+ /* @__PURE__ */ n("span", { className: "text-base-content font-medium", children: m.size > 0 ? _e(k, t, m).map((b) => ce[b] ?? b).join(" + ") : ce[de(t)] ?? de(t) }),
612
+ m.size === 0 && /* @__PURE__ */ n("span", { className: "text-neutral-content", children: "(canvas layer)" })
613
+ ] }),
614
+ /* @__PURE__ */ n(
615
+ Je,
616
+ {
617
+ bucketLists: { mobile: T, sm: q, desktop: J, lg: Z, xl: Q, "2xl": ee },
618
+ otherClasses: te,
619
+ rawTokenDisplay: y,
620
+ selectedViews: k,
621
+ toggleView: P,
622
+ dragOverCategory: h,
623
+ onDragOver: o,
624
+ onDragLeave: () => S(null),
625
+ onDrop: N,
626
+ onDragStart: U,
627
+ onDragEnd: K,
628
+ onDelete: M,
629
+ onClearBucket: ge,
630
+ onClearAll: ae,
631
+ draggedItem: s,
632
+ showClearAllButton: x === "in-buckets"
633
+ }
634
+ ),
635
+ p,
636
+ x === "after-append" && ne.length > 0 && /* @__PURE__ */ n(he, { onClick: ae })
637
+ ] });
638
+ };
639
+ function Qe({
640
+ full: e = !1,
641
+ propKey: r,
642
+ children: a,
643
+ clearAllPlacement: l = "in-buckets",
644
+ ...t
645
+ }) {
646
+ const {
647
+ actions: { setProp: p },
648
+ nodeProps: x,
649
+ id: y
650
+ } = ke((s) => {
651
+ var g;
652
+ return { nodeProps: (g = s.data) == null ? void 0 : g.props, id: s.id };
653
+ }), { query: k, actions: i } = Ce(), m = H(we), u = H(ue).dark ?? !1, v = Le(m), f = (x || {})[r], D = (s) => {
654
+ const g = [];
655
+ if (!s.filter((h) => h).length)
656
+ return W({
657
+ propKey: "className",
658
+ value: [],
659
+ setProp: p,
660
+ propType: "component",
661
+ query: k,
662
+ actions: i,
663
+ nodeId: y
664
+ });
665
+ s.forEach((h) => {
666
+ const S = be(h);
667
+ if (S)
668
+ return W({
669
+ propKey: S,
670
+ value: h,
671
+ setProp: p,
672
+ propType: "class",
673
+ view: v,
674
+ query: k,
675
+ actions: i,
676
+ nodeId: y,
677
+ classDark: u
678
+ });
679
+ g.push(h);
680
+ }), g.length && W({
681
+ propKey: "className",
682
+ value: g.filter((h) => h),
683
+ setProp: p,
684
+ propType: "component",
685
+ query: k,
686
+ actions: i,
687
+ nodeId: y
688
+ });
689
+ };
690
+ return t.valueLabels && t.valueLabels[f] && t.valueLabels[f], /* @__PURE__ */ n(Ee, { frame: "bare", label: t != null && t.labelHide || t == null ? void 0 : t.label, propKey: r, children: /* @__PURE__ */ n(
691
+ Ze,
692
+ {
693
+ nodeProps: { ...x },
694
+ value: f,
695
+ changed: D,
696
+ setProp: p,
697
+ canvasView: m,
698
+ clearAllPlacement: l,
699
+ rawTokenDisplay: t.type === "className" || r === "className",
700
+ children: a
701
+ }
702
+ ) });
703
+ }
704
+ const et = me.lazy(
705
+ () => import("./CSSEditorInput-C1ITwAh3.js").then((e) => ({ default: e.CSSEditorInput }))
706
+ ), it = () => /* @__PURE__ */ n(
707
+ Qe,
708
+ {
709
+ propKey: "className",
710
+ type: "className",
711
+ propType: "component",
712
+ label: "",
713
+ labelHide: !0,
714
+ clearAllPlacement: "after-append",
715
+ children: /* @__PURE__ */ n(me.Suspense, { fallback: /* @__PURE__ */ n(ye, {}), children: /* @__PURE__ */ n(et, {}) })
716
+ }
717
+ );
718
+ export {
719
+ it as ClassNameInput
720
+ };