@puckeditor/core 0.22.1 → 0.23.0-canary.7ca16bcb
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-MXSH3OSX.mjs → Editor-V2RQPQAL.mjs} +6 -6
- package/dist/{chunk-54LFCIWQ.mjs → chunk-2KHLVDRT.mjs} +119 -4
- package/dist/{chunk-6PIQFZBM.mjs → chunk-D6RLJXOY.mjs} +265 -144
- package/dist/{chunk-DATOBXTJ.mjs → chunk-EQADD6J2.mjs} +15 -8
- package/dist/{chunk-2AATV7NG.mjs → chunk-G3YMTKUD.mjs} +21 -10
- package/dist/{chunk-73XKHVBN.mjs → chunk-OI2LQGRV.mjs} +37 -22
- package/dist/{chunk-VOB4L2BJ.mjs → chunk-WABMBXFK.mjs} +3 -3
- package/dist/{chunk-BVKXFA4V.mjs → chunk-X4NMPUXH.mjs} +27 -12
- package/dist/{full-7JVAMOPS.mjs → full-GSJGH3OO.mjs} +5 -5
- package/dist/{index-ClzBCbx_.d.mts → index-De5Tn61v.d.mts} +85 -1
- package/dist/{index-B1b1cFug.d.ts → index-t7c1w81O.d.ts} +85 -1
- package/dist/index.d.mts +20 -5
- package/dist/index.d.ts +20 -5
- package/dist/index.js +465 -137
- package/dist/index.mjs +7 -7
- package/dist/internal.d.mts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/{loaded-B7563MDT.mjs → loaded-7EVGM4NA.mjs} +2 -2
- package/dist/{loaded-EFZRGV2Y.mjs → loaded-A7IXFU7M.mjs} +2 -2
- package/dist/{loaded-HECCGJKO.mjs → loaded-QAIOZVXW.mjs} +2 -2
- package/dist/no-external.d.mts +2 -2
- package/dist/no-external.d.ts +2 -2
- package/dist/no-external.js +465 -137
- package/dist/no-external.mjs +7 -7
- package/package.json +1 -1
package/dist/no-external.js
CHANGED
|
@@ -3141,7 +3141,7 @@ var init_fields = __esm({
|
|
|
3141
3141
|
const componentData = node == null ? void 0 : node.data;
|
|
3142
3142
|
const parentNode = (node == null ? void 0 : node.parentId) ? nodes[node.parentId] : null;
|
|
3143
3143
|
const parent = (parentNode == null ? void 0 : parentNode.data) || null;
|
|
3144
|
-
const { getComponentConfig, state } = appStore.getState();
|
|
3144
|
+
const { getComponentConfig, state, config } = appStore.getState();
|
|
3145
3145
|
const componentConfig = getComponentConfig(componentData == null ? void 0 : componentData.type);
|
|
3146
3146
|
if (!componentData || !componentConfig) return;
|
|
3147
3147
|
const defaultFields2 = componentConfig.fields || {};
|
|
@@ -3174,6 +3174,9 @@ var init_fields = __esm({
|
|
|
3174
3174
|
if (((_b = appStore.getState().selectedItem) == null ? void 0 : _b.props.id) !== id) {
|
|
3175
3175
|
return;
|
|
3176
3176
|
}
|
|
3177
|
+
if (appStore.getState().config !== config) {
|
|
3178
|
+
return;
|
|
3179
|
+
}
|
|
3177
3180
|
appStore.setState({
|
|
3178
3181
|
fields: {
|
|
3179
3182
|
fields: newFields,
|
|
@@ -3192,10 +3195,18 @@ var init_fields = __esm({
|
|
|
3192
3195
|
);
|
|
3193
3196
|
(0, import_react10.useEffect)(() => {
|
|
3194
3197
|
resolveFields(true);
|
|
3195
|
-
|
|
3198
|
+
const unsubscribeData = appStore.subscribe(
|
|
3196
3199
|
(s) => s.state.indexes.nodes[id || "root"],
|
|
3197
3200
|
() => resolveFields()
|
|
3198
3201
|
);
|
|
3202
|
+
const unsubscribeConfig = appStore.subscribe(
|
|
3203
|
+
(s) => s.config,
|
|
3204
|
+
() => resolveFields(true)
|
|
3205
|
+
);
|
|
3206
|
+
return () => {
|
|
3207
|
+
unsubscribeData();
|
|
3208
|
+
unsubscribeConfig();
|
|
3209
|
+
};
|
|
3199
3210
|
}, [id]);
|
|
3200
3211
|
};
|
|
3201
3212
|
}
|
|
@@ -3402,6 +3413,7 @@ var init_store = __esm({
|
|
|
3402
3413
|
_experimentalFullScreenCanvas: false,
|
|
3403
3414
|
_experimentalVirtualization: false,
|
|
3404
3415
|
metadata: {},
|
|
3416
|
+
dictionary: {},
|
|
3405
3417
|
fieldTransforms: {}
|
|
3406
3418
|
}, initialAppStore), {
|
|
3407
3419
|
fields: createFieldsSlice(set, get),
|
|
@@ -3796,6 +3808,118 @@ var init_styles_module2 = __esm({
|
|
|
3796
3808
|
}
|
|
3797
3809
|
});
|
|
3798
3810
|
|
|
3811
|
+
// lib/dictionary.ts
|
|
3812
|
+
var defaultDictionary, interpolate, getMessage;
|
|
3813
|
+
var init_dictionary = __esm({
|
|
3814
|
+
"lib/dictionary.ts"() {
|
|
3815
|
+
"use strict";
|
|
3816
|
+
init_react_import();
|
|
3817
|
+
defaultDictionary = {
|
|
3818
|
+
// Header
|
|
3819
|
+
"header-publish": "Publish",
|
|
3820
|
+
"header-undo": "undo",
|
|
3821
|
+
"header-redo": "redo",
|
|
3822
|
+
"header-toggle-leftsidebar": "Toggle left sidebar",
|
|
3823
|
+
"header-toggle-rightsidebar": "Toggle right sidebar",
|
|
3824
|
+
"header-toggle-menubar": "Toggle menu bar",
|
|
3825
|
+
// Component action bar
|
|
3826
|
+
"action-selectparent": "Select parent",
|
|
3827
|
+
"action-duplicate": "Duplicate",
|
|
3828
|
+
"action-delete": "Delete",
|
|
3829
|
+
// Fallback labels — shared by the breadcrumbs, fields panel and header
|
|
3830
|
+
"label-page": "Page",
|
|
3831
|
+
"label-component": "Component",
|
|
3832
|
+
// Outline
|
|
3833
|
+
"outline-empty": "No items",
|
|
3834
|
+
"outline-collapse": "Collapse",
|
|
3835
|
+
"outline-expand": "Expand",
|
|
3836
|
+
// Drawer (component list)
|
|
3837
|
+
"drawer-category-collapse": "Collapse {title}",
|
|
3838
|
+
"drawer-category-expand": "Expand {title}",
|
|
3839
|
+
"drawer-category-other": "Other",
|
|
3840
|
+
// Canvas
|
|
3841
|
+
"canvas-noconfig": "No configuration for {type}",
|
|
3842
|
+
// Fields
|
|
3843
|
+
"field-readonly": "Read-only",
|
|
3844
|
+
"field-arrayitem-summary": "Item #{index}",
|
|
3845
|
+
"field-arrayitem-duplicate": "Duplicate",
|
|
3846
|
+
"field-arrayitem-delete": "Delete",
|
|
3847
|
+
"field-external-selectdata": "Select data",
|
|
3848
|
+
"field-external-search": "Search",
|
|
3849
|
+
"field-external-togglefilters": "Toggle filters",
|
|
3850
|
+
"field-external-item": "External item",
|
|
3851
|
+
"field-external-result-singular": "{count} result",
|
|
3852
|
+
"field-external-result-plural": "{count} results",
|
|
3853
|
+
// Rich text field
|
|
3854
|
+
"field-richtext-bold": "Bold",
|
|
3855
|
+
"field-richtext-italic": "Italic",
|
|
3856
|
+
"field-richtext-underline": "Underline",
|
|
3857
|
+
"field-richtext-strikethrough": "Strikethrough",
|
|
3858
|
+
"field-richtext-blockquote": "Blockquote",
|
|
3859
|
+
"field-richtext-code-inline": "Inline code",
|
|
3860
|
+
"field-richtext-code-block": "Code block",
|
|
3861
|
+
"field-richtext-list-bullet": "Bullet list",
|
|
3862
|
+
"field-richtext-list-ordered": "Ordered list",
|
|
3863
|
+
"field-richtext-horizontalrule": "Horizontal rule",
|
|
3864
|
+
"field-richtext-align-left": "Align left",
|
|
3865
|
+
"field-richtext-align-center": "Align center",
|
|
3866
|
+
"field-richtext-align-right": "Align right",
|
|
3867
|
+
"field-richtext-align-justify": "Justify",
|
|
3868
|
+
"field-richtext-select": "Select",
|
|
3869
|
+
"field-richtext-headingselect-1": "Heading 1",
|
|
3870
|
+
"field-richtext-headingselect-2": "Heading 2",
|
|
3871
|
+
"field-richtext-headingselect-3": "Heading 3",
|
|
3872
|
+
"field-richtext-headingselect-4": "Heading 4",
|
|
3873
|
+
"field-richtext-headingselect-5": "Heading 5",
|
|
3874
|
+
"field-richtext-headingselect-6": "Heading 6",
|
|
3875
|
+
"field-richtext-alignselect-left": "Left",
|
|
3876
|
+
"field-richtext-alignselect-center": "Center",
|
|
3877
|
+
"field-richtext-alignselect-right": "Right",
|
|
3878
|
+
"field-richtext-alignselect-justify": "Justify",
|
|
3879
|
+
"field-richtext-listselect-bullet": "Bullet list",
|
|
3880
|
+
"field-richtext-listselect-ordered": "Ordered list",
|
|
3881
|
+
// Viewport controls
|
|
3882
|
+
"viewport-zoom-in": "Zoom viewport in",
|
|
3883
|
+
"viewport-zoom-out": "Zoom viewport out",
|
|
3884
|
+
"viewport-zoom-auto": "{zoom}% (Auto)",
|
|
3885
|
+
"viewport-toggle-menu": "Toggle viewport menu",
|
|
3886
|
+
"viewport-switch": "Switch to {label} viewport",
|
|
3887
|
+
"viewport-switch-default": "Switch viewport",
|
|
3888
|
+
// Plugin bar
|
|
3889
|
+
"plugin-blocks": "Blocks",
|
|
3890
|
+
"plugin-outline": "Outline",
|
|
3891
|
+
"plugin-fields": "Fields",
|
|
3892
|
+
"plugin-components": "Components",
|
|
3893
|
+
// Layout
|
|
3894
|
+
"layout-maximize": "maximize",
|
|
3895
|
+
"layout-minimize": "minimize",
|
|
3896
|
+
// Loader
|
|
3897
|
+
"loader-loading": "loading"
|
|
3898
|
+
};
|
|
3899
|
+
interpolate = (template, params) => template.replace(
|
|
3900
|
+
/\{(\w+)\}/g,
|
|
3901
|
+
(match, key) => params[key] !== void 0 ? String(params[key]) : match
|
|
3902
|
+
);
|
|
3903
|
+
getMessage = (dictionary, key, params) => {
|
|
3904
|
+
var _a;
|
|
3905
|
+
const message = (_a = dictionary[key]) != null ? _a : defaultDictionary[key];
|
|
3906
|
+
return params ? interpolate(message, params) : message;
|
|
3907
|
+
};
|
|
3908
|
+
}
|
|
3909
|
+
});
|
|
3910
|
+
|
|
3911
|
+
// lib/use-message.ts
|
|
3912
|
+
var useMessage;
|
|
3913
|
+
var init_use_message = __esm({
|
|
3914
|
+
"lib/use-message.ts"() {
|
|
3915
|
+
"use strict";
|
|
3916
|
+
init_react_import();
|
|
3917
|
+
init_store();
|
|
3918
|
+
init_dictionary();
|
|
3919
|
+
useMessage = (key, params) => useAppStore((s) => getMessage(s.dictionary, key, params));
|
|
3920
|
+
}
|
|
3921
|
+
});
|
|
3922
|
+
|
|
3799
3923
|
// components/Loader/index.tsx
|
|
3800
3924
|
var import_jsx_runtime3, getClassName2, Loader;
|
|
3801
3925
|
var init_Loader = __esm({
|
|
@@ -3804,6 +3928,7 @@ var init_Loader = __esm({
|
|
|
3804
3928
|
init_react_import();
|
|
3805
3929
|
init_lib();
|
|
3806
3930
|
init_styles_module2();
|
|
3931
|
+
init_use_message();
|
|
3807
3932
|
import_jsx_runtime3 = require("react/jsx-runtime");
|
|
3808
3933
|
getClassName2 = get_class_name_factory_default("Loader", styles_module_default4);
|
|
3809
3934
|
Loader = (_a) => {
|
|
@@ -3814,6 +3939,7 @@ var init_Loader = __esm({
|
|
|
3814
3939
|
"color",
|
|
3815
3940
|
"size"
|
|
3816
3941
|
]);
|
|
3942
|
+
const loadingLabel = useMessage("loader-loading");
|
|
3817
3943
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3818
3944
|
"span",
|
|
3819
3945
|
__spreadValues({
|
|
@@ -3823,7 +3949,7 @@ var init_Loader = __esm({
|
|
|
3823
3949
|
height: size,
|
|
3824
3950
|
color
|
|
3825
3951
|
},
|
|
3826
|
-
"aria-label":
|
|
3952
|
+
"aria-label": loadingLabel
|
|
3827
3953
|
}, props)
|
|
3828
3954
|
);
|
|
3829
3955
|
};
|
|
@@ -4018,6 +4144,7 @@ var init_Control = __esm({
|
|
|
4018
4144
|
// components/RichTextMenu/controls/AlignLeft.tsx
|
|
4019
4145
|
function AlignLeft2() {
|
|
4020
4146
|
const { editor, editorState } = useControlContext();
|
|
4147
|
+
const alignLeftLabel = useMessage("field-richtext-align-left");
|
|
4021
4148
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4022
4149
|
Control,
|
|
4023
4150
|
{
|
|
@@ -4028,7 +4155,7 @@ function AlignLeft2() {
|
|
|
4028
4155
|
},
|
|
4029
4156
|
disabled: !(editorState == null ? void 0 : editorState.canAlignLeft),
|
|
4030
4157
|
active: editorState == null ? void 0 : editorState.isAlignLeft,
|
|
4031
|
-
title:
|
|
4158
|
+
title: alignLeftLabel
|
|
4032
4159
|
}
|
|
4033
4160
|
);
|
|
4034
4161
|
}
|
|
@@ -4039,6 +4166,7 @@ var init_AlignLeft = __esm({
|
|
|
4039
4166
|
init_react_import();
|
|
4040
4167
|
init_lucide_react();
|
|
4041
4168
|
init_Control();
|
|
4169
|
+
init_use_message();
|
|
4042
4170
|
init_use_control_context();
|
|
4043
4171
|
import_jsx_runtime20 = require("react/jsx-runtime");
|
|
4044
4172
|
}
|
|
@@ -4047,6 +4175,7 @@ var init_AlignLeft = __esm({
|
|
|
4047
4175
|
// components/RichTextMenu/controls/AlignCenter.tsx
|
|
4048
4176
|
function AlignCenter2() {
|
|
4049
4177
|
const { editor, editorState } = useControlContext();
|
|
4178
|
+
const alignCenterLabel = useMessage("field-richtext-align-center");
|
|
4050
4179
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4051
4180
|
Control,
|
|
4052
4181
|
{
|
|
@@ -4057,7 +4186,7 @@ function AlignCenter2() {
|
|
|
4057
4186
|
},
|
|
4058
4187
|
disabled: !(editorState == null ? void 0 : editorState.canAlignCenter),
|
|
4059
4188
|
active: editorState == null ? void 0 : editorState.isAlignCenter,
|
|
4060
|
-
title:
|
|
4189
|
+
title: alignCenterLabel
|
|
4061
4190
|
}
|
|
4062
4191
|
);
|
|
4063
4192
|
}
|
|
@@ -4068,6 +4197,7 @@ var init_AlignCenter = __esm({
|
|
|
4068
4197
|
init_react_import();
|
|
4069
4198
|
init_lucide_react();
|
|
4070
4199
|
init_Control();
|
|
4200
|
+
init_use_message();
|
|
4071
4201
|
init_use_control_context();
|
|
4072
4202
|
import_jsx_runtime21 = require("react/jsx-runtime");
|
|
4073
4203
|
}
|
|
@@ -4076,6 +4206,7 @@ var init_AlignCenter = __esm({
|
|
|
4076
4206
|
// components/RichTextMenu/controls/AlignRight.tsx
|
|
4077
4207
|
function AlignRight2() {
|
|
4078
4208
|
const { editor, editorState } = useControlContext();
|
|
4209
|
+
const alignRightLabel = useMessage("field-richtext-align-right");
|
|
4079
4210
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4080
4211
|
Control,
|
|
4081
4212
|
{
|
|
@@ -4086,7 +4217,7 @@ function AlignRight2() {
|
|
|
4086
4217
|
},
|
|
4087
4218
|
disabled: !(editorState == null ? void 0 : editorState.canAlignRight),
|
|
4088
4219
|
active: editorState == null ? void 0 : editorState.isAlignRight,
|
|
4089
|
-
title:
|
|
4220
|
+
title: alignRightLabel
|
|
4090
4221
|
}
|
|
4091
4222
|
);
|
|
4092
4223
|
}
|
|
@@ -4097,6 +4228,7 @@ var init_AlignRight = __esm({
|
|
|
4097
4228
|
init_react_import();
|
|
4098
4229
|
init_lucide_react();
|
|
4099
4230
|
init_Control();
|
|
4231
|
+
init_use_message();
|
|
4100
4232
|
init_use_control_context();
|
|
4101
4233
|
import_jsx_runtime22 = require("react/jsx-runtime");
|
|
4102
4234
|
}
|
|
@@ -4105,6 +4237,7 @@ var init_AlignRight = __esm({
|
|
|
4105
4237
|
// components/RichTextMenu/controls/AlignJustify.tsx
|
|
4106
4238
|
function AlignJustify2() {
|
|
4107
4239
|
const { editor, editorState } = useControlContext();
|
|
4240
|
+
const alignJustifyLabel = useMessage("field-richtext-align-justify");
|
|
4108
4241
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4109
4242
|
Control,
|
|
4110
4243
|
{
|
|
@@ -4115,7 +4248,7 @@ function AlignJustify2() {
|
|
|
4115
4248
|
},
|
|
4116
4249
|
disabled: !(editorState == null ? void 0 : editorState.canAlignJustify),
|
|
4117
4250
|
active: editorState == null ? void 0 : editorState.isAlignJustify,
|
|
4118
|
-
title:
|
|
4251
|
+
title: alignJustifyLabel
|
|
4119
4252
|
}
|
|
4120
4253
|
);
|
|
4121
4254
|
}
|
|
@@ -4126,6 +4259,7 @@ var init_AlignJustify = __esm({
|
|
|
4126
4259
|
init_react_import();
|
|
4127
4260
|
init_lucide_react();
|
|
4128
4261
|
init_Control();
|
|
4262
|
+
init_use_message();
|
|
4129
4263
|
init_use_control_context();
|
|
4130
4264
|
import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4131
4265
|
}
|
|
@@ -4161,6 +4295,7 @@ var init_Select = __esm({
|
|
|
4161
4295
|
init_lib();
|
|
4162
4296
|
init_IconButton2();
|
|
4163
4297
|
init_ActionBar();
|
|
4298
|
+
init_use_message();
|
|
4164
4299
|
import_jsx_runtime24 = require("react/jsx-runtime");
|
|
4165
4300
|
getClassName15 = get_class_name_factory_default("Select", styles_module_default11);
|
|
4166
4301
|
getItemClassName = get_class_name_factory_default("SelectItem", styles_module_default11);
|
|
@@ -4181,6 +4316,7 @@ var init_Select = __esm({
|
|
|
4181
4316
|
disabled = false
|
|
4182
4317
|
}) => {
|
|
4183
4318
|
const [open, setOpen] = (0, import_react25.useState)(false);
|
|
4319
|
+
const selectLabel = useMessage("field-richtext-select");
|
|
4184
4320
|
const hasOptions = options.length > 0;
|
|
4185
4321
|
const isDisabled = disabled || !hasOptions;
|
|
4186
4322
|
const buttonInner = /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: getClassName15("buttonInner"), children: [
|
|
@@ -4190,7 +4326,7 @@ var init_Select = __esm({
|
|
|
4190
4326
|
const trigger = mode === "actionBar" ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Action, { active: value !== defaultValue, disabled: isDisabled, children: buttonInner }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4191
4327
|
IconButton,
|
|
4192
4328
|
{
|
|
4193
|
-
title:
|
|
4329
|
+
title: selectLabel,
|
|
4194
4330
|
active: value !== defaultValue,
|
|
4195
4331
|
disabled: isDisabled,
|
|
4196
4332
|
children: buttonInner
|
|
@@ -4273,21 +4409,32 @@ var init_SelectControl = __esm({
|
|
|
4273
4409
|
});
|
|
4274
4410
|
|
|
4275
4411
|
// components/RichTextMenu/controls/AlignSelect/use-options.ts
|
|
4276
|
-
var import_react27,
|
|
4412
|
+
var import_react27, optionIcons, useAlignOptions;
|
|
4277
4413
|
var init_use_options = __esm({
|
|
4278
4414
|
"components/RichTextMenu/controls/AlignSelect/use-options.ts"() {
|
|
4279
4415
|
"use strict";
|
|
4280
4416
|
init_react_import();
|
|
4281
4417
|
import_react27 = require("react");
|
|
4282
4418
|
init_lucide_react();
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4419
|
+
init_use_message();
|
|
4420
|
+
optionIcons = {
|
|
4421
|
+
left: AlignLeft,
|
|
4422
|
+
center: AlignCenter,
|
|
4423
|
+
right: AlignRight,
|
|
4424
|
+
justify: AlignJustify
|
|
4288
4425
|
};
|
|
4289
4426
|
useAlignOptions = (fieldOptions) => {
|
|
4290
4427
|
var _a;
|
|
4428
|
+
const leftString = useMessage("field-richtext-alignselect-left");
|
|
4429
|
+
const centerString = useMessage("field-richtext-alignselect-center");
|
|
4430
|
+
const rightString = useMessage("field-richtext-alignselect-right");
|
|
4431
|
+
const justifyString = useMessage("field-richtext-alignselect-justify");
|
|
4432
|
+
const optionLabels = {
|
|
4433
|
+
left: leftString,
|
|
4434
|
+
center: centerString,
|
|
4435
|
+
right: rightString,
|
|
4436
|
+
justify: justifyString
|
|
4437
|
+
};
|
|
4291
4438
|
let blockOptions = [];
|
|
4292
4439
|
if ((fieldOptions == null ? void 0 : fieldOptions.textAlign) !== false) {
|
|
4293
4440
|
if (!((_a = fieldOptions == null ? void 0 : fieldOptions.textAlign) == null ? void 0 : _a.alignments)) {
|
|
@@ -4310,10 +4457,10 @@ var init_use_options = __esm({
|
|
|
4310
4457
|
return (0, import_react27.useMemo)(
|
|
4311
4458
|
() => blockOptions.map((item) => ({
|
|
4312
4459
|
value: item,
|
|
4313
|
-
label:
|
|
4314
|
-
icon:
|
|
4460
|
+
label: optionLabels[item],
|
|
4461
|
+
icon: optionIcons[item]
|
|
4315
4462
|
})),
|
|
4316
|
-
[blockOptions]
|
|
4463
|
+
[blockOptions, optionLabels]
|
|
4317
4464
|
);
|
|
4318
4465
|
};
|
|
4319
4466
|
}
|
|
@@ -4422,6 +4569,7 @@ var init_AlignSelect = __esm({
|
|
|
4422
4569
|
// components/RichTextMenu/controls/Bold.tsx
|
|
4423
4570
|
function Bold2() {
|
|
4424
4571
|
const { editor, editorState } = useControlContext();
|
|
4572
|
+
const boldLabel = useMessage("field-richtext-bold");
|
|
4425
4573
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4426
4574
|
Control,
|
|
4427
4575
|
{
|
|
@@ -4432,7 +4580,7 @@ function Bold2() {
|
|
|
4432
4580
|
},
|
|
4433
4581
|
disabled: !(editorState == null ? void 0 : editorState.canBold),
|
|
4434
4582
|
active: editorState == null ? void 0 : editorState.isBold,
|
|
4435
|
-
title:
|
|
4583
|
+
title: boldLabel
|
|
4436
4584
|
}
|
|
4437
4585
|
);
|
|
4438
4586
|
}
|
|
@@ -4443,6 +4591,7 @@ var init_Bold = __esm({
|
|
|
4443
4591
|
init_react_import();
|
|
4444
4592
|
init_lucide_react();
|
|
4445
4593
|
init_Control();
|
|
4594
|
+
init_use_message();
|
|
4446
4595
|
init_use_control_context();
|
|
4447
4596
|
import_jsx_runtime29 = require("react/jsx-runtime");
|
|
4448
4597
|
}
|
|
@@ -4451,6 +4600,7 @@ var init_Bold = __esm({
|
|
|
4451
4600
|
// components/RichTextMenu/controls/Italic.tsx
|
|
4452
4601
|
function Italic2() {
|
|
4453
4602
|
const { editor, editorState } = useControlContext();
|
|
4603
|
+
const italicLabel = useMessage("field-richtext-italic");
|
|
4454
4604
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4455
4605
|
Control,
|
|
4456
4606
|
{
|
|
@@ -4461,7 +4611,7 @@ function Italic2() {
|
|
|
4461
4611
|
},
|
|
4462
4612
|
disabled: !(editorState == null ? void 0 : editorState.canItalic),
|
|
4463
4613
|
active: editorState == null ? void 0 : editorState.isItalic,
|
|
4464
|
-
title:
|
|
4614
|
+
title: italicLabel
|
|
4465
4615
|
}
|
|
4466
4616
|
);
|
|
4467
4617
|
}
|
|
@@ -4472,6 +4622,7 @@ var init_Italic = __esm({
|
|
|
4472
4622
|
init_react_import();
|
|
4473
4623
|
init_lucide_react();
|
|
4474
4624
|
init_Control();
|
|
4625
|
+
init_use_message();
|
|
4475
4626
|
init_use_control_context();
|
|
4476
4627
|
import_jsx_runtime30 = require("react/jsx-runtime");
|
|
4477
4628
|
}
|
|
@@ -4480,6 +4631,7 @@ var init_Italic = __esm({
|
|
|
4480
4631
|
// components/RichTextMenu/controls/Underline.tsx
|
|
4481
4632
|
function Underline2() {
|
|
4482
4633
|
const { editor, editorState } = useControlContext();
|
|
4634
|
+
const underlineLabel = useMessage("field-richtext-underline");
|
|
4483
4635
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4484
4636
|
Control,
|
|
4485
4637
|
{
|
|
@@ -4490,7 +4642,7 @@ function Underline2() {
|
|
|
4490
4642
|
},
|
|
4491
4643
|
disabled: !(editorState == null ? void 0 : editorState.canUnderline),
|
|
4492
4644
|
active: editorState == null ? void 0 : editorState.isUnderline,
|
|
4493
|
-
title:
|
|
4645
|
+
title: underlineLabel
|
|
4494
4646
|
}
|
|
4495
4647
|
);
|
|
4496
4648
|
}
|
|
@@ -4501,6 +4653,7 @@ var init_Underline = __esm({
|
|
|
4501
4653
|
init_react_import();
|
|
4502
4654
|
init_lucide_react();
|
|
4503
4655
|
init_Control();
|
|
4656
|
+
init_use_message();
|
|
4504
4657
|
init_use_control_context();
|
|
4505
4658
|
import_jsx_runtime31 = require("react/jsx-runtime");
|
|
4506
4659
|
}
|
|
@@ -4509,6 +4662,7 @@ var init_Underline = __esm({
|
|
|
4509
4662
|
// components/RichTextMenu/controls/Strikethrough.tsx
|
|
4510
4663
|
function Strikethrough2() {
|
|
4511
4664
|
const { editor, editorState } = useControlContext();
|
|
4665
|
+
const strikethroughLabel = useMessage("field-richtext-strikethrough");
|
|
4512
4666
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4513
4667
|
Control,
|
|
4514
4668
|
{
|
|
@@ -4519,7 +4673,7 @@ function Strikethrough2() {
|
|
|
4519
4673
|
},
|
|
4520
4674
|
disabled: !(editorState == null ? void 0 : editorState.canStrike),
|
|
4521
4675
|
active: editorState == null ? void 0 : editorState.isStrike,
|
|
4522
|
-
title:
|
|
4676
|
+
title: strikethroughLabel
|
|
4523
4677
|
}
|
|
4524
4678
|
);
|
|
4525
4679
|
}
|
|
@@ -4530,6 +4684,7 @@ var init_Strikethrough = __esm({
|
|
|
4530
4684
|
init_react_import();
|
|
4531
4685
|
init_lucide_react();
|
|
4532
4686
|
init_Control();
|
|
4687
|
+
init_use_message();
|
|
4533
4688
|
init_use_control_context();
|
|
4534
4689
|
import_jsx_runtime32 = require("react/jsx-runtime");
|
|
4535
4690
|
}
|
|
@@ -4538,6 +4693,7 @@ var init_Strikethrough = __esm({
|
|
|
4538
4693
|
// components/RichTextMenu/controls/InlineCode.tsx
|
|
4539
4694
|
function InlineCode() {
|
|
4540
4695
|
const { editor, editorState } = useControlContext();
|
|
4696
|
+
const inlineCodeLabel = useMessage("field-richtext-code-inline");
|
|
4541
4697
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4542
4698
|
Control,
|
|
4543
4699
|
{
|
|
@@ -4548,7 +4704,7 @@ function InlineCode() {
|
|
|
4548
4704
|
},
|
|
4549
4705
|
disabled: !(editorState == null ? void 0 : editorState.canInlineCode),
|
|
4550
4706
|
active: editorState == null ? void 0 : editorState.isInlineCode,
|
|
4551
|
-
title:
|
|
4707
|
+
title: inlineCodeLabel
|
|
4552
4708
|
}
|
|
4553
4709
|
);
|
|
4554
4710
|
}
|
|
@@ -4559,6 +4715,7 @@ var init_InlineCode = __esm({
|
|
|
4559
4715
|
init_react_import();
|
|
4560
4716
|
init_lucide_react();
|
|
4561
4717
|
init_Control();
|
|
4718
|
+
init_use_message();
|
|
4562
4719
|
init_use_control_context();
|
|
4563
4720
|
import_jsx_runtime33 = require("react/jsx-runtime");
|
|
4564
4721
|
}
|
|
@@ -4567,6 +4724,7 @@ var init_InlineCode = __esm({
|
|
|
4567
4724
|
// components/RichTextMenu/controls/BulletList.tsx
|
|
4568
4725
|
function BulletList() {
|
|
4569
4726
|
const { editor, editorState } = useControlContext();
|
|
4727
|
+
const bulletListLabel = useMessage("field-richtext-list-bullet");
|
|
4570
4728
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4571
4729
|
Control,
|
|
4572
4730
|
{
|
|
@@ -4577,7 +4735,7 @@ function BulletList() {
|
|
|
4577
4735
|
},
|
|
4578
4736
|
disabled: !(editorState == null ? void 0 : editorState.canBulletList),
|
|
4579
4737
|
active: editorState == null ? void 0 : editorState.isBulletList,
|
|
4580
|
-
title:
|
|
4738
|
+
title: bulletListLabel
|
|
4581
4739
|
}
|
|
4582
4740
|
);
|
|
4583
4741
|
}
|
|
@@ -4588,6 +4746,7 @@ var init_BulletList = __esm({
|
|
|
4588
4746
|
init_react_import();
|
|
4589
4747
|
init_lucide_react();
|
|
4590
4748
|
init_Control();
|
|
4749
|
+
init_use_message();
|
|
4591
4750
|
init_use_control_context();
|
|
4592
4751
|
import_jsx_runtime34 = require("react/jsx-runtime");
|
|
4593
4752
|
}
|
|
@@ -4596,6 +4755,7 @@ var init_BulletList = __esm({
|
|
|
4596
4755
|
// components/RichTextMenu/controls/OrderedList.tsx
|
|
4597
4756
|
function OrderedList() {
|
|
4598
4757
|
const { editor, editorState } = useControlContext();
|
|
4758
|
+
const orderedListLabel = useMessage("field-richtext-list-ordered");
|
|
4599
4759
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4600
4760
|
Control,
|
|
4601
4761
|
{
|
|
@@ -4606,7 +4766,7 @@ function OrderedList() {
|
|
|
4606
4766
|
},
|
|
4607
4767
|
disabled: !(editorState == null ? void 0 : editorState.canOrderedList),
|
|
4608
4768
|
active: editorState == null ? void 0 : editorState.isOrderedList,
|
|
4609
|
-
title:
|
|
4769
|
+
title: orderedListLabel
|
|
4610
4770
|
}
|
|
4611
4771
|
);
|
|
4612
4772
|
}
|
|
@@ -4617,6 +4777,7 @@ var init_OrderedList = __esm({
|
|
|
4617
4777
|
init_react_import();
|
|
4618
4778
|
init_lucide_react();
|
|
4619
4779
|
init_Control();
|
|
4780
|
+
init_use_message();
|
|
4620
4781
|
init_use_control_context();
|
|
4621
4782
|
import_jsx_runtime35 = require("react/jsx-runtime");
|
|
4622
4783
|
}
|
|
@@ -4625,6 +4786,7 @@ var init_OrderedList = __esm({
|
|
|
4625
4786
|
// components/RichTextMenu/controls/CodeBlock.tsx
|
|
4626
4787
|
function CodeBlock() {
|
|
4627
4788
|
const { editor, editorState } = useControlContext();
|
|
4789
|
+
const codeBlockLabel = useMessage("field-richtext-code-block");
|
|
4628
4790
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4629
4791
|
Control,
|
|
4630
4792
|
{
|
|
@@ -4635,7 +4797,7 @@ function CodeBlock() {
|
|
|
4635
4797
|
},
|
|
4636
4798
|
disabled: !(editorState == null ? void 0 : editorState.canCodeBlock),
|
|
4637
4799
|
active: editorState == null ? void 0 : editorState.isCodeBlock,
|
|
4638
|
-
title:
|
|
4800
|
+
title: codeBlockLabel
|
|
4639
4801
|
}
|
|
4640
4802
|
);
|
|
4641
4803
|
}
|
|
@@ -4646,6 +4808,7 @@ var init_CodeBlock = __esm({
|
|
|
4646
4808
|
init_react_import();
|
|
4647
4809
|
init_lucide_react();
|
|
4648
4810
|
init_Control();
|
|
4811
|
+
init_use_message();
|
|
4649
4812
|
init_use_control_context();
|
|
4650
4813
|
import_jsx_runtime36 = require("react/jsx-runtime");
|
|
4651
4814
|
}
|
|
@@ -4654,6 +4817,7 @@ var init_CodeBlock = __esm({
|
|
|
4654
4817
|
// components/RichTextMenu/controls/Blockquote.tsx
|
|
4655
4818
|
function Blockquote() {
|
|
4656
4819
|
const { editor, editorState } = useControlContext();
|
|
4820
|
+
const blockquoteLabel = useMessage("field-richtext-blockquote");
|
|
4657
4821
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4658
4822
|
Control,
|
|
4659
4823
|
{
|
|
@@ -4664,7 +4828,7 @@ function Blockquote() {
|
|
|
4664
4828
|
},
|
|
4665
4829
|
disabled: !(editorState == null ? void 0 : editorState.canBlockquote),
|
|
4666
4830
|
active: editorState == null ? void 0 : editorState.isBlockquote,
|
|
4667
|
-
title:
|
|
4831
|
+
title: blockquoteLabel
|
|
4668
4832
|
}
|
|
4669
4833
|
);
|
|
4670
4834
|
}
|
|
@@ -4675,6 +4839,7 @@ var init_Blockquote = __esm({
|
|
|
4675
4839
|
init_react_import();
|
|
4676
4840
|
init_lucide_react();
|
|
4677
4841
|
init_Control();
|
|
4842
|
+
init_use_message();
|
|
4678
4843
|
init_use_control_context();
|
|
4679
4844
|
import_jsx_runtime37 = require("react/jsx-runtime");
|
|
4680
4845
|
}
|
|
@@ -4683,6 +4848,7 @@ var init_Blockquote = __esm({
|
|
|
4683
4848
|
// components/RichTextMenu/controls/HorizontalRule.tsx
|
|
4684
4849
|
function HorizontalRule() {
|
|
4685
4850
|
const { editor, editorState } = useControlContext();
|
|
4851
|
+
const horizontalRuleLabel = useMessage("field-richtext-horizontalrule");
|
|
4686
4852
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4687
4853
|
Control,
|
|
4688
4854
|
{
|
|
@@ -4692,7 +4858,7 @@ function HorizontalRule() {
|
|
|
4692
4858
|
editor == null ? void 0 : editor.chain().focus().setHorizontalRule().run();
|
|
4693
4859
|
},
|
|
4694
4860
|
disabled: !(editorState == null ? void 0 : editorState.canHorizontalRule),
|
|
4695
|
-
title:
|
|
4861
|
+
title: horizontalRuleLabel
|
|
4696
4862
|
}
|
|
4697
4863
|
);
|
|
4698
4864
|
}
|
|
@@ -4703,29 +4869,45 @@ var init_HorizontalRule = __esm({
|
|
|
4703
4869
|
init_react_import();
|
|
4704
4870
|
init_lucide_react();
|
|
4705
4871
|
init_Control();
|
|
4872
|
+
init_use_message();
|
|
4706
4873
|
init_use_control_context();
|
|
4707
4874
|
import_jsx_runtime38 = require("react/jsx-runtime");
|
|
4708
4875
|
}
|
|
4709
4876
|
});
|
|
4710
4877
|
|
|
4711
4878
|
// components/RichTextMenu/controls/HeadingSelect/use-options.ts
|
|
4712
|
-
var import_react30,
|
|
4879
|
+
var import_react30, optionIcons2, useHeadingOptions;
|
|
4713
4880
|
var init_use_options2 = __esm({
|
|
4714
4881
|
"components/RichTextMenu/controls/HeadingSelect/use-options.ts"() {
|
|
4715
4882
|
"use strict";
|
|
4716
4883
|
init_react_import();
|
|
4717
4884
|
import_react30 = require("react");
|
|
4718
4885
|
init_lucide_react();
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4886
|
+
init_use_message();
|
|
4887
|
+
optionIcons2 = {
|
|
4888
|
+
h1: Heading1,
|
|
4889
|
+
h2: Heading2,
|
|
4890
|
+
h3: Heading3,
|
|
4891
|
+
h4: Heading4,
|
|
4892
|
+
h5: Heading5,
|
|
4893
|
+
h6: Heading6
|
|
4726
4894
|
};
|
|
4727
4895
|
useHeadingOptions = (fieldOptions) => {
|
|
4728
4896
|
var _a;
|
|
4897
|
+
const h1String = useMessage("field-richtext-headingselect-1");
|
|
4898
|
+
const h2String = useMessage("field-richtext-headingselect-2");
|
|
4899
|
+
const h3String = useMessage("field-richtext-headingselect-3");
|
|
4900
|
+
const h4String = useMessage("field-richtext-headingselect-4");
|
|
4901
|
+
const h5String = useMessage("field-richtext-headingselect-5");
|
|
4902
|
+
const h6String = useMessage("field-richtext-headingselect-6");
|
|
4903
|
+
const optionLabels = {
|
|
4904
|
+
h1: h1String,
|
|
4905
|
+
h2: h2String,
|
|
4906
|
+
h3: h3String,
|
|
4907
|
+
h4: h4String,
|
|
4908
|
+
h5: h5String,
|
|
4909
|
+
h6: h6String
|
|
4910
|
+
};
|
|
4729
4911
|
let blockOptions = [];
|
|
4730
4912
|
if ((fieldOptions == null ? void 0 : fieldOptions.heading) !== false) {
|
|
4731
4913
|
if (!((_a = fieldOptions == null ? void 0 : fieldOptions.heading) == null ? void 0 : _a.levels)) {
|
|
@@ -4754,10 +4936,10 @@ var init_use_options2 = __esm({
|
|
|
4754
4936
|
return (0, import_react30.useMemo)(
|
|
4755
4937
|
() => blockOptions.map((item) => ({
|
|
4756
4938
|
value: item,
|
|
4757
|
-
label:
|
|
4758
|
-
icon:
|
|
4939
|
+
label: optionLabels[item],
|
|
4940
|
+
icon: optionIcons2[item]
|
|
4759
4941
|
})),
|
|
4760
|
-
[blockOptions]
|
|
4942
|
+
[blockOptions, optionLabels]
|
|
4761
4943
|
);
|
|
4762
4944
|
};
|
|
4763
4945
|
}
|
|
@@ -4867,18 +5049,25 @@ var init_HeadingSelect = __esm({
|
|
|
4867
5049
|
});
|
|
4868
5050
|
|
|
4869
5051
|
// components/RichTextMenu/controls/ListSelect/use-options.ts
|
|
4870
|
-
var import_react33,
|
|
5052
|
+
var import_react33, optionIcons3, useListOptions;
|
|
4871
5053
|
var init_use_options3 = __esm({
|
|
4872
5054
|
"components/RichTextMenu/controls/ListSelect/use-options.ts"() {
|
|
4873
5055
|
"use strict";
|
|
4874
5056
|
init_react_import();
|
|
4875
5057
|
import_react33 = require("react");
|
|
4876
5058
|
init_lucide_react();
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
5059
|
+
init_use_message();
|
|
5060
|
+
optionIcons3 = {
|
|
5061
|
+
ul: List,
|
|
5062
|
+
ol: ListOrdered
|
|
4880
5063
|
};
|
|
4881
5064
|
useListOptions = (fieldOptions) => {
|
|
5065
|
+
const ulString = useMessage("field-richtext-listselect-bullet");
|
|
5066
|
+
const olString = useMessage("field-richtext-listselect-ordered");
|
|
5067
|
+
const optionLabels = {
|
|
5068
|
+
ul: ulString,
|
|
5069
|
+
ol: olString
|
|
5070
|
+
};
|
|
4882
5071
|
let blockOptions = [];
|
|
4883
5072
|
if ((fieldOptions == null ? void 0 : fieldOptions.listItem) !== false) {
|
|
4884
5073
|
blockOptions = ["ul", "ol"];
|
|
@@ -4886,10 +5075,10 @@ var init_use_options3 = __esm({
|
|
|
4886
5075
|
return (0, import_react33.useMemo)(
|
|
4887
5076
|
() => blockOptions.map((item) => ({
|
|
4888
5077
|
value: item,
|
|
4889
|
-
label:
|
|
4890
|
-
icon:
|
|
5078
|
+
label: optionLabels[item],
|
|
5079
|
+
icon: optionIcons3[item]
|
|
4891
5080
|
})),
|
|
4892
|
-
[blockOptions]
|
|
5081
|
+
[blockOptions, optionLabels]
|
|
4893
5082
|
);
|
|
4894
5083
|
};
|
|
4895
5084
|
}
|
|
@@ -6445,6 +6634,7 @@ function setDeep(node, path, newVal) {
|
|
|
6445
6634
|
}
|
|
6446
6635
|
|
|
6447
6636
|
// components/AutoField/fields/ArrayField/index.tsx
|
|
6637
|
+
init_use_message();
|
|
6448
6638
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
6449
6639
|
var getClassName5 = get_class_name_factory_default("ArrayField", styles_module_default3);
|
|
6450
6640
|
var getClassNameItem = get_class_name_factory_default("ArrayFieldItem", styles_module_default3);
|
|
@@ -6458,12 +6648,15 @@ var ItemSummaryInner = ({
|
|
|
6458
6648
|
const path = `${[name]}[${index}]`;
|
|
6459
6649
|
return getDeep(s, path);
|
|
6460
6650
|
});
|
|
6651
|
+
const fallbackSummary = useMessage("field-arrayitem-summary", {
|
|
6652
|
+
index: originalIndex
|
|
6653
|
+
});
|
|
6461
6654
|
const itemSummary = (0, import_react18.useMemo)(() => {
|
|
6462
6655
|
if (data && field.getItemSummary) {
|
|
6463
6656
|
return field.getItemSummary(data, index);
|
|
6464
6657
|
}
|
|
6465
|
-
return
|
|
6466
|
-
}, [data, field, originalIndex, index]);
|
|
6658
|
+
return fallbackSummary;
|
|
6659
|
+
}, [data, field, originalIndex, index, fallbackSummary]);
|
|
6467
6660
|
return itemSummary;
|
|
6468
6661
|
};
|
|
6469
6662
|
var ItemSummary = (0, import_react18.memo)(ItemSummaryInner);
|
|
@@ -6685,6 +6878,8 @@ var ArrayField = ({
|
|
|
6685
6878
|
const newArrayState = regenerateArrayState(getValue());
|
|
6686
6879
|
setUi(mapArrayStateToUi(newArrayState), false);
|
|
6687
6880
|
}, [numItems]);
|
|
6881
|
+
const duplicateLabel = useMessage("field-arrayitem-duplicate");
|
|
6882
|
+
const deleteLabel = useMessage("field-arrayitem-delete");
|
|
6688
6883
|
if (field.type !== "array" || !field.arrayFields) {
|
|
6689
6884
|
return null;
|
|
6690
6885
|
}
|
|
@@ -6796,7 +6991,7 @@ var ArrayField = ({
|
|
|
6796
6991
|
existingValue.splice(index, 0, newItem);
|
|
6797
6992
|
updateValue(existingValue);
|
|
6798
6993
|
},
|
|
6799
|
-
title:
|
|
6994
|
+
title: duplicateLabel,
|
|
6800
6995
|
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Copy, { size: 16 })
|
|
6801
6996
|
}
|
|
6802
6997
|
) }),
|
|
@@ -6812,7 +7007,7 @@ var ArrayField = ({
|
|
|
6812
7007
|
existingValue.splice(index, 1);
|
|
6813
7008
|
updateValue(existingValue);
|
|
6814
7009
|
},
|
|
6815
|
-
title:
|
|
7010
|
+
title: deleteLabel,
|
|
6816
7011
|
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Trash, { size: 16 })
|
|
6817
7012
|
}
|
|
6818
7013
|
) })
|
|
@@ -7132,9 +7327,15 @@ var Button = (_a) => {
|
|
|
7132
7327
|
|
|
7133
7328
|
// components/ExternalInput/index.tsx
|
|
7134
7329
|
init_IconButton2();
|
|
7330
|
+
init_use_message();
|
|
7135
7331
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
7136
7332
|
var getClassName10 = get_class_name_factory_default("ExternalInput", styles_module_default6);
|
|
7137
7333
|
var getClassNameModal = get_class_name_factory_default("ExternalInputModal", styles_module_default6);
|
|
7334
|
+
var DefaultFooter = ({ count }) => {
|
|
7335
|
+
const singular = useMessage("field-external-result-singular", { count });
|
|
7336
|
+
const plural = useMessage("field-external-result-plural", { count });
|
|
7337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: getClassNameModal("footer"), children: count === 1 ? singular : plural });
|
|
7338
|
+
};
|
|
7138
7339
|
var dataCache = {};
|
|
7139
7340
|
var ExternalInput = ({
|
|
7140
7341
|
field,
|
|
@@ -7193,16 +7394,16 @@ var ExternalInput = ({
|
|
|
7193
7394
|
[id, field]
|
|
7194
7395
|
);
|
|
7195
7396
|
const Footer = (0, import_react22.useCallback)(
|
|
7196
|
-
(props) => field.renderFooter ? field.renderFooter(props) : /* @__PURE__ */ (0, import_jsx_runtime14.
|
|
7197
|
-
props.items.length,
|
|
7198
|
-
" result",
|
|
7199
|
-
props.items.length === 1 ? "" : "s"
|
|
7200
|
-
] }),
|
|
7397
|
+
(props) => field.renderFooter ? field.renderFooter(props) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DefaultFooter, { count: props.items.length }),
|
|
7201
7398
|
[field.renderFooter]
|
|
7202
7399
|
);
|
|
7203
7400
|
(0, import_react22.useEffect)(() => {
|
|
7204
7401
|
search(searchQuery, filters);
|
|
7205
7402
|
}, []);
|
|
7403
|
+
const externalItemLabel = useMessage("field-external-item");
|
|
7404
|
+
const searchLabel = useMessage("field-external-search");
|
|
7405
|
+
const toggleFiltersLabel = useMessage("field-external-togglefilters");
|
|
7406
|
+
const selectDataLabel = useMessage("field-external-selectdata");
|
|
7206
7407
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
7207
7408
|
"div",
|
|
7208
7409
|
{
|
|
@@ -7221,7 +7422,7 @@ var ExternalInput = ({
|
|
|
7221
7422
|
onClick: () => setOpen(true),
|
|
7222
7423
|
className: getClassName10("button"),
|
|
7223
7424
|
disabled: readOnly,
|
|
7224
|
-
children: value ? field.getItemSummary ? field.getItemSummary(value) :
|
|
7425
|
+
children: value ? field.getItemSummary ? field.getItemSummary(value) : externalItemLabel : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
7225
7426
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Link, { size: "16" }),
|
|
7226
7427
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: field.placeholder })
|
|
7227
7428
|
] })
|
|
@@ -7257,7 +7458,7 @@ var ExternalInput = ({
|
|
|
7257
7458
|
children: [
|
|
7258
7459
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("masthead"), children: field.showSearch ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: getClassNameModal("searchForm"), children: [
|
|
7259
7460
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: getClassNameModal("search"), children: [
|
|
7260
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: getClassNameModal("searchIconText"), children:
|
|
7461
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: getClassNameModal("searchIconText"), children: searchLabel }),
|
|
7261
7462
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("searchIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Search, { size: "18" }) }),
|
|
7262
7463
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
7263
7464
|
"input",
|
|
@@ -7275,12 +7476,12 @@ var ExternalInput = ({
|
|
|
7275
7476
|
)
|
|
7276
7477
|
] }),
|
|
7277
7478
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: getClassNameModal("searchActions"), children: [
|
|
7278
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Button, { type: "submit", loading: isLoading, fullWidth: true, children:
|
|
7479
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Button, { type: "submit", loading: isLoading, fullWidth: true, children: searchLabel }),
|
|
7279
7480
|
hasFilterFields && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("searchActionIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
7280
7481
|
IconButton,
|
|
7281
7482
|
{
|
|
7282
7483
|
type: "button",
|
|
7283
|
-
title:
|
|
7484
|
+
title: toggleFiltersLabel,
|
|
7284
7485
|
onClick: (e) => {
|
|
7285
7486
|
e.preventDefault();
|
|
7286
7487
|
e.stopPropagation();
|
|
@@ -7290,7 +7491,7 @@ var ExternalInput = ({
|
|
|
7290
7491
|
}
|
|
7291
7492
|
) })
|
|
7292
7493
|
] })
|
|
7293
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Heading7, { rank: "2", size: "xs", children: field.placeholder ||
|
|
7494
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Heading7, { rank: "2", size: "xs", children: field.placeholder || selectDataLabel }) }),
|
|
7294
7495
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: getClassNameModal("grid"), children: [
|
|
7295
7496
|
hasFilterFields && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("filters"), children: hasFilterFields && Object.keys(filterFields).map((fieldName) => {
|
|
7296
7497
|
const filterField = filterFields[fieldName];
|
|
@@ -7360,6 +7561,7 @@ var ExternalInput = ({
|
|
|
7360
7561
|
|
|
7361
7562
|
// components/AutoField/fields/ExternalField/index.tsx
|
|
7362
7563
|
init_lucide_react();
|
|
7564
|
+
init_use_message();
|
|
7363
7565
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
7364
7566
|
var ExternalField = ({
|
|
7365
7567
|
field,
|
|
@@ -7375,6 +7577,7 @@ var ExternalField = ({
|
|
|
7375
7577
|
const value = useDeepField(name);
|
|
7376
7578
|
const validField = field;
|
|
7377
7579
|
const deprecatedField = field;
|
|
7580
|
+
const selectDataLabel = useMessage("field-external-selectdata");
|
|
7378
7581
|
(0, import_react23.useEffect)(() => {
|
|
7379
7582
|
if (deprecatedField.adaptor) {
|
|
7380
7583
|
console.error(
|
|
@@ -7397,7 +7600,7 @@ var ExternalField = ({
|
|
|
7397
7600
|
name,
|
|
7398
7601
|
field: __spreadProps(__spreadValues({}, validField), {
|
|
7399
7602
|
// DEPRECATED
|
|
7400
|
-
placeholder: ((_a = deprecatedField.adaptor) == null ? void 0 : _a.name) ? `Select from ${deprecatedField.adaptor.name}` : validField.placeholder ||
|
|
7603
|
+
placeholder: ((_a = deprecatedField.adaptor) == null ? void 0 : _a.name) ? `Select from ${deprecatedField.adaptor.name}` : validField.placeholder || selectDataLabel,
|
|
7401
7604
|
mapProp: ((_b = deprecatedField.adaptor) == null ? void 0 : _b.mapProp) || validField.mapProp,
|
|
7402
7605
|
mapRow: validField.mapRow,
|
|
7403
7606
|
fetchList: ((_c = deprecatedField.adaptor) == null ? void 0 : _c.fetchList) ? () => __async(null, null, function* () {
|
|
@@ -7740,6 +7943,7 @@ init_get_class_name_factory();
|
|
|
7740
7943
|
var import_react48 = require("react");
|
|
7741
7944
|
init_lucide_react();
|
|
7742
7945
|
init_store();
|
|
7946
|
+
init_use_message();
|
|
7743
7947
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
7744
7948
|
var getClassName19 = get_class_name_factory_default("Input", styles_module_default2);
|
|
7745
7949
|
var FieldLabel = ({
|
|
@@ -7751,11 +7955,12 @@ var FieldLabel = ({
|
|
|
7751
7955
|
className
|
|
7752
7956
|
}) => {
|
|
7753
7957
|
const El = el;
|
|
7958
|
+
const readOnlyLabel = useMessage("field-readonly");
|
|
7754
7959
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(El, { className, children: [
|
|
7755
7960
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: getClassName19("label"), children: [
|
|
7756
7961
|
icon ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: getClassName19("labelIcon"), children: icon }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_jsx_runtime53.Fragment, {}),
|
|
7757
7962
|
label,
|
|
7758
|
-
readOnly && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: getClassName19("disabledIcon"), title:
|
|
7963
|
+
readOnly && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: getClassName19("disabledIcon"), title: readOnlyLabel, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Lock, { size: "12" }) })
|
|
7759
7964
|
] }),
|
|
7760
7965
|
children
|
|
7761
7966
|
] });
|
|
@@ -8138,6 +8343,7 @@ function assignRefs(refs, node) {
|
|
|
8138
8343
|
}
|
|
8139
8344
|
|
|
8140
8345
|
// components/DraggableComponent/index.tsx
|
|
8346
|
+
init_use_message();
|
|
8141
8347
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
8142
8348
|
var getClassName21 = get_class_name_factory_default("DraggableComponent", styles_module_default15);
|
|
8143
8349
|
var DEBUG2 = false;
|
|
@@ -8626,9 +8832,12 @@ var DraggableComponent = ({
|
|
|
8626
8832
|
}
|
|
8627
8833
|
setDragAxis(autoDragAxis);
|
|
8628
8834
|
}, [ref, userDragAxis, autoDragAxis]);
|
|
8835
|
+
const selectParentLabel = useMessage("action-selectparent");
|
|
8836
|
+
const duplicateLabel = useMessage("action-duplicate");
|
|
8837
|
+
const deleteLabel = useMessage("action-delete");
|
|
8629
8838
|
const parentAction = (0, import_react52.useMemo)(
|
|
8630
|
-
() => (ctx == null ? void 0 : ctx.areaId) && (ctx == null ? void 0 : ctx.areaId) !== "root" && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ActionBar.Action, { onClick: onSelectParent, label:
|
|
8631
|
-
[ctx == null ? void 0 : ctx.areaId]
|
|
8839
|
+
() => (ctx == null ? void 0 : ctx.areaId) && (ctx == null ? void 0 : ctx.areaId) !== "root" && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ActionBar.Action, { onClick: onSelectParent, label: selectParentLabel, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(CornerLeftUp, { size: 16 }) }),
|
|
8840
|
+
[ctx == null ? void 0 : ctx.areaId, selectParentLabel]
|
|
8632
8841
|
);
|
|
8633
8842
|
const nextContextValue = (0, import_react52.useMemo)(
|
|
8634
8843
|
() => __spreadProps(__spreadValues({}, ctx), {
|
|
@@ -8708,8 +8917,15 @@ var DraggableComponent = ({
|
|
|
8708
8917
|
),
|
|
8709
8918
|
hasNormalActions && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ActionBar.Separator, {})
|
|
8710
8919
|
] }),
|
|
8711
|
-
permissions.duplicate && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8712
|
-
|
|
8920
|
+
permissions.duplicate && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8921
|
+
ActionBar.Action,
|
|
8922
|
+
{
|
|
8923
|
+
onClick: onDuplicate,
|
|
8924
|
+
label: duplicateLabel,
|
|
8925
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Copy, { className: getClassName21("actionsAction") })
|
|
8926
|
+
}
|
|
8927
|
+
),
|
|
8928
|
+
permissions.delete && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ActionBar.Action, { onClick: onDelete, label: deleteLabel, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Trash, { className: getClassName21("actionsAction") }) })
|
|
8713
8929
|
]
|
|
8714
8930
|
}
|
|
8715
8931
|
)
|
|
@@ -9274,6 +9490,9 @@ function useFieldTransformsTracked(config, item, transforms, readOnly, forceRead
|
|
|
9274
9490
|
return mergedProps;
|
|
9275
9491
|
}
|
|
9276
9492
|
|
|
9493
|
+
// components/DropZone/index.tsx
|
|
9494
|
+
init_use_message();
|
|
9495
|
+
|
|
9277
9496
|
// lib/field-transforms/default-transforms/inline-text-transform.tsx
|
|
9278
9497
|
init_react_import();
|
|
9279
9498
|
|
|
@@ -9899,7 +10118,7 @@ var DropZoneChild = ({
|
|
|
9899
10118
|
inDroppableZone,
|
|
9900
10119
|
itemRef
|
|
9901
10120
|
}) => {
|
|
9902
|
-
var _a, _b;
|
|
10121
|
+
var _a, _b, _c, _d;
|
|
9903
10122
|
const metadata = useAppStore((s) => s.metadata);
|
|
9904
10123
|
const ctx = (0, import_react68.useContext)(dropZoneContext);
|
|
9905
10124
|
const { depth = 1 } = ctx != null ? ctx : {};
|
|
@@ -9967,7 +10186,11 @@ var DropZoneChild = ({
|
|
|
9967
10186
|
return ((_a2 = s.selectedItem) == null ? void 0 : _a2.props.id) === componentId || false;
|
|
9968
10187
|
}
|
|
9969
10188
|
);
|
|
9970
|
-
|
|
10189
|
+
const componentLabel = useMessage("label-component");
|
|
10190
|
+
const noConfigMessage = useMessage("canvas-noconfig", {
|
|
10191
|
+
type: (_b = (_a = item == null ? void 0 : item.type) == null ? void 0 : _a.toString()) != null ? _b : ""
|
|
10192
|
+
});
|
|
10193
|
+
let label = (_d = (_c = componentConfig == null ? void 0 : componentConfig.label) != null ? _c : item == null ? void 0 : item.type.toString()) != null ? _d : componentLabel;
|
|
9971
10194
|
const defaultsProps = (0, import_react68.useMemo)(
|
|
9972
10195
|
() => __spreadProps(__spreadValues(__spreadValues({}, componentConfig == null ? void 0 : componentConfig.defaultProps), item == null ? void 0 : item.props), {
|
|
9973
10196
|
puck: puckProps,
|
|
@@ -10001,10 +10224,7 @@ var DropZoneChild = ({
|
|
|
10001
10224
|
isLoading
|
|
10002
10225
|
);
|
|
10003
10226
|
if (!item) return;
|
|
10004
|
-
const Render2 = componentConfig ? componentConfig.render : () => /* @__PURE__ */ (0, import_jsx_runtime68.
|
|
10005
|
-
"No configuration for ",
|
|
10006
|
-
item.type
|
|
10007
|
-
] });
|
|
10227
|
+
const Render2 = componentConfig ? componentConfig.render : () => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { style: { padding: 48, textAlign: "center" }, children: noConfigMessage });
|
|
10008
10228
|
let componentType = item.type;
|
|
10009
10229
|
const isInserting = "previewType" in item ? item.previewType === "insert" : false;
|
|
10010
10230
|
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
@@ -11457,6 +11677,7 @@ var styles_module_default19 = { "ComponentList": "_ComponentList_htktj_1", "Comp
|
|
|
11457
11677
|
init_get_class_name_factory();
|
|
11458
11678
|
var import_react75 = require("react");
|
|
11459
11679
|
init_store();
|
|
11680
|
+
init_use_message();
|
|
11460
11681
|
init_lucide_react();
|
|
11461
11682
|
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
11462
11683
|
var getClassName28 = get_class_name_factory_default("ComponentList", styles_module_default19);
|
|
@@ -11490,6 +11711,12 @@ var ComponentList = ({
|
|
|
11490
11711
|
const componentList = useAppStore((s) => s.state.ui.componentList);
|
|
11491
11712
|
const { expanded = true } = componentList[id] || {};
|
|
11492
11713
|
const contentId = `puck-drawer-category-${id}`;
|
|
11714
|
+
const collapseTitle = useMessage("drawer-category-collapse", {
|
|
11715
|
+
title: title != null ? title : ""
|
|
11716
|
+
});
|
|
11717
|
+
const expandTitle = useMessage("drawer-category-expand", {
|
|
11718
|
+
title: title != null ? title : ""
|
|
11719
|
+
});
|
|
11493
11720
|
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: getClassName28({ isExpanded: expanded }), children: [
|
|
11494
11721
|
title && /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
|
|
11495
11722
|
"button",
|
|
@@ -11505,7 +11732,7 @@ var ComponentList = ({
|
|
|
11505
11732
|
})
|
|
11506
11733
|
})
|
|
11507
11734
|
}),
|
|
11508
|
-
title: expanded ?
|
|
11735
|
+
title: expanded ? collapseTitle : expandTitle,
|
|
11509
11736
|
children: [
|
|
11510
11737
|
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { children: title }),
|
|
11511
11738
|
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: getClassName28("titleIcon"), children: expanded ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(ChevronUp, { size: 12 }) : /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(ChevronDown, { size: 12 }) })
|
|
@@ -11529,11 +11756,13 @@ ComponentList.Item = ComponentListItem;
|
|
|
11529
11756
|
|
|
11530
11757
|
// lib/use-component-list.tsx
|
|
11531
11758
|
init_store();
|
|
11759
|
+
init_use_message();
|
|
11532
11760
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
11533
11761
|
var useComponentList = () => {
|
|
11534
11762
|
const [componentList, setComponentList] = (0, import_react76.useState)();
|
|
11535
11763
|
const config = useAppStore((s) => s.config);
|
|
11536
11764
|
const uiComponentList = useAppStore((s) => s.state.ui.componentList);
|
|
11765
|
+
const otherLabel = useMessage("drawer-category-other");
|
|
11537
11766
|
(0, import_react76.useEffect)(() => {
|
|
11538
11767
|
var _a, _b, _c;
|
|
11539
11768
|
if (Object.keys(uiComponentList).length > 0) {
|
|
@@ -11541,6 +11770,7 @@ var useComponentList = () => {
|
|
|
11541
11770
|
let _componentList;
|
|
11542
11771
|
_componentList = Object.entries(uiComponentList).map(
|
|
11543
11772
|
([categoryKey, category]) => {
|
|
11773
|
+
var _a2, _b2;
|
|
11544
11774
|
if (!category.components) {
|
|
11545
11775
|
return null;
|
|
11546
11776
|
}
|
|
@@ -11554,14 +11784,14 @@ var useComponentList = () => {
|
|
|
11554
11784
|
ComponentList,
|
|
11555
11785
|
{
|
|
11556
11786
|
id: categoryKey,
|
|
11557
|
-
title: category.title || categoryKey,
|
|
11787
|
+
title: ((_b2 = (_a2 = config.categories) == null ? void 0 : _a2[categoryKey]) == null ? void 0 : _b2.title) || category.title || categoryKey,
|
|
11558
11788
|
children: category.components.map((componentName, i) => {
|
|
11559
|
-
var
|
|
11789
|
+
var _a3;
|
|
11560
11790
|
const componentConf = config.components[componentName] || {};
|
|
11561
11791
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
11562
11792
|
ComponentList.Item,
|
|
11563
11793
|
{
|
|
11564
|
-
label: (
|
|
11794
|
+
label: (_a3 = componentConf["label"]) != null ? _a3 : componentName,
|
|
11565
11795
|
name: componentName,
|
|
11566
11796
|
index: i
|
|
11567
11797
|
},
|
|
@@ -11582,7 +11812,7 @@ var useComponentList = () => {
|
|
|
11582
11812
|
ComponentList,
|
|
11583
11813
|
{
|
|
11584
11814
|
id: "other",
|
|
11585
|
-
title: ((_c = uiComponentList.other) == null ? void 0 : _c.title) ||
|
|
11815
|
+
title: ((_c = uiComponentList.other) == null ? void 0 : _c.title) || otherLabel,
|
|
11586
11816
|
children: remainingComponents.map((componentName, i) => {
|
|
11587
11817
|
var _a2;
|
|
11588
11818
|
const componentConf = config.components[componentName] || {};
|
|
@@ -11603,7 +11833,7 @@ var useComponentList = () => {
|
|
|
11603
11833
|
}
|
|
11604
11834
|
setComponentList(_componentList);
|
|
11605
11835
|
}
|
|
11606
|
-
}, [config.categories, config.components, uiComponentList]);
|
|
11836
|
+
}, [config.categories, config.components, uiComponentList, otherLabel]);
|
|
11607
11837
|
return componentList;
|
|
11608
11838
|
};
|
|
11609
11839
|
|
|
@@ -15038,6 +15268,7 @@ init_lucide_react();
|
|
|
15038
15268
|
init_root_droppable_id();
|
|
15039
15269
|
var import_react81 = require("react");
|
|
15040
15270
|
init_store();
|
|
15271
|
+
init_use_message();
|
|
15041
15272
|
var import_react_virtual2 = require("@tanstack/react-virtual");
|
|
15042
15273
|
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
15043
15274
|
var getClassName30 = get_class_name_factory_default("LayerTree", styles_module_default21);
|
|
@@ -15073,11 +15304,12 @@ var buildLayerNode = ({
|
|
|
15073
15304
|
nodes,
|
|
15074
15305
|
zoneCompound,
|
|
15075
15306
|
zones,
|
|
15076
|
-
zonesByParent
|
|
15307
|
+
zonesByParent,
|
|
15308
|
+
componentFallbackLabel = "Component"
|
|
15077
15309
|
}) => {
|
|
15078
15310
|
var _a, _b, _c;
|
|
15079
15311
|
const nodeData = nodes[itemId];
|
|
15080
|
-
const componentType = ((_a = nodeData == null ? void 0 : nodeData.data.type) == null ? void 0 : _a.toString()) ||
|
|
15312
|
+
const componentType = ((_a = nodeData == null ? void 0 : nodeData.data.type) == null ? void 0 : _a.toString()) || componentFallbackLabel;
|
|
15081
15313
|
const label = (_c = (_b = config.components[componentType]) == null ? void 0 : _b.label) != null ? _c : componentType;
|
|
15082
15314
|
const childZoneCompounds = zonesByParent[itemId] || [];
|
|
15083
15315
|
return {
|
|
@@ -15087,7 +15319,8 @@ var buildLayerNode = ({
|
|
|
15087
15319
|
nodes,
|
|
15088
15320
|
zoneCompound: childZoneCompound,
|
|
15089
15321
|
zones,
|
|
15090
|
-
zonesByParent
|
|
15322
|
+
zonesByParent,
|
|
15323
|
+
componentFallbackLabel
|
|
15091
15324
|
})
|
|
15092
15325
|
),
|
|
15093
15326
|
componentType,
|
|
@@ -15103,7 +15336,8 @@ var buildLayerTree = ({
|
|
|
15103
15336
|
nodes,
|
|
15104
15337
|
zoneCompound,
|
|
15105
15338
|
zones,
|
|
15106
|
-
zonesByParent = getZonesByParent(zones)
|
|
15339
|
+
zonesByParent = getZonesByParent(zones),
|
|
15340
|
+
componentFallbackLabel = "Component"
|
|
15107
15341
|
}) => {
|
|
15108
15342
|
var _a, _b;
|
|
15109
15343
|
const contentIds = (_b = (_a = zones[zoneCompound]) == null ? void 0 : _a.contentIds) != null ? _b : [];
|
|
@@ -15116,7 +15350,8 @@ var buildLayerTree = ({
|
|
|
15116
15350
|
nodes,
|
|
15117
15351
|
zoneCompound,
|
|
15118
15352
|
zones,
|
|
15119
|
-
zonesByParent
|
|
15353
|
+
zonesByParent,
|
|
15354
|
+
componentFallbackLabel
|
|
15120
15355
|
})
|
|
15121
15356
|
),
|
|
15122
15357
|
label: getZoneLabel(zoneCompound, nodes, config, label),
|
|
@@ -15161,6 +15396,8 @@ var Layer = (0, import_react81.forwardRef)(function Layer2({
|
|
|
15161
15396
|
(s) => s.hoveringComponent === node.itemId
|
|
15162
15397
|
);
|
|
15163
15398
|
const containsZone = node.childZones.length > 0;
|
|
15399
|
+
const collapseLabel = useMessage("outline-collapse");
|
|
15400
|
+
const expandLabel = useMessage("outline-expand");
|
|
15164
15401
|
const setItemSelector = (0, import_react81.useCallback)(
|
|
15165
15402
|
(itemSelector) => {
|
|
15166
15403
|
dispatch({ type: "setUi", ui: { itemSelector } });
|
|
@@ -15210,7 +15447,7 @@ var Layer = (0, import_react81.forwardRef)(function Layer2({
|
|
|
15210
15447
|
"div",
|
|
15211
15448
|
{
|
|
15212
15449
|
className: getClassNameLayer("chevron"),
|
|
15213
|
-
title: isSelected ?
|
|
15450
|
+
title: isSelected ? collapseLabel : expandLabel,
|
|
15214
15451
|
children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(ChevronDown, { size: "12" })
|
|
15215
15452
|
}
|
|
15216
15453
|
),
|
|
@@ -15278,8 +15515,9 @@ var StaticLayerTreeItems = ({
|
|
|
15278
15515
|
selectedPathIds,
|
|
15279
15516
|
tree
|
|
15280
15517
|
}) => {
|
|
15518
|
+
const noItemsLabel = useMessage("outline-empty");
|
|
15281
15519
|
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("ul", { className: getClassName30(), children: [
|
|
15282
|
-
tree.items.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: getClassName30("helper"), children:
|
|
15520
|
+
tree.items.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: getClassName30("helper"), children: noItemsLabel }),
|
|
15283
15521
|
tree.items.map((node) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
15284
15522
|
Layer,
|
|
15285
15523
|
{
|
|
@@ -15301,6 +15539,7 @@ var VirtualizedLayerTreeItems = ({
|
|
|
15301
15539
|
tree
|
|
15302
15540
|
}) => {
|
|
15303
15541
|
const listRef = (0, import_react81.useRef)(null);
|
|
15542
|
+
const noItemsLabel = useMessage("outline-empty");
|
|
15304
15543
|
const virtualizer = (0, import_react_virtual2.useVirtualizer)({
|
|
15305
15544
|
count: tree.items.length,
|
|
15306
15545
|
estimateSize: (index) => getEstimatedRowHeight(tree.items[index].itemId),
|
|
@@ -15369,7 +15608,7 @@ var VirtualizedLayerTreeItems = ({
|
|
|
15369
15608
|
);
|
|
15370
15609
|
}
|
|
15371
15610
|
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("ul", { className: getClassName30(), ref: listRef, children: [
|
|
15372
|
-
tree.items.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: getClassName30("helper"), children:
|
|
15611
|
+
tree.items.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: getClassName30("helper"), children: noItemsLabel }),
|
|
15373
15612
|
renderedItems
|
|
15374
15613
|
] });
|
|
15375
15614
|
};
|
|
@@ -15392,6 +15631,7 @@ var LayerTree = ({
|
|
|
15392
15631
|
|
|
15393
15632
|
// components/Puck/components/Outline/index.tsx
|
|
15394
15633
|
init_store();
|
|
15634
|
+
init_use_message();
|
|
15395
15635
|
var import_react82 = require("react");
|
|
15396
15636
|
|
|
15397
15637
|
// lib/data/find-zones-for-area.ts
|
|
@@ -15414,6 +15654,7 @@ var Outline = () => {
|
|
|
15414
15654
|
var _a;
|
|
15415
15655
|
return ((_a = s.selectedItem) == null ? void 0 : _a.props.id) || null;
|
|
15416
15656
|
});
|
|
15657
|
+
const componentFallbackLabel = useMessage("label-component");
|
|
15417
15658
|
const rootZones = useAppStore(
|
|
15418
15659
|
(0, import_shallow8.useShallow)((s) => findZonesForArea(s.state, "root"))
|
|
15419
15660
|
);
|
|
@@ -15431,10 +15672,11 @@ var Outline = () => {
|
|
|
15431
15672
|
label: rootZones.length === 1 ? "" : zoneCompound.split(":")[1],
|
|
15432
15673
|
nodes,
|
|
15433
15674
|
zoneCompound,
|
|
15434
|
-
zones
|
|
15675
|
+
zones,
|
|
15676
|
+
componentFallbackLabel
|
|
15435
15677
|
})
|
|
15436
15678
|
),
|
|
15437
|
-
[config, nodes, rootZones, zones]
|
|
15679
|
+
[config, nodes, rootZones, zones, componentFallbackLabel]
|
|
15438
15680
|
);
|
|
15439
15681
|
const Wrapper = (0, import_react82.useMemo)(() => outlineOverride || "div", [outlineOverride]);
|
|
15440
15682
|
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Wrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
@@ -15608,7 +15850,8 @@ var generateUsePuck = (store, getState) => {
|
|
|
15608
15850
|
const parentNode = store.state.indexes.nodes[parentId];
|
|
15609
15851
|
if (!parentNode) return;
|
|
15610
15852
|
return parentNode.data;
|
|
15611
|
-
}
|
|
15853
|
+
},
|
|
15854
|
+
dictionary: store.dictionary
|
|
15612
15855
|
};
|
|
15613
15856
|
storeData.__private = {
|
|
15614
15857
|
appState: store.state
|
|
@@ -15625,7 +15868,8 @@ var convertToPickedStore = (store) => {
|
|
|
15625
15868
|
dispatch: store.dispatch,
|
|
15626
15869
|
permissions: store.permissions,
|
|
15627
15870
|
history: store.history,
|
|
15628
|
-
selectedItem: store.selectedItem
|
|
15871
|
+
selectedItem: store.selectedItem,
|
|
15872
|
+
dictionary: store.dictionary
|
|
15629
15873
|
};
|
|
15630
15874
|
};
|
|
15631
15875
|
var useRegisterUsePuckStore = (appStore) => {
|
|
@@ -15693,6 +15937,7 @@ var styles_module_default22 = { "Puck": "_Puck_mr27u_19", "Puck-portal": "_Puck-
|
|
|
15693
15937
|
|
|
15694
15938
|
// components/Puck/components/Layout/index.tsx
|
|
15695
15939
|
init_store();
|
|
15940
|
+
init_use_message();
|
|
15696
15941
|
|
|
15697
15942
|
// components/DefaultOverride/index.tsx
|
|
15698
15943
|
init_react_import();
|
|
@@ -15741,6 +15986,7 @@ var styles_module_default23 = { "MenuBar": "_MenuBar_1hxnj_1", "MenuBar--menuOpe
|
|
|
15741
15986
|
|
|
15742
15987
|
// components/MenuBar/index.tsx
|
|
15743
15988
|
init_store();
|
|
15989
|
+
init_use_message();
|
|
15744
15990
|
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
15745
15991
|
var getClassName31 = get_class_name_factory_default("MenuBar", styles_module_default23);
|
|
15746
15992
|
function MenuBar({
|
|
@@ -15752,6 +15998,8 @@ function MenuBar({
|
|
|
15752
15998
|
const forward = useAppStore((s) => s.history.forward);
|
|
15753
15999
|
const hasFuture = useAppStore((s) => s.history.hasFuture());
|
|
15754
16000
|
const hasPast = useAppStore((s) => s.history.hasPast());
|
|
16001
|
+
const undoLabel = useMessage("header-undo");
|
|
16002
|
+
const redoLabel = useMessage("header-redo");
|
|
15755
16003
|
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
15756
16004
|
"div",
|
|
15757
16005
|
{
|
|
@@ -15772,7 +16020,7 @@ function MenuBar({
|
|
|
15772
16020
|
IconButton,
|
|
15773
16021
|
{
|
|
15774
16022
|
type: "button",
|
|
15775
|
-
title:
|
|
16023
|
+
title: undoLabel,
|
|
15776
16024
|
disabled: !hasPast,
|
|
15777
16025
|
onClick: back,
|
|
15778
16026
|
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Undo2, { size: 21 })
|
|
@@ -15782,7 +16030,7 @@ function MenuBar({
|
|
|
15782
16030
|
IconButton,
|
|
15783
16031
|
{
|
|
15784
16032
|
type: "button",
|
|
15785
|
-
title:
|
|
16033
|
+
title: redoLabel,
|
|
15786
16034
|
disabled: !hasFuture,
|
|
15787
16035
|
onClick: forward,
|
|
15788
16036
|
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Redo2, { size: 21 })
|
|
@@ -15797,6 +16045,7 @@ function MenuBar({
|
|
|
15797
16045
|
|
|
15798
16046
|
// components/Puck/components/Header/index.tsx
|
|
15799
16047
|
init_lib();
|
|
16048
|
+
init_use_message();
|
|
15800
16049
|
|
|
15801
16050
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Header/styles.module.css#css-module
|
|
15802
16051
|
init_react_import();
|
|
@@ -15877,6 +16126,11 @@ var HeaderInner = ({
|
|
|
15877
16126
|
},
|
|
15878
16127
|
[dispatch, leftSideBarVisible, rightSideBarVisible]
|
|
15879
16128
|
);
|
|
16129
|
+
const publishLabel = useMessage("header-publish");
|
|
16130
|
+
const pageLabel = useMessage("label-page");
|
|
16131
|
+
const toggleLeftLabel = useMessage("header-toggle-leftsidebar");
|
|
16132
|
+
const toggleRightLabel = useMessage("header-toggle-rightsidebar");
|
|
16133
|
+
const toggleMenuLabel = useMessage("header-toggle-menubar");
|
|
15880
16134
|
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
15881
16135
|
CustomHeader,
|
|
15882
16136
|
{
|
|
@@ -15888,7 +16142,7 @@ var HeaderInner = ({
|
|
|
15888
16142
|
onPublish && onPublish(data);
|
|
15889
16143
|
},
|
|
15890
16144
|
icon: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Globe, { size: "14px" }),
|
|
15891
|
-
children:
|
|
16145
|
+
children: publishLabel
|
|
15892
16146
|
}
|
|
15893
16147
|
) }) }),
|
|
15894
16148
|
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
@@ -15908,7 +16162,7 @@ var HeaderInner = ({
|
|
|
15908
16162
|
onClick: () => {
|
|
15909
16163
|
toggleSidebars("left");
|
|
15910
16164
|
},
|
|
15911
|
-
title:
|
|
16165
|
+
title: toggleLeftLabel,
|
|
15912
16166
|
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(PanelLeft, { focusable: "false" })
|
|
15913
16167
|
}
|
|
15914
16168
|
) }),
|
|
@@ -15919,13 +16173,13 @@ var HeaderInner = ({
|
|
|
15919
16173
|
onClick: () => {
|
|
15920
16174
|
toggleSidebars("right");
|
|
15921
16175
|
},
|
|
15922
|
-
title:
|
|
16176
|
+
title: toggleRightLabel,
|
|
15923
16177
|
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(PanelRight, { focusable: "false" })
|
|
15924
16178
|
}
|
|
15925
16179
|
) })
|
|
15926
16180
|
] }),
|
|
15927
16181
|
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: getClassName32("title"), children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(Heading7, { rank: "2", size: "xs", children: [
|
|
15928
|
-
headerTitle || rootTitle ||
|
|
16182
|
+
headerTitle || rootTitle || pageLabel,
|
|
15929
16183
|
headerPath && /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(import_jsx_runtime81.Fragment, { children: [
|
|
15930
16184
|
" ",
|
|
15931
16185
|
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("code", { className: getClassName32("path"), children: headerPath })
|
|
@@ -15939,7 +16193,7 @@ var HeaderInner = ({
|
|
|
15939
16193
|
onClick: () => {
|
|
15940
16194
|
return setMenuOpen(!menuOpen);
|
|
15941
16195
|
},
|
|
15942
|
-
title:
|
|
16196
|
+
title: toggleMenuLabel,
|
|
15943
16197
|
children: menuOpen ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ChevronUp, { focusable: "false" }) : /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ChevronDown, { focusable: "false" })
|
|
15944
16198
|
}
|
|
15945
16199
|
) }),
|
|
@@ -15957,7 +16211,7 @@ var HeaderInner = ({
|
|
|
15957
16211
|
onPublish && onPublish(data);
|
|
15958
16212
|
},
|
|
15959
16213
|
icon: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Globe, { size: "14px" }),
|
|
15960
|
-
children:
|
|
16214
|
+
children: publishLabel
|
|
15961
16215
|
}
|
|
15962
16216
|
) }),
|
|
15963
16217
|
setMenuOpen
|
|
@@ -15998,6 +16252,7 @@ init_lucide_react();
|
|
|
15998
16252
|
init_react_import();
|
|
15999
16253
|
var import_react87 = require("react");
|
|
16000
16254
|
init_store();
|
|
16255
|
+
init_use_message();
|
|
16001
16256
|
var useBreadcrumbs = (renderCount) => {
|
|
16002
16257
|
const selectedId = useAppStore((s) => {
|
|
16003
16258
|
var _a;
|
|
@@ -16009,13 +16264,15 @@ var useBreadcrumbs = (renderCount) => {
|
|
|
16009
16264
|
return (_a = s.state.indexes.nodes[selectedId]) == null ? void 0 : _a.path;
|
|
16010
16265
|
});
|
|
16011
16266
|
const appStore = useAppStoreApi();
|
|
16267
|
+
const pageLabel = useMessage("label-page");
|
|
16268
|
+
const componentLabel = useMessage("label-component");
|
|
16012
16269
|
return (0, import_react87.useMemo)(() => {
|
|
16013
16270
|
const breadcrumbs = (path == null ? void 0 : path.map((zoneCompound) => {
|
|
16014
16271
|
var _a, _b, _c, _d;
|
|
16015
16272
|
const [componentId] = zoneCompound.split(":");
|
|
16016
16273
|
if (componentId === "root") {
|
|
16017
16274
|
return {
|
|
16018
|
-
label: ((_a = config == null ? void 0 : config.root) == null ? void 0 : _a.label) ||
|
|
16275
|
+
label: ((_a = config == null ? void 0 : config.root) == null ? void 0 : _a.label) || pageLabel,
|
|
16019
16276
|
selector: null
|
|
16020
16277
|
};
|
|
16021
16278
|
}
|
|
@@ -16023,7 +16280,7 @@ var useBreadcrumbs = (renderCount) => {
|
|
|
16023
16280
|
const parentId = node.path[node.path.length - 1];
|
|
16024
16281
|
const contentIds = ((_b = appStore.getState().state.indexes.zones[parentId]) == null ? void 0 : _b.contentIds) || [];
|
|
16025
16282
|
const index = contentIds.indexOf(componentId);
|
|
16026
|
-
const label = node ? (_d = (_c = config.components[node.data.type]) == null ? void 0 : _c.label) != null ? _d : node.data.type :
|
|
16283
|
+
const label = node ? (_d = (_c = config.components[node.data.type]) == null ? void 0 : _c.label) != null ? _d : node.data.type : componentLabel;
|
|
16027
16284
|
return {
|
|
16028
16285
|
label,
|
|
16029
16286
|
selector: node ? {
|
|
@@ -16036,7 +16293,7 @@ var useBreadcrumbs = (renderCount) => {
|
|
|
16036
16293
|
return breadcrumbs.slice(breadcrumbs.length - renderCount);
|
|
16037
16294
|
}
|
|
16038
16295
|
return breadcrumbs;
|
|
16039
|
-
}, [path, renderCount]);
|
|
16296
|
+
}, [path, renderCount, pageLabel, componentLabel]);
|
|
16040
16297
|
};
|
|
16041
16298
|
|
|
16042
16299
|
// components/Breadcrumbs/index.tsx
|
|
@@ -16098,6 +16355,7 @@ init_react_import();
|
|
|
16098
16355
|
init_lucide_react();
|
|
16099
16356
|
init_IconButton2();
|
|
16100
16357
|
init_store();
|
|
16358
|
+
init_use_message();
|
|
16101
16359
|
var import_react88 = require("react");
|
|
16102
16360
|
init_lib();
|
|
16103
16361
|
|
|
@@ -16143,6 +16401,26 @@ var defaultZoomOptions = [
|
|
|
16143
16401
|
{ label: "150%", value: 1.5 },
|
|
16144
16402
|
{ label: "200%", value: 2 }
|
|
16145
16403
|
];
|
|
16404
|
+
var ViewportButton = ({
|
|
16405
|
+
viewport,
|
|
16406
|
+
isActive,
|
|
16407
|
+
onClick
|
|
16408
|
+
}) => {
|
|
16409
|
+
var _a;
|
|
16410
|
+
const switchTitle = useMessage("viewport-switch", {
|
|
16411
|
+
label: (_a = viewport.label) != null ? _a : ""
|
|
16412
|
+
});
|
|
16413
|
+
const switchDefaultTitle = useMessage("viewport-switch-default");
|
|
16414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
16415
|
+
ActionButton,
|
|
16416
|
+
{
|
|
16417
|
+
title: viewport.label ? switchTitle : switchDefaultTitle,
|
|
16418
|
+
onClick,
|
|
16419
|
+
isActive,
|
|
16420
|
+
children: typeof viewport.icon === "string" ? icons[viewport.icon] || viewport.icon : viewport.icon || icons.Smartphone
|
|
16421
|
+
}
|
|
16422
|
+
);
|
|
16423
|
+
};
|
|
16146
16424
|
var ViewportControls = ({
|
|
16147
16425
|
autoZoom,
|
|
16148
16426
|
zoom,
|
|
@@ -16156,17 +16434,20 @@ var ViewportControls = ({
|
|
|
16156
16434
|
const defaultsContainAutoZoom = defaultZoomOptions.find(
|
|
16157
16435
|
(option) => option.value === autoZoom
|
|
16158
16436
|
);
|
|
16437
|
+
const autoZoomLabel = useMessage("viewport-zoom-auto", {
|
|
16438
|
+
zoom: (autoZoom * 100).toFixed(0)
|
|
16439
|
+
});
|
|
16159
16440
|
const zoomOptions = (0, import_react88.useMemo)(
|
|
16160
16441
|
() => [
|
|
16161
16442
|
...defaultZoomOptions,
|
|
16162
16443
|
...defaultsContainAutoZoom ? [] : [
|
|
16163
16444
|
{
|
|
16164
16445
|
value: autoZoom,
|
|
16165
|
-
label:
|
|
16446
|
+
label: autoZoomLabel
|
|
16166
16447
|
}
|
|
16167
16448
|
]
|
|
16168
16449
|
].filter((a) => a.value <= autoZoom).sort((a, b) => a.value > b.value ? 1 : -1),
|
|
16169
|
-
[autoZoom]
|
|
16450
|
+
[autoZoom, autoZoomLabel]
|
|
16170
16451
|
);
|
|
16171
16452
|
const [activeViewport, setActiveViewport] = (0, import_react88.useState)(
|
|
16172
16453
|
uiViewports.current.width
|
|
@@ -16175,6 +16456,9 @@ var ViewportControls = ({
|
|
|
16175
16456
|
setActiveViewport(uiViewports.current.width);
|
|
16176
16457
|
}, [uiViewports.current]);
|
|
16177
16458
|
const [isExpanded, setIsExpanded] = (0, import_react88.useState)(false);
|
|
16459
|
+
const zoomOutLabel = useMessage("viewport-zoom-out");
|
|
16460
|
+
const zoomInLabel = useMessage("viewport-zoom-in");
|
|
16461
|
+
const toggleMenuLabel = useMessage("viewport-toggle-menu");
|
|
16178
16462
|
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
|
|
16179
16463
|
"div",
|
|
16180
16464
|
{
|
|
@@ -16183,15 +16467,14 @@ var ViewportControls = ({
|
|
|
16183
16467
|
children: [
|
|
16184
16468
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: getClassName35("actions"), children: /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: getClassName35("actionsInner"), children: [
|
|
16185
16469
|
viewports.map((viewport, i) => /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
16186
|
-
|
|
16470
|
+
ViewportButton,
|
|
16187
16471
|
{
|
|
16188
|
-
|
|
16472
|
+
viewport,
|
|
16189
16473
|
onClick: () => {
|
|
16190
16474
|
setActiveViewport(viewport.width);
|
|
16191
16475
|
onViewportChange(viewport);
|
|
16192
16476
|
},
|
|
16193
|
-
isActive: activeViewport === viewport.width
|
|
16194
|
-
children: typeof viewport.icon === "string" ? icons[viewport.icon] || viewport.icon : viewport.icon || icons.Smartphone
|
|
16477
|
+
isActive: activeViewport === viewport.width
|
|
16195
16478
|
},
|
|
16196
16479
|
i
|
|
16197
16480
|
)),
|
|
@@ -16199,7 +16482,7 @@ var ViewportControls = ({
|
|
|
16199
16482
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
16200
16483
|
ActionButton,
|
|
16201
16484
|
{
|
|
16202
|
-
title:
|
|
16485
|
+
title: zoomOutLabel,
|
|
16203
16486
|
disabled: zoom <= ((_a = zoomOptions[0]) == null ? void 0 : _a.value),
|
|
16204
16487
|
onClick: (e) => {
|
|
16205
16488
|
e.stopPropagation();
|
|
@@ -16216,7 +16499,7 @@ var ViewportControls = ({
|
|
|
16216
16499
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
16217
16500
|
ActionButton,
|
|
16218
16501
|
{
|
|
16219
|
-
title:
|
|
16502
|
+
title: zoomInLabel,
|
|
16220
16503
|
disabled: zoom >= ((_b = zoomOptions[zoomOptions.length - 1]) == null ? void 0 : _b.value),
|
|
16221
16504
|
onClick: (e) => {
|
|
16222
16505
|
e.stopPropagation();
|
|
@@ -16259,7 +16542,7 @@ var ViewportControls = ({
|
|
|
16259
16542
|
"button",
|
|
16260
16543
|
{
|
|
16261
16544
|
className: getClassName35("toggleButton"),
|
|
16262
|
-
title:
|
|
16545
|
+
title: toggleMenuLabel,
|
|
16263
16546
|
onClick: () => setIsExpanded((s) => !s),
|
|
16264
16547
|
children: isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(X, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Monitor, { size: 16 })
|
|
16265
16548
|
}
|
|
@@ -16866,12 +17149,15 @@ var styles_module_default32 = { "BlocksPlugin": "_BlocksPlugin_9af19_1" };
|
|
|
16866
17149
|
init_lib();
|
|
16867
17150
|
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
16868
17151
|
var getClassName40 = get_class_name_factory_default("BlocksPlugin", styles_module_default32);
|
|
16869
|
-
var blocksPlugin = () =>
|
|
16870
|
-
|
|
16871
|
-
|
|
16872
|
-
|
|
16873
|
-
|
|
16874
|
-
})
|
|
17152
|
+
var blocksPlugin = (props = {}) => {
|
|
17153
|
+
var _a, _b;
|
|
17154
|
+
return {
|
|
17155
|
+
name: "blocks",
|
|
17156
|
+
label: (_a = props.label) != null ? _a : "Blocks",
|
|
17157
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: getClassName40(), children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Components, {}) }),
|
|
17158
|
+
icon: (_b = props.icon) != null ? _b : /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Hammer, {})
|
|
17159
|
+
};
|
|
17160
|
+
};
|
|
16875
17161
|
|
|
16876
17162
|
// plugins/outline/index.tsx
|
|
16877
17163
|
init_react_import();
|
|
@@ -16885,17 +17171,21 @@ var styles_module_default33 = { "OutlinePlugin": "_OutlinePlugin_16k03_1" };
|
|
|
16885
17171
|
init_lib();
|
|
16886
17172
|
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
16887
17173
|
var getClassName41 = get_class_name_factory_default("OutlinePlugin", styles_module_default33);
|
|
16888
|
-
var outlinePlugin = () =>
|
|
16889
|
-
|
|
16890
|
-
|
|
16891
|
-
|
|
16892
|
-
|
|
16893
|
-
})
|
|
17174
|
+
var outlinePlugin = (props = {}) => {
|
|
17175
|
+
var _a, _b;
|
|
17176
|
+
return {
|
|
17177
|
+
name: "outline",
|
|
17178
|
+
label: (_a = props.label) != null ? _a : "Outline",
|
|
17179
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: getClassName41(), children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Outline, {}) }),
|
|
17180
|
+
icon: (_b = props.icon) != null ? _b : /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Layers, {})
|
|
17181
|
+
};
|
|
17182
|
+
};
|
|
16894
17183
|
|
|
16895
17184
|
// plugins/fields/index.tsx
|
|
16896
17185
|
init_react_import();
|
|
16897
17186
|
init_lucide_react();
|
|
16898
17187
|
init_store();
|
|
17188
|
+
init_use_message();
|
|
16899
17189
|
|
|
16900
17190
|
// css-module:/home/runner/work/puck/puck/packages/core/plugins/fields/styles.module.css#css-module
|
|
16901
17191
|
init_react_import();
|
|
@@ -16906,21 +17196,22 @@ init_lib();
|
|
|
16906
17196
|
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
16907
17197
|
var getClassName42 = get_class_name_factory_default("FieldsPlugin", styles_module_default34);
|
|
16908
17198
|
var CurrentTitle = () => {
|
|
17199
|
+
const pageLabel = useMessage("label-page");
|
|
16909
17200
|
const label = useAppStore((s) => {
|
|
16910
17201
|
var _a, _b;
|
|
16911
17202
|
const selectedItem = s.selectedItem;
|
|
16912
|
-
return selectedItem ? (_b = (_a = s.config.components[selectedItem.type]) == null ? void 0 : _a.label) != null ? _b : selectedItem.type :
|
|
17203
|
+
return selectedItem ? (_b = (_a = s.config.components[selectedItem.type]) == null ? void 0 : _a.label) != null ? _b : selectedItem.type : null;
|
|
16913
17204
|
});
|
|
16914
|
-
return label;
|
|
17205
|
+
return label != null ? label : pageLabel;
|
|
16915
17206
|
};
|
|
16916
|
-
var fieldsPlugin = ({ desktopSideBar = "right" } = {}) => ({
|
|
17207
|
+
var fieldsPlugin = ({ desktopSideBar = "right", label, icon } = {}) => ({
|
|
16917
17208
|
name: "fields",
|
|
16918
|
-
label: "Fields",
|
|
17209
|
+
label: label != null ? label : "Fields",
|
|
16919
17210
|
render: () => /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: getClassName42(), children: [
|
|
16920
17211
|
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: getClassName42("header"), children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Breadcrumbs, { numParents: 2, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(CurrentTitle, {}) }) }),
|
|
16921
17212
|
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Fields, {})
|
|
16922
17213
|
] }),
|
|
16923
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(RectangleEllipsis, {}),
|
|
17214
|
+
icon: icon != null ? icon : /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(RectangleEllipsis, {}),
|
|
16924
17215
|
mobileOnly: desktopSideBar === "right"
|
|
16925
17216
|
});
|
|
16926
17217
|
|
|
@@ -16939,13 +17230,14 @@ var getLayoutClassName = get_class_name_factory_default("PuckLayout", styles_mod
|
|
|
16939
17230
|
var getPluginTabClassName = get_class_name_factory_default("PuckPluginTab", styles_module_default22);
|
|
16940
17231
|
var useBrowserLayoutEffect = typeof window === "undefined" ? import_react94.useEffect : import_react94.useLayoutEffect;
|
|
16941
17232
|
var FieldSideBar = () => {
|
|
17233
|
+
const pageLabel = useMessage("label-page");
|
|
16942
17234
|
const title = useAppStore(
|
|
16943
17235
|
(s) => {
|
|
16944
17236
|
var _a, _b, _c;
|
|
16945
|
-
return s.selectedItem ? (_b = (_a = s.config.components[s.selectedItem.type]) == null ? void 0 : _a["label"]) != null ? _b : s.selectedItem.type.toString() : (
|
|
17237
|
+
return s.selectedItem ? (_b = (_a = s.config.components[s.selectedItem.type]) == null ? void 0 : _a["label"]) != null ? _b : s.selectedItem.type.toString() : (_c = s.config.root) == null ? void 0 : _c.label;
|
|
16946
17238
|
}
|
|
16947
17239
|
);
|
|
16948
|
-
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(SidebarSection, { noBorderTop: true, showBreadcrumbs: true, title, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Fields, {}) });
|
|
17240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(SidebarSection, { noBorderTop: true, showBreadcrumbs: true, title: title || pageLabel, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Fields, {}) });
|
|
16949
17241
|
};
|
|
16950
17242
|
var PluginTab = ({
|
|
16951
17243
|
children,
|
|
@@ -17047,16 +17339,22 @@ var Layout = ({ children }) => {
|
|
|
17047
17339
|
() => !!(plugins == null ? void 0 : plugins.find((p) => p.name === "legacy-side-bar")),
|
|
17048
17340
|
[plugins]
|
|
17049
17341
|
);
|
|
17342
|
+
const blocksLabel = useMessage("plugin-blocks");
|
|
17343
|
+
const outlineLabel = useMessage("plugin-outline");
|
|
17344
|
+
const fieldsLabel = useMessage("plugin-fields");
|
|
17050
17345
|
const pluginItems = (0, import_react94.useMemo)(() => {
|
|
17051
17346
|
const details = {};
|
|
17052
|
-
const defaultPlugins = [
|
|
17347
|
+
const defaultPlugins = [
|
|
17348
|
+
blocksPlugin({ label: blocksLabel }),
|
|
17349
|
+
outlinePlugin({ label: outlineLabel })
|
|
17350
|
+
];
|
|
17053
17351
|
const isLegacy = (plugin) => plugin.name === "legacy-side-bar" ? -1 : 0;
|
|
17054
17352
|
const combinedPlugins = [
|
|
17055
17353
|
...defaultPlugins,
|
|
17056
17354
|
...plugins != null ? plugins : []
|
|
17057
17355
|
].sort((a, b) => isLegacy(a) - isLegacy(b));
|
|
17058
17356
|
if (!(plugins == null ? void 0 : plugins.some((p) => p.name === "fields"))) {
|
|
17059
|
-
combinedPlugins.push(fieldsPlugin());
|
|
17357
|
+
combinedPlugins.push(fieldsPlugin({ label: fieldsLabel }));
|
|
17060
17358
|
}
|
|
17061
17359
|
combinedPlugins == null ? void 0 : combinedPlugins.forEach((plugin) => {
|
|
17062
17360
|
var _a, _b;
|
|
@@ -17093,7 +17391,15 @@ var Layout = ({ children }) => {
|
|
|
17093
17391
|
}
|
|
17094
17392
|
});
|
|
17095
17393
|
return details;
|
|
17096
|
-
}, [
|
|
17394
|
+
}, [
|
|
17395
|
+
plugins,
|
|
17396
|
+
currentPlugin,
|
|
17397
|
+
appStoreApi,
|
|
17398
|
+
leftSideBarVisible,
|
|
17399
|
+
blocksLabel,
|
|
17400
|
+
outlineLabel,
|
|
17401
|
+
fieldsLabel
|
|
17402
|
+
]);
|
|
17097
17403
|
(0, import_react94.useEffect)(() => {
|
|
17098
17404
|
if (!currentPlugin) {
|
|
17099
17405
|
const names = Object.keys(pluginItems);
|
|
@@ -17107,6 +17413,8 @@ var Layout = ({ children }) => {
|
|
|
17107
17413
|
return (_a = s.state.ui.mobilePanelExpanded) != null ? _a : false;
|
|
17108
17414
|
}
|
|
17109
17415
|
);
|
|
17416
|
+
const maximizeLabel = useMessage("layout-maximize");
|
|
17417
|
+
const minimizeLabel = useMessage("layout-minimize");
|
|
17110
17418
|
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
|
|
17111
17419
|
"div",
|
|
17112
17420
|
{
|
|
@@ -17143,7 +17451,7 @@ var Layout = ({ children }) => {
|
|
|
17143
17451
|
IconButton,
|
|
17144
17452
|
{
|
|
17145
17453
|
type: "button",
|
|
17146
|
-
title:
|
|
17454
|
+
title: mobilePanelExpanded ? minimizeLabel : maximizeLabel,
|
|
17147
17455
|
onClick: () => {
|
|
17148
17456
|
setUi({
|
|
17149
17457
|
mobilePanelExpanded: !mobilePanelExpanded
|
|
@@ -17218,6 +17526,7 @@ function PuckProvider({ children }) {
|
|
|
17218
17526
|
iframe: _iframe,
|
|
17219
17527
|
initialHistory: _initialHistory,
|
|
17220
17528
|
metadata,
|
|
17529
|
+
dictionary,
|
|
17221
17530
|
onAction,
|
|
17222
17531
|
fieldTransforms,
|
|
17223
17532
|
_experimentalFullScreenCanvas,
|
|
@@ -17315,6 +17624,7 @@ function PuckProvider({ children }) {
|
|
|
17315
17624
|
_experimentalVirtualization: !!_experimentalVirtualization,
|
|
17316
17625
|
onAction,
|
|
17317
17626
|
metadata,
|
|
17627
|
+
dictionary: dictionary || {},
|
|
17318
17628
|
fieldTransforms: loadedFieldTransforms
|
|
17319
17629
|
};
|
|
17320
17630
|
},
|
|
@@ -17330,6 +17640,7 @@ function PuckProvider({ children }) {
|
|
|
17330
17640
|
_experimentalVirtualization,
|
|
17331
17641
|
onAction,
|
|
17332
17642
|
metadata,
|
|
17643
|
+
dictionary,
|
|
17333
17644
|
loadedFieldTransforms
|
|
17334
17645
|
]
|
|
17335
17646
|
);
|
|
@@ -17642,13 +17953,30 @@ init_walk_tree();
|
|
|
17642
17953
|
|
|
17643
17954
|
// plugins/legacy-side-bar/index.tsx
|
|
17644
17955
|
init_react_import();
|
|
17956
|
+
init_use_message();
|
|
17645
17957
|
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
17646
|
-
var
|
|
17958
|
+
var LegacySideBar = ({
|
|
17959
|
+
outlineLabel,
|
|
17960
|
+
componentsLabel
|
|
17961
|
+
}) => {
|
|
17962
|
+
const componentsLabelMessage = useMessage("plugin-components");
|
|
17963
|
+
const outlineLabelMessage = useMessage("plugin-outline");
|
|
17964
|
+
const resolvedComponentsLabel = componentsLabel != null ? componentsLabel : componentsLabelMessage;
|
|
17965
|
+
const resolvedOutlineLabel = outlineLabel != null ? outlineLabel : outlineLabelMessage;
|
|
17966
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { style: { overflowY: "auto" }, children: [
|
|
17967
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(SidebarSection, { title: resolvedComponentsLabel, noBorderTop: true, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Components, {}) }),
|
|
17968
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(SidebarSection, { title: resolvedOutlineLabel, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Outline, {}) })
|
|
17969
|
+
] });
|
|
17970
|
+
};
|
|
17971
|
+
var legacySideBarPlugin = (props = {}) => ({
|
|
17647
17972
|
name: "legacy-side-bar",
|
|
17648
|
-
render: () => /* @__PURE__ */ (0, import_jsx_runtime95.
|
|
17649
|
-
|
|
17650
|
-
|
|
17651
|
-
|
|
17973
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
17974
|
+
LegacySideBar,
|
|
17975
|
+
{
|
|
17976
|
+
outlineLabel: props.outlineLabel,
|
|
17977
|
+
componentsLabel: props.componentsLabel
|
|
17978
|
+
}
|
|
17979
|
+
)
|
|
17652
17980
|
});
|
|
17653
17981
|
// Annotate the CommonJS export names for ESM import in node:
|
|
17654
17982
|
0 && (module.exports = {
|