@elaraai/e3-ui 1.0.98 → 1.0.99
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 +0 -2
- package/dist/src/allocation/adapters.d.ts +1 -1
- package/dist/src/allocation/adapters.js +1 -1
- package/dist/src/allocation/index.d.ts +46 -90
- package/dist/src/allocation/index.d.ts.map +1 -1
- package/dist/src/allocation/index.js +5 -5
- package/dist/src/allocation/index.js.map +1 -1
- package/dist/src/bind/data-indexed.d.ts +273 -51
- package/dist/src/bind/data-indexed.d.ts.map +1 -1
- package/dist/src/bind/data-indexed.js +233 -56
- package/dist/src/bind/data-indexed.js.map +1 -1
- package/dist/src/bind/data.d.ts +48 -9
- package/dist/src/bind/data.d.ts.map +1 -1
- package/dist/src/bind/data.js +48 -3
- package/dist/src/bind/data.js.map +1 -1
- package/dist/src/bind/record.d.ts +61 -24
- package/dist/src/bind/record.d.ts.map +1 -1
- package/dist/src/bind/record.js +17 -57
- package/dist/src/bind/record.js.map +1 -1
- package/dist/src/calendar/index.d.ts +55 -95
- package/dist/src/calendar/index.d.ts.map +1 -1
- package/dist/src/calendar/index.js +10 -6
- package/dist/src/calendar/index.js.map +1 -1
- package/dist/src/flowchart/index.d.ts +35 -31
- package/dist/src/flowchart/index.d.ts.map +1 -1
- package/dist/src/flowchart/index.js +35 -31
- package/dist/src/flowchart/index.js.map +1 -1
- package/dist/src/flowchart/library.d.ts +108 -84
- package/dist/src/flowchart/library.d.ts.map +1 -1
- package/dist/src/flowchart/library.js +108 -84
- package/dist/src/flowchart/library.js.map +1 -1
- package/dist/src/flowchart/payload.d.ts +39 -107
- package/dist/src/flowchart/payload.d.ts.map +1 -1
- package/dist/src/flowchart/payload.js +3 -3
- package/dist/src/flowchart/payload.js.map +1 -1
- package/dist/src/flowchart/values.d.ts +35 -31
- package/dist/src/flowchart/values.d.ts.map +1 -1
- package/dist/src/flowchart/values.js +35 -31
- package/dist/src/flowchart/values.js.map +1 -1
- package/dist/src/flowchart/window.d.ts +0 -12
- package/dist/src/flowchart/window.d.ts.map +1 -1
- package/dist/src/flowchart/window.js +3 -2
- package/dist/src/flowchart/window.js.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal.d.ts +7 -3
- package/dist/src/internal.d.ts.map +1 -1
- package/dist/src/internal.js +12 -3
- package/dist/src/internal.js.map +1 -1
- package/dist/src/plan/assemble.d.ts +8 -0
- package/dist/src/plan/assemble.d.ts.map +1 -1
- package/dist/src/plan/assemble.js +1 -1
- package/dist/src/plan/assemble.js.map +1 -1
- package/dist/src/plan/builders.d.ts +1518 -2
- package/dist/src/plan/builders.d.ts.map +1 -1
- package/dist/src/plan/builders.js +248 -114
- package/dist/src/plan/builders.js.map +1 -1
- package/dist/src/plan/event-rows.d.ts +9 -14
- package/dist/src/plan/event-rows.d.ts.map +1 -1
- package/dist/src/plan/event-rows.js +6 -46
- package/dist/src/plan/event-rows.js.map +1 -1
- package/dist/src/plan/factories.d.ts +72 -4
- package/dist/src/plan/factories.d.ts.map +1 -1
- package/dist/src/plan/factories.js +147 -1
- package/dist/src/plan/factories.js.map +1 -1
- package/dist/src/plan/index.d.ts +147 -125
- package/dist/src/plan/index.d.ts.map +1 -1
- package/dist/src/plan/index.js +135 -122
- package/dist/src/plan/index.js.map +1 -1
- package/dist/src/plan/ir.d.ts +1105 -44
- package/dist/src/plan/ir.d.ts.map +1 -1
- package/dist/src/plan/ir.js +5 -0
- package/dist/src/plan/ir.js.map +1 -1
- package/dist/src/plan/library.d.ts +65 -42
- package/dist/src/plan/library.d.ts.map +1 -1
- package/dist/src/plan/library.js +65 -42
- package/dist/src/plan/library.js.map +1 -1
- package/dist/src/plan/nested-checks.d.ts +146 -0
- package/dist/src/plan/nested-checks.d.ts.map +1 -0
- package/dist/src/plan/nested-checks.js +468 -0
- package/dist/src/plan/nested-checks.js.map +1 -0
- package/dist/src/plan/nested-patch.d.ts +35 -0
- package/dist/src/plan/nested-patch.d.ts.map +1 -0
- package/dist/src/plan/nested-patch.js +143 -0
- package/dist/src/plan/nested-patch.js.map +1 -0
- package/dist/src/plan/nested-read.d.ts +3250 -0
- package/dist/src/plan/nested-read.d.ts.map +1 -0
- package/dist/src/plan/nested-read.js +163 -0
- package/dist/src/plan/nested-read.js.map +1 -0
- package/dist/src/plan/nested.d.ts +280 -0
- package/dist/src/plan/nested.d.ts.map +1 -0
- package/dist/src/plan/nested.js +6 -0
- package/dist/src/plan/nested.js.map +1 -0
- package/dist/src/plan/ordered-source.d.ts +1030 -1
- package/dist/src/plan/ordered-source.d.ts.map +1 -1
- package/dist/src/plan/ordered-source.js +48 -6
- package/dist/src/plan/ordered-source.js.map +1 -1
- package/dist/src/plan/over.d.ts +111 -75
- package/dist/src/plan/over.d.ts.map +1 -1
- package/dist/src/plan/over.js +111 -75
- package/dist/src/plan/over.js.map +1 -1
- package/dist/src/plan/pick.d.ts +15 -3
- package/dist/src/plan/pick.d.ts.map +1 -1
- package/dist/src/plan/pick.js +75 -36
- package/dist/src/plan/pick.js.map +1 -1
- package/dist/src/plan/plan.d.ts +2719 -558
- package/dist/src/plan/plan.d.ts.map +1 -1
- package/dist/src/plan/plan.js +14 -2
- package/dist/src/plan/plan.js.map +1 -1
- package/dist/src/plan/reads.d.ts +421 -0
- package/dist/src/plan/reads.d.ts.map +1 -0
- package/dist/src/plan/reads.js +143 -0
- package/dist/src/plan/reads.js.map +1 -0
- package/dist/src/plan/refs.d.ts +111 -75
- package/dist/src/plan/refs.d.ts.map +1 -1
- package/dist/src/plan/refs.js +111 -75
- package/dist/src/plan/refs.js.map +1 -1
- package/dist/src/plan/root.d.ts +10 -5
- package/dist/src/plan/root.d.ts.map +1 -1
- package/dist/src/plan/root.js +76 -13
- package/dist/src/plan/root.js.map +1 -1
- package/dist/src/plan/series.d.ts +5140 -4331
- package/dist/src/plan/series.d.ts.map +1 -1
- package/dist/src/plan/series.js +1026 -264
- package/dist/src/plan/series.js.map +1 -1
- package/dist/src/plan/shade.d.ts +981 -0
- package/dist/src/plan/shade.d.ts.map +1 -0
- package/dist/src/plan/shade.js +60 -0
- package/dist/src/plan/shade.js.map +1 -0
- package/dist/src/plan/types.d.ts +178 -18
- package/dist/src/plan/types.d.ts.map +1 -1
- package/dist/src/plan/types.js +69 -19
- package/dist/src/plan/types.js.map +1 -1
- package/dist/src/query/builder.d.ts +3 -3
- package/dist/src/query/builder.d.ts.map +1 -1
- package/dist/src/query/builder.js +1 -1
- package/dist/src/query/library.d.ts +3 -3
- package/dist/src/query/library.d.ts.map +1 -1
- package/dist/src/query/library.js +1 -1
- package/dist/src/query/queries.d.ts +2 -2
- package/dist/src/query/queries.js +1 -1
- package/dist/src/query/saved.d.ts +8 -4
- package/dist/src/query/saved.d.ts.map +1 -1
- package/dist/src/query/saved.js +8 -4
- package/dist/src/query/saved.js.map +1 -1
- package/dist/src/query/types.d.ts +8 -3
- package/dist/src/query/types.d.ts.map +1 -1
- package/dist/src/query/types.js +8 -3
- package/dist/src/query/types.js.map +1 -1
- package/dist/src/roster/index.d.ts +47 -91
- package/dist/src/roster/index.d.ts.map +1 -1
- package/dist/src/roster/index.js +6 -6
- package/dist/src/roster/index.js.map +1 -1
- package/dist/src/roster/targets.d.ts +8 -4
- package/dist/src/roster/targets.d.ts.map +1 -1
- package/dist/src/roster/targets.js +9 -5
- package/dist/src/roster/targets.js.map +1 -1
- package/dist/src/schedule/cell-checks.js +3 -3
- package/dist/src/schedule/cell-checks.js.map +1 -1
- package/dist/src/schedule/days.d.ts +1 -1
- package/dist/src/schedule/days.js +1 -1
- package/dist/src/schedule/events.d.ts +10 -6
- package/dist/src/schedule/events.d.ts.map +1 -1
- package/dist/src/schedule/events.js +252 -228
- package/dist/src/schedule/events.js.map +1 -1
- package/dist/src/schedule/patch.d.ts +1 -1
- package/dist/src/schedule/patch.js +1 -1
- package/dist/src/schedule/periods.d.ts +8 -4
- package/dist/src/schedule/periods.d.ts.map +1 -1
- package/dist/src/schedule/periods.js +1 -1
- package/dist/src/schedule/periods.js.map +1 -1
- package/dist/src/schedule/record-window.d.ts +38 -58
- package/dist/src/schedule/record-window.d.ts.map +1 -1
- package/dist/src/schedule/record-window.js +15 -16
- package/dist/src/schedule/record-window.js.map +1 -1
- package/dist/src/schedule/resources.d.ts +1 -1
- package/dist/src/schedule/session.d.ts +1 -1
- package/dist/src/schedule/session.js +1 -1
- package/dist/src/schedule/types.d.ts +29 -1
- package/dist/src/schedule/types.d.ts.map +1 -1
- package/dist/src/schedule/types.js +16 -1
- package/dist/src/schedule/types.js.map +1 -1
- package/dist/src/schematic/index.d.ts +19 -9
- package/dist/src/schematic/index.d.ts.map +1 -1
- package/dist/src/schematic/index.js +19 -9
- package/dist/src/schematic/index.js.map +1 -1
- package/dist/src/schematic/kinds.d.ts +4 -4
- package/dist/src/schematic/kinds.js +9 -9
- package/dist/src/schematic/kinds.js.map +1 -1
- package/dist/src/schematic/payload.d.ts +38 -88
- package/dist/src/schematic/payload.d.ts.map +1 -1
- package/dist/src/schematic/payload.js +4 -4
- package/dist/src/schematic/payload.js.map +1 -1
- package/dist/src/schematic/window.d.ts +8 -7
- package/dist/src/schematic/window.d.ts.map +1 -1
- package/dist/src/schematic/window.js +22 -19
- package/dist/src/schematic/window.js.map +1 -1
- package/dist/src/sheet/bridge.d.ts +19 -0
- package/dist/src/sheet/bridge.d.ts.map +1 -1
- package/dist/src/sheet/bridge.js +28 -21
- package/dist/src/sheet/bridge.js.map +1 -1
- package/dist/src/sheet/index.d.ts +66 -46
- package/dist/src/sheet/index.d.ts.map +1 -1
- package/dist/src/sheet/index.js +66 -46
- package/dist/src/sheet/index.js.map +1 -1
- package/dist/src/sheet/library.d.ts +13 -8
- package/dist/src/sheet/library.d.ts.map +1 -1
- package/dist/src/sheet/library.js +13 -8
- package/dist/src/sheet/library.js.map +1 -1
- package/dist/src/sheet/record.d.ts +1 -1
- package/dist/src/sheet/record.js +2 -2
- package/dist/src/sheet/record.js.map +1 -1
- package/dist/src/sheet/registers.d.ts +152 -128
- package/dist/src/sheet/registers.d.ts.map +1 -1
- package/dist/src/sheet/registers.js +152 -128
- package/dist/src/sheet/registers.js.map +1 -1
- package/dist/src/sheet/root.d.ts +4 -1
- package/dist/src/sheet/root.d.ts.map +1 -1
- package/dist/src/sheet/root.js +15 -3
- package/dist/src/sheet/root.js.map +1 -1
- package/dist/src/sheet/sheet.d.ts +39 -113
- package/dist/src/sheet/sheet.d.ts.map +1 -1
- package/dist/src/sheet/sheet.js +7 -5
- package/dist/src/sheet/sheet.js.map +1 -1
- package/dist/src/sheet/sub-rows.d.ts +106 -76
- package/dist/src/sheet/sub-rows.d.ts.map +1 -1
- package/dist/src/sheet/sub-rows.js +106 -76
- package/dist/src/sheet/sub-rows.js.map +1 -1
- package/dist/src/sheet/types.d.ts +19 -62
- package/dist/src/sheet/types.d.ts.map +1 -1
- package/dist/src/studio/builder.d.ts +3 -153
- package/dist/src/studio/builder.d.ts.map +1 -1
- package/dist/src/studio/builder.js +1 -1
- package/dist/src/studio/canvas.d.ts +5 -4
- package/dist/src/studio/canvas.d.ts.map +1 -1
- package/dist/src/studio/canvas.js +8 -7
- package/dist/src/studio/canvas.js.map +1 -1
- package/dist/src/studio/component.d.ts +30 -20
- package/dist/src/studio/component.d.ts.map +1 -1
- package/dist/src/studio/component.js +26 -61
- package/dist/src/studio/component.js.map +1 -1
- package/dist/src/studio/index.d.ts +2 -2
- package/dist/src/studio/index.d.ts.map +1 -1
- package/dist/src/studio/index.js +1 -1
- package/dist/src/studio/index.js.map +1 -1
- package/dist/src/studio/inspector.d.ts +10 -39
- package/dist/src/studio/inspector.d.ts.map +1 -1
- package/dist/src/studio/inspector.js +11 -31
- package/dist/src/studio/inspector.js.map +1 -1
- package/dist/src/studio/library.d.ts +3 -169
- package/dist/src/studio/library.d.ts.map +1 -1
- package/dist/src/studio/library.js +1 -1
- package/dist/src/studio/page.d.ts +0 -8
- package/dist/src/studio/page.d.ts.map +1 -1
- package/dist/src/studio/pages.d.ts +17 -591
- package/dist/src/studio/pages.d.ts.map +1 -1
- package/dist/src/studio/pages.js +17 -44
- package/dist/src/studio/pages.js.map +1 -1
- package/dist/src/studio/palette.d.ts +2 -7
- package/dist/src/studio/palette.d.ts.map +1 -1
- package/dist/src/studio/palette.js +4 -5
- package/dist/src/studio/palette.js.map +1 -1
- package/dist/src/studio/publish.d.ts +8 -18
- package/dist/src/studio/publish.d.ts.map +1 -1
- package/dist/src/studio/publish.js +10 -36
- package/dist/src/studio/publish.js.map +1 -1
- package/dist/src/utils/derive.d.ts +12 -12
- package/dist/src/utils/derive.d.ts.map +1 -1
- package/dist/src/utils/derive.js +5 -2
- package/dist/src/utils/derive.js.map +1 -1
- package/dist/src/utils/ordered-source.d.ts.map +1 -1
- package/dist/src/utils/ordered-source.js +14 -5
- package/dist/src/utils/ordered-source.js.map +1 -1
- package/dist/test/allocation/allocation.examples.d.ts +1900 -1598
- package/dist/test/allocation/allocation.examples.d.ts.map +1 -1
- package/dist/test/allocation/allocation.examples.js +179 -89
- package/dist/test/allocation/allocation.examples.js.map +1 -1
- package/dist/test/allocation/optimise.examples.d.ts.map +1 -1
- package/dist/test/allocation/optimise.examples.js +7 -7
- package/dist/test/allocation/optimise.examples.js.map +1 -1
- package/dist/test/bind/data/data.examples.d.ts +1057 -903
- package/dist/test/bind/data/data.examples.d.ts.map +1 -1
- package/dist/test/bind/data/data.examples.js +260 -204
- package/dist/test/bind/data/data.examples.js.map +1 -1
- package/dist/test/bind/record/record.examples.d.ts +457 -426
- package/dist/test/bind/record/record.examples.d.ts.map +1 -1
- package/dist/test/bind/record/record.examples.js +41 -21
- package/dist/test/bind/record/record.examples.js.map +1 -1
- package/dist/test/calendar/calendar-records.examples.d.ts +162 -170
- package/dist/test/calendar/calendar-records.examples.d.ts.map +1 -1
- package/dist/test/calendar/calendar-records.examples.js +20 -12
- package/dist/test/calendar/calendar-records.examples.js.map +1 -1
- package/dist/test/calendar/calendar-windows.examples.d.ts.map +1 -1
- package/dist/test/calendar/calendar-windows.examples.js +12 -12
- package/dist/test/calendar/calendar-windows.examples.js.map +1 -1
- package/dist/test/calendar/calendar.examples.d.ts +1172 -901
- package/dist/test/calendar/calendar.examples.d.ts.map +1 -1
- package/dist/test/calendar/calendar.examples.js +211 -124
- package/dist/test/calendar/calendar.examples.js.map +1 -1
- package/dist/test/calendar/optimise.examples.js +2 -2
- package/dist/test/calendar/optimise.examples.js.map +1 -1
- package/dist/test/examples-package.d.ts +6 -9
- package/dist/test/examples-package.d.ts.map +1 -1
- package/dist/test/examples-package.js +11 -32
- package/dist/test/examples-package.js.map +1 -1
- package/dist/test/flowchart/flowchart.examples.d.ts +3841 -2820
- package/dist/test/flowchart/flowchart.examples.d.ts.map +1 -1
- package/dist/test/flowchart/flowchart.examples.js +211 -121
- package/dist/test/flowchart/flowchart.examples.js.map +1 -1
- package/dist/test/plan/optimise.examples.js +2 -2
- package/dist/test/plan/optimise.examples.js.map +1 -1
- package/dist/test/plan/plan-events.examples.d.ts +4055 -3263
- package/dist/test/plan/plan-events.examples.d.ts.map +1 -1
- package/dist/test/plan/plan-events.examples.js +492 -319
- package/dist/test/plan/plan-events.examples.js.map +1 -1
- package/dist/test/plan/plan-nested.examples.d.ts +1829 -0
- package/dist/test/plan/plan-nested.examples.d.ts.map +1 -0
- package/dist/test/plan/plan-nested.examples.js +321 -0
- package/dist/test/plan/plan-nested.examples.js.map +1 -0
- package/dist/test/plan/plan-records.examples.d.ts +328 -362
- package/dist/test/plan/plan-records.examples.d.ts.map +1 -1
- package/dist/test/plan/plan-records.examples.js +81 -57
- package/dist/test/plan/plan-records.examples.js.map +1 -1
- package/dist/test/plan/plan-windows.examples.d.ts +1756 -1398
- package/dist/test/plan/plan-windows.examples.d.ts.map +1 -1
- package/dist/test/plan/plan-windows.examples.js +161 -128
- package/dist/test/plan/plan-windows.examples.js.map +1 -1
- package/dist/test/plan/plan.examples.d.ts +2238 -5712
- package/dist/test/plan/plan.examples.d.ts.map +1 -1
- package/dist/test/plan/plan.examples.js +839 -968
- package/dist/test/plan/plan.examples.js.map +1 -1
- package/dist/test/query/query.examples.d.ts +5221 -3005
- package/dist/test/query/query.examples.d.ts.map +1 -1
- package/dist/test/query/query.examples.js +169 -118
- package/dist/test/query/query.examples.js.map +1 -1
- package/dist/test/roster/optimise.examples.d.ts.map +1 -1
- package/dist/test/roster/optimise.examples.js +7 -7
- package/dist/test/roster/optimise.examples.js.map +1 -1
- package/dist/test/roster/roster-records.examples.d.ts +364 -392
- package/dist/test/roster/roster-records.examples.d.ts.map +1 -1
- package/dist/test/roster/roster-records.examples.js +40 -26
- package/dist/test/roster/roster-records.examples.js.map +1 -1
- package/dist/test/roster/roster.examples.d.ts +4605 -4308
- package/dist/test/roster/roster.examples.d.ts.map +1 -1
- package/dist/test/roster/roster.examples.js +212 -113
- package/dist/test/roster/roster.examples.js.map +1 -1
- package/dist/test/schedule/schedule.examples.d.ts +2646 -2471
- package/dist/test/schedule/schedule.examples.d.ts.map +1 -1
- package/dist/test/schedule/schedule.examples.js +144 -88
- package/dist/test/schedule/schedule.examples.js.map +1 -1
- package/dist/test/schematic/schematic-records.examples.d.ts +286 -276
- package/dist/test/schematic/schematic-records.examples.d.ts.map +1 -1
- package/dist/test/schematic/schematic-records.examples.js +52 -38
- package/dist/test/schematic/schematic-records.examples.js.map +1 -1
- package/dist/test/schematic/schematic.examples.d.ts +1842 -1491
- package/dist/test/schematic/schematic.examples.d.ts.map +1 -1
- package/dist/test/schematic/schematic.examples.js +240 -134
- package/dist/test/schematic/schematic.examples.js.map +1 -1
- package/dist/test/sheet/optimise.examples.d.ts +102 -95
- package/dist/test/sheet/optimise.examples.d.ts.map +1 -1
- package/dist/test/sheet/optimise.examples.js +7 -3
- package/dist/test/sheet/optimise.examples.js.map +1 -1
- package/dist/test/sheet/sheet-records.examples.d.ts +175 -214
- package/dist/test/sheet/sheet-records.examples.d.ts.map +1 -1
- package/dist/test/sheet/sheet-records.examples.js +29 -17
- package/dist/test/sheet/sheet-records.examples.js.map +1 -1
- package/dist/test/sheet/sheet.examples.d.ts +3642 -3353
- package/dist/test/sheet/sheet.examples.d.ts.map +1 -1
- package/dist/test/sheet/sheet.examples.js +389 -282
- package/dist/test/sheet/sheet.examples.js.map +1 -1
- package/dist/test/studio/component.examples.js +2 -2
- package/dist/test/studio/component.examples.js.map +1 -1
- package/dist/test/studio/page.examples.js +6 -6
- package/dist/test/studio/page.examples.js.map +1 -1
- package/dist/test/studio/studio.examples.d.ts +2329 -873
- package/dist/test/studio/studio.examples.d.ts.map +1 -1
- package/dist/test/studio/studio.examples.js +155 -107
- package/dist/test/studio/studio.examples.js.map +1 -1
- package/package.json +15 -11
|
@@ -0,0 +1,143 @@
|
|
|
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
|
+
* A Save's patch over rows read beside their nested series index, restated by
|
|
7
|
+
* key (#1438). East's diff of a Dict whose every key went one way is one whole
|
|
8
|
+
* `replace`: a machine whose only job moves off it sends `replace { before: {
|
|
9
|
+
* j-42 }, after: {} }`, which conflicts with another planner's job added to it
|
|
10
|
+
* meanwhile. The Plan restates each collection the index lists as the
|
|
11
|
+
* operations a `replace` stands for, key by key — a `delete` of each key it
|
|
12
|
+
* held, an `insert` of each it holds, an `update` of each in both that changed
|
|
13
|
+
* — down through child rows, so a commit's patch names only the items and
|
|
14
|
+
* values it changed, and e3 checks each against what it was. A node of a
|
|
15
|
+
* recursive tree is a whole value to East's patches, so its update replaces it
|
|
16
|
+
* whole, by its key.
|
|
17
|
+
*
|
|
18
|
+
* @packageDocumentation
|
|
19
|
+
*/
|
|
20
|
+
import { DictType, East, OptionType, PatchType, dictPatchOpsType, some, variant, } from "@elaraai/east";
|
|
21
|
+
import { EditingChangeSetTypeFor } from "@elaraai/east-ui/internal";
|
|
22
|
+
/**
|
|
23
|
+
* A Dict's patch with its `replace` restated by key, and each `update` of a
|
|
24
|
+
* value restated within where its values hold more collections.
|
|
25
|
+
*
|
|
26
|
+
* @param type - The Dict's type
|
|
27
|
+
* @param inner - The restatement of its values' patches, where they hold collections
|
|
28
|
+
* @returns The restatement
|
|
29
|
+
*/
|
|
30
|
+
function dictByKey(type, inner) {
|
|
31
|
+
const patchType = PatchType(type);
|
|
32
|
+
const opType = dictPatchOpsType(type.value);
|
|
33
|
+
const opsType = DictType(type.key, opType);
|
|
34
|
+
return East.function([patchType], patchType, ($, patch) => {
|
|
35
|
+
const out = $.let(patch);
|
|
36
|
+
$.match(patch, {
|
|
37
|
+
replace: ($2, whole) => {
|
|
38
|
+
const ops = $2.let(new Map(), opsType);
|
|
39
|
+
$2.for(whole.before, ($3, was, key) => {
|
|
40
|
+
$3.match(whole.after.tryGet(key), {
|
|
41
|
+
none: ($4) => { $4(ops.insert(key, East.value(variant("delete", was), opType))); },
|
|
42
|
+
some: ($4, now) => {
|
|
43
|
+
$4.if(East.notEqual(was, now), ($5) => {
|
|
44
|
+
$5(ops.insert(key, East.value(variant("update", East.diff(was, now)), opType)));
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
$2.for(whole.after, ($3, now, key) => {
|
|
50
|
+
$3.if(whole.before.has(key).not(), ($4) => {
|
|
51
|
+
$4(ops.insert(key, East.value(variant("insert", now), opType)));
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
$2.assign(out, East.value(variant("patch", ops), patchType));
|
|
55
|
+
},
|
|
56
|
+
...(inner === undefined ? {} : {
|
|
57
|
+
patch: ($2, ops) => {
|
|
58
|
+
const restate = $2.const(inner);
|
|
59
|
+
const restated = ops.map((_$3, op) => op.match({ update: (_$4, value) => East.value(variant("update", restate(value)), opType) }, () => op));
|
|
60
|
+
$2.assign(out, East.value(variant("patch", restated), patchType));
|
|
61
|
+
},
|
|
62
|
+
}),
|
|
63
|
+
});
|
|
64
|
+
return out;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* A row's patch with each collection the index lists restated by key, down
|
|
69
|
+
* through its child rows; `undefined` for a row of a recursive tree, which
|
|
70
|
+
* East patches whole, or one listing no Dict.
|
|
71
|
+
*
|
|
72
|
+
* @param rowType - The row's type
|
|
73
|
+
* @param collections - The collections the index lists in it, by field
|
|
74
|
+
* @returns The restatement
|
|
75
|
+
*/
|
|
76
|
+
function rowByKey(rowType, collections) {
|
|
77
|
+
if (rowType.type !== "Struct")
|
|
78
|
+
return undefined;
|
|
79
|
+
const fields = [];
|
|
80
|
+
for (const [field, declared] of collections) {
|
|
81
|
+
const fieldType = rowType.fields[field];
|
|
82
|
+
if (fieldType?.type !== "Dict")
|
|
83
|
+
continue;
|
|
84
|
+
const dict = fieldType;
|
|
85
|
+
const inner = declared.kind === "rows" ? rowByKey(dict.value, declared.collections) : undefined;
|
|
86
|
+
fields.push([field, dictByKey(dict, inner)]);
|
|
87
|
+
}
|
|
88
|
+
if (fields.length === 0)
|
|
89
|
+
return undefined;
|
|
90
|
+
const patchType = PatchType(rowType);
|
|
91
|
+
return East.function([patchType], patchType, ($, patch) => {
|
|
92
|
+
const restate = fields.map(([field, fn]) => [field, $.const(fn)]);
|
|
93
|
+
const out = $.let(patch);
|
|
94
|
+
$.match(patch, {
|
|
95
|
+
patch: ($2, parts) => {
|
|
96
|
+
// Each step held in a variable of its own: an expression read twice is written out twice.
|
|
97
|
+
const next = restate.reduce((was, [field, fn]) => {
|
|
98
|
+
const held = $2.let(was);
|
|
99
|
+
return East.withField(held, field, fn(East.field(held, field)));
|
|
100
|
+
}, parts);
|
|
101
|
+
$2.assign(out, East.value(variant("patch", next), patchType));
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
return out;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* A Plan's batch over rows read beside their nested series index, each
|
|
109
|
+
* change's patch restated by key (see the module docs).
|
|
110
|
+
*
|
|
111
|
+
* @param entryType - The rows' type
|
|
112
|
+
* @param keyType - Their key's type
|
|
113
|
+
* @param index - The nested series index the rows are read beside
|
|
114
|
+
* @returns `(ChangeSet(R, K)) → ChangeSet(R, K)`; `undefined` where the index lists no collection a patch reaches by key
|
|
115
|
+
*/
|
|
116
|
+
export function planNestedRestatement(entryType, keyType, index) {
|
|
117
|
+
const row = rowByKey(entryType, index.collections);
|
|
118
|
+
if (row === undefined)
|
|
119
|
+
return undefined;
|
|
120
|
+
const entryPatch = PatchType(OptionType(entryType));
|
|
121
|
+
const entry = East.function([entryPatch], entryPatch, ($, patch) => {
|
|
122
|
+
const restate = $.const(row);
|
|
123
|
+
const out = $.let(patch);
|
|
124
|
+
$.match(patch, {
|
|
125
|
+
patch: ($2, inner) => {
|
|
126
|
+
$2.match(inner, {
|
|
127
|
+
some: ($3, rowPatch) => {
|
|
128
|
+
// The option's patch, its `some` case the row's.
|
|
129
|
+
$3.assign(out, East.value(variant("patch", some(restate(rowPatch))), entryPatch));
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
return out;
|
|
135
|
+
});
|
|
136
|
+
const batchType = EditingChangeSetTypeFor(entryType, keyType);
|
|
137
|
+
return East.function([batchType], batchType, ($, batch) => {
|
|
138
|
+
const restate = $.const(entry);
|
|
139
|
+
const changes = batch.changes;
|
|
140
|
+
return East.withField(batch, "changes", changes.map((_$2, change) => East.withField(change, "patch", restate(change.patch))));
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=nested-patch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nested-patch.js","sourceRoot":"","sources":["../../../src/plan/nested-patch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACH,QAAQ,EAAE,IAAI,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