@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 @@
|
|
|
1
|
+
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../src/decision/queue.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAEH,SAAS,EACT,UAAU,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,QAAQ,EACR,YAAY,EAIZ,KAAK,QAAQ,EACb,KAAK,kBAAkB,EAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAU,WAAW,EAAE,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7F,OAAO,EAAuB,KAAK,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAE7F,OAAO,EAAyB,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAMhD,gCAAgC;AAChC,eAAO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AC3B,KAAK,EAAE,SAAS,CAAC;KACpB,CAAC;CA4EI,CAAC"}
|
|
@@ -0,0 +1,166 @@
|
|
|
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
|
+
* `DecisionQueue` — *the* Decide surface (see `design/decide.html` §2.3).
|
|
7
|
+
* One queue over the handle's unioned cases, sorted by urgency with the
|
|
8
|
+
* routine tail collapsed. The case view is the row's expanded state, not a
|
|
9
|
+
* sibling component: selecting a row opens one compact facet at a time
|
|
10
|
+
* beneath it — `Evidence` (the model's argument + the host's per-decision
|
|
11
|
+
* `detail` canvas), `Options` (the ranked stack), `Judgement` (prompts ·
|
|
12
|
+
* knowledge · lever builder, gating Apply), `Modify` (the host's per-kind
|
|
13
|
+
* probe via the `modify` slot). Apply / Reject stay on the row and resolve
|
|
14
|
+
* through the handle.
|
|
15
|
+
*
|
|
16
|
+
* An `EastUI.component` extension: the payload carries the handle's ref
|
|
17
|
+
* (binding descriptors) plus the host's slots; the renderer registers
|
|
18
|
+
* against {@link DecisionQueue.Component} in `@elaraai/e3-ui-components`.
|
|
19
|
+
*
|
|
20
|
+
* @packageDocumentation
|
|
21
|
+
*/
|
|
22
|
+
import { East, ArrayType, StructType, OptionType, VariantType, StringType, NullType, FunctionType, some, none, variant, } from "@elaraai/east";
|
|
23
|
+
import { EastUI, DensityType, UIComponentType } from "@elaraai/east-ui";
|
|
24
|
+
import { SliceAffordanceType } from "@elaraai/east-ui/internal";
|
|
25
|
+
import { DecisionHandleRefType } from "./bind.js";
|
|
26
|
+
import { DecisionType, DecisionUpdateType } from "./types.js";
|
|
27
|
+
export { DecisionUpdateType } from "./types.js";
|
|
28
|
+
// ============================================================================
|
|
29
|
+
// Payload — the fixed IR shape the renderer decodes.
|
|
30
|
+
// ============================================================================
|
|
31
|
+
/** The expanded row's facet. */
|
|
32
|
+
export const FacetType = VariantType({
|
|
33
|
+
evidence: NullType,
|
|
34
|
+
options: NullType,
|
|
35
|
+
judgement: NullType,
|
|
36
|
+
modify: NullType,
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* The `DecisionQueue` component payload.
|
|
40
|
+
*
|
|
41
|
+
* @property handle - The surface's decision handle ref (binding descriptors).
|
|
42
|
+
* @property heading - Optional header label (e.g. `"Decisions waiting"`).
|
|
43
|
+
* @property modify - Optional per-kind probe editor: `(decision, update) =>
|
|
44
|
+
* UIComponentType`; renders as the expanded row's Modify facet.
|
|
45
|
+
* `update(edited)` writes the decision back through its owning binding.
|
|
46
|
+
* @property detail - Optional per-decision canvas: `(decision) =>
|
|
47
|
+
* UIComponentType`; renders inside the Evidence facet (the host's chart /
|
|
48
|
+
* working surface / trajectory).
|
|
49
|
+
* @property defaultExpanded - The case shown expanded before any selection
|
|
50
|
+
* exists (a display-only default — clicking rows writes the real
|
|
51
|
+
* selection).
|
|
52
|
+
* @property defaultFacet - The facet the expansion opens with (defaults to
|
|
53
|
+
* `evidence`).
|
|
54
|
+
* @property onApply - Optional side-effect hook fired with the decision when
|
|
55
|
+
* Apply resolves it (the resolution itself goes through the handle).
|
|
56
|
+
* @property onReject - Optional side-effect hook fired with the decision
|
|
57
|
+
* when Reject resolves it.
|
|
58
|
+
* @property slice - Optional rail affordances. The slice itself is
|
|
59
|
+
* handle-owned (bound by `Decision.bind`, seeded there); this field only
|
|
60
|
+
* chooses what mounts in the queue's eyebrow rail.
|
|
61
|
+
* @property maxHeight - Optional cap on the queue's height (a CSS length).
|
|
62
|
+
* The header stays pinned; the rows scroll.
|
|
63
|
+
* @property density - Information-density preset.
|
|
64
|
+
*/
|
|
65
|
+
export const DecisionQueuePayloadType = StructType({
|
|
66
|
+
handle: DecisionHandleRefType,
|
|
67
|
+
heading: OptionType(StringType),
|
|
68
|
+
modify: OptionType(FunctionType([DecisionType, DecisionUpdateType], UIComponentType)),
|
|
69
|
+
detail: OptionType(FunctionType([DecisionType], UIComponentType)),
|
|
70
|
+
defaultExpanded: OptionType(DecisionType),
|
|
71
|
+
defaultFacet: OptionType(FacetType),
|
|
72
|
+
onApply: OptionType(FunctionType([DecisionType], NullType)),
|
|
73
|
+
onReject: OptionType(FunctionType([DecisionType], NullType)),
|
|
74
|
+
slice: OptionType(ArrayType(SliceAffordanceType)),
|
|
75
|
+
maxHeight: OptionType(StringType),
|
|
76
|
+
density: OptionType(DensityType),
|
|
77
|
+
});
|
|
78
|
+
/**
|
|
79
|
+
* Internal {@link EastUI.component} carrier. The React renderer registers
|
|
80
|
+
* against this in `@elaraai/e3-ui-components` via `implementUIComponent`.
|
|
81
|
+
*/
|
|
82
|
+
export const DecisionQueueComponent = EastUI.component("DecisionQueue", DecisionQueuePayloadType, { optional: true });
|
|
83
|
+
/**
|
|
84
|
+
* The Decision queue component namespace — the Decide surface.
|
|
85
|
+
*
|
|
86
|
+
* @remarks
|
|
87
|
+
* Use `DecisionQueue.Root({ handle, modify: …, detail: … })` inside a
|
|
88
|
+
* `Reactive` block, with the handle from `Decision.bind`. The `Component`
|
|
89
|
+
* property is the {@link EastUI.component} carrier the renderer registers
|
|
90
|
+
* against.
|
|
91
|
+
*/
|
|
92
|
+
export const DecisionQueue = {
|
|
93
|
+
/**
|
|
94
|
+
* Build a decision queue bound to a decision handle.
|
|
95
|
+
*
|
|
96
|
+
* @param options - {@link DecisionQueueOptions}. Only `handle` is required.
|
|
97
|
+
* @returns An East expression of {@link UIComponentType}.
|
|
98
|
+
*/
|
|
99
|
+
Root(options) {
|
|
100
|
+
const modify = options.modify === undefined
|
|
101
|
+
? none
|
|
102
|
+
: some(East.function([DecisionType, DecisionUpdateType], UIComponentType, (_$, decision, update) => East.value(options.modify(decision, update), UIComponentType)));
|
|
103
|
+
const detail = options.detail === undefined
|
|
104
|
+
? none
|
|
105
|
+
: some(East.function([DecisionType], UIComponentType, (_$, decision) => East.value(options.detail(decision), UIComponentType)));
|
|
106
|
+
const onApply = options.onApply === undefined
|
|
107
|
+
? none
|
|
108
|
+
: some(East.function([DecisionType], NullType, ($, decision) => {
|
|
109
|
+
$(East.value(options.onApply(decision), NullType));
|
|
110
|
+
}));
|
|
111
|
+
const onReject = options.onReject === undefined
|
|
112
|
+
? none
|
|
113
|
+
: some(East.function([DecisionType], NullType, ($, decision) => {
|
|
114
|
+
$(East.value(options.onReject(decision), NullType));
|
|
115
|
+
}));
|
|
116
|
+
const defaultFacet = options.defaultFacet === undefined
|
|
117
|
+
? none
|
|
118
|
+
: some(typeof options.defaultFacet === "string"
|
|
119
|
+
? East.value(variant(options.defaultFacet, null), FacetType)
|
|
120
|
+
: options.defaultFacet);
|
|
121
|
+
const sliceAffordances = options.slice === undefined
|
|
122
|
+
? undefined
|
|
123
|
+
: options.slice === true ? ["filter", "search"] : options.slice;
|
|
124
|
+
if (sliceAffordances?.includes("brush")) {
|
|
125
|
+
throw new Error("DecisionQueue does not support the 'brush' affordance — it has no continuous axis.");
|
|
126
|
+
}
|
|
127
|
+
const slice = sliceAffordances === undefined
|
|
128
|
+
? none
|
|
129
|
+
: some(East.value(sliceAffordances.map(a => variant(a, null)), ArrayType(SliceAffordanceType)));
|
|
130
|
+
const density = options.density === undefined
|
|
131
|
+
? none
|
|
132
|
+
: typeof options.density === "string"
|
|
133
|
+
? some(East.value(variant(options.density, null), DensityType))
|
|
134
|
+
: options.density;
|
|
135
|
+
return DecisionQueueComponent.Root({
|
|
136
|
+
handle: East.value({
|
|
137
|
+
decisions: options.handle.decisions,
|
|
138
|
+
judgements: options.handle.judgements,
|
|
139
|
+
slice: options.handle.sliceInit,
|
|
140
|
+
}, DecisionHandleRefType),
|
|
141
|
+
heading: options.heading !== undefined ? some(options.heading) : none,
|
|
142
|
+
modify,
|
|
143
|
+
detail,
|
|
144
|
+
defaultExpanded: options.defaultExpanded !== undefined
|
|
145
|
+
? East.value(options.defaultExpanded, OptionType(DecisionType))
|
|
146
|
+
: none,
|
|
147
|
+
defaultFacet,
|
|
148
|
+
onApply,
|
|
149
|
+
onReject,
|
|
150
|
+
slice,
|
|
151
|
+
maxHeight: options.maxHeight !== undefined ? some(options.maxHeight) : none,
|
|
152
|
+
density,
|
|
153
|
+
});
|
|
154
|
+
},
|
|
155
|
+
/** The internal {@link EastUI.component} carrier renderers register against. */
|
|
156
|
+
Component: DecisionQueueComponent,
|
|
157
|
+
Types: {
|
|
158
|
+
/** The rendered payload struct. */
|
|
159
|
+
Payload: DecisionQueuePayloadType,
|
|
160
|
+
/** The probe editor's `update` writer. */
|
|
161
|
+
Update: DecisionUpdateType,
|
|
162
|
+
/** The expanded row's facet variant. */
|
|
163
|
+
Facet: FacetType,
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
//# sourceMappingURL=queue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue.js","sourceRoot":"","sources":["../../../src/decision/queue.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACH,IAAI,EACJ,SAAS,EACT,UAAU,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,IAAI,EACJ,IAAI,EACJ,OAAO,GAGV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,EAAuB,MAAM,kBAAkB,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAA+B,MAAM,2BAA2B,CAAC;AAE7F,OAAO,EAAE,qBAAqB,EAA2B,MAAM,WAAW,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,+EAA+E;AAC/E,qDAAqD;AACrD,+EAA+E;AAE/E,gCAAgC;AAChC,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;IACjC,QAAQ,EAAE,QAAQ;IAClB,OAAO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