@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jq.d.ts","sourceRoot":"","sources":["../../../src/query/steps/jq.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AAEH,OAAO,EASH,KAAK,QAAQ,EACb,KAAK,MAAM,EACd,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;;GAOG;AACH,wBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAGrD;AAWD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AAMD,UAAU;AACV,eAAO,MAAM,QAAQ,EAAE,MAAkC,CAAC;AAE1D,oBAAoB;AACpB,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EA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BAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAAG,MAAM,EAAE,GAAG,SAAS,CAS7F;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAExF;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAUxF;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAUjE;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAS/C;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,EAAE,GAAG,SAAS,CAQjG;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,CAS5D"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { EastType, ParsedJq, QueryErrorType, ValueTypeOf } from '@elaraai/east';
|
|
2
|
+
import { Shape } from './shape.js';
|
|
3
|
+
import { Aggregate, StepQuery } from './values.js';
|
|
4
|
+
/** A problem that keeps a program from being steps, as the query wire types hold one. */
|
|
5
|
+
export type StepParseError = ValueTypeOf<typeof QueryErrorType>;
|
|
6
|
+
/** Where a step was read from in the program's text: the segments it was made of, first to last. */
|
|
7
|
+
export interface StepSpan {
|
|
8
|
+
/** The step's id. */
|
|
9
|
+
readonly stepId: string;
|
|
10
|
+
/** The offset its first segment starts at. */
|
|
11
|
+
readonly from: number;
|
|
12
|
+
/** The offset after its last segment. */
|
|
13
|
+
readonly to: number;
|
|
14
|
+
}
|
|
15
|
+
/** The name a total takes until its author names it: count, the field's name for a sum, `fn_field` otherwise. */
|
|
16
|
+
export declare function defaultTotalName(shape: Shape, fn: Aggregate["fn"]["type"], ref: string | undefined): string;
|
|
17
|
+
/**
|
|
18
|
+
* Parses a jq program into steps.
|
|
19
|
+
*
|
|
20
|
+
* @param program - the program's text, or what east's `parseJq` made of it
|
|
21
|
+
* @param root - the root's type: a struct of the data sources
|
|
22
|
+
* @returns the query as steps, with where each was read from in the text; or
|
|
23
|
+
* the problem that keeps it from being steps
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* The program starts with the `.ds as $ds` binds of its Look ups, then reads
|
|
27
|
+
* a data source; every canonical form after it becomes its step, and a
|
|
28
|
+
* segment no form takes is a jq step, as is every segment after it. Ids are
|
|
29
|
+
* fresh on every parse. A program that does not parse, or does not start
|
|
30
|
+
* from a data source, is not steps.
|
|
31
|
+
*/
|
|
32
|
+
export declare function parseSteps(program: string | ParsedJq, root: EastType): {
|
|
33
|
+
query: StepQuery;
|
|
34
|
+
spans: readonly StepSpan[];
|
|
35
|
+
} | {
|
|
36
|
+
error: StepParseError;
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=parse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../src/query/steps/parse.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AAEH,OAAO,EAEH,KAAK,QAAQ,EAAe,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,KAAK,WAAW,EACnF,MAAM,eAAe,CAAC;AAMvB,OAAO,EAA+C,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AACrF,OAAO,EACkB,KAAK,SAAS,EACnC,KAAK,SAAS,EACjB,MAAM,aAAa,CAAC;AAErB,yFAAyF;AACzF,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,OAAO,cAAc,CAAC,CAAC;AAEhE,oGAAoG;AACpG,MAAM,WAAW,QAAQ;IACrB,qBAAqB;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,8CAA8C;IAC9C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACvB;AA0LD,iHAAiH;AACjH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAI3G;AA+PD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,EAAE,IAAI,EAAE,QAAQ,GAAG;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,cAAc,CAAA;CAAE,CAsGnJ"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { CheckJqResult, EastType, JqNode } from '@elaraai/east';
|
|
2
|
+
import { StepField } from './fields.js';
|
|
3
|
+
import { Shape } from './shape.js';
|
|
4
|
+
import { Condition, Step, StepQuery } from './values.js';
|
|
5
|
+
/** A printed step's range of text. */
|
|
6
|
+
export interface StepRange {
|
|
7
|
+
/** The step's id. */
|
|
8
|
+
readonly id: string;
|
|
9
|
+
/** Its first offset. */
|
|
10
|
+
readonly from: number;
|
|
11
|
+
/** The offset after its last. */
|
|
12
|
+
readonly to: number;
|
|
13
|
+
}
|
|
14
|
+
/** A printed condition's range of text, and the ranges of its field and its value. */
|
|
15
|
+
export interface ConditionRange {
|
|
16
|
+
/** The step it is in. */
|
|
17
|
+
readonly stepId: string;
|
|
18
|
+
/** The condition's id. */
|
|
19
|
+
readonly condId: string;
|
|
20
|
+
/** Its first offset. */
|
|
21
|
+
readonly from: number;
|
|
22
|
+
/** The offset after its last. */
|
|
23
|
+
readonly to: number;
|
|
24
|
+
/** Where its field's read is, and its value's literal. */
|
|
25
|
+
readonly parts: {
|
|
26
|
+
readonly field?: readonly [number, number];
|
|
27
|
+
readonly value?: readonly [number, number];
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A step's slot: what a check's diagnostic is placed on, besides a
|
|
32
|
+
* condition. `dataset`, `key` and `fields` are a Look up's; `by` and
|
|
33
|
+
* `agg-field` (a total's field, with the total's id) a Group and total's;
|
|
34
|
+
* `pick-field` (with the field shown's id) a Show only fields'; `n` a Keep
|
|
35
|
+
* the first's; `field` the field of a Sort, a Fill, an Open each list or a
|
|
36
|
+
* Take part of a date; `value` a Fill's; `via` a List every part's; `range`
|
|
37
|
+
* and `fixed` (with the input's name) a Try the model's.
|
|
38
|
+
*/
|
|
39
|
+
export type StepSlot = "dataset" | "key" | "fields" | "by" | "agg-field" | "pick-field" | "n" | "field" | "value" | "via" | "range" | "fixed";
|
|
40
|
+
/** A printed slot's range of text. */
|
|
41
|
+
export interface SlotRange {
|
|
42
|
+
/** The step it is in. */
|
|
43
|
+
readonly stepId: string;
|
|
44
|
+
/** The slot. */
|
|
45
|
+
readonly slot: StepSlot;
|
|
46
|
+
/** The total, field shown, field brought in or input it is for. */
|
|
47
|
+
readonly id?: string;
|
|
48
|
+
/** Its first offset. */
|
|
49
|
+
readonly from: number;
|
|
50
|
+
/** The offset after its last. */
|
|
51
|
+
readonly to: number;
|
|
52
|
+
}
|
|
53
|
+
/** Steps printed as canonical jq. */
|
|
54
|
+
export interface PrintedSteps {
|
|
55
|
+
/** The program's text. */
|
|
56
|
+
readonly text: string;
|
|
57
|
+
/** The program, or `null` when a jq step's text breaks it. */
|
|
58
|
+
readonly program: JqNode | null;
|
|
59
|
+
/** Where the data source's read is. */
|
|
60
|
+
readonly source: {
|
|
61
|
+
readonly from: number;
|
|
62
|
+
readonly to: number;
|
|
63
|
+
};
|
|
64
|
+
/** Each printed step's range, in order; an unfinished step is not printed. */
|
|
65
|
+
readonly steps: readonly StepRange[];
|
|
66
|
+
/** Each printed condition's range, groups included. */
|
|
67
|
+
readonly conds: readonly ConditionRange[];
|
|
68
|
+
/** Each printed slot's range. */
|
|
69
|
+
readonly slots: readonly SlotRange[];
|
|
70
|
+
}
|
|
71
|
+
/** One step laid out: the shape it takes and gives, and whether it printed and checked. */
|
|
72
|
+
export interface LaidOutStep {
|
|
73
|
+
/** The step. */
|
|
74
|
+
readonly step: Step;
|
|
75
|
+
/** The shape of the rows it takes. */
|
|
76
|
+
readonly before: Shape;
|
|
77
|
+
/** The shape it gives: its input's when it is unfinished or does not check. */
|
|
78
|
+
readonly after: Shape;
|
|
79
|
+
/** Whether it is in the program: unfinished steps are left out. */
|
|
80
|
+
readonly printed: boolean;
|
|
81
|
+
/** Whether it checked in the program before it. */
|
|
82
|
+
readonly checked: boolean;
|
|
83
|
+
}
|
|
84
|
+
/** A segment of the program, as the counting program reads it. */
|
|
85
|
+
export interface LaidOutSegment {
|
|
86
|
+
/** The step it is part of; `undefined` for the prologue and the source. */
|
|
87
|
+
readonly stepId: string | undefined;
|
|
88
|
+
/** Its text. */
|
|
89
|
+
readonly text: string;
|
|
90
|
+
/** Whether it is the source, or a step's last segment, after which the step's shape holds. */
|
|
91
|
+
readonly last: boolean;
|
|
92
|
+
}
|
|
93
|
+
/** A query laid out: the printed program, each step's shapes, and the program's check. */
|
|
94
|
+
export interface StepLayout {
|
|
95
|
+
/** The printed program. */
|
|
96
|
+
readonly printed: PrintedSteps;
|
|
97
|
+
/** The shape the data source gives. */
|
|
98
|
+
readonly source: Shape;
|
|
99
|
+
/** Each step, in order. */
|
|
100
|
+
readonly steps: readonly LaidOutStep[];
|
|
101
|
+
/** The shape the query gives. */
|
|
102
|
+
readonly final: Shape;
|
|
103
|
+
/** The whole program's check, against the root. */
|
|
104
|
+
readonly check: CheckJqResult;
|
|
105
|
+
/** The program's segments, in order. */
|
|
106
|
+
readonly segments: readonly LaidOutSegment[];
|
|
107
|
+
}
|
|
108
|
+
/** What separates two segments of the pipeline layout. */
|
|
109
|
+
export declare const SEP = "\n| ";
|
|
110
|
+
/**
|
|
111
|
+
* The fields jq reads a step's field through, in a shape.
|
|
112
|
+
*
|
|
113
|
+
* @param shape - the shape
|
|
114
|
+
* @param ref - how the step names the field
|
|
115
|
+
* @param whole - read a variant as its whole value, not its case
|
|
116
|
+
* @returns the fields read
|
|
117
|
+
*/
|
|
118
|
+
export declare function pathFor(shape: Shape, ref: string, whole?: boolean): readonly string[];
|
|
119
|
+
/**
|
|
120
|
+
* The shape of each item of a list field, for the conditions inside has any
|
|
121
|
+
* where.
|
|
122
|
+
*
|
|
123
|
+
* @param field - the list field
|
|
124
|
+
* @returns the items as rows of their record, or {@link UNKNOWN}
|
|
125
|
+
*/
|
|
126
|
+
export declare function itemShape(field: StepField | undefined): Shape;
|
|
127
|
+
/**
|
|
128
|
+
* Whether a condition of an all filter narrows the rows to a case, and so
|
|
129
|
+
* prints in a `select` of its own before the rest: a variant field is one of
|
|
130
|
+
* its cases.
|
|
131
|
+
*
|
|
132
|
+
* @param condition - a top-level condition of the filter
|
|
133
|
+
* @param shape - the rows it tests
|
|
134
|
+
* @returns the variant field and the case, or `undefined`
|
|
135
|
+
*/
|
|
136
|
+
export declare function narrowingOf(condition: Condition, shape: Shape): {
|
|
137
|
+
field: string;
|
|
138
|
+
case: string | undefined;
|
|
139
|
+
} | undefined;
|
|
140
|
+
/** The name a step gives a field made from another: the field's own, or the step's name for it. */
|
|
141
|
+
export declare function nameFor(shape: Shape, ref: string): string;
|
|
142
|
+
/** The scalar fields of a tree's node, which List every part keeps. */
|
|
143
|
+
export declare function scalarFieldsOf(record: EastType): string[];
|
|
144
|
+
/** The name of a variable a step binds, from a name it would like: the name, or `value` when jq cannot read it as one. */
|
|
145
|
+
export declare function variableName(name: string): string;
|
|
146
|
+
/**
|
|
147
|
+
* Whether a finished step can be printed: a Look up's dataset must be one jq
|
|
148
|
+
* can bind as a variable.
|
|
149
|
+
*
|
|
150
|
+
* @param step - the step
|
|
151
|
+
* @returns whether it prints
|
|
152
|
+
*/
|
|
153
|
+
export declare function printable(step: Step): boolean;
|
|
154
|
+
/**
|
|
155
|
+
* What the steps know of the shape a step gives, besides its type: the cases
|
|
156
|
+
* its rows are narrowed to, a Keep the first bound, and what a row is called.
|
|
157
|
+
*
|
|
158
|
+
* @param step - the step
|
|
159
|
+
* @param before - the shape it takes
|
|
160
|
+
* @returns the narrowed fields, the bound and the noun
|
|
161
|
+
*/
|
|
162
|
+
export declare function knownAfter(step: Step, before: Shape): {
|
|
163
|
+
narrowed: ReadonlyMap<string, string>;
|
|
164
|
+
limit: number | undefined;
|
|
165
|
+
noun: string;
|
|
166
|
+
};
|
|
167
|
+
/** The shape a stage of a checked prefix gives, found by where the segment starts. */
|
|
168
|
+
export declare function stageAt(check: CheckJqResult, from: number): {
|
|
169
|
+
type: EastType;
|
|
170
|
+
multiplicity: CheckJqResult["stages"][number]["multiplicity"];
|
|
171
|
+
} | undefined;
|
|
172
|
+
/**
|
|
173
|
+
* Lays a query out: prints each finished step for the shape before it,
|
|
174
|
+
* checking each prefix against the root, and checks the whole program.
|
|
175
|
+
*
|
|
176
|
+
* @param query - the query
|
|
177
|
+
* @param root - the root's type: a struct of the data sources
|
|
178
|
+
* @returns the printed program, each step's shapes, and the program's check
|
|
179
|
+
*/
|
|
180
|
+
export declare function layOutSteps(query: StepQuery, root: EastType): StepLayout;
|
|
181
|
+
/**
|
|
182
|
+
* Prints a query's steps as canonical jq (`Query Editor Spec.md` §4.7), with
|
|
183
|
+
* the span of every step and condition.
|
|
184
|
+
*
|
|
185
|
+
* @param query - the query
|
|
186
|
+
* @param root - the root's type: a struct of the data sources
|
|
187
|
+
* @returns the program's text, the program, and the ranges
|
|
188
|
+
*
|
|
189
|
+
* @remarks
|
|
190
|
+
* The program starts with `.ds as $ds` for each dataset a finished Look up
|
|
191
|
+
* reads, then the data source; each finished step follows on its own line.
|
|
192
|
+
* Unfinished steps are left out. A jq step's text is printed as written.
|
|
193
|
+
*/
|
|
194
|
+
export declare function printSteps(query: StepQuery, root: EastType): PrintedSteps;
|
|
195
|
+
//# sourceMappingURL=print.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"print.d.ts","sourceRoot":"","sources":["../../../src/query/steps/print.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAA6B,KAAK,aAAa,EAAE,KAAK,QAAQ,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AAC1G,OAAO,EAA2D,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAMtG,OAAO,EAA+C,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AACrF,OAAO,EAC8B,KAAK,SAAS,EAAkB,KAAK,IAAI,EAAe,KAAK,SAAS,EAC1G,MAAM,aAAa,CAAC;AAErB,sCAAsC;AACtC,MAAM,WAAW,SAAS;IACtB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,wBAAwB;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACvB;AAED,sFAAsF;AACtF,MAAM,WAAW,cAAc;IAC3B,yBAAyB;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,0BAA0B;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,wBAAwB;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,0DAA0D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AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,GAAG,YAAY,CAEzE"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { EastType, JqMultiplicity } from '@elaraai/east';
|
|
2
|
+
/**
|
|
3
|
+
* What a stage gives: `rows` — an array (or set) of records, which the
|
|
4
|
+
* steps that keep, reshape and total rows take; `one` — any other value, or a
|
|
5
|
+
* stream; `unknown` — the checker could not tell, after a problem.
|
|
6
|
+
*/
|
|
7
|
+
export type ShapeKind = "rows" | "one" | "unknown";
|
|
8
|
+
/** The shape of a query at a step. */
|
|
9
|
+
export interface Shape {
|
|
10
|
+
/** What it gives. */
|
|
11
|
+
readonly kind: ShapeKind;
|
|
12
|
+
/** The stage's type, as the checker gives it; `Never` when unknown. */
|
|
13
|
+
readonly type: EastType;
|
|
14
|
+
/** For rows, the record each row is. */
|
|
15
|
+
readonly row: EastType | undefined;
|
|
16
|
+
/** How many outputs the program has given here, as the checker counts them. */
|
|
17
|
+
readonly multiplicity: JqMultiplicity | null;
|
|
18
|
+
/**
|
|
19
|
+
* For rows, each variant field a Keep rows where step narrowed to one
|
|
20
|
+
* case, with the case: its payload's fields are exact, not missing.
|
|
21
|
+
*/
|
|
22
|
+
readonly narrowed: ReadonlyMap<string, string>;
|
|
23
|
+
/** For rows, the most a Keep the first step lets through. */
|
|
24
|
+
readonly limit: number | undefined;
|
|
25
|
+
/** What one row, or the value, is called: "order", "line", "part". */
|
|
26
|
+
readonly noun: string;
|
|
27
|
+
}
|
|
28
|
+
/** The shape after a problem the checker stopped at. */
|
|
29
|
+
export declare const UNKNOWN: Shape;
|
|
30
|
+
/**
|
|
31
|
+
* A type read through its recursive wrapper: what a value of it is made of.
|
|
32
|
+
*
|
|
33
|
+
* @param type - a type
|
|
34
|
+
* @returns its node, for a recursive type; itself otherwise
|
|
35
|
+
*/
|
|
36
|
+
export declare function unwrapRecursive(type: EastType): EastType;
|
|
37
|
+
/**
|
|
38
|
+
* The payload of an option type.
|
|
39
|
+
*
|
|
40
|
+
* @param type - a type
|
|
41
|
+
* @returns `T` when the type is `Option<T>`, decided by East's type equality;
|
|
42
|
+
* `undefined` otherwise
|
|
43
|
+
*/
|
|
44
|
+
export declare function optionPayload(type: EastType): EastType | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* A type read through its option and recursive wrappers.
|
|
47
|
+
*
|
|
48
|
+
* @param type - a type
|
|
49
|
+
* @returns what a present value of it is made of
|
|
50
|
+
*/
|
|
51
|
+
export declare function baseType(type: EastType): EastType;
|
|
52
|
+
/**
|
|
53
|
+
* The type a read gives where the value can be missing: `Option<T>`, or `T`
|
|
54
|
+
* itself when it is already an option or `Null`.
|
|
55
|
+
*
|
|
56
|
+
* @param type - the value's type
|
|
57
|
+
* @returns the type of a read that can miss it
|
|
58
|
+
*/
|
|
59
|
+
export declare function orMissing(type: EastType): EastType;
|
|
60
|
+
/**
|
|
61
|
+
* The record of each row, when a type is rows: an array or a set of structs.
|
|
62
|
+
*
|
|
63
|
+
* @param type - a stage's type
|
|
64
|
+
* @returns the struct, or `undefined` when the type is not rows
|
|
65
|
+
*/
|
|
66
|
+
export declare function rowOf(type: EastType): EastType | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* The shape of a stage.
|
|
69
|
+
*
|
|
70
|
+
* @param type - the stage's type
|
|
71
|
+
* @param multiplicity - how many outputs the program has given there
|
|
72
|
+
* @param known - what the steps know besides: the narrowed variant fields,
|
|
73
|
+
* a Keep the first bound, and the noun
|
|
74
|
+
* @returns the shape: rows when one value is an array or set of structs
|
|
75
|
+
*/
|
|
76
|
+
export declare function shapeOf(type: EastType, multiplicity: JqMultiplicity | null, known: {
|
|
77
|
+
narrowed?: ReadonlyMap<string, string>;
|
|
78
|
+
limit?: number | undefined;
|
|
79
|
+
noun: string;
|
|
80
|
+
}): Shape;
|
|
81
|
+
/**
|
|
82
|
+
* The singular of a plural name, as English mostly forms it: `orders` →
|
|
83
|
+
* `order`, `categories` → `category`, `statuses` → `status`; a name that is
|
|
84
|
+
* not plural is itself.
|
|
85
|
+
*
|
|
86
|
+
* @param word - the name
|
|
87
|
+
* @returns its singular
|
|
88
|
+
*/
|
|
89
|
+
export declare function singular(word: string): string;
|
|
90
|
+
//# sourceMappingURL=shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shape.d.ts","sourceRoot":"","sources":["../../../src/query/steps/shape.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,OAAO,EAAsC,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAEvG;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC;AAEnD,sCAAsC;AACtC,MAAM,WAAW,KAAK;IAClB,qBAAqB;IACrB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,wCAAwC;IACxC,QAAQ,CAAC,GAAG,EAAE,QAAQ,GAAG,SAAS,CAAC;IACnC,+EAA+E;IAC/E,QAAQ,CAAC,YAAY,EAAE,cAAc,GAAG,IAAI,CAAC;IAC7C;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/C,6DAA6D;IAC7D,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACzB;AAID,wDAAwD;AACxD,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAIxD;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAKlE;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAGjD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAIlD;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAM1D;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CACnB,IAAI,EAAE,QAAQ,EACd,YAAY,EAAE,cAAc,GAAG,IAAI,EACnC,KAAK,EAAE;IAAE,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC5F,KAAK,CAWP;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK7C"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { ValueTypeOf } from '@elaraai/east';
|
|
2
|
+
import { QueryAggregateType, QueryComparisonType, QueryConditionType, QueryMatchType, QueryPickFieldType, QueryStepInputType, QueryStepType, QueryStepValueType, QueryStepsType } from '@elaraai/e3-ui/internal';
|
|
3
|
+
/** A query as steps: its data source and its steps. */
|
|
4
|
+
export type StepQuery = ValueTypeOf<typeof QueryStepsType>;
|
|
5
|
+
/** One step of a query. */
|
|
6
|
+
export type Step = ValueTypeOf<typeof QueryStepType>;
|
|
7
|
+
/** A step's kind: `filter`, `lookup`, … */
|
|
8
|
+
export type StepKind = Step["type"];
|
|
9
|
+
/** One step of a kind. */
|
|
10
|
+
export type StepOf<K extends StepKind> = Extract<Step, {
|
|
11
|
+
type: K;
|
|
12
|
+
}>;
|
|
13
|
+
/** A condition of a Keep rows where step. */
|
|
14
|
+
export type Condition = ValueTypeOf<typeof QueryConditionType>;
|
|
15
|
+
/** A test of one field. */
|
|
16
|
+
export type TestCondition = Extract<Condition, {
|
|
17
|
+
type: "test";
|
|
18
|
+
}>;
|
|
19
|
+
/** A group of conditions. */
|
|
20
|
+
export type GroupCondition = Extract<Condition, {
|
|
21
|
+
type: "group";
|
|
22
|
+
}>;
|
|
23
|
+
/** How a condition compares a field. */
|
|
24
|
+
export type Comparison = ValueTypeOf<typeof QueryComparisonType>;
|
|
25
|
+
/** A comparison's kind: `eq`, `inYear`, … */
|
|
26
|
+
export type ComparisonKind = Comparison["type"];
|
|
27
|
+
/** How conditions combine. */
|
|
28
|
+
export type Match = ValueTypeOf<typeof QueryMatchType>;
|
|
29
|
+
/** One total of a Group and total step. */
|
|
30
|
+
export type Aggregate = ValueTypeOf<typeof QueryAggregateType>;
|
|
31
|
+
/** One field a Show only fields step shows. */
|
|
32
|
+
export type PickField = ValueTypeOf<typeof QueryPickFieldType>;
|
|
33
|
+
/** A value a step compares with or fills in. */
|
|
34
|
+
export type StepValue = ValueTypeOf<typeof QueryStepValueType>;
|
|
35
|
+
/** A count or a bound a step takes. */
|
|
36
|
+
export type StepInput = ValueTypeOf<typeof QueryStepInputType>;
|
|
37
|
+
/** What an id names: a step, a condition, a total or a field shown. */
|
|
38
|
+
export type IdKind = "step" | "condition" | "aggregate" | "pick";
|
|
39
|
+
/**
|
|
40
|
+
* A fresh id, unique for the life of the page: each call gives a new one, so
|
|
41
|
+
* an id is never reused, even by a query parsed again.
|
|
42
|
+
*
|
|
43
|
+
* @param kind - what it names
|
|
44
|
+
* @returns the id
|
|
45
|
+
*/
|
|
46
|
+
export declare function freshId(kind: IdKind): string;
|
|
47
|
+
/**
|
|
48
|
+
* A comparison of a kind.
|
|
49
|
+
*
|
|
50
|
+
* @param kind - the comparison
|
|
51
|
+
* @returns its value
|
|
52
|
+
*/
|
|
53
|
+
export declare function comparison(kind: ComparisonKind): Comparison;
|
|
54
|
+
/**
|
|
55
|
+
* Whether a value is filled in: any value but empty text.
|
|
56
|
+
*
|
|
57
|
+
* @param value - the value
|
|
58
|
+
* @returns whether it counts as given
|
|
59
|
+
*/
|
|
60
|
+
export declare function isGiven(value: StepValue): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Whether a comparison takes a value: every one but missing, present, yes,
|
|
63
|
+
* no, and any where, which takes an inner condition instead.
|
|
64
|
+
*
|
|
65
|
+
* @param kind - the comparison
|
|
66
|
+
* @returns whether it needs a value
|
|
67
|
+
*/
|
|
68
|
+
export declare function needsValue(kind: ComparisonKind): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Whether a condition is finished: a test with its field, its comparison and
|
|
71
|
+
* the value or inner condition it needs; a group with a finished condition.
|
|
72
|
+
*
|
|
73
|
+
* @param condition - the condition
|
|
74
|
+
* @returns whether it is printed
|
|
75
|
+
*/
|
|
76
|
+
export declare function isConditionComplete(condition: Condition): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Whether a step is finished: every slot it needs is filled. An unfinished
|
|
79
|
+
* step is left out of the program until it is.
|
|
80
|
+
*
|
|
81
|
+
* @param step - the step
|
|
82
|
+
* @returns whether it is printed
|
|
83
|
+
*/
|
|
84
|
+
export declare function isComplete(step: Step): boolean;
|
|
85
|
+
//# sourceMappingURL=values.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../../../src/query/steps/values.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EAAW,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EACR,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,cAAc,EACjB,MAAM,yBAAyB,CAAC;AAEjC,uDAAuD;AACvD,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC,OAAO,cAAc,CAAC,CAAC;AAC3D,2BAA2B;AAC3B,MAA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G,WAAW,GAAG,WAAW,GAAG,MAAM,CAAC;AAMjE;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG5C;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,UAAU,CAE3D;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAEjD;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAExD;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAOjE;AAaD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAkC9C"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ToolbarItem } from '@elaraai/east-ui-components';
|
|
3
|
+
import { QueryWords } from './model/words.js';
|
|
4
|
+
import { Styles } from './parts.js';
|
|
5
|
+
/** A view of the query: its steps, or its jq. */
|
|
6
|
+
export type QueryView = "visual" | "jq";
|
|
7
|
+
/** How long Copy jq shows its check. */
|
|
8
|
+
export declare const COPIED_MS = 1600;
|
|
9
|
+
/** What the builder's toolbar holds. */
|
|
10
|
+
export interface QueryToolbarOptions {
|
|
11
|
+
/** The history item (#935). */
|
|
12
|
+
readonly history: ToolbarItem;
|
|
13
|
+
/** The text Copy jq copies: the program, or the jq as typed in the jq view. */
|
|
14
|
+
readonly copyText: () => string;
|
|
15
|
+
/** The save popover, its trigger the toolbar's Save…. */
|
|
16
|
+
readonly save: ReactNode;
|
|
17
|
+
/** Whether the save popover is open: its item keeps its form. */
|
|
18
|
+
readonly saving: boolean;
|
|
19
|
+
/** Whether a run goes. */
|
|
20
|
+
readonly running: boolean;
|
|
21
|
+
/** Runs the query. */
|
|
22
|
+
readonly onRun: () => void;
|
|
23
|
+
/** The words. */
|
|
24
|
+
readonly words: QueryWords;
|
|
25
|
+
/** The `queryBuilder` recipe's styles. */
|
|
26
|
+
readonly styles: Styles;
|
|
27
|
+
}
|
|
28
|
+
/** What the Query tab's band holds: Visual · jq. */
|
|
29
|
+
export interface ViewItemOptions {
|
|
30
|
+
/** The view shown. */
|
|
31
|
+
readonly view: QueryView;
|
|
32
|
+
/** Shows a view. */
|
|
33
|
+
readonly onView: (view: QueryView) => void;
|
|
34
|
+
/** The words. */
|
|
35
|
+
readonly words: QueryWords;
|
|
36
|
+
/** The `queryBuilder` recipe's styles. */
|
|
37
|
+
readonly styles: Styles;
|
|
38
|
+
/** The `seg` recipe's styles. */
|
|
39
|
+
readonly seg: Styles;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Visual · jq, an item of the Query tab's band (`Query Editor Spec.md` §4.2):
|
|
43
|
+
* the `seg` strip, folding to its icons.
|
|
44
|
+
*
|
|
45
|
+
* @param options - The view, what picking one does, the words and the styles ({@link ViewItemOptions})
|
|
46
|
+
* @returns The item
|
|
47
|
+
*/
|
|
48
|
+
export declare function viewToolbarItem(options: ViewItemOptions): ToolbarItem;
|
|
49
|
+
/**
|
|
50
|
+
* The builder's toolbar items — see the module docs.
|
|
51
|
+
*
|
|
52
|
+
* @param options - The history item, the result's controls, the save popover, the run, and the words ({@link QueryToolbarOptions})
|
|
53
|
+
* @returns The items, in their order along the row
|
|
54
|
+
*/
|
|
55
|
+
export declare function queryToolbarItems(options: QueryToolbarOptions): ToolbarItem[];
|
|
56
|
+
//# sourceMappingURL=toolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../src/query/toolbar.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIpE,OAAO,KAAK,EAAE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GAAG,WAAW,CAmBrE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,mBAAmB,GAAG,WAAW,EAAE,CAmB7E"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { CheckJqResult } from '@elaraai/east';
|
|
2
|
+
import { Origin } from '@elaraai/east-ui-components';
|
|
3
|
+
import { Card, SourceCard } from './model/cards.js';
|
|
4
|
+
import { SlotRef } from './model/refs.js';
|
|
5
|
+
import { SavedOffer, SlotItem, StepOption } from './model/slots.js';
|
|
6
|
+
import { SummaryCache } from './model/summaries.js';
|
|
7
|
+
import { QueryWords } from './model/words.js';
|
|
8
|
+
import { QueryRoot } from './one-shot.js';
|
|
9
|
+
import { QueryEntry, QueryHeader } from './session.js';
|
|
10
|
+
import { CardActions } from './step-card.js';
|
|
11
|
+
import { QueryCheckLine, QueryGivesLine } from './status-line.js';
|
|
12
|
+
import { CheckedSteps } from './steps/check.js';
|
|
13
|
+
import { StepKind, StepQuery } from './steps/values.js';
|
|
14
|
+
import { QueryView } from './toolbar.js';
|
|
15
|
+
/** A notice at the top of the Query tab: what just happened. */
|
|
16
|
+
export interface QueryNotice {
|
|
17
|
+
/** Its identity among the notices. */
|
|
18
|
+
readonly id: number;
|
|
19
|
+
/** What it says. */
|
|
20
|
+
readonly text: string;
|
|
21
|
+
}
|
|
22
|
+
/** A slot's autocomplete, open. */
|
|
23
|
+
export interface OpenSlot {
|
|
24
|
+
/** The slot. */
|
|
25
|
+
readonly ref: SlotRef;
|
|
26
|
+
/** Its key. */
|
|
27
|
+
readonly key: string;
|
|
28
|
+
/** The element it hangs from. */
|
|
29
|
+
readonly anchor: HTMLElement;
|
|
30
|
+
}
|
|
31
|
+
/** What the autocomplete of the open slot shows, and what it is told. */
|
|
32
|
+
export interface SlotPopover {
|
|
33
|
+
/** The slot. */
|
|
34
|
+
readonly slot: OpenSlot;
|
|
35
|
+
/** Changes when the offers' source does — a summary arriving — so the list opens afresh on its current value. */
|
|
36
|
+
readonly generation: string;
|
|
37
|
+
/** Its label, filter placeholder, footer, empty words and keys. */
|
|
38
|
+
readonly label: string;
|
|
39
|
+
readonly placeholder: string;
|
|
40
|
+
readonly hint: string;
|
|
41
|
+
readonly empty: string;
|
|
42
|
+
readonly keys: string;
|
|
43
|
+
/** The offers for the text typed. */
|
|
44
|
+
readonly items: readonly SlotItem[];
|
|
45
|
+
/** The text typed. */
|
|
46
|
+
readonly text: string;
|
|
47
|
+
/** The offer active as it opens. */
|
|
48
|
+
readonly initialActive: number;
|
|
49
|
+
/** Told each change of the text. */
|
|
50
|
+
readonly onText: (text: string) => void;
|
|
51
|
+
/** Told the offer picked. */
|
|
52
|
+
readonly onPick: (item: SlotItem) => void;
|
|
53
|
+
/** Told it closes. */
|
|
54
|
+
readonly onClose: () => void;
|
|
55
|
+
}
|
|
56
|
+
/** What editing the open query needs. */
|
|
57
|
+
export interface QueryEditorOptions {
|
|
58
|
+
/** The query's entries as its drafts stand. */
|
|
59
|
+
readonly entries: readonly QueryEntry[];
|
|
60
|
+
/** The query's entries as the drafts stand this moment — after a gesture in the same event, too. */
|
|
61
|
+
readonly current: () => readonly QueryEntry[] | undefined;
|
|
62
|
+
/** Records a gesture: the entries it leaves, as one transaction. */
|
|
63
|
+
readonly gesture: (next: readonly QueryEntry[], origin: Origin, label: string) => boolean;
|
|
64
|
+
/** Moves with every change of the session. */
|
|
65
|
+
readonly version: number;
|
|
66
|
+
/** The root. */
|
|
67
|
+
readonly root: QueryRoot;
|
|
68
|
+
/** The words. */
|
|
69
|
+
readonly words: QueryWords;
|
|
70
|
+
/** The builder's summaries, and the latest hash of each data source a run has read. */
|
|
71
|
+
readonly summaries: {
|
|
72
|
+
readonly cache: SummaryCache;
|
|
73
|
+
readonly hashes: ReadonlyMap<string, string>;
|
|
74
|
+
};
|
|
75
|
+
/** The saved queries the add-step list of a query with no steps offers. */
|
|
76
|
+
readonly saved: readonly SavedOffer[];
|
|
77
|
+
/** Opens a saved query picked from the add-step list. */
|
|
78
|
+
readonly onOpenSaved: (name: string) => void;
|
|
79
|
+
/** Shows the Query tab, the pane expanded: Visual · jq picked. */
|
|
80
|
+
readonly onShowQuery: () => void;
|
|
81
|
+
/** The builder's element: the autocomplete hangs inside it, and the slots are found in it. */
|
|
82
|
+
readonly bounds: () => HTMLElement | null;
|
|
83
|
+
/** Its session's source id: another query opened starts afresh. */
|
|
84
|
+
readonly sourceId: string;
|
|
85
|
+
/** The rows a fresh run of the steps counted at each stage, by step id (#938): the shape lines count them. */
|
|
86
|
+
readonly counts?: ReadonlyMap<string, number> | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* The notice a query arrives with when it opens (#939) — "Opened “Big
|
|
89
|
+
* orders” from the library.", "Started a new query on customers." — by its
|
|
90
|
+
* session's source id: shown when that query opens, in place of the last
|
|
91
|
+
* query's notices.
|
|
92
|
+
*/
|
|
93
|
+
readonly arrival?: {
|
|
94
|
+
readonly sourceId: string;
|
|
95
|
+
readonly text: string;
|
|
96
|
+
} | undefined;
|
|
97
|
+
}
|
|
98
|
+
/** Editing the open query: what the surfaces draw, and what they do. */
|
|
99
|
+
export interface QueryEditor {
|
|
100
|
+
/** The header. */
|
|
101
|
+
readonly header: QueryHeader;
|
|
102
|
+
/** The steps, as a query on the header's data source. */
|
|
103
|
+
readonly query: StepQuery;
|
|
104
|
+
/** The steps' check; `undefined` while the program is jq. */
|
|
105
|
+
readonly checked: CheckedSteps | undefined;
|
|
106
|
+
/** The source's card, and each step's; empty while the program is jq. */
|
|
107
|
+
readonly source: SourceCard | undefined;
|
|
108
|
+
readonly cards: readonly Card[];
|
|
109
|
+
/** The Quick add buttons at the end of the query. */
|
|
110
|
+
readonly quick: readonly StepOption[];
|
|
111
|
+
/** The view shown. */
|
|
112
|
+
readonly view: QueryView;
|
|
113
|
+
/** Shows a view: to jq prints the program; back to visual parses it. */
|
|
114
|
+
readonly setView: (view: QueryView) => void;
|
|
115
|
+
/** The jq as typed, in the jq view. */
|
|
116
|
+
readonly jqText: string;
|
|
117
|
+
/** Told each change of the jq typed. */
|
|
118
|
+
readonly onJqText: (text: string) => void;
|
|
119
|
+
/** The jq typed in and left: one gesture. */
|
|
120
|
+
readonly leaveJq: () => void;
|
|
121
|
+
/** A fix taken in the jq view: the jq typed so far left, then the text the fix makes, a gesture of its own, under its label. */
|
|
122
|
+
readonly onJqFix: (text: string, label: string) => void;
|
|
123
|
+
/** The jq view's check of the jq as typed; `undefined` in the visual view. */
|
|
124
|
+
readonly jqChecked: CheckJqResult | undefined;
|
|
125
|
+
/** The jq view's note: unfinished steps left out, or the jq kept for its syntax. */
|
|
126
|
+
readonly jqNote: string | undefined;
|
|
127
|
+
/** The root, which the jq view completes and reads steps over. */
|
|
128
|
+
readonly root: QueryRoot;
|
|
129
|
+
/** The builder's summaries, whose values the jq view's completions offer. */
|
|
130
|
+
readonly summaries: QueryEditorOptions["summaries"];
|
|
131
|
+
/** The program as it stands: what Run runs and Copy jq copies — in the jq view, the jq as typed. */
|
|
132
|
+
readonly program: string;
|
|
133
|
+
/** The status line's check, and the shape the query gives. */
|
|
134
|
+
readonly check: QueryCheckLine;
|
|
135
|
+
readonly gives: QueryGivesLine | undefined;
|
|
136
|
+
/** The notices, newest last; a notice dismissed. */
|
|
137
|
+
readonly notices: readonly QueryNotice[];
|
|
138
|
+
readonly dismiss: (id: number) => void;
|
|
139
|
+
/** The parts' and the cards' asks. */
|
|
140
|
+
readonly actions: CardActions;
|
|
141
|
+
/** A Quick add button pressed. */
|
|
142
|
+
readonly onQuick: (kind: StepKind) => void;
|
|
143
|
+
/** The open slot's autocomplete. */
|
|
144
|
+
readonly popover: SlotPopover | undefined;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Editing the open query — see the module docs.
|
|
148
|
+
*
|
|
149
|
+
* @param options - The session's entries and gesture, the root, the words and the builder's element
|
|
150
|
+
* @returns What the surfaces draw, and what they do
|
|
151
|
+
*/
|
|
152
|
+
export declare function useQueryEditor(options: QueryEditorOptions): QueryEditor;
|
|
153
|
+
//# sourceMappingURL=use-query-editor.d.ts.map
|