@elementor/editor-editing-panel 1.1.0 → 1.3.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 +53 -0
- package/dist/index.js +868 -444
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +851 -403
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -14
- package/src/components/css-class-selector.tsx +131 -0
- package/src/components/multi-combobox/multi-combobox.tsx +34 -32
- package/src/components/multi-combobox/types.ts +2 -0
- package/src/components/multi-combobox/use-combobox-actions.ts +4 -4
- package/src/components/style-sections/border-section/border-radius-field.tsx +4 -4
- package/src/components/style-sections/border-section/border-width-field.tsx +4 -4
- package/src/components/style-sections/layout-section/align-items-field.tsx +72 -0
- package/src/components/style-sections/layout-section/align-self-child-field.tsx +72 -0
- package/src/components/style-sections/layout-section/flex-direction-field.tsx +64 -0
- package/src/components/style-sections/layout-section/flex-order-field.tsx +120 -0
- package/src/components/style-sections/layout-section/flex-size-field.tsx +164 -0
- package/src/components/style-sections/layout-section/justify-content-field.tsx +62 -62
- package/src/components/style-sections/layout-section/layout-section.tsx +27 -3
- package/src/components/style-sections/layout-section/utils/rotated-icon.tsx +52 -0
- package/src/components/style-sections/layout-section/wrap-field.tsx +52 -0
- package/src/components/style-sections/position-section/position-section.tsx +3 -3
- package/src/components/style-sections/typography-section/line-height-field.tsx +21 -0
- package/src/components/style-sections/typography-section/text-stroke-field.tsx +41 -6
- package/src/components/style-sections/typography-section/text-style-field.tsx +31 -8
- package/src/components/style-sections/typography-section/typography-section.tsx +3 -1
- package/src/components/style-tab.tsx +2 -2
- package/src/controls-registry/controls-registry.tsx +4 -0
- package/src/dynamics/components/dynamic-selection-control.tsx +8 -5
- package/src/dynamics/components/dynamic-selection.tsx +10 -8
- package/src/dynamics/dynamic-control.tsx +9 -11
- package/src/dynamics/utils.ts +20 -3
- package/src/components/css-class-selector-section.tsx +0 -76
- package/src/components/style-sections/layout-section/utils/rotate-flex-icon.ts +0 -12
package/dist/index.js
CHANGED
|
@@ -31,10 +31,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
33
|
replaceControl: () => replaceControl,
|
|
34
|
-
useBoundProp: () =>
|
|
34
|
+
useBoundProp: () => import_editor_controls46.useBoundProp
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(src_exports);
|
|
37
|
-
var
|
|
37
|
+
var import_editor_controls46 = require("@elementor/editor-controls");
|
|
38
38
|
|
|
39
39
|
// src/control-replacement.tsx
|
|
40
40
|
var import_editor_controls = require("@elementor/editor-controls");
|
|
@@ -46,7 +46,7 @@ var import_editor_panels3 = require("@elementor/editor-panels");
|
|
|
46
46
|
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
47
47
|
|
|
48
48
|
// src/hooks/use-close-editor-panel.ts
|
|
49
|
-
var
|
|
49
|
+
var import_react15 = require("react");
|
|
50
50
|
var import_editor_elements8 = require("@elementor/editor-elements");
|
|
51
51
|
var import_editor_v1_adapters = require("@elementor/editor-v1-adapters");
|
|
52
52
|
|
|
@@ -54,12 +54,12 @@ var import_editor_v1_adapters = require("@elementor/editor-v1-adapters");
|
|
|
54
54
|
var import_editor_panels2 = require("@elementor/editor-panels");
|
|
55
55
|
|
|
56
56
|
// src/components/editing-panel.tsx
|
|
57
|
-
var
|
|
58
|
-
var
|
|
57
|
+
var React58 = __toESM(require("react"));
|
|
58
|
+
var import_editor_controls41 = require("@elementor/editor-controls");
|
|
59
59
|
var import_editor_elements6 = require("@elementor/editor-elements");
|
|
60
60
|
var import_editor_panels = require("@elementor/editor-panels");
|
|
61
|
-
var
|
|
62
|
-
var
|
|
61
|
+
var import_ui50 = require("@elementor/ui");
|
|
62
|
+
var import_i18n38 = require("@wordpress/i18n");
|
|
63
63
|
|
|
64
64
|
// src/contexts/element-context.tsx
|
|
65
65
|
var React = __toESM(require("react"));
|
|
@@ -130,10 +130,10 @@ function EditorPanelErrorFallback() {
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
// src/components/editing-panel-tabs.tsx
|
|
133
|
-
var
|
|
134
|
-
var
|
|
135
|
-
var
|
|
136
|
-
var
|
|
133
|
+
var React57 = __toESM(require("react"));
|
|
134
|
+
var import_react14 = require("react");
|
|
135
|
+
var import_ui49 = require("@elementor/ui");
|
|
136
|
+
var import_i18n37 = require("@wordpress/i18n");
|
|
137
137
|
|
|
138
138
|
// src/components/settings-tab.tsx
|
|
139
139
|
var React9 = __toESM(require("react"));
|
|
@@ -150,7 +150,9 @@ var controlTypes = {
|
|
|
150
150
|
text: { component: import_editor_controls2.TextControl, layout: "two-columns" },
|
|
151
151
|
textarea: { component: import_editor_controls2.TextAreaControl, layout: "full" },
|
|
152
152
|
size: { component: import_editor_controls2.SizeControl, layout: "two-columns" },
|
|
153
|
-
select: { component: import_editor_controls2.SelectControl, layout: "two-columns" }
|
|
153
|
+
select: { component: import_editor_controls2.SelectControl, layout: "two-columns" },
|
|
154
|
+
link: { component: import_editor_controls2.LinkControl, layout: "full" },
|
|
155
|
+
url: { component: import_editor_controls2.UrlControl, layout: "full" }
|
|
154
156
|
};
|
|
155
157
|
var getControlByType = (type) => controlTypes[type]?.component;
|
|
156
158
|
var getLayoutByType = (type) => controlTypes[type].layout;
|
|
@@ -283,13 +285,13 @@ var Control2 = ({ control }) => {
|
|
|
283
285
|
};
|
|
284
286
|
|
|
285
287
|
// src/components/style-tab.tsx
|
|
286
|
-
var
|
|
287
|
-
var
|
|
288
|
+
var React56 = __toESM(require("react"));
|
|
289
|
+
var import_react13 = require("react");
|
|
288
290
|
var import_editor_elements5 = require("@elementor/editor-elements");
|
|
289
291
|
var import_editor_responsive = require("@elementor/editor-responsive");
|
|
290
292
|
var import_editor_styles = require("@elementor/editor-styles");
|
|
291
|
-
var
|
|
292
|
-
var
|
|
293
|
+
var import_ui48 = require("@elementor/ui");
|
|
294
|
+
var import_i18n36 = require("@wordpress/i18n");
|
|
293
295
|
|
|
294
296
|
// src/contexts/classes-prop-context.tsx
|
|
295
297
|
var React10 = __toESM(require("react"));
|
|
@@ -321,9 +323,10 @@ function useStyle() {
|
|
|
321
323
|
return context;
|
|
322
324
|
}
|
|
323
325
|
|
|
324
|
-
// src/components/css-class-selector
|
|
326
|
+
// src/components/css-class-selector.tsx
|
|
325
327
|
var React13 = __toESM(require("react"));
|
|
326
328
|
var import_editor_elements2 = require("@elementor/editor-elements");
|
|
329
|
+
var import_editor_props = require("@elementor/editor-props");
|
|
327
330
|
var import_ui9 = require("@elementor/ui");
|
|
328
331
|
var import_i18n = require("@wordpress/i18n");
|
|
329
332
|
|
|
@@ -333,9 +336,9 @@ var import_ui8 = require("@elementor/ui");
|
|
|
333
336
|
|
|
334
337
|
// src/components/multi-combobox/use-combobox-actions.ts
|
|
335
338
|
var import_ui7 = require("@elementor/ui");
|
|
336
|
-
var useComboboxActions = (applied, actions, optionsLabel,
|
|
339
|
+
var useComboboxActions = (applied, actions, optionsLabel, onSelect) => ({
|
|
337
340
|
action: {
|
|
338
|
-
is: (opt) =>
|
|
341
|
+
is: (opt) => typeof opt !== "string" && "action" in opt,
|
|
339
342
|
getLabel: (option) => option.action.getLabel(option.label),
|
|
340
343
|
groupBy: (option) => option.action.groupLabel,
|
|
341
344
|
onChange: ({ action, label }) => action?.apply(label),
|
|
@@ -355,10 +358,10 @@ var useComboboxActions = (applied, actions, optionsLabel, onApply) => ({
|
|
|
355
358
|
}
|
|
356
359
|
},
|
|
357
360
|
option: {
|
|
358
|
-
is: (opt) => !("action" in opt),
|
|
361
|
+
is: (opt) => typeof opt !== "string" && !("action" in opt),
|
|
359
362
|
getLabel: (option) => option.label,
|
|
360
363
|
groupBy: () => optionsLabel ?? "",
|
|
361
|
-
onChange: (optionValues) =>
|
|
364
|
+
onChange: (optionValues) => onSelect?.(optionValues),
|
|
362
365
|
getFilteredOptions: (optionList, params) => {
|
|
363
366
|
const appliedValues = applied.map((option) => option.value);
|
|
364
367
|
const optionsWithoutApplied = optionList.filter((option) => !appliedValues.includes(option.value));
|
|
@@ -381,24 +384,19 @@ var createActionOption = (groupLabel, action, inputValue) => ({
|
|
|
381
384
|
var MultiCombobox = ({
|
|
382
385
|
actions = {},
|
|
383
386
|
selected,
|
|
384
|
-
options:
|
|
387
|
+
options: options10,
|
|
385
388
|
optionsLabel,
|
|
386
|
-
|
|
389
|
+
onSelect,
|
|
387
390
|
onCreate,
|
|
388
391
|
...props
|
|
389
392
|
}) => {
|
|
390
|
-
const { action: actionProps, option: optionProps } = useComboboxActions(
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
};
|
|
398
|
-
const handleCreateOption = (values) => {
|
|
399
|
-
const value = values.find((option) => typeof option === "string");
|
|
400
|
-
onCreate?.(value);
|
|
401
|
-
};
|
|
393
|
+
const { action: actionProps, option: optionProps } = useComboboxActions(
|
|
394
|
+
selected,
|
|
395
|
+
actions,
|
|
396
|
+
// TODO: make the group mechanism more generic, allow passing list of groups.
|
|
397
|
+
optionsLabel,
|
|
398
|
+
onSelect
|
|
399
|
+
);
|
|
402
400
|
return /* @__PURE__ */ React12.createElement(
|
|
403
401
|
import_ui8.Autocomplete,
|
|
404
402
|
{
|
|
@@ -410,29 +408,36 @@ var MultiCombobox = ({
|
|
|
410
408
|
disableClearable: true,
|
|
411
409
|
handleHomeEndKeys: true,
|
|
412
410
|
value: selected,
|
|
413
|
-
options:
|
|
411
|
+
options: options10,
|
|
414
412
|
renderGroup,
|
|
415
413
|
renderInput: (params) => /* @__PURE__ */ React12.createElement(import_ui8.TextField, { ...params }),
|
|
416
414
|
getLimitTagsText: (more) => /* @__PURE__ */ React12.createElement(import_ui8.Chip, { size: "tiny", variant: "standard", label: `+${more}`, clickable: true }),
|
|
417
|
-
onChange: (_,
|
|
418
|
-
if (reason === "selectOption") {
|
|
419
|
-
return handleSelectOption(values);
|
|
420
|
-
}
|
|
415
|
+
onChange: (_, selectedOrTypedValue, reason) => {
|
|
421
416
|
if (reason === "createOption") {
|
|
422
|
-
|
|
417
|
+
const typedValue = selectedOrTypedValue.find((option) => typeof option === "string");
|
|
418
|
+
return typedValue && onCreate?.(typedValue);
|
|
419
|
+
}
|
|
420
|
+
const action = selectedOrTypedValue.find((value) => actionProps.is(value));
|
|
421
|
+
if (reason === "selectOption" && action) {
|
|
422
|
+
return actionProps.onChange(action);
|
|
423
423
|
}
|
|
424
|
-
|
|
424
|
+
const selectedValues = selectedOrTypedValue.filter((v) => typeof v !== "string");
|
|
425
|
+
const fixedValues = options10.filter((option) => option.fixed);
|
|
426
|
+
optionProps.onChange([.../* @__PURE__ */ new Set([...fixedValues, ...selectedValues])]);
|
|
425
427
|
},
|
|
426
428
|
getOptionLabel: (option) => {
|
|
427
429
|
if (optionProps.is(option)) {
|
|
428
430
|
return optionProps.getLabel(option);
|
|
429
431
|
}
|
|
430
|
-
|
|
432
|
+
if (actionProps.is(option)) {
|
|
433
|
+
return actionProps.getLabel(option);
|
|
434
|
+
}
|
|
435
|
+
return "";
|
|
431
436
|
},
|
|
432
437
|
filterOptions: (optionList, params) => {
|
|
433
|
-
const
|
|
438
|
+
const filteredOptions = optionProps.getFilteredOptions(optionList, params);
|
|
434
439
|
const actionOptions = actionProps.getFilteredActions(optionList, params);
|
|
435
|
-
return [...actionOptions, ...
|
|
440
|
+
return [...actionOptions, ...filteredOptions];
|
|
436
441
|
},
|
|
437
442
|
groupBy: (option) => (optionProps.is(option) ? optionProps.groupBy() : actionProps.groupBy(option)) ?? ""
|
|
438
443
|
}
|
|
@@ -454,36 +459,40 @@ var GroupItems = (0, import_ui8.styled)("ul")`
|
|
|
454
459
|
padding: 0;
|
|
455
460
|
`;
|
|
456
461
|
|
|
457
|
-
// src/components/css-class-selector
|
|
462
|
+
// src/components/css-class-selector.tsx
|
|
458
463
|
var ID = "elementor-css-class-selector";
|
|
459
464
|
var TAGS_LIMIT = 8;
|
|
460
|
-
function
|
|
461
|
-
const
|
|
465
|
+
function CssClassSelector() {
|
|
466
|
+
const options10 = useOptions();
|
|
462
467
|
const { id: activeId, setId: setActiveId } = useStyle();
|
|
463
|
-
const appliedIds = useAppliedClassesIds();
|
|
464
|
-
const
|
|
465
|
-
const
|
|
468
|
+
const [appliedIds] = useAppliedClassesIds();
|
|
469
|
+
const handleApply = useHandleApply();
|
|
470
|
+
const handleActivate = ({ value }) => setActiveId(value);
|
|
471
|
+
const active = options10.find((option) => option.value === activeId) || null;
|
|
472
|
+
const applied = appliedIds.map((id) => options10.find((option) => option.value === id)).filter((option) => !!option);
|
|
466
473
|
return /* @__PURE__ */ React13.createElement(import_ui9.Stack, { gap: 1, p: 2 }, /* @__PURE__ */ React13.createElement(import_ui9.Typography, { component: "label", variant: "caption", htmlFor: ID }, (0, import_i18n.__)("CSS Classes", "elementor")), /* @__PURE__ */ React13.createElement(
|
|
467
474
|
MultiCombobox,
|
|
468
475
|
{
|
|
469
476
|
id: ID,
|
|
470
477
|
size: "tiny",
|
|
471
|
-
options:
|
|
478
|
+
options: options10,
|
|
472
479
|
selected: applied,
|
|
480
|
+
onSelect: handleApply,
|
|
473
481
|
limitTags: TAGS_LIMIT,
|
|
474
482
|
optionsLabel: (0, import_i18n.__)("Global CSS Classes", "elementor"),
|
|
475
|
-
renderTags: (
|
|
483
|
+
renderTags: (values, getTagProps) => values.map((value, index) => {
|
|
476
484
|
const chipProps = getTagProps({ index });
|
|
485
|
+
const isActive = value.value === active?.value;
|
|
477
486
|
return /* @__PURE__ */ React13.createElement(
|
|
478
487
|
import_ui9.Chip,
|
|
479
488
|
{
|
|
480
489
|
...chipProps,
|
|
481
490
|
key: chipProps.key,
|
|
482
491
|
size: "small",
|
|
483
|
-
label:
|
|
484
|
-
variant:
|
|
485
|
-
color:
|
|
486
|
-
onClick: () =>
|
|
492
|
+
label: value.label,
|
|
493
|
+
variant: isActive ? "filled" : "standard",
|
|
494
|
+
color: isActive && value.color ? value.color : "default",
|
|
495
|
+
onClick: () => handleActivate(value),
|
|
487
496
|
onDelete: null
|
|
488
497
|
}
|
|
489
498
|
);
|
|
@@ -491,20 +500,51 @@ function CssClassSelectorSection() {
|
|
|
491
500
|
}
|
|
492
501
|
));
|
|
493
502
|
}
|
|
494
|
-
function useAppliedClassesIds() {
|
|
495
|
-
const { element } = useElement();
|
|
496
|
-
const currentClassesProp = useClassesProp();
|
|
497
|
-
return (0, import_editor_elements2.useElementSetting)(element.id, currentClassesProp)?.value || [];
|
|
498
|
-
}
|
|
499
503
|
function useOptions() {
|
|
500
504
|
const { element } = useElement();
|
|
501
505
|
const styleDefs = (0, import_editor_elements2.useElementStyles)(element.id);
|
|
502
506
|
return Object.values(styleDefs).map((styleDef) => ({
|
|
503
507
|
label: styleDef.label,
|
|
504
508
|
value: styleDef.id,
|
|
509
|
+
fixed: true,
|
|
505
510
|
color: "primary"
|
|
506
511
|
}));
|
|
507
512
|
}
|
|
513
|
+
function useAppliedClassesIds() {
|
|
514
|
+
const { element } = useElement();
|
|
515
|
+
const currentClassesProp = useClassesProp();
|
|
516
|
+
const value = (0, import_editor_elements2.useElementSetting)(element.id, currentClassesProp)?.value || [];
|
|
517
|
+
const setValue = (ids) => {
|
|
518
|
+
(0, import_editor_elements2.updateSettings)({
|
|
519
|
+
id: element.id,
|
|
520
|
+
props: {
|
|
521
|
+
[currentClassesProp]: import_editor_props.classesPropTypeUtil.create(ids)
|
|
522
|
+
}
|
|
523
|
+
});
|
|
524
|
+
};
|
|
525
|
+
return [value, setValue];
|
|
526
|
+
}
|
|
527
|
+
function useHandleApply() {
|
|
528
|
+
const { id: activeId, setId: setActiveId } = useStyle();
|
|
529
|
+
const [appliedIds, setAppliedIds] = useAppliedClassesIds();
|
|
530
|
+
return (selectedOptions) => {
|
|
531
|
+
const selectedValues = selectedOptions.map(({ value }) => value);
|
|
532
|
+
const isSameClassesAlreadyApplied = selectedValues.length === appliedIds.length && selectedValues.every((value) => appliedIds.includes(value));
|
|
533
|
+
if (isSameClassesAlreadyApplied) {
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
setAppliedIds(selectedValues);
|
|
537
|
+
const addedValue = selectedValues.find((id) => !appliedIds.includes(id));
|
|
538
|
+
if (addedValue) {
|
|
539
|
+
setActiveId(addedValue);
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
const removedValue = appliedIds.find((id) => !selectedValues.includes(id));
|
|
543
|
+
if (removedValue && removedValue === activeId) {
|
|
544
|
+
setActiveId(selectedValues[0] ?? null);
|
|
545
|
+
}
|
|
546
|
+
};
|
|
547
|
+
}
|
|
508
548
|
|
|
509
549
|
// src/components/style-sections/background-section/background-section.tsx
|
|
510
550
|
var React16 = __toESM(require("react"));
|
|
@@ -632,6 +672,7 @@ var BorderStyleField = () => {
|
|
|
632
672
|
// src/components/style-sections/border-section/border-width-field.tsx
|
|
633
673
|
var React20 = __toESM(require("react"));
|
|
634
674
|
var import_editor_controls11 = require("@elementor/editor-controls");
|
|
675
|
+
var import_editor_props2 = require("@elementor/editor-props");
|
|
635
676
|
var import_icons4 = require("@elementor/icons");
|
|
636
677
|
var import_i18n5 = require("@wordpress/i18n");
|
|
637
678
|
var edges = [
|
|
@@ -660,10 +701,10 @@ var BorderWidthField = () => {
|
|
|
660
701
|
return /* @__PURE__ */ React20.createElement(StylesField, { bind: "border-width" }, /* @__PURE__ */ React20.createElement(
|
|
661
702
|
import_editor_controls11.EqualUnequalSizesControl,
|
|
662
703
|
{
|
|
704
|
+
items: edges,
|
|
663
705
|
label: (0, import_i18n5.__)("Border Width", "elementor"),
|
|
664
706
|
icon: /* @__PURE__ */ React20.createElement(import_icons4.SideAllIcon, { fontSize: "tiny" }),
|
|
665
|
-
|
|
666
|
-
multiSizeType: "border-width"
|
|
707
|
+
multiSizePropTypeUtil: import_editor_props2.borderWidthPropTypeUtil
|
|
667
708
|
}
|
|
668
709
|
));
|
|
669
710
|
};
|
|
@@ -708,6 +749,7 @@ var BorderField = () => {
|
|
|
708
749
|
// src/components/style-sections/border-section/border-radius-field.tsx
|
|
709
750
|
var React22 = __toESM(require("react"));
|
|
710
751
|
var import_editor_controls12 = require("@elementor/editor-controls");
|
|
752
|
+
var import_editor_props3 = require("@elementor/editor-props");
|
|
711
753
|
var import_icons5 = require("@elementor/icons");
|
|
712
754
|
var import_i18n7 = require("@wordpress/i18n");
|
|
713
755
|
var corners = [
|
|
@@ -736,10 +778,10 @@ var BorderRadiusField = () => {
|
|
|
736
778
|
return /* @__PURE__ */ React22.createElement(StylesField, { bind: "border-radius" }, /* @__PURE__ */ React22.createElement(
|
|
737
779
|
import_editor_controls12.EqualUnequalSizesControl,
|
|
738
780
|
{
|
|
781
|
+
items: corners,
|
|
739
782
|
label: (0, import_i18n7.__)("Border Radius", "elementor"),
|
|
740
783
|
icon: /* @__PURE__ */ React22.createElement(import_icons5.BorderCornersIcon, { fontSize: "tiny" }),
|
|
741
|
-
|
|
742
|
-
multiSizeType: "border-radius"
|
|
784
|
+
multiSizePropTypeUtil: import_editor_props3.borderRadiusPropTypeUtil
|
|
743
785
|
}
|
|
744
786
|
));
|
|
745
787
|
};
|
|
@@ -756,139 +798,476 @@ var EffectsSection = () => {
|
|
|
756
798
|
};
|
|
757
799
|
|
|
758
800
|
// src/components/style-sections/layout-section/layout-section.tsx
|
|
759
|
-
var
|
|
760
|
-
var
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
var React25 = __toESM(require("react"));
|
|
764
|
-
var import_editor_controls14 = require("@elementor/editor-controls");
|
|
765
|
-
var import_ui17 = require("@elementor/ui");
|
|
766
|
-
var import_i18n8 = require("@wordpress/i18n");
|
|
767
|
-
var DisplayField = () => {
|
|
768
|
-
const options5 = [
|
|
769
|
-
{
|
|
770
|
-
value: "block",
|
|
771
|
-
renderContent: () => (0, import_i18n8.__)("Block", "elementor"),
|
|
772
|
-
label: (0, import_i18n8.__)("Block", "elementor")
|
|
773
|
-
},
|
|
774
|
-
{
|
|
775
|
-
value: "flex",
|
|
776
|
-
renderContent: () => (0, import_i18n8.__)("Flex", "elementor"),
|
|
777
|
-
label: (0, import_i18n8.__)("Flex", "elementor")
|
|
778
|
-
}
|
|
779
|
-
];
|
|
780
|
-
return /* @__PURE__ */ React25.createElement(StylesField, { bind: "display" }, /* @__PURE__ */ React25.createElement(import_ui17.Stack, { gap: 1 }, /* @__PURE__ */ React25.createElement(import_editor_controls14.ControlLabel, null, (0, import_i18n8.__)("Display", "elementor")), /* @__PURE__ */ React25.createElement(import_editor_controls14.ToggleControl, { options: options5, fullWidth: true })));
|
|
781
|
-
};
|
|
801
|
+
var React34 = __toESM(require("react"));
|
|
802
|
+
var import_editor_controls22 = require("@elementor/editor-controls");
|
|
803
|
+
var import_ui27 = require("@elementor/ui");
|
|
804
|
+
var import_i18n16 = require("@wordpress/i18n");
|
|
782
805
|
|
|
783
|
-
// src/components/style-sections/layout-section/
|
|
806
|
+
// src/components/style-sections/layout-section/align-items-field.tsx
|
|
784
807
|
var React26 = __toESM(require("react"));
|
|
785
|
-
var
|
|
808
|
+
var import_editor_controls14 = require("@elementor/editor-controls");
|
|
786
809
|
var import_icons6 = require("@elementor/icons");
|
|
787
810
|
var import_ui19 = require("@elementor/ui");
|
|
788
|
-
var
|
|
811
|
+
var import_i18n8 = require("@wordpress/i18n");
|
|
789
812
|
|
|
790
813
|
// src/hooks/use-direction.ts
|
|
791
|
-
var
|
|
814
|
+
var import_ui17 = require("@elementor/ui");
|
|
792
815
|
function useDirection() {
|
|
793
|
-
const theme = (0,
|
|
816
|
+
const theme = (0, import_ui17.useTheme)(), extendedWindow = window;
|
|
794
817
|
const isUiRtl = "rtl" === theme.direction, isSiteRtl = !!extendedWindow.elementorFrontend?.config?.is_rtl;
|
|
795
818
|
return { isSiteRtl, isUiRtl };
|
|
796
819
|
}
|
|
797
820
|
|
|
798
|
-
// src/components/style-sections/layout-section/utils/
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
821
|
+
// src/components/style-sections/layout-section/utils/rotated-icon.tsx
|
|
822
|
+
var React25 = __toESM(require("react"));
|
|
823
|
+
var import_react7 = require("react");
|
|
824
|
+
var import_ui18 = require("@elementor/ui");
|
|
825
|
+
var CLOCKWISE_ANGLES = {
|
|
826
|
+
row: 0,
|
|
827
|
+
column: 90,
|
|
828
|
+
"row-reverse": 180,
|
|
829
|
+
"column-reverse": 270
|
|
830
|
+
};
|
|
831
|
+
var COUNTER_CLOCKWISE_ANGLES = {
|
|
832
|
+
row: 0,
|
|
833
|
+
column: -90,
|
|
834
|
+
"row-reverse": -180,
|
|
835
|
+
"column-reverse": -270
|
|
836
|
+
};
|
|
837
|
+
var RotatedIcon = ({ icon: Icon, size, isClockwise = true, offset = 0 }) => {
|
|
838
|
+
const rotate = (0, import_react7.useRef)(useGetTargetAngle(isClockwise, offset));
|
|
839
|
+
rotate.current = useGetTargetAngle(isClockwise, offset, rotate);
|
|
840
|
+
return /* @__PURE__ */ React25.createElement(Icon, { fontSize: size, sx: { transition: ".3s", rotate: `${rotate.current}deg` } });
|
|
841
|
+
};
|
|
842
|
+
var useGetTargetAngle = (isClockwise, offset, existingRef) => {
|
|
812
843
|
const [direction] = useStylesField("flex-direction");
|
|
813
|
-
const
|
|
814
|
-
const
|
|
815
|
-
const
|
|
844
|
+
const isRtl = "rtl" === (0, import_ui18.useTheme)().direction;
|
|
845
|
+
const rotationMultiplier = isRtl ? -1 : 1;
|
|
846
|
+
const angleMap = isClockwise ? CLOCKWISE_ANGLES : COUNTER_CLOCKWISE_ANGLES;
|
|
847
|
+
const currentAngle = existingRef ? existingRef.current * rotationMultiplier : angleMap[direction?.value || "row"] + offset;
|
|
848
|
+
const targetAngle = angleMap[direction?.value || "row"] + offset;
|
|
849
|
+
const diffToTargetAngle = (targetAngle - currentAngle + 360) % 360;
|
|
850
|
+
const formattedDiff = (diffToTargetAngle + 180) % 360 - 180;
|
|
851
|
+
return (currentAngle + formattedDiff) * rotationMultiplier;
|
|
852
|
+
};
|
|
853
|
+
|
|
854
|
+
// src/components/style-sections/layout-section/align-items-field.tsx
|
|
855
|
+
var StartIcon = (0, import_ui19.withDirection)(import_icons6.LayoutAlignLeftIcon);
|
|
856
|
+
var EndIcon = (0, import_ui19.withDirection)(import_icons6.LayoutAlignRightIcon);
|
|
857
|
+
var iconProps = {
|
|
858
|
+
isClockwise: false,
|
|
859
|
+
offset: 90
|
|
860
|
+
};
|
|
861
|
+
var options = [
|
|
862
|
+
{
|
|
863
|
+
value: "start",
|
|
864
|
+
label: (0, import_i18n8.__)("Start", "elementor"),
|
|
865
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(RotatedIcon, { icon: StartIcon, size, ...iconProps }),
|
|
866
|
+
showTooltip: true
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
value: "center",
|
|
870
|
+
label: (0, import_i18n8.__)("Center", "elementor"),
|
|
871
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(RotatedIcon, { icon: import_icons6.LayoutAlignCenterIcon, size, ...iconProps }),
|
|
872
|
+
showTooltip: true
|
|
873
|
+
},
|
|
874
|
+
{
|
|
875
|
+
value: "end",
|
|
876
|
+
label: (0, import_i18n8.__)("End", "elementor"),
|
|
877
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(RotatedIcon, { icon: EndIcon, size, ...iconProps }),
|
|
878
|
+
showTooltip: true
|
|
879
|
+
},
|
|
880
|
+
{
|
|
881
|
+
value: "stretch",
|
|
882
|
+
label: (0, import_i18n8.__)("Stretch", "elementor"),
|
|
883
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(RotatedIcon, { icon: import_icons6.LayoutDistributeVerticalIcon, size, ...iconProps }),
|
|
884
|
+
showTooltip: true
|
|
885
|
+
}
|
|
886
|
+
];
|
|
887
|
+
var AlignItemsField = () => {
|
|
888
|
+
const { isSiteRtl } = useDirection();
|
|
889
|
+
return /* @__PURE__ */ React26.createElement(import_ui19.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React26.createElement(import_ui19.ThemeProvider, null, /* @__PURE__ */ React26.createElement(StylesField, { bind: "align-items" }, /* @__PURE__ */ React26.createElement(import_ui19.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React26.createElement(import_ui19.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React26.createElement(import_editor_controls14.ControlLabel, null, (0, import_i18n8.__)("Align items", "elementor"))), /* @__PURE__ */ React26.createElement(import_ui19.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React26.createElement(import_editor_controls14.ToggleControl, { options }))))));
|
|
890
|
+
};
|
|
891
|
+
|
|
892
|
+
// src/components/style-sections/layout-section/align-self-child-field.tsx
|
|
893
|
+
var React27 = __toESM(require("react"));
|
|
894
|
+
var import_editor_controls15 = require("@elementor/editor-controls");
|
|
895
|
+
var import_icons7 = require("@elementor/icons");
|
|
896
|
+
var import_ui20 = require("@elementor/ui");
|
|
897
|
+
var import_i18n9 = require("@wordpress/i18n");
|
|
898
|
+
var StartIcon2 = (0, import_ui20.withDirection)(import_icons7.LayoutAlignLeftIcon);
|
|
899
|
+
var EndIcon2 = (0, import_ui20.withDirection)(import_icons7.LayoutAlignRightIcon);
|
|
900
|
+
var iconProps2 = {
|
|
901
|
+
isClockwise: false,
|
|
902
|
+
offset: 90
|
|
903
|
+
};
|
|
904
|
+
var options2 = [
|
|
905
|
+
{
|
|
906
|
+
value: "start",
|
|
907
|
+
label: (0, import_i18n9.__)("Start", "elementor"),
|
|
908
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: StartIcon2, size, ...iconProps2 }),
|
|
909
|
+
showTooltip: true
|
|
910
|
+
},
|
|
911
|
+
{
|
|
912
|
+
value: "center",
|
|
913
|
+
label: (0, import_i18n9.__)("Center", "elementor"),
|
|
914
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: import_icons7.LayoutAlignCenterIcon, size, ...iconProps2 }),
|
|
915
|
+
showTooltip: true
|
|
916
|
+
},
|
|
917
|
+
{
|
|
918
|
+
value: "end",
|
|
919
|
+
label: (0, import_i18n9.__)("End", "elementor"),
|
|
920
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: EndIcon2, size, ...iconProps2 }),
|
|
921
|
+
showTooltip: true
|
|
922
|
+
},
|
|
923
|
+
{
|
|
924
|
+
value: "stretch",
|
|
925
|
+
label: (0, import_i18n9.__)("Stretch", "elementor"),
|
|
926
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: import_icons7.LayoutDistributeVerticalIcon, size, ...iconProps2 }),
|
|
927
|
+
showTooltip: true
|
|
928
|
+
}
|
|
929
|
+
];
|
|
930
|
+
var AlignSelfChild = () => {
|
|
931
|
+
const { isSiteRtl } = useDirection();
|
|
932
|
+
return /* @__PURE__ */ React27.createElement(import_ui20.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React27.createElement(import_ui20.ThemeProvider, null, /* @__PURE__ */ React27.createElement(StylesField, { bind: "align-self" }, /* @__PURE__ */ React27.createElement(import_ui20.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React27.createElement(import_ui20.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React27.createElement(import_editor_controls15.ControlLabel, null, (0, import_i18n9.__)("Align self", "elementor"))), /* @__PURE__ */ React27.createElement(import_ui20.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React27.createElement(import_editor_controls15.ToggleControl, { options: options2 }))))));
|
|
933
|
+
};
|
|
934
|
+
|
|
935
|
+
// src/components/style-sections/layout-section/display-field.tsx
|
|
936
|
+
var React28 = __toESM(require("react"));
|
|
937
|
+
var import_editor_controls16 = require("@elementor/editor-controls");
|
|
938
|
+
var import_ui21 = require("@elementor/ui");
|
|
939
|
+
var import_i18n10 = require("@wordpress/i18n");
|
|
940
|
+
var DisplayField = () => {
|
|
941
|
+
const options10 = [
|
|
816
942
|
{
|
|
817
|
-
value: "
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
showTooltip: true
|
|
943
|
+
value: "block",
|
|
944
|
+
renderContent: () => (0, import_i18n10.__)("Block", "elementor"),
|
|
945
|
+
label: (0, import_i18n10.__)("Block", "elementor")
|
|
821
946
|
},
|
|
822
947
|
{
|
|
823
|
-
value: "
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
948
|
+
value: "flex",
|
|
949
|
+
renderContent: () => (0, import_i18n10.__)("Flex", "elementor"),
|
|
950
|
+
label: (0, import_i18n10.__)("Flex", "elementor")
|
|
951
|
+
}
|
|
952
|
+
];
|
|
953
|
+
return /* @__PURE__ */ React28.createElement(StylesField, { bind: "display" }, /* @__PURE__ */ React28.createElement(import_ui21.Stack, { gap: 1 }, /* @__PURE__ */ React28.createElement(import_editor_controls16.ControlLabel, null, (0, import_i18n10.__)("Display", "elementor")), /* @__PURE__ */ React28.createElement(import_editor_controls16.ToggleControl, { options: options10, fullWidth: true })));
|
|
954
|
+
};
|
|
955
|
+
|
|
956
|
+
// src/components/style-sections/layout-section/flex-direction-field.tsx
|
|
957
|
+
var React29 = __toESM(require("react"));
|
|
958
|
+
var import_editor_controls17 = require("@elementor/editor-controls");
|
|
959
|
+
var import_icons8 = require("@elementor/icons");
|
|
960
|
+
var import_ui22 = require("@elementor/ui");
|
|
961
|
+
var import_i18n11 = require("@wordpress/i18n");
|
|
962
|
+
var options3 = [
|
|
963
|
+
{
|
|
964
|
+
value: "row",
|
|
965
|
+
label: (0, import_i18n11.__)("Row", "elementor"),
|
|
966
|
+
renderContent: ({ size }) => {
|
|
967
|
+
const StartIcon4 = (0, import_ui22.withDirection)(import_icons8.ArrowRightIcon);
|
|
968
|
+
return /* @__PURE__ */ React29.createElement(StartIcon4, { fontSize: size });
|
|
827
969
|
},
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
970
|
+
showTooltip: true
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
value: "column",
|
|
974
|
+
label: (0, import_i18n11.__)("Column", "elementor"),
|
|
975
|
+
renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(import_icons8.ArrowDownSmallIcon, { fontSize: size }),
|
|
976
|
+
showTooltip: true
|
|
977
|
+
},
|
|
978
|
+
{
|
|
979
|
+
value: "row-reverse",
|
|
980
|
+
label: (0, import_i18n11.__)("Reversed row", "elementor"),
|
|
981
|
+
renderContent: ({ size }) => {
|
|
982
|
+
const EndIcon4 = (0, import_ui22.withDirection)(import_icons8.ArrowLeftIcon);
|
|
983
|
+
return /* @__PURE__ */ React29.createElement(EndIcon4, { fontSize: size });
|
|
833
984
|
},
|
|
985
|
+
showTooltip: true
|
|
986
|
+
},
|
|
987
|
+
{
|
|
988
|
+
value: "column-reverse",
|
|
989
|
+
label: (0, import_i18n11.__)("Reversed column", "elementor"),
|
|
990
|
+
renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(import_icons8.ArrowUpSmallIcon, { fontSize: size }),
|
|
991
|
+
showTooltip: true
|
|
992
|
+
}
|
|
993
|
+
];
|
|
994
|
+
var FlexDirectionField = () => {
|
|
995
|
+
const { isSiteRtl } = useDirection();
|
|
996
|
+
return /* @__PURE__ */ React29.createElement(import_ui22.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React29.createElement(import_ui22.ThemeProvider, null, /* @__PURE__ */ React29.createElement(StylesField, { bind: "flex-direction" }, /* @__PURE__ */ React29.createElement(import_ui22.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React29.createElement(import_ui22.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React29.createElement(import_editor_controls17.ControlLabel, null, (0, import_i18n11.__)("Direction", "elementor"))), /* @__PURE__ */ React29.createElement(import_ui22.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React29.createElement(import_editor_controls17.ToggleControl, { options: options3 }))))));
|
|
997
|
+
};
|
|
998
|
+
|
|
999
|
+
// src/components/style-sections/layout-section/flex-order-field.tsx
|
|
1000
|
+
var React30 = __toESM(require("react"));
|
|
1001
|
+
var import_react8 = require("react");
|
|
1002
|
+
var import_editor_controls18 = require("@elementor/editor-controls");
|
|
1003
|
+
var import_icons9 = require("@elementor/icons");
|
|
1004
|
+
var import_ui23 = require("@elementor/ui");
|
|
1005
|
+
var import_i18n12 = require("@wordpress/i18n");
|
|
1006
|
+
var FIRST_DEFAULT_VALUE = -99999;
|
|
1007
|
+
var LAST_DEFAULT_VALUE = 99999;
|
|
1008
|
+
var FIRST = "first";
|
|
1009
|
+
var LAST = "last";
|
|
1010
|
+
var CUSTOM = "custom";
|
|
1011
|
+
var orderValueMap = {
|
|
1012
|
+
[FIRST]: FIRST_DEFAULT_VALUE,
|
|
1013
|
+
[LAST]: LAST_DEFAULT_VALUE
|
|
1014
|
+
};
|
|
1015
|
+
var items = [
|
|
1016
|
+
{
|
|
1017
|
+
value: FIRST,
|
|
1018
|
+
label: (0, import_i18n12.__)("First", "elementor"),
|
|
1019
|
+
renderContent: ({ size }) => /* @__PURE__ */ React30.createElement(import_icons9.ArrowUpSmallIcon, { fontSize: size }),
|
|
1020
|
+
showTooltip: true
|
|
1021
|
+
},
|
|
1022
|
+
{
|
|
1023
|
+
value: LAST,
|
|
1024
|
+
label: (0, import_i18n12.__)("Last", "elementor"),
|
|
1025
|
+
renderContent: ({ size }) => /* @__PURE__ */ React30.createElement(import_icons9.ArrowDownSmallIcon, { fontSize: size }),
|
|
1026
|
+
showTooltip: true
|
|
1027
|
+
},
|
|
1028
|
+
{
|
|
1029
|
+
value: CUSTOM,
|
|
1030
|
+
label: (0, import_i18n12.__)("Custom", "elementor"),
|
|
1031
|
+
renderContent: ({ size }) => /* @__PURE__ */ React30.createElement(import_icons9.PencilIcon, { fontSize: size }),
|
|
1032
|
+
showTooltip: true
|
|
1033
|
+
}
|
|
1034
|
+
];
|
|
1035
|
+
var FlexOrderField = () => {
|
|
1036
|
+
const { isSiteRtl } = useDirection(), [order, setOrder] = useStylesField("order");
|
|
1037
|
+
const [groupControlValue, setGroupControlValue] = (0, import_react8.useState)(getGroupControlValue(order?.value || null));
|
|
1038
|
+
const handleToggleButtonChange = (group) => {
|
|
1039
|
+
setGroupControlValue(group);
|
|
1040
|
+
if (!group || group === CUSTOM) {
|
|
1041
|
+
setOrder(null);
|
|
1042
|
+
return;
|
|
1043
|
+
}
|
|
1044
|
+
setOrder({ $$type: "number", value: orderValueMap[group] });
|
|
1045
|
+
};
|
|
1046
|
+
return /* @__PURE__ */ React30.createElement(import_ui23.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React30.createElement(import_ui23.ThemeProvider, null, /* @__PURE__ */ React30.createElement(import_ui23.Stack, { gap: 2 }, /* @__PURE__ */ React30.createElement(import_ui23.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React30.createElement(import_ui23.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(import_editor_controls18.ControlLabel, null, (0, import_i18n12.__)("Order", "elementor"))), /* @__PURE__ */ React30.createElement(import_ui23.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React30.createElement(
|
|
1047
|
+
import_editor_controls18.ControlToggleButtonGroup,
|
|
834
1048
|
{
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
}
|
|
1049
|
+
items,
|
|
1050
|
+
value: groupControlValue,
|
|
1051
|
+
onChange: handleToggleButtonChange,
|
|
1052
|
+
exclusive: true
|
|
1053
|
+
}
|
|
1054
|
+
))), CUSTOM === groupControlValue && /* @__PURE__ */ React30.createElement(StylesField, { bind: "order" }, /* @__PURE__ */ React30.createElement(import_ui23.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React30.createElement(import_ui23.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(import_editor_controls18.ControlLabel, null, (0, import_i18n12.__)("Custom order", "elementor"))), /* @__PURE__ */ React30.createElement(import_ui23.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React30.createElement(
|
|
1055
|
+
import_editor_controls18.NumberControl,
|
|
840
1056
|
{
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
1057
|
+
min: FIRST_DEFAULT_VALUE + 1,
|
|
1058
|
+
max: LAST_DEFAULT_VALUE - 1,
|
|
1059
|
+
shouldForceInt: true
|
|
1060
|
+
}
|
|
1061
|
+
)))))));
|
|
1062
|
+
};
|
|
1063
|
+
var getGroupControlValue = (order) => {
|
|
1064
|
+
if (LAST_DEFAULT_VALUE === order) {
|
|
1065
|
+
return LAST;
|
|
1066
|
+
}
|
|
1067
|
+
if (FIRST_DEFAULT_VALUE === order) {
|
|
1068
|
+
return FIRST;
|
|
1069
|
+
}
|
|
1070
|
+
return 0 === order || order ? CUSTOM : null;
|
|
1071
|
+
};
|
|
1072
|
+
|
|
1073
|
+
// src/components/style-sections/layout-section/flex-size-field.tsx
|
|
1074
|
+
var React31 = __toESM(require("react"));
|
|
1075
|
+
var import_editor_controls19 = require("@elementor/editor-controls");
|
|
1076
|
+
var import_icons10 = require("@elementor/icons");
|
|
1077
|
+
var import_ui24 = require("@elementor/ui");
|
|
1078
|
+
var import_i18n13 = require("@wordpress/i18n");
|
|
1079
|
+
var DEFAULT = 1;
|
|
1080
|
+
var items2 = [
|
|
1081
|
+
{
|
|
1082
|
+
value: "flex-grow",
|
|
1083
|
+
label: (0, import_i18n13.__)("Grow", "elementor"),
|
|
1084
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(import_icons10.ExpandIcon, { fontSize: size }),
|
|
1085
|
+
showTooltip: true
|
|
1086
|
+
},
|
|
1087
|
+
{
|
|
1088
|
+
value: "flex-shrink",
|
|
1089
|
+
label: (0, import_i18n13.__)("Shrink", "elementor"),
|
|
1090
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(import_icons10.ShrinkIcon, { fontSize: size }),
|
|
1091
|
+
showTooltip: true
|
|
1092
|
+
},
|
|
1093
|
+
{
|
|
1094
|
+
value: "custom",
|
|
1095
|
+
label: (0, import_i18n13.__)("Custom", "elementor"),
|
|
1096
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(import_icons10.PencilIcon, { fontSize: size }),
|
|
1097
|
+
showTooltip: true
|
|
1098
|
+
}
|
|
1099
|
+
];
|
|
1100
|
+
var FlexSizeField = () => {
|
|
1101
|
+
const { isSiteRtl } = useDirection(), [growField, setGrowField] = useStylesField("flex-grow"), [shrinkField, setShrinkField] = useStylesField("flex-shrink"), [basisField, setBasisField] = useStylesField("flex-basis");
|
|
1102
|
+
const grow = growField?.value || null, shrink = shrinkField?.value || null, basis = basisField?.value || null;
|
|
1103
|
+
const currentGroup = React31.useMemo(() => getActiveGroup({ grow, shrink, basis }), [grow, shrink, basis]), [activeGroup, setActiveGroup] = React31.useState(currentGroup);
|
|
1104
|
+
const onChangeGroup = (group = null) => {
|
|
1105
|
+
setActiveGroup(group);
|
|
1106
|
+
setBasisField(null);
|
|
1107
|
+
if (!group || group === "custom") {
|
|
1108
|
+
setGrowField(null);
|
|
1109
|
+
setShrinkField(null);
|
|
1110
|
+
return;
|
|
1111
|
+
}
|
|
1112
|
+
if (group === "flex-grow") {
|
|
1113
|
+
setGrowField({ $$type: "number", value: DEFAULT });
|
|
1114
|
+
setShrinkField(null);
|
|
1115
|
+
return;
|
|
1116
|
+
}
|
|
1117
|
+
setGrowField(null);
|
|
1118
|
+
setShrinkField({ $$type: "number", value: DEFAULT });
|
|
1119
|
+
};
|
|
1120
|
+
return /* @__PURE__ */ React31.createElement(import_ui24.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React31.createElement(import_ui24.ThemeProvider, null, /* @__PURE__ */ React31.createElement(import_ui24.Stack, { gap: 2 }, /* @__PURE__ */ React31.createElement(import_ui24.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(import_ui24.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(import_editor_controls19.ControlLabel, null, (0, import_i18n13.__)("Size", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui24.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React31.createElement(
|
|
1121
|
+
import_editor_controls19.ControlToggleButtonGroup,
|
|
846
1122
|
{
|
|
847
|
-
value:
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
1123
|
+
value: activeGroup,
|
|
1124
|
+
onChange: onChangeGroup,
|
|
1125
|
+
items: items2,
|
|
1126
|
+
exclusive: true
|
|
851
1127
|
}
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
1128
|
+
))), "custom" === activeGroup && /* @__PURE__ */ React31.createElement(FlexCustomField, null))));
|
|
1129
|
+
};
|
|
1130
|
+
var FlexCustomField = () => /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement(StylesField, { bind: "flex-grow" }, /* @__PURE__ */ React31.createElement(import_ui24.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(import_ui24.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(import_editor_controls19.ControlLabel, null, (0, import_i18n13.__)("Grow", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui24.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React31.createElement(import_editor_controls19.NumberControl, { min: 0, shouldForceInt: true })))), /* @__PURE__ */ React31.createElement(StylesField, { bind: "flex-shrink" }, /* @__PURE__ */ React31.createElement(import_ui24.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(import_ui24.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(import_editor_controls19.ControlLabel, null, (0, import_i18n13.__)("Shrink", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui24.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React31.createElement(import_editor_controls19.NumberControl, { min: 0, shouldForceInt: true })))), /* @__PURE__ */ React31.createElement(StylesField, { bind: "flex-basis" }, /* @__PURE__ */ React31.createElement(import_ui24.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(import_ui24.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(import_editor_controls19.ControlLabel, null, (0, import_i18n13.__)("Basis", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui24.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React31.createElement(import_editor_controls19.SizeControl, null)))));
|
|
1131
|
+
var getActiveGroup = ({
|
|
1132
|
+
grow,
|
|
1133
|
+
shrink,
|
|
1134
|
+
basis
|
|
1135
|
+
}) => {
|
|
1136
|
+
if (null === grow && null === shrink && !basis) {
|
|
1137
|
+
return null;
|
|
855
1138
|
}
|
|
856
|
-
|
|
1139
|
+
if (shrink && grow || basis) {
|
|
1140
|
+
return "custom";
|
|
1141
|
+
}
|
|
1142
|
+
if (grow === DEFAULT) {
|
|
1143
|
+
return "flex-grow";
|
|
1144
|
+
}
|
|
1145
|
+
if (shrink === DEFAULT) {
|
|
1146
|
+
return "flex-shrink";
|
|
1147
|
+
}
|
|
1148
|
+
return "custom";
|
|
1149
|
+
};
|
|
1150
|
+
|
|
1151
|
+
// src/components/style-sections/layout-section/justify-content-field.tsx
|
|
1152
|
+
var React32 = __toESM(require("react"));
|
|
1153
|
+
var import_editor_controls20 = require("@elementor/editor-controls");
|
|
1154
|
+
var import_icons11 = require("@elementor/icons");
|
|
1155
|
+
var import_ui25 = require("@elementor/ui");
|
|
1156
|
+
var import_i18n14 = require("@wordpress/i18n");
|
|
1157
|
+
var StartIcon3 = (0, import_ui25.withDirection)(import_icons11.JustifyTopIcon);
|
|
1158
|
+
var EndIcon3 = (0, import_ui25.withDirection)(import_icons11.JustifyBottomIcon);
|
|
1159
|
+
var iconProps3 = {
|
|
1160
|
+
isClockwise: true,
|
|
1161
|
+
offset: -90
|
|
1162
|
+
};
|
|
1163
|
+
var options4 = [
|
|
1164
|
+
{
|
|
1165
|
+
value: "start",
|
|
1166
|
+
label: (0, import_i18n14.__)("Start", "elementor"),
|
|
1167
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(RotatedIcon, { icon: StartIcon3, size, ...iconProps3 }),
|
|
1168
|
+
showTooltip: true
|
|
1169
|
+
},
|
|
1170
|
+
{
|
|
1171
|
+
value: "center",
|
|
1172
|
+
label: (0, import_i18n14.__)("Center", "elementor"),
|
|
1173
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(RotatedIcon, { icon: import_icons11.JustifyCenterIcon, size, ...iconProps3 }),
|
|
1174
|
+
showTooltip: true
|
|
1175
|
+
},
|
|
1176
|
+
{
|
|
1177
|
+
value: "end",
|
|
1178
|
+
label: (0, import_i18n14.__)("End", "elementor"),
|
|
1179
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(RotatedIcon, { icon: EndIcon3, size, ...iconProps3 }),
|
|
1180
|
+
showTooltip: true
|
|
1181
|
+
},
|
|
1182
|
+
{
|
|
1183
|
+
value: "space-between",
|
|
1184
|
+
label: (0, import_i18n14.__)("Space between", "elementor"),
|
|
1185
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(RotatedIcon, { icon: import_icons11.JustifySpaceBetweenVerticalIcon, size, ...iconProps3 }),
|
|
1186
|
+
showTooltip: true
|
|
1187
|
+
},
|
|
1188
|
+
{
|
|
1189
|
+
value: "space-around",
|
|
1190
|
+
label: (0, import_i18n14.__)("Space around", "elementor"),
|
|
1191
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(RotatedIcon, { icon: import_icons11.JustifySpaceAroundVerticalIcon, size, ...iconProps3 }),
|
|
1192
|
+
showTooltip: true
|
|
1193
|
+
},
|
|
1194
|
+
{
|
|
1195
|
+
value: "space-evenly",
|
|
1196
|
+
label: (0, import_i18n14.__)("Space evenly", "elementor"),
|
|
1197
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(RotatedIcon, { icon: import_icons11.JustifyDistributeVerticalIcon, size, ...iconProps3 }),
|
|
1198
|
+
showTooltip: true
|
|
1199
|
+
}
|
|
1200
|
+
];
|
|
1201
|
+
var JustifyContentField = () => {
|
|
1202
|
+
const { isSiteRtl } = useDirection();
|
|
1203
|
+
return /* @__PURE__ */ React32.createElement(import_ui25.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React32.createElement(import_ui25.ThemeProvider, null, /* @__PURE__ */ React32.createElement(StylesField, { bind: "justify-content" }, /* @__PURE__ */ React32.createElement(import_ui25.Stack, { gap: 1 }, /* @__PURE__ */ React32.createElement(import_editor_controls20.ControlLabel, null, (0, import_i18n14.__)("Justify content", "elementor")), /* @__PURE__ */ React32.createElement(import_editor_controls20.ToggleControl, { options: options4, fullWidth: true })))));
|
|
1204
|
+
};
|
|
1205
|
+
|
|
1206
|
+
// src/components/style-sections/layout-section/wrap-field.tsx
|
|
1207
|
+
var React33 = __toESM(require("react"));
|
|
1208
|
+
var import_editor_controls21 = require("@elementor/editor-controls");
|
|
1209
|
+
var import_icons12 = require("@elementor/icons");
|
|
1210
|
+
var import_ui26 = require("@elementor/ui");
|
|
1211
|
+
var import_i18n15 = require("@wordpress/i18n");
|
|
1212
|
+
var options5 = [
|
|
1213
|
+
{
|
|
1214
|
+
value: "nowrap",
|
|
1215
|
+
label: (0, import_i18n15.__)("No wrap", "elementor"),
|
|
1216
|
+
renderContent: ({ size }) => /* @__PURE__ */ React33.createElement(import_icons12.ArrowRightIcon, { fontSize: size }),
|
|
1217
|
+
showTooltip: true
|
|
1218
|
+
},
|
|
1219
|
+
{
|
|
1220
|
+
value: "wrap",
|
|
1221
|
+
label: (0, import_i18n15.__)("Wrap", "elementor"),
|
|
1222
|
+
renderContent: ({ size }) => /* @__PURE__ */ React33.createElement(import_icons12.ArrowBackIcon, { fontSize: size }),
|
|
1223
|
+
showTooltip: true
|
|
1224
|
+
},
|
|
1225
|
+
{
|
|
1226
|
+
value: "wrap-reverse",
|
|
1227
|
+
label: (0, import_i18n15.__)("Reversed wrap", "elementor"),
|
|
1228
|
+
renderContent: ({ size }) => /* @__PURE__ */ React33.createElement(import_icons12.ArrowForwardIcon, { fontSize: size }),
|
|
1229
|
+
showTooltip: true
|
|
1230
|
+
}
|
|
1231
|
+
];
|
|
1232
|
+
var WrapField = () => {
|
|
1233
|
+
const { isSiteRtl } = useDirection();
|
|
1234
|
+
return /* @__PURE__ */ React33.createElement(import_ui26.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React33.createElement(import_ui26.ThemeProvider, null, /* @__PURE__ */ React33.createElement(StylesField, { bind: "flex-wrap" }, /* @__PURE__ */ React33.createElement(import_ui26.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React33.createElement(import_ui26.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(import_editor_controls21.ControlLabel, null, (0, import_i18n15.__)("Wrap", "elementor"))), /* @__PURE__ */ React33.createElement(import_ui26.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React33.createElement(import_editor_controls21.ToggleControl, { options: options5 }))))));
|
|
857
1235
|
};
|
|
858
1236
|
|
|
859
1237
|
// src/components/style-sections/layout-section/layout-section.tsx
|
|
860
1238
|
var LayoutSection = () => {
|
|
861
1239
|
const [display] = useStylesField("display");
|
|
862
|
-
return /* @__PURE__ */
|
|
1240
|
+
return /* @__PURE__ */ React34.createElement(import_ui27.Stack, { gap: 2 }, /* @__PURE__ */ React34.createElement(DisplayField, null), "flex" === display?.value && /* @__PURE__ */ React34.createElement(FlexFields, null));
|
|
863
1241
|
};
|
|
1242
|
+
var FlexFields = () => /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(FlexDirectionField, null), /* @__PURE__ */ React34.createElement(JustifyContentField, null), /* @__PURE__ */ React34.createElement(AlignItemsField, null), /* @__PURE__ */ React34.createElement(import_ui27.Divider, null), /* @__PURE__ */ React34.createElement(WrapField, null), /* @__PURE__ */ React34.createElement(import_ui27.Divider, null), /* @__PURE__ */ React34.createElement(import_editor_controls22.ControlLabel, null, (0, import_i18n16.__)("Flex child", "elementor")), /* @__PURE__ */ React34.createElement(AlignSelfChild, null), /* @__PURE__ */ React34.createElement(FlexOrderField, null), /* @__PURE__ */ React34.createElement(FlexSizeField, null));
|
|
864
1243
|
|
|
865
1244
|
// src/components/style-sections/position-section/position-section.tsx
|
|
866
|
-
var
|
|
867
|
-
var
|
|
868
|
-
var
|
|
1245
|
+
var React38 = __toESM(require("react"));
|
|
1246
|
+
var import_react11 = require("react");
|
|
1247
|
+
var import_ui31 = require("@elementor/ui");
|
|
869
1248
|
|
|
870
1249
|
// src/hooks/use-style-prop-history.ts
|
|
871
|
-
var
|
|
1250
|
+
var import_react10 = require("react");
|
|
872
1251
|
var import_editor_elements4 = require("@elementor/editor-elements");
|
|
873
1252
|
|
|
874
1253
|
// src/hooks/use-prop-value-history.ts
|
|
875
|
-
var
|
|
1254
|
+
var import_react9 = require("react");
|
|
876
1255
|
var import_utils2 = require("@elementor/utils");
|
|
877
1256
|
var PROPS_VALUES_HISTORY_PREFIX = "elementor/editor-editing-panel/prop-value-history";
|
|
878
1257
|
var usePropValueHistory = () => {
|
|
879
1258
|
const { element } = useElement();
|
|
880
1259
|
const elementKey = `${PROPS_VALUES_HISTORY_PREFIX}/${element.id}`;
|
|
881
|
-
const getElementPropsHistory = (0,
|
|
1260
|
+
const getElementPropsHistory = (0, import_react9.useCallback)(() => {
|
|
882
1261
|
return (0, import_utils2.getSessionStorageItem)(elementKey);
|
|
883
1262
|
}, [elementKey]);
|
|
884
|
-
const getPropValue = (0,
|
|
1263
|
+
const getPropValue = (0, import_react9.useCallback)(
|
|
885
1264
|
(propKey) => {
|
|
886
1265
|
const elementPropValues = getElementPropsHistory();
|
|
887
1266
|
return elementPropValues?.[propKey] ?? null;
|
|
888
1267
|
},
|
|
889
1268
|
[getElementPropsHistory]
|
|
890
1269
|
);
|
|
891
|
-
const setPropValue = (0,
|
|
1270
|
+
const setPropValue = (0, import_react9.useCallback)(
|
|
892
1271
|
(propKey, propValue) => {
|
|
893
1272
|
const elementPropValues = getElementPropsHistory();
|
|
894
1273
|
const updatedElementPropValues = { ...elementPropValues, [propKey]: propValue };
|
|
@@ -896,7 +1275,7 @@ var usePropValueHistory = () => {
|
|
|
896
1275
|
},
|
|
897
1276
|
[getElementPropsHistory, elementKey]
|
|
898
1277
|
);
|
|
899
|
-
const removeProp = (0,
|
|
1278
|
+
const removeProp = (0, import_react9.useCallback)(
|
|
900
1279
|
(propKey) => {
|
|
901
1280
|
const elementPropValues = getElementPropsHistory();
|
|
902
1281
|
const updatedElementPropValues = Object.fromEntries(
|
|
@@ -906,7 +1285,7 @@ var usePropValueHistory = () => {
|
|
|
906
1285
|
},
|
|
907
1286
|
[getElementPropsHistory, elementKey]
|
|
908
1287
|
);
|
|
909
|
-
return (0,
|
|
1288
|
+
return (0, import_react9.useMemo)(() => ({ getPropValue, setPropValue, removeProp }), [getPropValue, removeProp, setPropValue]);
|
|
910
1289
|
};
|
|
911
1290
|
|
|
912
1291
|
// src/hooks/use-style-prop-history.ts
|
|
@@ -917,7 +1296,7 @@ var useStylePropsHistory = (props) => {
|
|
|
917
1296
|
const styleDef = (0, import_editor_elements4.getElementStyles)(element.id)?.[styleDefID];
|
|
918
1297
|
const styleVariant = styleDef ? (0, import_editor_elements4.getVariantByMeta)(styleDef, meta) : null;
|
|
919
1298
|
const styleVariantPath = `${styleDefID}-${styleVariant?.meta.breakpoint}-${styleVariant?.meta.state}`;
|
|
920
|
-
const saveStylePropsHistory = (0,
|
|
1299
|
+
const saveStylePropsHistory = (0, import_react10.useCallback)(() => {
|
|
921
1300
|
props.forEach((propKey) => {
|
|
922
1301
|
const propValue = styleVariant?.props[propKey];
|
|
923
1302
|
if (propValue) {
|
|
@@ -926,7 +1305,7 @@ var useStylePropsHistory = (props) => {
|
|
|
926
1305
|
}
|
|
927
1306
|
});
|
|
928
1307
|
}, [props, setPropValue, styleVariant?.props, styleVariantPath]);
|
|
929
|
-
const updateStylePropsFromHistory = (0,
|
|
1308
|
+
const updateStylePropsFromHistory = (0, import_react10.useCallback)(() => {
|
|
930
1309
|
const propValuesFromHistory = props.reduce((allProps, currentPropKey) => {
|
|
931
1310
|
const propPath = `${styleVariantPath}-${currentPropKey}`;
|
|
932
1311
|
const propHistory = getPropValue(propPath);
|
|
@@ -946,7 +1325,7 @@ var useStylePropsHistory = (props) => {
|
|
|
946
1325
|
});
|
|
947
1326
|
}
|
|
948
1327
|
}, [element.id, getPropValue, meta, props, removeProp, styleDefID, styleVariantPath]);
|
|
949
|
-
const clearCurrentStyleProps = (0,
|
|
1328
|
+
const clearCurrentStyleProps = (0, import_react10.useCallback)(() => {
|
|
950
1329
|
const resetValues = props.reduce(
|
|
951
1330
|
(allProps, currentPropKey) => ({
|
|
952
1331
|
...allProps,
|
|
@@ -962,53 +1341,53 @@ var useStylePropsHistory = (props) => {
|
|
|
962
1341
|
bind: "classes"
|
|
963
1342
|
});
|
|
964
1343
|
}, [element.id, meta, props, styleDefID]);
|
|
965
|
-
return (0,
|
|
1344
|
+
return (0, import_react10.useMemo)(
|
|
966
1345
|
() => ({ saveStylePropsHistory, updateStylePropsFromHistory, clearCurrentStyleProps }),
|
|
967
1346
|
[saveStylePropsHistory, updateStylePropsFromHistory, clearCurrentStyleProps]
|
|
968
1347
|
);
|
|
969
1348
|
};
|
|
970
1349
|
|
|
971
1350
|
// src/components/style-sections/position-section/dimensions-field.tsx
|
|
972
|
-
var
|
|
973
|
-
var
|
|
974
|
-
var
|
|
975
|
-
var
|
|
976
|
-
var
|
|
1351
|
+
var React35 = __toESM(require("react"));
|
|
1352
|
+
var import_editor_controls23 = require("@elementor/editor-controls");
|
|
1353
|
+
var import_icons13 = require("@elementor/icons");
|
|
1354
|
+
var import_ui28 = require("@elementor/ui");
|
|
1355
|
+
var import_i18n17 = require("@wordpress/i18n");
|
|
977
1356
|
var sideIcons = {
|
|
978
|
-
left: /* @__PURE__ */
|
|
979
|
-
right: /* @__PURE__ */
|
|
980
|
-
top: /* @__PURE__ */
|
|
981
|
-
bottom: /* @__PURE__ */
|
|
1357
|
+
left: /* @__PURE__ */ React35.createElement(import_icons13.SideLeftIcon, { fontSize: "tiny" }),
|
|
1358
|
+
right: /* @__PURE__ */ React35.createElement(import_icons13.SideRightIcon, { fontSize: "tiny" }),
|
|
1359
|
+
top: /* @__PURE__ */ React35.createElement(import_icons13.SideTopIcon, { fontSize: "tiny" }),
|
|
1360
|
+
bottom: /* @__PURE__ */ React35.createElement(import_icons13.SideBottomIcon, { fontSize: "tiny" })
|
|
982
1361
|
};
|
|
983
1362
|
var DimensionsField = () => {
|
|
984
|
-
return /* @__PURE__ */
|
|
1363
|
+
return /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement(import_ui28.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React35.createElement(DimensionField, { side: "top", label: (0, import_i18n17.__)("Top", "elementor") }), /* @__PURE__ */ React35.createElement(DimensionField, { side: "right", label: (0, import_i18n17.__)("Right", "elementor") })), /* @__PURE__ */ React35.createElement(import_ui28.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React35.createElement(DimensionField, { side: "bottom", label: (0, import_i18n17.__)("Bottom", "elementor") }), /* @__PURE__ */ React35.createElement(DimensionField, { side: "left", label: (0, import_i18n17.__)("Left", "elementor") })));
|
|
985
1364
|
};
|
|
986
1365
|
var DimensionField = ({ side, label }) => {
|
|
987
|
-
return /* @__PURE__ */
|
|
1366
|
+
return /* @__PURE__ */ React35.createElement(import_ui28.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React35.createElement(import_ui28.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React35.createElement(import_editor_controls23.ControlLabel, null, label)), /* @__PURE__ */ React35.createElement(import_ui28.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React35.createElement(StylesField, { bind: side }, /* @__PURE__ */ React35.createElement(import_editor_controls23.SizeControl, { startIcon: sideIcons[side] }))));
|
|
988
1367
|
};
|
|
989
1368
|
|
|
990
1369
|
// src/components/style-sections/position-section/position-field.tsx
|
|
991
|
-
var
|
|
992
|
-
var
|
|
993
|
-
var
|
|
994
|
-
var
|
|
1370
|
+
var React36 = __toESM(require("react"));
|
|
1371
|
+
var import_editor_controls24 = require("@elementor/editor-controls");
|
|
1372
|
+
var import_ui29 = require("@elementor/ui");
|
|
1373
|
+
var import_i18n18 = require("@wordpress/i18n");
|
|
995
1374
|
var positionOptions = [
|
|
996
|
-
{ label: (0,
|
|
997
|
-
{ label: (0,
|
|
998
|
-
{ label: (0,
|
|
999
|
-
{ label: (0,
|
|
1375
|
+
{ label: (0, import_i18n18.__)("Static", "elementor"), value: "static" },
|
|
1376
|
+
{ label: (0, import_i18n18.__)("Relative", "elementor"), value: "relative" },
|
|
1377
|
+
{ label: (0, import_i18n18.__)("Absolute", "elementor"), value: "absolute" },
|
|
1378
|
+
{ label: (0, import_i18n18.__)("Fixed", "elementor"), value: "fixed" }
|
|
1000
1379
|
];
|
|
1001
1380
|
var PositionField = () => {
|
|
1002
|
-
return /* @__PURE__ */
|
|
1381
|
+
return /* @__PURE__ */ React36.createElement(StylesField, { bind: "position" }, /* @__PURE__ */ React36.createElement(import_ui29.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React36.createElement(import_ui29.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(import_editor_controls24.ControlLabel, null, (0, import_i18n18.__)("Position", "elementor"))), /* @__PURE__ */ React36.createElement(import_ui29.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(import_editor_controls24.SelectControl, { options: positionOptions }))));
|
|
1003
1382
|
};
|
|
1004
1383
|
|
|
1005
1384
|
// src/components/style-sections/position-section/z-index-field.tsx
|
|
1006
|
-
var
|
|
1007
|
-
var
|
|
1008
|
-
var
|
|
1009
|
-
var
|
|
1385
|
+
var React37 = __toESM(require("react"));
|
|
1386
|
+
var import_editor_controls25 = require("@elementor/editor-controls");
|
|
1387
|
+
var import_ui30 = require("@elementor/ui");
|
|
1388
|
+
var import_i18n19 = require("@wordpress/i18n");
|
|
1010
1389
|
var ZIndexField = () => {
|
|
1011
|
-
return /* @__PURE__ */
|
|
1390
|
+
return /* @__PURE__ */ React37.createElement(StylesField, { bind: "z-index" }, /* @__PURE__ */ React37.createElement(import_ui30.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React37.createElement(import_ui30.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(import_editor_controls25.ControlLabel, null, (0, import_i18n19.__)("Z-Index", "elementor"))), /* @__PURE__ */ React37.createElement(import_ui30.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(import_editor_controls25.NumberControl, null))));
|
|
1012
1391
|
};
|
|
1013
1392
|
|
|
1014
1393
|
// src/components/style-sections/position-section/position-section.tsx
|
|
@@ -1016,12 +1395,12 @@ var dimensionsPropKeys = ["top", "bottom", "left", "right"];
|
|
|
1016
1395
|
var PositionSection = () => {
|
|
1017
1396
|
const [positionValue] = useStylesField("position");
|
|
1018
1397
|
usePositionChangeHandler();
|
|
1019
|
-
const isNotStatic = positionValue && positionValue !== "static";
|
|
1020
|
-
return /* @__PURE__ */
|
|
1398
|
+
const isNotStatic = positionValue && positionValue?.value !== "static";
|
|
1399
|
+
return /* @__PURE__ */ React38.createElement(import_ui31.Stack, { gap: 1.5 }, /* @__PURE__ */ React38.createElement(PositionField, null), isNotStatic ? /* @__PURE__ */ React38.createElement(React38.Fragment, null, /* @__PURE__ */ React38.createElement(DimensionsField, null), /* @__PURE__ */ React38.createElement(ZIndexField, null)) : null);
|
|
1021
1400
|
};
|
|
1022
1401
|
var usePositionChangeHandler = () => {
|
|
1023
1402
|
const dimensionsHistory = useStylePropsHistory(dimensionsPropKeys);
|
|
1024
|
-
const onPositionChange = (0,
|
|
1403
|
+
const onPositionChange = (0, import_react11.useCallback)(
|
|
1025
1404
|
(newPositionValue, previousPosition) => {
|
|
1026
1405
|
if (!dimensionsHistory) {
|
|
1027
1406
|
return;
|
|
@@ -1042,91 +1421,91 @@ var usePositionChangeHandler = () => {
|
|
|
1042
1421
|
};
|
|
1043
1422
|
|
|
1044
1423
|
// src/components/style-sections/size-section/size-section.tsx
|
|
1045
|
-
var
|
|
1046
|
-
var
|
|
1047
|
-
var
|
|
1048
|
-
var
|
|
1424
|
+
var React40 = __toESM(require("react"));
|
|
1425
|
+
var import_editor_controls27 = require("@elementor/editor-controls");
|
|
1426
|
+
var import_ui33 = require("@elementor/ui");
|
|
1427
|
+
var import_i18n21 = require("@wordpress/i18n");
|
|
1049
1428
|
|
|
1050
1429
|
// src/components/style-sections/size-section/overflow-field.tsx
|
|
1051
|
-
var
|
|
1052
|
-
var
|
|
1053
|
-
var
|
|
1054
|
-
var
|
|
1055
|
-
var
|
|
1056
|
-
var
|
|
1430
|
+
var React39 = __toESM(require("react"));
|
|
1431
|
+
var import_editor_controls26 = require("@elementor/editor-controls");
|
|
1432
|
+
var import_icons14 = require("@elementor/icons");
|
|
1433
|
+
var import_ui32 = require("@elementor/ui");
|
|
1434
|
+
var import_i18n20 = require("@wordpress/i18n");
|
|
1435
|
+
var options6 = [
|
|
1057
1436
|
{
|
|
1058
1437
|
value: "visible",
|
|
1059
|
-
label: (0,
|
|
1060
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1438
|
+
label: (0, import_i18n20.__)("Visible", "elementor"),
|
|
1439
|
+
renderContent: ({ size }) => /* @__PURE__ */ React39.createElement(import_icons14.EyeIcon, { fontSize: size }),
|
|
1061
1440
|
showTooltip: true
|
|
1062
1441
|
},
|
|
1063
1442
|
{
|
|
1064
1443
|
value: "hidden",
|
|
1065
|
-
label: (0,
|
|
1066
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1444
|
+
label: (0, import_i18n20.__)("Hidden", "elementor"),
|
|
1445
|
+
renderContent: ({ size }) => /* @__PURE__ */ React39.createElement(import_icons14.EyeOffIcon, { fontSize: size }),
|
|
1067
1446
|
showTooltip: true
|
|
1068
1447
|
},
|
|
1069
1448
|
{
|
|
1070
1449
|
value: "auto",
|
|
1071
|
-
label: (0,
|
|
1072
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1450
|
+
label: (0, import_i18n20.__)("Auto", "elementor"),
|
|
1451
|
+
renderContent: ({ size }) => /* @__PURE__ */ React39.createElement(import_icons14.ExpandBottomIcon, { fontSize: size }),
|
|
1073
1452
|
showTooltip: true
|
|
1074
1453
|
}
|
|
1075
1454
|
];
|
|
1076
1455
|
var OverflowField = () => {
|
|
1077
|
-
return /* @__PURE__ */
|
|
1456
|
+
return /* @__PURE__ */ React39.createElement(StylesField, { bind: "overflow" }, /* @__PURE__ */ React39.createElement(import_ui32.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React39.createElement(import_ui32.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(import_editor_controls26.ControlLabel, null, (0, import_i18n20.__)("Overflow", "elementor"))), /* @__PURE__ */ React39.createElement(import_ui32.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React39.createElement(import_editor_controls26.ToggleControl, { options: options6 }))));
|
|
1078
1457
|
};
|
|
1079
1458
|
|
|
1080
1459
|
// src/components/style-sections/size-section/size-section.tsx
|
|
1081
1460
|
var SizeSection = () => {
|
|
1082
|
-
return /* @__PURE__ */
|
|
1461
|
+
return /* @__PURE__ */ React40.createElement(import_ui33.Stack, { gap: 1.5 }, /* @__PURE__ */ React40.createElement(import_ui33.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React40.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(SizeField, { bind: "width", label: (0, import_i18n21.__)("Width", "elementor") })), /* @__PURE__ */ React40.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(SizeField, { bind: "height", label: (0, import_i18n21.__)("Height", "elementor") }))), /* @__PURE__ */ React40.createElement(import_ui33.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React40.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(SizeField, { bind: "min-width", label: (0, import_i18n21.__)("Min. Width", "elementor") })), /* @__PURE__ */ React40.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(SizeField, { bind: "min-height", label: (0, import_i18n21.__)("Min. Height", "elementor") }))), /* @__PURE__ */ React40.createElement(import_ui33.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React40.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(SizeField, { bind: "max-width", label: (0, import_i18n21.__)("Max. Width", "elementor") })), /* @__PURE__ */ React40.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(SizeField, { bind: "max-height", label: (0, import_i18n21.__)("Max. Height", "elementor") }))), /* @__PURE__ */ React40.createElement(import_ui33.Divider, null), /* @__PURE__ */ React40.createElement(import_ui33.Stack, null, /* @__PURE__ */ React40.createElement(OverflowField, null)));
|
|
1083
1462
|
};
|
|
1084
1463
|
var SizeField = ({ label, bind }) => {
|
|
1085
|
-
return /* @__PURE__ */
|
|
1464
|
+
return /* @__PURE__ */ React40.createElement(StylesField, { bind }, /* @__PURE__ */ React40.createElement(import_ui33.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React40.createElement(import_ui33.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React40.createElement(import_editor_controls27.ControlLabel, null, label)), /* @__PURE__ */ React40.createElement(import_ui33.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React40.createElement(import_editor_controls27.SizeControl, null))));
|
|
1086
1465
|
};
|
|
1087
1466
|
|
|
1088
1467
|
// src/components/style-sections/spacing-section/spacing-section.tsx
|
|
1089
|
-
var
|
|
1090
|
-
var
|
|
1091
|
-
var
|
|
1092
|
-
var
|
|
1468
|
+
var React41 = __toESM(require("react"));
|
|
1469
|
+
var import_editor_controls28 = require("@elementor/editor-controls");
|
|
1470
|
+
var import_ui34 = require("@elementor/ui");
|
|
1471
|
+
var import_i18n22 = require("@wordpress/i18n");
|
|
1093
1472
|
var SpacingSection = () => {
|
|
1094
|
-
return /* @__PURE__ */
|
|
1473
|
+
return /* @__PURE__ */ React41.createElement(import_ui34.Stack, { gap: 1.5 }, /* @__PURE__ */ React41.createElement(StylesField, { bind: "padding" }, /* @__PURE__ */ React41.createElement(import_editor_controls28.LinkedDimensionsControl, { label: (0, import_i18n22.__)("Padding", "elementor") })), /* @__PURE__ */ React41.createElement(import_ui34.Divider, null), /* @__PURE__ */ React41.createElement(StylesField, { bind: "margin" }, /* @__PURE__ */ React41.createElement(import_editor_controls28.LinkedDimensionsControl, { label: (0, import_i18n22.__)("Margin", "elementor") })));
|
|
1095
1474
|
};
|
|
1096
1475
|
|
|
1097
1476
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1098
|
-
var
|
|
1099
|
-
var
|
|
1477
|
+
var React55 = __toESM(require("react"));
|
|
1478
|
+
var import_ui47 = require("@elementor/ui");
|
|
1100
1479
|
|
|
1101
1480
|
// src/components/collapsible-content.tsx
|
|
1102
|
-
var
|
|
1103
|
-
var
|
|
1104
|
-
var
|
|
1105
|
-
var
|
|
1481
|
+
var React42 = __toESM(require("react"));
|
|
1482
|
+
var import_react12 = require("react");
|
|
1483
|
+
var import_ui35 = require("@elementor/ui");
|
|
1484
|
+
var import_i18n23 = require("@wordpress/i18n");
|
|
1106
1485
|
var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
1107
|
-
const [open, setOpen] = (0,
|
|
1486
|
+
const [open, setOpen] = (0, import_react12.useState)(defaultOpen);
|
|
1108
1487
|
const handleToggle = () => {
|
|
1109
1488
|
setOpen((prevOpen) => !prevOpen);
|
|
1110
1489
|
};
|
|
1111
|
-
return /* @__PURE__ */
|
|
1112
|
-
|
|
1490
|
+
return /* @__PURE__ */ React42.createElement(import_ui35.Stack, { sx: { py: 0.5 } }, /* @__PURE__ */ React42.createElement(
|
|
1491
|
+
import_ui35.Button,
|
|
1113
1492
|
{
|
|
1114
1493
|
fullWidth: true,
|
|
1115
1494
|
size: "small",
|
|
1116
1495
|
color: "secondary",
|
|
1117
1496
|
variant: "outlined",
|
|
1118
1497
|
onClick: handleToggle,
|
|
1119
|
-
endIcon: /* @__PURE__ */
|
|
1498
|
+
endIcon: /* @__PURE__ */ React42.createElement(CollapseIcon, { open })
|
|
1120
1499
|
},
|
|
1121
|
-
open ? (0,
|
|
1122
|
-
), /* @__PURE__ */
|
|
1500
|
+
open ? (0, import_i18n23.__)("Show less", "elementor") : (0, import_i18n23.__)("Show more", "elementor")
|
|
1501
|
+
), /* @__PURE__ */ React42.createElement(import_ui35.Collapse, { in: open, timeout: "auto", unmountOnExit: true }, children));
|
|
1123
1502
|
};
|
|
1124
1503
|
|
|
1125
1504
|
// src/components/style-sections/typography-section/font-family-field.tsx
|
|
1126
|
-
var
|
|
1127
|
-
var
|
|
1128
|
-
var
|
|
1129
|
-
var
|
|
1505
|
+
var React43 = __toESM(require("react"));
|
|
1506
|
+
var import_editor_controls29 = require("@elementor/editor-controls");
|
|
1507
|
+
var import_ui36 = require("@elementor/ui");
|
|
1508
|
+
var import_i18n24 = require("@wordpress/i18n");
|
|
1130
1509
|
|
|
1131
1510
|
// src/sync/get-elementor-config.ts
|
|
1132
1511
|
var getElementorConfig = () => {
|
|
@@ -1140,184 +1519,220 @@ var FontFamilyField = () => {
|
|
|
1140
1519
|
if (!fontFamilies) {
|
|
1141
1520
|
return null;
|
|
1142
1521
|
}
|
|
1143
|
-
return /* @__PURE__ */
|
|
1522
|
+
return /* @__PURE__ */ React43.createElement(StylesField, { bind: "font-family" }, /* @__PURE__ */ React43.createElement(import_ui36.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React43.createElement(import_ui36.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React43.createElement(import_editor_controls29.ControlLabel, null, (0, import_i18n24.__)("Font Family", "elementor"))), /* @__PURE__ */ React43.createElement(import_ui36.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React43.createElement(import_editor_controls29.FontFamilyControl, { fontFamilies }))));
|
|
1144
1523
|
};
|
|
1145
1524
|
var getFontFamilies = () => {
|
|
1146
1525
|
const { controls } = getElementorConfig();
|
|
1147
|
-
const
|
|
1148
|
-
if (!
|
|
1526
|
+
const options10 = controls?.font?.options;
|
|
1527
|
+
if (!options10) {
|
|
1149
1528
|
return null;
|
|
1150
1529
|
}
|
|
1151
|
-
return
|
|
1530
|
+
return options10;
|
|
1152
1531
|
};
|
|
1153
1532
|
|
|
1154
1533
|
// src/components/style-sections/typography-section/font-size-field.tsx
|
|
1155
|
-
var
|
|
1156
|
-
var
|
|
1157
|
-
var
|
|
1158
|
-
var
|
|
1534
|
+
var React44 = __toESM(require("react"));
|
|
1535
|
+
var import_editor_controls30 = require("@elementor/editor-controls");
|
|
1536
|
+
var import_ui37 = require("@elementor/ui");
|
|
1537
|
+
var import_i18n25 = require("@wordpress/i18n");
|
|
1159
1538
|
var FontSizeField = () => {
|
|
1160
|
-
return /* @__PURE__ */
|
|
1539
|
+
return /* @__PURE__ */ React44.createElement(StylesField, { bind: "font-size" }, /* @__PURE__ */ React44.createElement(import_ui37.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React44.createElement(import_ui37.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(import_editor_controls30.ControlLabel, null, (0, import_i18n25.__)("Font Size", "elementor"))), /* @__PURE__ */ React44.createElement(import_ui37.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(import_editor_controls30.SizeControl, null))));
|
|
1161
1540
|
};
|
|
1162
1541
|
|
|
1163
1542
|
// src/components/style-sections/typography-section/font-weight-field.tsx
|
|
1164
|
-
var
|
|
1165
|
-
var
|
|
1166
|
-
var
|
|
1167
|
-
var
|
|
1543
|
+
var React45 = __toESM(require("react"));
|
|
1544
|
+
var import_editor_controls31 = require("@elementor/editor-controls");
|
|
1545
|
+
var import_ui38 = require("@elementor/ui");
|
|
1546
|
+
var import_i18n26 = require("@wordpress/i18n");
|
|
1168
1547
|
var fontWeightOptions = [
|
|
1169
|
-
{ label: (0,
|
|
1170
|
-
{ label: (0,
|
|
1171
|
-
{ label: (0,
|
|
1172
|
-
{ label: (0,
|
|
1173
|
-
{ label: (0,
|
|
1548
|
+
{ label: (0, import_i18n26.__)("Light - 400", "elementor"), value: "400" },
|
|
1549
|
+
{ label: (0, import_i18n26.__)("Regular - 500", "elementor"), value: "500" },
|
|
1550
|
+
{ label: (0, import_i18n26.__)("Semi Bold - 600", "elementor"), value: "600" },
|
|
1551
|
+
{ label: (0, import_i18n26.__)("Bold - 700", "elementor"), value: "700" },
|
|
1552
|
+
{ label: (0, import_i18n26.__)("Black - 900", "elementor"), value: "900" }
|
|
1174
1553
|
];
|
|
1175
1554
|
var FontWeightField = () => {
|
|
1176
|
-
return /* @__PURE__ */
|
|
1555
|
+
return /* @__PURE__ */ React45.createElement(StylesField, { bind: "font-weight" }, /* @__PURE__ */ React45.createElement(import_ui38.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React45.createElement(import_ui38.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(import_editor_controls31.ControlLabel, null, (0, import_i18n26.__)("Font Weight", "elementor"))), /* @__PURE__ */ React45.createElement(import_ui38.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(import_editor_controls31.SelectControl, { options: fontWeightOptions }))));
|
|
1177
1556
|
};
|
|
1178
1557
|
|
|
1179
1558
|
// src/components/style-sections/typography-section/letter-spacing-field.tsx
|
|
1180
|
-
var
|
|
1181
|
-
var
|
|
1182
|
-
var
|
|
1183
|
-
var
|
|
1559
|
+
var React46 = __toESM(require("react"));
|
|
1560
|
+
var import_editor_controls32 = require("@elementor/editor-controls");
|
|
1561
|
+
var import_ui39 = require("@elementor/ui");
|
|
1562
|
+
var import_i18n27 = require("@wordpress/i18n");
|
|
1184
1563
|
var LetterSpacingField = () => {
|
|
1185
|
-
return /* @__PURE__ */
|
|
1564
|
+
return /* @__PURE__ */ React46.createElement(StylesField, { bind: "letter-spacing" }, /* @__PURE__ */ React46.createElement(import_ui39.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React46.createElement(import_ui39.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(import_editor_controls32.ControlLabel, null, (0, import_i18n27.__)("Letter Spacing", "elementor"))), /* @__PURE__ */ React46.createElement(import_ui39.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(import_editor_controls32.SizeControl, null))));
|
|
1565
|
+
};
|
|
1566
|
+
|
|
1567
|
+
// src/components/style-sections/typography-section/line-height-field.tsx
|
|
1568
|
+
var React47 = __toESM(require("react"));
|
|
1569
|
+
var import_editor_controls33 = require("@elementor/editor-controls");
|
|
1570
|
+
var import_ui40 = require("@elementor/ui");
|
|
1571
|
+
var import_i18n28 = require("@wordpress/i18n");
|
|
1572
|
+
var LineHeightField = () => {
|
|
1573
|
+
return /* @__PURE__ */ React47.createElement(StylesField, { bind: "line-height" }, /* @__PURE__ */ React47.createElement(import_ui40.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React47.createElement(import_ui40.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(import_editor_controls33.ControlLabel, null, (0, import_i18n28.__)("Line Height", "elementor"))), /* @__PURE__ */ React47.createElement(import_ui40.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(import_editor_controls33.SizeControl, null))));
|
|
1186
1574
|
};
|
|
1187
1575
|
|
|
1188
1576
|
// src/components/style-sections/typography-section/text-alignment-field.tsx
|
|
1189
|
-
var
|
|
1190
|
-
var
|
|
1191
|
-
var
|
|
1192
|
-
var
|
|
1193
|
-
var
|
|
1194
|
-
var
|
|
1577
|
+
var React48 = __toESM(require("react"));
|
|
1578
|
+
var import_editor_controls34 = require("@elementor/editor-controls");
|
|
1579
|
+
var import_icons15 = require("@elementor/icons");
|
|
1580
|
+
var import_ui41 = require("@elementor/ui");
|
|
1581
|
+
var import_i18n29 = require("@wordpress/i18n");
|
|
1582
|
+
var options7 = [
|
|
1195
1583
|
{
|
|
1196
1584
|
value: "left",
|
|
1197
|
-
label: (0,
|
|
1198
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1585
|
+
label: (0, import_i18n29.__)("Left", "elementor"),
|
|
1586
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(import_icons15.AlignLeftIcon, { fontSize: size })
|
|
1199
1587
|
},
|
|
1200
1588
|
{
|
|
1201
1589
|
value: "center",
|
|
1202
|
-
label: (0,
|
|
1203
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1590
|
+
label: (0, import_i18n29.__)("Center", "elementor"),
|
|
1591
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(import_icons15.AlignCenterIcon, { fontSize: size })
|
|
1204
1592
|
},
|
|
1205
1593
|
{
|
|
1206
1594
|
value: "right",
|
|
1207
|
-
label: (0,
|
|
1208
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1595
|
+
label: (0, import_i18n29.__)("Right", "elementor"),
|
|
1596
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(import_icons15.AlignRightIcon, { fontSize: size })
|
|
1209
1597
|
},
|
|
1210
1598
|
{
|
|
1211
1599
|
value: "justify",
|
|
1212
|
-
label: (0,
|
|
1213
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1600
|
+
label: (0, import_i18n29.__)("Justify", "elementor"),
|
|
1601
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(import_icons15.AlignJustifiedIcon, { fontSize: size })
|
|
1214
1602
|
}
|
|
1215
1603
|
];
|
|
1216
1604
|
var TextAlignmentField = () => {
|
|
1217
|
-
return /* @__PURE__ */
|
|
1605
|
+
return /* @__PURE__ */ React48.createElement(StylesField, { bind: "text-align" }, /* @__PURE__ */ React48.createElement(import_ui41.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React48.createElement(import_ui41.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(import_editor_controls34.ControlLabel, null, (0, import_i18n29.__)("Alignment", "elementor"))), /* @__PURE__ */ React48.createElement(import_ui41.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React48.createElement(import_editor_controls34.ToggleControl, { options: options7 }))));
|
|
1218
1606
|
};
|
|
1219
1607
|
|
|
1220
1608
|
// src/components/style-sections/typography-section/text-color-field.tsx
|
|
1221
|
-
var
|
|
1222
|
-
var
|
|
1223
|
-
var
|
|
1224
|
-
var
|
|
1609
|
+
var React49 = __toESM(require("react"));
|
|
1610
|
+
var import_editor_controls35 = require("@elementor/editor-controls");
|
|
1611
|
+
var import_ui42 = require("@elementor/ui");
|
|
1612
|
+
var import_i18n30 = require("@wordpress/i18n");
|
|
1225
1613
|
var TextColorField = () => {
|
|
1226
|
-
return /* @__PURE__ */
|
|
1614
|
+
return /* @__PURE__ */ React49.createElement(StylesField, { bind: "color" }, /* @__PURE__ */ React49.createElement(import_ui42.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React49.createElement(import_ui42.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(import_editor_controls35.ControlLabel, null, (0, import_i18n30.__)("Text Color", "elementor"))), /* @__PURE__ */ React49.createElement(import_ui42.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(import_editor_controls35.ColorControl, null))));
|
|
1227
1615
|
};
|
|
1228
1616
|
|
|
1229
1617
|
// src/components/style-sections/typography-section/text-direction-field.tsx
|
|
1230
|
-
var
|
|
1231
|
-
var
|
|
1232
|
-
var
|
|
1233
|
-
var
|
|
1234
|
-
var
|
|
1235
|
-
var
|
|
1618
|
+
var React50 = __toESM(require("react"));
|
|
1619
|
+
var import_editor_controls36 = require("@elementor/editor-controls");
|
|
1620
|
+
var import_icons16 = require("@elementor/icons");
|
|
1621
|
+
var import_ui43 = require("@elementor/ui");
|
|
1622
|
+
var import_i18n31 = require("@wordpress/i18n");
|
|
1623
|
+
var options8 = [
|
|
1236
1624
|
{
|
|
1237
1625
|
value: "ltr",
|
|
1238
|
-
label: (0,
|
|
1239
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1626
|
+
label: (0, import_i18n31.__)("Left to Right", "elementor"),
|
|
1627
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(import_icons16.TextDirectionLtrIcon, { fontSize: size })
|
|
1240
1628
|
},
|
|
1241
1629
|
{
|
|
1242
1630
|
value: "rtl",
|
|
1243
|
-
label: (0,
|
|
1244
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1631
|
+
label: (0, import_i18n31.__)("Right to Left", "elementor"),
|
|
1632
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(import_icons16.TextDirectionRtlIcon, { fontSize: size })
|
|
1245
1633
|
}
|
|
1246
1634
|
];
|
|
1247
1635
|
var TextDirectionField = () => {
|
|
1248
|
-
return /* @__PURE__ */
|
|
1636
|
+
return /* @__PURE__ */ React50.createElement(StylesField, { bind: "direction" }, /* @__PURE__ */ React50.createElement(import_ui43.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React50.createElement(import_ui43.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React50.createElement(import_editor_controls36.ControlLabel, null, (0, import_i18n31.__)("Direction", "elementor"))), /* @__PURE__ */ React50.createElement(import_ui43.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React50.createElement(import_editor_controls36.ToggleControl, { options: options8 }))));
|
|
1249
1637
|
};
|
|
1250
1638
|
|
|
1251
1639
|
// src/components/style-sections/typography-section/text-stroke-field.tsx
|
|
1252
|
-
var
|
|
1253
|
-
var
|
|
1254
|
-
var
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
var import_i18n24 = require("@wordpress/i18n");
|
|
1262
|
-
var CollapsibleField = ({ label, children, defaultOpen = false }) => {
|
|
1263
|
-
const [open, setOpen] = (0, import_react11.useState)(defaultOpen);
|
|
1264
|
-
const handleToggle = () => {
|
|
1265
|
-
setOpen((prevOpen) => !prevOpen);
|
|
1266
|
-
};
|
|
1267
|
-
return /* @__PURE__ */ React43.createElement(import_ui36.Stack, { gap: 1.5 }, /* @__PURE__ */ React43.createElement(import_ui36.Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { py: 0.5 } }, label, /* @__PURE__ */ React43.createElement(
|
|
1268
|
-
import_ui36.IconButton,
|
|
1269
|
-
{
|
|
1270
|
-
onClick: handleToggle,
|
|
1271
|
-
size: "tiny",
|
|
1272
|
-
"aria-label": open ? (0, import_i18n24.__)("Close", "elementor") : (0, import_i18n24.__)("Expand", "elementor")
|
|
1640
|
+
var React51 = __toESM(require("react"));
|
|
1641
|
+
var import_editor_controls37 = require("@elementor/editor-controls");
|
|
1642
|
+
var import_i18n32 = require("@wordpress/i18n");
|
|
1643
|
+
var initTextStroke = {
|
|
1644
|
+
$$type: "stroke",
|
|
1645
|
+
value: {
|
|
1646
|
+
color: {
|
|
1647
|
+
$$type: "color",
|
|
1648
|
+
value: "#000000"
|
|
1273
1649
|
},
|
|
1274
|
-
|
|
1275
|
-
|
|
1650
|
+
width: {
|
|
1651
|
+
$$type: "size",
|
|
1652
|
+
value: {
|
|
1653
|
+
unit: "px",
|
|
1654
|
+
size: 1
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1276
1658
|
};
|
|
1277
|
-
|
|
1278
|
-
// src/components/style-sections/typography-section/text-stroke-field.tsx
|
|
1279
1659
|
var TextStrokeField = () => {
|
|
1280
|
-
|
|
1660
|
+
const [textStroke, setTextStroke] = useStylesField("-webkit-text-stroke");
|
|
1661
|
+
const addTextStroke = () => {
|
|
1662
|
+
setTextStroke(initTextStroke);
|
|
1663
|
+
};
|
|
1664
|
+
const removeTextStroke = () => {
|
|
1665
|
+
setTextStroke(null);
|
|
1666
|
+
};
|
|
1667
|
+
const hasTextStroke = Boolean(textStroke);
|
|
1668
|
+
return /* @__PURE__ */ React51.createElement(
|
|
1669
|
+
AddOrRemoveContent,
|
|
1670
|
+
{
|
|
1671
|
+
label: (0, import_i18n32.__)("Text Stroke", "elementor"),
|
|
1672
|
+
isAdded: hasTextStroke,
|
|
1673
|
+
onAdd: addTextStroke,
|
|
1674
|
+
onRemove: removeTextStroke
|
|
1675
|
+
},
|
|
1676
|
+
/* @__PURE__ */ React51.createElement(StylesField, { bind: "-webkit-text-stroke" }, /* @__PURE__ */ React51.createElement(import_editor_controls37.StrokeControl, null))
|
|
1677
|
+
);
|
|
1281
1678
|
};
|
|
1282
1679
|
|
|
1283
1680
|
// src/components/style-sections/typography-section/text-style-field.tsx
|
|
1284
|
-
var
|
|
1285
|
-
var
|
|
1286
|
-
var
|
|
1287
|
-
var
|
|
1288
|
-
var
|
|
1681
|
+
var React52 = __toESM(require("react"));
|
|
1682
|
+
var import_editor_controls38 = require("@elementor/editor-controls");
|
|
1683
|
+
var import_icons17 = require("@elementor/icons");
|
|
1684
|
+
var import_ui44 = require("@elementor/ui");
|
|
1685
|
+
var import_i18n33 = require("@wordpress/i18n");
|
|
1289
1686
|
var buttonSize = "tiny";
|
|
1290
1687
|
var TextStyleField = () => {
|
|
1291
1688
|
const [fontStyle, setFontStyle] = useStylesField("font-style");
|
|
1292
1689
|
const [textDecoration, setTextDecoration] = useStylesField("text-decoration");
|
|
1293
|
-
const formats = [fontStyle, ...(textDecoration || "").split(" ")];
|
|
1294
|
-
|
|
1690
|
+
const formats = [fontStyle?.value, ...(textDecoration?.value || "").split(" ")];
|
|
1691
|
+
const handleSetFontStyle = (newValue) => {
|
|
1692
|
+
if (newValue === null) {
|
|
1693
|
+
return setFontStyle(null);
|
|
1694
|
+
}
|
|
1695
|
+
setFontStyle({
|
|
1696
|
+
$$type: "string",
|
|
1697
|
+
value: newValue
|
|
1698
|
+
});
|
|
1699
|
+
};
|
|
1700
|
+
const handleSetTextDecoration = (newValue) => {
|
|
1701
|
+
if (newValue === null) {
|
|
1702
|
+
return setTextDecoration(null);
|
|
1703
|
+
}
|
|
1704
|
+
setTextDecoration({
|
|
1705
|
+
$$type: "string",
|
|
1706
|
+
value: newValue
|
|
1707
|
+
});
|
|
1708
|
+
};
|
|
1709
|
+
return /* @__PURE__ */ React52.createElement(import_ui44.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React52.createElement(import_ui44.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React52.createElement(import_editor_controls38.ControlLabel, null, (0, import_i18n33.__)("Style", "elementor"))), /* @__PURE__ */ React52.createElement(import_ui44.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React52.createElement(import_ui44.ToggleButtonGroup, { value: formats }, /* @__PURE__ */ React52.createElement(
|
|
1295
1710
|
ToggleButton,
|
|
1296
1711
|
{
|
|
1297
1712
|
value: "italic",
|
|
1298
|
-
onChange: (v) =>
|
|
1713
|
+
onChange: (v) => handleSetFontStyle(fontStyle?.value === v ? null : v),
|
|
1299
1714
|
"aria-label": "italic",
|
|
1300
1715
|
sx: { marginLeft: "auto" }
|
|
1301
1716
|
},
|
|
1302
|
-
/* @__PURE__ */
|
|
1303
|
-
), /* @__PURE__ */
|
|
1717
|
+
/* @__PURE__ */ React52.createElement(import_icons17.ItalicIcon, { fontSize: buttonSize })
|
|
1718
|
+
), /* @__PURE__ */ React52.createElement(
|
|
1304
1719
|
ShorthandControl,
|
|
1305
1720
|
{
|
|
1306
1721
|
value: "line-through",
|
|
1307
|
-
currentValues: textDecoration || "",
|
|
1308
|
-
updateValues:
|
|
1722
|
+
currentValues: textDecoration?.value || "",
|
|
1723
|
+
updateValues: handleSetTextDecoration,
|
|
1309
1724
|
"aria-label": "line-through"
|
|
1310
1725
|
},
|
|
1311
|
-
/* @__PURE__ */
|
|
1312
|
-
), /* @__PURE__ */
|
|
1726
|
+
/* @__PURE__ */ React52.createElement(import_icons17.StrikethroughIcon, { fontSize: buttonSize })
|
|
1727
|
+
), /* @__PURE__ */ React52.createElement(
|
|
1313
1728
|
ShorthandControl,
|
|
1314
1729
|
{
|
|
1315
1730
|
value: "underline",
|
|
1316
|
-
currentValues: textDecoration || "",
|
|
1317
|
-
updateValues:
|
|
1731
|
+
currentValues: textDecoration?.value || "",
|
|
1732
|
+
updateValues: handleSetTextDecoration,
|
|
1318
1733
|
"aria-label": "underline"
|
|
1319
1734
|
},
|
|
1320
|
-
/* @__PURE__ */
|
|
1735
|
+
/* @__PURE__ */ React52.createElement(import_icons17.UnderlineIcon, { fontSize: buttonSize })
|
|
1321
1736
|
))));
|
|
1322
1737
|
};
|
|
1323
1738
|
var ShorthandControl = ({
|
|
@@ -1336,52 +1751,52 @@ var ShorthandControl = ({
|
|
|
1336
1751
|
updateValues([...valuesArr, newValue].join(" "));
|
|
1337
1752
|
}
|
|
1338
1753
|
};
|
|
1339
|
-
return /* @__PURE__ */
|
|
1754
|
+
return /* @__PURE__ */ React52.createElement(ToggleButton, { value, onChange: toggleValue, selected, "aria-label": ariaLabel }, children);
|
|
1340
1755
|
};
|
|
1341
1756
|
var ToggleButton = ({ onChange, ...props }) => {
|
|
1342
1757
|
const handleChange = (_e, newValue) => {
|
|
1343
1758
|
onChange(newValue);
|
|
1344
1759
|
};
|
|
1345
|
-
return /* @__PURE__ */
|
|
1760
|
+
return /* @__PURE__ */ React52.createElement(import_ui44.ToggleButton, { ...props, onChange: handleChange, size: buttonSize });
|
|
1346
1761
|
};
|
|
1347
1762
|
|
|
1348
1763
|
// src/components/style-sections/typography-section/transform-field.tsx
|
|
1349
|
-
var
|
|
1350
|
-
var
|
|
1351
|
-
var
|
|
1352
|
-
var
|
|
1353
|
-
var
|
|
1354
|
-
var
|
|
1764
|
+
var React53 = __toESM(require("react"));
|
|
1765
|
+
var import_editor_controls39 = require("@elementor/editor-controls");
|
|
1766
|
+
var import_icons18 = require("@elementor/icons");
|
|
1767
|
+
var import_ui45 = require("@elementor/ui");
|
|
1768
|
+
var import_i18n34 = require("@wordpress/i18n");
|
|
1769
|
+
var options9 = [
|
|
1355
1770
|
{
|
|
1356
1771
|
value: "capitalize",
|
|
1357
|
-
label: (0,
|
|
1358
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1772
|
+
label: (0, import_i18n34.__)("Capitalize", "elementor"),
|
|
1773
|
+
renderContent: ({ size }) => /* @__PURE__ */ React53.createElement(import_icons18.LetterCaseIcon, { fontSize: size })
|
|
1359
1774
|
},
|
|
1360
1775
|
{
|
|
1361
1776
|
value: "uppercase",
|
|
1362
|
-
label: (0,
|
|
1363
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1777
|
+
label: (0, import_i18n34.__)("Uppercase", "elementor"),
|
|
1778
|
+
renderContent: ({ size }) => /* @__PURE__ */ React53.createElement(import_icons18.LetterCaseUpperIcon, { fontSize: size })
|
|
1364
1779
|
},
|
|
1365
1780
|
{
|
|
1366
1781
|
value: "lowercase",
|
|
1367
|
-
label: (0,
|
|
1368
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1782
|
+
label: (0, import_i18n34.__)("Lowercase", "elementor"),
|
|
1783
|
+
renderContent: ({ size }) => /* @__PURE__ */ React53.createElement(import_icons18.LetterCaseLowerIcon, { fontSize: size })
|
|
1369
1784
|
}
|
|
1370
1785
|
];
|
|
1371
|
-
var TransformField = () => /* @__PURE__ */
|
|
1786
|
+
var TransformField = () => /* @__PURE__ */ React53.createElement(StylesField, { bind: "text-transform" }, /* @__PURE__ */ React53.createElement(import_ui45.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React53.createElement(import_ui45.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React53.createElement(import_editor_controls39.ControlLabel, null, (0, import_i18n34.__)("Transform", "elementor"))), /* @__PURE__ */ React53.createElement(import_ui45.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React53.createElement(import_editor_controls39.ToggleControl, { options: options9 }))));
|
|
1372
1787
|
|
|
1373
1788
|
// src/components/style-sections/typography-section/word-spacing-field.tsx
|
|
1374
|
-
var
|
|
1375
|
-
var
|
|
1376
|
-
var
|
|
1377
|
-
var
|
|
1789
|
+
var React54 = __toESM(require("react"));
|
|
1790
|
+
var import_editor_controls40 = require("@elementor/editor-controls");
|
|
1791
|
+
var import_ui46 = require("@elementor/ui");
|
|
1792
|
+
var import_i18n35 = require("@wordpress/i18n");
|
|
1378
1793
|
var WordSpacingField = () => {
|
|
1379
|
-
return /* @__PURE__ */
|
|
1794
|
+
return /* @__PURE__ */ React54.createElement(StylesField, { bind: "word-spacing" }, /* @__PURE__ */ React54.createElement(import_ui46.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React54.createElement(import_ui46.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(import_editor_controls40.ControlLabel, null, (0, import_i18n35.__)("Word Spacing", "elementor"))), /* @__PURE__ */ React54.createElement(import_ui46.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(import_editor_controls40.SizeControl, null))));
|
|
1380
1795
|
};
|
|
1381
1796
|
|
|
1382
1797
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1383
1798
|
var TypographySection = () => {
|
|
1384
|
-
return /* @__PURE__ */
|
|
1799
|
+
return /* @__PURE__ */ React55.createElement(import_ui47.Stack, { gap: 1.5 }, /* @__PURE__ */ React55.createElement(FontFamilyField, null), /* @__PURE__ */ React55.createElement(FontWeightField, null), /* @__PURE__ */ React55.createElement(FontSizeField, null), /* @__PURE__ */ React55.createElement(import_ui47.Divider, null), /* @__PURE__ */ React55.createElement(TextAlignmentField, null), /* @__PURE__ */ React55.createElement(TextColorField, null), /* @__PURE__ */ React55.createElement(CollapsibleContent, null, /* @__PURE__ */ React55.createElement(import_ui47.Stack, { gap: 1.5, sx: { pt: 1.5 } }, /* @__PURE__ */ React55.createElement(LineHeightField, null), /* @__PURE__ */ React55.createElement(LetterSpacingField, null), /* @__PURE__ */ React55.createElement(WordSpacingField, null), /* @__PURE__ */ React55.createElement(import_ui47.Divider, null), /* @__PURE__ */ React55.createElement(TextStyleField, null), /* @__PURE__ */ React55.createElement(TransformField, null), /* @__PURE__ */ React55.createElement(TextDirectionField, null), /* @__PURE__ */ React55.createElement(TextStrokeField, null))));
|
|
1385
1800
|
};
|
|
1386
1801
|
|
|
1387
1802
|
// src/components/style-tab.tsx
|
|
@@ -1390,10 +1805,10 @@ var StyleTab = () => {
|
|
|
1390
1805
|
const currentClassesProp = useCurrentClassesProp();
|
|
1391
1806
|
const [activeStyleDefId, setActiveStyleDefId] = useActiveStyleDefId(currentClassesProp);
|
|
1392
1807
|
const breakpoint = (0, import_editor_responsive.useActiveBreakpoint)();
|
|
1393
|
-
return /* @__PURE__ */
|
|
1808
|
+
return /* @__PURE__ */ React56.createElement(ClassesPropProvider, { prop: currentClassesProp }, /* @__PURE__ */ React56.createElement(StyleProvider, { meta: { breakpoint, state: null }, id: activeStyleDefId, setId: setActiveStyleDefId }, /* @__PURE__ */ React56.createElement(CssClassSelector, null), /* @__PURE__ */ React56.createElement(import_ui48.Divider, null), /* @__PURE__ */ React56.createElement(SectionsList, null, /* @__PURE__ */ React56.createElement(Section, { title: (0, import_i18n36.__)("Layout", "elementor") }, /* @__PURE__ */ React56.createElement(LayoutSection, null)), /* @__PURE__ */ React56.createElement(Section, { title: (0, import_i18n36.__)("Spacing", "elementor") }, /* @__PURE__ */ React56.createElement(SpacingSection, null)), /* @__PURE__ */ React56.createElement(Section, { title: (0, import_i18n36.__)("Size", "elementor") }, /* @__PURE__ */ React56.createElement(SizeSection, null)), /* @__PURE__ */ React56.createElement(Section, { title: (0, import_i18n36.__)("Position", "elementor") }, /* @__PURE__ */ React56.createElement(PositionSection, null)), /* @__PURE__ */ React56.createElement(Section, { title: (0, import_i18n36.__)("Typography", "elementor") }, /* @__PURE__ */ React56.createElement(TypographySection, null)), /* @__PURE__ */ React56.createElement(Section, { title: (0, import_i18n36.__)("Background", "elementor") }, /* @__PURE__ */ React56.createElement(BackgroundSection, null)), /* @__PURE__ */ React56.createElement(Section, { title: (0, import_i18n36.__)("Border", "elementor") }, /* @__PURE__ */ React56.createElement(BorderSection, null)), /* @__PURE__ */ React56.createElement(Section, { title: (0, import_i18n36.__)("Effects", "elementor") }, /* @__PURE__ */ React56.createElement(EffectsSection, null)))));
|
|
1394
1809
|
};
|
|
1395
1810
|
function useActiveStyleDefId(currentClassesProp) {
|
|
1396
|
-
const [activeStyledDefId, setActiveStyledDefId] = (0,
|
|
1811
|
+
const [activeStyledDefId, setActiveStyledDefId] = (0, import_react13.useState)(null);
|
|
1397
1812
|
const fallback = useFirstElementStyleDef(currentClassesProp);
|
|
1398
1813
|
const newId = useGeneratedId();
|
|
1399
1814
|
return [activeStyledDefId || fallback?.id || newId, setActiveStyledDefId];
|
|
@@ -1423,11 +1838,11 @@ function useCurrentClassesProp() {
|
|
|
1423
1838
|
// src/components/editing-panel-tabs.tsx
|
|
1424
1839
|
var EditingPanelTabs = () => {
|
|
1425
1840
|
const { element } = useElement();
|
|
1426
|
-
const { getTabProps, getTabPanelProps, getTabsProps } = (0,
|
|
1841
|
+
const { getTabProps, getTabPanelProps, getTabsProps } = (0, import_ui49.useTabs)("settings");
|
|
1427
1842
|
return (
|
|
1428
1843
|
// When switching between elements, the local states should be reset. We are using key to rerender the tabs.
|
|
1429
1844
|
// Reference: https://react.dev/learn/preserving-and-resetting-state#resetting-a-form-with-a-key
|
|
1430
|
-
/* @__PURE__ */
|
|
1845
|
+
/* @__PURE__ */ React57.createElement(import_react14.Fragment, { key: element.id }, /* @__PURE__ */ React57.createElement(import_ui49.Stack, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React57.createElement(import_ui49.Tabs, { variant: "fullWidth", indicatorColor: "secondary", textColor: "inherit", ...getTabsProps() }, /* @__PURE__ */ React57.createElement(import_ui49.Tab, { label: (0, import_i18n37.__)("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React57.createElement(import_ui49.Tab, { label: (0, import_i18n37.__)("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React57.createElement(import_ui49.Divider, null), /* @__PURE__ */ React57.createElement(import_ui49.TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React57.createElement(SettingsTab, null)), /* @__PURE__ */ React57.createElement(import_ui49.TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React57.createElement(StyleTab, null))))
|
|
1431
1846
|
);
|
|
1432
1847
|
};
|
|
1433
1848
|
|
|
@@ -1440,8 +1855,8 @@ var EditingPanel = () => {
|
|
|
1440
1855
|
if (!element || !elementType) {
|
|
1441
1856
|
return null;
|
|
1442
1857
|
}
|
|
1443
|
-
const panelTitle = (0,
|
|
1444
|
-
return /* @__PURE__ */
|
|
1858
|
+
const panelTitle = (0, import_i18n38.__)("Edit %s", "elementor").replace("%s", elementType.title);
|
|
1859
|
+
return /* @__PURE__ */ React58.createElement(import_ui50.ErrorBoundary, { fallback: /* @__PURE__ */ React58.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React58.createElement(import_editor_panels.Panel, null, /* @__PURE__ */ React58.createElement(import_editor_panels.PanelHeader, null, /* @__PURE__ */ React58.createElement(import_editor_panels.PanelHeaderTitle, null, panelTitle)), /* @__PURE__ */ React58.createElement(import_editor_panels.PanelBody, null, /* @__PURE__ */ React58.createElement(import_editor_controls41.ControlActionsProvider, { items: menuItems }, /* @__PURE__ */ React58.createElement(import_editor_controls41.ControlReplacementProvider, { ...controlReplacement }, /* @__PURE__ */ React58.createElement(ElementProvider, { element, elementType }, /* @__PURE__ */ React58.createElement(EditingPanelTabs, null)))))));
|
|
1445
1860
|
};
|
|
1446
1861
|
|
|
1447
1862
|
// src/panel.ts
|
|
@@ -1464,7 +1879,7 @@ var isAtomicWidgetSelected = () => {
|
|
|
1464
1879
|
// src/hooks/use-close-editor-panel.ts
|
|
1465
1880
|
var useCloseEditorPanel = () => {
|
|
1466
1881
|
const { close } = usePanelActions();
|
|
1467
|
-
return (0,
|
|
1882
|
+
return (0, import_react15.useEffect)(() => {
|
|
1468
1883
|
return (0, import_editor_v1_adapters.__privateListenTo)((0, import_editor_v1_adapters.commandStartEvent)("document/elements/delete"), (e) => {
|
|
1469
1884
|
const selectedElement = (0, import_editor_elements8.getSelectedElements)()[0];
|
|
1470
1885
|
const { container: deletedContainer } = e?.args;
|
|
@@ -1477,11 +1892,11 @@ var useCloseEditorPanel = () => {
|
|
|
1477
1892
|
};
|
|
1478
1893
|
|
|
1479
1894
|
// src/hooks/use-open-editor-panel.ts
|
|
1480
|
-
var
|
|
1895
|
+
var import_react16 = require("react");
|
|
1481
1896
|
var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
|
|
1482
1897
|
var useOpenEditorPanel = () => {
|
|
1483
1898
|
const { open } = usePanelActions();
|
|
1484
|
-
(0,
|
|
1899
|
+
(0, import_react16.useEffect)(() => {
|
|
1485
1900
|
return (0, import_editor_v1_adapters2.__privateListenTo)((0, import_editor_v1_adapters2.commandStartEvent)("panel/editor/open"), () => {
|
|
1486
1901
|
if (isAtomicWidgetSelected()) {
|
|
1487
1902
|
open();
|
|
@@ -1498,22 +1913,23 @@ var EditingPanelHooks = () => {
|
|
|
1498
1913
|
};
|
|
1499
1914
|
|
|
1500
1915
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
1501
|
-
var
|
|
1502
|
-
var
|
|
1503
|
-
var
|
|
1504
|
-
var
|
|
1505
|
-
var
|
|
1506
|
-
var
|
|
1916
|
+
var React61 = __toESM(require("react"));
|
|
1917
|
+
var import_react20 = require("react");
|
|
1918
|
+
var import_editor_controls44 = require("@elementor/editor-controls");
|
|
1919
|
+
var import_icons20 = require("@elementor/icons");
|
|
1920
|
+
var import_ui52 = require("@elementor/ui");
|
|
1921
|
+
var import_i18n40 = require("@wordpress/i18n");
|
|
1507
1922
|
|
|
1508
1923
|
// src/dynamics/dynamic-control.tsx
|
|
1509
|
-
var
|
|
1510
|
-
var
|
|
1924
|
+
var React59 = __toESM(require("react"));
|
|
1925
|
+
var import_editor_controls42 = require("@elementor/editor-controls");
|
|
1926
|
+
var import_editor_props5 = require("@elementor/editor-props");
|
|
1511
1927
|
|
|
1512
1928
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
1513
|
-
var
|
|
1929
|
+
var import_react18 = require("react");
|
|
1514
1930
|
|
|
1515
1931
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
1516
|
-
var
|
|
1932
|
+
var import_react17 = require("react");
|
|
1517
1933
|
|
|
1518
1934
|
// src/dynamics/sync/get-elementor-config.ts
|
|
1519
1935
|
var getElementorConfig2 = () => {
|
|
@@ -1534,7 +1950,8 @@ var getAtomicDynamicTags = () => {
|
|
|
1534
1950
|
};
|
|
1535
1951
|
|
|
1536
1952
|
// src/dynamics/utils.ts
|
|
1537
|
-
var
|
|
1953
|
+
var import_editor_props4 = require("@elementor/editor-props");
|
|
1954
|
+
var import_schema = require("@elementor/schema");
|
|
1538
1955
|
var DYNAMIC_PROP_TYPE_KEY = "dynamic";
|
|
1539
1956
|
var isDynamicPropType = (prop) => prop.key === DYNAMIC_PROP_TYPE_KEY;
|
|
1540
1957
|
var getDynamicPropType = (propType) => {
|
|
@@ -1542,11 +1959,18 @@ var getDynamicPropType = (propType) => {
|
|
|
1542
1959
|
return dynamicPropType && isDynamicPropType(dynamicPropType) ? dynamicPropType : null;
|
|
1543
1960
|
};
|
|
1544
1961
|
var isDynamicPropValue = (prop) => {
|
|
1545
|
-
return (0,
|
|
1962
|
+
return (0, import_editor_props4.isTransformable)(prop) && prop.$$type === DYNAMIC_PROP_TYPE_KEY;
|
|
1546
1963
|
};
|
|
1547
1964
|
var supportsDynamic = (propType) => {
|
|
1548
1965
|
return !!getDynamicPropType(propType);
|
|
1549
1966
|
};
|
|
1967
|
+
var dynamicPropTypeUtil = (0, import_editor_props4.createPropUtils)(
|
|
1968
|
+
DYNAMIC_PROP_TYPE_KEY,
|
|
1969
|
+
import_schema.z.strictObject({
|
|
1970
|
+
name: import_schema.z.string(),
|
|
1971
|
+
settings: import_schema.z.record(import_schema.z.any()).optional()
|
|
1972
|
+
})
|
|
1973
|
+
);
|
|
1550
1974
|
|
|
1551
1975
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
1552
1976
|
var usePropDynamicTags = (propName) => {
|
|
@@ -1557,7 +1981,7 @@ var usePropDynamicTags = (propName) => {
|
|
|
1557
1981
|
const propDynamicType = getDynamicPropType(propType);
|
|
1558
1982
|
categories = propDynamicType?.settings.categories || [];
|
|
1559
1983
|
}
|
|
1560
|
-
return (0,
|
|
1984
|
+
return (0, import_react17.useMemo)(() => getDynamicTagsByCategories(categories), [categories.join()]);
|
|
1561
1985
|
};
|
|
1562
1986
|
var getDynamicTagsByCategories = (categories) => {
|
|
1563
1987
|
const dynamicTags = getAtomicDynamicTags();
|
|
@@ -1573,13 +1997,13 @@ var getDynamicTagsByCategories = (categories) => {
|
|
|
1573
1997
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
1574
1998
|
var useDynamicTag = (propName, tagName) => {
|
|
1575
1999
|
const dynamicTags = usePropDynamicTags(propName);
|
|
1576
|
-
return (0,
|
|
2000
|
+
return (0, import_react18.useMemo)(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
1577
2001
|
};
|
|
1578
2002
|
|
|
1579
2003
|
// src/dynamics/dynamic-control.tsx
|
|
1580
2004
|
var DynamicControl = ({ bind, children }) => {
|
|
1581
|
-
const { value, setValue, bind: propName } = (0,
|
|
1582
|
-
const { name = "", settings } = value
|
|
2005
|
+
const { value, setValue, bind: propName } = (0, import_editor_controls42.useBoundProp)(dynamicPropTypeUtil);
|
|
2006
|
+
const { name = "", settings } = value ?? {};
|
|
1583
2007
|
const dynamicTag = useDynamicTag(propName, name);
|
|
1584
2008
|
if (!dynamicTag) {
|
|
1585
2009
|
throw new Error(`Dynamic tag ${name} not found`);
|
|
@@ -1588,60 +2012,59 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
1588
2012
|
const dynamicValue = settings?.[bind] ?? defaultValue;
|
|
1589
2013
|
const setDynamicValue = (newValue) => {
|
|
1590
2014
|
setValue({
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
[bind]: newValue
|
|
1597
|
-
}
|
|
2015
|
+
name,
|
|
2016
|
+
settings: {
|
|
2017
|
+
...settings,
|
|
2018
|
+
// The value inside the dynamic is not a transformable value, so we need to store the whole object.
|
|
2019
|
+
[bind]: (0, import_editor_props5.isTransformable)(newValue) ? newValue.value : newValue
|
|
1598
2020
|
}
|
|
1599
2021
|
});
|
|
1600
2022
|
};
|
|
1601
|
-
return /* @__PURE__ */
|
|
2023
|
+
return /* @__PURE__ */ React59.createElement(import_editor_controls42.BoundPropProvider, { setValue: setDynamicValue, value: dynamicValue, bind }, children);
|
|
1602
2024
|
};
|
|
1603
2025
|
|
|
1604
2026
|
// src/dynamics/components/dynamic-selection.tsx
|
|
1605
|
-
var
|
|
1606
|
-
var
|
|
1607
|
-
var
|
|
1608
|
-
var
|
|
1609
|
-
var
|
|
1610
|
-
var
|
|
2027
|
+
var React60 = __toESM(require("react"));
|
|
2028
|
+
var import_react19 = require("react");
|
|
2029
|
+
var import_editor_controls43 = require("@elementor/editor-controls");
|
|
2030
|
+
var import_icons19 = require("@elementor/icons");
|
|
2031
|
+
var import_ui51 = require("@elementor/ui");
|
|
2032
|
+
var import_i18n39 = require("@wordpress/i18n");
|
|
1611
2033
|
var SIZE3 = "tiny";
|
|
1612
2034
|
var DynamicSelection = ({ onSelect }) => {
|
|
1613
|
-
const [searchValue, setSearchValue] = (0,
|
|
2035
|
+
const [searchValue, setSearchValue] = (0, import_react19.useState)("");
|
|
1614
2036
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
1615
|
-
const {
|
|
2037
|
+
const { value: anyValue } = (0, import_editor_controls43.useBoundProp)();
|
|
2038
|
+
const { bind, value: dynamicvalue, setValue } = (0, import_editor_controls43.useBoundProp)(dynamicPropTypeUtil);
|
|
1616
2039
|
const { setPropValue: updatePropValueHistory } = usePropValueHistory();
|
|
1617
|
-
const isCurrentValueDynamic =
|
|
1618
|
-
const
|
|
2040
|
+
const isCurrentValueDynamic = !!dynamicvalue;
|
|
2041
|
+
const options10 = useFilteredOptions(bind, searchValue);
|
|
1619
2042
|
const handleSearch = (event) => {
|
|
1620
2043
|
setSearchValue(event.target.value);
|
|
1621
2044
|
};
|
|
1622
2045
|
const handleSetDynamicTag = (value) => {
|
|
1623
2046
|
if (!isCurrentValueDynamic) {
|
|
1624
|
-
updatePropValueHistory(bind,
|
|
2047
|
+
updatePropValueHistory(bind, anyValue);
|
|
1625
2048
|
}
|
|
1626
|
-
setValue({
|
|
2049
|
+
setValue({ name: value, settings: {} });
|
|
1627
2050
|
onSelect?.();
|
|
1628
2051
|
};
|
|
1629
|
-
return /* @__PURE__ */
|
|
1630
|
-
|
|
2052
|
+
return /* @__PURE__ */ React60.createElement(import_ui51.Stack, null, /* @__PURE__ */ React60.createElement(import_ui51.Box, { px: 1.5, pb: 1 }, /* @__PURE__ */ React60.createElement(
|
|
2053
|
+
import_ui51.TextField,
|
|
1631
2054
|
{
|
|
1632
2055
|
fullWidth: true,
|
|
1633
2056
|
size: SIZE3,
|
|
1634
2057
|
value: searchValue,
|
|
1635
2058
|
onChange: handleSearch,
|
|
1636
|
-
placeholder: (0,
|
|
2059
|
+
placeholder: (0, import_i18n39.__)("Search dynamic tag", "elementor"),
|
|
1637
2060
|
InputProps: {
|
|
1638
|
-
startAdornment: /* @__PURE__ */
|
|
2061
|
+
startAdornment: /* @__PURE__ */ React60.createElement(import_ui51.InputAdornment, { position: "start" }, /* @__PURE__ */ React60.createElement(import_icons19.SearchIcon, { fontSize: SIZE3 }))
|
|
1639
2062
|
}
|
|
1640
2063
|
}
|
|
1641
|
-
)), /* @__PURE__ */
|
|
1642
|
-
const isSelected = isCurrentValueDynamic && value ===
|
|
1643
|
-
return /* @__PURE__ */
|
|
1644
|
-
|
|
2064
|
+
)), /* @__PURE__ */ React60.createElement(import_ui51.Divider, null), /* @__PURE__ */ React60.createElement(import_ui51.Box, { sx: { overflowY: "auto", height: 260, width: 220 } }, options10.length > 0 ? /* @__PURE__ */ React60.createElement(import_ui51.MenuList, { role: "listbox", tabIndex: 0 }, options10.map(([category, items3], index) => /* @__PURE__ */ React60.createElement(import_react19.Fragment, { key: index }, /* @__PURE__ */ React60.createElement(import_ui51.ListSubheader, { sx: { typography: "caption", color: "text.tertiary" } }, dynamicGroups?.[category]?.title || category), items3.map(({ value, label: tagLabel }) => {
|
|
2065
|
+
const isSelected = isCurrentValueDynamic && value === dynamicvalue?.name;
|
|
2066
|
+
return /* @__PURE__ */ React60.createElement(
|
|
2067
|
+
import_ui51.MenuItem,
|
|
1645
2068
|
{
|
|
1646
2069
|
key: value,
|
|
1647
2070
|
selected: isSelected,
|
|
@@ -1651,20 +2074,20 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
1651
2074
|
},
|
|
1652
2075
|
tagLabel
|
|
1653
2076
|
);
|
|
1654
|
-
})))) : /* @__PURE__ */
|
|
1655
|
-
|
|
2077
|
+
})))) : /* @__PURE__ */ React60.createElement(import_ui51.Stack, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React60.createElement(import_icons19.PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React60.createElement(import_ui51.Typography, { align: "center", variant: "caption", color: "text.secondary" }, (0, import_i18n39.__)("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React60.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React60.createElement(import_ui51.Typography, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React60.createElement(
|
|
2078
|
+
import_ui51.Link,
|
|
1656
2079
|
{
|
|
1657
2080
|
color: "secondary",
|
|
1658
2081
|
variant: "caption",
|
|
1659
2082
|
component: "button",
|
|
1660
2083
|
onClick: () => setSearchValue("")
|
|
1661
2084
|
},
|
|
1662
|
-
(0,
|
|
1663
|
-
), "\xA0", (0,
|
|
2085
|
+
(0, import_i18n39.__)("Clear the filters", "elementor")
|
|
2086
|
+
), "\xA0", (0, import_i18n39.__)("and try again.", "elementor")))));
|
|
1664
2087
|
};
|
|
1665
2088
|
var useFilteredOptions = (bind, searchValue) => {
|
|
1666
2089
|
const dynamicTags = usePropDynamicTags(bind);
|
|
1667
|
-
const
|
|
2090
|
+
const options10 = dynamicTags.reduce((categories, { name, label, group }) => {
|
|
1668
2091
|
const isVisible = label.toLowerCase().includes(searchValue.trim().toLowerCase());
|
|
1669
2092
|
if (!isVisible) {
|
|
1670
2093
|
return categories;
|
|
@@ -1675,89 +2098,90 @@ var useFilteredOptions = (bind, searchValue) => {
|
|
|
1675
2098
|
categories.get(group)?.push({ label, value: name });
|
|
1676
2099
|
return categories;
|
|
1677
2100
|
}, /* @__PURE__ */ new Map());
|
|
1678
|
-
return [...
|
|
2101
|
+
return [...options10];
|
|
1679
2102
|
};
|
|
1680
2103
|
|
|
1681
2104
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
1682
2105
|
var SIZE4 = "tiny";
|
|
1683
2106
|
var DynamicSelectionControl = () => {
|
|
1684
|
-
const {
|
|
2107
|
+
const { setValue: setAnyValue } = (0, import_editor_controls44.useBoundProp)();
|
|
2108
|
+
const { bind, value } = (0, import_editor_controls44.useBoundProp)(dynamicPropTypeUtil);
|
|
1685
2109
|
const { getPropValue: getPropValueFromHistory } = usePropValueHistory();
|
|
1686
|
-
const { name: tagName = "" } = value
|
|
1687
|
-
const selectionPopoverId = (0,
|
|
1688
|
-
const selectionPopoverState = (0,
|
|
2110
|
+
const { name: tagName = "" } = value;
|
|
2111
|
+
const selectionPopoverId = (0, import_react20.useId)();
|
|
2112
|
+
const selectionPopoverState = (0, import_ui52.usePopupState)({ variant: "popover", popupId: selectionPopoverId });
|
|
1689
2113
|
const dynamicTag = useDynamicTag(bind, tagName);
|
|
1690
2114
|
const removeDynamicTag = () => {
|
|
1691
2115
|
const propValue = getPropValueFromHistory(bind);
|
|
1692
|
-
|
|
2116
|
+
setAnyValue(propValue ?? null);
|
|
1693
2117
|
};
|
|
1694
2118
|
if (!dynamicTag) {
|
|
1695
2119
|
throw new Error(`Dynamic tag ${tagName} not found`);
|
|
1696
2120
|
}
|
|
1697
|
-
return /* @__PURE__ */
|
|
1698
|
-
|
|
2121
|
+
return /* @__PURE__ */ React61.createElement(import_ui52.Box, null, /* @__PURE__ */ React61.createElement(
|
|
2122
|
+
import_ui52.UnstableTag,
|
|
1699
2123
|
{
|
|
1700
2124
|
fullWidth: true,
|
|
1701
2125
|
showActionsOnHover: true,
|
|
1702
2126
|
label: dynamicTag.label,
|
|
1703
|
-
startIcon: /* @__PURE__ */
|
|
1704
|
-
...(0,
|
|
1705
|
-
actions: /* @__PURE__ */
|
|
1706
|
-
|
|
2127
|
+
startIcon: /* @__PURE__ */ React61.createElement(import_icons20.DatabaseIcon, { fontSize: SIZE4 }),
|
|
2128
|
+
...(0, import_ui52.bindTrigger)(selectionPopoverState),
|
|
2129
|
+
actions: /* @__PURE__ */ React61.createElement(React61.Fragment, null, /* @__PURE__ */ React61.createElement(DynamicSettingsPopover, { dynamicTag }), /* @__PURE__ */ React61.createElement(
|
|
2130
|
+
import_ui52.IconButton,
|
|
1707
2131
|
{
|
|
1708
2132
|
size: SIZE4,
|
|
1709
2133
|
onClick: removeDynamicTag,
|
|
1710
|
-
"aria-label": (0,
|
|
2134
|
+
"aria-label": (0, import_i18n40.__)("Remove dynamic value", "elementor")
|
|
1711
2135
|
},
|
|
1712
|
-
/* @__PURE__ */
|
|
2136
|
+
/* @__PURE__ */ React61.createElement(import_icons20.XIcon, { fontSize: SIZE4 })
|
|
1713
2137
|
))
|
|
1714
2138
|
}
|
|
1715
|
-
), /* @__PURE__ */
|
|
1716
|
-
|
|
2139
|
+
), /* @__PURE__ */ React61.createElement(
|
|
2140
|
+
import_ui52.Popover,
|
|
1717
2141
|
{
|
|
1718
2142
|
disablePortal: true,
|
|
1719
2143
|
disableScrollLock: true,
|
|
1720
2144
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
1721
|
-
...(0,
|
|
2145
|
+
...(0, import_ui52.bindPopover)(selectionPopoverState)
|
|
1722
2146
|
},
|
|
1723
|
-
/* @__PURE__ */
|
|
2147
|
+
/* @__PURE__ */ React61.createElement(import_ui52.Stack, null, /* @__PURE__ */ React61.createElement(import_ui52.Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React61.createElement(import_icons20.DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React61.createElement(import_ui52.Typography, { variant: "subtitle2" }, (0, import_i18n40.__)("Dynamic Tags", "elementor")), /* @__PURE__ */ React61.createElement(import_ui52.IconButton, { size: SIZE4, sx: { ml: "auto" }, onClick: selectionPopoverState.close }, /* @__PURE__ */ React61.createElement(import_icons20.XIcon, { fontSize: SIZE4 }))), /* @__PURE__ */ React61.createElement(DynamicSelection, { onSelect: selectionPopoverState.close }))
|
|
1724
2148
|
));
|
|
1725
2149
|
};
|
|
1726
2150
|
var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
1727
|
-
const popupId = (0,
|
|
1728
|
-
const settingsPopupState = (0,
|
|
2151
|
+
const popupId = (0, import_react20.useId)();
|
|
2152
|
+
const settingsPopupState = (0, import_ui52.usePopupState)({ variant: "popover", popupId });
|
|
1729
2153
|
const hasDynamicSettings = !!dynamicTag.atomic_controls.length;
|
|
1730
2154
|
if (!hasDynamicSettings) {
|
|
1731
2155
|
return null;
|
|
1732
2156
|
}
|
|
1733
|
-
return /* @__PURE__ */
|
|
1734
|
-
|
|
2157
|
+
return /* @__PURE__ */ React61.createElement(React61.Fragment, null, /* @__PURE__ */ React61.createElement(
|
|
2158
|
+
import_ui52.IconButton,
|
|
1735
2159
|
{
|
|
1736
2160
|
size: SIZE4,
|
|
1737
|
-
...(0,
|
|
1738
|
-
"aria-label": (0,
|
|
2161
|
+
...(0, import_ui52.bindTrigger)(settingsPopupState),
|
|
2162
|
+
"aria-label": (0, import_i18n40.__)("Settings", "elementor")
|
|
1739
2163
|
},
|
|
1740
|
-
/* @__PURE__ */
|
|
1741
|
-
), /* @__PURE__ */
|
|
1742
|
-
|
|
2164
|
+
/* @__PURE__ */ React61.createElement(import_icons20.SettingsIcon, { fontSize: SIZE4 })
|
|
2165
|
+
), /* @__PURE__ */ React61.createElement(
|
|
2166
|
+
import_ui52.Popover,
|
|
1743
2167
|
{
|
|
1744
2168
|
disableScrollLock: true,
|
|
1745
2169
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
1746
|
-
...(0,
|
|
2170
|
+
...(0, import_ui52.bindPopover)(settingsPopupState)
|
|
1747
2171
|
},
|
|
1748
|
-
/* @__PURE__ */
|
|
2172
|
+
/* @__PURE__ */ React61.createElement(import_ui52.Paper, { component: import_ui52.Stack, sx: { minHeight: "300px", width: "220px" } }, /* @__PURE__ */ React61.createElement(import_ui52.Stack, { direction: "row", alignItems: "center", px: 1.5, pt: 2, pb: 1 }, /* @__PURE__ */ React61.createElement(import_icons20.DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React61.createElement(import_ui52.Typography, { variant: "subtitle2" }, dynamicTag.label), /* @__PURE__ */ React61.createElement(import_ui52.IconButton, { sx: { ml: "auto" }, size: SIZE4, onClick: settingsPopupState.close }, /* @__PURE__ */ React61.createElement(import_icons20.XIcon, { fontSize: SIZE4 }))), /* @__PURE__ */ React61.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls }))
|
|
1749
2173
|
));
|
|
1750
2174
|
};
|
|
1751
2175
|
var DynamicSettings = ({ controls }) => {
|
|
1752
2176
|
const tabs = controls.filter(({ type }) => type === "section");
|
|
1753
|
-
const { getTabsProps, getTabProps, getTabPanelProps } = (0,
|
|
2177
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui52.useTabs)(0);
|
|
1754
2178
|
if (!tabs.length) {
|
|
1755
2179
|
return null;
|
|
1756
2180
|
}
|
|
1757
|
-
return /* @__PURE__ */
|
|
1758
|
-
return /* @__PURE__ */
|
|
2181
|
+
return /* @__PURE__ */ React61.createElement(React61.Fragment, null, /* @__PURE__ */ React61.createElement(import_ui52.Tabs, { indicatorColor: "secondary", textColor: "secondary", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React61.createElement(import_ui52.Tab, { key: index, label: value.label, sx: { px: 1, py: 0.5 }, ...getTabProps(index) }))), /* @__PURE__ */ React61.createElement(import_ui52.Divider, null), tabs.map(({ value }, index) => {
|
|
2182
|
+
return /* @__PURE__ */ React61.createElement(import_ui52.TabPanel, { key: index, sx: { flexGrow: 1 }, ...getTabPanelProps(index) }, /* @__PURE__ */ React61.createElement(import_ui52.Stack, { gap: 1, px: 2 }, value.items.map((item) => {
|
|
1759
2183
|
if (item.type === "control") {
|
|
1760
|
-
return /* @__PURE__ */
|
|
2184
|
+
return /* @__PURE__ */ React61.createElement(Control3, { key: item.value.bind, control: item.value });
|
|
1761
2185
|
}
|
|
1762
2186
|
return null;
|
|
1763
2187
|
})));
|
|
@@ -1767,24 +2191,24 @@ var Control3 = ({ control }) => {
|
|
|
1767
2191
|
if (!getControlByType(control.type)) {
|
|
1768
2192
|
return null;
|
|
1769
2193
|
}
|
|
1770
|
-
return /* @__PURE__ */
|
|
2194
|
+
return /* @__PURE__ */ React61.createElement(DynamicControl, { bind: control.bind }, control.label ? /* @__PURE__ */ React61.createElement(import_editor_controls44.ControlLabel, null, control.label) : null, /* @__PURE__ */ React61.createElement(Control, { type: control.type, props: control.props }));
|
|
1771
2195
|
};
|
|
1772
2196
|
|
|
1773
2197
|
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
1774
|
-
var
|
|
1775
|
-
var
|
|
1776
|
-
var
|
|
1777
|
-
var
|
|
2198
|
+
var React62 = __toESM(require("react"));
|
|
2199
|
+
var import_editor_controls45 = require("@elementor/editor-controls");
|
|
2200
|
+
var import_icons21 = require("@elementor/icons");
|
|
2201
|
+
var import_i18n41 = require("@wordpress/i18n");
|
|
1778
2202
|
var usePropDynamicAction = () => {
|
|
1779
|
-
const { bind } = (0,
|
|
2203
|
+
const { bind } = (0, import_editor_controls45.useBoundProp)();
|
|
1780
2204
|
const { elementType } = useElement();
|
|
1781
2205
|
const propType = elementType.propsSchema[bind];
|
|
1782
2206
|
const visible = !!propType && supportsDynamic(propType);
|
|
1783
2207
|
return {
|
|
1784
2208
|
visible,
|
|
1785
|
-
icon:
|
|
1786
|
-
title: (0,
|
|
1787
|
-
popoverContent: ({ closePopover }) => /* @__PURE__ */
|
|
2209
|
+
icon: import_icons21.DatabaseIcon,
|
|
2210
|
+
title: (0, import_i18n41.__)("Dynamic Tags", "elementor"),
|
|
2211
|
+
popoverContent: ({ closePopover }) => /* @__PURE__ */ React62.createElement(DynamicSelection, { onSelect: closePopover })
|
|
1788
2212
|
};
|
|
1789
2213
|
};
|
|
1790
2214
|
|