@elementor/editor-controls 4.3.0-1058 → 4.3.0-1059

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/index.mjs CHANGED
@@ -7962,10 +7962,10 @@ var BoundTimeStringControl = ({ bind, ariaLabel }) => {
7962
7962
  };
7963
7963
 
7964
7964
  // src/controls/inline-editing-control.tsx
7965
- import * as React115 from "react";
7966
- import { useCallback as useCallback4 } from "react";
7965
+ import * as React117 from "react";
7966
+ import { useCallback as useCallback4, useState as useState20 } from "react";
7967
7967
  import { escapedHtmlPropTypeUtil as escapedHtmlPropTypeUtil2 } from "@elementor/editor-props";
7968
- import { Box as Box25 } from "@elementor/ui";
7968
+ import { Box as Box26 } from "@elementor/ui";
7969
7969
 
7970
7970
  // src/components/inline-editor.tsx
7971
7971
  import * as React114 from "react";
@@ -8027,6 +8027,7 @@ var InlineEditor = React114.forwardRef((props, ref) => {
8027
8027
  onBlur = void 0,
8028
8028
  expectedTag = null,
8029
8029
  onEditorCreate,
8030
+ onEditorDestroy,
8030
8031
  wrapperClassName,
8031
8032
  onSelectionEnd,
8032
8033
  mountElement = null
@@ -8111,6 +8112,7 @@ var InlineEditor = React114.forwardRef((props, ref) => {
8111
8112
  }
8112
8113
  },
8113
8114
  onCreate: onEditorCreate ? ({ editor: mountedEditor }) => onEditorCreate(mountedEditor) : void 0,
8115
+ onDestroy: onEditorDestroy ? () => onEditorDestroy() : void 0,
8114
8116
  onBlur: mountElement ? void 0 : () => onBlurRef.current?.(),
8115
8117
  onSelectionUpdate: onSelectionEnd ? ({ editor: updatedEditor }) => onSelectionEnd(updatedEditor.view) : void 0
8116
8118
  });
@@ -8139,88 +8141,425 @@ var useOnUpdate = (callback, dependencies) => {
8139
8141
  }, dependencies);
8140
8142
  };
8141
8143
 
