@elaraai/e3-ui-components 1.0.83 → 1.0.85
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/README.md +113 -6
- package/dist/components/DataTaskPreview.d.ts +35 -1
- package/dist/components/DataTaskPreview.d.ts.map +1 -1
- package/dist/components/DatasetPreview.d.ts +16 -0
- package/dist/components/DatasetPreview.d.ts.map +1 -1
- package/dist/components/InputPreview.d.ts +12 -0
- package/dist/components/InputPreview.d.ts.map +1 -1
- package/dist/components/PagedDatasetPreview.d.ts +15 -0
- package/dist/components/PagedDatasetPreview.d.ts.map +1 -1
- package/dist/components/TaskLogs.d.ts +19 -0
- package/dist/components/TaskLogs.d.ts.map +1 -1
- package/dist/components/TaskPreview.d.ts +24 -0
- package/dist/components/TaskPreview.d.ts.map +1 -1
- package/dist/components/UITaskPreview.d.ts +4 -1
- package/dist/components/UITaskPreview.d.ts.map +1 -1
- package/dist/components/VirtualizedLogViewer.d.ts +29 -1
- package/dist/components/VirtualizedLogViewer.d.ts.map +1 -1
- package/dist/components/controlled-search.d.ts +22 -0
- package/dist/components/controlled-search.d.ts.map +1 -0
- package/dist/components/preview-controls.d.ts +73 -0
- package/dist/components/preview-controls.d.ts.map +1 -0
- package/dist/diff/index.d.ts.map +1 -1
- package/dist/experiment/index.d.ts.map +1 -1
- package/dist/hooks/executions.d.ts +17 -0
- package/dist/hooks/executions.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useDatasetValue.d.ts +19 -1
- package/dist/hooks/useDatasetValue.d.ts.map +1 -1
- package/dist/hooks/useTaskLogsHook.d.ts +67 -3
- package/dist/hooks/useTaskLogsHook.d.ts.map +1 -1
- package/dist/in-memory-call-7_3frW52.js +615 -0
- package/dist/in-memory-call-7_3frW52.js.map +1 -0
- package/dist/in-memory-call-_r5DJotS.cjs +614 -0
- package/dist/in-memory-call-_r5DJotS.cjs.map +1 -0
- package/dist/index.cjs +25860 -5731
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +14 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28383 -8253
- package/dist/index.js.map +1 -1
- package/dist/platform/bind-runtime.d.ts +18 -3
- package/dist/platform/bind-runtime.d.ts.map +1 -1
- package/dist/platform/dataset-hooks.d.ts +15 -3
- package/dist/platform/dataset-hooks.d.ts.map +1 -1
- package/dist/platform/dataset-store.d.ts +35 -7
- package/dist/platform/dataset-store.d.ts.map +1 -1
- package/dist/platform/e3-config.d.ts +26 -2
- package/dist/platform/e3-config.d.ts.map +1 -1
- package/dist/platform/func-runtime.d.ts +11 -5
- package/dist/platform/func-runtime.d.ts.map +1 -1
- package/dist/platform/index.d.ts +2 -2
- package/dist/platform/index.d.ts.map +1 -1
- package/dist/platform/paged-runtime.d.ts +46 -9
- package/dist/platform/paged-runtime.d.ts.map +1 -1
- package/dist/platform/record-runtime.d.ts +45 -7
- package/dist/platform/record-runtime.d.ts.map +1 -1
- package/dist/platform/recovery.d.ts +44 -0
- package/dist/platform/recovery.d.ts.map +1 -0
- package/dist/platform/staged-store.d.ts +16 -0
- package/dist/platform/staged-store.d.ts.map +1 -1
- package/dist/platform/tracked-channel.d.ts +12 -0
- package/dist/platform/tracked-channel.d.ts.map +1 -1
- package/dist/query/about.d.ts +50 -0
- package/dist/query/about.d.ts.map +1 -0
- package/dist/query/autocomplete.d.ts +112 -0
- package/dist/query/autocomplete.d.ts.map +1 -0
- package/dist/query/builder.d.ts +29 -0
- package/dist/query/builder.d.ts.map +1 -0
- package/dist/query/calls.d.ts +46 -0
- package/dist/query/calls.d.ts.map +1 -0
- package/dist/query/datasets-tab.d.ts +52 -0
- package/dist/query/datasets-tab.d.ts.map +1 -0
- package/dist/query/downloads.d.ts +29 -0
- package/dist/query/downloads.d.ts.map +1 -0
- package/dist/query/drops.d.ts +28 -0
- package/dist/query/drops.d.ts.map +1 -0
- package/dist/query/foot.d.ts +22 -0
- package/dist/query/foot.d.ts.map +1 -0
- package/dist/query/hooks.d.ts +265 -0
- package/dist/query/hooks.d.ts.map +1 -0
- package/dist/query/in-memory-call.d.ts +150 -0
- package/dist/query/in-memory-call.d.ts.map +1 -0
- package/dist/query/jq-editor.d.ts +34 -0
- package/dist/query/jq-editor.d.ts.map +1 -0
- package/dist/query/library-tab.d.ts +33 -0
- package/dist/query/library-tab.d.ts.map +1 -0
- package/dist/query/library.d.ts +20 -0
- package/dist/query/library.d.ts.map +1 -0
- package/dist/query/model/cards.d.ts +179 -0
- package/dist/query/model/cards.d.ts.map +1 -0
- package/dist/query/model/index.d.ts +19 -0
- package/dist/query/model/index.d.ts.map +1 -0
- package/dist/query/model/messages.d.ts +1253 -0
- package/dist/query/model/messages.d.ts.map +1 -0
- package/dist/query/model/refs.d.ts +92 -0
- package/dist/query/model/refs.d.ts.map +1 -0
- package/dist/query/model/slots.d.ts +213 -0
- package/dist/query/model/slots.d.ts.map +1 -0
- package/dist/query/model/summaries.d.ts +104 -0
- package/dist/query/model/summaries.d.ts.map +1 -0
- package/dist/query/model/words.d.ts +331 -0
- package/dist/query/model/words.d.ts.map +1 -0
- package/dist/query/one-shot.d.ts +266 -0
- package/dist/query/one-shot.d.ts.map +1 -0
- package/dist/query/open-query.d.ts +214 -0
- package/dist/query/open-query.d.ts.map +1 -0
- package/dist/query/parts.d.ts +115 -0
- package/dist/query/parts.d.ts.map +1 -0
- package/dist/query/plan-popover.d.ts +22 -0
- package/dist/query/plan-popover.d.ts.map +1 -0
- package/dist/query/plan.d.ts +353 -0
- package/dist/query/plan.d.ts.map +1 -0
- package/dist/query/query-east.d.ts +21 -0
- package/dist/query/query-east.d.ts.map +1 -0
- package/dist/query/query-tab.d.ts +21 -0
- package/dist/query/query-tab.d.ts.map +1 -0
- package/dist/query/results-table.d.ts +153 -0
- package/dist/query/results-table.d.ts.map +1 -0
- package/dist/query/results.d.ts +137 -0
- package/dist/query/results.d.ts.map +1 -0
- package/dist/query/run.d.ts +199 -0
- package/dist/query/run.d.ts.map +1 -0
- package/dist/query/save-popover.d.ts +29 -0
- package/dist/query/save-popover.d.ts.map +1 -0
- package/dist/query/session.d.ts +409 -0
- package/dist/query/session.d.ts.map +1 -0
- package/dist/query/shape-line.d.ts +21 -0
- package/dist/query/shape-line.d.ts.map +1 -0
- package/dist/query/source.d.ts +21 -0
- package/dist/query/source.d.ts.map +1 -0
- package/dist/query/status-line.d.ts +48 -0
- package/dist/query/status-line.d.ts.map +1 -0
- package/dist/query/step-card.d.ts +30 -0
- package/dist/query/step-card.d.ts.map +1 -0
- package/dist/query/steps/check.d.ts +162 -0
- package/dist/query/steps/check.d.ts.map +1 -0
- package/dist/query/steps/count.d.ts +49 -0
- package/dist/query/steps/count.d.ts.map +1 -0
- package/dist/query/steps/edit.d.ts +108 -0
- package/dist/query/steps/edit.d.ts.map +1 -0
- package/dist/query/steps/fields.d.ts +101 -0
- package/dist/query/steps/fields.d.ts.map +1 -0
- package/dist/query/steps/index.d.ts +22 -0
- package/dist/query/steps/index.d.ts.map +1 -0
- package/dist/query/steps/jq.d.ts +188 -0
- package/dist/query/steps/jq.d.ts.map +1 -0
- package/dist/query/steps/parse.d.ts +38 -0
- package/dist/query/steps/parse.d.ts.map +1 -0
- package/dist/query/steps/print.d.ts +195 -0
- package/dist/query/steps/print.d.ts.map +1 -0
- package/dist/query/steps/shape.d.ts +90 -0
- package/dist/query/steps/shape.d.ts.map +1 -0
- package/dist/query/steps/values.d.ts +85 -0
- package/dist/query/steps/values.d.ts.map +1 -0
- package/dist/query/toolbar.d.ts +56 -0
- package/dist/query/toolbar.d.ts.map +1 -0
- package/dist/query/use-query-editor.d.ts +153 -0
- package/dist/query/use-query-editor.d.ts.map +1 -0
- package/dist/query/use-query-session.d.ts +55 -0
- package/dist/query/use-query-session.d.ts.map +1 -0
- package/dist/query/words.d.ts +60 -0
- package/dist/query/words.d.ts.map +1 -0
- package/dist/query.cjs +16 -0
- package/dist/query.cjs.map +1 -0
- package/dist/query.js +16 -0
- package/dist/query.js.map +1 -0
- package/dist/shared/name-popover.d.ts +38 -0
- package/dist/shared/name-popover.d.ts.map +1 -0
- package/dist/studio/builder.d.ts +20 -0
- package/dist/studio/builder.d.ts.map +1 -0
- package/dist/studio/inspector.d.ts +18 -0
- package/dist/studio/inspector.d.ts.map +1 -0
- package/dist/studio/library.d.ts +20 -0
- package/dist/studio/library.d.ts.map +1 -0
- package/dist/studio/messages.d.ts +318 -0
- package/dist/studio/messages.d.ts.map +1 -0
- package/dist/studio/open-page.d.ts +13 -0
- package/dist/studio/open-page.d.ts.map +1 -0
- package/dist/studio/page.d.ts +61 -0
- package/dist/studio/page.d.ts.map +1 -0
- package/dist/studio/palette.d.ts +41 -0
- package/dist/studio/palette.d.ts.map +1 -0
- package/dist/studio/publish.d.ts +21 -0
- package/dist/studio/publish.d.ts.map +1 -0
- package/dist/studio/save-template.d.ts +18 -0
- package/dist/studio/save-template.d.ts.map +1 -0
- package/dist/studio/studio-east.d.ts +45 -0
- package/dist/studio/studio-east.d.ts.map +1 -0
- package/package.json +19 -14
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { EastType, EastTypeValue, ValueTypeOf } from '@elaraai/east';
|
|
2
2
|
import { PlatformFunction } from '@elaraai/east/internal';
|
|
3
3
|
import { RecordErrorType } from '@elaraai/e3-ui/internal';
|
|
4
|
-
import { RecordSignature, MutationResult, RecordHistoryResult } from '@elaraai/e3-api-client';
|
|
4
|
+
import { RecordSignature, MutationResult, RecordHistoryResult, RequestOptions } from '@elaraai/e3-api-client';
|
|
5
5
|
import { TrackedChannelStore } from './tracked-channel.js';
|
|
6
6
|
import { ReactiveDatasetCacheInterface } from './dataset-store.js';
|
|
7
7
|
/** Request shape for {@link RecordApi.mutate} — beast2-encoded positional
|
|
8
8
|
* args (the extra reducer parameters, after the implicit state). */
|
|
9
9
|
export interface RecordMutateArgs {
|
|
10
10
|
args: Uint8Array[];
|
|
11
|
+
/** The write's idempotency key: a retry with the same key after an
|
|
12
|
+
* unanswered call resolves to the first call's commit instead of writing
|
|
13
|
+
* twice. */
|
|
14
|
+
idempotencyKey?: string;
|
|
11
15
|
}
|
|
12
16
|
/**
|
|
13
17
|
* Adapter for the workspace record endpoints. The default wraps
|
|
@@ -26,8 +30,14 @@ export interface RecordApi {
|
|
|
26
30
|
/**
|
|
27
31
|
* Build the default {@link RecordApi} that talks to a real e3 server via
|
|
28
32
|
* `@elaraai/e3-api-client`.
|
|
33
|
+
*
|
|
34
|
+
* @param apiUrl - Base URL of the e3 API server
|
|
35
|
+
* @param repo - Repository name
|
|
36
|
+
* @param getOptions - Reads the current request options — the token, and the
|
|
37
|
+
* `fetch` requests go through — so a rotated one is used at once
|
|
38
|
+
* @returns The adapter
|
|
29
39
|
*/
|
|
30
|
-
export declare function createDefaultRecordApi(apiUrl: string, repo: string,
|
|
40
|
+
export declare function createDefaultRecordApi(apiUrl: string, repo: string, getOptions: () => RequestOptions): RecordApi;
|
|
31
41
|
type RecordError = ValueTypeOf<RecordErrorType>;
|
|
32
42
|
type RecordMutateTag = "idle" | "running" | "committed" | "failed" | "cancelled";
|
|
33
43
|
/** A handle's signature, recovered from the instantiated handle type. */
|
|
@@ -73,7 +83,8 @@ export declare class RecordRuntime extends TrackedChannelStore<RecordEntry> {
|
|
|
73
83
|
private readonly handleCache;
|
|
74
84
|
protected createEntry(): RecordEntry;
|
|
75
85
|
/** Install the API adapter + dataset cache + workspace — called by the
|
|
76
|
-
* React provider (or a test
|
|
86
|
+
* React provider (or a test, or the snapshot harness) before any handle
|
|
87
|
+
* is used. */
|
|
77
88
|
initialize(api: RecordApi, cache: ReactiveDatasetCacheInterface, workspace: string): void;
|
|
78
89
|
/**
|
|
79
90
|
* Tear down the adapter and all record state.
|
|
@@ -88,9 +99,29 @@ export declare class RecordRuntime extends TrackedChannelStore<RecordEntry> {
|
|
|
88
99
|
private signature;
|
|
89
100
|
/** Validate a mutation's declared arg types against the deployed signature. */
|
|
90
101
|
private validate;
|
|
91
|
-
/**
|
|
102
|
+
/**
|
|
103
|
+
* Fetch a record's history once per channel (deduped); notify on settle.
|
|
104
|
+
*
|
|
105
|
+
* @param again - Fetch once more after a fetch in flight, which may have
|
|
106
|
+
* read the chain before what the caller fetches it for
|
|
107
|
+
* @returns The fetch, settled once the history or its failure is in
|
|
108
|
+
*/
|
|
92
109
|
private fetchHistory;
|
|
93
|
-
|
|
110
|
+
/**
|
|
111
|
+
* Run one mutation on the record's channel, and settle to the server's
|
|
112
|
+
* outcome.
|
|
113
|
+
*
|
|
114
|
+
* @remarks
|
|
115
|
+
* The channel shows the write as it shows every launch, latest-wins; the
|
|
116
|
+
* outcome returned is the server's own, whatever became of the channel. A
|
|
117
|
+
* commit refreshes the record's bytes and drops its history. A conflict
|
|
118
|
+
* fetches both again before the outcome settles, so an awaiting caller
|
|
119
|
+
* reads the state and the history its write lost to.
|
|
120
|
+
*
|
|
121
|
+
* @param idempotencyKey - The write's request id, when it has one
|
|
122
|
+
* @returns The outcome
|
|
123
|
+
*/
|
|
124
|
+
private runMutation;
|
|
94
125
|
/**
|
|
95
126
|
* The low-level primitives backing handle methods, bound to THIS runtime.
|
|
96
127
|
* Registered globally (extension registry) and included by the scoped
|
|
@@ -117,7 +148,7 @@ export declare class RecordRuntime extends TrackedChannelStore<RecordEntry> {
|
|
|
117
148
|
/** Process-global runtime backing the `RecordPlatform` export. */
|
|
118
149
|
export declare const defaultRecordRuntime: RecordRuntime;
|
|
119
150
|
/** Install the record API adapter + dataset cache + workspace — called by the
|
|
120
|
-
* React provider on mount (or by a test
|
|
151
|
+
* React provider on mount (or by a test, or the snapshot harness). */
|
|
121
152
|
export declare function initializeRecordApi(api: RecordApi, cache: ReactiveDatasetCacheInterface, workspace: string): void;
|
|
122
153
|
/**
|
|
123
154
|
* Tear down the record API adapter and all record state.
|
|
@@ -152,8 +183,15 @@ export interface InMemoryRecordDef {
|
|
|
152
183
|
}
|
|
153
184
|
/**
|
|
154
185
|
* Build an offline {@link RecordApi} from local implementations — the
|
|
155
|
-
*
|
|
186
|
+
* snapshot harness's stand-in for a deployed record. Seeds each
|
|
156
187
|
* record's current value into the dataset cache so `read()` works offline.
|
|
188
|
+
*
|
|
189
|
+
* @remarks
|
|
190
|
+
* A reducer that throws a patch's `ConflictError` — `applyFor` over a patch
|
|
191
|
+
* whose befores the state no longer holds — is the stale write the server
|
|
192
|
+
* reports as a `conflict` naming the key; any other throw is a failed program.
|
|
193
|
+
* A mutation carrying the key the last one carried returns that one's result
|
|
194
|
+
* without running again, as the server's idempotent retry does.
|
|
157
195
|
*/
|
|
158
196
|
export declare function createInMemoryRecordApi(cache: ReactiveDatasetCacheInterface, workspace: string, defs: InMemoryRecordDef[]): RecordApi;
|
|
159
197
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-runtime.d.ts","sourceRoot":"","sources":["../../src/platform/record-runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"record-runtime.d.ts","sourceRoot":"","sources":["../../src/platform/record-runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAcH,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,WAAW,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,gBAAgB,EAAgB,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAA8C,KAAK,eAAe,EAA0B,MAAM,yBAAyB,CAAC;AACnI,OAAO,EAIH,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EAGxB,KAAK,cAAc,EACtB,MAAM,wBAAwB,CAAC;AAKhC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAmB,KAAK,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AASzF;qEACqE;AACrE,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,UAAU,EAAE,CA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WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,gBAAgB;CAcvE;AAMD,kEAAkE;AAClE,eAAO,MAAM,oBAAoB,eAAsB,CAAC;AAExD;uEACuE;AACvE,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,6BAA6B,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAEjH;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,CAAC,EAAE,SAAS,GAAG,IAAI,CAEpD;AAED;6EAC6E;AAC7E,eAAO,MAAM,cAAc,EAAE,gBAAgB,EAG5C,CAAC;AAEF;;;;;0DAK0D;AAC1D,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAKzF;AASD,6EAA6E;AAC7E,MAAM,WAAW,iBAAiB;IAC9B,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,SAAS,EAAE,QAAQ,GAAG,aAAa,CAAC;IACpC,qDAAqD;IACrD,OAAO,EAAE,OAAO,CAAC;IACjB,wEAAwE;IACxE,SAAS,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,CAAC,QAAQ,GAAG,aAAa,CAAC,EAAE,CAAC;QACvC,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;KAC3D,EAAE,CAAC;CACP;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CACnC,KAAK,EAAE,6BAA6B,EACpC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,iBAAiB,EAAE,GAC1B,SAAS,CAkFX"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { QueryObserverResult } from '@tanstack/react-query';
|
|
2
|
+
/** The most a view waits before it tries a read again after its first
|
|
3
|
+
* failure; each failure in a row doubles it, up to {@link RECOVERY_MAX_MS}. */
|
|
4
|
+
export declare const RECOVERY_FIRST_MS = 1000;
|
|
5
|
+
/** The most a view waits before it tries a read again. */
|
|
6
|
+
export declare const RECOVERY_MAX_MS = 30000;
|
|
7
|
+
/**
|
|
8
|
+
* How long a view waits before it tries a failed read again.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* The wait backs off: at most 1 s after the first failure in a row, doubling
|
|
12
|
+
* with each failure after it, up to 30 s. It is a random point in the second
|
|
13
|
+
* half of that: 0.5–1 s after the first failure, 1–2 s after the second, and
|
|
14
|
+
* 15–30 s from the sixth on. So views that failed together try again apart,
|
|
15
|
+
* and none tries again sooner than half its backoff.
|
|
16
|
+
*
|
|
17
|
+
* @param failures - How many times in a row the read has failed, from 1
|
|
18
|
+
* @param random - A draw from [0, 1); `Math.random` unless a test gives one
|
|
19
|
+
* @returns The wait, in milliseconds
|
|
20
|
+
*/
|
|
21
|
+
export declare function recoveryDelay(failures: number, random?: () => number): number;
|
|
22
|
+
/** What {@link useQueryRecovery} reads of a query, as `useQuery` returns it. */
|
|
23
|
+
export type RecoveringQuery = Pick<QueryObserverResult<unknown, Error>, "error" | "errorUpdatedAt" | "dataUpdatedAt" | "fetchStatus" | "refetch">;
|
|
24
|
+
/**
|
|
25
|
+
* Tries a failed query again by itself, for as long as the view is mounted,
|
|
26
|
+
* and gives the failure to show meanwhile.
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* A query that failed fetches again only when the window regains focus or the
|
|
30
|
+
* view mounts again, so a view on a screen no one touches would stay on the
|
|
31
|
+
* failure. This fetches it again after {@link recoveryDelay}'s wait for each
|
|
32
|
+
* failure in a row, once the query has stopped fetching.
|
|
33
|
+
*
|
|
34
|
+
* TanStack clears the error of a query that holds no data while it fetches
|
|
35
|
+
* again, so a view that showed the query's error would go back to loading at
|
|
36
|
+
* every try. The failure this gives stands until a fetch reads: the latest,
|
|
37
|
+
* through each try.
|
|
38
|
+
*
|
|
39
|
+
* @param query - The query to keep trying while it fails
|
|
40
|
+
* @returns The failure to show, or `null` while the query has not failed since
|
|
41
|
+
* it last read
|
|
42
|
+
*/
|
|
43
|
+
export declare function useQueryRecovery(query: RecoveringQuery): Error | null;
|
|
44
|
+
//# sourceMappingURL=recovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recovery.d.ts","sourceRoot":"","sources":["../../src/platform/recovery.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgBH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE;gFACgF;AAChF,eAAO,MAAM,iBAAiB,OAAQ,CAAC;AAEvC,0DAA0D;AAC1D,eAAO,MAAM,eAAe,QAAS,CAAC;AAEtC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,MAAoB,GAAG,MAAM,CAG1F;AAED,gFAAgF;AAChF,MAAM,MAAM,eAAe,GAAG,IAAI,CAC9B,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,EACnC,OAAO,GAAG,gBAAgB,GAAG,eAAe,GAAG,aAAa,GAAG,SAAS,CAC3E,CAAC;AAYF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,eAAe,GAAG,KAAK,GAAG,IAAI,CAsBrE"}
|
|
@@ -135,7 +135,23 @@ export declare class StagedStore implements StagedStoreInterface {
|
|
|
135
135
|
private emitPersistError;
|
|
136
136
|
private hydrate;
|
|
137
137
|
}
|
|
138
|
+
/**
|
|
139
|
+
* The staged store the package uses: the one installed
|
|
140
|
+
* ({@link initializeStagedStore}), else the default — over IndexedDB where
|
|
141
|
+
* there is one, made when it is first asked for.
|
|
142
|
+
*
|
|
143
|
+
* @returns The store
|
|
144
|
+
*/
|
|
138
145
|
export declare function getStagedStore(): StagedStoreInterface;
|
|
146
|
+
/**
|
|
147
|
+
* Install the staged store the package uses from now on. The default
|
|
148
|
+
* `Data.bind` runtime, its reactive tracker and the providers each read the
|
|
149
|
+
* store installed when they use it, so a host installs its own as it loads —
|
|
150
|
+
* one that keeps edits in memory, say, when what they are staged against
|
|
151
|
+
* lives no longer than the page.
|
|
152
|
+
*
|
|
153
|
+
* @param store - The store
|
|
154
|
+
*/
|
|
139
155
|
export declare function initializeStagedStore(store: StagedStoreInterface): void;
|
|
140
156
|
export declare function clearStagedStoreSingleton(): void;
|
|
141
157
|
//# sourceMappingURL=staged-store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staged-store.d.ts","sourceRoot":"","sources":["../../src/platform/staged-store.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAOlD,qDAAqD;AACrD,MAAM,WAAW,WAAW;IACxB;2EACuE;IACvE,QAAQ,EAAE,UAAU,CAAC;IACrB,8DAA8D;IAC9D,QAAQ,EAAE,UAAU,CAAC;CACxB;AAED;;qCAEqC;AACrC,MAAM,WAAW,oBAAoB;IACjC,QAAQ,EAAE,UAAU,CAAC;IACrB,QAAQ,EAAE,UAAU,CAAC;CACxB;AAED;iCACiC;AACjC,MAAM,WAAW,wBAAwB;IACrC,6EAA6E;IAC7E,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAC;IACtD,4CAA4C;IAC5C,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,8CAA8C;IAC9C,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,oCAAoC;IACpC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED,MAAM,WAAW,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QAAQ,EAAE,UAAU,GACrB,IAAI;IAgBP,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO;IASnD,QAAQ,IAAI,MAAM,EAAE;IAKpB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,IAAI;IAWnC,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAaxD,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAIlC,cAAc,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI;IAKnE,oEAAoE;IAC9D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAY5B,iEAAiE;IACjE,OAAO,CAAC,KAAK;IAIb;+EAC2E;IAC3E,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,MAAM;IAMd;;;;;OAKG;IACH,OAAO,CAAC,OAAO;IAgBf,OAAO,CAAC,gBAAgB;YAcV,OAAO;CAyBxB;AAmBD;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI,oBAAoB,CAKrD;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,CAEvE;AAED,wBAAgB,yBAAyB,IAAI,IAAI,CAEhD"}
|
|
@@ -51,6 +51,18 @@ export declare abstract class TrackedChannelStore<E extends ChannelEntry> {
|
|
|
51
51
|
protected track(key: string): void;
|
|
52
52
|
subscribe(key: string, callback: () => void): () => void;
|
|
53
53
|
getKeyVersion(key: string): number;
|
|
54
|
+
/** Whether anything is subscribed to a channel. */
|
|
55
|
+
protected isSubscribed(key: string): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Called as a channel's last subscriber leaves, synchronously — a
|
|
58
|
+
* subclass that holds something for the channel's readers can let it go.
|
|
59
|
+
* A reader re-subscribing drops its subscriptions first (a tracked read's
|
|
60
|
+
* run, React's), so what is let go should be let go only if the channel
|
|
61
|
+
* is still unsubscribed once that is done.
|
|
62
|
+
*
|
|
63
|
+
* @param _key - The channel
|
|
64
|
+
*/
|
|
65
|
+
protected unsubscribed(_key: string): void;
|
|
54
66
|
protected notify(key: string): void;
|
|
55
67
|
protected entry(key: string): E;
|
|
56
68
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracked-channel.d.ts","sourceRoot":"","sources":["../../src/platform/tracked-channel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;GAaG;AAEH,sDAAsD;AACtD,MAAM,WAAW,YAAY;IACzB;sDACkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf;0EACsE;IACtE,SAAS,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,8BAAsB,mBAAmB,CAAC,CAAC,SAAS,YAAY;IAC5D,SAAS,CAAC,QAAQ,CAAC,OAAO,iBAAwB;IAGlD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAsC;IACrE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA6B;IAIzD,OAAO,CAAC,eAAe,CAA4B;IAEnD,+DAA+D;IAC/D,SAAS,CAAC,QAAQ,CAAC,WAAW,IAAI,CAAC;IAInC,cAAc,IAAI,GAAG,CAAC,MAAM,CAAC;IAK7B,eAAe,IAAI,MAAM,EAAE;IAM3B,UAAU,IAAI,OAAO;IAIrB;;;+CAG2C;IAC3C,SAAS,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIzC;qBACiB;IACjB,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAMlC,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;
|
|
1
|
+
{"version":3,"file":"tracked-channel.d.ts","sourceRoot":"","sources":["../../src/platform/tracked-channel.ts"],"names":[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E,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAC3B;QAAE,KAAK,EAAE,CAAC,CAAC;QAAC,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,KAAK,IAAI,CAAA;KAAE;IAiB7D;;;;OAIG;IACH,SAAS,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAAG,IAAI;IAUtE,mEAAmE;IACnE,SAAS,CAAC,aAAa,IAAI,IAAI;CAKlC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Formatters } from '@elaraai/east-ui-components';
|
|
2
|
+
import { OutlineLine } from './model/cards.js';
|
|
3
|
+
import { QueryWords } from './model/words.js';
|
|
4
|
+
import { QueryRoot } from './one-shot.js';
|
|
5
|
+
import { SavedQuery } from './session.js';
|
|
6
|
+
/** What a saved query, or a recent run, is here. */
|
|
7
|
+
export interface QueryAbout {
|
|
8
|
+
/**
|
|
9
|
+
* The data source its steps start from; for a program that is not steps,
|
|
10
|
+
* the first its root reads — else the first bound.
|
|
11
|
+
*/
|
|
12
|
+
readonly source: string;
|
|
13
|
+
/** Its description: the author's, else the sentence generated from its steps; `undefined` when there is neither. */
|
|
14
|
+
readonly description: string | undefined;
|
|
15
|
+
/** Why it can't open here, in the builder's words; `undefined` when it can. */
|
|
16
|
+
readonly refusal: string | undefined;
|
|
17
|
+
/** Its steps: how many, and one outline line per finished step; `undefined` for a program that is not steps. */
|
|
18
|
+
readonly steps: {
|
|
19
|
+
readonly count: number;
|
|
20
|
+
readonly outline: readonly OutlineLine[];
|
|
21
|
+
} | undefined;
|
|
22
|
+
/** How many problems it has here: the errors its check finds. */
|
|
23
|
+
readonly problems: number;
|
|
24
|
+
/** The first, in plain words; `undefined` when it has none. */
|
|
25
|
+
readonly problem: string | undefined;
|
|
26
|
+
/** What it gives, in words — "Up to 10 shipped orders"; `undefined` while it has problems. */
|
|
27
|
+
readonly gives: string | undefined;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* What a saved query, or a recent run, is against a root: its steps parsed
|
|
31
|
+
* and checked once (`Query Editor Spec.md` §4.10, §5).
|
|
32
|
+
*
|
|
33
|
+
* @param saved - The saved query, or the run
|
|
34
|
+
* @param root - The root the surface's data sources make
|
|
35
|
+
* @param words - The words
|
|
36
|
+
* @returns What it is here
|
|
37
|
+
*/
|
|
38
|
+
export declare function queryAbout(saved: SavedQuery, root: QueryRoot, words: QueryWords): QueryAbout;
|
|
39
|
+
/**
|
|
40
|
+
* When a query was saved, or a run ran, in a card's words — "14:02" today,
|
|
41
|
+
* "Tue" within the last six days, "Sep 12" this year, else "Sep 12, 2025" —
|
|
42
|
+
* in the viewer's locale and time zone.
|
|
43
|
+
*
|
|
44
|
+
* @param at - When
|
|
45
|
+
* @param now - The moment it is read at
|
|
46
|
+
* @param formatters - The locale's formatters
|
|
47
|
+
* @returns The words
|
|
48
|
+
*/
|
|
49
|
+
export declare function whenWords(at: Date, now: Date, formatters: Formatters): string;
|
|
50
|
+
//# sourceMappingURL=about.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"about.d.ts","sourceRoot":"","sources":["../../src/query/about.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAA2C,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC5F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAA2C,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AASxF,oDAAoD;AACpD,MAAM,WAAW,UAAU;IACvB;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,oHAAoH;IACpH,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,+EAA+E;IAC/E,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,gHAAgH;IAChH,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAA;KAAE,GAAG,SAAS,CAAC;IACjG,iEAAiE;IACjE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,8FAA8F;IAC9F,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,GAAG,UAAU,CA+B5F;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,GAAG,MAAM,CAI7E"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { SlotItem } from './model/slots.js';
|
|
2
|
+
/** A box as the viewport measures it — what `getBoundingClientRect` gives. */
|
|
3
|
+
export interface PlacementBox {
|
|
4
|
+
/** Its left edge. */
|
|
5
|
+
readonly left: number;
|
|
6
|
+
/** Its top edge. */
|
|
7
|
+
readonly top: number;
|
|
8
|
+
/** Its width. */
|
|
9
|
+
readonly width: number;
|
|
10
|
+
/** Its height. */
|
|
11
|
+
readonly height: number;
|
|
12
|
+
}
|
|
13
|
+
/** What {@link placeAutocomplete} places the popover by. */
|
|
14
|
+
export interface AutocompletePlacementInput {
|
|
15
|
+
/** The slot's box, as the viewport measures it. */
|
|
16
|
+
readonly anchor: PlacementBox;
|
|
17
|
+
/** The builder's box, as the viewport measures it. */
|
|
18
|
+
readonly bounds: PlacementBox;
|
|
19
|
+
/** The popover's width, in the builder's own pixels (its `offsetWidth`). */
|
|
20
|
+
readonly width: number;
|
|
21
|
+
/** How much the builder is CSS-scaled: its measured width over its own (`offsetWidth`); 1 when it is not. */
|
|
22
|
+
readonly scale: number;
|
|
23
|
+
}
|
|
24
|
+
/** The popover below its slot, in the builder's own pixels. */
|
|
25
|
+
export interface AutocompleteBelow {
|
|
26
|
+
/** The side of its slot it opens on. */
|
|
27
|
+
readonly side: "below";
|
|
28
|
+
/** Its left edge, from the builder's. */
|
|
29
|
+
readonly left: number;
|
|
30
|
+
/** Its top edge, from the builder's. */
|
|
31
|
+
readonly top: number;
|
|
32
|
+
/** Its greatest height, to end inside the builder. */
|
|
33
|
+
readonly maxHeight: number;
|
|
34
|
+
}
|
|
35
|
+
/** The popover above its slot, in the builder's own pixels: its bottom edge is held, so it grows upward. */
|
|
36
|
+
export interface AutocompleteAbove {
|
|
37
|
+
/** The side of its slot it opens on. */
|
|
38
|
+
readonly side: "above";
|
|
39
|
+
/** Its left edge, from the builder's. */
|
|
40
|
+
readonly left: number;
|
|
41
|
+
/** Its bottom edge, from the builder's bottom edge. */
|
|
42
|
+
readonly bottom: number;
|
|
43
|
+
/** Its greatest height, to start inside the builder. */
|
|
44
|
+
readonly maxHeight: number;
|
|
45
|
+
}
|
|
46
|
+
/** Where the popover goes, in the builder's own pixels. */
|
|
47
|
+
export type AutocompletePlacement = AutocompleteBelow | AutocompleteAbove;
|
|
48
|
+
/**
|
|
49
|
+
* Where the slot autocomplete goes (`Query Editor Spec.md` §4.5): left-aligned
|
|
50
|
+
* with its slot and clamped 8px inside the builder; 4px below the slot, or 4px
|
|
51
|
+
* above it when under 280px remain below and more is above. A CSS-scaled
|
|
52
|
+
* builder measures scaled, so every measure is divided by its scale into the
|
|
53
|
+
* builder's own pixels, the ones its absolutely positioned popover is laid
|
|
54
|
+
* out in.
|
|
55
|
+
*
|
|
56
|
+
* @param input - the slot's and the builder's boxes as measured, the popover's width and the builder's scale
|
|
57
|
+
* @returns the side it opens on, its left edge and its top edge (below) or bottom edge (above), and its greatest height
|
|
58
|
+
*/
|
|
59
|
+
export declare function placeAutocomplete({ anchor, bounds, width, scale }: AutocompletePlacementInput): AutocompletePlacement;
|
|
60
|
+
/** Props of {@link SlotAutocomplete}. */
|
|
61
|
+
export interface SlotAutocompleteProps {
|
|
62
|
+
/** The slot's element: the popover hangs from it, and a press on it is the host's (it toggles the slot), not a press outside. */
|
|
63
|
+
anchor: HTMLElement;
|
|
64
|
+
/**
|
|
65
|
+
* The builder's element: the popover is portaled into it and stays inside
|
|
66
|
+
* it, absolutely positioned in its coordinates — so it is the popover's
|
|
67
|
+
* containing block (positioned, or transformed).
|
|
68
|
+
*/
|
|
69
|
+
bounds: HTMLElement;
|
|
70
|
+
/** Its label — `FIELD` (#934's `slotLabel`). */
|
|
71
|
+
label: string;
|
|
72
|
+
/** The filter's placeholder (#934's `slotPlaceholder`). */
|
|
73
|
+
placeholder: string;
|
|
74
|
+
/** The footer's hint: where the offers come from (#934's `slotHint`). */
|
|
75
|
+
hint: string;
|
|
76
|
+
/** What it says with nothing to offer (#934's `slotEmpty`). */
|
|
77
|
+
empty: string;
|
|
78
|
+
/** The keys' hint, `↑↓ ⏎ esc` (#934's `slotKeys`). */
|
|
79
|
+
keys: string;
|
|
80
|
+
/**
|
|
81
|
+
* The offers for the text typed — #934's `slotItems`, which the host
|
|
82
|
+
* recomputes on each change of text. A new list for the same text (a
|
|
83
|
+
* summary arrived) keeps the active offer, found by its group and label,
|
|
84
|
+
* while it is still offered.
|
|
85
|
+
*/
|
|
86
|
+
items: readonly SlotItem[];
|
|
87
|
+
/** The text typed; a text the host sets, other than the one typed, replaces it. */
|
|
88
|
+
text: string;
|
|
89
|
+
/** Told each change of the text. */
|
|
90
|
+
onText: (text: string) => void;
|
|
91
|
+
/**
|
|
92
|
+
* The offer active when it opens — #934's `activeItem`; `-1` when none can
|
|
93
|
+
* be picked. Typing makes the first offer that can be picked active.
|
|
94
|
+
*/
|
|
95
|
+
initialActive: number;
|
|
96
|
+
/** Told the offer picked: ⏎, Tab or a click. */
|
|
97
|
+
onPick: (item: SlotItem) => void;
|
|
98
|
+
/** Told it closes: Esc, or a press outside it and its anchor. */
|
|
99
|
+
onClose: () => void;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The slot autocomplete — see the module docs. It opens with `initialActive`
|
|
103
|
+
* active and its filter focused (without scrolling); the active offer stays in
|
|
104
|
+
* view. While it is open it follows its slot as the page scrolls or resizes,
|
|
105
|
+
* and when it closes with the focus in it, the focus returns to its slot.
|
|
106
|
+
* Callbacks reach the host through `queueMicrotask`.
|
|
107
|
+
*
|
|
108
|
+
* @param props - its slot and builder, its words, the offers, the text typed, and the callbacks ({@link SlotAutocompleteProps})
|
|
109
|
+
* @returns the popover, portaled into the builder
|
|
110
|
+
*/
|
|
111
|
+
export declare const SlotAutocomplete: import('react').NamedExoticComponent<SlotAutocompleteProps>;
|
|
112
|
+
//# sourceMappingURL=autocomplete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../src/query/autocomplete.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAmCH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAiBjD,8EAA8E;AAC9E,MAAM,WAAW,YAAY;IACzB,qBAAqB;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,oBAAoB;IACpB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,iBAAiB;IACjB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,kBAAkB;IAClB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CAC3B;AAED,4DAA4D;AAC5D,MAAM,WAAW,0BAA0B;IACvC,mDAAmD;IACnD,QAAQ,CAAC,MAAM,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E,MAAM,CAAC;IACb,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;IAC3B,mFAAmF;IACnF,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,MAAM,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACjC,iEAAiE;IACjE,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,6DAgN3B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ValueTypeOf } from '@elaraai/east';
|
|
2
|
+
import { QueryBuilderComponent } from '@elaraai/e3-ui/internal';
|
|
3
|
+
/** The renderer's payload, decoded. */
|
|
4
|
+
type QueryBuilderValue = ValueTypeOf<typeof QueryBuilderComponent.schema>;
|
|
5
|
+
/** A tab of the pane. */
|
|
6
|
+
export type QueryTab = "query" | "datasets" | "library";
|
|
7
|
+
/** Where an issue the history item goes to is: its step, and its slot. */
|
|
8
|
+
export interface QueryFocus {
|
|
9
|
+
/** The step's id, or `$query` for the query as a whole. */
|
|
10
|
+
readonly entry: string;
|
|
11
|
+
/** The slot, when the issue is on one. */
|
|
12
|
+
readonly slot: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
/** Props of {@link EastChakraQueryBuilder}. */
|
|
15
|
+
export interface EastChakraQueryBuilderProps {
|
|
16
|
+
/** The payload, decoded. */
|
|
17
|
+
value: QueryBuilderValue;
|
|
18
|
+
/** The structural storage key. */
|
|
19
|
+
storageKey: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Renders the query builder — see the module docs.
|
|
23
|
+
*
|
|
24
|
+
* @param props - The payload and its storage key
|
|
25
|
+
* @returns The builder
|
|
26
|
+
*/
|
|
27
|
+
export declare const EastChakraQueryBuilder: import('react').NamedExoticComponent<EastChakraQueryBuilderProps>;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/query/builder.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAmDH,OAAO,EAA+D,KAAK,WAAW,EAAe,MAAM,eAAe,CAAC;AAC3H,OAAO,EAAE,qBAAqB,EAAsC,MAAM,yBAAyB,CAAC;AAgCpG,uCAAuC;AACvC,KAAK,iBAAiB,GAAG,WAAW,CAAC,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAS1E,yBAAyB;AACzB,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAC;AAExD,0EAA0E;AAC1E,MAAM,WAAW,UAAU;IACvB,2DAA2D;IAC3D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC;AAED,+CAA+C;AAC/C,MAAM,WAAW,2BAA2B;IACxC,4BAA4B;IAC5B,KAAK,EAAE,iBAAiB,CAAC;IACzB,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;CACtB;AAuBD;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,mEAoCiE,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* A query's calls without the builder (#941) — `@elaraai/e3-ui-components/query`:
|
|
7
|
+
* the root a query reads, its one-shot call and the reading of its answer
|
|
8
|
+
* (`one-shot.ts`), a run's plan and its split call (`plan.ts`), and each call
|
|
9
|
+
* answered in memory where there is no server (`in-memory-call.ts`).
|
|
10
|
+
*
|
|
11
|
+
* It imports neither React nor the renderers — only East and e3's wire types —
|
|
12
|
+
* so a host in Node, where the package's main entry cannot load (its renderers
|
|
13
|
+
* need a DOM), plans and makes a query's calls exactly as the builder does: a
|
|
14
|
+
* CLI, an agent, or a test against an e3 server. The main entry exports the
|
|
15
|
+
* same names.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { planQuery, prepareQuery, queryResultOf, queryRoot } from "@elaraai/e3-ui-components/query";
|
|
20
|
+
* import { oneShotExecute, splitCall } from "@elaraai/e3-api-client";
|
|
21
|
+
*
|
|
22
|
+
* const root = queryRoot([{ name: "orders", path: ordersPath, type: toEastTypeValue(OrdersType) }]);
|
|
23
|
+
* const planned = planQuery(".orders | map(.total) | add", root, new Map([["orders", { bytes, rows }]]));
|
|
24
|
+
* if ("result" in planned) return planned.result; // the checker's problems
|
|
25
|
+
* const plan = planned.plan;
|
|
26
|
+
* switch (plan.kind) {
|
|
27
|
+
* case "split":
|
|
28
|
+
* return queryResultOf(plan.reading, (await splitCall(url, repo, workspace, plan.request, { token })).result);
|
|
29
|
+
* case "rekey": {
|
|
30
|
+
* // A re-keyed join (#942): the re-key call, then the join call over its output, by its hash.
|
|
31
|
+
* const first = await splitCall(url, repo, workspace, plan.first, { token });
|
|
32
|
+
* const join = first.output === null ? undefined : (await splitCall(url, repo, workspace, plan.join(first.output), { token })).result;
|
|
33
|
+
* return queryResultOf(plan.reading, plan.answer(first.result, join));
|
|
34
|
+
* }
|
|
35
|
+
* case "one_shot":
|
|
36
|
+
* return queryResultOf(plan.prepared, await oneShotExecute(url, repo, workspace, plan.prepared.request, { token }));
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @packageDocumentation
|
|
41
|
+
*/
|
|
42
|
+
export { prepareQuery, programChecks, queryResultOf, queryRoot, type CheckedProgram, type PreparedQuery, type QueryOptions, type QueryReading, type QueryResult, type QueryRoot, type QueryRootEntry, } from './one-shot.js';
|
|
43
|
+
export { draftPlan, weighPlan, planQuery, splitCallRequest, rekeyCallRequests, type OneCallWhy, type PlanDraft, type PlanExplanation, type PlanOptions, type PlanPath, type PlanPrograms, type QueryPlan, type RekeyCalls, type SourceWeight, } from './plan.js';
|
|
44
|
+
export { createInMemoryQueryCall, createInMemorySplitCall, createInMemorySourceStatus, type InMemoryDataset, type InMemorySplitCall, type InMemorySplitCallOptions, } from './in-memory-call.js';
|
|
45
|
+
export type { QueryCall, QuerySplitCall, QuerySplitCallOptions, QuerySplitExplain, QuerySourceStatus, SourceStatus } from './hooks.js';
|
|
46
|
+
//# sourceMappingURL=calls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calls.d.ts","sourceRoot":"","sources":["../../src/query/calls.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EACH,YAAY,EACZ,aAAa,EACb,aAAa,EACb,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,cAAc,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,SAAS,EACT,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,YAAY,GACpB,MAAM,WAAW,CAAC;AACnB,OAAO,EACH,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,GAChC,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { EastType } from '@elaraai/east';
|
|
2
|
+
import { QueryWords } from './model/words.js';
|
|
3
|
+
import { QueryRoot } from './one-shot.js';
|
|
4
|
+
/** A kind of data source: the Datasets tab's group. */
|
|
5
|
+
export type SourceKind = "rows" | "lookups" | "values" | "models";
|
|
6
|
+
/** How the open query reads a data source: as its source, or looked up. */
|
|
7
|
+
export type SourceRole = "source" | "lookedUp";
|
|
8
|
+
/**
|
|
9
|
+
* What a data source is, by its type: its group and its icon.
|
|
10
|
+
*
|
|
11
|
+
* @param type - its type
|
|
12
|
+
* @returns the group and the icon
|
|
13
|
+
*/
|
|
14
|
+
export declare function sourceKind(type: EastType): {
|
|
15
|
+
kind: SourceKind;
|
|
16
|
+
icon: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* A data source's size in words: a list's or a lookup table's count, once its
|
|
20
|
+
* status gives one; a tree, a record, a calculation's inputs and result, or a
|
|
21
|
+
* value's kind otherwise.
|
|
22
|
+
*
|
|
23
|
+
* @param name - its name, which names its items
|
|
24
|
+
* @param type - its type
|
|
25
|
+
* @param rows - how many elements its status counts, if it does
|
|
26
|
+
* @param words - the words
|
|
27
|
+
* @returns the size, or `""` for a list or a lookup table not counted yet
|
|
28
|
+
*/
|
|
29
|
+
export declare function sourceSize(name: string, type: EastType, rows: number | undefined, words: QueryWords): string;
|
|
30
|
+
/** Props of {@link DatasetsTab}. */
|
|
31
|
+
export interface DatasetsTabProps {
|
|
32
|
+
/** The data sources, as the root holds them. */
|
|
33
|
+
readonly root: QueryRoot;
|
|
34
|
+
/** How the open query reads each data source it reads, by name. */
|
|
35
|
+
readonly reads: ReadonlyMap<string, SourceRole>;
|
|
36
|
+
/** Starts a new query on a data source. */
|
|
37
|
+
readonly onStart: (name: string) => void;
|
|
38
|
+
/** The tab's library's id. */
|
|
39
|
+
readonly id: string;
|
|
40
|
+
/** The words. */
|
|
41
|
+
readonly words: QueryWords;
|
|
42
|
+
/** Where the library keeps its state. */
|
|
43
|
+
readonly storageKey: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Renders the Datasets tab — see the module docs.
|
|
47
|
+
*
|
|
48
|
+
* @param props - The data sources, how the open query reads them, and what a click does ({@link DatasetsTabProps})
|
|
49
|
+
* @returns The tab's library
|
|
50
|
+
*/
|
|
51
|
+
export declare const DatasetsTab: import('react').NamedExoticComponent<DatasetsTabProps>;
|
|
52
|
+
//# sourceMappingURL=datasets-tab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datasets-tab.d.ts","sourceRoot":"","sources":["../../src/query/datasets-tab.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAwBH,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAI1D,OAAO,EAA4B,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAI/C,uDAAuD;AACvD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAKlE,2EAA2E;AAC3E,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;AAQ/C;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,GAAG;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAU7E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,CAyB5G;AAED,oCAAoC;AACpC,MAAM,WAAW,gBAAgB;IAC7B,gDAAgD;IAChD,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,mEAAmE;IACnE,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAChD,2CAA2C;IAC3C,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,iBAAiB;IACjB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,yCAAyC;IACzC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC/B;AAKD;;;;;GAKG;AACH,eAAO,MAAM,WAAW,wDAKtB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { QueryWords } from './model/words.js';
|
|
2
|
+
import { DownloadFormat } from './results.js';
|
|
3
|
+
import { RunOutput, RunState } from './run.js';
|
|
4
|
+
/**
|
|
5
|
+
* A result's rows as CSV: one row per output, its header the fields' names.
|
|
6
|
+
*
|
|
7
|
+
* @param output - the run's result
|
|
8
|
+
* @param words - the words, for a nested value
|
|
9
|
+
* @returns the CSV's bytes, UTF-8
|
|
10
|
+
*/
|
|
11
|
+
export declare function resultCsv(output: RunOutput, words: QueryWords): Uint8Array;
|
|
12
|
+
/**
|
|
13
|
+
* A result with its type, self-describing beast2: what the run returned.
|
|
14
|
+
*
|
|
15
|
+
* @param output - the run's result
|
|
16
|
+
* @returns the bytes
|
|
17
|
+
*/
|
|
18
|
+
export declare function resultBeast2(output: RunOutput): Uint8Array;
|
|
19
|
+
/**
|
|
20
|
+
* Downloads a run's result, and says so.
|
|
21
|
+
*
|
|
22
|
+
* @param run - the run, answered with a result
|
|
23
|
+
* @param format - CSV or BEAST2
|
|
24
|
+
* @param name - the query's name: the file's
|
|
25
|
+
* @param words - the words
|
|
26
|
+
* @returns the note the results show after it; `undefined` when the run has no result
|
|
27
|
+
*/
|
|
28
|
+
export declare function downloadResult(run: RunState, format: DownloadFormat, name: string, words: QueryWords): string | undefined;
|
|
29
|
+
//# sourceMappingURL=downloads.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"downloads.d.ts","sourceRoot":"","sources":["../../src/query/downloads.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAoBH,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnE,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAiBpD;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,GAAG,UAAU,CAkB1E;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,UAAU,CAE1D;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAWzH"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { QueryWords } from './model/words.js';
|
|
3
|
+
/** Props of {@link QueryDropTarget}. */
|
|
4
|
+
export interface QueryDropTargetProps {
|
|
5
|
+
/** The builder's id (`queryKeys(id)`'s), naming its drop target. */
|
|
6
|
+
readonly id: string | undefined;
|
|
7
|
+
/** Why a query of a name can't open here, in the builder's words; undefined when it can. */
|
|
8
|
+
readonly refusal: (name: string) => string | undefined;
|
|
9
|
+
/** How many steps the query of a name has, for the target's words; undefined when unknown. */
|
|
10
|
+
readonly steps: (name: string) => number | undefined;
|
|
11
|
+
/** Opens the query of a name — what dropping it does. */
|
|
12
|
+
readonly onOpen: (name: string) => void;
|
|
13
|
+
/** The words. */
|
|
14
|
+
readonly words: QueryWords;
|
|
15
|
+
/** The builder's frame: the toolbar, the pane, the results and the status line. */
|
|
16
|
+
readonly children: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The builder's frame as a drop target for the query library's cards — see
|
|
20
|
+
* the module docs. The builder wraps its frame in it: with a drag layer on the
|
|
21
|
+
* page the frame sits in the target's zone, which takes the frame's place;
|
|
22
|
+
* without one, the frame renders alone.
|
|
23
|
+
*
|
|
24
|
+
* @param props - The builder's id, the refusal and the steps of a query by name, what a drop does, the words and the frame ({@link QueryDropTargetProps})
|
|
25
|
+
* @returns The frame, in its drop zone when a drag layer is on the page
|
|
26
|
+
*/
|
|
27
|
+
export declare function QueryDropTarget({ id, refusal, steps, onOpen, words, children }: QueryDropTargetProps): ReactElement;
|
|
28
|
+
//# sourceMappingURL=drops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drops.d.ts","sourceRoot":"","sources":["../../src/query/drops.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAA6C,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAOrG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAiBnD,wCAAwC;AACxC,MAAM,WAAW,oBAAoB;IACjC,oEAAoE;IACpE,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,4FAA4F;IAC5F,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IACvD,8FAA8F;IAC9F,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IACrD,yDAAyD;IACzD,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,iBAAiB;IACjB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,mFAAmF;IACnF,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAChC;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,oBAAoB,GAAG,YAAY,CA4DnH"}
|