@elementor/editor-ui 0.11.0 → 0.13.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @elementor/editor-ui@0.11.0 build
2
+ > @elementor/editor-ui@0.13.0 build
3
3
  > tsup --config=../../tsup.build.ts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -10,13 +10,13 @@
10
10
  CLI Cleaning output folder
11
11
  ESM Build start
12
12
  CJS Build start
13
- CJS dist/index.js 14.50 KB
14
- CJS dist/index.js.map 23.69 KB
15
- CJS ⚡️ Build success in 97ms
16
- ESM dist/index.mjs 12.24 KB
17
- ESM dist/index.mjs.map 23.31 KB
18
- ESM ⚡️ Build success in 101ms
13
+ CJS dist/index.js 23.49 KB
14
+ CJS dist/index.js.map 40.38 KB
15
+ CJS ⚡️ Build success in 183ms
16
+ ESM dist/index.mjs 20.74 KB
17
+ ESM dist/index.mjs.map 39.98 KB
18
+ ESM ⚡️ Build success in 189ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 16816ms
21
- DTS dist/index.d.mts 3.47 KB
22
- DTS dist/index.d.ts 3.47 KB
20
+ DTS ⚡️ Build success in 21633ms
21
+ DTS dist/index.d.mts 5.18 KB
22
+ DTS dist/index.d.ts 5.18 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @elementor/editor-ui
2
2
 
3
+ ## 0.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - c91168a: Update the virtualization of the sticky menu list items in the popover.
8
+ - bfe6b0b: Update the width settings for the popover selection list.
9
+ - d85ca8c: Update the popover styling for version 3.30.
10
+
11
+ ### Patch Changes
12
+
13
+ - @elementor/editor-v1-adapters@0.12.1
14
+
15
+ ## 0.12.0
16
+
17
+ ### Minor Changes
18
+
19
+ - da0c4ca: Ability to search variables by name
20
+ - 17b73ab: Update `@elementor/ui` version.
21
+ - 7a4178f: Remove alert custom styling.
22
+ - 8e18905: Update the autofocus and padding of the popover search component.
23
+ - 3daa1c9: Extract font family content list to a standalone component inside the Editor UI package.
24
+ - 40d00c2: Implement the Popover Menu List inside the Dynamic Tags and the Variables.
25
+ - d5e9011: Implement the Popover Search component inside the Dynamic Tags, Font Families and the Variables.
26
+ - f37c325: Extract the popover scrollable content box to a standalone component inside the Editor UI package.
27
+
3
28
  ## 0.11.0
4
29
 
5
30
  ### Minor Changes
package/dist/index.d.mts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as React$1 from 'react';
2
2
  import { ReactNode, PropsWithChildren } from 'react';
3
- import { MenuItemProps, SxProps, InfotipProps } from '@elementor/ui';
3
+ import { MenuItemProps, AlertProps, InfotipProps, MenuList } from '@elementor/ui';
4
+ import * as _emotion_styled from '@emotion/styled';
4
5
 
