@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.
- 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/dist/theme.css +168 -0
- package/package.json +25 -14
- package/dist/pagehub-viewer.umd.cjs +0 -574
- package/dist/pagehub.umd.cjs +0 -1130
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { W as p, aO as u, bY as x } from "./index-C66dAl3Q.js";
|
|
3
|
+
import { F as g } from "./FloatingPanel-DJP5Vhua.js";
|
|
4
|
+
import { C as f } from "./CodeEditor-axBXmPH8.js";
|
|
5
|
+
import { b, H as N } from "./HandlersAddPicker-DWTgjKgo.js";
|
|
6
|
+
function O({
|
|
7
|
+
event: a,
|
|
8
|
+
code: r,
|
|
9
|
+
preventDefault: l,
|
|
10
|
+
takenEvents: o,
|
|
11
|
+
onChange: i,
|
|
12
|
+
onRemove: c,
|
|
13
|
+
initialPosition: d,
|
|
14
|
+
onClose: s
|
|
15
|
+
}) {
|
|
16
|
+
const h = new Set(o), m = b.filter(
|
|
17
|
+
(e) => e.value === a || !h.has(e.value)
|
|
18
|
+
);
|
|
19
|
+
return /* @__PURE__ */ t(
|
|
20
|
+
g,
|
|
21
|
+
{
|
|
22
|
+
isOpen: !0,
|
|
23
|
+
onClose: s,
|
|
24
|
+
title: `Handler: ${N[a] ?? a}`,
|
|
25
|
+
storageKey: "handler-input",
|
|
26
|
+
minWidth: 320,
|
|
27
|
+
maxWidth: 560,
|
|
28
|
+
minHeight: 260,
|
|
29
|
+
initialPosition: d,
|
|
30
|
+
zIndex: p,
|
|
31
|
+
scrollable: !0,
|
|
32
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: [
|
|
33
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-1", children: [
|
|
34
|
+
/* @__PURE__ */ t("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ t(
|
|
35
|
+
u,
|
|
36
|
+
{
|
|
37
|
+
value: a,
|
|
38
|
+
onChange: (e) => i({ event: e, code: r, preventDefault: l }),
|
|
39
|
+
propKey: "handlerEvent",
|
|
40
|
+
children: m.map((e) => /* @__PURE__ */ t("option", { value: e.value, children: e.label }, e.value))
|
|
41
|
+
}
|
|
42
|
+
) }),
|
|
43
|
+
/* @__PURE__ */ t(
|
|
44
|
+
"button",
|
|
45
|
+
{
|
|
46
|
+
type: "button",
|
|
47
|
+
onClick: () => {
|
|
48
|
+
c(), s();
|
|
49
|
+
},
|
|
50
|
+
className: "text-neutral-content hover:bg-error hover:text-error-content flex shrink-0 items-center justify-center rounded p-1 text-xs transition-colors",
|
|
51
|
+
"aria-label": "Remove handler",
|
|
52
|
+
children: /* @__PURE__ */ t(x, {})
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
] }),
|
|
56
|
+
/* @__PURE__ */ n("p", { className: "text-neutral-content text-[10px] leading-snug", children: [
|
|
57
|
+
"Runs after the action. ",
|
|
58
|
+
/* @__PURE__ */ t("code", { className: "text-[9px]", children: "event" }),
|
|
59
|
+
" is in scope."
|
|
60
|
+
] }),
|
|
61
|
+
/* @__PURE__ */ n("label", { className: "text-neutral-content flex items-center gap-1.5 text-[10px] leading-snug", children: [
|
|
62
|
+
/* @__PURE__ */ t(
|
|
63
|
+
"input",
|
|
64
|
+
{
|
|
65
|
+
type: "checkbox",
|
|
66
|
+
checked: l,
|
|
67
|
+
onChange: (e) => i({ event: a, code: r, preventDefault: e.target.checked }),
|
|
68
|
+
className: "size-3"
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ t("span", { children: "Prevent default — skips form submit / link navigation / etc. before this handler runs." })
|
|
72
|
+
] }),
|
|
73
|
+
/* @__PURE__ */ t(
|
|
74
|
+
f,
|
|
75
|
+
{
|
|
76
|
+
value: r,
|
|
77
|
+
onChange: (e) => i({ event: a, code: e, preventDefault: l }),
|
|
78
|
+
language: "javascript",
|
|
79
|
+
minHeight: "120px",
|
|
80
|
+
maxHeight: "320px",
|
|
81
|
+
height: "160px",
|
|
82
|
+
lineNumbers: !1,
|
|
83
|
+
toolbarDenseCode: !0,
|
|
84
|
+
placeholder: "event.stopPropagation();"
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
] })
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
export {
|
|
92
|
+
O as default
|
|
93
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useNode as T } from "@craftjs/core";
|
|
3
|
+
import { useRef as g } from "react";
|
|
4
|
+
import { aq as a, eZ as C, fb as p, ar as b, fc as d, aY as v, Q as k, e9 as A, d as y, G as _ } from "./index-C66dAl3Q.js";
|
|
5
|
+
import { S as N } from "./SearchableMenuPopover-DZKVXiEl.js";
|
|
6
|
+
import { g as L } from "./propertyRegistry-CMhVNOgl.js";
|
|
7
|
+
import { P as R, u as w, r as H } from "./popoverOpenRequestAtom-hBS_siXv.js";
|
|
8
|
+
const m = [
|
|
9
|
+
{ value: "onClick", label: "On Click" },
|
|
10
|
+
{ value: "onDoubleClick", label: "On Double Click" },
|
|
11
|
+
{ value: "onMouseEnter", label: "On Mouse Enter" },
|
|
12
|
+
{ value: "onMouseLeave", label: "On Mouse Leave" },
|
|
13
|
+
{ value: "onMouseDown", label: "On Mouse Down" },
|
|
14
|
+
{ value: "onMouseUp", label: "On Mouse Up" },
|
|
15
|
+
{ value: "onFocus", label: "On Focus" },
|
|
16
|
+
{ value: "onBlur", label: "On Blur" },
|
|
17
|
+
{ value: "onKeyDown", label: "On Key Down" },
|
|
18
|
+
{ value: "onKeyUp", label: "On Key Up" },
|
|
19
|
+
{ value: "onSubmit", label: "On Submit" },
|
|
20
|
+
{ value: "onChange", label: "On Change" },
|
|
21
|
+
{ value: "onInput", label: "On Input" }
|
|
22
|
+
], Y = Object.fromEntries(
|
|
23
|
+
m.map((o) => [o.value, o.label])
|
|
24
|
+
), q = {
|
|
25
|
+
onClick: v,
|
|
26
|
+
onDoubleClick: v,
|
|
27
|
+
onMouseEnter: d,
|
|
28
|
+
onMouseLeave: d,
|
|
29
|
+
onMouseDown: b,
|
|
30
|
+
onMouseUp: b,
|
|
31
|
+
onFocus: a,
|
|
32
|
+
onBlur: a,
|
|
33
|
+
onKeyDown: p,
|
|
34
|
+
onKeyUp: p,
|
|
35
|
+
onSubmit: C,
|
|
36
|
+
onChange: a,
|
|
37
|
+
onInput: a
|
|
38
|
+
};
|
|
39
|
+
function G(o) {
|
|
40
|
+
return q[o] || k;
|
|
41
|
+
}
|
|
42
|
+
const O = "handlers";
|
|
43
|
+
function I({ def: o }) {
|
|
44
|
+
var r;
|
|
45
|
+
const {
|
|
46
|
+
id: s,
|
|
47
|
+
actions: { setProp: f },
|
|
48
|
+
handlers: h
|
|
49
|
+
} = T((e) => ({
|
|
50
|
+
id: e.id,
|
|
51
|
+
handlers: e.data.props.handlers && typeof e.data.props.handlers == "object" ? e.data.props.handlers : {}
|
|
52
|
+
})), n = A(), t = (r = L(o.section)) == null ? void 0 : r.title, [D, M] = y(R), l = g(null);
|
|
53
|
+
w(
|
|
54
|
+
s,
|
|
55
|
+
o.id,
|
|
56
|
+
() => requestAnimationFrame(() => {
|
|
57
|
+
var e;
|
|
58
|
+
return (e = l.current) == null ? void 0 : e.open();
|
|
59
|
+
})
|
|
60
|
+
);
|
|
61
|
+
const P = new Set(Object.keys(h)), S = m.filter(
|
|
62
|
+
(e) => !P.has(e.value)
|
|
63
|
+
).map((e) => ({
|
|
64
|
+
id: e.value,
|
|
65
|
+
label: e.label,
|
|
66
|
+
data: e.value
|
|
67
|
+
}));
|
|
68
|
+
return /* @__PURE__ */ i(
|
|
69
|
+
N,
|
|
70
|
+
{
|
|
71
|
+
ref: l,
|
|
72
|
+
items: S,
|
|
73
|
+
onSelect: (e) => {
|
|
74
|
+
if (!e.data) return;
|
|
75
|
+
const E = e.data;
|
|
76
|
+
f((u) => {
|
|
77
|
+
const c = { ...u.handlers || {} };
|
|
78
|
+
c[E] = "", u.handlers = c;
|
|
79
|
+
}), t && (n != null && n.setOpen) && n.setOpen(t, !0), H(D, M, s, O);
|
|
80
|
+
},
|
|
81
|
+
trigger: /* @__PURE__ */ i(_, { className: "size-3.5", "aria-hidden": !0 }),
|
|
82
|
+
triggerAriaLabel: "Add handler",
|
|
83
|
+
searchPlaceholder: "Search events…",
|
|
84
|
+
emptyMessage: "All events in use",
|
|
85
|
+
anchor: "bottom end",
|
|
86
|
+
panelWidthClass: "w-56"
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
const Q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
91
|
+
__proto__: null,
|
|
92
|
+
HANDLERS_BODY_DEF_ID: O,
|
|
93
|
+
default: I
|
|
94
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
95
|
+
export {
|
|
96
|
+
Y as H,
|
|
97
|
+
O as a,
|
|
98
|
+
m as b,
|
|
99
|
+
Q as c,
|
|
100
|
+
G as g
|
|
101
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { jsxs as L, Fragment as A, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { useNode as k } from "@craftjs/core";
|
|
3
|
+
import { useState as j, useRef as b, useEffect as P, Suspense as N, lazy as _, useMemo as E } from "react";
|
|
4
|
+
import { C as q, u as C } from "./index-C66dAl3Q.js";
|
|
5
|
+
import { u as I } from "./usePopoverPosition-83Vti7Aw.js";
|
|
6
|
+
import { H as S, g as M, a as F } from "./HandlersAddPicker-DWTgjKgo.js";
|
|
7
|
+
import { P as K, p as V } from "./popoverOpenRequestAtom-hBS_siXv.js";
|
|
8
|
+
const T = _(() => import("./HandlerEditorPanel-DiOXobsl.js")), w = 360;
|
|
9
|
+
function z(o) {
|
|
10
|
+
const l = (o || "").split(`
|
|
11
|
+
`).map((i) => i.trim()).find((i) => i.length > 0);
|
|
12
|
+
return l ? l.length > 32 ? l.slice(0, 32) + "…" : l : "Add JS…";
|
|
13
|
+
}
|
|
14
|
+
function B({
|
|
15
|
+
event: o,
|
|
16
|
+
code: l,
|
|
17
|
+
preventDefault: i,
|
|
18
|
+
takenEvents: H,
|
|
19
|
+
onChange: v,
|
|
20
|
+
onRemove: d,
|
|
21
|
+
autoOpen: p,
|
|
22
|
+
onAutoOpenConsumed: r
|
|
23
|
+
}) {
|
|
24
|
+
const [f, c] = j(!1), { triggerRef: y, initialPos: m, setInitialPos: g, computePosition: h } = I(w), O = M(o), R = S[o] ?? o, n = z(l), e = () => {
|
|
25
|
+
g(h()), c(!0);
|
|
26
|
+
}, t = b(!1);
|
|
27
|
+
return P(() => {
|
|
28
|
+
!p || t.current || (t.current = !0, requestAnimationFrame(() => {
|
|
29
|
+
g(h()), c(!0), r == null || r();
|
|
30
|
+
}));
|
|
31
|
+
}, [p]), /* @__PURE__ */ L(A, { children: [
|
|
32
|
+
/* @__PURE__ */ u(
|
|
33
|
+
q,
|
|
34
|
+
{
|
|
35
|
+
mode: "popover",
|
|
36
|
+
ref: y,
|
|
37
|
+
label: R,
|
|
38
|
+
open: f,
|
|
39
|
+
onTriggerClick: () => f ? c(!1) : e(),
|
|
40
|
+
onClear: () => {
|
|
41
|
+
f && c(!1), d();
|
|
42
|
+
},
|
|
43
|
+
triggerAriaLabel: "Edit handler",
|
|
44
|
+
clearAriaLabel: "Remove handler",
|
|
45
|
+
leading: /* @__PURE__ */ u(O, { className: "size-3.5", "aria-hidden": !0 }),
|
|
46
|
+
summary: n
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
f && /* @__PURE__ */ u(N, { fallback: null, children: /* @__PURE__ */ u(
|
|
50
|
+
T,
|
|
51
|
+
{
|
|
52
|
+
event: o,
|
|
53
|
+
code: l,
|
|
54
|
+
preventDefault: i,
|
|
55
|
+
takenEvents: H,
|
|
56
|
+
onChange: v,
|
|
57
|
+
onRemove: d,
|
|
58
|
+
initialPosition: m,
|
|
59
|
+
onClose: () => c(!1)
|
|
60
|
+
}
|
|
61
|
+
) })
|
|
62
|
+
] });
|
|
63
|
+
}
|
|
64
|
+
function Z() {
|
|
65
|
+
const {
|
|
66
|
+
id: o,
|
|
67
|
+
actions: { setProp: l },
|
|
68
|
+
handlers: i,
|
|
69
|
+
handlerOptions: H
|
|
70
|
+
} = k((n) => {
|
|
71
|
+
const e = n.data.props, t = e.handlers && typeof e.handlers == "object" ? e.handlers : {}, s = e.handlerOptions && typeof e.handlerOptions == "object" ? e.handlerOptions : {};
|
|
72
|
+
return {
|
|
73
|
+
id: n.id,
|
|
74
|
+
handlers: t,
|
|
75
|
+
handlerOptions: s
|
|
76
|
+
};
|
|
77
|
+
}), d = C(K).get(V(o, F)) || 0, p = E(
|
|
78
|
+
() => Object.entries(i).filter(([, n]) => typeof n == "string"),
|
|
79
|
+
[i]
|
|
80
|
+
), r = E(() => p.map(([n]) => n), [p]), f = r.join("|"), c = (n, e) => {
|
|
81
|
+
l((t) => {
|
|
82
|
+
const s = { ...t.handlers || {} }, a = {
|
|
83
|
+
...t.handlerOptions || {}
|
|
84
|
+
};
|
|
85
|
+
if (n === e.event ? s[n] = e.code : (delete s[n], delete a[n], s[e.event] = e.code), t.handlers = s, e.preventDefault)
|
|
86
|
+
a[e.event] = { ...a[e.event] || {}, preventDefault: !0 };
|
|
87
|
+
else if (a[e.event]) {
|
|
88
|
+
const { preventDefault: J, ...D } = a[e.event];
|
|
89
|
+
Object.keys(D).length === 0 ? delete a[e.event] : a[e.event] = D;
|
|
90
|
+
}
|
|
91
|
+
Object.keys(a).length === 0 ? delete t.handlerOptions : t.handlerOptions = a;
|
|
92
|
+
});
|
|
93
|
+
}, y = (n) => {
|
|
94
|
+
l((e) => {
|
|
95
|
+
if (!e.handlers) return;
|
|
96
|
+
const t = { ...e.handlers };
|
|
97
|
+
if (delete t[n], Object.keys(t).length === 0 ? delete e.handlers : e.handlers = t, e.handlerOptions) {
|
|
98
|
+
const s = { ...e.handlerOptions };
|
|
99
|
+
delete s[n], Object.keys(s).length === 0 ? delete e.handlerOptions : e.handlerOptions = s;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}, m = b(r), [g, h] = j(null);
|
|
103
|
+
P(() => {
|
|
104
|
+
const n = new Set(m.current), e = r.find((t) => !n.has(t));
|
|
105
|
+
e && h(e), m.current = r;
|
|
106
|
+
}, [f, r]);
|
|
107
|
+
const O = b(0);
|
|
108
|
+
P(() => {
|
|
109
|
+
d === 0 || d === O.current || (O.current = d, r.length > 0 && h(r[r.length - 1]));
|
|
110
|
+
}, [d, r]);
|
|
111
|
+
const R = () => h(null);
|
|
112
|
+
return /* @__PURE__ */ u("div", { className: "flex flex-col gap-1", children: p.map(([n, e]) => {
|
|
113
|
+
var t;
|
|
114
|
+
return /* @__PURE__ */ u(
|
|
115
|
+
B,
|
|
116
|
+
{
|
|
117
|
+
event: n,
|
|
118
|
+
code: e,
|
|
119
|
+
preventDefault: !!((t = H[n]) != null && t.preventDefault),
|
|
120
|
+
takenEvents: r,
|
|
121
|
+
autoOpen: n === g,
|
|
122
|
+
onAutoOpenConsumed: R,
|
|
123
|
+
onChange: (s) => c(n, s),
|
|
124
|
+
onRemove: () => y(n)
|
|
125
|
+
},
|
|
126
|
+
`handler-${n}`
|
|
127
|
+
);
|
|
128
|
+
}) });
|
|
129
|
+
}
|
|
130
|
+
export {
|
|
131
|
+
Z as HandlersInput
|
|
132
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { jsxs as F, Fragment as H, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useEditor as C, useNode as T } from "@craftjs/core";
|
|
3
|
+
import { useMemo as W, useState as $, Suspense as j, lazy as M } from "react";
|
|
4
|
+
import { _ as R, $ as S, u as h, V as _, E as q, C as B, a0 as O, c as G, e as Q } from "./index-C66dAl3Q.js";
|
|
5
|
+
import { u as Z } from "./usePopoverPosition-83Vti7Aw.js";
|
|
6
|
+
const J = ({ value: e }) => {
|
|
7
|
+
const { query: o } = C(), { pageMedia: n } = W(() => R(o), [o]);
|
|
8
|
+
return S(e, n);
|
|
9
|
+
}, U = M(() => import("./IconPickerPanel-BjNOlCh6.js")), p = 384, X = 480;
|
|
10
|
+
function Y(e) {
|
|
11
|
+
if (!e) return "Pick icon";
|
|
12
|
+
if (e.startsWith("ref-image:")) return "Image";
|
|
13
|
+
const o = e.lastIndexOf("/");
|
|
14
|
+
return (o >= 0 ? e.slice(o + 1) : e).replace(/^(Tb|Fa6?|Bs|Bi|Im|Si|Lia)/, "").replace(/([a-z])([A-Z])/g, "$1 $2");
|
|
15
|
+
}
|
|
16
|
+
const ae = ({
|
|
17
|
+
propKey: e,
|
|
18
|
+
label: o = "",
|
|
19
|
+
prefix: n = "",
|
|
20
|
+
index: r = null,
|
|
21
|
+
propItemKey: c = "",
|
|
22
|
+
propType: f = "class"
|
|
23
|
+
}) => {
|
|
24
|
+
var g, P;
|
|
25
|
+
const { actions: I, query: k } = C(), x = h(_), A = h(q).dark ?? !1, b = Q(x), {
|
|
26
|
+
actions: { setProp: N },
|
|
27
|
+
nodeProps: d,
|
|
28
|
+
id: v
|
|
29
|
+
} = T((a) => ({
|
|
30
|
+
nodeProps: a.data.props || {},
|
|
31
|
+
id: a.id
|
|
32
|
+
})), [l, u] = $(!1), { triggerRef: E, initialPos: L, setInitialPos: V, computePosition: w } = Z(p), m = (a) => {
|
|
33
|
+
G({
|
|
34
|
+
propType: f,
|
|
35
|
+
propKey: e,
|
|
36
|
+
value: a,
|
|
37
|
+
setProp: N,
|
|
38
|
+
index: r,
|
|
39
|
+
propItemKey: c,
|
|
40
|
+
query: k,
|
|
41
|
+
actions: I,
|
|
42
|
+
nodeId: v,
|
|
43
|
+
...f === "class" ? { view: b, classDark: A } : {}
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
let s = "";
|
|
47
|
+
if (r !== null && c)
|
|
48
|
+
s = ((P = (g = d[e]) == null ? void 0 : g[r]) == null ? void 0 : P[c]) || "";
|
|
49
|
+
else {
|
|
50
|
+
const a = e.split(".");
|
|
51
|
+
let t = d;
|
|
52
|
+
for (const D of a)
|
|
53
|
+
if (t = t == null ? void 0 : t[D], t === void 0) break;
|
|
54
|
+
s = typeof t == "string" ? t : "";
|
|
55
|
+
}
|
|
56
|
+
const z = () => {
|
|
57
|
+
V(w()), u(!0);
|
|
58
|
+
}, y = s ? /* @__PURE__ */ i(
|
|
59
|
+
"span",
|
|
60
|
+
{
|
|
61
|
+
className: "text-base-content flex size-4 shrink-0 items-center justify-center [&>svg]:size-full",
|
|
62
|
+
"aria-hidden": !0,
|
|
63
|
+
children: /* @__PURE__ */ i(J, { value: s })
|
|
64
|
+
}
|
|
65
|
+
) : /* @__PURE__ */ i(O, { className: "size-3.5", "aria-hidden": !0 });
|
|
66
|
+
return /* @__PURE__ */ F(H, { children: [
|
|
67
|
+
/* @__PURE__ */ i(
|
|
68
|
+
B,
|
|
69
|
+
{
|
|
70
|
+
mode: "popover",
|
|
71
|
+
ref: E,
|
|
72
|
+
label: o,
|
|
73
|
+
propKey: e,
|
|
74
|
+
propType: f,
|
|
75
|
+
index: r ?? void 0,
|
|
76
|
+
propItemKey: c || null,
|
|
77
|
+
open: l,
|
|
78
|
+
onTriggerClick: () => l ? u(!1) : z(),
|
|
79
|
+
onClear: () => {
|
|
80
|
+
l && u(!1), m("");
|
|
81
|
+
},
|
|
82
|
+
triggerAriaLabel: s ? `Icon: ${s}` : "Choose icon",
|
|
83
|
+
clearAriaLabel: "Clear icon",
|
|
84
|
+
leading: y,
|
|
85
|
+
summary: Y(s)
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
l && /* @__PURE__ */ i(j, { fallback: null, children: /* @__PURE__ */ i(
|
|
89
|
+
U,
|
|
90
|
+
{
|
|
91
|
+
value: s,
|
|
92
|
+
prefix: n,
|
|
93
|
+
onChange: m,
|
|
94
|
+
onClose: () => u(!1),
|
|
95
|
+
initialPosition: L,
|
|
96
|
+
defaultWidth: p,
|
|
97
|
+
defaultHeight: X
|
|
98
|
+
}
|
|
99
|
+
) })
|
|
100
|
+
] });
|
|
101
|
+
};
|
|
102
|
+
export {
|
|
103
|
+
J as C,
|
|
104
|
+
ae as I
|
|
105
|
+
};
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { jsx as o, jsxs as m, Fragment as P } from "react/jsx-runtime";
|
|
2
|
+
import { useState as C } from "react";
|
|
3
|
+
import { useNode as L } from "@craftjs/core";
|
|
4
|
+
import { C as W, W as S, n as r, o as s, X as z } from "./index-C66dAl3Q.js";
|
|
5
|
+
import { F as N } from "./FloatingPanel-DJP5Vhua.js";
|
|
6
|
+
import { u as y } from "./usePopoverPosition-83Vti7Aw.js";
|
|
7
|
+
import { C as O, I as R } from "./IconDialogInput-C-81_L2n.js";
|
|
8
|
+
import { C as V } from "./ColorInput-BSfMNt86.js";
|
|
9
|
+
import { U as k } from "./index-B-GJd039.js";
|
|
10
|
+
const E = ({
|
|
11
|
+
propKey: e = "shadow",
|
|
12
|
+
propType: t = "class",
|
|
13
|
+
label: i = "Shadow",
|
|
14
|
+
inline: n = !0
|
|
15
|
+
}) => /* @__PURE__ */ o(
|
|
16
|
+
k,
|
|
17
|
+
{
|
|
18
|
+
propKey: e,
|
|
19
|
+
propType: t,
|
|
20
|
+
propTag: "shadow",
|
|
21
|
+
tailwindKey: "dropShadows",
|
|
22
|
+
allowedTypes: ["tailwind", "calc"],
|
|
23
|
+
label: i,
|
|
24
|
+
showVarSelector: !0,
|
|
25
|
+
inline: n
|
|
26
|
+
}
|
|
27
|
+
), F = 320;
|
|
28
|
+
function Z(e) {
|
|
29
|
+
if (e.startsWith("ref-image:")) return "Custom";
|
|
30
|
+
const t = z(e);
|
|
31
|
+
if (!t) return e;
|
|
32
|
+
const i = t.set.charAt(0).toUpperCase() + t.set.slice(1);
|
|
33
|
+
return (t.name.startsWith(i) ? t.name.slice(i.length) : t.name).replace(/([a-z])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2");
|
|
34
|
+
}
|
|
35
|
+
function f(e, t) {
|
|
36
|
+
const i = t.split(".");
|
|
37
|
+
let n = e;
|
|
38
|
+
for (const c of i)
|
|
39
|
+
if (n = n == null ? void 0 : n[c], n === void 0) return;
|
|
40
|
+
return n;
|
|
41
|
+
}
|
|
42
|
+
const q = ({
|
|
43
|
+
propKey: e = "icon",
|
|
44
|
+
propType: t = "component",
|
|
45
|
+
label: i = "Icon",
|
|
46
|
+
showIconOnly: n = !0,
|
|
47
|
+
showPosition: c = !0,
|
|
48
|
+
iconOnlyLabel: g = "Only Show Icon",
|
|
49
|
+
positionLabel: b = "Position"
|
|
50
|
+
}) => {
|
|
51
|
+
const [d, u] = C(!1), { triggerRef: I, initialPos: x, setInitialPos: $, computePosition: v } = y(F), {
|
|
52
|
+
actions: { setProp: w },
|
|
53
|
+
iconValue: a
|
|
54
|
+
} = L((l) => {
|
|
55
|
+
var p, h;
|
|
56
|
+
return {
|
|
57
|
+
iconValue: typeof f(((p = l.data) == null ? void 0 : p.props) || {}, `${e}.value`) == "string" ? f(((h = l.data) == null ? void 0 : h.props) || {}, `${e}.value`) : ""
|
|
58
|
+
};
|
|
59
|
+
}), A = () => {
|
|
60
|
+
$(v()), u(!0);
|
|
61
|
+
};
|
|
62
|
+
return /* @__PURE__ */ m(P, { children: [
|
|
63
|
+
/* @__PURE__ */ o(
|
|
64
|
+
W,
|
|
65
|
+
{
|
|
66
|
+
mode: "popover",
|
|
67
|
+
ref: I,
|
|
68
|
+
label: i,
|
|
69
|
+
open: d,
|
|
70
|
+
onTriggerClick: () => d ? u(!1) : A(),
|
|
71
|
+
onClear: () => {
|
|
72
|
+
w((l) => {
|
|
73
|
+
delete l[e];
|
|
74
|
+
}, 0);
|
|
75
|
+
},
|
|
76
|
+
triggerAriaLabel: a ? `Edit icon: ${a}` : "Add icon",
|
|
77
|
+
clearAriaLabel: "Remove icon",
|
|
78
|
+
leading: /* @__PURE__ */ o(
|
|
79
|
+
"span",
|
|
80
|
+
{
|
|
81
|
+
className: `flex size-4 items-center justify-center ${a ? "text-base-content" : "border-base-300 text-neutral-content/60 rounded-sm border border-dashed"}`,
|
|
82
|
+
"aria-hidden": !0,
|
|
83
|
+
children: a ? /* @__PURE__ */ o(O, { value: a }) : null
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
summary: a ? Z(a) : "Add..."
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
d && /* @__PURE__ */ o(
|
|
90
|
+
N,
|
|
91
|
+
{
|
|
92
|
+
isOpen: !0,
|
|
93
|
+
onClose: () => u(!1),
|
|
94
|
+
title: i,
|
|
95
|
+
storageKey: `icon-bundle-${e}`,
|
|
96
|
+
minWidth: 280,
|
|
97
|
+
maxWidth: 480,
|
|
98
|
+
minHeight: 200,
|
|
99
|
+
initialPosition: x,
|
|
100
|
+
zIndex: S,
|
|
101
|
+
children: /* @__PURE__ */ m("div", { className: "flex flex-1 flex-col gap-2 overflow-y-auto p-3", children: [
|
|
102
|
+
/* @__PURE__ */ o(
|
|
103
|
+
R,
|
|
104
|
+
{
|
|
105
|
+
propKey: `${e}.value`,
|
|
106
|
+
propType: t,
|
|
107
|
+
label: "Image"
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
n && /* @__PURE__ */ o(
|
|
111
|
+
r,
|
|
112
|
+
{
|
|
113
|
+
propKey: `${e}.only`,
|
|
114
|
+
propType: t,
|
|
115
|
+
type: "checkbox",
|
|
116
|
+
label: g,
|
|
117
|
+
on: !0,
|
|
118
|
+
labelHide: !0,
|
|
119
|
+
labelWidth: "w-full"
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
c && /* @__PURE__ */ m(
|
|
123
|
+
r,
|
|
124
|
+
{
|
|
125
|
+
propKey: `${e}.position`,
|
|
126
|
+
propType: t,
|
|
127
|
+
type: "select",
|
|
128
|
+
label: b,
|
|
129
|
+
inline: !0,
|
|
130
|
+
children: [
|
|
131
|
+
/* @__PURE__ */ o("option", { value: "left", children: "Left" }),
|
|
132
|
+
/* @__PURE__ */ o("option", { value: "right", children: "Right" }),
|
|
133
|
+
/* @__PURE__ */ o("option", { value: "top", children: "Top" }),
|
|
134
|
+
/* @__PURE__ */ o("option", { value: "bottom", children: "Bottom" })
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
/* @__PURE__ */ o(
|
|
139
|
+
r,
|
|
140
|
+
{
|
|
141
|
+
propKey: `${e}.size`,
|
|
142
|
+
propType: t,
|
|
143
|
+
type: "select",
|
|
144
|
+
label: "Size",
|
|
145
|
+
max: s.allWidths.length - 1,
|
|
146
|
+
min: 0,
|
|
147
|
+
valueLabels: s.allWidths,
|
|
148
|
+
inline: !0
|
|
149
|
+
}
|
|
150
|
+
),
|
|
151
|
+
/* @__PURE__ */ o(
|
|
152
|
+
V,
|
|
153
|
+
{
|
|
154
|
+
propKey: `${e}.color`,
|
|
155
|
+
propType: t,
|
|
156
|
+
label: "Color",
|
|
157
|
+
prefix: "text",
|
|
158
|
+
inline: !0
|
|
159
|
+
}
|
|
160
|
+
),
|
|
161
|
+
/* @__PURE__ */ o(E, { propKey: `${e}.shadow`, propType: t }),
|
|
162
|
+
/* @__PURE__ */ o(
|
|
163
|
+
r,
|
|
164
|
+
{
|
|
165
|
+
propKey: `${e}.gap`,
|
|
166
|
+
propType: t,
|
|
167
|
+
type: "select",
|
|
168
|
+
label: "Gap",
|
|
169
|
+
max: s.gap.length - 1,
|
|
170
|
+
min: 0,
|
|
171
|
+
valueLabels: s.gap,
|
|
172
|
+
inline: !0
|
|
173
|
+
}
|
|
174
|
+
)
|
|
175
|
+
] })
|
|
176
|
+
}
|
|
177
|
+
)
|
|
178
|
+
] });
|
|
179
|
+
};
|
|
180
|
+
export {
|
|
181
|
+
q as I
|
|
182
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { I as p } from "./IconDialogInput-C-81_L2n.js";
|
|
3
|
+
import { w as r } from "./index-C66dAl3Q.js";
|
|
4
|
+
import { U as l } from "./index-B-GJd039.js";
|
|
5
|
+
import { r as a } from "./helpers-Cll72tMn.js";
|
|
6
|
+
const c = () => a({
|
|
7
|
+
Content: /* @__PURE__ */ e(r, { collapsible: !1, children: [
|
|
8
|
+
/* @__PURE__ */ o(p, { propKey: "value", propType: "component", label: "Icon" }),
|
|
9
|
+
/* @__PURE__ */ o(
|
|
10
|
+
l,
|
|
11
|
+
{
|
|
12
|
+
propKey: "size",
|
|
13
|
+
propType: "class",
|
|
14
|
+
propTag: "size",
|
|
15
|
+
label: "Size",
|
|
16
|
+
tailwindKey: "size",
|
|
17
|
+
showVarSelector: !0,
|
|
18
|
+
allowedTypes: ["tailwind", "calc", "px", "%", "em", "rem", "vw", "vh"],
|
|
19
|
+
inputWidth: "flex-1"
|
|
20
|
+
}
|
|
21
|
+
)
|
|
22
|
+
] })
|
|
23
|
+
});
|
|
24
|
+
export {
|
|
25
|
+
c as IconMainTab
|
|
26
|
+
};
|