@elaraai/e3-ui 1.0.83 → 1.0.84

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.
Files changed (69) hide show
  1. package/dist/src/bind/record.d.ts +229 -4
  2. package/dist/src/bind/record.d.ts.map +1 -1
  3. package/dist/src/bind/record.js +245 -5
  4. package/dist/src/bind/record.js.map +1 -1
  5. package/dist/src/index.d.ts +2 -1
  6. package/dist/src/index.d.ts.map +1 -1
  7. package/dist/src/index.js +4 -1
  8. package/dist/src/index.js.map +1 -1
  9. package/dist/src/internal.d.ts +2 -1
  10. package/dist/src/internal.d.ts.map +1 -1
  11. package/dist/src/internal.js +5 -1
  12. package/dist/src/internal.js.map +1 -1
  13. package/dist/src/studio/builder.d.ts +3123 -0
  14. package/dist/src/studio/builder.d.ts.map +1 -0
  15. package/dist/src/studio/builder.js +115 -0
  16. package/dist/src/studio/builder.js.map +1 -0
  17. package/dist/src/studio/canvas.d.ts +83 -0
  18. package/dist/src/studio/canvas.d.ts.map +1 -0
  19. package/dist/src/studio/canvas.js +71 -0
  20. package/dist/src/studio/canvas.js.map +1 -0
  21. package/dist/src/studio/component.d.ts +178 -0
  22. package/dist/src/studio/component.d.ts.map +1 -0
  23. package/dist/src/studio/component.js +189 -0
  24. package/dist/src/studio/component.js.map +1 -0
  25. package/dist/src/studio/index.d.ts +104 -0
  26. package/dist/src/studio/index.d.ts.map +1 -0
  27. package/dist/src/studio/index.js +75 -0
  28. package/dist/src/studio/index.js.map +1 -0
  29. package/dist/src/studio/inspector.d.ts +208 -0
  30. package/dist/src/studio/inspector.d.ts.map +1 -0
  31. package/dist/src/studio/inspector.js +155 -0
  32. package/dist/src/studio/inspector.js.map +1 -0
  33. package/dist/src/studio/library.d.ts +3506 -0
  34. package/dist/src/studio/library.d.ts.map +1 -0
  35. package/dist/src/studio/library.js +245 -0
  36. package/dist/src/studio/library.js.map +1 -0
  37. package/dist/src/studio/page.d.ts +305 -0
  38. package/dist/src/studio/page.d.ts.map +1 -0
  39. package/dist/src/studio/page.js +105 -0
  40. package/dist/src/studio/page.js.map +1 -0
  41. package/dist/src/studio/pages.d.ts +10929 -0
  42. package/dist/src/studio/pages.d.ts.map +1 -0
  43. package/dist/src/studio/pages.js +502 -0
  44. package/dist/src/studio/pages.js.map +1 -0
  45. package/dist/src/studio/palette.d.ts +179 -0
  46. package/dist/src/studio/palette.d.ts.map +1 -0
  47. package/dist/src/studio/palette.js +120 -0
  48. package/dist/src/studio/palette.js.map +1 -0
  49. package/dist/src/studio/publish.d.ts +397 -0
  50. package/dist/src/studio/publish.d.ts.map +1 -0
  51. package/dist/src/studio/publish.js +198 -0
  52. package/dist/src/studio/publish.js.map +1 -0
  53. package/dist/test/bind/record/record.examples.d.ts +65 -1
  54. package/dist/test/bind/record/record.examples.d.ts.map +1 -1
  55. package/dist/test/bind/record/record.examples.js +21 -3
  56. package/dist/test/bind/record/record.examples.js.map +1 -1
  57. package/dist/test/studio/component.examples.d.ts +7 -0
  58. package/dist/test/studio/component.examples.d.ts.map +1 -0
  59. package/dist/test/studio/component.examples.js +46 -0
  60. package/dist/test/studio/component.examples.js.map +1 -0
  61. package/dist/test/studio/page.examples.d.ts +7 -0
  62. package/dist/test/studio/page.examples.d.ts.map +1 -0
  63. package/dist/test/studio/page.examples.js +64 -0
  64. package/dist/test/studio/page.examples.js.map +1 -0
  65. package/dist/test/studio/studio.examples.d.ts +1766 -0
  66. package/dist/test/studio/studio.examples.d.ts.map +1 -0
  67. package/dist/test/studio/studio.examples.js +354 -0
  68. package/dist/test/studio/studio.examples.js.map +1 -0
  69. package/package.json +9 -8
