@open-mercato/ui 0.6.7-develop.6766.1.40c9011995 → 0.6.7-develop.6770.1.b52298cf20

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.
@@ -256,6 +256,32 @@ function writePerspectiveSnapshot(tableId, snapshot) {
256
256
  }
257
257
  writeVersionedPreference(key, PERSPECTIVE_SNAPSHOT_VERSION, snapshot);
258
258
  }
259
+ function clearAllPerspectiveState() {
260
+ if (typeof window !== "undefined") {
261
+ try {
262
+ const storage = window.localStorage;
263
+ const staleKeys = [];
264
+ for (let index = 0; index < storage.length; index += 1) {
265
+ const key = storage.key(index);
266
+ if (key && key.startsWith(`${PERSPECTIVE_STORAGE_PREFIX}:`)) staleKeys.push(key);
267
+ }
268
+ for (const key of staleKeys) storage.removeItem(key);
269
+ } catch {
270
+ }
271
+ }
272
+ if (typeof document !== "undefined") {
273
+ try {
274
+ const cookies = document.cookie ? document.cookie.split(";") : [];
275
+ for (const cookie of cookies) {
276
+ const name = cookie.split("=")[0]?.trim();
277
+ if (name && name.startsWith(`${PERSPECTIVE_COOKIE_PREFIX}:`)) {
278
+ document.cookie = `${name}=; Path=/; Max-Age=0; SameSite=Lax`;
279
+ }
280
+ }
281
+ } catch {
282
+ }
283
+ }
284
+ }
259
285
  function sanitizePerspectiveSettings(source) {
260
286
  if (!source || typeof source !== "object") return null;
261
287
  const forbidden = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
@@ -2556,6 +2582,7 @@ function DataTable({
2556
2582
  }
2557
2583
  export {
2558
2584
  DataTable,
2585
+ clearAllPerspectiveState,
2559
2586
  readPerspectiveSnapshot,
2560
2587
  sanitizePerspectiveSettings,
2561
2588
  withDataTableNamespaces,