@elementor/editor-editing-panel 1.17.1 → 1.19.0
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/CHANGELOG.md +72 -0
- package/dist/index.js +1014 -724
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +826 -536
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -11
- package/src/components/control-label-with-adornments.tsx +13 -0
- package/src/components/css-classes/css-class-item.tsx +32 -10
- package/src/components/css-classes/css-class-menu.tsx +25 -9
- package/src/components/css-classes/css-class-selector.tsx +13 -7
- package/src/components/editing-panel-hooks.tsx +0 -2
- package/src/components/editing-panel.tsx +2 -2
- package/src/components/multi-combobox.tsx +9 -4
- package/src/components/style-sections/border-section/border-radius-field.tsx +6 -5
- package/src/components/style-sections/position-section/dimensions-field.tsx +2 -2
- package/src/components/style-sections/spacing-section/spacing-section.tsx +4 -4
- package/src/components/style-sections/typography-section/font-family-field.tsx +2 -46
- package/src/components/style-sections/typography-section/font-style-field.tsx +1 -1
- package/src/components/style-sections/typography-section/hooks/use-font-families.ts +52 -0
- package/src/components/style-sections/typography-section/text-decoration-field.tsx +40 -89
- package/src/components/style-tab.tsx +34 -33
- package/src/contexts/styles-inheritance-context.tsx +80 -0
- package/src/controls-registry/control.tsx +3 -1
- package/src/controls-registry/styles-field.tsx +14 -4
- package/src/dynamics/components/dynamic-selection.tsx +111 -74
- package/src/hooks/use-styles-fields.ts +3 -4
- package/src/hooks/use-styles-rerender.ts +10 -0
- package/src/init.ts +6 -0
- package/src/styles-inheritance/styles-inheritance-indicator.tsx +70 -0
- package/src/sync/types.ts +1 -1
- package/src/hooks/use-close-editor-panel.ts +0 -23
package/dist/index.js
CHANGED
|
@@ -32,12 +32,12 @@ var index_exports = {};
|
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
injectIntoClassSelectorActions: () => injectIntoClassSelectorActions,
|
|
34
34
|
replaceControl: () => replaceControl,
|
|
35
|
-
useBoundProp: () =>
|
|
35
|
+
useBoundProp: () => import_editor_controls49.useBoundProp,
|
|
36
36
|
usePanelActions: () => usePanelActions,
|
|
37
37
|
usePanelStatus: () => usePanelStatus
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(index_exports);
|
|
40
|
-
var
|
|
40
|
+
var import_editor_controls49 = require("@elementor/editor-controls");
|
|
41
41
|
|
|
42
42
|
// src/control-replacement.tsx
|
|
43
43
|
var import_editor_controls = require("@elementor/editor-controls");
|
|
@@ -48,6 +48,7 @@ var React7 = __toESM(require("react"));
|
|
|
48
48
|
var import_editor_elements2 = require("@elementor/editor-elements");
|
|
49
49
|
var import_editor_props = require("@elementor/editor-props");
|
|
50
50
|
var import_editor_styles_repository4 = require("@elementor/editor-styles-repository");
|
|
51
|
+
var import_icons2 = require("@elementor/icons");
|
|
51
52
|
var import_locations = require("@elementor/locations");
|
|
52
53
|
var import_ui4 = require("@elementor/ui");
|
|
53
54
|
var import_i18n3 = require("@wordpress/i18n");
|
|
@@ -136,7 +137,7 @@ var import_ui = require("@elementor/ui");
|
|
|
136
137
|
function MultiCombobox({
|
|
137
138
|
actions = [],
|
|
138
139
|
selected,
|
|
139
|
-
options:
|
|
140
|
+
options: options12,
|
|
140
141
|
onSelect,
|
|
141
142
|
...props
|
|
142
143
|
}) {
|
|
@@ -154,23 +155,23 @@ function MultiCombobox({
|
|
|
154
155
|
handleHomeEndKeys: true,
|
|
155
156
|
disabled: loading,
|
|
156
157
|
value: selected,
|
|
157
|
-
options:
|
|
158
|
+
options: options12,
|
|
158
159
|
renderGroup: (params) => /* @__PURE__ */ React4.createElement(Group, { ...params }),
|
|
159
160
|
renderInput: (params) => /* @__PURE__ */ React4.createElement(import_ui.TextField, { ...params }),
|
|
160
161
|
onChange: (_, selectedOrInputValue, reason) => {
|
|
161
162
|
const inputValue = selectedOrInputValue.find((option) => typeof option === "string");
|
|
162
163
|
const optionsAndActions = selectedOrInputValue.filter((option) => typeof option !== "string");
|
|
163
164
|
if (reason === "createOption") {
|
|
164
|
-
const [firstAction] = filterActions(actions, { options:
|
|
165
|
-
if (firstAction) {
|
|
165
|
+
const [firstAction] = filterActions(actions, { options: options12, inputValue: inputValue ?? "" });
|
|
166
|
+
if (firstAction.value) {
|
|
166
167
|
return run(firstAction.apply, firstAction.value);
|
|
167
168
|
}
|
|
168
169
|
}
|
|
169
170
|
const action = optionsAndActions.find((value) => isAction(value));
|
|
170
|
-
if (reason === "selectOption" && action) {
|
|
171
|
+
if (reason === "selectOption" && action?.value) {
|
|
171
172
|
return run(action.apply, action.value);
|
|
172
173
|
}
|
|
173
|
-
const fixedValues =
|
|
174
|
+
const fixedValues = options12.filter((option) => !!option.fixed);
|
|
174
175
|
onSelect?.([.../* @__PURE__ */ new Set([...optionsAndActions, ...fixedValues])]);
|
|
175
176
|
},
|
|
176
177
|
getOptionLabel: (option) => typeof option === "string" ? option : option.label,
|
|
@@ -178,7 +179,7 @@ function MultiCombobox({
|
|
|
178
179
|
if (typeof option === "string") {
|
|
179
180
|
return option;
|
|
180
181
|
}
|
|
181
|
-
return option.key ?? option.value;
|
|
182
|
+
return option.key ?? option.value ?? option.label;
|
|
182
183
|
},
|
|
183
184
|
filterOptions: (optionList, params) => {
|
|
184
185
|
const selectedValues = selected.map((option) => option.value);
|
|
@@ -190,7 +191,8 @@ function MultiCombobox({
|
|
|
190
191
|
)
|
|
191
192
|
];
|
|
192
193
|
},
|
|
193
|
-
groupBy: (option) => option.group ?? ""
|
|
194
|
+
groupBy: (option) => option.group ?? "",
|
|
195
|
+
renderOption: (optionProps, { label }) => /* @__PURE__ */ React4.createElement("li", { ...optionProps, style: { display: "block", textOverflow: "ellipsis" } }, label)
|
|
194
196
|
}
|
|
195
197
|
);
|
|
196
198
|
}
|
|
@@ -227,8 +229,8 @@ function useActionRunner() {
|
|
|
227
229
|
};
|
|
228
230
|
return { run, loading };
|
|
229
231
|
}
|
|
230
|
-
function filterActions(actions, { options:
|
|
231
|
-
return actions.filter((action) => action.condition(
|
|
232
|
+
function filterActions(actions, { options: options12, inputValue }) {
|
|
233
|
+
return actions.filter((action) => action.condition(options12, inputValue)).map((action, index) => ({
|
|
232
234
|
label: action.label(inputValue),
|
|
233
235
|
value: inputValue,
|
|
234
236
|
group: action.group,
|
|
@@ -302,8 +304,9 @@ function CssClassMenu({ styleId, provider, popupState, handleRename, anchorEl })
|
|
|
302
304
|
},
|
|
303
305
|
getMenuItemsByProvider({ provider, styleId, handleRename, closeMenu: popupState.close }),
|
|
304
306
|
/* @__PURE__ */ React5.createElement(import_ui2.ListSubheader, { sx: { typography: "caption", color: "text.secondary", pb: 0.5, pt: 1 } }, (0, import_i18n.__)("Pseudo classes", "elementor")),
|
|
307
|
+
/* @__PURE__ */ React5.createElement(StateMenuItem, { key: "normal", state: null, styleId, closeMenu: popupState.close }),
|
|
305
308
|
STATES.map((state) => {
|
|
306
|
-
return /* @__PURE__ */ React5.createElement(StateMenuItem, { key: state, state, styleId });
|
|
309
|
+
return /* @__PURE__ */ React5.createElement(StateMenuItem, { key: state, state, styleId, closeMenu: popupState.close });
|
|
307
310
|
})
|
|
308
311
|
);
|
|
309
312
|
}
|
|
@@ -313,12 +316,15 @@ function getMenuItemsByProvider({
|
|
|
313
316
|
handleRename,
|
|
314
317
|
closeMenu
|
|
315
318
|
}) {
|
|
319
|
+
if (!styleId) {
|
|
320
|
+
return [];
|
|
321
|
+
}
|
|
316
322
|
const providerInstance = import_editor_styles_repository2.stylesRepository.getProviderByKey(provider);
|
|
317
323
|
const providerActions = providerInstance?.actions;
|
|
318
324
|
const [canUpdate, canDelete] = [providerActions?.update, providerActions?.delete];
|
|
319
325
|
const actions = [
|
|
320
326
|
canUpdate && /* @__PURE__ */ React5.createElement(RenameClassMenuItem, { key: "rename-class", handleRename, closeMenu }),
|
|
321
|
-
canDelete && /* @__PURE__ */ React5.createElement(UnapplyClassMenuItem, { key: "unapply-class", styleId })
|
|
327
|
+
canDelete && /* @__PURE__ */ React5.createElement(UnapplyClassMenuItem, { key: "unapply-class", styleId, closeMenu })
|
|
322
328
|
].filter(Boolean);
|
|
323
329
|
if (actions.length) {
|
|
324
330
|
actions.unshift(
|
|
@@ -335,7 +341,7 @@ function getMenuItemsByProvider({
|
|
|
335
341
|
}
|
|
336
342
|
return actions;
|
|
337
343
|
}
|
|
338
|
-
function StateMenuItem({ state, styleId, ...props }) {
|
|
344
|
+
function StateMenuItem({ state, styleId, closeMenu, ...props }) {
|
|
339
345
|
const { id: activeId, setId: setActiveId, setMetaState: setActiveMetaState, meta } = useStyle();
|
|
340
346
|
const { state: activeState } = meta;
|
|
341
347
|
const isActive = styleId === activeId;
|
|
@@ -351,14 +357,25 @@ function StateMenuItem({ state, styleId, ...props }) {
|
|
|
351
357
|
setActiveId(styleId);
|
|
352
358
|
}
|
|
353
359
|
setActiveMetaState(state);
|
|
360
|
+
closeMenu();
|
|
354
361
|
}
|
|
355
362
|
},
|
|
356
|
-
state
|
|
363
|
+
state ? state : "Normal"
|
|
357
364
|
);
|
|
358
365
|
}
|
|
359
|
-
function UnapplyClassMenuItem({ styleId, ...props }) {
|
|
366
|
+
function UnapplyClassMenuItem({ styleId, closeMenu, ...props }) {
|
|
360
367
|
const unapplyClass = useUnapplyClass(styleId);
|
|
361
|
-
return /* @__PURE__ */ React5.createElement(
|
|
368
|
+
return /* @__PURE__ */ React5.createElement(
|
|
369
|
+
StyledMenuItem,
|
|
370
|
+
{
|
|
371
|
+
...props,
|
|
372
|
+
onClick: () => {
|
|
373
|
+
unapplyClass();
|
|
374
|
+
closeMenu();
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
(0, import_i18n.__)("Remove", "elementor")
|
|
378
|
+
);
|
|
362
379
|
}
|
|
363
380
|
function RenameClassMenuItem({
|
|
364
381
|
handleRename,
|
|
@@ -387,11 +404,12 @@ function CssClassItem({
|
|
|
387
404
|
provider,
|
|
388
405
|
isActive,
|
|
389
406
|
color: colorProp,
|
|
407
|
+
icon,
|
|
390
408
|
chipProps,
|
|
391
409
|
onClickActive,
|
|
392
410
|
renameLabel
|
|
393
411
|
}) {
|
|
394
|
-
const { meta } = useStyle();
|
|
412
|
+
const { meta, setMetaState } = useStyle();
|
|
395
413
|
const popupState = (0, import_ui3.usePopupState)({ variant: "popover" });
|
|
396
414
|
const [chipRef, setChipRef] = (0, import_react5.useState)(null);
|
|
397
415
|
const { onDelete, ...chipGroupProps } = chipProps;
|
|
@@ -409,21 +427,30 @@ function CssClassItem({
|
|
|
409
427
|
const color = error ? "error" : colorProp;
|
|
410
428
|
const providerActions = import_editor_styles_repository3.stylesRepository.getProviderByKey(provider)?.actions;
|
|
411
429
|
const allowRename = Boolean(providerActions?.update);
|
|
430
|
+
const isShowingState = isActive && meta.state;
|
|
412
431
|
return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(import_ui3.UnstableChipGroup, { ref: setChipRef, ...chipGroupProps, "aria-label": `Edit ${label}`, role: "group" }, /* @__PURE__ */ React6.createElement(
|
|
413
432
|
import_ui3.Chip,
|
|
414
433
|
{
|
|
415
434
|
size: CHIP_SIZE,
|
|
416
435
|
label: isEditing ? /* @__PURE__ */ React6.createElement(import_editor_ui.EditableField, { ref, error, ...getEditableProps() }) : /* @__PURE__ */ React6.createElement(import_editor_ui.EllipsisWithTooltip, { maxWidth: "10ch", title: label, as: "div" }),
|
|
417
|
-
variant: isActive && !meta.state ? "filled" : "standard",
|
|
436
|
+
variant: isActive && !meta.state && !isEditing ? "filled" : "standard",
|
|
437
|
+
shape: "rounded",
|
|
438
|
+
icon,
|
|
418
439
|
color,
|
|
419
440
|
onClick: () => {
|
|
420
|
-
if (
|
|
441
|
+
if (isShowingState) {
|
|
442
|
+
setMetaState(null);
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
if (allowRename && isActive) {
|
|
421
446
|
openEditMode();
|
|
447
|
+
return;
|
|
422
448
|
}
|
|
423
449
|
onClickActive(id);
|
|
424
450
|
},
|
|
425
451
|
"aria-pressed": isActive,
|
|
426
452
|
sx: {
|
|
453
|
+
cursor: isActive && allowRename && !isShowingState ? "text" : "pointer",
|
|
427
454
|
"&.Mui-focusVisible": {
|
|
428
455
|
boxShadow: "none !important"
|
|
429
456
|
}
|
|
@@ -432,12 +459,19 @@ function CssClassItem({
|
|
|
432
459
|
), !isEditing && /* @__PURE__ */ React6.createElement(
|
|
433
460
|
import_ui3.Chip,
|
|
434
461
|
{
|
|
462
|
+
icon: isShowingState ? void 0 : /* @__PURE__ */ React6.createElement(import_icons.DotsVerticalIcon, { fontSize: "tiny" }),
|
|
435
463
|
size: CHIP_SIZE,
|
|
436
|
-
label: /* @__PURE__ */ React6.createElement(import_ui3.Stack, { direction: "row", gap: 0.5, alignItems: "center" },
|
|
464
|
+
label: isShowingState ? /* @__PURE__ */ React6.createElement(import_ui3.Stack, { direction: "row", gap: 0.5, alignItems: "center" }, /* @__PURE__ */ React6.createElement(import_ui3.Typography, { variant: "inherit" }, meta.state), /* @__PURE__ */ React6.createElement(import_icons.DotsVerticalIcon, { fontSize: "tiny" })) : void 0,
|
|
437
465
|
variant: "filled",
|
|
466
|
+
shape: "rounded",
|
|
438
467
|
color,
|
|
439
468
|
...(0, import_ui3.bindTrigger)(popupState),
|
|
440
|
-
"aria-label": (0, import_i18n2.__)("Open CSS Class Menu", "elementor")
|
|
469
|
+
"aria-label": (0, import_i18n2.__)("Open CSS Class Menu", "elementor"),
|
|
470
|
+
sx: {
|
|
471
|
+
paddingRight: 0,
|
|
472
|
+
...!isShowingState ? { paddingLeft: 0 } : {},
|
|
473
|
+
".MuiChip-label": isShowingState ? { paddingRight: 0 } : { padding: 0 }
|
|
474
|
+
}
|
|
441
475
|
}
|
|
442
476
|
)), /* @__PURE__ */ React6.createElement(
|
|
443
477
|
CssClassMenu,
|
|
@@ -462,29 +496,30 @@ var validateLabel = (newLabel) => {
|
|
|
462
496
|
|
|
463
497
|
// src/components/css-classes/css-class-selector.tsx
|
|
464
498
|
var ID = "elementor-css-class-selector";
|
|
465
|
-
var TAGS_LIMIT =
|
|
499
|
+
var TAGS_LIMIT = 50;
|
|
466
500
|
var EMPTY_OPTION = {
|
|
467
501
|
label: (0, import_i18n3.__)("local", "elementor"),
|
|
468
|
-
value:
|
|
502
|
+
value: null,
|
|
469
503
|
fixed: true,
|
|
470
504
|
color: "primary",
|
|
505
|
+
icon: /* @__PURE__ */ React7.createElement(import_icons2.MapPinIcon, null),
|
|
471
506
|
provider: import_editor_styles_repository4.ELEMENTS_STYLES_PROVIDER_KEY
|
|
472
507
|
};
|
|
473
508
|
var { Slot: ClassSelectorActionsSlot, inject: injectIntoClassSelectorActions } = (0, import_locations.createLocation)();
|
|
474
509
|
function CssClassSelector() {
|
|
475
|
-
const
|
|
510
|
+
const options12 = useOptions();
|
|
476
511
|
const { value: appliedIds, setValue: setAppliedIds, pushValue: pushAppliedId } = useAppliedClassesIds();
|
|
477
512
|
const { id: activeId, setId: setActiveId } = useStyle();
|
|
478
513
|
const actions = useCreateActions({ pushAppliedId, setActiveId });
|
|
479
514
|
const handleApply = useHandleApply(appliedIds, setAppliedIds);
|
|
480
|
-
const applied = useAppliedOptions(
|
|
515
|
+
const applied = useAppliedOptions(options12, appliedIds);
|
|
481
516
|
const active = applied.find((option) => option.value === activeId) ?? EMPTY_OPTION;
|
|
482
517
|
return /* @__PURE__ */ React7.createElement(import_ui4.Stack, { gap: 1, p: 2 }, /* @__PURE__ */ React7.createElement(import_ui4.Stack, { direction: "row", gap: 1, alignItems: "center", justifyContent: "space-between" }, /* @__PURE__ */ React7.createElement(import_ui4.Typography, { component: "label", variant: "caption", htmlFor: ID }, (0, import_i18n3.__)("CSS classes", "elementor")), /* @__PURE__ */ React7.createElement(import_ui4.Stack, { direction: "row", gap: 1 }, /* @__PURE__ */ React7.createElement(ClassSelectorActionsSlot, null))), /* @__PURE__ */ React7.createElement(
|
|
483
518
|
MultiCombobox,
|
|
484
519
|
{
|
|
485
520
|
id: ID,
|
|
486
521
|
size: "tiny",
|
|
487
|
-
options:
|
|
522
|
+
options: options12,
|
|
488
523
|
selected: applied,
|
|
489
524
|
onSelect: handleApply,
|
|
490
525
|
limitTags: TAGS_LIMIT,
|
|
@@ -493,8 +528,10 @@ function CssClassSelector() {
|
|
|
493
528
|
renderTags: (values, getTagProps) => values.map((value, index) => {
|
|
494
529
|
const chipProps = getTagProps({ index });
|
|
495
530
|
const isActive = value.value === active?.value;
|
|
496
|
-
const isElementsProvider = value.provider === import_editor_styles_repository4.ELEMENTS_STYLES_PROVIDER_KEY;
|
|
497
531
|
const renameLabel = (newLabel) => {
|
|
532
|
+
if (!value.value) {
|
|
533
|
+
throw new Error(`Cannot rename a class without style id`);
|
|
534
|
+
}
|
|
498
535
|
return updateClassByProvider(value.provider, { label: newLabel, id: value.value });
|
|
499
536
|
};
|
|
500
537
|
return /* @__PURE__ */ React7.createElement(
|
|
@@ -506,8 +543,9 @@ function CssClassSelector() {
|
|
|
506
543
|
id: value.value,
|
|
507
544
|
isActive,
|
|
508
545
|
color: isActive && value.color ? value.color : "default",
|
|
546
|
+
icon: value.icon,
|
|
509
547
|
chipProps,
|
|
510
|
-
onClickActive: () => setActiveId(
|
|
548
|
+
onClickActive: () => setActiveId(value.value),
|
|
511
549
|
renameLabel
|
|
512
550
|
}
|
|
513
551
|
);
|
|
@@ -537,6 +575,7 @@ function useOptions() {
|
|
|
537
575
|
value: styleDef.id,
|
|
538
576
|
fixed: isElements,
|
|
539
577
|
color: isElements ? "primary" : "global",
|
|
578
|
+
icon: isElements ? /* @__PURE__ */ React7.createElement(import_icons2.MapPinIcon, null) : null,
|
|
540
579
|
provider: provider.key,
|
|
541
580
|
group: provider.labels?.plural
|
|
542
581
|
};
|
|
@@ -565,8 +604,8 @@ function useCreateActions({
|
|
|
565
604
|
};
|
|
566
605
|
});
|
|
567
606
|
}
|
|
568
|
-
function useAppliedOptions(
|
|
569
|
-
const applied =
|
|
607
|
+
function useAppliedOptions(options12, appliedIds) {
|
|
608
|
+
const applied = options12.filter((option) => option.value && appliedIds.includes(option.value));
|
|
570
609
|
const hasElementsProviderStyleApplied = applied.some(
|
|
571
610
|
(option) => option.provider === import_editor_styles_repository4.ELEMENTS_STYLES_PROVIDER_KEY
|
|
572
611
|
);
|
|
@@ -622,14 +661,14 @@ function useHandleApply(appliedIds, setAppliedIds) {
|
|
|
622
661
|
var import_editor_panels2 = require("@elementor/editor-panels");
|
|
623
662
|
|
|
624
663
|
// src/components/editing-panel.tsx
|
|
625
|
-
var
|
|
626
|
-
var
|
|
627
|
-
var
|
|
664
|
+
var React65 = __toESM(require("react"));
|
|
665
|
+
var import_editor_controls43 = require("@elementor/editor-controls");
|
|
666
|
+
var import_editor_elements8 = require("@elementor/editor-elements");
|
|
628
667
|
var import_editor_panels = require("@elementor/editor-panels");
|
|
629
|
-
var
|
|
668
|
+
var import_icons22 = require("@elementor/icons");
|
|
630
669
|
var import_session4 = require("@elementor/session");
|
|
631
|
-
var
|
|
632
|
-
var
|
|
670
|
+
var import_ui50 = require("@elementor/ui");
|
|
671
|
+
var import_i18n44 = require("@wordpress/i18n");
|
|
633
672
|
|
|
634
673
|
// src/controls-actions.ts
|
|
635
674
|
var import_menus = require("@elementor/menus");
|
|
@@ -637,7 +676,7 @@ var import_menus = require("@elementor/menus");
|
|
|
637
676
|
// src/popover-action.tsx
|
|
638
677
|
var React8 = __toESM(require("react"));
|
|
639
678
|
var import_react6 = require("react");
|
|
640
|
-
var
|
|
679
|
+
var import_icons3 = require("@elementor/icons");
|
|
641
680
|
var import_ui5 = require("@elementor/ui");
|
|
642
681
|
var SIZE = "tiny";
|
|
643
682
|
function PopoverAction({
|
|
@@ -665,7 +704,7 @@ function PopoverAction({
|
|
|
665
704
|
},
|
|
666
705
|
...(0, import_ui5.bindPopover)(popupState)
|
|
667
706
|
},
|
|
668
|
-
/* @__PURE__ */ React8.createElement(import_ui5.Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React8.createElement(Icon, { fontSize: SIZE, sx: { mr: 0.5 } }), /* @__PURE__ */ React8.createElement(import_ui5.Typography, { variant: "subtitle2" }, title), /* @__PURE__ */ React8.createElement(import_ui5.IconButton, { sx: { ml: "auto" }, size: SIZE, onClick: popupState.close }, /* @__PURE__ */ React8.createElement(
|
|
707
|
+
/* @__PURE__ */ React8.createElement(import_ui5.Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React8.createElement(Icon, { fontSize: SIZE, sx: { mr: 0.5 } }), /* @__PURE__ */ React8.createElement(import_ui5.Typography, { variant: "subtitle2" }, title), /* @__PURE__ */ React8.createElement(import_ui5.IconButton, { sx: { ml: "auto" }, size: SIZE, onClick: popupState.close }, /* @__PURE__ */ React8.createElement(import_icons3.XIcon, { fontSize: SIZE }))),
|
|
669
708
|
/* @__PURE__ */ React8.createElement(PopoverContent2, { closePopover: popupState.close })
|
|
670
709
|
));
|
|
671
710
|
}
|
|
@@ -685,10 +724,10 @@ function EditorPanelErrorFallback() {
|
|
|
685
724
|
}
|
|
686
725
|
|
|
687
726
|
// src/components/editing-panel-tabs.tsx
|
|
688
|
-
var
|
|
689
|
-
var
|
|
690
|
-
var
|
|
691
|
-
var
|
|
727
|
+
var React64 = __toESM(require("react"));
|
|
728
|
+
var import_react17 = require("react");
|
|
729
|
+
var import_ui49 = require("@elementor/ui");
|
|
730
|
+
var import_i18n43 = require("@wordpress/i18n");
|
|
692
731
|
|
|
693
732
|
// src/components/settings-tab.tsx
|
|
694
733
|
var React15 = __toESM(require("react"));
|
|
@@ -716,12 +755,13 @@ var getLayoutByType = (type) => controlTypes[type].layout;
|
|
|
716
755
|
// src/controls-registry/control.tsx
|
|
717
756
|
var Control = ({ props, type }) => {
|
|
718
757
|
const ControlByType = getControlByType(type);
|
|
758
|
+
const { element } = useElement();
|
|
719
759
|
if (!ControlByType) {
|
|
720
760
|
throw new ControlTypeNotFoundError({
|
|
721
761
|
context: { controlType: type }
|
|
722
762
|
});
|
|
723
763
|
}
|
|
724
|
-
return /* @__PURE__ */ React10.createElement(ControlByType, { ...props });
|
|
764
|
+
return /* @__PURE__ */ React10.createElement(ControlByType, { ...props, context: { elementId: element.id } });
|
|
725
765
|
};
|
|
726
766
|
|
|
727
767
|
// src/controls-registry/control-type-container.tsx
|
|
@@ -788,9 +828,9 @@ var import_react7 = require("react");
|
|
|
788
828
|
var import_ui9 = require("@elementor/ui");
|
|
789
829
|
|
|
790
830
|
// src/components/collapse-icon.tsx
|
|
791
|
-
var
|
|
831
|
+
var import_icons4 = require("@elementor/icons");
|
|
792
832
|
var import_ui8 = require("@elementor/ui");
|
|
793
|
-
var CollapseIcon = (0, import_ui8.styled)(
|
|
833
|
+
var CollapseIcon = (0, import_ui8.styled)(import_icons4.ChevronDownIcon, {
|
|
794
834
|
shouldForwardProp: (prop) => prop !== "open"
|
|
795
835
|
})(({ theme, open }) => ({
|
|
796
836
|
transform: open ? "rotate(180deg)" : "rotate(0deg)",
|
|
@@ -850,28 +890,235 @@ var Control2 = ({ control }) => {
|
|
|
850
890
|
};
|
|
851
891
|
|
|
852
892
|
// src/components/style-tab.tsx
|
|
853
|
-
var
|
|
854
|
-
var
|
|
855
|
-
var
|
|
856
|
-
var
|
|
893
|
+
var React63 = __toESM(require("react"));
|
|
894
|
+
var import_react16 = require("react");
|
|
895
|
+
var import_editor_elements7 = require("@elementor/editor-elements");
|
|
896
|
+
var import_editor_props5 = require("@elementor/editor-props");
|
|
897
|
+
var import_editor_responsive2 = require("@elementor/editor-responsive");
|
|
857
898
|
var import_session3 = require("@elementor/session");
|
|
858
|
-
var
|
|
859
|
-
var
|
|
899
|
+
var import_ui48 = require("@elementor/ui");
|
|
900
|
+
var import_i18n42 = require("@wordpress/i18n");
|
|
901
|
+
|
|
902
|
+
// src/contexts/styles-inheritance-context.tsx
|
|
903
|
+
var React16 = __toESM(require("react"));
|
|
904
|
+
var import_react9 = require("react");
|
|
905
|
+
var import_editor_elements4 = require("@elementor/editor-elements");
|
|
906
|
+
var import_editor_props2 = require("@elementor/editor-props");
|
|
907
|
+
var import_editor_responsive = require("@elementor/editor-responsive");
|
|
908
|
+
var import_editor_styles_repository5 = require("@elementor/editor-styles-repository");
|
|
909
|
+
|
|
910
|
+
// src/hooks/use-styles-rerender.ts
|
|
911
|
+
var import_react8 = require("react");
|
|
912
|
+
var useStylesRerender = () => {
|
|
913
|
+
const { provider } = useStyle();
|
|
914
|
+
const [, reRender] = (0, import_react8.useReducer)((p) => !p, false);
|
|
915
|
+
(0, import_react8.useEffect)(() => provider?.subscribe(reRender), [provider]);
|
|
916
|
+
};
|
|
917
|
+
|
|
918
|
+
// src/styles-inheritance/utils.ts
|
|
919
|
+
var DEFAULT_STATE = "normal";
|
|
920
|
+
var DEFAULT_BREAKPOINT = "desktop";
|
|
921
|
+
var getStateKey = (state) => state ?? DEFAULT_STATE;
|
|
922
|
+
var getBreakpointKey = (breakpoint) => breakpoint ?? DEFAULT_BREAKPOINT;
|
|
923
|
+
|
|
924
|
+
// src/styles-inheritance/create-snapshots-manager.ts
|
|
925
|
+
function createSnapshotsManager(getStylesByMeta, breakpointsRoot) {
|
|
926
|
+
const breakpointsInheritancePaths = makeBreakpointsInheritancePaths(breakpointsRoot);
|
|
927
|
+
const allBreakpointStatesSnapshots = {};
|
|
928
|
+
const buildMissingSnapshotsForBreakpoint = (currentBreakpointId, parentBreakpoint, state) => {
|
|
929
|
+
const currentBreakpointKey = getBreakpointKey(currentBreakpointId);
|
|
930
|
+
const stateKey = getStateKey(state);
|
|
931
|
+
if (!allBreakpointStatesSnapshots[currentBreakpointKey]) {
|
|
932
|
+
allBreakpointStatesSnapshots[currentBreakpointKey] = {
|
|
933
|
+
[DEFAULT_STATE]: buildStateSnapshotSlot(
|
|
934
|
+
getStylesByMeta({ breakpoint: currentBreakpointId, state: null }),
|
|
935
|
+
parentBreakpoint,
|
|
936
|
+
{},
|
|
937
|
+
null
|
|
938
|
+
)
|
|
939
|
+
};
|
|
940
|
+
}
|
|
941
|
+
if (state && !allBreakpointStatesSnapshots[currentBreakpointKey][stateKey]) {
|
|
942
|
+
allBreakpointStatesSnapshots[currentBreakpointKey][stateKey] = buildStateSnapshotSlot(
|
|
943
|
+
getStylesByMeta({ breakpoint: currentBreakpointId, state }),
|
|
944
|
+
parentBreakpoint,
|
|
945
|
+
allBreakpointStatesSnapshots[currentBreakpointKey],
|
|
946
|
+
state
|
|
947
|
+
);
|
|
948
|
+
}
|
|
949
|
+
};
|
|
950
|
+
return (meta) => {
|
|
951
|
+
const { breakpoint, state } = meta;
|
|
952
|
+
const stateKey = getStateKey(state);
|
|
953
|
+
const breakpointKey = getBreakpointKey(breakpoint);
|
|
954
|
+
if (allBreakpointStatesSnapshots[breakpointKey]?.[stateKey]) {
|
|
955
|
+
return allBreakpointStatesSnapshots[breakpointKey][stateKey].snapshot;
|
|
956
|
+
}
|
|
957
|
+
const breakpointsChain = [...breakpointsInheritancePaths[breakpointKey], breakpoint];
|
|
958
|
+
breakpointsChain.forEach((breakpointId, index) => {
|
|
959
|
+
const parentBreakpointId = index > 0 ? breakpointsChain[index - 1] : null;
|
|
960
|
+
buildMissingSnapshotsForBreakpoint(
|
|
961
|
+
breakpointId,
|
|
962
|
+
parentBreakpointId ? allBreakpointStatesSnapshots[parentBreakpointId] : void 0,
|
|
963
|
+
state
|
|
964
|
+
);
|
|
965
|
+
});
|
|
966
|
+
return allBreakpointStatesSnapshots[breakpointKey]?.[stateKey]?.snapshot;
|
|
967
|
+
};
|
|
968
|
+
}
|
|
969
|
+
function makeBreakpointsInheritancePaths(root) {
|
|
970
|
+
const breakpoints = {};
|
|
971
|
+
const traverse = (node, parent) => {
|
|
972
|
+
const { id, children } = node;
|
|
973
|
+
breakpoints[id] = parent ? [...parent] : [];
|
|
974
|
+
children?.forEach((child) => {
|
|
975
|
+
traverse(child, [...breakpoints[id] ?? [], id]);
|
|
976
|
+
});
|
|
977
|
+
};
|
|
978
|
+
traverse(root);
|
|
979
|
+
return breakpoints;
|
|
980
|
+
}
|
|
981
|
+
function buildStateSnapshotSlot(styles, parentBreakpoint, currentBreakpoint, state) {
|
|
982
|
+
const initialSlot = buildInitialSnapshotFromStyles(styles);
|
|
983
|
+
if (!state) {
|
|
984
|
+
return {
|
|
985
|
+
snapshot: mergeSnapshots([initialSlot.snapshot, parentBreakpoint?.[DEFAULT_STATE]?.snapshot]),
|
|
986
|
+
stateSpecificSnapshot: void 0
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
return {
|
|
990
|
+
snapshot: mergeSnapshots([
|
|
991
|
+
initialSlot.snapshot,
|
|
992
|
+
parentBreakpoint?.[state]?.stateSpecificSnapshot,
|
|
993
|
+
currentBreakpoint[DEFAULT_STATE]?.snapshot
|
|
994
|
+
]),
|
|
995
|
+
stateSpecificSnapshot: mergeSnapshots([
|
|
996
|
+
initialSlot.stateSpecificSnapshot,
|
|
997
|
+
parentBreakpoint?.[state]?.stateSpecificSnapshot
|
|
998
|
+
])
|
|
999
|
+
};
|
|
1000
|
+
}
|
|
1001
|
+
function buildInitialSnapshotFromStyles(styles) {
|
|
1002
|
+
const snapshot = {};
|
|
1003
|
+
styles.forEach((styleVariantWithId) => {
|
|
1004
|
+
const {
|
|
1005
|
+
styleVariant: { props }
|
|
1006
|
+
} = styleVariantWithId;
|
|
1007
|
+
Object.entries(props).forEach(([key, value]) => {
|
|
1008
|
+
if (!snapshot[key]) {
|
|
1009
|
+
snapshot[key] = [];
|
|
1010
|
+
}
|
|
1011
|
+
const snapshotPropValue = {
|
|
1012
|
+
...styleVariantWithId,
|
|
1013
|
+
value
|
|
1014
|
+
};
|
|
1015
|
+
snapshot[key].push(snapshotPropValue);
|
|
1016
|
+
});
|
|
1017
|
+
});
|
|
1018
|
+
return {
|
|
1019
|
+
snapshot,
|
|
1020
|
+
stateSpecificSnapshot: snapshot
|
|
1021
|
+
};
|
|
1022
|
+
}
|
|
1023
|
+
function mergeSnapshots(snapshots) {
|
|
1024
|
+
const snapshot = {};
|
|
1025
|
+
snapshots.filter(Boolean).forEach(
|
|
1026
|
+
(currentSnapshot) => Object.entries(currentSnapshot).forEach(([key, values]) => {
|
|
1027
|
+
if (!snapshot[key]) {
|
|
1028
|
+
snapshot[key] = [];
|
|
1029
|
+
}
|
|
1030
|
+
snapshot[key] = snapshot[key].concat(values);
|
|
1031
|
+
})
|
|
1032
|
+
);
|
|
1033
|
+
return snapshot;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
// src/styles-inheritance/create-styles-inheritance.ts
|
|
1037
|
+
function createStylesInheritance(styleDefs, breakpointsRoot) {
|
|
1038
|
+
const styleVariantsByMeta = buildStyleVariantsByMetaMapping(styleDefs);
|
|
1039
|
+
const getStyles = ({ breakpoint, state }) => styleVariantsByMeta?.[getBreakpointKey(breakpoint)]?.[getStateKey(state)] ?? [];
|
|
1040
|
+
return createSnapshotsManager(getStyles, breakpointsRoot);
|
|
1041
|
+
}
|
|
1042
|
+
function buildStyleVariantsByMetaMapping(styleDefs) {
|
|
1043
|
+
const breakpointStateSlots = {};
|
|
1044
|
+
styleDefs.forEach((styleDef) => {
|
|
1045
|
+
styleDef.variants.forEach((styleVariant) => {
|
|
1046
|
+
const { meta } = styleVariant;
|
|
1047
|
+
const { state, breakpoint } = meta;
|
|
1048
|
+
const breakpointKey = getBreakpointKey(breakpoint);
|
|
1049
|
+
const stateKey = getStateKey(state);
|
|
1050
|
+
if (!breakpointStateSlots[breakpointKey]) {
|
|
1051
|
+
breakpointStateSlots[breakpointKey] = {};
|
|
1052
|
+
}
|
|
1053
|
+
const breakpointNode = breakpointStateSlots[breakpointKey];
|
|
1054
|
+
if (!breakpointNode[stateKey]) {
|
|
1055
|
+
breakpointNode[stateKey] = [];
|
|
1056
|
+
}
|
|
1057
|
+
breakpointNode[stateKey].push({
|
|
1058
|
+
styleId: styleDef.id,
|
|
1059
|
+
styleVariant
|
|
1060
|
+
});
|
|
1061
|
+
});
|
|
1062
|
+
});
|
|
1063
|
+
return breakpointStateSlots;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
// src/contexts/styles-inheritance-context.tsx
|
|
1067
|
+
var Context4 = (0, import_react9.createContext)(null);
|
|
1068
|
+
function StyleInheritanceProvider({ children }) {
|
|
1069
|
+
const styleDefs = useAppliedStyles();
|
|
1070
|
+
const breakpointsTree = (0, import_editor_responsive.getBreakpointsTree)();
|
|
1071
|
+
const getSnapshot = createStylesInheritance(styleDefs, breakpointsTree);
|
|
1072
|
+
return /* @__PURE__ */ React16.createElement(Context4.Provider, { value: { getSnapshot } }, children);
|
|
1073
|
+
}
|
|
1074
|
+
function useStylesInheritanceFields(fields) {
|
|
1075
|
+
const context = (0, import_react9.useContext)(Context4);
|
|
1076
|
+
const { meta } = useStyle();
|
|
1077
|
+
if (!context) {
|
|
1078
|
+
throw new Error("useStylesInheritanceFields must be used within a StyleInheritanceProvider");
|
|
1079
|
+
}
|
|
1080
|
+
if (!meta) {
|
|
1081
|
+
return null;
|
|
1082
|
+
}
|
|
1083
|
+
const snapshot = context.getSnapshot(meta);
|
|
1084
|
+
return fields.reduce(
|
|
1085
|
+
(acc, key) => ({ ...acc, [key]: snapshot?.[key] ?? [] }),
|
|
1086
|
+
{}
|
|
1087
|
+
);
|
|
1088
|
+
}
|
|
1089
|
+
function useStylesInheritanceField(field) {
|
|
1090
|
+
return useStylesInheritanceFields([field])?.[field] ?? [];
|
|
1091
|
+
}
|
|
1092
|
+
var useAppliedStyles = () => {
|
|
1093
|
+
const { element } = useElement();
|
|
1094
|
+
const currentClassesProp = useClassesProp();
|
|
1095
|
+
const baseStyles = useBaseStyles();
|
|
1096
|
+
useStylesRerender();
|
|
1097
|
+
const classesProp = (0, import_editor_elements4.useElementSetting)(element.id, currentClassesProp);
|
|
1098
|
+
const appliedStyles = import_editor_props2.classesPropTypeUtil.extract(classesProp);
|
|
1099
|
+
return import_editor_styles_repository5.stylesRepository.all().filter((style) => appliedStyles?.includes(style.id)).concat(baseStyles);
|
|
1100
|
+
};
|
|
1101
|
+
var useBaseStyles = () => {
|
|
1102
|
+
const { elementType } = useElement();
|
|
1103
|
+
const widgetsCache = (0, import_editor_elements4.getWidgetsCache)();
|
|
1104
|
+
const widgetCache = widgetsCache?.[elementType.key];
|
|
1105
|
+
return Object.values(widgetCache?.base_styles ?? {});
|
|
1106
|
+
};
|
|
860
1107
|
|
|
861
1108
|
// src/components/style-sections/background-section/background-section.tsx
|
|
862
|
-
var
|
|
863
|
-
var
|
|
1109
|
+
var React19 = __toESM(require("react"));
|
|
1110
|
+
var import_editor_controls7 = require("@elementor/editor-controls");
|
|
864
1111
|
|
|
865
1112
|
// src/controls-registry/styles-field.tsx
|
|
866
|
-
var
|
|
867
|
-
var
|
|
1113
|
+
var React18 = __toESM(require("react"));
|
|
1114
|
+
var import_editor_controls6 = require("@elementor/editor-controls");
|
|
868
1115
|
var import_editor_styles2 = require("@elementor/editor-styles");
|
|
869
1116
|
|
|
870
1117
|
// src/hooks/use-styles-fields.ts
|
|
871
|
-
var
|
|
872
|
-
var
|
|
1118
|
+
var import_react10 = require("react");
|
|
1119
|
+
var import_editor_elements5 = require("@elementor/editor-elements");
|
|
873
1120
|
var import_editor_styles = require("@elementor/editor-styles");
|
|
874
|
-
var
|
|
1121
|
+
var import_editor_styles_repository6 = require("@elementor/editor-styles-repository");
|
|
875
1122
|
var import_editor_v1_adapters = require("@elementor/editor-v1-adapters");
|
|
876
1123
|
var import_i18n4 = require("@wordpress/i18n");
|
|
877
1124
|
function useStylesFields(propNames) {
|
|
@@ -880,8 +1127,7 @@ function useStylesFields(propNames) {
|
|
|
880
1127
|
const classesProp = useClassesProp();
|
|
881
1128
|
const undoableUpdateStyle = useUndoableUpdateStyle();
|
|
882
1129
|
const undoableCreateElementStyle = useUndoableCreateElementStyle();
|
|
883
|
-
|
|
884
|
-
(0, import_react8.useEffect)(() => provider?.subscribe(reRender), [provider]);
|
|
1130
|
+
useStylesRerender();
|
|
885
1131
|
const value = getProps({
|
|
886
1132
|
elementId: element.id,
|
|
887
1133
|
styleId: id,
|
|
@@ -923,35 +1169,35 @@ function getProps({ styleId, elementId, provider, meta, propNames }) {
|
|
|
923
1169
|
);
|
|
924
1170
|
}
|
|
925
1171
|
function useUndoableCreateElementStyle() {
|
|
926
|
-
return (0,
|
|
1172
|
+
return (0, import_react10.useMemo)(() => {
|
|
927
1173
|
return (0, import_editor_v1_adapters.undoable)(
|
|
928
1174
|
{
|
|
929
1175
|
do: (payload) => {
|
|
930
|
-
return (0,
|
|
1176
|
+
return (0, import_editor_elements5.createElementStyle)({
|
|
931
1177
|
...payload,
|
|
932
|
-
label:
|
|
1178
|
+
label: import_editor_styles_repository6.LOCAL_STYLES_RESERVED_LABEL
|
|
933
1179
|
});
|
|
934
1180
|
},
|
|
935
1181
|
undo: ({ elementId }, styleId) => {
|
|
936
|
-
(0,
|
|
1182
|
+
(0, import_editor_elements5.deleteElementStyle)(elementId, styleId);
|
|
937
1183
|
},
|
|
938
1184
|
redo: (payload, styleId) => {
|
|
939
|
-
return (0,
|
|
1185
|
+
return (0, import_editor_elements5.createElementStyle)({
|
|
940
1186
|
...payload,
|
|
941
1187
|
styleId,
|
|
942
|
-
label:
|
|
1188
|
+
label: import_editor_styles_repository6.LOCAL_STYLES_RESERVED_LABEL
|
|
943
1189
|
});
|
|
944
1190
|
}
|
|
945
1191
|
},
|
|
946
1192
|
{
|
|
947
|
-
title: ({ elementId }) => (0,
|
|
1193
|
+
title: ({ elementId }) => (0, import_editor_elements5.getElementLabel)(elementId),
|
|
948
1194
|
subtitle: (0, import_i18n4.__)("Style edited", "elementor")
|
|
949
1195
|
}
|
|
950
1196
|
);
|
|
951
1197
|
}, []);
|
|
952
1198
|
}
|
|
953
1199
|
function useUndoableUpdateStyle() {
|
|
954
|
-
return (0,
|
|
1200
|
+
return (0, import_react10.useMemo)(() => {
|
|
955
1201
|
return (0, import_editor_v1_adapters.undoable)(
|
|
956
1202
|
{
|
|
957
1203
|
do: ({ elementId, styleId, provider, meta, props }) => {
|
|
@@ -977,7 +1223,7 @@ function useUndoableUpdateStyle() {
|
|
|
977
1223
|
}
|
|
978
1224
|
},
|
|
979
1225
|
{
|
|
980
|
-
title: ({ elementId }) => (0,
|
|
1226
|
+
title: ({ elementId }) => (0, import_editor_elements5.getElementLabel)(elementId),
|
|
981
1227
|
subtitle: (0, import_i18n4.__)("Style edited", "elementor")
|
|
982
1228
|
}
|
|
983
1229
|
);
|
|
@@ -1004,6 +1250,62 @@ function useStylesField(propName) {
|
|
|
1004
1250
|
return [value, setValue];
|
|
1005
1251
|
}
|
|
1006
1252
|
|
|
1253
|
+
// src/styles-inheritance/styles-inheritance-indicator.tsx
|
|
1254
|
+
var React17 = __toESM(require("react"));
|
|
1255
|
+
var import_editor_controls5 = require("@elementor/editor-controls");
|
|
1256
|
+
var import_editor_styles_repository7 = require("@elementor/editor-styles-repository");
|
|
1257
|
+
var import_ui11 = require("@elementor/ui");
|
|
1258
|
+
var import_i18n5 = require("@wordpress/i18n");
|
|
1259
|
+
var Circle = (0, import_ui11.styled)("div", {
|
|
1260
|
+
shouldForwardProp: (prop) => prop !== "variant"
|
|
1261
|
+
})`
|
|
1262
|
+
width: 5px;
|
|
1263
|
+
height: 5px;
|
|
1264
|
+
border-radius: 50%;
|
|
1265
|
+
background-color: ${({ theme, variant }) => {
|
|
1266
|
+
switch (variant) {
|
|
1267
|
+
case "overridden":
|
|
1268
|
+
return theme.palette.warning.main;
|
|
1269
|
+
case "global-affects":
|
|
1270
|
+
return theme.palette.global.main;
|
|
1271
|
+
case "local-affects":
|
|
1272
|
+
return theme.palette.primary.main;
|
|
1273
|
+
default:
|
|
1274
|
+
return theme.palette.text.secondary;
|
|
1275
|
+
}
|
|
1276
|
+
}};
|
|
1277
|
+
`;
|
|
1278
|
+
var StylesInheritanceIndicator = () => {
|
|
1279
|
+
const { bind } = (0, import_editor_controls5.useBoundProp)();
|
|
1280
|
+
const { id: currentStyleId, provider: currentStyleProvider, meta: currentStyleMeta } = useStyle();
|
|
1281
|
+
const [value] = useStylesField(bind);
|
|
1282
|
+
const inheritanceChain = useStylesInheritanceField(bind);
|
|
1283
|
+
if (!inheritanceChain.length) {
|
|
1284
|
+
return null;
|
|
1285
|
+
}
|
|
1286
|
+
const [{ styleId, styleVariant }] = inheritanceChain;
|
|
1287
|
+
const { breakpoint, state } = styleVariant.meta;
|
|
1288
|
+
if (styleId === currentStyleId && breakpoint === currentStyleMeta.breakpoint && state === currentStyleMeta.state) {
|
|
1289
|
+
return /* @__PURE__ */ React17.createElement(
|
|
1290
|
+
Circle,
|
|
1291
|
+
{
|
|
1292
|
+
"aria-label": (0, import_i18n5.__)("This is the final value", "elementor"),
|
|
1293
|
+
variant: currentStyleProvider?.key === import_editor_styles_repository7.ELEMENTS_STYLES_PROVIDER_KEY ? "local-affects" : "global-affects"
|
|
1294
|
+
}
|
|
1295
|
+
);
|
|
1296
|
+
}
|
|
1297
|
+
if (value !== null && value !== void 0) {
|
|
1298
|
+
return /* @__PURE__ */ React17.createElement(
|
|
1299
|
+
Circle,
|
|
1300
|
+
{
|
|
1301
|
+
"aria-label": (0, import_i18n5.__)("This value is overridden by another style", "elementor"),
|
|
1302
|
+
variant: "overridden"
|
|
1303
|
+
}
|
|
1304
|
+
);
|
|
1305
|
+
}
|
|
1306
|
+
return /* @__PURE__ */ React17.createElement(Circle, { "aria-label": (0, import_i18n5.__)("This has value from another style", "elementor") });
|
|
1307
|
+
};
|
|
1308
|
+
|
|
1007
1309
|
// src/controls-registry/styles-field.tsx
|
|
1008
1310
|
var StylesField = ({ bind, children }) => {
|
|
1009
1311
|
const [value, setValue] = useStylesField(bind);
|
|
@@ -1013,40 +1315,51 @@ var StylesField = ({ bind, children }) => {
|
|
|
1013
1315
|
const setValues = (newValue) => {
|
|
1014
1316
|
setValue(newValue[bind]);
|
|
1015
1317
|
};
|
|
1016
|
-
return /* @__PURE__ */
|
|
1318
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1319
|
+
import_editor_controls6.ControlAdornmentsProvider,
|
|
1320
|
+
{
|
|
1321
|
+
items: [
|
|
1322
|
+
{
|
|
1323
|
+
id: "styles-inheritance",
|
|
1324
|
+
Adornment: StylesInheritanceIndicator
|
|
1325
|
+
}
|
|
1326
|
+
]
|
|
1327
|
+
},
|
|
1328
|
+
/* @__PURE__ */ React18.createElement(import_editor_controls6.PropProvider, { propType, value: values, setValue: setValues }, /* @__PURE__ */ React18.createElement(import_editor_controls6.PropKeyProvider, { bind }, children))
|
|
1329
|
+
);
|
|
1017
1330
|
};
|
|
1018
1331
|
|
|
1019
1332
|
// src/components/style-sections/background-section/background-section.tsx
|
|
1020
1333
|
var BackgroundSection = () => {
|
|
1021
|
-
return /* @__PURE__ */
|
|
1334
|
+
return /* @__PURE__ */ React19.createElement(StylesField, { bind: "background" }, /* @__PURE__ */ React19.createElement(import_editor_controls7.BackgroundControl, null));
|
|
1022
1335
|
};
|
|
1023
1336
|
|
|
1024
1337
|
// src/components/style-sections/border-section/border-section.tsx
|
|
1025
|
-
var
|
|
1338
|
+
var React29 = __toESM(require("react"));
|
|
1026
1339
|
|
|
1027
1340
|
// src/components/panel-divider.tsx
|
|
1028
|
-
var
|
|
1029
|
-
var
|
|
1030
|
-
var PanelDivider = () => /* @__PURE__ */
|
|
1341
|
+
var React20 = __toESM(require("react"));
|
|
1342
|
+
var import_ui12 = require("@elementor/ui");
|
|
1343
|
+
var PanelDivider = () => /* @__PURE__ */ React20.createElement(import_ui12.Divider, { sx: { my: 0.5 } });
|
|
1031
1344
|
|
|
1032
1345
|
// src/components/section-content.tsx
|
|
1033
|
-
var
|
|
1034
|
-
var
|
|
1035
|
-
var SectionContent = ({ gap = 2, sx, children }) => /* @__PURE__ */
|
|
1346
|
+
var React21 = __toESM(require("react"));
|
|
1347
|
+
var import_ui13 = require("@elementor/ui");
|
|
1348
|
+
var SectionContent = ({ gap = 2, sx, children }) => /* @__PURE__ */ React21.createElement(import_ui13.Stack, { gap, sx: { ...sx } }, children);
|
|
1036
1349
|
|
|
1037
1350
|
// src/components/style-sections/border-section/border-field.tsx
|
|
1038
|
-
var
|
|
1039
|
-
var
|
|
1351
|
+
var React27 = __toESM(require("react"));
|
|
1352
|
+
var import_i18n9 = require("@wordpress/i18n");
|
|
1040
1353
|
|
|
1041
1354
|
// src/components/add-or-remove-content.tsx
|
|
1042
|
-
var
|
|
1043
|
-
var
|
|
1044
|
-
var
|
|
1045
|
-
var
|
|
1355
|
+
var React22 = __toESM(require("react"));
|
|
1356
|
+
var import_editor_controls8 = require("@elementor/editor-controls");
|
|
1357
|
+
var import_icons5 = require("@elementor/icons");
|
|
1358
|
+
var import_ui14 = require("@elementor/ui");
|
|
1046
1359
|
var SIZE2 = "tiny";
|
|
1047
1360
|
var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
|
|
1048
|
-
return /* @__PURE__ */
|
|
1049
|
-
|
|
1361
|
+
return /* @__PURE__ */ React22.createElement(SectionContent, null, /* @__PURE__ */ React22.createElement(
|
|
1362
|
+
import_ui14.Stack,
|
|
1050
1363
|
{
|
|
1051
1364
|
direction: "row",
|
|
1052
1365
|
sx: {
|
|
@@ -1054,60 +1367,60 @@ var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
|
|
|
1054
1367
|
alignItems: "center"
|
|
1055
1368
|
}
|
|
1056
1369
|
},
|
|
1057
|
-
/* @__PURE__ */
|
|
1058
|
-
isAdded ? /* @__PURE__ */
|
|
1059
|
-
), /* @__PURE__ */
|
|
1370
|
+
/* @__PURE__ */ React22.createElement(import_editor_controls8.ControlLabel, null, label),
|
|
1371
|
+
isAdded ? /* @__PURE__ */ React22.createElement(import_ui14.IconButton, { size: SIZE2, onClick: onRemove, "aria-label": "Remove" }, /* @__PURE__ */ React22.createElement(import_icons5.MinusIcon, { fontSize: SIZE2 })) : /* @__PURE__ */ React22.createElement(import_ui14.IconButton, { size: SIZE2, onClick: onAdd, "aria-label": "Add" }, /* @__PURE__ */ React22.createElement(import_icons5.PlusIcon, { fontSize: SIZE2 }))
|
|
1372
|
+
), /* @__PURE__ */ React22.createElement(import_ui14.Collapse, { in: isAdded, unmountOnExit: true }, /* @__PURE__ */ React22.createElement(SectionContent, null, children)));
|
|
1060
1373
|
};
|
|
1061
1374
|
|
|
1062
1375
|
// src/components/style-sections/border-section/border-color-field.tsx
|
|
1063
|
-
var
|
|
1064
|
-
var
|
|
1065
|
-
var
|
|
1066
|
-
var
|
|
1376
|
+
var React23 = __toESM(require("react"));
|
|
1377
|
+
var import_editor_controls9 = require("@elementor/editor-controls");
|
|
1378
|
+
var import_ui15 = require("@elementor/ui");
|
|
1379
|
+
var import_i18n6 = require("@wordpress/i18n");
|
|
1067
1380
|
var BorderColorField = () => {
|
|
1068
|
-
return /* @__PURE__ */
|
|
1381
|
+
return /* @__PURE__ */ React23.createElement(StylesField, { bind: "border-color" }, /* @__PURE__ */ React23.createElement(import_ui15.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React23.createElement(import_ui15.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React23.createElement(import_editor_controls9.ControlLabel, null, (0, import_i18n6.__)("Border color", "elementor"))), /* @__PURE__ */ React23.createElement(import_ui15.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React23.createElement(import_editor_controls9.ColorControl, null))));
|
|
1069
1382
|
};
|
|
1070
1383
|
|
|
1071
1384
|
// src/components/style-sections/border-section/border-style-field.tsx
|
|
1072
|
-
var
|
|
1073
|
-
var
|
|
1074
|
-
var
|
|
1075
|
-
var
|
|
1385
|
+
var React24 = __toESM(require("react"));
|
|
1386
|
+
var import_editor_controls10 = require("@elementor/editor-controls");
|
|
1387
|
+
var import_ui16 = require("@elementor/ui");
|
|
1388
|
+
var import_i18n7 = require("@wordpress/i18n");
|
|
1076
1389
|
var borderStyles = [
|
|
1077
|
-
{ value: "none", label: (0,
|
|
1078
|
-
{ value: "solid", label: (0,
|
|
1079
|
-
{ value: "dashed", label: (0,
|
|
1080
|
-
{ value: "dotted", label: (0,
|
|
1081
|
-
{ value: "double", label: (0,
|
|
1082
|
-
{ value: "groove", label: (0,
|
|
1083
|
-
{ value: "ridge", label: (0,
|
|
1084
|
-
{ value: "inset", label: (0,
|
|
1085
|
-
{ value: "outset", label: (0,
|
|
1390
|
+
{ value: "none", label: (0, import_i18n7.__)("None", "elementor") },
|
|
1391
|
+
{ value: "solid", label: (0, import_i18n7.__)("Solid", "elementor") },
|
|
1392
|
+
{ value: "dashed", label: (0, import_i18n7.__)("Dashed", "elementor") },
|
|
1393
|
+
{ value: "dotted", label: (0, import_i18n7.__)("Dotted", "elementor") },
|
|
1394
|
+
{ value: "double", label: (0, import_i18n7.__)("Double", "elementor") },
|
|
1395
|
+
{ value: "groove", label: (0, import_i18n7.__)("Groove", "elementor") },
|
|
1396
|
+
{ value: "ridge", label: (0, import_i18n7.__)("Ridge", "elementor") },
|
|
1397
|
+
{ value: "inset", label: (0, import_i18n7.__)("Inset", "elementor") },
|
|
1398
|
+
{ value: "outset", label: (0, import_i18n7.__)("Outset", "elementor") }
|
|
1086
1399
|
];
|
|
1087
1400
|
var BorderStyleField = () => {
|
|
1088
|
-
return /* @__PURE__ */
|
|
1401
|
+
return /* @__PURE__ */ React24.createElement(StylesField, { bind: "border-style" }, /* @__PURE__ */ React24.createElement(import_ui16.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React24.createElement(import_ui16.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React24.createElement(import_editor_controls10.ControlLabel, null, (0, import_i18n7.__)("Border type", "elementor"))), /* @__PURE__ */ React24.createElement(import_ui16.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React24.createElement(import_editor_controls10.SelectControl, { options: borderStyles }))));
|
|
1089
1402
|
};
|
|
1090
1403
|
|
|
1091
1404
|
// src/components/style-sections/border-section/border-width-field.tsx
|
|
1092
|
-
var
|
|
1093
|
-
var
|
|
1094
|
-
var
|
|
1095
|
-
var
|
|
1096
|
-
var
|
|
1097
|
-
var
|
|
1405
|
+
var React26 = __toESM(require("react"));
|
|
1406
|
+
var import_editor_controls11 = require("@elementor/editor-controls");
|
|
1407
|
+
var import_editor_props3 = require("@elementor/editor-props");
|
|
1408
|
+
var import_icons6 = require("@elementor/icons");
|
|
1409
|
+
var import_ui19 = require("@elementor/ui");
|
|
1410
|
+
var import_i18n8 = require("@wordpress/i18n");
|
|
1098
1411
|
|
|
1099
1412
|
// src/hooks/use-direction.ts
|
|
1100
|
-
var
|
|
1413
|
+
var import_ui17 = require("@elementor/ui");
|
|
1101
1414
|
function useDirection() {
|
|
1102
|
-
const theme = (0,
|
|
1415
|
+
const theme = (0, import_ui17.useTheme)(), extendedWindow = window;
|
|
1103
1416
|
const isUiRtl = "rtl" === theme.direction, isSiteRtl = !!extendedWindow.elementorFrontend?.config?.is_rtl;
|
|
1104
1417
|
return { isSiteRtl, isUiRtl };
|
|
1105
1418
|
}
|
|
1106
1419
|
|
|
1107
1420
|
// src/components/style-sections/layout-section/utils/rotated-icon.tsx
|
|
1108
|
-
var
|
|
1109
|
-
var
|
|
1110
|
-
var
|
|
1421
|
+
var React25 = __toESM(require("react"));
|
|
1422
|
+
var import_react11 = require("react");
|
|
1423
|
+
var import_ui18 = require("@elementor/ui");
|
|
1111
1424
|
var CLOCKWISE_ANGLES = {
|
|
1112
1425
|
row: 0,
|
|
1113
1426
|
column: 90,
|
|
@@ -1121,13 +1434,13 @@ var COUNTER_CLOCKWISE_ANGLES = {
|
|
|
1121
1434
|
"column-reverse": -270
|
|
1122
1435
|
};
|
|
1123
1436
|
var RotatedIcon = ({ icon: Icon, size, isClockwise = true, offset = 0 }) => {
|
|
1124
|
-
const rotate = (0,
|
|
1437
|
+
const rotate = (0, import_react11.useRef)(useGetTargetAngle(isClockwise, offset));
|
|
1125
1438
|
rotate.current = useGetTargetAngle(isClockwise, offset, rotate);
|
|
1126
|
-
return /* @__PURE__ */
|
|
1439
|
+
return /* @__PURE__ */ React25.createElement(Icon, { fontSize: size, sx: { transition: ".3s", rotate: `${rotate.current}deg` } });
|
|
1127
1440
|
};
|
|
1128
1441
|
var useGetTargetAngle = (isClockwise, offset, existingRef) => {
|
|
1129
1442
|
const [direction] = useStylesField("flex-direction");
|
|
1130
|
-
const isRtl = "rtl" === (0,
|
|
1443
|
+
const isRtl = "rtl" === (0, import_ui18.useTheme)().direction;
|
|
1131
1444
|
const rotationMultiplier = isRtl ? -1 : 1;
|
|
1132
1445
|
const angleMap = isClockwise ? CLOCKWISE_ANGLES : COUNTER_CLOCKWISE_ANGLES;
|
|
1133
1446
|
const currentAngle = existingRef ? existingRef.current * rotationMultiplier : angleMap[direction?.value || "row"] + offset;
|
|
@@ -1138,40 +1451,40 @@ var useGetTargetAngle = (isClockwise, offset, existingRef) => {
|
|
|
1138
1451
|
};
|
|
1139
1452
|
|
|
1140
1453
|
// src/components/style-sections/border-section/border-width-field.tsx
|
|
1141
|
-
var InlineStartIcon = (0,
|
|
1142
|
-
var InlineEndIcon = (0,
|
|
1454
|
+
var InlineStartIcon = (0, import_ui19.withDirection)(import_icons6.SideRightIcon);
|
|
1455
|
+
var InlineEndIcon = (0, import_ui19.withDirection)(import_icons6.SideLeftIcon);
|
|
1143
1456
|
var getEdges = (isSiteRtl) => [
|
|
1144
1457
|
{
|
|
1145
|
-
label: (0,
|
|
1146
|
-
icon: /* @__PURE__ */
|
|
1458
|
+
label: (0, import_i18n8.__)("Top", "elementor"),
|
|
1459
|
+
icon: /* @__PURE__ */ React26.createElement(import_icons6.SideTopIcon, { fontSize: "tiny" }),
|
|
1147
1460
|
bind: "block-start"
|
|
1148
1461
|
},
|
|
1149
1462
|
{
|
|
1150
|
-
label: isSiteRtl ? (0,
|
|
1151
|
-
icon: /* @__PURE__ */
|
|
1463
|
+
label: isSiteRtl ? (0, import_i18n8.__)("Left", "elementor") : (0, import_i18n8.__)("Right", "elementor"),
|
|
1464
|
+
icon: /* @__PURE__ */ React26.createElement(RotatedIcon, { icon: InlineStartIcon, size: "tiny" }),
|
|
1152
1465
|
bind: "inline-end"
|
|
1153
1466
|
},
|
|
1154
1467
|
{
|
|
1155
|
-
label: (0,
|
|
1156
|
-
icon: /* @__PURE__ */
|
|
1468
|
+
label: (0, import_i18n8.__)("Bottom", "elementor"),
|
|
1469
|
+
icon: /* @__PURE__ */ React26.createElement(import_icons6.SideBottomIcon, { fontSize: "tiny" }),
|
|
1157
1470
|
bind: "block-end"
|
|
1158
1471
|
},
|
|
1159
1472
|
{
|
|
1160
|
-
label: isSiteRtl ? (0,
|
|
1161
|
-
icon: /* @__PURE__ */
|
|
1473
|
+
label: isSiteRtl ? (0, import_i18n8.__)("Right", "elementor") : (0, import_i18n8.__)("Left", "elementor"),
|
|
1474
|
+
icon: /* @__PURE__ */ React26.createElement(RotatedIcon, { icon: InlineEndIcon, size: "tiny" }),
|
|
1162
1475
|
bind: "inline-start"
|
|
1163
1476
|
}
|
|
1164
1477
|
];
|
|
1165
1478
|
var BorderWidthField = () => {
|
|
1166
1479
|
const { isSiteRtl } = useDirection();
|
|
1167
|
-
return /* @__PURE__ */
|
|
1168
|
-
|
|
1480
|
+
return /* @__PURE__ */ React26.createElement(StylesField, { bind: "border-width" }, /* @__PURE__ */ React26.createElement(
|
|
1481
|
+
import_editor_controls11.EqualUnequalSizesControl,
|
|
1169
1482
|
{
|
|
1170
1483
|
items: getEdges(isSiteRtl),
|
|
1171
|
-
label: (0,
|
|
1172
|
-
icon: /* @__PURE__ */
|
|
1173
|
-
tooltipLabel: (0,
|
|
1174
|
-
multiSizePropTypeUtil:
|
|
1484
|
+
label: (0, import_i18n8.__)("Border width", "elementor"),
|
|
1485
|
+
icon: /* @__PURE__ */ React26.createElement(import_icons6.SideAllIcon, { fontSize: "tiny" }),
|
|
1486
|
+
tooltipLabel: (0, import_i18n8.__)("Adjust borders", "elementor"),
|
|
1487
|
+
multiSizePropTypeUtil: import_editor_props3.borderWidthPropTypeUtil
|
|
1175
1488
|
}
|
|
1176
1489
|
));
|
|
1177
1490
|
};
|
|
@@ -1195,86 +1508,86 @@ var BorderField = () => {
|
|
|
1195
1508
|
});
|
|
1196
1509
|
};
|
|
1197
1510
|
const hasBorder = Object.values(border ?? {}).some(Boolean);
|
|
1198
|
-
return /* @__PURE__ */
|
|
1511
|
+
return /* @__PURE__ */ React27.createElement(
|
|
1199
1512
|
AddOrRemoveContent,
|
|
1200
1513
|
{
|
|
1201
|
-
label: (0,
|
|
1514
|
+
label: (0, import_i18n9.__)("Border", "elementor"),
|
|
1202
1515
|
isAdded: hasBorder,
|
|
1203
1516
|
onAdd: addBorder,
|
|
1204
1517
|
onRemove: removeBorder
|
|
1205
1518
|
},
|
|
1206
|
-
/* @__PURE__ */
|
|
1207
|
-
/* @__PURE__ */
|
|
1208
|
-
/* @__PURE__ */
|
|
1519
|
+
/* @__PURE__ */ React27.createElement(BorderWidthField, null),
|
|
1520
|
+
/* @__PURE__ */ React27.createElement(BorderColorField, null),
|
|
1521
|
+
/* @__PURE__ */ React27.createElement(BorderStyleField, null)
|
|
1209
1522
|
);
|
|
1210
1523
|
};
|
|
1211
1524
|
|
|
1212
1525
|
// src/components/style-sections/border-section/border-radius-field.tsx
|
|
1213
|
-
var
|
|
1214
|
-
var
|
|
1215
|
-
var
|
|
1216
|
-
var
|
|
1217
|
-
var
|
|
1218
|
-
var
|
|
1219
|
-
var StartStartIcon = (0,
|
|
1220
|
-
var StartEndIcon = (0,
|
|
1221
|
-
var EndStartIcon = (0,
|
|
1222
|
-
var EndEndIcon = (0,
|
|
1223
|
-
var getStartStartLabel = (isSiteRtl) => isSiteRtl ? (0,
|
|
1224
|
-
var getStartEndLabel = (isSiteRtl) => isSiteRtl ? (0,
|
|
1225
|
-
var getEndStartLabel = (isSiteRtl) => isSiteRtl ? (0,
|
|
1226
|
-
var getEndEndLabel = (isSiteRtl) => isSiteRtl ? (0,
|
|
1526
|
+
var React28 = __toESM(require("react"));
|
|
1527
|
+
var import_editor_controls12 = require("@elementor/editor-controls");
|
|
1528
|
+
var import_editor_props4 = require("@elementor/editor-props");
|
|
1529
|
+
var import_icons7 = require("@elementor/icons");
|
|
1530
|
+
var import_ui20 = require("@elementor/ui");
|
|
1531
|
+
var import_i18n10 = require("@wordpress/i18n");
|
|
1532
|
+
var StartStartIcon = (0, import_ui20.withDirection)(import_icons7.RadiusTopLeftIcon);
|
|
1533
|
+
var StartEndIcon = (0, import_ui20.withDirection)(import_icons7.RadiusTopRightIcon);
|
|
1534
|
+
var EndStartIcon = (0, import_ui20.withDirection)(import_icons7.RadiusBottomLeftIcon);
|
|
1535
|
+
var EndEndIcon = (0, import_ui20.withDirection)(import_icons7.RadiusBottomRightIcon);
|
|
1536
|
+
var getStartStartLabel = (isSiteRtl) => isSiteRtl ? (0, import_i18n10.__)("Top right", "elementor") : (0, import_i18n10.__)("Top left", "elementor");
|
|
1537
|
+
var getStartEndLabel = (isSiteRtl) => isSiteRtl ? (0, import_i18n10.__)("Top left", "elementor") : (0, import_i18n10.__)("Top right", "elementor");
|
|
1538
|
+
var getEndStartLabel = (isSiteRtl) => isSiteRtl ? (0, import_i18n10.__)("Bottom right", "elementor") : (0, import_i18n10.__)("Bottom left", "elementor");
|
|
1539
|
+
var getEndEndLabel = (isSiteRtl) => isSiteRtl ? (0, import_i18n10.__)("Bottom left", "elementor") : (0, import_i18n10.__)("Bottom right", "elementor");
|
|
1227
1540
|
var getCorners = (isSiteRtl) => [
|
|
1228
1541
|
{
|
|
1229
1542
|
label: getStartStartLabel(isSiteRtl),
|
|
1230
|
-
icon: /* @__PURE__ */
|
|
1543
|
+
icon: /* @__PURE__ */ React28.createElement(RotatedIcon, { icon: StartStartIcon, size: "tiny" }),
|
|
1231
1544
|
bind: "start-start"
|
|
1232
1545
|
},
|
|
1233
1546
|
{
|
|
1234
1547
|
label: getStartEndLabel(isSiteRtl),
|
|
1235
|
-
icon: /* @__PURE__ */
|
|
1548
|
+
icon: /* @__PURE__ */ React28.createElement(RotatedIcon, { icon: StartEndIcon, size: "tiny" }),
|
|
1236
1549
|
bind: "start-end"
|
|
1237
1550
|
},
|
|
1238
|
-
{
|
|
1239
|
-
label: getEndEndLabel(isSiteRtl),
|
|
1240
|
-
icon: /* @__PURE__ */ React26.createElement(RotatedIcon, { icon: EndEndIcon, size: "tiny" }),
|
|
1241
|
-
bind: "end-end"
|
|
1242
|
-
},
|
|
1243
1551
|
{
|
|
1244
1552
|
label: getEndStartLabel(isSiteRtl),
|
|
1245
|
-
icon: /* @__PURE__ */
|
|
1553
|
+
icon: /* @__PURE__ */ React28.createElement(RotatedIcon, { icon: EndStartIcon, size: "tiny" }),
|
|
1246
1554
|
bind: "end-start"
|
|
1555
|
+
},
|
|
1556
|
+
{
|
|
1557
|
+
label: getEndEndLabel(isSiteRtl),
|
|
1558
|
+
icon: /* @__PURE__ */ React28.createElement(RotatedIcon, { icon: EndEndIcon, size: "tiny" }),
|
|
1559
|
+
bind: "end-end"
|
|
1247
1560
|
}
|
|
1248
1561
|
];
|
|
1249
1562
|
var BorderRadiusField = () => {
|
|
1250
1563
|
const { isSiteRtl } = useDirection();
|
|
1251
|
-
return /* @__PURE__ */
|
|
1252
|
-
|
|
1564
|
+
return /* @__PURE__ */ React28.createElement(StylesField, { bind: "border-radius" }, /* @__PURE__ */ React28.createElement(
|
|
1565
|
+
import_editor_controls12.EqualUnequalSizesControl,
|
|
1253
1566
|
{
|
|
1254
1567
|
items: getCorners(isSiteRtl),
|
|
1255
|
-
label: (0,
|
|
1256
|
-
icon: /* @__PURE__ */
|
|
1257
|
-
tooltipLabel: (0,
|
|
1258
|
-
multiSizePropTypeUtil:
|
|
1568
|
+
label: (0, import_i18n10.__)("Border radius", "elementor"),
|
|
1569
|
+
icon: /* @__PURE__ */ React28.createElement(import_icons7.BorderCornersIcon, { fontSize: "tiny" }),
|
|
1570
|
+
tooltipLabel: (0, import_i18n10.__)("Adjust corners", "elementor"),
|
|
1571
|
+
multiSizePropTypeUtil: import_editor_props4.borderRadiusPropTypeUtil
|
|
1259
1572
|
}
|
|
1260
1573
|
));
|
|
1261
1574
|
};
|
|
1262
1575
|
|
|
1263
1576
|
// src/components/style-sections/border-section/border-section.tsx
|
|
1264
|
-
var BorderSection = () => /* @__PURE__ */
|
|
1577
|
+
var BorderSection = () => /* @__PURE__ */ React29.createElement(SectionContent, null, /* @__PURE__ */ React29.createElement(BorderRadiusField, null), /* @__PURE__ */ React29.createElement(PanelDivider, null), /* @__PURE__ */ React29.createElement(BorderField, null));
|
|
1265
1578
|
|
|
1266
1579
|
// src/components/style-sections/effects-section/effects-section.tsx
|
|
1267
|
-
var
|
|
1268
|
-
var
|
|
1580
|
+
var React30 = __toESM(require("react"));
|
|
1581
|
+
var import_editor_controls13 = require("@elementor/editor-controls");
|
|
1269
1582
|
var EffectsSection = () => {
|
|
1270
|
-
return /* @__PURE__ */
|
|
1583
|
+
return /* @__PURE__ */ React30.createElement(SectionContent, null, /* @__PURE__ */ React30.createElement(StylesField, { bind: "box-shadow" }, /* @__PURE__ */ React30.createElement(import_editor_controls13.BoxShadowRepeaterControl, null)));
|
|
1271
1584
|
};
|
|
1272
1585
|
|
|
1273
1586
|
// src/components/style-sections/layout-section/layout-section.tsx
|
|
1274
|
-
var
|
|
1275
|
-
var
|
|
1276
|
-
var
|
|
1277
|
-
var
|
|
1587
|
+
var React40 = __toESM(require("react"));
|
|
1588
|
+
var import_editor_controls23 = require("@elementor/editor-controls");
|
|
1589
|
+
var import_editor_elements6 = require("@elementor/editor-elements");
|
|
1590
|
+
var import_i18n20 = require("@wordpress/i18n");
|
|
1278
1591
|
|
|
1279
1592
|
// src/hooks/use-computed-style.ts
|
|
1280
1593
|
var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
|
|
@@ -1302,13 +1615,13 @@ function useComputedStyle(elementId) {
|
|
|
1302
1615
|
}
|
|
1303
1616
|
|
|
1304
1617
|
// src/components/style-sections/layout-section/align-items-field.tsx
|
|
1305
|
-
var
|
|
1306
|
-
var
|
|
1307
|
-
var
|
|
1308
|
-
var
|
|
1309
|
-
var
|
|
1310
|
-
var StartIcon = (0,
|
|
1311
|
-
var EndIcon = (0,
|
|
1618
|
+
var React31 = __toESM(require("react"));
|
|
1619
|
+
var import_editor_controls14 = require("@elementor/editor-controls");
|
|
1620
|
+
var import_icons8 = require("@elementor/icons");
|
|
1621
|
+
var import_ui21 = require("@elementor/ui");
|
|
1622
|
+
var import_i18n11 = require("@wordpress/i18n");
|
|
1623
|
+
var StartIcon = (0, import_ui21.withDirection)(import_icons8.LayoutAlignLeftIcon);
|
|
1624
|
+
var EndIcon = (0, import_ui21.withDirection)(import_icons8.LayoutAlignRightIcon);
|
|
1312
1625
|
var iconProps = {
|
|
1313
1626
|
isClockwise: false,
|
|
1314
1627
|
offset: 90
|
|
@@ -1316,42 +1629,42 @@ var iconProps = {
|
|
|
1316
1629
|
var options = [
|
|
1317
1630
|
{
|
|
1318
1631
|
value: "start",
|
|
1319
|
-
label: (0,
|
|
1320
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1632
|
+
label: (0, import_i18n11.__)("Start", "elementor"),
|
|
1633
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(RotatedIcon, { icon: StartIcon, size, ...iconProps }),
|
|
1321
1634
|
showTooltip: true
|
|
1322
1635
|
},
|
|
1323
1636
|
{
|
|
1324
1637
|
value: "center",
|
|
1325
|
-
label: (0,
|
|
1326
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1638
|
+
label: (0, import_i18n11.__)("Center", "elementor"),
|
|
1639
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(RotatedIcon, { icon: import_icons8.LayoutAlignCenterIcon, size, ...iconProps }),
|
|
1327
1640
|
showTooltip: true
|
|
1328
1641
|
},
|
|
1329
1642
|
{
|
|
1330
1643
|
value: "end",
|
|
1331
|
-
label: (0,
|
|
1332
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1644
|
+
label: (0, import_i18n11.__)("End", "elementor"),
|
|
1645
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(RotatedIcon, { icon: EndIcon, size, ...iconProps }),
|
|
1333
1646
|
showTooltip: true
|
|
1334
1647
|
},
|
|
1335
1648
|
{
|
|
1336
1649
|
value: "stretch",
|
|
1337
|
-
label: (0,
|
|
1338
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1650
|
+
label: (0, import_i18n11.__)("Stretch", "elementor"),
|
|
1651
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(RotatedIcon, { icon: import_icons8.LayoutDistributeVerticalIcon, size, ...iconProps }),
|
|
1339
1652
|
showTooltip: true
|
|
1340
1653
|
}
|
|
1341
1654
|
];
|
|
1342
1655
|
var AlignItemsField = () => {
|
|
1343
1656
|
const { isSiteRtl } = useDirection();
|
|
1344
|
-
return /* @__PURE__ */
|
|
1657
|
+
return /* @__PURE__ */ React31.createElement(import_ui21.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React31.createElement(import_ui21.ThemeProvider, null, /* @__PURE__ */ React31.createElement(StylesField, { bind: "align-items" }, /* @__PURE__ */ React31.createElement(import_ui21.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(import_ui21.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(import_editor_controls14.ControlLabel, null, (0, import_i18n11.__)("Align items", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui21.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React31.createElement(import_editor_controls14.ToggleControl, { options }))))));
|
|
1345
1658
|
};
|
|
1346
1659
|
|
|
1347
1660
|
// src/components/style-sections/layout-section/align-self-child-field.tsx
|
|
1348
|
-
var
|
|
1349
|
-
var
|
|
1350
|
-
var
|
|
1351
|
-
var
|
|
1352
|
-
var
|
|
1353
|
-
var StartIcon2 = (0,
|
|
1354
|
-
var EndIcon2 = (0,
|
|
1661
|
+
var React32 = __toESM(require("react"));
|
|
1662
|
+
var import_editor_controls15 = require("@elementor/editor-controls");
|
|
1663
|
+
var import_icons9 = require("@elementor/icons");
|
|
1664
|
+
var import_ui22 = require("@elementor/ui");
|
|
1665
|
+
var import_i18n12 = require("@wordpress/i18n");
|
|
1666
|
+
var StartIcon2 = (0, import_ui22.withDirection)(import_icons9.LayoutAlignLeftIcon);
|
|
1667
|
+
var EndIcon2 = (0, import_ui22.withDirection)(import_icons9.LayoutAlignRightIcon);
|
|
1355
1668
|
var iconProps2 = {
|
|
1356
1669
|
isClockwise: false,
|
|
1357
1670
|
offset: 90
|
|
@@ -1359,119 +1672,119 @@ var iconProps2 = {
|
|
|
1359
1672
|
var options2 = [
|
|
1360
1673
|
{
|
|
1361
1674
|
value: "start",
|
|
1362
|
-
label: (0,
|
|
1363
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1675
|
+
label: (0, import_i18n12.__)("Start", "elementor"),
|
|
1676
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(RotatedIcon, { icon: StartIcon2, size, ...iconProps2 }),
|
|
1364
1677
|
showTooltip: true
|
|
1365
1678
|
},
|
|
1366
1679
|
{
|
|
1367
1680
|
value: "center",
|
|
1368
|
-
label: (0,
|
|
1369
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1681
|
+
label: (0, import_i18n12.__)("Center", "elementor"),
|
|
1682
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(RotatedIcon, { icon: import_icons9.LayoutAlignCenterIcon, size, ...iconProps2 }),
|
|
1370
1683
|
showTooltip: true
|
|
1371
1684
|
},
|
|
1372
1685
|
{
|
|
1373
1686
|
value: "end",
|
|
1374
|
-
label: (0,
|
|
1375
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1687
|
+
label: (0, import_i18n12.__)("End", "elementor"),
|
|
1688
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(RotatedIcon, { icon: EndIcon2, size, ...iconProps2 }),
|
|
1376
1689
|
showTooltip: true
|
|
1377
1690
|
},
|
|
1378
1691
|
{
|
|
1379
1692
|
value: "stretch",
|
|
1380
|
-
label: (0,
|
|
1381
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1693
|
+
label: (0, import_i18n12.__)("Stretch", "elementor"),
|
|
1694
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(RotatedIcon, { icon: import_icons9.LayoutDistributeVerticalIcon, size, ...iconProps2 }),
|
|
1382
1695
|
showTooltip: true
|
|
1383
1696
|
}
|
|
1384
1697
|
];
|
|
1385
1698
|
var AlignSelfChild = () => {
|
|
1386
1699
|
const { isSiteRtl } = useDirection();
|
|
1387
|
-
return /* @__PURE__ */
|
|
1700
|
+
return /* @__PURE__ */ React32.createElement(import_ui22.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React32.createElement(import_ui22.ThemeProvider, null, /* @__PURE__ */ React32.createElement(StylesField, { bind: "align-self" }, /* @__PURE__ */ React32.createElement(import_ui22.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(import_ui22.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(import_editor_controls15.ControlLabel, null, (0, import_i18n12.__)("Align self", "elementor"))), /* @__PURE__ */ React32.createElement(import_ui22.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React32.createElement(import_editor_controls15.ToggleControl, { options: options2 }))))));
|
|
1388
1701
|
};
|
|
1389
1702
|
|
|
1390
1703
|
// src/components/style-sections/layout-section/display-field.tsx
|
|
1391
|
-
var
|
|
1392
|
-
var
|
|
1393
|
-
var
|
|
1394
|
-
var
|
|
1704
|
+
var React33 = __toESM(require("react"));
|
|
1705
|
+
var import_editor_controls16 = require("@elementor/editor-controls");
|
|
1706
|
+
var import_ui23 = require("@elementor/ui");
|
|
1707
|
+
var import_i18n13 = require("@wordpress/i18n");
|
|
1395
1708
|
var DisplayField = () => {
|
|
1396
|
-
const
|
|
1709
|
+
const options12 = [
|
|
1397
1710
|
{
|
|
1398
1711
|
value: "block",
|
|
1399
|
-
renderContent: () => (0,
|
|
1400
|
-
label: (0,
|
|
1712
|
+
renderContent: () => (0, import_i18n13.__)("Block", "elementor"),
|
|
1713
|
+
label: (0, import_i18n13.__)("Block", "elementor"),
|
|
1401
1714
|
showTooltip: true
|
|
1402
1715
|
},
|
|
1403
1716
|
{
|
|
1404
1717
|
value: "flex",
|
|
1405
|
-
renderContent: () => (0,
|
|
1406
|
-
label: (0,
|
|
1718
|
+
renderContent: () => (0, import_i18n13.__)("Flex", "elementor"),
|
|
1719
|
+
label: (0, import_i18n13.__)("Flex", "elementor"),
|
|
1407
1720
|
showTooltip: true
|
|
1408
1721
|
},
|
|
1409
1722
|
{
|
|
1410
1723
|
value: "inline-block",
|
|
1411
|
-
renderContent: () => (0,
|
|
1412
|
-
label: (0,
|
|
1724
|
+
renderContent: () => (0, import_i18n13.__)("In-blk", "elementor"),
|
|
1725
|
+
label: (0, import_i18n13.__)("Inline-block", "elementor"),
|
|
1413
1726
|
showTooltip: true
|
|
1414
1727
|
},
|
|
1415
1728
|
{
|
|
1416
1729
|
value: "inline-flex",
|
|
1417
|
-
renderContent: () => (0,
|
|
1418
|
-
label: (0,
|
|
1730
|
+
renderContent: () => (0, import_i18n13.__)("In-flx", "elementor"),
|
|
1731
|
+
label: (0, import_i18n13.__)("Inline-flex", "elementor"),
|
|
1419
1732
|
showTooltip: true
|
|
1420
1733
|
}
|
|
1421
1734
|
];
|
|
1422
|
-
return /* @__PURE__ */
|
|
1735
|
+
return /* @__PURE__ */ React33.createElement(StylesField, { bind: "display" }, /* @__PURE__ */ React33.createElement(import_ui23.Stack, { gap: 1 }, /* @__PURE__ */ React33.createElement(import_editor_controls16.ControlLabel, null, (0, import_i18n13.__)("Display", "elementor")), /* @__PURE__ */ React33.createElement(import_editor_controls16.ToggleControl, { options: options12, fullWidth: true })));
|
|
1423
1736
|
};
|
|
1424
1737
|
|
|
1425
1738
|
// src/components/style-sections/layout-section/flex-direction-field.tsx
|
|
1426
|
-
var
|
|
1427
|
-
var
|
|
1428
|
-
var
|
|
1429
|
-
var
|
|
1430
|
-
var
|
|
1739
|
+
var React34 = __toESM(require("react"));
|
|
1740
|
+
var import_editor_controls17 = require("@elementor/editor-controls");
|
|
1741
|
+
var import_icons10 = require("@elementor/icons");
|
|
1742
|
+
var import_ui24 = require("@elementor/ui");
|
|
1743
|
+
var import_i18n14 = require("@wordpress/i18n");
|
|
1431
1744
|
var options3 = [
|
|
1432
1745
|
{
|
|
1433
1746
|
value: "row",
|
|
1434
|
-
label: (0,
|
|
1747
|
+
label: (0, import_i18n14.__)("Row", "elementor"),
|
|
1435
1748
|
renderContent: ({ size }) => {
|
|
1436
|
-
const StartIcon5 = (0,
|
|
1437
|
-
return /* @__PURE__ */
|
|
1749
|
+
const StartIcon5 = (0, import_ui24.withDirection)(import_icons10.ArrowRightIcon);
|
|
1750
|
+
return /* @__PURE__ */ React34.createElement(StartIcon5, { fontSize: size });
|
|
1438
1751
|
},
|
|
1439
1752
|
showTooltip: true
|
|
1440
1753
|
},
|
|
1441
1754
|
{
|
|
1442
1755
|
value: "column",
|
|
1443
|
-
label: (0,
|
|
1444
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1756
|
+
label: (0, import_i18n14.__)("Column", "elementor"),
|
|
1757
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(import_icons10.ArrowDownSmallIcon, { fontSize: size }),
|
|
1445
1758
|
showTooltip: true
|
|
1446
1759
|
},
|
|
1447
1760
|
{
|
|
1448
1761
|
value: "row-reverse",
|
|
1449
|
-
label: (0,
|
|
1762
|
+
label: (0, import_i18n14.__)("Reversed row", "elementor"),
|
|
1450
1763
|
renderContent: ({ size }) => {
|
|
1451
|
-
const EndIcon5 = (0,
|
|
1452
|
-
return /* @__PURE__ */
|
|
1764
|
+
const EndIcon5 = (0, import_ui24.withDirection)(import_icons10.ArrowLeftIcon);
|
|
1765
|
+
return /* @__PURE__ */ React34.createElement(EndIcon5, { fontSize: size });
|
|
1453
1766
|
},
|
|
1454
1767
|
showTooltip: true
|
|
1455
1768
|
},
|
|
1456
1769
|
{
|
|
1457
1770
|
value: "column-reverse",
|
|
1458
|
-
label: (0,
|
|
1459
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1771
|
+
label: (0, import_i18n14.__)("Reversed column", "elementor"),
|
|
1772
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(import_icons10.ArrowUpSmallIcon, { fontSize: size }),
|
|
1460
1773
|
showTooltip: true
|
|
1461
1774
|
}
|
|
1462
1775
|
];
|
|
1463
1776
|
var FlexDirectionField = () => {
|
|
1464
1777
|
const { isSiteRtl } = useDirection();
|
|
1465
|
-
return /* @__PURE__ */
|
|
1778
|
+
return /* @__PURE__ */ React34.createElement(import_ui24.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React34.createElement(import_ui24.ThemeProvider, null, /* @__PURE__ */ React34.createElement(StylesField, { bind: "flex-direction" }, /* @__PURE__ */ React34.createElement(import_ui24.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React34.createElement(import_ui24.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React34.createElement(import_editor_controls17.ControlLabel, null, (0, import_i18n14.__)("Direction", "elementor"))), /* @__PURE__ */ React34.createElement(import_ui24.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React34.createElement(import_editor_controls17.ToggleControl, { options: options3 }))))));
|
|
1466
1779
|
};
|
|
1467
1780
|
|
|
1468
1781
|
// src/components/style-sections/layout-section/flex-order-field.tsx
|
|
1469
|
-
var
|
|
1470
|
-
var
|
|
1471
|
-
var
|
|
1472
|
-
var
|
|
1473
|
-
var
|
|
1474
|
-
var
|
|
1782
|
+
var React35 = __toESM(require("react"));
|
|
1783
|
+
var import_react12 = require("react");
|
|
1784
|
+
var import_editor_controls18 = require("@elementor/editor-controls");
|
|
1785
|
+
var import_icons11 = require("@elementor/icons");
|
|
1786
|
+
var import_ui25 = require("@elementor/ui");
|
|
1787
|
+
var import_i18n15 = require("@wordpress/i18n");
|
|
1475
1788
|
var FIRST_DEFAULT_VALUE = -99999;
|
|
1476
1789
|
var LAST_DEFAULT_VALUE = 99999;
|
|
1477
1790
|
var FIRST = "first";
|
|
@@ -1484,26 +1797,26 @@ var orderValueMap = {
|
|
|
1484
1797
|
var items = [
|
|
1485
1798
|
{
|
|
1486
1799
|
value: FIRST,
|
|
1487
|
-
label: (0,
|
|
1488
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1800
|
+
label: (0, import_i18n15.__)("First", "elementor"),
|
|
1801
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(import_icons11.ArrowUpSmallIcon, { fontSize: size }),
|
|
1489
1802
|
showTooltip: true
|
|
1490
1803
|
},
|
|
1491
1804
|
{
|
|
1492
1805
|
value: LAST,
|
|
1493
|
-
label: (0,
|
|
1494
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1806
|
+
label: (0, import_i18n15.__)("Last", "elementor"),
|
|
1807
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(import_icons11.ArrowDownSmallIcon, { fontSize: size }),
|
|
1495
1808
|
showTooltip: true
|
|
1496
1809
|
},
|
|
1497
1810
|
{
|
|
1498
1811
|
value: CUSTOM,
|
|
1499
|
-
label: (0,
|
|
1500
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1812
|
+
label: (0, import_i18n15.__)("Custom", "elementor"),
|
|
1813
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(import_icons11.PencilIcon, { fontSize: size }),
|
|
1501
1814
|
showTooltip: true
|
|
1502
1815
|
}
|
|
1503
1816
|
];
|
|
1504
1817
|
var FlexOrderField = () => {
|
|
1505
1818
|
const { isSiteRtl } = useDirection(), [order, setOrder] = useStylesField("order");
|
|
1506
|
-
const [groupControlValue, setGroupControlValue] = (0,
|
|
1819
|
+
const [groupControlValue, setGroupControlValue] = (0, import_react12.useState)(getGroupControlValue(order?.value || null));
|
|
1507
1820
|
const handleToggleButtonChange = (group) => {
|
|
1508
1821
|
setGroupControlValue(group);
|
|
1509
1822
|
if (!group || group === CUSTOM) {
|
|
@@ -1512,16 +1825,16 @@ var FlexOrderField = () => {
|
|
|
1512
1825
|
}
|
|
1513
1826
|
setOrder({ $$type: "number", value: orderValueMap[group] });
|
|
1514
1827
|
};
|
|
1515
|
-
return /* @__PURE__ */
|
|
1516
|
-
|
|
1828
|
+
return /* @__PURE__ */ React35.createElement(import_ui25.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React35.createElement(import_ui25.ThemeProvider, null, /* @__PURE__ */ React35.createElement(SectionContent, null, /* @__PURE__ */ React35.createElement(import_ui25.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React35.createElement(import_ui25.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(import_editor_controls18.ControlLabel, null, (0, import_i18n15.__)("Order", "elementor"))), /* @__PURE__ */ React35.createElement(import_ui25.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React35.createElement(
|
|
1829
|
+
import_editor_controls18.ControlToggleButtonGroup,
|
|
1517
1830
|
{
|
|
1518
1831
|
items,
|
|
1519
1832
|
value: groupControlValue,
|
|
1520
1833
|
onChange: handleToggleButtonChange,
|
|
1521
1834
|
exclusive: true
|
|
1522
1835
|
}
|
|
1523
|
-
))), CUSTOM === groupControlValue && /* @__PURE__ */
|
|
1524
|
-
|
|
1836
|
+
))), CUSTOM === groupControlValue && /* @__PURE__ */ React35.createElement(StylesField, { bind: "order" }, /* @__PURE__ */ React35.createElement(import_ui25.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React35.createElement(import_ui25.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(import_editor_controls18.ControlLabel, null, (0, import_i18n15.__)("Custom order", "elementor"))), /* @__PURE__ */ React35.createElement(import_ui25.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React35.createElement(
|
|
1837
|
+
import_editor_controls18.NumberControl,
|
|
1525
1838
|
{
|
|
1526
1839
|
min: FIRST_DEFAULT_VALUE + 1,
|
|
1527
1840
|
max: LAST_DEFAULT_VALUE - 1,
|
|
@@ -1540,37 +1853,37 @@ var getGroupControlValue = (order) => {
|
|
|
1540
1853
|
};
|
|
1541
1854
|
|
|
1542
1855
|
// src/components/style-sections/layout-section/flex-size-field.tsx
|
|
1543
|
-
var
|
|
1544
|
-
var
|
|
1545
|
-
var
|
|
1546
|
-
var
|
|
1547
|
-
var
|
|
1548
|
-
var
|
|
1856
|
+
var React36 = __toESM(require("react"));
|
|
1857
|
+
var import_react13 = require("react");
|
|
1858
|
+
var import_editor_controls19 = require("@elementor/editor-controls");
|
|
1859
|
+
var import_icons12 = require("@elementor/icons");
|
|
1860
|
+
var import_ui26 = require("@elementor/ui");
|
|
1861
|
+
var import_i18n16 = require("@wordpress/i18n");
|
|
1549
1862
|
var DEFAULT = 1;
|
|
1550
1863
|
var items2 = [
|
|
1551
1864
|
{
|
|
1552
1865
|
value: "flex-grow",
|
|
1553
|
-
label: (0,
|
|
1554
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1866
|
+
label: (0, import_i18n16.__)("Grow", "elementor"),
|
|
1867
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(import_icons12.ExpandIcon, { fontSize: size }),
|
|
1555
1868
|
showTooltip: true
|
|
1556
1869
|
},
|
|
1557
1870
|
{
|
|
1558
1871
|
value: "flex-shrink",
|
|
1559
|
-
label: (0,
|
|
1560
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1872
|
+
label: (0, import_i18n16.__)("Shrink", "elementor"),
|
|
1873
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(import_icons12.ShrinkIcon, { fontSize: size }),
|
|
1561
1874
|
showTooltip: true
|
|
1562
1875
|
},
|
|
1563
1876
|
{
|
|
1564
1877
|
value: "custom",
|
|
1565
|
-
label: (0,
|
|
1566
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1878
|
+
label: (0, import_i18n16.__)("Custom", "elementor"),
|
|
1879
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(import_icons12.PencilIcon, { fontSize: size }),
|
|
1567
1880
|
showTooltip: true
|
|
1568
1881
|
}
|
|
1569
1882
|
];
|
|
1570
1883
|
var FlexSizeField = () => {
|
|
1571
1884
|
const { isSiteRtl } = useDirection(), [growField, setGrowField] = useStylesField("flex-grow"), [shrinkField, setShrinkField] = useStylesField("flex-shrink"), [basisField, setBasisField] = useStylesField("flex-basis");
|
|
1572
1885
|
const grow = growField?.value || null, shrink = shrinkField?.value || null, basis = basisField?.value || null;
|
|
1573
|
-
const currentGroup = (0,
|
|
1886
|
+
const currentGroup = (0, import_react13.useMemo)(() => getActiveGroup({ grow, shrink, basis }), [grow, shrink, basis]), [activeGroup, setActiveGroup] = (0, import_react13.useState)(currentGroup);
|
|
1574
1887
|
const onChangeGroup = (group = null) => {
|
|
1575
1888
|
setActiveGroup(group);
|
|
1576
1889
|
setBasisField(null);
|
|
@@ -1587,17 +1900,17 @@ var FlexSizeField = () => {
|
|
|
1587
1900
|
setGrowField(null);
|
|
1588
1901
|
setShrinkField({ $$type: "number", value: DEFAULT });
|
|
1589
1902
|
};
|
|
1590
|
-
return /* @__PURE__ */
|
|
1591
|
-
|
|
1903
|
+
return /* @__PURE__ */ React36.createElement(import_ui26.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React36.createElement(import_ui26.ThemeProvider, null, /* @__PURE__ */ React36.createElement(SectionContent, null, /* @__PURE__ */ React36.createElement(import_ui26.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React36.createElement(import_ui26.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(import_editor_controls19.ControlLabel, null, (0, import_i18n16.__)("Size", "elementor"))), /* @__PURE__ */ React36.createElement(import_ui26.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React36.createElement(
|
|
1904
|
+
import_editor_controls19.ControlToggleButtonGroup,
|
|
1592
1905
|
{
|
|
1593
1906
|
value: activeGroup,
|
|
1594
1907
|
onChange: onChangeGroup,
|
|
1595
1908
|
items: items2,
|
|
1596
1909
|
exclusive: true
|
|
1597
1910
|
}
|
|
1598
|
-
))), "custom" === activeGroup && /* @__PURE__ */
|
|
1911
|
+
))), "custom" === activeGroup && /* @__PURE__ */ React36.createElement(FlexCustomField, null))));
|
|
1599
1912
|
};
|
|
1600
|
-
var FlexCustomField = () => /* @__PURE__ */
|
|
1913
|
+
var FlexCustomField = () => /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(StylesField, { bind: "flex-grow" }, /* @__PURE__ */ React36.createElement(import_ui26.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React36.createElement(import_ui26.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(import_editor_controls19.ControlLabel, null, (0, import_i18n16.__)("Grow", "elementor"))), /* @__PURE__ */ React36.createElement(import_ui26.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React36.createElement(import_editor_controls19.NumberControl, { min: 0, shouldForceInt: true })))), /* @__PURE__ */ React36.createElement(StylesField, { bind: "flex-shrink" }, /* @__PURE__ */ React36.createElement(import_ui26.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React36.createElement(import_ui26.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(import_editor_controls19.ControlLabel, null, (0, import_i18n16.__)("Shrink", "elementor"))), /* @__PURE__ */ React36.createElement(import_ui26.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React36.createElement(import_editor_controls19.NumberControl, { min: 0, shouldForceInt: true })))), /* @__PURE__ */ React36.createElement(StylesField, { bind: "flex-basis" }, /* @__PURE__ */ React36.createElement(import_ui26.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React36.createElement(import_ui26.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(import_editor_controls19.ControlLabel, null, (0, import_i18n16.__)("Basis", "elementor"))), /* @__PURE__ */ React36.createElement(import_ui26.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React36.createElement(import_editor_controls19.SizeControl, { extendedValues: ["auto"] })))));
|
|
1601
1914
|
var getActiveGroup = ({
|
|
1602
1915
|
grow,
|
|
1603
1916
|
shrink,
|
|
@@ -1619,22 +1932,22 @@ var getActiveGroup = ({
|
|
|
1619
1932
|
};
|
|
1620
1933
|
|
|
1621
1934
|
// src/components/style-sections/layout-section/gap-control-field.tsx
|
|
1622
|
-
var
|
|
1623
|
-
var
|
|
1624
|
-
var
|
|
1625
|
-
var
|
|
1935
|
+
var React37 = __toESM(require("react"));
|
|
1936
|
+
var import_editor_controls20 = require("@elementor/editor-controls");
|
|
1937
|
+
var import_ui27 = require("@elementor/ui");
|
|
1938
|
+
var import_i18n17 = require("@wordpress/i18n");
|
|
1626
1939
|
var GapControlField = () => {
|
|
1627
|
-
return /* @__PURE__ */
|
|
1940
|
+
return /* @__PURE__ */ React37.createElement(import_ui27.Stack, { gap: 1 }, /* @__PURE__ */ React37.createElement(StylesField, { bind: "gap" }, /* @__PURE__ */ React37.createElement(import_editor_controls20.GapControl, { label: (0, import_i18n17.__)("Gaps", "elementor") })));
|
|
1628
1941
|
};
|
|
1629
1942
|
|
|
1630
1943
|
// src/components/style-sections/layout-section/justify-content-field.tsx
|
|
1631
|
-
var
|
|
1632
|
-
var
|
|
1633
|
-
var
|
|
1634
|
-
var
|
|
1635
|
-
var
|
|
1636
|
-
var StartIcon3 = (0,
|
|
1637
|
-
var EndIcon3 = (0,
|
|
1944
|
+
var React38 = __toESM(require("react"));
|
|
1945
|
+
var import_editor_controls21 = require("@elementor/editor-controls");
|
|
1946
|
+
var import_icons13 = require("@elementor/icons");
|
|
1947
|
+
var import_ui28 = require("@elementor/ui");
|
|
1948
|
+
var import_i18n18 = require("@wordpress/i18n");
|
|
1949
|
+
var StartIcon3 = (0, import_ui28.withDirection)(import_icons13.JustifyTopIcon);
|
|
1950
|
+
var EndIcon3 = (0, import_ui28.withDirection)(import_icons13.JustifyBottomIcon);
|
|
1638
1951
|
var iconProps3 = {
|
|
1639
1952
|
isClockwise: true,
|
|
1640
1953
|
offset: -90
|
|
@@ -1642,139 +1955,139 @@ var iconProps3 = {
|
|
|
1642
1955
|
var options4 = [
|
|
1643
1956
|
{
|
|
1644
1957
|
value: "start",
|
|
1645
|
-
label: (0,
|
|
1646
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1958
|
+
label: (0, import_i18n18.__)("Start", "elementor"),
|
|
1959
|
+
renderContent: ({ size }) => /* @__PURE__ */ React38.createElement(RotatedIcon, { icon: StartIcon3, size, ...iconProps3 }),
|
|
1647
1960
|
showTooltip: true
|
|
1648
1961
|
},
|
|
1649
1962
|
{
|
|
1650
1963
|
value: "center",
|
|
1651
|
-
label: (0,
|
|
1652
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1964
|
+
label: (0, import_i18n18.__)("Center", "elementor"),
|
|
1965
|
+
renderContent: ({ size }) => /* @__PURE__ */ React38.createElement(RotatedIcon, { icon: import_icons13.JustifyCenterIcon, size, ...iconProps3 }),
|
|
1653
1966
|
showTooltip: true
|
|
1654
1967
|
},
|
|
1655
1968
|
{
|
|
1656
1969
|
value: "end",
|
|
1657
|
-
label: (0,
|
|
1658
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1970
|
+
label: (0, import_i18n18.__)("End", "elementor"),
|
|
1971
|
+
renderContent: ({ size }) => /* @__PURE__ */ React38.createElement(RotatedIcon, { icon: EndIcon3, size, ...iconProps3 }),
|
|
1659
1972
|
showTooltip: true
|
|
1660
1973
|
},
|
|
1661
1974
|
{
|
|
1662
1975
|
value: "space-between",
|
|
1663
|
-
label: (0,
|
|
1664
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1976
|
+
label: (0, import_i18n18.__)("Space between", "elementor"),
|
|
1977
|
+
renderContent: ({ size }) => /* @__PURE__ */ React38.createElement(RotatedIcon, { icon: import_icons13.JustifySpaceBetweenVerticalIcon, size, ...iconProps3 }),
|
|
1665
1978
|
showTooltip: true
|
|
1666
1979
|
},
|
|
1667
1980
|
{
|
|
1668
1981
|
value: "space-around",
|
|
1669
|
-
label: (0,
|
|
1670
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1982
|
+
label: (0, import_i18n18.__)("Space around", "elementor"),
|
|
1983
|
+
renderContent: ({ size }) => /* @__PURE__ */ React38.createElement(RotatedIcon, { icon: import_icons13.JustifySpaceAroundVerticalIcon, size, ...iconProps3 }),
|
|
1671
1984
|
showTooltip: true
|
|
1672
1985
|
},
|
|
1673
1986
|
{
|
|
1674
1987
|
value: "space-evenly",
|
|
1675
|
-
label: (0,
|
|
1676
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1988
|
+
label: (0, import_i18n18.__)("Space evenly", "elementor"),
|
|
1989
|
+
renderContent: ({ size }) => /* @__PURE__ */ React38.createElement(RotatedIcon, { icon: import_icons13.JustifyDistributeVerticalIcon, size, ...iconProps3 }),
|
|
1677
1990
|
showTooltip: true
|
|
1678
1991
|
}
|
|
1679
1992
|
];
|
|
1680
1993
|
var JustifyContentField = () => {
|
|
1681
1994
|
const { isSiteRtl } = useDirection();
|
|
1682
|
-
return /* @__PURE__ */
|
|
1995
|
+
return /* @__PURE__ */ React38.createElement(import_ui28.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React38.createElement(import_ui28.ThemeProvider, null, /* @__PURE__ */ React38.createElement(StylesField, { bind: "justify-content" }, /* @__PURE__ */ React38.createElement(import_ui28.Stack, { gap: 1 }, /* @__PURE__ */ React38.createElement(import_editor_controls21.ControlLabel, null, (0, import_i18n18.__)("Justify content", "elementor")), /* @__PURE__ */ React38.createElement(import_editor_controls21.ToggleControl, { options: options4, fullWidth: true })))));
|
|
1683
1996
|
};
|
|
1684
1997
|
|
|
1685
1998
|
// src/components/style-sections/layout-section/wrap-field.tsx
|
|
1686
|
-
var
|
|
1687
|
-
var
|
|
1688
|
-
var
|
|
1689
|
-
var
|
|
1690
|
-
var
|
|
1999
|
+
var React39 = __toESM(require("react"));
|
|
2000
|
+
var import_editor_controls22 = require("@elementor/editor-controls");
|
|
2001
|
+
var import_icons14 = require("@elementor/icons");
|
|
2002
|
+
var import_ui29 = require("@elementor/ui");
|
|
2003
|
+
var import_i18n19 = require("@wordpress/i18n");
|
|
1691
2004
|
var options5 = [
|
|
1692
2005
|
{
|
|
1693
2006
|
value: "nowrap",
|
|
1694
|
-
label: (0,
|
|
1695
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2007
|
+
label: (0, import_i18n19.__)("No wrap", "elementor"),
|
|
2008
|
+
renderContent: ({ size }) => /* @__PURE__ */ React39.createElement(import_icons14.ArrowRightIcon, { fontSize: size }),
|
|
1696
2009
|
showTooltip: true
|
|
1697
2010
|
},
|
|
1698
2011
|
{
|
|
1699
2012
|
value: "wrap",
|
|
1700
|
-
label: (0,
|
|
1701
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2013
|
+
label: (0, import_i18n19.__)("Wrap", "elementor"),
|
|
2014
|
+
renderContent: ({ size }) => /* @__PURE__ */ React39.createElement(import_icons14.ArrowBackIcon, { fontSize: size }),
|
|
1702
2015
|
showTooltip: true
|
|
1703
2016
|
},
|
|
1704
2017
|
{
|
|
1705
2018
|
value: "wrap-reverse",
|
|
1706
|
-
label: (0,
|
|
1707
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2019
|
+
label: (0, import_i18n19.__)("Reversed wrap", "elementor"),
|
|
2020
|
+
renderContent: ({ size }) => /* @__PURE__ */ React39.createElement(import_icons14.ArrowForwardIcon, { fontSize: size }),
|
|
1708
2021
|
showTooltip: true
|
|
1709
2022
|
}
|
|
1710
2023
|
];
|
|
1711
2024
|
var WrapField = () => {
|
|
1712
2025
|
const { isSiteRtl } = useDirection();
|
|
1713
|
-
return /* @__PURE__ */
|
|
2026
|
+
return /* @__PURE__ */ React39.createElement(import_ui29.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React39.createElement(import_ui29.ThemeProvider, null, /* @__PURE__ */ React39.createElement(StylesField, { bind: "flex-wrap" }, /* @__PURE__ */ React39.createElement(import_ui29.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React39.createElement(import_ui29.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(import_editor_controls22.ControlLabel, null, (0, import_i18n19.__)("Wrap", "elementor"))), /* @__PURE__ */ React39.createElement(import_ui29.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React39.createElement(import_editor_controls22.ToggleControl, { options: options5 }))))));
|
|
1714
2027
|
};
|
|
1715
2028
|
|
|
1716
2029
|
// src/components/style-sections/layout-section/layout-section.tsx
|
|
1717
2030
|
var LayoutSection = () => {
|
|
1718
2031
|
const [display] = useStylesField("display");
|
|
1719
2032
|
const { element } = useElement();
|
|
1720
|
-
const parent = (0,
|
|
2033
|
+
const parent = (0, import_editor_elements6.useParentElement)(element.id);
|
|
1721
2034
|
const parentStyle = useComputedStyle(parent?.id || null);
|
|
1722
|
-
return /* @__PURE__ */
|
|
2035
|
+
return /* @__PURE__ */ React40.createElement(SectionContent, null, /* @__PURE__ */ React40.createElement(DisplayField, null), ("flex" === display?.value || "inline-flex" === display?.value) && /* @__PURE__ */ React40.createElement(FlexFields, null), "flex" === parentStyle?.display && /* @__PURE__ */ React40.createElement(FlexChildFields, null));
|
|
1723
2036
|
};
|
|
1724
|
-
var FlexFields = () => /* @__PURE__ */
|
|
1725
|
-
var FlexChildFields = () => /* @__PURE__ */
|
|
2037
|
+
var FlexFields = () => /* @__PURE__ */ React40.createElement(React40.Fragment, null, /* @__PURE__ */ React40.createElement(FlexDirectionField, null), /* @__PURE__ */ React40.createElement(JustifyContentField, null), /* @__PURE__ */ React40.createElement(AlignItemsField, null), /* @__PURE__ */ React40.createElement(PanelDivider, null), /* @__PURE__ */ React40.createElement(GapControlField, null), /* @__PURE__ */ React40.createElement(WrapField, null));
|
|
2038
|
+
var FlexChildFields = () => /* @__PURE__ */ React40.createElement(React40.Fragment, null, /* @__PURE__ */ React40.createElement(PanelDivider, null), /* @__PURE__ */ React40.createElement(import_editor_controls23.ControlLabel, null, (0, import_i18n20.__)("Flex child", "elementor")), /* @__PURE__ */ React40.createElement(AlignSelfChild, null), /* @__PURE__ */ React40.createElement(FlexOrderField, null), /* @__PURE__ */ React40.createElement(FlexSizeField, null));
|
|
1726
2039
|
|
|
1727
2040
|
// src/components/style-sections/position-section/position-section.tsx
|
|
1728
|
-
var
|
|
2041
|
+
var React44 = __toESM(require("react"));
|
|
1729
2042
|
var import_session2 = require("@elementor/session");
|
|
1730
2043
|
|
|
1731
2044
|
// src/components/style-sections/position-section/dimensions-field.tsx
|
|
1732
|
-
var
|
|
1733
|
-
var
|
|
1734
|
-
var
|
|
1735
|
-
var
|
|
1736
|
-
var
|
|
1737
|
-
var InlineStartIcon2 = (0,
|
|
1738
|
-
var InlineEndIcon2 = (0,
|
|
2045
|
+
var React41 = __toESM(require("react"));
|
|
2046
|
+
var import_editor_controls24 = require("@elementor/editor-controls");
|
|
2047
|
+
var import_icons15 = require("@elementor/icons");
|
|
2048
|
+
var import_ui30 = require("@elementor/ui");
|
|
2049
|
+
var import_i18n21 = require("@wordpress/i18n");
|
|
2050
|
+
var InlineStartIcon2 = (0, import_ui30.withDirection)(import_icons15.SideLeftIcon);
|
|
2051
|
+
var InlineEndIcon2 = (0, import_ui30.withDirection)(import_icons15.SideRightIcon);
|
|
1739
2052
|
var sideIcons = {
|
|
1740
|
-
"inset-block-start": /* @__PURE__ */
|
|
1741
|
-
"inset-block-end": /* @__PURE__ */
|
|
1742
|
-
"inset-inline-start": /* @__PURE__ */
|
|
1743
|
-
"inset-inline-end": /* @__PURE__ */
|
|
2053
|
+
"inset-block-start": /* @__PURE__ */ React41.createElement(import_icons15.SideTopIcon, { fontSize: "tiny" }),
|
|
2054
|
+
"inset-block-end": /* @__PURE__ */ React41.createElement(import_icons15.SideBottomIcon, { fontSize: "tiny" }),
|
|
2055
|
+
"inset-inline-start": /* @__PURE__ */ React41.createElement(RotatedIcon, { icon: InlineStartIcon2, size: "tiny" }),
|
|
2056
|
+
"inset-inline-end": /* @__PURE__ */ React41.createElement(RotatedIcon, { icon: InlineEndIcon2, size: "tiny" })
|
|
1744
2057
|
};
|
|
1745
|
-
var getInlineStartLabel = (isSiteRtl) => isSiteRtl ? (0,
|
|
1746
|
-
var getInlineEndLabel = (isSiteRtl) => isSiteRtl ? (0,
|
|
2058
|
+
var getInlineStartLabel = (isSiteRtl) => isSiteRtl ? (0, import_i18n21.__)("Right", "elementor") : (0, import_i18n21.__)("Left", "elementor");
|
|
2059
|
+
var getInlineEndLabel = (isSiteRtl) => isSiteRtl ? (0, import_i18n21.__)("Left", "elementor") : (0, import_i18n21.__)("Right", "elementor");
|
|
1747
2060
|
var DimensionsField = () => {
|
|
1748
2061
|
const { isSiteRtl } = useDirection();
|
|
1749
|
-
return /* @__PURE__ */
|
|
2062
|
+
return /* @__PURE__ */ React41.createElement(React41.Fragment, null, /* @__PURE__ */ React41.createElement(import_ui30.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React41.createElement(DimensionField, { side: "inset-block-start", label: (0, import_i18n21.__)("Top", "elementor") }), /* @__PURE__ */ React41.createElement(DimensionField, { side: "inset-inline-end", label: getInlineEndLabel(isSiteRtl) })), /* @__PURE__ */ React41.createElement(import_ui30.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React41.createElement(DimensionField, { side: "inset-block-end", label: (0, import_i18n21.__)("Bottom", "elementor") }), /* @__PURE__ */ React41.createElement(DimensionField, { side: "inset-inline-start", label: getInlineStartLabel(isSiteRtl) })));
|
|
1750
2063
|
};
|
|
1751
2064
|
var DimensionField = ({ side, label }) => {
|
|
1752
|
-
return /* @__PURE__ */
|
|
2065
|
+
return /* @__PURE__ */ React41.createElement(import_ui30.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React41.createElement(import_ui30.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React41.createElement(import_editor_controls24.ControlLabel, null, label)), /* @__PURE__ */ React41.createElement(import_ui30.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React41.createElement(StylesField, { bind: side }, /* @__PURE__ */ React41.createElement(import_editor_controls24.SizeControl, { startIcon: sideIcons[side], extendedValues: ["auto"] }))));
|
|
1753
2066
|
};
|
|
1754
2067
|
|
|
1755
2068
|
// src/components/style-sections/position-section/position-field.tsx
|
|
1756
|
-
var
|
|
1757
|
-
var
|
|
1758
|
-
var
|
|
1759
|
-
var
|
|
2069
|
+
var React42 = __toESM(require("react"));
|
|
2070
|
+
var import_editor_controls25 = require("@elementor/editor-controls");
|
|
2071
|
+
var import_ui31 = require("@elementor/ui");
|
|
2072
|
+
var import_i18n22 = require("@wordpress/i18n");
|
|
1760
2073
|
var positionOptions = [
|
|
1761
|
-
{ label: (0,
|
|
1762
|
-
{ label: (0,
|
|
1763
|
-
{ label: (0,
|
|
1764
|
-
{ label: (0,
|
|
1765
|
-
{ label: (0,
|
|
2074
|
+
{ label: (0, import_i18n22.__)("Static", "elementor"), value: "static" },
|
|
2075
|
+
{ label: (0, import_i18n22.__)("Relative", "elementor"), value: "relative" },
|
|
2076
|
+
{ label: (0, import_i18n22.__)("Absolute", "elementor"), value: "absolute" },
|
|
2077
|
+
{ label: (0, import_i18n22.__)("Fixed", "elementor"), value: "fixed" },
|
|
2078
|
+
{ label: (0, import_i18n22.__)("Sticky", "elementor"), value: "sticky" }
|
|
1766
2079
|
];
|
|
1767
2080
|
var PositionField = ({ onChange }) => {
|
|
1768
|
-
return /* @__PURE__ */
|
|
2081
|
+
return /* @__PURE__ */ React42.createElement(StylesField, { bind: "position" }, /* @__PURE__ */ React42.createElement(import_ui31.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React42.createElement(import_ui31.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(import_editor_controls25.ControlLabel, null, (0, import_i18n22.__)("Position", "elementor"))), /* @__PURE__ */ React42.createElement(import_ui31.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React42.createElement(import_editor_controls25.SelectControl, { options: positionOptions, onChange }))));
|
|
1769
2082
|
};
|
|
1770
2083
|
|
|
1771
2084
|
// src/components/style-sections/position-section/z-index-field.tsx
|
|
1772
|
-
var
|
|
1773
|
-
var
|
|
1774
|
-
var
|
|
1775
|
-
var
|
|
2085
|
+
var React43 = __toESM(require("react"));
|
|
2086
|
+
var import_editor_controls26 = require("@elementor/editor-controls");
|
|
2087
|
+
var import_ui32 = require("@elementor/ui");
|
|
2088
|
+
var import_i18n23 = require("@wordpress/i18n");
|
|
1776
2089
|
var ZIndexField = () => {
|
|
1777
|
-
return /* @__PURE__ */
|
|
2090
|
+
return /* @__PURE__ */ React43.createElement(StylesField, { bind: "z-index" }, /* @__PURE__ */ React43.createElement(import_ui32.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React43.createElement(import_ui32.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React43.createElement(import_editor_controls26.ControlLabel, null, (0, import_i18n23.__)("Z-index", "elementor"))), /* @__PURE__ */ React43.createElement(import_ui32.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React43.createElement(import_editor_controls26.NumberControl, null))));
|
|
1778
2091
|
};
|
|
1779
2092
|
|
|
1780
2093
|
// src/components/style-sections/position-section/position-section.tsx
|
|
@@ -1806,7 +2119,7 @@ var PositionSection = () => {
|
|
|
1806
2119
|
}
|
|
1807
2120
|
};
|
|
1808
2121
|
const isNotStatic = positionValue && positionValue?.value !== "static";
|
|
1809
|
-
return /* @__PURE__ */
|
|
2122
|
+
return /* @__PURE__ */ React44.createElement(SectionContent, null, /* @__PURE__ */ React44.createElement(PositionField, { onChange: onPositionChange }), isNotStatic ? /* @__PURE__ */ React44.createElement(React44.Fragment, null, /* @__PURE__ */ React44.createElement(DimensionsField, null), /* @__PURE__ */ React44.createElement(ZIndexField, null)) : null);
|
|
1810
2123
|
};
|
|
1811
2124
|
var usePersistDimensions = () => {
|
|
1812
2125
|
const { id: styleDefID, meta } = useStyle();
|
|
@@ -1816,113 +2129,116 @@ var usePersistDimensions = () => {
|
|
|
1816
2129
|
};
|
|
1817
2130
|
|
|
1818
2131
|
// src/components/style-sections/size-section/size-section.tsx
|
|
1819
|
-
var
|
|
2132
|
+
var React46 = __toESM(require("react"));
|
|
2133
|
+
var import_editor_controls28 = require("@elementor/editor-controls");
|
|
2134
|
+
var import_ui34 = require("@elementor/ui");
|
|
2135
|
+
var import_i18n25 = require("@wordpress/i18n");
|
|
2136
|
+
|
|
2137
|
+
// src/components/style-sections/size-section/overflow-field.tsx
|
|
2138
|
+
var React45 = __toESM(require("react"));
|
|
1820
2139
|
var import_editor_controls27 = require("@elementor/editor-controls");
|
|
2140
|
+
var import_icons16 = require("@elementor/icons");
|
|
1821
2141
|
var import_ui33 = require("@elementor/ui");
|
|
1822
2142
|
var import_i18n24 = require("@wordpress/i18n");
|
|
1823
|
-
|
|
1824
|
-
// src/components/style-sections/size-section/overflow-field.tsx
|
|
1825
|
-
var React43 = __toESM(require("react"));
|
|
1826
|
-
var import_editor_controls26 = require("@elementor/editor-controls");
|
|
1827
|
-
var import_icons15 = require("@elementor/icons");
|
|
1828
|
-
var import_ui32 = require("@elementor/ui");
|
|
1829
|
-
var import_i18n23 = require("@wordpress/i18n");
|
|
1830
2143
|
var options6 = [
|
|
1831
2144
|
{
|
|
1832
2145
|
value: "visible",
|
|
1833
|
-
label: (0,
|
|
1834
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2146
|
+
label: (0, import_i18n24.__)("Visible", "elementor"),
|
|
2147
|
+
renderContent: ({ size }) => /* @__PURE__ */ React45.createElement(import_icons16.EyeIcon, { fontSize: size }),
|
|
1835
2148
|
showTooltip: true
|
|
1836
2149
|
},
|
|
1837
2150
|
{
|
|
1838
2151
|
value: "hidden",
|
|
1839
|
-
label: (0,
|
|
1840
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2152
|
+
label: (0, import_i18n24.__)("Hidden", "elementor"),
|
|
2153
|
+
renderContent: ({ size }) => /* @__PURE__ */ React45.createElement(import_icons16.EyeOffIcon, { fontSize: size }),
|
|
1841
2154
|
showTooltip: true
|
|
1842
2155
|
},
|
|
1843
2156
|
{
|
|
1844
2157
|
value: "auto",
|
|
1845
|
-
label: (0,
|
|
1846
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2158
|
+
label: (0, import_i18n24.__)("Auto", "elementor"),
|
|
2159
|
+
renderContent: ({ size }) => /* @__PURE__ */ React45.createElement(import_icons16.LetterAIcon, { fontSize: size }),
|
|
1847
2160
|
showTooltip: true
|
|
1848
2161
|
}
|
|
1849
2162
|
];
|
|
1850
2163
|
var OverflowField = () => {
|
|
1851
|
-
return /* @__PURE__ */
|
|
2164
|
+
return /* @__PURE__ */ React45.createElement(StylesField, { bind: "overflow" }, /* @__PURE__ */ React45.createElement(import_ui33.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React45.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(import_editor_controls27.ControlLabel, null, (0, import_i18n24.__)("Overflow", "elementor"))), /* @__PURE__ */ React45.createElement(import_ui33.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React45.createElement(import_editor_controls27.ToggleControl, { options: options6 }))));
|
|
1852
2165
|
};
|
|
1853
2166
|
|
|
1854
2167
|
// src/components/style-sections/size-section/size-section.tsx
|
|
1855
2168
|
var SizeSection = () => {
|
|
1856
|
-
return /* @__PURE__ */
|
|
2169
|
+
return /* @__PURE__ */ React46.createElement(SectionContent, null, /* @__PURE__ */ React46.createElement(import_ui34.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React46.createElement(import_ui34.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(SizeField, { bind: "width", label: (0, import_i18n25.__)("Width", "elementor"), extendedValues: ["auto"] })), /* @__PURE__ */ React46.createElement(import_ui34.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(SizeField, { bind: "height", label: (0, import_i18n25.__)("Height", "elementor"), extendedValues: ["auto"] }))), /* @__PURE__ */ React46.createElement(import_ui34.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React46.createElement(import_ui34.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(
|
|
1857
2170
|
SizeField,
|
|
1858
2171
|
{
|
|
1859
2172
|
bind: "min-width",
|
|
1860
|
-
label: (0,
|
|
2173
|
+
label: (0, import_i18n25.__)("Min width", "elementor"),
|
|
1861
2174
|
extendedValues: ["auto"]
|
|
1862
2175
|
}
|
|
1863
|
-
)), /* @__PURE__ */
|
|
2176
|
+
)), /* @__PURE__ */ React46.createElement(import_ui34.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(
|
|
1864
2177
|
SizeField,
|
|
1865
2178
|
{
|
|
1866
2179
|
bind: "min-height",
|
|
1867
|
-
label: (0,
|
|
2180
|
+
label: (0, import_i18n25.__)("Min height", "elementor"),
|
|
1868
2181
|
extendedValues: ["auto"]
|
|
1869
2182
|
}
|
|
1870
|
-
))), /* @__PURE__ */
|
|
2183
|
+
))), /* @__PURE__ */ React46.createElement(import_ui34.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React46.createElement(import_ui34.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(SizeField, { bind: "max-width", label: (0, import_i18n25.__)("Max width", "elementor") })), /* @__PURE__ */ React46.createElement(import_ui34.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(SizeField, { bind: "max-height", label: (0, import_i18n25.__)("Max height", "elementor") }))), /* @__PURE__ */ React46.createElement(PanelDivider, null), /* @__PURE__ */ React46.createElement(import_ui34.Stack, null, /* @__PURE__ */ React46.createElement(OverflowField, null)));
|
|
1871
2184
|
};
|
|
1872
2185
|
var SizeField = ({ label, bind, extendedValues }) => {
|
|
1873
|
-
return /* @__PURE__ */
|
|
2186
|
+
return /* @__PURE__ */ React46.createElement(StylesField, { bind }, /* @__PURE__ */ React46.createElement(import_ui34.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React46.createElement(import_ui34.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React46.createElement(import_editor_controls28.ControlLabel, null, label)), /* @__PURE__ */ React46.createElement(import_ui34.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React46.createElement(import_editor_controls28.SizeControl, { extendedValues }))));
|
|
1874
2187
|
};
|
|
1875
2188
|
|
|
1876
2189
|
// src/components/style-sections/spacing-section/spacing-section.tsx
|
|
1877
|
-
var
|
|
1878
|
-
var
|
|
1879
|
-
var
|
|
2190
|
+
var React47 = __toESM(require("react"));
|
|
2191
|
+
var import_editor_controls29 = require("@elementor/editor-controls");
|
|
2192
|
+
var import_i18n26 = require("@wordpress/i18n");
|
|
1880
2193
|
var SpacingSection = () => {
|
|
1881
2194
|
const { isSiteRtl } = useDirection();
|
|
1882
|
-
return /* @__PURE__ */
|
|
1883
|
-
|
|
2195
|
+
return /* @__PURE__ */ React47.createElement(SectionContent, null, /* @__PURE__ */ React47.createElement(StylesField, { bind: "margin" }, /* @__PURE__ */ React47.createElement(
|
|
2196
|
+
import_editor_controls29.LinkedDimensionsControl,
|
|
1884
2197
|
{
|
|
1885
|
-
label: (0,
|
|
2198
|
+
label: (0, import_i18n26.__)("Margin", "elementor"),
|
|
1886
2199
|
isSiteRtl,
|
|
1887
2200
|
extendedValues: ["auto"]
|
|
1888
2201
|
}
|
|
1889
|
-
)));
|
|
2202
|
+
)), /* @__PURE__ */ React47.createElement(PanelDivider, null), /* @__PURE__ */ React47.createElement(StylesField, { bind: "padding" }, /* @__PURE__ */ React47.createElement(import_editor_controls29.LinkedDimensionsControl, { label: (0, import_i18n26.__)("Padding", "elementor"), isSiteRtl })));
|
|
1890
2203
|
};
|
|
1891
2204
|
|
|
1892
2205
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1893
|
-
var
|
|
2206
|
+
var React62 = __toESM(require("react"));
|
|
1894
2207
|
|
|
1895
2208
|
// src/components/collapsible-content.tsx
|
|
1896
|
-
var
|
|
1897
|
-
var
|
|
1898
|
-
var
|
|
1899
|
-
var
|
|
2209
|
+
var React48 = __toESM(require("react"));
|
|
2210
|
+
var import_react14 = require("react");
|
|
2211
|
+
var import_ui35 = require("@elementor/ui");
|
|
2212
|
+
var import_i18n27 = require("@wordpress/i18n");
|
|
1900
2213
|
var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
1901
|
-
const [open, setOpen] = (0,
|
|
2214
|
+
const [open, setOpen] = (0, import_react14.useState)(defaultOpen);
|
|
1902
2215
|
const handleToggle = () => {
|
|
1903
2216
|
setOpen((prevOpen) => !prevOpen);
|
|
1904
2217
|
};
|
|
1905
|
-
return /* @__PURE__ */
|
|
1906
|
-
|
|
2218
|
+
return /* @__PURE__ */ React48.createElement(import_ui35.Stack, null, /* @__PURE__ */ React48.createElement(
|
|
2219
|
+
import_ui35.Button,
|
|
1907
2220
|
{
|
|
1908
2221
|
fullWidth: true,
|
|
1909
2222
|
size: "small",
|
|
1910
2223
|
color: "secondary",
|
|
1911
2224
|
variant: "outlined",
|
|
1912
2225
|
onClick: handleToggle,
|
|
1913
|
-
endIcon: /* @__PURE__ */
|
|
2226
|
+
endIcon: /* @__PURE__ */ React48.createElement(CollapseIcon, { open }),
|
|
1914
2227
|
sx: { my: 0.5 }
|
|
1915
2228
|
},
|
|
1916
|
-
open ? (0,
|
|
1917
|
-
), /* @__PURE__ */
|
|
2229
|
+
open ? (0, import_i18n27.__)("Show less", "elementor") : (0, import_i18n27.__)("Show more", "elementor")
|
|
2230
|
+
), /* @__PURE__ */ React48.createElement(import_ui35.Collapse, { in: open, timeout: "auto", unmountOnExit: true }, children));
|
|
1918
2231
|
};
|
|
1919
2232
|
|
|
1920
2233
|
// src/components/style-sections/typography-section/font-family-field.tsx
|
|
1921
|
-
var
|
|
1922
|
-
var
|
|
1923
|
-
var
|
|
1924
|
-
var
|
|
1925
|
-
|
|
2234
|
+
var React49 = __toESM(require("react"));
|
|
2235
|
+
var import_editor_controls30 = require("@elementor/editor-controls");
|
|
2236
|
+
var import_ui36 = require("@elementor/ui");
|
|
2237
|
+
var import_i18n29 = require("@wordpress/i18n");
|
|
2238
|
+
|
|
2239
|
+
// src/components/style-sections/typography-section/hooks/use-font-families.ts
|
|
2240
|
+
var import_react15 = require("react");
|
|
2241
|
+
var import_i18n28 = require("@wordpress/i18n");
|
|
1926
2242
|
|
|
1927
2243
|
// src/sync/get-elementor-config.ts
|
|
1928
2244
|
var getElementorConfig = () => {
|
|
@@ -1930,254 +2246,229 @@ var getElementorConfig = () => {
|
|
|
1930
2246
|
return extendedWindow.elementor?.config ?? {};
|
|
1931
2247
|
};
|
|
1932
2248
|
|
|
1933
|
-
// src/components/style-sections/typography-section/font-
|
|
2249
|
+
// src/components/style-sections/typography-section/hooks/use-font-families.ts
|
|
1934
2250
|
var supportedCategories = {
|
|
1935
|
-
system: (0,
|
|
1936
|
-
custom: (0,
|
|
1937
|
-
googlefonts: (0,
|
|
1938
|
-
};
|
|
1939
|
-
var FontFamilyField = () => {
|
|
1940
|
-
const fontFamilies = useFontFamilies();
|
|
1941
|
-
if (Object.keys(fontFamilies).length === 0) {
|
|
1942
|
-
return null;
|
|
1943
|
-
}
|
|
1944
|
-
return /* @__PURE__ */ React47.createElement(StylesField, { bind: "font-family" }, /* @__PURE__ */ React47.createElement(import_ui35.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React47.createElement(import_ui35.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(import_editor_controls29.ControlLabel, null, (0, import_i18n27.__)("Font family", "elementor"))), /* @__PURE__ */ React47.createElement(import_ui35.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React47.createElement(import_editor_controls29.FontFamilyControl, { fontFamilies }))));
|
|
2251
|
+
system: (0, import_i18n28.__)("System", "elementor"),
|
|
2252
|
+
custom: (0, import_i18n28.__)("Custom Fonts", "elementor"),
|
|
2253
|
+
googlefonts: (0, import_i18n28.__)("Google Fonts", "elementor")
|
|
1945
2254
|
};
|
|
1946
2255
|
var getFontFamilies = () => {
|
|
1947
2256
|
const { controls } = getElementorConfig();
|
|
1948
|
-
const
|
|
1949
|
-
if (!
|
|
2257
|
+
const options12 = controls?.font?.options;
|
|
2258
|
+
if (!options12) {
|
|
1950
2259
|
return null;
|
|
1951
2260
|
}
|
|
1952
|
-
return
|
|
2261
|
+
return options12;
|
|
1953
2262
|
};
|
|
1954
2263
|
var useFontFamilies = () => {
|
|
1955
2264
|
const fontFamilies = getFontFamilies();
|
|
1956
|
-
return (0,
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
if (!categoryLabel) {
|
|
2265
|
+
return (0, import_react15.useMemo)(() => {
|
|
2266
|
+
const categoriesOrder = ["system", "custom", "googlefonts"];
|
|
2267
|
+
return Object.entries(fontFamilies || {}).reduce((acc, [font, category]) => {
|
|
2268
|
+
if (!supportedCategories[category]) {
|
|
1961
2269
|
return acc;
|
|
1962
2270
|
}
|
|
1963
|
-
|
|
1964
|
-
|
|
2271
|
+
const categoryIndex = categoriesOrder.indexOf(category);
|
|
2272
|
+
if (!acc[categoryIndex]) {
|
|
2273
|
+
acc[categoryIndex] = {
|
|
2274
|
+
label: supportedCategories[category],
|
|
2275
|
+
fonts: []
|
|
2276
|
+
};
|
|
1965
2277
|
}
|
|
1966
|
-
acc[
|
|
2278
|
+
acc[categoryIndex].fonts.push(font);
|
|
1967
2279
|
return acc;
|
|
1968
|
-
},
|
|
1969
|
-
|
|
1970
|
-
|
|
2280
|
+
}, []).filter(Boolean);
|
|
2281
|
+
}, [fontFamilies]);
|
|
2282
|
+
};
|
|
2283
|
+
|
|
2284
|
+
// src/components/style-sections/typography-section/font-family-field.tsx
|
|
2285
|
+
var FontFamilyField = () => {
|
|
2286
|
+
const fontFamilies = useFontFamilies();
|
|
2287
|
+
if (fontFamilies.length === 0) {
|
|
2288
|
+
return null;
|
|
2289
|
+
}
|
|
2290
|
+
return /* @__PURE__ */ React49.createElement(StylesField, { bind: "font-family" }, /* @__PURE__ */ React49.createElement(import_ui36.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React49.createElement(import_ui36.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(import_editor_controls30.ControlLabel, null, (0, import_i18n29.__)("Font family", "elementor"))), /* @__PURE__ */ React49.createElement(import_ui36.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React49.createElement(import_editor_controls30.FontFamilyControl, { fontFamilies }))));
|
|
1971
2291
|
};
|
|
1972
2292
|
|
|
1973
2293
|
// src/components/style-sections/typography-section/font-size-field.tsx
|
|
1974
|
-
var
|
|
1975
|
-
var
|
|
1976
|
-
var
|
|
1977
|
-
var
|
|
2294
|
+
var React50 = __toESM(require("react"));
|
|
2295
|
+
var import_editor_controls31 = require("@elementor/editor-controls");
|
|
2296
|
+
var import_ui37 = require("@elementor/ui");
|
|
2297
|
+
var import_i18n30 = require("@wordpress/i18n");
|
|
1978
2298
|
var FontSizeField = () => {
|
|
1979
|
-
return /* @__PURE__ */
|
|
2299
|
+
return /* @__PURE__ */ React50.createElement(StylesField, { bind: "font-size" }, /* @__PURE__ */ React50.createElement(import_ui37.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React50.createElement(import_ui37.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React50.createElement(import_editor_controls31.ControlLabel, null, (0, import_i18n30.__)("Font size", "elementor"))), /* @__PURE__ */ React50.createElement(import_ui37.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React50.createElement(import_editor_controls31.SizeControl, null))));
|
|
1980
2300
|
};
|
|
1981
2301
|
|
|
1982
2302
|
// src/components/style-sections/typography-section/font-style-field.tsx
|
|
1983
|
-
var
|
|
1984
|
-
var
|
|
1985
|
-
var
|
|
1986
|
-
var
|
|
1987
|
-
var
|
|
2303
|
+
var React51 = __toESM(require("react"));
|
|
2304
|
+
var import_editor_controls32 = require("@elementor/editor-controls");
|
|
2305
|
+
var import_icons17 = require("@elementor/icons");
|
|
2306
|
+
var import_ui38 = require("@elementor/ui");
|
|
2307
|
+
var import_i18n31 = require("@wordpress/i18n");
|
|
1988
2308
|
var options7 = [
|
|
1989
2309
|
{
|
|
1990
2310
|
value: "normal",
|
|
1991
|
-
label: (0,
|
|
1992
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2311
|
+
label: (0, import_i18n31.__)("Normal", "elementor"),
|
|
2312
|
+
renderContent: ({ size }) => /* @__PURE__ */ React51.createElement(import_icons17.MinusIcon, { fontSize: size }),
|
|
1993
2313
|
showTooltip: true
|
|
1994
2314
|
},
|
|
1995
2315
|
{
|
|
1996
2316
|
value: "italic",
|
|
1997
|
-
label: (0,
|
|
1998
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2317
|
+
label: (0, import_i18n31.__)("Italic", "elementor"),
|
|
2318
|
+
renderContent: ({ size }) => /* @__PURE__ */ React51.createElement(import_icons17.ItalicIcon, { fontSize: size }),
|
|
1999
2319
|
showTooltip: true
|
|
2000
2320
|
}
|
|
2001
2321
|
];
|
|
2002
|
-
var FontStyleField = () => /* @__PURE__ */
|
|
2322
|
+
var FontStyleField = () => /* @__PURE__ */ React51.createElement(StylesField, { bind: "font-style" }, /* @__PURE__ */ React51.createElement(import_ui38.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React51.createElement(import_ui38.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(import_editor_controls32.ControlLabel, null, (0, import_i18n31.__)("Font style", "elementor"))), /* @__PURE__ */ React51.createElement(import_ui38.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React51.createElement(import_editor_controls32.ToggleControl, { options: options7 }))));
|
|
2003
2323
|
|
|
2004
2324
|
// src/components/style-sections/typography-section/font-weight-field.tsx
|
|
2005
|
-
var
|
|
2006
|
-
var
|
|
2007
|
-
var
|
|
2008
|
-
var
|
|
2325
|
+
var React52 = __toESM(require("react"));
|
|
2326
|
+
var import_editor_controls33 = require("@elementor/editor-controls");
|
|
2327
|
+
var import_ui39 = require("@elementor/ui");
|
|
2328
|
+
var import_i18n32 = require("@wordpress/i18n");
|
|
2009
2329
|
var fontWeightOptions = [
|
|
2010
|
-
{ value: "100", label: (0,
|
|
2011
|
-
{ value: "200", label: (0,
|
|
2012
|
-
{ value: "300", label: (0,
|
|
2013
|
-
{ value: "400", label: (0,
|
|
2014
|
-
{ value: "500", label: (0,
|
|
2015
|
-
{ value: "600", label: (0,
|
|
2016
|
-
{ value: "700", label: (0,
|
|
2017
|
-
{ value: "800", label: (0,
|
|
2018
|
-
{ value: "900", label: (0,
|
|
2330
|
+
{ value: "100", label: (0, import_i18n32.__)("100 - Thin", "elementor") },
|
|
2331
|
+
{ value: "200", label: (0, import_i18n32.__)("200 - Extra light", "elementor") },
|
|
2332
|
+
{ value: "300", label: (0, import_i18n32.__)("300 - Light", "elementor") },
|
|
2333
|
+
{ value: "400", label: (0, import_i18n32.__)("400 - Normal", "elementor") },
|
|
2334
|
+
{ value: "500", label: (0, import_i18n32.__)("500 - Medium", "elementor") },
|
|
2335
|
+
{ value: "600", label: (0, import_i18n32.__)("600 - Semi bold", "elementor") },
|
|
2336
|
+
{ value: "700", label: (0, import_i18n32.__)("700 - Bold", "elementor") },
|
|
2337
|
+
{ value: "800", label: (0, import_i18n32.__)("800 - Extra bold", "elementor") },
|
|
2338
|
+
{ value: "900", label: (0, import_i18n32.__)("900 - Black", "elementor") }
|
|
2019
2339
|
];
|
|
2020
2340
|
var FontWeightField = () => {
|
|
2021
|
-
return /* @__PURE__ */
|
|
2341
|
+
return /* @__PURE__ */ React52.createElement(StylesField, { bind: "font-weight" }, /* @__PURE__ */ React52.createElement(import_ui39.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React52.createElement(import_ui39.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React52.createElement(import_editor_controls33.ControlLabel, null, (0, import_i18n32.__)("Font weight", "elementor"))), /* @__PURE__ */ React52.createElement(import_ui39.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React52.createElement(import_editor_controls33.SelectControl, { options: fontWeightOptions }))));
|
|
2022
2342
|
};
|
|
2023
2343
|
|
|
2024
2344
|
// src/components/style-sections/typography-section/letter-spacing-field.tsx
|
|
2025
|
-
var
|
|
2026
|
-
var
|
|
2027
|
-
var
|
|
2028
|
-
var
|
|
2345
|
+
var React53 = __toESM(require("react"));
|
|
2346
|
+
var import_editor_controls34 = require("@elementor/editor-controls");
|
|
2347
|
+
var import_ui40 = require("@elementor/ui");
|
|
2348
|
+
var import_i18n33 = require("@wordpress/i18n");
|
|
2029
2349
|
var LetterSpacingField = () => {
|
|
2030
|
-
return /* @__PURE__ */
|
|
2350
|
+
return /* @__PURE__ */ React53.createElement(StylesField, { bind: "letter-spacing" }, /* @__PURE__ */ React53.createElement(import_ui40.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React53.createElement(import_ui40.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React53.createElement(import_editor_controls34.ControlLabel, null, (0, import_i18n33.__)("Letter spacing", "elementor"))), /* @__PURE__ */ React53.createElement(import_ui40.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React53.createElement(import_editor_controls34.SizeControl, null))));
|
|
2031
2351
|
};
|
|
2032
2352
|
|
|
2033
2353
|
// src/components/style-sections/typography-section/line-height-field.tsx
|
|
2034
|
-
var
|
|
2035
|
-
var
|
|
2036
|
-
var
|
|
2037
|
-
var
|
|
2354
|
+
var React54 = __toESM(require("react"));
|
|
2355
|
+
var import_editor_controls35 = require("@elementor/editor-controls");
|
|
2356
|
+
var import_ui41 = require("@elementor/ui");
|
|
2357
|
+
var import_i18n34 = require("@wordpress/i18n");
|
|
2038
2358
|
var LineHeightField = () => {
|
|
2039
|
-
return /* @__PURE__ */
|
|
2359
|
+
return /* @__PURE__ */ React54.createElement(StylesField, { bind: "line-height" }, /* @__PURE__ */ React54.createElement(import_ui41.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React54.createElement(import_ui41.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(import_editor_controls35.ControlLabel, null, (0, import_i18n34.__)("Line height", "elementor"))), /* @__PURE__ */ React54.createElement(import_ui41.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(import_editor_controls35.SizeControl, null))));
|
|
2040
2360
|
};
|
|
2041
2361
|
|
|
2042
2362
|
// src/components/style-sections/typography-section/text-alignment-field.tsx
|
|
2043
|
-
var
|
|
2044
|
-
var
|
|
2045
|
-
var
|
|
2046
|
-
var
|
|
2047
|
-
var
|
|
2048
|
-
var StartIcon4 = (0,
|
|
2049
|
-
var EndIcon4 = (0,
|
|
2363
|
+
var React55 = __toESM(require("react"));
|
|
2364
|
+
var import_editor_controls36 = require("@elementor/editor-controls");
|
|
2365
|
+
var import_icons18 = require("@elementor/icons");
|
|
2366
|
+
var import_ui42 = require("@elementor/ui");
|
|
2367
|
+
var import_i18n35 = require("@wordpress/i18n");
|
|
2368
|
+
var StartIcon4 = (0, import_ui42.withDirection)(import_icons18.AlignLeftIcon);
|
|
2369
|
+
var EndIcon4 = (0, import_ui42.withDirection)(import_icons18.AlignRightIcon);
|
|
2050
2370
|
var options8 = [
|
|
2051
2371
|
{
|
|
2052
2372
|
value: "start",
|
|
2053
|
-
label: (0,
|
|
2054
|
-
renderContent: () => /* @__PURE__ */
|
|
2373
|
+
label: (0, import_i18n35.__)("Start", "elementor"),
|
|
2374
|
+
renderContent: () => /* @__PURE__ */ React55.createElement(RotatedIcon, { icon: StartIcon4, size: "tiny" }),
|
|
2055
2375
|
showTooltip: true
|
|
2056
2376
|
},
|
|
2057
2377
|
{
|
|
2058
2378
|
value: "center",
|
|
2059
|
-
label: (0,
|
|
2060
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2379
|
+
label: (0, import_i18n35.__)("Center", "elementor"),
|
|
2380
|
+
renderContent: ({ size }) => /* @__PURE__ */ React55.createElement(import_icons18.AlignCenterIcon, { fontSize: size }),
|
|
2061
2381
|
showTooltip: true
|
|
2062
2382
|
},
|
|
2063
2383
|
{
|
|
2064
2384
|
value: "end",
|
|
2065
|
-
label: (0,
|
|
2066
|
-
renderContent: () => /* @__PURE__ */
|
|
2385
|
+
label: (0, import_i18n35.__)("End", "elementor"),
|
|
2386
|
+
renderContent: () => /* @__PURE__ */ React55.createElement(RotatedIcon, { icon: EndIcon4, size: "tiny" }),
|
|
2067
2387
|
showTooltip: true
|
|
2068
2388
|
},
|
|
2069
2389
|
{
|
|
2070
2390
|
value: "justify",
|
|
2071
|
-
label: (0,
|
|
2072
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2391
|
+
label: (0, import_i18n35.__)("Justify", "elementor"),
|
|
2392
|
+
renderContent: ({ size }) => /* @__PURE__ */ React55.createElement(import_icons18.AlignJustifiedIcon, { fontSize: size }),
|
|
2073
2393
|
showTooltip: true
|
|
2074
2394
|
}
|
|
2075
2395
|
];
|
|
2076
2396
|
var TextAlignmentField = () => {
|
|
2077
|
-
return /* @__PURE__ */
|
|
2397
|
+
return /* @__PURE__ */ React55.createElement(StylesField, { bind: "text-align" }, /* @__PURE__ */ React55.createElement(import_ui42.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React55.createElement(import_ui42.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React55.createElement(import_editor_controls36.ControlLabel, null, (0, import_i18n35.__)("Alignment", "elementor"))), /* @__PURE__ */ React55.createElement(import_ui42.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React55.createElement(import_editor_controls36.ToggleControl, { options: options8 }))));
|
|
2078
2398
|
};
|
|
2079
2399
|
|
|
2080
2400
|
// src/components/style-sections/typography-section/text-color-field.tsx
|
|
2081
|
-
var
|
|
2082
|
-
var import_editor_controls36 = require("@elementor/editor-controls");
|
|
2083
|
-
var import_ui42 = require("@elementor/ui");
|
|
2084
|
-
var import_i18n34 = require("@wordpress/i18n");
|
|
2085
|
-
var TextColorField = () => {
|
|
2086
|
-
return /* @__PURE__ */ React54.createElement(StylesField, { bind: "color" }, /* @__PURE__ */ React54.createElement(import_ui42.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React54.createElement(import_ui42.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(import_editor_controls36.ControlLabel, null, (0, import_i18n34.__)("Text color", "elementor"))), /* @__PURE__ */ React54.createElement(import_ui42.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(import_editor_controls36.ColorControl, null))));
|
|
2087
|
-
};
|
|
2088
|
-
|
|
2089
|
-
// src/components/style-sections/typography-section/text-decoration-field.tsx
|
|
2090
|
-
var React55 = __toESM(require("react"));
|
|
2401
|
+
var React56 = __toESM(require("react"));
|
|
2091
2402
|
var import_editor_controls37 = require("@elementor/editor-controls");
|
|
2092
|
-
var import_icons18 = require("@elementor/icons");
|
|
2093
2403
|
var import_ui43 = require("@elementor/ui");
|
|
2094
|
-
var
|
|
2095
|
-
var
|
|
2096
|
-
|
|
2097
|
-
const [textDecoration, setTextDecoration] = useStylesField("text-decoration");
|
|
2098
|
-
const formats = [...(textDecoration?.value || "").split(" ")];
|
|
2099
|
-
const handleSetTextDecoration = (newValue) => {
|
|
2100
|
-
if (newValue === null) {
|
|
2101
|
-
return setTextDecoration(null);
|
|
2102
|
-
}
|
|
2103
|
-
setTextDecoration({
|
|
2104
|
-
$$type: "string",
|
|
2105
|
-
value: newValue
|
|
2106
|
-
});
|
|
2107
|
-
};
|
|
2108
|
-
return /* @__PURE__ */ React55.createElement(import_ui43.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React55.createElement(import_ui43.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React55.createElement(import_editor_controls37.ControlLabel, null, (0, import_i18n35.__)("Style", "elementor"))), /* @__PURE__ */ React55.createElement(import_ui43.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React55.createElement(import_ui43.ToggleButtonGroup, { value: formats }, /* @__PURE__ */ React55.createElement(
|
|
2109
|
-
ShorthandControl,
|
|
2110
|
-
{
|
|
2111
|
-
value: "line-through",
|
|
2112
|
-
currentValues: textDecoration?.value || "",
|
|
2113
|
-
updateValues: handleSetTextDecoration,
|
|
2114
|
-
"aria-label": "line-through"
|
|
2115
|
-
},
|
|
2116
|
-
/* @__PURE__ */ React55.createElement(import_icons18.StrikethroughIcon, { fontSize: buttonSize })
|
|
2117
|
-
), /* @__PURE__ */ React55.createElement(
|
|
2118
|
-
ShorthandControl,
|
|
2119
|
-
{
|
|
2120
|
-
value: "underline",
|
|
2121
|
-
currentValues: textDecoration?.value || "",
|
|
2122
|
-
updateValues: handleSetTextDecoration,
|
|
2123
|
-
"aria-label": "underline"
|
|
2124
|
-
},
|
|
2125
|
-
/* @__PURE__ */ React55.createElement(import_icons18.UnderlineIcon, { fontSize: buttonSize })
|
|
2126
|
-
))));
|
|
2127
|
-
};
|
|
2128
|
-
var ShorthandControl = ({
|
|
2129
|
-
children,
|
|
2130
|
-
value,
|
|
2131
|
-
currentValues,
|
|
2132
|
-
updateValues,
|
|
2133
|
-
"aria-label": ariaLabel
|
|
2134
|
-
}) => {
|
|
2135
|
-
const valuesArr = currentValues.split(" ").filter(Boolean);
|
|
2136
|
-
const selected = valuesArr.includes(value);
|
|
2137
|
-
const toggleValue = (newValue) => {
|
|
2138
|
-
if (selected) {
|
|
2139
|
-
updateValues(valuesArr.filter((v) => v !== newValue).join(" ") || null);
|
|
2140
|
-
} else {
|
|
2141
|
-
updateValues([...valuesArr, newValue].join(" "));
|
|
2142
|
-
}
|
|
2143
|
-
};
|
|
2144
|
-
return /* @__PURE__ */ React55.createElement(ToggleButton, { value, onChange: toggleValue, selected, "aria-label": ariaLabel }, children);
|
|
2145
|
-
};
|
|
2146
|
-
var ToggleButton = ({ onChange, ...props }) => {
|
|
2147
|
-
const handleChange = (_e, newValue) => {
|
|
2148
|
-
onChange(newValue);
|
|
2149
|
-
};
|
|
2150
|
-
return /* @__PURE__ */ React55.createElement(import_ui43.ToggleButton, { ...props, onChange: handleChange, size: buttonSize });
|
|
2404
|
+
var import_i18n36 = require("@wordpress/i18n");
|
|
2405
|
+
var TextColorField = () => {
|
|
2406
|
+
return /* @__PURE__ */ React56.createElement(StylesField, { bind: "color" }, /* @__PURE__ */ React56.createElement(import_ui43.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React56.createElement(import_ui43.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React56.createElement(import_editor_controls37.ControlLabel, null, (0, import_i18n36.__)("Text color", "elementor"))), /* @__PURE__ */ React56.createElement(import_ui43.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React56.createElement(import_editor_controls37.ColorControl, null))));
|
|
2151
2407
|
};
|
|
2152
2408
|
|
|
2153
|
-
// src/components/style-sections/typography-section/text-
|
|
2154
|
-
var
|
|
2409
|
+
// src/components/style-sections/typography-section/text-decoration-field.tsx
|
|
2410
|
+
var React57 = __toESM(require("react"));
|
|
2155
2411
|
var import_editor_controls38 = require("@elementor/editor-controls");
|
|
2156
2412
|
var import_icons19 = require("@elementor/icons");
|
|
2157
2413
|
var import_ui44 = require("@elementor/ui");
|
|
2158
|
-
var
|
|
2414
|
+
var import_i18n37 = require("@wordpress/i18n");
|
|
2159
2415
|
var options9 = [
|
|
2416
|
+
{
|
|
2417
|
+
value: "none",
|
|
2418
|
+
label: (0, import_i18n37.__)("None", "elementor"),
|
|
2419
|
+
renderContent: ({ size }) => /* @__PURE__ */ React57.createElement(import_icons19.MinusIcon, { fontSize: size }),
|
|
2420
|
+
showTooltip: true,
|
|
2421
|
+
exclusive: true
|
|
2422
|
+
},
|
|
2423
|
+
{
|
|
2424
|
+
value: "underline",
|
|
2425
|
+
label: (0, import_i18n37.__)("Underline", "elementor"),
|
|
2426
|
+
renderContent: ({ size }) => /* @__PURE__ */ React57.createElement(import_icons19.UnderlineIcon, { fontSize: size }),
|
|
2427
|
+
showTooltip: true
|
|
2428
|
+
},
|
|
2429
|
+
{
|
|
2430
|
+
value: "line-through",
|
|
2431
|
+
label: (0, import_i18n37.__)("Line-through", "elementor"),
|
|
2432
|
+
renderContent: ({ size }) => /* @__PURE__ */ React57.createElement(import_icons19.StrikethroughIcon, { fontSize: size }),
|
|
2433
|
+
showTooltip: true
|
|
2434
|
+
},
|
|
2435
|
+
{
|
|
2436
|
+
value: "overline",
|
|
2437
|
+
label: (0, import_i18n37.__)("Overline", "elementor"),
|
|
2438
|
+
renderContent: ({ size }) => /* @__PURE__ */ React57.createElement(import_icons19.OverlineIcon, { fontSize: size }),
|
|
2439
|
+
showTooltip: true
|
|
2440
|
+
}
|
|
2441
|
+
];
|
|
2442
|
+
var TextDecorationField = () => /* @__PURE__ */ React57.createElement(StylesField, { bind: "text-decoration" }, /* @__PURE__ */ React57.createElement(import_ui44.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React57.createElement(import_ui44.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(import_editor_controls38.ControlLabel, null, (0, import_i18n37.__)("Line decoration", "elementor"))), /* @__PURE__ */ React57.createElement(import_ui44.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React57.createElement(import_editor_controls38.ToggleControl, { options: options9, exclusive: false }))));
|
|
2443
|
+
|
|
2444
|
+
// src/components/style-sections/typography-section/text-direction-field.tsx
|
|
2445
|
+
var React58 = __toESM(require("react"));
|
|
2446
|
+
var import_editor_controls39 = require("@elementor/editor-controls");
|
|
2447
|
+
var import_icons20 = require("@elementor/icons");
|
|
2448
|
+
var import_ui45 = require("@elementor/ui");
|
|
2449
|
+
var import_i18n38 = require("@wordpress/i18n");
|
|
2450
|
+
var options10 = [
|
|
2160
2451
|
{
|
|
2161
2452
|
value: "ltr",
|
|
2162
|
-
label: (0,
|
|
2163
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2453
|
+
label: (0, import_i18n38.__)("Left to right", "elementor"),
|
|
2454
|
+
renderContent: ({ size }) => /* @__PURE__ */ React58.createElement(import_icons20.TextDirectionLtrIcon, { fontSize: size }),
|
|
2164
2455
|
showTooltip: true
|
|
2165
2456
|
},
|
|
2166
2457
|
{
|
|
2167
2458
|
value: "rtl",
|
|
2168
|
-
label: (0,
|
|
2169
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2459
|
+
label: (0, import_i18n38.__)("Right to left", "elementor"),
|
|
2460
|
+
renderContent: ({ size }) => /* @__PURE__ */ React58.createElement(import_icons20.TextDirectionRtlIcon, { fontSize: size }),
|
|
2170
2461
|
showTooltip: true
|
|
2171
2462
|
}
|
|
2172
2463
|
];
|
|
2173
2464
|
var TextDirectionField = () => {
|
|
2174
|
-
return /* @__PURE__ */
|
|
2465
|
+
return /* @__PURE__ */ React58.createElement(StylesField, { bind: "direction" }, /* @__PURE__ */ React58.createElement(import_ui45.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React58.createElement(import_ui45.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React58.createElement(import_editor_controls39.ControlLabel, null, (0, import_i18n38.__)("Direction", "elementor"))), /* @__PURE__ */ React58.createElement(import_ui45.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React58.createElement(import_editor_controls39.ToggleControl, { options: options10 }))));
|
|
2175
2466
|
};
|
|
2176
2467
|
|
|
2177
2468
|
// src/components/style-sections/typography-section/text-stroke-field.tsx
|
|
2178
|
-
var
|
|
2179
|
-
var
|
|
2180
|
-
var
|
|
2469
|
+
var React59 = __toESM(require("react"));
|
|
2470
|
+
var import_editor_controls40 = require("@elementor/editor-controls");
|
|
2471
|
+
var import_i18n39 = require("@wordpress/i18n");
|
|
2181
2472
|
var initTextStroke = {
|
|
2182
2473
|
$$type: "stroke",
|
|
2183
2474
|
value: {
|
|
@@ -2203,74 +2494,73 @@ var TextStrokeField = () => {
|
|
|
2203
2494
|
setTextStroke(null);
|
|
2204
2495
|
};
|
|
2205
2496
|
const hasTextStroke = Boolean(textStroke);
|
|
2206
|
-
return /* @__PURE__ */
|
|
2497
|
+
return /* @__PURE__ */ React59.createElement(
|
|
2207
2498
|
AddOrRemoveContent,
|
|
2208
2499
|
{
|
|
2209
|
-
label: (0,
|
|
2500
|
+
label: (0, import_i18n39.__)("Text stroke", "elementor"),
|
|
2210
2501
|
isAdded: hasTextStroke,
|
|
2211
2502
|
onAdd: addTextStroke,
|
|
2212
2503
|
onRemove: removeTextStroke
|
|
2213
2504
|
},
|
|
2214
|
-
/* @__PURE__ */
|
|
2505
|
+
/* @__PURE__ */ React59.createElement(StylesField, { bind: "stroke" }, /* @__PURE__ */ React59.createElement(import_editor_controls40.StrokeControl, null))
|
|
2215
2506
|
);
|
|
2216
2507
|
};
|
|
2217
2508
|
|
|
2218
2509
|
// src/components/style-sections/typography-section/transform-field.tsx
|
|
2219
|
-
var
|
|
2220
|
-
var
|
|
2221
|
-
var
|
|
2222
|
-
var
|
|
2223
|
-
var
|
|
2224
|
-
var
|
|
2510
|
+
var React60 = __toESM(require("react"));
|
|
2511
|
+
var import_editor_controls41 = require("@elementor/editor-controls");
|
|
2512
|
+
var import_icons21 = require("@elementor/icons");
|
|
2513
|
+
var import_ui46 = require("@elementor/ui");
|
|
2514
|
+
var import_i18n40 = require("@wordpress/i18n");
|
|
2515
|
+
var options11 = [
|
|
2225
2516
|
{
|
|
2226
2517
|
value: "none",
|
|
2227
|
-
label: (0,
|
|
2228
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2518
|
+
label: (0, import_i18n40.__)("None", "elementor"),
|
|
2519
|
+
renderContent: ({ size }) => /* @__PURE__ */ React60.createElement(import_icons21.MinusIcon, { fontSize: size }),
|
|
2229
2520
|
showTooltip: true
|
|
2230
2521
|
},
|
|
2231
2522
|
{
|
|
2232
2523
|
value: "capitalize",
|
|
2233
|
-
label: (0,
|
|
2234
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2524
|
+
label: (0, import_i18n40.__)("Capitalize", "elementor"),
|
|
2525
|
+
renderContent: ({ size }) => /* @__PURE__ */ React60.createElement(import_icons21.LetterCaseIcon, { fontSize: size }),
|
|
2235
2526
|
showTooltip: true
|
|
2236
2527
|
},
|
|
2237
2528
|
{
|
|
2238
2529
|
value: "uppercase",
|
|
2239
|
-
label: (0,
|
|
2240
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2530
|
+
label: (0, import_i18n40.__)("Uppercase", "elementor"),
|
|
2531
|
+
renderContent: ({ size }) => /* @__PURE__ */ React60.createElement(import_icons21.LetterCaseUpperIcon, { fontSize: size }),
|
|
2241
2532
|
showTooltip: true
|
|
2242
2533
|
},
|
|
2243
2534
|
{
|
|
2244
2535
|
value: "lowercase",
|
|
2245
|
-
label: (0,
|
|
2246
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2536
|
+
label: (0, import_i18n40.__)("Lowercase", "elementor"),
|
|
2537
|
+
renderContent: ({ size }) => /* @__PURE__ */ React60.createElement(import_icons21.LetterCaseLowerIcon, { fontSize: size }),
|
|
2247
2538
|
showTooltip: true
|
|
2248
2539
|
}
|
|
2249
2540
|
];
|
|
2250
|
-
var TransformField = () => /* @__PURE__ */
|
|
2541
|
+
var TransformField = () => /* @__PURE__ */ React60.createElement(StylesField, { bind: "text-transform" }, /* @__PURE__ */ React60.createElement(import_ui46.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React60.createElement(import_ui46.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React60.createElement(import_editor_controls41.ControlLabel, null, (0, import_i18n40.__)("Text transform", "elementor"))), /* @__PURE__ */ React60.createElement(import_ui46.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React60.createElement(import_editor_controls41.ToggleControl, { options: options11 }))));
|
|
2251
2542
|
|
|
2252
2543
|
// src/components/style-sections/typography-section/word-spacing-field.tsx
|
|
2253
|
-
var
|
|
2254
|
-
var
|
|
2255
|
-
var
|
|
2256
|
-
var
|
|
2544
|
+
var React61 = __toESM(require("react"));
|
|
2545
|
+
var import_editor_controls42 = require("@elementor/editor-controls");
|
|
2546
|
+
var import_ui47 = require("@elementor/ui");
|
|
2547
|
+
var import_i18n41 = require("@wordpress/i18n");
|
|
2257
2548
|
var WordSpacingField = () => {
|
|
2258
|
-
return /* @__PURE__ */
|
|
2549
|
+
return /* @__PURE__ */ React61.createElement(StylesField, { bind: "word-spacing" }, /* @__PURE__ */ React61.createElement(import_ui47.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React61.createElement(import_ui47.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React61.createElement(import_editor_controls42.ControlLabel, null, (0, import_i18n41.__)("Word spacing", "elementor"))), /* @__PURE__ */ React61.createElement(import_ui47.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React61.createElement(import_editor_controls42.SizeControl, null))));
|
|
2259
2550
|
};
|
|
2260
2551
|
|
|
2261
2552
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
2262
2553
|
var TypographySection = () => {
|
|
2263
|
-
return /* @__PURE__ */
|
|
2554
|
+
return /* @__PURE__ */ React62.createElement(SectionContent, null, /* @__PURE__ */ React62.createElement(FontFamilyField, null), /* @__PURE__ */ React62.createElement(FontWeightField, null), /* @__PURE__ */ React62.createElement(FontSizeField, null), /* @__PURE__ */ React62.createElement(PanelDivider, null), /* @__PURE__ */ React62.createElement(TextAlignmentField, null), /* @__PURE__ */ React62.createElement(TextColorField, null), /* @__PURE__ */ React62.createElement(CollapsibleContent, null, /* @__PURE__ */ React62.createElement(SectionContent, { sx: { pt: 2 } }, /* @__PURE__ */ React62.createElement(LineHeightField, null), /* @__PURE__ */ React62.createElement(LetterSpacingField, null), /* @__PURE__ */ React62.createElement(WordSpacingField, null), /* @__PURE__ */ React62.createElement(PanelDivider, null), /* @__PURE__ */ React62.createElement(TextDecorationField, null), /* @__PURE__ */ React62.createElement(TransformField, null), /* @__PURE__ */ React62.createElement(TextDirectionField, null), /* @__PURE__ */ React62.createElement(FontStyleField, null), /* @__PURE__ */ React62.createElement(TextStrokeField, null))));
|
|
2264
2555
|
};
|
|
2265
2556
|
|
|
2266
2557
|
// src/components/style-tab.tsx
|
|
2267
|
-
var CLASSES_PROP_KEY = "classes";
|
|
2268
2558
|
var StyleTab = () => {
|
|
2269
2559
|
const currentClassesProp = useCurrentClassesProp();
|
|
2270
2560
|
const [activeStyleDefId, setActiveStyleDefId] = useActiveStyleDefId(currentClassesProp);
|
|
2271
|
-
const [activeStyleState, setActiveStyleState] = (0,
|
|
2272
|
-
const breakpoint = (0,
|
|
2273
|
-
return /* @__PURE__ */
|
|
2561
|
+
const [activeStyleState, setActiveStyleState] = (0, import_react16.useState)(null);
|
|
2562
|
+
const breakpoint = (0, import_editor_responsive2.useActiveBreakpoint)();
|
|
2563
|
+
return /* @__PURE__ */ React63.createElement(ClassesPropProvider, { prop: currentClassesProp }, /* @__PURE__ */ React63.createElement(
|
|
2274
2564
|
StyleProvider,
|
|
2275
2565
|
{
|
|
2276
2566
|
meta: { breakpoint, state: activeStyleState },
|
|
@@ -2281,24 +2571,24 @@ var StyleTab = () => {
|
|
|
2281
2571
|
},
|
|
2282
2572
|
setMetaState: setActiveStyleState
|
|
2283
2573
|
},
|
|
2284
|
-
/* @__PURE__ */
|
|
2574
|
+
/* @__PURE__ */ React63.createElement(import_session3.SessionStorageProvider, { prefix: activeStyleDefId ?? "" }, /* @__PURE__ */ React63.createElement(StyleInheritanceProvider, null, /* @__PURE__ */ React63.createElement(CssClassSelector, null), /* @__PURE__ */ React63.createElement(import_ui48.Divider, null), /* @__PURE__ */ React63.createElement(SectionsList, null, /* @__PURE__ */ React63.createElement(Section, { title: (0, import_i18n42.__)("Layout", "elementor") }, /* @__PURE__ */ React63.createElement(LayoutSection, null)), /* @__PURE__ */ React63.createElement(Section, { title: (0, import_i18n42.__)("Spacing", "elementor") }, /* @__PURE__ */ React63.createElement(SpacingSection, null)), /* @__PURE__ */ React63.createElement(Section, { title: (0, import_i18n42.__)("Size", "elementor") }, /* @__PURE__ */ React63.createElement(SizeSection, null)), /* @__PURE__ */ React63.createElement(Section, { title: (0, import_i18n42.__)("Position", "elementor") }, /* @__PURE__ */ React63.createElement(PositionSection, null)), /* @__PURE__ */ React63.createElement(Section, { title: (0, import_i18n42.__)("Typography", "elementor") }, /* @__PURE__ */ React63.createElement(TypographySection, null)), /* @__PURE__ */ React63.createElement(Section, { title: (0, import_i18n42.__)("Background", "elementor") }, /* @__PURE__ */ React63.createElement(BackgroundSection, null)), /* @__PURE__ */ React63.createElement(Section, { title: (0, import_i18n42.__)("Border", "elementor") }, /* @__PURE__ */ React63.createElement(BorderSection, null)), /* @__PURE__ */ React63.createElement(Section, { title: (0, import_i18n42.__)("Effects", "elementor") }, /* @__PURE__ */ React63.createElement(EffectsSection, null)))))
|
|
2285
2575
|
));
|
|
2286
2576
|
};
|
|
2287
2577
|
function useActiveStyleDefId(currentClassesProp) {
|
|
2288
|
-
const [activeStyledDefId, setActiveStyledDefId] = (0,
|
|
2578
|
+
const [activeStyledDefId, setActiveStyledDefId] = (0, import_react16.useState)(null);
|
|
2289
2579
|
const fallback = useFirstElementStyleDef(currentClassesProp);
|
|
2290
2580
|
return [activeStyledDefId || fallback?.id || null, setActiveStyledDefId];
|
|
2291
2581
|
}
|
|
2292
2582
|
function useFirstElementStyleDef(currentClassesProp) {
|
|
2293
2583
|
const { element } = useElement();
|
|
2294
|
-
const classesIds = (0,
|
|
2295
|
-
const stylesDefs = (0,
|
|
2584
|
+
const classesIds = (0, import_editor_elements7.useElementSetting)(element.id, currentClassesProp)?.value || [];
|
|
2585
|
+
const stylesDefs = (0, import_editor_elements7.getElementStyles)(element.id) ?? {};
|
|
2296
2586
|
return Object.values(stylesDefs).find((styleDef) => classesIds.includes(styleDef.id));
|
|
2297
2587
|
}
|
|
2298
2588
|
function useCurrentClassesProp() {
|
|
2299
2589
|
const { elementType } = useElement();
|
|
2300
2590
|
const prop = Object.entries(elementType.propsSchema).find(
|
|
2301
|
-
([, propType]) => propType.kind === "plain" && propType.key === CLASSES_PROP_KEY
|
|
2591
|
+
([, propType]) => propType.kind === "plain" && propType.key === import_editor_props5.CLASSES_PROP_KEY
|
|
2302
2592
|
);
|
|
2303
2593
|
if (!prop) {
|
|
2304
2594
|
throw new Error("Element does not have a classes prop");
|
|
@@ -2309,25 +2599,25 @@ function useCurrentClassesProp() {
|
|
|
2309
2599
|
// src/components/editing-panel-tabs.tsx
|
|
2310
2600
|
var EditingPanelTabs = () => {
|
|
2311
2601
|
const { element } = useElement();
|
|
2312
|
-
const { getTabProps, getTabPanelProps, getTabsProps } = (0,
|
|
2602
|
+
const { getTabProps, getTabPanelProps, getTabsProps } = (0, import_ui49.useTabs)("settings");
|
|
2313
2603
|
return (
|
|
2314
2604
|
// When switching between elements, the local states should be reset. We are using key to rerender the tabs.
|
|
2315
2605
|
// Reference: https://react.dev/learn/preserving-and-resetting-state#resetting-a-form-with-a-key
|
|
2316
|
-
/* @__PURE__ */
|
|
2606
|
+
/* @__PURE__ */ React64.createElement(import_react17.Fragment, { key: element.id }, /* @__PURE__ */ React64.createElement(import_ui49.Stack, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React64.createElement(import_ui49.Tabs, { variant: "fullWidth", indicatorColor: "secondary", textColor: "inherit", ...getTabsProps() }, /* @__PURE__ */ React64.createElement(import_ui49.Tab, { label: (0, import_i18n43.__)("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React64.createElement(import_ui49.Tab, { label: (0, import_i18n43.__)("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React64.createElement(import_ui49.Divider, null), /* @__PURE__ */ React64.createElement(import_ui49.TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React64.createElement(SettingsTab, null)), /* @__PURE__ */ React64.createElement(import_ui49.TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React64.createElement(StyleTab, null))))
|
|
2317
2607
|
);
|
|
2318
2608
|
};
|
|
2319
2609
|
|
|
2320
2610
|
// src/components/editing-panel.tsx
|
|
2321
2611
|
var { useMenuItems } = controlActionsMenu;
|
|
2322
2612
|
var EditingPanel = () => {
|
|
2323
|
-
const { element, elementType } = (0,
|
|
2613
|
+
const { element, elementType } = (0, import_editor_elements8.useSelectedElement)();
|
|
2324
2614
|
const controlReplacement = getControlReplacement();
|
|
2325
2615
|
const menuItems = useMenuItems().default;
|
|
2326
2616
|
if (!element || !elementType) {
|
|
2327
2617
|
return null;
|
|
2328
2618
|
}
|
|
2329
|
-
const panelTitle = (0,
|
|
2330
|
-
return /* @__PURE__ */
|
|
2619
|
+
const panelTitle = (0, import_i18n44.__)("Edit %s", "elementor").replace("%s", elementType.title);
|
|
2620
|
+
return /* @__PURE__ */ React65.createElement(import_ui50.ErrorBoundary, { fallback: /* @__PURE__ */ React65.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React65.createElement(import_session4.SessionStorageProvider, { prefix: "elementor" }, /* @__PURE__ */ React65.createElement(import_editor_panels.Panel, null, /* @__PURE__ */ React65.createElement(import_editor_panels.PanelHeader, null, /* @__PURE__ */ React65.createElement(import_editor_panels.PanelHeaderTitle, null, panelTitle), /* @__PURE__ */ React65.createElement(import_icons22.AtomIcon, { fontSize: "small", sx: { color: "text.tertiary" } })), /* @__PURE__ */ React65.createElement(import_editor_panels.PanelBody, null, /* @__PURE__ */ React65.createElement(import_editor_controls43.ControlActionsProvider, { items: menuItems }, /* @__PURE__ */ React65.createElement(import_editor_controls43.ControlReplacementProvider, { ...controlReplacement }, /* @__PURE__ */ React65.createElement(ElementProvider, { element, elementType }, /* @__PURE__ */ React65.createElement(EditingPanelTabs, null))))))));
|
|
2331
2621
|
};
|
|
2332
2622
|
|
|
2333
2623
|
// src/panel.ts
|
|
@@ -2338,47 +2628,30 @@ var { panel, usePanelActions, usePanelStatus } = (0, import_editor_panels2.__cre
|
|
|
2338
2628
|
|
|
2339
2629
|
// src/init.ts
|
|
2340
2630
|
var import_editor = require("@elementor/editor");
|
|
2631
|
+
var import_editor_current_user = require("@elementor/editor-current-user");
|
|
2341
2632
|
var import_editor_panels3 = require("@elementor/editor-panels");
|
|
2342
|
-
var
|
|
2633
|
+
var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
|
|
2343
2634
|
|
|
2344
|
-
// src/hooks/use-
|
|
2345
|
-
var
|
|
2346
|
-
var import_editor_elements9 = require("@elementor/editor-elements");
|
|
2635
|
+
// src/hooks/use-open-editor-panel.ts
|
|
2636
|
+
var import_react18 = require("react");
|
|
2347
2637
|
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
2348
2638
|
|
|
2349
2639
|
// src/sync/is-atomic-widget-selected.ts
|
|
2350
|
-
var
|
|
2640
|
+
var import_editor_elements9 = require("@elementor/editor-elements");
|
|
2351
2641
|
var isAtomicWidgetSelected = () => {
|
|
2352
|
-
const selectedElements = (0,
|
|
2353
|
-
const widgetCache = (0,
|
|
2642
|
+
const selectedElements = (0, import_editor_elements9.getSelectedElements)();
|
|
2643
|
+
const widgetCache = (0, import_editor_elements9.getWidgetsCache)();
|
|
2354
2644
|
if (selectedElements.length !== 1) {
|
|
2355
2645
|
return false;
|
|
2356
2646
|
}
|
|
2357
2647
|
return !!widgetCache?.[selectedElements[0].type]?.atomic_controls;
|
|
2358
2648
|
};
|
|
2359
2649
|
|
|
2360
|
-
// src/hooks/use-close-editor-panel.ts
|
|
2361
|
-
var useCloseEditorPanel = () => {
|
|
2362
|
-
const { close } = usePanelActions();
|
|
2363
|
-
return (0, import_react16.useEffect)(() => {
|
|
2364
|
-
return (0, import_editor_v1_adapters3.__privateListenTo)((0, import_editor_v1_adapters3.commandStartEvent)("document/elements/delete"), (e) => {
|
|
2365
|
-
const selectedElement = (0, import_editor_elements9.getSelectedElements)()[0];
|
|
2366
|
-
const { container: deletedContainer } = e?.args;
|
|
2367
|
-
const isSelectedElementInDeletedContainer = deletedContainer && selectedElement && (0, import_editor_elements9.isElementInContainer)(selectedElement, deletedContainer);
|
|
2368
|
-
if (isSelectedElementInDeletedContainer && isAtomicWidgetSelected()) {
|
|
2369
|
-
close();
|
|
2370
|
-
}
|
|
2371
|
-
});
|
|
2372
|
-
}, []);
|
|
2373
|
-
};
|
|
2374
|
-
|
|
2375
2650
|
// src/hooks/use-open-editor-panel.ts
|
|
2376
|
-
var import_react17 = require("react");
|
|
2377
|
-
var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
|
|
2378
2651
|
var useOpenEditorPanel = () => {
|
|
2379
2652
|
const { open } = usePanelActions();
|
|
2380
|
-
(0,
|
|
2381
|
-
return (0,
|
|
2653
|
+
(0, import_react18.useEffect)(() => {
|
|
2654
|
+
return (0, import_editor_v1_adapters3.__privateListenTo)((0, import_editor_v1_adapters3.commandStartEvent)("panel/editor/open"), () => {
|
|
2382
2655
|
if (isAtomicWidgetSelected()) {
|
|
2383
2656
|
open();
|
|
2384
2657
|
}
|
|
@@ -2389,22 +2662,21 @@ var useOpenEditorPanel = () => {
|
|
|
2389
2662
|
// src/components/editing-panel-hooks.tsx
|
|
2390
2663
|
var EditingPanelHooks = () => {
|
|
2391
2664
|
useOpenEditorPanel();
|
|
2392
|
-
useCloseEditorPanel();
|
|
2393
2665
|
return null;
|
|
2394
2666
|
};
|
|
2395
2667
|
|
|
2396
2668
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
2397
|
-
var
|
|
2398
|
-
var
|
|
2399
|
-
var
|
|
2400
|
-
var
|
|
2401
|
-
var
|
|
2402
|
-
var
|
|
2669
|
+
var React69 = __toESM(require("react"));
|
|
2670
|
+
var import_react22 = require("react");
|
|
2671
|
+
var import_editor_controls47 = require("@elementor/editor-controls");
|
|
2672
|
+
var import_icons24 = require("@elementor/icons");
|
|
2673
|
+
var import_ui53 = require("@elementor/ui");
|
|
2674
|
+
var import_i18n46 = require("@wordpress/i18n");
|
|
2403
2675
|
|
|
2404
2676
|
// src/components/popover-content.tsx
|
|
2405
|
-
var
|
|
2406
|
-
var
|
|
2407
|
-
var PopoverContent = ({ alignItems, gap = 1.5, p, children }) => /* @__PURE__ */
|
|
2677
|
+
var React66 = __toESM(require("react"));
|
|
2678
|
+
var import_ui51 = require("@elementor/ui");
|
|
2679
|
+
var PopoverContent = ({ alignItems, gap = 1.5, p, children }) => /* @__PURE__ */ React66.createElement(import_ui51.Stack, { alignItems, gap, p }, children);
|
|
2408
2680
|
|
|
2409
2681
|
// src/hooks/use-persist-dynamic-value.ts
|
|
2410
2682
|
var import_session5 = require("@elementor/session");
|
|
@@ -2415,15 +2687,15 @@ var usePersistDynamicValue = (propKey) => {
|
|
|
2415
2687
|
};
|
|
2416
2688
|
|
|
2417
2689
|
// src/dynamics/dynamic-control.tsx
|
|
2418
|
-
var
|
|
2419
|
-
var
|
|
2690
|
+
var React67 = __toESM(require("react"));
|
|
2691
|
+
var import_editor_controls45 = require("@elementor/editor-controls");
|
|
2420
2692
|
|
|
2421
2693
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
2422
|
-
var
|
|
2694
|
+
var import_react20 = require("react");
|
|
2423
2695
|
|
|
2424
2696
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
2425
|
-
var
|
|
2426
|
-
var
|
|
2697
|
+
var import_react19 = require("react");
|
|
2698
|
+
var import_editor_controls44 = require("@elementor/editor-controls");
|
|
2427
2699
|
|
|
2428
2700
|
// src/dynamics/sync/get-elementor-config.ts
|
|
2429
2701
|
var getElementorConfig2 = () => {
|
|
@@ -2444,7 +2716,7 @@ var getAtomicDynamicTags = () => {
|
|
|
2444
2716
|
};
|
|
2445
2717
|
|
|
2446
2718
|
// src/dynamics/utils.ts
|
|
2447
|
-
var
|
|
2719
|
+
var import_editor_props6 = require("@elementor/editor-props");
|
|
2448
2720
|
var import_schema = require("@elementor/schema");
|
|
2449
2721
|
var DYNAMIC_PROP_TYPE_KEY = "dynamic";
|
|
2450
2722
|
var isDynamicPropType = (prop) => prop.key === DYNAMIC_PROP_TYPE_KEY;
|
|
@@ -2453,12 +2725,12 @@ var getDynamicPropType = (propType) => {
|
|
|
2453
2725
|
return dynamicPropType && isDynamicPropType(dynamicPropType) ? dynamicPropType : null;
|
|
2454
2726
|
};
|
|
2455
2727
|
var isDynamicPropValue = (prop) => {
|
|
2456
|
-
return (0,
|
|
2728
|
+
return (0, import_editor_props6.isTransformable)(prop) && prop.$$type === DYNAMIC_PROP_TYPE_KEY;
|
|
2457
2729
|
};
|
|
2458
2730
|
var supportsDynamic = (propType) => {
|
|
2459
2731
|
return !!getDynamicPropType(propType);
|
|
2460
2732
|
};
|
|
2461
|
-
var dynamicPropTypeUtil = (0,
|
|
2733
|
+
var dynamicPropTypeUtil = (0, import_editor_props6.createPropUtils)(
|
|
2462
2734
|
DYNAMIC_PROP_TYPE_KEY,
|
|
2463
2735
|
import_schema.z.strictObject({
|
|
2464
2736
|
name: import_schema.z.string(),
|
|
@@ -2469,12 +2741,12 @@ var dynamicPropTypeUtil = (0, import_editor_props4.createPropUtils)(
|
|
|
2469
2741
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
2470
2742
|
var usePropDynamicTags = () => {
|
|
2471
2743
|
let categories = [];
|
|
2472
|
-
const { propType } = (0,
|
|
2744
|
+
const { propType } = (0, import_editor_controls44.useBoundProp)();
|
|
2473
2745
|
if (propType) {
|
|
2474
2746
|
const propDynamicType = getDynamicPropType(propType);
|
|
2475
2747
|
categories = propDynamicType?.settings.categories || [];
|
|
2476
2748
|
}
|
|
2477
|
-
return (0,
|
|
2749
|
+
return (0, import_react19.useMemo)(() => getDynamicTagsByCategories(categories), [categories.join()]);
|
|
2478
2750
|
};
|
|
2479
2751
|
var getDynamicTagsByCategories = (categories) => {
|
|
2480
2752
|
const dynamicTags = getAtomicDynamicTags();
|
|
@@ -2490,12 +2762,12 @@ var getDynamicTagsByCategories = (categories) => {
|
|
|
2490
2762
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
2491
2763
|
var useDynamicTag = (tagName) => {
|
|
2492
2764
|
const dynamicTags = usePropDynamicTags();
|
|
2493
|
-
return (0,
|
|
2765
|
+
return (0, import_react20.useMemo)(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
2494
2766
|
};
|
|
2495
2767
|
|
|
2496
2768
|
// src/dynamics/dynamic-control.tsx
|
|
2497
2769
|
var DynamicControl = ({ bind, children }) => {
|
|
2498
|
-
const { value, setValue } = (0,
|
|
2770
|
+
const { value, setValue } = (0, import_editor_controls45.useBoundProp)(dynamicPropTypeUtil);
|
|
2499
2771
|
const { name = "", settings } = value ?? {};
|
|
2500
2772
|
const dynamicTag = useDynamicTag(name);
|
|
2501
2773
|
if (!dynamicTag) {
|
|
@@ -2514,25 +2786,26 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
2514
2786
|
});
|
|
2515
2787
|
};
|
|
2516
2788
|
const propType = createTopLevelOjectType({ schema: dynamicTag.props_schema });
|
|
2517
|
-
return /* @__PURE__ */
|
|
2789
|
+
return /* @__PURE__ */ React67.createElement(import_editor_controls45.PropProvider, { propType, setValue: setDynamicValue, value: { [bind]: dynamicValue } }, /* @__PURE__ */ React67.createElement(import_editor_controls45.PropKeyProvider, { bind }, children));
|
|
2518
2790
|
};
|
|
2519
2791
|
|
|
2520
2792
|
// src/dynamics/components/dynamic-selection.tsx
|
|
2521
|
-
var
|
|
2522
|
-
var
|
|
2523
|
-
var
|
|
2524
|
-
var
|
|
2525
|
-
var
|
|
2526
|
-
var
|
|
2793
|
+
var React68 = __toESM(require("react"));
|
|
2794
|
+
var import_react21 = require("react");
|
|
2795
|
+
var import_editor_controls46 = require("@elementor/editor-controls");
|
|
2796
|
+
var import_icons23 = require("@elementor/icons");
|
|
2797
|
+
var import_ui52 = require("@elementor/ui");
|
|
2798
|
+
var import_i18n45 = require("@wordpress/i18n");
|
|
2527
2799
|
var SIZE3 = "tiny";
|
|
2528
2800
|
var DynamicSelection = ({ onSelect }) => {
|
|
2529
|
-
const [searchValue, setSearchValue] = (0,
|
|
2801
|
+
const [searchValue, setSearchValue] = (0, import_react21.useState)("");
|
|
2530
2802
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
2531
|
-
const { value: anyValue } = (0,
|
|
2532
|
-
const { bind, value: dynamicValue, setValue } = (0,
|
|
2803
|
+
const { value: anyValue } = (0, import_editor_controls46.useBoundProp)();
|
|
2804
|
+
const { bind, value: dynamicValue, setValue } = (0, import_editor_controls46.useBoundProp)(dynamicPropTypeUtil);
|
|
2533
2805
|
const [, updatePropValueHistory] = usePersistDynamicValue(bind);
|
|
2534
2806
|
const isCurrentValueDynamic = !!dynamicValue;
|
|
2535
|
-
const
|
|
2807
|
+
const options12 = useFilteredOptions(searchValue);
|
|
2808
|
+
const hasNoDynamicTags = !options12.length && !searchValue.trim();
|
|
2536
2809
|
const handleSearch = (event) => {
|
|
2537
2810
|
setSearchValue(event.target.value);
|
|
2538
2811
|
};
|
|
@@ -2543,22 +2816,28 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2543
2816
|
setValue({ name: value, settings: {} });
|
|
2544
2817
|
onSelect?.();
|
|
2545
2818
|
};
|
|
2546
|
-
return /* @__PURE__ */
|
|
2547
|
-
|
|
2819
|
+
return /* @__PURE__ */ React68.createElement(import_ui52.Stack, null, hasNoDynamicTags ? /* @__PURE__ */ React68.createElement(NoDynamicTags, null) : /* @__PURE__ */ React68.createElement(import_react21.Fragment, null, /* @__PURE__ */ React68.createElement(import_ui52.Box, { px: 1.5, pb: 1 }, /* @__PURE__ */ React68.createElement(
|
|
2820
|
+
import_ui52.TextField,
|
|
2548
2821
|
{
|
|
2549
2822
|
fullWidth: true,
|
|
2550
2823
|
size: SIZE3,
|
|
2551
2824
|
value: searchValue,
|
|
2552
2825
|
onChange: handleSearch,
|
|
2553
|
-
placeholder: (0,
|
|
2826
|
+
placeholder: (0, import_i18n45.__)("Search dynamic tags\u2026", "elementor"),
|
|
2554
2827
|
InputProps: {
|
|
2555
|
-
startAdornment: /* @__PURE__ */
|
|
2828
|
+
startAdornment: /* @__PURE__ */ React68.createElement(import_ui52.InputAdornment, { position: "start" }, /* @__PURE__ */ React68.createElement(import_icons23.SearchIcon, { fontSize: SIZE3 }))
|
|
2556
2829
|
}
|
|
2557
2830
|
}
|
|
2558
|
-
)), /* @__PURE__ */
|
|
2831
|
+
)), /* @__PURE__ */ React68.createElement(import_ui52.Divider, null), /* @__PURE__ */ React68.createElement(import_ui52.Box, { sx: { overflowY: "auto", height: 260, width: 220 } }, options12.length > 0 ? /* @__PURE__ */ React68.createElement(import_ui52.MenuList, { role: "listbox", tabIndex: 0 }, options12.map(([category, items3], index) => /* @__PURE__ */ React68.createElement(import_react21.Fragment, { key: index }, /* @__PURE__ */ React68.createElement(
|
|
2832
|
+
import_ui52.ListSubheader,
|
|
2833
|
+
{
|
|
2834
|
+
sx: { px: 1.5, typography: "caption", color: "text.tertiary" }
|
|
2835
|
+
},
|
|
2836
|
+
dynamicGroups?.[category]?.title || category
|
|
2837
|
+
), items3.map(({ value, label: tagLabel }) => {
|
|
2559
2838
|
const isSelected = isCurrentValueDynamic && value === dynamicValue?.name;
|
|
2560
|
-
return /* @__PURE__ */
|
|
2561
|
-
|
|
2839
|
+
return /* @__PURE__ */ React68.createElement(
|
|
2840
|
+
import_ui52.MenuItem,
|
|
2562
2841
|
{
|
|
2563
2842
|
key: value,
|
|
2564
2843
|
selected: isSelected,
|
|
@@ -2568,34 +2847,41 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2568
2847
|
},
|
|
2569
2848
|
tagLabel
|
|
2570
2849
|
);
|
|
2571
|
-
})))) : /* @__PURE__ */
|
|
2572
|
-
import_ui51.Stack,
|
|
2573
|
-
{
|
|
2574
|
-
gap: 1,
|
|
2575
|
-
alignItems: "center",
|
|
2576
|
-
justifyContent: "center",
|
|
2577
|
-
height: "100%",
|
|
2578
|
-
p: 2.5,
|
|
2579
|
-
color: "text.secondary",
|
|
2580
|
-
sx: { pb: 3.5 }
|
|
2581
|
-
},
|
|
2582
|
-
/* @__PURE__ */ React66.createElement(import_icons22.DatabaseIcon, { fontSize: "large" }),
|
|
2583
|
-
/* @__PURE__ */ React66.createElement(import_ui51.Typography, { align: "center", variant: "subtitle2" }, (0, import_i18n43.__)("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React66.createElement("br", null), "\u201C", searchValue, "\u201D."),
|
|
2584
|
-
/* @__PURE__ */ React66.createElement(import_ui51.Typography, { align: "center", variant: "caption" }, (0, import_i18n43.__)("Try something else.", "elementor"), "\xA0", /* @__PURE__ */ React66.createElement(
|
|
2585
|
-
import_ui51.Link,
|
|
2586
|
-
{
|
|
2587
|
-
color: "text.secondary",
|
|
2588
|
-
variant: "caption",
|
|
2589
|
-
component: "button",
|
|
2590
|
-
onClick: () => setSearchValue("")
|
|
2591
|
-
},
|
|
2592
|
-
(0, import_i18n43.__)("Clear & try again", "elementor")
|
|
2593
|
-
))
|
|
2594
|
-
)));
|
|
2850
|
+
})))) : /* @__PURE__ */ React68.createElement(NoResults, { searchValue, onClear: () => setSearchValue("") }))));
|
|
2595
2851
|
};
|
|
2852
|
+
var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */ React68.createElement(
|
|
2853
|
+
import_ui52.Stack,
|
|
2854
|
+
{
|
|
2855
|
+
gap: 1,
|
|
2856
|
+
alignItems: "center",
|
|
2857
|
+
justifyContent: "center",
|
|
2858
|
+
height: "100%",
|
|
2859
|
+
p: 2.5,
|
|
2860
|
+
color: "text.secondary",
|
|
2861
|
+
sx: { pb: 3.5 }
|
|
2862
|
+
},
|
|
2863
|
+
/* @__PURE__ */ React68.createElement(import_icons23.DatabaseIcon, { fontSize: "large" }),
|
|
2864
|
+
/* @__PURE__ */ React68.createElement(import_ui52.Typography, { align: "center", variant: "subtitle2" }, (0, import_i18n45.__)("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React68.createElement("br", null), "\u201C", searchValue, "\u201D."),
|
|
2865
|
+
/* @__PURE__ */ React68.createElement(import_ui52.Typography, { align: "center", variant: "caption" }, (0, import_i18n45.__)("Try something else.", "elementor"), "\xA0", /* @__PURE__ */ React68.createElement(import_ui52.Link, { color: "text.secondary", variant: "caption", component: "button", onClick: onClear }, (0, import_i18n45.__)("Clear & try again", "elementor")))
|
|
2866
|
+
);
|
|
2867
|
+
var NoDynamicTags = () => /* @__PURE__ */ React68.createElement(import_ui52.Box, { sx: { overflowY: "hidden", height: 297, width: 220 } }, /* @__PURE__ */ React68.createElement(import_ui52.Divider, null), /* @__PURE__ */ React68.createElement(
|
|
2868
|
+
import_ui52.Stack,
|
|
2869
|
+
{
|
|
2870
|
+
gap: 1,
|
|
2871
|
+
alignItems: "center",
|
|
2872
|
+
justifyContent: "center",
|
|
2873
|
+
height: "100%",
|
|
2874
|
+
p: 2.5,
|
|
2875
|
+
color: "text.secondary",
|
|
2876
|
+
sx: { pb: 3.5 }
|
|
2877
|
+
},
|
|
2878
|
+
/* @__PURE__ */ React68.createElement(import_icons23.DatabaseIcon, { fontSize: "large" }),
|
|
2879
|
+
/* @__PURE__ */ React68.createElement(import_ui52.Typography, { align: "center", variant: "subtitle2" }, (0, import_i18n45.__)("Streamline your workflow with dynamic tags", "elementor")),
|
|
2880
|
+
/* @__PURE__ */ React68.createElement(import_ui52.Typography, { align: "center", variant: "caption" }, (0, import_i18n45.__)("You\u2019ll need Elementor Pro to use this feature.", "elementor"))
|
|
2881
|
+
));
|
|
2596
2882
|
var useFilteredOptions = (searchValue) => {
|
|
2597
2883
|
const dynamicTags = usePropDynamicTags();
|
|
2598
|
-
const
|
|
2884
|
+
const options12 = dynamicTags.reduce((categories, { name, label, group }) => {
|
|
2599
2885
|
const isVisible = label.toLowerCase().includes(searchValue.trim().toLowerCase());
|
|
2600
2886
|
if (!isVisible) {
|
|
2601
2887
|
return categories;
|
|
@@ -2606,18 +2892,18 @@ var useFilteredOptions = (searchValue) => {
|
|
|
2606
2892
|
categories.get(group)?.push({ label, value: name });
|
|
2607
2893
|
return categories;
|
|
2608
2894
|
}, /* @__PURE__ */ new Map());
|
|
2609
|
-
return [...
|
|
2895
|
+
return [...options12];
|
|
2610
2896
|
};
|
|
2611
2897
|
|
|
2612
2898
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
2613
2899
|
var SIZE4 = "tiny";
|
|
2614
2900
|
var DynamicSelectionControl = () => {
|
|
2615
|
-
const { setValue: setAnyValue } = (0,
|
|
2616
|
-
const { bind, value } = (0,
|
|
2901
|
+
const { setValue: setAnyValue } = (0, import_editor_controls47.useBoundProp)();
|
|
2902
|
+
const { bind, value } = (0, import_editor_controls47.useBoundProp)(dynamicPropTypeUtil);
|
|
2617
2903
|
const [propValueFromHistory] = usePersistDynamicValue(bind);
|
|
2618
2904
|
const { name: tagName = "" } = value;
|
|
2619
|
-
const selectionPopoverId = (0,
|
|
2620
|
-
const selectionPopoverState = (0,
|
|
2905
|
+
const selectionPopoverId = (0, import_react22.useId)();
|
|
2906
|
+
const selectionPopoverState = (0, import_ui53.usePopupState)({ variant: "popover", popupId: selectionPopoverId });
|
|
2621
2907
|
const dynamicTag = useDynamicTag(tagName);
|
|
2622
2908
|
const removeDynamicTag = () => {
|
|
2623
2909
|
setAnyValue(propValueFromHistory ?? null);
|
|
@@ -2625,70 +2911,70 @@ var DynamicSelectionControl = () => {
|
|
|
2625
2911
|
if (!dynamicTag) {
|
|
2626
2912
|
throw new Error(`Dynamic tag ${tagName} not found`);
|
|
2627
2913
|
}
|
|
2628
|
-
return /* @__PURE__ */
|
|
2629
|
-
|
|
2914
|
+
return /* @__PURE__ */ React69.createElement(import_ui53.Box, null, /* @__PURE__ */ React69.createElement(
|
|
2915
|
+
import_ui53.UnstableTag,
|
|
2630
2916
|
{
|
|
2631
2917
|
fullWidth: true,
|
|
2632
2918
|
showActionsOnHover: true,
|
|
2633
2919
|
label: dynamicTag.label,
|
|
2634
|
-
startIcon: /* @__PURE__ */
|
|
2635
|
-
...(0,
|
|
2636
|
-
actions: /* @__PURE__ */
|
|
2637
|
-
|
|
2920
|
+
startIcon: /* @__PURE__ */ React69.createElement(import_icons24.DatabaseIcon, { fontSize: SIZE4 }),
|
|
2921
|
+
...(0, import_ui53.bindTrigger)(selectionPopoverState),
|
|
2922
|
+
actions: /* @__PURE__ */ React69.createElement(React69.Fragment, null, /* @__PURE__ */ React69.createElement(DynamicSettingsPopover, { dynamicTag }), /* @__PURE__ */ React69.createElement(
|
|
2923
|
+
import_ui53.IconButton,
|
|
2638
2924
|
{
|
|
2639
2925
|
size: SIZE4,
|
|
2640
2926
|
onClick: removeDynamicTag,
|
|
2641
|
-
"aria-label": (0,
|
|
2927
|
+
"aria-label": (0, import_i18n46.__)("Remove dynamic value", "elementor")
|
|
2642
2928
|
},
|
|
2643
|
-
/* @__PURE__ */
|
|
2929
|
+
/* @__PURE__ */ React69.createElement(import_icons24.XIcon, { fontSize: SIZE4 })
|
|
2644
2930
|
))
|
|
2645
2931
|
}
|
|
2646
|
-
), /* @__PURE__ */
|
|
2647
|
-
|
|
2932
|
+
), /* @__PURE__ */ React69.createElement(
|
|
2933
|
+
import_ui53.Popover,
|
|
2648
2934
|
{
|
|
2649
2935
|
disablePortal: true,
|
|
2650
2936
|
disableScrollLock: true,
|
|
2651
2937
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
2652
|
-
...(0,
|
|
2938
|
+
...(0, import_ui53.bindPopover)(selectionPopoverState)
|
|
2653
2939
|
},
|
|
2654
|
-
/* @__PURE__ */
|
|
2940
|
+
/* @__PURE__ */ React69.createElement(import_ui53.Stack, null, /* @__PURE__ */ React69.createElement(import_ui53.Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React69.createElement(import_icons24.DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React69.createElement(import_ui53.Typography, { variant: "subtitle2" }, (0, import_i18n46.__)("Dynamic tags", "elementor")), /* @__PURE__ */ React69.createElement(import_ui53.IconButton, { size: SIZE4, sx: { ml: "auto" }, onClick: selectionPopoverState.close }, /* @__PURE__ */ React69.createElement(import_icons24.XIcon, { fontSize: SIZE4 }))), /* @__PURE__ */ React69.createElement(DynamicSelection, { onSelect: selectionPopoverState.close }))
|
|
2655
2941
|
));
|
|
2656
2942
|
};
|
|
2657
2943
|
var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
2658
|
-
const popupId = (0,
|
|
2659
|
-
const settingsPopupState = (0,
|
|
2944
|
+
const popupId = (0, import_react22.useId)();
|
|
2945
|
+
const settingsPopupState = (0, import_ui53.usePopupState)({ variant: "popover", popupId });
|
|
2660
2946
|
const hasDynamicSettings = !!dynamicTag.atomic_controls.length;
|
|
2661
2947
|
if (!hasDynamicSettings) {
|
|
2662
2948
|
return null;
|
|
2663
2949
|
}
|
|
2664
|
-
return /* @__PURE__ */
|
|
2665
|
-
|
|
2950
|
+
return /* @__PURE__ */ React69.createElement(React69.Fragment, null, /* @__PURE__ */ React69.createElement(
|
|
2951
|
+
import_ui53.IconButton,
|
|
2666
2952
|
{
|
|
2667
2953
|
size: SIZE4,
|
|
2668
|
-
...(0,
|
|
2669
|
-
"aria-label": (0,
|
|
2954
|
+
...(0, import_ui53.bindTrigger)(settingsPopupState),
|
|
2955
|
+
"aria-label": (0, import_i18n46.__)("Settings", "elementor")
|
|
2670
2956
|
},
|
|
2671
|
-
/* @__PURE__ */
|
|
2672
|
-
), /* @__PURE__ */
|
|
2673
|
-
|
|
2957
|
+
/* @__PURE__ */ React69.createElement(import_icons24.SettingsIcon, { fontSize: SIZE4 })
|
|
2958
|
+
), /* @__PURE__ */ React69.createElement(
|
|
2959
|
+
import_ui53.Popover,
|
|
2674
2960
|
{
|
|
2675
2961
|
disableScrollLock: true,
|
|
2676
2962
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
2677
|
-
...(0,
|
|
2963
|
+
...(0, import_ui53.bindPopover)(settingsPopupState)
|
|
2678
2964
|
},
|
|
2679
|
-
/* @__PURE__ */
|
|
2965
|
+
/* @__PURE__ */ React69.createElement(import_ui53.Paper, { component: import_ui53.Stack, sx: { minHeight: "300px", width: "220px" } }, /* @__PURE__ */ React69.createElement(import_ui53.Stack, { direction: "row", alignItems: "center", px: 1.5, pt: 2, pb: 1 }, /* @__PURE__ */ React69.createElement(import_icons24.DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React69.createElement(import_ui53.Typography, { variant: "subtitle2" }, dynamicTag.label), /* @__PURE__ */ React69.createElement(import_ui53.IconButton, { sx: { ml: "auto" }, size: SIZE4, onClick: settingsPopupState.close }, /* @__PURE__ */ React69.createElement(import_icons24.XIcon, { fontSize: SIZE4 }))), /* @__PURE__ */ React69.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls }))
|
|
2680
2966
|
));
|
|
2681
2967
|
};
|
|
2682
2968
|
var DynamicSettings = ({ controls }) => {
|
|
2683
2969
|
const tabs = controls.filter(({ type }) => type === "section");
|
|
2684
|
-
const { getTabsProps, getTabProps, getTabPanelProps } = (0,
|
|
2970
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui53.useTabs)(0);
|
|
2685
2971
|
if (!tabs.length) {
|
|
2686
2972
|
return null;
|
|
2687
2973
|
}
|
|
2688
|
-
return /* @__PURE__ */
|
|
2689
|
-
return /* @__PURE__ */
|
|
2974
|
+
return /* @__PURE__ */ React69.createElement(React69.Fragment, null, /* @__PURE__ */ React69.createElement(import_ui53.Tabs, { indicatorColor: "secondary", textColor: "secondary", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React69.createElement(import_ui53.Tab, { key: index, label: value.label, sx: { px: 1, py: 0.5 }, ...getTabProps(index) }))), /* @__PURE__ */ React69.createElement(import_ui53.Divider, null), tabs.map(({ value }, index) => {
|
|
2975
|
+
return /* @__PURE__ */ React69.createElement(import_ui53.TabPanel, { key: index, sx: { flexGrow: 1, py: 0 }, ...getTabPanelProps(index) }, /* @__PURE__ */ React69.createElement(PopoverContent, { p: 1.5 }, value.items.map((item) => {
|
|
2690
2976
|
if (item.type === "control") {
|
|
2691
|
-
return /* @__PURE__ */
|
|
2977
|
+
return /* @__PURE__ */ React69.createElement(Control3, { key: item.value.bind, control: item.value });
|
|
2692
2978
|
}
|
|
2693
2979
|
return null;
|
|
2694
2980
|
})));
|
|
@@ -2698,22 +2984,22 @@ var Control3 = ({ control }) => {
|
|
|
2698
2984
|
if (!getControlByType(control.type)) {
|
|
2699
2985
|
return null;
|
|
2700
2986
|
}
|
|
2701
|
-
return /* @__PURE__ */
|
|
2987
|
+
return /* @__PURE__ */ React69.createElement(DynamicControl, { bind: control.bind }, /* @__PURE__ */ React69.createElement(import_ui53.Grid, { container: true, gap: 1 }, control.label ? /* @__PURE__ */ React69.createElement(import_ui53.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React69.createElement(import_editor_controls47.ControlLabel, null, control.label)) : null, /* @__PURE__ */ React69.createElement(import_ui53.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React69.createElement(Control, { type: control.type, props: control.props }))));
|
|
2702
2988
|
};
|
|
2703
2989
|
|
|
2704
2990
|
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
2705
|
-
var
|
|
2706
|
-
var
|
|
2707
|
-
var
|
|
2708
|
-
var
|
|
2991
|
+
var React70 = __toESM(require("react"));
|
|
2992
|
+
var import_editor_controls48 = require("@elementor/editor-controls");
|
|
2993
|
+
var import_icons25 = require("@elementor/icons");
|
|
2994
|
+
var import_i18n47 = require("@wordpress/i18n");
|
|
2709
2995
|
var usePropDynamicAction = () => {
|
|
2710
|
-
const { propType } = (0,
|
|
2996
|
+
const { propType } = (0, import_editor_controls48.useBoundProp)();
|
|
2711
2997
|
const visible = !!propType && supportsDynamic(propType);
|
|
2712
2998
|
return {
|
|
2713
2999
|
visible,
|
|
2714
|
-
icon:
|
|
2715
|
-
title: (0,
|
|
2716
|
-
popoverContent: ({ closePopover }) => /* @__PURE__ */
|
|
3000
|
+
icon: import_icons25.DatabaseIcon,
|
|
3001
|
+
title: (0, import_i18n47.__)("Dynamic tags", "elementor"),
|
|
3002
|
+
popoverContent: ({ closePopover }) => /* @__PURE__ */ React70.createElement(DynamicSelection, { onSelect: closePopover })
|
|
2717
3003
|
};
|
|
2718
3004
|
};
|
|
2719
3005
|
|
|
@@ -2738,10 +3024,14 @@ function init2() {
|
|
|
2738
3024
|
id: "editing-panel-hooks",
|
|
2739
3025
|
component: EditingPanelHooks
|
|
2740
3026
|
});
|
|
3027
|
+
(0, import_editor.injectIntoLogic)({
|
|
3028
|
+
id: "current-user-data",
|
|
3029
|
+
component: import_editor_current_user.PrefetchUserData
|
|
3030
|
+
});
|
|
2741
3031
|
init();
|
|
2742
3032
|
}
|
|
2743
3033
|
var blockV1Panel = () => {
|
|
2744
|
-
(0,
|
|
3034
|
+
(0, import_editor_v1_adapters4.blockCommand)({
|
|
2745
3035
|
command: "panel/editor/open",
|
|
2746
3036
|
condition: isAtomicWidgetSelected
|
|
2747
3037
|
});
|