@pstdio/ui 0.19.0 → 0.20.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 (101) hide show
  1. package/dist/{MermaidComponent-BPiVFNYK.js → MermaidComponent-AmAjWLPm.js} +3 -3
  2. package/dist/{MermaidComponent-BPiVFNYK.js.map → MermaidComponent-AmAjWLPm.js.map} +1 -1
  3. package/dist/browser-storage-DPtOQJx0.js +127 -0
  4. package/dist/browser-storage-DPtOQJx0.js.map +1 -0
  5. package/dist/chat-ui.js +19 -20
  6. package/dist/chat-ui.js.map +1 -1
  7. package/dist/components/data-table/data-table-header.d.ts +3 -1
  8. package/dist/components/data-table/edit-mode-data-table-body.d.ts +29 -0
  9. package/dist/components/data-table/edit-mode-data-table-cell.d.ts +15 -0
  10. package/dist/components/data-table/edit-mode-data-table-editors.d.ts +19 -0
  11. package/dist/components/data-table/edit-mode-data-table-header.d.ts +23 -0
  12. package/dist/components/data-table/edit-mode-data-table-selection.d.ts +12 -0
  13. package/dist/components/data-table/edit-mode-data-table.d.ts +2 -0
  14. package/dist/components/data-table/edit-mode-story.d.ts +5 -0
  15. package/dist/components/data-table/index.d.ts +1 -1
  16. package/dist/components/data-table/pagination-footer.d.ts +8 -5
  17. package/dist/components/data-table/types.d.ts +24 -0
  18. package/dist/components/rich-text/index.d.ts +2 -0
  19. package/dist/components/rich-text/markdown-editor/markdown-editor.d.ts +7 -0
  20. package/dist/components/rich-text/markdown-editor/markdown-table.story-fixture.d.ts +3 -0
  21. package/dist/components/rich-text/markdown-editor/plugins/MarkdownSectionNavigationPlugin.d.ts +8 -0
  22. package/dist/components/rich-text/markdown-editor/plugins/MarkdownSlashCommandPlugin.d.ts +1 -0
  23. package/dist/components/rich-text/markdown-editor/plugins/markdown-history-plugin.d.ts +1 -0
  24. package/dist/components/rich-text/markdown-editor/plugins/markdown-section-navigation.d.ts +20 -0
  25. package/dist/components/rich-text/rich-message/rich-message.d.ts +2 -0
  26. package/dist/components/rich-text/shared/markdown-ast.d.ts +6 -0
  27. package/dist/components/rich-text/shared/markdown-codec.d.ts +3 -0
  28. package/dist/components/rich-text/shared/markdown-export.d.ts +2 -0
  29. package/dist/components/rich-text/shared/markdown-import.d.ts +2 -0
  30. package/dist/components/rich-text/shared/markdown-inline.d.ts +5 -0
  31. package/dist/components/rich-text/shared/markdown-table.d.ts +41 -0
  32. package/dist/components/rich-text/shared/markdown-url-context.d.ts +9 -0
  33. package/dist/components/rich-text/shared/markdown-url.d.ts +3 -0
  34. package/dist/components/rich-text/shared/nodes/DataTableNode.d.ts +13 -11
  35. package/dist/components/rich-text/shared/nodes/MarkdownImageNode.d.ts +35 -0
  36. package/dist/components/rich-text/shared/nodes/MarkdownLinkNode.d.ts +18 -0
  37. package/dist/components/rich-text/shared/nodes/RawHtmlNode.d.ts +31 -0
  38. package/dist/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/floating-toolbar-buttons.d.ts +4 -2
  39. package/dist/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/resolve-block-type.d.ts +1 -1
  40. package/dist/components/rich-text/shared/plugins/LinkEditorPlugin/utils/setFloatingElemPos.d.ts +1 -1
  41. package/dist/components/rich-text/shared/plugins/MermaidPlugin/MermaidNode.d.ts +1 -0
  42. package/dist/components/rich-text/shared/transformers/markdown-transformers.d.ts +2 -3
  43. package/dist/data-table.js +723 -923
  44. package/dist/data-table.js.map +1 -1
  45. package/dist/diff.js +4 -4
  46. package/dist/edit-mode-data-table-4GMiDy75.js +775 -0
  47. package/dist/edit-mode-data-table-4GMiDy75.js.map +1 -0
  48. package/dist/editor-config-Dyh8n5A2.js +2416 -0
  49. package/dist/editor-config-Dyh8n5A2.js.map +1 -0
  50. package/dist/index.js +142 -144
  51. package/dist/index.js.map +1 -1
  52. package/dist/{kanban-renderer-toolbar-Bcj_N1qr.js → kanban-renderer-toolbar-BcUZvGyY.js} +359 -361
  53. package/dist/kanban-renderer-toolbar-BcUZvGyY.js.map +1 -0
  54. package/dist/kanban-renderer.js +28 -27
  55. package/dist/kanban-renderer.js.map +1 -1
  56. package/dist/{lazy-markdown-editor-DwhqQ-NN.js → lazy-markdown-editor-CWSREEhf.js} +2 -2
  57. package/dist/{lazy-markdown-editor-DwhqQ-NN.js.map → lazy-markdown-editor-CWSREEhf.js.map} +1 -1
  58. package/dist/{list-row-BtoVJpFs.js → list-row-B8L4TGsh.js} +2 -2
  59. package/dist/{list-row-BtoVJpFs.js.map → list-row-B8L4TGsh.js.map} +1 -1
  60. package/dist/{mermaid-renderer-DZo3qj6D.js → mermaid-renderer-H3IhLqnQ.js} +3 -3
  61. package/dist/{mermaid-renderer-DZo3qj6D.js.map → mermaid-renderer-H3IhLqnQ.js.map} +1 -1
  62. package/dist/mermaid.js +1 -1
  63. package/dist/number-input-WUfejtNx.js +343 -0
  64. package/dist/number-input-WUfejtNx.js.map +1 -0
  65. package/dist/param-editor-field-C8zRDStn.js +2845 -0
  66. package/dist/param-editor-field-C8zRDStn.js.map +1 -0
  67. package/dist/{param-editor-XRjSu6MT.js → param-editor-w3xH-t8A.js} +2 -2
  68. package/dist/{param-editor-XRjSu6MT.js.map → param-editor-w3xH-t8A.js.map} +1 -1
  69. package/dist/rich-message-jZ2oPQhU.js +658 -0
  70. package/dist/rich-message-jZ2oPQhU.js.map +1 -0
  71. package/dist/rich-text.js +182 -110
  72. package/dist/rich-text.js.map +1 -1
  73. package/dist/style.css +1 -1
  74. package/dist/theme/recipes/button.d.ts +11 -0
  75. package/dist/{theme-7PDdD9OD.js → theme-J8K8KbZi.js} +12 -1
  76. package/dist/theme-J8K8KbZi.js.map +1 -0
  77. package/dist/{theme-preference-DOzHx64J.js → theme-preference-DyymrYpR.js} +2 -2
  78. package/dist/{theme-preference-DOzHx64J.js.map → theme-preference-DyymrYpR.js.map} +1 -1
  79. package/dist/theme.js +1 -1
  80. package/dist/{tree-list-B2L0cTj2.js → tree-list-CC13pOYi.js} +2 -2
  81. package/dist/{tree-list-B2L0cTj2.js.map → tree-list-CC13pOYi.js.map} +1 -1
  82. package/package.json +9 -1
  83. package/dist/browser-storage-BinyFNJX.js +0 -40
  84. package/dist/browser-storage-BinyFNJX.js.map +0 -1
  85. package/dist/checkbox-B2zYVemL.js +0 -70
  86. package/dist/checkbox-B2zYVemL.js.map +0 -1
  87. package/dist/components/data-table/editable-cells-story.d.ts +0 -9
  88. package/dist/kanban-renderer-toolbar-Bcj_N1qr.js.map +0 -1
  89. package/dist/markdown-DDd2ESoH.js +0 -743
  90. package/dist/markdown-DDd2ESoH.js.map +0 -1
  91. package/dist/markdown-editor-CYVkzt8t.js +0 -741
  92. package/dist/markdown-editor-CYVkzt8t.js.map +0 -1
  93. package/dist/param-editor-field-B9lEPq8c.js +0 -3028
  94. package/dist/param-editor-field-B9lEPq8c.js.map +0 -1
  95. package/dist/resource-badge-CuItchgL.js +0 -98
  96. package/dist/resource-badge-CuItchgL.js.map +0 -1
  97. package/dist/rich-message--eRzjWYK.js +0 -730
  98. package/dist/rich-message--eRzjWYK.js.map +0 -1
  99. package/dist/scroll-area-BMbg1WcD.js +0 -91
  100. package/dist/scroll-area-BMbg1WcD.js.map +0 -1
  101. package/dist/theme-7PDdD9OD.js.map +0 -1
