@elementor/editor-app-bar 4.3.0-986 → 4.3.0-988
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/README.md +62 -3
- package/dist/index.js +174 -95
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +171 -92
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -12
- package/src/components/app-bar.tsx +41 -19
- package/src/components/locations/tools-menu-location.tsx +4 -4
- package/src/components/locations/utilities-menu-location.tsx +6 -6
- package/src/constants.ts +14 -0
- package/src/contexts/app-bar-size-context.tsx +14 -0
- package/src/hooks/use-container-width.ts +29 -0
- package/src/utils/get-max-toolbar-actions.ts +25 -0
package/dist/index.mjs
CHANGED
|
@@ -189,19 +189,75 @@ var documentOptionsMenu = createMenu2({
|
|
|
189
189
|
import { injectIntoTop as injectIntoTop2 } from "@elementor/editor";
|
|
190
190
|
|
|
191
191
|
// src/components/app-bar.tsx
|
|
192
|
-
import * as
|
|
192
|
+
import * as React23 from "react";
|
|
193
|
+
import { useRef } from "react";
|
|
193
194
|
import { __useActiveDocument as useActiveDocument } from "@elementor/editor-documents";
|
|
194
195
|
import { AppBar as BaseAppBar, Box as Box3, Divider as Divider2, Grid, ThemeProvider as ThemeProvider3, Toolbar } from "@elementor/ui";
|
|
195
196
|
|
|
197
|
+
// src/constants.ts
|
|
198
|
+
var MIN_APP_BAR_WIDTH = 800;
|
|
199
|
+
var DEFAULT_MAX_TOOLBAR_ACTIONS = {
|
|
200
|
+
tools: 5,
|
|
201
|
+
utilities: 4
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
// src/contexts/app-bar-size-context.tsx
|
|
205
|
+
import * as React8 from "react";
|
|
206
|
+
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
207
|
+
var AppBarSizeContext = createContext2(DEFAULT_MAX_TOOLBAR_ACTIONS);
|
|
208
|
+
function AppBarSizeProvider({ value, children }) {
|
|
209
|
+
return /* @__PURE__ */ React8.createElement(AppBarSizeContext.Provider, { value }, children);
|
|
210
|
+
}
|
|
211
|
+
function useMaxToolbarActions() {
|
|
212
|
+
return useContext2(AppBarSizeContext);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// src/hooks/use-container-width.ts
|
|
216
|
+
import { useEffect, useState } from "react";
|
|
217
|
+
function useContainerWidth(ref) {
|
|
218
|
+
const [width, setWidth] = useState(0);
|
|
219
|
+
useEffect(() => {
|
|
220
|
+
const element = ref.current;
|
|
221
|
+
if (!element || typeof ResizeObserver === "undefined") {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
const observer = new ResizeObserver((entries) => {
|
|
225
|
+
const entry = entries[0];
|
|
226
|
+
if (entry) {
|
|
227
|
+
setWidth(entry.contentRect.width);
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
setWidth(element.getBoundingClientRect().width);
|
|
231
|
+
observer.observe(element);
|
|
232
|
+
return () => observer.disconnect();
|
|
233
|
+
}, [ref]);
|
|
234
|
+
return width;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// src/utils/get-max-toolbar-actions.ts
|
|
238
|
+
var BREAKPOINTS = [
|
|
239
|
+
{ minWidth: 1200, ...DEFAULT_MAX_TOOLBAR_ACTIONS },
|
|
240
|
+
{ minWidth: 950, tools: 3, utilities: 2 },
|
|
241
|
+
{ minWidth: MIN_APP_BAR_WIDTH, tools: 1, utilities: 0 },
|
|
242
|
+
{ minWidth: 0, tools: 0, utilities: 0 }
|
|
243
|
+
];
|
|
244
|
+
function getMaxToolbarActions(containerWidth) {
|
|
245
|
+
if (!containerWidth) {
|
|
246
|
+
return DEFAULT_MAX_TOOLBAR_ACTIONS;
|
|
247
|
+
}
|
|
248
|
+
const breakpoint = BREAKPOINTS.find(({ minWidth }) => containerWidth >= minWidth) ?? BREAKPOINTS.at(-1);
|
|
249
|
+
return { tools: breakpoint?.tools ?? 0, utilities: breakpoint?.utilities ?? 0 };
|
|
250
|
+
}
|
|
251
|
+
|
|
196
252
|
// src/components/locations/main-menu-location.tsx
|
|
197
|
-
import * as
|
|
253
|
+
import * as React11 from "react";
|
|
198
254
|
import { bindMenu, bindTrigger, Divider, Stack, usePopupState } from "@elementor/ui";
|
|
199
255
|
|
|
200
256
|
// src/components/ui/popover-menu.tsx
|
|
201
|
-
import * as
|
|
257
|
+
import * as React9 from "react";
|
|
202
258
|
import { Menu } from "@elementor/ui";
|
|
203
259
|
function PopoverMenu({ children, popupState, ...props }) {
|
|
204
|
-
return /* @__PURE__ */
|
|
260
|
+
return /* @__PURE__ */ React9.createElement(MenuContextProvider, { type: "popover", popupState }, /* @__PURE__ */ React9.createElement(
|
|
205
261
|
Menu,
|
|
206
262
|
{
|
|
207
263
|
PaperProps: {
|
|
@@ -218,12 +274,12 @@ function PopoverMenu({ children, popupState, ...props }) {
|
|
|
218
274
|
}
|
|
219
275
|
|
|
220
276
|
// src/components/ui/toolbar-logo.tsx
|
|
221
|
-
import * as
|
|
222
|
-
import { useState } from "react";
|
|
277
|
+
import * as React10 from "react";
|
|
278
|
+
import { useState as useState2 } from "react";
|
|
223
279
|
import { styled, SvgIcon, ToggleButton as ToggleButton2 } from "@elementor/ui";
|
|
224
280
|
import { __ } from "@wordpress/i18n";
|
|
225
281
|
var ElementorLogo = (props) => {
|
|
226
|
-
return /* @__PURE__ */
|
|
282
|
+
return /* @__PURE__ */ React10.createElement(SvgIcon, { viewBox: "0 0 32 32", ...props }, /* @__PURE__ */ React10.createElement("g", null, /* @__PURE__ */ React10.createElement("circle", { cx: "16", cy: "16", r: "16" }), /* @__PURE__ */ React10.createElement("path", { d: "M11.7 9H9V22.3H11.7V9Z" }), /* @__PURE__ */ React10.createElement("path", { d: "M22.4 9H9V11.7H22.4V9Z" }), /* @__PURE__ */ React10.createElement("path", { d: "M22.4 14.4004H9V17.1004H22.4V14.4004Z" }), /* @__PURE__ */ React10.createElement("path", { d: "M22.4 19.6992H9V22.3992H22.4V19.6992Z" })));
|
|
227
283
|
};
|
|
228
284
|
var StyledToggleButton = styled(ToggleButton2)(({ theme }) => ({
|
|
229
285
|
padding: 0,
|
|
@@ -263,9 +319,9 @@ var StyledElementorLogo = styled(ElementorLogo, {
|
|
|
263
319
|
}
|
|
264
320
|
}));
|
|
265
321
|
function ToolbarLogo(props) {
|
|
266
|
-
const [isHoverState, setIsHoverState] =
|
|
322
|
+
const [isHoverState, setIsHoverState] = useState2(false);
|
|
267
323
|
const showMenuIcon = props.selected || isHoverState;
|
|
268
|
-
return /* @__PURE__ */
|
|
324
|
+
return /* @__PURE__ */ React10.createElement(
|
|
269
325
|
StyledToggleButton,
|
|
270
326
|
{
|
|
271
327
|
...props,
|
|
@@ -274,7 +330,7 @@ function ToolbarLogo(props) {
|
|
|
274
330
|
onMouseEnter: () => setIsHoverState(true),
|
|
275
331
|
onMouseLeave: () => setIsHoverState(false)
|
|
276
332
|
},
|
|
277
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ React10.createElement(
|
|
278
334
|
StyledElementorLogo,
|
|
279
335
|
{
|
|
280
336
|
fontSize: "large",
|
|
@@ -307,33 +363,33 @@ function MainMenuLocation() {
|
|
|
307
363
|
}
|
|
308
364
|
toolbarLogoProps.onClick(e);
|
|
309
365
|
};
|
|
310
|
-
return /* @__PURE__ */
|
|
366
|
+
return /* @__PURE__ */ React11.createElement(Stack, { sx: { paddingInlineStart: 3 }, direction: "row", alignItems: "center" }, /* @__PURE__ */ React11.createElement(ToolbarLogo, { ...toolbarLogoProps, onClick: onToolbarClick, selected: popupState.isOpen }), /* @__PURE__ */ React11.createElement(PopoverMenu, { onClick: popupState.close, ...bindMenu(popupState), marginThreshold: 8 }, menuItems.default.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React11.createElement(MenuItem2, { key: id })), /* @__PURE__ */ React11.createElement(Divider, null), menuItems.help.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React11.createElement(MenuItem2, { key: id })), menuItems.exits.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React11.createElement(MenuItem2, { key: id }))));
|
|
311
367
|
}
|
|
312
368
|
|
|
313
369
|
// src/components/locations/page-indication-location.tsx
|
|
314
|
-
import * as
|
|
370
|
+
import * as React12 from "react";
|
|
315
371
|
function PageIndicationLocation() {
|
|
316
|
-
return /* @__PURE__ */
|
|
372
|
+
return /* @__PURE__ */ React12.createElement(PageIndicationSlot, null);
|
|
317
373
|
}
|
|
318
374
|
|
|
319
375
|
// src/components/locations/primary-action-location.tsx
|
|
320
|
-
import * as
|
|
376
|
+
import * as React13 from "react";
|
|
321
377
|
function PrimaryActionLocation() {
|
|
322
|
-
return /* @__PURE__ */
|
|
378
|
+
return /* @__PURE__ */ React13.createElement(PrimaryActionSlot, null);
|
|
323
379
|
}
|
|
324
380
|
|
|
325
381
|
// src/components/locations/responsive-location.tsx
|
|
326
|
-
import * as
|
|
382
|
+
import * as React14 from "react";
|
|
327
383
|
function ResponsiveLocation() {
|
|
328
|
-
return /* @__PURE__ */
|
|
384
|
+
return /* @__PURE__ */ React14.createElement(ResponsiveSlot, null);
|
|
329
385
|
}
|
|
330
386
|
|
|
331
387
|
// src/components/locations/tools-menu-location.tsx
|
|
332
|
-
import * as
|
|
388
|
+
import * as React21 from "react";
|
|
333
389
|
|
|
334
390
|
// src/extensions/angie/components/angie-guide-location.tsx
|
|
335
|
-
import * as
|
|
336
|
-
import { useEffect as
|
|
391
|
+
import * as React16 from "react";
|
|
392
|
+
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
337
393
|
import { useCurrentUserCapabilities } from "@elementor/editor-current-user";
|
|
338
394
|
import { ThemeProvider } from "@elementor/editor-ui";
|
|
339
395
|
import { useMixpanel } from "@elementor/events";
|
|
@@ -354,11 +410,11 @@ var ANGIE_TOP_BAR_PROMOTION_IMAGE_URL = "https://assets.elementor.com/packages/v
|
|
|
354
410
|
var ANGIE_TOP_BAR_DESCRIPTION = __2("Build custom widgets using simple instructions.", "elementor");
|
|
355
411
|
|
|
356
412
|
// src/extensions/angie/components/angie-guide-card.tsx
|
|
357
|
-
import * as
|
|
413
|
+
import * as React15 from "react";
|
|
358
414
|
import { Button, Chip, ClickAwayListener, CloseButton, Image, Stack as Stack2, Typography } from "@elementor/ui";
|
|
359
415
|
import { __ as __3 } from "@wordpress/i18n";
|
|
360
416
|
function AngieGuideCard({ imageUrl, description, learnMoreUrl, onInstall, onClose }) {
|
|
361
|
-
return /* @__PURE__ */
|
|
417
|
+
return /* @__PURE__ */ React15.createElement(ClickAwayListener, { onClickAway: onClose }, /* @__PURE__ */ React15.createElement(Stack2, { sx: { width: 296 }, "data-testid": "e-angie-guide-card" }, /* @__PURE__ */ React15.createElement(Stack2, { direction: "row", alignItems: "center", gap: 1, py: 1, px: 2 }, /* @__PURE__ */ React15.createElement(Typography, { variant: "subtitle2" }, __3("Meet Angie", "elementor")), /* @__PURE__ */ React15.createElement(Chip, { label: __3("New", "elementor"), size: "small", color: "info", variant: "standard" }), /* @__PURE__ */ React15.createElement(
|
|
362
418
|
CloseButton,
|
|
363
419
|
{
|
|
364
420
|
edge: "end",
|
|
@@ -366,7 +422,7 @@ function AngieGuideCard({ imageUrl, description, learnMoreUrl, onInstall, onClos
|
|
|
366
422
|
slotProps: { icon: { fontSize: "small" } },
|
|
367
423
|
onClick: onClose
|
|
368
424
|
}
|
|
369
|
-
)), /* @__PURE__ */
|
|
425
|
+
)), /* @__PURE__ */ React15.createElement(Image, { src: imageUrl, alt: __3("Angie", "elementor"), sx: { height: 150, width: "100%" } }), /* @__PURE__ */ React15.createElement(Stack2, { px: 2, pt: 1.5, pb: 1 }, /* @__PURE__ */ React15.createElement(Typography, { variant: "body2", color: "secondary" }, description)), /* @__PURE__ */ React15.createElement(Stack2, { direction: "row", justifyContent: "flex-end", gap: 1, pt: 1, pb: 1.5, px: 2 }, /* @__PURE__ */ React15.createElement(
|
|
370
426
|
Button,
|
|
371
427
|
{
|
|
372
428
|
variant: "text",
|
|
@@ -378,13 +434,13 @@ function AngieGuideCard({ imageUrl, description, learnMoreUrl, onInstall, onClos
|
|
|
378
434
|
}
|
|
379
435
|
},
|
|
380
436
|
__3("Learn More", "elementor")
|
|
381
|
-
), onInstall && /* @__PURE__ */
|
|
437
|
+
), onInstall && /* @__PURE__ */ React15.createElement(Button, { variant: "contained", size: "small", color: "accent", onClick: onInstall }, __3("Try for free", "elementor")))));
|
|
382
438
|
}
|
|
383
439
|
|
|
384
440
|
// src/extensions/angie/hooks/use-auto-show.ts
|
|
385
|
-
import { useEffect } from "react";
|
|
441
|
+
import { useEffect as useEffect2 } from "react";
|
|
386
442
|
function useAutoShow() {
|
|
387
|
-
|
|
443
|
+
useEffect2(() => {
|
|
388
444
|
if (!window.elementor?.config?.angie?.autoShow) {
|
|
389
445
|
return;
|
|
390
446
|
}
|
|
@@ -398,11 +454,11 @@ function useAutoShow() {
|
|
|
398
454
|
// src/extensions/angie/components/angie-guide-location.tsx
|
|
399
455
|
function AngieGuideLocation() {
|
|
400
456
|
useAutoShow();
|
|
401
|
-
const [anchorEl, setAnchorEl] =
|
|
457
|
+
const [anchorEl, setAnchorEl] = useState3(null);
|
|
402
458
|
const { dispatchEvent: dispatchEvent2 } = useMixpanel();
|
|
403
459
|
const { isAdmin } = useCurrentUserCapabilities();
|
|
404
460
|
const isOpen = Boolean(anchorEl);
|
|
405
|
-
|
|
461
|
+
useEffect3(() => {
|
|
406
462
|
const handleToggle = () => {
|
|
407
463
|
setAnchorEl((prev) => {
|
|
408
464
|
if (prev) {
|
|
@@ -430,10 +486,10 @@ function AngieGuideLocation() {
|
|
|
430
486
|
);
|
|
431
487
|
handleClose();
|
|
432
488
|
};
|
|
433
|
-
return /* @__PURE__ */
|
|
489
|
+
return /* @__PURE__ */ React16.createElement(ThemeProvider, null, /* @__PURE__ */ React16.createElement(
|
|
434
490
|
Infotip,
|
|
435
491
|
{
|
|
436
|
-
content: /* @__PURE__ */
|
|
492
|
+
content: /* @__PURE__ */ React16.createElement(
|
|
437
493
|
AngieGuideCard,
|
|
438
494
|
{
|
|
439
495
|
imageUrl: ANGIE_TOP_BAR_PROMOTION_IMAGE_URL,
|
|
@@ -456,19 +512,19 @@ function AngieGuideLocation() {
|
|
|
456
512
|
]
|
|
457
513
|
}
|
|
458
514
|
},
|
|
459
|
-
/* @__PURE__ */
|
|
515
|
+
/* @__PURE__ */ React16.createElement("span", null)
|
|
460
516
|
));
|
|
461
517
|
}
|
|
462
518
|
|
|
463
519
|
// src/components/ui/toolbar-menu.tsx
|
|
464
|
-
import * as
|
|
520
|
+
import * as React17 from "react";
|
|
465
521
|
import { Stack as Stack3 } from "@elementor/ui";
|
|
466
522
|
function ToolbarMenu({ children, ...props }) {
|
|
467
|
-
return /* @__PURE__ */
|
|
523
|
+
return /* @__PURE__ */ React17.createElement(MenuContextProvider, { type: "toolbar" }, /* @__PURE__ */ React17.createElement(Stack3, { sx: { px: 1.5 }, spacing: 1.5, direction: "row", alignItems: "center", ...props }, children));
|
|
468
524
|
}
|
|
469
525
|
|
|
470
526
|
// src/components/ui/toolbar-menu-more.tsx
|
|
471
|
-
import * as
|
|
527
|
+
import * as React18 from "react";
|
|
472
528
|
import { DotsVerticalIcon } from "@elementor/icons";
|
|
473
529
|
import { bindMenu as bindMenu2, bindTrigger as bindTrigger2, usePopupState as usePopupState2 } from "@elementor/ui";
|
|
474
530
|
import { __ as __4 } from "@wordpress/i18n";
|
|
@@ -477,11 +533,11 @@ function ToolbarMenuMore({ children, id }) {
|
|
|
477
533
|
variant: "popover",
|
|
478
534
|
popupId: id
|
|
479
535
|
});
|
|
480
|
-
return /* @__PURE__ */
|
|
536
|
+
return /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement(ToolbarMenuItem, { ...bindTrigger2(popupState), title: __4("More", "elementor") }, /* @__PURE__ */ React18.createElement(DotsVerticalIcon, null)), /* @__PURE__ */ React18.createElement(PopoverMenu, { onClick: popupState.close, ...bindMenu2(popupState) }, children));
|
|
481
537
|
}
|
|
482
538
|
|
|
483
539
|
// src/components/locations/integrations-menu-location.tsx
|
|
484
|
-
import * as
|
|
540
|
+
import * as React19 from "react";
|
|
485
541
|
import { PlugIcon } from "@elementor/icons";
|
|
486
542
|
import { bindMenu as bindMenu3, bindTrigger as bindTrigger3, usePopupState as usePopupState3 } from "@elementor/ui";
|
|
487
543
|
import { __ as __5 } from "@wordpress/i18n";
|
|
@@ -495,7 +551,7 @@ function IntegrationsMenuLocation() {
|
|
|
495
551
|
if (menuItems.default.length === 0) {
|
|
496
552
|
return null;
|
|
497
553
|
}
|
|
498
|
-
return /* @__PURE__ */
|
|
554
|
+
return /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement(ToolbarMenuItem, { ...bindTrigger3(popupState), title: __5("Integrations", "elementor") }, /* @__PURE__ */ React19.createElement(PlugIcon, null)), /* @__PURE__ */ React19.createElement(
|
|
499
555
|
PopoverMenu,
|
|
500
556
|
{
|
|
501
557
|
onClick: popupState.close,
|
|
@@ -503,13 +559,13 @@ function IntegrationsMenuLocation() {
|
|
|
503
559
|
marginThreshold: 8,
|
|
504
560
|
open: popupState.isOpen
|
|
505
561
|
},
|
|
506
|
-
menuItems.default.map(({ MenuItem: IntegrationsMenuItem, id }) => /* @__PURE__ */
|
|
562
|
+
menuItems.default.map(({ MenuItem: IntegrationsMenuItem, id }) => /* @__PURE__ */ React19.createElement(IntegrationsMenuItem, { key: id }))
|
|
507
563
|
));
|
|
508
564
|
}
|
|
509
565
|
|
|
510
566
|
// src/components/locations/send-feedback-popup-location.tsx
|
|
511
|
-
import * as
|
|
512
|
-
import { useEffect as
|
|
567
|
+
import * as React20 from "react";
|
|
568
|
+
import { useEffect as useEffect4, useState as useState4 } from "react";
|
|
513
569
|
import { ThemeProvider as ThemeProvider2 } from "@elementor/editor-ui";
|
|
514
570
|
import { isExperimentActive } from "@elementor/editor-v1-adapters";
|
|
515
571
|
import { useMixpanel as useMixpanel2 } from "@elementor/events";
|
|
@@ -542,18 +598,18 @@ var checkIfUserIsConnected = () => {
|
|
|
542
598
|
function SendFeedbackPopupLocation() {
|
|
543
599
|
const isActive = isExperimentActive(EXPERIMENT_NAME);
|
|
544
600
|
const extendedWindow = window;
|
|
545
|
-
const [isUserConnected, setIsUserConnected] =
|
|
601
|
+
const [isUserConnected, setIsUserConnected] = useState4(checkIfUserIsConnected());
|
|
546
602
|
const connectUrl = extendedWindow?.elementor?.config.user.top_bar.connect_url;
|
|
547
|
-
const [feedbackContent, setFeedbackContent] =
|
|
548
|
-
const [feedbackResult, setFeedbackResult] =
|
|
549
|
-
const [submitDisabled, setSubmitDisabled] =
|
|
603
|
+
const [feedbackContent, setFeedbackContent] = useState4("");
|
|
604
|
+
const [feedbackResult, setFeedbackResult] = useState4(null);
|
|
605
|
+
const [submitDisabled, setSubmitDisabled] = useState4(true);
|
|
550
606
|
const { dispatchEvent: trackEvent2 = (...args) => void args } = useMixpanel2();
|
|
551
607
|
const popupState = usePopupState4({
|
|
552
608
|
variant: "dialog",
|
|
553
609
|
popupId: FEEDBACK_TOGGLE_EVENT
|
|
554
610
|
});
|
|
555
|
-
const [isFetching, setIsFetching] =
|
|
556
|
-
|
|
611
|
+
const [isFetching, setIsFetching] = useState4(false);
|
|
612
|
+
useEffect4(() => {
|
|
557
613
|
const handler = () => {
|
|
558
614
|
popupState.toggle();
|
|
559
615
|
setIsUserConnected(checkIfUserIsConnected());
|
|
@@ -568,7 +624,7 @@ function SendFeedbackPopupLocation() {
|
|
|
568
624
|
window.removeEventListener(FEEDBACK_TOGGLE_EVENT, handler);
|
|
569
625
|
};
|
|
570
626
|
}, [popupState, trackEvent2]);
|
|
571
|
-
|
|
627
|
+
useEffect4(() => {
|
|
572
628
|
setSubmitDisabled(feedbackContent.trim().length < 10 || !isUserConnected || isFetching);
|
|
573
629
|
}, [feedbackContent, feedbackResult, isUserConnected, isFetching]);
|
|
574
630
|
const handleClose = () => {
|
|
@@ -603,7 +659,7 @@ function SendFeedbackPopupLocation() {
|
|
|
603
659
|
if (!isActive) {
|
|
604
660
|
return null;
|
|
605
661
|
}
|
|
606
|
-
return /* @__PURE__ */
|
|
662
|
+
return /* @__PURE__ */ React20.createElement(ThemeProvider2, null, /* @__PURE__ */ React20.createElement(Popover, { ...bindDialog(popupState), onClose: () => handleClose() }, /* @__PURE__ */ React20.createElement(Dialog, { open: popupState.isOpen }, /* @__PURE__ */ React20.createElement(DialogHeader, { style: { width: "100%", minWidth: "35rem" } }, /* @__PURE__ */ React20.createElement(DialogTitle, { style: { width: "100%" } }, /* @__PURE__ */ React20.createElement(
|
|
607
663
|
Stack4,
|
|
608
664
|
{
|
|
609
665
|
display: "flex",
|
|
@@ -613,8 +669,8 @@ function SendFeedbackPopupLocation() {
|
|
|
613
669
|
width: "100%"
|
|
614
670
|
},
|
|
615
671
|
__6("Submit Feedback", "elementor"),
|
|
616
|
-
/* @__PURE__ */
|
|
617
|
-
))), /* @__PURE__ */
|
|
672
|
+
/* @__PURE__ */ React20.createElement(CloseButton2, { onClick: popupState.close })
|
|
673
|
+
))), /* @__PURE__ */ React20.createElement(DialogContent, null, /* @__PURE__ */ React20.createElement(Stack4, { direction: "column", gap: 2 }, isUserConnected ? /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(
|
|
618
674
|
TextField,
|
|
619
675
|
{
|
|
620
676
|
autofocus: true,
|
|
@@ -632,7 +688,7 @@ function SendFeedbackPopupLocation() {
|
|
|
632
688
|
onChange: (event) => setFeedbackContent(event.target.value),
|
|
633
689
|
value: feedbackContent
|
|
634
690
|
}
|
|
635
|
-
), /* @__PURE__ */
|
|
691
|
+
), /* @__PURE__ */ React20.createElement(Stack4, { direction: "row", justifyContent: "flex-end", alignItems: "center", gap: 2 }, feedbackResult && /* @__PURE__ */ React20.createElement(React20.Fragment, null, feedbackResult.success ? /* @__PURE__ */ React20.createElement(CheckIcon, { color: "success" }) : /* @__PURE__ */ React20.createElement(AlertCircleIcon, { color: "error" }), feedbackResult.message), feedbackResult?.success ? /* @__PURE__ */ React20.createElement(Button2, { variant: "text", onClick: () => handleStartAnother() }, __6("Submit Another Feedback", "elementor")) : /* @__PURE__ */ React20.createElement(
|
|
636
692
|
Button2,
|
|
637
693
|
{
|
|
638
694
|
disabled: submitDisabled,
|
|
@@ -642,7 +698,7 @@ function SendFeedbackPopupLocation() {
|
|
|
642
698
|
size: "small"
|
|
643
699
|
},
|
|
644
700
|
__6("Submit", "elementor")
|
|
645
|
-
))) : /* @__PURE__ */
|
|
701
|
+
))) : /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(
|
|
646
702
|
Button2,
|
|
647
703
|
{
|
|
648
704
|
variant: "contained",
|
|
@@ -658,36 +714,59 @@ function SendFeedbackPopupLocation() {
|
|
|
658
714
|
}
|
|
659
715
|
|
|
660
716
|
// src/components/locations/tools-menu-location.tsx
|
|
661
|
-
var MAX_TOOLBAR_ACTIONS = 5;
|
|
662
717
|
var { useMenuItems: useMenuItems3 } = toolsMenu;
|
|
663
718
|
function ToolsMenuLocation() {
|
|
664
719
|
const menuItems = useMenuItems3();
|
|
665
|
-
const
|
|
666
|
-
const
|
|
667
|
-
|
|
720
|
+
const { tools: maxToolbarActions } = useMaxToolbarActions();
|
|
721
|
+
const toolbarMenuItems = menuItems.default.slice(0, maxToolbarActions);
|
|
722
|
+
const popoverMenuItems = menuItems.default.slice(maxToolbarActions);
|
|
723
|
+
return /* @__PURE__ */ React21.createElement(ToolbarMenu, null, toolbarMenuItems.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React21.createElement(MenuItem2, { key: id })), /* @__PURE__ */ React21.createElement(AngieGuideLocation, null), /* @__PURE__ */ React21.createElement(SendFeedbackPopupLocation, null), /* @__PURE__ */ React21.createElement(IntegrationsMenuLocation, null), popoverMenuItems.length > 0 && /* @__PURE__ */ React21.createElement(ToolbarMenuMore, { id: "elementor-editor-app-bar-tools-more" }, popoverMenuItems.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React21.createElement(MenuItem2, { key: id }))));
|
|
668
724
|
}
|
|
669
725
|
|
|
670
726
|
// src/components/locations/utilities-menu-location.tsx
|
|
671
|
-
import * as
|
|
727
|
+
import * as React22 from "react";
|
|
672
728
|
import { Fragment as Fragment4 } from "react";
|
|
673
|
-
var MAX_TOOLBAR_ACTIONS2 = 4;
|
|
674
729
|
var { useMenuItems: useMenuItems4 } = utilitiesMenu;
|
|
675
730
|
function UtilitiesMenuLocation() {
|
|
676
731
|
const menuItems = useMenuItems4();
|
|
677
|
-
const
|
|
678
|
-
const
|
|
679
|
-
const
|
|
680
|
-
|
|
732
|
+
const { utilities: maxToolbarActions } = useMaxToolbarActions();
|
|
733
|
+
const shouldUsePopover = menuItems.default.length > maxToolbarActions + 1;
|
|
734
|
+
const toolbarMenuItems = shouldUsePopover ? menuItems.default.slice(0, maxToolbarActions) : menuItems.default;
|
|
735
|
+
const popoverMenuItems = shouldUsePopover ? menuItems.default.slice(maxToolbarActions) : [];
|
|
736
|
+
return /* @__PURE__ */ React22.createElement(ToolbarMenu, null, toolbarMenuItems.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React22.createElement(Fragment4, { key: id }, /* @__PURE__ */ React22.createElement(MenuItem2, null))), popoverMenuItems.length > 0 && /* @__PURE__ */ React22.createElement(ToolbarMenuMore, { id: "elementor-editor-app-bar-utilities-more" }, popoverMenuItems.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React22.createElement(MenuItem2, { key: id }))));
|
|
681
737
|
}
|
|
682
738
|
|
|
683
739
|
// src/components/app-bar.tsx
|
|
684
740
|
function AppBar() {
|
|
685
741
|
const document2 = useActiveDocument();
|
|
686
|
-
|
|
742
|
+
const containerRef = useRef(null);
|
|
743
|
+
const containerWidth = useContainerWidth(containerRef);
|
|
744
|
+
const maxToolbarActions = getMaxToolbarActions(containerWidth);
|
|
745
|
+
return /* @__PURE__ */ React23.createElement(ThemeProvider3, { colorScheme: "dark" }, /* @__PURE__ */ React23.createElement(BaseAppBar, { position: "sticky" }, /* @__PURE__ */ React23.createElement(Toolbar, { disableGutters: true, variant: "dense", sx: { overflowX: "auto" } }, /* @__PURE__ */ React23.createElement(
|
|
746
|
+
Box3,
|
|
747
|
+
{
|
|
748
|
+
ref: containerRef,
|
|
749
|
+
display: "grid",
|
|
750
|
+
gridTemplateColumns: "minmax(0, 1fr) auto minmax(0, 1fr)",
|
|
751
|
+
flexGrow: 1,
|
|
752
|
+
minWidth: `${MIN_APP_BAR_WIDTH}px`
|
|
753
|
+
},
|
|
754
|
+
/* @__PURE__ */ React23.createElement(AppBarSizeProvider, { value: maxToolbarActions }, /* @__PURE__ */ React23.createElement(Grid, { container: true, flexWrap: "nowrap", sx: { minWidth: 0, overflow: "hidden" } }, /* @__PURE__ */ React23.createElement(MainMenuLocation, null), document2?.permissions?.allowAddingWidgets && /* @__PURE__ */ React23.createElement(ToolsMenuLocation, null)), /* @__PURE__ */ React23.createElement(Grid, { container: true, justifyContent: "center" }, /* @__PURE__ */ React23.createElement(ToolbarMenu, { spacing: 1.5 }, /* @__PURE__ */ React23.createElement(Divider2, { orientation: "vertical" }), /* @__PURE__ */ React23.createElement(PageIndicationLocation, null), /* @__PURE__ */ React23.createElement(Divider2, { orientation: "vertical" }), /* @__PURE__ */ React23.createElement(ResponsiveLocation, null), /* @__PURE__ */ React23.createElement(Divider2, { orientation: "vertical" }))), /* @__PURE__ */ React23.createElement(
|
|
755
|
+
Grid,
|
|
756
|
+
{
|
|
757
|
+
container: true,
|
|
758
|
+
justifyContent: "flex-end",
|
|
759
|
+
flexWrap: "nowrap",
|
|
760
|
+
sx: { minWidth: 0, overflow: "hidden" }
|
|
761
|
+
},
|
|
762
|
+
/* @__PURE__ */ React23.createElement(UtilitiesMenuLocation, null),
|
|
763
|
+
/* @__PURE__ */ React23.createElement(PrimaryActionLocation, null)
|
|
764
|
+
))
|
|
765
|
+
))));
|
|
687
766
|
}
|
|
688
767
|
|
|
689
768
|
// src/extensions/angie/hooks/use-action-props.ts
|
|
690
|
-
import { useEffect as
|
|
769
|
+
import { useEffect as useEffect5 } from "react";
|
|
691
770
|
import { isAngieAvailable } from "@elementor/editor-mcp";
|
|
692
771
|
import { trackEvent } from "@elementor/events";
|
|
693
772
|
import { AngieIcon } from "@elementor/icons";
|
|
@@ -695,7 +774,7 @@ import { __ as __7 } from "@wordpress/i18n";
|
|
|
695
774
|
function useActionProps() {
|
|
696
775
|
const hasAngieInstalled = isAngieAvailable();
|
|
697
776
|
const visible = !hasAngieInstalled;
|
|
698
|
-
|
|
777
|
+
useEffect5(() => {
|
|
699
778
|
if (!visible) {
|
|
700
779
|
return;
|
|
701
780
|
}
|
|
@@ -845,7 +924,7 @@ function init3() {
|
|
|
845
924
|
}
|
|
846
925
|
|
|
847
926
|
// src/extensions/documents-save/components/primary-action.tsx
|
|
848
|
-
import * as
|
|
927
|
+
import * as React25 from "react";
|
|
849
928
|
import {
|
|
850
929
|
__useActiveDocument as useActiveDocument3,
|
|
851
930
|
__useActiveDocumentActions as useActiveDocumentActions
|
|
@@ -865,7 +944,7 @@ import {
|
|
|
865
944
|
import { __ as __10 } from "@wordpress/i18n";
|
|
866
945
|
|
|
867
946
|
// src/extensions/documents-save/components/primary-action-menu.tsx
|
|
868
|
-
import * as
|
|
947
|
+
import * as React24 from "react";
|
|
869
948
|
import { Divider as Divider3, styled as styled2 } from "@elementor/ui";
|
|
870
949
|
var { useMenuItems: useMenuItems5 } = documentOptionsMenu;
|
|
871
950
|
var StyledPopoverMenu = styled2(PopoverMenu)`
|
|
@@ -881,7 +960,7 @@ var StyledPopoverMenu = styled2(PopoverMenu)`
|
|
|
881
960
|
`;
|
|
882
961
|
function PrimaryActionMenu(props) {
|
|
883
962
|
const { save: saveActions, default: defaultActions } = useMenuItems5();
|
|
884
|
-
return /* @__PURE__ */
|
|
963
|
+
return /* @__PURE__ */ React24.createElement(
|
|
885
964
|
StyledPopoverMenu,
|
|
886
965
|
{
|
|
887
966
|
...props,
|
|
@@ -899,13 +978,13 @@ function PrimaryActionMenu(props) {
|
|
|
899
978
|
}
|
|
900
979
|
},
|
|
901
980
|
saveActions.map(({ MenuItem: MenuItem2, id }, index) => [
|
|
902
|
-
index > 0 && /* @__PURE__ */
|
|
903
|
-
/* @__PURE__ */
|
|
981
|
+
index > 0 && /* @__PURE__ */ React24.createElement(Divider3, { key: `${id}-divider` }),
|
|
982
|
+
/* @__PURE__ */ React24.createElement(MenuItem2, { key: id })
|
|
904
983
|
]),
|
|
905
|
-
saveActions.length > 0 && defaultActions.length > 0 && /* @__PURE__ */
|
|
984
|
+
saveActions.length > 0 && defaultActions.length > 0 && /* @__PURE__ */ React24.createElement(Divider3, null),
|
|
906
985
|
defaultActions.map(({ MenuItem: MenuItem2, id }, index) => [
|
|
907
|
-
index > 0 && /* @__PURE__ */
|
|
908
|
-
/* @__PURE__ */
|
|
986
|
+
index > 0 && /* @__PURE__ */ React24.createElement(Divider3, { key: `${id}-divider` }),
|
|
987
|
+
/* @__PURE__ */ React24.createElement(MenuItem2, { key: id })
|
|
909
988
|
])
|
|
910
989
|
);
|
|
911
990
|
}
|
|
@@ -926,7 +1005,7 @@ function PrimaryAction() {
|
|
|
926
1005
|
const isPublishDisabled = !isEditMode || !isPublishEnabled(document2);
|
|
927
1006
|
const isSaveOptionsDisabled = !isEditMode || document2.type.value === "kit";
|
|
928
1007
|
const shouldShowSpinner = document2.isSaving && !isPublishDisabled;
|
|
929
|
-
return /* @__PURE__ */
|
|
1008
|
+
return /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement(ButtonGroup, { size: "large", variant: "contained" }, /* @__PURE__ */ React25.createElement(
|
|
930
1009
|
Button3,
|
|
931
1010
|
{
|
|
932
1011
|
onClick: () => {
|
|
@@ -957,8 +1036,8 @@ function PrimaryAction() {
|
|
|
957
1036
|
},
|
|
958
1037
|
disabled: isPublishDisabled
|
|
959
1038
|
},
|
|
960
|
-
shouldShowSpinner ? /* @__PURE__ */
|
|
961
|
-
), /* @__PURE__ */
|
|
1039
|
+
shouldShowSpinner ? /* @__PURE__ */ React25.createElement(CircularProgress, { color: "inherit", size: "1.5em" }) : getLabel(document2)
|
|
1040
|
+
), /* @__PURE__ */ React25.createElement(
|
|
962
1041
|
Tooltip3,
|
|
963
1042
|
{
|
|
964
1043
|
title: __10("Save Options", "elementor"),
|
|
@@ -971,7 +1050,7 @@ function PrimaryAction() {
|
|
|
971
1050
|
}
|
|
972
1051
|
}
|
|
973
1052
|
},
|
|
974
|
-
/* @__PURE__ */
|
|
1053
|
+
/* @__PURE__ */ React25.createElement(Box4, { component: "span", "aria-label": void 0 }, /* @__PURE__ */ React25.createElement(
|
|
975
1054
|
Button3,
|
|
976
1055
|
{
|
|
977
1056
|
size: "small",
|
|
@@ -980,9 +1059,9 @@ function PrimaryAction() {
|
|
|
980
1059
|
disabled: isSaveOptionsDisabled,
|
|
981
1060
|
"aria-label": __10("Save Options", "elementor")
|
|
982
1061
|
},
|
|
983
|
-
/* @__PURE__ */
|
|
1062
|
+
/* @__PURE__ */ React25.createElement(ChevronDownIcon, null)
|
|
984
1063
|
))
|
|
985
|
-
)), /* @__PURE__ */
|
|
1064
|
+
)), /* @__PURE__ */ React25.createElement(PrimaryActionMenu, { ...bindMenu4(popupState), onClick: popupState.close }));
|
|
986
1065
|
}
|
|
987
1066
|
function getLabel(document2) {
|
|
988
1067
|
return document2.userCan.publish ? __10("Publish", "elementor") : __10("Submit", "elementor");
|
|
@@ -1451,7 +1530,7 @@ function init11() {
|
|
|
1451
1530
|
}
|
|
1452
1531
|
|
|
1453
1532
|
// src/extensions/responsive/components/breakpoints-switcher.tsx
|
|
1454
|
-
import * as
|
|
1533
|
+
import * as React26 from "react";
|
|
1455
1534
|
import {
|
|
1456
1535
|
useActivateBreakpoint,
|
|
1457
1536
|
useActiveBreakpoint,
|
|
@@ -1489,7 +1568,7 @@ function BreakpointsSwitcher() {
|
|
|
1489
1568
|
}
|
|
1490
1569
|
activateBreakpoint(value);
|
|
1491
1570
|
};
|
|
1492
|
-
return /* @__PURE__ */
|
|
1571
|
+
return /* @__PURE__ */ React26.createElement(
|
|
1493
1572
|
Tabs,
|
|
1494
1573
|
{
|
|
1495
1574
|
textColor: "inherit",
|
|
@@ -1506,13 +1585,13 @@ function BreakpointsSwitcher() {
|
|
|
1506
1585
|
breakpoints.map(({ id, label, type, width }) => {
|
|
1507
1586
|
const Icon = iconsMap[id];
|
|
1508
1587
|
const title = labelsMap[type || "default"].replace("%s", label).replace("%d", width?.toString() || "");
|
|
1509
|
-
return /* @__PURE__ */
|
|
1588
|
+
return /* @__PURE__ */ React26.createElement(
|
|
1510
1589
|
Tab,
|
|
1511
1590
|
{
|
|
1512
1591
|
value: id,
|
|
1513
1592
|
key: id,
|
|
1514
1593
|
"aria-label": title,
|
|
1515
|
-
icon: /* @__PURE__ */
|
|
1594
|
+
icon: /* @__PURE__ */ React26.createElement(Tooltip4, { title }, /* @__PURE__ */ React26.createElement(Icon, null)),
|
|
1516
1595
|
sx: { minWidth: "auto" },
|
|
1517
1596
|
"data-testid": `switch-device-to-${id}`
|
|
1518
1597
|
}
|
|
@@ -1521,7 +1600,7 @@ function BreakpointsSwitcher() {
|
|
|
1521
1600
|
);
|
|
1522
1601
|
}
|
|
1523
1602
|
function Tooltip4(props) {
|
|
1524
|
-
return /* @__PURE__ */
|
|
1603
|
+
return /* @__PURE__ */ React26.createElement(
|
|
1525
1604
|
BaseTooltip2,
|
|
1526
1605
|
{
|
|
1527
1606
|
PopperProps: {
|
|
@@ -1568,10 +1647,10 @@ function init12() {
|
|
|
1568
1647
|
import { injectIntoTop } from "@elementor/editor";
|
|
1569
1648
|
|
|
1570
1649
|
// src/extensions/site-settings/components/portalled-primary-action.tsx
|
|
1571
|
-
import * as
|
|
1650
|
+
import * as React29 from "react";
|
|
1572
1651
|
|
|
1573
1652
|
// src/extensions/site-settings/components/portal.tsx
|
|
1574
|
-
import * as
|
|
1653
|
+
import * as React27 from "react";
|
|
1575
1654
|
import {
|
|
1576
1655
|
__privateIsRouteActive as isRouteActive2,
|
|
1577
1656
|
__privateUseListenTo as useListenTo,
|
|
@@ -1587,14 +1666,14 @@ function Portal(props) {
|
|
|
1587
1666
|
if (!containerRef.current) {
|
|
1588
1667
|
return null;
|
|
1589
1668
|
}
|
|
1590
|
-
return /* @__PURE__ */
|
|
1669
|
+
return /* @__PURE__ */ React27.createElement(BasePortal, { container: containerRef.current, ...props });
|
|
1591
1670
|
}
|
|
1592
1671
|
function getContainerRef() {
|
|
1593
1672
|
return isRouteActive2("panel/global") ? { current: document.querySelector("#elementor-panel-inner") } : { current: null };
|
|
1594
1673
|
}
|
|
1595
1674
|
|
|
1596
1675
|
// src/extensions/site-settings/components/primary-action.tsx
|
|
1597
|
-
import * as
|
|
1676
|
+
import * as React28 from "react";
|
|
1598
1677
|
import {
|
|
1599
1678
|
__useActiveDocument as useActiveDocument8,
|
|
1600
1679
|
__useActiveDocumentActions as useActiveDocumentActions5
|
|
@@ -1604,7 +1683,7 @@ import { __ as __24 } from "@wordpress/i18n";
|
|
|
1604
1683
|
function PrimaryAction2() {
|
|
1605
1684
|
const document2 = useActiveDocument8();
|
|
1606
1685
|
const { save } = useActiveDocumentActions5();
|
|
1607
|
-
return /* @__PURE__ */
|
|
1686
|
+
return /* @__PURE__ */ React28.createElement(
|
|
1608
1687
|
Paper,
|
|
1609
1688
|
{
|
|
1610
1689
|
sx: {
|
|
@@ -1614,7 +1693,7 @@ function PrimaryAction2() {
|
|
|
1614
1693
|
borderColor: "divider"
|
|
1615
1694
|
}
|
|
1616
1695
|
},
|
|
1617
|
-
/* @__PURE__ */
|
|
1696
|
+
/* @__PURE__ */ React28.createElement(
|
|
1618
1697
|
Button4,
|
|
1619
1698
|
{
|
|
1620
1699
|
variant: "contained",
|
|
@@ -1623,14 +1702,14 @@ function PrimaryAction2() {
|
|
|
1623
1702
|
sx: { width: "100%" },
|
|
1624
1703
|
onClick: () => document2 && !document2.isSaving ? save() : null
|
|
1625
1704
|
},
|
|
1626
|
-
document2?.isSaving ? /* @__PURE__ */
|
|
1705
|
+
document2?.isSaving ? /* @__PURE__ */ React28.createElement(CircularProgress2, null) : __24("Save Changes", "elementor")
|
|
1627
1706
|
)
|
|
1628
1707
|
);
|
|
1629
1708
|
}
|
|
1630
1709
|
|
|
1631
1710
|
// src/extensions/site-settings/components/portalled-primary-action.tsx
|
|
1632
1711
|
function PortalledPrimaryAction() {
|
|
1633
|
-
return /* @__PURE__ */
|
|
1712
|
+
return /* @__PURE__ */ React29.createElement(Portal, null, /* @__PURE__ */ React29.createElement(PrimaryAction2, null));
|
|
1634
1713
|
}
|
|
1635
1714
|
|
|
1636
1715
|
// src/extensions/site-settings/hooks/use-action-props.ts
|