5
6
  type EllipsisWithTooltipProps<T extends React$1.ElementType> = {
6
7
  maxWidth?: React$1.CSSProperties['maxWidth'];
@@ -45,10 +46,7 @@ type InfoTipCardProps = {
45
46
  };
46
47
  declare const InfoTipCard: ({ content, svgIcon, learnMoreButton, ctaButton }: InfoTipCardProps) => React$1.JSX.Element;
47
48
 
48
- declare const InfoAlert: ({ content, sx }: {
49
- content: string;
50
- sx?: SxProps;
51
- }) => React$1.JSX.Element;
49
+ declare const InfoAlert: (props: AlertProps) => React$1.JSX.Element;
52
50
 
53
51
  interface WarningInfotipProps extends PropsWithChildren {
54
52
  open: boolean;
@@ -68,6 +66,48 @@ type PopoverHeaderProps = {
68
66
  };
69
67
  declare const PopoverHeader: ({ title, onClose, icon, actions }: PopoverHeaderProps) => React$1.JSX.Element;
70
68
 
69
+ type VirtualizedItem<T, V extends string> = {
70
+ type: T;
71
+ value: V;
72
+ label?: string;
73
+ icon?: React$1.ReactNode;
74
+ secondaryText?: string;
75
+ [key: string]: unknown;
76
+ };
77
+ type PopoverMenuListProps<T, V extends string> = {
78
+ items: VirtualizedItem<T, V>[];
79
+ onSelect: (value: V) => void;
80
+ onClose: () => void;
81
+ selectedValue?: V;
82
+ itemStyle?: (item: VirtualizedItem<T, V>) => React$1.CSSProperties;
83
+ 'data-testid'?: string;
84
+ onChange?: (params: {
85
+ getVirtualIndexes: () => number[];
86
+ }) => void;
87
+ menuListTemplate?: React$1.ComponentType<React$1.ComponentProps<typeof MenuList>>;
88
+ menuItemContentTemplate?: (item: VirtualizedItem<T, V>) => React$1.ReactNode;
89
+ noResultsComponent?: React$1.ReactNode;
90
+ };
91
+ declare const ITEM_HEIGHT = 32;
92
+ declare const PopoverMenuList: <T, V extends string>({ items, onSelect, onClose, selectedValue, itemStyle, onChange, "data-testid": dataTestId, menuItemContentTemplate, noResultsComponent, menuListTemplate: CustomMenuList, }: PopoverMenuListProps<T, V>) => React$1.JSX.Element;
93
+ declare const StyledMenuList: _emotion_styled.StyledComponent<any, {}, {
94
+ ref?: React$1.Ref<any> | undefined;
95
+ }>;
96
+
97
+ declare const PopoverScrollableContent: React$1.ForwardRefExoticComponent<{
98
+ height?: number | "auto";
99
+ width?: number;
100
+ } & {
101
+ children?: React$1.ReactNode | undefined;
102
+ } & React$1.RefAttributes<HTMLDivElement>>;
103
+
104
+ type Props = {
105
+ value: string;
106
+ onSearch: (search: string) => void;
107
+ placeholder: string;
108
+ };
109
+ declare const PopoverSearch: ({ value, onSearch, placeholder }: Props) => React$1.JSX.Element;
110
+
71
111
  type UseEditableParams = {
72
112
  value: string;
73
113
  onSubmit: (value: string) => unknown;
@@ -94,4 +134,4 @@ declare const useEditable: ({ value, onSubmit, validation, onClick, onError }: U
94
134
  };
95
135
  };
96
136
 
97
- export { EditableField, EllipsisWithTooltip, InfoAlert, InfoTipCard, IntroductionModal, MenuItemInfotip, MenuListItem, PopoverHeader, ThemeProvider, WarningInfotip, useEditable };
137
+ export { EditableField, EllipsisWithTooltip, ITEM_HEIGHT, InfoAlert, InfoTipCard, IntroductionModal, MenuItemInfotip, MenuListItem, PopoverHeader, PopoverMenuList, type PopoverMenuListProps, PopoverScrollableContent, PopoverSearch, StyledMenuList, ThemeProvider, type VirtualizedItem, WarningInfotip, useEditable };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as React$1 from 'react';
2
2
  import { ReactNode, PropsWithChildren } from 'react';
3
- import { MenuItemProps, SxProps, InfotipProps } from '@elementor/ui';
3
+ import { MenuItemProps, AlertProps, InfotipProps, MenuList } from '@elementor/ui';
4
+ import * as _emotion_styled from '@emotion/styled';
4
5
 
5
6
  type EllipsisWithTooltipProps<T extends React$1.ElementType> = {
6
7
  maxWidth?: React$1.CSSProperties['maxWidth'];
@@ -45,10 +46,7 @@ type InfoTipCardProps = {
45
46
  };
46
47
  declare const InfoTipCard: ({ content, svgIcon, learnMoreButton, ctaButton }: InfoTipCardProps) => React$1.JSX.Element;
47
48
 
48
- declare const InfoAlert: ({ content, sx }: {
49
- content: string;
50
- sx?: SxProps;
51
- }) => React$1.JSX.Element;
49
+ declare const InfoAlert: (props: AlertProps) => React$1.JSX.Element;
52
50
 
53
51
  interface WarningInfotipProps extends PropsWithChildren {
54
52
  open: boolean;
@@ -68,6 +66,48 @@ type PopoverHeaderProps = {
68
66
  };
69
67
  declare const PopoverHeader: ({ title, onClose, icon, actions }: PopoverHeaderProps) => React$1.JSX.Element;
70
68
 
69
+ type VirtualizedItem<T, V extends string> = {
70
+ type: T;
71
+ value: V;
72
+ label?: string;
73
+ icon?: React$1.ReactNode;
74
+ secondaryText?: string;
75
+ [key: string]: unknown;
76
+ };
77
+ type PopoverMenuListProps<T, V extends string> = {
78
+ items: VirtualizedItem<T, V>[];
79
+ onSelect: (value: V) => void;
80
+ onClose: () => void;
81
+ selectedValue?: V;
82
+ itemStyle?: (item: VirtualizedItem<T, V>) => React$1.CSSProperties;
83
+ 'data-testid'?: string;
84
+ onChange?: (params: {
85
+ getVirtualIndexes: () => number[];
86
+ }) => void;
87
+ menuListTemplate?: React$1.ComponentType<React$1.ComponentProps<typeof MenuList>>;
88
+ menuItemContentTemplate?: (item: VirtualizedItem<T, V>) => React$1.ReactNode;
89
+ noResultsComponent?: React$1.ReactNode;
90
+ };
91
+ declare const ITEM_HEIGHT = 32;
92
+ declare const PopoverMenuList: <T, V extends string>({ items, onSelect, onClose, selectedValue, itemStyle, onChange, "data-testid": dataTestId, menuItemContentTemplate, noResultsComponent, menuListTemplate: CustomMenuList, }: PopoverMenuListProps<T, V>) => React$1.JSX.Element;
93
+ declare const StyledMenuList: _emotion_styled.StyledComponent<any, {}, {
94
+ ref?: React$1.Ref<any> | undefined;
95
+ }>;
96
+
97
+ declare const PopoverScrollableContent: React$1.ForwardRefExoticComponent<{
98
+ height?: number | "auto";
99
+ width?: number;
100
+ } & {
101
+ children?: React$1.ReactNode | undefined;
102
+ } & React$1.RefAttributes<HTMLDivElement>>;
103
+
104
+ type Props = {
105
+ value: string;
106
+ onSearch: (search: string) => void;
107
+ placeholder: string;
108
+ };
109
+ declare const PopoverSearch: ({ value, onSearch, placeholder }: Props) => React$1.JSX.Element;
110
+
71
111
  type UseEditableParams = {
72
112
  value: string;
73
113
  onSubmit: (value: string) => unknown;
@@ -94,4 +134,4 @@ declare const useEditable: ({ value, onSubmit, validation, onClick, onError }: U
94
134
  };
95
135
  };
96
136
 
97
- export { EditableField, EllipsisWithTooltip, InfoAlert, InfoTipCard, IntroductionModal, MenuItemInfotip, MenuListItem, PopoverHeader, ThemeProvider, WarningInfotip, useEditable };
137
+ export { EditableField, EllipsisWithTooltip, ITEM_HEIGHT, InfoAlert, InfoTipCard, IntroductionModal, MenuItemInfotip, MenuListItem, PopoverHeader, PopoverMenuList, type PopoverMenuListProps, PopoverScrollableContent, PopoverSearch, StyledMenuList, ThemeProvider, type VirtualizedItem, WarningInfotip, useEditable };
package/dist/index.js CHANGED
@@ -32,12 +32,17 @@ var index_exports = {};
32
32
  __export(index_exports, {
33
33
  EditableField: () => EditableField,
34
34
  EllipsisWithTooltip: () => EllipsisWithTooltip,
35
+ ITEM_HEIGHT: () => ITEM_HEIGHT,
35
36
  InfoAlert: () => InfoAlert,
36
37
  InfoTipCard: () => InfoTipCard,
37
38
  IntroductionModal: () => IntroductionModal,
38
39
  MenuItemInfotip: () => MenuItemInfotip,
39
40
  MenuListItem: () => MenuListItem,
40
41
  PopoverHeader: () => PopoverHeader,
42
+ PopoverMenuList: () => PopoverMenuList,
43
+ PopoverScrollableContent: () => PopoverScrollableContent,
44
+ PopoverSearch: () => PopoverSearch,
45
+ StyledMenuList: () => StyledMenuList,
41
46
  ThemeProvider: () => ThemeProvider,
42
47
  WarningInfotip: () => WarningInfotip,
43
48
  useEditable: () => useEditable
@@ -190,22 +195,17 @@ var import_ui6 = require("@elementor/ui");
190
195
  var React5 = __toESM(require("react"));
191
196
  var import_icons = require("@elementor/icons");
192
197
  var import_ui5 = require("@elementor/ui");
193
- var InfoAlert = ({ content, sx }) => {
194
- return /* @__PURE__ */ React5.createElement(
195
- import_ui5.Alert,
196
- {
197
- sx: (theme) => ({
198
- ".MuiAlert-icon": { fontSize: "1.25rem", marginRight: theme.spacing(0.5) },
199
- ...sx
200
- }),
201
- icon: /* @__PURE__ */ React5.createElement(import_icons.InfoCircleFilledIcon, { fontSize: "small", color: "secondary" }),
202
- variant: "standard",
203
- color: "secondary",
204
- elevation: 0
205
- },
206
- /* @__PURE__ */ React5.createElement(import_ui5.Stack, null, /* @__PURE__ */ React5.createElement(import_ui5.Typography, { variant: "caption", color: "text.primary" }, content))
207
- );
208
- };
198
+ var InfoAlert = (props) => /* @__PURE__ */ React5.createElement(
199
+ import_ui5.Alert,
200
+ {
201
+ icon: /* @__PURE__ */ React5.createElement(import_icons.InfoCircleFilledIcon, { fontSize: "small", color: "secondary" }),
202
+ variant: "standard",
203
+ color: "secondary",
204
+ elevation: 0,
205
+ size: "small",
206
+ ...props
207
+ }
208
+ );
209
209
 
210
210
  // src/components/menu-item.tsx
211
211
  var MenuListItem = ({ children, ...props }) => {
@@ -240,7 +240,7 @@ var MenuItemInfotip = (0, import_react5.forwardRef)(
240
240
  ref,
241
241
  placement: "right",
242
242
  arrow: false,
243
- content: /* @__PURE__ */ React6.createElement(InfoAlert, { content, sx: { maxWidth: 325 } })
243
+ content: /* @__PURE__ */ React6.createElement(InfoAlert, { sx: { maxWidth: 325 } }, content)
244
244
  },
245
245
  /* @__PURE__ */ React6.createElement("div", { style: { pointerEvents: "initial", width: "100%" }, onClick: (e) => e.stopPropagation() }, children)
246
246
  );
@@ -274,19 +274,7 @@ var WarningInfotip = (0, import_react6.forwardRef)(
274
274
  modifiers: offset ? [{ name: "offset", options: { offset } }] : []
275
275
  },
276
276
  arrow: false,
277
- content: /* @__PURE__ */ React8.createElement(
278
- import_ui8.Alert,
279
- {
280
- color: "error",
281
- severity: "warning",
282
- variant: "standard",
283
- sx: (theme) => ({
284
- ".MuiAlert-icon": { fontSize: "1.25rem", marginRight: theme.spacing(0.5) }
285
- })
286
- },
287
- title ? /* @__PURE__ */ React8.createElement(import_ui8.AlertTitle, null, title) : null,
288
- /* @__PURE__ */ React8.createElement(import_ui8.Typography, { variant: "caption", sx: { color: "text.primary" } }, text)
289
- )
277
+ content: /* @__PURE__ */ React8.createElement(import_ui8.Alert, { color: "error", severity: "warning", variant: "standard", size: "small" }, title ? /* @__PURE__ */ React8.createElement(import_ui8.AlertTitle, null, title) : null, text)
290
278
  },
291
279
  children
292
280
  );
@@ -295,15 +283,303 @@ var WarningInfotip = (0, import_react6.forwardRef)(
295
283
 
296
284
  // src/components/popover/header.tsx
297
285
  var React9 = __toESM(require("react"));
286
+ var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
298
287
  var import_ui9 = require("@elementor/ui");
299
288
  var SIZE = "tiny";
300
- var PopoverHeader = ({ title, onClose, icon, actions }) => /* @__PURE__ */ React9.createElement(import_ui9.Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5, sx: { columnGap: 0.5 } }, icon, /* @__PURE__ */ React9.createElement(import_ui9.Typography, { variant: "subtitle2" }, title), /* @__PURE__ */ React9.createElement(import_ui9.Stack, { direction: "row", sx: { ml: "auto" } }, actions, /* @__PURE__ */ React9.createElement(import_ui9.CloseButton, { slotProps: { icon: { fontSize: SIZE } }, sx: { ml: "auto" }, onClick: onClose })));
289
+ var isVersion330Active = (0, import_editor_v1_adapters2.isExperimentActive)("e_v_3_30");
290
+ var PopoverHeader = ({ title, onClose, icon, actions }) => {
291
+ const paddingAndSizing = isVersion330Active ? {
292
+ pl: 2,
293
+ pr: 1,
294
+ py: 1.5,
295
+ maxHeight: 36
296
+ } : {
297
+ pl: 1.5,
298
+ pr: 0.5,
299
+ py: 1.5
300
+ };
301
+ return /* @__PURE__ */ React9.createElement(import_ui9.Stack, { direction: "row", alignItems: "center", ...paddingAndSizing, sx: { columnGap: 0.5 } }, icon, /* @__PURE__ */ React9.createElement(
302
+ import_ui9.Typography,
303
+ {
304
+ variant: "subtitle2",
305
+ sx: isVersion330Active ? {
306
+ fontSize: "12px",
307
+ mt: 0.25
308
+ } : void 0
309
+ },
310
+ title
311
+ ), /* @__PURE__ */ React9.createElement(import_ui9.Stack, { direction: "row", sx: { ml: "auto" } }, actions, /* @__PURE__ */ React9.createElement(import_ui9.CloseButton, { slotProps: { icon: { fontSize: SIZE } }, sx: { ml: "auto" }, onClick: onClose })));
312
+ };
301
313
 
302
- // src/hooks/use-editable.ts
314
+ // src/components/popover/menu-list.tsx
315
+ var React10 = __toESM(require("react"));
316
+ var import_react9 = require("react");
317
+ var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
318
+ var import_ui10 = require("@elementor/ui");
319
+ var import_react_virtual = require("@tanstack/react-virtual");
320
+
321
+ // src/hooks/use-scroll-to-selected.ts
303
322
  var import_react7 = require("react");
323
+ var useScrollToSelected = ({
324
+ selectedValue,
325
+ items,
326
+ virtualizer
327
+ }) => {
328
+ (0, import_react7.useEffect)(() => {
329
+ if (!selectedValue || items.length === 0) {
330
+ return;
331
+ }
332
+ const selectedIndex = items.findIndex((item) => item.value === selectedValue);
333
+ if (selectedIndex !== -1) {
334
+ virtualizer.scrollToIndex(selectedIndex, { align: "center" });
335
+ }
336
+ }, [selectedValue, items, virtualizer]);
337
+ };
338
+
339
+ // src/hooks/use-scroll-top.ts
340
+ var import_react8 = require("react");
341
+ var useScrollTop = ({ containerRef }) => {
342
+ const [scrollTop, setScrollTop] = (0, import_react8.useState)(0);
343
+ (0, import_react8.useEffect)(() => {
344
+ const container = containerRef.current;
345
+ if (!container) {
346
+ return;
347
+ }
348
+ const handleScroll = () => {
349
+ setScrollTop(container.scrollTop);
350
+ };
351
+ container.addEventListener("scroll", handleScroll);
352
+ return () => container.removeEventListener("scroll", handleScroll);
353
+ }, [containerRef]);
354
+ return scrollTop;
355
+ };
356
+
357
+ // src/components/popover/menu-list.tsx
358
+ var isVersion330Active2 = (0, import_editor_v1_adapters3.isExperimentActive)("e_v_3_30");
359
+ var ITEM_HEIGHT = 32;
360
+ var LIST_ITEMS_BUFFER = 6;
361
+ var MENU_LIST_PADDING_TOP = 8;
362
+ var menuSubHeaderAbsoluteStyling = (start) => ({
363
+ position: "absolute",
364
+ transform: `translateY(${start + MENU_LIST_PADDING_TOP}px)`
365
+ });
366
+ var getAdjacentStickyIndices = (stickyIndices, range) => {
367
+ const previousTwoStickyIndices = stickyIndices.filter((stickyIndex) => stickyIndex < range.startIndex).slice(-2);
368
+ const nextTwoStickyIndices = stickyIndices.filter((stickyIndex) => stickyIndex > range.endIndex).slice(0, 2);
369
+ return [...previousTwoStickyIndices, ...nextTwoStickyIndices];
370
+ };
371
+ var PopoverMenuList = ({
372
+ items,
373
+ onSelect,
374
+ onClose,
375
+ selectedValue,
376
+ itemStyle,
377
+ onChange,
378
+ "data-testid": dataTestId,
379
+ menuItemContentTemplate,
380
+ noResultsComponent,
381
+ menuListTemplate: CustomMenuList
382
+ }) => {
383
+ const containerRef = (0, import_react9.useRef)(null);
384
+ const scrollTop = useScrollTop({ containerRef });
385
+ const MenuListComponent = CustomMenuList || StyledMenuList;
386
+ const stickyIndices = (0, import_react9.useMemo)(
387
+ () => items.reduce((categoryIndices, item, index) => {
388
+ if (item.type === "category") {
389
+ categoryIndices.push(index);
390
+ }
391
+ return categoryIndices;
392
+ }, []),
393
+ [items]
394
+ );
395
+ const getActiveItemIndices = (range) => {
396
+ const visibleAndStickyIndexes = [];
397
+ for (let i = range.startIndex; i <= range.endIndex; i++) {
398
+ visibleAndStickyIndexes.push(i);
399
+ }
400
+ const stickyIndicesToShow = getAdjacentStickyIndices(stickyIndices, range);
401
+ stickyIndicesToShow.forEach((stickyIndex) => {
402
+ if (!visibleAndStickyIndexes.includes(stickyIndex)) {
403
+ visibleAndStickyIndexes.push(stickyIndex);
404
+ }
405
+ });
406
+ return visibleAndStickyIndexes.sort((a, b) => a - b);
407
+ };
408
+ const virtualizer = (0, import_react_virtual.useVirtualizer)({
409
+ count: items.length,
410
+ getScrollElement: () => containerRef.current,
411
+ estimateSize: () => ITEM_HEIGHT,
412
+ overscan: LIST_ITEMS_BUFFER,
413
+ rangeExtractor: getActiveItemIndices,
414
+ onChange
415
+ });
416
+ useScrollToSelected({ selectedValue, items, virtualizer });
417
+ return /* @__PURE__ */ React10.createElement(import_ui10.Box, { ref: containerRef }, items.length === 0 && noResultsComponent ? noResultsComponent : /* @__PURE__ */ React10.createElement(
418
+ MenuListComponent,
419
+ {
420
+ role: "listbox",
421
+ style: { height: `${virtualizer.getTotalSize()}px` },
422
+ "data-testid": dataTestId
423
+ },
424
+ virtualizer.getVirtualItems().map((virtualRow) => {
425
+ const item = items[virtualRow.index];
426
+ const isLast = virtualRow.index === items.length - 1;
427
+ const isFirst = items[0]?.type === "category" ? virtualRow.index === 1 : virtualRow.index === 0;
428
+ const isSelected = selectedValue === item.value;
429
+ const tabIndexFallback = !selectedValue ? 0 : -1;
430
+ if (!item) {
431
+ return null;
432
+ }
433
+ if (item.type === "category") {
434
+ const shouldStick = virtualRow.start + MENU_LIST_PADDING_TOP <= scrollTop;
435
+ return /* @__PURE__ */ React10.createElement(
436
+ import_ui10.MenuSubheader,
437
+ {
438
+ key: virtualRow.key,
439
+ style: shouldStick ? {} : menuSubHeaderAbsoluteStyling(virtualRow.start),
440
+ sx: isVersion330Active2 ? { fontWeight: "400", color: "text.tertiary" } : void 0
441
+ },
442
+ item.label || item.value
443
+ );
444
+ }
445
+ return /* @__PURE__ */ React10.createElement(
446
+ "li",
447
+ {
448
+ key: virtualRow.key,
449
+ role: "option",
450
+ "aria-selected": isSelected,
451
+ onClick: (e) => {
452
+ if (e.target.closest("button")) {
453
+ return;
454
+ }
455
+ onSelect(item.value);
456
+ onClose();
457
+ },
458
+ onKeyDown: (event) => {
459
+ if (event.key === "Enter") {
460
+ onSelect(item.value);
461
+ onClose();
462
+ }
463
+ if (event.key === "ArrowDown" && isLast) {
464
+ event.preventDefault();
465
+ event.stopPropagation();
466
+ }
467
+ if (event.key === "ArrowUp" && isFirst) {
468
+ event.preventDefault();
469
+ event.stopPropagation();
470
+ }
471
+ },
472
+ tabIndex: isSelected ? 0 : tabIndexFallback,
473
+ style: {
474
+ transform: `translateY(${virtualRow.start + MENU_LIST_PADDING_TOP}px)`,
475
+ ...itemStyle ? itemStyle(item) : {}
476
+ }
477
+ },
478
+ menuItemContentTemplate ? menuItemContentTemplate(item) : item.label || item.value
479
+ );
480
+ })
481
+ ));
482
+ };
483
+ var StyledMenuList = (0, import_ui10.styled)(import_ui10.MenuList)(({ theme }) => ({
484
+ "& > li": {
485
+ height: ITEM_HEIGHT,
486
+ width: "100%",
487
+ display: "flex",
488
+ alignItems: "center"
489
+ },
490
+ '& > [role="option"]': {
491
+ ...theme.typography.caption,
492
+ lineHeight: "inherit",
493
+ padding: theme.spacing(0.75, 2, 0.75, 4),
494
+ "&:hover, &:focus": {
495
+ backgroundColor: theme.palette.action.hover
496
+ },
497
+ '&[aria-selected="true"]': {
498
+ backgroundColor: theme.palette.action.selected
499
+ },
500
+ cursor: "pointer",
501
+ textOverflow: "ellipsis",
502
+ position: "absolute",
503
+ top: 0,
504
+ left: 0
505
+ },
506
+ width: "100%",
507
+ position: "relative"
508
+ }));
509
+
510
+ // src/components/popover/scrollable-content.tsx
511
+ var React11 = __toESM(require("react"));
512
+ var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
513
+ var import_ui11 = require("@elementor/ui");
514
+ var SECTION_PADDING_INLINE = 32;
515
+ var DEFAULT_POPOVER_WIDTH = 220;
516
+ var isVersion330Active3 = (0, import_editor_v1_adapters4.isExperimentActive)("e_v_3_30");
517
+ var PopoverScrollableContent = React11.forwardRef(
518
+ ({ children, height = 260, width = DEFAULT_POPOVER_WIDTH }, ref) => {
519
+ return /* @__PURE__ */ React11.createElement(
520
+ import_ui11.Box,
521
+ {
522
+ ref,
523
+ sx: {
524
+ overflowY: "auto",
525
+ height,
526
+ width: `${isVersion330Active3 ? width - SECTION_PADDING_INLINE : DEFAULT_POPOVER_WIDTH}px`,
527
+ maxWidth: 496
528
+ }
529
+ },
530
+ children
531
+ );
532
+ }
533
+ );
534
+
535
+ // src/components/popover/search.tsx
536
+ var React12 = __toESM(require("react"));
537
+ var import_react10 = require("react");
538
+ var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
539
+ var import_icons2 = require("@elementor/icons");
540
+ var import_ui12 = require("@elementor/ui");
541
+ var import_i18n2 = require("@wordpress/i18n");
542
+ var isVersion330Active4 = (0, import_editor_v1_adapters5.isExperimentActive)("e_v_3_30");
543
+ var SIZE2 = "tiny";
544
+ var PopoverSearch = ({ value, onSearch, placeholder }) => {
545
+ const inputRef = (0, import_react10.useRef)(null);
546
+ const handleClear = () => {
547
+ onSearch("");
548
+ inputRef.current?.focus();
549
+ };
550
+ const handleInputChange = (event) => {
551
+ onSearch(event.target.value);
552
+ };
553
+ const padding = isVersion330Active4 ? {
554
+ px: 2,
555
+ pb: 1.5
556
+ } : {
557
+ px: 1.5,
558
+ pb: 1
559
+ };
560
+ return /* @__PURE__ */ React12.createElement(import_ui12.Box, { ...padding }, /* @__PURE__ */ React12.createElement(
561
+ import_ui12.TextField,
562
+ {
563
+ autoFocus: true,
564
+ fullWidth: true,
565
+ size: SIZE2,
566
+ value,
567
+ inputRef,
568
+ onChange: handleInputChange,
569
+ placeholder,
570
+ InputProps: {
571
+ startAdornment: /* @__PURE__ */ React12.createElement(import_ui12.InputAdornment, { position: "start" }, /* @__PURE__ */ React12.createElement(import_icons2.SearchIcon, { fontSize: SIZE2 })),
572
+ endAdornment: value && /* @__PURE__ */ React12.createElement(import_ui12.IconButton, { size: SIZE2, onClick: handleClear, "aria-label": (0, import_i18n2.__)("Clear", "elementor") }, /* @__PURE__ */ React12.createElement(import_icons2.XIcon, { color: "action", fontSize: SIZE2 }))
573
+ }
574
+ }
575
+ ));
576
+ };
577
+
578
+ // src/hooks/use-editable.ts
579
+ var import_react11 = require("react");
304
580
  var useEditable = ({ value, onSubmit, validation, onClick, onError }) => {
305
- const [isEditing, setIsEditing] = (0, import_react7.useState)(false);
306
- const [error, setError] = (0, import_react7.useState)(null);
581
+ const [isEditing, setIsEditing] = (0, import_react11.useState)(false);
582
+ const [error, setError] = (0, import_react11.useState)(null);
307
583
  const ref = useSelection(isEditing);
308
584
  const isDirty = (newValue) => newValue !== value;
309
585
  const openEditMode = () => {
@@ -376,8 +652,8 @@ var useEditable = ({ value, onSubmit, validation, onClick, onError }) => {
376
652
  };
377
653
  };
378
654
  var useSelection = (isEditing) => {
379
- const ref = (0, import_react7.useRef)(null);
380
- (0, import_react7.useEffect)(() => {
655
+ const ref = (0, import_react11.useRef)(null);
656
+ (0, import_react11.useEffect)(() => {
381
657
  if (isEditing) {
382
658
  selectAll(ref.current);
383
659
  }
@@ -398,12 +674,17 @@ var selectAll = (el) => {
398
674
  0 && (module.exports = {
399
675
  EditableField,
400
676
  EllipsisWithTooltip,
677
+ ITEM_HEIGHT,
401
678
  InfoAlert,
402
679
  InfoTipCard,
403
680
  IntroductionModal,
404
681
  MenuItemInfotip,
405
682
  MenuListItem,
406
683
  PopoverHeader,
684
+ PopoverMenuList,
685
+ PopoverScrollableContent,
686
+ PopoverSearch,
687
+ StyledMenuList,
407
688
  ThemeProvider,
408
689
  WarningInfotip,
409
690
  useEditable