@@ -3,15 +3,13 @@ import { c as Y } from "react/compiler-runtime";
3
3
  import { Popover as le, IconButton as We, Icon as Q, Portal as gt, Text as J, HStack as H, Menu as re, Button as Z, Stack as ze, Input as mt, Badge as Rt, Tabs as $e, Box as Le, chakra as Ot, Dialog as oe } from "@chakra-ui/react";
4
4
  import { Settings2 as _t, SortAsc as Gt, SortDesc as Dt, Check as Pt, ChevronDown as Ft, List as Tt, SquareKanban as Et, Filter as $t, Search as Lt, RotateCcw as Nt, X as Bt, Pencil as Mt, Copy as zt, Trash2 as jt, Plus as Wt } from "lucide-react";
5
5
  import { createElement as Kt, useRef as Ge, useState as xe, useEffect as Ke, Fragment as Xt, useReducer as Ut } from "react";
6
- import { T as Xe, S as Je } from "./scroll-area-BMbg1WcD.js";
7
- import { W as Ht } from "./param-editor-field-B9lEPq8c.js";
8
- import { C as qt } from "./checkbox-B2zYVemL.js";
9
- import { L as Ye, R as Jt } from "./list-row-BtoVJpFs.js";
10
- import { useStore as Yt } from "zustand";
11
- import { persist as Qt, createJSONStorage as Zt } from "zustand/middleware";
12
- import { createStore as en } from "zustand/vanilla";
13
- import { c as tn } from "./browser-storage-BinyFNJX.js";
14
- const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Array.isArray(t), nn = {
6
+ import { c as Ht, T as Xe, S as Je } from "./browser-storage-DPtOQJx0.js";
7
+ import { W as qt, C as Jt } from "./number-input-WUfejtNx.js";
8
+ import { L as Ye, R as Yt } from "./list-row-B8L4TGsh.js";
9
+ import { useStore as Qt } from "zustand";
10
+ import { persist as Zt, createJSONStorage as en } from "zustand/middleware";
11
+ import { createStore as tn } from "zustand/vanilla";
12
+ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Gi = (t) => !Array.isArray(t), nn = {
15
13
  viewMode: "board",
16
14
  columnGrouping: W,
17
15
  rowGrouping: W,
@@ -111,7 +109,7 @@ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Arr
111
109
  const i = mn(n.attributes[t.display.itemsAttributeId]);
112
110
  if (i.length === 0) return null;
113
111
  const o = typeof e == "string" ? e : void 0, r = i.find((l) => l.id === o) ?? i[0];
114
- return r ? Kt(Ht, {
112
+ return r ? Kt(qt, {
115
113
  workspaceType: r.type,
116
114
  shorthand: r.shorthand ?? r.name,
117
115
  hasMultipleWorkspaces: i.length > 1,
@@ -149,7 +147,7 @@ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Arr
149
147
  attributeId: t.id,
150
148
  label: o
151
149
  } : null;
152
- }, Fi = (t, e, n) => {
150
+ }, Di = (t, e, n) => {
153
151
  const i = [];
154
152
  for (const o of n) {
155
153
  const r = ae(e, o);
@@ -158,7 +156,7 @@ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Arr
158
156
  l && i.push(l);
159
157
  }
160
158
  return i;
161
- }, Ti = (t, e, n) => {
159
+ }, Pi = (t, e, n) => {
162
160
  const i = [];
163
161
  for (const o of n) {
164
162
  const r = ae(e, o);
@@ -243,7 +241,7 @@ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Arr
243
241
  label: n.label
244
242
  });
245
243
  return e;
246
- }, Sn = (t, e) => e === W ? t.filter((n) => n.value === W) : t.filter((n) => n.value === W || n.value !== e), Ei = (t, e) => t === W ? "all" : e?.columnKey, $i = (t, e, n) => {
244
+ }, Sn = (t, e) => e === W ? t.filter((n) => n.value === W) : t.filter((n) => n.value === W || n.value !== e), Fi = (t, e) => t === W ? "all" : e?.columnKey, Ti = (t, e, n) => {
247
245
  if (t === W) return;
248
246
  const i = ae(e, t), o = n?.[t];
249
247
  if (i && o && o.length > 0) return qe(i, o);
@@ -254,7 +252,7 @@ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Arr
254
252
  ...t
255
253
  };
256
254
  return delete n[e], n;
257
- }, Li = (t, e) => {
255
+ }, Ei = (t, e) => {
258
256
  const n = new Set(e.map((c) => c.id)), i = (c) => c === W || n.has(c), o = (c) => c === se || c === "title" || n.has(c), r = i(t.columnGrouping) ? t.columnGrouping : W, l = i(t.rowGrouping) ? t.rowGrouping : W, s = o(t.ordering.attributeId) ? t.ordering.attributeId : se, u = t.displayProperties.filter(i);
259
257
  return {
260
258
  viewMode: t.viewMode,
@@ -266,18 +264,291 @@ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Arr
266
264
  },
267
265
  displayProperties: u
268
266
  };
269
- }, Ni = (t, e) => {
267
+ }, $i = (t, e) => {
270
268
  const n = new Map(e.map((o) => [o.id, o])), i = {};
271
269
  for (const [o, r] of Object.entries(t)) {
272
270
  const l = n.get(o);
273
271
  l && (!r || r.length === 0 || (i[o] = qe(l, r)));
274
272
  }
275
273
  return i;
276
- }, et = (t) => {
274
+ }, bt = (t) => ({
275
+ ...t,
276
+ ordering: {
277
+ ...t.ordering
278
+ },
279
+ displayProperties: [...t.displayProperties]
280
+ }), ht = (t) => Object.fromEntries(Object.entries(t).map(([e, n]) => [e, [...n]])), _e = (t, e, n, i = !1) => ({
281
+ id: t,
282
+ title: e,
283
+ settings: bt(n.settings),
284
+ filters: ht(n.filters),
285
+ ...i ? {
286
+ isDefault: !0
287
+ } : {}
288
+ }), Ce = (t) => ({
289
+ settings: bt(t.settings),
290
+ filters: ht(t.filters)
291
+ }), et = (t) => ({
292
+ viewMode: t.viewMode,
293
+ columnGrouping: t.columnGrouping,
294
+ rowGrouping: t.rowGrouping,
295
+ ordering: t.ordering,
296
+ displayProperties: [...t.displayProperties].sort()
297
+ }), tt = (t) => Object.fromEntries(Object.entries(t).filter(([, e]) => e.length > 0).sort(([e], [n]) => e.localeCompare(n)).map(([e, n]) => [e, [...n].sort()])), xn = (t, e) => t ? JSON.stringify(et(t.settings)) !== JSON.stringify(et(e.settings)) || JSON.stringify(tt(t.filters)) !== JSON.stringify(tt(e.filters)) : !1, Cn = "pstdio/ui/kanban-renderer", Vn = (t) => `${Cn}/${t}`, Be = {
298
+ settings: nn,
299
+ filters: {},
300
+ expandedGroups: {}
301
+ }, nt = (t) => {
302
+ const e = {
303
+ ...Be.settings,
304
+ ...t?.settings ?? {}
305
+ }, n = t?.filters ?? Be.filters, i = t?.views ?? [], o = i.length > 0 ? i : [_e("default", "All", {
306
+ settings: e,
307
+ filters: n
308
+ }, !0)], l = o.find((s) => s.id === t?.activeViewId) ?? o.find((s) => s.isDefault) ?? o[0];
309
+ return {
310
+ ...Ce(l),
311
+ expandedGroups: t?.expandedGroups ?? Be.expandedGroups,
312
+ views: o,
313
+ activeViewId: l.id
314
+ };
315
+ }, kn = (t, e) => t.includes(e) ? t.filter((n) => n !== e) : [...t, e], Ve = (t) => t.startsWith("tag:") ? t.slice(4) : t, An = (t) => {
316
+ const e = t.ordering, n = typeof e?.attributeId == "string" ? e.attributeId : typeof e?.field == "string" ? Ve(e.field) : se, i = e?.direction === "desc" ? "desc" : "asc", o = typeof t.columnGrouping == "string" ? Ve(t.columnGrouping) : W, r = typeof t.rowGrouping == "string" ? Ve(t.rowGrouping) : W, l = Array.isArray(t.displayProperties) ? t.displayProperties.filter((s) => typeof s == "string").map(Ve) : [];
317
+ return {
318
+ viewMode: t.viewMode === "list" ? "list" : "board",
319
+ columnGrouping: o,
320
+ rowGrouping: r,
321
+ ordering: {
322
+ attributeId: n === "manual" ? se : n,
323
+ direction: i
324
+ },
325
+ displayProperties: l
326
+ };
327
+ }, In = (t) => {
328
+ const e = {};
329
+ for (const [n, i] of Object.entries(t)) {
330
+ if (!Array.isArray(i)) continue;
331
+ const o = i.filter((r) => typeof r == "string");
332
+ o.length !== 0 && (e[Ve(n)] = o);
333
+ }
334
+ return e;
335
+ }, Rn = (t) => {
336
+ const {
337
+ storageKey: e,
338
+ initialState: n
339
+ } = t, i = nt(n);
340
+ return tn()(Zt((o) => ({
341
+ ...i,
342
+ setViewMode: (r) => o((l) => ({
343
+ ...l,
344
+ settings: {
345
+ ...l.settings,
346
+ viewMode: r
347
+ }
348
+ })),
349
+ setColumnGrouping: (r) => o((l) => ({
350
+ ...l,
351
+ settings: {
352
+ ...l.settings,
353
+ columnGrouping: r
354
+ }
355
+ })),
356
+ setRowGrouping: (r) => o((l) => ({
357
+ ...l,
358
+ settings: {
359
+ ...l.settings,
360
+ rowGrouping: r
361
+ }
362
+ })),
363
+ setOrdering: (r) => o((l) => ({
364
+ ...l,
365
+ settings: {
366
+ ...l.settings,
367
+ ordering: r
368
+ }
369
+ })),
370
+ setOrderingAttributeId: (r) => o((l) => ({
371
+ ...l,
372
+ settings: {
373
+ ...l.settings,
374
+ ordering: {
375
+ ...l.settings.ordering,
376
+ attributeId: r
377
+ }
378
+ }
379
+ })),
380
+ setDisplayProperties: (r) => o((l) => ({
381
+ ...l,
382
+ settings: {
383
+ ...l.settings,
384
+ displayProperties: r
385
+ }
386
+ })),
387
+ toggleSortDirection: () => o((r) => ({
388
+ ...r,
389
+ settings: {
390
+ ...r.settings,
391
+ ordering: {
392
+ ...r.settings.ordering,
393
+ direction: r.settings.ordering.direction === "asc" ? "desc" : "asc"
394
+ }
395
+ }
396
+ })),
397
+ toggleDisplayProperty: (r) => o((l) => {
398
+ const s = l.settings.displayProperties.includes(r) ? l.settings.displayProperties.filter((u) => u !== r) : [...l.settings.displayProperties, r];
399
+ return {
400
+ ...l,
401
+ settings: {
402
+ ...l.settings,
403
+ displayProperties: s
404
+ }
405
+ };
406
+ }),
407
+ setFilter: (r, l) => o((s) => ({
408
+ ...s,
409
+ filters: {
410
+ ...s.filters,
411
+ [r]: l
412
+ }
413
+ })),
414
+ toggleFilterValue: (r, l) => o((s) => {
415
+ const u = s.filters[r] ?? [], c = kn(u, l), d = c.length === 0 ? Ze(s.filters, r) : {
416
+ ...s.filters,
417
+ [r]: c
418
+ };
419
+ return {
420
+ ...s,
421
+ filters: d
422
+ };
423
+ }),
424
+ clearFilter: (r) => o((l) => ({
425
+ ...l,
426
+ filters: Ze(l.filters, r)
427
+ })),
428
+ clearAllFilters: () => o((r) => ({
429
+ ...r,
430
+ filters: {}
431
+ })),
432
+ setExpandedGroup: (r, l) => o((s) => ({
433
+ ...s,
434
+ expandedGroups: {
435
+ ...s.expandedGroups,
436
+ [r]: l
437
+ }
438
+ })),
439
+ activateView: (r) => o((l) => {
440
+ const s = l.views.find((u) => u.id === r);
441
+ return s ? {
442
+ ...l,
443
+ ...Ce(s),
444
+ activeViewId: s.id,
445
+ expandedGroups: {}
446
+ } : l;
447
+ }),
448
+ createView: (r) => o((l) => {
449
+ const s = _e(r.id, r.title, l);
450
+ return {
451
+ ...l,
452
+ views: [...l.views, s],
453
+ activeViewId: s.id
454
+ };
455
+ }),
456
+ saveActiveView: () => o((r) => ({
457
+ ...r,
458
+ views: r.views.map((l) => l.id === r.activeViewId ? _e(l.id, l.title, r, l.isDefault) : l)
459
+ })),
460
+ resetActiveView: () => o((r) => {
461
+ const l = r.views.find((s) => s.id === r.activeViewId);
462
+ return l ? {
463
+ ...r,
464
+ ...Ce(l)
465
+ } : r;
466
+ }),
467
+ renameView: (r, l) => o((s) => ({
468
+ ...s,
469
+ views: s.views.map((u) => u.id === r ? {
470
+ ...u,
471
+ title: l
472
+ } : u)
473
+ })),
474
+ duplicateView: (r, l) => o((s) => {
475
+ const u = s.views.find((d) => d.id === r);
476
+ if (!u) return s;
477
+ const c = _e(l.id, l.title, u);
478
+ return {
479
+ ...s,
480
+ ...Ce(c),
481
+ views: [...s.views, c],
482
+ activeViewId: c.id,
483
+ expandedGroups: {}
484
+ };
485
+ }),
486
+ deleteView: (r) => o((l) => {
487
+ if (l.views.length === 1) return l;
488
+ const s = l.views.filter((c) => c.id !== r);
489
+ if (s.length === l.views.length || l.activeViewId !== r) return {
490
+ ...l,
491
+ views: s
492
+ };
493
+ const u = s.find((c) => c.isDefault) ?? s[0];
494
+ return {
495
+ ...l,
496
+ ...Ce(u),
497
+ views: s,
498
+ activeViewId: u.id,
499
+ expandedGroups: {}
500
+ };
501
+ }),
502
+ setDefaultView: (r) => o((l) => ({
503
+ ...l,
504
+ views: l.views.map((s) => ({
505
+ ...s,
506
+ isDefault: s.id === r || void 0
507
+ }))
508
+ })),
509
+ reset: () => o(i)
510
+ }), {
511
+ name: Vn(e),
512
+ version: 3,
513
+ migrate: (o, r) => {
514
+ if (!o || typeof o != "object") return o;
515
+ const l = o;
516
+ if (r >= 3)
517
+ return {
518
+ ...l,
519
+ expandedGroups: {}
520
+ };
521
+ const s = An(l.settings ?? {}), u = In(l.filters ?? {});
522
+ return nt({
523
+ settings: s,
524
+ filters: u
525
+ });
526
+ },
527
+ storage: en(Ht),
528
+ partialize: (o) => ({
529
+ settings: o.settings,
530
+ filters: o.filters,
531
+ views: o.views,
532
+ activeViewId: o.activeViewId
533
+ })
534
+ }));
535
+ }, it = /* @__PURE__ */ new Map(), On = (t, e) => {
536
+ const n = it.get(t);
537
+ if (n) return n;
538
+ const i = Rn({
539
+ storageKey: t,
540
+ initialState: e
541
+ });
542
+ return it.set(t, i), i;
543
+ }, D = (t, e, n) => {
544
+ const i = Y(3);
545
+ let o;
546
+ return i[0] !== n || i[1] !== t ? (o = On(t, n), i[0] = n, i[1] = t, i[2] = o) : o = i[2], Qt(o, e);
547
+ }, _n = (t) => xn(t.views.find((e) => e.id === t.activeViewId), t), rt = (t) => {
277
548
  const e = Y(2);
278
549
  let n;
279
550
  return e[0] !== t.children ? (n = /* @__PURE__ */ a(J, { paddingX: "xs", paddingTop: "xs", paddingBottom: "2xs", textStyle: "label/XS/medium", color: "fg.muted", children: t.children }), e[0] = t.children, e[1] = n) : n = e[1], n;
280
- }, Be = (t) => {
551
+ }, Me = (t) => {
281
552
  const e = Y(26);
282
553
  let n;
283
554
  e[0] !== t.label || e[1] !== t.options || e[2] !== t.value ? (n = t.options.find((p) => p.value === t.value)?.label ?? t.label, e[0] = t.label, e[1] = t.options, e[2] = t.value, e[3] = n) : n = e[3];
@@ -322,7 +593,7 @@ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Arr
322
593
  c,
323
594
  m
324
595
  ] }), e[23] = c, e[24] = m, e[25] = g) : g = e[25], g;
