@elementor/editor-controls 3.33.0-113 → 3.33.0-115
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 +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +122 -84
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +118 -81
- package/dist/index.mjs.map +1 -1
- package/package.json +14 -14
- package/src/components/css-code-editor/css-editor.styles.ts +1 -0
- package/src/components/css-code-editor/css-editor.tsx +66 -34
- package/src/components/icon-buttons/clear-icon-button.tsx +23 -0
- package/src/index.ts +1 -0
package/dist/index.d.mts
CHANGED
|
@@ -324,6 +324,14 @@ type CssEditorProps = {
|
|
|
324
324
|
};
|
|
325
325
|
declare const CssEditor: ({ value, onChange }: CssEditorProps) => React$1.JSX.Element;
|
|
326
326
|
|
|
327
|
+
type ClearIconButtonProps = {
|
|
328
|
+
onClick?: () => void;
|
|
329
|
+
tooltipText: React$1.ReactNode;
|
|
330
|
+
disabled?: boolean;
|
|
331
|
+
size?: 'tiny' | 'small' | 'medium' | 'large';
|
|
332
|
+
};
|
|
333
|
+
declare const ClearIconButton: ({ tooltipText, onClick, disabled, size }: ClearIconButtonProps) => React$1.JSX.Element;
|
|
334
|
+
|
|
327
335
|
type AnchorEl = HTMLElement | null;
|
|
328
336
|
type Item<T> = {
|
|
329
337
|
disabled?: boolean;
|
|
@@ -491,4 +499,4 @@ type UseInternalStateOptions<TValue> = {
|
|
|
491
499
|
};
|
|
492
500
|
declare const useSyncExternalState: <TValue>({ external, setExternal, persistWhen, fallback, }: UseInternalStateOptions<TValue>) => readonly [TValue, (setter: ((value: TValue) => TValue) | TValue, options?: CreateOptions, meta?: SetValueMeta) => void];
|
|
493
501
|
|
|
494
|
-
export { type AngleUnit, AspectRatioControl, BackgroundControl, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent, ControlFormLabel, ControlReplacementsProvider, ControlToggleButtonGroup, CssEditor, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedOption, FilterRepeaterControl, type FontCategory, FontFamilyControl, GapControl, ImageControl, ItemSelector, KeyValueControl, type LengthUnit, LinkControl, LinkedDimensionsControl, NumberControl, PopoverContent, PositionControl, PropKeyProvider, PropProvider, type PropProviderProps, RepeatableControl, Repeater, SelectControl, type SetValue, SizeControl, StrokeControl, SvgMediaControl, SwitchControl, TextAreaControl, TextControl, type TimeUnit, type ToggleButtonGroupItem, ToggleControl, type ToggleControlProps, TransformBaseControl, TransformRepeaterControl, TransitionRepeaterControl, type Unit, UrlControl, createControl, createControlReplacementsRegistry, enqueueFont, injectIntoRepeaterHeaderActions, injectIntoRepeaterItemActions, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, transitionProperties, transitionsItemsList, useBoundProp, useControlActions, useFloatingActionsBar, useSyncExternalState };
|
|
502
|
+
export { type AngleUnit, AspectRatioControl, BackgroundControl, BoxShadowRepeaterControl, ClearIconButton, ColorControl, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent, ControlFormLabel, ControlReplacementsProvider, ControlToggleButtonGroup, CssEditor, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedOption, FilterRepeaterControl, type FontCategory, FontFamilyControl, GapControl, ImageControl, ItemSelector, KeyValueControl, type LengthUnit, LinkControl, LinkedDimensionsControl, NumberControl, PopoverContent, PositionControl, PropKeyProvider, PropProvider, type PropProviderProps, RepeatableControl, Repeater, SelectControl, type SetValue, SizeControl, StrokeControl, SvgMediaControl, SwitchControl, TextAreaControl, TextControl, type TimeUnit, type ToggleButtonGroupItem, ToggleControl, type ToggleControlProps, TransformBaseControl, TransformRepeaterControl, TransitionRepeaterControl, type Unit, UrlControl, createControl, createControlReplacementsRegistry, enqueueFont, injectIntoRepeaterHeaderActions, injectIntoRepeaterItemActions, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, transitionProperties, transitionsItemsList, useBoundProp, useControlActions, useFloatingActionsBar, useSyncExternalState };
|
package/dist/index.d.ts
CHANGED
|
@@ -324,6 +324,14 @@ type CssEditorProps = {
|
|
|
324
324
|
};
|
|
325
325
|
declare const CssEditor: ({ value, onChange }: CssEditorProps) => React$1.JSX.Element;
|
|
326
326
|
|
|
327
|
+
type ClearIconButtonProps = {
|
|
328
|
+
onClick?: () => void;
|
|
329
|
+
tooltipText: React$1.ReactNode;
|
|
330
|
+
disabled?: boolean;
|
|
331
|
+
size?: 'tiny' | 'small' | 'medium' | 'large';
|
|
332
|
+
};
|
|
333
|
+
declare const ClearIconButton: ({ tooltipText, onClick, disabled, size }: ClearIconButtonProps) => React$1.JSX.Element;
|
|
334
|
+
|
|
327
335
|
type AnchorEl = HTMLElement | null;
|
|
328
336
|
type Item<T> = {
|
|
329
337
|
disabled?: boolean;
|
|
@@ -491,4 +499,4 @@ type UseInternalStateOptions<TValue> = {
|
|
|
491
499
|
};
|
|
492
500
|
declare const useSyncExternalState: <TValue>({ external, setExternal, persistWhen, fallback, }: UseInternalStateOptions<TValue>) => readonly [TValue, (setter: ((value: TValue) => TValue) | TValue, options?: CreateOptions, meta?: SetValueMeta) => void];
|
|
493
501
|
|
|
494
|
-
export { type AngleUnit, AspectRatioControl, BackgroundControl, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent, ControlFormLabel, ControlReplacementsProvider, ControlToggleButtonGroup, CssEditor, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedOption, FilterRepeaterControl, type FontCategory, FontFamilyControl, GapControl, ImageControl, ItemSelector, KeyValueControl, type LengthUnit, LinkControl, LinkedDimensionsControl, NumberControl, PopoverContent, PositionControl, PropKeyProvider, PropProvider, type PropProviderProps, RepeatableControl, Repeater, SelectControl, type SetValue, SizeControl, StrokeControl, SvgMediaControl, SwitchControl, TextAreaControl, TextControl, type TimeUnit, type ToggleButtonGroupItem, ToggleControl, type ToggleControlProps, TransformBaseControl, TransformRepeaterControl, TransitionRepeaterControl, type Unit, UrlControl, createControl, createControlReplacementsRegistry, enqueueFont, injectIntoRepeaterHeaderActions, injectIntoRepeaterItemActions, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, transitionProperties, transitionsItemsList, useBoundProp, useControlActions, useFloatingActionsBar, useSyncExternalState };
|
|
502
|
+
export { type AngleUnit, AspectRatioControl, BackgroundControl, BoxShadowRepeaterControl, ClearIconButton, ColorControl, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent, ControlFormLabel, ControlReplacementsProvider, ControlToggleButtonGroup, CssEditor, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedOption, FilterRepeaterControl, type FontCategory, FontFamilyControl, GapControl, ImageControl, ItemSelector, KeyValueControl, type LengthUnit, LinkControl, LinkedDimensionsControl, NumberControl, PopoverContent, PositionControl, PropKeyProvider, PropProvider, type PropProviderProps, RepeatableControl, Repeater, SelectControl, type SetValue, SizeControl, StrokeControl, SvgMediaControl, SwitchControl, TextAreaControl, TextControl, type TimeUnit, type ToggleButtonGroupItem, ToggleControl, type ToggleControlProps, TransformBaseControl, TransformRepeaterControl, TransitionRepeaterControl, type Unit, UrlControl, createControl, createControlReplacementsRegistry, enqueueFont, injectIntoRepeaterHeaderActions, injectIntoRepeaterItemActions, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, transitionProperties, transitionsItemsList, useBoundProp, useControlActions, useFloatingActionsBar, useSyncExternalState };
|
package/dist/index.js
CHANGED
|
@@ -33,6 +33,7 @@ __export(index_exports, {
|
|
|
33
33
|
AspectRatioControl: () => AspectRatioControl,
|
|
34
34
|
BackgroundControl: () => BackgroundControl,
|
|
35
35
|
BoxShadowRepeaterControl: () => BoxShadowRepeaterControl,
|
|
36
|
+
ClearIconButton: () => ClearIconButton,
|
|
36
37
|
ColorControl: () => ColorControl,
|
|
37
38
|
ControlActionsProvider: () => ControlActionsProvider,
|
|
38
39
|
ControlAdornments: () => ControlAdornments,
|
|
@@ -5359,14 +5360,25 @@ var TransitionRepeaterControl = createControl(
|
|
|
5359
5360
|
);
|
|
5360
5361
|
|
|
5361
5362
|
// src/components/css-code-editor/css-editor.tsx
|
|
5362
|
-
var
|
|
5363
|
+
var React93 = __toESM(require("react"));
|
|
5363
5364
|
var import_editor_responsive2 = require("@elementor/editor-responsive");
|
|
5364
|
-
var
|
|
5365
|
+
var import_ui81 = require("@elementor/ui");
|
|
5365
5366
|
var import_react47 = require("@monaco-editor/react");
|
|
5367
|
+
var import_i18n49 = require("@wordpress/i18n");
|
|
5366
5368
|
|
|
5367
|
-
// src/components/
|
|
5369
|
+
// src/components/icon-buttons/clear-icon-button.tsx
|
|
5370
|
+
var React91 = __toESM(require("react"));
|
|
5371
|
+
var import_icons32 = require("@elementor/icons");
|
|
5368
5372
|
var import_ui79 = require("@elementor/ui");
|
|
5369
|
-
var
|
|
5373
|
+
var CustomIconButton = (0, import_ui79.styled)(import_ui79.IconButton)(({ theme }) => ({
|
|
5374
|
+
width: theme.spacing(2.5),
|
|
5375
|
+
height: theme.spacing(2.5)
|
|
5376
|
+
}));
|
|
5377
|
+
var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */ React91.createElement(import_ui79.Tooltip, { title: tooltipText, placement: "top", disableInteractive: true }, /* @__PURE__ */ React91.createElement(CustomIconButton, { "aria-label": tooltipText, size, onClick, disabled }, /* @__PURE__ */ React91.createElement(import_icons32.BrushBigIcon, { fontSize: size })));
|
|
5378
|
+
|
|
5379
|
+
// src/components/css-code-editor/css-editor.styles.ts
|
|
5380
|
+
var import_ui80 = require("@elementor/ui");
|
|
5381
|
+
var EditorWrapper = (0, import_ui80.styled)(import_ui80.Box)`
|
|
5370
5382
|
border: 1px solid var( --e-a-border-color );
|
|
5371
5383
|
border-radius: 8px;
|
|
5372
5384
|
padding: 10px 12px;
|
|
@@ -5376,6 +5388,7 @@ var EditorWrapper = (0, import_ui79.styled)(import_ui79.Box)`
|
|
|
5376
5388
|
.monaco-editor .suggest-widget {
|
|
5377
5389
|
width: 220px !important;
|
|
5378
5390
|
max-width: 220px !important;
|
|
5391
|
+
z-index: 1001;
|
|
5379
5392
|
}
|
|
5380
5393
|
|
|
5381
5394
|
.visual-content-dimmed {
|
|
@@ -5384,7 +5397,7 @@ var EditorWrapper = (0, import_ui79.styled)(import_ui79.Box)`
|
|
|
5384
5397
|
pointer-events: none;
|
|
5385
5398
|
}
|
|
5386
5399
|
`;
|
|
5387
|
-
var ResizeHandle = (0,
|
|
5400
|
+
var ResizeHandle = (0, import_ui80.styled)(import_ui80.Button)`
|
|
5388
5401
|
position: absolute;
|
|
5389
5402
|
bottom: 0;
|
|
5390
5403
|
left: 0;
|
|
@@ -5484,9 +5497,9 @@ function clearMarkersFromVisualContent(editor, monaco) {
|
|
|
5484
5497
|
}
|
|
5485
5498
|
|
|
5486
5499
|
// src/components/css-code-editor/resize-handle.tsx
|
|
5487
|
-
var
|
|
5500
|
+
var React92 = __toESM(require("react"));
|
|
5488
5501
|
var ResizeHandleComponent = ({ onResize, containerRef, onHeightChange }) => {
|
|
5489
|
-
const handleResizeMove =
|
|
5502
|
+
const handleResizeMove = React92.useCallback(
|
|
5490
5503
|
(e) => {
|
|
5491
5504
|
const container = containerRef.current;
|
|
5492
5505
|
if (!container) {
|
|
@@ -5499,11 +5512,11 @@ var ResizeHandleComponent = ({ onResize, containerRef, onHeightChange }) => {
|
|
|
5499
5512
|
},
|
|
5500
5513
|
[containerRef, onResize, onHeightChange]
|
|
5501
5514
|
);
|
|
5502
|
-
const handleResizeEnd =
|
|
5515
|
+
const handleResizeEnd = React92.useCallback(() => {
|
|
5503
5516
|
document.removeEventListener("mousemove", handleResizeMove);
|
|
5504
5517
|
document.removeEventListener("mouseup", handleResizeEnd);
|
|
5505
5518
|
}, [handleResizeMove]);
|
|
5506
|
-
const handleResizeStart =
|
|
5519
|
+
const handleResizeStart = React92.useCallback(
|
|
5507
5520
|
(e) => {
|
|
5508
5521
|
e.preventDefault();
|
|
5509
5522
|
e.stopPropagation();
|
|
@@ -5512,13 +5525,13 @@ var ResizeHandleComponent = ({ onResize, containerRef, onHeightChange }) => {
|
|
|
5512
5525
|
},
|
|
5513
5526
|
[handleResizeMove, handleResizeEnd]
|
|
5514
5527
|
);
|
|
5515
|
-
|
|
5528
|
+
React92.useEffect(() => {
|
|
5516
5529
|
return () => {
|
|
5517
5530
|
document.removeEventListener("mousemove", handleResizeMove);
|
|
5518
5531
|
document.removeEventListener("mouseup", handleResizeEnd);
|
|
5519
5532
|
};
|
|
5520
5533
|
}, [handleResizeMove, handleResizeEnd]);
|
|
5521
|
-
return /* @__PURE__ */
|
|
5534
|
+
return /* @__PURE__ */ React92.createElement(
|
|
5522
5535
|
ResizeHandle,
|
|
5523
5536
|
{
|
|
5524
5537
|
onMouseDown: handleResizeStart,
|
|
@@ -5595,12 +5608,15 @@ var getActual = (value) => {
|
|
|
5595
5608
|
}
|
|
5596
5609
|
return lines.slice(1, -1).map((line) => line.replace(/^ {2}/, "")).join("\n");
|
|
5597
5610
|
};
|
|
5598
|
-
var createEditorDidMountHandler = (editorRef, monacoRef) => {
|
|
5611
|
+
var createEditorDidMountHandler = (editorRef, monacoRef, onUserContentChange) => {
|
|
5599
5612
|
return (editor, monaco) => {
|
|
5600
5613
|
editorRef.current = editor;
|
|
5601
5614
|
monacoRef.current = monaco;
|
|
5602
5615
|
preventChangeOnVisualContent(editor);
|
|
5603
5616
|
setCustomSyntaxRules(editor, monaco);
|
|
5617
|
+
const initialCode = editor.getModel()?.getValue() ?? "";
|
|
5618
|
+
const initialUserContent = getActual(initialCode);
|
|
5619
|
+
onUserContentChange(initialUserContent);
|
|
5604
5620
|
monaco.editor.onDidChangeMarkers(() => {
|
|
5605
5621
|
setTimeout(() => clearMarkersFromVisualContent(editor, monaco), 0);
|
|
5606
5622
|
});
|
|
@@ -5608,16 +5624,20 @@ var createEditorDidMountHandler = (editorRef, monacoRef) => {
|
|
|
5608
5624
|
};
|
|
5609
5625
|
};
|
|
5610
5626
|
var CssEditor = ({ value, onChange }) => {
|
|
5611
|
-
const theme = (0,
|
|
5612
|
-
const containerRef =
|
|
5613
|
-
const editorRef =
|
|
5614
|
-
const monacoRef =
|
|
5615
|
-
const debounceTimer =
|
|
5627
|
+
const theme = (0, import_ui81.useTheme)();
|
|
5628
|
+
const containerRef = React93.useRef(null);
|
|
5629
|
+
const editorRef = React93.useRef(null);
|
|
5630
|
+
const monacoRef = React93.useRef(null);
|
|
5631
|
+
const debounceTimer = React93.useRef(null);
|
|
5616
5632
|
const activeBreakpoint = (0, import_editor_responsive2.useActiveBreakpoint)();
|
|
5617
|
-
const
|
|
5633
|
+
const [hasContent, setHasContent] = React93.useState(value.trim() !== "");
|
|
5634
|
+
const handleUserContentChange = React93.useCallback((newValue) => {
|
|
5635
|
+
setHasContent(newValue.trim() !== "");
|
|
5636
|
+
}, []);
|
|
5637
|
+
const handleResize = React93.useCallback(() => {
|
|
5618
5638
|
editorRef.current?.layout();
|
|
5619
5639
|
}, []);
|
|
5620
|
-
const handleHeightChange =
|
|
5640
|
+
const handleHeightChange = React93.useCallback((height) => {
|
|
5621
5641
|
if (containerRef.current) {
|
|
5622
5642
|
containerRef.current.style.height = `${height}px`;
|
|
5623
5643
|
}
|
|
@@ -5628,6 +5648,7 @@ var CssEditor = ({ value, onChange }) => {
|
|
|
5628
5648
|
}
|
|
5629
5649
|
const code = editorRef.current?.getModel()?.getValue() ?? "";
|
|
5630
5650
|
const userContent = getActual(code);
|
|
5651
|
+
setHasContent(userContent.trim() !== "");
|
|
5631
5652
|
setCustomSyntaxRules(editorRef?.current, monacoRef.current);
|
|
5632
5653
|
const currentTimer = debounceTimer.current;
|
|
5633
5654
|
if (currentTimer) {
|
|
@@ -5642,8 +5663,9 @@ var CssEditor = ({ value, onChange }) => {
|
|
|
5642
5663
|
}, 500);
|
|
5643
5664
|
debounceTimer.current = newTimer;
|
|
5644
5665
|
};
|
|
5645
|
-
const handleEditorDidMount = createEditorDidMountHandler(editorRef, monacoRef);
|
|
5646
|
-
|
|
5666
|
+
const handleEditorDidMount = createEditorDidMountHandler(editorRef, monacoRef, handleUserContentChange);
|
|
5667
|
+
const handleReset = () => editorRef.current?.getModel()?.setValue(setVisualContent(""));
|
|
5668
|
+
React93.useEffect(() => {
|
|
5647
5669
|
const timerRef = debounceTimer;
|
|
5648
5670
|
return () => {
|
|
5649
5671
|
const timer = timerRef.current;
|
|
@@ -5652,49 +5674,64 @@ var CssEditor = ({ value, onChange }) => {
|
|
|
5652
5674
|
}
|
|
5653
5675
|
};
|
|
5654
5676
|
}, []);
|
|
5655
|
-
return /* @__PURE__ */
|
|
5656
|
-
|
|
5677
|
+
return /* @__PURE__ */ React93.createElement(
|
|
5678
|
+
FloatingActionsBar,
|
|
5657
5679
|
{
|
|
5658
|
-
|
|
5659
|
-
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
+
actions: hasContent ? [
|
|
5681
|
+
/* @__PURE__ */ React93.createElement(
|
|
5682
|
+
ClearIconButton,
|
|
5683
|
+
{
|
|
5684
|
+
key: "clear",
|
|
5685
|
+
tooltipText: (0, import_i18n49.__)("Clear", "elementor"),
|
|
5686
|
+
onClick: handleReset
|
|
5687
|
+
}
|
|
5688
|
+
)
|
|
5689
|
+
] : []
|
|
5690
|
+
},
|
|
5691
|
+
/* @__PURE__ */ React93.createElement(EditorWrapper, { ref: containerRef }, /* @__PURE__ */ React93.createElement(
|
|
5692
|
+
import_react47.Editor,
|
|
5693
|
+
{
|
|
5694
|
+
key: activeBreakpoint,
|
|
5695
|
+
height: "100%",
|
|
5696
|
+
language: "css",
|
|
5697
|
+
theme: theme.palette.mode === "dark" ? "vs-dark" : "vs",
|
|
5698
|
+
value: setVisualContent(value),
|
|
5699
|
+
onMount: handleEditorDidMount,
|
|
5700
|
+
onChange: handleEditorChange,
|
|
5701
|
+
options: {
|
|
5702
|
+
lineNumbers: "on",
|
|
5703
|
+
folding: true,
|
|
5704
|
+
minimap: { enabled: false },
|
|
5705
|
+
fontFamily: "Roboto, Arial, Helvetica, Verdana, sans-serif",
|
|
5706
|
+
fontSize: 12,
|
|
5707
|
+
renderLineHighlight: "none",
|
|
5708
|
+
hideCursorInOverviewRuler: true,
|
|
5709
|
+
fixedOverflowWidgets: true,
|
|
5710
|
+
suggestFontSize: 10,
|
|
5711
|
+
suggestLineHeight: 14,
|
|
5712
|
+
stickyScroll: {
|
|
5713
|
+
enabled: false
|
|
5714
|
+
},
|
|
5715
|
+
lineDecorationsWidth: 2
|
|
5716
|
+
}
|
|
5680
5717
|
}
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
)
|
|
5718
|
+
), /* @__PURE__ */ React93.createElement(
|
|
5719
|
+
ResizeHandleComponent,
|
|
5720
|
+
{
|
|
5721
|
+
onResize: handleResize,
|
|
5722
|
+
containerRef,
|
|
5723
|
+
onHeightChange: handleHeightChange
|
|
5724
|
+
}
|
|
5725
|
+
))
|
|
5726
|
+
);
|
|
5690
5727
|
};
|
|
5691
5728
|
|
|
5692
5729
|
// src/components/repeater.tsx
|
|
5693
|
-
var
|
|
5730
|
+
var React94 = __toESM(require("react"));
|
|
5694
5731
|
var import_react48 = require("react");
|
|
5695
|
-
var
|
|
5696
|
-
var
|
|
5697
|
-
var
|
|
5732
|
+
var import_icons33 = require("@elementor/icons");
|
|
5733
|
+
var import_ui82 = require("@elementor/ui");
|
|
5734
|
+
var import_i18n50 = require("@wordpress/i18n");
|
|
5698
5735
|
var SIZE9 = "tiny";
|
|
5699
5736
|
var EMPTY_OPEN_ITEM2 = -1;
|
|
5700
5737
|
var Repeater3 = ({
|
|
@@ -5784,8 +5821,8 @@ var Repeater3 = ({
|
|
|
5784
5821
|
{ action: { type: "reorder", payload: { ...meta } } }
|
|
5785
5822
|
);
|
|
5786
5823
|
};
|
|
5787
|
-
return /* @__PURE__ */
|
|
5788
|
-
|
|
5824
|
+
return /* @__PURE__ */ React94.createElement(SectionContent, null, /* @__PURE__ */ React94.createElement(
|
|
5825
|
+
import_ui82.Stack,
|
|
5789
5826
|
{
|
|
5790
5827
|
direction: "row",
|
|
5791
5828
|
justifyContent: "start",
|
|
@@ -5793,31 +5830,31 @@ var Repeater3 = ({
|
|
|
5793
5830
|
gap: 1,
|
|
5794
5831
|
sx: { marginInlineEnd: -0.75 }
|
|
5795
5832
|
},
|
|
5796
|
-
/* @__PURE__ */
|
|
5797
|
-
/* @__PURE__ */
|
|
5798
|
-
/* @__PURE__ */
|
|
5799
|
-
|
|
5833
|
+
/* @__PURE__ */ React94.createElement(import_ui82.Typography, { component: "label", variant: "caption", color: "text.secondary" }, label),
|
|
5834
|
+
/* @__PURE__ */ React94.createElement(ControlAdornments, null),
|
|
5835
|
+
/* @__PURE__ */ React94.createElement(
|
|
5836
|
+
import_ui82.IconButton,
|
|
5800
5837
|
{
|
|
5801
5838
|
size: SIZE9,
|
|
5802
5839
|
sx: { ml: "auto" },
|
|
5803
5840
|
disabled,
|
|
5804
5841
|
onClick: addRepeaterItem,
|
|
5805
|
-
"aria-label": (0,
|
|
5842
|
+
"aria-label": (0, import_i18n50.__)("Add item", "elementor")
|
|
5806
5843
|
},
|
|
5807
|
-
/* @__PURE__ */
|
|
5844
|
+
/* @__PURE__ */ React94.createElement(import_icons33.PlusIcon, { fontSize: SIZE9 })
|
|
5808
5845
|
)
|
|
5809
|
-
), 0 < uniqueKeys.length && /* @__PURE__ */
|
|
5846
|
+
), 0 < uniqueKeys.length && /* @__PURE__ */ React94.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key, index) => {
|
|
5810
5847
|
const value = items2[index];
|
|
5811
5848
|
if (!value) {
|
|
5812
5849
|
return null;
|
|
5813
5850
|
}
|
|
5814
|
-
return /* @__PURE__ */
|
|
5851
|
+
return /* @__PURE__ */ React94.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React94.createElement(
|
|
5815
5852
|
RepeaterItem,
|
|
5816
5853
|
{
|
|
5817
5854
|
disabled,
|
|
5818
5855
|
propDisabled: value?.disabled,
|
|
5819
|
-
label: /* @__PURE__ */
|
|
5820
|
-
startIcon: /* @__PURE__ */
|
|
5856
|
+
label: /* @__PURE__ */ React94.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React94.createElement(itemSettings.Label, { value })),
|
|
5857
|
+
startIcon: /* @__PURE__ */ React94.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React94.createElement(itemSettings.Icon, { value })),
|
|
5821
5858
|
removeItem: () => removeRepeaterItem(index),
|
|
5822
5859
|
duplicateItem: () => duplicateRepeaterItem(index),
|
|
5823
5860
|
toggleDisableItem: () => toggleDisableRepeaterItem(index),
|
|
@@ -5827,7 +5864,7 @@ var Repeater3 = ({
|
|
|
5827
5864
|
showToggle,
|
|
5828
5865
|
collectionPropUtil
|
|
5829
5866
|
},
|
|
5830
|
-
(props) => /* @__PURE__ */
|
|
5867
|
+
(props) => /* @__PURE__ */ React94.createElement(itemSettings.Content, { ...props, value, bind: String(index) })
|
|
5831
5868
|
));
|
|
5832
5869
|
})));
|
|
5833
5870
|
};
|
|
@@ -5848,11 +5885,11 @@ var RepeaterItem = ({
|
|
|
5848
5885
|
}) => {
|
|
5849
5886
|
const [anchorEl, setAnchorEl] = (0, import_react48.useState)(null);
|
|
5850
5887
|
const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount, onOpen);
|
|
5851
|
-
const duplicateLabel = (0,
|
|
5852
|
-
const toggleLabel = propDisabled ? (0,
|
|
5853
|
-
const removeLabel = (0,
|
|
5854
|
-
return /* @__PURE__ */
|
|
5855
|
-
|
|
5888
|
+
const duplicateLabel = (0, import_i18n50.__)("Duplicate", "elementor");
|
|
5889
|
+
const toggleLabel = propDisabled ? (0, import_i18n50.__)("Show", "elementor") : (0, import_i18n50.__)("Hide", "elementor");
|
|
5890
|
+
const removeLabel = (0, import_i18n50.__)("Remove", "elementor");
|
|
5891
|
+
return /* @__PURE__ */ React94.createElement(React94.Fragment, null, /* @__PURE__ */ React94.createElement(
|
|
5892
|
+
import_ui82.UnstableTag,
|
|
5856
5893
|
{
|
|
5857
5894
|
disabled,
|
|
5858
5895
|
label,
|
|
@@ -5860,13 +5897,13 @@ var RepeaterItem = ({
|
|
|
5860
5897
|
fullWidth: true,
|
|
5861
5898
|
ref: setRef,
|
|
5862
5899
|
variant: "outlined",
|
|
5863
|
-
"aria-label": (0,
|
|
5864
|
-
...(0,
|
|
5900
|
+
"aria-label": (0, import_i18n50.__)("Open item", "elementor"),
|
|
5901
|
+
...(0, import_ui82.bindTrigger)(popoverState),
|
|
5865
5902
|
startIcon,
|
|
5866
|
-
actions: /* @__PURE__ */
|
|
5903
|
+
actions: /* @__PURE__ */ React94.createElement(React94.Fragment, null, showDuplicate && /* @__PURE__ */ React94.createElement(import_ui82.Tooltip, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React94.createElement(import_ui82.IconButton, { size: SIZE9, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React94.createElement(import_icons33.CopyIcon, { fontSize: SIZE9 }))), showToggle && /* @__PURE__ */ React94.createElement(import_ui82.Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React94.createElement(import_ui82.IconButton, { size: SIZE9, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React94.createElement(import_icons33.EyeOffIcon, { fontSize: SIZE9 }) : /* @__PURE__ */ React94.createElement(import_icons33.EyeIcon, { fontSize: SIZE9 }))), /* @__PURE__ */ React94.createElement(import_ui82.Tooltip, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React94.createElement(import_ui82.IconButton, { size: SIZE9, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React94.createElement(import_icons33.XIcon, { fontSize: SIZE9 }))))
|
|
5867
5904
|
}
|
|
5868
|
-
), /* @__PURE__ */
|
|
5869
|
-
|
|
5905
|
+
), /* @__PURE__ */ React94.createElement(
|
|
5906
|
+
import_ui82.Popover,
|
|
5870
5907
|
{
|
|
5871
5908
|
disablePortal: true,
|
|
5872
5909
|
slotProps: {
|
|
@@ -5879,13 +5916,13 @@ var RepeaterItem = ({
|
|
|
5879
5916
|
...popoverProps,
|
|
5880
5917
|
anchorEl: ref
|
|
5881
5918
|
},
|
|
5882
|
-
/* @__PURE__ */
|
|
5919
|
+
/* @__PURE__ */ React94.createElement(import_ui82.Box, null, children({ anchorEl, collectionPropUtil }))
|
|
5883
5920
|
));
|
|
5884
5921
|
};
|
|
5885
5922
|
var usePopover = (openOnMount, onOpen) => {
|
|
5886
5923
|
const [ref, setRef] = (0, import_react48.useState)(null);
|
|
5887
|
-
const popoverState = (0,
|
|
5888
|
-
const popoverProps = (0,
|
|
5924
|
+
const popoverState = (0, import_ui82.usePopupState)({ variant: "popover" });
|
|
5925
|
+
const popoverProps = (0, import_ui82.bindPopover)(popoverState);
|
|
5889
5926
|
(0, import_react48.useEffect)(() => {
|
|
5890
5927
|
if (openOnMount && ref) {
|
|
5891
5928
|
popoverState.open(ref);
|
|
@@ -5904,6 +5941,7 @@ var usePopover = (openOnMount, onOpen) => {
|
|
|
5904
5941
|
AspectRatioControl,
|
|
5905
5942
|
BackgroundControl,
|
|
5906
5943
|
BoxShadowRepeaterControl,
|
|
5944
|
+
ClearIconButton,
|
|
5907
5945
|
ColorControl,
|
|
5908
5946
|
ControlActionsProvider,
|
|
5909
5947
|
ControlAdornments,
|