@elementor/editor-global-classes 3.32.0-71 → 3.32.0-73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +32 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/class-manager/class-item.tsx +11 -6
- package/src/components/class-manager/global-classes-list.tsx +24 -25
- package/src/components/class-manager/sortable.tsx +1 -1
package/dist/index.js
CHANGED
|
@@ -1208,7 +1208,7 @@ var React12 = __toESM(require("react"));
|
|
|
1208
1208
|
var import_icons8 = require("@elementor/icons");
|
|
1209
1209
|
var import_ui10 = require("@elementor/ui");
|
|
1210
1210
|
var SortableProvider = (props) => /* @__PURE__ */ React12.createElement(import_ui10.UnstableSortableProvider, { restrictAxis: true, variant: "static", dragPlaceholderStyle: { opacity: "1" }, ...props });
|
|
1211
|
-
var SortableTrigger = (props) => /* @__PURE__ */ React12.createElement(StyledSortableTrigger, { ...props, role: "button", className: "class-item-sortable-trigger" }, /* @__PURE__ */ React12.createElement(import_icons8.GripVerticalIcon, { fontSize: "tiny" }));
|
|
1211
|
+
var SortableTrigger = (props) => /* @__PURE__ */ React12.createElement(StyledSortableTrigger, { ...props, role: "button", className: "class-item-sortable-trigger", "aria-label": "sort" }, /* @__PURE__ */ React12.createElement(import_icons8.GripVerticalIcon, { fontSize: "tiny" }));
|
|
1212
1212
|
var SortableItem = ({ children, id: id2, ...props }) => {
|
|
1213
1213
|
return /* @__PURE__ */ React12.createElement(
|
|
1214
1214
|
import_ui10.UnstableSortableItem,
|
|
@@ -1265,11 +1265,16 @@ var SortableItemIndicator = (0, import_ui10.styled)(import_ui10.Box)`
|
|
|
1265
1265
|
`;
|
|
1266
1266
|
|
|
1267
1267
|
// src/components/class-manager/class-item.tsx
|
|
1268
|
-
var ClassItem = ({
|
|
1268
|
+
var ClassItem = ({
|
|
1269
|
+
id: id2,
|
|
1270
|
+
label,
|
|
1271
|
+
renameClass,
|
|
1272
|
+
selected,
|
|
1273
|
+
disabled,
|
|
1274
|
+
sortableTriggerProps,
|
|
1275
|
+
showSortIndicator
|
|
1276
|
+
}) => {
|
|
1269
1277
|
const itemRef = (0, import_react6.useRef)(null);
|
|
1270
|
-
const {
|
|
1271
|
-
search: { inputValue }
|
|
1272
|
-
} = useSearchAndFilters();
|
|
1273
1278
|
const {
|
|
1274
1279
|
ref: editableRef,
|
|
1275
1280
|
openEditMode,
|
|
@@ -1303,7 +1308,7 @@ var ClassItem = ({ id: id2, label, renameClass, selected, disabled, sortableTrig
|
|
|
1303
1308
|
ref: itemRef,
|
|
1304
1309
|
dense: true,
|
|
1305
1310
|
disableGutters: true,
|
|
1306
|
-
showSortIndicator
|
|
1311
|
+
showSortIndicator,
|
|
1307
1312
|
showActions: isSelected || isEditing,
|
|
1308
1313
|
shape: "rounded",
|
|
1309
1314
|
onDoubleClick: openEditMode,
|
|
@@ -1569,28 +1574,27 @@ var GlobalClassesList = ({ disabled }) => {
|
|
|
1569
1574
|
if (notFoundType) {
|
|
1570
1575
|
return /* @__PURE__ */ React15.createElement(NotFound, { notFoundType });
|
|
1571
1576
|
}
|
|
1572
|
-
return /* @__PURE__ */ React15.createElement(DeleteConfirmationProvider, null, /* @__PURE__ */ React15.createElement(import_ui13.List, { sx: { display: "flex", flexDirection: "column", gap: 0.5 } }, /* @__PURE__ */ React15.createElement(SortableProvider, { value: classesOrder, onChange: reorderClasses }, filteredCssClasses?.map(({ id: id2, label }) => {
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
}))));
|
|
1577
|
+
return /* @__PURE__ */ React15.createElement(DeleteConfirmationProvider, null, /* @__PURE__ */ React15.createElement(import_ui13.List, { sx: { display: "flex", flexDirection: "column", gap: 0.5 } }, /* @__PURE__ */ React15.createElement(SortableProvider, { value: classesOrder, onChange: reorderClasses }, filteredCssClasses?.map(({ id: id2, label }) => /* @__PURE__ */ React15.createElement(SortableItem, { key: id2, id: id2 }, ({ isDragged, isDragPlaceholder, triggerProps, triggerStyle }) => /* @__PURE__ */ React15.createElement(
|
|
1578
|
+
ClassItem,
|
|
1579
|
+
{
|
|
1580
|
+
id: id2,
|
|
1581
|
+
label,
|
|
1582
|
+
renameClass: (newLabel) => {
|
|
1583
|
+
dispatch5(
|
|
1584
|
+
slice.actions.update({
|
|
1585
|
+
style: {
|
|
1586
|
+
id: id2,
|
|
1587
|
+
label: newLabel
|
|
1588
|
+
}
|
|
1589
|
+
})
|
|
1590
|
+
);
|
|
1591
|
+
},
|
|
1592
|
+
selected: isDragged,
|
|
1593
|
+
disabled: disabled || isDragPlaceholder,
|
|
1594
|
+
sortableTriggerProps: { ...triggerProps, style: triggerStyle },
|
|
1595
|
+
showSortIndicator: filteredCssClasses.length > 1
|
|
1596
|
+
}
|
|
1597
|
+
))))));
|
|
1594
1598
|
};
|
|
1595
1599
|
var EmptyState = () => /* @__PURE__ */ React15.createElement(import_ui13.Stack, { alignItems: "center", gap: 1.5, pt: 10, px: 0.5, maxWidth: "260px", margin: "auto" }, /* @__PURE__ */ React15.createElement(FlippedColorSwatchIcon, { fontSize: "large" }), /* @__PURE__ */ React15.createElement(StyledHeader, { variant: "subtitle2", component: "h2", color: "text.secondary" }, (0, import_i18n12.__)("There are no global classes yet.", "elementor")), /* @__PURE__ */ React15.createElement(import_ui13.Typography, { align: "center", variant: "caption", color: "text.secondary" }, (0, import_i18n12.__)(
|
|
1596
1600
|
"CSS classes created in the editor panel will appear here. Once they are available, you can arrange their hierarchy, rename them, or delete them as needed.",
|