@elementor/editor-editing-panel 0.17.0 → 0.19.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 (81) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/index.d.mts +28 -10
  3. package/dist/index.d.ts +28 -10
  4. package/dist/index.js +941 -398
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +918 -366
  7. package/dist/index.mjs.map +1 -1
  8. package/package.json +8 -7
  9. package/src/components/editing-panel-error-fallback.tsx +12 -0
  10. package/src/components/editing-panel.tsx +23 -12
  11. package/src/components/settings-tab.tsx +8 -5
  12. package/src/components/style-sections/background-section/background-color-control.tsx +20 -0
  13. package/src/components/style-sections/background-section/background-section.tsx +15 -0
  14. package/src/components/style-sections/effects-section/box-shadow-repeater.tsx +224 -0
  15. package/src/components/style-sections/effects-section/effects-section.tsx +18 -0
  16. package/src/components/style-sections/position-section/z-index-control.tsx +11 -7
  17. package/src/components/style-sections/size-section.tsx +23 -20
  18. package/src/components/style-sections/spacing-section/linked-dimensions-control.tsx +62 -47
  19. package/src/components/style-sections/typography-section/font-size-control.tsx +10 -6
  20. package/src/components/style-sections/typography-section/font-weight-control.tsx +16 -12
  21. package/src/components/style-sections/typography-section/letter-spacing-control.tsx +10 -6
  22. package/src/components/style-sections/typography-section/text-alignment-control.tsx +12 -8
  23. package/src/components/style-sections/typography-section/text-color-control.tsx +10 -6
  24. package/src/components/style-sections/typography-section/text-direction-control.tsx +37 -0
  25. package/src/components/style-sections/typography-section/text-style-control.tsx +37 -34
  26. package/src/components/style-sections/typography-section/transform-control.tsx +14 -12
  27. package/src/components/style-sections/typography-section/typography-section.tsx +2 -0
  28. package/src/components/style-sections/typography-section/word-spacing-control.tsx +10 -6
  29. package/src/components/style-tab.tsx +10 -4
  30. package/src/control-replacement.tsx +3 -0
  31. package/src/controls/components/control-type-container.tsx +28 -0
  32. package/src/controls/components/repeater.tsx +197 -0
  33. package/src/controls/components/text-field-inner-selection.tsx +2 -2
  34. package/src/controls/control-actions/actions/popover-action.tsx +58 -0
  35. package/src/controls/control-actions/control-actions-menu.ts +8 -0
  36. package/src/controls/control-actions/control-actions.tsx +43 -0
  37. package/src/controls/control-context.tsx +1 -1
  38. package/src/controls/control-replacement.ts +16 -8
  39. package/src/controls/control-types/color-control.tsx +21 -18
  40. package/src/controls/control-types/image-control.tsx +56 -59
  41. package/src/controls/control-types/image-media-control.tsx +73 -0
  42. package/src/controls/control-types/number-control.tsx +13 -9
  43. package/src/controls/control-types/select-control.tsx +14 -10
  44. package/src/controls/control-types/size-control.tsx +18 -14
  45. package/src/controls/control-types/text-area-control.tsx +15 -11
  46. package/src/controls/control-types/text-control.tsx +9 -3
  47. package/src/controls/control-types/toggle-control.tsx +4 -3
  48. package/src/controls/control.tsx +1 -7
  49. package/src/controls/controls-registry.tsx +19 -10
  50. package/src/controls/create-control-replacement.tsx +53 -0
  51. package/src/controls/create-control.tsx +40 -0
  52. package/src/controls/hooks/use-style-control.ts +3 -3
  53. package/src/{hooks → controls/hooks}/use-widget-settings.ts +1 -1
  54. package/src/{props → controls/props}/is-transformable.ts +1 -2
  55. package/src/controls/props/types.ts +51 -0
  56. package/src/{contexts/element-context.tsx → controls/providers/element-provider.tsx} +4 -4
  57. package/src/controls/settings-control.tsx +7 -14
  58. package/src/controls/style-control.tsx +1 -1
  59. package/src/{sync → controls/sync}/get-container.ts +1 -1
  60. package/src/{sync → controls/sync}/update-settings.ts +1 -1
  61. package/src/controls/types.ts +39 -0
  62. package/src/dynamics/components/dynamic-selection-control.tsx +2 -2
  63. package/src/dynamics/components/dynamic-selection.tsx +6 -6
  64. package/src/dynamics/dynamic-control.tsx +2 -2
  65. package/src/dynamics/hooks/use-dynamic-tag.ts +2 -2
  66. package/src/dynamics/hooks/use-prop-dynamic-action.tsx +23 -0
  67. package/src/dynamics/hooks/use-prop-dynamic-tags.ts +7 -7
  68. package/src/dynamics/hooks/use-prop-value-history.ts +3 -3
  69. package/src/dynamics/init.ts +10 -1
  70. package/src/dynamics/types.ts +7 -3
  71. package/src/dynamics/utils.ts +17 -4
  72. package/src/hooks/use-element-style-prop.ts +3 -2
  73. package/src/hooks/use-element-styles.ts +1 -1
  74. package/src/hooks/use-element-type.ts +1 -1
  75. package/src/index.ts +3 -1
  76. package/src/sync/get-element-styles.ts +2 -2
  77. package/src/sync/get-selected-elements.ts +1 -1
  78. package/src/sync/types.ts +2 -1
  79. package/src/sync/update-style.ts +3 -2
  80. package/src/controls/components/control-container.tsx +0 -18
  81. package/src/types.ts +0 -68