325
- }, xn = (t) => {
596
+ }, Gn = (t) => {
326
597
  const e = Y(65), {
327
598
  settings: n,
328
599
  groupingOptions: i,
@@ -356,7 +627,7 @@ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Arr
356
627
  let _;
357
628
  e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ a(Xe, { content: "Display", children: /* @__PURE__ */ a(le.Trigger, { asChild: !0, children: /* @__PURE__ */ a(We, { ref: m, "aria-label": "Display settings", variant: "ghost", size: "2xs", children: /* @__PURE__ */ a(Q, { as: _t }) }) }) }), e[5] = _) : _ = e[5];
358
629
  let w;
359
- e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ a(et, { children: "DISPLAY" }), e[6] = w) : w = e[6];
630
+ e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ a(rt, { children: "DISPLAY" }), e[6] = w) : w = e[6];
360
631
  const P = n.viewMode === "list";
361
632
  let x;
362
633
  e[7] !== l ? (x = () => l("list"), e[7] = l, e[8] = x) : x = e[8];
@@ -387,19 +658,19 @@ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Arr
387
658
  s(U), (U === "none" || U === n.rowGrouping) && u("none");
388
659
  }, e[22] = s, e[23] = u, e[24] = n.rowGrouping, e[25] = F) : F = e[25];
