@elementor/editor-editing-panel 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.
Files changed (55) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/index.d.mts +26 -9
  3. package/dist/index.d.ts +26 -9
  4. package/dist/index.js +859 -367
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +830 -329
  7. package/dist/index.mjs.map +1 -1
  8. package/package.json +8 -7
  9. package/src/components/settings-tab.tsx +5 -2
  10. package/src/components/style-sections/effects-section/box-shadow-repeater.tsx +224 -0
  11. package/src/components/style-sections/effects-section/effects-section.tsx +18 -0
  12. package/src/components/style-sections/position-section/z-index-control.tsx +11 -7
  13. package/src/components/style-sections/size-section.tsx +23 -20
  14. package/src/components/style-sections/spacing-section/linked-dimensions-control.tsx +62 -47
  15. package/src/components/style-sections/typography-section/font-size-control.tsx +10 -6
  16. package/src/components/style-sections/typography-section/font-weight-control.tsx +16 -12
  17. package/src/components/style-sections/typography-section/letter-spacing-control.tsx +10 -6
  18. package/src/components/style-sections/typography-section/text-alignment-control.tsx +12 -8
  19. package/src/components/style-sections/typography-section/text-color-control.tsx +10 -6
  20. package/src/components/style-sections/typography-section/text-direction-control.tsx +37 -0
  21. package/src/components/style-sections/typography-section/text-style-control.tsx +37 -34
  22. package/src/components/style-sections/typography-section/transform-control.tsx +14 -12
  23. package/src/components/style-sections/typography-section/typography-section.tsx +2 -0
  24. package/src/components/style-sections/typography-section/word-spacing-control.tsx +10 -6
  25. package/src/components/style-tab.tsx +5 -1
  26. package/src/controls/components/control-type-container.tsx +28 -0
  27. package/src/controls/components/repeater.tsx +197 -0
  28. package/src/controls/control-actions/actions/popover-action.tsx +58 -0
  29. package/src/controls/control-actions/control-actions-menu.ts +8 -0
  30. package/src/controls/control-actions/control-actions.tsx +43 -0
  31. package/src/controls/control-replacement.ts +15 -7
  32. package/src/controls/control-types/color-control.tsx +21 -18
  33. package/src/controls/control-types/image-control.tsx +56 -59
  34. package/src/controls/control-types/image-media-control.tsx +73 -0
  35. package/src/controls/control-types/number-control.tsx +13 -9
  36. package/src/controls/control-types/select-control.tsx +13 -9
  37. package/src/controls/control-types/size-control.tsx +17 -13
  38. package/src/controls/control-types/text-area-control.tsx +15 -11
  39. package/src/controls/control-types/text-control.tsx +9 -3
  40. package/src/controls/control-types/toggle-control.tsx +3 -2
  41. package/src/controls/control.tsx +1 -7
  42. package/src/controls/controls-registry.tsx +19 -10
  43. package/src/controls/create-control.tsx +31 -0
  44. package/src/controls/settings-control.tsx +2 -9
  45. package/src/dynamics/components/dynamic-selection-control.tsx +1 -1
  46. package/src/dynamics/components/dynamic-selection.tsx +1 -1
  47. package/src/dynamics/dynamic-control.tsx +1 -1
  48. package/src/dynamics/hooks/use-prop-dynamic-action.tsx +23 -0
  49. package/src/dynamics/hooks/use-prop-dynamic-tags.ts +4 -4
  50. package/src/dynamics/init.ts +9 -0
  51. package/src/dynamics/types.ts +6 -3
  52. package/src/dynamics/utils.ts +16 -3
  53. package/src/index.ts +2 -0
  54. package/src/types.ts +35 -14
  55. package/src/controls/components/control-container.tsx +0 -18
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.18.0
4
+
5
+ ### Minor Changes
6
+
7
+ - c1f4bcb: Added `TextDirectionControl`
8
+ - 1206fbd: Added support for inner props in `ImageControl`
9
+ - 8bbc145: Update `@elementor/icons` version
10
+ - b7dca9f: Update `@elementor/icons` version
11
+ - aa24b6f: Render settings control layout by type
12
+ - 701fc35: Updated color picker version
13
+ - 4d27f27: Added controls repeater, and box shadow control.
14
+ - 9a77872: adding control floating bar
15
+ - 28620a5: added registration of dynamic tag item to control actions
16
+ - d1b6297: Use Grid components to render style controls layout.
17
+
18
+ ### Patch Changes
19
+
20
+ - 97e6534: Changed bind name format and added color prop type
21
+ - 68e3a30: apply control replacement on the control component
22
+
23
+ create a function to wrap each control to allow general solutions for each control
24
+
25
+ - 20e9aeb: Adjusting `prop-types` to fit the new structure
26
+ - 8a50411: change linked dimensions control default value
27
+ - Updated dependencies [1206fbd]
28
+ - Updated dependencies [97e6534]
29
+ - Updated dependencies [701fc35]
30
+ - @elementor/wp-media@0.2.0
31
+ - @elementor/editor-style@0.4.1
32
+ - @elementor/editor-panels@0.8.0
33
+ - @elementor/editor@0.15.0
34
+
3
35
  ## 0.17.0
4
36
 
5
37
  ### Minor Changes
