@object-ui/plugin-list 0.5.0 → 0.5.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/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +7 -0
- package/dist/index.js +588 -593
- package/dist/index.umd.cjs +11 -11
- package/dist/src/ListView.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/ListView.tsx +10 -1
- package/src/__tests__/ListViewPersistence.test.tsx +5 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListView.d.ts","sourceRoot":"","sources":["../../src/ListView.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAgB,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACxC,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IACxC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IACnC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAmCD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"ListView.d.ts","sourceRoot":"","sources":["../../src/ListView.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAgB,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACxC,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IACxC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IACnC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAmCD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAmc5C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@object-ui/plugin-list",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "ListView plugin for Object UI - unified view component with view type switching",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"lucide-react": "^0.563.0",
|
|
28
28
|
"@object-ui/components": "0.5.0",
|
|
29
|
-
"@object-ui/core": "0.5.0",
|
|
30
29
|
"@object-ui/react": "0.5.0",
|
|
31
|
-
"@object-ui/types": "0.5.0"
|
|
30
|
+
"@object-ui/types": "0.5.0",
|
|
31
|
+
"@object-ui/core": "0.5.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"react": "^18.0.0 || ^19.0.0",
|
package/src/ListView.tsx
CHANGED
|
@@ -236,7 +236,15 @@ export const ListView: React.FC<ListViewProps> = ({
|
|
|
236
236
|
return views;
|
|
237
237
|
}, [schema.options, schema.viewType]);
|
|
238
238
|
|
|
239
|
-
//
|
|
239
|
+
// Sync view from props
|
|
240
|
+
React.useEffect(() => {
|
|
241
|
+
if (schema.viewType) {
|
|
242
|
+
setCurrentView(schema.viewType as ViewType);
|
|
243
|
+
}
|
|
244
|
+
}, [schema.viewType]);
|
|
245
|
+
|
|
246
|
+
// Load saved view preference (DISABLED: interfering with schema-defined views)
|
|
247
|
+
/*
|
|
240
248
|
React.useEffect(() => {
|
|
241
249
|
try {
|
|
242
250
|
const savedView = localStorage.getItem(storageKey);
|
|
@@ -247,6 +255,7 @@ export const ListView: React.FC<ListViewProps> = ({
|
|
|
247
255
|
console.warn('Failed to load view preference from localStorage:', error);
|
|
248
256
|
}
|
|
249
257
|
}, [storageKey, availableViews]);
|
|
258
|
+
*/
|
|
250
259
|
|
|
251
260
|
const handleViewChange = React.useCallback((view: ViewType) => {
|
|
252
261
|
setCurrentView(view);
|
|
@@ -119,8 +119,11 @@ describe('ListView Persistence', () => {
|
|
|
119
119
|
|
|
120
120
|
renderWithProvider(<ListView schema={schema} />);
|
|
121
121
|
|
|
122
|
-
// Should respect
|
|
122
|
+
// Should respect schema ('grid') because storage persistence is currently disabled
|
|
123
123
|
const kanbanButton = screen.getByLabelText('Kanban');
|
|
124
|
-
expect(kanbanButton.getAttribute('data-state')).toBe('
|
|
124
|
+
expect(kanbanButton.getAttribute('data-state')).toBe('off');
|
|
125
|
+
|
|
126
|
+
const gridButton = screen.getByLabelText('Grid');
|
|
127
|
+
expect(gridButton.getAttribute('data-state')).toBe('on');
|
|
125
128
|
});
|
|
126
129
|
});
|