@elementor/editor-controls 4.1.0-758 → 4.1.0-759
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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +92 -63
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +67 -38
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/controls/size-control/hooks/use-size-value.ts +18 -8
- package/src/controls/size-control/hooks/use-unit-sync.ts +28 -0
- package/src/controls/size-control/unstable-size-control.tsx +1 -1
- package/src/controls/size-control/utils/resolve-bound-prop-value.ts +31 -27
package/dist/index.d.mts
CHANGED
|
@@ -483,7 +483,7 @@ type SizeVariant = 'length' | 'angle' | 'time';
|
|
|
483
483
|
type SetSizeValue<T> = (value: T, options?: CreateOptions, meta?: SetValueMeta) => void;
|
|
484
484
|
|
|
485
485
|
type Props$3 = {
|
|
486
|
-
placeholder?: string;
|
|
486
|
+
placeholder?: string | SizePropValue['value'];
|
|
487
487
|
variant?: SizeVariant;
|
|
488
488
|
anchorRef?: RefObject<HTMLDivElement | null>;
|
|
489
489
|
startIcon?: React$1.ReactNode;
|
package/dist/index.d.ts
CHANGED
|
@@ -483,7 +483,7 @@ type SizeVariant = 'length' | 'angle' | 'time';
|
|
|
483
483
|
type SetSizeValue<T> = (value: T, options?: CreateOptions, meta?: SetValueMeta) => void;
|
|
484
484
|
|
|
485
485
|
type Props$3 = {
|
|
486
|
-
placeholder?: string;
|
|
486
|
+
placeholder?: string | SizePropValue['value'];
|
|
487
487
|
variant?: SizeVariant;
|
|
488
488
|
anchorRef?: RefObject<HTMLDivElement | null>;
|
|
489
489
|
startIcon?: React$1.ReactNode;
|
package/dist/index.js
CHANGED
|
@@ -6849,7 +6849,7 @@ var import_editor_props56 = require("@elementor/editor-props");
|
|
|
6849
6849
|
|
|
6850
6850
|
// src/controls/size-control/size-component.tsx
|
|
6851
6851
|
var React107 = __toESM(require("react"));
|
|
6852
|
-
var
|
|
6852
|
+
var import_react63 = require("react");
|
|
6853
6853
|
var import_editor_responsive4 = require("@elementor/editor-responsive");
|
|
6854
6854
|
var import_ui92 = require("@elementor/ui");
|
|
6855
6855
|
|
|
@@ -6920,7 +6920,7 @@ var isNumericValue = (value) => {
|
|
|
6920
6920
|
};
|
|
6921
6921
|
|
|
6922
6922
|
// src/controls/size-control/hooks/use-size-value.ts
|
|
6923
|
-
var
|
|
6923
|
+
var import_react59 = require("react");
|
|
6924
6924
|
|
|
6925
6925
|
// src/controls/size-control/utils/resolve-size-value.ts
|
|
6926
6926
|
var DEFAULT_SIZE2 = "";
|
|
@@ -6971,6 +6971,24 @@ var sanitizeSize = (size) => {
|
|
|
6971
6971
|
return size;
|
|
6972
6972
|
};
|
|
6973
6973
|
|
|
6974
|
+
// src/controls/size-control/hooks/use-unit-sync.ts
|
|
6975
|
+
var import_react58 = require("react");
|
|
6976
|
+
var useUnitSync = ({ unit, setUnit, persistWhen }) => {
|
|
6977
|
+
const [state, setState] = (0, import_react58.useState)(unit);
|
|
6978
|
+
(0, import_react58.useEffect)(() => {
|
|
6979
|
+
if (unit !== state) {
|
|
6980
|
+
setState(unit);
|
|
6981
|
+
}
|
|
6982
|
+
}, [unit]);
|
|
6983
|
+
const setInternalValue = (newUnit) => {
|
|
6984
|
+
setState(newUnit);
|
|
6985
|
+
if (persistWhen()) {
|
|
6986
|
+
setUnit(newUnit);
|
|
6987
|
+
}
|
|
6988
|
+
};
|
|
6989
|
+
return [state, setInternalValue];
|
|
6990
|
+
};
|
|
6991
|
+
|
|
6974
6992
|
// src/controls/size-control/hooks/use-size-value.ts
|
|
6975
6993
|
var useSizeValue = ({
|
|
6976
6994
|
value,
|
|
@@ -6978,7 +6996,7 @@ var useSizeValue = ({
|
|
|
6978
6996
|
units: units2,
|
|
6979
6997
|
defaultUnit
|
|
6980
6998
|
}) => {
|
|
6981
|
-
const resolvedValue = (0,
|
|
6999
|
+
const resolvedValue = (0, import_react59.useMemo)(
|
|
6982
7000
|
() => resolveSizeValue(value, { units: units2, defaultUnit }),
|
|
6983
7001
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6984
7002
|
[value?.size, value?.unit, defaultUnit]
|
|
@@ -6993,25 +7011,34 @@ var useSizeValue = ({
|
|
|
6993
7011
|
persistWhen: (next) => hasChanged(next, resolvedValue),
|
|
6994
7012
|
fallback: () => createDefaultSizeValue(units2, defaultUnit)
|
|
6995
7013
|
});
|
|
7014
|
+
const [unit, setUnit] = useUnitSync({
|
|
7015
|
+
unit: sizeValue?.unit,
|
|
7016
|
+
setUnit: (newUnit) => {
|
|
7017
|
+
setSizeValue({
|
|
7018
|
+
unit: newUnit,
|
|
7019
|
+
size: resolveSizeOnUnitChange(sizeValue.size, newUnit)
|
|
7020
|
+
});
|
|
7021
|
+
},
|
|
7022
|
+
persistWhen: () => {
|
|
7023
|
+
return Boolean(sizeValue.size) || sizeValue.size !== "";
|
|
7024
|
+
}
|
|
7025
|
+
});
|
|
6996
7026
|
const setSize = (newSize, isInputValid = true) => {
|
|
6997
|
-
if (isExtendedUnit(
|
|
7027
|
+
if (isExtendedUnit(unit)) {
|
|
6998
7028
|
return;
|
|
6999
7029
|
}
|
|
7000
7030
|
const trimmed = newSize.trim();
|
|
7001
7031
|
const parsed = Number(trimmed);
|
|
7002
7032
|
const newState = {
|
|
7003
|
-
|
|
7033
|
+
unit,
|
|
7004
7034
|
size: trimmed && !isNaN(parsed) ? parsed : ""
|
|
7005
7035
|
};
|
|
7006
7036
|
setSizeValue(newState, void 0, { validation: () => isInputValid });
|
|
7007
7037
|
};
|
|
7008
|
-
const setUnit = (unit) => {
|
|
7009
|
-
setSizeValue({ unit, size: resolveSizeOnUnitChange(sizeValue.size, unit) });
|
|
7010
|
-
};
|
|
7011
7038
|
return {
|
|
7012
7039
|
size: sizeValue.size,
|
|
7013
|
-
unit: sizeValue.unit,
|
|
7014
7040
|
setSize,
|
|
7041
|
+
unit,
|
|
7015
7042
|
setUnit
|
|
7016
7043
|
};
|
|
7017
7044
|
};
|
|
@@ -7021,8 +7048,8 @@ var hasChanged = (next, current) => {
|
|
|
7021
7048
|
|
|
7022
7049
|
// src/controls/size-control/ui/size-input.tsx
|
|
7023
7050
|
var React103 = __toESM(require("react"));
|
|
7024
|
-
var
|
|
7025
|
-
var SizeInput2 = (0,
|
|
7051
|
+
var import_react60 = require("react");
|
|
7052
|
+
var SizeInput2 = (0, import_react60.forwardRef)(
|
|
7026
7053
|
({
|
|
7027
7054
|
id,
|
|
7028
7055
|
type,
|
|
@@ -7066,7 +7093,7 @@ var getCursorStyle = (readOnly) => ({
|
|
|
7066
7093
|
|
|
7067
7094
|
// src/controls/size-control/ui/unit-selector.tsx
|
|
7068
7095
|
var React104 = __toESM(require("react"));
|
|
7069
|
-
var
|
|
7096
|
+
var import_react61 = require("react");
|
|
7070
7097
|
var import_editor_ui14 = require("@elementor/editor-ui");
|
|
7071
7098
|
var import_ui89 = require("@elementor/ui");
|
|
7072
7099
|
var menuItemContentStyles = {
|
|
@@ -7085,7 +7112,7 @@ var UnitSelector = ({
|
|
|
7085
7112
|
}) => {
|
|
7086
7113
|
const popupState = (0, import_ui89.usePopupState)({
|
|
7087
7114
|
variant: "popover",
|
|
7088
|
-
popupId: (0,
|
|
7115
|
+
popupId: (0, import_react61.useId)()
|
|
7089
7116
|
});
|
|
7090
7117
|
const handleMenuItemClick = (option) => {
|
|
7091
7118
|
onSelect(option);
|
|
@@ -7210,15 +7237,15 @@ var shouldHighlightUnit = (value) => {
|
|
|
7210
7237
|
|
|
7211
7238
|
// src/controls/size-control/ui/text-field-popover.tsx
|
|
7212
7239
|
var React106 = __toESM(require("react"));
|
|
7213
|
-
var
|
|
7240
|
+
var import_react62 = require("react");
|
|
7214
7241
|
var import_editor_ui15 = require("@elementor/editor-ui");
|
|
7215
7242
|
var import_icons35 = require("@elementor/icons");
|
|
7216
7243
|
var import_ui91 = require("@elementor/ui");
|
|
7217
7244
|
var import_i18n52 = require("@wordpress/i18n");
|
|
7218
7245
|
var SIZE10 = "tiny";
|
|
7219
7246
|
var TextFieldPopover2 = ({ popupState, anchorRef, value, onChange, onClose }) => {
|
|
7220
|
-
const inputRef = (0,
|
|
7221
|
-
(0,
|
|
7247
|
+
const inputRef = (0, import_react62.useRef)(null);
|
|
7248
|
+
(0, import_react62.useEffect)(() => {
|
|
7222
7249
|
if (popupState.isOpen) {
|
|
7223
7250
|
requestAnimationFrame(() => {
|
|
7224
7251
|
if (inputRef.current) {
|
|
@@ -7285,7 +7312,7 @@ var SizeComponent = ({ anchorRef, SizeFieldWrapper = React107.Fragment, ...sizeF
|
|
|
7285
7312
|
const activeBreakpoint = (0, import_editor_responsive4.useActiveBreakpoint)();
|
|
7286
7313
|
const isCustomUnit = sizeFieldProps?.value?.unit === EXTENDED_UNITS.custom;
|
|
7287
7314
|
const hasCustomUnitOption = sizeFieldProps.units.includes(EXTENDED_UNITS.custom);
|
|
7288
|
-
(0,
|
|
7315
|
+
(0, import_react63.useEffect)(() => {
|
|
7289
7316
|
if (popupState && popupState.isOpen) {
|
|
7290
7317
|
popupState.close();
|
|
7291
7318
|
}
|
|
@@ -7340,36 +7367,38 @@ var SizeComponent = ({ anchorRef, SizeFieldWrapper = React107.Fragment, ...sizeF
|
|
|
7340
7367
|
// src/controls/size-control/utils/resolve-bound-prop-value.ts
|
|
7341
7368
|
var import_editor_props55 = require("@elementor/editor-props");
|
|
7342
7369
|
var resolveBoundPropValue = (value, boundPropPlaceholder, propPlaceholder) => {
|
|
7343
|
-
|
|
7344
|
-
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7370
|
+
const sizeValue = pickFirstValid([
|
|
7371
|
+
{ candidate: value, resolve: (v) => v },
|
|
7372
|
+
{ candidate: propPlaceholder, resolve: toUnitPlaceholder },
|
|
7373
|
+
{ candidate: boundPropPlaceholder, resolve: toUnitPlaceholder }
|
|
7374
|
+
]);
|
|
7375
|
+
const placeholderSource = propPlaceholder ?? boundPropPlaceholder;
|
|
7349
7376
|
return {
|
|
7350
7377
|
sizeValue,
|
|
7351
|
-
placeholder: resolvePlaceholder(
|
|
7378
|
+
placeholder: resolvePlaceholder(placeholderSource)
|
|
7352
7379
|
};
|
|
7353
7380
|
};
|
|
7381
|
+
var toUnitPlaceholder = (v) => ({ ...v, size: "" });
|
|
7382
|
+
var pickFirstValid = (candidates) => {
|
|
7383
|
+
const found = candidates.find(({ candidate }) => validateSizeValue(candidate));
|
|
7384
|
+
return found ? found.resolve(found.candidate) : null;
|
|
7385
|
+
};
|
|
7354
7386
|
var validateSizeValue = (value) => {
|
|
7355
|
-
if (!value) {
|
|
7387
|
+
if (!value || typeof value !== "object") {
|
|
7356
7388
|
return false;
|
|
7357
7389
|
}
|
|
7358
7390
|
const sizePropValue = import_editor_props55.sizePropTypeUtil.create(value);
|
|
7359
7391
|
return import_editor_props55.sizePropTypeUtil.isValid(sizePropValue);
|
|
7360
7392
|
};
|
|
7361
|
-
var resolvePlaceholder = (
|
|
7362
|
-
if (
|
|
7363
|
-
return
|
|
7393
|
+
var resolvePlaceholder = (placeholder) => {
|
|
7394
|
+
if (typeof placeholder === "string") {
|
|
7395
|
+
return placeholder;
|
|
7364
7396
|
}
|
|
7365
|
-
const size =
|
|
7397
|
+
const size = placeholder?.size;
|
|
7366
7398
|
if (size === void 0) {
|
|
7367
7399
|
return void 0;
|
|
7368
7400
|
}
|
|
7369
|
-
|
|
7370
|
-
return size.toString();
|
|
7371
|
-
}
|
|
7372
|
-
return size;
|
|
7401
|
+
return typeof size === "number" ? size.toString() : size;
|
|
7373
7402
|
};
|
|
7374
7403
|
|
|
7375
7404
|
// src/controls/size-control/utils/settings/get-prop-type-settings.ts
|
|
@@ -7462,24 +7491,24 @@ var UnstableSizeControl = createControl(
|
|
|
7462
7491
|
|
|
7463
7492
|
// src/components/promotions/display-conditions-control.tsx
|
|
7464
7493
|
var React110 = __toESM(require("react"));
|
|
7465
|
-
var
|
|
7494
|
+
var import_react65 = require("react");
|
|
7466
7495
|
var import_icons36 = require("@elementor/icons");
|
|
7467
7496
|
var import_ui94 = require("@elementor/ui");
|
|
7468
7497
|
var import_i18n53 = require("@wordpress/i18n");
|
|
7469
7498
|
|
|
7470
7499
|
// src/components/promotions/promotion-trigger.tsx
|
|
7471
7500
|
var React109 = __toESM(require("react"));
|
|
7472
|
-
var
|
|
7501
|
+
var import_react64 = require("react");
|
|
7473
7502
|
var import_editor_ui16 = require("@elementor/editor-ui");
|
|
7474
7503
|
var import_ui93 = require("@elementor/ui");
|
|
7475
7504
|
function getV4Promotion(key) {
|
|
7476
7505
|
return window.elementor?.config?.v4Promotions?.[key];
|
|
7477
7506
|
}
|
|
7478
|
-
var PromotionTrigger = (0,
|
|
7507
|
+
var PromotionTrigger = (0, import_react64.forwardRef)(
|
|
7479
7508
|
({ promotionKey, children, trackingData }, ref) => {
|
|
7480
|
-
const [isOpen, setIsOpen] = (0,
|
|
7509
|
+
const [isOpen, setIsOpen] = (0, import_react64.useState)(false);
|
|
7481
7510
|
const promotion = getV4Promotion(promotionKey);
|
|
7482
|
-
const toggle = (0,
|
|
7511
|
+
const toggle = (0, import_react64.useCallback)(() => {
|
|
7483
7512
|
setIsOpen((prev) => {
|
|
7484
7513
|
if (!prev) {
|
|
7485
7514
|
trackViewPromotion(trackingData);
|
|
@@ -7487,7 +7516,7 @@ var PromotionTrigger = (0, import_react63.forwardRef)(
|
|
|
7487
7516
|
return !prev;
|
|
7488
7517
|
});
|
|
7489
7518
|
}, [trackingData]);
|
|
7490
|
-
(0,
|
|
7519
|
+
(0, import_react64.useImperativeHandle)(ref, () => ({ toggle }), [toggle]);
|
|
7491
7520
|
return /* @__PURE__ */ React109.createElement(React109.Fragment, null, promotion && /* @__PURE__ */ React109.createElement(
|
|
7492
7521
|
import_editor_ui16.PromotionInfotip,
|
|
7493
7522
|
{
|
|
@@ -7521,7 +7550,7 @@ var PromotionTrigger = (0, import_react63.forwardRef)(
|
|
|
7521
7550
|
var ARIA_LABEL = (0, import_i18n53.__)("Display Conditions", "elementor");
|
|
7522
7551
|
var TRACKING_DATA = { target_name: "display_conditions", location_l2: "general" };
|
|
7523
7552
|
var DisplayConditionsControl = createControl(() => {
|
|
7524
|
-
const triggerRef = (0,
|
|
7553
|
+
const triggerRef = (0, import_react65.useRef)(null);
|
|
7525
7554
|
return /* @__PURE__ */ React110.createElement(
|
|
7526
7555
|
import_ui94.Stack,
|
|
7527
7556
|
{
|
|
@@ -7553,14 +7582,14 @@ var DisplayConditionsControl = createControl(() => {
|
|
|
7553
7582
|
|
|
7554
7583
|
// src/components/promotions/attributes-control.tsx
|
|
7555
7584
|
var React111 = __toESM(require("react"));
|
|
7556
|
-
var
|
|
7585
|
+
var import_react66 = require("react");
|
|
7557
7586
|
var import_icons37 = require("@elementor/icons");
|
|
7558
7587
|
var import_ui95 = require("@elementor/ui");
|
|
7559
7588
|
var import_i18n54 = require("@wordpress/i18n");
|
|
7560
7589
|
var ARIA_LABEL2 = (0, import_i18n54.__)("Attributes", "elementor");
|
|
7561
7590
|
var TRACKING_DATA2 = { target_name: "attributes", location_l2: "general" };
|
|
7562
7591
|
var AttributesControl = createControl(() => {
|
|
7563
|
-
const triggerRef = (0,
|
|
7592
|
+
const triggerRef = (0, import_react66.useRef)(null);
|
|
7564
7593
|
return /* @__PURE__ */ React111.createElement(
|
|
7565
7594
|
import_ui95.Stack,
|
|
7566
7595
|
{
|
|
@@ -7597,7 +7626,7 @@ var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /*
|
|
|
7597
7626
|
|
|
7598
7627
|
// src/components/repeater/repeater.tsx
|
|
7599
7628
|
var React113 = __toESM(require("react"));
|
|
7600
|
-
var
|
|
7629
|
+
var import_react67 = require("react");
|
|
7601
7630
|
var import_icons39 = require("@elementor/icons");
|
|
7602
7631
|
var import_ui97 = require("@elementor/ui");
|
|
7603
7632
|
var import_i18n55 = require("@wordpress/i18n");
|
|
@@ -7618,7 +7647,7 @@ var Repeater3 = ({
|
|
|
7618
7647
|
openItem: initialOpenItem = EMPTY_OPEN_ITEM2,
|
|
7619
7648
|
isSortable = true
|
|
7620
7649
|
}) => {
|
|
7621
|
-
const [openItem, setOpenItem] = (0,
|
|
7650
|
+
const [openItem, setOpenItem] = (0, import_react67.useState)(initialOpenItem);
|
|
7622
7651
|
const uniqueKeys = items2.map(
|
|
7623
7652
|
(item, index) => isSortable && "getId" in itemSettings ? itemSettings.getId({ item, index }) : String(index)
|
|
7624
7653
|
);
|
|
@@ -7800,10 +7829,10 @@ var RepeaterItem = ({
|
|
|
7800
7829
|
));
|
|
7801
7830
|
};
|
|
7802
7831
|
var usePopover = (openOnMount, onOpen) => {
|
|
7803
|
-
const [ref, setRef] = (0,
|
|
7832
|
+
const [ref, setRef] = (0, import_react67.useState)(null);
|
|
7804
7833
|
const popoverState = (0, import_ui97.usePopupState)({ variant: "popover" });
|
|
7805
7834
|
const popoverProps = (0, import_ui97.bindPopover)(popoverState);
|
|
7806
|
-
(0,
|
|
7835
|
+
(0, import_react67.useEffect)(() => {
|
|
7807
7836
|
if (openOnMount && ref) {
|
|
7808
7837
|
popoverState.open(ref);
|
|
7809
7838
|
onOpen?.();
|
|
@@ -7819,16 +7848,16 @@ var usePopover = (openOnMount, onOpen) => {
|
|
|
7819
7848
|
|
|
7820
7849
|
// src/components/inline-editor-toolbar.tsx
|
|
7821
7850
|
var React115 = __toESM(require("react"));
|
|
7822
|
-
var
|
|
7851
|
+
var import_react69 = require("react");
|
|
7823
7852
|
var import_editor_elements6 = require("@elementor/editor-elements");
|
|
7824
7853
|
var import_icons41 = require("@elementor/icons");
|
|
7825
7854
|
var import_ui99 = require("@elementor/ui");
|
|
7826
|
-
var
|
|
7855
|
+
var import_react70 = require("@tiptap/react");
|
|
7827
7856
|
var import_i18n57 = require("@wordpress/i18n");
|
|
7828
7857
|
|
|
7829
7858
|
// src/components/url-popover.tsx
|
|
7830
7859
|
var React114 = __toESM(require("react"));
|
|
7831
|
-
var
|
|
7860
|
+
var import_react68 = require("react");
|
|
7832
7861
|
var import_icons40 = require("@elementor/icons");
|
|
7833
7862
|
var import_ui98 = require("@elementor/ui");
|
|
7834
7863
|
var import_i18n56 = require("@wordpress/i18n");
|
|
@@ -7841,8 +7870,8 @@ var UrlPopover = ({
|
|
|
7841
7870
|
openInNewTab,
|
|
7842
7871
|
onToggleNewTab
|
|
7843
7872
|
}) => {
|
|
7844
|
-
const inputRef = (0,
|
|
7845
|
-
(0,
|
|
7873
|
+
const inputRef = (0, import_react68.useRef)(null);
|
|
7874
|
+
(0, import_react68.useEffect)(() => {
|
|
7846
7875
|
if (popupState.isOpen) {
|
|
7847
7876
|
requestAnimationFrame(() => inputRef.current?.focus());
|
|
7848
7877
|
}
|
|
@@ -7892,16 +7921,16 @@ var UrlPopover = ({
|
|
|
7892
7921
|
|
|
7893
7922
|
// src/components/inline-editor-toolbar.tsx
|
|
7894
7923
|
var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
7895
|
-
const [urlValue, setUrlValue] = (0,
|
|
7896
|
-
const [openInNewTab, setOpenInNewTab] = (0,
|
|
7897
|
-
const toolbarRef = (0,
|
|
7924
|
+
const [urlValue, setUrlValue] = (0, import_react69.useState)("");
|
|
7925
|
+
const [openInNewTab, setOpenInNewTab] = (0, import_react69.useState)(false);
|
|
7926
|
+
const toolbarRef = (0, import_react69.useRef)(null);
|
|
7898
7927
|
const linkPopupState = (0, import_ui99.usePopupState)({ variant: "popover" });
|
|
7899
7928
|
const isElementClickable = elementId ? checkIfElementIsClickable(elementId) : false;
|
|
7900
|
-
const editorState = (0,
|
|
7929
|
+
const editorState = (0, import_react70.useEditorState)({
|
|
7901
7930
|
editor,
|
|
7902
7931
|
selector: (ctx) => possibleFormats.filter((format) => ctx.editor.isActive(format))
|
|
7903
7932
|
});
|
|
7904
|
-
const formatButtonsList = (0,
|
|
7933
|
+
const formatButtonsList = (0, import_react69.useMemo)(() => {
|
|
7905
7934
|
const buttons = Object.values(formatButtons);
|
|
7906
7935
|
if (isElementClickable) {
|
|
7907
7936
|
return buttons.filter((button) => button.action !== "link");
|
|
@@ -7938,7 +7967,7 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
7938
7967
|
}
|
|
7939
7968
|
linkPopupState.close();
|
|
7940
7969
|
};
|
|
7941
|
-
(0,
|
|
7970
|
+
(0, import_react69.useEffect)(() => {
|
|
7942
7971
|
editor?.commands?.focus();
|
|
7943
7972
|
}, [editor]);
|
|
7944
7973
|
return /* @__PURE__ */ React115.createElement(
|
|
@@ -8132,7 +8161,7 @@ var differsFromExternal = (newState, externalState) => {
|
|
|
8132
8161
|
|
|
8133
8162
|
// src/components/size/unit-select.tsx
|
|
8134
8163
|
var React116 = __toESM(require("react"));
|
|
8135
|
-
var
|
|
8164
|
+
var import_react71 = require("react");
|
|
8136
8165
|
var import_editor_ui17 = require("@elementor/editor-ui");
|
|
8137
8166
|
var import_ui100 = require("@elementor/ui");
|
|
8138
8167
|
var menuItemContentStyles2 = {
|
|
@@ -8143,7 +8172,7 @@ var menuItemContentStyles2 = {
|
|
|
8143
8172
|
var UnitSelect = ({ value, showPrimaryColor, onClick, options }) => {
|
|
8144
8173
|
const popupState = (0, import_ui100.usePopupState)({
|
|
8145
8174
|
variant: "popover",
|
|
8146
|
-
popupId: (0,
|
|
8175
|
+
popupId: (0, import_react71.useId)()
|
|
8147
8176
|
});
|
|
8148
8177
|
const handleMenuItemClick = (index) => {
|
|
8149
8178
|
onClick(options[index]);
|
|
@@ -8179,8 +8208,8 @@ var StyledButton3 = (0, import_ui100.styled)(import_ui100.Button, {
|
|
|
8179
8208
|
|
|
8180
8209
|
// src/components/size/unstable-size-input.tsx
|
|
8181
8210
|
var React117 = __toESM(require("react"));
|
|
8182
|
-
var
|
|
8183
|
-
var UnstableSizeInput = (0,
|
|
8211
|
+
var import_react72 = require("react");
|
|
8212
|
+
var UnstableSizeInput = (0, import_react72.forwardRef)(
|
|
8184
8213
|
({ type, value, onChange, onKeyDown, onKeyUp, InputProps, onBlur, focused, disabled }, ref) => {
|
|
8185
8214
|
return /* @__PURE__ */ React117.createElement(
|
|
8186
8215
|
NumberInput,
|
|
@@ -8248,7 +8277,7 @@ var hasValue = (value) => {
|
|
|
8248
8277
|
};
|
|
8249
8278
|
|
|
8250
8279
|
// src/hooks/use-font-families.ts
|
|
8251
|
-
var
|
|
8280
|
+
var import_react73 = require("react");
|
|
8252
8281
|
var import_editor_v1_adapters = require("@elementor/editor-v1-adapters");
|
|
8253
8282
|
var getFontControlConfig = () => {
|
|
8254
8283
|
const { controls } = (0, import_editor_v1_adapters.getElementorConfig)();
|
|
@@ -8256,7 +8285,7 @@ var getFontControlConfig = () => {
|
|
|
8256
8285
|
};
|
|
8257
8286
|
var useFontFamilies = () => {
|
|
8258
8287
|
const { groups, options } = getFontControlConfig();
|
|
8259
|
-
return (0,
|
|
8288
|
+
return (0, import_react73.useMemo)(() => {
|
|
8260
8289
|
if (!groups || !options) {
|
|
8261
8290
|
return [];
|
|
8262
8291
|
}
|