@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.
- package/README.md +1 -1
- package/dist/chrome/viewport/Viewport/hooks/usePageLoadIndicator.d.ts +2 -2
- package/dist/chrome/viewport/design-system/hooks/useDesignSystem.d.ts +2 -2
- package/dist/chrome/viewport/design-system/hooks/usePaletteState.d.ts +2 -2
- package/dist/chunks/ActionEditorPanel-9v50QUwu.js +89 -0
- package/dist/chunks/ActionInput-CTt7sOs6.js +929 -0
- package/dist/chunks/ActionsAddPicker-BeTPUUor.js +51 -0
- package/dist/chunks/ActionsInput-D0h-zLYj.js +174 -0
- package/dist/chunks/AnchoredPopover-CckPTxXu.js +2676 -0
- package/dist/chunks/AnimationEditorPanel-CXNmsTqV.js +26 -0
- package/dist/chunks/AnimationsInput-Djyz0uXG.js +292 -0
- package/dist/chunks/AnimationsInputPopover-B2-oNebx.js +71 -0
- package/dist/chunks/AnimationsPanel-DungA9qb.js +25 -0
- package/dist/chunks/Audio.render-CsR69fZ9.js +22 -0
- package/dist/chunks/AudioMainTab-BljM2NMQ.js +70 -0
- package/dist/chunks/BackdropEditorPanel-CA2k-6SR.js +26 -0
- package/dist/chunks/BackgroundImageInputPopover-vB_217Ig.js +94 -0
- package/dist/chunks/BackgroundImagePanel-BvMhF9eU.js +100 -0
- package/dist/chunks/BackgroundMainTab-CI4c5DEF.js +10 -0
- package/dist/chunks/BundleRowPanel-BcYfyfGQ.js +33 -0
- package/dist/chunks/ButtonMainTab-Civy_DoA.js +43 -0
- package/dist/chunks/CSSEditorInput-C1ITwAh3.js +73 -0
- package/dist/chunks/ClassNameInput-Ce0fGQES.js +720 -0
- package/dist/chunks/CodeEditor-axBXmPH8.js +33370 -0
- package/dist/chunks/ColorInput-BSfMNt86.js +187 -0
- package/dist/chunks/ColorPanel-DOLrT-gS.js +562 -0
- package/dist/chunks/ComponentImportExportPanel-DVcnGhGx.js +161 -0
- package/dist/chunks/ComponentImportExportPopover-BY1_oxU8.js +26 -0
- package/dist/chunks/ConditionEditorPanel-DLbqYaSF.js +43 -0
- package/dist/chunks/ConditionsAddPicker-SsHJlc1E.js +54 -0
- package/dist/chunks/ConditionsInput-B_5Nge8o.js +474 -0
- package/dist/chunks/ContainerMainTab-kkktm1Ns.js +1107 -0
- package/dist/chunks/ContainerOverflowSectionPanel-ibKXf-1N.js +120 -0
- package/dist/chunks/ContainerOverflowSectionPopover-CRQ9EPsn.js +24 -0
- package/dist/chunks/ContainerPaddingOverlay-Cd3xOv-S.js +340 -0
- package/dist/chunks/ContainerScrollEffectSection-Dbztqdnr.js +123 -0
- package/dist/chunks/ContainerStateSection-DY_gjBJL.js +478 -0
- package/dist/chunks/ConversionFields-Bpfl-SGP.js +135 -0
- package/dist/chunks/CraftListEditor-_TIy1ogW.js +73 -0
- package/dist/chunks/CreateTokenDialog-DNWtWqJd.js +147 -0
- package/dist/chunks/Data.render-DTmaqSyz.js +10 -0
- package/dist/chunks/DataAttributesPanel-mYhisO_O.js +125 -0
- package/dist/chunks/DataMainTab-Batm515E.js +23 -0
- package/dist/chunks/DataSourceSectionSlot-BKoO6Vxn.js +10 -0
- package/dist/chunks/EditorEmptyLeafHintView-D3E3UN_0.js +78 -0
- package/dist/chunks/EffectRowInputPopover-CYhfjFwJ.js +323 -0
- package/dist/chunks/EffectsClassInput-Yujuchwy.js +315 -0
- package/dist/chunks/Embed.render-BgKpUV8n.js +17 -0
- package/dist/chunks/EmbedMainTab-d_-Bnkug.js +225 -0
- package/dist/chunks/FilterEditorPanel-CRa0IpLr.js +26 -0
- package/dist/chunks/FlexDirectionInput-C5gYjk5W.js +78 -0
- package/dist/chunks/FloatingPanel-DJP5Vhua.js +553 -0
- package/dist/chunks/FontFamilyInput-CVNnVylt.js +111 -0
- package/dist/chunks/Form.render-6GjcmL2u.js +54 -0
- package/dist/chunks/FormElement.render-DWrG-2ID.js +36 -0
- package/dist/chunks/FormElementMainTab-DSbF3F6e.js +470 -0
- package/dist/chunks/FormMainTab-SHny1HxF.js +240 -0
- package/dist/chunks/GradientInputPopover-1K6O9jBq.js +103 -0
- package/dist/chunks/GradientPanel-DSRQKkaB.js +194 -0
- package/dist/chunks/HTMLCodeInput-CCe4Bj5z.js +69 -0
- package/dist/chunks/HandlerEditorPanel-DiOXobsl.js +93 -0
- package/dist/chunks/HandlersAddPicker-DWTgjKgo.js +101 -0
- package/dist/chunks/HandlersInput-p49STTn8.js +132 -0
- package/dist/chunks/IconDialogInput-C-81_L2n.js +105 -0
- package/dist/chunks/IconInput-D2Gy7Hvf.js +182 -0
- package/dist/chunks/IconMainTab-CNrVjDWP.js +26 -0
- package/dist/chunks/IconPickerPanel-BjNOlCh6.js +670 -0
- package/dist/chunks/ImageMainTab-C4O7RjX0.js +66 -0
- package/dist/chunks/ImageSettingsPanel-dvOmGg3C.js +485 -0
- package/dist/chunks/LayoutPresetPanel-CNAVAcvw.js +81 -0
- package/dist/chunks/LayoutPresetSlot-BqMTdE33.js +16 -0
- package/dist/chunks/LinkMainTab-BfFZx0AU.js +13 -0
- package/dist/chunks/ListEditor-mD-CmRNE.js +178 -0
- package/dist/chunks/Map.render-DFkmncHz.js +82 -0
- package/dist/chunks/MapLeaflet-DOfmZ3Pk.js +6588 -0
- package/dist/chunks/MapMainTab-CxI7IS1_.js +165 -0
- package/dist/chunks/MapPoint.render-0OAfCZTp.js +16 -0
- package/dist/chunks/MapPointMainTab-CmLcaSR5.js +60 -0
- package/dist/chunks/MediaInput-DHs3D8TJ.js +672 -0
- package/dist/chunks/MediaManagerModal-Dc5PK3dn.js +240 -0
- package/dist/chunks/MiniPreviewTile-B4zxTj9Y.js +32 -0
- package/dist/chunks/ModifierChipList-CwsWklih.js +33 -0
- package/dist/chunks/ModifiersAddPicker-D-vSYw7O.js +74 -0
- package/dist/chunks/ModifiersPickerPanel-CTefidBx.js +243 -0
- package/dist/chunks/NodeAiContextInputPopover-D5bn5o_T.js +66 -0
- package/dist/chunks/NodeAiContextPanel-Bx4rcjiM.js +81 -0
- package/dist/chunks/NumberSettingsPanel-DASi_l6V.js +56 -0
- package/dist/chunks/PageSettingsModal-D6o450IR.js +2678 -0
- package/dist/chunks/PatternInputPopover-qMWBv_nl.js +100 -0
- package/dist/chunks/PatternPanel-D2fgWDd-.js +352 -0
- package/dist/chunks/PeekTargetButton-ClrJX7zh.js +26 -0
- package/dist/chunks/PermissionsSection-DwobrV40.js +82 -0
- package/dist/chunks/PresetAddChildList-D6a0xdt8.js +35 -0
- package/dist/chunks/PropertiesInput-9O39ngbb.js +125 -0
- package/dist/chunks/PropertiesPanel-DO0RlalO.js +76 -0
- package/dist/chunks/SaveModifierPanel-B6mjKyrT.js +130 -0
- package/dist/chunks/ScrollEffectEditorPanel-CllGUhui.js +26 -0
- package/dist/chunks/SearchInput-DRUztbM0.js +76 -0
- package/dist/chunks/SearchableMenuPopover-DZKVXiEl.js +1251 -0
- package/dist/chunks/SlotRenderer-CaLf_2_C.js +38 -0
- package/dist/chunks/StateBindingEditorPanel-DKdcG5py.js +101 -0
- package/dist/chunks/StateBindingsAddPicker-DxMNAWAD.js +91 -0
- package/dist/chunks/StateBindingsInput-iWiqvAVB.js +103 -0
- package/dist/chunks/TailwindInput-660FZtyK.js +24 -0
- package/dist/chunks/TextEditor-B2O7DlN8.js +22032 -0
- package/dist/chunks/TextMainTab-B5udsXsk.js +260 -0
- package/dist/chunks/TextStyleEditorPanel-GRNPGzUL.js +381 -0
- package/dist/chunks/TextStylePickerPanel-l108SmGQ.js +140 -0
- package/dist/chunks/TextareaSettingsPanel-C1rQuF1O.js +50 -0
- package/dist/chunks/TokenPicker-Q0LToF_p.js +291 -0
- package/dist/chunks/ToolbarDashedButton-DbUxGmDg.js +23 -0
- package/dist/chunks/TransformEditorPanel-BGwyznZ6.js +26 -0
- package/dist/chunks/TransitionEditorPanel-BSvk58Ow.js +26 -0
- package/dist/chunks/TypographyPresetInput-DqnGSgR2.js +296 -0
- package/dist/chunks/ValidationPanel-CmA9SfoF.js +56 -0
- package/dist/chunks/Video.render-Dg6xvis4.js +21 -0
- package/dist/chunks/VideoMainTab-v5UFhUm-.js +174 -0
- package/dist/chunks/YouTube.esm-EbHnLU1Z.js +744 -0
- package/dist/chunks/dialogAtoms-CeQ2G05l.js +59 -0
- package/dist/chunks/extends-hS2Bh-Yp.js +12 -0
- package/dist/chunks/formatStorage-C3o2s3dk.js +22 -0
- package/dist/chunks/googleFonts-Dj4AntNi.js +323 -0
- package/dist/chunks/helpers-Cll72tMn.js +18 -0
- package/dist/chunks/index-B-GJd039.js +2875 -0
- package/dist/chunks/index-C66dAl3Q.js +32177 -0
- package/dist/chunks/index.esm-mqFx3NOs.js +644 -0
- package/dist/chunks/popoverOpenRequestAtom-hBS_siXv.js +22 -0
- package/dist/chunks/propertyRegistry-CMhVNOgl.js +38 -0
- package/dist/chunks/resolveAnchorsViaCraft-Cixm6ZyJ.js +31 -0
- package/dist/chunks/toolboxUtils-DjTMslSn.js +370 -0
- package/dist/chunks/uiPrimitives-BtohldWg.js +15 -0
- package/dist/chunks/use-event-listener-DO3Sk7g0.js +15 -0
- package/dist/chunks/useElementPicker-DoNuXNMQ.js +41 -0
- package/dist/chunks/useLayoutPreset-wOMV5YnO.js +528 -0
- package/dist/chunks/useMediaManager-CmKDbFfw.js +4629 -0
- package/dist/chunks/usePopoverAutoOpen-CxIjt0ez.js +25 -0
- package/dist/chunks/usePopoverPosition-83Vti7Aw.js +15 -0
- package/dist/render/static/index.js +9 -0
- package/package.json +22 -13
- package/dist/pagehub-viewer.umd.cjs +0 -574
- package/dist/pagehub.umd.cjs +0 -1130
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { jsxs as z, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { ROOT_NODE as J } from "@craftjs/utils";
|
|
3
|
+
import { useEditor as Q, useNode as U } from "@craftjs/core";
|
|
4
|
+
import { u as I, V as X, E as Y, g as Z, dL as ee, r as te, a as oe, p as re, b as ne, c as A, C as se, aw as ae, e as le } from "./index-C66dAl3Q.js";
|
|
5
|
+
import { useState as B, useRef as k, useEffect as ie, useMemo as O, useCallback as ce } from "react";
|
|
6
|
+
import { createPortal as ue } from "react-dom";
|
|
7
|
+
import { T as de } from "./TokenPicker-Q0LToF_p.js";
|
|
8
|
+
import { f as pe } from "./FloatingPanel-DJP5Vhua.js";
|
|
9
|
+
import { c as me, T as fe } from "./uiPrimitives-BtohldWg.js";
|
|
10
|
+
import { f as he } from "./formatStorage-C3o2s3dk.js";
|
|
11
|
+
const Le = (c) => {
|
|
12
|
+
const {
|
|
13
|
+
propKey: r,
|
|
14
|
+
label: u = "",
|
|
15
|
+
prefix: s = "",
|
|
16
|
+
index: d = null,
|
|
17
|
+
propItemKey: p = "",
|
|
18
|
+
propType: a = "class",
|
|
19
|
+
showPalette: Ce = !0,
|
|
20
|
+
onChange: v = () => {
|
|
21
|
+
},
|
|
22
|
+
labelHide: F = !1,
|
|
23
|
+
inline: ge = !1,
|
|
24
|
+
inputWidth: we = "",
|
|
25
|
+
labelWidth: K = ""
|
|
26
|
+
} = c, [C, m] = B(!1), [g, W] = B(null), x = k(null);
|
|
27
|
+
ie(() => {
|
|
28
|
+
if (!C) return;
|
|
29
|
+
const e = () => {
|
|
30
|
+
var L;
|
|
31
|
+
const t = (L = x.current) == null ? void 0 : L.getBoundingClientRect();
|
|
32
|
+
t && W({
|
|
33
|
+
top: t.bottom + 4,
|
|
34
|
+
right: window.innerWidth - t.right
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
return e(), window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
|
|
38
|
+
window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
|
|
39
|
+
};
|
|
40
|
+
}, [C]);
|
|
41
|
+
const y = I(X), f = I(Y).dark ?? !1, { actions: w, query: l } = Q(), {
|
|
42
|
+
actions: { setProp: b },
|
|
43
|
+
nodeProps: j,
|
|
44
|
+
id: P
|
|
45
|
+
} = U((e) => {
|
|
46
|
+
var t;
|
|
47
|
+
return {
|
|
48
|
+
nodeProps: ((t = e.data) == null ? void 0 : t.props) || {},
|
|
49
|
+
id: e.id
|
|
50
|
+
};
|
|
51
|
+
}), { value: D } = Z(c, y, j, f), n = D || "", h = ee(), M = O(() => {
|
|
52
|
+
var e;
|
|
53
|
+
if (h && h.length > 0) return h;
|
|
54
|
+
try {
|
|
55
|
+
const t = l.node(J).get();
|
|
56
|
+
return te(((e = t == null ? void 0 : t.data) == null ? void 0 : e.props) || {}).palette;
|
|
57
|
+
} catch {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
}, [h, l]), E = oe(n, s), [, N] = re(E, s), q = ne(E, s, M), T = !!String(n ?? "").trim(), V = q.backgroundColor ?? "", H = !T || me(V), R = O(() => {
|
|
61
|
+
const e = String(n ?? "").trim();
|
|
62
|
+
if (!e) return "";
|
|
63
|
+
const t = e.match(/palette:(.+)$/);
|
|
64
|
+
return t ? t[1] : e;
|
|
65
|
+
}, [n]), i = a === "class" ? le(y) : void 0, $ = (e) => {
|
|
66
|
+
if (!e) return;
|
|
67
|
+
const t = he(e, s);
|
|
68
|
+
A({
|
|
69
|
+
propKey: r,
|
|
70
|
+
index: d,
|
|
71
|
+
propItemKey: p,
|
|
72
|
+
propType: a,
|
|
73
|
+
value: t,
|
|
74
|
+
setProp: b,
|
|
75
|
+
query: l,
|
|
76
|
+
actions: w,
|
|
77
|
+
nodeId: P,
|
|
78
|
+
...a === "class" && i != null ? { view: i, classDark: f } : {}
|
|
79
|
+
}), v(N, t);
|
|
80
|
+
}, G = k(null), _ = n && n.includes("palette:") ? n : N, S = ce(() => {
|
|
81
|
+
A({
|
|
82
|
+
propKey: r,
|
|
83
|
+
index: d,
|
|
84
|
+
propItemKey: p,
|
|
85
|
+
propType: a,
|
|
86
|
+
value: "",
|
|
87
|
+
setProp: b,
|
|
88
|
+
query: l,
|
|
89
|
+
actions: w,
|
|
90
|
+
nodeId: P,
|
|
91
|
+
...a === "class" && i != null ? { view: i, classDark: f } : {}
|
|
92
|
+
}), v("", ""), m(!1);
|
|
93
|
+
}, [
|
|
94
|
+
w,
|
|
95
|
+
f,
|
|
96
|
+
i,
|
|
97
|
+
P,
|
|
98
|
+
d,
|
|
99
|
+
v,
|
|
100
|
+
p,
|
|
101
|
+
r,
|
|
102
|
+
a,
|
|
103
|
+
l,
|
|
104
|
+
b
|
|
105
|
+
]);
|
|
106
|
+
return /* @__PURE__ */ z("div", { ref: G, className: "relative", children: [
|
|
107
|
+
/* @__PURE__ */ o(
|
|
108
|
+
se,
|
|
109
|
+
{
|
|
110
|
+
variant: "swatch",
|
|
111
|
+
label: F ? void 0 : u,
|
|
112
|
+
onLabelClick: () => m((e) => !e),
|
|
113
|
+
index: d,
|
|
114
|
+
propType: a,
|
|
115
|
+
propKey: r,
|
|
116
|
+
propItemKey: p,
|
|
117
|
+
labelWidth: K,
|
|
118
|
+
trailing: n ? /* @__PURE__ */ o(ae, { onClick: (e) => {
|
|
119
|
+
e.stopPropagation(), S();
|
|
120
|
+
}, tooltip: "Clear color" }) : null,
|
|
121
|
+
children: /* @__PURE__ */ z(
|
|
122
|
+
"button",
|
|
123
|
+
{
|
|
124
|
+
ref: x,
|
|
125
|
+
type: "button",
|
|
126
|
+
id: `input-${r}`,
|
|
127
|
+
className: "relative h-full w-full min-w-0 flex-1 shrink rounded-none",
|
|
128
|
+
onClick: () => m((e) => !e),
|
|
129
|
+
"aria-label": u || r || "Color",
|
|
130
|
+
children: [
|
|
131
|
+
H && /* @__PURE__ */ o(
|
|
132
|
+
"span",
|
|
133
|
+
{
|
|
134
|
+
className: "pointer-events-none absolute inset-0 z-0",
|
|
135
|
+
style: fe,
|
|
136
|
+
"aria-hidden": !0
|
|
137
|
+
}
|
|
138
|
+
),
|
|
139
|
+
T && /* @__PURE__ */ o(
|
|
140
|
+
"span",
|
|
141
|
+
{
|
|
142
|
+
className: "pointer-events-none absolute inset-0 z-[1]",
|
|
143
|
+
style: { backgroundColor: V },
|
|
144
|
+
"aria-hidden": !0
|
|
145
|
+
}
|
|
146
|
+
),
|
|
147
|
+
R && /* @__PURE__ */ o(
|
|
148
|
+
"span",
|
|
149
|
+
{
|
|
150
|
+
className: "pointer-events-none absolute inset-0 z-[2] flex items-center justify-center px-2 text-[11px] font-medium tracking-tight text-white",
|
|
151
|
+
style: { mixBlendMode: "difference" },
|
|
152
|
+
children: /* @__PURE__ */ o("span", { className: "block max-w-full truncate", children: R })
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
}
|
|
159
|
+
),
|
|
160
|
+
C && g && /* @__PURE__ */ o(ve, { top: g.top, right: g.right, children: /* @__PURE__ */ o("div", { className: "border-base-300 bg-base-200 rounded-xl border shadow-xl", children: /* @__PURE__ */ o(
|
|
161
|
+
de,
|
|
162
|
+
{
|
|
163
|
+
variant: "panel",
|
|
164
|
+
value: _,
|
|
165
|
+
onChange: (e) => {
|
|
166
|
+
$(e);
|
|
167
|
+
},
|
|
168
|
+
onClose: () => m(!1),
|
|
169
|
+
onClear: S
|
|
170
|
+
}
|
|
171
|
+
) }) })
|
|
172
|
+
] });
|
|
173
|
+
};
|
|
174
|
+
function ve({
|
|
175
|
+
top: c,
|
|
176
|
+
right: r,
|
|
177
|
+
children: u
|
|
178
|
+
}) {
|
|
179
|
+
const s = k(null);
|
|
180
|
+
return pe(s), ue(
|
|
181
|
+
/* @__PURE__ */ o("div", { ref: s, className: "pagehub-sdk-root fixed z-[1200]", style: { top: c, right: r }, children: u }),
|
|
182
|
+
document.querySelector(".pagehub-sdk-root") || document.body
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
export {
|
|
186
|
+
Le as C
|
|
187
|
+
};
|