@elaraai/e3-ui 1.0.85 → 1.0.87
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/bind/data-indexed.d.ts +159 -0
- package/dist/src/bind/data-indexed.d.ts.map +1 -0
- package/dist/src/bind/data-indexed.js +105 -0
- package/dist/src/bind/data-indexed.js.map +1 -0
- package/dist/src/bind/data.d.ts +5 -3
- package/dist/src/bind/data.d.ts.map +1 -1
- package/dist/src/bind/data.js +6 -0
- package/dist/src/bind/data.js.map +1 -1
- package/dist/src/bind/record.d.ts +34 -23
- package/dist/src/bind/record.d.ts.map +1 -1
- package/dist/src/bind/record.js +46 -19
- package/dist/src/bind/record.js.map +1 -1
- package/dist/src/calendar/index.d.ts +2923 -0
- package/dist/src/calendar/index.d.ts.map +1 -0
- package/dist/src/calendar/index.js +135 -0
- package/dist/src/calendar/index.js.map +1 -0
- package/dist/src/decision/queue.d.ts +3 -3
- package/dist/src/decision/queue.d.ts.map +1 -1
- package/dist/src/decision/queue.js +2 -2
- package/dist/src/decision/queue.js.map +1 -1
- package/dist/src/decision/types.d.ts +4 -0
- package/dist/src/decision/types.d.ts.map +1 -1
- package/dist/src/decision/types.js +4 -0
- package/dist/src/decision/types.js.map +1 -1
- package/dist/src/flowchart/canvas.d.ts +114 -0
- package/dist/src/flowchart/canvas.d.ts.map +1 -0
- package/dist/src/flowchart/canvas.js +84 -0
- package/dist/src/flowchart/canvas.js.map +1 -0
- package/dist/src/flowchart/flowchart.d.ts +79 -0
- package/dist/src/flowchart/flowchart.d.ts.map +1 -0
- package/dist/src/flowchart/flowchart.js +9 -0
- package/dist/src/flowchart/flowchart.js.map +1 -0
- package/dist/src/flowchart/index.d.ts +305 -0
- package/dist/src/flowchart/index.d.ts.map +1 -0
- package/dist/src/flowchart/index.js +267 -0
- package/dist/src/flowchart/index.js.map +1 -0
- package/dist/src/flowchart/library.d.ts +720 -0
- package/dist/src/flowchart/library.d.ts.map +1 -0
- package/dist/src/flowchart/library.js +611 -0
- package/dist/src/flowchart/library.js.map +1 -0
- package/dist/src/flowchart/over.d.ts +234 -0
- package/dist/src/flowchart/over.d.ts.map +1 -0
- package/dist/src/flowchart/over.js +220 -0
- package/dist/src/flowchart/over.js.map +1 -0
- package/dist/src/flowchart/patch.d.ts +64 -0
- package/dist/src/flowchart/patch.d.ts.map +1 -0
- package/dist/src/flowchart/patch.js +67 -0
- package/dist/src/flowchart/patch.js.map +1 -0
- package/dist/src/flowchart/payload.d.ts +8220 -0
- package/dist/src/flowchart/payload.d.ts.map +1 -0
- package/dist/src/flowchart/payload.js +521 -0
- package/dist/src/flowchart/payload.js.map +1 -0
- package/dist/src/flowchart/types.d.ts +393 -0
- package/dist/src/flowchart/types.d.ts.map +1 -0
- package/dist/src/flowchart/types.js +216 -0
- package/dist/src/flowchart/types.js.map +1 -0
- package/dist/src/flowchart/values.d.ts +267 -0
- package/dist/src/flowchart/values.d.ts.map +1 -0
- package/dist/src/flowchart/values.js +216 -0
- package/dist/src/flowchart/values.js.map +1 -0
- package/dist/src/flowchart/window.d.ts +521 -0
- package/dist/src/flowchart/window.d.ts.map +1 -0
- package/dist/src/flowchart/window.js +69 -0
- package/dist/src/flowchart/window.js.map +1 -0
- package/dist/src/index.d.ts +25 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +48 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal.d.ts +35 -3
- package/dist/src/internal.d.ts.map +1 -1
- package/dist/src/internal.js +72 -3
- package/dist/src/internal.js.map +1 -1
- package/dist/src/plan/assemble.d.ts +2224 -0
- package/dist/src/plan/assemble.d.ts.map +1 -0
- package/dist/src/plan/assemble.js +210 -0
- package/dist/src/plan/assemble.js.map +1 -0
- package/dist/src/plan/builders.d.ts +790 -0
- package/dist/src/plan/builders.d.ts.map +1 -0
- package/dist/src/plan/builders.js +749 -0
- package/dist/src/plan/builders.js.map +1 -0
- package/dist/src/plan/event-rows.d.ts +2565 -0
- package/dist/src/plan/event-rows.d.ts.map +1 -0
- package/dist/src/plan/event-rows.js +689 -0
- package/dist/src/plan/event-rows.js.map +1 -0
- package/dist/src/plan/factories.d.ts +458 -0
- package/dist/src/plan/factories.d.ts.map +1 -0
- package/dist/src/plan/factories.js +484 -0
- package/dist/src/plan/factories.js.map +1 -0
- package/dist/src/plan/index.d.ts +672 -0
- package/dist/src/plan/index.d.ts.map +1 -0
- package/dist/src/plan/index.js +532 -0
- package/dist/src/plan/index.js.map +1 -0
- package/dist/src/plan/ir.d.ts +2594 -0
- package/dist/src/plan/ir.d.ts.map +1 -0
- package/dist/src/plan/ir.js +78 -0
- package/dist/src/plan/ir.js.map +1 -0
- package/dist/src/plan/library.d.ts +772 -0
- package/dist/src/plan/library.d.ts.map +1 -0
- package/dist/src/plan/library.js +424 -0
- package/dist/src/plan/library.js.map +1 -0
- package/dist/src/plan/ordered-source.d.ts +27 -0
- package/dist/src/plan/ordered-source.d.ts.map +1 -0
- package/dist/src/plan/ordered-source.js +48 -0
- package/dist/src/plan/ordered-source.js.map +1 -0
- package/dist/src/plan/over.d.ts +247 -0
- package/dist/src/plan/over.d.ts.map +1 -0
- package/dist/src/plan/over.js +266 -0
- package/dist/src/plan/over.js.map +1 -0
- package/dist/src/plan/pick.d.ts +78 -0
- package/dist/src/plan/pick.d.ts.map +1 -0
- package/dist/src/plan/pick.js +146 -0
- package/dist/src/plan/pick.js.map +1 -0
- package/dist/src/plan/plan.d.ts +11611 -0
- package/dist/src/plan/plan.d.ts.map +1 -0
- package/dist/src/plan/plan.js +428 -0
- package/dist/src/plan/plan.js.map +1 -0
- package/dist/src/plan/refs.d.ts +218 -0
- package/dist/src/plan/refs.d.ts.map +1 -0
- package/dist/src/plan/refs.js +226 -0
- package/dist/src/plan/refs.js.map +1 -0
- package/dist/src/plan/root.d.ts +290 -0
- package/dist/src/plan/root.d.ts.map +1 -0
- package/dist/src/plan/root.js +463 -0
- package/dist/src/plan/root.js.map +1 -0
- package/dist/src/plan/series.d.ts +13554 -0
- package/dist/src/plan/series.d.ts.map +1 -0
- package/dist/src/plan/series.js +1921 -0
- package/dist/src/plan/series.js.map +1 -0
- package/dist/src/plan/types.d.ts +12400 -0
- package/dist/src/plan/types.d.ts.map +1 -0
- package/dist/src/plan/types.js +1335 -0
- package/dist/src/plan/types.js.map +1 -0
- package/dist/src/roster/coverage.d.ts +240 -0
- package/dist/src/roster/coverage.d.ts.map +1 -0
- package/dist/src/roster/coverage.js +109 -0
- package/dist/src/roster/coverage.js.map +1 -0
- package/dist/src/roster/index.d.ts +4028 -0
- package/dist/src/roster/index.d.ts.map +1 -0
- package/dist/src/roster/index.js +115 -0
- package/dist/src/roster/index.js.map +1 -0
- package/dist/src/roster/library.d.ts +106 -0
- package/dist/src/roster/library.d.ts.map +1 -0
- package/dist/src/roster/library.js +78 -0
- package/dist/src/roster/library.js.map +1 -0
- package/dist/src/roster/people.d.ts +50 -0
- package/dist/src/roster/people.d.ts.map +1 -0
- package/dist/src/roster/people.js +32 -0
- package/dist/src/roster/people.js.map +1 -0
- package/dist/src/roster/rules.d.ts +275 -0
- package/dist/src/roster/rules.d.ts.map +1 -0
- package/dist/src/roster/rules.js +162 -0
- package/dist/src/roster/rules.js.map +1 -0
- package/dist/src/roster/types.d.ts +672 -0
- package/dist/src/roster/types.d.ts.map +1 -0
- package/dist/src/roster/types.js +248 -0
- package/dist/src/roster/types.js.map +1 -0
- package/dist/src/roster/visibility.d.ts +66 -0
- package/dist/src/roster/visibility.d.ts.map +1 -0
- package/dist/src/roster/visibility.js +25 -0
- package/dist/src/roster/visibility.js.map +1 -0
- package/dist/src/schedule/days.d.ts +54 -0
- package/dist/src/schedule/days.d.ts.map +1 -0
- package/dist/src/schedule/days.js +68 -0
- package/dist/src/schedule/days.js.map +1 -0
- package/dist/src/schedule/events.d.ts +433 -0
- package/dist/src/schedule/events.d.ts.map +1 -0
- package/dist/src/schedule/events.js +851 -0
- package/dist/src/schedule/events.js.map +1 -0
- package/dist/src/schedule/index.d.ts +150 -0
- package/dist/src/schedule/index.d.ts.map +1 -0
- package/dist/src/schedule/index.js +132 -0
- package/dist/src/schedule/index.js.map +1 -0
- package/dist/src/schedule/library.d.ts +70 -0
- package/dist/src/schedule/library.d.ts.map +1 -0
- package/dist/src/schedule/library.js +102 -0
- package/dist/src/schedule/library.js.map +1 -0
- package/dist/src/schedule/patch.d.ts +74 -0
- package/dist/src/schedule/patch.d.ts.map +1 -0
- package/dist/src/schedule/patch.js +68 -0
- package/dist/src/schedule/patch.js.map +1 -0
- package/dist/src/schedule/record-window.d.ts +189 -0
- package/dist/src/schedule/record-window.d.ts.map +1 -0
- package/dist/src/schedule/record-window.js +95 -0
- package/dist/src/schedule/record-window.js.map +1 -0
- package/dist/src/schedule/resources.d.ts +165 -0
- package/dist/src/schedule/resources.d.ts.map +1 -0
- package/dist/src/schedule/resources.js +234 -0
- package/dist/src/schedule/resources.js.map +1 -0
- package/dist/src/schedule/templates.d.ts +47 -0
- package/dist/src/schedule/templates.d.ts.map +1 -0
- package/dist/src/schedule/templates.js +61 -0
- package/dist/src/schedule/templates.js.map +1 -0
- package/dist/src/schedule/types.d.ts +1677 -0
- package/dist/src/schedule/types.d.ts.map +1 -0
- package/dist/src/schedule/types.js +374 -0
- package/dist/src/schedule/types.js.map +1 -0
- package/dist/src/schedule/window.d.ts +154 -0
- package/dist/src/schedule/window.d.ts.map +1 -0
- package/dist/src/schedule/window.js +363 -0
- package/dist/src/schedule/window.js.map +1 -0
- package/dist/src/sheet/bridge.d.ts +385 -0
- package/dist/src/sheet/bridge.d.ts.map +1 -0
- package/dist/src/sheet/bridge.js +809 -0
- package/dist/src/sheet/bridge.js.map +1 -0
- package/dist/src/sheet/columns.d.ts +410 -0
- package/dist/src/sheet/columns.d.ts.map +1 -0
- package/dist/src/sheet/columns.js +99 -0
- package/dist/src/sheet/columns.js.map +1 -0
- package/dist/src/sheet/context-bridge.d.ts +48 -0
- package/dist/src/sheet/context-bridge.d.ts.map +1 -0
- package/dist/src/sheet/context-bridge.js +216 -0
- package/dist/src/sheet/context-bridge.js.map +1 -0
- package/dist/src/sheet/draft-bridge.d.ts +37 -0
- package/dist/src/sheet/draft-bridge.d.ts.map +1 -0
- package/dist/src/sheet/draft-bridge.js +153 -0
- package/dist/src/sheet/draft-bridge.js.map +1 -0
- package/dist/src/sheet/drafts.d.ts +14 -0
- package/dist/src/sheet/drafts.d.ts.map +1 -0
- package/dist/src/sheet/drafts.js +14 -0
- package/dist/src/sheet/drafts.js.map +1 -0
- package/dist/src/sheet/editing-bridge.d.ts +40 -0
- package/dist/src/sheet/editing-bridge.d.ts.map +1 -0
- package/dist/src/sheet/editing-bridge.js +231 -0
- package/dist/src/sheet/editing-bridge.js.map +1 -0
- package/dist/src/sheet/editing-types.d.ts +268 -0
- package/dist/src/sheet/editing-types.d.ts.map +1 -0
- package/dist/src/sheet/editing-types.js +34 -0
- package/dist/src/sheet/editing-types.js.map +1 -0
- package/dist/src/sheet/edits.d.ts +37 -0
- package/dist/src/sheet/edits.d.ts.map +1 -0
- package/dist/src/sheet/edits.js +31 -0
- package/dist/src/sheet/edits.js.map +1 -0
- package/dist/src/sheet/fields.d.ts +693 -0
- package/dist/src/sheet/fields.d.ts.map +1 -0
- package/dist/src/sheet/fields.js +280 -0
- package/dist/src/sheet/fields.js.map +1 -0
- package/dist/src/sheet/group.d.ts +165 -0
- package/dist/src/sheet/group.d.ts.map +1 -0
- package/dist/src/sheet/group.js +52 -0
- package/dist/src/sheet/group.js.map +1 -0
- package/dist/src/sheet/index.d.ts +542 -0
- package/dist/src/sheet/index.d.ts.map +1 -0
- package/dist/src/sheet/index.js +387 -0
- package/dist/src/sheet/index.js.map +1 -0
- package/dist/src/sheet/library.d.ts +284 -0
- package/dist/src/sheet/library.d.ts.map +1 -0
- package/dist/src/sheet/library.js +259 -0
- package/dist/src/sheet/library.js.map +1 -0
- package/dist/src/sheet/link.d.ts +398 -0
- package/dist/src/sheet/link.d.ts.map +1 -0
- package/dist/src/sheet/link.js +228 -0
- package/dist/src/sheet/link.js.map +1 -0
- package/dist/src/sheet/record.d.ts +75 -0
- package/dist/src/sheet/record.d.ts.map +1 -0
- package/dist/src/sheet/record.js +128 -0
- package/dist/src/sheet/record.js.map +1 -0
- package/dist/src/sheet/registers.d.ts +681 -0
- package/dist/src/sheet/registers.d.ts.map +1 -0
- package/dist/src/sheet/registers.js +671 -0
- package/dist/src/sheet/registers.js.map +1 -0
- package/dist/src/sheet/root.d.ts +329 -0
- package/dist/src/sheet/root.d.ts.map +1 -0
- package/dist/src/sheet/root.js +511 -0
- package/dist/src/sheet/root.js.map +1 -0
- package/dist/src/sheet/seed-bridge.d.ts +14 -0
- package/dist/src/sheet/seed-bridge.d.ts.map +1 -0
- package/dist/src/sheet/seed-bridge.js +51 -0
- package/dist/src/sheet/seed-bridge.js.map +1 -0
- package/dist/src/sheet/sheet.d.ts +11819 -0
- package/dist/src/sheet/sheet.d.ts.map +1 -0
- package/dist/src/sheet/sheet.js +236 -0
- package/dist/src/sheet/sheet.js.map +1 -0
- package/dist/src/sheet/sub-rows.d.ts +299 -0
- package/dist/src/sheet/sub-rows.d.ts.map +1 -0
- package/dist/src/sheet/sub-rows.js +272 -0
- package/dist/src/sheet/sub-rows.js.map +1 -0
- package/dist/src/sheet/templates.d.ts +161 -0
- package/dist/src/sheet/templates.d.ts.map +1 -0
- package/dist/src/sheet/templates.js +122 -0
- package/dist/src/sheet/templates.js.map +1 -0
- package/dist/src/sheet/transactions.d.ts +76 -0
- package/dist/src/sheet/transactions.d.ts.map +1 -0
- package/dist/src/sheet/transactions.js +40 -0
- package/dist/src/sheet/transactions.js.map +1 -0
- package/dist/src/sheet/types.d.ts +15226 -0
- package/dist/src/sheet/types.d.ts.map +1 -0
- package/dist/src/sheet/types.js +1070 -0
- package/dist/src/sheet/types.js.map +1 -0
- package/dist/src/sheet/views.d.ts +29 -0
- package/dist/src/sheet/views.d.ts.map +1 -0
- package/dist/src/sheet/views.js +43 -0
- package/dist/src/sheet/views.js.map +1 -0
- package/dist/src/studio/component.d.ts.map +1 -1
- package/dist/src/studio/component.js +11 -8
- package/dist/src/studio/component.js.map +1 -1
- package/dist/src/utils/derive.d.ts +134 -8
- package/dist/src/utils/derive.d.ts.map +1 -1
- package/dist/src/utils/derive.js +409 -7
- package/dist/src/utils/derive.js.map +1 -1
- package/dist/src/utils/ordered-source.d.ts +38 -0
- package/dist/src/utils/ordered-source.d.ts.map +1 -0
- package/dist/src/utils/ordered-source.js +45 -0
- package/dist/src/utils/ordered-source.js.map +1 -0
- package/dist/src/utils/row-inspector.d.ts +36 -0
- package/dist/src/utils/row-inspector.d.ts.map +1 -0
- package/dist/src/utils/row-inspector.js +49 -0
- package/dist/src/utils/row-inspector.js.map +1 -0
- package/dist/test/bind/data/data.examples.d.ts +21 -19
- package/dist/test/bind/data/data.examples.d.ts.map +1 -1
- package/dist/test/bind/data/data.examples.js +122 -122
- package/dist/test/bind/data/data.examples.js.map +1 -1
- package/dist/test/bind/record/record.examples.d.ts.map +1 -1
- package/dist/test/bind/record/record.examples.js +9 -9
- package/dist/test/bind/record/record.examples.js.map +1 -1
- package/dist/test/calendar/calendar-records.examples.d.ts +228 -0
- package/dist/test/calendar/calendar-records.examples.d.ts.map +1 -0
- package/dist/test/calendar/calendar-records.examples.js +91 -0
- package/dist/test/calendar/calendar-records.examples.js.map +1 -0
- package/dist/test/calendar/calendar.examples.d.ts +776 -0
- package/dist/test/calendar/calendar.examples.d.ts.map +1 -0
- package/dist/test/calendar/calendar.examples.js +336 -0
- package/dist/test/calendar/calendar.examples.js.map +1 -0
- package/dist/test/decision/journal.examples.d.ts +28 -28
- package/dist/test/decision/journal.examples.d.ts.map +1 -1
- package/dist/test/decision/journal.examples.js +4 -4
- package/dist/test/decision/journal.examples.js.map +1 -1
- package/dist/test/decision/queue.examples.d.ts.map +1 -1
- package/dist/test/decision/queue.examples.js +5 -7
- package/dist/test/decision/queue.examples.js.map +1 -1
- package/dist/test/flowchart/flowchart.examples.d.ts +3713 -0
- package/dist/test/flowchart/flowchart.examples.d.ts.map +1 -0
- package/dist/test/flowchart/flowchart.examples.js +465 -0
- package/dist/test/flowchart/flowchart.examples.js.map +1 -0
- package/dist/test/plan/plan-events.examples.d.ts +3666 -0
- package/dist/test/plan/plan-events.examples.d.ts.map +1 -0
- package/dist/test/plan/plan-events.examples.js +773 -0
- package/dist/test/plan/plan-events.examples.js.map +1 -0
- package/dist/test/plan/plan-records.examples.d.ts +3 -0
- package/dist/test/plan/plan-records.examples.d.ts.map +1 -0
- package/dist/test/plan/plan-records.examples.js +45 -0
- package/dist/test/plan/plan-records.examples.js.map +1 -0
- package/dist/test/plan/plan-windows.examples.d.ts +588 -0
- package/dist/test/plan/plan-windows.examples.d.ts.map +1 -0
- package/dist/test/plan/plan-windows.examples.js +170 -0
- package/dist/test/plan/plan-windows.examples.js.map +1 -0
- package/dist/test/plan/plan.examples.d.ts +8095 -0
- package/dist/test/plan/plan.examples.d.ts.map +1 -0
- package/dist/test/plan/plan.examples.js +2500 -0
- package/dist/test/plan/plan.examples.js.map +1 -0
- package/dist/test/roster/domain.examples.d.ts +367 -0
- package/dist/test/roster/domain.examples.d.ts.map +1 -0
- package/dist/test/roster/domain.examples.js +72 -0
- package/dist/test/roster/domain.examples.js.map +1 -0
- package/dist/test/roster/roster-records.examples.d.ts +729 -0
- package/dist/test/roster/roster-records.examples.d.ts.map +1 -0
- package/dist/test/roster/roster-records.examples.js +86 -0
- package/dist/test/roster/roster-records.examples.js.map +1 -0
- package/dist/test/roster/roster.examples.d.ts +750 -0
- package/dist/test/roster/roster.examples.d.ts.map +1 -0
- package/dist/test/roster/roster.examples.js +198 -0
- package/dist/test/roster/roster.examples.js.map +1 -0
- package/dist/test/roster/warehouse.d.ts +87 -0
- package/dist/test/roster/warehouse.d.ts.map +1 -0
- package/dist/test/roster/warehouse.js +883 -0
- package/dist/test/roster/warehouse.js.map +1 -0
- package/dist/test/sheet/sheet-link.examples.d.ts +7 -0
- package/dist/test/sheet/sheet-link.examples.d.ts.map +1 -0
- package/dist/test/sheet/sheet-link.examples.js +41 -0
- package/dist/test/sheet/sheet-link.examples.js.map +1 -0
- package/dist/test/sheet/sheet-records.examples.d.ts +421 -0
- package/dist/test/sheet/sheet-records.examples.d.ts.map +1 -0
- package/dist/test/sheet/sheet-records.examples.js +79 -0
- package/dist/test/sheet/sheet-records.examples.js.map +1 -0
- package/dist/test/sheet/sheet-transactions.examples.d.ts +7 -0
- package/dist/test/sheet/sheet-transactions.examples.d.ts.map +1 -0
- package/dist/test/sheet/sheet-transactions.examples.js +58 -0
- package/dist/test/sheet/sheet-transactions.examples.js.map +1 -0
- package/dist/test/sheet/sheet.examples.d.ts +5562 -0
- package/dist/test/sheet/sheet.examples.d.ts.map +1 -0
- package/dist/test/sheet/sheet.examples.js +1178 -0
- package/dist/test/sheet/sheet.examples.js.map +1 -0
- package/dist/test/studio/studio.examples.d.ts.map +1 -1
- package/dist/test/studio/studio.examples.js +11 -11
- package/dist/test/studio/studio.examples.js.map +1 -1
- package/package.json +12 -9
|
@@ -0,0 +1,218 @@
|
|
|
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
|
+
* `Plan.eventRef(kind, key)` (#1191, `Plan Builder Spec.md` PB10): an event of
|
|
7
|
+
* one of a Plan's event kinds, named for a link's end.
|
|
8
|
+
*
|
|
9
|
+
* Where an event draws is not known when the Plan is built: its row is the
|
|
10
|
+
* resource it is on, and a draft can move it. So the ref names the event, not
|
|
11
|
+
* its row: a run ref whose row is an `entry` of the kind's slot with no path
|
|
12
|
+
* — a row no series makes, since every row's path holds at least its entry's
|
|
13
|
+
* key — and whose run is the event's key. The canvas finds the event's
|
|
14
|
+
* element where it draws.
|
|
15
|
+
*
|
|
16
|
+
* @packageDocumentation
|
|
17
|
+
*/
|
|
18
|
+
import { type ExprType, type StringType, type SubtypeExprOrValue } from "@elaraai/east";
|
|
19
|
+
import { PlanRunRefType } from "./types.js";
|
|
20
|
+
/**
|
|
21
|
+
* Names an event for a link's end — `Plan.eventRef("job", "J-4642")`.
|
|
22
|
+
*
|
|
23
|
+
* @param kind - The event kind's slot name, as the Plan's `events` names it
|
|
24
|
+
* @param key - The event's record key, as text (a String key as it is, any other key as East prints it)
|
|
25
|
+
* @returns The run ref a link's `from` or `to` takes
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* // .tsx file with the `@jsxImportSource @elaraai/e3-ui` pragma
|
|
30
|
+
* import { ArrayType, DateTimeType, DictType, East, FloatType, NullType, OptionType, StringType, StructType, VariantType, some, variant } from "@elaraai/east";
|
|
31
|
+
* import { EventStateType, Format, Reactive, UIComponentType } from "@elaraai/east-ui";
|
|
32
|
+
* import { Data, Plan, Record, Schedule } from "@elaraai/e3-ui";
|
|
33
|
+
* import e3 from "@elaraai/e3";
|
|
34
|
+
*
|
|
35
|
+
* export const PrintPress = StructType({ name: StringType, hall: StringType, sheets_per_hour: FloatType });
|
|
36
|
+
* export const PrintJob = StructType({
|
|
37
|
+
* title: StringType,
|
|
38
|
+
* start: OptionType(DateTimeType),
|
|
39
|
+
* end: OptionType(DateTimeType),
|
|
40
|
+
* press: OptionType(StringType),
|
|
41
|
+
* state: EventStateType,
|
|
42
|
+
* sheets: FloatType,
|
|
43
|
+
* customer: StringType,
|
|
44
|
+
* stock: VariantType({ coated: NullType, uncoated: NullType, board: NullType }),
|
|
45
|
+
* due: OptionType(DateTimeType),
|
|
46
|
+
* });
|
|
47
|
+
* export const PrintStock = StructType({ name: StringType, weekly: ArrayType(FloatType) });
|
|
48
|
+
* export const PrintCentre = StructType({ name: StringType });
|
|
49
|
+
* export const PrintPlates = StructType({ title: StringType, at: DateTimeType, setter: StringType });
|
|
50
|
+
* export const PrintBinding = StructType({ title: StringType, start: DateTimeType, end: DateTimeType, line: StringType, state: EventStateType });
|
|
51
|
+
* export const PrintDelivery = StructType({ title: StringType, at: DateTimeType, bay: StringType });
|
|
52
|
+
* export const planPrintPresses = e3.record("plan_print_presses", DictType(StringType, PrintPress), new Map([
|
|
53
|
+
* ["a1", { name: "Press A1", hall: "Hall A", sheets_per_hour: 12000.0 }],
|
|
54
|
+
* ["a2", { name: "Press A2", hall: "Hall A", sheets_per_hour: 10000.0 }],
|
|
55
|
+
* ["a3", { name: "Press A3", hall: "Hall A", sheets_per_hour: 8000.0 }],
|
|
56
|
+
* ["b1", { name: "Press B1", hall: "Hall B", sheets_per_hour: 15000.0 }],
|
|
57
|
+
* ["b2", { name: "Press B2", hall: "Hall B", sheets_per_hour: 12000.0 }],
|
|
58
|
+
* ["b3", { name: "Press B3", hall: "Hall B", sheets_per_hour: 6000.0 }],
|
|
59
|
+
* ]));
|
|
60
|
+
* export const planLinkStock = e3.input("plan_link_stock", DictType(StringType, PrintStock), variant("value", new Map([
|
|
61
|
+
* ["board", { name: "Board", weekly: [40.0, 22.0, 31.0, 18.0] }],
|
|
62
|
+
* ["coated", { name: "Coated", weekly: [520.0, 410.0, 460.0, 380.0] }],
|
|
63
|
+
* ["uncoated", { name: "Uncoated", weekly: [300.0, 260.0, 280.0, 240.0] }],
|
|
64
|
+
* ])));
|
|
65
|
+
* export const planLinkSetters = e3.record("plan_link_setters", DictType(StringType, PrintCentre), new Map([
|
|
66
|
+
* ["ps", { name: "Platesetter" }],
|
|
67
|
+
* ]));
|
|
68
|
+
* export const planLinkLines = e3.record("plan_link_lines", DictType(StringType, PrintCentre), new Map([
|
|
69
|
+
* ["fold", { name: "Folder" }],
|
|
70
|
+
* ["bind", { name: "Binder" }],
|
|
71
|
+
* ]));
|
|
72
|
+
* export const planLinkBays = e3.record("plan_link_bays", DictType(StringType, PrintCentre), new Map([
|
|
73
|
+
* ["bay", { name: "Dispatch bay" }],
|
|
74
|
+
* ]));
|
|
75
|
+
* export const planLinkPlates = e3.record("plan_link_plates", DictType(StringType, PrintPlates), new Map([
|
|
76
|
+
* ["P-01", { title: "Catalogue plates", at: new Date("2026-10-05T12:00:00Z"), setter: "ps" }],
|
|
77
|
+
* ]));
|
|
78
|
+
* export const planLinkPlatesPatch = e3.mutation.patch(planLinkPlates);
|
|
79
|
+
* export const planLinkCaseJobs = e3.record("plan_link_case_jobs", DictType(StringType, PrintJob), new Map([
|
|
80
|
+
* ["J-2001", { title: "Catalogue covers", start: some(new Date("2026-10-08T06:00:00Z")), end: some(new Date("2026-10-08T08:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 12000.0, customer: "Larkspur Home", stock: variant("board", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
|
|
81
|
+
* ["J-2002", { title: "Shop posters", start: some(new Date("2026-10-10T06:00:00Z")), end: some(new Date("2026-10-11T06:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 24000.0, customer: "Orchard Street Market", stock: variant("uncoated", null), due: some(new Date("2026-10-20T00:00:00Z")) }],
|
|
82
|
+
* ["J-2003", { title: "Catalogue inserts", start: some(new Date("2026-10-15T06:00:00Z")), end: some(new Date("2026-10-17T18:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 96000.0, customer: "Larkspur Home", stock: variant("coated", null), due: some(new Date("2026-10-19T00:00:00Z")) }],
|
|
83
|
+
* ["J-2004", { title: "Price lists", start: some(new Date("2026-10-07T12:00:00Z")), end: some(new Date("2026-10-08T18:00:00Z")), press: some("a2"), state: variant("confirmed", null), sheets: 16000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
|
|
84
|
+
* ["J-2005", { title: "Menu cards", start: some(new Date("2026-10-11T06:00:00Z")), end: some(new Date("2026-10-11T18:00:00Z")), press: some("a2"), state: variant("confirmed", null), sheets: 30000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-13T00:00:00Z")) }],
|
|
85
|
+
* ["J-2006", { title: "Gift tags", start: some(new Date("2026-10-25T06:00:00Z")), end: some(new Date("2026-10-25T18:00:00Z")), press: some("a2"), state: variant("proposed", variant("recommended", null)), sheets: 20000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-28T00:00:00Z")) }],
|
|
86
|
+
* ["J-2007", { title: "Gift boxes", start: some(new Date("2026-10-27T06:00:00Z")), end: some(new Date("2026-10-27T14:00:00Z")), press: some("a2"), state: variant("proposed", variant("recommended", null)), sheets: 48000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
|
|
87
|
+
* ["J-2008", { title: "Proof run", start: some(new Date("2026-10-02T06:00:00Z")), end: some(new Date("2026-10-05T18:00:00Z")), press: some("a3"), state: variant("actual", null), sheets: 16000.0, customer: "Meridian Monthly", stock: variant("coated", null), due: some(new Date("2026-10-06T00:00:00Z")) }],
|
|
88
|
+
* ["J-2009", { title: "Annual report", start: some(new Date("2026-10-19T18:00:00Z")), end: some(new Date("2026-10-21T06:00:00Z")), press: some("a3"), state: variant("confirmed", null), sheets: 48000.0, customer: "Harbour Arts Society", stock: variant("coated", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
|
|
89
|
+
* ["J-2010", { title: "Desk calendars", start: some(new Date("2026-10-28T06:00:00Z")), end: some(new Date("2026-10-29T06:00:00Z")), press: some("a3"), state: variant("proposed", variant("added", null)), sheets: 36000.0, customer: "Foxglove Gardens", stock: variant("board", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
|
|
90
|
+
* ["J-2011", { title: "Calendar pads", start: some(new Date("2026-10-29T06:00:00Z")), end: some(new Date("2026-10-30T18:00:00Z")), press: some("a3"), state: variant("proposed", variant("added", null)), sheets: 72000.0, customer: "Foxglove Gardens", stock: variant("uncoated", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
|
|
91
|
+
* ["J-2012", { title: "Proof sheets", start: some(new Date("2026-09-28T06:00:00Z")), end: some(new Date("2026-09-30T18:00:00Z")), press: some("b1"), state: variant("actual", null), sheets: 8000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-10-01T00:00:00Z")) }],
|
|
92
|
+
* ["J-2013", { title: "Catalogue", start: some(new Date("2026-10-12T06:00:00Z")), end: some(new Date("2026-10-13T18:00:00Z")), press: some("b1"), state: variant("confirmed", null), sheets: 144000.0, customer: "Larkspur Home", stock: variant("coated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
|
|
93
|
+
* ["J-2014", { title: "Seed catalogue", start: some(new Date("2026-10-22T06:00:00Z")), end: some(new Date("2026-10-23T12:00:00Z")), press: some("b1"), state: variant("confirmed", null), sheets: 100000.0, customer: "Foxglove Gardens", stock: variant("coated", null), due: some(new Date("2026-10-26T00:00:00Z")) }],
|
|
94
|
+
* ["J-2015", { title: "Night run", start: some(new Date("2026-10-05T00:00:00Z")), end: some(new Date("2026-10-05T08:00:00Z")), press: some("b2"), state: variant("actual", null), sheets: 16000.0, customer: "Meridian Monthly", stock: variant("coated", null), due: some(new Date("2026-10-06T00:00:00Z")) }],
|
|
95
|
+
* ["J-2016", { title: "Store flyers", start: some(new Date("2026-10-16T06:00:00Z")), end: some(new Date("2026-10-16T20:00:00Z")), press: some("b2"), state: variant("confirmed", null), sheets: 96000.0, customer: "Larkspur Home", stock: variant("uncoated", null), due: some(new Date("2026-10-19T00:00:00Z")) }],
|
|
96
|
+
* ["J-2017", { title: "Seed packets", start: some(new Date("2026-10-23T06:00:00Z")), end: some(new Date("2026-10-24T06:00:00Z")), press: some("b2"), state: variant("confirmed", null), sheets: 72000.0, customer: "Foxglove Gardens", stock: variant("board", null), due: some(new Date("2026-10-27T00:00:00Z")) }],
|
|
97
|
+
* ["J-2018", { title: "Exhibition book", start: some(new Date("2026-10-26T06:00:00Z")), end: some(new Date("2026-10-27T18:00:00Z")), press: some("b2"), state: variant("proposed", variant("recommended", null)), sheets: 54000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
|
|
98
|
+
* ["J-2019", { title: "Ticket books", start: some(new Date("2026-10-29T06:00:00Z")), end: some(new Date("2026-10-30T06:00:00Z")), press: some("b2"), state: variant("estimated", null), sheets: 60000.0, customer: "Heathfield Theatre", stock: variant("uncoated", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
|
|
99
|
+
* ["J-2020", { title: "Card stock", start: some(new Date("2026-10-06T06:00:00Z")), end: some(new Date("2026-10-06T14:00:00Z")), press: some("b3"), state: variant("actual", null), sheets: 30000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-08T00:00:00Z")) }],
|
|
100
|
+
* ["J-2021", { title: "Book sections", start: some(new Date("2026-10-11T06:00:00Z")), end: some(new Date("2026-10-12T12:00:00Z")), press: some("b3"), state: variant("confirmed", null), sheets: 84000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-14T00:00:00Z")) }],
|
|
101
|
+
* ["J-2022", { title: "Report covers", start: some(new Date("2026-10-19T06:00:00Z")), end: some(new Date("2026-10-20T18:00:00Z")), press: some("b3"), state: variant("confirmed", null), sheets: 48000.0, customer: "Harbour Arts Society", stock: variant("board", null), due: some(new Date("2026-10-21T00:00:00Z")) }],
|
|
102
|
+
* ["J-2023", { title: "Spring brochure", start: some(new Date("2026-11-03T06:00:00Z")), end: some(new Date("2026-11-04T18:00:00Z")), press: some("b3"), state: variant("estimated", null), sheets: 60000.0, customer: "Heathfield Theatre", stock: variant("coated", null), due: some(new Date("2026-11-09T00:00:00Z")) }],
|
|
103
|
+
* ]));
|
|
104
|
+
* export const planLinkCaseJobsPatch = e3.mutation.patch(planLinkCaseJobs);
|
|
105
|
+
* export const planLinkBindings = e3.record("plan_link_bindings", DictType(StringType, PrintBinding), new Map([
|
|
106
|
+
* ["B-01", { title: "Fold sections", start: new Date("2026-10-15T06:00:00Z"), end: new Date("2026-10-16T06:00:00Z"), line: "fold", state: variant("confirmed", null) }],
|
|
107
|
+
* ["B-02", { title: "Fold sections", start: new Date("2026-10-17T06:00:00Z"), end: new Date("2026-10-18T06:00:00Z"), line: "fold", state: variant("confirmed", null) }],
|
|
108
|
+
* ["B-03", { title: "Bind books", start: new Date("2026-10-20T18:00:00Z"), end: new Date("2026-10-21T18:00:00Z"), line: "bind", state: variant("confirmed", null) }],
|
|
109
|
+
* ["B-04", { title: "Bind exhibition book", start: new Date("2026-10-25T06:00:00Z"), end: new Date("2026-10-26T06:00:00Z"), line: "bind", state: variant("proposed", variant("recommended", null)) }],
|
|
110
|
+
* ]));
|
|
111
|
+
* export const planLinkBindingsPatch = e3.mutation.patch(planLinkBindings);
|
|
112
|
+
* export const planLinkDeliveries = e3.record("plan_link_deliveries", DictType(StringType, PrintDelivery), new Map([
|
|
113
|
+
* ["D-01", { title: "Books", at: new Date("2026-10-28T10:00:00Z"), bay: "bay" }],
|
|
114
|
+
* ["D-02", { title: "Posters", at: new Date("2026-10-20T10:00:00Z"), bay: "bay" }],
|
|
115
|
+
* ]));
|
|
116
|
+
* export const planLinkDeliveriesPatch = e3.mutation.patch(planLinkDeliveries);
|
|
117
|
+
*
|
|
118
|
+
* const planEventLinks = East.function([], UIComponentType, (_$) => (
|
|
119
|
+
* <Reactive>{$ => {
|
|
120
|
+
* const setters = $.let(Record.bind(planLinkSetters, []));
|
|
121
|
+
* const presses = $.let(Record.bind(planPrintPresses, []));
|
|
122
|
+
* const lines = $.let(Record.bind(planLinkLines, []));
|
|
123
|
+
* const bays = $.let(Record.bind(planLinkBays, []));
|
|
124
|
+
* const plates = $.let(Record.bind(planLinkPlates, [planLinkPlatesPatch]));
|
|
125
|
+
* const jobs = $.let(Record.bind(planLinkCaseJobs, [planLinkCaseJobsPatch]));
|
|
126
|
+
* const bindings = $.let(Record.bind(planLinkBindings, [planLinkBindingsPatch]));
|
|
127
|
+
* const deliveries = $.let(Record.bind(planLinkDeliveries, [planLinkDeliveriesPatch]));
|
|
128
|
+
* const stock = $.let(Data.bind(planLinkStock));
|
|
129
|
+
* // The window's first Monday: each stock reading runs from it, a week apiece.
|
|
130
|
+
* const first = $.const(new Date("2026-10-05T00:00:00Z"), DateTimeType);
|
|
131
|
+
* const StockWeek = StructType({ at: DateTimeType, value: OptionType(FloatType) });
|
|
132
|
+
* const weekly = $.const(East.function([ArrayType(FloatType)], ArrayType(StockWeek), (_$2, readings) =>
|
|
133
|
+
* East.Array.generate(readings.size(), StockWeek, (_$3, i) => ({ at: first.addWeeks(i), value: some(readings.get(i)) }))));
|
|
134
|
+
* const axis = $.let(Plan.axis({
|
|
135
|
+
* window: { min: new Date("2026-10-05T00:00:00Z"), max: new Date("2026-11-02T00:00:00Z") },
|
|
136
|
+
* resolution: "week", now: new Date("2026-10-14T09:00:00Z"),
|
|
137
|
+
* }));
|
|
138
|
+
* return (
|
|
139
|
+
* <Plan
|
|
140
|
+
* axis={axis}
|
|
141
|
+
* resources={{
|
|
142
|
+
* setters: Schedule.resources(setters.read(), { name: "Plate room", icon: "layer-group", label: s => s.name }),
|
|
143
|
+
* presses: Schedule.resources(presses.read(), { name: "Presses", icon: "print", label: p => p.name, group: p => p.hall }),
|
|
144
|
+
* lines: Schedule.resources(lines.read(), { name: "Bindery", icon: "book", label: l => l.name }),
|
|
145
|
+
* bays: Schedule.resources(bays.read(), { name: "Dispatch", icon: "warehouse", label: b => b.name }),
|
|
146
|
+
* }}
|
|
147
|
+
* events={{
|
|
148
|
+
* plate: Schedule.events(plates, {
|
|
149
|
+
* name: "Plates", icon: "clone",
|
|
150
|
+
* title: "title", at: "at",
|
|
151
|
+
* resource: { field: "setter", of: "setters" },
|
|
152
|
+
* }),
|
|
153
|
+
* job: Schedule.events(jobs, {
|
|
154
|
+
* name: "Print job", icon: "file-lines",
|
|
155
|
+
* title: "title", start: "start", end: "end",
|
|
156
|
+
* resource: { field: "press", of: "presses" },
|
|
157
|
+
* state: "state", quantity: { field: "sheets", unit: "sheets" },
|
|
158
|
+
* }),
|
|
159
|
+
* binding: Schedule.events(bindings, {
|
|
160
|
+
* name: "Bindery job", icon: "book-open", draw: "cards",
|
|
161
|
+
* title: "title", start: "start", end: "end",
|
|
162
|
+
* resource: { field: "line", of: "lines" }, state: "state",
|
|
163
|
+
* }),
|
|
164
|
+
* delivery: Schedule.events(deliveries, {
|
|
165
|
+
* name: "Delivery", icon: "truck", draw: "buckets",
|
|
166
|
+
* title: "title", at: "at",
|
|
167
|
+
* resource: { field: "bay", of: "bays" },
|
|
168
|
+
* }),
|
|
169
|
+
* }}
|
|
170
|
+
* // The paper in stock: a table over a dataset, read only.
|
|
171
|
+
* rows={[
|
|
172
|
+
* Plan.over(stock, [
|
|
173
|
+
* Plan.series.table(PrintStock, {
|
|
174
|
+
* key: "stock", title: "Paper stock", label: s => s.name,
|
|
175
|
+
* cells: s => Plan.tableCells(weekly(s.weekly)),
|
|
176
|
+
* format: Format.Number({ maximumFractionDigits: 0n }),
|
|
177
|
+
* }),
|
|
178
|
+
* ]),
|
|
179
|
+
* ]}
|
|
180
|
+
* // Each quantity in thousands of sheets, its third of the family's largest setting the link's
|
|
181
|
+
* // weight; the plates' link carries none.
|
|
182
|
+
* links={[
|
|
183
|
+
* Plan.link({ key: "plates", from: Plan.eventRef("plate", "P-01"), to: Plan.eventRef("job", "J-2001") }),
|
|
184
|
+
* Plan.link({ key: "covers", from: Plan.eventRef("job", "J-2001"), to: Plan.eventRef("job", "J-2013"), quantity: Plan.quantity(12, { unit: "k sheets" }) }),
|
|
185
|
+
* Plan.link({ key: "card", from: Plan.eventRef("job", "J-2020"), to: Plan.eventRef("job", "J-2005"), quantity: Plan.quantity(30, { unit: "k sheets" }) }),
|
|
186
|
+
* Plan.link({ key: "inserts", from: Plan.eventRef("job", "J-2003"), to: Plan.eventRef("job", "J-2016"), quantity: Plan.quantity(96, { unit: "k sheets" }) }),
|
|
187
|
+
* Plan.link({ key: "report-covers", from: Plan.eventRef("job", "J-2022"), to: Plan.eventRef("job", "J-2009"), quantity: Plan.quantity(48, { unit: "k sheets" }) }),
|
|
188
|
+
* Plan.link({ key: "seed-prints", from: Plan.eventRef("job", "J-2014"), to: Plan.eventRef("job", "J-2017"), quantity: Plan.quantity(72, { unit: "k sheets" }) }),
|
|
189
|
+
* Plan.link({ key: "tags", from: Plan.eventRef("job", "J-2006"), to: Plan.eventRef("job", "J-2007"), quantity: Plan.quantity(20, { unit: "k sheets" }) }),
|
|
190
|
+
* Plan.link({ key: "pads", from: Plan.eventRef("job", "J-2010"), to: Plan.eventRef("job", "J-2011"), quantity: Plan.quantity(36, { unit: "k sheets" }) }),
|
|
191
|
+
* Plan.link({ key: "proofs", from: Plan.eventRef("job", "J-2008"), to: Plan.eventRef("job", "J-2015"), quantity: Plan.quantity(16, { unit: "k sheets" }) }),
|
|
192
|
+
* Plan.link({ key: "proof-sheets", from: Plan.eventRef("job", "J-2012"), to: Plan.eventRef("job", "J-2004"), quantity: Plan.quantity(8, { unit: "k sheets" }) }),
|
|
193
|
+
* Plan.link({ key: "tickets", from: Plan.eventRef("job", "J-2019"), to: Plan.eventRef("job", "J-2023"), quantity: Plan.quantity(60, { unit: "k sheets" }) }),
|
|
194
|
+
* Plan.link({ key: "sections", from: Plan.eventRef("job", "J-2021"), to: Plan.eventRef("binding", "B-01"), quantity: Plan.quantity(40, { unit: "k sheets" }) }),
|
|
195
|
+
* Plan.link({ key: "sections-more", from: Plan.eventRef("job", "J-2021"), to: Plan.eventRef("binding", "B-02"), quantity: Plan.quantity(44, { unit: "k sheets" }) }),
|
|
196
|
+
* Plan.link({ key: "folded", from: Plan.eventRef("binding", "B-02"), to: Plan.eventRef("binding", "B-03"), quantity: Plan.quantity(40, { unit: "k sheets" }) }),
|
|
197
|
+
* Plan.link({ key: "books", from: Plan.eventRef("binding", "B-03"), to: Plan.eventRef("delivery", "D-01"), quantity: Plan.quantity(36, { unit: "k sheets" }) }),
|
|
198
|
+
* Plan.link({ key: "posters", from: Plan.eventRef("job", "J-2002"), to: Plan.eventRef("delivery", "D-02"), quantity: Plan.quantity(24, { unit: "k sheets" }) }),
|
|
199
|
+
* Plan.link({ key: "book-blocks", from: Plan.eventRef("job", "J-2018"), to: Plan.eventRef("binding", "B-04"), quantity: Plan.quantity(54, { unit: "k sheets" }) }),
|
|
200
|
+
* ]}
|
|
201
|
+
* style={{ height: "400px" }}
|
|
202
|
+
* />
|
|
203
|
+
* );
|
|
204
|
+
* }}</Reactive>
|
|
205
|
+
* ));
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
export declare function createEventRef(kind: string, key: SubtypeExprOrValue<StringType>): ExprType<PlanRunRefType>;
|
|
209
|
+
/**
|
|
210
|
+
* The kind an event ref names, when `Plan.eventRef` made it — what a Plan
|
|
211
|
+
* checks its links' ends against.
|
|
212
|
+
*
|
|
213
|
+
* @param ref - A link end
|
|
214
|
+
* @returns The kind's slot name, or `undefined` for any other value
|
|
215
|
+
* @internal
|
|
216
|
+
*/
|
|
217
|
+
export declare function eventRefKind(ref: unknown): string | undefined;
|
|
218
|
+
//# sourceMappingURL=refs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refs.d.ts","sourceRoot":"","sources":["../../../src/plan/refs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAiB,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAK5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2LG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,kBAAkB,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC,cAAc,CAAC,CAI1G;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAE7D"}
|
|
@@ -0,0 +1,226 @@
|
|
|
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
|
+
* `Plan.eventRef(kind, key)` (#1191, `Plan Builder Spec.md` PB10): an event of
|
|
7
|
+
* one of a Plan's event kinds, named for a link's end.
|
|
8
|
+
*
|
|
9
|
+
* Where an event draws is not known when the Plan is built: its row is the
|
|
10
|
+
* resource it is on, and a draft can move it. So the ref names the event, not
|
|
11
|
+
* its row: a run ref whose row is an `entry` of the kind's slot with no path
|
|
12
|
+
* — a row no series makes, since every row's path holds at least its entry's
|
|
13
|
+
* key — and whose run is the event's key. The canvas finds the event's
|
|
14
|
+
* element where it draws.
|
|
15
|
+
*
|
|
16
|
+
* @packageDocumentation
|
|
17
|
+
*/
|
|
18
|
+
import { East, variant } from "@elaraai/east";
|
|
19
|
+
import { PlanRunRefType } from "./types.js";
|
|
20
|
+
/** The kind of each ref `Plan.eventRef` made, by the value it returned. */
|
|
21
|
+
const EVENT_REFS = new WeakMap();
|
|
22
|
+
/**
|
|
23
|
+
* Names an event for a link's end — `Plan.eventRef("job", "J-4642")`.
|
|
24
|
+
*
|
|
25
|
+
* @param kind - The event kind's slot name, as the Plan's `events` names it
|
|
26
|
+
* @param key - The event's record key, as text (a String key as it is, any other key as East prints it)
|
|
27
|
+
* @returns The run ref a link's `from` or `to` takes
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* // .tsx file with the `@jsxImportSource @elaraai/e3-ui` pragma
|
|
32
|
+
* import { ArrayType, DateTimeType, DictType, East, FloatType, NullType, OptionType, StringType, StructType, VariantType, some, variant } from "@elaraai/east";
|
|
33
|
+
* import { EventStateType, Format, Reactive, UIComponentType } from "@elaraai/east-ui";
|
|
34
|
+
* import { Data, Plan, Record, Schedule } from "@elaraai/e3-ui";
|
|
35
|
+
* import e3 from "@elaraai/e3";
|
|
36
|
+
*
|
|
37
|
+
* export const PrintPress = StructType({ name: StringType, hall: StringType, sheets_per_hour: FloatType });
|
|
38
|
+
* export const PrintJob = StructType({
|
|
39
|
+
* title: StringType,
|
|
40
|
+
* start: OptionType(DateTimeType),
|
|
41
|
+
* end: OptionType(DateTimeType),
|
|
42
|
+
* press: OptionType(StringType),
|
|
43
|
+
* state: EventStateType,
|
|
44
|
+
* sheets: FloatType,
|
|
45
|
+
* customer: StringType,
|
|
46
|
+
* stock: VariantType({ coated: NullType, uncoated: NullType, board: NullType }),
|
|
47
|
+
* due: OptionType(DateTimeType),
|
|
48
|
+
* });
|
|
49
|
+
* export const PrintStock = StructType({ name: StringType, weekly: ArrayType(FloatType) });
|
|
50
|
+
* export const PrintCentre = StructType({ name: StringType });
|
|
51
|
+
* export const PrintPlates = StructType({ title: StringType, at: DateTimeType, setter: StringType });
|
|
52
|
+
* export const PrintBinding = StructType({ title: StringType, start: DateTimeType, end: DateTimeType, line: StringType, state: EventStateType });
|
|
53
|
+
* export const PrintDelivery = StructType({ title: StringType, at: DateTimeType, bay: StringType });
|
|
54
|
+
* export const planPrintPresses = e3.record("plan_print_presses", DictType(StringType, PrintPress), new Map([
|
|
55
|
+
* ["a1", { name: "Press A1", hall: "Hall A", sheets_per_hour: 12000.0 }],
|
|
56
|
+
* ["a2", { name: "Press A2", hall: "Hall A", sheets_per_hour: 10000.0 }],
|
|
57
|
+
* ["a3", { name: "Press A3", hall: "Hall A", sheets_per_hour: 8000.0 }],
|
|
58
|
+
* ["b1", { name: "Press B1", hall: "Hall B", sheets_per_hour: 15000.0 }],
|
|
59
|
+
* ["b2", { name: "Press B2", hall: "Hall B", sheets_per_hour: 12000.0 }],
|
|
60
|
+
* ["b3", { name: "Press B3", hall: "Hall B", sheets_per_hour: 6000.0 }],
|
|
61
|
+
* ]));
|
|
62
|
+
* export const planLinkStock = e3.input("plan_link_stock", DictType(StringType, PrintStock), variant("value", new Map([
|
|
63
|
+
* ["board", { name: "Board", weekly: [40.0, 22.0, 31.0, 18.0] }],
|
|
64
|
+
* ["coated", { name: "Coated", weekly: [520.0, 410.0, 460.0, 380.0] }],
|
|
65
|
+
* ["uncoated", { name: "Uncoated", weekly: [300.0, 260.0, 280.0, 240.0] }],
|
|
66
|
+
* ])));
|
|
67
|
+
* export const planLinkSetters = e3.record("plan_link_setters", DictType(StringType, PrintCentre), new Map([
|
|
68
|
+
* ["ps", { name: "Platesetter" }],
|
|
69
|
+
* ]));
|
|
70
|
+
* export const planLinkLines = e3.record("plan_link_lines", DictType(StringType, PrintCentre), new Map([
|
|
71
|
+
* ["fold", { name: "Folder" }],
|
|
72
|
+
* ["bind", { name: "Binder" }],
|
|
73
|
+
* ]));
|
|
74
|
+
* export const planLinkBays = e3.record("plan_link_bays", DictType(StringType, PrintCentre), new Map([
|
|
75
|
+
* ["bay", { name: "Dispatch bay" }],
|
|
76
|
+
* ]));
|
|
77
|
+
* export const planLinkPlates = e3.record("plan_link_plates", DictType(StringType, PrintPlates), new Map([
|
|
78
|
+
* ["P-01", { title: "Catalogue plates", at: new Date("2026-10-05T12:00:00Z"), setter: "ps" }],
|
|
79
|
+
* ]));
|
|
80
|
+
* export const planLinkPlatesPatch = e3.mutation.patch(planLinkPlates);
|
|
81
|
+
* export const planLinkCaseJobs = e3.record("plan_link_case_jobs", DictType(StringType, PrintJob), new Map([
|
|
82
|
+
* ["J-2001", { title: "Catalogue covers", start: some(new Date("2026-10-08T06:00:00Z")), end: some(new Date("2026-10-08T08:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 12000.0, customer: "Larkspur Home", stock: variant("board", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
|
|
83
|
+
* ["J-2002", { title: "Shop posters", start: some(new Date("2026-10-10T06:00:00Z")), end: some(new Date("2026-10-11T06:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 24000.0, customer: "Orchard Street Market", stock: variant("uncoated", null), due: some(new Date("2026-10-20T00:00:00Z")) }],
|
|
84
|
+
* ["J-2003", { title: "Catalogue inserts", start: some(new Date("2026-10-15T06:00:00Z")), end: some(new Date("2026-10-17T18:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 96000.0, customer: "Larkspur Home", stock: variant("coated", null), due: some(new Date("2026-10-19T00:00:00Z")) }],
|
|
85
|
+
* ["J-2004", { title: "Price lists", start: some(new Date("2026-10-07T12:00:00Z")), end: some(new Date("2026-10-08T18:00:00Z")), press: some("a2"), state: variant("confirmed", null), sheets: 16000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
|
|
86
|
+
* ["J-2005", { title: "Menu cards", start: some(new Date("2026-10-11T06:00:00Z")), end: some(new Date("2026-10-11T18:00:00Z")), press: some("a2"), state: variant("confirmed", null), sheets: 30000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-13T00:00:00Z")) }],
|
|
87
|
+
* ["J-2006", { title: "Gift tags", start: some(new Date("2026-10-25T06:00:00Z")), end: some(new Date("2026-10-25T18:00:00Z")), press: some("a2"), state: variant("proposed", variant("recommended", null)), sheets: 20000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-28T00:00:00Z")) }],
|
|
88
|
+
* ["J-2007", { title: "Gift boxes", start: some(new Date("2026-10-27T06:00:00Z")), end: some(new Date("2026-10-27T14:00:00Z")), press: some("a2"), state: variant("proposed", variant("recommended", null)), sheets: 48000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
|
|
89
|
+
* ["J-2008", { title: "Proof run", start: some(new Date("2026-10-02T06:00:00Z")), end: some(new Date("2026-10-05T18:00:00Z")), press: some("a3"), state: variant("actual", null), sheets: 16000.0, customer: "Meridian Monthly", stock: variant("coated", null), due: some(new Date("2026-10-06T00:00:00Z")) }],
|
|
90
|
+
* ["J-2009", { title: "Annual report", start: some(new Date("2026-10-19T18:00:00Z")), end: some(new Date("2026-10-21T06:00:00Z")), press: some("a3"), state: variant("confirmed", null), sheets: 48000.0, customer: "Harbour Arts Society", stock: variant("coated", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
|
|
91
|
+
* ["J-2010", { title: "Desk calendars", start: some(new Date("2026-10-28T06:00:00Z")), end: some(new Date("2026-10-29T06:00:00Z")), press: some("a3"), state: variant("proposed", variant("added", null)), sheets: 36000.0, customer: "Foxglove Gardens", stock: variant("board", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
|
|
92
|
+
* ["J-2011", { title: "Calendar pads", start: some(new Date("2026-10-29T06:00:00Z")), end: some(new Date("2026-10-30T18:00:00Z")), press: some("a3"), state: variant("proposed", variant("added", null)), sheets: 72000.0, customer: "Foxglove Gardens", stock: variant("uncoated", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
|
|
93
|
+
* ["J-2012", { title: "Proof sheets", start: some(new Date("2026-09-28T06:00:00Z")), end: some(new Date("2026-09-30T18:00:00Z")), press: some("b1"), state: variant("actual", null), sheets: 8000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-10-01T00:00:00Z")) }],
|
|
94
|
+
* ["J-2013", { title: "Catalogue", start: some(new Date("2026-10-12T06:00:00Z")), end: some(new Date("2026-10-13T18:00:00Z")), press: some("b1"), state: variant("confirmed", null), sheets: 144000.0, customer: "Larkspur Home", stock: variant("coated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
|
|
95
|
+
* ["J-2014", { title: "Seed catalogue", start: some(new Date("2026-10-22T06:00:00Z")), end: some(new Date("2026-10-23T12:00:00Z")), press: some("b1"), state: variant("confirmed", null), sheets: 100000.0, customer: "Foxglove Gardens", stock: variant("coated", null), due: some(new Date("2026-10-26T00:00:00Z")) }],
|
|
96
|
+
* ["J-2015", { title: "Night run", start: some(new Date("2026-10-05T00:00:00Z")), end: some(new Date("2026-10-05T08:00:00Z")), press: some("b2"), state: variant("actual", null), sheets: 16000.0, customer: "Meridian Monthly", stock: variant("coated", null), due: some(new Date("2026-10-06T00:00:00Z")) }],
|
|
97
|
+
* ["J-2016", { title: "Store flyers", start: some(new Date("2026-10-16T06:00:00Z")), end: some(new Date("2026-10-16T20:00:00Z")), press: some("b2"), state: variant("confirmed", null), sheets: 96000.0, customer: "Larkspur Home", stock: variant("uncoated", null), due: some(new Date("2026-10-19T00:00:00Z")) }],
|
|
98
|
+
* ["J-2017", { title: "Seed packets", start: some(new Date("2026-10-23T06:00:00Z")), end: some(new Date("2026-10-24T06:00:00Z")), press: some("b2"), state: variant("confirmed", null), sheets: 72000.0, customer: "Foxglove Gardens", stock: variant("board", null), due: some(new Date("2026-10-27T00:00:00Z")) }],
|
|
99
|
+
* ["J-2018", { title: "Exhibition book", start: some(new Date("2026-10-26T06:00:00Z")), end: some(new Date("2026-10-27T18:00:00Z")), press: some("b2"), state: variant("proposed", variant("recommended", null)), sheets: 54000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
|
|
100
|
+
* ["J-2019", { title: "Ticket books", start: some(new Date("2026-10-29T06:00:00Z")), end: some(new Date("2026-10-30T06:00:00Z")), press: some("b2"), state: variant("estimated", null), sheets: 60000.0, customer: "Heathfield Theatre", stock: variant("uncoated", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
|
|
101
|
+
* ["J-2020", { title: "Card stock", start: some(new Date("2026-10-06T06:00:00Z")), end: some(new Date("2026-10-06T14:00:00Z")), press: some("b3"), state: variant("actual", null), sheets: 30000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-08T00:00:00Z")) }],
|
|
102
|
+
* ["J-2021", { title: "Book sections", start: some(new Date("2026-10-11T06:00:00Z")), end: some(new Date("2026-10-12T12:00:00Z")), press: some("b3"), state: variant("confirmed", null), sheets: 84000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-14T00:00:00Z")) }],
|
|
103
|
+
* ["J-2022", { title: "Report covers", start: some(new Date("2026-10-19T06:00:00Z")), end: some(new Date("2026-10-20T18:00:00Z")), press: some("b3"), state: variant("confirmed", null), sheets: 48000.0, customer: "Harbour Arts Society", stock: variant("board", null), due: some(new Date("2026-10-21T00:00:00Z")) }],
|
|
104
|
+
* ["J-2023", { title: "Spring brochure", start: some(new Date("2026-11-03T06:00:00Z")), end: some(new Date("2026-11-04T18:00:00Z")), press: some("b3"), state: variant("estimated", null), sheets: 60000.0, customer: "Heathfield Theatre", stock: variant("coated", null), due: some(new Date("2026-11-09T00:00:00Z")) }],
|
|
105
|
+
* ]));
|
|
106
|
+
* export const planLinkCaseJobsPatch = e3.mutation.patch(planLinkCaseJobs);
|
|
107
|
+
* export const planLinkBindings = e3.record("plan_link_bindings", DictType(StringType, PrintBinding), new Map([
|
|
108
|
+
* ["B-01", { title: "Fold sections", start: new Date("2026-10-15T06:00:00Z"), end: new Date("2026-10-16T06:00:00Z"), line: "fold", state: variant("confirmed", null) }],
|
|
109
|
+
* ["B-02", { title: "Fold sections", start: new Date("2026-10-17T06:00:00Z"), end: new Date("2026-10-18T06:00:00Z"), line: "fold", state: variant("confirmed", null) }],
|
|
110
|
+
* ["B-03", { title: "Bind books", start: new Date("2026-10-20T18:00:00Z"), end: new Date("2026-10-21T18:00:00Z"), line: "bind", state: variant("confirmed", null) }],
|
|
111
|
+
* ["B-04", { title: "Bind exhibition book", start: new Date("2026-10-25T06:00:00Z"), end: new Date("2026-10-26T06:00:00Z"), line: "bind", state: variant("proposed", variant("recommended", null)) }],
|
|
112
|
+
* ]));
|
|
113
|
+
* export const planLinkBindingsPatch = e3.mutation.patch(planLinkBindings);
|
|
114
|
+
* export const planLinkDeliveries = e3.record("plan_link_deliveries", DictType(StringType, PrintDelivery), new Map([
|
|
115
|
+
* ["D-01", { title: "Books", at: new Date("2026-10-28T10:00:00Z"), bay: "bay" }],
|
|
116
|
+
* ["D-02", { title: "Posters", at: new Date("2026-10-20T10:00:00Z"), bay: "bay" }],
|
|
117
|
+
* ]));
|
|
118
|
+
* export const planLinkDeliveriesPatch = e3.mutation.patch(planLinkDeliveries);
|
|
119
|
+
*
|
|
120
|
+
* const planEventLinks = East.function([], UIComponentType, (_$) => (
|
|
121
|
+
* <Reactive>{$ => {
|
|
122
|
+
* const setters = $.let(Record.bind(planLinkSetters, []));
|
|
123
|
+
* const presses = $.let(Record.bind(planPrintPresses, []));
|
|
124
|
+
* const lines = $.let(Record.bind(planLinkLines, []));
|
|
125
|
+
* const bays = $.let(Record.bind(planLinkBays, []));
|
|
126
|
+
* const plates = $.let(Record.bind(planLinkPlates, [planLinkPlatesPatch]));
|
|
127
|
+
* const jobs = $.let(Record.bind(planLinkCaseJobs, [planLinkCaseJobsPatch]));
|
|
128
|
+
* const bindings = $.let(Record.bind(planLinkBindings, [planLinkBindingsPatch]));
|
|
129
|
+
* const deliveries = $.let(Record.bind(planLinkDeliveries, [planLinkDeliveriesPatch]));
|
|
130
|
+
* const stock = $.let(Data.bind(planLinkStock));
|
|
131
|
+
* // The window's first Monday: each stock reading runs from it, a week apiece.
|
|
132
|
+
* const first = $.const(new Date("2026-10-05T00:00:00Z"), DateTimeType);
|
|
133
|
+
* const StockWeek = StructType({ at: DateTimeType, value: OptionType(FloatType) });
|
|
134
|
+
* const weekly = $.const(East.function([ArrayType(FloatType)], ArrayType(StockWeek), (_$2, readings) =>
|
|
135
|
+
* East.Array.generate(readings.size(), StockWeek, (_$3, i) => ({ at: first.addWeeks(i), value: some(readings.get(i)) }))));
|
|
136
|
+
* const axis = $.let(Plan.axis({
|
|
137
|
+
* window: { min: new Date("2026-10-05T00:00:00Z"), max: new Date("2026-11-02T00:00:00Z") },
|
|
138
|
+
* resolution: "week", now: new Date("2026-10-14T09:00:00Z"),
|
|
139
|
+
* }));
|
|
140
|
+
* return (
|
|
141
|
+
* <Plan
|
|
142
|
+
* axis={axis}
|
|
143
|
+
* resources={{
|
|
144
|
+
* setters: Schedule.resources(setters.read(), { name: "Plate room", icon: "layer-group", label: s => s.name }),
|
|
145
|
+
* presses: Schedule.resources(presses.read(), { name: "Presses", icon: "print", label: p => p.name, group: p => p.hall }),
|
|
146
|
+
* lines: Schedule.resources(lines.read(), { name: "Bindery", icon: "book", label: l => l.name }),
|
|
147
|
+
* bays: Schedule.resources(bays.read(), { name: "Dispatch", icon: "warehouse", label: b => b.name }),
|
|
148
|
+
* }}
|
|
149
|
+
* events={{
|
|
150
|
+
* plate: Schedule.events(plates, {
|
|
151
|
+
* name: "Plates", icon: "clone",
|
|
152
|
+
* title: "title", at: "at",
|
|
153
|
+
* resource: { field: "setter", of: "setters" },
|
|
154
|
+
* }),
|
|
155
|
+
* job: Schedule.events(jobs, {
|
|
156
|
+
* name: "Print job", icon: "file-lines",
|
|
157
|
+
* title: "title", start: "start", end: "end",
|
|
158
|
+
* resource: { field: "press", of: "presses" },
|
|
159
|
+
* state: "state", quantity: { field: "sheets", unit: "sheets" },
|
|
160
|
+
* }),
|
|
161
|
+
* binding: Schedule.events(bindings, {
|
|
162
|
+
* name: "Bindery job", icon: "book-open", draw: "cards",
|
|
163
|
+
* title: "title", start: "start", end: "end",
|
|
164
|
+
* resource: { field: "line", of: "lines" }, state: "state",
|
|
165
|
+
* }),
|
|
166
|
+
* delivery: Schedule.events(deliveries, {
|
|
167
|
+
* name: "Delivery", icon: "truck", draw: "buckets",
|
|
168
|
+
* title: "title", at: "at",
|
|
169
|
+
* resource: { field: "bay", of: "bays" },
|
|
170
|
+
* }),
|
|
171
|
+
* }}
|
|
172
|
+
* // The paper in stock: a table over a dataset, read only.
|
|
173
|
+
* rows={[
|
|
174
|
+
* Plan.over(stock, [
|
|
175
|
+
* Plan.series.table(PrintStock, {
|
|
176
|
+
* key: "stock", title: "Paper stock", label: s => s.name,
|
|
177
|
+
* cells: s => Plan.tableCells(weekly(s.weekly)),
|
|
178
|
+
* format: Format.Number({ maximumFractionDigits: 0n }),
|
|
179
|
+
* }),
|
|
180
|
+
* ]),
|
|
181
|
+
* ]}
|
|
182
|
+
* // Each quantity in thousands of sheets, its third of the family's largest setting the link's
|
|
183
|
+
* // weight; the plates' link carries none.
|
|
184
|
+
* links={[
|
|
185
|
+
* Plan.link({ key: "plates", from: Plan.eventRef("plate", "P-01"), to: Plan.eventRef("job", "J-2001") }),
|
|
186
|
+
* Plan.link({ key: "covers", from: Plan.eventRef("job", "J-2001"), to: Plan.eventRef("job", "J-2013"), quantity: Plan.quantity(12, { unit: "k sheets" }) }),
|
|
187
|
+
* Plan.link({ key: "card", from: Plan.eventRef("job", "J-2020"), to: Plan.eventRef("job", "J-2005"), quantity: Plan.quantity(30, { unit: "k sheets" }) }),
|
|
188
|
+
* Plan.link({ key: "inserts", from: Plan.eventRef("job", "J-2003"), to: Plan.eventRef("job", "J-2016"), quantity: Plan.quantity(96, { unit: "k sheets" }) }),
|
|
189
|
+
* Plan.link({ key: "report-covers", from: Plan.eventRef("job", "J-2022"), to: Plan.eventRef("job", "J-2009"), quantity: Plan.quantity(48, { unit: "k sheets" }) }),
|
|
190
|
+
* Plan.link({ key: "seed-prints", from: Plan.eventRef("job", "J-2014"), to: Plan.eventRef("job", "J-2017"), quantity: Plan.quantity(72, { unit: "k sheets" }) }),
|
|
191
|
+
* Plan.link({ key: "tags", from: Plan.eventRef("job", "J-2006"), to: Plan.eventRef("job", "J-2007"), quantity: Plan.quantity(20, { unit: "k sheets" }) }),
|
|
192
|
+
* Plan.link({ key: "pads", from: Plan.eventRef("job", "J-2010"), to: Plan.eventRef("job", "J-2011"), quantity: Plan.quantity(36, { unit: "k sheets" }) }),
|
|
193
|
+
* Plan.link({ key: "proofs", from: Plan.eventRef("job", "J-2008"), to: Plan.eventRef("job", "J-2015"), quantity: Plan.quantity(16, { unit: "k sheets" }) }),
|
|
194
|
+
* Plan.link({ key: "proof-sheets", from: Plan.eventRef("job", "J-2012"), to: Plan.eventRef("job", "J-2004"), quantity: Plan.quantity(8, { unit: "k sheets" }) }),
|
|
195
|
+
* Plan.link({ key: "tickets", from: Plan.eventRef("job", "J-2019"), to: Plan.eventRef("job", "J-2023"), quantity: Plan.quantity(60, { unit: "k sheets" }) }),
|
|
196
|
+
* Plan.link({ key: "sections", from: Plan.eventRef("job", "J-2021"), to: Plan.eventRef("binding", "B-01"), quantity: Plan.quantity(40, { unit: "k sheets" }) }),
|
|
197
|
+
* Plan.link({ key: "sections-more", from: Plan.eventRef("job", "J-2021"), to: Plan.eventRef("binding", "B-02"), quantity: Plan.quantity(44, { unit: "k sheets" }) }),
|
|
198
|
+
* Plan.link({ key: "folded", from: Plan.eventRef("binding", "B-02"), to: Plan.eventRef("binding", "B-03"), quantity: Plan.quantity(40, { unit: "k sheets" }) }),
|
|
199
|
+
* Plan.link({ key: "books", from: Plan.eventRef("binding", "B-03"), to: Plan.eventRef("delivery", "D-01"), quantity: Plan.quantity(36, { unit: "k sheets" }) }),
|
|
200
|
+
* Plan.link({ key: "posters", from: Plan.eventRef("job", "J-2002"), to: Plan.eventRef("delivery", "D-02"), quantity: Plan.quantity(24, { unit: "k sheets" }) }),
|
|
201
|
+
* Plan.link({ key: "book-blocks", from: Plan.eventRef("job", "J-2018"), to: Plan.eventRef("binding", "B-04"), quantity: Plan.quantity(54, { unit: "k sheets" }) }),
|
|
202
|
+
* ]}
|
|
203
|
+
* style={{ height: "400px" }}
|
|
204
|
+
* />
|
|
205
|
+
* );
|
|
206
|
+
* }}</Reactive>
|
|
207
|
+
* ));
|
|
208
|
+
* ```
|
|
209
|
+
*/
|
|
210
|
+
export function createEventRef(kind, key) {
|
|
211
|
+
const ref = East.value({ row: variant("entry", { series: kind, path: [] }), run: key }, PlanRunRefType);
|
|
212
|
+
EVENT_REFS.set(ref, kind);
|
|
213
|
+
return ref;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* The kind an event ref names, when `Plan.eventRef` made it — what a Plan
|
|
217
|
+
* checks its links' ends against.
|
|
218
|
+
*
|
|
219
|
+
* @param ref - A link end
|
|
220
|
+
* @returns The kind's slot name, or `undefined` for any other value
|
|
221
|
+
* @internal
|
|
222
|
+
*/
|
|
223
|
+
export function eventRefKind(ref) {
|
|
224
|
+
return typeof ref === "object" && ref !== null ? EVENT_REFS.get(ref) : undefined;
|
|
225
|
+
}
|
|
226
|
+
//# sourceMappingURL=refs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refs.js","sourceRoot":"","sources":["../../../src/plan/refs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAA2D,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,2EAA2E;AAC3E,MAAM,UAAU,GAAG,IAAI,OAAO,EAAkB,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2LG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,GAAmC;IAC5E,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,cAAc,CAAC,CAAC;IACxG,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC1B,OAAO,GAAG,CAAC;AACf,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,GAAY;IACrC,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACrF,CAAC"}
|