package/dist/index.d.mts CHANGED
@@ -1,30 +1,47 @@
1
- import * as react from 'react';
1
+ import * as React from 'react';
2
+ import { ElementType, ComponentType } from 'react';
3
+ import * as _elementor_menus from '@elementor/menus';
4
+
5
+ type PopoverActionProps = {
6
+ title: string;
7
+ visible?: boolean;
8
+ icon: ElementType;
9
+ popoverContent: ComponentType<{
10
+ closePopover: () => void;
11
+ }>;
12
+ };
13
+ declare function PopoverAction({ title, visible, icon: Icon, popoverContent: PopoverContent, }: PopoverActionProps): React.JSX.Element | null;
2
14
 
3
15
  type MaybeArray<T> = T | T[];
4
- type TransformablePropValue<T = unknown> = {
5
- $$type: string;
6
- value: T;
16
+ type TransformablePropValue<Type extends string, Value = unknown> = {
17
+ $$type: Type;
18
+ value: Value;
19
+ disabled?: boolean;
7
20
  };
8
21
  type PlainPropValue = MaybeArray<string | number | boolean | object | null | undefined>;
9
- type PropValue = PlainPropValue | TransformablePropValue;
22
+ type PropValue = PlainPropValue | TransformablePropValue<string>;
10
23
  type PropKey = string;
11
24
 
12
25
  type ReplaceWhenParams = {
13
26
  value: PropValue;
14
27
  };
15
28
  type ControlReplacement = {
16
- component: React.ComponentType;
29
+ component: ComponentType;
17
30
  condition: ({ value }: ReplaceWhenParams) => boolean;
18
31
  };
19
- declare const replaceControl: ({ component, condition }: ControlReplacement) => void;
32
+ declare function replaceControl({ component, condition }: ControlReplacement): void;
20
33
 
21
34
  type ControlContext<T extends PropValue> = {
22
35
  bind: PropKey;
23
36
  setValue: (value: T | undefined) => void;
24
37
  value: T | undefined;
25
38
  };
26
- declare const ControlContext: react.Context<ControlContext<PropValue> | null>;
39
+ declare const ControlContext: React.Context<ControlContext<PropValue> | null>;
27
40
  declare function useControl<T extends PropValue>(): ControlContext<T | undefined>;
28
41
  declare function useControl<T extends PropValue>(defaultValue: T): ControlContext<T>;
29
42
 
30
- export { replaceControl, useControl };
43
+ declare const controlActionsMenu: _elementor_menus.Menu<{
44
+ PopoverAction: typeof PopoverAction;
45
+ }, "default">;
46
+
47
+ export { type PopoverActionProps, controlActionsMenu, replaceControl, useControl };
package/dist/index.d.ts CHANGED
@@ -1,30 +1,47 @@
1
- import * as react from 'react';
1
+ import * as React from 'react';
2
+ import { ElementType, ComponentType } from 'react';
3
+ import * as _elementor_menus from '@elementor/menus';
4
+
5
+ type PopoverActionProps = {
6
+ title: string;
7
+ visible?: boolean;
8
+ icon: ElementType;
9
+ popoverContent: ComponentType<{
10
+ closePopover: () => void;
11
+ }>;
12
+ };
13
+ declare function PopoverAction({ title, visible, icon: Icon, popoverContent: PopoverContent, }: PopoverActionProps): React.JSX.Element | null;
2
14
 
3
15
  type MaybeArray<T> = T | T[];
4
- type TransformablePropValue<T = unknown> = {
5
- $$type: string;
6
- value: T;
16
+ type TransformablePropValue<Type extends string, Value = unknown> = {
17
+ $$type: Type;
18
+ value: Value;
19
+ disabled?: boolean;
7
20
  };
8
21
  type PlainPropValue = MaybeArray<string | number | boolean | object | null | undefined>;
9
- type PropValue = PlainPropValue | TransformablePropValue;
22
+ type PropValue = PlainPropValue | TransformablePropValue<string>;
10
23
  type PropKey = string;
11
24
 
12
25
  type ReplaceWhenParams = {
13
26
  value: PropValue;
14
27
  };
15
28
  type ControlReplacement = {
16
- component: React.ComponentType;
29
+ component: ComponentType;
17
30
  condition: ({ value }: ReplaceWhenParams) => boolean;
18
31
  };
19
- declare const replaceControl: ({ component, condition }: ControlReplacement) => void;
32
+ declare function replaceControl({ component, condition }: ControlReplacement): void;
20
33
 
21
34
  type ControlContext<T extends PropValue> = {
22
35
  bind: PropKey;
23
36
  setValue: (value: T | undefined) => void;
24
37
  value: T | undefined;
25
38
  };
26
- declare const ControlContext: react.Context<ControlContext<PropValue> | null>;
39
+ declare const ControlContext: React.Context<ControlContext<PropValue> | null>;
27
40
  declare function useControl<T extends PropValue>(): ControlContext<T | undefined>;
28
41
  declare function useControl<T extends PropValue>(defaultValue: T): ControlContext<T>;
29
42
 
30
- export { replaceControl, useControl };
43
+ declare const controlActionsMenu: _elementor_menus.Menu<{
44
+ PopoverAction: typeof PopoverAction;
45
+ }, "default">;
46
+
47
+ export { type PopoverActionProps, controlActionsMenu, replaceControl, useControl };