@pagehub/sdk 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,140 @@
|
|
|
1
|
+
import { jsxs as r, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as v, useRef as S, useMemo as T } from "react";
|
|
3
|
+
import { W as w, dp as k, P as z, a5 as P, G as $ } from "./index-C66dAl3Q.js";
|
|
4
|
+
import { F as C } from "./FloatingPanel-DJP5Vhua.js";
|
|
5
|
+
function L(n) {
|
|
6
|
+
const a = /^\s*h(?:eading)?\s*([1-6])/i.exec(n);
|
|
7
|
+
return a ? `H${a[1]}` : "P";
|
|
8
|
+
}
|
|
9
|
+
function A(n) {
|
|
10
|
+
const a = (n.fontSize || "").trim(), l = (n.lineHeight || "").trim();
|
|
11
|
+
return !a && !l ? "" : l ? `${a} / ${l}` : a;
|
|
12
|
+
}
|
|
13
|
+
const F = ({ tag: n, active: a = !1 }) => /* @__PURE__ */ t(
|
|
14
|
+
"span",
|
|
15
|
+
{
|
|
16
|
+
className: `border-base-300 flex h-5 min-w-[1.5rem] shrink-0 items-center justify-center rounded border px-1.5 text-[10px] font-bold ${a ? "bg-base-content text-base-100" : "bg-base-100 text-base-content"}`,
|
|
17
|
+
children: n
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
function G({
|
|
21
|
+
presets: n,
|
|
22
|
+
selectedName: a,
|
|
23
|
+
initialPosition: l,
|
|
24
|
+
onClose: m,
|
|
25
|
+
onApply: u,
|
|
26
|
+
onEditPreset: d,
|
|
27
|
+
onCreateNew: x,
|
|
28
|
+
defaultWidth: f,
|
|
29
|
+
defaultHeight: b,
|
|
30
|
+
overlay: h
|
|
31
|
+
}) {
|
|
32
|
+
const [i, p] = v(""), y = S(null), o = T(() => {
|
|
33
|
+
const e = i.trim().toLowerCase();
|
|
34
|
+
return e ? n.filter((s) => s.name.toLowerCase().includes(e)) : n;
|
|
35
|
+
}, [n, i]);
|
|
36
|
+
return /* @__PURE__ */ r(
|
|
37
|
+
C,
|
|
38
|
+
{
|
|
39
|
+
isOpen: !0,
|
|
40
|
+
onClose: m,
|
|
41
|
+
title: "Text Styles",
|
|
42
|
+
storageKey: "text-style-picker",
|
|
43
|
+
autoSize: !1,
|
|
44
|
+
defaultWidth: f,
|
|
45
|
+
defaultHeight: b,
|
|
46
|
+
minWidth: 260,
|
|
47
|
+
maxWidth: 420,
|
|
48
|
+
minHeight: 260,
|
|
49
|
+
initialPosition: l,
|
|
50
|
+
persistSize: !1,
|
|
51
|
+
zIndex: w,
|
|
52
|
+
scrollable: !1,
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ r("div", { className: "flex min-h-0 flex-1 flex-col", children: [
|
|
55
|
+
/* @__PURE__ */ r("div", { className: "border-base-300/60 flex items-center gap-1.5 border-b px-3 py-2", children: [
|
|
56
|
+
/* @__PURE__ */ t(k, { className: "text-neutral-content size-3.5 shrink-0", "aria-hidden": !0 }),
|
|
57
|
+
/* @__PURE__ */ t(
|
|
58
|
+
"input",
|
|
59
|
+
{
|
|
60
|
+
ref: y,
|
|
61
|
+
type: "text",
|
|
62
|
+
value: i,
|
|
63
|
+
onChange: (e) => p(e.target.value),
|
|
64
|
+
placeholder: "Search styles...",
|
|
65
|
+
autoFocus: !0,
|
|
66
|
+
className: "text-base-content placeholder:text-neutral-content min-w-0 flex-1 bg-transparent text-xs outline-none"
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
] }),
|
|
70
|
+
/* @__PURE__ */ t("div", { className: "scrollbar min-h-0 flex-1 overflow-y-auto py-1", children: o.length === 0 ? /* @__PURE__ */ t("div", { className: "text-neutral-content px-3 py-6 text-center text-xs italic", children: n.length === 0 ? "No styles yet" : `No matches for "${i}"` }) : o.map((e) => {
|
|
71
|
+
const s = e.name === a, g = L(e.name), c = A(e), N = {
|
|
72
|
+
fontFamily: e.fontFamily,
|
|
73
|
+
fontWeight: e.fontWeight,
|
|
74
|
+
letterSpacing: e.letterSpacing || "normal",
|
|
75
|
+
textTransform: e.textTransform || "none"
|
|
76
|
+
};
|
|
77
|
+
return /* @__PURE__ */ r(
|
|
78
|
+
"div",
|
|
79
|
+
{
|
|
80
|
+
className: `group flex w-full items-center gap-2 px-2 py-1 text-xs transition-colors ${s ? "bg-base-200" : "hover:bg-base-200/60"}`,
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ r(
|
|
83
|
+
"button",
|
|
84
|
+
{
|
|
85
|
+
type: "button",
|
|
86
|
+
onClick: () => u(e),
|
|
87
|
+
className: "flex min-w-0 flex-1 items-center gap-2 text-left",
|
|
88
|
+
"aria-label": `Apply style ${e.name}`,
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ t(F, { tag: g, active: s }),
|
|
91
|
+
/* @__PURE__ */ t(
|
|
92
|
+
"span",
|
|
93
|
+
{
|
|
94
|
+
className: "text-base-content min-w-0 flex-1 truncate font-medium",
|
|
95
|
+
style: N,
|
|
96
|
+
children: e.name
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
c && /* @__PURE__ */ t("span", { className: "text-neutral-content shrink-0 text-[10px] tabular-nums", children: c })
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
/* @__PURE__ */ t(
|
|
104
|
+
"button",
|
|
105
|
+
{
|
|
106
|
+
type: "button",
|
|
107
|
+
onClick: () => d(e),
|
|
108
|
+
"aria-label": `Edit style ${e.name}`,
|
|
109
|
+
"data-tooltip-id": z,
|
|
110
|
+
"data-tooltip-content": "Edit style",
|
|
111
|
+
className: "text-neutral-content hover:text-base-content hover:bg-base-300/60 flex size-6 shrink-0 items-center justify-center rounded opacity-0 transition-[color,background-color,opacity] group-hover:opacity-100",
|
|
112
|
+
children: /* @__PURE__ */ t(P, { className: "size-3.5", "aria-hidden": !0 })
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
e.name
|
|
118
|
+
);
|
|
119
|
+
}) }),
|
|
120
|
+
/* @__PURE__ */ t("div", { className: "border-base-300/60 border-t p-2", children: /* @__PURE__ */ r(
|
|
121
|
+
"button",
|
|
122
|
+
{
|
|
123
|
+
type: "button",
|
|
124
|
+
onClick: x,
|
|
125
|
+
className: "bg-base-200 text-base-content hover:bg-base-300 flex w-full items-center justify-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ t($, { className: "size-3.5", "aria-hidden": !0 }),
|
|
128
|
+
"New Style"
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
) })
|
|
132
|
+
] }),
|
|
133
|
+
h
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
export {
|
|
139
|
+
G as default
|
|
140
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { W as l, n as o, aG as n } from "./index-C66dAl3Q.js";
|
|
3
|
+
import { F as p } from "./FloatingPanel-DJP5Vhua.js";
|
|
4
|
+
function c({ initialPosition: t, onClose: a }) {
|
|
5
|
+
return /* @__PURE__ */ e(
|
|
6
|
+
p,
|
|
7
|
+
{
|
|
8
|
+
isOpen: !0,
|
|
9
|
+
onClose: a,
|
|
10
|
+
title: "Textarea",
|
|
11
|
+
icon: /* @__PURE__ */ e(n, {}),
|
|
12
|
+
storageKey: "ph-form-element-textarea",
|
|
13
|
+
autoSize: !0,
|
|
14
|
+
defaultWidth: 260,
|
|
15
|
+
minWidth: 240,
|
|
16
|
+
initialPosition: t,
|
|
17
|
+
zIndex: l,
|
|
18
|
+
scrollable: !0,
|
|
19
|
+
children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-1.5", children: [
|
|
20
|
+
/* @__PURE__ */ e(
|
|
21
|
+
o,
|
|
22
|
+
{
|
|
23
|
+
propKey: "rows",
|
|
24
|
+
propType: "component",
|
|
25
|
+
type: "number",
|
|
26
|
+
label: "Rows",
|
|
27
|
+
placeholder: "4",
|
|
28
|
+
min: 1,
|
|
29
|
+
max: 20
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
/* @__PURE__ */ e(
|
|
33
|
+
o,
|
|
34
|
+
{
|
|
35
|
+
propKey: "cols",
|
|
36
|
+
propType: "component",
|
|
37
|
+
type: "number",
|
|
38
|
+
label: "Columns",
|
|
39
|
+
placeholder: "50",
|
|
40
|
+
min: 1,
|
|
41
|
+
max: 200
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
] })
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
c as default
|
|
50
|
+
};
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { jsxs as x, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { ROOT_NODE as C } from "@craftjs/utils";
|
|
3
|
+
import { useEditor as W } from "@craftjs/core";
|
|
4
|
+
import { useState as w, useRef as J, useEffect as P, useCallback as Q } from "react";
|
|
5
|
+
import { dM as z, dN as R, dO as U, r as O, ct as M, dP as X, P as g, G as Y, cp as Z, bV as V, db as A, aA as ee, dQ as D, b as v } from "./index-C66dAl3Q.js";
|
|
6
|
+
import { C as te } from "./CreateTokenDialog-DNWtWqJd.js";
|
|
7
|
+
import { c as oe, T as re } from "./uiPrimitives-BtohldWg.js";
|
|
8
|
+
const E = (e, o) => {
|
|
9
|
+
if (!e) return !1;
|
|
10
|
+
let r;
|
|
11
|
+
if (typeof e == "object" && e.r !== void 0)
|
|
12
|
+
r = `rgba(${e.r},${e.g},${e.b},${e.a})`;
|
|
13
|
+
else if (typeof e == "string")
|
|
14
|
+
r = e;
|
|
15
|
+
else
|
|
16
|
+
return !1;
|
|
17
|
+
const s = z(r.trim()).base;
|
|
18
|
+
if (s.includes("palette:")) {
|
|
19
|
+
const n = s.match(/palette:(.+)$/);
|
|
20
|
+
if (n)
|
|
21
|
+
return z(n[1].trim()).base === o.name.trim();
|
|
22
|
+
}
|
|
23
|
+
if (s.includes("var(--")) {
|
|
24
|
+
const n = s.match(/var\(--([^)]+)\)/);
|
|
25
|
+
if (n)
|
|
26
|
+
return R(n[1]) === o.name.trim();
|
|
27
|
+
}
|
|
28
|
+
const i = s.trim();
|
|
29
|
+
if (i && /^[a-z][a-z0-9-]*$/i.test(i) && !s.includes("palette:") && !s.includes("var(--")) {
|
|
30
|
+
const n = i.split("-");
|
|
31
|
+
if (!(n.length === 2 && (() => {
|
|
32
|
+
const d = n[0].toLowerCase(), h = n[1], p = U[d];
|
|
33
|
+
return !!(p && typeof p == "object" && Object.prototype.hasOwnProperty.call(p, h));
|
|
34
|
+
})()) && R(i) === o.name.trim())
|
|
35
|
+
return !0;
|
|
36
|
+
}
|
|
37
|
+
if (r === o.color)
|
|
38
|
+
return !0;
|
|
39
|
+
if (typeof e == "object" && e.r !== void 0) {
|
|
40
|
+
const n = e, a = `rgba(${n.r},${n.g},${n.b},${n.a})`;
|
|
41
|
+
return o.color === a;
|
|
42
|
+
}
|
|
43
|
+
return !1;
|
|
44
|
+
};
|
|
45
|
+
function ne(e) {
|
|
46
|
+
return e == null ? !1 : String(e).trim() !== "";
|
|
47
|
+
}
|
|
48
|
+
function L() {
|
|
49
|
+
try {
|
|
50
|
+
const e = A.get("recent-tokens");
|
|
51
|
+
return e ? JSON.parse(e) : [];
|
|
52
|
+
} catch {
|
|
53
|
+
return [];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function ae(e) {
|
|
57
|
+
const o = L();
|
|
58
|
+
if (o.includes(e))
|
|
59
|
+
return [...o];
|
|
60
|
+
const r = [...o, e].slice(-8);
|
|
61
|
+
return A.set("recent-tokens", r), r;
|
|
62
|
+
}
|
|
63
|
+
function se(e, o, r) {
|
|
64
|
+
const s = /* @__PURE__ */ new Set(), i = [], n = (a) => {
|
|
65
|
+
i.length >= r || s.has(a.name) || (s.add(a.name), i.push(a));
|
|
66
|
+
};
|
|
67
|
+
for (const a of e) n(a);
|
|
68
|
+
for (const a of o) n(a);
|
|
69
|
+
return i;
|
|
70
|
+
}
|
|
71
|
+
function ve({
|
|
72
|
+
value: e,
|
|
73
|
+
onChange: o,
|
|
74
|
+
onClose: r,
|
|
75
|
+
onClear: s,
|
|
76
|
+
variant: i = "inline"
|
|
77
|
+
}) {
|
|
78
|
+
const { query: n } = W(), [a, d] = w([]), [h, p] = w(L), [k, _] = w(!1), [B, N] = w(!1), $ = J(null);
|
|
79
|
+
P(() => {
|
|
80
|
+
var t;
|
|
81
|
+
try {
|
|
82
|
+
const c = n.node(C).get(), m = O(((t = c == null ? void 0 : c.data) == null ? void 0 : t.props) || {}).palette;
|
|
83
|
+
d(m.filter((f) => (f == null ? void 0 : f.name) && (f == null ? void 0 : f.color)));
|
|
84
|
+
} catch {
|
|
85
|
+
}
|
|
86
|
+
}, [n]), P(() => {
|
|
87
|
+
if (!r) return;
|
|
88
|
+
const t = (c) => {
|
|
89
|
+
var m;
|
|
90
|
+
(m = $.current) != null && m.contains(c.target) || r();
|
|
91
|
+
};
|
|
92
|
+
return document.addEventListener("mousedown", t, !0), () => document.removeEventListener("mousedown", t, !0);
|
|
93
|
+
}, [r]), M({
|
|
94
|
+
id: "token-picker",
|
|
95
|
+
isOpen: !!r,
|
|
96
|
+
onDismiss: r ?? (() => {
|
|
97
|
+
})
|
|
98
|
+
});
|
|
99
|
+
const y = Q(
|
|
100
|
+
(t) => {
|
|
101
|
+
o({ type: "palette", value: `palette:${t}` }), p(ae(t));
|
|
102
|
+
},
|
|
103
|
+
[o]
|
|
104
|
+
), G = h.map((t) => a.find((c) => c.name === t)).filter(Boolean), T = i === "inline", b = T ? "size-6" : "size-8", S = se(G, a, T ? 11 : 4), F = new Set(S.map((t) => t.name)), H = a.some((t) => !F.has(t.name)), { scrollRef: I, onDragPointerDown: K, dragMoved: q } = X({
|
|
105
|
+
deps: [S.length, a.length]
|
|
106
|
+
});
|
|
107
|
+
return /* @__PURE__ */ x(
|
|
108
|
+
"div",
|
|
109
|
+
{
|
|
110
|
+
ref: $,
|
|
111
|
+
className: T ? "relative flex w-full max-w-[min(280px,100vw-2rem)] flex-col gap-2 p-2" : "relative flex w-[240px] max-w-[min(240px,100vw-2rem)] flex-col gap-3 p-3",
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ x("div", { className: "flex min-w-0 items-center gap-1", children: [
|
|
114
|
+
/* @__PURE__ */ l(
|
|
115
|
+
"div",
|
|
116
|
+
{
|
|
117
|
+
ref: I,
|
|
118
|
+
onPointerDown: K,
|
|
119
|
+
className: "scrollbar-hide no-scrollbar flex min-w-0 flex-1 cursor-grab flex-row gap-1 overflow-x-auto",
|
|
120
|
+
style: { scrollbarWidth: "none", msOverflowStyle: "none" },
|
|
121
|
+
children: S.map((t) => /* @__PURE__ */ l(
|
|
122
|
+
j,
|
|
123
|
+
{
|
|
124
|
+
color: t,
|
|
125
|
+
palette: a,
|
|
126
|
+
selected: E(e, t),
|
|
127
|
+
onPick: y,
|
|
128
|
+
dragMovedRef: q,
|
|
129
|
+
size: b,
|
|
130
|
+
tooltip: t.name
|
|
131
|
+
},
|
|
132
|
+
t.name
|
|
133
|
+
))
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
/* @__PURE__ */ x("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
137
|
+
/* @__PURE__ */ l(
|
|
138
|
+
"button",
|
|
139
|
+
{
|
|
140
|
+
type: "button",
|
|
141
|
+
onClick: () => N(!0),
|
|
142
|
+
className: `${b} border-base-300 text-neutral-content hover:border-base-content hover:text-base-content flex shrink-0 items-center justify-center rounded-md border-2 border-dashed transition-colors`,
|
|
143
|
+
"data-tooltip-id": g,
|
|
144
|
+
"data-tooltip-content": "New token",
|
|
145
|
+
"data-tooltip-place": "bottom",
|
|
146
|
+
"data-tooltip-offset": 10,
|
|
147
|
+
children: /* @__PURE__ */ l(Y, { className: "size-3" })
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
s != null && /* @__PURE__ */ l(
|
|
151
|
+
"button",
|
|
152
|
+
{
|
|
153
|
+
type: "button",
|
|
154
|
+
disabled: !ne(e),
|
|
155
|
+
onClick: (t) => {
|
|
156
|
+
t.preventDefault(), t.stopPropagation(), s();
|
|
157
|
+
},
|
|
158
|
+
className: `${b} border-base-300 text-neutral-content hover:border-primary hover:text-base-content flex shrink-0 items-center justify-center rounded-md border-2 transition-colors disabled:pointer-events-none disabled:opacity-40`,
|
|
159
|
+
"aria-label": "Remove color",
|
|
160
|
+
"data-tooltip-id": g,
|
|
161
|
+
"data-tooltip-content": "Remove color",
|
|
162
|
+
"data-tooltip-place": "bottom",
|
|
163
|
+
"data-tooltip-offset": 10,
|
|
164
|
+
children: /* @__PURE__ */ l(Z, { className: "size-3.5" })
|
|
165
|
+
}
|
|
166
|
+
),
|
|
167
|
+
H && /* @__PURE__ */ l(
|
|
168
|
+
"button",
|
|
169
|
+
{
|
|
170
|
+
type: "button",
|
|
171
|
+
onClick: () => _((t) => !t),
|
|
172
|
+
className: "text-neutral-content hover:text-base-content flex shrink-0 items-center",
|
|
173
|
+
"data-tooltip-id": g,
|
|
174
|
+
"data-tooltip-content": k ? "Less" : "All tokens",
|
|
175
|
+
"data-tooltip-place": "bottom",
|
|
176
|
+
"data-tooltip-offset": 10,
|
|
177
|
+
children: /* @__PURE__ */ l(
|
|
178
|
+
V,
|
|
179
|
+
{
|
|
180
|
+
className: `size-3.5 transition-transform ${k ? "rotate-180" : ""}`
|
|
181
|
+
}
|
|
182
|
+
)
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
] })
|
|
186
|
+
] }),
|
|
187
|
+
k && /* @__PURE__ */ l("div", { className: "border-base-300 flex flex-wrap gap-1 border-t pt-2", children: a.map((t) => /* @__PURE__ */ l(
|
|
188
|
+
j,
|
|
189
|
+
{
|
|
190
|
+
color: t,
|
|
191
|
+
palette: a,
|
|
192
|
+
selected: E(e, t),
|
|
193
|
+
onPick: y,
|
|
194
|
+
size: b,
|
|
195
|
+
tooltip: t.name
|
|
196
|
+
},
|
|
197
|
+
t.name
|
|
198
|
+
)) }),
|
|
199
|
+
B && /* @__PURE__ */ l("div", { className: "absolute top-full left-1/2 z-50 mt-1 -translate-x-1/2", children: /* @__PURE__ */ l(
|
|
200
|
+
te,
|
|
201
|
+
{
|
|
202
|
+
onCreated: (t) => {
|
|
203
|
+
var c;
|
|
204
|
+
N(!1);
|
|
205
|
+
try {
|
|
206
|
+
const m = n.node(C).get(), f = O(((c = m == null ? void 0 : m.data) == null ? void 0 : c.props) || {}).palette;
|
|
207
|
+
d(f.filter((u) => (u == null ? void 0 : u.name) && (u == null ? void 0 : u.color)));
|
|
208
|
+
} catch {
|
|
209
|
+
}
|
|
210
|
+
y(t);
|
|
211
|
+
},
|
|
212
|
+
onClose: () => N(!1)
|
|
213
|
+
}
|
|
214
|
+
) })
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
function ie(e) {
|
|
220
|
+
const o = e.trim();
|
|
221
|
+
return o ? o.startsWith("#") || /^(rgb|rgba|hsl|hsla|oklch|lab|lch|color|hwb|var)\(/i.test(o) ? !0 : (/* @__PURE__ */ new Set(["transparent", "currentcolor", "black", "white", "inherit"])).has(o.toLowerCase()) : !1;
|
|
222
|
+
}
|
|
223
|
+
const le = /^[a-z][a-z0-9-]*(\/(\d{1,3}|\[[^\]]+\]))?$/i;
|
|
224
|
+
function ce(e, o) {
|
|
225
|
+
const r = e.color.trim();
|
|
226
|
+
if (!r) {
|
|
227
|
+
const i = `--${D(e.name)}`;
|
|
228
|
+
return v(`text-[var(${i})]`, "text", o).backgroundColor;
|
|
229
|
+
}
|
|
230
|
+
if (ie(r))
|
|
231
|
+
return v(`text-${r}`, "text", o).backgroundColor;
|
|
232
|
+
if (le.test(r))
|
|
233
|
+
return v(`text-${r}`, "text", o).backgroundColor;
|
|
234
|
+
const s = `--${D(e.name)}`;
|
|
235
|
+
return v(`text-[var(${s})]`, "text", o).backgroundColor;
|
|
236
|
+
}
|
|
237
|
+
function j({
|
|
238
|
+
color: e,
|
|
239
|
+
palette: o,
|
|
240
|
+
selected: r,
|
|
241
|
+
onPick: s,
|
|
242
|
+
dragMovedRef: i,
|
|
243
|
+
size: n = "size-6",
|
|
244
|
+
tooltip: a
|
|
245
|
+
}) {
|
|
246
|
+
const d = ce(e, o), h = oe(d);
|
|
247
|
+
return /* @__PURE__ */ l(
|
|
248
|
+
"button",
|
|
249
|
+
{
|
|
250
|
+
type: "button",
|
|
251
|
+
onClick: () => {
|
|
252
|
+
i != null && i.current || s(e.name);
|
|
253
|
+
},
|
|
254
|
+
className: "group relative shrink-0",
|
|
255
|
+
...a ? {
|
|
256
|
+
"data-tooltip-id": g,
|
|
257
|
+
"data-tooltip-content": a,
|
|
258
|
+
"data-tooltip-place": "bottom",
|
|
259
|
+
"data-tooltip-offset": 10
|
|
260
|
+
} : {},
|
|
261
|
+
children: /* @__PURE__ */ x(
|
|
262
|
+
"div",
|
|
263
|
+
{
|
|
264
|
+
className: `relative overflow-hidden ${n} flex items-center justify-center rounded-md border-2 transition-transform hover:scale-110 ${r ? "border-primary ring-primary/30 ring-1" : "border-base-300"}`,
|
|
265
|
+
children: [
|
|
266
|
+
h && /* @__PURE__ */ l(
|
|
267
|
+
"span",
|
|
268
|
+
{
|
|
269
|
+
className: "pointer-events-none absolute inset-0 z-0 rounded-[inherit]",
|
|
270
|
+
style: re,
|
|
271
|
+
"aria-hidden": !0
|
|
272
|
+
}
|
|
273
|
+
),
|
|
274
|
+
/* @__PURE__ */ l(
|
|
275
|
+
"span",
|
|
276
|
+
{
|
|
277
|
+
className: "absolute inset-0 z-1 rounded-[inherit]",
|
|
278
|
+
style: { backgroundColor: d },
|
|
279
|
+
"aria-hidden": !0
|
|
280
|
+
}
|
|
281
|
+
),
|
|
282
|
+
r && /* @__PURE__ */ l(ee, { className: "relative z-2 size-3 text-white drop-shadow-md" })
|
|
283
|
+
]
|
|
284
|
+
}
|
|
285
|
+
)
|
|
286
|
+
}
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
export {
|
|
290
|
+
ve as T
|
|
291
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsxs as s, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as u } from "react";
|
|
3
|
+
import { G as d, t as l } from "./index-C66dAl3Q.js";
|
|
4
|
+
const h = u(
|
|
5
|
+
function({ className: o, children: r, icon: t, ...a }, e) {
|
|
6
|
+
return /* @__PURE__ */ s(
|
|
7
|
+
"button",
|
|
8
|
+
{
|
|
9
|
+
ref: e,
|
|
10
|
+
type: "button",
|
|
11
|
+
className: l("ph-toolbar-dashed-btn", o),
|
|
12
|
+
...a,
|
|
13
|
+
children: [
|
|
14
|
+
t !== null && (t ?? /* @__PURE__ */ n(d, { size: 12, "aria-hidden": !0 })),
|
|
15
|
+
r
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
export {
|
|
22
|
+
h as T
|
|
23
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { W as a, eN as i } from "./index-C66dAl3Q.js";
|
|
3
|
+
import { F as o } from "./FloatingPanel-DJP5Vhua.js";
|
|
4
|
+
import { a as n } from "./EffectsClassInput-Yujuchwy.js";
|
|
5
|
+
function d({ initialPosition: e, onClose: t }) {
|
|
6
|
+
return /* @__PURE__ */ r(
|
|
7
|
+
o,
|
|
8
|
+
{
|
|
9
|
+
isOpen: !0,
|
|
10
|
+
onClose: t,
|
|
11
|
+
title: "Transform",
|
|
12
|
+
icon: /* @__PURE__ */ r(i, { "aria-hidden": !0 }),
|
|
13
|
+
storageKey: "effects-builder-transform",
|
|
14
|
+
minWidth: 300,
|
|
15
|
+
maxWidth: 480,
|
|
16
|
+
minHeight: 300,
|
|
17
|
+
initialPosition: e,
|
|
18
|
+
zIndex: a,
|
|
19
|
+
scrollable: !0,
|
|
20
|
+
children: /* @__PURE__ */ r(n, {})
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
d as default
|
|
26
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { W as n, eM as e } from "./index-C66dAl3Q.js";
|
|
3
|
+
import { F as o } from "./FloatingPanel-DJP5Vhua.js";
|
|
4
|
+
import { T as a } from "./EffectsClassInput-Yujuchwy.js";
|
|
5
|
+
function f({ initialPosition: t, onClose: r }) {
|
|
6
|
+
return /* @__PURE__ */ i(
|
|
7
|
+
o,
|
|
8
|
+
{
|
|
9
|
+
isOpen: !0,
|
|
10
|
+
onClose: r,
|
|
11
|
+
title: "Transition",
|
|
12
|
+
icon: /* @__PURE__ */ i(e, { "aria-hidden": !0 }),
|
|
13
|
+
storageKey: "effects-builder-transition",
|
|
14
|
+
minWidth: 300,
|
|
15
|
+
maxWidth: 460,
|
|
16
|
+
minHeight: 180,
|
|
17
|
+
initialPosition: t,
|
|
18
|
+
zIndex: n,
|
|
19
|
+
scrollable: !0,
|
|
20
|
+
children: /* @__PURE__ */ i(a, {})
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
f as default
|
|
26
|
+
};
|