@elaraai/east-ui 1.0.80 → 1.0.82
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/charts/chart/index.d.ts +4 -0
- package/dist/src/charts/chart/index.d.ts.map +1 -1
- package/dist/src/charts/spec/index.d.ts +8 -0
- package/dist/src/charts/spec/index.d.ts.map +1 -1
- package/dist/src/collections/deck/index.d.ts +8 -0
- package/dist/src/collections/deck/index.d.ts.map +1 -1
- package/dist/src/collections/index.d.ts +2 -2
- package/dist/src/collections/index.d.ts.map +1 -1
- package/dist/src/collections/index.js.map +1 -1
- package/dist/src/collections/library/index.d.ts +4 -0
- package/dist/src/collections/library/index.d.ts.map +1 -1
- package/dist/src/collections/library/types.d.ts +4 -0
- package/dist/src/collections/library/types.d.ts.map +1 -1
- package/dist/src/collections/matrix/index.d.ts +56 -19
- package/dist/src/collections/matrix/index.d.ts.map +1 -1
- package/dist/src/collections/matrix/index.js +38 -24
- package/dist/src/collections/matrix/index.js.map +1 -1
- package/dist/src/collections/plan/assemble.d.ts +655 -2113
- package/dist/src/collections/plan/assemble.d.ts.map +1 -1
- package/dist/src/collections/plan/assemble.js +159 -136
- package/dist/src/collections/plan/assemble.js.map +1 -1
- package/dist/src/collections/plan/builders.d.ts +193 -40
- package/dist/src/collections/plan/builders.d.ts.map +1 -1
- package/dist/src/collections/plan/builders.js +162 -32
- package/dist/src/collections/plan/builders.js.map +1 -1
- package/dist/src/collections/plan/factories.d.ts +290 -116
- package/dist/src/collections/plan/factories.d.ts.map +1 -1
- package/dist/src/collections/plan/factories.js +281 -156
- package/dist/src/collections/plan/factories.js.map +1 -1
- package/dist/src/collections/plan/index.d.ts +111 -58
- package/dist/src/collections/plan/index.d.ts.map +1 -1
- package/dist/src/collections/plan/index.js +62 -31
- package/dist/src/collections/plan/index.js.map +1 -1
- package/dist/src/collections/plan/ir.d.ts +759 -1769
- package/dist/src/collections/plan/ir.d.ts.map +1 -1
- package/dist/src/collections/plan/ir.js +51 -27
- package/dist/src/collections/plan/ir.js.map +1 -1
- package/dist/src/collections/plan/pick.d.ts +89 -71
- package/dist/src/collections/plan/pick.d.ts.map +1 -1
- package/dist/src/collections/plan/pick.js +101 -86
- package/dist/src/collections/plan/pick.js.map +1 -1
- package/dist/src/collections/plan/root.d.ts +164 -77
- package/dist/src/collections/plan/root.d.ts.map +1 -1
- package/dist/src/collections/plan/root.js +350 -42
- package/dist/src/collections/plan/root.js.map +1 -1
- package/dist/src/collections/plan/series.d.ts +12524 -10527
- package/dist/src/collections/plan/series.d.ts.map +1 -1
- package/dist/src/collections/plan/series.js +1596 -298
- package/dist/src/collections/plan/series.js.map +1 -1
- package/dist/src/collections/plan/types.d.ts +6115 -2802
- package/dist/src/collections/plan/types.d.ts.map +1 -1
- package/dist/src/collections/plan/types.js +575 -170
- package/dist/src/collections/plan/types.js.map +1 -1
- package/dist/src/collections/sheet/bridge.d.ts +154 -43
- package/dist/src/collections/sheet/bridge.d.ts.map +1 -1
- package/dist/src/collections/sheet/bridge.js +383 -240
- package/dist/src/collections/sheet/bridge.js.map +1 -1
- package/dist/src/collections/sheet/columns.d.ts +66 -16
- package/dist/src/collections/sheet/columns.d.ts.map +1 -1
- package/dist/src/collections/sheet/columns.js +25 -25
- package/dist/src/collections/sheet/columns.js.map +1 -1
- package/dist/src/collections/sheet/context-bridge.d.ts +48 -0
- package/dist/src/collections/sheet/context-bridge.d.ts.map +1 -0
- package/dist/src/collections/sheet/context-bridge.js +216 -0
- package/dist/src/collections/sheet/context-bridge.js.map +1 -0
- package/dist/src/collections/sheet/draft-bridge.d.ts +37 -0
- package/dist/src/collections/sheet/draft-bridge.d.ts.map +1 -0
- package/dist/src/collections/sheet/draft-bridge.js +153 -0
- package/dist/src/collections/sheet/draft-bridge.js.map +1 -0
- package/dist/src/collections/sheet/drafts.d.ts +14 -0
- package/dist/src/collections/sheet/drafts.d.ts.map +1 -0
- package/dist/src/collections/sheet/drafts.js +14 -0
- package/dist/src/collections/sheet/drafts.js.map +1 -0
- package/dist/src/collections/sheet/editing-bridge.d.ts +36 -0
- package/dist/src/collections/sheet/editing-bridge.d.ts.map +1 -0
- package/dist/src/collections/sheet/editing-bridge.js +196 -0
- package/dist/src/collections/sheet/editing-bridge.js.map +1 -0
- package/dist/src/collections/sheet/editing-types.d.ts +268 -0
- package/dist/src/collections/sheet/editing-types.d.ts.map +1 -0
- package/dist/src/collections/sheet/editing-types.js +34 -0
- package/dist/src/collections/sheet/editing-types.js.map +1 -0
- package/dist/src/collections/sheet/edits.d.ts +37 -0
- package/dist/src/collections/sheet/edits.d.ts.map +1 -0
- package/dist/src/collections/sheet/edits.js +31 -0
- package/dist/src/collections/sheet/edits.js.map +1 -0
- package/dist/src/collections/sheet/group.d.ts +165 -0
- package/dist/src/collections/sheet/group.d.ts.map +1 -0
- package/dist/src/collections/sheet/group.js +52 -0
- package/dist/src/collections/sheet/group.js.map +1 -0
- package/dist/src/collections/sheet/index.d.ts +171 -27
- package/dist/src/collections/sheet/index.d.ts.map +1 -1
- package/dist/src/collections/sheet/index.js +99 -17
- package/dist/src/collections/sheet/index.js.map +1 -1
- package/dist/src/collections/sheet/link.d.ts +22 -16
- package/dist/src/collections/sheet/link.d.ts.map +1 -1
- package/dist/src/collections/sheet/link.js +18 -12
- package/dist/src/collections/sheet/link.js.map +1 -1
- package/dist/src/collections/sheet/registers.d.ts +152 -5
- package/dist/src/collections/sheet/registers.d.ts.map +1 -1
- package/dist/src/collections/sheet/registers.js +154 -5
- package/dist/src/collections/sheet/registers.js.map +1 -1
- package/dist/src/collections/sheet/root.d.ts +175 -26
- package/dist/src/collections/sheet/root.d.ts.map +1 -1
- package/dist/src/collections/sheet/root.js +150 -26
- package/dist/src/collections/sheet/root.js.map +1 -1
- package/dist/src/collections/sheet/seed-bridge.d.ts +14 -0
- package/dist/src/collections/sheet/seed-bridge.d.ts.map +1 -0
- package/dist/src/collections/sheet/seed-bridge.js +51 -0
- package/dist/src/collections/sheet/seed-bridge.js.map +1 -0
- package/dist/src/collections/sheet/sub-rows.d.ts +249 -0
- package/dist/src/collections/sheet/sub-rows.d.ts.map +1 -0
- package/dist/src/collections/sheet/sub-rows.js +222 -0
- package/dist/src/collections/sheet/sub-rows.js.map +1 -0
- package/dist/src/collections/sheet/transactions.d.ts +76 -0
- package/dist/src/collections/sheet/transactions.d.ts.map +1 -0
- package/dist/src/collections/sheet/transactions.js +40 -0
- package/dist/src/collections/sheet/transactions.js.map +1 -0
- package/dist/src/collections/sheet/types.d.ts +12034 -3651
- package/dist/src/collections/sheet/types.d.ts.map +1 -1
- package/dist/src/collections/sheet/types.js +365 -48
- package/dist/src/collections/sheet/types.js.map +1 -1
- package/dist/src/collections/table/index.d.ts +98 -123
- package/dist/src/collections/table/index.d.ts.map +1 -1
- package/dist/src/collections/table/index.js +97 -111
- package/dist/src/collections/table/index.js.map +1 -1
- package/dist/src/collections/table/types.d.ts +87 -31
- package/dist/src/collections/table/types.d.ts.map +1 -1
- package/dist/src/collections/table/types.js +51 -26
- package/dist/src/collections/table/types.js.map +1 -1
- package/dist/src/collections/value-tree/flatten.d.ts.map +1 -1
- package/dist/src/collections/value-tree/flatten.js +4 -1
- package/dist/src/collections/value-tree/flatten.js.map +1 -1
- package/dist/src/component.d.ts +5075 -4079
- package/dist/src/component.d.ts.map +1 -1
- package/dist/src/component.js +46 -46
- package/dist/src/component.js.map +1 -1
- package/dist/src/contracts/approval.d.ts +10 -8
- package/dist/src/contracts/approval.d.ts.map +1 -1
- package/dist/src/contracts/approval.js +10 -8
- package/dist/src/contracts/approval.js.map +1 -1
- package/dist/src/contracts/drag.d.ts +11 -9
- package/dist/src/contracts/drag.d.ts.map +1 -1
- package/dist/src/contracts/drag.js +28 -21
- package/dist/src/contracts/drag.js.map +1 -1
- package/dist/src/contracts/editing.d.ts +1283 -0
- package/dist/src/contracts/editing.d.ts.map +1 -0
- package/dist/src/contracts/editing.js +711 -0
- package/dist/src/contracts/editing.js.map +1 -0
- package/dist/src/contracts/index.d.ts +2 -1
- package/dist/src/contracts/index.d.ts.map +1 -1
- package/dist/src/contracts/index.js +2 -1
- package/dist/src/contracts/index.js.map +1 -1
- package/dist/src/contracts/pick.d.ts +6 -7
- package/dist/src/contracts/pick.d.ts.map +1 -1
- package/dist/src/contracts/pick.js +6 -7
- package/dist/src/contracts/pick.js.map +1 -1
- package/dist/src/contracts/review.d.ts +3 -1
- package/dist/src/contracts/review.d.ts.map +1 -1
- package/dist/src/contracts/review.js +3 -1
- package/dist/src/contracts/review.js.map +1 -1
- package/dist/src/contracts/source.d.ts +270 -80
- package/dist/src/contracts/source.d.ts.map +1 -1
- package/dist/src/contracts/source.js +357 -58
- package/dist/src/contracts/source.js.map +1 -1
- package/dist/src/display/chip-rail/index.d.ts.map +1 -1
- package/dist/src/display/chip-rail/index.js +10 -10
- package/dist/src/display/chip-rail/index.js.map +1 -1
- package/dist/src/extension.d.ts +2 -1
- package/dist/src/extension.d.ts.map +1 -1
- package/dist/src/extension.js +2 -1
- package/dist/src/extension.js.map +1 -1
- package/dist/src/format/index.d.ts +1 -154
- package/dist/src/format/index.d.ts.map +1 -1
- package/dist/src/format/types.d.ts +35 -23
- package/dist/src/format/types.d.ts.map +1 -1
- package/dist/src/format/types.js +16 -14
- package/dist/src/format/types.js.map +1 -1
- package/dist/src/forms/field/index.js +4 -4
- package/dist/src/forms/field/index.js.map +1 -1
- package/dist/src/forms/file-upload/index.js +16 -16
- package/dist/src/forms/file-upload/index.js.map +1 -1
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +12 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal.d.ts +8 -3
- package/dist/src/internal.d.ts.map +1 -1
- package/dist/src/internal.js +11 -3
- package/dist/src/internal.js.map +1 -1
- package/dist/src/layout/box/index.d.ts.map +1 -1
- package/dist/src/layout/box/index.js +47 -47
- package/dist/src/layout/box/index.js.map +1 -1
- package/dist/src/layout/flex/index.d.ts.map +1 -1
- package/dist/src/layout/flex/index.js +47 -47
- package/dist/src/layout/flex/index.js.map +1 -1
- package/dist/src/layout/grid/index.js +11 -11
- package/dist/src/layout/grid/index.js.map +1 -1
- package/dist/src/layout/scroll-area/index.d.ts.map +1 -1
- package/dist/src/layout/scroll-area/index.js +8 -8
- package/dist/src/layout/scroll-area/index.js.map +1 -1
- package/dist/src/layout/separator/index.d.ts.map +1 -1
- package/dist/src/layout/separator/index.js +6 -6
- package/dist/src/layout/separator/index.js.map +1 -1
- package/dist/src/layout/stack/index.d.ts.map +1 -1
- package/dist/src/layout/stack/index.js +46 -46
- package/dist/src/layout/stack/index.js.map +1 -1
- package/dist/src/layout/sticky/index.d.ts.map +1 -1
- package/dist/src/layout/sticky/index.js +8 -8
- package/dist/src/layout/sticky/index.js.map +1 -1
- package/dist/src/overlays/action-bar/index.d.ts.map +1 -1
- package/dist/src/overlays/action-bar/index.js +8 -8
- package/dist/src/overlays/action-bar/index.js.map +1 -1
- package/dist/src/platform/index.d.ts +1 -1
- package/dist/src/platform/index.d.ts.map +1 -1
- package/dist/src/platform/index.js +1 -1
- package/dist/src/platform/index.js.map +1 -1
- package/dist/src/platform/slice/impl.d.ts +62 -51
- package/dist/src/platform/slice/impl.d.ts.map +1 -1
- package/dist/src/platform/slice/impl.js +155 -72
- package/dist/src/platform/slice/impl.js.map +1 -1
- package/dist/src/platform/slice/index.d.ts +3744 -2226
- package/dist/src/platform/slice/index.d.ts.map +1 -1
- package/dist/src/platform/slice/index.js +43 -1
- package/dist/src/platform/slice/index.js.map +1 -1
- package/dist/src/runtime/collections/deck.d.ts +4 -0
- package/dist/src/runtime/collections/deck.d.ts.map +1 -1
- package/dist/src/runtime/collections/matrix.d.ts +10 -9
- package/dist/src/runtime/collections/matrix.d.ts.map +1 -1
- package/dist/src/runtime/collections/matrix.js +11 -6
- package/dist/src/runtime/collections/matrix.js.map +1 -1
- package/dist/src/runtime/collections/plan.d.ts +148 -65
- package/dist/src/runtime/collections/plan.d.ts.map +1 -1
- package/dist/src/runtime/collections/plan.js +155 -67
- package/dist/src/runtime/collections/plan.js.map +1 -1
- package/dist/src/runtime/collections/sheet.d.ts +56 -23
- package/dist/src/runtime/collections/sheet.d.ts.map +1 -1
- package/dist/src/runtime/collections/sheet.js +30 -22
- package/dist/src/runtime/collections/sheet.js.map +1 -1
- package/dist/src/runtime/collections/table.d.ts +18 -11
- package/dist/src/runtime/collections/table.d.ts.map +1 -1
- package/dist/src/runtime/collections/table.js +7 -4
- package/dist/src/runtime/collections/table.js.map +1 -1
- package/dist/src/shared/reify.d.ts +4 -46
- package/dist/src/shared/reify.d.ts.map +1 -1
- package/dist/src/shared/reify.js +4 -61
- package/dist/src/shared/reify.js.map +1 -1
- package/dist/src/shared/tree.d.ts +88 -0
- package/dist/src/shared/tree.d.ts.map +1 -0
- package/dist/src/shared/tree.js +134 -0
- package/dist/src/shared/tree.js.map +1 -0
- package/dist/src/slice/breakdown/index.d.ts +4 -0
- package/dist/src/slice/breakdown/index.d.ts.map +1 -1
- package/dist/src/slice/breakdown/types.d.ts +4 -0
- package/dist/src/slice/breakdown/types.d.ts.map +1 -1
- package/dist/src/slice/cohort/index.d.ts +24 -4
- package/dist/src/slice/cohort/index.d.ts.map +1 -1
- package/dist/src/slice/cohort/index.js +8 -4
- package/dist/src/slice/cohort/index.js.map +1 -1
- package/dist/src/slice/cohort/types.d.ts +11 -0
- package/dist/src/slice/cohort/types.d.ts.map +1 -1
- package/dist/src/slice/cohort/types.js +7 -0
- package/dist/src/slice/cohort/types.js.map +1 -1
- package/dist/src/slice/filter/index.d.ts +4 -0
- package/dist/src/slice/filter/index.d.ts.map +1 -1
- package/dist/src/slice/filter/types.d.ts +4 -0
- package/dist/src/slice/filter/types.d.ts.map +1 -1
- package/dist/src/slice/index.d.ts +736 -0
- package/dist/src/slice/index.d.ts.map +1 -1
- package/dist/src/slice/legend/index.d.ts +4 -0
- package/dist/src/slice/legend/index.d.ts.map +1 -1
- package/dist/src/slice/legend/types.d.ts +4 -0
- package/dist/src/slice/legend/types.d.ts.map +1 -1
- package/dist/src/slice/rail/index.d.ts +8 -4
- package/dist/src/slice/rail/index.d.ts.map +1 -1
- package/dist/src/slice/rail/index.js.map +1 -1
- package/dist/src/slice/range/index.d.ts +4 -0
- package/dist/src/slice/range/index.d.ts.map +1 -1
- package/dist/src/slice/range/types.d.ts +4 -0
- package/dist/src/slice/range/types.d.ts.map +1 -1
- package/dist/src/slice/search/index.d.ts +4 -0
- package/dist/src/slice/search/index.d.ts.map +1 -1
- package/dist/src/slice/search/types.d.ts +4 -0
- package/dist/src/slice/search/types.d.ts.map +1 -1
- package/dist/src/slice/summary/index.d.ts +4 -0
- package/dist/src/slice/summary/index.d.ts.map +1 -1
- package/dist/src/slice/summary/types.d.ts +4 -0
- package/dist/src/slice/summary/types.d.ts.map +1 -1
- package/dist/src/typography/code/index.js +1 -1
- package/dist/src/typography/code/index.js.map +1 -1
- package/dist/src/typography/code-block/index.js +7 -7
- package/dist/src/typography/code-block/index.js.map +1 -1
- package/dist/src/typography/heading/index.js +2 -2
- package/dist/src/typography/heading/index.js.map +1 -1
- package/dist/src/typography/list/index.js +1 -1
- package/dist/src/typography/list/index.js.map +1 -1
- package/dist/src/typography/mark/index.js +1 -1
- package/dist/src/typography/mark/index.js.map +1 -1
- package/dist/src/typography/note/index.js +1 -1
- package/dist/src/typography/note/index.js.map +1 -1
- package/dist/src/typography/numeric/index.d.ts +3 -308
- package/dist/src/typography/numeric/index.d.ts.map +1 -1
- package/dist/src/typography/numeric/index.js +4 -4
- package/dist/src/typography/numeric/index.js.map +1 -1
- package/dist/src/typography/numeric/types.d.ts +1 -154
- package/dist/src/typography/numeric/types.d.ts.map +1 -1
- package/dist/src/typography/text/index.js +1 -1
- package/dist/src/typography/text/index.js.map +1 -1
- package/dist/test/collections/matrix.examples.d.ts +7 -3
- package/dist/test/collections/matrix.examples.d.ts.map +1 -1
- package/dist/test/collections/matrix.examples.js +55 -24
- package/dist/test/collections/matrix.examples.js.map +1 -1
- package/dist/test/collections/paged-source.examples.d.ts +4 -0
- package/dist/test/collections/paged-source.examples.d.ts.map +1 -1
- package/dist/test/collections/paged-source.examples.js +98 -13
- package/dist/test/collections/paged-source.examples.js.map +1 -1
- package/dist/test/collections/plan.examples.d.ts +101 -26
- package/dist/test/collections/plan.examples.d.ts.map +1 -1
- package/dist/test/collections/plan.examples.js +1481 -755
- package/dist/test/collections/plan.examples.js.map +1 -1
- package/dist/test/collections/sheet-link.examples.d.ts +7 -0
- package/dist/test/collections/sheet-link.examples.d.ts.map +1 -0
- package/dist/test/collections/sheet-link.examples.js +41 -0
- package/dist/test/collections/sheet-link.examples.js.map +1 -0
- package/dist/test/collections/sheet-transactions.examples.d.ts +7 -0
- package/dist/test/collections/sheet-transactions.examples.d.ts.map +1 -0
- package/dist/test/collections/sheet-transactions.examples.js +58 -0
- package/dist/test/collections/sheet-transactions.examples.js.map +1 -0
- package/dist/test/collections/sheet.examples.d.ts +52 -5
- package/dist/test/collections/sheet.examples.d.ts.map +1 -1
- package/dist/test/collections/sheet.examples.js +500 -158
- package/dist/test/collections/sheet.examples.js.map +1 -1
- package/dist/test/collections/table.examples.d.ts +31 -3
- package/dist/test/collections/table.examples.d.ts.map +1 -1
- package/dist/test/collections/table.examples.js +188 -28
- package/dist/test/collections/table.examples.js.map +1 -1
- package/dist/test/contracts/editing.examples.d.ts +7 -0
- package/dist/test/contracts/editing.examples.d.ts.map +1 -0
- package/dist/test/contracts/editing.examples.js +58 -0
- package/dist/test/contracts/editing.examples.js.map +1 -0
- package/dist/test/layout/splitter.examples.d.ts.map +1 -1
- package/dist/test/layout/splitter.examples.js +3 -1
- package/dist/test/layout/splitter.examples.js.map +1 -1
- package/dist/test/platform/slice.examples.d.ts.map +1 -1
- package/dist/test/platform/slice.examples.js +1 -0
- package/dist/test/platform/slice.examples.js.map +1 -1
- package/dist/test/slice/slice.examples.d.ts.map +1 -1
- package/dist/test/slice/slice.examples.js +5 -2
- package/dist/test/slice/slice.examples.js.map +1 -1
- package/package.json +4 -3
- package/dist/src/collections/plan/data-forms.d.ts +0 -332
- package/dist/src/collections/plan/data-forms.d.ts.map +0 -1
- package/dist/src/collections/plan/data-forms.js +0 -212
- package/dist/src/collections/plan/data-forms.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../../../src/runtime/collections/sheet.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACrG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../../../src/runtime/collections/sheet.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACrG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAEH,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,cAAc,EACtB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C;;;;;GAKG;AACH,iBAAS,QAAQ,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,eAAe,CAAC,CAAC,CAAC,EAChE,KAAK,EAAE;IACH,IAAI,EAAE,OAAO,CAAC,kBAAk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AAO,MAAM,KAAK,EAAE,OAAO,QAAQ,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,CAAsC,CAAC"}
|
|
@@ -8,6 +8,10 @@ function SheetTag(props) {
|
|
|
8
8
|
const { data, columns, ...options } = props;
|
|
9
9
|
return SheetFactory.Root(data, columns, hasKeys(options) ? options : undefined);
|
|
10
10
|
}
|
|
11
|
+
// The tag IS the root, so `Root` is the one factory member it does not carry.
|
|
12
|
+
// Derived, never hand-listed: a member added to `SheetNamespace` rides the tag
|
|
13
|
+
// with no edit here (#862, as #814 did for the Plan).
|
|
14
|
+
const { Root: _root, ...authoring } = SheetFactory;
|
|
11
15
|
/**
|
|
12
16
|
* The planning spreadsheet — rows are the host's records, columns are TYPED
|
|
13
17
|
* (`Sheet.column.date` / `quantity` / `lookup` / `reference` / `enum` /
|
|
@@ -22,24 +26,30 @@ function SheetTag(props) {
|
|
|
22
26
|
* @example
|
|
23
27
|
* ```tsx
|
|
24
28
|
* // .tsx file with the `@jsxImportSource @elaraai/east-ui` pragma
|
|
25
|
-
* import {
|
|
29
|
+
* import { ArrayType, DateTimeType, East, FloatType, OptionType, StringType, StructType, none } from "@elaraai/east";
|
|
26
30
|
* import { Reactive, Sheet, State, UIComponentType } from "@elaraai/east-ui";
|
|
27
31
|
*
|
|
28
|
-
* const
|
|
29
|
-
*
|
|
30
|
-
* const jobs = East.function([], UIComponentType, (_$) => (
|
|
32
|
+
* const sheet = East.function([], UIComponentType, (_$) => (
|
|
31
33
|
* <Reactive>{$ => {
|
|
32
|
-
* const
|
|
34
|
+
* const JobType = StructType({
|
|
35
|
+
* id: StringType,
|
|
36
|
+
* start: OptionType(DateTimeType), // none = blank cell
|
|
37
|
+
* task: StringType, // "" = blank cell
|
|
38
|
+
* qty: OptionType(FloatType),
|
|
39
|
+
* });
|
|
40
|
+
* const jobs = $.let(State.bind([ArrayType(JobType)], "sheet_basic_jobs", [
|
|
41
|
+
* { id: "j1", start: none, task: "Machining", qty: none },
|
|
42
|
+
* ]));
|
|
33
43
|
* return (
|
|
34
44
|
* <Sheet
|
|
35
|
-
* data={
|
|
45
|
+
* data={jobs}
|
|
36
46
|
* id="id"
|
|
37
47
|
* columns={{
|
|
38
|
-
* start: Sheet.column.date(JobType, { header: "Start", sub: "
|
|
48
|
+
* start: Sheet.column.date(JobType, { header: "Start", sub: "dd / mm / yyyy" }),
|
|
39
49
|
* task: Sheet.column.text(JobType, { header: "Task" }),
|
|
40
|
-
* qty: Sheet.column.quantity(JobType, { header: "Qty" }),
|
|
50
|
+
* qty: Sheet.column.quantity(JobType, { header: "Qty" }), // no driver on this sheet — the two-argument form
|
|
41
51
|
* }}
|
|
42
|
-
* onUpdate={
|
|
52
|
+
* onUpdate={jobs.write}
|
|
43
53
|
* />
|
|
44
54
|
* );
|
|
45
55
|
* }}</Reactive>
|
|
@@ -47,19 +57,17 @@ function SheetTag(props) {
|
|
|
47
57
|
* ```
|
|
48
58
|
*
|
|
49
59
|
* @remarks
|
|
50
|
-
* Carries the
|
|
51
|
-
* `Sheet.register.members` / `.concat`,
|
|
52
|
-
* `.check` / `.parse` / `.print`,
|
|
53
|
-
*
|
|
54
|
-
* `
|
|
60
|
+
* Carries the factory namespace except `Root` (the tag is the root):
|
|
61
|
+
* `Sheet.column.*` (the builders), `Sheet.register.members` / `.concat`,
|
|
62
|
+
* `Sheet.driver`, `Sheet.link.arity` / `.check` / `.parse` / `.print`,
|
|
63
|
+
* `Sheet.patch`, `Sheet.apply` (a checked batch applied to a collection),
|
|
64
|
+
* `Sheet.group` / `Sheet.group.cell.*` (grouped rows, #740 — with loose rows
|
|
65
|
+
* between the groups over `Sheet.Types.Entry` entries, #846), `Sheet.subRows`
|
|
66
|
+
* / `Sheet.subRow` (sub rows, #844), and `Sheet.Types.*` (the closed wire
|
|
67
|
+
* types plus the typed constructors, among them `DraftContext(R, D)` /
|
|
68
|
+
* `Fill(T)` / `Patch(R)` / `Proposal(R)` / `CheckContext(R)` / `Draft(R)` /
|
|
69
|
+
* `PatchEvent(E)` / `ChangeSet(E)` / `Entry(G, "rows")`). Desugars to
|
|
55
70
|
* `Sheet.Root(data, columns, options)`.
|
|
56
71
|
*/
|
|
57
|
-
export const Sheet = Object.assign(SheetTag,
|
|
58
|
-
column: SheetFactory.column,
|
|
59
|
-
register: SheetFactory.register,
|
|
60
|
-
driver: SheetFactory.driver,
|
|
61
|
-
link: SheetFactory.link,
|
|
62
|
-
patch: SheetFactory.patch,
|
|
63
|
-
Types: SheetFactory.Types,
|
|
64
|
-
});
|
|
72
|
+
export const Sheet = Object.assign(SheetTag, authoring);
|
|
65
73
|
//# sourceMappingURL=sheet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.js","sourceRoot":"","sources":["../../../../src/runtime/collections/sheet.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EACH,KAAK,IAAI,YAAY,
|
|
1
|
+
{"version":3,"file":"sheet.js","sourceRoot":"","sources":["../../../../src/runtime/collections/sheet.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EACH,KAAK,IAAI,YAAY,GAUxB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAiD5C,SAAS,QAAQ,CACb,KAA0C;IAE1C,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,GAAG,KAAsE,CAAC;IAC7G,OAAQ,YAAY,CAAC,IAA2D,CAC5E,IAAI,EACJ,OAAO,EACP,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CACzC,CAAC;AACN,CAAC;AAED,8EAA8E;AAC9E,+EAA+E;AAC/E,sDAAsD;AACtD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,SAAS,EAAE,GAAG,YAAY,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,MAAM,CAAC,MAAM,KAAK,GAAmD,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC"}
|
|
@@ -5,35 +5,42 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* `<Table>` tag — see the export's JSDoc.
|
|
7
7
|
*/
|
|
8
|
-
import type {
|
|
8
|
+
import type { ArrayType, ExprType, RecursiveType, StructType } from "@elaraai/east";
|
|
9
9
|
import type { PagedSource } from "../../contracts/source.js";
|
|
10
|
-
import { Table as TableFactory, type ColumnSpec, type DataFieldKeys, type DataRowType, type TableOptions } from "../../collections/table/index.js";
|
|
10
|
+
import { Table as TableFactory, type ColumnSpec, type DataFieldKeys, type DataRowType, type TableData, type TableOptions, type TableRowNode } from "../../collections/table/index.js";
|
|
11
11
|
import type { UIElement } from "../runtime.js";
|
|
12
|
+
/** A paged source's row as its accessors receive it — the struct, or a recursive row's node (#954). */
|
|
13
|
+
type PagedRowType<R> = TableRowNode<R> extends StructType ? TableRowNode<R> : StructType;
|
|
12
14
|
/**
|
|
13
15
|
* `<Table data={rows} columns={["name", "age"]} striped />` — schema-typed
|
|
14
16
|
* table. Maps to `Table.Root`. `columns` is typed directly as `ColumnSpec<T>`
|
|
15
17
|
* (not an inferred generic) so an object-form column map gets excess-property
|
|
16
|
-
* checked — a key that is not a data field is a type error.
|
|
18
|
+
* checked — a key that is not a data field is a type error. Recursive rows
|
|
19
|
+
* nest with `tree` (#954), their accessors reading each row's node.
|
|
17
20
|
*/
|
|
18
|
-
declare function TableTag<T extends
|
|
21
|
+
declare function TableTag<T extends TableData>(props: {
|
|
19
22
|
data: T;
|
|
20
23
|
columns: ColumnSpec<T>;
|
|
21
24
|
} & TableOptions<DataFieldKeys<T>, DataRowType<T>>): UIElement;
|
|
22
25
|
/** The PAGED arm (#576) — `data` is a windowed source of the same rows; the
|
|
23
26
|
* row type rides structurally in its `page` signature, so `columns` is checked
|
|
24
|
-
* against it exactly as for an inline array.
|
|
25
|
-
|
|
27
|
+
* against it exactly as for an inline array. A source of recursive rows pages
|
|
28
|
+
* its top-level rows, each with its subtree (#954). */
|
|
29
|
+
declare function TableTag<R extends StructType | RecursiveType<StructType>>(props: {
|
|
26
30
|
data: PagedSource<ArrayType<R>>;
|
|
27
31
|
columns: ColumnSpec<ExprType<ArrayType<R>>>;
|
|
28
|
-
} & TableOptions<Extract<keyof R["fields"], string>, R
|
|
32
|
+
} & TableOptions<Extract<keyof PagedRowType<R>["fields"], string>, PagedRowType<R>>): UIElement;
|
|
29
33
|
/**
|
|
30
34
|
* Schema-typed data table — renders an array of struct rows as columns. The
|
|
31
35
|
* row type drives everything: `columns` is a key list or a per-key config map
|
|
32
36
|
* ({@link ColumnSpec}, with `header` / `width` / `value` sort-key / `render`
|
|
33
|
-
* cell renderer), and the remaining display props
|
|
34
|
-
* columns, row status, selection, pagination,
|
|
35
|
-
* column groups, interaction callbacks) are flat
|
|
36
|
-
*
|
|
37
|
+
* cell renderer / `aggregate` subtotal), and the remaining display props
|
|
38
|
+
* (striped, density, frozen columns, row status, selection, pagination,
|
|
39
|
+
* expandable rows, footer rows, column groups, interaction callbacks) are flat
|
|
40
|
+
* ({@link TableOptions}). Rows nest to any depth with `tree={{ children }}`
|
|
41
|
+
* (#954): a parent draws its own cells and, in an `aggregate` column, its
|
|
42
|
+
* children's subtotal. Reach for it whenever tabular records need sorting,
|
|
43
|
+
* selection, or rich cells.
|
|
37
44
|
*
|
|
38
45
|
* @example
|
|
39
46
|
* ```tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/runtime/collections/table.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/runtime/collections/table.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS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,eAAO,MAAM,KAAK,EAAE,OAAO,QAAQ,GAAG;IAAE,KAAK,EAAE,OAAO,YAAY,CAAC,KAAK,CAAA;CACd,CAAC"}
|
|
@@ -12,10 +12,13 @@ function TableTag(props) {
|
|
|
12
12
|
* Schema-typed data table — renders an array of struct rows as columns. The
|
|
13
13
|
* row type drives everything: `columns` is a key list or a per-key config map
|
|
14
14
|
* ({@link ColumnSpec}, with `header` / `width` / `value` sort-key / `render`
|
|
15
|
-
* cell renderer), and the remaining display props
|
|
16
|
-
* columns, row status, selection, pagination,
|
|
17
|
-
* column groups, interaction callbacks) are flat
|
|
18
|
-
*
|
|
15
|
+
* cell renderer / `aggregate` subtotal), and the remaining display props
|
|
16
|
+
* (striped, density, frozen columns, row status, selection, pagination,
|
|
17
|
+
* expandable rows, footer rows, column groups, interaction callbacks) are flat
|
|
18
|
+
* ({@link TableOptions}). Rows nest to any depth with `tree={{ children }}`
|
|
19
|
+
* (#954): a parent draws its own cells and, in an `aggregate` column, its
|
|
20
|
+
* children's subtotal. Reach for it whenever tabular records need sorting,
|
|
21
|
+
* selection, or rich cells.
|
|
19
22
|
*
|
|
20
23
|
* @example
|
|
21
24
|
* ```tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.js","sourceRoot":"","sources":["../../../../src/runtime/collections/table.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EACH,KAAK,IAAI,YAAY,
|
|
1
|
+
{"version":3,"file":"table.js","sourceRoot":"","sources":["../../../../src/runtime/collections/table.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EACH,KAAK,IAAI,YAAY,GAOxB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAwB5C,SAAS,QAAQ,CACb,KAA0C;IAE1C,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,GAAG,KAAsE,CAAC;IAC7G,OAAQ,YAAY,CAAC,IAA2D,CAC5E,IAAI,EACJ,OAAO,EACP,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CACzC,CAAC;AACN,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAM,CAAC,MAAM,KAAK,GACd,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC"}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
*
|
|
22
22
|
* @packageDocumentation
|
|
23
23
|
*/
|
|
24
|
-
import { ArrayType, type BlockBuilder, type
|
|
24
|
+
import { type ArrayType, type BlockBuilder, type EastType, type ExprType, type FunctionType, type StructType, type SubtypeExprOrValue, type TypeOf } from "@elaraai/east";
|
|
25
25
|
/**
|
|
26
26
|
* Reifies an accessor lambda into an East function, inferring the output
|
|
27
27
|
* type from the lambda's expanded result (single expansion via
|
|
@@ -61,8 +61,9 @@ export declare function reifyAccessor<const I extends EastType[], R>(inputs: [..
|
|
|
61
61
|
export declare function mapRows<T extends EastType>(rows: ExprType<ArrayType<StructType>>, outType: T, body: (row: ExprType<StructType>) => SubtypeExprOrValue<T>): ExprType<ArrayType<T>>;
|
|
62
62
|
/**
|
|
63
63
|
* `mapRows` for row mappers whose body needs a block builder — per-row
|
|
64
|
-
* normalizations that declare `$.let` bindings or emit statements (
|
|
65
|
-
*
|
|
64
|
+
* normalizations that declare `$.let` bindings or emit statements (Library
|
|
65
|
+
* row construction; the Table and the Matrix build theirs in the tree walk,
|
|
66
|
+
* `shared/tree.ts`).
|
|
66
67
|
*
|
|
67
68
|
* @typeParam T - The fixed East element type the mapper produces
|
|
68
69
|
* @param rows - The caller's rows array expression
|
|
@@ -73,47 +74,4 @@ export declare function mapRows<T extends EastType>(rows: ExprType<ArrayType<Str
|
|
|
73
74
|
* @internal
|
|
74
75
|
*/
|
|
75
76
|
export declare function mapRowsBlock<T extends EastType>(rows: ExprType<ArrayType<StructType>>, outType: T, body: ($: BlockBuilder<T>, row: ExprType<StructType>) => SubtypeExprOrValue<T>): ExprType<ArrayType<T>>;
|
|
76
|
-
/**
|
|
77
|
-
* `mapRowsBlock` for per-row constructors that produce a **subtree** — an
|
|
78
|
-
* array of output elements per row — rather than exactly one element: the
|
|
79
|
-
* reified body's results are concat-flattened eagerly in a single pass, so
|
|
80
|
-
* no intermediate array-of-arrays is materialized (Plan row construction,
|
|
81
|
-
* where one data row expands to a parent plus its re-parented children).
|
|
82
|
-
*
|
|
83
|
-
* @typeParam T - The fixed East element type of the flattened result
|
|
84
|
-
* @param rows - The caller's rows array expression
|
|
85
|
-
* @param outType - The fixed East output ELEMENT type (the helper flattens `ArrayType(outType)` subtrees)
|
|
86
|
-
* @param body - Per-row subtree constructor; expanded exactly once against a typed placeholder row
|
|
87
|
-
* @returns The eagerly-flattened array expression
|
|
88
|
-
*
|
|
89
|
-
* @internal
|
|
90
|
-
*/
|
|
91
|
-
export declare function flatMapRowsBlock<T extends EastType>(rows: ExprType<ArrayType<StructType>>, outType: T, body: ($: BlockBuilder<ArrayType<NoInfer<T>>>, row: ExprType<StructType>) => SubtypeExprOrValue<ArrayType<NoInfer<T>>>): ExprType<ArrayType<T>>;
|
|
92
|
-
/**
|
|
93
|
-
* `flatMapRowsBlock` for per-ENTRY constructors that produce a KEYED subtree —
|
|
94
|
-
* a `Dict` of output elements per source entry — folded into one dictionary
|
|
95
|
-
* (Plan row construction, where the source is a keyed collection and the
|
|
96
|
-
* canvas rows inherit its keys, so duplicates are unconstructable).
|
|
97
|
-
*
|
|
98
|
-
* @remarks
|
|
99
|
-
* The body receives the entry's `(value, key)`, because a keyed dataset does
|
|
100
|
-
* not repeat its key inside the value — the key is where a row's identity
|
|
101
|
-
* comes from, not a field to re-derive.
|
|
102
|
-
*
|
|
103
|
-
* The accumulator is folded with `unionInPlace`, never with the pure `union`:
|
|
104
|
-
* `union` copies the whole B-tree per step, so a 200-entry window would rebuild
|
|
105
|
-
* the dictionary 200 times. `reduce` threads ONE accumulator and each entry's
|
|
106
|
-
* subtree is merged into it — the same shape `groupToArrays` uses for arrays.
|
|
107
|
-
*
|
|
108
|
-
* @typeParam K - The output dictionary's key type
|
|
109
|
-
* @typeParam V - The output dictionary's value type
|
|
110
|
-
* @param entries - The caller's keyed source expression
|
|
111
|
-
* @param dictType - The fixed East output dictionary type
|
|
112
|
-
* @param merge - Conflict policy when two entries produce the same key, as `(existing, incoming, key) => kept`
|
|
113
|
-
* @param body - Per-entry subtree constructor; expanded exactly once against typed placeholders
|
|
114
|
-
* @returns The folded dictionary expression
|
|
115
|
-
*
|
|
116
|
-
* @internal
|
|
117
|
-
*/
|
|
118
|
-
export declare function foldEntriesToDict<K extends EastType, V extends EastType>(entries: ExprType<DictType<StringType, StructType>>, dictType: DictType<K, V>, merge: SubtypeExprOrValue<FunctionType<[NoInfer<V>, NoInfer<V>, NoInfer<K>], NoInfer<V>>>, body: ($: BlockBuilder<DictType<NoInfer<K>, NoInfer<V>>>, value: ExprType<StructType>, key: ExprType<StringType>) => SubtypeExprOrValue<DictType<NoInfer<K>, NoInfer<V>>>): ExprType<DictType<K, V>>;
|
|
119
77
|
//# sourceMappingURL=reify.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reify.d.ts","sourceRoot":"","sources":["../../../src/shared/reify.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EACH,SAAS,
|
|
1
|
+
{"version":3,"file":"reify.d.ts","sourceRoot":"","sources":["../../../src/shared/reify.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EACH,KAAK,SAAS,EACd,KAAK,YAAY,EAEjB,KAAK,QAAQ,EAEb,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,UAAU,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East, Expr, } from "@elaraai/east";
|
|
25
25
|
/**
|
|
26
26
|
* Reifies an accessor lambda into an East function, inferring the output
|
|
27
27
|
* type from the lambda's expanded result (single expansion via
|
|
@@ -66,8 +66,9 @@ export function mapRows(rows, outType, body) {
|
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
68
|
* `mapRows` for row mappers whose body needs a block builder — per-row
|
|
69
|
-
* normalizations that declare `$.let` bindings or emit statements (
|
|
70
|
-
*
|
|
69
|
+
* normalizations that declare `$.let` bindings or emit statements (Library
|
|
70
|
+
* row construction; the Table and the Matrix build theirs in the tree walk,
|
|
71
|
+
* `shared/tree.ts`).
|
|
71
72
|
*
|
|
72
73
|
* @typeParam T - The fixed East element type the mapper produces
|
|
73
74
|
* @param rows - The caller's rows array expression
|
|
@@ -82,62 +83,4 @@ export function mapRowsBlock(rows, outType, body) {
|
|
|
82
83
|
const fn = East.function([rowType], outType, ($, row) => body($, row));
|
|
83
84
|
return rows.map((_$, row) => fn(row));
|
|
84
85
|
}
|
|
85
|
-
/**
|
|
86
|
-
* `mapRowsBlock` for per-row constructors that produce a **subtree** — an
|
|
87
|
-
* array of output elements per row — rather than exactly one element: the
|
|
88
|
-
* reified body's results are concat-flattened eagerly in a single pass, so
|
|
89
|
-
* no intermediate array-of-arrays is materialized (Plan row construction,
|
|
90
|
-
* where one data row expands to a parent plus its re-parented children).
|
|
91
|
-
*
|
|
92
|
-
* @typeParam T - The fixed East element type of the flattened result
|
|
93
|
-
* @param rows - The caller's rows array expression
|
|
94
|
-
* @param outType - The fixed East output ELEMENT type (the helper flattens `ArrayType(outType)` subtrees)
|
|
95
|
-
* @param body - Per-row subtree constructor; expanded exactly once against a typed placeholder row
|
|
96
|
-
* @returns The eagerly-flattened array expression
|
|
97
|
-
*
|
|
98
|
-
* @internal
|
|
99
|
-
*/
|
|
100
|
-
export function flatMapRowsBlock(rows, outType, body) {
|
|
101
|
-
const rowType = Expr.type(rows).value;
|
|
102
|
-
const fn = East.function([rowType], ArrayType(outType), ($, row) => body($, row));
|
|
103
|
-
return rows.reduce((_$, acc, row) => acc.concat(fn(row)), East.value([], ArrayType(outType)));
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* `flatMapRowsBlock` for per-ENTRY constructors that produce a KEYED subtree —
|
|
107
|
-
* a `Dict` of output elements per source entry — folded into one dictionary
|
|
108
|
-
* (Plan row construction, where the source is a keyed collection and the
|
|
109
|
-
* canvas rows inherit its keys, so duplicates are unconstructable).
|
|
110
|
-
*
|
|
111
|
-
* @remarks
|
|
112
|
-
* The body receives the entry's `(value, key)`, because a keyed dataset does
|
|
113
|
-
* not repeat its key inside the value — the key is where a row's identity
|
|
114
|
-
* comes from, not a field to re-derive.
|
|
115
|
-
*
|
|
116
|
-
* The accumulator is folded with `unionInPlace`, never with the pure `union`:
|
|
117
|
-
* `union` copies the whole B-tree per step, so a 200-entry window would rebuild
|
|
118
|
-
* the dictionary 200 times. `reduce` threads ONE accumulator and each entry's
|
|
119
|
-
* subtree is merged into it — the same shape `groupToArrays` uses for arrays.
|
|
120
|
-
*
|
|
121
|
-
* @typeParam K - The output dictionary's key type
|
|
122
|
-
* @typeParam V - The output dictionary's value type
|
|
123
|
-
* @param entries - The caller's keyed source expression
|
|
124
|
-
* @param dictType - The fixed East output dictionary type
|
|
125
|
-
* @param merge - Conflict policy when two entries produce the same key, as `(existing, incoming, key) => kept`
|
|
126
|
-
* @param body - Per-entry subtree constructor; expanded exactly once against typed placeholders
|
|
127
|
-
* @returns The folded dictionary expression
|
|
128
|
-
*
|
|
129
|
-
* @internal
|
|
130
|
-
*/
|
|
131
|
-
export function foldEntriesToDict(entries, dictType,
|
|
132
|
-
// `dictType` is the ONLY inference site: the loose `SubtypeExprOrValue`
|
|
133
|
-
// faces below would otherwise widen `V` to the subtype form and the result
|
|
134
|
-
// would stop being assignable to the exact collection type.
|
|
135
|
-
merge, body) {
|
|
136
|
-
const valueType = Expr.type(entries).value;
|
|
137
|
-
const fn = East.function([valueType, StringType], dictType, ($, value, key) => body($, value, key));
|
|
138
|
-
return entries.reduce(($, acc, value, key) => {
|
|
139
|
-
$(acc.unionInPlace(fn(value, key), merge));
|
|
140
|
-
return acc;
|
|
141
|
-
}, East.value(new Map(), dictType));
|
|
142
|
-
}
|
|
143
86
|
//# sourceMappingURL=reify.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reify.js","sourceRoot":"","sources":["../../../src/shared/reify.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"reify.js","sourceRoot":"","sources":["../../../src/shared/reify.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAGH,IAAI,EAEJ,IAAI,GAMP,MAAM,eAAe,CAAC;AAEvB;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,aAAa,CACzB,MAAc,EACd,QAA4D;IAE5D,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,CACpB,MAAM,EACN,SAAS,EACT,CAAC,EAAW,EAAE,GAAG,IAAwC,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAClF,CAAC;IACF,OAAO,EAAqD,CAAC;AACjE,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,OAAO,CACnB,IAAqC,EACrC,OAAU,EACV,IAA0D;IAE1D,MAAM,OAAO,GAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAA2B,CAAC,KAAK,CAAC;IACjE,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACrE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAsC,CAAC;AAC/E,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,YAAY,CACxB,IAAqC,EACrC,OAAU,EACV,IAA8E;IAE9E,MAAM,OAAO,GAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAA2B,CAAC,KAAK,CAAC;IACjE,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,CAAoB,EAAE,GAAG,CAAC,CAAC,CAAC;IAC1F,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAsC,CAAC;AAC/E,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
* Nested rows (#954, #955) — a collection's own tree, walked in pre-order.
|
|
7
|
+
*
|
|
8
|
+
* A Table's and a Matrix's rows nest the way the Plan's do (#822): a row
|
|
9
|
+
* carries its children, to any depth, through `tree={{ children, collapsed }}`.
|
|
10
|
+
* The walk is ONE reified East function over the data — an explicit stack,
|
|
11
|
+
* since depth is data (the Plan's walk, `collections/plan/series.ts`) — that
|
|
12
|
+
* turns the author's elements into the component's own rows, each parent
|
|
13
|
+
* followed by its subtree, each with its depth.
|
|
14
|
+
*
|
|
15
|
+
* Not exported from the package barrel — factory-internal; the components
|
|
16
|
+
* re-export the input types under their own names.
|
|
17
|
+
*
|
|
18
|
+
* @packageDocumentation
|
|
19
|
+
*/
|
|
20
|
+
import { type BlockBuilder, type EastType, type ExpandOnce, type ExprType, type FunctionType, type RecursiveType, type SubtypeExprOrValue, ArrayType, BooleanType, Expr, IntegerType, StructType } from "@elaraai/east";
|
|
21
|
+
/**
|
|
22
|
+
* A data element as a tree's accessors receive it — a recursive element as
|
|
23
|
+
* its NODE, so an accessor reads its fields directly at every depth
|
|
24
|
+
* (`(r) => r.lines`), as the Plan's series do.
|
|
25
|
+
*
|
|
26
|
+
* @typeParam S - The data's element type
|
|
27
|
+
*/
|
|
28
|
+
export type TreeNode<S> = S extends RecursiveType<infer U> ? ExpandOnce<U, S> : S;
|
|
29
|
+
/**
|
|
30
|
+
* How a collection's rows nest — the data's own tree, to any depth.
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* `children` returns a row's child rows: more of the SAME row type (an `Array`
|
|
34
|
+
* of the data's element type), so every row fills the same columns — a
|
|
35
|
+
* `RecursiveType` row's own field (`r => r.lines`), or a lookup over flat data
|
|
36
|
+
* (`r => all.filter((_$, c) => c.parent.equal(r.id))`), the data holding only
|
|
37
|
+
* the top-level rows. `collapsed` says which parents start closed.
|
|
38
|
+
*
|
|
39
|
+
* @typeParam RowType - The row an accessor receives — a struct, or a recursive row's node
|
|
40
|
+
*/
|
|
41
|
+
export interface TreeInput<RowType extends StructType = StructType> {
|
|
42
|
+
/** A row's child rows — an `Array` of the data's element type (a recursive row's own field, say). */
|
|
43
|
+
children: (row: ExprType<RowType>) => Expr;
|
|
44
|
+
/** Whether a parent starts collapsed — `true` for every parent, or per row. Default open. */
|
|
45
|
+
collapsed?: boolean | ((row: ExprType<RowType>) => SubtypeExprOrValue<BooleanType>);
|
|
46
|
+
}
|
|
47
|
+
/** A collection's element type, resolved for its accessors. */
|
|
48
|
+
export interface TreeElement {
|
|
49
|
+
/** The data's element type — a struct, or a recursive type whose node is one. */
|
|
50
|
+
elementType: EastType;
|
|
51
|
+
/** The struct every accessor receives — the element, or its node. */
|
|
52
|
+
rowType: StructType;
|
|
53
|
+
/** An element as the accessors receive it — its node, when recursive. */
|
|
54
|
+
nodeOf: (element: ExprType<EastType>) => ExprType<StructType>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Resolves a collection's element type for its accessors: a struct as it is,
|
|
58
|
+
* a recursive element through its node.
|
|
59
|
+
*
|
|
60
|
+
* @param component - The component, for the message (`"Table"`)
|
|
61
|
+
* @param elementType - The data's element type
|
|
62
|
+
* @returns The element, its row struct and the node accessor
|
|
63
|
+
* @throws {Error} When the element is neither a struct nor a recursive type whose node is one
|
|
64
|
+
*/
|
|
65
|
+
export declare function treeElement(component: string, elementType: EastType): TreeElement;
|
|
66
|
+
/**
|
|
67
|
+
* The collection's rows IN PRE-ORDER, as one East function over the data: a
|
|
68
|
+
* parent, then its subtree, each row built by `rowOf` with its depth and
|
|
69
|
+
* whether it starts collapsed (only a row with children ever does). Without a
|
|
70
|
+
* `tree`, every element is a row at depth 0, in data order.
|
|
71
|
+
*
|
|
72
|
+
* @remarks
|
|
73
|
+
* The tree's depth is data, so the walk is an explicit stack: a level's rows
|
|
74
|
+
* go on REVERSED, so the stack pops the first of them first. Every function
|
|
75
|
+
* the walk calls is reified once and bound once — a captured function
|
|
76
|
+
* referenced in a loop would be re-inlined per use.
|
|
77
|
+
*
|
|
78
|
+
* @typeParam Row - The component's row type
|
|
79
|
+
* @param component - The component, for the build-time messages (`"Table"`)
|
|
80
|
+
* @param element - The collection's element ({@link treeElement})
|
|
81
|
+
* @param rowType - The component's row type
|
|
82
|
+
* @param rowOf - One element's row, given its depth and whether it starts collapsed
|
|
83
|
+
* @param tree - How the rows nest; absent, the collection is flat
|
|
84
|
+
* @returns A function from the collection to its rows
|
|
85
|
+
* @throws {Error} When `tree.children` returns anything but more of the collection's rows
|
|
86
|
+
*/
|
|
87
|
+
export declare function preOrderRows<Row extends EastType>(component: string, element: TreeElement, rowType: Row, rowOf: ($: BlockBuilder<Row>, element: ExprType<EastType>, depth: ExprType<IntegerType>, collapsed: ExprType<BooleanType>) => SubtypeExprOrValue<Row>, tree: TreeInput | undefined): ExprType<FunctionType<[ArrayType<EastType>],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E,WAAW,EAAE,QAAQ,GAAG,WAAW,CAajF;AAiCD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,YAAY,CAAC,GAAG,SAAS,QAAQ,EAC7C,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,GAAG,EACZ,KAAK,EAAE,CAAC,CAAC,EAAE,YAAY,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,KAAK,kBAAkB,CAAC,GAAG,CAAC,EACrJ,IAAI,EAAE,SAAS,GAAG,SAAS,GAC5B,QAAQ,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAiD/D"}
|
|
@@ -0,0 +1,134 @@
|
|
|
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
|
+
* Nested rows (#954, #955) — a collection's own tree, walked in pre-order.
|
|
7
|
+
*
|
|
8
|
+
* A Table's and a Matrix's rows nest the way the Plan's do (#822): a row
|
|
9
|
+
* carries its children, to any depth, through `tree={{ children, collapsed }}`.
|
|
10
|
+
* The walk is ONE reified East function over the data — an explicit stack,
|
|
11
|
+
* since depth is data (the Plan's walk, `collections/plan/series.ts`) — that
|
|
12
|
+
* turns the author's elements into the component's own rows, each parent
|
|
13
|
+
* followed by its subtree, each with its depth.
|
|
14
|
+
*
|
|
15
|
+
* Not exported from the package barrel — factory-internal; the components
|
|
16
|
+
* re-export the input types under their own names.
|
|
17
|
+
*
|
|
18
|
+
* @packageDocumentation
|
|
19
|
+
*/
|
|
20
|
+
import { ArrayType, BooleanType, East, EastTypeType, Expr, IntegerType, StructType, isTypeEqual, printFor, toEastTypeValue, } from "@elaraai/east";
|
|
21
|
+
import { reifyAccessor } from "./reify.js";
|
|
22
|
+
/**
|
|
23
|
+
* Resolves a collection's element type for its accessors: a struct as it is,
|
|
24
|
+
* a recursive element through its node.
|
|
25
|
+
*
|
|
26
|
+
* @param component - The component, for the message (`"Table"`)
|
|
27
|
+
* @param elementType - The data's element type
|
|
28
|
+
* @returns The element, its row struct and the node accessor
|
|
29
|
+
* @throws {Error} When the element is neither a struct nor a recursive type whose node is one
|
|
30
|
+
*/
|
|
31
|
+
export function treeElement(component, elementType) {
|
|
32
|
+
const recursive = elementType.type === "Recursive";
|
|
33
|
+
const rowType = (recursive ? elementType.node : elementType);
|
|
34
|
+
if (rowType.type !== "Struct") {
|
|
35
|
+
throw new Error(`${component}: rows must be structs, or recursive rows whose node is a struct — got ` +
|
|
36
|
+
`${rowType.type}. Map the collection to a struct per row before passing it.`);
|
|
37
|
+
}
|
|
38
|
+
const nodeOf = (element) => (recursive
|
|
39
|
+
? element.unwrap()
|
|
40
|
+
: element);
|
|
41
|
+
return { elementType, rowType, nodeOf };
|
|
42
|
+
}
|
|
43
|
+
/** East's own printer over a type value — the types a build-time message names. */
|
|
44
|
+
const printType = printFor(EastTypeType);
|
|
45
|
+
/**
|
|
46
|
+
* A `tree.children` accessor as a real East function: from a row to its child
|
|
47
|
+
* rows, which must be more of the collection's own rows — an `Array` of its
|
|
48
|
+
* element type — because every row fills the same columns.
|
|
49
|
+
*
|
|
50
|
+
* @param component - The component, for the message (`"Table"`)
|
|
51
|
+
* @param element - The collection's element
|
|
52
|
+
* @param children - The author's accessor
|
|
53
|
+
* @returns The accessor, reified once
|
|
54
|
+
* @throws {Error} When the accessor returns anything but an Array of the element type
|
|
55
|
+
*/
|
|
56
|
+
function childRowsOf(component, element, children) {
|
|
57
|
+
const fn = reifyAccessor([element.elementType], (e) => children(element.nodeOf(e)));
|
|
58
|
+
const output = Expr.type(fn).output;
|
|
59
|
+
const want = ArrayType(element.elementType);
|
|
60
|
+
if (!isTypeEqual(output, want)) {
|
|
61
|
+
throw new Error(`${component}: \`tree.children\` returns a row's child rows — more of the ${component.toLowerCase()}'s own rows, ` +
|
|
62
|
+
`${printType(toEastTypeValue(want))} — but it returned ${printType(toEastTypeValue(output))}. ` +
|
|
63
|
+
"Every row fills the same columns: return a recursive row's own children, or look them up among the rows.");
|
|
64
|
+
}
|
|
65
|
+
return fn;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The collection's rows IN PRE-ORDER, as one East function over the data: a
|
|
69
|
+
* parent, then its subtree, each row built by `rowOf` with its depth and
|
|
70
|
+
* whether it starts collapsed (only a row with children ever does). Without a
|
|
71
|
+
* `tree`, every element is a row at depth 0, in data order.
|
|
72
|
+
*
|
|
73
|
+
* @remarks
|
|
74
|
+
* The tree's depth is data, so the walk is an explicit stack: a level's rows
|
|
75
|
+
* go on REVERSED, so the stack pops the first of them first. Every function
|
|
76
|
+
* the walk calls is reified once and bound once — a captured function
|
|
77
|
+
* referenced in a loop would be re-inlined per use.
|
|
78
|
+
*
|
|
79
|
+
* @typeParam Row - The component's row type
|
|
80
|
+
* @param component - The component, for the build-time messages (`"Table"`)
|
|
81
|
+
* @param element - The collection's element ({@link treeElement})
|
|
82
|
+
* @param rowType - The component's row type
|
|
83
|
+
* @param rowOf - One element's row, given its depth and whether it starts collapsed
|
|
84
|
+
* @param tree - How the rows nest; absent, the collection is flat
|
|
85
|
+
* @returns A function from the collection to its rows
|
|
86
|
+
* @throws {Error} When `tree.children` returns anything but more of the collection's rows
|
|
87
|
+
*/
|
|
88
|
+
export function preOrderRows(component, element, rowType, rowOf, tree) {
|
|
89
|
+
const { elementType, nodeOf } = element;
|
|
90
|
+
const rowFn = East.function([elementType, IntegerType, BooleanType], rowType, ($, e, depth, collapsed) => rowOf($, e, depth, collapsed));
|
|
91
|
+
const collapsedInput = tree?.collapsed;
|
|
92
|
+
const nesting = tree === undefined ? undefined : {
|
|
93
|
+
children: childRowsOf(component, element, tree.children),
|
|
94
|
+
collapsed: East.function([elementType], BooleanType, (_$, e) => (typeof collapsedInput === "function"
|
|
95
|
+
? East.value(collapsedInput(nodeOf(e)), BooleanType)
|
|
96
|
+
: East.value(collapsedInput ?? false, BooleanType))),
|
|
97
|
+
};
|
|
98
|
+
const rowsType = ArrayType(rowType);
|
|
99
|
+
const Frame = StructType({ value: elementType, depth: IntegerType });
|
|
100
|
+
const Frames = ArrayType(Frame);
|
|
101
|
+
const walk = East.function([ArrayType(elementType)], rowsType, ($, collection) => {
|
|
102
|
+
const row = $.const(rowFn);
|
|
103
|
+
const out = $.let([], rowsType);
|
|
104
|
+
if (nesting === undefined) {
|
|
105
|
+
$.for(collection, ($2, e) => {
|
|
106
|
+
$2(out.pushLast(row(e, 0n, false)));
|
|
107
|
+
});
|
|
108
|
+
return out;
|
|
109
|
+
}
|
|
110
|
+
const kids = $.const(nesting.children);
|
|
111
|
+
const fold = $.const(nesting.collapsed);
|
|
112
|
+
const stack = $.let([], Frames);
|
|
113
|
+
$.for(collection, ($2, e) => {
|
|
114
|
+
$2(stack.pushLast(East.value({ value: e, depth: 0n }, Frame)));
|
|
115
|
+
});
|
|
116
|
+
$(stack.reverseInPlace());
|
|
117
|
+
$.while(stack.size().greater(0n), ($2) => {
|
|
118
|
+
const frame = $2.let(stack.popLast(), Frame);
|
|
119
|
+
const below = $2.let(kids(frame.value), ArrayType(elementType));
|
|
120
|
+
// Only a row with children folds.
|
|
121
|
+
const closed = $2.let(below.size().greater(0n).and(() => fold(frame.value)), BooleanType);
|
|
122
|
+
$2(out.pushLast(row(frame.value, frame.depth, closed)));
|
|
123
|
+
const next = $2.let([], Frames);
|
|
124
|
+
$2.for(below, ($3, e) => {
|
|
125
|
+
$3(next.pushLast(East.value({ value: e, depth: frame.depth.add(1n) }, Frame)));
|
|
126
|
+
});
|
|
127
|
+
$2(next.reverseInPlace());
|
|
128
|
+
$2(stack.append(next));
|
|
129
|
+
});
|
|
130
|
+
return out;
|
|
131
|
+
});
|
|
132
|
+
return walk;
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.js","sourceRoot":"","sources":["../../../src/shared/tree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EASH,SAAS,EACT,WAAW,EACX,IAAI,EACJ,YAAY,EACZ,IAAI,EACJ,WAAW,EACX,UAAU,EACV,WAAW,EACX,QAAQ,EACR,eAAe,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAwC3C;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,SAAiB,EAAE,WAAqB;IAChE,MAAM,SAAS,GAAI,WAAgC,CAAC,IAAI,KAAK,WAAW,CAAC;IACzE,MAAM,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC,CAAE,WAAyC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAe,CAAC;IAC1G,IAAK,OAA4B,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAClD,MAAM,IAAI,KAAK,CACX,GAAG,SAAS,yEAAyE;YACrF,GAAI,OAA4B,CAAC,IAAI,6DAA6D,CACrG,CAAC;IACN,CAAC;IACD,MAAM,MAAM,GAAG,CAAC,OAA2B,EAAwB,EAAE,CAAC,CAAC,SAAS;QAC5E,CAAC,CAAE,OAAgD,CAAC,MAAM,EAAE;QAC5D,CAAC,CAAC,OAAO,CAAyB,CAAC;IACvC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AAC5C,CAAC;AAED,mFAAmF;AACnF,MAAM,SAAS,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;AAEzC;;;;;;;;;;GAUG;AACH,SAAS,WAAW,CAChB,SAAiB,EACjB,OAAoB,EACpB,QAA6C;IAE7C,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