@elementor/editor-ui 3.33.0-155 → 3.33.0-157
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 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +60 -60
- package/dist/index.mjs +50 -50
- package/package.json +2 -2
- package/src/components/popover/index.ts +0 -1
- package/src/components/{popover/search.tsx → search-field.tsx} +1 -1
- package/src/index.ts +2 -0
package/dist/index.d.mts
CHANGED
|
@@ -67,6 +67,14 @@ type DialogContent = {
|
|
|
67
67
|
declare const openDialog: ({ component }: DialogContent) => void;
|
|
68
68
|
declare const closeDialog: () => void;
|
|
69
69
|
|
|
70
|
+
type Props = {
|
|
71
|
+
value: string;
|
|
72
|
+
onSearch: (search: string) => void;
|
|
73
|
+
placeholder: string;
|
|
74
|
+
id?: string;
|
|
75
|
+
};
|
|
76
|
+
declare const SearchField: ({ value, onSearch, placeholder, id }: Props) => React$1.JSX.Element;
|
|
77
|
+
|
|
70
78
|
type PopoverBodyProps = PropsWithChildren<{
|
|
71
79
|
height?: number | 'auto';
|
|
72
80
|
width?: number;
|
|
@@ -111,14 +119,6 @@ declare const StyledMenuList: _emotion_styled.StyledComponent<any, {}, {
|
|
|
111
119
|
ref?: React$1.Ref<any> | undefined;
|
|
112
120
|
}>;
|
|
113
121
|
|
|
114
|
-
type Props = {
|
|
115
|
-
value: string;
|
|
116
|
-
onSearch: (search: string) => void;
|
|
117
|
-
placeholder: string;
|
|
118
|
-
id?: string;
|
|
119
|
-
};
|
|
120
|
-
declare const PopoverSearch: ({ value, onSearch, placeholder, id }: Props) => React$1.JSX.Element;
|
|
121
|
-
|
|
122
122
|
declare const SaveChangesDialog: {
|
|
123
123
|
({ children, onClose }: Pick<DialogProps, "children" | "onClose">): React$1.JSX.Element;
|
|
124
124
|
Title: ({ children, onClose }: React$1.PropsWithChildren & {
|
|
@@ -171,4 +171,4 @@ declare const useEditable: ({ value, onSubmit, validation, onClick, onError }: U
|
|
|
171
171
|
};
|
|
172
172
|
};
|
|
173
173
|
|
|
174
|
-
export { EditableField, EllipsisWithTooltip, GlobalDialog, ITEM_HEIGHT, InfoAlert, InfoTipCard, IntroductionModal, MenuItemInfotip, MenuListItem, PopoverBody, PopoverHeader, PopoverMenuList, type PopoverMenuListProps,
|
|
174
|
+
export { EditableField, EllipsisWithTooltip, GlobalDialog, ITEM_HEIGHT, InfoAlert, InfoTipCard, IntroductionModal, MenuItemInfotip, MenuListItem, PopoverBody, PopoverHeader, PopoverMenuList, type PopoverMenuListProps, SaveChangesDialog, SearchField, StyledMenuList, ThemeProvider, type VirtualizedItem, WarningInfotip, closeDialog, openDialog, useDialog, useEditable };
|
package/dist/index.d.ts
CHANGED
|
@@ -67,6 +67,14 @@ type DialogContent = {
|
|
|
67
67
|
declare const openDialog: ({ component }: DialogContent) => void;
|
|
68
68
|
declare const closeDialog: () => void;
|
|
69
69
|
|
|
70
|
+
type Props = {
|
|
71
|
+
value: string;
|
|
72
|
+
onSearch: (search: string) => void;
|
|
73
|
+
placeholder: string;
|
|
74
|
+
id?: string;
|
|
75
|
+
};
|
|
76
|
+
declare const SearchField: ({ value, onSearch, placeholder, id }: Props) => React$1.JSX.Element;
|
|
77
|
+
|
|
70
78
|
type PopoverBodyProps = PropsWithChildren<{
|
|
71
79
|
height?: number | 'auto';
|
|
72
80
|
width?: number;
|
|
@@ -111,14 +119,6 @@ declare const StyledMenuList: _emotion_styled.StyledComponent<any, {}, {
|
|
|
111
119
|
ref?: React$1.Ref<any> | undefined;
|
|
112
120
|
}>;
|
|
113
121
|
|
|
114
|
-
type Props = {
|
|
115
|
-
value: string;
|
|
116
|
-
onSearch: (search: string) => void;
|
|
117
|
-
placeholder: string;
|
|
118
|
-
id?: string;
|
|
119
|
-
};
|
|
120
|
-
declare const PopoverSearch: ({ value, onSearch, placeholder, id }: Props) => React$1.JSX.Element;
|
|
121
|
-
|
|
122
122
|
declare const SaveChangesDialog: {
|
|
123
123
|
({ children, onClose }: Pick<DialogProps, "children" | "onClose">): React$1.JSX.Element;
|
|
124
124
|
Title: ({ children, onClose }: React$1.PropsWithChildren & {
|
|
@@ -171,4 +171,4 @@ declare const useEditable: ({ value, onSubmit, validation, onClick, onError }: U
|
|
|
171
171
|
};
|
|
172
172
|
};
|
|
173
173
|
|
|
174
|
-
export { EditableField, EllipsisWithTooltip, GlobalDialog, ITEM_HEIGHT, InfoAlert, InfoTipCard, IntroductionModal, MenuItemInfotip, MenuListItem, PopoverBody, PopoverHeader, PopoverMenuList, type PopoverMenuListProps,
|
|
174
|
+
export { EditableField, EllipsisWithTooltip, GlobalDialog, ITEM_HEIGHT, InfoAlert, InfoTipCard, IntroductionModal, MenuItemInfotip, MenuListItem, PopoverBody, PopoverHeader, PopoverMenuList, type PopoverMenuListProps, SaveChangesDialog, SearchField, StyledMenuList, ThemeProvider, type VirtualizedItem, WarningInfotip, closeDialog, openDialog, useDialog, useEditable };
|
package/dist/index.js
CHANGED
|
@@ -42,8 +42,8 @@ __export(index_exports, {
|
|
|
42
42
|
PopoverBody: () => PopoverBody,
|
|
43
43
|
PopoverHeader: () => PopoverHeader,
|
|
44
44
|
PopoverMenuList: () => PopoverMenuList,
|
|
45
|
-
PopoverSearch: () => PopoverSearch,
|
|
46
45
|
SaveChangesDialog: () => SaveChangesDialog,
|
|
46
|
+
SearchField: () => SearchField,
|
|
47
47
|
StyledMenuList: () => StyledMenuList,
|
|
48
48
|
ThemeProvider: () => ThemeProvider,
|
|
49
49
|
WarningInfotip: () => WarningInfotip,
|
|
@@ -346,15 +346,50 @@ var GlobalDialog = () => {
|
|
|
346
346
|
return /* @__PURE__ */ React9.createElement(ThemeProvider, null, /* @__PURE__ */ React9.createElement(import_ui9.Dialog, { role: "dialog", open: true, onClose: closeDialog, maxWidth: "sm", fullWidth: true }, content.component));
|
|
347
347
|
};
|
|
348
348
|
|
|
349
|
-
// src/components/
|
|
349
|
+
// src/components/search-field.tsx
|
|
350
350
|
var React10 = __toESM(require("react"));
|
|
351
|
+
var import_react8 = require("react");
|
|
352
|
+
var import_icons2 = require("@elementor/icons");
|
|
351
353
|
var import_ui10 = require("@elementor/ui");
|
|
354
|
+
var import_i18n2 = require("@wordpress/i18n");
|
|
355
|
+
var SIZE = "tiny";
|
|
356
|
+
var SearchField = ({ value, onSearch, placeholder, id }) => {
|
|
357
|
+
const inputRef = (0, import_react8.useRef)(null);
|
|
358
|
+
const handleClear = () => {
|
|
359
|
+
onSearch("");
|
|
360
|
+
inputRef.current?.focus();
|
|
361
|
+
};
|
|
362
|
+
const handleInputChange = (event) => {
|
|
363
|
+
onSearch(event.target.value);
|
|
364
|
+
};
|
|
365
|
+
return /* @__PURE__ */ React10.createElement(import_ui10.Box, { sx: { px: 2, pb: 1.5 } }, /* @__PURE__ */ React10.createElement(
|
|
366
|
+
import_ui10.TextField,
|
|
367
|
+
{
|
|
368
|
+
autoFocus: true,
|
|
369
|
+
fullWidth: true,
|
|
370
|
+
id,
|
|
371
|
+
size: SIZE,
|
|
372
|
+
value,
|
|
373
|
+
inputRef,
|
|
374
|
+
onChange: handleInputChange,
|
|
375
|
+
placeholder,
|
|
376
|
+
InputProps: {
|
|
377
|
+
startAdornment: /* @__PURE__ */ React10.createElement(import_ui10.InputAdornment, { position: "start" }, /* @__PURE__ */ React10.createElement(import_icons2.SearchIcon, { fontSize: SIZE })),
|
|
378
|
+
endAdornment: value && /* @__PURE__ */ React10.createElement(import_ui10.IconButton, { size: SIZE, onClick: handleClear, "aria-label": (0, import_i18n2.__)("Clear", "elementor") }, /* @__PURE__ */ React10.createElement(import_icons2.XIcon, { color: "action", fontSize: SIZE }))
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
));
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
// src/components/popover/body.tsx
|
|
385
|
+
var React11 = __toESM(require("react"));
|
|
386
|
+
var import_ui11 = require("@elementor/ui");
|
|
352
387
|
var SECTION_PADDING_INLINE = 32;
|
|
353
388
|
var DEFAULT_POPOVER_HEIGHT = 348;
|
|
354
389
|
var FALLBACK_POPOVER_WIDTH = 220;
|
|
355
390
|
var PopoverBody = ({ children, height = DEFAULT_POPOVER_HEIGHT, width, id }) => {
|
|
356
|
-
return /* @__PURE__ */
|
|
357
|
-
|
|
391
|
+
return /* @__PURE__ */ React11.createElement(
|
|
392
|
+
import_ui11.Box,
|
|
358
393
|
{
|
|
359
394
|
display: "flex",
|
|
360
395
|
flexDirection: "column",
|
|
@@ -371,9 +406,9 @@ var PopoverBody = ({ children, height = DEFAULT_POPOVER_HEIGHT, width, id }) =>
|
|
|
371
406
|
};
|
|
372
407
|
|
|
373
408
|
// src/components/popover/header.tsx
|
|
374
|
-
var
|
|
375
|
-
var
|
|
376
|
-
var
|
|
409
|
+
var React12 = __toESM(require("react"));
|
|
410
|
+
var import_ui12 = require("@elementor/ui");
|
|
411
|
+
var SIZE2 = "tiny";
|
|
377
412
|
var PopoverHeader = ({ title, onClose, icon, actions }) => {
|
|
378
413
|
const paddingAndSizing = {
|
|
379
414
|
pl: 2,
|
|
@@ -381,23 +416,23 @@ var PopoverHeader = ({ title, onClose, icon, actions }) => {
|
|
|
381
416
|
py: 1.5,
|
|
382
417
|
maxHeight: 36
|
|
383
418
|
};
|
|
384
|
-
return /* @__PURE__ */
|
|
419
|
+
return /* @__PURE__ */ React12.createElement(import_ui12.Stack, { direction: "row", alignItems: "center", ...paddingAndSizing, sx: { columnGap: 0.5 } }, icon, /* @__PURE__ */ React12.createElement(import_ui12.Typography, { variant: "subtitle2", sx: { fontSize: "12px", mt: 0.25 } }, title), /* @__PURE__ */ React12.createElement(import_ui12.Stack, { direction: "row", sx: { ml: "auto" } }, actions, /* @__PURE__ */ React12.createElement(import_ui12.CloseButton, { slotProps: { icon: { fontSize: SIZE2 } }, sx: { ml: "auto" }, onClick: onClose })));
|
|
385
420
|
};
|
|
386
421
|
|
|
387
422
|
// src/components/popover/menu-list.tsx
|
|
388
|
-
var
|
|
389
|
-
var
|
|
390
|
-
var
|
|
423
|
+
var React13 = __toESM(require("react"));
|
|
424
|
+
var import_react11 = require("react");
|
|
425
|
+
var import_ui13 = require("@elementor/ui");
|
|
391
426
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
392
427
|
|
|
393
428
|
// src/hooks/use-scroll-to-selected.ts
|
|
394
|
-
var
|
|
429
|
+
var import_react9 = require("react");
|
|
395
430
|
var useScrollToSelected = ({
|
|
396
431
|
selectedValue,
|
|
397
432
|
items,
|
|
398
433
|
virtualizer
|
|
399
434
|
}) => {
|
|
400
|
-
(0,
|
|
435
|
+
(0, import_react9.useEffect)(() => {
|
|
401
436
|
if (!selectedValue || items.length === 0) {
|
|
402
437
|
return;
|
|
403
438
|
}
|
|
@@ -409,10 +444,10 @@ var useScrollToSelected = ({
|
|
|
409
444
|
};
|
|
410
445
|
|
|
411
446
|
// src/hooks/use-scroll-top.ts
|
|
412
|
-
var
|
|
447
|
+
var import_react10 = require("react");
|
|
413
448
|
var useScrollTop = ({ containerRef }) => {
|
|
414
|
-
const [scrollTop, setScrollTop] = (0,
|
|
415
|
-
(0,
|
|
449
|
+
const [scrollTop, setScrollTop] = (0, import_react10.useState)(0);
|
|
450
|
+
(0, import_react10.useEffect)(() => {
|
|
416
451
|
const container = containerRef.current;
|
|
417
452
|
if (!container) {
|
|
418
453
|
return;
|
|
@@ -451,10 +486,10 @@ var PopoverMenuList = ({
|
|
|
451
486
|
noResultsComponent,
|
|
452
487
|
menuListTemplate: CustomMenuList
|
|
453
488
|
}) => {
|
|
454
|
-
const containerRef = (0,
|
|
489
|
+
const containerRef = (0, import_react11.useRef)(null);
|
|
455
490
|
const scrollTop = useScrollTop({ containerRef });
|
|
456
491
|
const MenuListComponent = CustomMenuList || StyledMenuList;
|
|
457
|
-
const stickyIndices = (0,
|
|
492
|
+
const stickyIndices = (0, import_react11.useMemo)(
|
|
458
493
|
() => items.reduce((categoryIndices, item, index) => {
|
|
459
494
|
if (item.type === "category") {
|
|
460
495
|
categoryIndices.push(index);
|
|
@@ -486,7 +521,7 @@ var PopoverMenuList = ({
|
|
|
486
521
|
});
|
|
487
522
|
useScrollToSelected({ selectedValue, items, virtualizer });
|
|
488
523
|
const virtualItems = virtualizer.getVirtualItems();
|
|
489
|
-
return /* @__PURE__ */
|
|
524
|
+
return /* @__PURE__ */ React13.createElement(import_ui13.Box, { ref: containerRef, sx: { height: "100%", overflowY: "auto" } }, items.length === 0 && noResultsComponent ? noResultsComponent : /* @__PURE__ */ React13.createElement(
|
|
490
525
|
MenuListComponent,
|
|
491
526
|
{
|
|
492
527
|
role: "listbox",
|
|
@@ -504,8 +539,8 @@ var PopoverMenuList = ({
|
|
|
504
539
|
}
|
|
505
540
|
if (item.type === "category") {
|
|
506
541
|
const shouldStick = virtualRow.start + MENU_LIST_PADDING_TOP <= scrollTop;
|
|
507
|
-
return /* @__PURE__ */
|
|
508
|
-
|
|
542
|
+
return /* @__PURE__ */ React13.createElement(
|
|
543
|
+
import_ui13.MenuSubheader,
|
|
509
544
|
{
|
|
510
545
|
key: virtualRow.key,
|
|
511
546
|
style: shouldStick ? {} : menuSubHeaderAbsoluteStyling(virtualRow.start),
|
|
@@ -515,8 +550,8 @@ var PopoverMenuList = ({
|
|
|
515
550
|
);
|
|
516
551
|
}
|
|
517
552
|
const isDisabled = item.disabled;
|
|
518
|
-
return /* @__PURE__ */
|
|
519
|
-
|
|
553
|
+
return /* @__PURE__ */ React13.createElement(
|
|
554
|
+
import_ui13.ListItem,
|
|
520
555
|
{
|
|
521
556
|
key: virtualRow.key,
|
|
522
557
|
role: "option",
|
|
@@ -554,7 +589,7 @@ var PopoverMenuList = ({
|
|
|
554
589
|
})
|
|
555
590
|
));
|
|
556
591
|
};
|
|
557
|
-
var StyledMenuList = (0,
|
|
592
|
+
var StyledMenuList = (0, import_ui13.styled)(import_ui13.MenuList)(({ theme }) => ({
|
|
558
593
|
"& > li": {
|
|
559
594
|
height: ITEM_HEIGHT,
|
|
560
595
|
width: "100%",
|
|
@@ -584,41 +619,6 @@ var StyledMenuList = (0, import_ui12.styled)(import_ui12.MenuList)(({ theme }) =
|
|
|
584
619
|
position: "relative"
|
|
585
620
|
}));
|
|
586
621
|
|
|
587
|
-
// src/components/popover/search.tsx
|
|
588
|
-
var React13 = __toESM(require("react"));
|
|
589
|
-
var import_react11 = require("react");
|
|
590
|
-
var import_icons2 = require("@elementor/icons");
|
|
591
|
-
var import_ui13 = require("@elementor/ui");
|
|
592
|
-
var import_i18n2 = require("@wordpress/i18n");
|
|
593
|
-
var SIZE2 = "tiny";
|
|
594
|
-
var PopoverSearch = ({ value, onSearch, placeholder, id }) => {
|
|
595
|
-
const inputRef = (0, import_react11.useRef)(null);
|
|
596
|
-
const handleClear = () => {
|
|
597
|
-
onSearch("");
|
|
598
|
-
inputRef.current?.focus();
|
|
599
|
-
};
|
|
600
|
-
const handleInputChange = (event) => {
|
|
601
|
-
onSearch(event.target.value);
|
|
602
|
-
};
|
|
603
|
-
return /* @__PURE__ */ React13.createElement(import_ui13.Box, { sx: { px: 2, pb: 1.5 } }, /* @__PURE__ */ React13.createElement(
|
|
604
|
-
import_ui13.TextField,
|
|
605
|
-
{
|
|
606
|
-
autoFocus: true,
|
|
607
|
-
fullWidth: true,
|
|
608
|
-
id,
|
|
609
|
-
size: SIZE2,
|
|
610
|
-
value,
|
|
611
|
-
inputRef,
|
|
612
|
-
onChange: handleInputChange,
|
|
613
|
-
placeholder,
|
|
614
|
-
InputProps: {
|
|
615
|
-
startAdornment: /* @__PURE__ */ React13.createElement(import_ui13.InputAdornment, { position: "start" }, /* @__PURE__ */ React13.createElement(import_icons2.SearchIcon, { fontSize: SIZE2 })),
|
|
616
|
-
endAdornment: value && /* @__PURE__ */ React13.createElement(import_ui13.IconButton, { size: SIZE2, onClick: handleClear, "aria-label": (0, import_i18n2.__)("Clear", "elementor") }, /* @__PURE__ */ React13.createElement(import_icons2.XIcon, { color: "action", fontSize: SIZE2 }))
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
));
|
|
620
|
-
};
|
|
621
|
-
|
|
622
622
|
// src/components/save-changes-dialog.tsx
|
|
623
623
|
var React14 = __toESM(require("react"));
|
|
624
624
|
var import_react12 = require("react");
|
|
@@ -770,8 +770,8 @@ var selectAll = (el) => {
|
|
|
770
770
|
PopoverBody,
|
|
771
771
|
PopoverHeader,
|
|
772
772
|
PopoverMenuList,
|
|
773
|
-
PopoverSearch,
|
|
774
773
|
SaveChangesDialog,
|
|
774
|
+
SearchField,
|
|
775
775
|
StyledMenuList,
|
|
776
776
|
ThemeProvider,
|
|
777
777
|
WarningInfotip,
|
package/dist/index.mjs
CHANGED
|
@@ -304,15 +304,50 @@ var GlobalDialog = () => {
|
|
|
304
304
|
return /* @__PURE__ */ React9.createElement(ThemeProvider, null, /* @__PURE__ */ React9.createElement(Dialog2, { role: "dialog", open: true, onClose: closeDialog, maxWidth: "sm", fullWidth: true }, content.component));
|
|
305
305
|
};
|
|
306
306
|
|
|
307
|
-
// src/components/
|
|
307
|
+
// src/components/search-field.tsx
|
|
308
308
|
import * as React10 from "react";
|
|
309
|
-
import {
|
|
309
|
+
import { useRef } from "react";
|
|
310
|
+
import { SearchIcon, XIcon } from "@elementor/icons";
|
|
311
|
+
import { Box as Box4, IconButton, InputAdornment, TextField } from "@elementor/ui";
|
|
312
|
+
import { __ as __2 } from "@wordpress/i18n";
|
|
313
|
+
var SIZE = "tiny";
|
|
314
|
+
var SearchField = ({ value, onSearch, placeholder, id }) => {
|
|
315
|
+
const inputRef = useRef(null);
|
|
316
|
+
const handleClear = () => {
|
|
317
|
+
onSearch("");
|
|
318
|
+
inputRef.current?.focus();
|
|
319
|
+
};
|
|
320
|
+
const handleInputChange = (event) => {
|
|
321
|
+
onSearch(event.target.value);
|
|
322
|
+
};
|
|
323
|
+
return /* @__PURE__ */ React10.createElement(Box4, { sx: { px: 2, pb: 1.5 } }, /* @__PURE__ */ React10.createElement(
|
|
324
|
+
TextField,
|
|
325
|
+
{
|
|
326
|
+
autoFocus: true,
|
|
327
|
+
fullWidth: true,
|
|
328
|
+
id,
|
|
329
|
+
size: SIZE,
|
|
330
|
+
value,
|
|
331
|
+
inputRef,
|
|
332
|
+
onChange: handleInputChange,
|
|
333
|
+
placeholder,
|
|
334
|
+
InputProps: {
|
|
335
|
+
startAdornment: /* @__PURE__ */ React10.createElement(InputAdornment, { position: "start" }, /* @__PURE__ */ React10.createElement(SearchIcon, { fontSize: SIZE })),
|
|
336
|
+
endAdornment: value && /* @__PURE__ */ React10.createElement(IconButton, { size: SIZE, onClick: handleClear, "aria-label": __2("Clear", "elementor") }, /* @__PURE__ */ React10.createElement(XIcon, { color: "action", fontSize: SIZE }))
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
));
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
// src/components/popover/body.tsx
|
|
343
|
+
import * as React11 from "react";
|
|
344
|
+
import { Box as Box5 } from "@elementor/ui";
|
|
310
345
|
var SECTION_PADDING_INLINE = 32;
|
|
311
346
|
var DEFAULT_POPOVER_HEIGHT = 348;
|
|
312
347
|
var FALLBACK_POPOVER_WIDTH = 220;
|
|
313
348
|
var PopoverBody = ({ children, height = DEFAULT_POPOVER_HEIGHT, width, id }) => {
|
|
314
|
-
return /* @__PURE__ */
|
|
315
|
-
|
|
349
|
+
return /* @__PURE__ */ React11.createElement(
|
|
350
|
+
Box5,
|
|
316
351
|
{
|
|
317
352
|
display: "flex",
|
|
318
353
|
flexDirection: "column",
|
|
@@ -329,9 +364,9 @@ var PopoverBody = ({ children, height = DEFAULT_POPOVER_HEIGHT, width, id }) =>
|
|
|
329
364
|
};
|
|
330
365
|
|
|
331
366
|
// src/components/popover/header.tsx
|
|
332
|
-
import * as
|
|
367
|
+
import * as React12 from "react";
|
|
333
368
|
import { CloseButton, Stack, Typography as Typography3 } from "@elementor/ui";
|
|
334
|
-
var
|
|
369
|
+
var SIZE2 = "tiny";
|
|
335
370
|
var PopoverHeader = ({ title, onClose, icon, actions }) => {
|
|
336
371
|
const paddingAndSizing = {
|
|
337
372
|
pl: 2,
|
|
@@ -339,13 +374,13 @@ var PopoverHeader = ({ title, onClose, icon, actions }) => {
|
|
|
339
374
|
py: 1.5,
|
|
340
375
|
maxHeight: 36
|
|
341
376
|
};
|
|
342
|
-
return /* @__PURE__ */
|
|
377
|
+
return /* @__PURE__ */ React12.createElement(Stack, { direction: "row", alignItems: "center", ...paddingAndSizing, sx: { columnGap: 0.5 } }, icon, /* @__PURE__ */ React12.createElement(Typography3, { variant: "subtitle2", sx: { fontSize: "12px", mt: 0.25 } }, title), /* @__PURE__ */ React12.createElement(Stack, { direction: "row", sx: { ml: "auto" } }, actions, /* @__PURE__ */ React12.createElement(CloseButton, { slotProps: { icon: { fontSize: SIZE2 } }, sx: { ml: "auto" }, onClick: onClose })));
|
|
343
378
|
};
|
|
344
379
|
|
|
345
380
|
// src/components/popover/menu-list.tsx
|
|
346
|
-
import * as
|
|
347
|
-
import { useMemo, useRef } from "react";
|
|
348
|
-
import { Box as
|
|
381
|
+
import * as React13 from "react";
|
|
382
|
+
import { useMemo, useRef as useRef2 } from "react";
|
|
383
|
+
import { Box as Box6, ListItem, MenuList, MenuSubheader, styled as styled2 } from "@elementor/ui";
|
|
349
384
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
350
385
|
|
|
351
386
|
// src/hooks/use-scroll-to-selected.ts
|
|
@@ -409,7 +444,7 @@ var PopoverMenuList = ({
|
|
|
409
444
|
noResultsComponent,
|
|
410
445
|
menuListTemplate: CustomMenuList
|
|
411
446
|
}) => {
|
|
412
|
-
const containerRef =
|
|
447
|
+
const containerRef = useRef2(null);
|
|
413
448
|
const scrollTop = useScrollTop({ containerRef });
|
|
414
449
|
const MenuListComponent = CustomMenuList || StyledMenuList;
|
|
415
450
|
const stickyIndices = useMemo(
|
|
@@ -444,7 +479,7 @@ var PopoverMenuList = ({
|
|
|
444
479
|
});
|
|
445
480
|
useScrollToSelected({ selectedValue, items, virtualizer });
|
|
446
481
|
const virtualItems = virtualizer.getVirtualItems();
|
|
447
|
-
return /* @__PURE__ */
|
|
482
|
+
return /* @__PURE__ */ React13.createElement(Box6, { ref: containerRef, sx: { height: "100%", overflowY: "auto" } }, items.length === 0 && noResultsComponent ? noResultsComponent : /* @__PURE__ */ React13.createElement(
|
|
448
483
|
MenuListComponent,
|
|
449
484
|
{
|
|
450
485
|
role: "listbox",
|
|
@@ -462,7 +497,7 @@ var PopoverMenuList = ({
|
|
|
462
497
|
}
|
|
463
498
|
if (item.type === "category") {
|
|
464
499
|
const shouldStick = virtualRow.start + MENU_LIST_PADDING_TOP <= scrollTop;
|
|
465
|
-
return /* @__PURE__ */
|
|
500
|
+
return /* @__PURE__ */ React13.createElement(
|
|
466
501
|
MenuSubheader,
|
|
467
502
|
{
|
|
468
503
|
key: virtualRow.key,
|
|
@@ -473,7 +508,7 @@ var PopoverMenuList = ({
|
|
|
473
508
|
);
|
|
474
509
|
}
|
|
475
510
|
const isDisabled = item.disabled;
|
|
476
|
-
return /* @__PURE__ */
|
|
511
|
+
return /* @__PURE__ */ React13.createElement(
|
|
477
512
|
ListItem,
|
|
478
513
|
{
|
|
479
514
|
key: virtualRow.key,
|
|
@@ -542,41 +577,6 @@ var StyledMenuList = styled2(MenuList)(({ theme }) => ({
|
|
|
542
577
|
position: "relative"
|
|
543
578
|
}));
|
|
544
579
|
|
|
545
|
-
// src/components/popover/search.tsx
|
|
546
|
-
import * as React13 from "react";
|
|
547
|
-
import { useRef as useRef2 } from "react";
|
|
548
|
-
import { SearchIcon, XIcon } from "@elementor/icons";
|
|
549
|
-
import { Box as Box6, IconButton, InputAdornment, TextField } from "@elementor/ui";
|
|
550
|
-
import { __ as __2 } from "@wordpress/i18n";
|
|
551
|
-
var SIZE2 = "tiny";
|
|
552
|
-
var PopoverSearch = ({ value, onSearch, placeholder, id }) => {
|
|
553
|
-
const inputRef = useRef2(null);
|
|
554
|
-
const handleClear = () => {
|
|
555
|
-
onSearch("");
|
|
556
|
-
inputRef.current?.focus();
|
|
557
|
-
};
|
|
558
|
-
const handleInputChange = (event) => {
|
|
559
|
-
onSearch(event.target.value);
|
|
560
|
-
};
|
|
561
|
-
return /* @__PURE__ */ React13.createElement(Box6, { sx: { px: 2, pb: 1.5 } }, /* @__PURE__ */ React13.createElement(
|
|
562
|
-
TextField,
|
|
563
|
-
{
|
|
564
|
-
autoFocus: true,
|
|
565
|
-
fullWidth: true,
|
|
566
|
-
id,
|
|
567
|
-
size: SIZE2,
|
|
568
|
-
value,
|
|
569
|
-
inputRef,
|
|
570
|
-
onChange: handleInputChange,
|
|
571
|
-
placeholder,
|
|
572
|
-
InputProps: {
|
|
573
|
-
startAdornment: /* @__PURE__ */ React13.createElement(InputAdornment, { position: "start" }, /* @__PURE__ */ React13.createElement(SearchIcon, { fontSize: SIZE2 })),
|
|
574
|
-
endAdornment: value && /* @__PURE__ */ React13.createElement(IconButton, { size: SIZE2, onClick: handleClear, "aria-label": __2("Clear", "elementor") }, /* @__PURE__ */ React13.createElement(XIcon, { color: "action", fontSize: SIZE2 }))
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
));
|
|
578
|
-
};
|
|
579
|
-
|
|
580
580
|
// src/components/save-changes-dialog.tsx
|
|
581
581
|
import * as React14 from "react";
|
|
582
582
|
import { useState as useState6 } from "react";
|
|
@@ -736,8 +736,8 @@ export {
|
|
|
736
736
|
PopoverBody,
|
|
737
737
|
PopoverHeader,
|
|
738
738
|
PopoverMenuList,
|
|
739
|
-
PopoverSearch,
|
|
740
739
|
SaveChangesDialog,
|
|
740
|
+
SearchField,
|
|
741
741
|
StyledMenuList,
|
|
742
742
|
ThemeProvider,
|
|
743
743
|
WarningInfotip,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-ui",
|
|
3
3
|
"description": "Elementor Editor UI",
|
|
4
|
-
"version": "3.33.0-
|
|
4
|
+
"version": "3.33.0-157",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Elementor Team",
|
|
7
7
|
"homepage": "https://elementor.com/",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"react-dom": "^18.3.1"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@elementor/editor-v1-adapters": "3.33.0-
|
|
40
|
+
"@elementor/editor-v1-adapters": "3.33.0-157",
|
|
41
41
|
"@elementor/icons": "1.46.0",
|
|
42
42
|
"@elementor/ui": "1.36.12",
|
|
43
43
|
"@tanstack/react-virtual": "^3.13.3",
|
|
@@ -2,4 +2,3 @@ export { PopoverBody } from './body';
|
|
|
2
2
|
export { PopoverHeader } from './header';
|
|
3
3
|
export { ITEM_HEIGHT, PopoverMenuList, StyledMenuList } from './menu-list';
|
|
4
4
|
export type { PopoverMenuListProps, VirtualizedItem } from './menu-list';
|
|
5
|
-
export { PopoverSearch } from './search';
|
|
@@ -13,7 +13,7 @@ type Props = {
|
|
|
13
13
|
id?: string;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
export const
|
|
16
|
+
export const SearchField = ( { value, onSearch, placeholder, id }: Props ) => {
|
|
17
17
|
const inputRef = useRef< HTMLInputElement | null >( null );
|
|
18
18
|
|
|
19
19
|
const handleClear = () => {
|
package/src/index.ts
CHANGED
|
@@ -8,6 +8,8 @@ export { InfoTipCard } from './components/infotip-card';
|
|
|
8
8
|
export { InfoAlert } from './components/info-alert';
|
|
9
9
|
export { WarningInfotip } from './components/warning-infotip';
|
|
10
10
|
export { GlobalDialog, openDialog, closeDialog } from './components/global-dialog';
|
|
11
|
+
export { SearchField } from './components/search-field';
|
|
12
|
+
|
|
11
13
|
export * from './components/popover';
|
|
12
14
|
export * from './components/save-changes-dialog';
|
|
13
15
|
|