@puckeditor/core 0.22.0-canary.faffb521 → 0.22.0
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/dist/{Editor-HFELA66Z.mjs → Editor-FJJNKTC3.mjs} +8 -9
- package/dist/Editor-ZZW3KF2T.css +385 -0
- package/dist/{Render-MJ563JES.mjs → Render-DQXAYUBI.mjs} +1 -1
- package/dist/Render-EKEWMTMI.css +117 -0
- package/dist/{chunk-GFIZBMKN.mjs → chunk-3RQGAM3Z.mjs} +1 -1
- package/dist/{chunk-6PUO3QRB.mjs → chunk-4US666EQ.mjs} +91 -248
- package/dist/{chunk-52JFFDX2.mjs → chunk-ELDOSC5Y.mjs} +1469 -1335
- package/dist/{chunk-4V66DSMA.mjs → chunk-GKUX6MNS.mjs} +4 -4
- package/dist/{chunk-AOEDIUVK.mjs → chunk-H635BA2V.mjs} +1 -1
- package/dist/{chunk-4X2SLJRQ.mjs → chunk-M5GPDW62.mjs} +1 -1
- package/dist/{chunk-CO6PRTVM.mjs → chunk-SSXLOL3N.mjs} +6 -6
- package/dist/{chunk-MQKADUDK.mjs → chunk-XIGSFEU7.mjs} +1 -1
- package/dist/{chunk-OVPTKQ2P.mjs → chunk-XQHCQEAF.mjs} +229 -51
- package/dist/{full-YKFH7JSW.mjs → full-6ZILLKCS.mjs} +6 -6
- package/dist/full-S3QQ2IBQ.css +267 -0
- package/dist/index.css +1287 -1171
- package/dist/index.d.mts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +1993 -1837
- package/dist/index.mjs +11 -10
- package/dist/loaded-FVWRAJR3.css +215 -0
- package/dist/{loaded-A7UUCT2O.mjs → loaded-LAKI4KDY.mjs} +2 -2
- package/dist/{loaded-2QS7VXZ6.mjs → loaded-PILFUJGA.mjs} +2 -2
- package/dist/{loaded-JHBS3QYA.mjs → loaded-QH5RKCGC.mjs} +2 -2
- package/dist/no-external.css +1287 -1171
- package/dist/no-external.js +1993 -1837
- package/dist/no-external.mjs +11 -10
- package/dist/rsc.css +61 -46
- package/dist/rsc.js +6 -6
- package/dist/rsc.mjs +2 -2
- package/package.json +1 -1
- package/dist/Editor-IQP25PUX.css +0 -404
- package/dist/Render-3OV4N4MT.css +0 -102
- package/dist/full-2GJTAAZE.css +0 -301
- package/dist/loaded-RVWBFK7L.css +0 -87
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
styles_module_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-H635BA2V.mjs";
|
|
4
4
|
import {
|
|
5
5
|
LoadedRichTextMenuInner
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4US666EQ.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useAppStore,
|
|
9
9
|
useAppStoreApi
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-XQHCQEAF.mjs";
|
|
11
11
|
import {
|
|
12
12
|
get_class_name_factory_default
|
|
13
13
|
} from "./chunk-Y2EFNT5P.mjs";
|
|
@@ -100,7 +100,7 @@ init_react_import();
|
|
|
100
100
|
import { lazy, Suspense } from "react";
|
|
101
101
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
102
102
|
var LoadedRichTextMenuFull = lazy(
|
|
103
|
-
() => import("./full-
|
|
103
|
+
() => import("./full-6ZILLKCS.mjs").then((m) => ({
|
|
104
104
|
default: m.LoadedRichTextMenuFull
|
|
105
105
|
}))
|
|
106
106
|
);
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
|
|
5
5
|
// css-module:/home/runner/work/puck/puck/packages/core/components/RichTextEditor/styles.module.css#css-module
|
|
6
6
|
init_react_import();
|
|
7
|
-
var styles_module_default = { "RichTextEditor": "
|
|
7
|
+
var styles_module_default = { "RichTextEditor": "_RichTextEditor_5wzos_1", "RichTextEditor--editor": "_RichTextEditor--editor_5wzos_50", "RichTextEditor--disabled": "_RichTextEditor--disabled_5wzos_123", "RichTextEditor--isActive": "_RichTextEditor--isActive_5wzos_159", "RichTextEditor-menu": "_RichTextEditor-menu_5wzos_165" };
|
|
8
8
|
|
|
9
9
|
export {
|
|
10
10
|
styles_module_default
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
styles_module_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-H635BA2V.mjs";
|
|
4
4
|
import {
|
|
5
5
|
defaultAppState,
|
|
6
6
|
resolveComponentData
|
|
@@ -377,6 +377,11 @@ var mapDeep = (source, path, render) => {
|
|
|
377
377
|
|
|
378
378
|
// components/RichTextEditor/lib/use-richtext-props.tsx
|
|
379
379
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
380
|
+
var RichTextRender = lazy(
|
|
381
|
+
() => import("./Render-DQXAYUBI.mjs").then((m) => ({
|
|
382
|
+
default: m.RichTextRender
|
|
383
|
+
}))
|
|
384
|
+
);
|
|
380
385
|
function useRichtextProps(fields, props) {
|
|
381
386
|
const findAllRichtextKeys = (fields2, path = []) => {
|
|
382
387
|
if (!fields2) return [];
|
|
@@ -401,11 +406,6 @@ function useRichtextProps(fields, props) {
|
|
|
401
406
|
const richtextKeys = useMemo2(() => findAllRichtextKeys(fields), [fields]);
|
|
402
407
|
const richtextProps = useMemo2(() => {
|
|
403
408
|
if (!(richtextKeys == null ? void 0 : richtextKeys.length)) return {};
|
|
404
|
-
const RichTextRender = lazy(
|
|
405
|
-
() => import("./Render-MJ563JES.mjs").then((m) => ({
|
|
406
|
-
default: m.RichTextRender
|
|
407
|
-
}))
|
|
408
|
-
);
|
|
409
409
|
let result = __spreadValues({}, props);
|
|
410
410
|
for (const { path, field } of richtextKeys) {
|
|
411
411
|
result = mapDeep(result, path, (content) => /* @__PURE__ */ jsx2(
|
|
@@ -24,12 +24,66 @@ import {
|
|
|
24
24
|
init_react_import
|
|
25
25
|
} from "./chunk-M6W7YEVX.mjs";
|
|
26
26
|
|
|
27
|
+
// components/ActionBar/index.tsx
|
|
28
|
+
init_react_import();
|
|
29
|
+
import { forwardRef } from "react";
|
|
30
|
+
|
|
31
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/ActionBar/styles.module.css#css-module
|
|
32
|
+
init_react_import();
|
|
33
|
+
var styles_module_default = { "ActionBar": "_ActionBar_5vdfr_1", "ActionBar-label": "_ActionBar-label_5vdfr_17", "ActionBarAction": "_ActionBarAction_5vdfr_30", "ActionBar-group": "_ActionBar-group_5vdfr_38", "ActionBarAction--disabled": "_ActionBarAction--disabled_5vdfr_74", "ActionBarAction--active": "_ActionBarAction--active_5vdfr_104", "ActionBar-separator": "_ActionBar-separator_5vdfr_117" };
|
|
34
|
+
|
|
35
|
+
// components/ActionBar/index.tsx
|
|
36
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
37
|
+
var getClassName = get_class_name_factory_default("ActionBar", styles_module_default);
|
|
38
|
+
var getActionClassName = get_class_name_factory_default("ActionBarAction", styles_module_default);
|
|
39
|
+
var ActionBar = ({
|
|
40
|
+
label,
|
|
41
|
+
children
|
|
42
|
+
}) => /* @__PURE__ */ jsxs(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
className: getClassName(),
|
|
46
|
+
onClick: (e) => {
|
|
47
|
+
e.stopPropagation();
|
|
48
|
+
},
|
|
49
|
+
children: [
|
|
50
|
+
label && /* @__PURE__ */ jsx(ActionBar.Group, { children: /* @__PURE__ */ jsx("div", { className: getClassName("label"), children: label }) }),
|
|
51
|
+
children
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
var Action = forwardRef((_a, ref) => {
|
|
56
|
+
var _b = _a, { children, label, onClick, active = false, disabled } = _b, rest = __objRest(_b, ["children", "label", "onClick", "active", "disabled"]);
|
|
57
|
+
return /* @__PURE__ */ jsx(
|
|
58
|
+
"button",
|
|
59
|
+
__spreadProps(__spreadValues({
|
|
60
|
+
type: "button"
|
|
61
|
+
}, rest), {
|
|
62
|
+
ref,
|
|
63
|
+
className: getActionClassName({ active, disabled }),
|
|
64
|
+
onClick,
|
|
65
|
+
title: label,
|
|
66
|
+
tabIndex: 0,
|
|
67
|
+
disabled,
|
|
68
|
+
children
|
|
69
|
+
})
|
|
70
|
+
);
|
|
71
|
+
});
|
|
72
|
+
Action.displayName = "Action";
|
|
73
|
+
var Group = ({ children }) => /* @__PURE__ */ jsx("div", { className: getClassName("group"), children });
|
|
74
|
+
var Label = ({ label }) => /* @__PURE__ */ jsx("div", { className: getClassName("label"), children: label });
|
|
75
|
+
var Separator = () => /* @__PURE__ */ jsx("div", { className: getClassName("separator") });
|
|
76
|
+
ActionBar.Action = Action;
|
|
77
|
+
ActionBar.Label = Label;
|
|
78
|
+
ActionBar.Group = Group;
|
|
79
|
+
ActionBar.Separator = Separator;
|
|
80
|
+
|
|
27
81
|
// ../../node_modules/lucide-react/dist/esm/icons/align-left.js
|
|
28
82
|
init_react_import();
|
|
29
83
|
|
|
30
84
|
// ../../node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
31
85
|
init_react_import();
|
|
32
|
-
import { forwardRef as
|
|
86
|
+
import { forwardRef as forwardRef3, createElement as createElement2 } from "react";
|
|
33
87
|
|
|
34
88
|
// ../../node_modules/lucide-react/dist/esm/shared/src/utils.js
|
|
35
89
|
init_react_import();
|
|
@@ -40,7 +94,7 @@ var mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
|
|
40
94
|
|
|
41
95
|
// ../../node_modules/lucide-react/dist/esm/Icon.js
|
|
42
96
|
init_react_import();
|
|
43
|
-
import { forwardRef, createElement } from "react";
|
|
97
|
+
import { forwardRef as forwardRef2, createElement } from "react";
|
|
44
98
|
|
|
45
99
|
// ../../node_modules/lucide-react/dist/esm/defaultAttributes.js
|
|
46
100
|
init_react_import();
|
|
@@ -57,7 +111,7 @@ var defaultAttributes = {
|
|
|
57
111
|
};
|
|
58
112
|
|
|
59
113
|
// ../../node_modules/lucide-react/dist/esm/Icon.js
|
|
60
|
-
var Icon =
|
|
114
|
+
var Icon = forwardRef2(
|
|
61
115
|
(_a, ref) => {
|
|
62
116
|
var _b = _a, {
|
|
63
117
|
color = "currentColor",
|
|
@@ -97,7 +151,7 @@ var Icon = forwardRef(
|
|
|
97
151
|
|
|
98
152
|
// ../../node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
99
153
|
var createLucideIcon = (iconName, iconNode) => {
|
|
100
|
-
const Component =
|
|
154
|
+
const Component = forwardRef3(
|
|
101
155
|
(_a, ref) => {
|
|
102
156
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
103
157
|
return createElement2(Icon, __spreadValues({
|
|
@@ -1357,33 +1411,16 @@ function useAppStoreApi() {
|
|
|
1357
1411
|
return useContext(appStoreContext);
|
|
1358
1412
|
}
|
|
1359
1413
|
|
|
1360
|
-
// components/
|
|
1414
|
+
// components/IconButton/IconButton.tsx
|
|
1361
1415
|
init_react_import();
|
|
1362
|
-
import {
|
|
1363
|
-
var ControlContext = createContext2({});
|
|
1364
|
-
var useControlContext = () => {
|
|
1365
|
-
return useContext2(ControlContext);
|
|
1366
|
-
};
|
|
1416
|
+
import { forwardRef as forwardRef4, useState } from "react";
|
|
1367
1417
|
|
|
1368
|
-
//
|
|
1369
|
-
init_react_import();
|
|
1370
|
-
import { useMemo } from "react";
|
|
1371
|
-
|
|
1372
|
-
// components/Select/index.tsx
|
|
1418
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/IconButton/IconButton.module.css#css-module
|
|
1373
1419
|
init_react_import();
|
|
1420
|
+
var IconButton_module_default = { "IconButton": "_IconButton_yuha3_1", "IconButton--active": "_IconButton--active_yuha3_15", "IconButton--disabled": "_IconButton--disabled_yuha3_28" };
|
|
1374
1421
|
|
|
1375
|
-
//
|
|
1422
|
+
// components/Loader/index.tsx
|
|
1376
1423
|
init_react_import();
|
|
1377
|
-
var styles_module_default = { "Select": "_Select_xjbef_1", "Select-button": "_Select-button_xjbef_6", "Select--hasOptions": "_Select--hasOptions_xjbef_19", "Select--disabled": "_Select--disabled_xjbef_23", "Select-buttonIcon": "_Select-buttonIcon_xjbef_27", "Select--standalone": "_Select--standalone_xjbef_33", "Select--actionBar": "_Select--actionBar_xjbef_38", "Select--hasValue": "_Select--hasValue_xjbef_44", "Select-items": "_Select-items_xjbef_61", "SelectItem": "_SelectItem_xjbef_72", "SelectItem--isSelected": "_SelectItem--isSelected_xjbef_87", "SelectItem-icon": "_SelectItem-icon_xjbef_93" };
|
|
1378
|
-
|
|
1379
|
-
// components/Select/index.tsx
|
|
1380
|
-
import { useState } from "react";
|
|
1381
|
-
import {
|
|
1382
|
-
Popover,
|
|
1383
|
-
PopoverContent,
|
|
1384
|
-
PopoverPortal,
|
|
1385
|
-
PopoverTrigger
|
|
1386
|
-
} from "@radix-ui/react-popover";
|
|
1387
1424
|
|
|
1388
1425
|
// lib/index.ts
|
|
1389
1426
|
init_react_import();
|
|
@@ -1579,16 +1616,146 @@ var useResetAutoZoom = (frameRef) => {
|
|
|
1579
1616
|
return resetAutoZoom;
|
|
1580
1617
|
};
|
|
1581
1618
|
|
|
1619
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/Loader/styles.module.css#css-module
|
|
1620
|
+
init_react_import();
|
|
1621
|
+
var styles_module_default2 = { "Loader": "_Loader_1w5zn_13", "loader-animation": "_loader-animation_1w5zn_1" };
|
|
1622
|
+
|
|
1623
|
+
// components/Loader/index.tsx
|
|
1624
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
1625
|
+
var getClassName2 = get_class_name_factory_default("Loader", styles_module_default2);
|
|
1626
|
+
var Loader = (_a) => {
|
|
1627
|
+
var _b = _a, {
|
|
1628
|
+
color,
|
|
1629
|
+
size = 16
|
|
1630
|
+
} = _b, props = __objRest(_b, [
|
|
1631
|
+
"color",
|
|
1632
|
+
"size"
|
|
1633
|
+
]);
|
|
1634
|
+
return /* @__PURE__ */ jsx2(
|
|
1635
|
+
"span",
|
|
1636
|
+
__spreadValues({
|
|
1637
|
+
className: getClassName2(),
|
|
1638
|
+
style: {
|
|
1639
|
+
width: size,
|
|
1640
|
+
height: size,
|
|
1641
|
+
color
|
|
1642
|
+
},
|
|
1643
|
+
"aria-label": "loading"
|
|
1644
|
+
}, props)
|
|
1645
|
+
);
|
|
1646
|
+
};
|
|
1647
|
+
|
|
1648
|
+
// components/IconButton/IconButton.tsx
|
|
1649
|
+
import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1650
|
+
var getClassName3 = get_class_name_factory_default("IconButton", IconButton_module_default);
|
|
1651
|
+
var IconButton = forwardRef4(
|
|
1652
|
+
(_a, ref) => {
|
|
1653
|
+
var _b = _a, {
|
|
1654
|
+
active = false,
|
|
1655
|
+
children,
|
|
1656
|
+
href,
|
|
1657
|
+
onClick,
|
|
1658
|
+
type,
|
|
1659
|
+
disabled,
|
|
1660
|
+
tabIndex,
|
|
1661
|
+
newTab,
|
|
1662
|
+
fullWidth,
|
|
1663
|
+
title,
|
|
1664
|
+
suppressHydrationWarning
|
|
1665
|
+
} = _b, rest = __objRest(_b, [
|
|
1666
|
+
"active",
|
|
1667
|
+
"children",
|
|
1668
|
+
"href",
|
|
1669
|
+
"onClick",
|
|
1670
|
+
"type",
|
|
1671
|
+
"disabled",
|
|
1672
|
+
"tabIndex",
|
|
1673
|
+
"newTab",
|
|
1674
|
+
"fullWidth",
|
|
1675
|
+
"title",
|
|
1676
|
+
"suppressHydrationWarning"
|
|
1677
|
+
]);
|
|
1678
|
+
const [loading, setLoading] = useState(false);
|
|
1679
|
+
const ElementType = href ? "a" : "button";
|
|
1680
|
+
return /* @__PURE__ */ jsxs2(
|
|
1681
|
+
ElementType,
|
|
1682
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
1683
|
+
ref,
|
|
1684
|
+
className: getClassName3({
|
|
1685
|
+
active,
|
|
1686
|
+
disabled,
|
|
1687
|
+
fullWidth
|
|
1688
|
+
}),
|
|
1689
|
+
onClick: (e) => {
|
|
1690
|
+
if (!onClick) return;
|
|
1691
|
+
setLoading(true);
|
|
1692
|
+
Promise.resolve(onClick(e)).then(() => {
|
|
1693
|
+
setLoading(false);
|
|
1694
|
+
});
|
|
1695
|
+
},
|
|
1696
|
+
type,
|
|
1697
|
+
disabled: disabled || loading,
|
|
1698
|
+
tabIndex,
|
|
1699
|
+
target: newTab ? "_blank" : void 0,
|
|
1700
|
+
rel: newTab ? "noreferrer" : void 0,
|
|
1701
|
+
href,
|
|
1702
|
+
title,
|
|
1703
|
+
"aria-label": title,
|
|
1704
|
+
suppressHydrationWarning,
|
|
1705
|
+
children: [
|
|
1706
|
+
children,
|
|
1707
|
+
loading && /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
1708
|
+
"\xA0\xA0",
|
|
1709
|
+
/* @__PURE__ */ jsx3(Loader, { size: 14 })
|
|
1710
|
+
] })
|
|
1711
|
+
]
|
|
1712
|
+
})
|
|
1713
|
+
);
|
|
1714
|
+
}
|
|
1715
|
+
);
|
|
1716
|
+
IconButton.displayName = "IconButton";
|
|
1717
|
+
|
|
1718
|
+
// components/RichTextMenu/lib/use-control-context.ts
|
|
1719
|
+
init_react_import();
|
|
1720
|
+
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
1721
|
+
var ControlContext = createContext2({});
|
|
1722
|
+
var useControlContext = () => {
|
|
1723
|
+
return useContext2(ControlContext);
|
|
1724
|
+
};
|
|
1725
|
+
|
|
1726
|
+
// components/RichTextMenu/components/SelectControl/index.tsx
|
|
1727
|
+
init_react_import();
|
|
1728
|
+
import { useMemo } from "react";
|
|
1729
|
+
|
|
1582
1730
|
// components/Select/index.tsx
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1731
|
+
init_react_import();
|
|
1732
|
+
|
|
1733
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/Select/styles.module.css#css-module
|
|
1734
|
+
init_react_import();
|
|
1735
|
+
var styles_module_default3 = { "Select": "_Select_1n4iv_1", "Select-buttonInner": "_Select-buttonInner_1n4iv_6", "Select-buttonIcon": "_Select-buttonIcon_1n4iv_11", "Select--standalone": "_Select--standalone_1n4iv_17", "Select--actionBar": "_Select--actionBar_1n4iv_22", "Select-items": "_Select-items_1n4iv_27", "SelectItem": "_SelectItem_1n4iv_38", "SelectItem--isSelected": "_SelectItem--isSelected_1n4iv_53", "SelectItem-icon": "_SelectItem-icon_1n4iv_59" };
|
|
1736
|
+
|
|
1737
|
+
// components/Select/index.tsx
|
|
1738
|
+
import { useState as useState2 } from "react";
|
|
1739
|
+
import {
|
|
1740
|
+
Popover,
|
|
1741
|
+
PopoverContent,
|
|
1742
|
+
PopoverPortal,
|
|
1743
|
+
PopoverTrigger
|
|
1744
|
+
} from "@radix-ui/react-popover";
|
|
1745
|
+
|
|
1746
|
+
// components/IconButton/index.ts
|
|
1747
|
+
init_react_import();
|
|
1748
|
+
|
|
1749
|
+
// components/Select/index.tsx
|
|
1750
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1751
|
+
var getClassName4 = get_class_name_factory_default("Select", styles_module_default3);
|
|
1752
|
+
var getItemClassName = get_class_name_factory_default("SelectItem", styles_module_default3);
|
|
1586
1753
|
var Item = ({
|
|
1587
1754
|
children,
|
|
1588
1755
|
isSelected,
|
|
1589
1756
|
onClick
|
|
1590
1757
|
}) => {
|
|
1591
|
-
return /* @__PURE__ */
|
|
1758
|
+
return /* @__PURE__ */ jsx4("button", { className: getItemClassName({ isSelected }), onClick, children });
|
|
1592
1759
|
};
|
|
1593
1760
|
var Select = ({
|
|
1594
1761
|
children,
|
|
@@ -1599,30 +1766,34 @@ var Select = ({
|
|
|
1599
1766
|
mode,
|
|
1600
1767
|
disabled = false
|
|
1601
1768
|
}) => {
|
|
1602
|
-
const [open, setOpen] =
|
|
1769
|
+
const [open, setOpen] = useState2(false);
|
|
1603
1770
|
const hasOptions = options.length > 0;
|
|
1604
1771
|
const isDisabled = disabled || !hasOptions;
|
|
1605
|
-
|
|
1772
|
+
const buttonInner = /* @__PURE__ */ jsxs3("div", { className: getClassName4("buttonInner"), children: [
|
|
1773
|
+
/* @__PURE__ */ jsx4("span", { className: getClassName4("buttonIcon"), children }),
|
|
1774
|
+
/* @__PURE__ */ jsx4(ChevronDown, { size: 12 })
|
|
1775
|
+
] });
|
|
1776
|
+
const trigger = mode === "actionBar" ? /* @__PURE__ */ jsx4(Action, { active: value !== defaultValue, disabled: isDisabled, children: buttonInner }) : /* @__PURE__ */ jsx4(
|
|
1777
|
+
IconButton,
|
|
1778
|
+
{
|
|
1779
|
+
title: "Select",
|
|
1780
|
+
active: value !== defaultValue,
|
|
1781
|
+
disabled: isDisabled,
|
|
1782
|
+
children: buttonInner
|
|
1783
|
+
}
|
|
1784
|
+
);
|
|
1785
|
+
return /* @__PURE__ */ jsx4(
|
|
1606
1786
|
"div",
|
|
1607
1787
|
{
|
|
1608
|
-
className:
|
|
1609
|
-
hasValue: value !== defaultValue,
|
|
1610
|
-
hasOptions,
|
|
1788
|
+
className: getClassName4({
|
|
1611
1789
|
actionBar: mode === "actionBar",
|
|
1612
|
-
standalone: mode === "standalone"
|
|
1613
|
-
disabled: isDisabled
|
|
1790
|
+
standalone: mode === "standalone"
|
|
1614
1791
|
}),
|
|
1615
|
-
children: /* @__PURE__ */
|
|
1616
|
-
hasOptions ? /* @__PURE__ */
|
|
1617
|
-
|
|
1618
|
-
/* @__PURE__ */ jsx(ChevronDown, { size: 12 })
|
|
1619
|
-
] }) }) : /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("div", { className: getClassName("button"), children: [
|
|
1620
|
-
/* @__PURE__ */ jsx("span", { className: getClassName("buttonIcon"), children }),
|
|
1621
|
-
/* @__PURE__ */ jsx(ChevronDown, { size: 12 })
|
|
1622
|
-
] }) }),
|
|
1623
|
-
options.length > 0 && /* @__PURE__ */ jsx(PopoverPortal, { children: /* @__PURE__ */ jsx(PopoverContent, { align: "start", children: /* @__PURE__ */ jsx("ul", { className: getClassName("items"), "data-puck-rte-menu": true, children: options.map((option) => {
|
|
1792
|
+
children: /* @__PURE__ */ jsxs3(Popover, { open, onOpenChange: setOpen, children: [
|
|
1793
|
+
hasOptions ? /* @__PURE__ */ jsx4(PopoverTrigger, { asChild: true, children: trigger }) : trigger,
|
|
1794
|
+
options.length > 0 && /* @__PURE__ */ jsx4(PopoverPortal, { children: /* @__PURE__ */ jsx4(PopoverContent, { align: "start", children: /* @__PURE__ */ jsx4("ul", { className: getClassName4("items"), "data-puck-rte-menu": true, children: options.map((option) => {
|
|
1624
1795
|
const Icon2 = option.icon;
|
|
1625
|
-
return /* @__PURE__ */
|
|
1796
|
+
return /* @__PURE__ */ jsx4("li", { children: /* @__PURE__ */ jsxs3(
|
|
1626
1797
|
Item,
|
|
1627
1798
|
{
|
|
1628
1799
|
isSelected: value === option.value,
|
|
@@ -1631,7 +1802,7 @@ var Select = ({
|
|
|
1631
1802
|
setOpen(false);
|
|
1632
1803
|
},
|
|
1633
1804
|
children: [
|
|
1634
|
-
Icon2 && /* @__PURE__ */
|
|
1805
|
+
Icon2 && /* @__PURE__ */ jsx4("div", { className: getItemClassName("icon"), children: /* @__PURE__ */ jsx4(Icon2, { size: 16 }) }),
|
|
1635
1806
|
option.label
|
|
1636
1807
|
]
|
|
1637
1808
|
}
|
|
@@ -1643,7 +1814,7 @@ var Select = ({
|
|
|
1643
1814
|
};
|
|
1644
1815
|
|
|
1645
1816
|
// components/RichTextMenu/components/SelectControl/index.tsx
|
|
1646
|
-
import { jsx as
|
|
1817
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
1647
1818
|
function SelectControl({
|
|
1648
1819
|
renderDefaultIcon,
|
|
1649
1820
|
onChange,
|
|
@@ -1661,7 +1832,7 @@ function SelectControl({
|
|
|
1661
1832
|
[options]
|
|
1662
1833
|
);
|
|
1663
1834
|
const Node = (_b = value && ((_a = optionsByValue[value]) == null ? void 0 : _a.icon)) != null ? _b : renderDefaultIcon;
|
|
1664
|
-
return /* @__PURE__ */
|
|
1835
|
+
return /* @__PURE__ */ jsx5(
|
|
1665
1836
|
Select,
|
|
1666
1837
|
{
|
|
1667
1838
|
options,
|
|
@@ -1670,12 +1841,17 @@ function SelectControl({
|
|
|
1670
1841
|
defaultValue,
|
|
1671
1842
|
mode: inline ? "actionBar" : "standalone",
|
|
1672
1843
|
disabled: readOnly,
|
|
1673
|
-
children: /* @__PURE__ */
|
|
1844
|
+
children: /* @__PURE__ */ jsx5(Node, {})
|
|
1674
1845
|
}
|
|
1675
1846
|
);
|
|
1676
1847
|
}
|
|
1677
1848
|
|
|
1678
1849
|
export {
|
|
1850
|
+
ActionBar,
|
|
1851
|
+
Action,
|
|
1852
|
+
Group,
|
|
1853
|
+
Label,
|
|
1854
|
+
Separator,
|
|
1679
1855
|
AlignCenter,
|
|
1680
1856
|
AlignJustify,
|
|
1681
1857
|
AlignLeft,
|
|
@@ -1746,6 +1922,8 @@ export {
|
|
|
1746
1922
|
useAppStoreApi,
|
|
1747
1923
|
getBox,
|
|
1748
1924
|
useResetAutoZoom,
|
|
1925
|
+
Loader,
|
|
1926
|
+
IconButton,
|
|
1749
1927
|
ControlContext,
|
|
1750
1928
|
useControlContext,
|
|
1751
1929
|
SelectControl
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LoadedRichTextMenuInner
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-4US666EQ.mjs";
|
|
4
|
+
import "./chunk-M5GPDW62.mjs";
|
|
5
|
+
import "./chunk-3RQGAM3Z.mjs";
|
|
6
|
+
import "./chunk-XIGSFEU7.mjs";
|
|
7
|
+
import "./chunk-XQHCQEAF.mjs";
|
|
8
8
|
import "./chunk-DVZWVU66.mjs";
|
|
9
9
|
import "./chunk-6MO3E35Y.mjs";
|
|
10
10
|
import "./chunk-Y2EFNT5P.mjs";
|
|
@@ -24,7 +24,7 @@ init_react_import();
|
|
|
24
24
|
var defaultEditorState = (ctx, readOnly) => {
|
|
25
25
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B;
|
|
26
26
|
const editor = ctx.editor;
|
|
27
|
-
if (!editor) return {};
|
|
27
|
+
if (!editor || editor.isDestroyed) return {};
|
|
28
28
|
const canChain = () => editor.can().chain();
|
|
29
29
|
return {
|
|
30
30
|
isAlignLeft: editor.isActive({ textAlign: "left" }),
|