@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,105 @@
|
|
|
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, variant, } from "@elaraai/east";
|
|
18
|
+
import { EastUI, optionsTag, } from "@elaraai/east-ui/internal";
|
|
19
|
+
import { StudioComponentType } from "./component.js";
|
|
20
|
+
import { StudioKeyType, StudioPagesType } from "./pages.js";
|
|
21
|
+
// ============================================================================
|
|
22
|
+
// Types
|
|
23
|
+
// ============================================================================
|
|
24
|
+
/**
|
|
25
|
+
* Which layout of a page to draw.
|
|
26
|
+
*
|
|
27
|
+
* @property live - The published version — what a published page shows
|
|
28
|
+
* @property draft - The layout as last saved — what the builder edits
|
|
29
|
+
*/
|
|
30
|
+
export const StudioVersionType = VariantType({
|
|
31
|
+
live: NullType,
|
|
32
|
+
draft: NullType,
|
|
33
|
+
});
|
|
34
|
+
/**
|
|
35
|
+
* The `StudioPage` renderer's payload — one page, to draw.
|
|
36
|
+
*
|
|
37
|
+
* @property pages - The pages record's value
|
|
38
|
+
* @property components - The components the surface lists
|
|
39
|
+
* @property page - The page's key
|
|
40
|
+
* @property version - Which of its layouts to draw
|
|
41
|
+
*/
|
|
42
|
+
export const StudioPagePayloadType = StructType({
|
|
43
|
+
pages: StudioPagesType,
|
|
44
|
+
components: ArrayType(StudioComponentType),
|
|
45
|
+
page: StudioKeyType,
|
|
46
|
+
version: StudioVersionType,
|
|
47
|
+
});
|
|
48
|
+
/**
|
|
49
|
+
* Internal {@link EastUI.component} carrier. The React renderer registers
|
|
50
|
+
* against this in `@elaraai/e3-ui-components` via `implementUIComponent`.
|
|
51
|
+
*/
|
|
52
|
+
export const StudioPageComponent = EastUI.component("StudioPage", StudioPagePayloadType, { optional: true });
|
|
53
|
+
/**
|
|
54
|
+
* Draws one page with no chrome: its live or draft layout on the snap grid,
|
|
55
|
+
* each placement its component's own UI.
|
|
56
|
+
*
|
|
57
|
+
* @remarks
|
|
58
|
+
* A component renders the same way here and in the builder: a frameless one
|
|
59
|
+
* (`frame: "none"`) is bare, and a tile's label is its title or its
|
|
60
|
+
* component's name. Two placements of one component share its State and Slice
|
|
61
|
+
* keys. A placement whose component the surface does not list is a
|
|
62
|
+
* placeholder naming its key. A page the record does not hold, or a live
|
|
63
|
+
* version not yet published, is a placeholder that says so. Under a narrow
|
|
64
|
+
* container the tiles stack in row order. The page draws no border around
|
|
65
|
+
* itself.
|
|
66
|
+
*
|
|
67
|
+
* @param options - The record's value, the listed components, the page and
|
|
68
|
+
* its version ({@link StudioPageOptions})
|
|
69
|
+
* @returns An East expression of type `UIComponentType`
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```tsx
|
|
73
|
+
* import { East } from "@elaraai/east";
|
|
74
|
+
* import { Reactive, UIComponentType } from "@elaraai/east-ui";
|
|
75
|
+
* import { Data, Studio, ui } from "@elaraai/e3-ui";
|
|
76
|
+
*
|
|
77
|
+
* // The published Overview page, for everyone else: it only reads the pages.
|
|
78
|
+
* export const opsConsole = ui("ops_console", [], East.function([], UIComponentType, _$ => (
|
|
79
|
+
* <Reactive>{$ => {
|
|
80
|
+
* const components = $.let([kpiRail, revenueTrend, breakdownBars]);
|
|
81
|
+
* const all = $.let(Data.bind(pages));
|
|
82
|
+
* return <Studio.Page pages={all.read()} components={components}
|
|
83
|
+
* page={{ project: "Ops console", page: "Overview" }} />;
|
|
84
|
+
* }}</Reactive>
|
|
85
|
+
* )));
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
function createPage(options) {
|
|
89
|
+
const version = options.version ?? "live";
|
|
90
|
+
return StudioPageComponent.Root({
|
|
91
|
+
pages: options.pages,
|
|
92
|
+
components: options.components,
|
|
93
|
+
page: options.page,
|
|
94
|
+
version: typeof version === "string" ? variant(version, null) : version,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
// ============================================================================
|
|
98
|
+
// Tag
|
|
99
|
+
// ============================================================================
|
|
100
|
+
/**
|
|
101
|
+
* `<Studio.Page>` — one page with no chrome, its live or draft layout on the
|
|
102
|
+
* snap grid. See {@link createPage}.
|
|
103
|
+
*/
|
|
104
|
+
export const StudioPage = optionsTag(createPage);
|
|
105
|
+
//# sourceMappingURL=page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../src/studio/page.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH,OAAO,EACH,SAAS,EACT,QAAQ,EACR,UAAU,EACV,WAAW,EACX,OAAO,GAGV,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,MAAM,EACN,UAAU,GAIb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE5D,+EAA+E;AAC/E,QAAQ;AACR,+EAA+E;AAE/E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAC;IACzC,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,QAAQ;CAClB,CAAC,CAAC;AAQH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,UAAU,CAAC;IAC5C,KAAK,EAAE,eAAe;IACtB,UAAU,EAAE,SAAS,CAAC,mBAAmB,CAAC;IAC1C,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,iBAAiB;CAC7B,CAAC,CAAC;AAKH;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,qBAAqB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAyB7G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,SAAS,UAAU,CAAC,OAA0B;IAC1C,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,MAAM,CAAC;IAC1C,OAAO,mBAAmB,CAAC,IAAI,CAAC;QAC5B,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,OAAO,EAAE,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO;KAC1E,CAAC,CAAC;AACP,CAAC;AAED,+EAA+E;AAC/E,MAAM;AACN,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAA4C,UAAU,CAAC,UAAU,CAAC,CAAC"}
|