@elementor/editor-editing-panel 0.19.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 +97 -0
- package/dist/index.d.mts +10 -36
- package/dist/index.d.ts +10 -36
- package/dist/index.js +1256 -1445
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1311 -1482
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -14
- package/src/components/add-or-remove-content.tsx +42 -0
- package/src/components/collapse-icon.tsx +12 -0
- package/src/components/collapsible-content.tsx +5 -14
- package/src/components/collapsible-field.tsx +36 -0
- 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 +21 -21
- 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 +17 -16
- package/src/components/style-sections/background-section/background-color-field.tsx +21 -0
- package/src/components/style-sections/background-section/background-section.tsx +10 -8
- package/src/components/style-sections/border-section/border-color-field.tsx +21 -0
- package/src/components/style-sections/border-section/border-field.tsx +48 -0
- package/src/components/style-sections/border-section/border-radius-field.tsx +49 -0
- package/src/components/style-sections/border-section/border-section.tsx +13 -0
- package/src/components/style-sections/border-section/border-style-field.tsx +32 -0
- package/src/components/style-sections/border-section/border-width-field.tsx +43 -0
- package/src/components/style-sections/effects-section/effects-section.tsx +8 -11
- 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 +46 -0
- package/src/components/style-sections/position-section/position-field.tsx +28 -0
- package/src/components/style-sections/position-section/position-section.tsx +51 -8
- package/src/components/style-sections/position-section/z-index-field.tsx +21 -0
- package/src/components/style-sections/size-section/overflow-field.tsx +45 -0
- package/src/components/style-sections/size-section/size-section.tsx +62 -0
- package/src/components/style-sections/spacing-section/spacing-section.tsx +12 -14
- package/src/components/style-sections/typography-section/font-family-field.tsx +40 -0
- package/src/components/style-sections/typography-section/font-size-field.tsx +21 -0
- package/src/components/style-sections/typography-section/{font-weight-control.tsx → font-weight-field.tsx} +9 -8
- package/src/components/style-sections/typography-section/letter-spacing-field.tsx +21 -0
- package/src/components/style-sections/typography-section/text-alignment-field.tsx +47 -0
- package/src/components/style-sections/typography-section/text-color-field.tsx +21 -0
- package/src/components/style-sections/typography-section/{text-direction-control.tsx → text-direction-field.tsx} +12 -12
- package/src/components/style-sections/typography-section/text-stroke-field.tsx +16 -0
- package/src/components/style-sections/typography-section/{text-style-control.tsx → text-style-field.tsx} +9 -8
- package/src/components/style-sections/typography-section/transform-field.tsx +40 -0
- package/src/components/style-sections/typography-section/typography-section.tsx +31 -30
- package/src/components/style-sections/typography-section/word-spacing-field.tsx +21 -0
- package/src/components/style-tab.tsx +82 -29
- package/src/contexts/classes-prop-context.tsx +24 -0
- package/src/{controls/providers/element-provider.tsx → contexts/element-context.tsx} +3 -7
- package/src/contexts/style-context.tsx +10 -23
- package/src/control-replacement.tsx +1 -1
- package/src/{controls/control-actions/control-actions-menu.ts → controls-actions.ts} +2 -1
- package/src/{controls/components → controls-registry}/control-type-container.tsx +3 -2
- package/src/{controls → controls-registry}/control.tsx +2 -1
- package/src/{controls → controls-registry}/controls-registry.tsx +8 -6
- package/src/controls-registry/settings-field.tsx +36 -0
- package/src/controls-registry/styles-field.tsx +20 -0
- package/src/dynamics/components/dynamic-selection-control.tsx +18 -17
- package/src/dynamics/components/dynamic-selection.tsx +10 -9
- package/src/dynamics/dynamic-control.tsx +7 -6
- package/src/dynamics/hooks/use-dynamic-tag.ts +3 -2
- package/src/dynamics/hooks/use-prop-dynamic-action.tsx +7 -6
- package/src/dynamics/hooks/use-prop-dynamic-tags.ts +3 -2
- package/src/dynamics/init.ts +3 -3
- package/src/dynamics/sync/get-elementor-config.ts +1 -1
- package/src/dynamics/types.ts +2 -2
- package/src/dynamics/utils.ts +3 -3
- 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 +51 -0
- package/src/index.ts +2 -3
- package/src/init.ts +5 -4
- package/src/panel.ts +1 -0
- package/src/{controls/control-actions/actions/popover-action.tsx → popover-action.tsx} +2 -2
- 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} +2 -3
- package/src/sync/types.ts +20 -21
- package/src/components/accordion-section.tsx +0 -25
- package/src/components/control-label.tsx +0 -10
- package/src/components/style-sections/background-section/background-color-control.tsx +0 -20
- package/src/components/style-sections/effects-section/box-shadow-repeater.tsx +0 -224
- package/src/components/style-sections/position-section/z-index-control.tsx +0 -20
- package/src/components/style-sections/size-section.tsx +0 -49
- package/src/components/style-sections/spacing-section/linked-dimensions-control.tsx +0 -155
- package/src/components/style-sections/typography-section/font-size-control.tsx +0 -20
- package/src/components/style-sections/typography-section/letter-spacing-control.tsx +0 -20
- package/src/components/style-sections/typography-section/text-alignment-control.tsx +0 -47
- package/src/components/style-sections/typography-section/text-color-control.tsx +0 -20
- package/src/components/style-sections/typography-section/transform-control.tsx +0 -25
- package/src/components/style-sections/typography-section/word-spacing-control.tsx +0 -20
- package/src/controls/components/control-toggle-button-group.tsx +0 -59
- package/src/controls/components/repeater.tsx +0 -197
- package/src/controls/components/text-field-inner-selection.tsx +0 -79
- package/src/controls/control-actions/control-actions.tsx +0 -43
- package/src/controls/control-context.tsx +0 -22
- package/src/controls/control-replacement.ts +0 -34
- package/src/controls/control-types/color-control.tsx +0 -27
- package/src/controls/control-types/image-control.tsx +0 -66
- package/src/controls/control-types/image-media-control.tsx +0 -73
- package/src/controls/control-types/number-control.tsx +0 -29
- package/src/controls/control-types/select-control.tsx +0 -30
- package/src/controls/control-types/size-control.tsx +0 -71
- package/src/controls/control-types/text-area-control.tsx +0 -31
- package/src/controls/control-types/text-control.tsx +0 -17
- package/src/controls/control-types/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-style-control.ts +0 -29
- package/src/controls/hooks/use-sync-external-state.tsx +0 -51
- package/src/controls/hooks/use-widget-settings.ts +0 -16
- package/src/controls/props/is-transformable.ts +0 -13
- package/src/controls/props/types.ts +0 -51
- package/src/controls/settings-control.tsx +0 -37
- package/src/controls/style-control.tsx +0 -20
- package/src/controls/sync/get-container.ts +0 -8
- package/src/controls/sync/update-settings.ts +0 -14
- package/src/controls/types.ts +0 -39
- package/src/dynamics/hooks/use-prop-value-history.ts +0 -26
- package/src/hooks/use-element-style-prop.ts +0 -46
- package/src/hooks/use-element-styles.ts +0 -13
- package/src/hooks/use-element-type.ts +0 -33
- package/src/hooks/use-selected-elements.ts +0 -9
- package/src/sync/get-element-styles.ts +0 -9
- package/src/sync/get-selected-elements.ts +0 -21
- package/src/sync/get-widgets-cache.ts +0 -7
- package/src/sync/update-style.ts +0 -25
package/dist/index.mjs
CHANGED
|
@@ -1,56 +1,54 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { useBoundProp as useBoundProp5 } from "@elementor/editor-controls";
|
|
3
|
+
|
|
4
|
+
// src/control-replacement.tsx
|
|
5
|
+
import { createControlReplacement } from "@elementor/editor-controls";
|
|
6
|
+
var { replaceControl, getControlReplacement } = createControlReplacement();
|
|
7
|
+
|
|
8
|
+
// src/init.ts
|
|
9
|
+
import { injectIntoLogic } from "@elementor/editor";
|
|
10
|
+
import { __registerPanel as registerPanel } from "@elementor/editor-panels";
|
|
11
|
+
import { __privateBlockDataCommand as blockDataCommand } from "@elementor/editor-v1-adapters";
|
|
12
|
+
|
|
13
|
+
// src/hooks/use-close-editor-panel.ts
|
|
14
|
+
import { useEffect as useEffect2 } from "react";
|
|
15
|
+
import { getSelectedElements as getSelectedElements2, isElementInContainer } from "@elementor/editor-elements";
|
|
16
|
+
import { __privateListenTo as listenTo, commandStartEvent } from "@elementor/editor-v1-adapters";
|
|
17
|
+
|
|
18
|
+
// src/panel.ts
|
|
19
|
+
import { __createPanel as createPanel } from "@elementor/editor-panels";
|
|
4
20
|
|
|
5
|
-
// src/
|
|
21
|
+
// src/components/editing-panel.tsx
|
|
22
|
+
import * as React51 from "react";
|
|
23
|
+
import { ControlActionsProvider, ControlReplacementProvider } from "@elementor/editor-controls";
|
|
24
|
+
import { useSelectedElement } from "@elementor/editor-elements";
|
|
25
|
+
import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from "@elementor/editor-panels";
|
|
26
|
+
import { ErrorBoundary } from "@elementor/ui";
|
|
27
|
+
import { __ as __31 } from "@wordpress/i18n";
|
|
28
|
+
|
|
29
|
+
// src/contexts/element-context.tsx
|
|
30
|
+
import * as React from "react";
|
|
6
31
|
import { createContext, useContext } from "react";
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
if (!controlContext) {
|
|
11
|
-
throw new Error("useControl must be used within a ControlContext");
|
|
12
|
-
}
|
|
13
|
-
return { ...controlContext, value: controlContext.value ?? defaultValue };
|
|
32
|
+
var Context = createContext(null);
|
|
33
|
+
function ElementProvider({ children, element, elementType }) {
|
|
34
|
+
return /* @__PURE__ */ React.createElement(Context.Provider, { value: { element, elementType } }, children);
|
|
14
35
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
component,
|
|
20
|
-
condition,
|
|
21
|
-
children
|
|
22
|
-
}) => {
|
|
23
|
-
return /* @__PURE__ */ React.createElement(ControlReplacementContext.Provider, { value: { component, condition } }, children);
|
|
24
|
-
};
|
|
25
|
-
var useControlReplacement = () => {
|
|
26
|
-
const { value } = useControl();
|
|
27
|
-
const controlReplacement = useContext2(ControlReplacementContext);
|
|
28
|
-
let shouldReplace = false;
|
|
29
|
-
try {
|
|
30
|
-
shouldReplace = !!controlReplacement?.condition({ value }) && !!controlReplacement.component;
|
|
31
|
-
} catch {
|
|
32
|
-
}
|
|
33
|
-
return shouldReplace ? controlReplacement?.component : void 0;
|
|
34
|
-
};
|
|
35
|
-
var createControlReplacement = () => {
|
|
36
|
-
let controlReplacement;
|
|
37
|
-
function replaceControl2({ component, condition }) {
|
|
38
|
-
controlReplacement = { component, condition };
|
|
39
|
-
}
|
|
40
|
-
function getControlReplacement2() {
|
|
41
|
-
return controlReplacement;
|
|
36
|
+
function useElement() {
|
|
37
|
+
const context = useContext(Context);
|
|
38
|
+
if (!context) {
|
|
39
|
+
throw new Error("useElement must be used within a ElementProvider");
|
|
42
40
|
}
|
|
43
|
-
return
|
|
44
|
-
}
|
|
41
|
+
return context;
|
|
42
|
+
}
|
|
45
43
|
|
|
46
|
-
// src/
|
|
47
|
-
|
|
44
|
+
// src/controls-actions.ts
|
|
45
|
+
import { createMenu } from "@elementor/menus";
|
|
48
46
|
|
|
49
|
-
// src/
|
|
47
|
+
// src/popover-action.tsx
|
|
50
48
|
import * as React2 from "react";
|
|
51
|
-
import { bindPopover, bindToggle, IconButton, Popover, Stack, Tooltip, Typography, usePopupState } from "@elementor/ui";
|
|
52
49
|
import { useId } from "react";
|
|
53
50
|
import { XIcon } from "@elementor/icons";
|
|
51
|
+
import { bindPopover, bindToggle, IconButton, Popover, Stack, Tooltip, Typography, usePopupState } from "@elementor/ui";
|
|
54
52
|
var SIZE = "tiny";
|
|
55
53
|
function PopoverAction({
|
|
56
54
|
title,
|
|
@@ -82,492 +80,42 @@ function PopoverAction({
|
|
|
82
80
|
));
|
|
83
81
|
}
|
|
84
82
|
|
|
85
|
-
// src/controls
|
|
86
|
-
import { createMenu } from "@elementor/menus";
|
|
83
|
+
// src/controls-actions.ts
|
|
87
84
|
var controlActionsMenu = createMenu({
|
|
88
85
|
components: {
|
|
89
86
|
PopoverAction
|
|
90
87
|
}
|
|
91
88
|
});
|
|
92
89
|
|
|
93
|
-
// src/panel.
|
|
94
|
-
import { __createPanel as createPanel } from "@elementor/editor-panels";
|
|
95
|
-
|
|
96
|
-
// src/components/editing-panel.tsx
|
|
97
|
-
import * as React49 from "react";
|
|
98
|
-
import { __ as __25 } from "@wordpress/i18n";
|
|
99
|
-
|
|
100
|
-
// src/hooks/use-selected-elements.ts
|
|
101
|
-
import { __privateUseListenTo as useListenTo, commandEndEvent } from "@elementor/editor-v1-adapters";
|
|
102
|
-
|
|
103
|
-
// src/sync/get-selected-elements.ts
|
|
104
|
-
function getSelectedElements() {
|
|
105
|
-
const extendedWindow = window;
|
|
106
|
-
const selectedElements = extendedWindow.elementor?.selection?.getElements?.() ?? [];
|
|
107
|
-
return selectedElements.reduce((acc, el) => {
|
|
108
|
-
const type = el.model.get("widgetType") || el.model.get("elType");
|
|
109
|
-
if (type) {
|
|
110
|
-
acc.push({
|
|
111
|
-
id: el.model.get("id"),
|
|
112
|
-
type
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
return acc;
|
|
116
|
-
}, []);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// src/hooks/use-selected-elements.ts
|
|
120
|
-
function useSelectedElements() {
|
|
121
|
-
return useListenTo(
|
|
122
|
-
[commandEndEvent("document/elements/select"), commandEndEvent("document/elements/deselect")],
|
|
123
|
-
() => getSelectedElements()
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// src/components/editing-panel.tsx
|
|
128
|
-
import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from "@elementor/editor-panels";
|
|
129
|
-
|
|
130
|
-
// src/controls/providers/element-provider.tsx
|
|
90
|
+
// src/components/editing-panel-error-fallback.tsx
|
|
131
91
|
import * as React3 from "react";
|
|
132
|
-
import {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return /* @__PURE__ */ React3.createElement(Context.Provider, { value: { element, elementType } }, children);
|
|
136
|
-
}
|
|
137
|
-
function useElement() {
|
|
138
|
-
const context = useContext3(Context);
|
|
139
|
-
if (!context) {
|
|
140
|
-
throw new Error("useElement must be used within a ElementProvider");
|
|
141
|
-
}
|
|
142
|
-
return context;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// src/hooks/use-element-type.ts
|
|
146
|
-
import { __privateUseListenTo as useListenTo2, commandEndEvent as commandEndEvent2 } from "@elementor/editor-v1-adapters";
|
|
147
|
-
|
|
148
|
-
// src/sync/get-widgets-cache.ts
|
|
149
|
-
function getWidgetsCache() {
|
|
150
|
-
const extendedWindow = window;
|
|
151
|
-
return extendedWindow?.elementor?.widgetsCache || null;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
// src/hooks/use-element-type.ts
|
|
155
|
-
function useElementType(type) {
|
|
156
|
-
return useListenTo2(
|
|
157
|
-
commandEndEvent2("editor/documents/load"),
|
|
158
|
-
() => {
|
|
159
|
-
if (!type) {
|
|
160
|
-
return null;
|
|
161
|
-
}
|
|
162
|
-
const widgetsCache = getWidgetsCache();
|
|
163
|
-
const elementType = widgetsCache?.[type];
|
|
164
|
-
if (!elementType?.atomic_controls) {
|
|
165
|
-
return null;
|
|
166
|
-
}
|
|
167
|
-
if (!elementType?.atomic_props_schema) {
|
|
168
|
-
return null;
|
|
169
|
-
}
|
|
170
|
-
return {
|
|
171
|
-
key: type,
|
|
172
|
-
controls: elementType.atomic_controls,
|
|
173
|
-
propsSchema: elementType.atomic_props_schema,
|
|
174
|
-
title: elementType.title
|
|
175
|
-
};
|
|
176
|
-
},
|
|
177
|
-
[type]
|
|
178
|
-
);
|
|
92
|
+
import { Alert, Box } from "@elementor/ui";
|
|
93
|
+
function EditorPanelErrorFallback() {
|
|
94
|
+
return /* @__PURE__ */ React3.createElement(Box, { role: "alert", sx: { minHeight: "100%", p: 2 } }, /* @__PURE__ */ React3.createElement(Alert, { severity: "error", sx: { mb: 2, maxWidth: 400, textAlign: "center" } }, /* @__PURE__ */ React3.createElement("strong", null, "Something went wrong")));
|
|
179
95
|
}
|
|
180
96
|
|
|
181
97
|
// src/components/editing-panel-tabs.tsx
|
|
182
|
-
import
|
|
183
|
-
import
|
|
184
|
-
import {
|
|
98
|
+
import * as React50 from "react";
|
|
99
|
+
import { Fragment as Fragment5 } from "react";
|
|
100
|
+
import { Divider as Divider7, Stack as Stack18, Tab, TabPanel, Tabs, useTabs } from "@elementor/ui";
|
|
101
|
+
import { __ as __30 } from "@wordpress/i18n";
|
|
185
102
|
|
|
186
103
|
// src/components/settings-tab.tsx
|
|
187
|
-
import * as
|
|
188
|
-
import {
|
|
189
|
-
|
|
190
|
-
// src/controls/settings-control.tsx
|
|
191
|
-
import * as React5 from "react";
|
|
192
|
-
|
|
193
|
-
// src/controls/hooks/use-widget-settings.ts
|
|
194
|
-
import { commandEndEvent as commandEndEvent3, __privateUseListenTo as useListenTo3 } from "@elementor/editor-v1-adapters";
|
|
195
|
-
|
|
196
|
-
// src/controls/sync/get-container.ts
|
|
197
|
-
function getContainer(id) {
|
|
198
|
-
const extendedWindow = window;
|
|
199
|
-
const container = extendedWindow.elementor?.getContainer?.(id);
|
|
200
|
-
return container ?? null;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
// src/controls/hooks/use-widget-settings.ts
|
|
204
|
-
var useWidgetSettings = ({ id, bind }) => {
|
|
205
|
-
return useListenTo3(
|
|
206
|
-
commandEndEvent3("document/elements/settings"),
|
|
207
|
-
() => {
|
|
208
|
-
const container = getContainer(id);
|
|
209
|
-
const value = container?.settings?.get(bind) ?? null;
|
|
210
|
-
return value;
|
|
211
|
-
},
|
|
212
|
-
[id, bind]
|
|
213
|
-
);
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
// src/controls/sync/update-settings.ts
|
|
217
|
-
import { __privateRunCommand as runCommand } from "@elementor/editor-v1-adapters";
|
|
218
|
-
var updateSettings = ({ id, props }) => {
|
|
219
|
-
const container = getContainer(id);
|
|
220
|
-
runCommand("document/elements/settings", {
|
|
221
|
-
container,
|
|
222
|
-
settings: {
|
|
223
|
-
...props
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
};
|
|
104
|
+
import * as React9 from "react";
|
|
105
|
+
import { ControlLabel } from "@elementor/editor-controls";
|
|
227
106
|
|
|
228
|
-
// src/
|
|
107
|
+
// src/controls-registry/control.tsx
|
|
229
108
|
import * as React4 from "react";
|
|
230
|
-
import { Typography as Typography2 } from "@elementor/ui";
|
|
231
|
-
var ControlLabel = ({ children }) => {
|
|
232
|
-
return /* @__PURE__ */ React4.createElement(Typography2, { component: "label", variant: "caption", color: "text.secondary" }, children);
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
// src/controls/settings-control.tsx
|
|
236
|
-
var SettingsControl = ({ bind, children }) => {
|
|
237
|
-
const { element, elementType } = useElement();
|
|
238
|
-
const defaultValue = elementType.propsSchema[bind]?.default;
|
|
239
|
-
const settingsValue = useWidgetSettings({ id: element.id, bind });
|
|
240
|
-
const value = settingsValue ?? defaultValue ?? null;
|
|
241
|
-
const setValue = (newValue) => {
|
|
242
|
-
updateSettings({
|
|
243
|
-
id: element.id,
|
|
244
|
-
props: {
|
|
245
|
-
[bind]: newValue
|
|
246
|
-
}
|
|
247
|
-
});
|
|
248
|
-
};
|
|
249
|
-
return /* @__PURE__ */ React5.createElement(ControlContext.Provider, { value: { setValue, value, bind } }, children);
|
|
250
|
-
};
|
|
251
|
-
SettingsControl.Label = ControlLabel;
|
|
252
|
-
|
|
253
|
-
// src/components/accordion-section.tsx
|
|
254
|
-
import * as React6 from "react";
|
|
255
|
-
import { useId as useId2 } from "react";
|
|
256
|
-
import { Accordion, AccordionSummary, AccordionDetails, AccordionSummaryText, Stack as Stack2 } from "@elementor/ui";
|
|
257
|
-
var AccordionSection = ({ title, children }) => {
|
|
258
|
-
const uid = useId2();
|
|
259
|
-
const labelId = `label-${uid}`;
|
|
260
|
-
const contentId = `content-${uid}`;
|
|
261
|
-
return /* @__PURE__ */ React6.createElement(Accordion, { disableGutters: true, defaultExpanded: true }, /* @__PURE__ */ React6.createElement(AccordionSummary, { "aria-controls": contentId, id: labelId }, /* @__PURE__ */ React6.createElement(AccordionSummaryText, { primaryTypographyProps: { variant: "caption" } }, title)), /* @__PURE__ */ React6.createElement(AccordionDetails, { id: contentId, "aria-labelledby": labelId }, /* @__PURE__ */ React6.createElement(Stack2, { gap: 2.5 }, children)));
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
// src/controls/control.tsx
|
|
265
|
-
import * as React16 from "react";
|
|
266
109
|
import { createError } from "@elementor/utils";
|
|
267
110
|
|
|
268
|
-
// src/controls
|
|
269
|
-
import
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
import { UploadIcon } from "@elementor/icons";
|
|
277
|
-
import { useWpMediaAttachment, useWpMediaFrame } from "@elementor/wp-media";
|
|
278
|
-
import { __ } from "@wordpress/i18n";
|
|
279
|
-
|
|
280
|
-
// src/controls/control-actions/control-actions.tsx
|
|
281
|
-
import * as React7 from "react";
|
|
282
|
-
import { styled, UnstableFloatingActionBar } from "@elementor/ui";
|
|
283
|
-
var { useMenuItems } = controlActionsMenu;
|
|
284
|
-
var FloatingBar = styled(UnstableFloatingActionBar)`
|
|
285
|
-
& .MuiPaper-root:empty {
|
|
286
|
-
display: none;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
// this is for a fix which would be added later on - to force the width externally
|
|
290
|
-
width: 100%;
|
|
291
|
-
& > :first-of-type {
|
|
292
|
-
width: 100%;
|
|
293
|
-
}
|
|
294
|
-
`;
|
|
295
|
-
function ControlActions({ fullWidth = false, children }) {
|
|
296
|
-
const items = useMenuItems().default;
|
|
297
|
-
if (items.length === 0) {
|
|
298
|
-
return children;
|
|
299
|
-
}
|
|
300
|
-
return /* @__PURE__ */ React7.createElement(
|
|
301
|
-
FloatingBar,
|
|
302
|
-
{
|
|
303
|
-
actions: items.map(({ MenuItem: MenuItem4, id }) => /* @__PURE__ */ React7.createElement(MenuItem4, { key: id })),
|
|
304
|
-
sx: fullWidth ? { width: "100%" } : void 0
|
|
305
|
-
},
|
|
306
|
-
children
|
|
307
|
-
);
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
// src/controls/create-control.tsx
|
|
311
|
-
import * as React8 from "react";
|
|
312
|
-
import { ErrorBoundary } from "@elementor/ui";
|
|
313
|
-
var brandSymbol = Symbol("control");
|
|
314
|
-
function createControl(Component, { supportsReplacements = true } = {}) {
|
|
315
|
-
return (props) => {
|
|
316
|
-
const ControlReplacement = useControlReplacement();
|
|
317
|
-
if (ControlReplacement && supportsReplacements) {
|
|
318
|
-
return /* @__PURE__ */ React8.createElement(ErrorBoundary, { fallback: null }, /* @__PURE__ */ React8.createElement(ControlReplacement, { ...props }));
|
|
319
|
-
}
|
|
320
|
-
return /* @__PURE__ */ React8.createElement(ErrorBoundary, { fallback: null }, /* @__PURE__ */ React8.createElement(Component, { ...props }));
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
// src/controls/control-types/image-media-control.tsx
|
|
325
|
-
var ImageMediaControl = createControl(() => {
|
|
326
|
-
const { value, setValue } = useControl();
|
|
327
|
-
const { id, url } = value?.value ?? {};
|
|
328
|
-
const { data: attachment } = useWpMediaAttachment(id?.value || null);
|
|
329
|
-
const src = attachment?.url ?? url;
|
|
330
|
-
const { open } = useWpMediaFrame({
|
|
331
|
-
types: ["image"],
|
|
332
|
-
multiple: false,
|
|
333
|
-
selected: id?.value || null,
|
|
334
|
-
onSelect: (selectedAttachment) => {
|
|
335
|
-
setValue({
|
|
336
|
-
$$type: "image-src",
|
|
337
|
-
value: {
|
|
338
|
-
id: {
|
|
339
|
-
$$type: "image-attachment-id",
|
|
340
|
-
value: selectedAttachment.id
|
|
341
|
-
},
|
|
342
|
-
url: null
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
|
-
});
|
|
347
|
-
return /* @__PURE__ */ React9.createElement(Card, { variant: "outlined" }, /* @__PURE__ */ React9.createElement(CardMedia, { image: src, sx: { height: 150 } }), /* @__PURE__ */ React9.createElement(CardOverlay, null, /* @__PURE__ */ React9.createElement(ControlActions, null, /* @__PURE__ */ React9.createElement(Stack3, { gap: 0.5 }, /* @__PURE__ */ React9.createElement(
|
|
348
|
-
Button,
|
|
349
|
-
{
|
|
350
|
-
size: "tiny",
|
|
351
|
-
color: "inherit",
|
|
352
|
-
variant: "outlined",
|
|
353
|
-
onClick: () => open({ mode: "browse" })
|
|
354
|
-
},
|
|
355
|
-
__("Select Image", "elementor")
|
|
356
|
-
), /* @__PURE__ */ React9.createElement(
|
|
357
|
-
Button,
|
|
358
|
-
{
|
|
359
|
-
size: "tiny",
|
|
360
|
-
variant: "text",
|
|
361
|
-
color: "inherit",
|
|
362
|
-
startIcon: /* @__PURE__ */ React9.createElement(UploadIcon, null),
|
|
363
|
-
onClick: () => open({ mode: "upload" })
|
|
364
|
-
},
|
|
365
|
-
__("Upload Image", "elementor")
|
|
366
|
-
)))));
|
|
367
|
-
});
|
|
368
|
-
|
|
369
|
-
// src/controls/control-types/select-control.tsx
|
|
370
|
-
import * as React10 from "react";
|
|
371
|
-
import { MenuItem, Select } from "@elementor/ui";
|
|
372
|
-
var SelectControl = createControl(({ options: options4 }) => {
|
|
373
|
-
const { value, setValue } = useControl();
|
|
374
|
-
const handleChange = (event) => {
|
|
375
|
-
setValue(event.target.value);
|
|
376
|
-
};
|
|
377
|
-
return /* @__PURE__ */ React10.createElement(ControlActions, null, /* @__PURE__ */ React10.createElement(Select, { size: "tiny", value: value ?? "", onChange: handleChange }, options4.map(({ label, ...props }) => /* @__PURE__ */ React10.createElement(MenuItem, { key: props.value, ...props }, label))));
|
|
378
|
-
});
|
|
379
|
-
|
|
380
|
-
// src/controls/control-types/image-control.tsx
|
|
381
|
-
var ImageControl = createControl((props) => {
|
|
382
|
-
const { value, setValue } = useControl();
|
|
383
|
-
const { src, size } = value?.value || {};
|
|
384
|
-
const setImageSrc = (newValue) => {
|
|
385
|
-
setValue({
|
|
386
|
-
$$type: "image",
|
|
387
|
-
value: {
|
|
388
|
-
src: newValue,
|
|
389
|
-
size
|
|
390
|
-
}
|
|
391
|
-
});
|
|
392
|
-
};
|
|
393
|
-
const setImageSize = (newValue) => {
|
|
394
|
-
setValue({
|
|
395
|
-
$$type: "image",
|
|
396
|
-
value: {
|
|
397
|
-
src,
|
|
398
|
-
size: newValue
|
|
399
|
-
}
|
|
400
|
-
});
|
|
401
|
-
};
|
|
402
|
-
return /* @__PURE__ */ React11.createElement(Stack4, { gap: 2 }, /* @__PURE__ */ React11.createElement(ControlContext.Provider, { value: { setValue: setImageSrc, value: src, bind: "src" } }, /* @__PURE__ */ React11.createElement(ImageMediaControl, null)), /* @__PURE__ */ React11.createElement(ControlContext.Provider, { value: { setValue: setImageSize, value: size, bind: "size" } }, /* @__PURE__ */ React11.createElement(Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React11.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React11.createElement(SettingsControl.Label, null, " ", __2("Image Resolution", "elementor"))), /* @__PURE__ */ React11.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React11.createElement(SelectControl, { options: props.sizes })))));
|
|
403
|
-
});
|
|
404
|
-
|
|
405
|
-
// src/controls/control-types/text-control.tsx
|
|
406
|
-
import * as React12 from "react";
|
|
407
|
-
import { TextField } from "@elementor/ui";
|
|
408
|
-
var TextControl = createControl(({ placeholder }) => {
|
|
409
|
-
const { value, setValue } = useControl("");
|
|
410
|
-
const handleChange = (event) => setValue(event.target.value);
|
|
411
|
-
return /* @__PURE__ */ React12.createElement(ControlActions, { fullWidth: true }, /* @__PURE__ */ React12.createElement(TextField, { type: "text", size: "tiny", value, onChange: handleChange, placeholder }));
|
|
412
|
-
});
|
|
413
|
-
|
|
414
|
-
// src/controls/control-types/text-area-control.tsx
|
|
415
|
-
import * as React13 from "react";
|
|
416
|
-
import { TextField as TextField2 } from "@elementor/ui";
|
|
417
|
-
var TextAreaControl = createControl(({ placeholder }) => {
|
|
418
|
-
const { value, setValue } = useControl();
|
|
419
|
-
const handleChange = (event) => {
|
|
420
|
-
setValue(event.target.value);
|
|
421
|
-
};
|
|
422
|
-
return /* @__PURE__ */ React13.createElement(ControlActions, { fullWidth: true }, /* @__PURE__ */ React13.createElement(
|
|
423
|
-
TextField2,
|
|
424
|
-
{
|
|
425
|
-
size: "tiny",
|
|
426
|
-
multiline: true,
|
|
427
|
-
fullWidth: true,
|
|
428
|
-
rows: 5,
|
|
429
|
-
value,
|
|
430
|
-
onChange: handleChange,
|
|
431
|
-
placeholder
|
|
432
|
-
}
|
|
433
|
-
));
|
|
434
|
-
});
|
|
435
|
-
|
|
436
|
-
// src/controls/control-types/size-control.tsx
|
|
437
|
-
import * as React15 from "react";
|
|
438
|
-
import { InputAdornment as InputAdornment2 } from "@elementor/ui";
|
|
439
|
-
|
|
440
|
-
// src/controls/hooks/use-sync-external-state.tsx
|
|
441
|
-
import { useEffect, useState } from "react";
|
|
442
|
-
var useSyncExternalState = ({
|
|
443
|
-
external,
|
|
444
|
-
setExternal,
|
|
445
|
-
persistWhen,
|
|
446
|
-
fallback
|
|
447
|
-
}) => {
|
|
448
|
-
function toExternal(internalValue) {
|
|
449
|
-
if (persistWhen(internalValue)) {
|
|
450
|
-
return internalValue;
|
|
451
|
-
}
|
|
452
|
-
return void 0;
|
|
453
|
-
}
|
|
454
|
-
function toInternal(externalValue, internalValue) {
|
|
455
|
-
if (!externalValue) {
|
|
456
|
-
return fallback(internalValue);
|
|
457
|
-
}
|
|
458
|
-
return externalValue;
|
|
459
|
-
}
|
|
460
|
-
const [internal, setInternal] = useState(toInternal(external, void 0));
|
|
461
|
-
useEffect(() => {
|
|
462
|
-
setInternal((prevInternal) => toInternal(external, prevInternal));
|
|
463
|
-
}, [external]);
|
|
464
|
-
const setInternalValue = (setter) => {
|
|
465
|
-
const setterFn = typeof setter === "function" ? setter : () => setter;
|
|
466
|
-
const updated = setterFn(internal);
|
|
467
|
-
setInternal(updated);
|
|
468
|
-
setExternal(toExternal(updated));
|
|
469
|
-
};
|
|
470
|
-
return [internal, setInternalValue];
|
|
471
|
-
};
|
|
472
|
-
|
|
473
|
-
// src/controls/components/text-field-inner-selection.tsx
|
|
474
|
-
import * as React14 from "react";
|
|
475
|
-
import { useId as useId3 } from "react";
|
|
476
|
-
import { bindMenu, bindTrigger, Button as Button2, InputAdornment, Menu, MenuItem as MenuItem2, TextField as TextField3, usePopupState as usePopupState2 } from "@elementor/ui";
|
|
477
|
-
var TextFieldInnerSelection = ({
|
|
478
|
-
placeholder,
|
|
479
|
-
type,
|
|
480
|
-
value,
|
|
481
|
-
onChange,
|
|
482
|
-
endAdornment,
|
|
483
|
-
startAdornment
|
|
484
|
-
}) => {
|
|
485
|
-
return /* @__PURE__ */ React14.createElement(
|
|
486
|
-
TextField3,
|
|
487
|
-
{
|
|
488
|
-
size: "tiny",
|
|
489
|
-
type,
|
|
490
|
-
value,
|
|
491
|
-
onChange,
|
|
492
|
-
placeholder,
|
|
493
|
-
InputProps: {
|
|
494
|
-
endAdornment,
|
|
495
|
-
startAdornment
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
);
|
|
499
|
-
};
|
|
500
|
-
var SelectionEndAdornment = ({
|
|
501
|
-
options: options4,
|
|
502
|
-
onClick,
|
|
503
|
-
value
|
|
504
|
-
}) => {
|
|
505
|
-
const popupState = usePopupState2({
|
|
506
|
-
variant: "popover",
|
|
507
|
-
popupId: useId3()
|
|
508
|
-
});
|
|
509
|
-
const handleMenuItemClick = (index) => {
|
|
510
|
-
onClick(options4[index]);
|
|
511
|
-
popupState.close();
|
|
512
|
-
};
|
|
513
|
-
return /* @__PURE__ */ React14.createElement(InputAdornment, { position: "end" }, /* @__PURE__ */ React14.createElement(
|
|
514
|
-
Button2,
|
|
515
|
-
{
|
|
516
|
-
size: "small",
|
|
517
|
-
color: "inherit",
|
|
518
|
-
sx: { font: "inherit", minWidth: "initial" },
|
|
519
|
-
...bindTrigger(popupState)
|
|
520
|
-
},
|
|
521
|
-
value.toUpperCase()
|
|
522
|
-
), /* @__PURE__ */ React14.createElement(Menu, { MenuListProps: { dense: true }, ...bindMenu(popupState) }, options4.map((option, index) => /* @__PURE__ */ React14.createElement(MenuItem2, { key: option, onClick: () => handleMenuItemClick(index) }, option.toUpperCase()))));
|
|
523
|
-
};
|
|
524
|
-
|
|
525
|
-
// src/controls/control-types/size-control.tsx
|
|
526
|
-
var defaultUnits = ["px", "%", "em", "rem", "vw"];
|
|
527
|
-
var SizeControl = createControl(({ units = defaultUnits, placeholder, startIcon }) => {
|
|
528
|
-
const { value, setValue } = useControl();
|
|
529
|
-
const [state, setState] = useSyncExternalState({
|
|
530
|
-
external: value,
|
|
531
|
-
setExternal: setValue,
|
|
532
|
-
persistWhen: (controlValue) => !!controlValue?.value.size || controlValue?.value.size === 0,
|
|
533
|
-
fallback: (controlValue) => ({
|
|
534
|
-
$$type: "size",
|
|
535
|
-
value: { unit: controlValue?.value.unit || "px", size: NaN }
|
|
536
|
-
})
|
|
537
|
-
});
|
|
538
|
-
const handleUnitChange = (unit) => {
|
|
539
|
-
setState((prev) => ({
|
|
540
|
-
...prev,
|
|
541
|
-
value: {
|
|
542
|
-
...prev.value,
|
|
543
|
-
unit
|
|
544
|
-
}
|
|
545
|
-
}));
|
|
546
|
-
};
|
|
547
|
-
const handleSizeChange = (event) => {
|
|
548
|
-
const { value: size } = event.target;
|
|
549
|
-
setState((prev) => ({
|
|
550
|
-
...prev,
|
|
551
|
-
value: {
|
|
552
|
-
...prev.value,
|
|
553
|
-
size: size || size === "0" ? parseFloat(size) : NaN
|
|
554
|
-
}
|
|
555
|
-
}));
|
|
556
|
-
};
|
|
557
|
-
return /* @__PURE__ */ React15.createElement(ControlActions, null, /* @__PURE__ */ React15.createElement(
|
|
558
|
-
TextFieldInnerSelection,
|
|
559
|
-
{
|
|
560
|
-
endAdornment: /* @__PURE__ */ React15.createElement(SelectionEndAdornment, { options: units, onClick: handleUnitChange, value: state.value.unit }),
|
|
561
|
-
placeholder,
|
|
562
|
-
startAdornment: startIcon ?? /* @__PURE__ */ React15.createElement(InputAdornment2, { position: "start" }, startIcon),
|
|
563
|
-
type: "number",
|
|
564
|
-
value: Number.isNaN(state.value.size) ? "" : state.value.size,
|
|
565
|
-
onChange: handleSizeChange
|
|
566
|
-
}
|
|
567
|
-
));
|
|
568
|
-
});
|
|
569
|
-
|
|
570
|
-
// src/controls/controls-registry.tsx
|
|
111
|
+
// src/controls-registry/controls-registry.tsx
|
|
112
|
+
import {
|
|
113
|
+
ImageControl,
|
|
114
|
+
SelectControl,
|
|
115
|
+
SizeControl,
|
|
116
|
+
TextAreaControl,
|
|
117
|
+
TextControl
|
|
118
|
+
} from "@elementor/editor-controls";
|
|
571
119
|
var controlTypes = {
|
|
572
120
|
image: { component: ImageControl, layout: "full" },
|
|
573
121
|
text: { component: TextControl, layout: "two-columns" },
|
|
@@ -578,7 +126,7 @@ var controlTypes = {
|
|
|
578
126
|
var getControlByType = (type) => controlTypes[type]?.component;
|
|
579
127
|
var getLayoutByType = (type) => controlTypes[type].layout;
|
|
580
128
|
|
|
581
|
-
// src/controls/control.tsx
|
|
129
|
+
// src/controls-registry/control.tsx
|
|
582
130
|
var ControlTypeError = createError({
|
|
583
131
|
code: "CONTROL_TYPE_NOT_FOUND",
|
|
584
132
|
message: `Control type not found.`
|
|
@@ -590,20 +138,20 @@ var Control = ({ props, type }) => {
|
|
|
590
138
|
context: { type }
|
|
591
139
|
});
|
|
592
140
|
}
|
|
593
|
-
return /* @__PURE__ */
|
|
141
|
+
return /* @__PURE__ */ React4.createElement(ControlByType, { ...props });
|
|
594
142
|
};
|
|
595
143
|
|
|
596
|
-
// src/controls/
|
|
597
|
-
import * as
|
|
598
|
-
import {
|
|
144
|
+
// src/controls-registry/control-type-container.tsx
|
|
145
|
+
import * as React5 from "react";
|
|
146
|
+
import { Box as Box2, styled } from "@elementor/ui";
|
|
599
147
|
var ControlTypeContainer = ({
|
|
600
148
|
controlType,
|
|
601
149
|
children
|
|
602
150
|
}) => {
|
|
603
151
|
const layout = getLayoutByType(controlType);
|
|
604
|
-
return /* @__PURE__ */
|
|
152
|
+
return /* @__PURE__ */ React5.createElement(StyledContainer, { layout }, children);
|
|
605
153
|
};
|
|
606
|
-
var StyledContainer =
|
|
154
|
+
var StyledContainer = styled(Box2, {
|
|
607
155
|
shouldForwardProp: (prop) => !["layout"].includes(prop)
|
|
608
156
|
})(({ layout, theme }) => ({
|
|
609
157
|
display: "grid",
|
|
@@ -618,931 +166,1240 @@ var getGridLayout = (layout) => ({
|
|
|
618
166
|
}[layout]
|
|
619
167
|
});
|
|
620
168
|
|
|
621
|
-
// src/
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
}
|
|
638
|
-
};
|
|
639
|
-
|
|
640
|
-
if (!getControlByType(control.type)) {
|
|
641
|
-
return null;
|
|
642
|
-
}
|
|
643
|
-
return /* @__PURE__ */ React18.createElement(SettingsControl, { bind: control.bind }, /* @__PURE__ */ React18.createElement(ControlTypeContainer, { controlType: control.type }, control.label ? /* @__PURE__ */ React18.createElement(SettingsControl.Label, null, control.label) : null, /* @__PURE__ */ React18.createElement(Control, { type: control.type, props: control.props })));
|
|
644
|
-
};
|
|
645
|
-
|
|
646
|
-
// src/components/style-tab.tsx
|
|
647
|
-
import * as React46 from "react";
|
|
169
|
+
// src/controls-registry/settings-field.tsx
|
|
170
|
+
import * as React6 from "react";
|
|
171
|
+
import { BoundPropProvider } from "@elementor/editor-controls";
|
|
172
|
+
import { updateSettings, useElementSetting } from "@elementor/editor-elements";
|
|
173
|
+
var SettingsField = ({ bind, children }) => {
|
|
174
|
+
const { element, elementType } = useElement();
|
|
175
|
+
const defaultValue = elementType.propsSchema[bind]?.default;
|
|
176
|
+
const settingsValue = useElementSetting(element.id, bind);
|
|
177
|
+
const value = settingsValue ?? defaultValue ?? null;
|
|
178
|
+
const setValue = (newValue) => {
|
|
179
|
+
updateSettings({
|
|
180
|
+
id: element.id,
|
|
181
|
+
props: {
|
|
182
|
+
[bind]: newValue
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
return /* @__PURE__ */ React6.createElement(BoundPropProvider, { setValue, value, bind }, children);
|
|
187
|
+
};
|
|
648
188
|
|
|
649
|
-
// src/
|
|
650
|
-
import * as
|
|
651
|
-
import {
|
|
652
|
-
import {
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
}
|
|
664
|
-
|
|
189
|
+
// src/components/section.tsx
|
|
190
|
+
import * as React7 from "react";
|
|
191
|
+
import { useId as useId2, useState } from "react";
|
|
192
|
+
import { Collapse, Divider, ListItemButton, ListItemText, Stack as Stack2 } from "@elementor/ui";
|
|
193
|
+
|
|
194
|
+
// src/components/collapse-icon.tsx
|
|
195
|
+
import { ChevronDownIcon } from "@elementor/icons";
|
|
196
|
+
import { styled as styled2 } from "@elementor/ui";
|
|
197
|
+
var CollapseIcon = styled2(ChevronDownIcon, {
|
|
198
|
+
shouldForwardProp: (prop) => prop !== "open"
|
|
199
|
+
})(({ theme, open }) => ({
|
|
200
|
+
transform: open ? "rotate(180deg)" : "rotate(0deg)",
|
|
201
|
+
transition: theme.transitions.create("transform", {
|
|
202
|
+
duration: theme.transitions.duration.standard
|
|
203
|
+
})
|
|
204
|
+
}));
|
|
205
|
+
|
|
206
|
+
// src/components/section.tsx
|
|
207
|
+
function Section({ title, children, defaultExpanded = false }) {
|
|
208
|
+
const [isOpen, setIsOpen] = useState(!!defaultExpanded);
|
|
209
|
+
const id = useId2();
|
|
210
|
+
const labelId = `label-${id}`;
|
|
211
|
+
const contentId = `content-${id}`;
|
|
212
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(
|
|
213
|
+
ListItemButton,
|
|
214
|
+
{
|
|
215
|
+
id: labelId,
|
|
216
|
+
"aria-controls": contentId,
|
|
217
|
+
onClick: () => setIsOpen((prev) => !prev)
|
|
218
|
+
},
|
|
219
|
+
/* @__PURE__ */ React7.createElement(ListItemText, { secondary: title }),
|
|
220
|
+
/* @__PURE__ */ React7.createElement(CollapseIcon, { open: isOpen, color: "secondary" })
|
|
221
|
+
), /* @__PURE__ */ React7.createElement(Collapse, { id: contentId, "aria-labelledby": labelId, in: isOpen, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React7.createElement(Stack2, { gap: 2.5, p: 2 }, children)), /* @__PURE__ */ React7.createElement(Divider, null));
|
|
665
222
|
}
|
|
666
223
|
|
|
667
|
-
// src/
|
|
668
|
-
import
|
|
224
|
+
// src/components/sections-list.tsx
|
|
225
|
+
import * as React8 from "react";
|
|
226
|
+
import { List } from "@elementor/ui";
|
|
227
|
+
function SectionsList(props) {
|
|
228
|
+
return /* @__PURE__ */ React8.createElement(List, { disablePadding: true, component: "div", ...props });
|
|
229
|
+
}
|
|
669
230
|
|
|
670
|
-
// src/
|
|
671
|
-
var
|
|
672
|
-
const
|
|
673
|
-
return
|
|
231
|
+
// src/components/settings-tab.tsx
|
|
232
|
+
var SettingsTab = () => {
|
|
233
|
+
const { elementType } = useElement();
|
|
234
|
+
return /* @__PURE__ */ React9.createElement(SectionsList, null, elementType.controls.map(({ type, value }, index) => {
|
|
235
|
+
if (type === "control") {
|
|
236
|
+
return /* @__PURE__ */ React9.createElement(Control2, { key: value.bind, control: value });
|
|
237
|
+
}
|
|
238
|
+
if (type === "section") {
|
|
239
|
+
return /* @__PURE__ */ React9.createElement(Section, { title: value.label, key: type + "." + index, defaultExpanded: true }, value.items?.map((item) => {
|
|
240
|
+
if (item.type === "control") {
|
|
241
|
+
return /* @__PURE__ */ React9.createElement(Control2, { key: item.value.bind, control: item.value });
|
|
242
|
+
}
|
|
243
|
+
return null;
|
|
244
|
+
}));
|
|
245
|
+
}
|
|
246
|
+
return null;
|
|
247
|
+
}));
|
|
674
248
|
};
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
() => {
|
|
681
|
-
return getElementStyles(elementID);
|
|
682
|
-
},
|
|
683
|
-
[elementID]
|
|
684
|
-
);
|
|
249
|
+
var Control2 = ({ control }) => {
|
|
250
|
+
if (!getControlByType(control.type)) {
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
return /* @__PURE__ */ React9.createElement(SettingsField, { bind: control.bind }, /* @__PURE__ */ React9.createElement(ControlTypeContainer, { controlType: control.type }, control.label ? /* @__PURE__ */ React9.createElement(ControlLabel, null, control.label) : null, /* @__PURE__ */ React9.createElement(Control, { type: control.type, props: control.props })));
|
|
685
254
|
};
|
|
686
255
|
|
|
687
256
|
// src/components/style-tab.tsx
|
|
688
|
-
import
|
|
257
|
+
import * as React49 from "react";
|
|
258
|
+
import { useState as useState4 } from "react";
|
|
259
|
+
import { useElementSetting as useElementSetting3, useElementStyles as useElementStyles2 } from "@elementor/editor-elements";
|
|
260
|
+
import { useActiveBreakpoint } from "@elementor/editor-responsive";
|
|
261
|
+
import { generateId } from "@elementor/editor-styles";
|
|
262
|
+
import { Divider as Divider6 } from "@elementor/ui";
|
|
263
|
+
import { __ as __29 } from "@wordpress/i18n";
|
|
689
264
|
|
|
690
|
-
// src/
|
|
691
|
-
import * as
|
|
265
|
+
// src/contexts/classes-prop-context.tsx
|
|
266
|
+
import * as React10 from "react";
|
|
267
|
+
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
268
|
+
var Context2 = createContext2(null);
|
|
269
|
+
function ClassesPropProvider({ children, prop }) {
|
|
270
|
+
return /* @__PURE__ */ React10.createElement(Context2.Provider, { value: { prop } }, children);
|
|
271
|
+
}
|
|
272
|
+
function useClassesProp() {
|
|
273
|
+
const context = useContext2(Context2);
|
|
274
|
+
if (!context) {
|
|
275
|
+
throw new Error("useClassesProp must be used within a ClassesPropProvider");
|
|
276
|
+
}
|
|
277
|
+
return context.prop;
|
|
278
|
+
}
|
|
692
279
|
|
|
693
|
-
// src/
|
|
694
|
-
import * as
|
|
280
|
+
// src/contexts/style-context.tsx
|
|
281
|
+
import * as React11 from "react";
|
|
282
|
+
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
283
|
+
var Context3 = createContext3(null);
|
|
284
|
+
function StyleProvider({ children, id, setId, meta }) {
|
|
285
|
+
return /* @__PURE__ */ React11.createElement(Context3.Provider, { value: { id, setId, meta } }, children);
|
|
286
|
+
}
|
|
287
|
+
function useStyle() {
|
|
288
|
+
const context = useContext3(Context3);
|
|
289
|
+
if (!context) {
|
|
290
|
+
throw new Error("useStyle must be used within a StyleProvider");
|
|
291
|
+
}
|
|
292
|
+
return context;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// src/components/css-class-selector-section.tsx
|
|
296
|
+
import * as React13 from "react";
|
|
297
|
+
import { useElementSetting as useElementSetting2, useElementStyles } from "@elementor/editor-elements";
|
|
298
|
+
import { Chip as Chip2, Stack as Stack3, Typography as Typography2 } from "@elementor/ui";
|
|
299
|
+
import { __ } from "@wordpress/i18n";
|
|
300
|
+
|
|
301
|
+
// src/components/multi-combobox/multi-combobox.tsx
|
|
302
|
+
import * as React12 from "react";
|
|
303
|
+
import {
|
|
304
|
+
Autocomplete,
|
|
305
|
+
Box as Box3,
|
|
306
|
+
Chip,
|
|
307
|
+
styled as styled3,
|
|
308
|
+
TextField
|
|
309
|
+
} from "@elementor/ui";
|
|
310
|
+
|
|
311
|
+
// src/components/multi-combobox/use-combobox-actions.ts
|
|
312
|
+
import { createFilterOptions } from "@elementor/ui";
|
|
313
|
+
var useComboboxActions = (applied, actions, optionsLabel, onApply) => ({
|
|
314
|
+
action: {
|
|
315
|
+
is: (opt) => !!opt.action,
|
|
316
|
+
getLabel: (option) => option.action.getLabel(option.label),
|
|
317
|
+
groupBy: (option) => option.action.groupLabel,
|
|
318
|
+
onChange: ({ action, label }) => action?.apply(label),
|
|
319
|
+
getFilteredActions: (optionList, params) => {
|
|
320
|
+
const actionGroups = Object.values(actions);
|
|
321
|
+
return actionGroups.reduce((groups, group) => {
|
|
322
|
+
const actionOptions = group.actions.reduce((groupActions, action) => {
|
|
323
|
+
const shouldShowAction = action.condition(optionList, params.inputValue);
|
|
324
|
+
if (shouldShowAction) {
|
|
325
|
+
const actionOption = createActionOption(group.label, action, params.inputValue);
|
|
326
|
+
groupActions.unshift(actionOption);
|
|
327
|
+
}
|
|
328
|
+
return groupActions;
|
|
329
|
+
}, []);
|
|
330
|
+
return [...groups, ...actionOptions];
|
|
331
|
+
}, []);
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
option: {
|
|
335
|
+
is: (opt) => !("action" in opt),
|
|
336
|
+
getLabel: (option) => option.label,
|
|
337
|
+
groupBy: () => optionsLabel ?? "",
|
|
338
|
+
onChange: (optionValues) => onApply?.(optionValues),
|
|
339
|
+
getFilteredOptions: (optionList, params) => {
|
|
340
|
+
const appliedValues = applied.map((option) => option.value);
|
|
341
|
+
const optionsWithoutApplied = optionList.filter((option) => !appliedValues.includes(option.value));
|
|
342
|
+
return filter(optionsWithoutApplied, params);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
var filter = createFilterOptions();
|
|
347
|
+
var createActionOption = (groupLabel, action, inputValue) => ({
|
|
348
|
+
value: "",
|
|
349
|
+
label: inputValue,
|
|
350
|
+
action: {
|
|
351
|
+
groupLabel,
|
|
352
|
+
apply: action.apply,
|
|
353
|
+
getLabel: action.getLabel
|
|
354
|
+
}
|
|
355
|
+
});
|
|
695
356
|
|
|
696
|
-
// src/
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
357
|
+
// src/components/multi-combobox/multi-combobox.tsx
|
|
358
|
+
var MultiCombobox = ({
|
|
359
|
+
actions = {},
|
|
360
|
+
selected,
|
|
361
|
+
options: options5,
|
|
362
|
+
optionsLabel,
|
|
363
|
+
onApply,
|
|
364
|
+
onCreate,
|
|
365
|
+
...props
|
|
703
366
|
}) => {
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
() =>
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
367
|
+
const { action: actionProps, option: optionProps } = useComboboxActions(selected, actions, optionsLabel, onApply);
|
|
368
|
+
const handleSelectOption = (values) => {
|
|
369
|
+
const action = values.find((value) => actionProps.is(value));
|
|
370
|
+
if (action) {
|
|
371
|
+
return actionProps.onChange(action);
|
|
372
|
+
}
|
|
373
|
+
return optionProps.onChange(values);
|
|
374
|
+
};
|
|
375
|
+
const handleCreateOption = (values) => {
|
|
376
|
+
const value = values.find((option) => typeof option === "string");
|
|
377
|
+
onCreate?.(value);
|
|
378
|
+
};
|
|
379
|
+
return /* @__PURE__ */ React12.createElement(
|
|
380
|
+
Autocomplete,
|
|
381
|
+
{
|
|
382
|
+
...props,
|
|
383
|
+
freeSolo: true,
|
|
384
|
+
multiple: true,
|
|
385
|
+
clearOnBlur: true,
|
|
386
|
+
selectOnFocus: true,
|
|
387
|
+
disableClearable: true,
|
|
388
|
+
handleHomeEndKeys: true,
|
|
389
|
+
value: selected,
|
|
390
|
+
options: options5,
|
|
391
|
+
renderGroup,
|
|
392
|
+
renderInput: (params) => /* @__PURE__ */ React12.createElement(TextField, { ...params }),
|
|
393
|
+
getLimitTagsText: (more) => /* @__PURE__ */ React12.createElement(Chip, { size: "tiny", variant: "standard", label: `+${more}`, clickable: true }),
|
|
394
|
+
onChange: (_, values, reason) => {
|
|
395
|
+
if (reason === "selectOption") {
|
|
396
|
+
return handleSelectOption(values);
|
|
397
|
+
}
|
|
398
|
+
if (reason === "createOption") {
|
|
399
|
+
return handleCreateOption(values);
|
|
400
|
+
}
|
|
401
|
+
onApply?.(values);
|
|
402
|
+
},
|
|
403
|
+
getOptionLabel: (option) => {
|
|
404
|
+
if (optionProps.is(option)) {
|
|
405
|
+
return optionProps.getLabel(option);
|
|
406
|
+
}
|
|
407
|
+
return actionProps.getLabel(option) ?? "";
|
|
408
|
+
},
|
|
409
|
+
filterOptions: (optionList, params) => {
|
|
410
|
+
const filteredoptions = optionProps.getFilteredOptions(optionList, params);
|
|
411
|
+
const actionOptions = actionProps.getFilteredActions(optionList, params);
|
|
412
|
+
return [...actionOptions, ...filteredoptions];
|
|
413
|
+
},
|
|
414
|
+
groupBy: (option) => (optionProps.is(option) ? optionProps.groupBy() : actionProps.groupBy(option)) ?? ""
|
|
415
|
+
}
|
|
718
416
|
);
|
|
719
417
|
};
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
418
|
+
var renderGroup = (params) => /* @__PURE__ */ React12.createElement(Group, { key: params.key }, /* @__PURE__ */ React12.createElement(GroupHeader, null, params.group), /* @__PURE__ */ React12.createElement(GroupItems, null, params.children));
|
|
419
|
+
var Group = styled3("li")`
|
|
420
|
+
&:not( :last-of-type ) {
|
|
421
|
+
border-bottom: 1px solid ${({ theme }) => theme.palette.divider};
|
|
422
|
+
}
|
|
423
|
+
`;
|
|
424
|
+
var GroupHeader = styled3(Box3)(({ theme }) => ({
|
|
425
|
+
position: "sticky",
|
|
426
|
+
top: "-8px",
|
|
427
|
+
padding: theme.spacing(1, 2),
|
|
428
|
+
color: theme.palette.text.tertiary
|
|
429
|
+
}));
|
|
430
|
+
var GroupItems = styled3("ul")`
|
|
431
|
+
padding: 0;
|
|
432
|
+
`;
|
|
433
|
+
|
|
434
|
+
// src/components/css-class-selector-section.tsx
|
|
435
|
+
var ID = "elementor-css-class-selector";
|
|
436
|
+
var TAGS_LIMIT = 8;
|
|
437
|
+
function CssClassSelectorSection() {
|
|
438
|
+
const options5 = useOptions();
|
|
439
|
+
const { id: activeId, setId: setActiveId } = useStyle();
|
|
440
|
+
const appliedIds = useAppliedClassesIds();
|
|
441
|
+
const applied = options5.filter((option) => appliedIds.includes(option.value));
|
|
442
|
+
const active = options5.find((option) => option.value === activeId) || null;
|
|
443
|
+
return /* @__PURE__ */ React13.createElement(Stack3, { gap: 1, p: 2 }, /* @__PURE__ */ React13.createElement(Typography2, { component: "label", variant: "caption", htmlFor: ID }, __("CSS Classes", "elementor")), /* @__PURE__ */ React13.createElement(
|
|
444
|
+
MultiCombobox,
|
|
445
|
+
{
|
|
446
|
+
id: ID,
|
|
447
|
+
size: "tiny",
|
|
448
|
+
options: options5,
|
|
449
|
+
selected: applied,
|
|
450
|
+
limitTags: TAGS_LIMIT,
|
|
451
|
+
optionsLabel: __("Global CSS Classes", "elementor"),
|
|
452
|
+
renderTags: (tagValue, getTagProps) => tagValue.map((option, index) => {
|
|
453
|
+
const chipProps = getTagProps({ index });
|
|
454
|
+
return /* @__PURE__ */ React13.createElement(
|
|
455
|
+
Chip2,
|
|
456
|
+
{
|
|
457
|
+
...chipProps,
|
|
458
|
+
key: chipProps.key,
|
|
459
|
+
size: "small",
|
|
460
|
+
label: option.label,
|
|
461
|
+
variant: option.value === active?.value ? "filled" : "standard",
|
|
462
|
+
color: option.color ?? "default",
|
|
463
|
+
onClick: () => setActiveId(option.value),
|
|
464
|
+
onDelete: null
|
|
465
|
+
}
|
|
466
|
+
);
|
|
467
|
+
})
|
|
468
|
+
}
|
|
469
|
+
));
|
|
470
|
+
}
|
|
471
|
+
function useAppliedClassesIds() {
|
|
472
|
+
const { element } = useElement();
|
|
473
|
+
const currentClassesProp = useClassesProp();
|
|
474
|
+
return useElementSetting2(element.id, currentClassesProp)?.value || [];
|
|
475
|
+
}
|
|
476
|
+
function useOptions() {
|
|
477
|
+
const { element } = useElement();
|
|
478
|
+
const styleDefs = useElementStyles(element.id);
|
|
479
|
+
return Object.values(styleDefs).map((styleDef) => ({
|
|
480
|
+
label: styleDef.label,
|
|
481
|
+
value: styleDef.id,
|
|
482
|
+
color: "primary"
|
|
483
|
+
}));
|
|
724
484
|
}
|
|
725
485
|
|
|
726
|
-
// src/
|
|
727
|
-
import
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
runCommand2("document/atomic-widgets/styles", {
|
|
731
|
-
container,
|
|
732
|
-
styleDefID,
|
|
733
|
-
bind,
|
|
734
|
-
meta,
|
|
735
|
-
props
|
|
736
|
-
});
|
|
737
|
-
};
|
|
486
|
+
// src/components/style-sections/background-section/background-section.tsx
|
|
487
|
+
import * as React16 from "react";
|
|
488
|
+
import { BackgroundOverlayRepeaterControl } from "@elementor/editor-controls";
|
|
489
|
+
import { Stack as Stack4 } from "@elementor/ui";
|
|
738
490
|
|
|
739
|
-
// src/controls/
|
|
740
|
-
|
|
491
|
+
// src/controls-registry/styles-field.tsx
|
|
492
|
+
import * as React14 from "react";
|
|
493
|
+
import { BoundPropProvider as BoundPropProvider2 } from "@elementor/editor-controls";
|
|
494
|
+
|
|
495
|
+
// src/hooks/use-styles-field.ts
|
|
496
|
+
import { useEffect, useRef } from "react";
|
|
497
|
+
import { updateStyle, useElementStyleProp } from "@elementor/editor-elements";
|
|
498
|
+
var useStylesField = (propName) => {
|
|
741
499
|
const { element } = useElement();
|
|
742
|
-
const {
|
|
500
|
+
const { id, meta } = useStyle();
|
|
501
|
+
const classesProp = useClassesProp();
|
|
502
|
+
const previousValue = useRef(null);
|
|
503
|
+
const onChangeCallbacks = useRef(/* @__PURE__ */ new Set());
|
|
743
504
|
const value = useElementStyleProp({
|
|
744
505
|
elementID: element.id,
|
|
745
|
-
styleDefID:
|
|
746
|
-
meta
|
|
506
|
+
styleDefID: id,
|
|
507
|
+
meta,
|
|
747
508
|
propName
|
|
748
509
|
});
|
|
749
510
|
const setValue = (newValue) => {
|
|
750
511
|
updateStyle({
|
|
751
512
|
elementID: element.id,
|
|
752
|
-
styleDefID:
|
|
513
|
+
styleDefID: id,
|
|
753
514
|
props: { [propName]: newValue },
|
|
754
|
-
meta
|
|
755
|
-
bind:
|
|
515
|
+
meta,
|
|
516
|
+
bind: classesProp
|
|
756
517
|
});
|
|
757
518
|
};
|
|
758
|
-
|
|
519
|
+
const registerChangeListener = (callback) => {
|
|
520
|
+
onChangeCallbacks.current.add(callback);
|
|
521
|
+
};
|
|
522
|
+
useEffect(() => {
|
|
523
|
+
onChangeCallbacks.current.forEach((cb) => {
|
|
524
|
+
cb(value, previousValue.current);
|
|
525
|
+
});
|
|
526
|
+
previousValue.current = value;
|
|
527
|
+
}, [value]);
|
|
528
|
+
return [value, setValue, registerChangeListener];
|
|
759
529
|
};
|
|
760
530
|
|
|
761
|
-
// src/controls/
|
|
762
|
-
var
|
|
763
|
-
const [value, setValue] =
|
|
764
|
-
return /* @__PURE__ */
|
|
531
|
+
// src/controls-registry/styles-field.tsx
|
|
532
|
+
var StylesField = ({ bind, children }) => {
|
|
533
|
+
const [value, setValue] = useStylesField(bind);
|
|
534
|
+
return /* @__PURE__ */ React14.createElement(BoundPropProvider2, { setValue, value, bind }, children);
|
|
765
535
|
};
|
|
766
|
-
StyleControl.Label = ControlLabel;
|
|
767
536
|
|
|
768
|
-
// src/components/style-sections/
|
|
769
|
-
import
|
|
770
|
-
import {
|
|
771
|
-
|
|
772
|
-
|
|
537
|
+
// src/components/style-sections/background-section/background-color-field.tsx
|
|
538
|
+
import * as React15 from "react";
|
|
539
|
+
import { ColorControl, ControlLabel as ControlLabel2 } from "@elementor/editor-controls";
|
|
540
|
+
import { Grid } from "@elementor/ui";
|
|
541
|
+
import { __ as __2 } from "@wordpress/i18n";
|
|
542
|
+
var BackgroundColorField = () => {
|
|
543
|
+
return /* @__PURE__ */ React15.createElement(StylesField, { bind: "background-color" }, /* @__PURE__ */ React15.createElement(Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React15.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React15.createElement(ControlLabel2, null, __2("Color", "elementor"))), /* @__PURE__ */ React15.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React15.createElement(ColorControl, null))));
|
|
773
544
|
};
|
|
774
|
-
|
|
775
|
-
|
|
545
|
+
|
|
546
|
+
// src/components/style-sections/background-section/background-section.tsx
|
|
547
|
+
var BackgroundSection = () => {
|
|
548
|
+
return /* @__PURE__ */ React16.createElement(Stack4, { gap: 1.5 }, /* @__PURE__ */ React16.createElement(StylesField, { bind: "background-image" }, /* @__PURE__ */ React16.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React16.createElement(BackgroundColorField, null));
|
|
776
549
|
};
|
|
777
550
|
|
|
778
|
-
// src/components/style-sections/
|
|
779
|
-
import * as
|
|
780
|
-
import { Divider, Stack as
|
|
551
|
+
// src/components/style-sections/border-section/border-section.tsx
|
|
552
|
+
import * as React23 from "react";
|
|
553
|
+
import { Divider as Divider2, Stack as Stack6 } from "@elementor/ui";
|
|
781
554
|
|
|
782
|
-
// src/components/style-sections/
|
|
783
|
-
import * as
|
|
784
|
-
import { __ as
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
value: "italic",
|
|
796
|
-
onChange: (v) => setFontStyle(fontStyle === v ? null : v),
|
|
797
|
-
"aria-label": "italic",
|
|
798
|
-
sx: { marginLeft: "auto" }
|
|
799
|
-
},
|
|
800
|
-
/* @__PURE__ */ React22.createElement(ItalicIcon, { fontSize: buttonSize })
|
|
801
|
-
), /* @__PURE__ */ React22.createElement(
|
|
802
|
-
ShorthandControl,
|
|
803
|
-
{
|
|
804
|
-
value: "line-through",
|
|
805
|
-
currentValues: textDecoration || "",
|
|
806
|
-
updateValues: setTextDecoration,
|
|
807
|
-
"aria-label": "line-through"
|
|
808
|
-
},
|
|
809
|
-
/* @__PURE__ */ React22.createElement(StrikethroughIcon, { fontSize: buttonSize })
|
|
810
|
-
), /* @__PURE__ */ React22.createElement(
|
|
811
|
-
ShorthandControl,
|
|
555
|
+
// src/components/style-sections/border-section/border-field.tsx
|
|
556
|
+
import * as React21 from "react";
|
|
557
|
+
import { __ as __6 } from "@wordpress/i18n";
|
|
558
|
+
|
|
559
|
+
// src/components/add-or-remove-content.tsx
|
|
560
|
+
import * as React17 from "react";
|
|
561
|
+
import { ControlLabel as ControlLabel3 } from "@elementor/editor-controls";
|
|
562
|
+
import { MinusIcon, PlusIcon } from "@elementor/icons";
|
|
563
|
+
import { Collapse as Collapse2, IconButton as IconButton2, Stack as Stack5 } from "@elementor/ui";
|
|
564
|
+
var SIZE2 = "tiny";
|
|
565
|
+
var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
|
|
566
|
+
return /* @__PURE__ */ React17.createElement(Stack5, { gap: 1.5 }, /* @__PURE__ */ React17.createElement(
|
|
567
|
+
Stack5,
|
|
812
568
|
{
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
569
|
+
direction: "row",
|
|
570
|
+
sx: {
|
|
571
|
+
justifyContent: "space-between",
|
|
572
|
+
alignItems: "center"
|
|
573
|
+
}
|
|
817
574
|
},
|
|
818
|
-
/* @__PURE__ */
|
|
819
|
-
|
|
820
|
-
};
|
|
821
|
-
var ShorthandControl = ({
|
|
822
|
-
children,
|
|
823
|
-
value,
|
|
824
|
-
currentValues,
|
|
825
|
-
updateValues,
|
|
826
|
-
"aria-label": ariaLabel
|
|
827
|
-
}) => {
|
|
828
|
-
const valuesArr = currentValues.split(" ").filter(Boolean);
|
|
829
|
-
const selected = valuesArr.includes(value);
|
|
830
|
-
const toggleValue = (newValue) => {
|
|
831
|
-
if (selected) {
|
|
832
|
-
updateValues(valuesArr.filter((v) => v !== newValue).join(" ") || null);
|
|
833
|
-
} else {
|
|
834
|
-
updateValues([...valuesArr, newValue].join(" "));
|
|
835
|
-
}
|
|
836
|
-
};
|
|
837
|
-
return /* @__PURE__ */ React22.createElement(ToggleButton, { value, onChange: toggleValue, selected, "aria-label": ariaLabel }, children);
|
|
575
|
+
/* @__PURE__ */ React17.createElement(ControlLabel3, null, label),
|
|
576
|
+
isAdded ? /* @__PURE__ */ React17.createElement(IconButton2, { size: SIZE2, onClick: onRemove }, /* @__PURE__ */ React17.createElement(MinusIcon, { fontSize: SIZE2 })) : /* @__PURE__ */ React17.createElement(IconButton2, { size: SIZE2, onClick: onAdd }, /* @__PURE__ */ React17.createElement(PlusIcon, { fontSize: SIZE2 }))
|
|
577
|
+
), /* @__PURE__ */ React17.createElement(Collapse2, { in: isAdded, unmountOnExit: true }, /* @__PURE__ */ React17.createElement(Stack5, { gap: 1.5 }, children)));
|
|
838
578
|
};
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
579
|
+
|
|
580
|
+
// src/components/style-sections/border-section/border-color-field.tsx
|
|
581
|
+
import * as React18 from "react";
|
|
582
|
+
import { ColorControl as ColorControl2, ControlLabel as ControlLabel4 } from "@elementor/editor-controls";
|
|
583
|
+
import { Grid as Grid2 } from "@elementor/ui";
|
|
584
|
+
import { __ as __3 } from "@wordpress/i18n";
|
|
585
|
+
var BorderColorField = () => {
|
|
586
|
+
return /* @__PURE__ */ React18.createElement(StylesField, { bind: "border-color" }, /* @__PURE__ */ React18.createElement(Grid2, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React18.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React18.createElement(ControlLabel4, null, __3("Border Color", "elementor"))), /* @__PURE__ */ React18.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React18.createElement(ColorControl2, null))));
|
|
844
587
|
};
|
|
845
588
|
|
|
846
|
-
// src/components/style-sections/
|
|
847
|
-
import
|
|
589
|
+
// src/components/style-sections/border-section/border-style-field.tsx
|
|
590
|
+
import * as React19 from "react";
|
|
591
|
+
import { ControlLabel as ControlLabel5, SelectControl as SelectControl2 } from "@elementor/editor-controls";
|
|
592
|
+
import { Grid as Grid3 } from "@elementor/ui";
|
|
593
|
+
import { __ as __4 } from "@wordpress/i18n";
|
|
594
|
+
var borderStyles = [
|
|
595
|
+
{ value: "none", label: __4("None", "elementor") },
|
|
596
|
+
{ value: "solid", label: __4("Solid", "elementor") },
|
|
597
|
+
{ value: "dashed", label: __4("Dashed", "elementor") },
|
|
598
|
+
{ value: "dotted", label: __4("Dotted", "elementor") },
|
|
599
|
+
{ value: "double", label: __4("Double", "elementor") },
|
|
600
|
+
{ value: "groove", label: __4("Groove", "elementor") },
|
|
601
|
+
{ value: "ridge", label: __4("Ridge", "elementor") },
|
|
602
|
+
{ value: "inset", label: __4("Inset", "elementor") },
|
|
603
|
+
{ value: "outset", label: __4("Outset", "elementor") }
|
|
604
|
+
];
|
|
605
|
+
var BorderStyleField = () => {
|
|
606
|
+
return /* @__PURE__ */ React19.createElement(StylesField, { bind: "border-style" }, /* @__PURE__ */ React19.createElement(Grid3, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React19.createElement(Grid3, { item: true, xs: 6 }, /* @__PURE__ */ React19.createElement(ControlLabel5, null, __4("Border Type", "elementor"))), /* @__PURE__ */ React19.createElement(Grid3, { item: true, xs: 6 }, /* @__PURE__ */ React19.createElement(SelectControl2, { options: borderStyles }))));
|
|
607
|
+
};
|
|
848
608
|
|
|
849
|
-
// src/components/style-sections/
|
|
850
|
-
import * as
|
|
609
|
+
// src/components/style-sections/border-section/border-width-field.tsx
|
|
610
|
+
import * as React20 from "react";
|
|
611
|
+
import { EqualUnequalSizesControl } from "@elementor/editor-controls";
|
|
612
|
+
import { SideAllIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
851
613
|
import { __ as __5 } from "@wordpress/i18n";
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
614
|
+
var edges = [
|
|
615
|
+
{
|
|
616
|
+
label: __5("Top", "elementor"),
|
|
617
|
+
icon: /* @__PURE__ */ React20.createElement(SideTopIcon, { fontSize: "tiny" }),
|
|
618
|
+
bind: "top"
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
label: __5("Right", "elementor"),
|
|
622
|
+
icon: /* @__PURE__ */ React20.createElement(SideRightIcon, { fontSize: "tiny" }),
|
|
623
|
+
bind: "right"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
label: __5("Bottom", "elementor"),
|
|
627
|
+
icon: /* @__PURE__ */ React20.createElement(SideBottomIcon, { fontSize: "tiny" }),
|
|
628
|
+
bind: "bottom"
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
label: __5("Left", "elementor"),
|
|
632
|
+
icon: /* @__PURE__ */ React20.createElement(SideLeftIcon, { fontSize: "tiny" }),
|
|
633
|
+
bind: "left"
|
|
634
|
+
}
|
|
635
|
+
];
|
|
636
|
+
var BorderWidthField = () => {
|
|
637
|
+
return /* @__PURE__ */ React20.createElement(StylesField, { bind: "border-width" }, /* @__PURE__ */ React20.createElement(
|
|
638
|
+
EqualUnequalSizesControl,
|
|
639
|
+
{
|
|
640
|
+
label: __5("Border Width", "elementor"),
|
|
641
|
+
icon: /* @__PURE__ */ React20.createElement(SideAllIcon, { fontSize: "tiny" }),
|
|
642
|
+
items: edges,
|
|
643
|
+
multiSizeType: "border-width"
|
|
644
|
+
}
|
|
645
|
+
));
|
|
855
646
|
};
|
|
856
647
|
|
|
857
|
-
// src/components/style-sections/
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
];
|
|
868
|
-
|
|
869
|
-
|
|
648
|
+
// src/components/style-sections/border-section/border-field.tsx
|
|
649
|
+
var initialSize = { $$type: "size", value: { size: 1, unit: "px" } };
|
|
650
|
+
var initialBorderWidth = {
|
|
651
|
+
$$type: "border-width",
|
|
652
|
+
value: { top: initialSize, right: initialSize, bottom: initialSize, left: initialSize }
|
|
653
|
+
};
|
|
654
|
+
var initialBorderColor = { $$type: "color", value: "#000000" };
|
|
655
|
+
var initialBorderStyle = "solid";
|
|
656
|
+
var BorderField = () => {
|
|
657
|
+
const [borderWidth, setBorderWidth] = useStylesField("border-width");
|
|
658
|
+
const [borderColor, setBorderColor] = useStylesField("border-color");
|
|
659
|
+
const [borderStyle, setBorderStyle] = useStylesField("border-style");
|
|
660
|
+
const addBorder = () => {
|
|
661
|
+
setBorderWidth(initialBorderWidth);
|
|
662
|
+
setBorderColor(initialBorderColor);
|
|
663
|
+
setBorderStyle(initialBorderStyle);
|
|
664
|
+
};
|
|
665
|
+
const removeBorder = () => {
|
|
666
|
+
setBorderWidth(null);
|
|
667
|
+
setBorderColor(null);
|
|
668
|
+
setBorderStyle(null);
|
|
669
|
+
};
|
|
670
|
+
const hasBorder = Boolean(borderWidth || borderColor || borderStyle);
|
|
671
|
+
return /* @__PURE__ */ React21.createElement(
|
|
672
|
+
AddOrRemoveContent,
|
|
673
|
+
{
|
|
674
|
+
label: __6("Border", "elementor"),
|
|
675
|
+
isAdded: hasBorder,
|
|
676
|
+
onAdd: addBorder,
|
|
677
|
+
onRemove: removeBorder
|
|
678
|
+
},
|
|
679
|
+
/* @__PURE__ */ React21.createElement(BorderWidthField, null),
|
|
680
|
+
/* @__PURE__ */ React21.createElement(BorderColorField, null),
|
|
681
|
+
/* @__PURE__ */ React21.createElement(BorderStyleField, null)
|
|
682
|
+
);
|
|
870
683
|
};
|
|
871
684
|
|
|
872
|
-
// src/components/style-sections/
|
|
873
|
-
import * as
|
|
685
|
+
// src/components/style-sections/border-section/border-radius-field.tsx
|
|
686
|
+
import * as React22 from "react";
|
|
687
|
+
import { EqualUnequalSizesControl as EqualUnequalSizesControl2 } from "@elementor/editor-controls";
|
|
688
|
+
import {
|
|
689
|
+
BorderCornersIcon,
|
|
690
|
+
RadiusBottomLeftIcon,
|
|
691
|
+
RadiusBottomRightIcon,
|
|
692
|
+
RadiusTopLeftIcon,
|
|
693
|
+
RadiusTopRightIcon
|
|
694
|
+
} from "@elementor/icons";
|
|
874
695
|
import { __ as __7 } from "@wordpress/i18n";
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
}
|
|
889
|
-
|
|
696
|
+
var corners = [
|
|
697
|
+
{
|
|
698
|
+
label: __7("Top Left", "elementor"),
|
|
699
|
+
icon: /* @__PURE__ */ React22.createElement(RadiusTopLeftIcon, { fontSize: "tiny" }),
|
|
700
|
+
bind: "top-left"
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
label: __7("Top Right", "elementor"),
|
|
704
|
+
icon: /* @__PURE__ */ React22.createElement(RadiusTopRightIcon, { fontSize: "tiny" }),
|
|
705
|
+
bind: "top-right"
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
label: __7("Bottom Right", "elementor"),
|
|
709
|
+
icon: /* @__PURE__ */ React22.createElement(RadiusBottomRightIcon, { fontSize: "tiny" }),
|
|
710
|
+
bind: "bottom-right"
|
|
711
|
+
},
|
|
712
|
+
{
|
|
713
|
+
label: __7("Bottom Left", "elementor"),
|
|
714
|
+
icon: /* @__PURE__ */ React22.createElement(RadiusBottomLeftIcon, { fontSize: "tiny" }),
|
|
715
|
+
bind: "bottom-left"
|
|
890
716
|
}
|
|
891
|
-
|
|
717
|
+
];
|
|
718
|
+
var BorderRadiusField = () => {
|
|
719
|
+
return /* @__PURE__ */ React22.createElement(StylesField, { bind: "border-radius" }, /* @__PURE__ */ React22.createElement(
|
|
720
|
+
EqualUnequalSizesControl2,
|
|
721
|
+
{
|
|
722
|
+
label: __7("Border Radius", "elementor"),
|
|
723
|
+
icon: /* @__PURE__ */ React22.createElement(BorderCornersIcon, { fontSize: "tiny" }),
|
|
724
|
+
items: corners,
|
|
725
|
+
multiSizeType: "border-radius"
|
|
726
|
+
}
|
|
727
|
+
));
|
|
728
|
+
};
|
|
892
729
|
|
|
893
|
-
// src/components/style-sections/
|
|
894
|
-
var
|
|
895
|
-
|
|
730
|
+
// src/components/style-sections/border-section/border-section.tsx
|
|
731
|
+
var BorderSection = () => /* @__PURE__ */ React23.createElement(Stack6, { gap: 1.5 }, /* @__PURE__ */ React23.createElement(BorderRadiusField, null), /* @__PURE__ */ React23.createElement(Divider2, null), /* @__PURE__ */ React23.createElement(BorderField, null));
|
|
732
|
+
|
|
733
|
+
// src/components/style-sections/effects-section/effects-section.tsx
|
|
734
|
+
import * as React24 from "react";
|
|
735
|
+
import { BoxShadowRepeaterControl } from "@elementor/editor-controls";
|
|
736
|
+
import { Stack as Stack7 } from "@elementor/ui";
|
|
737
|
+
var EffectsSection = () => {
|
|
738
|
+
return /* @__PURE__ */ React24.createElement(Stack7, { gap: 1.5 }, /* @__PURE__ */ React24.createElement(StylesField, { bind: "box-shadow" }, /* @__PURE__ */ React24.createElement(BoxShadowRepeaterControl, null)));
|
|
896
739
|
};
|
|
897
740
|
|
|
898
|
-
// src/components/style-sections/
|
|
741
|
+
// src/components/style-sections/layout-section/layout-section.tsx
|
|
899
742
|
import * as React27 from "react";
|
|
743
|
+
import { Stack as Stack10 } from "@elementor/ui";
|
|
744
|
+
|
|
745
|
+
// src/components/style-sections/layout-section/display-field.tsx
|
|
746
|
+
import * as React25 from "react";
|
|
747
|
+
import { ControlLabel as ControlLabel6, ToggleControl } from "@elementor/editor-controls";
|
|
748
|
+
import { Stack as Stack8 } from "@elementor/ui";
|
|
900
749
|
import { __ as __8 } from "@wordpress/i18n";
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
750
|
+
var DisplayField = () => {
|
|
751
|
+
const options5 = [
|
|
752
|
+
{
|
|
753
|
+
value: "block",
|
|
754
|
+
renderContent: () => __8("Block", "elementor"),
|
|
755
|
+
label: __8("Block", "elementor")
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
value: "flex",
|
|
759
|
+
renderContent: () => __8("Flex", "elementor"),
|
|
760
|
+
label: __8("Flex", "elementor")
|
|
761
|
+
}
|
|
762
|
+
];
|
|
763
|
+
return /* @__PURE__ */ React25.createElement(StylesField, { bind: "display" }, /* @__PURE__ */ React25.createElement(Stack8, { gap: 1 }, /* @__PURE__ */ React25.createElement(ControlLabel6, null, __8("Display", "elementor")), /* @__PURE__ */ React25.createElement(ToggleControl, { options: options5, fullWidth: true })));
|
|
904
764
|
};
|
|
905
765
|
|
|
906
|
-
// src/components/style-sections/
|
|
907
|
-
import * as
|
|
766
|
+
// src/components/style-sections/layout-section/justify-content-field.tsx
|
|
767
|
+
import * as React26 from "react";
|
|
768
|
+
import { ControlLabel as ControlLabel7, ToggleControl as ToggleControl2 } from "@elementor/editor-controls";
|
|
769
|
+
import {
|
|
770
|
+
JustifyBottomIcon,
|
|
771
|
+
JustifyCenterIcon,
|
|
772
|
+
JustifyDistributeVerticalIcon,
|
|
773
|
+
JustifySpaceAroundVerticalIcon,
|
|
774
|
+
JustifySpaceBetweenVerticalIcon,
|
|
775
|
+
JustifyTopIcon
|
|
776
|
+
} from "@elementor/icons";
|
|
777
|
+
import { Stack as Stack9 } from "@elementor/ui";
|
|
908
778
|
import { __ as __9 } from "@wordpress/i18n";
|
|
909
|
-
import { Grid as Grid8 } from "@elementor/ui";
|
|
910
|
-
var WordSpacingControl = () => {
|
|
911
|
-
return /* @__PURE__ */ React28.createElement(StyleControl, { bind: "word-spacing" }, /* @__PURE__ */ React28.createElement(Grid8, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React28.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(StyleControl.Label, null, __9("Word Spacing", "elementor"))), /* @__PURE__ */ React28.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(SizeControl, null))));
|
|
912
|
-
};
|
|
913
779
|
|
|
914
|
-
// src/
|
|
915
|
-
import
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
780
|
+
// src/hooks/use-direction.ts
|
|
781
|
+
import { useTheme } from "@elementor/ui";
|
|
782
|
+
function useDirection() {
|
|
783
|
+
const theme = useTheme(), extendedWindow = window;
|
|
784
|
+
const isUiRtl = "rtl" === theme.direction, isSiteRtl = !!extendedWindow.elementorFrontend?.config?.is_rtl;
|
|
785
|
+
return { isSiteRtl, isUiRtl };
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
// src/components/style-sections/layout-section/utils/rotate-flex-icon.ts
|
|
789
|
+
function rotateFlexIcon(direction = "row", initValue) {
|
|
790
|
+
const rotationIndexMap = {
|
|
791
|
+
row: 0,
|
|
792
|
+
column: 1,
|
|
793
|
+
"row-reverse": 2,
|
|
794
|
+
"column-reverse": 3
|
|
924
795
|
};
|
|
925
|
-
|
|
926
|
-
|
|
796
|
+
const rotationIndex = initValue + (rotationIndexMap[direction || "row"] ?? 0);
|
|
797
|
+
return `rotate(calc(90deg * ${rotationIndex}))`;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
// src/components/style-sections/layout-section/justify-content-field.tsx
|
|
801
|
+
var JustifyContentField = () => {
|
|
802
|
+
const [direction] = useStylesField("flex-direction");
|
|
803
|
+
const { isUiRtl, isSiteRtl } = useDirection(), sx = { transform: rotateFlexIcon(direction, -1) }, shouldReverseOrder = isSiteRtl !== isUiRtl;
|
|
804
|
+
const StartIcon = isSiteRtl ? JustifyBottomIcon : JustifyTopIcon, EndIcon = isSiteRtl ? JustifyTopIcon : JustifyBottomIcon;
|
|
805
|
+
const options5 = [
|
|
927
806
|
{
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
807
|
+
value: "start",
|
|
808
|
+
label: __9("Start", "elementor"),
|
|
809
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(StartIcon, { fontSize: size, sx }),
|
|
810
|
+
showTooltip: true
|
|
811
|
+
},
|
|
812
|
+
{
|
|
813
|
+
value: "center",
|
|
814
|
+
label: __9("Center", "elementor"),
|
|
815
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(JustifyCenterIcon, { fontSize: size, sx }),
|
|
816
|
+
showTooltip: true
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
value: "end",
|
|
820
|
+
label: __9("End", "elementor"),
|
|
821
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(EndIcon, { fontSize: size, sx }),
|
|
822
|
+
showTooltip: true
|
|
823
|
+
},
|
|
824
|
+
{
|
|
825
|
+
value: "space-between",
|
|
826
|
+
label: __9("Space Between", "elementor"),
|
|
827
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(JustifySpaceBetweenVerticalIcon, { fontSize: size, sx }),
|
|
828
|
+
showTooltip: true
|
|
829
|
+
},
|
|
830
|
+
{
|
|
831
|
+
value: "space-around",
|
|
832
|
+
label: __9("Space Around", "elementor"),
|
|
833
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(JustifySpaceAroundVerticalIcon, { fontSize: size, sx }),
|
|
834
|
+
showTooltip: true
|
|
934
835
|
},
|
|
935
|
-
|
|
936
|
-
|
|
836
|
+
{
|
|
837
|
+
value: "space-evenly",
|
|
838
|
+
label: __9("Space Evenly", "elementor"),
|
|
839
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(JustifyDistributeVerticalIcon, { fontSize: size, sx }),
|
|
840
|
+
showTooltip: true
|
|
841
|
+
}
|
|
842
|
+
];
|
|
843
|
+
if (shouldReverseOrder) {
|
|
844
|
+
options5.reverse();
|
|
845
|
+
}
|
|
846
|
+
return /* @__PURE__ */ React26.createElement(StylesField, { bind: "justify-content" }, /* @__PURE__ */ React26.createElement(Stack9, { gap: 1 }, /* @__PURE__ */ React26.createElement(ControlLabel7, null, __9("Justify Content", "elementor")), /* @__PURE__ */ React26.createElement(ToggleControl2, { options: options5, fullWidth: true })));
|
|
937
847
|
};
|
|
938
|
-
var ChevronIcon = styled3(ChevronDownIcon, {
|
|
939
|
-
shouldForwardProp: (prop) => prop !== "open"
|
|
940
|
-
})(({ theme, open }) => ({
|
|
941
|
-
transform: open ? "rotate(180deg)" : "rotate(0)",
|
|
942
|
-
transition: theme.transitions.create("transform", {
|
|
943
|
-
duration: theme.transitions.duration.standard
|
|
944
|
-
})
|
|
945
|
-
}));
|
|
946
848
|
|
|
947
|
-
// src/components/style-sections/
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
849
|
+
// src/components/style-sections/layout-section/layout-section.tsx
|
|
850
|
+
var LayoutSection = () => {
|
|
851
|
+
const [display] = useStylesField("display");
|
|
852
|
+
return /* @__PURE__ */ React27.createElement(Stack10, { gap: 2 }, /* @__PURE__ */ React27.createElement(DisplayField, null), "flex" === display && /* @__PURE__ */ React27.createElement(JustifyContentField, null));
|
|
853
|
+
};
|
|
952
854
|
|
|
953
|
-
// src/
|
|
855
|
+
// src/components/style-sections/position-section/position-section.tsx
|
|
954
856
|
import * as React31 from "react";
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
857
|
+
import { useCallback as useCallback3 } from "react";
|
|
858
|
+
import { Stack as Stack12 } from "@elementor/ui";
|
|
859
|
+
|
|
860
|
+
// src/hooks/use-style-prop-history.ts
|
|
861
|
+
import { useCallback as useCallback2, useMemo as useMemo2 } from "react";
|
|
862
|
+
import { getElementStyles, getVariantByMeta, updateStyle as updateStyle2 } from "@elementor/editor-elements";
|
|
863
|
+
|
|
864
|
+
// src/hooks/use-prop-value-history.ts
|
|
865
|
+
import { useCallback, useMemo } from "react";
|
|
866
|
+
import { getSessionStorageItem, setSessionStorageItem } from "@elementor/utils";
|
|
867
|
+
var PROPS_VALUES_HISTORY_PREFIX = "elementor/editor-editing-panel/prop-value-history";
|
|
868
|
+
var usePropValueHistory = () => {
|
|
869
|
+
const { element } = useElement();
|
|
870
|
+
const elementKey = `${PROPS_VALUES_HISTORY_PREFIX}/${element.id}`;
|
|
871
|
+
const getElementPropsHistory = useCallback(() => {
|
|
872
|
+
return getSessionStorageItem(elementKey);
|
|
873
|
+
}, [elementKey]);
|
|
874
|
+
const getPropValue = useCallback(
|
|
875
|
+
(propKey) => {
|
|
876
|
+
const elementPropValues = getElementPropsHistory();
|
|
877
|
+
return elementPropValues?.[propKey] ?? null;
|
|
878
|
+
},
|
|
879
|
+
[getElementPropsHistory]
|
|
880
|
+
);
|
|
881
|
+
const setPropValue = useCallback(
|
|
882
|
+
(propKey, propValue) => {
|
|
883
|
+
const elementPropValues = getElementPropsHistory();
|
|
884
|
+
const updatedElementPropValues = { ...elementPropValues, [propKey]: propValue };
|
|
885
|
+
setSessionStorageItem(elementKey, updatedElementPropValues);
|
|
886
|
+
},
|
|
887
|
+
[getElementPropsHistory, elementKey]
|
|
888
|
+
);
|
|
889
|
+
const removeProp = useCallback(
|
|
890
|
+
(propKey) => {
|
|
891
|
+
const elementPropValues = getElementPropsHistory();
|
|
892
|
+
const updatedElementPropValues = Object.fromEntries(
|
|
893
|
+
Object.entries(elementPropValues || {}).filter(([key]) => key !== propKey)
|
|
894
|
+
);
|
|
895
|
+
setSessionStorageItem(elementKey, updatedElementPropValues);
|
|
896
|
+
},
|
|
897
|
+
[getElementPropsHistory, elementKey]
|
|
898
|
+
);
|
|
899
|
+
return useMemo(() => ({ getPropValue, setPropValue, removeProp }), [getPropValue, removeProp, setPropValue]);
|
|
974
900
|
};
|
|
975
901
|
|
|
976
|
-
// src/
|
|
977
|
-
var
|
|
978
|
-
const {
|
|
979
|
-
const
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
902
|
+
// src/hooks/use-style-prop-history.ts
|
|
903
|
+
var useStylePropsHistory = (props) => {
|
|
904
|
+
const { element } = useElement();
|
|
905
|
+
const { id: styleDefID, meta } = useStyle();
|
|
906
|
+
const { getPropValue, setPropValue, removeProp } = usePropValueHistory();
|
|
907
|
+
const styleDef = getElementStyles(element.id)?.[styleDefID];
|
|
908
|
+
const styleVariant = styleDef ? getVariantByMeta(styleDef, meta) : null;
|
|
909
|
+
const styleVariantPath = `${styleDefID}-${styleVariant?.meta.breakpoint}-${styleVariant?.meta.state}`;
|
|
910
|
+
const saveStylePropsHistory = useCallback2(() => {
|
|
911
|
+
props.forEach((propKey) => {
|
|
912
|
+
const propValue = styleVariant?.props[propKey];
|
|
913
|
+
if (propValue) {
|
|
914
|
+
const propPath = `${styleVariantPath}-${propKey}`;
|
|
915
|
+
setPropValue(propPath, propValue);
|
|
916
|
+
}
|
|
917
|
+
});
|
|
918
|
+
}, [props, setPropValue, styleVariant?.props, styleVariantPath]);
|
|
919
|
+
const updateStylePropsFromHistory = useCallback2(() => {
|
|
920
|
+
const propValuesFromHistory = props.reduce((allProps, currentPropKey) => {
|
|
921
|
+
const propPath = `${styleVariantPath}-${currentPropKey}`;
|
|
922
|
+
const propHistory = getPropValue(propPath);
|
|
923
|
+
if (propHistory) {
|
|
924
|
+
removeProp(propPath);
|
|
925
|
+
return { ...allProps, [currentPropKey]: propHistory };
|
|
926
|
+
}
|
|
927
|
+
return allProps;
|
|
928
|
+
}, {});
|
|
929
|
+
if (Object.keys(propValuesFromHistory).length) {
|
|
930
|
+
updateStyle2({
|
|
931
|
+
elementID: element.id,
|
|
932
|
+
styleDefID,
|
|
933
|
+
meta,
|
|
934
|
+
props: propValuesFromHistory,
|
|
935
|
+
bind: "classes"
|
|
936
|
+
});
|
|
989
937
|
}
|
|
938
|
+
}, [element.id, getPropValue, meta, props, removeProp, styleDefID, styleVariantPath]);
|
|
939
|
+
const clearCurrentStyleProps = useCallback2(() => {
|
|
940
|
+
const resetValues = props.reduce(
|
|
941
|
+
(allProps, currentPropKey) => ({
|
|
942
|
+
...allProps,
|
|
943
|
+
[currentPropKey]: void 0
|
|
944
|
+
}),
|
|
945
|
+
{}
|
|
946
|
+
);
|
|
947
|
+
updateStyle2({
|
|
948
|
+
elementID: element.id,
|
|
949
|
+
styleDefID,
|
|
950
|
+
meta,
|
|
951
|
+
props: resetValues,
|
|
952
|
+
bind: "classes"
|
|
953
|
+
});
|
|
954
|
+
}, [element.id, meta, props, styleDefID]);
|
|
955
|
+
return useMemo2(
|
|
956
|
+
() => ({ saveStylePropsHistory, updateStylePropsFromHistory, clearCurrentStyleProps }),
|
|
957
|
+
[saveStylePropsHistory, updateStylePropsFromHistory, clearCurrentStyleProps]
|
|
990
958
|
);
|
|
991
|
-
}
|
|
959
|
+
};
|
|
992
960
|
|
|
993
|
-
// src/components/style-sections/
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
961
|
+
// src/components/style-sections/position-section/dimensions-field.tsx
|
|
962
|
+
import * as React28 from "react";
|
|
963
|
+
import { ControlLabel as ControlLabel8, SizeControl as SizeControl2 } from "@elementor/editor-controls";
|
|
964
|
+
import { SideBottomIcon as SideBottomIcon2, SideLeftIcon as SideLeftIcon2, SideRightIcon as SideRightIcon2, SideTopIcon as SideTopIcon2 } from "@elementor/icons";
|
|
965
|
+
import { Grid as Grid4, Stack as Stack11 } from "@elementor/ui";
|
|
966
|
+
import { __ as __10 } from "@wordpress/i18n";
|
|
967
|
+
var sideIcons = {
|
|
968
|
+
left: /* @__PURE__ */ React28.createElement(SideLeftIcon2, { fontSize: "tiny" }),
|
|
969
|
+
right: /* @__PURE__ */ React28.createElement(SideRightIcon2, { fontSize: "tiny" }),
|
|
970
|
+
top: /* @__PURE__ */ React28.createElement(SideTopIcon2, { fontSize: "tiny" }),
|
|
971
|
+
bottom: /* @__PURE__ */ React28.createElement(SideBottomIcon2, { fontSize: "tiny" })
|
|
972
|
+
};
|
|
973
|
+
var DimensionsField = () => {
|
|
974
|
+
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(Stack11, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React28.createElement(DimensionField, { side: "top", label: __10("Top", "elementor") }), /* @__PURE__ */ React28.createElement(DimensionField, { side: "right", label: __10("Right", "elementor") })), /* @__PURE__ */ React28.createElement(Stack11, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React28.createElement(DimensionField, { side: "bottom", label: __10("Bottom", "elementor") }), /* @__PURE__ */ React28.createElement(DimensionField, { side: "left", label: __10("Left", "elementor") })));
|
|
975
|
+
};
|
|
976
|
+
var DimensionField = ({ side, label }) => {
|
|
977
|
+
return /* @__PURE__ */ React28.createElement(Grid4, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React28.createElement(Grid4, { item: true, xs: 12 }, /* @__PURE__ */ React28.createElement(ControlLabel8, null, label)), /* @__PURE__ */ React28.createElement(Grid4, { item: true, xs: 12 }, /* @__PURE__ */ React28.createElement(StylesField, { bind: side }, /* @__PURE__ */ React28.createElement(SizeControl2, { startIcon: sideIcons[side] }))));
|
|
978
|
+
};
|
|
979
|
+
|
|
980
|
+
// src/components/style-sections/position-section/position-field.tsx
|
|
981
|
+
import * as React29 from "react";
|
|
982
|
+
import { ControlLabel as ControlLabel9, SelectControl as SelectControl3 } from "@elementor/editor-controls";
|
|
983
|
+
import { Grid as Grid5 } from "@elementor/ui";
|
|
984
|
+
import { __ as __11 } from "@wordpress/i18n";
|
|
985
|
+
var positionOptions = [
|
|
986
|
+
{ label: __11("Static", "elementor"), value: "static" },
|
|
987
|
+
{ label: __11("Relative", "elementor"), value: "relative" },
|
|
988
|
+
{ label: __11("Absolute", "elementor"), value: "absolute" },
|
|
989
|
+
{ label: __11("Fixed", "elementor"), value: "fixed" }
|
|
998
990
|
];
|
|
999
|
-
var
|
|
991
|
+
var PositionField = () => {
|
|
992
|
+
return /* @__PURE__ */ React29.createElement(StylesField, { bind: "position" }, /* @__PURE__ */ React29.createElement(Grid5, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React29.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React29.createElement(ControlLabel9, null, __11("Position", "elementor"))), /* @__PURE__ */ React29.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React29.createElement(SelectControl3, { options: positionOptions }))));
|
|
993
|
+
};
|
|
1000
994
|
|
|
1001
|
-
// src/components/style-sections/
|
|
1002
|
-
import * as
|
|
995
|
+
// src/components/style-sections/position-section/z-index-field.tsx
|
|
996
|
+
import * as React30 from "react";
|
|
997
|
+
import { ControlLabel as ControlLabel10, NumberControl } from "@elementor/editor-controls";
|
|
998
|
+
import { Grid as Grid6 } from "@elementor/ui";
|
|
1003
999
|
import { __ as __12 } from "@wordpress/i18n";
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
var options2 = [
|
|
1007
|
-
{
|
|
1008
|
-
value: "left",
|
|
1009
|
-
label: __12("Left", "elementor"),
|
|
1010
|
-
icon: AlignLeftIcon
|
|
1011
|
-
},
|
|
1012
|
-
{
|
|
1013
|
-
value: "center",
|
|
1014
|
-
label: __12("Center", "elementor"),
|
|
1015
|
-
icon: AlignCenterIcon
|
|
1016
|
-
},
|
|
1017
|
-
{
|
|
1018
|
-
value: "right",
|
|
1019
|
-
label: __12("Right", "elementor"),
|
|
1020
|
-
icon: AlignRightIcon
|
|
1021
|
-
},
|
|
1022
|
-
{
|
|
1023
|
-
value: "justify",
|
|
1024
|
-
label: __12("Justify", "elementor"),
|
|
1025
|
-
icon: AlignJustifiedIcon
|
|
1026
|
-
}
|
|
1027
|
-
];
|
|
1028
|
-
var TextAlignmentControl = () => {
|
|
1029
|
-
return /* @__PURE__ */ React33.createElement(StyleControl, { bind: "text-align" }, /* @__PURE__ */ React33.createElement(Grid10, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React33.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(StyleControl.Label, null, __12("Alignment", "elementor"))), /* @__PURE__ */ React33.createElement(Grid10, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React33.createElement(ToggleControl, { options: options2 }))));
|
|
1000
|
+
var ZIndexField = () => {
|
|
1001
|
+
return /* @__PURE__ */ React30.createElement(StylesField, { bind: "z-index" }, /* @__PURE__ */ React30.createElement(Grid6, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React30.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlLabel10, null, __12("Z-Index", "elementor"))), /* @__PURE__ */ React30.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(NumberControl, null))));
|
|
1030
1002
|
};
|
|
1031
1003
|
|
|
1032
|
-
// src/components/style-sections/
|
|
1033
|
-
|
|
1004
|
+
// src/components/style-sections/position-section/position-section.tsx
|
|
1005
|
+
var dimensionsPropKeys = ["top", "bottom", "left", "right"];
|
|
1006
|
+
var PositionSection = () => {
|
|
1007
|
+
const [positionValue] = useStylesField("position");
|
|
1008
|
+
usePositionChangeHandler();
|
|
1009
|
+
const isNotStatic = positionValue && positionValue !== "static";
|
|
1010
|
+
return /* @__PURE__ */ React31.createElement(Stack12, { 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);
|
|
1011
|
+
};
|
|
1012
|
+
var usePositionChangeHandler = () => {
|
|
1013
|
+
const dimensionsHistory = useStylePropsHistory(dimensionsPropKeys);
|
|
1014
|
+
const onPositionChange = useCallback3(
|
|
1015
|
+
(newPositionValue, previousPosition) => {
|
|
1016
|
+
if (!dimensionsHistory) {
|
|
1017
|
+
return;
|
|
1018
|
+
}
|
|
1019
|
+
const { saveStylePropsHistory, updateStylePropsFromHistory, clearCurrentStyleProps } = dimensionsHistory;
|
|
1020
|
+
if (newPositionValue === "static") {
|
|
1021
|
+
saveStylePropsHistory();
|
|
1022
|
+
clearCurrentStyleProps();
|
|
1023
|
+
} else if (previousPosition === "static") {
|
|
1024
|
+
updateStylePropsFromHistory();
|
|
1025
|
+
}
|
|
1026
|
+
previousPosition = newPositionValue;
|
|
1027
|
+
},
|
|
1028
|
+
[dimensionsHistory]
|
|
1029
|
+
);
|
|
1030
|
+
const [, , registerChangeListener] = useStylesField("position");
|
|
1031
|
+
registerChangeListener?.(onPositionChange);
|
|
1032
|
+
};
|
|
1033
|
+
|
|
1034
|
+
// src/components/style-sections/size-section/size-section.tsx
|
|
1035
|
+
import * as React33 from "react";
|
|
1036
|
+
import { ControlLabel as ControlLabel12, SizeControl as SizeControl3 } from "@elementor/editor-controls";
|
|
1037
|
+
import { Divider as Divider3, Grid as Grid8, Stack as Stack13 } from "@elementor/ui";
|
|
1038
|
+
import { __ as __14 } from "@wordpress/i18n";
|
|
1039
|
+
|
|
1040
|
+
// src/components/style-sections/size-section/overflow-field.tsx
|
|
1041
|
+
import * as React32 from "react";
|
|
1042
|
+
import { ControlLabel as ControlLabel11, ToggleControl as ToggleControl3 } from "@elementor/editor-controls";
|
|
1043
|
+
import { ExpandBottomIcon, EyeIcon, EyeOffIcon } from "@elementor/icons";
|
|
1044
|
+
import { Grid as Grid7 } from "@elementor/ui";
|
|
1034
1045
|
import { __ as __13 } from "@wordpress/i18n";
|
|
1035
|
-
|
|
1036
|
-
import { TextDirectionLtrIcon, TextDirectionRtlIcon } from "@elementor/icons";
|
|
1037
|
-
var options3 = [
|
|
1046
|
+
var options = [
|
|
1038
1047
|
{
|
|
1039
|
-
value: "
|
|
1040
|
-
label: __13("
|
|
1041
|
-
|
|
1048
|
+
value: "visible",
|
|
1049
|
+
label: __13("Visible", "elementor"),
|
|
1050
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(EyeIcon, { fontSize: size }),
|
|
1051
|
+
showTooltip: true
|
|
1042
1052
|
},
|
|
1043
1053
|
{
|
|
1044
|
-
value: "
|
|
1045
|
-
label: __13("
|
|
1046
|
-
|
|
1054
|
+
value: "hidden",
|
|
1055
|
+
label: __13("Hidden", "elementor"),
|
|
1056
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(EyeOffIcon, { fontSize: size }),
|
|
1057
|
+
showTooltip: true
|
|
1058
|
+
},
|
|
1059
|
+
{
|
|
1060
|
+
value: "auto",
|
|
1061
|
+
label: __13("Auto", "elementor"),
|
|
1062
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(ExpandBottomIcon, { fontSize: size }),
|
|
1063
|
+
showTooltip: true
|
|
1047
1064
|
}
|
|
1048
1065
|
];
|
|
1049
|
-
var
|
|
1050
|
-
return /* @__PURE__ */
|
|
1066
|
+
var OverflowField = () => {
|
|
1067
|
+
return /* @__PURE__ */ React32.createElement(StylesField, { bind: "overflow" }, /* @__PURE__ */ React32.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(ControlLabel11, null, __13("Overflow", "elementor"))), /* @__PURE__ */ React32.createElement(Grid7, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React32.createElement(ToggleControl3, { options }))));
|
|
1051
1068
|
};
|
|
1052
1069
|
|
|
1053
|
-
// src/components/style-sections/
|
|
1054
|
-
var
|
|
1055
|
-
return /* @__PURE__ */
|
|
1070
|
+
// src/components/style-sections/size-section/size-section.tsx
|
|
1071
|
+
var SizeSection = () => {
|
|
1072
|
+
return /* @__PURE__ */ React33.createElement(Stack13, { gap: 1.5 }, /* @__PURE__ */ React33.createElement(Grid8, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React33.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(SizeField, { bind: "width", label: __14("Width", "elementor") })), /* @__PURE__ */ React33.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(SizeField, { bind: "height", label: __14("Height", "elementor") }))), /* @__PURE__ */ React33.createElement(Grid8, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React33.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(SizeField, { bind: "min-width", label: __14("Min. Width", "elementor") })), /* @__PURE__ */ React33.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(SizeField, { bind: "min-height", label: __14("Min. Height", "elementor") }))), /* @__PURE__ */ React33.createElement(Grid8, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React33.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(SizeField, { bind: "max-width", label: __14("Max. Width", "elementor") })), /* @__PURE__ */ React33.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(SizeField, { bind: "max-height", label: __14("Max. Height", "elementor") }))), /* @__PURE__ */ React33.createElement(Divider3, null), /* @__PURE__ */ React33.createElement(Stack13, null, /* @__PURE__ */ React33.createElement(OverflowField, null)));
|
|
1073
|
+
};
|
|
1074
|
+
var SizeField = ({ label, bind }) => {
|
|
1075
|
+
return /* @__PURE__ */ React33.createElement(StylesField, { bind }, /* @__PURE__ */ React33.createElement(Grid8, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React33.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React33.createElement(ControlLabel12, null, label)), /* @__PURE__ */ React33.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React33.createElement(SizeControl3, null))));
|
|
1056
1076
|
};
|
|
1057
1077
|
|
|
1058
|
-
// src/components/style-sections/
|
|
1059
|
-
import * as
|
|
1060
|
-
import {
|
|
1061
|
-
|
|
1062
|
-
// src/components/style-sections/position-section/z-index-control.tsx
|
|
1063
|
-
import * as React37 from "react";
|
|
1078
|
+
// src/components/style-sections/spacing-section/spacing-section.tsx
|
|
1079
|
+
import * as React34 from "react";
|
|
1080
|
+
import { LinkedDimensionsControl } from "@elementor/editor-controls";
|
|
1081
|
+
import { Divider as Divider4, Stack as Stack14 } from "@elementor/ui";
|
|
1064
1082
|
import { __ as __15 } from "@wordpress/i18n";
|
|
1065
|
-
|
|
1083
|
+
var SpacingSection = () => {
|
|
1084
|
+
return /* @__PURE__ */ React34.createElement(Stack14, { gap: 1.5 }, /* @__PURE__ */ React34.createElement(StylesField, { bind: "padding" }, /* @__PURE__ */ React34.createElement(LinkedDimensionsControl, { label: __15("Padding", "elementor") })), /* @__PURE__ */ React34.createElement(Divider4, null), /* @__PURE__ */ React34.createElement(StylesField, { bind: "margin" }, /* @__PURE__ */ React34.createElement(LinkedDimensionsControl, { label: __15("Margin", "elementor") })));
|
|
1085
|
+
};
|
|
1066
1086
|
|
|
1067
|
-
// src/
|
|
1068
|
-
import * as
|
|
1069
|
-
import {
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1087
|
+
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1088
|
+
import * as React48 from "react";
|
|
1089
|
+
import { Divider as Divider5, Stack as Stack17 } from "@elementor/ui";
|
|
1090
|
+
|
|
1091
|
+
// src/components/collapsible-content.tsx
|
|
1092
|
+
import * as React35 from "react";
|
|
1093
|
+
import { useState as useState2 } from "react";
|
|
1094
|
+
import { Button, Collapse as Collapse3, Stack as Stack15 } from "@elementor/ui";
|
|
1095
|
+
import { __ as __16 } from "@wordpress/i18n";
|
|
1096
|
+
var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
1097
|
+
const [open, setOpen] = useState2(defaultOpen);
|
|
1098
|
+
const handleToggle = () => {
|
|
1099
|
+
setOpen((prevOpen) => !prevOpen);
|
|
1076
1100
|
};
|
|
1077
|
-
return /* @__PURE__ */
|
|
1078
|
-
|
|
1101
|
+
return /* @__PURE__ */ React35.createElement(Stack15, { sx: { py: 0.5 } }, /* @__PURE__ */ React35.createElement(
|
|
1102
|
+
Button,
|
|
1079
1103
|
{
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1104
|
+
fullWidth: true,
|
|
1105
|
+
size: "small",
|
|
1106
|
+
color: "secondary",
|
|
1107
|
+
variant: "outlined",
|
|
1108
|
+
onClick: handleToggle,
|
|
1109
|
+
endIcon: /* @__PURE__ */ React35.createElement(CollapseIcon, { open })
|
|
1110
|
+
},
|
|
1111
|
+
open ? __16("Show less", "elementor") : __16("Show more", "elementor")
|
|
1112
|
+
), /* @__PURE__ */ React35.createElement(Collapse3, { in: open, timeout: "auto", unmountOnExit: true }, children));
|
|
1113
|
+
};
|
|
1088
1114
|
|
|
1089
|
-
// src/components/style-sections/
|
|
1090
|
-
|
|
1091
|
-
|
|
1115
|
+
// src/components/style-sections/typography-section/font-family-field.tsx
|
|
1116
|
+
import * as React36 from "react";
|
|
1117
|
+
import { ControlLabel as ControlLabel13, FontFamilyControl } from "@elementor/editor-controls";
|
|
1118
|
+
import { Grid as Grid9 } from "@elementor/ui";
|
|
1119
|
+
import { __ as __17 } from "@wordpress/i18n";
|
|
1120
|
+
|
|
1121
|
+
// src/sync/get-elementor-config.ts
|
|
1122
|
+
var getElementorConfig = () => {
|
|
1123
|
+
const extendedWindow = window;
|
|
1124
|
+
return extendedWindow.elementor?.config ?? {};
|
|
1092
1125
|
};
|
|
1093
1126
|
|
|
1094
|
-
// src/components/style-sections/
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1127
|
+
// src/components/style-sections/typography-section/font-family-field.tsx
|
|
1128
|
+
var FontFamilyField = () => {
|
|
1129
|
+
const fontFamilies = getFontFamilies();
|
|
1130
|
+
if (!fontFamilies) {
|
|
1131
|
+
return null;
|
|
1132
|
+
}
|
|
1133
|
+
return /* @__PURE__ */ React36.createElement(StylesField, { bind: "font-family" }, /* @__PURE__ */ React36.createElement(Grid9, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React36.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(ControlLabel13, null, __17("Font Family", "elementor"))), /* @__PURE__ */ React36.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(FontFamilyControl, { fontFamilies }))));
|
|
1134
|
+
};
|
|
1135
|
+
var getFontFamilies = () => {
|
|
1136
|
+
const { controls } = getElementorConfig();
|
|
1137
|
+
const options5 = controls?.font?.options;
|
|
1138
|
+
if (!options5) {
|
|
1139
|
+
return null;
|
|
1140
|
+
}
|
|
1141
|
+
return options5;
|
|
1098
1142
|
};
|
|
1099
1143
|
|
|
1100
|
-
// src/components/style-sections/
|
|
1101
|
-
import * as
|
|
1102
|
-
import {
|
|
1144
|
+
// src/components/style-sections/typography-section/font-size-field.tsx
|
|
1145
|
+
import * as React37 from "react";
|
|
1146
|
+
import { ControlLabel as ControlLabel14, SizeControl as SizeControl4 } from "@elementor/editor-controls";
|
|
1147
|
+
import { Grid as Grid10 } from "@elementor/ui";
|
|
1103
1148
|
import { __ as __18 } from "@wordpress/i18n";
|
|
1149
|
+
var FontSizeField = () => {
|
|
1150
|
+
return /* @__PURE__ */ React37.createElement(StylesField, { bind: "font-size" }, /* @__PURE__ */ React37.createElement(Grid10, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React37.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(ControlLabel14, null, __18("Font Size", "elementor"))), /* @__PURE__ */ React37.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(SizeControl4, null))));
|
|
1151
|
+
};
|
|
1104
1152
|
|
|
1105
|
-
// src/components/style-sections/
|
|
1153
|
+
// src/components/style-sections/typography-section/font-weight-field.tsx
|
|
1154
|
+
import * as React38 from "react";
|
|
1155
|
+
import { ControlLabel as ControlLabel15, SelectControl as SelectControl4 } from "@elementor/editor-controls";
|
|
1156
|
+
import { Grid as Grid11 } from "@elementor/ui";
|
|
1157
|
+
import { __ as __19 } from "@wordpress/i18n";
|
|
1158
|
+
var fontWeightOptions = [
|
|
1159
|
+
{ label: __19("Light - 400", "elementor"), value: "400" },
|
|
1160
|
+
{ label: __19("Regular - 500", "elementor"), value: "500" },
|
|
1161
|
+
{ label: __19("Semi Bold - 600", "elementor"), value: "600" },
|
|
1162
|
+
{ label: __19("Bold - 700", "elementor"), value: "700" },
|
|
1163
|
+
{ label: __19("Black - 900", "elementor"), value: "900" }
|
|
1164
|
+
];
|
|
1165
|
+
var FontWeightField = () => {
|
|
1166
|
+
return /* @__PURE__ */ React38.createElement(StylesField, { bind: "font-weight" }, /* @__PURE__ */ React38.createElement(Grid11, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React38.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(ControlLabel15, null, __19("Font Weight", "elementor"))), /* @__PURE__ */ React38.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(SelectControl4, { options: fontWeightOptions }))));
|
|
1167
|
+
};
|
|
1168
|
+
|
|
1169
|
+
// src/components/style-sections/typography-section/letter-spacing-field.tsx
|
|
1106
1170
|
import * as React39 from "react";
|
|
1107
|
-
import {
|
|
1108
|
-
import { Grid as
|
|
1109
|
-
import {
|
|
1110
|
-
var
|
|
1111
|
-
|
|
1112
|
-
const { top, right, bottom, left, isLinked = true } = value?.value || {};
|
|
1113
|
-
const setLinkedValue = (position, newValue) => {
|
|
1114
|
-
const updatedValue = {
|
|
1115
|
-
isLinked,
|
|
1116
|
-
top: isLinked ? newValue : top,
|
|
1117
|
-
right: isLinked ? newValue : right,
|
|
1118
|
-
bottom: isLinked ? newValue : bottom,
|
|
1119
|
-
left: isLinked ? newValue : left,
|
|
1120
|
-
[position]: newValue
|
|
1121
|
-
};
|
|
1122
|
-
setValue({
|
|
1123
|
-
$$type: "linked-dimensions",
|
|
1124
|
-
value: updatedValue
|
|
1125
|
-
});
|
|
1126
|
-
};
|
|
1127
|
-
const toggleLinked = () => {
|
|
1128
|
-
const updatedValue = {
|
|
1129
|
-
isLinked: !isLinked,
|
|
1130
|
-
top,
|
|
1131
|
-
right: !isLinked ? top : right,
|
|
1132
|
-
bottom: !isLinked ? top : bottom,
|
|
1133
|
-
left: !isLinked ? top : left
|
|
1134
|
-
};
|
|
1135
|
-
setValue({
|
|
1136
|
-
$$type: "linked-dimensions",
|
|
1137
|
-
value: updatedValue
|
|
1138
|
-
});
|
|
1139
|
-
};
|
|
1140
|
-
const LinkedIcon = isLinked ? LinkIcon : DetachIcon;
|
|
1141
|
-
return /* @__PURE__ */ React39.createElement(React39.Fragment, null, /* @__PURE__ */ React39.createElement(Stack10, { direction: "row", gap: 2 }, /* @__PURE__ */ React39.createElement(ControlLabel, null, label), /* @__PURE__ */ React39.createElement(
|
|
1142
|
-
ToggleButton3,
|
|
1143
|
-
{
|
|
1144
|
-
"aria-label": __17("Link Inputs", "elementor"),
|
|
1145
|
-
size: "tiny",
|
|
1146
|
-
value: "check",
|
|
1147
|
-
selected: isLinked,
|
|
1148
|
-
sx: { marginLeft: "auto" },
|
|
1149
|
-
onChange: toggleLinked
|
|
1150
|
-
},
|
|
1151
|
-
/* @__PURE__ */ React39.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1152
|
-
)), /* @__PURE__ */ React39.createElement(Stack10, { direction: "row", gap: 2 }, /* @__PURE__ */ React39.createElement(Grid13, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React39.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React39.createElement(ControlLabel, null, __17("Top", "elementor"))), /* @__PURE__ */ React39.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React39.createElement(
|
|
1153
|
-
Control4,
|
|
1154
|
-
{
|
|
1155
|
-
bind: "top",
|
|
1156
|
-
value: top,
|
|
1157
|
-
setValue: setLinkedValue,
|
|
1158
|
-
startIcon: /* @__PURE__ */ React39.createElement(SideTopIcon, { fontSize: "tiny" })
|
|
1159
|
-
}
|
|
1160
|
-
))), /* @__PURE__ */ React39.createElement(Grid13, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React39.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React39.createElement(ControlLabel, null, __17("Right", "elementor"))), /* @__PURE__ */ React39.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React39.createElement(
|
|
1161
|
-
Control4,
|
|
1162
|
-
{
|
|
1163
|
-
bind: "right",
|
|
1164
|
-
value: right,
|
|
1165
|
-
setValue: setLinkedValue,
|
|
1166
|
-
startIcon: /* @__PURE__ */ React39.createElement(SideRightIcon, { fontSize: "tiny" })
|
|
1167
|
-
}
|
|
1168
|
-
)))), /* @__PURE__ */ React39.createElement(Stack10, { direction: "row", gap: 2 }, /* @__PURE__ */ React39.createElement(Grid13, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React39.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React39.createElement(ControlLabel, null, __17("Bottom", "elementor"))), /* @__PURE__ */ React39.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React39.createElement(
|
|
1169
|
-
Control4,
|
|
1170
|
-
{
|
|
1171
|
-
bind: "bottom",
|
|
1172
|
-
value: bottom,
|
|
1173
|
-
setValue: setLinkedValue,
|
|
1174
|
-
startIcon: /* @__PURE__ */ React39.createElement(SideBottomIcon, { fontSize: "tiny" })
|
|
1175
|
-
}
|
|
1176
|
-
))), /* @__PURE__ */ React39.createElement(Grid13, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React39.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React39.createElement(ControlLabel, null, __17("Left", "elementor"))), /* @__PURE__ */ React39.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React39.createElement(
|
|
1177
|
-
Control4,
|
|
1178
|
-
{
|
|
1179
|
-
bind: "left",
|
|
1180
|
-
value: left,
|
|
1181
|
-
setValue: setLinkedValue,
|
|
1182
|
-
startIcon: /* @__PURE__ */ React39.createElement(SideLeftIcon, { fontSize: "tiny" })
|
|
1183
|
-
}
|
|
1184
|
-
)))));
|
|
1171
|
+
import { ControlLabel as ControlLabel16, SizeControl as SizeControl5 } from "@elementor/editor-controls";
|
|
1172
|
+
import { Grid as Grid12 } from "@elementor/ui";
|
|
1173
|
+
import { __ as __20 } from "@wordpress/i18n";
|
|
1174
|
+
var LetterSpacingField = () => {
|
|
1175
|
+
return /* @__PURE__ */ React39.createElement(StylesField, { bind: "letter-spacing" }, /* @__PURE__ */ React39.createElement(Grid12, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React39.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ControlLabel16, null, __20("Letter Spacing", "elementor"))), /* @__PURE__ */ React39.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(SizeControl5, null))));
|
|
1185
1176
|
};
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1177
|
+
|
|
1178
|
+
// src/components/style-sections/typography-section/text-alignment-field.tsx
|
|
1179
|
+
import * as React40 from "react";
|
|
1180
|
+
import { ControlLabel as ControlLabel17, ToggleControl as ToggleControl4 } from "@elementor/editor-controls";
|
|
1181
|
+
import { AlignCenterIcon, AlignJustifiedIcon, AlignLeftIcon, AlignRightIcon } from "@elementor/icons";
|
|
1182
|
+
import { Grid as Grid13 } from "@elementor/ui";
|
|
1183
|
+
import { __ as __21 } from "@wordpress/i18n";
|
|
1184
|
+
var options2 = [
|
|
1193
1185
|
{
|
|
1194
|
-
value:
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1186
|
+
value: "left",
|
|
1187
|
+
label: __21("Left", "elementor"),
|
|
1188
|
+
renderContent: ({ size }) => /* @__PURE__ */ React40.createElement(AlignLeftIcon, { fontSize: size })
|
|
1189
|
+
},
|
|
1190
|
+
{
|
|
1191
|
+
value: "center",
|
|
1192
|
+
label: __21("Center", "elementor"),
|
|
1193
|
+
renderContent: ({ size }) => /* @__PURE__ */ React40.createElement(AlignCenterIcon, { fontSize: size })
|
|
1194
|
+
},
|
|
1195
|
+
{
|
|
1196
|
+
value: "right",
|
|
1197
|
+
label: __21("Right", "elementor"),
|
|
1198
|
+
renderContent: ({ size }) => /* @__PURE__ */ React40.createElement(AlignRightIcon, { fontSize: size })
|
|
1199
1199
|
},
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1200
|
+
{
|
|
1201
|
+
value: "justify",
|
|
1202
|
+
label: __21("Justify", "elementor"),
|
|
1203
|
+
renderContent: ({ size }) => /* @__PURE__ */ React40.createElement(AlignJustifiedIcon, { fontSize: size })
|
|
1204
|
+
}
|
|
1205
|
+
];
|
|
1206
|
+
var TextAlignmentField = () => {
|
|
1207
|
+
return /* @__PURE__ */ React40.createElement(StylesField, { bind: "text-align" }, /* @__PURE__ */ React40.createElement(Grid13, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React40.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(ControlLabel17, null, __21("Alignment", "elementor"))), /* @__PURE__ */ React40.createElement(Grid13, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React40.createElement(ToggleControl4, { options: options2 }))));
|
|
1206
1208
|
};
|
|
1207
1209
|
|
|
1208
|
-
// src/components/style-sections/
|
|
1209
|
-
import * as
|
|
1210
|
-
import {
|
|
1211
|
-
import {
|
|
1210
|
+
// src/components/style-sections/typography-section/text-color-field.tsx
|
|
1211
|
+
import * as React41 from "react";
|
|
1212
|
+
import { ColorControl as ColorControl3, ControlLabel as ControlLabel18 } from "@elementor/editor-controls";
|
|
1213
|
+
import { Grid as Grid14 } from "@elementor/ui";
|
|
1214
|
+
import { __ as __22 } from "@wordpress/i18n";
|
|
1215
|
+
var TextColorField = () => {
|
|
1216
|
+
return /* @__PURE__ */ React41.createElement(StylesField, { bind: "color" }, /* @__PURE__ */ React41.createElement(Grid14, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React41.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(ControlLabel18, null, __22("Text Color", "elementor"))), /* @__PURE__ */ React41.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(ColorControl3, null))));
|
|
1217
|
+
};
|
|
1212
1218
|
|
|
1213
|
-
// src/components/style-sections/
|
|
1219
|
+
// src/components/style-sections/typography-section/text-direction-field.tsx
|
|
1214
1220
|
import * as React42 from "react";
|
|
1215
|
-
import {
|
|
1216
|
-
import {
|
|
1221
|
+
import { ControlLabel as ControlLabel19, ToggleControl as ToggleControl5 } from "@elementor/editor-controls";
|
|
1222
|
+
import { TextDirectionLtrIcon, TextDirectionRtlIcon } from "@elementor/icons";
|
|
1223
|
+
import { Grid as Grid15 } from "@elementor/ui";
|
|
1224
|
+
import { __ as __23 } from "@wordpress/i18n";
|
|
1225
|
+
var options3 = [
|
|
1226
|
+
{
|
|
1227
|
+
value: "ltr",
|
|
1228
|
+
label: __23("Left to Right", "elementor"),
|
|
1229
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(TextDirectionLtrIcon, { fontSize: size })
|
|
1230
|
+
},
|
|
1231
|
+
{
|
|
1232
|
+
value: "rtl",
|
|
1233
|
+
label: __23("Right to Left", "elementor"),
|
|
1234
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(TextDirectionRtlIcon, { fontSize: size })
|
|
1235
|
+
}
|
|
1236
|
+
];
|
|
1237
|
+
var TextDirectionField = () => {
|
|
1238
|
+
return /* @__PURE__ */ React42.createElement(StylesField, { bind: "direction" }, /* @__PURE__ */ React42.createElement(Grid15, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React42.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(ControlLabel19, null, __23("Direction", "elementor"))), /* @__PURE__ */ React42.createElement(Grid15, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React42.createElement(ToggleControl5, { options: options3 }))));
|
|
1239
|
+
};
|
|
1217
1240
|
|
|
1218
|
-
// src/
|
|
1219
|
-
import * as
|
|
1220
|
-
import {
|
|
1221
|
-
import { __ as
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
} from "@elementor/ui";
|
|
1234
|
-
var SIZE2 = "tiny";
|
|
1235
|
-
var Repeater = ({
|
|
1236
|
-
label,
|
|
1237
|
-
itemSettings,
|
|
1238
|
-
values: repeaterValues = [],
|
|
1239
|
-
setValues: setRepeaterValues
|
|
1240
|
-
}) => {
|
|
1241
|
-
const addRepeaterItem = () => {
|
|
1242
|
-
const newItem = structuredClone(itemSettings.initialValues);
|
|
1243
|
-
setRepeaterValues([...repeaterValues, newItem]);
|
|
1244
|
-
};
|
|
1245
|
-
const duplicateRepeaterItem = (index) => {
|
|
1246
|
-
setRepeaterValues([
|
|
1247
|
-
...repeaterValues.slice(0, index),
|
|
1248
|
-
structuredClone(repeaterValues[index]),
|
|
1249
|
-
...repeaterValues.slice(index)
|
|
1250
|
-
]);
|
|
1251
|
-
};
|
|
1252
|
-
const removeRepeaterItem = (index) => {
|
|
1253
|
-
setRepeaterValues(repeaterValues.filter((_, i) => i !== index));
|
|
1254
|
-
};
|
|
1255
|
-
const toggleDisableRepeaterItem = (index) => {
|
|
1256
|
-
setRepeaterValues(
|
|
1257
|
-
repeaterValues.map((value, i) => {
|
|
1258
|
-
if (i === index) {
|
|
1259
|
-
const { disabled, ...rest } = value;
|
|
1260
|
-
return { ...rest, ...disabled ? {} : { disabled: true } };
|
|
1261
|
-
}
|
|
1262
|
-
return value;
|
|
1263
|
-
})
|
|
1264
|
-
);
|
|
1241
|
+
// src/components/style-sections/typography-section/text-stroke-field.tsx
|
|
1242
|
+
import * as React44 from "react";
|
|
1243
|
+
import { ControlLabel as ControlLabel20, StrokeControl } from "@elementor/editor-controls";
|
|
1244
|
+
import { __ as __25 } from "@wordpress/i18n";
|
|
1245
|
+
|
|
1246
|
+
// src/components/collapsible-field.tsx
|
|
1247
|
+
import * as React43 from "react";
|
|
1248
|
+
import { useState as useState3 } from "react";
|
|
1249
|
+
import { MinusIcon as MinusIcon2, PlusIcon as PlusIcon2 } from "@elementor/icons";
|
|
1250
|
+
import { Collapse as Collapse4, IconButton as IconButton3, Stack as Stack16 } from "@elementor/ui";
|
|
1251
|
+
import { __ as __24 } from "@wordpress/i18n";
|
|
1252
|
+
var CollapsibleField = ({ label, children, defaultOpen = false }) => {
|
|
1253
|
+
const [open, setOpen] = useState3(defaultOpen);
|
|
1254
|
+
const handleToggle = () => {
|
|
1255
|
+
setOpen((prevOpen) => !prevOpen);
|
|
1265
1256
|
};
|
|
1266
|
-
return /* @__PURE__ */
|
|
1267
|
-
|
|
1268
|
-
{
|
|
1269
|
-
key: index,
|
|
1270
|
-
disabled: value.disabled,
|
|
1271
|
-
label: /* @__PURE__ */ React41.createElement(itemSettings.Label, { value }),
|
|
1272
|
-
startIcon: /* @__PURE__ */ React41.createElement(itemSettings.Icon, { value }),
|
|
1273
|
-
removeItem: () => removeRepeaterItem(index),
|
|
1274
|
-
duplicateItem: () => duplicateRepeaterItem(index),
|
|
1275
|
-
toggleDisableItem: () => toggleDisableRepeaterItem(index)
|
|
1276
|
-
},
|
|
1277
|
-
(props) => /* @__PURE__ */ React41.createElement(
|
|
1278
|
-
itemSettings.Content,
|
|
1279
|
-
{
|
|
1280
|
-
...props,
|
|
1281
|
-
value,
|
|
1282
|
-
setValue: (newValue) => setRepeaterValues(
|
|
1283
|
-
repeaterValues.map((item, i) => i === index ? newValue : item)
|
|
1284
|
-
)
|
|
1285
|
-
}
|
|
1286
|
-
)
|
|
1287
|
-
))));
|
|
1288
|
-
};
|
|
1289
|
-
var RepeaterItem = ({
|
|
1290
|
-
label,
|
|
1291
|
-
disabled,
|
|
1292
|
-
startIcon,
|
|
1293
|
-
children,
|
|
1294
|
-
removeItem,
|
|
1295
|
-
duplicateItem,
|
|
1296
|
-
toggleDisableItem
|
|
1297
|
-
}) => {
|
|
1298
|
-
const popupId = useId4();
|
|
1299
|
-
const tagRef = useRef(null);
|
|
1300
|
-
const [anchorEl, setAnchorEl] = useState3(null);
|
|
1301
|
-
const popoverState = usePopupState3({ popupId, variant: "popover" });
|
|
1302
|
-
const popoverProps = bindPopover2(popoverState);
|
|
1303
|
-
return /* @__PURE__ */ React41.createElement(React41.Fragment, null, /* @__PURE__ */ React41.createElement(
|
|
1304
|
-
UnstableTag,
|
|
1305
|
-
{
|
|
1306
|
-
ref: tagRef,
|
|
1307
|
-
label,
|
|
1308
|
-
showActionsOnHover: true,
|
|
1309
|
-
variant: "outlined",
|
|
1310
|
-
"aria-label": __19("Open item", "elementor"),
|
|
1311
|
-
...bindTrigger2(popoverState),
|
|
1312
|
-
startIcon,
|
|
1313
|
-
actions: /* @__PURE__ */ React41.createElement(React41.Fragment, null, /* @__PURE__ */ React41.createElement(
|
|
1314
|
-
IconButton2,
|
|
1315
|
-
{
|
|
1316
|
-
size: SIZE2,
|
|
1317
|
-
onClick: duplicateItem,
|
|
1318
|
-
"aria-label": __19("Duplicate item", "elementor")
|
|
1319
|
-
},
|
|
1320
|
-
/* @__PURE__ */ React41.createElement(CopyIcon, { fontSize: SIZE2 })
|
|
1321
|
-
), /* @__PURE__ */ React41.createElement(
|
|
1322
|
-
IconButton2,
|
|
1323
|
-
{
|
|
1324
|
-
size: SIZE2,
|
|
1325
|
-
onClick: toggleDisableItem,
|
|
1326
|
-
"aria-label": disabled ? __19("Enable item", "elementor") : __19("Disable item", "elementor")
|
|
1327
|
-
},
|
|
1328
|
-
disabled ? /* @__PURE__ */ React41.createElement(EyeOffIcon, { fontSize: SIZE2 }) : /* @__PURE__ */ React41.createElement(EyeIcon, { fontSize: SIZE2 })
|
|
1329
|
-
), /* @__PURE__ */ React41.createElement(
|
|
1330
|
-
IconButton2,
|
|
1331
|
-
{
|
|
1332
|
-
size: SIZE2,
|
|
1333
|
-
onClick: removeItem,
|
|
1334
|
-
"aria-label": __19("Remove item", "elementor")
|
|
1335
|
-
},
|
|
1336
|
-
/* @__PURE__ */ React41.createElement(XIcon2, { fontSize: SIZE2 })
|
|
1337
|
-
))
|
|
1338
|
-
}
|
|
1339
|
-
), /* @__PURE__ */ React41.createElement(
|
|
1340
|
-
Popover2,
|
|
1257
|
+
return /* @__PURE__ */ React43.createElement(Stack16, { gap: 1.5 }, /* @__PURE__ */ React43.createElement(Stack16, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { py: 0.5 } }, label, /* @__PURE__ */ React43.createElement(
|
|
1258
|
+
IconButton3,
|
|
1341
1259
|
{
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
},
|
|
1346
|
-
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
1347
|
-
...popoverProps
|
|
1260
|
+
onClick: handleToggle,
|
|
1261
|
+
size: "tiny",
|
|
1262
|
+
"aria-label": open ? __24("Close", "elementor") : __24("Expand", "elementor")
|
|
1348
1263
|
},
|
|
1349
|
-
/* @__PURE__ */
|
|
1350
|
-
));
|
|
1264
|
+
open ? /* @__PURE__ */ React43.createElement(MinusIcon2, { fontSize: "tiny" }) : /* @__PURE__ */ React43.createElement(PlusIcon2, { fontSize: "tiny" })
|
|
1265
|
+
)), /* @__PURE__ */ React43.createElement(Collapse4, { in: open, unmountOnExit: true }, children));
|
|
1351
1266
|
};
|
|
1352
1267
|
|
|
1353
|
-
// src/components/style-sections/
|
|
1354
|
-
var
|
|
1355
|
-
|
|
1356
|
-
const boxShadowValues = value?.value;
|
|
1357
|
-
const setBoxShadow = (newValue) => {
|
|
1358
|
-
setValue({
|
|
1359
|
-
$$type: "box-shadow",
|
|
1360
|
-
value: newValue
|
|
1361
|
-
});
|
|
1362
|
-
};
|
|
1363
|
-
return /* @__PURE__ */ React42.createElement(
|
|
1364
|
-
Repeater,
|
|
1365
|
-
{
|
|
1366
|
-
values: boxShadowValues,
|
|
1367
|
-
setValues: setBoxShadow,
|
|
1368
|
-
label: __20("Box shadow", "elementor"),
|
|
1369
|
-
itemSettings: {
|
|
1370
|
-
Icon: ItemIcon,
|
|
1371
|
-
Label: ItemLabel,
|
|
1372
|
-
Content: ItemContent,
|
|
1373
|
-
initialValues: initialShadow
|
|
1374
|
-
}
|
|
1375
|
-
}
|
|
1376
|
-
);
|
|
1268
|
+
// src/components/style-sections/typography-section/text-stroke-field.tsx
|
|
1269
|
+
var TextStrokeField = () => {
|
|
1270
|
+
return /* @__PURE__ */ React44.createElement(StylesField, { bind: "-webkit-text-stroke" }, /* @__PURE__ */ React44.createElement(CollapsibleField, { label: /* @__PURE__ */ React44.createElement(ControlLabel20, null, __25("Text Stroke", "elementor")) }, /* @__PURE__ */ React44.createElement(StrokeControl, null)));
|
|
1377
1271
|
};
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
}
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
return /* @__PURE__ */
|
|
1391
|
-
|
|
1392
|
-
{
|
|
1393
|
-
bind: "color",
|
|
1394
|
-
value: value.value.color,
|
|
1395
|
-
label: __20("Color", "elementor"),
|
|
1396
|
-
setValue: (v) => setShadow({ ...value.value, color: v })
|
|
1397
|
-
},
|
|
1398
|
-
/* @__PURE__ */ React42.createElement(
|
|
1399
|
-
ColorControl,
|
|
1400
|
-
{
|
|
1401
|
-
anchorEl,
|
|
1402
|
-
anchorOrigin: {
|
|
1403
|
-
vertical: "top",
|
|
1404
|
-
horizontal: "right"
|
|
1405
|
-
},
|
|
1406
|
-
transformOrigin: {
|
|
1407
|
-
vertical: "top",
|
|
1408
|
-
horizontal: -10
|
|
1409
|
-
}
|
|
1410
|
-
}
|
|
1411
|
-
)
|
|
1412
|
-
), /* @__PURE__ */ React42.createElement(
|
|
1413
|
-
Control5,
|
|
1414
|
-
{
|
|
1415
|
-
bind: "position",
|
|
1416
|
-
value: value.value.position,
|
|
1417
|
-
label: __20("Position", "elementor"),
|
|
1418
|
-
setValue: (v) => setShadow({ ...value.value, position: v })
|
|
1419
|
-
},
|
|
1420
|
-
/* @__PURE__ */ React42.createElement(
|
|
1421
|
-
SelectControl,
|
|
1422
|
-
{
|
|
1423
|
-
options: [
|
|
1424
|
-
{ label: "Inset", value: "inset" },
|
|
1425
|
-
{ label: "Outset", value: "outset" }
|
|
1426
|
-
]
|
|
1427
|
-
}
|
|
1428
|
-
)
|
|
1429
|
-
)), /* @__PURE__ */ React42.createElement(Grid14, { container: true, spacing: 1 }, /* @__PURE__ */ React42.createElement(
|
|
1430
|
-
Control5,
|
|
1431
|
-
{
|
|
1432
|
-
bind: "hOffset",
|
|
1433
|
-
label: __20("Horizontal", "elementor"),
|
|
1434
|
-
value: value.value.hOffset,
|
|
1435
|
-
setValue: (v) => setShadow({ ...value.value, hOffset: v })
|
|
1436
|
-
},
|
|
1437
|
-
/* @__PURE__ */ React42.createElement(SizeControl, null)
|
|
1438
|
-
), /* @__PURE__ */ React42.createElement(
|
|
1439
|
-
Control5,
|
|
1272
|
+
|
|
1273
|
+
// src/components/style-sections/typography-section/text-style-field.tsx
|
|
1274
|
+
import * as React45 from "react";
|
|
1275
|
+
import { ControlLabel as ControlLabel21 } from "@elementor/editor-controls";
|
|
1276
|
+
import { ItalicIcon, StrikethroughIcon, UnderlineIcon } from "@elementor/icons";
|
|
1277
|
+
import { Grid as Grid16, ToggleButton as ToggleButtonBase, ToggleButtonGroup } from "@elementor/ui";
|
|
1278
|
+
import { __ as __26 } from "@wordpress/i18n";
|
|
1279
|
+
var buttonSize = "tiny";
|
|
1280
|
+
var TextStyleField = () => {
|
|
1281
|
+
const [fontStyle, setFontStyle] = useStylesField("font-style");
|
|
1282
|
+
const [textDecoration, setTextDecoration] = useStylesField("text-decoration");
|
|
1283
|
+
const formats = [fontStyle, ...(textDecoration || "").split(" ")];
|
|
1284
|
+
return /* @__PURE__ */ React45.createElement(Grid16, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React45.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(ControlLabel21, null, __26("Style", "elementor"))), /* @__PURE__ */ React45.createElement(Grid16, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React45.createElement(ToggleButtonGroup, { value: formats }, /* @__PURE__ */ React45.createElement(
|
|
1285
|
+
ToggleButton,
|
|
1440
1286
|
{
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1287
|
+
value: "italic",
|
|
1288
|
+
onChange: (v) => setFontStyle(fontStyle === v ? null : v),
|
|
1289
|
+
"aria-label": "italic",
|
|
1290
|
+
sx: { marginLeft: "auto" }
|
|
1445
1291
|
},
|
|
1446
|
-
/* @__PURE__ */
|
|
1447
|
-
)
|
|
1448
|
-
|
|
1292
|
+
/* @__PURE__ */ React45.createElement(ItalicIcon, { fontSize: buttonSize })
|
|
1293
|
+
), /* @__PURE__ */ React45.createElement(
|
|
1294
|
+
ShorthandControl,
|
|
1449
1295
|
{
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1296
|
+
value: "line-through",
|
|
1297
|
+
currentValues: textDecoration || "",
|
|
1298
|
+
updateValues: setTextDecoration,
|
|
1299
|
+
"aria-label": "line-through"
|
|
1454
1300
|
},
|
|
1455
|
-
/* @__PURE__ */
|
|
1456
|
-
), /* @__PURE__ */
|
|
1457
|
-
|
|
1301
|
+
/* @__PURE__ */ React45.createElement(StrikethroughIcon, { fontSize: buttonSize })
|
|
1302
|
+
), /* @__PURE__ */ React45.createElement(
|
|
1303
|
+
ShorthandControl,
|
|
1458
1304
|
{
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1305
|
+
value: "underline",
|
|
1306
|
+
currentValues: textDecoration || "",
|
|
1307
|
+
updateValues: setTextDecoration,
|
|
1308
|
+
"aria-label": "underline"
|
|
1463
1309
|
},
|
|
1464
|
-
/* @__PURE__ */
|
|
1465
|
-
)));
|
|
1310
|
+
/* @__PURE__ */ React45.createElement(UnderlineIcon, { fontSize: buttonSize })
|
|
1311
|
+
))));
|
|
1466
1312
|
};
|
|
1467
|
-
var
|
|
1313
|
+
var ShorthandControl = ({
|
|
1314
|
+
children,
|
|
1468
1315
|
value,
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
const
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
blurSize + blurUnit,
|
|
1484
|
-
spreadSize + spreadUnit
|
|
1485
|
-
].join(" ");
|
|
1486
|
-
return /* @__PURE__ */ React42.createElement("span", { style: { textTransform: "capitalize" } }, position, ": ", sizes);
|
|
1487
|
-
};
|
|
1488
|
-
var initialShadow = {
|
|
1489
|
-
$$type: "shadow",
|
|
1490
|
-
value: {
|
|
1491
|
-
hOffset: {
|
|
1492
|
-
$$type: "size",
|
|
1493
|
-
value: { unit: "px", size: 0 }
|
|
1494
|
-
},
|
|
1495
|
-
vOffset: {
|
|
1496
|
-
$$type: "size",
|
|
1497
|
-
value: { unit: "px", size: 0 }
|
|
1498
|
-
},
|
|
1499
|
-
blur: {
|
|
1500
|
-
$$type: "size",
|
|
1501
|
-
value: { unit: "px", size: 0 }
|
|
1502
|
-
},
|
|
1503
|
-
spread: {
|
|
1504
|
-
$$type: "size",
|
|
1505
|
-
value: { unit: "px", size: 0 }
|
|
1506
|
-
},
|
|
1507
|
-
color: {
|
|
1508
|
-
$$type: "color",
|
|
1509
|
-
value: "rgba(0, 0, 0, 0)"
|
|
1510
|
-
},
|
|
1511
|
-
position: "inset"
|
|
1512
|
-
}
|
|
1316
|
+
currentValues,
|
|
1317
|
+
updateValues,
|
|
1318
|
+
"aria-label": ariaLabel
|
|
1319
|
+
}) => {
|
|
1320
|
+
const valuesArr = currentValues.split(" ").filter(Boolean);
|
|
1321
|
+
const selected = valuesArr.includes(value);
|
|
1322
|
+
const toggleValue = (newValue) => {
|
|
1323
|
+
if (selected) {
|
|
1324
|
+
updateValues(valuesArr.filter((v) => v !== newValue).join(" ") || null);
|
|
1325
|
+
} else {
|
|
1326
|
+
updateValues([...valuesArr, newValue].join(" "));
|
|
1327
|
+
}
|
|
1328
|
+
};
|
|
1329
|
+
return /* @__PURE__ */ React45.createElement(ToggleButton, { value, onChange: toggleValue, selected, "aria-label": ariaLabel }, children);
|
|
1513
1330
|
};
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1331
|
+
var ToggleButton = ({ onChange, ...props }) => {
|
|
1332
|
+
const handleChange = (_e, newValue) => {
|
|
1333
|
+
onChange(newValue);
|
|
1334
|
+
};
|
|
1335
|
+
return /* @__PURE__ */ React45.createElement(ToggleButtonBase, { ...props, onChange: handleChange, size: buttonSize });
|
|
1518
1336
|
};
|
|
1519
1337
|
|
|
1520
|
-
// src/components/style-sections/
|
|
1521
|
-
import * as
|
|
1522
|
-
import {
|
|
1523
|
-
import {
|
|
1338
|
+
// src/components/style-sections/typography-section/transform-field.tsx
|
|
1339
|
+
import * as React46 from "react";
|
|
1340
|
+
import { ControlLabel as ControlLabel22, ToggleControl as ToggleControl6 } from "@elementor/editor-controls";
|
|
1341
|
+
import { LetterCaseIcon, LetterCaseLowerIcon, LetterCaseUpperIcon } from "@elementor/icons";
|
|
1342
|
+
import { Grid as Grid17 } from "@elementor/ui";
|
|
1343
|
+
import { __ as __27 } from "@wordpress/i18n";
|
|
1344
|
+
var options4 = [
|
|
1345
|
+
{
|
|
1346
|
+
value: "capitalize",
|
|
1347
|
+
label: __27("Capitalize", "elementor"),
|
|
1348
|
+
renderContent: ({ size }) => /* @__PURE__ */ React46.createElement(LetterCaseIcon, { fontSize: size })
|
|
1349
|
+
},
|
|
1350
|
+
{
|
|
1351
|
+
value: "uppercase",
|
|
1352
|
+
label: __27("Uppercase", "elementor"),
|
|
1353
|
+
renderContent: ({ size }) => /* @__PURE__ */ React46.createElement(LetterCaseUpperIcon, { fontSize: size })
|
|
1354
|
+
},
|
|
1355
|
+
{
|
|
1356
|
+
value: "lowercase",
|
|
1357
|
+
label: __27("Lowercase", "elementor"),
|
|
1358
|
+
renderContent: ({ size }) => /* @__PURE__ */ React46.createElement(LetterCaseLowerIcon, { fontSize: size })
|
|
1359
|
+
}
|
|
1360
|
+
];
|
|
1361
|
+
var TransformField = () => /* @__PURE__ */ React46.createElement(StylesField, { bind: "text-transform" }, /* @__PURE__ */ React46.createElement(Grid17, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React46.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(ControlLabel22, null, __27("Transform", "elementor"))), /* @__PURE__ */ React46.createElement(Grid17, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React46.createElement(ToggleControl6, { options: options4 }))));
|
|
1524
1362
|
|
|
1525
|
-
// src/components/style-sections/
|
|
1526
|
-
import * as
|
|
1527
|
-
import {
|
|
1528
|
-
import { Grid as
|
|
1529
|
-
|
|
1530
|
-
|
|
1363
|
+
// src/components/style-sections/typography-section/word-spacing-field.tsx
|
|
1364
|
+
import * as React47 from "react";
|
|
1365
|
+
import { ControlLabel as ControlLabel23, SizeControl as SizeControl6 } from "@elementor/editor-controls";
|
|
1366
|
+
import { Grid as Grid18 } from "@elementor/ui";
|
|
1367
|
+
import { __ as __28 } from "@wordpress/i18n";
|
|
1368
|
+
var WordSpacingField = () => {
|
|
1369
|
+
return /* @__PURE__ */ React47.createElement(StylesField, { bind: "word-spacing" }, /* @__PURE__ */ React47.createElement(Grid18, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React47.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(ControlLabel23, null, __28("Word Spacing", "elementor"))), /* @__PURE__ */ React47.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(SizeControl6, null))));
|
|
1531
1370
|
};
|
|
1532
1371
|
|
|
1533
|
-
// src/components/style-sections/
|
|
1534
|
-
var
|
|
1535
|
-
return /* @__PURE__ */
|
|
1372
|
+
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1373
|
+
var TypographySection = () => {
|
|
1374
|
+
return /* @__PURE__ */ React48.createElement(Stack17, { gap: 1.5 }, /* @__PURE__ */ React48.createElement(FontFamilyField, null), /* @__PURE__ */ React48.createElement(FontWeightField, null), /* @__PURE__ */ React48.createElement(FontSizeField, null), /* @__PURE__ */ React48.createElement(Divider5, null), /* @__PURE__ */ React48.createElement(TextColorField, null), /* @__PURE__ */ React48.createElement(CollapsibleContent, null, /* @__PURE__ */ React48.createElement(Stack17, { gap: 1.5, sx: { pt: 1.5 } }, /* @__PURE__ */ React48.createElement(LetterSpacingField, null), /* @__PURE__ */ React48.createElement(WordSpacingField, null), /* @__PURE__ */ React48.createElement(Divider5, 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))));
|
|
1536
1375
|
};
|
|
1537
1376
|
|
|
1538
1377
|
// src/components/style-tab.tsx
|
|
1539
1378
|
var CLASSES_PROP_KEY = "classes";
|
|
1540
1379
|
var StyleTab = () => {
|
|
1541
|
-
const
|
|
1542
|
-
const
|
|
1543
|
-
|
|
1380
|
+
const currentClassesProp = useCurrentClassesProp();
|
|
1381
|
+
const [activeStyleDefId, setActiveStyleDefId] = useActiveStyleDefId(currentClassesProp);
|
|
1382
|
+
const breakpoint = useActiveBreakpoint();
|
|
1383
|
+
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(Divider6, null), /* @__PURE__ */ React49.createElement(SectionsList, null, /* @__PURE__ */ React49.createElement(Section, { title: __29("Layout", "elementor") }, /* @__PURE__ */ React49.createElement(LayoutSection, null)), /* @__PURE__ */ React49.createElement(Section, { title: __29("Spacing", "elementor") }, /* @__PURE__ */ React49.createElement(SpacingSection, null)), /* @__PURE__ */ React49.createElement(Section, { title: __29("Size", "elementor") }, /* @__PURE__ */ React49.createElement(SizeSection, null)), /* @__PURE__ */ React49.createElement(Section, { title: __29("Position", "elementor") }, /* @__PURE__ */ React49.createElement(PositionSection, null)), /* @__PURE__ */ React49.createElement(Section, { title: __29("Typography", "elementor") }, /* @__PURE__ */ React49.createElement(TypographySection, null)), /* @__PURE__ */ React49.createElement(Section, { title: __29("Background", "elementor") }, /* @__PURE__ */ React49.createElement(BackgroundSection, null)), /* @__PURE__ */ React49.createElement(Section, { title: __29("Border", "elementor") }, /* @__PURE__ */ React49.createElement(BorderSection, null)), /* @__PURE__ */ React49.createElement(Section, { title: __29("Effects", "elementor") }, /* @__PURE__ */ React49.createElement(EffectsSection, null)))));
|
|
1544
1384
|
};
|
|
1545
|
-
function
|
|
1385
|
+
function useActiveStyleDefId(currentClassesProp) {
|
|
1386
|
+
const [activeStyledDefId, setActiveStyledDefId] = useState4(null);
|
|
1387
|
+
const fallback = useFirstElementStyleDef(currentClassesProp);
|
|
1388
|
+
const newId = useGeneratedId();
|
|
1389
|
+
return [activeStyledDefId || fallback?.id || newId, setActiveStyledDefId];
|
|
1390
|
+
}
|
|
1391
|
+
function useFirstElementStyleDef(currentClassesProp) {
|
|
1392
|
+
const { element } = useElement();
|
|
1393
|
+
const classesIds = useElementSetting3(element.id, currentClassesProp)?.value || [];
|
|
1394
|
+
const stylesDefs = useElementStyles2(element.id);
|
|
1395
|
+
return Object.values(stylesDefs).find((styleDef) => classesIds.includes(styleDef.id));
|
|
1396
|
+
}
|
|
1397
|
+
function useGeneratedId() {
|
|
1398
|
+
const { element } = useElement();
|
|
1399
|
+
const stylesDefs = useElementStyles2(element.id);
|
|
1400
|
+
return generateId(`e-${element.id}-`, Object.keys(stylesDefs));
|
|
1401
|
+
}
|
|
1402
|
+
function useCurrentClassesProp() {
|
|
1546
1403
|
const { elementType } = useElement();
|
|
1547
1404
|
const prop = Object.entries(elementType.propsSchema).find(
|
|
1548
1405
|
([, propType]) => propType.kind === "array" && propType.key === CLASSES_PROP_KEY
|
|
@@ -1552,39 +1409,29 @@ function useClassesProp() {
|
|
|
1552
1409
|
}
|
|
1553
1410
|
return prop[0];
|
|
1554
1411
|
}
|
|
1555
|
-
function useStyleDefinition() {
|
|
1556
|
-
const { element } = useElement();
|
|
1557
|
-
const elementStyles = useElementStyles(element.id);
|
|
1558
|
-
return Object.values(elementStyles || {})[0] ?? null;
|
|
1559
|
-
}
|
|
1560
1412
|
|
|
1561
1413
|
// src/components/editing-panel-tabs.tsx
|
|
1562
1414
|
var EditingPanelTabs = () => {
|
|
1415
|
+
const { element } = useElement();
|
|
1563
1416
|
const { getTabProps, getTabPanelProps, getTabsProps } = useTabs("settings");
|
|
1564
|
-
return
|
|
1417
|
+
return (
|
|
1418
|
+
// When switching between elements, the local states should be reset. We are using key to rerender the tabs.
|
|
1419
|
+
// Reference: https://react.dev/learn/preserving-and-resetting-state#resetting-a-form-with-a-key
|
|
1420
|
+
/* @__PURE__ */ React50.createElement(Fragment5, { key: element.id }, /* @__PURE__ */ React50.createElement(Stack18, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React50.createElement(Tabs, { variant: "fullWidth", indicatorColor: "secondary", textColor: "inherit", ...getTabsProps() }, /* @__PURE__ */ React50.createElement(Tab, { label: __30("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React50.createElement(Tab, { label: __30("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React50.createElement(Divider7, null), /* @__PURE__ */ React50.createElement(TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React50.createElement(SettingsTab, null)), /* @__PURE__ */ React50.createElement(TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React50.createElement(StyleTab, null))))
|
|
1421
|
+
);
|
|
1565
1422
|
};
|
|
1566
1423
|
|
|
1567
1424
|
// src/components/editing-panel.tsx
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
// src/components/editing-panel-error-fallback.tsx
|
|
1571
|
-
import * as React48 from "react";
|
|
1572
|
-
import { Alert, Box as Box3 } from "@elementor/ui";
|
|
1573
|
-
function EditorPanelErrorFallback() {
|
|
1574
|
-
return /* @__PURE__ */ React48.createElement(Box3, { role: "alert", sx: { minHeight: "100%", p: 2 } }, /* @__PURE__ */ React48.createElement(Alert, { severity: "error", sx: { mb: 2, maxWidth: 400, textAlign: "center" } }, /* @__PURE__ */ React48.createElement("strong", null, "Something went wrong")));
|
|
1575
|
-
}
|
|
1576
|
-
|
|
1577
|
-
// src/components/editing-panel.tsx
|
|
1425
|
+
var { useMenuItems } = controlActionsMenu;
|
|
1578
1426
|
var EditingPanel = () => {
|
|
1579
|
-
const
|
|
1580
|
-
const
|
|
1581
|
-
const
|
|
1582
|
-
if (
|
|
1427
|
+
const { element, elementType } = useSelectedElement();
|
|
1428
|
+
const controlReplacement = getControlReplacement();
|
|
1429
|
+
const menuItems = useMenuItems().default;
|
|
1430
|
+
if (!element || !elementType) {
|
|
1583
1431
|
return null;
|
|
1584
1432
|
}
|
|
1585
|
-
const
|
|
1586
|
-
|
|
1587
|
-
return /* @__PURE__ */ React49.createElement(ErrorBoundary2, { fallback: /* @__PURE__ */ React49.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React49.createElement(Panel, null, /* @__PURE__ */ React49.createElement(PanelHeader, null, /* @__PURE__ */ React49.createElement(PanelHeaderTitle, null, panelTitle)), /* @__PURE__ */ React49.createElement(PanelBody, null, /* @__PURE__ */ React49.createElement(ControlReplacementProvider, { ...controlReplacement }, /* @__PURE__ */ React49.createElement(ElementProvider, { element: selectedElement, elementType }, /* @__PURE__ */ React49.createElement(EditingPanelTabs, null))))));
|
|
1433
|
+
const panelTitle = __31("Edit %s", "elementor").replace("%s", elementType.title);
|
|
1434
|
+
return /* @__PURE__ */ React51.createElement(ErrorBoundary, { fallback: /* @__PURE__ */ React51.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React51.createElement(Panel, null, /* @__PURE__ */ React51.createElement(PanelHeader, null, /* @__PURE__ */ React51.createElement(PanelHeaderTitle, null, panelTitle)), /* @__PURE__ */ React51.createElement(PanelBody, null, /* @__PURE__ */ React51.createElement(ControlActionsProvider, { items: menuItems }, /* @__PURE__ */ React51.createElement(ControlReplacementProvider, { ...controlReplacement }, /* @__PURE__ */ React51.createElement(ElementProvider, { element, elementType }, /* @__PURE__ */ React51.createElement(EditingPanelTabs, null)))))));
|
|
1588
1435
|
};
|
|
1589
1436
|
|
|
1590
1437
|
// src/panel.ts
|
|
@@ -1593,11 +1440,9 @@ var { panel, usePanelActions, usePanelStatus } = createPanel({
|
|
|
1593
1440
|
component: EditingPanel
|
|
1594
1441
|
});
|
|
1595
1442
|
|
|
1596
|
-
// src/
|
|
1597
|
-
import {
|
|
1598
|
-
|
|
1599
|
-
// src/sync/should-use-v2-panel.ts
|
|
1600
|
-
var shouldUseV2Panel = () => {
|
|
1443
|
+
// src/sync/is-atomic-widget-selected.ts
|
|
1444
|
+
import { getSelectedElements, getWidgetsCache } from "@elementor/editor-elements";
|
|
1445
|
+
var isAtomicWidgetSelected = () => {
|
|
1601
1446
|
const selectedElements = getSelectedElements();
|
|
1602
1447
|
const widgetCache = getWidgetsCache();
|
|
1603
1448
|
if (selectedElements.length !== 1) {
|
|
@@ -1606,14 +1451,29 @@ var shouldUseV2Panel = () => {
|
|
|
1606
1451
|
return !!widgetCache?.[selectedElements[0].type]?.atomic_controls;
|
|
1607
1452
|
};
|
|
1608
1453
|
|
|
1454
|
+
// src/hooks/use-close-editor-panel.ts
|
|
1455
|
+
var useCloseEditorPanel = () => {
|
|
1456
|
+
const { close } = usePanelActions();
|
|
1457
|
+
return useEffect2(() => {
|
|
1458
|
+
return listenTo(commandStartEvent("document/elements/delete"), (e) => {
|
|
1459
|
+
const selectedElement = getSelectedElements2()[0];
|
|
1460
|
+
const { container: deletedContainer } = e?.args;
|
|
1461
|
+
const isSelectedElementInDeletedContainer = deletedContainer && selectedElement && isElementInContainer(selectedElement, deletedContainer);
|
|
1462
|
+
if (isSelectedElementInDeletedContainer && isAtomicWidgetSelected()) {
|
|
1463
|
+
close();
|
|
1464
|
+
}
|
|
1465
|
+
});
|
|
1466
|
+
}, []);
|
|
1467
|
+
};
|
|
1468
|
+
|
|
1609
1469
|
// src/hooks/use-open-editor-panel.ts
|
|
1610
|
-
import { useEffect as
|
|
1611
|
-
import {
|
|
1470
|
+
import { useEffect as useEffect3 } from "react";
|
|
1471
|
+
import { __privateListenTo as listenTo2, commandStartEvent as commandStartEvent2 } from "@elementor/editor-v1-adapters";
|
|
1612
1472
|
var useOpenEditorPanel = () => {
|
|
1613
1473
|
const { open } = usePanelActions();
|
|
1614
|
-
|
|
1615
|
-
return
|
|
1616
|
-
if (
|
|
1474
|
+
useEffect3(() => {
|
|
1475
|
+
return listenTo2(commandStartEvent2("panel/editor/open"), () => {
|
|
1476
|
+
if (isAtomicWidgetSelected()) {
|
|
1617
1477
|
open();
|
|
1618
1478
|
}
|
|
1619
1479
|
});
|
|
@@ -1623,35 +1483,53 @@ var useOpenEditorPanel = () => {
|
|
|
1623
1483
|
// src/components/editing-panel-hooks.tsx
|
|
1624
1484
|
var EditingPanelHooks = () => {
|
|
1625
1485
|
useOpenEditorPanel();
|
|
1486
|
+
useCloseEditorPanel();
|
|
1626
1487
|
return null;
|
|
1627
1488
|
};
|
|
1628
1489
|
|
|
1629
|
-
// src/init.ts
|
|
1630
|
-
import { __registerPanel as registerPanel } from "@elementor/editor-panels";
|
|
1631
|
-
import { __privateBlockDataCommand as blockDataCommand } from "@elementor/editor-v1-adapters";
|
|
1632
|
-
|
|
1633
1490
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
1634
|
-
import * as
|
|
1635
|
-
import { useId as
|
|
1491
|
+
import * as React54 from "react";
|
|
1492
|
+
import { useId as useId3 } from "react";
|
|
1493
|
+
import { ControlLabel as ControlLabel24, useBoundProp as useBoundProp3 } from "@elementor/editor-controls";
|
|
1494
|
+
import { DatabaseIcon, SettingsIcon, XIcon as XIcon2 } from "@elementor/icons";
|
|
1495
|
+
import {
|
|
1496
|
+
bindPopover as bindPopover2,
|
|
1497
|
+
bindTrigger,
|
|
1498
|
+
Box as Box5,
|
|
1499
|
+
Divider as Divider9,
|
|
1500
|
+
IconButton as IconButton4,
|
|
1501
|
+
Paper,
|
|
1502
|
+
Popover as Popover2,
|
|
1503
|
+
Stack as Stack20,
|
|
1504
|
+
Tab as Tab2,
|
|
1505
|
+
TabPanel as TabPanel2,
|
|
1506
|
+
Tabs as Tabs2,
|
|
1507
|
+
Typography as Typography4,
|
|
1508
|
+
UnstableTag as Tag,
|
|
1509
|
+
usePopupState as usePopupState2,
|
|
1510
|
+
useTabs as useTabs2
|
|
1511
|
+
} from "@elementor/ui";
|
|
1512
|
+
import { __ as __33 } from "@wordpress/i18n";
|
|
1636
1513
|
|
|
1637
1514
|
// src/dynamics/dynamic-control.tsx
|
|
1638
|
-
import * as
|
|
1515
|
+
import * as React52 from "react";
|
|
1516
|
+
import { BoundPropProvider as BoundPropProvider3, useBoundProp } from "@elementor/editor-controls";
|
|
1639
1517
|
|
|
1640
1518
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
1641
|
-
import { useMemo as
|
|
1519
|
+
import { useMemo as useMemo4 } from "react";
|
|
1642
1520
|
|
|
1643
1521
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
1644
|
-
import { useMemo } from "react";
|
|
1522
|
+
import { useMemo as useMemo3 } from "react";
|
|
1645
1523
|
|
|
1646
1524
|
// src/dynamics/sync/get-elementor-config.ts
|
|
1647
|
-
var
|
|
1525
|
+
var getElementorConfig2 = () => {
|
|
1648
1526
|
const extendedWindow = window;
|
|
1649
1527
|
return extendedWindow.elementor?.config ?? {};
|
|
1650
1528
|
};
|
|
1651
1529
|
|
|
1652
1530
|
// src/dynamics/sync/get-atomic-dynamic-tags.ts
|
|
1653
1531
|
var getAtomicDynamicTags = () => {
|
|
1654
|
-
const { atomicDynamicTags } =
|
|
1532
|
+
const { atomicDynamicTags } = getElementorConfig2();
|
|
1655
1533
|
if (!atomicDynamicTags) {
|
|
1656
1534
|
return null;
|
|
1657
1535
|
}
|
|
@@ -1661,17 +1539,8 @@ var getAtomicDynamicTags = () => {
|
|
|
1661
1539
|
};
|
|
1662
1540
|
};
|
|
1663
1541
|
|
|
1664
|
-
// src/controls/props/is-transformable.ts
|
|
1665
|
-
import { z } from "@elementor/schema";
|
|
1666
|
-
var transformableSchema = z.object({
|
|
1667
|
-
$$type: z.string(),
|
|
1668
|
-
value: z.any()
|
|
1669
|
-
});
|
|
1670
|
-
var isTransformable = (value) => {
|
|
1671
|
-
return transformableSchema.safeParse(value).success;
|
|
1672
|
-
};
|
|
1673
|
-
|
|
1674
1542
|
// src/dynamics/utils.ts
|
|
1543
|
+
import { isTransformable } from "@elementor/editor-props";
|
|
1675
1544
|
var DYNAMIC_PROP_TYPE_KEY = "dynamic";
|
|
1676
1545
|
var isDynamicPropType = (prop) => prop.key === DYNAMIC_PROP_TYPE_KEY;
|
|
1677
1546
|
var getDynamicPropType = (propType) => {
|
|
@@ -1694,7 +1563,7 @@ var usePropDynamicTags = (propName) => {
|
|
|
1694
1563
|
const propDynamicType = getDynamicPropType(propType);
|
|
1695
1564
|
categories = propDynamicType?.settings.categories || [];
|
|
1696
1565
|
}
|
|
1697
|
-
return
|
|
1566
|
+
return useMemo3(() => getDynamicTagsByCategories(categories), [categories.join()]);
|
|
1698
1567
|
};
|
|
1699
1568
|
var getDynamicTagsByCategories = (categories) => {
|
|
1700
1569
|
const dynamicTags = getAtomicDynamicTags();
|
|
@@ -1710,12 +1579,12 @@ var getDynamicTagsByCategories = (categories) => {
|
|
|
1710
1579
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
1711
1580
|
var useDynamicTag = (propName, tagName) => {
|
|
1712
1581
|
const dynamicTags = usePropDynamicTags(propName);
|
|
1713
|
-
return
|
|
1582
|
+
return useMemo4(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
1714
1583
|
};
|
|
1715
1584
|
|
|
1716
1585
|
// src/dynamics/dynamic-control.tsx
|
|
1717
1586
|
var DynamicControl = ({ bind, children }) => {
|
|
1718
|
-
const { value, setValue, bind: propName } =
|
|
1587
|
+
const { value, setValue, bind: propName } = useBoundProp();
|
|
1719
1588
|
const { name = "", settings } = value?.value ?? {};
|
|
1720
1589
|
const dynamicTag = useDynamicTag(propName, name);
|
|
1721
1590
|
if (!dynamicTag) {
|
|
@@ -1735,84 +1604,61 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
1735
1604
|
}
|
|
1736
1605
|
});
|
|
1737
1606
|
};
|
|
1738
|
-
return /* @__PURE__ */
|
|
1607
|
+
return /* @__PURE__ */ React52.createElement(BoundPropProvider3, { setValue: setDynamicValue, value: dynamicValue, bind }, children);
|
|
1739
1608
|
};
|
|
1740
1609
|
|
|
1741
|
-
// src/dynamics/components/dynamic-selection-control.tsx
|
|
1742
|
-
import { DatabaseIcon, SettingsIcon, XIcon as XIcon3 } from "@elementor/icons";
|
|
1743
|
-
|
|
1744
1610
|
// src/dynamics/components/dynamic-selection.tsx
|
|
1745
|
-
import * as
|
|
1746
|
-
import {
|
|
1747
|
-
import {
|
|
1611
|
+
import * as React53 from "react";
|
|
1612
|
+
import { Fragment as Fragment6, useState as useState5 } from "react";
|
|
1613
|
+
import { useBoundProp as useBoundProp2 } from "@elementor/editor-controls";
|
|
1614
|
+
import { PhotoIcon, SearchIcon } from "@elementor/icons";
|
|
1748
1615
|
import {
|
|
1749
1616
|
Box as Box4,
|
|
1750
|
-
Divider as
|
|
1751
|
-
InputAdornment
|
|
1617
|
+
Divider as Divider8,
|
|
1618
|
+
InputAdornment,
|
|
1752
1619
|
Link,
|
|
1753
1620
|
ListSubheader,
|
|
1754
|
-
MenuItem
|
|
1621
|
+
MenuItem,
|
|
1755
1622
|
MenuList,
|
|
1756
|
-
Stack as
|
|
1757
|
-
TextField as
|
|
1758
|
-
Typography as
|
|
1623
|
+
Stack as Stack19,
|
|
1624
|
+
TextField as TextField2,
|
|
1625
|
+
Typography as Typography3
|
|
1759
1626
|
} from "@elementor/ui";
|
|
1760
|
-
import { __ as
|
|
1761
|
-
|
|
1762
|
-
// src/dynamics/hooks/use-prop-value-history.ts
|
|
1763
|
-
var PROPS_VALUES_HISTORY_KEY = "elementor/dynamic/non-dynamic-values-history";
|
|
1764
|
-
var usePropValueHistory = (path) => {
|
|
1765
|
-
const valuesHistory = getValues();
|
|
1766
|
-
const { element } = useElement();
|
|
1767
|
-
const key = `${element.id}-${path}`;
|
|
1768
|
-
const value = valuesHistory[key] ?? null;
|
|
1769
|
-
const setValue = (newValue) => {
|
|
1770
|
-
setValues({ ...valuesHistory, [key]: newValue });
|
|
1771
|
-
};
|
|
1772
|
-
return [value, setValue];
|
|
1773
|
-
};
|
|
1774
|
-
var getValues = () => {
|
|
1775
|
-
return JSON.parse(sessionStorage.getItem(PROPS_VALUES_HISTORY_KEY) || "{}");
|
|
1776
|
-
};
|
|
1777
|
-
var setValues = (values) => {
|
|
1778
|
-
sessionStorage.setItem(PROPS_VALUES_HISTORY_KEY, JSON.stringify(values));
|
|
1779
|
-
};
|
|
1780
|
-
|
|
1781
|
-
// src/dynamics/components/dynamic-selection.tsx
|
|
1627
|
+
import { __ as __32 } from "@wordpress/i18n";
|
|
1782
1628
|
var SIZE3 = "tiny";
|
|
1783
1629
|
var DynamicSelection = ({ onSelect }) => {
|
|
1784
|
-
const [searchValue, setSearchValue] =
|
|
1630
|
+
const [searchValue, setSearchValue] = useState5("");
|
|
1785
1631
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
1786
|
-
const { bind, value: currentValue, setValue } =
|
|
1787
|
-
const
|
|
1632
|
+
const { bind, value: currentValue, setValue } = useBoundProp2();
|
|
1633
|
+
const { setPropValue: updatePropValueHistory } = usePropValueHistory();
|
|
1788
1634
|
const isCurrentValueDynamic = isDynamicPropValue(currentValue);
|
|
1789
|
-
const
|
|
1635
|
+
const options5 = useFilteredOptions(bind, searchValue);
|
|
1790
1636
|
const handleSearch = (event) => {
|
|
1791
1637
|
setSearchValue(event.target.value);
|
|
1792
1638
|
};
|
|
1793
1639
|
const handleSetDynamicTag = (value) => {
|
|
1794
1640
|
if (!isCurrentValueDynamic) {
|
|
1795
|
-
updatePropValueHistory(currentValue);
|
|
1641
|
+
updatePropValueHistory(bind, currentValue);
|
|
1796
1642
|
}
|
|
1797
1643
|
setValue({ $$type: "dynamic", value: { name: value, settings: {} } });
|
|
1798
1644
|
onSelect?.();
|
|
1799
1645
|
};
|
|
1800
|
-
return /* @__PURE__ */
|
|
1801
|
-
|
|
1646
|
+
return /* @__PURE__ */ React53.createElement(Stack19, null, /* @__PURE__ */ React53.createElement(Box4, { px: 1.5, pb: 1 }, /* @__PURE__ */ React53.createElement(
|
|
1647
|
+
TextField2,
|
|
1802
1648
|
{
|
|
1803
1649
|
fullWidth: true,
|
|
1804
1650
|
size: SIZE3,
|
|
1805
1651
|
value: searchValue,
|
|
1806
1652
|
onChange: handleSearch,
|
|
1807
|
-
placeholder:
|
|
1653
|
+
placeholder: __32("Search dynamic tag", "elementor"),
|
|
1808
1654
|
InputProps: {
|
|
1809
|
-
startAdornment: /* @__PURE__ */
|
|
1655
|
+
startAdornment: /* @__PURE__ */ React53.createElement(InputAdornment, { position: "start" }, /* @__PURE__ */ React53.createElement(SearchIcon, { fontSize: SIZE3 }))
|
|
1810
1656
|
}
|
|
1811
1657
|
}
|
|
1812
|
-
)), /* @__PURE__ */
|
|
1658
|
+
)), /* @__PURE__ */ React53.createElement(Divider8, null), /* @__PURE__ */ React53.createElement(Box4, { sx: { overflowY: "auto", height: 260, width: 220 } }, options5.length > 0 ? /* @__PURE__ */ React53.createElement(MenuList, { role: "listbox", tabIndex: 0 }, options5.map(([category, items], index) => /* @__PURE__ */ React53.createElement(Fragment6, { key: index }, /* @__PURE__ */ React53.createElement(ListSubheader, { sx: { typography: "caption", color: "text.tertiary" } }, dynamicGroups?.[category]?.title || category), items.map(({ value, label: tagLabel }) => {
|
|
1813
1659
|
const isSelected = isCurrentValueDynamic && value === currentValue?.value?.name;
|
|
1814
|
-
return /* @__PURE__ */
|
|
1815
|
-
|
|
1660
|
+
return /* @__PURE__ */ React53.createElement(
|
|
1661
|
+
MenuItem,
|
|
1816
1662
|
{
|
|
1817
1663
|
key: value,
|
|
1818
1664
|
selected: isSelected,
|
|
@@ -1822,7 +1668,7 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
1822
1668
|
},
|
|
1823
1669
|
tagLabel
|
|
1824
1670
|
);
|
|
1825
|
-
})))) : /* @__PURE__ */
|
|
1671
|
+
})))) : /* @__PURE__ */ React53.createElement(Stack19, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React53.createElement(PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React53.createElement(Typography3, { align: "center", variant: "caption", color: "text.secondary" }, __32("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React53.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React53.createElement(Typography3, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React53.createElement(
|
|
1826
1672
|
Link,
|
|
1827
1673
|
{
|
|
1828
1674
|
color: "secondary",
|
|
@@ -1830,12 +1676,12 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
1830
1676
|
component: "button",
|
|
1831
1677
|
onClick: () => setSearchValue("")
|
|
1832
1678
|
},
|
|
1833
|
-
|
|
1834
|
-
), "\xA0",
|
|
1679
|
+
__32("Clear the filters", "elementor")
|
|
1680
|
+
), "\xA0", __32("and try again.", "elementor")))));
|
|
1835
1681
|
};
|
|
1836
1682
|
var useFilteredOptions = (bind, searchValue) => {
|
|
1837
1683
|
const dynamicTags = usePropDynamicTags(bind);
|
|
1838
|
-
const
|
|
1684
|
+
const options5 = dynamicTags.reduce((categories, { name, label, group }) => {
|
|
1839
1685
|
const isVisible = label.toLowerCase().includes(searchValue.trim().toLowerCase());
|
|
1840
1686
|
if (!isVisible) {
|
|
1841
1687
|
return categories;
|
|
@@ -1846,94 +1692,77 @@ var useFilteredOptions = (bind, searchValue) => {
|
|
|
1846
1692
|
categories.get(group)?.push({ label, value: name });
|
|
1847
1693
|
return categories;
|
|
1848
1694
|
}, /* @__PURE__ */ new Map());
|
|
1849
|
-
return [...
|
|
1695
|
+
return [...options5];
|
|
1850
1696
|
};
|
|
1851
1697
|
|
|
1852
1698
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
1853
|
-
import {
|
|
1854
|
-
bindPopover as bindPopover3,
|
|
1855
|
-
bindTrigger as bindTrigger3,
|
|
1856
|
-
Box as Box5,
|
|
1857
|
-
IconButton as IconButton3,
|
|
1858
|
-
Paper,
|
|
1859
|
-
Popover as Popover3,
|
|
1860
|
-
Stack as Stack19,
|
|
1861
|
-
Typography as Typography5,
|
|
1862
|
-
UnstableTag as Tag,
|
|
1863
|
-
usePopupState as usePopupState4,
|
|
1864
|
-
Tabs as Tabs2,
|
|
1865
|
-
Divider as Divider4,
|
|
1866
|
-
useTabs as useTabs2,
|
|
1867
|
-
Tab as Tab2,
|
|
1868
|
-
TabPanel as TabPanel2
|
|
1869
|
-
} from "@elementor/ui";
|
|
1870
|
-
import { __ as __27 } from "@wordpress/i18n";
|
|
1871
1699
|
var SIZE4 = "tiny";
|
|
1872
1700
|
var DynamicSelectionControl = () => {
|
|
1873
|
-
const { bind, value, setValue } =
|
|
1874
|
-
const
|
|
1701
|
+
const { bind, value, setValue } = useBoundProp3();
|
|
1702
|
+
const { getPropValue: getPropValueFromHistory } = usePropValueHistory();
|
|
1875
1703
|
const { name: tagName = "" } = value?.value || {};
|
|
1876
|
-
const selectionPopoverId =
|
|
1877
|
-
const selectionPopoverState =
|
|
1704
|
+
const selectionPopoverId = useId3();
|
|
1705
|
+
const selectionPopoverState = usePopupState2({ variant: "popover", popupId: selectionPopoverId });
|
|
1878
1706
|
const dynamicTag = useDynamicTag(bind, tagName);
|
|
1879
1707
|
const removeDynamicTag = () => {
|
|
1880
|
-
|
|
1708
|
+
const propValue = getPropValueFromHistory(bind);
|
|
1709
|
+
setValue(propValue ?? null);
|
|
1881
1710
|
};
|
|
1882
1711
|
if (!dynamicTag) {
|
|
1883
1712
|
throw new Error(`Dynamic tag ${tagName} not found`);
|
|
1884
1713
|
}
|
|
1885
|
-
return /* @__PURE__ */
|
|
1714
|
+
return /* @__PURE__ */ React54.createElement(Box5, null, /* @__PURE__ */ React54.createElement(
|
|
1886
1715
|
Tag,
|
|
1887
1716
|
{
|
|
1888
1717
|
fullWidth: true,
|
|
1889
1718
|
showActionsOnHover: true,
|
|
1890
1719
|
label: dynamicTag.label,
|
|
1891
|
-
startIcon: /* @__PURE__ */
|
|
1892
|
-
...
|
|
1893
|
-
actions: /* @__PURE__ */
|
|
1894
|
-
|
|
1720
|
+
startIcon: /* @__PURE__ */ React54.createElement(DatabaseIcon, { fontSize: SIZE4 }),
|
|
1721
|
+
...bindTrigger(selectionPopoverState),
|
|
1722
|
+
actions: /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(DynamicSettingsPopover, { dynamicTag }), /* @__PURE__ */ React54.createElement(
|
|
1723
|
+
IconButton4,
|
|
1895
1724
|
{
|
|
1896
1725
|
size: SIZE4,
|
|
1897
1726
|
onClick: removeDynamicTag,
|
|
1898
|
-
"aria-label":
|
|
1727
|
+
"aria-label": __33("Remove dynamic value", "elementor")
|
|
1899
1728
|
},
|
|
1900
|
-
/* @__PURE__ */
|
|
1729
|
+
/* @__PURE__ */ React54.createElement(XIcon2, { fontSize: SIZE4 })
|
|
1901
1730
|
))
|
|
1902
1731
|
}
|
|
1903
|
-
), /* @__PURE__ */
|
|
1904
|
-
|
|
1732
|
+
), /* @__PURE__ */ React54.createElement(
|
|
1733
|
+
Popover2,
|
|
1905
1734
|
{
|
|
1906
1735
|
disablePortal: true,
|
|
1907
1736
|
disableScrollLock: true,
|
|
1908
1737
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
1909
|
-
...
|
|
1738
|
+
...bindPopover2(selectionPopoverState)
|
|
1910
1739
|
},
|
|
1911
|
-
/* @__PURE__ */
|
|
1740
|
+
/* @__PURE__ */ React54.createElement(Stack20, null, /* @__PURE__ */ React54.createElement(Stack20, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React54.createElement(DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React54.createElement(Typography4, { variant: "subtitle2" }, __33("Dynamic Tags", "elementor")), /* @__PURE__ */ React54.createElement(IconButton4, { size: SIZE4, sx: { ml: "auto" }, onClick: selectionPopoverState.close }, /* @__PURE__ */ React54.createElement(XIcon2, { fontSize: SIZE4 }))), /* @__PURE__ */ React54.createElement(DynamicSelection, { onSelect: selectionPopoverState.close }))
|
|
1912
1741
|
));
|
|
1913
1742
|
};
|
|
1914
1743
|
var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
1915
|
-
const popupId =
|
|
1916
|
-
const settingsPopupState =
|
|
1744
|
+
const popupId = useId3();
|
|
1745
|
+
const settingsPopupState = usePopupState2({ variant: "popover", popupId });
|
|
1917
1746
|
const hasDynamicSettings = !!dynamicTag.atomic_controls.length;
|
|
1918
1747
|
if (!hasDynamicSettings) {
|
|
1919
1748
|
return null;
|
|
1920
1749
|
}
|
|
1921
|
-
return /* @__PURE__ */
|
|
1922
|
-
|
|
1750
|
+
return /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(
|
|
1751
|
+
IconButton4,
|
|
1923
1752
|
{
|
|
1924
1753
|
size: SIZE4,
|
|
1925
|
-
...
|
|
1926
|
-
"aria-label":
|
|
1754
|
+
...bindTrigger(settingsPopupState),
|
|
1755
|
+
"aria-label": __33("Settings", "elementor")
|
|
1927
1756
|
},
|
|
1928
|
-
/* @__PURE__ */
|
|
1929
|
-
), /* @__PURE__ */
|
|
1930
|
-
|
|
1757
|
+
/* @__PURE__ */ React54.createElement(SettingsIcon, { fontSize: SIZE4 })
|
|
1758
|
+
), /* @__PURE__ */ React54.createElement(
|
|
1759
|
+
Popover2,
|
|
1931
1760
|
{
|
|
1932
1761
|
disableScrollLock: true,
|
|
1933
1762
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
1934
|
-
...
|
|
1763
|
+
...bindPopover2(settingsPopupState)
|
|
1935
1764
|
},
|
|
1936
|
-
/* @__PURE__ */
|
|
1765
|
+
/* @__PURE__ */ React54.createElement(Paper, { component: Stack20, sx: { minHeight: "300px", width: "220px" } }, /* @__PURE__ */ React54.createElement(Stack20, { direction: "row", alignItems: "center", px: 1.5, pt: 2, pb: 1 }, /* @__PURE__ */ React54.createElement(DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React54.createElement(Typography4, { variant: "subtitle2" }, dynamicTag.label), /* @__PURE__ */ React54.createElement(IconButton4, { sx: { ml: "auto" }, size: SIZE4, onClick: settingsPopupState.close }, /* @__PURE__ */ React54.createElement(XIcon2, { fontSize: SIZE4 }))), /* @__PURE__ */ React54.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls }))
|
|
1937
1766
|
));
|
|
1938
1767
|
};
|
|
1939
1768
|
var DynamicSettings = ({ controls }) => {
|
|
@@ -1942,36 +1771,37 @@ var DynamicSettings = ({ controls }) => {
|
|
|
1942
1771
|
if (!tabs.length) {
|
|
1943
1772
|
return null;
|
|
1944
1773
|
}
|
|
1945
|
-
return /* @__PURE__ */
|
|
1946
|
-
return /* @__PURE__ */
|
|
1774
|
+
return /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(Tabs2, { indicatorColor: "secondary", textColor: "secondary", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React54.createElement(Tab2, { key: index, label: value.label, sx: { px: 1, py: 0.5 }, ...getTabProps(index) }))), /* @__PURE__ */ React54.createElement(Divider9, null), tabs.map(({ value }, index) => {
|
|
1775
|
+
return /* @__PURE__ */ React54.createElement(TabPanel2, { key: index, sx: { flexGrow: 1 }, ...getTabPanelProps(index) }, /* @__PURE__ */ React54.createElement(Stack20, { gap: 1, px: 2 }, value.items.map((item) => {
|
|
1947
1776
|
if (item.type === "control") {
|
|
1948
|
-
return /* @__PURE__ */
|
|
1777
|
+
return /* @__PURE__ */ React54.createElement(Control3, { key: item.value.bind, control: item.value });
|
|
1949
1778
|
}
|
|
1950
1779
|
return null;
|
|
1951
1780
|
})));
|
|
1952
1781
|
}));
|
|
1953
1782
|
};
|
|
1954
|
-
var
|
|
1783
|
+
var Control3 = ({ control }) => {
|
|
1955
1784
|
if (!getControlByType(control.type)) {
|
|
1956
1785
|
return null;
|
|
1957
1786
|
}
|
|
1958
|
-
return /* @__PURE__ */
|
|
1787
|
+
return /* @__PURE__ */ React54.createElement(DynamicControl, { bind: control.bind }, control.label ? /* @__PURE__ */ React54.createElement(ControlLabel24, null, control.label) : null, /* @__PURE__ */ React54.createElement(Control, { type: control.type, props: control.props }));
|
|
1959
1788
|
};
|
|
1960
1789
|
|
|
1961
1790
|
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
1962
|
-
import * as
|
|
1791
|
+
import * as React55 from "react";
|
|
1792
|
+
import { useBoundProp as useBoundProp4 } from "@elementor/editor-controls";
|
|
1963
1793
|
import { DatabaseIcon as DatabaseIcon2 } from "@elementor/icons";
|
|
1964
|
-
import { __ as
|
|
1794
|
+
import { __ as __34 } from "@wordpress/i18n";
|
|
1965
1795
|
var usePropDynamicAction = () => {
|
|
1966
|
-
const { bind } =
|
|
1796
|
+
const { bind } = useBoundProp4();
|
|
1967
1797
|
const { elementType } = useElement();
|
|
1968
1798
|
const propType = elementType.propsSchema[bind];
|
|
1969
1799
|
const visible = !!propType && supportsDynamic(propType);
|
|
1970
1800
|
return {
|
|
1971
1801
|
visible,
|
|
1972
1802
|
icon: DatabaseIcon2,
|
|
1973
|
-
title:
|
|
1974
|
-
popoverContent: ({ closePopover }) => /* @__PURE__ */
|
|
1803
|
+
title: __34("Dynamic Tags", "elementor"),
|
|
1804
|
+
popoverContent: ({ closePopover }) => /* @__PURE__ */ React55.createElement(DynamicSelection, { onSelect: closePopover })
|
|
1975
1805
|
};
|
|
1976
1806
|
};
|
|
1977
1807
|
|
|
@@ -2001,15 +1831,14 @@ function init2() {
|
|
|
2001
1831
|
var blockV1Panel = () => {
|
|
2002
1832
|
blockDataCommand({
|
|
2003
1833
|
command: "panel/editor/open",
|
|
2004
|
-
condition:
|
|
1834
|
+
condition: isAtomicWidgetSelected
|
|
2005
1835
|
});
|
|
2006
1836
|
};
|
|
2007
1837
|
|
|
2008
1838
|
// src/index.ts
|
|
2009
1839
|
init2();
|
|
2010
1840
|
export {
|
|
2011
|
-
controlActionsMenu,
|
|
2012
1841
|
replaceControl,
|
|
2013
|
-
|
|
1842
|
+
useBoundProp5 as useBoundProp
|
|
2014
1843
|
};
|
|
2015
1844
|
//# sourceMappingURL=index.mjs.map
|