@revolist/ui 4.0.6-rc → 4.0.6
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/MIGRATION.md +7 -7
- package/OWNERSHIP.md +33 -33
- package/README.md +65 -410
- package/_button.scss +6 -2
- package/_chunks/{calendar-QWDyYzdo.js → calendar-BQYQLu8Q.js} +5 -5
- package/_chunks/{cell-visuals-E-2oEKHg.js → cell-visuals-r6DOOhGh.js} +7 -7
- package/_chunks/{chart-frame-hcOlnQ1K.js → chart-frame-GprenwEg.js} +4 -4
- package/_chunks/{chevron-left-D0nc4Z5S.js → chevron-right-CM3ljziP.js} +2 -2
- package/_chunks/{choice-chips-A6WR-WJe.js → choice-chips-C5OxD0GV.js} +3 -3
- package/_chunks/{color-palette-DMJUChWC.js → color-palette-7siNch__.js} +3 -3
- package/_chunks/{color-picker-BK4W1nd6.js → color-picker-Cfc9eqZb.js} +4 -4
- package/_chunks/{component-CMkF17YZ.js → component-C3k_8uIq.js} +44 -45
- package/_chunks/{component-metadata-BKd7U8OW.js → component-metadata-DlVkpW3h.js} +1 -1
- package/_chunks/{configurator-actions-By8WSL2m.js → configurator-actions-vRnI54mO.js} +3 -3
- package/_chunks/{control-mlH7l0Uq.js → control-BRfF5DWQ.js} +3 -3
- package/_chunks/{controller-hRBm_Lfz.js → controller-BbiQuRt-.js} +5 -5
- package/_chunks/{controls-FUU-MUKC.js → controls-B3EgM_DS.js} +137 -102
- package/_chunks/{date-control-Dup_P3w5.js → date-control-87dcA5br.js} +5 -5
- package/_chunks/{date-time-9z6pAG5T.js → date-time-CfiFYodx.js} +20 -20
- package/_chunks/{delete-button-CW9vjLnk.js → delete-button-jneO24wa.js} +1 -1
- package/_chunks/{dialog.parts-Bi7YbXqS.js → dialog.parts-NqEEVc9P.js} +4 -4
- package/_chunks/{duration-D7oRjsmP.js → duration-BGZ_qJ99.js} +6 -6
- package/_chunks/{editor-commit-Bq3wSgvr.js → editor-commit-Dyo-FMgD.js} +1 -1
- package/_chunks/{editor-popup-ByU7qiub.js → editor-popup-NNP9Fh9U.js} +4 -4
- package/_chunks/field-configurator-DPulsY3l.js +288 -0
- package/_chunks/{field-context-D57PnBbH.js → field-context-C4_WrO2z.js} +1 -1
- package/_chunks/{framework-mount-Bk4O_T7T.js → framework-mount-D4I8HpVp.js} +2 -2
- package/_chunks/{icon-toolbar-DSjOdwM7.js → icon-toolbar-BAAdEvr9.js} +2 -2
- package/_chunks/{icons-Ci5mADVc.js → icons-B4qN13Yj.js} +1 -1
- package/_chunks/{iso-B0YHBK7m.js → iso-CJQl2kmq.js} +1 -1
- package/_chunks/{model-mPO2tG2f.js → model-CFrBgRHm.js} +3 -3
- package/_chunks/mount-C8CnIW9k.js +267 -0
- package/_chunks/{native-Blr3byjO.js → native-CJm3eq3-.js} +1 -1
- package/_chunks/{native-control-pFMuHf3G.js → native-control-um1L1wgZ.js} +143 -138
- package/_chunks/{number-input-DqXV6vgP.js → number-input-CKiA4d1N.js} +4 -4
- package/_chunks/{picker-gEGTu1Ki.js → picker-igNshTRC.js} +5 -5
- package/_chunks/{popup-C35Isk7p.js → popup-DECYM9FI.js} +2 -2
- package/_chunks/{rating-choice-DbxdUJr-.js → rating-choice-CepVfGUq.js} +2 -2
- package/_chunks/{render-m5eMMwFR.js → render-bTk3curw.js} +2 -2
- package/_chunks/{reorder-list-B0_13Sja.js → reorder-list-B4w3aARt.js} +2 -2
- package/_chunks/{request-trail-CCSK6TJA.js → request-trail-B1zVRPEf.js} +151 -142
- package/_chunks/{rich-text-5rnc8lpI.js → rich-text-Ci4d6dHn.js} +11 -11
- package/_chunks/selection-list-tooltips-m00U3L6z.js +42 -0
- package/_chunks/{title-tooltip-Cw6LOZhb.js → title-tooltip-ncldbUwS.js} +2 -2
- package/_chunks/{tooltip-D4xkio5G.js → tooltip-h-Z8yFBY.js} +2 -2
- package/_chunks/{tooltip-owner-DjdvqKzz.js → tooltip-owner-BYho-vJl.js} +1 -1
- package/_chunks/{tooltip-session-B6X6x8G_.js → tooltip-session-CBtRMBPr.js} +3 -3
- package/_chunks/{tooltip-text-BXsUEmBH.js → tooltip-text-BN5WdGHn.js} +2 -2
- package/_chunks/{top-layer-popup-CNSDdfJV.js → top-layer-popup-CKJ7VJOF.js} +3 -3
- package/_dialog.scss +57 -22
- package/_form.scss +71 -21
- package/_legend.scss +25 -7
- package/_variables.scss +2 -1
- package/_view-switcher.scss +6 -0
- package/activity-message.d.ts +1 -1
- package/activity-message.js +1 -1
- package/ai/_chat.scss +7 -0
- package/ai/_style.scss +27 -20
- package/ai/components.d.ts +3 -1
- package/ai/index.js +2 -2
- package/ai/mount.d.ts +15 -7
- package/ai/request-trail.d.ts +9 -3
- package/ai/results/index.d.ts +1 -1
- package/ai/translations.d.ts +1 -1
- package/angular/angular.d.ts +1 -1
- package/angular/angular.js +13 -7
- package/assignee/assignee.scss +24 -6
- package/assignee/index.js +6 -6
- package/avatar/avatar.style.scss +23 -6
- package/avatar/index.d.ts +1 -1
- package/avatar/index.js +2 -2
- package/badge.d.ts +1 -1
- package/badge.js +1 -1
- package/badge.view.d.ts +1 -1
- package/brush-range/_brush-range.scss +55 -49
- package/brush-range/component.js +2 -2
- package/buttons/delete-button.js +1 -1
- package/buttons/delete-button.style.scss +6 -2
- package/buttons/remove-button.js +2 -2
- package/buttons/svg-button.js +3 -3
- package/calendar/_calendar.scss +19 -23
- package/calendar/calendar.js +1 -1
- package/calendar/day.js +2 -2
- package/calendar/header.js +2 -3
- package/calendar/index.js +3 -3
- package/calendar/model.js +1 -1
- package/calendar/month-grid.js +2 -2
- package/calendar/translations.js +1 -1
- package/calendar/year-grid.js +2 -2
- package/cell-input.js +1 -1
- package/cell-input.scss +3 -7
- package/cell-visuals/badge.style.scss +6 -3
- package/cell-visuals/bar-chart.style.scss +2 -1
- package/cell-visuals/column-type.style.css +12 -0
- package/cell-visuals/index.js +1 -1
- package/cell-visuals/progress-line-value.renderer.style.scss +4 -2
- package/cell-visuals/progress-line.style.scss +1 -4
- package/cell-visuals/sparkline.style.scss +2 -1
- package/cell-visuals/timeline.style.css +4 -2
- package/checkbox/checkbox.scss +5 -2
- package/checkbox/index.js +1 -1
- package/choice-chips/index.js +1 -1
- package/color-palette/built-in-palettes.js +1 -1
- package/color-palette/chart-palettes.js +1 -1
- package/color-palette/color-palette.js +1 -1
- package/color-palette/color-palette.style.scss +88 -25
- package/color-palette/color-picker.constants.js +1 -1
- package/color-palette/color-picker.js +2 -2
- package/color-palette/color-picker.style.scss +23 -10
- package/color-palette/common-palettes.d.ts +1 -1
- package/color-palette/common-palettes.js +2 -2
- package/color-palette/gantt-palettes.js +1 -1
- package/color-palette/palette.js +1 -1
- package/color-palette/pivot-palettes.js +1 -1
- package/color-palette/platform-palettes.js +1 -1
- package/color-palette/pro-palettes.js +1 -1
- package/color-palette/scheduler-palettes.js +1 -1
- package/configurator-actions.d.ts +6 -6
- package/configurator-actions.js +1 -1
- package/configurator-aggregation-list.d.ts +1 -1
- package/configurator-aggregation-list.js +19 -17
- package/configurator-drop-zone.d.ts +2 -1
- package/configurator-drop-zone.js +34 -32
- package/configurator-focus.js +1 -1
- package/configurator-sections.d.ts +3 -3
- package/configurator-sections.js +1 -1
- package/control-attributes.js +1 -1
- package/control-presentation.js +2 -2
- package/controls.d.ts +11 -0
- package/controls.js +4 -4
- package/core/anchored-popover.js +1 -1
- package/core/control-id.js +1 -1
- package/core/editor-popup.js +1 -1
- package/core/motion.js +1 -1
- package/{_chunks/popover-controller-D-AvKQ7B.js → core/popover-controller.js} +8 -8
- package/core/selection-list-tooltips.d.ts +2 -0
- package/core/tooltip.d.ts +1 -1
- package/core/top-layer-popup.d.ts +1 -1
- package/core/top-layer-popup.js +1 -1
- package/date-time/date-control.d.ts +1 -1
- package/date-time/field.d.ts +1 -0
- package/date-time/index.js +1 -1
- package/date-time/style.scss +192 -46
- package/date-time/time-selection.d.ts +1 -1
- package/dialog/dialog.dom.js +3 -3
- package/dialog/dialog.drag.js +1 -1
- package/dialog/dialog.parts.js +1 -1
- package/dialog/dialog.preact.js +1 -1
- package/distribution-chart/_distribution-chart.scss +106 -28
- package/distribution-chart/area-chart.js +2 -2
- package/distribution-chart/bar-chart.js +2 -2
- package/distribution-chart/chart-frame.d.ts +1 -1
- package/distribution-chart/index.js +1 -1
- package/distribution-chart/line-chart.js +2 -2
- package/dropdown/content.js +1 -1
- package/dropdown/control.js +1 -1
- package/dropdown/dropdown.service.js +1 -1
- package/dropdown/dropdown.types.d.ts +1 -1
- package/dropdown/editor-dropdown.style.scss +14 -9
- package/dropdown/index.js +2 -2
- package/dropdown/lookup-field.js +3 -3
- package/dropdown/popup.js +1 -1
- package/duration/index.js +1 -1
- package/editor-actions.js +2 -2
- package/editor-layout/index.d.ts +4 -4
- package/editor-layout/index.js +40 -35
- package/editor-layout/style.scss +82 -18
- package/favicon.svg +9 -0
- package/field-configurator.d.ts +14 -3
- package/field-configurator.js +1 -1
- package/field-reorder.hook.js +1 -1
- package/field-reorder.js +1 -1
- package/filter/filters/slider/_single-slider.scss +57 -38
- package/filter/filters/slider/_slider.scss +35 -10
- package/filter/filters/slider/component.js +1 -1
- package/filter/filters/slider/control.js +1 -1
- package/filter/filters/slider/inputs.js +1 -1
- package/filter/filters/slider/logic.js +1 -1
- package/filter/filters/slider/preact.js +1 -1
- package/filter/filters/slider/runtime.js +3 -3
- package/filter/filters/slider/single.js +2 -2
- package/filter-badge.js +2 -2
- package/filter-controls.js +2 -2
- package/form-controls/index.js +3 -3
- package/form-controls/presentation.d.ts +1 -1
- package/form-controls/presentation.js +2 -2
- package/formatting/index.js +7 -7
- package/formatting/styles.scss +13 -11
- package/framework.js +76 -77
- package/history-controls.js +1 -1
- package/html-controls.js +1 -1
- package/icon-toolbar.d.ts +1 -1
- package/icon-toolbar.js +1 -1
- package/icons/icon.d.ts +1 -1
- package/icons/icon.js +1 -1
- package/legend.d.ts +1 -1
- package/legend.js +1 -1
- package/masked-input/index.js +4 -4
- package/native-control.js +1 -1
- package/native-styles.css +1 -1
- package/native-styles.scss +6 -2
- package/native.d.ts +3 -3
- package/native.js +16 -16
- package/number-input/index.d.ts +1 -1
- package/number-input/index.js +1 -1
- package/package.json +49 -1
- package/pagination.js +2 -2
- package/pdf-viewer/controller.js +1 -1
- package/pdf-viewer/header.d.ts +1 -1
- package/pdf-viewer/index.d.ts +2 -2
- package/pdf-viewer/index.js +3 -3
- package/pdf-viewer/search-bar.d.ts +1 -1
- package/pdf-viewer/status.d.ts +1 -1
- package/pdf-viewer/style.scss +203 -42
- package/preact-mount.js +1 -1
- package/preact.d.ts +5 -4
- package/preact.js +105 -67
- package/progress/_bar.scss +9 -3
- package/progress/_circular.scss +2 -1
- package/progress/bar.js +1 -1
- package/progress/circular.js +1 -1
- package/progress/range.js +1 -1
- package/rating-choice.js +1 -1
- package/react-adapter.d.ts +4 -2
- package/react-control.js +1 -1
- package/react.d.ts +2 -2
- package/react.js +30 -31
- package/reorder-list.d.ts +1 -1
- package/reorder-list.js +1 -1
- package/reorder-list.scss +59 -17
- package/resource-picker/resource-picker-avatar.js +1 -1
- package/resource-picker/resource-picker-option.js +1 -1
- package/resource-picker/resource-picker-popup.js +2 -2
- package/resource-picker/resource-picker.js +74 -72
- package/resource-picker/resource-picker.scss +62 -34
- package/resource-picker/resource-picker.utils.js +1 -1
- package/rich-text/index.js +1 -1
- package/rich-text/style.scss +203 -49
- package/rich-text/toolbar.d.ts +1 -1
- package/robots.txt +4 -0
- package/search-input/index.js +2 -2
- package/segmented-switch/index.js +1 -1
- package/select.js +1 -1
- package/selection-list.d.ts +1 -0
- package/selection-list.js +3 -1
- package/status-feedback/badge.js +2 -2
- package/status-feedback/exit-snapshot.js +2 -2
- package/status-feedback/header.js +2 -2
- package/status-feedback/icons.js +1 -1
- package/status-feedback/index.js +1 -1
- package/status-feedback/item.js +2 -2
- package/status-feedback/motion.js +1 -1
- package/status-feedback/placement.js +1 -1
- package/status-feedback/popover.js +2 -2
- package/status-feedback/render.js +1 -1
- package/status-feedback/status-feedback.scss +124 -35
- package/styles/_activity-message.scss +24 -7
- package/styles/_alert.scss +61 -14
- package/styles/_cell-editor-frame.scss +11 -0
- package/styles/_compositions.scss +399 -79
- package/styles/_control.scss +30 -8
- package/styles/_disclosure.scss +15 -5
- package/styles/_editor-counter.scss +16 -6
- package/styles/_editor-slider.scss +8 -2
- package/styles/_field-configurator.scss +192 -41
- package/styles/_fields-grid.scss +16 -4
- package/styles/_filter-controls.scss +10 -2
- package/styles/_icon-action.scss +48 -15
- package/styles/_loading.scss +12 -3
- package/styles/_motion.scss +32 -9
- package/styles/_primitives.scss +346 -96
- package/styles/_theme.scss +130 -86
- package/styles/_thresholds.scss +28 -25
- package/styles/_time-grid.scss +8 -3
- package/styles/_tokens.scss +6 -1
- package/styles/color-roles.js +1 -1
- package/styles/configurator-actions.scss +126 -26
- package/styles/pagination.css +114 -30
- package/styles/rating.css +8 -3
- package/styles.css +1 -1
- package/styles.scss +1 -3
- package/surfaces.d.ts +4 -2
- package/surfaces.js +8 -8
- package/svelte/UiComponent.svelte +44 -11
- package/svelte-control.js +1 -1
- package/svelte.d.ts +1 -1
- package/svelte.js +5 -5
- package/switch/index.js +2 -2
- package/time-grid.js +3 -3
- package/timeline-track/_style.scss +96 -24
- package/timeline-track/index.js +3 -3
- package/timeline-track/model.js +1 -1
- package/ui.css +1 -1
- package/view-switcher.d.ts +23 -0
- package/vue-badge.js +1 -1
- package/vue-control.js +1 -1
- package/vue-segmented-switch.js +1 -1
- package/vue.d.ts +3 -2
- package/vue.js +43 -44
- package/_chunks/badge.view-D30pMUfi.js +0 -14
- package/_chunks/chevron-right-sxHQMSkq.js +0 -4
- package/_chunks/field-configurator-BCINdXpU.js +0 -223
- package/_chunks/mount-Cw2zk58T.js +0 -266
- package/_shared/data-query/binding.d.ts +0 -30
- package/_shared/data-query/blocks.d.ts +0 -30
- package/_shared/data-query/commands.d.ts +0 -47
- package/_shared/data-query/contracts.d.ts +0 -106
- package/_shared/data-query/cursor-reader.d.ts +0 -25
- package/_shared/data-query/direct-binding.d.ts +0 -3
- package/_shared/data-query/index.d.ts +0 -23
- package/_shared/data-query/infinite-binding.d.ts +0 -18
- package/_shared/data-query/keys.d.ts +0 -9
- package/_shared/data-query/limiter.d.ts +0 -12
- package/_shared/data-query/load-options.d.ts +0 -25
- package/_shared/data-query/materialize.d.ts +0 -2
- package/_shared/data-query/policy.d.ts +0 -14
- package/_shared/data-query/provider-queries.d.ts +0 -22
- package/_shared/data-query/reader.d.ts +0 -23
- package/_shared/data-query/remote-load.d.ts +0 -7
- package/_shared/data-query/source.d.ts +0 -40
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
import { i as e, r as t } from "./preact.module-BBM36DnO.js";
|
|
2
|
-
import { c as n, i as r, r as i, t as a } from "./hooks.module-CG3gN83z.js";
|
|
3
|
-
import { E as o, _ as s, a as c, c as l, i as u, m as d, n as f, o as p, p as m, r as h, t as g, u as _, v, y } from "./request-trail-CCSK6TJA.js";
|
|
4
|
-
import { t as b } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
5
|
-
import { n as x } from "./popup-C35Isk7p.js";
|
|
6
|
-
import { t as S } from "./controls-FUU-MUKC.js";
|
|
7
|
-
import { HistoryControls as C } from "../history-controls.js";
|
|
8
|
-
import { n as w } from "./render-m5eMMwFR.js";
|
|
9
|
-
//#region src/ai/transcript.ts
|
|
10
|
-
var T = (e) => new TextEncoder().encode(JSON.stringify(e)).byteLength, E = (e) => {
|
|
11
|
-
if (!e) return "";
|
|
12
|
-
if (T(e) <= 16384) return e;
|
|
13
|
-
let t = 0, n = Math.min(e.length, 16384);
|
|
14
|
-
for (; t < n;) {
|
|
15
|
-
let r = Math.ceil((t + n) / 2);
|
|
16
|
-
T(e.slice(0, r) + "…") <= 16384 ? t = r : n = r - 1;
|
|
17
|
-
}
|
|
18
|
-
return /[\uD800-\uDBFF]/.test(e.charAt(t - 1)) && t--, e.slice(0, t) + "…";
|
|
19
|
-
}, D = class {
|
|
20
|
-
messages = [];
|
|
21
|
-
epoch = 0;
|
|
22
|
-
initialized = !1;
|
|
23
|
-
requestId;
|
|
24
|
-
ignoredRequest;
|
|
25
|
-
currentId;
|
|
26
|
-
active = !1;
|
|
27
|
-
lastPhase;
|
|
28
|
-
key = "";
|
|
29
|
-
sequence = 0;
|
|
30
|
-
update(e) {
|
|
31
|
-
if (this.initialized ||= (this.epoch = e.chatKey ?? 0, !0), (e.chatKey ?? 0) !== this.epoch) {
|
|
32
|
-
this.epoch = e.chatKey ?? 0, this.messages = [], this.requestId = void 0, this.ignoredRequest = e.request?.id, this.currentId = void 0, this.active = !1, this.key = "", this.lastPhase = void 0;
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
if (e.phase === "idle" || e.request?.id === this.ignoredRequest && this.ignoredRequest !== void 0) return;
|
|
36
|
-
let t = e.request, n = !!t && t.id !== this.requestId, r = e.phase === "completed" && e.result && T(e.result) <= 16384 ? structuredClone(e.result) : void 0, i = {
|
|
37
|
-
text: E(e.message),
|
|
38
|
-
phase: e.phase,
|
|
39
|
-
details: e.phase === "completed" && !r && e.resultDetails ? E(e.resultDetails) : void 0,
|
|
40
|
-
pending: !!e.pendingAction,
|
|
41
|
-
result: r
|
|
42
|
-
}, a = JSON.stringify([t?.id, i]);
|
|
43
|
-
if (!n && a === this.key || !n && !i.text && !i.pending) return;
|
|
44
|
-
let o = this.messages.find((e) => e.id === this.currentId), s = this.lastPhase === "completed" && e.phase === "understanding" && o?.from === "assistant", c = o?.from === "system" && o.phase === "completed" && (e.phase === "applying" || e.phase === "completed");
|
|
45
|
-
if (n) {
|
|
46
|
-
this.requestId = t.id, this.ignoredRequest = void 0;
|
|
47
|
-
let e = "turn:" + ++this.sequence;
|
|
48
|
-
this.currentId = e + ":assistant", this.messages = [
|
|
49
|
-
...this.messages,
|
|
50
|
-
{
|
|
51
|
-
id: e + ":user",
|
|
52
|
-
group: e,
|
|
53
|
-
from: "user",
|
|
54
|
-
text: E(t.prompt)
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
id: this.currentId,
|
|
58
|
-
group: e,
|
|
59
|
-
from: "assistant",
|
|
60
|
-
...i
|
|
61
|
-
}
|
|
62
|
-
];
|
|
63
|
-
} else if ((this.active || s || c) && o) this.messages = this.messages.map((e) => e.id === this.currentId ? {
|
|
64
|
-
...e,
|
|
65
|
-
...i
|
|
66
|
-
} : e);
|
|
67
|
-
else {
|
|
68
|
-
let e = "system:" + ++this.sequence;
|
|
69
|
-
this.currentId = e, this.messages = [...this.messages, {
|
|
70
|
-
id: e,
|
|
71
|
-
group: e,
|
|
72
|
-
from: "system",
|
|
73
|
-
...i
|
|
74
|
-
}];
|
|
75
|
-
}
|
|
76
|
-
for (this.active = e.phase === "understanding" || e.phase === "applying" || !!e.pendingAction, this.lastPhase = e.phase, this.key = a; this.messages.length > 50 || T(this.messages) > 65536;) {
|
|
77
|
-
let e = this.messages[0].group;
|
|
78
|
-
this.messages = this.messages.filter((t) => t.group !== e);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
clear() {
|
|
82
|
-
this.messages = [], this.requestId = void 0, this.currentId = void 0, this.active = !1, this.key = "";
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
//#endregion
|
|
86
|
-
//#region src/ai/mount.tsx
|
|
87
|
-
function O(T, E) {
|
|
88
|
-
let O = (e) => o(e, E.translations), k = !1, A = E.suggestions ?? [], j, M = v(E.promptHistory?.items ?? []), N = new D(), P = E.mode === "chat", F = [], I = 0, L = !1, R = "";
|
|
89
|
-
function z(e) {
|
|
90
|
-
if (e.phase === "idle" || !e.message || e.pendingAction) return;
|
|
91
|
-
let t = e.phase === "understanding" || e.phase === "applying", n = JSON.stringify([
|
|
92
|
-
e.phase,
|
|
93
|
-
e.message,
|
|
94
|
-
e.matchedRows,
|
|
95
|
-
e.resultDetails
|
|
96
|
-
]);
|
|
97
|
-
if (n === R) return;
|
|
98
|
-
let r = F.at(-1), i = {
|
|
99
|
-
id: L && r ? r.id : String(++I),
|
|
100
|
-
title: e.message,
|
|
101
|
-
busy: t,
|
|
102
|
-
tone: e.phase === "error" ? "danger" : e.phase === "completed" ? "success" : "neutral",
|
|
103
|
-
description: e.phase === "completed" && e.matchedRows !== void 0 ? E.countLabel?.(e.matchedRows) ?? O("{count} matching rows").replace("{count}", e.matchedRows.toLocaleString()) : void 0,
|
|
104
|
-
detail: e.phase === "completed" && !e.result ? e.resultDetails : void 0
|
|
105
|
-
};
|
|
106
|
-
F = [...L && r ? F.slice(0, -1) : F, i].slice(-50), L = t, R = n;
|
|
107
|
-
}
|
|
108
|
-
function B({ state: t }) {
|
|
109
|
-
let [o, D] = r(""), [k, j] = r(M), [I, L] = r(!1), R = a();
|
|
110
|
-
i(() => {
|
|
111
|
-
D(""), R.current = void 0;
|
|
112
|
-
}, [t.chatKey]);
|
|
113
|
-
let z = t.phase === "understanding" || t.phase === "applying", B = !!t.pendingAction, H = t.steps ?? [], U = a(!1);
|
|
114
|
-
n(() => {
|
|
115
|
-
U.current && !B && !z && T.querySelector("textarea")?.focus(), U.current = B || z && U.current;
|
|
116
|
-
}, [B, z]), n(() => {
|
|
117
|
-
if (z || B || t.phase === "idle" || R.current === void 0) return;
|
|
118
|
-
let e = R.current;
|
|
119
|
-
R.current = void 0, t.phase === "completed" && D((t) => t.trim() === e ? "" : t);
|
|
120
|
-
}, [t]);
|
|
121
|
-
let W = (e) => {
|
|
122
|
-
R.current = e.trim(), E.promptHistory && (M = v([...M, e]), j(M), E.promptHistory.onChange?.([...M])), E.onSubmit(e);
|
|
123
|
-
}, G = /* @__PURE__ */ b(s, {
|
|
124
|
-
items: t.choices?.length ? t.choices : t.suggestions?.length ? t.suggestions : A,
|
|
125
|
-
onSelect: (e) => {
|
|
126
|
-
z || B || (D(e), W(e));
|
|
127
|
-
},
|
|
128
|
-
disabled: z || B
|
|
129
|
-
}), K = /* @__PURE__ */ b(h, {
|
|
130
|
-
label: E.prompt?.label ?? "Ask AI to change this view",
|
|
131
|
-
...E.prompt,
|
|
132
|
-
value: o,
|
|
133
|
-
onValueChange: D,
|
|
134
|
-
onSubmit: W,
|
|
135
|
-
onStop: E.onStop,
|
|
136
|
-
busy: z,
|
|
137
|
-
promptHistory: E.promptHistory ? k : void 0,
|
|
138
|
-
disabled: B,
|
|
139
|
-
hint: H.length ? "" : E.prompt?.hint,
|
|
140
|
-
footer: G,
|
|
141
|
-
actions: /* @__PURE__ */ b(g, {
|
|
142
|
-
...E.trail,
|
|
143
|
-
items: H,
|
|
144
|
-
onRemove: (e) => E.onRemoveStep?.(e),
|
|
145
|
-
onClear: E.onReset,
|
|
146
|
-
onEmpty: () => T.querySelector("textarea")?.focus(),
|
|
147
|
-
disabled: z || B,
|
|
148
|
-
removalsDisabled: !E.onRemoveStep || t.canEditSteps === !1,
|
|
149
|
-
clearDescription: E.trail?.clearDescription ?? "Restore the starting view",
|
|
150
|
-
clearLabel: E.trail?.clearLabel ?? E.resetLabel ?? "Clear all",
|
|
151
|
-
changedMessage: !z && H.length > 0 && t.canEditSteps === !1 ? E.trail?.changedMessage ?? "The view changed manually. Start a new request to continue." : void 0
|
|
152
|
-
})
|
|
153
|
-
}), q = t.pendingAction && /* @__PURE__ */ b(d, {
|
|
154
|
-
...t.pendingAction,
|
|
155
|
-
disabled: z || !E.onApplyAction,
|
|
156
|
-
onApply: () => E.onApplyAction?.(),
|
|
157
|
-
onCancel: () => E.onCancelAction?.()
|
|
158
|
-
}), J = /* @__PURE__ */ b("div", {
|
|
159
|
-
class: "rv-ai-result-actions",
|
|
160
|
-
children: [
|
|
161
|
-
(E.onUndoData || E.onRedoData) && /* @__PURE__ */ b(C, {
|
|
162
|
-
onUndo: E.onUndoData,
|
|
163
|
-
onRedo: E.onRedoData,
|
|
164
|
-
canUndo: !z && !B && !!t.canUndoData,
|
|
165
|
-
canRedo: !z && !B && !!t.canRedoData,
|
|
166
|
-
undoLabel: O("Undo data change"),
|
|
167
|
-
redoLabel: O("Redo data change"),
|
|
168
|
-
label: O("Data history")
|
|
169
|
-
}),
|
|
170
|
-
/* @__PURE__ */ b(S, {
|
|
171
|
-
disabled: z || B || !t.canRestore,
|
|
172
|
-
onClick: E.onRestore,
|
|
173
|
-
size: "compact",
|
|
174
|
-
children: O(E.restoreLabel ?? "Restore previous view")
|
|
175
|
-
}),
|
|
176
|
-
!H.length && /* @__PURE__ */ b(S, {
|
|
177
|
-
disabled: z || B,
|
|
178
|
-
onClick: E.onReset,
|
|
179
|
-
size: "compact",
|
|
180
|
-
variant: "ghost",
|
|
181
|
-
children: O(E.resetLabel ?? "Reset view")
|
|
182
|
-
}),
|
|
183
|
-
P && E.showClearChat !== !1 && /* @__PURE__ */ b(S, {
|
|
184
|
-
size: "compact",
|
|
185
|
-
variant: "ghost",
|
|
186
|
-
disabled: z || B || !E.onClearChat || !N.messages.length,
|
|
187
|
-
onClick: () => E.onClearChat?.(),
|
|
188
|
-
children: O("Clear chat")
|
|
189
|
-
})
|
|
190
|
-
]
|
|
191
|
-
}), Y = E.showHistoryControls === !1 ? null : E.controlsMountTo ? x(J, E.controlsMountTo) : J;
|
|
192
|
-
return /* @__PURE__ */ b(m, {
|
|
193
|
-
layout: E.layout,
|
|
194
|
-
translations: E.translations,
|
|
195
|
-
label: E.label,
|
|
196
|
-
busy: z,
|
|
197
|
-
footer: E.footer,
|
|
198
|
-
children: P ? /* @__PURE__ */ b(f, {
|
|
199
|
-
className: "rv-ai-mounted-chat",
|
|
200
|
-
children: [
|
|
201
|
-
/* @__PURE__ */ b(u, {
|
|
202
|
-
busy: z,
|
|
203
|
-
children: [!N.messages.length && E.emptyState && /* @__PURE__ */ b(c, { ...E.emptyState }), N.messages.map((e) => /* @__PURE__ */ b(p, {
|
|
204
|
-
from: e.from,
|
|
205
|
-
isStreaming: e.phase === "understanding" || e.phase === "applying",
|
|
206
|
-
children: [
|
|
207
|
-
e.from === "user" ? /* @__PURE__ */ b(l, { children: e.text }) : e.phase === "preview" && e.pending && e.id === N.messages.at(-1)?.id && t.pendingAction ? null : /* @__PURE__ */ b(l, { children: e.phase === "understanding" || e.phase === "applying" || e.phase === "error" || e.phase === "cancelled" ? /* @__PURE__ */ b(_, {
|
|
208
|
-
title: e.text,
|
|
209
|
-
status: e.phase === "understanding" || e.phase === "applying" ? "running" : e.phase === "error" ? "error" : "cancelled"
|
|
210
|
-
}) : e.text }),
|
|
211
|
-
e.result ? /* @__PURE__ */ b(y, {
|
|
212
|
-
result: e.result,
|
|
213
|
-
renderTable: E.renderTable
|
|
214
|
-
}) : e.details && /* @__PURE__ */ b("pre", {
|
|
215
|
-
class: "rv-ai-chat-result",
|
|
216
|
-
children: e.details
|
|
217
|
-
}),
|
|
218
|
-
e.id === N.messages.at(-1)?.id && e.pending && q
|
|
219
|
-
]
|
|
220
|
-
}, e.id))]
|
|
221
|
-
}),
|
|
222
|
-
K,
|
|
223
|
-
Y
|
|
224
|
-
]
|
|
225
|
-
}) : /* @__PURE__ */ b(e, { children: [
|
|
226
|
-
K,
|
|
227
|
-
q,
|
|
228
|
-
t.phase === "completed" && t.result && /* @__PURE__ */ b(y, {
|
|
229
|
-
result: t.result,
|
|
230
|
-
renderTable: E.renderTable
|
|
231
|
-
}),
|
|
232
|
-
!!F.length && /* @__PURE__ */ b(w, {
|
|
233
|
-
className: "rv-ai-activity",
|
|
234
|
-
title: O("Activity"),
|
|
235
|
-
compact: !0,
|
|
236
|
-
autoDismissMs: E.activityDurationMs,
|
|
237
|
-
onDismissItem: (e) => {
|
|
238
|
-
F = F.filter((t) => t.id !== e), V();
|
|
239
|
-
},
|
|
240
|
-
collapsed: I,
|
|
241
|
-
onCollapsedChange: L,
|
|
242
|
-
collapseLabel: O("Collapse activity"),
|
|
243
|
-
expandLabel: O("Expand activity"),
|
|
244
|
-
items: F
|
|
245
|
-
}),
|
|
246
|
-
Y
|
|
247
|
-
] })
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
let V = () => {
|
|
251
|
-
!k && j && t(/* @__PURE__ */ b(B, { state: j }), T);
|
|
252
|
-
};
|
|
253
|
-
return {
|
|
254
|
-
update(e) {
|
|
255
|
-
P ? N.update(e) : z(e), j = e, V();
|
|
256
|
-
},
|
|
257
|
-
setSuggestions(e) {
|
|
258
|
-
A = [...e], V();
|
|
259
|
-
},
|
|
260
|
-
destroy() {
|
|
261
|
-
k || (k = !0, M = [], N.clear(), t(null, T));
|
|
262
|
-
}
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
//#endregion
|
|
266
|
-
export { O as t };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { QueryObserverOptions } from '@tanstack/query-core';
|
|
2
|
-
import type { ReadBinding, ReadIntent, ReadPort, ReadProvider } from './contracts.js';
|
|
3
|
-
import type { DataQueryScope, ReadValue } from './source.js';
|
|
4
|
-
import { type NativeReadOptions } from './load-options.js';
|
|
5
|
-
export interface QueryRead<Request, Result> {
|
|
6
|
-
readonly source: DataQueryScope;
|
|
7
|
-
readonly resource: string;
|
|
8
|
-
readonly operation: string;
|
|
9
|
-
/** Semantic request only: no AbortSignal, transport request ID or component ID. */
|
|
10
|
-
readonly request: Request;
|
|
11
|
-
readonly read: ReadProvider<Request, Result>;
|
|
12
|
-
readonly observerOptions?: NativeReadOptions;
|
|
13
|
-
/** Product-owned bounded transport copying; omit for structured cloning. */
|
|
14
|
-
readonly materialize?: (data: Result) => Result;
|
|
15
|
-
}
|
|
16
|
-
export interface BindingOptions<Result> {
|
|
17
|
-
/** Explicitly fetch before delivering cached data, independently of mount/freshness policy. */
|
|
18
|
-
readonly force?: boolean;
|
|
19
|
-
readonly port: ReadPort<Result>;
|
|
20
|
-
/** Default structuredClone supports cloneable transport data, including nested values. */
|
|
21
|
-
readonly materialize?: (data: Result) => Result;
|
|
22
|
-
/** Optional product revision/completeness check; returning false suppresses hydration. */
|
|
23
|
-
readonly canHydrate?: (data: Result) => boolean;
|
|
24
|
-
}
|
|
25
|
-
export declare function claimReadOwner(owner: object): () => void;
|
|
26
|
-
export declare function observerPolicy<FnData, Data = FnData>(source: DataQueryScope, options?: NativeReadOptions): Pick<QueryObserverOptions<FnData, unknown, Data, Data>, keyof NativeReadOptions | 'placeholderData' | 'initialData' | 'select' | 'notifyOnChangeProps'>;
|
|
27
|
-
export declare function queryOptions<Request, Result>(definition: QueryRead<Request, Result>): QueryObserverOptions<ReadValue<Result>, unknown>;
|
|
28
|
-
export declare function bindQuery<Request, Result>(initial: QueryRead<Request, Result>, options: BindingOptions<Result>): ReadBinding<QueryRead<Request, Result>>;
|
|
29
|
-
/** Connect a product-owned request subscription; dispose stops only this subscription. */
|
|
30
|
-
export declare function bindQueryIntent<Request, Result>(intent: ReadIntent<Request>, describe: (request: Request) => QueryRead<Request, Result>, options: BindingOptions<Result>): ReadBinding<QueryRead<Request, Result>>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { RemoteBlockController, RemoteBlockPort } from './contracts.js';
|
|
2
|
-
import type { ReadProvider, ReadStatus } from './contracts.js';
|
|
3
|
-
import type { DataQueryScope } from './source.js';
|
|
4
|
-
import type { NativeReadOptions } from './load-options.js';
|
|
5
|
-
/** Providers must order offsets deterministically, with a unique tie-breaker. */
|
|
6
|
-
export type BlockConsistency<Result> = {
|
|
7
|
-
readonly mode: 'eventual';
|
|
8
|
-
readonly reload: 'sequence' | 'route';
|
|
9
|
-
} | {
|
|
10
|
-
readonly mode: 'snapshot';
|
|
11
|
-
readonly revision: string;
|
|
12
|
-
readonly getRevision: (result: Result) => string;
|
|
13
|
-
};
|
|
14
|
-
export interface BlockQueryOptions<Request, Result> {
|
|
15
|
-
readonly source?: DataQueryScope;
|
|
16
|
-
/** Internal uncached transport mode; no QueryClient or observers. */
|
|
17
|
-
readonly uncached?: boolean;
|
|
18
|
-
readonly concurrency?: number;
|
|
19
|
-
readonly read: ReadProvider<Request, Result>;
|
|
20
|
-
readonly consistency: BlockConsistency<Result>;
|
|
21
|
-
readonly resource?: string;
|
|
22
|
-
readonly observerOptions?: NativeReadOptions;
|
|
23
|
-
/** Semantic key normalization only. The provider still receives its original typed request. */
|
|
24
|
-
readonly keyRequest?: (request: Request) => unknown;
|
|
25
|
-
/** Application-owned pending proposals, applied only to detached data. */
|
|
26
|
-
readonly reconcile?: (result: Result, request: Request) => Result;
|
|
27
|
-
readonly onStatus?: (request: Request, status: ReadStatus) => void;
|
|
28
|
-
}
|
|
29
|
-
/** Subscription registry: cached reads use Query; bypass keeps only live operations. */
|
|
30
|
-
export declare function createBlockQueries<Request, Result>(port: RemoteBlockPort<Request, Result>, options: BlockQueryOptions<Request, Result>, operation: string): RemoteBlockController<Request>;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { CommandEnvelope, CommandReceipt } from './contracts.js';
|
|
2
|
-
export type CommandProvider<Command, Changes, Revision = string, Conflict = Changes> = (envelope: CommandEnvelope<Command, Revision>, context: {
|
|
3
|
-
readonly signal: AbortSignal;
|
|
4
|
-
}) => CommandReceipt<Changes, Revision, Conflict> | Promise<CommandReceipt<Changes, Revision, Conflict>>;
|
|
5
|
-
export interface CommandState<Changes, Revision = string, Conflict = Changes> {
|
|
6
|
-
readonly status: 'idle' | 'submitting' | 'recovering' | 'accepted' | 'rejected' | 'conflict' | 'unknown' | 'disposed';
|
|
7
|
-
readonly attempt: number;
|
|
8
|
-
readonly receipt?: CommandReceipt<Changes, Revision, Conflict>;
|
|
9
|
-
/** Local application/refetch errors never change a definitive server receipt. */
|
|
10
|
-
readonly error?: unknown;
|
|
11
|
-
}
|
|
12
|
-
/** Write policy and domain hooks.
|
|
13
|
-
* @see https://pro.rv-grid.com/guides/server-data-commands/#configuration-types
|
|
14
|
-
*/
|
|
15
|
-
export interface CommandOptions<Command, Changes, Revision = string, Conflict = Changes> {
|
|
16
|
-
/** Restore a previously submitted envelope as unknown; execute() must not resubmit it. */
|
|
17
|
-
readonly resume?: boolean;
|
|
18
|
-
readonly submit: CommandProvider<Command, Changes, Revision, Conflict>;
|
|
19
|
-
/** Read a durable receipt by operation ID. Never resubmit from this callback. */
|
|
20
|
-
readonly recover?: CommandProvider<Command, Changes, Revision, Conflict>;
|
|
21
|
-
/** Explicit backend guarantee: identical operation IDs/payloads cannot execute twice. */
|
|
22
|
-
readonly idempotent?: boolean;
|
|
23
|
-
/** Validate product-specific revision, completeness and canonical-change semantics. */
|
|
24
|
-
readonly validateReceipt?: (receipt: CommandReceipt<Changes, Revision, Conflict>) => boolean;
|
|
25
|
-
/** Apply canonical changes atomically; domain pending/history state remains product-owned. */
|
|
26
|
-
readonly applyAccepted?: (changes: Changes, receipt: CommandReceipt<Changes, Revision, Conflict>) => void | Promise<void>;
|
|
27
|
-
readonly source?: {
|
|
28
|
-
accepted(): Promise<void>;
|
|
29
|
-
};
|
|
30
|
-
readonly onStatus?: (state: CommandState<Changes, Revision, Conflict>) => void;
|
|
31
|
-
}
|
|
32
|
-
export interface CommandExecution<Command, Changes, Revision = string, Conflict = Changes> {
|
|
33
|
-
/** A detached snapshot. Mutating it cannot change a submitted command. */
|
|
34
|
-
readonly envelope: CommandEnvelope<Command, Revision>;
|
|
35
|
-
getState(): CommandState<Changes, Revision, Conflict>;
|
|
36
|
-
execute(): Promise<CommandReceipt<Changes, Revision, Conflict>>;
|
|
37
|
-
recover(): Promise<CommandReceipt<Changes, Revision, Conflict>>;
|
|
38
|
-
retry(): Promise<CommandReceipt<Changes, Revision, Conflict>>;
|
|
39
|
-
/** Retry local canonical application/refetch after acceptance, without another write. */
|
|
40
|
-
reconcile(): Promise<void>;
|
|
41
|
-
cancel(): void;
|
|
42
|
-
dispose(): void;
|
|
43
|
-
}
|
|
44
|
-
/** One logical write. Keep this handle for recovery/retry; backend receipts provide durability.
|
|
45
|
-
* @see https://pro.rv-grid.com/guides/server-data-commands/
|
|
46
|
-
*/
|
|
47
|
-
export declare function createCommandExecution<Command, Changes, Revision = string, Conflict = Changes>(envelope: CommandEnvelope<Command, Revision>, options: CommandOptions<Command, Changes, Revision, Conflict>): CommandExecution<Command, Changes, Revision, Conflict>;
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/** Library-independent contracts. Product packages need not depend on this package. */
|
|
2
|
-
export interface SourceIdentity {
|
|
3
|
-
readonly sourceId: string;
|
|
4
|
-
readonly schemaId: string;
|
|
5
|
-
readonly tenantId: string;
|
|
6
|
-
/** Non-secret principal/permission identity. Never put credentials here. */
|
|
7
|
-
readonly authorizationScope: string;
|
|
8
|
-
}
|
|
9
|
-
export type ReadProvider<Request, Result> = (request: Request, context: {
|
|
10
|
-
readonly signal: AbortSignal;
|
|
11
|
-
}) => Promise<Result> | Result;
|
|
12
|
-
export interface ReadStatus {
|
|
13
|
-
readonly status: 'pending' | 'success' | 'error';
|
|
14
|
-
readonly fetching: boolean;
|
|
15
|
-
readonly paused: boolean;
|
|
16
|
-
readonly error: unknown;
|
|
17
|
-
/** Infinite bindings expose Query's pagination state without a second page ledger. */
|
|
18
|
-
readonly hasNextPage?: boolean;
|
|
19
|
-
readonly hasPreviousPage?: boolean;
|
|
20
|
-
readonly fetchingNextPage?: boolean;
|
|
21
|
-
readonly fetchingPreviousPage?: boolean;
|
|
22
|
-
}
|
|
23
|
-
/** Synchronous domain-aware application; preserve pending changes/history here. */
|
|
24
|
-
export interface ReadPort<Result> {
|
|
25
|
-
/** Used to reject a second remote controller for the same mounted view. */
|
|
26
|
-
readonly owner: object;
|
|
27
|
-
/** Release old projection/row references on scope/request change and disposal. */
|
|
28
|
-
clear(): void;
|
|
29
|
-
hydrate(result: Result, context: {
|
|
30
|
-
readonly origin: 'remote';
|
|
31
|
-
}): void;
|
|
32
|
-
status(status: ReadStatus): void;
|
|
33
|
-
}
|
|
34
|
-
/** Subscription seam a product can implement without importing Query. */
|
|
35
|
-
export interface ReadIntent<Request> {
|
|
36
|
-
current(): Request;
|
|
37
|
-
subscribe(listener: (request: Request) => void): () => void;
|
|
38
|
-
}
|
|
39
|
-
export interface ReadBinding<Request> {
|
|
40
|
-
setRequest(request: Request): void;
|
|
41
|
-
refresh(): Promise<void>;
|
|
42
|
-
dispose(): void;
|
|
43
|
-
}
|
|
44
|
-
export type ReadConsistency<Revision> = {
|
|
45
|
-
readonly mode: 'snapshot';
|
|
46
|
-
readonly revision: Revision;
|
|
47
|
-
} | {
|
|
48
|
-
readonly mode: 'eventual';
|
|
49
|
-
readonly reload: 'sequence' | 'route';
|
|
50
|
-
};
|
|
51
|
-
export interface CommandEnvelope<Command, Revision = string> {
|
|
52
|
-
readonly operationId: string;
|
|
53
|
-
readonly resourceId: string;
|
|
54
|
-
readonly expectedRevision?: Revision;
|
|
55
|
-
readonly command: Command;
|
|
56
|
-
}
|
|
57
|
-
/** Payloads/revisions remain product-specific; transport failures are not rejections. */
|
|
58
|
-
export type CommandReceipt<Changes, Revision = string, Conflict = Changes> = {
|
|
59
|
-
readonly operationId: string;
|
|
60
|
-
readonly status: 'accepted';
|
|
61
|
-
readonly changes: Changes;
|
|
62
|
-
readonly revision: Revision;
|
|
63
|
-
} | {
|
|
64
|
-
readonly operationId: string;
|
|
65
|
-
readonly status: 'rejected';
|
|
66
|
-
readonly message: string;
|
|
67
|
-
} | {
|
|
68
|
-
readonly operationId: string;
|
|
69
|
-
readonly status: 'conflict';
|
|
70
|
-
readonly message: string;
|
|
71
|
-
readonly authoritative: Conflict;
|
|
72
|
-
readonly revision: Revision;
|
|
73
|
-
} | {
|
|
74
|
-
readonly operationId: string;
|
|
75
|
-
readonly status: 'unknown';
|
|
76
|
-
readonly message?: string;
|
|
77
|
-
};
|
|
78
|
-
/** Compatibility only: cannot cancel a transport that ignores signals. */
|
|
79
|
-
export declare function fromLegacyRead<Request, Result>(read: (request: Request) => Promise<Result> | Result): ReadProvider<Request, Result>;
|
|
80
|
-
export interface RemoteBlockStatus {
|
|
81
|
-
readonly status: 'pending' | 'success' | 'error';
|
|
82
|
-
readonly fetching: boolean;
|
|
83
|
-
readonly paused: boolean;
|
|
84
|
-
readonly error: unknown;
|
|
85
|
-
}
|
|
86
|
-
export interface RemoteBlockPort<Request, Result> {
|
|
87
|
-
readonly owner: object;
|
|
88
|
-
hydrate(request: Request, result: Result, context: {
|
|
89
|
-
readonly origin: 'remote';
|
|
90
|
-
}): void;
|
|
91
|
-
status(request: Request, state: RemoteBlockStatus): void;
|
|
92
|
-
/** Release editable row references while preserving logical slot/route identity. */
|
|
93
|
-
evict(request: Request): void;
|
|
94
|
-
}
|
|
95
|
-
export interface RemoteBlockController<Request> {
|
|
96
|
-
observe(request: Request, force?: boolean): Promise<boolean>;
|
|
97
|
-
retain(keep: (request: Request) => boolean): void;
|
|
98
|
-
reset(): void;
|
|
99
|
-
/** Optional aggregate physical-attempt diagnostics for the shared source. */
|
|
100
|
-
getRequestState?(): {
|
|
101
|
-
activeRequests: number;
|
|
102
|
-
queuedRequests: number;
|
|
103
|
-
};
|
|
104
|
-
refresh(): Promise<void>;
|
|
105
|
-
dispose(): void;
|
|
106
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { LoadQueryOptions } from './load-options.js';
|
|
2
|
-
import type { ReadStatus } from './contracts.js';
|
|
3
|
-
export interface CursorData<Page, Param> {
|
|
4
|
-
pages: Page[];
|
|
5
|
-
pageParams: Param[];
|
|
6
|
-
}
|
|
7
|
-
export interface CursorSubscription<Page, Param> {
|
|
8
|
-
readonly ready: Promise<CursorData<Page, Param>>;
|
|
9
|
-
fetchNextPage(): Promise<void>;
|
|
10
|
-
refresh(): Promise<void>;
|
|
11
|
-
dispose(): void;
|
|
12
|
-
}
|
|
13
|
-
/** Cursor sequences use Query's page ownership; no product transport/page cache is required. */
|
|
14
|
-
export declare function createCursorReader<Request, Page, Param>(operation: string, read: (request: Request, pageParam: Param, signal: AbortSignal) => Promise<Page> | Page, keyRequest: (request: Request) => unknown, initialPageParam: Param, getNextPageParam: (last: Page, pages: Page[], lastParam: Param) => Param | undefined, options?: Omit<LoadQueryOptions<never>, 'consistency' | 'reconcile'> | false): {
|
|
15
|
-
observe(request: Request, settings?: {
|
|
16
|
-
signal?: AbortSignal;
|
|
17
|
-
force?: boolean;
|
|
18
|
-
onData?: (data: CursorData<Page, Param>) => void;
|
|
19
|
-
onStatus?: (status: ReadStatus) => void;
|
|
20
|
-
}): CursorSubscription<Page, Param>;
|
|
21
|
-
/** Explicit product refresh starts a new sequence; mounted peers follow the reset. */
|
|
22
|
-
reset(request: Request): void;
|
|
23
|
-
invalidate(): void;
|
|
24
|
-
dispose(): void;
|
|
25
|
-
};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { ReadBinding, ReadPort } from './contracts.js';
|
|
2
|
-
/** One uncached subscription. Product block ownership guards delivery after reset. */
|
|
3
|
-
export declare function bindDirectRead<Result>(read: (signal: AbortSignal) => Promise<Result>, port: ReadPort<Result>, materialize?: (data: Result) => Result): Pick<ReadBinding<unknown>, 'refresh' | 'dispose'>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export * from './contracts.js';
|
|
2
|
-
export * from './keys.js';
|
|
3
|
-
export * from './policy.js';
|
|
4
|
-
export { createDataQueryContext, getDataQuerySource } from './source.js';
|
|
5
|
-
export type { DataQuerySource, DataQueryScope, SourceOptions } from './source.js';
|
|
6
|
-
export { bindQuery, bindQueryIntent } from './binding.js';
|
|
7
|
-
export type { BindingOptions, QueryRead } from './binding.js';
|
|
8
|
-
export { bindInfiniteQuery } from './infinite-binding.js';
|
|
9
|
-
export type { InfiniteRead, InfiniteBinding } from './infinite-binding.js';
|
|
10
|
-
export { materializeData } from './materialize.js';
|
|
11
|
-
export { createBlockQueries } from './blocks.js';
|
|
12
|
-
export type { BlockQueryOptions, BlockConsistency } from './blocks.js';
|
|
13
|
-
export type { LoadQueryOptions, NativeReadOptions } from './load-options.js';
|
|
14
|
-
export { createRemoteLoad } from './remote-load.js';
|
|
15
|
-
export type { RemoteLoadController } from './remote-load.js';
|
|
16
|
-
export { createCommandExecution } from './commands.js';
|
|
17
|
-
export type { CommandProvider, CommandOptions, CommandState, CommandExecution } from './commands.js';
|
|
18
|
-
export { createQueryReader } from './reader.js';
|
|
19
|
-
export type { QueryReader, QueryReadSubscription } from './reader.js';
|
|
20
|
-
export { createCursorReader } from './cursor-reader.js';
|
|
21
|
-
export type { CursorData, CursorSubscription } from './cursor-reader.js';
|
|
22
|
-
export { createProviderQueries } from './provider-queries.js';
|
|
23
|
-
export type { ProviderQueryOptions } from './provider-queries.js';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { InfiniteData } from '@tanstack/query-core';
|
|
2
|
-
import type { ReadBinding, ReadProvider } from './contracts.js';
|
|
3
|
-
import { type BindingOptions, type QueryRead } from './binding.js';
|
|
4
|
-
export interface InfiniteRead<Request, Page, PageParam> extends Omit<QueryRead<Request, Page>, 'read' | 'materialize'> {
|
|
5
|
-
readonly read: ReadProvider<{
|
|
6
|
-
readonly request: Request;
|
|
7
|
-
readonly pageParam: PageParam;
|
|
8
|
-
}, Page>;
|
|
9
|
-
readonly initialPageParam: PageParam;
|
|
10
|
-
readonly getNextPageParam: (lastPage: Page, pages: Page[], lastParam: PageParam) => PageParam | null | undefined;
|
|
11
|
-
readonly maxPages?: number;
|
|
12
|
-
readonly getPreviousPageParam?: (firstPage: Page, pages: Page[], firstParam: PageParam) => PageParam | null | undefined;
|
|
13
|
-
}
|
|
14
|
-
export interface InfiniteBinding<Request, Page, PageParam> extends ReadBinding<InfiniteRead<Request, Page, PageParam>> {
|
|
15
|
-
fetchNextPage(): Promise<void>;
|
|
16
|
-
fetchPreviousPage(): Promise<void>;
|
|
17
|
-
}
|
|
18
|
-
export declare function bindInfiniteQuery<Request, Page, PageParam>(initial: InfiniteRead<Request, Page, PageParam>, options: BindingOptions<InfiniteData<Page, PageParam>>): InfiniteBinding<Request, Page, PageParam>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { SourceIdentity } from './contracts.js';
|
|
2
|
-
/** Tagged encoding avoids collisions between undefined/null, strings/numbers and -0. */
|
|
3
|
-
export type KeyValue = string | number | boolean | null | readonly KeyValue[];
|
|
4
|
-
export declare function encodeRequest(value: unknown, ancestors?: Set<object>): KeyValue;
|
|
5
|
-
export declare function sourceKey(scope: SourceIdentity): readonly ["revo", 1, string[]];
|
|
6
|
-
export declare function resultKey(scope: SourceIdentity, resource: string, operation: string, request: unknown): readonly ["revo", 1, string[], string, string, "result", KeyValue];
|
|
7
|
-
export declare function infiniteResultKey(scope: SourceIdentity, resource: string, operation: string, request: unknown): readonly ["revo", 1, string[], string, string, "infinite", KeyValue];
|
|
8
|
-
/** Record insertion order expresses current grid multi-sort precedence. */
|
|
9
|
-
export declare function orderedSort(sort: Readonly<Record<string, 'asc' | 'desc' | undefined>> | undefined): [string, "asc" | "desc"][];
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** One physical-attempt budget per source runtime, not a request/result cache. */
|
|
2
|
-
export declare class SourceLimiter {
|
|
3
|
-
readonly concurrency: number;
|
|
4
|
-
private active;
|
|
5
|
-
private readonly queue;
|
|
6
|
-
constructor(concurrency: number);
|
|
7
|
-
getRequestState(): {
|
|
8
|
-
activeRequests: number;
|
|
9
|
-
queuedRequests: number;
|
|
10
|
-
};
|
|
11
|
-
run<T>(signal: AbortSignal, read: () => Promise<T> | T): Promise<T>;
|
|
12
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { DataQueryScope } from './source.js';
|
|
2
|
-
import type { ReadStatus } from './contracts.js';
|
|
3
|
-
import type { BlockConsistency } from './blocks.js';
|
|
4
|
-
import type { QueryObserverOptions } from '@tanstack/query-core';
|
|
5
|
-
/** Read policy only: identity, transport, acceptance framing and projection stay engine-owned. */
|
|
6
|
-
export declare const nativeReadOptionKeys: readonly ["enabled", "staleTime", "gcTime", "refetchInterval", "refetchIntervalInBackground", "refetchOnMount", "refetchOnWindowFocus", "refetchOnReconnect", "retry", "retryDelay", "retryOnMount", "networkMode", "meta"];
|
|
7
|
-
/** Native callbacks receive the native Query; its cached data is engine-owned/opaque. */
|
|
8
|
-
export type NativeReadOptions = Pick<QueryObserverOptions<unknown, unknown>, typeof nativeReadOptionKeys[number]>;
|
|
9
|
-
/** Also protects JavaScript callers from overriding keys, queryFn or acceptance framing. */
|
|
10
|
-
export declare function nativeReadOptions<FnData, Data = FnData>(options?: NativeReadOptions): Pick<QueryObserverOptions<FnData, unknown, Data, Data>, typeof nativeReadOptionKeys[number]>;
|
|
11
|
-
/**
|
|
12
|
-
* Optional native read policies plus shared scope, consistency and product reconciliation.
|
|
13
|
-
* Native options: enabled, staleTime, gcTime, refetchInterval, refetchIntervalInBackground,
|
|
14
|
-
* refetchOnMount, refetchOnWindowFocus, refetchOnReconnect, retry, retryDelay,
|
|
15
|
-
* retryOnMount, networkMode and meta. All existing loader callbacks stay unchanged.
|
|
16
|
-
* @see [Usage, configuration types and defaults](https://pro.rv-grid.com/guides/server-data-queries/#configuration-types)
|
|
17
|
-
*/
|
|
18
|
-
export interface LoadQueryOptions<Result> extends NativeReadOptions {
|
|
19
|
-
readonly source?: DataQueryScope;
|
|
20
|
-
readonly resource?: string;
|
|
21
|
-
readonly consistency?: BlockConsistency<Result>;
|
|
22
|
-
/** Application-owned pending proposals. The input is detached from the cache. */
|
|
23
|
-
readonly reconcile?: (result: Result) => Result;
|
|
24
|
-
readonly onStatus?: (status: ReadStatus) => void;
|
|
25
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface ReadPolicy {
|
|
2
|
-
readonly staleTime: number;
|
|
3
|
-
readonly gcTime: number;
|
|
4
|
-
readonly refetchOnMount: boolean;
|
|
5
|
-
readonly refetchOnWindowFocus: boolean;
|
|
6
|
-
readonly refetchOnReconnect: boolean;
|
|
7
|
-
readonly retry: number;
|
|
8
|
-
readonly retryDelay: number;
|
|
9
|
-
}
|
|
10
|
-
/** Explicit pilot defaults. Bindings override host defaults locally, never globally. */
|
|
11
|
-
export declare const defaultReadPolicy: Readonly<ReadPolicy>;
|
|
12
|
-
/** HTTP providers may expose a status; validation/auth failures are not transient. */
|
|
13
|
-
export declare function isRetryableRead(error: unknown): boolean;
|
|
14
|
-
export declare function resolveReadPolicy(policy?: Partial<ReadPolicy>): ReadPolicy;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { NativeReadOptions } from './load-options.js';
|
|
2
|
-
import type { DataQueryScope } from './source.js';
|
|
3
|
-
import type { ReadStatus } from './contracts.js';
|
|
4
|
-
/** Policy for one-shot provider calls. Polling/enabled require a mounted product observer.
|
|
5
|
-
* @see https://pro.rv-grid.com/guides/server-data-queries/#ancillary-providers
|
|
6
|
-
*/
|
|
7
|
-
export interface ProviderQueryOptions extends Pick<NativeReadOptions, 'staleTime' | 'gcTime' | 'retry' | 'retryDelay' | 'networkMode' | 'meta'> {
|
|
8
|
-
readonly source?: DataQueryScope;
|
|
9
|
-
/** Include endpoint/project identity when it is hidden inside a callback. */
|
|
10
|
-
readonly resource?: string;
|
|
11
|
-
readonly onStatus?: (status: ReadStatus) => void;
|
|
12
|
-
}
|
|
13
|
-
/** Keeps live callback context out of keys; Query owns every physical attempt and cached result. */
|
|
14
|
-
export declare function createProviderQueries(options?: ProviderQueryOptions | false): {
|
|
15
|
-
read<T>(operation: string, key: unknown, execute: (signal: AbortSignal) => T | PromiseLike<T>, signal?: AbortSignal, settings?: {
|
|
16
|
-
fresh?: boolean;
|
|
17
|
-
}): Promise<T>;
|
|
18
|
-
accepted(): Promise<void>;
|
|
19
|
-
/** A cache failure must never turn an already accepted write into a retryable write failure. */
|
|
20
|
-
afterWrite(): Promise<void>;
|
|
21
|
-
dispose(): void;
|
|
22
|
-
};
|