@raketa-builder/menu-builder 1.1.7 → 1.2.1
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 +15 -19
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -47,17 +47,21 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
47
47
|
return to;
|
|
48
48
|
};
|
|
49
49
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
50
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
51
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
52
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
53
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
50
54
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
51
55
|
mod
|
|
52
56
|
));
|
|
53
57
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
54
58
|
|
|
55
59
|
// src/index.js
|
|
56
|
-
var
|
|
57
|
-
__export(
|
|
60
|
+
var index_exports = {};
|
|
61
|
+
__export(index_exports, {
|
|
58
62
|
MenuBuilder: () => MenuBuilder_default
|
|
59
63
|
});
|
|
60
|
-
module.exports = __toCommonJS(
|
|
64
|
+
module.exports = __toCommonJS(index_exports);
|
|
61
65
|
|
|
62
66
|
// src/MenuBuilder/index.js
|
|
63
67
|
var import_react9 = __toESM(require("react"));
|
|
@@ -468,8 +472,7 @@ var ContentBuilder = ({ value, onChange }) => {
|
|
|
468
472
|
onChange(newState);
|
|
469
473
|
};
|
|
470
474
|
const removeWidget = (items, item) => {
|
|
471
|
-
if (!confirm("Are you sure?"))
|
|
472
|
-
return;
|
|
475
|
+
if (!confirm("Are you sure?")) return;
|
|
473
476
|
const newState = __spreadProps(__spreadValues({}, state), {
|
|
474
477
|
widgets: remove(items, item)
|
|
475
478
|
});
|
|
@@ -597,8 +600,7 @@ var ColumnBuilder = ({ value, onChange }) => {
|
|
|
597
600
|
setState(newState);
|
|
598
601
|
};
|
|
599
602
|
const removeColumn = (items, item) => {
|
|
600
|
-
if (!confirm("Are you sure?"))
|
|
601
|
-
return;
|
|
603
|
+
if (!confirm("Are you sure?")) return;
|
|
602
604
|
const newState = __spreadProps(__spreadValues({}, state), {
|
|
603
605
|
columns: remove(items, item)
|
|
604
606
|
});
|
|
@@ -690,8 +692,7 @@ var RowBuilder = ({ value, onChange }) => {
|
|
|
690
692
|
onChange(newState);
|
|
691
693
|
};
|
|
692
694
|
const removeRow = (items, item) => {
|
|
693
|
-
if (!confirm("Are you sure?"))
|
|
694
|
-
return;
|
|
695
|
+
if (!confirm("Are you sure?")) return;
|
|
695
696
|
const newState = __spreadProps(__spreadValues({}, state), {
|
|
696
697
|
rows: remove(items, item)
|
|
697
698
|
});
|
|
@@ -757,23 +758,20 @@ var MenuBuilder = ({ widgets, value, onChange }) => {
|
|
|
757
758
|
const currentTab = state.tab;
|
|
758
759
|
const currentItem = state.items ? state.items[currentTab] : null;
|
|
759
760
|
const removeItem = (items, item) => {
|
|
760
|
-
if (!confirm("Are you sure?"))
|
|
761
|
-
return;
|
|
761
|
+
if (!confirm("Are you sure?")) return;
|
|
762
762
|
const newState = __spreadProps(__spreadValues({}, state), {
|
|
763
763
|
tab: 0,
|
|
764
764
|
items: remove(items, item)
|
|
765
765
|
});
|
|
766
766
|
setState(newState);
|
|
767
|
-
if (onChange)
|
|
768
|
-
onChange(newState);
|
|
767
|
+
if (onChange) onChange(newState);
|
|
769
768
|
};
|
|
770
769
|
const updateItem = (items, item) => {
|
|
771
770
|
const newState = __spreadProps(__spreadValues({}, state), {
|
|
772
771
|
items: update(items, item)
|
|
773
772
|
});
|
|
774
773
|
setState(newState);
|
|
775
|
-
if (onChange)
|
|
776
|
-
onChange(newState);
|
|
774
|
+
if (onChange) onChange(newState);
|
|
777
775
|
};
|
|
778
776
|
const duplicateItem = (items, item) => {
|
|
779
777
|
const newState = __spreadProps(__spreadValues({}, state), {
|
|
@@ -783,8 +781,7 @@ var MenuBuilder = ({ widgets, value, onChange }) => {
|
|
|
783
781
|
}))
|
|
784
782
|
});
|
|
785
783
|
setState(newState);
|
|
786
|
-
if (onChange)
|
|
787
|
-
onChange(newState);
|
|
784
|
+
if (onChange) onChange(newState);
|
|
788
785
|
};
|
|
789
786
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(WidgetContext_default.Provider, { value: widgets, children: [
|
|
790
787
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
@@ -796,8 +793,7 @@ var MenuBuilder = ({ widgets, value, onChange }) => {
|
|
|
796
793
|
onChange: (items) => {
|
|
797
794
|
const newState = __spreadProps(__spreadValues({}, state), { items });
|
|
798
795
|
setState(newState);
|
|
799
|
-
if (onChange)
|
|
800
|
-
onChange(newState);
|
|
796
|
+
if (onChange) onChange(newState);
|
|
801
797
|
}
|
|
802
798
|
}
|
|
803
799
|
),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raketa-builder/menu-builder",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,22 +11,22 @@
|
|
|
11
11
|
"lint": "biome lint --max-diagnostics=5000 ."
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"react": "
|
|
15
|
-
"react-dom": "
|
|
14
|
+
"react": "19.0.0",
|
|
15
|
+
"react-dom": "19.0.0"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"react-sortablejs": "
|
|
18
|
+
"react-sortablejs": "6.1.4",
|
|
19
19
|
"@raketa-builder/ui": "1.1.7",
|
|
20
20
|
"@raketa-builder/builder": "1.1.7"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@biomejs/biome": "1.5.2",
|
|
24
|
-
"@types/react": "
|
|
25
|
-
"@types/react-dom": "
|
|
26
|
-
"prettier": "3.
|
|
27
|
-
"react": "
|
|
24
|
+
"@types/react": "19.0.12",
|
|
25
|
+
"@types/react-dom": "19.0.4",
|
|
26
|
+
"prettier": "3.5.3",
|
|
27
|
+
"react": "19.0.0",
|
|
28
28
|
"tsconfig": "*",
|
|
29
|
-
"tsup": "
|
|
29
|
+
"tsup": "8.4.0",
|
|
30
30
|
"typescript": "4.5.2"
|
|
31
31
|
}
|
|
32
32
|
}
|