@puckeditor/core 0.22.4 → 0.23.0-canary.026f0300
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-ZZW3KF2T.css → Editor-T7TKW6NT.css} +7 -7
- package/dist/{Editor-MLHOIEVM.mjs → Editor-Z6P5UAVB.mjs} +8 -8
- package/dist/{actions-Csn3gOP8.d.mts → actions-3w-1VzY_.d.mts} +7 -1
- package/dist/{actions-Csn3gOP8.d.ts → actions-3w-1VzY_.d.ts} +7 -1
- package/dist/{chunk-25O24MZR.mjs → chunk-3OLRWMRO.mjs} +37 -22
- package/dist/{chunk-JNJJ2M57.mjs → chunk-3TERNOIP.mjs} +1 -1
- package/dist/{chunk-KJQTOPIV.mjs → chunk-DIYX54ZO.mjs} +136 -7
- package/dist/{chunk-4I2WN43X.mjs → chunk-L73ATZ55.mjs} +15 -8
- package/dist/{chunk-WUO7D6OQ.mjs → chunk-NPAYGEG5.mjs} +1 -0
- package/dist/{chunk-C2H4WQP2.mjs → chunk-OCFR2FFG.mjs} +27 -12
- package/dist/{chunk-NKDMBWQC.mjs → chunk-OSPG5CWL.mjs} +21 -10
- package/dist/{chunk-PRZEIT36.mjs → chunk-PJYHZPJK.mjs} +3 -3
- package/dist/{chunk-WH6PO5ND.mjs → chunk-S3CSGIQ3.mjs} +2047 -797
- package/dist/{chunk-25QAPMLH.mjs → chunk-UAWUZ45G.mjs} +41 -18
- package/dist/{full-YXSOFDYM.mjs → full-67VCA5MX.mjs} +7 -7
- package/dist/{full-S3QQ2IBQ.css → full-AAZK6KLI.css} +7 -7
- package/dist/index-KWLAZybR.d.ts +206 -0
- package/dist/index-l1l-a8tj.d.mts +206 -0
- package/dist/index.css +308 -111
- package/dist/index.d.mts +24 -11
- package/dist/index.d.ts +24 -11
- package/dist/index.js +2352 -809
- package/dist/index.mjs +10 -10
- package/dist/internal.d.mts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +40 -18
- package/dist/internal.mjs +1 -1
- package/dist/{loaded-LMF4JLYG.mjs → loaded-4XVG2RKQ.mjs} +4 -4
- package/dist/{loaded-FVWRAJR3.css → loaded-CA3Q7UHH.css} +7 -7
- package/dist/{loaded-IFFZACEG.mjs → loaded-LM723CWI.mjs} +4 -4
- package/dist/{loaded-SJJPEREQ.mjs → loaded-VBJBTUSI.mjs} +4 -4
- package/dist/no-external.css +308 -111
- package/dist/no-external.d.mts +4 -4
- package/dist/no-external.d.ts +4 -4
- package/dist/no-external.js +2352 -809
- package/dist/no-external.mjs +10 -10
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +1 -0
- package/dist/rsc.mjs +2 -2
- package/dist/{walk-tree-CWrsBHHe.d.ts → walk-tree-ConR82Y6.d.ts} +1 -1
- package/dist/{walk-tree-BrW9VQ_t.d.mts → walk-tree-DJMo6GTF.d.mts} +1 -1
- package/package.json +1 -1
- package/dist/index-B1b1cFug.d.ts +0 -117
- package/dist/index-ClzBCbx_.d.mts +0 -117
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
generateId,
|
|
4
4
|
getItem,
|
|
5
5
|
makeStatePublic
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UAWUZ45G.mjs";
|
|
7
7
|
import {
|
|
8
8
|
defaultAppState,
|
|
9
9
|
defaultViewports,
|
|
10
10
|
getChanged,
|
|
11
11
|
resolveComponentData
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NPAYGEG5.mjs";
|
|
13
13
|
import {
|
|
14
14
|
get_class_name_factory_default
|
|
15
15
|
} from "./chunk-Y2EFNT5P.mjs";
|
|
@@ -243,6 +243,13 @@ var ChevronRight = createLucideIcon("ChevronRight", [
|
|
|
243
243
|
init_react_import();
|
|
244
244
|
var ChevronUp = createLucideIcon("ChevronUp", [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]]);
|
|
245
245
|
|
|
246
|
+
// ../../node_modules/lucide-react/dist/esm/icons/chevrons-down-up.js
|
|
247
|
+
init_react_import();
|
|
248
|
+
var ChevronsDownUp = createLucideIcon("ChevronsDownUp", [
|
|
249
|
+
["path", { d: "m7 20 5-5 5 5", key: "13a0gw" }],
|
|
250
|
+
["path", { d: "m7 4 5 5 5-5", key: "1kwcof" }]
|
|
251
|
+
]);
|
|
252
|
+
|
|
246
253
|
// ../../node_modules/lucide-react/dist/esm/icons/circle-check-big.js
|
|
247
254
|
init_react_import();
|
|
248
255
|
var CircleCheckBig = createLucideIcon("CircleCheckBig", [
|
|
@@ -1134,7 +1141,7 @@ var useRegisterFieldsSlice = (appStore, id) => {
|
|
|
1134
1141
|
const componentData = node == null ? void 0 : node.data;
|
|
1135
1142
|
const parentNode = (node == null ? void 0 : node.parentId) ? nodes[node.parentId] : null;
|
|
1136
1143
|
const parent = (parentNode == null ? void 0 : parentNode.data) || null;
|
|
1137
|
-
const { getComponentConfig, state } = appStore.getState();
|
|
1144
|
+
const { getComponentConfig, state, config } = appStore.getState();
|
|
1138
1145
|
const componentConfig = getComponentConfig(componentData == null ? void 0 : componentData.type);
|
|
1139
1146
|
if (!componentData || !componentConfig) return;
|
|
1140
1147
|
const defaultFields = componentConfig.fields || {};
|
|
@@ -1167,6 +1174,9 @@ var useRegisterFieldsSlice = (appStore, id) => {
|
|
|
1167
1174
|
if (((_b = appStore.getState().selectedItem) == null ? void 0 : _b.props.id) !== id) {
|
|
1168
1175
|
return;
|
|
1169
1176
|
}
|
|
1177
|
+
if (appStore.getState().config !== config) {
|
|
1178
|
+
return;
|
|
1179
|
+
}
|
|
1170
1180
|
appStore.setState({
|
|
1171
1181
|
fields: {
|
|
1172
1182
|
fields: newFields,
|
|
@@ -1185,10 +1195,18 @@ var useRegisterFieldsSlice = (appStore, id) => {
|
|
|
1185
1195
|
);
|
|
1186
1196
|
useEffect4(() => {
|
|
1187
1197
|
resolveFields(true);
|
|
1188
|
-
|
|
1198
|
+
const unsubscribeData = appStore.subscribe(
|
|
1189
1199
|
(s) => s.state.indexes.nodes[id || "root"],
|
|
1190
1200
|
() => resolveFields()
|
|
1191
1201
|
);
|
|
1202
|
+
const unsubscribeConfig = appStore.subscribe(
|
|
1203
|
+
(s) => s.config,
|
|
1204
|
+
() => resolveFields(true)
|
|
1205
|
+
);
|
|
1206
|
+
return () => {
|
|
1207
|
+
unsubscribeData();
|
|
1208
|
+
unsubscribeConfig();
|
|
1209
|
+
};
|
|
1192
1210
|
}, [id]);
|
|
1193
1211
|
};
|
|
1194
1212
|
|
|
@@ -1234,6 +1252,8 @@ var createAppStore = (initialAppStore) => create2()(
|
|
|
1234
1252
|
_experimentalFullScreenCanvas: false,
|
|
1235
1253
|
_experimentalVirtualization: false,
|
|
1236
1254
|
metadata: {},
|
|
1255
|
+
dictionary: {},
|
|
1256
|
+
dnd: {},
|
|
1237
1257
|
fieldTransforms: {}
|
|
1238
1258
|
}, initialAppStore), {
|
|
1239
1259
|
fields: createFieldsSlice(set, get),
|
|
@@ -1417,7 +1437,7 @@ import { forwardRef as forwardRef4, useState } from "react";
|
|
|
1417
1437
|
|
|
1418
1438
|
// css-module:/home/runner/work/puck/puck/packages/core/components/IconButton/IconButton.module.css#css-module
|
|
1419
1439
|
init_react_import();
|
|
1420
|
-
var IconButton_module_default = { "IconButton": "
|
|
1440
|
+
var IconButton_module_default = { "IconButton": "_IconButton_1pxxt_1", "IconButton--active": "_IconButton--active_1pxxt_15", "IconButton--disabled": "_IconButton--disabled_1pxxt_28" };
|
|
1421
1441
|
|
|
1422
1442
|
// components/Loader/index.tsx
|
|
1423
1443
|
init_react_import();
|
|
@@ -1620,6 +1640,110 @@ var useResetAutoZoom = (frameRef) => {
|
|
|
1620
1640
|
init_react_import();
|
|
1621
1641
|
var styles_module_default2 = { "Loader": "_Loader_1w5zn_13", "loader-animation": "_loader-animation_1w5zn_1" };
|
|
1622
1642
|
|
|
1643
|
+
// lib/use-message.ts
|
|
1644
|
+
init_react_import();
|
|
1645
|
+
|
|
1646
|
+
// lib/dictionary.ts
|
|
1647
|
+
init_react_import();
|
|
1648
|
+
var defaultDictionary = {
|
|
1649
|
+
// Header
|
|
1650
|
+
"header-publish": "Publish",
|
|
1651
|
+
"header-undo": "undo",
|
|
1652
|
+
"header-redo": "redo",
|
|
1653
|
+
"header-toggle-leftsidebar": "Toggle left sidebar",
|
|
1654
|
+
"header-toggle-rightsidebar": "Toggle right sidebar",
|
|
1655
|
+
"header-toggle-menubar": "Toggle menu bar",
|
|
1656
|
+
// Component action bar
|
|
1657
|
+
"action-selectparent": "Select parent",
|
|
1658
|
+
"action-duplicate": "Duplicate",
|
|
1659
|
+
"action-delete": "Delete",
|
|
1660
|
+
// Fallback labels — shared by the breadcrumbs, fields panel and header
|
|
1661
|
+
"label-page": "Page",
|
|
1662
|
+
"label-component": "Component",
|
|
1663
|
+
// Outline
|
|
1664
|
+
"outline-empty": "No items",
|
|
1665
|
+
"outline-item-collapse": "Collapse",
|
|
1666
|
+
"outline-item-expand": "Expand",
|
|
1667
|
+
"outline-header-title": "Outline",
|
|
1668
|
+
"outline-header-collapseall": "Collapse all",
|
|
1669
|
+
"outline-item-duplicate": "Duplicate",
|
|
1670
|
+
"outline-item-delete": "Delete",
|
|
1671
|
+
// Drawer (component list)
|
|
1672
|
+
"drawer-category-collapse": "Collapse {title}",
|
|
1673
|
+
"drawer-category-expand": "Expand {title}",
|
|
1674
|
+
"drawer-category-other": "Other",
|
|
1675
|
+
// Canvas
|
|
1676
|
+
"canvas-noconfig": "No configuration for {type}",
|
|
1677
|
+
// Fields
|
|
1678
|
+
"field-readonly": "Read-only",
|
|
1679
|
+
"field-arrayitem-summary": "Item #{index}",
|
|
1680
|
+
"field-arrayitem-duplicate": "Duplicate",
|
|
1681
|
+
"field-arrayitem-delete": "Delete",
|
|
1682
|
+
"field-external-selectdata": "Select data",
|
|
1683
|
+
"field-external-search": "Search",
|
|
1684
|
+
"field-external-togglefilters": "Toggle filters",
|
|
1685
|
+
"field-external-item": "External item",
|
|
1686
|
+
"field-external-result-singular": "{count} result",
|
|
1687
|
+
"field-external-result-plural": "{count} results",
|
|
1688
|
+
// Rich text field
|
|
1689
|
+
"field-richtext-bold": "Bold",
|
|
1690
|
+
"field-richtext-italic": "Italic",
|
|
1691
|
+
"field-richtext-underline": "Underline",
|
|
1692
|
+
"field-richtext-strikethrough": "Strikethrough",
|
|
1693
|
+
"field-richtext-blockquote": "Blockquote",
|
|
1694
|
+
"field-richtext-code-inline": "Inline code",
|
|
1695
|
+
"field-richtext-code-block": "Code block",
|
|
1696
|
+
"field-richtext-list-bullet": "Bullet list",
|
|
1697
|
+
"field-richtext-list-ordered": "Ordered list",
|
|
1698
|
+
"field-richtext-horizontalrule": "Horizontal rule",
|
|
1699
|
+
"field-richtext-align-left": "Align left",
|
|
1700
|
+
"field-richtext-align-center": "Align center",
|
|
1701
|
+
"field-richtext-align-right": "Align right",
|
|
1702
|
+
"field-richtext-align-justify": "Justify",
|
|
1703
|
+
"field-richtext-select": "Select",
|
|
1704
|
+
"field-richtext-headingselect-1": "Heading 1",
|
|
1705
|
+
"field-richtext-headingselect-2": "Heading 2",
|
|
1706
|
+
"field-richtext-headingselect-3": "Heading 3",
|
|
1707
|
+
"field-richtext-headingselect-4": "Heading 4",
|
|
1708
|
+
"field-richtext-headingselect-5": "Heading 5",
|
|
1709
|
+
"field-richtext-headingselect-6": "Heading 6",
|
|
1710
|
+
"field-richtext-alignselect-left": "Left",
|
|
1711
|
+
"field-richtext-alignselect-center": "Center",
|
|
1712
|
+
"field-richtext-alignselect-right": "Right",
|
|
1713
|
+
"field-richtext-alignselect-justify": "Justify",
|
|
1714
|
+
"field-richtext-listselect-bullet": "Bullet list",
|
|
1715
|
+
"field-richtext-listselect-ordered": "Ordered list",
|
|
1716
|
+
// Viewport controls
|
|
1717
|
+
"viewport-zoom-in": "Zoom viewport in",
|
|
1718
|
+
"viewport-zoom-out": "Zoom viewport out",
|
|
1719
|
+
"viewport-zoom-auto": "{zoom}% (Auto)",
|
|
1720
|
+
"viewport-toggle-menu": "Toggle viewport menu",
|
|
1721
|
+
"viewport-switch": "Switch to {label} viewport",
|
|
1722
|
+
"viewport-switch-default": "Switch viewport",
|
|
1723
|
+
// Plugin bar
|
|
1724
|
+
"plugin-blocks": "Blocks",
|
|
1725
|
+
"plugin-outline": "Outline",
|
|
1726
|
+
"plugin-fields": "Fields",
|
|
1727
|
+
"plugin-components": "Components",
|
|
1728
|
+
// Layout
|
|
1729
|
+
"layout-maximize": "maximize",
|
|
1730
|
+
"layout-minimize": "minimize",
|
|
1731
|
+
// Loader
|
|
1732
|
+
"loader-loading": "loading"
|
|
1733
|
+
};
|
|
1734
|
+
var interpolate = (template, params) => template.replace(
|
|
1735
|
+
/\{(\w+)\}/g,
|
|
1736
|
+
(match, key) => params[key] !== void 0 ? String(params[key]) : match
|
|
1737
|
+
);
|
|
1738
|
+
var getMessage = (dictionary, key, params) => {
|
|
1739
|
+
var _a;
|
|
1740
|
+
const message = (_a = dictionary[key]) != null ? _a : defaultDictionary[key];
|
|
1741
|
+
return params ? interpolate(message, params) : message;
|
|
1742
|
+
};
|
|
1743
|
+
|
|
1744
|
+
// lib/use-message.ts
|
|
1745
|
+
var useMessage = (key, params) => useAppStore((s) => getMessage(s.dictionary, key, params));
|
|
1746
|
+
|
|
1623
1747
|
// components/Loader/index.tsx
|
|
1624
1748
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
1625
1749
|
var getClassName2 = get_class_name_factory_default("Loader", styles_module_default2);
|
|
@@ -1631,6 +1755,7 @@ var Loader = (_a) => {
|
|
|
1631
1755
|
"color",
|
|
1632
1756
|
"size"
|
|
1633
1757
|
]);
|
|
1758
|
+
const loadingLabel = useMessage("loader-loading");
|
|
1634
1759
|
return /* @__PURE__ */ jsx2(
|
|
1635
1760
|
"span",
|
|
1636
1761
|
__spreadValues({
|
|
@@ -1640,7 +1765,7 @@ var Loader = (_a) => {
|
|
|
1640
1765
|
height: size,
|
|
1641
1766
|
color
|
|
1642
1767
|
},
|
|
1643
|
-
"aria-label":
|
|
1768
|
+
"aria-label": loadingLabel
|
|
1644
1769
|
}, props)
|
|
1645
1770
|
);
|
|
1646
1771
|
};
|
|
@@ -1767,6 +1892,7 @@ var Select = ({
|
|
|
1767
1892
|
disabled = false
|
|
1768
1893
|
}) => {
|
|
1769
1894
|
const [open, setOpen] = useState2(false);
|
|
1895
|
+
const selectLabel = useMessage("field-richtext-select");
|
|
1770
1896
|
const hasOptions = options.length > 0;
|
|
1771
1897
|
const isDisabled = disabled || !hasOptions;
|
|
1772
1898
|
const buttonInner = /* @__PURE__ */ jsxs3("div", { className: getClassName4("buttonInner"), children: [
|
|
@@ -1776,7 +1902,7 @@ var Select = ({
|
|
|
1776
1902
|
const trigger = mode === "actionBar" ? /* @__PURE__ */ jsx4(Action, { active: value !== defaultValue, disabled: isDisabled, children: buttonInner }) : /* @__PURE__ */ jsx4(
|
|
1777
1903
|
IconButton,
|
|
1778
1904
|
{
|
|
1779
|
-
title:
|
|
1905
|
+
title: selectLabel,
|
|
1780
1906
|
active: value !== defaultValue,
|
|
1781
1907
|
disabled: isDisabled,
|
|
1782
1908
|
children: buttonInner
|
|
@@ -1860,6 +1986,7 @@ export {
|
|
|
1860
1986
|
ChevronDown,
|
|
1861
1987
|
ChevronRight,
|
|
1862
1988
|
ChevronUp,
|
|
1989
|
+
ChevronsDownUp,
|
|
1863
1990
|
CircleCheckBig,
|
|
1864
1991
|
Code,
|
|
1865
1992
|
Copy,
|
|
@@ -1922,6 +2049,7 @@ export {
|
|
|
1922
2049
|
useAppStoreApi,
|
|
1923
2050
|
getBox,
|
|
1924
2051
|
useResetAutoZoom,
|
|
2052
|
+
useMessage,
|
|
1925
2053
|
Loader,
|
|
1926
2054
|
IconButton,
|
|
1927
2055
|
ControlContext,
|
|
@@ -1944,6 +2072,7 @@ lucide-react/dist/esm/icons/bold.js:
|
|
|
1944
2072
|
lucide-react/dist/esm/icons/chevron-down.js:
|
|
1945
2073
|
lucide-react/dist/esm/icons/chevron-right.js:
|
|
1946
2074
|
lucide-react/dist/esm/icons/chevron-up.js:
|
|
2075
|
+
lucide-react/dist/esm/icons/chevrons-down-up.js:
|
|
1947
2076
|
lucide-react/dist/esm/icons/circle-check-big.js:
|
|
1948
2077
|
lucide-react/dist/esm/icons/code.js:
|
|
1949
2078
|
lucide-react/dist/esm/icons/copy.js:
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
List,
|
|
3
|
-
ListOrdered
|
|
4
|
-
|
|
3
|
+
ListOrdered,
|
|
4
|
+
useMessage
|
|
5
|
+
} from "./chunk-DIYX54ZO.mjs";
|
|
5
6
|
import {
|
|
6
7
|
init_react_import
|
|
7
8
|
} from "./chunk-M6W7YEVX.mjs";
|
|
@@ -9,11 +10,17 @@ import {
|
|
|
9
10
|
// components/RichTextMenu/controls/ListSelect/use-options.ts
|
|
10
11
|
init_react_import();
|
|
11
12
|
import { useMemo } from "react";
|
|
12
|
-
var
|
|
13
|
-
ul:
|
|
14
|
-
ol:
|
|
13
|
+
var optionIcons = {
|
|
14
|
+
ul: List,
|
|
15
|
+
ol: ListOrdered
|
|
15
16
|
};
|
|
16
17
|
var useListOptions = (fieldOptions) => {
|
|
18
|
+
const ulString = useMessage("field-richtext-listselect-bullet");
|
|
19
|
+
const olString = useMessage("field-richtext-listselect-ordered");
|
|
20
|
+
const optionLabels = {
|
|
21
|
+
ul: ulString,
|
|
22
|
+
ol: olString
|
|
23
|
+
};
|
|
17
24
|
let blockOptions = [];
|
|
18
25
|
if ((fieldOptions == null ? void 0 : fieldOptions.listItem) !== false) {
|
|
19
26
|
blockOptions = ["ul", "ol"];
|
|
@@ -21,10 +28,10 @@ var useListOptions = (fieldOptions) => {
|
|
|
21
28
|
return useMemo(
|
|
22
29
|
() => blockOptions.map((item) => ({
|
|
23
30
|
value: item,
|
|
24
|
-
label:
|
|
25
|
-
icon:
|
|
31
|
+
label: optionLabels[item],
|
|
32
|
+
icon: optionIcons[item]
|
|
26
33
|
})),
|
|
27
|
-
[blockOptions]
|
|
34
|
+
[blockOptions, optionLabels]
|
|
28
35
|
);
|
|
29
36
|
};
|
|
30
37
|
|
|
@@ -4,8 +4,9 @@ import {
|
|
|
4
4
|
Heading3,
|
|
5
5
|
Heading4,
|
|
6
6
|
Heading5,
|
|
7
|
-
Heading6
|
|
8
|
-
|
|
7
|
+
Heading6,
|
|
8
|
+
useMessage
|
|
9
|
+
} from "./chunk-DIYX54ZO.mjs";
|
|
9
10
|
import {
|
|
10
11
|
init_react_import
|
|
11
12
|
} from "./chunk-M6W7YEVX.mjs";
|
|
@@ -13,16 +14,30 @@ import {
|
|
|
13
14
|
// components/RichTextMenu/controls/HeadingSelect/use-options.ts
|
|
14
15
|
init_react_import();
|
|
15
16
|
import { useMemo } from "react";
|
|
16
|
-
var
|
|
17
|
-
h1:
|
|
18
|
-
h2:
|
|
19
|
-
h3:
|
|
20
|
-
h4:
|
|
21
|
-
h5:
|
|
22
|
-
h6:
|
|
17
|
+
var optionIcons = {
|
|
18
|
+
h1: Heading1,
|
|
19
|
+
h2: Heading2,
|
|
20
|
+
h3: Heading3,
|
|
21
|
+
h4: Heading4,
|
|
22
|
+
h5: Heading5,
|
|
23
|
+
h6: Heading6
|
|
23
24
|
};
|
|
24
25
|
var useHeadingOptions = (fieldOptions) => {
|
|
25
26
|
var _a;
|
|
27
|
+
const h1String = useMessage("field-richtext-headingselect-1");
|
|
28
|
+
const h2String = useMessage("field-richtext-headingselect-2");
|
|
29
|
+
const h3String = useMessage("field-richtext-headingselect-3");
|
|
30
|
+
const h4String = useMessage("field-richtext-headingselect-4");
|
|
31
|
+
const h5String = useMessage("field-richtext-headingselect-5");
|
|
32
|
+
const h6String = useMessage("field-richtext-headingselect-6");
|
|
33
|
+
const optionLabels = {
|
|
34
|
+
h1: h1String,
|
|
35
|
+
h2: h2String,
|
|
36
|
+
h3: h3String,
|
|
37
|
+
h4: h4String,
|
|
38
|
+
h5: h5String,
|
|
39
|
+
h6: h6String
|
|
40
|
+
};
|
|
26
41
|
let blockOptions = [];
|
|
27
42
|
if ((fieldOptions == null ? void 0 : fieldOptions.heading) !== false) {
|
|
28
43
|
if (!((_a = fieldOptions == null ? void 0 : fieldOptions.heading) == null ? void 0 : _a.levels)) {
|
|
@@ -51,10 +66,10 @@ var useHeadingOptions = (fieldOptions) => {
|
|
|
51
66
|
return useMemo(
|
|
52
67
|
() => blockOptions.map((item) => ({
|
|
53
68
|
value: item,
|
|
54
|
-
label:
|
|
55
|
-
icon:
|
|
69
|
+
label: optionLabels[item],
|
|
70
|
+
icon: optionIcons[item]
|
|
56
71
|
})),
|
|
57
|
-
[blockOptions]
|
|
72
|
+
[blockOptions, optionLabels]
|
|
58
73
|
);
|
|
59
74
|
};
|
|
60
75
|
|
|
@@ -2,8 +2,9 @@ import {
|
|
|
2
2
|
AlignCenter,
|
|
3
3
|
AlignJustify,
|
|
4
4
|
AlignLeft,
|
|
5
|
-
AlignRight
|
|
6
|
-
|
|
5
|
+
AlignRight,
|
|
6
|
+
useMessage
|
|
7
|
+
} from "./chunk-DIYX54ZO.mjs";
|
|
7
8
|
import {
|
|
8
9
|
init_react_import
|
|
9
10
|
} from "./chunk-M6W7YEVX.mjs";
|
|
@@ -11,14 +12,24 @@ import {
|
|
|
11
12
|
// components/RichTextMenu/controls/AlignSelect/use-options.ts
|
|
12
13
|
init_react_import();
|
|
13
14
|
import { useMemo } from "react";
|
|
14
|
-
var
|
|
15
|
-
left:
|
|
16
|
-
center:
|
|
17
|
-
right:
|
|
18
|
-
justify:
|
|
15
|
+
var optionIcons = {
|
|
16
|
+
left: AlignLeft,
|
|
17
|
+
center: AlignCenter,
|
|
18
|
+
right: AlignRight,
|
|
19
|
+
justify: AlignJustify
|
|
19
20
|
};
|
|
20
21
|
var useAlignOptions = (fieldOptions) => {
|
|
21
22
|
var _a;
|
|
23
|
+
const leftString = useMessage("field-richtext-alignselect-left");
|
|
24
|
+
const centerString = useMessage("field-richtext-alignselect-center");
|
|
25
|
+
const rightString = useMessage("field-richtext-alignselect-right");
|
|
26
|
+
const justifyString = useMessage("field-richtext-alignselect-justify");
|
|
27
|
+
const optionLabels = {
|
|
28
|
+
left: leftString,
|
|
29
|
+
center: centerString,
|
|
30
|
+
right: rightString,
|
|
31
|
+
justify: justifyString
|
|
32
|
+
};
|
|
22
33
|
let blockOptions = [];
|
|
23
34
|
if ((fieldOptions == null ? void 0 : fieldOptions.textAlign) !== false) {
|
|
24
35
|
if (!((_a = fieldOptions == null ? void 0 : fieldOptions.textAlign) == null ? void 0 : _a.alignments)) {
|
|
@@ -41,10 +52,10 @@ var useAlignOptions = (fieldOptions) => {
|
|
|
41
52
|
return useMemo(
|
|
42
53
|
() => blockOptions.map((item) => ({
|
|
43
54
|
value: item,
|
|
44
|
-
label:
|
|
45
|
-
icon:
|
|
55
|
+
label: optionLabels[item],
|
|
56
|
+
icon: optionIcons[item]
|
|
46
57
|
})),
|
|
47
|
-
[blockOptions]
|
|
58
|
+
[blockOptions, optionLabels]
|
|
48
59
|
);
|
|
49
60
|
};
|
|
50
61
|
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
} from "./chunk-H635BA2V.mjs";
|
|
4
4
|
import {
|
|
5
5
|
LoadedRichTextMenuInner
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3OLRWMRO.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useAppStore,
|
|
9
9
|
useAppStoreApi
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-DIYX54ZO.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-67VCA5MX.mjs").then((m) => ({
|
|
104
104
|
default: m.LoadedRichTextMenuFull
|
|
105
105
|
}))
|
|
106
106
|
);
|