@elementor/editor-controls 0.29.0 → 0.30.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 +12 -0
- package/dist/index.d.mts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
- package/src/components/repeater.tsx +11 -2
- package/src/controls/box-shadow-repeater-control.tsx +1 -1
- package/src/index.ts +2 -0
- package/src/locations.ts +11 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @elementor/editor-controls
|
|
2
2
|
|
|
3
|
+
## 0.30.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- be87c6e: null-check was missing, causing possible crash in the box-shadow control
|
|
8
|
+
- d05046f: Add replaceable location
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies [d05046f]
|
|
13
|
+
- @elementor/locations@0.8.0
|
|
14
|
+
|
|
3
15
|
## 0.29.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { ReactNode, ComponentType, PropsWithChildren } from 'react';
|
|
3
3
|
import { StringPropValue, PropTypeUtil, PropValue, PropKey, SizePropValue, PropType, CreateOptions } from '@elementor/editor-props';
|
|
4
4
|
import { UnstableColorFieldProps, ToggleButtonProps, StackProps } from '@elementor/ui';
|
|
5
|
+
import * as _elementor_locations from '@elementor/locations';
|
|
5
6
|
|
|
6
7
|
type ImageControlProps = {
|
|
7
8
|
sizes: {
|
|
@@ -246,6 +247,13 @@ declare const ControlAdornmentsProvider: ({ children, items }: ControlAdornments
|
|
|
246
247
|
|
|
247
248
|
declare function ControlAdornments(): React.JSX.Element | null;
|
|
248
249
|
|
|
250
|
+
declare const injectIntoRepeaterItemIcon: (args: _elementor_locations.ReplaceableInjectArgs<{
|
|
251
|
+
value: PropValue;
|
|
252
|
+
}>) => void;
|
|
253
|
+
declare const injectIntoRepeaterItemLabel: (args: _elementor_locations.ReplaceableInjectArgs<{
|
|
254
|
+
value: PropValue;
|
|
255
|
+
}>) => void;
|
|
256
|
+
|
|
249
257
|
type UseInternalStateOptions<TValue> = {
|
|
250
258
|
external: TValue | null;
|
|
251
259
|
setExternal: (value: TValue | null) => void;
|
|
@@ -254,4 +262,4 @@ type UseInternalStateOptions<TValue> = {
|
|
|
254
262
|
};
|
|
255
263
|
declare const useSyncExternalState: <TValue>({ external, setExternal, persistWhen, fallback, }: UseInternalStateOptions<TValue>) => readonly [TValue, (setter: ((value: TValue) => TValue) | TValue) => void];
|
|
256
264
|
|
|
257
|
-
export { BackgroundControl, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent, ControlFormLabel, ControlReplacementsProvider, ControlToggleButtonGroup, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedValue, type FontCategory, FontFamilyControl, GapControl, ImageControl, LinkControl, LinkedDimensionsControl, NumberControl, PropKeyProvider, PropProvider, type PropProviderProps, SelectControl, type SetValue, SizeControl, StrokeControl, SvgMediaControl, TextAreaControl, TextControl, type ToggleButtonGroupItem, ToggleControl, type ToggleControlProps, UrlControl, createControlReplacementsRegistry, useBoundProp, useControlActions, useSyncExternalState };
|
|
265
|
+
export { BackgroundControl, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent, ControlFormLabel, ControlReplacementsProvider, ControlToggleButtonGroup, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedValue, type FontCategory, FontFamilyControl, GapControl, ImageControl, LinkControl, LinkedDimensionsControl, NumberControl, PropKeyProvider, PropProvider, type PropProviderProps, SelectControl, type SetValue, SizeControl, StrokeControl, SvgMediaControl, TextAreaControl, TextControl, type ToggleButtonGroupItem, ToggleControl, type ToggleControlProps, UrlControl, createControlReplacementsRegistry, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, useBoundProp, useControlActions, useSyncExternalState };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { ReactNode, ComponentType, PropsWithChildren } from 'react';
|
|
3
3
|
import { StringPropValue, PropTypeUtil, PropValue, PropKey, SizePropValue, PropType, CreateOptions } from '@elementor/editor-props';
|
|
4
4
|
import { UnstableColorFieldProps, ToggleButtonProps, StackProps } from '@elementor/ui';
|
|
5
|
+
import * as _elementor_locations from '@elementor/locations';
|
|
5
6
|
|
|
6
7
|
type ImageControlProps = {
|
|
7
8
|
sizes: {
|
|
@@ -246,6 +247,13 @@ declare const ControlAdornmentsProvider: ({ children, items }: ControlAdornments
|
|
|
246
247
|
|
|
247
248
|
declare function ControlAdornments(): React.JSX.Element | null;
|
|
248
249
|
|
|
250
|
+
declare const injectIntoRepeaterItemIcon: (args: _elementor_locations.ReplaceableInjectArgs<{
|
|
251
|
+
value: PropValue;
|
|
252
|
+
}>) => void;
|
|
253
|
+
declare const injectIntoRepeaterItemLabel: (args: _elementor_locations.ReplaceableInjectArgs<{
|
|
254
|
+
value: PropValue;
|
|
255
|
+
}>) => void;
|
|
256
|
+
|
|
249
257
|
type UseInternalStateOptions<TValue> = {
|
|
250
258
|
external: TValue | null;
|
|
251
259
|
setExternal: (value: TValue | null) => void;
|
|
@@ -254,4 +262,4 @@ type UseInternalStateOptions<TValue> = {
|
|
|
254
262
|
};
|
|
255
263
|
declare const useSyncExternalState: <TValue>({ external, setExternal, persistWhen, fallback, }: UseInternalStateOptions<TValue>) => readonly [TValue, (setter: ((value: TValue) => TValue) | TValue) => void];
|
|
256
264
|
|
|
257
|
-
export { BackgroundControl, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent, ControlFormLabel, ControlReplacementsProvider, ControlToggleButtonGroup, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedValue, type FontCategory, FontFamilyControl, GapControl, ImageControl, LinkControl, LinkedDimensionsControl, NumberControl, PropKeyProvider, PropProvider, type PropProviderProps, SelectControl, type SetValue, SizeControl, StrokeControl, SvgMediaControl, TextAreaControl, TextControl, type ToggleButtonGroupItem, ToggleControl, type ToggleControlProps, UrlControl, createControlReplacementsRegistry, useBoundProp, useControlActions, useSyncExternalState };
|
|
265
|
+
export { BackgroundControl, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent, ControlFormLabel, ControlReplacementsProvider, ControlToggleButtonGroup, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedValue, type FontCategory, FontFamilyControl, GapControl, ImageControl, LinkControl, LinkedDimensionsControl, NumberControl, PropKeyProvider, PropProvider, type PropProviderProps, SelectControl, type SetValue, SizeControl, StrokeControl, SvgMediaControl, TextAreaControl, TextControl, type ToggleButtonGroupItem, ToggleControl, type ToggleControlProps, UrlControl, createControlReplacementsRegistry, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, useBoundProp, useControlActions, useSyncExternalState };
|
package/dist/index.js
CHANGED
|
@@ -57,6 +57,8 @@ __export(index_exports, {
|
|
|
57
57
|
ToggleControl: () => ToggleControl,
|
|
58
58
|
UrlControl: () => UrlControl,
|
|
59
59
|
createControlReplacementsRegistry: () => createControlReplacementsRegistry,
|
|
60
|
+
injectIntoRepeaterItemIcon: () => injectIntoRepeaterItemIcon,
|
|
61
|
+
injectIntoRepeaterItemLabel: () => injectIntoRepeaterItemLabel,
|
|
60
62
|
useBoundProp: () => useBoundProp,
|
|
61
63
|
useControlActions: () => useControlActions,
|
|
62
64
|
useSyncExternalState: () => useSyncExternalState
|
|
@@ -777,6 +779,11 @@ function ControlAdornments() {
|
|
|
777
779
|
return /* @__PURE__ */ React21.createElement(React21.Fragment, null, items.map(({ Adornment, id }) => /* @__PURE__ */ React21.createElement(Adornment, { key: id })));
|
|
778
780
|
}
|
|
779
781
|
|
|
782
|
+
// src/locations.ts
|
|
783
|
+
var import_locations = require("@elementor/locations");
|
|
784
|
+
var { Slot: RepeaterItemIconSlot, inject: injectIntoRepeaterItemIcon } = (0, import_locations.createReplaceableLocation)();
|
|
785
|
+
var { Slot: RepeaterItemLabelSlot, inject: injectIntoRepeaterItemLabel } = (0, import_locations.createReplaceableLocation)();
|
|
786
|
+
|
|
780
787
|
// src/components/sortable.tsx
|
|
781
788
|
var React22 = __toESM(require("react"));
|
|
782
789
|
var import_icons2 = require("@elementor/icons");
|
|
@@ -954,8 +961,8 @@ var Repeater = ({
|
|
|
954
961
|
RepeaterItem,
|
|
955
962
|
{
|
|
956
963
|
disabled: value?.disabled,
|
|
957
|
-
label: /* @__PURE__ */ React23.createElement(itemSettings.Label, { value }),
|
|
958
|
-
startIcon: /* @__PURE__ */ React23.createElement(itemSettings.Icon, { value }),
|
|
964
|
+
label: /* @__PURE__ */ React23.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React23.createElement(itemSettings.Label, { value })),
|
|
965
|
+
startIcon: /* @__PURE__ */ React23.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React23.createElement(itemSettings.Icon, { value })),
|
|
959
966
|
removeItem: () => removeRepeaterItem(index),
|
|
960
967
|
duplicateItem: () => duplicateRepeaterItem(index),
|
|
961
968
|
toggleDisableItem: () => toggleDisableRepeaterItem(index),
|
|
@@ -1049,7 +1056,7 @@ var BoxShadowRepeaterControl = createControl(() => {
|
|
|
1049
1056
|
}
|
|
1050
1057
|
));
|
|
1051
1058
|
});
|
|
1052
|
-
var ItemIcon = ({ value }) => /* @__PURE__ */ React24.createElement(import_ui18.UnstableColorIndicator, { size: "inherit", component: "span", value: value.value.color
|
|
1059
|
+
var ItemIcon = ({ value }) => /* @__PURE__ */ React24.createElement(import_ui18.UnstableColorIndicator, { size: "inherit", component: "span", value: value.value.color?.value });
|
|
1053
1060
|
var ItemContent = ({ anchorEl, bind }) => {
|
|
1054
1061
|
return /* @__PURE__ */ React24.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React24.createElement(Content, { anchorEl }));
|
|
1055
1062
|
};
|
|
@@ -2920,6 +2927,8 @@ var BackgroundControl = createControl(() => {
|
|
|
2920
2927
|
ToggleControl,
|
|
2921
2928
|
UrlControl,
|
|
2922
2929
|
createControlReplacementsRegistry,
|
|
2930
|
+
injectIntoRepeaterItemIcon,
|
|
2931
|
+
injectIntoRepeaterItemLabel,
|
|
2923
2932
|
useBoundProp,
|
|
2924
2933
|
useControlActions,
|
|
2925
2934
|
useSyncExternalState
|