@septkit/ui 0.0.88 → 0.0.90

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 (35) hide show
  1. package/dist/dialecte/composables/change-id-window.js +14 -0
  2. package/dist/dialecte/composables/use-live-data.js +154 -31
  3. package/dist/dialecte/create-document-store.js +16 -7
  4. package/dist/dropdown/combobox.vue_vue_type_script_setup_true_lang.js +35 -29
  5. package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/dialecte-DHj8__Ch.js +7293 -0
  6. package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/helpers-Bfv2XDC-.js +351 -0
  7. package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/index.js +6 -0
  8. package/dist/external/.pnpm/{@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/open-connections-D59wm6nb.js → @dialecte_core@0.12.1/node_modules/@dialecte/core/dist/open-connections-ClJo0-Af.js} +2 -2
  9. package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/project-key-DD8DyQ8-.js +1751 -0
  10. package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/qname-definition-C6GUFWL8.js +56 -0
  11. package/dist/external/.pnpm/{@dialecte_core@0.11.0 → @dialecte_core@0.12.1}/node_modules/@dialecte/core/dist/rolldown-runtime-CYdcPHCu.js +1 -1
  12. package/dist/external/.pnpm/{@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/same-json-value-boJ4pSRe.js → @dialecte_core@0.12.1/node_modules/@dialecte/core/dist/same-json-value-DTtSsGUF.js} +491 -370
  13. package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/utils-Q5zsKl3Y.js +2449 -0
  14. package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/utils.js +2 -0
  15. package/dist/external/.pnpm/@tanstack_virtual-core@3.17.3/node_modules/@tanstack/virtual-core/dist/esm/index.js +627 -0
  16. package/dist/external/.pnpm/@tanstack_virtual-core@3.17.3/node_modules/@tanstack/virtual-core/dist/esm/lazy-measurements.js +31 -0
  17. package/dist/external/.pnpm/@tanstack_virtual-core@3.17.3/node_modules/@tanstack/virtual-core/dist/esm/utils.js +38 -0
  18. package/dist/external/.pnpm/@tanstack_vue-virtual@3.13.31_vue@3.5.39_typescript@5.8.3_/node_modules/@tanstack/vue-virtual/dist/esm/index.js +28 -0
  19. package/dist/external/.pnpm/@vueuse_core@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/core/dist/index.js +24 -2
  20. package/dist/index.d.ts +268 -7
  21. package/dist/index.js +7 -1
  22. package/dist/ui.css +1 -1
  23. package/dist/virtual/grid-aria.js +16 -0
  24. package/dist/virtual/grid-navigation.js +84 -0
  25. package/dist/virtual/index.js +6 -0
  26. package/dist/virtual/kept-range.js +32 -0
  27. package/dist/virtual/use-virtual-scroller.js +180 -0
  28. package/dist/virtual/virtual.constants.js +7 -0
  29. package/package.json +6 -4
  30. package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/dialecte-Cs_XRP4I.js +0 -4426
  31. package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/helpers-D8p0KiJu.js +0 -130
  32. package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/index.js +0 -6
  33. package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/project-key-sr4wkl2Q.js +0 -1371
  34. package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/utils-Cv4oHia0.js +0 -865
  35. package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/utils.js +0 -2
@@ -0,0 +1,14 @@
1
+ //#region lib/dialecte/composables/change-id-window.ts
2
+ function e() {
3
+ let e = /* @__PURE__ */ new Set();
4
+ return {
5
+ isNew(t) {
6
+ return t === void 0 ? !0 : e.has(t) ? !1 : (e.add(t), e.size > 256 && e.delete(e.values().next().value), !0);
7
+ },
8
+ clear() {
9
+ e.clear();
10
+ }
11
+ };
12
+ }
13
+ //#endregion
14
+ export { e as createChangeIdWindow };
@@ -1,57 +1,180 @@
1
1
  import { tryOnScopeDispose as e, useDebounceFn as t } from "../../external/.pnpm/@vueuse_shared@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/shared/dist/index.js";
2
2
  import { useAsyncState as n } from "../../external/.pnpm/@vueuse_core@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/core/dist/index.js";
3
3
  import { useDialecteChannel as r } from "./use-dialecte-channel.js";
4
- import { computed as i, toValue as a, watch as o } from "vue";
4
+ import { createChangeIdWindow as i } from "./change-id-window.js";
5
+ import { computed as a, toValue as o, watch as s } from "vue";
5
6
  //#region lib/dialecte/composables/use-live-data.ts