389
660
  let T;
390
- e[26] !== i || e[27] !== n.columnGrouping || e[28] !== F ? (T = /* @__PURE__ */ a(Be, { label: "Grouping", value: n.columnGrouping, options: i, onSelect: F }), e[26] = i, e[27] = n.columnGrouping, e[28] = F, e[29] = T) : T = e[29];
661
+ e[26] !== i || e[27] !== n.columnGrouping || e[28] !== F ? (T = /* @__PURE__ */ a(Me, { label: "Grouping", value: n.columnGrouping, options: i, onSelect: F }), e[26] = i, e[27] = n.columnGrouping, e[28] = F, e[29] = T) : T = e[29];
391
662
  let C;
392
663
  e[30] !== n.ordering.attributeId || e[31] !== n.ordering.direction ? (C = n.ordering.attributeId === "manual" ? void 0 : /* @__PURE__ */ a(Q, { as: n.ordering.direction === "asc" ? Gt : Dt, "aria-label": `${n.ordering.direction === "asc" ? "Ascending" : "Descending"} order`, "aria-hidden": !1, role: "img", boxSize: "0.875rem", flexShrink: 0 }), e[30] = n.ordering.attributeId, e[31] = n.ordering.direction, e[32] = C) : C = e[32];
393
664
  const j = n.ordering.attributeId === "manual" ? void 0 : d;
394
665
  let N;
395
- e[33] !== c || e[34] !== o || e[35] !== n.ordering.attributeId || e[36] !== C || e[37] !== j ? (N = /* @__PURE__ */ a(Be, { label: "Ordering", value: n.ordering.attributeId, options: o, valueSuffix: C, onSelect: c, onSuffixAction: j }), e[33] = c, e[34] = o, e[35] = n.ordering.attributeId, e[36] = C, e[37] = j, e[38] = N) : N = e[38];
666
+ e[33] !== c || e[34] !== o || e[35] !== n.ordering.attributeId || e[36] !== C || e[37] !== j ? (N = /* @__PURE__ */ a(Me, { label: "Ordering", value: n.ordering.attributeId, options: o, valueSuffix: C, onSelect: c, onSuffixAction: j }), e[33] = c, e[34] = o, e[35] = n.ordering.attributeId, e[36] = C, e[37] = j, e[38] = N) : N = e[38];
396
667
  const X = n.rowGrouping;
397
668
  let B;
398
669
  e[39] !== i || e[40] !== n.columnGrouping ? (B = Sn(i, n.columnGrouping), e[39] = i, e[40] = n.columnGrouping, e[41] = B) : B = e[41];
399
670
  let E;
400
- e[42] !== u || e[43] !== n.rowGrouping || e[44] !== B ? (E = /* @__PURE__ */ a(Be, { label: "Sub-grouping", value: X, options: B, onSelect: u }), e[42] = u, e[43] = n.rowGrouping, e[44] = B, e[45] = E) : E = e[45];
671
+ e[42] !== u || e[43] !== n.rowGrouping || e[44] !== B ? (E = /* @__PURE__ */ a(Me, { label: "Sub-grouping", value: X, options: B, onSelect: u }), e[42] = u, e[43] = n.rowGrouping, e[44] = B, e[45] = E) : E = e[45];
401
672
  let M;
402
- e[46] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (M = /* @__PURE__ */ a(et, { children: "PROPERTIES" }), e[46] = M) : M = e[46];
673
+ e[46] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (M = /* @__PURE__ */ a(rt, { children: "PROPERTIES" }), e[46] = M) : M = e[46];
403
674
  let b;
404
675
  if (e[47] !== r || e[48] !== f || e[49] !== n.displayProperties) {
405
676
  let U;
@@ -426,15 +697,15 @@ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Arr
426
697
  _,
427
698
  q
428
699
  ] }), e[62] = p, e[63] = q, e[64] = te) : te = e[64], te;
