@elaraai/e3-ui 1.0.82 → 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,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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