@@ -1,18 +0,0 @@
1
- import * as React from 'react';
2
- import { Stack, StackProps, styled } from '@elementor/ui';
3
-
4
- const StyledStack = styled( Stack )( ( { theme, gap, direction } ) => ( {
5
- '> :only-child': {
6
- width: '100%',
7
- },
8
- '&:where( :has( > :nth-child( 2 ):last-child ) ) > :where( * )': {
9
- width: direction === 'column' ? '100%' : `calc( 50% - ${ theme.spacing( gap / 2 ) })`,
10
- },
11
- '&:where( :has( > :nth-child( 3 ):last-child ) ) > :where( * )': {
12
- width: direction === 'column' ? '100%' : `calc( 33.3333% - ${ theme.spacing( gap * 2 ) } / 3)`,
13
- },
14
- } ) );
15
-
16
- export const ControlContainer = ( props: StackProps ) => (
17
- <StyledStack gap={ 1 } direction="row" alignItems="center" justifyContent="space-between" { ...props } />
18
- );
package/src/types.ts DELETED
@@ -1,68 +0,0 @@
1
- export type ElementID = string;
2
-
3
- export type Element = {
4
- id: ElementID;
5
- type: string;
6
- };
7
-
8
- export type ElementType = {
9
- key: string;
10
- controls: ControlItem[];
11
- propsSchema: PropsSchema;
12
- title: string;
13
- };
14
-
15
- export type ControlsSection = {
16
- type: 'section';
17
- value: {
18
- description?: string;
19
- label: string;
20
- items: ControlItem[];
21
- };
22
- };
23
-
24
- export type Control = {
25
- type: 'control';
26
- value: {
27
- bind: string;
28
- label?: string;
29
- description?: string;
30
- type: string;
31
- props: Record< string, unknown >;
32
- };
33
- };
34
-
35
- export type ControlItem = ControlsSection | Control;
36
-
37
- export type AdditionalPropType = {
38
- key: string;
39
- settings: Record< string, unknown >;
40
- };
41
-
42
- export type PropDefinition = {
43
- type: {
44
- key: string;
45
- default: PropValue;
46
- settings: Record< string, unknown >;
47
- };
48
- additional_types: Array< AdditionalPropType >;
49
- };
50
-
51
- export type PropsSchema = Record< Control[ 'value' ][ 'bind' ], PropDefinition >;
52
-
53
- type MaybeArray< T > = T | T[];
54
-
55
- export type TransformablePropValue< T = unknown > = {
56
- $$type: string;
57
- value: T;
58
- };
59
-
60
- export type PlainPropValue = MaybeArray< string | number | boolean | object | null | undefined >;
61
-
62
- export type PropValue = PlainPropValue | TransformablePropValue;
63
-
64
- export type PropKey = string;
65
-
66
- export type Props = Record< PropKey, PropValue >;
67
-
68
- export type PlainProps = Record< PropKey, PlainPropValue >;