429
- }, tt = {
700
+ }, ot = {
430
701
  p: "2xs",
431
702
  display: "flex",
432
703
  flexDirection: "column",
433
704
  gap: "1px"
434
- }, nt = (t, e) => t[e]?.filter(Boolean) ?? [], Cn = (t) => Object.values(t).some((e) => e.length > 0), Vn = (t, e) => {
705
+ }, lt = (t, e) => t[e]?.filter(Boolean) ?? [], Dn = (t) => Object.values(t).some((e) => e.length > 0), Pn = (t, e) => {
435
706
  const n = e.map((i) => t.options.find((o) => o.value === i)?.label ?? i);
436
707
  return n.length <= 2 ? n.join(", ") : `${n.slice(0, 2).join(", ")} +${(n.length - 2).toString()}`;
437
- }, kn = (t) => {
708
+ }, Fn = (t) => {
438
709
  const e = Y(8), {
439
710
  category: n,
440
711
  values: i
@@ -442,13 +713,13 @@ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Arr
442
713
  let o;
443
714
  e[0] !== n.label ? (o = /* @__PURE__ */ a(J, { textStyle: "label/S/regular", truncate: !0, children: n.label }), e[0] = n.label, e[1] = o) : o = e[1];
444
715
  let r;
445
- e[2] !== n || e[3] !== i ? (r = i.length > 0 ? /* @__PURE__ */ a(J, { textStyle: "label/XS", color: "fg.menu-item.secondary", truncate: !0, children: Vn(n, i) }) : null, e[2] = n, e[3] = i, e[4] = r) : r = e[4];
716
+ e[2] !== n || e[3] !== i ? (r = i.length > 0 ? /* @__PURE__ */ a(J, { textStyle: "label/XS", color: "fg.menu-item.secondary", truncate: !0, children: Pn(n, i) }) : null, e[2] = n, e[3] = i, e[4] = r) : r = e[4];
446
717
  let l;
447
718
  return e[5] !== o || e[6] !== r ? (l = /* @__PURE__ */ h(H, { minW: "0", width: "full", gap: "2xs", children: [
448
719
  o,
449
720
  r
450
721
  ] }), e[5] = o, e[6] = r, e[7] = l) : l = e[7], l;
451
- }, An = (t) => {
722
+ }, Tn = (t) => {
452
723
  const e = Y(8);
453
724
  let n;
454
725
  e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = {
@@ -456,7 +727,7 @@ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Arr
456
727
  "aria-hidden": !0
457
728
  }, e[0] = n) : n = e[0];
458
729
  let i;
459
- e[1] !== t.checked ? (i = /* @__PURE__ */ a(qt, { checked: t.checked, readOnly: !0, "aria-readonly": "true", inputProps: n, pointerEvents: "none", size: "sm" }), e[1] = t.checked, e[2] = i) : i = e[2];
730
+ e[1] !== t.checked ? (i = /* @__PURE__ */ a(Jt, { checked: t.checked, readOnly: !0, "aria-readonly": "true", inputProps: n, pointerEvents: "none", size: "sm" }), e[1] = t.checked, e[2] = i) : i = e[2];
460
731
  let o;
461
732
  e[3] !== t.label ? (o = /* @__PURE__ */ a(J, { textStyle: "label/S/regular", truncate: !0, children: t.label }), e[3] = t.label, e[4] = o) : o = e[4];
462
733
  let r;
@@ -464,7 +735,7 @@ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Arr
464
735
  i,
465
736
  o
466
737
  ] }), e[5] = i, e[6] = o, e[7] = r) : r = e[7], r;
467
- }, In = (t) => {
738
+ }, En = (t) => {
468
739
  const e = Y(63), {
469
740
  categories: n,
470
741
  filters: i,
@@ -477,7 +748,7 @@ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Arr
477
748
  e[0] !== p || e[1] !== n ? (v = n.find((k) => k.id === p) ?? n[0], e[0] = p, e[1] = n, e[2] = v) : v = e[2];
478
749
  const S = v;
479
750
  let A;
480
- e[3] !== i ? (A = Cn(i), e[3] = i, e[4] = A) : A = e[4];
751
+ e[3] !== i ? (A = Dn(i), e[3] = i, e[4] = A) : A = e[4];
481
752
  const I = A, _ = m.trim().toLocaleLowerCase(), w = n.filter((k) => k.label.toLocaleLowerCase().includes(_));
482
753
  let P, x;
483
754
  e[5] !== d ? (P = () => {
@@ -528,11 +799,11 @@ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Arr
528
799
  e[21] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ge = {
529
800
  overscrollBehavior: "contain"
530
801
  }, e[21] = ge) : ge = e[21];
531
- const Fe = tt;
802
+ const Fe = ot;
532
803
  let Ie;
533
804
  e[22] !== S?.id || e[23] !== i ? (Ie = (k) => {
534
- const ie = nt(i, k.id);
535
- return /* @__PURE__ */ a(Ye, { id: k.id, role: "button", variant: "compact", isSelected: S?.id === k.id, label: /* @__PURE__ */ a(kn, { category: k, values: ie }), endContent: ie.length > 0 ? /* @__PURE__ */ a(Rt, { variant: "number", colorPalette: "gray", children: ie.length }) : void 0, onActivate: () => y(k.id) }, k.id);
805
+ const ie = lt(i, k.id);
806
+ return /* @__PURE__ */ a(Ye, { id: k.id, role: "button", variant: "compact", isSelected: S?.id === k.id, label: /* @__PURE__ */ a(Fn, { category: k, values: ie }), endContent: ie.length > 0 ? /* @__PURE__ */ a(Rt, { variant: "number", colorPalette: "gray", children: ie.length }) : void 0, onActivate: () => y(k.id) }, k.id);
536
807
  }, e[22] = S?.id, e[23] = i, e[24] = Ie) : Ie = e[24];
537
808
  const Te = w.map(Ie);
538
809
  let me;
@@ -550,9 +821,9 @@ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Arr
550
821
  ] }),
551
822
  /* @__PURE__ */ a(Je, { flex: "1", minH: "0", viewportProps: {
552
823
  overscrollBehavior: "contain"
553
- }, contentProps: tt, children: S.options.map((k) => {
554
- const ie = nt(i, S.id).includes(k.value);
555
- return /* @__PURE__ */ a(Ye, { id: k.value, role: "checkbox", "aria-label": k.label, "aria-checked": ie, variant: "compact", label: /* @__PURE__ */ a(An, { checked: ie, label: k.label }), endContent: /* @__PURE__ */ a(J, { textStyle: "label/XS", color: "fg.muted", children: o[S.id]?.[k.value] ?? 0 }), onActivate: () => r(S.id, k.value) }, k.value);
824
+ }, contentProps: ot, children: S.options.map((k) => {
825
+ const ie = lt(i, S.id).includes(k.value);
826
+ return /* @__PURE__ */ a(Ye, { id: k.value, role: "checkbox", "aria-label": k.label, "aria-checked": ie, variant: "compact", label: /* @__PURE__ */ a(Tn, { checked: ie, label: k.label }), endContent: /* @__PURE__ */ a(J, { textStyle: "label/XS", color: "fg.muted", children: o[S.id]?.[k.value] ?? 0 }), onActivate: () => r(S.id, k.value) }, k.value);
556
827
  }) })
557
828
  ] }) : null, e[34] = S, e[35] = o, e[36] = i, e[37] = l, e[38] = r, e[39] = be) : be = e[39];
558
829
  let he;
@@ -576,26 +847,26 @@ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Arr
576
847
  R,
577
848
  Se
578
849
  ] }), e[56] = d, e[57] = R, e[58] = z.Root, e[59] = Se, e[60] = $, e[61] = O, e[62] = Re) : Re = e[62], Re;
