@djangocfg/widget-data 0.1.9 → 0.1.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/widget-data",
3
- "version": "0.1.9",
3
+ "version": "0.1.13",
4
4
  "description": "Data surfaces: file tree, JSON viewer, data grid and table, kanban, listbox, masonry and timeline",
5
5
  "keywords": [
6
6
  "tree",
@@ -90,21 +90,23 @@
90
90
  "test:watch": "vitest"
91
91
  },
92
92
  "dependencies": {
93
- "@djangocfg/widget-kit": "^0.1.9",
93
+ "@djangocfg/widget-kit": "^0.1.14",
94
94
  "@dnd-kit/core": "^6.3.1",
95
95
  "@radix-ui/react-direction": "^1.1.2",
96
96
  "@radix-ui/react-slot": "^1.3.0",
97
97
  "class-variance-authority": "^0.7.1"
98
98
  },
99
99
  "peerDependencies": {
100
- "@djangocfg/ui-core": "^2.1.550",
100
+ "@djangocfg/api": "^2.1.584",
101
+ "@djangocfg/ui-core": "^2.1.584",
101
102
  "lucide-react": "^0.545.0",
102
103
  "react": "^19.0.0",
103
104
  "react-dom": "^19.0.0"
104
105
  },
105
106
  "devDependencies": {
106
- "@djangocfg/typescript-config": "^2.1.550",
107
- "@djangocfg/ui-core": "^2.1.550",
107
+ "@djangocfg/api": "^2.1.584",
108
+ "@djangocfg/typescript-config": "^2.1.584",
109
+ "@djangocfg/ui-core": "^2.1.584",
108
110
  "@storybook/react-vite": "^10.5.0",
109
111
  "@types/node": "^25.9.5",
110
112
  "@types/react": "19.2.15",
@@ -1,8 +1,9 @@
1
1
  'use client';
2
2
 
3
+ import { CFG_FAMILIES, cfgStorage } from '@djangocfg/api/storage';
4
+
3
5
  import type { TreeItemId } from '../types';
4
6
 
5
- const KEY_PREFIX = '@djangocfg/tree:';
6
7
  const VERSION = 1;
7
8
 
8
9
  export interface PersistedTreeState {
@@ -27,7 +28,7 @@ export function loadTreeState(key: string): PersistedTreeState | null {
27
28
  const storage = safeStorage();
28
29
  if (!storage) return null;
29
30
  try {
30
- const raw = storage.getItem(KEY_PREFIX + key);
31
+ const raw = storage.getItem(cfgStorage.familyKey(CFG_FAMILIES.dataTree, key));
31
32
  if (!raw) return null;
32
33
  const parsed = JSON.parse(raw) as Partial<PersistedShape>;
33
34
  if (parsed.version !== VERSION) return null;
@@ -45,7 +46,7 @@ export function saveTreeState(key: string, state: PersistedTreeState): void {
45
46
  if (!storage) return;
46
47
  try {
47
48
  const payload: PersistedShape = { ...state, version: VERSION };
48
- storage.setItem(KEY_PREFIX + key, JSON.stringify(payload));
49
+ storage.setItem(cfgStorage.familyKey(CFG_FAMILIES.dataTree, key), JSON.stringify(payload));
49
50
  } catch {
50
51
  /* quota / serialization — best-effort persistence */
51
52
  }
@@ -55,7 +56,7 @@ export function clearTreeState(key: string): void {
55
56
  const storage = safeStorage();
56
57
  if (!storage) return;
57
58
  try {
58
- storage.removeItem(KEY_PREFIX + key);
59
+ storage.removeItem(cfgStorage.familyKey(CFG_FAMILIES.dataTree, key));
59
60
  } catch {
60
61
  /* ignore */
61
62
  }