@elementor/editor-controls 0.17.0 → 0.18.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 +11 -0
- package/dist/index.d.mts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/control-adornments/control-adornments-context.tsx +25 -0
- package/src/control-adornments/control-adornments.tsx +19 -0
- package/src/control-adornments/control-label-with-adornments.tsx +15 -0
- package/src/index.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @elementor/editor-controls
|
|
2
2
|
|
|
3
|
+
## 0.18.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 217d896: Add indicators to control labels to reflect the style inheritance.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [14610ee]
|
|
12
|
+
- @elementor/editor-elements@0.6.4
|
|
13
|
+
|
|
3
14
|
## 0.17.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -224,6 +224,18 @@ declare const createControlReplacement: () => {
|
|
|
224
224
|
getControlReplacement: () => CreateControlReplacement;
|
|
225
225
|
};
|
|
226
226
|
|
|
227
|
+
type ControlAdornmentsItems = Array<{
|
|
228
|
+
id: string;
|
|
229
|
+
Adornment: ComponentType;
|
|
230
|
+
}>;
|
|
231
|
+
type ControlAdornmentsContext = {
|
|
232
|
+
items?: ControlAdornmentsItems;
|
|
233
|
+
};
|
|
234
|
+
type ControlAdornmentsProviderProps = PropsWithChildren<ControlAdornmentsContext>;
|
|
235
|
+
declare const ControlAdornmentsProvider: ({ children, items }: ControlAdornmentsProviderProps) => React.JSX.Element;
|
|
236
|
+
|
|
237
|
+
declare function ControlAdornments(): React.JSX.Element | null;
|
|
238
|
+
|
|
227
239
|
type UseInternalStateOptions<TValue> = {
|
|
228
240
|
external: TValue | null;
|
|
229
241
|
setExternal: (value: TValue | null) => void;
|
|
@@ -232,4 +244,4 @@ type UseInternalStateOptions<TValue> = {
|
|
|
232
244
|
};
|
|
233
245
|
declare const useSyncExternalState: <TValue>({ external, setExternal, persistWhen, fallback, }: UseInternalStateOptions<TValue>) => readonly [TValue, (setter: ((value: TValue) => TValue) | TValue) => void];
|
|
234
246
|
|
|
235
|
-
export { BackgroundControl, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, type ControlComponent, ControlLabel, ControlReplacementProvider, 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, createControlReplacement, useBoundProp, useControlActions, useSyncExternalState };
|
|
247
|
+
export { BackgroundControl, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent, ControlLabel, ControlReplacementProvider, 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, createControlReplacement, useBoundProp, useControlActions, useSyncExternalState };
|
package/dist/index.d.ts
CHANGED
|
@@ -224,6 +224,18 @@ declare const createControlReplacement: () => {
|
|
|
224
224
|
getControlReplacement: () => CreateControlReplacement;
|
|
225
225
|
};
|
|
226
226
|
|
|
227
|
+
type ControlAdornmentsItems = Array<{
|
|
228
|
+
id: string;
|
|
229
|
+
Adornment: ComponentType;
|
|
230
|
+
}>;
|
|
231
|
+
type ControlAdornmentsContext = {
|
|
232
|
+
items?: ControlAdornmentsItems;
|
|
233
|
+
};
|
|
234
|
+
type ControlAdornmentsProviderProps = PropsWithChildren<ControlAdornmentsContext>;
|
|
235
|
+
declare const ControlAdornmentsProvider: ({ children, items }: ControlAdornmentsProviderProps) => React.JSX.Element;
|
|
236
|
+
|
|
237
|
+
declare function ControlAdornments(): React.JSX.Element | null;
|
|
238
|
+
|
|
227
239
|
type UseInternalStateOptions<TValue> = {
|
|
228
240
|
external: TValue | null;
|
|
229
241
|
setExternal: (value: TValue | null) => void;
|
|
@@ -232,4 +244,4 @@ type UseInternalStateOptions<TValue> = {
|
|
|
232
244
|
};
|
|
233
245
|
declare const useSyncExternalState: <TValue>({ external, setExternal, persistWhen, fallback, }: UseInternalStateOptions<TValue>) => readonly [TValue, (setter: ((value: TValue) => TValue) | TValue) => void];
|
|
234
246
|
|
|
235
|
-
export { BackgroundControl, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, type ControlComponent, ControlLabel, ControlReplacementProvider, 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, createControlReplacement, useBoundProp, useControlActions, useSyncExternalState };
|
|
247
|
+
export { BackgroundControl, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent, ControlLabel, ControlReplacementProvider, 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, createControlReplacement, useBoundProp, useControlActions, useSyncExternalState };
|
package/dist/index.js
CHANGED
|
@@ -34,6 +34,8 @@ __export(index_exports, {
|
|
|
34
34
|
BoxShadowRepeaterControl: () => BoxShadowRepeaterControl,
|
|
35
35
|
ColorControl: () => ColorControl,
|
|
36
36
|
ControlActionsProvider: () => ControlActionsProvider,
|
|
37
|
+
ControlAdornments: () => ControlAdornments,
|
|
38
|
+
ControlAdornmentsProvider: () => ControlAdornmentsProvider,
|
|
37
39
|
ControlLabel: () => ControlLabel,
|
|
38
40
|
ControlReplacementProvider: () => ControlReplacementProvider,
|
|
39
41
|
ControlToggleButtonGroup: () => ControlToggleButtonGroup,
|
|
@@ -2596,12 +2598,34 @@ var BackgroundControl = createControl(() => {
|
|
|
2596
2598
|
const propContext = useBoundProp(import_editor_props24.backgroundPropTypeUtil);
|
|
2597
2599
|
return /* @__PURE__ */ React41.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React41.createElement(SectionContent, null, /* @__PURE__ */ React41.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React41.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React41.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React41.createElement(import_ui37.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React41.createElement(import_ui37.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(ControlLabel, null, (0, import_i18n18.__)("Color", "elementor"))), /* @__PURE__ */ React41.createElement(import_ui37.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(ColorControl, null))))));
|
|
2598
2600
|
});
|
|
2601
|
+
|
|
2602
|
+
// src/control-adornments/control-adornments-context.tsx
|
|
2603
|
+
var React42 = __toESM(require("react"));
|
|
2604
|
+
var import_react15 = require("react");
|
|
2605
|
+
var Context2 = (0, import_react15.createContext)(null);
|
|
2606
|
+
var ControlAdornmentsProvider = ({ children, items }) => /* @__PURE__ */ React42.createElement(Context2.Provider, { value: { items } }, children);
|
|
2607
|
+
var useControlAdornments = () => {
|
|
2608
|
+
const context = (0, import_react15.useContext)(Context2);
|
|
2609
|
+
return context?.items ?? [];
|
|
2610
|
+
};
|
|
2611
|
+
|
|
2612
|
+
// src/control-adornments/control-adornments.tsx
|
|
2613
|
+
var React43 = __toESM(require("react"));
|
|
2614
|
+
function ControlAdornments() {
|
|
2615
|
+
const items = useControlAdornments();
|
|
2616
|
+
if (items?.length === 0) {
|
|
2617
|
+
return null;
|
|
2618
|
+
}
|
|
2619
|
+
return /* @__PURE__ */ React43.createElement(React43.Fragment, null, items.map(({ Adornment, id }) => /* @__PURE__ */ React43.createElement(Adornment, { key: id })));
|
|
2620
|
+
}
|
|
2599
2621
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2600
2622
|
0 && (module.exports = {
|
|
2601
2623
|
BackgroundControl,
|
|
2602
2624
|
BoxShadowRepeaterControl,
|
|
2603
2625
|
ColorControl,
|
|
2604
2626
|
ControlActionsProvider,
|
|
2627
|
+
ControlAdornments,
|
|
2628
|
+
ControlAdornmentsProvider,
|
|
2605
2629
|
ControlLabel,
|
|
2606
2630
|
ControlReplacementProvider,
|
|
2607
2631
|
ControlToggleButtonGroup,
|