@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,66 @@
1
+ import { jsxs as o, Fragment as p, jsx as e } from "react/jsx-runtime";
2
+ import { M as l } from "./MediaInput-DHs3D8TJ.js";
3
+ import { TailwindInput as r } from "./TailwindInput-660FZtyK.js";
4
+ import { w as i, n as t } from "./index-C66dAl3Q.js";
5
+ import { r as a, S as n } from "./helpers-Cll72tMn.js";
6
+ import { S as c } from "./SlotRenderer-CaLf_2_C.js";
7
+ const g = () => a({
8
+ Content: /* @__PURE__ */ o(p, { children: [
9
+ /* @__PURE__ */ o(i, { collapsible: !1, children: [
10
+ /* @__PURE__ */ e(
11
+ l,
12
+ {
13
+ propKey: "videoId",
14
+ typeKey: "type",
15
+ contentKey: "src",
16
+ variant: "chip",
17
+ label: "Image"
18
+ }
19
+ ),
20
+ /* @__PURE__ */ e(
21
+ t,
22
+ {
23
+ propKey: "alt",
24
+ propType: "component",
25
+ type: "text",
26
+ label: "Alt Text",
27
+ placeholder: "Describe this image for screen readers"
28
+ }
29
+ ),
30
+ /* @__PURE__ */ e(r, { propKey: "objectFit", label: "Object Fit", prop: "objectFit", type: "select" }),
31
+ /* @__PURE__ */ e(
32
+ r,
33
+ {
34
+ propKey: "objectPosition",
35
+ label: "Object Position",
36
+ prop: "objectPosition",
37
+ type: "select"
38
+ }
39
+ ),
40
+ /* @__PURE__ */ e(c, { id: "settings/ai-button" })
41
+ ] }),
42
+ /* @__PURE__ */ o(
43
+ i,
44
+ {
45
+ full: 1,
46
+ title: "Loading",
47
+ icon: n.Type,
48
+ help: "Preload important images, like the first ones on the page. Lazy load images that are below the first page.",
49
+ children: [
50
+ /* @__PURE__ */ o(t, { propKey: "loading", propType: "component", type: "select", label: "Loading", children: [
51
+ /* @__PURE__ */ e("option", { value: "lazy", children: "lazy" }),
52
+ /* @__PURE__ */ e("option", { value: "eager", children: "eager" })
53
+ ] }),
54
+ /* @__PURE__ */ o(t, { propKey: "fetchPriority", propType: "component", type: "select", label: "Priority", children: [
55
+ /* @__PURE__ */ e("option", { value: "low", children: "Low" }),
56
+ /* @__PURE__ */ e("option", { value: "high", children: "High" }),
57
+ /* @__PURE__ */ e("option", { value: "", children: "Auto" })
58
+ ] })
59
+ ]
60
+ }
61
+ )
62
+ ] })
63
+ });
64
+ export {
65
+ g as ImageMainTab
66
+ };
@@ -0,0 +1,485 @@
1
+ import { jsxs as M, Fragment as J, jsx as o } from "react/jsx-runtime";
2
+ import { d as ve, F as xe } from "./FloatingPanel-DJP5Vhua.js";
3
+ import { useEditor as te, useNode as ne } from "@craftjs/core";
4
+ import de, { useState as Z, useRef as Y, useMemo as A, useEffect as G, forwardRef as ke, useImperativeHandle as we, useContext as Ne, createContext as Ae } from "react";
5
+ import { u as D, V as re, E as se, M as Se, _ as ue, fq as pe, fr as Me, J as Oe, c as me, aE as ie, e9 as Ke, d as ce, S as fe, i as ee, P as he, G as le, fs as Re, ft as Ce, w as Fe, W as De } from "./index-C66dAl3Q.js";
6
+ import { T as Te } from "./ToolbarDashedButton-DbUxGmDg.js";
7
+ import { createPortal as Ee } from "react-dom";
8
+ import { p as ye, i as F, r as _e, P as Ve, a as We } from "./ContainerMainTab-kkktm1Ns.js";
9
+ import { S as qe } from "./SearchableMenuPopover-DZKVXiEl.js";
10
+ import { g as ge, a as j } from "./propertyRegistry-CMhVNOgl.js";
11
+ import { P as ze, r as oe } from "./popoverOpenRequestAtom-hBS_siXv.js";
12
+ function Ie({
13
+ imageUrl: d,
14
+ onOpenChange: r
15
+ }) {
16
+ const { actions: P, query: v } = te(), h = D(re), x = D(se), T = D(Se), {
17
+ actions: { setProp: O },
18
+ id: N,
19
+ props: l
20
+ } = ne((s) => {
21
+ var i;
22
+ return {
23
+ id: s.id,
24
+ props: (i = s.data) == null ? void 0 : i.props
25
+ };
26
+ }), [p, y] = Z(!1), [g, k] = Z({ x: 50, y: 50 }), [K, W] = Z({ x: 50, y: 50 }), E = Y(null), I = Y(null), u = Y(null), { pageMedia: _ } = A(() => ue(v), [v]), w = d || pe(l, _);
27
+ G(() => {
28
+ if (typeof document < "u") {
29
+ const s = document.querySelector(`[node-id="${N}"]`);
30
+ u.current = s;
31
+ }
32
+ }, [N]);
33
+ const q = (s, i) => {
34
+ if (!E.current) return;
35
+ const m = E.current.getBoundingClientRect(), e = Math.max(0, Math.min(100, (s - m.left) / m.width * 100)), t = Math.max(0, Math.min(100, (i - m.top) / m.height * 100));
36
+ k({ x: e, y: t }), S(e, t);
37
+ }, S = (s, i) => {
38
+ if (!u.current) return;
39
+ const m = Math.round(s), e = Math.round(i);
40
+ u.current.style.backgroundPosition = `${m}% ${e}%`;
41
+ }, B = () => {
42
+ const s = Math.round(g.x), i = Math.round(g.y);
43
+ u.current && (u.current.style.backgroundPosition = "");
44
+ const m = Oe(x, h, T), e = x.dark ?? !1;
45
+ m.forEach((t) => {
46
+ me({
47
+ propKey: "backgroundPosition",
48
+ value: `bg-[${s}%_${i}%]`,
49
+ setProp: O,
50
+ propType: "class",
51
+ view: t,
52
+ query: v,
53
+ actions: P,
54
+ nodeId: N,
55
+ classDark: e
56
+ });
57
+ }), W({ x: s, y: i }), y(!1);
58
+ }, { onPointerDown: L } = ve({
59
+ onStart: (s, i) => {
60
+ s.preventDefault(), q(i.clientX, i.clientY);
61
+ },
62
+ onMove: (s, i) => {
63
+ q(i.clientX, i.clientY);
64
+ }
65
+ }), H = () => {
66
+ k(K), u.current && (u.current.style.backgroundPosition = "");
67
+ }, Q = () => {
68
+ k(K), u.current && (u.current.style.backgroundPosition = ""), y(!1);
69
+ }, z = () => {
70
+ const i = ((l == null ? void 0 : l.className) || "").match(/bg-\[\d+%_\d+%\]/), m = i ? i[0] : null;
71
+ if (m && m.includes("bg-[") && m.includes("%")) {
72
+ const t = m.match(/bg-\[(\d+)%_(\d+)%\]/);
73
+ if (t) {
74
+ const a = { x: parseInt(t[1]), y: parseInt(t[2]) };
75
+ W(a), k(a);
76
+ return;
77
+ }
78
+ }
79
+ const e = { x: 50, y: 50 };
80
+ W(e), k(e);
81
+ };
82
+ return G(() => {
83
+ z();
84
+ }, [l]), G(() => {
85
+ p && (z(), u.current && (u.current.style.backgroundPosition = ""));
86
+ }, [p]), G(() => {
87
+ r == null || r(p);
88
+ }, [p, r]), G(() => () => {
89
+ u.current && (u.current.style.backgroundPosition = "");
90
+ }, []), w ? /* @__PURE__ */ M(J, { children: [
91
+ /* @__PURE__ */ o(
92
+ Te,
93
+ {
94
+ onClick: () => p ? Q() : y(!0),
95
+ icon: /* @__PURE__ */ o(Me, { className: "size-3.5", "aria-hidden": !0 }),
96
+ children: p ? "Close Focal Point Picker" : "Focal Point Picker"
97
+ }
98
+ ),
99
+ p && /* @__PURE__ */ M("div", { className: "border-base-300 bg-base-200 flex flex-col gap-3 rounded-lg border p-3", children: [
100
+ /* @__PURE__ */ o("div", { className: "text-neutral-content text-xs", children: "Click or drag to set the focal point of your background image" }),
101
+ /* @__PURE__ */ M(
102
+ "div",
103
+ {
104
+ ref: E,
105
+ role: "presentation",
106
+ "aria-hidden": "true",
107
+ className: "border-base-300 bg-neutral relative aspect-video w-full cursor-crosshair touch-none overflow-hidden rounded-lg border-2 select-none",
108
+ onPointerDown: L,
109
+ children: [
110
+ /* @__PURE__ */ o(
111
+ "img",
112
+ {
113
+ ref: I,
114
+ src: w,
115
+ alt: "Background preview",
116
+ className: "size-full object-cover",
117
+ draggable: !1
118
+ }
119
+ ),
120
+ /* @__PURE__ */ o("div", { className: "pointer-events-none absolute inset-0", children: /* @__PURE__ */ M("svg", { className: "size-full", children: [
121
+ /* @__PURE__ */ o(
122
+ "line",
123
+ {
124
+ x1: "33.33%",
125
+ y1: "0",
126
+ x2: "33.33%",
127
+ y2: "100%",
128
+ stroke: "white",
129
+ strokeWidth: "1",
130
+ opacity: "0.3"
131
+ }
132
+ ),
133
+ /* @__PURE__ */ o(
134
+ "line",
135
+ {
136
+ x1: "66.66%",
137
+ y1: "0",
138
+ x2: "66.66%",
139
+ y2: "100%",
140
+ stroke: "white",
141
+ strokeWidth: "1",
142
+ opacity: "0.3"
143
+ }
144
+ ),
145
+ /* @__PURE__ */ o(
146
+ "line",
147
+ {
148
+ x1: "0",
149
+ y1: "33.33%",
150
+ x2: "100%",
151
+ y2: "33.33%",
152
+ stroke: "white",
153
+ strokeWidth: "1",
154
+ opacity: "0.3"
155
+ }
156
+ ),
157
+ /* @__PURE__ */ o(
158
+ "line",
159
+ {
160
+ x1: "0",
161
+ y1: "66.66%",
162
+ x2: "100%",
163
+ y2: "66.66%",
164
+ stroke: "white",
165
+ strokeWidth: "1",
166
+ opacity: "0.3"
167
+ }
168
+ )
169
+ ] }) }),
170
+ /* @__PURE__ */ M(
171
+ "div",
172
+ {
173
+ className: "pointer-events-none absolute -mt-4 -ml-4 size-8",
174
+ style: { left: `${g.x}%`, top: `${g.y}%` },
175
+ children: [
176
+ /* @__PURE__ */ o("div", { className: "absolute inset-0 rounded-full border-2 border-white shadow-lg" }),
177
+ /* @__PURE__ */ o("div", { className: "bg-primary absolute inset-2 rounded-full shadow-lg" }),
178
+ /* @__PURE__ */ o("div", { className: "absolute top-0 left-1/2 h-full w-px bg-white opacity-50" }),
179
+ /* @__PURE__ */ o("div", { className: "absolute top-1/2 left-0 h-px w-full bg-white opacity-50" })
180
+ ]
181
+ }
182
+ )
183
+ ]
184
+ }
185
+ ),
186
+ /* @__PURE__ */ M("div", { className: "flex items-center justify-between gap-2", children: [
187
+ /* @__PURE__ */ M("div", { className: "text-neutral-content font-mono text-xs", children: [
188
+ "Position: ",
189
+ Math.round(g.x),
190
+ "%, ",
191
+ Math.round(g.y),
192
+ "%"
193
+ ] }),
194
+ /* @__PURE__ */ M("div", { className: "flex gap-2", children: [
195
+ /* @__PURE__ */ o("button", { type: "button", onClick: H, className: "btn btn-secondary btn-sm", children: "Reset" }),
196
+ /* @__PURE__ */ o("button", { type: "button", onClick: B, className: "btn btn-primary btn-sm", children: "Apply" })
197
+ ] })
198
+ ] })
199
+ ] })
200
+ ] }) : null;
201
+ }
202
+ const Be = ie("settingsSearch", "");
203
+ ie("settingsSearchOpen", !1);
204
+ const be = ie("hiddenKeys", () => /* @__PURE__ */ new Set());
205
+ function $e(d) {
206
+ if (d.defaultValue) return d.defaultValue;
207
+ switch (d.input.type) {
208
+ case "checkbox":
209
+ return d.input.on;
210
+ case "tailwind-select":
211
+ case "tailwind-radio":
212
+ return;
213
+ default:
214
+ return;
215
+ }
216
+ }
217
+ const Le = de.memo(
218
+ ke(function({ sectionId: r }, P) {
219
+ const v = Y(null), h = Ke(), x = A(() => {
220
+ var e;
221
+ return ((e = ge(r)) == null ? void 0 : e.title) || "";
222
+ }, [r]), T = () => {
223
+ x && (h != null && h.setOpen) && h.setOpen(x, !0);
224
+ }, O = D(re), N = D(se).dark ?? !1, l = D(be), {
225
+ actions: { setProp: p },
226
+ id: y,
227
+ className: g,
228
+ craftName: k,
229
+ componentProps: K,
230
+ toolbarOrder: W
231
+ } = ne((e) => {
232
+ var t, a, c, R, V, $, X;
233
+ return {
234
+ className: typeof ((a = (t = e.data) == null ? void 0 : t.props) == null ? void 0 : a.className) == "string" ? e.data.props.className : "",
235
+ craftName: ((c = e.data) == null ? void 0 : c.name) || ((R = e.data) == null ? void 0 : R.displayName) || "",
236
+ componentProps: ((V = e.data) == null ? void 0 : V.props) || {},
237
+ toolbarOrder: Array.isArray((X = ($ = e.data) == null ? void 0 : $.props) == null ? void 0 : X.toolbarOrder) ? e.data.props.toolbarOrder : []
238
+ };
239
+ }), { query: E } = te(), [I, u] = ce(fe), [_, w] = ce(ze), q = A(
240
+ () => ({ ...K, _craftName: k }),
241
+ [K, k]
242
+ ), S = A(() => ({ query: E, nodeId: y }), [E, y]), B = A(() => new Set(W), [W]), L = A(() => j({ section: r }).filter((e) => !e.pinned).filter((e) => !e.hideKey || !l.has(e.hideKey)).filter((e) => !e.showWhen || e.showWhen(g, q)).filter((e) => !B.has(e.id)).filter((e) => !I.has(ee(y, e.id))).filter((e) => e.isActive ? !e.isActive(g, K, S) : !ye(e, g, K, O, N)).map((e) => ({
243
+ id: e.id,
244
+ label: e.label || e.id,
245
+ hint: e.groupLabel,
246
+ help: e.help,
247
+ keywords: e.keywords,
248
+ data: e
249
+ })), [
250
+ r,
251
+ g,
252
+ q,
253
+ K,
254
+ O,
255
+ N,
256
+ l,
257
+ B,
258
+ S,
259
+ I,
260
+ y
261
+ ]);
262
+ if (we(
263
+ P,
264
+ () => ({
265
+ // Imperative open from PropertySection (empty-section title click).
266
+ // For popover-mode single-prop sections we MUST expand the accordion
267
+ // first so the trigger row mounts; otherwise the open-request fires
268
+ // into a void (the popover trigger lives inside the section body).
269
+ // Search-popover sections still float over a collapsed section.
270
+ open: () => {
271
+ var t;
272
+ const e = j({ section: r }).filter(
273
+ (a) => !a.pinned && (!a.hideKey || !l.has(a.hideKey))
274
+ );
275
+ if (e.length === 1 && e[0].input.type === "custom" && F(e[0].input.component)) {
276
+ T(), oe(_, w, y, e[0].id);
277
+ return;
278
+ }
279
+ (t = v.current) == null || t.open();
280
+ }
281
+ }),
282
+ [r, l, _, w, y]
283
+ ), !A(
284
+ () => j({ section: r }).some(
285
+ (e) => !e.pinned && (!e.hideKey || !l.has(e.hideKey))
286
+ ),
287
+ [r, l]
288
+ ) || (() => {
289
+ const e = j({ section: r }).filter(
290
+ (a) => !a.pinned && (!a.hideKey || !l.has(a.hideKey))
291
+ );
292
+ if (e.length !== 1) return !1;
293
+ const t = e[0];
294
+ return t.input.type === "custom" && !F(t.input.component);
295
+ })()) return null;
296
+ const z = (() => {
297
+ const e = j({ section: r }).filter(
298
+ (a) => !a.pinned && (!a.hideKey || !l.has(a.hideKey))
299
+ );
300
+ if (e.length !== 1) return null;
301
+ const t = e[0];
302
+ return t.input.type !== "custom" || !F(t.input.component) ? null : t;
303
+ })();
304
+ if (z && z.input.type === "custom") {
305
+ const e = _e(z.input.component);
306
+ return /* @__PURE__ */ o(e, { def: z });
307
+ }
308
+ const s = (e) => {
309
+ if (!e.length) return;
310
+ T();
311
+ const t = [], a = e.length === 1;
312
+ if (e.forEach((c) => {
313
+ const R = $e(c);
314
+ R != null ? (me({
315
+ propKey: c.propKey || c.id,
316
+ value: R,
317
+ propType: c.propType || "class",
318
+ setProp: p,
319
+ view: O,
320
+ classDark: N
321
+ }), p((V) => {
322
+ const $ = Array.isArray(V.toolbarOrder) ? V.toolbarOrder : [];
323
+ $.includes(c.id) || (V.toolbarOrder = [...$, c.id]);
324
+ }, 0)) : c.input.type === "custom" && F(c.input.component) && !a || t.push(ee(y, c.id)), a && c.input.type === "custom" && F(c.input.component) && oe(_, w, y, c.id);
325
+ }), t.length) {
326
+ const c = new Set(I);
327
+ t.forEach((R) => c.add(R)), u(c);
328
+ }
329
+ }, i = (e) => s([e.data]), m = (e) => s(e.map((t) => t.data));
330
+ if (L.length === 1) {
331
+ const e = L[0], t = e.data, a = (t == null ? void 0 : t.input.type) === "custom" && F(t.input.component);
332
+ return /* @__PURE__ */ o(
333
+ "button",
334
+ {
335
+ type: "button",
336
+ onClick: () => {
337
+ T(), a && t ? oe(_, w, y, t.id) : i(e);
338
+ },
339
+ "aria-label": `Add ${e.label}`,
340
+ "data-tooltip-id": he,
341
+ "data-tooltip-content": e.help,
342
+ className: "text-neutral-content hover:text-base-content hover:bg-base-200 flex size-4 shrink-0 items-center justify-center rounded-md opacity-70 transition-[color,background-color,opacity] hover:opacity-100",
343
+ children: /* @__PURE__ */ o(le, { className: "size-3.5", "aria-hidden": !0 })
344
+ }
345
+ );
346
+ }
347
+ return /* @__PURE__ */ o(
348
+ qe,
349
+ {
350
+ ref: v,
351
+ trigger: /* @__PURE__ */ o(le, { className: "size-3.5", "aria-hidden": !0 }),
352
+ triggerAriaLabel: "Add property",
353
+ items: L,
354
+ onSelect: i,
355
+ multiSelect: !0,
356
+ onSelectMany: m,
357
+ emptyMessage: "All properties added"
358
+ }
359
+ );
360
+ })
361
+ ), je = Ae(null);
362
+ function Pe() {
363
+ const d = Ne(je);
364
+ if (!d)
365
+ throw new Error("useInspectorPin must be used within InspectorPinProvider");
366
+ return d;
367
+ }
368
+ function He({ sectionId: d }) {
369
+ const r = D(Be), { isPinned: P, togglePin: v } = Pe();
370
+ if (r.length > 0) return null;
371
+ const h = P(d);
372
+ return /* @__PURE__ */ o(
373
+ "button",
374
+ {
375
+ type: "button",
376
+ className: "text-sidebar-foreground/70 hover:text-sidebar-foreground inline-flex size-4 shrink-0 cursor-pointer items-center justify-center rounded p-0 leading-none opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100",
377
+ onClick: (x) => {
378
+ x.stopPropagation(), x.preventDefault(), v(d);
379
+ },
380
+ onKeyDown: (x) => x.stopPropagation(),
381
+ "aria-label": h ? "Unpin from sidebar" : "Pin to sidebar",
382
+ "aria-pressed": h,
383
+ "data-tooltip-id": he,
384
+ "data-tooltip-content": h ? "Unpin from sidebar" : "Pin to sidebar",
385
+ "data-tooltip-place": "left",
386
+ "data-tooltip-offset": 8,
387
+ children: h ? /* @__PURE__ */ o(Re, { className: "size-3" }) : /* @__PURE__ */ o(Ce, { className: "size-3" })
388
+ }
389
+ );
390
+ }
391
+ const Ue = de.memo(function({ sectionId: r }) {
392
+ const P = ge(r), v = D(be), h = Y(null), { isPinned: x, getSlotNode: T } = Pe(), O = x(r), N = O ? T(r) : null, { id: l, className: p, craftName: y, toolbarOrder: g, componentProps: k } = ne((n) => {
393
+ var b, C, f, U;
394
+ return {
395
+ className: typeof ((b = n.data) == null ? void 0 : b.props.className) == "string" ? n.data.props.className : "",
396
+ craftName: n.data.name || n.data.displayName || "",
397
+ toolbarOrder: Array.isArray((f = (C = n.data) == null ? void 0 : C.props) == null ? void 0 : f.toolbarOrder) ? n.data.props.toolbarOrder : [],
398
+ componentProps: ((U = n.data) == null ? void 0 : U.props) || {}
399
+ };
400
+ }), K = D(re), W = D(se).dark ?? !1, E = D(fe), { query: I } = te(), u = A(() => ({ _craftName: y }), [y]), _ = A(() => ({ query: I, nodeId: l }), [I, l]), w = A(() => j({ section: r }).filter((b) => !(b.hideKey && v.has(b.hideKey))), [r, v]), { main: q, candidates: S } = A(() => {
401
+ const n = w.filter((f) => !f.showWhen || f.showWhen(p, u)), b = [], C = [];
402
+ for (const f of n)
403
+ if (f.pinned) {
404
+ if (f.isActive && !f.isActive(p, k, _)) continue;
405
+ b.push(f);
406
+ } else
407
+ C.push(f);
408
+ return { main: b, candidates: C };
409
+ }, [w, p, u, k, _]), B = S.length === 1 && S[0].input.type === "custom" && !F(S[0].input.component), L = (n) => n.input.type === "custom" && F(n.input.component) ? n.isActive ? n.isActive(p, k, _) || g.includes(n.id) || E.has(ee(l, n.id)) : !0 : B && n === S[0] ? !0 : g.includes(n.id) || E.has(ee(l, n.id)) || ye(n, p, k, K, W), H = A(() => {
410
+ const n = S.filter(L), b = new Map(g.map((C, f) => [C, f]));
411
+ return [...n].sort((C, f) => {
412
+ const U = b.has(C.id), ae = b.has(f.id);
413
+ return U && ae ? b.get(C.id) - b.get(f.id) : U ? 1 : ae ? -1 : (C.sortOrder ?? 100) - (f.sortOrder ?? 100);
414
+ });
415
+ }, [S, g, E, l, p, k, K, W]);
416
+ if (!P) return null;
417
+ const Q = !!(P.hideKey && v.has(P.hideKey)), z = q.length === 0 && S.length === 0;
418
+ if (Q || z) return null;
419
+ const s = w.length === 1 && w[0].input.type === "custom" && F(w[0].input.component), i = w.filter((n) => !n.pinned), m = !s && i.length === 1 && i[0].input.type === "custom" && F(i[0].input.component), e = (n) => !(n.input.type === "custom" && F(n.input.component)), t = s || m, a = t ? q.filter(e) : q, c = t ? H.filter(e) : H, R = a.length === 0 && c.length === 0, V = B ? Ve : We, $ = /* @__PURE__ */ M(J, { children: [
420
+ a.map((n) => /* @__PURE__ */ o(V, { def: n }, n.id)),
421
+ c.map((n) => /* @__PURE__ */ o(V, { def: n }, n.id))
422
+ ] }), X = O ? /* @__PURE__ */ o("div", { className: "text-neutral-content border-base-300/60 border-t border-dashed px-3 py-2 text-xs italic", children: "Properties for this section are pinned below." }) : $;
423
+ return /* @__PURE__ */ M(J, { children: [
424
+ /* @__PURE__ */ o(
425
+ Fe,
426
+ {
427
+ title: P.title,
428
+ icon: P.icon,
429
+ help: P.help,
430
+ defaultOpen: s ? !1 : (P.defaultOpen ?? !1) && !R,
431
+ enabled: !R,
432
+ collapsible: !s,
433
+ className: s ? "cursor-pointer!" : "",
434
+ onClick: (n) => {
435
+ var b;
436
+ (s || R && !B) && (n.preventDefault(), (b = h.current) == null || b.open());
437
+ },
438
+ header: /* @__PURE__ */ M(J, { children: [
439
+ /* @__PURE__ */ o(He, { sectionId: r }),
440
+ /* @__PURE__ */ o(Le, { ref: h, sectionId: r })
441
+ ] }),
442
+ children: X
443
+ }
444
+ ),
445
+ O && N ? Ee($, N) : null
446
+ ] });
447
+ });
448
+ function Ge() {
449
+ var T;
450
+ const { query: d } = te(), { props: r } = ne((O) => {
451
+ var N;
452
+ return { props: (N = O.data) == null ? void 0 : N.props };
453
+ }), { pageMedia: P } = A(() => ue(d), [d]), v = !!((T = r == null ? void 0 : r.background) != null && T.image), [h, x] = Z(!1);
454
+ return v ? /* @__PURE__ */ M("div", { className: "flex flex-col gap-3", children: [
455
+ /* @__PURE__ */ o(
456
+ Ie,
457
+ {
458
+ imageUrl: pe(r, P),
459
+ onOpenChange: x
460
+ }
461
+ ),
462
+ !h && /* @__PURE__ */ o(Ue, { sectionId: "image-settings" })
463
+ ] }) : /* @__PURE__ */ o("p", { className: "text-neutral-content text-xs italic", children: "Pick an image first to configure its settings." });
464
+ }
465
+ function it({ initialPosition: d, onClose: r }) {
466
+ return /* @__PURE__ */ o(
467
+ xe,
468
+ {
469
+ isOpen: !0,
470
+ onClose: r,
471
+ title: "Image Settings",
472
+ storageKey: "image-settings",
473
+ minWidth: 300,
474
+ maxWidth: 520,
475
+ minHeight: 320,
476
+ initialPosition: d,
477
+ zIndex: De,
478
+ scrollable: !0,
479
+ children: /* @__PURE__ */ o(Ge, {})
480
+ }
481
+ );
482
+ }
483
+ export {
484
+ it as default
485
+ };
@@ -0,0 +1,81 @@
1
+ import { jsx as r, jsxs as s } from "react/jsx-runtime";
2
+ import { W as g, a4 as y, t as c } from "./index-C66dAl3Q.js";
3
+ import { F as f } from "./FloatingPanel-DJP5Vhua.js";
4
+ import { G as h, g as d, D as x } from "./useLayoutPreset-wOMV5YnO.js";
5
+ const u = "border-primary bg-primary/10 text-primary ring-1 ring-primary/25 hover:border-primary hover:bg-primary/15 hover:text-primary";
6
+ function v(t) {
7
+ return t.name.toLowerCase().replace(/\s+/g, "-");
8
+ }
9
+ function N(t, i, a) {
10
+ return a.currentLayoutMode !== i || String(a.currentPresetLayout ?? "").trim().toLowerCase() !== v(t) ? !1 : t.columns === void 0 ? !0 : Number(a.currentLayoutColumns) === Number(t.columns);
11
+ }
12
+ function _({ initialPosition: t, onClose: i, lp: a }) {
13
+ const n = [
14
+ { label: "Side by side", presets: d("column"), layoutMode: "flex-row" },
15
+ { label: "Stacked", presets: d("row"), layoutMode: "flex-col" },
16
+ { label: "Grid", presets: h, layoutMode: "grid" }
17
+ ], m = (e) => {
18
+ a.handlePresetSelect(e), i();
19
+ }, p = x;
20
+ return /* @__PURE__ */ r(
21
+ f,
22
+ {
23
+ isOpen: !0,
24
+ onClose: i,
25
+ title: "Layout",
26
+ storageKey: "layout-preset",
27
+ minWidth: 280,
28
+ maxHeight: 640,
29
+ initialPosition: t,
30
+ zIndex: g,
31
+ scrollable: !0,
32
+ children: /* @__PURE__ */ s("div", { className: "grid grid-cols-[repeat(auto-fill,minmax(15rem,1fr))] gap-3", children: [
33
+ n.map((e) => /* @__PURE__ */ s("div", { children: [
34
+ /* @__PURE__ */ r("div", { className: "text-neutral-content mb-1.5 text-[10px] font-semibold tracking-wider uppercase", children: e.label }),
35
+ /* @__PURE__ */ r(y, { className: "max-h-[120px]", children: /* @__PURE__ */ r("div", { className: "grid grid-cols-[repeat(auto-fill,minmax(7rem,1fr))] gap-1.5 pr-1.5", children: e.presets.map((l, b) => {
36
+ const o = N(l, e.layoutMode, a);
37
+ return /* @__PURE__ */ r(
38
+ "button",
39
+ {
40
+ type: "button",
41
+ "aria-pressed": o,
42
+ "aria-label": l.name,
43
+ onClick: () => m(l),
44
+ className: c(
45
+ "ph-toolbar-dashed-btn items-center justify-center p-2",
46
+ o && u
47
+ ),
48
+ children: /* @__PURE__ */ r("div", { className: "w-full", children: l.icon })
49
+ },
50
+ `${e.label}-${b}`
51
+ );
52
+ }) }) })
53
+ ] }, e.label)),
54
+ /* @__PURE__ */ s("div", { children: [
55
+ /* @__PURE__ */ r("div", { className: "text-neutral-content mb-1.5 text-[10px] font-semibold tracking-wider uppercase", children: "Display" }),
56
+ /* @__PURE__ */ r("div", { className: "grid grid-cols-[repeat(auto-fill,minmax(7rem,1fr))] gap-1.5", children: p.map((e) => {
57
+ const l = a.currentDisplay === e.value;
58
+ return /* @__PURE__ */ r(
59
+ "button",
60
+ {
61
+ type: "button",
62
+ "aria-pressed": l,
63
+ "aria-label": e.label,
64
+ onClick: () => a.handleDisplayVariant(e.value),
65
+ className: c(
66
+ "ph-toolbar-dashed-btn items-center justify-center p-2 text-xs",
67
+ l && u
68
+ ),
69
+ children: e.label
70
+ },
71
+ e.value
72
+ );
73
+ }) })
74
+ ] })
75
+ ] })
76
+ }
77
+ );
78
+ }
79
+ export {
80
+ _ as default
81
+ };
@@ -0,0 +1,16 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { useNode as s } from "@craftjs/core";
3
+ import { u as m, L as p } from "./useLayoutPreset-wOMV5YnO.js";
4
+ const u = /* @__PURE__ */ new Set(["Container", "Data", "Header", "Footer", "Form"]);
5
+ function f() {
6
+ const { componentName: a } = s((e) => {
7
+ var t, o;
8
+ return {
9
+ componentName: ((t = e.data) == null ? void 0 : t.name) || ((o = e.data) == null ? void 0 : o.displayName) || ""
10
+ };
11
+ }), r = m({ propKey: "layoutPreset" });
12
+ return u.has(a) ? /* @__PURE__ */ n(p, { lp: r, sectionWrapper: !1 }) : null;
13
+ }
14
+ export {
15
+ f as LayoutPresetSlot
16
+ };
@@ -0,0 +1,13 @@
1
+ import { jsxs as t, jsx as o } from "react/jsx-runtime";
2
+ import { I as e } from "./IconInput-D2Gy7Hvf.js";
3
+ import { w as r, n as p } from "./index-C66dAl3Q.js";
4
+ import { r as n } from "./helpers-Cll72tMn.js";
5
+ const l = () => n({
6
+ Content: /* @__PURE__ */ t(r, { collapsible: !1, children: [
7
+ /* @__PURE__ */ o(p, { propKey: "text", type: "text", label: "Text", propType: "component" }),
8
+ /* @__PURE__ */ o(e, { propKey: "icon" })
9
+ ] })
10
+ });
11
+ export {
12
+ l as LinkMainTab
13
+ };