@elementor/editor-editing-panel 4.3.0-1048 → 4.3.0-1050
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.js +626 -288
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +544 -199
- package/dist/index.mjs.map +1 -1
- package/package.json +24 -24
- package/src/controls-registry/element-controls/accordion-items-control/accordion-items-control.tsx +141 -0
- package/src/controls-registry/element-controls/accordion-items-control/use-actions.ts +235 -0
- package/src/controls-registry/element-controls/accordion-items-control/use-show-icon-write-through.ts +135 -0
- package/src/controls-registry/element-controls/registry.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -5734,7 +5734,7 @@ function PseudoStateMenuItems({ states, activeState, onSelectState, onClose }) {
|
|
|
5734
5734
|
// src/init.ts
|
|
5735
5735
|
var import_editor = require("@elementor/editor");
|
|
5736
5736
|
var import_editor_panels3 = require("@elementor/editor-panels");
|
|
5737
|
-
var
|
|
5737
|
+
var import_editor_v1_adapters12 = require("@elementor/editor-v1-adapters");
|
|
5738
5738
|
|
|
5739
5739
|
// src/hooks/use-open-editor-panel.ts
|
|
5740
5740
|
var import_react38 = require("react");
|
|
@@ -5815,19 +5815,356 @@ var init = () => {
|
|
|
5815
5815
|
}
|
|
5816
5816
|
};
|
|
5817
5817
|
|
|
5818
|
-
// src/controls-registry/element-controls/
|
|
5818
|
+
// src/controls-registry/element-controls/accordion-items-control/accordion-items-control.tsx
|
|
5819
5819
|
var React95 = __toESM(require("react"));
|
|
5820
|
-
var
|
|
5820
|
+
var import_editor_controls58 = require("@elementor/editor-controls");
|
|
5821
5821
|
var import_editor_elements19 = require("@elementor/editor-elements");
|
|
5822
|
-
var
|
|
5823
|
-
var import_icons28 = require("@elementor/icons");
|
|
5822
|
+
var import_editor_props19 = require("@elementor/editor-props");
|
|
5824
5823
|
var import_ui47 = require("@elementor/ui");
|
|
5824
|
+
var import_i18n70 = require("@wordpress/i18n");
|
|
5825
|
+
|
|
5826
|
+
// src/controls-registry/element-controls/accordion-items-control/use-actions.ts
|
|
5827
|
+
var import_editor_elements17 = require("@elementor/editor-elements");
|
|
5828
|
+
var import_editor_props17 = require("@elementor/editor-props");
|
|
5829
|
+
var import_i18n68 = require("@wordpress/i18n");
|
|
5830
|
+
var ACCORDION_ELEMENT_TYPE = "e-accordion";
|
|
5831
|
+
var ACCORDION_ITEM_ELEMENT_TYPE = "e-accordion-item";
|
|
5832
|
+
var ACCORDION_ITEM_HEADER_ELEMENT_TYPE = "e-accordion-item-header";
|
|
5833
|
+
var ACCORDION_ITEM_TITLE_ELEMENT_TYPE = "e-accordion-item-title";
|
|
5834
|
+
var ACCORDION_ITEM_ICON_ELEMENT_TYPE = "e-accordion-item-icon";
|
|
5835
|
+
var ACCORDION_ITEM_CONTENT_ELEMENT_TYPE = "e-accordion-item-content";
|
|
5836
|
+
var PARAGRAPH_WIDGET_TYPE = "e-paragraph";
|
|
5837
|
+
var getItemTitle = (position) => (
|
|
5838
|
+
/* translators: %d: Accordion item position. */
|
|
5839
|
+
(0, import_i18n68.sprintf)((0, import_i18n68.__)("Accordion Item %d", "elementor"), position)
|
|
5840
|
+
);
|
|
5841
|
+
var TRAILING_NUMBER = /(\d+)\s*$/;
|
|
5842
|
+
var getNextItemNumber = (existingTitles) => {
|
|
5843
|
+
const taken = new Set(existingTitles.filter((title) => Boolean(title)));
|
|
5844
|
+
const highest = existingTitles.reduce((max, title) => {
|
|
5845
|
+
const [, trailingNumber] = title?.match(TRAILING_NUMBER) ?? [];
|
|
5846
|
+
const parsed = trailingNumber ? Number(trailingNumber) : 0;
|
|
5847
|
+
return Number.isFinite(parsed) && parsed > max ? parsed : max;
|
|
5848
|
+
}, 0);
|
|
5849
|
+
let next = highest + 1;
|
|
5850
|
+
while (taken.has(getItemTitle(next))) {
|
|
5851
|
+
next += 1;
|
|
5852
|
+
}
|
|
5853
|
+
return next;
|
|
5854
|
+
};
|
|
5855
|
+
var buildItemModel = (position, showIcon) => {
|
|
5856
|
+
const numberedTitle = getItemTitle(position);
|
|
5857
|
+
return {
|
|
5858
|
+
elType: ACCORDION_ITEM_ELEMENT_TYPE,
|
|
5859
|
+
id: (0, import_editor_elements17.generateElementId)(),
|
|
5860
|
+
editor_settings: { title: numberedTitle, initial_position: position },
|
|
5861
|
+
elements: [
|
|
5862
|
+
{
|
|
5863
|
+
elType: ACCORDION_ITEM_HEADER_ELEMENT_TYPE,
|
|
5864
|
+
id: (0, import_editor_elements17.generateElementId)(),
|
|
5865
|
+
editor_settings: { title: (0, import_i18n68.__)("Header", "elementor") },
|
|
5866
|
+
// Seeded from the root's *current* `show_icon` value, not the schema default: if a user
|
|
5867
|
+
// has already turned Show Icon off, a newly added item must start with its icon hidden
|
|
5868
|
+
// too, not re-show one just because the item itself is brand new. See the comment on
|
|
5869
|
+
// the mirrored prop in `Atomic_Accordion_Item_Header` for why this duplication exists.
|
|
5870
|
+
settings: { show_icon: import_editor_props17.booleanPropTypeUtil.create(showIcon) },
|
|
5871
|
+
elements: [
|
|
5872
|
+
{
|
|
5873
|
+
elType: ACCORDION_ITEM_TITLE_ELEMENT_TYPE,
|
|
5874
|
+
id: (0, import_editor_elements17.generateElementId)(),
|
|
5875
|
+
editor_settings: { title: (0, import_i18n68.__)("Title", "elementor") },
|
|
5876
|
+
elements: [
|
|
5877
|
+
{
|
|
5878
|
+
elType: "widget",
|
|
5879
|
+
widgetType: PARAGRAPH_WIDGET_TYPE,
|
|
5880
|
+
id: (0, import_editor_elements17.generateElementId)(),
|
|
5881
|
+
// A leaf still needs an explicit empty `elements`: `ElementModel.initialize()` only
|
|
5882
|
+
// turns the attribute into a collection when it is defined, and v1 code walking a
|
|
5883
|
+
// subtree (`deselectRecursive()` on delete) calls `.forEach()` on it unguarded.
|
|
5884
|
+
elements: [],
|
|
5885
|
+
settings: {
|
|
5886
|
+
paragraph: import_editor_props17.escapedHtmlPropTypeUtil.create(numberedTitle),
|
|
5887
|
+
tag: { $$type: "string", value: "span" }
|
|
5888
|
+
}
|
|
5889
|
+
}
|
|
5890
|
+
]
|
|
5891
|
+
},
|
|
5892
|
+
{
|
|
5893
|
+
elType: ACCORDION_ITEM_ICON_ELEMENT_TYPE,
|
|
5894
|
+
id: (0, import_editor_elements17.generateElementId)(),
|
|
5895
|
+
editor_settings: { title: (0, import_i18n68.__)("Icon", "elementor") },
|
|
5896
|
+
elements: [],
|
|
5897
|
+
hydrateDefaultChildren: true
|
|
5898
|
+
}
|
|
5899
|
+
]
|
|
5900
|
+
},
|
|
5901
|
+
{
|
|
5902
|
+
elType: ACCORDION_ITEM_CONTENT_ELEMENT_TYPE,
|
|
5903
|
+
id: (0, import_editor_elements17.generateElementId)(),
|
|
5904
|
+
editor_settings: { title: (0, import_i18n68.__)("Content", "elementor") },
|
|
5905
|
+
elements: [],
|
|
5906
|
+
hydrateDefaultChildren: true
|
|
5907
|
+
}
|
|
5908
|
+
]
|
|
5909
|
+
};
|
|
5910
|
+
};
|
|
5911
|
+
var useActions = () => {
|
|
5912
|
+
const addItem = ({
|
|
5913
|
+
accordionId,
|
|
5914
|
+
existingTitles,
|
|
5915
|
+
items: items3,
|
|
5916
|
+
showIcon
|
|
5917
|
+
}) => {
|
|
5918
|
+
const accordion = (0, import_editor_elements17.getContainer)(accordionId);
|
|
5919
|
+
if (!accordion) {
|
|
5920
|
+
throw new Error("Accordion container not found");
|
|
5921
|
+
}
|
|
5922
|
+
const titles = [...existingTitles];
|
|
5923
|
+
items3.forEach(() => {
|
|
5924
|
+
const position = getNextItemNumber(titles);
|
|
5925
|
+
(0, import_editor_elements17.createElements)({
|
|
5926
|
+
title: (0, import_i18n68.__)("Accordion", "elementor"),
|
|
5927
|
+
elements: [
|
|
5928
|
+
{
|
|
5929
|
+
container: accordion,
|
|
5930
|
+
// `buildItemModel()` returns `V1ElementData`, whose `elements` field is plain nested
|
|
5931
|
+
// data (`V1ElementData[]`) - correct for a tree we're constructing to send as a
|
|
5932
|
+
// creation payload. `CreateElementParams['model']` is derived from
|
|
5933
|
+
// `V1ElementModelProps`, whose `elements` field is typed as `V1Model<...>[]` - live
|
|
5934
|
+
// Backbone-model wrappers with `get`/`set`/`toJSON`, the shape for reading an
|
|
5935
|
+
// *existing* element out of the document, not for describing one to create. A single
|
|
5936
|
+
// cast is enough (the two types overlap enough for TS to allow it directly); no
|
|
5937
|
+
// `unknown` escape hatch needed.
|
|
5938
|
+
model: buildItemModel(position, showIcon)
|
|
5939
|
+
}
|
|
5940
|
+
]
|
|
5941
|
+
});
|
|
5942
|
+
titles.push(getItemTitle(position));
|
|
5943
|
+
});
|
|
5944
|
+
};
|
|
5945
|
+
const removeItem = ({ items: items3 }) => {
|
|
5946
|
+
(0, import_editor_elements17.removeElements)({
|
|
5947
|
+
title: (0, import_i18n68.__)("Accordion", "elementor"),
|
|
5948
|
+
elementIds: items3.map(({ item }) => item.id)
|
|
5949
|
+
});
|
|
5950
|
+
};
|
|
5951
|
+
const duplicateItem = ({ items: items3 }) => {
|
|
5952
|
+
(0, import_editor_elements17.duplicateElements)({
|
|
5953
|
+
title: (0, import_i18n68.__)("Duplicate Accordion Item", "elementor"),
|
|
5954
|
+
elementIds: items3.map(({ item }) => item.id)
|
|
5955
|
+
});
|
|
5956
|
+
};
|
|
5957
|
+
const moveItem = ({
|
|
5958
|
+
accordionId,
|
|
5959
|
+
movedElementId,
|
|
5960
|
+
toIndex
|
|
5961
|
+
}) => {
|
|
5962
|
+
const accordion = (0, import_editor_elements17.getContainer)(accordionId);
|
|
5963
|
+
const movedElement = (0, import_editor_elements17.getContainer)(movedElementId);
|
|
5964
|
+
if (!accordion || !movedElement) {
|
|
5965
|
+
throw new Error("Accordion item or container not found");
|
|
5966
|
+
}
|
|
5967
|
+
(0, import_editor_elements17.moveElements)({
|
|
5968
|
+
title: (0, import_i18n68.__)("Reorder Accordion Items", "elementor"),
|
|
5969
|
+
moves: [
|
|
5970
|
+
{
|
|
5971
|
+
element: movedElement,
|
|
5972
|
+
targetContainer: accordion,
|
|
5973
|
+
options: { at: toIndex }
|
|
5974
|
+
}
|
|
5975
|
+
]
|
|
5976
|
+
});
|
|
5977
|
+
};
|
|
5978
|
+
return {
|
|
5979
|
+
addItem,
|
|
5980
|
+
removeItem,
|
|
5981
|
+
duplicateItem,
|
|
5982
|
+
moveItem
|
|
5983
|
+
};
|
|
5984
|
+
};
|
|
5985
|
+
|
|
5986
|
+
// src/controls-registry/element-controls/accordion-items-control/use-show-icon-write-through.ts
|
|
5987
|
+
var import_react40 = require("react");
|
|
5988
|
+
var import_editor_elements18 = require("@elementor/editor-elements");
|
|
5989
|
+
var import_editor_props18 = require("@elementor/editor-props");
|
|
5990
|
+
var import_editor_v1_adapters9 = require("@elementor/editor-v1-adapters");
|
|
5825
5991
|
var import_i18n69 = require("@wordpress/i18n");
|
|
5992
|
+
var ACCORDION_ITEM_HEADER_ELEMENT_TYPE2 = "e-accordion-item-header";
|
|
5993
|
+
var cascadeShowIconToHeaders = (0, import_editor_v1_adapters9.undoable)(
|
|
5994
|
+
{
|
|
5995
|
+
do: ({ accordionId, showIcon }) => {
|
|
5996
|
+
const headerIds = getAccordionHeaderIds(accordionId);
|
|
5997
|
+
const previous = Object.fromEntries(
|
|
5998
|
+
headerIds.map(
|
|
5999
|
+
(headerId) => [
|
|
6000
|
+
headerId,
|
|
6001
|
+
(0, import_editor_elements18.getElementSettings)(headerId, [
|
|
6002
|
+
"show_icon"
|
|
6003
|
+
]).show_icon
|
|
6004
|
+
]
|
|
6005
|
+
)
|
|
6006
|
+
);
|
|
6007
|
+
headerIds.forEach((headerId) => {
|
|
6008
|
+
(0, import_editor_elements18.updateElementSettings)({
|
|
6009
|
+
id: headerId,
|
|
6010
|
+
props: { show_icon: import_editor_props18.booleanPropTypeUtil.create(showIcon) },
|
|
6011
|
+
withHistory: false
|
|
6012
|
+
});
|
|
6013
|
+
});
|
|
6014
|
+
return { previous };
|
|
6015
|
+
},
|
|
6016
|
+
undo: (_payload, { previous }) => {
|
|
6017
|
+
Object.entries(previous).forEach(([headerId, previousValue]) => {
|
|
6018
|
+
(0, import_editor_elements18.updateElementSettings)({
|
|
6019
|
+
id: headerId,
|
|
6020
|
+
props: { show_icon: previousValue ?? null },
|
|
6021
|
+
withHistory: false
|
|
6022
|
+
});
|
|
6023
|
+
});
|
|
6024
|
+
}
|
|
6025
|
+
},
|
|
6026
|
+
{
|
|
6027
|
+
title: (0, import_i18n69.__)("Accordion", "elementor"),
|
|
6028
|
+
subtitle: (0, import_i18n69.__)("Show Icon", "elementor"),
|
|
6029
|
+
// `undoable()`'s debounce only delays when the *history entry* is pushed onto the undo stack -
|
|
6030
|
+
// the settings write itself (`do()`) still runs synchronously on every call. The root's own
|
|
6031
|
+
// `show_icon` change goes through `SettingsField` -> `useUndoableUpdateElementProp`
|
|
6032
|
+
// (`settings-field.tsx`), which debounces its history push by `HISTORY_DEBOUNCE_WAIT` (800ms).
|
|
6033
|
+
// Without matching that here, this cascade's history entry (pushed immediately) would land on
|
|
6034
|
+
// the undo stack *before* the root's (pushed 800ms later), so the first Undo after a toggle
|
|
6035
|
+
// would revert the root switch alone while every header stayed on its new value - the switch and
|
|
6036
|
+
// the icons would visibly disagree until a second Undo. Matching the debounce window fixes the
|
|
6037
|
+
// stack order to be deterministic (root's own entry, then this one) regardless of how quickly a
|
|
6038
|
+
// user hits Undo. It does not make the two changes one atomic transaction - see the comment on
|
|
6039
|
+
// `useShowIconWriteThrough` for why that would require forking the shared `Switch_Control`.
|
|
6040
|
+
debounce: { wait: HISTORY_DEBOUNCE_WAIT }
|
|
6041
|
+
}
|
|
6042
|
+
);
|
|
6043
|
+
function getAccordionHeaderIds(accordionId) {
|
|
6044
|
+
const accordion = (0, import_editor_elements18.getContainer)(accordionId);
|
|
6045
|
+
const itemContainers = (accordion?.children ?? []).filter(
|
|
6046
|
+
(child) => child.model.get("elType") === ACCORDION_ITEM_ELEMENT_TYPE
|
|
6047
|
+
);
|
|
6048
|
+
const headerContainers = itemContainers.map(
|
|
6049
|
+
(item) => item.children?.find((child) => child.model.get("elType") === ACCORDION_ITEM_HEADER_ELEMENT_TYPE2)
|
|
6050
|
+
).filter((header) => Boolean(header));
|
|
6051
|
+
return headerContainers.map((header) => header.id);
|
|
6052
|
+
}
|
|
6053
|
+
function useShowIconWriteThrough(accordionId, showIcon) {
|
|
6054
|
+
const previousRef = (0, import_react40.useRef)(null);
|
|
6055
|
+
(0, import_react40.useEffect)(() => {
|
|
6056
|
+
const previous = previousRef.current;
|
|
6057
|
+
previousRef.current = { accordionId, showIcon };
|
|
6058
|
+
if (!previous || previous.accordionId !== accordionId || previous.showIcon === showIcon) {
|
|
6059
|
+
return;
|
|
6060
|
+
}
|
|
6061
|
+
cascadeShowIconToHeaders({ accordionId, showIcon });
|
|
6062
|
+
}, [accordionId, showIcon]);
|
|
6063
|
+
}
|
|
6064
|
+
|
|
6065
|
+
// src/controls-registry/element-controls/accordion-items-control/accordion-items-control.tsx
|
|
6066
|
+
var AccordionItemsControl = ({ label }) => {
|
|
6067
|
+
const { element, settings } = useElement();
|
|
6068
|
+
const { addItem, duplicateItem, moveItem, removeItem } = useActions();
|
|
6069
|
+
const { [ACCORDION_ITEM_ELEMENT_TYPE]: items3 } = (0, import_editor_elements19.useElementChildren)(
|
|
6070
|
+
element.id,
|
|
6071
|
+
{ [ACCORDION_ELEMENT_TYPE]: ACCORDION_ITEM_ELEMENT_TYPE },
|
|
6072
|
+
{ includeSelfAsParent: true }
|
|
6073
|
+
);
|
|
6074
|
+
const showIcon = import_editor_props19.booleanPropTypeUtil.extract(settings.show_icon) ?? true;
|
|
6075
|
+
useShowIconWriteThrough(element.id, showIcon);
|
|
6076
|
+
const repeaterValues = items3.map((item, index) => {
|
|
6077
|
+
return {
|
|
6078
|
+
id: item.id,
|
|
6079
|
+
title: item.editorSettings?.title,
|
|
6080
|
+
index
|
|
6081
|
+
};
|
|
6082
|
+
});
|
|
6083
|
+
const setValue = (_newValues, _options, meta) => {
|
|
6084
|
+
if (meta?.action?.type === "add") {
|
|
6085
|
+
return addItem({
|
|
6086
|
+
accordionId: element.id,
|
|
6087
|
+
// The new item's number comes from the titles already in use, not from the item count -
|
|
6088
|
+
// see `getNextItemNumber`.
|
|
6089
|
+
existingTitles: repeaterValues.map(({ title }) => title),
|
|
6090
|
+
items: meta.action.payload,
|
|
6091
|
+
showIcon
|
|
6092
|
+
});
|
|
6093
|
+
}
|
|
6094
|
+
if (meta?.action?.type === "remove") {
|
|
6095
|
+
return removeItem({ items: meta.action.payload });
|
|
6096
|
+
}
|
|
6097
|
+
if (meta?.action?.type === "duplicate") {
|
|
6098
|
+
return duplicateItem({ items: meta.action.payload });
|
|
6099
|
+
}
|
|
6100
|
+
if (meta?.action?.type === "reorder") {
|
|
6101
|
+
const { from, to } = meta.action.payload;
|
|
6102
|
+
return moveItem({
|
|
6103
|
+
accordionId: element.id,
|
|
6104
|
+
movedElementId: items3[from].id,
|
|
6105
|
+
toIndex: to
|
|
6106
|
+
});
|
|
6107
|
+
}
|
|
6108
|
+
};
|
|
6109
|
+
return /* @__PURE__ */ React95.createElement(
|
|
6110
|
+
import_editor_controls58.Repeater,
|
|
6111
|
+
{
|
|
6112
|
+
showToggle: false,
|
|
6113
|
+
values: repeaterValues,
|
|
6114
|
+
setValues: setValue,
|
|
6115
|
+
showRemove: repeaterValues.length > 1,
|
|
6116
|
+
label,
|
|
6117
|
+
adornment: () => null,
|
|
6118
|
+
itemSettings: {
|
|
6119
|
+
getId: ({ item }) => item.id,
|
|
6120
|
+
initialValues: { id: "", title: (0, import_i18n70.__)("Accordion Item", "elementor") },
|
|
6121
|
+
Label: ItemLabel,
|
|
6122
|
+
Content: ItemContent,
|
|
6123
|
+
Icon: () => null
|
|
6124
|
+
}
|
|
6125
|
+
}
|
|
6126
|
+
);
|
|
6127
|
+
};
|
|
6128
|
+
var ItemLabel = ({ value }) => {
|
|
6129
|
+
return /* @__PURE__ */ React95.createElement(import_ui47.Stack, { sx: { minHeight: 20 }, direction: "row", alignItems: "center", gap: 1.5 }, /* @__PURE__ */ React95.createElement("span", null, value?.title));
|
|
6130
|
+
};
|
|
6131
|
+
var ItemContent = ({ value }) => {
|
|
6132
|
+
if (!value.id) {
|
|
6133
|
+
return null;
|
|
6134
|
+
}
|
|
6135
|
+
return /* @__PURE__ */ React95.createElement(import_ui47.Stack, { p: 2, gap: 1.5 }, /* @__PURE__ */ React95.createElement(ItemNameControl, { elementId: value.id }));
|
|
6136
|
+
};
|
|
6137
|
+
var ItemNameControl = ({ elementId }) => {
|
|
6138
|
+
const editorSettings = (0, import_editor_elements19.useElementEditorSettings)(elementId);
|
|
6139
|
+
const label = editorSettings?.title ?? "";
|
|
6140
|
+
return /* @__PURE__ */ React95.createElement(import_ui47.Stack, { gap: 1 }, /* @__PURE__ */ React95.createElement(import_editor_controls58.ControlFormLabel, null, (0, import_i18n70.__)("Name", "elementor")), /* @__PURE__ */ React95.createElement(
|
|
6141
|
+
import_ui47.TextField,
|
|
6142
|
+
{
|
|
6143
|
+
size: "tiny",
|
|
6144
|
+
value: label,
|
|
6145
|
+
onChange: ({ target }) => {
|
|
6146
|
+
(0, import_editor_elements19.updateElementEditorSettings)({
|
|
6147
|
+
elementId,
|
|
6148
|
+
settings: { title: target.value }
|
|
6149
|
+
});
|
|
6150
|
+
}
|
|
6151
|
+
}
|
|
6152
|
+
));
|
|
6153
|
+
};
|
|
6154
|
+
|
|
6155
|
+
// src/controls-registry/element-controls/tabs-control/tabs-control.tsx
|
|
6156
|
+
var React96 = __toESM(require("react"));
|
|
6157
|
+
var import_editor_controls60 = require("@elementor/editor-controls");
|
|
6158
|
+
var import_editor_elements22 = require("@elementor/editor-elements");
|
|
6159
|
+
var import_editor_props21 = require("@elementor/editor-props");
|
|
6160
|
+
var import_icons28 = require("@elementor/icons");
|
|
6161
|
+
var import_ui48 = require("@elementor/ui");
|
|
6162
|
+
var import_i18n72 = require("@wordpress/i18n");
|
|
5826
6163
|
|
|
5827
6164
|
// src/controls-registry/element-controls/get-element-by-type.ts
|
|
5828
|
-
var
|
|
6165
|
+
var import_editor_elements20 = require("@elementor/editor-elements");
|
|
5829
6166
|
var getElementByType = (elementId, type) => {
|
|
5830
|
-
const currentElement = (0,
|
|
6167
|
+
const currentElement = (0, import_editor_elements20.getContainer)(elementId);
|
|
5831
6168
|
if (!currentElement) {
|
|
5832
6169
|
return null;
|
|
5833
6170
|
}
|
|
@@ -5838,14 +6175,14 @@ var getElementByType = (elementId, type) => {
|
|
|
5838
6175
|
};
|
|
5839
6176
|
|
|
5840
6177
|
// src/controls-registry/element-controls/tabs-control/use-actions.ts
|
|
5841
|
-
var
|
|
5842
|
-
var
|
|
5843
|
-
var
|
|
5844
|
-
var
|
|
6178
|
+
var import_editor_controls59 = require("@elementor/editor-controls");
|
|
6179
|
+
var import_editor_elements21 = require("@elementor/editor-elements");
|
|
6180
|
+
var import_editor_props20 = require("@elementor/editor-props");
|
|
6181
|
+
var import_i18n71 = require("@wordpress/i18n");
|
|
5845
6182
|
var TAB_ELEMENT_TYPE = "e-tab";
|
|
5846
6183
|
var TAB_CONTENT_ELEMENT_TYPE = "e-tab-content";
|
|
5847
|
-
var
|
|
5848
|
-
const { value, setValue: setDefaultActiveTab } = (0,
|
|
6184
|
+
var useActions2 = () => {
|
|
6185
|
+
const { value, setValue: setDefaultActiveTab } = (0, import_editor_controls59.useBoundProp)(import_editor_props20.numberPropTypeUtil);
|
|
5849
6186
|
const defaultActiveTab = value ?? 0;
|
|
5850
6187
|
const duplicateItem = ({
|
|
5851
6188
|
items: items3,
|
|
@@ -5857,14 +6194,14 @@ var useActions = () => {
|
|
|
5857
6194
|
});
|
|
5858
6195
|
items3.forEach(({ item, index }) => {
|
|
5859
6196
|
const tabId = item.id;
|
|
5860
|
-
const tabContentAreaContainer = (0,
|
|
6197
|
+
const tabContentAreaContainer = (0, import_editor_elements21.getContainer)(tabContentAreaId);
|
|
5861
6198
|
const tabContentId = tabContentAreaContainer?.children?.[index]?.id;
|
|
5862
6199
|
if (!tabContentId) {
|
|
5863
6200
|
throw new Error("Original content ID is required for duplication");
|
|
5864
6201
|
}
|
|
5865
|
-
(0,
|
|
6202
|
+
(0, import_editor_elements21.duplicateElements)({
|
|
5866
6203
|
elementIds: [tabId, tabContentId],
|
|
5867
|
-
title: (0,
|
|
6204
|
+
title: (0, import_i18n71.__)("Duplicate Tab", "elementor"),
|
|
5868
6205
|
onDuplicateElements: () => {
|
|
5869
6206
|
if (newDefault !== defaultActiveTab) {
|
|
5870
6207
|
setDefaultActiveTab(newDefault, {}, { withHistory: false });
|
|
@@ -5885,10 +6222,10 @@ var useActions = () => {
|
|
|
5885
6222
|
movedElementId,
|
|
5886
6223
|
movedElementIndex
|
|
5887
6224
|
}) => {
|
|
5888
|
-
const tabContentContainer = (0,
|
|
6225
|
+
const tabContentContainer = (0, import_editor_elements21.getContainer)(tabContentAreaId);
|
|
5889
6226
|
const tabContent = tabContentContainer?.children?.[movedElementIndex];
|
|
5890
|
-
const movedElement = (0,
|
|
5891
|
-
const tabsMenu = (0,
|
|
6227
|
+
const movedElement = (0, import_editor_elements21.getContainer)(movedElementId);
|
|
6228
|
+
const tabsMenu = (0, import_editor_elements21.getContainer)(tabsMenuId);
|
|
5892
6229
|
if (!tabContent) {
|
|
5893
6230
|
throw new Error("Content element is required");
|
|
5894
6231
|
}
|
|
@@ -5900,8 +6237,8 @@ var useActions = () => {
|
|
|
5900
6237
|
to: toIndex,
|
|
5901
6238
|
defaultActiveTab
|
|
5902
6239
|
});
|
|
5903
|
-
(0,
|
|
5904
|
-
title: (0,
|
|
6240
|
+
(0, import_editor_elements21.moveElements)({
|
|
6241
|
+
title: (0, import_i18n71.__)("Reorder Tabs", "elementor"),
|
|
5905
6242
|
moves: [
|
|
5906
6243
|
{
|
|
5907
6244
|
element: movedElement,
|
|
@@ -5934,11 +6271,11 @@ var useActions = () => {
|
|
|
5934
6271
|
items: items3,
|
|
5935
6272
|
defaultActiveTab
|
|
5936
6273
|
});
|
|
5937
|
-
(0,
|
|
5938
|
-
title: (0,
|
|
6274
|
+
(0, import_editor_elements21.removeElements)({
|
|
6275
|
+
title: (0, import_i18n71.__)("Tabs", "elementor"),
|
|
5939
6276
|
elementIds: items3.flatMap(({ item, index }) => {
|
|
5940
6277
|
const tabId = item.id;
|
|
5941
|
-
const tabContentContainer = (0,
|
|
6278
|
+
const tabContentContainer = (0, import_editor_elements21.getContainer)(tabContentAreaId);
|
|
5942
6279
|
const tabContentId = tabContentContainer?.children?.[index]?.id;
|
|
5943
6280
|
if (!tabContentId) {
|
|
5944
6281
|
throw new Error("Content ID is required");
|
|
@@ -5962,15 +6299,15 @@ var useActions = () => {
|
|
|
5962
6299
|
tabsMenuId,
|
|
5963
6300
|
items: items3
|
|
5964
6301
|
}) => {
|
|
5965
|
-
const tabContentArea = (0,
|
|
5966
|
-
const tabsMenu = (0,
|
|
6302
|
+
const tabContentArea = (0, import_editor_elements21.getContainer)(tabContentAreaId);
|
|
6303
|
+
const tabsMenu = (0, import_editor_elements21.getContainer)(tabsMenuId);
|
|
5967
6304
|
if (!tabContentArea || !tabsMenu) {
|
|
5968
6305
|
throw new Error("Tab containers not found");
|
|
5969
6306
|
}
|
|
5970
6307
|
items3.forEach(({ index }) => {
|
|
5971
6308
|
const position = index + 1;
|
|
5972
|
-
(0,
|
|
5973
|
-
title: (0,
|
|
6309
|
+
(0, import_editor_elements21.createElements)({
|
|
6310
|
+
title: (0, import_i18n71.__)("Tabs", "elementor"),
|
|
5974
6311
|
elements: [
|
|
5975
6312
|
{
|
|
5976
6313
|
container: tabContentArea,
|
|
@@ -6039,12 +6376,12 @@ var calculateDefaultOnDuplicate = ({
|
|
|
6039
6376
|
var TAB_MENU_ELEMENT_TYPE = "e-tabs-menu";
|
|
6040
6377
|
var TAB_CONTENT_AREA_ELEMENT_TYPE = "e-tabs-content-area";
|
|
6041
6378
|
var TabsControl = ({ label }) => {
|
|
6042
|
-
return /* @__PURE__ */
|
|
6379
|
+
return /* @__PURE__ */ React96.createElement(SettingsField, { bind: "default-active-tab", propDisplayName: (0, import_i18n72.__)("Tabs", "elementor") }, /* @__PURE__ */ React96.createElement(TabsControlContent, { label }));
|
|
6043
6380
|
};
|
|
6044
6381
|
var TabsControlContent = ({ label }) => {
|
|
6045
6382
|
const { element } = useElement();
|
|
6046
|
-
const { addItem, duplicateItem, moveItem, removeItem } =
|
|
6047
|
-
const { [TAB_ELEMENT_TYPE]: tabLinks } = (0,
|
|
6383
|
+
const { addItem, duplicateItem, moveItem, removeItem } = useActions2();
|
|
6384
|
+
const { [TAB_ELEMENT_TYPE]: tabLinks } = (0, import_editor_elements22.useElementChildren)(element.id, {
|
|
6048
6385
|
[TAB_MENU_ELEMENT_TYPE]: TAB_ELEMENT_TYPE
|
|
6049
6386
|
});
|
|
6050
6387
|
const tabList = getElementByType(element.id, TAB_MENU_ELEMENT_TYPE);
|
|
@@ -6083,8 +6420,8 @@ var TabsControlContent = ({ label }) => {
|
|
|
6083
6420
|
});
|
|
6084
6421
|
}
|
|
6085
6422
|
};
|
|
6086
|
-
return /* @__PURE__ */
|
|
6087
|
-
|
|
6423
|
+
return /* @__PURE__ */ React96.createElement(
|
|
6424
|
+
import_editor_controls60.Repeater,
|
|
6088
6425
|
{
|
|
6089
6426
|
showToggle: false,
|
|
6090
6427
|
values: repeaterValues,
|
|
@@ -6094,36 +6431,36 @@ var TabsControlContent = ({ label }) => {
|
|
|
6094
6431
|
itemSettings: {
|
|
6095
6432
|
getId: ({ item }) => item.id,
|
|
6096
6433
|
initialValues: { id: "", title: "Tab" },
|
|
6097
|
-
Label:
|
|
6098
|
-
Content:
|
|
6434
|
+
Label: ItemLabel2,
|
|
6435
|
+
Content: ItemContent2,
|
|
6099
6436
|
Icon: () => null
|
|
6100
6437
|
}
|
|
6101
6438
|
}
|
|
6102
6439
|
);
|
|
6103
6440
|
};
|
|
6104
|
-
var
|
|
6441
|
+
var ItemLabel2 = ({ value, index }) => {
|
|
6105
6442
|
const elementTitle = value?.title;
|
|
6106
|
-
return /* @__PURE__ */
|
|
6443
|
+
return /* @__PURE__ */ React96.createElement(import_ui48.Stack, { sx: { minHeight: 20 }, direction: "row", alignItems: "center", gap: 1.5 }, /* @__PURE__ */ React96.createElement("span", null, elementTitle), /* @__PURE__ */ React96.createElement(ItemDefaultTab, { index }));
|
|
6107
6444
|
};
|
|
6108
6445
|
var ItemDefaultTab = ({ index }) => {
|
|
6109
|
-
const { value: defaultItem } = (0,
|
|
6446
|
+
const { value: defaultItem } = (0, import_editor_controls60.useBoundProp)(import_editor_props21.numberPropTypeUtil);
|
|
6110
6447
|
const isDefault = defaultItem === index;
|
|
6111
6448
|
if (!isDefault) {
|
|
6112
6449
|
return null;
|
|
6113
6450
|
}
|
|
6114
|
-
return /* @__PURE__ */
|
|
6451
|
+
return /* @__PURE__ */ React96.createElement(import_ui48.Chip, { size: "tiny", shape: "rounded", label: (0, import_i18n72.__)("Default", "elementor") });
|
|
6115
6452
|
};
|
|
6116
|
-
var
|
|
6453
|
+
var ItemContent2 = ({ value, index }) => {
|
|
6117
6454
|
if (!value.id) {
|
|
6118
6455
|
return null;
|
|
6119
6456
|
}
|
|
6120
|
-
return /* @__PURE__ */
|
|
6457
|
+
return /* @__PURE__ */ React96.createElement(import_ui48.Stack, { p: 2, gap: 1.5 }, /* @__PURE__ */ React96.createElement(TabLabelControl, { elementId: value.id }), /* @__PURE__ */ React96.createElement(SettingsField, { bind: "default-active-tab", propDisplayName: (0, import_i18n72.__)("Tabs", "elementor") }, /* @__PURE__ */ React96.createElement(DefaultTabControl, { tabIndex: index })));
|
|
6121
6458
|
};
|
|
6122
6459
|
var DefaultTabControl = ({ tabIndex }) => {
|
|
6123
|
-
const { value, setValue } = (0,
|
|
6460
|
+
const { value, setValue } = (0, import_editor_controls60.useBoundProp)(import_editor_props21.numberPropTypeUtil);
|
|
6124
6461
|
const isDefault = value === tabIndex;
|
|
6125
|
-
return /* @__PURE__ */
|
|
6126
|
-
|
|
6462
|
+
return /* @__PURE__ */ React96.createElement(import_ui48.Stack, { direction: "row", alignItems: "center", justifyContent: "space-between", gap: 2 }, /* @__PURE__ */ React96.createElement(import_editor_controls60.ControlFormLabel, null, (0, import_i18n72.__)("Set as default tab", "elementor")), /* @__PURE__ */ React96.createElement(ConditionalTooltip, { showTooltip: isDefault, placement: "right" }, /* @__PURE__ */ React96.createElement(
|
|
6463
|
+
import_ui48.Switch,
|
|
6127
6464
|
{
|
|
6128
6465
|
size: "small",
|
|
6129
6466
|
checked: isDefault,
|
|
@@ -6138,15 +6475,15 @@ var DefaultTabControl = ({ tabIndex }) => {
|
|
|
6138
6475
|
)));
|
|
6139
6476
|
};
|
|
6140
6477
|
var TabLabelControl = ({ elementId }) => {
|
|
6141
|
-
const editorSettings = (0,
|
|
6478
|
+
const editorSettings = (0, import_editor_elements22.useElementEditorSettings)(elementId);
|
|
6142
6479
|
const label = editorSettings?.title ?? "";
|
|
6143
|
-
return /* @__PURE__ */
|
|
6144
|
-
|
|
6480
|
+
return /* @__PURE__ */ React96.createElement(import_ui48.Stack, { gap: 1 }, /* @__PURE__ */ React96.createElement(import_editor_controls60.ControlFormLabel, null, (0, import_i18n72.__)("Tab name", "elementor")), /* @__PURE__ */ React96.createElement(
|
|
6481
|
+
import_ui48.TextField,
|
|
6145
6482
|
{
|
|
6146
6483
|
size: "tiny",
|
|
6147
6484
|
value: label,
|
|
6148
6485
|
onChange: ({ target }) => {
|
|
6149
|
-
(0,
|
|
6486
|
+
(0, import_editor_elements22.updateElementEditorSettings)({
|
|
6150
6487
|
elementId,
|
|
6151
6488
|
settings: { title: target.value }
|
|
6152
6489
|
});
|
|
@@ -6161,28 +6498,29 @@ var ConditionalTooltip = ({
|
|
|
6161
6498
|
if (!showTooltip) {
|
|
6162
6499
|
return children;
|
|
6163
6500
|
}
|
|
6164
|
-
return /* @__PURE__ */
|
|
6165
|
-
|
|
6501
|
+
return /* @__PURE__ */ React96.createElement(
|
|
6502
|
+
import_ui48.Infotip,
|
|
6166
6503
|
{
|
|
6167
6504
|
arrow: false,
|
|
6168
|
-
content: /* @__PURE__ */
|
|
6169
|
-
|
|
6505
|
+
content: /* @__PURE__ */ React96.createElement(
|
|
6506
|
+
import_ui48.Alert,
|
|
6170
6507
|
{
|
|
6171
6508
|
color: "secondary",
|
|
6172
|
-
icon: /* @__PURE__ */
|
|
6509
|
+
icon: /* @__PURE__ */ React96.createElement(import_icons28.InfoCircleFilledIcon, { fontSize: "tiny" }),
|
|
6173
6510
|
size: "small",
|
|
6174
6511
|
sx: { width: 288 }
|
|
6175
6512
|
},
|
|
6176
|
-
/* @__PURE__ */
|
|
6513
|
+
/* @__PURE__ */ React96.createElement(import_ui48.Typography, { variant: "body2" }, (0, import_i18n72.__)("To change the default tab, simply set another tab as default.", "elementor"))
|
|
6177
6514
|
)
|
|
6178
6515
|
},
|
|
6179
|
-
/* @__PURE__ */
|
|
6516
|
+
/* @__PURE__ */ React96.createElement("span", null, children)
|
|
6180
6517
|
);
|
|
6181
6518
|
};
|
|
6182
6519
|
|
|
6183
6520
|
// src/controls-registry/element-controls/registry.ts
|
|
6184
6521
|
var controlTypes2 = {
|
|
6185
|
-
tabs: { component: TabsControl, layout: "full" }
|
|
6522
|
+
tabs: { component: TabsControl, layout: "full" },
|
|
6523
|
+
"accordion-items": { component: AccordionItemsControl, layout: "full" }
|
|
6186
6524
|
};
|
|
6187
6525
|
var registerElementControls = () => {
|
|
6188
6526
|
Object.entries(controlTypes2).forEach(
|
|
@@ -6194,27 +6532,27 @@ var registerElementControls = () => {
|
|
|
6194
6532
|
|
|
6195
6533
|
// src/dynamics/init.ts
|
|
6196
6534
|
var import_editor_canvas3 = require("@elementor/editor-canvas");
|
|
6197
|
-
var
|
|
6535
|
+
var import_editor_controls67 = require("@elementor/editor-controls");
|
|
6198
6536
|
var import_menus2 = require("@elementor/menus");
|
|
6199
6537
|
|
|
6200
6538
|
// src/dynamics/components/background-control-dynamic-tag.tsx
|
|
6201
|
-
var
|
|
6202
|
-
var
|
|
6203
|
-
var
|
|
6539
|
+
var React97 = __toESM(require("react"));
|
|
6540
|
+
var import_editor_controls62 = require("@elementor/editor-controls");
|
|
6541
|
+
var import_editor_props23 = require("@elementor/editor-props");
|
|
6204
6542
|
var import_icons29 = require("@elementor/icons");
|
|
6205
6543
|
|
|
6206
6544
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
6207
|
-
var
|
|
6545
|
+
var import_react43 = require("react");
|
|
6208
6546
|
|
|
6209
6547
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
6210
|
-
var
|
|
6211
|
-
var
|
|
6548
|
+
var import_react42 = require("react");
|
|
6549
|
+
var import_editor_controls61 = require("@elementor/editor-controls");
|
|
6212
6550
|
|
|
6213
6551
|
// src/dynamics/sync/get-atomic-dynamic-tags.ts
|
|
6214
|
-
var
|
|
6552
|
+
var import_editor_v1_adapters10 = require("@elementor/editor-v1-adapters");
|
|
6215
6553
|
|
|
6216
6554
|
// src/hooks/use-license-config.ts
|
|
6217
|
-
var
|
|
6555
|
+
var import_react41 = require("react");
|
|
6218
6556
|
var config = { expired: false };
|
|
6219
6557
|
var listeners = /* @__PURE__ */ new Set();
|
|
6220
6558
|
function setLicenseConfig(newConfig) {
|
|
@@ -6229,12 +6567,12 @@ function subscribe(listener) {
|
|
|
6229
6567
|
return () => listeners.delete(listener);
|
|
6230
6568
|
}
|
|
6231
6569
|
function useLicenseConfig() {
|
|
6232
|
-
return (0,
|
|
6570
|
+
return (0, import_react41.useSyncExternalStore)(subscribe, getLicenseConfig, getLicenseConfig);
|
|
6233
6571
|
}
|
|
6234
6572
|
|
|
6235
6573
|
// src/dynamics/sync/get-atomic-dynamic-tags.ts
|
|
6236
6574
|
var getAtomicDynamicTags = (shouldFilterByLicense = true) => {
|
|
6237
|
-
const { atomicDynamicTags } = (0,
|
|
6575
|
+
const { atomicDynamicTags } = (0, import_editor_v1_adapters10.getElementorConfig)();
|
|
6238
6576
|
if (!atomicDynamicTags) {
|
|
6239
6577
|
return null;
|
|
6240
6578
|
}
|
|
@@ -6256,11 +6594,11 @@ var filterByLicense = (tags) => {
|
|
|
6256
6594
|
};
|
|
6257
6595
|
|
|
6258
6596
|
// src/dynamics/utils.ts
|
|
6259
|
-
var
|
|
6260
|
-
var
|
|
6597
|
+
var import_editor_props22 = require("@elementor/editor-props");
|
|
6598
|
+
var import_editor_v1_adapters11 = require("@elementor/editor-v1-adapters");
|
|
6261
6599
|
var import_schema = require("@elementor/schema");
|
|
6262
6600
|
var DYNAMIC_PROP_TYPE_KEY = "dynamic";
|
|
6263
|
-
var dynamicPropTypeUtil = (0,
|
|
6601
|
+
var dynamicPropTypeUtil = (0, import_editor_props22.createPropUtils)(
|
|
6264
6602
|
DYNAMIC_PROP_TYPE_KEY,
|
|
6265
6603
|
import_schema.z.strictObject({
|
|
6266
6604
|
name: import_schema.z.string(),
|
|
@@ -6269,7 +6607,7 @@ var dynamicPropTypeUtil = (0, import_editor_props19.createPropUtils)(
|
|
|
6269
6607
|
})
|
|
6270
6608
|
);
|
|
6271
6609
|
var isDynamicTagSupported = (tagName) => {
|
|
6272
|
-
return !!(0,
|
|
6610
|
+
return !!(0, import_editor_v1_adapters11.getElementorConfig)()?.atomicDynamicTags?.tags?.[tagName];
|
|
6273
6611
|
};
|
|
6274
6612
|
var isDynamicPropType = (prop) => prop.key === DYNAMIC_PROP_TYPE_KEY;
|
|
6275
6613
|
var getDynamicPropType = (propType) => {
|
|
@@ -6277,7 +6615,7 @@ var getDynamicPropType = (propType) => {
|
|
|
6277
6615
|
return dynamicPropType && isDynamicPropType(dynamicPropType) ? dynamicPropType : null;
|
|
6278
6616
|
};
|
|
6279
6617
|
var isDynamicPropValue = (prop) => {
|
|
6280
|
-
return (0,
|
|
6618
|
+
return (0, import_editor_props22.isTransformable)(prop) && prop.$$type === DYNAMIC_PROP_TYPE_KEY;
|
|
6281
6619
|
};
|
|
6282
6620
|
var supportsDynamic = (propType) => {
|
|
6283
6621
|
return !!getDynamicPropType(propType);
|
|
@@ -6292,13 +6630,13 @@ var useAllPropDynamicTags = () => {
|
|
|
6292
6630
|
};
|
|
6293
6631
|
var usePropDynamicTagsInternal = (filterByLicense2) => {
|
|
6294
6632
|
let categories = [];
|
|
6295
|
-
const { propType } = (0,
|
|
6633
|
+
const { propType } = (0, import_editor_controls61.useBoundProp)();
|
|
6296
6634
|
if (propType) {
|
|
6297
6635
|
const propDynamicType = getDynamicPropType(propType);
|
|
6298
6636
|
categories = propDynamicType?.settings.categories || [];
|
|
6299
6637
|
}
|
|
6300
6638
|
const categoriesKey = categories.join();
|
|
6301
|
-
return (0,
|
|
6639
|
+
return (0, import_react42.useMemo)(
|
|
6302
6640
|
() => getDynamicTagsByCategories(categories, filterByLicense2),
|
|
6303
6641
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6304
6642
|
[categoriesKey, filterByLicense2]
|
|
@@ -6332,33 +6670,33 @@ var getDynamicTagsByCategories = (categories, filterByLicense2) => {
|
|
|
6332
6670
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
6333
6671
|
var useDynamicTag = (tagName) => {
|
|
6334
6672
|
const dynamicTags = useAllPropDynamicTags();
|
|
6335
|
-
return (0,
|
|
6673
|
+
return (0, import_react43.useMemo)(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
6336
6674
|
};
|
|
6337
6675
|
|
|
6338
6676
|
// src/dynamics/components/background-control-dynamic-tag.tsx
|
|
6339
|
-
var BackgroundControlDynamicTagIcon = () => /* @__PURE__ */
|
|
6677
|
+
var BackgroundControlDynamicTagIcon = () => /* @__PURE__ */ React97.createElement(import_icons29.DatabaseIcon, { fontSize: "tiny" });
|
|
6340
6678
|
var BackgroundControlDynamicTagLabel = ({ value }) => {
|
|
6341
|
-
const context = (0,
|
|
6342
|
-
return /* @__PURE__ */
|
|
6679
|
+
const context = (0, import_editor_controls62.useBoundProp)(import_editor_props23.backgroundImageOverlayPropTypeUtil);
|
|
6680
|
+
return /* @__PURE__ */ React97.createElement(import_editor_controls62.PropProvider, { ...context, value: value.value }, /* @__PURE__ */ React97.createElement(import_editor_controls62.PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React97.createElement(Wrapper2, { rawValue: value.value })));
|
|
6343
6681
|
};
|
|
6344
6682
|
var Wrapper2 = ({ rawValue }) => {
|
|
6345
|
-
const { propType } = (0,
|
|
6683
|
+
const { propType } = (0, import_editor_controls62.useBoundProp)();
|
|
6346
6684
|
const imageOverlayPropType = propType.prop_types["background-image-overlay"];
|
|
6347
|
-
return /* @__PURE__ */
|
|
6685
|
+
return /* @__PURE__ */ React97.createElement(import_editor_controls62.PropProvider, { propType: imageOverlayPropType.shape.image, value: rawValue, setValue: () => void 0 }, /* @__PURE__ */ React97.createElement(import_editor_controls62.PropKeyProvider, { bind: "src" }, /* @__PURE__ */ React97.createElement(Content, { rawValue: rawValue.image })));
|
|
6348
6686
|
};
|
|
6349
6687
|
var Content = ({ rawValue }) => {
|
|
6350
6688
|
const src = rawValue.value.src;
|
|
6351
6689
|
const dynamicTag = useDynamicTag(src.value.name || "");
|
|
6352
|
-
return /* @__PURE__ */
|
|
6690
|
+
return /* @__PURE__ */ React97.createElement(React97.Fragment, null, dynamicTag?.label);
|
|
6353
6691
|
};
|
|
6354
6692
|
|
|
6355
6693
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
6356
|
-
var
|
|
6357
|
-
var
|
|
6694
|
+
var React101 = __toESM(require("react"));
|
|
6695
|
+
var import_editor_controls65 = require("@elementor/editor-controls");
|
|
6358
6696
|
var import_editor_ui11 = require("@elementor/editor-ui");
|
|
6359
6697
|
var import_icons31 = require("@elementor/icons");
|
|
6360
|
-
var
|
|
6361
|
-
var
|
|
6698
|
+
var import_ui50 = require("@elementor/ui");
|
|
6699
|
+
var import_i18n74 = require("@wordpress/i18n");
|
|
6362
6700
|
|
|
6363
6701
|
// src/hooks/use-persist-dynamic-value.ts
|
|
6364
6702
|
var import_session10 = require("@elementor/session");
|
|
@@ -6369,20 +6707,20 @@ var usePersistDynamicValue = (propKey) => {
|
|
|
6369
6707
|
};
|
|
6370
6708
|
|
|
6371
6709
|
// src/dynamics/dynamic-control.tsx
|
|
6372
|
-
var
|
|
6373
|
-
var
|
|
6710
|
+
var React99 = __toESM(require("react"));
|
|
6711
|
+
var import_editor_controls63 = require("@elementor/editor-controls");
|
|
6374
6712
|
|
|
6375
6713
|
// src/dynamics/components/dynamic-conditional-control.tsx
|
|
6376
|
-
var
|
|
6377
|
-
var
|
|
6378
|
-
var
|
|
6714
|
+
var React98 = __toESM(require("react"));
|
|
6715
|
+
var import_react44 = require("react");
|
|
6716
|
+
var import_editor_props24 = require("@elementor/editor-props");
|
|
6379
6717
|
var DynamicConditionalControl = ({
|
|
6380
6718
|
children,
|
|
6381
6719
|
propType,
|
|
6382
6720
|
propsSchema,
|
|
6383
6721
|
dynamicSettings
|
|
6384
6722
|
}) => {
|
|
6385
|
-
const defaults = (0,
|
|
6723
|
+
const defaults = (0, import_react44.useMemo)(() => {
|
|
6386
6724
|
if (!propsSchema) {
|
|
6387
6725
|
return {};
|
|
6388
6726
|
}
|
|
@@ -6392,7 +6730,7 @@ var DynamicConditionalControl = ({
|
|
|
6392
6730
|
return result;
|
|
6393
6731
|
}, {});
|
|
6394
6732
|
}, [propsSchema]);
|
|
6395
|
-
const convertedSettings = (0,
|
|
6733
|
+
const convertedSettings = (0, import_react44.useMemo)(() => {
|
|
6396
6734
|
if (!dynamicSettings) {
|
|
6397
6735
|
return {};
|
|
6398
6736
|
}
|
|
@@ -6411,19 +6749,19 @@ var DynamicConditionalControl = ({
|
|
|
6411
6749
|
{}
|
|
6412
6750
|
);
|
|
6413
6751
|
}, [dynamicSettings]);
|
|
6414
|
-
const effectiveSettings = (0,
|
|
6752
|
+
const effectiveSettings = (0, import_react44.useMemo)(() => {
|
|
6415
6753
|
return { ...defaults, ...convertedSettings };
|
|
6416
6754
|
}, [defaults, convertedSettings]);
|
|
6417
6755
|
if (!propType?.dependencies?.terms.length) {
|
|
6418
|
-
return /* @__PURE__ */
|
|
6756
|
+
return /* @__PURE__ */ React98.createElement(React98.Fragment, null, children);
|
|
6419
6757
|
}
|
|
6420
|
-
const isHidden = !(0,
|
|
6421
|
-
return isHidden ? null : /* @__PURE__ */
|
|
6758
|
+
const isHidden = !(0, import_editor_props24.isDependencyMet)(propType?.dependencies, effectiveSettings).isMet;
|
|
6759
|
+
return isHidden ? null : /* @__PURE__ */ React98.createElement(React98.Fragment, null, children);
|
|
6422
6760
|
};
|
|
6423
6761
|
|
|
6424
6762
|
// src/dynamics/dynamic-control.tsx
|
|
6425
6763
|
var DynamicControl = ({ bind, children }) => {
|
|
6426
|
-
const { value, setValue } = (0,
|
|
6764
|
+
const { value, setValue } = (0, import_editor_controls63.useBoundProp)(dynamicPropTypeUtil);
|
|
6427
6765
|
const { name = "", group = "", settings } = value ?? {};
|
|
6428
6766
|
const dynamicTag = useDynamicTag(name);
|
|
6429
6767
|
if (!dynamicTag) {
|
|
@@ -6443,7 +6781,7 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
6443
6781
|
});
|
|
6444
6782
|
};
|
|
6445
6783
|
const propType = createTopLevelObjectType({ schema: dynamicTag.props_schema });
|
|
6446
|
-
return /* @__PURE__ */
|
|
6784
|
+
return /* @__PURE__ */ React99.createElement(import_editor_controls63.PropProvider, { propType, setValue: setDynamicValue, value: { [bind]: dynamicValue } }, /* @__PURE__ */ React99.createElement(import_editor_controls63.PropKeyProvider, { bind }, /* @__PURE__ */ React99.createElement(
|
|
6447
6785
|
DynamicConditionalControl,
|
|
6448
6786
|
{
|
|
6449
6787
|
propType: dynamicPropType,
|
|
@@ -6455,32 +6793,32 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
6455
6793
|
};
|
|
6456
6794
|
|
|
6457
6795
|
// src/dynamics/components/dynamic-selection.tsx
|
|
6458
|
-
var
|
|
6459
|
-
var
|
|
6460
|
-
var
|
|
6796
|
+
var React100 = __toESM(require("react"));
|
|
6797
|
+
var import_react45 = require("react");
|
|
6798
|
+
var import_editor_controls64 = require("@elementor/editor-controls");
|
|
6461
6799
|
var import_editor_ui10 = require("@elementor/editor-ui");
|
|
6462
6800
|
var import_icons30 = require("@elementor/icons");
|
|
6463
|
-
var
|
|
6464
|
-
var
|
|
6801
|
+
var import_ui49 = require("@elementor/ui");
|
|
6802
|
+
var import_i18n73 = require("@wordpress/i18n");
|
|
6465
6803
|
var SIZE2 = "tiny";
|
|
6466
6804
|
var PROMO_TEXT_WIDTH = 170;
|
|
6467
6805
|
var PRO_DYNAMIC_TAGS_URL = "https://go.elementor.com/go-pro-dynamic-tags-modal/";
|
|
6468
6806
|
var RENEW_DYNAMIC_TAGS_URL = "https://go.elementor.com/go-pro-dynamic-tags-renew-modal/";
|
|
6469
6807
|
var DynamicSelection = ({ close: closePopover, expired = false }) => {
|
|
6470
|
-
const [searchValue, setSearchValue] = (0,
|
|
6808
|
+
const [searchValue, setSearchValue] = (0, import_react45.useState)("");
|
|
6471
6809
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
6472
|
-
const theme = (0,
|
|
6473
|
-
const { value: anyValue } = (0,
|
|
6474
|
-
const { bind, value: dynamicValue, setValue } = (0,
|
|
6810
|
+
const theme = (0, import_ui49.useTheme)();
|
|
6811
|
+
const { value: anyValue } = (0, import_editor_controls64.useBoundProp)();
|
|
6812
|
+
const { bind, value: dynamicValue, setValue } = (0, import_editor_controls64.useBoundProp)(dynamicPropTypeUtil);
|
|
6475
6813
|
const [, updatePropValueHistory] = usePersistDynamicValue(bind);
|
|
6476
6814
|
const isCurrentValueDynamic = !!dynamicValue;
|
|
6477
6815
|
const options13 = useFilteredOptions(searchValue);
|
|
6478
6816
|
const hasNoDynamicTags = !options13.length && !searchValue.trim();
|
|
6479
|
-
(0,
|
|
6817
|
+
(0, import_react45.useEffect)(() => {
|
|
6480
6818
|
if (hasNoDynamicTags) {
|
|
6481
|
-
(0,
|
|
6819
|
+
(0, import_editor_controls64.trackViewPromotion)({ target_name: "dynamic_tags" });
|
|
6482
6820
|
} else if (expired) {
|
|
6483
|
-
(0,
|
|
6821
|
+
(0, import_editor_controls64.trackViewPromotion)({ target_name: "dynamic_tags" });
|
|
6484
6822
|
}
|
|
6485
6823
|
}, [hasNoDynamicTags, expired]);
|
|
6486
6824
|
const handleSearch = (value) => {
|
|
@@ -6508,19 +6846,19 @@ var DynamicSelection = ({ close: closePopover, expired = false }) => {
|
|
|
6508
6846
|
]);
|
|
6509
6847
|
const getPopOverContent = () => {
|
|
6510
6848
|
if (hasNoDynamicTags) {
|
|
6511
|
-
return /* @__PURE__ */
|
|
6849
|
+
return /* @__PURE__ */ React100.createElement(NoDynamicTags, null);
|
|
6512
6850
|
}
|
|
6513
6851
|
if (expired) {
|
|
6514
|
-
return /* @__PURE__ */
|
|
6852
|
+
return /* @__PURE__ */ React100.createElement(ExpiredDynamicTags, null);
|
|
6515
6853
|
}
|
|
6516
|
-
return /* @__PURE__ */
|
|
6854
|
+
return /* @__PURE__ */ React100.createElement(import_react45.Fragment, null, /* @__PURE__ */ React100.createElement(
|
|
6517
6855
|
import_editor_ui10.SearchField,
|
|
6518
6856
|
{
|
|
6519
6857
|
value: searchValue,
|
|
6520
6858
|
onSearch: handleSearch,
|
|
6521
|
-
placeholder: (0,
|
|
6859
|
+
placeholder: (0, import_i18n73.__)("Search dynamic tags\u2026", "elementor")
|
|
6522
6860
|
}
|
|
6523
|
-
), /* @__PURE__ */
|
|
6861
|
+
), /* @__PURE__ */ React100.createElement(import_ui49.Divider, null), /* @__PURE__ */ React100.createElement(
|
|
6524
6862
|
import_editor_ui10.PopoverMenuList,
|
|
6525
6863
|
{
|
|
6526
6864
|
items: virtualizedItems,
|
|
@@ -6528,21 +6866,21 @@ var DynamicSelection = ({ close: closePopover, expired = false }) => {
|
|
|
6528
6866
|
onClose: closePopover,
|
|
6529
6867
|
selectedValue: dynamicValue?.name,
|
|
6530
6868
|
itemStyle: (item) => item.type === "item" ? { paddingInlineStart: theme.spacing(3.5) } : {},
|
|
6531
|
-
noResultsComponent: /* @__PURE__ */
|
|
6869
|
+
noResultsComponent: /* @__PURE__ */ React100.createElement(NoResults, { searchValue, onClear: () => setSearchValue("") })
|
|
6532
6870
|
}
|
|
6533
6871
|
));
|
|
6534
6872
|
};
|
|
6535
|
-
return /* @__PURE__ */
|
|
6873
|
+
return /* @__PURE__ */ React100.createElement(import_editor_ui10.SectionPopoverBody, { "aria-label": (0, import_i18n73.__)("Dynamic tags", "elementor") }, /* @__PURE__ */ React100.createElement(
|
|
6536
6874
|
import_editor_ui10.PopoverHeader,
|
|
6537
6875
|
{
|
|
6538
|
-
title: (0,
|
|
6876
|
+
title: (0, import_i18n73.__)("Dynamic tags", "elementor"),
|
|
6539
6877
|
onClose: closePopover,
|
|
6540
|
-
icon: /* @__PURE__ */
|
|
6878
|
+
icon: /* @__PURE__ */ React100.createElement(import_icons30.DatabaseIcon, { fontSize: SIZE2 })
|
|
6541
6879
|
}
|
|
6542
6880
|
), getPopOverContent());
|
|
6543
6881
|
};
|
|
6544
|
-
var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */
|
|
6545
|
-
|
|
6882
|
+
var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */ React100.createElement(
|
|
6883
|
+
import_ui49.Stack,
|
|
6546
6884
|
{
|
|
6547
6885
|
gap: 1,
|
|
6548
6886
|
alignItems: "center",
|
|
@@ -6552,12 +6890,12 @@ var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */ React99.createElem
|
|
|
6552
6890
|
color: "text.secondary",
|
|
6553
6891
|
sx: { pb: 3.5 }
|
|
6554
6892
|
},
|
|
6555
|
-
/* @__PURE__ */
|
|
6556
|
-
/* @__PURE__ */
|
|
6557
|
-
/* @__PURE__ */
|
|
6893
|
+
/* @__PURE__ */ React100.createElement(import_icons30.DatabaseIcon, { fontSize: "large" }),
|
|
6894
|
+
/* @__PURE__ */ React100.createElement(import_ui49.Typography, { align: "center", variant: "subtitle2" }, (0, import_i18n73.__)("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React100.createElement("br", null), "\u201C", searchValue, "\u201D."),
|
|
6895
|
+
/* @__PURE__ */ React100.createElement(import_ui49.Typography, { align: "center", variant: "caption", sx: { display: "flex", flexDirection: "column" } }, (0, import_i18n73.__)("Try something else.", "elementor"), /* @__PURE__ */ React100.createElement(import_ui49.Link, { color: "text.secondary", variant: "caption", component: "button", onClick: onClear }, (0, import_i18n73.__)("Clear & try again", "elementor")))
|
|
6558
6896
|
);
|
|
6559
|
-
var NoDynamicTags = () => /* @__PURE__ */
|
|
6560
|
-
|
|
6897
|
+
var NoDynamicTags = () => /* @__PURE__ */ React100.createElement(React100.Fragment, null, /* @__PURE__ */ React100.createElement(import_ui49.Divider, null), /* @__PURE__ */ React100.createElement(
|
|
6898
|
+
import_ui49.Stack,
|
|
6561
6899
|
{
|
|
6562
6900
|
gap: 1,
|
|
6563
6901
|
alignItems: "center",
|
|
@@ -6567,20 +6905,20 @@ var NoDynamicTags = () => /* @__PURE__ */ React99.createElement(React99.Fragment
|
|
|
6567
6905
|
color: "text.secondary",
|
|
6568
6906
|
sx: { pb: 3.5 }
|
|
6569
6907
|
},
|
|
6570
|
-
/* @__PURE__ */
|
|
6571
|
-
/* @__PURE__ */
|
|
6572
|
-
/* @__PURE__ */
|
|
6573
|
-
/* @__PURE__ */
|
|
6908
|
+
/* @__PURE__ */ React100.createElement(import_icons30.DatabaseIcon, { fontSize: "large" }),
|
|
6909
|
+
/* @__PURE__ */ React100.createElement(import_ui49.Typography, { align: "center", variant: "subtitle2" }, (0, import_i18n73.__)("Streamline your workflow with dynamic tags", "elementor")),
|
|
6910
|
+
/* @__PURE__ */ React100.createElement(import_ui49.Typography, { align: "center", variant: "caption", width: PROMO_TEXT_WIDTH }, (0, import_i18n73.__)("Upgrade now to display your content dynamically.", "elementor")),
|
|
6911
|
+
/* @__PURE__ */ React100.createElement(
|
|
6574
6912
|
import_editor_ui10.CtaButton,
|
|
6575
6913
|
{
|
|
6576
6914
|
size: "small",
|
|
6577
6915
|
href: PRO_DYNAMIC_TAGS_URL,
|
|
6578
|
-
onClick: () => (0,
|
|
6916
|
+
onClick: () => (0, import_editor_controls64.trackUpgradePromotionClick)({ target_name: "dynamic_tags" })
|
|
6579
6917
|
}
|
|
6580
6918
|
)
|
|
6581
6919
|
));
|
|
6582
|
-
var ExpiredDynamicTags = () => /* @__PURE__ */
|
|
6583
|
-
|
|
6920
|
+
var ExpiredDynamicTags = () => /* @__PURE__ */ React100.createElement(React100.Fragment, null, /* @__PURE__ */ React100.createElement(import_ui49.Divider, null), /* @__PURE__ */ React100.createElement(
|
|
6921
|
+
import_ui49.Stack,
|
|
6584
6922
|
{
|
|
6585
6923
|
gap: 1,
|
|
6586
6924
|
alignItems: "center",
|
|
@@ -6590,16 +6928,16 @@ var ExpiredDynamicTags = () => /* @__PURE__ */ React99.createElement(React99.Fra
|
|
|
6590
6928
|
color: "text.secondary",
|
|
6591
6929
|
sx: { pb: 3.5 }
|
|
6592
6930
|
},
|
|
6593
|
-
/* @__PURE__ */
|
|
6594
|
-
/* @__PURE__ */
|
|
6595
|
-
/* @__PURE__ */
|
|
6596
|
-
/* @__PURE__ */
|
|
6931
|
+
/* @__PURE__ */ React100.createElement(import_icons30.DatabaseIcon, { fontSize: "large" }),
|
|
6932
|
+
/* @__PURE__ */ React100.createElement(import_ui49.Typography, { align: "center", variant: "subtitle2" }, (0, import_i18n73.__)("Unlock your Dynamic tags again", "elementor")),
|
|
6933
|
+
/* @__PURE__ */ React100.createElement(import_ui49.Typography, { align: "center", variant: "caption", width: PROMO_TEXT_WIDTH }, (0, import_i18n73.__)("Dynamic tags need Elementor Pro. Renew now to keep them active.", "elementor")),
|
|
6934
|
+
/* @__PURE__ */ React100.createElement(
|
|
6597
6935
|
import_editor_ui10.CtaButton,
|
|
6598
6936
|
{
|
|
6599
6937
|
size: "small",
|
|
6600
6938
|
href: RENEW_DYNAMIC_TAGS_URL,
|
|
6601
|
-
onClick: () => (0,
|
|
6602
|
-
children: (0,
|
|
6939
|
+
onClick: () => (0, import_editor_controls64.trackUpgradePromotionClick)({ target_name: "dynamic_tags" }),
|
|
6940
|
+
children: (0, import_i18n73.__)("Renew Now", "elementor")
|
|
6603
6941
|
}
|
|
6604
6942
|
)
|
|
6605
6943
|
));
|
|
@@ -6623,8 +6961,8 @@ var useFilteredOptions = (searchValue) => {
|
|
|
6623
6961
|
var SIZE3 = "tiny";
|
|
6624
6962
|
var tagsWithoutTabs = ["popup"];
|
|
6625
6963
|
var DynamicSelectionControl = ({ OriginalControl, ...props }) => {
|
|
6626
|
-
const { setValue: setAnyValue, propType } = (0,
|
|
6627
|
-
const { bind, value } = (0,
|
|
6964
|
+
const { setValue: setAnyValue, propType } = (0, import_editor_controls65.useBoundProp)();
|
|
6965
|
+
const { bind, value } = (0, import_editor_controls65.useBoundProp)(dynamicPropTypeUtil);
|
|
6628
6966
|
const { expired: readonly } = useLicenseConfig();
|
|
6629
6967
|
const originalPropType = createTopLevelObjectType({
|
|
6630
6968
|
schema: {
|
|
@@ -6632,11 +6970,11 @@ var DynamicSelectionControl = ({ OriginalControl, ...props }) => {
|
|
|
6632
6970
|
}
|
|
6633
6971
|
});
|
|
6634
6972
|
const [propValueFromHistory] = usePersistDynamicValue(bind);
|
|
6635
|
-
const selectionPopoverState = (0,
|
|
6973
|
+
const selectionPopoverState = (0, import_ui50.usePopupState)({ variant: "popover" });
|
|
6636
6974
|
const { name: tagName = "" } = value;
|
|
6637
6975
|
const dynamicTag = useDynamicTag(tagName);
|
|
6638
6976
|
if (!isDynamicTagSupported(tagName) && OriginalControl) {
|
|
6639
|
-
return /* @__PURE__ */
|
|
6977
|
+
return /* @__PURE__ */ React101.createElement(import_editor_controls65.PropProvider, { propType: originalPropType, value: { [bind]: null }, setValue: setAnyValue }, /* @__PURE__ */ React101.createElement(import_editor_controls65.PropKeyProvider, { bind }, /* @__PURE__ */ React101.createElement(OriginalControl, { ...props })));
|
|
6640
6978
|
}
|
|
6641
6979
|
const removeDynamicTag = () => {
|
|
6642
6980
|
setAnyValue(propValueFromHistory ?? null);
|
|
@@ -6644,26 +6982,26 @@ var DynamicSelectionControl = ({ OriginalControl, ...props }) => {
|
|
|
6644
6982
|
if (!dynamicTag) {
|
|
6645
6983
|
throw new Error(`Dynamic tag ${tagName} not found`);
|
|
6646
6984
|
}
|
|
6647
|
-
return /* @__PURE__ */
|
|
6648
|
-
|
|
6985
|
+
return /* @__PURE__ */ React101.createElement(import_ui50.Box, null, /* @__PURE__ */ React101.createElement(
|
|
6986
|
+
import_ui50.UnstableTag,
|
|
6649
6987
|
{
|
|
6650
6988
|
fullWidth: true,
|
|
6651
6989
|
showActionsOnHover: true,
|
|
6652
6990
|
label: dynamicTag.label,
|
|
6653
|
-
startIcon: /* @__PURE__ */
|
|
6654
|
-
...(0,
|
|
6655
|
-
actions: /* @__PURE__ */
|
|
6656
|
-
|
|
6991
|
+
startIcon: /* @__PURE__ */ React101.createElement(import_icons31.DatabaseIcon, { fontSize: SIZE3 }),
|
|
6992
|
+
...(0, import_ui50.bindTrigger)(selectionPopoverState),
|
|
6993
|
+
actions: /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(DynamicSettingsPopover, { dynamicTag, disabled: readonly }), /* @__PURE__ */ React101.createElement(
|
|
6994
|
+
import_ui50.IconButton,
|
|
6657
6995
|
{
|
|
6658
6996
|
size: SIZE3,
|
|
6659
6997
|
onClick: removeDynamicTag,
|
|
6660
|
-
"aria-label": (0,
|
|
6998
|
+
"aria-label": (0, import_i18n74.__)("Remove dynamic value", "elementor")
|
|
6661
6999
|
},
|
|
6662
|
-
/* @__PURE__ */
|
|
7000
|
+
/* @__PURE__ */ React101.createElement(import_icons31.XIcon, { fontSize: SIZE3 })
|
|
6663
7001
|
))
|
|
6664
7002
|
}
|
|
6665
|
-
), /* @__PURE__ */
|
|
6666
|
-
|
|
7003
|
+
), /* @__PURE__ */ React101.createElement(
|
|
7004
|
+
import_ui50.Popover,
|
|
6667
7005
|
{
|
|
6668
7006
|
disablePortal: true,
|
|
6669
7007
|
disableScrollLock: true,
|
|
@@ -6672,31 +7010,31 @@ var DynamicSelectionControl = ({ OriginalControl, ...props }) => {
|
|
|
6672
7010
|
PaperProps: {
|
|
6673
7011
|
sx: { my: 1 }
|
|
6674
7012
|
},
|
|
6675
|
-
...(0,
|
|
7013
|
+
...(0, import_ui50.bindPopover)(selectionPopoverState)
|
|
6676
7014
|
},
|
|
6677
|
-
/* @__PURE__ */
|
|
7015
|
+
/* @__PURE__ */ React101.createElement(import_editor_ui11.SectionPopoverBody, { "aria-label": (0, import_i18n74.__)("Dynamic tags", "elementor") }, /* @__PURE__ */ React101.createElement(DynamicSelection, { close: selectionPopoverState.close, expired: readonly }))
|
|
6678
7016
|
));
|
|
6679
7017
|
};
|
|
6680
7018
|
var DynamicSettingsPopover = ({
|
|
6681
7019
|
dynamicTag,
|
|
6682
7020
|
disabled = false
|
|
6683
7021
|
}) => {
|
|
6684
|
-
const popupState = (0,
|
|
7022
|
+
const popupState = (0, import_ui50.usePopupState)({ variant: "popover" });
|
|
6685
7023
|
const hasDynamicSettings = !!dynamicTag.atomic_controls.length;
|
|
6686
7024
|
if (!hasDynamicSettings) {
|
|
6687
7025
|
return null;
|
|
6688
7026
|
}
|
|
6689
|
-
return /* @__PURE__ */
|
|
6690
|
-
|
|
7027
|
+
return /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(
|
|
7028
|
+
import_ui50.IconButton,
|
|
6691
7029
|
{
|
|
6692
7030
|
size: SIZE3,
|
|
6693
7031
|
disabled,
|
|
6694
|
-
...!disabled && (0,
|
|
6695
|
-
"aria-label": (0,
|
|
7032
|
+
...!disabled && (0, import_ui50.bindTrigger)(popupState),
|
|
7033
|
+
"aria-label": (0, import_i18n74.__)("Dynamic settings", "elementor")
|
|
6696
7034
|
},
|
|
6697
|
-
/* @__PURE__ */
|
|
6698
|
-
), /* @__PURE__ */
|
|
6699
|
-
|
|
7035
|
+
/* @__PURE__ */ React101.createElement(import_icons31.SettingsIcon, { fontSize: SIZE3 })
|
|
7036
|
+
), /* @__PURE__ */ React101.createElement(
|
|
7037
|
+
import_ui50.Popover,
|
|
6700
7038
|
{
|
|
6701
7039
|
disablePortal: true,
|
|
6702
7040
|
disableScrollLock: true,
|
|
@@ -6705,45 +7043,45 @@ var DynamicSettingsPopover = ({
|
|
|
6705
7043
|
PaperProps: {
|
|
6706
7044
|
sx: { my: 1 }
|
|
6707
7045
|
},
|
|
6708
|
-
...(0,
|
|
7046
|
+
...(0, import_ui50.bindPopover)(popupState)
|
|
6709
7047
|
},
|
|
6710
|
-
/* @__PURE__ */
|
|
7048
|
+
/* @__PURE__ */ React101.createElement(import_editor_ui11.SectionPopoverBody, { "aria-label": (0, import_i18n74.__)("Dynamic settings", "elementor") }, /* @__PURE__ */ React101.createElement(
|
|
6711
7049
|
import_editor_ui11.PopoverHeader,
|
|
6712
7050
|
{
|
|
6713
7051
|
title: dynamicTag.label,
|
|
6714
7052
|
onClose: popupState.close,
|
|
6715
|
-
icon: /* @__PURE__ */
|
|
7053
|
+
icon: /* @__PURE__ */ React101.createElement(import_icons31.DatabaseIcon, { fontSize: SIZE3 })
|
|
6716
7054
|
}
|
|
6717
|
-
), /* @__PURE__ */
|
|
7055
|
+
), /* @__PURE__ */ React101.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls, tagName: dynamicTag.name }))
|
|
6718
7056
|
));
|
|
6719
7057
|
};
|
|
6720
7058
|
var DynamicSettings = ({ controls, tagName }) => {
|
|
6721
7059
|
const tabs = controls.filter(({ type }) => type === "section");
|
|
6722
|
-
const { getTabsProps, getTabProps, getTabPanelProps } = (0,
|
|
7060
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui50.useTabs)(0);
|
|
6723
7061
|
if (!tabs.length) {
|
|
6724
7062
|
return null;
|
|
6725
7063
|
}
|
|
6726
7064
|
if (tagsWithoutTabs.includes(tagName)) {
|
|
6727
7065
|
const singleTab = tabs[0];
|
|
6728
|
-
return /* @__PURE__ */
|
|
7066
|
+
return /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(import_ui50.Divider, null), /* @__PURE__ */ React101.createElement(ControlsItemsStack, { items: singleTab.value.items }));
|
|
6729
7067
|
}
|
|
6730
|
-
return /* @__PURE__ */
|
|
6731
|
-
|
|
7068
|
+
return /* @__PURE__ */ React101.createElement(React101.Fragment, null, tabs.length > 1 && /* @__PURE__ */ React101.createElement(import_ui50.Tabs, { size: "small", variant: "fullWidth", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React101.createElement(
|
|
7069
|
+
import_ui50.Tab,
|
|
6732
7070
|
{
|
|
6733
7071
|
key: index,
|
|
6734
7072
|
label: value.label,
|
|
6735
7073
|
sx: { px: 1, py: 0.5 },
|
|
6736
7074
|
...getTabProps(index)
|
|
6737
7075
|
}
|
|
6738
|
-
))), /* @__PURE__ */
|
|
6739
|
-
return /* @__PURE__ */
|
|
6740
|
-
|
|
7076
|
+
))), /* @__PURE__ */ React101.createElement(import_ui50.Divider, null), tabs.map(({ value }, index) => {
|
|
7077
|
+
return /* @__PURE__ */ React101.createElement(
|
|
7078
|
+
import_ui50.TabPanel,
|
|
6741
7079
|
{
|
|
6742
7080
|
key: index,
|
|
6743
7081
|
sx: { flexGrow: 1, py: 0, overflowY: "auto" },
|
|
6744
7082
|
...getTabPanelProps(index)
|
|
6745
7083
|
},
|
|
6746
|
-
/* @__PURE__ */
|
|
7084
|
+
/* @__PURE__ */ React101.createElement(ControlsItemsStack, { items: value.items })
|
|
6747
7085
|
);
|
|
6748
7086
|
}));
|
|
6749
7087
|
};
|
|
@@ -6785,17 +7123,17 @@ var Control2 = ({ control }) => {
|
|
|
6785
7123
|
display: "grid",
|
|
6786
7124
|
gridTemplateColumns: isSwitchControl ? "minmax(0, 1fr) max-content" : "1fr 1fr"
|
|
6787
7125
|
} : {};
|
|
6788
|
-
return /* @__PURE__ */
|
|
7126
|
+
return /* @__PURE__ */ React101.createElement(DynamicControl, { bind: control.bind }, /* @__PURE__ */ React101.createElement(import_ui50.Grid, { container: true, gap: 0.75, sx: layoutStyleProps }, control.label ? /* @__PURE__ */ React101.createElement(import_ui50.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React101.createElement(import_editor_controls65.ControlFormLabel, null, control.label)) : null, /* @__PURE__ */ React101.createElement(import_ui50.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React101.createElement(Control, { type: control.type, props: controlProps }))));
|
|
6789
7127
|
};
|
|
6790
7128
|
function ControlsItemsStack({ items: items3 }) {
|
|
6791
|
-
return /* @__PURE__ */
|
|
6792
|
-
(item) => item.type === "control" ? /* @__PURE__ */
|
|
7129
|
+
return /* @__PURE__ */ React101.createElement(import_ui50.Stack, { p: 2, gap: 2, sx: { overflowY: "auto" } }, items3.map(
|
|
7130
|
+
(item) => item.type === "control" ? /* @__PURE__ */ React101.createElement(Control2, { key: item.value.bind, control: item.value }) : null
|
|
6793
7131
|
));
|
|
6794
7132
|
}
|
|
6795
7133
|
|
|
6796
7134
|
// src/dynamics/dynamic-transformer.ts
|
|
6797
7135
|
var import_editor_canvas2 = require("@elementor/editor-canvas");
|
|
6798
|
-
var
|
|
7136
|
+
var import_editor_props25 = require("@elementor/editor-props");
|
|
6799
7137
|
|
|
6800
7138
|
// src/dynamics/errors.ts
|
|
6801
7139
|
var import_utils9 = require("@elementor/utils");
|
|
@@ -6814,7 +7152,7 @@ var dynamicTransformer = (0, import_editor_canvas2.createTransformer)((value, {
|
|
|
6814
7152
|
});
|
|
6815
7153
|
function simpleTransform(props) {
|
|
6816
7154
|
const transformed = Object.entries(props).map(([settingKey, settingValue]) => {
|
|
6817
|
-
const value = (0,
|
|
7155
|
+
const value = (0, import_editor_props25.isTransformable)(settingValue) ? settingValue.value : settingValue;
|
|
6818
7156
|
return [settingKey, value];
|
|
6819
7157
|
});
|
|
6820
7158
|
return Object.fromEntries(transformed);
|
|
@@ -6846,34 +7184,34 @@ function getDynamicValue(name, settings, renderPostId) {
|
|
|
6846
7184
|
}
|
|
6847
7185
|
|
|
6848
7186
|
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
6849
|
-
var
|
|
6850
|
-
var
|
|
7187
|
+
var React102 = __toESM(require("react"));
|
|
7188
|
+
var import_editor_controls66 = require("@elementor/editor-controls");
|
|
6851
7189
|
var import_icons32 = require("@elementor/icons");
|
|
6852
|
-
var
|
|
7190
|
+
var import_i18n75 = require("@wordpress/i18n");
|
|
6853
7191
|
var usePropDynamicAction = () => {
|
|
6854
|
-
const { propType } = (0,
|
|
7192
|
+
const { propType } = (0, import_editor_controls66.useBoundProp)();
|
|
6855
7193
|
const visible = !!propType && supportsDynamic(propType);
|
|
6856
7194
|
return {
|
|
6857
7195
|
visible,
|
|
6858
7196
|
icon: import_icons32.DatabaseIcon,
|
|
6859
|
-
title: (0,
|
|
6860
|
-
content: ({ close }) => /* @__PURE__ */
|
|
7197
|
+
title: (0, import_i18n75.__)("Dynamic tags", "elementor"),
|
|
7198
|
+
content: ({ close }) => /* @__PURE__ */ React102.createElement(DynamicSelection, { close })
|
|
6861
7199
|
};
|
|
6862
7200
|
};
|
|
6863
7201
|
|
|
6864
7202
|
// src/dynamics/init.ts
|
|
6865
7203
|
var { registerPopoverAction } = import_menus2.controlActionsMenu;
|
|
6866
7204
|
var init2 = () => {
|
|
6867
|
-
(0,
|
|
7205
|
+
(0, import_editor_controls67.registerControlReplacement)({
|
|
6868
7206
|
component: DynamicSelectionControl,
|
|
6869
7207
|
condition: ({ value }) => isDynamicPropValue(value)
|
|
6870
7208
|
});
|
|
6871
|
-
(0,
|
|
7209
|
+
(0, import_editor_controls67.injectIntoRepeaterItemLabel)({
|
|
6872
7210
|
id: "dynamic-background-image",
|
|
6873
7211
|
condition: ({ value }) => isDynamicPropValue(value.value?.image?.value?.src),
|
|
6874
7212
|
component: BackgroundControlDynamicTagLabel
|
|
6875
7213
|
});
|
|
6876
|
-
(0,
|
|
7214
|
+
(0, import_editor_controls67.injectIntoRepeaterItemIcon)({
|
|
6877
7215
|
id: "dynamic-background-image",
|
|
6878
7216
|
condition: ({ value }) => isDynamicPropValue(value.value?.image?.value?.src),
|
|
6879
7217
|
component: BackgroundControlDynamicTagIcon
|
|
@@ -6888,11 +7226,11 @@ var init2 = () => {
|
|
|
6888
7226
|
};
|
|
6889
7227
|
|
|
6890
7228
|
// src/reset-style-props.tsx
|
|
6891
|
-
var
|
|
7229
|
+
var import_editor_controls68 = require("@elementor/editor-controls");
|
|
6892
7230
|
var import_editor_variables2 = require("@elementor/editor-variables");
|
|
6893
7231
|
var import_icons33 = require("@elementor/icons");
|
|
6894
7232
|
var import_menus3 = require("@elementor/menus");
|
|
6895
|
-
var
|
|
7233
|
+
var import_i18n76 = require("@wordpress/i18n");
|
|
6896
7234
|
|
|
6897
7235
|
// src/utils/is-equal.ts
|
|
6898
7236
|
function isEqual(a, b) {
|
|
@@ -6948,7 +7286,7 @@ function initResetStyleProps() {
|
|
|
6948
7286
|
}
|
|
6949
7287
|
function useResetStyleValueProps() {
|
|
6950
7288
|
const isStyle = useIsStyle();
|
|
6951
|
-
const { value, resetValue, propType } = (0,
|
|
7289
|
+
const { value, resetValue, propType } = (0, import_editor_controls68.useBoundProp)();
|
|
6952
7290
|
const hasValue = value !== null && value !== void 0;
|
|
6953
7291
|
const hasInitial = propType.initial_value !== void 0 && propType.initial_value !== null;
|
|
6954
7292
|
const isRequired = !!propType.settings?.required;
|
|
@@ -6968,44 +7306,44 @@ function useResetStyleValueProps() {
|
|
|
6968
7306
|
const visible = calculateVisibility();
|
|
6969
7307
|
return {
|
|
6970
7308
|
visible,
|
|
6971
|
-
title: (0,
|
|
7309
|
+
title: (0, import_i18n76.__)("Clear", "elementor"),
|
|
6972
7310
|
icon: import_icons33.BrushBigIcon,
|
|
6973
7311
|
onClick: () => resetValue()
|
|
6974
7312
|
};
|
|
6975
7313
|
}
|
|
6976
7314
|
|
|
6977
7315
|
// src/styles-inheritance/components/styles-inheritance-indicator.tsx
|
|
6978
|
-
var
|
|
6979
|
-
var
|
|
6980
|
-
var
|
|
7316
|
+
var React108 = __toESM(require("react"));
|
|
7317
|
+
var import_editor_controls69 = require("@elementor/editor-controls");
|
|
7318
|
+
var import_editor_props26 = require("@elementor/editor-props");
|
|
6981
7319
|
var import_editor_styles_repository20 = require("@elementor/editor-styles-repository");
|
|
6982
|
-
var
|
|
7320
|
+
var import_i18n80 = require("@wordpress/i18n");
|
|
6983
7321
|
|
|
6984
7322
|
// src/styles-inheritance/components/styles-inheritance-infotip.tsx
|
|
6985
|
-
var
|
|
6986
|
-
var
|
|
7323
|
+
var React107 = __toESM(require("react"));
|
|
7324
|
+
var import_react47 = require("react");
|
|
6987
7325
|
var import_editor_canvas5 = require("@elementor/editor-canvas");
|
|
6988
7326
|
var import_editor_ui12 = require("@elementor/editor-ui");
|
|
6989
|
-
var
|
|
6990
|
-
var
|
|
7327
|
+
var import_ui55 = require("@elementor/ui");
|
|
7328
|
+
var import_i18n79 = require("@wordpress/i18n");
|
|
6991
7329
|
|
|
6992
7330
|
// src/styles-inheritance/hooks/use-normalized-inheritance-chain-items.tsx
|
|
6993
|
-
var
|
|
7331
|
+
var import_react46 = require("react");
|
|
6994
7332
|
var import_editor_canvas4 = require("@elementor/editor-canvas");
|
|
6995
7333
|
var import_editor_styles8 = require("@elementor/editor-styles");
|
|
6996
7334
|
var import_editor_styles_repository18 = require("@elementor/editor-styles-repository");
|
|
6997
|
-
var
|
|
7335
|
+
var import_i18n77 = require("@wordpress/i18n");
|
|
6998
7336
|
var MAXIMUM_ITEMS = 2;
|
|
6999
7337
|
var useNormalizedInheritanceChainItems = (inheritanceChain, bind, resolve) => {
|
|
7000
|
-
const [items3, setItems] = (0,
|
|
7001
|
-
(0,
|
|
7338
|
+
const [items3, setItems] = (0, import_react46.useState)([]);
|
|
7339
|
+
(0, import_react46.useEffect)(() => {
|
|
7002
7340
|
(async () => {
|
|
7003
7341
|
const normalizedItems = await Promise.all(
|
|
7004
7342
|
inheritanceChain.filter(({ style }) => style).map((item, index) => normalizeInheritanceItem(item, index, bind, resolve))
|
|
7005
7343
|
);
|
|
7006
7344
|
const validItems = normalizedItems.map((item) => ({
|
|
7007
7345
|
...item,
|
|
7008
|
-
displayLabel: import_editor_styles_repository18.ELEMENTS_BASE_STYLES_PROVIDER_KEY !== item.provider ? item.displayLabel : (0,
|
|
7346
|
+
displayLabel: import_editor_styles_repository18.ELEMENTS_BASE_STYLES_PROVIDER_KEY !== item.provider ? item.displayLabel : (0, import_i18n77.__)("Base", "elementor")
|
|
7009
7347
|
})).filter((item) => !item.value || item.displayLabel !== "").slice(0, MAXIMUM_ITEMS);
|
|
7010
7348
|
setItems(validItems);
|
|
7011
7349
|
})();
|
|
@@ -7049,7 +7387,7 @@ var getTransformedValue = async (item, bind, resolve) => {
|
|
|
7049
7387
|
}
|
|
7050
7388
|
});
|
|
7051
7389
|
const value = result?.[bind] ?? result;
|
|
7052
|
-
if ((0,
|
|
7390
|
+
if ((0, import_react46.isValidElement)(value)) {
|
|
7053
7391
|
return value;
|
|
7054
7392
|
}
|
|
7055
7393
|
if (typeof value === "object") {
|
|
@@ -7062,10 +7400,10 @@ var getTransformedValue = async (item, bind, resolve) => {
|
|
|
7062
7400
|
};
|
|
7063
7401
|
|
|
7064
7402
|
// src/styles-inheritance/components/infotip/breakpoint-icon.tsx
|
|
7065
|
-
var
|
|
7403
|
+
var React103 = __toESM(require("react"));
|
|
7066
7404
|
var import_editor_responsive4 = require("@elementor/editor-responsive");
|
|
7067
7405
|
var import_icons34 = require("@elementor/icons");
|
|
7068
|
-
var
|
|
7406
|
+
var import_ui51 = require("@elementor/ui");
|
|
7069
7407
|
var SIZE4 = "tiny";
|
|
7070
7408
|
var DEFAULT_BREAKPOINT3 = "desktop";
|
|
7071
7409
|
var breakpointIconMap = {
|
|
@@ -7085,21 +7423,21 @@ var BreakpointIcon = ({ breakpoint }) => {
|
|
|
7085
7423
|
return null;
|
|
7086
7424
|
}
|
|
7087
7425
|
const breakpointLabel = breakpoints.find((breakpointItem) => breakpointItem.id === currentBreakpoint)?.label;
|
|
7088
|
-
return /* @__PURE__ */
|
|
7426
|
+
return /* @__PURE__ */ React103.createElement(import_ui51.Tooltip, { title: breakpointLabel, placement: "top" }, /* @__PURE__ */ React103.createElement(IconComponent, { fontSize: SIZE4, sx: { mt: "2px" } }));
|
|
7089
7427
|
};
|
|
7090
7428
|
|
|
7091
7429
|
// src/styles-inheritance/components/infotip/label-chip.tsx
|
|
7092
|
-
var
|
|
7430
|
+
var React104 = __toESM(require("react"));
|
|
7093
7431
|
var import_editor_styles_repository19 = require("@elementor/editor-styles-repository");
|
|
7094
7432
|
var import_icons35 = require("@elementor/icons");
|
|
7095
|
-
var
|
|
7096
|
-
var
|
|
7433
|
+
var import_ui52 = require("@elementor/ui");
|
|
7434
|
+
var import_i18n78 = require("@wordpress/i18n");
|
|
7097
7435
|
var SIZE5 = "tiny";
|
|
7098
7436
|
var LabelChip = ({ displayLabel, provider }) => {
|
|
7099
7437
|
const isBaseStyle = provider === import_editor_styles_repository19.ELEMENTS_BASE_STYLES_PROVIDER_KEY;
|
|
7100
|
-
const chipIcon = isBaseStyle ? /* @__PURE__ */
|
|
7101
|
-
return /* @__PURE__ */
|
|
7102
|
-
|
|
7438
|
+
const chipIcon = isBaseStyle ? /* @__PURE__ */ React104.createElement(import_ui52.Tooltip, { title: (0, import_i18n78.__)("Inherited from base styles", "elementor"), placement: "top" }, /* @__PURE__ */ React104.createElement(import_icons35.InfoCircleIcon, { fontSize: SIZE5 })) : void 0;
|
|
7439
|
+
return /* @__PURE__ */ React104.createElement(
|
|
7440
|
+
import_ui52.Chip,
|
|
7103
7441
|
{
|
|
7104
7442
|
label: displayLabel,
|
|
7105
7443
|
size: SIZE5,
|
|
@@ -7124,11 +7462,11 @@ var LabelChip = ({ displayLabel, provider }) => {
|
|
|
7124
7462
|
};
|
|
7125
7463
|
|
|
7126
7464
|
// src/styles-inheritance/components/infotip/value-component.tsx
|
|
7127
|
-
var
|
|
7128
|
-
var
|
|
7465
|
+
var React105 = __toESM(require("react"));
|
|
7466
|
+
var import_ui53 = require("@elementor/ui");
|
|
7129
7467
|
var ValueComponent = ({ index, value }) => {
|
|
7130
|
-
return /* @__PURE__ */
|
|
7131
|
-
|
|
7468
|
+
return /* @__PURE__ */ React105.createElement(import_ui53.Tooltip, { title: value, placement: "top" }, /* @__PURE__ */ React105.createElement(
|
|
7469
|
+
import_ui53.Typography,
|
|
7132
7470
|
{
|
|
7133
7471
|
variant: "caption",
|
|
7134
7472
|
color: "text.tertiary",
|
|
@@ -7149,9 +7487,9 @@ var ValueComponent = ({ index, value }) => {
|
|
|
7149
7487
|
};
|
|
7150
7488
|
|
|
7151
7489
|
// src/styles-inheritance/components/infotip/action-icons.tsx
|
|
7152
|
-
var
|
|
7153
|
-
var
|
|
7154
|
-
var ActionIcons = () => /* @__PURE__ */
|
|
7490
|
+
var React106 = __toESM(require("react"));
|
|
7491
|
+
var import_ui54 = require("@elementor/ui");
|
|
7492
|
+
var ActionIcons = () => /* @__PURE__ */ React106.createElement(import_ui54.Box, { display: "flex", gap: 0.5, alignItems: "center" });
|
|
7155
7493
|
|
|
7156
7494
|
// src/styles-inheritance/components/styles-inheritance-infotip.tsx
|
|
7157
7495
|
var SECTION_PADDING_INLINE = 32;
|
|
@@ -7164,8 +7502,8 @@ var StylesInheritanceInfotip = ({
|
|
|
7164
7502
|
children,
|
|
7165
7503
|
isDisabled
|
|
7166
7504
|
}) => {
|
|
7167
|
-
const [showInfotip, setShowInfotip] = (0,
|
|
7168
|
-
const triggerRef = (0,
|
|
7505
|
+
const [showInfotip, setShowInfotip] = (0, import_react47.useState)(false);
|
|
7506
|
+
const triggerRef = (0, import_react47.useRef)(null);
|
|
7169
7507
|
const toggleInfotip = () => {
|
|
7170
7508
|
if (isDisabled) {
|
|
7171
7509
|
return;
|
|
@@ -7180,15 +7518,15 @@ var StylesInheritanceInfotip = ({
|
|
|
7180
7518
|
};
|
|
7181
7519
|
const key = path.join(".");
|
|
7182
7520
|
const sectionWidth = (0, import_editor_ui12.useSectionWidth)();
|
|
7183
|
-
const resolve = (0,
|
|
7521
|
+
const resolve = (0, import_react47.useMemo)(() => {
|
|
7184
7522
|
return (0, import_editor_canvas5.createPropsResolver)({
|
|
7185
7523
|
transformers: import_editor_canvas5.stylesInheritanceTransformersRegistry,
|
|
7186
7524
|
schema: { [key]: propType }
|
|
7187
7525
|
});
|
|
7188
7526
|
}, [key, propType]);
|
|
7189
7527
|
const items3 = useNormalizedInheritanceChainItems(inheritanceChain, key, resolve);
|
|
7190
|
-
const infotipContent = /* @__PURE__ */
|
|
7191
|
-
|
|
7528
|
+
const infotipContent = /* @__PURE__ */ React107.createElement(import_ui55.ClickAwayListener, { onClickAway: closeInfotip }, /* @__PURE__ */ React107.createElement(
|
|
7529
|
+
import_ui55.Card,
|
|
7192
7530
|
{
|
|
7193
7531
|
elevation: 0,
|
|
7194
7532
|
sx: {
|
|
@@ -7200,8 +7538,8 @@ var StylesInheritanceInfotip = ({
|
|
|
7200
7538
|
flexDirection: "column"
|
|
7201
7539
|
}
|
|
7202
7540
|
},
|
|
7203
|
-
/* @__PURE__ */
|
|
7204
|
-
|
|
7541
|
+
/* @__PURE__ */ React107.createElement(
|
|
7542
|
+
import_ui55.Box,
|
|
7205
7543
|
{
|
|
7206
7544
|
sx: {
|
|
7207
7545
|
position: "sticky",
|
|
@@ -7210,10 +7548,10 @@ var StylesInheritanceInfotip = ({
|
|
|
7210
7548
|
backgroundColor: "background.paper"
|
|
7211
7549
|
}
|
|
7212
7550
|
},
|
|
7213
|
-
/* @__PURE__ */
|
|
7551
|
+
/* @__PURE__ */ React107.createElement(import_editor_ui12.PopoverHeader, { title: (0, import_i18n79.__)("Style origin", "elementor"), onClose: closeInfotip })
|
|
7214
7552
|
),
|
|
7215
|
-
/* @__PURE__ */
|
|
7216
|
-
|
|
7553
|
+
/* @__PURE__ */ React107.createElement(
|
|
7554
|
+
import_ui55.CardContent,
|
|
7217
7555
|
{
|
|
7218
7556
|
sx: {
|
|
7219
7557
|
display: "flex",
|
|
@@ -7226,39 +7564,39 @@ var StylesInheritanceInfotip = ({
|
|
|
7226
7564
|
}
|
|
7227
7565
|
}
|
|
7228
7566
|
},
|
|
7229
|
-
/* @__PURE__ */
|
|
7230
|
-
return /* @__PURE__ */
|
|
7231
|
-
|
|
7567
|
+
/* @__PURE__ */ React107.createElement(import_ui55.Stack, { gap: 1.5, sx: { pl: 2, pr: 1, pt: 1.5, pb: 1.5 }, role: "list" }, items3.map((item, index) => {
|
|
7568
|
+
return /* @__PURE__ */ React107.createElement(
|
|
7569
|
+
import_ui55.Box,
|
|
7232
7570
|
{
|
|
7233
7571
|
key: item.id,
|
|
7234
7572
|
display: "flex",
|
|
7235
7573
|
gap: 0.5,
|
|
7236
7574
|
role: "listitem",
|
|
7237
|
-
"aria-label": (0,
|
|
7575
|
+
"aria-label": (0, import_i18n79.__)("Inheritance item: %s", "elementor").replace(
|
|
7238
7576
|
"%s",
|
|
7239
7577
|
item.displayLabel
|
|
7240
7578
|
)
|
|
7241
7579
|
},
|
|
7242
|
-
/* @__PURE__ */
|
|
7243
|
-
|
|
7580
|
+
/* @__PURE__ */ React107.createElement(
|
|
7581
|
+
import_ui55.Box,
|
|
7244
7582
|
{
|
|
7245
7583
|
display: "flex",
|
|
7246
7584
|
gap: 0.5,
|
|
7247
7585
|
sx: { flexWrap: "wrap", width: "100%", alignItems: "flex-start" }
|
|
7248
7586
|
},
|
|
7249
|
-
/* @__PURE__ */
|
|
7250
|
-
/* @__PURE__ */
|
|
7251
|
-
/* @__PURE__ */
|
|
7587
|
+
/* @__PURE__ */ React107.createElement(BreakpointIcon, { breakpoint: item.breakpoint }),
|
|
7588
|
+
/* @__PURE__ */ React107.createElement(LabelChip, { displayLabel: item.displayLabel, provider: item.provider }),
|
|
7589
|
+
/* @__PURE__ */ React107.createElement(ValueComponent, { index, value: item.value })
|
|
7252
7590
|
),
|
|
7253
|
-
/* @__PURE__ */
|
|
7591
|
+
/* @__PURE__ */ React107.createElement(ActionIcons, null)
|
|
7254
7592
|
);
|
|
7255
7593
|
}))
|
|
7256
7594
|
)
|
|
7257
7595
|
));
|
|
7258
7596
|
if (isDisabled) {
|
|
7259
|
-
return /* @__PURE__ */
|
|
7597
|
+
return /* @__PURE__ */ React107.createElement(import_ui55.Box, { sx: { display: "inline-flex" } }, children);
|
|
7260
7598
|
}
|
|
7261
|
-
return /* @__PURE__ */
|
|
7599
|
+
return /* @__PURE__ */ React107.createElement(import_ui55.Box, { ref: triggerRef, sx: { display: "inline-flex" } }, /* @__PURE__ */ React107.createElement(
|
|
7262
7600
|
TooltipOrInfotip,
|
|
7263
7601
|
{
|
|
7264
7602
|
showInfotip,
|
|
@@ -7266,8 +7604,8 @@ var StylesInheritanceInfotip = ({
|
|
|
7266
7604
|
infotipContent,
|
|
7267
7605
|
isDisabled
|
|
7268
7606
|
},
|
|
7269
|
-
/* @__PURE__ */
|
|
7270
|
-
|
|
7607
|
+
/* @__PURE__ */ React107.createElement(
|
|
7608
|
+
import_ui55.IconButton,
|
|
7271
7609
|
{
|
|
7272
7610
|
onClick: toggleInfotip,
|
|
7273
7611
|
"aria-label": label,
|
|
@@ -7286,11 +7624,11 @@ function TooltipOrInfotip({
|
|
|
7286
7624
|
isDisabled
|
|
7287
7625
|
}) {
|
|
7288
7626
|
if (isDisabled) {
|
|
7289
|
-
return /* @__PURE__ */
|
|
7627
|
+
return /* @__PURE__ */ React107.createElement(import_ui55.Box, { sx: { display: "inline-flex" } }, children);
|
|
7290
7628
|
}
|
|
7291
7629
|
if (showInfotip) {
|
|
7292
|
-
return /* @__PURE__ */
|
|
7293
|
-
|
|
7630
|
+
return /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(
|
|
7631
|
+
import_ui55.Backdrop,
|
|
7294
7632
|
{
|
|
7295
7633
|
open: showInfotip,
|
|
7296
7634
|
onClick: onClose,
|
|
@@ -7299,8 +7637,8 @@ function TooltipOrInfotip({
|
|
|
7299
7637
|
zIndex: (theme) => theme.zIndex.modal - 1
|
|
7300
7638
|
}
|
|
7301
7639
|
}
|
|
7302
|
-
), /* @__PURE__ */
|
|
7303
|
-
|
|
7640
|
+
), /* @__PURE__ */ React107.createElement(
|
|
7641
|
+
import_ui55.Infotip,
|
|
7304
7642
|
{
|
|
7305
7643
|
placement: "top-end",
|
|
7306
7644
|
content: infotipContent,
|
|
@@ -7311,25 +7649,25 @@ function TooltipOrInfotip({
|
|
|
7311
7649
|
children
|
|
7312
7650
|
));
|
|
7313
7651
|
}
|
|
7314
|
-
return /* @__PURE__ */
|
|
7652
|
+
return /* @__PURE__ */ React107.createElement(import_ui55.Tooltip, { title: (0, import_i18n79.__)("Style origin", "elementor"), placement: "top" }, children);
|
|
7315
7653
|
}
|
|
7316
7654
|
|
|
7317
7655
|
// src/styles-inheritance/components/styles-inheritance-indicator.tsx
|
|
7318
7656
|
var StylesInheritanceIndicator = ({
|
|
7319
7657
|
customContext
|
|
7320
7658
|
}) => {
|
|
7321
|
-
const context = (0,
|
|
7659
|
+
const context = (0, import_editor_controls69.useBoundProp)();
|
|
7322
7660
|
const { path, propType } = customContext || context;
|
|
7323
7661
|
const inheritanceChain = useStylesInheritanceChain(path);
|
|
7324
7662
|
if (!path || !inheritanceChain.length) {
|
|
7325
7663
|
return null;
|
|
7326
7664
|
}
|
|
7327
|
-
return /* @__PURE__ */
|
|
7665
|
+
return /* @__PURE__ */ React108.createElement(Indicator, { inheritanceChain, path, propType });
|
|
7328
7666
|
};
|
|
7329
7667
|
var Indicator = ({ inheritanceChain, path, propType, isDisabled }) => {
|
|
7330
7668
|
const { id: currentStyleId, provider: currentStyleProvider, meta: currentStyleMeta } = useStyle();
|
|
7331
7669
|
const currentItem = currentStyleId ? getValueFromInheritanceChain(inheritanceChain, currentStyleId, currentStyleMeta) : null;
|
|
7332
|
-
const hasValue = !(0,
|
|
7670
|
+
const hasValue = !(0, import_editor_props26.isEmpty)(currentItem?.value);
|
|
7333
7671
|
const [actualStyle] = inheritanceChain;
|
|
7334
7672
|
if (actualStyle.provider === import_editor_styles_repository20.ELEMENTS_BASE_STYLES_PROVIDER_KEY) {
|
|
7335
7673
|
return null;
|
|
@@ -7340,7 +7678,7 @@ var Indicator = ({ inheritanceChain, path, propType, isDisabled }) => {
|
|
|
7340
7678
|
getColor: isFinalValue && currentStyleProvider ? getStylesProviderThemeColor(currentStyleProvider.getKey()) : void 0,
|
|
7341
7679
|
isOverridden: hasValue && !isFinalValue ? true : void 0
|
|
7342
7680
|
};
|
|
7343
|
-
return /* @__PURE__ */
|
|
7681
|
+
return /* @__PURE__ */ React108.createElement(
|
|
7344
7682
|
StylesInheritanceInfotip,
|
|
7345
7683
|
{
|
|
7346
7684
|
inheritanceChain,
|
|
@@ -7349,17 +7687,17 @@ var Indicator = ({ inheritanceChain, path, propType, isDisabled }) => {
|
|
|
7349
7687
|
label,
|
|
7350
7688
|
isDisabled
|
|
7351
7689
|
},
|
|
7352
|
-
/* @__PURE__ */
|
|
7690
|
+
/* @__PURE__ */ React108.createElement(StyleIndicator, { ...styleIndicatorProps })
|
|
7353
7691
|
);
|
|
7354
7692
|
};
|
|
7355
7693
|
var getLabel = ({ isFinalValue, hasValue }) => {
|
|
7356
7694
|
if (isFinalValue) {
|
|
7357
|
-
return (0,
|
|
7695
|
+
return (0, import_i18n80.__)("This is the final value", "elementor");
|
|
7358
7696
|
}
|
|
7359
7697
|
if (hasValue) {
|
|
7360
|
-
return (0,
|
|
7698
|
+
return (0, import_i18n80.__)("This value is overridden by another style", "elementor");
|
|
7361
7699
|
}
|
|
7362
|
-
return (0,
|
|
7700
|
+
return (0, import_i18n80.__)("This has value from another style", "elementor");
|
|
7363
7701
|
};
|
|
7364
7702
|
|
|
7365
7703
|
// src/styles-inheritance/init-styles-inheritance-transformers.ts
|
|
@@ -7380,7 +7718,7 @@ var excludePropTypeTransformers = /* @__PURE__ */ new Set([
|
|
|
7380
7718
|
]);
|
|
7381
7719
|
|
|
7382
7720
|
// src/styles-inheritance/transformers/array-transformer.tsx
|
|
7383
|
-
var
|
|
7721
|
+
var React109 = __toESM(require("react"));
|
|
7384
7722
|
var import_editor_canvas6 = require("@elementor/editor-canvas");
|
|
7385
7723
|
var arrayTransformer = (0, import_editor_canvas6.createTransformer)((values) => {
|
|
7386
7724
|
if (!values || values.length === 0) {
|
|
@@ -7390,18 +7728,18 @@ var arrayTransformer = (0, import_editor_canvas6.createTransformer)((values) =>
|
|
|
7390
7728
|
if (allStrings) {
|
|
7391
7729
|
return values.join(" ");
|
|
7392
7730
|
}
|
|
7393
|
-
return /* @__PURE__ */
|
|
7731
|
+
return /* @__PURE__ */ React109.createElement(React109.Fragment, null, values.map((item, index) => /* @__PURE__ */ React109.createElement(React109.Fragment, { key: index }, index > 0 && " ", item)));
|
|
7394
7732
|
});
|
|
7395
7733
|
|
|
7396
7734
|
// src/styles-inheritance/transformers/background-color-overlay-transformer.tsx
|
|
7397
|
-
var
|
|
7735
|
+
var React110 = __toESM(require("react"));
|
|
7398
7736
|
var import_editor_canvas7 = require("@elementor/editor-canvas");
|
|
7399
|
-
var
|
|
7400
|
-
var backgroundColorOverlayTransformer = (0, import_editor_canvas7.createTransformer)((value) => /* @__PURE__ */
|
|
7737
|
+
var import_ui56 = require("@elementor/ui");
|
|
7738
|
+
var backgroundColorOverlayTransformer = (0, import_editor_canvas7.createTransformer)((value) => /* @__PURE__ */ React110.createElement(import_ui56.Stack, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React110.createElement(ItemLabelColor, { value })));
|
|
7401
7739
|
var ItemLabelColor = ({ value: { color } }) => {
|
|
7402
|
-
return /* @__PURE__ */
|
|
7740
|
+
return /* @__PURE__ */ React110.createElement("span", null, color);
|
|
7403
7741
|
};
|
|
7404
|
-
var StyledUnstableColorIndicator = (0,
|
|
7742
|
+
var StyledUnstableColorIndicator = (0, import_ui56.styled)(import_ui56.UnstableColorIndicator)(({ theme }) => ({
|
|
7405
7743
|
width: "1em",
|
|
7406
7744
|
height: "1em",
|
|
7407
7745
|
borderRadius: `${theme.shape.borderRadius / 2}px`,
|
|
@@ -7410,20 +7748,20 @@ var StyledUnstableColorIndicator = (0, import_ui55.styled)(import_ui55.UnstableC
|
|
|
7410
7748
|
}));
|
|
7411
7749
|
|
|
7412
7750
|
// src/styles-inheritance/transformers/background-gradient-overlay-transformer.tsx
|
|
7413
|
-
var
|
|
7751
|
+
var React111 = __toESM(require("react"));
|
|
7414
7752
|
var import_editor_canvas8 = require("@elementor/editor-canvas");
|
|
7415
|
-
var
|
|
7416
|
-
var
|
|
7417
|
-
var backgroundGradientOverlayTransformer = (0, import_editor_canvas8.createTransformer)((value) => /* @__PURE__ */
|
|
7753
|
+
var import_ui57 = require("@elementor/ui");
|
|
7754
|
+
var import_i18n81 = require("@wordpress/i18n");
|
|
7755
|
+
var backgroundGradientOverlayTransformer = (0, import_editor_canvas8.createTransformer)((value) => /* @__PURE__ */ React111.createElement(import_ui57.Stack, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React111.createElement(ItemIconGradient, { value }), /* @__PURE__ */ React111.createElement(ItemLabelGradient, { value })));
|
|
7418
7756
|
var ItemIconGradient = ({ value }) => {
|
|
7419
7757
|
const gradient = getGradientValue(value);
|
|
7420
|
-
return /* @__PURE__ */
|
|
7758
|
+
return /* @__PURE__ */ React111.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: gradient });
|
|
7421
7759
|
};
|
|
7422
7760
|
var ItemLabelGradient = ({ value }) => {
|
|
7423
7761
|
if (value.type === "linear") {
|
|
7424
|
-
return /* @__PURE__ */
|
|
7762
|
+
return /* @__PURE__ */ React111.createElement("span", null, (0, import_i18n81.__)("Linear gradient", "elementor"));
|
|
7425
7763
|
}
|
|
7426
|
-
return /* @__PURE__ */
|
|
7764
|
+
return /* @__PURE__ */ React111.createElement("span", null, (0, import_i18n81.__)("Radial gradient", "elementor"));
|
|
7427
7765
|
};
|
|
7428
7766
|
var getGradientValue = (gradient) => {
|
|
7429
7767
|
const stops = gradient.stops?.map(({ color, offset }) => `${color} ${offset ?? 0}%`)?.join(",");
|
|
@@ -7434,16 +7772,16 @@ var getGradientValue = (gradient) => {
|
|
|
7434
7772
|
};
|
|
7435
7773
|
|
|
7436
7774
|
// src/styles-inheritance/transformers/background-image-overlay-transformer.tsx
|
|
7437
|
-
var
|
|
7775
|
+
var React112 = __toESM(require("react"));
|
|
7438
7776
|
var import_editor_canvas9 = require("@elementor/editor-canvas");
|
|
7439
7777
|
var import_editor_ui13 = require("@elementor/editor-ui");
|
|
7440
|
-
var
|
|
7778
|
+
var import_ui58 = require("@elementor/ui");
|
|
7441
7779
|
var import_wp_media = require("@elementor/wp-media");
|
|
7442
|
-
var backgroundImageOverlayTransformer = (0, import_editor_canvas9.createTransformer)((value) => /* @__PURE__ */
|
|
7780
|
+
var backgroundImageOverlayTransformer = (0, import_editor_canvas9.createTransformer)((value) => /* @__PURE__ */ React112.createElement(import_ui58.Stack, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React112.createElement(ItemIconImage, { value }), /* @__PURE__ */ React112.createElement(ItemLabelImage, { value })));
|
|
7443
7781
|
var ItemIconImage = ({ value }) => {
|
|
7444
7782
|
const { imageUrl } = useImage(value);
|
|
7445
|
-
return /* @__PURE__ */
|
|
7446
|
-
|
|
7783
|
+
return /* @__PURE__ */ React112.createElement(
|
|
7784
|
+
import_ui58.CardMedia,
|
|
7447
7785
|
{
|
|
7448
7786
|
image: imageUrl,
|
|
7449
7787
|
sx: (theme) => ({
|
|
@@ -7458,7 +7796,7 @@ var ItemIconImage = ({ value }) => {
|
|
|
7458
7796
|
};
|
|
7459
7797
|
var ItemLabelImage = ({ value }) => {
|
|
7460
7798
|
const { imageTitle } = useImage(value);
|
|
7461
|
-
return /* @__PURE__ */
|
|
7799
|
+
return /* @__PURE__ */ React112.createElement(import_editor_ui13.EllipsisWithTooltip, { title: imageTitle }, /* @__PURE__ */ React112.createElement("span", null, imageTitle));
|
|
7462
7800
|
};
|
|
7463
7801
|
var useImage = (image) => {
|
|
7464
7802
|
let imageTitle, imageUrl = null;
|
|
@@ -7483,7 +7821,7 @@ var getFileExtensionFromFilename = (filename) => {
|
|
|
7483
7821
|
};
|
|
7484
7822
|
|
|
7485
7823
|
// src/styles-inheritance/transformers/box-shadow-transformer.tsx
|
|
7486
|
-
var
|
|
7824
|
+
var React113 = __toESM(require("react"));
|
|
7487
7825
|
var import_editor_canvas10 = require("@elementor/editor-canvas");
|
|
7488
7826
|
var boxShadowTransformer = (0, import_editor_canvas10.createTransformer)((value) => {
|
|
7489
7827
|
if (!value) {
|
|
@@ -7493,20 +7831,20 @@ var boxShadowTransformer = (0, import_editor_canvas10.createTransformer)((value)
|
|
|
7493
7831
|
const colorValue = color || "#000000";
|
|
7494
7832
|
const sizes = [hOffset || "0px", vOffset || "0px", blur || "10px", spread || "0px"].join(" ");
|
|
7495
7833
|
const positionValue = position || "outset";
|
|
7496
|
-
return /* @__PURE__ */
|
|
7834
|
+
return /* @__PURE__ */ React113.createElement(React113.Fragment, null, colorValue, " ", positionValue, ", ", sizes);
|
|
7497
7835
|
});
|
|
7498
7836
|
|
|
7499
7837
|
// src/styles-inheritance/transformers/color-transformer.tsx
|
|
7500
|
-
var
|
|
7838
|
+
var React114 = __toESM(require("react"));
|
|
7501
7839
|
var import_editor_canvas11 = require("@elementor/editor-canvas");
|
|
7502
|
-
var
|
|
7840
|
+
var import_ui59 = require("@elementor/ui");
|
|
7503
7841
|
function isValidCSSColor(value) {
|
|
7504
7842
|
if (!value.trim()) {
|
|
7505
7843
|
return false;
|
|
7506
7844
|
}
|
|
7507
7845
|
return CSS.supports("color", value.trim());
|
|
7508
7846
|
}
|
|
7509
|
-
var StyledColorIndicator = (0,
|
|
7847
|
+
var StyledColorIndicator = (0, import_ui59.styled)(import_ui59.UnstableColorIndicator)(({ theme }) => ({
|
|
7510
7848
|
width: "1em",
|
|
7511
7849
|
height: "1em",
|
|
7512
7850
|
borderRadius: `${theme.shape.borderRadius / 2}px`,
|
|
@@ -7517,7 +7855,7 @@ var colorTransformer = (0, import_editor_canvas11.createTransformer)((value) =>
|
|
|
7517
7855
|
if (!isValidCSSColor(value)) {
|
|
7518
7856
|
return value;
|
|
7519
7857
|
}
|
|
7520
|
-
return /* @__PURE__ */
|
|
7858
|
+
return /* @__PURE__ */ React114.createElement(import_ui59.Stack, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React114.createElement(StyledColorIndicator, { size: "inherit", component: "span", value }), /* @__PURE__ */ React114.createElement("span", null, value));
|
|
7521
7859
|
});
|
|
7522
7860
|
|
|
7523
7861
|
// src/styles-inheritance/transformers/repeater-to-items-transformer.tsx
|
|
@@ -7600,7 +7938,7 @@ function init4() {
|
|
|
7600
7938
|
init();
|
|
7601
7939
|
}
|
|
7602
7940
|
var blockV1Panel = () => {
|
|
7603
|
-
(0,
|
|
7941
|
+
(0, import_editor_v1_adapters12.blockCommand)({
|
|
7604
7942
|
command: "panel/editor/open",
|
|
7605
7943
|
condition: isAtomicWidgetSelected
|
|
7606
7944
|
});
|