@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,296 @@
|
|
|
1
|
+
import { jsxs as L, Fragment as O, jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { ROOT_NODE as H } from "@craftjs/utils";
|
|
3
|
+
import { useEditor as _, useNode as j } from "@craftjs/core";
|
|
4
|
+
import { useState as A, useRef as B, Suspense as F, lazy as R, useMemo as W } from "react";
|
|
5
|
+
import { u as M, aK as K, C as G, r as I, dQ as Q, dY as E } from "./index-C66dAl3Q.js";
|
|
6
|
+
const V = R(() => import("./TextStylePickerPanel-l108SmGQ.js")), q = R(() => import("./TextStyleEditorPanel-GRNPGzUL.js")), v = 300, U = 360, z = 340, Y = 540;
|
|
7
|
+
function J(l) {
|
|
8
|
+
const c = /^\s*h(?:eading)?\s*([1-6])/i.exec(l);
|
|
9
|
+
return c ? `H${c[1]}` : "P";
|
|
10
|
+
}
|
|
11
|
+
const X = ({ tag: l }) => /* @__PURE__ */ f("span", { className: "border-base-300 bg-base-100 text-base-content flex h-5 min-w-[1.5rem] shrink-0 items-center justify-center rounded border px-1.5 text-[10px] font-bold", children: l });
|
|
12
|
+
function Z({
|
|
13
|
+
presets: l,
|
|
14
|
+
selectedName: c,
|
|
15
|
+
onSelect: i,
|
|
16
|
+
buildNewDraft: D,
|
|
17
|
+
buildEditDraft: y,
|
|
18
|
+
onCreate: S,
|
|
19
|
+
onUpdate: b,
|
|
20
|
+
onDelete: d
|
|
21
|
+
}) {
|
|
22
|
+
const [T, h] = A(!1), [m, u] = A(null), N = B(null), w = M(K), g = c != null ? l.find((t) => t.name === c) ?? null : null, P = (g == null ? void 0 : g.name) ?? "Default", k = g ? J(g.name) : "—", C = () => {
|
|
23
|
+
var r;
|
|
24
|
+
const t = (r = N.current) == null ? void 0 : r.getBoundingClientRect();
|
|
25
|
+
if (!t) return;
|
|
26
|
+
const a = w ? t.right + 8 : t.left - v - 8;
|
|
27
|
+
return { x: Math.max(8, a), y: Math.max(8, t.top) };
|
|
28
|
+
}, n = () => {
|
|
29
|
+
var p;
|
|
30
|
+
const t = (p = N.current) == null ? void 0 : p.getBoundingClientRect();
|
|
31
|
+
if (!t) return;
|
|
32
|
+
const a = T ? v + 16 : 8, r = w ? t.right + a : t.left - z - a;
|
|
33
|
+
return { x: Math.max(8, r), y: Math.max(8, t.top) };
|
|
34
|
+
}, e = () => {
|
|
35
|
+
if (m) {
|
|
36
|
+
u(null), h(!1);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
h((t) => !t);
|
|
40
|
+
}, o = () => {
|
|
41
|
+
i(null);
|
|
42
|
+
}, s = l.map((t) => t.name);
|
|
43
|
+
return /* @__PURE__ */ L(O, { children: [
|
|
44
|
+
/* @__PURE__ */ f(
|
|
45
|
+
G,
|
|
46
|
+
{
|
|
47
|
+
mode: "popover",
|
|
48
|
+
ref: N,
|
|
49
|
+
open: T || m != null,
|
|
50
|
+
onTriggerClick: e,
|
|
51
|
+
onClear: o,
|
|
52
|
+
triggerAriaLabel: g ? `Style: ${g.name}` : "Pick style",
|
|
53
|
+
clearAriaLabel: "Clear style",
|
|
54
|
+
leading: /* @__PURE__ */ f(X, { tag: k }),
|
|
55
|
+
summary: P
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
T && /* @__PURE__ */ f(F, { fallback: null, children: /* @__PURE__ */ f(
|
|
59
|
+
V,
|
|
60
|
+
{
|
|
61
|
+
presets: l,
|
|
62
|
+
selectedName: c,
|
|
63
|
+
initialPosition: C(),
|
|
64
|
+
defaultWidth: v,
|
|
65
|
+
defaultHeight: U,
|
|
66
|
+
onClose: () => {
|
|
67
|
+
h(!1), u(null);
|
|
68
|
+
},
|
|
69
|
+
onApply: (t) => {
|
|
70
|
+
i(t), h(!1), u(null);
|
|
71
|
+
},
|
|
72
|
+
onEditPreset: (t) => u({
|
|
73
|
+
mode: "edit",
|
|
74
|
+
originalName: t.name,
|
|
75
|
+
draft: y(t)
|
|
76
|
+
}),
|
|
77
|
+
onCreateNew: () => u({ mode: "new", draft: D() }),
|
|
78
|
+
overlay: m ? /* @__PURE__ */ f(F, { fallback: null, children: /* @__PURE__ */ f(
|
|
79
|
+
q,
|
|
80
|
+
{
|
|
81
|
+
mode: m.mode,
|
|
82
|
+
initialDraft: m.draft,
|
|
83
|
+
originalName: m.mode === "edit" ? m.originalName : null,
|
|
84
|
+
existingNames: s,
|
|
85
|
+
initialPosition: n(),
|
|
86
|
+
defaultWidth: z,
|
|
87
|
+
defaultHeight: Y,
|
|
88
|
+
onClose: () => u(null),
|
|
89
|
+
onSave: (t) => {
|
|
90
|
+
m.mode === "edit" ? b(m.originalName, t) : S(t), u(null), h(!1);
|
|
91
|
+
},
|
|
92
|
+
onDelete: m.mode === "edit" ? () => {
|
|
93
|
+
d(m.originalName), u(null), h(!1);
|
|
94
|
+
} : void 0
|
|
95
|
+
}
|
|
96
|
+
) }) : null
|
|
97
|
+
}
|
|
98
|
+
) })
|
|
99
|
+
] });
|
|
100
|
+
}
|
|
101
|
+
function ee() {
|
|
102
|
+
return {
|
|
103
|
+
name: "",
|
|
104
|
+
fontFamily: "Inter",
|
|
105
|
+
fontSize: "1rem",
|
|
106
|
+
fontWeight: "400",
|
|
107
|
+
lineHeight: "1.5",
|
|
108
|
+
letterSpacing: "normal",
|
|
109
|
+
textTransform: "none",
|
|
110
|
+
color: "",
|
|
111
|
+
textDecoration: "none",
|
|
112
|
+
textAlign: "left"
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function te(l) {
|
|
116
|
+
return {
|
|
117
|
+
name: l.name,
|
|
118
|
+
fontFamily: l.fontFamily || "Inter",
|
|
119
|
+
fontSize: l.fontSize || "1rem",
|
|
120
|
+
fontWeight: l.fontWeight || "400",
|
|
121
|
+
lineHeight: l.lineHeight || "1.5",
|
|
122
|
+
letterSpacing: l.letterSpacing || "normal",
|
|
123
|
+
textTransform: l.textTransform || "none",
|
|
124
|
+
color: l.color || "",
|
|
125
|
+
textDecoration: l.textDecoration || "none",
|
|
126
|
+
textAlign: l.textAlign || "left"
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function x(l) {
|
|
130
|
+
const c = Q(l);
|
|
131
|
+
return c ? `ph-${c}` : "";
|
|
132
|
+
}
|
|
133
|
+
function ne(l) {
|
|
134
|
+
return l.split(",")[0].trim().replace(/^['"]|['"]$/g, "");
|
|
135
|
+
}
|
|
136
|
+
function oe(l) {
|
|
137
|
+
const c = document.querySelector(`[node-id="${l}"]`);
|
|
138
|
+
if (!c) return null;
|
|
139
|
+
const i = window.getComputedStyle(c);
|
|
140
|
+
return {
|
|
141
|
+
fontFamily: ne(i.fontFamily || "Inter"),
|
|
142
|
+
fontSize: i.fontSize || "1rem",
|
|
143
|
+
fontWeight: i.fontWeight || "400",
|
|
144
|
+
lineHeight: i.lineHeight === "normal" ? "1.5" : i.lineHeight || "1.5",
|
|
145
|
+
letterSpacing: i.letterSpacing === "normal" ? "normal" : i.letterSpacing,
|
|
146
|
+
textTransform: i.textTransform === "none" ? "none" : i.textTransform,
|
|
147
|
+
color: i.color || "",
|
|
148
|
+
textDecoration: i.textDecorationLine && i.textDecorationLine !== "none" ? i.textDecorationLine : "none",
|
|
149
|
+
textAlign: i.textAlign || "left"
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function $(l, c) {
|
|
153
|
+
return l.split(/\s+/).filter(Boolean).filter((i) => !c.has(i)).join(" ");
|
|
154
|
+
}
|
|
155
|
+
function le({ def: l } = {}) {
|
|
156
|
+
const {
|
|
157
|
+
actions: c,
|
|
158
|
+
presets: i,
|
|
159
|
+
presetsRaw: D
|
|
160
|
+
} = _((n) => {
|
|
161
|
+
var a;
|
|
162
|
+
const e = n.nodes[H], s = I(((a = e == null ? void 0 : e.data) == null ? void 0 : a.props) || {}).typography || [];
|
|
163
|
+
return { presets: s.filter((r) => r && typeof r.name == "string" && r.name.length > 0).map((r) => ({
|
|
164
|
+
name: r.name,
|
|
165
|
+
fontFamily: r.fontFamily || "inherit",
|
|
166
|
+
fontSize: r.fontSize || "1rem",
|
|
167
|
+
fontWeight: r.fontWeight || "400",
|
|
168
|
+
lineHeight: r.lineHeight || "1.5",
|
|
169
|
+
letterSpacing: r.letterSpacing,
|
|
170
|
+
textTransform: r.textTransform
|
|
171
|
+
})), presetsRaw: s };
|
|
172
|
+
}), {
|
|
173
|
+
actions: { setProp: y },
|
|
174
|
+
classNameStr: S,
|
|
175
|
+
nodeId: b
|
|
176
|
+
} = j((n) => {
|
|
177
|
+
var e, o;
|
|
178
|
+
return {
|
|
179
|
+
classNameStr: typeof ((o = (e = n.data) == null ? void 0 : e.props) == null ? void 0 : o.className) == "string" ? n.data.props.className : "",
|
|
180
|
+
nodeId: n.id
|
|
181
|
+
};
|
|
182
|
+
}), d = W(
|
|
183
|
+
() => new Set(i.map((n) => x(n.name)).filter(Boolean)),
|
|
184
|
+
[i]
|
|
185
|
+
), T = W(() => {
|
|
186
|
+
if (!S || d.size === 0) return null;
|
|
187
|
+
const e = S.split(/\s+/).filter(Boolean).find((s) => d.has(s));
|
|
188
|
+
if (!e) return null;
|
|
189
|
+
const o = i.find((s) => x(s.name) === e);
|
|
190
|
+
return (o == null ? void 0 : o.name) ?? null;
|
|
191
|
+
}, [S, i, d]), h = (n, e) => {
|
|
192
|
+
const o = d;
|
|
193
|
+
y((s) => {
|
|
194
|
+
const t = $(typeof s.className == "string" ? s.className : "", o), a = n ? x(n) : "";
|
|
195
|
+
s.className = a ? t ? `${t} ${a}` : a : t;
|
|
196
|
+
});
|
|
197
|
+
}, m = (n) => {
|
|
198
|
+
h((n == null ? void 0 : n.name) ?? null), n != null && n.fontFamily && import("./googleFonts-Dj4AntNi.js").then(({ loadGoogleFont: e }) => {
|
|
199
|
+
e(n.fontFamily, [n.fontWeight || "400"]);
|
|
200
|
+
});
|
|
201
|
+
}, u = () => {
|
|
202
|
+
const n = oe(b), e = { ...ee(), ...n || {} };
|
|
203
|
+
let o = `Style ${i.length + 1}`;
|
|
204
|
+
const s = new Set(i.map((a) => a.name.toLowerCase()));
|
|
205
|
+
let t = i.length + 1;
|
|
206
|
+
for (; s.has(o.toLowerCase()); )
|
|
207
|
+
t += 1, o = `Style ${t}`;
|
|
208
|
+
return e.name = o, e;
|
|
209
|
+
}, N = (n) => {
|
|
210
|
+
const e = D.find((o) => o && typeof o.name == "string" && o.name === n.name) ?? n;
|
|
211
|
+
return te({ ...n, ...e });
|
|
212
|
+
}, w = (n, e) => {
|
|
213
|
+
const o = {
|
|
214
|
+
name: e.name,
|
|
215
|
+
fontFamily: e.fontFamily || "Inter",
|
|
216
|
+
fontSize: e.fontSize || "1rem",
|
|
217
|
+
fontWeight: e.fontWeight || "400",
|
|
218
|
+
lineHeight: e.lineHeight || "1.5",
|
|
219
|
+
letterSpacing: e.letterSpacing || "normal",
|
|
220
|
+
textTransform: e.textTransform || "none"
|
|
221
|
+
};
|
|
222
|
+
e.color && (o.color = e.color), e.textDecoration && e.textDecoration !== "none" && (o.textDecoration = e.textDecoration), e.textAlign && e.textAlign !== "left" && (o.textAlign = e.textAlign), c.setProp(H, (s) => {
|
|
223
|
+
const t = I(s), a = [...t.typography || []].filter(
|
|
224
|
+
(r) => r && typeof r.name == "string" && r.name.length > 0
|
|
225
|
+
);
|
|
226
|
+
if (n == null)
|
|
227
|
+
a.push(o);
|
|
228
|
+
else {
|
|
229
|
+
const r = a.findIndex((p) => p.name === n);
|
|
230
|
+
r === -1 ? a.push(o) : a[r] = { ...a[r], ...o };
|
|
231
|
+
}
|
|
232
|
+
E(s, { ...t, typography: a });
|
|
233
|
+
});
|
|
234
|
+
}, g = (n) => {
|
|
235
|
+
w(null, n);
|
|
236
|
+
const e = x(n.name);
|
|
237
|
+
e && y((o) => {
|
|
238
|
+
const s = $(
|
|
239
|
+
typeof o.className == "string" ? o.className : "",
|
|
240
|
+
d
|
|
241
|
+
), t = s ? `${s} ${e}` : e;
|
|
242
|
+
o.className = t;
|
|
243
|
+
});
|
|
244
|
+
}, P = (n, e) => {
|
|
245
|
+
if (w(n, e), n === e.name) return;
|
|
246
|
+
const o = x(n), s = x(e.name);
|
|
247
|
+
y((t) => {
|
|
248
|
+
const r = (typeof t.className == "string" ? t.className : "").split(/\s+/).filter(Boolean).map((p) => p === o ? s : p);
|
|
249
|
+
t.className = r.join(" ");
|
|
250
|
+
});
|
|
251
|
+
}, k = (n) => {
|
|
252
|
+
c.setProp(H, (o) => {
|
|
253
|
+
const s = I(o), t = [...s.typography || []].filter(
|
|
254
|
+
(a) => a && typeof a.name == "string" && a.name !== n
|
|
255
|
+
);
|
|
256
|
+
E(o, { ...s, typography: t });
|
|
257
|
+
});
|
|
258
|
+
const e = x(n);
|
|
259
|
+
e && y((o) => {
|
|
260
|
+
const s = (typeof o.className == "string" ? o.className : "").split(/\s+/).filter(Boolean).filter((t) => t !== e);
|
|
261
|
+
o.className = s.join(" ");
|
|
262
|
+
});
|
|
263
|
+
}, C = l == null ? void 0 : l.label;
|
|
264
|
+
return /* @__PURE__ */ f("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ L("div", { className: "relative flex w-full items-center gap-0.5", children: [
|
|
265
|
+
C ? /* @__PURE__ */ f("div", { className: "flex w-20 shrink-0 flex-col items-start gap-0.5", children: /* @__PURE__ */ f(
|
|
266
|
+
"label",
|
|
267
|
+
{
|
|
268
|
+
htmlFor: "typography-preset",
|
|
269
|
+
className: "w-full cursor-pointer truncate text-xs whitespace-nowrap",
|
|
270
|
+
children: C
|
|
271
|
+
}
|
|
272
|
+
) }) : null,
|
|
273
|
+
/* @__PURE__ */ f("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ f(
|
|
274
|
+
Z,
|
|
275
|
+
{
|
|
276
|
+
presets: i,
|
|
277
|
+
selectedName: T,
|
|
278
|
+
onSelect: m,
|
|
279
|
+
buildNewDraft: u,
|
|
280
|
+
buildEditDraft: N,
|
|
281
|
+
onCreate: g,
|
|
282
|
+
onUpdate: P,
|
|
283
|
+
onDelete: k
|
|
284
|
+
}
|
|
285
|
+
) })
|
|
286
|
+
] }) });
|
|
287
|
+
}
|
|
288
|
+
const me = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
289
|
+
__proto__: null,
|
|
290
|
+
TypographyPresetInput: le
|
|
291
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
292
|
+
export {
|
|
293
|
+
me as T,
|
|
294
|
+
ee as e,
|
|
295
|
+
te as p
|
|
296
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { W as r, n as l, aH as p } from "./index-C66dAl3Q.js";
|
|
3
|
+
import { F as n } from "./FloatingPanel-DJP5Vhua.js";
|
|
4
|
+
function c({ initialPosition: a, onClose: t }) {
|
|
5
|
+
return /* @__PURE__ */ e(
|
|
6
|
+
n,
|
|
7
|
+
{
|
|
8
|
+
isOpen: !0,
|
|
9
|
+
onClose: t,
|
|
10
|
+
title: "Validation",
|
|
11
|
+
icon: /* @__PURE__ */ e(p, {}),
|
|
12
|
+
storageKey: "ph-form-element-validation",
|
|
13
|
+
autoSize: !0,
|
|
14
|
+
defaultWidth: 320,
|
|
15
|
+
minWidth: 280,
|
|
16
|
+
initialPosition: a,
|
|
17
|
+
zIndex: r,
|
|
18
|
+
scrollable: !0,
|
|
19
|
+
children: /* @__PURE__ */ o("div", { className: "flex flex-col gap-1.5", children: [
|
|
20
|
+
/* @__PURE__ */ e(
|
|
21
|
+
l,
|
|
22
|
+
{
|
|
23
|
+
propKey: "pattern",
|
|
24
|
+
propType: "component",
|
|
25
|
+
type: "text",
|
|
26
|
+
label: "Pattern",
|
|
27
|
+
placeholder: "Regex (e.g. [A-Za-z]+)"
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
/* @__PURE__ */ e(
|
|
31
|
+
l,
|
|
32
|
+
{
|
|
33
|
+
propKey: "errorMessage",
|
|
34
|
+
propType: "component",
|
|
35
|
+
type: "text",
|
|
36
|
+
label: "Error",
|
|
37
|
+
placeholder: "Please enter a valid value"
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
/* @__PURE__ */ e(
|
|
41
|
+
l,
|
|
42
|
+
{
|
|
43
|
+
propKey: "label",
|
|
44
|
+
propType: "component",
|
|
45
|
+
type: "text",
|
|
46
|
+
label: "A11y label",
|
|
47
|
+
placeholder: "Field label"
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
] })
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
c as default
|
|
56
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { cY as n, cZ as i, c_ as p, dT as r } from "./index-C66dAl3Q.js";
|
|
2
|
+
const c = (e) => {
|
|
3
|
+
const a = {
|
|
4
|
+
provider: "youtube",
|
|
5
|
+
controls: !0,
|
|
6
|
+
playsInline: !0,
|
|
7
|
+
...e
|
|
8
|
+
}, o = n(), s = i(), d = p({
|
|
9
|
+
id: (s == null ? void 0 : s.id) ?? "",
|
|
10
|
+
isCanvas: !1,
|
|
11
|
+
hasChildNodes: !1,
|
|
12
|
+
displayName: (s == null ? void 0 : s.displayName) ?? "Video",
|
|
13
|
+
rootProps: (o == null ? void 0 : o.rootProps) ?? {},
|
|
14
|
+
pageMedia: (o == null ? void 0 : o.pageMedia) ?? null,
|
|
15
|
+
pageIndex: (o == null ? void 0 : o.pageIndex) ?? {}
|
|
16
|
+
});
|
|
17
|
+
return r(a, d);
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
c as VideoRender
|
|
21
|
+
};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { jsxs as d, Fragment as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useNode as u } from "@craftjs/core";
|
|
3
|
+
import { useRef as m, useEffect as h } from "react";
|
|
4
|
+
import { M as y } from "./MediaInput-DHs3D8TJ.js";
|
|
5
|
+
import { w as r, n as t, aJ as b } from "./index-C66dAl3Q.js";
|
|
6
|
+
import { r as f, S as v } from "./helpers-Cll72tMn.js";
|
|
7
|
+
import { S as w } from "./SlotRenderer-CaLf_2_C.js";
|
|
8
|
+
const U = () => {
|
|
9
|
+
const {
|
|
10
|
+
provider: o,
|
|
11
|
+
videoId: p,
|
|
12
|
+
actions: { setProp: a }
|
|
13
|
+
} = u((i) => {
|
|
14
|
+
var n, l;
|
|
15
|
+
return {
|
|
16
|
+
provider: (n = i.data) == null ? void 0 : n.props.provider,
|
|
17
|
+
videoId: (l = i.data) == null ? void 0 : l.props.videoId
|
|
18
|
+
};
|
|
19
|
+
}), c = m(o);
|
|
20
|
+
return h(() => {
|
|
21
|
+
const i = c.current;
|
|
22
|
+
if (c.current = o, i === o) return;
|
|
23
|
+
i === "r2" != (o === "r2") && p && a((l) => {
|
|
24
|
+
l.videoId = "";
|
|
25
|
+
});
|
|
26
|
+
}, [o, p, a]), f({
|
|
27
|
+
Content: /* @__PURE__ */ d(s, { children: [
|
|
28
|
+
/* @__PURE__ */ e(r, { collapsible: !1, children: /* @__PURE__ */ d(
|
|
29
|
+
t,
|
|
30
|
+
{
|
|
31
|
+
propKey: "provider",
|
|
32
|
+
propType: "component",
|
|
33
|
+
type: "select",
|
|
34
|
+
label: "Video Provider",
|
|
35
|
+
labelHide: !1,
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ e("option", { value: "r2", children: "Uploaded" }),
|
|
38
|
+
/* @__PURE__ */ e("option", { value: "youtube", children: "YouTube" }),
|
|
39
|
+
/* @__PURE__ */ e("option", { value: "vimeo", children: "Vimeo" }),
|
|
40
|
+
/* @__PURE__ */ e("option", { value: "dailymotion", children: "Dailymotion" }),
|
|
41
|
+
/* @__PURE__ */ e("option", { value: "wistia", children: "Wistia" }),
|
|
42
|
+
/* @__PURE__ */ e("option", { value: "facebook", children: "Facebook" }),
|
|
43
|
+
/* @__PURE__ */ e("option", { value: "twitch", children: "Twitch" }),
|
|
44
|
+
/* @__PURE__ */ e("option", { value: "url", children: "Direct URL" })
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
) }),
|
|
48
|
+
/* @__PURE__ */ e("p", { className: "text-md text-neutral-content px-3 pt-2 pb-3 text-sm", children: (() => {
|
|
49
|
+
switch (o) {
|
|
50
|
+
case "youtube":
|
|
51
|
+
return "Copy the Video ID from the YouTube video URL (e.g., 'dQw4w9WgXcQ' from youtube.com/watch?v=dQw4w9WgXcQ)";
|
|
52
|
+
case "vimeo":
|
|
53
|
+
return "Copy the Video ID from the Vimeo video URL (e.g., '123456789' from vimeo.com/123456789)";
|
|
54
|
+
case "dailymotion":
|
|
55
|
+
return "Copy the Video ID from the Dailymotion video URL (e.g., 'x8abcde' from dailymotion.com/video/x8abcde)";
|
|
56
|
+
case "wistia":
|
|
57
|
+
return "Copy the Video ID from your Wistia embed code or video URL";
|
|
58
|
+
case "facebook":
|
|
59
|
+
return "Paste the full Facebook video URL (e.g., https://www.facebook.com/...)";
|
|
60
|
+
case "twitch":
|
|
61
|
+
return "Copy the Video ID from the Twitch video URL (e.g., '1234567890' from twitch.tv/videos/1234567890)";
|
|
62
|
+
case "url":
|
|
63
|
+
return "Paste a direct file URL ending in .mp4, .webm, .mov, etc. Uses native HTML5 video (not an iframe). For fullscreen backgrounds, enable Playback: Autoplay, Loop, Muted, turn off Controls.";
|
|
64
|
+
case "r2":
|
|
65
|
+
return "Pick a video file from your media library.";
|
|
66
|
+
default:
|
|
67
|
+
return "Enter the video ID or URL";
|
|
68
|
+
}
|
|
69
|
+
})() }),
|
|
70
|
+
o === "r2" ? /* @__PURE__ */ e(r, { title: "", children: /* @__PURE__ */ e(
|
|
71
|
+
y,
|
|
72
|
+
{
|
|
73
|
+
propKey: "videoId",
|
|
74
|
+
typeKey: "provider",
|
|
75
|
+
contentKey: "videoId",
|
|
76
|
+
kindFilter: "video",
|
|
77
|
+
defaultTypeValue: "r2",
|
|
78
|
+
variant: "chip",
|
|
79
|
+
label: "Video"
|
|
80
|
+
}
|
|
81
|
+
) }) : /* @__PURE__ */ e(r, { title: "", children: /* @__PURE__ */ e(
|
|
82
|
+
t,
|
|
83
|
+
{
|
|
84
|
+
propKey: "videoId",
|
|
85
|
+
propType: "component",
|
|
86
|
+
type: "text",
|
|
87
|
+
label: o === "url" || o === "facebook" ? "Video URL" : "Video ID",
|
|
88
|
+
labelHide: !0,
|
|
89
|
+
placeholder: o === "url" || o === "facebook" ? "https://..." : "Enter video ID"
|
|
90
|
+
}
|
|
91
|
+
) }),
|
|
92
|
+
(o === "r2" || o === "url") && (o === "r2" || b(p)) ? /* @__PURE__ */ d(
|
|
93
|
+
r,
|
|
94
|
+
{
|
|
95
|
+
title: "Playback",
|
|
96
|
+
icon: v.Type,
|
|
97
|
+
help: "HTML5 video only (uploaded files, or direct .mp4/.webm URLs). Ignored for YouTube/Vimeo iframe embeds.",
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ e(
|
|
100
|
+
t,
|
|
101
|
+
{
|
|
102
|
+
propKey: "controls",
|
|
103
|
+
propType: "component",
|
|
104
|
+
type: "checkbox",
|
|
105
|
+
label: "Show controls",
|
|
106
|
+
labelWidth: "w-full",
|
|
107
|
+
inputWidth: "w-fit"
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
/* @__PURE__ */ e(
|
|
111
|
+
t,
|
|
112
|
+
{
|
|
113
|
+
propKey: "autoPlay",
|
|
114
|
+
propType: "component",
|
|
115
|
+
type: "checkbox",
|
|
116
|
+
label: "Autoplay",
|
|
117
|
+
labelWidth: "w-full",
|
|
118
|
+
inputWidth: "w-fit"
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
/* @__PURE__ */ e(
|
|
122
|
+
t,
|
|
123
|
+
{
|
|
124
|
+
propKey: "loop",
|
|
125
|
+
propType: "component",
|
|
126
|
+
type: "checkbox",
|
|
127
|
+
label: "Loop",
|
|
128
|
+
labelWidth: "w-full",
|
|
129
|
+
inputWidth: "w-fit"
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
/* @__PURE__ */ e(
|
|
133
|
+
t,
|
|
134
|
+
{
|
|
135
|
+
propKey: "muted",
|
|
136
|
+
propType: "component",
|
|
137
|
+
type: "checkbox",
|
|
138
|
+
label: "Muted",
|
|
139
|
+
labelWidth: "w-full",
|
|
140
|
+
inputWidth: "w-fit"
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
/* @__PURE__ */ e(
|
|
144
|
+
t,
|
|
145
|
+
{
|
|
146
|
+
propKey: "playsInline",
|
|
147
|
+
propType: "component",
|
|
148
|
+
type: "checkbox",
|
|
149
|
+
label: "Plays inline (iOS)",
|
|
150
|
+
labelWidth: "w-full",
|
|
151
|
+
inputWidth: "w-fit"
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
) : null,
|
|
157
|
+
/* @__PURE__ */ e(r, { title: "Accessibility", help: "Accessibility title for the video.", children: /* @__PURE__ */ e(
|
|
158
|
+
t,
|
|
159
|
+
{
|
|
160
|
+
propKey: "title",
|
|
161
|
+
propType: "component",
|
|
162
|
+
type: "text",
|
|
163
|
+
label: "Video Title",
|
|
164
|
+
labelHide: !1,
|
|
165
|
+
placeholder: "Describe the video content"
|
|
166
|
+
}
|
|
167
|
+
) }),
|
|
168
|
+
/* @__PURE__ */ e(w, { id: "settings/ai-button" })
|
|
169
|
+
] })
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
export {
|
|
173
|
+
U as VideoMainTab
|
|
174
|
+
};
|