@berenjena/react-dev-panel 2.2.0 → 2.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.
Files changed (41) hide show
  1. package/README.md +97 -239
  2. package/dist/assets/index11.css +1 -1
  3. package/dist/assets/index12.css +1 -1
  4. package/dist/assets/index13.css +1 -1
  5. package/dist/assets/index14.css +1 -1
  6. package/dist/assets/index15.css +1 -1
  7. package/dist/assets/index16.css +1 -0
  8. package/dist/assets/index5.css +1 -1
  9. package/dist/assets/index7.css +1 -1
  10. package/dist/components/ControlRenderer/controls/BooleanControl/index.js +1 -1
  11. package/dist/components/ControlRenderer/controls/ButtonControl/index.js +1 -1
  12. package/dist/components/ControlRenderer/controls/ButtonGroupControl/index.js +1 -1
  13. package/dist/components/ControlRenderer/controls/ColorControl/index.js +1 -1
  14. package/dist/components/ControlRenderer/controls/DragAndDropControl/index.js +1 -1
  15. package/dist/components/ControlRenderer/controls/LocalStorageControl/index.d.ts +23 -0
  16. package/dist/components/ControlRenderer/controls/LocalStorageControl/index.js +252 -0
  17. package/dist/components/ControlRenderer/controls/LocalStorageControl/types.d.ts +14 -0
  18. package/dist/components/ControlRenderer/controls/SelectControl/index.js +15 -5
  19. package/dist/components/ControlRenderer/controls/SelectControl/types.d.ts +2 -0
  20. package/dist/components/ControlRenderer/controls/index.d.ts +1 -0
  21. package/dist/components/ControlRenderer/controls/index.js +2 -1
  22. package/dist/components/ControlRenderer/controls/types.d.ts +3 -0
  23. package/dist/components/ControlRenderer/index.js +23 -23
  24. package/dist/components/Select/index.d.ts +3 -1
  25. package/dist/components/Select/index.js +132 -97
  26. package/dist/hooks/useDevPanel/index.js +45 -17
  27. package/dist/store/ControlPersistenceService.d.ts +33 -0
  28. package/dist/store/ControlPersistenceService.js +61 -0
  29. package/dist/utils/copyToClipboard/copyToClipboard.d.ts +17 -0
  30. package/dist/utils/copyToClipboard/copyToClipboard.js +10 -0
  31. package/dist/utils/copyToClipboard/index.d.ts +1 -0
  32. package/dist/utils/copyToClipboard/index.js +4 -0
  33. package/dist/utils/getStringPreview/getStringPreview.d.ts +14 -0
  34. package/dist/utils/getStringPreview/getStringPreview.js +6 -0
  35. package/dist/utils/getStringPreview/index.d.ts +1 -0
  36. package/dist/utils/getStringPreview/index.js +4 -0
  37. package/dist/utils/prettifyJson/index.d.ts +1 -0
  38. package/dist/utils/prettifyJson/index.js +4 -0
  39. package/dist/utils/prettifyJson/prettifyJson.d.ts +13 -0
  40. package/dist/utils/prettifyJson/prettifyJson.js +11 -0
  41. package/package.json +9 -3
@@ -0,0 +1,4 @@
1
+ import { prettifyJson as t } from "./prettifyJson.js";
2
+ export {
3
+ t as prettifyJson
4
+ };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Prettifies a JSON string by formatting it with indentation or returning it as-is if not valid JSON
3
+ *
4
+ * @param value - The JSON string to prettify
5
+ * @returns Prettified JSON string or original value if parsing fails
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * prettifyJson('{"name":"John"}') // Returns '{\n "name": "John"\n}'
10
+ * prettifyJson('invalid') // Returns 'invalid'
11
+ * ```
12
+ */
13
+ export declare function prettifyJson(value: string): string;
@@ -0,0 +1,11 @@
1
+ function n(r) {
2
+ try {
3
+ const t = JSON.parse(r);
4
+ return JSON.stringify(t, null, 2);
5
+ } catch {
6
+ return r;
7
+ }
8
+ }
9
+ export {
10
+ n as prettifyJson
11
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "private": false,
3
- "version": "2.2.0",
3
+ "version": "2.4.0",
4
4
  "license": "MIT",
5
5
  "name": "@berenjena/react-dev-panel",
6
6
  "description": "A React development panel with various tools and utilities.",
@@ -65,9 +65,12 @@
65
65
  "test": "vitest",
66
66
  "test:ui": "vitest --ui",
67
67
  "coverage": "vitest run --coverage",
68
- "prepublishOnly": "vitest run && npm run build",
68
+ "size": "size-limit",
69
+ "size:analyze": "npm run build && size-limit --json > .size-limit-output.json && node scripts/analyze-bundle.js",
70
+ "size:watch": "bundlewatch",
71
+ "prepublishOnly": "vitest run && npm run build && npm run size",
69
72
  "changeset": "changeset",
70
- "prerelease": "vitest run && npm run build",
73
+ "prerelease": "vitest run && npm run build && npm run size",
71
74
  "release": "changeset publish",
72
75
  "prepare": "npx husky",
73
76
  "commit": "git-cz"
@@ -86,6 +89,7 @@
86
89
  "@commitlint/cz-commitlint": "^19.8.1",
87
90
  "@eslint/js": "^9.32.0",
88
91
  "@rollup/plugin-terser": "^0.4.4",
92
+ "@size-limit/preset-small-lib": "^12.0.0",
89
93
  "@storybook/addon-docs": "^9.1.0",
90
94
  "@storybook/react-vite": "^9.1.0",
91
95
  "@types/node": "^24.1.0",
@@ -94,6 +98,7 @@
94
98
  "@vitejs/plugin-react-swc": "^3.11.0",
95
99
  "@vitest/coverage-v8": "^3.2.4",
96
100
  "@vitest/ui": "^3.2.4",
101
+ "bundlewatch": "^0.4.1",
97
102
  "commitizen": "^4.3.1",
98
103
  "eslint": "^9.32.0",
99
104
  "eslint-plugin-react": "^7.37.5",
@@ -109,6 +114,7 @@
109
114
  "react": "^19.1.1",
110
115
  "react-dom": "^19.1.1",
111
116
  "sass-embedded": "^1.89.2",
117
+ "size-limit": "^12.0.0",
112
118
  "storybook": "^9.1.0",
113
119
  "stylelint": "^16.23.0",
114
120
  "typescript": "^5.9.2",