@@ -0,0 +1 @@
1
+ {"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../src/studio/library.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACH,SAAS,EACT,WAAW,EACX,QAAQ,EAER,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,U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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAkF,CAAC;AAMtH;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAoB;IACjC,4FAA4F;IAC5F,KAAK,EAAE,iBAAiB,CAAC;IACzB,wEAAwE;IACxE,UAAU,EAAE,kBAAkB,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC/D,kCAAkC;IAClC,OAAO,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC;IACxC,qGAAqG;IACrG,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,wFAAwF;IACxF,MAAM,CAAC,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC,aAAa,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;CACxE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,iBAAS,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,QAAQ,CAAC,eAAe,CAAC,CAQ/E;AAMD;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,YAAY,CAAC,OAAO,aAAa,CAAC,CAA6B,CAAC"}
@@ -0,0 +1,245 @@
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.Library>` (#997) — a project's templates and pages, and where
7
+ * new pages start.
8
+ *
9
+ * The page library is a component of its own, apart from the builder: an
10
+ * interface — the pages record bound with its patch, the listed components,
11
+ * the project it shows first, the builder it opens pages in, and who to tell —
12
+ * which the `StudioLibrary` renderer draws, headerless with one toolbar: the
13
+ * search over both rows, Sort · Name, the pages' Grid · List and the primary
14
+ * "+ New page in <project>"; beside it the projects the record holds and the
15
+ * project's pages; under it the Templates — Blank grid, then the project's
16
+ * templates — and the Pages, each card a wireframe of its layout.
17
+ *
18
+ * A new page — from the toolbar's button, the dashed last card or a template's
19
+ * card — takes a name and a template, and is one commit on the record.
20
+ * "Open in builder →" opens a page in the builder: it writes the builder's
21
+ * open page ({@link builderKeys}) and tells the host.
22
+ *
23
+ * @packageDocumentation
24
+ */
25
+ import { ArrayType, BooleanType, DictType, East, FunctionType, IntegerType, NullType, OptionType, SetType, StringType, StructType, none, some, } from "@elaraai/east";
26
+ import { EastUI, optionsTag, } from "@elaraai/east-ui/internal";
27
+ import { RecordOutcomeType } from "../bind/record.js";
28
+ import { StudioComponentType } from "./component.js";
29
+ import { StudioCellType, StudioKeyType, StudioPagesHandleType, StudioPagesType, pageStatus } from "./pages.js";
30
+ // ============================================================================
31
+ // Types
32
+ // ============================================================================
33
+ /**
34
+ * A page of the project, as the page library's Pages row draws it.
35
+ *
36
+ * @property page - The page's name in the project
37
+ * @property title - Its title
38
+ * @property live - Whether it is live: published, its draft its live layout
39
+ * @property cells - Its draft's placements — its card's wireframe
40
+ */
41
+ export const StudioLibraryPageType = StructType({
42
+ page: StringType,
43
+ title: StringType,
44
+ live: BooleanType,
45
+ cells: ArrayType(StudioCellType),
46
+ });
47
+ /**
48
+ * A template, as the page library's Templates row draws it.
49
+ *
50
+ * @property name - The template's name in the project; `""` for Blank grid
51
+ * @property title - Its title
52
+ * @property summary - What it places — "KPI rail ×4 · Revenue trend"
53
+ * @property cells - Its placements — its card's wireframe
54
+ */
55
+ export const StudioLibraryTemplateType = StructType({
56
+ name: StringType,
57
+ title: StringType,
58
+ summary: StringType,
59
+ cells: ArrayType(StudioCellType),
60
+ });
61
+ /**
62
+ * The `StudioLibrary` renderer's payload — the page library's interface.
63
+ *
64
+ * @property pages - The pages record, bound with its patch — what it reads, and a new page commits through
65
+ * @property components - The components the surface lists — what a layout's summary names
66
+ * @property project - The project it shows first
67
+ * @property id - Names the builder whose open page it writes; `none` for the one builder
68
+ * @property onOpen - Told when a page opens in the builder, with its key — the host shows the builder
69
+ */
70
+ export const StudioLibraryPayloadType = StructType({
71
+ pages: StudioPagesHandleType,
72
+ components: ArrayType(StudioComponentType),
73
+ project: StringType,
74
+ id: OptionType(StringType),
75
+ onOpen: OptionType(FunctionType([StudioKeyType], NullType)),
76
+ });
77
+ // ============================================================================
78
+ // What the page library shows
79
+ // ============================================================================
80
+ /** The projects the record holds, and the surface's own, in name order. */
81
+ export const libraryProjects = East.function([StudioPagesType, StringType], ArrayType(StringType), ($, pages, home) => {
82
+ const projects = $.let(new Set(), SetType(StringType));
83
+ $(projects.insert(home));
84
+ $.for(pages, ($2, _entry, key) => {
85
+ $2(projects.tryInsert(key.project));
86
+ });
87
+ const listed = $.let([], ArrayType(StringType));
88
+ $.for(projects, ($2, project) => {
89
+ $2(listed.pushLast(project));
90
+ });
91
+ return listed;
92
+ });
93
+ /**
94
+ * What a layout places, as its card's meta line says: each component's name,
95
+ * counted when it is placed more than once — "KPI rail ×4 · Revenue trend" —
96
+ * in the order they first appear. A component the surface does not list is
97
+ * named by its key.
98
+ */
99
+ export const layoutSummary = East.function([ArrayType(StudioComponentType), ArrayType(StudioCellType)], StringType, ($, components, cells) => {
100
+ const order = $.let([], ArrayType(StringType));
101
+ const counts = $.let(new Map(), DictType(StringType, IntegerType));
102
+ $.for(cells, ($2, cell) => {
103
+ $2.if(counts.has(cell.component).not(), ($3) => {
104
+ $3(order.pushLast(cell.component));
105
+ });
106
+ $2(counts.insertOrUpdate(cell.component, 1n, (_$3, n) => n.add(1n)));
107
+ });
108
+ const parts = $.let([], ArrayType(StringType));
109
+ $.for(order, ($2, key) => {
110
+ const name = $2.let(components.firstMap((_$3, c) => c.key.equal(key).ifElse(() => East.value(some(c.name), OptionType(StringType)), () => East.value(none, OptionType(StringType)))).match({
111
+ some: (_$3, found) => found,
112
+ none: (_$3) => key,
113
+ }));
114
+ const count = $2.let(counts.get(key));
115
+ $2(parts.pushLast(count.greater(1n).ifElse(() => East.str `${name} ×${East.print(count)}`, () => name)));
116
+ });
117
+ return parts.stringJoin(" · ");
118
+ });
119
+ /** A project's pages, in name order: each one's name, title, whether it is live, and its draft's placements. */
120
+ export const libraryPages = East.function([StudioPagesType, StringType], ArrayType(StudioLibraryPageType), ($, pages, project) => {
121
+ const listed = $.let([], ArrayType(StudioLibraryPageType));
122
+ $.for(pages, ($2, entry, key) => {
123
+ $2.if(key.project.equal(project), ($3) => {
124
+ $3.match(entry, {
125
+ page: ($4, page) => {
126
+ $4(listed.pushLast({
127
+ page: key.page,
128
+ title: page.draft.title,
129
+ live: pageStatus(page).hasTag("live"),
130
+ cells: page.draft.cells,
131
+ }));
132
+ },
133
+ });
134
+ });
135
+ });
136
+ return listed;
137
+ });
138
+ /** A project's templates, in name order, each with what it places. */
139
+ export const libraryTemplates = East.function([StudioPagesType, StringType, ArrayType(StudioComponentType)], ArrayType(StudioLibraryTemplateType), ($, pages, project, components) => {
140
+ const listed = $.let([], ArrayType(StudioLibraryTemplateType));
141
+ $.for(pages, ($2, entry, key) => {
142
+ $2.if(key.project.equal(project), ($3) => {
143
+ $3.match(entry, {
144
+ template: ($4, layout) => {
145
+ $4(listed.pushLast({
146
+ name: key.page,
147
+ title: layout.title,
148
+ summary: layoutSummary(components, layout.cells),
149
+ cells: layout.cells,
150
+ }));
151
+ },
152
+ });
153
+ });
154
+ });
155
+ return listed;
156
+ });
157
+ /**
158
+ * What refused a write that makes an entry under a new name — a new page, a
159
+ * template — or `none` when it committed. A name another write took first is
160
+ * a conflict; a write that got no answer may have committed, and says so.
161
+ */
162
+ export const nameWriteRefusal = East.function([RecordOutcomeType, StringType], OptionType(StringType), ($, outcome, name) => {
163
+ const refused = $.let(none, OptionType(StringType));
164
+ $.match(outcome, {
165
+ conflict: ($2) => { $2.assign(refused, some(East.str `Another write took the name ${name} first — choose another`)); },
166
+ invalid: ($2, refusal) => { $2.assign(refused, some(refusal.message)); },
167
+ failed: ($2, refusal) => { $2.assign(refused, some(East.str `The write failed: ${refusal.stderr}`)); },
168
+ timed_out: ($2) => { $2.assign(refused, some("The write ran out of time and wrote nothing")); },
169
+ transport: ($2, lost) => { $2.assign(refused, some(East.str `The write got no answer, so it may have been made — ${lost.message}`)); },
170
+ });
171
+ return refused;
172
+ });
173
+ // ============================================================================
174
+ // The renderer's carrier
175
+ // ============================================================================
176
+ /**
177
+ * Internal {@link EastUI.component} carrier. The React renderer registers
178
+ * against this in `@elaraai/e3-ui-components` via `implementUIComponent`.
179
+ */
180
+ export const StudioLibraryComponent = EastUI.component("StudioLibrary", StudioLibraryPayloadType, { optional: true });
181
+ /**
182
+ * A project's templates and pages, and where new pages start.
183
+ *
184
+ * @remarks
185
+ * - **The toolbar**, one row: the search "Search N pages and M templates…",
186
+ * which narrows both rows by title; Sort · Name, A to Z (the record's key
187
+ * order) or Z to A; the Pages row's Grid · List; and "+ New page in
188
+ * <project>".
189
+ * - **The pane**: the projects the record holds, the one shown in the brand;
190
+ * then the project's pages, each with its status dot — ● live, ○ draft —
191
+ * the one open in the builder in the strong ink, a click opening one in the
192
+ * builder; and the legend.
193
+ * - **Templates**, "clone to start a page": Blank grid, then the project's
194
+ * templates, four across, each with its wireframe, its title and what it
195
+ * places; a click starts a new page from it.
196
+ * - **Pages**, "N in <project>": two across, each with its wireframe at its
197
+ * start, its title and status, how many components it places, and "Open in
198
+ * builder →"; a dashed card last starts a new page.
199
+ * - **A new page** takes a name the project does not hold and a template, or
200
+ * Blank grid, in a popover under the New page button — which a template's
201
+ * card and the dashed card open too, their template picked — and is one
202
+ * commit on the record; a name another write took first is refused in the
203
+ * popover.
204
+ *
205
+ * The project shown, the search, the order and the Pages row's layout are the
206
+ * page library's own; the page it opens is the builder's, shared by `id` with
207
+ * a `<Studio.Builder>`. The page library draws no border around itself.
208
+ *
209
+ * @param options - The bound record, the listed components and the project ({@link StudioLibraryOptions})
210
+ * @returns An East expression of type `UIComponentType`
211
+ *
212
+ * @example
213
+ * ```tsx
214
+ * import { East } from "@elaraai/east";
215
+ * import { Reactive, UIComponentType } from "@elaraai/east-ui";
216
+ * import { Record, Studio, ui } from "@elaraai/e3-ui";
217
+ *
218
+ * // The page library: the project's pages and templates, and where new pages start.
219
+ * export const library = ui("library", [], East.function([], UIComponentType, _$ => (
220
+ * <Reactive>{$ => {
221
+ * const components = $.let([kpiRail, revenueTrend, breakdownBars]);
222
+ * const pages = $.let(Record.bind(d.pages, [d.pagesPatch]));
223
+ * return <Studio.Library pages={pages} components={components} project="Ops console" />;
224
+ * }}</Reactive>
225
+ * )));
226
+ * ```
227
+ */
228
+ function createLibrary(options) {
229
+ return StudioLibraryComponent.Root({
230
+ pages: { read: options.pages.read, history: options.pages.history, commit: { patch: options.pages.commit.patch } },
231
+ components: options.components,
232
+ project: options.project,
233
+ id: options.id === undefined ? none : some(options.id),
234
+ onOpen: options.onOpen === undefined ? none : some(options.onOpen),
235
+ });
236
+ }
237
+ // ============================================================================
238
+ // Tag
239
+ // ============================================================================
240
+ /**
241
+ * `<Studio.Library>` — a project's templates and pages, and where new
242
+ * pages start. See {@link createLibrary}.
243
+ */
244
+ export const StudioLibrary = optionsTag(createLibrary);
245
+ //# sourceMappingURL=library.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"library.js","sourceRoot":"","sources":["../../../src/studio/library.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACH,SAAS,EACT,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,UAAU,EACV,OAAO,EACP,UAAU,EACV,UAAU,EACV,IAAI,EACJ,IAAI,GAGP,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,MAAM,EACN,UAAU,GAIb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,qBAAqB,EAAE,eAAe,EAAE,UAAU,EAA0B,MAAM,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AC,IAAI,CAAC;QAC/B,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE;QAClH,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,EAAE,EAAE,OAAO,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACtD,MAAM,EAAE,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;KACrE,CAAC,CAAC;AACP,CAAC;AAED,+EAA+E;AAC/E,MAAM;AACN,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAA+C,UAAU,CAAC,aAAa,CAAC,CAAC"}
@@ -0,0 +1,305 @@
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.Page>` (#993) — a page as operators see it. It reads the pages
7
+ * record's value and never writes it.
8
+ *
9
+ * The page is an interface — the record's value, the listed components, the
10
+ * page's key and which of its layouts to draw — and the `StudioPage` renderer
11
+ * draws it: the layout's placements on the snap grid, each its component's own
12
+ * UI, so a surface's `ui()` task holds every listed component's reads. A
13
+ * solution places it where it wants, in a layout of its own.
14
+ *
15
+ * @packageDocumentation
16
+ */
17
+ import { ArrayType, NullType, StructType, VariantType, type ExprType, type SubtypeExprOrValue } from "@elaraai/east";
18
+ import { type JsxTag, type OptionsProps, type UIComponentType } from "@elaraai/east-ui/internal";
19
+ import { StudioComponentType } from "./component.js";
20
+ import { StudioKeyType, StudioPagesType } from "./pages.js";
21
+ /**
22
+ * Which layout of a page to draw.
23
+ *
24
+ * @property live - The published version — what a published page shows
25
+ * @property draft - The layout as last saved — what the builder edits
26
+ */
27
+ export declare const StudioVersionType: VariantType<{
28
+ readonly live: NullType;
29
+ readonly draft: NullType;
30
+ }>;
31
+ /** Type representing which layout of a page to draw. */
32
+ export type StudioVersionType = typeof StudioVersionType;
33
+ /** Literal shorthand for {@link StudioVersionType}. */
34
+ export type StudioVersionLiteral = "live" | "draft";
35
+ /**
36
+ * The `StudioPage` renderer's payload — one page, to draw.
37
+ *
38
+ * @property pages - The pages record's value
39
+ * @property components - The components the surface lists
40
+ * @property page - The page's key
41
+ * @property version - Which of its layouts to draw
42
+ */
43
+ export declare const StudioPagePayloadType: StructType<{
44
+ readonly pages: import("@elaraai/east").DictType<StructType<{
45
+ readonly project: import("@elaraai/east").StringType;
46
+ readonly page: import("@elaraai/east").StringType;
47
+ }>, VariantType<{
48
+ readonly page: StructType<{
49
+ readonly draft: StructType<{
50
+ readonly title: import("@elaraai/east").StringType;
51
+ readonly cells: ArrayType<StructType<{
52
+ readonly key: import("@elaraai/east").StringType;
53
+ readonly row: import("@elaraai/east").StringType;
54
+ readonly span: import("@elaraai/east").IntegerType;
55
+ readonly height: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
56
+ readonly align: VariantType<{
57
+ readonly top: NullType;
58
+ readonly center: NullType;
59
+ readonly stretch: NullType;
60
+ }>;
61
+ readonly title: import("@elaraai/east").OptionType<import("@elaraai/east").StringType>;
62
+ readonly component: import("@elaraai/east").StringType;
63
+ readonly fingerprint: import("@elaraai/east").StringType;
64
+ }>>;
65
+ }>;
66
+ readonly live: import("@elaraai/east").OptionType<StructType<{
67
+ readonly version: import("@elaraai/east").IntegerType;
68
+ readonly page: StructType<{
69
+ readonly title: import("@elaraai/east").StringType;
70
+ readonly cells: ArrayType<StructType<{
71
+ readonly key: import("@elaraai/east").StringType;
72
+ readonly row: import("@elaraai/east").StringType;
73
+ readonly span: import("@elaraai/east").IntegerType;
74
+ readonly height: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
75
+ readonly align: VariantType<{
76
+ readonly top: NullType;
77
+ readonly center: NullType;
78
+ readonly stretch: NullType;
79
+ }>;
80
+ readonly title: import("@elaraai/east").OptionType<import("@elaraai/east").StringType>;
81
+ readonly component: import("@elaraai/east").StringType;
82
+ readonly fingerprint: import("@elaraai/east").StringType;
83
+ }>>;
84
+ }>;
85
+ }>>;
86
+ }>;
87
+ readonly template: StructType<{
88
+ readonly title: import("@elaraai/east").StringType;
89
+ readonly cells: ArrayType<StructType<{
90
+ readonly key: import("@elaraai/east").StringType;
91
+ readonly row: import("@elaraai/east").StringType;
92
+ readonly span: import("@elaraai/east").IntegerType;
93
+ readonly height: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
94
+ readonly align: VariantType<{
95
+ readonly top: NullType;
96
+ readonly center: NullType;
97
+ readonly stretch: NullType;
98
+ }>;
99
+ readonly title: import("@elaraai/east").OptionType<import("@elaraai/east").StringType>;
100
+ readonly component: import("@elaraai/east").StringType;
101
+ readonly fingerprint: import("@elaraai/east").StringType;
102
+ }>>;
103
+ }>;
104
+ }>>;
105
+ readonly components: ArrayType<StructType<{
106
+ readonly key: import("@elaraai/east").StringType;
107
+ readonly name: import("@elaraai/east").StringType;
108
+ readonly category: import("@elaraai/east").StringType;
109
+ readonly icon: import("@elaraai/east").StringType;
110
+ readonly span: import("@elaraai/east").IntegerType;
111
+ readonly description: import("@elaraai/east").OptionType<import("@elaraai/east").StringType>;
112
+ readonly frame: VariantType<{
113
+ readonly card: NullType;
114
+ readonly none: NullType;
115
+ }>;
116
+ readonly tags: ArrayType<import("@elaraai/east").StringType>;
117
+ readonly collections: ArrayType<import("@elaraai/east").StringType>;
118
+ readonly deprecated: import("@elaraai/east").BooleanType;
119
+ readonly reads: StructType<{
120
+ readonly paths: ArrayType<ArrayType<VariantType<{
121
+ readonly field: import("@elaraai/east").StringType;
122
+ }>>>;
123
+ readonly functions: ArrayType<import("@elaraai/east").StringType>;
124
+ readonly records: ArrayType<import("@elaraai/east").StringType>;
125
+ readonly pages: ArrayType<ArrayType<VariantType<{
126
+ readonly field: import("@elaraai/east").StringType;
127
+ }>>>;
128
+ }>;
129
+ readonly fingerprint: import("@elaraai/east").StringType;
130
+ readonly render: import("@elaraai/east").FunctionType<[], import("@elaraai/east").RecursiveType<import("@elaraai/east-ui").UIComponentNode>>;
131
+ }>>;
132
+ readonly page: StructType<{
133
+ readonly project: import("@elaraai/east").StringType;
134
+ readonly page: import("@elaraai/east").StringType;
135
+ }>;
136
+ readonly version: VariantType<{
137
+ readonly live: NullType;
138
+ readonly draft: NullType;
139
+ }>;
140
+ }>;
141
+ /** Type representing the `StudioPage` renderer's payload. */
142
+ export type StudioPagePayloadType = typeof StudioPagePayloadType;
143
+ /**
144
+ * Internal {@link EastUI.component} carrier. The React renderer registers
145
+ * against this in `@elaraai/e3-ui-components` via `implementUIComponent`.
146
+ */
147
+ export declare const StudioPageComponent: import("@elaraai/east-ui/internal").UIComponentDef<StructType<{
148
+ readonly pages: import("@elaraai/east").DictType<StructType<{
149
+ readonly project: import("@elaraai/east").StringType;
150
+ readonly page: import("@elaraai/east").StringType;
151
+ }>, VariantType<{
152
+ readonly page: StructType<{
153
+ readonly draft: StructType<{
154
+ readonly title: import("@elaraai/east").StringType;
155
+ readonly cells: ArrayType<StructType<{
156
+ readonly key: import("@elaraai/east").StringType;
157
+ readonly row: import("@elaraai/east").StringType;
158
+ readonly span: import("@elaraai/east").IntegerType;
159
+ readonly height: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
160
+ readonly align: VariantType<{
161
+ readonly top: NullType;
162
+ readonly center: NullType;
163
+ readonly stretch: NullType;
164
+ }>;
165
+ readonly title: import("@elaraai/east").OptionType<import("@elaraai/east").StringType>;
166
+ readonly component: import("@elaraai/east").StringType;
167
+ readonly fingerprint: import("@elaraai/east").StringType;
168
+ }>>;
169
+ }>;
170
+ readonly live: import("@elaraai/east").OptionType<StructType<{
171
+ readonly version: import("@elaraai/east").IntegerType;
172
+ readonly page: StructType<{
173
+ readonly title: import("@elaraai/east").StringType;
174
+ readonly cells: ArrayType<StructType<{
175
+ readonly key: import("@elaraai/east").StringType;
176
+ readonly row: import("@elaraai/east").StringType;
177
+ readonly span: import("@elaraai/east").IntegerType;
178
+ readonly height: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
179
+ readonly align: VariantType<{
180
+ readonly top: NullType;
181
+ readonly center: NullType;
182
+ readonly stretch: NullType;
183
+ }>;
184
+ readonly title: import("@elaraai/east").OptionType<import("@elaraai/east").StringType>;
185
+ readonly component: import("@elaraai/east").StringType;
186
+ readonly fingerprint: import("@elaraai/east").StringType;
187
+ }>>;
188
+ }>;
189
+ }>>;
190
+ }>;
191
+ readonly template: StructType<{
192
+ readonly title: import("@elaraai/east").StringType;
193
+ readonly cells: ArrayType<StructType<{
194
+ readonly key: import("@elaraai/east").StringType;
195
+ readonly row: import("@elaraai/east").StringType;
196
+ readonly span: import("@elaraai/east").IntegerType;
197
+ readonly height: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
198
+ readonly align: VariantType<{
199
+ readonly top: NullType;
200
+ readonly center: NullType;
201
+ readonly stretch: NullType;
202
+ }>;
203
+ readonly title: import("@elaraai/east").OptionType<import("@elaraai/east").StringType>;
204
+ readonly component: import("@elaraai/east").StringType;
205
+ readonly fingerprint: import("@elaraai/east").StringType;
206
+ }>>;
207
+ }>;
208
+ }>>;
209
+ readonly components: ArrayType<StructType<{
210
+ readonly key: import("@elaraai/east").StringType;
211
+ readonly name: import("@elaraai/east").StringType;
212
+ readonly category: import("@elaraai/east").StringType;
213
+ readonly icon: import("@elaraai/east").StringType;
214
+ readonly span: import("@elaraai/east").IntegerType;
215
+ readonly description: import("@elaraai/east").OptionType<import("@elaraai/east").StringType>;
216
+ readonly frame: VariantType<{
217
+ readonly card: NullType;
218
+ readonly none: NullType;
219
+ }>;
220
+ readonly tags: ArrayType<import("@elaraai/east").StringType>;
221
+ readonly collections: ArrayType<import("@elaraai/east").StringType>;
222
+ readonly deprecated: import("@elaraai/east").BooleanType;
223
+ readonly reads: StructType<{
224
+ readonly paths: ArrayType<ArrayType<VariantType<{
225
+ readonly field: import("@elaraai/east").StringType;
226
+ }>>>;
227
+ readonly functions: ArrayType<import("@elaraai/east").StringType>;
228
+ readonly records: ArrayType<import("@elaraai/east").StringType>;
229
+ readonly pages: ArrayType<ArrayType<VariantType<{
230
+ readonly field: import("@elaraai/east").StringType;
231
+ }>>>;
232
+ }>;
233
+ readonly fingerprint: import("@elaraai/east").StringType;
234
+ readonly render: import("@elaraai/east").FunctionType<[], import("@elaraai/east").RecursiveType<import("@elaraai/east-ui").UIComponentNode>>;
235
+ }>>;
236
+ readonly page: StructType<{
237
+ readonly project: import("@elaraai/east").StringType;
238
+ readonly page: import("@elaraai/east").StringType;
239
+ }>;
240
+ readonly version: VariantType<{
241
+ readonly live: NullType;
242
+ readonly draft: NullType;
243
+ }>;
244
+ }>>;
245
+ /**
246
+ * `<Studio.Page>` options.
247
+ *
248
+ * @property pages - The pages record's value — `Data.bind(pages).read()`
249
+ * @property components - The components the surface lists
250
+ * @property page - The page's key
251
+ * @property version - `"live"` (the default) or `"draft"`
252
+ */
253
+ export interface StudioPageOptions {
254
+ /** The pages record's value — `Data.bind(pages).read()`, or a bound record's `read()`. */
255
+ pages: SubtypeExprOrValue<StudioPagesType>;
256
+ /** The components the surface lists, in palette order. */
257
+ components: SubtypeExprOrValue<ArrayType<StudioComponentType>>;
258
+ /** The page's key. */
259
+ page: SubtypeExprOrValue<StudioKeyType>;
260
+ /** Which layout: the published one (`"live"`, the default), or the draft. */
261
+ version?: StudioVersionLiteral | SubtypeExprOrValue<StudioVersionType>;
262
+ }
263
+ /**
264
+ * Draws one page with no chrome: its live or draft layout on the snap grid,
265
+ * each placement its component's own UI.
266
+ *
267
+ * @remarks
268
+ * A component renders the same way here and in the builder: a frameless one
269
+ * (`frame: "none"`) is bare, and a tile's label is its title or its
270
+ * component's name. Two placements of one component share its State and Slice
271
+ * keys. A placement whose component the surface does not list is a
272
+ * placeholder naming its key. A page the record does not hold, or a live
273
+ * version not yet published, is a placeholder that says so. Under a narrow
274
+ * container the tiles stack in row order. The page draws no border around
275
+ * itself.
276
+ *
277
+ * @param options - The record's value, the listed components, the page and
278
+ * its version ({@link StudioPageOptions})
279
+ * @returns An East expression of type `UIComponentType`
280
+ *
281
+ * @example
282
+ * ```tsx
283
+ * import { East } from "@elaraai/east";
284
+ * import { Reactive, UIComponentType } from "@elaraai/east-ui";
285
+ * import { Data, Studio, ui } from "@elaraai/e3-ui";
286
+ *
287
+ * // The published Overview page, for everyone else: it only reads the pages.
288
+ * export const opsConsole = ui("ops_console", [], East.function([], UIComponentType, _$ => (
289
+ * <Reactive>{$ => {
290
+ * const components = $.let([kpiRail, revenueTrend, breakdownBars]);
291
+ * const all = $.let(Data.bind(pages));
292
+ * return <Studio.Page pages={all.read()} components={components}
293
+ * page={{ project: "Ops console", page: "Overview" }} />;
294
+ * }}</Reactive>
295
+ * )));
296
+ * ```
297
+ */
298
+ declare function createPage(options: StudioPageOptions): ExprType<UIComponentType>;
299
+ /**
300
+ * `<Studio.Page>` — one page with no chrome, its live or draft layout on the
301
+ * snap grid. See {@link createPage}.
302
+ */
303
+ export declare const StudioPage: JsxTag<OptionsProps<typeof createPage>>;
304
+ export {};
305
+ //# sourceMappingURL=page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../src/studio/page.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH,OAAO,EACH,SAAS,EACT,QAAQ,EACR,UAAU,EACV,WAAW,EAEX,KAAK,QAAQ,EACb,KAAK,kBAAkB,EAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EAGH,KAAK,MAAM,EACX,KAA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