@elementor/editor-editing-panel 0.9.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/index.js +171 -53
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +162 -44
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -6
- package/src/components/settings-tab.tsx +1 -1
- package/src/controls/control-context.tsx +2 -2
- package/src/controls/control-types/attachment-control.tsx +101 -0
- package/src/controls/control-types/size-control.tsx +30 -17
- package/src/controls/get-control-by-type.ts +2 -0
- package/src/controls/hooks/use-sync-external-state.tsx +49 -0
- package/src/types.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.11.0](https://github.com/elementor/elementor-packages/compare/@elementor/editor-editing-panel@0.10.0...@elementor/editor-editing-panel@0.11.0) (2024-08-15)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **edito-editing-panel:** add control internal state hook [EDS-359] ([#232](https://github.com/elementor/elementor-packages/issues/232)) ([c9cbced](https://github.com/elementor/elementor-packages/commit/c9cbced3d8136f8bb157a0ab3878076b08e521f5))
|
|
11
|
+
|
|
12
|
+
# [0.10.0](https://github.com/elementor/elementor-packages/compare/@elementor/editor-editing-panel@0.9.1...@elementor/editor-editing-panel@0.10.0) (2024-08-14)
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- **editor-editing-panel:** init attachment control [EDS-320] ([#239](https://github.com/elementor/elementor-packages/issues/239)) ([9871e10](https://github.com/elementor/elementor-packages/commit/9871e105c98b8c4502289cf8cf99d75b4074e0a9))
|
|
17
|
+
|
|
6
18
|
## [0.9.1](https://github.com/elementor/elementor-packages/compare/@elementor/editor-editing-panel@0.9.0...@elementor/editor-editing-panel@0.9.1) (2024-08-06)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package @elementor/editor-editing-panel
|
package/dist/index.js
CHANGED
|
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
var import_editor_panels2 = require("@elementor/editor-panels");
|
|
27
27
|
|
|
28
28
|
// src/components/editing-panel.tsx
|
|
29
|
-
var
|
|
30
|
-
var
|
|
29
|
+
var React15 = __toESM(require("react"));
|
|
30
|
+
var import_i18n4 = require("@wordpress/i18n");
|
|
31
31
|
|
|
32
32
|
// src/hooks/use-selected-elements.ts
|
|
33
33
|
var import_editor_v1_adapters = require("@elementor/editor-v1-adapters");
|
|
@@ -107,13 +107,13 @@ function useElementContext() {
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
// src/components/editing-panel-tabs.tsx
|
|
110
|
-
var
|
|
111
|
-
var
|
|
112
|
-
var
|
|
110
|
+
var import_ui12 = require("@elementor/ui");
|
|
111
|
+
var React14 = __toESM(require("react"));
|
|
112
|
+
var import_i18n3 = require("@wordpress/i18n");
|
|
113
113
|
|
|
114
114
|
// src/components/settings-tab.tsx
|
|
115
|
-
var
|
|
116
|
-
var
|
|
115
|
+
var React8 = __toESM(require("react"));
|
|
116
|
+
var import_ui7 = require("@elementor/ui");
|
|
117
117
|
|
|
118
118
|
// src/controls/settings-control.tsx
|
|
119
119
|
var React2 = __toESM(require("react"));
|
|
@@ -249,8 +249,78 @@ var TextControl = ({ placeholder }) => {
|
|
|
249
249
|
return /* @__PURE__ */ React6.createElement(import_ui5.TextField, { type: "text", size: "tiny", value, onChange: handleChange, placeholder });
|
|
250
250
|
};
|
|
251
251
|
|
|
252
|
+
// src/controls/control-types/attachment-control.tsx
|
|
253
|
+
var React7 = __toESM(require("react"));
|
|
254
|
+
var import_ui6 = require("@elementor/ui");
|
|
255
|
+
var import_icons = require("@elementor/icons");
|
|
256
|
+
var import_i18n = require("@wordpress/i18n");
|
|
257
|
+
var import_wp_media = require("@elementor/wp-media");
|
|
258
|
+
var isImageAttachment = (value) => {
|
|
259
|
+
return value?.$$type === "image-attachment";
|
|
260
|
+
};
|
|
261
|
+
var isImageUrl = (value) => {
|
|
262
|
+
return value?.$$type === "image-url";
|
|
263
|
+
};
|
|
264
|
+
var defaultState = {
|
|
265
|
+
$$type: "image-url",
|
|
266
|
+
value: {
|
|
267
|
+
url: "/wp-content/plugins/elementor/assets/images/placeholder.png"
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
var AttachmentControl = (props) => {
|
|
271
|
+
const { value, setValue } = useControl(defaultState);
|
|
272
|
+
const { data: attachment } = (0, import_wp_media.useWpMediaAttachment)(isImageAttachment(value) ? value.value.id : void 0);
|
|
273
|
+
const getImageSrc = () => {
|
|
274
|
+
if (attachment?.url) {
|
|
275
|
+
return attachment.url;
|
|
276
|
+
}
|
|
277
|
+
if (isImageUrl(value)) {
|
|
278
|
+
return value.value.url;
|
|
279
|
+
}
|
|
280
|
+
return defaultState.value.url;
|
|
281
|
+
};
|
|
282
|
+
const { open } = (0, import_wp_media.useWpMediaFrame)({
|
|
283
|
+
types: props.mediaTypes,
|
|
284
|
+
multiple: false,
|
|
285
|
+
selected: isImageAttachment(value) ? value.value?.id : void 0,
|
|
286
|
+
onSelect: (val) => {
|
|
287
|
+
setValue({
|
|
288
|
+
$$type: "image-attachment",
|
|
289
|
+
value: {
|
|
290
|
+
id: val.id
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
return /* @__PURE__ */ React7.createElement(import_ui6.Card, { variant: "outlined" }, /* @__PURE__ */ React7.createElement(import_ui6.CardMedia, { image: getImageSrc(), sx: { height: 150 } }), /* @__PURE__ */ React7.createElement(import_ui6.CardOverlay, null, /* @__PURE__ */ React7.createElement(
|
|
296
|
+
import_ui6.Button,
|
|
297
|
+
{
|
|
298
|
+
color: "inherit",
|
|
299
|
+
size: "small",
|
|
300
|
+
variant: "outlined",
|
|
301
|
+
onClick: () => {
|
|
302
|
+
open({ mode: "browse" });
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
(0, import_i18n.__)("Select Image", "elementor")
|
|
306
|
+
), /* @__PURE__ */ React7.createElement(
|
|
307
|
+
import_ui6.Button,
|
|
308
|
+
{
|
|
309
|
+
color: "inherit",
|
|
310
|
+
size: "small",
|
|
311
|
+
variant: "text",
|
|
312
|
+
startIcon: /* @__PURE__ */ React7.createElement(import_icons.UploadIcon, null),
|
|
313
|
+
onClick: () => {
|
|
314
|
+
open({ mode: "upload" });
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
(0, import_i18n.__)("Upload Image", "elementor")
|
|
318
|
+
)));
|
|
319
|
+
};
|
|
320
|
+
|
|
252
321
|
// src/controls/get-control-by-type.ts
|
|
253
322
|
var controlTypes = {
|
|
323
|
+
attachment: AttachmentControl,
|
|
254
324
|
select: SelectControl,
|
|
255
325
|
text: TextControl,
|
|
256
326
|
textarea: TextAreaControl
|
|
@@ -266,14 +336,14 @@ var SettingsTab = () => {
|
|
|
266
336
|
if (!elementType) {
|
|
267
337
|
return null;
|
|
268
338
|
}
|
|
269
|
-
return /* @__PURE__ */
|
|
339
|
+
return /* @__PURE__ */ React8.createElement(import_ui7.Stack, null, elementType.controls.map(({ type, value }, index) => {
|
|
270
340
|
if (type === "control") {
|
|
271
|
-
return /* @__PURE__ */
|
|
341
|
+
return /* @__PURE__ */ React8.createElement(Control, { key: value.bind, control: value });
|
|
272
342
|
}
|
|
273
343
|
if (type === "section") {
|
|
274
|
-
return /* @__PURE__ */
|
|
344
|
+
return /* @__PURE__ */ React8.createElement(CollapsibleSection, { key: type + "." + index, title: value.label }, value.items?.map((item) => {
|
|
275
345
|
if (item.type === "control") {
|
|
276
|
-
return /* @__PURE__ */
|
|
346
|
+
return /* @__PURE__ */ React8.createElement(Control, { key: item.value.bind, control: item.value });
|
|
277
347
|
}
|
|
278
348
|
return null;
|
|
279
349
|
}));
|
|
@@ -286,7 +356,7 @@ var Control = ({ control }) => {
|
|
|
286
356
|
if (!ControlComponent) {
|
|
287
357
|
return null;
|
|
288
358
|
}
|
|
289
|
-
return /* @__PURE__ */
|
|
359
|
+
return /* @__PURE__ */ React8.createElement(SettingsControl, { bind: control.bind }, control.label ? /* @__PURE__ */ React8.createElement(SettingsControl.Label, null, control.label) : null, /* @__PURE__ */ React8.createElement(
|
|
290
360
|
ControlComponent,
|
|
291
361
|
{
|
|
292
362
|
...control.props
|
|
@@ -295,17 +365,17 @@ var Control = ({ control }) => {
|
|
|
295
365
|
};
|
|
296
366
|
|
|
297
367
|
// src/components/style-tab.tsx
|
|
298
|
-
var
|
|
368
|
+
var React13 = __toESM(require("react"));
|
|
299
369
|
|
|
300
370
|
// src/contexts/style-context.tsx
|
|
301
|
-
var
|
|
371
|
+
var React9 = __toESM(require("react"));
|
|
302
372
|
var import_react4 = require("react");
|
|
303
373
|
var import_editor_responsive = require("@elementor/editor-responsive");
|
|
304
374
|
var Context2 = (0, import_react4.createContext)(null);
|
|
305
375
|
function StyleContext({ children, selectedStyleDef }) {
|
|
306
376
|
const breakpoint = (0, import_editor_responsive.useActiveBreakpoint)();
|
|
307
377
|
const selectedMeta = { breakpoint, state: null };
|
|
308
|
-
return /* @__PURE__ */
|
|
378
|
+
return /* @__PURE__ */ React9.createElement(Context2.Provider, { value: { selectedStyleDef, selectedMeta } }, children);
|
|
309
379
|
}
|
|
310
380
|
function useStyleContext() {
|
|
311
381
|
const context = (0, import_react4.useContext)(Context2);
|
|
@@ -336,13 +406,13 @@ var useElementStyles = (elementID) => {
|
|
|
336
406
|
};
|
|
337
407
|
|
|
338
408
|
// src/components/style-tab.tsx
|
|
339
|
-
var
|
|
409
|
+
var import_ui11 = require("@elementor/ui");
|
|
340
410
|
|
|
341
411
|
// src/components/style-sections/size-section.tsx
|
|
342
|
-
var
|
|
412
|
+
var React12 = __toESM(require("react"));
|
|
343
413
|
|
|
344
414
|
// src/controls/style-control.tsx
|
|
345
|
-
var
|
|
415
|
+
var React10 = __toESM(require("react"));
|
|
346
416
|
|
|
347
417
|
// src/sync/update-style.ts
|
|
348
418
|
var import_editor_v1_adapters6 = require("@elementor/editor-v1-adapters");
|
|
@@ -388,7 +458,7 @@ function getVariantByMeta(styleDef, meta) {
|
|
|
388
458
|
}
|
|
389
459
|
|
|
390
460
|
// src/controls/style-control.tsx
|
|
391
|
-
var
|
|
461
|
+
var import_ui8 = require("@elementor/ui");
|
|
392
462
|
var StyleControl = ({ bind, children }) => {
|
|
393
463
|
const { element } = useElementContext();
|
|
394
464
|
const { selectedStyleDef, selectedMeta } = useStyleContext();
|
|
@@ -406,67 +476,115 @@ var StyleControl = ({ bind, children }) => {
|
|
|
406
476
|
meta: selectedMeta,
|
|
407
477
|
propName: bind
|
|
408
478
|
});
|
|
409
|
-
return /* @__PURE__ */
|
|
479
|
+
return /* @__PURE__ */ React10.createElement(ControlContext.Provider, { value: { bind, value, setValue } }, children);
|
|
410
480
|
};
|
|
411
481
|
var Label2 = ({ children }) => {
|
|
412
|
-
return /* @__PURE__ */
|
|
482
|
+
return /* @__PURE__ */ React10.createElement(import_ui8.Typography, { component: "label", variant: "caption", color: "text.secondary" }, children);
|
|
413
483
|
};
|
|
414
484
|
StyleControl.Label = Label2;
|
|
415
485
|
|
|
416
486
|
// src/controls/control-types/size-control.tsx
|
|
417
|
-
var
|
|
418
|
-
var
|
|
487
|
+
var React11 = __toESM(require("react"));
|
|
488
|
+
var import_ui9 = require("@elementor/ui");
|
|
489
|
+
|
|
490
|
+
// src/controls/hooks/use-sync-external-state.tsx
|
|
491
|
+
var import_react5 = require("react");
|
|
492
|
+
var useSyncExternalState = ({
|
|
493
|
+
external,
|
|
494
|
+
setExternal,
|
|
495
|
+
persistWhen,
|
|
496
|
+
fallback
|
|
497
|
+
}) => {
|
|
498
|
+
function toExternal(internalValue) {
|
|
499
|
+
if (persistWhen(internalValue)) {
|
|
500
|
+
return internalValue;
|
|
501
|
+
}
|
|
502
|
+
return void 0;
|
|
503
|
+
}
|
|
504
|
+
function toInternal(externalValue, internalValue) {
|
|
505
|
+
if (!externalValue) {
|
|
506
|
+
return fallback(internalValue);
|
|
507
|
+
}
|
|
508
|
+
return externalValue;
|
|
509
|
+
}
|
|
510
|
+
const [internal, setInternal] = (0, import_react5.useState)(toInternal(external, void 0));
|
|
511
|
+
(0, import_react5.useEffect)(() => {
|
|
512
|
+
setInternal(toInternal(external, internal));
|
|
513
|
+
}, [external]);
|
|
514
|
+
const setInternalValue = (setter) => {
|
|
515
|
+
const setterFn = typeof setter === "function" ? setter : () => setter;
|
|
516
|
+
const updated = setterFn(internal);
|
|
517
|
+
setInternal(updated);
|
|
518
|
+
setExternal(toExternal(updated));
|
|
519
|
+
};
|
|
520
|
+
return [internal, setInternalValue];
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
// src/controls/control-types/size-control.tsx
|
|
419
524
|
var SizeControl = ({ units: units2, placeholder }) => {
|
|
420
|
-
const { value, setValue } = useControl(
|
|
421
|
-
const
|
|
525
|
+
const { value, setValue } = useControl();
|
|
526
|
+
const [state, setState] = useSyncExternalState({
|
|
527
|
+
external: value,
|
|
528
|
+
setExternal: setValue,
|
|
529
|
+
persistWhen: (controlValue) => !!controlValue?.value.size || controlValue?.value.size === 0,
|
|
530
|
+
fallback: (controlValue) => ({
|
|
531
|
+
$$type: "size",
|
|
532
|
+
value: { unit: controlValue?.value.unit || "px", size: NaN }
|
|
533
|
+
})
|
|
534
|
+
});
|
|
422
535
|
const handleUnitChange = (event) => {
|
|
423
536
|
const unit = event.target.value;
|
|
424
|
-
|
|
537
|
+
setState((prev) => ({
|
|
538
|
+
...prev,
|
|
539
|
+
value: {
|
|
540
|
+
...prev.value,
|
|
541
|
+
unit
|
|
542
|
+
}
|
|
543
|
+
}));
|
|
425
544
|
};
|
|
426
545
|
const handleSizeChange = (event) => {
|
|
427
|
-
const {
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
546
|
+
const { value: size } = event.target;
|
|
547
|
+
setState((prev) => ({
|
|
548
|
+
...prev,
|
|
549
|
+
value: {
|
|
550
|
+
...prev.value,
|
|
551
|
+
size: size || size === "0" ? parseFloat(size) : NaN
|
|
552
|
+
}
|
|
553
|
+
}));
|
|
432
554
|
};
|
|
433
|
-
return /* @__PURE__ */
|
|
434
|
-
|
|
555
|
+
return /* @__PURE__ */ React11.createElement(import_ui9.Stack, { direction: "row" }, /* @__PURE__ */ React11.createElement(
|
|
556
|
+
import_ui9.TextField,
|
|
435
557
|
{
|
|
436
558
|
size: "tiny",
|
|
437
559
|
type: "number",
|
|
438
|
-
value:
|
|
560
|
+
value: Number.isNaN(state.value.size) ? "" : state.value.size,
|
|
439
561
|
onChange: handleSizeChange,
|
|
440
562
|
placeholder
|
|
441
563
|
}
|
|
442
|
-
), /* @__PURE__ */
|
|
443
|
-
|
|
564
|
+
), /* @__PURE__ */ React11.createElement(
|
|
565
|
+
import_ui9.Select,
|
|
444
566
|
{
|
|
445
567
|
size: "tiny",
|
|
446
|
-
value:
|
|
568
|
+
value: state.value.unit,
|
|
447
569
|
onChange: handleUnitChange,
|
|
448
570
|
MenuProps: {
|
|
449
571
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
450
572
|
transformOrigin: { vertical: "top", horizontal: "right" }
|
|
451
573
|
}
|
|
452
574
|
},
|
|
453
|
-
units2.map((unit) => /* @__PURE__ */
|
|
575
|
+
units2.map((unit) => /* @__PURE__ */ React11.createElement(import_ui9.MenuItem, { key: unit, value: unit }, unit.toUpperCase()))
|
|
454
576
|
));
|
|
455
577
|
};
|
|
456
|
-
var defaultState = {
|
|
457
|
-
$$type: "size",
|
|
458
|
-
value: { unit: "px", size: 0 }
|
|
459
|
-
};
|
|
460
578
|
|
|
461
579
|
// src/components/style-sections/size-section.tsx
|
|
462
|
-
var
|
|
463
|
-
var
|
|
580
|
+
var import_ui10 = require("@elementor/ui");
|
|
581
|
+
var import_i18n2 = require("@wordpress/i18n");
|
|
464
582
|
var SizeSection = () => {
|
|
465
|
-
return /* @__PURE__ */
|
|
583
|
+
return /* @__PURE__ */ React12.createElement(CollapsibleSection, { title: (0, import_i18n2.__)("Size", "elementor") }, /* @__PURE__ */ React12.createElement(import_ui10.Stack, { gap: 1.5 }, /* @__PURE__ */ React12.createElement(import_ui10.Stack, { direction: "row", gap: 2 }, /* @__PURE__ */ React12.createElement(Control2, { bind: "width", label: (0, import_i18n2.__)("Width", "elementor") }), /* @__PURE__ */ React12.createElement(Control2, { bind: "height", label: (0, import_i18n2.__)("Height", "elementor") })), /* @__PURE__ */ React12.createElement(import_ui10.Stack, { direction: "row", gap: 2 }, /* @__PURE__ */ React12.createElement(Control2, { bind: "min-width", label: (0, import_i18n2.__)("Min. Width", "elementor") }), /* @__PURE__ */ React12.createElement(Control2, { bind: "min-height", label: (0, import_i18n2.__)("Min. Height", "elementor") })), /* @__PURE__ */ React12.createElement(import_ui10.Stack, { direction: "row", gap: 2 }, /* @__PURE__ */ React12.createElement(Control2, { bind: "max-width", label: (0, import_i18n2.__)("Max. Width", "elementor") }), /* @__PURE__ */ React12.createElement(Control2, { bind: "max-height", label: (0, import_i18n2.__)("Max. Height", "elementor") }))));
|
|
466
584
|
};
|
|
467
585
|
var units = ["px", "%", "em", "rem", "vw"];
|
|
468
586
|
var Control2 = ({ label, bind }) => {
|
|
469
|
-
return /* @__PURE__ */
|
|
587
|
+
return /* @__PURE__ */ React12.createElement(StyleControl, { bind }, /* @__PURE__ */ React12.createElement(import_ui10.Stack, { gap: 1, sx: { flex: "0 1 50%" } }, /* @__PURE__ */ React12.createElement(StyleControl.Label, null, label), /* @__PURE__ */ React12.createElement(SizeControl, { units })));
|
|
470
588
|
};
|
|
471
589
|
|
|
472
590
|
// src/components/style-tab.tsx
|
|
@@ -474,13 +592,13 @@ var StyleTab = () => {
|
|
|
474
592
|
const { element } = useElementContext();
|
|
475
593
|
const elementStyles = useElementStyles(element.id);
|
|
476
594
|
const [selectedStyleDef = null] = Object.values(elementStyles || {});
|
|
477
|
-
return /* @__PURE__ */
|
|
595
|
+
return /* @__PURE__ */ React13.createElement(StyleContext, { selectedStyleDef }, /* @__PURE__ */ React13.createElement(import_ui11.Stack, null, /* @__PURE__ */ React13.createElement(SizeSection, null)));
|
|
478
596
|
};
|
|
479
597
|
|
|
480
598
|
// src/components/editing-panel-tabs.tsx
|
|
481
599
|
var EditingPanelTabs = () => {
|
|
482
|
-
const { getTabProps, getTabPanelProps, getTabsProps } = (0,
|
|
483
|
-
return /* @__PURE__ */
|
|
600
|
+
const { getTabProps, getTabPanelProps, getTabsProps } = (0, import_ui12.useTabs)("settings");
|
|
601
|
+
return /* @__PURE__ */ React14.createElement(import_ui12.Stack, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React14.createElement(import_ui12.Tabs, { variant: "fullWidth", indicatorColor: "secondary", textColor: "inherit", ...getTabsProps() }, /* @__PURE__ */ React14.createElement(import_ui12.Tab, { label: (0, import_i18n3.__)("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React14.createElement(import_ui12.Tab, { label: (0, import_i18n3.__)("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React14.createElement(import_ui12.TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React14.createElement(SettingsTab, null)), /* @__PURE__ */ React14.createElement(import_ui12.TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React14.createElement(StyleTab, null)));
|
|
484
602
|
};
|
|
485
603
|
|
|
486
604
|
// src/components/editing-panel.tsx
|
|
@@ -491,8 +609,8 @@ var EditingPanel = () => {
|
|
|
491
609
|
if (elements.length !== 1 || !elementType) {
|
|
492
610
|
return null;
|
|
493
611
|
}
|
|
494
|
-
const panelTitle = (0,
|
|
495
|
-
return /* @__PURE__ */
|
|
612
|
+
const panelTitle = (0, import_i18n4.__)("Edit %s", "elementor").replace("%s", elementType.title);
|
|
613
|
+
return /* @__PURE__ */ React15.createElement(import_editor_panels.Panel, null, /* @__PURE__ */ React15.createElement(import_editor_panels.PanelHeader, null, /* @__PURE__ */ React15.createElement(import_editor_panels.PanelHeaderTitle, null, panelTitle)), /* @__PURE__ */ React15.createElement(import_editor_panels.PanelBody, null, /* @__PURE__ */ React15.createElement(ElementContext, { element: selectedElement }, /* @__PURE__ */ React15.createElement(EditingPanelTabs, null))));
|
|
496
614
|
};
|
|
497
615
|
|
|
498
616
|
// src/panel.ts
|
|
@@ -515,11 +633,11 @@ var shouldUseV2Panel = () => {
|
|
|
515
633
|
};
|
|
516
634
|
|
|
517
635
|
// src/hooks/use-open-editor-panel.ts
|
|
518
|
-
var
|
|
636
|
+
var import_react6 = require("react");
|
|
519
637
|
var import_editor_v1_adapters8 = require("@elementor/editor-v1-adapters");
|
|
520
638
|
var useOpenEditorPanel = () => {
|
|
521
639
|
const { open } = usePanelActions();
|
|
522
|
-
(0,
|
|
640
|
+
(0, import_react6.useEffect)(() => {
|
|
523
641
|
return (0, import_editor_v1_adapters8.__privateListenTo)((0, import_editor_v1_adapters8.commandStartEvent)("panel/editor/open"), () => {
|
|
524
642
|
if (shouldUseV2Panel()) {
|
|
525
643
|
open();
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/panel.ts","../src/components/editing-panel.tsx","../src/hooks/use-selected-elements.ts","../src/sync/get-selected-elements.ts","../src/hooks/use-element-type.ts","../src/sync/get-widgets-cache.ts","../src/contexts/element-context.tsx","../src/components/editing-panel-tabs.tsx","../src/components/settings-tab.tsx","../src/controls/settings-control.tsx","../src/controls/control-context.tsx","../src/hooks/use-widget-settings.ts","../src/sync/get-container.ts","../src/sync/update-settings.ts","../src/components/collapsible-section.tsx","../src/controls/control-types/select-control.tsx","../src/controls/control-types/text-area-control.tsx","../src/controls/control-types/text-control.tsx","../src/controls/get-control-by-type.ts","../src/components/style-tab.tsx","../src/contexts/style-context.tsx","../src/hooks/use-element-styles.ts","../src/sync/get-element-styles.ts","../src/components/style-sections/size-section.tsx","../src/controls/style-control.tsx","../src/sync/update-style.ts","../src/hooks/use-element-style-prop.ts","../src/controls/control-types/size-control.tsx","../src/init.ts","../src/sync/should-use-v2-panel.ts","../src/hooks/use-open-editor-panel.ts","../src/components/editing-panel-hooks.tsx","../src/index.ts"],"sourcesContent":["import { __createPanel as createPanel } from '@elementor/editor-panels';\nimport { EditingPanel } from './components/editing-panel';\n\nexport const { panel, usePanelActions, usePanelStatus } = createPanel( {\n\tid: 'editing-panel',\n\tcomponent: EditingPanel,\n} );\n","import * as React from 'react';\nimport { __ } from '@wordpress/i18n';\nimport useSelectedElements from '../hooks/use-selected-elements';\nimport useElementType from '../hooks/use-element-type';\nimport { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from '@elementor/editor-panels';\nimport { ElementContext } from '../contexts/element-context';\nimport { EditingPanelTabs } from './editing-panel-tabs';\n\nexport const EditingPanel = () => {\n\tconst elements = useSelectedElements();\n\n\tconst [ selectedElement ] = elements;\n\n\tconst elementType = useElementType( selectedElement?.type );\n\n\tif ( elements.length !== 1 || ! elementType ) {\n\t\treturn null;\n\t}\n\n\t/* translators: %s: Element type title. */\n\tconst panelTitle = __( 'Edit %s', 'elementor' ).replace( '%s', elementType.title );\n\n\treturn (\n\t\t<Panel>\n\t\t\t<PanelHeader>\n\t\t\t\t<PanelHeaderTitle>{ panelTitle }</PanelHeaderTitle>\n\t\t\t</PanelHeader>\n\t\t\t<PanelBody>\n\t\t\t\t<ElementContext element={ selectedElement }>\n\t\t\t\t\t<EditingPanelTabs />\n\t\t\t\t</ElementContext>\n\t\t\t</PanelBody>\n\t\t</Panel>\n\t);\n};\n","import { __privateUseListenTo as useListenTo, commandEndEvent } from '@elementor/editor-v1-adapters';\nimport getSelectedElements from '../sync/get-selected-elements';\n\nexport default function useSelectedElements() {\n\treturn useListenTo(\n\t\t[ commandEndEvent( 'document/elements/select' ), commandEndEvent( 'document/elements/deselect' ) ],\n\t\t() => getSelectedElements()\n\t);\n}\n","import { ExtendedWindow } from './types';\nimport { Element } from '../types';\n\nexport default function getSelectedElements(): Element[] {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\tconst selectedElements = extendedWindow.elementor?.selection?.getElements?.() ?? [];\n\n\treturn selectedElements.reduce< Element[] >( ( acc, el ) => {\n\t\tconst type = el.model.get( 'widgetType' ) || el.model.get( 'elType' );\n\n\t\tif ( type ) {\n\t\t\tacc.push( {\n\t\t\t\tid: el.model.get( 'id' ),\n\t\t\t\ttype,\n\t\t\t} );\n\t\t}\n\n\t\treturn acc;\n\t}, [] );\n}\n","import { __privateUseListenTo as useListenTo, commandEndEvent } from '@elementor/editor-v1-adapters';\nimport getWidgetsCache from '../sync/get-widgets-cache';\nimport { ElementType } from '../types';\n\nexport default function useElementType( type?: string ) {\n\treturn useListenTo(\n\t\tcommandEndEvent( 'editor/documents/load' ),\n\t\t(): ElementType | null => {\n\t\t\tif ( ! type ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst widgetsCache = getWidgetsCache();\n\t\t\tconst elementType = widgetsCache?.[ type ];\n\n\t\t\tif ( ! elementType?.atomic_controls ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tkey: type,\n\t\t\t\tcontrols: elementType.atomic_controls,\n\t\t\t\ttitle: elementType.title,\n\t\t\t};\n\t\t},\n\t\t[ type ]\n\t);\n}\n","import { ExtendedWindow } from './types';\n\nexport default function getWidgetsCache() {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn extendedWindow?.elementor?.widgetsCache || null;\n}\n","import * as React from 'react';\nimport { createContext, ReactNode, useContext } from 'react';\nimport { Element } from '../types';\n\ntype ContextValue = {\n\telement: Element;\n};\n\nconst Context = createContext< ContextValue | null >( null );\n\ntype Props = {\n\telement: Element;\n\tchildren?: ReactNode;\n};\n\nexport function ElementContext( { children, element }: Props ) {\n\treturn <Context.Provider value={ { element } }>{ children }</Context.Provider>;\n}\n\nexport function useElementContext() {\n\tconst context = useContext( Context );\n\n\tif ( ! context ) {\n\t\tthrow new Error( 'useElementContext must be used within a ElementContextProvider' );\n\t}\n\n\treturn context;\n}\n","import { Stack, Tabs, Tab, TabPanel, useTabs } from '@elementor/ui';\nimport * as React from 'react';\nimport { __ } from '@wordpress/i18n';\nimport { SettingsTab } from './settings-tab';\nimport { StyleTab } from './style-tab';\n\ntype TabValue = 'settings' | 'style';\n\nexport const EditingPanelTabs = () => {\n\tconst { getTabProps, getTabPanelProps, getTabsProps } = useTabs< TabValue >( 'settings' );\n\n\treturn (\n\t\t<Stack direction=\"column\" sx={ { width: '100%' } }>\n\t\t\t<Tabs variant=\"fullWidth\" indicatorColor=\"secondary\" textColor=\"inherit\" { ...getTabsProps() }>\n\t\t\t\t<Tab label={ __( 'General', 'elementor' ) } { ...getTabProps( 'settings' ) } />\n\t\t\t\t<Tab label={ __( 'Style', 'elementor' ) } { ...getTabProps( 'style' ) } />\n\t\t\t</Tabs>\n\t\t\t<TabPanel { ...getTabPanelProps( 'settings' ) } disablePadding>\n\t\t\t\t<SettingsTab />\n\t\t\t</TabPanel>\n\t\t\t<TabPanel { ...getTabPanelProps( 'style' ) } disablePadding>\n\t\t\t\t<StyleTab />\n\t\t\t</TabPanel>\n\t\t</Stack>\n\t);\n};\n","import * as React from 'react';\nimport { Stack } from '@elementor/ui';\nimport { SettingsControl } from '../controls/settings-control';\nimport { useElementContext } from '../contexts/element-context';\nimport useElementType from '../hooks/use-element-type';\nimport type { Control } from '../types';\nimport { CollapsibleSection } from './collapsible-section';\nimport { getControlByType } from '../controls/get-control-by-type';\n\nexport const SettingsTab = () => {\n\tconst { element } = useElementContext();\n\n\tconst elementType = useElementType( element?.type );\n\n\tif ( ! elementType ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Stack>\n\t\t\t{ elementType.controls.map( ( { type, value }, index ) => {\n\t\t\t\tif ( type === 'control' ) {\n\t\t\t\t\treturn <Control key={ value.bind } control={ value } />;\n\t\t\t\t}\n\n\t\t\t\tif ( type === 'section' ) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<CollapsibleSection key={ type + '.' + index } title={ value.label }>\n\t\t\t\t\t\t\t{ value.items?.map( ( item ) => {\n\t\t\t\t\t\t\t\tif ( item.type === 'control' ) {\n\t\t\t\t\t\t\t\t\treturn <Control key={ item.value.bind } control={ item.value } />;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// TODO: Handle 2nd level sections\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</CollapsibleSection>\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t} ) }\n\t\t</Stack>\n\t);\n};\n\n// TODO: Create control wrapper by type for different layouts.\nconst Control = ( { control }: { control: Control[ 'value' ] } ) => {\n\tconst ControlComponent = getControlByType( control.type );\n\n\tif ( ! ControlComponent ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<SettingsControl bind={ control.bind }>\n\t\t\t<SettingsControl.Label>{ control.label }</SettingsControl.Label>\n\t\t\t<ControlComponent\n\t\t\t\t/* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n\t\t\t\t{ ...( control.props as any ) }\n\t\t\t/>\n\t\t</SettingsControl>\n\t);\n};\n","import * as React from 'react';\nimport { ControlContext } from '../controls/control-context';\nimport { Stack, styled, Typography } from '@elementor/ui';\nimport { PropKey, PropValue } from '../types';\nimport { useElementContext } from '../contexts/element-context';\nimport { useWidgetSettings } from '../hooks/use-widget-settings';\nimport { updateSettings } from '../sync/update-settings';\n\ntype Props = {\n\tbind: PropKey;\n\tchildren: React.ReactNode;\n};\n\nexport const SettingsControlProvider = ( { bind, children }: Props ) => {\n\tconst { element } = useElementContext();\n\tconst value = useWidgetSettings( { id: element.id, bind } );\n\n\tconst setValue = ( newValue: PropValue ) => {\n\t\tupdateSettings( {\n\t\t\tid: element.id,\n\t\t\tprops: {\n\t\t\t\t[ bind ]: newValue,\n\t\t\t},\n\t\t} );\n\t};\n\n\treturn <ControlContext.Provider value={ { setValue, value, bind } }>{ children }</ControlContext.Provider>;\n};\n\nconst SettingsControl = ( { children, bind }: Props ) => (\n\t<SettingsControlProvider bind={ bind }>\n\t\t<StyledStack gap={ 1 } direction=\"row\" alignItems=\"center\" justifyContent=\"space-between\" flexWrap=\"wrap\">\n\t\t\t{ children }\n\t\t</StyledStack>\n\t</SettingsControlProvider>\n);\n\nconst StyledStack = styled( Stack )`\n\t& > * {\n\t\tflex-grow: 1;\n\t}\n\n\t& > label {\n\t\tmin-width: 50%;\n\t}\n`;\n\nconst Label = ( { children }: { children: React.ReactNode } ) => {\n\treturn (\n\t\t<Typography component=\"label\" variant=\"caption\" color=\"text.secondary\">\n\t\t\t{ children }\n\t\t</Typography>\n\t);\n};\n\nSettingsControl.Label = Label;\n\nexport { SettingsControl };\n","import { createContext, useContext } from 'react';\nimport { PropKey, PropValue } from '../types';\n\nexport type ControlContext< T extends PropValue > = {\n\tbind: PropKey;\n\tsetValue: ( value: T ) => void;\n\tvalue: T;\n};\n\nexport const ControlContext = createContext< ControlContext< PropValue > | null >( null );\n\nexport function useControl< T extends PropValue >(): ControlContext< T | undefined >;\nexport function useControl< T extends PropValue >( defaultValue: T ): ControlContext< T >;\nexport function useControl< T extends PropValue >( defaultValue?: T ) {\n\tconst controlContext = useContext< ControlContext< T > >( ControlContext as never );\n\n\tif ( ! controlContext ) {\n\t\tthrow new Error( 'useControl must be used within a ControlContext' );\n\t}\n\n\treturn { ...controlContext, value: controlContext.value ?? defaultValue };\n}\n","import { commandEndEvent, __privateUseListenTo as useListenTo } from '@elementor/editor-v1-adapters';\nimport { PropValue } from '../types';\nimport getContainer from '../sync/get-container';\n\nexport const useWidgetSettings = ( { id, bind }: { id: string; bind: string } ): PropValue => {\n\treturn useListenTo(\n\t\tcommandEndEvent( 'document/elements/settings' ),\n\t\t() => {\n\t\t\tconst container = getContainer( id );\n\t\t\tconst value = container?.settings?.get( bind ) ?? null;\n\n\t\t\treturn value;\n\t\t},\n\t\t[ id, bind ]\n\t);\n};\n","import { ExtendedWindow } from './types';\n\nexport default function getContainer( id: string ) {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\tconst container = extendedWindow.elementor?.getContainer?.( id );\n\n\treturn container ?? null;\n}\n","import { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';\nimport { Props } from '../types';\nimport getContainer from './get-container';\n\nexport const updateSettings = ( { id, props }: { id: string; props: Props } ) => {\n\tconst container = getContainer( id );\n\n\trunCommand( 'document/elements/settings', {\n\t\tcontainer,\n\t\tsettings: {\n\t\t\t...props,\n\t\t},\n\t} );\n};\n","import * as React from 'react';\nimport { useId } from 'react';\nimport { Accordion, AccordionSummary, AccordionDetails, AccordionSummaryText, Stack } from '@elementor/ui';\n\nexport type CollapsibleSectionProps = React.PropsWithChildren< {\n\ttitle: React.ReactNode;\n} >;\n\nexport const CollapsibleSection = ( { title, children }: CollapsibleSectionProps ) => {\n\tconst uid = useId();\n\tconst labelId = `label-${ uid }`;\n\tconst contentId = `content-${ uid }`;\n\n\t// TODO: Change to collapsible list item\n\treturn (\n\t\t<Accordion disableGutters defaultExpanded>\n\t\t\t<AccordionSummary aria-controls={ contentId } id={ labelId }>\n\t\t\t\t<AccordionSummaryText primaryTypographyProps={ { variant: 'caption' } }>{ title }</AccordionSummaryText>\n\t\t\t</AccordionSummary>\n\t\t\t<AccordionDetails id={ contentId } aria-labelledby={ labelId }>\n\t\t\t\t<Stack gap={ 2.5 }>{ children }</Stack>\n\t\t\t</AccordionDetails>\n\t\t</Accordion>\n\t);\n};\n","import * as React from 'react';\nimport { MenuItem, Select, SelectChangeEvent } from '@elementor/ui';\nimport { useControl } from '../control-context';\nimport { PropValue } from '../../types';\n\ntype Props< T > = {\n\toptions: Array< { label: string; value: T; disabled?: boolean } >;\n};\n\nexport const SelectControl = < T extends PropValue >( { options }: Props< T > ) => {\n\tconst { value, setValue } = useControl< T >();\n\n\tconst handleChange = ( event: SelectChangeEvent< T > ) => {\n\t\tsetValue( event.target.value as T );\n\t};\n\n\treturn (\n\t\t<Select size=\"tiny\" value={ value ?? '' } onChange={ handleChange }>\n\t\t\t{ options.map( ( { label, ...props } ) => (\n\t\t\t\t<MenuItem key={ props.value } { ...props }>\n\t\t\t\t\t{ label }\n\t\t\t\t</MenuItem>\n\t\t\t) ) }\n\t\t</Select>\n\t);\n};\n","import * as React from 'react';\nimport { TextField } from '@elementor/ui';\nimport { useControl } from '../control-context';\n\ntype Props = {\n\tplaceholder?: string;\n};\n\nexport const TextAreaControl = ( { placeholder }: Props ) => {\n\tconst { value, setValue } = useControl< string >( '' );\n\n\tconst handleChange = ( event: React.ChangeEvent< HTMLInputElement > ) => {\n\t\tsetValue( event.target.value );\n\t};\n\n\treturn (\n\t\t<TextField\n\t\t\tsize=\"tiny\"\n\t\t\tmultiline\n\t\t\tfullWidth\n\t\t\trows={ 5 }\n\t\t\tvalue={ value }\n\t\t\tonChange={ handleChange }\n\t\t\tplaceholder={ placeholder }\n\t\t/>\n\t);\n};\n","import * as React from 'react';\nimport { TextField } from '@elementor/ui';\nimport { useControl } from '../control-context';\n\nexport const TextControl = ( { placeholder }: { placeholder?: string } ) => {\n\tconst { value, setValue } = useControl< string >( '' );\n\n\tconst handleChange = ( event: React.ChangeEvent< HTMLInputElement > ) => setValue( event.target.value );\n\n\treturn <TextField type=\"text\" size=\"tiny\" value={ value } onChange={ handleChange } placeholder={ placeholder } />;\n};\n","import { SelectControl } from './control-types/select-control';\nimport { TextAreaControl } from './control-types/text-area-control';\nimport { TextControl } from './control-types/text-control';\n\nconst controlTypes = {\n\tselect: SelectControl,\n\ttext: TextControl,\n\ttextarea: TextAreaControl,\n};\n\nexport const getControlByType = ( type: string ) => {\n\treturn controlTypes[ type as keyof typeof controlTypes ] ?? null;\n};\n","import * as React from 'react';\nimport { StyleContext } from '../contexts/style-context';\nimport { useElementContext } from '../contexts/element-context';\nimport { useElementStyles } from '../hooks/use-element-styles';\nimport { Stack } from '@elementor/ui';\nimport { SizeSection } from './style-sections/size-section';\n\nexport const StyleTab = () => {\n\tconst { element } = useElementContext();\n\tconst elementStyles = useElementStyles( element.id );\n\t// TODO: Handle selected style state.\n\tconst [ selectedStyleDef = null ] = Object.values( elementStyles || {} );\n\n\treturn (\n\t\t<StyleContext selectedStyleDef={ selectedStyleDef }>\n\t\t\t<Stack>\n\t\t\t\t<SizeSection />\n\t\t\t</Stack>\n\t\t</StyleContext>\n\t);\n};\n","import * as React from 'react';\nimport { createContext, ReactNode, useContext } from 'react';\nimport { useActiveBreakpoint } from '@elementor/editor-responsive';\nimport { StyleDefinition, StyleVariant } from '@elementor/editor-style';\n\ntype ContextValue = {\n\tselectedStyleDef: StyleDefinition | null;\n\tselectedMeta: StyleVariant[ 'meta' ];\n};\n\nconst Context = createContext< ContextValue | null >( null );\n\ntype Props = {\n\tchildren: ReactNode;\n\tselectedStyleDef: StyleDefinition | null;\n};\n\nexport function StyleContext( { children, selectedStyleDef }: Props ) {\n\tconst breakpoint = useActiveBreakpoint();\n\t// TODO: Handle state when we support it.\n\tconst selectedMeta = { breakpoint, state: null } as const;\n\n\treturn <Context.Provider value={ { selectedStyleDef, selectedMeta } }>{ children }</Context.Provider>;\n}\n\nexport function useStyleContext() {\n\tconst context = useContext( Context );\n\n\tif ( ! context ) {\n\t\tthrow new Error( 'UseStyleContext must be used within a StyleContextProvider' );\n\t}\n\n\treturn context;\n}\n","import { __privateUseListenTo as useListenTo, commandEndEvent } from '@elementor/editor-v1-adapters';\nimport { getElementStyles } from '../sync/get-element-styles';\nimport { ElementID } from '../types';\n\nexport const useElementStyles = ( elementID: ElementID ) => {\n\treturn useListenTo(\n\t\tcommandEndEvent( 'document/atomic-widgets/styles' ),\n\t\t() => {\n\t\t\treturn getElementStyles( elementID );\n\t\t},\n\t\t[ elementID ]\n\t);\n};\n","import getContainer from './get-container';\nimport { ElementID } from '../types';\nimport { StyleDefinition } from '@elementor/editor-style';\n\nexport const getElementStyles = ( elementID: ElementID ): Record< string, StyleDefinition > | null => {\n\tconst container = getContainer( elementID );\n\n\treturn container?.model.get( 'styles' ) || null;\n};\n","import * as React from 'react';\nimport { CollapsibleSection } from '../../components/collapsible-section';\nimport { StyleControl, StyleControlProps } from '../../controls/style-control';\nimport { SizeControl, Unit } from '../../controls/control-types/size-control';\nimport { Stack } from '@elementor/ui';\nimport { __ } from '@wordpress/i18n';\n\nexport const SizeSection = () => {\n\treturn (\n\t\t<CollapsibleSection title={ __( 'Size', 'elementor' ) }>\n\t\t\t<Stack gap={ 1.5 }>\n\t\t\t\t<Stack direction=\"row\" gap={ 2 }>\n\t\t\t\t\t<Control bind=\"width\" label={ __( 'Width', 'elementor' ) } />\n\t\t\t\t\t<Control bind=\"height\" label={ __( 'Height', 'elementor' ) } />\n\t\t\t\t</Stack>\n\t\t\t\t<Stack direction=\"row\" gap={ 2 }>\n\t\t\t\t\t<Control bind=\"min-width\" label={ __( 'Min. Width', 'elementor' ) } />\n\t\t\t\t\t<Control bind=\"min-height\" label={ __( 'Min. Height', 'elementor' ) } />\n\t\t\t\t</Stack>\n\t\t\t\t<Stack direction=\"row\" gap={ 2 }>\n\t\t\t\t\t<Control bind=\"max-width\" label={ __( 'Max. Width', 'elementor' ) } />\n\t\t\t\t\t<Control bind=\"max-height\" label={ __( 'Max. Height', 'elementor' ) } />\n\t\t\t\t</Stack>\n\t\t\t</Stack>\n\t\t</CollapsibleSection>\n\t);\n};\n\nconst units: Unit[] = [ 'px', '%', 'em', 'rem', 'vw' ];\n\ntype ControlProps = {\n\tbind: StyleControlProps[ 'bind' ];\n\tlabel: string;\n};\n\nconst Control = ( { label, bind }: ControlProps ) => {\n\treturn (\n\t\t<StyleControl bind={ bind }>\n\t\t\t<Stack gap={ 1 } sx={ { flex: '0 1 50%' } }>\n\t\t\t\t<StyleControl.Label>{ label }</StyleControl.Label>\n\t\t\t\t<SizeControl units={ units } />\n\t\t\t</Stack>\n\t\t</StyleControl>\n\t);\n};\n","import * as React from 'react';\nimport { PropKey, PropValue } from '../types';\nimport { ControlContext } from '../controls/control-context';\nimport { updateStyle } from '../sync/update-style';\nimport { useElementStyleProp } from '../hooks/use-element-style-prop';\nimport { useElementContext } from '../contexts/element-context';\nimport { useStyleContext } from '../contexts/style-context';\nimport { Typography } from '@elementor/ui';\n\nexport type StyleControlProps = {\n\tbind: PropKey;\n\tchildren: React.ReactNode;\n};\n\nconst StyleControl = ( { bind, children }: StyleControlProps ) => {\n\tconst { element } = useElementContext();\n\tconst { selectedStyleDef, selectedMeta } = useStyleContext();\n\n\tconst setValue = ( newValue: PropValue ) => {\n\t\tupdateStyle( {\n\t\t\telementID: element.id,\n\t\t\tstyleDefID: selectedStyleDef?.id,\n\t\t\tprops: { [ bind ]: newValue },\n\t\t\tmeta: selectedMeta,\n\t\t} );\n\t};\n\n\tconst value = useElementStyleProp( {\n\t\telementID: element.id,\n\t\tstyleDefID: selectedStyleDef?.id,\n\t\tmeta: selectedMeta,\n\t\tpropName: bind,\n\t} );\n\n\treturn <ControlContext.Provider value={ { bind, value, setValue } }>{ children }</ControlContext.Provider>;\n};\n\nconst Label = ( { children }: { children: React.ReactNode } ) => {\n\treturn (\n\t\t<Typography component=\"label\" variant=\"caption\" color=\"text.secondary\">\n\t\t\t{ children }\n\t\t</Typography>\n\t);\n};\n\nStyleControl.Label = Label;\n\nexport { StyleControl };\n","import { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';\nimport { ElementID, PropKey, Props } from '../types';\nimport getContainer from './get-container';\nimport { StyleDefinitionID, StyleVariant } from '@elementor/editor-style';\n\nexport type UpdateStyleProps = {\n\telementID: ElementID;\n\tstyleDefID?: StyleDefinitionID;\n\tmeta: StyleVariant[ 'meta' ];\n\tprops: Props;\n\tbind?: PropKey;\n};\n\nexport const updateStyle = ( { elementID, styleDefID, meta, props, bind = 'classes' }: UpdateStyleProps ) => {\n\tconst container = getContainer( elementID );\n\n\trunCommand( 'document/atomic-widgets/styles', {\n\t\tcontainer,\n\t\tstyleDefID,\n\t\tbind,\n\t\tmeta,\n\t\tprops,\n\t} );\n};\n","import { commandEndEvent, __privateUseListenTo as useListenTo } from '@elementor/editor-v1-adapters';\nimport { ElementID, PropKey, PropValue } from '../types';\nimport { getElementStyles } from '../sync/get-element-styles';\nimport { StyleDefinition, StyleDefinitionID, StyleVariant } from '@elementor/editor-style';\n\nexport type UseElementStylePropArgs = {\n\telementID: ElementID;\n\tstyleDefID?: StyleDefinitionID;\n\tmeta: StyleVariant[ 'meta' ];\n\tpropName: PropKey;\n};\n\nexport const useElementStyleProp = < T extends PropValue >( {\n\telementID,\n\tstyleDefID,\n\tmeta,\n\tpropName,\n}: UseElementStylePropArgs ): T | null => {\n\treturn useListenTo(\n\t\tcommandEndEvent( 'document/atomic-widgets/styles' ),\n\t\t() => {\n\t\t\t// TODO: return default value for style prop\n\t\t\tif ( ! styleDefID ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst styleDef = getElementStyles( elementID )?.[ styleDefID ];\n\n\t\t\tif ( ! styleDef ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst variant = getVariantByMeta( styleDef, meta );\n\n\t\t\treturn variant?.props[ propName ] ?? null;\n\t\t},\n\t\t[ elementID, styleDefID, propName, meta ]\n\t) as T;\n};\n\nfunction getVariantByMeta( styleDef: StyleDefinition, meta: StyleVariant[ 'meta' ] ) {\n\treturn styleDef.variants.find( ( variant ) => {\n\t\treturn variant.meta.breakpoint === meta.breakpoint && variant.meta.state === meta.state;\n\t} );\n}\n","import * as React from 'react';\nimport { MenuItem, Select, SelectChangeEvent, Stack, TextField } from '@elementor/ui';\nimport { useControl } from '../control-context';\nimport { TransformablePropValue } from '../../types';\n\nexport type SizeControlProps = {\n\tunits: Unit[];\n\tplaceholder?: string;\n};\n\nexport type Unit = 'px' | '%' | 'em' | 'rem' | 'vw';\n\nexport type SizeControlValue = TransformablePropValue< { unit: Unit; size: number } >;\n\nexport const SizeControl = ( { units, placeholder }: SizeControlProps ) => {\n\tconst { value, setValue } = useControl< SizeControlValue >( defaultState );\n\tconst propValue = value.value;\n\n\tconst handleUnitChange = ( event: SelectChangeEvent< Unit > ) => {\n\t\tconst unit = event.target.value as Unit;\n\n\t\tsetValue( { $$type: 'size', value: { ...propValue, unit } } );\n\t};\n\n\tconst handleSizeChange = ( event: React.ChangeEvent< HTMLInputElement > ) => {\n\t\tconst { valueAsNumber: size } = event.target;\n\n\t\tif ( Number.isNaN( size ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetValue( { $$type: 'size', value: { ...propValue, size } } );\n\t};\n\n\treturn (\n\t\t<Stack direction=\"row\">\n\t\t\t<TextField\n\t\t\t\tsize=\"tiny\"\n\t\t\t\ttype=\"number\"\n\t\t\t\tvalue={ propValue.size }\n\t\t\t\tonChange={ handleSizeChange }\n\t\t\t\tplaceholder={ placeholder }\n\t\t\t/>\n\t\t\t<Select\n\t\t\t\tsize=\"tiny\"\n\t\t\t\tvalue={ propValue.unit }\n\t\t\t\tonChange={ handleUnitChange }\n\t\t\t\tMenuProps={ {\n\t\t\t\t\tanchorOrigin: { vertical: 'bottom', horizontal: 'right' },\n\t\t\t\t\ttransformOrigin: { vertical: 'top', horizontal: 'right' },\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ units.map( ( unit ) => (\n\t\t\t\t\t<MenuItem key={ unit } value={ unit }>\n\t\t\t\t\t\t{ unit.toUpperCase() }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t) ) }\n\t\t\t</Select>\n\t\t</Stack>\n\t);\n};\n\nconst defaultState: SizeControlValue = {\n\t$$type: 'size',\n\tvalue: { unit: 'px', size: 0 },\n};\n","import { panel } from './panel';\nimport { injectIntoLogic } from '@elementor/editor';\nimport { shouldUseV2Panel } from './sync/should-use-v2-panel';\nimport { EditingPanelHooks } from './components/editing-panel-hooks';\nimport { __registerPanel as registerPanel } from '@elementor/editor-panels';\nimport { __privateBlockDataCommand as blockDataCommand } from '@elementor/editor-v1-adapters';\n\nexport default function init() {\n\tregisterPanel( panel );\n\tblockV1Panel();\n\n\tinjectIntoLogic( {\n\t\tid: 'editing-panel-hooks',\n\t\tcomponent: EditingPanelHooks,\n\t} );\n}\n\nconst blockV1Panel = () => {\n\tblockDataCommand( {\n\t\tcommand: 'panel/editor/open',\n\t\tcondition: shouldUseV2Panel,\n\t} );\n};\n","import getSelectedElements from './get-selected-elements';\nimport getWidgetsCache from './get-widgets-cache';\n\nexport const shouldUseV2Panel = () => {\n\tconst selectedElements = getSelectedElements();\n\tconst widgetCache = getWidgetsCache();\n\n\tif ( selectedElements.length !== 1 ) {\n\t\treturn false;\n\t}\n\n\t// Check if the selected element has atomic controls, meaning it's a V2 element.\n\treturn !! widgetCache?.[ selectedElements[ 0 ].type ]?.atomic_controls;\n};\n","import { useEffect } from 'react';\nimport { commandStartEvent, __privateListenTo as listenTo } from '@elementor/editor-v1-adapters';\nimport { usePanelActions } from '../panel';\nimport { shouldUseV2Panel } from '../sync/should-use-v2-panel';\n\nexport const useOpenEditorPanel = () => {\n\tconst { open } = usePanelActions();\n\n\tuseEffect( () => {\n\t\treturn listenTo( commandStartEvent( 'panel/editor/open' ), () => {\n\t\t\tif ( shouldUseV2Panel() ) {\n\t\t\t\topen();\n\t\t\t}\n\t\t} );\n\t}, [] ); // eslint-disable-line react-hooks/exhaustive-deps\n};\n","import { useOpenEditorPanel } from '../hooks/use-open-editor-panel';\n\nexport const EditingPanelHooks = () => {\n\tuseOpenEditorPanel();\n\n\treturn null;\n};\n","import init from './init';\n\ninit();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,wBAA6C;;;ACA7C,IAAAC,UAAuB;AACvB,IAAAC,eAAmB;;;ACDnB,gCAAqE;;;ACGtD,SAAR,sBAAkD;AACxD,QAAM,iBAAiB;AAEvB,QAAM,mBAAmB,eAAe,WAAW,WAAW,cAAc,KAAK,CAAC;AAElF,SAAO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rB,eAAa;AAEb,qCAAiB;AAAA,IAChB,IAAI;AAAA,IACJ,WAAW;AAAA,EACZ,CAAE;AACH;AAEA,IAAM,eAAe,MAAM;AAC1B,iCAAAC,2BAAkB;AAAA,IACjB,SAAS;AAAA,IACT,WAAW;AAAA,EACZ,CAAE;AACH;;;AIpBA,KAAK;","names":["import_editor_panels","React","import_i18n","useListenTo","import_editor_v1_adapters","useListenTo","import_ui","React","import_i18n","React","import_ui","React","import_react","import_editor_v1_adapters","useListenTo","import_editor_v1_adapters","runCommand","React","import_react","import_ui","React","import_ui","React","import_ui","React","import_ui","React","React","import_react","Context","import_editor_v1_adapters","useListenTo","import_ui","React","React","import_editor_v1_adapters","runCommand","import_editor_v1_adapters","useListenTo","import_ui","Label","React","import_ui","units","import_ui","Control","createPanel","import_react","import_editor_v1_adapters","listenTo","import_editor_panels","import_editor_v1_adapters","registerPanel","blockDataCommand"]}
|
|
1
|
+
{"version":3,"sources":["../src/panel.ts","../src/components/editing-panel.tsx","../src/hooks/use-selected-elements.ts","../src/sync/get-selected-elements.ts","../src/hooks/use-element-type.ts","../src/sync/get-widgets-cache.ts","../src/contexts/element-context.tsx","../src/components/editing-panel-tabs.tsx","../src/components/settings-tab.tsx","../src/controls/settings-control.tsx","../src/controls/control-context.tsx","../src/hooks/use-widget-settings.ts","../src/sync/get-container.ts","../src/sync/update-settings.ts","../src/components/collapsible-section.tsx","../src/controls/control-types/select-control.tsx","../src/controls/control-types/text-area-control.tsx","../src/controls/control-types/text-control.tsx","../src/controls/control-types/attachment-control.tsx","../src/controls/get-control-by-type.ts","../src/components/style-tab.tsx","../src/contexts/style-context.tsx","../src/hooks/use-element-styles.ts","../src/sync/get-element-styles.ts","../src/components/style-sections/size-section.tsx","../src/controls/style-control.tsx","../src/sync/update-style.ts","../src/hooks/use-element-style-prop.ts","../src/controls/control-types/size-control.tsx","../src/controls/hooks/use-sync-external-state.tsx","../src/init.ts","../src/sync/should-use-v2-panel.ts","../src/hooks/use-open-editor-panel.ts","../src/components/editing-panel-hooks.tsx","../src/index.ts"],"sourcesContent":["import { __createPanel as createPanel } from '@elementor/editor-panels';\nimport { EditingPanel } from './components/editing-panel';\n\nexport const { panel, usePanelActions, usePanelStatus } = createPanel( {\n\tid: 'editing-panel',\n\tcomponent: EditingPanel,\n} );\n","import * as React from 'react';\nimport { __ } from '@wordpress/i18n';\nimport useSelectedElements from '../hooks/use-selected-elements';\nimport useElementType from '../hooks/use-element-type';\nimport { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from '@elementor/editor-panels';\nimport { ElementContext } from '../contexts/element-context';\nimport { EditingPanelTabs } from './editing-panel-tabs';\n\nexport const EditingPanel = () => {\n\tconst elements = useSelectedElements();\n\n\tconst [ selectedElement ] = elements;\n\n\tconst elementType = useElementType( selectedElement?.type );\n\n\tif ( elements.length !== 1 || ! elementType ) {\n\t\treturn null;\n\t}\n\n\t/* translators: %s: Element type title. */\n\tconst panelTitle = __( 'Edit %s', 'elementor' ).replace( '%s', elementType.title );\n\n\treturn (\n\t\t<Panel>\n\t\t\t<PanelHeader>\n\t\t\t\t<PanelHeaderTitle>{ panelTitle }</PanelHeaderTitle>\n\t\t\t</PanelHeader>\n\t\t\t<PanelBody>\n\t\t\t\t<ElementContext element={ selectedElement }>\n\t\t\t\t\t<EditingPanelTabs />\n\t\t\t\t</ElementContext>\n\t\t\t</PanelBody>\n\t\t</Panel>\n\t);\n};\n","import { __privateUseListenTo as useListenTo, commandEndEvent } from '@elementor/editor-v1-adapters';\nimport getSelectedElements from '../sync/get-selected-elements';\n\nexport default function useSelectedElements() {\n\treturn useListenTo(\n\t\t[ commandEndEvent( 'document/elements/select' ), commandEndEvent( 'document/elements/deselect' ) ],\n\t\t() => getSelectedElements()\n\t);\n}\n","import { ExtendedWindow } from './types';\nimport { Element } from '../types';\n\nexport default function getSelectedElements(): Element[] {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\tconst selectedElements = extendedWindow.elementor?.selection?.getElements?.() ?? [];\n\n\treturn selectedElements.reduce< Element[] >( ( acc, el ) => {\n\t\tconst type = el.model.get( 'widgetType' ) || el.model.get( 'elType' );\n\n\t\tif ( type ) {\n\t\t\tacc.push( {\n\t\t\t\tid: el.model.get( 'id' ),\n\t\t\t\ttype,\n\t\t\t} );\n\t\t}\n\n\t\treturn acc;\n\t}, [] );\n}\n","import { __privateUseListenTo as useListenTo, commandEndEvent } from '@elementor/editor-v1-adapters';\nimport getWidgetsCache from '../sync/get-widgets-cache';\nimport { ElementType } from '../types';\n\nexport default function useElementType( type?: string ) {\n\treturn useListenTo(\n\t\tcommandEndEvent( 'editor/documents/load' ),\n\t\t(): ElementType | null => {\n\t\t\tif ( ! type ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst widgetsCache = getWidgetsCache();\n\t\t\tconst elementType = widgetsCache?.[ type ];\n\n\t\t\tif ( ! elementType?.atomic_controls ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tkey: type,\n\t\t\t\tcontrols: elementType.atomic_controls,\n\t\t\t\ttitle: elementType.title,\n\t\t\t};\n\t\t},\n\t\t[ type ]\n\t);\n}\n","import { ExtendedWindow } from './types';\n\nexport default function getWidgetsCache() {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn extendedWindow?.elementor?.widgetsCache || null;\n}\n","import * as React from 'react';\nimport { createContext, ReactNode, useContext } from 'react';\nimport { Element } from '../types';\n\ntype ContextValue = {\n\telement: Element;\n};\n\nconst Context = createContext< ContextValue | null >( null );\n\ntype Props = {\n\telement: Element;\n\tchildren?: ReactNode;\n};\n\nexport function ElementContext( { children, element }: Props ) {\n\treturn <Context.Provider value={ { element } }>{ children }</Context.Provider>;\n}\n\nexport function useElementContext() {\n\tconst context = useContext( Context );\n\n\tif ( ! context ) {\n\t\tthrow new Error( 'useElementContext must be used within a ElementContextProvider' );\n\t}\n\n\treturn context;\n}\n","import { Stack, Tabs, Tab, TabPanel, useTabs } from '@elementor/ui';\nimport * as React from 'react';\nimport { __ } from '@wordpress/i18n';\nimport { SettingsTab } from './settings-tab';\nimport { StyleTab } from './style-tab';\n\ntype TabValue = 'settings' | 'style';\n\nexport const EditingPanelTabs = () => {\n\tconst { getTabProps, getTabPanelProps, getTabsProps } = useTabs< TabValue >( 'settings' );\n\n\treturn (\n\t\t<Stack direction=\"column\" sx={ { width: '100%' } }>\n\t\t\t<Tabs variant=\"fullWidth\" indicatorColor=\"secondary\" textColor=\"inherit\" { ...getTabsProps() }>\n\t\t\t\t<Tab label={ __( 'General', 'elementor' ) } { ...getTabProps( 'settings' ) } />\n\t\t\t\t<Tab label={ __( 'Style', 'elementor' ) } { ...getTabProps( 'style' ) } />\n\t\t\t</Tabs>\n\t\t\t<TabPanel { ...getTabPanelProps( 'settings' ) } disablePadding>\n\t\t\t\t<SettingsTab />\n\t\t\t</TabPanel>\n\t\t\t<TabPanel { ...getTabPanelProps( 'style' ) } disablePadding>\n\t\t\t\t<StyleTab />\n\t\t\t</TabPanel>\n\t\t</Stack>\n\t);\n};\n","import * as React from 'react';\nimport { Stack } from '@elementor/ui';\nimport { SettingsControl } from '../controls/settings-control';\nimport { useElementContext } from '../contexts/element-context';\nimport useElementType from '../hooks/use-element-type';\nimport type { Control } from '../types';\nimport { CollapsibleSection } from './collapsible-section';\nimport { getControlByType } from '../controls/get-control-by-type';\n\nexport const SettingsTab = () => {\n\tconst { element } = useElementContext();\n\n\tconst elementType = useElementType( element?.type );\n\n\tif ( ! elementType ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Stack>\n\t\t\t{ elementType.controls.map( ( { type, value }, index ) => {\n\t\t\t\tif ( type === 'control' ) {\n\t\t\t\t\treturn <Control key={ value.bind } control={ value } />;\n\t\t\t\t}\n\n\t\t\t\tif ( type === 'section' ) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<CollapsibleSection key={ type + '.' + index } title={ value.label }>\n\t\t\t\t\t\t\t{ value.items?.map( ( item ) => {\n\t\t\t\t\t\t\t\tif ( item.type === 'control' ) {\n\t\t\t\t\t\t\t\t\treturn <Control key={ item.value.bind } control={ item.value } />;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// TODO: Handle 2nd level sections\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</CollapsibleSection>\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t} ) }\n\t\t</Stack>\n\t);\n};\n\n// TODO: Create control wrapper by type for different layouts.\nconst Control = ( { control }: { control: Control[ 'value' ] } ) => {\n\tconst ControlComponent = getControlByType( control.type );\n\n\tif ( ! ControlComponent ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<SettingsControl bind={ control.bind }>\n\t\t\t{ control.label ? <SettingsControl.Label>{ control.label }</SettingsControl.Label> : null }\n\t\t\t<ControlComponent\n\t\t\t\t/* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n\t\t\t\t{ ...( control.props as any ) }\n\t\t\t/>\n\t\t</SettingsControl>\n\t);\n};\n","import * as React from 'react';\nimport { ControlContext } from '../controls/control-context';\nimport { Stack, styled, Typography } from '@elementor/ui';\nimport { PropKey, PropValue } from '../types';\nimport { useElementContext } from '../contexts/element-context';\nimport { useWidgetSettings } from '../hooks/use-widget-settings';\nimport { updateSettings } from '../sync/update-settings';\n\ntype Props = {\n\tbind: PropKey;\n\tchildren: React.ReactNode;\n};\n\nexport const SettingsControlProvider = ( { bind, children }: Props ) => {\n\tconst { element } = useElementContext();\n\tconst value = useWidgetSettings( { id: element.id, bind } );\n\n\tconst setValue = ( newValue: PropValue ) => {\n\t\tupdateSettings( {\n\t\t\tid: element.id,\n\t\t\tprops: {\n\t\t\t\t[ bind ]: newValue,\n\t\t\t},\n\t\t} );\n\t};\n\n\treturn <ControlContext.Provider value={ { setValue, value, bind } }>{ children }</ControlContext.Provider>;\n};\n\nconst SettingsControl = ( { children, bind }: Props ) => (\n\t<SettingsControlProvider bind={ bind }>\n\t\t<StyledStack gap={ 1 } direction=\"row\" alignItems=\"center\" justifyContent=\"space-between\" flexWrap=\"wrap\">\n\t\t\t{ children }\n\t\t</StyledStack>\n\t</SettingsControlProvider>\n);\n\nconst StyledStack = styled( Stack )`\n\t& > * {\n\t\tflex-grow: 1;\n\t}\n\n\t& > label {\n\t\tmin-width: 50%;\n\t}\n`;\n\nconst Label = ( { children }: { children: React.ReactNode } ) => {\n\treturn (\n\t\t<Typography component=\"label\" variant=\"caption\" color=\"text.secondary\">\n\t\t\t{ children }\n\t\t</Typography>\n\t);\n};\n\nSettingsControl.Label = Label;\n\nexport { SettingsControl };\n","import { createContext, useContext } from 'react';\nimport { PropKey, PropValue } from '../types';\n\nexport type ControlContext< T extends PropValue > = {\n\tbind: PropKey;\n\tsetValue: ( value: T | undefined ) => void;\n\tvalue: T | undefined;\n};\n\nexport const ControlContext = createContext< ControlContext< PropValue > | null >( null );\n\nexport function useControl< T extends PropValue >(): ControlContext< T | undefined >;\nexport function useControl< T extends PropValue >( defaultValue: T ): ControlContext< T >;\nexport function useControl< T extends PropValue >( defaultValue?: T ) {\n\tconst controlContext = useContext< ControlContext< T > >( ControlContext as never );\n\n\tif ( ! controlContext ) {\n\t\tthrow new Error( 'useControl must be used within a ControlContext' );\n\t}\n\n\treturn { ...controlContext, value: controlContext.value ?? defaultValue };\n}\n","import { commandEndEvent, __privateUseListenTo as useListenTo } from '@elementor/editor-v1-adapters';\nimport { PropValue } from '../types';\nimport getContainer from '../sync/get-container';\n\nexport const useWidgetSettings = ( { id, bind }: { id: string; bind: string } ): PropValue => {\n\treturn useListenTo(\n\t\tcommandEndEvent( 'document/elements/settings' ),\n\t\t() => {\n\t\t\tconst container = getContainer( id );\n\t\t\tconst value = container?.settings?.get( bind ) ?? null;\n\n\t\t\treturn value;\n\t\t},\n\t\t[ id, bind ]\n\t);\n};\n","import { ExtendedWindow } from './types';\n\nexport default function getContainer( id: string ) {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\tconst container = extendedWindow.elementor?.getContainer?.( id );\n\n\treturn container ?? null;\n}\n","import { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';\nimport { Props } from '../types';\nimport getContainer from './get-container';\n\nexport const updateSettings = ( { id, props }: { id: string; props: Props } ) => {\n\tconst container = getContainer( id );\n\n\trunCommand( 'document/elements/settings', {\n\t\tcontainer,\n\t\tsettings: {\n\t\t\t...props,\n\t\t},\n\t} );\n};\n","import * as React from 'react';\nimport { useId } from 'react';\nimport { Accordion, AccordionSummary, AccordionDetails, AccordionSummaryText, Stack } from '@elementor/ui';\n\nexport type CollapsibleSectionProps = React.PropsWithChildren< {\n\ttitle: React.ReactNode;\n} >;\n\nexport const CollapsibleSection = ( { title, children }: CollapsibleSectionProps ) => {\n\tconst uid = useId();\n\tconst labelId = `label-${ uid }`;\n\tconst contentId = `content-${ uid }`;\n\n\t// TODO: Change to collapsible list item\n\treturn (\n\t\t<Accordion disableGutters defaultExpanded>\n\t\t\t<AccordionSummary aria-controls={ contentId } id={ labelId }>\n\t\t\t\t<AccordionSummaryText primaryTypographyProps={ { variant: 'caption' } }>{ title }</AccordionSummaryText>\n\t\t\t</AccordionSummary>\n\t\t\t<AccordionDetails id={ contentId } aria-labelledby={ labelId }>\n\t\t\t\t<Stack gap={ 2.5 }>{ children }</Stack>\n\t\t\t</AccordionDetails>\n\t\t</Accordion>\n\t);\n};\n","import * as React from 'react';\nimport { MenuItem, Select, SelectChangeEvent } from '@elementor/ui';\nimport { useControl } from '../control-context';\nimport { PropValue } from '../../types';\n\ntype Props< T > = {\n\toptions: Array< { label: string; value: T; disabled?: boolean } >;\n};\n\nexport const SelectControl = < T extends PropValue >( { options }: Props< T > ) => {\n\tconst { value, setValue } = useControl< T >();\n\n\tconst handleChange = ( event: SelectChangeEvent< T > ) => {\n\t\tsetValue( event.target.value as T );\n\t};\n\n\treturn (\n\t\t<Select size=\"tiny\" value={ value ?? '' } onChange={ handleChange }>\n\t\t\t{ options.map( ( { label, ...props } ) => (\n\t\t\t\t<MenuItem key={ props.value } { ...props }>\n\t\t\t\t\t{ label }\n\t\t\t\t</MenuItem>\n\t\t\t) ) }\n\t\t</Select>\n\t);\n};\n","import * as React from 'react';\nimport { TextField } from '@elementor/ui';\nimport { useControl } from '../control-context';\n\ntype Props = {\n\tplaceholder?: string;\n};\n\nexport const TextAreaControl = ( { placeholder }: Props ) => {\n\tconst { value, setValue } = useControl< string >( '' );\n\n\tconst handleChange = ( event: React.ChangeEvent< HTMLInputElement > ) => {\n\t\tsetValue( event.target.value );\n\t};\n\n\treturn (\n\t\t<TextField\n\t\t\tsize=\"tiny\"\n\t\t\tmultiline\n\t\t\tfullWidth\n\t\t\trows={ 5 }\n\t\t\tvalue={ value }\n\t\t\tonChange={ handleChange }\n\t\t\tplaceholder={ placeholder }\n\t\t/>\n\t);\n};\n","import * as React from 'react';\nimport { TextField } from '@elementor/ui';\nimport { useControl } from '../control-context';\n\nexport const TextControl = ( { placeholder }: { placeholder?: string } ) => {\n\tconst { value, setValue } = useControl< string >( '' );\n\n\tconst handleChange = ( event: React.ChangeEvent< HTMLInputElement > ) => setValue( event.target.value );\n\n\treturn <TextField type=\"text\" size=\"tiny\" value={ value } onChange={ handleChange } placeholder={ placeholder } />;\n};\n","import * as React from 'react';\nimport { Button, Card, CardMedia, CardOverlay } from '@elementor/ui';\nimport { useControl } from '../control-context';\nimport { UploadIcon } from '@elementor/icons';\nimport { __ } from '@wordpress/i18n';\nimport { useWpMediaAttachment, useWpMediaFrame } from '@elementor/wp-media';\n\ntype ImageAttachment = {\n\t$$type: 'image-attachment';\n\tvalue: {\n\t\tid: number;\n\t};\n};\n\ntype ImageURL = {\n\t$$type: 'image-url';\n\tvalue: {\n\t\turl: string;\n\t};\n};\n\ntype Props = {\n\tmediaTypes: Array< 'image' >;\n};\n\nconst isImageAttachment = ( value: ImageAttachment | ImageURL | undefined ): value is ImageAttachment => {\n\treturn value?.$$type === 'image-attachment';\n};\n\nconst isImageUrl = ( value: ImageAttachment | ImageURL | undefined ): value is ImageURL => {\n\treturn value?.$$type === 'image-url';\n};\n\n// TODO: Use schema to get default image.\nconst defaultState: ImageURL = {\n\t$$type: 'image-url',\n\tvalue: {\n\t\turl: '/wp-content/plugins/elementor/assets/images/placeholder.png',\n\t},\n};\n\nexport const AttachmentControl = ( props: Props ) => {\n\tconst { value, setValue } = useControl< ImageAttachment | ImageURL >( defaultState );\n\tconst { data: attachment } = useWpMediaAttachment( isImageAttachment( value ) ? value.value.id : undefined );\n\n\tconst getImageSrc = () => {\n\t\tif ( attachment?.url ) {\n\t\t\treturn attachment.url;\n\t\t}\n\n\t\tif ( isImageUrl( value ) ) {\n\t\t\treturn value.value.url;\n\t\t}\n\n\t\treturn defaultState.value.url;\n\t};\n\n\tconst { open } = useWpMediaFrame( {\n\t\ttypes: props.mediaTypes,\n\t\tmultiple: false,\n\t\tselected: isImageAttachment( value ) ? value.value?.id : undefined,\n\t\tonSelect: ( val ) => {\n\t\t\tsetValue( {\n\t\t\t\t$$type: 'image-attachment',\n\t\t\t\tvalue: {\n\t\t\t\t\tid: val.id,\n\t\t\t\t},\n\t\t\t} );\n\t\t},\n\t} );\n\n\treturn (\n\t\t<Card variant=\"outlined\">\n\t\t\t<CardMedia image={ getImageSrc() } sx={ { height: 150 } } />\n\t\t\t<CardOverlay>\n\t\t\t\t<Button\n\t\t\t\t\tcolor=\"inherit\"\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\tvariant=\"outlined\"\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\topen( { mode: 'browse' } );\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Select Image', 'elementor' ) }\n\t\t\t\t</Button>\n\n\t\t\t\t<Button\n\t\t\t\t\tcolor=\"inherit\"\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\tvariant=\"text\"\n\t\t\t\t\tstartIcon={ <UploadIcon /> }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\topen( { mode: 'upload' } );\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Upload Image', 'elementor' ) }\n\t\t\t\t</Button>\n\t\t\t</CardOverlay>\n\t\t</Card>\n\t);\n};\n","import { SelectControl } from './control-types/select-control';\nimport { TextAreaControl } from './control-types/text-area-control';\nimport { TextControl } from './control-types/text-control';\nimport { AttachmentControl } from './control-types/attachment-control';\n\nconst controlTypes = {\n\tattachment: AttachmentControl,\n\tselect: SelectControl,\n\ttext: TextControl,\n\ttextarea: TextAreaControl,\n};\n\nexport const getControlByType = ( type: string ) => {\n\treturn controlTypes[ type as keyof typeof controlTypes ] ?? null;\n};\n","import * as React from 'react';\nimport { StyleContext } from '../contexts/style-context';\nimport { useElementContext } from '../contexts/element-context';\nimport { useElementStyles } from '../hooks/use-element-styles';\nimport { Stack } from '@elementor/ui';\nimport { SizeSection } from './style-sections/size-section';\n\nexport const StyleTab = () => {\n\tconst { element } = useElementContext();\n\tconst elementStyles = useElementStyles( element.id );\n\t// TODO: Handle selected style state.\n\tconst [ selectedStyleDef = null ] = Object.values( elementStyles || {} );\n\n\treturn (\n\t\t<StyleContext selectedStyleDef={ selectedStyleDef }>\n\t\t\t<Stack>\n\t\t\t\t<SizeSection />\n\t\t\t</Stack>\n\t\t</StyleContext>\n\t);\n};\n","import * as React from 'react';\nimport { createContext, ReactNode, useContext } from 'react';\nimport { useActiveBreakpoint } from '@elementor/editor-responsive';\nimport { StyleDefinition, StyleVariant } from '@elementor/editor-style';\n\ntype ContextValue = {\n\tselectedStyleDef: StyleDefinition | null;\n\tselectedMeta: StyleVariant[ 'meta' ];\n};\n\nconst Context = createContext< ContextValue | null >( null );\n\ntype Props = {\n\tchildren: ReactNode;\n\tselectedStyleDef: StyleDefinition | null;\n};\n\nexport function StyleContext( { children, selectedStyleDef }: Props ) {\n\tconst breakpoint = useActiveBreakpoint();\n\t// TODO: Handle state when we support it.\n\tconst selectedMeta = { breakpoint, state: null } as const;\n\n\treturn <Context.Provider value={ { selectedStyleDef, selectedMeta } }>{ children }</Context.Provider>;\n}\n\nexport function useStyleContext() {\n\tconst context = useContext( Context );\n\n\tif ( ! context ) {\n\t\tthrow new Error( 'UseStyleContext must be used within a StyleContextProvider' );\n\t}\n\n\treturn context;\n}\n","import { __privateUseListenTo as useListenTo, commandEndEvent } from '@elementor/editor-v1-adapters';\nimport { getElementStyles } from '../sync/get-element-styles';\nimport { ElementID } from '../types';\n\nexport const useElementStyles = ( elementID: ElementID ) => {\n\treturn useListenTo(\n\t\tcommandEndEvent( 'document/atomic-widgets/styles' ),\n\t\t() => {\n\t\t\treturn getElementStyles( elementID );\n\t\t},\n\t\t[ elementID ]\n\t);\n};\n","import getContainer from './get-container';\nimport { ElementID } from '../types';\nimport { StyleDefinition } from '@elementor/editor-style';\n\nexport const getElementStyles = ( elementID: ElementID ): Record< string, StyleDefinition > | null => {\n\tconst container = getContainer( elementID );\n\n\treturn container?.model.get( 'styles' ) || null;\n};\n","import * as React from 'react';\nimport { CollapsibleSection } from '../../components/collapsible-section';\nimport { StyleControl, StyleControlProps } from '../../controls/style-control';\nimport { SizeControl, Unit } from '../../controls/control-types/size-control';\nimport { Stack } from '@elementor/ui';\nimport { __ } from '@wordpress/i18n';\n\nexport const SizeSection = () => {\n\treturn (\n\t\t<CollapsibleSection title={ __( 'Size', 'elementor' ) }>\n\t\t\t<Stack gap={ 1.5 }>\n\t\t\t\t<Stack direction=\"row\" gap={ 2 }>\n\t\t\t\t\t<Control bind=\"width\" label={ __( 'Width', 'elementor' ) } />\n\t\t\t\t\t<Control bind=\"height\" label={ __( 'Height', 'elementor' ) } />\n\t\t\t\t</Stack>\n\t\t\t\t<Stack direction=\"row\" gap={ 2 }>\n\t\t\t\t\t<Control bind=\"min-width\" label={ __( 'Min. Width', 'elementor' ) } />\n\t\t\t\t\t<Control bind=\"min-height\" label={ __( 'Min. Height', 'elementor' ) } />\n\t\t\t\t</Stack>\n\t\t\t\t<Stack direction=\"row\" gap={ 2 }>\n\t\t\t\t\t<Control bind=\"max-width\" label={ __( 'Max. Width', 'elementor' ) } />\n\t\t\t\t\t<Control bind=\"max-height\" label={ __( 'Max. Height', 'elementor' ) } />\n\t\t\t\t</Stack>\n\t\t\t</Stack>\n\t\t</CollapsibleSection>\n\t);\n};\n\nconst units: Unit[] = [ 'px', '%', 'em', 'rem', 'vw' ];\n\ntype ControlProps = {\n\tbind: StyleControlProps[ 'bind' ];\n\tlabel: string;\n};\n\nconst Control = ( { label, bind }: ControlProps ) => {\n\treturn (\n\t\t<StyleControl bind={ bind }>\n\t\t\t<Stack gap={ 1 } sx={ { flex: '0 1 50%' } }>\n\t\t\t\t<StyleControl.Label>{ label }</StyleControl.Label>\n\t\t\t\t<SizeControl units={ units } />\n\t\t\t</Stack>\n\t\t</StyleControl>\n\t);\n};\n","import * as React from 'react';\nimport { PropKey, PropValue } from '../types';\nimport { ControlContext } from '../controls/control-context';\nimport { updateStyle } from '../sync/update-style';\nimport { useElementStyleProp } from '../hooks/use-element-style-prop';\nimport { useElementContext } from '../contexts/element-context';\nimport { useStyleContext } from '../contexts/style-context';\nimport { Typography } from '@elementor/ui';\n\nexport type StyleControlProps = {\n\tbind: PropKey;\n\tchildren: React.ReactNode;\n};\n\nconst StyleControl = ( { bind, children }: StyleControlProps ) => {\n\tconst { element } = useElementContext();\n\tconst { selectedStyleDef, selectedMeta } = useStyleContext();\n\n\tconst setValue = ( newValue: PropValue ) => {\n\t\tupdateStyle( {\n\t\t\telementID: element.id,\n\t\t\tstyleDefID: selectedStyleDef?.id,\n\t\t\tprops: { [ bind ]: newValue },\n\t\t\tmeta: selectedMeta,\n\t\t} );\n\t};\n\n\tconst value = useElementStyleProp( {\n\t\telementID: element.id,\n\t\tstyleDefID: selectedStyleDef?.id,\n\t\tmeta: selectedMeta,\n\t\tpropName: bind,\n\t} );\n\n\treturn <ControlContext.Provider value={ { bind, value, setValue } }>{ children }</ControlContext.Provider>;\n};\n\nconst Label = ( { children }: { children: React.ReactNode } ) => {\n\treturn (\n\t\t<Typography component=\"label\" variant=\"caption\" color=\"text.secondary\">\n\t\t\t{ children }\n\t\t</Typography>\n\t);\n};\n\nStyleControl.Label = Label;\n\nexport { StyleControl };\n","import { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';\nimport { ElementID, PropKey, Props } from '../types';\nimport getContainer from './get-container';\nimport { StyleDefinitionID, StyleVariant } from '@elementor/editor-style';\n\nexport type UpdateStyleProps = {\n\telementID: ElementID;\n\tstyleDefID?: StyleDefinitionID;\n\tmeta: StyleVariant[ 'meta' ];\n\tprops: Props;\n\tbind?: PropKey;\n};\n\nexport const updateStyle = ( { elementID, styleDefID, meta, props, bind = 'classes' }: UpdateStyleProps ) => {\n\tconst container = getContainer( elementID );\n\n\trunCommand( 'document/atomic-widgets/styles', {\n\t\tcontainer,\n\t\tstyleDefID,\n\t\tbind,\n\t\tmeta,\n\t\tprops,\n\t} );\n};\n","import { commandEndEvent, __privateUseListenTo as useListenTo } from '@elementor/editor-v1-adapters';\nimport { ElementID, PropKey, PropValue } from '../types';\nimport { getElementStyles } from '../sync/get-element-styles';\nimport { StyleDefinition, StyleDefinitionID, StyleVariant } from '@elementor/editor-style';\n\nexport type UseElementStylePropArgs = {\n\telementID: ElementID;\n\tstyleDefID?: StyleDefinitionID;\n\tmeta: StyleVariant[ 'meta' ];\n\tpropName: PropKey;\n};\n\nexport const useElementStyleProp = < T extends PropValue >( {\n\telementID,\n\tstyleDefID,\n\tmeta,\n\tpropName,\n}: UseElementStylePropArgs ): T | null => {\n\treturn useListenTo(\n\t\tcommandEndEvent( 'document/atomic-widgets/styles' ),\n\t\t() => {\n\t\t\t// TODO: return default value for style prop\n\t\t\tif ( ! styleDefID ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst styleDef = getElementStyles( elementID )?.[ styleDefID ];\n\n\t\t\tif ( ! styleDef ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst variant = getVariantByMeta( styleDef, meta );\n\n\t\t\treturn variant?.props[ propName ] ?? null;\n\t\t},\n\t\t[ elementID, styleDefID, propName, meta ]\n\t) as T;\n};\n\nfunction getVariantByMeta( styleDef: StyleDefinition, meta: StyleVariant[ 'meta' ] ) {\n\treturn styleDef.variants.find( ( variant ) => {\n\t\treturn variant.meta.breakpoint === meta.breakpoint && variant.meta.state === meta.state;\n\t} );\n}\n","import * as React from 'react';\nimport { MenuItem, Select, SelectChangeEvent, Stack, TextField } from '@elementor/ui';\nimport { TransformablePropValue } from '../../types';\nimport { useControl } from '../control-context';\nimport { useSyncExternalState } from '../hooks/use-sync-external-state';\n\nexport type SizeControlProps = {\n\tunits: Unit[];\n\tplaceholder?: string;\n};\n\nexport type Unit = 'px' | '%' | 'em' | 'rem' | 'vw';\n\nexport type SizeControlValue = TransformablePropValue< { unit: Unit; size: number } >;\n\nexport const SizeControl = ( { units, placeholder }: SizeControlProps ) => {\n\tconst { value, setValue } = useControl< SizeControlValue >();\n\n\tconst [ state, setState ] = useSyncExternalState< SizeControlValue >( {\n\t\texternal: value,\n\t\tsetExternal: setValue,\n\t\tpersistWhen: ( controlValue ) => !! controlValue?.value.size || controlValue?.value.size === 0,\n\t\tfallback: ( controlValue ) => ( {\n\t\t\t$$type: 'size',\n\t\t\tvalue: { unit: controlValue?.value.unit || 'px', size: NaN },\n\t\t} ),\n\t} );\n\n\tconst handleUnitChange = ( event: SelectChangeEvent< Unit > ) => {\n\t\tconst unit = event.target.value as Unit;\n\n\t\tsetState( ( prev ) => ( {\n\t\t\t...prev,\n\t\t\tvalue: {\n\t\t\t\t...prev.value,\n\t\t\t\tunit,\n\t\t\t},\n\t\t} ) );\n\t};\n\n\tconst handleSizeChange = ( event: React.ChangeEvent< HTMLInputElement > ) => {\n\t\tconst { value: size } = event.target;\n\n\t\tsetState( ( prev ) => ( {\n\t\t\t...prev,\n\t\t\tvalue: {\n\t\t\t\t...prev.value,\n\t\t\t\tsize: size || size === '0' ? parseFloat( size ) : NaN,\n\t\t\t},\n\t\t} ) );\n\t};\n\n\treturn (\n\t\t<Stack direction=\"row\">\n\t\t\t<TextField\n\t\t\t\tsize=\"tiny\"\n\t\t\t\ttype=\"number\"\n\t\t\t\tvalue={ Number.isNaN( state.value.size ) ? '' : state.value.size }\n\t\t\t\tonChange={ handleSizeChange }\n\t\t\t\tplaceholder={ placeholder }\n\t\t\t/>\n\t\t\t<Select\n\t\t\t\tsize=\"tiny\"\n\t\t\t\tvalue={ state.value.unit }\n\t\t\t\tonChange={ handleUnitChange }\n\t\t\t\tMenuProps={ {\n\t\t\t\t\tanchorOrigin: { vertical: 'bottom', horizontal: 'right' },\n\t\t\t\t\ttransformOrigin: { vertical: 'top', horizontal: 'right' },\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ units.map( ( unit ) => (\n\t\t\t\t\t<MenuItem key={ unit } value={ unit }>\n\t\t\t\t\t\t{ unit.toUpperCase() }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t) ) }\n\t\t\t</Select>\n\t\t</Stack>\n\t);\n};\n","import { useEffect, useState } from 'react';\n\ntype UseInternalStateOptions< TValue > = {\n\texternal: TValue | undefined;\n\tsetExternal: ( value: TValue | undefined ) => void;\n\tpersistWhen: ( value: TValue | undefined ) => boolean;\n\tfallback: ( value: TValue | undefined ) => TValue;\n};\n\nexport const useSyncExternalState = < TValue, >( {\n\texternal,\n\tsetExternal,\n\tpersistWhen,\n\tfallback,\n}: UseInternalStateOptions< TValue > ) => {\n\tfunction toExternal( internalValue: TValue | undefined ) {\n\t\tif ( persistWhen( internalValue ) ) {\n\t\t\treturn internalValue;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tfunction toInternal( externalValue: TValue | undefined, internalValue: TValue | undefined ) {\n\t\tif ( ! externalValue ) {\n\t\t\treturn fallback( internalValue );\n\t\t}\n\n\t\treturn externalValue;\n\t}\n\n\tconst [ internal, setInternal ] = useState< TValue >( toInternal( external, undefined ) );\n\n\tuseEffect( () => {\n\t\tsetInternal( toInternal( external, internal ) );\n\t}, [ external ] );\n\n\ttype SetterFunc = ( value: TValue ) => TValue;\n\n\tconst setInternalValue = ( setter: SetterFunc | TValue ) => {\n\t\tconst setterFn = ( typeof setter === 'function' ? setter : () => setter ) as SetterFunc;\n\t\tconst updated = setterFn( internal );\n\n\t\tsetInternal( updated );\n\t\tsetExternal( toExternal( updated ) );\n\t};\n\n\treturn [ internal, setInternalValue ] as const;\n};\n","import { panel } from './panel';\nimport { injectIntoLogic } from '@elementor/editor';\nimport { shouldUseV2Panel } from './sync/should-use-v2-panel';\nimport { EditingPanelHooks } from './components/editing-panel-hooks';\nimport { __registerPanel as registerPanel } from '@elementor/editor-panels';\nimport { __privateBlockDataCommand as blockDataCommand } from '@elementor/editor-v1-adapters';\n\nexport default function init() {\n\tregisterPanel( panel );\n\tblockV1Panel();\n\n\tinjectIntoLogic( {\n\t\tid: 'editing-panel-hooks',\n\t\tcomponent: EditingPanelHooks,\n\t} );\n}\n\nconst blockV1Panel = () => {\n\tblockDataCommand( {\n\t\tcommand: 'panel/editor/open',\n\t\tcondition: shouldUseV2Panel,\n\t} );\n};\n","import getSelectedElements from './get-selected-elements';\nimport getWidgetsCache from './get-widgets-cache';\n\nexport const shouldUseV2Panel = () => {\n\tconst selectedElements = getSelectedElements();\n\tconst widgetCache = getWidgetsCache();\n\n\tif ( selectedElements.length !== 1 ) {\n\t\treturn false;\n\t}\n\n\t// Check if the selected element has atomic controls, meaning it's a V2 element.\n\treturn !! widgetCache?.[ selectedElements[ 0 ].type ]?.atomic_controls;\n};\n","import { useEffect } from 'react';\nimport { commandStartEvent, __privateListenTo as listenTo } from '@elementor/editor-v1-adapters';\nimport { usePanelActions } from '../panel';\nimport { shouldUseV2Panel } from '../sync/should-use-v2-panel';\n\nexport const useOpenEditorPanel = () => {\n\tconst { open } = usePanelActions();\n\n\tuseEffect( () => {\n\t\treturn listenTo( commandStartEvent( 'panel/editor/open' ), () => {\n\t\t\tif ( shouldUseV2Panel() ) {\n\t\t\t\topen();\n\t\t\t}\n\t\t} );\n\t}, [] ); // eslint-disable-line react-hooks/exhaustive-deps\n};\n","import { useOpenEditorPanel } from '../hooks/use-open-editor-panel';\n\nexport const EditingPanelHooks = () => {\n\tuseOpenEditorPanel();\n\n\treturn null;\n};\n","import init from './init';\n\ninit();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,wBAA6C;;;ACA7C,IAAAC,UAAuB;AACvB,IAAAC,eAAmB;;;ACDnB,gCAAqE;;;ACGtD,SAAR,sBAAkD;AACxD,QAAM,iBAAiB;AAEvB,QAAM,mBAAmB,eAAe,WAAW,WAAW,cAAc,KAAK,CAAC;AAElF,SAAO,iBAAiB,OAAqB,CAAE,KAAK,OAAQ;AAC3D,UAAM,OAAO,GAAG,MAAM,IAAK,YAAa,KAAK,GAAG,MAAM,IAAK,QAAS;AAEpE,QAAK,MAAO;AACX,UAAI,KAAM;AAAA,QACT,IAAI,GAAG,MAAM,IAAK,IAAK;AAAA,QACvB;AAAA,MACD,CAAE;AAAA,IACH;AAEA,WAAO;AAAA,EACR,GAAG,CAAC,CAAE;AACP;;;ADjBe,SAAR,sBAAuC;AAC7C,aAAO,0BAAAC;AAAA,IACN,KAAE,2CAAiB,0BAA2B,OAAG,2CAAiB,4BAA6B,CAAE;AAAA,IACjG,MAAM,oBAAoB;AAAA,EAC3B;AACD;;;AERA,IAAAC,6BAAqE;;;ACEtD,SAAR,kBAAmC;AACzC,QAAM,iBAAiB;AAEvB,SAAO,gBAAgB,WAAW,gBAAgB;AACnD;;;ADFe,SAAR,eAAiC,MAAgB;AACvD,aAAO,2BAAAC;AAAA,QACN,4CAAiB,uBAAwB;AAAA,IACzC,MAA0B;AACzB,UAAK,CAAE,MAAO;AACb,eAAO;AAAA,MACR;AAEA,YAAM,eAAe,gBAAgB;AACrC,YAAM,cAAc,eAAgB,IAAK;AAEzC,UAAK,CAAE,aAAa,iBAAkB;AACrC,eAAO;AAAA,MACR;AAEA,aAAO;AAAA,QAC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,WAAW,GAAI;AACpC,WAAO;AAAA,EACR;AAGA,SAAO,CAAC,CAAE,cAAe,iBAAkB,CAAE,EAAE,IAAK,GAAG;AACxD;;;ACbA,IAAAC,gBAA0B;AAC1B,IAAAC,6BAAiE;AAI1D,IAAM,qBAAqB,MAAM;AACvC,QAAM,EAAE,KAAK,IAAI,gBAAgB;AAEjC,+BAAW,MAAM;AAChB,eAAO,2BAAAC,uBAAU,8CAAmB,mBAAoB,GAAG,MAAM;AAChE,UAAK,iBAAiB,GAAI;AACzB,aAAK;AAAA,MACN;AAAA,IACD,CAAE;AAAA,EACH,GAAG,CAAC,CAAE;AACP;;;ACbO,IAAM,oBAAoB,MAAM;AACtC,qBAAmB;AAEnB,SAAO;AACR;;;AHFA,IAAAC,wBAAiD;AACjD,IAAAC,6BAA8D;AAE/C,SAAR,OAAwB;AAC9B,4BAAAC,iBAAe,KAAM;AACrB,eAAa;AAEb,qCAAiB;AAAA,IAChB,IAAI;AAAA,IACJ,WAAW;AAAA,EACZ,CAAE;AACH;AAEA,IAAM,eAAe,MAAM;AAC1B,iCAAAC,2BAAkB;AAAA,IACjB,SAAS;AAAA,IACT,WAAW;AAAA,EACZ,CAAE;AACH;;;AIpBA,KAAK;","names":["import_editor_panels","React","import_i18n","useListenTo","import_editor_v1_adapters","useListenTo","import_ui","React","import_i18n","React","import_ui","React","import_react","import_editor_v1_adapters","useListenTo","import_editor_v1_adapters","runCommand","React","import_react","import_ui","React","import_ui","React","import_ui","React","import_ui","React","import_ui","React","React","import_react","Context","import_editor_v1_adapters","useListenTo","import_ui","React","React","import_editor_v1_adapters","runCommand","import_editor_v1_adapters","useListenTo","import_ui","Label","React","import_ui","import_react","units","import_ui","import_i18n","Control","createPanel","import_react","import_editor_v1_adapters","listenTo","import_editor_panels","import_editor_v1_adapters","registerPanel","blockDataCommand"]}
|