@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.
- package/dist/dialecte/composables/change-id-window.js +14 -0
- package/dist/dialecte/composables/use-live-data.js +154 -31
- package/dist/dialecte/create-document-store.js +16 -7
- package/dist/dropdown/combobox.vue_vue_type_script_setup_true_lang.js +35 -29
- package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/dialecte-DHj8__Ch.js +7293 -0
- package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/helpers-Bfv2XDC-.js +351 -0
- package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/index.js +6 -0
- 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
- package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/project-key-DD8DyQ8-.js +1751 -0
- package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/qname-definition-C6GUFWL8.js +56 -0
- 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
- 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
- package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/utils-Q5zsKl3Y.js +2449 -0
- package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/utils.js +2 -0
- package/dist/external/.pnpm/@tanstack_virtual-core@3.17.3/node_modules/@tanstack/virtual-core/dist/esm/index.js +627 -0
- package/dist/external/.pnpm/@tanstack_virtual-core@3.17.3/node_modules/@tanstack/virtual-core/dist/esm/lazy-measurements.js +31 -0
- package/dist/external/.pnpm/@tanstack_virtual-core@3.17.3/node_modules/@tanstack/virtual-core/dist/esm/utils.js +38 -0
- 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
- 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
- package/dist/index.d.ts +268 -7
- package/dist/index.js +7 -1
- package/dist/ui.css +1 -1
- package/dist/virtual/grid-aria.js +16 -0
- package/dist/virtual/grid-navigation.js +84 -0
- package/dist/virtual/index.js +6 -0
- package/dist/virtual/kept-range.js +32 -0
- package/dist/virtual/use-virtual-scroller.js +180 -0
- package/dist/virtual/virtual.constants.js +7 -0
- package/package.json +6 -4
- package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/dialecte-Cs_XRP4I.js +0 -4426
- package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/helpers-D8p0KiJu.js +0 -130
- package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/index.js +0 -6
- package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/project-key-sr4wkl2Q.js +0 -1371
- package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/utils-Cv4oHia0.js +0 -865
- package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/utils.js +0 -2
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//#region node_modules/.pnpm/@tanstack+virtual-core@3.17.3/node_modules/@tanstack/virtual-core/dist/esm/utils.js
|
|
2
|
+
function e(e, t, n) {
|
|
3
|
+
let r = n.initialDeps ?? [], i, a = !0;
|
|
4
|
+
function o() {
|
|
5
|
+
let o = process.env.NODE_ENV !== "production" && !!n.key && !!n.debug?.call(n), s = 0;
|
|
6
|
+
o && (s = Date.now());
|
|
7
|
+
let c = e();
|
|
8
|
+
if (!(c.length !== r.length || c.some((e, t) => r[t] !== e))) return i;
|
|
9
|
+
r = c;
|
|
10
|
+
let l = 0;
|
|
11
|
+
if (o && (l = Date.now()), i = t(...c), o) {
|
|
12
|
+
let e = Math.round((Date.now() - s) * 100) / 100, t = Math.round((Date.now() - l) * 100) / 100, r = t / 16, i = (e, t) => {
|
|
13
|
+
for (e = String(e); e.length < t;) e = " " + e;
|
|
14
|
+
return e;
|
|
15
|
+
};
|
|
16
|
+
console.info(`%c⏱ ${i(t, 5)} /${i(e, 5)} ms`, `
|
|
17
|
+
font-size: .6rem;
|
|
18
|
+
font-weight: bold;
|
|
19
|
+
color: hsl(${Math.max(0, Math.min(120 - 120 * r, 120))}deg 100% 31%);`, n?.key);
|
|
20
|
+
}
|
|
21
|
+
return n?.onChange && !(a && n.skipInitialOnChange) && n.onChange(i), a = !1, i;
|
|
22
|
+
}
|
|
23
|
+
return o.updateDeps = (e) => {
|
|
24
|
+
r = e;
|
|
25
|
+
}, o;
|
|
26
|
+
}
|
|
27
|
+
function t(e, t) {
|
|
28
|
+
if (e === void 0) throw Error(`Unexpected undefined${t ? `: ${t}` : ""}`);
|
|
29
|
+
return e;
|
|
30
|
+
}
|
|
31
|
+
var n = (e, t) => Math.abs(e - t) < 1.01, r = (e, t, n) => {
|
|
32
|
+
let r;
|
|
33
|
+
return function(...i) {
|
|
34
|
+
e.clearTimeout(r), r = e.setTimeout(() => t.apply(this, i), n);
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
//#endregion
|
|
38
|
+
export { n as approxEqual, r as debounce, e as memo, t as notUndefined };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { approxEqual as e, debounce as t, memo as n, notUndefined as r } from "../../../../../../@tanstack_virtual-core@3.17.3/node_modules/@tanstack/virtual-core/dist/esm/utils.js";
|
|
2
|
+
import { Virtualizer as i, defaultKeyExtractor as a, defaultRangeExtractor as o, elementScroll as s, measureElement as c, observeElementOffset as l, observeElementRect as u } from "../../../../../../@tanstack_virtual-core@3.17.3/node_modules/@tanstack/virtual-core/dist/esm/index.js";
|
|
3
|
+
import { computed as d, onScopeDispose as f, shallowRef as p, triggerRef as m, unref as h, watch as g } from "vue";
|
|
4
|
+
//#region node_modules/.pnpm/@tanstack+vue-virtual@3.13.31_vue@3.5.39_typescript@5.8.3_/node_modules/@tanstack/vue-virtual/dist/esm/index.js
|
|
5
|
+
function _(e) {
|
|
6
|
+
let t = new i(h(e)), n = p(t), r = t._didMount();
|
|
7
|
+
return g(() => h(e).getScrollElement(), (e) => {
|
|
8
|
+
e && t._willUpdate();
|
|
9
|
+
}, { immediate: !0 }), g(() => h(e), (e) => {
|
|
10
|
+
t.setOptions({
|
|
11
|
+
...e,
|
|
12
|
+
onChange: (t, r) => {
|
|
13
|
+
var i;
|
|
14
|
+
m(n), (i = e.onChange) == null || i.call(e, t, r);
|
|
15
|
+
}
|
|
16
|
+
}), t._willUpdate(), m(n);
|
|
17
|
+
}, { immediate: !0 }), f(r), n;
|
|
18
|
+
}
|
|
19
|
+
function v(e) {
|
|
20
|
+
return _(d(() => ({
|
|
21
|
+
observeElementRect: u,
|
|
22
|
+
observeElementOffset: l,
|
|
23
|
+
scrollToFn: s,
|
|
24
|
+
...h(e)
|
|
25
|
+
})));
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { i as Virtualizer, e as approxEqual, t as debounce, a as defaultKeyExtractor, o as defaultRangeExtractor, s as elementScroll, c as measureElement, n as memo, r as notUndefined, l as observeElementOffset, u as observeElementRect, v as useVirtualizer };
|
|
@@ -164,7 +164,29 @@ function Z(e = {}) {
|
|
|
164
164
|
function Q(e) {
|
|
165
165
|
return JSON.parse(JSON.stringify(e));
|
|
166
166
|
}
|
|
167
|
-
function $(e, t, n
|
|
167
|
+
function $(e, t, n = {}) {
|
|
168
|
+
let { window: r = V, ...i } = n, a, o = /* @__PURE__ */ K(() => r && "ResizeObserver" in r), s = () => {
|
|
169
|
+
a &&= (a.disconnect(), void 0);
|
|
170
|
+
}, c = B(A(() => {
|
|
171
|
+
let t = R(e);
|
|
172
|
+
return Array.isArray(t) ? t.map((e) => U(e)) : [U(t)];
|
|
173
|
+
}), (e) => {
|
|
174
|
+
if (s(), o.value && r) {
|
|
175
|
+
a = new ResizeObserver(t);
|
|
176
|
+
for (let t of e) t && a.observe(t, i);
|
|
177
|
+
}
|
|
178
|
+
}, {
|
|
179
|
+
immediate: !0,
|
|
180
|
+
flush: "post"
|
|
181
|
+
}), l = () => {
|
|
182
|
+
s(), c();
|
|
183
|
+
};
|
|
184
|
+
return C(l), {
|
|
185
|
+
isSupported: o,
|
|
186
|
+
stop: l
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function ee(e, t, n, r = {}) {
|
|
168
190
|
var i, a;
|
|
169
191
|
let { clone: o = !1, passive: s = !1, eventName: c, deep: u = !1, defaultValue: d, shouldEmit: f } = r, p = j(), m = n || p?.emit || (p == null || (i = p.$emit) == null ? void 0 : i.bind(p)) || (p == null || (a = p.proxy) == null || (a = a.$emit) == null ? void 0 : a.bind(p?.proxy)), h = c;
|
|
170
192
|
t ||= "modelValue", h ||= `update:${t.toString()}`;
|
|
@@ -188,4 +210,4 @@ function $(e, t, n, r = {}) {
|
|
|
188
210
|
});
|
|
189
211
|
}
|
|
190
212
|
//#endregion
|
|
191
|
-
export { e as bypassFilter, Q as cloneFnJSON, t as createEventHook, n as createFilterWrapper, r as createGlobalState, i as createSharedComposable, a as createSingletonPromise, o as debounceFilter, H as defaultNavigator, V as defaultWindow, s as getLifeCycleTarget, c as isClient, l as isDef, u as isIOS, d as isObject, f as noop, J as onKeyStroke, p as pausableFilter, m as promiseTimeout, h as reactiveComputed, g as reactiveOmit, _ as refAutoReset, v as syncRef, y as toArray, b as toReactive, x as toRef, S as tryOnBeforeUnmount, C as tryOnScopeDispose, U as unrefElement, w as until, Y as useAsyncState, Z as useClipboard, T as useDebounceFn, W as useEventListener, G as useMounted, X as usePermission, K as useSupported, E as useTimeoutFn,
|
|
213
|
+
export { e as bypassFilter, Q as cloneFnJSON, t as createEventHook, n as createFilterWrapper, r as createGlobalState, i as createSharedComposable, a as createSingletonPromise, o as debounceFilter, H as defaultNavigator, V as defaultWindow, s as getLifeCycleTarget, c as isClient, l as isDef, u as isIOS, d as isObject, f as noop, J as onKeyStroke, p as pausableFilter, m as promiseTimeout, h as reactiveComputed, g as reactiveOmit, _ as refAutoReset, v as syncRef, y as toArray, b as toReactive, x as toRef, S as tryOnBeforeUnmount, C as tryOnScopeDispose, U as unrefElement, w as until, Y as useAsyncState, Z as useClipboard, T as useDebounceFn, W as useEventListener, G as useMounted, X as usePermission, $ as useResizeObserver, K as useSupported, E as useTimeoutFn, ee as useVModel, D as watchImmediate, O as watchPausable, k as watchWithFilter };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { AsTag } from 'reka-ui';
|
|
|
4
4
|
import { Attrs } from 'vue';
|
|
5
5
|
import { AutocompleteAnchorProps } from 'reka-ui';
|
|
6
6
|
import { ComboboxInputProps } from 'reka-ui';
|
|
7
|
+
import { CommitChanges } from '@dialecte/core';
|
|
7
8
|
import { Component } from 'vue';
|
|
8
9
|
import { ComponentCustomProperties } from 'vue';
|
|
9
10
|
import { ComponentCustomProps } from 'vue';
|
|
@@ -20,10 +21,11 @@ import { ExtensionModule } from '@dialecte/core';
|
|
|
20
21
|
import { GlobalComponents } from 'vue';
|
|
21
22
|
import { GlobalDirectives } from 'vue';
|
|
22
23
|
import { InjectionKey } from 'vue';
|
|
24
|
+
import { MaybeRef } from 'vue';
|
|
23
25
|
import { MaybeRefOrGetter } from 'vue';
|
|
24
26
|
import { nextTick } from 'vue';
|
|
25
27
|
import { OnCleanup } from '@vue/reactivity';
|
|
26
|
-
import {
|
|
28
|
+
import { ProjectChannelEvent } from '@dialecte/core';
|
|
27
29
|
import { PublicProps } from 'vue';
|
|
28
30
|
import { Ref } from 'vue';
|
|
29
31
|
import { ReferenceElement } from 'reka-ui';
|
|
@@ -571,6 +573,8 @@ declare type __VLS_Props_3 = {
|
|
|
571
573
|
/** The input's accessible name, and what describes it. */
|
|
572
574
|
ariaLabel?: string;
|
|
573
575
|
ariaDescribedby?: string;
|
|
576
|
+
/** The id of the input, for a `<label for>` to point at. */
|
|
577
|
+
inputId?: string;
|
|
574
578
|
};
|
|
575
579
|
|
|
576
580
|
declare type __VLS_Props_4 = {
|
|
@@ -1226,6 +1230,23 @@ export declare const Button: __VLS_WithTemplateSlots<typeof __VLS_component, __V
|
|
|
1226
1230
|
|
|
1227
1231
|
export declare const CATEGORY_ELEMENTS: Record<string, string[]>;
|
|
1228
1232
|
|
|
1233
|
+
export declare type CellAria = {
|
|
1234
|
+
'aria-colindex': number;
|
|
1235
|
+
};
|
|
1236
|
+
|
|
1237
|
+
/** 1-based position of a mounted data cell, right of the row-header columns. */
|
|
1238
|
+
export declare function cellAria(params: CellAriaParams): CellAria;
|
|
1239
|
+
|
|
1240
|
+
export declare type CellAriaParams = {
|
|
1241
|
+
index: number;
|
|
1242
|
+
headerColumns?: number;
|
|
1243
|
+
};
|
|
1244
|
+
|
|
1245
|
+
export declare type ClampParams = {
|
|
1246
|
+
value: number;
|
|
1247
|
+
max: number;
|
|
1248
|
+
};
|
|
1249
|
+
|
|
1229
1250
|
declare function closeDropdown(): void;
|
|
1230
1251
|
|
|
1231
1252
|
export declare const CodeBlock: DefineComponent<__VLS_Props_14, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_14> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
@@ -1291,6 +1312,21 @@ export declare const Combobox: __VLS_WithTemplateSlots_3<typeof __VLS_component_
|
|
|
1291
1312
|
*/
|
|
1292
1313
|
export declare function computeGroups<TRecord extends LayoutTreeRecord>(visibleIds: string[], recordMap: RecordMapById<TRecord>): GroupNode[];
|
|
1293
1314
|
|
|
1315
|
+
/**
|
|
1316
|
+
* Spacer sizes for a flow layout that renders the mounted items as `splitKeptItems` orders them: kept
|
|
1317
|
+
* items before the range take their own space, so the space above shrinks by their size (same below).
|
|
1318
|
+
*/
|
|
1319
|
+
export declare function computeSpacers(params: ComputeSpacersParams): Spacers;
|
|
1320
|
+
|
|
1321
|
+
export declare type ComputeSpacersParams = {
|
|
1322
|
+
/** the mounted items in index order */
|
|
1323
|
+
items: readonly Pick<VirtualItem, 'start' | 'size' | 'kept'>[];
|
|
1324
|
+
/** the axis' full size, `paddingStart` included */
|
|
1325
|
+
totalSize: number;
|
|
1326
|
+
/** space before item 0 that the layout already fills (a header band in the scroller) */
|
|
1327
|
+
paddingStart?: number;
|
|
1328
|
+
};
|
|
1329
|
+
|
|
1294
1330
|
export declare type Connection = {
|
|
1295
1331
|
id: string;
|
|
1296
1332
|
source: string;
|
|
@@ -1354,6 +1390,12 @@ export declare function createDocumentStore<GenericBaseDocument, GenericAugmente
|
|
|
1354
1390
|
* every `layout()` call and can be overridden per call via its `options`. */
|
|
1355
1391
|
export declare function createElkLayoutEngine(defaults?: LayoutOptions): LayoutEngine;
|
|
1356
1392
|
|
|
1393
|
+
/** Items mounted beyond each edge of the viewport, per axis, when the consumer gives none. */
|
|
1394
|
+
export declare const DEFAULT_OVERSCAN: {
|
|
1395
|
+
readonly rows: 5;
|
|
1396
|
+
readonly columns: 3;
|
|
1397
|
+
};
|
|
1398
|
+
|
|
1357
1399
|
export declare type DiagramLayoutOptions<TRecord extends LayoutTreeRecord, TNode, TEdge> = {
|
|
1358
1400
|
engine?: LayoutEngine;
|
|
1359
1401
|
layoutOptions?: LayoutOptions;
|
|
@@ -1399,11 +1441,12 @@ rootEl: HTMLDivElement;
|
|
|
1399
1441
|
export declare const DiagramNodeGroup: __VLS_WithTemplateSlots_13<typeof __VLS_component_13, __VLS_TemplateResult_13["slots"]>;
|
|
1400
1442
|
|
|
1401
1443
|
/**
|
|
1402
|
-
*
|
|
1403
|
-
*
|
|
1404
|
-
* (single source of truth);
|
|
1444
|
+
* What a dialecte project's BroadcastChannel carries — the public event contract
|
|
1445
|
+
* of @dialecte/core: each change, and a `resync` (changes may have been missed,
|
|
1446
|
+
* read again). Alias of core's `ProjectChannelEvent` (single source of truth);
|
|
1447
|
+
* kept under this name as the @septkit/ui surface.
|
|
1405
1448
|
*/
|
|
1406
|
-
export declare type DialecteChannelMessage =
|
|
1449
|
+
export declare type DialecteChannelMessage = ProjectChannelEvent;
|
|
1407
1450
|
|
|
1408
1451
|
export declare const Dialog: __VLS_WithTemplateSlots_4<typeof __VLS_component_4, __VLS_TemplateResult_4["slots"]>;
|
|
1409
1452
|
|
|
@@ -1570,8 +1613,40 @@ export declare type FilterTreeNode = {
|
|
|
1570
1613
|
isTerminal?: boolean;
|
|
1571
1614
|
};
|
|
1572
1615
|
|
|
1616
|
+
/** The next index after (or before) `from` that `isEligible` accepts, within `[0, count)`. */
|
|
1617
|
+
export declare function findNextIndex(params: FindNextIndexParams): number | undefined;
|
|
1618
|
+
|
|
1619
|
+
export declare type FindNextIndexParams = {
|
|
1620
|
+
from: number;
|
|
1621
|
+
direction: 'forward' | 'backward';
|
|
1622
|
+
count: number;
|
|
1623
|
+
isEligible: (index: number) => boolean;
|
|
1624
|
+
};
|
|
1625
|
+
|
|
1573
1626
|
export declare const FloatingTooltip: __VLS_WithTemplateSlots_5<typeof __VLS_component_5, __VLS_TemplateResult_5["slots"]>;
|
|
1574
1627
|
|
|
1628
|
+
export declare type GridAria = {
|
|
1629
|
+
'aria-rowcount': number;
|
|
1630
|
+
'aria-colcount'?: number;
|
|
1631
|
+
};
|
|
1632
|
+
|
|
1633
|
+
/** Full counts for the grid (or list) root, header rows and columns included. */
|
|
1634
|
+
export declare function gridAria(params: GridAriaParams): GridAria;
|
|
1635
|
+
|
|
1636
|
+
export declare type GridAriaParams = {
|
|
1637
|
+
rowCount: number;
|
|
1638
|
+
/** omitted for a list */
|
|
1639
|
+
columnCount?: number;
|
|
1640
|
+
headerRows?: number;
|
|
1641
|
+
headerColumns?: number;
|
|
1642
|
+
};
|
|
1643
|
+
|
|
1644
|
+
/** A cell of a grid, both indices 0-based over the data (header rows and columns not counted). */
|
|
1645
|
+
export declare type GridPosition = {
|
|
1646
|
+
row: number;
|
|
1647
|
+
column: number;
|
|
1648
|
+
};
|
|
1649
|
+
|
|
1575
1650
|
/**
|
|
1576
1651
|
* Collapsed members viewport: tall enough to show at least two member cards
|
|
1577
1652
|
* fully; extra members overflow (scroll) - a partial card at the bottom is fine.
|
|
@@ -1675,6 +1750,16 @@ export declare function highlightCode(code: string, options?: {
|
|
|
1675
1750
|
|
|
1676
1751
|
export declare function isGroupId(id: string): boolean;
|
|
1677
1752
|
|
|
1753
|
+
/**
|
|
1754
|
+
* The mounted items in the order a flow layout renders them: kept items before the range, the range,
|
|
1755
|
+
* kept items after it. The spacers go between them (`computeSpacers`).
|
|
1756
|
+
*/
|
|
1757
|
+
export declare type KeptSplit<T> = {
|
|
1758
|
+
before: T[];
|
|
1759
|
+
inRange: T[];
|
|
1760
|
+
after: T[];
|
|
1761
|
+
};
|
|
1762
|
+
|
|
1678
1763
|
export declare const KEY_SEPARATOR = "\0";
|
|
1679
1764
|
|
|
1680
1765
|
export declare type LayoutDirection = 'UP' | 'DOWN' | 'LEFT' | 'RIGHT';
|
|
@@ -1793,6 +1878,19 @@ export declare type LibraryBrowserSource = {
|
|
|
1793
1878
|
|
|
1794
1879
|
export declare type LineStatus = 'added' | 'removed' | 'unchanged';
|
|
1795
1880
|
|
|
1881
|
+
/** A commit as `LiveDataDependsOn` reads it: its document and the records it changed. */
|
|
1882
|
+
export declare type LiveDataCommit = {
|
|
1883
|
+
documentId: string;
|
|
1884
|
+
changes: CommitChanges;
|
|
1885
|
+
};
|
|
1886
|
+
|
|
1887
|
+
/**
|
|
1888
|
+
* What a live view reads, so a commit that touches none of it refetches nothing: the tag names it reads (a commit
|
|
1889
|
+
* creating, updating or deleting one of them refetches), or a predicate over a commit's changed records. A commit
|
|
1890
|
+
* whose changes are unknown always refetches.
|
|
1891
|
+
*/
|
|
1892
|
+
export declare type LiveDataDependsOn = ReadonlyArray<string> | ((commit: LiveDataCommit) => boolean);
|
|
1893
|
+
|
|
1796
1894
|
/**
|
|
1797
1895
|
* Minimal slice of a `Document` consumed by `useLiveData`: the id it queries
|
|
1798
1896
|
* and the project channel it listens on. Structural (not `Pick<Document, ...>`)
|
|
@@ -1815,6 +1913,35 @@ export declare function matchName({ match, value }: NameFilter, name: string | u
|
|
|
1815
1913
|
*/
|
|
1816
1914
|
export declare function memberCardHeight(hasChildCounts: boolean): number;
|
|
1817
1915
|
|
|
1916
|
+
/** The range plus the kept indices that exist, each once, ascending. */
|
|
1917
|
+
export declare function mergeKeptIndices(params: MergeKeptIndicesParams): number[];
|
|
1918
|
+
|
|
1919
|
+
export declare type MergeKeptIndicesParams = {
|
|
1920
|
+
/** the indices the virtualizer would mount (visible + overscan), ascending */
|
|
1921
|
+
range: readonly number[];
|
|
1922
|
+
/** indices that stay mounted wherever they are */
|
|
1923
|
+
keep: readonly number[];
|
|
1924
|
+
count: number;
|
|
1925
|
+
};
|
|
1926
|
+
|
|
1927
|
+
/**
|
|
1928
|
+
* The cell a navigation key leads to, clamped to the grid. `undefined` when the key does not move
|
|
1929
|
+
* (the caller leaves the event alone) or the grid is empty.
|
|
1930
|
+
*/
|
|
1931
|
+
export declare function moveGridPosition(params: MoveGridPositionParams): GridPosition | undefined;
|
|
1932
|
+
|
|
1933
|
+
export declare type MoveGridPositionParams = {
|
|
1934
|
+
position: GridPosition;
|
|
1935
|
+
/** `KeyboardEvent.key` */
|
|
1936
|
+
key: string;
|
|
1937
|
+
/** Ctrl or Meta held: Home/End go to the grid's corners */
|
|
1938
|
+
ctrlKey?: boolean;
|
|
1939
|
+
rowCount: number;
|
|
1940
|
+
columnCount: number;
|
|
1941
|
+
/** rows that fit in the viewport; PageUp/PageDown move by this much */
|
|
1942
|
+
rowsPerPage: number;
|
|
1943
|
+
};
|
|
1944
|
+
|
|
1818
1945
|
export declare const MultiSelect: DefineComponent<__VLS_PublicProps_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
1819
1946
|
"update:modelValue": (value: string[]) => any;
|
|
1820
1947
|
"update:open": (value: boolean) => any;
|
|
@@ -1978,6 +2105,18 @@ export declare type RecordWithCache<TRecord extends LayoutTreeRecord = LayoutTre
|
|
|
1978
2105
|
visibleChildIds: Set<string>;
|
|
1979
2106
|
};
|
|
1980
2107
|
|
|
2108
|
+
export declare type RowAria = {
|
|
2109
|
+
'aria-rowindex': number;
|
|
2110
|
+
};
|
|
2111
|
+
|
|
2112
|
+
/** 1-based position of a mounted data row, below the header rows. */
|
|
2113
|
+
export declare function rowAria(params: RowAriaParams): RowAria;
|
|
2114
|
+
|
|
2115
|
+
export declare type RowAriaParams = {
|
|
2116
|
+
index: number;
|
|
2117
|
+
headerRows?: number;
|
|
2118
|
+
};
|
|
2119
|
+
|
|
1981
2120
|
export declare interface RowSortController<TRow, TColId extends string> {
|
|
1982
2121
|
isSortable: (column: TColId) => boolean;
|
|
1983
2122
|
getDirection: (column: TColId) => SortDirection | null;
|
|
@@ -1995,16 +2134,49 @@ export declare const SclExplorer: __VLS_WithTemplateSlots_7<typeof __VLS_compone
|
|
|
1995
2134
|
|
|
1996
2135
|
export declare const SclTree: __VLS_WithTemplateSlots_6<typeof __VLS_component_6, __VLS_TemplateResult_6["slots"]>;
|
|
1997
2136
|
|
|
2137
|
+
export declare type ScrollAlign = 'start' | 'center' | 'end' | 'auto';
|
|
2138
|
+
|
|
2139
|
+
/** a scroller's visible size in px */
|
|
2140
|
+
export declare type ScrollRect = {
|
|
2141
|
+
width: number;
|
|
2142
|
+
height: number;
|
|
2143
|
+
};
|
|
2144
|
+
|
|
2145
|
+
export declare type ScrollToCellParams = {
|
|
2146
|
+
row: number;
|
|
2147
|
+
column: number;
|
|
2148
|
+
align?: ScrollAlign;
|
|
2149
|
+
};
|
|
2150
|
+
|
|
2151
|
+
export declare type ScrollToIndexParams = {
|
|
2152
|
+
index: number;
|
|
2153
|
+
align?: ScrollAlign;
|
|
2154
|
+
};
|
|
2155
|
+
|
|
1998
2156
|
export declare const SelectorInput: __VLS_WithTemplateSlots_9<typeof __VLS_component_9, __VLS_TemplateResult_9["slots"]>;
|
|
1999
2157
|
|
|
2000
2158
|
export declare function serializeNoteData({ categories, otherTags, ...rest }: NoteData): string;
|
|
2001
2159
|
|
|
2002
2160
|
export declare type SortDirection = 'asc' | 'desc';
|
|
2003
2161
|
|
|
2162
|
+
/** Heights of the spacer rows above and below the mounted items of a flow layout (`<table>`). */
|
|
2163
|
+
export declare type Spacers = {
|
|
2164
|
+
before: number;
|
|
2165
|
+
after: number;
|
|
2166
|
+
};
|
|
2167
|
+
|
|
2004
2168
|
export declare const Spinner: DefineComponent<__VLS_Props_24, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_24> & Readonly<{}>, {
|
|
2005
2169
|
size: number;
|
|
2006
2170
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLSpanElement>;
|
|
2007
2171
|
|
|
2172
|
+
/** Kept items above the range, the range, kept items below it; with no range, every kept item first. */
|
|
2173
|
+
export declare function splitKeptItems<T extends Pick<VirtualItem, 'start' | 'kept'>>(params: SplitKeptItemsParams<T>): KeptSplit<T>;
|
|
2174
|
+
|
|
2175
|
+
export declare type SplitKeptItemsParams<T extends Pick<VirtualItem, 'start' | 'kept'>> = {
|
|
2176
|
+
/** the mounted items in index order */
|
|
2177
|
+
items: readonly T[];
|
|
2178
|
+
};
|
|
2179
|
+
|
|
2008
2180
|
export declare const SplitLayout: __VLS_WithTemplateSlots_10<typeof __VLS_component_10, __VLS_TemplateResult_10["slots"]>;
|
|
2009
2181
|
|
|
2010
2182
|
export declare const StatusBar: __VLS_WithTemplateSlots_11<typeof __VLS_component_11, __VLS_TemplateResult_11["slots"]>;
|
|
@@ -2181,16 +2353,20 @@ export declare function useDocumentState(doc: MaybeRefOrGetter<ReactiveDocument
|
|
|
2181
2353
|
* {@link useProjectLiveData}. This lets a caller pass a document that is null
|
|
2182
2354
|
* before hydration or during a teardown/switch without pre-guarding a value
|
|
2183
2355
|
* that would otherwise throw.
|
|
2356
|
+
*
|
|
2357
|
+
* `dependsOn` limits the refetch to the commits that touch what the view reads (see {@link LiveDataDependsOn});
|
|
2358
|
+
* without it every commit of the document refetches.
|
|
2184
2359
|
*/
|
|
2185
2360
|
export declare function useLiveData<T>(params: {
|
|
2186
2361
|
document: MaybeRefOrGetter<LiveDataDocument | undefined>;
|
|
2187
2362
|
fetcher: () => Promise<T>;
|
|
2188
2363
|
initial: T;
|
|
2364
|
+
dependsOn?: LiveDataDependsOn;
|
|
2189
2365
|
}): {
|
|
2190
2366
|
state: Ref<T, T>;
|
|
2191
2367
|
isLoading: Ref<boolean, boolean>;
|
|
2192
2368
|
error: Ref<unknown, unknown>;
|
|
2193
|
-
refresh: (
|
|
2369
|
+
refresh: () => Promise<void>;
|
|
2194
2370
|
};
|
|
2195
2371
|
|
|
2196
2372
|
export declare function useOptionalRowSortContext(): RowSortHeaderModel | undefined;
|
|
@@ -2199,6 +2375,7 @@ export declare function useOptionalRowSortContext(): RowSortHeaderModel | undefi
|
|
|
2199
2375
|
* Async data that refetches when anything in the project changes:
|
|
2200
2376
|
* commits on any document, imports, removals, new documents.
|
|
2201
2377
|
* Trigger source: the project's BroadcastChannel (see {@link useDialecteChannel}).
|
|
2378
|
+
* `dependsOn` limits the refetch on commits only (see {@link LiveDataDependsOn}).
|
|
2202
2379
|
*/
|
|
2203
2380
|
export declare function useProjectLiveData<T>(params: {
|
|
2204
2381
|
project: MaybeRefOrGetter<{
|
|
@@ -2206,11 +2383,12 @@ export declare function useProjectLiveData<T>(params: {
|
|
|
2206
2383
|
} | undefined>;
|
|
2207
2384
|
fetcher: () => Promise<T>;
|
|
2208
2385
|
initial: T;
|
|
2386
|
+
dependsOn?: LiveDataDependsOn;
|
|
2209
2387
|
}): {
|
|
2210
2388
|
state: Ref<T, T>;
|
|
2211
2389
|
isLoading: Ref<boolean, boolean>;
|
|
2212
2390
|
error: Ref<unknown, unknown>;
|
|
2213
|
-
refresh: (
|
|
2391
|
+
refresh: () => Promise<void>;
|
|
2214
2392
|
};
|
|
2215
2393
|
|
|
2216
2394
|
/**
|
|
@@ -2224,10 +2402,86 @@ export declare interface UseRowSortConfig<TRow, TColId extends string> {
|
|
|
2224
2402
|
sortAccessors: Partial<Record<TColId, (row: TRow) => string>>;
|
|
2225
2403
|
}
|
|
2226
2404
|
|
|
2405
|
+
export declare type UseVirtualScroller = {
|
|
2406
|
+
/** mounted rows in index order: visible + overscan + kept */
|
|
2407
|
+
rows: ComputedRef<VirtualItem[]>;
|
|
2408
|
+
/** mounted columns in index order; empty without a columns axis */
|
|
2409
|
+
columns: ComputedRef<VirtualItem[]>;
|
|
2410
|
+
totalSize: ComputedRef<{
|
|
2411
|
+
height: number;
|
|
2412
|
+
width: number;
|
|
2413
|
+
}>;
|
|
2414
|
+
/** spacer row heights for a flow layout that renders `rows` in order (`<table>`) */
|
|
2415
|
+
spacers: ComputedRef<Spacers>;
|
|
2416
|
+
/** `{ start: 0, end: -1 }` before the first layout or without rows */
|
|
2417
|
+
visibleRange: ComputedRef<VisibleRange>;
|
|
2418
|
+
/** rows fully visible below the pinned band, at least 1: the PageUp/PageDown step */
|
|
2419
|
+
rowsPerPage: ComputedRef<number>;
|
|
2420
|
+
/** template ref callback for measured rows; the element carries `data-index` */
|
|
2421
|
+
measureRow: (element: unknown) => void;
|
|
2422
|
+
scrollToIndex: (params: ScrollToIndexParams) => void;
|
|
2423
|
+
scrollToCell: (params: ScrollToCellParams) => void;
|
|
2424
|
+
};
|
|
2425
|
+
|
|
2426
|
+
/**
|
|
2427
|
+
* Mounts only the rows (and columns) near the viewport of `scrollElement`. The view keeps its own
|
|
2428
|
+
* markup: it positions `rows` / `columns` by their `start`, or renders them in flow between spacers.
|
|
2429
|
+
*/
|
|
2430
|
+
export declare function useVirtualScroller(params: UseVirtualScrollerParams): UseVirtualScroller;
|
|
2431
|
+
|
|
2432
|
+
export declare type UseVirtualScrollerParams = {
|
|
2433
|
+
/** the element that scrolls; sticky headers and pinned rows live inside it */
|
|
2434
|
+
scrollElement: Readonly<Ref<HTMLElement | null | undefined>>;
|
|
2435
|
+
rows: VirtualAxis;
|
|
2436
|
+
/** a grid: columns of fixed width */
|
|
2437
|
+
columns?: Omit<VirtualAxis, 'measured'>;
|
|
2438
|
+
/**
|
|
2439
|
+
* the scroller's size assumed by the first render, used until the scroller is first measured: the
|
|
2440
|
+
* first render then mounts the rows (and columns) of that size instead of none. Read once at setup.
|
|
2441
|
+
*/
|
|
2442
|
+
initialRect?: ScrollRect;
|
|
2443
|
+
};
|
|
2444
|
+
|
|
2227
2445
|
export declare function validateSearchText(value: string): string | undefined;
|
|
2228
2446
|
|
|
2229
2447
|
export declare function validateXpath(xpath: string): string | undefined;
|
|
2230
2448
|
|
|
2449
|
+
/** One axis of `useVirtualScroller`. */
|
|
2450
|
+
export declare type VirtualAxis = {
|
|
2451
|
+
count: MaybeRefOrGetter<number>;
|
|
2452
|
+
/**
|
|
2453
|
+
* fixed size in px, or a function of the index (the estimate when `measured`), each optionally in
|
|
2454
|
+
* a ref. The axis is laid out again when the ref gets a new value, and when a reactive value read
|
|
2455
|
+
* by `size(0)` changes. To change per-index sizes, set a new function in the ref.
|
|
2456
|
+
*/
|
|
2457
|
+
size: MaybeRef<VirtualSize>;
|
|
2458
|
+
/** rows only: sizes read from the mounted elements (`measureRow`) */
|
|
2459
|
+
measured?: boolean;
|
|
2460
|
+
overscan?: MaybeRefOrGetter<number>;
|
|
2461
|
+
/** indices kept mounted wherever they are (a pinned group row, the focused item) */
|
|
2462
|
+
keep?: MaybeRefOrGetter<readonly number[]>;
|
|
2463
|
+
/** a pinned band at the start (sticky header, pinned row): scrolling to an item lands after it */
|
|
2464
|
+
scrollPaddingStart?: MaybeRefOrGetter<number>;
|
|
2465
|
+
/** space before item 0 inside the scroller (a header band in flow) */
|
|
2466
|
+
paddingStart?: MaybeRefOrGetter<number>;
|
|
2467
|
+
getKey?: (index: number) => VirtualKey;
|
|
2468
|
+
};
|
|
2469
|
+
|
|
2470
|
+
/** One mounted item of an axis. `kept` = mounted only because it is kept, outside the range. */
|
|
2471
|
+
export declare type VirtualItem = {
|
|
2472
|
+
index: number;
|
|
2473
|
+
key: VirtualKey;
|
|
2474
|
+
start: number;
|
|
2475
|
+
size: number;
|
|
2476
|
+
kept: boolean;
|
|
2477
|
+
};
|
|
2478
|
+
|
|
2479
|
+
/** A stable identity for an item across renders (the virtualizer's key). */
|
|
2480
|
+
export declare type VirtualKey = number | string;
|
|
2481
|
+
|
|
2482
|
+
/** A fixed size in px, or the size of each index. */
|
|
2483
|
+
export declare type VirtualSize = number | ((index: number) => number);
|
|
2484
|
+
|
|
2231
2485
|
/** Options that drive which nodes are initially visible. */
|
|
2232
2486
|
export declare type VisibilityOptions = {
|
|
2233
2487
|
expandedNodeIds: Set<string>;
|
|
@@ -2235,6 +2489,13 @@ export declare type VisibilityOptions = {
|
|
|
2235
2489
|
defaultOpenDepth: number;
|
|
2236
2490
|
};
|
|
2237
2491
|
|
|
2492
|
+
export declare type VisibleRange = {
|
|
2493
|
+
/** first row at least partly visible below the pinned band (`scrollPaddingStart`) */
|
|
2494
|
+
start: number;
|
|
2495
|
+
/** last row at least partly visible */
|
|
2496
|
+
end: number;
|
|
2497
|
+
};
|
|
2498
|
+
|
|
2238
2499
|
export declare const XmlDiff: DefineComponent<__VLS_Props_15, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_15> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
2239
2500
|
|
|
2240
2501
|
export declare type XpathBuilderState = {
|
package/dist/index.js
CHANGED
|
@@ -68,4 +68,10 @@ import { useDiagramLayout as Oe } from "./diagram-layout/use-diagram-layout.js";
|
|
|
68
68
|
import ke from "./diagram-layout/diagram-node-card.js";
|
|
69
69
|
import Ae from "./diagram-layout/diagram-node-group.js";
|
|
70
70
|
import "./diagram-layout/index.js";
|
|
71
|
-
|
|
71
|
+
import { DEFAULT_OVERSCAN as je } from "./virtual/virtual.constants.js";
|
|
72
|
+
import { computeSpacers as Me, mergeKeptIndices as Ne, splitKeptItems as Pe } from "./virtual/kept-range.js";
|
|
73
|
+
import { useVirtualScroller as Fe } from "./virtual/use-virtual-scroller.js";
|
|
74
|
+
import { findNextIndex as Ie, moveGridPosition as Le } from "./virtual/grid-navigation.js";
|
|
75
|
+
import { cellAria as Re, gridAria as ze, rowAria as Be } from "./virtual/grid-aria.js";
|
|
76
|
+
import "./virtual/index.js";
|
|
77
|
+
export { s as Button, x as CATEGORY_ELEMENTS, A as CodeBlock, l as Combobox, te as ContextMenu, je as DEFAULT_OVERSCAN, ke as DiagramNodeCard, Ae as DiagramNodeGroup, p as Dialog, y as DialogHost, b as DocumentProgressBar, c as Dropdown, S as ELEMENT_TO_COLOR, C as ELEMENT_TO_ICON, w as ElementBadge, m as FeedbackDialog, ee as FilterableColumnHeader, u as FloatingTooltip, ve as GROUP_COLLAPSED_MEMBERS_HEIGHT, ye as GROUP_HEADER_HEIGHT, be as GROUP_MEMBER_GAP, xe as GROUP_MEMBER_HEIGHT, Se as GROUP_MEMBER_HEIGHT_COMPACT, B as KEY_SEPARATOR, O as LibraryBrowser, d as MultiSelect, N as NOTE_CATEGORIES, P as NOTE_CATEGORY_LABELS, F as NOTE_STATUSES, V as NO_VALUE_KEY, z as NoteCategoryPicker, R as NoteCategoryTag, de as ProgressBar, D as SclExplorer, E as SclTree, se as SelectorInput, fe as Spinner, ce as SplitLayout, le as StatusBar, ue as StatusBarItem, f as TextInputAutocomplete, M as XmlDiff, pe as applyInitialVisibility, H as buildFlatOptions, U as buildMultiValueOptions, me as buildRecordCache, W as buildTreeOptions, ne as buildXpath, Re as cellAria, T as collectExpandableNodeIds, G as collectLeafKeys, K as collectParentKeys, he as collectVisibleIds, we as computeGroups, Me as computeSpacers, h as createDialogHost, e as createDocumentStore, De as createElkLayoutEngine, g as dialogHostKey, j as diffLines, q as filterTree, Ie as findNextIndex, ze as gridAria, _e as groupStackMetrics, ge as hideDescendants, k as highlightCode, Te as isGroupId, Ee as makeGroupId, re as matchName, Ce as memberCardHeight, Ne as mergeKeptIndices, Le as moveGridPosition, I as parseNoteData, ie as parseXpath, X as provideColumnFilterHeader, _ as provideDialogHost, Q as provideRowSortHeader, Be as rowAria, L as serializeNoteData, Pe as splitKeptItems, i as useActiveDocument, Z as useColumnFilterHeaderContext, J as useColumnFilters, Oe as useDiagramLayout, t as useDialecteChannel, v as useDialog, a as useDocumentProgress, o as useDocumentState, n as useLiveData, $ as useOptionalRowSortContext, r as useProjectLiveData, Y as useRowSort, Fe as useVirtualScroller, ae as validateSearchText, oe as validateXpath };
|