@elementor/editor-editing-panel 1.24.0 → 1.27.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 +64 -0
- package/dist/index.js +294 -194
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +304 -204
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -7
- package/src/components/css-classes/css-class-item.tsx +2 -2
- package/src/components/css-classes/css-class-menu.tsx +55 -9
- package/src/components/css-classes/css-class-selector.tsx +6 -5
- package/src/components/editing-panel-tabs.tsx +1 -8
- package/src/components/style-indicator.tsx +23 -0
- package/src/components/style-sections/border-section/border-radius-field.tsx +4 -5
- package/src/components/style-sections/border-section/border-width-field.tsx +2 -3
- package/src/components/style-sections/layout-section/flex-size-field.tsx +28 -18
- package/src/components/style-sections/typography-section/text-alignment-field.tsx +5 -6
- package/src/contexts/style-context.tsx +1 -1
- package/src/controls-registry/control-type-container.tsx +2 -2
- package/src/dynamics/dynamic-transformer.ts +61 -0
- package/src/dynamics/errors.ts +6 -0
- package/src/dynamics/init.ts +6 -0
- package/src/dynamics/types.ts +17 -0
- package/src/styles-inheritance/create-snapshots-manager.ts +8 -8
- package/src/styles-inheritance/create-styles-inheritance.ts +8 -4
- package/src/styles-inheritance/styles-inheritance-indicator.tsx +13 -31
- package/src/styles-inheritance/types.ts +7 -6
package/dist/index.mjs
CHANGED
|
@@ -10,14 +10,14 @@ import * as React7 from "react";
|
|
|
10
10
|
import { getElementSetting, updateElementSettings as updateElementSettings2, useElementSetting as useElementSetting2 } from "@elementor/editor-elements";
|
|
11
11
|
import { classesPropTypeUtil } from "@elementor/editor-props";
|
|
12
12
|
import {
|
|
13
|
-
ELEMENTS_STYLES_PROVIDER_KEY,
|
|
13
|
+
ELEMENTS_STYLES_PROVIDER_KEY as ELEMENTS_STYLES_PROVIDER_KEY2,
|
|
14
14
|
stylesRepository as stylesRepository4,
|
|
15
15
|
useCreateActionsByProvider,
|
|
16
16
|
useProviders
|
|
17
17
|
} from "@elementor/editor-styles-repository";
|
|
18
18
|
import { MapPinIcon } from "@elementor/icons";
|
|
19
19
|
import { createLocation } from "@elementor/locations";
|
|
20
|
-
import { Chip as Chip2, Stack as
|
|
20
|
+
import { Chip as Chip2, Stack as Stack3, Typography as Typography2 } from "@elementor/ui";
|
|
21
21
|
import { __ as __3 } from "@wordpress/i18n";
|
|
22
22
|
|
|
23
23
|
// src/contexts/classes-prop-context.tsx
|
|
@@ -236,7 +236,7 @@ import { DotsVerticalIcon } from "@elementor/icons";
|
|
|
236
236
|
import {
|
|
237
237
|
bindTrigger,
|
|
238
238
|
Chip,
|
|
239
|
-
Stack,
|
|
239
|
+
Stack as Stack2,
|
|
240
240
|
Typography,
|
|
241
241
|
UnstableChipGroup,
|
|
242
242
|
usePopupState
|
|
@@ -245,9 +245,9 @@ import { __ as __2 } from "@wordpress/i18n";
|
|
|
245
245
|
|
|
246
246
|
// src/components/css-classes/css-class-menu.tsx
|
|
247
247
|
import * as React5 from "react";
|
|
248
|
-
import { stylesRepository as stylesRepository2 } from "@elementor/editor-styles-repository";
|
|
248
|
+
import { ELEMENTS_STYLES_PROVIDER_KEY, stylesRepository as stylesRepository2 } from "@elementor/editor-styles-repository";
|
|
249
249
|
import { MenuListItem } from "@elementor/editor-ui";
|
|
250
|
-
import { bindMenu, Divider, Menu, MenuSubheader } from "@elementor/ui";
|
|
250
|
+
import { bindMenu, Divider, Menu, MenuSubheader, Stack } from "@elementor/ui";
|
|
251
251
|
import { __ } from "@wordpress/i18n";
|
|
252
252
|
|
|
253
253
|
// src/hooks/use-unapply-class.ts
|
|
@@ -272,16 +272,40 @@ var useUnapplyClass = (classId) => {
|
|
|
272
272
|
};
|
|
273
273
|
};
|
|
274
274
|
|
|
275
|
+
// src/components/style-indicator.tsx
|
|
276
|
+
import { styled as styled2 } from "@elementor/ui";
|
|
277
|
+
var StyleIndicator = styled2("div", {
|
|
278
|
+
shouldForwardProp: (prop) => prop !== "variant"
|
|
279
|
+
})`
|
|
280
|
+
width: 5px;
|
|
281
|
+
height: 5px;
|
|
282
|
+
border-radius: 50%;
|
|
283
|
+
background-color: ${({ theme, variant }) => {
|
|
284
|
+
switch (variant) {
|
|
285
|
+
case "overridden":
|
|
286
|
+
return theme.palette.warning.light;
|
|
287
|
+
case "global":
|
|
288
|
+
return theme.palette.global.dark;
|
|
289
|
+
case "local":
|
|
290
|
+
return theme.palette.accent.main;
|
|
291
|
+
default:
|
|
292
|
+
return theme.palette.text.disabled;
|
|
293
|
+
}
|
|
294
|
+
}};
|
|
295
|
+
`;
|
|
296
|
+
|
|
275
297
|
// src/components/css-classes/css-class-menu.tsx
|
|
276
298
|
var STATES = ["hover", "focus", "active"];
|
|
277
299
|
function CssClassMenu({ styleId, provider, popupState, handleRename, anchorEl }) {
|
|
300
|
+
const styledStates = useStyledStates(styleId);
|
|
301
|
+
const indicatorVariant = provider === ELEMENTS_STYLES_PROVIDER_KEY ? "local" : "global";
|
|
278
302
|
const handleKeyDown = (e) => {
|
|
279
303
|
e.stopPropagation();
|
|
280
304
|
};
|
|
281
305
|
return /* @__PURE__ */ React5.createElement(
|
|
282
306
|
Menu,
|
|
283
307
|
{
|
|
284
|
-
MenuListProps: { dense: true },
|
|
308
|
+
MenuListProps: { dense: true, sx: { minWidth: "160px" } },
|
|
285
309
|
...bindMenu(popupState),
|
|
286
310
|
anchorEl,
|
|
287
311
|
anchorOrigin: {
|
|
@@ -295,13 +319,40 @@ function CssClassMenu({ styleId, provider, popupState, handleRename, anchorEl })
|
|
|
295
319
|
onKeyDown: handleKeyDown
|
|
296
320
|
},
|
|
297
321
|
getMenuItemsByProvider({ provider, styleId, handleRename, closeMenu: popupState.close }),
|
|
298
|
-
/* @__PURE__ */ React5.createElement(MenuSubheader, { sx: { typography: "caption", color: "text.secondary", pb: 0.5, pt: 1 } }, __("
|
|
299
|
-
/* @__PURE__ */ React5.createElement(
|
|
322
|
+
/* @__PURE__ */ React5.createElement(MenuSubheader, { sx: { typography: "caption", color: "text.secondary", pb: 0.5, pt: 1 } }, __("States", "elementor")),
|
|
323
|
+
/* @__PURE__ */ React5.createElement(
|
|
324
|
+
StateMenuItem,
|
|
325
|
+
{
|
|
326
|
+
key: "normal",
|
|
327
|
+
state: null,
|
|
328
|
+
styleId,
|
|
329
|
+
closeMenu: popupState.close,
|
|
330
|
+
isStyled: styledStates.normal,
|
|
331
|
+
indicatorVariant
|
|
332
|
+
}
|
|
333
|
+
),
|
|
300
334
|
STATES.map((state) => {
|
|
301
|
-
return /* @__PURE__ */ React5.createElement(
|
|
335
|
+
return /* @__PURE__ */ React5.createElement(
|
|
336
|
+
StateMenuItem,
|
|
337
|
+
{
|
|
338
|
+
key: state,
|
|
339
|
+
state,
|
|
340
|
+
styleId,
|
|
341
|
+
closeMenu: popupState.close,
|
|
342
|
+
isStyled: styledStates[state],
|
|
343
|
+
indicatorVariant
|
|
344
|
+
}
|
|
345
|
+
);
|
|
302
346
|
})
|
|
303
347
|
);
|
|
304
348
|
}
|
|
349
|
+
function useStyledStates(styleId) {
|
|
350
|
+
const { meta } = useStyle();
|
|
351
|
+
const styleDef = stylesRepository2.all().find((style) => style.id === styleId);
|
|
352
|
+
return Object.fromEntries(
|
|
353
|
+
styleDef?.variants.filter((variant) => meta.breakpoint === variant.meta.breakpoint).map((variant) => [variant.meta.state ?? "normal", true]) ?? []
|
|
354
|
+
);
|
|
355
|
+
}
|
|
305
356
|
function getMenuItemsByProvider({
|
|
306
357
|
provider,
|
|
307
358
|
styleId,
|
|
@@ -324,7 +375,7 @@ function getMenuItemsByProvider({
|
|
|
324
375
|
MenuSubheader,
|
|
325
376
|
{
|
|
326
377
|
key: "provider-label",
|
|
327
|
-
sx: { typography: "caption", color: "text.secondary", pb: 0.5, pt: 1 }
|
|
378
|
+
sx: { typography: "caption", color: "text.secondary", pb: 0.5, pt: 1, textTransform: "capitalize" }
|
|
328
379
|
},
|
|
329
380
|
providerInstance?.labels?.singular
|
|
330
381
|
)
|
|
@@ -333,7 +384,14 @@ function getMenuItemsByProvider({
|
|
|
333
384
|
}
|
|
334
385
|
return actions;
|
|
335
386
|
}
|
|
336
|
-
function StateMenuItem({
|
|
387
|
+
function StateMenuItem({
|
|
388
|
+
state,
|
|
389
|
+
styleId,
|
|
390
|
+
closeMenu,
|
|
391
|
+
isStyled = false,
|
|
392
|
+
indicatorVariant,
|
|
393
|
+
...props
|
|
394
|
+
}) {
|
|
337
395
|
const { id: activeId, setId: setActiveId, setMetaState: setActiveMetaState, meta } = useStyle();
|
|
338
396
|
const { state: activeState } = meta;
|
|
339
397
|
const isActive = styleId === activeId;
|
|
@@ -352,7 +410,7 @@ function StateMenuItem({ state, styleId, closeMenu, ...props }) {
|
|
|
352
410
|
closeMenu();
|
|
353
411
|
}
|
|
354
412
|
},
|
|
355
|
-
|
|
413
|
+
/* @__PURE__ */ React5.createElement(Stack, { gap: 0.75, direction: "row", alignItems: "center" }, isStyled && /* @__PURE__ */ React5.createElement(StyleIndicator, { "aria-label": __("Has style", "elementor"), variant: indicatorVariant }), state ?? "normal")
|
|
356
414
|
);
|
|
357
415
|
}
|
|
358
416
|
function UnapplyClassMenuItem({ styleId, closeMenu, ...props }) {
|
|
@@ -465,7 +523,7 @@ function CssClassItem({
|
|
|
465
523
|
{
|
|
466
524
|
icon: isShowingState ? void 0 : /* @__PURE__ */ React6.createElement(DotsVerticalIcon, { fontSize: "tiny" }),
|
|
467
525
|
size: CHIP_SIZE,
|
|
468
|
-
label: isShowingState ? /* @__PURE__ */ React6.createElement(
|
|
526
|
+
label: isShowingState ? /* @__PURE__ */ React6.createElement(Stack2, { direction: "row", gap: 0.5, alignItems: "center" }, /* @__PURE__ */ React6.createElement(Typography, { variant: "inherit" }, meta.state), /* @__PURE__ */ React6.createElement(DotsVerticalIcon, { fontSize: "tiny" })) : void 0,
|
|
469
527
|
variant: "filled",
|
|
470
528
|
shape: "rounded",
|
|
471
529
|
color,
|
|
@@ -492,10 +550,10 @@ function CssClassItem({
|
|
|
492
550
|
}
|
|
493
551
|
var validateLabel = (newLabel) => {
|
|
494
552
|
if (!stylesRepository3.isLabelValid(newLabel)) {
|
|
495
|
-
return __2("
|
|
553
|
+
return __2("Invalid format", "elementor");
|
|
496
554
|
}
|
|
497
555
|
if (stylesRepository3.isLabelExist(newLabel)) {
|
|
498
|
-
return __2("
|
|
556
|
+
return __2("Name exists", "elementor");
|
|
499
557
|
}
|
|
500
558
|
return null;
|
|
501
559
|
};
|
|
@@ -509,7 +567,7 @@ var EMPTY_OPTION = {
|
|
|
509
567
|
fixed: true,
|
|
510
568
|
color: "accent",
|
|
511
569
|
icon: /* @__PURE__ */ React7.createElement(MapPinIcon, null),
|
|
512
|
-
provider:
|
|
570
|
+
provider: ELEMENTS_STYLES_PROVIDER_KEY2
|
|
513
571
|
};
|
|
514
572
|
var { Slot: ClassSelectorActionsSlot, inject: injectIntoClassSelectorActions } = createLocation();
|
|
515
573
|
function CssClassSelector() {
|
|
@@ -520,7 +578,7 @@ function CssClassSelector() {
|
|
|
520
578
|
const handleApply = useHandleApply(appliedIds, setAppliedIds);
|
|
521
579
|
const applied = useAppliedOptions(options13, appliedIds);
|
|
522
580
|
const active = applied.find((option) => option.value === activeId) ?? EMPTY_OPTION;
|
|
523
|
-
return /* @__PURE__ */ React7.createElement(
|
|
581
|
+
return /* @__PURE__ */ React7.createElement(Stack3, { gap: 1, p: 2 }, /* @__PURE__ */ React7.createElement(Stack3, { direction: "row", gap: 1, alignItems: "center", justifyContent: "space-between" }, /* @__PURE__ */ React7.createElement(Typography2, { component: "label", variant: "caption", htmlFor: ID }, __3("Classes", "elementor")), /* @__PURE__ */ React7.createElement(Stack3, { direction: "row", gap: 1 }, /* @__PURE__ */ React7.createElement(ClassSelectorActionsSlot, null))), /* @__PURE__ */ React7.createElement(
|
|
524
582
|
MultiCombobox,
|
|
525
583
|
{
|
|
526
584
|
id: ID,
|
|
@@ -570,7 +628,7 @@ function useOptions() {
|
|
|
570
628
|
const { element } = useElement();
|
|
571
629
|
const isProviderEditable = (provider) => !!provider.actions.updateProps;
|
|
572
630
|
return useProviders().filter(isProviderEditable).flatMap((provider) => {
|
|
573
|
-
const isElements = provider.key ===
|
|
631
|
+
const isElements = provider.key === ELEMENTS_STYLES_PROVIDER_KEY2;
|
|
574
632
|
const styleDefs = provider.actions.get({ elementId: element.id });
|
|
575
633
|
if (isElements && styleDefs.length === 0) {
|
|
576
634
|
return [EMPTY_OPTION];
|
|
@@ -583,7 +641,8 @@ function useOptions() {
|
|
|
583
641
|
color: isElements ? "accent" : "global",
|
|
584
642
|
icon: isElements ? /* @__PURE__ */ React7.createElement(MapPinIcon, null) : null,
|
|
585
643
|
provider: provider.key,
|
|
586
|
-
|
|
644
|
+
// translators: %s is the plural label of the provider (e.g "Existing classes").
|
|
645
|
+
group: __3("Existing %s", "elementor").replace("%s", provider.labels?.plural ?? "")
|
|
587
646
|
};
|
|
588
647
|
});
|
|
589
648
|
});
|
|
@@ -595,9 +654,9 @@ function useCreateActions({
|
|
|
595
654
|
return useCreateActionsByProvider().map(([provider, create]) => {
|
|
596
655
|
return {
|
|
597
656
|
// translators: %s is the label of the new class.
|
|
598
|
-
label: (value) => __3('Create
|
|
599
|
-
// translators: %s is the singular label of css class provider (e.g "
|
|
600
|
-
group: __3("Create
|
|
657
|
+
label: (value) => __3('Create "%s"', "elementor").replace("%s", value),
|
|
658
|
+
// translators: %s is the singular label of css class provider (e.g "CSS Class").
|
|
659
|
+
group: __3("Create a new %s", "elementor").replace("%s", provider.labels?.singular ?? ""),
|
|
601
660
|
condition: (_, inputValue) => isLabelValid(inputValue) && !hasReachedLimit(provider),
|
|
602
661
|
apply: (label) => {
|
|
603
662
|
const createdId = create(label);
|
|
@@ -622,7 +681,7 @@ function isLabelValid(newLabel) {
|
|
|
622
681
|
function useAppliedOptions(options13, appliedIds) {
|
|
623
682
|
const applied = options13.filter((option) => option.value && appliedIds.includes(option.value));
|
|
624
683
|
const hasElementsProviderStyleApplied = applied.some(
|
|
625
|
-
(option) => option.provider ===
|
|
684
|
+
(option) => option.provider === ELEMENTS_STYLES_PROVIDER_KEY2
|
|
626
685
|
);
|
|
627
686
|
if (!hasElementsProviderStyleApplied) {
|
|
628
687
|
applied.unshift(EMPTY_OPTION);
|
|
@@ -693,7 +752,7 @@ import { createMenu } from "@elementor/menus";
|
|
|
693
752
|
import * as React8 from "react";
|
|
694
753
|
import { useId as useId2 } from "react";
|
|
695
754
|
import { XIcon } from "@elementor/icons";
|
|
696
|
-
import { bindPopover, bindToggle, IconButton, Popover, Stack as
|
|
755
|
+
import { bindPopover, bindToggle, IconButton, Popover, Stack as Stack4, Tooltip, Typography as Typography3, usePopupState as usePopupState2 } from "@elementor/ui";
|
|
697
756
|
var SIZE = "tiny";
|
|
698
757
|
function PopoverAction({
|
|
699
758
|
title,
|
|
@@ -720,7 +779,7 @@ function PopoverAction({
|
|
|
720
779
|
},
|
|
721
780
|
...bindPopover(popupState)
|
|
722
781
|
},
|
|
723
|
-
/* @__PURE__ */ React8.createElement(
|
|
782
|
+
/* @__PURE__ */ React8.createElement(Stack4, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React8.createElement(Icon, { fontSize: SIZE, sx: { mr: 0.5 } }), /* @__PURE__ */ React8.createElement(Typography3, { variant: "subtitle2" }, title), /* @__PURE__ */ React8.createElement(IconButton, { sx: { ml: "auto" }, size: SIZE, onClick: popupState.close }, /* @__PURE__ */ React8.createElement(XIcon, { fontSize: SIZE }))),
|
|
724
783
|
/* @__PURE__ */ React8.createElement(PopoverContent2, { closePopover: popupState.close })
|
|
725
784
|
));
|
|
726
785
|
}
|
|
@@ -742,7 +801,7 @@ function EditorPanelErrorFallback() {
|
|
|
742
801
|
// src/components/editing-panel-tabs.tsx
|
|
743
802
|
import * as React66 from "react";
|
|
744
803
|
import { Fragment as Fragment8 } from "react";
|
|
745
|
-
import { Divider as Divider5, Stack as
|
|
804
|
+
import { Divider as Divider5, Stack as Stack16, Tab, TabPanel, Tabs, useTabs } from "@elementor/ui";
|
|
746
805
|
import { __ as __44 } from "@wordpress/i18n";
|
|
747
806
|
|
|
748
807
|
// src/components/settings-tab.tsx
|
|
@@ -791,7 +850,7 @@ var Control = ({ props, type }) => {
|
|
|
791
850
|
|
|
792
851
|
// src/controls-registry/control-type-container.tsx
|
|
793
852
|
import * as React11 from "react";
|
|
794
|
-
import { Box as Box3, styled as
|
|
853
|
+
import { Box as Box3, styled as styled3 } from "@elementor/ui";
|
|
795
854
|
var ControlTypeContainer = ({
|
|
796
855
|
controlType,
|
|
797
856
|
children
|
|
@@ -799,7 +858,7 @@ var ControlTypeContainer = ({
|
|
|
799
858
|
const layout = getLayoutByType(controlType);
|
|
800
859
|
return /* @__PURE__ */ React11.createElement(StyledContainer, { layout }, children);
|
|
801
860
|
};
|
|
802
|
-
var StyledContainer =
|
|
861
|
+
var StyledContainer = styled3(Box3, {
|
|
803
862
|
shouldForwardProp: (prop) => !["layout"].includes(prop)
|
|
804
863
|
})(({ layout, theme }) => ({
|
|
805
864
|
display: "grid",
|
|
@@ -809,8 +868,8 @@ var StyledContainer = styled2(Box3, {
|
|
|
809
868
|
var getGridLayout = (layout) => ({
|
|
810
869
|
justifyContent: "space-between",
|
|
811
870
|
gridTemplateColumns: {
|
|
812
|
-
full: "1fr",
|
|
813
|
-
"two-columns": "repeat(2, 1fr)"
|
|
871
|
+
full: "minmax(0, 1fr)",
|
|
872
|
+
"two-columns": "repeat(2, minmax(0, 1fr))"
|
|
814
873
|
}[layout]
|
|
815
874
|
});
|
|
816
875
|
|
|
@@ -850,12 +909,12 @@ var SettingsField = ({ bind, children }) => {
|
|
|
850
909
|
// src/components/section.tsx
|
|
851
910
|
import * as React13 from "react";
|
|
852
911
|
import { useId as useId3, useState as useState3 } from "react";
|
|
853
|
-
import { Collapse, Divider as Divider2, ListItemButton, ListItemText, Stack as
|
|
912
|
+
import { Collapse, Divider as Divider2, ListItemButton, ListItemText, Stack as Stack5 } from "@elementor/ui";
|
|
854
913
|
|
|
855
914
|
// src/components/collapse-icon.tsx
|
|
856
915
|
import { ChevronDownIcon } from "@elementor/icons";
|
|
857
|
-
import { styled as
|
|
858
|
-
var CollapseIcon =
|
|
916
|
+
import { styled as styled4 } from "@elementor/ui";
|
|
917
|
+
var CollapseIcon = styled4(ChevronDownIcon, {
|
|
859
918
|
shouldForwardProp: (prop) => prop !== "open"
|
|
860
919
|
})(({ theme, open }) => ({
|
|
861
920
|
transform: open ? "rotate(180deg)" : "rotate(0deg)",
|
|
@@ -886,7 +945,7 @@ function Section({ title, children, defaultExpanded = false }) {
|
|
|
886
945
|
}
|
|
887
946
|
),
|
|
888
947
|
/* @__PURE__ */ React13.createElement(CollapseIcon, { open: isOpen, color: "secondary", fontSize: "tiny" })
|
|
889
|
-
), /* @__PURE__ */ React13.createElement(Collapse, { id: contentId, "aria-labelledby": labelId, in: isOpen, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React13.createElement(
|
|
948
|
+
), /* @__PURE__ */ React13.createElement(Collapse, { id: contentId, "aria-labelledby": labelId, in: isOpen, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React13.createElement(Stack5, { gap: 2.5, p: 2 }, children)), /* @__PURE__ */ React13.createElement(Divider2, null));
|
|
890
949
|
}
|
|
891
950
|
|
|
892
951
|
// src/components/sections-list.tsx
|
|
@@ -1032,16 +1091,16 @@ function buildStateSnapshotSlot(styles, parentBreakpoint, currentBreakpoint, sta
|
|
|
1032
1091
|
}
|
|
1033
1092
|
function buildInitialSnapshotFromStyles(styles) {
|
|
1034
1093
|
const snapshot = {};
|
|
1035
|
-
styles.forEach((
|
|
1094
|
+
styles.forEach((styleData) => {
|
|
1036
1095
|
const {
|
|
1037
|
-
|
|
1038
|
-
} =
|
|
1096
|
+
variant: { props }
|
|
1097
|
+
} = styleData;
|
|
1039
1098
|
Object.entries(props).forEach(([key, value]) => {
|
|
1040
1099
|
if (!snapshot[key]) {
|
|
1041
1100
|
snapshot[key] = [];
|
|
1042
1101
|
}
|
|
1043
1102
|
const snapshotPropValue = {
|
|
1044
|
-
...
|
|
1103
|
+
...styleData,
|
|
1045
1104
|
value
|
|
1046
1105
|
};
|
|
1047
1106
|
snapshot[key].push(snapshotPropValue);
|
|
@@ -1074,8 +1133,9 @@ function createStylesInheritance(styleDefs, breakpointsRoot) {
|
|
|
1074
1133
|
function buildStyleVariantsByMetaMapping(styleDefs) {
|
|
1075
1134
|
const breakpointStateSlots = {};
|
|
1076
1135
|
styleDefs.forEach((styleDef) => {
|
|
1077
|
-
styleDef.
|
|
1078
|
-
|
|
1136
|
+
const provider = getProviderByStyleId(styleDef.id)?.key ?? null;
|
|
1137
|
+
styleDef.variants.forEach((variant) => {
|
|
1138
|
+
const { meta } = variant;
|
|
1079
1139
|
const { state, breakpoint } = meta;
|
|
1080
1140
|
const breakpointKey = getBreakpointKey(breakpoint);
|
|
1081
1141
|
const stateKey = getStateKey(state);
|
|
@@ -1087,8 +1147,9 @@ function buildStyleVariantsByMetaMapping(styleDefs) {
|
|
|
1087
1147
|
breakpointNode[stateKey] = [];
|
|
1088
1148
|
}
|
|
1089
1149
|
breakpointNode[stateKey].push({
|
|
1090
|
-
|
|
1091
|
-
|
|
1150
|
+
style: styleDef,
|
|
1151
|
+
variant,
|
|
1152
|
+
provider
|
|
1092
1153
|
});
|
|
1093
1154
|
});
|
|
1094
1155
|
});
|
|
@@ -1289,28 +1350,8 @@ function useStylesField(propName) {
|
|
|
1289
1350
|
// src/styles-inheritance/styles-inheritance-indicator.tsx
|
|
1290
1351
|
import * as React17 from "react";
|
|
1291
1352
|
import { useBoundProp } from "@elementor/editor-controls";
|
|
1292
|
-
import { ELEMENTS_STYLES_PROVIDER_KEY as
|
|
1293
|
-
import { styled as styled4 } from "@elementor/ui";
|
|
1353
|
+
import { ELEMENTS_BASE_STYLES_PROVIDER_KEY, ELEMENTS_STYLES_PROVIDER_KEY as ELEMENTS_STYLES_PROVIDER_KEY3 } from "@elementor/editor-styles-repository";
|
|
1294
1354
|
import { __ as __5 } from "@wordpress/i18n";
|
|
1295
|
-
var Circle = styled4("div", {
|
|
1296
|
-
shouldForwardProp: (prop) => prop !== "variant"
|
|
1297
|
-
})`
|
|
1298
|
-
width: 5px;
|
|
1299
|
-
height: 5px;
|
|
1300
|
-
border-radius: 50%;
|
|
1301
|
-
background-color: ${({ theme, variant }) => {
|
|
1302
|
-
switch (variant) {
|
|
1303
|
-
case "overridden":
|
|
1304
|
-
return theme.palette.warning.light;
|
|
1305
|
-
case "global-affects":
|
|
1306
|
-
return theme.palette.global.dark;
|
|
1307
|
-
case "local-affects":
|
|
1308
|
-
return theme.palette.primary.main;
|
|
1309
|
-
default:
|
|
1310
|
-
return theme.palette.text.disabled;
|
|
1311
|
-
}
|
|
1312
|
-
}};
|
|
1313
|
-
`;
|
|
1314
1355
|
var StylesInheritanceIndicator = () => {
|
|
1315
1356
|
const { value, path } = useBoundProp();
|
|
1316
1357
|
const { id: currentStyleId, provider: currentStyleProvider, meta: currentStyleMeta } = useStyle();
|
|
@@ -1319,27 +1360,30 @@ var StylesInheritanceIndicator = () => {
|
|
|
1319
1360
|
if (!inheritanceChain.length) {
|
|
1320
1361
|
return null;
|
|
1321
1362
|
}
|
|
1322
|
-
const [{
|
|
1323
|
-
|
|
1324
|
-
|
|
1363
|
+
const [{ style, variant, provider }] = inheritanceChain;
|
|
1364
|
+
if (provider === ELEMENTS_BASE_STYLES_PROVIDER_KEY) {
|
|
1365
|
+
return null;
|
|
1366
|
+
}
|
|
1367
|
+
const { breakpoint, state } = variant.meta;
|
|
1368
|
+
if (style.id === currentStyleId && breakpoint === currentStyleMeta.breakpoint && state === currentStyleMeta.state) {
|
|
1325
1369
|
return /* @__PURE__ */ React17.createElement(
|
|
1326
|
-
|
|
1370
|
+
StyleIndicator,
|
|
1327
1371
|
{
|
|
1328
1372
|
"aria-label": __5("This is the final value", "elementor"),
|
|
1329
|
-
variant: currentStyleProvider?.key ===
|
|
1373
|
+
variant: currentStyleProvider?.key === ELEMENTS_STYLES_PROVIDER_KEY3 ? "local" : "global"
|
|
1330
1374
|
}
|
|
1331
1375
|
);
|
|
1332
1376
|
}
|
|
1333
1377
|
if (value !== null && value !== void 0) {
|
|
1334
1378
|
return /* @__PURE__ */ React17.createElement(
|
|
1335
|
-
|
|
1379
|
+
StyleIndicator,
|
|
1336
1380
|
{
|
|
1337
1381
|
"aria-label": __5("This value is overridden by another style", "elementor"),
|
|
1338
1382
|
variant: "overridden"
|
|
1339
1383
|
}
|
|
1340
1384
|
);
|
|
1341
1385
|
}
|
|
1342
|
-
return /* @__PURE__ */ React17.createElement(
|
|
1386
|
+
return /* @__PURE__ */ React17.createElement(StyleIndicator, { "aria-label": __5("This has value from another style", "elementor") });
|
|
1343
1387
|
};
|
|
1344
1388
|
|
|
1345
1389
|
// src/controls-registry/styles-field.tsx
|
|
@@ -1371,7 +1415,7 @@ var BackgroundSection = () => {
|
|
|
1371
1415
|
};
|
|
1372
1416
|
|
|
1373
1417
|
// src/components/style-sections/border-section/border-section.tsx
|
|
1374
|
-
import * as
|
|
1418
|
+
import * as React29 from "react";
|
|
1375
1419
|
|
|
1376
1420
|
// src/components/panel-divider.tsx
|
|
1377
1421
|
import * as React20 from "react";
|
|
@@ -1380,31 +1424,31 @@ var PanelDivider = () => /* @__PURE__ */ React20.createElement(Divider3, { sx: {
|
|
|
1380
1424
|
|
|
1381
1425
|
// src/components/section-content.tsx
|
|
1382
1426
|
import * as React21 from "react";
|
|
1383
|
-
import { Stack as
|
|
1384
|
-
var SectionContent = ({ gap = 2, sx, children }) => /* @__PURE__ */ React21.createElement(
|
|
1427
|
+
import { Stack as Stack6 } from "@elementor/ui";
|
|
1428
|
+
var SectionContent = ({ gap = 2, sx, children }) => /* @__PURE__ */ React21.createElement(Stack6, { gap, sx: { ...sx } }, children);
|
|
1385
1429
|
|
|
1386
1430
|
// src/components/style-sections/border-section/border-field.tsx
|
|
1387
|
-
import * as
|
|
1431
|
+
import * as React27 from "react";
|
|
1388
1432
|
import { __ as __9 } from "@wordpress/i18n";
|
|
1389
1433
|
|
|
1390
1434
|
// src/components/add-or-remove-content.tsx
|
|
1391
1435
|
import * as React23 from "react";
|
|
1392
1436
|
import { MinusIcon, PlusIcon } from "@elementor/icons";
|
|
1393
|
-
import { Collapse as Collapse2, IconButton as IconButton2, Stack as
|
|
1437
|
+
import { Collapse as Collapse2, IconButton as IconButton2, Stack as Stack8 } from "@elementor/ui";
|
|
1394
1438
|
|
|
1395
1439
|
// src/components/control-label.tsx
|
|
1396
1440
|
import * as React22 from "react";
|
|
1397
1441
|
import { ControlAdornments, ControlFormLabel as ControlFormLabel2 } from "@elementor/editor-controls";
|
|
1398
|
-
import { Stack as
|
|
1442
|
+
import { Stack as Stack7 } from "@elementor/ui";
|
|
1399
1443
|
var ControlLabel = ({ children }) => {
|
|
1400
|
-
return /* @__PURE__ */ React22.createElement(
|
|
1444
|
+
return /* @__PURE__ */ React22.createElement(Stack7, { direction: "row", alignItems: "center", justifyItems: "start", gap: 1 }, /* @__PURE__ */ React22.createElement(ControlFormLabel2, null, children), /* @__PURE__ */ React22.createElement(ControlAdornments, null));
|
|
1401
1445
|
};
|
|
1402
1446
|
|
|
1403
1447
|
// src/components/add-or-remove-content.tsx
|
|
1404
1448
|
var SIZE2 = "tiny";
|
|
1405
1449
|
var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
|
|
1406
1450
|
return /* @__PURE__ */ React23.createElement(SectionContent, null, /* @__PURE__ */ React23.createElement(
|
|
1407
|
-
|
|
1451
|
+
Stack8,
|
|
1408
1452
|
{
|
|
1409
1453
|
direction: "row",
|
|
1410
1454
|
sx: {
|
|
@@ -1447,7 +1491,7 @@ var BorderStyleField = () => {
|
|
|
1447
1491
|
};
|
|
1448
1492
|
|
|
1449
1493
|
// src/components/style-sections/border-section/border-width-field.tsx
|
|
1450
|
-
import * as
|
|
1494
|
+
import * as React26 from "react";
|
|
1451
1495
|
import { EqualUnequalSizesControl } from "@elementor/editor-controls";
|
|
1452
1496
|
import { borderWidthPropTypeUtil } from "@elementor/editor-props";
|
|
1453
1497
|
import { SideAllIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
@@ -1462,82 +1506,39 @@ function useDirection() {
|
|
|
1462
1506
|
return { isSiteRtl, isUiRtl };
|
|
1463
1507
|
}
|
|
1464
1508
|
|
|
1465
|
-
// src/components/style-sections/layout-section/utils/rotated-icon.tsx
|
|
1466
|
-
import * as React26 from "react";
|
|
1467
|
-
import { useRef } from "react";
|
|
1468
|
-
import { useTheme as useTheme2 } from "@elementor/ui";
|
|
1469
|
-
var CLOCKWISE_ANGLES = {
|
|
1470
|
-
row: 0,
|
|
1471
|
-
column: 90,
|
|
1472
|
-
"row-reverse": 180,
|
|
1473
|
-
"column-reverse": 270
|
|
1474
|
-
};
|
|
1475
|
-
var COUNTER_CLOCKWISE_ANGLES = {
|
|
1476
|
-
row: 0,
|
|
1477
|
-
column: -90,
|
|
1478
|
-
"row-reverse": -180,
|
|
1479
|
-
"column-reverse": -270
|
|
1480
|
-
};
|
|
1481
|
-
var RotatedIcon = ({
|
|
1482
|
-
icon: Icon,
|
|
1483
|
-
size,
|
|
1484
|
-
isClockwise = true,
|
|
1485
|
-
offset = 0,
|
|
1486
|
-
disableRotationForReversed = false
|
|
1487
|
-
}) => {
|
|
1488
|
-
const rotate = useRef(useGetTargetAngle(isClockwise, offset, disableRotationForReversed));
|
|
1489
|
-
rotate.current = useGetTargetAngle(isClockwise, offset, disableRotationForReversed, rotate);
|
|
1490
|
-
return /* @__PURE__ */ React26.createElement(Icon, { fontSize: size, sx: { transition: ".3s", rotate: `${rotate.current}deg` } });
|
|
1491
|
-
};
|
|
1492
|
-
var useGetTargetAngle = (isClockwise, offset, disableRotationForReversed, existingRef) => {
|
|
1493
|
-
const [direction] = useStylesField("flex-direction");
|
|
1494
|
-
const isRtl = "rtl" === useTheme2().direction;
|
|
1495
|
-
const rotationMultiplier = isRtl ? -1 : 1;
|
|
1496
|
-
const angleMap = isClockwise ? CLOCKWISE_ANGLES : COUNTER_CLOCKWISE_ANGLES;
|
|
1497
|
-
const currentDirection = direction?.value || "row";
|
|
1498
|
-
const currentAngle = existingRef ? existingRef.current * rotationMultiplier : angleMap[currentDirection] + offset;
|
|
1499
|
-
const targetAngle = angleMap[currentDirection] + offset;
|
|
1500
|
-
const diffToTargetAngle = (targetAngle - currentAngle + 360) % 360;
|
|
1501
|
-
const formattedDiff = (diffToTargetAngle + 180) % 360 - 180;
|
|
1502
|
-
if (disableRotationForReversed && ["row-reverse", "column-reverse"].includes(currentDirection)) {
|
|
1503
|
-
return 0;
|
|
1504
|
-
}
|
|
1505
|
-
return (currentAngle + formattedDiff) * rotationMultiplier;
|
|
1506
|
-
};
|
|
1507
|
-
|
|
1508
1509
|
// src/components/style-sections/border-section/border-width-field.tsx
|
|
1509
1510
|
var InlineStartIcon = withDirection(SideRightIcon);
|
|
1510
1511
|
var InlineEndIcon = withDirection(SideLeftIcon);
|
|
1511
1512
|
var getEdges = (isSiteRtl) => [
|
|
1512
1513
|
{
|
|
1513
1514
|
label: __8("Top", "elementor"),
|
|
1514
|
-
icon: /* @__PURE__ */
|
|
1515
|
+
icon: /* @__PURE__ */ React26.createElement(SideTopIcon, { fontSize: "tiny" }),
|
|
1515
1516
|
bind: "block-start"
|
|
1516
1517
|
},
|
|
1517
1518
|
{
|
|
1518
1519
|
label: isSiteRtl ? __8("Left", "elementor") : __8("Right", "elementor"),
|
|
1519
|
-
icon: /* @__PURE__ */
|
|
1520
|
+
icon: /* @__PURE__ */ React26.createElement(InlineStartIcon, { fontSize: "tiny" }),
|
|
1520
1521
|
bind: "inline-end"
|
|
1521
1522
|
},
|
|
1522
1523
|
{
|
|
1523
1524
|
label: __8("Bottom", "elementor"),
|
|
1524
|
-
icon: /* @__PURE__ */
|
|
1525
|
+
icon: /* @__PURE__ */ React26.createElement(SideBottomIcon, { fontSize: "tiny" }),
|
|
1525
1526
|
bind: "block-end"
|
|
1526
1527
|
},
|
|
1527
1528
|
{
|
|
1528
1529
|
label: isSiteRtl ? __8("Right", "elementor") : __8("Left", "elementor"),
|
|
1529
|
-
icon: /* @__PURE__ */
|
|
1530
|
+
icon: /* @__PURE__ */ React26.createElement(InlineEndIcon, { fontSize: "tiny" }),
|
|
1530
1531
|
bind: "inline-start"
|
|
1531
1532
|
}
|
|
1532
1533
|
];
|
|
1533
1534
|
var BorderWidthField = () => {
|
|
1534
1535
|
const { isSiteRtl } = useDirection();
|
|
1535
|
-
return /* @__PURE__ */
|
|
1536
|
+
return /* @__PURE__ */ React26.createElement(StylesField, { bind: "border-width" }, /* @__PURE__ */ React26.createElement(
|
|
1536
1537
|
EqualUnequalSizesControl,
|
|
1537
1538
|
{
|
|
1538
1539
|
items: getEdges(isSiteRtl),
|
|
1539
1540
|
label: __8("Border width", "elementor"),
|
|
1540
|
-
icon: /* @__PURE__ */
|
|
1541
|
+
icon: /* @__PURE__ */ React26.createElement(SideAllIcon, { fontSize: "tiny" }),
|
|
1541
1542
|
tooltipLabel: __8("Adjust borders", "elementor"),
|
|
1542
1543
|
multiSizePropTypeUtil: borderWidthPropTypeUtil
|
|
1543
1544
|
}
|
|
@@ -1563,7 +1564,7 @@ var BorderField = () => {
|
|
|
1563
1564
|
});
|
|
1564
1565
|
};
|
|
1565
1566
|
const hasBorder = Object.values(border ?? {}).some(Boolean);
|
|
1566
|
-
return /* @__PURE__ */
|
|
1567
|
+
return /* @__PURE__ */ React27.createElement(
|
|
1567
1568
|
AddOrRemoveContent,
|
|
1568
1569
|
{
|
|
1569
1570
|
label: __9("Border", "elementor"),
|
|
@@ -1571,14 +1572,14 @@ var BorderField = () => {
|
|
|
1571
1572
|
onAdd: addBorder,
|
|
1572
1573
|
onRemove: removeBorder
|
|
1573
1574
|
},
|
|
1574
|
-
/* @__PURE__ */
|
|
1575
|
-
/* @__PURE__ */
|
|
1576
|
-
/* @__PURE__ */
|
|
1575
|
+
/* @__PURE__ */ React27.createElement(BorderWidthField, null),
|
|
1576
|
+
/* @__PURE__ */ React27.createElement(BorderColorField, null),
|
|
1577
|
+
/* @__PURE__ */ React27.createElement(BorderStyleField, null)
|
|
1577
1578
|
);
|
|
1578
1579
|
};
|
|
1579
1580
|
|
|
1580
1581
|
// src/components/style-sections/border-section/border-radius-field.tsx
|
|
1581
|
-
import * as
|
|
1582
|
+
import * as React28 from "react";
|
|
1582
1583
|
import { EqualUnequalSizesControl as EqualUnequalSizesControl2 } from "@elementor/editor-controls";
|
|
1583
1584
|
import { borderRadiusPropTypeUtil } from "@elementor/editor-props";
|
|
1584
1585
|
import {
|
|
@@ -1601,33 +1602,33 @@ var getEndEndLabel = (isSiteRtl) => isSiteRtl ? __10("Bottom left", "elementor")
|
|
|
1601
1602
|
var getCorners = (isSiteRtl) => [
|
|
1602
1603
|
{
|
|
1603
1604
|
label: getStartStartLabel(isSiteRtl),
|
|
1604
|
-
icon: /* @__PURE__ */
|
|
1605
|
+
icon: /* @__PURE__ */ React28.createElement(StartStartIcon, { fontSize: "tiny" }),
|
|
1605
1606
|
bind: "start-start"
|
|
1606
1607
|
},
|
|
1607
1608
|
{
|
|
1608
1609
|
label: getStartEndLabel(isSiteRtl),
|
|
1609
|
-
icon: /* @__PURE__ */
|
|
1610
|
+
icon: /* @__PURE__ */ React28.createElement(StartEndIcon, { fontSize: "tiny" }),
|
|
1610
1611
|
bind: "start-end"
|
|
1611
1612
|
},
|
|
1612
1613
|
{
|
|
1613
1614
|
label: getEndStartLabel(isSiteRtl),
|
|
1614
|
-
icon: /* @__PURE__ */
|
|
1615
|
+
icon: /* @__PURE__ */ React28.createElement(EndStartIcon, { fontSize: "tiny" }),
|
|
1615
1616
|
bind: "end-start"
|
|
1616
1617
|
},
|
|
1617
1618
|
{
|
|
1618
1619
|
label: getEndEndLabel(isSiteRtl),
|
|
1619
|
-
icon: /* @__PURE__ */
|
|
1620
|
+
icon: /* @__PURE__ */ React28.createElement(EndEndIcon, { fontSize: "tiny" }),
|
|
1620
1621
|
bind: "end-end"
|
|
1621
1622
|
}
|
|
1622
1623
|
];
|
|
1623
1624
|
var BorderRadiusField = () => {
|
|
1624
1625
|
const { isSiteRtl } = useDirection();
|
|
1625
|
-
return /* @__PURE__ */
|
|
1626
|
+
return /* @__PURE__ */ React28.createElement(StylesField, { bind: "border-radius" }, /* @__PURE__ */ React28.createElement(
|
|
1626
1627
|
EqualUnequalSizesControl2,
|
|
1627
1628
|
{
|
|
1628
1629
|
items: getCorners(isSiteRtl),
|
|
1629
1630
|
label: __10("Border radius", "elementor"),
|
|
1630
|
-
icon: /* @__PURE__ */
|
|
1631
|
+
icon: /* @__PURE__ */ React28.createElement(BorderCornersIcon, { fontSize: "tiny" }),
|
|
1631
1632
|
tooltipLabel: __10("Adjust corners", "elementor"),
|
|
1632
1633
|
multiSizePropTypeUtil: borderRadiusPropTypeUtil
|
|
1633
1634
|
}
|
|
@@ -1635,13 +1636,13 @@ var BorderRadiusField = () => {
|
|
|
1635
1636
|
};
|
|
1636
1637
|
|
|
1637
1638
|
// src/components/style-sections/border-section/border-section.tsx
|
|
1638
|
-
var BorderSection = () => /* @__PURE__ */
|
|
1639
|
+
var BorderSection = () => /* @__PURE__ */ React29.createElement(SectionContent, null, /* @__PURE__ */ React29.createElement(BorderRadiusField, null), /* @__PURE__ */ React29.createElement(PanelDivider, null), /* @__PURE__ */ React29.createElement(BorderField, null));
|
|
1639
1640
|
|
|
1640
1641
|
// src/components/style-sections/effects-section/effects-section.tsx
|
|
1641
|
-
import * as
|
|
1642
|
+
import * as React30 from "react";
|
|
1642
1643
|
import { BoxShadowRepeaterControl } from "@elementor/editor-controls";
|
|
1643
1644
|
var EffectsSection = () => {
|
|
1644
|
-
return /* @__PURE__ */
|
|
1645
|
+
return /* @__PURE__ */ React30.createElement(SectionContent, null, /* @__PURE__ */ React30.createElement(StylesField, { bind: "box-shadow" }, /* @__PURE__ */ React30.createElement(BoxShadowRepeaterControl, null)));
|
|
1645
1646
|
};
|
|
1646
1647
|
|
|
1647
1648
|
// src/components/style-sections/layout-section/layout-section.tsx
|
|
@@ -1686,8 +1687,53 @@ import {
|
|
|
1686
1687
|
JustifySpaceBetweenVerticalIcon as BetweenIcon,
|
|
1687
1688
|
JustifyTopIcon
|
|
1688
1689
|
} from "@elementor/icons";
|
|
1689
|
-
import { DirectionProvider, Stack as
|
|
1690
|
+
import { DirectionProvider, Stack as Stack9, ThemeProvider, withDirection as withDirection3 } from "@elementor/ui";
|
|
1690
1691
|
import { __ as __11 } from "@wordpress/i18n";
|
|
1692
|
+
|
|
1693
|
+
// src/components/style-sections/layout-section/utils/rotated-icon.tsx
|
|
1694
|
+
import * as React31 from "react";
|
|
1695
|
+
import { useRef } from "react";
|
|
1696
|
+
import { useTheme as useTheme2 } from "@elementor/ui";
|
|
1697
|
+
var CLOCKWISE_ANGLES = {
|
|
1698
|
+
row: 0,
|
|
1699
|
+
column: 90,
|
|
1700
|
+
"row-reverse": 180,
|
|
1701
|
+
"column-reverse": 270
|
|
1702
|
+
};
|
|
1703
|
+
var COUNTER_CLOCKWISE_ANGLES = {
|
|
1704
|
+
row: 0,
|
|
1705
|
+
column: -90,
|
|
1706
|
+
"row-reverse": -180,
|
|
1707
|
+
"column-reverse": -270
|
|
1708
|
+
};
|
|
1709
|
+
var RotatedIcon = ({
|
|
1710
|
+
icon: Icon,
|
|
1711
|
+
size,
|
|
1712
|
+
isClockwise = true,
|
|
1713
|
+
offset = 0,
|
|
1714
|
+
disableRotationForReversed = false
|
|
1715
|
+
}) => {
|
|
1716
|
+
const rotate = useRef(useGetTargetAngle(isClockwise, offset, disableRotationForReversed));
|
|
1717
|
+
rotate.current = useGetTargetAngle(isClockwise, offset, disableRotationForReversed, rotate);
|
|
1718
|
+
return /* @__PURE__ */ React31.createElement(Icon, { fontSize: size, sx: { transition: ".3s", rotate: `${rotate.current}deg` } });
|
|
1719
|
+
};
|
|
1720
|
+
var useGetTargetAngle = (isClockwise, offset, disableRotationForReversed, existingRef) => {
|
|
1721
|
+
const [direction] = useStylesField("flex-direction");
|
|
1722
|
+
const isRtl = "rtl" === useTheme2().direction;
|
|
1723
|
+
const rotationMultiplier = isRtl ? -1 : 1;
|
|
1724
|
+
const angleMap = isClockwise ? CLOCKWISE_ANGLES : COUNTER_CLOCKWISE_ANGLES;
|
|
1725
|
+
const currentDirection = direction?.value || "row";
|
|
1726
|
+
const currentAngle = existingRef ? existingRef.current * rotationMultiplier : angleMap[currentDirection] + offset;
|
|
1727
|
+
const targetAngle = angleMap[currentDirection] + offset;
|
|
1728
|
+
const diffToTargetAngle = (targetAngle - currentAngle + 360) % 360;
|
|
1729
|
+
const formattedDiff = (diffToTargetAngle + 180) % 360 - 180;
|
|
1730
|
+
if (disableRotationForReversed && ["row-reverse", "column-reverse"].includes(currentDirection)) {
|
|
1731
|
+
return 0;
|
|
1732
|
+
}
|
|
1733
|
+
return (currentAngle + formattedDiff) * rotationMultiplier;
|
|
1734
|
+
};
|
|
1735
|
+
|
|
1736
|
+
// src/components/style-sections/layout-section/align-content-field.tsx
|
|
1691
1737
|
var StartIcon = withDirection3(JustifyTopIcon);
|
|
1692
1738
|
var EndIcon = withDirection3(JustifyBottomIcon);
|
|
1693
1739
|
var iconProps = {
|
|
@@ -1735,7 +1781,7 @@ var options = [
|
|
|
1735
1781
|
];
|
|
1736
1782
|
var AlignContentField = () => {
|
|
1737
1783
|
const { isSiteRtl } = useDirection();
|
|
1738
|
-
return /* @__PURE__ */ React32.createElement(DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React32.createElement(ThemeProvider, null, /* @__PURE__ */ React32.createElement(StylesField, { bind: "align-content" }, /* @__PURE__ */ React32.createElement(
|
|
1784
|
+
return /* @__PURE__ */ React32.createElement(DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React32.createElement(ThemeProvider, null, /* @__PURE__ */ React32.createElement(StylesField, { bind: "align-content" }, /* @__PURE__ */ React32.createElement(Stack9, { gap: 1 }, /* @__PURE__ */ React32.createElement(ControlLabel, null, __11("Align content", "elementor")), /* @__PURE__ */ React32.createElement(ToggleControl, { options, fullWidth: true })))));
|
|
1739
1785
|
};
|
|
1740
1786
|
|
|
1741
1787
|
// src/components/style-sections/layout-section/align-items-field.tsx
|
|
@@ -1837,7 +1883,7 @@ var AlignSelfChild = () => {
|
|
|
1837
1883
|
// src/components/style-sections/layout-section/display-field.tsx
|
|
1838
1884
|
import * as React35 from "react";
|
|
1839
1885
|
import { ToggleControl as ToggleControl4 } from "@elementor/editor-controls";
|
|
1840
|
-
import { Stack as
|
|
1886
|
+
import { Stack as Stack10 } from "@elementor/ui";
|
|
1841
1887
|
import { __ as __14 } from "@wordpress/i18n";
|
|
1842
1888
|
var DisplayField = () => {
|
|
1843
1889
|
const options13 = [
|
|
@@ -1866,7 +1912,7 @@ var DisplayField = () => {
|
|
|
1866
1912
|
showTooltip: true
|
|
1867
1913
|
}
|
|
1868
1914
|
];
|
|
1869
|
-
return /* @__PURE__ */ React35.createElement(StylesField, { bind: "display" }, /* @__PURE__ */ React35.createElement(
|
|
1915
|
+
return /* @__PURE__ */ React35.createElement(StylesField, { bind: "display" }, /* @__PURE__ */ React35.createElement(Stack10, { gap: 0.75 }, /* @__PURE__ */ React35.createElement(ControlLabel, null, __14("Display", "elementor")), /* @__PURE__ */ React35.createElement(ToggleControl4, { options: options13, fullWidth: true })));
|
|
1870
1916
|
};
|
|
1871
1917
|
|
|
1872
1918
|
// src/components/style-sections/layout-section/flex-direction-field.tsx
|
|
@@ -1880,8 +1926,8 @@ var options4 = [
|
|
|
1880
1926
|
value: "row",
|
|
1881
1927
|
label: __15("Row", "elementor"),
|
|
1882
1928
|
renderContent: ({ size }) => {
|
|
1883
|
-
const
|
|
1884
|
-
return /* @__PURE__ */ React36.createElement(
|
|
1929
|
+
const StartIcon5 = withDirection6(ArrowRightIcon);
|
|
1930
|
+
return /* @__PURE__ */ React36.createElement(StartIcon5, { fontSize: size });
|
|
1885
1931
|
},
|
|
1886
1932
|
showTooltip: true
|
|
1887
1933
|
},
|
|
@@ -1895,8 +1941,8 @@ var options4 = [
|
|
|
1895
1941
|
value: "row-reverse",
|
|
1896
1942
|
label: __15("Reversed row", "elementor"),
|
|
1897
1943
|
renderContent: ({ size }) => {
|
|
1898
|
-
const
|
|
1899
|
-
return /* @__PURE__ */ React36.createElement(
|
|
1944
|
+
const EndIcon5 = withDirection6(ArrowLeftIcon);
|
|
1945
|
+
return /* @__PURE__ */ React36.createElement(EndIcon5, { fontSize: size });
|
|
1900
1946
|
},
|
|
1901
1947
|
showTooltip: true
|
|
1902
1948
|
},
|
|
@@ -1994,8 +2040,9 @@ import {
|
|
|
1994
2040
|
NumberControl as NumberControl2,
|
|
1995
2041
|
SizeControl as SizeControl2
|
|
1996
2042
|
} from "@elementor/editor-controls";
|
|
2043
|
+
import { numberPropTypeUtil } from "@elementor/editor-props";
|
|
1997
2044
|
import { ExpandIcon, PencilIcon as PencilIcon2, ShrinkIcon } from "@elementor/icons";
|
|
1998
|
-
import { DirectionProvider as DirectionProvider6, Grid as Grid7, ThemeProvider as ThemeProvider6
|
|
2045
|
+
import { DirectionProvider as DirectionProvider6, Grid as Grid7, ThemeProvider as ThemeProvider6 } from "@elementor/ui";
|
|
1999
2046
|
import { __ as __17 } from "@wordpress/i18n";
|
|
2000
2047
|
var DEFAULT = 1;
|
|
2001
2048
|
var items2 = [
|
|
@@ -2019,26 +2066,37 @@ var items2 = [
|
|
|
2019
2066
|
}
|
|
2020
2067
|
];
|
|
2021
2068
|
var FlexSizeField = () => {
|
|
2022
|
-
const { isSiteRtl } = useDirection()
|
|
2023
|
-
const
|
|
2069
|
+
const { isSiteRtl } = useDirection();
|
|
2070
|
+
const [fields, setFields] = useStylesFields(["flex-grow", "flex-shrink", "flex-basis"]);
|
|
2071
|
+
const grow = fields?.["flex-grow"]?.value || null;
|
|
2072
|
+
const shrink = fields?.["flex-shrink"]?.value || null;
|
|
2073
|
+
const basis = fields?.["flex-basis"]?.value || null;
|
|
2024
2074
|
const currentGroup = useMemo2(() => getActiveGroup({ grow, shrink, basis }), [grow, shrink, basis]), [activeGroup, setActiveGroup] = useState5(currentGroup);
|
|
2025
2075
|
const onChangeGroup = (group = null) => {
|
|
2026
2076
|
setActiveGroup(group);
|
|
2027
|
-
setBasisField(null);
|
|
2028
2077
|
if (!group || group === "custom") {
|
|
2029
|
-
|
|
2030
|
-
|
|
2078
|
+
setFields({
|
|
2079
|
+
"flex-basis": null,
|
|
2080
|
+
"flex-grow": null,
|
|
2081
|
+
"flex-shrink": null
|
|
2082
|
+
});
|
|
2031
2083
|
return;
|
|
2032
2084
|
}
|
|
2033
2085
|
if (group === "flex-grow") {
|
|
2034
|
-
|
|
2035
|
-
|
|
2086
|
+
setFields({
|
|
2087
|
+
"flex-basis": null,
|
|
2088
|
+
"flex-grow": numberPropTypeUtil.create(DEFAULT),
|
|
2089
|
+
"flex-shrink": null
|
|
2090
|
+
});
|
|
2036
2091
|
return;
|
|
2037
2092
|
}
|
|
2038
|
-
|
|
2039
|
-
|
|
2093
|
+
setFields({
|
|
2094
|
+
"flex-basis": null,
|
|
2095
|
+
"flex-grow": null,
|
|
2096
|
+
"flex-shrink": numberPropTypeUtil.create(DEFAULT)
|
|
2097
|
+
});
|
|
2040
2098
|
};
|
|
2041
|
-
return /* @__PURE__ */ React38.createElement(DirectionProvider6, { rtl: isSiteRtl }, /* @__PURE__ */ React38.createElement(ThemeProvider6, null, /* @__PURE__ */ React38.createElement(SectionContent, null, /* @__PURE__ */ React38.createElement(
|
|
2099
|
+
return /* @__PURE__ */ React38.createElement(DirectionProvider6, { rtl: isSiteRtl }, /* @__PURE__ */ React38.createElement(ThemeProvider6, null, /* @__PURE__ */ React38.createElement(SectionContent, null, /* @__PURE__ */ React38.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React38.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(StylesField, { bind: activeGroup ?? "" }, /* @__PURE__ */ React38.createElement(ControlLabel, null, __17("Size", "elementor")))), /* @__PURE__ */ React38.createElement(Grid7, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React38.createElement(
|
|
2042
2100
|
ControlToggleButtonGroup2,
|
|
2043
2101
|
{
|
|
2044
2102
|
value: activeGroup,
|
|
@@ -2072,10 +2130,10 @@ var getActiveGroup = ({
|
|
|
2072
2130
|
// src/components/style-sections/layout-section/gap-control-field.tsx
|
|
2073
2131
|
import * as React39 from "react";
|
|
2074
2132
|
import { GapControl } from "@elementor/editor-controls";
|
|
2075
|
-
import { Stack as
|
|
2133
|
+
import { Stack as Stack11 } from "@elementor/ui";
|
|
2076
2134
|
import { __ as __18 } from "@wordpress/i18n";
|
|
2077
2135
|
var GapControlField = () => {
|
|
2078
|
-
return /* @__PURE__ */ React39.createElement(
|
|
2136
|
+
return /* @__PURE__ */ React39.createElement(Stack11, { gap: 1 }, /* @__PURE__ */ React39.createElement(StylesField, { bind: "gap" }, /* @__PURE__ */ React39.createElement(GapControl, { label: __18("Gaps", "elementor") })));
|
|
2079
2137
|
};
|
|
2080
2138
|
|
|
2081
2139
|
// src/components/style-sections/layout-section/justify-content-field.tsx
|
|
@@ -2089,7 +2147,7 @@ import {
|
|
|
2089
2147
|
JustifySpaceBetweenVerticalIcon as BetweenIcon2,
|
|
2090
2148
|
JustifyTopIcon as JustifyTopIcon2
|
|
2091
2149
|
} from "@elementor/icons";
|
|
2092
|
-
import { DirectionProvider as DirectionProvider7, Stack as
|
|
2150
|
+
import { DirectionProvider as DirectionProvider7, Stack as Stack12, ThemeProvider as ThemeProvider7, withDirection as withDirection7 } from "@elementor/ui";
|
|
2093
2151
|
import { __ as __19 } from "@wordpress/i18n";
|
|
2094
2152
|
var StartIcon4 = withDirection7(JustifyTopIcon2);
|
|
2095
2153
|
var EndIcon4 = withDirection7(JustifyBottomIcon2);
|
|
@@ -2137,7 +2195,7 @@ var options5 = [
|
|
|
2137
2195
|
];
|
|
2138
2196
|
var JustifyContentField = () => {
|
|
2139
2197
|
const { isSiteRtl } = useDirection();
|
|
2140
|
-
return /* @__PURE__ */ React40.createElement(DirectionProvider7, { rtl: isSiteRtl }, /* @__PURE__ */ React40.createElement(ThemeProvider7, null, /* @__PURE__ */ React40.createElement(StylesField, { bind: "justify-content" }, /* @__PURE__ */ React40.createElement(
|
|
2198
|
+
return /* @__PURE__ */ React40.createElement(DirectionProvider7, { rtl: isSiteRtl }, /* @__PURE__ */ React40.createElement(ThemeProvider7, null, /* @__PURE__ */ React40.createElement(StylesField, { bind: "justify-content" }, /* @__PURE__ */ React40.createElement(Stack12, { gap: 0.75 }, /* @__PURE__ */ React40.createElement(ControlLabel, null, __19("Justify content", "elementor")), /* @__PURE__ */ React40.createElement(ToggleControl6, { options: options5, fullWidth: true })))));
|
|
2141
2199
|
};
|
|
2142
2200
|
|
|
2143
2201
|
// src/components/style-sections/layout-section/wrap-field.tsx
|
|
@@ -2193,7 +2251,7 @@ import { useSessionStorage } from "@elementor/session";
|
|
|
2193
2251
|
import * as React43 from "react";
|
|
2194
2252
|
import { SizeControl as SizeControl3 } from "@elementor/editor-controls";
|
|
2195
2253
|
import { SideBottomIcon as SideBottomIcon2, SideLeftIcon as SideLeftIcon2, SideRightIcon as SideRightIcon2, SideTopIcon as SideTopIcon2 } from "@elementor/icons";
|
|
2196
|
-
import { Grid as Grid9, Stack as
|
|
2254
|
+
import { Grid as Grid9, Stack as Stack13, withDirection as withDirection8 } from "@elementor/ui";
|
|
2197
2255
|
import { __ as __22 } from "@wordpress/i18n";
|
|
2198
2256
|
var InlineStartIcon2 = withDirection8(SideLeftIcon2);
|
|
2199
2257
|
var InlineEndIcon2 = withDirection8(SideRightIcon2);
|
|
@@ -2207,7 +2265,7 @@ var getInlineStartLabel = (isSiteRtl) => isSiteRtl ? __22("Right", "elementor")
|
|
|
2207
2265
|
var getInlineEndLabel = (isSiteRtl) => isSiteRtl ? __22("Left", "elementor") : __22("Right", "elementor");
|
|
2208
2266
|
var DimensionsField = () => {
|
|
2209
2267
|
const { isSiteRtl } = useDirection();
|
|
2210
|
-
return /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(
|
|
2268
|
+
return /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(Stack13, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React43.createElement(DimensionField, { side: "inset-block-start", label: __22("Top", "elementor") }), /* @__PURE__ */ React43.createElement(DimensionField, { side: "inset-inline-end", label: getInlineEndLabel(isSiteRtl) })), /* @__PURE__ */ React43.createElement(Stack13, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React43.createElement(DimensionField, { side: "inset-block-end", label: __22("Bottom", "elementor") }), /* @__PURE__ */ React43.createElement(DimensionField, { side: "inset-inline-start", label: getInlineStartLabel(isSiteRtl) })));
|
|
2211
2269
|
};
|
|
2212
2270
|
var DimensionField = ({ side, label }) => {
|
|
2213
2271
|
return /* @__PURE__ */ React43.createElement(Grid9, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React43.createElement(Grid9, { item: true, xs: 12 }, /* @__PURE__ */ React43.createElement(ControlLabel, null, label)), /* @__PURE__ */ React43.createElement(Grid9, { item: true, xs: 12 }, /* @__PURE__ */ React43.createElement(StylesField, { bind: side }, /* @__PURE__ */ React43.createElement(SizeControl3, { startIcon: sideIcons[side], extendedValues: ["auto"] }))));
|
|
@@ -2279,7 +2337,7 @@ var usePersistDimensions = () => {
|
|
|
2279
2337
|
// src/components/style-sections/size-section/size-section.tsx
|
|
2280
2338
|
import * as React48 from "react";
|
|
2281
2339
|
import { SizeControl as SizeControl4 } from "@elementor/editor-controls";
|
|
2282
|
-
import { Grid as Grid13, Stack as
|
|
2340
|
+
import { Grid as Grid13, Stack as Stack14 } from "@elementor/ui";
|
|
2283
2341
|
import { __ as __26 } from "@wordpress/i18n";
|
|
2284
2342
|
|
|
2285
2343
|
// src/components/style-sections/size-section/overflow-field.tsx
|
|
@@ -2328,7 +2386,7 @@ var SizeSection = () => {
|
|
|
2328
2386
|
label: __26("Min height", "elementor"),
|
|
2329
2387
|
extendedValues: ["auto"]
|
|
2330
2388
|
}
|
|
2331
|
-
))), /* @__PURE__ */ React48.createElement(Grid13, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React48.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(SizeField, { bind: "max-width", label: __26("Max width", "elementor") })), /* @__PURE__ */ React48.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(SizeField, { bind: "max-height", label: __26("Max height", "elementor") }))), /* @__PURE__ */ React48.createElement(PanelDivider, null), /* @__PURE__ */ React48.createElement(
|
|
2389
|
+
))), /* @__PURE__ */ React48.createElement(Grid13, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React48.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(SizeField, { bind: "max-width", label: __26("Max width", "elementor") })), /* @__PURE__ */ React48.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(SizeField, { bind: "max-height", label: __26("Max height", "elementor") }))), /* @__PURE__ */ React48.createElement(PanelDivider, null), /* @__PURE__ */ React48.createElement(Stack14, null, /* @__PURE__ */ React48.createElement(OverflowField, null)));
|
|
2332
2390
|
};
|
|
2333
2391
|
var SizeField = ({ label, bind, extendedValues }) => {
|
|
2334
2392
|
return /* @__PURE__ */ React48.createElement(StylesField, { bind }, /* @__PURE__ */ React48.createElement(Grid13, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React48.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React48.createElement(ControlLabel, null, label)), /* @__PURE__ */ React48.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React48.createElement(SizeControl4, { extendedValues }))));
|
|
@@ -2356,14 +2414,14 @@ import * as React64 from "react";
|
|
|
2356
2414
|
// src/components/collapsible-content.tsx
|
|
2357
2415
|
import * as React50 from "react";
|
|
2358
2416
|
import { useState as useState6 } from "react";
|
|
2359
|
-
import { Button, Collapse as Collapse3, Stack as
|
|
2417
|
+
import { Button, Collapse as Collapse3, Stack as Stack15 } from "@elementor/ui";
|
|
2360
2418
|
import { __ as __28 } from "@wordpress/i18n";
|
|
2361
2419
|
var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
2362
2420
|
const [open, setOpen] = useState6(defaultOpen);
|
|
2363
2421
|
const handleToggle = () => {
|
|
2364
2422
|
setOpen((prevOpen) => !prevOpen);
|
|
2365
2423
|
};
|
|
2366
|
-
return /* @__PURE__ */ React50.createElement(
|
|
2424
|
+
return /* @__PURE__ */ React50.createElement(Stack15, null, /* @__PURE__ */ React50.createElement(
|
|
2367
2425
|
Button,
|
|
2368
2426
|
{
|
|
2369
2427
|
fullWidth: true,
|
|
@@ -2513,13 +2571,13 @@ import { ToggleControl as ToggleControl10 } from "@elementor/editor-controls";
|
|
|
2513
2571
|
import { AlignCenterIcon, AlignJustifiedIcon, AlignLeftIcon, AlignRightIcon } from "@elementor/icons";
|
|
2514
2572
|
import { Grid as Grid20, withDirection as withDirection9 } from "@elementor/ui";
|
|
2515
2573
|
import { __ as __36 } from "@wordpress/i18n";
|
|
2516
|
-
var
|
|
2517
|
-
var
|
|
2574
|
+
var AlignStartIcon = withDirection9(AlignLeftIcon);
|
|
2575
|
+
var AlignEndIcon = withDirection9(AlignRightIcon);
|
|
2518
2576
|
var options9 = [
|
|
2519
2577
|
{
|
|
2520
2578
|
value: "start",
|
|
2521
2579
|
label: __36("Start", "elementor"),
|
|
2522
|
-
renderContent: () => /* @__PURE__ */ React57.createElement(
|
|
2580
|
+
renderContent: ({ size }) => /* @__PURE__ */ React57.createElement(AlignStartIcon, { fontSize: size }),
|
|
2523
2581
|
showTooltip: true
|
|
2524
2582
|
},
|
|
2525
2583
|
{
|
|
@@ -2531,7 +2589,7 @@ var options9 = [
|
|
|
2531
2589
|
{
|
|
2532
2590
|
value: "end",
|
|
2533
2591
|
label: __36("End", "elementor"),
|
|
2534
|
-
renderContent: () => /* @__PURE__ */ React57.createElement(
|
|
2592
|
+
renderContent: ({ size }) => /* @__PURE__ */ React57.createElement(AlignEndIcon, { fontSize: size }),
|
|
2535
2593
|
showTooltip: true
|
|
2536
2594
|
},
|
|
2537
2595
|
{
|
|
@@ -2542,7 +2600,7 @@ var options9 = [
|
|
|
2542
2600
|
}
|
|
2543
2601
|
];
|
|
2544
2602
|
var TextAlignmentField = () => {
|
|
2545
|
-
return /* @__PURE__ */ React57.createElement(StylesField, { bind: "text-align" }, /* @__PURE__ */ React57.createElement(Grid20, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React57.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(ControlLabel, null, __36("
|
|
2603
|
+
return /* @__PURE__ */ React57.createElement(StylesField, { bind: "text-align" }, /* @__PURE__ */ React57.createElement(Grid20, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React57.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(ControlLabel, null, __36("Text align", "elementor"))), /* @__PURE__ */ React57.createElement(Grid20, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React57.createElement(ToggleControl10, { options: options9 }))));
|
|
2546
2604
|
};
|
|
2547
2605
|
|
|
2548
2606
|
// src/components/style-sections/typography-section/text-color-field.tsx
|
|
@@ -2751,19 +2809,7 @@ var EditingPanelTabs = () => {
|
|
|
2751
2809
|
return (
|
|
2752
2810
|
// When switching between elements, the local states should be reset. We are using key to rerender the tabs.
|
|
2753
2811
|
// Reference: https://react.dev/learn/preserving-and-resetting-state#resetting-a-form-with-a-key
|
|
2754
|
-
/* @__PURE__ */ React66.createElement(Fragment8, { key: element.id }, /* @__PURE__ */ React66.createElement(
|
|
2755
|
-
Tabs,
|
|
2756
|
-
{
|
|
2757
|
-
variant: "fullWidth",
|
|
2758
|
-
indicatorColor: "secondary",
|
|
2759
|
-
textColor: "inherit",
|
|
2760
|
-
size: "small",
|
|
2761
|
-
sx: { mt: 0.5 },
|
|
2762
|
-
...getTabsProps()
|
|
2763
|
-
},
|
|
2764
|
-
/* @__PURE__ */ React66.createElement(Tab, { label: __44("General", "elementor"), ...getTabProps("settings") }),
|
|
2765
|
-
/* @__PURE__ */ React66.createElement(Tab, { label: __44("Style", "elementor"), ...getTabProps("style") })
|
|
2766
|
-
), /* @__PURE__ */ React66.createElement(Divider5, null), /* @__PURE__ */ React66.createElement(TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React66.createElement(SettingsTab, null)), /* @__PURE__ */ React66.createElement(TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React66.createElement(StyleTab, null))))
|
|
2812
|
+
/* @__PURE__ */ React66.createElement(Fragment8, { key: element.id }, /* @__PURE__ */ React66.createElement(Stack16, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React66.createElement(Tabs, { variant: "fullWidth", size: "small", sx: { mt: 0.5 }, ...getTabsProps() }, /* @__PURE__ */ React66.createElement(Tab, { label: __44("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React66.createElement(Tab, { label: __44("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React66.createElement(Divider5, null), /* @__PURE__ */ React66.createElement(TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React66.createElement(SettingsTab, null)), /* @__PURE__ */ React66.createElement(TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React66.createElement(StyleTab, null))))
|
|
2767
2813
|
);
|
|
2768
2814
|
};
|
|
2769
2815
|
|
|
@@ -2825,6 +2871,9 @@ var EditingPanelHooks = () => {
|
|
|
2825
2871
|
return null;
|
|
2826
2872
|
};
|
|
2827
2873
|
|
|
2874
|
+
// src/dynamics/init.ts
|
|
2875
|
+
import { settingsTransformersRegistry, styleTransformersRegistry } from "@elementor/editor-canvas";
|
|
2876
|
+
|
|
2828
2877
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
2829
2878
|
import * as React71 from "react";
|
|
2830
2879
|
import { useId as useId4 } from "react";
|
|
@@ -2839,11 +2888,11 @@ import {
|
|
|
2839
2888
|
IconButton as IconButton3,
|
|
2840
2889
|
Paper,
|
|
2841
2890
|
Popover as Popover2,
|
|
2842
|
-
Stack as
|
|
2891
|
+
Stack as Stack19,
|
|
2843
2892
|
Tab as Tab2,
|
|
2844
2893
|
TabPanel as TabPanel2,
|
|
2845
2894
|
Tabs as Tabs2,
|
|
2846
|
-
Typography as
|
|
2895
|
+
Typography as Typography5,
|
|
2847
2896
|
UnstableTag as Tag,
|
|
2848
2897
|
usePopupState as usePopupState3,
|
|
2849
2898
|
useTabs as useTabs2
|
|
@@ -2852,8 +2901,8 @@ import { __ as __47 } from "@wordpress/i18n";
|
|
|
2852
2901
|
|
|
2853
2902
|
// src/components/popover-content.tsx
|
|
2854
2903
|
import * as React68 from "react";
|
|
2855
|
-
import { Stack as
|
|
2856
|
-
var PopoverContent = ({ alignItems, gap = 1.5, p, children }) => /* @__PURE__ */ React68.createElement(
|
|
2904
|
+
import { Stack as Stack17 } from "@elementor/ui";
|
|
2905
|
+
var PopoverContent = ({ alignItems, gap = 1.5, p, children }) => /* @__PURE__ */ React68.createElement(Stack17, { alignItems, gap, p }, children);
|
|
2857
2906
|
|
|
2858
2907
|
// src/hooks/use-persist-dynamic-value.ts
|
|
2859
2908
|
import { useSessionStorage as useSessionStorage2 } from "@elementor/session";
|
|
@@ -2982,9 +3031,9 @@ import {
|
|
|
2982
3031
|
MenuItem,
|
|
2983
3032
|
MenuList,
|
|
2984
3033
|
MenuSubheader as MenuSubheader2,
|
|
2985
|
-
Stack as
|
|
3034
|
+
Stack as Stack18,
|
|
2986
3035
|
TextField as TextField2,
|
|
2987
|
-
Typography as
|
|
3036
|
+
Typography as Typography4
|
|
2988
3037
|
} from "@elementor/ui";
|
|
2989
3038
|
import { __ as __46 } from "@wordpress/i18n";
|
|
2990
3039
|
var SIZE3 = "tiny";
|
|
@@ -3007,7 +3056,7 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
3007
3056
|
setValue({ name: value, settings: { label } });
|
|
3008
3057
|
onSelect?.();
|
|
3009
3058
|
};
|
|
3010
|
-
return /* @__PURE__ */ React70.createElement(
|
|
3059
|
+
return /* @__PURE__ */ React70.createElement(Stack18, null, hasNoDynamicTags ? /* @__PURE__ */ React70.createElement(NoDynamicTags, null) : /* @__PURE__ */ React70.createElement(Fragment9, null, /* @__PURE__ */ React70.createElement(Box4, { px: 1.5, pb: 1 }, /* @__PURE__ */ React70.createElement(
|
|
3011
3060
|
TextField2,
|
|
3012
3061
|
{
|
|
3013
3062
|
fullWidth: true,
|
|
@@ -3041,7 +3090,7 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
3041
3090
|
})))) : /* @__PURE__ */ React70.createElement(NoResults, { searchValue, onClear: () => setSearchValue("") }))));
|
|
3042
3091
|
};
|
|
3043
3092
|
var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */ React70.createElement(
|
|
3044
|
-
|
|
3093
|
+
Stack18,
|
|
3045
3094
|
{
|
|
3046
3095
|
gap: 1,
|
|
3047
3096
|
alignItems: "center",
|
|
@@ -3052,11 +3101,11 @@ var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */ React70.createElem
|
|
|
3052
3101
|
sx: { pb: 3.5 }
|
|
3053
3102
|
},
|
|
3054
3103
|
/* @__PURE__ */ React70.createElement(DatabaseIcon, { fontSize: "large" }),
|
|
3055
|
-
/* @__PURE__ */ React70.createElement(
|
|
3056
|
-
/* @__PURE__ */ React70.createElement(
|
|
3104
|
+
/* @__PURE__ */ React70.createElement(Typography4, { align: "center", variant: "subtitle2" }, __46("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React70.createElement("br", null), "\u201C", searchValue, "\u201D."),
|
|
3105
|
+
/* @__PURE__ */ React70.createElement(Typography4, { align: "center", variant: "caption" }, __46("Try something else.", "elementor"), "\xA0", /* @__PURE__ */ React70.createElement(Link, { color: "text.secondary", variant: "caption", component: "button", onClick: onClear }, __46("Clear & try again", "elementor")))
|
|
3057
3106
|
);
|
|
3058
3107
|
var NoDynamicTags = () => /* @__PURE__ */ React70.createElement(Box4, { sx: { overflowY: "hidden", height: 297, width: 220 } }, /* @__PURE__ */ React70.createElement(Divider6, null), /* @__PURE__ */ React70.createElement(
|
|
3059
|
-
|
|
3108
|
+
Stack18,
|
|
3060
3109
|
{
|
|
3061
3110
|
gap: 1,
|
|
3062
3111
|
alignItems: "center",
|
|
@@ -3067,8 +3116,8 @@ var NoDynamicTags = () => /* @__PURE__ */ React70.createElement(Box4, { sx: { ov
|
|
|
3067
3116
|
sx: { pb: 3.5 }
|
|
3068
3117
|
},
|
|
3069
3118
|
/* @__PURE__ */ React70.createElement(DatabaseIcon, { fontSize: "large" }),
|
|
3070
|
-
/* @__PURE__ */ React70.createElement(
|
|
3071
|
-
/* @__PURE__ */ React70.createElement(
|
|
3119
|
+
/* @__PURE__ */ React70.createElement(Typography4, { align: "center", variant: "subtitle2" }, __46("Streamline your workflow with dynamic tags", "elementor")),
|
|
3120
|
+
/* @__PURE__ */ React70.createElement(Typography4, { align: "center", variant: "caption" }, __46("You\u2019ll need Elementor Pro to use this feature.", "elementor"))
|
|
3072
3121
|
));
|
|
3073
3122
|
var useFilteredOptions = (searchValue) => {
|
|
3074
3123
|
const dynamicTags = usePropDynamicTags();
|
|
@@ -3128,7 +3177,7 @@ var DynamicSelectionControl = () => {
|
|
|
3128
3177
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
3129
3178
|
...bindPopover2(selectionPopoverState)
|
|
3130
3179
|
},
|
|
3131
|
-
/* @__PURE__ */ React71.createElement(
|
|
3180
|
+
/* @__PURE__ */ React71.createElement(Stack19, null, /* @__PURE__ */ React71.createElement(Stack19, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React71.createElement(DatabaseIcon2, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React71.createElement(Typography5, { variant: "subtitle2" }, __47("Dynamic tags", "elementor")), /* @__PURE__ */ React71.createElement(IconButton3, { size: SIZE4, sx: { ml: "auto" }, onClick: selectionPopoverState.close }, /* @__PURE__ */ React71.createElement(XIcon2, { fontSize: SIZE4 }))), /* @__PURE__ */ React71.createElement(DynamicSelection, { onSelect: selectionPopoverState.close }))
|
|
3132
3181
|
));
|
|
3133
3182
|
};
|
|
3134
3183
|
var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
@@ -3153,7 +3202,7 @@ var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
|
3153
3202
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
3154
3203
|
...bindPopover2(settingsPopupState)
|
|
3155
3204
|
},
|
|
3156
|
-
/* @__PURE__ */ React71.createElement(Paper, { component:
|
|
3205
|
+
/* @__PURE__ */ React71.createElement(Paper, { component: Stack19, sx: { minHeight: "300px", width: "220px" } }, /* @__PURE__ */ React71.createElement(Stack19, { direction: "row", alignItems: "center", px: 1.5, pt: 2, pb: 1 }, /* @__PURE__ */ React71.createElement(DatabaseIcon2, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React71.createElement(Typography5, { variant: "subtitle2" }, dynamicTag.label), /* @__PURE__ */ React71.createElement(IconButton3, { sx: { ml: "auto" }, size: SIZE4, onClick: settingsPopupState.close }, /* @__PURE__ */ React71.createElement(XIcon2, { fontSize: SIZE4 }))), /* @__PURE__ */ React71.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls }))
|
|
3157
3206
|
));
|
|
3158
3207
|
};
|
|
3159
3208
|
var DynamicSettings = ({ controls }) => {
|
|
@@ -3178,6 +3227,55 @@ var Control3 = ({ control }) => {
|
|
|
3178
3227
|
return /* @__PURE__ */ React71.createElement(DynamicControl, { bind: control.bind }, /* @__PURE__ */ React71.createElement(Grid26, { container: true, gap: 0.75 }, control.label ? /* @__PURE__ */ React71.createElement(Grid26, { item: true, xs: 12 }, /* @__PURE__ */ React71.createElement(ControlFormLabel5, null, control.label)) : null, /* @__PURE__ */ React71.createElement(Grid26, { item: true, xs: 12 }, /* @__PURE__ */ React71.createElement(Control, { type: control.type, props: control.props }))));
|
|
3179
3228
|
};
|
|
3180
3229
|
|
|
3230
|
+
// src/dynamics/dynamic-transformer.ts
|
|
3231
|
+
import { createTransformer } from "@elementor/editor-canvas";
|
|
3232
|
+
import { isTransformable as isTransformable2 } from "@elementor/editor-props";
|
|
3233
|
+
|
|
3234
|
+
// src/dynamics/errors.ts
|
|
3235
|
+
import { createError as createError2 } from "@elementor/utils";
|
|
3236
|
+
var DynamicTagsManagerNotFoundError = createError2({
|
|
3237
|
+
code: "dynamic_tags_manager_not_found",
|
|
3238
|
+
message: "Dynamic tags manager not found"
|
|
3239
|
+
});
|
|
3240
|
+
|
|
3241
|
+
// src/dynamics/dynamic-transformer.ts
|
|
3242
|
+
var dynamicTransformer = createTransformer((value) => {
|
|
3243
|
+
if (!value.name) {
|
|
3244
|
+
return null;
|
|
3245
|
+
}
|
|
3246
|
+
return getDynamicValue(value.name, simpleTransform(value.settings ?? {}));
|
|
3247
|
+
});
|
|
3248
|
+
function simpleTransform(props) {
|
|
3249
|
+
const transformed = Object.entries(props).map(([settingKey, settingValue]) => {
|
|
3250
|
+
const value = isTransformable2(settingValue) ? settingValue.value : settingValue;
|
|
3251
|
+
return [settingKey, value];
|
|
3252
|
+
});
|
|
3253
|
+
return Object.fromEntries(transformed);
|
|
3254
|
+
}
|
|
3255
|
+
function getDynamicValue(name, settings) {
|
|
3256
|
+
const extendedWindow = window;
|
|
3257
|
+
const { dynamicTags } = extendedWindow.elementor ?? {};
|
|
3258
|
+
if (!dynamicTags) {
|
|
3259
|
+
throw new DynamicTagsManagerNotFoundError();
|
|
3260
|
+
}
|
|
3261
|
+
const getTagValue = () => {
|
|
3262
|
+
const tag = dynamicTags.createTag("v4-dynamic-tag", name, settings);
|
|
3263
|
+
if (!tag) {
|
|
3264
|
+
return null;
|
|
3265
|
+
}
|
|
3266
|
+
return dynamicTags.loadTagDataFromCache(tag) ?? null;
|
|
3267
|
+
};
|
|
3268
|
+
const tagValue = getTagValue();
|
|
3269
|
+
if (tagValue !== null) {
|
|
3270
|
+
return tagValue;
|
|
3271
|
+
}
|
|
3272
|
+
return new Promise((resolve) => {
|
|
3273
|
+
dynamicTags.refreshCacheFromServer(() => {
|
|
3274
|
+
resolve(getTagValue());
|
|
3275
|
+
});
|
|
3276
|
+
});
|
|
3277
|
+
}
|
|
3278
|
+
|
|
3181
3279
|
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
3182
3280
|
import * as React72 from "react";
|
|
3183
3281
|
import { useBoundProp as useBoundProp6 } from "@elementor/editor-controls";
|
|
@@ -3205,6 +3303,8 @@ var init = () => {
|
|
|
3205
3303
|
id: "dynamic-tags",
|
|
3206
3304
|
useProps: usePropDynamicAction
|
|
3207
3305
|
});
|
|
3306
|
+
styleTransformersRegistry.register("dynamic", dynamicTransformer);
|
|
3307
|
+
settingsTransformersRegistry.register("dynamic", dynamicTransformer);
|
|
3208
3308
|
};
|
|
3209
3309
|
|
|
3210
3310
|
// src/init.ts
|