@malloy-publisher/sdk 0.4.0 → 0.4.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/README.md +19 -0
- package/dist/{DocumentStorageProvider-CyOJ0hqf.es.js → DocumentStorage-BiFqO15i.es.js} +137 -129
- package/dist/{DocumentStorageProvider-DGPQEd_l.cjs.js → DocumentStorage-CMyLifsz.cjs.js} +26 -26
- package/dist/{RenderedResult-Dp22kZsQ.cjs.js → RenderedResult-CZzE8wv-.cjs.js} +2 -2
- package/dist/{RenderedResult-BnPzJ9Jf.es.js → RenderedResult-CvrmYyr5.es.js} +1 -1
- package/dist/builder/index.cjs.js +50 -50
- package/dist/builder/index.es.js +3265 -3185
- package/dist/components/Dashboard/telemetry.d.ts +20 -8
- package/dist/components/DashboardBuilder/DashboardBuilder.d.ts +16 -4
- package/dist/components/DashboardBuilder/DashboardEditor.d.ts +17 -5
- package/dist/components/DocumentStorage/DocumentStorage.d.ts +69 -5
- package/dist/components/DocumentStorage/index.d.ts +1 -0
- package/dist/index.cjs.js +9 -9
- package/dist/index.es.js +508 -506
- package/package.json +1 -1
- package/src/components/Dashboard/telemetry.ts +20 -8
- package/src/components/DashboardBuilder/DashboardBuilder.tsx +21 -3
- package/src/components/DashboardBuilder/DashboardEditor.authoritative.spec.tsx +706 -0
- package/src/components/DashboardBuilder/DashboardEditor.tsx +358 -84
- package/src/components/DocumentStorage/BrowserDocumentStorage.ts +7 -6
- package/src/components/DocumentStorage/DocumentStorage.ts +78 -5
- package/src/components/DocumentStorage/index.ts +1 -0
- package/src/components/Package/Package.tsx +12 -7
package/README.md
CHANGED
|
@@ -1006,7 +1006,16 @@ type DocumentType = "dashboard" | "notebook";
|
|
|
1006
1006
|
interface Workspace {
|
|
1007
1007
|
name: string;
|
|
1008
1008
|
writeable: boolean;
|
|
1009
|
+
/** What this place is, in the backend's own words. The editor shows it. */
|
|
1009
1010
|
description: string;
|
|
1011
|
+
/**
|
|
1012
|
+
* This workspace holds the package's system of record: the editor opens
|
|
1013
|
+
* what it keeps and writes back to it, and treats the package file as a
|
|
1014
|
+
* deploy of it. Left out, the package file is the record and this is a
|
|
1015
|
+
* place a copy is kept beside it, which is what every host got before the
|
|
1016
|
+
* flag existed. At most one workspace per storage sets it.
|
|
1017
|
+
*/
|
|
1018
|
+
authoritative?: boolean;
|
|
1010
1019
|
}
|
|
1011
1020
|
|
|
1012
1021
|
interface DocumentLocator {
|
|
@@ -1028,6 +1037,14 @@ interface DocumentStorage {
|
|
|
1028
1037
|
}
|
|
1029
1038
|
```
|
|
1030
1039
|
|
|
1040
|
+
`getDocument`, `deleteDocument` and `moveDocument` reject with `DocumentNotFoundError`
|
|
1041
|
+
when the document is not there, and with anything else when the backend could not be
|
|
1042
|
+
asked. The distinction is load-bearing rather than cosmetic: a failed read reported as
|
|
1043
|
+
"there is no document" reads as "the package is the only copy", and saving on that
|
|
1044
|
+
belief overwrites the copy that was actually there. Use `isDocumentNotFound(error)`
|
|
1045
|
+
rather than `instanceof`, since the `es` and `cjs` builds carry their own copy of the
|
|
1046
|
+
class.
|
|
1047
|
+
|
|
1031
1048
|
A document is a string; the `type` on its locator says what kind so a backend can keep kinds apart
|
|
1032
1049
|
and a listing can ask for one. Every method rejects when the document is not there, so a caller can
|
|
1033
1050
|
tell "missing" from "empty".
|
|
@@ -1471,6 +1488,8 @@ function EnvironmentList() {
|
|
|
1471
1488
|
| `createEmbeddedQueryResult` | Serialize query config |
|
|
1472
1489
|
| `BrowserDocumentStorage` | localStorage-based document storage |
|
|
1473
1490
|
| `globalQueryClient` | Shared React Query client |
|
|
1491
|
+
| `DocumentNotFoundError` | Absence, not a failed read |
|
|
1492
|
+
| `isDocumentNotFound` | Absence check across es/cjs builds |
|
|
1474
1493
|
|
|
1475
1494
|
### Exported Types
|
|
1476
1495
|
|
|
@@ -62,7 +62,7 @@ function pa(...e) {
|
|
|
62
62
|
function vn(e) {
|
|
63
63
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function O1(e) {
|
|
66
66
|
if (Object.prototype.hasOwnProperty.call(e, "__esModule")) return e;
|
|
67
67
|
var t = e.default;
|
|
68
68
|
if (typeof t == "function") {
|
|
@@ -3093,7 +3093,7 @@ function xm(e, t) {
|
|
|
3093
3093
|
const Sm = ut(/* @__PURE__ */ v("path", {
|
|
3094
3094
|
d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"
|
|
3095
3095
|
}));
|
|
3096
|
-
function
|
|
3096
|
+
function E1({
|
|
3097
3097
|
label: e,
|
|
3098
3098
|
onClick: t,
|
|
3099
3099
|
disabled: n
|
|
@@ -3112,7 +3112,7 @@ function O1({
|
|
|
3112
3112
|
}
|
|
3113
3113
|
);
|
|
3114
3114
|
}
|
|
3115
|
-
function
|
|
3115
|
+
function A1({
|
|
3116
3116
|
label: e,
|
|
3117
3117
|
icon: t,
|
|
3118
3118
|
onClick: n,
|
|
@@ -3143,7 +3143,7 @@ function E1({
|
|
|
3143
3143
|
const Di = ut(/* @__PURE__ */ v("path", {
|
|
3144
3144
|
d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
3145
3145
|
}));
|
|
3146
|
-
function
|
|
3146
|
+
function F1({
|
|
3147
3147
|
open: e,
|
|
3148
3148
|
onClose: t,
|
|
3149
3149
|
title: n,
|
|
@@ -3214,7 +3214,7 @@ function A1({
|
|
|
3214
3214
|
}
|
|
3215
3215
|
);
|
|
3216
3216
|
}
|
|
3217
|
-
function
|
|
3217
|
+
function L1({
|
|
3218
3218
|
left: e,
|
|
3219
3219
|
children: t
|
|
3220
3220
|
}) {
|
|
@@ -5851,7 +5851,7 @@ function Dt(e = []) {
|
|
|
5851
5851
|
function hg(e) {
|
|
5852
5852
|
return xe("MuiTypography", e);
|
|
5853
5853
|
}
|
|
5854
|
-
const
|
|
5854
|
+
const N1 = ye("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom", "paragraph"]), gg = {
|
|
5855
5855
|
primary: !0,
|
|
5856
5856
|
secondary: !0,
|
|
5857
5857
|
error: !0,
|
|
@@ -21550,13 +21550,13 @@ const iP = /* @__PURE__ */ new Set([
|
|
|
21550
21550
|
"link",
|
|
21551
21551
|
"image"
|
|
21552
21552
|
]);
|
|
21553
|
-
function
|
|
21553
|
+
function B1(e, t) {
|
|
21554
21554
|
return t === "fill" ? "container" : t === "fixed" || !e ? "content" : iP.has(e) ? "container" : "content";
|
|
21555
21555
|
}
|
|
21556
|
-
function
|
|
21556
|
+
function V1(e, t) {
|
|
21557
21557
|
return t === "fixed" ? !0 : t === "fill" ? !1 : e !== void 0 && aP.has(e);
|
|
21558
21558
|
}
|
|
21559
|
-
function
|
|
21559
|
+
function z1(e) {
|
|
21560
21560
|
return e === "dashboard" ? 3 : 2;
|
|
21561
21561
|
}
|
|
21562
21562
|
function lP(e, t) {
|
|
@@ -21565,11 +21565,11 @@ function lP(e, t) {
|
|
|
21565
21565
|
n = n.firstElementChild;
|
|
21566
21566
|
return n;
|
|
21567
21567
|
}
|
|
21568
|
-
function
|
|
21568
|
+
function W1(e, t) {
|
|
21569
21569
|
const n = lP(e, t);
|
|
21570
21570
|
return n && (n.scrollHeight || n.offsetHeight) || 0;
|
|
21571
21571
|
}
|
|
21572
|
-
const cP = 400,
|
|
21572
|
+
const cP = 400, H1 = 700, _1 = 600, U1 = 800, uP = 400, jl = 2e3;
|
|
21573
21573
|
function dP(e) {
|
|
21574
21574
|
return e === void 0 ? jl : Math.min(e, jl);
|
|
21575
21575
|
}
|
|
@@ -21709,7 +21709,7 @@ function CP(e) {
|
|
|
21709
21709
|
`)
|
|
21710
21710
|
};
|
|
21711
21711
|
}
|
|
21712
|
-
const wP = Cd(() => import("./RenderedResult-
|
|
21712
|
+
const wP = Cd(() => import("./RenderedResult-CvrmYyr5.es.js").then((e) => e.c));
|
|
21713
21713
|
function PP({
|
|
21714
21714
|
result: e,
|
|
21715
21715
|
maxHeight: t,
|
|
@@ -21887,7 +21887,7 @@ const cd = 20, OP = {
|
|
|
21887
21887
|
radius: "8px",
|
|
21888
21888
|
padding: `${cd}px`
|
|
21889
21889
|
};
|
|
21890
|
-
function
|
|
21890
|
+
function Y1(e, t = OP) {
|
|
21891
21891
|
return {
|
|
21892
21892
|
"--malloy-render--font-family": e.font.family,
|
|
21893
21893
|
"--malloy-render--table-font-size": `${e.font.size}px`,
|
|
@@ -23839,7 +23839,7 @@ function tc(e) {
|
|
|
23839
23839
|
return e instanceof Date ? Number.isNaN(e.getTime()) ? void 0 : e.toISOString().slice(0, 10) : /^(\d{4}-\d{2}-\d{2})/.exec(String(e))?.[1];
|
|
23840
23840
|
}
|
|
23841
23841
|
const fi = "[A-Za-z_][A-Za-z0-9_]*", nc = (e) => new RegExp(`^${fi}$`).test(e);
|
|
23842
|
-
function
|
|
23842
|
+
function j1(e, t, n) {
|
|
23843
23843
|
const r = /* @__PURE__ */ new Map(), o = new RegExp(
|
|
23844
23844
|
`^\\s*${n}:\\s*(${fi})\\s+is\\b\\s*(.*)$`
|
|
23845
23845
|
);
|
|
@@ -23858,14 +23858,14 @@ function Y1(e, t, n) {
|
|
|
23858
23858
|
}
|
|
23859
23859
|
return r;
|
|
23860
23860
|
}
|
|
23861
|
-
function
|
|
23861
|
+
function G1(e, t, n) {
|
|
23862
23862
|
const r = new RegExp(`^\\s*${t}:\\s*${n}\\s+is\\b`);
|
|
23863
23863
|
return e.findIndex((o) => r.test(o));
|
|
23864
23864
|
}
|
|
23865
|
-
const
|
|
23865
|
+
const K1 = (e) => e.findIndex(
|
|
23866
23866
|
(t) => t.trimStart().startsWith("##") && t.includes("artifact")
|
|
23867
23867
|
);
|
|
23868
|
-
function
|
|
23868
|
+
function q1(e) {
|
|
23869
23869
|
const t = /* @__PURE__ */ new Map(), n = (o) => /^([A-Z_][A-Z0-9_]*)\s*::/.exec(o)?.[1], r = (o, s, i) => {
|
|
23870
23870
|
const a = s.trim(), l = n(a);
|
|
23871
23871
|
l && t.set(l, {
|
|
@@ -24079,7 +24079,7 @@ function y1({
|
|
|
24079
24079
|
}
|
|
24080
24080
|
);
|
|
24081
24081
|
}
|
|
24082
|
-
function
|
|
24082
|
+
function Q1({
|
|
24083
24083
|
resourceUri: e,
|
|
24084
24084
|
dashboard: t,
|
|
24085
24085
|
givens: n,
|
|
@@ -24295,17 +24295,17 @@ function b1({
|
|
|
24295
24295
|
t && /* @__PURE__ */ v(sP, { variant: "caption", children: t })
|
|
24296
24296
|
] });
|
|
24297
24297
|
}
|
|
24298
|
-
const
|
|
24298
|
+
const X1 = ut(/* @__PURE__ */ v("path", {
|
|
24299
24299
|
d: "M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"
|
|
24300
24300
|
})), sa = wd(void 0);
|
|
24301
|
-
function
|
|
24301
|
+
function Z1({
|
|
24302
24302
|
children: e,
|
|
24303
24303
|
documentStorage: t
|
|
24304
24304
|
}) {
|
|
24305
24305
|
const n = ot(() => ({ documentStorage: t }), [t]);
|
|
24306
24306
|
return /* @__PURE__ */ v(sa.Provider, { value: n, children: e });
|
|
24307
24307
|
}
|
|
24308
|
-
function
|
|
24308
|
+
function J1() {
|
|
24309
24309
|
const e = ac(sa);
|
|
24310
24310
|
if (!e)
|
|
24311
24311
|
throw new Error(
|
|
@@ -24313,131 +24313,139 @@ function Z1() {
|
|
|
24313
24313
|
);
|
|
24314
24314
|
return e;
|
|
24315
24315
|
}
|
|
24316
|
-
function
|
|
24316
|
+
function ek() {
|
|
24317
24317
|
return ac(sa);
|
|
24318
24318
|
}
|
|
24319
|
+
class v1 extends Error {
|
|
24320
|
+
constructor(t) {
|
|
24321
|
+
super(t), this.name = "DocumentNotFoundError";
|
|
24322
|
+
}
|
|
24323
|
+
}
|
|
24324
|
+
const tk = (e) => e instanceof v1 || e instanceof Error && e.name === "DocumentNotFoundError";
|
|
24319
24325
|
export {
|
|
24320
|
-
|
|
24326
|
+
fr as $,
|
|
24321
24327
|
Sm as A,
|
|
24322
|
-
|
|
24323
|
-
|
|
24328
|
+
cP as B,
|
|
24329
|
+
X1 as C,
|
|
24324
24330
|
cd as D,
|
|
24325
|
-
|
|
24326
|
-
|
|
24331
|
+
Gl as E,
|
|
24332
|
+
eP as F,
|
|
24327
24333
|
mP as G,
|
|
24328
|
-
|
|
24329
|
-
|
|
24330
|
-
|
|
24331
|
-
|
|
24334
|
+
us as H,
|
|
24335
|
+
Yc as I,
|
|
24336
|
+
pe as J,
|
|
24337
|
+
Kc as K,
|
|
24332
24338
|
Qr as L,
|
|
24333
|
-
|
|
24334
|
-
|
|
24335
|
-
|
|
24339
|
+
Le as M,
|
|
24340
|
+
no as N,
|
|
24341
|
+
mt as O,
|
|
24336
24342
|
sP as P,
|
|
24337
|
-
|
|
24338
|
-
|
|
24339
|
-
|
|
24343
|
+
xe as Q,
|
|
24344
|
+
ye as R,
|
|
24345
|
+
A1 as S,
|
|
24340
24346
|
EP as T,
|
|
24341
|
-
|
|
24342
|
-
|
|
24343
|
-
|
|
24344
|
-
|
|
24345
|
-
|
|
24346
|
-
|
|
24347
|
-
|
|
24348
|
-
|
|
24349
|
-
|
|
24350
|
-
|
|
24351
|
-
|
|
24352
|
-
|
|
24353
|
-
|
|
24354
|
-
|
|
24355
|
-
|
|
24356
|
-
|
|
24357
|
-
|
|
24358
|
-
|
|
24359
|
-
|
|
24360
|
-
|
|
24361
|
-
|
|
24362
|
-
|
|
24363
|
-
|
|
24364
|
-
|
|
24365
|
-
|
|
24366
|
-
|
|
24367
|
-
|
|
24368
|
-
|
|
24369
|
-
|
|
24370
|
-
|
|
24371
|
-
|
|
24372
|
-
|
|
24373
|
-
|
|
24374
|
-
|
|
24375
|
-
|
|
24376
|
-
|
|
24377
|
-
|
|
24378
|
-
|
|
24379
|
-
|
|
24380
|
-
|
|
24381
|
-
|
|
24382
|
-
|
|
24383
|
-
|
|
24384
|
-
|
|
24385
|
-
|
|
24386
|
-
|
|
24387
|
-
|
|
24388
|
-
|
|
24389
|
-
|
|
24390
|
-
|
|
24391
|
-
|
|
24392
|
-
|
|
24393
|
-
|
|
24394
|
-
|
|
24395
|
-
|
|
24396
|
-
|
|
24397
|
-
|
|
24398
|
-
|
|
24399
|
-
|
|
24400
|
-
|
|
24401
|
-
|
|
24402
|
-
|
|
24403
|
-
|
|
24404
|
-
|
|
24405
|
-
|
|
24406
|
-
|
|
24407
|
-
|
|
24408
|
-
|
|
24409
|
-
|
|
24410
|
-
|
|
24411
|
-
|
|
24412
|
-
|
|
24413
|
-
|
|
24414
|
-
|
|
24415
|
-
|
|
24416
|
-
|
|
24417
|
-
|
|
24418
|
-
|
|
24347
|
+
$e as U,
|
|
24348
|
+
_ as V,
|
|
24349
|
+
fe as W,
|
|
24350
|
+
ve as X,
|
|
24351
|
+
hr as Y,
|
|
24352
|
+
Te as Z,
|
|
24353
|
+
Kp as _,
|
|
24354
|
+
V1 as a,
|
|
24355
|
+
dP as a$,
|
|
24356
|
+
He as a0,
|
|
24357
|
+
jo as a1,
|
|
24358
|
+
ce as a2,
|
|
24359
|
+
oh as a3,
|
|
24360
|
+
E1 as a4,
|
|
24361
|
+
Yd as a5,
|
|
24362
|
+
rm as a6,
|
|
24363
|
+
to as a7,
|
|
24364
|
+
zr as a8,
|
|
24365
|
+
zn as a9,
|
|
24366
|
+
gr as aA,
|
|
24367
|
+
vP as aB,
|
|
24368
|
+
PP as aC,
|
|
24369
|
+
U1 as aD,
|
|
24370
|
+
ad as aE,
|
|
24371
|
+
xP as aF,
|
|
24372
|
+
ld as aG,
|
|
24373
|
+
_1 as aH,
|
|
24374
|
+
ud as aI,
|
|
24375
|
+
a1 as aJ,
|
|
24376
|
+
l1 as aK,
|
|
24377
|
+
ih as aL,
|
|
24378
|
+
H1 as aM,
|
|
24379
|
+
Ti as aN,
|
|
24380
|
+
Zs as aO,
|
|
24381
|
+
v1 as aP,
|
|
24382
|
+
Q1 as aQ,
|
|
24383
|
+
Bs as aR,
|
|
24384
|
+
$c as aS,
|
|
24385
|
+
cs as aT,
|
|
24386
|
+
zm as aU,
|
|
24387
|
+
Oc as aV,
|
|
24388
|
+
Vm as aW,
|
|
24389
|
+
Wm as aX,
|
|
24390
|
+
Xw as aY,
|
|
24391
|
+
o1 as aZ,
|
|
24392
|
+
jl as a_,
|
|
24393
|
+
N1 as aa,
|
|
24394
|
+
lt as ab,
|
|
24395
|
+
jr as ac,
|
|
24396
|
+
Yt as ad,
|
|
24397
|
+
Yu as ae,
|
|
24398
|
+
mr as af,
|
|
24399
|
+
go as ag,
|
|
24400
|
+
sh as ah,
|
|
24401
|
+
ze as ai,
|
|
24402
|
+
Au as aj,
|
|
24403
|
+
Eu as ak,
|
|
24404
|
+
Uu as al,
|
|
24405
|
+
r1 as am,
|
|
24406
|
+
uu as an,
|
|
24407
|
+
Ho as ao,
|
|
24408
|
+
ei as ap,
|
|
24409
|
+
qo as aq,
|
|
24410
|
+
Tc as ar,
|
|
24411
|
+
c1 as as,
|
|
24412
|
+
O1 as at,
|
|
24413
|
+
vn as au,
|
|
24414
|
+
Di as av,
|
|
24415
|
+
Ft as aw,
|
|
24416
|
+
jt as ax,
|
|
24417
|
+
xm as ay,
|
|
24418
|
+
Dt as az,
|
|
24419
|
+
Y1 as b,
|
|
24420
|
+
pP as b0,
|
|
24421
|
+
uP as b1,
|
|
24422
|
+
Z1 as b2,
|
|
24423
|
+
J1 as b3,
|
|
24424
|
+
Xm as b4,
|
|
24425
|
+
th as b5,
|
|
24426
|
+
bP as b6,
|
|
24419
24427
|
lP as c,
|
|
24420
|
-
|
|
24428
|
+
z1 as d,
|
|
24421
24429
|
ut as e,
|
|
24422
|
-
|
|
24423
|
-
|
|
24430
|
+
L1 as f,
|
|
24431
|
+
F1 as g,
|
|
24424
24432
|
AP as h,
|
|
24425
|
-
|
|
24426
|
-
|
|
24427
|
-
|
|
24428
|
-
|
|
24429
|
-
|
|
24433
|
+
j1 as i,
|
|
24434
|
+
q1 as j,
|
|
24435
|
+
K1 as k,
|
|
24436
|
+
G1 as l,
|
|
24437
|
+
W1 as m,
|
|
24430
24438
|
fP as n,
|
|
24431
24439
|
rc as o,
|
|
24432
24440
|
b1 as p,
|
|
24433
24441
|
gP as q,
|
|
24434
|
-
|
|
24442
|
+
B1 as r,
|
|
24435
24443
|
u1 as s,
|
|
24436
24444
|
p1 as t,
|
|
24437
|
-
|
|
24445
|
+
ek as u,
|
|
24438
24446
|
Ri as v,
|
|
24439
|
-
|
|
24440
|
-
|
|
24441
|
-
|
|
24442
|
-
|
|
24447
|
+
tk as w,
|
|
24448
|
+
vi as x,
|
|
24449
|
+
rh as y,
|
|
24450
|
+
Kl as z
|
|
24443
24451
|
};
|