@elementor/editor-editing-panel 1.0.0 → 1.1.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 +46 -0
- package/dist/index.d.mts +10 -19
- package/dist/index.d.ts +10 -19
- package/dist/index.js +1283 -1751
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1305 -1762
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -12
- package/src/components/add-or-remove-content.tsx +3 -3
- package/src/components/collapse-icon.tsx +12 -0
- package/src/components/collapsible-content.tsx +5 -14
- package/src/components/collapsible-field.tsx +5 -3
- package/src/components/css-class-selector-section.tsx +76 -0
- package/src/components/editing-panel-hooks.tsx +2 -0
- package/src/components/editing-panel-tabs.tsx +23 -13
- package/src/components/editing-panel.tsx +9 -6
- package/src/components/multi-combobox/index.ts +3 -0
- package/src/components/multi-combobox/multi-combobox.tsx +120 -0
- package/src/components/multi-combobox/types.ts +26 -0
- package/src/components/multi-combobox/use-combobox-actions.ts +62 -0
- package/src/components/section.tsx +37 -0
- package/src/components/sections-list.tsx +6 -0
- package/src/components/settings-tab.tsx +11 -11
- package/src/components/style-sections/background-section/background-color-field.tsx +4 -4
- package/src/components/style-sections/background-section/background-section.tsx +9 -7
- package/src/components/style-sections/border-section/border-color-field.tsx +4 -4
- package/src/components/style-sections/border-section/border-field.tsx +4 -3
- package/src/components/style-sections/border-section/border-radius-field.tsx +4 -3
- package/src/components/style-sections/border-section/border-section.tsx +7 -10
- package/src/components/style-sections/border-section/border-style-field.tsx +4 -4
- package/src/components/style-sections/border-section/border-width-field.tsx +4 -3
- package/src/components/style-sections/effects-section/effects-section.tsx +7 -10
- package/src/components/style-sections/layout-section/display-field.tsx +32 -0
- package/src/components/style-sections/layout-section/justify-content-field.tsx +82 -0
- package/src/components/style-sections/layout-section/layout-section.tsx +17 -0
- package/src/components/style-sections/layout-section/utils/rotate-flex-icon.ts +12 -0
- package/src/components/style-sections/position-section/dimensions-field.tsx +6 -6
- package/src/components/style-sections/position-section/position-field.tsx +4 -4
- package/src/components/style-sections/position-section/position-section.tsx +45 -15
- package/src/components/style-sections/position-section/z-index-field.tsx +4 -4
- package/src/components/style-sections/size-section/overflow-field.tsx +8 -8
- package/src/components/style-sections/size-section/size-section.tsx +33 -26
- package/src/components/style-sections/spacing-section/spacing-section.tsx +11 -13
- package/src/components/style-sections/typography-section/font-family-field.tsx +40 -0
- package/src/components/style-sections/typography-section/font-size-field.tsx +4 -4
- package/src/components/style-sections/typography-section/font-weight-field.tsx +4 -4
- package/src/components/style-sections/typography-section/letter-spacing-field.tsx +4 -4
- package/src/components/style-sections/typography-section/text-alignment-field.tsx +9 -9
- package/src/components/style-sections/typography-section/text-color-field.tsx +4 -4
- package/src/components/style-sections/typography-section/text-direction-field.tsx +7 -7
- package/src/components/style-sections/typography-section/text-stroke-field.tsx +3 -3
- package/src/components/style-sections/typography-section/text-style-field.tsx +5 -4
- package/src/components/style-sections/typography-section/transform-field.tsx +23 -9
- package/src/components/style-sections/typography-section/typography-section.tsx +26 -27
- package/src/components/style-sections/typography-section/word-spacing-field.tsx +4 -4
- package/src/components/style-tab.tsx +67 -31
- package/src/contexts/classes-prop-context.tsx +1 -1
- package/src/contexts/element-context.tsx +2 -2
- package/src/contexts/style-context.tsx +6 -5
- package/src/control-replacement.tsx +1 -1
- package/src/controls-actions.ts +3 -2
- package/src/controls-registry/control-type-container.tsx +3 -2
- package/src/controls-registry/control.tsx +2 -1
- package/src/controls-registry/controls-registry.tsx +8 -1
- package/src/controls-registry/settings-field.tsx +5 -4
- package/src/controls-registry/styles-field.tsx +3 -2
- package/src/dynamics/components/dynamic-selection-control.tsx +15 -14
- package/src/dynamics/components/dynamic-selection.tsx +9 -8
- package/src/dynamics/dynamic-control.tsx +4 -4
- package/src/dynamics/hooks/use-dynamic-tag.ts +3 -2
- package/src/dynamics/hooks/use-prop-dynamic-action.tsx +6 -5
- package/src/dynamics/hooks/use-prop-dynamic-tags.ts +3 -2
- package/src/dynamics/init.ts +5 -3
- package/src/dynamics/sync/get-elementor-config.ts +1 -1
- package/src/dynamics/types.ts +2 -2
- package/src/dynamics/utils.ts +3 -2
- package/src/hooks/use-close-editor-panel.ts +23 -0
- package/src/hooks/use-direction.ts +13 -0
- package/src/hooks/use-open-editor-panel.ts +4 -3
- package/src/hooks/use-prop-value-history.ts +45 -0
- package/src/hooks/use-style-prop-history.ts +75 -0
- package/src/hooks/use-styles-field.ts +25 -4
- package/src/index.ts +1 -1
- package/src/init.ts +5 -4
- package/src/panel.ts +1 -0
- package/src/popover-action.tsx +1 -1
- package/src/sync/enqueue-font.ts +7 -0
- package/src/sync/get-elementor-config.ts +7 -0
- package/src/sync/{should-use-v2-panel.ts → is-atomic-widget-selected.ts} +1 -1
- package/src/sync/types.ts +20 -21
- package/src/components/accordion-section.tsx +0 -26
- package/src/components/control-label.tsx +0 -10
- package/src/controls/bound-prop-context.tsx +0 -30
- package/src/controls/components/control-toggle-button-group.tsx +0 -68
- package/src/controls/components/repeater.tsx +0 -197
- package/src/controls/components/text-field-inner-selection.tsx +0 -75
- package/src/controls/control-actions/control-actions-context.tsx +0 -27
- package/src/controls/control-actions/control-actions-menu.ts +0 -7
- package/src/controls/control-actions/control-actions.tsx +0 -31
- package/src/controls/controls/box-shadow-repeater-control.tsx +0 -210
- package/src/controls/controls/color-control.tsx +0 -25
- package/src/controls/controls/equal-unequal-sizes-control.tsx +0 -196
- package/src/controls/controls/image-control.tsx +0 -58
- package/src/controls/controls/image-media-control.tsx +0 -64
- package/src/controls/controls/linked-dimensions-control.tsx +0 -139
- package/src/controls/controls/number-control.tsx +0 -29
- package/src/controls/controls/select-control.tsx +0 -30
- package/src/controls/controls/size-control.tsx +0 -71
- package/src/controls/controls/stroke-control.tsx +0 -105
- package/src/controls/controls/text-area-control.tsx +0 -31
- package/src/controls/controls/text-control.tsx +0 -17
- package/src/controls/controls/toggle-control.tsx +0 -26
- package/src/controls/create-control-replacement.tsx +0 -53
- package/src/controls/create-control.tsx +0 -40
- package/src/controls/hooks/use-sync-external-state.tsx +0 -51
- package/src/controls/index.ts +0 -24
- package/src/dynamics/hooks/use-prop-value-history.ts +0 -26
package/dist/index.js
CHANGED
|
@@ -31,1204 +31,1084 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
33
|
replaceControl: () => replaceControl,
|
|
34
|
-
useBoundProp: () => useBoundProp
|
|
34
|
+
useBoundProp: () => import_editor_controls38.useBoundProp
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(src_exports);
|
|
37
|
+
var import_editor_controls38 = require("@elementor/editor-controls");
|
|
37
38
|
|
|
38
|
-
// src/
|
|
39
|
-
var
|
|
40
|
-
var
|
|
39
|
+
// src/control-replacement.tsx
|
|
40
|
+
var import_editor_controls = require("@elementor/editor-controls");
|
|
41
|
+
var { replaceControl, getControlReplacement } = (0, import_editor_controls.createControlReplacement)();
|
|
41
42
|
|
|
42
|
-
// src/
|
|
43
|
-
var
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
var BoundPropProvider = ({ children, value, setValue, bind }) => {
|
|
47
|
-
return /* @__PURE__ */ React.createElement(BoundPropContext.Provider, { value: { value, setValue, bind } }, children);
|
|
48
|
-
};
|
|
49
|
-
function useBoundProp(defaultValue) {
|
|
50
|
-
const boundPropContext = (0, import_react.useContext)(BoundPropContext);
|
|
51
|
-
if (!boundPropContext) {
|
|
52
|
-
throw new Error("useBoundProp must be used within a BoundPropContext");
|
|
53
|
-
}
|
|
54
|
-
return { ...boundPropContext, value: boundPropContext.value ?? defaultValue };
|
|
55
|
-
}
|
|
43
|
+
// src/init.ts
|
|
44
|
+
var import_editor = require("@elementor/editor");
|
|
45
|
+
var import_editor_panels3 = require("@elementor/editor-panels");
|
|
46
|
+
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
56
47
|
|
|
57
|
-
// src/
|
|
58
|
-
var
|
|
48
|
+
// src/hooks/use-close-editor-panel.ts
|
|
49
|
+
var import_react14 = require("react");
|
|
50
|
+
var import_editor_elements8 = require("@elementor/editor-elements");
|
|
51
|
+
var import_editor_v1_adapters = require("@elementor/editor-v1-adapters");
|
|
59
52
|
|
|
60
|
-
// src/
|
|
61
|
-
var
|
|
62
|
-
var import_i18n = require("@wordpress/i18n");
|
|
63
|
-
var import_icons = require("@elementor/icons");
|
|
64
|
-
var import_ui3 = require("@elementor/ui");
|
|
65
|
-
var import_wp_media = require("@elementor/wp-media");
|
|
53
|
+
// src/panel.ts
|
|
54
|
+
var import_editor_panels2 = require("@elementor/editor-panels");
|
|
66
55
|
|
|
67
|
-
// src/
|
|
68
|
-
var
|
|
69
|
-
var
|
|
56
|
+
// src/components/editing-panel.tsx
|
|
57
|
+
var React51 = __toESM(require("react"));
|
|
58
|
+
var import_editor_controls33 = require("@elementor/editor-controls");
|
|
59
|
+
var import_editor_elements6 = require("@elementor/editor-elements");
|
|
60
|
+
var import_editor_panels = require("@elementor/editor-panels");
|
|
61
|
+
var import_ui43 = require("@elementor/ui");
|
|
62
|
+
var import_i18n31 = require("@wordpress/i18n");
|
|
70
63
|
|
|
71
|
-
// src/
|
|
72
|
-
var
|
|
73
|
-
var
|
|
74
|
-
var Context = (0,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
64
|
+
// src/contexts/element-context.tsx
|
|
65
|
+
var React = __toESM(require("react"));
|
|
66
|
+
var import_react = require("react");
|
|
67
|
+
var Context = (0, import_react.createContext)(null);
|
|
68
|
+
function ElementProvider({ children, element, elementType }) {
|
|
69
|
+
return /* @__PURE__ */ React.createElement(Context.Provider, { value: { element, elementType } }, children);
|
|
70
|
+
}
|
|
71
|
+
function useElement() {
|
|
72
|
+
const context = (0, import_react.useContext)(Context);
|
|
78
73
|
if (!context) {
|
|
79
|
-
throw new Error("
|
|
74
|
+
throw new Error("useElement must be used within a ElementProvider");
|
|
80
75
|
}
|
|
81
76
|
return context;
|
|
82
|
-
}
|
|
77
|
+
}
|
|
83
78
|
|
|
84
|
-
// src/controls
|
|
85
|
-
var
|
|
86
|
-
display: contents;
|
|
79
|
+
// src/controls-actions.ts
|
|
80
|
+
var import_menus = require("@elementor/menus");
|
|
87
81
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
82
|
+
// src/popover-action.tsx
|
|
83
|
+
var React2 = __toESM(require("react"));
|
|
84
|
+
var import_react2 = require("react");
|
|
85
|
+
var import_icons = require("@elementor/icons");
|
|
86
|
+
var import_ui = require("@elementor/ui");
|
|
87
|
+
var SIZE = "tiny";
|
|
88
|
+
function PopoverAction({
|
|
89
|
+
title,
|
|
90
|
+
visible = true,
|
|
91
|
+
icon: Icon,
|
|
92
|
+
popoverContent: PopoverContent
|
|
93
|
+
}) {
|
|
94
|
+
const id = (0, import_react2.useId)();
|
|
95
|
+
const popupState = (0, import_ui.usePopupState)({
|
|
96
|
+
variant: "popover",
|
|
97
|
+
popupId: `elementor-popover-action-${id}`
|
|
98
|
+
});
|
|
99
|
+
if (!visible) {
|
|
100
|
+
return null;
|
|
96
101
|
}
|
|
97
|
-
|
|
98
|
-
|
|
102
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(import_ui.Tooltip, { placement: "top", title }, /* @__PURE__ */ React2.createElement(import_ui.IconButton, { "aria-label": title, key: id, size: SIZE, ...(0, import_ui.bindToggle)(popupState) }, /* @__PURE__ */ React2.createElement(Icon, { fontSize: SIZE }))), /* @__PURE__ */ React2.createElement(
|
|
103
|
+
import_ui.Popover,
|
|
104
|
+
{
|
|
105
|
+
disablePortal: true,
|
|
106
|
+
disableScrollLock: true,
|
|
107
|
+
anchorOrigin: {
|
|
108
|
+
vertical: "bottom",
|
|
109
|
+
horizontal: "center"
|
|
110
|
+
},
|
|
111
|
+
...(0, import_ui.bindPopover)(popupState)
|
|
112
|
+
},
|
|
113
|
+
/* @__PURE__ */ React2.createElement(import_ui.Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React2.createElement(Icon, { fontSize: SIZE, sx: { mr: 0.5 } }), /* @__PURE__ */ React2.createElement(import_ui.Typography, { variant: "subtitle2" }, title), /* @__PURE__ */ React2.createElement(import_ui.IconButton, { sx: { ml: "auto" }, size: SIZE, onClick: popupState.close }, /* @__PURE__ */ React2.createElement(import_icons.XIcon, { fontSize: SIZE }))),
|
|
114
|
+
/* @__PURE__ */ React2.createElement(PopoverContent, { closePopover: popupState.close })
|
|
115
|
+
));
|
|
99
116
|
}
|
|
100
117
|
|
|
101
|
-
// src/controls
|
|
102
|
-
var
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
var React4 = __toESM(require("react"));
|
|
106
|
-
var import_react3 = require("react");
|
|
107
|
-
var ControlReplacementContext = (0, import_react3.createContext)(void 0);
|
|
108
|
-
var ControlReplacementProvider = ({
|
|
109
|
-
component,
|
|
110
|
-
condition,
|
|
111
|
-
children
|
|
112
|
-
}) => {
|
|
113
|
-
return /* @__PURE__ */ React4.createElement(ControlReplacementContext.Provider, { value: { component, condition } }, children);
|
|
114
|
-
};
|
|
115
|
-
var useControlReplacement = () => {
|
|
116
|
-
const { value } = useBoundProp();
|
|
117
|
-
const controlReplacement = (0, import_react3.useContext)(ControlReplacementContext);
|
|
118
|
-
let shouldReplace = false;
|
|
119
|
-
try {
|
|
120
|
-
shouldReplace = !!controlReplacement?.condition({ value }) && !!controlReplacement.component;
|
|
121
|
-
} catch {
|
|
122
|
-
}
|
|
123
|
-
return shouldReplace ? controlReplacement?.component : void 0;
|
|
124
|
-
};
|
|
125
|
-
var createControlReplacement = () => {
|
|
126
|
-
let controlReplacement;
|
|
127
|
-
function replaceControl2({ component, condition }) {
|
|
128
|
-
controlReplacement = { component, condition };
|
|
129
|
-
}
|
|
130
|
-
function getControlReplacement2() {
|
|
131
|
-
return controlReplacement;
|
|
118
|
+
// src/controls-actions.ts
|
|
119
|
+
var controlActionsMenu = (0, import_menus.createMenu)({
|
|
120
|
+
components: {
|
|
121
|
+
PopoverAction
|
|
132
122
|
}
|
|
133
|
-
|
|
134
|
-
};
|
|
123
|
+
});
|
|
135
124
|
|
|
136
|
-
// src/
|
|
125
|
+
// src/components/editing-panel-error-fallback.tsx
|
|
126
|
+
var React3 = __toESM(require("react"));
|
|
137
127
|
var import_ui2 = require("@elementor/ui");
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
return (props) => {
|
|
141
|
-
const ControlReplacement = useControlReplacement();
|
|
142
|
-
if (ControlReplacement && supportsReplacements) {
|
|
143
|
-
return /* @__PURE__ */ React5.createElement(import_ui2.ErrorBoundary, { fallback: null }, /* @__PURE__ */ React5.createElement(ControlReplacement, { ...props }));
|
|
144
|
-
}
|
|
145
|
-
return /* @__PURE__ */ React5.createElement(import_ui2.ErrorBoundary, { fallback: null }, /* @__PURE__ */ React5.createElement(Component, { ...props }));
|
|
146
|
-
};
|
|
128
|
+
function EditorPanelErrorFallback() {
|
|
129
|
+
return /* @__PURE__ */ React3.createElement(import_ui2.Box, { role: "alert", sx: { minHeight: "100%", p: 2 } }, /* @__PURE__ */ React3.createElement(import_ui2.Alert, { severity: "error", sx: { mb: 2, maxWidth: 400, textAlign: "center" } }, /* @__PURE__ */ React3.createElement("strong", null, "Something went wrong")));
|
|
147
130
|
}
|
|
148
131
|
|
|
149
|
-
// src/
|
|
150
|
-
var
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
const src = attachment?.url ?? url;
|
|
155
|
-
const { open } = (0, import_wp_media.useWpMediaFrame)({
|
|
156
|
-
types: ["image"],
|
|
157
|
-
multiple: false,
|
|
158
|
-
selected: id?.value || null,
|
|
159
|
-
onSelect: (selectedAttachment) => {
|
|
160
|
-
setValue({
|
|
161
|
-
$$type: "image-src",
|
|
162
|
-
value: {
|
|
163
|
-
id: {
|
|
164
|
-
$$type: "image-attachment-id",
|
|
165
|
-
value: selectedAttachment.id
|
|
166
|
-
},
|
|
167
|
-
url: null
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
return /* @__PURE__ */ React6.createElement(import_ui3.Card, { variant: "outlined" }, /* @__PURE__ */ React6.createElement(import_ui3.CardMedia, { image: src, sx: { height: 150 } }), /* @__PURE__ */ React6.createElement(import_ui3.CardOverlay, null, /* @__PURE__ */ React6.createElement(ControlActions, null, /* @__PURE__ */ React6.createElement(import_ui3.Stack, { gap: 0.5 }, /* @__PURE__ */ React6.createElement(
|
|
173
|
-
import_ui3.Button,
|
|
174
|
-
{
|
|
175
|
-
size: "tiny",
|
|
176
|
-
color: "inherit",
|
|
177
|
-
variant: "outlined",
|
|
178
|
-
onClick: () => open({ mode: "browse" })
|
|
179
|
-
},
|
|
180
|
-
(0, import_i18n.__)("Select Image", "elementor")
|
|
181
|
-
), /* @__PURE__ */ React6.createElement(
|
|
182
|
-
import_ui3.Button,
|
|
183
|
-
{
|
|
184
|
-
size: "tiny",
|
|
185
|
-
variant: "text",
|
|
186
|
-
color: "inherit",
|
|
187
|
-
startIcon: /* @__PURE__ */ React6.createElement(import_icons.UploadIcon, null),
|
|
188
|
-
onClick: () => open({ mode: "upload" })
|
|
189
|
-
},
|
|
190
|
-
(0, import_i18n.__)("Upload Image", "elementor")
|
|
191
|
-
)))));
|
|
192
|
-
});
|
|
132
|
+
// src/components/editing-panel-tabs.tsx
|
|
133
|
+
var React50 = __toESM(require("react"));
|
|
134
|
+
var import_react13 = require("react");
|
|
135
|
+
var import_ui42 = require("@elementor/ui");
|
|
136
|
+
var import_i18n30 = require("@wordpress/i18n");
|
|
193
137
|
|
|
194
|
-
// src/
|
|
195
|
-
var
|
|
196
|
-
var
|
|
197
|
-
var SelectControl = createControl(({ options: options5 }) => {
|
|
198
|
-
const { value, setValue } = useBoundProp();
|
|
199
|
-
const handleChange = (event) => {
|
|
200
|
-
setValue(event.target.value);
|
|
201
|
-
};
|
|
202
|
-
return /* @__PURE__ */ React7.createElement(ControlActions, null, /* @__PURE__ */ React7.createElement(import_ui4.Select, { displayEmpty: true, size: "tiny", value: value ?? "", onChange: handleChange, fullWidth: true }, options5.map(({ label, ...props }) => /* @__PURE__ */ React7.createElement(import_ui4.MenuItem, { key: props.value, ...props }, label))));
|
|
203
|
-
});
|
|
138
|
+
// src/components/settings-tab.tsx
|
|
139
|
+
var React9 = __toESM(require("react"));
|
|
140
|
+
var import_editor_controls4 = require("@elementor/editor-controls");
|
|
204
141
|
|
|
205
|
-
// src/
|
|
206
|
-
var
|
|
207
|
-
var
|
|
208
|
-
|
|
209
|
-
|
|
142
|
+
// src/controls-registry/control.tsx
|
|
143
|
+
var React4 = __toESM(require("react"));
|
|
144
|
+
var import_utils = require("@elementor/utils");
|
|
145
|
+
|
|
146
|
+
// src/controls-registry/controls-registry.tsx
|
|
147
|
+
var import_editor_controls2 = require("@elementor/editor-controls");
|
|
148
|
+
var controlTypes = {
|
|
149
|
+
image: { component: import_editor_controls2.ImageControl, layout: "full" },
|
|
150
|
+
text: { component: import_editor_controls2.TextControl, layout: "two-columns" },
|
|
151
|
+
textarea: { component: import_editor_controls2.TextAreaControl, layout: "full" },
|
|
152
|
+
size: { component: import_editor_controls2.SizeControl, layout: "two-columns" },
|
|
153
|
+
select: { component: import_editor_controls2.SelectControl, layout: "two-columns" }
|
|
210
154
|
};
|
|
155
|
+
var getControlByType = (type) => controlTypes[type]?.component;
|
|
156
|
+
var getLayoutByType = (type) => controlTypes[type].layout;
|
|
211
157
|
|
|
212
|
-
// src/controls/
|
|
213
|
-
var
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
158
|
+
// src/controls-registry/control.tsx
|
|
159
|
+
var ControlTypeError = (0, import_utils.createError)({
|
|
160
|
+
code: "CONTROL_TYPE_NOT_FOUND",
|
|
161
|
+
message: `Control type not found.`
|
|
162
|
+
});
|
|
163
|
+
var Control = ({ props, type }) => {
|
|
164
|
+
const ControlByType = getControlByType(type);
|
|
165
|
+
if (!ControlByType) {
|
|
166
|
+
throw new ControlTypeError({
|
|
167
|
+
context: { type }
|
|
223
168
|
});
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
169
|
+
}
|
|
170
|
+
return /* @__PURE__ */ React4.createElement(ControlByType, { ...props });
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
// src/controls-registry/control-type-container.tsx
|
|
174
|
+
var React5 = __toESM(require("react"));
|
|
175
|
+
var import_ui3 = require("@elementor/ui");
|
|
176
|
+
var ControlTypeContainer = ({
|
|
177
|
+
controlType,
|
|
178
|
+
children
|
|
179
|
+
}) => {
|
|
180
|
+
const layout = getLayoutByType(controlType);
|
|
181
|
+
return /* @__PURE__ */ React5.createElement(StyledContainer, { layout }, children);
|
|
182
|
+
};
|
|
183
|
+
var StyledContainer = (0, import_ui3.styled)(import_ui3.Box, {
|
|
184
|
+
shouldForwardProp: (prop) => !["layout"].includes(prop)
|
|
185
|
+
})(({ layout, theme }) => ({
|
|
186
|
+
display: "grid",
|
|
187
|
+
gridGap: theme.spacing(1),
|
|
188
|
+
...getGridLayout(layout)
|
|
189
|
+
}));
|
|
190
|
+
var getGridLayout = (layout) => ({
|
|
191
|
+
justifyContent: "space-between",
|
|
192
|
+
gridTemplateColumns: {
|
|
193
|
+
full: "1fr",
|
|
194
|
+
"two-columns": "repeat(2, 1fr)"
|
|
195
|
+
}[layout]
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
// src/controls-registry/settings-field.tsx
|
|
199
|
+
var React6 = __toESM(require("react"));
|
|
200
|
+
var import_editor_controls3 = require("@elementor/editor-controls");
|
|
201
|
+
var import_editor_elements = require("@elementor/editor-elements");
|
|
202
|
+
var SettingsField = ({ bind, children }) => {
|
|
203
|
+
const { element, elementType } = useElement();
|
|
204
|
+
const defaultValue = elementType.propsSchema[bind]?.default;
|
|
205
|
+
const settingsValue = (0, import_editor_elements.useElementSetting)(element.id, bind);
|
|
206
|
+
const value = settingsValue ?? defaultValue ?? null;
|
|
207
|
+
const setValue = (newValue) => {
|
|
208
|
+
(0, import_editor_elements.updateSettings)({
|
|
209
|
+
id: element.id,
|
|
210
|
+
props: {
|
|
211
|
+
[bind]: newValue
|
|
231
212
|
}
|
|
232
213
|
});
|
|
233
214
|
};
|
|
234
|
-
return /* @__PURE__ */
|
|
235
|
-
}
|
|
215
|
+
return /* @__PURE__ */ React6.createElement(import_editor_controls3.BoundPropProvider, { setValue, value, bind }, children);
|
|
216
|
+
};
|
|
236
217
|
|
|
237
|
-
// src/
|
|
238
|
-
var
|
|
239
|
-
var
|
|
240
|
-
var
|
|
241
|
-
const { value, setValue } = useBoundProp("");
|
|
242
|
-
const handleChange = (event) => setValue(event.target.value);
|
|
243
|
-
return /* @__PURE__ */ React10.createElement(ControlActions, null, /* @__PURE__ */ React10.createElement(import_ui7.TextField, { type: "text", size: "tiny", value, onChange: handleChange, placeholder }));
|
|
244
|
-
});
|
|
218
|
+
// src/components/section.tsx
|
|
219
|
+
var React7 = __toESM(require("react"));
|
|
220
|
+
var import_react3 = require("react");
|
|
221
|
+
var import_ui5 = require("@elementor/ui");
|
|
245
222
|
|
|
246
|
-
// src/
|
|
247
|
-
var
|
|
248
|
-
var
|
|
249
|
-
var
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
223
|
+
// src/components/collapse-icon.tsx
|
|
224
|
+
var import_icons2 = require("@elementor/icons");
|
|
225
|
+
var import_ui4 = require("@elementor/ui");
|
|
226
|
+
var CollapseIcon = (0, import_ui4.styled)(import_icons2.ChevronDownIcon, {
|
|
227
|
+
shouldForwardProp: (prop) => prop !== "open"
|
|
228
|
+
})(({ theme, open }) => ({
|
|
229
|
+
transform: open ? "rotate(180deg)" : "rotate(0deg)",
|
|
230
|
+
transition: theme.transitions.create("transform", {
|
|
231
|
+
duration: theme.transitions.duration.standard
|
|
232
|
+
})
|
|
233
|
+
}));
|
|
234
|
+
|
|
235
|
+
// src/components/section.tsx
|
|
236
|
+
function Section({ title, children, defaultExpanded = false }) {
|
|
237
|
+
const [isOpen, setIsOpen] = (0, import_react3.useState)(!!defaultExpanded);
|
|
238
|
+
const id = (0, import_react3.useId)();
|
|
239
|
+
const labelId = `label-${id}`;
|
|
240
|
+
const contentId = `content-${id}`;
|
|
241
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(
|
|
242
|
+
import_ui5.ListItemButton,
|
|
256
243
|
{
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
));
|
|
266
|
-
});
|
|
244
|
+
id: labelId,
|
|
245
|
+
"aria-controls": contentId,
|
|
246
|
+
onClick: () => setIsOpen((prev) => !prev)
|
|
247
|
+
},
|
|
248
|
+
/* @__PURE__ */ React7.createElement(import_ui5.ListItemText, { secondary: title }),
|
|
249
|
+
/* @__PURE__ */ React7.createElement(CollapseIcon, { open: isOpen, color: "secondary" })
|
|
250
|
+
), /* @__PURE__ */ React7.createElement(import_ui5.Collapse, { id: contentId, "aria-labelledby": labelId, in: isOpen, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React7.createElement(import_ui5.Stack, { gap: 2.5, p: 2 }, children)), /* @__PURE__ */ React7.createElement(import_ui5.Divider, null));
|
|
251
|
+
}
|
|
267
252
|
|
|
268
|
-
// src/
|
|
269
|
-
var
|
|
270
|
-
var
|
|
253
|
+
// src/components/sections-list.tsx
|
|
254
|
+
var React8 = __toESM(require("react"));
|
|
255
|
+
var import_ui6 = require("@elementor/ui");
|
|
256
|
+
function SectionsList(props) {
|
|
257
|
+
return /* @__PURE__ */ React8.createElement(import_ui6.List, { disablePadding: true, component: "div", ...props });
|
|
258
|
+
}
|
|
271
259
|
|
|
272
|
-
// src/
|
|
273
|
-
var
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
fallback
|
|
279
|
-
}) => {
|
|
280
|
-
function toExternal(internalValue) {
|
|
281
|
-
if (persistWhen(internalValue)) {
|
|
282
|
-
return internalValue;
|
|
260
|
+
// src/components/settings-tab.tsx
|
|
261
|
+
var SettingsTab = () => {
|
|
262
|
+
const { elementType } = useElement();
|
|
263
|
+
return /* @__PURE__ */ React9.createElement(SectionsList, null, elementType.controls.map(({ type, value }, index) => {
|
|
264
|
+
if (type === "control") {
|
|
265
|
+
return /* @__PURE__ */ React9.createElement(Control2, { key: value.bind, control: value });
|
|
283
266
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
267
|
+
if (type === "section") {
|
|
268
|
+
return /* @__PURE__ */ React9.createElement(Section, { title: value.label, key: type + "." + index, defaultExpanded: true }, value.items?.map((item) => {
|
|
269
|
+
if (item.type === "control") {
|
|
270
|
+
return /* @__PURE__ */ React9.createElement(Control2, { key: item.value.bind, control: item.value });
|
|
271
|
+
}
|
|
272
|
+
return null;
|
|
273
|
+
}));
|
|
289
274
|
}
|
|
290
|
-
return
|
|
275
|
+
return null;
|
|
276
|
+
}));
|
|
277
|
+
};
|
|
278
|
+
var Control2 = ({ control }) => {
|
|
279
|
+
if (!getControlByType(control.type)) {
|
|
280
|
+
return null;
|
|
291
281
|
}
|
|
292
|
-
|
|
293
|
-
(0, import_react4.useEffect)(() => {
|
|
294
|
-
setInternal((prevInternal) => toInternal(external, prevInternal));
|
|
295
|
-
}, [external]);
|
|
296
|
-
const setInternalValue = (setter) => {
|
|
297
|
-
const setterFn = typeof setter === "function" ? setter : () => setter;
|
|
298
|
-
const updated = setterFn(internal);
|
|
299
|
-
setInternal(updated);
|
|
300
|
-
setExternal(toExternal(updated));
|
|
301
|
-
};
|
|
302
|
-
return [internal, setInternalValue];
|
|
282
|
+
return /* @__PURE__ */ React9.createElement(SettingsField, { bind: control.bind }, /* @__PURE__ */ React9.createElement(ControlTypeContainer, { controlType: control.type }, control.label ? /* @__PURE__ */ React9.createElement(import_editor_controls4.ControlLabel, null, control.label) : null, /* @__PURE__ */ React9.createElement(Control, { type: control.type, props: control.props })));
|
|
303
283
|
};
|
|
304
284
|
|
|
305
|
-
// src/
|
|
306
|
-
var
|
|
285
|
+
// src/components/style-tab.tsx
|
|
286
|
+
var React49 = __toESM(require("react"));
|
|
287
|
+
var import_react12 = require("react");
|
|
288
|
+
var import_editor_elements5 = require("@elementor/editor-elements");
|
|
289
|
+
var import_editor_responsive = require("@elementor/editor-responsive");
|
|
290
|
+
var import_editor_styles = require("@elementor/editor-styles");
|
|
291
|
+
var import_ui41 = require("@elementor/ui");
|
|
292
|
+
var import_i18n29 = require("@wordpress/i18n");
|
|
293
|
+
|
|
294
|
+
// src/contexts/classes-prop-context.tsx
|
|
295
|
+
var React10 = __toESM(require("react"));
|
|
296
|
+
var import_react4 = require("react");
|
|
297
|
+
var Context2 = (0, import_react4.createContext)(null);
|
|
298
|
+
function ClassesPropProvider({ children, prop }) {
|
|
299
|
+
return /* @__PURE__ */ React10.createElement(Context2.Provider, { value: { prop } }, children);
|
|
300
|
+
}
|
|
301
|
+
function useClassesProp() {
|
|
302
|
+
const context = (0, import_react4.useContext)(Context2);
|
|
303
|
+
if (!context) {
|
|
304
|
+
throw new Error("useClassesProp must be used within a ClassesPropProvider");
|
|
305
|
+
}
|
|
306
|
+
return context.prop;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// src/contexts/style-context.tsx
|
|
310
|
+
var React11 = __toESM(require("react"));
|
|
307
311
|
var import_react5 = require("react");
|
|
308
|
-
var
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
value,
|
|
317
|
-
onChange,
|
|
318
|
-
placeholder,
|
|
319
|
-
InputProps: {
|
|
320
|
-
endAdornment,
|
|
321
|
-
startAdornment
|
|
322
|
-
},
|
|
323
|
-
ref
|
|
324
|
-
}
|
|
325
|
-
);
|
|
312
|
+
var Context3 = (0, import_react5.createContext)(null);
|
|
313
|
+
function StyleProvider({ children, id, setId, meta }) {
|
|
314
|
+
return /* @__PURE__ */ React11.createElement(Context3.Provider, { value: { id, setId, meta } }, children);
|
|
315
|
+
}
|
|
316
|
+
function useStyle() {
|
|
317
|
+
const context = (0, import_react5.useContext)(Context3);
|
|
318
|
+
if (!context) {
|
|
319
|
+
throw new Error("useStyle must be used within a StyleProvider");
|
|
326
320
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
options: options5,
|
|
330
|
-
onClick,
|
|
331
|
-
value
|
|
332
|
-
}) => {
|
|
333
|
-
const popupState = (0, import_ui9.usePopupState)({
|
|
334
|
-
variant: "popover",
|
|
335
|
-
popupId: (0, import_react5.useId)()
|
|
336
|
-
});
|
|
337
|
-
const handleMenuItemClick = (index) => {
|
|
338
|
-
onClick(options5[index]);
|
|
339
|
-
popupState.close();
|
|
340
|
-
};
|
|
341
|
-
return /* @__PURE__ */ React12.createElement(import_ui9.InputAdornment, { position: "end" }, /* @__PURE__ */ React12.createElement(
|
|
342
|
-
import_ui9.Button,
|
|
343
|
-
{
|
|
344
|
-
size: "small",
|
|
345
|
-
color: "inherit",
|
|
346
|
-
sx: { font: "inherit", minWidth: "initial" },
|
|
347
|
-
...(0, import_ui9.bindTrigger)(popupState)
|
|
348
|
-
},
|
|
349
|
-
value.toUpperCase()
|
|
350
|
-
), /* @__PURE__ */ React12.createElement(import_ui9.Menu, { MenuListProps: { dense: true }, ...(0, import_ui9.bindMenu)(popupState) }, options5.map((option, index) => /* @__PURE__ */ React12.createElement(import_ui9.MenuItem, { key: option, onClick: () => handleMenuItemClick(index) }, option.toUpperCase()))));
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
// src/controls/controls/size-control.tsx
|
|
354
|
-
var defaultUnits = ["px", "%", "em", "rem", "vw", "vh"];
|
|
355
|
-
var SizeControl = createControl(({ units: units2 = defaultUnits, placeholder, startIcon }) => {
|
|
356
|
-
const { value, setValue } = useBoundProp();
|
|
357
|
-
const [state, setState] = useSyncExternalState({
|
|
358
|
-
external: value,
|
|
359
|
-
setExternal: setValue,
|
|
360
|
-
persistWhen: (controlValue) => !!controlValue?.value.size || controlValue?.value.size === 0,
|
|
361
|
-
fallback: (controlValue) => ({
|
|
362
|
-
$$type: "size",
|
|
363
|
-
value: { unit: controlValue?.value.unit || "px", size: NaN }
|
|
364
|
-
})
|
|
365
|
-
});
|
|
366
|
-
const handleUnitChange = (unit) => {
|
|
367
|
-
setState((prev) => ({
|
|
368
|
-
...prev,
|
|
369
|
-
value: {
|
|
370
|
-
...prev.value,
|
|
371
|
-
unit
|
|
372
|
-
}
|
|
373
|
-
}));
|
|
374
|
-
};
|
|
375
|
-
const handleSizeChange = (event) => {
|
|
376
|
-
const { value: size } = event.target;
|
|
377
|
-
setState((prev) => ({
|
|
378
|
-
...prev,
|
|
379
|
-
value: {
|
|
380
|
-
...prev.value,
|
|
381
|
-
size: size || size === "0" ? parseFloat(size) : NaN
|
|
382
|
-
}
|
|
383
|
-
}));
|
|
384
|
-
};
|
|
385
|
-
return /* @__PURE__ */ React13.createElement(ControlActions, null, /* @__PURE__ */ React13.createElement(
|
|
386
|
-
TextFieldInnerSelection,
|
|
387
|
-
{
|
|
388
|
-
endAdornment: /* @__PURE__ */ React13.createElement(SelectionEndAdornment, { options: units2, onClick: handleUnitChange, value: state.value.unit }),
|
|
389
|
-
placeholder,
|
|
390
|
-
startAdornment: startIcon ?? /* @__PURE__ */ React13.createElement(import_ui10.InputAdornment, { position: "start" }, startIcon),
|
|
391
|
-
type: "number",
|
|
392
|
-
value: Number.isNaN(state.value.size) ? "" : state.value.size,
|
|
393
|
-
onChange: handleSizeChange
|
|
394
|
-
}
|
|
395
|
-
));
|
|
396
|
-
});
|
|
321
|
+
return context;
|
|
322
|
+
}
|
|
397
323
|
|
|
398
|
-
// src/
|
|
399
|
-
var
|
|
400
|
-
var
|
|
401
|
-
var
|
|
324
|
+
// src/components/css-class-selector-section.tsx
|
|
325
|
+
var React13 = __toESM(require("react"));
|
|
326
|
+
var import_editor_elements2 = require("@elementor/editor-elements");
|
|
327
|
+
var import_ui9 = require("@elementor/ui");
|
|
328
|
+
var import_i18n = require("@wordpress/i18n");
|
|
402
329
|
|
|
403
|
-
// src/
|
|
404
|
-
var
|
|
405
|
-
var
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
)
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
330
|
+
// src/components/multi-combobox/multi-combobox.tsx
|
|
331
|
+
var React12 = __toESM(require("react"));
|
|
332
|
+
var import_ui8 = require("@elementor/ui");
|
|
333
|
+
|
|
334
|
+
// src/components/multi-combobox/use-combobox-actions.ts
|
|
335
|
+
var import_ui7 = require("@elementor/ui");
|
|
336
|
+
var useComboboxActions = (applied, actions, optionsLabel, onApply) => ({
|
|
337
|
+
action: {
|
|
338
|
+
is: (opt) => !!opt.action,
|
|
339
|
+
getLabel: (option) => option.action.getLabel(option.label),
|
|
340
|
+
groupBy: (option) => option.action.groupLabel,
|
|
341
|
+
onChange: ({ action, label }) => action?.apply(label),
|
|
342
|
+
getFilteredActions: (optionList, params) => {
|
|
343
|
+
const actionGroups = Object.values(actions);
|
|
344
|
+
return actionGroups.reduce((groups, group) => {
|
|
345
|
+
const actionOptions = group.actions.reduce((groupActions, action) => {
|
|
346
|
+
const shouldShowAction = action.condition(optionList, params.inputValue);
|
|
347
|
+
if (shouldShowAction) {
|
|
348
|
+
const actionOption = createActionOption(group.label, action, params.inputValue);
|
|
349
|
+
groupActions.unshift(actionOption);
|
|
350
|
+
}
|
|
351
|
+
return groupActions;
|
|
352
|
+
}, []);
|
|
353
|
+
return [...groups, ...actionOptions];
|
|
354
|
+
}, []);
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
option: {
|
|
358
|
+
is: (opt) => !("action" in opt),
|
|
359
|
+
getLabel: (option) => option.label,
|
|
360
|
+
groupBy: () => optionsLabel ?? "",
|
|
361
|
+
onChange: (optionValues) => onApply?.(optionValues),
|
|
362
|
+
getFilteredOptions: (optionList, params) => {
|
|
363
|
+
const appliedValues = applied.map((option) => option.value);
|
|
364
|
+
const optionsWithoutApplied = optionList.filter((option) => !appliedValues.includes(option.value));
|
|
365
|
+
return filter(optionsWithoutApplied, params);
|
|
433
366
|
}
|
|
434
367
|
}
|
|
435
|
-
};
|
|
436
|
-
var units = ["px", "em", "rem"];
|
|
437
|
-
var StrokeControl = createControl(() => {
|
|
438
|
-
const { value, setValue } = useBoundProp(defaultStrokeControlValue);
|
|
439
|
-
const setStrokeWidth = (newValue) => {
|
|
440
|
-
const updatedValue = {
|
|
441
|
-
...value?.value ?? defaultStrokeControlValue.value,
|
|
442
|
-
width: newValue
|
|
443
|
-
};
|
|
444
|
-
setValue({
|
|
445
|
-
$$type: "stroke",
|
|
446
|
-
value: updatedValue
|
|
447
|
-
});
|
|
448
|
-
};
|
|
449
|
-
const setStrokeColor = (newValue) => {
|
|
450
|
-
const updatedValue = {
|
|
451
|
-
...value?.value ?? defaultStrokeControlValue.value,
|
|
452
|
-
color: newValue
|
|
453
|
-
};
|
|
454
|
-
setValue({
|
|
455
|
-
$$type: "stroke",
|
|
456
|
-
value: updatedValue
|
|
457
|
-
});
|
|
458
|
-
};
|
|
459
|
-
return /* @__PURE__ */ React15.createElement(import_ui12.Stack, { gap: 1.5 }, /* @__PURE__ */ React15.createElement(
|
|
460
|
-
Control,
|
|
461
|
-
{
|
|
462
|
-
bind: "width",
|
|
463
|
-
label: (0, import_i18n3.__)("Stroke Width", "elementor"),
|
|
464
|
-
value: value?.value.width ?? defaultStrokeControlValue.value.width,
|
|
465
|
-
setValue: setStrokeWidth
|
|
466
|
-
},
|
|
467
|
-
/* @__PURE__ */ React15.createElement(SizeControl, { units })
|
|
468
|
-
), /* @__PURE__ */ React15.createElement(
|
|
469
|
-
Control,
|
|
470
|
-
{
|
|
471
|
-
bind: "color",
|
|
472
|
-
label: (0, import_i18n3.__)("Stroke Color", "elementor"),
|
|
473
|
-
value: value?.value.color ?? defaultStrokeControlValue.value.color,
|
|
474
|
-
setValue: setStrokeColor
|
|
475
|
-
},
|
|
476
|
-
/* @__PURE__ */ React15.createElement(ColorControl, null)
|
|
477
|
-
));
|
|
478
368
|
});
|
|
479
|
-
var
|
|
480
|
-
|
|
481
|
-
value,
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
var import_i18n5 = require("@wordpress/i18n");
|
|
490
|
-
var import_ui14 = require("@elementor/ui");
|
|
369
|
+
var filter = (0, import_ui7.createFilterOptions)();
|
|
370
|
+
var createActionOption = (groupLabel, action, inputValue) => ({
|
|
371
|
+
value: "",
|
|
372
|
+
label: inputValue,
|
|
373
|
+
action: {
|
|
374
|
+
groupLabel,
|
|
375
|
+
apply: action.apply,
|
|
376
|
+
getLabel: action.getLabel
|
|
377
|
+
}
|
|
378
|
+
});
|
|
491
379
|
|
|
492
|
-
// src/
|
|
493
|
-
var
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
itemSettings,
|
|
502
|
-
values: repeaterValues = [],
|
|
503
|
-
setValues: setRepeaterValues
|
|
380
|
+
// src/components/multi-combobox/multi-combobox.tsx
|
|
381
|
+
var MultiCombobox = ({
|
|
382
|
+
actions = {},
|
|
383
|
+
selected,
|
|
384
|
+
options: options5,
|
|
385
|
+
optionsLabel,
|
|
386
|
+
onApply,
|
|
387
|
+
onCreate,
|
|
388
|
+
...props
|
|
504
389
|
}) => {
|
|
505
|
-
const
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
structuredClone(repeaterValues[index]),
|
|
513
|
-
...repeaterValues.slice(index)
|
|
514
|
-
]);
|
|
515
|
-
};
|
|
516
|
-
const removeRepeaterItem = (index) => {
|
|
517
|
-
setRepeaterValues(repeaterValues.filter((_, i) => i !== index));
|
|
390
|
+
const { action: actionProps, option: optionProps } = useComboboxActions(selected, actions, optionsLabel, onApply);
|
|
391
|
+
const handleSelectOption = (values) => {
|
|
392
|
+
const action = values.find((value) => actionProps.is(value));
|
|
393
|
+
if (action) {
|
|
394
|
+
return actionProps.onChange(action);
|
|
395
|
+
}
|
|
396
|
+
return optionProps.onChange(values);
|
|
518
397
|
};
|
|
519
|
-
const
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
if (i === index) {
|
|
523
|
-
const { disabled, ...rest } = value;
|
|
524
|
-
return { ...rest, ...disabled ? {} : { disabled: true } };
|
|
525
|
-
}
|
|
526
|
-
return value;
|
|
527
|
-
})
|
|
528
|
-
);
|
|
398
|
+
const handleCreateOption = (values) => {
|
|
399
|
+
const value = values.find((option) => typeof option === "string");
|
|
400
|
+
onCreate?.(value);
|
|
529
401
|
};
|
|
530
|
-
return /* @__PURE__ */
|
|
531
|
-
|
|
532
|
-
{
|
|
533
|
-
key: index,
|
|
534
|
-
disabled: value.disabled,
|
|
535
|
-
label: /* @__PURE__ */ React16.createElement(itemSettings.Label, { value }),
|
|
536
|
-
startIcon: /* @__PURE__ */ React16.createElement(itemSettings.Icon, { value }),
|
|
537
|
-
removeItem: () => removeRepeaterItem(index),
|
|
538
|
-
duplicateItem: () => duplicateRepeaterItem(index),
|
|
539
|
-
toggleDisableItem: () => toggleDisableRepeaterItem(index)
|
|
540
|
-
},
|
|
541
|
-
(props) => /* @__PURE__ */ React16.createElement(
|
|
542
|
-
itemSettings.Content,
|
|
543
|
-
{
|
|
544
|
-
...props,
|
|
545
|
-
value,
|
|
546
|
-
setValue: (newValue) => setRepeaterValues(
|
|
547
|
-
repeaterValues.map((item, i) => i === index ? newValue : item)
|
|
548
|
-
)
|
|
549
|
-
}
|
|
550
|
-
)
|
|
551
|
-
))));
|
|
552
|
-
};
|
|
553
|
-
var RepeaterItem = ({
|
|
554
|
-
label,
|
|
555
|
-
disabled,
|
|
556
|
-
startIcon,
|
|
557
|
-
children,
|
|
558
|
-
removeItem,
|
|
559
|
-
duplicateItem,
|
|
560
|
-
toggleDisableItem
|
|
561
|
-
}) => {
|
|
562
|
-
const popupId = (0, import_react6.useId)();
|
|
563
|
-
const tagRef = (0, import_react6.useRef)(null);
|
|
564
|
-
const [anchorEl, setAnchorEl] = (0, import_react6.useState)(null);
|
|
565
|
-
const popoverState = (0, import_ui13.usePopupState)({ popupId, variant: "popover" });
|
|
566
|
-
const popoverProps = (0, import_ui13.bindPopover)(popoverState);
|
|
567
|
-
return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(
|
|
568
|
-
import_ui13.UnstableTag,
|
|
402
|
+
return /* @__PURE__ */ React12.createElement(
|
|
403
|
+
import_ui8.Autocomplete,
|
|
569
404
|
{
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
"aria-label": disabled ? (0, import_i18n4.__)("Enable item", "elementor") : (0, import_i18n4.__)("Disable item", "elementor")
|
|
591
|
-
},
|
|
592
|
-
disabled ? /* @__PURE__ */ React16.createElement(import_icons2.EyeOffIcon, { fontSize: SIZE }) : /* @__PURE__ */ React16.createElement(import_icons2.EyeIcon, { fontSize: SIZE })
|
|
593
|
-
), /* @__PURE__ */ React16.createElement(
|
|
594
|
-
import_ui13.IconButton,
|
|
595
|
-
{
|
|
596
|
-
size: SIZE,
|
|
597
|
-
onClick: removeItem,
|
|
598
|
-
"aria-label": (0, import_i18n4.__)("Remove item", "elementor")
|
|
599
|
-
},
|
|
600
|
-
/* @__PURE__ */ React16.createElement(import_icons2.XIcon, { fontSize: SIZE })
|
|
601
|
-
))
|
|
602
|
-
}
|
|
603
|
-
), /* @__PURE__ */ React16.createElement(
|
|
604
|
-
import_ui13.Popover,
|
|
605
|
-
{
|
|
606
|
-
disablePortal: true,
|
|
607
|
-
slotProps: {
|
|
608
|
-
paper: { ref: setAnchorEl, sx: { width: tagRef.current?.getBoundingClientRect().width } }
|
|
405
|
+
...props,
|
|
406
|
+
freeSolo: true,
|
|
407
|
+
multiple: true,
|
|
408
|
+
clearOnBlur: true,
|
|
409
|
+
selectOnFocus: true,
|
|
410
|
+
disableClearable: true,
|
|
411
|
+
handleHomeEndKeys: true,
|
|
412
|
+
value: selected,
|
|
413
|
+
options: options5,
|
|
414
|
+
renderGroup,
|
|
415
|
+
renderInput: (params) => /* @__PURE__ */ React12.createElement(import_ui8.TextField, { ...params }),
|
|
416
|
+
getLimitTagsText: (more) => /* @__PURE__ */ React12.createElement(import_ui8.Chip, { size: "tiny", variant: "standard", label: `+${more}`, clickable: true }),
|
|
417
|
+
onChange: (_, values, reason) => {
|
|
418
|
+
if (reason === "selectOption") {
|
|
419
|
+
return handleSelectOption(values);
|
|
420
|
+
}
|
|
421
|
+
if (reason === "createOption") {
|
|
422
|
+
return handleCreateOption(values);
|
|
423
|
+
}
|
|
424
|
+
onApply?.(values);
|
|
609
425
|
},
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
setValue({
|
|
623
|
-
$$type: "box-shadow",
|
|
624
|
-
value: newValue
|
|
625
|
-
});
|
|
626
|
-
};
|
|
627
|
-
return /* @__PURE__ */ React17.createElement(
|
|
628
|
-
Repeater,
|
|
629
|
-
{
|
|
630
|
-
values: boxShadowValues,
|
|
631
|
-
setValues: setBoxShadow,
|
|
632
|
-
label: (0, import_i18n5.__)("Box shadow", "elementor"),
|
|
633
|
-
itemSettings: {
|
|
634
|
-
Icon: ItemIcon,
|
|
635
|
-
Label: ItemLabel,
|
|
636
|
-
Content: ItemContent,
|
|
637
|
-
initialValues: initialShadow
|
|
638
|
-
}
|
|
426
|
+
getOptionLabel: (option) => {
|
|
427
|
+
if (optionProps.is(option)) {
|
|
428
|
+
return optionProps.getLabel(option);
|
|
429
|
+
}
|
|
430
|
+
return actionProps.getLabel(option) ?? "";
|
|
431
|
+
},
|
|
432
|
+
filterOptions: (optionList, params) => {
|
|
433
|
+
const filteredoptions = optionProps.getFilteredOptions(optionList, params);
|
|
434
|
+
const actionOptions = actionProps.getFilteredActions(optionList, params);
|
|
435
|
+
return [...actionOptions, ...filteredoptions];
|
|
436
|
+
},
|
|
437
|
+
groupBy: (option) => (optionProps.is(option) ? optionProps.groupBy() : actionProps.groupBy(option)) ?? ""
|
|
639
438
|
}
|
|
640
439
|
);
|
|
641
|
-
});
|
|
642
|
-
var ItemIcon = ({ value }) => /* @__PURE__ */ React17.createElement(import_ui14.UnstableColorIndicator, { size: "inherit", component: "span", value: value.value.color.value });
|
|
643
|
-
var ItemContent = ({
|
|
644
|
-
value,
|
|
645
|
-
setValue
|
|
646
|
-
}) => {
|
|
647
|
-
const setShadow = (newValue) => {
|
|
648
|
-
setValue({
|
|
649
|
-
$$type: "shadow",
|
|
650
|
-
value: newValue
|
|
651
|
-
});
|
|
652
|
-
};
|
|
653
|
-
return /* @__PURE__ */ React17.createElement(import_ui14.Stack, { gap: 1.5 }, /* @__PURE__ */ React17.createElement(import_ui14.Grid, { container: true, spacing: 1 }, /* @__PURE__ */ React17.createElement(
|
|
654
|
-
Control2,
|
|
655
|
-
{
|
|
656
|
-
bind: "color",
|
|
657
|
-
value: value.value.color,
|
|
658
|
-
label: (0, import_i18n5.__)("Color", "elementor"),
|
|
659
|
-
setValue: (v) => setShadow({ ...value.value, color: v })
|
|
660
|
-
},
|
|
661
|
-
/* @__PURE__ */ React17.createElement(ColorControl, null)
|
|
662
|
-
), /* @__PURE__ */ React17.createElement(
|
|
663
|
-
Control2,
|
|
664
|
-
{
|
|
665
|
-
bind: "position",
|
|
666
|
-
value: value.value.position,
|
|
667
|
-
label: (0, import_i18n5.__)("Position", "elementor"),
|
|
668
|
-
setValue: (v) => setShadow({ ...value.value, position: v || null })
|
|
669
|
-
},
|
|
670
|
-
/* @__PURE__ */ React17.createElement(
|
|
671
|
-
SelectControl,
|
|
672
|
-
{
|
|
673
|
-
options: [
|
|
674
|
-
{ label: (0, import_i18n5.__)("Inset", "elementor"), value: "inset" },
|
|
675
|
-
{ label: (0, import_i18n5.__)("Outset", "elementor"), value: "" }
|
|
676
|
-
]
|
|
677
|
-
}
|
|
678
|
-
)
|
|
679
|
-
)), /* @__PURE__ */ React17.createElement(import_ui14.Grid, { container: true, spacing: 1 }, /* @__PURE__ */ React17.createElement(
|
|
680
|
-
Control2,
|
|
681
|
-
{
|
|
682
|
-
bind: "hOffset",
|
|
683
|
-
label: (0, import_i18n5.__)("Horizontal", "elementor"),
|
|
684
|
-
value: value.value.hOffset,
|
|
685
|
-
setValue: (v) => setShadow({ ...value.value, hOffset: v })
|
|
686
|
-
},
|
|
687
|
-
/* @__PURE__ */ React17.createElement(SizeControl, null)
|
|
688
|
-
), /* @__PURE__ */ React17.createElement(
|
|
689
|
-
Control2,
|
|
690
|
-
{
|
|
691
|
-
bind: "vOffset",
|
|
692
|
-
label: (0, import_i18n5.__)("Vertical", "elementor"),
|
|
693
|
-
value: value.value.vOffset,
|
|
694
|
-
setValue: (v) => setShadow({ ...value.value, vOffset: v })
|
|
695
|
-
},
|
|
696
|
-
/* @__PURE__ */ React17.createElement(SizeControl, null)
|
|
697
|
-
)), /* @__PURE__ */ React17.createElement(import_ui14.Grid, { container: true, spacing: 1 }, /* @__PURE__ */ React17.createElement(
|
|
698
|
-
Control2,
|
|
699
|
-
{
|
|
700
|
-
bind: "blur",
|
|
701
|
-
value: value.value.blur,
|
|
702
|
-
label: (0, import_i18n5.__)("Blur", "elementor"),
|
|
703
|
-
setValue: (v) => setShadow({ ...value.value, blur: v })
|
|
704
|
-
},
|
|
705
|
-
/* @__PURE__ */ React17.createElement(SizeControl, null)
|
|
706
|
-
), /* @__PURE__ */ React17.createElement(
|
|
707
|
-
Control2,
|
|
708
|
-
{
|
|
709
|
-
bind: "spread",
|
|
710
|
-
label: (0, import_i18n5.__)("Spread", "elementor"),
|
|
711
|
-
value: value.value.spread,
|
|
712
|
-
setValue: (v) => setShadow({ ...value.value, spread: v })
|
|
713
|
-
},
|
|
714
|
-
/* @__PURE__ */ React17.createElement(SizeControl, null)
|
|
715
|
-
)));
|
|
716
|
-
};
|
|
717
|
-
var Control2 = ({
|
|
718
|
-
value,
|
|
719
|
-
setValue,
|
|
720
|
-
label,
|
|
721
|
-
bind,
|
|
722
|
-
children
|
|
723
|
-
}) => /* @__PURE__ */ React17.createElement(BoundPropProvider, { value, setValue, bind }, /* @__PURE__ */ React17.createElement(import_ui14.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React17.createElement(import_ui14.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React17.createElement(import_ui14.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React17.createElement(import_ui14.Typography, { component: "label", variant: "caption", color: "text.secondary" }, label)), /* @__PURE__ */ React17.createElement(import_ui14.Grid, { item: true, xs: 12 }, children))));
|
|
724
|
-
var ItemLabel = ({ value }) => {
|
|
725
|
-
const { position, hOffset, vOffset, blur, spread } = value.value;
|
|
726
|
-
const { size: blurSize = "", unit: blurUnit = "" } = blur?.value || {};
|
|
727
|
-
const { size: spreadSize = "", unit: spreadUnit = "" } = spread?.value || {};
|
|
728
|
-
const { size: hOffsetSize = "unset", unit: hOffsetUnit = "" } = hOffset?.value || {};
|
|
729
|
-
const { size: vOffsetSize = "unset", unit: vOffsetUnit = "" } = vOffset?.value || {};
|
|
730
|
-
const sizes = [
|
|
731
|
-
hOffsetSize + hOffsetUnit,
|
|
732
|
-
vOffsetSize + vOffsetUnit,
|
|
733
|
-
blurSize + blurUnit,
|
|
734
|
-
spreadSize + spreadUnit
|
|
735
|
-
].join(" ");
|
|
736
|
-
return /* @__PURE__ */ React17.createElement("span", { style: { textTransform: "capitalize" } }, position ?? "outset", ": ", sizes);
|
|
737
|
-
};
|
|
738
|
-
var initialShadow = {
|
|
739
|
-
$$type: "shadow",
|
|
740
|
-
value: {
|
|
741
|
-
hOffset: {
|
|
742
|
-
$$type: "size",
|
|
743
|
-
value: { unit: "px", size: 0 }
|
|
744
|
-
},
|
|
745
|
-
vOffset: {
|
|
746
|
-
$$type: "size",
|
|
747
|
-
value: { unit: "px", size: 0 }
|
|
748
|
-
},
|
|
749
|
-
blur: {
|
|
750
|
-
$$type: "size",
|
|
751
|
-
value: { unit: "px", size: 10 }
|
|
752
|
-
},
|
|
753
|
-
spread: {
|
|
754
|
-
$$type: "size",
|
|
755
|
-
value: { unit: "px", size: 0 }
|
|
756
|
-
},
|
|
757
|
-
color: {
|
|
758
|
-
$$type: "color",
|
|
759
|
-
value: "rgba(0, 0, 0, 1)"
|
|
760
|
-
},
|
|
761
|
-
position: null
|
|
762
|
-
}
|
|
763
440
|
};
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
var
|
|
771
|
-
|
|
772
|
-
|
|
441
|
+
var renderGroup = (params) => /* @__PURE__ */ React12.createElement(Group, { key: params.key }, /* @__PURE__ */ React12.createElement(GroupHeader, null, params.group), /* @__PURE__ */ React12.createElement(GroupItems, null, params.children));
|
|
442
|
+
var Group = (0, import_ui8.styled)("li")`
|
|
443
|
+
&:not( :last-of-type ) {
|
|
444
|
+
border-bottom: 1px solid ${({ theme }) => theme.palette.divider};
|
|
445
|
+
}
|
|
446
|
+
`;
|
|
447
|
+
var GroupHeader = (0, import_ui8.styled)(import_ui8.Box)(({ theme }) => ({
|
|
448
|
+
position: "sticky",
|
|
449
|
+
top: "-8px",
|
|
450
|
+
padding: theme.spacing(1, 2),
|
|
451
|
+
color: theme.palette.text.tertiary
|
|
452
|
+
}));
|
|
453
|
+
var GroupItems = (0, import_ui8.styled)("ul")`
|
|
454
|
+
padding: 0;
|
|
773
455
|
`;
|
|
774
|
-
var ControlToggleButtonGroup = ({
|
|
775
|
-
justify = "end",
|
|
776
|
-
size = "tiny",
|
|
777
|
-
value,
|
|
778
|
-
onChange,
|
|
779
|
-
items,
|
|
780
|
-
exclusive = false
|
|
781
|
-
}) => {
|
|
782
|
-
const handleChange = (_, newValue) => {
|
|
783
|
-
onChange(newValue);
|
|
784
|
-
};
|
|
785
|
-
return /* @__PURE__ */ React18.createElement(StyledToggleButtonGroup, { justify, value, onChange: handleChange, exclusive }, items.map(
|
|
786
|
-
({ label, value: buttonValue, icon: Icon, showTooltip }) => showTooltip ? /* @__PURE__ */ React18.createElement(import_ui15.Tooltip, { title: label, disableFocusListener: true, placement: "top", key: buttonValue }, /* @__PURE__ */ React18.createElement(import_ui15.ToggleButton, { value: buttonValue, "aria-label": label, size }, /* @__PURE__ */ React18.createElement(Icon, { fontSize: size }))) : /* @__PURE__ */ React18.createElement(import_ui15.ToggleButton, { key: buttonValue, value: buttonValue, "aria-label": label, size }, /* @__PURE__ */ React18.createElement(Icon, { fontSize: size }))
|
|
787
|
-
));
|
|
788
|
-
};
|
|
789
|
-
|
|
790
|
-
// src/controls/controls/toggle-control.tsx
|
|
791
|
-
var ToggleControl = createControl(({ options: options5 }) => {
|
|
792
|
-
const { value, setValue } = useBoundProp();
|
|
793
|
-
const handleToggle = (option) => {
|
|
794
|
-
setValue(option);
|
|
795
|
-
};
|
|
796
|
-
return /* @__PURE__ */ React19.createElement(
|
|
797
|
-
ControlToggleButtonGroup,
|
|
798
|
-
{
|
|
799
|
-
items: options5,
|
|
800
|
-
value: value || null,
|
|
801
|
-
onChange: handleToggle,
|
|
802
|
-
exclusive: true
|
|
803
|
-
}
|
|
804
|
-
);
|
|
805
|
-
});
|
|
806
456
|
|
|
807
|
-
// src/
|
|
808
|
-
var
|
|
809
|
-
var
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
const {
|
|
813
|
-
const
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
import_ui16.TextField,
|
|
457
|
+
// src/components/css-class-selector-section.tsx
|
|
458
|
+
var ID = "elementor-css-class-selector";
|
|
459
|
+
var TAGS_LIMIT = 8;
|
|
460
|
+
function CssClassSelectorSection() {
|
|
461
|
+
const options5 = useOptions();
|
|
462
|
+
const { id: activeId, setId: setActiveId } = useStyle();
|
|
463
|
+
const appliedIds = useAppliedClassesIds();
|
|
464
|
+
const applied = options5.filter((option) => appliedIds.includes(option.value));
|
|
465
|
+
const active = options5.find((option) => option.value === activeId) || null;
|
|
466
|
+
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
|
+
MultiCombobox,
|
|
819
468
|
{
|
|
469
|
+
id: ID,
|
|
820
470
|
size: "tiny",
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
471
|
+
options: options5,
|
|
472
|
+
selected: applied,
|
|
473
|
+
limitTags: TAGS_LIMIT,
|
|
474
|
+
optionsLabel: (0, import_i18n.__)("Global CSS Classes", "elementor"),
|
|
475
|
+
renderTags: (tagValue, getTagProps) => tagValue.map((option, index) => {
|
|
476
|
+
const chipProps = getTagProps({ index });
|
|
477
|
+
return /* @__PURE__ */ React13.createElement(
|
|
478
|
+
import_ui9.Chip,
|
|
479
|
+
{
|
|
480
|
+
...chipProps,
|
|
481
|
+
key: chipProps.key,
|
|
482
|
+
size: "small",
|
|
483
|
+
label: option.label,
|
|
484
|
+
variant: option.value === active?.value ? "filled" : "standard",
|
|
485
|
+
color: option.color ?? "default",
|
|
486
|
+
onClick: () => setActiveId(option.value),
|
|
487
|
+
onDelete: null
|
|
488
|
+
}
|
|
489
|
+
);
|
|
490
|
+
})
|
|
825
491
|
}
|
|
826
492
|
));
|
|
827
|
-
});
|
|
828
|
-
|
|
829
|
-
// src/controls/control-actions/control-actions-menu.ts
|
|
830
|
-
var import_menus = require("@elementor/menus");
|
|
831
|
-
var createControlActionsMenu = ({ components }) => {
|
|
832
|
-
return (0, import_menus.createMenu)({
|
|
833
|
-
components
|
|
834
|
-
});
|
|
835
|
-
};
|
|
836
|
-
|
|
837
|
-
// src/control-replacement.tsx
|
|
838
|
-
var { replaceControl, getControlReplacement } = createControlReplacement();
|
|
839
|
-
|
|
840
|
-
// src/panel.ts
|
|
841
|
-
var import_editor_panels2 = require("@elementor/editor-panels");
|
|
842
|
-
|
|
843
|
-
// src/components/editing-panel.tsx
|
|
844
|
-
var React66 = __toESM(require("react"));
|
|
845
|
-
var import_i18n38 = require("@wordpress/i18n");
|
|
846
|
-
var import_editor_elements4 = require("@elementor/editor-elements");
|
|
847
|
-
var import_editor_panels = require("@elementor/editor-panels");
|
|
848
|
-
|
|
849
|
-
// src/components/editing-panel-tabs.tsx
|
|
850
|
-
var import_ui49 = require("@elementor/ui");
|
|
851
|
-
var React63 = __toESM(require("react"));
|
|
852
|
-
var import_i18n37 = require("@wordpress/i18n");
|
|
853
|
-
|
|
854
|
-
// src/components/settings-tab.tsx
|
|
855
|
-
var React26 = __toESM(require("react"));
|
|
856
|
-
var import_ui19 = require("@elementor/ui");
|
|
857
|
-
|
|
858
|
-
// src/controls-registry/settings-field.tsx
|
|
859
|
-
var React22 = __toESM(require("react"));
|
|
860
|
-
var import_editor_elements = require("@elementor/editor-elements");
|
|
861
|
-
|
|
862
|
-
// src/contexts/element-context.tsx
|
|
863
|
-
var React21 = __toESM(require("react"));
|
|
864
|
-
var import_react7 = require("react");
|
|
865
|
-
var Context2 = (0, import_react7.createContext)(null);
|
|
866
|
-
function ElementProvider({ children, element, elementType }) {
|
|
867
|
-
return /* @__PURE__ */ React21.createElement(Context2.Provider, { value: { element, elementType } }, children);
|
|
868
493
|
}
|
|
869
|
-
function
|
|
870
|
-
const
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
494
|
+
function useAppliedClassesIds() {
|
|
495
|
+
const { element } = useElement();
|
|
496
|
+
const currentClassesProp = useClassesProp();
|
|
497
|
+
return (0, import_editor_elements2.useElementSetting)(element.id, currentClassesProp)?.value || [];
|
|
498
|
+
}
|
|
499
|
+
function useOptions() {
|
|
500
|
+
const { element } = useElement();
|
|
501
|
+
const styleDefs = (0, import_editor_elements2.useElementStyles)(element.id);
|
|
502
|
+
return Object.values(styleDefs).map((styleDef) => ({
|
|
503
|
+
label: styleDef.label,
|
|
504
|
+
value: styleDef.id,
|
|
505
|
+
color: "primary"
|
|
506
|
+
}));
|
|
875
507
|
}
|
|
876
508
|
|
|
877
|
-
// src/
|
|
878
|
-
var
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
509
|
+
// src/components/style-sections/background-section/background-section.tsx
|
|
510
|
+
var React16 = __toESM(require("react"));
|
|
511
|
+
var import_editor_controls7 = require("@elementor/editor-controls");
|
|
512
|
+
var import_ui11 = require("@elementor/ui");
|
|
513
|
+
|
|
514
|
+
// src/controls-registry/styles-field.tsx
|
|
515
|
+
var React14 = __toESM(require("react"));
|
|
516
|
+
var import_editor_controls5 = require("@elementor/editor-controls");
|
|
517
|
+
|
|
518
|
+
// src/hooks/use-styles-field.ts
|
|
519
|
+
var import_react6 = require("react");
|
|
520
|
+
var import_editor_elements3 = require("@elementor/editor-elements");
|
|
521
|
+
var useStylesField = (propName) => {
|
|
522
|
+
const { element } = useElement();
|
|
523
|
+
const { id, meta } = useStyle();
|
|
524
|
+
const classesProp = useClassesProp();
|
|
525
|
+
const previousValue = (0, import_react6.useRef)(null);
|
|
526
|
+
const onChangeCallbacks = (0, import_react6.useRef)(/* @__PURE__ */ new Set());
|
|
527
|
+
const value = (0, import_editor_elements3.useElementStyleProp)({
|
|
528
|
+
elementID: element.id,
|
|
529
|
+
styleDefID: id,
|
|
530
|
+
meta,
|
|
531
|
+
propName
|
|
532
|
+
});
|
|
883
533
|
const setValue = (newValue) => {
|
|
884
|
-
(0,
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
534
|
+
(0, import_editor_elements3.updateStyle)({
|
|
535
|
+
elementID: element.id,
|
|
536
|
+
styleDefID: id,
|
|
537
|
+
props: { [propName]: newValue },
|
|
538
|
+
meta,
|
|
539
|
+
bind: classesProp
|
|
889
540
|
});
|
|
890
541
|
};
|
|
891
|
-
|
|
542
|
+
const registerChangeListener = (callback) => {
|
|
543
|
+
onChangeCallbacks.current.add(callback);
|
|
544
|
+
};
|
|
545
|
+
(0, import_react6.useEffect)(() => {
|
|
546
|
+
onChangeCallbacks.current.forEach((cb) => {
|
|
547
|
+
cb(value, previousValue.current);
|
|
548
|
+
});
|
|
549
|
+
previousValue.current = value;
|
|
550
|
+
}, [value]);
|
|
551
|
+
return [value, setValue, registerChangeListener];
|
|
892
552
|
};
|
|
893
553
|
|
|
894
|
-
// src/
|
|
895
|
-
var
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
var AccordionSection = ({ title, children, defaultExpanded = false }) => {
|
|
899
|
-
const uid = (0, import_react8.useId)();
|
|
900
|
-
const labelId = `label-${uid}`;
|
|
901
|
-
const contentId = `content-${uid}`;
|
|
902
|
-
return /* @__PURE__ */ React23.createElement(import_ui17.Accordion, { disableGutters: true, defaultExpanded }, /* @__PURE__ */ React23.createElement(import_ui17.AccordionSummary, { "aria-controls": contentId, id: labelId }, /* @__PURE__ */ React23.createElement(import_ui17.AccordionSummaryText, { primaryTypographyProps: { variant: "caption" } }, title)), /* @__PURE__ */ React23.createElement(import_ui17.AccordionDetails, { id: contentId, "aria-labelledby": labelId }, /* @__PURE__ */ React23.createElement(import_ui17.Stack, { gap: 2.5 }, children)));
|
|
554
|
+
// src/controls-registry/styles-field.tsx
|
|
555
|
+
var StylesField = ({ bind, children }) => {
|
|
556
|
+
const [value, setValue] = useStylesField(bind);
|
|
557
|
+
return /* @__PURE__ */ React14.createElement(import_editor_controls5.BoundPropProvider, { setValue, value, bind }, children);
|
|
903
558
|
};
|
|
904
559
|
|
|
905
|
-
// src/
|
|
906
|
-
var
|
|
907
|
-
var
|
|
560
|
+
// src/components/style-sections/background-section/background-color-field.tsx
|
|
561
|
+
var React15 = __toESM(require("react"));
|
|
562
|
+
var import_editor_controls6 = require("@elementor/editor-controls");
|
|
563
|
+
var import_ui10 = require("@elementor/ui");
|
|
564
|
+
var import_i18n2 = require("@wordpress/i18n");
|
|
565
|
+
var BackgroundColorField = () => {
|
|
566
|
+
return /* @__PURE__ */ React15.createElement(StylesField, { bind: "background-color" }, /* @__PURE__ */ React15.createElement(import_ui10.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React15.createElement(import_ui10.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React15.createElement(import_editor_controls6.ControlLabel, null, (0, import_i18n2.__)("Color", "elementor"))), /* @__PURE__ */ React15.createElement(import_ui10.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React15.createElement(import_editor_controls6.ColorControl, null))));
|
|
567
|
+
};
|
|
908
568
|
|
|
909
|
-
// src/
|
|
910
|
-
var
|
|
911
|
-
|
|
912
|
-
text: { component: TextControl, layout: "two-columns" },
|
|
913
|
-
textarea: { component: TextAreaControl, layout: "full" },
|
|
914
|
-
size: { component: SizeControl, layout: "two-columns" },
|
|
915
|
-
select: { component: SelectControl, layout: "two-columns" }
|
|
569
|
+
// src/components/style-sections/background-section/background-section.tsx
|
|
570
|
+
var BackgroundSection = () => {
|
|
571
|
+
return /* @__PURE__ */ React16.createElement(import_ui11.Stack, { gap: 1.5 }, /* @__PURE__ */ React16.createElement(StylesField, { bind: "background-image" }, /* @__PURE__ */ React16.createElement(import_editor_controls7.BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React16.createElement(BackgroundColorField, null));
|
|
916
572
|
};
|
|
917
|
-
var getControlByType = (type) => controlTypes[type]?.component;
|
|
918
|
-
var getLayoutByType = (type) => controlTypes[type].layout;
|
|
919
573
|
|
|
920
|
-
// src/
|
|
921
|
-
var
|
|
922
|
-
|
|
923
|
-
message: `Control type not found.`
|
|
924
|
-
});
|
|
925
|
-
var Control3 = ({ props, type }) => {
|
|
926
|
-
const ControlByType = getControlByType(type);
|
|
927
|
-
if (!ControlByType) {
|
|
928
|
-
throw new ControlTypeError({
|
|
929
|
-
context: { type }
|
|
930
|
-
});
|
|
931
|
-
}
|
|
932
|
-
return /* @__PURE__ */ React24.createElement(ControlByType, { ...props });
|
|
933
|
-
};
|
|
934
|
-
|
|
935
|
-
// src/controls-registry/control-type-container.tsx
|
|
936
|
-
var React25 = __toESM(require("react"));
|
|
937
|
-
var import_ui18 = require("@elementor/ui");
|
|
938
|
-
var ControlTypeContainer = ({
|
|
939
|
-
controlType,
|
|
940
|
-
children
|
|
941
|
-
}) => {
|
|
942
|
-
const layout = getLayoutByType(controlType);
|
|
943
|
-
return /* @__PURE__ */ React25.createElement(StyledContainer, { layout }, children);
|
|
944
|
-
};
|
|
945
|
-
var StyledContainer = (0, import_ui18.styled)(import_ui18.Box, {
|
|
946
|
-
shouldForwardProp: (prop) => !["layout"].includes(prop)
|
|
947
|
-
})(({ layout, theme }) => ({
|
|
948
|
-
display: "grid",
|
|
949
|
-
gridGap: theme.spacing(1),
|
|
950
|
-
...getGridLayout(layout)
|
|
951
|
-
}));
|
|
952
|
-
var getGridLayout = (layout) => ({
|
|
953
|
-
justifyContent: "space-between",
|
|
954
|
-
gridTemplateColumns: {
|
|
955
|
-
full: "1fr",
|
|
956
|
-
"two-columns": "repeat(2, 1fr)"
|
|
957
|
-
}[layout]
|
|
958
|
-
});
|
|
959
|
-
|
|
960
|
-
// src/components/settings-tab.tsx
|
|
961
|
-
var SettingsTab = () => {
|
|
962
|
-
const { elementType } = useElement();
|
|
963
|
-
return /* @__PURE__ */ React26.createElement(import_ui19.Stack, null, elementType.controls.map(({ type, value }, index) => {
|
|
964
|
-
if (type === "control") {
|
|
965
|
-
return /* @__PURE__ */ React26.createElement(Control4, { key: value.bind, control: value });
|
|
966
|
-
}
|
|
967
|
-
if (type === "section") {
|
|
968
|
-
return /* @__PURE__ */ React26.createElement(AccordionSection, { key: type + "." + index, title: value.label, defaultExpanded: true }, value.items?.map((item) => {
|
|
969
|
-
if (item.type === "control") {
|
|
970
|
-
return /* @__PURE__ */ React26.createElement(Control4, { key: item.value.bind, control: item.value });
|
|
971
|
-
}
|
|
972
|
-
return null;
|
|
973
|
-
}));
|
|
974
|
-
}
|
|
975
|
-
return null;
|
|
976
|
-
}));
|
|
977
|
-
};
|
|
978
|
-
var Control4 = ({ control }) => {
|
|
979
|
-
if (!getControlByType(control.type)) {
|
|
980
|
-
return null;
|
|
981
|
-
}
|
|
982
|
-
return /* @__PURE__ */ React26.createElement(SettingsField, { bind: control.bind }, /* @__PURE__ */ React26.createElement(ControlTypeContainer, { controlType: control.type }, control.label ? /* @__PURE__ */ React26.createElement(ControlLabel, null, control.label) : null, /* @__PURE__ */ React26.createElement(Control3, { type: control.type, props: control.props })));
|
|
983
|
-
};
|
|
984
|
-
|
|
985
|
-
// src/components/style-tab.tsx
|
|
986
|
-
var React62 = __toESM(require("react"));
|
|
987
|
-
var import_react14 = require("react");
|
|
988
|
-
var import_ui48 = require("@elementor/ui");
|
|
989
|
-
var import_editor_styles = require("@elementor/editor-styles");
|
|
990
|
-
var import_editor_responsive = require("@elementor/editor-responsive");
|
|
991
|
-
var import_editor_elements3 = require("@elementor/editor-elements");
|
|
992
|
-
|
|
993
|
-
// src/contexts/style-context.tsx
|
|
994
|
-
var React27 = __toESM(require("react"));
|
|
995
|
-
var import_react9 = require("react");
|
|
996
|
-
var Context3 = (0, import_react9.createContext)(null);
|
|
997
|
-
function StyleProvider({ children, id, meta }) {
|
|
998
|
-
return /* @__PURE__ */ React27.createElement(Context3.Provider, { value: { id, meta } }, children);
|
|
999
|
-
}
|
|
1000
|
-
function useStyle() {
|
|
1001
|
-
const context = (0, import_react9.useContext)(Context3);
|
|
1002
|
-
if (!context) {
|
|
1003
|
-
throw new Error("UseStyleContext must be used within a StyleContextProvider");
|
|
1004
|
-
}
|
|
1005
|
-
return context;
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
// src/components/style-sections/size-section/size-section.tsx
|
|
1009
|
-
var React31 = __toESM(require("react"));
|
|
1010
|
-
var import_ui21 = require("@elementor/ui");
|
|
1011
|
-
var import_i18n7 = require("@wordpress/i18n");
|
|
574
|
+
// src/components/style-sections/border-section/border-section.tsx
|
|
575
|
+
var React23 = __toESM(require("react"));
|
|
576
|
+
var import_ui15 = require("@elementor/ui");
|
|
1012
577
|
|
|
1013
|
-
// src/components/style-sections/
|
|
1014
|
-
var
|
|
578
|
+
// src/components/style-sections/border-section/border-field.tsx
|
|
579
|
+
var React21 = __toESM(require("react"));
|
|
1015
580
|
var import_i18n6 = require("@wordpress/i18n");
|
|
1016
|
-
|
|
581
|
+
|
|
582
|
+
// src/components/add-or-remove-content.tsx
|
|
583
|
+
var React17 = __toESM(require("react"));
|
|
584
|
+
var import_editor_controls8 = require("@elementor/editor-controls");
|
|
1017
585
|
var import_icons3 = require("@elementor/icons");
|
|
586
|
+
var import_ui12 = require("@elementor/ui");
|
|
587
|
+
var SIZE2 = "tiny";
|
|
588
|
+
var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
|
|
589
|
+
return /* @__PURE__ */ React17.createElement(import_ui12.Stack, { gap: 1.5 }, /* @__PURE__ */ React17.createElement(
|
|
590
|
+
import_ui12.Stack,
|
|
591
|
+
{
|
|
592
|
+
direction: "row",
|
|
593
|
+
sx: {
|
|
594
|
+
justifyContent: "space-between",
|
|
595
|
+
alignItems: "center"
|
|
596
|
+
}
|
|
597
|
+
},
|
|
598
|
+
/* @__PURE__ */ React17.createElement(import_editor_controls8.ControlLabel, null, label),
|
|
599
|
+
isAdded ? /* @__PURE__ */ React17.createElement(import_ui12.IconButton, { size: SIZE2, onClick: onRemove }, /* @__PURE__ */ React17.createElement(import_icons3.MinusIcon, { fontSize: SIZE2 })) : /* @__PURE__ */ React17.createElement(import_ui12.IconButton, { size: SIZE2, onClick: onAdd }, /* @__PURE__ */ React17.createElement(import_icons3.PlusIcon, { fontSize: SIZE2 }))
|
|
600
|
+
), /* @__PURE__ */ React17.createElement(import_ui12.Collapse, { in: isAdded, unmountOnExit: true }, /* @__PURE__ */ React17.createElement(import_ui12.Stack, { gap: 1.5 }, children)));
|
|
601
|
+
};
|
|
1018
602
|
|
|
1019
|
-
// src/
|
|
1020
|
-
var
|
|
603
|
+
// src/components/style-sections/border-section/border-color-field.tsx
|
|
604
|
+
var React18 = __toESM(require("react"));
|
|
605
|
+
var import_editor_controls9 = require("@elementor/editor-controls");
|
|
606
|
+
var import_ui13 = require("@elementor/ui");
|
|
607
|
+
var import_i18n3 = require("@wordpress/i18n");
|
|
608
|
+
var BorderColorField = () => {
|
|
609
|
+
return /* @__PURE__ */ React18.createElement(StylesField, { bind: "border-color" }, /* @__PURE__ */ React18.createElement(import_ui13.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React18.createElement(import_ui13.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React18.createElement(import_editor_controls9.ControlLabel, null, (0, import_i18n3.__)("Border Color", "elementor"))), /* @__PURE__ */ React18.createElement(import_ui13.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React18.createElement(import_editor_controls9.ColorControl, null))));
|
|
610
|
+
};
|
|
1021
611
|
|
|
1022
|
-
// src/
|
|
1023
|
-
var
|
|
612
|
+
// src/components/style-sections/border-section/border-style-field.tsx
|
|
613
|
+
var React19 = __toESM(require("react"));
|
|
614
|
+
var import_editor_controls10 = require("@elementor/editor-controls");
|
|
615
|
+
var import_ui14 = require("@elementor/ui");
|
|
616
|
+
var import_i18n4 = require("@wordpress/i18n");
|
|
617
|
+
var borderStyles = [
|
|
618
|
+
{ value: "none", label: (0, import_i18n4.__)("None", "elementor") },
|
|
619
|
+
{ value: "solid", label: (0, import_i18n4.__)("Solid", "elementor") },
|
|
620
|
+
{ value: "dashed", label: (0, import_i18n4.__)("Dashed", "elementor") },
|
|
621
|
+
{ value: "dotted", label: (0, import_i18n4.__)("Dotted", "elementor") },
|
|
622
|
+
{ value: "double", label: (0, import_i18n4.__)("Double", "elementor") },
|
|
623
|
+
{ value: "groove", label: (0, import_i18n4.__)("Groove", "elementor") },
|
|
624
|
+
{ value: "ridge", label: (0, import_i18n4.__)("Ridge", "elementor") },
|
|
625
|
+
{ value: "inset", label: (0, import_i18n4.__)("Inset", "elementor") },
|
|
626
|
+
{ value: "outset", label: (0, import_i18n4.__)("Outset", "elementor") }
|
|
627
|
+
];
|
|
628
|
+
var BorderStyleField = () => {
|
|
629
|
+
return /* @__PURE__ */ React19.createElement(StylesField, { bind: "border-style" }, /* @__PURE__ */ React19.createElement(import_ui14.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React19.createElement(import_ui14.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React19.createElement(import_editor_controls10.ControlLabel, null, (0, import_i18n4.__)("Border Type", "elementor"))), /* @__PURE__ */ React19.createElement(import_ui14.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React19.createElement(import_editor_controls10.SelectControl, { options: borderStyles }))));
|
|
630
|
+
};
|
|
1024
631
|
|
|
1025
|
-
// src/
|
|
1026
|
-
var
|
|
1027
|
-
var
|
|
1028
|
-
var
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
632
|
+
// src/components/style-sections/border-section/border-width-field.tsx
|
|
633
|
+
var React20 = __toESM(require("react"));
|
|
634
|
+
var import_editor_controls11 = require("@elementor/editor-controls");
|
|
635
|
+
var import_icons4 = require("@elementor/icons");
|
|
636
|
+
var import_i18n5 = require("@wordpress/i18n");
|
|
637
|
+
var edges = [
|
|
638
|
+
{
|
|
639
|
+
label: (0, import_i18n5.__)("Top", "elementor"),
|
|
640
|
+
icon: /* @__PURE__ */ React20.createElement(import_icons4.SideTopIcon, { fontSize: "tiny" }),
|
|
641
|
+
bind: "top"
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
label: (0, import_i18n5.__)("Right", "elementor"),
|
|
645
|
+
icon: /* @__PURE__ */ React20.createElement(import_icons4.SideRightIcon, { fontSize: "tiny" }),
|
|
646
|
+
bind: "right"
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
label: (0, import_i18n5.__)("Bottom", "elementor"),
|
|
650
|
+
icon: /* @__PURE__ */ React20.createElement(import_icons4.SideBottomIcon, { fontSize: "tiny" }),
|
|
651
|
+
bind: "bottom"
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
label: (0, import_i18n5.__)("Left", "elementor"),
|
|
655
|
+
icon: /* @__PURE__ */ React20.createElement(import_icons4.SideLeftIcon, { fontSize: "tiny" }),
|
|
656
|
+
bind: "left"
|
|
1036
657
|
}
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
meta,
|
|
1049
|
-
propName
|
|
1050
|
-
});
|
|
1051
|
-
const setValue = (newValue) => {
|
|
1052
|
-
(0, import_editor_elements2.updateStyle)({
|
|
1053
|
-
elementID: element.id,
|
|
1054
|
-
styleDefID: id,
|
|
1055
|
-
props: { [propName]: newValue },
|
|
1056
|
-
meta,
|
|
1057
|
-
bind: classesProp
|
|
1058
|
-
});
|
|
1059
|
-
};
|
|
1060
|
-
return [value, setValue];
|
|
658
|
+
];
|
|
659
|
+
var BorderWidthField = () => {
|
|
660
|
+
return /* @__PURE__ */ React20.createElement(StylesField, { bind: "border-width" }, /* @__PURE__ */ React20.createElement(
|
|
661
|
+
import_editor_controls11.EqualUnequalSizesControl,
|
|
662
|
+
{
|
|
663
|
+
label: (0, import_i18n5.__)("Border Width", "elementor"),
|
|
664
|
+
icon: /* @__PURE__ */ React20.createElement(import_icons4.SideAllIcon, { fontSize: "tiny" }),
|
|
665
|
+
items: edges,
|
|
666
|
+
multiSizeType: "border-width"
|
|
667
|
+
}
|
|
668
|
+
));
|
|
1061
669
|
};
|
|
1062
670
|
|
|
1063
|
-
// src/
|
|
1064
|
-
var
|
|
1065
|
-
|
|
1066
|
-
|
|
671
|
+
// src/components/style-sections/border-section/border-field.tsx
|
|
672
|
+
var initialSize = { $$type: "size", value: { size: 1, unit: "px" } };
|
|
673
|
+
var initialBorderWidth = {
|
|
674
|
+
$$type: "border-width",
|
|
675
|
+
value: { top: initialSize, right: initialSize, bottom: initialSize, left: initialSize }
|
|
676
|
+
};
|
|
677
|
+
var initialBorderColor = { $$type: "color", value: "#000000" };
|
|
678
|
+
var initialBorderStyle = "solid";
|
|
679
|
+
var BorderField = () => {
|
|
680
|
+
const [borderWidth, setBorderWidth] = useStylesField("border-width");
|
|
681
|
+
const [borderColor, setBorderColor] = useStylesField("border-color");
|
|
682
|
+
const [borderStyle, setBorderStyle] = useStylesField("border-style");
|
|
683
|
+
const addBorder = () => {
|
|
684
|
+
setBorderWidth(initialBorderWidth);
|
|
685
|
+
setBorderColor(initialBorderColor);
|
|
686
|
+
setBorderStyle(initialBorderStyle);
|
|
687
|
+
};
|
|
688
|
+
const removeBorder = () => {
|
|
689
|
+
setBorderWidth(null);
|
|
690
|
+
setBorderColor(null);
|
|
691
|
+
setBorderStyle(null);
|
|
692
|
+
};
|
|
693
|
+
const hasBorder = Boolean(borderWidth || borderColor || borderStyle);
|
|
694
|
+
return /* @__PURE__ */ React21.createElement(
|
|
695
|
+
AddOrRemoveContent,
|
|
696
|
+
{
|
|
697
|
+
label: (0, import_i18n6.__)("Border", "elementor"),
|
|
698
|
+
isAdded: hasBorder,
|
|
699
|
+
onAdd: addBorder,
|
|
700
|
+
onRemove: removeBorder
|
|
701
|
+
},
|
|
702
|
+
/* @__PURE__ */ React21.createElement(BorderWidthField, null),
|
|
703
|
+
/* @__PURE__ */ React21.createElement(BorderColorField, null),
|
|
704
|
+
/* @__PURE__ */ React21.createElement(BorderStyleField, null)
|
|
705
|
+
);
|
|
1067
706
|
};
|
|
1068
707
|
|
|
1069
|
-
// src/components/style-sections/
|
|
1070
|
-
var
|
|
708
|
+
// src/components/style-sections/border-section/border-radius-field.tsx
|
|
709
|
+
var React22 = __toESM(require("react"));
|
|
710
|
+
var import_editor_controls12 = require("@elementor/editor-controls");
|
|
711
|
+
var import_icons5 = require("@elementor/icons");
|
|
712
|
+
var import_i18n7 = require("@wordpress/i18n");
|
|
713
|
+
var corners = [
|
|
1071
714
|
{
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
showTooltip: true
|
|
715
|
+
label: (0, import_i18n7.__)("Top Left", "elementor"),
|
|
716
|
+
icon: /* @__PURE__ */ React22.createElement(import_icons5.RadiusTopLeftIcon, { fontSize: "tiny" }),
|
|
717
|
+
bind: "top-left"
|
|
1076
718
|
},
|
|
1077
719
|
{
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
showTooltip: true
|
|
720
|
+
label: (0, import_i18n7.__)("Top Right", "elementor"),
|
|
721
|
+
icon: /* @__PURE__ */ React22.createElement(import_icons5.RadiusTopRightIcon, { fontSize: "tiny" }),
|
|
722
|
+
bind: "top-right"
|
|
1082
723
|
},
|
|
1083
724
|
{
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
725
|
+
label: (0, import_i18n7.__)("Bottom Right", "elementor"),
|
|
726
|
+
icon: /* @__PURE__ */ React22.createElement(import_icons5.RadiusBottomRightIcon, { fontSize: "tiny" }),
|
|
727
|
+
bind: "bottom-right"
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
label: (0, import_i18n7.__)("Bottom Left", "elementor"),
|
|
731
|
+
icon: /* @__PURE__ */ React22.createElement(import_icons5.RadiusBottomLeftIcon, { fontSize: "tiny" }),
|
|
732
|
+
bind: "bottom-left"
|
|
1088
733
|
}
|
|
1089
734
|
];
|
|
1090
|
-
var
|
|
1091
|
-
return /* @__PURE__ */
|
|
735
|
+
var BorderRadiusField = () => {
|
|
736
|
+
return /* @__PURE__ */ React22.createElement(StylesField, { bind: "border-radius" }, /* @__PURE__ */ React22.createElement(
|
|
737
|
+
import_editor_controls12.EqualUnequalSizesControl,
|
|
738
|
+
{
|
|
739
|
+
label: (0, import_i18n7.__)("Border Radius", "elementor"),
|
|
740
|
+
icon: /* @__PURE__ */ React22.createElement(import_icons5.BorderCornersIcon, { fontSize: "tiny" }),
|
|
741
|
+
items: corners,
|
|
742
|
+
multiSizeType: "border-radius"
|
|
743
|
+
}
|
|
744
|
+
));
|
|
1092
745
|
};
|
|
1093
746
|
|
|
1094
|
-
// src/components/style-sections/
|
|
1095
|
-
var
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
var
|
|
1099
|
-
|
|
747
|
+
// src/components/style-sections/border-section/border-section.tsx
|
|
748
|
+
var BorderSection = () => /* @__PURE__ */ React23.createElement(import_ui15.Stack, { gap: 1.5 }, /* @__PURE__ */ React23.createElement(BorderRadiusField, null), /* @__PURE__ */ React23.createElement(import_ui15.Divider, null), /* @__PURE__ */ React23.createElement(BorderField, null));
|
|
749
|
+
|
|
750
|
+
// src/components/style-sections/effects-section/effects-section.tsx
|
|
751
|
+
var React24 = __toESM(require("react"));
|
|
752
|
+
var import_editor_controls13 = require("@elementor/editor-controls");
|
|
753
|
+
var import_ui16 = require("@elementor/ui");
|
|
754
|
+
var EffectsSection = () => {
|
|
755
|
+
return /* @__PURE__ */ React24.createElement(import_ui16.Stack, { gap: 1.5 }, /* @__PURE__ */ React24.createElement(StylesField, { bind: "box-shadow" }, /* @__PURE__ */ React24.createElement(import_editor_controls13.BoxShadowRepeaterControl, null)));
|
|
1100
756
|
};
|
|
1101
757
|
|
|
1102
|
-
// src/components/style-sections/
|
|
1103
|
-
var
|
|
1104
|
-
var
|
|
758
|
+
// src/components/style-sections/layout-section/layout-section.tsx
|
|
759
|
+
var React27 = __toESM(require("react"));
|
|
760
|
+
var import_ui20 = require("@elementor/ui");
|
|
1105
761
|
|
|
1106
|
-
// src/components/style-sections/
|
|
1107
|
-
var
|
|
762
|
+
// src/components/style-sections/layout-section/display-field.tsx
|
|
763
|
+
var React25 = __toESM(require("react"));
|
|
764
|
+
var import_editor_controls14 = require("@elementor/editor-controls");
|
|
765
|
+
var import_ui17 = require("@elementor/ui");
|
|
1108
766
|
var import_i18n8 = require("@wordpress/i18n");
|
|
1109
|
-
var
|
|
1110
|
-
|
|
1111
|
-
var buttonSize = "tiny";
|
|
1112
|
-
var TextStyleField = () => {
|
|
1113
|
-
const [fontStyle, setFontStyle] = useStylesField("font-style");
|
|
1114
|
-
const [textDecoration, setTextDecoration] = useStylesField("text-decoration");
|
|
1115
|
-
const formats = [fontStyle, ...(textDecoration || "").split(" ")];
|
|
1116
|
-
return /* @__PURE__ */ React32.createElement(import_ui22.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React32.createElement(import_ui22.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(ControlLabel, null, (0, import_i18n8.__)("Style", "elementor"))), /* @__PURE__ */ React32.createElement(import_ui22.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React32.createElement(import_ui22.ToggleButtonGroup, { value: formats }, /* @__PURE__ */ React32.createElement(
|
|
1117
|
-
ToggleButton2,
|
|
767
|
+
var DisplayField = () => {
|
|
768
|
+
const options5 = [
|
|
1118
769
|
{
|
|
1119
|
-
value: "
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
sx: { marginLeft: "auto" }
|
|
770
|
+
value: "block",
|
|
771
|
+
renderContent: () => (0, import_i18n8.__)("Block", "elementor"),
|
|
772
|
+
label: (0, import_i18n8.__)("Block", "elementor")
|
|
1123
773
|
},
|
|
1124
|
-
/* @__PURE__ */ React32.createElement(import_icons4.ItalicIcon, { fontSize: buttonSize })
|
|
1125
|
-
), /* @__PURE__ */ React32.createElement(
|
|
1126
|
-
ShorthandControl,
|
|
1127
774
|
{
|
|
1128
|
-
value: "
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
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
|
+
};
|
|
782
|
+
|
|
783
|
+
// src/components/style-sections/layout-section/justify-content-field.tsx
|
|
784
|
+
var React26 = __toESM(require("react"));
|
|
785
|
+
var import_editor_controls15 = require("@elementor/editor-controls");
|
|
786
|
+
var import_icons6 = require("@elementor/icons");
|
|
787
|
+
var import_ui19 = require("@elementor/ui");
|
|
788
|
+
var import_i18n9 = require("@wordpress/i18n");
|
|
789
|
+
|
|
790
|
+
// src/hooks/use-direction.ts
|
|
791
|
+
var import_ui18 = require("@elementor/ui");
|
|
792
|
+
function useDirection() {
|
|
793
|
+
const theme = (0, import_ui18.useTheme)(), extendedWindow = window;
|
|
794
|
+
const isUiRtl = "rtl" === theme.direction, isSiteRtl = !!extendedWindow.elementorFrontend?.config?.is_rtl;
|
|
795
|
+
return { isSiteRtl, isUiRtl };
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
// src/components/style-sections/layout-section/utils/rotate-flex-icon.ts
|
|
799
|
+
function rotateFlexIcon(direction = "row", initValue) {
|
|
800
|
+
const rotationIndexMap = {
|
|
801
|
+
row: 0,
|
|
802
|
+
column: 1,
|
|
803
|
+
"row-reverse": 2,
|
|
804
|
+
"column-reverse": 3
|
|
805
|
+
};
|
|
806
|
+
const rotationIndex = initValue + (rotationIndexMap[direction || "row"] ?? 0);
|
|
807
|
+
return `rotate(calc(90deg * ${rotationIndex}))`;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
// src/components/style-sections/layout-section/justify-content-field.tsx
|
|
811
|
+
var JustifyContentField = () => {
|
|
812
|
+
const [direction] = useStylesField("flex-direction");
|
|
813
|
+
const { isUiRtl, isSiteRtl } = useDirection(), sx = { transform: rotateFlexIcon(direction, -1) }, shouldReverseOrder = isSiteRtl !== isUiRtl;
|
|
814
|
+
const StartIcon = isSiteRtl ? import_icons6.JustifyBottomIcon : import_icons6.JustifyTopIcon, EndIcon = isSiteRtl ? import_icons6.JustifyTopIcon : import_icons6.JustifyBottomIcon;
|
|
815
|
+
const options5 = [
|
|
816
|
+
{
|
|
817
|
+
value: "start",
|
|
818
|
+
label: (0, import_i18n9.__)("Start", "elementor"),
|
|
819
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(StartIcon, { fontSize: size, sx }),
|
|
820
|
+
showTooltip: true
|
|
1132
821
|
},
|
|
1133
|
-
/* @__PURE__ */ React32.createElement(import_icons4.StrikethroughIcon, { fontSize: buttonSize })
|
|
1134
|
-
), /* @__PURE__ */ React32.createElement(
|
|
1135
|
-
ShorthandControl,
|
|
1136
822
|
{
|
|
1137
|
-
value: "
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
823
|
+
value: "center",
|
|
824
|
+
label: (0, import_i18n9.__)("Center", "elementor"),
|
|
825
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(import_icons6.JustifyCenterIcon, { fontSize: size, sx }),
|
|
826
|
+
showTooltip: true
|
|
1141
827
|
},
|
|
1142
|
-
|
|
1143
|
-
|
|
828
|
+
{
|
|
829
|
+
value: "end",
|
|
830
|
+
label: (0, import_i18n9.__)("End", "elementor"),
|
|
831
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(EndIcon, { fontSize: size, sx }),
|
|
832
|
+
showTooltip: true
|
|
833
|
+
},
|
|
834
|
+
{
|
|
835
|
+
value: "space-between",
|
|
836
|
+
label: (0, import_i18n9.__)("Space Between", "elementor"),
|
|
837
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(import_icons6.JustifySpaceBetweenVerticalIcon, { fontSize: size, sx }),
|
|
838
|
+
showTooltip: true
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
|
+
value: "space-around",
|
|
842
|
+
label: (0, import_i18n9.__)("Space Around", "elementor"),
|
|
843
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(import_icons6.JustifySpaceAroundVerticalIcon, { fontSize: size, sx }),
|
|
844
|
+
showTooltip: true
|
|
845
|
+
},
|
|
846
|
+
{
|
|
847
|
+
value: "space-evenly",
|
|
848
|
+
label: (0, import_i18n9.__)("Space Evenly", "elementor"),
|
|
849
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(import_icons6.JustifyDistributeVerticalIcon, { fontSize: size, sx }),
|
|
850
|
+
showTooltip: true
|
|
851
|
+
}
|
|
852
|
+
];
|
|
853
|
+
if (shouldReverseOrder) {
|
|
854
|
+
options5.reverse();
|
|
855
|
+
}
|
|
856
|
+
return /* @__PURE__ */ React26.createElement(StylesField, { bind: "justify-content" }, /* @__PURE__ */ React26.createElement(import_ui19.Stack, { gap: 1 }, /* @__PURE__ */ React26.createElement(import_editor_controls15.ControlLabel, null, (0, import_i18n9.__)("Justify Content", "elementor")), /* @__PURE__ */ React26.createElement(import_editor_controls15.ToggleControl, { options: options5, fullWidth: true })));
|
|
1144
857
|
};
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
858
|
+
|
|
859
|
+
// src/components/style-sections/layout-section/layout-section.tsx
|
|
860
|
+
var LayoutSection = () => {
|
|
861
|
+
const [display] = useStylesField("display");
|
|
862
|
+
return /* @__PURE__ */ React27.createElement(import_ui20.Stack, { gap: 2 }, /* @__PURE__ */ React27.createElement(DisplayField, null), "flex" === display && /* @__PURE__ */ React27.createElement(JustifyContentField, null));
|
|
863
|
+
};
|
|
864
|
+
|
|
865
|
+
// src/components/style-sections/position-section/position-section.tsx
|
|
866
|
+
var React31 = __toESM(require("react"));
|
|
867
|
+
var import_react9 = require("react");
|
|
868
|
+
var import_ui24 = require("@elementor/ui");
|
|
869
|
+
|
|
870
|
+
// src/hooks/use-style-prop-history.ts
|
|
871
|
+
var import_react8 = require("react");
|
|
872
|
+
var import_editor_elements4 = require("@elementor/editor-elements");
|
|
873
|
+
|
|
874
|
+
// src/hooks/use-prop-value-history.ts
|
|
875
|
+
var import_react7 = require("react");
|
|
876
|
+
var import_utils2 = require("@elementor/utils");
|
|
877
|
+
var PROPS_VALUES_HISTORY_PREFIX = "elementor/editor-editing-panel/prop-value-history";
|
|
878
|
+
var usePropValueHistory = () => {
|
|
879
|
+
const { element } = useElement();
|
|
880
|
+
const elementKey = `${PROPS_VALUES_HISTORY_PREFIX}/${element.id}`;
|
|
881
|
+
const getElementPropsHistory = (0, import_react7.useCallback)(() => {
|
|
882
|
+
return (0, import_utils2.getSessionStorageItem)(elementKey);
|
|
883
|
+
}, [elementKey]);
|
|
884
|
+
const getPropValue = (0, import_react7.useCallback)(
|
|
885
|
+
(propKey) => {
|
|
886
|
+
const elementPropValues = getElementPropsHistory();
|
|
887
|
+
return elementPropValues?.[propKey] ?? null;
|
|
888
|
+
},
|
|
889
|
+
[getElementPropsHistory]
|
|
890
|
+
);
|
|
891
|
+
const setPropValue = (0, import_react7.useCallback)(
|
|
892
|
+
(propKey, propValue) => {
|
|
893
|
+
const elementPropValues = getElementPropsHistory();
|
|
894
|
+
const updatedElementPropValues = { ...elementPropValues, [propKey]: propValue };
|
|
895
|
+
(0, import_utils2.setSessionStorageItem)(elementKey, updatedElementPropValues);
|
|
896
|
+
},
|
|
897
|
+
[getElementPropsHistory, elementKey]
|
|
898
|
+
);
|
|
899
|
+
const removeProp = (0, import_react7.useCallback)(
|
|
900
|
+
(propKey) => {
|
|
901
|
+
const elementPropValues = getElementPropsHistory();
|
|
902
|
+
const updatedElementPropValues = Object.fromEntries(
|
|
903
|
+
Object.entries(elementPropValues || {}).filter(([key]) => key !== propKey)
|
|
904
|
+
);
|
|
905
|
+
(0, import_utils2.setSessionStorageItem)(elementKey, updatedElementPropValues);
|
|
906
|
+
},
|
|
907
|
+
[getElementPropsHistory, elementKey]
|
|
908
|
+
);
|
|
909
|
+
return (0, import_react7.useMemo)(() => ({ getPropValue, setPropValue, removeProp }), [getPropValue, removeProp, setPropValue]);
|
|
910
|
+
};
|
|
911
|
+
|
|
912
|
+
// src/hooks/use-style-prop-history.ts
|
|
913
|
+
var useStylePropsHistory = (props) => {
|
|
914
|
+
const { element } = useElement();
|
|
915
|
+
const { id: styleDefID, meta } = useStyle();
|
|
916
|
+
const { getPropValue, setPropValue, removeProp } = usePropValueHistory();
|
|
917
|
+
const styleDef = (0, import_editor_elements4.getElementStyles)(element.id)?.[styleDefID];
|
|
918
|
+
const styleVariant = styleDef ? (0, import_editor_elements4.getVariantByMeta)(styleDef, meta) : null;
|
|
919
|
+
const styleVariantPath = `${styleDefID}-${styleVariant?.meta.breakpoint}-${styleVariant?.meta.state}`;
|
|
920
|
+
const saveStylePropsHistory = (0, import_react8.useCallback)(() => {
|
|
921
|
+
props.forEach((propKey) => {
|
|
922
|
+
const propValue = styleVariant?.props[propKey];
|
|
923
|
+
if (propValue) {
|
|
924
|
+
const propPath = `${styleVariantPath}-${propKey}`;
|
|
925
|
+
setPropValue(propPath, propValue);
|
|
926
|
+
}
|
|
927
|
+
});
|
|
928
|
+
}, [props, setPropValue, styleVariant?.props, styleVariantPath]);
|
|
929
|
+
const updateStylePropsFromHistory = (0, import_react8.useCallback)(() => {
|
|
930
|
+
const propValuesFromHistory = props.reduce((allProps, currentPropKey) => {
|
|
931
|
+
const propPath = `${styleVariantPath}-${currentPropKey}`;
|
|
932
|
+
const propHistory = getPropValue(propPath);
|
|
933
|
+
if (propHistory) {
|
|
934
|
+
removeProp(propPath);
|
|
935
|
+
return { ...allProps, [currentPropKey]: propHistory };
|
|
936
|
+
}
|
|
937
|
+
return allProps;
|
|
938
|
+
}, {});
|
|
939
|
+
if (Object.keys(propValuesFromHistory).length) {
|
|
940
|
+
(0, import_editor_elements4.updateStyle)({
|
|
941
|
+
elementID: element.id,
|
|
942
|
+
styleDefID,
|
|
943
|
+
meta,
|
|
944
|
+
props: propValuesFromHistory,
|
|
945
|
+
bind: "classes"
|
|
946
|
+
});
|
|
1159
947
|
}
|
|
1160
|
-
};
|
|
1161
|
-
|
|
948
|
+
}, [element.id, getPropValue, meta, props, removeProp, styleDefID, styleVariantPath]);
|
|
949
|
+
const clearCurrentStyleProps = (0, import_react8.useCallback)(() => {
|
|
950
|
+
const resetValues = props.reduce(
|
|
951
|
+
(allProps, currentPropKey) => ({
|
|
952
|
+
...allProps,
|
|
953
|
+
[currentPropKey]: void 0
|
|
954
|
+
}),
|
|
955
|
+
{}
|
|
956
|
+
);
|
|
957
|
+
(0, import_editor_elements4.updateStyle)({
|
|
958
|
+
elementID: element.id,
|
|
959
|
+
styleDefID,
|
|
960
|
+
meta,
|
|
961
|
+
props: resetValues,
|
|
962
|
+
bind: "classes"
|
|
963
|
+
});
|
|
964
|
+
}, [element.id, meta, props, styleDefID]);
|
|
965
|
+
return (0, import_react8.useMemo)(
|
|
966
|
+
() => ({ saveStylePropsHistory, updateStylePropsFromHistory, clearCurrentStyleProps }),
|
|
967
|
+
[saveStylePropsHistory, updateStylePropsFromHistory, clearCurrentStyleProps]
|
|
968
|
+
);
|
|
1162
969
|
};
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
970
|
+
|
|
971
|
+
// src/components/style-sections/position-section/dimensions-field.tsx
|
|
972
|
+
var React28 = __toESM(require("react"));
|
|
973
|
+
var import_editor_controls16 = require("@elementor/editor-controls");
|
|
974
|
+
var import_icons7 = require("@elementor/icons");
|
|
975
|
+
var import_ui21 = require("@elementor/ui");
|
|
976
|
+
var import_i18n10 = require("@wordpress/i18n");
|
|
977
|
+
var sideIcons = {
|
|
978
|
+
left: /* @__PURE__ */ React28.createElement(import_icons7.SideLeftIcon, { fontSize: "tiny" }),
|
|
979
|
+
right: /* @__PURE__ */ React28.createElement(import_icons7.SideRightIcon, { fontSize: "tiny" }),
|
|
980
|
+
top: /* @__PURE__ */ React28.createElement(import_icons7.SideTopIcon, { fontSize: "tiny" }),
|
|
981
|
+
bottom: /* @__PURE__ */ React28.createElement(import_icons7.SideBottomIcon, { fontSize: "tiny" })
|
|
982
|
+
};
|
|
983
|
+
var DimensionsField = () => {
|
|
984
|
+
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(import_ui21.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React28.createElement(DimensionField, { side: "top", label: (0, import_i18n10.__)("Top", "elementor") }), /* @__PURE__ */ React28.createElement(DimensionField, { side: "right", label: (0, import_i18n10.__)("Right", "elementor") })), /* @__PURE__ */ React28.createElement(import_ui21.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React28.createElement(DimensionField, { side: "bottom", label: (0, import_i18n10.__)("Bottom", "elementor") }), /* @__PURE__ */ React28.createElement(DimensionField, { side: "left", label: (0, import_i18n10.__)("Left", "elementor") })));
|
|
985
|
+
};
|
|
986
|
+
var DimensionField = ({ side, label }) => {
|
|
987
|
+
return /* @__PURE__ */ React28.createElement(import_ui21.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React28.createElement(import_ui21.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React28.createElement(import_editor_controls16.ControlLabel, null, label)), /* @__PURE__ */ React28.createElement(import_ui21.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React28.createElement(StylesField, { bind: side }, /* @__PURE__ */ React28.createElement(import_editor_controls16.SizeControl, { startIcon: sideIcons[side] }))));
|
|
1168
988
|
};
|
|
1169
989
|
|
|
1170
|
-
// src/components/style-sections/
|
|
1171
|
-
var
|
|
990
|
+
// src/components/style-sections/position-section/position-field.tsx
|
|
991
|
+
var React29 = __toESM(require("react"));
|
|
992
|
+
var import_editor_controls17 = require("@elementor/editor-controls");
|
|
993
|
+
var import_ui22 = require("@elementor/ui");
|
|
994
|
+
var import_i18n11 = require("@wordpress/i18n");
|
|
995
|
+
var positionOptions = [
|
|
996
|
+
{ label: (0, import_i18n11.__)("Static", "elementor"), value: "static" },
|
|
997
|
+
{ label: (0, import_i18n11.__)("Relative", "elementor"), value: "relative" },
|
|
998
|
+
{ label: (0, import_i18n11.__)("Absolute", "elementor"), value: "absolute" },
|
|
999
|
+
{ label: (0, import_i18n11.__)("Fixed", "elementor"), value: "fixed" }
|
|
1000
|
+
];
|
|
1001
|
+
var PositionField = () => {
|
|
1002
|
+
return /* @__PURE__ */ React29.createElement(StylesField, { bind: "position" }, /* @__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.__)("Position", "elementor"))), /* @__PURE__ */ React29.createElement(import_ui22.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React29.createElement(import_editor_controls17.SelectControl, { options: positionOptions }))));
|
|
1003
|
+
};
|
|
1172
1004
|
|
|
1173
|
-
// src/components/style-sections/
|
|
1174
|
-
var
|
|
1175
|
-
var
|
|
1005
|
+
// src/components/style-sections/position-section/z-index-field.tsx
|
|
1006
|
+
var React30 = __toESM(require("react"));
|
|
1007
|
+
var import_editor_controls18 = require("@elementor/editor-controls");
|
|
1176
1008
|
var import_ui23 = require("@elementor/ui");
|
|
1177
|
-
var
|
|
1178
|
-
|
|
1009
|
+
var import_i18n12 = require("@wordpress/i18n");
|
|
1010
|
+
var ZIndexField = () => {
|
|
1011
|
+
return /* @__PURE__ */ React30.createElement(StylesField, { bind: "z-index" }, /* @__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.__)("Z-Index", "elementor"))), /* @__PURE__ */ React30.createElement(import_ui23.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(import_editor_controls18.NumberControl, null))));
|
|
1179
1012
|
};
|
|
1180
1013
|
|
|
1181
|
-
// src/components/style-sections/
|
|
1182
|
-
var
|
|
1183
|
-
var
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
{
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1014
|
+
// src/components/style-sections/position-section/position-section.tsx
|
|
1015
|
+
var dimensionsPropKeys = ["top", "bottom", "left", "right"];
|
|
1016
|
+
var PositionSection = () => {
|
|
1017
|
+
const [positionValue] = useStylesField("position");
|
|
1018
|
+
usePositionChangeHandler();
|
|
1019
|
+
const isNotStatic = positionValue && positionValue !== "static";
|
|
1020
|
+
return /* @__PURE__ */ React31.createElement(import_ui24.Stack, { gap: 1.5 }, /* @__PURE__ */ React31.createElement(PositionField, null), isNotStatic ? /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement(DimensionsField, null), /* @__PURE__ */ React31.createElement(ZIndexField, null)) : null);
|
|
1021
|
+
};
|
|
1022
|
+
var usePositionChangeHandler = () => {
|
|
1023
|
+
const dimensionsHistory = useStylePropsHistory(dimensionsPropKeys);
|
|
1024
|
+
const onPositionChange = (0, import_react9.useCallback)(
|
|
1025
|
+
(newPositionValue, previousPosition) => {
|
|
1026
|
+
if (!dimensionsHistory) {
|
|
1027
|
+
return;
|
|
1028
|
+
}
|
|
1029
|
+
const { saveStylePropsHistory, updateStylePropsFromHistory, clearCurrentStyleProps } = dimensionsHistory;
|
|
1030
|
+
if (newPositionValue === "static") {
|
|
1031
|
+
saveStylePropsHistory();
|
|
1032
|
+
clearCurrentStyleProps();
|
|
1033
|
+
} else if (previousPosition === "static") {
|
|
1034
|
+
updateStylePropsFromHistory();
|
|
1035
|
+
}
|
|
1036
|
+
previousPosition = newPositionValue;
|
|
1037
|
+
},
|
|
1038
|
+
[dimensionsHistory]
|
|
1039
|
+
);
|
|
1040
|
+
const [, , registerChangeListener] = useStylesField("position");
|
|
1041
|
+
registerChangeListener?.(onPositionChange);
|
|
1042
|
+
};
|
|
1043
|
+
|
|
1044
|
+
// src/components/style-sections/size-section/size-section.tsx
|
|
1045
|
+
var React33 = __toESM(require("react"));
|
|
1046
|
+
var import_editor_controls20 = require("@elementor/editor-controls");
|
|
1047
|
+
var import_ui26 = require("@elementor/ui");
|
|
1048
|
+
var import_i18n14 = require("@wordpress/i18n");
|
|
1049
|
+
|
|
1050
|
+
// src/components/style-sections/size-section/overflow-field.tsx
|
|
1051
|
+
var React32 = __toESM(require("react"));
|
|
1052
|
+
var import_editor_controls19 = require("@elementor/editor-controls");
|
|
1053
|
+
var import_icons8 = require("@elementor/icons");
|
|
1054
|
+
var import_ui25 = require("@elementor/ui");
|
|
1055
|
+
var import_i18n13 = require("@wordpress/i18n");
|
|
1056
|
+
var options = [
|
|
1057
|
+
{
|
|
1058
|
+
value: "visible",
|
|
1059
|
+
label: (0, import_i18n13.__)("Visible", "elementor"),
|
|
1060
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(import_icons8.EyeIcon, { fontSize: size }),
|
|
1061
|
+
showTooltip: true
|
|
1062
|
+
},
|
|
1063
|
+
{
|
|
1064
|
+
value: "hidden",
|
|
1065
|
+
label: (0, import_i18n13.__)("Hidden", "elementor"),
|
|
1066
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(import_icons8.EyeOffIcon, { fontSize: size }),
|
|
1067
|
+
showTooltip: true
|
|
1068
|
+
},
|
|
1069
|
+
{
|
|
1070
|
+
value: "auto",
|
|
1071
|
+
label: (0, import_i18n13.__)("Auto", "elementor"),
|
|
1072
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(import_icons8.ExpandBottomIcon, { fontSize: size }),
|
|
1073
|
+
showTooltip: true
|
|
1074
|
+
}
|
|
1191
1075
|
];
|
|
1192
|
-
var
|
|
1193
|
-
return /* @__PURE__ */
|
|
1076
|
+
var OverflowField = () => {
|
|
1077
|
+
return /* @__PURE__ */ React32.createElement(StylesField, { bind: "overflow" }, /* @__PURE__ */ React32.createElement(import_ui25.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(import_ui25.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(import_editor_controls19.ControlLabel, null, (0, import_i18n13.__)("Overflow", "elementor"))), /* @__PURE__ */ React32.createElement(import_ui25.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React32.createElement(import_editor_controls19.ToggleControl, { options }))));
|
|
1194
1078
|
};
|
|
1195
1079
|
|
|
1196
|
-
// src/components/style-sections/
|
|
1197
|
-
var
|
|
1198
|
-
|
|
1199
|
-
var import_ui25 = require("@elementor/ui");
|
|
1200
|
-
var TextColorField = () => {
|
|
1201
|
-
return /* @__PURE__ */ React35.createElement(StylesField, { bind: "color" }, /* @__PURE__ */ React35.createElement(import_ui25.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React35.createElement(import_ui25.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(ControlLabel, null, (0, import_i18n11.__)("Text Color", "elementor"))), /* @__PURE__ */ React35.createElement(import_ui25.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(ColorControl, null))));
|
|
1080
|
+
// src/components/style-sections/size-section/size-section.tsx
|
|
1081
|
+
var SizeSection = () => {
|
|
1082
|
+
return /* @__PURE__ */ React33.createElement(import_ui26.Stack, { gap: 1.5 }, /* @__PURE__ */ React33.createElement(import_ui26.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React33.createElement(import_ui26.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(SizeField, { bind: "width", label: (0, import_i18n14.__)("Width", "elementor") })), /* @__PURE__ */ React33.createElement(import_ui26.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(SizeField, { bind: "height", label: (0, import_i18n14.__)("Height", "elementor") }))), /* @__PURE__ */ React33.createElement(import_ui26.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React33.createElement(import_ui26.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(SizeField, { bind: "min-width", label: (0, import_i18n14.__)("Min. Width", "elementor") })), /* @__PURE__ */ React33.createElement(import_ui26.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(SizeField, { bind: "min-height", label: (0, import_i18n14.__)("Min. Height", "elementor") }))), /* @__PURE__ */ React33.createElement(import_ui26.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React33.createElement(import_ui26.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(SizeField, { bind: "max-width", label: (0, import_i18n14.__)("Max. Width", "elementor") })), /* @__PURE__ */ React33.createElement(import_ui26.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(SizeField, { bind: "max-height", label: (0, import_i18n14.__)("Max. Height", "elementor") }))), /* @__PURE__ */ React33.createElement(import_ui26.Divider, null), /* @__PURE__ */ React33.createElement(import_ui26.Stack, null, /* @__PURE__ */ React33.createElement(OverflowField, null)));
|
|
1202
1083
|
};
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
var React36 = __toESM(require("react"));
|
|
1206
|
-
var import_i18n12 = require("@wordpress/i18n");
|
|
1207
|
-
var import_ui26 = require("@elementor/ui");
|
|
1208
|
-
var LetterSpacingField = () => {
|
|
1209
|
-
return /* @__PURE__ */ React36.createElement(StylesField, { bind: "letter-spacing" }, /* @__PURE__ */ React36.createElement(import_ui26.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React36.createElement(import_ui26.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(ControlLabel, null, (0, import_i18n12.__)("Letter Spacing", "elementor"))), /* @__PURE__ */ React36.createElement(import_ui26.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(SizeControl, null))));
|
|
1084
|
+
var SizeField = ({ label, bind }) => {
|
|
1085
|
+
return /* @__PURE__ */ React33.createElement(StylesField, { bind }, /* @__PURE__ */ React33.createElement(import_ui26.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React33.createElement(import_ui26.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React33.createElement(import_editor_controls20.ControlLabel, null, label)), /* @__PURE__ */ React33.createElement(import_ui26.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React33.createElement(import_editor_controls20.SizeControl, null))));
|
|
1210
1086
|
};
|
|
1211
1087
|
|
|
1212
|
-
// src/components/style-sections/
|
|
1213
|
-
var
|
|
1214
|
-
var
|
|
1088
|
+
// src/components/style-sections/spacing-section/spacing-section.tsx
|
|
1089
|
+
var React34 = __toESM(require("react"));
|
|
1090
|
+
var import_editor_controls21 = require("@elementor/editor-controls");
|
|
1215
1091
|
var import_ui27 = require("@elementor/ui");
|
|
1216
|
-
var
|
|
1217
|
-
|
|
1092
|
+
var import_i18n15 = require("@wordpress/i18n");
|
|
1093
|
+
var SpacingSection = () => {
|
|
1094
|
+
return /* @__PURE__ */ React34.createElement(import_ui27.Stack, { gap: 1.5 }, /* @__PURE__ */ React34.createElement(StylesField, { bind: "padding" }, /* @__PURE__ */ React34.createElement(import_editor_controls21.LinkedDimensionsControl, { label: (0, import_i18n15.__)("Padding", "elementor") })), /* @__PURE__ */ React34.createElement(import_ui27.Divider, null), /* @__PURE__ */ React34.createElement(StylesField, { bind: "margin" }, /* @__PURE__ */ React34.createElement(import_editor_controls21.LinkedDimensionsControl, { label: (0, import_i18n15.__)("Margin", "elementor") })));
|
|
1218
1095
|
};
|
|
1219
1096
|
|
|
1097
|
+
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1098
|
+
var React48 = __toESM(require("react"));
|
|
1099
|
+
var import_ui40 = require("@elementor/ui");
|
|
1100
|
+
|
|
1220
1101
|
// src/components/collapsible-content.tsx
|
|
1221
|
-
var
|
|
1222
|
-
var
|
|
1223
|
-
var import_icons5 = require("@elementor/icons");
|
|
1102
|
+
var React35 = __toESM(require("react"));
|
|
1103
|
+
var import_react10 = require("react");
|
|
1224
1104
|
var import_ui28 = require("@elementor/ui");
|
|
1225
|
-
var
|
|
1105
|
+
var import_i18n16 = require("@wordpress/i18n");
|
|
1226
1106
|
var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
1227
|
-
const [open, setOpen] = (0,
|
|
1107
|
+
const [open, setOpen] = (0, import_react10.useState)(defaultOpen);
|
|
1228
1108
|
const handleToggle = () => {
|
|
1229
1109
|
setOpen((prevOpen) => !prevOpen);
|
|
1230
1110
|
};
|
|
1231
|
-
return /* @__PURE__ */
|
|
1111
|
+
return /* @__PURE__ */ React35.createElement(import_ui28.Stack, { sx: { py: 0.5 } }, /* @__PURE__ */ React35.createElement(
|
|
1232
1112
|
import_ui28.Button,
|
|
1233
1113
|
{
|
|
1234
1114
|
fullWidth: true,
|
|
@@ -1236,593 +1116,298 @@ var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
|
1236
1116
|
color: "secondary",
|
|
1237
1117
|
variant: "outlined",
|
|
1238
1118
|
onClick: handleToggle,
|
|
1239
|
-
endIcon: /* @__PURE__ */
|
|
1119
|
+
endIcon: /* @__PURE__ */ React35.createElement(CollapseIcon, { open })
|
|
1240
1120
|
},
|
|
1241
|
-
open ? (0,
|
|
1242
|
-
), /* @__PURE__ */
|
|
1121
|
+
open ? (0, import_i18n16.__)("Show less", "elementor") : (0, import_i18n16.__)("Show more", "elementor")
|
|
1122
|
+
), /* @__PURE__ */ React35.createElement(import_ui28.Collapse, { in: open, timeout: "auto", unmountOnExit: true }, children));
|
|
1243
1123
|
};
|
|
1244
|
-
var ChevronIcon = (0, import_ui28.styled)(import_icons5.ChevronDownIcon, {
|
|
1245
|
-
shouldForwardProp: (prop) => prop !== "open"
|
|
1246
|
-
})(({ theme, open }) => ({
|
|
1247
|
-
transform: open ? "rotate(180deg)" : "rotate(0)",
|
|
1248
|
-
transition: theme.transitions.create("transform", {
|
|
1249
|
-
duration: theme.transitions.duration.standard
|
|
1250
|
-
})
|
|
1251
|
-
}));
|
|
1252
1124
|
|
|
1253
|
-
// src/components/style-sections/typography-section/
|
|
1254
|
-
var
|
|
1255
|
-
var
|
|
1125
|
+
// src/components/style-sections/typography-section/font-family-field.tsx
|
|
1126
|
+
var React36 = __toESM(require("react"));
|
|
1127
|
+
var import_editor_controls22 = require("@elementor/editor-controls");
|
|
1256
1128
|
var import_ui29 = require("@elementor/ui");
|
|
1257
|
-
var
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1129
|
+
var import_i18n17 = require("@wordpress/i18n");
|
|
1130
|
+
|
|
1131
|
+
// src/sync/get-elementor-config.ts
|
|
1132
|
+
var getElementorConfig = () => {
|
|
1133
|
+
const extendedWindow = window;
|
|
1134
|
+
return extendedWindow.elementor?.config ?? {};
|
|
1135
|
+
};
|
|
1136
|
+
|
|
1137
|
+
// src/components/style-sections/typography-section/font-family-field.tsx
|
|
1138
|
+
var FontFamilyField = () => {
|
|
1139
|
+
const fontFamilies = getFontFamilies();
|
|
1140
|
+
if (!fontFamilies) {
|
|
1141
|
+
return null;
|
|
1142
|
+
}
|
|
1143
|
+
return /* @__PURE__ */ React36.createElement(StylesField, { bind: "font-family" }, /* @__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_controls22.ControlLabel, null, (0, import_i18n17.__)("Font Family", "elementor"))), /* @__PURE__ */ React36.createElement(import_ui29.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(import_editor_controls22.FontFamilyControl, { fontFamilies }))));
|
|
1144
|
+
};
|
|
1145
|
+
var getFontFamilies = () => {
|
|
1146
|
+
const { controls } = getElementorConfig();
|
|
1147
|
+
const options5 = controls?.font?.options;
|
|
1148
|
+
if (!options5) {
|
|
1149
|
+
return null;
|
|
1150
|
+
}
|
|
1151
|
+
return options5;
|
|
1152
|
+
};
|
|
1153
|
+
|
|
1154
|
+
// src/components/style-sections/typography-section/font-size-field.tsx
|
|
1155
|
+
var React37 = __toESM(require("react"));
|
|
1156
|
+
var import_editor_controls23 = require("@elementor/editor-controls");
|
|
1157
|
+
var import_ui30 = require("@elementor/ui");
|
|
1158
|
+
var import_i18n18 = require("@wordpress/i18n");
|
|
1159
|
+
var FontSizeField = () => {
|
|
1160
|
+
return /* @__PURE__ */ React37.createElement(StylesField, { bind: "font-size" }, /* @__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_controls23.ControlLabel, null, (0, import_i18n18.__)("Font Size", "elementor"))), /* @__PURE__ */ React37.createElement(import_ui30.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(import_editor_controls23.SizeControl, null))));
|
|
1161
|
+
};
|
|
1162
|
+
|
|
1163
|
+
// src/components/style-sections/typography-section/font-weight-field.tsx
|
|
1164
|
+
var React38 = __toESM(require("react"));
|
|
1165
|
+
var import_editor_controls24 = require("@elementor/editor-controls");
|
|
1166
|
+
var import_ui31 = require("@elementor/ui");
|
|
1167
|
+
var import_i18n19 = require("@wordpress/i18n");
|
|
1168
|
+
var fontWeightOptions = [
|
|
1169
|
+
{ label: (0, import_i18n19.__)("Light - 400", "elementor"), value: "400" },
|
|
1170
|
+
{ label: (0, import_i18n19.__)("Regular - 500", "elementor"), value: "500" },
|
|
1171
|
+
{ label: (0, import_i18n19.__)("Semi Bold - 600", "elementor"), value: "600" },
|
|
1172
|
+
{ label: (0, import_i18n19.__)("Bold - 700", "elementor"), value: "700" },
|
|
1173
|
+
{ label: (0, import_i18n19.__)("Black - 900", "elementor"), value: "900" }
|
|
1262
1174
|
];
|
|
1263
|
-
var
|
|
1175
|
+
var FontWeightField = () => {
|
|
1176
|
+
return /* @__PURE__ */ React38.createElement(StylesField, { bind: "font-weight" }, /* @__PURE__ */ React38.createElement(import_ui31.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React38.createElement(import_ui31.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(import_editor_controls24.ControlLabel, null, (0, import_i18n19.__)("Font Weight", "elementor"))), /* @__PURE__ */ React38.createElement(import_ui31.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(import_editor_controls24.SelectControl, { options: fontWeightOptions }))));
|
|
1177
|
+
};
|
|
1178
|
+
|
|
1179
|
+
// src/components/style-sections/typography-section/letter-spacing-field.tsx
|
|
1180
|
+
var React39 = __toESM(require("react"));
|
|
1181
|
+
var import_editor_controls25 = require("@elementor/editor-controls");
|
|
1182
|
+
var import_ui32 = require("@elementor/ui");
|
|
1183
|
+
var import_i18n20 = require("@wordpress/i18n");
|
|
1184
|
+
var LetterSpacingField = () => {
|
|
1185
|
+
return /* @__PURE__ */ React39.createElement(StylesField, { bind: "letter-spacing" }, /* @__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_controls25.ControlLabel, null, (0, import_i18n20.__)("Letter Spacing", "elementor"))), /* @__PURE__ */ React39.createElement(import_ui32.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(import_editor_controls25.SizeControl, null))));
|
|
1186
|
+
};
|
|
1264
1187
|
|
|
1265
1188
|
// src/components/style-sections/typography-section/text-alignment-field.tsx
|
|
1266
1189
|
var React40 = __toESM(require("react"));
|
|
1267
|
-
var
|
|
1268
|
-
var
|
|
1269
|
-
var
|
|
1270
|
-
var
|
|
1190
|
+
var import_editor_controls26 = require("@elementor/editor-controls");
|
|
1191
|
+
var import_icons9 = require("@elementor/icons");
|
|
1192
|
+
var import_ui33 = require("@elementor/ui");
|
|
1193
|
+
var import_i18n21 = require("@wordpress/i18n");
|
|
1194
|
+
var options2 = [
|
|
1271
1195
|
{
|
|
1272
1196
|
value: "left",
|
|
1273
|
-
label: (0,
|
|
1274
|
-
|
|
1197
|
+
label: (0, import_i18n21.__)("Left", "elementor"),
|
|
1198
|
+
renderContent: ({ size }) => /* @__PURE__ */ React40.createElement(import_icons9.AlignLeftIcon, { fontSize: size })
|
|
1275
1199
|
},
|
|
1276
1200
|
{
|
|
1277
1201
|
value: "center",
|
|
1278
|
-
label: (0,
|
|
1279
|
-
|
|
1202
|
+
label: (0, import_i18n21.__)("Center", "elementor"),
|
|
1203
|
+
renderContent: ({ size }) => /* @__PURE__ */ React40.createElement(import_icons9.AlignCenterIcon, { fontSize: size })
|
|
1280
1204
|
},
|
|
1281
1205
|
{
|
|
1282
1206
|
value: "right",
|
|
1283
|
-
label: (0,
|
|
1284
|
-
|
|
1207
|
+
label: (0, import_i18n21.__)("Right", "elementor"),
|
|
1208
|
+
renderContent: ({ size }) => /* @__PURE__ */ React40.createElement(import_icons9.AlignRightIcon, { fontSize: size })
|
|
1285
1209
|
},
|
|
1286
1210
|
{
|
|
1287
1211
|
value: "justify",
|
|
1288
|
-
label: (0,
|
|
1289
|
-
|
|
1212
|
+
label: (0, import_i18n21.__)("Justify", "elementor"),
|
|
1213
|
+
renderContent: ({ size }) => /* @__PURE__ */ React40.createElement(import_icons9.AlignJustifiedIcon, { fontSize: size })
|
|
1290
1214
|
}
|
|
1291
1215
|
];
|
|
1292
1216
|
var TextAlignmentField = () => {
|
|
1293
|
-
return /* @__PURE__ */ React40.createElement(StylesField, { bind: "text-align" }, /* @__PURE__ */ React40.createElement(
|
|
1217
|
+
return /* @__PURE__ */ React40.createElement(StylesField, { bind: "text-align" }, /* @__PURE__ */ React40.createElement(import_ui33.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React40.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(import_editor_controls26.ControlLabel, null, (0, import_i18n21.__)("Alignment", "elementor"))), /* @__PURE__ */ React40.createElement(import_ui33.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React40.createElement(import_editor_controls26.ToggleControl, { options: options2 }))));
|
|
1294
1218
|
};
|
|
1295
1219
|
|
|
1296
|
-
// src/components/style-sections/typography-section/text-
|
|
1220
|
+
// src/components/style-sections/typography-section/text-color-field.tsx
|
|
1297
1221
|
var React41 = __toESM(require("react"));
|
|
1298
|
-
var
|
|
1299
|
-
var
|
|
1300
|
-
var
|
|
1301
|
-
var
|
|
1222
|
+
var import_editor_controls27 = require("@elementor/editor-controls");
|
|
1223
|
+
var import_ui34 = require("@elementor/ui");
|
|
1224
|
+
var import_i18n22 = require("@wordpress/i18n");
|
|
1225
|
+
var TextColorField = () => {
|
|
1226
|
+
return /* @__PURE__ */ React41.createElement(StylesField, { bind: "color" }, /* @__PURE__ */ React41.createElement(import_ui34.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React41.createElement(import_ui34.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(import_editor_controls27.ControlLabel, null, (0, import_i18n22.__)("Text Color", "elementor"))), /* @__PURE__ */ React41.createElement(import_ui34.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(import_editor_controls27.ColorControl, null))));
|
|
1227
|
+
};
|
|
1228
|
+
|
|
1229
|
+
// src/components/style-sections/typography-section/text-direction-field.tsx
|
|
1230
|
+
var React42 = __toESM(require("react"));
|
|
1231
|
+
var import_editor_controls28 = require("@elementor/editor-controls");
|
|
1232
|
+
var import_icons10 = require("@elementor/icons");
|
|
1233
|
+
var import_ui35 = require("@elementor/ui");
|
|
1234
|
+
var import_i18n23 = require("@wordpress/i18n");
|
|
1235
|
+
var options3 = [
|
|
1302
1236
|
{
|
|
1303
1237
|
value: "ltr",
|
|
1304
|
-
label: (0,
|
|
1305
|
-
|
|
1238
|
+
label: (0, import_i18n23.__)("Left to Right", "elementor"),
|
|
1239
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(import_icons10.TextDirectionLtrIcon, { fontSize: size })
|
|
1306
1240
|
},
|
|
1307
1241
|
{
|
|
1308
1242
|
value: "rtl",
|
|
1309
|
-
label: (0,
|
|
1310
|
-
|
|
1243
|
+
label: (0, import_i18n23.__)("Right to Left", "elementor"),
|
|
1244
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(import_icons10.TextDirectionRtlIcon, { fontSize: size })
|
|
1311
1245
|
}
|
|
1312
1246
|
];
|
|
1313
1247
|
var TextDirectionField = () => {
|
|
1314
|
-
return /* @__PURE__ */
|
|
1248
|
+
return /* @__PURE__ */ React42.createElement(StylesField, { bind: "direction" }, /* @__PURE__ */ React42.createElement(import_ui35.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React42.createElement(import_ui35.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(import_editor_controls28.ControlLabel, null, (0, import_i18n23.__)("Direction", "elementor"))), /* @__PURE__ */ React42.createElement(import_ui35.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React42.createElement(import_editor_controls28.ToggleControl, { options: options3 }))));
|
|
1315
1249
|
};
|
|
1316
1250
|
|
|
1317
1251
|
// src/components/style-sections/typography-section/text-stroke-field.tsx
|
|
1318
|
-
var
|
|
1319
|
-
var
|
|
1252
|
+
var React44 = __toESM(require("react"));
|
|
1253
|
+
var import_editor_controls29 = require("@elementor/editor-controls");
|
|
1254
|
+
var import_i18n25 = require("@wordpress/i18n");
|
|
1320
1255
|
|
|
1321
1256
|
// src/components/collapsible-field.tsx
|
|
1322
|
-
var
|
|
1323
|
-
var
|
|
1324
|
-
var
|
|
1325
|
-
var
|
|
1326
|
-
var
|
|
1257
|
+
var React43 = __toESM(require("react"));
|
|
1258
|
+
var import_react11 = require("react");
|
|
1259
|
+
var import_icons11 = require("@elementor/icons");
|
|
1260
|
+
var import_ui36 = require("@elementor/ui");
|
|
1261
|
+
var import_i18n24 = require("@wordpress/i18n");
|
|
1327
1262
|
var CollapsibleField = ({ label, children, defaultOpen = false }) => {
|
|
1328
|
-
const [open, setOpen] = (0,
|
|
1263
|
+
const [open, setOpen] = (0, import_react11.useState)(defaultOpen);
|
|
1329
1264
|
const handleToggle = () => {
|
|
1330
1265
|
setOpen((prevOpen) => !prevOpen);
|
|
1331
1266
|
};
|
|
1332
|
-
return /* @__PURE__ */
|
|
1333
|
-
|
|
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,
|
|
1334
1269
|
{
|
|
1335
1270
|
onClick: handleToggle,
|
|
1336
1271
|
size: "tiny",
|
|
1337
|
-
"aria-label": open ? (0,
|
|
1272
|
+
"aria-label": open ? (0, import_i18n24.__)("Close", "elementor") : (0, import_i18n24.__)("Expand", "elementor")
|
|
1338
1273
|
},
|
|
1339
|
-
open ? /* @__PURE__ */
|
|
1340
|
-
)), /* @__PURE__ */
|
|
1274
|
+
open ? /* @__PURE__ */ React43.createElement(import_icons11.MinusIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React43.createElement(import_icons11.PlusIcon, { fontSize: "tiny" })
|
|
1275
|
+
)), /* @__PURE__ */ React43.createElement(import_ui36.Collapse, { in: open, unmountOnExit: true }, children));
|
|
1341
1276
|
};
|
|
1342
1277
|
|
|
1343
1278
|
// src/components/style-sections/typography-section/text-stroke-field.tsx
|
|
1344
1279
|
var TextStrokeField = () => {
|
|
1345
|
-
return /* @__PURE__ */
|
|
1346
|
-
};
|
|
1347
|
-
|
|
1348
|
-
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1349
|
-
var TypographySection = () => {
|
|
1350
|
-
return /* @__PURE__ */ React44.createElement(AccordionSection, { title: (0, import_i18n20.__)("Typography", "elementor") }, /* @__PURE__ */ React44.createElement(import_ui33.Stack, { gap: 1.5 }, /* @__PURE__ */ React44.createElement(FontWeightField, null), /* @__PURE__ */ React44.createElement(FontSizeField, null), /* @__PURE__ */ React44.createElement(import_ui33.Divider, null), /* @__PURE__ */ React44.createElement(TextColorField, null), /* @__PURE__ */ React44.createElement(CollapsibleContent, null, /* @__PURE__ */ React44.createElement(import_ui33.Stack, { gap: 1.5, sx: { pt: 1.5 } }, /* @__PURE__ */ React44.createElement(LetterSpacingField, null), /* @__PURE__ */ React44.createElement(WordSpacingField, null), /* @__PURE__ */ React44.createElement(import_ui33.Divider, null), /* @__PURE__ */ React44.createElement(TextAlignmentField, null), /* @__PURE__ */ React44.createElement(TextStyleField, null), /* @__PURE__ */ React44.createElement(TransformField, null), /* @__PURE__ */ React44.createElement(TextDirectionField, null), /* @__PURE__ */ React44.createElement(TextStrokeField, null)))));
|
|
1280
|
+
return /* @__PURE__ */ React44.createElement(StylesField, { bind: "-webkit-text-stroke" }, /* @__PURE__ */ React44.createElement(CollapsibleField, { label: /* @__PURE__ */ React44.createElement(import_editor_controls29.ControlLabel, null, (0, import_i18n25.__)("Text Stroke", "elementor")) }, /* @__PURE__ */ React44.createElement(import_editor_controls29.StrokeControl, null)));
|
|
1351
1281
|
};
|
|
1352
1282
|
|
|
1353
|
-
// src/components/style-sections/
|
|
1354
|
-
var React48 = __toESM(require("react"));
|
|
1355
|
-
var import_ui37 = require("@elementor/ui");
|
|
1356
|
-
|
|
1357
|
-
// src/components/style-sections/position-section/z-index-field.tsx
|
|
1283
|
+
// src/components/style-sections/typography-section/text-style-field.tsx
|
|
1358
1284
|
var React45 = __toESM(require("react"));
|
|
1359
|
-
var
|
|
1360
|
-
var
|
|
1361
|
-
var
|
|
1362
|
-
return /* @__PURE__ */ React45.createElement(StylesField, { bind: "z-index" }, /* @__PURE__ */ React45.createElement(import_ui34.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React45.createElement(import_ui34.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(ControlLabel, null, (0, import_i18n21.__)("Z-Index", "elementor"))), /* @__PURE__ */ React45.createElement(import_ui34.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(NumberControl, null))));
|
|
1363
|
-
};
|
|
1364
|
-
|
|
1365
|
-
// src/components/style-sections/position-section/position-field.tsx
|
|
1366
|
-
var React46 = __toESM(require("react"));
|
|
1367
|
-
var import_i18n22 = require("@wordpress/i18n");
|
|
1368
|
-
var import_ui35 = require("@elementor/ui");
|
|
1369
|
-
var positionOptions = [
|
|
1370
|
-
{ label: (0, import_i18n22.__)("Static", "elementor"), value: "static" },
|
|
1371
|
-
{ label: (0, import_i18n22.__)("Relative", "elementor"), value: "relative" },
|
|
1372
|
-
{ label: (0, import_i18n22.__)("Absolute", "elementor"), value: "absolute" },
|
|
1373
|
-
{ label: (0, import_i18n22.__)("Fixed", "elementor"), value: "fixed" }
|
|
1374
|
-
];
|
|
1375
|
-
var PositionField = () => {
|
|
1376
|
-
return /* @__PURE__ */ React46.createElement(StylesField, { bind: "position" }, /* @__PURE__ */ React46.createElement(import_ui35.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React46.createElement(import_ui35.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(ControlLabel, null, (0, import_i18n22.__)("Position", "elementor"))), /* @__PURE__ */ React46.createElement(import_ui35.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(SelectControl, { options: positionOptions }))));
|
|
1377
|
-
};
|
|
1378
|
-
|
|
1379
|
-
// src/components/style-sections/position-section/position-section.tsx
|
|
1380
|
-
var import_i18n24 = require("@wordpress/i18n");
|
|
1381
|
-
|
|
1382
|
-
// src/components/style-sections/position-section/dimensions-field.tsx
|
|
1383
|
-
var React47 = __toESM(require("react"));
|
|
1384
|
-
var import_ui36 = require("@elementor/ui");
|
|
1385
|
-
var import_i18n23 = require("@wordpress/i18n");
|
|
1386
|
-
var import_icons10 = require("@elementor/icons");
|
|
1387
|
-
var sideIcons = {
|
|
1388
|
-
left: /* @__PURE__ */ React47.createElement(import_icons10.SideLeftIcon, { fontSize: "tiny" }),
|
|
1389
|
-
right: /* @__PURE__ */ React47.createElement(import_icons10.SideRightIcon, { fontSize: "tiny" }),
|
|
1390
|
-
top: /* @__PURE__ */ React47.createElement(import_icons10.SideTopIcon, { fontSize: "tiny" }),
|
|
1391
|
-
bottom: /* @__PURE__ */ React47.createElement(import_icons10.SideBottomIcon, { fontSize: "tiny" })
|
|
1392
|
-
};
|
|
1393
|
-
var DimensionsField = () => {
|
|
1394
|
-
return /* @__PURE__ */ React47.createElement(React47.Fragment, null, /* @__PURE__ */ React47.createElement(import_ui36.Stack, { direction: "row", gap: 2 }, /* @__PURE__ */ React47.createElement(DimensionField, { side: "top", label: (0, import_i18n23.__)("Top", "elementor") }), /* @__PURE__ */ React47.createElement(DimensionField, { side: "right", label: (0, import_i18n23.__)("Right", "elementor") })), /* @__PURE__ */ React47.createElement(import_ui36.Stack, { direction: "row", gap: 2 }, /* @__PURE__ */ React47.createElement(DimensionField, { side: "bottom", label: (0, import_i18n23.__)("Bottom", "elementor") }), /* @__PURE__ */ React47.createElement(DimensionField, { side: "left", label: (0, import_i18n23.__)("Left", "elementor") })));
|
|
1395
|
-
};
|
|
1396
|
-
var DimensionField = ({ side, label }) => {
|
|
1397
|
-
return /* @__PURE__ */ React47.createElement(import_ui36.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React47.createElement(import_ui36.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React47.createElement(ControlLabel, null, label)), /* @__PURE__ */ React47.createElement(import_ui36.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React47.createElement(StylesField, { bind: side }, /* @__PURE__ */ React47.createElement(SizeControl, { startIcon: sideIcons[side] }))));
|
|
1398
|
-
};
|
|
1399
|
-
|
|
1400
|
-
// src/components/style-sections/position-section/position-section.tsx
|
|
1401
|
-
var PositionSection = () => {
|
|
1402
|
-
const [positionValue] = useStylesField("position");
|
|
1403
|
-
const isNotStatic = positionValue && positionValue !== "static";
|
|
1404
|
-
return /* @__PURE__ */ React48.createElement(AccordionSection, { title: (0, import_i18n24.__)("Position", "elementor") }, /* @__PURE__ */ React48.createElement(import_ui37.Stack, { gap: 1.5 }, /* @__PURE__ */ React48.createElement(PositionField, null), isNotStatic ? /* @__PURE__ */ React48.createElement(React48.Fragment, null, /* @__PURE__ */ React48.createElement(DimensionsField, null), /* @__PURE__ */ React48.createElement(ZIndexField, null)) : null));
|
|
1405
|
-
};
|
|
1406
|
-
|
|
1407
|
-
// src/components/style-sections/spacing-section/spacing-section.tsx
|
|
1408
|
-
var React50 = __toESM(require("react"));
|
|
1409
|
-
var import_ui39 = require("@elementor/ui");
|
|
1285
|
+
var import_editor_controls30 = require("@elementor/editor-controls");
|
|
1286
|
+
var import_icons12 = require("@elementor/icons");
|
|
1287
|
+
var import_ui37 = require("@elementor/ui");
|
|
1410
1288
|
var import_i18n26 = require("@wordpress/i18n");
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
const { value, setValue } = useBoundProp();
|
|
1419
|
-
const { top, right, bottom, left, isLinked = true } = value?.value || {};
|
|
1420
|
-
const setLinkedValue = (position, newValue) => {
|
|
1421
|
-
const updatedValue = {
|
|
1422
|
-
isLinked,
|
|
1423
|
-
top: isLinked ? newValue : top,
|
|
1424
|
-
right: isLinked ? newValue : right,
|
|
1425
|
-
bottom: isLinked ? newValue : bottom,
|
|
1426
|
-
left: isLinked ? newValue : left,
|
|
1427
|
-
[position]: newValue
|
|
1428
|
-
};
|
|
1429
|
-
setValue({
|
|
1430
|
-
$$type: "linked-dimensions",
|
|
1431
|
-
value: updatedValue
|
|
1432
|
-
});
|
|
1433
|
-
};
|
|
1434
|
-
const toggleLinked = () => {
|
|
1435
|
-
const updatedValue = {
|
|
1436
|
-
isLinked: !isLinked,
|
|
1437
|
-
top,
|
|
1438
|
-
right: !isLinked ? top : right,
|
|
1439
|
-
bottom: !isLinked ? top : bottom,
|
|
1440
|
-
left: !isLinked ? top : left
|
|
1441
|
-
};
|
|
1442
|
-
setValue({
|
|
1443
|
-
$$type: "linked-dimensions",
|
|
1444
|
-
value: updatedValue
|
|
1445
|
-
});
|
|
1446
|
-
};
|
|
1447
|
-
const LinkedIcon = isLinked ? import_icons11.LinkIcon : import_icons11.DetachIcon;
|
|
1448
|
-
return /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(import_ui38.Stack, { direction: "row", gap: 2 }, /* @__PURE__ */ React49.createElement(ControlLabel, null, label), /* @__PURE__ */ React49.createElement(
|
|
1449
|
-
import_ui38.ToggleButton,
|
|
1450
|
-
{
|
|
1451
|
-
"aria-label": (0, import_i18n25.__)("Link Inputs", "elementor"),
|
|
1452
|
-
size: "tiny",
|
|
1453
|
-
value: "check",
|
|
1454
|
-
selected: isLinked,
|
|
1455
|
-
sx: { marginLeft: "auto" },
|
|
1456
|
-
onChange: toggleLinked
|
|
1457
|
-
},
|
|
1458
|
-
/* @__PURE__ */ React49.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1459
|
-
)), /* @__PURE__ */ React49.createElement(import_ui38.Stack, { direction: "row", gap: 2 }, /* @__PURE__ */ React49.createElement(import_ui38.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React49.createElement(import_ui38.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(ControlLabel, null, (0, import_i18n25.__)("Top", "elementor"))), /* @__PURE__ */ React49.createElement(import_ui38.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(
|
|
1460
|
-
Control5,
|
|
1461
|
-
{
|
|
1462
|
-
bind: "top",
|
|
1463
|
-
value: top,
|
|
1464
|
-
setValue: setLinkedValue,
|
|
1465
|
-
startIcon: /* @__PURE__ */ React49.createElement(import_icons11.SideTopIcon, { fontSize: "tiny" })
|
|
1466
|
-
}
|
|
1467
|
-
))), /* @__PURE__ */ React49.createElement(import_ui38.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React49.createElement(import_ui38.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(ControlLabel, null, (0, import_i18n25.__)("Right", "elementor"))), /* @__PURE__ */ React49.createElement(import_ui38.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(
|
|
1468
|
-
Control5,
|
|
1469
|
-
{
|
|
1470
|
-
bind: "right",
|
|
1471
|
-
value: right,
|
|
1472
|
-
setValue: setLinkedValue,
|
|
1473
|
-
startIcon: /* @__PURE__ */ React49.createElement(import_icons11.SideRightIcon, { fontSize: "tiny" })
|
|
1474
|
-
}
|
|
1475
|
-
)))), /* @__PURE__ */ React49.createElement(import_ui38.Stack, { direction: "row", gap: 2 }, /* @__PURE__ */ React49.createElement(import_ui38.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React49.createElement(import_ui38.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(ControlLabel, null, (0, import_i18n25.__)("Bottom", "elementor"))), /* @__PURE__ */ React49.createElement(import_ui38.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(
|
|
1476
|
-
Control5,
|
|
1477
|
-
{
|
|
1478
|
-
bind: "bottom",
|
|
1479
|
-
value: bottom,
|
|
1480
|
-
setValue: setLinkedValue,
|
|
1481
|
-
startIcon: /* @__PURE__ */ React49.createElement(import_icons11.SideBottomIcon, { fontSize: "tiny" })
|
|
1482
|
-
}
|
|
1483
|
-
))), /* @__PURE__ */ React49.createElement(import_ui38.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React49.createElement(import_ui38.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(ControlLabel, null, (0, import_i18n25.__)("Left", "elementor"))), /* @__PURE__ */ React49.createElement(import_ui38.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(
|
|
1484
|
-
Control5,
|
|
1289
|
+
var buttonSize = "tiny";
|
|
1290
|
+
var TextStyleField = () => {
|
|
1291
|
+
const [fontStyle, setFontStyle] = useStylesField("font-style");
|
|
1292
|
+
const [textDecoration, setTextDecoration] = useStylesField("text-decoration");
|
|
1293
|
+
const formats = [fontStyle, ...(textDecoration || "").split(" ")];
|
|
1294
|
+
return /* @__PURE__ */ React45.createElement(import_ui37.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React45.createElement(import_ui37.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(import_editor_controls30.ControlLabel, null, (0, import_i18n26.__)("Style", "elementor"))), /* @__PURE__ */ React45.createElement(import_ui37.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React45.createElement(import_ui37.ToggleButtonGroup, { value: formats }, /* @__PURE__ */ React45.createElement(
|
|
1295
|
+
ToggleButton,
|
|
1485
1296
|
{
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
}
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
bind,
|
|
1495
|
-
startIcon,
|
|
1496
|
-
value,
|
|
1497
|
-
setValue
|
|
1498
|
-
}) => /* @__PURE__ */ React49.createElement(BoundPropProvider, { setValue: (newValue) => setValue(bind, newValue), value, bind }, /* @__PURE__ */ React49.createElement(SizeControl, { startIcon }));
|
|
1499
|
-
|
|
1500
|
-
// src/components/style-sections/spacing-section/spacing-section.tsx
|
|
1501
|
-
var SpacingSection = () => {
|
|
1502
|
-
return /* @__PURE__ */ React50.createElement(AccordionSection, { title: (0, import_i18n26.__)("Spacing", "elementor") }, /* @__PURE__ */ React50.createElement(import_ui39.Stack, { gap: 1.5 }, /* @__PURE__ */ React50.createElement(StylesField, { bind: "padding" }, /* @__PURE__ */ React50.createElement(LinkedDimensionsControl, { label: (0, import_i18n26.__)("Padding", "elementor") })), /* @__PURE__ */ React50.createElement(import_ui39.Divider, null), /* @__PURE__ */ React50.createElement(StylesField, { bind: "margin" }, /* @__PURE__ */ React50.createElement(LinkedDimensionsControl, { label: (0, import_i18n26.__)("Margin", "elementor") }))));
|
|
1503
|
-
};
|
|
1504
|
-
|
|
1505
|
-
// src/components/style-sections/effects-section/effects-section.tsx
|
|
1506
|
-
var React51 = __toESM(require("react"));
|
|
1507
|
-
var import_i18n27 = require("@wordpress/i18n");
|
|
1508
|
-
var import_ui40 = require("@elementor/ui");
|
|
1509
|
-
var EffectsSection = () => {
|
|
1510
|
-
return /* @__PURE__ */ React51.createElement(AccordionSection, { title: (0, import_i18n27.__)("Effects", "elementor") }, /* @__PURE__ */ React51.createElement(import_ui40.Stack, { gap: 1.5 }, /* @__PURE__ */ React51.createElement(StylesField, { bind: "box-shadow" }, /* @__PURE__ */ React51.createElement(BoxShadowRepeaterControl, null))));
|
|
1511
|
-
};
|
|
1512
|
-
|
|
1513
|
-
// src/components/style-sections/background-section/background-section.tsx
|
|
1514
|
-
var React53 = __toESM(require("react"));
|
|
1515
|
-
var import_i18n29 = require("@wordpress/i18n");
|
|
1516
|
-
var import_ui42 = require("@elementor/ui");
|
|
1517
|
-
|
|
1518
|
-
// src/components/style-sections/background-section/background-color-field.tsx
|
|
1519
|
-
var React52 = __toESM(require("react"));
|
|
1520
|
-
var import_i18n28 = require("@wordpress/i18n");
|
|
1521
|
-
var import_ui41 = require("@elementor/ui");
|
|
1522
|
-
var BackgroundColorField = () => {
|
|
1523
|
-
return /* @__PURE__ */ React52.createElement(StylesField, { bind: "background-color" }, /* @__PURE__ */ React52.createElement(import_ui41.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React52.createElement(import_ui41.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React52.createElement(ControlLabel, null, (0, import_i18n28.__)("Color", "elementor"))), /* @__PURE__ */ React52.createElement(import_ui41.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React52.createElement(ColorControl, null))));
|
|
1524
|
-
};
|
|
1525
|
-
|
|
1526
|
-
// src/components/style-sections/background-section/background-section.tsx
|
|
1527
|
-
var BackgroundSection = () => {
|
|
1528
|
-
return /* @__PURE__ */ React53.createElement(AccordionSection, { title: (0, import_i18n29.__)("Background", "elementor") }, /* @__PURE__ */ React53.createElement(import_ui42.Stack, { gap: 1.5 }, /* @__PURE__ */ React53.createElement(BackgroundColorField, null)));
|
|
1529
|
-
};
|
|
1530
|
-
|
|
1531
|
-
// src/components/style-sections/border-section/border-section.tsx
|
|
1532
|
-
var React61 = __toESM(require("react"));
|
|
1533
|
-
var import_ui47 = require("@elementor/ui");
|
|
1534
|
-
var import_i18n36 = require("@wordpress/i18n");
|
|
1535
|
-
|
|
1536
|
-
// src/components/style-sections/border-section/border-radius-field.tsx
|
|
1537
|
-
var React55 = __toESM(require("react"));
|
|
1538
|
-
var import_i18n31 = require("@wordpress/i18n");
|
|
1539
|
-
var import_icons12 = require("@elementor/icons");
|
|
1540
|
-
|
|
1541
|
-
// src/controls/controls/equal-unequal-sizes-control.tsx
|
|
1542
|
-
var React54 = __toESM(require("react"));
|
|
1543
|
-
var import_react13 = require("react");
|
|
1544
|
-
var import_ui43 = require("@elementor/ui");
|
|
1545
|
-
var import_i18n30 = require("@wordpress/i18n");
|
|
1546
|
-
function hasMixedSizes(values) {
|
|
1547
|
-
const [firstValue, ...restValues] = values;
|
|
1548
|
-
return restValues.some(
|
|
1549
|
-
(value) => value?.value?.size !== firstValue?.value?.size || value?.value?.unit !== firstValue?.value?.unit
|
|
1550
|
-
);
|
|
1551
|
-
}
|
|
1552
|
-
function EqualUnequalSizesControl({ label, icon, items, multiSizeType }) {
|
|
1553
|
-
const popupId = (0, import_react13.useId)();
|
|
1554
|
-
const controlRef = (0, import_react13.useRef)(null);
|
|
1555
|
-
const { value: controlValue, setValue: setControlValue } = useBoundProp();
|
|
1556
|
-
const actualValue = controlValue?.value ?? {};
|
|
1557
|
-
const setActualValue = (newValue) => {
|
|
1558
|
-
setControlValue({ $$type: multiSizeType, value: newValue });
|
|
1559
|
-
};
|
|
1560
|
-
const setNestedProp = (item, newValue) => {
|
|
1561
|
-
const { bind } = item;
|
|
1562
|
-
const newValues = {
|
|
1563
|
-
...actualValue,
|
|
1564
|
-
[bind]: newValue
|
|
1565
|
-
};
|
|
1566
|
-
setActualValue(newValues);
|
|
1567
|
-
};
|
|
1568
|
-
const setEqualValues = (newValue) => {
|
|
1569
|
-
const equalValues = items.reduce((values, item) => {
|
|
1570
|
-
return {
|
|
1571
|
-
...values,
|
|
1572
|
-
[item.bind]: newValue
|
|
1573
|
-
};
|
|
1574
|
-
}, {});
|
|
1575
|
-
setActualValue(equalValues);
|
|
1576
|
-
};
|
|
1577
|
-
const popupState = (0, import_ui43.usePopupState)({
|
|
1578
|
-
variant: "popover",
|
|
1579
|
-
popupId
|
|
1580
|
-
});
|
|
1581
|
-
return /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(import_ui43.Grid, { container: true, alignItems: "center", ref: controlRef }, /* @__PURE__ */ React54.createElement(import_ui43.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(ControlLabel, null, label)), /* @__PURE__ */ React54.createElement(import_ui43.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(
|
|
1582
|
-
EqualValuesControl,
|
|
1297
|
+
value: "italic",
|
|
1298
|
+
onChange: (v) => setFontStyle(fontStyle === v ? null : v),
|
|
1299
|
+
"aria-label": "italic",
|
|
1300
|
+
sx: { marginLeft: "auto" }
|
|
1301
|
+
},
|
|
1302
|
+
/* @__PURE__ */ React45.createElement(import_icons12.ItalicIcon, { fontSize: buttonSize })
|
|
1303
|
+
), /* @__PURE__ */ React45.createElement(
|
|
1304
|
+
ShorthandControl,
|
|
1583
1305
|
{
|
|
1584
|
-
value:
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
...(0, import_ui43.bindToggle)(popupState),
|
|
1593
|
-
selected: popupState.isOpen
|
|
1594
|
-
},
|
|
1595
|
-
icon
|
|
1596
|
-
)
|
|
1597
|
-
}
|
|
1598
|
-
))), /* @__PURE__ */ React54.createElement(
|
|
1599
|
-
import_ui43.Popover,
|
|
1306
|
+
value: "line-through",
|
|
1307
|
+
currentValues: textDecoration || "",
|
|
1308
|
+
updateValues: setTextDecoration,
|
|
1309
|
+
"aria-label": "line-through"
|
|
1310
|
+
},
|
|
1311
|
+
/* @__PURE__ */ React45.createElement(import_icons12.StrikethroughIcon, { fontSize: buttonSize })
|
|
1312
|
+
), /* @__PURE__ */ React45.createElement(
|
|
1313
|
+
ShorthandControl,
|
|
1600
1314
|
{
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
horizontal: "right"
|
|
1606
|
-
},
|
|
1607
|
-
transformOrigin: {
|
|
1608
|
-
vertical: "top",
|
|
1609
|
-
horizontal: "right"
|
|
1610
|
-
},
|
|
1611
|
-
...(0, import_ui43.bindPopover)(popupState),
|
|
1612
|
-
slotProps: {
|
|
1613
|
-
paper: { sx: { mt: 0.5, p: 2, pt: 1, width: controlRef.current?.getBoundingClientRect().width } }
|
|
1614
|
-
}
|
|
1315
|
+
value: "underline",
|
|
1316
|
+
currentValues: textDecoration || "",
|
|
1317
|
+
updateValues: setTextDecoration,
|
|
1318
|
+
"aria-label": "underline"
|
|
1615
1319
|
},
|
|
1616
|
-
/* @__PURE__ */
|
|
1617
|
-
));
|
|
1618
|
-
}
|
|
1619
|
-
var NestedValueControl = ({
|
|
1620
|
-
item,
|
|
1621
|
-
value,
|
|
1622
|
-
setNestedProp
|
|
1623
|
-
}) => {
|
|
1624
|
-
const { bind } = item;
|
|
1625
|
-
const nestedValue = value?.[bind] ? value[bind] : void 0;
|
|
1626
|
-
return /* @__PURE__ */ React54.createElement(BoundPropProvider, { bind: "", setValue: (val) => setNestedProp(item, val), value: nestedValue }, /* @__PURE__ */ React54.createElement(import_ui43.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(import_ui43.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React54.createElement(import_ui43.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React54.createElement(ControlLabel, null, item.label)), /* @__PURE__ */ React54.createElement(import_ui43.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React54.createElement(SizeControl, { startIcon: item.icon })))));
|
|
1320
|
+
/* @__PURE__ */ React45.createElement(import_icons12.UnderlineIcon, { fontSize: buttonSize })
|
|
1321
|
+
))));
|
|
1627
1322
|
};
|
|
1628
|
-
var
|
|
1323
|
+
var ShorthandControl = ({
|
|
1324
|
+
children,
|
|
1629
1325
|
value,
|
|
1630
|
-
|
|
1631
|
-
|
|
1326
|
+
currentValues,
|
|
1327
|
+
updateValues,
|
|
1328
|
+
"aria-label": ariaLabel
|
|
1632
1329
|
}) => {
|
|
1633
|
-
const
|
|
1634
|
-
const
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
value: isMixed ? void 0 : values[0]
|
|
1641
|
-
},
|
|
1642
|
-
/* @__PURE__ */ React54.createElement(import_ui43.Stack, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React54.createElement(SizeControl, { placeholder: (0, import_i18n30.__)("MIXED", "elementor") }), iconButton)
|
|
1643
|
-
);
|
|
1644
|
-
};
|
|
1645
|
-
|
|
1646
|
-
// src/components/style-sections/border-section/border-radius-field.tsx
|
|
1647
|
-
var corners = [
|
|
1648
|
-
{
|
|
1649
|
-
label: (0, import_i18n31.__)("Top Left", "elementor"),
|
|
1650
|
-
icon: /* @__PURE__ */ React55.createElement(import_icons12.RadiusTopLeftIcon, { fontSize: "tiny" }),
|
|
1651
|
-
bind: "top-left"
|
|
1652
|
-
},
|
|
1653
|
-
{
|
|
1654
|
-
label: (0, import_i18n31.__)("Top Right", "elementor"),
|
|
1655
|
-
icon: /* @__PURE__ */ React55.createElement(import_icons12.RadiusTopRightIcon, { fontSize: "tiny" }),
|
|
1656
|
-
bind: "top-right"
|
|
1657
|
-
},
|
|
1658
|
-
{
|
|
1659
|
-
label: (0, import_i18n31.__)("Bottom Right", "elementor"),
|
|
1660
|
-
icon: /* @__PURE__ */ React55.createElement(import_icons12.RadiusBottomRightIcon, { fontSize: "tiny" }),
|
|
1661
|
-
bind: "bottom-right"
|
|
1662
|
-
},
|
|
1663
|
-
{
|
|
1664
|
-
label: (0, import_i18n31.__)("Bottom Left", "elementor"),
|
|
1665
|
-
icon: /* @__PURE__ */ React55.createElement(import_icons12.RadiusBottomLeftIcon, { fontSize: "tiny" }),
|
|
1666
|
-
bind: "bottom-left"
|
|
1667
|
-
}
|
|
1668
|
-
];
|
|
1669
|
-
var BorderRadiusField = () => {
|
|
1670
|
-
return /* @__PURE__ */ React55.createElement(StylesField, { bind: "border-radius" }, /* @__PURE__ */ React55.createElement(
|
|
1671
|
-
EqualUnequalSizesControl,
|
|
1672
|
-
{
|
|
1673
|
-
label: (0, import_i18n31.__)("Border Radius", "elementor"),
|
|
1674
|
-
icon: /* @__PURE__ */ React55.createElement(import_icons12.BorderCornersIcon, { fontSize: "tiny" }),
|
|
1675
|
-
items: corners,
|
|
1676
|
-
multiSizeType: "border-radius"
|
|
1330
|
+
const valuesArr = currentValues.split(" ").filter(Boolean);
|
|
1331
|
+
const selected = valuesArr.includes(value);
|
|
1332
|
+
const toggleValue = (newValue) => {
|
|
1333
|
+
if (selected) {
|
|
1334
|
+
updateValues(valuesArr.filter((v) => v !== newValue).join(" ") || null);
|
|
1335
|
+
} else {
|
|
1336
|
+
updateValues([...valuesArr, newValue].join(" "));
|
|
1677
1337
|
}
|
|
1678
|
-
|
|
1338
|
+
};
|
|
1339
|
+
return /* @__PURE__ */ React45.createElement(ToggleButton, { value, onChange: toggleValue, selected, "aria-label": ariaLabel }, children);
|
|
1340
|
+
};
|
|
1341
|
+
var ToggleButton = ({ onChange, ...props }) => {
|
|
1342
|
+
const handleChange = (_e, newValue) => {
|
|
1343
|
+
onChange(newValue);
|
|
1344
|
+
};
|
|
1345
|
+
return /* @__PURE__ */ React45.createElement(import_ui37.ToggleButton, { ...props, onChange: handleChange, size: buttonSize });
|
|
1679
1346
|
};
|
|
1680
1347
|
|
|
1681
|
-
// src/components/style-sections/
|
|
1682
|
-
var
|
|
1683
|
-
var
|
|
1684
|
-
|
|
1685
|
-
// src/components/style-sections/border-section/border-width-field.tsx
|
|
1686
|
-
var React56 = __toESM(require("react"));
|
|
1348
|
+
// src/components/style-sections/typography-section/transform-field.tsx
|
|
1349
|
+
var React46 = __toESM(require("react"));
|
|
1350
|
+
var import_editor_controls31 = require("@elementor/editor-controls");
|
|
1687
1351
|
var import_icons13 = require("@elementor/icons");
|
|
1688
|
-
var
|
|
1689
|
-
var
|
|
1690
|
-
|
|
1691
|
-
label: (0, import_i18n32.__)("Top", "elementor"),
|
|
1692
|
-
icon: /* @__PURE__ */ React56.createElement(import_icons13.SideTopIcon, { fontSize: "tiny" }),
|
|
1693
|
-
bind: "top"
|
|
1694
|
-
},
|
|
1352
|
+
var import_ui38 = require("@elementor/ui");
|
|
1353
|
+
var import_i18n27 = require("@wordpress/i18n");
|
|
1354
|
+
var options4 = [
|
|
1695
1355
|
{
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1356
|
+
value: "capitalize",
|
|
1357
|
+
label: (0, import_i18n27.__)("Capitalize", "elementor"),
|
|
1358
|
+
renderContent: ({ size }) => /* @__PURE__ */ React46.createElement(import_icons13.LetterCaseIcon, { fontSize: size })
|
|
1699
1359
|
},
|
|
1700
1360
|
{
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1361
|
+
value: "uppercase",
|
|
1362
|
+
label: (0, import_i18n27.__)("Uppercase", "elementor"),
|
|
1363
|
+
renderContent: ({ size }) => /* @__PURE__ */ React46.createElement(import_icons13.LetterCaseUpperIcon, { fontSize: size })
|
|
1704
1364
|
},
|
|
1705
1365
|
{
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1366
|
+
value: "lowercase",
|
|
1367
|
+
label: (0, import_i18n27.__)("Lowercase", "elementor"),
|
|
1368
|
+
renderContent: ({ size }) => /* @__PURE__ */ React46.createElement(import_icons13.LetterCaseLowerIcon, { fontSize: size })
|
|
1709
1369
|
}
|
|
1710
1370
|
];
|
|
1711
|
-
var
|
|
1712
|
-
return /* @__PURE__ */ React56.createElement(StylesField, { bind: "border-width" }, /* @__PURE__ */ React56.createElement(
|
|
1713
|
-
EqualUnequalSizesControl,
|
|
1714
|
-
{
|
|
1715
|
-
label: (0, import_i18n32.__)("Border Width", "elementor"),
|
|
1716
|
-
icon: /* @__PURE__ */ React56.createElement(import_icons13.SideAllIcon, { fontSize: "tiny" }),
|
|
1717
|
-
items: edges,
|
|
1718
|
-
multiSizeType: "border-width"
|
|
1719
|
-
}
|
|
1720
|
-
));
|
|
1721
|
-
};
|
|
1722
|
-
|
|
1723
|
-
// src/components/style-sections/border-section/border-color-field.tsx
|
|
1724
|
-
var React57 = __toESM(require("react"));
|
|
1725
|
-
var import_i18n33 = require("@wordpress/i18n");
|
|
1726
|
-
var import_ui44 = require("@elementor/ui");
|
|
1727
|
-
var BorderColorField = () => {
|
|
1728
|
-
return /* @__PURE__ */ React57.createElement(StylesField, { bind: "border-color" }, /* @__PURE__ */ React57.createElement(import_ui44.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React57.createElement(import_ui44.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(ControlLabel, null, (0, import_i18n33.__)("Border Color", "elementor"))), /* @__PURE__ */ React57.createElement(import_ui44.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(ColorControl, null))));
|
|
1729
|
-
};
|
|
1730
|
-
|
|
1731
|
-
// src/components/style-sections/border-section/border-style-field.tsx
|
|
1732
|
-
var React58 = __toESM(require("react"));
|
|
1733
|
-
var import_i18n34 = require("@wordpress/i18n");
|
|
1734
|
-
var import_ui45 = require("@elementor/ui");
|
|
1735
|
-
var borderStyles = [
|
|
1736
|
-
{ value: "none", label: (0, import_i18n34.__)("None", "elementor") },
|
|
1737
|
-
{ value: "solid", label: (0, import_i18n34.__)("Solid", "elementor") },
|
|
1738
|
-
{ value: "dashed", label: (0, import_i18n34.__)("Dashed", "elementor") },
|
|
1739
|
-
{ value: "dotted", label: (0, import_i18n34.__)("Dotted", "elementor") },
|
|
1740
|
-
{ value: "double", label: (0, import_i18n34.__)("Double", "elementor") },
|
|
1741
|
-
{ value: "groove", label: (0, import_i18n34.__)("Groove", "elementor") },
|
|
1742
|
-
{ value: "ridge", label: (0, import_i18n34.__)("Ridge", "elementor") },
|
|
1743
|
-
{ value: "inset", label: (0, import_i18n34.__)("Inset", "elementor") },
|
|
1744
|
-
{ value: "outset", label: (0, import_i18n34.__)("Outset", "elementor") }
|
|
1745
|
-
];
|
|
1746
|
-
var BorderStyleField = () => {
|
|
1747
|
-
return /* @__PURE__ */ React58.createElement(StylesField, { bind: "border-style" }, /* @__PURE__ */ React58.createElement(import_ui45.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React58.createElement(import_ui45.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React58.createElement(ControlLabel, null, (0, import_i18n34.__)("Border Type", "elementor"))), /* @__PURE__ */ React58.createElement(import_ui45.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React58.createElement(SelectControl, { options: borderStyles }))));
|
|
1748
|
-
};
|
|
1371
|
+
var TransformField = () => /* @__PURE__ */ React46.createElement(StylesField, { bind: "text-transform" }, /* @__PURE__ */ React46.createElement(import_ui38.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React46.createElement(import_ui38.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(import_editor_controls31.ControlLabel, null, (0, import_i18n27.__)("Transform", "elementor"))), /* @__PURE__ */ React46.createElement(import_ui38.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React46.createElement(import_editor_controls31.ToggleControl, { options: options4 }))));
|
|
1749
1372
|
|
|
1750
|
-
// src/components/
|
|
1751
|
-
var
|
|
1752
|
-
var
|
|
1753
|
-
var
|
|
1754
|
-
var
|
|
1755
|
-
var
|
|
1756
|
-
return /* @__PURE__ */
|
|
1757
|
-
import_ui46.Stack,
|
|
1758
|
-
{
|
|
1759
|
-
direction: "row",
|
|
1760
|
-
sx: {
|
|
1761
|
-
justifyContent: "space-between",
|
|
1762
|
-
alignItems: "center"
|
|
1763
|
-
}
|
|
1764
|
-
},
|
|
1765
|
-
/* @__PURE__ */ React59.createElement(ControlLabel, null, label),
|
|
1766
|
-
isAdded ? /* @__PURE__ */ React59.createElement(import_ui46.IconButton, { size: SIZE2, onClick: onRemove }, /* @__PURE__ */ React59.createElement(import_icons14.MinusIcon, { fontSize: SIZE2 })) : /* @__PURE__ */ React59.createElement(import_ui46.IconButton, { size: SIZE2, onClick: onAdd }, /* @__PURE__ */ React59.createElement(import_icons14.PlusIcon, { fontSize: SIZE2 }))
|
|
1767
|
-
), /* @__PURE__ */ React59.createElement(import_ui46.Collapse, { in: isAdded }, /* @__PURE__ */ React59.createElement(import_ui46.Stack, { gap: 1.5 }, children)));
|
|
1373
|
+
// src/components/style-sections/typography-section/word-spacing-field.tsx
|
|
1374
|
+
var React47 = __toESM(require("react"));
|
|
1375
|
+
var import_editor_controls32 = require("@elementor/editor-controls");
|
|
1376
|
+
var import_ui39 = require("@elementor/ui");
|
|
1377
|
+
var import_i18n28 = require("@wordpress/i18n");
|
|
1378
|
+
var WordSpacingField = () => {
|
|
1379
|
+
return /* @__PURE__ */ React47.createElement(StylesField, { bind: "word-spacing" }, /* @__PURE__ */ React47.createElement(import_ui39.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React47.createElement(import_ui39.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(import_editor_controls32.ControlLabel, null, (0, import_i18n28.__)("Word Spacing", "elementor"))), /* @__PURE__ */ React47.createElement(import_ui39.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(import_editor_controls32.SizeControl, null))));
|
|
1768
1380
|
};
|
|
1769
1381
|
|
|
1770
|
-
// src/components/style-sections/
|
|
1771
|
-
var
|
|
1772
|
-
|
|
1773
|
-
$$type: "border-width",
|
|
1774
|
-
value: { top: initialSize, right: initialSize, bottom: initialSize, left: initialSize }
|
|
1775
|
-
};
|
|
1776
|
-
var initialBorderColor = { $$type: "color", value: "#000000" };
|
|
1777
|
-
var initialBorderStyle = "solid";
|
|
1778
|
-
var BorderField = () => {
|
|
1779
|
-
const [borderWidth, setBorderWidth] = useStylesField("border-width");
|
|
1780
|
-
const [borderColor, setBorderColor] = useStylesField("border-color");
|
|
1781
|
-
const [borderStyle, setBorderStyle] = useStylesField("border-style");
|
|
1782
|
-
const addBorder = () => {
|
|
1783
|
-
setBorderWidth(initialBorderWidth);
|
|
1784
|
-
setBorderColor(initialBorderColor);
|
|
1785
|
-
setBorderStyle(initialBorderStyle);
|
|
1786
|
-
};
|
|
1787
|
-
const removeBorder = () => {
|
|
1788
|
-
setBorderWidth(null);
|
|
1789
|
-
setBorderColor(null);
|
|
1790
|
-
setBorderStyle(null);
|
|
1791
|
-
};
|
|
1792
|
-
const hasBorder = Boolean(borderWidth || borderColor || borderStyle);
|
|
1793
|
-
return /* @__PURE__ */ React60.createElement(
|
|
1794
|
-
AddOrRemoveContent,
|
|
1795
|
-
{
|
|
1796
|
-
label: (0, import_i18n35.__)("Border", "elementor"),
|
|
1797
|
-
isAdded: hasBorder,
|
|
1798
|
-
onAdd: addBorder,
|
|
1799
|
-
onRemove: removeBorder
|
|
1800
|
-
},
|
|
1801
|
-
/* @__PURE__ */ React60.createElement(BorderWidthField, null),
|
|
1802
|
-
/* @__PURE__ */ React60.createElement(BorderColorField, null),
|
|
1803
|
-
/* @__PURE__ */ React60.createElement(BorderStyleField, null)
|
|
1804
|
-
);
|
|
1382
|
+
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1383
|
+
var TypographySection = () => {
|
|
1384
|
+
return /* @__PURE__ */ React48.createElement(import_ui40.Stack, { gap: 1.5 }, /* @__PURE__ */ React48.createElement(FontFamilyField, null), /* @__PURE__ */ React48.createElement(FontWeightField, null), /* @__PURE__ */ React48.createElement(FontSizeField, null), /* @__PURE__ */ React48.createElement(import_ui40.Divider, null), /* @__PURE__ */ React48.createElement(TextColorField, null), /* @__PURE__ */ React48.createElement(CollapsibleContent, null, /* @__PURE__ */ React48.createElement(import_ui40.Stack, { gap: 1.5, sx: { pt: 1.5 } }, /* @__PURE__ */ React48.createElement(LetterSpacingField, null), /* @__PURE__ */ React48.createElement(WordSpacingField, null), /* @__PURE__ */ React48.createElement(import_ui40.Divider, null), /* @__PURE__ */ React48.createElement(TextAlignmentField, null), /* @__PURE__ */ React48.createElement(TextStyleField, null), /* @__PURE__ */ React48.createElement(TransformField, null), /* @__PURE__ */ React48.createElement(TextDirectionField, null), /* @__PURE__ */ React48.createElement(TextStrokeField, null))));
|
|
1805
1385
|
};
|
|
1806
1386
|
|
|
1807
|
-
// src/components/style-sections/border-section/border-section.tsx
|
|
1808
|
-
var BorderSection = () => /* @__PURE__ */ React61.createElement(AccordionSection, { title: (0, import_i18n36.__)("Border", "elementor") }, /* @__PURE__ */ React61.createElement(import_ui47.Stack, { gap: 1.5 }, /* @__PURE__ */ React61.createElement(BorderRadiusField, null), /* @__PURE__ */ React61.createElement(import_ui47.Divider, null), /* @__PURE__ */ React61.createElement(BorderField, null)));
|
|
1809
|
-
|
|
1810
1387
|
// src/components/style-tab.tsx
|
|
1811
1388
|
var CLASSES_PROP_KEY = "classes";
|
|
1812
1389
|
var StyleTab = () => {
|
|
1813
1390
|
const currentClassesProp = useCurrentClassesProp();
|
|
1814
|
-
const [
|
|
1391
|
+
const [activeStyleDefId, setActiveStyleDefId] = useActiveStyleDefId(currentClassesProp);
|
|
1815
1392
|
const breakpoint = (0, import_editor_responsive.useActiveBreakpoint)();
|
|
1816
|
-
return /* @__PURE__ */
|
|
1393
|
+
return /* @__PURE__ */ React49.createElement(ClassesPropProvider, { prop: currentClassesProp }, /* @__PURE__ */ React49.createElement(StyleProvider, { meta: { breakpoint, state: null }, id: activeStyleDefId, setId: setActiveStyleDefId }, /* @__PURE__ */ React49.createElement(CssClassSelectorSection, null), /* @__PURE__ */ React49.createElement(import_ui41.Divider, null), /* @__PURE__ */ React49.createElement(SectionsList, null, /* @__PURE__ */ React49.createElement(Section, { title: (0, import_i18n29.__)("Layout", "elementor") }, /* @__PURE__ */ React49.createElement(LayoutSection, null)), /* @__PURE__ */ React49.createElement(Section, { title: (0, import_i18n29.__)("Spacing", "elementor") }, /* @__PURE__ */ React49.createElement(SpacingSection, null)), /* @__PURE__ */ React49.createElement(Section, { title: (0, import_i18n29.__)("Size", "elementor") }, /* @__PURE__ */ React49.createElement(SizeSection, null)), /* @__PURE__ */ React49.createElement(Section, { title: (0, import_i18n29.__)("Position", "elementor") }, /* @__PURE__ */ React49.createElement(PositionSection, null)), /* @__PURE__ */ React49.createElement(Section, { title: (0, import_i18n29.__)("Typography", "elementor") }, /* @__PURE__ */ React49.createElement(TypographySection, null)), /* @__PURE__ */ React49.createElement(Section, { title: (0, import_i18n29.__)("Background", "elementor") }, /* @__PURE__ */ React49.createElement(BackgroundSection, null)), /* @__PURE__ */ React49.createElement(Section, { title: (0, import_i18n29.__)("Border", "elementor") }, /* @__PURE__ */ React49.createElement(BorderSection, null)), /* @__PURE__ */ React49.createElement(Section, { title: (0, import_i18n29.__)("Effects", "elementor") }, /* @__PURE__ */ React49.createElement(EffectsSection, null)))));
|
|
1817
1394
|
};
|
|
1818
|
-
function
|
|
1395
|
+
function useActiveStyleDefId(currentClassesProp) {
|
|
1396
|
+
const [activeStyledDefId, setActiveStyledDefId] = (0, import_react12.useState)(null);
|
|
1397
|
+
const fallback = useFirstElementStyleDef(currentClassesProp);
|
|
1398
|
+
const newId = useGeneratedId();
|
|
1399
|
+
return [activeStyledDefId || fallback?.id || newId, setActiveStyledDefId];
|
|
1400
|
+
}
|
|
1401
|
+
function useFirstElementStyleDef(currentClassesProp) {
|
|
1819
1402
|
const { element } = useElement();
|
|
1820
|
-
const
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1403
|
+
const classesIds = (0, import_editor_elements5.useElementSetting)(element.id, currentClassesProp)?.value || [];
|
|
1404
|
+
const stylesDefs = (0, import_editor_elements5.useElementStyles)(element.id);
|
|
1405
|
+
return Object.values(stylesDefs).find((styleDef) => classesIds.includes(styleDef.id));
|
|
1406
|
+
}
|
|
1407
|
+
function useGeneratedId() {
|
|
1408
|
+
const { element } = useElement();
|
|
1409
|
+
const stylesDefs = (0, import_editor_elements5.useElementStyles)(element.id);
|
|
1410
|
+
return (0, import_editor_styles.generateId)(`e-${element.id}-`, Object.keys(stylesDefs));
|
|
1826
1411
|
}
|
|
1827
1412
|
function useCurrentClassesProp() {
|
|
1828
1413
|
const { elementType } = useElement();
|
|
@@ -1837,73 +1422,26 @@ function useCurrentClassesProp() {
|
|
|
1837
1422
|
|
|
1838
1423
|
// src/components/editing-panel-tabs.tsx
|
|
1839
1424
|
var EditingPanelTabs = () => {
|
|
1840
|
-
const {
|
|
1841
|
-
|
|
1425
|
+
const { element } = useElement();
|
|
1426
|
+
const { getTabProps, getTabPanelProps, getTabsProps } = (0, import_ui42.useTabs)("settings");
|
|
1427
|
+
return (
|
|
1428
|
+
// When switching between elements, the local states should be reset. We are using key to rerender the tabs.
|
|
1429
|
+
// Reference: https://react.dev/learn/preserving-and-resetting-state#resetting-a-form-with-a-key
|
|
1430
|
+
/* @__PURE__ */ React50.createElement(import_react13.Fragment, { key: element.id }, /* @__PURE__ */ React50.createElement(import_ui42.Stack, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React50.createElement(import_ui42.Tabs, { variant: "fullWidth", indicatorColor: "secondary", textColor: "inherit", ...getTabsProps() }, /* @__PURE__ */ React50.createElement(import_ui42.Tab, { label: (0, import_i18n30.__)("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React50.createElement(import_ui42.Tab, { label: (0, import_i18n30.__)("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React50.createElement(import_ui42.Divider, null), /* @__PURE__ */ React50.createElement(import_ui42.TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React50.createElement(SettingsTab, null)), /* @__PURE__ */ React50.createElement(import_ui42.TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React50.createElement(StyleTab, null))))
|
|
1431
|
+
);
|
|
1842
1432
|
};
|
|
1843
1433
|
|
|
1844
1434
|
// src/components/editing-panel.tsx
|
|
1845
|
-
var
|
|
1846
|
-
|
|
1847
|
-
// src/components/editing-panel-error-fallback.tsx
|
|
1848
|
-
var React64 = __toESM(require("react"));
|
|
1849
|
-
var import_ui50 = require("@elementor/ui");
|
|
1850
|
-
function EditorPanelErrorFallback() {
|
|
1851
|
-
return /* @__PURE__ */ React64.createElement(import_ui50.Box, { role: "alert", sx: { minHeight: "100%", p: 2 } }, /* @__PURE__ */ React64.createElement(import_ui50.Alert, { severity: "error", sx: { mb: 2, maxWidth: 400, textAlign: "center" } }, /* @__PURE__ */ React64.createElement("strong", null, "Something went wrong")));
|
|
1852
|
-
}
|
|
1853
|
-
|
|
1854
|
-
// src/popover-action.tsx
|
|
1855
|
-
var React65 = __toESM(require("react"));
|
|
1856
|
-
var import_react15 = require("react");
|
|
1857
|
-
var import_icons15 = require("@elementor/icons");
|
|
1858
|
-
var import_ui51 = require("@elementor/ui");
|
|
1859
|
-
var SIZE3 = "tiny";
|
|
1860
|
-
function PopoverAction({
|
|
1861
|
-
title,
|
|
1862
|
-
visible = true,
|
|
1863
|
-
icon: Icon,
|
|
1864
|
-
popoverContent: PopoverContent
|
|
1865
|
-
}) {
|
|
1866
|
-
const id = (0, import_react15.useId)();
|
|
1867
|
-
const popupState = (0, import_ui51.usePopupState)({
|
|
1868
|
-
variant: "popover",
|
|
1869
|
-
popupId: `elementor-popover-action-${id}`
|
|
1870
|
-
});
|
|
1871
|
-
if (!visible) {
|
|
1872
|
-
return null;
|
|
1873
|
-
}
|
|
1874
|
-
return /* @__PURE__ */ React65.createElement(React65.Fragment, null, /* @__PURE__ */ React65.createElement(import_ui51.Tooltip, { placement: "top", title }, /* @__PURE__ */ React65.createElement(import_ui51.IconButton, { "aria-label": title, key: id, size: SIZE3, ...(0, import_ui51.bindToggle)(popupState) }, /* @__PURE__ */ React65.createElement(Icon, { fontSize: SIZE3 }))), /* @__PURE__ */ React65.createElement(
|
|
1875
|
-
import_ui51.Popover,
|
|
1876
|
-
{
|
|
1877
|
-
disablePortal: true,
|
|
1878
|
-
disableScrollLock: true,
|
|
1879
|
-
anchorOrigin: {
|
|
1880
|
-
vertical: "bottom",
|
|
1881
|
-
horizontal: "center"
|
|
1882
|
-
},
|
|
1883
|
-
...(0, import_ui51.bindPopover)(popupState)
|
|
1884
|
-
},
|
|
1885
|
-
/* @__PURE__ */ React65.createElement(import_ui51.Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React65.createElement(Icon, { fontSize: SIZE3, sx: { mr: 0.5 } }), /* @__PURE__ */ React65.createElement(import_ui51.Typography, { variant: "subtitle2" }, title), /* @__PURE__ */ React65.createElement(import_ui51.IconButton, { sx: { ml: "auto" }, size: SIZE3, onClick: popupState.close }, /* @__PURE__ */ React65.createElement(import_icons15.XIcon, { fontSize: SIZE3 }))),
|
|
1886
|
-
/* @__PURE__ */ React65.createElement(PopoverContent, { closePopover: popupState.close })
|
|
1887
|
-
));
|
|
1888
|
-
}
|
|
1889
|
-
|
|
1890
|
-
// src/controls-actions.ts
|
|
1891
|
-
var { useMenuItems, registerPopoverAction } = createControlActionsMenu({
|
|
1892
|
-
components: {
|
|
1893
|
-
PopoverAction
|
|
1894
|
-
}
|
|
1895
|
-
});
|
|
1896
|
-
|
|
1897
|
-
// src/components/editing-panel.tsx
|
|
1435
|
+
var { useMenuItems } = controlActionsMenu;
|
|
1898
1436
|
var EditingPanel = () => {
|
|
1899
|
-
const { element, elementType } = (0,
|
|
1437
|
+
const { element, elementType } = (0, import_editor_elements6.useSelectedElement)();
|
|
1900
1438
|
const controlReplacement = getControlReplacement();
|
|
1901
1439
|
const menuItems = useMenuItems().default;
|
|
1902
1440
|
if (!element || !elementType) {
|
|
1903
1441
|
return null;
|
|
1904
1442
|
}
|
|
1905
|
-
const panelTitle = (0,
|
|
1906
|
-
return /* @__PURE__ */
|
|
1443
|
+
const panelTitle = (0, import_i18n31.__)("Edit %s", "elementor").replace("%s", elementType.title);
|
|
1444
|
+
return /* @__PURE__ */ React51.createElement(import_ui43.ErrorBoundary, { fallback: /* @__PURE__ */ React51.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React51.createElement(import_editor_panels.Panel, null, /* @__PURE__ */ React51.createElement(import_editor_panels.PanelHeader, null, /* @__PURE__ */ React51.createElement(import_editor_panels.PanelHeaderTitle, null, panelTitle)), /* @__PURE__ */ React51.createElement(import_editor_panels.PanelBody, null, /* @__PURE__ */ React51.createElement(import_editor_controls33.ControlActionsProvider, { items: menuItems }, /* @__PURE__ */ React51.createElement(import_editor_controls33.ControlReplacementProvider, { ...controlReplacement }, /* @__PURE__ */ React51.createElement(ElementProvider, { element, elementType }, /* @__PURE__ */ React51.createElement(EditingPanelTabs, null)))))));
|
|
1907
1445
|
};
|
|
1908
1446
|
|
|
1909
1447
|
// src/panel.ts
|
|
@@ -1912,28 +1450,40 @@ var { panel, usePanelActions, usePanelStatus } = (0, import_editor_panels2.__cre
|
|
|
1912
1450
|
component: EditingPanel
|
|
1913
1451
|
});
|
|
1914
1452
|
|
|
1915
|
-
// src/
|
|
1916
|
-
var
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
var shouldUseV2Panel = () => {
|
|
1921
|
-
const selectedElements = (0, import_editor_elements5.getSelectedElements)();
|
|
1922
|
-
const widgetCache = (0, import_editor_elements5.getWidgetsCache)();
|
|
1453
|
+
// src/sync/is-atomic-widget-selected.ts
|
|
1454
|
+
var import_editor_elements7 = require("@elementor/editor-elements");
|
|
1455
|
+
var isAtomicWidgetSelected = () => {
|
|
1456
|
+
const selectedElements = (0, import_editor_elements7.getSelectedElements)();
|
|
1457
|
+
const widgetCache = (0, import_editor_elements7.getWidgetsCache)();
|
|
1923
1458
|
if (selectedElements.length !== 1) {
|
|
1924
1459
|
return false;
|
|
1925
1460
|
}
|
|
1926
1461
|
return !!widgetCache?.[selectedElements[0].type]?.atomic_controls;
|
|
1927
1462
|
};
|
|
1928
1463
|
|
|
1464
|
+
// src/hooks/use-close-editor-panel.ts
|
|
1465
|
+
var useCloseEditorPanel = () => {
|
|
1466
|
+
const { close } = usePanelActions();
|
|
1467
|
+
return (0, import_react14.useEffect)(() => {
|
|
1468
|
+
return (0, import_editor_v1_adapters.__privateListenTo)((0, import_editor_v1_adapters.commandStartEvent)("document/elements/delete"), (e) => {
|
|
1469
|
+
const selectedElement = (0, import_editor_elements8.getSelectedElements)()[0];
|
|
1470
|
+
const { container: deletedContainer } = e?.args;
|
|
1471
|
+
const isSelectedElementInDeletedContainer = deletedContainer && selectedElement && (0, import_editor_elements8.isElementInContainer)(selectedElement, deletedContainer);
|
|
1472
|
+
if (isSelectedElementInDeletedContainer && isAtomicWidgetSelected()) {
|
|
1473
|
+
close();
|
|
1474
|
+
}
|
|
1475
|
+
});
|
|
1476
|
+
}, []);
|
|
1477
|
+
};
|
|
1478
|
+
|
|
1929
1479
|
// src/hooks/use-open-editor-panel.ts
|
|
1930
|
-
var
|
|
1931
|
-
var
|
|
1480
|
+
var import_react15 = require("react");
|
|
1481
|
+
var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
|
|
1932
1482
|
var useOpenEditorPanel = () => {
|
|
1933
1483
|
const { open } = usePanelActions();
|
|
1934
|
-
(0,
|
|
1935
|
-
return (0,
|
|
1936
|
-
if (
|
|
1484
|
+
(0, import_react15.useEffect)(() => {
|
|
1485
|
+
return (0, import_editor_v1_adapters2.__privateListenTo)((0, import_editor_v1_adapters2.commandStartEvent)("panel/editor/open"), () => {
|
|
1486
|
+
if (isAtomicWidgetSelected()) {
|
|
1937
1487
|
open();
|
|
1938
1488
|
}
|
|
1939
1489
|
});
|
|
@@ -1943,38 +1493,37 @@ var useOpenEditorPanel = () => {
|
|
|
1943
1493
|
// src/components/editing-panel-hooks.tsx
|
|
1944
1494
|
var EditingPanelHooks = () => {
|
|
1945
1495
|
useOpenEditorPanel();
|
|
1496
|
+
useCloseEditorPanel();
|
|
1946
1497
|
return null;
|
|
1947
1498
|
};
|
|
1948
1499
|
|
|
1949
|
-
// src/init.ts
|
|
1950
|
-
var import_editor_panels3 = require("@elementor/editor-panels");
|
|
1951
|
-
var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
|
|
1952
|
-
|
|
1953
1500
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
1954
|
-
var
|
|
1955
|
-
var
|
|
1956
|
-
var
|
|
1957
|
-
var
|
|
1958
|
-
var
|
|
1501
|
+
var React54 = __toESM(require("react"));
|
|
1502
|
+
var import_react19 = require("react");
|
|
1503
|
+
var import_editor_controls36 = require("@elementor/editor-controls");
|
|
1504
|
+
var import_icons15 = require("@elementor/icons");
|
|
1505
|
+
var import_ui45 = require("@elementor/ui");
|
|
1506
|
+
var import_i18n33 = require("@wordpress/i18n");
|
|
1959
1507
|
|
|
1960
1508
|
// src/dynamics/dynamic-control.tsx
|
|
1961
|
-
var
|
|
1509
|
+
var React52 = __toESM(require("react"));
|
|
1510
|
+
var import_editor_controls34 = require("@elementor/editor-controls");
|
|
1962
1511
|
|
|
1963
1512
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
1964
|
-
var
|
|
1513
|
+
var import_react17 = require("react");
|
|
1965
1514
|
|
|
1966
1515
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
1967
|
-
var
|
|
1516
|
+
var import_react16 = require("react");
|
|
1968
1517
|
|
|
1969
1518
|
// src/dynamics/sync/get-elementor-config.ts
|
|
1970
|
-
var
|
|
1519
|
+
var getElementorConfig2 = () => {
|
|
1971
1520
|
const extendedWindow = window;
|
|
1972
1521
|
return extendedWindow.elementor?.config ?? {};
|
|
1973
1522
|
};
|
|
1974
1523
|
|
|
1975
1524
|
// src/dynamics/sync/get-atomic-dynamic-tags.ts
|
|
1976
1525
|
var getAtomicDynamicTags = () => {
|
|
1977
|
-
const { atomicDynamicTags } =
|
|
1526
|
+
const { atomicDynamicTags } = getElementorConfig2();
|
|
1978
1527
|
if (!atomicDynamicTags) {
|
|
1979
1528
|
return null;
|
|
1980
1529
|
}
|
|
@@ -2008,7 +1557,7 @@ var usePropDynamicTags = (propName) => {
|
|
|
2008
1557
|
const propDynamicType = getDynamicPropType(propType);
|
|
2009
1558
|
categories = propDynamicType?.settings.categories || [];
|
|
2010
1559
|
}
|
|
2011
|
-
return (0,
|
|
1560
|
+
return (0, import_react16.useMemo)(() => getDynamicTagsByCategories(categories), [categories.join()]);
|
|
2012
1561
|
};
|
|
2013
1562
|
var getDynamicTagsByCategories = (categories) => {
|
|
2014
1563
|
const dynamicTags = getAtomicDynamicTags();
|
|
@@ -2024,12 +1573,12 @@ var getDynamicTagsByCategories = (categories) => {
|
|
|
2024
1573
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
2025
1574
|
var useDynamicTag = (propName, tagName) => {
|
|
2026
1575
|
const dynamicTags = usePropDynamicTags(propName);
|
|
2027
|
-
return (0,
|
|
1576
|
+
return (0, import_react17.useMemo)(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
2028
1577
|
};
|
|
2029
1578
|
|
|
2030
1579
|
// src/dynamics/dynamic-control.tsx
|
|
2031
1580
|
var DynamicControl = ({ bind, children }) => {
|
|
2032
|
-
const { value, setValue, bind: propName } = useBoundProp();
|
|
1581
|
+
const { value, setValue, bind: propName } = (0, import_editor_controls34.useBoundProp)();
|
|
2033
1582
|
const { name = "", settings } = value?.value ?? {};
|
|
2034
1583
|
const dynamicTag = useDynamicTag(propName, name);
|
|
2035
1584
|
if (!dynamicTag) {
|
|
@@ -2049,42 +1598,22 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
2049
1598
|
}
|
|
2050
1599
|
});
|
|
2051
1600
|
};
|
|
2052
|
-
return /* @__PURE__ */
|
|
2053
|
-
};
|
|
2054
|
-
|
|
2055
|
-
// src/dynamics/components/dynamic-selection.tsx
|
|
2056
|
-
var React68 = __toESM(require("react"));
|
|
2057
|
-
var import_react19 = require("react");
|
|
2058
|
-
var import_icons16 = require("@elementor/icons");
|
|
2059
|
-
var import_ui53 = require("@elementor/ui");
|
|
2060
|
-
var import_i18n39 = require("@wordpress/i18n");
|
|
2061
|
-
|
|
2062
|
-
// src/dynamics/hooks/use-prop-value-history.ts
|
|
2063
|
-
var PROPS_VALUES_HISTORY_KEY = "elementor/dynamic/non-dynamic-values-history";
|
|
2064
|
-
var usePropValueHistory = (path) => {
|
|
2065
|
-
const valuesHistory = getValues();
|
|
2066
|
-
const { element } = useElement();
|
|
2067
|
-
const key = `${element.id}-${path}`;
|
|
2068
|
-
const value = valuesHistory[key] ?? null;
|
|
2069
|
-
const setValue = (newValue) => {
|
|
2070
|
-
setValues({ ...valuesHistory, [key]: newValue });
|
|
2071
|
-
};
|
|
2072
|
-
return [value, setValue];
|
|
2073
|
-
};
|
|
2074
|
-
var getValues = () => {
|
|
2075
|
-
return JSON.parse(sessionStorage.getItem(PROPS_VALUES_HISTORY_KEY) || "{}");
|
|
2076
|
-
};
|
|
2077
|
-
var setValues = (values) => {
|
|
2078
|
-
sessionStorage.setItem(PROPS_VALUES_HISTORY_KEY, JSON.stringify(values));
|
|
1601
|
+
return /* @__PURE__ */ React52.createElement(import_editor_controls34.BoundPropProvider, { setValue: setDynamicValue, value: dynamicValue, bind }, children);
|
|
2079
1602
|
};
|
|
2080
1603
|
|
|
2081
1604
|
// src/dynamics/components/dynamic-selection.tsx
|
|
2082
|
-
var
|
|
1605
|
+
var React53 = __toESM(require("react"));
|
|
1606
|
+
var import_react18 = require("react");
|
|
1607
|
+
var import_editor_controls35 = require("@elementor/editor-controls");
|
|
1608
|
+
var import_icons14 = require("@elementor/icons");
|
|
1609
|
+
var import_ui44 = require("@elementor/ui");
|
|
1610
|
+
var import_i18n32 = require("@wordpress/i18n");
|
|
1611
|
+
var SIZE3 = "tiny";
|
|
2083
1612
|
var DynamicSelection = ({ onSelect }) => {
|
|
2084
|
-
const [searchValue, setSearchValue] = (0,
|
|
1613
|
+
const [searchValue, setSearchValue] = (0, import_react18.useState)("");
|
|
2085
1614
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
2086
|
-
const { bind, value: currentValue, setValue } = useBoundProp();
|
|
2087
|
-
const
|
|
1615
|
+
const { bind, value: currentValue, setValue } = (0, import_editor_controls35.useBoundProp)();
|
|
1616
|
+
const { setPropValue: updatePropValueHistory } = usePropValueHistory();
|
|
2088
1617
|
const isCurrentValueDynamic = isDynamicPropValue(currentValue);
|
|
2089
1618
|
const options5 = useFilteredOptions(bind, searchValue);
|
|
2090
1619
|
const handleSearch = (event) => {
|
|
@@ -2092,27 +1621,27 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2092
1621
|
};
|
|
2093
1622
|
const handleSetDynamicTag = (value) => {
|
|
2094
1623
|
if (!isCurrentValueDynamic) {
|
|
2095
|
-
updatePropValueHistory(currentValue);
|
|
1624
|
+
updatePropValueHistory(bind, currentValue);
|
|
2096
1625
|
}
|
|
2097
1626
|
setValue({ $$type: "dynamic", value: { name: value, settings: {} } });
|
|
2098
1627
|
onSelect?.();
|
|
2099
1628
|
};
|
|
2100
|
-
return /* @__PURE__ */
|
|
2101
|
-
|
|
1629
|
+
return /* @__PURE__ */ React53.createElement(import_ui44.Stack, null, /* @__PURE__ */ React53.createElement(import_ui44.Box, { px: 1.5, pb: 1 }, /* @__PURE__ */ React53.createElement(
|
|
1630
|
+
import_ui44.TextField,
|
|
2102
1631
|
{
|
|
2103
1632
|
fullWidth: true,
|
|
2104
|
-
size:
|
|
1633
|
+
size: SIZE3,
|
|
2105
1634
|
value: searchValue,
|
|
2106
1635
|
onChange: handleSearch,
|
|
2107
|
-
placeholder: (0,
|
|
1636
|
+
placeholder: (0, import_i18n32.__)("Search dynamic tag", "elementor"),
|
|
2108
1637
|
InputProps: {
|
|
2109
|
-
startAdornment: /* @__PURE__ */
|
|
1638
|
+
startAdornment: /* @__PURE__ */ React53.createElement(import_ui44.InputAdornment, { position: "start" }, /* @__PURE__ */ React53.createElement(import_icons14.SearchIcon, { fontSize: SIZE3 }))
|
|
2110
1639
|
}
|
|
2111
1640
|
}
|
|
2112
|
-
)), /* @__PURE__ */
|
|
1641
|
+
)), /* @__PURE__ */ React53.createElement(import_ui44.Divider, null), /* @__PURE__ */ React53.createElement(import_ui44.Box, { sx: { overflowY: "auto", height: 260, width: 220 } }, options5.length > 0 ? /* @__PURE__ */ React53.createElement(import_ui44.MenuList, { role: "listbox", tabIndex: 0 }, options5.map(([category, items], index) => /* @__PURE__ */ React53.createElement(import_react18.Fragment, { key: index }, /* @__PURE__ */ React53.createElement(import_ui44.ListSubheader, { sx: { typography: "caption", color: "text.tertiary" } }, dynamicGroups?.[category]?.title || category), items.map(({ value, label: tagLabel }) => {
|
|
2113
1642
|
const isSelected = isCurrentValueDynamic && value === currentValue?.value?.name;
|
|
2114
|
-
return /* @__PURE__ */
|
|
2115
|
-
|
|
1643
|
+
return /* @__PURE__ */ React53.createElement(
|
|
1644
|
+
import_ui44.MenuItem,
|
|
2116
1645
|
{
|
|
2117
1646
|
key: value,
|
|
2118
1647
|
selected: isSelected,
|
|
@@ -2122,16 +1651,16 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2122
1651
|
},
|
|
2123
1652
|
tagLabel
|
|
2124
1653
|
);
|
|
2125
|
-
})))) : /* @__PURE__ */
|
|
2126
|
-
|
|
1654
|
+
})))) : /* @__PURE__ */ React53.createElement(import_ui44.Stack, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React53.createElement(import_icons14.PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React53.createElement(import_ui44.Typography, { align: "center", variant: "caption", color: "text.secondary" }, (0, import_i18n32.__)("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React53.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React53.createElement(import_ui44.Typography, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React53.createElement(
|
|
1655
|
+
import_ui44.Link,
|
|
2127
1656
|
{
|
|
2128
1657
|
color: "secondary",
|
|
2129
1658
|
variant: "caption",
|
|
2130
1659
|
component: "button",
|
|
2131
1660
|
onClick: () => setSearchValue("")
|
|
2132
1661
|
},
|
|
2133
|
-
(0,
|
|
2134
|
-
), "\xA0", (0,
|
|
1662
|
+
(0, import_i18n32.__)("Clear the filters", "elementor")
|
|
1663
|
+
), "\xA0", (0, import_i18n32.__)("and try again.", "elementor")))));
|
|
2135
1664
|
};
|
|
2136
1665
|
var useFilteredOptions = (bind, searchValue) => {
|
|
2137
1666
|
const dynamicTags = usePropDynamicTags(bind);
|
|
@@ -2150,114 +1679,117 @@ var useFilteredOptions = (bind, searchValue) => {
|
|
|
2150
1679
|
};
|
|
2151
1680
|
|
|
2152
1681
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
2153
|
-
var
|
|
1682
|
+
var SIZE4 = "tiny";
|
|
2154
1683
|
var DynamicSelectionControl = () => {
|
|
2155
|
-
const { bind, value, setValue } = useBoundProp();
|
|
2156
|
-
const
|
|
1684
|
+
const { bind, value, setValue } = (0, import_editor_controls36.useBoundProp)();
|
|
1685
|
+
const { getPropValue: getPropValueFromHistory } = usePropValueHistory();
|
|
2157
1686
|
const { name: tagName = "" } = value?.value || {};
|
|
2158
|
-
const selectionPopoverId = (0,
|
|
2159
|
-
const selectionPopoverState = (0,
|
|
1687
|
+
const selectionPopoverId = (0, import_react19.useId)();
|
|
1688
|
+
const selectionPopoverState = (0, import_ui45.usePopupState)({ variant: "popover", popupId: selectionPopoverId });
|
|
2160
1689
|
const dynamicTag = useDynamicTag(bind, tagName);
|
|
2161
1690
|
const removeDynamicTag = () => {
|
|
2162
|
-
|
|
1691
|
+
const propValue = getPropValueFromHistory(bind);
|
|
1692
|
+
setValue(propValue ?? null);
|
|
2163
1693
|
};
|
|
2164
1694
|
if (!dynamicTag) {
|
|
2165
1695
|
throw new Error(`Dynamic tag ${tagName} not found`);
|
|
2166
1696
|
}
|
|
2167
|
-
return /* @__PURE__ */
|
|
2168
|
-
|
|
1697
|
+
return /* @__PURE__ */ React54.createElement(import_ui45.Box, null, /* @__PURE__ */ React54.createElement(
|
|
1698
|
+
import_ui45.UnstableTag,
|
|
2169
1699
|
{
|
|
2170
1700
|
fullWidth: true,
|
|
2171
1701
|
showActionsOnHover: true,
|
|
2172
1702
|
label: dynamicTag.label,
|
|
2173
|
-
startIcon: /* @__PURE__ */
|
|
2174
|
-
...(0,
|
|
2175
|
-
actions: /* @__PURE__ */
|
|
2176
|
-
|
|
1703
|
+
startIcon: /* @__PURE__ */ React54.createElement(import_icons15.DatabaseIcon, { fontSize: SIZE4 }),
|
|
1704
|
+
...(0, import_ui45.bindTrigger)(selectionPopoverState),
|
|
1705
|
+
actions: /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(DynamicSettingsPopover, { dynamicTag }), /* @__PURE__ */ React54.createElement(
|
|
1706
|
+
import_ui45.IconButton,
|
|
2177
1707
|
{
|
|
2178
|
-
size:
|
|
1708
|
+
size: SIZE4,
|
|
2179
1709
|
onClick: removeDynamicTag,
|
|
2180
|
-
"aria-label": (0,
|
|
1710
|
+
"aria-label": (0, import_i18n33.__)("Remove dynamic value", "elementor")
|
|
2181
1711
|
},
|
|
2182
|
-
/* @__PURE__ */
|
|
1712
|
+
/* @__PURE__ */ React54.createElement(import_icons15.XIcon, { fontSize: SIZE4 })
|
|
2183
1713
|
))
|
|
2184
1714
|
}
|
|
2185
|
-
), /* @__PURE__ */
|
|
2186
|
-
|
|
1715
|
+
), /* @__PURE__ */ React54.createElement(
|
|
1716
|
+
import_ui45.Popover,
|
|
2187
1717
|
{
|
|
2188
1718
|
disablePortal: true,
|
|
2189
1719
|
disableScrollLock: true,
|
|
2190
1720
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
2191
|
-
...(0,
|
|
1721
|
+
...(0, import_ui45.bindPopover)(selectionPopoverState)
|
|
2192
1722
|
},
|
|
2193
|
-
/* @__PURE__ */
|
|
1723
|
+
/* @__PURE__ */ React54.createElement(import_ui45.Stack, null, /* @__PURE__ */ React54.createElement(import_ui45.Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React54.createElement(import_icons15.DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React54.createElement(import_ui45.Typography, { variant: "subtitle2" }, (0, import_i18n33.__)("Dynamic Tags", "elementor")), /* @__PURE__ */ React54.createElement(import_ui45.IconButton, { size: SIZE4, sx: { ml: "auto" }, onClick: selectionPopoverState.close }, /* @__PURE__ */ React54.createElement(import_icons15.XIcon, { fontSize: SIZE4 }))), /* @__PURE__ */ React54.createElement(DynamicSelection, { onSelect: selectionPopoverState.close }))
|
|
2194
1724
|
));
|
|
2195
1725
|
};
|
|
2196
1726
|
var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
2197
|
-
const popupId = (0,
|
|
2198
|
-
const settingsPopupState = (0,
|
|
1727
|
+
const popupId = (0, import_react19.useId)();
|
|
1728
|
+
const settingsPopupState = (0, import_ui45.usePopupState)({ variant: "popover", popupId });
|
|
2199
1729
|
const hasDynamicSettings = !!dynamicTag.atomic_controls.length;
|
|
2200
1730
|
if (!hasDynamicSettings) {
|
|
2201
1731
|
return null;
|
|
2202
1732
|
}
|
|
2203
|
-
return /* @__PURE__ */
|
|
2204
|
-
|
|
1733
|
+
return /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(
|
|
1734
|
+
import_ui45.IconButton,
|
|
2205
1735
|
{
|
|
2206
|
-
size:
|
|
2207
|
-
...(0,
|
|
2208
|
-
"aria-label": (0,
|
|
1736
|
+
size: SIZE4,
|
|
1737
|
+
...(0, import_ui45.bindTrigger)(settingsPopupState),
|
|
1738
|
+
"aria-label": (0, import_i18n33.__)("Settings", "elementor")
|
|
2209
1739
|
},
|
|
2210
|
-
/* @__PURE__ */
|
|
2211
|
-
), /* @__PURE__ */
|
|
2212
|
-
|
|
1740
|
+
/* @__PURE__ */ React54.createElement(import_icons15.SettingsIcon, { fontSize: SIZE4 })
|
|
1741
|
+
), /* @__PURE__ */ React54.createElement(
|
|
1742
|
+
import_ui45.Popover,
|
|
2213
1743
|
{
|
|
2214
1744
|
disableScrollLock: true,
|
|
2215
1745
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
2216
|
-
...(0,
|
|
1746
|
+
...(0, import_ui45.bindPopover)(settingsPopupState)
|
|
2217
1747
|
},
|
|
2218
|
-
/* @__PURE__ */
|
|
1748
|
+
/* @__PURE__ */ React54.createElement(import_ui45.Paper, { component: import_ui45.Stack, sx: { minHeight: "300px", width: "220px" } }, /* @__PURE__ */ React54.createElement(import_ui45.Stack, { direction: "row", alignItems: "center", px: 1.5, pt: 2, pb: 1 }, /* @__PURE__ */ React54.createElement(import_icons15.DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React54.createElement(import_ui45.Typography, { variant: "subtitle2" }, dynamicTag.label), /* @__PURE__ */ React54.createElement(import_ui45.IconButton, { sx: { ml: "auto" }, size: SIZE4, onClick: settingsPopupState.close }, /* @__PURE__ */ React54.createElement(import_icons15.XIcon, { fontSize: SIZE4 }))), /* @__PURE__ */ React54.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls }))
|
|
2219
1749
|
));
|
|
2220
1750
|
};
|
|
2221
1751
|
var DynamicSettings = ({ controls }) => {
|
|
2222
1752
|
const tabs = controls.filter(({ type }) => type === "section");
|
|
2223
|
-
const { getTabsProps, getTabProps, getTabPanelProps } = (0,
|
|
1753
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui45.useTabs)(0);
|
|
2224
1754
|
if (!tabs.length) {
|
|
2225
1755
|
return null;
|
|
2226
1756
|
}
|
|
2227
|
-
return /* @__PURE__ */
|
|
2228
|
-
return /* @__PURE__ */
|
|
1757
|
+
return /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(import_ui45.Tabs, { indicatorColor: "secondary", textColor: "secondary", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React54.createElement(import_ui45.Tab, { key: index, label: value.label, sx: { px: 1, py: 0.5 }, ...getTabProps(index) }))), /* @__PURE__ */ React54.createElement(import_ui45.Divider, null), tabs.map(({ value }, index) => {
|
|
1758
|
+
return /* @__PURE__ */ React54.createElement(import_ui45.TabPanel, { key: index, sx: { flexGrow: 1 }, ...getTabPanelProps(index) }, /* @__PURE__ */ React54.createElement(import_ui45.Stack, { gap: 1, px: 2 }, value.items.map((item) => {
|
|
2229
1759
|
if (item.type === "control") {
|
|
2230
|
-
return /* @__PURE__ */
|
|
1760
|
+
return /* @__PURE__ */ React54.createElement(Control3, { key: item.value.bind, control: item.value });
|
|
2231
1761
|
}
|
|
2232
1762
|
return null;
|
|
2233
1763
|
})));
|
|
2234
1764
|
}));
|
|
2235
1765
|
};
|
|
2236
|
-
var
|
|
1766
|
+
var Control3 = ({ control }) => {
|
|
2237
1767
|
if (!getControlByType(control.type)) {
|
|
2238
1768
|
return null;
|
|
2239
1769
|
}
|
|
2240
|
-
return /* @__PURE__ */
|
|
1770
|
+
return /* @__PURE__ */ React54.createElement(DynamicControl, { bind: control.bind }, control.label ? /* @__PURE__ */ React54.createElement(import_editor_controls36.ControlLabel, null, control.label) : null, /* @__PURE__ */ React54.createElement(Control, { type: control.type, props: control.props }));
|
|
2241
1771
|
};
|
|
2242
1772
|
|
|
2243
1773
|
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
2244
|
-
var
|
|
2245
|
-
var
|
|
2246
|
-
var
|
|
1774
|
+
var React55 = __toESM(require("react"));
|
|
1775
|
+
var import_editor_controls37 = require("@elementor/editor-controls");
|
|
1776
|
+
var import_icons16 = require("@elementor/icons");
|
|
1777
|
+
var import_i18n34 = require("@wordpress/i18n");
|
|
2247
1778
|
var usePropDynamicAction = () => {
|
|
2248
|
-
const { bind } = useBoundProp();
|
|
1779
|
+
const { bind } = (0, import_editor_controls37.useBoundProp)();
|
|
2249
1780
|
const { elementType } = useElement();
|
|
2250
1781
|
const propType = elementType.propsSchema[bind];
|
|
2251
1782
|
const visible = !!propType && supportsDynamic(propType);
|
|
2252
1783
|
return {
|
|
2253
1784
|
visible,
|
|
2254
|
-
icon:
|
|
2255
|
-
title: (0,
|
|
2256
|
-
popoverContent: ({ closePopover }) => /* @__PURE__ */
|
|
1785
|
+
icon: import_icons16.DatabaseIcon,
|
|
1786
|
+
title: (0, import_i18n34.__)("Dynamic Tags", "elementor"),
|
|
1787
|
+
popoverContent: ({ closePopover }) => /* @__PURE__ */ React55.createElement(DynamicSelection, { onSelect: closePopover })
|
|
2257
1788
|
};
|
|
2258
1789
|
};
|
|
2259
1790
|
|
|
2260
1791
|
// src/dynamics/init.ts
|
|
1792
|
+
var { registerPopoverAction } = controlActionsMenu;
|
|
2261
1793
|
var init = () => {
|
|
2262
1794
|
replaceControl({
|
|
2263
1795
|
component: DynamicSelectionControl,
|
|
@@ -2280,9 +1812,9 @@ function init2() {
|
|
|
2280
1812
|
init();
|
|
2281
1813
|
}
|
|
2282
1814
|
var blockV1Panel = () => {
|
|
2283
|
-
(0,
|
|
1815
|
+
(0, import_editor_v1_adapters3.__privateBlockDataCommand)({
|
|
2284
1816
|
command: "panel/editor/open",
|
|
2285
|
-
condition:
|
|
1817
|
+
condition: isAtomicWidgetSelected
|
|
2286
1818
|
});
|
|
2287
1819
|
};
|
|
2288
1820
|
|