@elaraai/e3-ui 1.0.103 → 1.0.104
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/allocation/functions.d.ts +2 -1
- package/dist/src/allocation/functions.d.ts.map +1 -1
- package/dist/src/allocation/functions.js +3 -2
- package/dist/src/allocation/functions.js.map +1 -1
- package/dist/src/allocation/index.d.ts +120 -1
- package/dist/src/allocation/index.d.ts.map +1 -1
- package/dist/src/allocation/index.js +24 -4
- package/dist/src/allocation/index.js.map +1 -1
- package/dist/src/bind/data-indexed.d.ts +25 -4
- package/dist/src/bind/data-indexed.d.ts.map +1 -1
- package/dist/src/bind/data-indexed.js +58 -7
- package/dist/src/bind/data-indexed.js.map +1 -1
- package/dist/src/bind/data.d.ts +12 -14
- package/dist/src/bind/data.d.ts.map +1 -1
- package/dist/src/bind/data.js +11 -11
- package/dist/src/bind/data.js.map +1 -1
- package/dist/src/bind/func.d.ts +7 -2
- package/dist/src/bind/func.d.ts.map +1 -1
- package/dist/src/bind/func.js +10 -3
- package/dist/src/bind/func.js.map +1 -1
- package/dist/src/calendar/index.d.ts +148 -1
- package/dist/src/calendar/index.d.ts.map +1 -1
- package/dist/src/calendar/index.js +55 -5
- package/dist/src/calendar/index.js.map +1 -1
- package/dist/src/flowchart/canvas.d.ts +32 -14
- package/dist/src/flowchart/canvas.d.ts.map +1 -1
- package/dist/src/flowchart/canvas.js +21 -6
- package/dist/src/flowchart/canvas.js.map +1 -1
- package/dist/src/flowchart/details.d.ts +469 -0
- package/dist/src/flowchart/details.d.ts.map +1 -0
- package/dist/src/flowchart/details.js +1035 -0
- package/dist/src/flowchart/details.js.map +1 -0
- package/dist/src/flowchart/flowchart.d.ts +16 -72
- package/dist/src/flowchart/flowchart.d.ts.map +1 -1
- package/dist/src/flowchart/flowchart.js +10 -1
- package/dist/src/flowchart/flowchart.js.map +1 -1
- package/dist/src/flowchart/index.d.ts +282 -251
- package/dist/src/flowchart/index.d.ts.map +1 -1
- package/dist/src/flowchart/index.js +234 -220
- package/dist/src/flowchart/index.js.map +1 -1
- package/dist/src/flowchart/kinds.d.ts +438 -0
- package/dist/src/flowchart/kinds.d.ts.map +1 -0
- package/dist/src/flowchart/kinds.js +799 -0
- package/dist/src/flowchart/kinds.js.map +1 -0
- package/dist/src/flowchart/library.d.ts +154 -739
- package/dist/src/flowchart/library.d.ts.map +1 -1
- package/dist/src/flowchart/library.js +191 -673
- package/dist/src/flowchart/library.js.map +1 -1
- package/dist/src/flowchart/payload.d.ts +3652 -7843
- package/dist/src/flowchart/payload.d.ts.map +1 -1
- package/dist/src/flowchart/payload.js +331 -469
- package/dist/src/flowchart/payload.js.map +1 -1
- package/dist/src/flowchart/templates.d.ts +657 -0
- package/dist/src/flowchart/templates.d.ts.map +1 -0
- package/dist/src/flowchart/templates.js +658 -0
- package/dist/src/flowchart/templates.js.map +1 -0
- package/dist/src/flowchart/types.d.ts +2258 -214
- package/dist/src/flowchart/types.d.ts.map +1 -1
- package/dist/src/flowchart/types.js +374 -124
- package/dist/src/flowchart/types.js.map +1 -1
- package/dist/src/index.d.ts +13 -15
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +24 -29
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal.d.ts +5 -7
- package/dist/src/internal.d.ts.map +1 -1
- package/dist/src/internal.js +12 -19
- package/dist/src/internal.js.map +1 -1
- package/dist/src/ontology/index.d.ts +44 -15
- package/dist/src/ontology/index.d.ts.map +1 -1
- package/dist/src/ontology/index.js +19 -11
- package/dist/src/ontology/index.js.map +1 -1
- package/dist/src/plan/event-rows.d.ts +2 -1
- package/dist/src/plan/event-rows.d.ts.map +1 -1
- package/dist/src/plan/event-rows.js +6 -4
- package/dist/src/plan/event-rows.js.map +1 -1
- package/dist/src/plan/ir.d.ts +1 -0
- package/dist/src/plan/ir.d.ts.map +1 -1
- package/dist/src/plan/plan.d.ts +145 -1
- package/dist/src/plan/plan.d.ts.map +1 -1
- package/dist/src/plan/plan.js +67 -3
- package/dist/src/plan/plan.js.map +1 -1
- package/dist/src/plan/types.d.ts +1 -0
- package/dist/src/plan/types.d.ts.map +1 -1
- package/dist/src/query/builder.d.ts +362 -315
- package/dist/src/query/builder.d.ts.map +1 -1
- package/dist/src/query/builder.js +12 -1
- package/dist/src/query/builder.js.map +1 -1
- package/dist/src/query/index.d.ts +5 -1
- package/dist/src/query/index.d.ts.map +1 -1
- package/dist/src/query/index.js +3 -1
- package/dist/src/query/index.js.map +1 -1
- package/dist/src/roster/fit.d.ts +5 -2
- package/dist/src/roster/fit.d.ts.map +1 -1
- package/dist/src/roster/fit.js +5 -3
- package/dist/src/roster/fit.js.map +1 -1
- package/dist/src/roster/index.d.ts +103 -2
- package/dist/src/roster/index.d.ts.map +1 -1
- package/dist/src/roster/index.js +45 -6
- package/dist/src/roster/index.js.map +1 -1
- package/dist/src/runtime/index.d.ts +1 -3
- package/dist/src/runtime/index.d.ts.map +1 -1
- package/dist/src/runtime/index.js +1 -3
- package/dist/src/runtime/index.js.map +1 -1
- package/dist/src/schedule/record-window.d.ts +1 -0
- package/dist/src/schedule/record-window.d.ts.map +1 -1
- package/dist/src/schematic/index.d.ts +1 -1
- package/dist/src/schematic/index.d.ts.map +1 -1
- package/dist/src/schematic/index.js +1 -1
- package/dist/src/schematic/index.js.map +1 -1
- package/dist/src/schematic/kinds.d.ts +4 -24
- package/dist/src/schematic/kinds.d.ts.map +1 -1
- package/dist/src/schematic/kinds.js +8 -212
- package/dist/src/schematic/kinds.js.map +1 -1
- package/dist/src/schematic/payload.d.ts +140 -1
- package/dist/src/schematic/payload.d.ts.map +1 -1
- package/dist/src/schematic/payload.js +38 -1
- package/dist/src/schematic/payload.js.map +1 -1
- package/dist/src/schematic/types.d.ts.map +1 -1
- package/dist/src/schematic/types.js +4 -36
- package/dist/src/schematic/types.js.map +1 -1
- package/dist/src/schematic/window.d.ts +9 -42
- package/dist/src/schematic/window.d.ts.map +1 -1
- package/dist/src/schematic/window.js +10 -115
- package/dist/src/schematic/window.js.map +1 -1
- package/dist/src/sheet/actions.d.ts +388 -0
- package/dist/src/sheet/actions.d.ts.map +1 -0
- package/dist/src/sheet/actions.js +594 -0
- package/dist/src/sheet/actions.js.map +1 -0
- package/dist/src/sheet/bridge.d.ts +12 -1
- package/dist/src/sheet/bridge.d.ts.map +1 -1
- package/dist/src/sheet/bridge.js +30 -6
- package/dist/src/sheet/bridge.js.map +1 -1
- package/dist/src/sheet/columns.d.ts +5 -2
- package/dist/src/sheet/columns.d.ts.map +1 -1
- package/dist/src/sheet/columns.js.map +1 -1
- package/dist/src/sheet/draft-bridge.d.ts +9 -4
- package/dist/src/sheet/draft-bridge.d.ts.map +1 -1
- package/dist/src/sheet/draft-bridge.js +22 -7
- package/dist/src/sheet/draft-bridge.js.map +1 -1
- package/dist/src/sheet/fields.d.ts +13 -0
- package/dist/src/sheet/fields.d.ts.map +1 -1
- package/dist/src/sheet/fields.js +3 -0
- package/dist/src/sheet/fields.js.map +1 -1
- package/dist/src/sheet/index.d.ts +32 -2
- package/dist/src/sheet/index.d.ts.map +1 -1
- package/dist/src/sheet/index.js +18 -3
- package/dist/src/sheet/index.js.map +1 -1
- package/dist/src/sheet/library.d.ts +8 -0
- package/dist/src/sheet/library.d.ts.map +1 -1
- package/dist/src/sheet/root.d.ts +23 -1
- package/dist/src/sheet/root.d.ts.map +1 -1
- package/dist/src/sheet/root.js +40 -5
- package/dist/src/sheet/root.js.map +1 -1
- package/dist/src/sheet/sheet.d.ts +7843 -4132
- package/dist/src/sheet/sheet.d.ts.map +1 -1
- package/dist/src/sheet/sheet.js +41 -2
- package/dist/src/sheet/sheet.js.map +1 -1
- package/dist/src/sheet/templates.d.ts +4 -0
- package/dist/src/sheet/templates.d.ts.map +1 -1
- package/dist/src/sheet/types.d.ts +12449 -5268
- package/dist/src/sheet/types.d.ts.map +1 -1
- package/dist/src/sheet/types.js +114 -2
- package/dist/src/sheet/types.js.map +1 -1
- package/dist/src/utils/derive.d.ts +1 -1
- package/dist/src/utils/derive.js +1 -1
- package/dist/src/utils/record-kind.d.ts +625 -0
- package/dist/src/utils/record-kind.d.ts.map +1 -0
- package/dist/src/utils/record-kind.js +450 -0
- package/dist/src/utils/record-kind.js.map +1 -0
- package/dist/src/utils/views.d.ts +55 -0
- package/dist/src/utils/views.d.ts.map +1 -0
- package/dist/src/utils/views.js +72 -0
- package/dist/src/utils/views.js.map +1 -0
- package/dist/src/utils/vocabulary.d.ts +48 -0
- package/dist/src/utils/vocabulary.d.ts.map +1 -0
- package/dist/src/utils/vocabulary.js +47 -0
- package/dist/src/utils/vocabulary.js.map +1 -0
- package/dist/test/allocation/allocation.examples.d.ts +2 -0
- package/dist/test/allocation/allocation.examples.d.ts.map +1 -1
- package/dist/test/allocation/allocation.examples.js +81 -2
- package/dist/test/allocation/allocation.examples.js.map +1 -1
- package/dist/test/bind/func/func.examples.d.ts +19 -1
- package/dist/test/bind/func/func.examples.d.ts.map +1 -1
- package/dist/test/bind/func/func.examples.js +36 -1
- package/dist/test/bind/func/func.examples.js.map +1 -1
- package/dist/test/calendar/calendar.examples.d.ts +2 -0
- package/dist/test/calendar/calendar.examples.d.ts.map +1 -1
- package/dist/test/calendar/calendar.examples.js +80 -2
- package/dist/test/calendar/calendar.examples.js.map +1 -1
- package/dist/test/decision/queue.examples.d.ts +1 -0
- package/dist/test/decision/queue.examples.d.ts.map +1 -1
- package/dist/test/decision/queue.examples.js +12 -0
- package/dist/test/decision/queue.examples.js.map +1 -1
- package/dist/test/examples-package.d.ts.map +1 -1
- package/dist/test/examples-package.js +5 -4
- package/dist/test/examples-package.js.map +1 -1
- package/dist/test/flowchart/flowchart.examples.d.ts +1250 -4605
- package/dist/test/flowchart/flowchart.examples.d.ts.map +1 -1
- package/dist/test/flowchart/flowchart.examples.js +861 -512
- package/dist/test/flowchart/flowchart.examples.js.map +1 -1
- package/dist/test/ontology/ontology.examples.d.ts +2 -3
- package/dist/test/ontology/ontology.examples.d.ts.map +1 -1
- package/dist/test/ontology/ontology.examples.js +32 -21
- package/dist/test/ontology/ontology.examples.js.map +1 -1
- package/dist/test/plan/plan-events.examples.d.ts +1 -0
- package/dist/test/plan/plan-events.examples.d.ts.map +1 -1
- package/dist/test/plan/plan-events.examples.js +44 -0
- package/dist/test/plan/plan-events.examples.js.map +1 -1
- package/dist/test/plan/plan-nested.examples.d.ts +2 -2
- package/dist/test/plan/plan-nested.examples.js +5 -5
- package/dist/test/plan/plan-nested.examples.js.map +1 -1
- package/dist/test/plan/plan-records.examples.d.ts.map +1 -1
- package/dist/test/plan/plan-records.examples.js +1 -1
- package/dist/test/plan/plan-records.examples.js.map +1 -1
- package/dist/test/query/query.examples.d.ts +2 -0
- package/dist/test/query/query.examples.d.ts.map +1 -1
- package/dist/test/query/query.examples.js +37 -1
- package/dist/test/query/query.examples.js.map +1 -1
- package/dist/test/roster/roster.examples.d.ts +2 -0
- package/dist/test/roster/roster.examples.d.ts.map +1 -1
- package/dist/test/roster/roster.examples.js +76 -15
- package/dist/test/roster/roster.examples.js.map +1 -1
- package/dist/test/schematic/schematic-records.examples.d.ts.map +1 -1
- package/dist/test/schematic/schematic-records.examples.js +6 -4
- package/dist/test/schematic/schematic-records.examples.js.map +1 -1
- package/dist/test/schematic/schematic.examples.d.ts +1 -0
- package/dist/test/schematic/schematic.examples.d.ts.map +1 -1
- package/dist/test/schematic/schematic.examples.js +144 -0
- package/dist/test/schematic/schematic.examples.js.map +1 -1
- package/dist/test/sheet/sheet-actions.examples.d.ts +1264 -0
- package/dist/test/sheet/sheet-actions.examples.d.ts.map +1 -0
- package/dist/test/sheet/sheet-actions.examples.js +394 -0
- package/dist/test/sheet/sheet-actions.examples.js.map +1 -0
- package/dist/test/sheet/sheet.examples.d.ts +1 -0
- package/dist/test/sheet/sheet.examples.d.ts.map +1 -1
- package/dist/test/sheet/sheet.examples.js +77 -0
- package/dist/test/sheet/sheet.examples.js.map +1 -1
- package/dist/test/studio/studio.examples.d.ts +1 -0
- package/dist/test/studio/studio.examples.d.ts.map +1 -1
- package/dist/test/studio/studio.examples.js +18 -8
- package/dist/test/studio/studio.examples.js.map +1 -1
- package/package.json +12 -12
- package/dist/src/diff/index.d.ts +0 -407
- package/dist/src/diff/index.d.ts.map +0 -1
- package/dist/src/diff/index.js +0 -203
- package/dist/src/diff/index.js.map +0 -1
- package/dist/src/experiment/index.d.ts +0 -1033
- package/dist/src/experiment/index.d.ts.map +0 -1
- package/dist/src/experiment/index.js +0 -197
- package/dist/src/experiment/index.js.map +0 -1
- package/dist/src/experiment/types.d.ts +0 -1093
- package/dist/src/experiment/types.d.ts.map +0 -1
- package/dist/src/experiment/types.js +0 -423
- package/dist/src/experiment/types.js.map +0 -1
- package/dist/src/flowchart/over.d.ts +0 -227
- package/dist/src/flowchart/over.d.ts.map +0 -1
- package/dist/src/flowchart/over.js +0 -213
- package/dist/src/flowchart/over.js.map +0 -1
- package/dist/src/flowchart/patch.d.ts +0 -64
- package/dist/src/flowchart/patch.d.ts.map +0 -1
- package/dist/src/flowchart/patch.js +0 -67
- package/dist/src/flowchart/patch.js.map +0 -1
- package/dist/src/flowchart/values.d.ts +0 -271
- package/dist/src/flowchart/values.d.ts.map +0 -1
- package/dist/src/flowchart/values.js +0 -220
- package/dist/src/flowchart/values.js.map +0 -1
- package/dist/src/flowchart/window.d.ts +0 -306
- package/dist/src/flowchart/window.d.ts.map +0 -1
- package/dist/src/flowchart/window.js +0 -63
- package/dist/src/flowchart/window.js.map +0 -1
- package/dist/src/runtime/diff.d.ts +0 -36
- package/dist/src/runtime/diff.d.ts.map +0 -1
- package/dist/src/runtime/diff.js +0 -34
- package/dist/src/runtime/diff.js.map +0 -1
- package/dist/src/runtime/experiment.d.ts +0 -48
- package/dist/src/runtime/experiment.d.ts.map +0 -1
- package/dist/src/runtime/experiment.js +0 -10
- package/dist/src/runtime/experiment.js.map +0 -1
- package/dist/test/diff/diff.examples.d.ts +0 -313
- package/dist/test/diff/diff.examples.d.ts.map +0 -1
- package/dist/test/diff/diff.examples.js +0 -452
- package/dist/test/diff/diff.examples.js.map +0 -1
- package/dist/test/experiment/experiment.examples.d.ts +0 -1512
- package/dist/test/experiment/experiment.examples.d.ts.map +0 -1
- package/dist/test/experiment/experiment.examples.js +0 -609
- package/dist/test/experiment/experiment.examples.js.map +0 -1
package/dist/src/diff/index.js
DELETED
|
@@ -1,203 +0,0 @@
|
|
|
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
|
-
* Diff component — transactional review of pending changes for any
|
|
7
|
-
* combination of {@link Data.bind} bindings.
|
|
8
|
-
*
|
|
9
|
-
* @remarks
|
|
10
|
-
* The Diff card surfaces the in-flight change for each binding the caller
|
|
11
|
-
* lists in `bindings`. Per-leaf Discard, per-group Discard-all, and a
|
|
12
|
-
* footer Apply button drive the binding's commit flow. Conflicts surface
|
|
13
|
-
* inline as orange chooser rows (staged-mode 3-way drift) and as orange
|
|
14
|
-
* "stale" warning badges (drift between a patch dataset's expectations
|
|
15
|
-
* and the current source).
|
|
16
|
-
*
|
|
17
|
-
* Declared via the `EastUI.component` extension API — the React renderer
|
|
18
|
-
* lives in `@elaraai/e3-ui-components` and is wired via
|
|
19
|
-
* `implementUIComponent(DiffComponent, EastChakraDiff)` at module load
|
|
20
|
-
* time.
|
|
21
|
-
*
|
|
22
|
-
* @packageDocumentation
|
|
23
|
-
*/
|
|
24
|
-
import { East, StringType, BooleanType, NullType, IntegerType, StructType, OptionType, ArrayType, FunctionType, none, some, variant, } from "@elaraai/east";
|
|
25
|
-
import { EastUI, DensityType } from "@elaraai/east-ui";
|
|
26
|
-
import { DiffBindingType } from "../bind/data.js";
|
|
27
|
-
// ============================================================================
|
|
28
|
-
// Sub-types — visual style escape hatches.
|
|
29
|
-
// ============================================================================
|
|
30
|
-
/**
|
|
31
|
-
* Visual style escape hatches for the Diff component. Every visible surface
|
|
32
|
-
* is tokenable; defaults come from the host's Chakra theme (Elara AI brand).
|
|
33
|
-
*
|
|
34
|
-
* @property addedBackground - Soft-tint background for added / inserted leaves.
|
|
35
|
-
* @property addedColor - Foreground for added leaves.
|
|
36
|
-
* @property addedBorderColor - Border for added chips.
|
|
37
|
-
* @property removedBackground - Soft-tint background for removed / deleted leaves.
|
|
38
|
-
* @property removedColor - Foreground for removed leaves.
|
|
39
|
-
* @property removedBorderColor - Border for removed chips.
|
|
40
|
-
* @property changedBackground - Soft-tint background for updated leaves.
|
|
41
|
-
* @property changedColor - Foreground for updated leaves.
|
|
42
|
-
* @property changedBorderColor - Border for updated chips.
|
|
43
|
-
* @property unchangedColor - Foreground for unchanged rows when shown.
|
|
44
|
-
* @property acceptedBackground - Lane background for accepted-row indicator.
|
|
45
|
-
* @property acceptedBorderColor - Left-edge accent stripe for accepted rows.
|
|
46
|
-
* @property rejectedBackground - Lane background for rejected rows.
|
|
47
|
-
* @property rejectedBorderColor - Border for rejected rows.
|
|
48
|
-
* @property headerBackground - Card header background.
|
|
49
|
-
* @property summaryBackground - Stats bar background.
|
|
50
|
-
* @property background - Card body background.
|
|
51
|
-
* @property borderColor - Card outer border.
|
|
52
|
-
* @property indentGuideColor - Vertical guide line for nested rows.
|
|
53
|
-
* @property lineNumberColor - Gutter line numbers in unified mode.
|
|
54
|
-
*/
|
|
55
|
-
export const DiffStyleType = StructType({
|
|
56
|
-
addedBackground: OptionType(StringType),
|
|
57
|
-
addedColor: OptionType(StringType),
|
|
58
|
-
addedBorderColor: OptionType(StringType),
|
|
59
|
-
removedBackground: OptionType(StringType),
|
|
60
|
-
removedColor: OptionType(StringType),
|
|
61
|
-
removedBorderColor: OptionType(StringType),
|
|
62
|
-
changedBackground: OptionType(StringType),
|
|
63
|
-
changedColor: OptionType(StringType),
|
|
64
|
-
changedBorderColor: OptionType(StringType),
|
|
65
|
-
unchangedColor: OptionType(StringType),
|
|
66
|
-
acceptedBackground: OptionType(StringType),
|
|
67
|
-
acceptedBorderColor: OptionType(StringType),
|
|
68
|
-
rejectedBackground: OptionType(StringType),
|
|
69
|
-
rejectedBorderColor: OptionType(StringType),
|
|
70
|
-
headerBackground: OptionType(StringType),
|
|
71
|
-
summaryBackground: OptionType(StringType),
|
|
72
|
-
background: OptionType(StringType),
|
|
73
|
-
borderColor: OptionType(StringType),
|
|
74
|
-
indentGuideColor: OptionType(StringType),
|
|
75
|
-
lineNumberColor: OptionType(StringType),
|
|
76
|
-
});
|
|
77
|
-
// ============================================================================
|
|
78
|
-
// Re-export the binding descriptor — it lives in `data.ts` to keep the
|
|
79
|
-
// dependency direction one-way (Diff consumes; Data produces).
|
|
80
|
-
// ============================================================================
|
|
81
|
-
export { DiffBindingType } from "../bind/data.js";
|
|
82
|
-
// ============================================================================
|
|
83
|
-
// Diff payload — IR shape consumed by the renderer.
|
|
84
|
-
// ============================================================================
|
|
85
|
-
/**
|
|
86
|
-
* Schema for the `Diff` extension component. Internal IR shape — the
|
|
87
|
-
* developer-facing factory `Diff.Root` accepts {@link DataBindHandleType}
|
|
88
|
-
* descriptors and forwards them as `bindings`.
|
|
89
|
-
*
|
|
90
|
-
* @property bindings - The set of bindings to surface in the card. Each
|
|
91
|
-
* entry is a {@link DiffBindingType} value (typically obtained via the
|
|
92
|
-
* `binding` field of a {@link Data.bind} handle).
|
|
93
|
-
* @property readonly - Render the Diff without per-leaf or per-group Discard
|
|
94
|
-
* buttons. The footer Apply / Discard-all still render. Default `false`
|
|
95
|
-
* (interactive review).
|
|
96
|
-
* @property hideUnchanged - Elide unchanged rows. None ⇒ false.
|
|
97
|
-
* @property maxDepth - Cap nesting depth before "Show more" collapses. None ⇒ no cap.
|
|
98
|
-
* @property density - Information-density preset (`comfortable` | `compact`
|
|
99
|
-
* | `condensed`). Defaults to `comfortable`.
|
|
100
|
-
* @property onCommitted - Fired after a successful commit (post-merge).
|
|
101
|
-
* @property onDiscarded - Fired after a successful discard.
|
|
102
|
-
* @property style - Visual style escape hatches.
|
|
103
|
-
*/
|
|
104
|
-
export const DiffPayloadType = StructType({
|
|
105
|
-
bindings: ArrayType(DiffBindingType),
|
|
106
|
-
readonly: OptionType(BooleanType),
|
|
107
|
-
hideUnchanged: OptionType(BooleanType),
|
|
108
|
-
maxDepth: OptionType(IntegerType),
|
|
109
|
-
density: OptionType(DensityType),
|
|
110
|
-
onCommitted: OptionType(FunctionType([], NullType)),
|
|
111
|
-
onDiscarded: OptionType(FunctionType([], NullType)),
|
|
112
|
-
style: OptionType(DiffStyleType),
|
|
113
|
-
});
|
|
114
|
-
/**
|
|
115
|
-
* Internal `EastUI.component` carrier. Renderers register against this in
|
|
116
|
-
* `@elaraai/e3-ui-components`. Most callers should use {@link Diff.Root}
|
|
117
|
-
* (which wraps this with the handle-friendly API) rather than touching
|
|
118
|
-
* `DiffComponent` directly.
|
|
119
|
-
*/
|
|
120
|
-
export const DiffComponent = EastUI.component("Diff", DiffPayloadType, { optional: true });
|
|
121
|
-
/**
|
|
122
|
-
* The Diff component namespace. Surfaces transactional pending edits for
|
|
123
|
-
* review and commit, with merge-aware conflict resolution and stale-patch
|
|
124
|
-
* drift detection.
|
|
125
|
-
*
|
|
126
|
-
* @remarks
|
|
127
|
-
* Use `Diff.Root({ bindings: [view.binding, ...] })` to render the panel.
|
|
128
|
-
* The `Component` property is the internal {@link EastUI.component}
|
|
129
|
-
* carrier that renderers register against — most callers shouldn't need
|
|
130
|
-
* it.
|
|
131
|
-
*/
|
|
132
|
-
export const Diff = {
|
|
133
|
-
/**
|
|
134
|
-
* Build a Diff component. Surfaces every binding's in-flight change in
|
|
135
|
-
* a single review card, with per-leaf accept / reject and a footer
|
|
136
|
-
* Apply that runs the right commit per binding.
|
|
137
|
-
*
|
|
138
|
-
* @param options - {@link DiffOptions}. Only `bindings` is required;
|
|
139
|
-
* the rest default to absent / interactive.
|
|
140
|
-
* @returns An East expression of {@link UIComponentType} representing
|
|
141
|
-
* the Diff panel.
|
|
142
|
-
*
|
|
143
|
-
* @remarks
|
|
144
|
-
* The renderer reads each binding's IR descriptor (`source`, optional
|
|
145
|
-
* `patch`, `mode`), looks up the runtime types in the binding
|
|
146
|
-
* registry, and derives the in-flight change to display. Apply's
|
|
147
|
-
* commit code path depends on the binding's mode and patch presence —
|
|
148
|
-
* staged + no patch applies the buffer to source; staged + patch
|
|
149
|
-
* publishes the buffer as a fresh patch to the patch dataset; direct
|
|
150
|
-
* + patch applies the existing patch dataset to the source. Discard
|
|
151
|
-
* always drops the in-flight change in place.
|
|
152
|
-
*
|
|
153
|
-
* @example
|
|
154
|
-
* ```ts
|
|
155
|
-
* import { East, FloatType, variant } from "@elaraai/east";
|
|
156
|
-
* import { Reactive, UIComponentType } from "@elaraai/east-ui";
|
|
157
|
-
* import { Data, Diff } from "@elaraai/e3-ui";
|
|
158
|
-
* import * as e3 from "@elaraai/e3";
|
|
159
|
-
*
|
|
160
|
-
* const maxWeeklyHoursInput = e3.input("max_weekly_hours", FloatType, variant("value", 38.0));
|
|
161
|
-
*
|
|
162
|
-
* // Mirrors `diffDefaults` in test/diff.examples.ts (wired via Assert.examples).
|
|
163
|
-
* const diffDefaults = East.function([], UIComponentType, _$ => {
|
|
164
|
-
* return Reactive.Root(East.function([], UIComponentType, $ => {
|
|
165
|
-
* const view = $.let(Data.bind(maxWeeklyHoursInput, { mode: "staged" }));
|
|
166
|
-
* return Diff.Root({ bindings: [view.binding] });
|
|
167
|
-
* }));
|
|
168
|
-
* });
|
|
169
|
-
* ```
|
|
170
|
-
*/
|
|
171
|
-
Root(options) {
|
|
172
|
-
const density = options.density === undefined
|
|
173
|
-
? none
|
|
174
|
-
: typeof options.density === "string"
|
|
175
|
-
? some(East.value(variant(options.density, null), DensityType))
|
|
176
|
-
: options.density;
|
|
177
|
-
return DiffComponent.Root({
|
|
178
|
-
bindings: options.bindings,
|
|
179
|
-
readonly: options.readonly ?? none,
|
|
180
|
-
hideUnchanged: options.hideUnchanged ?? none,
|
|
181
|
-
maxDepth: options.maxDepth ?? none,
|
|
182
|
-
density,
|
|
183
|
-
onCommitted: options.onCommitted ?? none,
|
|
184
|
-
onDiscarded: options.onDiscarded ?? none,
|
|
185
|
-
style: options.style ?? none,
|
|
186
|
-
});
|
|
187
|
-
},
|
|
188
|
-
/**
|
|
189
|
-
* The internal {@link EastUI.component} carrier. Renderers register
|
|
190
|
-
* against this in `@elaraai/e3-ui-components` via
|
|
191
|
-
* `implementUIComponent(Diff.Component, EastChakraDiff)`. Most callers
|
|
192
|
-
* should use {@link Diff.Root} (the handle-friendly factory) and never
|
|
193
|
-
* touch this directly.
|
|
194
|
-
*/
|
|
195
|
-
Component: DiffComponent,
|
|
196
|
-
Types: {
|
|
197
|
-
/** Rendered Diff payload struct (bindings + style). */
|
|
198
|
-
Payload: DiffPayloadType,
|
|
199
|
-
/** Visual-presentation sub-struct (density, layout). */
|
|
200
|
-
Style: DiffStyleType,
|
|
201
|
-
},
|
|
202
|
-
};
|
|
203
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/diff/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EACH,IAAI,EACJ,UAAU,EACV,WAAW,EACX,QAAQ,EACR,WAAW,EACX,UAAU,EACV,UAAU,EACV,SAAS,EACT,YAAY,EACZ,IAAI,EACJ,IAAI,EACJ,OAAO,GAGV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,WAAW,EAA6C,MAAM,kBAAkB,CAAC;AAElG,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,+EAA+E;AAC/E,2CAA2C;AAC3C,+EAA+E;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC;IACpC,eAAe,EAAM,UAAU,CAAC,UAAU,CAAC;IAC3C,UAAU,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