579
- }, Rn = "Unassigned", it = (t) => `No ${t.label.toLowerCase()}`, rt = (t, e) => e ? e.type.kind === "enum" || e.type.kind === "enum-multi" ? Oe(e.type, t) : t : t === W ? "All" : t, ot = (t, e) => {
850
+ }, $n = "Unassigned", st = (t) => `No ${t.label.toLowerCase()}`, at = (t, e) => e ? e.type.kind === "enum" || e.type.kind === "enum-multi" ? Oe(e.type, t) : t : t === W ? "All" : t, ct = (t, e) => {
580
851
  if (t !== void 0)
581
852
  return e.type.kind !== "enum" && e.type.kind !== "enum-multi" || ee(e.type).some((n) => n.value === t) ? t : void 0;
582
- }, lt = (t, e, n) => {
853
+ }, ut = (t, e, n) => {
583
854
  if (n === W || !e) return "all";
584
855
  if (e.type.kind === "enum-multi") {
585
856
  const [o] = de(t, e);
586
- return ot(o, e) ?? it(e);
857
+ return ct(o, e) ?? st(e);
587
858
  }
588
859
  const [i] = de(t, e);
589
- return ot(i, e) ?? it(e);
590
- }, On = (t, e) => t.localeCompare(e, void 0, {
860
+ return ct(i, e) ?? st(e);
861
+ }, Ln = (t, e) => t.localeCompare(e, void 0, {
591
862
  numeric: !0
592
- }), st = (t, e, n) => {
863
+ }), dt = (t, e, n) => {
593
864
  if (n && (n.type.kind === "enum" || n.type.kind === "enum-multi")) {
594
- const i = bt(t, e, n.type);
865
+ const i = yt(t, e, n.type);
595
866
  if (i !== 0) return i;
596
867
  }
597
- return On(t, e);
598
- }, at = (t, e) => e === "asc" ? t : t * -1, bt = (t, e, n) => {
868
+ return Ln(t, e);
869
+ }, ft = (t, e) => e === "asc" ? t : t * -1, yt = (t, e, n) => {
599
870
  if (n.kind !== "enum" && n.kind !== "enum-multi") return 0;
600
871
  const i = ee(n), o = (r) => {
601
872
  if (r === void 0) return i.length;
@@ -603,7 +874,7 @@ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Arr
603
874
  return l === -1 ? i.length + 1 : l;
604
875
  };
605
876
  return o(t) - o(e);
606
- }, _n = (t, e, n) => {
877
+ }, Nn = (t, e, n) => {
607
878
  if (n.compare) return n.compare(ue(t, n), ue(e, n));
608
879
  const i = ue(t, n), o = ue(e, n);
609
880
  if (n.type.kind === "date") {
@@ -616,19 +887,19 @@ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Arr
616
887
  }
617
888
  if (n.type.kind === "enum" || n.type.kind === "enum-multi") {
618
889
  const [s] = de(t, n), [u] = de(e, n);
619
- return bt(s, u, n.type);
890
+ return yt(s, u, n.type);
620
891
  }
621
892
  const r = typeof i == "string" ? i : String(i ?? ""), l = typeof o == "string" ? o : String(o ?? "");
622
893
  return r.localeCompare(l, void 0, {
623
894
  numeric: !0
624
895
  });
625
- }, Bi = (t, e, n) => {
896
+ }, Li = (t, e, n) => {
626
897
  if (e.attributeId === se) return t;
627
898
  if (e.attributeId === "title")
628
- return [...t].sort((o, r) => at(o.title.localeCompare(r.title), e.direction));
899
+ return [...t].sort((o, r) => ft(o.title.localeCompare(r.title), e.direction));
629
900
  const i = ae(n, e.attributeId);
630
- return i ? [...t].sort((o, r) => at(_n(o, r, i), e.direction)) : t;
631
- }, Mi = (t, e) => {
901
+ return i ? [...t].sort((o, r) => ft(Nn(o, r, i), e.direction)) : t;
902
+ }, Ni = (t, e) => {
632
903
  const {
633
904
  attributes: n,
634
905
  columnGrouping: i,
@@ -638,11 +909,11 @@ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Arr
638
909
  if (r)
639
910
  for (const d of r) u.set(d, []);
640
911
  for (const d of t) {
641
- const f = lt(d, l, i);
912
+ const f = ut(d, l, i);
642
913
  u.set(f, [...u.get(f) ?? [], d]);
643
914
  }
644
- return [...u.entries()].sort(([d], [f]) => st(d, f, l)).map(([d, f]) => {
645
- const m = rt(d, l);
915
+ return [...u.entries()].sort(([d], [f]) => dt(d, f, l)).map(([d, f]) => {
916
+ const m = at(d, l);
646
917
  if (o === W)
647
918
  return {
648
919
  key: d,
@@ -652,12 +923,12 @@ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Arr
652
923
  };
653
924
  const g = /* @__PURE__ */ new Map();
654
925
  for (const y of f) {
655
- const v = lt(y, s, o);
926
+ const v = ut(y, s, o);
656
927
  g.set(v, [...g.get(v) ?? [], y]);
657
928
  }
658
- const p = [...g.entries()].sort(([y], [v]) => st(y, v, s)).map(([y, v]) => ({
929
+ const p = [...g.entries()].sort(([y], [v]) => dt(y, v, s)).map(([y, v]) => ({
659
930
  key: y,
660
- label: rt(y, s) || ke(y || Rn),
931
+ label: at(y, s) || ke(y || $n),
661
932
  rows: v
662
933
  }));
663
934
  return {
@@ -667,296 +938,23 @@ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Arr
667
938
  subgroups: p
668
939
  };
669
940
  });
670
- }, Gn = (t, e, n) => {
941
+ }, Bn = (t, e, n) => {
671
942
  const i = de(t, e), o = qe(e, n);
672
943
  return i.some((r) => o.includes(r));
673
- }, zi = (t, e, n) => {
944
+ }, Bi = (t, e, n) => {
674
945
  const i = Object.entries(e).filter((o) => Array.isArray(o[1]) && o[1].length > 0);
675
946
  return i.length === 0 ? t : t.filter((o) => i.every(([r, l]) => {
676
947
  const s = ae(n, r);
677
- return s ? Gn(o, s, l) : !0;
948
+ return s ? Bn(o, s, l) : !0;
678
949
  }));
679
- }, Dn = (t, e, n) => {
950
+ }, Mn = (t, e, n) => {
680
951
  const i = {}, o = ae(n, e);
681
952
  if (!o) return i;
682
953
  for (const r of t)
683
954
  for (const l of de(r, o))
684
955
  i[l] = (i[l] ?? 0) + 1;
685
956
  return i;
686
- }, ht = (t) => ({
687
- ...t,
688
- ordering: {
689
- ...t.ordering
690
- },
691
- displayProperties: [...t.displayProperties]
692
- }), yt = (t) => Object.fromEntries(Object.entries(t).map(([e, n]) => [e, [...n]])), _e = (t, e, n, i = !1) => ({
693
- id: t,
694
- title: e,
695
- settings: ht(n.settings),
696
- filters: yt(n.filters),
697
- ...i ? {
698
- isDefault: !0
699
- } : {}
700
- }), Ce = (t) => ({
701
- settings: ht(t.settings),
702
- filters: yt(t.filters)
703
- }), ct = (t) => ({
704
- viewMode: t.viewMode,
705
- columnGrouping: t.columnGrouping,
706
- rowGrouping: t.rowGrouping,
707
- ordering: t.ordering,
708
- displayProperties: [...t.displayProperties].sort()
709
- }), ut = (t) => Object.fromEntries(Object.entries(t).filter(([, e]) => e.length > 0).sort(([e], [n]) => e.localeCompare(n)).map(([e, n]) => [e, [...n].sort()])), Pn = (t, e) => t ? JSON.stringify(ct(t.settings)) !== JSON.stringify(ct(e.settings)) || JSON.stringify(ut(t.filters)) !== JSON.stringify(ut(e.filters)) : !1, Fn = "pstdio/ui/kanban-renderer", Tn = (t) => `${Fn}/${t}`, Me = {
710
- settings: nn,
711
- filters: {},
712
- expandedGroups: {}
713
- }, dt = (t) => {
714
- const e = {
715
- ...Me.settings,
716
- ...t?.settings ?? {}
717
- }, n = t?.filters ?? Me.filters, i = t?.views ?? [], o = i.length > 0 ? i : [_e("default", "All", {
718
- settings: e,
719
- filters: n
720
- }, !0)], l = o.find((s) => s.id === t?.activeViewId) ?? o.find((s) => s.isDefault) ?? o[0];
721
- return {
722
- ...Ce(l),
723
- expandedGroups: t?.expandedGroups ?? Me.expandedGroups,
724
- views: o,
725
- activeViewId: l.id
726
- };
727
- }, En = (t, e) => t.includes(e) ? t.filter((n) => n !== e) : [...t, e], Ve = (t) => t.startsWith("tag:") ? t.slice(4) : t, $n = (t) => {
728
- const e = t.ordering, n = typeof e?.attributeId == "string" ? e.attributeId : typeof e?.field == "string" ? Ve(e.field) : se, i = e?.direction === "desc" ? "desc" : "asc", o = typeof t.columnGrouping == "string" ? Ve(t.columnGrouping) : W, r = typeof t.rowGrouping == "string" ? Ve(t.rowGrouping) : W, l = Array.isArray(t.displayProperties) ? t.displayProperties.filter((s) => typeof s == "string").map(Ve) : [];
729
- return {
730
- viewMode: t.viewMode === "list" ? "list" : "board",
731
- columnGrouping: o,
732
- rowGrouping: r,
733
- ordering: {
734
- attributeId: n === "manual" ? se : n,
735
- direction: i
736
- },
737
- displayProperties: l
738
- };
739
- }, Ln = (t) => {
740
- const e = {};
741
- for (const [n, i] of Object.entries(t)) {
742
- if (!Array.isArray(i)) continue;
743
- const o = i.filter((r) => typeof r == "string");
744
- o.length !== 0 && (e[Ve(n)] = o);
745
- }
746
- return e;
747
- }, Nn = (t) => {
748
- const {
749
- storageKey: e,
750
- initialState: n
751
- } = t, i = dt(n);
752
- return en()(Qt((o) => ({
753
- ...i,
754
- setViewMode: (r) => o((l) => ({
755
- ...l,
756
- settings: {
757
- ...l.settings,
758
- viewMode: r
759
- }
760
- })),
761
- setColumnGrouping: (r) => o((l) => ({
762
- ...l,
763
- settings: {
764
- ...l.settings,
765
- columnGrouping: r
766
- }
767
- })),
768
- setRowGrouping: (r) => o((l) => ({
769
- ...l,
770
- settings: {
771
- ...l.settings,
772
- rowGrouping: r
773
- }
774
- })),
775
- setOrdering: (r) => o((l) => ({
776
- ...l,
777
- settings: {
778
- ...l.settings,
779
- ordering: r
780
- }
781
- })),
782
- setOrderingAttributeId: (r) => o((l) => ({
783
- ...l,
784
- settings: {
785
- ...l.settings,
786
- ordering: {
787
- ...l.settings.ordering,
788
- attributeId: r
789
- }
790
- }
791
- })),
792
- setDisplayProperties: (r) => o((l) => ({
793
- ...l,
794
- settings: {
795
- ...l.settings,
796
- displayProperties: r
797
- }
798
- })),
799
- toggleSortDirection: () => o((r) => ({
800
- ...r,
801
- settings: {
802
- ...r.settings,
803
- ordering: {
804
- ...r.settings.ordering,
805
- direction: r.settings.ordering.direction === "asc" ? "desc" : "asc"
806
- }
807
- }
808
- })),
809
- toggleDisplayProperty: (r) => o((l) => {
810
- const s = l.settings.displayProperties.includes(r) ? l.settings.displayProperties.filter((u) => u !== r) : [...l.settings.displayProperties, r];
811
- return {
812
- ...l,
813
- settings: {
814
- ...l.settings,
815
- displayProperties: s
816
- }
817
- };
818
- }),
819
- setFilter: (r, l) => o((s) => ({
820
- ...s,
821
- filters: {
822
- ...s.filters,
823
- [r]: l
824
- }
825
- })),
826
- toggleFilterValue: (r, l) => o((s) => {
827
- const u = s.filters[r] ?? [], c = En(u, l), d = c.length === 0 ? Ze(s.filters, r) : {
828
- ...s.filters,
829
- [r]: c
830
- };
831
- return {
832
- ...s,
833
- filters: d
834
- };
835
- }),
836
- clearFilter: (r) => o((l) => ({
837
- ...l,
838
- filters: Ze(l.filters, r)
839
- })),
840
- clearAllFilters: () => o((r) => ({
841
- ...r,
842
- filters: {}
843
- })),
844
- setExpandedGroup: (r, l) => o((s) => ({
845
- ...s,
846
- expandedGroups: {
847
- ...s.expandedGroups,
848
- [r]: l
849
- }
850
- })),
851
- activateView: (r) => o((l) => {
852
- const s = l.views.find((u) => u.id === r);
853
- return s ? {
854
- ...l,
855
- ...Ce(s),
856
- activeViewId: s.id,
857
- expandedGroups: {}
858
- } : l;
859
- }),
860
- createView: (r) => o((l) => {
861
- const s = _e(r.id, r.title, l);
862
- return {
863
- ...l,
864
- views: [...l.views, s],
865
- activeViewId: s.id
866
- };
867
- }),
868
- saveActiveView: () => o((r) => ({
869
- ...r,
870
- views: r.views.map((l) => l.id === r.activeViewId ? _e(l.id, l.title, r, l.isDefault) : l)
871
- })),
872
- resetActiveView: () => o((r) => {
873
- const l = r.views.find((s) => s.id === r.activeViewId);
874
- return l ? {
875
- ...r,
876
- ...Ce(l)
877
- } : r;
878
- }),
879
- renameView: (r, l) => o((s) => ({
880
- ...s,
881
- views: s.views.map((u) => u.id === r ? {
882
- ...u,
883
- title: l
884
- } : u)
885
- })),
886
- duplicateView: (r, l) => o((s) => {
887
- const u = s.views.find((d) => d.id === r);
888
- if (!u) return s;
889
- const c = _e(l.id, l.title, u);
890
- return {
891
- ...s,
892
- ...Ce(c),
893
- views: [...s.views, c],
894
- activeViewId: c.id,
895
- expandedGroups: {}
896
- };
897
- }),
898
- deleteView: (r) => o((l) => {
899
- if (l.views.length === 1) return l;
900
- const s = l.views.filter((c) => c.id !== r);
901
- if (s.length === l.views.length || l.activeViewId !== r) return {
902
- ...l,
903
- views: s
904
- };
905
- const u = s.find((c) => c.isDefault) ?? s[0];
906
- return {
907
- ...l,
908
- ...Ce(u),
909
- views: s,
910
- activeViewId: u.id,
911
- expandedGroups: {}
912
- };
913
- }),
914
- setDefaultView: (r) => o((l) => ({
915
- ...l,
916
- views: l.views.map((s) => ({
917
- ...s,
918
- isDefault: s.id === r || void 0
919
- }))
920
- })),
921
- reset: () => o(i)
922
- }), {
923
- name: Tn(e),
924
- version: 3,
925
- migrate: (o, r) => {
926
- if (!o || typeof o != "object") return o;
927
- const l = o;
928
- if (r >= 3)
929
- return {
930
- ...l,
931
- expandedGroups: {}
932
- };
933
- const s = $n(l.settings ?? {}), u = Ln(l.filters ?? {});
934
- return dt({
935
- settings: s,
936
- filters: u
937
- });
938
- },
939
- storage: Zt(tn),
940
- partialize: (o) => ({
941
- settings: o.settings,
942
- filters: o.filters,
943
- views: o.views,
944
- activeViewId: o.activeViewId
945
- })
946
- }));
947
- }, ft = /* @__PURE__ */ new Map(), Bn = (t, e) => {
948
- const n = ft.get(t);
949
- if (n) return n;
950
- const i = Nn({
951
- storageKey: t,
952
- initialState: e
953
- });
954
- return ft.set(t, i), i;
955
- }, D = (t, e, n) => {
956
- const i = Y(3);
957
- let o;
958
- return i[0] !== n || i[1] !== t ? (o = Bn(t, n), i[0] = n, i[1] = t, i[2] = o) : o = i[2], Yt(o, e);
959
- }, Mn = (t) => Pn(t.views.find((e) => e.id === t.activeViewId), t), zn = (t) => {
957
+ }, zn = (t) => {
960
958
  let e = t.length + 1;
961
959
  for (; t.some((n) => n.id === `view-${e.toString()}`); ) e += 1;
962
960
  return {
@@ -1060,7 +1058,7 @@ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Arr
1060
1058
  filterControl: l,
1061
1059
  displayControl: s,
1062
1060
  align: u
1063
- } = t, c = u === void 0 ? "split" : u, d = D(n, Hn), f = D(n, qn), m = D(n, Mn), g = D(n, Jn), p = D(n, Yn), y = D(n, Qn), v = D(n, Zn), S = D(n, ei), A = D(n, ti), I = D(n, ni), _ = D(n, ii), [w, P] = xe();
1061
+ } = t, c = u === void 0 ? "split" : u, d = D(n, Hn), f = D(n, qn), m = D(n, _n), g = D(n, Jn), p = D(n, Yn), y = D(n, Qn), v = D(n, Zn), S = D(n, ei), A = D(n, ti), I = D(n, ni), _ = D(n, ii), [w, P] = xe();
1064
1062
  let x;
1065
1063
  e[0] !== o ? (x = Object.entries(o).filter(ri), e[0] = o, e[1] = x) : x = e[1];
1066
1064
  const z = x, K = m || z.length > 0;
@@ -1089,7 +1087,7 @@ const W = "none", se = "manual", Ue = (t) => !Array.isArray(t), Pi = (t) => !Arr
1089
1087
  let G;
1090
1088
  if (e[8] !== O || e[9] !== f || e[10] !== m || e[11] !== d) {
1091
1089
  let b;
1092
- e[13] !== O || e[14] !== f || e[15] !== m ? (b = (V) => /* @__PURE__ */ a(Jt, { actions: O(V), positioning: {
1090
+ e[13] !== O || e[14] !== f || e[15] !== m ? (b = (V) => /* @__PURE__ */ a(Yt, { actions: O(V), positioning: {
1093
1091
  placement: "bottom-start"
1094
1092
  }, children: /* @__PURE__ */ h($e.Trigger, { value: V.id, children: [
1095
1093
  V.title,
@@ -1208,7 +1206,7 @@ const oi = (t) => {
1208
1206
  function ai(t) {
1209
1207
  return t + 1;
1210
1208
  }
1211
- const ji = (t) => {
1209
+ const Mi = (t) => {
1212
1210
  const e = Y(42), {
1213
1211
  rows: n,
1214
1212
  storageKey: i,
@@ -1239,13 +1237,13 @@ const ji = (t) => {
1239
1237
  }, e[6] = u, e[7] = l, e[8] = r, e[9] = s, e[10] = _) : _ = e[10];
1240
1238
  const w = _, P = D(i, ci, w), x = D(i, ui, w), z = D(i, di, w), K = D(i, fi, w), $ = D(i, gi, w), O = D(i, mi, w), L = D(i, pi, w), G = D(i, bi, w), R = D(i, hi, w), F = D(i, yi, w), T = D(i, vi, w);
1241
1239
  let C, j;
1242
- e[11] !== g || e[12] !== n ? (C = hn(g, n), j = Object.fromEntries(C.map((V) => [V.id, Dn(n, V.id, g)])), e[11] = g, e[12] = n, e[13] = C, e[14] = j) : (C = e[13], j = e[14]);
1240
+ e[11] !== g || e[12] !== n ? (C = hn(g, n), j = Object.fromEntries(C.map((V) => [V.id, Mn(n, V.id, g)])), e[11] = g, e[12] = n, e[13] = C, e[14] = j) : (C = e[13], j = e[14]);
1243
1241
  const N = j;
1244
1242
  let X;
1245
- e[15] !== C || e[16] !== T || e[17] !== F || e[18] !== N || e[19] !== x || e[20] !== R ? (X = /* @__PURE__ */ a(In, { categories: C, filters: x, countsByCategory: N, onToggleFilterValue: R, onClearFilter: F, onClearAll: T }), e[15] = C, e[16] = T, e[17] = F, e[18] = N, e[19] = x, e[20] = R, e[21] = X) : X = e[21];
1243
+ e[15] !== C || e[16] !== T || e[17] !== F || e[18] !== N || e[19] !== x || e[20] !== R ? (X = /* @__PURE__ */ a(En, { categories: C, filters: x, countsByCategory: N, onToggleFilterValue: R, onClearFilter: F, onClearAll: T }), e[15] = C, e[16] = T, e[17] = F, e[18] = N, e[19] = x, e[20] = R, e[21] = X) : X = e[21];
1246
1244
  const B = X;
1247
1245
  let E;
1248
- e[22] !== d || e[23] !== I || e[24] !== y || e[25] !== S || e[26] !== K || e[27] !== O || e[28] !== $ || e[29] !== z || e[30] !== P || e[31] !== G || e[32] !== L ? (E = d === void 0 ? /* @__PURE__ */ a(xn, { settings: P, groupingOptions: y, orderingOptions: S, displayPropertyOptions: I, onViewModeChange: z, onColumnGroupingChange: K, onRowGroupingChange: $, onOrderingAttributeIdChange: O, onSortDirectionToggle: L, onDisplayPropertyToggle: G }) : d, e[22] = d, e[23] = I, e[24] = y, e[25] = S, e[26] = K, e[27] = O, e[28] = $, e[29] = z, e[30] = P, e[31] = G, e[32] = L, e[33] = E) : E = e[33];
1246
+ e[22] !== d || e[23] !== I || e[24] !== y || e[25] !== S || e[26] !== K || e[27] !== O || e[28] !== $ || e[29] !== z || e[30] !== P || e[31] !== G || e[32] !== L ? (E = d === void 0 ? /* @__PURE__ */ a(Gn, { settings: P, groupingOptions: y, orderingOptions: S, displayPropertyOptions: I, onViewModeChange: z, onColumnGroupingChange: K, onRowGroupingChange: $, onOrderingAttributeIdChange: O, onSortDirectionToggle: L, onDisplayPropertyToggle: G }) : d, e[22] = d, e[23] = I, e[24] = y, e[25] = S, e[26] = K, e[27] = O, e[28] = $, e[29] = z, e[30] = P, e[31] = G, e[32] = L, e[33] = E) : E = e[33];
1249
1247
  const M = E;
1250
1248
  let b;
1251
1249
  return e[34] !== m || e[35] !== C || e[36] !== B || e[37] !== x || e[38] !== c || e[39] !== M || e[40] !== i ? (b = /* @__PURE__ */ a(Un, { storageKey: i, categories: C, filters: x, leading: c, filterControl: B, displayControl: M, align: m }), e[34] = m, e[35] = C, e[36] = B, e[37] = x, e[38] = c, e[39] = M, e[40] = i, e[41] = b) : b = e[41], b;
@@ -1284,35 +1282,35 @@ function vi(t) {
1284
1282
  return t.clearAllFilters;
1285
1283
  }
1286
1284
  export {
1287
- xn as D,
1288
- In as F,
1289
- ji as K,
1285
+ Gn as D,
1286
+ En as F,
1287
+ Mi as K,
1290
1288
  se as M,
1291
1289
  W as N,
1292
- Fi as a,
1293
- He as b,
1294
- Ti as c,
1295
- D as d,
1296
- zi as e,
1297
- ae as f,
1290
+ Di as a,
1291
+ ae as b,
1292
+ Pi as c,
1293
+ He as d,
1294
+ si as e,
1295
+ Bi as f,
1298
1296
  ee as g,
1299
- $i as h,
1300
- Mi as i,
1297
+ Ti as h,
1298
+ Ni as i,
1301
1299
  wn as j,
1302
1300
  hn as k,
1303
1301
  yn as l,
1304
1302
  vn as m,
1305
1303
  de as n,
1306
- Bi as o,
1304
+ Li as o,
1307
1305
  ue as p,
1308
- Mn as q,
1309
- Ei as r,
1310
- Pi as s,
1306
+ _n as q,
1307
+ Fi as r,
1308
+ Gi as s,
1311
1309
  Ue as t,
1312
- si as u,
1310
+ D as u,
1313
1311
  bn as v,
1314
1312
  li as w,
1315
- Ni as x,
1316
- Li as y
1313
+ $i as x,
1314
+ Ei as y
1317
1315
  };
1318
- //# sourceMappingURL=kanban-renderer-toolbar-Bcj_N1qr.js.map
1316
+ //# sourceMappingURL=kanban-renderer-toolbar-BcUZvGyY.js.map