@elementor/editor-components 3.35.0-377 → 3.35.0-379
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.js +282 -217
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +266 -201
- package/dist/index.mjs.map +1 -1
- package/package.json +22 -21
- package/src/components/component-panel-header/component-badge.tsx +25 -22
- package/src/components/component-panel-header/component-panel-header.tsx +18 -2
- package/src/components/components-tab/component-introduction.tsx +68 -0
package/dist/index.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import { injectTab } from "@elementor/editor-elements-panel";
|
|
|
16
16
|
import { stylesRepository } from "@elementor/editor-styles-repository";
|
|
17
17
|
import { registerDataHook } from "@elementor/editor-v1-adapters";
|
|
18
18
|
import { __registerSlice as registerSlice } from "@elementor/store";
|
|
19
|
-
import { __ as
|
|
19
|
+
import { __ as __18 } from "@wordpress/i18n";
|
|
20
20
|
|
|
21
21
|
// src/component-instance-transformer.ts
|
|
22
22
|
import { createTransformer, RenderContext } from "@elementor/editor-canvas";
|
|
@@ -316,11 +316,12 @@ var componentOverrideTransformer = createTransformer3((override) => {
|
|
|
316
316
|
});
|
|
317
317
|
|
|
318
318
|
// src/components/component-panel-header/component-panel-header.tsx
|
|
319
|
-
import * as
|
|
319
|
+
import * as React3 from "react";
|
|
320
|
+
import { useSuppressedMessage } from "@elementor/editor-current-user";
|
|
320
321
|
import { getV1DocumentsManager as getV1DocumentsManager3 } from "@elementor/editor-documents";
|
|
321
322
|
import { ArrowLeftIcon, ComponentsFilledIcon } from "@elementor/icons";
|
|
322
|
-
import { Box as
|
|
323
|
-
import { __ as
|
|
323
|
+
import { Box as Box3, Divider, IconButton, Stack as Stack2, Tooltip, Typography as Typography2 } from "@elementor/ui";
|
|
324
|
+
import { __ as __3 } from "@wordpress/i18n";
|
|
324
325
|
|
|
325
326
|
// src/hooks/use-navigate-back.ts
|
|
326
327
|
import { useCallback } from "react";
|
|
@@ -353,28 +354,77 @@ function useNavigateBack() {
|
|
|
353
354
|
}, [path, documentsManager]);
|
|
354
355
|
}
|
|
355
356
|
|
|
356
|
-
// src/components/
|
|
357
|
+
// src/components/components-tab/component-introduction.tsx
|
|
357
358
|
import * as React from "react";
|
|
358
|
-
import {
|
|
359
|
-
import {
|
|
360
|
-
import {
|
|
359
|
+
import { PopoverContent } from "@elementor/editor-controls";
|
|
360
|
+
import { PopoverHeader } from "@elementor/editor-ui";
|
|
361
|
+
import { Box, Button, Image, Popover, Stack, Typography } from "@elementor/ui";
|
|
361
362
|
import { __ } from "@wordpress/i18n";
|
|
362
|
-
var
|
|
363
|
-
|
|
364
|
-
|
|
363
|
+
var ComponentIntroduction = ({
|
|
364
|
+
anchorRef,
|
|
365
|
+
shouldShowIntroduction,
|
|
366
|
+
onClose
|
|
367
|
+
}) => {
|
|
368
|
+
if (!anchorRef.current || !shouldShowIntroduction) {
|
|
369
|
+
return null;
|
|
370
|
+
}
|
|
365
371
|
return /* @__PURE__ */ React.createElement(
|
|
366
|
-
|
|
372
|
+
Popover,
|
|
367
373
|
{
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
+
anchorEl: anchorRef.current,
|
|
375
|
+
open: shouldShowIntroduction,
|
|
376
|
+
anchorOrigin: {
|
|
377
|
+
vertical: "top",
|
|
378
|
+
horizontal: "right"
|
|
379
|
+
},
|
|
380
|
+
transformOrigin: {
|
|
381
|
+
vertical: "top",
|
|
382
|
+
horizontal: -30
|
|
383
|
+
},
|
|
384
|
+
onClose
|
|
374
385
|
},
|
|
375
|
-
/* @__PURE__ */ React.createElement(
|
|
386
|
+
/* @__PURE__ */ React.createElement(Box, { sx: { width: "296px" } }, /* @__PURE__ */ React.createElement(PopoverHeader, { title: __("Add your first property", "elementor"), onClose }), /* @__PURE__ */ React.createElement(
|
|
387
|
+
Image,
|
|
388
|
+
{
|
|
389
|
+
sx: { width: "296px", height: "160px" },
|
|
390
|
+
src: "https://assets.elementor.com/packages/v1/images/components-properties-intro.png",
|
|
391
|
+
alt: ""
|
|
392
|
+
}
|
|
393
|
+
), /* @__PURE__ */ React.createElement(PopoverContent, null, /* @__PURE__ */ React.createElement(Stack, { gap: 1, sx: { p: 2 } }, /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, __("Properties make instances flexible.", "elementor")), /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, __(
|
|
394
|
+
"Click next to any setting you want users to customize - like text, images, or links.",
|
|
395
|
+
"elementor"
|
|
396
|
+
)), /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, __(
|
|
397
|
+
"Your properties will appear in the Properties panel, where you can organize and manage them anytime.",
|
|
398
|
+
"elementor"
|
|
399
|
+
)), /* @__PURE__ */ React.createElement(Stack, { direction: "row", alignItems: "center", justifyContent: "flex-end" }, /* @__PURE__ */ React.createElement(Button, { size: "medium", variant: "contained", onClick: onClose }, __("Got it", "elementor"))))))
|
|
376
400
|
);
|
|
377
401
|
};
|
|
402
|
+
|
|
403
|
+
// src/components/component-panel-header/component-badge.tsx
|
|
404
|
+
import * as React2 from "react";
|
|
405
|
+
import { useEffect, useRef } from "react";
|
|
406
|
+
import { ComponentPropListIcon } from "@elementor/icons";
|
|
407
|
+
import { Badge, Box as Box2, keyframes, styled, ToggleButton } from "@elementor/ui";
|
|
408
|
+
import { __ as __2 } from "@wordpress/i18n";
|
|
409
|
+
var ComponentsBadge = React2.forwardRef(
|
|
410
|
+
({ overridesCount }, ref) => {
|
|
411
|
+
const prevCount = usePrevious(overridesCount);
|
|
412
|
+
const isFirstOverride = prevCount === 0 && overridesCount === 1;
|
|
413
|
+
return /* @__PURE__ */ React2.createElement(
|
|
414
|
+
StyledBadge,
|
|
415
|
+
{
|
|
416
|
+
ref,
|
|
417
|
+
color: "primary",
|
|
418
|
+
key: overridesCount,
|
|
419
|
+
invisible: overridesCount === 0,
|
|
420
|
+
animate: isFirstOverride,
|
|
421
|
+
anchorOrigin: { vertical: "top", horizontal: "right" },
|
|
422
|
+
badgeContent: /* @__PURE__ */ React2.createElement(Box2, { sx: { animation: !isFirstOverride ? `${slideUp} 300ms ease-out` : "none" } }, overridesCount)
|
|
423
|
+
},
|
|
424
|
+
/* @__PURE__ */ React2.createElement(ToggleButton, { value: "overrides", size: "tiny", "aria-label": __2("View overrides", "elementor") }, /* @__PURE__ */ React2.createElement(ComponentPropListIcon, { fontSize: "tiny" }))
|
|
425
|
+
);
|
|
426
|
+
}
|
|
427
|
+
);
|
|
378
428
|
var StyledBadge = styled(Badge, { shouldForwardProp: (prop) => prop !== "animate" })(
|
|
379
429
|
({ theme, animate }) => ({
|
|
380
430
|
"& .MuiBadge-badge": {
|
|
@@ -416,26 +466,41 @@ function useOverridableProps(componentId) {
|
|
|
416
466
|
}
|
|
417
467
|
|
|
418
468
|
// src/components/component-panel-header/component-panel-header.tsx
|
|
469
|
+
var MESSAGE_KEY = "components-properties-introduction";
|
|
419
470
|
var ComponentPanelHeader = () => {
|
|
420
471
|
const currentComponentId = useCurrentComponentId();
|
|
421
472
|
const overridableProps = useOverridableProps(currentComponentId);
|
|
422
473
|
const onBack = useNavigateBack();
|
|
423
474
|
const componentName = getComponentName();
|
|
475
|
+
const [isMessageSuppressed, suppressMessage] = useSuppressedMessage(MESSAGE_KEY);
|
|
476
|
+
const [shouldShowIntroduction, setShouldShowIntroduction] = React3.useState(!isMessageSuppressed);
|
|
424
477
|
const overridesCount = overridableProps ? Object.keys(overridableProps.props).length : 0;
|
|
478
|
+
const anchorRef = React3.useRef(null);
|
|
425
479
|
if (!currentComponentId) {
|
|
426
480
|
return null;
|
|
427
481
|
}
|
|
428
|
-
|
|
429
|
-
|
|
482
|
+
const handleCloseIntroduction = () => {
|
|
483
|
+
suppressMessage();
|
|
484
|
+
setShouldShowIntroduction(false);
|
|
485
|
+
};
|
|
486
|
+
return /* @__PURE__ */ React3.createElement(Box3, null, /* @__PURE__ */ React3.createElement(
|
|
487
|
+
Stack2,
|
|
430
488
|
{
|
|
431
489
|
direction: "row",
|
|
432
490
|
alignItems: "center",
|
|
433
491
|
justifyContent: "space-between",
|
|
434
492
|
sx: { height: 48, pl: 1.5, pr: 2, py: 1 }
|
|
435
493
|
},
|
|
436
|
-
/* @__PURE__ */
|
|
437
|
-
/* @__PURE__ */
|
|
438
|
-
), /* @__PURE__ */
|
|
494
|
+
/* @__PURE__ */ React3.createElement(Stack2, { direction: "row", alignItems: "center" }, /* @__PURE__ */ React3.createElement(Tooltip, { title: __3("Back", "elementor") }, /* @__PURE__ */ React3.createElement(IconButton, { size: "tiny", onClick: onBack, "aria-label": __3("Back", "elementor") }, /* @__PURE__ */ React3.createElement(ArrowLeftIcon, { fontSize: "tiny" }))), /* @__PURE__ */ React3.createElement(Stack2, { direction: "row", alignItems: "center", gap: 0.5 }, /* @__PURE__ */ React3.createElement(ComponentsFilledIcon, { fontSize: "tiny", stroke: "currentColor" }), /* @__PURE__ */ React3.createElement(Typography2, { variant: "caption", sx: { fontWeight: 500 } }, componentName))),
|
|
495
|
+
/* @__PURE__ */ React3.createElement(ComponentsBadge, { overridesCount, ref: anchorRef })
|
|
496
|
+
), /* @__PURE__ */ React3.createElement(Divider, null), /* @__PURE__ */ React3.createElement(
|
|
497
|
+
ComponentIntroduction,
|
|
498
|
+
{
|
|
499
|
+
anchorRef,
|
|
500
|
+
shouldShowIntroduction,
|
|
501
|
+
onClose: handleCloseIntroduction
|
|
502
|
+
}
|
|
503
|
+
));
|
|
439
504
|
};
|
|
440
505
|
function getComponentName() {
|
|
441
506
|
const documentsManager = getV1DocumentsManager3();
|
|
@@ -444,17 +509,17 @@ function getComponentName() {
|
|
|
444
509
|
}
|
|
445
510
|
|
|
446
511
|
// src/components/components-tab/components.tsx
|
|
447
|
-
import * as
|
|
512
|
+
import * as React9 from "react";
|
|
448
513
|
import { ThemeProvider } from "@elementor/editor-ui";
|
|
449
514
|
|
|
450
515
|
// src/components/components-tab/component-search.tsx
|
|
451
|
-
import * as
|
|
516
|
+
import * as React5 from "react";
|
|
452
517
|
import { SearchIcon } from "@elementor/icons";
|
|
453
|
-
import { Box as
|
|
454
|
-
import { __ as
|
|
518
|
+
import { Box as Box4, InputAdornment, Stack as Stack3, TextField } from "@elementor/ui";
|
|
519
|
+
import { __ as __4 } from "@wordpress/i18n";
|
|
455
520
|
|
|
456
521
|
// src/components/components-tab/search-provider.tsx
|
|
457
|
-
import * as
|
|
522
|
+
import * as React4 from "react";
|
|
458
523
|
import { createContext, useContext } from "react";
|
|
459
524
|
import { useSearchState } from "@elementor/utils";
|
|
460
525
|
var SearchContext = createContext(void 0);
|
|
@@ -466,7 +531,7 @@ var SearchProvider = ({
|
|
|
466
531
|
const clearSearch = () => {
|
|
467
532
|
handleChange("");
|
|
468
533
|
};
|
|
469
|
-
return /* @__PURE__ */
|
|
534
|
+
return /* @__PURE__ */ React4.createElement(SearchContext.Provider, { value: { handleChange, clearSearch, searchValue: debouncedValue, inputValue } }, children);
|
|
470
535
|
};
|
|
471
536
|
var useSearch = () => {
|
|
472
537
|
const context = useContext(SearchContext);
|
|
@@ -479,27 +544,27 @@ var useSearch = () => {
|
|
|
479
544
|
// src/components/components-tab/component-search.tsx
|
|
480
545
|
var ComponentSearch = () => {
|
|
481
546
|
const { inputValue, handleChange } = useSearch();
|
|
482
|
-
return /* @__PURE__ */
|
|
547
|
+
return /* @__PURE__ */ React5.createElement(Stack3, { direction: "row", gap: 0.5, sx: { width: "100%", px: 2, py: 1.5 } }, /* @__PURE__ */ React5.createElement(Box4, { sx: { flexGrow: 1 } }, /* @__PURE__ */ React5.createElement(
|
|
483
548
|
TextField,
|
|
484
549
|
{
|
|
485
550
|
role: "search",
|
|
486
551
|
fullWidth: true,
|
|
487
552
|
size: "tiny",
|
|
488
553
|
value: inputValue,
|
|
489
|
-
placeholder:
|
|
554
|
+
placeholder: __4("Search", "elementor"),
|
|
490
555
|
onChange: (e) => handleChange(e.target.value),
|
|
491
556
|
InputProps: {
|
|
492
|
-
startAdornment: /* @__PURE__ */
|
|
557
|
+
startAdornment: /* @__PURE__ */ React5.createElement(InputAdornment, { position: "start" }, /* @__PURE__ */ React5.createElement(SearchIcon, { fontSize: "tiny" }))
|
|
493
558
|
}
|
|
494
559
|
}
|
|
495
560
|
)));
|
|
496
561
|
};
|
|
497
562
|
|
|
498
563
|
// src/components/components-tab/components-list.tsx
|
|
499
|
-
import * as
|
|
564
|
+
import * as React8 from "react";
|
|
500
565
|
import { ComponentsIcon as ComponentsIcon2, EyeIcon } from "@elementor/icons";
|
|
501
|
-
import { Box as
|
|
502
|
-
import { __ as
|
|
566
|
+
import { Box as Box7, Divider as Divider2, Icon, Link, List, Stack as Stack6, Typography as Typography4 } from "@elementor/ui";
|
|
567
|
+
import { __ as __7 } from "@wordpress/i18n";
|
|
503
568
|
|
|
504
569
|
// src/hooks/use-components.ts
|
|
505
570
|
import { __useSelector as useSelector4 } from "@elementor/store";
|
|
@@ -510,7 +575,7 @@ var useComponents = () => {
|
|
|
510
575
|
};
|
|
511
576
|
|
|
512
577
|
// src/components/components-tab/components-item.tsx
|
|
513
|
-
import * as
|
|
578
|
+
import * as React6 from "react";
|
|
514
579
|
import { endDragElementFromPanel, startDragElementFromPanel } from "@elementor/editor-canvas";
|
|
515
580
|
import { dropElement } from "@elementor/editor-elements";
|
|
516
581
|
import { EllipsisWithTooltip, MenuListItem } from "@elementor/editor-ui";
|
|
@@ -518,16 +583,16 @@ import { ComponentsIcon, DotsVerticalIcon } from "@elementor/icons";
|
|
|
518
583
|
import {
|
|
519
584
|
bindMenu,
|
|
520
585
|
bindTrigger,
|
|
521
|
-
Box as
|
|
586
|
+
Box as Box5,
|
|
522
587
|
IconButton as IconButton2,
|
|
523
588
|
ListItemButton,
|
|
524
589
|
ListItemIcon,
|
|
525
590
|
Menu,
|
|
526
|
-
Stack as
|
|
527
|
-
Typography as
|
|
591
|
+
Stack as Stack4,
|
|
592
|
+
Typography as Typography3,
|
|
528
593
|
usePopupState
|
|
529
594
|
} from "@elementor/ui";
|
|
530
|
-
import { __ as
|
|
595
|
+
import { __ as __6 } from "@wordpress/i18n";
|
|
531
596
|
|
|
532
597
|
// src/store/actions/archive-component.ts
|
|
533
598
|
import { setDocumentModifiedStatus } from "@elementor/editor-documents";
|
|
@@ -550,7 +615,7 @@ import {
|
|
|
550
615
|
createTemplatedElementView
|
|
551
616
|
} from "@elementor/editor-canvas";
|
|
552
617
|
import { getCurrentDocument } from "@elementor/editor-documents";
|
|
553
|
-
import { __ as
|
|
618
|
+
import { __ as __5 } from "@wordpress/i18n";
|
|
554
619
|
|
|
555
620
|
// src/utils/tracking.ts
|
|
556
621
|
import { getMixpanel } from "@elementor/mixpanel";
|
|
@@ -670,7 +735,7 @@ function createComponentView(options) {
|
|
|
670
735
|
action: {
|
|
671
736
|
name: "edit component",
|
|
672
737
|
icon: "eicon-edit",
|
|
673
|
-
title: () =>
|
|
738
|
+
title: () => __5("Edit Component", "elementor"),
|
|
674
739
|
isEnabled: () => true,
|
|
675
740
|
callback: (_, eventData) => this.editComponent(eventData)
|
|
676
741
|
}
|
|
@@ -931,7 +996,7 @@ var ComponentItem = ({ component }) => {
|
|
|
931
996
|
}
|
|
932
997
|
archiveComponent(component.id);
|
|
933
998
|
};
|
|
934
|
-
return /* @__PURE__ */
|
|
999
|
+
return /* @__PURE__ */ React6.createElement(Stack4, null, /* @__PURE__ */ React6.createElement(
|
|
935
1000
|
ListItemButton,
|
|
936
1001
|
{
|
|
937
1002
|
draggable: true,
|
|
@@ -949,8 +1014,8 @@ var ComponentItem = ({ component }) => {
|
|
|
949
1014
|
gap: 1
|
|
950
1015
|
}
|
|
951
1016
|
},
|
|
952
|
-
/* @__PURE__ */
|
|
953
|
-
|
|
1017
|
+
/* @__PURE__ */ React6.createElement(
|
|
1018
|
+
Box5,
|
|
954
1019
|
{
|
|
955
1020
|
onClick: handleClick,
|
|
956
1021
|
sx: {
|
|
@@ -961,19 +1026,19 @@ var ComponentItem = ({ component }) => {
|
|
|
961
1026
|
flexGrow: 1
|
|
962
1027
|
}
|
|
963
1028
|
},
|
|
964
|
-
/* @__PURE__ */
|
|
965
|
-
/* @__PURE__ */
|
|
1029
|
+
/* @__PURE__ */ React6.createElement(ListItemIcon, { size: "tiny" }, /* @__PURE__ */ React6.createElement(ComponentsIcon, { fontSize: "tiny" })),
|
|
1030
|
+
/* @__PURE__ */ React6.createElement(Box5, { display: "flex", flex: 1, minWidth: 0, flexGrow: 1 }, /* @__PURE__ */ React6.createElement(
|
|
966
1031
|
EllipsisWithTooltip,
|
|
967
1032
|
{
|
|
968
1033
|
title: component.name,
|
|
969
|
-
as:
|
|
1034
|
+
as: Typography3,
|
|
970
1035
|
variant: "caption",
|
|
971
1036
|
color: "text.primary"
|
|
972
1037
|
}
|
|
973
1038
|
))
|
|
974
1039
|
),
|
|
975
|
-
/* @__PURE__ */
|
|
976
|
-
), /* @__PURE__ */
|
|
1040
|
+
/* @__PURE__ */ React6.createElement(IconButton2, { size: "tiny", ...bindTrigger(popupState), "aria-label": "More actions" }, /* @__PURE__ */ React6.createElement(DotsVerticalIcon, { fontSize: "tiny" }))
|
|
1041
|
+
), /* @__PURE__ */ React6.createElement(
|
|
977
1042
|
Menu,
|
|
978
1043
|
{
|
|
979
1044
|
...bindMenu(popupState),
|
|
@@ -986,7 +1051,7 @@ var ComponentItem = ({ component }) => {
|
|
|
986
1051
|
horizontal: "right"
|
|
987
1052
|
}
|
|
988
1053
|
},
|
|
989
|
-
/* @__PURE__ */
|
|
1054
|
+
/* @__PURE__ */ React6.createElement(MenuListItem, { sx: { minWidth: "160px" }, onClick: handleArchiveClick }, __6("Archive", "elementor"))
|
|
990
1055
|
));
|
|
991
1056
|
};
|
|
992
1057
|
var addComponentToPage = (model) => {
|
|
@@ -1003,13 +1068,13 @@ var addComponentToPage = (model) => {
|
|
|
1003
1068
|
};
|
|
1004
1069
|
|
|
1005
1070
|
// src/components/components-tab/loading-components.tsx
|
|
1006
|
-
import * as
|
|
1007
|
-
import { Box as
|
|
1071
|
+
import * as React7 from "react";
|
|
1072
|
+
import { Box as Box6, ListItemButton as ListItemButton2, Skeleton, Stack as Stack5 } from "@elementor/ui";
|
|
1008
1073
|
var ROWS_COUNT = 6;
|
|
1009
1074
|
var rows = Array.from({ length: ROWS_COUNT }, (_, index) => index);
|
|
1010
1075
|
var LoadingComponents = () => {
|
|
1011
|
-
return /* @__PURE__ */
|
|
1012
|
-
|
|
1076
|
+
return /* @__PURE__ */ React7.createElement(
|
|
1077
|
+
Stack5,
|
|
1013
1078
|
{
|
|
1014
1079
|
"aria-label": "Loading components",
|
|
1015
1080
|
gap: 1,
|
|
@@ -1030,14 +1095,14 @@ var LoadingComponents = () => {
|
|
|
1030
1095
|
}
|
|
1031
1096
|
}
|
|
1032
1097
|
},
|
|
1033
|
-
rows.map((row) => /* @__PURE__ */
|
|
1098
|
+
rows.map((row) => /* @__PURE__ */ React7.createElement(
|
|
1034
1099
|
ListItemButton2,
|
|
1035
1100
|
{
|
|
1036
1101
|
key: row,
|
|
1037
1102
|
sx: { border: "solid 1px", borderColor: "divider", py: 0.5, px: 1 },
|
|
1038
1103
|
shape: "rounded"
|
|
1039
1104
|
},
|
|
1040
|
-
/* @__PURE__ */
|
|
1105
|
+
/* @__PURE__ */ React7.createElement(Box6, { display: "flex", gap: 1, width: "100%" }, /* @__PURE__ */ React7.createElement(Skeleton, { variant: "text", width: "24px", height: "36px" }), /* @__PURE__ */ React7.createElement(Skeleton, { variant: "text", width: "100%", height: "36px" }))
|
|
1041
1106
|
))
|
|
1042
1107
|
);
|
|
1043
1108
|
};
|
|
@@ -1046,20 +1111,20 @@ var LoadingComponents = () => {
|
|
|
1046
1111
|
function ComponentsList() {
|
|
1047
1112
|
const { components, isLoading, searchValue } = useFilteredComponents();
|
|
1048
1113
|
if (isLoading) {
|
|
1049
|
-
return /* @__PURE__ */
|
|
1114
|
+
return /* @__PURE__ */ React8.createElement(LoadingComponents, null);
|
|
1050
1115
|
}
|
|
1051
1116
|
const isEmpty = !components || components.length === 0;
|
|
1052
1117
|
if (isEmpty) {
|
|
1053
1118
|
if (searchValue.length > 0) {
|
|
1054
|
-
return /* @__PURE__ */
|
|
1119
|
+
return /* @__PURE__ */ React8.createElement(EmptySearchResult, null);
|
|
1055
1120
|
}
|
|
1056
|
-
return /* @__PURE__ */
|
|
1121
|
+
return /* @__PURE__ */ React8.createElement(EmptyState, null);
|
|
1057
1122
|
}
|
|
1058
|
-
return /* @__PURE__ */
|
|
1123
|
+
return /* @__PURE__ */ React8.createElement(List, { sx: { display: "flex", flexDirection: "column", gap: 1, px: 2 } }, components.map((component) => /* @__PURE__ */ React8.createElement(ComponentItem, { key: component.uid, component })));
|
|
1059
1124
|
}
|
|
1060
1125
|
var EmptyState = () => {
|
|
1061
|
-
return /* @__PURE__ */
|
|
1062
|
-
|
|
1126
|
+
return /* @__PURE__ */ React8.createElement(
|
|
1127
|
+
Stack6,
|
|
1063
1128
|
{
|
|
1064
1129
|
alignItems: "center",
|
|
1065
1130
|
justifyContent: "center",
|
|
@@ -1068,32 +1133,32 @@ var EmptyState = () => {
|
|
|
1068
1133
|
gap: 1.75,
|
|
1069
1134
|
overflow: "hidden"
|
|
1070
1135
|
},
|
|
1071
|
-
/* @__PURE__ */
|
|
1072
|
-
/* @__PURE__ */
|
|
1073
|
-
/* @__PURE__ */
|
|
1136
|
+
/* @__PURE__ */ React8.createElement(Icon, { fontSize: "large" }, /* @__PURE__ */ React8.createElement(EyeIcon, { fontSize: "large" })),
|
|
1137
|
+
/* @__PURE__ */ React8.createElement(Typography4, { align: "center", variant: "subtitle2", color: "text.secondary", fontWeight: "bold" }, __7("Text that explains that there are no Components yet.", "elementor")),
|
|
1138
|
+
/* @__PURE__ */ React8.createElement(Typography4, { variant: "caption", align: "center", color: "text.secondary" }, __7(
|
|
1074
1139
|
"Once you have Components, this is where you can manage them\u2014rearrange, duplicate, rename and delete irrelevant classes.",
|
|
1075
1140
|
"elementor"
|
|
1076
1141
|
)),
|
|
1077
|
-
/* @__PURE__ */
|
|
1078
|
-
/* @__PURE__ */
|
|
1079
|
-
/* @__PURE__ */
|
|
1080
|
-
|
|
1142
|
+
/* @__PURE__ */ React8.createElement(Divider2, { sx: { width: "100%" }, color: "text.secondary" }),
|
|
1143
|
+
/* @__PURE__ */ React8.createElement(Typography4, { align: "left", variant: "caption", color: "text.secondary" }, __7("To create a component, first design it, then choose one of three options:", "elementor")),
|
|
1144
|
+
/* @__PURE__ */ React8.createElement(
|
|
1145
|
+
Typography4,
|
|
1081
1146
|
{
|
|
1082
1147
|
align: "left",
|
|
1083
1148
|
variant: "caption",
|
|
1084
1149
|
color: "text.secondary",
|
|
1085
1150
|
sx: { display: "flex", flexDirection: "column" }
|
|
1086
1151
|
},
|
|
1087
|
-
/* @__PURE__ */
|
|
1088
|
-
/* @__PURE__ */
|
|
1089
|
-
/* @__PURE__ */
|
|
1152
|
+
/* @__PURE__ */ React8.createElement("span", null, __7("1. Right-click and select Create Component", "elementor")),
|
|
1153
|
+
/* @__PURE__ */ React8.createElement("span", null, __7("2. Use the component icon in the Structure panel", "elementor")),
|
|
1154
|
+
/* @__PURE__ */ React8.createElement("span", null, __7("3. Use the component icon in the Edit panel header", "elementor"))
|
|
1090
1155
|
)
|
|
1091
1156
|
);
|
|
1092
1157
|
};
|
|
1093
1158
|
var EmptySearchResult = () => {
|
|
1094
1159
|
const { searchValue, clearSearch } = useSearch();
|
|
1095
|
-
return /* @__PURE__ */
|
|
1096
|
-
|
|
1160
|
+
return /* @__PURE__ */ React8.createElement(
|
|
1161
|
+
Stack6,
|
|
1097
1162
|
{
|
|
1098
1163
|
color: "text.secondary",
|
|
1099
1164
|
pt: 5,
|
|
@@ -1102,17 +1167,17 @@ var EmptySearchResult = () => {
|
|
|
1102
1167
|
overflow: "hidden",
|
|
1103
1168
|
justifySelf: "center"
|
|
1104
1169
|
},
|
|
1105
|
-
/* @__PURE__ */
|
|
1106
|
-
/* @__PURE__ */
|
|
1107
|
-
|
|
1170
|
+
/* @__PURE__ */ React8.createElement(ComponentsIcon2, null),
|
|
1171
|
+
/* @__PURE__ */ React8.createElement(
|
|
1172
|
+
Box7,
|
|
1108
1173
|
{
|
|
1109
1174
|
sx: {
|
|
1110
1175
|
width: "100%"
|
|
1111
1176
|
}
|
|
1112
1177
|
},
|
|
1113
|
-
/* @__PURE__ */
|
|
1114
|
-
searchValue && /* @__PURE__ */
|
|
1115
|
-
|
|
1178
|
+
/* @__PURE__ */ React8.createElement(Typography4, { align: "center", variant: "subtitle2", color: "inherit" }, __7("Sorry, nothing matched", "elementor")),
|
|
1179
|
+
searchValue && /* @__PURE__ */ React8.createElement(
|
|
1180
|
+
Typography4,
|
|
1116
1181
|
{
|
|
1117
1182
|
variant: "subtitle2",
|
|
1118
1183
|
color: "inherit",
|
|
@@ -1122,8 +1187,8 @@ var EmptySearchResult = () => {
|
|
|
1122
1187
|
justifyContent: "center"
|
|
1123
1188
|
}
|
|
1124
1189
|
},
|
|
1125
|
-
/* @__PURE__ */
|
|
1126
|
-
/* @__PURE__ */
|
|
1190
|
+
/* @__PURE__ */ React8.createElement("span", null, "\u201C"),
|
|
1191
|
+
/* @__PURE__ */ React8.createElement(
|
|
1127
1192
|
"span",
|
|
1128
1193
|
{
|
|
1129
1194
|
style: {
|
|
@@ -1134,11 +1199,11 @@ var EmptySearchResult = () => {
|
|
|
1134
1199
|
},
|
|
1135
1200
|
searchValue
|
|
1136
1201
|
),
|
|
1137
|
-
/* @__PURE__ */
|
|
1202
|
+
/* @__PURE__ */ React8.createElement("span", null, "\u201D.")
|
|
1138
1203
|
)
|
|
1139
1204
|
),
|
|
1140
|
-
/* @__PURE__ */
|
|
1141
|
-
/* @__PURE__ */
|
|
1205
|
+
/* @__PURE__ */ React8.createElement(Typography4, { align: "center", variant: "caption", color: "inherit" }, __7("Try something else.", "elementor")),
|
|
1206
|
+
/* @__PURE__ */ React8.createElement(Typography4, { align: "center", variant: "caption", color: "inherit" }, /* @__PURE__ */ React8.createElement(Link, { color: "secondary", variant: "caption", component: "button", onClick: clearSearch }, __7("Clear & try again", "elementor")))
|
|
1142
1207
|
);
|
|
1143
1208
|
};
|
|
1144
1209
|
var useFilteredComponents = () => {
|
|
@@ -1155,20 +1220,20 @@ var useFilteredComponents = () => {
|
|
|
1155
1220
|
|
|
1156
1221
|
// src/components/components-tab/components.tsx
|
|
1157
1222
|
var Components = () => {
|
|
1158
|
-
return /* @__PURE__ */
|
|
1223
|
+
return /* @__PURE__ */ React9.createElement(ThemeProvider, null, /* @__PURE__ */ React9.createElement(SearchProvider, { localStorageKey: "elementor-components-search" }, /* @__PURE__ */ React9.createElement(ComponentSearch, null), /* @__PURE__ */ React9.createElement(ComponentsList, null)));
|
|
1159
1224
|
};
|
|
1160
1225
|
|
|
1161
1226
|
// src/components/consts.ts
|
|
1162
1227
|
var COMPONENT_DOCUMENT_TYPE = "elementor_component";
|
|
1163
1228
|
|
|
1164
1229
|
// src/components/create-component-form/create-component-form.tsx
|
|
1165
|
-
import * as
|
|
1166
|
-
import { useEffect as useEffect2, useMemo as useMemo2, useRef as
|
|
1230
|
+
import * as React10 from "react";
|
|
1231
|
+
import { useEffect as useEffect2, useMemo as useMemo2, useRef as useRef3, useState as useState3 } from "react";
|
|
1167
1232
|
import { getElementLabel } from "@elementor/editor-elements";
|
|
1168
1233
|
import { Form as FormElement, ThemeProvider as ThemeProvider2 } from "@elementor/editor-ui";
|
|
1169
1234
|
import { StarIcon } from "@elementor/icons";
|
|
1170
|
-
import { Alert, Button, FormLabel, Grid, Popover, Snackbar, Stack as
|
|
1171
|
-
import { __ as
|
|
1235
|
+
import { Alert, Button as Button2, FormLabel, Grid, Popover as Popover2, Snackbar, Stack as Stack7, TextField as TextField2, Typography as Typography5 } from "@elementor/ui";
|
|
1236
|
+
import { __ as __9 } from "@wordpress/i18n";
|
|
1172
1237
|
|
|
1173
1238
|
// src/store/actions/create-unpublished-component.ts
|
|
1174
1239
|
import { __privateRunCommand as runCommand2 } from "@elementor/editor-v1-adapters";
|
|
@@ -1196,10 +1261,10 @@ function createUnpublishedComponent(name, element, eventData, overridableProps,
|
|
|
1196
1261
|
}
|
|
1197
1262
|
|
|
1198
1263
|
// src/components/create-component-form/hooks/use-form.ts
|
|
1199
|
-
import { useMemo, useState } from "react";
|
|
1264
|
+
import { useMemo, useState as useState2 } from "react";
|
|
1200
1265
|
var useForm = (initialValues) => {
|
|
1201
|
-
const [values, setValues] =
|
|
1202
|
-
const [errors, setErrors] =
|
|
1266
|
+
const [values, setValues] = useState2(initialValues);
|
|
1267
|
+
const [errors, setErrors] = useState2({});
|
|
1203
1268
|
const isValid = useMemo(() => {
|
|
1204
1269
|
return !Object.values(errors).some((error) => error);
|
|
1205
1270
|
}, [errors]);
|
|
@@ -1246,16 +1311,16 @@ var validateForm = (values, schema) => {
|
|
|
1246
1311
|
|
|
1247
1312
|
// src/components/create-component-form/utils/component-form-schema.ts
|
|
1248
1313
|
import { z } from "@elementor/schema";
|
|
1249
|
-
import { __ as
|
|
1314
|
+
import { __ as __8 } from "@wordpress/i18n";
|
|
1250
1315
|
var MIN_NAME_LENGTH = 2;
|
|
1251
1316
|
var MAX_NAME_LENGTH = 50;
|
|
1252
1317
|
var createBaseComponentSchema = (existingNames) => {
|
|
1253
1318
|
return z.object({
|
|
1254
1319
|
componentName: z.string().trim().max(
|
|
1255
1320
|
MAX_NAME_LENGTH,
|
|
1256
|
-
|
|
1321
|
+
__8("Component name is too long. Please keep it under 50 characters.", "elementor")
|
|
1257
1322
|
).refine((value) => !existingNames.includes(value), {
|
|
1258
|
-
message:
|
|
1323
|
+
message: __8("Component name already exists", "elementor")
|
|
1259
1324
|
})
|
|
1260
1325
|
});
|
|
1261
1326
|
};
|
|
@@ -1263,9 +1328,9 @@ var createSubmitComponentSchema = (existingNames) => {
|
|
|
1263
1328
|
const baseSchema = createBaseComponentSchema(existingNames);
|
|
1264
1329
|
return baseSchema.extend({
|
|
1265
1330
|
componentName: baseSchema.shape.componentName.refine((value) => value.length > 0, {
|
|
1266
|
-
message:
|
|
1331
|
+
message: __8("Component name is required.", "elementor")
|
|
1267
1332
|
}).refine((value) => value.length >= MIN_NAME_LENGTH, {
|
|
1268
|
-
message:
|
|
1333
|
+
message: __8("Component name is too short. Please enter at least 2 characters.", "elementor")
|
|
1269
1334
|
})
|
|
1270
1335
|
});
|
|
1271
1336
|
};
|
|
@@ -1301,10 +1366,10 @@ function countNestedElements(container) {
|
|
|
1301
1366
|
|
|
1302
1367
|
// src/components/create-component-form/create-component-form.tsx
|
|
1303
1368
|
function CreateComponentForm() {
|
|
1304
|
-
const [element, setElement] =
|
|
1305
|
-
const [anchorPosition, setAnchorPosition] =
|
|
1306
|
-
const [resultNotification, setResultNotification] =
|
|
1307
|
-
const eventData =
|
|
1369
|
+
const [element, setElement] = useState3(null);
|
|
1370
|
+
const [anchorPosition, setAnchorPosition] = useState3();
|
|
1371
|
+
const [resultNotification, setResultNotification] = useState3(null);
|
|
1372
|
+
const eventData = useRef3(null);
|
|
1308
1373
|
useEffect2(() => {
|
|
1309
1374
|
const OPEN_SAVE_AS_COMPONENT_FORM_EVENT = "elementor/editor/open-save-as-component-form";
|
|
1310
1375
|
const openPopup = (event) => {
|
|
@@ -1330,12 +1395,12 @@ function CreateComponentForm() {
|
|
|
1330
1395
|
setResultNotification({
|
|
1331
1396
|
show: true,
|
|
1332
1397
|
// Translators: %1$s: Component name, %2$s: Component UID
|
|
1333
|
-
message:
|
|
1398
|
+
message: __9("Component saved successfully as: %1$s (UID: %2$s)", "elementor").replace("%1$s", values.componentName).replace("%2$s", uid),
|
|
1334
1399
|
type: "success"
|
|
1335
1400
|
});
|
|
1336
1401
|
resetAndClosePopup();
|
|
1337
1402
|
} catch {
|
|
1338
|
-
const errorMessage =
|
|
1403
|
+
const errorMessage = __9("Failed to save component. Please try again.", "elementor");
|
|
1339
1404
|
setResultNotification({
|
|
1340
1405
|
show: true,
|
|
1341
1406
|
message: errorMessage,
|
|
@@ -1354,15 +1419,15 @@ function CreateComponentForm() {
|
|
|
1354
1419
|
...eventData.current
|
|
1355
1420
|
});
|
|
1356
1421
|
};
|
|
1357
|
-
return /* @__PURE__ */
|
|
1358
|
-
|
|
1422
|
+
return /* @__PURE__ */ React10.createElement(ThemeProvider2, null, /* @__PURE__ */ React10.createElement(
|
|
1423
|
+
Popover2,
|
|
1359
1424
|
{
|
|
1360
1425
|
open: element !== null,
|
|
1361
1426
|
onClose: cancelSave,
|
|
1362
1427
|
anchorReference: "anchorPosition",
|
|
1363
1428
|
anchorPosition
|
|
1364
1429
|
},
|
|
1365
|
-
element !== null && /* @__PURE__ */
|
|
1430
|
+
element !== null && /* @__PURE__ */ React10.createElement(
|
|
1366
1431
|
Form,
|
|
1367
1432
|
{
|
|
1368
1433
|
initialValues: { componentName: element.elementLabel },
|
|
@@ -1370,7 +1435,7 @@ function CreateComponentForm() {
|
|
|
1370
1435
|
closePopup: cancelSave
|
|
1371
1436
|
}
|
|
1372
1437
|
)
|
|
1373
|
-
), /* @__PURE__ */
|
|
1438
|
+
), /* @__PURE__ */ React10.createElement(Snackbar, { open: resultNotification?.show, onClose: () => setResultNotification(null) }, /* @__PURE__ */ React10.createElement(
|
|
1374
1439
|
Alert,
|
|
1375
1440
|
{
|
|
1376
1441
|
onClose: () => setResultNotification(null),
|
|
@@ -1406,14 +1471,14 @@ var Form = ({
|
|
|
1406
1471
|
}
|
|
1407
1472
|
};
|
|
1408
1473
|
const texts = {
|
|
1409
|
-
heading:
|
|
1410
|
-
name:
|
|
1411
|
-
cancel:
|
|
1412
|
-
create:
|
|
1474
|
+
heading: __9("Save as a component", "elementor"),
|
|
1475
|
+
name: __9("Name", "elementor"),
|
|
1476
|
+
cancel: __9("Cancel", "elementor"),
|
|
1477
|
+
create: __9("Create", "elementor")
|
|
1413
1478
|
};
|
|
1414
1479
|
const nameInputId = "component-name";
|
|
1415
|
-
return /* @__PURE__ */
|
|
1416
|
-
|
|
1480
|
+
return /* @__PURE__ */ React10.createElement(FormElement, { onSubmit: handleSubmit }, /* @__PURE__ */ React10.createElement(Stack7, { alignItems: "start", width: "268px" }, /* @__PURE__ */ React10.createElement(
|
|
1481
|
+
Stack7,
|
|
1417
1482
|
{
|
|
1418
1483
|
direction: "row",
|
|
1419
1484
|
alignItems: "center",
|
|
@@ -1421,9 +1486,9 @@ var Form = ({
|
|
|
1421
1486
|
px: 1.5,
|
|
1422
1487
|
sx: { columnGap: 0.5, borderBottom: "1px solid", borderColor: "divider", width: "100%" }
|
|
1423
1488
|
},
|
|
1424
|
-
/* @__PURE__ */
|
|
1425
|
-
/* @__PURE__ */
|
|
1426
|
-
), /* @__PURE__ */
|
|
1489
|
+
/* @__PURE__ */ React10.createElement(StarIcon, { fontSize: FONT_SIZE }),
|
|
1490
|
+
/* @__PURE__ */ React10.createElement(Typography5, { variant: "caption", sx: { color: "text.primary", fontWeight: "500", lineHeight: 1 } }, texts.heading)
|
|
1491
|
+
), /* @__PURE__ */ React10.createElement(Grid, { container: true, gap: 0.75, alignItems: "start", p: 1.5 }, /* @__PURE__ */ React10.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React10.createElement(FormLabel, { htmlFor: nameInputId, size: "tiny" }, texts.name)), /* @__PURE__ */ React10.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React10.createElement(
|
|
1427
1492
|
TextField2,
|
|
1428
1493
|
{
|
|
1429
1494
|
id: nameInputId,
|
|
@@ -1435,11 +1500,11 @@ var Form = ({
|
|
|
1435
1500
|
error: Boolean(errors.componentName),
|
|
1436
1501
|
helperText: errors.componentName
|
|
1437
1502
|
}
|
|
1438
|
-
))), /* @__PURE__ */
|
|
1503
|
+
))), /* @__PURE__ */ React10.createElement(Stack7, { direction: "row", justifyContent: "flex-end", alignSelf: "end", py: 1, px: 1.5 }, /* @__PURE__ */ React10.createElement(Button2, { onClick: closePopup, color: "secondary", variant: "text", size: "small" }, texts.cancel), /* @__PURE__ */ React10.createElement(Button2, { type: "submit", disabled: !isValid, variant: "contained", color: "primary", size: "small" }, texts.create))));
|
|
1439
1504
|
};
|
|
1440
1505
|
|
|
1441
1506
|
// src/components/edit-component/edit-component.tsx
|
|
1442
|
-
import * as
|
|
1507
|
+
import * as React12 from "react";
|
|
1443
1508
|
import { useEffect as useEffect5 } from "react";
|
|
1444
1509
|
import { getV1DocumentsManager as getV1DocumentsManager4 } from "@elementor/editor-documents";
|
|
1445
1510
|
import { __privateListenTo as listenTo, commandEndEvent as commandEndEvent2 } from "@elementor/editor-v1-adapters";
|
|
@@ -1462,10 +1527,10 @@ function updateCurrentComponent({
|
|
|
1462
1527
|
}
|
|
1463
1528
|
|
|
1464
1529
|
// src/components/edit-component/component-modal.tsx
|
|
1465
|
-
import * as
|
|
1530
|
+
import * as React11 from "react";
|
|
1466
1531
|
import { useEffect as useEffect4 } from "react";
|
|
1467
1532
|
import { createPortal } from "react-dom";
|
|
1468
|
-
import { __ as
|
|
1533
|
+
import { __ as __10 } from "@wordpress/i18n";
|
|
1469
1534
|
|
|
1470
1535
|
// src/hooks/use-canvas-document.ts
|
|
1471
1536
|
import { getCanvasIframeDocument } from "@elementor/editor-canvas";
|
|
@@ -1475,10 +1540,10 @@ function useCanvasDocument() {
|
|
|
1475
1540
|
}
|
|
1476
1541
|
|
|
1477
1542
|
// src/hooks/use-element-rect.ts
|
|
1478
|
-
import { useEffect as useEffect3, useState as
|
|
1543
|
+
import { useEffect as useEffect3, useState as useState4 } from "react";
|
|
1479
1544
|
import { throttle } from "@elementor/utils";
|
|
1480
1545
|
function useElementRect(element) {
|
|
1481
|
-
const [rect, setRect] =
|
|
1546
|
+
const [rect, setRect] = useState4(new DOMRect(0, 0, 0, 0));
|
|
1482
1547
|
const onChange = throttle(
|
|
1483
1548
|
() => {
|
|
1484
1549
|
setRect(element?.getBoundingClientRect() ?? new DOMRect(0, 0, 0, 0));
|
|
@@ -1555,7 +1620,7 @@ function ComponentModal({ element, onClose }) {
|
|
|
1555
1620
|
return null;
|
|
1556
1621
|
}
|
|
1557
1622
|
return createPortal(
|
|
1558
|
-
/* @__PURE__ */
|
|
1623
|
+
/* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(BlockEditPage, null), /* @__PURE__ */ React11.createElement(Backdrop, { canvas: canvasDocument, element, onClose })),
|
|
1559
1624
|
canvasDocument.body
|
|
1560
1625
|
);
|
|
1561
1626
|
}
|
|
@@ -1579,7 +1644,7 @@ function Backdrop({ canvas, element, onClose }) {
|
|
|
1579
1644
|
onClose();
|
|
1580
1645
|
}
|
|
1581
1646
|
};
|
|
1582
|
-
return /* @__PURE__ */
|
|
1647
|
+
return /* @__PURE__ */ React11.createElement(
|
|
1583
1648
|
"div",
|
|
1584
1649
|
{
|
|
1585
1650
|
style: backdropStyle,
|
|
@@ -1587,7 +1652,7 @@ function Backdrop({ canvas, element, onClose }) {
|
|
|
1587
1652
|
onKeyDown: handleKeyDown,
|
|
1588
1653
|
role: "button",
|
|
1589
1654
|
tabIndex: 0,
|
|
1590
|
-
"aria-label":
|
|
1655
|
+
"aria-label": __10("Exit component editing mode", "elementor")
|
|
1591
1656
|
}
|
|
1592
1657
|
);
|
|
1593
1658
|
}
|
|
@@ -1637,7 +1702,7 @@ function BlockEditPage() {
|
|
|
1637
1702
|
}
|
|
1638
1703
|
}
|
|
1639
1704
|
`;
|
|
1640
|
-
return /* @__PURE__ */
|
|
1705
|
+
return /* @__PURE__ */ React11.createElement("style", { "data-e-style-id": "e-block-v3-document-handles-styles" }, blockV3DocumentHandlesStyles);
|
|
1641
1706
|
}
|
|
1642
1707
|
|
|
1643
1708
|
// src/components/edit-component/edit-component.tsx
|
|
@@ -1650,7 +1715,7 @@ function EditComponent() {
|
|
|
1650
1715
|
if (!elementDom) {
|
|
1651
1716
|
return null;
|
|
1652
1717
|
}
|
|
1653
|
-
return /* @__PURE__ */
|
|
1718
|
+
return /* @__PURE__ */ React12.createElement(ComponentModal, { element: elementDom, onClose });
|
|
1654
1719
|
}
|
|
1655
1720
|
function useHandleDocumentSwitches() {
|
|
1656
1721
|
const documentsManager = getV1DocumentsManager4();
|
|
@@ -1703,33 +1768,33 @@ function getComponentDOMElement(id) {
|
|
|
1703
1768
|
}
|
|
1704
1769
|
|
|
1705
1770
|
// src/components/in-edit-mode.tsx
|
|
1706
|
-
import * as
|
|
1771
|
+
import * as React13 from "react";
|
|
1707
1772
|
import { closeDialog, openDialog } from "@elementor/editor-ui";
|
|
1708
1773
|
import { InfoCircleFilledIcon } from "@elementor/icons";
|
|
1709
|
-
import { Box as
|
|
1710
|
-
import { __ as
|
|
1774
|
+
import { Box as Box8, Button as Button3, DialogActions, DialogContent, DialogHeader, Icon as Icon2, Stack as Stack8, Typography as Typography6 } from "@elementor/ui";
|
|
1775
|
+
import { __ as __11 } from "@wordpress/i18n";
|
|
1711
1776
|
var openEditModeDialog = (lockedBy) => {
|
|
1712
1777
|
openDialog({
|
|
1713
|
-
component: /* @__PURE__ */
|
|
1778
|
+
component: /* @__PURE__ */ React13.createElement(EditModeDialog, { lockedBy })
|
|
1714
1779
|
});
|
|
1715
1780
|
};
|
|
1716
1781
|
var EditModeDialog = ({ lockedBy }) => {
|
|
1717
|
-
const content =
|
|
1718
|
-
return /* @__PURE__ */
|
|
1782
|
+
const content = __11("%s is currently editing this document", "elementor").replace("%s", lockedBy);
|
|
1783
|
+
return /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(DialogHeader, { logo: false }, /* @__PURE__ */ React13.createElement(Box8, { display: "flex", alignItems: "center", gap: 1 }, /* @__PURE__ */ React13.createElement(Icon2, { color: "secondary" }, /* @__PURE__ */ React13.createElement(InfoCircleFilledIcon, { fontSize: "medium" })), /* @__PURE__ */ React13.createElement(Typography6, { variant: "subtitle1" }, content))), /* @__PURE__ */ React13.createElement(DialogContent, null, /* @__PURE__ */ React13.createElement(Stack8, { spacing: 2, direction: "column" }, /* @__PURE__ */ React13.createElement(Typography6, { variant: "body2" }, __11(
|
|
1719
1784
|
"You can wait for them to finish or reach out to coordinate your changes together.",
|
|
1720
1785
|
"elementor"
|
|
1721
|
-
)), /* @__PURE__ */
|
|
1786
|
+
)), /* @__PURE__ */ React13.createElement(DialogActions, null, /* @__PURE__ */ React13.createElement(Button3, { color: "secondary", variant: "contained", onClick: closeDialog }, __11("Close", "elementor"))))));
|
|
1722
1787
|
};
|
|
1723
1788
|
|
|
1724
1789
|
// src/components/instance-editing-panel/instance-editing-panel.tsx
|
|
1725
|
-
import * as
|
|
1790
|
+
import * as React16 from "react";
|
|
1726
1791
|
import { useElement } from "@elementor/editor-editing-panel";
|
|
1727
1792
|
import { useElementSetting, useSelectedElement } from "@elementor/editor-elements";
|
|
1728
1793
|
import { PanelBody, PanelHeader, PanelHeaderTitle } from "@elementor/editor-panels";
|
|
1729
1794
|
import { ComponentsIcon as ComponentsIcon3, PencilIcon as PencilIcon2 } from "@elementor/icons";
|
|
1730
1795
|
import { __getState as getState5 } from "@elementor/store";
|
|
1731
|
-
import { IconButton as IconButton3, Stack as
|
|
1732
|
-
import { __ as
|
|
1796
|
+
import { IconButton as IconButton3, Stack as Stack11, Tooltip as Tooltip2 } from "@elementor/ui";
|
|
1797
|
+
import { __ as __13 } from "@wordpress/i18n";
|
|
1733
1798
|
|
|
1734
1799
|
// src/prop-types/component-instance-prop-type.ts
|
|
1735
1800
|
import { createPropUtils as createPropUtils3, numberPropTypeUtil } from "@elementor/editor-props";
|
|
@@ -1770,13 +1835,13 @@ var componentInstancePropTypeUtil = createPropUtils3(
|
|
|
1770
1835
|
);
|
|
1771
1836
|
|
|
1772
1837
|
// src/components/instance-editing-panel/empty-state.tsx
|
|
1773
|
-
import * as
|
|
1838
|
+
import * as React14 from "react";
|
|
1774
1839
|
import { ComponentPropListIcon as ComponentPropListIcon2, PencilIcon } from "@elementor/icons";
|
|
1775
|
-
import { Button as
|
|
1776
|
-
import { __ as
|
|
1840
|
+
import { Button as Button4, Stack as Stack9, Typography as Typography7 } from "@elementor/ui";
|
|
1841
|
+
import { __ as __12 } from "@wordpress/i18n";
|
|
1777
1842
|
var EmptyState2 = ({ onEditComponent }) => {
|
|
1778
|
-
return /* @__PURE__ */
|
|
1779
|
-
|
|
1843
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1844
|
+
Stack9,
|
|
1780
1845
|
{
|
|
1781
1846
|
alignItems: "center",
|
|
1782
1847
|
justifyContent: "start",
|
|
@@ -1785,22 +1850,22 @@ var EmptyState2 = ({ onEditComponent }) => {
|
|
|
1785
1850
|
sx: { p: 2.5, pt: 8, pb: 5.5, mt: 1 },
|
|
1786
1851
|
gap: 1.5
|
|
1787
1852
|
},
|
|
1788
|
-
/* @__PURE__ */
|
|
1789
|
-
/* @__PURE__ */
|
|
1790
|
-
/* @__PURE__ */
|
|
1853
|
+
/* @__PURE__ */ React14.createElement(ComponentPropListIcon2, { fontSize: "large" }),
|
|
1854
|
+
/* @__PURE__ */ React14.createElement(Typography7, { align: "center", variant: "subtitle2" }, __12("No properties yet", "elementor")),
|
|
1855
|
+
/* @__PURE__ */ React14.createElement(Typography7, { align: "center", variant: "caption", maxWidth: "170px" }, __12(
|
|
1791
1856
|
"Edit the component to add properties, manage them or update the design across all instances.",
|
|
1792
1857
|
"elementor"
|
|
1793
1858
|
)),
|
|
1794
|
-
/* @__PURE__ */
|
|
1859
|
+
/* @__PURE__ */ React14.createElement(Button4, { variant: "outlined", color: "secondary", size: "small", sx: { mt: 1 }, onClick: onEditComponent }, /* @__PURE__ */ React14.createElement(PencilIcon, { fontSize: "small" }), __12("Edit component", "elementor"))
|
|
1795
1860
|
);
|
|
1796
1861
|
};
|
|
1797
1862
|
|
|
1798
1863
|
// src/components/instance-editing-panel/override-props-group.tsx
|
|
1799
|
-
import * as
|
|
1864
|
+
import * as React15 from "react";
|
|
1800
1865
|
import { useId } from "react";
|
|
1801
1866
|
import { useStateByElement } from "@elementor/editor-editing-panel";
|
|
1802
1867
|
import { CollapseIcon } from "@elementor/editor-ui";
|
|
1803
|
-
import { Collapse, ListItemButton as ListItemButton3, ListItemText, Stack as
|
|
1868
|
+
import { Collapse, ListItemButton as ListItemButton3, ListItemText, Stack as Stack10 } from "@elementor/ui";
|
|
1804
1869
|
function OverridePropsGroup({ group, props }) {
|
|
1805
1870
|
const [isOpen, setIsOpen] = useStateByElement(group.id, true);
|
|
1806
1871
|
const handleClick = () => {
|
|
@@ -1810,7 +1875,7 @@ function OverridePropsGroup({ group, props }) {
|
|
|
1810
1875
|
const labelId = `label-${id}`;
|
|
1811
1876
|
const contentId = `content-${id}`;
|
|
1812
1877
|
const title = group.label;
|
|
1813
|
-
return /* @__PURE__ */
|
|
1878
|
+
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(
|
|
1814
1879
|
ListItemButton3,
|
|
1815
1880
|
{
|
|
1816
1881
|
id: labelId,
|
|
@@ -1820,7 +1885,7 @@ function OverridePropsGroup({ group, props }) {
|
|
|
1820
1885
|
p: 0,
|
|
1821
1886
|
sx: { "&:hover": { backgroundColor: "transparent" } }
|
|
1822
1887
|
},
|
|
1823
|
-
/* @__PURE__ */
|
|
1888
|
+
/* @__PURE__ */ React15.createElement(Stack10, { direction: "row", alignItems: "center", justifyItems: "start", flexGrow: 1, gap: 0.5 }, /* @__PURE__ */ React15.createElement(
|
|
1824
1889
|
ListItemText,
|
|
1825
1890
|
{
|
|
1826
1891
|
secondary: title,
|
|
@@ -1828,10 +1893,10 @@ function OverridePropsGroup({ group, props }) {
|
|
|
1828
1893
|
sx: { flexGrow: 0, flexShrink: 1, marginInlineEnd: 1 }
|
|
1829
1894
|
}
|
|
1830
1895
|
)),
|
|
1831
|
-
/* @__PURE__ */
|
|
1832
|
-
), /* @__PURE__ */
|
|
1896
|
+
/* @__PURE__ */ React15.createElement(CollapseIcon, { open: isOpen, color: "secondary", fontSize: "tiny" })
|
|
1897
|
+
), /* @__PURE__ */ React15.createElement(Collapse, { id: contentId, "aria-labelledby": labelId, in: isOpen, timeout: "auto" }, /* @__PURE__ */ React15.createElement(Stack10, { direction: "column", gap: 1, p: 2 }, group.props.map((propId) => (
|
|
1833
1898
|
// TODO: Render actual controls
|
|
1834
|
-
/* @__PURE__ */
|
|
1899
|
+
/* @__PURE__ */ React15.createElement("pre", { key: propId }, JSON.stringify(props[propId], null, 2))
|
|
1835
1900
|
)))));
|
|
1836
1901
|
}
|
|
1837
1902
|
|
|
@@ -1846,17 +1911,17 @@ function InstanceEditingPanel() {
|
|
|
1846
1911
|
if (!componentId || !overridableProps || !component) {
|
|
1847
1912
|
return null;
|
|
1848
1913
|
}
|
|
1849
|
-
const panelTitle =
|
|
1914
|
+
const panelTitle = __13("Edit %s", "elementor").replace("%s", component.name);
|
|
1850
1915
|
const handleEditComponent = () => switchToComponent(componentId, componentInstanceId);
|
|
1851
1916
|
const groups = overridableProps.groups.order.map(
|
|
1852
1917
|
(groupId) => overridableProps.groups.items[groupId] ? overridableProps.groups.items[groupId] : null
|
|
1853
1918
|
).filter(Boolean);
|
|
1854
1919
|
const isEmpty = groups.length === 0 || Object.keys(overridableProps.props).length === 0;
|
|
1855
|
-
return /* @__PURE__ */
|
|
1920
|
+
return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(PanelHeader, { sx: { justifyContent: "start", px: 2 } }, /* @__PURE__ */ React16.createElement(Stack11, { direction: "row", alignContent: "space-between", flexGrow: 1 }, /* @__PURE__ */ React16.createElement(Stack11, { direction: "row", alignItems: "center", justifyContent: "start", gap: 1, flexGrow: 1 }, /* @__PURE__ */ React16.createElement(ComponentsIcon3, { fontSize: "small", sx: { color: "text.tertiary" } }), /* @__PURE__ */ React16.createElement(PanelHeaderTitle, null, component.name)), /* @__PURE__ */ React16.createElement(Tooltip2, { title: panelTitle }, /* @__PURE__ */ React16.createElement(IconButton3, { size: "tiny", onClick: handleEditComponent, "aria-label": panelTitle }, /* @__PURE__ */ React16.createElement(PencilIcon2, { fontSize: "tiny" }))))), /* @__PURE__ */ React16.createElement(PanelBody, null, isEmpty ? /* @__PURE__ */ React16.createElement(EmptyState2, { onEditComponent: handleEditComponent }) : /* @__PURE__ */ React16.createElement(Stack11, { direction: "column", alignItems: "stretch" }, groups.map((group) => /* @__PURE__ */ React16.createElement(OverridePropsGroup, { key: group.id, group, props: overridableProps.props })))));
|
|
1856
1921
|
}
|
|
1857
1922
|
|
|
1858
1923
|
// src/components/overridable-props/overridable-prop-control.tsx
|
|
1859
|
-
import * as
|
|
1924
|
+
import * as React18 from "react";
|
|
1860
1925
|
import { ControlReplacementsProvider, PropKeyProvider, PropProvider, useBoundProp } from "@elementor/editor-controls";
|
|
1861
1926
|
import { createTopLevelObjectType, useElement as useElement2 } from "@elementor/editor-editing-panel";
|
|
1862
1927
|
|
|
@@ -1875,11 +1940,11 @@ var componentOverridablePropTypeUtil = createPropUtils4(
|
|
|
1875
1940
|
);
|
|
1876
1941
|
|
|
1877
1942
|
// src/provider/overridable-prop-context.tsx
|
|
1878
|
-
import * as
|
|
1943
|
+
import * as React17 from "react";
|
|
1879
1944
|
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
1880
1945
|
var OverridablePropContext = createContext2(null);
|
|
1881
1946
|
function OverridablePropProvider({ children, ...props }) {
|
|
1882
|
-
return /* @__PURE__ */
|
|
1947
|
+
return /* @__PURE__ */ React17.createElement(OverridablePropContext.Provider, { value: props }, children);
|
|
1883
1948
|
}
|
|
1884
1949
|
var useOverridablePropValue = () => useContext2(OverridablePropContext)?.value;
|
|
1885
1950
|
|
|
@@ -1940,7 +2005,7 @@ function OverridablePropControl({
|
|
|
1940
2005
|
}
|
|
1941
2006
|
});
|
|
1942
2007
|
const objectPlaceholder = placeholder ? { [bind]: placeholder } : void 0;
|
|
1943
|
-
return /* @__PURE__ */
|
|
2008
|
+
return /* @__PURE__ */ React18.createElement(OverridablePropProvider, { value }, /* @__PURE__ */ React18.createElement(
|
|
1944
2009
|
PropProvider,
|
|
1945
2010
|
{
|
|
1946
2011
|
...propContext,
|
|
@@ -1949,23 +2014,23 @@ function OverridablePropControl({
|
|
|
1949
2014
|
value: { [bind]: value.origin_value },
|
|
1950
2015
|
placeholder: objectPlaceholder
|
|
1951
2016
|
},
|
|
1952
|
-
/* @__PURE__ */
|
|
2017
|
+
/* @__PURE__ */ React18.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React18.createElement(ControlReplacementsProvider, { replacements: [] }, /* @__PURE__ */ React18.createElement(OriginalControl, { ...props })))
|
|
1953
2018
|
));
|
|
1954
2019
|
}
|
|
1955
2020
|
|
|
1956
2021
|
// src/components/overridable-props/overridable-prop-indicator.tsx
|
|
1957
|
-
import * as
|
|
2022
|
+
import * as React21 from "react";
|
|
1958
2023
|
import { useBoundProp as useBoundProp2 } from "@elementor/editor-controls";
|
|
1959
2024
|
import { useElement as useElement3 } from "@elementor/editor-editing-panel";
|
|
1960
2025
|
import { getWidgetsCache } from "@elementor/editor-elements";
|
|
1961
2026
|
import { __getState as getState9 } from "@elementor/store";
|
|
1962
|
-
import { bindPopover, bindTrigger as bindTrigger2, Popover as
|
|
1963
|
-
import { __ as
|
|
2027
|
+
import { bindPopover, bindTrigger as bindTrigger2, Popover as Popover3, Tooltip as Tooltip3, usePopupState as usePopupState2 } from "@elementor/ui";
|
|
2028
|
+
import { __ as __17 } from "@wordpress/i18n";
|
|
1964
2029
|
|
|
1965
2030
|
// src/store/actions/set-overridable-prop.ts
|
|
1966
2031
|
import { __dispatch as dispatch5, __getState as getState7 } from "@elementor/store";
|
|
1967
2032
|
import { generateUniqueId as generateUniqueId2 } from "@elementor/utils";
|
|
1968
|
-
import { __ as
|
|
2033
|
+
import { __ as __14 } from "@wordpress/i18n";
|
|
1969
2034
|
function setOverridableProp({
|
|
1970
2035
|
componentId,
|
|
1971
2036
|
overrideKey,
|
|
@@ -2055,7 +2120,7 @@ function addNewGroup(groups, groupId) {
|
|
|
2055
2120
|
...groups.items,
|
|
2056
2121
|
[currentGroupId]: {
|
|
2057
2122
|
id: currentGroupId,
|
|
2058
|
-
label:
|
|
2123
|
+
label: __14("Default", "elementor"),
|
|
2059
2124
|
props: []
|
|
2060
2125
|
}
|
|
2061
2126
|
},
|
|
@@ -2105,13 +2170,13 @@ function removeProps({
|
|
|
2105
2170
|
}
|
|
2106
2171
|
|
|
2107
2172
|
// src/components/overridable-props/indicator.tsx
|
|
2108
|
-
import * as
|
|
2109
|
-
import { forwardRef } from "react";
|
|
2173
|
+
import * as React19 from "react";
|
|
2174
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
2110
2175
|
import { CheckIcon, PlusIcon } from "@elementor/icons";
|
|
2111
|
-
import { Box as
|
|
2112
|
-
import { __ as
|
|
2176
|
+
import { Box as Box9, styled as styled2 } from "@elementor/ui";
|
|
2177
|
+
import { __ as __15 } from "@wordpress/i18n";
|
|
2113
2178
|
var SIZE = "tiny";
|
|
2114
|
-
var IconContainer = styled2(
|
|
2179
|
+
var IconContainer = styled2(Box9)`
|
|
2115
2180
|
pointer-events: none;
|
|
2116
2181
|
opacity: 0;
|
|
2117
2182
|
transition: opacity 0.2s ease-in-out;
|
|
@@ -2128,7 +2193,7 @@ var IconContainer = styled2(Box8)`
|
|
|
2128
2193
|
stroke-width: 2px;
|
|
2129
2194
|
}
|
|
2130
2195
|
`;
|
|
2131
|
-
var Content = styled2(
|
|
2196
|
+
var Content = styled2(Box9)`
|
|
2132
2197
|
position: relative;
|
|
2133
2198
|
display: flex;
|
|
2134
2199
|
align-items: center;
|
|
@@ -2165,33 +2230,33 @@ var Content = styled2(Box8)`
|
|
|
2165
2230
|
}
|
|
2166
2231
|
}
|
|
2167
2232
|
`;
|
|
2168
|
-
var Indicator =
|
|
2233
|
+
var Indicator = forwardRef2(({ isOpen, isOverridable, ...props }, ref) => /* @__PURE__ */ React19.createElement(Content, { ref, ...props, className: isOpen || isOverridable ? "enlarged" : "" }, /* @__PURE__ */ React19.createElement(
|
|
2169
2234
|
IconContainer,
|
|
2170
2235
|
{
|
|
2171
2236
|
className: "icon",
|
|
2172
|
-
"aria-label": isOverridable ?
|
|
2237
|
+
"aria-label": isOverridable ? __15("Overridable property", "elementor") : __15("Make prop overridable", "elementor")
|
|
2173
2238
|
},
|
|
2174
|
-
isOverridable ? /* @__PURE__ */
|
|
2239
|
+
isOverridable ? /* @__PURE__ */ React19.createElement(CheckIcon, { fontSize: SIZE }) : /* @__PURE__ */ React19.createElement(PlusIcon, { fontSize: SIZE })
|
|
2175
2240
|
)));
|
|
2176
2241
|
|
|
2177
2242
|
// src/components/overridable-props/overridable-prop-form.tsx
|
|
2178
|
-
import * as
|
|
2179
|
-
import { useState as
|
|
2243
|
+
import * as React20 from "react";
|
|
2244
|
+
import { useState as useState5 } from "react";
|
|
2180
2245
|
import { Form as Form2, MenuListItem as MenuListItem2 } from "@elementor/editor-ui";
|
|
2181
|
-
import { Button as
|
|
2182
|
-
import { __ as
|
|
2246
|
+
import { Button as Button5, FormLabel as FormLabel2, Grid as Grid2, Select, Stack as Stack12, TextField as TextField3, Typography as Typography8 } from "@elementor/ui";
|
|
2247
|
+
import { __ as __16 } from "@wordpress/i18n";
|
|
2183
2248
|
var SIZE2 = "tiny";
|
|
2184
|
-
var DEFAULT_GROUP = { value: null, label:
|
|
2249
|
+
var DEFAULT_GROUP = { value: null, label: __16("Default", "elementor") };
|
|
2185
2250
|
function OverridablePropForm({ onSubmit, groups, currentValue }) {
|
|
2186
|
-
const [propLabel, setPropLabel] =
|
|
2187
|
-
const [group, setGroup] =
|
|
2188
|
-
const name =
|
|
2189
|
-
const groupName =
|
|
2251
|
+
const [propLabel, setPropLabel] = useState5(currentValue?.label ?? null);
|
|
2252
|
+
const [group, setGroup] = useState5(currentValue?.groupId ?? groups?.[0]?.value ?? null);
|
|
2253
|
+
const name = __16("Name", "elementor");
|
|
2254
|
+
const groupName = __16("Group Name", "elementor");
|
|
2190
2255
|
const isCreate = currentValue === void 0;
|
|
2191
|
-
const title = isCreate ?
|
|
2192
|
-
const ctaLabel = isCreate ?
|
|
2193
|
-
return /* @__PURE__ */
|
|
2194
|
-
|
|
2256
|
+
const title = isCreate ? __16("Create new property", "elementor") : __16("Update property", "elementor");
|
|
2257
|
+
const ctaLabel = isCreate ? __16("Create", "elementor") : __16("Update", "elementor");
|
|
2258
|
+
return /* @__PURE__ */ React20.createElement(Form2, { onSubmit: () => onSubmit({ label: propLabel ?? "", group }) }, /* @__PURE__ */ React20.createElement(Stack12, { alignItems: "start", width: "268px" }, /* @__PURE__ */ React20.createElement(
|
|
2259
|
+
Stack12,
|
|
2195
2260
|
{
|
|
2196
2261
|
direction: "row",
|
|
2197
2262
|
alignItems: "center",
|
|
@@ -2199,18 +2264,18 @@ function OverridablePropForm({ onSubmit, groups, currentValue }) {
|
|
|
2199
2264
|
px: 1.5,
|
|
2200
2265
|
sx: { columnGap: 0.5, borderBottom: "1px solid", borderColor: "divider", width: "100%", mb: 1.5 }
|
|
2201
2266
|
},
|
|
2202
|
-
/* @__PURE__ */
|
|
2203
|
-
), /* @__PURE__ */
|
|
2267
|
+
/* @__PURE__ */ React20.createElement(Typography8, { variant: "caption", sx: { color: "text.primary", fontWeight: "500", lineHeight: 1 } }, title)
|
|
2268
|
+
), /* @__PURE__ */ React20.createElement(Grid2, { container: true, gap: 0.75, alignItems: "start", px: 1.5, mb: 1.5 }, /* @__PURE__ */ React20.createElement(Grid2, { item: true, xs: 12 }, /* @__PURE__ */ React20.createElement(FormLabel2, { size: "tiny" }, name)), /* @__PURE__ */ React20.createElement(Grid2, { item: true, xs: 12 }, /* @__PURE__ */ React20.createElement(
|
|
2204
2269
|
TextField3,
|
|
2205
2270
|
{
|
|
2206
2271
|
name,
|
|
2207
2272
|
size: SIZE2,
|
|
2208
2273
|
fullWidth: true,
|
|
2209
|
-
placeholder:
|
|
2274
|
+
placeholder: __16("Enter value", "elementor"),
|
|
2210
2275
|
value: propLabel ?? "",
|
|
2211
2276
|
onChange: (e) => setPropLabel(e.target.value)
|
|
2212
2277
|
}
|
|
2213
|
-
))), /* @__PURE__ */
|
|
2278
|
+
))), /* @__PURE__ */ React20.createElement(Grid2, { container: true, gap: 0.75, alignItems: "start", px: 1.5, mb: 1.5 }, /* @__PURE__ */ React20.createElement(Grid2, { item: true, xs: 12 }, /* @__PURE__ */ React20.createElement(FormLabel2, { size: "tiny" }, groupName)), /* @__PURE__ */ React20.createElement(Grid2, { item: true, xs: 12 }, /* @__PURE__ */ React20.createElement(
|
|
2214
2279
|
Select,
|
|
2215
2280
|
{
|
|
2216
2281
|
name: groupName,
|
|
@@ -2227,8 +2292,8 @@ function OverridablePropForm({ onSubmit, groups, currentValue }) {
|
|
|
2227
2292
|
return groups?.find(({ value }) => value === selectedValue)?.label ?? selectedValue;
|
|
2228
2293
|
}
|
|
2229
2294
|
},
|
|
2230
|
-
(groups ?? [DEFAULT_GROUP]).map(({ label: groupLabel, ...props }) => /* @__PURE__ */
|
|
2231
|
-
))), /* @__PURE__ */
|
|
2295
|
+
(groups ?? [DEFAULT_GROUP]).map(({ label: groupLabel, ...props }) => /* @__PURE__ */ React20.createElement(MenuListItem2, { key: props.value, ...props, value: props.value ?? "" }, groupLabel))
|
|
2296
|
+
))), /* @__PURE__ */ React20.createElement(Stack12, { direction: "row", justifyContent: "flex-end", alignSelf: "end", mt: 1.5, py: 1, px: 1.5 }, /* @__PURE__ */ React20.createElement(Button5, { type: "submit", disabled: !propLabel, variant: "contained", color: "primary", size: "small" }, ctaLabel))));
|
|
2232
2297
|
}
|
|
2233
2298
|
|
|
2234
2299
|
// src/components/overridable-props/utils/get-overridable-prop.ts
|
|
@@ -2253,7 +2318,7 @@ function OverridablePropIndicator() {
|
|
|
2253
2318
|
return null;
|
|
2254
2319
|
}
|
|
2255
2320
|
const overridableProps = selectOverridableProps(getState9(), componentId);
|
|
2256
|
-
return /* @__PURE__ */
|
|
2321
|
+
return /* @__PURE__ */ React21.createElement(Content2, { componentId, overridableProps });
|
|
2257
2322
|
}
|
|
2258
2323
|
function Content2({ componentId, overridableProps }) {
|
|
2259
2324
|
const {
|
|
@@ -2294,8 +2359,8 @@ function Content2({ componentId, overridableProps }) {
|
|
|
2294
2359
|
popupState.close();
|
|
2295
2360
|
};
|
|
2296
2361
|
const overridableConfig = overridableValue ? getOverridableProp({ componentId, overrideKey: overridableValue.override_key }) : void 0;
|
|
2297
|
-
return /* @__PURE__ */
|
|
2298
|
-
|
|
2362
|
+
return /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(Tooltip3, { placement: "top", title: __17("Override Property", "elementor") }, /* @__PURE__ */ React21.createElement(Indicator, { ...triggerProps, isOpen: !!popoverProps.open, isOverridable: !!overridableValue })), /* @__PURE__ */ React21.createElement(
|
|
2363
|
+
Popover3,
|
|
2299
2364
|
{
|
|
2300
2365
|
disableScrollLock: true,
|
|
2301
2366
|
anchorOrigin: {
|
|
@@ -2311,7 +2376,7 @@ function Content2({ componentId, overridableProps }) {
|
|
|
2311
2376
|
},
|
|
2312
2377
|
...popoverProps
|
|
2313
2378
|
},
|
|
2314
|
-
/* @__PURE__ */
|
|
2379
|
+
/* @__PURE__ */ React21.createElement(
|
|
2315
2380
|
OverridablePropForm,
|
|
2316
2381
|
{
|
|
2317
2382
|
onSubmit: handleSubmit,
|
|
@@ -2875,7 +2940,7 @@ function init() {
|
|
|
2875
2940
|
window.elementorCommon.__beforeSave = beforeSave;
|
|
2876
2941
|
injectTab({
|
|
2877
2942
|
id: "components",
|
|
2878
|
-
label:
|
|
2943
|
+
label: __18("Components", "elementor"),
|
|
2879
2944
|
component: Components
|
|
2880
2945
|
});
|
|
2881
2946
|
injectIntoTop({
|