8142
- // src/controls/inline-editing-control.tsx
8143
- var InlineEditingControl = createControl(
8144
- ({
8145
- sx,
8146
- attributes,
8147
- props
8148
- }) => {
8149
- const { setValue, placeholder, value } = useBoundProp(escapedHtmlPropTypeUtil2);
8150
- const { value: rawValue } = usePropKeyContext();
8151
- const content = value ?? extractInlineHtmlContent(rawValue);
8152
- const handleChange = useCallback4(
8153
- (newValue) => {
8154
- const html = newValue ?? "";
8155
- setValue(html);
8144
+ // src/components/inline-editor-toolbar.tsx
8145
+ import * as React116 from "react";
8146
+ import { useEffect as useEffect19, useMemo as useMemo17, useRef as useRef30, useState as useState19 } from "react";
8147
+ import { getContainer as getContainer2, getElementSetting } from "@elementor/editor-elements";
8148
+ import {
8149
+ BoldIcon,
8150
+ ItalicIcon,
8151
+ LinkIcon as LinkIcon3,
8152
+ MinusIcon as MinusIcon2,
8153
+ StrikethroughIcon,
8154
+ SubscriptIcon,
8155
+ SuperscriptIcon,
8156
+ UnderlineIcon
8157
+ } from "@elementor/icons";
8158
+ import {
8159
+ Box as Box25,
8160
+ IconButton as IconButton9,
8161
+ ToggleButton as ToggleButton3,
8162
+ ToggleButtonGroup as ToggleButtonGroup2,
8163
+ toggleButtonGroupClasses,
8164
+ Tooltip as Tooltip10,
8165
+ usePopupState as usePopupState10
8166
+ } from "@elementor/ui";
8167
+ import { useEditorState } from "@tiptap/react";
8168
+ import { __ as __58 } from "@wordpress/i18n";
8169
+
8170
+ // src/components/url-popover.tsx
8171
+ import * as React115 from "react";
8172
+ import { useEffect as useEffect18, useRef as useRef29 } from "react";
8173
+ import { ExternalLinkIcon } from "@elementor/icons";
8174
+ import { bindPopover as bindPopover8, Popover as Popover8, Stack as Stack19, TextField as TextField11, ToggleButton as ToggleButton2, Tooltip as Tooltip9 } from "@elementor/ui";
8175
+ import { __ as __57 } from "@wordpress/i18n";
8176
+ var UrlPopover = ({
8177
+ popupState,
8178
+ restoreValue,
8179
+ anchorRef,
8180
+ value,
8181
+ onChange,
8182
+ openInNewTab,
8183
+ onToggleNewTab
8184
+ }) => {
8185
+ const inputRef = useRef29(null);
8186
+ useEffect18(() => {
8187
+ if (popupState.isOpen) {
8188
+ requestAnimationFrame(() => inputRef.current?.focus());
8189
+ }
8190
+ }, [popupState.isOpen]);
8191
+ const handleClose = () => {
8192
+ restoreValue();
8193
+ popupState.close();
8194
+ };
8195
+ return /* @__PURE__ */ React115.createElement(
8196
+ Popover8,
8197
+ {
8198
+ slotProps: {
8199
+ paper: { sx: { borderRadius: "16px", width: anchorRef.current?.offsetWidth + "px", marginTop: -1 } }
8156
8200
  },
8157
- [setValue]
8158
- );
8159
- return /* @__PURE__ */ React115.createElement(ControlActions, null, /* @__PURE__ */ React115.createElement(
8160
- Box25,
8201
+ ...bindPopover8(popupState),
8202
+ anchorOrigin: { vertical: "top", horizontal: "left" },
8203
+ transformOrigin: { vertical: "top", horizontal: "left" },
8204
+ onClose: handleClose
8205
+ },
8206
+ /* @__PURE__ */ React115.createElement(Stack19, { direction: "row", alignItems: "center", gap: 1, sx: { p: 1.5 } }, /* @__PURE__ */ React115.createElement(
8207
+ TextField11,
8161
8208
  {
8209
+ value,
8210
+ onChange,
8211
+ size: "tiny",
8212
+ fullWidth: true,
8213
+ placeholder: __57("Type a URL", "elementor"),
8214
+ inputProps: { ref: inputRef },
8215
+ color: "secondary",
8216
+ InputProps: { sx: { borderRadius: "8px" } },
8217
+ onKeyUp: (event) => event.key === "Enter" && handleClose()
8218
+ }
8219
+ ), /* @__PURE__ */ React115.createElement(Tooltip9, { title: __57("Open in a new tab", "elementor") }, /* @__PURE__ */ React115.createElement(
8220
+ ToggleButton2,
8221
+ {
8222
+ size: "tiny",
8223
+ value: "newTab",
8224
+ selected: openInNewTab,
8225
+ onClick: onToggleNewTab,
8226
+ "aria-label": __57("Open in a new tab", "elementor"),
8227
+ sx: { borderRadius: "8px" }
8228
+ },
8229
+ /* @__PURE__ */ React115.createElement(ExternalLinkIcon, { fontSize: "tiny" })
8230
+ )))
8231
+ );
8232
+ };
8233
+
8234
+ // src/components/inline-editor-toolbar.tsx
8235
+ var InlineEditorToolbar = ({
8236
+ editor,
8237
+ elementId,
8238
+ sx = {},
8239
+ inControlPanel = false
8240
+ }) => {
8241
+ const [urlValue, setUrlValue] = useState19("");
8242
+ const [openInNewTab, setOpenInNewTab] = useState19(false);
8243
+ const toolbarRef = useRef30(null);
8244
+ const linkPopupState = usePopupState10({ variant: "popover" });
8245
+ const isElementClickable = elementId ? checkIfElementIsClickable(elementId) : false;
8246
+ const editorState = useEditorState({
8247
+ editor,
8248
+ selector: (ctx) => possibleFormats.filter((format) => ctx.editor.isActive(format))
8249
+ });
8250
+ const formatButtonsList = useMemo17(() => {
8251
+ const buttons = Object.values(formatButtons);
8252
+ if (isElementClickable) {
8253
+ return buttons.filter((button) => button.action !== "link");
8254
+ }
8255
+ return buttons;
8256
+ }, [isElementClickable]);
8257
+ const handleLinkClick = () => {
8258
+ const linkAttrs = editor.getAttributes("link");
8259
+ setUrlValue(linkAttrs.href || "");
8260
+ setOpenInNewTab(linkAttrs.target === "_blank");
8261
+ linkPopupState.open(toolbarRef.current);
8262
+ };
8263
+ const handleUrlChange = (event) => {
8264
+ setUrlValue(event.target.value);
8265
+ };
8266
+ const handleToggleNewTab = () => {
8267
+ setOpenInNewTab(!openInNewTab);
8268
+ };
8269
+ const handleUrlSubmit = () => {
8270
+ if (urlValue) {
8271
+ editor.chain().focus().setLink({
8272
+ href: urlValue,
8273
+ target: openInNewTab ? "_blank" : "_self"
8274
+ }).run();
8275
+ } else {
8276
+ editor.chain().focus().unsetLink().run();
8277
+ }
8278
+ if (elementId) {
8279
+ window.dispatchEvent(
8280
+ new CustomEvent("elementor:inline-link-changed", {
8281
+ detail: { elementId }
8282
+ })
8283
+ );
8284
+ }
8285
+ linkPopupState.close();
8286
+ };
8287
+ useEffect19(() => {
8288
+ if (!inControlPanel) {
8289
+ editor?.commands?.focus();
8290
+ }
8291
+ }, [editor, inControlPanel]);
8292
+ return /* @__PURE__ */ React116.createElement(
8293
+ Box25,
8294
+ {
8295
+ ref: toolbarRef,
8296
+ sx: {
8297
+ display: "inline-flex",
8298
+ gap: 0.5,
8299
+ padding: 0.5,
8300
+ borderRadius: "8px",
8301
+ backgroundColor: "background.paper",
8302
+ boxShadow: "0 2px 8px rgba(0, 0, 0, 0.2)",
8303
+ alignItems: "center",
8304
+ visibility: linkPopupState.isOpen ? "hidden" : "visible",
8305
+ pointerEvents: linkPopupState.isOpen ? "none" : "all",
8306
+ ...sx,
8307
+ ...inControlPanel && {
8308
+ width: "100%",
8309
+ justifyContent: "center",
8310
+ flexDirection: "row",
8311
+ backgroundColor: "transparent",
8312
+ boxShadow: "none",
8313
+ borderWidth: "0",
8314
+ borderBottom: "1px solid",
8315
+ borderBottomColor: "grey.200",
8316
+ borderRadius: "0",
8317
+ position: "absolute",
8318
+ top: "0",
8319
+ left: "0"
8320
+ }
8321
+ }
8322
+ },
8323
+ /* @__PURE__ */ React116.createElement(Tooltip10, { title: clearButton.label, placement: "top", sx: { borderRadius: "8px" } }, /* @__PURE__ */ React116.createElement(IconButton9, { "aria-label": clearButton.label, onClick: () => clearButton.method(editor), size: "tiny" }, clearButton.icon)),
8324
+ /* @__PURE__ */ React116.createElement(
8325
+ ToggleButtonGroup2,
8326
+ {
8327
+ value: editorState,
8328
+ size: "tiny",
8162
8329
  sx: {
8163
- p: 0.8,
8164
- border: "1px solid",
8165
- borderColor: "grey.200",
8166
- borderRadius: "8px",
8167
- transition: "border-color .2s ease, box-shadow .2s ease",
8168
- "&:hover": {
8169
- borderColor: "black"
8170
- },
8171
- "&:focus-within": {
8172
- borderColor: "black",
8173
- boxShadow: "0 0 0 1px black"
8174
- },
8175
- "& .ProseMirror:focus": {
8176
- outline: "none"
8177
- },
8178
- "& .ProseMirror": {
8179
- minHeight: "70px",
8180
- fontSize: "12px",
8181
- "& a": {
8182
- color: "inherit"
8183
- },
8184
- "& .elementor-inline-editor-reset": {
8185
- margin: 0,
8186
- padding: 0
8330
+ display: "flex",
8331
+ gap: 0.5,
8332
+ border: "none",
8333
+ [`& .${toggleButtonGroupClasses.firstButton}, & .${toggleButtonGroupClasses.middleButton}, & .${toggleButtonGroupClasses.lastButton}`]: {
8334
+ borderRadius: "8px",
8335
+ border: "none",
8336
+ marginLeft: 0,
8337
+ "&.Mui-selected": {
8338
+ marginLeft: 0
8187
8339
  },
8188
- "&.is-empty::before": {
8189
- content: "attr(data-placeholder)",
8190
- color: "text.tertiary",
8191
- pointerEvents: "none",
8192
- position: "absolute",
8193
- opacity: 0.6
8340
+ "& + &.Mui-selected": {
8341
+ marginLeft: 0
8194
8342
  }
8195
8343
  },
8196
- ".strip-styles *": {
8197
- all: "unset"
8344
+ ...inControlPanel && {
8345
+ justifyContent: "space-between",
8346
+ width: "100%",
8347
+ "& svg": {
8348
+ width: "0.7rem",
8349
+ height: "0.7rem",
8350
+ fill: "black"
8351
+ }
8352
+ }
8353
+ }
8354
+ },
8355
+ formatButtonsList.map((button) => /* @__PURE__ */ React116.createElement(Tooltip10, { title: button.label, key: button.action, placement: "top" }, /* @__PURE__ */ React116.createElement(
8356
+ ToggleButton3,
8357
+ {
8358
+ value: button.action,
8359
+ "aria-label": button.label,
8360
+ size: "tiny",
8361
+ onClick: () => {
8362
+ if (button.action === "link") {
8363
+ handleLinkClick();
8364
+ } else {
8365
+ button.method?.(editor);
8366
+ }
8367
+ editor?.commands?.focus();
8368
+ }
8369
+ },
8370
+ button.icon
8371
+ )))
8372
+ ),
8373
+ /* @__PURE__ */ React116.createElement(
8374
+ UrlPopover,
8375
+ {
8376
+ popupState: linkPopupState,
8377
+ anchorRef: toolbarRef,
8378
+ restoreValue: handleUrlSubmit,
8379
+ value: urlValue,
8380
+ onChange: handleUrlChange,
8381
+ openInNewTab,
8382
+ onToggleNewTab: handleToggleNewTab
8383
+ }
8384
+ )
8385
+ );
8386
+ };
8387
+ var checkIfElementIsClickable = (elementId) => {
8388
+ const container = getContainer2(elementId);
8389
+ const type = container?.model.get("widgetType");
8390
+ const isButton = type === "e-button";
8391
+ const hasLink = !!getElementSetting(elementId, "link")?.value?.destination;
8392
+ return isButton || hasLink;
8393
+ };
8394
+ var toolbarButtons = {
8395
+ clear: {
8396
+ label: __58("Clear", "elementor"),
8397
+ icon: /* @__PURE__ */ React116.createElement(MinusIcon2, { fontSize: "tiny" }),
8398
+ action: "clear",
8399
+ method: (editor) => {
8400
+ editor.chain().focus().clearNodes().unsetAllMarks().run();
8401
+ }
8402
+ },
8403
+ bold: {
8404
+ label: __58("Bold", "elementor"),
8405
+ icon: /* @__PURE__ */ React116.createElement(BoldIcon, { fontSize: "tiny" }),
8406
+ action: "bold",
8407
+ method: (editor) => {
8408
+ editor.chain().focus().toggleBold().run();
8409
+ }
8410
+ },
8411
+ italic: {
8412
+ label: __58("Italic", "elementor"),
8413
+ icon: /* @__PURE__ */ React116.createElement(ItalicIcon, { fontSize: "tiny" }),
8414
+ action: "italic",
8415
+ method: (editor) => {
8416
+ editor.chain().focus().toggleItalic().run();
8417
+ }
8418
+ },
8419
+ underline: {
8420
+ label: __58("Underline", "elementor"),
8421
+ icon: /* @__PURE__ */ React116.createElement(UnderlineIcon, { fontSize: "tiny" }),
8422
+ action: "underline",
8423
+ method: (editor) => {
8424
+ editor.chain().focus().toggleUnderline().run();
8425
+ }
8426
+ },
8427
+ strike: {
8428
+ label: __58("Strikethrough", "elementor"),
8429
+ icon: /* @__PURE__ */ React116.createElement(StrikethroughIcon, { fontSize: "tiny" }),
8430
+ action: "strike",
8431
+ method: (editor) => {
8432
+ editor.chain().focus().toggleStrike().run();
8433
+ }
8434
+ },
8435
+ superscript: {
8436
+ label: __58("Superscript", "elementor"),
8437
+ icon: /* @__PURE__ */ React116.createElement(SuperscriptIcon, { fontSize: "tiny" }),
8438
+ action: "superscript",
8439
+ method: (editor) => {
8440
+ editor.chain().focus().toggleSuperscript().run();
8441
+ }
8442
+ },
8443
+ subscript: {
8444
+ label: __58("Subscript", "elementor"),
8445
+ icon: /* @__PURE__ */ React116.createElement(SubscriptIcon, { fontSize: "tiny" }),
8446
+ action: "subscript",
8447
+ method: (editor) => {
8448
+ editor.chain().focus().toggleSubscript().run();
8449
+ }
8450
+ },
8451
+ link: {
8452
+ label: __58("Link", "elementor"),
8453
+ icon: /* @__PURE__ */ React116.createElement(LinkIcon3, { fontSize: "tiny" }),
8454
+ action: "link",
8455
+ method: null
8456
+ }
8457
+ };
8458
+ var { clear: clearButton, ...formatButtons } = toolbarButtons;
8459
+ var possibleFormats = Object.keys(formatButtons);
8460
+
8461
+ // src/controls/inline-editing-control.tsx
8462
+ var InlineEditingControl = createControl(({ sx, attributes, props, context: { elementId } }) => {
8463
+ const { setValue, placeholder, value } = useBoundProp(escapedHtmlPropTypeUtil2);
8464
+ const { value: rawValue } = usePropKeyContext();
8465
+ const content = value ?? extractInlineHtmlContent(rawValue);
8466
+ const [editor, setEditor] = useState20(null);
8467
+ const handleChange = useCallback4(
8468
+ (newValue) => {
8469
+ const html = newValue ?? "";
8470
+ setValue(html);
8471
+ },
8472
+ [setValue]
8473
+ );
8474
+ return /* @__PURE__ */ React117.createElement(ControlActions, null, /* @__PURE__ */ React117.createElement(Box26, { sx: { position: "relative" } }, editor && editor.isEditable && /* @__PURE__ */ React117.createElement(
8475
+ InlineEditorToolbar,
8476
+ {
8477
+ editor,
8478
+ elementId,
8479
+ sx: {
8480
+ boxShadow: "none",
8481
+ border: "1px solid",
8482
+ borderColor: "grey.200",
8483
+ mb: 0.5
8484
+ },
8485
+ inControlPanel: true
8486
+ }
8487
+ ), /* @__PURE__ */ React117.createElement(
8488
+ Box26,
8489
+ {
8490
+ sx: {
8491
+ p: 0.8,
8492
+ border: "1px solid",
8493
+ borderColor: "grey.200",
8494
+ borderRadius: "8px",
8495
+ transition: "border-color .2s ease, box-shadow .2s ease",
8496
+ "&:hover": {
8497
+ borderColor: "black"
8498
+ },
8499
+ "&:focus-within": {
8500
+ borderColor: "black",
8501
+ boxShadow: "0 0 0 1px black"
8502
+ },
8503
+ "& .ProseMirror:focus": {
8504
+ outline: "none"
8505
+ },
8506
+ "& .ProseMirror": {
8507
+ minHeight: "100px",
8508
+ fontSize: "12px",
8509
+ "& a": {
8510
+ color: "inherit"
8511
+ },
8512
+ "& .elementor-inline-editor-reset": {
8513
+ margin: 0,
8514
+ padding: 0
8198
8515
  },
8199
- ...sx
8516
+ "&.is-empty::before": {
8517
+ content: "attr(data-placeholder)",
8518
+ color: "text.tertiary",
8519
+ pointerEvents: "none",
8520
+ position: "absolute",
8521
+ opacity: 0.6
8522
+ }
8523
+ },
8524
+ ".strip-styles *": {
8525
+ all: "unset"
8200
8526
  },
8201
- ...attributes,
8202
- ...props
8527
+ ...sx
8203
8528
  },
8204
- /* @__PURE__ */ React115.createElement(InlineEditor, { value: content, setValue: handleChange, placeholder: placeholder ?? null })
8205
- ));
8206
- }
8207
- );
8529
+ ...attributes,
8530
+ ...props
8531
+ },
8532
+ /* @__PURE__ */ React117.createElement(
8533
+ InlineEditor,
8534
+ {
8535
+ value: content,
8536
+ setValue: handleChange,
8537
+ placeholder: placeholder ?? null,
8538
+ onEditorCreate: setEditor,
8539
+ onEditorDestroy: () => setEditor(null),
8540
+ sx: {
8541
+ paddingBlockStart: 5
8542
+ }
8543
+ }
8544
+ )
8545
+ )));
8546
+ });
8208
8547
 
8209
8548
  // src/controls/email-form-action-control/index.tsx
8210
- import * as React119 from "react";
8549
+ import * as React121 from "react";
8211
8550
  import { emailsPropTypeUtil } from "@elementor/editor-props";
8212
8551
  import { CollapsibleContent } from "@elementor/editor-ui";
8213
- import { Box as Box26, Divider as Divider5, Stack as Stack20 } from "@elementor/ui";
8214
- import { __ as __58 } from "@wordpress/i18n";
8552
+ import { Box as Box27, Divider as Divider5, Stack as Stack21 } from "@elementor/ui";
8553
+ import { __ as __60 } from "@wordpress/i18n";
8215
8554
 
8216
8555
  // src/controls/email-form-action-control/fields.tsx
8217
- import * as React118 from "react";
8556
+ import * as React120 from "react";
8218
8557
  import { InfoAlert as InfoAlert2 } from "@elementor/editor-ui";
8219
- import { Grid as Grid34, Stack as Stack19 } from "@elementor/ui";
8220
- import { __ as __57 } from "@wordpress/i18n";
8558
+ import { Grid as Grid34, Stack as Stack20 } from "@elementor/ui";
8559
+ import { __ as __59 } from "@wordpress/i18n";
8221
8560
 
8222
8561
  // src/hooks/use-form-field-suggestions.ts
8223
- import { getContainer as getContainer2, getSelectedElements as getSelectedElements3, getWidgetsCache } from "@elementor/editor-elements";
8562
+ import { getContainer as getContainer3, getSelectedElements as getSelectedElements3, getWidgetsCache } from "@elementor/editor-elements";
8224
8563
  import { stringPropTypeUtil as stringPropTypeUtil21 } from "@elementor/editor-props";
8225
8564
  import { __privateUseListenTo as useListenTo2, commandEndEvent as commandEndEvent2, v1ReadyEvent } from "@elementor/editor-v1-adapters";
8226
8565
  var FORM_FIELD_WIDGET_TYPES = [
@@ -8252,7 +8591,7 @@ function getFieldCssId(child, widgetType) {
8252
8591
  return extractStringPropValue(getSettingWithDefault(child, widgetType, CSS_ID_PROP_KEY));
8253
8592
  }
8254
8593
  function getFormContainer(elementId) {
8255
- let container = getContainer2(elementId);
8594
+ let container = getContainer3(elementId);
8256
8595
  while (container) {
8257
8596
  if (container.model.get("elType") === FORM_ELEMENT_TYPE) {
8258
8597
  return container;
@@ -8306,10 +8645,10 @@ function useFormFieldSuggestions(options) {
8306
8645
  }
8307
8646
 
8308
8647
  // src/controls/email-form-action-control/email-chips-field.tsx
8309
- import * as React116 from "react";
8310
- import { useMemo as useMemo17, useState as useState19 } from "react";
8648
+ import * as React118 from "react";
8649
+ import { useMemo as useMemo18, useState as useState21 } from "react";
8311
8650
  import { stringArrayPropTypeUtil as stringArrayPropTypeUtil3, stringPropTypeUtil as stringPropTypeUtil22 } from "@elementor/editor-props";
8312
- import { Autocomplete as Autocomplete4, Grid as Grid32, TextField as TextField11 } from "@elementor/ui";
8651
+ import { Autocomplete as Autocomplete4, Grid as Grid32, TextField as TextField12 } from "@elementor/ui";
8313
8652
 
8314
8653
  // src/controls/email-form-action-control/utils.ts
8315
8654
  import { z } from "@elementor/schema";
@@ -8345,10 +8684,10 @@ function resolveMention(raw, suggestions) {
8345
8684
  }
8346
8685
  var EmailChipsControl = createControl(({ placeholder, suggestions = [] }) => {
8347
8686
  const { value, setValue, disabled } = useBoundProp(stringArrayPropTypeUtil3);
8348
- const [inputValue, setInputValue] = useState19("");
8687
+ const [inputValue, setInputValue] = useState21("");
8349
8688
  const items2 = value || [];
8350
8689
  const selectedValues = items2.map((item) => stringPropTypeUtil22.extract(item)).filter((val) => val !== null);
8351
- const suggestionOptions = useMemo17(
8690
+ const suggestionOptions = useMemo18(
8352
8691
  () => suggestions.map((suggestion) => `[${suggestion.value}]`),
8353
8692
  [suggestions]
8354
8693
  );
@@ -8383,7 +8722,7 @@ var EmailChipsControl = createControl(({ placeholder, suggestions = [] }) => {
8383
8722
  tryAddChip(inputValue);
8384
8723
  }
8385
8724
  };
8386
- return /* @__PURE__ */ React116.createElement(ControlActions, null, /* @__PURE__ */ React116.createElement(
8725
+ return /* @__PURE__ */ React118.createElement(ControlActions, null, /* @__PURE__ */ React118.createElement(
8387
8726
  Autocomplete4,
8388
8727
  {
8389
8728
  fullWidth: true,
@@ -8408,99 +8747,99 @@ var EmailChipsControl = createControl(({ placeholder, suggestions = [] }) => {
8408
8747
  onBlur: handleBlur,
8409
8748
  getOptionLabel: (option) => option,
8410
8749
  isOptionEqualToValue: (option, val) => option === val,
8411
- renderInput: (params) => /* @__PURE__ */ React116.createElement(TextField11, { ...params, placeholder, onKeyDown: handleKeyDown }),
8412
- renderTags: (tagValues, getTagProps) => /* @__PURE__ */ React116.createElement(ChipsList, { getLabel: (option) => option, getTagProps, values: tagValues })
8750
+ renderInput: (params) => /* @__PURE__ */ React118.createElement(TextField12, { ...params, placeholder, onKeyDown: handleKeyDown }),
8751
+ renderTags: (tagValues, getTagProps) => /* @__PURE__ */ React118.createElement(ChipsList, { getLabel: (option) => option, getTagProps, values: tagValues })
8413
8752
  }
8414
8753
  ));
8415
8754
  });
8416
- var EmailChipsField = ({ fieldLabel, placeholder, suggestions }) => /* @__PURE__ */ React116.createElement(Grid32, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React116.createElement(Grid32, { item: true }, /* @__PURE__ */ React116.createElement(ControlFormLabel, null, fieldLabel)), /* @__PURE__ */ React116.createElement(Grid32, { item: true }, /* @__PURE__ */ React116.createElement(EmailChipsControl, { placeholder, suggestions })));
8755
+ var EmailChipsField = ({ fieldLabel, placeholder, suggestions }) => /* @__PURE__ */ React118.createElement(Grid32, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React118.createElement(Grid32, { item: true }, /* @__PURE__ */ React118.createElement(ControlFormLabel, null, fieldLabel)), /* @__PURE__ */ React118.createElement(Grid32, { item: true }, /* @__PURE__ */ React118.createElement(EmailChipsControl, { placeholder, suggestions })));
8417
8756
 
8418
8757
  // src/controls/email-form-action-control/email-field.tsx
8419
- import * as React117 from "react";
8758
+ import * as React119 from "react";
8420
8759
  import { Grid as Grid33 } from "@elementor/ui";
8421
- var EmailField = ({ bind, label, placeholder }) => /* @__PURE__ */ React117.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React117.createElement(Grid33, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React117.createElement(Grid33, { item: true }, /* @__PURE__ */ React117.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ React117.createElement(Grid33, { item: true }, /* @__PURE__ */ React117.createElement(TextControl, { placeholder }))));
8760
+ var EmailField = ({ bind, label, placeholder }) => /* @__PURE__ */ React119.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React119.createElement(Grid33, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React119.createElement(Grid33, { item: true }, /* @__PURE__ */ React119.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ React119.createElement(Grid33, { item: true }, /* @__PURE__ */ React119.createElement(TextControl, { placeholder }))));
8422
8761
 
8423
8762
  // src/controls/email-form-action-control/fields.tsx
8424
8763
  var SendToField = ({ placeholder }) => {
8425
8764
  const suggestions = useFormFieldSuggestions({ inputType: "email" });
8426
- return /* @__PURE__ */ React118.createElement(PropKeyProvider, { bind: "to" }, /* @__PURE__ */ React118.createElement(Stack19, { gap: 0.5 }, /* @__PURE__ */ React118.createElement(
8765
+ return /* @__PURE__ */ React120.createElement(PropKeyProvider, { bind: "to" }, /* @__PURE__ */ React120.createElement(Stack20, { gap: 0.5 }, /* @__PURE__ */ React120.createElement(
8427
8766
  EmailChipsField,
8428
8767
  {
8429
- fieldLabel: __57("Send to", "elementor"),
8768
+ fieldLabel: __59("Send to", "elementor"),
8430
8769
  placeholder,
8431
8770
  suggestions
8432
8771
  }
8433
- ), shouldShowMentionsInfo() && /* @__PURE__ */ React118.createElement(InfoAlert2, null, __57("Type @ or an email field name to insert its submitted value.", "elementor"))));
8772
+ ), shouldShowMentionsInfo() && /* @__PURE__ */ React120.createElement(InfoAlert2, null, __59("Type @ or an email field name to insert its submitted value.", "elementor"))));
8434
8773
  };
8435
- var SubjectField = () => /* @__PURE__ */ React118.createElement(
8774
+ var SubjectField = () => /* @__PURE__ */ React120.createElement(
8436
8775
  EmailField,
8437
8776
  {
8438
8777
  bind: "subject",
8439
- label: __57("Email subject", "elementor"),
8440
- placeholder: __57("New form submission", "elementor")
8778
+ label: __59("Email subject", "elementor"),
8779
+ placeholder: __59("New form submission", "elementor")
8441
8780
  }
8442
8781
  );
8443
8782
  var MessageField = () => {
8444
8783
  const suggestions = useFormFieldSuggestions();
8445
- return /* @__PURE__ */ React118.createElement(PropKeyProvider, { bind: "message" }, /* @__PURE__ */ React118.createElement(Grid34, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React118.createElement(Grid34, { item: true }, /* @__PURE__ */ React118.createElement(ControlFormLabel, null, __57("Message", "elementor"))), /* @__PURE__ */ React118.createElement(Grid34, { item: true }, /* @__PURE__ */ React118.createElement(MentionTextAreaControl, { suggestions })), /* @__PURE__ */ React118.createElement(Grid34, { item: true }, /* @__PURE__ */ React118.createElement(InfoAlert2, null, shouldShowMentionsInfo() ? __57(
8784
+ return /* @__PURE__ */ React120.createElement(PropKeyProvider, { bind: "message" }, /* @__PURE__ */ React120.createElement(Grid34, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React120.createElement(Grid34, { item: true }, /* @__PURE__ */ React120.createElement(ControlFormLabel, null, __59("Message", "elementor"))), /* @__PURE__ */ React120.createElement(Grid34, { item: true }, /* @__PURE__ */ React120.createElement(MentionTextAreaControl, { suggestions })), /* @__PURE__ */ React120.createElement(Grid34, { item: true }, /* @__PURE__ */ React120.createElement(InfoAlert2, null, shouldShowMentionsInfo() ? __59(
8446
8785
  "[all-fields] shortcode sends all fields. Type @ to insert specific fields and customize your message.",
8447
8786
  "elementor"
8448
- ) : __57("[all-fields] shortcode sends all fields.", "elementor")))));
8787
+ ) : __59("[all-fields] shortcode sends all fields.", "elementor")))));
8449
8788
  };
8450
- var FromEmailField = () => /* @__PURE__ */ React118.createElement(
8789
+ var FromEmailField = () => /* @__PURE__ */ React120.createElement(
8451
8790
  EmailField,
8452
8791
  {
8453
8792
  bind: "from",
8454
- label: __57("From email", "elementor"),
8455
- placeholder: __57("What email should appear as the sender?", "elementor")
8793
+ label: __59("From email", "elementor"),
8794
+ placeholder: __59("What email should appear as the sender?", "elementor")
8456
8795
  }
8457
8796
  );
8458
- var FromNameField = () => /* @__PURE__ */ React118.createElement(
8797
+ var FromNameField = () => /* @__PURE__ */ React120.createElement(
8459
8798
  EmailField,
8460
8799
  {
8461
8800
  bind: "from-name",
8462
- label: __57("From name", "elementor"),
8463
- placeholder: __57("What name should appear as the sender?", "elementor")
8801
+ label: __59("From name", "elementor"),
8802
+ placeholder: __59("What name should appear as the sender?", "elementor")
8464
8803
  }
8465
8804
  );
8466
8805
  var ReplyToField = () => {
8467
8806
  const emailSuggestions = useFormFieldSuggestions({ inputType: "email" });
8468
- return /* @__PURE__ */ React118.createElement(PropKeyProvider, { bind: "reply-to" }, /* @__PURE__ */ React118.createElement(Grid34, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React118.createElement(Grid34, { item: true }, /* @__PURE__ */ React118.createElement(ControlFormLabel, null, __57("Reply-to", "elementor"))), /* @__PURE__ */ React118.createElement(Grid34, { item: true }, /* @__PURE__ */ React118.createElement(
8807
+ return /* @__PURE__ */ React120.createElement(PropKeyProvider, { bind: "reply-to" }, /* @__PURE__ */ React120.createElement(Grid34, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React120.createElement(Grid34, { item: true }, /* @__PURE__ */ React120.createElement(ControlFormLabel, null, __59("Reply-to", "elementor"))), /* @__PURE__ */ React120.createElement(Grid34, { item: true }, /* @__PURE__ */ React120.createElement(
8469
8808
  MentionTextAreaControl,
8470
8809
  {
8471
8810
  suggestions: emailSuggestions,
8472
8811
  rows: 1,
8473
8812
  triggerPosition: "start",
8474
- placeholder: __57("You can type @ to insert an email field", "elementor")
8813
+ placeholder: __59("You can type @ to insert an email field", "elementor")
8475
8814
  }
8476
8815
  ))));
8477
8816
  };
8478
8817
  var CcField = () => {
8479
8818
  const suggestions = useFormFieldSuggestions({ inputType: "email" });
8480
- return /* @__PURE__ */ React118.createElement(PropKeyProvider, { bind: "cc" }, /* @__PURE__ */ React118.createElement(EmailChipsField, { fieldLabel: __57("Cc", "elementor"), suggestions }));
8819
+ return /* @__PURE__ */ React120.createElement(PropKeyProvider, { bind: "cc" }, /* @__PURE__ */ React120.createElement(EmailChipsField, { fieldLabel: __59("Cc", "elementor"), suggestions }));
8481
8820
  };
8482
8821
  var BccField = () => {
8483
8822
  const suggestions = useFormFieldSuggestions({ inputType: "email" });
8484
- return /* @__PURE__ */ React118.createElement(PropKeyProvider, { bind: "bcc" }, /* @__PURE__ */ React118.createElement(EmailChipsField, { fieldLabel: __57("Bcc", "elementor"), suggestions }));
8823
+ return /* @__PURE__ */ React120.createElement(PropKeyProvider, { bind: "bcc" }, /* @__PURE__ */ React120.createElement(EmailChipsField, { fieldLabel: __59("Bcc", "elementor"), suggestions }));
8485
8824
  };
8486
- var MetaDataField = () => /* @__PURE__ */ React118.createElement(PropKeyProvider, { bind: "meta-data" }, /* @__PURE__ */ React118.createElement(Stack19, { gap: 0.5 }, /* @__PURE__ */ React118.createElement(ControlFormLabel, null, __57("Metadata", "elementor")), /* @__PURE__ */ React118.createElement(
8825
+ var MetaDataField = () => /* @__PURE__ */ React120.createElement(PropKeyProvider, { bind: "meta-data" }, /* @__PURE__ */ React120.createElement(Stack20, { gap: 0.5 }, /* @__PURE__ */ React120.createElement(ControlFormLabel, null, __59("Metadata", "elementor")), /* @__PURE__ */ React120.createElement(
8487
8826
  ChipsControl,
8488
8827
  {
8489
8828
  options: [
8490
- { label: __57("Date", "elementor"), value: "date" },
8491
- { label: __57("Time", "elementor"), value: "time" },
8492
- { label: __57("Page URL", "elementor"), value: "page-url" },
8493
- { label: __57("User agent", "elementor"), value: "user-agent" },
8494
- { label: __57("Credit", "elementor"), value: "credit" }
8829
+ { label: __59("Date", "elementor"), value: "date" },
8830
+ { label: __59("Time", "elementor"), value: "time" },
8831
+ { label: __59("Page URL", "elementor"), value: "page-url" },
8832
+ { label: __59("User agent", "elementor"), value: "user-agent" },
8833
+ { label: __59("Credit", "elementor"), value: "credit" }
8495
8834
  ]
8496
8835
  }
8497
8836
  )));
8498
- var SendAsField = () => /* @__PURE__ */ React118.createElement(PropKeyProvider, { bind: "send-as" }, /* @__PURE__ */ React118.createElement(Grid34, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React118.createElement(Grid34, { item: true }, /* @__PURE__ */ React118.createElement(ControlFormLabel, null, __57("Send as", "elementor"))), /* @__PURE__ */ React118.createElement(Grid34, { item: true }, /* @__PURE__ */ React118.createElement(
8837
+ var SendAsField = () => /* @__PURE__ */ React120.createElement(PropKeyProvider, { bind: "send-as" }, /* @__PURE__ */ React120.createElement(Grid34, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React120.createElement(Grid34, { item: true }, /* @__PURE__ */ React120.createElement(ControlFormLabel, null, __59("Send as", "elementor"))), /* @__PURE__ */ React120.createElement(Grid34, { item: true }, /* @__PURE__ */ React120.createElement(
8499
8838
  SelectControl,
8500
8839
  {
8501
8840
  options: [
8502
- { label: __57("HTML", "elementor"), value: "html" },
8503
- { label: __57("Plain Text", "elementor"), value: "plain" }
8841
+ { label: __59("HTML", "elementor"), value: "html" },
8842
+ { label: __59("Plain Text", "elementor"), value: "plain" }
8504
8843
  ]
8505
8844
  }
8506
8845
  ))));
@@ -8509,27 +8848,27 @@ var SendAsField = () => /* @__PURE__ */ React118.createElement(PropKeyProvider,
8509
8848
  var EmailFormActionControl = createControl(
8510
8849
  ({ toPlaceholder, label }) => {
8511
8850
  const { value, setValue, ...propContext } = useBoundProp(emailsPropTypeUtil);
8512
- return /* @__PURE__ */ React119.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React119.createElement(Stack20, { gap: 2 }, /* @__PURE__ */ React119.createElement(ControlLabel, null, label ? label + " " + __58("settings", "elementor") : __58("Email settings", "elementor")), /* @__PURE__ */ React119.createElement(SendToField, { placeholder: toPlaceholder }), /* @__PURE__ */ React119.createElement(SubjectField, null), /* @__PURE__ */ React119.createElement(MessageField, null), /* @__PURE__ */ React119.createElement(FromEmailField, null), /* @__PURE__ */ React119.createElement(AdvancedSettings, null)));
8851
+ return /* @__PURE__ */ React121.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React121.createElement(Stack21, { gap: 2 }, /* @__PURE__ */ React121.createElement(ControlLabel, null, label ? label + " " + __60("settings", "elementor") : __60("Email settings", "elementor")), /* @__PURE__ */ React121.createElement(SendToField, { placeholder: toPlaceholder }), /* @__PURE__ */ React121.createElement(SubjectField, null), /* @__PURE__ */ React121.createElement(MessageField, null), /* @__PURE__ */ React121.createElement(FromEmailField, null), /* @__PURE__ */ React121.createElement(AdvancedSettings, null)));
8513
8852
  }
8514
8853
  );
8515
- var AdvancedSettings = () => /* @__PURE__ */ React119.createElement(CollapsibleContent, { defaultOpen: false }, /* @__PURE__ */ React119.createElement(Box26, { sx: { pt: 2 } }, /* @__PURE__ */ React119.createElement(Stack20, { gap: 2 }, /* @__PURE__ */ React119.createElement(FromNameField, null), /* @__PURE__ */ React119.createElement(ReplyToField, null), /* @__PURE__ */ React119.createElement(CcField, null), /* @__PURE__ */ React119.createElement(BccField, null), /* @__PURE__ */ React119.createElement(Divider5, null), /* @__PURE__ */ React119.createElement(MetaDataField, null), /* @__PURE__ */ React119.createElement(SendAsField, null))));
8854
+ var AdvancedSettings = () => /* @__PURE__ */ React121.createElement(CollapsibleContent, { defaultOpen: false }, /* @__PURE__ */ React121.createElement(Box27, { sx: { pt: 2 } }, /* @__PURE__ */ React121.createElement(Stack21, { gap: 2 }, /* @__PURE__ */ React121.createElement(FromNameField, null), /* @__PURE__ */ React121.createElement(ReplyToField, null), /* @__PURE__ */ React121.createElement(CcField, null), /* @__PURE__ */ React121.createElement(BccField, null), /* @__PURE__ */ React121.createElement(Divider5, null), /* @__PURE__ */ React121.createElement(MetaDataField, null), /* @__PURE__ */ React121.createElement(SendAsField, null))));
8516
8855
 
8517
8856
  // src/controls/attachment-type-control.tsx
8518
- import * as React120 from "react";
8857
+ import * as React122 from "react";
8519
8858
  import { InfoAlert as InfoAlert3 } from "@elementor/editor-ui";
8520
8859
  import { Grid as Grid35 } from "@elementor/ui";
8521
- import { __ as __59 } from "@wordpress/i18n";
8860
+ import { __ as __61 } from "@wordpress/i18n";
8522
8861
  var AttachmentTypeControl = createControl(({ label, options }) => {
8523
- return /* @__PURE__ */ React120.createElement(Grid35, { container: true, direction: "column", gap: 1 }, label && /* @__PURE__ */ React120.createElement(Grid35, { item: true }, /* @__PURE__ */ React120.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ React120.createElement(Grid35, { item: true }, /* @__PURE__ */ React120.createElement(SelectControl, { options })), /* @__PURE__ */ React120.createElement(Grid35, { item: true }, /* @__PURE__ */ React120.createElement(InfoAlert3, null, __59(
8862
+ return /* @__PURE__ */ React122.createElement(Grid35, { container: true, direction: "column", gap: 1 }, label && /* @__PURE__ */ React122.createElement(Grid35, { item: true }, /* @__PURE__ */ React122.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ React122.createElement(Grid35, { item: true }, /* @__PURE__ */ React122.createElement(SelectControl, { options })), /* @__PURE__ */ React122.createElement(Grid35, { item: true }, /* @__PURE__ */ React122.createElement(InfoAlert3, null, __61(
8524
8863
  "Linked uploads are saved to the server. Direct attachments will not appear under Submissions.",
8525
8864
  "elementor"
8526
8865
  ))));
8527
8866
  });
8528
8867
 
8529
8868
  // src/controls/grid-span-control.tsx
8530
- import * as React121 from "react";
8869
+ import * as React123 from "react";
8531
8870
  import { spanPropTypeUtil } from "@elementor/editor-props";
8532
- import { TextField as TextField12 } from "@elementor/ui";
8871
+ import { TextField as TextField13 } from "@elementor/ui";
8533
8872
  var GridSpanControl = createControl(
8534
8873
  ({
8535
8874
  placeholder: propPlaceholder,
@@ -8546,8 +8885,8 @@ var GridSpanControl = createControl(
8546
8885
  setValue(next === "" ? null : next);
8547
8886
  };
8548
8887
  const placeholder = propPlaceholder ?? boundPlaceholder ?? `e.g: 'span 2' or '1 / 3'`;
8549
- return /* @__PURE__ */ React121.createElement(ControlActions, null, /* @__PURE__ */ React121.createElement(
8550
- TextField12,
8888
+ return /* @__PURE__ */ React123.createElement(ControlActions, null, /* @__PURE__ */ React123.createElement(
8889
+ TextField13,
8551
8890
  {
8552
8891
  size: "tiny",
8553
8892
  fullWidth: true,
@@ -8567,23 +8906,23 @@ var GridSpanControl = createControl(
8567
8906
  );
8568
8907
 
8569
8908
  // src/components/promotions/display-conditions-control.tsx
8570
- import * as React123 from "react";
8571
- import { useRef as useRef29 } from "react";
8909
+ import * as React125 from "react";
8910
+ import { useRef as useRef31 } from "react";
8572
8911
  import { SitemapIcon } from "@elementor/icons";
8573
- import { IconButton as IconButton9, Stack as Stack21, Tooltip as Tooltip9 } from "@elementor/ui";
8574
- import { __ as __60 } from "@wordpress/i18n";
8912
+ import { IconButton as IconButton10, Stack as Stack22, Tooltip as Tooltip11 } from "@elementor/ui";
8913
+ import { __ as __62 } from "@wordpress/i18n";
8575
8914
 
8576
8915
  // src/components/promotions/promotion-trigger.tsx
8577
- import * as React122 from "react";
8578
- import { forwardRef as forwardRef12, useCallback as useCallback5, useImperativeHandle, useState as useState20 } from "react";
8916
+ import * as React124 from "react";
8917
+ import { forwardRef as forwardRef12, useCallback as useCallback5, useImperativeHandle, useState as useState22 } from "react";
8579
8918
  import { PromotionChip as PromotionChip2, PromotionInfotip } from "@elementor/editor-ui";
8580
- import { Box as Box27 } from "@elementor/ui";
8919
+ import { Box as Box28 } from "@elementor/ui";
8581
8920
  function getV4Promotion(key) {
8582
8921
  return window.elementor?.config?.v4Promotions?.[key];
8583
8922
  }
8584
8923
  var PromotionTrigger = forwardRef12(
8585
8924
  ({ promotionKey, children, trackingData }, ref) => {
8586
- const [isOpen, setIsOpen] = useState20(false);
8925
+ const [isOpen, setIsOpen] = useState22(false);
8587
8926
  const promotion = getV4Promotion(promotionKey);
8588
8927
  const toggle = useCallback5(() => {
8589
8928
  setIsOpen((prev) => {
@@ -8594,7 +8933,7 @@ var PromotionTrigger = forwardRef12(
8594
8933
  });
8595
8934
  }, [trackingData]);
8596
8935
  useImperativeHandle(ref, () => ({ toggle }), [toggle]);
8597
- return /* @__PURE__ */ React122.createElement(React122.Fragment, null, promotion && /* @__PURE__ */ React122.createElement(
8936
+ return /* @__PURE__ */ React124.createElement(React124.Fragment, null, promotion && /* @__PURE__ */ React124.createElement(
8598
8937
  PromotionInfotip,
8599
8938
  {
8600
8939
  title: promotion.title,
@@ -8608,8 +8947,8 @@ var PromotionTrigger = forwardRef12(
8608
8947
  },
8609
8948
  onCtaClick: () => trackUpgradePromotionClick(trackingData)
8610
8949
  },
8611
- /* @__PURE__ */ React122.createElement(
8612
- Box27,
8950
+ /* @__PURE__ */ React124.createElement(
8951
+ Box28,
8613
8952
  {
8614
8953
  onClick: (e) => {
8615
8954
  e.stopPropagation();
@@ -8617,19 +8956,19 @@ var PromotionTrigger = forwardRef12(
8617
8956
  },
8618
8957
  sx: { cursor: "pointer", display: "inline-flex" }
8619
8958
  },
8620
- children ?? /* @__PURE__ */ React122.createElement(PromotionChip2, null)
8959
+ children ?? /* @__PURE__ */ React124.createElement(PromotionChip2, null)
8621
8960
  )
8622
8961
  ));
8623
8962
  }
8624
8963
  );
8625
8964
 
8626
8965
  // src/components/promotions/display-conditions-control.tsx
8627
- var ARIA_LABEL = __60("Display Conditions", "elementor");
8966
+ var ARIA_LABEL = __62("Display Conditions", "elementor");
8628
8967
  var TRACKING_DATA = { target_name: "display_conditions", location_l2: "general" };
8629
8968
  var DisplayConditionsControl = createControl(() => {
8630
- const triggerRef = useRef29(null);
8631
- return /* @__PURE__ */ React123.createElement(
8632
- Stack21,
8969
+ const triggerRef = useRef31(null);
8970
+ return /* @__PURE__ */ React125.createElement(
8971
+ Stack22,
8633
8972
  {
8634
8973
  direction: "row",
8635
8974
  spacing: 2,
@@ -8638,9 +8977,9 @@ var DisplayConditionsControl = createControl(() => {
8638
8977
  alignItems: "center"
8639
8978
  }
8640
8979
  },
8641
- /* @__PURE__ */ React123.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "displayConditions", trackingData: TRACKING_DATA }),
8642
- /* @__PURE__ */ React123.createElement(Tooltip9, { title: ARIA_LABEL, placement: "top" }, /* @__PURE__ */ React123.createElement(
8643
- IconButton9,
8980
+ /* @__PURE__ */ React125.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "displayConditions", trackingData: TRACKING_DATA }),
8981
+ /* @__PURE__ */ React125.createElement(Tooltip11, { title: ARIA_LABEL, placement: "top" }, /* @__PURE__ */ React125.createElement(
8982
+ IconButton10,
8644
8983
  {
8645
8984
  size: "tiny",
8646
8985
  "aria-label": ARIA_LABEL,
@@ -8652,23 +8991,23 @@ var DisplayConditionsControl = createControl(() => {
8652
8991
  borderRadius: 1
8653
8992
  }
8654
8993
  },
8655
- /* @__PURE__ */ React123.createElement(SitemapIcon, { fontSize: "tiny", color: "disabled" })
8994
+ /* @__PURE__ */ React125.createElement(SitemapIcon, { fontSize: "tiny", color: "disabled" })
8656
8995
  ))
8657
8996
  );
8658
8997
  });
8659
8998
 
8660
8999
  // src/components/promotions/attributes-control.tsx
8661
- import * as React124 from "react";
8662
- import { useRef as useRef30 } from "react";
9000
+ import * as React126 from "react";
9001
+ import { useRef as useRef32 } from "react";
8663
9002
  import { PlusIcon as PlusIcon4 } from "@elementor/icons";
8664
- import { Stack as Stack22, Tooltip as Tooltip10 } from "@elementor/ui";
8665
- import { __ as __61 } from "@wordpress/i18n";
8666
- var ARIA_LABEL2 = __61("Attributes", "elementor");
9003
+ import { Stack as Stack23, Tooltip as Tooltip12 } from "@elementor/ui";
9004
+ import { __ as __63 } from "@wordpress/i18n";
9005
+ var ARIA_LABEL2 = __63("Attributes", "elementor");
8667
9006
  var TRACKING_DATA2 = { target_name: "attributes", location_l2: "general" };
8668
9007
  var AttributesControl = createControl(() => {
8669
- const triggerRef = useRef30(null);
8670
- return /* @__PURE__ */ React124.createElement(
8671
- Stack22,
9008
+ const triggerRef = useRef32(null);
9009
+ return /* @__PURE__ */ React126.createElement(
9010
+ Stack23,
8672
9011
  {
8673
9012
  direction: "row",
8674
9013
  spacing: 2,
@@ -8677,8 +9016,8 @@ var AttributesControl = createControl(() => {
8677
9016
  alignItems: "center"
8678
9017
  }
8679
9018
  },
8680
- /* @__PURE__ */ React124.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "attributes", trackingData: TRACKING_DATA2 }),
8681
- /* @__PURE__ */ React124.createElement(Tooltip10, { title: ARIA_LABEL2, placement: "top" }, /* @__PURE__ */ React124.createElement(
9019
+ /* @__PURE__ */ React126.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "attributes", trackingData: TRACKING_DATA2 }),
9020
+ /* @__PURE__ */ React126.createElement(Tooltip12, { title: ARIA_LABEL2, placement: "top" }, /* @__PURE__ */ React126.createElement(
8682
9021
  PlusIcon4,
8683
9022
  {
8684
9023
  "aria-label": ARIA_LABEL2,
@@ -8692,29 +9031,29 @@ var AttributesControl = createControl(() => {
8692
9031
  });
8693
9032
 
8694
9033
  // src/components/icon-buttons/clear-icon-button.tsx
8695
- import * as React125 from "react";
9034
+ import * as React127 from "react";
8696
9035
  import { BrushBigIcon } from "@elementor/icons";
8697
- import { IconButton as IconButton10, styled as styled11, Tooltip as Tooltip11 } from "@elementor/ui";
8698
- var CustomIconButton = styled11(IconButton10)(({ theme }) => ({
9036
+ import { IconButton as IconButton11, styled as styled11, Tooltip as Tooltip13 } from "@elementor/ui";
9037
+ var CustomIconButton = styled11(IconButton11)(({ theme }) => ({
8699
9038
  width: theme.spacing(2.5),
8700
9039
  height: theme.spacing(2.5)
8701
9040
  }));
8702
- var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */ React125.createElement(Tooltip11, { title: tooltipText, placement: "top", disableInteractive: true }, /* @__PURE__ */ React125.createElement(CustomIconButton, { "aria-label": tooltipText, size, onClick, disabled }, /* @__PURE__ */ React125.createElement(BrushBigIcon, { fontSize: size })));
9041
+ var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */ React127.createElement(Tooltip13, { title: tooltipText, placement: "top", disableInteractive: true }, /* @__PURE__ */ React127.createElement(CustomIconButton, { "aria-label": tooltipText, size, onClick, disabled }, /* @__PURE__ */ React127.createElement(BrushBigIcon, { fontSize: size })));
8703
9042
 
8704
9043
  // src/components/repeater/repeater.tsx
8705
- import * as React126 from "react";
8706
- import { useEffect as useEffect18, useState as useState21 } from "react";
9044
+ import * as React128 from "react";
9045
+ import { useEffect as useEffect20, useState as useState23 } from "react";
8707
9046
  import { CopyIcon as CopyIcon2, EyeIcon as EyeIcon2, EyeOffIcon as EyeOffIcon2, PlusIcon as PlusIcon5, XIcon as XIcon4 } from "@elementor/icons";
8708
9047
  import {
8709
- bindPopover as bindPopover8,
9048
+ bindPopover as bindPopover9,
8710
9049
  bindTrigger as bindTrigger7,
8711
- Box as Box28,
8712
- IconButton as IconButton11,
9050
+ Box as Box29,
9051
+ IconButton as IconButton12,
8713
9052
  Infotip as Infotip4,
8714
- Tooltip as Tooltip12,
8715
- usePopupState as usePopupState10
9053
+ Tooltip as Tooltip14,
9054
+ usePopupState as usePopupState11
8716
9055
  } from "@elementor/ui";
8717
- import { __ as __62 } from "@wordpress/i18n";
9056
+ import { __ as __64 } from "@wordpress/i18n";
8718
9057
  var SIZE12 = "tiny";
8719
9058
  var EMPTY_OPEN_ITEM2 = -1;
8720
9059
  var Repeater3 = ({
@@ -8733,7 +9072,7 @@ var Repeater3 = ({
8733
9072
  isSortable = true,
8734
9073
  adornment = ControlAdornments
8735
9074
  }) => {
8736
- const [openItem, setOpenItem] = useState21(initialOpenItem);
9075
+ const [openItem, setOpenItem] = useState23(initialOpenItem);
8737
9076
  const uniqueKeys = items2.map(
8738
9077
  (item, index) => isSortable && "getId" in itemSettings ? itemSettings.getId({ item, index }) : String(index)
8739
9078
  );
@@ -8796,8 +9135,8 @@ var Repeater3 = ({
8796
9135
  };
8797
9136
  const isButtonDisabled = disabled || disableAddItemButton;
8798
9137
  const shouldShowInfotip = isButtonDisabled && addButtonInfotipContent;
8799
- const addButton = /* @__PURE__ */ React126.createElement(
8800
- IconButton11,
9138
+ const addButton = /* @__PURE__ */ React128.createElement(
9139
+ IconButton12,
8801
9140
  {
8802
9141
  size: SIZE12,
8803
9142
  sx: {
@@ -8805,11 +9144,11 @@ var Repeater3 = ({
8805
9144
  },
8806
9145
  disabled: isButtonDisabled,
8807
9146
  onClick: addRepeaterItem,
8808
- "aria-label": __62("Add item", "elementor")
9147
+ "aria-label": __64("Add item", "elementor")
8809
9148
  },
8810
- /* @__PURE__ */ React126.createElement(PlusIcon5, { fontSize: SIZE12 })
9149
+ /* @__PURE__ */ React128.createElement(PlusIcon5, { fontSize: SIZE12 })
8811
9150
  );
8812
- return /* @__PURE__ */ React126.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ React126.createElement(RepeaterHeader, { label, adornment }, shouldShowInfotip ? /* @__PURE__ */ React126.createElement(
9151
+ return /* @__PURE__ */ React128.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ React128.createElement(RepeaterHeader, { label, adornment }, shouldShowInfotip ? /* @__PURE__ */ React128.createElement(
8813
9152
  Infotip4,
8814
9153
  {
8815
9154
  placement: "right",
@@ -8817,20 +9156,20 @@ var Repeater3 = ({
8817
9156
  color: "secondary",
8818
9157
  slotProps: { popper: { sx: { width: 300 } } }
8819
9158
  },
8820
- /* @__PURE__ */ React126.createElement(Box28, { sx: { ...isButtonDisabled ? { cursor: "not-allowed" } : {} } }, addButton)
8821
- ) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */ React126.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key) => {
9159
+ /* @__PURE__ */ React128.createElement(Box29, { sx: { ...isButtonDisabled ? { cursor: "not-allowed" } : {} } }, addButton)
9160
+ ) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */ React128.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key) => {
8822
9161
  const index = uniqueKeys.indexOf(key);
8823
9162
  const value = items2[index];
8824
9163
  if (!value) {
8825
9164
  return null;
8826
9165
  }
8827
- return /* @__PURE__ */ React126.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React126.createElement(
9166
+ return /* @__PURE__ */ React128.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React128.createElement(
8828
9167
  RepeaterItem,
8829
9168
  {
8830
9169
  disabled,
8831
9170
  propDisabled: value?.disabled,
8832
- label: /* @__PURE__ */ React126.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React126.createElement(itemSettings.Label, { value, index })),
8833
- startIcon: /* @__PURE__ */ React126.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React126.createElement(itemSettings.Icon, { value })),
9171
+ label: /* @__PURE__ */ React128.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React128.createElement(itemSettings.Label, { value, index })),
9172
+ startIcon: /* @__PURE__ */ React128.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React128.createElement(itemSettings.Icon, { value })),
8834
9173
  removeItem: () => removeRepeaterItem(index),
8835
9174
  duplicateItem: () => duplicateRepeaterItem(index),
8836
9175
  toggleDisableItem: () => toggleDisableRepeaterItem(index),
@@ -8844,7 +9183,7 @@ var Repeater3 = ({
8844
9183
  actions: itemSettings.actions,
8845
9184
  value
8846
9185
  },
8847
- (props) => /* @__PURE__ */ React126.createElement(
9186
+ (props) => /* @__PURE__ */ React128.createElement(
8848
9187
  itemSettings.Content,
8849
9188
  {
8850
9189
  ...props,
@@ -8886,16 +9225,16 @@ var RepeaterItem = ({
8886
9225
  );
8887
9226
  const triggerProps = bindTrigger7(popoverState);
8888
9227
  usePopoverDismiss({ isOpen: popoverState.isOpen, onClose: popoverProps.onClose });
8889
- const duplicateLabel = __62("Duplicate", "elementor");
8890
- const toggleLabel = propDisabled ? __62("Show", "elementor") : __62("Hide", "elementor");
8891
- const removeLabel = __62("Remove", "elementor");
8892
- return /* @__PURE__ */ React126.createElement(Box28, { sx: { display: "contents" } }, /* @__PURE__ */ React126.createElement(
9228
+ const duplicateLabel = __64("Duplicate", "elementor");
9229
+ const toggleLabel = propDisabled ? __64("Show", "elementor") : __64("Hide", "elementor");
9230
+ const removeLabel = __64("Remove", "elementor");
9231
+ return /* @__PURE__ */ React128.createElement(Box29, { sx: { display: "contents" } }, /* @__PURE__ */ React128.createElement(
8893
9232
  RepeaterTag,
8894
9233
  {
8895
9234
  disabled,
8896
9235
  label,
8897
9236
  ref: setRef,
8898
- "aria-label": __62("Open item", "elementor"),
9237
+ "aria-label": __64("Open item", "elementor"),
8899
9238
  ...triggerProps,
8900
9239
  onClick: (e) => {
8901
9240
  triggerProps.onClick(e);
@@ -8904,15 +9243,15 @@ var RepeaterItem = ({
8904
9243
  }
8905
9244
  },
8906
9245
  startIcon,
8907
- actions: /* @__PURE__ */ React126.createElement(React126.Fragment, null, showDuplicate && /* @__PURE__ */ React126.createElement(Tooltip12, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React126.createElement(IconButton11, { size: SIZE12, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React126.createElement(CopyIcon2, { fontSize: SIZE12 }))), showToggle && /* @__PURE__ */ React126.createElement(Tooltip12, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React126.createElement(IconButton11, { size: SIZE12, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React126.createElement(EyeOffIcon2, { fontSize: SIZE12 }) : /* @__PURE__ */ React126.createElement(EyeIcon2, { fontSize: SIZE12 }))), actions?.(value), showRemove && /* @__PURE__ */ React126.createElement(Tooltip12, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React126.createElement(IconButton11, { size: SIZE12, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React126.createElement(XIcon4, { fontSize: SIZE12 }))))
9246
+ actions: /* @__PURE__ */ React128.createElement(React128.Fragment, null, showDuplicate && /* @__PURE__ */ React128.createElement(Tooltip14, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React128.createElement(IconButton12, { size: SIZE12, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React128.createElement(CopyIcon2, { fontSize: SIZE12 }))), showToggle && /* @__PURE__ */ React128.createElement(Tooltip14, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React128.createElement(IconButton12, { size: SIZE12, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React128.createElement(EyeOffIcon2, { fontSize: SIZE12 }) : /* @__PURE__ */ React128.createElement(EyeIcon2, { fontSize: SIZE12 }))), actions?.(value), showRemove && /* @__PURE__ */ React128.createElement(Tooltip14, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React128.createElement(IconButton12, { size: SIZE12, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React128.createElement(XIcon4, { fontSize: SIZE12 }))))
8908
9247
  }
8909
- ), /* @__PURE__ */ React126.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React126.createElement(Box28, null, children({ anchorEl: ref }))));
9248
+ ), /* @__PURE__ */ React128.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React128.createElement(Box29, null, children({ anchorEl: ref }))));
8910
9249
  };
8911
9250
  var usePopover = (openOnMount, onOpen, onPopoverClose) => {
8912
- const [ref, setRef] = useState21(null);
8913
- const popoverState = usePopupState10({ variant: "popover" });
8914
- const popoverProps = bindPopover8(popoverState);
8915
- useEffect18(() => {
9251
+ const [ref, setRef] = useState23(null);
9252
+ const popoverState = usePopupState11({ variant: "popover" });
9253
+ const popoverProps = bindPopover9(popoverState);
9254
+ useEffect20(() => {
8916
9255
  if (openOnMount && ref) {
8917
9256
  popoverState.open(ref);
8918
9257
  onOpen?.();
@@ -8930,293 +9269,6 @@ var usePopover = (openOnMount, onOpen, onPopoverClose) => {
8930
9269
  };
8931
9270
  };
8932
9271
 
8933
- // src/components/inline-editor-toolbar.tsx
8934
- import * as React128 from "react";
8935
- import { useEffect as useEffect20, useMemo as useMemo18, useRef as useRef32, useState as useState22 } from "react";
8936
- import { getContainer as getContainer3, getElementSetting } from "@elementor/editor-elements";
8937
- import {
8938
- BoldIcon,
8939
- ItalicIcon,
8940
- LinkIcon as LinkIcon3,
8941
- MinusIcon as MinusIcon2,
8942
- StrikethroughIcon,
8943
- SubscriptIcon,
8944
- SuperscriptIcon,
8945
- UnderlineIcon
8946
- } from "@elementor/icons";
8947
- import {
8948
- Box as Box29,
8949
- IconButton as IconButton12,
8950
- ToggleButton as ToggleButton3,
8951
- ToggleButtonGroup as ToggleButtonGroup2,
8952
- toggleButtonGroupClasses,
8953
- Tooltip as Tooltip14,
8954
- usePopupState as usePopupState11
8955
- } from "@elementor/ui";
8956
- import { useEditorState } from "@tiptap/react";
8957
- import { __ as __64 } from "@wordpress/i18n";
8958
-
8959
- // src/components/url-popover.tsx
8960
- import * as React127 from "react";
8961
- import { useEffect as useEffect19, useRef as useRef31 } from "react";
8962
- import { ExternalLinkIcon } from "@elementor/icons";
8963
- import { bindPopover as bindPopover9, Popover as Popover8, Stack as Stack23, TextField as TextField13, ToggleButton as ToggleButton2, Tooltip as Tooltip13 } from "@elementor/ui";
8964
- import { __ as __63 } from "@wordpress/i18n";
8965
- var UrlPopover = ({
8966
- popupState,
8967
- restoreValue,
8968
- anchorRef,
8969
- value,
8970
- onChange,
8971
- openInNewTab,
8972
- onToggleNewTab
8973
- }) => {
8974
- const inputRef = useRef31(null);
8975
- useEffect19(() => {
8976
- if (popupState.isOpen) {
8977
- requestAnimationFrame(() => inputRef.current?.focus());
8978
- }
8979
- }, [popupState.isOpen]);
8980
- const handleClose = () => {
8981
- restoreValue();
8982
- popupState.close();
8983
- };
8984
- return /* @__PURE__ */ React127.createElement(
8985
- Popover8,
8986
- {
8987
- slotProps: {
8988
- paper: { sx: { borderRadius: "16px", width: anchorRef.current?.offsetWidth + "px", marginTop: -1 } }
8989
- },
8990
- ...bindPopover9(popupState),
8991
- anchorOrigin: { vertical: "top", horizontal: "left" },
8992
- transformOrigin: { vertical: "top", horizontal: "left" },
8993
- onClose: handleClose
8994
- },
8995
- /* @__PURE__ */ React127.createElement(Stack23, { direction: "row", alignItems: "center", gap: 1, sx: { p: 1.5 } }, /* @__PURE__ */ React127.createElement(
8996
- TextField13,
8997
- {
8998
- value,
8999
- onChange,
9000
- size: "tiny",
9001
- fullWidth: true,
9002
- placeholder: __63("Type a URL", "elementor"),
9003
- inputProps: { ref: inputRef },
9004
- color: "secondary",
9005
- InputProps: { sx: { borderRadius: "8px" } },
9006
- onKeyUp: (event) => event.key === "Enter" && handleClose()
9007
- }
9008
- ), /* @__PURE__ */ React127.createElement(Tooltip13, { title: __63("Open in a new tab", "elementor") }, /* @__PURE__ */ React127.createElement(
9009
- ToggleButton2,
9010
- {
9011
- size: "tiny",
9012
- value: "newTab",
9013
- selected: openInNewTab,
9014
- onClick: onToggleNewTab,
9015
- "aria-label": __63("Open in a new tab", "elementor"),
9016
- sx: { borderRadius: "8px" }
9017
- },
9018
- /* @__PURE__ */ React127.createElement(ExternalLinkIcon, { fontSize: "tiny" })
9019
- )))
9020
- );
9021
- };
9022
-
9023
- // src/components/inline-editor-toolbar.tsx
9024
- var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
9025
- const [urlValue, setUrlValue] = useState22("");
9026
- const [openInNewTab, setOpenInNewTab] = useState22(false);
9027
- const toolbarRef = useRef32(null);
9028
- const linkPopupState = usePopupState11({ variant: "popover" });
9029
- const isElementClickable = elementId ? checkIfElementIsClickable(elementId) : false;
9030
- const editorState = useEditorState({
9031
- editor,
9032
- selector: (ctx) => possibleFormats.filter((format) => ctx.editor.isActive(format))
9033
- });
9034
- const formatButtonsList = useMemo18(() => {
9035
- const buttons = Object.values(formatButtons);
9036
- if (isElementClickable) {
9037
- return buttons.filter((button) => button.action !== "link");
9038
- }
9039
- return buttons;
9040
- }, [isElementClickable]);
9041
- const handleLinkClick = () => {
9042
- const linkAttrs = editor.getAttributes("link");
9043
- setUrlValue(linkAttrs.href || "");
9044
- setOpenInNewTab(linkAttrs.target === "_blank");
9045
- linkPopupState.open(toolbarRef.current);
9046
- };
9047
- const handleUrlChange = (event) => {
9048
- setUrlValue(event.target.value);
9049
- };
9050
- const handleToggleNewTab = () => {
9051
- setOpenInNewTab(!openInNewTab);
9052
- };
9053
- const handleUrlSubmit = () => {
9054
- if (urlValue) {
9055
- editor.chain().focus().setLink({
9056
- href: urlValue,
9057
- target: openInNewTab ? "_blank" : "_self"
9058
- }).run();
9059
- } else {
9060
- editor.chain().focus().unsetLink().run();
9061
- }
9062
- if (elementId) {
9063
- window.dispatchEvent(
9064
- new CustomEvent("elementor:inline-link-changed", {
9065
- detail: { elementId }
9066
- })
9067
- );
9068
- }
9069
- linkPopupState.close();
9070
- };
9071
- useEffect20(() => {
9072
- editor?.commands?.focus();
9073
- }, [editor]);
9074
- return /* @__PURE__ */ React128.createElement(
9075
- Box29,
9076
- {
9077
- ref: toolbarRef,
9078
- sx: {
9079
- display: "inline-flex",
9080
- gap: 0.5,
9081
- padding: 0.5,
9082
- borderRadius: "8px",
9083
- backgroundColor: "background.paper",
9084
- boxShadow: "0 2px 8px rgba(0, 0, 0, 0.2)",
9085
- alignItems: "center",
9086
- visibility: linkPopupState.isOpen ? "hidden" : "visible",
9087
- pointerEvents: linkPopupState.isOpen ? "none" : "all",
9088
- ...sx
9089
- }
9090
- },
9091
- /* @__PURE__ */ React128.createElement(Tooltip14, { title: clearButton.label, placement: "top", sx: { borderRadius: "8px" } }, /* @__PURE__ */ React128.createElement(IconButton12, { "aria-label": clearButton.label, onClick: () => clearButton.method(editor), size: "tiny" }, clearButton.icon)),
9092
- /* @__PURE__ */ React128.createElement(
9093
- ToggleButtonGroup2,
9094
- {
9095
- value: editorState,
9096
- size: "tiny",
9097
- sx: {
9098
- display: "flex",
9099
- gap: 0.5,
9100
- border: "none",
9101
- [`& .${toggleButtonGroupClasses.firstButton}, & .${toggleButtonGroupClasses.middleButton}, & .${toggleButtonGroupClasses.lastButton}`]: {
9102
- borderRadius: "8px",
9103
- border: "none",
9104
- marginLeft: 0,
9105
- "&.Mui-selected": {
9106
- marginLeft: 0
9107
- },
9108
- "& + &.Mui-selected": {
9109
- marginLeft: 0
9110
- }
9111
- }
9112
- }
9113
- },
9114
- formatButtonsList.map((button) => /* @__PURE__ */ React128.createElement(Tooltip14, { title: button.label, key: button.action, placement: "top" }, /* @__PURE__ */ React128.createElement(
9115
- ToggleButton3,
9116
- {
9117
- value: button.action,
9118
- "aria-label": button.label,
9119
- size: "tiny",
9120
- onClick: () => {
9121
- if (button.action === "link") {
9122
- handleLinkClick();
9123
- } else {
9124
- button.method?.(editor);
9125
- }
9126
- editor?.commands?.focus();
9127
- }
9128
- },
9129
- button.icon
9130
- )))
9131
- ),
9132
- /* @__PURE__ */ React128.createElement(
9133
- UrlPopover,
9134
- {
9135
- popupState: linkPopupState,
9136
- anchorRef: toolbarRef,
9137
- restoreValue: handleUrlSubmit,
9138
- value: urlValue,
9139
- onChange: handleUrlChange,
9140
- openInNewTab,
9141
- onToggleNewTab: handleToggleNewTab
9142
- }
9143
- )
9144
- );
9145
- };
9146
- var checkIfElementIsClickable = (elementId) => {
9147
- const container = getContainer3(elementId);
9148
- const type = container?.model.get("widgetType");
9149
- const isButton = type === "e-button";
9150
- const hasLink = !!getElementSetting(elementId, "link")?.value?.destination;
9151
- return isButton || hasLink;
9152
- };
9153
- var toolbarButtons = {
9154
- clear: {
9155
- label: __64("Clear", "elementor"),
9156
- icon: /* @__PURE__ */ React128.createElement(MinusIcon2, { fontSize: "tiny" }),
9157
- action: "clear",
9158
- method: (editor) => {
9159
- editor.chain().focus().clearNodes().unsetAllMarks().run();
9160
- }
9161
- },
9162
- bold: {
9163
- label: __64("Bold", "elementor"),
9164
- icon: /* @__PURE__ */ React128.createElement(BoldIcon, { fontSize: "tiny" }),
9165
- action: "bold",
9166
- method: (editor) => {
9167
- editor.chain().focus().toggleBold().run();
9168
- }
9169
- },
9170
- italic: {
9171
- label: __64("Italic", "elementor"),
9172
- icon: /* @__PURE__ */ React128.createElement(ItalicIcon, { fontSize: "tiny" }),
9173
- action: "italic",
9174
- method: (editor) => {
9175
- editor.chain().focus().toggleItalic().run();
9176
- }
9177
- },
9178
- underline: {
9179
- label: __64("Underline", "elementor"),
9180
- icon: /* @__PURE__ */ React128.createElement(UnderlineIcon, { fontSize: "tiny" }),
9181
- action: "underline",
9182
- method: (editor) => {
9183
- editor.chain().focus().toggleUnderline().run();
9184
- }
9185
- },
9186
- strike: {
9187
- label: __64("Strikethrough", "elementor"),
9188
- icon: /* @__PURE__ */ React128.createElement(StrikethroughIcon, { fontSize: "tiny" }),
9189
- action: "strike",
9190
- method: (editor) => {
9191
- editor.chain().focus().toggleStrike().run();
9192
- }
9193
- },
9194
- superscript: {
9195
- label: __64("Superscript", "elementor"),
9196
- icon: /* @__PURE__ */ React128.createElement(SuperscriptIcon, { fontSize: "tiny" }),
9197
- action: "superscript",
9198
- method: (editor) => {
9199
- editor.chain().focus().toggleSuperscript().run();
9200
- }
9201
- },
9202
- subscript: {
9203
- label: __64("Subscript", "elementor"),
9204
- icon: /* @__PURE__ */ React128.createElement(SubscriptIcon, { fontSize: "tiny" }),
9205
- action: "subscript",
9206
- method: (editor) => {
9207
- editor.chain().focus().toggleSubscript().run();
9208
- }
9209
- },
9210
- link: {
9211
- label: __64("Link", "elementor"),
9212
- icon: /* @__PURE__ */ React128.createElement(LinkIcon3, { fontSize: "tiny" }),
9213
- action: "link",
9214
- method: null
9215
- }
9216
- };
9217
- var { clear: clearButton, ...formatButtons } = toolbarButtons;
9218
- var possibleFormats = Object.keys(formatButtons);
9219
-
9220
9272
  // src/components/size/unstable-size-field.tsx
9221
9273
  import * as React131 from "react";
9222
9274
  import { InputAdornment as InputAdornment6 } from "@elementor/ui";