@elaraai/e3-ui 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/dist/src/bind/data.d.ts +4 -3
- package/dist/src/bind/data.d.ts.map +1 -1
- package/dist/src/bind/data.js +4 -3
- package/dist/src/bind/data.js.map +1 -1
- package/dist/src/bind/record.d.ts +234 -6
- package/dist/src/bind/record.d.ts.map +1 -1
- package/dist/src/bind/record.js +250 -7
- package/dist/src/bind/record.js.map +1 -1
- package/dist/src/bind/sources.d.ts +148 -0
- package/dist/src/bind/sources.d.ts.map +1 -0
- package/dist/src/bind/sources.js +116 -0
- package/dist/src/bind/sources.js.map +1 -0
- package/dist/src/index.d.ts +4 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +9 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal.d.ts +4 -1
- package/dist/src/internal.d.ts.map +1 -1
- package/dist/src/internal.js +11 -1
- package/dist/src/internal.js.map +1 -1
- package/dist/src/query/builder.d.ts +3257 -0
- package/dist/src/query/builder.d.ts.map +1 -0
- package/dist/src/query/builder.js +126 -0
- package/dist/src/query/builder.js.map +1 -0
- package/dist/src/query/index.d.ts +108 -0
- package/dist/src/query/index.d.ts.map +1 -0
- package/dist/src/query/index.js +76 -0
- package/dist/src/query/index.js.map +1 -0
- package/dist/src/query/library.d.ts +3241 -0
- package/dist/src/query/library.d.ts.map +1 -0
- package/dist/src/query/library.js +114 -0
- package/dist/src/query/library.js.map +1 -0
- package/dist/src/query/queries.d.ts +4696 -0
- package/dist/src/query/queries.d.ts.map +1 -0
- package/dist/src/query/queries.js +129 -0
- package/dist/src/query/queries.js.map +1 -0
- package/dist/src/query/saved.d.ts +72 -0
- package/dist/src/query/saved.d.ts.map +1 -0
- package/dist/src/query/saved.js +84 -0
- package/dist/src/query/saved.js.map +1 -0
- package/dist/src/query/steps.d.ts +613 -0
- package/dist/src/query/steps.d.ts.map +1 -0
- package/dist/src/query/steps.js +316 -0
- package/dist/src/query/steps.js.map +1 -0
- package/dist/src/query/types.d.ts +444 -0
- package/dist/src/query/types.d.ts.map +1 -0
- package/dist/src/query/types.js +113 -0
- package/dist/src/query/types.js.map +1 -0
- package/dist/src/studio/builder.d.ts +3123 -0
- package/dist/src/studio/builder.d.ts.map +1 -0
- package/dist/src/studio/builder.js +115 -0
- package/dist/src/studio/builder.js.map +1 -0
- package/dist/src/studio/canvas.d.ts +83 -0
- package/dist/src/studio/canvas.d.ts.map +1 -0
- package/dist/src/studio/canvas.js +71 -0
- package/dist/src/studio/canvas.js.map +1 -0
- package/dist/src/studio/component.d.ts +178 -0
- package/dist/src/studio/component.d.ts.map +1 -0
- package/dist/src/studio/component.js +189 -0
- package/dist/src/studio/component.js.map +1 -0
- package/dist/src/studio/index.d.ts +104 -0
- package/dist/src/studio/index.d.ts.map +1 -0
- package/dist/src/studio/index.js +75 -0
- package/dist/src/studio/index.js.map +1 -0
- package/dist/src/studio/inspector.d.ts +208 -0
- package/dist/src/studio/inspector.d.ts.map +1 -0
- package/dist/src/studio/inspector.js +155 -0
- package/dist/src/studio/inspector.js.map +1 -0
- package/dist/src/studio/library.d.ts +3506 -0
- package/dist/src/studio/library.d.ts.map +1 -0
- package/dist/src/studio/library.js +245 -0
- package/dist/src/studio/library.js.map +1 -0
- package/dist/src/studio/page.d.ts +305 -0
- package/dist/src/studio/page.d.ts.map +1 -0
- package/dist/src/studio/page.js +105 -0
- package/dist/src/studio/page.js.map +1 -0
- package/dist/src/studio/pages.d.ts +10929 -0
- package/dist/src/studio/pages.d.ts.map +1 -0
- package/dist/src/studio/pages.js +502 -0
- package/dist/src/studio/pages.js.map +1 -0
- package/dist/src/studio/palette.d.ts +179 -0
- package/dist/src/studio/palette.d.ts.map +1 -0
- package/dist/src/studio/palette.js +120 -0
- package/dist/src/studio/palette.js.map +1 -0
- package/dist/src/studio/publish.d.ts +397 -0
- package/dist/src/studio/publish.d.ts.map +1 -0
- package/dist/src/studio/publish.js +198 -0
- package/dist/src/studio/publish.js.map +1 -0
- package/dist/src/ui.d.ts +16 -3
- package/dist/src/ui.d.ts.map +1 -1
- package/dist/src/ui.js +21 -1
- package/dist/src/ui.js.map +1 -1
- package/dist/test/bind/data/data.examples.d.ts +76 -1
- package/dist/test/bind/data/data.examples.d.ts.map +1 -1
- package/dist/test/bind/data/data.examples.js +176 -3
- package/dist/test/bind/data/data.examples.js.map +1 -1
- package/dist/test/bind/func/func.examples.d.ts +8 -0
- package/dist/test/bind/func/func.examples.d.ts.map +1 -1
- package/dist/test/bind/func/func.examples.js +4 -3
- package/dist/test/bind/func/func.examples.js.map +1 -1
- package/dist/test/bind/record/record.examples.d.ts +65 -1
- package/dist/test/bind/record/record.examples.d.ts.map +1 -1
- package/dist/test/bind/record/record.examples.js +21 -3
- package/dist/test/bind/record/record.examples.js.map +1 -1
- package/dist/test/query/query.examples.d.ts +5022 -0
- package/dist/test/query/query.examples.d.ts.map +1 -0
- package/dist/test/query/query.examples.js +467 -0
- package/dist/test/query/query.examples.js.map +1 -0
- package/dist/test/studio/component.examples.d.ts +7 -0
- package/dist/test/studio/component.examples.d.ts.map +1 -0
- package/dist/test/studio/component.examples.js +46 -0
- package/dist/test/studio/component.examples.js.map +1 -0
- package/dist/test/studio/page.examples.d.ts +7 -0
- package/dist/test/studio/page.examples.d.ts.map +1 -0
- package/dist/test/studio/page.examples.js +64 -0
- package/dist/test/studio/page.examples.js.map +1 -0
- package/dist/test/studio/studio.examples.d.ts +1766 -0
- package/dist/test/studio/studio.examples.d.ts.map +1 -0
- package/dist/test/studio/studio.examples.js +354 -0
- package/dist/test/studio/studio.examples.js.map +1 -0
- package/package.json +9 -8
|
@@ -0,0 +1,189 @@
|
|
|
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
|
+
* Studio components (#991) — a component is self-contained: an East UI
|
|
7
|
+
* function written exactly like a `ui()` body, which binds its own data, sets
|
|
8
|
+
* up its own slices and returns its UI. Different data is a different
|
|
9
|
+
* component.
|
|
10
|
+
*
|
|
11
|
+
* `Studio.component(key, meta, fn)` returns it as a `Studio.Types.Component`
|
|
12
|
+
* struct, the way `Slice.config` returns a slice config: what the palette
|
|
13
|
+
* shows, what the function reads, the fingerprint of its code, and the
|
|
14
|
+
* function itself. A surface lists the components it offers, and the Studio's
|
|
15
|
+
* renderers draw a placement by calling its component's function, so a
|
|
16
|
+
* surface's `ui()` task holds every listed component's function and its
|
|
17
|
+
* manifest is the union of theirs.
|
|
18
|
+
*
|
|
19
|
+
* @packageDocumentation
|
|
20
|
+
*/
|
|
21
|
+
import { ArrayType, BooleanType, East, FunctionType, IRType, IntegerType, NullType, OptionType, StringType, StructType, VariantType, encodeBeast2For, none, sha256Hex, some, variant, } from "@elaraai/east";
|
|
22
|
+
import { UIComponentType } from "@elaraai/east-ui/internal";
|
|
23
|
+
import { DataManifestType } from "@elaraai/e3-types";
|
|
24
|
+
import { deriveManifest } from "../utils/derive.js";
|
|
25
|
+
// ============================================================================
|
|
26
|
+
// Types
|
|
27
|
+
// ============================================================================
|
|
28
|
+
/**
|
|
29
|
+
* How a component's placements are drawn.
|
|
30
|
+
*
|
|
31
|
+
* @property card - In a tile frame (the default)
|
|
32
|
+
* @property none - Bare, on the canvas and published alike
|
|
33
|
+
*/
|
|
34
|
+
export const StudioFrameType = VariantType({
|
|
35
|
+
card: NullType,
|
|
36
|
+
none: NullType,
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* A Studio component — what the palette shows, what the component reads, the
|
|
40
|
+
* fingerprint of its code, and the East UI function that renders it.
|
|
41
|
+
*
|
|
42
|
+
* @property key - The component's identity; a cell stores it
|
|
43
|
+
* @property name - Its name, in the palette and the inspector
|
|
44
|
+
* @property category - The palette group it sits in
|
|
45
|
+
* @property icon - A Font Awesome solid icon name
|
|
46
|
+
* @property span - The span a new placement takes, in columns of 12
|
|
47
|
+
* @property description - What it shows — the inspector's "fixed by developer" block
|
|
48
|
+
* @property frame - Drawn in a tile frame, or bare
|
|
49
|
+
* @property tags - Its tags, which the palette's Filter menu offers
|
|
50
|
+
* @property collections - Its collections, which the palette's Filter menu offers
|
|
51
|
+
* @property deprecated - Hidden from the palette; placements keep rendering
|
|
52
|
+
* @property reads - The datasets, functions and records its function binds, derived from its code
|
|
53
|
+
* @property fingerprint - A hash of its code; a cell stores it when placed and when its page publishes, so a code change since shows
|
|
54
|
+
* @property render - The East UI function that renders it
|
|
55
|
+
*/
|
|
56
|
+
export const StudioComponentType = StructType({
|
|
57
|
+
key: StringType,
|
|
58
|
+
name: StringType,
|
|
59
|
+
category: StringType,
|
|
60
|
+
icon: StringType,
|
|
61
|
+
span: IntegerType,
|
|
62
|
+
description: OptionType(StringType),
|
|
63
|
+
frame: StudioFrameType,
|
|
64
|
+
tags: ArrayType(StringType),
|
|
65
|
+
collections: ArrayType(StringType),
|
|
66
|
+
deprecated: BooleanType,
|
|
67
|
+
reads: DataManifestType,
|
|
68
|
+
fingerprint: StringType,
|
|
69
|
+
render: FunctionType([], UIComponentType),
|
|
70
|
+
});
|
|
71
|
+
// ============================================================================
|
|
72
|
+
// The fingerprint
|
|
73
|
+
// ============================================================================
|
|
74
|
+
const encodeIR = encodeBeast2For(IRType);
|
|
75
|
+
/**
|
|
76
|
+
* The IR in a canonical form: every location id zeroed and every variable
|
|
77
|
+
* renamed by its first appearance, so the same code has the same IR wherever
|
|
78
|
+
* it is written and whatever was built before it.
|
|
79
|
+
*
|
|
80
|
+
* @remarks
|
|
81
|
+
* The East types a node carries are kept as they are, not copied: equal types
|
|
82
|
+
* are one shared object, which the encoder writes once, and a copy would make
|
|
83
|
+
* it write a UI type again at every node.
|
|
84
|
+
*/
|
|
85
|
+
function canonicalIR(ir) {
|
|
86
|
+
const names = new Map();
|
|
87
|
+
const walk = (node) => {
|
|
88
|
+
if (Array.isArray(node))
|
|
89
|
+
return node.map(walk);
|
|
90
|
+
if (node === null || typeof node !== "object")
|
|
91
|
+
return node;
|
|
92
|
+
const proto = Object.getPrototypeOf(node);
|
|
93
|
+
if (proto !== Object.prototype && proto !== null)
|
|
94
|
+
return node;
|
|
95
|
+
const out = {};
|
|
96
|
+
for (const [field, value] of Object.entries(node)) {
|
|
97
|
+
out[field] = field === "loc_id" ? 0n
|
|
98
|
+
: (field === "type" && typeof value === "object") || field === "type_parameters" ? value
|
|
99
|
+
: walk(value);
|
|
100
|
+
}
|
|
101
|
+
const v = out;
|
|
102
|
+
if (v.type === "Variable" && v.value !== undefined && typeof v.value.name === "string") {
|
|
103
|
+
const name = v.value.name;
|
|
104
|
+
let canonical = names.get(name);
|
|
105
|
+
if (canonical === undefined) {
|
|
106
|
+
canonical = `v${names.size}`;
|
|
107
|
+
names.set(name, canonical);
|
|
108
|
+
}
|
|
109
|
+
v.value = { ...v.value, name: canonical };
|
|
110
|
+
}
|
|
111
|
+
return out;
|
|
112
|
+
};
|
|
113
|
+
return walk(ir);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* A function's fingerprint: the SHA-256 of its IR in canonical form. The same
|
|
117
|
+
* code fingerprints the same; a change to it changes the fingerprint.
|
|
118
|
+
*
|
|
119
|
+
* @param fn - The function
|
|
120
|
+
* @returns The fingerprint, hex
|
|
121
|
+
*/
|
|
122
|
+
export function fingerprintOf(fn) {
|
|
123
|
+
return sha256Hex(encodeIR(canonicalIR(fn.toIR().ir)));
|
|
124
|
+
}
|
|
125
|
+
// ============================================================================
|
|
126
|
+
// Authoring
|
|
127
|
+
// ============================================================================
|
|
128
|
+
/**
|
|
129
|
+
* Declares a Studio component — a self-contained East UI function, and what
|
|
130
|
+
* the palette shows of it.
|
|
131
|
+
*
|
|
132
|
+
* @remarks
|
|
133
|
+
* `fn` is exactly what `ui()` takes, so a component written for a `ui()` body
|
|
134
|
+
* moves into `Studio.component` unchanged. Its `reads` come from its code
|
|
135
|
+
* (`deriveManifest`), and its `fingerprint` from its IR — neither is written.
|
|
136
|
+
* Call it at module scope or inside an East function, as `Slice.config` is.
|
|
137
|
+
*
|
|
138
|
+
* @param key - The component's identity; a cell stores it
|
|
139
|
+
* @param meta - What the palette shows ({@link StudioComponentMeta})
|
|
140
|
+
* @param fn - The East UI function that renders it
|
|
141
|
+
* @returns The component, a {@link StudioComponentType} value
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ```tsx
|
|
145
|
+
* import { East, IntegerType, NullType } from "@elaraai/east";
|
|
146
|
+
* import { Button, HStack, Reactive, State, Text, UIComponentType } from "@elaraai/east-ui";
|
|
147
|
+
* import { Studio } from "@elaraai/e3-ui";
|
|
148
|
+
*
|
|
149
|
+
* // A counter: its own state, shared by every placement of it.
|
|
150
|
+
* export const counter = Studio.component("counter", {
|
|
151
|
+
* name: "Counter", category: "Display", icon: "gauge-high", span: 4n,
|
|
152
|
+
* description: "Clicks so far",
|
|
153
|
+
* }, East.function([], UIComponentType, _$ => (
|
|
154
|
+
* <Reactive>{$ => {
|
|
155
|
+
* const clicks = $.let(State.bind([IntegerType], "counter.clicks", 0n));
|
|
156
|
+
* const add = $.const(East.function([], NullType, $2 => { $2(clicks.write(clicks.read().add(1n))); }));
|
|
157
|
+
* return (
|
|
158
|
+
* <HStack gap="3" align="center">
|
|
159
|
+
* <Text>{East.str`${East.print(clicks.read())} clicks`}</Text>
|
|
160
|
+
* <Button size="xs" onClick={add}>Add</Button>
|
|
161
|
+
* </HStack>
|
|
162
|
+
* );
|
|
163
|
+
* }}</Reactive>
|
|
164
|
+
* )));
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
function createComponent(key, meta, fn) {
|
|
168
|
+
const reads = deriveManifest(fn);
|
|
169
|
+
return East.value({
|
|
170
|
+
key,
|
|
171
|
+
name: meta.name,
|
|
172
|
+
category: meta.category,
|
|
173
|
+
icon: meta.icon,
|
|
174
|
+
span: meta.span ?? 12n,
|
|
175
|
+
description: meta.description === undefined ? none : some(meta.description),
|
|
176
|
+
frame: variant(meta.frame ?? "card", null),
|
|
177
|
+
tags: meta.tags ?? [],
|
|
178
|
+
collections: meta.collections ?? [],
|
|
179
|
+
deprecated: meta.deprecated ?? false,
|
|
180
|
+
reads,
|
|
181
|
+
fingerprint: fingerprintOf(fn),
|
|
182
|
+
render: fn,
|
|
183
|
+
}, StudioComponentType);
|
|
184
|
+
}
|
|
185
|
+
/** The component half of the `Studio` namespace. */
|
|
186
|
+
export const StudioComponents = {
|
|
187
|
+
component: createComponent,
|
|
188
|
+
};
|
|
189
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/studio/component.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACH,SAAS,EACT,WAAW,EACX,IAAI,EACJ,YAAY,EACZ,MAAM,EACN,WAAW,EACX,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,eAAe,EACf,IAAI,EACJ,SAAS,EACT,IAAI,EACJ,OAAO,GAIV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,+EAA+E;AAC/E,QAAQ;AACR,+EAA+E;AAE/E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC;IACvC,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;CACjB,CAAC,CAAC;AAQH;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC;IAC1C,GAAG,EAAE,UAAU;IACf,IAAI,EAAE,UAAU;IAChB,QAAQ,EAA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AAK,CAAC;QACd,GAAG;QACH,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,GAAG;QACtB,WAAW,EAAE,IAAI,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;QAC3E,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,MAAM,EAAE,IAAI,CAAC;QAC1C,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE;QACrB,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,EAAE;QACnC,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,KAAK;QACpC,KAAK;QACL,WAAW,EAAE,aAAa,CAAC,EAAE,CAAC;QAC9B,MAAM,EAAE,EAAE;KACb,EAAE,mBAAmB,CAAC,CAAC;AAC5B,CAAC;AAQD,oDAAoD;AACpD,MAAM,CAAC,MAAM,gBAAgB,GAA6B;IACtD,SAAS,EAAE,eAAe;CAC7B,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
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
|
+
* The Studio (#787) — components developers publish as code, and the pages
|
|
7
|
+
* operators build from them on the 12-column snap grid.
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
import { StudioComponentType, StudioComponents, StudioFrameType } from "./component.js";
|
|
12
|
+
import { StudioCellChangeType, StudioCellType, StudioChangeType, StudioEntryType, StudioKeyType, StudioLiveType, StudioPageEntryType, StudioPageType, StudioPages, StudioPagesType, StudioStatusType } from "./pages.js";
|
|
13
|
+
import { StudioPage, StudioVersionType } from "./page.js";
|
|
14
|
+
import { StudioBuilder } from "./builder.js";
|
|
15
|
+
import { StudioLibrary } from "./library.js";
|
|
16
|
+
export { StudioComponentType, StudioFrameType, fingerprintOf, type StudioComponentMeta, type StudioFrameLiteral, } from "./component.js";
|
|
17
|
+
export { StudioCellChangeType, StudioCellType, StudioChangeType, StudioEntryType, StudioKeyType, StudioLiveType, StudioPageEntryType, StudioPageType, StudioPagesHandleType, StudioPagesType, StudioStatusType, saveCells, type StudioPagesHandle, } from "./pages.js";
|
|
18
|
+
export { StudioPage, StudioPageComponent, StudioPagePayloadType, StudioVersionType, type StudioPageOptions, type StudioVersionLiteral, } from "./page.js";
|
|
19
|
+
export { StudioBuilder, StudioBuilderComponent, StudioBuilderPayloadType, type StudioBuilderOptions, } from "./builder.js";
|
|
20
|
+
export { builderKeys, paletteCards, palettePages, PaletteCardType, PalettePageType, } from "./palette.js";
|
|
21
|
+
export { canvasTiles, CanvasTileType, StudioSaveTemplatePayloadType, } from "./canvas.js";
|
|
22
|
+
export { StudioLibrary, StudioLibraryComponent, StudioLibraryPayloadType, StudioLibraryPageType, StudioLibraryTemplateType, libraryProjects, libraryPages, libraryTemplates, layoutSummary, nameWriteRefusal, type StudioLibraryOptions, } from "./library.js";
|
|
23
|
+
export { PublishChangeType, PublishStandingType, PublishSummaryType, StudioPublishPayloadType, publishSummary, publishRefusal, } from "./publish.js";
|
|
24
|
+
export { inspectorSelection, InspectorLayoutType, InspectorSelectionType, StudioInspectorPayloadType, } from "./inspector.js";
|
|
25
|
+
/** The Studio's East types — what a solution declares its pages record with, and seeds it from. */
|
|
26
|
+
export interface StudioTypes {
|
|
27
|
+
/** A Studio component ({@link StudioComponentType}). */
|
|
28
|
+
Component: typeof StudioComponentType;
|
|
29
|
+
/** How a component's placements are drawn ({@link StudioFrameType}). */
|
|
30
|
+
Frame: typeof StudioFrameType;
|
|
31
|
+
/** The pages record's type — every page and template, by key ({@link StudioPagesType}). */
|
|
32
|
+
Pages: typeof StudioPagesType;
|
|
33
|
+
/** A page's key ({@link StudioKeyType}). */
|
|
34
|
+
Key: typeof StudioKeyType;
|
|
35
|
+
/** One entry of the pages record: a page or a template ({@link StudioEntryType}). */
|
|
36
|
+
Entry: typeof StudioEntryType;
|
|
37
|
+
/** A page: its draft and its live version ({@link StudioPageEntryType}). */
|
|
38
|
+
PageEntry: typeof StudioPageEntryType;
|
|
39
|
+
/** A published version of a page ({@link StudioLiveType}). */
|
|
40
|
+
Live: typeof StudioLiveType;
|
|
41
|
+
/** A page's layout: its title and its placements ({@link StudioPageType}). */
|
|
42
|
+
Page: typeof StudioPageType;
|
|
43
|
+
/** One placement on a page ({@link StudioCellType}). */
|
|
44
|
+
Cell: typeof StudioCellType;
|
|
45
|
+
/** Which layout of a page to draw ({@link StudioVersionType}). */
|
|
46
|
+
Version: typeof StudioVersionType;
|
|
47
|
+
}
|
|
48
|
+
/** The type of the {@link Studio} namespace — what a solution mounts and declares. */
|
|
49
|
+
export interface StudioNamespace {
|
|
50
|
+
/** Declares a component: a self-contained East UI function, and what the palette shows of it. */
|
|
51
|
+
component: typeof StudioComponents.component;
|
|
52
|
+
/** `<Studio.Builder>` — the builder: the open page's canvas, the palette and the inspector beside it, and the publish preview. */
|
|
53
|
+
Builder: typeof StudioBuilder;
|
|
54
|
+
/** `<Studio.Library>` — a project's templates and pages, and where new pages start. */
|
|
55
|
+
Library: typeof StudioLibrary;
|
|
56
|
+
/** `<Studio.Page>` — one page with no chrome, its live or draft layout on the snap grid. */
|
|
57
|
+
Page: typeof StudioPage;
|
|
58
|
+
/** The Studio's East types. */
|
|
59
|
+
Types: StudioTypes;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The Studio — components developers publish as code (`Studio.component`),
|
|
63
|
+
* the pages record operators build (`Studio.Types.Pages`), and the components
|
|
64
|
+
* a solution mounts: the builder (`<Studio.Builder>`), the page library
|
|
65
|
+
* (`<Studio.Library>`) and one page (`<Studio.Page>`).
|
|
66
|
+
*/
|
|
67
|
+
export declare const Studio: StudioNamespace;
|
|
68
|
+
/**
|
|
69
|
+
* The type of the internal Studio namespace — the public one, and the page
|
|
70
|
+
* functions behind the builder and the page library.
|
|
71
|
+
*/
|
|
72
|
+
export interface StudioInternalNamespace extends Omit<StudioNamespace, "Types"> {
|
|
73
|
+
/** Saves a page's placements — the builder canvas's Apply, one patch to the page's draft. */
|
|
74
|
+
save: typeof StudioPages.save;
|
|
75
|
+
/** Publishes a page: the patch that makes its draft its next live version, each placement stamped with the code it goes live with. */
|
|
76
|
+
publish: typeof StudioPages.publish;
|
|
77
|
+
/** Reverts a page: the patch that makes its live version's layout its draft. */
|
|
78
|
+
revert: typeof StudioPages.revert;
|
|
79
|
+
/** Starts a page, from a template or blank: the patch that inserts it. */
|
|
80
|
+
newPage: typeof StudioPages.newPage;
|
|
81
|
+
/** Saves a page's draft as a template: the patch that inserts it. */
|
|
82
|
+
saveTemplate: typeof StudioPages.saveTemplate;
|
|
83
|
+
/** The changes from one layout of a page to another. */
|
|
84
|
+
changes: typeof StudioPages.changes;
|
|
85
|
+
/** A page's status: live or draft. */
|
|
86
|
+
status: typeof StudioPages.status;
|
|
87
|
+
/** The Studio's East types, and those of the change list and a page's status. */
|
|
88
|
+
Types: StudioTypes & {
|
|
89
|
+
/** One change between two layouts of a page ({@link StudioChangeType}). */
|
|
90
|
+
Change: typeof StudioChangeType;
|
|
91
|
+
/** One change to a placement ({@link StudioCellChangeType}). */
|
|
92
|
+
CellChange: typeof StudioCellChangeType;
|
|
93
|
+
/** A page's status ({@link StudioStatusType}). */
|
|
94
|
+
Status: typeof StudioStatusType;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The internal Studio namespace — `@elaraai/e3-ui/internal`'s `Studio`: the
|
|
99
|
+
* public namespace, and the page functions the renderers and the tests call.
|
|
100
|
+
*
|
|
101
|
+
* @internal
|
|
102
|
+
*/
|
|
103
|
+
export declare const StudioInternal: StudioInternalNamespace;
|
|
104
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/studio/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EACH,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACH,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,WAAW,EACX,eAAe,EACf,gBAAgB,EACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EACH,mBAAmB,EACnB,eAAe,EACf,aAAa,EACb,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACH,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,KAAK,iBAAiB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EACH,UAAU,EACV,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,GAC5B,MAAM,WAAW,CAAC;AACnB,OAAO,EACH,aAAa,EACb,sBAAsB,EACtB,wBAAwB,EACxB,KAAK,oBAAoB,GAC5B,MAAM,cAAc,CAAC;AACtB,OAAO,EACH,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,eAAe,GAClB,MAAM,cAAc,CAAC;A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AO,aAAa,CAAC;IAC9B,4FAA4F;IAC5F,IAAI,EAAE,OAAO,UAAU,CAAC;IACxB,+BAA+B;IAC/B,KAAK,EAAE,WAAW,CAAC;CACtB;AAeD;;;;;GAKG;AACH,eAAO,MAAM,MAAM,EAAE,eAMpB,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC;IAC3E,6FAA6F;IAC7F,IAAI,EAAE,OAAO,WAAW,CAAC,IAAI,CAAC;IAC9B,sIAAsI;IACtI,OAAO,EAAE,OAAO,WAAW,CAAC,OAAO,CAAC;IACpC,gFAAgF;IAChF,MAAM,EAAE,OAAO,WAAW,CAAC,MAAM,CAAC;IAClC,0EAA0E;IAC1E,OAAO,EAAE,OAAO,WAAW,CAAC,OAAO,CAAC;IACpC,qEAAqE;IACrE,YAAY,EAAE,OAAO,WAAW,CAAC,YAAY,CAAC;IAC9C,wDAAwD;IACxD,OAAO,EAAE,OAAO,WAAW,CAAC,OAAO,CAAC;IACpC,sCAAsC;IACtC,MAAM,EAAE,OAAO,WAAW,CAAC,MAAM,CAAC;IAClC,iFAAiF;IACjF,KAAK,EAAE,WAAW,GAAG;QACjB,2EAA2E;QAC3E,MAAM,EAAE,OAAO,gBAAgB,CAAC;QAChC,gEAAgE;QAChE,UAAU,EAAE,OAAO,oBAAoB,CAAC;QACxC,kDAAkD;QAClD,MAAM,EAAE,OAAO,gBAAgB,CAAC;KACnC,CAAC;CACL;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,uBAkB5B,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
* The Studio (#787) — components developers publish as code, and the pages
|
|
7
|
+
* operators build from them on the 12-column snap grid.
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
import { StudioComponentType, StudioComponents, StudioFrameType, } from "./component.js";
|
|
12
|
+
import { StudioCellChangeType, StudioCellType, StudioChangeType, StudioEntryType, StudioKeyType, StudioLiveType, StudioPageEntryType, StudioPageType, StudioPages, StudioPagesType, StudioStatusType, } from "./pages.js";
|
|
13
|
+
import { StudioPage, StudioVersionType } from "./page.js";
|
|
14
|
+
import { StudioBuilder } from "./builder.js";
|
|
15
|
+
import { StudioLibrary } from "./library.js";
|
|
16
|
+
export { StudioComponentType, StudioFrameType, fingerprintOf, } from "./component.js";
|
|
17
|
+
export { StudioCellChangeType, StudioCellType, StudioChangeType, StudioEntryType, StudioKeyType, StudioLiveType, StudioPageEntryType, StudioPageType, StudioPagesHandleType, StudioPagesType, StudioStatusType, saveCells, } from "./pages.js";
|
|
18
|
+
export { StudioPage, StudioPageComponent, StudioPagePayloadType, StudioVersionType, } from "./page.js";
|
|
19
|
+
export { StudioBuilder, StudioBuilderComponent, StudioBuilderPayloadType, } from "./builder.js";
|
|
20
|
+
export { builderKeys, paletteCards, palettePages, PaletteCardType, PalettePageType, } from "./palette.js";
|
|
21
|
+
export { canvasTiles, CanvasTileType, StudioSaveTemplatePayloadType, } from "./canvas.js";
|
|
22
|
+
export { StudioLibrary, StudioLibraryComponent, StudioLibraryPayloadType, StudioLibraryPageType, StudioLibraryTemplateType, libraryProjects, libraryPages, libraryTemplates, layoutSummary, nameWriteRefusal, } from "./library.js";
|
|
23
|
+
export { PublishChangeType, PublishStandingType, PublishSummaryType, StudioPublishPayloadType, publishSummary, publishRefusal, } from "./publish.js";
|
|
24
|
+
export { inspectorSelection, InspectorLayoutType, InspectorSelectionType, StudioInspectorPayloadType, } from "./inspector.js";
|
|
25
|
+
const types = {
|
|
26
|
+
Component: StudioComponentType,
|
|
27
|
+
Frame: StudioFrameType,
|
|
28
|
+
Pages: StudioPagesType,
|
|
29
|
+
Key: StudioKeyType,
|
|
30
|
+
Entry: StudioEntryType,
|
|
31
|
+
PageEntry: StudioPageEntryType,
|
|
32
|
+
Live: StudioLiveType,
|
|
33
|
+
Page: StudioPageType,
|
|
34
|
+
Cell: StudioCellType,
|
|
35
|
+
Version: StudioVersionType,
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* The Studio — components developers publish as code (`Studio.component`),
|
|
39
|
+
* the pages record operators build (`Studio.Types.Pages`), and the components
|
|
40
|
+
* a solution mounts: the builder (`<Studio.Builder>`), the page library
|
|
41
|
+
* (`<Studio.Library>`) and one page (`<Studio.Page>`).
|
|
42
|
+
*/
|
|
43
|
+
export const Studio = {
|
|
44
|
+
component: StudioComponents.component,
|
|
45
|
+
Builder: StudioBuilder,
|
|
46
|
+
Library: StudioLibrary,
|
|
47
|
+
Page: StudioPage,
|
|
48
|
+
Types: types,
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* The internal Studio namespace — `@elaraai/e3-ui/internal`'s `Studio`: the
|
|
52
|
+
* public namespace, and the page functions the renderers and the tests call.
|
|
53
|
+
*
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
export const StudioInternal = {
|
|
57
|
+
component: StudioComponents.component,
|
|
58
|
+
Builder: StudioBuilder,
|
|
59
|
+
Library: StudioLibrary,
|
|
60
|
+
Page: StudioPage,
|
|
61
|
+
save: StudioPages.save,
|
|
62
|
+
publish: StudioPages.publish,
|
|
63
|
+
revert: StudioPages.revert,
|
|
64
|
+
newPage: StudioPages.newPage,
|
|
65
|
+
saveTemplate: StudioPages.saveTemplate,
|
|
66
|
+
changes: StudioPages.changes,
|
|
67
|
+
status: StudioPages.status,
|
|
68
|
+
Types: {
|
|
69
|
+
...types,
|
|
70
|
+
Change: StudioChangeType,
|
|
71
|
+
CellChange: StudioCellChangeType,
|
|
72
|
+
Status: StudioStatusType,
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/studio/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EACH,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACH,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,WAAW,EACX,eAAe,EACf,gBAAgB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EACH,mBAAmB,EACnB,eAAe,EACf,aAAa,GAGhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACH,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,SAAS,GAEZ,MAAM,YAAY,CAAC;AACpB,OAAO,EACH,UAAU,EACV,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,GAGpB,MAAM,WAAW,CAAC;AACnB,OAAO,EACH,aAAa,EACb,sBAAsB,EACtB,wBAAwB,GAE3B,MAAM,cAAc,CAAC;AACtB,OAAO,EACH,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,eAAe,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EACH,WAAW,EACX,cAAc,EACd,6BAA6B,GAChC,MAAM,aAAa,CAAC;AACrB,OAAO,EACH,aAAa,EACb,sBAAsB,EACtB,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,eAAe,EACf,YAAY,EACZ,gBAA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BAAgB;QACxB,UAAU,EAAE,oBAAoB;QAChC,MAAM,EAAE,gBAAgB;KAC3B;CACJ,CAAC"}
|
|
@@ -0,0 +1,208 @@
|
|
|
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
|
+
* The builder's inspector (#996) — the selected placement's component, what
|
|
7
|
+
* it reads, its description and its layout, computed in East for the
|
|
8
|
+
* `StudioBuilder` renderer, which draws the inspector in its pane after the
|
|
9
|
+
* canvas. It writes no page: a layout edit is a request the canvas takes as
|
|
10
|
+
* one gesture of the page's editing session, undone, redone, discarded and
|
|
11
|
+
* applied with the rest.
|
|
12
|
+
*
|
|
13
|
+
* @packageDocumentation
|
|
14
|
+
*/
|
|
15
|
+
import { ArrayType, BooleanType, FunctionType, IntegerType, NullType, OptionType, StringType, StructType } from "@elaraai/east";
|
|
16
|
+
/**
|
|
17
|
+
* The selected placement's layout, as the canvas draws it.
|
|
18
|
+
*
|
|
19
|
+
* @property span - Its span, in columns of 12
|
|
20
|
+
* @property most - The most span its row leaves it: 12 less the row's other spans
|
|
21
|
+
* @property row - Its row, counting from 1 in the order the rows first appear
|
|
22
|
+
* @property rows - How many rows the page has
|
|
23
|
+
* @property height - Its height in px; `none` is its content's
|
|
24
|
+
* @property align - Where it sits in a taller row
|
|
25
|
+
*/
|
|
26
|
+
export declare const InspectorLayoutType: StructType<{
|
|
27
|
+
readonly span: IntegerType;
|
|
28
|
+
readonly most: IntegerType;
|
|
29
|
+
readonly row: IntegerType;
|
|
30
|
+
readonly rows: IntegerType;
|
|
31
|
+
readonly height: OptionType<IntegerType>;
|
|
32
|
+
readonly align: import("@elaraai/east").VariantType<{
|
|
33
|
+
readonly top: NullType;
|
|
34
|
+
readonly center: NullType;
|
|
35
|
+
readonly stretch: NullType;
|
|
36
|
+
}>;
|
|
37
|
+
}>;
|
|
38
|
+
/** Type representing the selected placement's layout. */
|
|
39
|
+
export type InspectorLayoutType = typeof InspectorLayoutType;
|
|
40
|
+
/**
|
|
41
|
+
* The selected placement, as the inspector shows it.
|
|
42
|
+
*
|
|
43
|
+
* @property key - The placement's key — what a layout request names
|
|
44
|
+
* @property name - Its title, else its component's name, else its component's key
|
|
45
|
+
* @property component - Its component's key
|
|
46
|
+
* @property changed - Its component's code changed since the page went live:
|
|
47
|
+
* its fingerprint differs from the one the live version's cell stored
|
|
48
|
+
* @property reads - The paths of the datasets its component's code reads, whole
|
|
49
|
+
* or a window at a time — the renderer prints each as its keypath (`.inputs.sales_daily`)
|
|
50
|
+
* @property description - Its component's description, fixed by its developer
|
|
51
|
+
* @property layout - Its layout ({@link InspectorLayoutType})
|
|
52
|
+
*/
|
|
53
|
+
export declare const InspectorSelectionType: StructType<{
|
|
54
|
+
readonly key: StringType;
|
|
55
|
+
readonly name: StringType;
|
|
56
|
+
readonly component: StringType;
|
|
57
|
+
readonly changed: BooleanType;
|
|
58
|
+
readonly reads: ArrayType<ArrayType<import("@elaraai/east").VariantType<{
|
|
59
|
+
readonly field: StringType;
|
|
60
|
+
}>>>;
|
|
61
|
+
readonly description: OptionType<StringType>;
|
|
62
|
+
readonly layout: StructType<{
|
|
63
|
+
readonly span: IntegerType;
|
|
64
|
+
readonly most: IntegerType;
|
|
65
|
+
readonly row: IntegerType;
|
|
66
|
+
readonly rows: IntegerType;
|
|
67
|
+
readonly height: OptionType<IntegerType>;
|
|
68
|
+
readonly align: import("@elaraai/east").VariantType<{
|
|
69
|
+
readonly top: NullType;
|
|
70
|
+
readonly center: NullType;
|
|
71
|
+
readonly stretch: NullType;
|
|
72
|
+
}>;
|
|
73
|
+
}>;
|
|
74
|
+
}>;
|
|
75
|
+
/** Type representing the selected placement, as the inspector shows it. */
|
|
76
|
+
export type InspectorSelectionType = typeof InspectorSelectionType;
|
|
77
|
+
/**
|
|
78
|
+
* The inspector, as the `StudioBuilder` renderer draws it.
|
|
79
|
+
*
|
|
80
|
+
* @property selection - The selected placement; `none` when nothing is selected
|
|
81
|
+
* @property onRequest - Asks the canvas for a layout change, which it takes as one gesture
|
|
82
|
+
*/
|
|
83
|
+
export declare const StudioInspectorPayloadType: StructType<{
|
|
84
|
+
readonly selection: OptionType<StructType<{
|
|
85
|
+
readonly key: StringType;
|
|
86
|
+
readonly name: StringType;
|
|
87
|
+
readonly component: StringType;
|
|
88
|
+
readonly changed: BooleanType;
|
|
89
|
+
readonly reads: ArrayType<ArrayType<import("@elaraai/east").VariantType<{
|
|
90
|
+
readonly field: StringType;
|
|
91
|
+
}>>>;
|
|
92
|
+
readonly description: OptionType<StringType>;
|
|
93
|
+
readonly layout: StructType<{
|
|
94
|
+
readonly span: IntegerType;
|
|
95
|
+
readonly most: IntegerType;
|
|
96
|
+
readonly row: IntegerType;
|
|
97
|
+
readonly rows: IntegerType;
|
|
98
|
+
readonly height: OptionType<IntegerType>;
|
|
99
|
+
readonly align: import("@elaraai/east").VariantType<{
|
|
100
|
+
readonly top: NullType;
|
|
101
|
+
readonly center: NullType;
|
|
102
|
+
readonly stretch: NullType;
|
|
103
|
+
}>;
|
|
104
|
+
}>;
|
|
105
|
+
}>>;
|
|
106
|
+
readonly onRequest: FunctionType<[StructType<{
|
|
107
|
+
readonly key: StringType;
|
|
108
|
+
readonly change: import("@elaraai/east").VariantType<{
|
|
109
|
+
readonly span: IntegerType;
|
|
110
|
+
readonly row: IntegerType;
|
|
111
|
+
readonly height: OptionType<IntegerType>;
|
|
112
|
+
readonly align: import("@elaraai/east").VariantType<{
|
|
113
|
+
readonly top: NullType;
|
|
114
|
+
readonly center: NullType;
|
|
115
|
+
readonly stretch: NullType;
|
|
116
|
+
}>;
|
|
117
|
+
}>;
|
|
118
|
+
}>], NullType>;
|
|
119
|
+
}>;
|
|
120
|
+
/** Type representing the inspector, as the builder draws it. */
|
|
121
|
+
export type StudioInspectorPayloadType = typeof StudioInspectorPayloadType;
|
|
122
|
+
/**
|
|
123
|
+
* The selected placement, as the inspector shows it — `none` when nothing is
|
|
124
|
+
* selected, or the page has no placement under the selected key.
|
|
125
|
+
*
|
|
126
|
+
* @remarks
|
|
127
|
+
* `cells` are the page's placements as the canvas draws them, its unsaved
|
|
128
|
+
* drafts in place; `live` the live version's, whose fingerprints say whether a
|
|
129
|
+
* component's code changed since the page went live — a placement the live
|
|
130
|
+
* version does not hold has not gone live, and has not changed. A placement
|
|
131
|
+
* whose component the surface does not list is named by its component's key,
|
|
132
|
+
* reads nothing and has no description.
|
|
133
|
+
*/
|
|
134
|
+
export declare const inspectorSelection: import("@elaraai/east").CallableFunctionExpr<[ArrayType<StructType<{
|
|
135
|
+
readonly key: StringType;
|
|
136
|
+
readonly name: StringType;
|
|
137
|
+
readonly category: StringType;
|
|
138
|
+
readonly icon: StringType;
|
|
139
|
+
readonly span: IntegerType;
|
|
140
|
+
readonly description: OptionType<StringType>;
|
|
141
|
+
readonly frame: import("@elaraai/east").VariantType<{
|
|
142
|
+
readonly card: NullType;
|
|
143
|
+
readonly none: NullType;
|
|
144
|
+
}>;
|
|
145
|
+
readonly tags: ArrayType<StringType>;
|
|
146
|
+
readonly collections: ArrayType<StringType>;
|
|
147
|
+
readonly deprecated: BooleanType;
|
|
148
|
+
readonly reads: StructType<{
|
|
149
|
+
readonly paths: ArrayType<ArrayType<import("@elaraai/east").VariantType<{
|
|
150
|
+
readonly field: StringType;
|
|
151
|
+
}>>>;
|
|
152
|
+
readonly functions: ArrayType<StringType>;
|
|
153
|
+
readonly records: ArrayType<StringType>;
|
|
154
|
+
readonly pages: ArrayType<ArrayType<import("@elaraai/east").VariantType<{
|
|
155
|
+
readonly field: StringType;
|
|
156
|
+
}>>>;
|
|
157
|
+
}>;
|
|
158
|
+
readonly fingerprint: StringType;
|
|
159
|
+
readonly render: FunctionType<[], import("@elaraai/east").RecursiveType<import("@elaraai/east-ui").UIComponentNode>>;
|
|
160
|
+
}>>, ArrayType<StructType<{
|
|
161
|
+
readonly key: StringType;
|
|
162
|
+
readonly row: StringType;
|
|
163
|
+
readonly span: IntegerType;
|
|
164
|
+
readonly height: OptionType<IntegerType>;
|
|
165
|
+
readonly align: import("@elaraai/east").VariantType<{
|
|
166
|
+
readonly top: NullType;
|
|
167
|
+
readonly center: NullType;
|
|
168
|
+
readonly stretch: NullType;
|
|
169
|
+
}>;
|
|
170
|
+
readonly title: OptionType<StringType>;
|
|
171
|
+
readonly component: StringType;
|
|
172
|
+
readonly fingerprint: StringType;
|
|
173
|
+
}>>, OptionType<ArrayType<StructType<{
|
|
174
|
+
readonly key: StringType;
|
|
175
|
+
readonly row: StringType;
|
|
176
|
+
readonly span: IntegerType;
|
|
177
|
+
readonly height: OptionType<IntegerType>;
|
|
178
|
+
readonly align: import("@elaraai/east").VariantType<{
|
|
179
|
+
readonly top: NullType;
|
|
180
|
+
readonly center: NullType;
|
|
181
|
+
readonly stretch: NullType;
|
|
182
|
+
}>;
|
|
183
|
+
readonly title: OptionType<StringType>;
|
|
184
|
+
readonly component: StringType;
|
|
185
|
+
readonly fingerprint: StringType;
|
|
186
|
+
}>>>, OptionType<StringType>], OptionType<StructType<{
|
|
187
|
+
readonly key: StringType;
|
|
188
|
+
readonly name: StringType;
|
|
189
|
+
readonly component: StringType;
|
|
190
|
+
readonly changed: BooleanType;
|
|
191
|
+
readonly reads: ArrayType<ArrayType<import("@elaraai/east").VariantType<{
|
|
192
|
+
readonly field: StringType;
|
|
193
|
+
}>>>;
|
|
194
|
+
readonly description: OptionType<StringType>;
|
|
195
|
+
readonly layout: StructType<{
|
|
196
|
+
readonly span: IntegerType;
|
|
197
|
+
readonly most: IntegerType;
|
|
198
|
+
readonly row: IntegerType;
|
|
199
|
+
readonly rows: IntegerType;
|
|
200
|
+
readonly height: OptionType<IntegerType>;
|
|
201
|
+
readonly align: import("@elaraai/east").VariantType<{
|
|
202
|
+
readonly top: NullType;
|
|
203
|
+
readonly center: NullType;
|
|
204
|
+
readonly stretch: NullType;
|
|
205
|
+
}>;
|
|
206
|
+
}>;
|
|
207
|
+
}>>>;
|
|
208
|
+
//# sourceMappingURL=inspector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspector.d.ts","sourceRoot":"","sources":["../../../src/studio/inspector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;GASG;AAEH,OAAO,EACH,SAAS,EACT,WAAW,EAEX,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,UAAU,EAEV,UAAU,EACV,UAAU,EAGb,MAAM,eAAe,CAAC;AAUvB;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;EAO9B,CAAC;AAEH,yDAAyD;AACzD,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAC;AAE7D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;EAQjC,CAAC;AAEH,2EAA2E;AAC3E,MAAM,MAAM,sBAAsB,GAAG,OAAO,sBAAsB,CAAC;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGrC,CAAC;AAEH,gEAAgE;AAChE,MAAM,MAAM,0BAA0B,GAAG,OAAO,0BAA0B,CAAC;AAE3E;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkF9B,CAAC"}
|