@elementor/editor-editing-panel 3.35.0-491 → 3.35.0-493
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 +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +85 -33
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +74 -23
- package/dist/index.mjs.map +1 -1
- package/package.json +20 -20
- package/src/dynamics/components/dynamic-selection-control.tsx +13 -4
- package/src/dynamics/components/dynamic-selection.tsx +63 -27
- package/src/hooks/use-license-config.ts +26 -0
- package/src/index.ts +1 -0
package/dist/index.d.mts
CHANGED
|
@@ -1368,4 +1368,9 @@ declare function doGetAppliedClasses(elementId: string, classesPropType?: string
|
|
|
1368
1368
|
declare function doApplyClasses(elementId: string, classIds: StyleDefinitionID[], classesPropType?: string): void;
|
|
1369
1369
|
declare function doUnapplyClass(elementId: string, classId: StyleDefinitionID, classesPropType?: string): boolean;
|
|
1370
1370
|
|
|
1371
|
-
|
|
1371
|
+
type LicenseConfig = {
|
|
1372
|
+
expired: boolean;
|
|
1373
|
+
};
|
|
1374
|
+
declare function setLicenseConfig(newConfig: Partial<LicenseConfig>): void;
|
|
1375
|
+
|
|
1376
|
+
export { Control as BaseControl, type ControlType, CustomCssIndicator, ElementProvider, FIELD_TYPE, HISTORY_DEBOUNCE_WAIT, type PopoverActionProps, PopoverBody, SectionContent, SettingsControl, SettingsField, StyleIndicator, StyleTabSection, StylesProviderCannotUpdatePropsError, type ValidationEvent, type ValidationResult, controlActionsMenu, controlsRegistry, createTopLevelObjectType, doApplyClasses, doGetAppliedClasses, doUnapplyClass, getControlReplacements, getFieldIndicators, getSubtitle, getTitle, init, injectIntoClassSelectorActions, injectIntoCssClassConvert, injectIntoPanelHeaderTop, injectIntoStyleTab, registerControlReplacement, registerEditingPanelReplacement, registerFieldIndicator, registerStyleProviderToColors, setLicenseConfig, stylesInheritanceTransformersRegistry, useClassesProp, useCustomCss, useElement, useFontFamilies, usePanelActions, usePanelStatus, useSectionWidth, useStateByElement, useStyle, useStylesRerender };
|
package/dist/index.d.ts
CHANGED
|
@@ -1368,4 +1368,9 @@ declare function doGetAppliedClasses(elementId: string, classesPropType?: string
|
|
|
1368
1368
|
declare function doApplyClasses(elementId: string, classIds: StyleDefinitionID[], classesPropType?: string): void;
|
|
1369
1369
|
declare function doUnapplyClass(elementId: string, classId: StyleDefinitionID, classesPropType?: string): boolean;
|
|
1370
1370
|
|
|
1371
|
-
|
|
1371
|
+
type LicenseConfig = {
|
|
1372
|
+
expired: boolean;
|
|
1373
|
+
};
|
|
1374
|
+
declare function setLicenseConfig(newConfig: Partial<LicenseConfig>): void;
|
|
1375
|
+
|
|
1376
|
+
export { Control as BaseControl, type ControlType, CustomCssIndicator, ElementProvider, FIELD_TYPE, HISTORY_DEBOUNCE_WAIT, type PopoverActionProps, PopoverBody, SectionContent, SettingsControl, SettingsField, StyleIndicator, StyleTabSection, StylesProviderCannotUpdatePropsError, type ValidationEvent, type ValidationResult, controlActionsMenu, controlsRegistry, createTopLevelObjectType, doApplyClasses, doGetAppliedClasses, doUnapplyClass, getControlReplacements, getFieldIndicators, getSubtitle, getTitle, init, injectIntoClassSelectorActions, injectIntoCssClassConvert, injectIntoPanelHeaderTop, injectIntoStyleTab, registerControlReplacement, registerEditingPanelReplacement, registerFieldIndicator, registerStyleProviderToColors, setLicenseConfig, stylesInheritanceTransformersRegistry, useClassesProp, useCustomCss, useElement, useFontFamilies, usePanelActions, usePanelStatus, useSectionWidth, useStateByElement, useStyle, useStylesRerender };
|
package/dist/index.js
CHANGED
|
@@ -61,6 +61,7 @@ __export(index_exports, {
|
|
|
61
61
|
registerEditingPanelReplacement: () => registerEditingPanelReplacement,
|
|
62
62
|
registerFieldIndicator: () => registerFieldIndicator,
|
|
63
63
|
registerStyleProviderToColors: () => registerStyleProviderToColors,
|
|
64
|
+
setLicenseConfig: () => setLicenseConfig,
|
|
64
65
|
stylesInheritanceTransformersRegistry: () => stylesInheritanceTransformersRegistry,
|
|
65
66
|
useBoundProp: () => import_editor_controls63.useBoundProp,
|
|
66
67
|
useClassesProp: () => useClassesProp,
|
|
@@ -5487,6 +5488,25 @@ var import_icons25 = require("@elementor/icons");
|
|
|
5487
5488
|
var import_ui42 = require("@elementor/ui");
|
|
5488
5489
|
var import_i18n62 = require("@wordpress/i18n");
|
|
5489
5490
|
|
|
5491
|
+
// src/hooks/use-license-config.ts
|
|
5492
|
+
var import_react41 = require("react");
|
|
5493
|
+
var config = { expired: false };
|
|
5494
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
5495
|
+
function setLicenseConfig(newConfig) {
|
|
5496
|
+
config = { ...config, ...newConfig };
|
|
5497
|
+
listeners.forEach((listener) => listener());
|
|
5498
|
+
}
|
|
5499
|
+
function getConfig() {
|
|
5500
|
+
return config;
|
|
5501
|
+
}
|
|
5502
|
+
function subscribe(listener) {
|
|
5503
|
+
listeners.add(listener);
|
|
5504
|
+
return () => listeners.delete(listener);
|
|
5505
|
+
}
|
|
5506
|
+
function useLicenseConfig() {
|
|
5507
|
+
return (0, import_react41.useSyncExternalStore)(subscribe, getConfig, getConfig);
|
|
5508
|
+
}
|
|
5509
|
+
|
|
5490
5510
|
// src/hooks/use-persist-dynamic-value.ts
|
|
5491
5511
|
var import_session9 = require("@elementor/session");
|
|
5492
5512
|
var usePersistDynamicValue = (propKey) => {
|
|
@@ -5581,7 +5601,7 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
5581
5601
|
};
|
|
5582
5602
|
|
|
5583
5603
|
// src/dynamics/components/dynamic-selection.tsx
|
|
5584
|
-
var
|
|
5604
|
+
var import_react42 = require("react");
|
|
5585
5605
|
var React91 = __toESM(require("react"));
|
|
5586
5606
|
var import_editor_controls57 = require("@elementor/editor-controls");
|
|
5587
5607
|
var import_editor_ui9 = require("@elementor/editor-ui");
|
|
@@ -5591,8 +5611,9 @@ var import_i18n61 = require("@wordpress/i18n");
|
|
|
5591
5611
|
var SIZE4 = "tiny";
|
|
5592
5612
|
var PROMO_TEXT_WIDTH = 170;
|
|
5593
5613
|
var PRO_DYNAMIC_TAGS_URL = "https://go.elementor.com/go-pro-dynamic-tags-modal/";
|
|
5594
|
-
var
|
|
5595
|
-
|
|
5614
|
+
var RENEW_DYNAMIC_TAGS_URL = "https://go.elementor.com/go-pro-dynamic-tags-renew-modal/";
|
|
5615
|
+
var DynamicSelection = ({ close: closePopover, expired = false }) => {
|
|
5616
|
+
const [searchValue, setSearchValue] = (0, import_react42.useState)("");
|
|
5596
5617
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
5597
5618
|
const theme = (0, import_ui41.useTheme)();
|
|
5598
5619
|
const { value: anyValue } = (0, import_editor_controls57.useBoundProp)();
|
|
@@ -5624,6 +5645,32 @@ var DynamicSelection = ({ close: closePopover }) => {
|
|
|
5624
5645
|
label: item.label
|
|
5625
5646
|
}))
|
|
5626
5647
|
]);
|
|
5648
|
+
const getPopOverContent = () => {
|
|
5649
|
+
if (hasNoDynamicTags) {
|
|
5650
|
+
return /* @__PURE__ */ React91.createElement(NoDynamicTags, null);
|
|
5651
|
+
}
|
|
5652
|
+
if (expired) {
|
|
5653
|
+
return /* @__PURE__ */ React91.createElement(ExpiredDynamicTags, null);
|
|
5654
|
+
}
|
|
5655
|
+
return /* @__PURE__ */ React91.createElement(import_react42.Fragment, null, /* @__PURE__ */ React91.createElement(
|
|
5656
|
+
import_editor_ui9.SearchField,
|
|
5657
|
+
{
|
|
5658
|
+
value: searchValue,
|
|
5659
|
+
onSearch: handleSearch,
|
|
5660
|
+
placeholder: (0, import_i18n61.__)("Search dynamic tags\u2026", "elementor")
|
|
5661
|
+
}
|
|
5662
|
+
), /* @__PURE__ */ React91.createElement(import_ui41.Divider, null), /* @__PURE__ */ React91.createElement(
|
|
5663
|
+
import_editor_ui9.PopoverMenuList,
|
|
5664
|
+
{
|
|
5665
|
+
items: virtualizedItems,
|
|
5666
|
+
onSelect: handleSetDynamicTag,
|
|
5667
|
+
onClose: closePopover,
|
|
5668
|
+
selectedValue: dynamicValue?.name,
|
|
5669
|
+
itemStyle: (item) => item.type === "item" ? { paddingInlineStart: theme.spacing(3.5) } : {},
|
|
5670
|
+
noResultsComponent: /* @__PURE__ */ React91.createElement(NoResults, { searchValue, onClear: () => setSearchValue("") })
|
|
5671
|
+
}
|
|
5672
|
+
));
|
|
5673
|
+
};
|
|
5627
5674
|
return /* @__PURE__ */ React91.createElement(PopoverBody, { "aria-label": (0, import_i18n61.__)("Dynamic tags", "elementor") }, /* @__PURE__ */ React91.createElement(
|
|
5628
5675
|
import_editor_ui9.PopoverHeader,
|
|
5629
5676
|
{
|
|
@@ -5631,24 +5678,7 @@ var DynamicSelection = ({ close: closePopover }) => {
|
|
|
5631
5678
|
onClose: closePopover,
|
|
5632
5679
|
icon: /* @__PURE__ */ React91.createElement(import_icons24.DatabaseIcon, { fontSize: SIZE4 })
|
|
5633
5680
|
}
|
|
5634
|
-
),
|
|
5635
|
-
import_editor_ui9.SearchField,
|
|
5636
|
-
{
|
|
5637
|
-
value: searchValue,
|
|
5638
|
-
onSearch: handleSearch,
|
|
5639
|
-
placeholder: (0, import_i18n61.__)("Search dynamic tags\u2026", "elementor")
|
|
5640
|
-
}
|
|
5641
|
-
), /* @__PURE__ */ React91.createElement(import_ui41.Divider, null), /* @__PURE__ */ React91.createElement(
|
|
5642
|
-
import_editor_ui9.PopoverMenuList,
|
|
5643
|
-
{
|
|
5644
|
-
items: virtualizedItems,
|
|
5645
|
-
onSelect: handleSetDynamicTag,
|
|
5646
|
-
onClose: closePopover,
|
|
5647
|
-
selectedValue: dynamicValue?.name,
|
|
5648
|
-
itemStyle: (item) => item.type === "item" ? { paddingInlineStart: theme.spacing(3.5) } : {},
|
|
5649
|
-
noResultsComponent: /* @__PURE__ */ React91.createElement(NoResults, { searchValue, onClear: () => setSearchValue("") })
|
|
5650
|
-
}
|
|
5651
|
-
)));
|
|
5681
|
+
), getPopOverContent());
|
|
5652
5682
|
};
|
|
5653
5683
|
var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */ React91.createElement(
|
|
5654
5684
|
import_ui41.Stack,
|
|
@@ -5681,6 +5711,22 @@ var NoDynamicTags = () => /* @__PURE__ */ React91.createElement(React91.Fragment
|
|
|
5681
5711
|
/* @__PURE__ */ React91.createElement(import_ui41.Typography, { align: "center", variant: "caption", width: PROMO_TEXT_WIDTH }, (0, import_i18n61.__)("Upgrade now to display your content dynamically.", "elementor")),
|
|
5682
5712
|
/* @__PURE__ */ React91.createElement(import_editor_ui9.CtaButton, { size: "small", href: PRO_DYNAMIC_TAGS_URL })
|
|
5683
5713
|
));
|
|
5714
|
+
var ExpiredDynamicTags = () => /* @__PURE__ */ React91.createElement(React91.Fragment, null, /* @__PURE__ */ React91.createElement(import_ui41.Divider, null), /* @__PURE__ */ React91.createElement(
|
|
5715
|
+
import_ui41.Stack,
|
|
5716
|
+
{
|
|
5717
|
+
gap: 1,
|
|
5718
|
+
alignItems: "center",
|
|
5719
|
+
justifyContent: "center",
|
|
5720
|
+
height: "100%",
|
|
5721
|
+
p: 2.5,
|
|
5722
|
+
color: "text.secondary",
|
|
5723
|
+
sx: { pb: 3.5 }
|
|
5724
|
+
},
|
|
5725
|
+
/* @__PURE__ */ React91.createElement(import_icons24.DatabaseIcon, { fontSize: "large" }),
|
|
5726
|
+
/* @__PURE__ */ React91.createElement(import_ui41.Typography, { align: "center", variant: "subtitle2" }, (0, import_i18n61.__)("Unlock your Dynamic tags again", "elementor")),
|
|
5727
|
+
/* @__PURE__ */ React91.createElement(import_ui41.Typography, { align: "center", variant: "caption", width: PROMO_TEXT_WIDTH }, (0, import_i18n61.__)("Dynamic tags need Elementor Pro. Renew now to keep them active.", "elementor")),
|
|
5728
|
+
/* @__PURE__ */ React91.createElement(import_editor_ui9.CtaButton, { size: "small", href: RENEW_DYNAMIC_TAGS_URL, children: (0, import_i18n61.__)("Renew Now", "elementor") })
|
|
5729
|
+
));
|
|
5684
5730
|
var useFilteredOptions = (searchValue) => {
|
|
5685
5731
|
const dynamicTags = usePropDynamicTags();
|
|
5686
5732
|
const options12 = dynamicTags.reduce((categories, { name, label, group }) => {
|
|
@@ -5703,6 +5749,7 @@ var tagsWithoutTabs = ["popup"];
|
|
|
5703
5749
|
var DynamicSelectionControl = ({ OriginalControl, ...props }) => {
|
|
5704
5750
|
const { setValue: setAnyValue, propType } = (0, import_editor_controls58.useBoundProp)();
|
|
5705
5751
|
const { bind, value } = (0, import_editor_controls58.useBoundProp)(dynamicPropTypeUtil);
|
|
5752
|
+
const { expired: readonly } = useLicenseConfig();
|
|
5706
5753
|
const originalPropType = createTopLevelObjectType({
|
|
5707
5754
|
schema: {
|
|
5708
5755
|
[bind]: propType
|
|
@@ -5729,7 +5776,7 @@ var DynamicSelectionControl = ({ OriginalControl, ...props }) => {
|
|
|
5729
5776
|
label: dynamicTag.label,
|
|
5730
5777
|
startIcon: /* @__PURE__ */ React92.createElement(import_icons25.DatabaseIcon, { fontSize: SIZE5 }),
|
|
5731
5778
|
...(0, import_ui42.bindTrigger)(selectionPopoverState),
|
|
5732
|
-
actions: /* @__PURE__ */ React92.createElement(React92.Fragment, null, /* @__PURE__ */ React92.createElement(DynamicSettingsPopover, { dynamicTag }), /* @__PURE__ */ React92.createElement(
|
|
5779
|
+
actions: /* @__PURE__ */ React92.createElement(React92.Fragment, null, /* @__PURE__ */ React92.createElement(DynamicSettingsPopover, { dynamicTag, disabled: readonly }), /* @__PURE__ */ React92.createElement(
|
|
5733
5780
|
import_ui42.IconButton,
|
|
5734
5781
|
{
|
|
5735
5782
|
size: SIZE5,
|
|
@@ -5751,10 +5798,13 @@ var DynamicSelectionControl = ({ OriginalControl, ...props }) => {
|
|
|
5751
5798
|
},
|
|
5752
5799
|
...(0, import_ui42.bindPopover)(selectionPopoverState)
|
|
5753
5800
|
},
|
|
5754
|
-
/* @__PURE__ */ React92.createElement(PopoverBody, { "aria-label": (0, import_i18n62.__)("Dynamic tags", "elementor") }, /* @__PURE__ */ React92.createElement(DynamicSelection, { close: selectionPopoverState.close }))
|
|
5801
|
+
/* @__PURE__ */ React92.createElement(PopoverBody, { "aria-label": (0, import_i18n62.__)("Dynamic tags", "elementor") }, /* @__PURE__ */ React92.createElement(DynamicSelection, { close: selectionPopoverState.close, expired: readonly }))
|
|
5755
5802
|
));
|
|
5756
5803
|
};
|
|
5757
|
-
var DynamicSettingsPopover = ({
|
|
5804
|
+
var DynamicSettingsPopover = ({
|
|
5805
|
+
dynamicTag,
|
|
5806
|
+
disabled = false
|
|
5807
|
+
}) => {
|
|
5758
5808
|
const popupState = (0, import_ui42.usePopupState)({ variant: "popover" });
|
|
5759
5809
|
const hasDynamicSettings = !!dynamicTag.atomic_controls.length;
|
|
5760
5810
|
if (!hasDynamicSettings) {
|
|
@@ -5764,7 +5814,8 @@ var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
|
5764
5814
|
import_ui42.IconButton,
|
|
5765
5815
|
{
|
|
5766
5816
|
size: SIZE5,
|
|
5767
|
-
|
|
5817
|
+
disabled,
|
|
5818
|
+
...!disabled && (0, import_ui42.bindTrigger)(popupState),
|
|
5768
5819
|
"aria-label": (0, import_i18n62.__)("Dynamic settings", "elementor")
|
|
5769
5820
|
},
|
|
5770
5821
|
/* @__PURE__ */ React92.createElement(import_icons25.SettingsIcon, { fontSize: SIZE5 })
|
|
@@ -6046,22 +6097,22 @@ var import_i18n68 = require("@wordpress/i18n");
|
|
|
6046
6097
|
|
|
6047
6098
|
// src/styles-inheritance/components/styles-inheritance-infotip.tsx
|
|
6048
6099
|
var React98 = __toESM(require("react"));
|
|
6049
|
-
var
|
|
6100
|
+
var import_react44 = require("react");
|
|
6050
6101
|
var import_editor_canvas6 = require("@elementor/editor-canvas");
|
|
6051
6102
|
var import_editor_ui11 = require("@elementor/editor-ui");
|
|
6052
6103
|
var import_ui47 = require("@elementor/ui");
|
|
6053
6104
|
var import_i18n67 = require("@wordpress/i18n");
|
|
6054
6105
|
|
|
6055
6106
|
// src/styles-inheritance/hooks/use-normalized-inheritance-chain-items.tsx
|
|
6056
|
-
var
|
|
6107
|
+
var import_react43 = require("react");
|
|
6057
6108
|
var import_editor_canvas4 = require("@elementor/editor-canvas");
|
|
6058
6109
|
var import_editor_styles8 = require("@elementor/editor-styles");
|
|
6059
6110
|
var import_editor_styles_repository14 = require("@elementor/editor-styles-repository");
|
|
6060
6111
|
var import_i18n65 = require("@wordpress/i18n");
|
|
6061
6112
|
var MAXIMUM_ITEMS = 2;
|
|
6062
6113
|
var useNormalizedInheritanceChainItems = (inheritanceChain, bind, resolve) => {
|
|
6063
|
-
const [items3, setItems] = (0,
|
|
6064
|
-
(0,
|
|
6114
|
+
const [items3, setItems] = (0, import_react43.useState)([]);
|
|
6115
|
+
(0, import_react43.useEffect)(() => {
|
|
6065
6116
|
(async () => {
|
|
6066
6117
|
const normalizedItems = await Promise.all(
|
|
6067
6118
|
inheritanceChain.filter(({ style }) => style).map((item, index) => normalizeInheritanceItem(item, index, bind, resolve))
|
|
@@ -6112,7 +6163,7 @@ var getTransformedValue = async (item, bind, resolve) => {
|
|
|
6112
6163
|
}
|
|
6113
6164
|
});
|
|
6114
6165
|
const value = result?.[bind] ?? result;
|
|
6115
|
-
if ((0,
|
|
6166
|
+
if ((0, import_react43.isValidElement)(value)) {
|
|
6116
6167
|
return value;
|
|
6117
6168
|
}
|
|
6118
6169
|
if (typeof value === "object") {
|
|
@@ -6237,8 +6288,8 @@ var StylesInheritanceInfotip = ({
|
|
|
6237
6288
|
children,
|
|
6238
6289
|
isDisabled
|
|
6239
6290
|
}) => {
|
|
6240
|
-
const [showInfotip, setShowInfotip] = (0,
|
|
6241
|
-
const triggerRef = (0,
|
|
6291
|
+
const [showInfotip, setShowInfotip] = (0, import_react44.useState)(false);
|
|
6292
|
+
const triggerRef = (0, import_react44.useRef)(null);
|
|
6242
6293
|
const toggleInfotip = () => {
|
|
6243
6294
|
if (isDisabled) {
|
|
6244
6295
|
return;
|
|
@@ -6253,7 +6304,7 @@ var StylesInheritanceInfotip = ({
|
|
|
6253
6304
|
};
|
|
6254
6305
|
const key = path.join(".");
|
|
6255
6306
|
const sectionWidth = useSectionWidth();
|
|
6256
|
-
const resolve = (0,
|
|
6307
|
+
const resolve = (0, import_react44.useMemo)(() => {
|
|
6257
6308
|
return (0, import_editor_canvas6.createPropsResolver)({
|
|
6258
6309
|
transformers: stylesInheritanceTransformersRegistry,
|
|
6259
6310
|
schema: { [key]: propType }
|
|
@@ -6739,6 +6790,7 @@ var blockV1Panel = () => {
|
|
|
6739
6790
|
registerEditingPanelReplacement,
|
|
6740
6791
|
registerFieldIndicator,
|
|
6741
6792
|
registerStyleProviderToColors,
|
|
6793
|
+
setLicenseConfig,
|
|
6742
6794
|
stylesInheritanceTransformersRegistry,
|
|
6743
6795
|
useBoundProp,
|
|
6744
6796
|
useClassesProp,
|