@holistics/anfra-sdk 0.23.1 → 0.24.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.d.ts +3 -3
- package/dist/app.js +2 -2
- package/dist/{bootstrap-DULxuxqY.d.ts → bootstrap-OCA3RI1u.d.ts} +271 -234
- package/dist/build.d.ts +1 -1
- package/dist/{chunk-Y7M6IWC4.js → chunk-4BSARXRZ.js} +1 -1
- package/dist/{chunk-7I2HXY72.js → chunk-5JDJD4EF.js} +1 -1
- package/dist/{chunk-CLXZMA5D.js → chunk-HA3ZB3LG.js} +1 -1
- package/dist/{chunk-FIDWUQAN.js → chunk-KXILIAGR.js} +66 -1
- package/dist/{chunk-3HX7IZ7E.js → chunk-OQ52YGQV.js} +1 -1
- package/dist/{chunk-2TTGSNHA.js → chunk-TPWCVL24.js} +5 -11
- package/dist/{chunk-D7DIJRAC.js → chunk-V6PRS5HV.js} +1 -1
- package/dist/{chunk-UWRQXPPG.js → chunk-XREEBDSR.js} +6 -12
- package/dist/common.d.ts +1 -1
- package/dist/{data-SZDYO55C.js → data-G6DCTXTJ.js} +24 -11
- package/dist/{declaration-GYV6OUR3.js → declaration-KB7ZHFDG.js} +7 -5
- package/dist/host.d.ts +17 -4
- package/dist/host.js +112 -9
- package/dist/{overview-F7YL3ONV.js → overview-PHXDQW3C.js} +9 -8
- package/dist/{plugin-CG0mVS1X.d.ts → plugin-CZmRhV4r.d.ts} +36 -8
- package/dist/plugins.d.ts +1 -1
- package/dist/plugins.js +20 -12
- package/dist/{queries-BWKWZQMG.js → queries-77M6ZM74.js} +20 -13
- package/dist/{structure-JO4YZHKZ.js → structure-RX5MANTK.js} +5 -4
- package/dist/{tab-QPHE7YUQ.js → tab-B7ZRE5WY.js} +3 -3
- package/dist/testing.js +2 -2
- package/dist/{theme-C9Tuzqu7.d.ts → theme-CWkVSteW.d.ts} +69 -69
- package/package.json +1 -1
- package/dist/{chunk-33HI2ODM.js → chunk-KSE7HX53.js} +8 -8
|
@@ -1,72 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* What a menu on a Data App's content is about: a marked node of the page (a right-click on a
|
|
5
|
-
* block), or some of a query's result rows (a right-click on a chart's point, which the definition
|
|
6
|
-
* reports with `query.menu`). Built in the frame, and checked by the host, which trusts nothing the
|
|
7
|
-
* frame sends.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/** A box in the frame's viewport. */
|
|
11
|
-
interface TargetRect {
|
|
12
|
-
x: number;
|
|
13
|
-
y: number;
|
|
14
|
-
width: number;
|
|
15
|
-
height: number;
|
|
16
|
-
}
|
|
17
|
-
/** A point in the frame's viewport. */
|
|
18
|
-
interface TargetPoint {
|
|
19
|
-
x: number;
|
|
20
|
-
y: number;
|
|
21
|
-
}
|
|
22
|
-
/** A marked node, as the structure has it, its ancestors outermost first (both without children's children), and where it is. */
|
|
23
|
-
interface NodeTarget {
|
|
24
|
-
kind: 'node';
|
|
25
|
-
node: StructureNode;
|
|
26
|
-
ancestors: StructureNode[];
|
|
27
|
-
rect: TargetRect;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Rows of a query's result: the query, by its app's index and name; the rows as the definition
|
|
31
|
-
* passed them; the dimensions that took part; the measure the point belongs to, when the
|
|
32
|
-
* definition said; and the conditions they make, derived as a cross-filter's are (an AQL
|
|
33
|
-
* `expression` when per-field conditions would admit more rows). With the node the rows are drawn
|
|
34
|
-
* in, when the event was inside one.
|
|
35
|
-
*/
|
|
36
|
-
interface RowsTarget {
|
|
37
|
-
kind: 'rows';
|
|
38
|
-
app: number;
|
|
39
|
-
query: string;
|
|
40
|
-
rows: Row[];
|
|
41
|
-
fields: string[];
|
|
42
|
-
/** The result column of the measure the point shows: a chart's series. */
|
|
43
|
-
measure?: string;
|
|
44
|
-
conditions: SelectionCondition[];
|
|
45
|
-
expression?: string;
|
|
46
|
-
node?: NodeTarget;
|
|
47
|
-
/**
|
|
48
|
-
* Where the gesture that opened it was, a point in the frame's viewport: the right-click's for
|
|
49
|
-
* `query.menu`, the badge's when an item runs from the annotations badge's popover. A plugin
|
|
50
|
-
* anchors a popover about the rows there.
|
|
51
|
-
*/
|
|
52
|
-
at?: TargetPoint;
|
|
53
|
-
/**
|
|
54
|
-
* The annotations plugins set on these rows, for the frame's items only (a plugin's `when` on
|
|
55
|
-
* them, say): the host never gets them.
|
|
56
|
-
*/
|
|
57
|
-
annotations?: Annotation[];
|
|
58
|
-
}
|
|
59
|
-
type MenuTarget = NodeTarget | RowsTarget;
|
|
60
|
-
type MenuTargetKind = MenuTarget['kind'];
|
|
61
|
-
/** One entry of a menu, as the host answers it for a target. */
|
|
62
|
-
interface MenuEntry {
|
|
63
|
-
id: string;
|
|
64
|
-
label: string;
|
|
65
|
-
/** Why it can't run: shown, and the entry can't be picked. */
|
|
66
|
-
disabled?: string;
|
|
67
|
-
}
|
|
68
|
-
/** A target as the frame sends it, or undefined when it isn't one: of its shape only, never trusted further. */
|
|
69
|
-
declare function checkTarget(value: unknown): MenuTarget | undefined;
|
|
1
|
+
import { ai as QueryStamp, D as DatasetDescriptor, aC as User, aq as Row, av as SelectionCondition, aA as StructureNode, a as Annotation } from './types-BiRAlSSk.js';
|
|
70
2
|
|
|
71
3
|
/**
|
|
72
4
|
* The bridge: the postMessage protocol between a Data App's frame (`app`'s bootstrap) and the
|
|
@@ -153,6 +85,74 @@ type HostMessage = Exclude<BridgeMessage, {
|
|
|
153
85
|
type: 'anfra:ready';
|
|
154
86
|
}>;
|
|
155
87
|
|
|
88
|
+
/**
|
|
89
|
+
* What a menu on a Data App's content is about: a marked node of the page (a right-click on a
|
|
90
|
+
* block), or some of a query's result rows (a right-click on a chart's point, which the definition
|
|
91
|
+
* reports with `query.menu`). Built in the frame, and checked by the host, which trusts nothing the
|
|
92
|
+
* frame sends.
|
|
93
|
+
*/
|
|
94
|
+
|
|
95
|
+
/** A box in the frame's viewport. */
|
|
96
|
+
interface TargetRect {
|
|
97
|
+
x: number;
|
|
98
|
+
y: number;
|
|
99
|
+
width: number;
|
|
100
|
+
height: number;
|
|
101
|
+
}
|
|
102
|
+
/** A point in the frame's viewport. */
|
|
103
|
+
interface TargetPoint {
|
|
104
|
+
x: number;
|
|
105
|
+
y: number;
|
|
106
|
+
}
|
|
107
|
+
/** A marked node, as the structure has it, its ancestors outermost first (both without children's children), and where it is. */
|
|
108
|
+
interface NodeTarget {
|
|
109
|
+
kind: 'node';
|
|
110
|
+
node: StructureNode;
|
|
111
|
+
ancestors: StructureNode[];
|
|
112
|
+
rect: TargetRect;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Rows of a query's result: the query, by its app's index and name; the rows as the definition
|
|
116
|
+
* passed them; the dimensions that took part; the measure the point belongs to, when the
|
|
117
|
+
* definition said; and the conditions they make, derived as a cross-filter's are (an AQL
|
|
118
|
+
* `expression` when per-field conditions would admit more rows). With the node the rows are drawn
|
|
119
|
+
* in, when the event was inside one.
|
|
120
|
+
*/
|
|
121
|
+
interface RowsTarget {
|
|
122
|
+
kind: 'rows';
|
|
123
|
+
app: number;
|
|
124
|
+
query: string;
|
|
125
|
+
rows: Row[];
|
|
126
|
+
fields: string[];
|
|
127
|
+
/** The result column of the measure the point shows: a chart's series. */
|
|
128
|
+
measure?: string;
|
|
129
|
+
conditions: SelectionCondition[];
|
|
130
|
+
expression?: string;
|
|
131
|
+
node?: NodeTarget;
|
|
132
|
+
/**
|
|
133
|
+
* Where the gesture that opened it was, a point in the frame's viewport: the right-click's for
|
|
134
|
+
* `query.menu`, the badge's when an item runs from the annotations badge's popover. A plugin
|
|
135
|
+
* anchors a popover about the rows there.
|
|
136
|
+
*/
|
|
137
|
+
at?: TargetPoint;
|
|
138
|
+
/**
|
|
139
|
+
* The annotations plugins set on these rows, for the frame's items only (a plugin's `when` on
|
|
140
|
+
* them, say): the host never gets them.
|
|
141
|
+
*/
|
|
142
|
+
annotations?: Annotation[];
|
|
143
|
+
}
|
|
144
|
+
type MenuTarget = NodeTarget | RowsTarget;
|
|
145
|
+
type MenuTargetKind = MenuTarget['kind'];
|
|
146
|
+
/** One entry of a menu, as the host answers it for a target. */
|
|
147
|
+
interface MenuEntry {
|
|
148
|
+
id: string;
|
|
149
|
+
label: string;
|
|
150
|
+
/** Why it can't run: shown, and the entry can't be picked. */
|
|
151
|
+
disabled?: string;
|
|
152
|
+
}
|
|
153
|
+
/** A target as the frame sends it, or undefined when it isn't one: of its shape only, never trusted further. */
|
|
154
|
+
declare function checkTarget(value: unknown): MenuTarget | undefined;
|
|
155
|
+
|
|
156
156
|
/**
|
|
157
157
|
* The theme a host hands plugin UI: a light or dark scheme, and a fixed set of tokens, each a CSS
|
|
158
158
|
* custom property `--anfra-<token>`. A host maps its own design tokens onto them once; tabs, and
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holistics/anfra-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0-rc.1",
|
|
4
4
|
"description": "Data Apps on anfra: the authoring layer (app), what hosts one (host), anfra's plugins (plugins), the core API client (api), and their shared contract (common)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -84,14 +84,6 @@ function dedent(text) {
|
|
|
84
84
|
return lines.map((line, i) => (i ? line.slice(Math.min(indent, indentOf(line))) : line).trimEnd()).join("\n");
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
// src/plugins/inspect/model/types.ts
|
|
88
|
-
var OVERVIEW_TAB = "inspect.overview";
|
|
89
|
-
var DATA_TAB = "inspect.data";
|
|
90
|
-
var QUERIES_TAB = "inspect.queries";
|
|
91
|
-
var STRUCTURE_TAB = "inspect.structure";
|
|
92
|
-
var DECLARATION_TAB = "inspect.declaration";
|
|
93
|
-
var LINEAGE_TAB = "lineage.lineage";
|
|
94
|
-
|
|
95
87
|
// src/plugins/inspect/model/entities.ts
|
|
96
88
|
function hasEntity(apps, kind, app, name) {
|
|
97
89
|
return Object.hasOwn((kind === "query" ? apps[app]?.queries : apps[app]?.controls) ?? {}, name);
|
|
@@ -103,6 +95,14 @@ function entityGone(key, apps) {
|
|
|
103
95
|
return !hasEntity(apps, match[1], Number(match[2]), match[3]);
|
|
104
96
|
}
|
|
105
97
|
|
|
98
|
+
// src/plugins/inspect/model/types.ts
|
|
99
|
+
var OVERVIEW_TAB = "inspect.overview";
|
|
100
|
+
var DATA_TAB = "inspect.data";
|
|
101
|
+
var QUERIES_TAB = "inspect.queries";
|
|
102
|
+
var STRUCTURE_TAB = "inspect.structure";
|
|
103
|
+
var DECLARATION_TAB = "inspect.declaration";
|
|
104
|
+
var LINEAGE_TAB = "lineage.lineage";
|
|
105
|
+
|
|
106
106
|
export {
|
|
107
107
|
formatCondition,
|
|
108
108
|
formatTime,
|