@anzusystems/common-admin 2.0.0-rc.20 → 2.0.0-rc.21

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.
@@ -46,6 +46,12 @@ export interface UseLiveListingOptions<T> {
46
46
  minIntervalMs?: number;
47
47
  /** Wait after a signal, so a burst of signals ends in one probe. */
48
48
  debounceMs?: number;
49
+ /**
50
+ * Whether the list is loading, for loads not started by the pill (a filter, the user's own change): a change
51
+ * signalled after such a load started stays offered after its `markLoaded`, as the load may have read the record
52
+ * before it changed. Without it such a load forgets every change offered.
53
+ */
54
+ loading?: MaybeRefOrGetter<boolean>;
49
55
  }
50
56
  /** Orders newness keys: numbers by value, strings (UTC datetimes in one format) as text. */
51
57
  export declare const compareLiveListingKeys: (a: LiveListingKey, b: LiveListingKey) => number;
@@ -1,142 +1,149 @@
1
1
  import { computed as e, onScopeDispose as t, readonly as n, ref as r, shallowRef as i, toValue as a, watch as o } from "vue";
2
- import { useDocumentVisibility as s } from "@vueuse/core";
2
+ import { useDocumentVisibility as ee } from "@vueuse/core";
3
3
  // src/domains/filters/datatable/composables/useLiveListing.ts
