@elaraai/e3-ui 1.0.86 → 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,773 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@elaraai/e3-ui/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
4
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
5
|
+
*/
|
|
6
|
+
/** @jsxImportSource @elaraai/e3-ui */
|
|
7
|
+
import { ArrayType, DateTimeType, DictType, East, FloatType, FunctionType, NullType, OptionType, StringType, StructType, VariantType, example, none, some, variant, } from "@elaraai/east";
|
|
8
|
+
import { Chart, EventStateType, Format, Reactive, SegmentGroup, Slice, Text, UIComponentType, VStack } from "@elaraai/east-ui";
|
|
9
|
+
import { Data, Plan, Record, Schedule } from "@elaraai/e3-ui";
|
|
10
|
+
import e3 from "@elaraai/e3";
|
|
11
|
+
// A Plan of event kinds (#1191, `Plan Builder Spec.md` §3): the resources are
|
|
12
|
+
// the canvas's rows, read from a record (`Schedule.resources`), and each event
|
|
13
|
+
// kind is a record of its own, bound with its patch mutation
|
|
14
|
+
// (`Schedule.events`) — the very values a Calendar takes. The print works'
|
|
15
|
+
// records are seeded so that every part of the Plan has something in it: six
|
|
16
|
+
// presses in two halls and four crews; thirty print jobs over four weeks from
|
|
17
|
+
// Monday 5 October 2026, eight of them waiting in the backlog; plate changes
|
|
18
|
+
// and services; early and late shifts; each press's utilisation and the sheets
|
|
19
|
+
// printed each day; templates for every kind; and the customers its library
|
|
20
|
+
// lists (#1195). The smallest builder reads the presses and the customers
|
|
21
|
+
// beside a jobs record of its own. A measure is stored as its readings from
|
|
22
|
+
// the window's first day, which the series turn into cells and points, as the
|
|
23
|
+
// Plan's other examples store theirs.
|
|
24
|
+
// ============================================================================
|
|
25
|
+
// The print works' records (§3.1)
|
|
26
|
+
// ============================================================================
|
|
27
|
+
/** A press: its name, its hall and the sheets it prints an hour. */
|
|
28
|
+
export const PrintPress = StructType({ name: StringType, hall: StringType, sheets_per_hour: FloatType });
|
|
29
|
+
/** A crew: its name and its hall. */
|
|
30
|
+
export const PrintCrew = StructType({ name: StringType, hall: StringType });
|
|
31
|
+
/**
|
|
32
|
+
* A print job: when it runs and on which press — none of the three while it
|
|
33
|
+
* waits in the backlog — the lifecycle it wears, its sheets, and the
|
|
34
|
+
* customer's details.
|
|
35
|
+
*/
|
|
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
|
+
/** A stop on a press, at one instant: a plate change or a service. */
|
|
48
|
+
export const PrintStop = StructType({
|
|
49
|
+
title: StringType,
|
|
50
|
+
at: DateTimeType,
|
|
51
|
+
press: StringType,
|
|
52
|
+
kind: VariantType({ plate_change: NullType, service: NullType }),
|
|
53
|
+
});
|
|
54
|
+
/** A crew's shift. */
|
|
55
|
+
export const PrintShift = StructType({ title: StringType, start: DateTimeType, end: DateTimeType, crew: StringType, state: EventStateType });
|
|
56
|
+
/** A customer: its name, the district it is in and its trade. */
|
|
57
|
+
export const PrintCustomer = StructType({ name: StringType, district: StringType, trade: StringType });
|
|
58
|
+
/** The presses: three in each hall. A Plan never writes its resources. */
|
|
59
|
+
export const planPrintPresses = e3.record("plan_print_presses", DictType(StringType, PrintPress), new Map([
|
|
60
|
+
["a1", { name: "Press A1", hall: "Hall A", sheets_per_hour: 12000.0 }],
|
|
61
|
+
["a2", { name: "Press A2", hall: "Hall A", sheets_per_hour: 10000.0 }],
|
|
62
|
+
["a3", { name: "Press A3", hall: "Hall A", sheets_per_hour: 8000.0 }],
|
|
63
|
+
["b1", { name: "Press B1", hall: "Hall B", sheets_per_hour: 15000.0 }],
|
|
64
|
+
["b2", { name: "Press B2", hall: "Hall B", sheets_per_hour: 12000.0 }],
|
|
65
|
+
["b3", { name: "Press B3", hall: "Hall B", sheets_per_hour: 6000.0 }],
|
|
66
|
+
]));
|
|
67
|
+
/** The crews: two in each hall. */
|
|
68
|
+
export const planPrintCrews = e3.record("plan_print_crews", DictType(StringType, PrintCrew), new Map([
|
|
69
|
+
["c1", { name: "Crew 1", hall: "Hall A" }],
|
|
70
|
+
["c2", { name: "Crew 2", hall: "Hall A" }],
|
|
71
|
+
["c3", { name: "Crew 3", hall: "Hall B" }],
|
|
72
|
+
["c4", { name: "Crew 4", hall: "Hall B" }],
|
|
73
|
+
]));
|
|
74
|
+
/**
|
|
75
|
+
* The print jobs: actual before 14 October, in progress on it, confirmed,
|
|
76
|
+
* proposed and estimated after it; two overlapping on Press B2 on the 20th;
|
|
77
|
+
* and eight with no start waiting in the backlog, two due this week, two next
|
|
78
|
+
* week, two later and two with no due date.
|
|
79
|
+
*/
|
|
80
|
+
export const planPrintJobs = e3.record("plan_print_jobs", DictType(StringType, PrintJob), new Map([
|
|
81
|
+
["J-1001", { title: "Spring catalogue", start: some(new Date("2026-10-05T06:00:00Z")), end: some(new Date("2026-10-05T14:00:00Z")), press: some("a1"), state: variant("actual", null), sheets: 96000.0, customer: "Alder & Finch", stock: variant("coated", null), due: some(new Date("2026-10-07T00:00:00Z")) }],
|
|
82
|
+
["J-1002", { title: "Museum guide", start: some(new Date("2026-10-07T06:00:00Z")), end: some(new Date("2026-10-07T12:00:00Z")), press: some("a1"), state: variant("actual", null), sheets: 72000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
|
|
83
|
+
["J-1003", { title: "Event posters", start: some(new Date("2026-10-14T07:00:00Z")), end: some(new Date("2026-10-14T12:00:00Z")), press: some("a1"), state: variant("in-progress", null), sheets: 60000.0, customer: "Granite Hall", stock: variant("uncoated", null), due: some(new Date("2026-10-15T00:00:00Z")) }],
|
|
84
|
+
["J-1004", { title: "Course handbook", start: some(new Date("2026-10-19T06:00:00Z")), end: some(new Date("2026-10-19T18:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 144000.0, customer: "Elmway College", stock: variant("uncoated", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
|
|
85
|
+
["J-1005", { title: "Menu cards", start: some(new Date("2026-10-27T06:00:00Z")), end: some(new Date("2026-10-27T08:00:00Z")), press: some("a1"), state: variant("proposed", variant("recommended", null)), sheets: 24000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
|
|
86
|
+
["J-1006", { title: "Tour brochure", start: some(new Date("2026-10-06T06:00:00Z")), end: some(new Date("2026-10-06T14:00:00Z")), press: some("a2"), state: variant("actual", null), sheets: 80000.0, customer: "Bluewater Tours", stock: variant("coated", null), due: some(new Date("2026-10-08T00:00:00Z")) }],
|
|
87
|
+
["J-1007", { title: "Annual report", start: some(new Date("2026-10-14T06:00:00Z")), end: some(new Date("2026-10-14T12:00:00Z")), press: some("a2"), state: variant("in-progress", null), sheets: 60000.0, customer: "Harbour Arts Society", stock: variant("coated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
|
|
88
|
+
["J-1008", { title: "Seed catalogue", start: some(new Date("2026-10-21T06:00:00Z")), end: some(new Date("2026-10-21T16:00:00Z")), press: some("a2"), state: variant("proposed", variant("added", null)), sheets: 100000.0, customer: "Foxglove Gardens", stock: variant("coated", null), due: some(new Date("2026-10-24T00:00:00Z")) }],
|
|
89
|
+
["J-1009", { title: "Season flyers", start: some(new Date("2026-10-28T06:00:00Z")), end: some(new Date("2026-10-28T09:00:00Z")), press: some("a2"), state: variant("estimated", null), sheets: 30000.0, customer: "Heathfield Theatre", stock: variant("uncoated", null), due: some(new Date("2026-10-31T00:00:00Z")) }],
|
|
90
|
+
["J-1010", { title: "Club newsletter", start: some(new Date("2026-10-08T06:00:00Z")), end: some(new Date("2026-10-08T08:00:00Z")), press: some("a3"), state: variant("actual", null), sheets: 16000.0, customer: "Kestrel Cycling Club", stock: variant("uncoated", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
|
|
91
|
+
["J-1011", { title: "Stationery set", start: some(new Date("2026-10-15T06:00:00Z")), end: some(new Date("2026-10-15T09:00:00Z")), press: some("a3"), state: variant("confirmed", null), sheets: 24000.0, customer: "Ivy Lane Studio", stock: variant("uncoated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
|
|
92
|
+
["J-1012", { title: "Gift boxes", start: some(new Date("2026-10-22T06:00:00Z")), end: some(new Date("2026-10-22T12:00:00Z")), press: some("a3"), state: variant("proposed", variant("recommended", null)), sheets: 48000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-26T00:00:00Z")) }],
|
|
93
|
+
["J-1013", { title: "Holiday catalogue", start: some(new Date("2026-10-05T06:00:00Z")), end: some(new Date("2026-10-05T22:00:00Z")), press: some("b1"), state: variant("actual", null), sheets: 240000.0, customer: "Larkspur Home", stock: variant("coated", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
|
|
94
|
+
["J-1014", { title: "Magazine run", start: some(new Date("2026-10-12T06:00:00Z")), end: some(new Date("2026-10-12T18:00:00Z")), press: some("b1"), state: variant("actual", null), sheets: 180000.0, customer: "Meridian Monthly", stock: variant("coated", null), due: some(new Date("2026-10-13T00:00:00Z")) }],
|
|
95
|
+
["J-1015", { title: "Store flyers", start: some(new Date("2026-10-14T06:00:00Z")), end: some(new Date("2026-10-14T16:00:00Z")), press: some("b1"), state: variant("in-progress", null), sheets: 150000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
|
|
96
|
+
["J-1016", { title: "Exhibition book", start: some(new Date("2026-10-26T06:00:00Z")), end: some(new Date("2026-10-26T12:00:00Z")), press: some("b1"), state: variant("estimated", null), sheets: 90000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
|
|
97
|
+
["J-1017", { title: "Timetables", start: some(new Date("2026-10-09T06:00:00Z")), end: some(new Date("2026-10-09T10:00:00Z")), press: some("b2"), state: variant("actual", null), sheets: 48000.0, customer: "Bluewater Tours", stock: variant("uncoated", null), due: some(new Date("2026-10-12T00:00:00Z")) }],
|
|
98
|
+
["J-1018", { title: "Market posters", start: some(new Date("2026-10-20T06:00:00Z")), end: some(new Date("2026-10-20T12:00:00Z")), press: some("b2"), state: variant("confirmed", null), sheets: 72000.0, customer: "Orchard Street Market", stock: variant("coated", null), due: some(new Date("2026-10-22T00:00:00Z")) }],
|
|
99
|
+
["J-1019", { title: "Loyalty cards", start: some(new Date("2026-10-20T10:00:00Z")), end: some(new Date("2026-10-20T13:00:00Z")), press: some("b2"), state: variant("proposed", variant("added", null)), sheets: 36000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
|
|
100
|
+
["J-1020", { title: "Ticket books", start: some(new Date("2026-10-29T06:00:00Z")), end: some(new Date("2026-10-29T08:00:00Z")), press: some("b2"), state: variant("estimated", null), sheets: 24000.0, customer: "Heathfield Theatre", stock: variant("uncoated", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
|
|
101
|
+
["J-1021", { title: "Handbook covers", start: some(new Date("2026-10-16T06:00:00Z")), end: some(new Date("2026-10-16T08:00:00Z")), press: some("b3"), state: variant("confirmed", null), sheets: 12000.0, customer: "Elmway College", stock: variant("board", null), due: some(new Date("2026-10-19T00:00:00Z")) }],
|
|
102
|
+
["J-1022", { title: "Box sleeves", start: some(new Date("2026-10-20T06:00:00Z")), end: some(new Date("2026-10-20T09:00:00Z")), press: some("b3"), state: variant("proposed", variant("recommended", null)), sheets: 18000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-22T00:00:00Z")) }],
|
|
103
|
+
["J-1023", { title: "Guide reprint", start: none, end: none, press: none, state: variant("estimated", null), sheets: 24000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
|
|
104
|
+
["J-1024", { title: "Order forms", start: none, end: none, press: none, state: variant("proposed", variant("added", null)), sheets: 40000.0, customer: "Larkspur Home", stock: variant("uncoated", null), due: some(new Date("2026-10-17T00:00:00Z")) }],
|
|
105
|
+
["J-1025", { title: "Winter brochure", start: none, end: none, press: none, state: variant("estimated", null), sheets: 64000.0, customer: "Bluewater Tours", stock: variant("coated", null), due: some(new Date("2026-10-21T00:00:00Z")) }],
|
|
106
|
+
["J-1026", { title: "Wall calendars", start: none, end: none, press: none, state: variant("estimated", null), sheets: 50000.0, customer: "Foxglove Gardens", stock: variant("coated", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
|
|
107
|
+
["J-1027", { title: "Prospectus", start: none, end: none, press: none, state: variant("estimated", null), sheets: 100000.0, customer: "Elmway College", stock: variant("coated", null), due: some(new Date("2026-11-06T00:00:00Z")) }],
|
|
108
|
+
["J-1028", { title: "Price lists", start: none, end: none, press: none, state: variant("estimated", null), sheets: 16000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-11-13T00:00:00Z")) }],
|
|
109
|
+
["J-1029", { title: "Spare covers", start: none, end: none, press: none, state: variant("estimated", null), sheets: 8000.0, customer: "Meridian Monthly", stock: variant("board", null), due: none }],
|
|
110
|
+
["J-1030", { title: "Proof sheets", start: none, end: none, press: none, state: variant("estimated", null), sheets: 2000.0, customer: "Alder & Finch", stock: variant("uncoated", null), due: none }],
|
|
111
|
+
]));
|
|
112
|
+
/** The jobs' patch door: every Save commits through it. */
|
|
113
|
+
export const planPrintJobsPatch = e3.mutation.patch(planPrintJobs);
|
|
114
|
+
/** The stops: plate changes and services across the presses. */
|
|
115
|
+
export const planPrintStops = e3.record("plan_print_stops", DictType(StringType, PrintStop), new Map([
|
|
116
|
+
["S-01", { title: "Plate change", at: new Date("2026-10-07T12:00:00Z"), press: "a1", kind: variant("plate_change", null) }],
|
|
117
|
+
["S-02", { title: "Service", at: new Date("2026-10-12T04:00:00Z"), press: "b1", kind: variant("service", null) }],
|
|
118
|
+
["S-03", { title: "Plate change", at: new Date("2026-10-14T12:00:00Z"), press: "a2", kind: variant("plate_change", null) }],
|
|
119
|
+
["S-04", { title: "Plate change", at: new Date("2026-10-19T18:00:00Z"), press: "a1", kind: variant("plate_change", null) }],
|
|
120
|
+
["S-05", { title: "Service", at: new Date("2026-10-26T14:00:00Z"), press: "a3", kind: variant("service", null) }],
|
|
121
|
+
["S-06", { title: "Plate change", at: new Date("2026-10-28T10:00:00Z"), press: "b2", kind: variant("plate_change", null) }],
|
|
122
|
+
]));
|
|
123
|
+
/** The stops' patch door. */
|
|
124
|
+
export const planPrintStopsPatch = e3.mutation.patch(planPrintStops);
|
|
125
|
+
/** The shifts: each crew's early and late shifts, confirmed for the first two weeks and proposed for the last two. */
|
|
126
|
+
export const planPrintShifts = e3.record("plan_print_shifts", DictType(StringType, PrintShift), new Map([
|
|
127
|
+
["SH-01", { title: "Early", start: new Date("2026-10-05T06:00:00Z"), end: new Date("2026-10-05T14:00:00Z"), crew: "c1", state: variant("confirmed", null) }],
|
|
128
|
+
["SH-02", { title: "Early", start: new Date("2026-10-07T06:00:00Z"), end: new Date("2026-10-07T14:00:00Z"), crew: "c1", state: variant("confirmed", null) }],
|
|
129
|
+
["SH-03", { title: "Late", start: new Date("2026-10-13T14:00:00Z"), end: new Date("2026-10-13T22:00:00Z"), crew: "c1", state: variant("confirmed", null) }],
|
|
130
|
+
["SH-04", { title: "Late", start: new Date("2026-10-15T14:00:00Z"), end: new Date("2026-10-15T22:00:00Z"), crew: "c1", state: variant("confirmed", null) }],
|
|
131
|
+
["SH-05", { title: "Early", start: new Date("2026-10-19T06:00:00Z"), end: new Date("2026-10-19T14:00:00Z"), crew: "c1", state: variant("proposed", variant("recommended", null)) }],
|
|
132
|
+
["SH-06", { title: "Early", start: new Date("2026-10-26T06:00:00Z"), end: new Date("2026-10-26T14:00:00Z"), crew: "c1", state: variant("proposed", variant("recommended", null)) }],
|
|
133
|
+
["SH-07", { title: "Late", start: new Date("2026-10-05T14:00:00Z"), end: new Date("2026-10-05T22:00:00Z"), crew: "c2", state: variant("confirmed", null) }],
|
|
134
|
+
["SH-08", { title: "Late", start: new Date("2026-10-07T14:00:00Z"), end: new Date("2026-10-07T22:00:00Z"), crew: "c2", state: variant("confirmed", null) }],
|
|
135
|
+
["SH-09", { title: "Early", start: new Date("2026-10-13T06:00:00Z"), end: new Date("2026-10-13T14:00:00Z"), crew: "c2", state: variant("confirmed", null) }],
|
|
136
|
+
["SH-10", { title: "Early", start: new Date("2026-10-15T06:00:00Z"), end: new Date("2026-10-15T14:00:00Z"), crew: "c2", state: variant("confirmed", null) }],
|
|
137
|
+
["SH-11", { title: "Late", start: new Date("2026-10-19T14:00:00Z"), end: new Date("2026-10-19T22:00:00Z"), crew: "c2", state: variant("proposed", variant("recommended", null)) }],
|
|
138
|
+
["SH-12", { title: "Late", start: new Date("2026-10-26T14:00:00Z"), end: new Date("2026-10-26T22:00:00Z"), crew: "c2", state: variant("proposed", variant("recommended", null)) }],
|
|
139
|
+
["SH-13", { title: "Early", start: new Date("2026-10-06T06:00:00Z"), end: new Date("2026-10-06T14:00:00Z"), crew: "c3", state: variant("confirmed", null) }],
|
|
140
|
+
["SH-14", { title: "Early", start: new Date("2026-10-08T06:00:00Z"), end: new Date("2026-10-08T14:00:00Z"), crew: "c3", state: variant("confirmed", null) }],
|
|
141
|
+
["SH-15", { title: "Late", start: new Date("2026-10-12T14:00:00Z"), end: new Date("2026-10-12T22:00:00Z"), crew: "c3", state: variant("confirmed", null) }],
|
|
142
|
+
["SH-16", { title: "Late", start: new Date("2026-10-14T14:00:00Z"), end: new Date("2026-10-14T22:00:00Z"), crew: "c3", state: variant("confirmed", null) }],
|
|
143
|
+
["SH-17", { title: "Early", start: new Date("2026-10-20T06:00:00Z"), end: new Date("2026-10-20T14:00:00Z"), crew: "c3", state: variant("proposed", variant("recommended", null)) }],
|
|
144
|
+
["SH-18", { title: "Early", start: new Date("2026-10-27T06:00:00Z"), end: new Date("2026-10-27T14:00:00Z"), crew: "c3", state: variant("proposed", variant("added", null)) }],
|
|
145
|
+
["SH-19", { title: "Late", start: new Date("2026-10-06T14:00:00Z"), end: new Date("2026-10-06T22:00:00Z"), crew: "c4", state: variant("confirmed", null) }],
|
|
146
|
+
["SH-20", { title: "Late", start: new Date("2026-10-08T14:00:00Z"), end: new Date("2026-10-08T22:00:00Z"), crew: "c4", state: variant("confirmed", null) }],
|
|
147
|
+
["SH-21", { title: "Early", start: new Date("2026-10-12T06:00:00Z"), end: new Date("2026-10-12T14:00:00Z"), crew: "c4", state: variant("confirmed", null) }],
|
|
148
|
+
["SH-22", { title: "Early", start: new Date("2026-10-14T06:00:00Z"), end: new Date("2026-10-14T14:00:00Z"), crew: "c4", state: variant("confirmed", null) }],
|
|
149
|
+
["SH-23", { title: "Late", start: new Date("2026-10-20T14:00:00Z"), end: new Date("2026-10-20T22:00:00Z"), crew: "c4", state: variant("proposed", variant("recommended", null)) }],
|
|
150
|
+
["SH-24", { title: "Late", start: new Date("2026-10-27T14:00:00Z"), end: new Date("2026-10-27T22:00:00Z"), crew: "c4", state: variant("proposed", variant("added", null)) }],
|
|
151
|
+
]));
|
|
152
|
+
/** The shifts' patch door. */
|
|
153
|
+
export const planPrintShiftsPatch = e3.mutation.patch(planPrintShifts);
|
|
154
|
+
/** The customers the jobs are printed for, by account, in three districts: what the print works' library lists. A Plan never writes them. */
|
|
155
|
+
export const planPrintCustomers = e3.record("plan_print_customers", DictType(StringType, PrintCustomer), new Map([
|
|
156
|
+
["alder-finch", { name: "Alder & Finch", district: "Old Town", trade: "Retail" }],
|
|
157
|
+
["bluewater-tours", { name: "Bluewater Tours", district: "North Quay", trade: "Travel" }],
|
|
158
|
+
["copperleaf-cafe", { name: "Copperleaf Cafe", district: "Old Town", trade: "Hospitality" }],
|
|
159
|
+
["driftwood-museum", { name: "Driftwood Museum", district: "North Quay", trade: "Arts" }],
|
|
160
|
+
["elmway-college", { name: "Elmway College", district: "Riverside", trade: "Education" }],
|
|
161
|
+
["foxglove-gardens", { name: "Foxglove Gardens", district: "Riverside", trade: "Retail" }],
|
|
162
|
+
["granite-hall", { name: "Granite Hall", district: "Old Town", trade: "Events" }],
|
|
163
|
+
["harbour-arts", { name: "Harbour Arts Society", district: "North Quay", trade: "Arts" }],
|
|
164
|
+
["heathfield", { name: "Heathfield Theatre", district: "Old Town", trade: "Arts" }],
|
|
165
|
+
["ivy-lane", { name: "Ivy Lane Studio", district: "Riverside", trade: "Design" }],
|
|
166
|
+
["juniper-toys", { name: "Juniper Toys", district: "Riverside", trade: "Retail" }],
|
|
167
|
+
["kestrel-cycling", { name: "Kestrel Cycling Club", district: "Riverside", trade: "Sport" }],
|
|
168
|
+
["larkspur-home", { name: "Larkspur Home", district: "Old Town", trade: "Retail" }],
|
|
169
|
+
["meridian-monthly", { name: "Meridian Monthly", district: "North Quay", trade: "Publishing" }],
|
|
170
|
+
["northwind", { name: "Northwind Outfitters", district: "North Quay", trade: "Retail" }],
|
|
171
|
+
["orchard-market", { name: "Orchard Street Market", district: "Old Town", trade: "Markets" }],
|
|
172
|
+
]));
|
|
173
|
+
/**
|
|
174
|
+
* Each press's utilisation (%): a reading a day from 5 October, as the
|
|
175
|
+
* dataflow measures it, idle at the weekends. Press B2's 97 on the 20th is
|
|
176
|
+
* the day its two jobs overlap.
|
|
177
|
+
*/
|
|
178
|
+
export const planPrintUtilisation = e3.input("plan_print_utilisation", DictType(StringType, ArrayType(FloatType)), variant("value", new Map([
|
|
179
|
+
["a1", [50.0, 12.0, 38.0, 20.0, 15.0, 0.0, 0.0, 22.0, 18.0, 31.0, 25.0, 20.0, 0.0, 0.0, 75.0, 40.0, 30.0, 28.0, 20.0, 0.0, 0.0, 18.0, 13.0, 10.0, 8.0, 6.0, 0.0, 0.0]],
|
|
180
|
+
["a2", [20.0, 50.0, 25.0, 18.0, 15.0, 0.0, 0.0, 24.0, 20.0, 38.0, 30.0, 22.0, 0.0, 0.0, 26.0, 30.0, 63.0, 35.0, 22.0, 0.0, 0.0, 20.0, 18.0, 19.0, 12.0, 10.0, 0.0, 0.0]],
|
|
181
|
+
["a3", [10.0, 12.0, 14.0, 13.0, 18.0, 0.0, 0.0, 15.0, 16.0, 20.0, 19.0, 22.0, 0.0, 0.0, 24.0, 28.0, 30.0, 38.0, 25.0, 0.0, 0.0, 14.0, 20.0, 12.0, 10.0, 8.0, 0.0, 0.0]],
|
|
182
|
+
["b1", [100.0, 45.0, 30.0, 28.0, 26.0, 0.0, 0.0, 75.0, 40.0, 63.0, 48.0, 36.0, 0.0, 0.0, 30.0, 34.0, 28.0, 26.0, 24.0, 0.0, 0.0, 38.0, 22.0, 18.0, 14.0, 12.0, 0.0, 0.0]],
|
|
183
|
+
["b2", [18.0, 20.0, 22.0, 24.0, 25.0, 0.0, 0.0, 26.0, 28.0, 30.0, 32.0, 30.0, 0.0, 0.0, 34.0, 97.0, 40.0, 36.0, 30.0, 0.0, 0.0, 26.0, 24.0, 22.0, 13.0, 10.0, 0.0, 0.0]],
|
|
184
|
+
["b3", [8.0, 10.0, 12.0, 10.0, 9.0, 0.0, 0.0, 12.0, 14.0, 16.0, 18.0, 13.0, 0.0, 0.0, 20.0, 19.0, 16.0, 14.0, 12.0, 0.0, 0.0, 10.0, 9.0, 8.0, 7.0, 6.0, 0.0, 0.0]],
|
|
185
|
+
])));
|
|
186
|
+
/** The sheets printed each day from 5 October, across every press. */
|
|
187
|
+
export const planPrintOutput = e3.input("plan_print_output", ArrayType(FloatType), variant("value", [
|
|
188
|
+
336000.0, 80000.0, 72000.0, 16000.0, 48000.0, 0.0, 0.0,
|
|
189
|
+
180000.0, 0.0, 270000.0, 24000.0, 12000.0, 0.0, 0.0,
|
|
190
|
+
144000.0, 126000.0, 100000.0, 48000.0, 0.0, 0.0, 0.0,
|
|
191
|
+
90000.0, 24000.0, 30000.0, 24000.0, 0.0, 0.0, 0.0,
|
|
192
|
+
]));
|
|
193
|
+
// ============================================================================
|
|
194
|
+
// planEvents — the smallest builder (§3.2)
|
|
195
|
+
// ============================================================================
|
|
196
|
+
/**
|
|
197
|
+
* The smallest builder's jobs, a record of its own: eight on the presses, two
|
|
198
|
+
* of them overlapping on Press B2 on the 20th; one timed and given no press
|
|
199
|
+
* yet; and three with no start waiting in the backlog, due this week, next
|
|
200
|
+
* week and never.
|
|
201
|
+
*/
|
|
202
|
+
export const planEventJobs = e3.record("plan_event_jobs", DictType(StringType, PrintJob), new Map([
|
|
203
|
+
["J-3001", { title: "Spring catalogue", start: some(new Date("2026-10-06T06:00:00Z")), end: some(new Date("2026-10-06T14:00:00Z")), press: some("a1"), state: variant("actual", null), sheets: 96000.0, customer: "Alder & Finch", stock: variant("coated", null), due: some(new Date("2026-10-08T00:00:00Z")) }],
|
|
204
|
+
["J-3002", { title: "Course handbook", start: some(new Date("2026-10-19T06:00:00Z")), end: some(new Date("2026-10-19T18:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 144000.0, customer: "Elmway College", stock: variant("uncoated", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
|
|
205
|
+
["J-3003", { title: "Annual report", start: some(new Date("2026-10-14T06:00:00Z")), end: some(new Date("2026-10-14T12:00:00Z")), press: some("a2"), state: variant("in-progress", null), sheets: 60000.0, customer: "Harbour Arts Society", stock: variant("coated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
|
|
206
|
+
["J-3004", { title: "Club newsletter", start: some(new Date("2026-10-08T06:00:00Z")), end: some(new Date("2026-10-08T08:00:00Z")), press: some("a3"), state: variant("actual", null), sheets: 16000.0, customer: "Kestrel Cycling Club", stock: variant("uncoated", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
|
|
207
|
+
["J-3005", { title: "Store flyers", start: some(new Date("2026-10-15T06:00:00Z")), end: some(new Date("2026-10-15T16:00:00Z")), press: some("b1"), state: variant("confirmed", null), sheets: 150000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
|
|
208
|
+
["J-3006", { title: "Market posters", start: some(new Date("2026-10-20T06:00:00Z")), end: some(new Date("2026-10-20T12:00:00Z")), press: some("b2"), state: variant("confirmed", null), sheets: 72000.0, customer: "Orchard Street Market", stock: variant("coated", null), due: some(new Date("2026-10-22T00:00:00Z")) }],
|
|
209
|
+
["J-3007", { title: "Loyalty cards", start: some(new Date("2026-10-20T10:00:00Z")), end: some(new Date("2026-10-20T13:00:00Z")), press: some("b2"), state: variant("proposed", variant("added", null)), sheets: 36000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
|
|
210
|
+
["J-3008", { title: "Gift boxes", start: some(new Date("2026-10-27T06:00:00Z")), end: some(new Date("2026-10-27T12:00:00Z")), press: some("b3"), 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")) }],
|
|
211
|
+
["J-3009", { title: "Ticket books", start: some(new Date("2026-10-22T06:00:00Z")), end: some(new Date("2026-10-22T09:00:00Z")), press: none, state: variant("proposed", variant("added", null)), sheets: 24000.0, customer: "Heathfield Theatre", stock: variant("uncoated", null), due: some(new Date("2026-10-26T00:00:00Z")) }],
|
|
212
|
+
["J-3010", { title: "Guide reprint", start: none, end: none, press: none, state: variant("estimated", null), sheets: 24000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
|
|
213
|
+
["J-3011", { title: "Wall calendars", start: none, end: none, press: none, state: variant("estimated", null), sheets: 50000.0, customer: "Foxglove Gardens", stock: variant("coated", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
|
|
214
|
+
["J-3012", { title: "Spare covers", start: none, end: none, press: none, state: variant("estimated", null), sheets: 8000.0, customer: "Meridian Monthly", stock: variant("board", null), due: none }],
|
|
215
|
+
]));
|
|
216
|
+
/** The smallest builder's jobs' patch door: its Save commits through it. */
|
|
217
|
+
export const planEventJobsPatch = e3.mutation.patch(planEventJobs);
|
|
218
|
+
/**
|
|
219
|
+
* The smallest builder (`Plan Builder Spec.md` §3.2): a row per press, each
|
|
220
|
+
* job a bar on its press, the jobs a record of the example's own. Jobs move
|
|
221
|
+
* and resize along a press and between presses, and Save commits the drafts
|
|
222
|
+
* as one patch through the jobs' patch door. Its library lists the backlog,
|
|
223
|
+
* the jobs with no start by when each is due, and the customers, a card
|
|
224
|
+
* apiece that sets the customer of the job it is dropped on
|
|
225
|
+
* (`Schedule.patch`). Its inspector shows what is selected: a job through the
|
|
226
|
+
* form its customer and stock are hinted for. Press B2's two jobs on the 20th
|
|
227
|
+
* overlap, and the toolbar's chip counts them; a job timed on no press draws
|
|
228
|
+
* on the jobs' Unassigned row. Its `id` keeps its panes and its library's
|
|
229
|
+
* cards apart from the print works' on the same surface. The two `Schedule`
|
|
230
|
+
* values are exactly what a Calendar takes.
|
|
231
|
+
*/
|
|
232
|
+
export const planEvents = example({
|
|
233
|
+
keywords: [
|
|
234
|
+
"Plan", "Schedule", "Schedule.resources", "Schedule.events", "Schedule.field", "event kinds", "events", "resources",
|
|
235
|
+
"rows", "jobs", "presses", "bars", "state", "backlog", "duration", "due", "fields", "library", "Plan.library",
|
|
236
|
+
"Plan.library.backlog", "Plan.library.tab", "customers", "drop", "Schedule.patch", "inspector", "overlaps",
|
|
237
|
+
"Unassigned", "id", "record", "Record.bind", "e3.record", "e3.mutation.patch", "patch", "smallest", "builder",
|
|
238
|
+
"#1191", "#1195", "#1197", "#1198",
|
|
239
|
+
],
|
|
240
|
+
description: "The smallest builder — the presses as its rows (`Schedule.resources`) and the print jobs as bars on them (`Schedule.events`), a record of its own bound with its patch mutation; its library the backlog and the customers, each card setting the customer of the job it is dropped on (`Schedule.patch`); its inspector a job's customer and stock; an overlap on Press B2, and a job on no press on the Unassigned row",
|
|
241
|
+
fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
|
|
242
|
+
const presses = $.let(Record.bind(planPrintPresses, []));
|
|
243
|
+
const jobs = $.let(Record.bind(planEventJobs, [planEventJobsPatch]));
|
|
244
|
+
const customers = $.let(Record.bind(planPrintCustomers, []));
|
|
245
|
+
const axis = $.let(Plan.axis({
|
|
246
|
+
window: { min: new Date("2026-10-05T00:00:00Z"), max: new Date("2026-11-02T00:00:00Z") },
|
|
247
|
+
resolution: "day", now: new Date("2026-10-14T09:00:00Z"),
|
|
248
|
+
}));
|
|
249
|
+
return (_jsx(Plan, { id: "jobs", axis: axis, resources: {
|
|
250
|
+
presses: Schedule.resources(presses.read(), { name: "Presses", icon: "print", label: p => p.name }),
|
|
251
|
+
}, events: {
|
|
252
|
+
job: Schedule.events(jobs, {
|
|
253
|
+
name: "Print job", icon: "file-lines",
|
|
254
|
+
title: "title", start: "start", end: "end",
|
|
255
|
+
resource: { field: "press", of: "presses" },
|
|
256
|
+
state: "state",
|
|
257
|
+
// A job with no start waits in the backlog: placed, it runs as long as its sheets take at
|
|
258
|
+
// 8,000 an hour.
|
|
259
|
+
backlog: { duration: j => variant("hours", j.sheets.divide(8000.0)), due: j => j.due },
|
|
260
|
+
fields: {
|
|
261
|
+
customer: Schedule.field.text({ label: "Customer" }),
|
|
262
|
+
stock: Schedule.field.select({ labels: { coated: "Coated", uncoated: "Uncoated", board: "Board" } }),
|
|
263
|
+
},
|
|
264
|
+
}),
|
|
265
|
+
}, library: [
|
|
266
|
+
Plan.library.backlog(),
|
|
267
|
+
// The customers, by district: a card dropped on a job sets its customer.
|
|
268
|
+
Plan.library.tab(customers.read(), {
|
|
269
|
+
name: "Customers", icon: "building",
|
|
270
|
+
label: c => c.name, meta: c => some(c.trade), group: c => c.district,
|
|
271
|
+
drop: c => Schedule.patch(PrintJob, { customer: c.name }),
|
|
272
|
+
}),
|
|
273
|
+
], inspector: true }));
|
|
274
|
+
} }))),
|
|
275
|
+
inputs: [],
|
|
276
|
+
});
|
|
277
|
+
// ============================================================================
|
|
278
|
+
// planEventLinks — every way a link draws, and rows over a dataset
|
|
279
|
+
// ============================================================================
|
|
280
|
+
/** A paper stock: its name, and its level in thousands of sheets, a reading a week from 5 October. */
|
|
281
|
+
export const PrintStock = StructType({ name: StringType, weekly: ArrayType(FloatType) });
|
|
282
|
+
/** Four jobs on the print works' presses — the covers and the sleeves on Press B3, and the handbooks and the boxes they go into on Press A1 — which the Plan's specs read as a second kind of job. */
|
|
283
|
+
export const planLinkJobs = e3.record("plan_link_jobs", DictType(StringType, PrintJob), new Map([
|
|
284
|
+
["J-2001", { title: "Handbook covers", start: some(new Date("2026-10-06T06:00:00Z")), end: some(new Date("2026-10-06T08:00:00Z")), press: some("b3"), state: variant("confirmed", null), sheets: 12000.0, customer: "Elmway College", stock: variant("board", null), due: some(new Date("2026-10-07T00:00:00Z")) }],
|
|
285
|
+
["J-2002", { title: "Course handbook", start: some(new Date("2026-10-13T06:00:00Z")), end: some(new Date("2026-10-13T18:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 144000.0, customer: "Elmway College", stock: variant("uncoated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
|
|
286
|
+
["J-2003", { title: "Box sleeves", start: some(new Date("2026-10-20T06:00:00Z")), end: some(new Date("2026-10-20T09:00:00Z")), press: some("b3"), state: variant("proposed", variant("recommended", null)), sheets: 18000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-21T00:00:00Z")) }],
|
|
287
|
+
["J-2004", { title: "Gift boxes", start: some(new Date("2026-10-27T06:00:00Z")), end: some(new Date("2026-10-27T12:00:00Z")), press: some("a1"), 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")) }],
|
|
288
|
+
]));
|
|
289
|
+
/** The linked jobs' patch door. */
|
|
290
|
+
export const planLinkJobsPatch = e3.mutation.patch(planLinkJobs);
|
|
291
|
+
/** The paper in stock. */
|
|
292
|
+
export const planLinkStock = e3.input("plan_link_stock", DictType(StringType, PrintStock), variant("value", new Map([
|
|
293
|
+
["board", { name: "Board", weekly: [40.0, 22.0, 31.0, 18.0] }],
|
|
294
|
+
["coated", { name: "Coated", weekly: [520.0, 410.0, 460.0, 380.0] }],
|
|
295
|
+
["uncoated", { name: "Uncoated", weekly: [300.0, 260.0, 280.0, 240.0] }],
|
|
296
|
+
])));
|
|
297
|
+
/** A work centre a job passes through on its way out: the platesetter, the bindery's folder and binder, the dispatch bay. */
|
|
298
|
+
export const PrintCentre = StructType({ name: StringType });
|
|
299
|
+
/** A set of plates the platesetter makes for a job, at the moment it makes them. */
|
|
300
|
+
export const PrintPlates = StructType({ title: StringType, at: DateTimeType, setter: StringType });
|
|
301
|
+
/** A bindery job — folding a press job's sections, or binding them — on the folder or the binder. */
|
|
302
|
+
export const PrintBinding = StructType({ title: StringType, start: DateTimeType, end: DateTimeType, line: StringType, state: EventStateType });
|
|
303
|
+
/** A delivery leaving the dispatch bay. */
|
|
304
|
+
export const PrintDelivery = StructType({ title: StringType, at: DateTimeType, bay: StringType });
|
|
305
|
+
/** The platesetter. A Plan never writes its resources. */
|
|
306
|
+
export const planLinkSetters = e3.record("plan_link_setters", DictType(StringType, PrintCentre), new Map([
|
|
307
|
+
["ps", { name: "Platesetter" }],
|
|
308
|
+
]));
|
|
309
|
+
/** The bindery's two lines. */
|
|
310
|
+
export const planLinkLines = e3.record("plan_link_lines", DictType(StringType, PrintCentre), new Map([
|
|
311
|
+
["fold", { name: "Folder" }],
|
|
312
|
+
["bind", { name: "Binder" }],
|
|
313
|
+
]));
|
|
314
|
+
/** The dispatch bay. */
|
|
315
|
+
export const planLinkBays = e3.record("plan_link_bays", DictType(StringType, PrintCentre), new Map([
|
|
316
|
+
["bay", { name: "Dispatch bay" }],
|
|
317
|
+
]));
|
|
318
|
+
/** The plates for the catalogue covers, made on the window's first day. */
|
|
319
|
+
export const planLinkPlates = e3.record("plan_link_plates", DictType(StringType, PrintPlates), new Map([
|
|
320
|
+
["P-01", { title: "Catalogue plates", at: new Date("2026-10-05T12:00:00Z"), setter: "ps" }],
|
|
321
|
+
]));
|
|
322
|
+
/** The plates' patch door. */
|
|
323
|
+
export const planLinkPlatesPatch = e3.mutation.patch(planLinkPlates);
|
|
324
|
+
/**
|
|
325
|
+
* The jobs the links join, on the six presses. Each link's jobs sit where its
|
|
326
|
+
* figure needs them: a job of two hours, which draws the narrowest bar; a job
|
|
327
|
+
* running in from before the window; one that ends before it starts, and one
|
|
328
|
+
* that starts after it ends; two jobs back to back on one press.
|
|
329
|
+
*/
|
|
330
|
+
export const planLinkCaseJobs = e3.record("plan_link_case_jobs", DictType(StringType, PrintJob), new Map([
|
|
331
|
+
["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")) }],
|
|
332
|
+
["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")) }],
|
|
333
|
+
["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")) }],
|
|
334
|
+
["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")) }],
|
|
335
|
+
["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")) }],
|
|
336
|
+
["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")) }],
|
|
337
|
+
["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")) }],
|
|
338
|
+
["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")) }],
|
|
339
|
+
["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")) }],
|
|
340
|
+
["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")) }],
|
|
341
|
+
["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")) }],
|
|
342
|
+
["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")) }],
|
|
343
|
+
["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")) }],
|
|
344
|
+
["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")) }],
|
|
345
|
+
["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")) }],
|
|
346
|
+
["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")) }],
|
|
347
|
+
["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")) }],
|
|
348
|
+
["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")) }],
|
|
349
|
+
["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")) }],
|
|
350
|
+
["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")) }],
|
|
351
|
+
["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")) }],
|
|
352
|
+
["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")) }],
|
|
353
|
+
["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")) }],
|
|
354
|
+
]));
|
|
355
|
+
/** The jobs' patch door. */
|
|
356
|
+
export const planLinkCaseJobsPatch = e3.mutation.patch(planLinkCaseJobs);
|
|
357
|
+
/** The bindery's jobs: two foldings of the book's sections, and two bindings. */
|
|
358
|
+
export const planLinkBindings = e3.record("plan_link_bindings", DictType(StringType, PrintBinding), new Map([
|
|
359
|
+
["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) }],
|
|
360
|
+
["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) }],
|
|
361
|
+
["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) }],
|
|
362
|
+
["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)) }],
|
|
363
|
+
]));
|
|
364
|
+
/** The bindery's patch door. */
|
|
365
|
+
export const planLinkBindingsPatch = e3.mutation.patch(planLinkBindings);
|
|
366
|
+
/** The deliveries: the shop posters in the third week, the bound books in the fourth. */
|
|
367
|
+
export const planLinkDeliveries = e3.record("plan_link_deliveries", DictType(StringType, PrintDelivery), new Map([
|
|
368
|
+
["D-01", { title: "Books", at: new Date("2026-10-28T10:00:00Z"), bay: "bay" }],
|
|
369
|
+
["D-02", { title: "Posters", at: new Date("2026-10-20T10:00:00Z"), bay: "bay" }],
|
|
370
|
+
]));
|
|
371
|
+
/** The deliveries' patch door. */
|
|
372
|
+
export const planLinkDeliveriesPatch = e3.mutation.patch(planLinkDeliveries);
|
|
373
|
+
// ============================================================================
|
|
374
|
+
// The print works' finishing and dispatch records (#1200)
|
|
375
|
+
// ============================================================================
|
|
376
|
+
/** The parent of the shared folder and binder, held in a record like every other resource. */
|
|
377
|
+
export const planPrintBindery = e3.record("plan_print_bindery", DictType(StringType, PrintCentre), new Map([
|
|
378
|
+
["bindery", { name: "Bindery" }],
|
|
379
|
+
]));
|
|
380
|
+
/** The vans a delivery can move onto from the dispatch bay. */
|
|
381
|
+
export const planPrintVans = e3.record("plan_print_vans", DictType(StringType, PrintCentre), new Map([
|
|
382
|
+
["van1", { name: "Van 1" }], ["van2", { name: "Van 2" }],
|
|
383
|
+
]));
|
|
384
|
+
/** A delivery's own status, separate from the schedule's lifecycle. */
|
|
385
|
+
export const PrintDispatchStatus = VariantType({ queued: NullType, ready: NullType, dispatched: NullType });
|
|
386
|
+
/** A delivery on a bay or a van: the variant preserves the resource kind when it moves. */
|
|
387
|
+
export const PrintDispatch = StructType({
|
|
388
|
+
title: StringType, at: DateTimeType,
|
|
389
|
+
location: VariantType({ bay: StringType, van: StringType }),
|
|
390
|
+
lane: StringType, status: PrintDispatchStatus, pallets: FloatType,
|
|
391
|
+
});
|
|
392
|
+
/** The print works' own plate orders, timed before its existing jobs. */
|
|
393
|
+
export const planPrintPlates = e3.record("plan_print_plates", DictType(StringType, PrintPlates), new Map([
|
|
394
|
+
["P-101", { title: "Handbook plates", at: new Date("2026-10-16T14:00:00Z"), setter: "ps" }],
|
|
395
|
+
["P-102", { title: "Poster plates", at: new Date("2026-10-13T14:00:00Z"), setter: "ps" }],
|
|
396
|
+
]));
|
|
397
|
+
/** The print works' plates commit through their own patch door. */
|
|
398
|
+
export const planPrintPlatesPatch = e3.mutation.patch(planPrintPlates);
|
|
399
|
+
/** Two foldings run in parallel, followed by binding, after the handbook leaves Press A1. */
|
|
400
|
+
export const planPrintBindings = e3.record("plan_print_bindings", DictType(StringType, PrintBinding), new Map([
|
|
401
|
+
["B-101", { title: "Fold handbook sections", start: new Date("2026-10-20T06:00:00Z"), end: new Date("2026-10-20T14:00:00Z"), line: "fold", state: variant("confirmed", null) }],
|
|
402
|
+
["B-102", { title: "Fold handbook inserts", start: new Date("2026-10-20T10:00:00Z"), end: new Date("2026-10-20T16:00:00Z"), line: "fold", state: variant("confirmed", null) }],
|
|
403
|
+
["B-103", { title: "Bind handbooks", start: new Date("2026-10-21T06:00:00Z"), end: new Date("2026-10-21T14:00:00Z"), line: "bind", state: variant("confirmed", null) }],
|
|
404
|
+
]));
|
|
405
|
+
/** The print works' bindery jobs commit through their own patch door. */
|
|
406
|
+
export const planPrintBindingsPatch = e3.mutation.patch(planPrintBindings);
|
|
407
|
+
/** Deliveries occupy AM/PM lanes and carry each of the dispatch statuses. */
|
|
408
|
+
export const planPrintDeliveries = e3.record("plan_print_deliveries", DictType(StringType, PrintDispatch), new Map([
|
|
409
|
+
["D-101", { title: "Handbooks", at: new Date("2026-10-22T10:00:00Z"), location: variant("bay", "bay"), lane: "AM", status: variant("queued", null), pallets: 3.0 }],
|
|
410
|
+
["D-102", { title: "Event posters", at: new Date("2026-10-15T14:00:00Z"), location: variant("van", "van1"), lane: "PM", status: variant("ready", null), pallets: 2.0 }],
|
|
411
|
+
["D-103", { title: "Museum guides", at: new Date("2026-10-09T10:00:00Z"), location: variant("van", "van2"), lane: "AM", status: variant("dispatched", null), pallets: 1.0 }],
|
|
412
|
+
]));
|
|
413
|
+
/** The print works' deliveries commit through their own patch door. */
|
|
414
|
+
export const planPrintDeliveriesPatch = e3.mutation.patch(planPrintDeliveries);
|
|
415
|
+
// ============================================================================
|
|
416
|
+
// planPrintWorks — the print works (§3.3)
|
|
417
|
+
// ============================================================================
|
|
418
|
+
/**
|
|
419
|
+
* The print works (`Plan Builder Spec.md` §3.3): two resource kinds grouped
|
|
420
|
+
* by hall, nested finishing resources and deliveries on bays or vans. Jobs
|
|
421
|
+
* draw as bars, stops and plates as marks
|
|
422
|
+
* at their instants, shifts as chips — a utilisation heat row under each
|
|
423
|
+
* press, and a pinned chart of the sheets printed each day. Each
|
|
424
|
+
* kind declares its templates. Its library (#1195) lists every kind's
|
|
425
|
+
* templates, the backlog, the series a viewer shows and hides, and the
|
|
426
|
+
* customers, a card apiece that sets the customer of the job it is dropped
|
|
427
|
+
* on. Its inspector (#1197) shows what is selected: a job through the form
|
|
428
|
+
* its customer, stock and sheets are hinted for, and a stop through the
|
|
429
|
+
* stop kind's own inspector, which chooses a plate change or a service on a
|
|
430
|
+
* segment. The same Slice owns the range and resolution; links connect the
|
|
431
|
+
* plates, printing, binding and dispatch. Delivery readiness holds Save for
|
|
432
|
+
* an invalid pallet count, while the drop veto explains a press in service.
|
|
433
|
+
*/
|
|
434
|
+
export const planPrintWorks = example({
|
|
435
|
+
keywords: [
|
|
436
|
+
"Plan", "Schedule", "Schedule.resources", "Schedule.events", "Schedule.field", "event kinds", "print works",
|
|
437
|
+
"presses", "crews", "jobs", "stops", "shifts", "draw", "span", "marks", "cards", "at", "instant", "group",
|
|
438
|
+
"hall", "sub", "measures", "utilisation", "heat", "state", "quantity", "backlog",
|
|
439
|
+
"duration", "due", "fields", "templates", "rows", "pinned", "chart", "output", "grain", "library",
|
|
440
|
+
"Plan.library", "customers", "Schedule.patch", "inspector", "selection", "kind's own inspector", "update",
|
|
441
|
+
"Record.bind", "Data.bind", "e3.record", "e3.input", "#1191", "#1195", "#1197", "#1200", "parent", "rollup", "collapsed", "meta", "value",
|
|
442
|
+
"buckets", "lane", "status", "ready", "overlaps", "allow", "canDrop", "Schedule.Types.Candidate",
|
|
443
|
+
"variant resource", "bay", "van", "Slice", "range", "brush", "resolution", "Plan.eventRef", "Plan.over",
|
|
444
|
+
],
|
|
445
|
+
description: "The print works from plates to dispatch — jobs, stops and shifts on grouped presses and crews, nested bindery resources, deliveries in AM/PM lanes on a bay or a van, status and readiness, links between event kinds, utilisation and paper stock, a Slice-owned range and resolution, and the shared library, inspector and Save session",
|
|
446
|
+
fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
|
|
447
|
+
const presses = $.let(Record.bind(planPrintPresses, []));
|
|
448
|
+
const crews = $.let(Record.bind(planPrintCrews, []));
|
|
449
|
+
const jobs = $.let(Record.bind(planPrintJobs, [planPrintJobsPatch]));
|
|
450
|
+
const stops = $.let(Record.bind(planPrintStops, [planPrintStopsPatch]));
|
|
451
|
+
const shifts = $.let(Record.bind(planPrintShifts, [planPrintShiftsPatch]));
|
|
452
|
+
const customers = $.let(Record.bind(planPrintCustomers, []));
|
|
453
|
+
const setters = $.let(Record.bind(planLinkSetters, []));
|
|
454
|
+
const lines = $.let(Record.bind(planLinkLines, []));
|
|
455
|
+
const bindery = $.let(Record.bind(planPrintBindery, []));
|
|
456
|
+
const bays = $.let(Record.bind(planLinkBays, []));
|
|
457
|
+
const vans = $.let(Record.bind(planPrintVans, []));
|
|
458
|
+
const plates = $.let(Record.bind(planPrintPlates, [planPrintPlatesPatch]));
|
|
459
|
+
const bindings = $.let(Record.bind(planPrintBindings, [planPrintBindingsPatch]));
|
|
460
|
+
const deliveries = $.let(Record.bind(planPrintDeliveries, [planPrintDeliveriesPatch]));
|
|
461
|
+
const stock = $.let(Data.bind(planLinkStock));
|
|
462
|
+
const lineRows = $.const(lines.read().union(bindery.read(), (_$2, line) => line));
|
|
463
|
+
const util = $.let(Data.bind(planPrintUtilisation));
|
|
464
|
+
const output = $.let(Data.bind(planPrintOutput));
|
|
465
|
+
// The window's first day: each reading runs from it, a day apiece.
|
|
466
|
+
const first = $.const(new Date("2026-10-05T00:00:00Z"), DateTimeType);
|
|
467
|
+
const parentLine = $.const(some("bindery"), OptionType(StringType));
|
|
468
|
+
const topLine = $.const(none, OptionType(StringType));
|
|
469
|
+
// The Slice's domain is the scheduled jobs. It owns the visible time window;
|
|
470
|
+
// Schedule reads every event kind over that window and keeps the backlog separate.
|
|
471
|
+
const scope = $.const(jobs.read().toArray((_$2, job) => job.start)
|
|
472
|
+
.filter((_$2, at) => at.hasTag("some"))
|
|
473
|
+
.map((_$2, at) => ({ at: at.unwrap("some") })));
|
|
474
|
+
const slice = $.let(Slice.bind("ex.planPrintWorks.time", scope, {
|
|
475
|
+
fields: { at: { label: "Job start", format: { date: "MMM DD" } } },
|
|
476
|
+
range: "at",
|
|
477
|
+
initial: { at: { from: first, to: new Date("2026-11-02T00:00:00Z") } },
|
|
478
|
+
view: { resolution: some(variant("day", null)) },
|
|
479
|
+
}));
|
|
480
|
+
// A press's readings as heat cells, one a day.
|
|
481
|
+
const daily = $.const(East.function([ArrayType(FloatType)], ArrayType(Plan.Types.HeatCell), (_$2, readings) => East.Array.generate(readings.size(), Plan.Types.HeatCell, (_$3, i) => ({
|
|
482
|
+
at: Plan.at.time(first.addDays(i)), value: some(readings.get(i)), label: none,
|
|
483
|
+
}))));
|
|
484
|
+
// The sheets printed each day, as a chart's points.
|
|
485
|
+
const PrintDay = StructType({ day: DateTimeType, sheets: FloatType });
|
|
486
|
+
const printed = $.let(output.read());
|
|
487
|
+
const days = $.let(East.Array.generate(printed.size(), PrintDay, (_$2, i) => ({ day: first.addDays(i), sheets: printed.get(i) })));
|
|
488
|
+
const axis = $.let(Plan.axis({
|
|
489
|
+
window: { min: new Date("2026-10-05T00:00:00Z"), max: new Date("2026-11-02T00:00:00Z") },
|
|
490
|
+
resolution: "day", resolutions: ["week", "day"], now: new Date("2026-10-14T09:00:00Z"),
|
|
491
|
+
}));
|
|
492
|
+
const StockWeek = StructType({ at: DateTimeType, value: OptionType(FloatType) });
|
|
493
|
+
const weekly = $.const(East.function([ArrayType(FloatType)], ArrayType(StockWeek), (_$2, readings) => East.Array.generate(readings.size(), StockWeek, (_$3, i) => ({ at: first.addWeeks(i), value: some(readings.get(i)) }))));
|
|
494
|
+
const canDrop = $.const(East.function([Schedule.Types.Candidate], OptionType(StringType), ($2, candidate) => {
|
|
495
|
+
const reason = $2.let(none, OptionType(StringType));
|
|
496
|
+
$2.match(candidate.resource, { some: ($3, resource) => {
|
|
497
|
+
$3.if(resource.kind.equal("presses").and(() => resource.key.equal("b3")), $4 => {
|
|
498
|
+
$4.assign(reason, some("Press B3 is in service; choose another press"));
|
|
499
|
+
});
|
|
500
|
+
} });
|
|
501
|
+
return reason;
|
|
502
|
+
}));
|
|
503
|
+
// A stop's own inspector: its title, and whether it is a plate change or a
|
|
504
|
+
// service, chosen on a segment — the edited stop goes back through `update`.
|
|
505
|
+
const StopKindType = PrintStop.fields.kind;
|
|
506
|
+
const inspectStop = $.const(East.function([PrintStop, FunctionType([PrintStop], NullType)], UIComponentType, ($2, stop, update) => {
|
|
507
|
+
const setKind = $2.const(East.function([StringType], NullType, ($3, picked) => {
|
|
508
|
+
const kind = $3.const(picked.equal("service").ifElse(() => East.value(variant("service", null), StopKindType), () => East.value(variant("plate_change", null), StopKindType)));
|
|
509
|
+
// East has no struct spread: the stop, rebuilt with its new kind.
|
|
510
|
+
$3(update({ title: stop.title, at: stop.at, press: stop.press, kind }));
|
|
511
|
+
}));
|
|
512
|
+
return (_jsxs(VStack, { gap: "3", align: "stretch", children: [_jsx(Text, { children: stop.title }), _jsx(SegmentGroup, { value: stop.kind.getTag(), onChange: setKind, size: "sm", items: [SegmentGroup.Item("plate_change", "Plate change"), SegmentGroup.Item("service", "Service")] })] }));
|
|
513
|
+
}));
|
|
514
|
+
return (_jsx(Plan, { id: "printWorks", axis: axis, date: first, canDrop: canDrop, slice: { slice, affordances: ["range", "brush"] }, resources: {
|
|
515
|
+
presses: Schedule.resources(presses.read(), {
|
|
516
|
+
name: "Presses", icon: "print",
|
|
517
|
+
label: p => p.name, group: p => p.hall,
|
|
518
|
+
sub: p => some(East.str `${East.Float.printCommaSeperated(p.sheets_per_hour, 0n)} sheets/h`),
|
|
519
|
+
// A row under each press, from the dataflow's utilisation: an ordinary
|
|
520
|
+
// heat series over the press rows, read only.
|
|
521
|
+
measures: [
|
|
522
|
+
Plan.series.heat(PrintPress, {
|
|
523
|
+
key: "util", title: "Utilisation", label: () => "Utilisation",
|
|
524
|
+
cells: (_p, key) => Plan.heatCells(daily(util.read().get(key)), { min: 0, max: 100, warnAt: 95 }),
|
|
525
|
+
}),
|
|
526
|
+
],
|
|
527
|
+
}),
|
|
528
|
+
crews: Schedule.resources(crews.read(), { name: "Crews", icon: "user-group", label: c => c.name, group: c => c.hall }),
|
|
529
|
+
setters: Schedule.resources(setters.read(), { name: "Plate room", icon: "layer-group", label: p => p.name, meta: () => some("Plates before printing") }),
|
|
530
|
+
lines: Schedule.resources(lineRows, {
|
|
531
|
+
name: "Bindery", icon: "book", label: l => l.name,
|
|
532
|
+
parent: (_l, key) => key.equal("bindery").ifElse(() => topLine, () => parentLine),
|
|
533
|
+
rollup: "union", collapsed: (_l, key) => key.equal("bindery"),
|
|
534
|
+
meta: () => some("Finishing"), value: (_l, key) => key.equal("bindery").ifElse(() => some("2 lines"), () => topLine),
|
|
535
|
+
}),
|
|
536
|
+
bays: Schedule.resources(bays.read(), { name: "Dispatch", icon: "warehouse", label: b => b.name, meta: () => some("Loading") }),
|
|
537
|
+
vans: Schedule.resources(vans.read(), { name: "Vans", icon: "truck", label: v => v.name, meta: () => some("Delivery fleet") }),
|
|
538
|
+
}, events: {
|
|
539
|
+
job: Schedule.events(jobs, {
|
|
540
|
+
name: "Print job", icon: "file-lines", draw: "span",
|
|
541
|
+
title: "title", start: "start", end: "end",
|
|
542
|
+
resource: { field: "press", of: "presses" },
|
|
543
|
+
state: "state",
|
|
544
|
+
quantity: { field: "sheets", unit: "sheets" },
|
|
545
|
+
backlog: { duration: j => variant("hours", j.sheets.divide(8000.0)), due: j => j.due },
|
|
546
|
+
fields: {
|
|
547
|
+
customer: Schedule.field.text({ label: "Customer" }),
|
|
548
|
+
stock: Schedule.field.select({ labels: { coated: "Coated", uncoated: "Uncoated", board: "Board" } }),
|
|
549
|
+
sheets: Schedule.field.number({ label: "Sheets", step: 1000.0, min: 0.0 }),
|
|
550
|
+
},
|
|
551
|
+
templates: [
|
|
552
|
+
{ key: "brochure", name: "Brochure run", group: "Jobs", duration: variant("hours", 6.0),
|
|
553
|
+
values: { title: "Brochure run", state: variant("proposed", variant("added", null)), sheets: 40000.0,
|
|
554
|
+
customer: "", stock: variant("coated", null), due: none } },
|
|
555
|
+
{ key: "catalogue", name: "Catalogue run", group: "Jobs", duration: variant("hours", 12.0),
|
|
556
|
+
values: { title: "Catalogue run", state: variant("proposed", variant("added", null)), sheets: 96000.0,
|
|
557
|
+
customer: "", stock: variant("coated", null), due: none } },
|
|
558
|
+
{ key: "poster", name: "Poster run", group: "Jobs", duration: variant("hours", 4.0),
|
|
559
|
+
values: { title: "Poster run", state: variant("proposed", variant("added", null)), sheets: 20000.0,
|
|
560
|
+
customer: "", stock: variant("uncoated", null), due: none } },
|
|
561
|
+
{ key: "board", name: "Board run", group: "Jobs", duration: variant("hours", 8.0),
|
|
562
|
+
values: { title: "Board run", state: variant("proposed", variant("added", null)), sheets: 24000.0,
|
|
563
|
+
customer: "", stock: variant("board", null), due: none } },
|
|
564
|
+
],
|
|
565
|
+
}),
|
|
566
|
+
stop: Schedule.events(stops, {
|
|
567
|
+
name: "Stop", icon: "screwdriver-wrench", draw: "marks",
|
|
568
|
+
title: "title", at: "at",
|
|
569
|
+
resource: { field: "press", of: "presses" },
|
|
570
|
+
inspector: inspectStop,
|
|
571
|
+
templates: [
|
|
572
|
+
{ key: "plates", name: "Plate change", group: "Stops",
|
|
573
|
+
values: { title: "Plate change", kind: variant("plate_change", null) } },
|
|
574
|
+
{ key: "service", name: "Service", group: "Stops",
|
|
575
|
+
values: { title: "Service", kind: variant("service", null) } },
|
|
576
|
+
],
|
|
577
|
+
}),
|
|
578
|
+
shift: Schedule.events(shifts, {
|
|
579
|
+
name: "Crew shift", icon: "user-clock", draw: "cards",
|
|
580
|
+
title: "title", start: "start", end: "end",
|
|
581
|
+
resource: { field: "crew", of: "crews" }, state: "state",
|
|
582
|
+
templates: [
|
|
583
|
+
{ key: "early", name: "Early shift", group: "Shifts", at: { hour: 6n, minute: 0n }, duration: variant("hours", 8.0),
|
|
584
|
+
values: { title: "Early", state: variant("confirmed", null) } },
|
|
585
|
+
{ key: "late", name: "Late shift", group: "Shifts", at: { hour: 14n, minute: 0n }, duration: variant("hours", 8.0),
|
|
586
|
+
values: { title: "Late", state: variant("confirmed", null) } },
|
|
587
|
+
{ key: "night", name: "Night shift", group: "Shifts", at: { hour: 22n, minute: 0n }, duration: variant("hours", 8.0),
|
|
588
|
+
values: { title: "Night", state: variant("proposed", variant("added", null)) } },
|
|
589
|
+
],
|
|
590
|
+
}),
|
|
591
|
+
plate: Schedule.events(plates, {
|
|
592
|
+
name: "Plates", icon: "clone", title: "title", at: "at", resource: { field: "setter", of: "setters" },
|
|
593
|
+
templates: [{ key: "plates", name: "Job plates", group: "Plate room", values: { title: "Job plates" } }],
|
|
594
|
+
}),
|
|
595
|
+
binding: Schedule.events(bindings, {
|
|
596
|
+
name: "Bindery job", icon: "book-open", draw: "cards", title: "title", start: "start", end: "end",
|
|
597
|
+
resource: { field: "line", of: "lines" }, state: "state", overlaps: "allow",
|
|
598
|
+
templates: [{ key: "fold", name: "Fold sections", group: "Bindery", duration: variant("hours", 8.0),
|
|
599
|
+
values: { title: "Fold sections", state: variant("confirmed", null) } }],
|
|
600
|
+
}),
|
|
601
|
+
delivery: Schedule.events(deliveries, {
|
|
602
|
+
name: "Delivery", icon: "truck", draw: "buckets", title: "title", at: "at",
|
|
603
|
+
resource: { field: "location", of: { bay: "bays", van: "vans" } }, lane: "lane",
|
|
604
|
+
status: { field: "status", cases: {
|
|
605
|
+
queued: { label: "Queued", tone: variant("warning", null), ring: true },
|
|
606
|
+
ready: { label: "Ready", tone: variant("info", null), ring: false },
|
|
607
|
+
dispatched: { label: "Dispatched", tone: variant("success", null), ring: false },
|
|
608
|
+
} },
|
|
609
|
+
ready: d => d.pallets.lessEqual(0.0).ifElse(() => variant("invalid", [{ field: "pallets", message: "Pallets must be positive" }]), () => variant("ready", null)),
|
|
610
|
+
fields: { pallets: Schedule.field.number({ label: "Pallets", min: 0.0, step: 1.0 }) },
|
|
611
|
+
templates: [{ key: "delivery", name: "Morning delivery", group: "Dispatch", at: { hour: 10n, minute: 0n },
|
|
612
|
+
values: { title: "Delivery", lane: "AM", status: variant("queued", null), pallets: 1.0 } }],
|
|
613
|
+
}),
|
|
614
|
+
}, rows: [
|
|
615
|
+
Plan.chart({
|
|
616
|
+
key: "output", label: "SHEETS / DAY", id: true, pinned: true, height: "spark", expandable: true,
|
|
617
|
+
layers: [Chart.Column(days, { x: r => r.day, y: r => r.sheets })],
|
|
618
|
+
}),
|
|
619
|
+
Plan.over(stock, [Plan.series.table(PrintStock, {
|
|
620
|
+
key: "stock", title: "Paper stock", label: s => s.name,
|
|
621
|
+
cells: s => Plan.tableCells(weekly(s.weekly)), format: Format.Number({ maximumFractionDigits: 0n }),
|
|
622
|
+
})]),
|
|
623
|
+
], links: [
|
|
624
|
+
Plan.link({ key: "plates", from: Plan.eventRef("plate", "P-101"), to: Plan.eventRef("job", "J-1004") }),
|
|
625
|
+
Plan.link({ key: "printed", from: Plan.eventRef("job", "J-1004"), to: Plan.eventRef("binding", "B-101"), quantity: Plan.quantity(144, { unit: "k sheets" }) }),
|
|
626
|
+
Plan.link({ key: "folded", from: Plan.eventRef("binding", "B-101"), to: Plan.eventRef("binding", "B-103") }),
|
|
627
|
+
Plan.link({ key: "dispatched", from: Plan.eventRef("binding", "B-103"), to: Plan.eventRef("delivery", "D-101") }),
|
|
628
|
+
], grain: "resource", library: [
|
|
629
|
+
Plan.library.events(),
|
|
630
|
+
Plan.library.backlog(),
|
|
631
|
+
Plan.library.series(),
|
|
632
|
+
// The customers, by district: a card dropped on a job sets its customer.
|
|
633
|
+
Plan.library.tab(customers.read(), {
|
|
634
|
+
name: "Customers", icon: "building",
|
|
635
|
+
label: c => c.name, meta: c => some(c.trade), group: c => c.district,
|
|
636
|
+
drop: c => Schedule.patch(PrintJob, { customer: c.name }),
|
|
637
|
+
}),
|
|
638
|
+
], inspector: true }));
|
|
639
|
+
} }))),
|
|
640
|
+
inputs: [],
|
|
641
|
+
});
|
|
642
|
+
/**
|
|
643
|
+
* Every way a link draws (`Plan links.html`, `Plan Builder Spec.md` §4.3,
|
|
644
|
+
* PB10, #1258): a print works' jobs from the plates that start them, across its
|
|
645
|
+
* presses, through the bindery to the dispatch bay — each link's ends named by
|
|
646
|
+
* event (`Plan.eventRef`), so it draws between the elements wherever they draw.
|
|
647
|
+
* Press a row's link control to see them. Each link is one of the grammar's
|
|
648
|
+
* cases, its quantity sizing it against the family's largest:
|
|
649
|
+
*
|
|
650
|
+
* - from the plates, a mark, into the catalogue covers: an S down, with no
|
|
651
|
+
* quantity — the thinnest weight, no caption;
|
|
652
|
+
* - from the covers, a two-hour job drawn the narrowest bar, into the
|
|
653
|
+
* catalogue: an S down, out of the bar's end as drawn;
|
|
654
|
+
* - from the card stock up into the menu cards: an S up;
|
|
655
|
+
* - from the catalogue inserts into the store flyers, which start first: the
|
|
656
|
+
* loopback down, on the lane halfway between them;
|
|
657
|
+
* - from the report covers up into the annual report: the loopback up;
|
|
658
|
+
* - from the seed catalogue into the seed packets on the press below: the
|
|
659
|
+
* loopback between adjacent rows;
|
|
660
|
+
* - from the gift tags into the gift boxes on one press: a straight feed;
|
|
661
|
+
* - from the desk calendars into the calendar pads, back to back on one press:
|
|
662
|
+
* the runoff stubs;
|
|
663
|
+
* - from the proof run, in from before the window, into the night run at its
|
|
664
|
+
* start: the loopback that drops onto the night run's start — nothing of a
|
|
665
|
+
* link crosses into the gutter;
|
|
666
|
+
* - from the proof sheets, ended before the window, and into the spring
|
|
667
|
+
* brochure, after it: each end in a dashed slot on the plot's edge;
|
|
668
|
+
* - from the book sections into the folder's two jobs: two S's out of one end,
|
|
669
|
+
* the second caption stepped under the first; then from the folder into the
|
|
670
|
+
* binder, chip to chip, and from the binder into the books' delivery, met at
|
|
671
|
+
* its week's cell;
|
|
672
|
+
* - from the shop posters straight to their delivery: an S down the canvas,
|
|
673
|
+
* and from the exhibition book back into its binding: a loopback down.
|
|
674
|
+
*
|
|
675
|
+
* The canvas is bounded, so its rows scroll: a link to a row out of view meets
|
|
676
|
+
* the view's edge in a stub pointing at it, and one between rows past both
|
|
677
|
+
* edges crosses the view as a band. The now line and the row controls draw
|
|
678
|
+
* over the links.
|
|
679
|
+
*
|
|
680
|
+
* Below the event kinds' rows, the paper in stock is a table over a dataset
|
|
681
|
+
* (`Plan.over`), a reading a week, read only: a Plan's edits go through its
|
|
682
|
+
* event kinds.
|
|
683
|
+
*/
|
|
684
|
+
export const planEventLinks = example({
|
|
685
|
+
keywords: [
|
|
686
|
+
"Plan", "links", "Plan.link", "Plan.eventRef", "event", "ends", "quantity", "weight", "ribbon", "route", "S", "loopback",
|
|
687
|
+
"feed", "runoff", "drop", "slot", "stub", "band", "out of view", "bounded", "height", "caption", "mark", "chip",
|
|
688
|
+
"tile", "bucket", "cards", "marks", "Schedule", "Schedule.events", "Schedule.resources", "Record.bind", "e3.record",
|
|
689
|
+
"rows", "Plan.over", "dataset", "read only", "table", "Plan.series.table", "Plan.tableCells", "stock", "Data.bind",
|
|
690
|
+
"e3.input", "#1191", "#1258",
|
|
691
|
+
],
|
|
692
|
+
description: "Every way a link draws — S's up and down, loopbacks, a feed and the runoff on one press, a drop onto a start at the window's edge, slots past the window, stubs and a band out of view, links into a mark, chips and a tile, weighted by quantity — between event kinds (`Plan.eventRef`) on a bounded canvas, with the paper in stock as a read-only table over a dataset (`Plan.over`)",
|
|
693
|
+
fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
|
|
694
|
+
const setters = $.let(Record.bind(planLinkSetters, []));
|
|
695
|
+
const presses = $.let(Record.bind(planPrintPresses, []));
|
|
696
|
+
const lines = $.let(Record.bind(planLinkLines, []));
|
|
697
|
+
const bays = $.let(Record.bind(planLinkBays, []));
|
|
698
|
+
const plates = $.let(Record.bind(planLinkPlates, [planLinkPlatesPatch]));
|
|
699
|
+
const jobs = $.let(Record.bind(planLinkCaseJobs, [planLinkCaseJobsPatch]));
|
|
700
|
+
const bindings = $.let(Record.bind(planLinkBindings, [planLinkBindingsPatch]));
|
|
701
|
+
const deliveries = $.let(Record.bind(planLinkDeliveries, [planLinkDeliveriesPatch]));
|
|
702
|
+
const stock = $.let(Data.bind(planLinkStock));
|
|
703
|
+
// The window's first Monday: each stock reading runs from it, a week apiece.
|
|
704
|
+
const first = $.const(new Date("2026-10-05T00:00:00Z"), DateTimeType);
|
|
705
|
+
const StockWeek = StructType({ at: DateTimeType, value: OptionType(FloatType) });
|
|
706
|
+
const weekly = $.const(East.function([ArrayType(FloatType)], ArrayType(StockWeek), (_$2, readings) => East.Array.generate(readings.size(), StockWeek, (_$3, i) => ({ at: first.addWeeks(i), value: some(readings.get(i)) }))));
|
|
707
|
+
const axis = $.let(Plan.axis({
|
|
708
|
+
window: { min: new Date("2026-10-05T00:00:00Z"), max: new Date("2026-11-02T00:00:00Z") },
|
|
709
|
+
resolution: "week", now: new Date("2026-10-14T09:00:00Z"),
|
|
710
|
+
}));
|
|
711
|
+
return (_jsx(Plan, { axis: axis, resources: {
|
|
712
|
+
setters: Schedule.resources(setters.read(), { name: "Plate room", icon: "layer-group", label: s => s.name }),
|
|
713
|
+
presses: Schedule.resources(presses.read(), { name: "Presses", icon: "print", label: p => p.name, group: p => p.hall }),
|
|
714
|
+
lines: Schedule.resources(lines.read(), { name: "Bindery", icon: "book", label: l => l.name }),
|
|
715
|
+
bays: Schedule.resources(bays.read(), { name: "Dispatch", icon: "warehouse", label: b => b.name }),
|
|
716
|
+
}, events: {
|
|
717
|
+
plate: Schedule.events(plates, {
|
|
718
|
+
name: "Plates", icon: "clone",
|
|
719
|
+
title: "title", at: "at",
|
|
720
|
+
resource: { field: "setter", of: "setters" },
|
|
721
|
+
}),
|
|
722
|
+
job: Schedule.events(jobs, {
|
|
723
|
+
name: "Print job", icon: "file-lines",
|
|
724
|
+
title: "title", start: "start", end: "end",
|
|
725
|
+
resource: { field: "press", of: "presses" },
|
|
726
|
+
state: "state", quantity: { field: "sheets", unit: "sheets" },
|
|
727
|
+
}),
|
|
728
|
+
binding: Schedule.events(bindings, {
|
|
729
|
+
name: "Bindery job", icon: "book-open", draw: "cards",
|
|
730
|
+
title: "title", start: "start", end: "end",
|
|
731
|
+
resource: { field: "line", of: "lines" }, state: "state",
|
|
732
|
+
}),
|
|
733
|
+
delivery: Schedule.events(deliveries, {
|
|
734
|
+
name: "Delivery", icon: "truck", draw: "buckets",
|
|
735
|
+
title: "title", at: "at",
|
|
736
|
+
resource: { field: "bay", of: "bays" },
|
|
737
|
+
}),
|
|
738
|
+
},
|
|
739
|
+
// The paper in stock: a table over a dataset, read only.
|
|
740
|
+
rows: [
|
|
741
|
+
Plan.over(stock, [
|
|
742
|
+
Plan.series.table(PrintStock, {
|
|
743
|
+
key: "stock", title: "Paper stock", label: s => s.name,
|
|
744
|
+
cells: s => Plan.tableCells(weekly(s.weekly)),
|
|
745
|
+
format: Format.Number({ maximumFractionDigits: 0n }),
|
|
746
|
+
}),
|
|
747
|
+
]),
|
|
748
|
+
],
|
|
749
|
+
// Each quantity in thousands of sheets, its third of the family's largest setting the link's
|
|
750
|
+
// weight; the plates' link carries none.
|
|
751
|
+
links: [
|
|
752
|
+
Plan.link({ key: "plates", from: Plan.eventRef("plate", "P-01"), to: Plan.eventRef("job", "J-2001") }),
|
|
753
|
+
Plan.link({ key: "covers", from: Plan.eventRef("job", "J-2001"), to: Plan.eventRef("job", "J-2013"), quantity: Plan.quantity(12, { unit: "k sheets" }) }),
|
|
754
|
+
Plan.link({ key: "card", from: Plan.eventRef("job", "J-2020"), to: Plan.eventRef("job", "J-2005"), quantity: Plan.quantity(30, { unit: "k sheets" }) }),
|
|
755
|
+
Plan.link({ key: "inserts", from: Plan.eventRef("job", "J-2003"), to: Plan.eventRef("job", "J-2016"), quantity: Plan.quantity(96, { unit: "k sheets" }) }),
|
|
756
|
+
Plan.link({ key: "report-covers", from: Plan.eventRef("job", "J-2022"), to: Plan.eventRef("job", "J-2009"), quantity: Plan.quantity(48, { unit: "k sheets" }) }),
|
|
757
|
+
Plan.link({ key: "seed-prints", from: Plan.eventRef("job", "J-2014"), to: Plan.eventRef("job", "J-2017"), quantity: Plan.quantity(72, { unit: "k sheets" }) }),
|
|
758
|
+
Plan.link({ key: "tags", from: Plan.eventRef("job", "J-2006"), to: Plan.eventRef("job", "J-2007"), quantity: Plan.quantity(20, { unit: "k sheets" }) }),
|
|
759
|
+
Plan.link({ key: "pads", from: Plan.eventRef("job", "J-2010"), to: Plan.eventRef("job", "J-2011"), quantity: Plan.quantity(36, { unit: "k sheets" }) }),
|
|
760
|
+
Plan.link({ key: "proofs", from: Plan.eventRef("job", "J-2008"), to: Plan.eventRef("job", "J-2015"), quantity: Plan.quantity(16, { unit: "k sheets" }) }),
|
|
761
|
+
Plan.link({ key: "proof-sheets", from: Plan.eventRef("job", "J-2012"), to: Plan.eventRef("job", "J-2004"), quantity: Plan.quantity(8, { unit: "k sheets" }) }),
|
|
762
|
+
Plan.link({ key: "tickets", from: Plan.eventRef("job", "J-2019"), to: Plan.eventRef("job", "J-2023"), quantity: Plan.quantity(60, { unit: "k sheets" }) }),
|
|
763
|
+
Plan.link({ key: "sections", from: Plan.eventRef("job", "J-2021"), to: Plan.eventRef("binding", "B-01"), quantity: Plan.quantity(40, { unit: "k sheets" }) }),
|
|
764
|
+
Plan.link({ key: "sections-more", from: Plan.eventRef("job", "J-2021"), to: Plan.eventRef("binding", "B-02"), quantity: Plan.quantity(44, { unit: "k sheets" }) }),
|
|
765
|
+
Plan.link({ key: "folded", from: Plan.eventRef("binding", "B-02"), to: Plan.eventRef("binding", "B-03"), quantity: Plan.quantity(40, { unit: "k sheets" }) }),
|
|
766
|
+
Plan.link({ key: "books", from: Plan.eventRef("binding", "B-03"), to: Plan.eventRef("delivery", "D-01"), quantity: Plan.quantity(36, { unit: "k sheets" }) }),
|
|
767
|
+
Plan.link({ key: "posters", from: Plan.eventRef("job", "J-2002"), to: Plan.eventRef("delivery", "D-02"), quantity: Plan.quantity(24, { unit: "k sheets" }) }),
|
|
768
|
+
Plan.link({ key: "book-blocks", from: Plan.eventRef("job", "J-2018"), to: Plan.eventRef("binding", "B-04"), quantity: Plan.quantity(54, { unit: "k sheets" }) }),
|
|
769
|
+
], style: { height: "400px" } }));
|
|
770
|
+
} }))),
|
|
771
|
+
inputs: [],
|
|
772
|
+
});
|
|
773
|
+
//# sourceMappingURL=plan-events.examples.js.map
|