@elementor/editor-controls 4.0.0-573 → 4.0.0-591
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/dist/index.d.mts +8 -4
- package/dist/index.d.ts +8 -4
- package/dist/index.js +16 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/size/unstable-size-field.tsx +7 -12
- package/src/controls/inline-editing-control.tsx +5 -5
- package/src/hooks/use-size-value.ts +9 -4
- package/src/index.ts +1 -0
package/dist/index.d.mts
CHANGED
|
@@ -6,6 +6,7 @@ import { StyleDefinitionState } from '@elementor/editor-styles';
|
|
|
6
6
|
import { EditorProps, EditorView } from '@tiptap/pm/view';
|
|
7
7
|
import { Editor } from '@tiptap/react';
|
|
8
8
|
import { ElementID } from '@elementor/editor-elements';
|
|
9
|
+
import * as _mui_material from '@mui/material';
|
|
9
10
|
import * as _elementor_locations from '@elementor/locations';
|
|
10
11
|
|
|
11
12
|
type ImageControlProps = {
|
|
@@ -605,15 +606,18 @@ type InlineEditorToolbarProps = {
|
|
|
605
606
|
declare const InlineEditorToolbar: ({ editor, elementId, sx }: InlineEditorToolbarProps) => React$1.JSX.Element;
|
|
606
607
|
|
|
607
608
|
type Props$1<TValue> = {
|
|
608
|
-
units: Unit[];
|
|
609
609
|
value: TValue;
|
|
610
|
-
|
|
610
|
+
units: Unit[];
|
|
611
|
+
defaultUnit?: Unit;
|
|
611
612
|
onChange: (value: TValue) => void;
|
|
612
613
|
onBlur?: (event: React$1.FocusEvent<HTMLInputElement>) => void;
|
|
613
614
|
disabled?: boolean;
|
|
614
615
|
InputProps?: TextFieldProps['InputProps'];
|
|
616
|
+
startIcon?: React$1.ReactNode;
|
|
615
617
|
};
|
|
616
|
-
declare const UnstableSizeField: <T extends SizePropValue["value"]>({ value, InputProps,
|
|
618
|
+
declare const UnstableSizeField: <T extends SizePropValue["value"]>({ value, InputProps, onChange, onBlur, units, defaultUnit, startIcon, }: Props$1<T>) => React$1.JSX.Element;
|
|
619
|
+
|
|
620
|
+
declare const NumberInput: React$1.ForwardRefExoticComponent<(Omit<_mui_material.FilledTextFieldProps, "ref"> | Omit<_mui_material.OutlinedTextFieldProps, "ref"> | Omit<_mui_material.StandardTextFieldProps, "ref">) & React$1.RefAttributes<unknown>>;
|
|
617
621
|
|
|
618
622
|
type AnyComponentType = ComponentType<any>;
|
|
619
623
|
declare const brandSymbol: unique symbol;
|
|
@@ -710,4 +714,4 @@ declare const useElementCanHaveChildren: () => boolean;
|
|
|
710
714
|
|
|
711
715
|
declare const useFontFamilies: () => FontCategory[];
|
|
712
716
|
|
|
713
|
-
export { type AdornmentComponent, type AngleUnit, AspectRatioControl, AttributesControl, BackgroundControl, BoxShadowRepeaterControl, ChipsControl, ClearIconButton, ColorControl, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent$1 as ControlComponent, ControlFormLabel, type ControlReplacement, ControlReplacementsProvider, ControlToggleButtonGroup, DateTimeControl, DisplayConditionsControl, EmailFormActionControl, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedOption, FilterRepeaterControl, type FontCategory, FontFamilyControl, GapControl, HtmlTagControl, ImageControl, InlineEditingControl, InlineEditor, InlineEditorToolbar, type InlineEditorToolbarProps, ItemSelector, type ItemsActionPayload, KeyValueControl, type LengthUnit, LinkControl, LinkedDimensionsControl, NumberControl, PopoverContent, PopoverGridContainer, PositionControl, PromotionTrigger, type PromotionTriggerRef, PropKeyProvider, PropProvider, type PropProviderProps, QueryControl, RepeatableControl, Repeater, type RepeaterItem, SelectControl, SelectControlWrapper, type SetRepeaterValuesMeta, type SetValue, type SetValueMeta, SizeControl, StrokeControl, SvgMediaControl, SwitchControl, TextAreaControl, TextControl, type TimeUnit, type ToggleButtonGroupItem, ToggleButtonGroupUi, ToggleControl, type ToggleControlProps, TransformRepeaterControl, TransformSettingsControl, TransitionRepeaterControl, type Unit, UnstableSizeField, UrlControl, type V4PromotionData, type V4PromotionKey, createControl, createControlReplacementsRegistry, enqueueFont, getControlReplacements, injectIntoRepeaterItemActions, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, registerControlReplacement, transitionProperties, transitionsItemsList, useBoundProp, useControlActions, useControlReplacement, useElementCanHaveChildren, useFontFamilies, useSyncExternalState };
|
|
717
|
+
export { type AdornmentComponent, type AngleUnit, AspectRatioControl, AttributesControl, BackgroundControl, BoxShadowRepeaterControl, ChipsControl, ClearIconButton, ColorControl, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent$1 as ControlComponent, ControlFormLabel, type ControlReplacement, ControlReplacementsProvider, ControlToggleButtonGroup, DateTimeControl, DisplayConditionsControl, EmailFormActionControl, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedOption, FilterRepeaterControl, type FontCategory, FontFamilyControl, GapControl, HtmlTagControl, ImageControl, InlineEditingControl, InlineEditor, InlineEditorToolbar, type InlineEditorToolbarProps, ItemSelector, type ItemsActionPayload, KeyValueControl, type LengthUnit, LinkControl, LinkedDimensionsControl, NumberControl, NumberInput, PopoverContent, PopoverGridContainer, PositionControl, PromotionTrigger, type PromotionTriggerRef, PropKeyProvider, PropProvider, type PropProviderProps, QueryControl, RepeatableControl, Repeater, type RepeaterItem, SelectControl, SelectControlWrapper, type SetRepeaterValuesMeta, type SetValue, type SetValueMeta, SizeControl, StrokeControl, SvgMediaControl, SwitchControl, TextAreaControl, TextControl, type TimeUnit, type ToggleButtonGroupItem, ToggleButtonGroupUi, ToggleControl, type ToggleControlProps, TransformRepeaterControl, TransformSettingsControl, TransitionRepeaterControl, type Unit, UnstableSizeField, UrlControl, type V4PromotionData, type V4PromotionKey, createControl, createControlReplacementsRegistry, enqueueFont, getControlReplacements, injectIntoRepeaterItemActions, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, registerControlReplacement, transitionProperties, transitionsItemsList, useBoundProp, useControlActions, useControlReplacement, useElementCanHaveChildren, useFontFamilies, useSyncExternalState };
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { StyleDefinitionState } from '@elementor/editor-styles';
|
|
|
6
6
|
import { EditorProps, EditorView } from '@tiptap/pm/view';
|
|
7
7
|
import { Editor } from '@tiptap/react';
|
|
8
8
|
import { ElementID } from '@elementor/editor-elements';
|
|
9
|
+
import * as _mui_material from '@mui/material';
|
|
9
10
|
import * as _elementor_locations from '@elementor/locations';
|
|
10
11
|
|
|
11
12
|
type ImageControlProps = {
|
|
@@ -605,15 +606,18 @@ type InlineEditorToolbarProps = {
|
|
|
605
606
|
declare const InlineEditorToolbar: ({ editor, elementId, sx }: InlineEditorToolbarProps) => React$1.JSX.Element;
|
|
606
607
|
|
|
607
608
|
type Props$1<TValue> = {
|
|
608
|
-
units: Unit[];
|
|
609
609
|
value: TValue;
|
|
610
|
-
|
|
610
|
+
units: Unit[];
|
|
611
|
+
defaultUnit?: Unit;
|
|
611
612
|
onChange: (value: TValue) => void;
|
|
612
613
|
onBlur?: (event: React$1.FocusEvent<HTMLInputElement>) => void;
|
|
613
614
|
disabled?: boolean;
|
|
614
615
|
InputProps?: TextFieldProps['InputProps'];
|
|
616
|
+
startIcon?: React$1.ReactNode;
|
|
615
617
|
};
|
|
616
|
-
declare const UnstableSizeField: <T extends SizePropValue["value"]>({ value, InputProps,
|
|
618
|
+
declare const UnstableSizeField: <T extends SizePropValue["value"]>({ value, InputProps, onChange, onBlur, units, defaultUnit, startIcon, }: Props$1<T>) => React$1.JSX.Element;
|
|
619
|
+
|
|
620
|
+
declare const NumberInput: React$1.ForwardRefExoticComponent<(Omit<_mui_material.FilledTextFieldProps, "ref"> | Omit<_mui_material.OutlinedTextFieldProps, "ref"> | Omit<_mui_material.StandardTextFieldProps, "ref">) & React$1.RefAttributes<unknown>>;
|
|
617
621
|
|
|
618
622
|
type AnyComponentType = ComponentType<any>;
|
|
619
623
|
declare const brandSymbol: unique symbol;
|
|
@@ -710,4 +714,4 @@ declare const useElementCanHaveChildren: () => boolean;
|
|
|
710
714
|
|
|
711
715
|
declare const useFontFamilies: () => FontCategory[];
|
|
712
716
|
|
|
713
|
-
export { type AdornmentComponent, type AngleUnit, AspectRatioControl, AttributesControl, BackgroundControl, BoxShadowRepeaterControl, ChipsControl, ClearIconButton, ColorControl, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent$1 as ControlComponent, ControlFormLabel, type ControlReplacement, ControlReplacementsProvider, ControlToggleButtonGroup, DateTimeControl, DisplayConditionsControl, EmailFormActionControl, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedOption, FilterRepeaterControl, type FontCategory, FontFamilyControl, GapControl, HtmlTagControl, ImageControl, InlineEditingControl, InlineEditor, InlineEditorToolbar, type InlineEditorToolbarProps, ItemSelector, type ItemsActionPayload, KeyValueControl, type LengthUnit, LinkControl, LinkedDimensionsControl, NumberControl, PopoverContent, PopoverGridContainer, PositionControl, PromotionTrigger, type PromotionTriggerRef, PropKeyProvider, PropProvider, type PropProviderProps, QueryControl, RepeatableControl, Repeater, type RepeaterItem, SelectControl, SelectControlWrapper, type SetRepeaterValuesMeta, type SetValue, type SetValueMeta, SizeControl, StrokeControl, SvgMediaControl, SwitchControl, TextAreaControl, TextControl, type TimeUnit, type ToggleButtonGroupItem, ToggleButtonGroupUi, ToggleControl, type ToggleControlProps, TransformRepeaterControl, TransformSettingsControl, TransitionRepeaterControl, type Unit, UnstableSizeField, UrlControl, type V4PromotionData, type V4PromotionKey, createControl, createControlReplacementsRegistry, enqueueFont, getControlReplacements, injectIntoRepeaterItemActions, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, registerControlReplacement, transitionProperties, transitionsItemsList, useBoundProp, useControlActions, useControlReplacement, useElementCanHaveChildren, useFontFamilies, useSyncExternalState };
|
|
717
|
+
export { type AdornmentComponent, type AngleUnit, AspectRatioControl, AttributesControl, BackgroundControl, BoxShadowRepeaterControl, ChipsControl, ClearIconButton, ColorControl, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent$1 as ControlComponent, ControlFormLabel, type ControlReplacement, ControlReplacementsProvider, ControlToggleButtonGroup, DateTimeControl, DisplayConditionsControl, EmailFormActionControl, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedOption, FilterRepeaterControl, type FontCategory, FontFamilyControl, GapControl, HtmlTagControl, ImageControl, InlineEditingControl, InlineEditor, InlineEditorToolbar, type InlineEditorToolbarProps, ItemSelector, type ItemsActionPayload, KeyValueControl, type LengthUnit, LinkControl, LinkedDimensionsControl, NumberControl, NumberInput, PopoverContent, PopoverGridContainer, PositionControl, PromotionTrigger, type PromotionTriggerRef, PropKeyProvider, PropProvider, type PropProviderProps, QueryControl, RepeatableControl, Repeater, type RepeaterItem, SelectControl, SelectControlWrapper, type SetRepeaterValuesMeta, type SetValue, type SetValueMeta, SizeControl, StrokeControl, SvgMediaControl, SwitchControl, TextAreaControl, TextControl, type TimeUnit, type ToggleButtonGroupItem, ToggleButtonGroupUi, ToggleControl, type ToggleControlProps, TransformRepeaterControl, TransformSettingsControl, TransitionRepeaterControl, type Unit, UnstableSizeField, UrlControl, type V4PromotionData, type V4PromotionKey, createControl, createControlReplacementsRegistry, enqueueFont, getControlReplacements, injectIntoRepeaterItemActions, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, registerControlReplacement, transitionProperties, transitionsItemsList, useBoundProp, useControlActions, useControlReplacement, useElementCanHaveChildren, useFontFamilies, useSyncExternalState };
|
package/dist/index.js
CHANGED
|
@@ -60,6 +60,7 @@ __export(index_exports, {
|
|
|
60
60
|
LinkControl: () => LinkControl,
|
|
61
61
|
LinkedDimensionsControl: () => LinkedDimensionsControl,
|
|
62
62
|
NumberControl: () => NumberControl,
|
|
63
|
+
NumberInput: () => NumberInput,
|
|
63
64
|
PopoverContent: () => PopoverContent,
|
|
64
65
|
PopoverGridContainer: () => PopoverGridContainer,
|
|
65
66
|
PositionControl: () => PositionControl,
|
|
@@ -6428,13 +6429,13 @@ var InlineEditingControl = createControl(
|
|
|
6428
6429
|
attributes,
|
|
6429
6430
|
props
|
|
6430
6431
|
}) => {
|
|
6431
|
-
const { value, setValue } = useBoundProp(import_editor_props52.
|
|
6432
|
-
const content = value?.content ?? "";
|
|
6432
|
+
const { value, setValue } = useBoundProp(import_editor_props52.htmlV3PropTypeUtil);
|
|
6433
|
+
const content = import_editor_props52.stringPropTypeUtil.extract(value?.content ?? null) ?? "";
|
|
6433
6434
|
const debouncedParse = (0, import_react54.useMemo)(
|
|
6434
6435
|
() => (0, import_utils7.debounce)((html) => {
|
|
6435
6436
|
const parsed = (0, import_editor_props52.parseHtmlChildren)(html);
|
|
6436
6437
|
setValue({
|
|
6437
|
-
content: parsed.content
|
|
6438
|
+
content: parsed.content ? import_editor_props52.stringPropTypeUtil.create(parsed.content) : null,
|
|
6438
6439
|
children: parsed.children
|
|
6439
6440
|
});
|
|
6440
6441
|
}, CHILDREN_PARSE_DEBOUNCE_MS),
|
|
@@ -6444,7 +6445,7 @@ var InlineEditingControl = createControl(
|
|
|
6444
6445
|
(newValue) => {
|
|
6445
6446
|
const html = newValue ?? "";
|
|
6446
6447
|
setValue({
|
|
6447
|
-
content: html
|
|
6448
|
+
content: html ? import_editor_props52.stringPropTypeUtil.create(html) : null,
|
|
6448
6449
|
children: value?.children ?? []
|
|
6449
6450
|
});
|
|
6450
6451
|
debouncedParse(html);
|
|
@@ -7169,7 +7170,9 @@ var React111 = __toESM(require("react"));
|
|
|
7169
7170
|
var import_ui96 = require("@elementor/ui");
|
|
7170
7171
|
|
|
7171
7172
|
// src/hooks/use-size-value.ts
|
|
7172
|
-
var
|
|
7173
|
+
var DEFAULT_UNIT2 = "px";
|
|
7174
|
+
var DEFAULT_SIZE2 = "";
|
|
7175
|
+
var useSizeValue = (externalValue, onChange, defaultUnit) => {
|
|
7173
7176
|
const [sizeValue, setSizeValue] = useSyncExternalState({
|
|
7174
7177
|
external: externalValue,
|
|
7175
7178
|
setExternal: (newState) => {
|
|
@@ -7178,7 +7181,7 @@ var useSizeValue = (externalValue, onChange, defaultValue) => {
|
|
|
7178
7181
|
}
|
|
7179
7182
|
},
|
|
7180
7183
|
persistWhen: (newState) => differsFromExternal(newState, externalValue),
|
|
7181
|
-
fallback: () =>
|
|
7184
|
+
fallback: () => ({ size: DEFAULT_SIZE2, unit: defaultUnit ?? DEFAULT_UNIT2 })
|
|
7182
7185
|
});
|
|
7183
7186
|
const setSize = (value) => {
|
|
7184
7187
|
const newState = {
|
|
@@ -7202,7 +7205,7 @@ var useSizeValue = (externalValue, onChange, defaultValue) => {
|
|
|
7202
7205
|
};
|
|
7203
7206
|
};
|
|
7204
7207
|
var differsFromExternal = (newState, externalState) => {
|
|
7205
|
-
return newState
|
|
7208
|
+
return newState?.size !== externalState?.size || newState?.unit !== externalState?.unit;
|
|
7206
7209
|
};
|
|
7207
7210
|
|
|
7208
7211
|
// src/components/size/unit-select.tsx
|
|
@@ -7282,22 +7285,16 @@ var getCursorStyle = (readOnly) => ({
|
|
|
7282
7285
|
});
|
|
7283
7286
|
|
|
7284
7287
|
// src/components/size/unstable-size-field.tsx
|
|
7285
|
-
var DEFAULT_VALUE = {
|
|
7286
|
-
unit: "px",
|
|
7287
|
-
size: 0
|
|
7288
|
-
};
|
|
7289
7288
|
var UnstableSizeField = ({
|
|
7290
7289
|
value,
|
|
7291
7290
|
InputProps,
|
|
7292
|
-
defaultValue,
|
|
7293
7291
|
onChange,
|
|
7294
7292
|
onBlur,
|
|
7295
|
-
units: units2
|
|
7293
|
+
units: units2,
|
|
7294
|
+
defaultUnit,
|
|
7295
|
+
startIcon
|
|
7296
7296
|
}) => {
|
|
7297
|
-
const { size, unit, setSize, setUnit } = useSizeValue(value, onChange,
|
|
7298
|
-
...DEFAULT_VALUE,
|
|
7299
|
-
...defaultValue
|
|
7300
|
-
});
|
|
7297
|
+
const { size, unit, setSize, setUnit } = useSizeValue(value, onChange, defaultUnit);
|
|
7301
7298
|
const shouldHighlightUnit = () => {
|
|
7302
7299
|
return hasValue(size);
|
|
7303
7300
|
};
|
|
@@ -7310,6 +7307,7 @@ var UnstableSizeField = ({
|
|
|
7310
7307
|
onChange: (event) => setSize(event.target.value),
|
|
7311
7308
|
InputProps: {
|
|
7312
7309
|
...InputProps,
|
|
7310
|
+
startAdornment: startIcon && /* @__PURE__ */ React111.createElement(import_ui96.InputAdornment, { position: "start" }, startIcon),
|
|
7313
7311
|
endAdornment: /* @__PURE__ */ React111.createElement(import_ui96.InputAdornment, { position: "end" }, /* @__PURE__ */ React111.createElement(
|
|
7314
7312
|
UnitSelect,
|
|
7315
7313
|
{
|
|
@@ -7396,6 +7394,7 @@ var useFontFamilies = () => {
|
|
|
7396
7394
|
LinkControl,
|
|
7397
7395
|
LinkedDimensionsControl,
|
|
7398
7396
|
NumberControl,
|
|
7397
|
+
NumberInput,
|
|
7399
7398
|
PopoverContent,
|
|
7400
7399
|
PopoverGridContainer,
|
|
7401
7400
|
PositionControl,
|