6
- function s(e) {
7
- let { document: t, fetcher: n, initial: s } = e, { state: c, isLoading: u, error: d, execute: f, refresh: p } = l(n, s), m = i(() => a(t)), { data: h } = r(i(() => m.value?.channelName));
8
- return o(h, (e) => {
9
- e?.type === "commit" && e.documentId === m.value?.documentId && p();
10
- }), o(() => m.value?.documentId, (e) => {
11
- c.value = s, e && p();
12
- }, { immediate: !0 }), {
13
- state: c,
14
- isLoading: u,
15
- error: d,
16
- refresh: f
7
+ function c(e) {
8
+ let { document: t, fetcher: n, initial: c, dependsOn: l } = e, { state: f, isLoading: p, error: m, refresh: h, refreshNow: g, restart: _, dropQueuedRefetch: v, joinRestart: y } = u(n, c), b = a(() => o(t)), { data: x } = r(a(() => b.value?.channelName)), S = i();
9
+ s(x, function(e) {
10
+ if (e?.type === "resync") {
11
+ S.clear(), h();
12
+ return;
13
+ }
14
+ e?.type !== "commit" || e.documentId !== b.value?.documentId || S.isNew(e.changeId) && d({
15
+ message: e,
16
+ dependsOn: l
17
+ }) && h();
18
+ });
19
+ let C;
20
+ s(() => b.value?.documentId, function(e) {
21
+ if (C = e, f.value = c, m.value = void 0, !e) {
22
+ v();
23
+ return;
24
+ }
25
+ _();
26
+ }, { immediate: !0 });
27
+ function w() {
28
+ let e = b.value?.documentId;
29
+ return e ? e === C ? g() : y() : Promise.resolve();
30
+ }
31
+ return {
32
+ state: f,
33
+ isLoading: p,
34
+ error: m,
35
+ refresh: w
17
36
  };
18
37
  }
19
- function c(e) {
20
- let { project: t, fetcher: n, initial: s } = e, { state: c, isLoading: u, error: d, execute: f, refresh: p } = l(n, s), m = i(() => a(t)?.channelName), { data: h } = r(m);
21
- return o(h, (e) => {
38
+ function l(e) {
39
+ let { project: t, fetcher: n, initial: c, dependsOn: l } = e, { state: f, isLoading: p, error: m, refresh: h, refreshNow: g, restart: _, dropQueuedRefetch: v, joinRestart: y } = u(n, c), b = a(() => o(t)?.channelName), { data: x } = r(b), S = i();
40
+ s(x, function(e) {
22
41
  switch (e?.type) {
23
42
  case "commit":
43
+ S.isNew(e.changeId) && d({
44
+ message: e,
45
+ dependsOn: l
46
+ }) && h();
47
+ return;
48
+ case "resync":
49
+ S.clear(), h();
50
+ return;
24
51
  case "init-empty-document":
25
52
  case "document-removed":
26
53
  case "document-imported":
27
- case "document-updated": p();
28
- }
29
- }), o(m, (e) => {
30
- c.value = s, e && p();
31
- }, { immediate: !0 }), {
32
- state: c,
33
- isLoading: u,
34
- error: d,
35
- refresh: f
54
+ case "document-updated": h();
55
+ }
56
+ });
57
+ let C;
58
+ s(b, function(e) {
59
+ if (C = e, f.value = c, m.value = void 0, !e) {
60
+ v();
61
+ return;
62
+ }
63
+ _();
64
+ }, { immediate: !0 });
65
+ function w() {
66
+ let e = b.value;
67
+ return e ? e === C ? g() : y() : Promise.resolve();
68
+ }
69
+ return {
70
+ state: f,
71
+ isLoading: p,
72
+ error: m,
73
+ refresh: w
36
74
  };
37
75
  }
38
- function l(r, i) {
76
+ function u(r, i) {
39
77
  let a = !1;
40
78
  e(() => {
41
79
  a = !0;
42
80
  });
43
- let o = n(r, i, {
81
+ let o = 0;
82
+ async function s() {
83
+ let e = o;
84
+ try {
85
+ let t = await r();
86
+ return e === o ? t : c.state.value;
87
+ } catch (t) {
88
+ if (e !== o) return c.state.value;
89
+ throw t;
90
+ }
91
+ }
92
+ let c = n(s, i, {
44
93
  immediate: !1,
94
+ resetOnExecute: !1,
45
95
  onError: (e) => {
46
96
  a || globalThis.reportError?.(e);
47
97
  }
48
- }), s = t(async () => {
49
- a || await o.execute();
98
+ }), l, u = -1, d, p = [];
99
+ function m() {
100
+ let e = c.execute().then(() => void 0);
101
+ return l = e, u = o, e.then(() => h(e));
102
+ }
103
+ function h(e) {
104
+ if (l && l !== e) {
105
+ let e = l;
106
+ return e.then(() => h(e));
107
+ }
108
+ if (l !== e) return Promise.resolve();
109
+ l = void 0;
110
+ let t = d;
111
+ return d = void 0, t && a && t.resolve(), t && !a && m().then(t.resolve), Promise.resolve();
112
+ }
113
+ function g() {
114
+ return a ? Promise.resolve() : l ? (d ??= f(), d.promise) : m();
115
+ }
116
+ function _() {
117
+ let e = d ? [...p, d] : p;
118
+ return d = void 0, p = [], e;
119
+ }
120
+ function v() {
121
+ let e = _();
122
+ if (a) {
123
+ e.forEach((e) => e.resolve());
124
+ return;
125
+ }
126
+ (u === o ? l ?? Promise.resolve() : m()).then(() => e.forEach((e) => e.resolve()));
127
+ }
128
+ function y() {
129
+ o++, _().forEach((e) => e.resolve());
130
+ }
131
+ let b = t(function(e) {
132
+ e === o && g();
133
+ }, 50), x = t(function(e) {
134
+ e === o && v();
50
135
  }, 50);
136
+ function S() {
137
+ b(o);
138
+ }
139
+ function C() {
140
+ let e = f();
141
+ return p.push(e), e.promise;
142
+ }
143
+ function w() {
144
+ o++, p = _(), x(o);
145
+ }
146
+ return {
147
+ ...c,
148
+ refresh: S,
149
+ refreshNow: g,
150
+ restart: w,
151
+ dropQueuedRefetch: y,
152
+ joinRestart: C
153
+ };
154
+ }
155
+ function d(e) {
156
+ let { message: t, dependsOn: n } = e, { changes: r, documentId: i } = t;
157
+ if (!n || !r || "unknown" in r) return !0;
158
+ if (typeof n == "function") try {
159
+ return n({
160
+ documentId: i,
161
+ changes: r
162
+ });
163
+ } catch (e) {
164
+ return globalThis.reportError?.(e), !0;
165
+ }
166
+ return [
167
+ r.created,
168
+ r.updated,
169
+ r.deleted
170
+ ].some((e) => e.some((e) => n.includes(e.tagName)));
171
+ }
172
+ function f() {
173
+ let e = () => {};
51
174
  return {
52
- ...o,
53
- refresh: s
175
+ promise: new Promise((t) => e = t),
176
+ resolve: e
54
177
  };
55
178
  }
56
179
  //#endregion
57
- export { s as useLiveData, c as useProjectLiveData };
180
+ export { c as useLiveData, l as useProjectLiveData };
@@ -1,7 +1,7 @@
1
- import { f as e } from "../external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/utils-Cv4oHia0.js";
2
- import "../external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/utils.js";
3
- import { V as t } from "../external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/dialecte-Cs_XRP4I.js";
4
- import "../external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/index.js";
1
+ import { f as e } from "../external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/utils-Q5zsKl3Y.js";
2
+ import "../external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/utils.js";
3
+ import { G as t } from "../external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/dialecte-DHj8__Ch.js";
4
+ import "../external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/index.js";
5
5
  import { computed as n, shallowRef as r } from "vue";
6
6
  //#region lib/dialecte/create-document-store.ts
7
7
  function i(i) {
@@ -10,10 +10,19 @@ function i(i) {
10
10
  let d = Object.keys(l).length > 0, f = Object.keys(u).length > 0, p = d || f, m = n(() => {
11
11
  let n = s.value;
12
12
  if (e(n, { detail: "createDocumentStore: document accessed before hydration. Ensure hydrate() is called before consumers read document, or guard with isHydrated." }), !p) return n;
13
- let r = n;
13
+ let r = n, i = d ? o(r.query, a(t(l, r.query), r.query)) : r.query, c = (e) => o(e, a(t(u, e), e)), m = {};
14
+ if (f) {
15
+ m.transaction = function(e, t) {
16
+ return r.transaction.call(r, (t) => e(c(t)), t);
17
+ };
18
+ let e = r.prepare;
19
+ e && (m.prepare = function(t, n) {
20
+ return e.call(r, (e) => t(c(e)), n);
21
+ });
22
+ }
14
23
  return o(r, {
15
- query: d ? o(r.query, a(t(l, r.query), r.query)) : r.query,
16
- transaction: f ? (e) => r.transaction((n) => e(o(n, a(t(u, n), n)))) : r.transaction
24
+ query: i,
25
+ ...m
17
26
  });
18
27
  }), h = n(() => s.value !== null);
19
28
  function g(e) {
@@ -38,14 +38,15 @@ var F = {
38
38
  limit: {},
39
39
  actionLabel: {},
40
40
  ariaLabel: {},
41
- ariaDescribedby: {}
41
+ ariaDescribedby: {},
42
+ inputId: {}
42
43
  }, {
43
44
  modelValue: { default: null },
44
45
  modelModifiers: {}
45
46
  }),
46
47
  emits: /*@__PURE__*/ w(["action"], ["update:modelValue"]),
47
48
  setup(C, { emit: w }) {
48
- let R = C, z = w, B = N(C, "modelValue"), V = { action: !0 }, H = O(""), U = O(), W = g(() => ({
49
+ let R = C, z = w, B = N(C, "modelValue"), V = { action: !0 }, H = O(""), U = O(), W = O("body"), G = g(() => ({
49
50
  "input-neutral": R.color === "neutral",
50
51
  "input-primary": R.color === "primary",
51
52
  "input-secondary": R.color === "secondary",
@@ -63,7 +64,7 @@ var F = {
63
64
  "input-md": R.size === "md",
64
65
  "input-lg": R.size === "lg",
65
66
  "input-xl": R.size === "xl"
66
- })), G = g(() => !!R.searchText), K = g(() => G.value ? m({
67
+ })), K = g(() => !!R.searchText), q = g(() => K.value ? m({
67
68
  options: R.options,
68
69
  search: H.value,
69
70
  searchText: R.searchText,
@@ -75,58 +76,63 @@ var F = {
75
76
  items: R.options
76
77
  }],
77
78
  more: 0
78
- }), q = g(() => G.value && K.value.groups.length === 0), J = g(() => K.value.groups.reduce((e, t) => e + t.items.length, 0) + K.value.more);
79
- function Y(e) {
79
+ }), J = g(() => K.value && q.value.groups.length === 0), Y = g(() => q.value.groups.reduce((e, t) => e + t.items.length, 0) + q.value.more);
80
+ function X(e) {
80
81
  return R.getKey ? R.getKey(e) : R.displayValue(e);
81
82
  }
82
- function X(e) {
83
+ function Z(e) {
83
84
  return e == null || e === V ? "" : R.displayValue(e);
84
85
  }
85
- function Z(e) {
86
+ function Q(e) {
86
87
  if (e === V) {
87
- z("action", H.value.trim(), J.value);
88
+ z("action", H.value.trim(), Y.value);
88
89
  return;
89
90
  }
90
91
  B.value = e;
91
92
  }
92
- function Q(e, t) {
93
- return e === V || t === V ? e === t : e != null && t != null && Y(e) === Y(t);
93
+ function $(e, t) {
94
+ return e === V || t === V ? e === t : e != null && t != null && X(e) === X(t);
94
95
  }
95
- async function $(e) {
96
- e && (H.value = "", await T(), await T(), (U.value?.$el)?.select());
96
+ async function ee(e) {
97
+ if (!e) return;
98
+ H.value = "";
99
+ let t = U.value?.$el;
100
+ W.value = t?.closest("dialog[open]") ?? "body", await T(), await T(), t?.select();
97
101
  }
98
- function ee(e) {
102
+ function te(e) {
99
103
  H.value = e.target.value;
100
104
  }
101
105
  return (m, g) => (D(), _(M(e), {
102
106
  "model-value": B.value,
103
107
  class: "dropdown w-full",
104
108
  disabled: C.disabled,
105
- "ignore-filter": G.value,
106
- by: C.getKey ? Q : void 0,
107
- "onUpdate:modelValue": Z,
108
- "onUpdate:open": $
109
+ "ignore-filter": K.value,
110
+ by: C.getKey ? $ : void 0,
111
+ "onUpdate:modelValue": Q,
112
+ "onUpdate:open": ee
109
113
  }, {
110
- default: P(() => [S(M(t), { class: E(["input w-full flex items-center gap-2", W.value]) }, {
114
+ default: P(() => [S(M(t), { class: E(["input w-full flex items-center gap-2", G.value]) }, {
111
115
  default: P(() => [S(M(a), {
112
116
  ref_key: "input",
113
117
  ref: U,
114
118
  class: "input-ghost outline-none w-full",
115
119
  placeholder: C.placeholder ?? "Search...",
116
- "display-value": X,
120
+ "display-value": Z,
117
121
  "aria-label": C.ariaLabel,
118
122
  "aria-describedby": C.ariaDescribedby,
119
- onInput: ee
123
+ id: C.inputId,
124
+ onInput: te
120
125
  }, null, 8, [
121
126
  "placeholder",
122
127
  "aria-label",
123
- "aria-describedby"
128
+ "aria-describedby",
129
+ "id"
124
130
  ]), S(M(u), { "aria-label": C.ariaLabel ? `Show the choices for: ${C.ariaLabel}` : "Show the choices" }, {
125
131
  default: P(() => [S(M(p), { class: "h-4 w-4 text-base-content/60 cursor-pointer" })]),
126
132
  _: 1
127
133
  }, 8, ["aria-label"])]),
128
134
  _: 1
129
- }, 8, ["class"]), S(M(l), null, {
135
+ }, 8, ["class"]), S(M(l), { to: W.value }, {
130
136
  default: P(() => [S(M(n), {
131
137
  position: "popper",
132
138
  "side-offset": 4,
@@ -138,15 +144,15 @@ var F = {
138
144
  }, {
139
145
  default: P(() => [S(M(d), { class: "max-h-64 overflow-y-auto p-1" }, {
140
146
  default: P(() => [
141
- G.value ? v("", !0) : (D(), _(M(r), {
147
+ K.value ? v("", !0) : (D(), _(M(r), {
142
148
  key: 0,
143
149
  class: "text-base-content/80 text-xs text-center py-2"
144
150
  }, {
145
151
  default: P(() => [x(j(C.emptyText ?? "No results found"), 1)]),
146
152
  _: 1
147
153
  })),
148
- q.value ? (D(), y("p", F, j(C.emptyText ?? `Nothing matches “${H.value}”`), 1)) : v("", !0),
149
- (D(!0), y(h, null, k(K.value.groups, (e) => (D(), _(M(i), { key: e.label }, {
154
+ J.value ? (D(), y("p", F, j(C.emptyText ?? `Nothing matches “${H.value}”`), 1)) : v("", !0),
155
+ (D(!0), y(h, null, k(q.value.groups, (e) => (D(), _(M(i), { key: e.label }, {
150
156
  default: P(() => [e.label ? (D(), _(M(c), {
151
157
  key: 0,
152
158
  "data-testid": "combobox-group-label",
@@ -155,7 +161,7 @@ var F = {
155
161
  default: P(() => [x(j(e.label), 1)]),
156
162
  _: 2
157
163
  }, 1024)) : v("", !0), (D(!0), y(h, null, k(e.items, (e) => (D(), _(M(o), {
158
- key: Y(e),
164
+ key: X(e),
159
165
  value: e,
160
166
  class: "cursor-pointer text-xs leading-none w-full flex items-center gap-2 rounded px-2 min-h-7 py-1 pl-7 relative select-none data-disabled:opacity-40 data-disabled:pointer-events-none data-highlighted:outline-none data-highlighted:bg-primary data-highlighted:text-primary-content"
161
167
  }, {
@@ -167,14 +173,14 @@ var F = {
167
173
  }, 1032, ["value"]))), 128))]),
168
174
  _: 2
169
175
  }, 1024))), 128)),
170
- K.value.more > 0 ? (D(), y("p", L, j(K.value.more) + " more: type to narrow ", 1)) : v("", !0),
176
+ q.value.more > 0 ? (D(), y("p", L, j(q.value.more) + " more: type to narrow ", 1)) : v("", !0),
171
177
  C.actionLabel ? (D(), _(M(o), {
172
178
  key: 3,
173
179
  "data-testid": "combobox-action",
174
180
  value: V,
175
181
  class: "cursor-pointer text-xs leading-none w-full flex items-center gap-2 rounded px-2 min-h-7 py-1 pl-7 relative select-none border-t border-base-300 font-medium data-highlighted:outline-none data-highlighted:bg-primary data-highlighted:text-primary-content"
176
182
  }, {
177
- default: P(() => [x(j(C.actionLabel(H.value.trim(), J.value)), 1)]),
183
+ default: P(() => [x(j(C.actionLabel(H.value.trim(), Y.value)), 1)]),
178
184
  _: 1
179
185
  })) : v("", !0)
180
186
  ]),
@@ -183,7 +189,7 @@ var F = {
183
189
  _: 3
184
190
  })]),
185
191
  _: 3
186
- })]),
192
+ }, 8, ["to"])]),
187
193
  _: 3
188
194
  }, 8, [
189
195
  "model-value",