@puckeditor/core 0.22.2 → 0.23.0-canary.20671fd7

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.
@@ -3143,7 +3143,7 @@ var init_fields = __esm({
3143
3143
  const componentData = node == null ? void 0 : node.data;
3144
3144
  const parentNode = (node == null ? void 0 : node.parentId) ? nodes[node.parentId] : null;
3145
3145
  const parent = (parentNode == null ? void 0 : parentNode.data) || null;
3146
- const { getComponentConfig, state } = appStore.getState();
3146
+ const { getComponentConfig, state, config } = appStore.getState();
3147
3147
  const componentConfig = getComponentConfig(componentData == null ? void 0 : componentData.type);
3148
3148
  if (!componentData || !componentConfig) return;
3149
3149
  const defaultFields2 = componentConfig.fields || {};
@@ -3176,6 +3176,9 @@ var init_fields = __esm({
3176
3176
  if (((_b = appStore.getState().selectedItem) == null ? void 0 : _b.props.id) !== id) {
3177
3177
  return;
3178
3178
  }
3179
+ if (appStore.getState().config !== config) {
3180
+ return;
3181
+ }
3179
3182
  appStore.setState({
3180
3183
  fields: {
3181
3184
  fields: newFields,
@@ -3194,10 +3197,18 @@ var init_fields = __esm({
3194
3197
  );
3195
3198
  (0, import_react10.useEffect)(() => {
3196
3199
  resolveFields(true);
3197
- return appStore.subscribe(
3200
+ const unsubscribeData = appStore.subscribe(
3198
3201
  (s) => s.state.indexes.nodes[id || "root"],
3199
3202
  () => resolveFields()
3200
3203
  );
3204
+ const unsubscribeConfig = appStore.subscribe(
3205
+ (s) => s.config,
3206
+ () => resolveFields(true)
3207
+ );
3208
+ return () => {
3209
+ unsubscribeData();
3210
+ unsubscribeConfig();
3211
+ };
3201
3212
  }, [id]);
3202
3213
  };
3203
3214
  }
@@ -3404,6 +3415,7 @@ var init_store = __esm({
3404
3415
  _experimentalFullScreenCanvas: false,
3405
3416
  _experimentalVirtualization: false,
3406
3417
  metadata: {},
3418
+ dictionary: {},
3407
3419
  fieldTransforms: {}
3408
3420
  }, initialAppStore), {
3409
3421
  fields: createFieldsSlice(set, get),
@@ -3798,6 +3810,118 @@ var init_styles_module2 = __esm({
3798
3810
  }
3799
3811
  });
3800
3812
 
3813
+ // lib/dictionary.ts
3814
+ var defaultDictionary, interpolate, getMessage;
3815
+ var init_dictionary = __esm({
3816
+ "lib/dictionary.ts"() {
3817
+ "use strict";
3818
+ init_react_import();
3819
+ defaultDictionary = {
3820
+ // Header
3821
+ "header-publish": "Publish",
3822
+ "header-undo": "undo",
3823
+ "header-redo": "redo",
3824
+ "header-toggle-leftsidebar": "Toggle left sidebar",
3825
+ "header-toggle-rightsidebar": "Toggle right sidebar",
3826
+ "header-toggle-menubar": "Toggle menu bar",
3827
+ // Component action bar
3828
+ "action-selectparent": "Select parent",
3829
+ "action-duplicate": "Duplicate",
3830
+ "action-delete": "Delete",
3831
+ // Fallback labels — shared by the breadcrumbs, fields panel and header
3832
+ "label-page": "Page",
3833
+ "label-component": "Component",
3834
+ // Outline
3835
+ "outline-empty": "No items",
3836
+ "outline-collapse": "Collapse",
3837
+ "outline-expand": "Expand",
3838
+ // Drawer (component list)
3839
+ "drawer-category-collapse": "Collapse {title}",
3840
+ "drawer-category-expand": "Expand {title}",
3841
+ "drawer-category-other": "Other",
3842
+ // Canvas
3843
+ "canvas-noconfig": "No configuration for {type}",
3844
+ // Fields
3845
+ "field-readonly": "Read-only",
3846
+ "field-arrayitem-summary": "Item #{index}",
3847
+ "field-arrayitem-duplicate": "Duplicate",
3848
+ "field-arrayitem-delete": "Delete",
3849
+ "field-external-selectdata": "Select data",
3850
+ "field-external-search": "Search",
3851
+ "field-external-togglefilters": "Toggle filters",
3852
+ "field-external-item": "External item",
3853
+ "field-external-result-singular": "{count} result",
3854
+ "field-external-result-plural": "{count} results",
3855
+ // Rich text field
3856
+ "field-richtext-bold": "Bold",
3857
+ "field-richtext-italic": "Italic",
3858
+ "field-richtext-underline": "Underline",
3859
+ "field-richtext-strikethrough": "Strikethrough",
3860
+ "field-richtext-blockquote": "Blockquote",
3861
+ "field-richtext-code-inline": "Inline code",
3862
+ "field-richtext-code-block": "Code block",
3863
+ "field-richtext-list-bullet": "Bullet list",
3864
+ "field-richtext-list-ordered": "Ordered list",
3865
+ "field-richtext-horizontalrule": "Horizontal rule",
3866
+ "field-richtext-align-left": "Align left",
3867
+ "field-richtext-align-center": "Align center",
3868
+ "field-richtext-align-right": "Align right",
3869
+ "field-richtext-align-justify": "Justify",
3870
+ "field-richtext-select": "Select",
3871
+ "field-richtext-headingselect-1": "Heading 1",
3872
+ "field-richtext-headingselect-2": "Heading 2",
3873
+ "field-richtext-headingselect-3": "Heading 3",
3874
+ "field-richtext-headingselect-4": "Heading 4",
3875
+ "field-richtext-headingselect-5": "Heading 5",
3876
+ "field-richtext-headingselect-6": "Heading 6",
3877
+ "field-richtext-alignselect-left": "Left",
3878
+ "field-richtext-alignselect-center": "Center",
3879
+ "field-richtext-alignselect-right": "Right",
3880
+ "field-richtext-alignselect-justify": "Justify",
3881
+ "field-richtext-listselect-bullet": "Bullet list",
3882
+ "field-richtext-listselect-ordered": "Ordered list",
3883
+ // Viewport controls
3884
+ "viewport-zoom-in": "Zoom viewport in",
3885
+ "viewport-zoom-out": "Zoom viewport out",
3886
+ "viewport-zoom-auto": "{zoom}% (Auto)",
3887
+ "viewport-toggle-menu": "Toggle viewport menu",
3888
+ "viewport-switch": "Switch to {label} viewport",
3889
+ "viewport-switch-default": "Switch viewport",
3890
+ // Plugin bar
3891
+ "plugin-blocks": "Blocks",
3892
+ "plugin-outline": "Outline",
3893
+ "plugin-fields": "Fields",
3894
+ "plugin-components": "Components",
3895
+ // Layout
3896
+ "layout-maximize": "maximize",
3897
+ "layout-minimize": "minimize",
3898
+ // Loader
3899
+ "loader-loading": "loading"
3900
+ };
3901
+ interpolate = (template, params) => template.replace(
3902
+ /\{(\w+)\}/g,
3903
+ (match, key) => params[key] !== void 0 ? String(params[key]) : match
3904
+ );
3905
+ getMessage = (dictionary, key, params) => {
3906
+ var _a;
3907
+ const message = (_a = dictionary[key]) != null ? _a : defaultDictionary[key];
3908
+ return params ? interpolate(message, params) : message;
3909
+ };
3910
+ }
3911
+ });
3912
+
3913
+ // lib/use-message.ts
3914
+ var useMessage;
3915
+ var init_use_message = __esm({
3916
+ "lib/use-message.ts"() {
3917
+ "use strict";
3918
+ init_react_import();
3919
+ init_store();
3920
+ init_dictionary();
3921
+ useMessage = (key, params) => useAppStore((s) => getMessage(s.dictionary, key, params));
3922
+ }
3923
+ });
3924
+
3801
3925
  // components/Loader/index.tsx
3802
3926
  var import_jsx_runtime3, getClassName2, Loader;
3803
3927
  var init_Loader = __esm({
@@ -3806,6 +3930,7 @@ var init_Loader = __esm({
3806
3930
  init_react_import();
3807
3931
  init_lib();
3808
3932
  init_styles_module2();
3933
+ init_use_message();
3809
3934
  import_jsx_runtime3 = require("react/jsx-runtime");
3810
3935
  getClassName2 = get_class_name_factory_default("Loader", styles_module_default4);
3811
3936
  Loader = (_a) => {
@@ -3816,6 +3941,7 @@ var init_Loader = __esm({
3816
3941
  "color",
3817
3942
  "size"
3818
3943
  ]);
3944
+ const loadingLabel = useMessage("loader-loading");
3819
3945
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
3820
3946
  "span",
3821
3947
  __spreadValues({
@@ -3825,7 +3951,7 @@ var init_Loader = __esm({
3825
3951
  height: size,
3826
3952
  color
3827
3953
  },
3828
- "aria-label": "loading"
3954
+ "aria-label": loadingLabel
3829
3955
  }, props)
3830
3956
  );
3831
3957
  };
@@ -4020,6 +4146,7 @@ var init_Control = __esm({
4020
4146
  // components/RichTextMenu/controls/AlignLeft.tsx
4021
4147
  function AlignLeft2() {
4022
4148
  const { editor, editorState } = useControlContext();
4149
+ const alignLeftLabel = useMessage("field-richtext-align-left");
4023
4150
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4024
4151
  Control,
4025
4152
  {
@@ -4030,7 +4157,7 @@ function AlignLeft2() {
4030
4157
  },
4031
4158
  disabled: !(editorState == null ? void 0 : editorState.canAlignLeft),
4032
4159
  active: editorState == null ? void 0 : editorState.isAlignLeft,
4033
- title: "Align left"
4160
+ title: alignLeftLabel
4034
4161
  }
4035
4162
  );
4036
4163
  }
@@ -4041,6 +4168,7 @@ var init_AlignLeft = __esm({
4041
4168
  init_react_import();
4042
4169
  init_lucide_react();
4043
4170
  init_Control();
4171
+ init_use_message();
4044
4172
  init_use_control_context();
4045
4173
  import_jsx_runtime20 = require("react/jsx-runtime");
4046
4174
  }
@@ -4049,6 +4177,7 @@ var init_AlignLeft = __esm({
4049
4177
  // components/RichTextMenu/controls/AlignCenter.tsx
4050
4178
  function AlignCenter2() {
4051
4179
  const { editor, editorState } = useControlContext();
4180
+ const alignCenterLabel = useMessage("field-richtext-align-center");
4052
4181
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4053
4182
  Control,
4054
4183
  {
@@ -4059,7 +4188,7 @@ function AlignCenter2() {
4059
4188
  },
4060
4189
  disabled: !(editorState == null ? void 0 : editorState.canAlignCenter),
4061
4190
  active: editorState == null ? void 0 : editorState.isAlignCenter,
4062
- title: "Align center"
4191
+ title: alignCenterLabel
4063
4192
  }
4064
4193
  );
4065
4194
  }
@@ -4070,6 +4199,7 @@ var init_AlignCenter = __esm({
4070
4199
  init_react_import();
4071
4200
  init_lucide_react();
4072
4201
  init_Control();
4202
+ init_use_message();
4073
4203
  init_use_control_context();
4074
4204
  import_jsx_runtime21 = require("react/jsx-runtime");
4075
4205
  }
@@ -4078,6 +4208,7 @@ var init_AlignCenter = __esm({
4078
4208
  // components/RichTextMenu/controls/AlignRight.tsx
4079
4209
  function AlignRight2() {
4080
4210
  const { editor, editorState } = useControlContext();
4211
+ const alignRightLabel = useMessage("field-richtext-align-right");
4081
4212
  return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4082
4213
  Control,
4083
4214
  {
@@ -4088,7 +4219,7 @@ function AlignRight2() {
4088
4219
  },
4089
4220
  disabled: !(editorState == null ? void 0 : editorState.canAlignRight),
4090
4221
  active: editorState == null ? void 0 : editorState.isAlignRight,
4091
- title: "Align right"
4222
+ title: alignRightLabel
4092
4223
  }
4093
4224
  );
4094
4225
  }
@@ -4099,6 +4230,7 @@ var init_AlignRight = __esm({
4099
4230
  init_react_import();
4100
4231
  init_lucide_react();
4101
4232
  init_Control();
4233
+ init_use_message();
4102
4234
  init_use_control_context();
4103
4235
  import_jsx_runtime22 = require("react/jsx-runtime");
4104
4236
  }
@@ -4107,6 +4239,7 @@ var init_AlignRight = __esm({
4107
4239
  // components/RichTextMenu/controls/AlignJustify.tsx
4108
4240
  function AlignJustify2() {
4109
4241
  const { editor, editorState } = useControlContext();
4242
+ const alignJustifyLabel = useMessage("field-richtext-align-justify");
4110
4243
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4111
4244
  Control,
4112
4245
  {
@@ -4117,7 +4250,7 @@ function AlignJustify2() {
4117
4250
  },
4118
4251
  disabled: !(editorState == null ? void 0 : editorState.canAlignJustify),
4119
4252
  active: editorState == null ? void 0 : editorState.isAlignJustify,
4120
- title: "Justify"
4253
+ title: alignJustifyLabel
4121
4254
  }
4122
4255
  );
4123
4256
  }
@@ -4128,6 +4261,7 @@ var init_AlignJustify = __esm({
4128
4261
  init_react_import();
4129
4262
  init_lucide_react();
4130
4263
  init_Control();
4264
+ init_use_message();
4131
4265
  init_use_control_context();
4132
4266
  import_jsx_runtime23 = require("react/jsx-runtime");
4133
4267
  }
@@ -4163,6 +4297,7 @@ var init_Select = __esm({
4163
4297
  init_lib();
4164
4298
  init_IconButton2();
4165
4299
  init_ActionBar();
4300
+ init_use_message();
4166
4301
  import_jsx_runtime24 = require("react/jsx-runtime");
4167
4302
  getClassName15 = get_class_name_factory_default("Select", styles_module_default11);
4168
4303
  getItemClassName = get_class_name_factory_default("SelectItem", styles_module_default11);
@@ -4183,6 +4318,7 @@ var init_Select = __esm({
4183
4318
  disabled = false
4184
4319
  }) => {
4185
4320
  const [open, setOpen] = (0, import_react25.useState)(false);
4321
+ const selectLabel = useMessage("field-richtext-select");
4186
4322
  const hasOptions = options.length > 0;
4187
4323
  const isDisabled = disabled || !hasOptions;
4188
4324
  const buttonInner = /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: getClassName15("buttonInner"), children: [
@@ -4192,7 +4328,7 @@ var init_Select = __esm({
4192
4328
  const trigger = mode === "actionBar" ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Action, { active: value !== defaultValue, disabled: isDisabled, children: buttonInner }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
4193
4329
  IconButton,
4194
4330
  {
4195
- title: "Select",
4331
+ title: selectLabel,
4196
4332
  active: value !== defaultValue,
4197
4333
  disabled: isDisabled,
4198
4334
  children: buttonInner
@@ -4275,21 +4411,32 @@ var init_SelectControl = __esm({
4275
4411
  });
4276
4412
 
4277
4413
  // components/RichTextMenu/controls/AlignSelect/use-options.ts
4278
- var import_react27, optionNodes, useAlignOptions;
4414
+ var import_react27, optionIcons, useAlignOptions;
4279
4415
  var init_use_options = __esm({
4280
4416
  "components/RichTextMenu/controls/AlignSelect/use-options.ts"() {
4281
4417
  "use strict";
4282
4418
  init_react_import();
4283
4419
  import_react27 = require("react");
4284
4420
  init_lucide_react();
4285
- optionNodes = {
4286
- left: { label: "Left", icon: AlignLeft },
4287
- center: { label: "Center", icon: AlignCenter },
4288
- right: { label: "Right", icon: AlignRight },
4289
- justify: { label: "Justify", icon: AlignJustify }
4421
+ init_use_message();
4422
+ optionIcons = {
4423
+ left: AlignLeft,
4424
+ center: AlignCenter,
4425
+ right: AlignRight,
4426
+ justify: AlignJustify
4290
4427
  };
4291
4428
  useAlignOptions = (fieldOptions) => {
4292
4429
  var _a;
4430
+ const leftString = useMessage("field-richtext-alignselect-left");
4431
+ const centerString = useMessage("field-richtext-alignselect-center");
4432
+ const rightString = useMessage("field-richtext-alignselect-right");
4433
+ const justifyString = useMessage("field-richtext-alignselect-justify");
4434
+ const optionLabels = {
4435
+ left: leftString,
4436
+ center: centerString,
4437
+ right: rightString,
4438
+ justify: justifyString
4439
+ };
4293
4440
  let blockOptions = [];
4294
4441
  if ((fieldOptions == null ? void 0 : fieldOptions.textAlign) !== false) {
4295
4442
  if (!((_a = fieldOptions == null ? void 0 : fieldOptions.textAlign) == null ? void 0 : _a.alignments)) {
@@ -4312,10 +4459,10 @@ var init_use_options = __esm({
4312
4459
  return (0, import_react27.useMemo)(
4313
4460
  () => blockOptions.map((item) => ({
4314
4461
  value: item,
4315
- label: optionNodes[item].label,
4316
- icon: optionNodes[item].icon
4462
+ label: optionLabels[item],
4463
+ icon: optionIcons[item]
4317
4464
  })),
4318
- [blockOptions]
4465
+ [blockOptions, optionLabels]
4319
4466
  );
4320
4467
  };
4321
4468
  }
@@ -4424,6 +4571,7 @@ var init_AlignSelect = __esm({
4424
4571
  // components/RichTextMenu/controls/Bold.tsx
4425
4572
  function Bold2() {
4426
4573
  const { editor, editorState } = useControlContext();
4574
+ const boldLabel = useMessage("field-richtext-bold");
4427
4575
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4428
4576
  Control,
4429
4577
  {
@@ -4434,7 +4582,7 @@ function Bold2() {
4434
4582
  },
4435
4583
  disabled: !(editorState == null ? void 0 : editorState.canBold),
4436
4584
  active: editorState == null ? void 0 : editorState.isBold,
4437
- title: "Bold"
4585
+ title: boldLabel
4438
4586
  }
4439
4587
  );
4440
4588
  }
@@ -4445,6 +4593,7 @@ var init_Bold = __esm({
4445
4593
  init_react_import();
4446
4594
  init_lucide_react();
4447
4595
  init_Control();
4596
+ init_use_message();
4448
4597
  init_use_control_context();
4449
4598
  import_jsx_runtime29 = require("react/jsx-runtime");
4450
4599
  }
@@ -4453,6 +4602,7 @@ var init_Bold = __esm({
4453
4602
  // components/RichTextMenu/controls/Italic.tsx
4454
4603
  function Italic2() {
4455
4604
  const { editor, editorState } = useControlContext();
4605
+ const italicLabel = useMessage("field-richtext-italic");
4456
4606
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4457
4607
  Control,
4458
4608
  {
@@ -4463,7 +4613,7 @@ function Italic2() {
4463
4613
  },
4464
4614
  disabled: !(editorState == null ? void 0 : editorState.canItalic),
4465
4615
  active: editorState == null ? void 0 : editorState.isItalic,
4466
- title: "Italic"
4616
+ title: italicLabel
4467
4617
  }
4468
4618
  );
4469
4619
  }
@@ -4474,6 +4624,7 @@ var init_Italic = __esm({
4474
4624
  init_react_import();
4475
4625
  init_lucide_react();
4476
4626
  init_Control();
4627
+ init_use_message();
4477
4628
  init_use_control_context();
4478
4629
  import_jsx_runtime30 = require("react/jsx-runtime");
4479
4630
  }
@@ -4482,6 +4633,7 @@ var init_Italic = __esm({
4482
4633
  // components/RichTextMenu/controls/Underline.tsx
4483
4634
  function Underline2() {
4484
4635
  const { editor, editorState } = useControlContext();
4636
+ const underlineLabel = useMessage("field-richtext-underline");
4485
4637
  return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4486
4638
  Control,
4487
4639
  {
@@ -4492,7 +4644,7 @@ function Underline2() {
4492
4644
  },
4493
4645
  disabled: !(editorState == null ? void 0 : editorState.canUnderline),
4494
4646
  active: editorState == null ? void 0 : editorState.isUnderline,
4495
- title: "Underline"
4647
+ title: underlineLabel
4496
4648
  }
4497
4649
  );
4498
4650
  }
@@ -4503,6 +4655,7 @@ var init_Underline = __esm({
4503
4655
  init_react_import();
4504
4656
  init_lucide_react();
4505
4657
  init_Control();
4658
+ init_use_message();
4506
4659
  init_use_control_context();
4507
4660
  import_jsx_runtime31 = require("react/jsx-runtime");
4508
4661
  }
@@ -4511,6 +4664,7 @@ var init_Underline = __esm({
4511
4664
  // components/RichTextMenu/controls/Strikethrough.tsx
4512
4665
  function Strikethrough2() {
4513
4666
  const { editor, editorState } = useControlContext();
4667
+ const strikethroughLabel = useMessage("field-richtext-strikethrough");
4514
4668
  return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4515
4669
  Control,
4516
4670
  {
@@ -4521,7 +4675,7 @@ function Strikethrough2() {
4521
4675
  },
4522
4676
  disabled: !(editorState == null ? void 0 : editorState.canStrike),
4523
4677
  active: editorState == null ? void 0 : editorState.isStrike,
4524
- title: "Strikethrough"
4678
+ title: strikethroughLabel
4525
4679
  }
4526
4680
  );
4527
4681
  }
@@ -4532,6 +4686,7 @@ var init_Strikethrough = __esm({
4532
4686
  init_react_import();
4533
4687
  init_lucide_react();
4534
4688
  init_Control();
4689
+ init_use_message();
4535
4690
  init_use_control_context();
4536
4691
  import_jsx_runtime32 = require("react/jsx-runtime");
4537
4692
  }
@@ -4540,6 +4695,7 @@ var init_Strikethrough = __esm({
4540
4695
  // components/RichTextMenu/controls/InlineCode.tsx
4541
4696
  function InlineCode() {
4542
4697
  const { editor, editorState } = useControlContext();
4698
+ const inlineCodeLabel = useMessage("field-richtext-code-inline");
4543
4699
  return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4544
4700
  Control,
4545
4701
  {
@@ -4550,7 +4706,7 @@ function InlineCode() {
4550
4706
  },
4551
4707
  disabled: !(editorState == null ? void 0 : editorState.canInlineCode),
4552
4708
  active: editorState == null ? void 0 : editorState.isInlineCode,
4553
- title: "Inline code"
4709
+ title: inlineCodeLabel
4554
4710
  }
4555
4711
  );
4556
4712
  }
@@ -4561,6 +4717,7 @@ var init_InlineCode = __esm({
4561
4717
  init_react_import();
4562
4718
  init_lucide_react();
4563
4719
  init_Control();
4720
+ init_use_message();
4564
4721
  init_use_control_context();
4565
4722
  import_jsx_runtime33 = require("react/jsx-runtime");
4566
4723
  }
@@ -4569,6 +4726,7 @@ var init_InlineCode = __esm({
4569
4726
  // components/RichTextMenu/controls/BulletList.tsx
4570
4727
  function BulletList() {
4571
4728
  const { editor, editorState } = useControlContext();
4729
+ const bulletListLabel = useMessage("field-richtext-list-bullet");
4572
4730
  return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
4573
4731
  Control,
4574
4732
  {
@@ -4579,7 +4737,7 @@ function BulletList() {
4579
4737
  },
4580
4738
  disabled: !(editorState == null ? void 0 : editorState.canBulletList),
4581
4739
  active: editorState == null ? void 0 : editorState.isBulletList,
4582
- title: "Bullet list"
4740
+ title: bulletListLabel
4583
4741
  }
4584
4742
  );
4585
4743
  }
@@ -4590,6 +4748,7 @@ var init_BulletList = __esm({
4590
4748
  init_react_import();
4591
4749
  init_lucide_react();
4592
4750
  init_Control();
4751
+ init_use_message();
4593
4752
  init_use_control_context();
4594
4753
  import_jsx_runtime34 = require("react/jsx-runtime");
4595
4754
  }
@@ -4598,6 +4757,7 @@ var init_BulletList = __esm({
4598
4757
  // components/RichTextMenu/controls/OrderedList.tsx
4599
4758
  function OrderedList() {
4600
4759
  const { editor, editorState } = useControlContext();
4760
+ const orderedListLabel = useMessage("field-richtext-list-ordered");
4601
4761
  return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
4602
4762
  Control,
4603
4763
  {
@@ -4608,7 +4768,7 @@ function OrderedList() {
4608
4768
  },
4609
4769
  disabled: !(editorState == null ? void 0 : editorState.canOrderedList),
4610
4770
  active: editorState == null ? void 0 : editorState.isOrderedList,
4611
- title: "Ordered list"
4771
+ title: orderedListLabel
4612
4772
  }
4613
4773
  );
4614
4774
  }
@@ -4619,6 +4779,7 @@ var init_OrderedList = __esm({
4619
4779
  init_react_import();
4620
4780
  init_lucide_react();
4621
4781
  init_Control();
4782
+ init_use_message();
4622
4783
  init_use_control_context();
4623
4784
  import_jsx_runtime35 = require("react/jsx-runtime");
4624
4785
  }
@@ -4627,6 +4788,7 @@ var init_OrderedList = __esm({
4627
4788
  // components/RichTextMenu/controls/CodeBlock.tsx
4628
4789
  function CodeBlock() {
4629
4790
  const { editor, editorState } = useControlContext();
4791
+ const codeBlockLabel = useMessage("field-richtext-code-block");
4630
4792
  return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
4631
4793
  Control,
4632
4794
  {
@@ -4637,7 +4799,7 @@ function CodeBlock() {
4637
4799
  },
4638
4800
  disabled: !(editorState == null ? void 0 : editorState.canCodeBlock),
4639
4801
  active: editorState == null ? void 0 : editorState.isCodeBlock,
4640
- title: "Code block"
4802
+ title: codeBlockLabel
4641
4803
  }
4642
4804
  );
4643
4805
  }
@@ -4648,6 +4810,7 @@ var init_CodeBlock = __esm({
4648
4810
  init_react_import();
4649
4811
  init_lucide_react();
4650
4812
  init_Control();
4813
+ init_use_message();
4651
4814
  init_use_control_context();
4652
4815
  import_jsx_runtime36 = require("react/jsx-runtime");
4653
4816
  }
@@ -4656,6 +4819,7 @@ var init_CodeBlock = __esm({
4656
4819
  // components/RichTextMenu/controls/Blockquote.tsx
4657
4820
  function Blockquote() {
4658
4821
  const { editor, editorState } = useControlContext();
4822
+ const blockquoteLabel = useMessage("field-richtext-blockquote");
4659
4823
  return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
4660
4824
  Control,
4661
4825
  {
@@ -4666,7 +4830,7 @@ function Blockquote() {
4666
4830
  },
4667
4831
  disabled: !(editorState == null ? void 0 : editorState.canBlockquote),
4668
4832
  active: editorState == null ? void 0 : editorState.isBlockquote,
4669
- title: "Blockquote"
4833
+ title: blockquoteLabel
4670
4834
  }
4671
4835
  );
4672
4836
  }
@@ -4677,6 +4841,7 @@ var init_Blockquote = __esm({
4677
4841
  init_react_import();
4678
4842
  init_lucide_react();
4679
4843
  init_Control();
4844
+ init_use_message();
4680
4845
  init_use_control_context();
4681
4846
  import_jsx_runtime37 = require("react/jsx-runtime");
4682
4847
  }
@@ -4685,6 +4850,7 @@ var init_Blockquote = __esm({
4685
4850
  // components/RichTextMenu/controls/HorizontalRule.tsx
4686
4851
  function HorizontalRule() {
4687
4852
  const { editor, editorState } = useControlContext();
4853
+ const horizontalRuleLabel = useMessage("field-richtext-horizontalrule");
4688
4854
  return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
4689
4855
  Control,
4690
4856
  {
@@ -4694,7 +4860,7 @@ function HorizontalRule() {
4694
4860
  editor == null ? void 0 : editor.chain().focus().setHorizontalRule().run();
4695
4861
  },
4696
4862
  disabled: !(editorState == null ? void 0 : editorState.canHorizontalRule),
4697
- title: "Horizontal rule"
4863
+ title: horizontalRuleLabel
4698
4864
  }
4699
4865
  );
4700
4866
  }
@@ -4705,29 +4871,45 @@ var init_HorizontalRule = __esm({
4705
4871
  init_react_import();
4706
4872
  init_lucide_react();
4707
4873
  init_Control();
4874
+ init_use_message();
4708
4875
  init_use_control_context();
4709
4876
  import_jsx_runtime38 = require("react/jsx-runtime");
4710
4877
  }
4711
4878
  });
4712
4879
 
4713
4880
  // components/RichTextMenu/controls/HeadingSelect/use-options.ts
4714
- var import_react30, optionNodes2, useHeadingOptions;
4881
+ var import_react30, optionIcons2, useHeadingOptions;
4715
4882
  var init_use_options2 = __esm({
4716
4883
  "components/RichTextMenu/controls/HeadingSelect/use-options.ts"() {
4717
4884
  "use strict";
4718
4885
  init_react_import();
4719
4886
  import_react30 = require("react");
4720
4887
  init_lucide_react();
4721
- optionNodes2 = {
4722
- h1: { label: "Heading 1", icon: Heading1 },
4723
- h2: { label: "Heading 2", icon: Heading2 },
4724
- h3: { label: "Heading 3", icon: Heading3 },
4725
- h4: { label: "Heading 4", icon: Heading4 },
4726
- h5: { label: "Heading 5", icon: Heading5 },
4727
- h6: { label: "Heading 6", icon: Heading6 }
4888
+ init_use_message();
4889
+ optionIcons2 = {
4890
+ h1: Heading1,
4891
+ h2: Heading2,
4892
+ h3: Heading3,
4893
+ h4: Heading4,
4894
+ h5: Heading5,
4895
+ h6: Heading6
4728
4896
  };
4729
4897
  useHeadingOptions = (fieldOptions) => {
4730
4898
  var _a;
4899
+ const h1String = useMessage("field-richtext-headingselect-1");
4900
+ const h2String = useMessage("field-richtext-headingselect-2");
4901
+ const h3String = useMessage("field-richtext-headingselect-3");
4902
+ const h4String = useMessage("field-richtext-headingselect-4");
4903
+ const h5String = useMessage("field-richtext-headingselect-5");
4904
+ const h6String = useMessage("field-richtext-headingselect-6");
4905
+ const optionLabels = {
4906
+ h1: h1String,
4907
+ h2: h2String,
4908
+ h3: h3String,
4909
+ h4: h4String,
4910
+ h5: h5String,
4911
+ h6: h6String
4912
+ };
4731
4913
  let blockOptions = [];
4732
4914
  if ((fieldOptions == null ? void 0 : fieldOptions.heading) !== false) {
4733
4915
  if (!((_a = fieldOptions == null ? void 0 : fieldOptions.heading) == null ? void 0 : _a.levels)) {
@@ -4756,10 +4938,10 @@ var init_use_options2 = __esm({
4756
4938
  return (0, import_react30.useMemo)(
4757
4939
  () => blockOptions.map((item) => ({
4758
4940
  value: item,
4759
- label: optionNodes2[item].label,
4760
- icon: optionNodes2[item].icon
4941
+ label: optionLabels[item],
4942
+ icon: optionIcons2[item]
4761
4943
  })),
4762
- [blockOptions]
4944
+ [blockOptions, optionLabels]
4763
4945
  );
4764
4946
  };
4765
4947
  }
@@ -4869,18 +5051,25 @@ var init_HeadingSelect = __esm({
4869
5051
  });
4870
5052
 
4871
5053
  // components/RichTextMenu/controls/ListSelect/use-options.ts
4872
- var import_react33, optionNodes3, useListOptions;
5054
+ var import_react33, optionIcons3, useListOptions;
4873
5055
  var init_use_options3 = __esm({
4874
5056
  "components/RichTextMenu/controls/ListSelect/use-options.ts"() {
4875
5057
  "use strict";
4876
5058
  init_react_import();
4877
5059
  import_react33 = require("react");
4878
5060
  init_lucide_react();
4879
- optionNodes3 = {
4880
- ul: { label: "Bullet list", icon: List },
4881
- ol: { label: "Numbered list", icon: ListOrdered }
5061
+ init_use_message();
5062
+ optionIcons3 = {
5063
+ ul: List,
5064
+ ol: ListOrdered
4882
5065
  };
4883
5066
  useListOptions = (fieldOptions) => {
5067
+ const ulString = useMessage("field-richtext-listselect-bullet");
5068
+ const olString = useMessage("field-richtext-listselect-ordered");
5069
+ const optionLabels = {
5070
+ ul: ulString,
5071
+ ol: olString
5072
+ };
4884
5073
  let blockOptions = [];
4885
5074
  if ((fieldOptions == null ? void 0 : fieldOptions.listItem) !== false) {
4886
5075
  blockOptions = ["ul", "ol"];
@@ -4888,10 +5077,10 @@ var init_use_options3 = __esm({
4888
5077
  return (0, import_react33.useMemo)(
4889
5078
  () => blockOptions.map((item) => ({
4890
5079
  value: item,
4891
- label: optionNodes3[item].label,
4892
- icon: optionNodes3[item].icon
5080
+ label: optionLabels[item],
5081
+ icon: optionIcons3[item]
4893
5082
  })),
4894
- [blockOptions]
5083
+ [blockOptions, optionLabels]
4895
5084
  );
4896
5085
  };
4897
5086
  }
@@ -6447,6 +6636,7 @@ function setDeep(node, path, newVal) {
6447
6636
  }
6448
6637
 
6449
6638
  // components/AutoField/fields/ArrayField/index.tsx
6639
+ init_use_message();
6450
6640
  var import_jsx_runtime9 = require("react/jsx-runtime");
6451
6641
  var getClassName5 = get_class_name_factory_default("ArrayField", styles_module_default3);
6452
6642
  var getClassNameItem = get_class_name_factory_default("ArrayFieldItem", styles_module_default3);
@@ -6460,12 +6650,15 @@ var ItemSummaryInner = ({
6460
6650
  const path = `${[name]}[${index}]`;
6461
6651
  return getDeep(s, path);
6462
6652
  });
6653
+ const fallbackSummary = useMessage("field-arrayitem-summary", {
6654
+ index: originalIndex
6655
+ });
6463
6656
  const itemSummary = (0, import_react18.useMemo)(() => {
6464
6657
  if (data && field.getItemSummary) {
6465
6658
  return field.getItemSummary(data, index);
6466
6659
  }
6467
- return `Item #${originalIndex}`;
6468
- }, [data, field, originalIndex, index]);
6660
+ return fallbackSummary;
6661
+ }, [data, field, originalIndex, index, fallbackSummary]);
6469
6662
  return itemSummary;
6470
6663
  };
6471
6664
  var ItemSummary = (0, import_react18.memo)(ItemSummaryInner);
@@ -6687,6 +6880,8 @@ var ArrayField = ({
6687
6880
  const newArrayState = regenerateArrayState(getValue());
6688
6881
  setUi(mapArrayStateToUi(newArrayState), false);
6689
6882
  }, [numItems]);
6883
+ const duplicateLabel = useMessage("field-arrayitem-duplicate");
6884
+ const deleteLabel = useMessage("field-arrayitem-delete");
6690
6885
  if (field.type !== "array" || !field.arrayFields) {
6691
6886
  return null;
6692
6887
  }
@@ -6798,7 +6993,7 @@ var ArrayField = ({
6798
6993
  existingValue.splice(index, 0, newItem);
6799
6994
  updateValue(existingValue);
6800
6995
  },
6801
- title: "Duplicate",
6996
+ title: duplicateLabel,
6802
6997
  children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Copy, { size: 16 })
6803
6998
  }
6804
6999
  ) }),
@@ -6814,7 +7009,7 @@ var ArrayField = ({
6814
7009
  existingValue.splice(index, 1);
6815
7010
  updateValue(existingValue);
6816
7011
  },
6817
- title: "Delete",
7012
+ title: deleteLabel,
6818
7013
  children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Trash, { size: 16 })
6819
7014
  }
6820
7015
  ) })
@@ -7134,9 +7329,15 @@ var Button = (_a) => {
7134
7329
 
7135
7330
  // components/ExternalInput/index.tsx
7136
7331
  init_IconButton2();
7332
+ init_use_message();
7137
7333
  var import_jsx_runtime14 = require("react/jsx-runtime");
7138
7334
  var getClassName10 = get_class_name_factory_default("ExternalInput", styles_module_default6);
7139
7335
  var getClassNameModal = get_class_name_factory_default("ExternalInputModal", styles_module_default6);
7336
+ var DefaultFooter = ({ count }) => {
7337
+ const singular = useMessage("field-external-result-singular", { count });
7338
+ const plural = useMessage("field-external-result-plural", { count });
7339
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: getClassNameModal("footer"), children: count === 1 ? singular : plural });
7340
+ };
7140
7341
  var dataCache = {};
7141
7342
  var ExternalInput = ({
7142
7343
  field,
@@ -7195,16 +7396,16 @@ var ExternalInput = ({
7195
7396
  [id, field]
7196
7397
  );
7197
7398
  const Footer = (0, import_react22.useCallback)(
7198
- (props) => field.renderFooter ? field.renderFooter(props) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: getClassNameModal("footer"), children: [
7199
- props.items.length,
7200
- " result",
7201
- props.items.length === 1 ? "" : "s"
7202
- ] }),
7399
+ (props) => field.renderFooter ? field.renderFooter(props) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DefaultFooter, { count: props.items.length }),
7203
7400
  [field.renderFooter]
7204
7401
  );
7205
7402
  (0, import_react22.useEffect)(() => {
7206
7403
  search(searchQuery, filters);
7207
7404
  }, []);
7405
+ const externalItemLabel = useMessage("field-external-item");
7406
+ const searchLabel = useMessage("field-external-search");
7407
+ const toggleFiltersLabel = useMessage("field-external-togglefilters");
7408
+ const selectDataLabel = useMessage("field-external-selectdata");
7208
7409
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
7209
7410
  "div",
7210
7411
  {
@@ -7223,7 +7424,7 @@ var ExternalInput = ({
7223
7424
  onClick: () => setOpen(true),
7224
7425
  className: getClassName10("button"),
7225
7426
  disabled: readOnly,
7226
- children: value ? field.getItemSummary ? field.getItemSummary(value) : "External item" : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
7427
+ children: value ? field.getItemSummary ? field.getItemSummary(value) : externalItemLabel : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
7227
7428
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Link, { size: "16" }),
7228
7429
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: field.placeholder })
7229
7430
  ] })
@@ -7259,7 +7460,7 @@ var ExternalInput = ({
7259
7460
  children: [
7260
7461
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("masthead"), children: field.showSearch ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: getClassNameModal("searchForm"), children: [
7261
7462
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: getClassNameModal("search"), children: [
7262
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: getClassNameModal("searchIconText"), children: "Search" }),
7463
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: getClassNameModal("searchIconText"), children: searchLabel }),
7263
7464
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("searchIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Search, { size: "18" }) }),
7264
7465
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
7265
7466
  "input",
@@ -7277,12 +7478,12 @@ var ExternalInput = ({
7277
7478
  )
7278
7479
  ] }),
7279
7480
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: getClassNameModal("searchActions"), children: [
7280
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Button, { type: "submit", loading: isLoading, fullWidth: true, children: "Search" }),
7481
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Button, { type: "submit", loading: isLoading, fullWidth: true, children: searchLabel }),
7281
7482
  hasFilterFields && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("searchActionIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
7282
7483
  IconButton,
7283
7484
  {
7284
7485
  type: "button",
7285
- title: "Toggle filters",
7486
+ title: toggleFiltersLabel,
7286
7487
  onClick: (e) => {
7287
7488
  e.preventDefault();
7288
7489
  e.stopPropagation();
@@ -7292,7 +7493,7 @@ var ExternalInput = ({
7292
7493
  }
7293
7494
  ) })
7294
7495
  ] })
7295
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Heading7, { rank: "2", size: "xs", children: field.placeholder || "Select data" }) }),
7496
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Heading7, { rank: "2", size: "xs", children: field.placeholder || selectDataLabel }) }),
7296
7497
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: getClassNameModal("grid"), children: [
7297
7498
  hasFilterFields && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("filters"), children: hasFilterFields && Object.keys(filterFields).map((fieldName) => {
7298
7499
  const filterField = filterFields[fieldName];
@@ -7362,6 +7563,7 @@ var ExternalInput = ({
7362
7563
 
7363
7564
  // components/AutoField/fields/ExternalField/index.tsx
7364
7565
  init_lucide_react();
7566
+ init_use_message();
7365
7567
  var import_jsx_runtime15 = require("react/jsx-runtime");
7366
7568
  var ExternalField = ({
7367
7569
  field,
@@ -7377,6 +7579,7 @@ var ExternalField = ({
7377
7579
  const value = useDeepField(name);
7378
7580
  const validField = field;
7379
7581
  const deprecatedField = field;
7582
+ const selectDataLabel = useMessage("field-external-selectdata");
7380
7583
  (0, import_react23.useEffect)(() => {
7381
7584
  if (deprecatedField.adaptor) {
7382
7585
  console.error(
@@ -7399,7 +7602,7 @@ var ExternalField = ({
7399
7602
  name,
7400
7603
  field: __spreadProps(__spreadValues({}, validField), {
7401
7604
  // DEPRECATED
7402
- placeholder: ((_a = deprecatedField.adaptor) == null ? void 0 : _a.name) ? `Select from ${deprecatedField.adaptor.name}` : validField.placeholder || "Select data",
7605
+ placeholder: ((_a = deprecatedField.adaptor) == null ? void 0 : _a.name) ? `Select from ${deprecatedField.adaptor.name}` : validField.placeholder || selectDataLabel,
7403
7606
  mapProp: ((_b = deprecatedField.adaptor) == null ? void 0 : _b.mapProp) || validField.mapProp,
7404
7607
  mapRow: validField.mapRow,
7405
7608
  fetchList: ((_c = deprecatedField.adaptor) == null ? void 0 : _c.fetchList) ? () => __async(null, null, function* () {
@@ -7742,6 +7945,7 @@ init_get_class_name_factory();
7742
7945
  var import_react48 = require("react");
7743
7946
  init_lucide_react();
7744
7947
  init_store();
7948
+ init_use_message();
7745
7949
  var import_jsx_runtime53 = require("react/jsx-runtime");
7746
7950
  var getClassName19 = get_class_name_factory_default("Input", styles_module_default2);
7747
7951
  var FieldLabel = ({
@@ -7753,11 +7957,12 @@ var FieldLabel = ({
7753
7957
  className
7754
7958
  }) => {
7755
7959
  const El = el;
7960
+ const readOnlyLabel = useMessage("field-readonly");
7756
7961
  return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(El, { className, children: [
7757
7962
  /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: getClassName19("label"), children: [
7758
7963
  icon ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: getClassName19("labelIcon"), children: icon }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_jsx_runtime53.Fragment, {}),
7759
7964
  label,
7760
- readOnly && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: getClassName19("disabledIcon"), title: "Read-only", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Lock, { size: "12" }) })
7965
+ readOnly && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: getClassName19("disabledIcon"), title: readOnlyLabel, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Lock, { size: "12" }) })
7761
7966
  ] }),
7762
7967
  children
7763
7968
  ] });
@@ -8140,6 +8345,7 @@ function assignRefs(refs, node) {
8140
8345
  }
8141
8346
 
8142
8347
  // components/DraggableComponent/index.tsx
8348
+ init_use_message();
8143
8349
  var import_jsx_runtime56 = require("react/jsx-runtime");
8144
8350
  var getClassName21 = get_class_name_factory_default("DraggableComponent", styles_module_default15);
8145
8351
  var DEBUG2 = false;
@@ -8628,9 +8834,12 @@ var DraggableComponent = ({
8628
8834
  }
8629
8835
  setDragAxis(autoDragAxis);
8630
8836
  }, [ref, userDragAxis, autoDragAxis]);
8837
+ const selectParentLabel = useMessage("action-selectparent");
8838
+ const duplicateLabel = useMessage("action-duplicate");
8839
+ const deleteLabel = useMessage("action-delete");
8631
8840
  const parentAction = (0, import_react52.useMemo)(
8632
- () => (ctx == null ? void 0 : ctx.areaId) && (ctx == null ? void 0 : ctx.areaId) !== "root" && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ActionBar.Action, { onClick: onSelectParent, label: "Select parent", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(CornerLeftUp, { size: 16 }) }),
8633
- [ctx == null ? void 0 : ctx.areaId]
8841
+ () => (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 }) }),
8842
+ [ctx == null ? void 0 : ctx.areaId, selectParentLabel]
8634
8843
  );
8635
8844
  const nextContextValue = (0, import_react52.useMemo)(
8636
8845
  () => __spreadProps(__spreadValues({}, ctx), {
@@ -8710,8 +8919,15 @@ var DraggableComponent = ({
8710
8919
  ),
8711
8920
  hasNormalActions && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ActionBar.Separator, {})
8712
8921
  ] }),
8713
- permissions.duplicate && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ActionBar.Action, { onClick: onDuplicate, label: "Duplicate", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Copy, { className: getClassName21("actionsAction") }) }),
8714
- permissions.delete && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ActionBar.Action, { onClick: onDelete, label: "Delete", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Trash, { className: getClassName21("actionsAction") }) })
8922
+ permissions.duplicate && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
8923
+ ActionBar.Action,
8924
+ {
8925
+ onClick: onDuplicate,
8926
+ label: duplicateLabel,
8927
+ children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Copy, { className: getClassName21("actionsAction") })
8928
+ }
8929
+ ),
8930
+ 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") }) })
8715
8931
  ]
8716
8932
  }
8717
8933
  )
@@ -9292,6 +9508,9 @@ function useFieldTransformsTracked(config, item, transforms, readOnly, forceRead
9292
9508
  return mergedProps;
9293
9509
  }
9294
9510
 
9511
+ // components/DropZone/index.tsx
9512
+ init_use_message();
9513
+
9295
9514
  // lib/field-transforms/default-transforms/inline-text-transform.tsx
9296
9515
  init_react_import();
9297
9516
 
@@ -9917,7 +10136,7 @@ var DropZoneChild = ({
9917
10136
  inDroppableZone,
9918
10137
  itemRef
9919
10138
  }) => {
9920
- var _a, _b;
10139
+ var _a, _b, _c, _d;
9921
10140
  const metadata = useAppStore((s) => s.metadata);
9922
10141
  const ctx = (0, import_react68.useContext)(dropZoneContext);
9923
10142
  const { depth = 1 } = ctx != null ? ctx : {};
@@ -9985,7 +10204,11 @@ var DropZoneChild = ({
9985
10204
  return ((_a2 = s.selectedItem) == null ? void 0 : _a2.props.id) === componentId || false;
9986
10205
  }
9987
10206
  );
9988
- let label = (_b = (_a = componentConfig == null ? void 0 : componentConfig.label) != null ? _a : item == null ? void 0 : item.type.toString()) != null ? _b : "Component";
10207
+ const componentLabel = useMessage("label-component");
10208
+ const noConfigMessage = useMessage("canvas-noconfig", {
10209
+ type: (_b = (_a = item == null ? void 0 : item.type) == null ? void 0 : _a.toString()) != null ? _b : ""
10210
+ });
10211
+ let label = (_d = (_c = componentConfig == null ? void 0 : componentConfig.label) != null ? _c : item == null ? void 0 : item.type.toString()) != null ? _d : componentLabel;
9989
10212
  const defaultsProps = (0, import_react68.useMemo)(
9990
10213
  () => __spreadProps(__spreadValues(__spreadValues({}, componentConfig == null ? void 0 : componentConfig.defaultProps), item == null ? void 0 : item.props), {
9991
10214
  puck: puckProps,
@@ -10019,10 +10242,7 @@ var DropZoneChild = ({
10019
10242
  isLoading
10020
10243
  );
10021
10244
  if (!item) return;
10022
- const Render2 = componentConfig ? componentConfig.render : () => /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { style: { padding: 48, textAlign: "center" }, children: [
10023
- "No configuration for ",
10024
- item.type
10025
- ] });
10245
+ const Render2 = componentConfig ? componentConfig.render : () => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { style: { padding: 48, textAlign: "center" }, children: noConfigMessage });
10026
10246
  let componentType = item.type;
10027
10247
  const isInserting = "previewType" in item ? item.previewType === "insert" : false;
10028
10248
  return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
@@ -11475,6 +11695,7 @@ var styles_module_default19 = { "ComponentList": "_ComponentList_htktj_1", "Comp
11475
11695
  init_get_class_name_factory();
11476
11696
  var import_react75 = require("react");
11477
11697
  init_store();
11698
+ init_use_message();
11478
11699
  init_lucide_react();
11479
11700
  var import_jsx_runtime72 = require("react/jsx-runtime");
11480
11701
  var getClassName28 = get_class_name_factory_default("ComponentList", styles_module_default19);
@@ -11508,6 +11729,12 @@ var ComponentList = ({
11508
11729
  const componentList = useAppStore((s) => s.state.ui.componentList);
11509
11730
  const { expanded = true } = componentList[id] || {};
11510
11731
  const contentId = `puck-drawer-category-${id}`;
11732
+ const collapseTitle = useMessage("drawer-category-collapse", {
11733
+ title: title != null ? title : ""
11734
+ });
11735
+ const expandTitle = useMessage("drawer-category-expand", {
11736
+ title: title != null ? title : ""
11737
+ });
11511
11738
  return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: getClassName28({ isExpanded: expanded }), children: [
11512
11739
  title && /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
11513
11740
  "button",
@@ -11523,7 +11750,7 @@ var ComponentList = ({
11523
11750
  })
11524
11751
  })
11525
11752
  }),
11526
- title: expanded ? `Collapse${title ? ` ${title}` : ""}` : `Expand${title ? ` ${title}` : ""}`,
11753
+ title: expanded ? collapseTitle : expandTitle,
11527
11754
  children: [
11528
11755
  /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { children: title }),
11529
11756
  /* @__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 }) })
@@ -11547,11 +11774,13 @@ ComponentList.Item = ComponentListItem;
11547
11774
 
11548
11775
  // lib/use-component-list.tsx
11549
11776
  init_store();
11777
+ init_use_message();
11550
11778
  var import_jsx_runtime73 = require("react/jsx-runtime");
11551
11779
  var useComponentList = () => {
11552
11780
  const [componentList, setComponentList] = (0, import_react76.useState)();
11553
11781
  const config = useAppStore((s) => s.config);
11554
11782
  const uiComponentList = useAppStore((s) => s.state.ui.componentList);
11783
+ const otherLabel = useMessage("drawer-category-other");
11555
11784
  (0, import_react76.useEffect)(() => {
11556
11785
  var _a, _b, _c;
11557
11786
  if (Object.keys(uiComponentList).length > 0) {
@@ -11559,6 +11788,7 @@ var useComponentList = () => {
11559
11788
  let _componentList;
11560
11789
  _componentList = Object.entries(uiComponentList).map(
11561
11790
  ([categoryKey, category]) => {
11791
+ var _a2, _b2;
11562
11792
  if (!category.components) {
11563
11793
  return null;
11564
11794
  }
@@ -11572,14 +11802,14 @@ var useComponentList = () => {
11572
11802
  ComponentList,
11573
11803
  {
11574
11804
  id: categoryKey,
11575
- title: category.title || categoryKey,
11805
+ title: ((_b2 = (_a2 = config.categories) == null ? void 0 : _a2[categoryKey]) == null ? void 0 : _b2.title) || category.title || categoryKey,
11576
11806
  children: category.components.map((componentName, i) => {
11577
- var _a2;
11807
+ var _a3;
11578
11808
  const componentConf = config.components[componentName] || {};
11579
11809
  return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
11580
11810
  ComponentList.Item,
11581
11811
  {
11582
- label: (_a2 = componentConf["label"]) != null ? _a2 : componentName,
11812
+ label: (_a3 = componentConf["label"]) != null ? _a3 : componentName,
11583
11813
  name: componentName,
11584
11814
  index: i
11585
11815
  },
@@ -11600,7 +11830,7 @@ var useComponentList = () => {
11600
11830
  ComponentList,
11601
11831
  {
11602
11832
  id: "other",
11603
- title: ((_c = uiComponentList.other) == null ? void 0 : _c.title) || "Other",
11833
+ title: ((_c = uiComponentList.other) == null ? void 0 : _c.title) || otherLabel,
11604
11834
  children: remainingComponents.map((componentName, i) => {
11605
11835
  var _a2;
11606
11836
  const componentConf = config.components[componentName] || {};
@@ -11621,7 +11851,7 @@ var useComponentList = () => {
11621
11851
  }
11622
11852
  setComponentList(_componentList);
11623
11853
  }
11624
- }, [config.categories, config.components, uiComponentList]);
11854
+ }, [config.categories, config.components, uiComponentList, otherLabel]);
11625
11855
  return componentList;
11626
11856
  };
11627
11857
 
@@ -15056,6 +15286,7 @@ init_lucide_react();
15056
15286
  init_root_droppable_id();
15057
15287
  var import_react81 = require("react");
15058
15288
  init_store();
15289
+ init_use_message();
15059
15290
  var import_react_virtual2 = require("@tanstack/react-virtual");
15060
15291
  var import_jsx_runtime77 = require("react/jsx-runtime");
15061
15292
  var getClassName30 = get_class_name_factory_default("LayerTree", styles_module_default21);
@@ -15091,11 +15322,12 @@ var buildLayerNode = ({
15091
15322
  nodes,
15092
15323
  zoneCompound,
15093
15324
  zones,
15094
- zonesByParent
15325
+ zonesByParent,
15326
+ componentFallbackLabel = "Component"
15095
15327
  }) => {
15096
15328
  var _a, _b, _c;
15097
15329
  const nodeData = nodes[itemId];
15098
- const componentType = ((_a = nodeData == null ? void 0 : nodeData.data.type) == null ? void 0 : _a.toString()) || "Component";
15330
+ const componentType = ((_a = nodeData == null ? void 0 : nodeData.data.type) == null ? void 0 : _a.toString()) || componentFallbackLabel;
15099
15331
  const label = (_c = (_b = config.components[componentType]) == null ? void 0 : _b.label) != null ? _c : componentType;
15100
15332
  const childZoneCompounds = zonesByParent[itemId] || [];
15101
15333
  return {
@@ -15105,7 +15337,8 @@ var buildLayerNode = ({
15105
15337
  nodes,
15106
15338
  zoneCompound: childZoneCompound,
15107
15339
  zones,
15108
- zonesByParent
15340
+ zonesByParent,
15341
+ componentFallbackLabel
15109
15342
  })
15110
15343
  ),
15111
15344
  componentType,
@@ -15121,7 +15354,8 @@ var buildLayerTree = ({
15121
15354
  nodes,
15122
15355
  zoneCompound,
15123
15356
  zones,
15124
- zonesByParent = getZonesByParent(zones)
15357
+ zonesByParent = getZonesByParent(zones),
15358
+ componentFallbackLabel = "Component"
15125
15359
  }) => {
15126
15360
  var _a, _b;
15127
15361
  const contentIds = (_b = (_a = zones[zoneCompound]) == null ? void 0 : _a.contentIds) != null ? _b : [];
@@ -15134,7 +15368,8 @@ var buildLayerTree = ({
15134
15368
  nodes,
15135
15369
  zoneCompound,
15136
15370
  zones,
15137
- zonesByParent
15371
+ zonesByParent,
15372
+ componentFallbackLabel
15138
15373
  })
15139
15374
  ),
15140
15375
  label: getZoneLabel(zoneCompound, nodes, config, label),
@@ -15179,6 +15414,8 @@ var Layer = (0, import_react81.forwardRef)(function Layer2({
15179
15414
  (s) => s.hoveringComponent === node.itemId
15180
15415
  );
15181
15416
  const containsZone = node.childZones.length > 0;
15417
+ const collapseLabel = useMessage("outline-collapse");
15418
+ const expandLabel = useMessage("outline-expand");
15182
15419
  const setItemSelector = (0, import_react81.useCallback)(
15183
15420
  (itemSelector) => {
15184
15421
  dispatch({ type: "setUi", ui: { itemSelector } });
@@ -15228,7 +15465,7 @@ var Layer = (0, import_react81.forwardRef)(function Layer2({
15228
15465
  "div",
15229
15466
  {
15230
15467
  className: getClassNameLayer("chevron"),
15231
- title: isSelected ? "Collapse" : "Expand",
15468
+ title: isSelected ? collapseLabel : expandLabel,
15232
15469
  children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(ChevronDown, { size: "12" })
15233
15470
  }
15234
15471
  ),
@@ -15296,8 +15533,9 @@ var StaticLayerTreeItems = ({
15296
15533
  selectedPathIds,
15297
15534
  tree
15298
15535
  }) => {
15536
+ const noItemsLabel = useMessage("outline-empty");
15299
15537
  return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("ul", { className: getClassName30(), children: [
15300
- tree.items.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: getClassName30("helper"), children: "No items" }),
15538
+ tree.items.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: getClassName30("helper"), children: noItemsLabel }),
15301
15539
  tree.items.map((node) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
15302
15540
  Layer,
15303
15541
  {
@@ -15319,6 +15557,7 @@ var VirtualizedLayerTreeItems = ({
15319
15557
  tree
15320
15558
  }) => {
15321
15559
  const listRef = (0, import_react81.useRef)(null);
15560
+ const noItemsLabel = useMessage("outline-empty");
15322
15561
  const virtualizer = (0, import_react_virtual2.useVirtualizer)({
15323
15562
  count: tree.items.length,
15324
15563
  estimateSize: (index) => getEstimatedRowHeight(tree.items[index].itemId),
@@ -15387,7 +15626,7 @@ var VirtualizedLayerTreeItems = ({
15387
15626
  );
15388
15627
  }
15389
15628
  return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("ul", { className: getClassName30(), ref: listRef, children: [
15390
- tree.items.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: getClassName30("helper"), children: "No items" }),
15629
+ tree.items.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: getClassName30("helper"), children: noItemsLabel }),
15391
15630
  renderedItems
15392
15631
  ] });
15393
15632
  };
@@ -15410,6 +15649,7 @@ var LayerTree = ({
15410
15649
 
15411
15650
  // components/Puck/components/Outline/index.tsx
15412
15651
  init_store();
15652
+ init_use_message();
15413
15653
  var import_react82 = require("react");
15414
15654
 
15415
15655
  // lib/data/find-zones-for-area.ts
@@ -15432,6 +15672,7 @@ var Outline = () => {
15432
15672
  var _a;
15433
15673
  return ((_a = s.selectedItem) == null ? void 0 : _a.props.id) || null;
15434
15674
  });
15675
+ const componentFallbackLabel = useMessage("label-component");
15435
15676
  const rootZones = useAppStore(
15436
15677
  (0, import_shallow8.useShallow)((s) => findZonesForArea(s.state, "root"))
15437
15678
  );
@@ -15449,10 +15690,11 @@ var Outline = () => {
15449
15690
  label: rootZones.length === 1 ? "" : zoneCompound.split(":")[1],
15450
15691
  nodes,
15451
15692
  zoneCompound,
15452
- zones
15693
+ zones,
15694
+ componentFallbackLabel
15453
15695
  })
15454
15696
  ),
15455
- [config, nodes, rootZones, zones]
15697
+ [config, nodes, rootZones, zones, componentFallbackLabel]
15456
15698
  );
15457
15699
  const Wrapper = (0, import_react82.useMemo)(() => outlineOverride || "div", [outlineOverride]);
15458
15700
  return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Wrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
@@ -15626,7 +15868,8 @@ var generateUsePuck = (store, getState) => {
15626
15868
  const parentNode = store.state.indexes.nodes[parentId];
15627
15869
  if (!parentNode) return;
15628
15870
  return parentNode.data;
15629
- }
15871
+ },
15872
+ dictionary: store.dictionary
15630
15873
  };
15631
15874
  storeData.__private = {
15632
15875
  appState: store.state
@@ -15643,7 +15886,8 @@ var convertToPickedStore = (store) => {
15643
15886
  dispatch: store.dispatch,
15644
15887
  permissions: store.permissions,
15645
15888
  history: store.history,
15646
- selectedItem: store.selectedItem
15889
+ selectedItem: store.selectedItem,
15890
+ dictionary: store.dictionary
15647
15891
  };
15648
15892
  };
15649
15893
  var useRegisterUsePuckStore = (appStore) => {
@@ -15711,6 +15955,7 @@ var styles_module_default22 = { "Puck": "_Puck_mr27u_19", "Puck-portal": "_Puck-
15711
15955
 
15712
15956
  // components/Puck/components/Layout/index.tsx
15713
15957
  init_store();
15958
+ init_use_message();
15714
15959
 
15715
15960
  // components/DefaultOverride/index.tsx
15716
15961
  init_react_import();
@@ -15759,6 +16004,7 @@ var styles_module_default23 = { "MenuBar": "_MenuBar_1hxnj_1", "MenuBar--menuOpe
15759
16004
 
15760
16005
  // components/MenuBar/index.tsx
15761
16006
  init_store();
16007
+ init_use_message();
15762
16008
  var import_jsx_runtime80 = require("react/jsx-runtime");
15763
16009
  var getClassName31 = get_class_name_factory_default("MenuBar", styles_module_default23);
15764
16010
  function MenuBar({
@@ -15770,6 +16016,8 @@ function MenuBar({
15770
16016
  const forward = useAppStore((s) => s.history.forward);
15771
16017
  const hasFuture = useAppStore((s) => s.history.hasFuture());
15772
16018
  const hasPast = useAppStore((s) => s.history.hasPast());
16019
+ const undoLabel = useMessage("header-undo");
16020
+ const redoLabel = useMessage("header-redo");
15773
16021
  return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
15774
16022
  "div",
15775
16023
  {
@@ -15790,7 +16038,7 @@ function MenuBar({
15790
16038
  IconButton,
15791
16039
  {
15792
16040
  type: "button",
15793
- title: "undo",
16041
+ title: undoLabel,
15794
16042
  disabled: !hasPast,
15795
16043
  onClick: back,
15796
16044
  children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Undo2, { size: 21 })
@@ -15800,7 +16048,7 @@ function MenuBar({
15800
16048
  IconButton,
15801
16049
  {
15802
16050
  type: "button",
15803
- title: "redo",
16051
+ title: redoLabel,
15804
16052
  disabled: !hasFuture,
15805
16053
  onClick: forward,
15806
16054
  children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Redo2, { size: 21 })
@@ -15815,6 +16063,7 @@ function MenuBar({
15815
16063
 
15816
16064
  // components/Puck/components/Header/index.tsx
15817
16065
  init_lib();
16066
+ init_use_message();
15818
16067
 
15819
16068
  // css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Header/styles.module.css#css-module
15820
16069
  init_react_import();
@@ -15895,6 +16144,11 @@ var HeaderInner = ({
15895
16144
  },
15896
16145
  [dispatch, leftSideBarVisible, rightSideBarVisible]
15897
16146
  );
16147
+ const publishLabel = useMessage("header-publish");
16148
+ const pageLabel = useMessage("label-page");
16149
+ const toggleLeftLabel = useMessage("header-toggle-leftsidebar");
16150
+ const toggleRightLabel = useMessage("header-toggle-rightsidebar");
16151
+ const toggleMenuLabel = useMessage("header-toggle-menubar");
15898
16152
  return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
15899
16153
  CustomHeader,
15900
16154
  {
@@ -15906,7 +16160,7 @@ var HeaderInner = ({
15906
16160
  onPublish && onPublish(data);
15907
16161
  },
15908
16162
  icon: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Globe, { size: "14px" }),
15909
- children: "Publish"
16163
+ children: publishLabel
15910
16164
  }
15911
16165
  ) }) }),
15912
16166
  children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
@@ -15926,7 +16180,7 @@ var HeaderInner = ({
15926
16180
  onClick: () => {
15927
16181
  toggleSidebars("left");
15928
16182
  },
15929
- title: "Toggle left sidebar",
16183
+ title: toggleLeftLabel,
15930
16184
  children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(PanelLeft, { focusable: "false" })
15931
16185
  }
15932
16186
  ) }),
@@ -15937,13 +16191,13 @@ var HeaderInner = ({
15937
16191
  onClick: () => {
15938
16192
  toggleSidebars("right");
15939
16193
  },
15940
- title: "Toggle right sidebar",
16194
+ title: toggleRightLabel,
15941
16195
  children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(PanelRight, { focusable: "false" })
15942
16196
  }
15943
16197
  ) })
15944
16198
  ] }),
15945
16199
  /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: getClassName32("title"), children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(Heading7, { rank: "2", size: "xs", children: [
15946
- headerTitle || rootTitle || "Page",
16200
+ headerTitle || rootTitle || pageLabel,
15947
16201
  headerPath && /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(import_jsx_runtime81.Fragment, { children: [
15948
16202
  " ",
15949
16203
  /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("code", { className: getClassName32("path"), children: headerPath })
@@ -15957,7 +16211,7 @@ var HeaderInner = ({
15957
16211
  onClick: () => {
15958
16212
  return setMenuOpen(!menuOpen);
15959
16213
  },
15960
- title: "Toggle menu bar",
16214
+ title: toggleMenuLabel,
15961
16215
  children: menuOpen ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ChevronUp, { focusable: "false" }) : /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ChevronDown, { focusable: "false" })
15962
16216
  }
15963
16217
  ) }),
@@ -15975,7 +16229,7 @@ var HeaderInner = ({
15975
16229
  onPublish && onPublish(data);
15976
16230
  },
15977
16231
  icon: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Globe, { size: "14px" }),
15978
- children: "Publish"
16232
+ children: publishLabel
15979
16233
  }
15980
16234
  ) }),
15981
16235
  setMenuOpen
@@ -16016,6 +16270,7 @@ init_lucide_react();
16016
16270
  init_react_import();
16017
16271
  var import_react87 = require("react");
16018
16272
  init_store();
16273
+ init_use_message();
16019
16274
  var useBreadcrumbs = (renderCount) => {
16020
16275
  const selectedId = useAppStore((s) => {
16021
16276
  var _a;
@@ -16027,13 +16282,15 @@ var useBreadcrumbs = (renderCount) => {
16027
16282
  return (_a = s.state.indexes.nodes[selectedId]) == null ? void 0 : _a.path;
16028
16283
  });
16029
16284
  const appStore = useAppStoreApi();
16285
+ const pageLabel = useMessage("label-page");
16286
+ const componentLabel = useMessage("label-component");
16030
16287
  return (0, import_react87.useMemo)(() => {
16031
16288
  const breadcrumbs = (path == null ? void 0 : path.map((zoneCompound) => {
16032
16289
  var _a, _b, _c, _d;
16033
16290
  const [componentId] = zoneCompound.split(":");
16034
16291
  if (componentId === "root") {
16035
16292
  return {
16036
- label: ((_a = config == null ? void 0 : config.root) == null ? void 0 : _a.label) || "Page",
16293
+ label: ((_a = config == null ? void 0 : config.root) == null ? void 0 : _a.label) || pageLabel,
16037
16294
  selector: null
16038
16295
  };
16039
16296
  }
@@ -16041,7 +16298,7 @@ var useBreadcrumbs = (renderCount) => {
16041
16298
  const parentId = node.path[node.path.length - 1];
16042
16299
  const contentIds = ((_b = appStore.getState().state.indexes.zones[parentId]) == null ? void 0 : _b.contentIds) || [];
16043
16300
  const index = contentIds.indexOf(componentId);
16044
- const label = node ? (_d = (_c = config.components[node.data.type]) == null ? void 0 : _c.label) != null ? _d : node.data.type : "Component";
16301
+ const label = node ? (_d = (_c = config.components[node.data.type]) == null ? void 0 : _c.label) != null ? _d : node.data.type : componentLabel;
16045
16302
  return {
16046
16303
  label,
16047
16304
  selector: node ? {
@@ -16054,7 +16311,7 @@ var useBreadcrumbs = (renderCount) => {
16054
16311
  return breadcrumbs.slice(breadcrumbs.length - renderCount);
16055
16312
  }
16056
16313
  return breadcrumbs;
16057
- }, [path, renderCount]);
16314
+ }, [path, renderCount, pageLabel, componentLabel]);
16058
16315
  };
16059
16316
 
16060
16317
  // components/Breadcrumbs/index.tsx
@@ -16116,6 +16373,7 @@ init_react_import();
16116
16373
  init_lucide_react();
16117
16374
  init_IconButton2();
16118
16375
  init_store();
16376
+ init_use_message();
16119
16377
  var import_react88 = require("react");
16120
16378
  init_lib();
16121
16379
 
@@ -16161,6 +16419,26 @@ var defaultZoomOptions = [
16161
16419
  { label: "150%", value: 1.5 },
16162
16420
  { label: "200%", value: 2 }
16163
16421
  ];
16422
+ var ViewportButton = ({
16423
+ viewport,
16424
+ isActive,
16425
+ onClick
16426
+ }) => {
16427
+ var _a;
16428
+ const switchTitle = useMessage("viewport-switch", {
16429
+ label: (_a = viewport.label) != null ? _a : ""
16430
+ });
16431
+ const switchDefaultTitle = useMessage("viewport-switch-default");
16432
+ return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
16433
+ ActionButton,
16434
+ {
16435
+ title: viewport.label ? switchTitle : switchDefaultTitle,
16436
+ onClick,
16437
+ isActive,
16438
+ children: typeof viewport.icon === "string" ? icons[viewport.icon] || viewport.icon : viewport.icon || icons.Smartphone
16439
+ }
16440
+ );
16441
+ };
16164
16442
  var ViewportControls = ({
16165
16443
  autoZoom,
16166
16444
  zoom,
@@ -16174,17 +16452,20 @@ var ViewportControls = ({
16174
16452
  const defaultsContainAutoZoom = defaultZoomOptions.find(
16175
16453
  (option) => option.value === autoZoom
16176
16454
  );
16455
+ const autoZoomLabel = useMessage("viewport-zoom-auto", {
16456
+ zoom: (autoZoom * 100).toFixed(0)
16457
+ });
16177
16458
  const zoomOptions = (0, import_react88.useMemo)(
16178
16459
  () => [
16179
16460
  ...defaultZoomOptions,
16180
16461
  ...defaultsContainAutoZoom ? [] : [
16181
16462
  {
16182
16463
  value: autoZoom,
16183
- label: `${(autoZoom * 100).toFixed(0)}% (Auto)`
16464
+ label: autoZoomLabel
16184
16465
  }
16185
16466
  ]
16186
16467
  ].filter((a) => a.value <= autoZoom).sort((a, b) => a.value > b.value ? 1 : -1),
16187
- [autoZoom]
16468
+ [autoZoom, autoZoomLabel]
16188
16469
  );
16189
16470
  const [activeViewport, setActiveViewport] = (0, import_react88.useState)(
16190
16471
  uiViewports.current.width
@@ -16193,6 +16474,9 @@ var ViewportControls = ({
16193
16474
  setActiveViewport(uiViewports.current.width);
16194
16475
  }, [uiViewports.current]);
16195
16476
  const [isExpanded, setIsExpanded] = (0, import_react88.useState)(false);
16477
+ const zoomOutLabel = useMessage("viewport-zoom-out");
16478
+ const zoomInLabel = useMessage("viewport-zoom-in");
16479
+ const toggleMenuLabel = useMessage("viewport-toggle-menu");
16196
16480
  return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
16197
16481
  "div",
16198
16482
  {
@@ -16201,15 +16485,14 @@ var ViewportControls = ({
16201
16485
  children: [
16202
16486
  /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: getClassName35("actions"), children: /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: getClassName35("actionsInner"), children: [
16203
16487
  viewports.map((viewport, i) => /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
16204
- ActionButton,
16488
+ ViewportButton,
16205
16489
  {
16206
- title: viewport.label ? `Switch to ${viewport.label} viewport` : "Switch viewport",
16490
+ viewport,
16207
16491
  onClick: () => {
16208
16492
  setActiveViewport(viewport.width);
16209
16493
  onViewportChange(viewport);
16210
16494
  },
16211
- isActive: activeViewport === viewport.width,
16212
- children: typeof viewport.icon === "string" ? icons[viewport.icon] || viewport.icon : viewport.icon || icons.Smartphone
16495
+ isActive: activeViewport === viewport.width
16213
16496
  },
16214
16497
  i
16215
16498
  )),
@@ -16217,7 +16500,7 @@ var ViewportControls = ({
16217
16500
  /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
16218
16501
  ActionButton,
16219
16502
  {
16220
- title: "Zoom viewport out",
16503
+ title: zoomOutLabel,
16221
16504
  disabled: zoom <= ((_a = zoomOptions[0]) == null ? void 0 : _a.value),
16222
16505
  onClick: (e) => {
16223
16506
  e.stopPropagation();
@@ -16234,7 +16517,7 @@ var ViewportControls = ({
16234
16517
  /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
16235
16518
  ActionButton,
16236
16519
  {
16237
- title: "Zoom viewport in",
16520
+ title: zoomInLabel,
16238
16521
  disabled: zoom >= ((_b = zoomOptions[zoomOptions.length - 1]) == null ? void 0 : _b.value),
16239
16522
  onClick: (e) => {
16240
16523
  e.stopPropagation();
@@ -16277,7 +16560,7 @@ var ViewportControls = ({
16277
16560
  "button",
16278
16561
  {
16279
16562
  className: getClassName35("toggleButton"),
16280
- title: "Toggle viewport menu",
16563
+ title: toggleMenuLabel,
16281
16564
  onClick: () => setIsExpanded((s) => !s),
16282
16565
  children: isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(X, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Monitor, { size: 16 })
16283
16566
  }
@@ -16884,12 +17167,15 @@ var styles_module_default32 = { "BlocksPlugin": "_BlocksPlugin_9af19_1" };
16884
17167
  init_lib();
16885
17168
  var import_jsx_runtime90 = require("react/jsx-runtime");
16886
17169
  var getClassName40 = get_class_name_factory_default("BlocksPlugin", styles_module_default32);
16887
- var blocksPlugin = () => ({
16888
- name: "blocks",
16889
- label: "Blocks",
16890
- render: () => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: getClassName40(), children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Components, {}) }),
16891
- icon: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Hammer, {})
16892
- });
17170
+ var blocksPlugin = (props = {}) => {
17171
+ var _a, _b;
17172
+ return {
17173
+ name: "blocks",
17174
+ label: (_a = props.label) != null ? _a : "Blocks",
17175
+ render: () => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: getClassName40(), children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Components, {}) }),
17176
+ icon: (_b = props.icon) != null ? _b : /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Hammer, {})
17177
+ };
17178
+ };
16893
17179
 
16894
17180
  // plugins/outline/index.tsx
16895
17181
  init_react_import();
@@ -16903,17 +17189,21 @@ var styles_module_default33 = { "OutlinePlugin": "_OutlinePlugin_16k03_1" };
16903
17189
  init_lib();
16904
17190
  var import_jsx_runtime91 = require("react/jsx-runtime");
16905
17191
  var getClassName41 = get_class_name_factory_default("OutlinePlugin", styles_module_default33);
16906
- var outlinePlugin = () => ({
16907
- name: "outline",
16908
- label: "Outline",
16909
- render: () => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: getClassName41(), children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Outline, {}) }),
16910
- icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Layers, {})
16911
- });
17192
+ var outlinePlugin = (props = {}) => {
17193
+ var _a, _b;
17194
+ return {
17195
+ name: "outline",
17196
+ label: (_a = props.label) != null ? _a : "Outline",
17197
+ render: () => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: getClassName41(), children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Outline, {}) }),
17198
+ icon: (_b = props.icon) != null ? _b : /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Layers, {})
17199
+ };
17200
+ };
16912
17201
 
16913
17202
  // plugins/fields/index.tsx
16914
17203
  init_react_import();
16915
17204
  init_lucide_react();
16916
17205
  init_store();
17206
+ init_use_message();
16917
17207
 
16918
17208
  // css-module:/home/runner/work/puck/puck/packages/core/plugins/fields/styles.module.css#css-module
16919
17209
  init_react_import();
@@ -16924,21 +17214,22 @@ init_lib();
16924
17214
  var import_jsx_runtime92 = require("react/jsx-runtime");
16925
17215
  var getClassName42 = get_class_name_factory_default("FieldsPlugin", styles_module_default34);
16926
17216
  var CurrentTitle = () => {
17217
+ const pageLabel = useMessage("label-page");
16927
17218
  const label = useAppStore((s) => {
16928
17219
  var _a, _b;
16929
17220
  const selectedItem = s.selectedItem;
16930
- return selectedItem ? (_b = (_a = s.config.components[selectedItem.type]) == null ? void 0 : _a.label) != null ? _b : selectedItem.type : "Page";
17221
+ return selectedItem ? (_b = (_a = s.config.components[selectedItem.type]) == null ? void 0 : _a.label) != null ? _b : selectedItem.type : null;
16931
17222
  });
16932
- return label;
17223
+ return label != null ? label : pageLabel;
16933
17224
  };
16934
- var fieldsPlugin = ({ desktopSideBar = "right" } = {}) => ({
17225
+ var fieldsPlugin = ({ desktopSideBar = "right", label, icon } = {}) => ({
16935
17226
  name: "fields",
16936
- label: "Fields",
17227
+ label: label != null ? label : "Fields",
16937
17228
  render: () => /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: getClassName42(), children: [
16938
17229
  /* @__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, {}) }) }),
16939
17230
  /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Fields, {})
16940
17231
  ] }),
16941
- icon: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(RectangleEllipsis, {}),
17232
+ icon: icon != null ? icon : /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(RectangleEllipsis, {}),
16942
17233
  mobileOnly: desktopSideBar === "right"
16943
17234
  });
16944
17235
 
@@ -16957,13 +17248,14 @@ var getLayoutClassName = get_class_name_factory_default("PuckLayout", styles_mod
16957
17248
  var getPluginTabClassName = get_class_name_factory_default("PuckPluginTab", styles_module_default22);
16958
17249
  var useBrowserLayoutEffect = typeof window === "undefined" ? import_react94.useEffect : import_react94.useLayoutEffect;
16959
17250
  var FieldSideBar = () => {
17251
+ const pageLabel = useMessage("label-page");
16960
17252
  const title = useAppStore(
16961
17253
  (s) => {
16962
17254
  var _a, _b, _c;
16963
- 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) || "Page";
17255
+ 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;
16964
17256
  }
16965
17257
  );
16966
- return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(SidebarSection, { noBorderTop: true, showBreadcrumbs: true, title, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Fields, {}) });
17258
+ return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(SidebarSection, { noBorderTop: true, showBreadcrumbs: true, title: title || pageLabel, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Fields, {}) });
16967
17259
  };
16968
17260
  var PluginTab = ({
16969
17261
  children,
@@ -17065,16 +17357,22 @@ var Layout = ({ children }) => {
17065
17357
  () => !!(plugins == null ? void 0 : plugins.find((p) => p.name === "legacy-side-bar")),
17066
17358
  [plugins]
17067
17359
  );
17360
+ const blocksLabel = useMessage("plugin-blocks");
17361
+ const outlineLabel = useMessage("plugin-outline");
17362
+ const fieldsLabel = useMessage("plugin-fields");
17068
17363
  const pluginItems = (0, import_react94.useMemo)(() => {
17069
17364
  const details = {};
17070
- const defaultPlugins = [blocksPlugin(), outlinePlugin()];
17365
+ const defaultPlugins = [
17366
+ blocksPlugin({ label: blocksLabel }),
17367
+ outlinePlugin({ label: outlineLabel })
17368
+ ];
17071
17369
  const isLegacy = (plugin) => plugin.name === "legacy-side-bar" ? -1 : 0;
17072
17370
  const combinedPlugins = [
17073
17371
  ...defaultPlugins,
17074
17372
  ...plugins != null ? plugins : []
17075
17373
  ].sort((a, b) => isLegacy(a) - isLegacy(b));
17076
17374
  if (!(plugins == null ? void 0 : plugins.some((p) => p.name === "fields"))) {
17077
- combinedPlugins.push(fieldsPlugin());
17375
+ combinedPlugins.push(fieldsPlugin({ label: fieldsLabel }));
17078
17376
  }
17079
17377
  combinedPlugins == null ? void 0 : combinedPlugins.forEach((plugin) => {
17080
17378
  var _a, _b;
@@ -17111,7 +17409,15 @@ var Layout = ({ children }) => {
17111
17409
  }
17112
17410
  });
17113
17411
  return details;
17114
- }, [plugins, currentPlugin, appStoreApi, leftSideBarVisible]);
17412
+ }, [
17413
+ plugins,
17414
+ currentPlugin,
17415
+ appStoreApi,
17416
+ leftSideBarVisible,
17417
+ blocksLabel,
17418
+ outlineLabel,
17419
+ fieldsLabel
17420
+ ]);
17115
17421
  (0, import_react94.useEffect)(() => {
17116
17422
  if (!currentPlugin) {
17117
17423
  const names = Object.keys(pluginItems);
@@ -17125,6 +17431,8 @@ var Layout = ({ children }) => {
17125
17431
  return (_a = s.state.ui.mobilePanelExpanded) != null ? _a : false;
17126
17432
  }
17127
17433
  );
17434
+ const maximizeLabel = useMessage("layout-maximize");
17435
+ const minimizeLabel = useMessage("layout-minimize");
17128
17436
  return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
17129
17437
  "div",
17130
17438
  {
@@ -17161,7 +17469,7 @@ var Layout = ({ children }) => {
17161
17469
  IconButton,
17162
17470
  {
17163
17471
  type: "button",
17164
- title: "maximize",
17472
+ title: mobilePanelExpanded ? minimizeLabel : maximizeLabel,
17165
17473
  onClick: () => {
17166
17474
  setUi({
17167
17475
  mobilePanelExpanded: !mobilePanelExpanded
@@ -17236,6 +17544,7 @@ function PuckProvider({ children }) {
17236
17544
  iframe: _iframe,
17237
17545
  initialHistory: _initialHistory,
17238
17546
  metadata,
17547
+ dictionary,
17239
17548
  onAction,
17240
17549
  fieldTransforms,
17241
17550
  _experimentalFullScreenCanvas,
@@ -17333,6 +17642,7 @@ function PuckProvider({ children }) {
17333
17642
  _experimentalVirtualization: !!_experimentalVirtualization,
17334
17643
  onAction,
17335
17644
  metadata,
17645
+ dictionary: dictionary || {},
17336
17646
  fieldTransforms: loadedFieldTransforms
17337
17647
  };
17338
17648
  },
@@ -17348,6 +17658,7 @@ function PuckProvider({ children }) {
17348
17658
  _experimentalVirtualization,
17349
17659
  onAction,
17350
17660
  metadata,
17661
+ dictionary,
17351
17662
  loadedFieldTransforms
17352
17663
  ]
17353
17664
  );
@@ -17660,13 +17971,30 @@ init_walk_tree();
17660
17971
 
17661
17972
  // plugins/legacy-side-bar/index.tsx
17662
17973
  init_react_import();
17974
+ init_use_message();
17663
17975
  var import_jsx_runtime95 = require("react/jsx-runtime");
17664
- var legacySideBarPlugin = () => ({
17976
+ var LegacySideBar = ({
17977
+ outlineLabel,
17978
+ componentsLabel
17979
+ }) => {
17980
+ const componentsLabelMessage = useMessage("plugin-components");
17981
+ const outlineLabelMessage = useMessage("plugin-outline");
17982
+ const resolvedComponentsLabel = componentsLabel != null ? componentsLabel : componentsLabelMessage;
17983
+ const resolvedOutlineLabel = outlineLabel != null ? outlineLabel : outlineLabelMessage;
17984
+ return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { style: { overflowY: "auto" }, children: [
17985
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(SidebarSection, { title: resolvedComponentsLabel, noBorderTop: true, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Components, {}) }),
17986
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(SidebarSection, { title: resolvedOutlineLabel, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Outline, {}) })
17987
+ ] });
17988
+ };
17989
+ var legacySideBarPlugin = (props = {}) => ({
17665
17990
  name: "legacy-side-bar",
17666
- render: () => /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { style: { overflowY: "auto" }, children: [
17667
- /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(SidebarSection, { title: "Components", noBorderTop: true, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Components, {}) }),
17668
- /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(SidebarSection, { title: "Outline", children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Outline, {}) })
17669
- ] })
17991
+ render: () => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
17992
+ LegacySideBar,
17993
+ {
17994
+ outlineLabel: props.outlineLabel,
17995
+ componentsLabel: props.componentsLabel
17996
+ }
17997
+ )
17670
17998
  });
17671
17999
  // Annotate the CommonJS export names for ESM import in node:
17672
18000
  0 && (module.exports = {