@elementor/editor-editing-panel 4.2.0-872 → 4.2.0-874
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/dist/index.js +246 -221
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +245 -220
- package/dist/index.mjs.map +1 -1
- package/package.json +24 -24
- package/src/components/settings-tab.tsx +49 -9
package/dist/index.js
CHANGED
|
@@ -2030,206 +2030,8 @@ var InteractionsTab = () => {
|
|
|
2030
2030
|
var React23 = __toESM(require("react"));
|
|
2031
2031
|
var import_session6 = require("@elementor/session");
|
|
2032
2032
|
|
|
2033
|
-
// src/components/section.tsx
|
|
2034
|
-
var React17 = __toESM(require("react"));
|
|
2035
|
-
var import_react18 = require("react");
|
|
2036
|
-
var import_editor_ui5 = require("@elementor/editor-ui");
|
|
2037
|
-
var import_ui11 = require("@elementor/ui");
|
|
2038
|
-
function Section({ title, children, defaultExpanded = false, titleEnd, unmountOnExit = true, action }) {
|
|
2039
|
-
const [isOpen, setIsOpen] = useStateByElement(title, !!defaultExpanded);
|
|
2040
|
-
const ref = (0, import_react18.useRef)(null);
|
|
2041
|
-
const isDisabled = !!action;
|
|
2042
|
-
const handleClick = () => {
|
|
2043
|
-
if (isDisabled) {
|
|
2044
|
-
action?.onClick();
|
|
2045
|
-
} else {
|
|
2046
|
-
setIsOpen(!isOpen);
|
|
2047
|
-
}
|
|
2048
|
-
};
|
|
2049
|
-
const id = (0, import_react18.useId)();
|
|
2050
|
-
const labelId = `label-${id}`;
|
|
2051
|
-
const contentId = `content-${id}`;
|
|
2052
|
-
return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
|
|
2053
|
-
import_ui11.ListItemButton,
|
|
2054
|
-
{
|
|
2055
|
-
id: labelId,
|
|
2056
|
-
"aria-controls": contentId,
|
|
2057
|
-
"aria-label": `${title} section`,
|
|
2058
|
-
onClick: handleClick,
|
|
2059
|
-
sx: { "&:hover": { backgroundColor: "transparent" } }
|
|
2060
|
-
},
|
|
2061
|
-
/* @__PURE__ */ React17.createElement(import_ui11.Stack, { direction: "row", alignItems: "center", justifyItems: "start", flexGrow: 1, gap: 0.5 }, /* @__PURE__ */ React17.createElement(
|
|
2062
|
-
import_ui11.ListItemText,
|
|
2063
|
-
{
|
|
2064
|
-
secondary: title,
|
|
2065
|
-
secondaryTypographyProps: { color: "text.primary", variant: "caption", fontWeight: "bold" },
|
|
2066
|
-
sx: { flexGrow: 0, flexShrink: 1, marginInlineEnd: 1 }
|
|
2067
|
-
}
|
|
2068
|
-
), (0, import_editor_ui5.getCollapsibleValue)(titleEnd, isOpen)),
|
|
2069
|
-
action?.component,
|
|
2070
|
-
/* @__PURE__ */ React17.createElement(
|
|
2071
|
-
import_editor_ui5.CollapseIcon,
|
|
2072
|
-
{
|
|
2073
|
-
open: isOpen,
|
|
2074
|
-
color: "secondary",
|
|
2075
|
-
fontSize: "tiny",
|
|
2076
|
-
disabled: isDisabled,
|
|
2077
|
-
sx: { ml: 1 }
|
|
2078
|
-
}
|
|
2079
|
-
)
|
|
2080
|
-
), /* @__PURE__ */ React17.createElement(
|
|
2081
|
-
import_ui11.Collapse,
|
|
2082
|
-
{
|
|
2083
|
-
id: contentId,
|
|
2084
|
-
"aria-labelledby": labelId,
|
|
2085
|
-
in: isOpen,
|
|
2086
|
-
timeout: "auto",
|
|
2087
|
-
unmountOnExit
|
|
2088
|
-
},
|
|
2089
|
-
/* @__PURE__ */ React17.createElement(import_editor_ui5.SectionRefContext.Provider, { value: ref }, /* @__PURE__ */ React17.createElement(import_ui11.Stack, { ref, gap: 2.5, p: 2, "aria-label": `${title} section content` }, children))
|
|
2090
|
-
), /* @__PURE__ */ React17.createElement(import_ui11.Divider, null));
|
|
2091
|
-
}
|
|
2092
|
-
|
|
2093
|
-
// src/components/settings-control.tsx
|
|
2094
|
-
var React22 = __toESM(require("react"));
|
|
2095
|
-
var import_editor_controls4 = require("@elementor/editor-controls");
|
|
2096
|
-
var import_ui14 = require("@elementor/ui");
|
|
2097
|
-
|
|
2098
|
-
// src/controls-registry/control.tsx
|
|
2099
|
-
var React18 = __toESM(require("react"));
|
|
2100
|
-
|
|
2101
|
-
// src/controls-registry/controls-registry.tsx
|
|
2102
|
-
var import_editor_controls = require("@elementor/editor-controls");
|
|
2103
|
-
var import_editor_props4 = require("@elementor/editor-props");
|
|
2104
|
-
var queryArrayPropTypeUtil = (0, import_editor_props4.createArrayPropUtils)(import_editor_props4.queryPropTypeUtil.key, import_editor_props4.queryPropTypeUtil.schema);
|
|
2105
|
-
var controlTypes = {
|
|
2106
|
-
image: { component: import_editor_controls.ImageControl, layout: "custom", propTypeUtil: import_editor_props4.imagePropTypeUtil },
|
|
2107
|
-
"svg-media": { component: import_editor_controls.SvgMediaControl, layout: "full", propTypeUtil: import_editor_props4.svgSrcPropTypeUtil },
|
|
2108
|
-
text: { component: import_editor_controls.TextControl, layout: "full", propTypeUtil: import_editor_props4.stringPropTypeUtil },
|
|
2109
|
-
textarea: { component: import_editor_controls.TextAreaControl, layout: "full", propTypeUtil: import_editor_props4.stringPropTypeUtil },
|
|
2110
|
-
size: { component: import_editor_controls.SizeControl, layout: "two-columns", propTypeUtil: import_editor_props4.sizePropTypeUtil },
|
|
2111
|
-
select: { component: import_editor_controls.SelectControlWrapper, layout: "two-columns", propTypeUtil: import_editor_props4.stringPropTypeUtil },
|
|
2112
|
-
chips: { component: import_editor_controls.ChipsControl, layout: "full", propTypeUtil: import_editor_props4.stringArrayPropTypeUtil },
|
|
2113
|
-
link: { component: import_editor_controls.LinkControl, layout: "custom", propTypeUtil: import_editor_props4.linkPropTypeUtil },
|
|
2114
|
-
query: { component: import_editor_controls.QueryControl, layout: "full", propTypeUtil: import_editor_props4.queryPropTypeUtil },
|
|
2115
|
-
"query-chips": { component: import_editor_controls.QueryChipsControl, layout: "full", propTypeUtil: queryArrayPropTypeUtil },
|
|
2116
|
-
"query-filter-repeater": {
|
|
2117
|
-
component: import_editor_controls.QueryFilterRepeaterControl,
|
|
2118
|
-
layout: "full",
|
|
2119
|
-
propTypeUtil: import_editor_props4.queryFilterArrayPropTypeUtil
|
|
2120
|
-
},
|
|
2121
|
-
url: { component: import_editor_controls.UrlControl, layout: "full", propTypeUtil: import_editor_props4.stringPropTypeUtil },
|
|
2122
|
-
switch: { component: import_editor_controls.SwitchControl, layout: "two-columns", propTypeUtil: import_editor_props4.booleanPropTypeUtil },
|
|
2123
|
-
number: { component: import_editor_controls.NumberControl, layout: "two-columns", propTypeUtil: import_editor_props4.numberPropTypeUtil },
|
|
2124
|
-
repeatable: { component: import_editor_controls.RepeatableControl, layout: "full", propTypeUtil: void 0 },
|
|
2125
|
-
"key-value": { component: import_editor_controls.KeyValueControl, layout: "full", propTypeUtil: import_editor_props4.keyValuePropTypeUtil },
|
|
2126
|
-
"html-tag": { component: import_editor_controls.HtmlTagControl, layout: "two-columns", propTypeUtil: import_editor_props4.stringPropTypeUtil },
|
|
2127
|
-
toggle: { component: import_editor_controls.ToggleControl, layout: "full", propTypeUtil: import_editor_props4.stringPropTypeUtil },
|
|
2128
|
-
"date-time": { component: import_editor_controls.DateTimeControl, layout: "full", propTypeUtil: import_editor_props4.DateTimePropTypeUtil },
|
|
2129
|
-
video: { component: import_editor_controls.VideoMediaControl, layout: "full", propTypeUtil: import_editor_props4.videoSrcPropTypeUtil },
|
|
2130
|
-
"inline-editing": { component: import_editor_controls.InlineEditingControl, layout: "full", propTypeUtil: import_editor_props4.htmlV3PropTypeUtil },
|
|
2131
|
-
email: { component: import_editor_controls.EmailFormActionControl, layout: "custom", propTypeUtil: import_editor_props4.emailsPropTypeUtil },
|
|
2132
|
-
"date-range": {
|
|
2133
|
-
component: import_editor_controls.DateRangeControl,
|
|
2134
|
-
layout: "custom",
|
|
2135
|
-
propTypeUtil: import_editor_props4.dateRangePropTypeUtil
|
|
2136
|
-
},
|
|
2137
|
-
"time-range": {
|
|
2138
|
-
component: import_editor_controls.TimeRangeControl,
|
|
2139
|
-
layout: "custom",
|
|
2140
|
-
propTypeUtil: import_editor_props4.timeRangePropTypeUtil
|
|
2141
|
-
},
|
|
2142
|
-
"attachment-type": { component: import_editor_controls.AttachmentTypeControl, layout: "custom", propTypeUtil: import_editor_props4.stringPropTypeUtil }
|
|
2143
|
-
};
|
|
2144
|
-
var ControlsRegistry = class {
|
|
2145
|
-
constructor(controlsRegistry2) {
|
|
2146
|
-
this.controlsRegistry = controlsRegistry2;
|
|
2147
|
-
this.controlsRegistry = controlsRegistry2;
|
|
2148
|
-
}
|
|
2149
|
-
get(type) {
|
|
2150
|
-
return this.controlsRegistry[type]?.component;
|
|
2151
|
-
}
|
|
2152
|
-
getLayout(type) {
|
|
2153
|
-
return this.controlsRegistry[type]?.layout;
|
|
2154
|
-
}
|
|
2155
|
-
getPropTypeUtil(type) {
|
|
2156
|
-
return this.controlsRegistry[type]?.propTypeUtil;
|
|
2157
|
-
}
|
|
2158
|
-
registry() {
|
|
2159
|
-
return this.controlsRegistry;
|
|
2160
|
-
}
|
|
2161
|
-
register(type, component, layout, propTypeUtil) {
|
|
2162
|
-
if (this.controlsRegistry[type]) {
|
|
2163
|
-
throw new ControlTypeAlreadyRegisteredError({ context: { controlType: type } });
|
|
2164
|
-
}
|
|
2165
|
-
this.controlsRegistry[type] = { component, layout, propTypeUtil };
|
|
2166
|
-
}
|
|
2167
|
-
unregister(type) {
|
|
2168
|
-
if (!this.controlsRegistry[type]) {
|
|
2169
|
-
throw new ControlTypeNotRegisteredError({ context: { controlType: type } });
|
|
2170
|
-
}
|
|
2171
|
-
delete this.controlsRegistry[type];
|
|
2172
|
-
}
|
|
2173
|
-
};
|
|
2174
|
-
var controlsRegistry = new ControlsRegistry(controlTypes);
|
|
2175
|
-
|
|
2176
|
-
// src/controls-registry/control.tsx
|
|
2177
|
-
var Control = ({ props, type }) => {
|
|
2178
|
-
const ControlByType = controlsRegistry.get(type);
|
|
2179
|
-
const { element } = useElement();
|
|
2180
|
-
if (!ControlByType) {
|
|
2181
|
-
throw new ControlTypeNotFoundError({
|
|
2182
|
-
context: { controlType: type }
|
|
2183
|
-
});
|
|
2184
|
-
}
|
|
2185
|
-
return /* @__PURE__ */ React18.createElement(ControlByType, { ...props, context: { elementId: element.id } });
|
|
2186
|
-
};
|
|
2187
|
-
|
|
2188
|
-
// src/controls-registry/control-type-container.tsx
|
|
2189
|
-
var React19 = __toESM(require("react"));
|
|
2190
|
-
var import_ui12 = require("@elementor/ui");
|
|
2191
|
-
var ControlTypeContainer = ({ children, layout }) => {
|
|
2192
|
-
if (layout === "custom") {
|
|
2193
|
-
return children;
|
|
2194
|
-
}
|
|
2195
|
-
return /* @__PURE__ */ React19.createElement(StyledContainer, { layout }, children);
|
|
2196
|
-
};
|
|
2197
|
-
var StyledContainer = (0, import_ui12.styled)(import_ui12.Box, {
|
|
2198
|
-
shouldForwardProp: (prop) => !["layout"].includes(prop)
|
|
2199
|
-
})(({ layout, theme }) => ({
|
|
2200
|
-
display: "grid",
|
|
2201
|
-
gridGap: theme.spacing(1),
|
|
2202
|
-
...getGridLayout(layout)
|
|
2203
|
-
}));
|
|
2204
|
-
var getGridLayout = (layout) => ({
|
|
2205
|
-
justifyContent: "space-between",
|
|
2206
|
-
...getStyleByLayout(layout)
|
|
2207
|
-
});
|
|
2208
|
-
var getStyleByLayout = (layout) => {
|
|
2209
|
-
if (layout === "full") {
|
|
2210
|
-
return {
|
|
2211
|
-
gridTemplateColumns: "minmax(0, 1fr)"
|
|
2212
|
-
};
|
|
2213
|
-
}
|
|
2214
|
-
if (layout === "two-columns") {
|
|
2215
|
-
return {
|
|
2216
|
-
alignItems: "center",
|
|
2217
|
-
gridTemplateColumns: "repeat(2, minmax(0, 1fr))"
|
|
2218
|
-
};
|
|
2219
|
-
}
|
|
2220
|
-
};
|
|
2221
|
-
|
|
2222
|
-
// src/controls-registry/settings-field.tsx
|
|
2223
|
-
var React20 = __toESM(require("react"));
|
|
2224
|
-
var import_react19 = require("react");
|
|
2225
|
-
var import_editor_controls2 = require("@elementor/editor-controls");
|
|
2226
|
-
var import_editor_documents2 = require("@elementor/editor-documents");
|
|
2227
|
-
var import_editor_elements6 = require("@elementor/editor-elements");
|
|
2228
|
-
var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
|
|
2229
|
-
var import_i18n8 = require("@wordpress/i18n");
|
|
2230
|
-
|
|
2231
2033
|
// src/utils/prop-dependency-utils.ts
|
|
2232
|
-
var
|
|
2034
|
+
var import_editor_props4 = require("@elementor/editor-props");
|
|
2233
2035
|
var import_session5 = require("@elementor/session");
|
|
2234
2036
|
function getElementSettingsWithDefaults(propsSchema, elementSettings) {
|
|
2235
2037
|
const elementSettingsWithDefaults = { ...elementSettings };
|
|
@@ -2243,12 +2045,12 @@ function getElementSettingsWithDefaults(propsSchema, elementSettings) {
|
|
|
2243
2045
|
function extractDependencyEffect(bind, propsSchema, settings) {
|
|
2244
2046
|
const settingsWithDefaults = getElementSettingsWithDefaults(propsSchema, settings);
|
|
2245
2047
|
const propType = propsSchema[bind];
|
|
2246
|
-
const depCheck = (0,
|
|
2048
|
+
const depCheck = (0, import_editor_props4.isDependencyMet)(propType?.dependencies, settingsWithDefaults);
|
|
2247
2049
|
const failingTerm = !depCheck.isMet ? depCheck.failingDependencies[0] : void 0;
|
|
2248
|
-
const isHidden = !!failingTerm && !(0,
|
|
2050
|
+
const isHidden = !!failingTerm && !(0, import_editor_props4.isDependency)(failingTerm) && failingTerm?.effect === "hide";
|
|
2249
2051
|
return {
|
|
2250
2052
|
isHidden,
|
|
2251
|
-
isDisabled: (prop) => !(0,
|
|
2053
|
+
isDisabled: (prop) => !(0, import_editor_props4.isDependencyMet)(prop?.dependencies, settingsWithDefaults).isMet
|
|
2252
2054
|
};
|
|
2253
2055
|
}
|
|
2254
2056
|
function extractOrderedDependencies(dependenciesPerTargetMapping) {
|
|
@@ -2267,8 +2069,8 @@ function getUpdatedValues(values, dependencies, propsSchema, elementValues, elem
|
|
|
2267
2069
|
return newValues;
|
|
2268
2070
|
}
|
|
2269
2071
|
const testDependencies = {
|
|
2270
|
-
previousValues: (0,
|
|
2271
|
-
newValues: (0,
|
|
2072
|
+
previousValues: (0, import_editor_props4.isDependencyMet)(propType.dependencies, elementValues),
|
|
2073
|
+
newValues: (0, import_editor_props4.isDependencyMet)(propType.dependencies, combinedValues)
|
|
2272
2074
|
};
|
|
2273
2075
|
if (!testDependencies.newValues.isMet) {
|
|
2274
2076
|
const newValue = handleUnmetCondition({
|
|
@@ -2285,7 +2087,7 @@ function getUpdatedValues(values, dependencies, propsSchema, elementValues, elem
|
|
|
2285
2087
|
}
|
|
2286
2088
|
if (!testDependencies.previousValues.isMet) {
|
|
2287
2089
|
const savedValue = retrievePreviousValueFromStorage({ path: dependency, elementId });
|
|
2288
|
-
const currentValue = (0,
|
|
2090
|
+
const currentValue = (0, import_editor_props4.extractValue)(path, combinedValues, [], {
|
|
2289
2091
|
unwrapOverridableLeaf: false
|
|
2290
2092
|
});
|
|
2291
2093
|
removePreviousValueFromStorage({ path: dependency, elementId });
|
|
@@ -2322,7 +2124,7 @@ function evaluatePropType(props) {
|
|
|
2322
2124
|
const { key, index, path, elementValues, basePropKey } = props;
|
|
2323
2125
|
switch (prop.kind) {
|
|
2324
2126
|
case "union":
|
|
2325
|
-
const value = (0,
|
|
2127
|
+
const value = (0, import_editor_props4.extractValue)(path.slice(0, index + 1), elementValues);
|
|
2326
2128
|
const type = value?.$$type ?? null;
|
|
2327
2129
|
return getPropType(
|
|
2328
2130
|
{ [basePropKey]: prop.prop_types?.[type] },
|
|
@@ -2360,9 +2162,9 @@ function cloneDescent(child) {
|
|
|
2360
2162
|
if (!child) {
|
|
2361
2163
|
return null;
|
|
2362
2164
|
}
|
|
2363
|
-
if ((0,
|
|
2165
|
+
if ((0, import_editor_props4.isOverridable)(child)) {
|
|
2364
2166
|
const origin = child.value.origin_value;
|
|
2365
|
-
if (!origin || !(0,
|
|
2167
|
+
if (!origin || !(0, import_editor_props4.isTransformable)(origin)) {
|
|
2366
2168
|
return null;
|
|
2367
2169
|
}
|
|
2368
2170
|
const descended = { ...origin.value };
|
|
@@ -2375,7 +2177,7 @@ function cloneDescent(child) {
|
|
|
2375
2177
|
};
|
|
2376
2178
|
return { replacement, descended };
|
|
2377
2179
|
}
|
|
2378
|
-
if ((0,
|
|
2180
|
+
if ((0, import_editor_props4.isTransformable)(child)) {
|
|
2379
2181
|
const descended = { ...child.value };
|
|
2380
2182
|
const replacement = { ...child, value: descended };
|
|
2381
2183
|
return { replacement, descended };
|
|
@@ -2386,17 +2188,17 @@ function isCompatibleSavedValue(saved, current) {
|
|
|
2386
2188
|
if (!saved) {
|
|
2387
2189
|
return false;
|
|
2388
2190
|
}
|
|
2389
|
-
return (0,
|
|
2191
|
+
return (0, import_editor_props4.isOverridable)(saved) === (0, import_editor_props4.isOverridable)(current);
|
|
2390
2192
|
}
|
|
2391
2193
|
function mergeLeafValue(existing, incoming) {
|
|
2392
2194
|
if (incoming === null) {
|
|
2393
2195
|
return null;
|
|
2394
2196
|
}
|
|
2395
|
-
if (incoming && (0,
|
|
2197
|
+
if (incoming && (0, import_editor_props4.isOverridable)(incoming)) {
|
|
2396
2198
|
return incoming;
|
|
2397
2199
|
}
|
|
2398
|
-
if (existing && (0,
|
|
2399
|
-
return (0,
|
|
2200
|
+
if (existing && (0, import_editor_props4.isOverridable)(existing) && incoming) {
|
|
2201
|
+
return (0, import_editor_props4.rewrapOverridableValue)(existing, incoming);
|
|
2400
2202
|
}
|
|
2401
2203
|
return incoming;
|
|
2402
2204
|
}
|
|
@@ -2406,7 +2208,7 @@ function handleUnmetCondition(props) {
|
|
|
2406
2208
|
(term) => "newValue" in term && !!term.newValue
|
|
2407
2209
|
);
|
|
2408
2210
|
const newValue = termWithNewValue?.newValue ?? null;
|
|
2409
|
-
const currentValue = (0,
|
|
2211
|
+
const currentValue = (0, import_editor_props4.extractValue)(dependency.split("."), elementValues, [], { unwrapOverridableLeaf: false }) ?? defaultValue;
|
|
2410
2212
|
savePreviousValueToStorage({
|
|
2411
2213
|
path: dependency,
|
|
2412
2214
|
elementId,
|
|
@@ -2434,6 +2236,204 @@ function removePreviousValueFromStorage({ path, elementId }) {
|
|
|
2434
2236
|
(0, import_session5.removeSessionStorageItem)(key);
|
|
2435
2237
|
}
|
|
2436
2238
|
|
|
2239
|
+
// src/components/section.tsx
|
|
2240
|
+
var React17 = __toESM(require("react"));
|
|
2241
|
+
var import_react18 = require("react");
|
|
2242
|
+
var import_editor_ui5 = require("@elementor/editor-ui");
|
|
2243
|
+
var import_ui11 = require("@elementor/ui");
|
|
2244
|
+
function Section({ title, children, defaultExpanded = false, titleEnd, unmountOnExit = true, action }) {
|
|
2245
|
+
const [isOpen, setIsOpen] = useStateByElement(title, !!defaultExpanded);
|
|
2246
|
+
const ref = (0, import_react18.useRef)(null);
|
|
2247
|
+
const isDisabled = !!action;
|
|
2248
|
+
const handleClick = () => {
|
|
2249
|
+
if (isDisabled) {
|
|
2250
|
+
action?.onClick();
|
|
2251
|
+
} else {
|
|
2252
|
+
setIsOpen(!isOpen);
|
|
2253
|
+
}
|
|
2254
|
+
};
|
|
2255
|
+
const id = (0, import_react18.useId)();
|
|
2256
|
+
const labelId = `label-${id}`;
|
|
2257
|
+
const contentId = `content-${id}`;
|
|
2258
|
+
return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
|
|
2259
|
+
import_ui11.ListItemButton,
|
|
2260
|
+
{
|
|
2261
|
+
id: labelId,
|
|
2262
|
+
"aria-controls": contentId,
|
|
2263
|
+
"aria-label": `${title} section`,
|
|
2264
|
+
onClick: handleClick,
|
|
2265
|
+
sx: { "&:hover": { backgroundColor: "transparent" } }
|
|
2266
|
+
},
|
|
2267
|
+
/* @__PURE__ */ React17.createElement(import_ui11.Stack, { direction: "row", alignItems: "center", justifyItems: "start", flexGrow: 1, gap: 0.5 }, /* @__PURE__ */ React17.createElement(
|
|
2268
|
+
import_ui11.ListItemText,
|
|
2269
|
+
{
|
|
2270
|
+
secondary: title,
|
|
2271
|
+
secondaryTypographyProps: { color: "text.primary", variant: "caption", fontWeight: "bold" },
|
|
2272
|
+
sx: { flexGrow: 0, flexShrink: 1, marginInlineEnd: 1 }
|
|
2273
|
+
}
|
|
2274
|
+
), (0, import_editor_ui5.getCollapsibleValue)(titleEnd, isOpen)),
|
|
2275
|
+
action?.component,
|
|
2276
|
+
/* @__PURE__ */ React17.createElement(
|
|
2277
|
+
import_editor_ui5.CollapseIcon,
|
|
2278
|
+
{
|
|
2279
|
+
open: isOpen,
|
|
2280
|
+
color: "secondary",
|
|
2281
|
+
fontSize: "tiny",
|
|
2282
|
+
disabled: isDisabled,
|
|
2283
|
+
sx: { ml: 1 }
|
|
2284
|
+
}
|
|
2285
|
+
)
|
|
2286
|
+
), /* @__PURE__ */ React17.createElement(
|
|
2287
|
+
import_ui11.Collapse,
|
|
2288
|
+
{
|
|
2289
|
+
id: contentId,
|
|
2290
|
+
"aria-labelledby": labelId,
|
|
2291
|
+
in: isOpen,
|
|
2292
|
+
timeout: "auto",
|
|
2293
|
+
unmountOnExit
|
|
2294
|
+
},
|
|
2295
|
+
/* @__PURE__ */ React17.createElement(import_editor_ui5.SectionRefContext.Provider, { value: ref }, /* @__PURE__ */ React17.createElement(import_ui11.Stack, { ref, gap: 2.5, p: 2, "aria-label": `${title} section content` }, children))
|
|
2296
|
+
), /* @__PURE__ */ React17.createElement(import_ui11.Divider, null));
|
|
2297
|
+
}
|
|
2298
|
+
|
|
2299
|
+
// src/components/settings-control.tsx
|
|
2300
|
+
var React22 = __toESM(require("react"));
|
|
2301
|
+
var import_editor_controls4 = require("@elementor/editor-controls");
|
|
2302
|
+
var import_ui14 = require("@elementor/ui");
|
|
2303
|
+
|
|
2304
|
+
// src/controls-registry/control.tsx
|
|
2305
|
+
var React18 = __toESM(require("react"));
|
|
2306
|
+
|
|
2307
|
+
// src/controls-registry/controls-registry.tsx
|
|
2308
|
+
var import_editor_controls = require("@elementor/editor-controls");
|
|
2309
|
+
var import_editor_props5 = require("@elementor/editor-props");
|
|
2310
|
+
var queryArrayPropTypeUtil = (0, import_editor_props5.createArrayPropUtils)(import_editor_props5.queryPropTypeUtil.key, import_editor_props5.queryPropTypeUtil.schema);
|
|
2311
|
+
var controlTypes = {
|
|
2312
|
+
image: { component: import_editor_controls.ImageControl, layout: "custom", propTypeUtil: import_editor_props5.imagePropTypeUtil },
|
|
2313
|
+
"svg-media": { component: import_editor_controls.SvgMediaControl, layout: "full", propTypeUtil: import_editor_props5.svgSrcPropTypeUtil },
|
|
2314
|
+
text: { component: import_editor_controls.TextControl, layout: "full", propTypeUtil: import_editor_props5.stringPropTypeUtil },
|
|
2315
|
+
textarea: { component: import_editor_controls.TextAreaControl, layout: "full", propTypeUtil: import_editor_props5.stringPropTypeUtil },
|
|
2316
|
+
size: { component: import_editor_controls.SizeControl, layout: "two-columns", propTypeUtil: import_editor_props5.sizePropTypeUtil },
|
|
2317
|
+
select: { component: import_editor_controls.SelectControlWrapper, layout: "two-columns", propTypeUtil: import_editor_props5.stringPropTypeUtil },
|
|
2318
|
+
chips: { component: import_editor_controls.ChipsControl, layout: "full", propTypeUtil: import_editor_props5.stringArrayPropTypeUtil },
|
|
2319
|
+
link: { component: import_editor_controls.LinkControl, layout: "custom", propTypeUtil: import_editor_props5.linkPropTypeUtil },
|
|
2320
|
+
query: { component: import_editor_controls.QueryControl, layout: "full", propTypeUtil: import_editor_props5.queryPropTypeUtil },
|
|
2321
|
+
"query-chips": { component: import_editor_controls.QueryChipsControl, layout: "full", propTypeUtil: queryArrayPropTypeUtil },
|
|
2322
|
+
"query-filter-repeater": {
|
|
2323
|
+
component: import_editor_controls.QueryFilterRepeaterControl,
|
|
2324
|
+
layout: "full",
|
|
2325
|
+
propTypeUtil: import_editor_props5.queryFilterArrayPropTypeUtil
|
|
2326
|
+
},
|
|
2327
|
+
url: { component: import_editor_controls.UrlControl, layout: "full", propTypeUtil: import_editor_props5.stringPropTypeUtil },
|
|
2328
|
+
switch: { component: import_editor_controls.SwitchControl, layout: "two-columns", propTypeUtil: import_editor_props5.booleanPropTypeUtil },
|
|
2329
|
+
number: { component: import_editor_controls.NumberControl, layout: "two-columns", propTypeUtil: import_editor_props5.numberPropTypeUtil },
|
|
2330
|
+
repeatable: { component: import_editor_controls.RepeatableControl, layout: "full", propTypeUtil: void 0 },
|
|
2331
|
+
"key-value": { component: import_editor_controls.KeyValueControl, layout: "full", propTypeUtil: import_editor_props5.keyValuePropTypeUtil },
|
|
2332
|
+
"html-tag": { component: import_editor_controls.HtmlTagControl, layout: "two-columns", propTypeUtil: import_editor_props5.stringPropTypeUtil },
|
|
2333
|
+
toggle: { component: import_editor_controls.ToggleControl, layout: "full", propTypeUtil: import_editor_props5.stringPropTypeUtil },
|
|
2334
|
+
"date-time": { component: import_editor_controls.DateTimeControl, layout: "full", propTypeUtil: import_editor_props5.DateTimePropTypeUtil },
|
|
2335
|
+
video: { component: import_editor_controls.VideoMediaControl, layout: "full", propTypeUtil: import_editor_props5.videoSrcPropTypeUtil },
|
|
2336
|
+
"inline-editing": { component: import_editor_controls.InlineEditingControl, layout: "full", propTypeUtil: import_editor_props5.htmlV3PropTypeUtil },
|
|
2337
|
+
email: { component: import_editor_controls.EmailFormActionControl, layout: "custom", propTypeUtil: import_editor_props5.emailsPropTypeUtil },
|
|
2338
|
+
"date-range": {
|
|
2339
|
+
component: import_editor_controls.DateRangeControl,
|
|
2340
|
+
layout: "custom",
|
|
2341
|
+
propTypeUtil: import_editor_props5.dateRangePropTypeUtil
|
|
2342
|
+
},
|
|
2343
|
+
"time-range": {
|
|
2344
|
+
component: import_editor_controls.TimeRangeControl,
|
|
2345
|
+
layout: "custom",
|
|
2346
|
+
propTypeUtil: import_editor_props5.timeRangePropTypeUtil
|
|
2347
|
+
},
|
|
2348
|
+
"attachment-type": { component: import_editor_controls.AttachmentTypeControl, layout: "custom", propTypeUtil: import_editor_props5.stringPropTypeUtil }
|
|
2349
|
+
};
|
|
2350
|
+
var ControlsRegistry = class {
|
|
2351
|
+
constructor(controlsRegistry2) {
|
|
2352
|
+
this.controlsRegistry = controlsRegistry2;
|
|
2353
|
+
this.controlsRegistry = controlsRegistry2;
|
|
2354
|
+
}
|
|
2355
|
+
get(type) {
|
|
2356
|
+
return this.controlsRegistry[type]?.component;
|
|
2357
|
+
}
|
|
2358
|
+
getLayout(type) {
|
|
2359
|
+
return this.controlsRegistry[type]?.layout;
|
|
2360
|
+
}
|
|
2361
|
+
getPropTypeUtil(type) {
|
|
2362
|
+
return this.controlsRegistry[type]?.propTypeUtil;
|
|
2363
|
+
}
|
|
2364
|
+
registry() {
|
|
2365
|
+
return this.controlsRegistry;
|
|
2366
|
+
}
|
|
2367
|
+
register(type, component, layout, propTypeUtil) {
|
|
2368
|
+
if (this.controlsRegistry[type]) {
|
|
2369
|
+
throw new ControlTypeAlreadyRegisteredError({ context: { controlType: type } });
|
|
2370
|
+
}
|
|
2371
|
+
this.controlsRegistry[type] = { component, layout, propTypeUtil };
|
|
2372
|
+
}
|
|
2373
|
+
unregister(type) {
|
|
2374
|
+
if (!this.controlsRegistry[type]) {
|
|
2375
|
+
throw new ControlTypeNotRegisteredError({ context: { controlType: type } });
|
|
2376
|
+
}
|
|
2377
|
+
delete this.controlsRegistry[type];
|
|
2378
|
+
}
|
|
2379
|
+
};
|
|
2380
|
+
var controlsRegistry = new ControlsRegistry(controlTypes);
|
|
2381
|
+
|
|
2382
|
+
// src/controls-registry/control.tsx
|
|
2383
|
+
var Control = ({ props, type }) => {
|
|
2384
|
+
const ControlByType = controlsRegistry.get(type);
|
|
2385
|
+
const { element } = useElement();
|
|
2386
|
+
if (!ControlByType) {
|
|
2387
|
+
throw new ControlTypeNotFoundError({
|
|
2388
|
+
context: { controlType: type }
|
|
2389
|
+
});
|
|
2390
|
+
}
|
|
2391
|
+
return /* @__PURE__ */ React18.createElement(ControlByType, { ...props, context: { elementId: element.id } });
|
|
2392
|
+
};
|
|
2393
|
+
|
|
2394
|
+
// src/controls-registry/control-type-container.tsx
|
|
2395
|
+
var React19 = __toESM(require("react"));
|
|
2396
|
+
var import_ui12 = require("@elementor/ui");
|
|
2397
|
+
var ControlTypeContainer = ({ children, layout }) => {
|
|
2398
|
+
if (layout === "custom") {
|
|
2399
|
+
return children;
|
|
2400
|
+
}
|
|
2401
|
+
return /* @__PURE__ */ React19.createElement(StyledContainer, { layout }, children);
|
|
2402
|
+
};
|
|
2403
|
+
var StyledContainer = (0, import_ui12.styled)(import_ui12.Box, {
|
|
2404
|
+
shouldForwardProp: (prop) => !["layout"].includes(prop)
|
|
2405
|
+
})(({ layout, theme }) => ({
|
|
2406
|
+
display: "grid",
|
|
2407
|
+
gridGap: theme.spacing(1),
|
|
2408
|
+
...getGridLayout(layout)
|
|
2409
|
+
}));
|
|
2410
|
+
var getGridLayout = (layout) => ({
|
|
2411
|
+
justifyContent: "space-between",
|
|
2412
|
+
...getStyleByLayout(layout)
|
|
2413
|
+
});
|
|
2414
|
+
var getStyleByLayout = (layout) => {
|
|
2415
|
+
if (layout === "full") {
|
|
2416
|
+
return {
|
|
2417
|
+
gridTemplateColumns: "minmax(0, 1fr)"
|
|
2418
|
+
};
|
|
2419
|
+
}
|
|
2420
|
+
if (layout === "two-columns") {
|
|
2421
|
+
return {
|
|
2422
|
+
alignItems: "center",
|
|
2423
|
+
gridTemplateColumns: "repeat(2, minmax(0, 1fr))"
|
|
2424
|
+
};
|
|
2425
|
+
}
|
|
2426
|
+
};
|
|
2427
|
+
|
|
2428
|
+
// src/controls-registry/settings-field.tsx
|
|
2429
|
+
var React20 = __toESM(require("react"));
|
|
2430
|
+
var import_react19 = require("react");
|
|
2431
|
+
var import_editor_controls2 = require("@elementor/editor-controls");
|
|
2432
|
+
var import_editor_documents2 = require("@elementor/editor-documents");
|
|
2433
|
+
var import_editor_elements6 = require("@elementor/editor-elements");
|
|
2434
|
+
var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
|
|
2435
|
+
var import_i18n8 = require("@wordpress/i18n");
|
|
2436
|
+
|
|
2437
2437
|
// src/controls-registry/create-top-level-object-type.ts
|
|
2438
2438
|
var createTopLevelObjectType = ({ schema }) => {
|
|
2439
2439
|
const schemaPropType = {
|
|
@@ -2577,8 +2577,9 @@ function populateChildControlProps(props) {
|
|
|
2577
2577
|
|
|
2578
2578
|
// src/components/settings-tab.tsx
|
|
2579
2579
|
var SettingsTab = () => {
|
|
2580
|
-
const { elementType, element } = useElement();
|
|
2580
|
+
const { elementType, element, settings } = useElement();
|
|
2581
2581
|
const settingsDefault = useDefaultPanelSettings();
|
|
2582
|
+
const currentSettings = settings;
|
|
2582
2583
|
const isDefaultExpanded = (sectionId) => settingsDefault.defaultSectionsExpanded.settings?.includes(sectionId);
|
|
2583
2584
|
return /* @__PURE__ */ React23.createElement(import_session6.SessionStorageProvider, { prefix: element.id }, /* @__PURE__ */ React23.createElement(SectionsList, null, elementType.controls.map((control, index) => {
|
|
2584
2585
|
if (isControl(control)) {
|
|
@@ -2586,6 +2587,15 @@ var SettingsTab = () => {
|
|
|
2586
2587
|
}
|
|
2587
2588
|
const { type, value } = control;
|
|
2588
2589
|
if (type === "section") {
|
|
2590
|
+
const sectionItems = renderSectionItems({
|
|
2591
|
+
items: value.items,
|
|
2592
|
+
element,
|
|
2593
|
+
propsSchema: elementType.propsSchema,
|
|
2594
|
+
settings: currentSettings
|
|
2595
|
+
});
|
|
2596
|
+
if (!sectionItems.length) {
|
|
2597
|
+
return null;
|
|
2598
|
+
}
|
|
2589
2599
|
return /* @__PURE__ */ React23.createElement(
|
|
2590
2600
|
Section,
|
|
2591
2601
|
{
|
|
@@ -2593,12 +2603,7 @@ var SettingsTab = () => {
|
|
|
2593
2603
|
key: type + "." + index,
|
|
2594
2604
|
defaultExpanded: isDefaultExpanded(value.label)
|
|
2595
2605
|
},
|
|
2596
|
-
|
|
2597
|
-
if (isControl(item)) {
|
|
2598
|
-
return /* @__PURE__ */ React23.createElement(SettingsControl, { key: getKey(item, element), control: item });
|
|
2599
|
-
}
|
|
2600
|
-
return null;
|
|
2601
|
-
})
|
|
2606
|
+
sectionItems
|
|
2602
2607
|
);
|
|
2603
2608
|
}
|
|
2604
2609
|
return null;
|
|
@@ -2613,6 +2618,26 @@ function getKey(control, element) {
|
|
|
2613
2618
|
function isControl(control) {
|
|
2614
2619
|
return control.type === "control" || control.type === "element-control";
|
|
2615
2620
|
}
|
|
2621
|
+
function renderSectionItems({
|
|
2622
|
+
items: items3,
|
|
2623
|
+
element,
|
|
2624
|
+
propsSchema,
|
|
2625
|
+
settings
|
|
2626
|
+
}) {
|
|
2627
|
+
return items3?.flatMap((item) => {
|
|
2628
|
+
if (!isControl(item)) {
|
|
2629
|
+
return [];
|
|
2630
|
+
}
|
|
2631
|
+
if (item.type === "control" && isControlHiddenByDependencies(item, propsSchema, settings)) {
|
|
2632
|
+
return [];
|
|
2633
|
+
}
|
|
2634
|
+
return [/* @__PURE__ */ React23.createElement(SettingsControl, { key: getKey(item, element), control: item })];
|
|
2635
|
+
}) ?? [];
|
|
2636
|
+
}
|
|
2637
|
+
function isControlHiddenByDependencies(control, propsSchema, settings) {
|
|
2638
|
+
const { isHidden } = extractDependencyEffect(control.value.bind, propsSchema, settings);
|
|
2639
|
+
return isHidden;
|
|
2640
|
+
}
|
|
2616
2641
|
|
|
2617
2642
|
// src/components/style-tab.tsx
|
|
2618
2643
|
var React85 = __toESM(require("react"));
|