create-pmos 0.398.0 → 0.400.0
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/package.json +30 -25
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/briefing-premium-adddoc-test.js +19 -15
- package/workspace/briefing-premium-board-test.js +82 -50
- package/workspace/briefing-premium-calendar-2-test.js +36 -36
- package/workspace/briefing-premium-calendar-3-test.js +39 -39
- package/workspace/briefing-premium-calendar-test.js +23 -24
- package/workspace/briefing-premium-doc-edit-test.js +8 -10
- package/workspace/briefing-premium-initiative-test.js +38 -16
- package/workspace/briefing-premium-insights-test.js +114 -37
- package/workspace/briefing-premium-metrics-test.js +6 -4
- package/workspace/briefing-premium-products-test.js +10 -7
- package/workspace/briefing-premium-sources-test.js +25 -22
- package/workspace/briefing-premium-test.js +48 -43
- package/workspace/briefing-premium-work-test.js +16 -11
- package/workspace/c3-capture-test.js +0 -17
- package/workspace/changelog.json +29 -0
- package/workspace/ev-everywhere-test.js +210 -0
- package/workspace/fixtures/premium-viewer-fixtures.js +11 -6
- package/workspace/guide/briefing-premium.md +2 -2
- package/workspace/guide/home.md +58 -19
- package/workspace/guide/index.md +1 -1
- package/workspace/guide/layout.md +2 -2
- package/workspace/guide/notes.md +2 -2
- package/workspace/guide/phone-companion.md +1 -1
- package/workspace/lib/board-grill.js +63 -0
- package/workspace/lib/board-premium.js +36 -5
- package/workspace/lib/initiative-layout.js +77 -0
- package/workspace/lib/insights-premium.js +3 -2
- package/workspace/lib/insights-records.js +21 -7
- package/workspace/lib/meeting-points.js +52 -0
- package/workspace/lib/news-for-you.js +88 -0
- package/workspace/lib/notes-series.js +29 -6
- package/workspace/lib/report-confirm.js +48 -0
- package/workspace/lib/route-modules.js +9 -9
- package/workspace/lib/routes-board-docs.js +46 -0
- package/workspace/lib/routes-board-grill.js +90 -0
- package/workspace/lib/routes-home-review.js +108 -0
- package/workspace/lib/routes-initiative-layout.js +57 -0
- package/workspace/lib/routes-insights-premium.js +4 -1
- package/workspace/lib/routes-insights-records.js +8 -4
- package/workspace/lib/routes-meeting-points.js +37 -0
- package/workspace/lib/routes-news.js +57 -0
- package/workspace/lib/routes-notes.js +2 -1
- package/workspace/lib/routes-phone-day.js +18 -9
- package/workspace/lib/routes-report-confirm.js +31 -0
- package/workspace/lib/routes-search.js +38 -0
- package/workspace/lib/routes-slash.js +95 -0
- package/workspace/lib/search-index.js +176 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -2
- package/workspace/premium-board-actions-test.js +86 -50
- package/workspace/premium-briefing-depth-test.js +55 -54
- package/workspace/premium-chat-chart-tab-test.js +4 -2
- package/workspace/premium-chat-goal-view-test.js +1 -1
- package/workspace/premium-chat-report-tab-test.js +16 -2
- package/workspace/premium-chat-term-test.js +0 -10
- package/workspace/premium-core-doc-issue-test.js +15 -13
- package/workspace/premium-menu-rows-test.js +1 -1
- package/workspace/premium-phone-card-test.js +7 -5
- package/workspace/premium-report-read-test.js +55 -18
- package/workspace/premium-vw-backlog-test.js +2 -2
- package/workspace/premium-vw-cal-test.js +50 -35
- package/workspace/premium-vw-doc-test.js +10 -11
- package/workspace/premium-vw-item-test.js +1 -1
- package/workspace/premium-vw-jira-test.js +2 -2
- package/workspace/premium-vw-meet-test.js +37 -40
- package/workspace/premium-vw-notes-test.js +21 -19
- package/workspace/premium-vw-rec-test.js +11 -12
- package/workspace/premium-welcome-test.js +3 -3
- package/workspace/premium-work-depth-test.js +5 -6
- package/workspace/public/capture.html +23 -0
- package/workspace/public/pm/bd-acts.js +303 -225
- package/workspace/public/pm/bd-asks.js +261 -0
- package/workspace/public/pm/bd-pop.js +59 -0
- package/workspace/public/pm/bd-span.js +49 -13
- package/workspace/public/pm/bd-views.js +169 -0
- package/workspace/public/pm/c3-base.js +47 -0
- package/workspace/public/pm/c3-capture.js +1 -1
- package/workspace/public/pm/c3-ini-ui.js +1 -1
- package/workspace/public/pm/c3-sheet.js +1 -1
- package/workspace/public/pm/c3-toast.js +1 -1
- package/workspace/public/pm/console3.css +3 -0
- package/workspace/public/pm/cozy-board.css +301 -0
- package/workspace/public/pm/cozy-ev.css +228 -0
- package/workspace/public/pm/cozy-evmodel.js +106 -0
- package/workspace/public/pm/cozy-evui.js +47 -0
- package/workspace/public/pm/cozy-home.css +20 -5
- package/workspace/public/pm/cozy-insights.css +148 -10
- package/workspace/public/pm/cozy-nav.js +103 -39
- package/workspace/public/pm/cozy-news.js +140 -0
- package/workspace/public/pm/cozy-search.js +203 -0
- package/workspace/public/pm/cozy-settings.js +198 -0
- package/workspace/public/pm/cozy-sources.js +89 -0
- package/workspace/public/pm/cozy-today.css +220 -0
- package/workspace/public/pm/cozy-viewer.js +5 -2
- package/workspace/public/pm/cozy-vw-mtg.css +350 -0
- package/workspace/public/pm/cozy-vw-rp.css +152 -0
- package/workspace/public/pm/cozy.css +9 -0
- package/workspace/public/pm/goal-chat.js +5 -1
- package/workspace/public/pm/home-adddoc.js +5 -5
- package/workspace/public/pm/home-app.js +365 -70
- package/workspace/public/pm/home-around.js +24 -126
- package/workspace/public/pm/home-chat.js +77 -18
- package/workspace/public/pm/home-data.js +9 -7
- package/workspace/public/pm/home-dictate.js +57 -0
- package/workspace/public/pm/home-draft.js +6 -6
- package/workspace/public/pm/home-ini-model.js +190 -0
- package/workspace/public/pm/home-ini.css +171 -0
- package/workspace/public/pm/home-ini.js +466 -0
- package/workspace/public/pm/home-list.js +289 -0
- package/workspace/public/pm/home-more.js +18 -135
- package/workspace/public/pm/home-phone-card.js +13 -8
- package/workspace/public/pm/home-review.js +103 -0
- package/workspace/public/pm/home-task.js +67 -0
- package/workspace/public/pm/home-today.js +148 -0
- package/workspace/public/pm/home-work.js +63 -28
- package/workspace/public/pm/note-dock.js +1 -2
- package/workspace/public/pm/notes-links.js +1 -2
- package/workspace/public/pm/notes-task.js +3 -4
- package/workspace/public/pm/premium-board.js +164 -40
- package/workspace/public/pm/premium-chart-tab.js +4 -5
- package/workspace/public/pm/premium-first.js +5 -7
- package/workspace/public/pm/premium-initiative-head.js +3 -3
- package/workspace/public/pm/premium-insights.js +499 -202
- package/workspace/public/pm/premium-mtg-present.js +138 -0
- package/workspace/public/pm/premium-mtg-replay.js +142 -0
- package/workspace/public/pm/premium-report-read.js +216 -52
- package/workspace/public/pm/premium-report-tab.js +44 -19
- package/workspace/public/pm/premium-shell.js +7 -7
- package/workspace/public/pm/premium-vw-cal.js +150 -60
- package/workspace/public/pm/premium-vw-doc.css +20 -2
- package/workspace/public/pm/premium-vw-doc.js +22 -7
- package/workspace/public/pm/premium-vw-mtg.js +488 -261
- package/workspace/public/pm/premium-vw-notes.js +61 -0
- package/workspace/public/pm/rp-parts.js +269 -0
- package/workspace/public/pm/view-notes.js +2 -2
- package/workspace/public/premium-board.html +4 -3
- package/workspace/public/premium-insights.html +10 -10
- package/workspace/public/premium.html +3 -1
- package/workspace/r/m1.png +0 -0
- package/workspace/r/m2.png +0 -0
- package/workspace/r/m3.png +0 -0
- package/workspace/r/nl.png +0 -0
- package/workspace/replaced-tests.json +435 -0
- package/workspace/run-tests.js +323 -28
- package/workspace/server.js +15 -10
- package/workspace/test-files.json +3 -140
- package/workspace/test-lists/base.json +1 -2
- package/workspace/test-lists/c3-desktop-light-load.json +1 -2
- package/workspace/test-lists/c3-initiative-boards.json +1 -2
- package/workspace/test-lists/c3-meeting-focus.json +2 -12
- package/workspace/test-lists/c3-work-agent.json +1 -2
- package/workspace/test-lists/calendar-tidy-up.json +1 -2
- package/workspace/test-lists/console3-reports.json +1 -2
- package/workspace/test-lists/docs-three-way-sync.json +1 -2
- package/workspace/test-lists/extension-capture.json +5 -0
- package/workspace/test-lists/initiative-layout.json +9 -0
- package/workspace/test-lists/jira-wbs.json +1 -2
- package/workspace/test-lists/legacy-cleanup-a.json +9 -0
- package/workspace/test-lists/meeting-material.json +1 -2
- package/workspace/test-lists/meeting-notes.json +2 -36
- package/workspace/test-lists/meeting-replay.json +1 -2
- package/workspace/test-lists/mm-capture.json +2 -12
- package/workspace/test-lists/my-work.json +2 -10
- package/workspace/test-lists/onboarding-firstrun.json +2 -12
- package/workspace/test-lists/people-directory.json +1 -2
- package/workspace/test-lists/premium-uncovered-meetings.json +9 -0
- package/workspace/test-lists/premium-uncovered-reports.json +9 -0
- package/workspace/test-lists/run2-a.json +1 -2
- package/workspace/test-lists/run2-d.json +2 -19
- package/workspace/test-lists/run3-b.json +1 -2
- package/workspace/test-lists/run3-c.json +2 -12
- package/workspace/test-lists/run4-b.json +1 -2
- package/workspace/test-lists/run4-d.json +1 -5
- package/workspace/test-lists/run5-c.json +1 -11
- package/workspace/test-lists/run6.json +1 -5
- package/workspace/test-lists/uf-everywhere.json +15 -0
- package/workspace/test-lists/uf-home.json +9 -0
- package/workspace/test-lists/uncovered-board.json +9 -0
- package/workspace/test-lists/workspace-launch-flags.json +2 -12
- package/workspace/test-lists/workspace-profile-detection.json +2 -10
- package/workspace/test-timings.json +242 -123
- package/workspace/c3-briefing-test.js +0 -136
- package/workspace/c3-core-docs-test.js +0 -170
- package/workspace/c3-driver-fixture.js +0 -64
- package/workspace/c3-driver-test.js +0 -169
- package/workspace/c3-foundation-test.js +0 -163
- package/workspace/c3-ib-items-test.js +0 -114
- package/workspace/c3-ib-more-test.js +0 -146
- package/workspace/c3-ib-triage-backlog-test.js +0 -128
- package/workspace/c3-ini-harness.js +0 -66
- package/workspace/c3-ini-life-test.js +0 -167
- package/workspace/c3-initiatives-test.js +0 -186
- package/workspace/c3-light-load-test.js +0 -112
- package/workspace/c3-one-home-test.js +0 -149
- package/workspace/c3-phone-test.js +0 -289
- package/workspace/c3-quiet-test.js +0 -157
- package/workspace/c3-report-design-real-test.js +0 -264
- package/workspace/c3-report-design-test.js +0 -442
- package/workspace/c3-report-setup-test.js +0 -192
- package/workspace/c3-report-structure-real-test.js +0 -248
- package/workspace/c3-report-structure-test.js +0 -397
- package/workspace/c3-reports-test.js +0 -288
- package/workspace/c3-scan-test.js +0 -517
- package/workspace/c3-sessions-panel-test.js +0 -365
- package/workspace/c3-settings-test.js +0 -204
- package/workspace/c3-updates-test.js +0 -131
- package/workspace/c3-work-test.js +0 -260
- package/workspace/cut-stub.js +0 -40
- package/workspace/first-paint-audit.js +0 -160
- package/workspace/lib/c3-full-console.js +0 -15
- package/workspace/lib/engine/derived/trust.js +0 -3
- package/workspace/lib/engine/plan-forecast.js +0 -342
- package/workspace/lib/engine/report-families.js +0 -175
- package/workspace/lib/engine/truth-table.js +0 -57
- package/workspace/lib/routes-c3-init.js +0 -54
- package/workspace/lib/routes-c3-life.js +0 -120
- package/workspace/lib/routes-c3-timeline.js +0 -192
- package/workspace/lib/routes-forecast.js +0 -86
- package/workspace/lib/routes-releases.js +0 -130
- package/workspace/lib/routes-report-facts.js +0 -85
- package/workspace/lib/routes-report-families.js +0 -33
- package/workspace/lib/routes-signals.js +0 -51
- package/workspace/lib/routes-timeline.js +0 -197
- package/workspace/public/c3.html +0 -35
- package/workspace/public/index.html +0 -156
- package/workspace/public/pm/app.js +0 -831
- package/workspace/public/pm/bd-board.js +0 -159
- package/workspace/public/pm/bd-drag.js +0 -59
- package/workspace/public/pm/bd-model.js +0 -152
- package/workspace/public/pm/bd-timeline.js +0 -233
- package/workspace/public/pm/bd-tree.js +0 -244
- package/workspace/public/pm/board-copy.js +0 -59
- package/workspace/public/pm/board-read.js +0 -38
- package/workspace/public/pm/branches-sheet.js +0 -56
- package/workspace/public/pm/breakdown-api.js +0 -58
- package/workspace/public/pm/breakdown-copy.js +0 -138
- package/workspace/public/pm/briefing-deck.js +0 -441
- package/workspace/public/pm/briefing-model.js +0 -251
- package/workspace/public/pm/c3-ambient.js +0 -100
- package/workspace/public/pm/c3-audience-link.js +0 -21
- package/workspace/public/pm/c3-audience.js +0 -46
- package/workspace/public/pm/c3-boot.js +0 -13
- package/workspace/public/pm/c3-breakdown.js +0 -240
- package/workspace/public/pm/c3-brief-data.js +0 -11
- package/workspace/public/pm/c3-brief-mentions.js +0 -137
- package/workspace/public/pm/c3-brief-needs.js +0 -288
- package/workspace/public/pm/c3-brief-pulse.js +0 -112
- package/workspace/public/pm/c3-brief-summary.js +0 -139
- package/workspace/public/pm/c3-brief-today.js +0 -79
- package/workspace/public/pm/c3-brief.js +0 -279
- package/workspace/public/pm/c3-cal-strategy.js +0 -529
- package/workspace/public/pm/c3-calendar.js +0 -965
- package/workspace/public/pm/c3-calpop.js +0 -111
- package/workspace/public/pm/c3-case.js +0 -196
- package/workspace/public/pm/c3-core-docs.css +0 -18
- package/workspace/public/pm/c3-core-docs.js +0 -236
- package/workspace/public/pm/c3-daypart.js +0 -176
- package/workspace/public/pm/c3-demo-boards.js +0 -764
- package/workspace/public/pm/c3-demo-brief-ix.js +0 -350
- package/workspace/public/pm/c3-demo-brief-page.js +0 -70
- package/workspace/public/pm/c3-demo-cal-ix.js +0 -74
- package/workspace/public/pm/c3-demo-cal2.js +0 -66
- package/workspace/public/pm/c3-demo-cal3.js +0 -173
- package/workspace/public/pm/c3-demo-cal4.js +0 -169
- package/workspace/public/pm/c3-demo-cal5.js +0 -52
- package/workspace/public/pm/c3-demo-coredocs.js +0 -221
- package/workspace/public/pm/c3-demo-data.js +0 -552
- package/workspace/public/pm/c3-demo-focus.js +0 -181
- package/workspace/public/pm/c3-demo-init.js +0 -430
- package/workspace/public/pm/c3-demo-life.js +0 -77
- package/workspace/public/pm/c3-demo-material.js +0 -58
- package/workspace/public/pm/c3-demo-misc2.js +0 -34
- package/workspace/public/pm/c3-demo-phone.js +0 -48
- package/workspace/public/pm/c3-demo-plan2.js +0 -30
- package/workspace/public/pm/c3-demo-rd.js +0 -432
- package/workspace/public/pm/c3-demo-rep-ix.js +0 -126
- package/workspace/public/pm/c3-demo-rep2.js +0 -130
- package/workspace/public/pm/c3-demo-rep3.js +0 -138
- package/workspace/public/pm/c3-demo-rs.js +0 -287
- package/workspace/public/pm/c3-demo-term.js +0 -153
- package/workspace/public/pm/c3-demo-time.js +0 -49
- package/workspace/public/pm/c3-demo-work-ix.js +0 -32
- package/workspace/public/pm/c3-demo.js +0 -131
- package/workspace/public/pm/c3-design-studio.js +0 -369
- package/workspace/public/pm/c3-doc-formats.js +0 -153
- package/workspace/public/pm/c3-doc-sheet.js +0 -1230
- package/workspace/public/pm/c3-dock.js +0 -206
- package/workspace/public/pm/c3-docs.js +0 -291
- package/workspace/public/pm/c3-driver-work.js +0 -110
- package/workspace/public/pm/c3-driver.css +0 -18
- package/workspace/public/pm/c3-driver.js +0 -298
- package/workspace/public/pm/c3-focus.css +0 -304
- package/workspace/public/pm/c3-focus.js +0 -983
- package/workspace/public/pm/c3-ib-docs.js +0 -92
- package/workspace/public/pm/c3-ib-initiatives.js +0 -201
- package/workspace/public/pm/c3-ib-items.js +0 -210
- package/workspace/public/pm/c3-ib-releases.js +0 -48
- package/workspace/public/pm/c3-ib-sprints.js +0 -201
- package/workspace/public/pm/c3-ib-triage.js +0 -177
- package/workspace/public/pm/c3-ii-tabs.js +0 -252
- package/workspace/public/pm/c3-ini-life.css +0 -34
- package/workspace/public/pm/c3-ini-life.js +0 -379
- package/workspace/public/pm/c3-ini-records.js +0 -197
- package/workspace/public/pm/c3-ini-timeline.js +0 -278
- package/workspace/public/pm/c3-ini-work.js +0 -139
- package/workspace/public/pm/c3-init-extras.js +0 -170
- package/workspace/public/pm/c3-initiatives.js +0 -852
- package/workspace/public/pm/c3-lifecycle-panels.js +0 -479
- package/workspace/public/pm/c3-look.js +0 -27
- package/workspace/public/pm/c3-material.css +0 -22
- package/workspace/public/pm/c3-material.js +0 -321
- package/workspace/public/pm/c3-md.js +0 -3
- package/workspace/public/pm/c3-misc-panels.js +0 -89
- package/workspace/public/pm/c3-new-session.js +0 -110
- package/workspace/public/pm/c3-notes.js +0 -751
- package/workspace/public/pm/c3-phone-boot.js +0 -47
- package/workspace/public/pm/c3-phone-detail.js +0 -97
- package/workspace/public/pm/c3-phone-model.js +0 -3
- package/workspace/public/pm/c3-phone.css +0 -66
- package/workspace/public/pm/c3-phone.js +0 -444
- package/workspace/public/pm/c3-plan-panels.js +0 -163
- package/workspace/public/pm/c3-plan.js +0 -193
- package/workspace/public/pm/c3-quiet.css +0 -113
- package/workspace/public/pm/c3-quiet.js +0 -177
- package/workspace/public/pm/c3-replay.css +0 -133
- package/workspace/public/pm/c3-replay.js +0 -429
- package/workspace/public/pm/c3-report-deck.css +0 -163
- package/workspace/public/pm/c3-report-deck.js +0 -598
- package/workspace/public/pm/c3-report-frame.css +0 -20
- package/workspace/public/pm/c3-report-print.css +0 -20
- package/workspace/public/pm/c3-report-setup.css +0 -67
- package/workspace/public/pm/c3-report-setup.js +0 -298
- package/workspace/public/pm/c3-report-store.js +0 -244
- package/workspace/public/pm/c3-report-structure.css +0 -44
- package/workspace/public/pm/c3-report-structure.js +0 -473
- package/workspace/public/pm/c3-reports.css +0 -68
- package/workspace/public/pm/c3-reports.js +0 -377
- package/workspace/public/pm/c3-roadmap.js +0 -249
- package/workspace/public/pm/c3-scan-api.js +0 -167
- package/workspace/public/pm/c3-scan-next.js +0 -248
- package/workspace/public/pm/c3-scan-setup.js +0 -313
- package/workspace/public/pm/c3-scan-words.js +0 -41
- package/workspace/public/pm/c3-scan.css +0 -74
- package/workspace/public/pm/c3-scan.js +0 -93
- package/workspace/public/pm/c3-session-chat.js +0 -103
- package/workspace/public/pm/c3-session-conv.js +0 -165
- package/workspace/public/pm/c3-session-term.js +0 -216
- package/workspace/public/pm/c3-settings.css +0 -85
- package/workspace/public/pm/c3-settings.js +0 -1045
- package/workspace/public/pm/c3-shell.js +0 -628
- package/workspace/public/pm/c3-signals.js +0 -196
- package/workspace/public/pm/c3-strategy-panels.js +0 -45
- package/workspace/public/pm/c3-swipe.js +0 -230
- package/workspace/public/pm/c3-terminal-data.js +0 -48
- package/workspace/public/pm/c3-terminal-edge.js +0 -91
- package/workspace/public/pm/c3-terminal-icons.js +0 -40
- package/workspace/public/pm/c3-terminal-results.js +0 -141
- package/workspace/public/pm/c3-terminal.js +0 -52
- package/workspace/public/pm/c3-tickets.js +0 -163
- package/workspace/public/pm/c3-timeline.js +0 -201
- package/workspace/public/pm/calendar-views.js +0 -1049
- package/workspace/public/pm/console3-lift.md +0 -220
- package/workspace/public/pm/cozy-home.js +0 -172
- package/workspace/public/pm/cozy-initiative.css +0 -138
- package/workspace/public/pm/cycle-review.js +0 -125
- package/workspace/public/pm/data.js +0 -1577
- package/workspace/public/pm/dest-board.js +0 -444
- package/workspace/public/pm/dest-docs.js +0 -530
- package/workspace/public/pm/dest-initiatives.js +0 -162
- package/workspace/public/pm/dest-mywork.js +0 -307
- package/workspace/public/pm/dest-notes.js +0 -537
- package/workspace/public/pm/dest-people.js +0 -449
- package/workspace/public/pm/dest-reports.js +0 -383
- package/workspace/public/pm/dest-settings.js +0 -601
- package/workspace/public/pm/dest-today.js +0 -267
- package/workspace/public/pm/display-word.js +0 -56
- package/workspace/public/pm/doc-editor.js +0 -473
- package/workspace/public/pm/doc-graph.js +0 -272
- package/workspace/public/pm/doc-health-panel.js +0 -110
- package/workspace/public/pm/doc-rail.js +0 -167
- package/workspace/public/pm/doc-remote.js +0 -180
- package/workspace/public/pm/dock-sessions.js +0 -472
- package/workspace/public/pm/dock.js +0 -216
- package/workspace/public/pm/fixture.js +0 -821
- package/workspace/public/pm/flag-picker.js +0 -104
- package/workspace/public/pm/frame-copy.js +0 -278
- package/workspace/public/pm/freshness-line.js +0 -149
- package/workspace/public/pm/handoff-box.js +0 -82
- package/workspace/public/pm/initiative-list.js +0 -235
- package/workspace/public/pm/initiative-sheet.js +0 -331
- package/workspace/public/pm/initiatives-api.js +0 -95
- package/workspace/public/pm/initiatives-copy.js +0 -287
- package/workspace/public/pm/initiatives-timeline-copy.js +0 -59
- package/workspace/public/pm/initiatives-timeline.js +0 -410
- package/workspace/public/pm/initiatives-ui.js +0 -291
- package/workspace/public/pm/item-sheet.js +0 -268
- package/workspace/public/pm/keep-card.js +0 -204
- package/workspace/public/pm/lifecycle-lens-model.js +0 -246
- package/workspace/public/pm/lifecycle-lens.js +0 -276
- package/workspace/public/pm/lifecycle.js +0 -111
- package/workspace/public/pm/mobile.css +0 -366
- package/workspace/public/pm/mobile.js +0 -581
- package/workspace/public/pm/modes-live.js +0 -453
- package/workspace/public/pm/modes.js +0 -147
- package/workspace/public/pm/my-work-card.js +0 -51
- package/workspace/public/pm/my-work-data.js +0 -36
- package/workspace/public/pm/new-initiative-sheet.js +0 -169
- package/workspace/public/pm/next-step-ui.js +0 -190
- package/workspace/public/pm/outbox-panel.js +0 -125
- package/workspace/public/pm/palette-copy.js +0 -55
- package/workspace/public/pm/palette.js +0 -343
- package/workspace/public/pm/panel-breakdown.js +0 -702
- package/workspace/public/pm/panel-cockpit.js +0 -425
- package/workspace/public/pm/panel-detail.js +0 -1513
- package/workspace/public/pm/panel-initiatives.js +0 -929
- package/workspace/public/pm/panel-newsess.js +0 -709
- package/workspace/public/pm/panel-repos.js +0 -741
- package/workspace/public/pm/panel-tabs.js +0 -1506
- package/workspace/public/pm/panel-trees.js +0 -204
- package/workspace/public/pm/people-link.js +0 -106
- package/workspace/public/pm/phone-deck.js +0 -167
- package/workspace/public/pm/pm-work-view.js +0 -1533
- package/workspace/public/pm/portfolio-report.js +0 -61
- package/workspace/public/pm/premium-acts.js +0 -280
- package/workspace/public/pm/premium-brief.js +0 -111
- package/workspace/public/pm/premium-chat.js +0 -22
- package/workspace/public/pm/premium-doc-sheet.js +0 -312
- package/workspace/public/pm/premium-initiative.js +0 -324
- package/workspace/public/pm/premium-insights.css +0 -228
- package/workspace/public/pm/premium-metric-tiles.js +0 -68
- package/workspace/public/pm/premium-report-brief.js +0 -132
- package/workspace/public/pm/premium-vw-rec.js +0 -67
- package/workspace/public/pm/premium-wide.css +0 -30
- package/workspace/public/pm/print.css +0 -44
- package/workspace/public/pm/provider-cards.js +0 -136
- package/workspace/public/pm/registry.js +0 -203
- package/workspace/public/pm/release-card.js +0 -110
- package/workspace/public/pm/releases-view.js +0 -248
- package/workspace/public/pm/report-families-view.js +0 -505
- package/workspace/public/pm/report-slides.js +0 -438
- package/workspace/public/pm/report-tab.js +0 -33
- package/workspace/public/pm/report-view.js +0 -337
- package/workspace/public/pm/reports-copy.js +0 -134
- package/workspace/public/pm/roadmap.js +0 -294
- package/workspace/public/pm/run-card.js +0 -260
- package/workspace/public/pm/sessions-panel.js +0 -219
- package/workspace/public/pm/sheet-jira.js +0 -353
- package/workspace/public/pm/shell-bell.js +0 -163
- package/workspace/public/pm/shell-model.js +0 -83
- package/workspace/public/pm/shell-phone.js +0 -124
- package/workspace/public/pm/shell-readaloud.js +0 -53
- package/workspace/public/pm/shell-recording.js +0 -274
- package/workspace/public/pm/shell-ticker.js +0 -90
- package/workspace/public/pm/sig-watch.js +0 -41
- package/workspace/public/pm/slide-confirm.js +0 -163
- package/workspace/public/pm/slides-copy.js +0 -52
- package/workspace/public/pm/status-banner.js +0 -95
- package/workspace/public/pm/tab-doc.js +0 -859
- package/workspace/public/pm/tab-gone.js +0 -21
- package/workspace/public/pm/tab-term.js +0 -1210
- package/workspace/public/pm/tab-web.js +0 -90
- package/workspace/public/pm/timeline-copy.js +0 -48
- package/workspace/public/pm/timeline-forecast-view.js +0 -164
- package/workspace/public/pm/today-agenda.js +0 -331
- package/workspace/public/pm/today-cards.js +0 -244
- package/workspace/public/pm/today-copy.js +0 -506
- package/workspace/public/pm/today-day.js +0 -1371
- package/workspace/public/pm/today-goals.js +0 -297
- package/workspace/public/pm/today-jobs.js +0 -84
- package/workspace/public/pm/today-mentions.js +0 -50
- package/workspace/public/pm/topbar.js +0 -202
- package/workspace/public/pm/triage-card.js +0 -60
- package/workspace/public/pm/undo-hold.js +0 -103
- package/workspace/public/pm/view-addrepo.js +0 -208
- package/workspace/public/pm/view-files.js +0 -197
- package/workspace/public/pm/view-livenotes.js +0 -399
- package/workspace/public/pm/view-today.js +0 -13
- package/workspace/public/pm/view-validate.js +0 -171
- package/workspace/public/pm/welcome.js +0 -391
- package/workspace/public/pm/work-place.js +0 -68
- package/workspace/public/pm/xlsx-read.js +0 -117
- package/workspace/public/welcome.html +0 -22
- package/workspace/test-lists/browser-suites-green.json +0 -5
- package/workspace/test-lists/c3-core-docs.json +0 -9
- package/workspace/test-lists/c3-doc-sheet-rich.json +0 -6
- package/workspace/test-lists/c3-doc-sheet-size.json +0 -6
- package/workspace/test-lists/c3-doc-sheet-v2.json +0 -6
- package/workspace/test-lists/c3-ib-items.json +0 -9
- package/workspace/test-lists/c3-ib-more.json +0 -9
- package/workspace/test-lists/c3-ib-triage-backlog.json +0 -9
- package/workspace/test-lists/c3-ini-life.json +0 -9
- package/workspace/test-lists/c3-meeting-board.json +0 -5
- package/workspace/test-lists/c3-meeting-card.json +0 -5
- package/workspace/test-lists/c3-notes-place.json +0 -5
- package/workspace/test-lists/c3-notes-series.json +0 -5
- package/workspace/test-lists/calendar-time-page.json +0 -5
- package/workspace/test-lists/calpop.json +0 -4
- package/workspace/test-lists/console3-briefing.json +0 -9
- package/workspace/test-lists/console3-foundation.json +0 -9
- package/workspace/test-lists/console3-work-page.json +0 -9
- package/workspace/test-lists/premium-brief-parity.json +0 -9
- package/workspace/test-lists/report-design-studio-ui.json +0 -5
- package/workspace/test-lists/report-structure-ui.json +0 -11
- package/workspace/test-lists/report-workspace-ui.json +0 -5
- package/workspace/test-lists/run3-a.json +0 -5
- package/workspace/test-lists/run3-d.json +0 -6
- package/workspace/test-lists/run4-c.json +0 -13
- package/workspace/test-lists/today-goals-jobs-ui.json +0 -5
- package/workspace/test-lists/today-mentions-cards.json +0 -5
- package/workspace/test-lists/workspace-tabs-declutter.json +0 -13
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
/* pm/bd-board.js — the Breakdown's Board (pm-os-absorb Run 1, PRD R19).
|
|
2
|
-
*
|
|
3
|
-
* Four columns, Todo · Doing · Review · Done, read from the same items map as the Tree, so a card's column is always its
|
|
4
|
-
* row's state. Done shows the last 14 days; older done items are counted ("3 older in the Tree") and stay in the Tree.
|
|
5
|
-
*
|
|
6
|
-
* When the pane is narrower than 600px — a phone, or the tabs column beside an open list and detail — the Board shows one
|
|
7
|
-
* column at a time behind a segmented switch (Todo 4 · Doing 2 · Review 1 · Done 3), and a card moves through the item
|
|
8
|
-
* sheet's state buttons: tap the card, tap the state. When it is wider, the four columns sit side by side and a card is
|
|
9
|
-
* dragged between them; a drop on Done is held for Undo, like any other Done.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { el } from './dom.js';
|
|
13
|
-
import { card, tabs, dragHandle, iconButton, empty, button, badge } from './primitives.js';
|
|
14
|
-
import { COPY, STATES, shortDate, ownerLabel } from './breakdown-copy.js';
|
|
15
|
-
import { stageLabel } from './bd-model.js';
|
|
16
|
-
import { signalsFor, byPart } from './bd-tree.js';
|
|
17
|
-
import { icon } from './icons.js';
|
|
18
|
-
|
|
19
|
-
/** The width below which the Board shows one column at a time. Mirrors components.css's container query. */
|
|
20
|
-
export const WIDE_BOARD = 600;
|
|
21
|
-
|
|
22
|
-
function boardCard(ctx, id, wide) {
|
|
23
|
-
const { L, A } = ctx;
|
|
24
|
-
const it = L.items[id];
|
|
25
|
-
const ag = !!ctx.agenda;
|
|
26
|
-
// the Board destination shows the Agenda's card: initiative and stage only, the owner as an icon; the Breakdown keeps the long meta
|
|
27
|
-
const meta = ag ? [stageLabel(L, it.stage)] : [stageLabel(L, it.stage), ownerLabel(it.owner), it.due ? COPY.due(shortDate(it.due)) : null, byPart(it)];
|
|
28
|
-
|
|
29
|
-
const ownerIcon = !ag ? null : it.owner === 'you'
|
|
30
|
-
? badge({ text: 'You', tone: 'outline', attrs: { 'data-bd-card-owner': 'you' } })
|
|
31
|
-
: it.owner === 'agent'
|
|
32
|
-
? el('span', { class: 'bd-card__owner-icon', 'data-bd-card-owner': 'agent' }, icon('bot'))
|
|
33
|
-
: null;
|
|
34
|
-
|
|
35
|
-
const trail = !ag && !ctx.cardMenus ? null : [
|
|
36
|
-
ownerIcon,
|
|
37
|
-
iconButton({
|
|
38
|
-
icon: 'ellipsis', size: 'sm', ariaLabel: COPY.aria.more(it.title),
|
|
39
|
-
onClick: (e) => { e.stopPropagation(); A.menu(e.currentTarget, id, 'board'); },
|
|
40
|
-
attrs: { 'aria-haspopup': 'menu', 'data-fk': 'more:' + id, 'data-bd-more': '', 'data-bd-card-menu': '' },
|
|
41
|
-
}),
|
|
42
|
-
].filter(Boolean);
|
|
43
|
-
|
|
44
|
-
// Without the ⋯ button the card's menu is a right-click away, and Shift+F10 (or the ContextMenu key) for the keyboard.
|
|
45
|
-
const menuKeys = ctx.cardMenus ? {} : {
|
|
46
|
-
'aria-keyshortcuts': 'Shift+F10',
|
|
47
|
-
onContextmenu: (e) => {
|
|
48
|
-
e.preventDefault();
|
|
49
|
-
const t = e.currentTarget;
|
|
50
|
-
// the key that raised this event (Shift+F10, ContextMenu) has already opened the menu below: a second call closes it
|
|
51
|
-
if (t.getAttribute('aria-expanded') === 'true') return;
|
|
52
|
-
// On Linux and macOS the event comes on the PRESS. A popover opened then is light-dismissed by the release, which
|
|
53
|
-
// lands outside it, so the menu opens after the release.
|
|
54
|
-
if (e.buttons) window.addEventListener('pointerup', () => setTimeout(() => A.menu(t, id, 'board'), 0), { once: true, capture: true });
|
|
55
|
-
else A.menu(t, id, 'board');
|
|
56
|
-
},
|
|
57
|
-
onKeydown: (e) => {
|
|
58
|
-
if (e.key === 'ContextMenu' || (e.shiftKey && e.key === 'F10')) { e.preventDefault(); e.stopPropagation(); A.menu(e.currentTarget, id, 'board'); }
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
return card({
|
|
62
|
-
title: it.title, titleIcon: it.milestone ? 'diamond' : null, meta, signals: signalsFor(it, 'board'),
|
|
63
|
-
lead: wide ? [dragHandle({ label: COPY.aria.reorder(it.title), })] : null, trail,
|
|
64
|
-
muted: it.proposed, onOpen: () => A.openSheet(id),
|
|
65
|
-
center: ag,
|
|
66
|
-
attrs: { class: 'bd-card', 'data-item': id, 'data-state': it.state },
|
|
67
|
-
openAttrs: { 'data-fk': 'card:' + id, ...menuKeys },
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/** The Board's nodes: the column switch (shown only when narrow) and the four columns. */
|
|
72
|
-
export function renderBoard(ctx) {
|
|
73
|
-
const { P, L, A } = ctx;
|
|
74
|
-
const wide = ctx.wide;
|
|
75
|
-
const shown = P.boardCol || 'todo';
|
|
76
|
-
const counts = Object.fromEntries(STATES.map((s) => [s, (L.board[s] || []).length]));
|
|
77
|
-
const sw = tabs({
|
|
78
|
-
variant: 'segmented', full: true, ariaLabel: COPY.columns, value: shown,
|
|
79
|
-
items: STATES.map((s) => ({ id: s, label: COPY.states[s], count: counts[s] })),
|
|
80
|
-
onChange: (c) => A.setBoardCol(c),
|
|
81
|
-
attrs: { class: 'bd-switch', 'data-bd-switch': '' },
|
|
82
|
-
});
|
|
83
|
-
for (const b of sw.querySelectorAll('[data-tab]')) b.setAttribute('data-fk', 'col:' + b.getAttribute('data-tab'));
|
|
84
|
-
|
|
85
|
-
const cols = STATES.map((s) => {
|
|
86
|
-
const allIds = L.board[s] || [];
|
|
87
|
-
const expanded = P.expandedCols || (P.expandedCols = new Set());
|
|
88
|
-
const isExpanded = expanded.has(s);
|
|
89
|
-
const showLimit = ctx.agenda ? 3 : Infinity;
|
|
90
|
-
const shownIds = isExpanded ? allIds : allIds.slice(0, showLimit);
|
|
91
|
-
const hasMore = allIds.length > showLimit;
|
|
92
|
-
const moreCount = allIds.length - showLimit;
|
|
93
|
-
|
|
94
|
-
const statusDot = el('span', { class: 'bd-col__dot bd-col__dot--' + s });
|
|
95
|
-
const colName = COPY.states[s];
|
|
96
|
-
const countBadge = badge({ text: String(counts[s]), tone: 'outline', attrs: { 'data-bd-col-count': s } });
|
|
97
|
-
|
|
98
|
-
const cards = shownIds.map((id) => boardCard(ctx, id, wide));
|
|
99
|
-
|
|
100
|
-
const moreButton = hasMore && !isExpanded
|
|
101
|
-
? button({
|
|
102
|
-
label: `Show ${moreCount} more`,
|
|
103
|
-
variant: 'ghost',
|
|
104
|
-
icon: 'chevron-down',
|
|
105
|
-
size: 'sm',
|
|
106
|
-
onClick: () => {
|
|
107
|
-
expanded.add(s);
|
|
108
|
-
A.rerender();
|
|
109
|
-
},
|
|
110
|
-
attrs: { 'data-bd-col-more': s, 'data-bd-show-more': '' },
|
|
111
|
-
})
|
|
112
|
-
: null;
|
|
113
|
-
|
|
114
|
-
return el('div', { class: 'bd-col' + (s === shown ? ' bd-col--shown' : ''), 'data-col-wrap': s },
|
|
115
|
-
ctx.agenda
|
|
116
|
-
? el('div', { class: 'bd-col__head' }, el('div', { class: 'bd-col__name' }, statusDot, el('span', null, colName)), countBadge)
|
|
117
|
-
: el('div', { class: 'bd-col__head' }, el('span', null, COPY.states[s]), el('span', { class: 'bd-col__n' }, '· ' + counts[s])),
|
|
118
|
-
s === 'done' && L.board.doneOlder > 0 ? el('div', { class: 'bd-col__older', 'data-bd-older': String(L.board.doneOlder) }, COPY.olderInTree(L.board.doneOlder)) : null,
|
|
119
|
-
// an empty column says so, so a blank area never reads as a failed load
|
|
120
|
-
!counts[s] && !(s === 'done' && L.board.doneOlder > 0) ? empty({ text: COPY.emptyColumn(COPY.states[s]), attrs: { 'data-bd-empty-col': s } }) : null,
|
|
121
|
-
// the list fills its column, so the whole column height takes a drop
|
|
122
|
-
el('div', { class: 'bd-col__list', 'data-col': s, 'aria-label': COPY.states[s] }, ...cards, moreButton));
|
|
123
|
-
});
|
|
124
|
-
return [sw, el('div', { class: 'bd-board' + (ctx.agenda ? ' bd-board--agenda' : ''), 'data-bd-board': wide ? 'wide' : 'narrow' }, cols)];
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* The column under the pointer when the card is dropped. Sortable moves the card only when the pointer is over another
|
|
129
|
-
* card or past the end of a list, so a drop in the gap between two cards would otherwise land in the last column the
|
|
130
|
-
* card passed through. The column under the pointer is the one the person chose.
|
|
131
|
-
*/
|
|
132
|
-
function columnUnder(P, e) {
|
|
133
|
-
const pt = e && e.changedTouches && e.changedTouches.length ? e.changedTouches[0] : e;
|
|
134
|
-
if (!pt || !Number.isFinite(pt.clientX) || !Number.isFinite(pt.clientY) || (pt.clientX === 0 && pt.clientY === 0)) return null;
|
|
135
|
-
const under = document.elementFromPoint(pt.clientX, pt.clientY);
|
|
136
|
-
const col = under && under.closest('[data-col-wrap]');
|
|
137
|
-
return col && P.root.contains(col) ? col.getAttribute('data-col-wrap') : null;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/** Attach Sortable to the four columns. Only when they are side by side: one column at a time has nowhere to drop. */
|
|
141
|
-
export function bindBoardDrag(ctx, Sortable, drags, baseOptions) {
|
|
142
|
-
const { P, A } = ctx;
|
|
143
|
-
if (!ctx.wide) return;
|
|
144
|
-
const group = 'bd-board:' + P.slug;
|
|
145
|
-
for (const list of P.bodyEl.querySelectorAll('[data-col]')) {
|
|
146
|
-
drags.add(new Sortable(list, baseOptions({
|
|
147
|
-
group, sort: false, draggable: '.bd-card',
|
|
148
|
-
onStart: () => { P.dragging = true; },
|
|
149
|
-
onEnd: (evt) => {
|
|
150
|
-
P.dragging = false;
|
|
151
|
-
const id = evt.item.getAttribute('data-item');
|
|
152
|
-
const from = evt.from && evt.from.getAttribute('data-col');
|
|
153
|
-
const to = columnUnder(P, evt.originalEvent) || (evt.to && evt.to.getAttribute('data-col'));
|
|
154
|
-
if (id && to && to !== from) A.moveTo(id, to);
|
|
155
|
-
else A.rerender();
|
|
156
|
-
},
|
|
157
|
-
})));
|
|
158
|
-
}
|
|
159
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/* pm/bd-drag.js — drag for the Breakdown, on the vendored SortableJS 1.15.7 (D86 point 1).
|
|
2
|
-
*
|
|
3
|
-
* Sortable is loaded on first use as a classic script from /vendor/Sortable.min.js (its UMD build sets window.Sortable).
|
|
4
|
-
* Drag is never the only way: every move it can make is also on the keyboard (Alt+ArrowUp/Down in the Tree) and in a
|
|
5
|
-
* menu or the item sheet's state buttons. If the script does not load, those paths still work and one warning is logged.
|
|
6
|
-
*
|
|
7
|
-
* Touch: a 150 ms hold starts a drag and a plain swipe scrolls (`delay` + `delayOnTouchOnly` + `touchStartThreshold`,
|
|
8
|
-
* and `touch-action: pan-y` on the grip in components.css, so a swipe that starts on a grip scrolls too).
|
|
9
|
-
* iOS Safari gets Sortable's own pointer fallback, because its native drag-and-drop does not start from a touch hold.
|
|
10
|
-
* The fallback clone stays inside its list (`fallbackOnBody: false`): appended to <body> it would sit outside
|
|
11
|
-
* [data-pm-theme] and the pane's font, and the PM would drag a dark slab of serif text in the light theme.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
export const IOS = typeof navigator !== 'undefined'
|
|
15
|
-
&& (/iP(hone|ad|od)/.test(navigator.userAgent) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1));
|
|
16
|
-
|
|
17
|
-
export const baseOptions = (extra) => ({
|
|
18
|
-
animation: 120, delay: 150, delayOnTouchOnly: true, touchStartThreshold: 5,
|
|
19
|
-
forceFallback: IOS, fallbackTolerance: 3, fallbackOnBody: false,
|
|
20
|
-
ghostClass: 'bd-ghost', chosenClass: 'bd-chosen', dragClass: 'bd-dragging', fallbackClass: 'bd-fallback',
|
|
21
|
-
...extra,
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
let loading = null;
|
|
25
|
-
let warned = false;
|
|
26
|
-
|
|
27
|
-
/** Resolve to the Sortable constructor, loading the vendored script once. Resolves to null when it cannot load. */
|
|
28
|
-
export function loadSortable() {
|
|
29
|
-
if (typeof window === 'undefined') return Promise.resolve(null);
|
|
30
|
-
if (window.Sortable) return Promise.resolve(window.Sortable);
|
|
31
|
-
if (!loading) {
|
|
32
|
-
loading = new Promise((resolve) => {
|
|
33
|
-
const s = document.createElement('script');
|
|
34
|
-
s.src = '/vendor/Sortable.min.js';
|
|
35
|
-
s.async = true;
|
|
36
|
-
s.onload = () => resolve(window.Sortable || null);
|
|
37
|
-
s.onerror = () => {
|
|
38
|
-
if (!warned) { warned = true; console.warn('[breakdown] drag is unavailable: /vendor/Sortable.min.js did not load. The keyboard and the menus still move items.'); }
|
|
39
|
-
loading = null;
|
|
40
|
-
resolve(null);
|
|
41
|
-
};
|
|
42
|
-
document.head.appendChild(s);
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
return loading;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Sortable instances for one pane, destroyed together before every rebuild. The DOM is always rebuilt from the model
|
|
50
|
-
* after a drop, so the list Sortable rearranged is never the one that stays on screen.
|
|
51
|
-
*/
|
|
52
|
-
export function dragSet() {
|
|
53
|
-
const all = [];
|
|
54
|
-
return {
|
|
55
|
-
add(inst) { if (inst) all.push(inst); return inst; },
|
|
56
|
-
destroy() { while (all.length) { const s = all.pop(); try { s.destroy(); } catch { /* already gone */ } } },
|
|
57
|
-
get size() { return all.length; },
|
|
58
|
-
};
|
|
59
|
-
}
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
/* pm/bd-model.js — local changes to a fetched Layout, so a write shows before the server answers (pm-os-absorb Run 1).
|
|
2
|
-
*
|
|
3
|
-
* The server's Layout (GET /api/plan-items) is the truth; these helpers only change a COPY of it in the page, the same
|
|
4
|
-
* way the server's fold would, so that an optimistic write or a held change (undo-hold.js) reads right on screen until
|
|
5
|
-
* the next fetch replaces it. `recount` rebuilds every derived list and count (stage items, progress, the Board columns,
|
|
6
|
-
* the 14-day Done window) from the items map with the server's rules, so the Board column always equals the row state.
|
|
7
|
-
* Nothing here is stored or sent (D33).
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
export const PM = 'pm:wawan';
|
|
11
|
-
const DAY = 86400000;
|
|
12
|
-
|
|
13
|
-
const todayUTC = (now) => new Date(now).toISOString().slice(0, 10);
|
|
14
|
-
|
|
15
|
-
/** Tree order inside a stage: order, then created, then id. */
|
|
16
|
-
export function treeOrder(items) {
|
|
17
|
-
return (a, b) => {
|
|
18
|
-
const x = items[a]; const y = items[b];
|
|
19
|
-
if (x.order !== y.order) return (x.order || 0) - (y.order || 0);
|
|
20
|
-
if ((x.createdAt || '') !== (y.createdAt || '')) return (x.createdAt || '') < (y.createdAt || '') ? -1 : 1;
|
|
21
|
-
return a < b ? -1 : a > b ? 1 : 0;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/** Rebuild the stage lists, counts, progress and Board columns from `L.items`. Returns L. */
|
|
26
|
-
export function recount(L) {
|
|
27
|
-
if (!L || !L.items) return L;
|
|
28
|
-
const by = Object.create(null);
|
|
29
|
-
for (const s of L.stages || []) by[s.id] = [];
|
|
30
|
-
const other = [];
|
|
31
|
-
const ids = Object.keys(L.items).filter((id) => L.items[id] && L.items[id].state !== 'withdrawn').sort(treeOrder(L.items));
|
|
32
|
-
for (const id of ids) (by[L.items[id].stage] || other).push(id);
|
|
33
|
-
let done = 0; let total = 0; let proposed = 0;
|
|
34
|
-
const count = (list) => {
|
|
35
|
-
let d = 0; let t = 0; let p = 0;
|
|
36
|
-
for (const id of list) { const it = L.items[id]; if (it.proposed) p++; else { t++; if (it.state === 'done') d++; } }
|
|
37
|
-
return { d, t, p };
|
|
38
|
-
};
|
|
39
|
-
for (const s of L.stages || []) {
|
|
40
|
-
const c = count(by[s.id]);
|
|
41
|
-
s.items = by[s.id]; s.done = c.d; s.total = c.t; s.proposed = c.p;
|
|
42
|
-
s.count = c.t ? `${c.d} of ${c.t}` : null;
|
|
43
|
-
s.visible = c.t > 0 || c.p > 0 || !!s.owed;
|
|
44
|
-
done += c.d; total += c.t; proposed += c.p;
|
|
45
|
-
}
|
|
46
|
-
const oc = count(other);
|
|
47
|
-
done += oc.d; total += oc.t; proposed += oc.p;
|
|
48
|
-
L.other = { items: other };
|
|
49
|
-
L.progress = { done, total, proposed, label: total ? `${done} of ${total}` : proposed ? `no breakdown · ${proposed} proposed` : 'no breakdown' };
|
|
50
|
-
const cut = Date.parse(L.now || new Date().toISOString()) - 14 * DAY;
|
|
51
|
-
const cols = { todo: [], doing: [], review: [], done: [] };
|
|
52
|
-
let older = 0;
|
|
53
|
-
const ordered = [...(L.stages || []).flatMap((s) => s.items), ...other];
|
|
54
|
-
for (const id of ordered) {
|
|
55
|
-
const it = L.items[id];
|
|
56
|
-
if (!cols[it.state]) continue;
|
|
57
|
-
if (it.state === 'done' && it.doneAt && Date.parse(it.doneAt) < cut) { older++; continue; }
|
|
58
|
-
cols[it.state].push(id);
|
|
59
|
-
}
|
|
60
|
-
L.board = { ...cols, doneOlder: older };
|
|
61
|
-
return L;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/** The label of a stage id ("Build"), or the id itself for a stage this profile does not have. */
|
|
65
|
-
export function stageLabel(L, id) {
|
|
66
|
-
const s = (L && L.stages || []).find((x) => x.id === id);
|
|
67
|
-
return s ? s.label : (id || '');
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/** A move to `to`, as the server's fold would record it for a PM move. */
|
|
71
|
-
export function moveLocal(L, id, to) {
|
|
72
|
-
const it = L && L.items[id];
|
|
73
|
-
if (!it) return L;
|
|
74
|
-
const at = new Date().toISOString();
|
|
75
|
-
it.state = to;
|
|
76
|
-
it.doneAt = to === 'done' ? at : null;
|
|
77
|
-
it.noEvidence = false;
|
|
78
|
-
it.override = it.owner === 'agent';
|
|
79
|
-
it.overrideShown = it.override;
|
|
80
|
-
it.movedBy = PM;
|
|
81
|
-
it.late = !!it.due && to !== 'done' && it.due < todayUTC(Date.now());
|
|
82
|
-
it.updatedBy = PM; it.updatedAt = at; it.byLabel = 'you';
|
|
83
|
-
return recount(L);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/** A `set` of fields. */
|
|
87
|
-
export function setLocal(L, id, fields) {
|
|
88
|
-
const it = L && L.items[id];
|
|
89
|
-
if (!it) return L;
|
|
90
|
-
Object.assign(it, fields);
|
|
91
|
-
if ('due' in fields) it.late = !!it.due && it.state !== 'done' && it.due < todayUTC(Date.now());
|
|
92
|
-
it.updatedBy = PM; it.updatedAt = new Date().toISOString(); it.byLabel = 'you';
|
|
93
|
-
return recount(L);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/** A `flagged` line. */
|
|
97
|
-
export function flagLocal(L, id, blocked, reason) {
|
|
98
|
-
const it = L && L.items[id];
|
|
99
|
-
if (!it) return L;
|
|
100
|
-
it.blocked = blocked ? { reason, by: PM, at: new Date().toISOString() } : null;
|
|
101
|
-
it.updatedBy = PM; it.byLabel = 'you';
|
|
102
|
-
return recount(L);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/** A `withdrawn` line: the item leaves every list. */
|
|
106
|
-
export function removeLocal(L, id) {
|
|
107
|
-
if (!L || !L.items[id]) return L;
|
|
108
|
-
delete L.items[id];
|
|
109
|
-
L.withdrawnCount = (L.withdrawnCount || 0) + 1;
|
|
110
|
-
for (const b of L.batches || []) b.items = (b.items || []).filter((x) => x !== id);
|
|
111
|
-
L.batches = (L.batches || []).filter((b) => b.items.length);
|
|
112
|
-
for (const b of L.batches) b.count = b.items.length;
|
|
113
|
-
return recount(L);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/** A `kept` line: the batch's items stop being proposed. */
|
|
117
|
-
export function keepLocal(L, by, ids) {
|
|
118
|
-
if (!L) return L;
|
|
119
|
-
for (const id of ids || []) { const it = L.items[id]; if (it && it.proposed) { it.proposed = false; it.kept = true; } }
|
|
120
|
-
L.batches = (L.batches || []).filter((b) => b.by !== by);
|
|
121
|
-
return recount(L);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/** A `planned` line drawn before the server has given it an id. */
|
|
125
|
-
export function planLocal(L, { tmpId, title, stage, order }) {
|
|
126
|
-
if (!L) return L;
|
|
127
|
-
const at = new Date().toISOString();
|
|
128
|
-
const max = Math.max(0, ...Object.values(L.items).filter((x) => x.stage === stage).map((x) => x.order || 0));
|
|
129
|
-
L.items[tmpId] = {
|
|
130
|
-
id: tmpId, initiative: L.initiative, title, stage, stageKnown: true, order: Number.isFinite(order) ? order : max + 1024,
|
|
131
|
-
owner: 'you', after: [], start: null, due: null, milestone: false, note: '', state: 'todo', blocked: null, evidence: null,
|
|
132
|
-
noEvidence: false, doneAt: null, movedBy: null, override: false, overrideShown: false, proposed: false, kept: false,
|
|
133
|
-
late: false, createdBy: PM, createdVia: 'ui', createdAt: at, updatedBy: PM, updatedVia: 'ui', updatedAt: at, byLabel: 'you',
|
|
134
|
-
history: [], pending: true,
|
|
135
|
-
};
|
|
136
|
-
return recount(L);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/** The order for a row placed between `prev` and `next` (either may be absent). Null when the gap is too small. */
|
|
140
|
-
export function orderBetween(prev, next) {
|
|
141
|
-
if (prev === null && next === null) return 1024;
|
|
142
|
-
if (prev === null) return next - 1024;
|
|
143
|
-
if (next === null) return prev + 1024;
|
|
144
|
-
const mid = (prev + next) / 2;
|
|
145
|
-
return Math.abs(next - prev) < 1e-6 || mid === prev || mid === next ? null : mid;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/** The order after every item of a stage. */
|
|
149
|
-
export function endOrder(L, stage) {
|
|
150
|
-
const list = Object.values(L.items).filter((x) => x.stage === stage).map((x) => x.order || 0);
|
|
151
|
-
return (list.length ? Math.max(...list) : 0) + 1024;
|
|
152
|
-
}
|
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
/* pm/bd-timeline.js — Breakdown › Timeline: an initiative's items on a time axis (pm-os-absorb Run 4, slice 4B; PRD R20,
|
|
2
|
-
* R8, R27).
|
|
3
|
-
*
|
|
4
|
-
* An extension (registry.js EXTENSIONS): loaded at boot, it only registers the view, and panel-breakdown.js shows it next
|
|
5
|
-
* to Tree and Board. Each dated item is one row whose bar runs from its start to its due; the rows are grouped by stage,
|
|
6
|
-
* under a first row for the whole initiative split by stage. A milestone shows a ◆ on its due date and every row carries
|
|
7
|
-
* the line for today. The spans come from lib/item-spans.js (window.PMOSItemSpans), the one engine Initiatives ›
|
|
8
|
-
* Timeline and the report's strip also read, and every bar is primitives.js `timelineBar`.
|
|
9
|
-
*
|
|
10
|
-
* Writes. Dragging a bar moves its dates and dragging its end changes the due date: each gesture is ONE `set` event
|
|
11
|
-
* through the pane's own write (breakdown-api.js postEvents), with the dates the item has (start and due, or only the
|
|
12
|
-
* one it has), and nothing else. No other item moves (no cascade) and nothing is counted in days of effort. A press with
|
|
13
|
-
* no movement opens the item sheet.
|
|
14
|
-
*
|
|
15
|
-
* Health (R8), as text and a dot on its own line under the dates, and on the bar as an outline: an item that starts
|
|
16
|
-
* before a predecessor ends is at risk and says which one; an overdue item is at risk; an overdue milestone is off track.
|
|
17
|
-
* On track shows nothing. A predecessor in another initiative counts only when the Layout carries its dates
|
|
18
|
-
* (`L.externalAfter`, asked of slice 4A in issues/run4-b.md); until then such a clash is not flagged here.
|
|
19
|
-
*
|
|
20
|
-
* Proposed items (an agent's proposals the PM has not kept) have a muted bar and the "Proposed" signal, and they never
|
|
21
|
-
* stretch a stage bar or the first row (item-spans.js).
|
|
22
|
-
*
|
|
23
|
-
* mount(host, ctx) is called on every render of the pane; it rebuilds only when the items it draws changed, and never
|
|
24
|
-
* while a bar is moving. Undated items are counted under the chart: their dates are set in the item sheet. On its first
|
|
25
|
-
* draw the chart scrolls so today shows.
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
import { el } from './dom.js';
|
|
29
|
-
import { registerBreakdownView } from './registry.js';
|
|
30
|
-
import { timelineBar, timelinePct, signal, empty } from './primitives.js';
|
|
31
|
-
import { COPY, shortDate, monthLabel } from './timeline-copy.js';
|
|
32
|
-
import { COPY as BD_COPY } from './breakdown-copy.js';
|
|
33
|
-
|
|
34
|
-
const SPANS = () => (typeof window !== 'undefined' ? window.PMOSItemSpans : null);
|
|
35
|
-
const DATE = /^\d{4}-\d{2}-\d{2}$/;
|
|
36
|
-
const views = new WeakMap(); // host -> { key, held, next }
|
|
37
|
-
|
|
38
|
-
/** Today as the server's Layout gives it (the day `late` was derived on), else the viewer's own calendar day. */
|
|
39
|
-
function todayOf(L) {
|
|
40
|
-
const n = L && typeof L.now === 'string' ? L.now.slice(0, 10) : '';
|
|
41
|
-
if (DATE.test(n)) return n;
|
|
42
|
-
const d = new Date();
|
|
43
|
-
return d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0');
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/** What the chart draws from: a change to any of it rebuilds the chart, anything else (a note, an owner) does not. */
|
|
47
|
-
function keyOf(L, today) {
|
|
48
|
-
const row = (it) => [it.id, it.title, it.stage, it.order, it.start, it.due, it.milestone, it.state, it.late, it.proposed, (it.after || []).join(' ')];
|
|
49
|
-
const items = Object.values((L && L.items) || {}).map(row);
|
|
50
|
-
const ext = Object.values((L && L.externalAfter) || {}).map(row);
|
|
51
|
-
return JSON.stringify([today, (L.stages || []).map((s) => [s.id, s.label]), items, ext]);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/** The R8 flag of one item's span, or null on track. */
|
|
55
|
-
function healthOf(span, it, known) {
|
|
56
|
-
if (it && it.late && it.milestone) return { health: 'off', text: COPY.milestoneOverdue(shortDate(it.due)) };
|
|
57
|
-
if (span.overlapsPredecessor && span.overlap) {
|
|
58
|
-
const p = known[span.overlap.id];
|
|
59
|
-
return { health: 'risk', text: COPY.overlap(p ? p.title : span.overlap.id, shortDate(span.overlap.due)) };
|
|
60
|
-
}
|
|
61
|
-
if (it && it.late) return { health: 'risk', text: COPY.overdue(shortDate(it.due)) };
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/** The fields one gesture writes: the dates the item has. A move of an item with only a due date writes only its due. */
|
|
66
|
-
function fieldsFor(it, c) {
|
|
67
|
-
if (c.mode === 'end') return { due: c.due };
|
|
68
|
-
const f = {};
|
|
69
|
-
if (it.start) f.start = c.start;
|
|
70
|
-
if (it.due) f.due = c.due;
|
|
71
|
-
if (!it.start && !it.due) { f.start = c.start; f.due = c.due; }
|
|
72
|
-
return f;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function row(kind, nameKids, bar, attrs) {
|
|
76
|
-
return el('div', { class: 'tl-row tl-row--' + kind, ...attrs }, el('div', { class: 'tl-name' }, ...nameKids), el('div', { class: 'tl-track' }, bar));
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function axisHead(axis, range, today) {
|
|
80
|
-
/* the month labels on the lower line, Today on the line above them: the two never cover each other */
|
|
81
|
-
const ticks = axis.months.map((m) => {
|
|
82
|
-
const t = el('span', { class: 'tl-month', 'data-month': m.month }, monthLabel(m.month));
|
|
83
|
-
t.style.setProperty('--tl-x', timelinePct(range, m.start).toFixed(3) + '%');
|
|
84
|
-
return t;
|
|
85
|
-
});
|
|
86
|
-
if (today >= range.start && today <= range.end) {
|
|
87
|
-
const x = timelinePct(range, today);
|
|
88
|
-
// the label sits to the right of the line, or to its left in the second half, so it stays inside the axis
|
|
89
|
-
const t = el('span', { class: 'tl-today' + (x > 50 ? ' tl-today--end' : ''), 'data-tl-today': today }, COPY.today);
|
|
90
|
-
t.style.setProperty('--tl-x', x.toFixed(3) + '%');
|
|
91
|
-
ticks.push(t);
|
|
92
|
-
}
|
|
93
|
-
return el('div', { class: 'tl-row tl-row--head', 'aria-hidden': 'true' }, el('div', { class: 'tl-name' }), el('div', { class: 'tl-axis' }, ...ticks));
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function build(host, ctx, V) {
|
|
97
|
-
const S = SPANS();
|
|
98
|
-
const L = ctx.layout || {};
|
|
99
|
-
const items = L.items || {};
|
|
100
|
-
const ext = L.externalAfter && typeof L.externalAfter === 'object' ? L.externalAfter : {};
|
|
101
|
-
const known = { ...ext, ...items };
|
|
102
|
-
const stages = L.stages || [];
|
|
103
|
-
const label = new Map(stages.map((s) => [s.id, s.label || s.id]));
|
|
104
|
-
const today = todayOf(L);
|
|
105
|
-
// a predecessor in another initiative is passed for the flag only: it gets no row here
|
|
106
|
-
const spans = S ? S.spansOf(known, { stages }).filter((s) => Object.prototype.hasOwnProperty.call(items, s.id)) : [];
|
|
107
|
-
const live = Object.values(items).filter((it) => it && it.state !== 'withdrawn');
|
|
108
|
-
const undated = live.filter((it) => !it.start && !it.due).length;
|
|
109
|
-
const note = undated ? el('p', { class: 'tl-note', 'data-tl-undated': String(undated) }, COPY.undated(undated)) : null;
|
|
110
|
-
if (!spans.length) return [empty({ text: COPY.noDates, attrs: { 'data-tl-empty': '' } }), note];
|
|
111
|
-
|
|
112
|
-
const axis = S.axisOf(spans, { today });
|
|
113
|
-
const range = { start: axis.start, end: axis.end };
|
|
114
|
-
const flags = new Map(spans.map((s) => [s.id, healthOf(s, items[s.id], known)]));
|
|
115
|
-
// the first row and the stage rows draw kept items only: a proposal nobody kept stretches nothing
|
|
116
|
-
const ms = (list) => list.filter((s) => s.milestone && !s.proposed).map((s) => ({ date: s.due, health: flags.get(s.id) ? flags.get(s.id).health : null }));
|
|
117
|
-
const rangeText = (g) => COPY.range(shortDate(g.start), shortDate(g.due));
|
|
118
|
-
const stageName = (id) => label.get(id) || id || '';
|
|
119
|
-
const rows = [axisHead(axis, range, today)];
|
|
120
|
-
|
|
121
|
-
/* the whole initiative, split by stage */
|
|
122
|
-
const whole = S.initiativeSpan(spans);
|
|
123
|
-
const parts = S.stageSpans(spans);
|
|
124
|
-
rows.push(row('all', [el('div', { class: 'tl-title' }, COPY.all), whole ? el('div', { class: 'tl-meta' }, rangeText(whole)) : null],
|
|
125
|
-
timelineBar({
|
|
126
|
-
label: [whole ? `${COPY.all}, ${rangeText(whole)}.` : COPY.all + '.', ...parts.map((g) => COPY.stageSpan(stageName(g.stage), rangeText(g)))].join(' '),
|
|
127
|
-
segments: parts.map((g) => ({ stage: g.stage, start: g.start, due: g.due })), milestones: ms(spans), range, today,
|
|
128
|
-
}), { 'data-tl-all': '' }));
|
|
129
|
-
|
|
130
|
-
/* each stage: its own span, then one row per item */
|
|
131
|
-
const drag = (s) => ({
|
|
132
|
-
onCommit: (c) => { const it = items[s.id]; if (it) ctx.setFields(s.id, fieldsFor(it, c)); },
|
|
133
|
-
onOpen: () => ctx.openItem(s.id),
|
|
134
|
-
onStart: () => { V.held = true; ctx.hold(true); },
|
|
135
|
-
onEnd: () => { V.held = false; ctx.hold(false); },
|
|
136
|
-
});
|
|
137
|
-
const groups = [...new Set(spans.map((s) => s.stage))];
|
|
138
|
-
for (const stage of groups) {
|
|
139
|
-
const mine = spans.filter((s) => s.stage === stage);
|
|
140
|
-
const g = parts.find((x) => x.stage === stage);
|
|
141
|
-
const name = stageName(stage);
|
|
142
|
-
rows.push(row('stage', [el('div', { class: 'tl-title' }, COPY.stageRow(name, mine.length))],
|
|
143
|
-
timelineBar({ label: COPY.stageRow(name, mine.length) + (g ? ', ' + rangeText(g) : ''), segments: g ? [{ stage, start: g.start, due: g.due }] : [], milestones: ms(mine), range, today }),
|
|
144
|
-
{ 'data-tl-stage': stage || '' }));
|
|
145
|
-
for (const s of mine) {
|
|
146
|
-
const it = items[s.id] || {};
|
|
147
|
-
const f = flags.get(s.id);
|
|
148
|
-
const when = rangeText(s);
|
|
149
|
-
const title = it.title || s.id;
|
|
150
|
-
const signals = [
|
|
151
|
-
f ? signal({ text: f.text, tone: f.health === 'off' ? 'destructive' : 'warning', wrap: true, attrs: { 'data-tl-health': f.health } }) : null,
|
|
152
|
-
s.proposed ? signal({ text: BD_COPY.signals.proposed, attrs: { 'data-tl-proposed': '' } }) : null,
|
|
153
|
-
].filter(Boolean);
|
|
154
|
-
rows.push(row('item', [
|
|
155
|
-
el('div', { class: 'tl-title' }, title),
|
|
156
|
-
el('div', { class: 'tl-meta' }, when),
|
|
157
|
-
signals.length ? el('div', { class: 'tl-flag' }, ...signals) : null,
|
|
158
|
-
], timelineBar({
|
|
159
|
-
label: title,
|
|
160
|
-
segments: [{
|
|
161
|
-
stage: s.stage, start: s.start, due: s.due, health: f ? f.health : null, done: it.state === 'done', muted: s.proposed,
|
|
162
|
-
label: COPY.bar(title, when, [f && f.text, s.milestone && COPY.milestone(shortDate(s.due)), s.proposed && BD_COPY.signals.proposed]),
|
|
163
|
-
}],
|
|
164
|
-
milestones: s.milestone ? [{ date: s.due, health: f ? f.health : null }] : [], range, today, drag: drag(s),
|
|
165
|
-
attrs: { 'data-tl-item': s.id },
|
|
166
|
-
}), { 'data-tl-row': s.id }));
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
const chart = el('div', { class: 'tl-chart', role: 'group', 'aria-label': COPY.chart, 'data-tl-range': range.start + '/' + range.end }, ...rows);
|
|
170
|
-
return [el('p', { class: 'tl-hint' }, COPY.hint), el('div', { class: 'tl-scroll', 'data-tl-scroll': '' }, chart), note];
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/** Scroll the chart so the Today label shows just right of the name column (the first draw only). */
|
|
174
|
-
function scrollToToday(host) {
|
|
175
|
-
const sc = host.querySelector('[data-tl-scroll]');
|
|
176
|
-
const t = host.querySelector('[data-tl-today]');
|
|
177
|
-
const name = host.querySelector('.tl-row--item .tl-name') || host.querySelector('.tl-name');
|
|
178
|
-
if (!sc || !t || !name || sc.scrollWidth <= sc.clientWidth) return;
|
|
179
|
-
const x = t.getBoundingClientRect().left - sc.getBoundingClientRect().left + sc.scrollLeft;
|
|
180
|
-
sc.scrollLeft = Math.max(0, x - name.getBoundingClientRect().width - 48);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
function mount(host, ctx) {
|
|
184
|
-
let V = views.get(host);
|
|
185
|
-
if (!V) {
|
|
186
|
-
V = { key: null, held: false, next: null };
|
|
187
|
-
views.set(host, V);
|
|
188
|
-
/* A move from the keyboard saves when the bar loses the focus, and that write draws the chart again inside the blur,
|
|
189
|
-
* so the element the focus was going to is gone. Remember which bar it was (blur does not bubble: listen in the
|
|
190
|
-
* capture phase, before the bar's own listener saves) and forget it once the blur is over. */
|
|
191
|
-
host.addEventListener('blur', (e) => {
|
|
192
|
-
const n = e.relatedTarget && host.contains(e.relatedTarget) && e.relatedTarget.closest ? e.relatedTarget.closest('[data-tl-item]') : null;
|
|
193
|
-
V.next = n ? n.getAttribute('data-tl-item') : null;
|
|
194
|
-
}, true);
|
|
195
|
-
host.addEventListener('focusout', () => { V.next = null; });
|
|
196
|
-
}
|
|
197
|
-
if (V.held) return; // never rebuild under a moving bar; the pane draws again when the gesture ends
|
|
198
|
-
const L = ctx.layout || {};
|
|
199
|
-
const key = keyOf(L, todayOf(L));
|
|
200
|
-
if (key === V.key && host.firstChild) return;
|
|
201
|
-
const first = V.key === null;
|
|
202
|
-
V.key = key;
|
|
203
|
-
// a bar moved from the keyboard keeps the focus across the rebuild; a bar saved by leaving it passes the focus on
|
|
204
|
-
const a = typeof document !== 'undefined' ? document.activeElement : null;
|
|
205
|
-
const inside = a && host.contains(a) && a.closest('[data-tl-item]');
|
|
206
|
-
const focusId = inside ? inside.getAttribute('data-tl-item') : V.next;
|
|
207
|
-
const scroll = host.querySelector('[data-tl-scroll]');
|
|
208
|
-
const left = scroll ? scroll.scrollLeft : 0;
|
|
209
|
-
host.replaceChildren(...build(host, ctx, V).filter(Boolean));
|
|
210
|
-
const s2 = host.querySelector('[data-tl-scroll]');
|
|
211
|
-
if (s2 && left) s2.scrollLeft = left;
|
|
212
|
-
if (first && typeof requestAnimationFrame === 'function') requestAnimationFrame(() => scrollToToday(host));
|
|
213
|
-
if (focusId) {
|
|
214
|
-
const sel = '[data-tl-item="' + (window.CSS && CSS.escape ? CSS.escape(focusId) : focusId) + '"] button';
|
|
215
|
-
const b = host.querySelector(sel);
|
|
216
|
-
if (b) b.focus({ preventScroll: true });
|
|
217
|
-
// if the browser finishes the blur by dropping the focus on the page, put it on the bar after the blur
|
|
218
|
-
if (!inside) {
|
|
219
|
-
setTimeout(() => {
|
|
220
|
-
const cur = document.activeElement;
|
|
221
|
-
const again = host.querySelector(sel);
|
|
222
|
-
if (again && (!cur || cur === document.body)) again.focus({ preventScroll: true });
|
|
223
|
-
}, 0);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
function dispose(host) {
|
|
229
|
-
views.delete(host);
|
|
230
|
-
host.replaceChildren();
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
registerBreakdownView('timeline', { label: COPY.view, mount, dispose });
|