@elementor/editor-editing-panel 0.14.1 → 0.15.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/index.d.mts +29 -1
  3. package/dist/index.d.ts +29 -1
  4. package/dist/index.js +329 -265
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +311 -261
  7. package/dist/index.mjs.map +1 -1
  8. package/package.json +4 -4
  9. package/src/components/{collapsible-section.tsx → collapsible-content.tsx} +2 -2
  10. package/src/components/editing-panel.tsx +1 -1
  11. package/src/components/settings-tab.tsx +6 -17
  12. package/src/components/style-sections/size-section.tsx +8 -9
  13. package/src/components/style-sections/typography-section/font-size-control.tsx +16 -0
  14. package/src/components/style-sections/typography-section/font-weight-control.tsx +24 -0
  15. package/src/{controls/control-types → components/style-sections/typography-section}/text-style-control.tsx +16 -14
  16. package/src/components/style-sections/typography-section/typography-section.tsx +20 -0
  17. package/src/components/style-tab.tsx +1 -1
  18. package/src/contexts/element-context.tsx +5 -3
  19. package/src/controls/components/control-container.tsx +18 -0
  20. package/src/controls/control-replacement.ts +26 -0
  21. package/src/controls/control-types/image-control.tsx +3 -18
  22. package/src/controls/control-types/size-control.tsx +4 -2
  23. package/src/controls/control-types/text-area-control.tsx +1 -1
  24. package/src/controls/control.tsx +50 -0
  25. package/src/controls/{get-control-by-type.ts → controls-registry.tsx} +13 -9
  26. package/src/controls/settings-control.tsx +8 -21
  27. package/src/hooks/use-dynamic-tags-config.ts +35 -0
  28. package/src/hooks/use-element-type.ts +5 -0
  29. package/src/index.ts +3 -0
  30. package/src/sync/get-atomic-dynamic-tags.ts +14 -0
  31. package/src/sync/get-elementor-config.ts +7 -0
  32. package/src/sync/types.ts +15 -1
  33. package/src/types.ts +14 -0
  34. package/LICENSE +0 -674
  35. package/src/components/style-sections/typography-section.tsx +0 -15
package/CHANGELOG.md CHANGED
@@ -1,8 +1,30 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - c67ae92: Add control component
8
+ - c9c430d: Create hook for supported dynamic categories
9
+ - 68acbed: Add font size control, separate customs from generic controls
10
+ - 4929220: Refactor - move `elementType` into `ElementContext`
11
+ - c3a53d7: Add icons to `TextStyleControl`
12
+ - 730ef85: Add `getDynamicTagsByCategories` function
13
+ - ed21ec8: Create a font weight control in the editor panel
14
+ - 4c6e274: Add support for default values from the widget schema
15
+
16
+ ### Patch Changes
17
+
18
+ - 44d49dd: Update `@elementor/ui` version
19
+ - ad3cd19: Fix settings control layout when there is no label
20
+
3
21
  All notable changes to this project will be documented in this file.
4
22
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
23
 
24
+ ## [0.14.2](https://github.com/elementor/elementor-packages/compare/@elementor/editor-editing-panel@0.14.1...@elementor/editor-editing-panel@0.14.2) (2024-08-25)
25
+
26
+ **Note:** Version bump only for package @elementor/editor-editing-panel
27
+
6
28
  ## [0.14.1](https://github.com/elementor/elementor-packages/compare/@elementor/editor-editing-panel@0.14.0...@elementor/editor-editing-panel@0.14.1) (2024-08-25)
7
29
 
8
30
  **Note:** Version bump only for package @elementor/editor-editing-panel
package/dist/index.d.mts CHANGED
@@ -1,2 +1,30 @@
1
+ import * as react from 'react';
1
2
 
2
- export { }
3
+ type MaybeArray<T> = T | T[];
4
+ type TransformablePropValue<T = unknown> = {
5
+ $$type: string;
6
+ value: T;
7
+ };
8
+ type PlainPropValue = MaybeArray<string | number | boolean | object | null | undefined>;
9
+ type PropValue = PlainPropValue | TransformablePropValue;
10
+ type PropKey = string;
11
+
12
+ type ReplaceWhenParams = {
13
+ value: PropValue;
14
+ };
15
+ type ControlReplacement = {
16
+ component: React.ComponentType;
17
+ condition: ({ value }: ReplaceWhenParams) => boolean;
18
+ };
19
+ declare const replaceControl: ({ component, condition }: ControlReplacement) => void;
20
+
21
+ type ControlContext<T extends PropValue> = {
22
+ bind: PropKey;
23
+ setValue: (value: T | undefined) => void;
24
+ value: T | undefined;
25
+ };
26
+ declare const ControlContext: react.Context<ControlContext<PropValue> | null>;
27
+ declare function useControl<T extends PropValue>(): ControlContext<T | undefined>;
28
+ declare function useControl<T extends PropValue>(defaultValue: T): ControlContext<T>;
29
+
30
+ export { replaceControl, useControl };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,30 @@
1
+ import * as react from 'react';
1
2
 
2
- export { }
3
+ type MaybeArray<T> = T | T[];
4
+ type TransformablePropValue<T = unknown> = {
5
+ $$type: string;
6
+ value: T;
7
+ };
8
+ type PlainPropValue = MaybeArray<string | number | boolean | object | null | undefined>;
9
+ type PropValue = PlainPropValue | TransformablePropValue;
10
+ type PropKey = string;
11
+
12
+ type ReplaceWhenParams = {
13
+ value: PropValue;
14
+ };
15
+ type ControlReplacement = {
16
+ component: React.ComponentType;
17
+ condition: ({ value }: ReplaceWhenParams) => boolean;
18
+ };
19
+ declare const replaceControl: ({ component, condition }: ControlReplacement) => void;
20
+
21
+ type ControlContext<T extends PropValue> = {
22
+ bind: PropKey;
23
+ setValue: (value: T | undefined) => void;
24
+ value: T | undefined;
25
+ };
26
+ declare const ControlContext: react.Context<ControlContext<PropValue> | null>;
27
+ declare function useControl<T extends PropValue>(): ControlContext<T | undefined>;
28
+ declare function useControl<T extends PropValue>(defaultValue: T): ControlContext<T>;
29
+
30
+ export { replaceControl, useControl };