@elementor/editor-controls 0.19.0 → 0.20.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 +23 -0
- package/dist/index.js +12 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -40
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
- package/src/components/text-field-inner-selection.tsx +4 -3
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx +4 -3
- package/src/controls/equal-unequal-sizes-control.tsx +1 -0
- package/src/controls/font-family-control/font-family-control.tsx +4 -3
- package/src/controls/link-control.tsx +2 -2
- package/src/controls/select-control.tsx +4 -3
- package/src/hooks/use-sync-external-state.tsx +1 -0
- package/src/utils/link-restriction.ts +0 -47
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @elementor/editor-controls
|
|
2
2
|
|
|
3
|
+
## 0.20.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 2ea9555: Enhanced link restriction functionality and moved to editor-elements package
|
|
8
|
+
- 50938e4: Change controls menus text style
|
|
9
|
+
- 64ec032: Change the style from 'ListSubHeader' to 'MenuSubHeader'
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [2ea9555]
|
|
14
|
+
- Updated dependencies [50938e4]
|
|
15
|
+
- @elementor/editor-elements@0.7.0
|
|
16
|
+
- @elementor/editor-ui@0.5.0
|
|
17
|
+
|
|
18
|
+
## 0.19.1
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- 3e108d9: update elementor/ui
|
|
23
|
+
- Updated dependencies [593f222]
|
|
24
|
+
- @elementor/editor-elements@0.6.6
|
|
25
|
+
|
|
3
26
|
## 0.19.0
|
|
4
27
|
|
|
5
28
|
### Minor Changes
|
package/dist/index.js
CHANGED
|
@@ -350,7 +350,7 @@ function ControlActions({ children }) {
|
|
|
350
350
|
if (items.length === 0) {
|
|
351
351
|
return children;
|
|
352
352
|
}
|
|
353
|
-
const menuItems = items.map(({ MenuItem
|
|
353
|
+
const menuItems = items.map(({ MenuItem, id }) => /* @__PURE__ */ React7.createElement(MenuItem, { key: id }));
|
|
354
354
|
return /* @__PURE__ */ React7.createElement(FloatingBarContainer, null, /* @__PURE__ */ React7.createElement(import_ui3.UnstableFloatingActionBar, { actions: menuItems }, children));
|
|
355
355
|
}
|
|
356
356
|
|
|
@@ -399,6 +399,7 @@ var ImageMediaControl = createControl(({ mediaTypes = ["image"] }) => {
|
|
|
399
399
|
// src/controls/select-control.tsx
|
|
400
400
|
var React9 = __toESM(require("react"));
|
|
401
401
|
var import_editor_props2 = require("@elementor/editor-props");
|
|
402
|
+
var import_editor_ui = require("@elementor/editor-ui");
|
|
402
403
|
var import_ui5 = require("@elementor/ui");
|
|
403
404
|
var SelectControl = createControl(({ options, onChange }) => {
|
|
404
405
|
const { value, setValue } = useBoundProp(import_editor_props2.stringPropTypeUtil);
|
|
@@ -417,7 +418,7 @@ var SelectControl = createControl(({ options, onChange }) => {
|
|
|
417
418
|
onChange: handleChange,
|
|
418
419
|
fullWidth: true
|
|
419
420
|
},
|
|
420
|
-
options.map(({ label, ...props }) => /* @__PURE__ */ React9.createElement(
|
|
421
|
+
options.map(({ label, ...props }) => /* @__PURE__ */ React9.createElement(import_editor_ui.MenuListItem, { key: props.value, ...props, value: props.value ?? "" }, label))
|
|
421
422
|
));
|
|
422
423
|
});
|
|
423
424
|
|
|
@@ -481,6 +482,7 @@ var import_ui10 = require("@elementor/ui");
|
|
|
481
482
|
// src/components/text-field-inner-selection.tsx
|
|
482
483
|
var React13 = __toESM(require("react"));
|
|
483
484
|
var import_react5 = require("react");
|
|
485
|
+
var import_editor_ui2 = require("@elementor/editor-ui");
|
|
484
486
|
var import_ui9 = require("@elementor/ui");
|
|
485
487
|
var TextFieldInnerSelection = (0, import_react5.forwardRef)(
|
|
486
488
|
({ placeholder, type, value, onChange, endAdornment, startAdornment }, ref) => {
|
|
@@ -524,7 +526,7 @@ var SelectionEndAdornment = ({
|
|
|
524
526
|
...(0, import_ui9.bindTrigger)(popupState)
|
|
525
527
|
},
|
|
526
528
|
value.toUpperCase()
|
|
527
|
-
), /* @__PURE__ */ React13.createElement(import_ui9.Menu, { MenuListProps: { dense: true }, ...(0, import_ui9.bindMenu)(popupState) }, options.map((option, index) => /* @__PURE__ */ React13.createElement(
|
|
529
|
+
), /* @__PURE__ */ React13.createElement(import_ui9.Menu, { MenuListProps: { dense: true }, ...(0, import_ui9.bindMenu)(popupState) }, options.map((option, index) => /* @__PURE__ */ React13.createElement(import_editor_ui2.MenuListItem, { key: option, onClick: () => handleMenuItemClick(index) }, option.toUpperCase()))));
|
|
528
530
|
};
|
|
529
531
|
|
|
530
532
|
// src/hooks/use-sync-external-state.tsx
|
|
@@ -1264,6 +1266,7 @@ function EqualUnequalSizesControl({
|
|
|
1264
1266
|
},
|
|
1265
1267
|
...(0, import_ui21.bindPopover)(popupState),
|
|
1266
1268
|
slotProps: {
|
|
1269
|
+
// eslint-disable-next-line react-compiler/react-compiler
|
|
1267
1270
|
paper: { sx: { mt: 0.5, width: controlRef.current?.getBoundingClientRect().width } }
|
|
1268
1271
|
}
|
|
1269
1272
|
},
|
|
@@ -1506,6 +1509,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1506
1509
|
() => {
|
|
1507
1510
|
virtualizer.scrollToIndex(fontListItems.findIndex((item) => item.value === fontFamily));
|
|
1508
1511
|
},
|
|
1512
|
+
// eslint-disable-next-line react-compiler/react-compiler
|
|
1509
1513
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1510
1514
|
[fontFamily]
|
|
1511
1515
|
);
|
|
@@ -1536,7 +1540,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1536
1540
|
const tabIndexFallback = !selectedItem ? 0 : -1;
|
|
1537
1541
|
if (item.type === "category") {
|
|
1538
1542
|
return /* @__PURE__ */ React28.createElement(
|
|
1539
|
-
import_ui23.
|
|
1543
|
+
import_ui23.MenuSubheader,
|
|
1540
1544
|
{
|
|
1541
1545
|
key: virtualRow.key,
|
|
1542
1546
|
style: {
|
|
@@ -1634,6 +1638,7 @@ var UrlControl = createControl(({ placeholder }) => {
|
|
|
1634
1638
|
// src/controls/link-control.tsx
|
|
1635
1639
|
var React31 = __toESM(require("react"));
|
|
1636
1640
|
var import_react11 = require("react");
|
|
1641
|
+
var import_editor_elements = require("@elementor/editor-elements");
|
|
1637
1642
|
var import_editor_props16 = require("@elementor/editor-props");
|
|
1638
1643
|
var import_http2 = require("@elementor/http");
|
|
1639
1644
|
var import_icons7 = require("@elementor/icons");
|
|
@@ -1748,36 +1753,6 @@ function _factoryFilter(newValue, options, minInputLength) {
|
|
|
1748
1753
|
);
|
|
1749
1754
|
}
|
|
1750
1755
|
|
|
1751
|
-
// src/utils/link-restriction.ts
|
|
1752
|
-
var import_editor_elements = require("@elementor/editor-elements");
|
|
1753
|
-
function getLinkRestriction(elementId) {
|
|
1754
|
-
if (getAncestorAnchor(elementId)) {
|
|
1755
|
-
return {
|
|
1756
|
-
shouldRestrict: true,
|
|
1757
|
-
restrictReason: "ancestor"
|
|
1758
|
-
};
|
|
1759
|
-
}
|
|
1760
|
-
if (getDescendantAnchor(elementId)) {
|
|
1761
|
-
return {
|
|
1762
|
-
shouldRestrict: true,
|
|
1763
|
-
restrictReason: "descendant"
|
|
1764
|
-
};
|
|
1765
|
-
}
|
|
1766
|
-
return { shouldRestrict: false };
|
|
1767
|
-
}
|
|
1768
|
-
function getAncestorAnchor(elementId) {
|
|
1769
|
-
const element = getElementView(elementId);
|
|
1770
|
-
return element?.closest("a") || null;
|
|
1771
|
-
}
|
|
1772
|
-
function getDescendantAnchor(elementId) {
|
|
1773
|
-
const element = getElementView(elementId);
|
|
1774
|
-
return element?.querySelector("a") || null;
|
|
1775
|
-
}
|
|
1776
|
-
function getElementView(id) {
|
|
1777
|
-
const elementContainer = (0, import_editor_elements.getContainer)(id);
|
|
1778
|
-
return elementContainer?.view?.el || null;
|
|
1779
|
-
}
|
|
1780
|
-
|
|
1781
1756
|
// src/controls/link-control.tsx
|
|
1782
1757
|
var SIZE3 = "tiny";
|
|
1783
1758
|
var LinkControl = createControl((props) => {
|
|
@@ -1795,7 +1770,7 @@ var LinkControl = createControl((props) => {
|
|
|
1795
1770
|
generateFirstLoadedOption(value)
|
|
1796
1771
|
);
|
|
1797
1772
|
const onEnabledChange = () => {
|
|
1798
|
-
const
|
|
1773
|
+
const shouldRestrict = (0, import_editor_elements.getAncestorWithAnchorTag)(elementId) || (0, import_editor_elements.getDescendantWithAnchorTag)(elementId);
|
|
1799
1774
|
if (shouldRestrict && !isEnabled) {
|
|
1800
1775
|
return;
|
|
1801
1776
|
}
|
|
@@ -2235,6 +2210,7 @@ var BackgroundImageOverlayAttachment = () => {
|
|
|
2235
2210
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
2236
2211
|
var React37 = __toESM(require("react"));
|
|
2237
2212
|
var import_editor_props20 = require("@elementor/editor-props");
|
|
2213
|
+
var import_editor_ui3 = require("@elementor/editor-ui");
|
|
2238
2214
|
var import_icons11 = require("@elementor/icons");
|
|
2239
2215
|
var import_ui32 = require("@elementor/ui");
|
|
2240
2216
|
var import_i18n14 = require("@wordpress/i18n");
|
|
@@ -2270,7 +2246,7 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
2270
2246
|
onChange: handlePositionChange,
|
|
2271
2247
|
fullWidth: true
|
|
2272
2248
|
},
|
|
2273
|
-
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React37.createElement(
|
|
2249
|
+
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React37.createElement(import_editor_ui3.MenuListItem, { key: value, value: value ?? "" }, label))
|
|
2274
2250
|
)))), isCustom ? /* @__PURE__ */ React37.createElement(PropProvider, { ...backgroundImageOffsetContext }, /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(import_ui32.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React37.createElement(SizeControl, { startIcon: /* @__PURE__ */ React37.createElement(import_icons11.LetterXIcon, { fontSize: "tiny" }) }))), /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React37.createElement(SizeControl, { startIcon: /* @__PURE__ */ React37.createElement(import_icons11.LetterYIcon, { fontSize: "tiny" }) })))))) : null);
|
|
2275
2251
|
};
|
|
2276
2252
|
|