@elaraai/e3-ui 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/src/data.d.ts +22 -1
- package/dist/src/data.d.ts.map +1 -1
- package/dist/src/data.js.map +1 -1
- package/dist/src/decision/bind.d.ts +4594 -0
- package/dist/src/decision/bind.d.ts.map +1 -0
- package/dist/src/decision/bind.js +156 -0
- package/dist/src/decision/bind.js.map +1 -0
- package/dist/src/decision/index.d.ts +1787 -0
- package/dist/src/decision/index.d.ts.map +1 -0
- package/dist/src/decision/index.js +36 -0
- package/dist/src/decision/index.js.map +1 -0
- package/dist/src/decision/journal.d.ts +405 -0
- package/dist/src/decision/journal.d.ts.map +1 -0
- package/dist/src/decision/journal.js +74 -0
- package/dist/src/decision/journal.js.map +1 -0
- package/dist/src/decision/queue.d.ts +2876 -0
- package/dist/src/decision/queue.d.ts.map +1 -0
- package/dist/src/decision/queue.js +166 -0
- package/dist/src/decision/queue.js.map +1 -0
- package/dist/src/decision/types.d.ts +1338 -0
- package/dist/src/decision/types.d.ts.map +1 -0
- package/dist/src/decision/types.js +389 -0
- package/dist/src/decision/types.js.map +1 -0
- package/dist/src/diff.d.ts +72 -0
- package/dist/src/diff.d.ts.map +1 -1
- package/dist/src/diff.js +6 -0
- package/dist/src/diff.js.map +1 -1
- package/dist/src/index.d.ts +27 -11
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +30 -10
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal.d.ts +28 -0
- package/dist/src/internal.d.ts.map +1 -0
- package/dist/src/internal.js +28 -0
- package/dist/src/internal.js.map +1 -0
- package/dist/src/ontology.d.ts +205 -10
- package/dist/src/ontology.d.ts.map +1 -1
- package/dist/src/ontology.js +23 -4
- package/dist/src/ontology.js.map +1 -1
- package/dist/src/runtime/decision/journal.d.ts +29 -0
- package/dist/src/runtime/decision/journal.d.ts.map +1 -0
- package/dist/src/runtime/decision/journal.js +27 -0
- package/dist/src/runtime/decision/journal.js.map +1 -0
- package/dist/src/runtime/decision/queue.d.ts +47 -0
- package/dist/src/runtime/decision/queue.d.ts.map +1 -0
- package/dist/src/runtime/decision/queue.js +45 -0
- package/dist/src/runtime/decision/queue.js.map +1 -0
- package/dist/src/runtime/diff.d.ts +36 -0
- package/dist/src/runtime/diff.d.ts.map +1 -0
- package/dist/src/runtime/diff.js +34 -0
- package/dist/src/runtime/diff.js.map +1 -0
- package/dist/src/runtime/index.d.ts +15 -0
- package/dist/src/runtime/index.d.ts.map +1 -0
- package/dist/src/runtime/index.js +15 -0
- package/dist/src/runtime/index.js.map +1 -0
- package/dist/src/runtime/ontology.d.ts +36 -0
- package/dist/src/runtime/ontology.d.ts.map +1 -0
- package/dist/src/runtime/ontology.js +34 -0
- package/dist/src/runtime/ontology.js.map +1 -0
- package/dist/src/runtime/runtime.d.ts +7 -0
- package/dist/src/runtime/runtime.d.ts.map +1 -0
- package/dist/src/runtime/runtime.js +7 -0
- package/dist/src/runtime/runtime.js.map +1 -0
- package/dist/src/ui.d.ts +6 -6
- package/dist/src/ui.d.ts.map +1 -1
- package/dist/src/ui.js +9 -1
- package/dist/src/ui.js.map +1 -1
- package/dist/test/{data.examples.d.ts → data/data.examples.d.ts} +1 -0
- package/dist/test/data/data.examples.d.ts.map +1 -0
- package/dist/test/{data.examples.js → data/data.examples.js} +30 -68
- package/dist/test/data/data.examples.js.map +1 -0
- package/dist/test/decision/journal.examples.d.ts +266 -0
- package/dist/test/decision/journal.examples.d.ts.map +1 -0
- package/dist/test/decision/journal.examples.js +107 -0
- package/dist/test/decision/journal.examples.js.map +1 -0
- package/dist/test/decision/loop.examples.d.ts +455 -0
- package/dist/test/decision/loop.examples.d.ts.map +1 -0
- package/dist/test/decision/loop.examples.js +120 -0
- package/dist/test/decision/loop.examples.js.map +1 -0
- package/dist/test/decision/queue.examples.d.ts +269 -0
- package/dist/test/decision/queue.examples.d.ts.map +1 -0
- package/dist/test/decision/queue.examples.js +273 -0
- package/dist/test/decision/queue.examples.js.map +1 -0
- package/dist/test/{diff.examples.d.ts → diff/diff.examples.d.ts} +5 -4
- package/dist/test/diff/diff.examples.d.ts.map +1 -0
- package/dist/test/diff/diff.examples.js +582 -0
- package/dist/test/diff/diff.examples.js.map +1 -0
- package/dist/test/{ontology.examples.d.ts → ontology/ontology.examples.d.ts} +6 -4
- package/dist/test/ontology/ontology.examples.d.ts.map +1 -0
- package/dist/test/{ontology.examples.js → ontology/ontology.examples.js} +37 -57
- package/dist/test/ontology/ontology.examples.js.map +1 -0
- package/package.json +19 -19
- package/dist/test/data.examples.d.ts.map +0 -1
- package/dist/test/data.examples.js.map +0 -1
- package/dist/test/diff.examples.d.ts.map +0 -1
- package/dist/test/diff.examples.js +0 -964
- package/dist/test/diff.examples.js.map +0 -1
- package/dist/test/ontology.examples.d.ts.map +0 -1
- package/dist/test/ontology.examples.js.map +0 -1
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
/** `<DecisionQueue>` tag — see the export's JSDoc. */
|
|
6
|
+
import { optionsTag } from "@elaraai/east-ui";
|
|
7
|
+
import { DecisionQueue as DecisionQueueFactory } from "../../decision/queue.js";
|
|
8
|
+
/**
|
|
9
|
+
* Decision queue — surfaces an `ArrayType(DecisionType)`-bound dataset as a
|
|
10
|
+
* prioritised, actionable list (the entry surface for Decide). Pass the
|
|
11
|
+
* `Data.bind([ArrayType(Decision.Types.Decision)], …, { patch })` handle as
|
|
12
|
+
* `value`; Apply / Modify write back through the binding (Modify's edit diffs
|
|
13
|
+
* into the patch overlay).
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* // .tsx with the `@jsxImportSource @elaraai/east-ui` pragma
|
|
18
|
+
* import { East, ArrayType } from "@elaraai/east";
|
|
19
|
+
* import { Reactive, Text, UIComponentType } from "@elaraai/east-ui";
|
|
20
|
+
* import { Data, Decision, DecisionQueue } from "@elaraai/e3-ui";
|
|
21
|
+
*
|
|
22
|
+
* const surface = East.function([], UIComponentType, _$ => (
|
|
23
|
+
* <Reactive>{$ => {
|
|
24
|
+
* const view = $.let(Data.bind(
|
|
25
|
+
* [ArrayType(Decision.Types.Decision)],
|
|
26
|
+
* decisionsTask.output.path,
|
|
27
|
+
* { mode: "direct", patch: decisionPatch.path },
|
|
28
|
+
* ));
|
|
29
|
+
* return (
|
|
30
|
+
* <DecisionQueue
|
|
31
|
+
* value={view}
|
|
32
|
+
* modify={(decision, update) => <Text>{decision.title}</Text>}
|
|
33
|
+
* />
|
|
34
|
+
* );
|
|
35
|
+
* }}</Reactive>
|
|
36
|
+
* ));
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
* Carries `DecisionQueue.Types`. Desugars to `DecisionQueue.Root(options)`. The
|
|
41
|
+
* renderer registers against `DecisionQueue.Component` (from
|
|
42
|
+
* `@elaraai/e3-ui/internal`).
|
|
43
|
+
*/
|
|
44
|
+
export const DecisionQueue = Object.assign(optionsTag(DecisionQueueFactory.Root), { Types: DecisionQueueFactory.Types });
|
|
45
|
+
//# sourceMappingURL=queue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue.js","sourceRoot":"","sources":["../../../../src/runtime/decision/queue.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,sDAAsD;AAEtD,OAAO,EAAE,UAAU,EAAkC,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,aAAa,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEhF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,CAAC,MAAM,aAAa,GAEtB,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,oBAAoB,CAAC,KAAK,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
/** `<Diff>` tag — see the export's JSDoc. */
|
|
6
|
+
import { type OptionsProps, type JsxTag } from "@elaraai/east-ui";
|
|
7
|
+
import { Diff as DiffFactory } from "../diff.js";
|
|
8
|
+
/**
|
|
9
|
+
* Change-review panel — surfaces every bound dataset's in-flight change in a
|
|
10
|
+
* single card with per-leaf accept / reject and a footer Apply. Pass the
|
|
11
|
+
* bindings to review; `hideUnchanged` collapses leaves with no pending change.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* // .tsx file with the `@jsxImportSource @elaraai/e3-ui` pragma
|
|
16
|
+
* import { East, FloatType, some } from "@elaraai/east";
|
|
17
|
+
* import { Reactive, UIComponentType } from "@elaraai/east-ui";
|
|
18
|
+
* import { Data, Diff } from "@elaraai/e3-ui";
|
|
19
|
+
*
|
|
20
|
+
* const review = East.function([], UIComponentType, _$ => (
|
|
21
|
+
* <Reactive>{$ => {
|
|
22
|
+
* const view = $.let(Data.bind([FloatType], maxHoursInput.path));
|
|
23
|
+
* return <Diff bindings={[view.binding]} hideUnchanged={some(true)} />;
|
|
24
|
+
* }}</Reactive>
|
|
25
|
+
* ));
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* Carries `Diff.Types` (the payload + style East types). Desugars to
|
|
30
|
+
* `Diff.Root(options)`. The renderer registers against `Diff.Component`
|
|
31
|
+
* (available from `@elaraai/e3-ui/internal`).
|
|
32
|
+
*/
|
|
33
|
+
export declare const Diff: JsxTag<OptionsProps<typeof DiffFactory.Root>> & {
|
|
34
|
+
Types: typeof DiffFactory.Types;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=diff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../src/runtime/diff.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,6CAA6C;AAE7C,OAAO,EAAc,KAAK,YAAY,EAAE,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,YAAY,CAAC,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG;IAAE,KAAK,EAAE,OAAO,WAAW,CAAC,KAAK,CAAA;CACvB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
/** `<Diff>` tag — see the export's JSDoc. */
|
|
6
|
+
import { optionsTag } from "@elaraai/east-ui";
|
|
7
|
+
import { Diff as DiffFactory } from "../diff.js";
|
|
8
|
+
/**
|
|
9
|
+
* Change-review panel — surfaces every bound dataset's in-flight change in a
|
|
10
|
+
* single card with per-leaf accept / reject and a footer Apply. Pass the
|
|
11
|
+
* bindings to review; `hideUnchanged` collapses leaves with no pending change.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* // .tsx file with the `@jsxImportSource @elaraai/e3-ui` pragma
|
|
16
|
+
* import { East, FloatType, some } from "@elaraai/east";
|
|
17
|
+
* import { Reactive, UIComponentType } from "@elaraai/east-ui";
|
|
18
|
+
* import { Data, Diff } from "@elaraai/e3-ui";
|
|
19
|
+
*
|
|
20
|
+
* const review = East.function([], UIComponentType, _$ => (
|
|
21
|
+
* <Reactive>{$ => {
|
|
22
|
+
* const view = $.let(Data.bind([FloatType], maxHoursInput.path));
|
|
23
|
+
* return <Diff bindings={[view.binding]} hideUnchanged={some(true)} />;
|
|
24
|
+
* }}</Reactive>
|
|
25
|
+
* ));
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* Carries `Diff.Types` (the payload + style East types). Desugars to
|
|
30
|
+
* `Diff.Root(options)`. The renderer registers against `Diff.Component`
|
|
31
|
+
* (available from `@elaraai/e3-ui/internal`).
|
|
32
|
+
*/
|
|
33
|
+
export const Diff = Object.assign(optionsTag(DiffFactory.Root), { Types: DiffFactory.Types });
|
|
34
|
+
//# sourceMappingURL=diff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.js","sourceRoot":"","sources":["../../../src/runtime/diff.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,6CAA6C;AAE7C,OAAO,EAAE,UAAU,EAAkC,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,IAAI,GACb,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
* e3-specific JSX tags — `<Diff>` and `<Ontology>`. The east-ui tags
|
|
7
|
+
* (`<VStack>`, `<Text>`, …) are imported directly from `@elaraai/east-ui`;
|
|
8
|
+
* this package does not re-export them.
|
|
9
|
+
*
|
|
10
|
+
* @packageDocumentation
|
|
11
|
+
*/
|
|
12
|
+
export { Diff } from "./diff.js";
|
|
13
|
+
export { Ontology } from "./ontology.js";
|
|
14
|
+
export { DecisionQueue } from "./decision/queue.js";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
* e3-specific JSX tags — `<Diff>` and `<Ontology>`. The east-ui tags
|
|
7
|
+
* (`<VStack>`, `<Text>`, …) are imported directly from `@elaraai/east-ui`;
|
|
8
|
+
* this package does not re-export them.
|
|
9
|
+
*
|
|
10
|
+
* @packageDocumentation
|
|
11
|
+
*/
|
|
12
|
+
export { Diff } from "./diff.js";
|
|
13
|
+
export { Ontology } from "./ontology.js";
|
|
14
|
+
export { DecisionQueue } from "./decision/queue.js";
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runtime/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
/** `<Ontology>` tag — see the export's JSDoc. */
|
|
6
|
+
import { type OptionsProps, type JsxTag } from "@elaraai/east-ui";
|
|
7
|
+
import { Ontology as OntologyFactory } from "../ontology.js";
|
|
8
|
+
/**
|
|
9
|
+
* Economic-ontology editor — renders an `OntologyType`-bound dataset as a
|
|
10
|
+
* graph canvas with node/link mutation surfaces wired through the binding.
|
|
11
|
+
* `readonly` hides the mutation affordances; `density` tightens the layout.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* // .tsx file with the `@jsxImportSource @elaraai/e3-ui` pragma
|
|
16
|
+
* import { East } from "@elaraai/east";
|
|
17
|
+
* import { Reactive, UIComponentType } from "@elaraai/east-ui";
|
|
18
|
+
* import { Data, Ontology, OntologyType } from "@elaraai/e3-ui";
|
|
19
|
+
*
|
|
20
|
+
* const editor = East.function([], UIComponentType, _$ => (
|
|
21
|
+
* <Reactive>{$ => {
|
|
22
|
+
* const view = $.let(Data.bind([OntologyType], ontologyInput.path));
|
|
23
|
+
* return <Ontology value={view} />;
|
|
24
|
+
* }}</Reactive>
|
|
25
|
+
* ));
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* Carries `Ontology.Types` (the graph value, node/link structs, kind enums,
|
|
30
|
+
* payload + style types). Desugars to `Ontology.Root(options)`. The renderer
|
|
31
|
+
* registers against `Ontology.Component` (from `@elaraai/e3-ui/internal`).
|
|
32
|
+
*/
|
|
33
|
+
export declare const Ontology: JsxTag<OptionsProps<typeof OntologyFactory.Root>> & {
|
|
34
|
+
Types: typeof OntologyFactory.Types;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=ontology.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ontology.d.ts","sourceRoot":"","sources":["../../../src/runtime/ontology.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,iDAAiD;AAEjD,OAAO,EAAc,KAAK,YAAY,EAAE,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,YAAY,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,GAAG;IAAE,KAAK,EAAE,OAAO,eAAe,CAAC,KAAK,CAAA;CAC3B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
/** `<Ontology>` tag — see the export's JSDoc. */
|
|
6
|
+
import { optionsTag } from "@elaraai/east-ui";
|
|
7
|
+
import { Ontology as OntologyFactory } from "../ontology.js";
|
|
8
|
+
/**
|
|
9
|
+
* Economic-ontology editor — renders an `OntologyType`-bound dataset as a
|
|
10
|
+
* graph canvas with node/link mutation surfaces wired through the binding.
|
|
11
|
+
* `readonly` hides the mutation affordances; `density` tightens the layout.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* // .tsx file with the `@jsxImportSource @elaraai/e3-ui` pragma
|
|
16
|
+
* import { East } from "@elaraai/east";
|
|
17
|
+
* import { Reactive, UIComponentType } from "@elaraai/east-ui";
|
|
18
|
+
* import { Data, Ontology, OntologyType } from "@elaraai/e3-ui";
|
|
19
|
+
*
|
|
20
|
+
* const editor = East.function([], UIComponentType, _$ => (
|
|
21
|
+
* <Reactive>{$ => {
|
|
22
|
+
* const view = $.let(Data.bind([OntologyType], ontologyInput.path));
|
|
23
|
+
* return <Ontology value={view} />;
|
|
24
|
+
* }}</Reactive>
|
|
25
|
+
* ));
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* Carries `Ontology.Types` (the graph value, node/link structs, kind enums,
|
|
30
|
+
* payload + style types). Desugars to `Ontology.Root(options)`. The renderer
|
|
31
|
+
* registers against `Ontology.Component` (from `@elaraai/e3-ui/internal`).
|
|
32
|
+
*/
|
|
33
|
+
export const Ontology = Object.assign(optionsTag(OntologyFactory.Root), { Types: OntologyFactory.Types });
|
|
34
|
+
//# sourceMappingURL=ontology.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ontology.js","sourceRoot":"","sources":["../../../src/runtime/ontology.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,iDAAiD;AAEjD,OAAO,EAAE,UAAU,EAAkC,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,QAAQ,GACjB,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,eAAe,CAAC,KAAK,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
/** e3-ui JSX runtime — identical to `@elaraai/east-ui/jsx-runtime`. */
|
|
6
|
+
export * from "@elaraai/east-ui/jsx-runtime";
|
|
7
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/runtime/runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,uEAAuE;AAEvE,cAAc,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
/** e3-ui JSX runtime — identical to `@elaraai/east-ui/jsx-runtime`. */
|
|
6
|
+
export * from "@elaraai/east-ui/jsx-runtime";
|
|
7
|
+
//# sourceMappingURL=runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../../src/runtime/runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,uEAAuE;AAEvE,cAAc,8BAA8B,CAAC"}
|
package/dist/src/ui.d.ts
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @packageDocumentation
|
|
13
13
|
*/
|
|
14
|
-
import { type DatasetDef, type TaskDef } from '@elaraai/e3';
|
|
15
|
-
import
|
|
16
|
-
import type
|
|
14
|
+
import { type DatasetDef, type Runner, type TaskDef } from '@elaraai/e3';
|
|
15
|
+
import { UIComponentType } from '@elaraai/east-ui';
|
|
16
|
+
import { type EastType, type CallableFunctionExpr, type CallableAsyncFunctionExpr, type variant } from '@elaraai/east';
|
|
17
17
|
/**
|
|
18
18
|
* Create a UI task — an e3 task that produces a UIComponentType value.
|
|
19
19
|
*
|
|
@@ -51,7 +51,7 @@ import type { EastType, CallableFunctionExpr, CallableAsyncFunctionExpr } from '
|
|
|
51
51
|
* // Manifest: { reads: [name.path], writes: [] }
|
|
52
52
|
* ```
|
|
53
53
|
*/
|
|
54
|
-
export declare function ui<Inputs extends readonly DatasetDef[], O extends EastType = typeof UIComponentType>(name:
|
|
55
|
-
runner?:
|
|
56
|
-
}): TaskDef
|
|
54
|
+
export declare function ui<Name extends string, Inputs extends readonly DatasetDef[], O extends EastType = typeof UIComponentType>(name: Name, inputs: [...Inputs], fn: CallableFunctionExpr<any, O> | CallableAsyncFunctionExpr<any, O>, options?: {
|
|
55
|
+
runner?: Runner;
|
|
56
|
+
}): TaskDef<O, [variant<'field', 'tasks'>, variant<'field', Name>, variant<'field', 'output'>]>;
|
|
57
57
|
//# sourceMappingURL=ui.d.ts.map
|
package/dist/src/ui.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/ui.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AAEH,OAAO,EAAQ,KAAK,UAAU,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/ui.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AAEH,OAAO,EAAQ,KAAK,UAAU,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,OAAO,EACb,MAAM,eAAe,CAAC;AAKvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,EAAE,CAChB,IAAI,SAAS,MAAM,EACnB,MAAM,SAAS,SAAS,UAAU,EAAE,EACpC,CAAC,SAAS,QAAQ,GAAG,OAAO,eAAe,EAE3C,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,CAAC,GAAG,MAAM,CAAC,EACnB,EAAE,EAAE,oBAAoB,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,yBAAyB,CAAC,GAAG,EAAE,CAAC,CAAC,EACpE,OAAO,CAAC,EAAE;IACR,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GACA,OAAO,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAK7F"}
|
package/dist/src/ui.js
CHANGED
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
* @packageDocumentation
|
|
13
13
|
*/
|
|
14
14
|
import { task } from '@elaraai/e3';
|
|
15
|
+
import { UIComponentType } from '@elaraai/east-ui';
|
|
16
|
+
import {} from '@elaraai/east';
|
|
15
17
|
import { encodeManifest } from './manifest.js';
|
|
16
18
|
import { deriveManifest } from './derive.js';
|
|
17
19
|
/**
|
|
@@ -52,6 +54,9 @@ import { deriveManifest } from './derive.js';
|
|
|
52
54
|
* ```
|
|
53
55
|
*/
|
|
54
56
|
export function ui(name, inputs, fn, options) {
|
|
57
|
+
return buildUiTask(name, inputs, fn, options);
|
|
58
|
+
}
|
|
59
|
+
function buildUiTask(name, inputs, fn, options) {
|
|
55
60
|
const derived = deriveManifest(fn);
|
|
56
61
|
const inputPaths = inputs.map(i => i.path);
|
|
57
62
|
const seen = new Set();
|
|
@@ -63,8 +68,11 @@ export function ui(name, inputs, fn, options) {
|
|
|
63
68
|
seen.add(k);
|
|
64
69
|
paths.push(p);
|
|
65
70
|
}
|
|
71
|
+
// UI tasks default to east-c with no platforms — east-c can produce the
|
|
72
|
+
// UIComponentType value without any platform-function imports; bound
|
|
73
|
+
// Data/State reads resolve at render time, not in the runner.
|
|
66
74
|
return task(name, inputs, fn, {
|
|
67
|
-
runner: options?.runner ??
|
|
75
|
+
runner: options?.runner ?? { runtime: 'east-c' },
|
|
68
76
|
kind: 'ui',
|
|
69
77
|
metadata: encodeManifest({ paths }),
|
|
70
78
|
});
|
package/dist/src/ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/ui.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/ui.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAA8C,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAKN,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,UAAU,EAAE,CAKhB,IAAU,EACV,MAAmB,EACnB,EAAoE,EACpE,OAEC;IAED,OAAO,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,CAG3C,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAClB,IAAY,EACZ,MAA6B,EAC7B,EAAkF,EAClF,OAA6B;IAE7B,MAAM,OAAO,GAAG,cAAc,CAAC,EAAE,CAAC,CAAC;IACnC,MAAM,UAAU,GAAe,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACvD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,KAAK,GAAe,EAAE,CAAC;IAC7B,KAAK,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAClD,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACvD,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;YAAE,SAAS;QAC1B,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACZ,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAChB,CAAC;IACD,wEAAwE;IACxE,qEAAqE;IACrE,8DAA8D;IAC9D,OAAO,IAAI,CAAC,IAAI,EAAE,MAAa,EAAE,EAAS,EAAE;QAC1C,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAY;QAC1D,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,cAAc,CAAC,EAAE,KAAK,EAAE,CAAC;KACpC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
3
|
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
4
|
*/
|
|
5
|
+
/** @jsxImportSource @elaraai/e3-ui */
|
|
5
6
|
import { FloatType, IntegerType, StringType, variant } from "@elaraai/east";
|
|
6
7
|
import * as e3 from "@elaraai/e3";
|
|
7
8
|
export declare const thresholdInput: e3.DatasetDef<FloatType, [variant<"field", "inputs">, variant<"field", "threshold">]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.examples.d.ts","sourceRoot":"","sources":["../../../test/data/data.examples.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sCAAsC;AACtC,OAAO,EAAQ,SAAS,EAAgB,WAAW,EAAY,UAAU,EAAa,OAAO,EAAW,MAAM,eAAe,CAAC;AAG9H,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAElC,eAAO,MAAM,cAAc,uFAAoD,CAAC;AAChF,eAAO,MAAM,mBAAmB,oHAAgF,CAAC;AACjH,eAAO,MAAM,UAAU,qFAA8C,CAAC;AACtE,eAAO,MAAM,SAAS,mFAA+C,CAAC;AAEtE,eAAO,MAAM,aAAa,6CAWxB,CAAC;AAEH,eAAO,MAAM,uBAAuB,6CAmBlC,CAAC;AAEH,eAAO,MAAM,eAAe,6CAW1B,CAAC;AAEH,eAAO,MAAM,mBAAmB,6CAmB9B,CAAC;AAEH,eAAO,MAAM,gBAAgB,6CAe3B,CAAC;AAEH,eAAO,MAAM,mBAAmB,6CAW9B,CAAC;AAEH,eAAO,MAAM,yBAAyB,6CAWpC,CAAC;AAEH,eAAO,MAAM,2BAA2B,6CAsBtC,CAAC;AAEH,eAAO,MAAM,4BAA4B,6CAiBvC,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@elaraai/e3-ui/jsx-runtime";
|
|
1
2
|
/**
|
|
2
3
|
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
4
|
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
5
|
*/
|
|
6
|
+
/** @jsxImportSource @elaraai/e3-ui */
|
|
5
7
|
import { East, FloatType, FunctionType, IntegerType, NullType, StringType, PatchType, variant, example } from "@elaraai/east";
|
|
6
|
-
import { Reactive, Slider,
|
|
8
|
+
import { Button, Input, Reactive, Slider, Stat, Text, UIComponentType, VStack } from "@elaraai/east-ui";
|
|
7
9
|
import { Data } from "@elaraai/e3-ui";
|
|
8
10
|
import * as e3 from "@elaraai/e3";
|
|
9
11
|
export const thresholdInput = e3.input('threshold', FloatType, 50.0);
|
|
@@ -13,111 +15,84 @@ export const nameInput = e3.input('name', StringType, '');
|
|
|
13
15
|
export const dataBindFloat = example({
|
|
14
16
|
keywords: ["Data", "bind", "Reactive", "Float", "dataset", "read"],
|
|
15
17
|
description: "Bind to a Float dataset and display its current value",
|
|
16
|
-
fn: East.function([], UIComponentType, (_$) => {
|
|
17
|
-
return Reactive.Root(East.function([], UIComponentType, $ => {
|
|
18
|
+
fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
|
|
18
19
|
const thresh = $.let(Data.bind([FloatType], thresholdInput.path));
|
|
19
20
|
const value = $.let(thresh.read());
|
|
20
|
-
return Stat
|
|
21
|
-
}))
|
|
22
|
-
}),
|
|
21
|
+
return _jsx(Stat, { label: "Threshold", value: value });
|
|
22
|
+
} }))),
|
|
23
23
|
inputs: [],
|
|
24
24
|
});
|
|
25
25
|
export const dataBindSliderWriteback = example({
|
|
26
26
|
keywords: ["Data", "bind", "Reactive", "Slider", "onChange", "write", "interactive"],
|
|
27
27
|
description: "Slider whose value is bound to a dataset — onChange writes back",
|
|
28
|
-
fn: East.function([], UIComponentType, (_$) => {
|
|
29
|
-
return Reactive.Root(East.function([], UIComponentType, $ => {
|
|
28
|
+
fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
|
|
30
29
|
const thresh = $.let(Data.bind([FloatType], thresholdInput.path));
|
|
31
30
|
const value = $.let(thresh.read());
|
|
32
|
-
return Slider
|
|
33
|
-
|
|
34
|
-
max: 100,
|
|
35
|
-
onChangeEnd: thresh.writeAndStart,
|
|
36
|
-
disabled: thresh.status().hasTag('stale')
|
|
37
|
-
});
|
|
38
|
-
}));
|
|
39
|
-
}),
|
|
31
|
+
return (_jsx(Slider, { value: value, min: 0, max: 100, onChangeEnd: thresh.writeAndStart, disabled: thresh.status().hasTag('stale') }));
|
|
32
|
+
} }))),
|
|
40
33
|
inputs: [],
|
|
41
34
|
});
|
|
42
35
|
export const dataBindInteger = example({
|
|
43
36
|
keywords: ["Data", "bind", "Integer", "Input", "write", "interactive"],
|
|
44
37
|
description: "Integer dataset bound to a number input with writeback",
|
|
45
|
-
fn: East.function([], UIComponentType, (_$) => {
|
|
46
|
-
return Reactive.Root(East.function([], UIComponentType, $ => {
|
|
38
|
+
fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
|
|
47
39
|
const count = $.let(Data.bind([IntegerType], countInput.path));
|
|
48
40
|
const value = $.let(count.read());
|
|
49
|
-
return Input.Integer
|
|
50
|
-
}))
|
|
51
|
-
}),
|
|
41
|
+
return _jsx(Input.Integer, { value: value, onChange: count.write });
|
|
42
|
+
} }))),
|
|
52
43
|
inputs: [],
|
|
53
44
|
});
|
|
54
45
|
export const dataBindStringReset = example({
|
|
55
46
|
keywords: ["Data", "bind", "String", "callback", "Button", "reset", "write"],
|
|
56
47
|
description: "String dataset with a reset button that writes an empty string",
|
|
57
|
-
fn: East.function([], UIComponentType, (_$) => {
|
|
58
|
-
return Reactive.Root(East.function([], UIComponentType, $ => {
|
|
48
|
+
fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
|
|
59
49
|
const name = $.let(Data.bind([StringType], nameInput.path));
|
|
60
50
|
const value = $.let(name.read());
|
|
61
51
|
const reset = $.const(East.function([], NullType, $ => {
|
|
62
52
|
$(name.write(""));
|
|
63
53
|
}));
|
|
64
|
-
return
|
|
65
|
-
|
|
66
|
-
Button.Root("Reset", { style: { variant: "outline" }, onClick: reset }),
|
|
67
|
-
], { gap: "3", align: "stretch" });
|
|
68
|
-
}));
|
|
69
|
-
}),
|
|
54
|
+
return (_jsxs(VStack, { gap: "3", align: "stretch", children: [_jsx(Stat, { label: "Name", value: value }), _jsx(Button, { variant: "outline", onClick: reset, children: "Reset" })] }));
|
|
55
|
+
} }))),
|
|
70
56
|
inputs: [],
|
|
71
57
|
});
|
|
72
58
|
export const dataBindHasGuard = example({
|
|
73
59
|
keywords: ["Data", "bind", "has", "guard", "conditional", "Reactive"],
|
|
74
60
|
description: "Use has() to gate UI on whether a dataset has been written",
|
|
75
|
-
fn: East.function([], UIComponentType, (_$) => {
|
|
76
|
-
return Reactive.Root(East.function([], UIComponentType, $ => {
|
|
61
|
+
fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
|
|
77
62
|
const thresh = $.let(Data.bind([FloatType], thresholdInput.path));
|
|
78
63
|
const ready = $.let(thresh.has());
|
|
79
64
|
const message = $.let("(no data)");
|
|
80
65
|
$.if(ready, $ => {
|
|
81
66
|
$.assign(message, East.print(thresh.read()));
|
|
82
67
|
});
|
|
83
|
-
return Text
|
|
84
|
-
}))
|
|
85
|
-
}),
|
|
68
|
+
return _jsx(Text, { children: message });
|
|
69
|
+
} }))),
|
|
86
70
|
inputs: [],
|
|
87
71
|
});
|
|
88
72
|
export const dataBindStagedFloat = example({
|
|
89
73
|
keywords: ["Data", "bindStaged", "Reactive", "Float", "buffered", "transactional"],
|
|
90
74
|
description: "Stage edits to a Float dataset; read returns overlay (buffered or server)",
|
|
91
|
-
fn: East.function([], UIComponentType, (_$) => {
|
|
92
|
-
return Reactive.Root(East.function([], UIComponentType, $ => {
|
|
75
|
+
fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
|
|
93
76
|
const thresh = $.let(Data.bind([FloatType], thresholdInput.path, { mode: "staged" }));
|
|
94
77
|
const value = $.let(thresh.read(), FloatType);
|
|
95
|
-
return Stat
|
|
96
|
-
}))
|
|
97
|
-
}),
|
|
78
|
+
return _jsx(Stat, { label: "Threshold (live)", value: value });
|
|
79
|
+
} }))),
|
|
98
80
|
inputs: [],
|
|
99
81
|
});
|
|
100
82
|
export const dataBindStagedSliderWrite = example({
|
|
101
83
|
keywords: ["Data", "bindStaged", "Slider", "write", "buffer", "interactive"],
|
|
102
84
|
description: "Slider whose onChange writes to the staged buffer instead of the server",
|
|
103
|
-
fn: East.function([], UIComponentType, (_$) => {
|
|
104
|
-
return Reactive.Root(East.function([], UIComponentType, $ => {
|
|
85
|
+
fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
|
|
105
86
|
const thresh = $.let(Data.bind([FloatType], thresholdInput.path, { mode: "staged" }));
|
|
106
87
|
const value = $.let(thresh.read(), FloatType);
|
|
107
|
-
return Slider
|
|
108
|
-
|
|
109
|
-
max: 100,
|
|
110
|
-
onChange: thresh.write,
|
|
111
|
-
});
|
|
112
|
-
}));
|
|
113
|
-
}),
|
|
88
|
+
return _jsx(Slider, { value: value, min: 0, max: 100, onChange: thresh.write });
|
|
89
|
+
} }))),
|
|
114
90
|
inputs: [],
|
|
115
91
|
});
|
|
116
92
|
export const dataBindStagedCommitDiscard = example({
|
|
117
93
|
keywords: ["Data", "bindStaged", "commit", "discard", "pending", "transactional"],
|
|
118
94
|
description: "Two buttons that commit or discard the staged buffer for a path",
|
|
119
|
-
fn: East.function([], UIComponentType, (_$) => {
|
|
120
|
-
return Reactive.Root(East.function([], UIComponentType, $ => {
|
|
95
|
+
fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
|
|
121
96
|
const thresh = $.let(Data.bind([FloatType], thresholdInput.path, { mode: "staged" }));
|
|
122
97
|
const commit = $.const(East.function([], NullType, $ => {
|
|
123
98
|
$(thresh.commit());
|
|
@@ -125,32 +100,19 @@ export const dataBindStagedCommitDiscard = example({
|
|
|
125
100
|
const discard = $.const(East.function([], NullType, $ => {
|
|
126
101
|
$(thresh.discard());
|
|
127
102
|
}), FunctionType([], NullType));
|
|
128
|
-
return
|
|
129
|
-
|
|
130
|
-
Button.Root("Commit", { onClick: commit }),
|
|
131
|
-
Button.Root("Discard", {
|
|
132
|
-
style: { variant: "outline" },
|
|
133
|
-
onClick: discard,
|
|
134
|
-
}),
|
|
135
|
-
], { gap: "3", align: "stretch" });
|
|
136
|
-
}));
|
|
137
|
-
}),
|
|
103
|
+
return (_jsxs(VStack, { gap: "3", align: "stretch", children: [_jsx(Text, { children: "Pending edits" }), _jsx(Button, { onClick: commit, children: "Commit" }), _jsx(Button, { variant: "outline", onClick: discard, children: "Discard" })] }));
|
|
104
|
+
} }))),
|
|
138
105
|
inputs: [],
|
|
139
106
|
});
|
|
140
107
|
export const dataBindStagedOriginalVsRead = example({
|
|
141
108
|
keywords: ["Data", "bindStaged", "original", "read", "overlay", "diff"],
|
|
142
109
|
description: "Show server snapshot (original) and overlay (read) side by side",
|
|
143
|
-
fn: East.function([], UIComponentType, (_$) => {
|
|
144
|
-
return Reactive.Root(East.function([], UIComponentType, $ => {
|
|
110
|
+
fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
|
|
145
111
|
const thresh = $.let(Data.bind([FloatType], thresholdInput.path, { mode: "staged", patch: thresholdPatchInput.path }));
|
|
146
112
|
const live = $.let(thresh.read(), FloatType);
|
|
147
113
|
const server = $.let(thresh.source(), FloatType);
|
|
148
|
-
return
|
|
149
|
-
|
|
150
|
-
Stat.Root("Live (with stage)", live),
|
|
151
|
-
], { gap: "3", align: "stretch" });
|
|
152
|
-
}));
|
|
153
|
-
}),
|
|
114
|
+
return (_jsxs(VStack, { gap: "3", align: "stretch", children: [_jsx(Stat, { label: "Server", value: server }), _jsx(Stat, { label: "Live (with stage)", value: live })] }));
|
|
115
|
+
} }))),
|
|
154
116
|
inputs: [],
|
|
155
117
|
});
|
|
156
118
|
//# sourceMappingURL=data.examples.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.examples.js","sourceRoot":"","sources":["../../../test/data/data.examples.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AACH,sCAAsC;AACtC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC9H,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACxG,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAElC,MAAM,CAAC,MAAM,cAAc,GAAQ,EAAE,CAAC,KAAK,CAAC,WAAW,EAAQ,SAAS,EAAE,IAAI,CAAC,CAAC;AAChF,MAAM,CAAC,MAAM,mBAAmB,GAAG,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