@elementor/editor-controls 3.32.0-86 → 3.32.0-89
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.d.mts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.js +43 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +43 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +14 -14
- package/src/components/unstable-repeater/header/header.tsx +35 -17
- package/src/control-adornments/control-adornments-context.tsx +2 -1
- package/src/control-adornments/control-adornments.tsx +10 -2
- package/src/controls/transform-control/transform-repeater-control.tsx +9 -4
package/dist/index.d.mts
CHANGED
|
@@ -405,7 +405,12 @@ declare function useFloatingActionsBar(): {
|
|
|
405
405
|
|
|
406
406
|
type ControlAdornmentsItems = Array<{
|
|
407
407
|
id: string;
|
|
408
|
-
Adornment: ComponentType
|
|
408
|
+
Adornment: ComponentType<{
|
|
409
|
+
customContext?: {
|
|
410
|
+
path: string[];
|
|
411
|
+
propType: PropType;
|
|
412
|
+
};
|
|
413
|
+
}>;
|
|
409
414
|
}>;
|
|
410
415
|
type ControlAdornmentsContext = {
|
|
411
416
|
items?: ControlAdornmentsItems;
|
|
@@ -413,7 +418,12 @@ type ControlAdornmentsContext = {
|
|
|
413
418
|
type ControlAdornmentsProviderProps = PropsWithChildren<ControlAdornmentsContext>;
|
|
414
419
|
declare const ControlAdornmentsProvider: ({ children, items }: ControlAdornmentsProviderProps) => React$1.JSX.Element;
|
|
415
420
|
|
|
416
|
-
declare function ControlAdornments(
|
|
421
|
+
declare function ControlAdornments({ customContext, }: {
|
|
422
|
+
customContext?: {
|
|
423
|
+
path: string[];
|
|
424
|
+
propType: PropType;
|
|
425
|
+
};
|
|
426
|
+
}): React$1.JSX.Element | null;
|
|
417
427
|
|
|
418
428
|
declare const injectIntoRepeaterItemIcon: (args: _elementor_locations.ReplaceableInjectArgs<{
|
|
419
429
|
value: PropValue;
|
package/dist/index.d.ts
CHANGED
|
@@ -405,7 +405,12 @@ declare function useFloatingActionsBar(): {
|
|
|
405
405
|
|
|
406
406
|
type ControlAdornmentsItems = Array<{
|
|
407
407
|
id: string;
|
|
408
|
-
Adornment: ComponentType
|
|
408
|
+
Adornment: ComponentType<{
|
|
409
|
+
customContext?: {
|
|
410
|
+
path: string[];
|
|
411
|
+
propType: PropType;
|
|
412
|
+
};
|
|
413
|
+
}>;
|
|
409
414
|
}>;
|
|
410
415
|
type ControlAdornmentsContext = {
|
|
411
416
|
items?: ControlAdornmentsItems;
|
|
@@ -413,7 +418,12 @@ type ControlAdornmentsContext = {
|
|
|
413
418
|
type ControlAdornmentsProviderProps = PropsWithChildren<ControlAdornmentsContext>;
|
|
414
419
|
declare const ControlAdornmentsProvider: ({ children, items }: ControlAdornmentsProviderProps) => React$1.JSX.Element;
|
|
415
420
|
|
|
416
|
-
declare function ControlAdornments(
|
|
421
|
+
declare function ControlAdornments({ customContext, }: {
|
|
422
|
+
customContext?: {
|
|
423
|
+
path: string[];
|
|
424
|
+
propType: PropType;
|
|
425
|
+
};
|
|
426
|
+
}): React$1.JSX.Element | null;
|
|
417
427
|
|
|
418
428
|
declare const injectIntoRepeaterItemIcon: (args: _elementor_locations.ReplaceableInjectArgs<{
|
|
419
429
|
value: PropValue;
|
package/dist/index.js
CHANGED
|
@@ -1384,12 +1384,14 @@ var useControlAdornments = () => {
|
|
|
1384
1384
|
};
|
|
1385
1385
|
|
|
1386
1386
|
// src/control-adornments/control-adornments.tsx
|
|
1387
|
-
function ControlAdornments(
|
|
1387
|
+
function ControlAdornments({
|
|
1388
|
+
customContext
|
|
1389
|
+
}) {
|
|
1388
1390
|
const items2 = useControlAdornments();
|
|
1389
1391
|
if (items2?.length === 0) {
|
|
1390
1392
|
return null;
|
|
1391
1393
|
}
|
|
1392
|
-
return /* @__PURE__ */ React27.createElement(React27.Fragment, null, items2.map(({ Adornment, id }) => /* @__PURE__ */ React27.createElement(Adornment, { key: id })));
|
|
1394
|
+
return /* @__PURE__ */ React27.createElement(React27.Fragment, null, items2.map(({ Adornment, id }) => /* @__PURE__ */ React27.createElement(Adornment, { key: id, customContext })));
|
|
1393
1395
|
}
|
|
1394
1396
|
|
|
1395
1397
|
// src/components/unstable-repeater/locations.ts
|
|
@@ -1400,10 +1402,28 @@ var { Slot: RepeaterHeaderActionsSlot, inject: injectIntoRepeaterHeaderActions }
|
|
|
1400
1402
|
var { Slot: RepeaterItemActionsSlot, inject: injectIntoRepeaterItemActions } = (0, import_locations.createLocation)();
|
|
1401
1403
|
|
|
1402
1404
|
// src/components/unstable-repeater/header/header.tsx
|
|
1403
|
-
var Header = React28.forwardRef(
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1405
|
+
var Header = React28.forwardRef(
|
|
1406
|
+
({
|
|
1407
|
+
label,
|
|
1408
|
+
children,
|
|
1409
|
+
adornment: Adornment = ControlAdornments
|
|
1410
|
+
}, ref) => {
|
|
1411
|
+
const { value } = useBoundProp();
|
|
1412
|
+
return /* @__PURE__ */ React28.createElement(
|
|
1413
|
+
import_ui21.Stack,
|
|
1414
|
+
{
|
|
1415
|
+
direction: "row",
|
|
1416
|
+
alignItems: "center",
|
|
1417
|
+
gap: 1,
|
|
1418
|
+
sx: { marginInlineEnd: -0.75, py: 0.25 },
|
|
1419
|
+
ref
|
|
1420
|
+
},
|
|
1421
|
+
/* @__PURE__ */ React28.createElement(import_ui21.Box, { display: "flex", alignItems: "center", gap: 1, sx: { flexGrow: 1 } }, /* @__PURE__ */ React28.createElement(import_ui21.Typography, { component: "label", variant: "caption", color: "text.secondary", sx: { lineHeight: 1 } }, label), /* @__PURE__ */ React28.createElement(Adornment, null)),
|
|
1422
|
+
/* @__PURE__ */ React28.createElement(RepeaterHeaderActionsSlot, { value }),
|
|
1423
|
+
/* @__PURE__ */ React28.createElement(SlotChildren, { whitelist: [TooltipAddItemAction], sorted: true }, children)
|
|
1424
|
+
);
|
|
1425
|
+
}
|
|
1426
|
+
);
|
|
1407
1427
|
|
|
1408
1428
|
// src/components/unstable-repeater/items/items-container.tsx
|
|
1409
1429
|
var React30 = __toESM(require("react"));
|
|
@@ -4888,7 +4908,7 @@ var TransformRepeaterControl = createControl(() => {
|
|
|
4888
4908
|
component: () => /* @__PURE__ */ React87.createElement(TransformBasePopoverTrigger, { popupState, repeaterBindKey }),
|
|
4889
4909
|
options: { overwrite: true }
|
|
4890
4910
|
});
|
|
4891
|
-
return /* @__PURE__ */ React87.createElement(PropProvider, { ...context }, /* @__PURE__ */ React87.createElement(TransformBaseControl, { popupState, anchorRef: headerRef }), /* @__PURE__ */ React87.createElement(PropKeyProvider, { bind: repeaterBindKey }, /* @__PURE__ */ React87.createElement(Repeater2, { headerRef })));
|
|
4911
|
+
return /* @__PURE__ */ React87.createElement(PropProvider, { ...context }, /* @__PURE__ */ React87.createElement(TransformBaseControl, { popupState, anchorRef: headerRef }), /* @__PURE__ */ React87.createElement(PropKeyProvider, { bind: repeaterBindKey }, /* @__PURE__ */ React87.createElement(Repeater2, { headerRef, propType: context.propType })));
|
|
4892
4912
|
});
|
|
4893
4913
|
var ToolTip = /* @__PURE__ */ React87.createElement(
|
|
4894
4914
|
import_ui75.Box,
|
|
@@ -4900,7 +4920,7 @@ var ToolTip = /* @__PURE__ */ React87.createElement(
|
|
|
4900
4920
|
/* @__PURE__ */ React87.createElement(import_icons29.InfoCircleFilledIcon, { sx: { color: "secondary.main" } }),
|
|
4901
4921
|
/* @__PURE__ */ React87.createElement(import_ui75.Typography, { variant: "body2", color: "text.secondary", fontSize: "14px" }, (0, import_i18n43.__)("You can use each kind of transform only once per element.", "elementor"))
|
|
4902
4922
|
);
|
|
4903
|
-
var Repeater2 = ({ headerRef }) => {
|
|
4923
|
+
var Repeater2 = ({ headerRef, propType }) => {
|
|
4904
4924
|
const transformFunctionsContext = useBoundProp(import_editor_props44.transformFunctionsPropTypeUtil);
|
|
4905
4925
|
const availableValues = [initialTransformValue, initialScaleValue, initialRotateValue, initialSkewValue];
|
|
4906
4926
|
const { value: transformValues } = transformFunctionsContext;
|
|
@@ -4914,14 +4934,22 @@ var Repeater2 = ({ headerRef }) => {
|
|
|
4914
4934
|
initial: getInitialValue() ?? initialTransformValue,
|
|
4915
4935
|
propTypeUtil: import_editor_props44.transformFunctionsPropTypeUtil
|
|
4916
4936
|
},
|
|
4917
|
-
/* @__PURE__ */ React87.createElement(
|
|
4918
|
-
|
|
4937
|
+
/* @__PURE__ */ React87.createElement(
|
|
4938
|
+
Header,
|
|
4919
4939
|
{
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
}
|
|
4924
|
-
|
|
4940
|
+
label: (0, import_i18n43.__)("Transform", "elementor"),
|
|
4941
|
+
adornment: () => /* @__PURE__ */ React87.createElement(ControlAdornments, { customContext: { path: ["transform"], propType } }),
|
|
4942
|
+
ref: headerRef
|
|
4943
|
+
},
|
|
4944
|
+
/* @__PURE__ */ React87.createElement(
|
|
4945
|
+
TooltipAddItemAction,
|
|
4946
|
+
{
|
|
4947
|
+
disabled: shouldDisableAddItem,
|
|
4948
|
+
tooltipContent: ToolTip,
|
|
4949
|
+
enableTooltip: shouldDisableAddItem
|
|
4950
|
+
}
|
|
4951
|
+
)
|
|
4952
|
+
),
|
|
4925
4953
|
/* @__PURE__ */ React87.createElement(ItemsContainer, { itemTemplate: /* @__PURE__ */ React87.createElement(Item, { Icon: TransformIcon, Label: TransformLabel }) }, /* @__PURE__ */ React87.createElement(DisableItemAction, null), /* @__PURE__ */ React87.createElement(RemoveItemAction, null)),
|
|
4926
4954
|
/* @__PURE__ */ React87.createElement(EditItemPopover, null, /* @__PURE__ */ React87.createElement(TransformContent, null))
|
|
4927
4955
|
));
|