@raketa-builder/menu-builder 0.3.0 → 0.4.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.
@@ -4,5 +4,5 @@ CLI Using tsconfig: tsconfig.json
4
4
  CLI tsup v6.5.0
5
5
  CLI Target: es6
6
6
  CJS Build start
7
- CJS dist/index.js 61.18 KB
8
- CJS ⚡️ Build success in 70ms
7
+ CJS dist/index.js 61.29 KB
8
+ CJS ⚡️ Build success in 68ms
@@ -1,13 +1,13 @@
1
1
  $ TIMING=1 eslint "**/*.js"
2
- Rule | Time (ms) | Relative
3
- :------------------------------|----------:|--------:
4
- react/no-direct-mutation-state | 7.151 | 26.7%
5
- react/display-name | 7.135 | 26.6%
6
- react/require-render-return | 3.681 | 13.7%
7
- react-hooks/exhaustive-deps | 1.189 | 4.4%
8
- react/no-deprecated | 1.141 | 4.3%
9
- react-hooks/rules-of-hooks | 1.005 | 3.7%
10
- react/no-string-refs | 0.856 | 3.2%
11
- react/no-unescaped-entities | 0.658 | 2.5%
12
- react/no-danger-with-children | 0.460 | 1.7%
13
- react/jsx-no-comment-textnodes | 0.352 | 1.3%
2
+ Rule | Time (ms) | Relative
3
+ :---------------------------------|----------:|--------:
4
+ react/display-name | 28.043 | 25.4%
5
+ react/no-direct-mutation-state | 27.800 | 25.2%
6
+ react/require-render-return | 20.287 | 18.4%
7
+ react/no-deprecated | 4.712 | 4.3%
8
+ react-hooks/exhaustive-deps | 4.033 | 3.7%
9
+ react-hooks/rules-of-hooks | 3.917 | 3.5%
10
+ react/no-string-refs | 3.201 | 2.9%
11
+ react/no-unescaped-entities | 2.490 | 2.3%
12
+ react/jsx-no-comment-textnodes | 1.645 | 1.5%
13
+ jsx-a11y/role-supports-aria-props | 1.306 | 1.2%
package/dist/index.js CHANGED
@@ -1705,7 +1705,12 @@ var MenuBuilder = ({ widgets, value, onChange }) => {
1705
1705
  items: state.items,
1706
1706
  tab: currentTab,
1707
1707
  onTab: (tab) => setState(__spreadProps(__spreadValues({}, state), { tab })),
1708
- onChange: (items) => setState(__spreadProps(__spreadValues({}, state), { items }))
1708
+ onChange: (items) => {
1709
+ const newState = __spreadProps(__spreadValues({}, state), { items });
1710
+ setState(newState);
1711
+ if (onChange)
1712
+ onChange(newState);
1713
+ }
1709
1714
  }
1710
1715
  ),
1711
1716
  currentItem && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raketa-builder/menu-builder",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "license": "MIT",
@@ -56,7 +56,12 @@ const MenuBuilder = ({ widgets, value, onChange }) => {
56
56
  items={state.items}
57
57
  tab={currentTab}
58
58
  onTab={(tab) => setState({ ...state, tab })}
59
- onChange={(items) => setState({ ...state, items })}
59
+ onChange={(items) => {
60
+ const newState = { ...state, items };
61
+
62
+ setState(newState);
63
+ if (onChange) onChange(newState);
64
+ }}
60
65
  />
61
66
 
62
67
  {currentItem && (