4
- var c = {
4
+ var s = {
5
5
  visibleMs: 1e4,
6
6
  hiddenMs: 6e4
7
- }, l = 2e3, ee = 6e4, u = (e, t) => {
7
+ }, te = 2e3, c = 6e4, l = (e, t) => {
8
8
  if (typeof e == "number" && typeof t == "number") return e - t;
9
9
  let n = String(e), r = String(t);
10
10
  return n === r ? 0 : n < r ? -1 : 1;
11
- }, te = (e) => {
11
+ }, ne = (e) => {
12
12
  try {
13
13
  return JSON.stringify(e) ?? "";
14
14
  } catch {
15
15
  return String(e);
16
16
  }
17
17
  };
18
- function d(c) {
19
- let d = c.max ?? 9, f = c.minIntervalMs ?? 1e4, p = c.debounceMs ?? 1500, m = c.newness ?? "newer", h = Math.max(c.probeLimit ?? d + 1, d + 1), g = () => a(c.interval) ?? !1, _ = r(0), v = r(!1), y = r(!1), b = e(() => _.value > d), ne = e(() => _.value === 0 ? "" : b.value ? `${d}+` : String(_.value)), x, S = i(void 0), C = (e) => {
20
- x = e, S.value = e;
21
- }, w, T = /* @__PURE__ */ new Set(), E = 0, D, O, k = !1, A = 0, j, M, N, P = 0, F = !1, I = 0, L = 0, R, z, B = !1, V = s(), re = (e) => m === "unseen" ? x !== void 0 && !T.has(e) : x === null || x !== void 0 && u(e, x) > 0, H = (e, t) => {
22
- w !== t && T.clear(), (w !== t || x == null || e !== null && u(e, x) > 0) && C(e), w = t;
23
- }, U = (e) => {
24
- m === "unseen" && e.forEach((e) => T.add(c.key(e)));
25
- }, W = (e) => e.reduce((e, t) => {
26
- let n = c.key(t);
27
- return e === null || u(n, e) > 0 ? n : e;
28
- }, null), G = () => {
29
- D?.abort(), D = void 0, O = void 0, k = !1;
18
+ function u(s) {
19
+ let u = s.max ?? 9, d = s.minIntervalMs ?? 1e4, re = s.debounceMs ?? 1500, f = s.newness ?? "newer", p = Math.max(s.probeLimit ?? u + 1, u + 1), m = () => a(s.interval) ?? !1, h = r(0), g = r(!1), _ = r(!1), v = e(() => h.value > u), ie = e(() => h.value === 0 ? "" : v.value ? `${u}+` : String(h.value)), y, b = i(void 0), x = (e) => {
20
+ y = e, b.value = e;
21
+ }, S, C = /* @__PURE__ */ new Set(), w, T = 0, E, D, O = !1, k = 0, A, j, M, N = 0, P = !1, F = 0, I = 0, L, R, z, B = !1, V = ee(), ae = (e) => f === "unseen" ? y !== void 0 && !C.has(e) && (w === void 0 || l(e, w) > 0) : y === null || y !== void 0 && l(e, y) > 0, H = (e, t) => {
22
+ S !== t && C.clear(), (S !== t || y == null || e !== null && l(e, y) > 0) && x(e), S = t;
23
+ }, U = (e) => e.reduce((e, t) => {
24
+ let n = s.key(t);
25
+ return e === null || l(n, e) > 0 ? n : e;
26
+ }, null), oe = (e) => e.reduce((e, t) => {
27
+ let n = s.key(t);
28
+ return e === void 0 || l(n, e) < 0 ? n : e;
29
+ }, void 0), W = (e) => {
30
+ f === "unseen" && (e.forEach((e) => C.add(s.key(e))), w = e.length >= p ? oe(e) : void 0);
31
+ }, G = () => {
32
+ E?.abort(), E = void 0, D = void 0, O = !1;
30
33
  }, K = () => {
31
- clearTimeout(j), clearTimeout(M), clearTimeout(N), j = void 0, M = void 0, N = void 0;
34
+ clearTimeout(A), clearTimeout(j), clearTimeout(M), A = void 0, j = void 0, M = void 0;
32
35
  }, q = (e) => {
33
- if (clearTimeout(N), B) return;
34
- let t = Math.min(f * 2 ** P, ee);
35
- P += 1, N = setTimeout(() => {
36
- N = void 0, e();
36
+ if (clearTimeout(M), B) return;
37
+ let t = Math.min(d * 2 ** N, c);
38
+ N += 1, M = setTimeout(() => {
39
+ M = void 0, e();
37
40
  }, t);
38
41
  }, J = () => {
39
- P = 0, clearTimeout(N), N = void 0, v.value = !1;
42
+ N = 0, clearTimeout(M), M = void 0, g.value = !1;
40
43
  }, Y = () => {
41
- F && (F = !1, Q());
44
+ P && (P = !1, Q());
42
45
  }, X = () => {
43
- clearTimeout(j), j = void 0;
44
- let e = g();
45
- if (!e || B || b.value || x === void 0) return;
46
+ clearTimeout(A), A = void 0;
47
+ let e = m();
48
+ if (!e || B || v.value || y === void 0) return;
46
49
  let t = V.value === "hidden" ? e.hiddenMs : e.visibleMs;
47
- j = setTimeout(async () => {
48
- j = void 0, await Z(), X();
50
+ A = setTimeout(async () => {
51
+ A = void 0, await Z(), X();
49
52
  }, t);
50
53
  }, Z = async () => {
51
- if (B || x === void 0 || b.value) return;
52
- if (D) {
53
- k = !0;
54
+ if (B || y === void 0 || v.value) return;
55
+ if (E) {
56
+ O = !0;
54
57
  return;
55
58
  }
56
- let e = E, t = new AbortController();
57
- D = t, O = t, A = Date.now();
59
+ let e = T, t = new AbortController();
60
+ E = t, D = t, k = Date.now();
58
61
  try {
59
- let n = await c.probe({
60
- limit: h,
62
+ let n = await s.probe({
63
+ limit: p,
61
64
  signal: t.signal
62
65
  });
63
- if (t.signal.aborted || e !== E) return;
64
- _.value = n.filter((e) => re(c.key(e))).length, J(), b.value && K();
66
+ if (t.signal.aborted || e !== T) return;
67
+ h.value = n.filter((e) => ae(s.key(e))).length, J(), v.value && K();
65
68
  } catch {
66
- if (t.signal.aborted || e !== E) return;
67
- v.value = !0, g() || q(() => void Z());
69
+ if (t.signal.aborted || e !== T) return;
70
+ g.value = !0, m() || q(() => void Z());
68
71
  } finally {
69
- D === t && (D = void 0), O === t && (O = void 0), k && !t.signal.aborted && (k = !1, Q());
72
+ E === t && (E = void 0), D === t && (D = void 0), O && !t.signal.aborted && (O = !1, Q());
70
73
  }
71
74
  }, Q = () => {
72
- if (B || b.value) return;
73
- if (x === void 0) {
74
- F = !0;
75
+ if (B || v.value) return;
76
+ if (y === void 0) {
77
+ P = !0;
75
78
  return;
76
79
  }
77
- if (M) return;
78
- let e = Math.max(p, A + f - Date.now());
79
- M = setTimeout(() => {
80
- M = void 0, Z();
80
+ if (j) return;
81
+ let e = Math.max(re, k + d - Date.now());
82
+ j = setTimeout(() => {
83
+ j = void 0, Z();
81
84
  }, e);
82
- }, ie = () => {
83
- B || (I += 1, Q());
85
+ }, se = () => {
86
+ B || (F += 1, Q());
84
87
  }, $ = async (e, t) => {
85
88
  let n = new AbortController();
86
- D = n;
89
+ E = n;
87
90
  try {
88
- let r = m === "unseen" ? h : 1, i = await c.probe({
91
+ let r = f === "unseen" ? p : 1, i = await s.probe({
89
92
  limit: r,
90
93
  signal: n.signal
91
94
  });
92
- if (n.signal.aborted || t !== E) return;
93
- H(W(i), e), U(i), J(), X(), Y();
95
+ if (n.signal.aborted || t !== T) return;
96
+ H(U(i), e), W(i), J(), X(), Y();
94
97
  } catch {
95
- if (n.signal.aborted || t !== E) return;
96
- v.value = !0, q(() => {
97
- t === E && $(e, t);
98
+ if (n.signal.aborted || t !== T) return;
99
+ g.value = !0, q(() => {
100
+ t === T && $(e, t);
98
101
  });
99
102
  } finally {
100
- D === n && (D = void 0), k && !n.signal.aborted && (k = !1, Q());
103
+ E === n && (E = void 0), O && !n.signal.aborted && (O = !1, Q());
101
104
  }
102
- }, ae = () => M !== void 0 || k || O !== void 0 || (R === void 0 ? _.value > 0 : I > R), oe = (e, t) => {
103
- E += 1, ae() && (F = !0), y.value = R !== void 0 && L > R, G(), K(), _.value = 0, P = 0, v.value = !1;
104
- let n = te(a(c.scope)), r = t.newestFirst ? e : t.newest;
105
- r ? (H(W(r), n), U(r), X(), Y()) : (C(void 0), X(), $(n, E));
106
- }, se = () => {
107
- B || E === 0 || (I += 1, L = I, y.value = !0);
108
- }, ce = async () => {
109
- (M !== void 0 || k || O !== void 0) && (F = !0), O &&= (O.abort(), D === O && (D = void 0), void 0), k = !1, clearTimeout(j), clearTimeout(M), j = void 0, M = void 0;
110
- let e = E;
111
- R = I;
105
+ }, ce = () => j !== void 0 || O || D !== void 0 || (L === void 0 ? h.value > 0 : F > L), le = (e, t) => {
106
+ T += 1, ce() && (P = !0);
107
+ let n = L !== void 0 && R !== void 0 ? Math.min(L, R) : L ?? R;
108
+ _.value = n !== void 0 && I > n, a(s.loading) || (R = void 0), G(), K(), h.value = 0, N = 0, g.value = !1;
109
+ let r = ne(a(s.scope)), i = t.newestFirst ? e : t.newest;
110
+ i ? (H(U(i), r), W(i), X(), Y()) : (x(void 0), X(), $(r, T));
111
+ }, ue = () => {
112
+ B || T === 0 || (F += 1, I = F, _.value = !0);
113
+ }, de = async () => {
114
+ (j !== void 0 || O || D !== void 0) && (P = !0), D &&= (D.abort(), E === D && (E = void 0), void 0), O = !1, clearTimeout(A), clearTimeout(j), A = void 0, j = void 0;
115
+ let e = T;
116
+ L = F, a(s.loading) || (R = void 0);
112
117
  try {
113
- await c.reload();
118
+ await s.reload();
114
119
  } finally {
115
- R = void 0, E === e && (X(), Y());
120
+ L = void 0, T === e && (X(), Y());
116
121
  }
117
122
  };
118
- return o(() => a(c.interval), () => {
119
- !B && x !== void 0 && X();
123
+ return s.loading !== void 0 && o(() => !!a(s.loading), (e, t) => {
124
+ e && !t && (R = F);
125
+ }, { flush: "sync" }), o(() => a(s.interval), () => {
126
+ !B && y !== void 0 && X();
120
127
  }), o(V, (e) => {
121
- B || x === void 0 || (e === "visible" && !b.value && Date.now() - A > l && Z(), X());
128
+ B || y === void 0 || (e === "visible" && !v.value && Date.now() - k > te && Z(), X());
122
129
  }), t(() => {
123
130
  B = !0, G(), K();
124
131
  }), {
125
- count: n(_),
126
- overflow: b,
127
- label: ne,
128
- failed: n(v),
129
- changed: n(y),
130
- baseline: n(S),
131
- max: d,
132
- markLoaded: oe,
133
- requestProbe: ie,
134
- markChanged: se,
135
- apply: () => (z ??= ce().finally(() => {
132
+ count: n(h),
133
+ overflow: v,
134
+ label: ie,
135
+ failed: n(g),
136
+ changed: n(_),
137
+ baseline: n(b),
138
+ max: u,
139
+ markLoaded: le,
140
+ requestProbe: se,
141
+ markChanged: ue,
142
+ apply: () => (z ??= de().finally(() => {
136
143
  z = void 0;
137
144
  }), z)
138
145
  };
139
146
  }
140
- export { c as LIVE_LISTING_INTERVAL, u as compareLiveListingKeys, d as useLiveListing };
147
+ export { s as LIVE_LISTING_INTERVAL, l as compareLiveListingKeys, u as useLiveListing };
141
148
 
142
149
  //# sourceMappingURL=useLiveListing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLiveListing.js","names":["LIVE_LISTING_INTERVAL","RETURN_PROBE_GAP_MS","MAX_RETRY_MS","compareLiveListingKeys","a","b","sa","sb","serializeScope","scope","useLiveListing","max","options","minIntervalMs","debounceMs","newness","probeLimit","currentInterval","toValue","count","ref","failed","changed","overflow","computed","label","baseline","baselineState","shallowRef","setBaseline","value","baselineScope","seenKeys","generation","controller","probeInFlight","rerun","lastProbeAt","intervalTimer","signalTimer","retryTimer","failures","probeWanted","signals","changedAtSignal","applyingFrom","applying","disposed","visibility","useDocumentVisibility","isNew","key","raiseBaseline","see","items","item","newestKey","newest","abortProbe","clearTimers","scheduleRetry","ms","run","succeeded","runWantedProbe","scheduleProbe","scheduleInterval","interval","runProbe","myGeneration","myController","wait","requestProbe","fetchBaseline","limit","signalPending","markLoaded","seenNewest","loaded","markChanged","reloadOnClick","loadsBefore","watch","onScopeDispose","readonly"],"sources":["../../../../../src/domains/filters/datatable/composables/useLiveListing.ts"],"sourcesContent":["import { useDocumentVisibility } from '@vueuse/core'\nimport { computed, onScopeDispose, readonly, ref, shallowRef, toValue, watch, type MaybeRefOrGetter } from 'vue'\n\nexport type LiveListingKey = number | string\n\nexport interface LiveListingProbeOptions {\n limit: number\n signal: AbortSignal\n}\n\nexport interface LiveListingInterval {\n /** Probe period while the browser tab is visible. */\n visibleMs: number\n /** Probe period while the browser tab is hidden, so a count in the browser title stays fresh. */\n hiddenMs: number\n}\n\n/**\n * How often a list without backend signals probes for new records: every 10 s while the browser tab is visible,\n * every minute while it is hidden, so a count in the browser title stays fresh.\n */\nexport const LIVE_LISTING_INTERVAL: LiveListingInterval = { visibleMs: 10_000, hiddenMs: 60_000 }\n\n/**\n * How a record counts as new: `newer` than the newest record the user has seen, or `unseen`, a record of the probe\n * the user has not seen listed, for listings where a record can enter with a key older than the newest one.\n */\nexport type LiveListingNewness = 'newer' | 'unseen'\n\nexport interface UseLiveListingOptions<T> {\n /**\n * Newest records under the current filters, newest first by `key`, at most `limit` of them.\n * It must leave the shown list alone and load nothing else for the rows.\n */\n probe: (options: LiveListingProbeOptions) => Promise<T[]>\n /** Newness key: an autoincrement id, or a UTC datetime string in one format. */\n key: (item: T) => LiveListingKey\n /** Fetches the list on the click of the pill and reports it back with `markLoaded`. */\n reload: () => Promise<void>\n /** What the user filters by. When it changes, the baseline is set anew; otherwise it never decreases. */\n scope?: MaybeRefOrGetter<unknown>\n /** Probes on a timer, for listings without a backend signal, or while it is down. */\n interval?: MaybeRefOrGetter<LiveListingInterval | false>\n newness?: LiveListingNewness\n /**\n * How many of the newest records a probe asks for. Default `max + 1`; with `unseen` newness give the page size,\n * as an unseen record can enter anywhere on the first page.\n */\n probeLimit?: number\n /** Highest count shown as a number, more is shown as `max+`. */\n max?: number\n /** Shortest gap between the start of two probes requested by signals. */\n minIntervalMs?: number\n /** Wait after a signal, so a burst of signals ends in one probe. */\n debounceMs?: number\n}\n\nconst RETURN_PROBE_GAP_MS = 2000\nconst MAX_RETRY_MS = 60_000\n\n/** Orders newness keys: numbers by value, strings (UTC datetimes in one format) as text. */\nexport const compareLiveListingKeys = (a: LiveListingKey, b: LiveListingKey) => {\n if (typeof a === 'number' && typeof b === 'number') return a - b\n const sa = String(a)\n const sb = String(b)\n if (sa === sb) return 0\n return sa < sb ? -1 : 1\n}\n\nconst serializeScope = (scope: unknown) => {\n try {\n return JSON.stringify(scope) ?? ''\n } catch {\n return String(scope)\n }\n}\n\n/**\n * Tells the user that new records exist under the current filters, without changing the list until they click.\n * A probe (a small list request, newest first) runs on a signal, on a timer or when the user returns to the\n * browser tab; its records newer than the baseline are the count. The baseline is the newest record the user\n * has seen, taken from every full load reported through `markLoaded`.\n */\nexport function useLiveListing<T>(options: UseLiveListingOptions<T>) {\n const max = options.max ?? 9\n const minIntervalMs = options.minIntervalMs ?? 10_000\n const debounceMs = options.debounceMs ?? 1500\n const newness = options.newness ?? 'newer'\n const probeLimit = Math.max(options.probeLimit ?? max + 1, max + 1)\n const currentInterval = () => toValue(options.interval) ?? false\n\n const count = ref(0)\n const failed = ref(false)\n const changed = ref(false)\n const overflow = computed(() => count.value > max)\n const label = computed(() => {\n if (count.value === 0) return ''\n return overflow.value ? `${max}+` : String(count.value)\n })\n\n // undefined: not known yet, nothing is probed; null: the filtered list was empty, every record is new.\n let baseline: LiveListingKey | null | undefined = undefined\n // The same, for callers that keep what the user has seen, e.g. for a count on an inactive tab.\n const baselineState = shallowRef<LiveListingKey | null | undefined>(undefined)\n const setBaseline = (value: LiveListingKey | null | undefined) => {\n baseline = value\n baselineState.value = value\n }\n let baselineScope: string | undefined = undefined\n // With `unseen` newness: the keys the user has seen listed under the baseline scope.\n const seenKeys = new Set<LiveListingKey>()\n // Bumped by every full load: answers of probes started before it are dropped.\n let generation = 0\n let controller: AbortController | undefined = undefined\n // The controller of a probe in flight, as opposed to a baseline fetch.\n let probeInFlight: AbortController | undefined = undefined\n let rerun = false\n let lastProbeAt = 0\n let intervalTimer: ReturnType<typeof setTimeout> | undefined = undefined\n let signalTimer: ReturnType<typeof setTimeout> | undefined = undefined\n // A failed probe or baseline fetch is tried again, less and less often, also when no interval runs.\n let retryTimer: ReturnType<typeof setTimeout> | undefined = undefined\n let failures = 0\n // A probe asked for while no baseline is known, or while a full load replaces the list: it runs once the list is.\n let probeWanted = false\n // Signals (`requestProbe`, `markChanged`) counted, so the pill's reload can tell those that came while it ran.\n let signals = 0\n let changedAtSignal = 0\n let applyingFrom: number | undefined = undefined\n let applying: Promise<void> | undefined = undefined\n let disposed = false\n\n const visibility = useDocumentVisibility()\n\n const isNew = (key: LiveListingKey) => {\n if (newness === 'unseen') return baseline !== undefined && !seenKeys.has(key)\n return baseline === null || (baseline !== undefined && compareLiveListingKeys(key, baseline) > 0)\n }\n\n const raiseBaseline = (key: LiveListingKey | null, scope: string) => {\n if (baselineScope !== scope) seenKeys.clear()\n if (baselineScope !== scope || baseline === undefined || baseline === null) {\n setBaseline(key)\n } else if (key !== null && compareLiveListingKeys(key, baseline) > 0) {\n setBaseline(key)\n }\n baselineScope = scope\n }\n\n const see = (items: T[]) => {\n if (newness === 'unseen') items.forEach((item) => seenKeys.add(options.key(item)))\n }\n\n const newestKey = (items: T[]) =>\n items.reduce<LiveListingKey | null>((newest, item) => {\n const key = options.key(item)\n return newest === null || compareLiveListingKeys(key, newest) > 0 ? key : newest\n }, null)\n\n const abortProbe = () => {\n controller?.abort()\n controller = undefined\n probeInFlight = undefined\n rerun = false\n }\n\n const clearTimers = () => {\n clearTimeout(intervalTimer)\n clearTimeout(signalTimer)\n clearTimeout(retryTimer)\n intervalTimer = undefined\n signalTimer = undefined\n retryTimer = undefined\n }\n\n const scheduleRetry = (run: () => void) => {\n clearTimeout(retryTimer)\n if (disposed) return\n const ms = Math.min(minIntervalMs * 2 ** failures, MAX_RETRY_MS)\n failures += 1\n retryTimer = setTimeout(() => {\n retryTimer = undefined\n run()\n }, ms)\n }\n\n const succeeded = () => {\n failures = 0\n clearTimeout(retryTimer)\n retryTimer = undefined\n failed.value = false\n }\n\n const runWantedProbe = () => {\n if (!probeWanted) return\n probeWanted = false\n scheduleProbe()\n }\n\n const scheduleInterval = () => {\n clearTimeout(intervalTimer)\n intervalTimer = undefined\n const interval = currentInterval()\n if (!interval || disposed || overflow.value || baseline === undefined) return\n const ms = visibility.value === 'hidden' ? interval.hiddenMs : interval.visibleMs\n intervalTimer = setTimeout(async () => {\n intervalTimer = undefined\n await runProbe()\n scheduleInterval()\n }, ms)\n }\n\n const runProbe = async () => {\n if (disposed || baseline === undefined || overflow.value) return\n if (controller) {\n rerun = true\n return\n }\n const myGeneration = generation\n const myController = new AbortController()\n controller = myController\n probeInFlight = myController\n lastProbeAt = Date.now()\n try {\n const items = await options.probe({ limit: probeLimit, signal: myController.signal })\n if (myController.signal.aborted || myGeneration !== generation) return\n count.value = items.filter((item) => isNew(options.key(item))).length\n succeeded()\n if (overflow.value) clearTimers()\n } catch {\n if (myController.signal.aborted || myGeneration !== generation) return\n failed.value = true\n // The interval tries again on its own; signals may not come for long.\n if (!currentInterval()) scheduleRetry(() => void runProbe())\n } finally {\n if (controller === myController) controller = undefined\n if (probeInFlight === myController) probeInFlight = undefined\n if (rerun && !myController.signal.aborted) {\n rerun = false\n scheduleProbe()\n }\n }\n }\n\n const scheduleProbe = () => {\n if (disposed || overflow.value) return\n if (baseline === undefined) {\n probeWanted = true\n return\n }\n if (signalTimer) return\n const wait = Math.max(debounceMs, lastProbeAt + minIntervalMs - Date.now())\n signalTimer = setTimeout(() => {\n signalTimer = undefined\n void runProbe()\n }, wait)\n }\n\n /** Asks for a probe, e.g. on a backend signal. A burst of requests ends in one probe. */\n const requestProbe = () => {\n if (disposed) return\n signals += 1\n scheduleProbe()\n }\n\n const fetchBaseline = async (scope: string, myGeneration: number) => {\n const myController = new AbortController()\n controller = myController\n try {\n // With `unseen` newness, what the probe would count is seen: the list the user looks at holds it.\n const limit = newness === 'unseen' ? probeLimit : 1\n const items = await options.probe({ limit, signal: myController.signal })\n if (myController.signal.aborted || myGeneration !== generation) return\n raiseBaseline(newestKey(items), scope)\n see(items)\n succeeded()\n scheduleInterval()\n runWantedProbe()\n } catch {\n if (myController.signal.aborted || myGeneration !== generation) return\n failed.value = true\n // Without a baseline nothing is probed, so the fetch itself is tried again.\n scheduleRetry(() => {\n if (myGeneration === generation) void fetchBaseline(scope, myGeneration)\n })\n } finally {\n if (controller === myController) controller = undefined\n if (rerun && !myController.signal.aborted) {\n rerun = false\n scheduleProbe()\n }\n }\n }\n\n // A probe still to run or running may announce records the load did not see; so may one that counted records\n // while the load ran, unknown outside the pill's reload, which knows when it started.\n const signalPending = () =>\n signalTimer !== undefined ||\n rerun ||\n probeInFlight !== undefined ||\n (applyingFrom !== undefined ? signals > applyingFrom : count.value > 0)\n\n /**\n * Reports a successful full load of the list: a filter, a sort, page 1 or a reload after the click.\n * `newestFirst`: the items are page 1 sorted newest first, so the newest of them is the baseline.\n * Otherwise `newest` gives it: what the probe returns under the loaded filters (one record, with `unseen` newness\n * `probeLimit`), asked for when the load started, so a record created while the list loaded is counted, at worst\n * one the list shows. Without it one probe after the load finds the baseline and takes such a record as seen.\n * A switch to another page needs no report.\n */\n const markLoaded = (items: T[], loaded: { newestFirst: boolean; newest?: T[] }) => {\n generation += 1\n if (signalPending()) probeWanted = true\n // A change signalled while the pill's reload ran may be newer than what it loaded.\n changed.value = applyingFrom !== undefined && changedAtSignal > applyingFrom\n abortProbe()\n clearTimers()\n count.value = 0\n failures = 0\n failed.value = false\n const scope = serializeScope(toValue(options.scope))\n const seenNewest = loaded.newestFirst ? items : loaded.newest\n if (seenNewest) {\n raiseBaseline(newestKey(seenNewest), scope)\n see(seenNewest)\n scheduleInterval()\n runWantedProbe()\n return\n }\n // No probe runs until the new baseline is known: under other filters the old one means nothing, under the same\n // ones it may be older than the rows shown, so a probe would count them.\n setBaseline(undefined)\n scheduleInterval()\n void fetchBaseline(scope, generation)\n }\n\n /**\n * Asks the user to reload the list because records already in it changed, e.g. moved to another tab or got\n * another status, which no count shows. The pill offers it while nothing new is counted.\n */\n const markChanged = () => {\n // Before the first load nothing is shown that could change.\n if (disposed || generation === 0) return\n signals += 1\n changedAtSignal = signals\n changed.value = true\n }\n\n const reloadOnClick = async () => {\n if (signalTimer !== undefined || rerun || probeInFlight !== undefined) probeWanted = true\n // Only probes stop: a baseline still being fetched is needed when the reload fails.\n if (probeInFlight) {\n probeInFlight.abort()\n if (controller === probeInFlight) controller = undefined\n probeInFlight = undefined\n }\n rerun = false\n clearTimeout(intervalTimer)\n clearTimeout(signalTimer)\n intervalTimer = undefined\n signalTimer = undefined\n const loadsBefore = generation\n applyingFrom = signals\n try {\n await options.reload()\n } finally {\n applyingFrom = undefined\n // A fetched list reported itself through `markLoaded`, which started the counting anew. Without one nothing\n // was shown: the pill keeps what it offered and the looking goes on.\n if (generation === loadsBefore) {\n scheduleInterval()\n runWantedProbe()\n }\n }\n }\n\n /**\n * The click on the pill: reloads the list and starts counting again from it. A click while the reload runs\n * waits for the same reload.\n */\n const apply = () => {\n applying ??= reloadOnClick().finally(() => {\n applying = undefined\n })\n return applying\n }\n\n watch(\n () => toValue(options.interval),\n () => {\n if (!disposed && baseline !== undefined) scheduleInterval()\n }\n )\n\n watch(visibility, (value) => {\n if (disposed || baseline === undefined) return\n if (value === 'visible' && !overflow.value && Date.now() - lastProbeAt > RETURN_PROBE_GAP_MS) {\n void runProbe()\n }\n scheduleInterval()\n })\n\n onScopeDispose(() => {\n disposed = true\n abortProbe()\n clearTimers()\n })\n\n return {\n count: readonly(count),\n overflow,\n label,\n failed: readonly(failed),\n /** Records already listed changed; see `markChanged`. */\n changed: readonly(changed),\n /** The newest record the user has seen: `null` for an empty list, `undefined` before the first load. */\n baseline: readonly(baselineState),\n max,\n markLoaded,\n requestProbe,\n markChanged,\n apply,\n }\n}\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QAAQiE,EAAS/D,CAAM;EAEvB,SAAS+D,EAAS9D,CAAO;EAEzB,UAAU8D,EAASzD,CAAa;EAChC;EACA;EACA;EACA;EACA,cAxCA,MAAaqD,GAAc,CAAC,CAAC,cAAc;GACzC,IAAW,KAAA;EACb,CAAC,GACMlC;CAsCT;AACF"}
1
+ {"version":3,"file":"useLiveListing.js","names":["LIVE_LISTING_INTERVAL","RETURN_PROBE_GAP_MS","MAX_RETRY_MS","compareLiveListingKeys","a","b","sa","sb","serializeScope","scope","useLiveListing","max","options","minIntervalMs","debounceMs","newness","probeLimit","currentInterval","toValue","count","ref","failed","changed","overflow","computed","label","baseline","baselineState","shallowRef","setBaseline","value","baselineScope","seenKeys","seenFloor","generation","controller","probeInFlight","rerun","lastProbeAt","intervalTimer","signalTimer","retryTimer","failures","probeWanted","signals","changedAtSignal","applyingFrom","loadingFrom","applying","disposed","visibility","useDocumentVisibility","isNew","key","raiseBaseline","newestKey","items","item","newest","oldestKey","oldest","see","abortProbe","clearTimers","scheduleRetry","ms","run","succeeded","runWantedProbe","scheduleProbe","scheduleInterval","interval","runProbe","myGeneration","myController","wait","requestProbe","fetchBaseline","limit","signalPending","markLoaded","loadFrom","seenNewest","loaded","markChanged","reloadOnClick","loadsBefore","watch","before","onScopeDispose","readonly"],"sources":["../../../../../src/domains/filters/datatable/composables/useLiveListing.ts"],"sourcesContent":["import { useDocumentVisibility } from '@vueuse/core'\nimport { computed, onScopeDispose, readonly, ref, shallowRef, toValue, watch, type MaybeRefOrGetter } from 'vue'\n\nexport type LiveListingKey = number | string\n\nexport interface LiveListingProbeOptions {\n limit: number\n signal: AbortSignal\n}\n\nexport interface LiveListingInterval {\n /** Probe period while the browser tab is visible. */\n visibleMs: number\n /** Probe period while the browser tab is hidden, so a count in the browser title stays fresh. */\n hiddenMs: number\n}\n\n/**\n * How often a list without backend signals probes for new records: every 10 s while the browser tab is visible,\n * every minute while it is hidden, so a count in the browser title stays fresh.\n */\nexport const LIVE_LISTING_INTERVAL: LiveListingInterval = { visibleMs: 10_000, hiddenMs: 60_000 }\n\n/**\n * How a record counts as new: `newer` than the newest record the user has seen, or `unseen`, a record of the probe\n * the user has not seen listed, for listings where a record can enter with a key older than the newest one.\n */\nexport type LiveListingNewness = 'newer' | 'unseen'\n\nexport interface UseLiveListingOptions<T> {\n /**\n * Newest records under the current filters, newest first by `key`, at most `limit` of them.\n * It must leave the shown list alone and load nothing else for the rows.\n */\n probe: (options: LiveListingProbeOptions) => Promise<T[]>\n /** Newness key: an autoincrement id, or a UTC datetime string in one format. */\n key: (item: T) => LiveListingKey\n /** Fetches the list on the click of the pill and reports it back with `markLoaded`. */\n reload: () => Promise<void>\n /** What the user filters by. When it changes, the baseline is set anew; otherwise it never decreases. */\n scope?: MaybeRefOrGetter<unknown>\n /** Probes on a timer, for listings without a backend signal, or while it is down. */\n interval?: MaybeRefOrGetter<LiveListingInterval | false>\n newness?: LiveListingNewness\n /**\n * How many of the newest records a probe asks for. Default `max + 1`; with `unseen` newness give the page size,\n * as an unseen record can enter anywhere on the first page.\n */\n probeLimit?: number\n /** Highest count shown as a number, more is shown as `max+`. */\n max?: number\n /** Shortest gap between the start of two probes requested by signals. */\n minIntervalMs?: number\n /** Wait after a signal, so a burst of signals ends in one probe. */\n debounceMs?: number\n /**\n * Whether the list is loading, for loads not started by the pill (a filter, the user's own change): a change\n * signalled after such a load started stays offered after its `markLoaded`, as the load may have read the record\n * before it changed. Without it such a load forgets every change offered.\n */\n loading?: MaybeRefOrGetter<boolean>\n}\n\nconst RETURN_PROBE_GAP_MS = 2000\nconst MAX_RETRY_MS = 60_000\n\n/** Orders newness keys: numbers by value, strings (UTC datetimes in one format) as text. */\nexport const compareLiveListingKeys = (a: LiveListingKey, b: LiveListingKey) => {\n if (typeof a === 'number' && typeof b === 'number') return a - b\n const sa = String(a)\n const sb = String(b)\n if (sa === sb) return 0\n return sa < sb ? -1 : 1\n}\n\nconst serializeScope = (scope: unknown) => {\n try {\n return JSON.stringify(scope) ?? ''\n } catch {\n return String(scope)\n }\n}\n\n/**\n * Tells the user that new records exist under the current filters, without changing the list until they click.\n * A probe (a small list request, newest first) runs on a signal, on a timer or when the user returns to the\n * browser tab; its records newer than the baseline are the count. The baseline is the newest record the user\n * has seen, taken from every full load reported through `markLoaded`.\n */\nexport function useLiveListing<T>(options: UseLiveListingOptions<T>) {\n const max = options.max ?? 9\n const minIntervalMs = options.minIntervalMs ?? 10_000\n const debounceMs = options.debounceMs ?? 1500\n const newness = options.newness ?? 'newer'\n const probeLimit = Math.max(options.probeLimit ?? max + 1, max + 1)\n const currentInterval = () => toValue(options.interval) ?? false\n\n const count = ref(0)\n const failed = ref(false)\n const changed = ref(false)\n const overflow = computed(() => count.value > max)\n const label = computed(() => {\n if (count.value === 0) return ''\n return overflow.value ? `${max}+` : String(count.value)\n })\n\n // undefined: not known yet, nothing is probed; null: the filtered list was empty, every record is new.\n let baseline: LiveListingKey | null | undefined = undefined\n // The same, for callers that keep what the user has seen, e.g. for a count on an inactive tab.\n const baselineState = shallowRef<LiveListingKey | null | undefined>(undefined)\n const setBaseline = (value: LiveListingKey | null | undefined) => {\n baseline = value\n baselineState.value = value\n }\n let baselineScope: string | undefined = undefined\n // With `unseen` newness: the keys the user has seen listed under the baseline scope.\n const seenKeys = new Set<LiveListingKey>()\n // With `unseen` newness: the oldest record of the last full load when it filled the probe. An unseen record below\n // it reached the first page because listed ones left the filter, not because it entered.\n let seenFloor: LiveListingKey | undefined = undefined\n // Bumped by every full load: answers of probes started before it are dropped.\n let generation = 0\n let controller: AbortController | undefined = undefined\n // The controller of a probe in flight, as opposed to a baseline fetch.\n let probeInFlight: AbortController | undefined = undefined\n let rerun = false\n let lastProbeAt = 0\n let intervalTimer: ReturnType<typeof setTimeout> | undefined = undefined\n let signalTimer: ReturnType<typeof setTimeout> | undefined = undefined\n // A failed probe or baseline fetch is tried again, less and less often, also when no interval runs.\n let retryTimer: ReturnType<typeof setTimeout> | undefined = undefined\n let failures = 0\n // A probe asked for while no baseline is known, or while a full load replaces the list: it runs once the list is.\n let probeWanted = false\n // Signals (`requestProbe`, `markChanged`) counted, so the pill's reload can tell those that came while it ran.\n let signals = 0\n let changedAtSignal = 0\n let applyingFrom: number | undefined = undefined\n // The signals counted when the current or last load given by `loading` started.\n let loadingFrom: number | undefined = undefined\n let applying: Promise<void> | undefined = undefined\n let disposed = false\n\n const visibility = useDocumentVisibility()\n\n const isNew = (key: LiveListingKey) => {\n if (newness === 'unseen') {\n return (\n baseline !== undefined &&\n !seenKeys.has(key) &&\n (seenFloor === undefined || compareLiveListingKeys(key, seenFloor) > 0)\n )\n }\n return baseline === null || (baseline !== undefined && compareLiveListingKeys(key, baseline) > 0)\n }\n\n const raiseBaseline = (key: LiveListingKey | null, scope: string) => {\n if (baselineScope !== scope) seenKeys.clear()\n if (baselineScope !== scope || baseline === undefined || baseline === null) {\n setBaseline(key)\n } else if (key !== null && compareLiveListingKeys(key, baseline) > 0) {\n setBaseline(key)\n }\n baselineScope = scope\n }\n\n const newestKey = (items: T[]) =>\n items.reduce<LiveListingKey | null>((newest, item) => {\n const key = options.key(item)\n return newest === null || compareLiveListingKeys(key, newest) > 0 ? key : newest\n }, null)\n\n const oldestKey = (items: T[]) =>\n items.reduce<LiveListingKey | undefined>((oldest, item) => {\n const key = options.key(item)\n return oldest === undefined || compareLiveListingKeys(key, oldest) < 0 ? key : oldest\n }, undefined)\n\n const see = (items: T[]) => {\n if (newness !== 'unseen') return\n items.forEach((item) => seenKeys.add(options.key(item)))\n // Fewer records than the probe asks for were all there were under the filter, so nothing can slide in.\n seenFloor = items.length >= probeLimit ? oldestKey(items) : undefined\n }\n\n const abortProbe = () => {\n controller?.abort()\n controller = undefined\n probeInFlight = undefined\n rerun = false\n }\n\n const clearTimers = () => {\n clearTimeout(intervalTimer)\n clearTimeout(signalTimer)\n clearTimeout(retryTimer)\n intervalTimer = undefined\n signalTimer = undefined\n retryTimer = undefined\n }\n\n const scheduleRetry = (run: () => void) => {\n clearTimeout(retryTimer)\n if (disposed) return\n const ms = Math.min(minIntervalMs * 2 ** failures, MAX_RETRY_MS)\n failures += 1\n retryTimer = setTimeout(() => {\n retryTimer = undefined\n run()\n }, ms)\n }\n\n const succeeded = () => {\n failures = 0\n clearTimeout(retryTimer)\n retryTimer = undefined\n failed.value = false\n }\n\n const runWantedProbe = () => {\n if (!probeWanted) return\n probeWanted = false\n scheduleProbe()\n }\n\n const scheduleInterval = () => {\n clearTimeout(intervalTimer)\n intervalTimer = undefined\n const interval = currentInterval()\n if (!interval || disposed || overflow.value || baseline === undefined) return\n const ms = visibility.value === 'hidden' ? interval.hiddenMs : interval.visibleMs\n intervalTimer = setTimeout(async () => {\n intervalTimer = undefined\n await runProbe()\n scheduleInterval()\n }, ms)\n }\n\n const runProbe = async () => {\n if (disposed || baseline === undefined || overflow.value) return\n if (controller) {\n rerun = true\n return\n }\n const myGeneration = generation\n const myController = new AbortController()\n controller = myController\n probeInFlight = myController\n lastProbeAt = Date.now()\n try {\n const items = await options.probe({ limit: probeLimit, signal: myController.signal })\n if (myController.signal.aborted || myGeneration !== generation) return\n count.value = items.filter((item) => isNew(options.key(item))).length\n succeeded()\n if (overflow.value) clearTimers()\n } catch {\n if (myController.signal.aborted || myGeneration !== generation) return\n failed.value = true\n // The interval tries again on its own; signals may not come for long.\n if (!currentInterval()) scheduleRetry(() => void runProbe())\n } finally {\n if (controller === myController) controller = undefined\n if (probeInFlight === myController) probeInFlight = undefined\n if (rerun && !myController.signal.aborted) {\n rerun = false\n scheduleProbe()\n }\n }\n }\n\n const scheduleProbe = () => {\n if (disposed || overflow.value) return\n if (baseline === undefined) {\n probeWanted = true\n return\n }\n if (signalTimer) return\n const wait = Math.max(debounceMs, lastProbeAt + minIntervalMs - Date.now())\n signalTimer = setTimeout(() => {\n signalTimer = undefined\n void runProbe()\n }, wait)\n }\n\n /** Asks for a probe, e.g. on a backend signal. A burst of requests ends in one probe. */\n const requestProbe = () => {\n if (disposed) return\n signals += 1\n scheduleProbe()\n }\n\n const fetchBaseline = async (scope: string, myGeneration: number) => {\n const myController = new AbortController()\n controller = myController\n try {\n // With `unseen` newness, what the probe would count is seen: the list the user looks at holds it.\n const limit = newness === 'unseen' ? probeLimit : 1\n const items = await options.probe({ limit, signal: myController.signal })\n if (myController.signal.aborted || myGeneration !== generation) return\n raiseBaseline(newestKey(items), scope)\n see(items)\n succeeded()\n scheduleInterval()\n runWantedProbe()\n } catch {\n if (myController.signal.aborted || myGeneration !== generation) return\n failed.value = true\n // Without a baseline nothing is probed, so the fetch itself is tried again.\n scheduleRetry(() => {\n if (myGeneration === generation) void fetchBaseline(scope, myGeneration)\n })\n } finally {\n if (controller === myController) controller = undefined\n if (rerun && !myController.signal.aborted) {\n rerun = false\n scheduleProbe()\n }\n }\n }\n\n // A probe still to run or running may announce records the load did not see; so may one that counted records\n // while the load ran, unknown outside the pill's reload, which knows when it started.\n const signalPending = () =>\n signalTimer !== undefined ||\n rerun ||\n probeInFlight !== undefined ||\n (applyingFrom !== undefined ? signals > applyingFrom : count.value > 0)\n\n /**\n * Reports a successful full load of the list: a filter, a sort, page 1 or a reload after the click.\n * `newestFirst`: the items are page 1 sorted newest first, so the newest of them is the baseline.\n * Otherwise `newest` gives it: what the probe returns under the loaded filters (one record, with `unseen` newness\n * `probeLimit`), asked for when the load started, so a record created while the list loaded is counted, at worst\n * one the list shows. Without it one probe after the load finds the baseline and takes such a record as seen.\n * A switch to another page needs no report. The changes offered end, except those signalled while the pill's\n * reload or a load given by `loading` ran.\n */\n const markLoaded = (items: T[], loaded: { newestFirst: boolean; newest?: T[] }) => {\n generation += 1\n if (signalPending()) probeWanted = true\n // A change signalled while the load ran (the pill's reload, or one given by `loading`) may be newer than what it\n // loaded.\n const loadFrom =\n applyingFrom !== undefined && loadingFrom !== undefined\n ? Math.min(applyingFrom, loadingFrom)\n : (applyingFrom ?? loadingFrom)\n changed.value = loadFrom !== undefined && changedAtSignal > loadFrom\n if (!toValue(options.loading)) loadingFrom = undefined\n abortProbe()\n clearTimers()\n count.value = 0\n failures = 0\n failed.value = false\n const scope = serializeScope(toValue(options.scope))\n const seenNewest = loaded.newestFirst ? items : loaded.newest\n if (seenNewest) {\n raiseBaseline(newestKey(seenNewest), scope)\n see(seenNewest)\n scheduleInterval()\n runWantedProbe()\n return\n }\n // No probe runs until the new baseline is known: under other filters the old one means nothing, under the same\n // ones it may be older than the rows shown, so a probe would count them.\n setBaseline(undefined)\n scheduleInterval()\n void fetchBaseline(scope, generation)\n }\n\n /**\n * Asks the user to reload the list because records already in it changed, e.g. moved to another tab or got\n * another status, which no count shows. The pill offers it while nothing new is counted.\n */\n const markChanged = () => {\n // Before the first load nothing is shown that could change.\n if (disposed || generation === 0) return\n signals += 1\n changedAtSignal = signals\n changed.value = true\n }\n\n const reloadOnClick = async () => {\n if (signalTimer !== undefined || rerun || probeInFlight !== undefined) probeWanted = true\n // Only probes stop: a baseline still being fetched is needed when the reload fails.\n if (probeInFlight) {\n probeInFlight.abort()\n if (controller === probeInFlight) controller = undefined\n probeInFlight = undefined\n }\n rerun = false\n clearTimeout(intervalTimer)\n clearTimeout(signalTimer)\n intervalTimer = undefined\n signalTimer = undefined\n const loadsBefore = generation\n applyingFrom = signals\n // The start of an earlier load that reported nothing says nothing about this one.\n if (!toValue(options.loading)) loadingFrom = undefined\n try {\n await options.reload()\n } finally {\n applyingFrom = undefined\n // A fetched list reported itself through `markLoaded`, which started the counting anew. Without one nothing\n // was shown: the pill keeps what it offered and the looking goes on.\n if (generation === loadsBefore) {\n scheduleInterval()\n runWantedProbe()\n }\n }\n }\n\n /**\n * The click on the pill: reloads the list and starts counting again from it. A click while the reload runs\n * waits for the same reload.\n */\n const apply = () => {\n applying ??= reloadOnClick().finally(() => {\n applying = undefined\n })\n return applying\n }\n\n if (options.loading !== undefined) {\n watch(\n () => Boolean(toValue(options.loading)),\n (value, before) => {\n if (value && !before) loadingFrom = signals\n },\n { flush: 'sync' }\n )\n }\n\n watch(\n () => toValue(options.interval),\n () => {\n if (!disposed && baseline !== undefined) scheduleInterval()\n }\n )\n\n watch(visibility, (value) => {\n if (disposed || baseline === undefined) return\n if (value === 'visible' && !overflow.value && Date.now() - lastProbeAt > RETURN_PROBE_GAP_MS) {\n void runProbe()\n }\n scheduleInterval()\n })\n\n onScopeDispose(() => {\n disposed = true\n abortProbe()\n clearTimers()\n })\n\n return {\n count: readonly(count),\n overflow,\n label,\n failed: readonly(failed),\n /** Records already listed changed; see `markChanged`. */\n changed: readonly(changed),\n /** The newest record the user has seen: `null` for an empty list, `undefined` before the first load. */\n baseline: readonly(baselineState),\n max,\n markLoaded,\n requestProbe,\n markChanged,\n apply,\n }\n}\n"],"mappings":";;;AAqBA,IAAaA,IAA6C;CAAE,WAAW;CAAQ,UAAU;AAAO,GA0C1FC,KAAsB,KACtBC,IAAe,KAGRC,KAA0B,GAAmB,MAAsB;CAC9E,IAAI,OAAOC,KAAM,YAAY,OAAOC,KAAM,UAAU,OAAOD,IAAIC;CAC/D,IAAMC,IAAK,OAAOF,CAAC,GACbG,IAAK,OAAOF,CAAC;CAEnB,OADIC,MAAOC,IAAW,IACfD,IAAKC,IAAK,KAAK;AACxB,GAEMC,MAAkB,MAAmB;CACzC,IAAI;EACF,OAAO,KAAK,UAAUC,CAAK,KAAK;CAClC,QAAQ;EACN,OAAO,OAAOA,CAAK;CACrB;AACF;AAQA,SAAgBC,EAAkB,GAAmC;CACnE,IAAMC,IAAMC,EAAQ,OAAO,GACrBC,IAAgBD,EAAQ,iBAAiB,KACzCE,KAAaF,EAAQ,cAAc,MACnCG,IAAUH,EAAQ,WAAW,SAC7BI,IAAa,KAAK,IAAIJ,EAAQ,cAAcD,IAAM,GAAGA,IAAM,CAAC,GAC5DM,UAAwBC,EAAQN,EAAQ,QAAQ,KAAK,IAErDO,IAAQC,EAAI,CAAC,GACbC,IAASD,EAAI,EAAK,GAClBE,IAAUF,EAAI,EAAK,GACnBG,IAAWC,QAAeL,EAAM,QAAQR,CAAG,GAC3Cc,KAAQD,QACRL,EAA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Aa0D,GAAc,CAAC,CAAC,cAAc;GACzC,IAAW,KAAA;EACb,CAAC,GACMrC;CAgDT;AACF"}
package/package.json CHANGED
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "./package.json": "./package.json"
42
42
  },
43
- "version": "2.0.0-rc.20",
43
+ "version": "2.0.0-rc.21",
44
44
  "license": "Apache-2.0",
45
45
  "repository": {
46
46
  "type": "git",
@@ -80,7 +80,7 @@
80
80
  "release:cleanup": "npx -y --allow-git=all github:anzusystems/release-tools#main cleanup"
81
81
  },
82
82
  "devDependencies": {
83
- "@anzusystems/common-admin": "2.0.0-rc.20",
83
+ "@anzusystems/common-admin": "2.0.0-rc.21",
84
84
  "@intlify/unplugin-vue-i18n": "^11.2.8",
85
85
  "@mdi/font": "^7.4.47",
86
86
  "@sentry/vite-plugin": "11.14.0",