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.
Files changed (515) hide show
  1. package/package.json +30 -25
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/briefing-premium-adddoc-test.js +19 -15
  7. package/workspace/briefing-premium-board-test.js +82 -50
  8. package/workspace/briefing-premium-calendar-2-test.js +36 -36
  9. package/workspace/briefing-premium-calendar-3-test.js +39 -39
  10. package/workspace/briefing-premium-calendar-test.js +23 -24
  11. package/workspace/briefing-premium-doc-edit-test.js +8 -10
  12. package/workspace/briefing-premium-initiative-test.js +38 -16
  13. package/workspace/briefing-premium-insights-test.js +114 -37
  14. package/workspace/briefing-premium-metrics-test.js +6 -4
  15. package/workspace/briefing-premium-products-test.js +10 -7
  16. package/workspace/briefing-premium-sources-test.js +25 -22
  17. package/workspace/briefing-premium-test.js +48 -43
  18. package/workspace/briefing-premium-work-test.js +16 -11
  19. package/workspace/c3-capture-test.js +0 -17
  20. package/workspace/changelog.json +29 -0
  21. package/workspace/ev-everywhere-test.js +210 -0
  22. package/workspace/fixtures/premium-viewer-fixtures.js +11 -6
  23. package/workspace/guide/briefing-premium.md +2 -2
  24. package/workspace/guide/home.md +58 -19
  25. package/workspace/guide/index.md +1 -1
  26. package/workspace/guide/layout.md +2 -2
  27. package/workspace/guide/notes.md +2 -2
  28. package/workspace/guide/phone-companion.md +1 -1
  29. package/workspace/lib/board-grill.js +63 -0
  30. package/workspace/lib/board-premium.js +36 -5
  31. package/workspace/lib/initiative-layout.js +77 -0
  32. package/workspace/lib/insights-premium.js +3 -2
  33. package/workspace/lib/insights-records.js +21 -7
  34. package/workspace/lib/meeting-points.js +52 -0
  35. package/workspace/lib/news-for-you.js +88 -0
  36. package/workspace/lib/notes-series.js +29 -6
  37. package/workspace/lib/report-confirm.js +48 -0
  38. package/workspace/lib/route-modules.js +9 -9
  39. package/workspace/lib/routes-board-docs.js +46 -0
  40. package/workspace/lib/routes-board-grill.js +90 -0
  41. package/workspace/lib/routes-home-review.js +108 -0
  42. package/workspace/lib/routes-initiative-layout.js +57 -0
  43. package/workspace/lib/routes-insights-premium.js +4 -1
  44. package/workspace/lib/routes-insights-records.js +8 -4
  45. package/workspace/lib/routes-meeting-points.js +37 -0
  46. package/workspace/lib/routes-news.js +57 -0
  47. package/workspace/lib/routes-notes.js +2 -1
  48. package/workspace/lib/routes-phone-day.js +18 -9
  49. package/workspace/lib/routes-report-confirm.js +31 -0
  50. package/workspace/lib/routes-search.js +38 -0
  51. package/workspace/lib/routes-slash.js +95 -0
  52. package/workspace/lib/search-index.js +176 -0
  53. package/workspace/package-lock.json +2 -2
  54. package/workspace/package.json +1 -2
  55. package/workspace/premium-board-actions-test.js +86 -50
  56. package/workspace/premium-briefing-depth-test.js +55 -54
  57. package/workspace/premium-chat-chart-tab-test.js +4 -2
  58. package/workspace/premium-chat-goal-view-test.js +1 -1
  59. package/workspace/premium-chat-report-tab-test.js +16 -2
  60. package/workspace/premium-chat-term-test.js +0 -10
  61. package/workspace/premium-core-doc-issue-test.js +15 -13
  62. package/workspace/premium-menu-rows-test.js +1 -1
  63. package/workspace/premium-phone-card-test.js +7 -5
  64. package/workspace/premium-report-read-test.js +55 -18
  65. package/workspace/premium-vw-backlog-test.js +2 -2
  66. package/workspace/premium-vw-cal-test.js +50 -35
  67. package/workspace/premium-vw-doc-test.js +10 -11
  68. package/workspace/premium-vw-item-test.js +1 -1
  69. package/workspace/premium-vw-jira-test.js +2 -2
  70. package/workspace/premium-vw-meet-test.js +37 -40
  71. package/workspace/premium-vw-notes-test.js +21 -19
  72. package/workspace/premium-vw-rec-test.js +11 -12
  73. package/workspace/premium-welcome-test.js +3 -3
  74. package/workspace/premium-work-depth-test.js +5 -6
  75. package/workspace/public/capture.html +23 -0
  76. package/workspace/public/pm/bd-acts.js +303 -225
  77. package/workspace/public/pm/bd-asks.js +261 -0
  78. package/workspace/public/pm/bd-pop.js +59 -0
  79. package/workspace/public/pm/bd-span.js +49 -13
  80. package/workspace/public/pm/bd-views.js +169 -0
  81. package/workspace/public/pm/c3-base.js +47 -0
  82. package/workspace/public/pm/c3-capture.js +1 -1
  83. package/workspace/public/pm/c3-ini-ui.js +1 -1
  84. package/workspace/public/pm/c3-sheet.js +1 -1
  85. package/workspace/public/pm/c3-toast.js +1 -1
  86. package/workspace/public/pm/console3.css +3 -0
  87. package/workspace/public/pm/cozy-board.css +301 -0
  88. package/workspace/public/pm/cozy-ev.css +228 -0
  89. package/workspace/public/pm/cozy-evmodel.js +106 -0
  90. package/workspace/public/pm/cozy-evui.js +47 -0
  91. package/workspace/public/pm/cozy-home.css +20 -5
  92. package/workspace/public/pm/cozy-insights.css +148 -10
  93. package/workspace/public/pm/cozy-nav.js +103 -39
  94. package/workspace/public/pm/cozy-news.js +140 -0
  95. package/workspace/public/pm/cozy-search.js +203 -0
  96. package/workspace/public/pm/cozy-settings.js +198 -0
  97. package/workspace/public/pm/cozy-sources.js +89 -0
  98. package/workspace/public/pm/cozy-today.css +220 -0
  99. package/workspace/public/pm/cozy-viewer.js +5 -2
  100. package/workspace/public/pm/cozy-vw-mtg.css +350 -0
  101. package/workspace/public/pm/cozy-vw-rp.css +152 -0
  102. package/workspace/public/pm/cozy.css +9 -0
  103. package/workspace/public/pm/goal-chat.js +5 -1
  104. package/workspace/public/pm/home-adddoc.js +5 -5
  105. package/workspace/public/pm/home-app.js +365 -70
  106. package/workspace/public/pm/home-around.js +24 -126
  107. package/workspace/public/pm/home-chat.js +77 -18
  108. package/workspace/public/pm/home-data.js +9 -7
  109. package/workspace/public/pm/home-dictate.js +57 -0
  110. package/workspace/public/pm/home-draft.js +6 -6
  111. package/workspace/public/pm/home-ini-model.js +190 -0
  112. package/workspace/public/pm/home-ini.css +171 -0
  113. package/workspace/public/pm/home-ini.js +466 -0
  114. package/workspace/public/pm/home-list.js +289 -0
  115. package/workspace/public/pm/home-more.js +18 -135
  116. package/workspace/public/pm/home-phone-card.js +13 -8
  117. package/workspace/public/pm/home-review.js +103 -0
  118. package/workspace/public/pm/home-task.js +67 -0
  119. package/workspace/public/pm/home-today.js +148 -0
  120. package/workspace/public/pm/home-work.js +63 -28
  121. package/workspace/public/pm/note-dock.js +1 -2
  122. package/workspace/public/pm/notes-links.js +1 -2
  123. package/workspace/public/pm/notes-task.js +3 -4
  124. package/workspace/public/pm/premium-board.js +164 -40
  125. package/workspace/public/pm/premium-chart-tab.js +4 -5
  126. package/workspace/public/pm/premium-first.js +5 -7
  127. package/workspace/public/pm/premium-initiative-head.js +3 -3
  128. package/workspace/public/pm/premium-insights.js +499 -202
  129. package/workspace/public/pm/premium-mtg-present.js +138 -0
  130. package/workspace/public/pm/premium-mtg-replay.js +142 -0
  131. package/workspace/public/pm/premium-report-read.js +216 -52
  132. package/workspace/public/pm/premium-report-tab.js +44 -19
  133. package/workspace/public/pm/premium-shell.js +7 -7
  134. package/workspace/public/pm/premium-vw-cal.js +150 -60
  135. package/workspace/public/pm/premium-vw-doc.css +20 -2
  136. package/workspace/public/pm/premium-vw-doc.js +22 -7
  137. package/workspace/public/pm/premium-vw-mtg.js +488 -261
  138. package/workspace/public/pm/premium-vw-notes.js +61 -0
  139. package/workspace/public/pm/rp-parts.js +269 -0
  140. package/workspace/public/pm/view-notes.js +2 -2
  141. package/workspace/public/premium-board.html +4 -3
  142. package/workspace/public/premium-insights.html +10 -10
  143. package/workspace/public/premium.html +3 -1
  144. package/workspace/r/m1.png +0 -0
  145. package/workspace/r/m2.png +0 -0
  146. package/workspace/r/m3.png +0 -0
  147. package/workspace/r/nl.png +0 -0
  148. package/workspace/replaced-tests.json +435 -0
  149. package/workspace/run-tests.js +323 -28
  150. package/workspace/server.js +15 -10
  151. package/workspace/test-files.json +3 -140
  152. package/workspace/test-lists/base.json +1 -2
  153. package/workspace/test-lists/c3-desktop-light-load.json +1 -2
  154. package/workspace/test-lists/c3-initiative-boards.json +1 -2
  155. package/workspace/test-lists/c3-meeting-focus.json +2 -12
  156. package/workspace/test-lists/c3-work-agent.json +1 -2
  157. package/workspace/test-lists/calendar-tidy-up.json +1 -2
  158. package/workspace/test-lists/console3-reports.json +1 -2
  159. package/workspace/test-lists/docs-three-way-sync.json +1 -2
  160. package/workspace/test-lists/extension-capture.json +5 -0
  161. package/workspace/test-lists/initiative-layout.json +9 -0
  162. package/workspace/test-lists/jira-wbs.json +1 -2
  163. package/workspace/test-lists/legacy-cleanup-a.json +9 -0
  164. package/workspace/test-lists/meeting-material.json +1 -2
  165. package/workspace/test-lists/meeting-notes.json +2 -36
  166. package/workspace/test-lists/meeting-replay.json +1 -2
  167. package/workspace/test-lists/mm-capture.json +2 -12
  168. package/workspace/test-lists/my-work.json +2 -10
  169. package/workspace/test-lists/onboarding-firstrun.json +2 -12
  170. package/workspace/test-lists/people-directory.json +1 -2
  171. package/workspace/test-lists/premium-uncovered-meetings.json +9 -0
  172. package/workspace/test-lists/premium-uncovered-reports.json +9 -0
  173. package/workspace/test-lists/run2-a.json +1 -2
  174. package/workspace/test-lists/run2-d.json +2 -19
  175. package/workspace/test-lists/run3-b.json +1 -2
  176. package/workspace/test-lists/run3-c.json +2 -12
  177. package/workspace/test-lists/run4-b.json +1 -2
  178. package/workspace/test-lists/run4-d.json +1 -5
  179. package/workspace/test-lists/run5-c.json +1 -11
  180. package/workspace/test-lists/run6.json +1 -5
  181. package/workspace/test-lists/uf-everywhere.json +15 -0
  182. package/workspace/test-lists/uf-home.json +9 -0
  183. package/workspace/test-lists/uncovered-board.json +9 -0
  184. package/workspace/test-lists/workspace-launch-flags.json +2 -12
  185. package/workspace/test-lists/workspace-profile-detection.json +2 -10
  186. package/workspace/test-timings.json +242 -123
  187. package/workspace/c3-briefing-test.js +0 -136
  188. package/workspace/c3-core-docs-test.js +0 -170
  189. package/workspace/c3-driver-fixture.js +0 -64
  190. package/workspace/c3-driver-test.js +0 -169
  191. package/workspace/c3-foundation-test.js +0 -163
  192. package/workspace/c3-ib-items-test.js +0 -114
  193. package/workspace/c3-ib-more-test.js +0 -146
  194. package/workspace/c3-ib-triage-backlog-test.js +0 -128
  195. package/workspace/c3-ini-harness.js +0 -66
  196. package/workspace/c3-ini-life-test.js +0 -167
  197. package/workspace/c3-initiatives-test.js +0 -186
  198. package/workspace/c3-light-load-test.js +0 -112
  199. package/workspace/c3-one-home-test.js +0 -149
  200. package/workspace/c3-phone-test.js +0 -289
  201. package/workspace/c3-quiet-test.js +0 -157
  202. package/workspace/c3-report-design-real-test.js +0 -264
  203. package/workspace/c3-report-design-test.js +0 -442
  204. package/workspace/c3-report-setup-test.js +0 -192
  205. package/workspace/c3-report-structure-real-test.js +0 -248
  206. package/workspace/c3-report-structure-test.js +0 -397
  207. package/workspace/c3-reports-test.js +0 -288
  208. package/workspace/c3-scan-test.js +0 -517
  209. package/workspace/c3-sessions-panel-test.js +0 -365
  210. package/workspace/c3-settings-test.js +0 -204
  211. package/workspace/c3-updates-test.js +0 -131
  212. package/workspace/c3-work-test.js +0 -260
  213. package/workspace/cut-stub.js +0 -40
  214. package/workspace/first-paint-audit.js +0 -160
  215. package/workspace/lib/c3-full-console.js +0 -15
  216. package/workspace/lib/engine/derived/trust.js +0 -3
  217. package/workspace/lib/engine/plan-forecast.js +0 -342
  218. package/workspace/lib/engine/report-families.js +0 -175
  219. package/workspace/lib/engine/truth-table.js +0 -57
  220. package/workspace/lib/routes-c3-init.js +0 -54
  221. package/workspace/lib/routes-c3-life.js +0 -120
  222. package/workspace/lib/routes-c3-timeline.js +0 -192
  223. package/workspace/lib/routes-forecast.js +0 -86
  224. package/workspace/lib/routes-releases.js +0 -130
  225. package/workspace/lib/routes-report-facts.js +0 -85
  226. package/workspace/lib/routes-report-families.js +0 -33
  227. package/workspace/lib/routes-signals.js +0 -51
  228. package/workspace/lib/routes-timeline.js +0 -197
  229. package/workspace/public/c3.html +0 -35
  230. package/workspace/public/index.html +0 -156
  231. package/workspace/public/pm/app.js +0 -831
  232. package/workspace/public/pm/bd-board.js +0 -159
  233. package/workspace/public/pm/bd-drag.js +0 -59
  234. package/workspace/public/pm/bd-model.js +0 -152
  235. package/workspace/public/pm/bd-timeline.js +0 -233
  236. package/workspace/public/pm/bd-tree.js +0 -244
  237. package/workspace/public/pm/board-copy.js +0 -59
  238. package/workspace/public/pm/board-read.js +0 -38
  239. package/workspace/public/pm/branches-sheet.js +0 -56
  240. package/workspace/public/pm/breakdown-api.js +0 -58
  241. package/workspace/public/pm/breakdown-copy.js +0 -138
  242. package/workspace/public/pm/briefing-deck.js +0 -441
  243. package/workspace/public/pm/briefing-model.js +0 -251
  244. package/workspace/public/pm/c3-ambient.js +0 -100
  245. package/workspace/public/pm/c3-audience-link.js +0 -21
  246. package/workspace/public/pm/c3-audience.js +0 -46
  247. package/workspace/public/pm/c3-boot.js +0 -13
  248. package/workspace/public/pm/c3-breakdown.js +0 -240
  249. package/workspace/public/pm/c3-brief-data.js +0 -11
  250. package/workspace/public/pm/c3-brief-mentions.js +0 -137
  251. package/workspace/public/pm/c3-brief-needs.js +0 -288
  252. package/workspace/public/pm/c3-brief-pulse.js +0 -112
  253. package/workspace/public/pm/c3-brief-summary.js +0 -139
  254. package/workspace/public/pm/c3-brief-today.js +0 -79
  255. package/workspace/public/pm/c3-brief.js +0 -279
  256. package/workspace/public/pm/c3-cal-strategy.js +0 -529
  257. package/workspace/public/pm/c3-calendar.js +0 -965
  258. package/workspace/public/pm/c3-calpop.js +0 -111
  259. package/workspace/public/pm/c3-case.js +0 -196
  260. package/workspace/public/pm/c3-core-docs.css +0 -18
  261. package/workspace/public/pm/c3-core-docs.js +0 -236
  262. package/workspace/public/pm/c3-daypart.js +0 -176
  263. package/workspace/public/pm/c3-demo-boards.js +0 -764
  264. package/workspace/public/pm/c3-demo-brief-ix.js +0 -350
  265. package/workspace/public/pm/c3-demo-brief-page.js +0 -70
  266. package/workspace/public/pm/c3-demo-cal-ix.js +0 -74
  267. package/workspace/public/pm/c3-demo-cal2.js +0 -66
  268. package/workspace/public/pm/c3-demo-cal3.js +0 -173
  269. package/workspace/public/pm/c3-demo-cal4.js +0 -169
  270. package/workspace/public/pm/c3-demo-cal5.js +0 -52
  271. package/workspace/public/pm/c3-demo-coredocs.js +0 -221
  272. package/workspace/public/pm/c3-demo-data.js +0 -552
  273. package/workspace/public/pm/c3-demo-focus.js +0 -181
  274. package/workspace/public/pm/c3-demo-init.js +0 -430
  275. package/workspace/public/pm/c3-demo-life.js +0 -77
  276. package/workspace/public/pm/c3-demo-material.js +0 -58
  277. package/workspace/public/pm/c3-demo-misc2.js +0 -34
  278. package/workspace/public/pm/c3-demo-phone.js +0 -48
  279. package/workspace/public/pm/c3-demo-plan2.js +0 -30
  280. package/workspace/public/pm/c3-demo-rd.js +0 -432
  281. package/workspace/public/pm/c3-demo-rep-ix.js +0 -126
  282. package/workspace/public/pm/c3-demo-rep2.js +0 -130
  283. package/workspace/public/pm/c3-demo-rep3.js +0 -138
  284. package/workspace/public/pm/c3-demo-rs.js +0 -287
  285. package/workspace/public/pm/c3-demo-term.js +0 -153
  286. package/workspace/public/pm/c3-demo-time.js +0 -49
  287. package/workspace/public/pm/c3-demo-work-ix.js +0 -32
  288. package/workspace/public/pm/c3-demo.js +0 -131
  289. package/workspace/public/pm/c3-design-studio.js +0 -369
  290. package/workspace/public/pm/c3-doc-formats.js +0 -153
  291. package/workspace/public/pm/c3-doc-sheet.js +0 -1230
  292. package/workspace/public/pm/c3-dock.js +0 -206
  293. package/workspace/public/pm/c3-docs.js +0 -291
  294. package/workspace/public/pm/c3-driver-work.js +0 -110
  295. package/workspace/public/pm/c3-driver.css +0 -18
  296. package/workspace/public/pm/c3-driver.js +0 -298
  297. package/workspace/public/pm/c3-focus.css +0 -304
  298. package/workspace/public/pm/c3-focus.js +0 -983
  299. package/workspace/public/pm/c3-ib-docs.js +0 -92
  300. package/workspace/public/pm/c3-ib-initiatives.js +0 -201
  301. package/workspace/public/pm/c3-ib-items.js +0 -210
  302. package/workspace/public/pm/c3-ib-releases.js +0 -48
  303. package/workspace/public/pm/c3-ib-sprints.js +0 -201
  304. package/workspace/public/pm/c3-ib-triage.js +0 -177
  305. package/workspace/public/pm/c3-ii-tabs.js +0 -252
  306. package/workspace/public/pm/c3-ini-life.css +0 -34
  307. package/workspace/public/pm/c3-ini-life.js +0 -379
  308. package/workspace/public/pm/c3-ini-records.js +0 -197
  309. package/workspace/public/pm/c3-ini-timeline.js +0 -278
  310. package/workspace/public/pm/c3-ini-work.js +0 -139
  311. package/workspace/public/pm/c3-init-extras.js +0 -170
  312. package/workspace/public/pm/c3-initiatives.js +0 -852
  313. package/workspace/public/pm/c3-lifecycle-panels.js +0 -479
  314. package/workspace/public/pm/c3-look.js +0 -27
  315. package/workspace/public/pm/c3-material.css +0 -22
  316. package/workspace/public/pm/c3-material.js +0 -321
  317. package/workspace/public/pm/c3-md.js +0 -3
  318. package/workspace/public/pm/c3-misc-panels.js +0 -89
  319. package/workspace/public/pm/c3-new-session.js +0 -110
  320. package/workspace/public/pm/c3-notes.js +0 -751
  321. package/workspace/public/pm/c3-phone-boot.js +0 -47
  322. package/workspace/public/pm/c3-phone-detail.js +0 -97
  323. package/workspace/public/pm/c3-phone-model.js +0 -3
  324. package/workspace/public/pm/c3-phone.css +0 -66
  325. package/workspace/public/pm/c3-phone.js +0 -444
  326. package/workspace/public/pm/c3-plan-panels.js +0 -163
  327. package/workspace/public/pm/c3-plan.js +0 -193
  328. package/workspace/public/pm/c3-quiet.css +0 -113
  329. package/workspace/public/pm/c3-quiet.js +0 -177
  330. package/workspace/public/pm/c3-replay.css +0 -133
  331. package/workspace/public/pm/c3-replay.js +0 -429
  332. package/workspace/public/pm/c3-report-deck.css +0 -163
  333. package/workspace/public/pm/c3-report-deck.js +0 -598
  334. package/workspace/public/pm/c3-report-frame.css +0 -20
  335. package/workspace/public/pm/c3-report-print.css +0 -20
  336. package/workspace/public/pm/c3-report-setup.css +0 -67
  337. package/workspace/public/pm/c3-report-setup.js +0 -298
  338. package/workspace/public/pm/c3-report-store.js +0 -244
  339. package/workspace/public/pm/c3-report-structure.css +0 -44
  340. package/workspace/public/pm/c3-report-structure.js +0 -473
  341. package/workspace/public/pm/c3-reports.css +0 -68
  342. package/workspace/public/pm/c3-reports.js +0 -377
  343. package/workspace/public/pm/c3-roadmap.js +0 -249
  344. package/workspace/public/pm/c3-scan-api.js +0 -167
  345. package/workspace/public/pm/c3-scan-next.js +0 -248
  346. package/workspace/public/pm/c3-scan-setup.js +0 -313
  347. package/workspace/public/pm/c3-scan-words.js +0 -41
  348. package/workspace/public/pm/c3-scan.css +0 -74
  349. package/workspace/public/pm/c3-scan.js +0 -93
  350. package/workspace/public/pm/c3-session-chat.js +0 -103
  351. package/workspace/public/pm/c3-session-conv.js +0 -165
  352. package/workspace/public/pm/c3-session-term.js +0 -216
  353. package/workspace/public/pm/c3-settings.css +0 -85
  354. package/workspace/public/pm/c3-settings.js +0 -1045
  355. package/workspace/public/pm/c3-shell.js +0 -628
  356. package/workspace/public/pm/c3-signals.js +0 -196
  357. package/workspace/public/pm/c3-strategy-panels.js +0 -45
  358. package/workspace/public/pm/c3-swipe.js +0 -230
  359. package/workspace/public/pm/c3-terminal-data.js +0 -48
  360. package/workspace/public/pm/c3-terminal-edge.js +0 -91
  361. package/workspace/public/pm/c3-terminal-icons.js +0 -40
  362. package/workspace/public/pm/c3-terminal-results.js +0 -141
  363. package/workspace/public/pm/c3-terminal.js +0 -52
  364. package/workspace/public/pm/c3-tickets.js +0 -163
  365. package/workspace/public/pm/c3-timeline.js +0 -201
  366. package/workspace/public/pm/calendar-views.js +0 -1049
  367. package/workspace/public/pm/console3-lift.md +0 -220
  368. package/workspace/public/pm/cozy-home.js +0 -172
  369. package/workspace/public/pm/cozy-initiative.css +0 -138
  370. package/workspace/public/pm/cycle-review.js +0 -125
  371. package/workspace/public/pm/data.js +0 -1577
  372. package/workspace/public/pm/dest-board.js +0 -444
  373. package/workspace/public/pm/dest-docs.js +0 -530
  374. package/workspace/public/pm/dest-initiatives.js +0 -162
  375. package/workspace/public/pm/dest-mywork.js +0 -307
  376. package/workspace/public/pm/dest-notes.js +0 -537
  377. package/workspace/public/pm/dest-people.js +0 -449
  378. package/workspace/public/pm/dest-reports.js +0 -383
  379. package/workspace/public/pm/dest-settings.js +0 -601
  380. package/workspace/public/pm/dest-today.js +0 -267
  381. package/workspace/public/pm/display-word.js +0 -56
  382. package/workspace/public/pm/doc-editor.js +0 -473
  383. package/workspace/public/pm/doc-graph.js +0 -272
  384. package/workspace/public/pm/doc-health-panel.js +0 -110
  385. package/workspace/public/pm/doc-rail.js +0 -167
  386. package/workspace/public/pm/doc-remote.js +0 -180
  387. package/workspace/public/pm/dock-sessions.js +0 -472
  388. package/workspace/public/pm/dock.js +0 -216
  389. package/workspace/public/pm/fixture.js +0 -821
  390. package/workspace/public/pm/flag-picker.js +0 -104
  391. package/workspace/public/pm/frame-copy.js +0 -278
  392. package/workspace/public/pm/freshness-line.js +0 -149
  393. package/workspace/public/pm/handoff-box.js +0 -82
  394. package/workspace/public/pm/initiative-list.js +0 -235
  395. package/workspace/public/pm/initiative-sheet.js +0 -331
  396. package/workspace/public/pm/initiatives-api.js +0 -95
  397. package/workspace/public/pm/initiatives-copy.js +0 -287
  398. package/workspace/public/pm/initiatives-timeline-copy.js +0 -59
  399. package/workspace/public/pm/initiatives-timeline.js +0 -410
  400. package/workspace/public/pm/initiatives-ui.js +0 -291
  401. package/workspace/public/pm/item-sheet.js +0 -268
  402. package/workspace/public/pm/keep-card.js +0 -204
  403. package/workspace/public/pm/lifecycle-lens-model.js +0 -246
  404. package/workspace/public/pm/lifecycle-lens.js +0 -276
  405. package/workspace/public/pm/lifecycle.js +0 -111
  406. package/workspace/public/pm/mobile.css +0 -366
  407. package/workspace/public/pm/mobile.js +0 -581
  408. package/workspace/public/pm/modes-live.js +0 -453
  409. package/workspace/public/pm/modes.js +0 -147
  410. package/workspace/public/pm/my-work-card.js +0 -51
  411. package/workspace/public/pm/my-work-data.js +0 -36
  412. package/workspace/public/pm/new-initiative-sheet.js +0 -169
  413. package/workspace/public/pm/next-step-ui.js +0 -190
  414. package/workspace/public/pm/outbox-panel.js +0 -125
  415. package/workspace/public/pm/palette-copy.js +0 -55
  416. package/workspace/public/pm/palette.js +0 -343
  417. package/workspace/public/pm/panel-breakdown.js +0 -702
  418. package/workspace/public/pm/panel-cockpit.js +0 -425
  419. package/workspace/public/pm/panel-detail.js +0 -1513
  420. package/workspace/public/pm/panel-initiatives.js +0 -929
  421. package/workspace/public/pm/panel-newsess.js +0 -709
  422. package/workspace/public/pm/panel-repos.js +0 -741
  423. package/workspace/public/pm/panel-tabs.js +0 -1506
  424. package/workspace/public/pm/panel-trees.js +0 -204
  425. package/workspace/public/pm/people-link.js +0 -106
  426. package/workspace/public/pm/phone-deck.js +0 -167
  427. package/workspace/public/pm/pm-work-view.js +0 -1533
  428. package/workspace/public/pm/portfolio-report.js +0 -61
  429. package/workspace/public/pm/premium-acts.js +0 -280
  430. package/workspace/public/pm/premium-brief.js +0 -111
  431. package/workspace/public/pm/premium-chat.js +0 -22
  432. package/workspace/public/pm/premium-doc-sheet.js +0 -312
  433. package/workspace/public/pm/premium-initiative.js +0 -324
  434. package/workspace/public/pm/premium-insights.css +0 -228
  435. package/workspace/public/pm/premium-metric-tiles.js +0 -68
  436. package/workspace/public/pm/premium-report-brief.js +0 -132
  437. package/workspace/public/pm/premium-vw-rec.js +0 -67
  438. package/workspace/public/pm/premium-wide.css +0 -30
  439. package/workspace/public/pm/print.css +0 -44
  440. package/workspace/public/pm/provider-cards.js +0 -136
  441. package/workspace/public/pm/registry.js +0 -203
  442. package/workspace/public/pm/release-card.js +0 -110
  443. package/workspace/public/pm/releases-view.js +0 -248
  444. package/workspace/public/pm/report-families-view.js +0 -505
  445. package/workspace/public/pm/report-slides.js +0 -438
  446. package/workspace/public/pm/report-tab.js +0 -33
  447. package/workspace/public/pm/report-view.js +0 -337
  448. package/workspace/public/pm/reports-copy.js +0 -134
  449. package/workspace/public/pm/roadmap.js +0 -294
  450. package/workspace/public/pm/run-card.js +0 -260
  451. package/workspace/public/pm/sessions-panel.js +0 -219
  452. package/workspace/public/pm/sheet-jira.js +0 -353
  453. package/workspace/public/pm/shell-bell.js +0 -163
  454. package/workspace/public/pm/shell-model.js +0 -83
  455. package/workspace/public/pm/shell-phone.js +0 -124
  456. package/workspace/public/pm/shell-readaloud.js +0 -53
  457. package/workspace/public/pm/shell-recording.js +0 -274
  458. package/workspace/public/pm/shell-ticker.js +0 -90
  459. package/workspace/public/pm/sig-watch.js +0 -41
  460. package/workspace/public/pm/slide-confirm.js +0 -163
  461. package/workspace/public/pm/slides-copy.js +0 -52
  462. package/workspace/public/pm/status-banner.js +0 -95
  463. package/workspace/public/pm/tab-doc.js +0 -859
  464. package/workspace/public/pm/tab-gone.js +0 -21
  465. package/workspace/public/pm/tab-term.js +0 -1210
  466. package/workspace/public/pm/tab-web.js +0 -90
  467. package/workspace/public/pm/timeline-copy.js +0 -48
  468. package/workspace/public/pm/timeline-forecast-view.js +0 -164
  469. package/workspace/public/pm/today-agenda.js +0 -331
  470. package/workspace/public/pm/today-cards.js +0 -244
  471. package/workspace/public/pm/today-copy.js +0 -506
  472. package/workspace/public/pm/today-day.js +0 -1371
  473. package/workspace/public/pm/today-goals.js +0 -297
  474. package/workspace/public/pm/today-jobs.js +0 -84
  475. package/workspace/public/pm/today-mentions.js +0 -50
  476. package/workspace/public/pm/topbar.js +0 -202
  477. package/workspace/public/pm/triage-card.js +0 -60
  478. package/workspace/public/pm/undo-hold.js +0 -103
  479. package/workspace/public/pm/view-addrepo.js +0 -208
  480. package/workspace/public/pm/view-files.js +0 -197
  481. package/workspace/public/pm/view-livenotes.js +0 -399
  482. package/workspace/public/pm/view-today.js +0 -13
  483. package/workspace/public/pm/view-validate.js +0 -171
  484. package/workspace/public/pm/welcome.js +0 -391
  485. package/workspace/public/pm/work-place.js +0 -68
  486. package/workspace/public/pm/xlsx-read.js +0 -117
  487. package/workspace/public/welcome.html +0 -22
  488. package/workspace/test-lists/browser-suites-green.json +0 -5
  489. package/workspace/test-lists/c3-core-docs.json +0 -9
  490. package/workspace/test-lists/c3-doc-sheet-rich.json +0 -6
  491. package/workspace/test-lists/c3-doc-sheet-size.json +0 -6
  492. package/workspace/test-lists/c3-doc-sheet-v2.json +0 -6
  493. package/workspace/test-lists/c3-ib-items.json +0 -9
  494. package/workspace/test-lists/c3-ib-more.json +0 -9
  495. package/workspace/test-lists/c3-ib-triage-backlog.json +0 -9
  496. package/workspace/test-lists/c3-ini-life.json +0 -9
  497. package/workspace/test-lists/c3-meeting-board.json +0 -5
  498. package/workspace/test-lists/c3-meeting-card.json +0 -5
  499. package/workspace/test-lists/c3-notes-place.json +0 -5
  500. package/workspace/test-lists/c3-notes-series.json +0 -5
  501. package/workspace/test-lists/calendar-time-page.json +0 -5
  502. package/workspace/test-lists/calpop.json +0 -4
  503. package/workspace/test-lists/console3-briefing.json +0 -9
  504. package/workspace/test-lists/console3-foundation.json +0 -9
  505. package/workspace/test-lists/console3-work-page.json +0 -9
  506. package/workspace/test-lists/premium-brief-parity.json +0 -9
  507. package/workspace/test-lists/report-design-studio-ui.json +0 -5
  508. package/workspace/test-lists/report-structure-ui.json +0 -11
  509. package/workspace/test-lists/report-workspace-ui.json +0 -5
  510. package/workspace/test-lists/run3-a.json +0 -5
  511. package/workspace/test-lists/run3-d.json +0 -6
  512. package/workspace/test-lists/run4-c.json +0 -13
  513. package/workspace/test-lists/today-goals-jobs-ui.json +0 -5
  514. package/workspace/test-lists/today-mentions-cards.json +0 -5
  515. package/workspace/test-lists/workspace-tabs-declutter.json +0 -13
@@ -1,278 +0,0 @@
1
- /* pm/c3-ini-timeline.js — the HTML timeline of the Initiatives page (mockup v5, 34-initiatives.js "Timeline: compact rows, mono 11px
2
- * labels, thin bars, zoom, expand, drag, pan"). Used by the Portfolio (board > initiative > epic), a board's Timeline tab (initiative >
3
- * epic > item) and an initiative's Timeline tab (epic > item).
4
- *
5
- * timeline({ key, rows, from, to, today, markers, defOpen, head, onMove, onLocked }) -> div.ini-tl
6
- * rows [{ uid, label, key?, src? ('pmos'|'jira'), start, end ('YYYY-MM-DD'), progress (0..1), tone ('', ok, warn, bad, pm, muted),
7
- * cls ('grp'|'ini'|'ep'|'it'), drag? (a PMOS task id: the bar can be dragged), lock? (a Jira key: dates come from Jira),
8
- * open? () => void, tip? { t, p, st, o, src, jira, hint }, kids? [rows] }]
9
- * markers [{ id, at, label, kind: 'release'|'milestone', open? }] drawn on their own row
10
- * defOpen the uids open on the first draw; later draws keep what the PM opened and closed (state is kept per `key`)
11
- * onMove(taskId, days, uid) a PMOS bar was dragged (or moved with the arrow keys) by whole days
12
- * onLocked(key) a Jira bar was pressed and dragged, or moved with an arrow key
13
- * tlInit(node) after the node is in the page: scroll so today sits near the left, end the grow-in
14
- * tlStill(key) the next draw of that key keeps its scroll and does not animate (after a reschedule)
15
- *
16
- * Layout: rows are 24px (a board group 28px), the label column is 240px (132px under 760px), labels are 11px mono. The day width is
17
- * --in-pd px (Week 22, Month 6, Quarter 2); a bar sits at --in-d0..--in-d1 days. Zoom eases the day width over 380 ms around the centre
18
- * of the view. A row with children has a chevron that opens it (grid rows 0fr to 1fr) and its bars grow in. A press on the empty chart
19
- * pans it (mouse). Pointer handlers are on the document (R28-15); every control is a button. Reduced motion turns the motion off.
20
- */
21
- import { el } from './dom.js';
22
- import { btn, icon, geo, day, parseDay, put } from './c3-ini-ui.js';
23
-
24
- const DAY = 864e5;
25
- export const ZOOMS = [['week', 'Week', 22], ['month', 'Month', 6], ['quarter', 'Quarter', 2]];
26
- const ZPD = Object.fromEntries(ZOOMS.map(([k, , p]) => [k, p]));
27
- const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
28
- const TLS = new Map(); // key -> { zoom, open:Set, scroll, still }
29
- const INST = new WeakMap(); // .ini-tl node -> instance
30
- const reduced = () => { try { return matchMedia('(prefers-reduced-motion: reduce)').matches; } catch { return false; } };
31
- const dOf = (from, d) => Math.round((d - from) / DAY);
32
- const monthStart = (d) => new Date(d.getFullYear(), d.getMonth(), 1);
33
- export const tlRange = (today, back = 75, fwd = 230) => { const t = parseDay(today) || new Date(); return { from: monthStart(new Date(+t - back * DAY)), to: monthStart(new Date(+t + fwd * DAY)) }; };
34
- const stOf = (key, def) => { if (!TLS.has(key)) TLS.set(key, { zoom: 'month', open: new Set(def || []), scroll: null, still: false }); return TLS.get(key); };
35
- export const tlStill = (key) => { const s = TLS.get(key); if (s) s.still = true; };
36
-
37
- function ticks(from, days, zoom) {
38
- const maj = []; const min = []; const end = new Date(+from + days * DAY);
39
- for (let d = monthStart(from); d < end; d = new Date(d.getFullYear(), d.getMonth() + 1, 1)) {
40
- const x = dOf(from, d); if (x < 0) continue;
41
- if (zoom === 'quarter') { if (d.getMonth() % 3 === 0) maj.push([x, 'Q' + (d.getMonth() / 3 + 1) + ' ' + d.getFullYear()]); min.push([x, MON[d.getMonth()]]); }
42
- else maj.push([x, MON[d.getMonth()] + ' ' + d.getFullYear()]);
43
- }
44
- if (zoom !== 'quarter') {
45
- const m = new Date(from); m.setDate(m.getDate() + ((8 - m.getDay()) % 7));
46
- for (let d = m; d < end; d = new Date(d.getFullYear(), d.getMonth(), d.getDate() + 7)) min.push([dOf(from, d), zoom === 'week' ? 'Mon ' + d.getDate() : String(d.getDate())]);
47
- }
48
- return { maj, min };
49
- }
50
- const axis = (from, days, zoom) => { const { maj, min } = ticks(from, days, zoom); return [...maj.map(([x, l]) => geo(el('span', { class: 'ini-tlt mj' }, l), { '--in-d0': x })), ...min.map(([x, l]) => geo(el('span', { class: 'ini-tlt' }, l), { '--in-d0': x }))]; };
51
- const grid = (from, days, zoom) => { const { maj, min } = ticks(from, days, zoom); const seen = new Set(maj.map((m) => m[0])); return [...maj.map(([x]) => geo(el('i', { class: 'mj' }), { '--in-d0': x })), ...min.filter(([x]) => !seen.has(x)).map(([x]) => geo(el('i'), { '--in-d0': x }))]; };
52
- const anyRow = (rows, f) => rows.some((r) => r && (f(r) || anyRow(r.kids || [], f)));
53
-
54
- export function timeline({ key, rows, from, to, today, markers = [], defOpen, head = 'Initiative', onMove, onLocked }) {
55
- const st = stOf(key, defOpen);
56
- const days = dOf(from, to);
57
- const T = parseDay(today) || new Date();
58
- const anim = !st.still && !reduced();
59
- const byUid = new Map();
60
- let n = 0;
61
- function rowNode(r, depth) {
62
- byUid.set(r.uid, r);
63
- const kids = (r.kids || []).filter(Boolean); const has = kids.length > 0; const open = has && st.open.has(r.uid);
64
- const s = parseDay(r.start); const e = parseDay(r.end);
65
- let bar = null;
66
- if (s && e && !(e < from || s > to)) {
67
- const d0 = Math.max(0, (s - from) / DAY); const d1 = Math.min(days, Math.max((e - from) / DAY, d0 + 0.8)); const p = Math.round((r.progress || 0) * 100);
68
- const aria = (r.key ? r.key + ' ' : '') + r.label + ', ' + day(r.start) + ' to ' + day(r.end) + ', ' + p + '% done' + (r.drag ? '. Drag or use the arrow keys to move it' : r.lock ? '. Dates come from Jira' : '');
69
- bar = geo(el('span', { class: 'ini-tlb ' + (r.cls || 'it') + ' ini-t-' + (r.tone || 'acc') + (r.drag ? ' pm' : '') + (r.lock ? ' jl' : ''), tabindex: '0', role: 'button', 'data-tlb': r.uid,
70
- ...(r.drag ? { 'data-tldrag': r.drag } : {}), ...(r.lock ? { 'data-tllock': r.lock } : {}), 'data-s': r.start, 'data-e': r.end, 'aria-label': aria },
71
- geo(el('i'), { '--in-w': p + '%' }), r.lock ? el('span', { class: 'lk' }, icon('lock', 'sm')) : null), { '--in-d0': d0.toFixed(2), '--in-d1': d1.toFixed(2), '--in-i': Math.min(n++, 40) });
72
- }
73
- const label = [r.key ? el('span', { class: 'ini-tlkey' }, r.key) : null,
74
- r.src === 'pmos' ? el('span', { class: 'ini-tlsrc' }, 'PMOS') : r.src === 'jira' ? el('span', { class: 'ini-tlsrc j', title: 'From Jira' }, icon('jira', 'sm')) : null,
75
- el('span', { class: 'ini-tlname' }, r.label)];
76
- const lab = has
77
- ? [btn({ class: 'ini-tlc', 'data-tltog': r.uid, 'aria-expanded': String(open), 'aria-label': (open ? 'Collapse ' : 'Expand ') + r.label, onclick: () => toggle(r.uid) }, icon('next', 'sm')),
78
- btn({ class: 'ini-tlx', title: r.label, 'data-tltog': r.uid, onclick: () => toggle(r.uid) }, ...label),
79
- r.open ? btn({ class: 'ini-tlo', 'aria-label': 'Open ' + r.label, title: 'Open', 'data-tlopen': r.uid, onclick: () => r.open() }, icon('next', 'sm')) : null]
80
- : [el('span', { class: 'ini-tlc0' }), r.open ? btn({ class: 'ini-tlx', title: r.label, 'data-tlopen': r.uid, onclick: () => r.open() }, ...label) : el('span', { class: 'ini-tlx', title: r.label }, ...label)];
81
- const out = [el('div', { class: 'ini-tlr ' + (r.cls || 'it'), 'data-tlrow': r.uid }, geo(el('div', { class: 'ini-tll' }, ...lab), { '--in-dep': depth }), el('div', { class: 'ini-tltr' }, bar))];
82
- if (has) out.push(el('div', { class: 'ini-tlk' + (open ? ' open' : ''), 'data-tlkids': r.uid }, el('div', null, ...kids.flatMap((k) => rowNode(k, depth + 1)))));
83
- return out;
84
- }
85
- const body = rows.flatMap((r) => rowNode(r, 0));
86
- const mk = markers.filter((m) => { const d = parseDay(m.at); return d && d >= from && d <= to; });
87
- const mrow = mk.length ? el('div', { class: 'ini-tlr mrk' }, geo(el('div', { class: 'ini-tll' }, el('span', { class: 'ini-tlc0' }), el('span', { class: 'ini-tlx' }, el('span', { class: 'ini-tlname dim' }, 'Releases, milestones'))), { '--in-dep': 0 }),
88
- el('div', { class: 'ini-tltr' }, ...mk.map((m) => geo(btn({ class: 'ini-tlm ' + m.kind, 'data-tlm': m.id, 'aria-label': m.label + ', ' + day(m.at), title: m.label + ' · ' + day(m.at) + ' (lives on the Calendar)', onclick: () => (m.open ? m.open() : null) }), { '--in-d0': ((parseDay(m.at) - from) / DAY).toFixed(2) })))) : null;
89
- const dT = (T - from) / DAY;
90
- const zoomSeg = el('div', { class: 'seg ini-seg', role: 'group', 'aria-label': 'Zoom' }, ...ZOOMS.map(([k, l]) => btn({ 'aria-pressed': String(st.zoom === k), 'data-tlzoom': k, onclick: () => zoom(k) }, l)));
91
- const ax = el('div', { class: 'ini-tltr ini-tlax' }, ...axis(from, days, st.zoom));
92
- const gr = el('div', { class: 'ini-tlgrid', 'aria-hidden': 'true' }, ...grid(from, days, st.zoom));
93
- const sc = el('div', { class: 'ini-tlsc', 'data-tlsc': '' }, el('div', { class: 'ini-tlin' },
94
- gr,
95
- dT >= 0 && dT <= days ? geo(el('div', { class: 'ini-tlnow', 'aria-hidden': 'true' }, el('b', null, 'Today')), { '--in-d0': dT.toFixed(2) }) : null,
96
- el('div', { class: 'ini-tlr ini-tlhd' }, el('div', { class: 'ini-tll' }, el('span', { class: 'ini-tlname dim' }, head)), ax),
97
- ...(body.length ? body : [el('div', { class: 'ini-tlr' }, el('div', { class: 'ini-tll' }, el('span', { class: 'ini-tlname dim' }, 'Nothing matches the filters.')), el('div', { class: 'ini-tltr' }))]),
98
- mrow));
99
- const tip = el('div', { class: 'ini-tip', role: 'tooltip', 'aria-hidden': 'true' });
100
- const key2 = (cls) => el('i', { class: 'ini-tlkeyi ' + cls, 'aria-hidden': 'true' });
101
- const legend = el('div', { class: 'pgl ini-pgl' }, el('span', { class: 'ini-fg' }, key2('now'), 'today'), el('span', null, key2('bar'), 'progress'),
102
- anyRow(rows, (r) => r.lock) ? el('span', null, icon('lock', 'sm'), 'Jira: dates come from Jira') : null,
103
- anyRow(rows, (r) => r.drag) ? el('span', null, key2('pm'), 'PMOS task: drag to reschedule') : null,
104
- mk.length ? [el('span', null, key2('rel'), 'release'), el('span', null, key2('ms'), 'milestone')] : null,
105
- el('span', null, 'drag the empty chart to pan'));
106
- const node = geo(el('div', { class: 'ini-tl' + (anim ? ' anim' : ''), 'data-tl': key, 'data-ini': 'timeline' },
107
- el('div', { class: 'ini-tlbar' }, zoomSeg, el('span', { class: 'chips2' },
108
- btn({ class: 'pill', 'data-tltoday': '', onclick: () => goToday(true) }, icon('cal', 'sm'), 'Today'),
109
- btn({ class: 'pill', 'data-tlall': '1', onclick: () => all(true) }, 'Expand all'),
110
- btn({ class: 'pill', 'data-tlall': '0', onclick: () => all(false) }, 'Collapse all'))),
111
- sc, tip, legend), { '--in-pd': ZPD[st.zoom], '--in-days': days });
112
-
113
- const lw = () => { const l = node.querySelector('.ini-tll'); return l ? l.offsetWidth : 240; };
114
- const pdNow = () => parseFloat(node.style.getPropertyValue('--in-pd')) || ZPD[st.zoom];
115
- function goToday(smooth) {
116
- const left = Math.max(0, dT * pdNow() - (sc.clientWidth - lw()) * 0.28);
117
- if (smooth && !reduced() && sc.scrollTo) sc.scrollTo({ left, behavior: 'smooth' }); else sc.scrollLeft = left;
118
- }
119
- function zoom(z) {
120
- if (st.zoom === z) return;
121
- const p0 = ZPD[st.zoom]; const p1 = ZPD[z]; const view = sc.clientWidth - lw();
122
- const center = (sc.scrollLeft + view / 2) / p0;
123
- st.zoom = z;
124
- zoomSeg.querySelectorAll('[data-tlzoom]').forEach((b) => b.setAttribute('aria-pressed', String(b.dataset.tlzoom === z)));
125
- node.classList.add('zooming');
126
- const finish = () => {
127
- geo(node, { '--in-pd': p1 }); sc.scrollLeft = center * p1 - view / 2; st.scroll = sc.scrollLeft;
128
- put(ax, ...axis(from, days, z)); put(gr, ...grid(from, days, z));
129
- node.classList.remove('zooming');
130
- };
131
- if (reduced()) { finish(); return; }
132
- const t0 = performance.now(); const dur = 380;
133
- const step = (now) => {
134
- const k = Math.min(1, (now - t0) / dur); const e = 1 - Math.pow(1 - k, 3); const p = p0 + (p1 - p0) * e;
135
- geo(node, { '--in-pd': p.toFixed(3) }); sc.scrollLeft = center * p - view / 2;
136
- if (k < 1) requestAnimationFrame(step); else finish();
137
- };
138
- requestAnimationFrame(step);
139
- }
140
- function toggle(uid, force) {
141
- const kids = node.querySelector('[data-tlkids="' + CSS.escape(uid) + '"]'); if (!kids) return;
142
- const open = force != null ? force : !st.open.has(uid);
143
- if (open) st.open.add(uid); else st.open.delete(uid);
144
- kids.classList.toggle('open', open);
145
- node.querySelectorAll('.ini-tlc[data-tltog="' + CSS.escape(uid) + '"]').forEach((b) => { b.setAttribute('aria-expanded', String(open)); b.setAttribute('aria-label', (open ? 'Collapse ' : 'Expand ') + ((byUid.get(uid) || {}).label || '')); });
146
- if (open && !reduced()) {
147
- kids.querySelectorAll(':scope > div > .ini-tlr .ini-tlb').forEach((b, k) => geo(b, { '--in-j': k }));
148
- kids.classList.remove('grow'); void kids.offsetWidth; kids.classList.add('grow');
149
- clearTimeout(kids._g); kids._g = setTimeout(() => kids.classList.remove('grow'), 900);
150
- }
151
- }
152
- function all(open) { node.querySelectorAll('[data-tlkids]').forEach((k) => toggle(k.dataset.tlkids, open)); }
153
- sc.addEventListener('scroll', () => { st.scroll = sc.scrollLeft; }, { passive: true });
154
- INST.set(node, { key, st, byUid, tip, sc, from, onMove, onLocked, goToday, pd: pdNow });
155
- return node;
156
- }
157
-
158
- /** After the node is in the page: the first scroll (today near the left, or where the PM left it), and the end of the grow-in. */
159
- export function tlInit(root) {
160
- if (!root) return;
161
- const nodes = root.classList && root.classList.contains('ini-tl') ? [root] : [...root.querySelectorAll('.ini-tl')];
162
- for (const node of nodes) {
163
- const I = INST.get(node); if (!I) continue;
164
- if (I.st.still && I.st.scroll != null) I.sc.scrollLeft = I.st.scroll; else I.goToday(false);
165
- I.st.still = false;
166
- if (node.classList.contains('anim')) setTimeout(() => node.classList.remove('anim'), 1600);
167
- }
168
- }
169
-
170
- /* ── the tooltip ── */
171
- function tipShow(bar, ev, nd, extra) {
172
- const node = bar.closest('.ini-tl'); const I = node && INST.get(node); if (!I) return;
173
- const r = I.byUid.get(bar.dataset.tlb) || {}; const t = r.tip || {};
174
- const s = new Date(+parseDay(bar.dataset.s) + (nd || 0) * DAY); const e = new Date(+parseDay(bar.dataset.e) + (nd || 0) * DAY);
175
- const iso = (d) => d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0');
176
- const len = Math.max(1, Math.round((e - s) / DAY));
177
- put(I.tip, el('b', null, t.t || r.label || ''),
178
- el('div', null, icon('cal', 'sm'), day(iso(s)) + ' to ' + day(iso(e)) + ' · ' + len + ' days', nd ? el('span', { class: 'ini-tlmv' }, (nd > 0 ? '+' : '') + nd + 'd') : null),
179
- el('div', null, icon('up', 'sm'), (t.p || '0%') + ' done' + (t.st ? ' · ' + t.st : '')),
180
- t.o ? el('div', null, icon('user', 'sm'), t.o) : null,
181
- el('div', null, t.jira ? icon('lock', 'sm') : icon('init', 'sm'), t.src || ''),
182
- el('div', { class: 'dim' }, extra || t.hint || ''));
183
- const box = node.getBoundingClientRect(); const br = bar.getBoundingClientRect();
184
- I.tip.classList.add('on'); I.tip.setAttribute('aria-hidden', 'false');
185
- const w = I.tip.offsetWidth; const hh = I.tip.offsetHeight; const x = ev && ev.clientX ? ev.clientX : br.left + Math.min(br.width, 40);
186
- let top = br.bottom - box.top + 8; if (br.bottom + hh + 12 > window.innerHeight && br.top - hh - 8 > box.top) top = br.top - box.top - hh - 8;
187
- geo(I.tip, { '--in-x': Math.max(4, Math.min(box.width - w - 4, x - box.left + 10)) + 'px', '--in-y': top + 'px' });
188
- node.querySelectorAll('.ini-tlr.hl').forEach((x2) => x2.classList.remove('hl')); const row = bar.closest('.ini-tlr'); if (row) row.classList.add('hl');
189
- }
190
- function tipHide(node) {
191
- const I = node && INST.get(node); if (!I) return;
192
- I.tip.classList.remove('on'); I.tip.setAttribute('aria-hidden', 'true');
193
- node.querySelectorAll('.ini-tlr.hl').forEach((x) => x.classList.remove('hl'));
194
- }
195
- function openRow(bar) { const I = INST.get(bar.closest('.ini-tl')); const r = I && I.byUid.get(bar.dataset.tlb); if (r && r.open) r.open(); }
196
-
197
- /* ── document-level pointer and key handlers: drag a PMOS bar, nudge a Jira bar (locked), pan the chart ── */
198
- let TLD = null;
199
- function install() {
200
- if (typeof document === 'undefined' || document.__iniTl) return;
201
- document.__iniTl = true;
202
- document.addEventListener('pointerdown', (e) => {
203
- if (e.button !== 0) return;
204
- const node = e.target.closest && e.target.closest('.ini-tl'); const I = node && INST.get(node); if (!I) return;
205
- const bar = e.target.closest('.ini-tlb');
206
- if (bar) {
207
- TLD = { mode: 'bar', bar, node, I, x0: e.clientX, moved: false, nd: 0, pd: I.pd(), d0: parseFloat(bar.style.getPropertyValue('--in-d0')), d1: parseFloat(bar.style.getPropertyValue('--in-d1')) };
208
- if (bar.dataset.tldrag) { try { bar.setPointerCapture(e.pointerId); } catch { /* not capturable */ } e.preventDefault(); }
209
- return;
210
- }
211
- if (!e.target.closest('.ini-tltr') || e.target.closest('button') || e.pointerType !== 'mouse') return;
212
- TLD = { mode: 'pan', node, I, x0: e.clientX, s0: I.sc.scrollLeft, moved: false };
213
- });
214
- document.addEventListener('pointermove', (e) => {
215
- if (!TLD || TLD.mode === 'cancel') return;
216
- const dx = e.clientX - TLD.x0;
217
- if (!TLD.moved && Math.abs(dx) < 4) return;
218
- TLD.moved = true;
219
- if (TLD.mode === 'pan' || (!TLD.bar.dataset.tldrag && !TLD.bar.dataset.tllock)) {
220
- if (TLD.mode === 'bar') { TLD.mode = 'pan'; TLD.s0 = TLD.I.sc.scrollLeft; }
221
- TLD.I.sc.scrollLeft = TLD.s0 - dx; TLD.node.classList.add('panning'); tipHide(TLD.node); return;
222
- }
223
- const b = TLD.bar;
224
- if (b.dataset.tldrag) {
225
- const nd = Math.round(dx / TLD.pd); if (nd === TLD.nd && b.classList.contains('drag')) return;
226
- TLD.nd = nd; b.classList.add('drag'); TLD.node.classList.add('dragging');
227
- geo(b, { '--in-d0': (TLD.d0 + nd).toFixed(2), '--in-d1': (TLD.d1 + nd).toFixed(2) });
228
- tipShow(b, e, nd, nd ? 'Release to reschedule. Esc cancels.' : 'Drag left or right');
229
- } else if (!TLD.warned) {
230
- TLD.warned = true; b.classList.remove('nope'); void b.offsetWidth; b.classList.add('nope');
231
- tipShow(b, e, 0, 'Dates come from Jira. Change them in Jira.');
232
- }
233
- });
234
- document.addEventListener('pointerup', () => {
235
- if (!TLD) return;
236
- const D = TLD; TLD = null;
237
- D.node.classList.remove('panning', 'dragging');
238
- if (D.mode === 'pan' || D.mode === 'cancel') return;
239
- const b = D.bar; b.classList.remove('drag');
240
- if (!D.moved) { tipHide(D.node); openRow(b); return; }
241
- if (b.dataset.tldrag) { if (D.nd && D.I.onMove) { tlStill(D.I.key); D.I.onMove(b.dataset.tldrag, D.nd, b.dataset.tlb); } else tipHide(D.node); return; }
242
- if (b.dataset.tllock) { setTimeout(() => b.classList.remove('nope'), 500); if (D.I.onLocked) D.I.onLocked(b.dataset.tllock); }
243
- });
244
- document.addEventListener('pointercancel', () => {
245
- if (TLD && TLD.bar && TLD.mode === 'bar') { geo(TLD.bar, { '--in-d0': TLD.d0, '--in-d1': TLD.d1 }); TLD.bar.classList.remove('drag'); }
246
- if (TLD) TLD.node.classList.remove('panning', 'dragging');
247
- TLD = null;
248
- });
249
- document.addEventListener('keydown', (e) => {
250
- const t = e.target;
251
- if (t && t.classList && t.classList.contains('ini-tlb')) {
252
- const I = INST.get(t.closest('.ini-tl')); if (!I) return;
253
- if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); openRow(t); return; }
254
- if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') {
255
- e.preventDefault();
256
- if (t.dataset.tldrag && I.onMove) { tlStill(I.key); I.onMove(t.dataset.tldrag, e.key === 'ArrowRight' ? 1 : -1, t.dataset.tlb); return; }
257
- if (t.dataset.tllock && I.onLocked) I.onLocked(t.dataset.tllock);
258
- }
259
- return;
260
- }
261
- if (e.key === 'Escape' && TLD && TLD.mode === 'bar' && TLD.bar.dataset.tldrag) {
262
- geo(TLD.bar, { '--in-d0': TLD.d0.toFixed(2), '--in-d1': TLD.d1.toFixed(2) }); TLD.bar.classList.remove('drag'); tipHide(TLD.node);
263
- TLD = { mode: 'cancel', node: TLD.node, moved: true };
264
- }
265
- });
266
- const hover = (e) => { if (TLD) return; const b = e.target.closest && e.target.closest('.ini-tlb'); if (b) tipShow(b, e); };
267
- document.addEventListener('mouseover', hover);
268
- document.addEventListener('mousemove', hover);
269
- document.addEventListener('mouseout', (e) => {
270
- if (TLD) return;
271
- const b = e.target.closest && e.target.closest('.ini-tlb'); if (!b) return;
272
- if (e.relatedTarget && b.contains(e.relatedTarget)) return;
273
- tipHide(b.closest('.ini-tl'));
274
- });
275
- document.addEventListener('focusin', (e) => { const b = e.target.closest && e.target.closest('.ini-tlb'); if (b) tipShow(b, null); });
276
- document.addEventListener('focusout', (e) => { const b = e.target.closest && e.target.closest('.ini-tlb'); if (b) tipHide(b.closest('.ini-tl')); });
277
- }
278
- install();
@@ -1,139 +0,0 @@
1
- /* pm/c3-ini-work.js — the model the Initiatives page shares across its tabs (mockup v5, 34-initiatives.js): the workflow templates an
2
- * initiative can run, the stage tools, and the work items (Jira items and PMOS tasks) as rows, sheets and timeline rows. It reads the
3
- * server only through the ctx it is handed (c3-initiatives.js makeCtx), and writes only the PMOS-task status (POST
4
- * /api/boards/tasks/state) from the item sheet. Jira items are read-only everywhere: status, dates and owner are Jira's.
5
- *
6
- * TEMPLATES · isBuildStage · templateBuilds · offered(board) · wfOf(row, board) · catOf(wf, stage) · tplName(row, board) · kindOf(row, board)
7
- * TOOL_META { id: [label, icon] } the server's stage tools (scripts/boards.js TOOLS)
8
- * KIND_IC · STATUSES · srcTag(w) · wkStatus(w) · workRow(ctx, w, o) · openWorkSheet(ctx, w, all, onChanged)
9
- * workTlRows(ctx, items, onChanged) · iniTlRow(ctx, ini, kids, board) · iniTip(ini, board) rows for c3-ini-timeline.js
10
- * loadItems(ctx) · dropItems(ctx) GET /api/boards/items, kept for a few seconds per board */
11
- import { el } from './dom.js';
12
- import { icon, chip, tag, st, note, kv, nrow, sect, list, lk, dateChip, ownerChip, ownerText, day, daysBetween, trunc, progChip, pill, plural, put } from './c3-ini-ui.js';
13
-
14
- const S = (name, cat) => ({ name, cat });
15
- /** The workflow templates (scripts/boards.js INI_TEMPLATES): name, kind, use and stages. */
16
- export const TEMPLATES = Object.freeze({
17
- product: { name: 'Product', kind: 'product', use: 'Product work that ships: discovery through to evaluating what shipped.', stages: [S('Discover', 'Discover'), S('Plan', 'Plan'), S('Build & Deliver', 'Do'), S('Monitor & Evaluate', 'Learn')] },
18
- fix: { name: 'Quick fix', kind: 'product', use: 'A small, known change: plan it, build it, ship it, check it.', stages: [S('Plan', 'Plan'), S('Build & Deliver', 'Do'), S('Evaluate', 'Learn')] },
19
- research: { name: 'Research only', kind: 'product', use: 'Learn before committing. Nothing gets built in this initiative.', stages: [S('Discover', 'Discover'), S('Plan', 'Plan'), S('Evaluate', 'Learn')] },
20
- content: { name: 'Content and launch', kind: 'project', use: 'Pages, campaigns and launches that a team or an agency produces.', stages: [S('Discover', 'Discover'), S('Plan', 'Plan'), S('Produce', 'Do'), S('Launch', 'Do'), S('Evaluate', 'Learn')] },
21
- project: { name: 'Project', kind: 'project', use: 'Someone who only manages a project: plan it, run it, close it.', stages: [S('Plan', 'Plan'), S('Execute', 'Do'), S('Close', 'Learn')] },
22
- simple: { name: 'Simple', kind: 'simple', use: 'A plain to-do flow for small or personal work.', stages: [S('To do', 'Plan'), S('Doing', 'Do'), S('Done', 'Learn')] },
23
- });
24
- export const BOARD_TEMPLATES = ['product', 'project', 'simple'];
25
- export const isBuildStage = (s) => /^(build|deliver)/i.test(String((s && s.name) || s || ''));
26
- export const templateBuilds = (k) => !!TEMPLATES[k] && TEMPLATES[k].stages.some(isBuildStage);
27
- /** The templates the board offers new and existing initiatives (never a Build one when Build and deliver is off). */
28
- export const offered = (b) => (Array.isArray(b && b.offer) && b.offer.length ? b.offer : Object.keys(TEMPLATES)).filter((k) => TEMPLATES[k] && (b.build !== false || !templateBuilds(k)));
29
- export const wfOf = (row, b) => (row && Array.isArray(row.workflow) && row.workflow.length ? row.workflow : (row && row.template && TEMPLATES[row.template] ? TEMPLATES[row.template].stages : (b && b.workflow) || []));
30
- export const catOf = (wf, stage) => ((wf || []).find((s) => s.name === stage) || {}).cat || 'Plan';
31
- const sameNames = (a, b) => a.length === b.length && a.every((s, k) => s.name === b[k].name);
32
- /** "Research only", "Product (edited)", or the board's own workflow ("Product, the board's"). */
33
- export function tplName(row, b) {
34
- const t = row && row.template && TEMPLATES[row.template];
35
- if (t) return t.name + (row.workflow && row.workflow.length && !sameNames(t.stages, row.workflow) ? ' (edited)' : '');
36
- if (b && b.self) return 'PMOS ladder';
37
- const bt = TEMPLATES[b && b.template];
38
- return bt ? bt.name + (b.templateEdited ? ' (edited)' : '') : 'Custom';
39
- }
40
- export const kindOf = (row, b) => (row && row.template && TEMPLATES[row.template] ? TEMPLATES[row.template].kind : (TEMPLATES[b && b.template] || TEMPLATES.product).kind);
41
-
42
- /** The stage tools of the server (scripts/boards.js TOOLS): label and icon. */
43
- export const TOOL_META = {
44
- ideas: ['Ideas', 'spark'], hypotheses: ['Hypotheses', 'flag'], notes: ['Notes', 'notes'], prd: ['PRD', 'doc'], rubric: ['Done-criteria', 'check'],
45
- breakdown: ['Breakdown', 'tree'], placement: ['Roadmap place', 'cal'], tickets: ['Tickets', 'check'], releases: ['Releases', 'out'],
46
- measurements: ['Measurements', 'up'], evaluation: ['Evaluation', 'scale'], history: ['History', 'undo'], brief: ['Brief', 'doc'], timeline: ['Timeline', 'cal'],
47
- };
48
- export const toolLabel = (t) => (t && t.label) || (TOOL_META[t && t.id] || [String((t && t.id) || '')])[0];
49
- export const toolIcon = (id) => (TOOL_META[id] || [0, 'doc'])[1];
50
-
51
- /* ── work items ── */
52
- export const KIND_IC = { Epic: 'bolt', Story: 'doc', Task: 'check', Bug: 'alert' };
53
- export const STATUSES = ['To do', 'In progress', 'In review', 'Done'];
54
- export const srcTag = (w) => (w.src === 'jira' ? el('span', { class: 'tag' }, icon('jira', 'sm'), 'Jira') : el('span', { class: 'tag' }, 'PMOS'));
55
- export const wkStatus = (w) => (w.blocked ? st('bad', 'alert', 'Blocked') : w.status === 'Done' ? st('ok', 'check', 'Done') : w.status === 'To do' ? chip('To do') : tag(w.status));
56
-
57
- const CACHE = new Map();
58
- /** GET /api/boards/items for the ctx's board: { ok, items, initiatives, build, jira, error }. Kept for 5 s. */
59
- export async function loadItems(ctx, force) {
60
- const key = ctx.ws + '|' + ctx.board.id;
61
- const hit = CACHE.get(key);
62
- if (!force && hit && Date.now() - hit.at < 5000) return hit.p;
63
- const p = ctx.api.get('/api/boards/items', { board: ctx.board.id }).then((r) => (r && r.ok && !r.pending
64
- ? { ok: true, items: r.items || [], initiatives: r.initiatives || [], build: !!r.build, jira: r.jira || null, error: '' }
65
- : { ok: false, items: [], initiatives: [], build: !!ctx.board.build, jira: ctx.board.jira || null, error: r && r.pending ? 'the repository is still being read' : (r && r.error) || 'no answer' }));
66
- CACHE.set(key, { at: Date.now(), p });
67
- return p;
68
- }
69
- export const dropItems = (ctx) => { if (ctx && ctx.board) CACHE.delete(ctx.ws + '|' + ctx.board.id); else CACHE.clear(); };
70
-
71
- /** One work item as a console3 row. o: { all, ini (show the initiative link), epic (show the epic chip, default true), sub, right, onChanged }. */
72
- export function workRow(ctx, w, o = {}) {
73
- const ep = w.epic && o.all && o.epic !== false ? o.all.find((x) => x.uid === w.epic) : null;
74
- const late = w.status !== 'Done' && w.end && daysBetween(ctx.today, w.end) < 0;
75
- const chips = [w.key ? chipM(w.key) : null, chip(icon(KIND_IC[w.kind] || 'check', 'sm'), w.kind), srcTag(w), wkStatus(w), ownerChip(w.owner),
76
- w.end ? dateChip(w.kind === 'Epic' ? w.start : null, w.end, late) : null,
77
- ep ? chip(icon('bolt', 'sm'), trunc(ep.title, 32)) : null,
78
- o.ini && w.ini ? lk({ onclick: () => ctx.openInitiative(w.ini), 'data-ini-open': w.ini }, icon('init', 'sm'), w.ini) : null];
79
- return nrow({ ic: w.blocked ? 'alert' : KIND_IC[w.kind] || 'check', hot: w.status === 'In progress' || w.status === 'In review', tone: w.blocked ? 'bad' : '',
80
- title: w.title, onOpen: () => openWorkSheet(ctx, w, o.all || [w], o.onChanged), openLabel: 'Open ' + (w.key ? w.key + ' ' : '') + w.title, chips,
81
- right: [w.src === 'jira' ? el('span', { class: 'chip2', title: 'Status and dates come from Jira' }, icon('lock', 'sm')) : null, ...(o.right || [])],
82
- attrs: { 'data-ini-item': w.uid, 'data-src': w.src }, cls: o.sub ? 'ini-sub-row' : '' });
83
- }
84
- const chipM = (t) => el('span', { class: 'chip2 mono' }, t);
85
-
86
- /** The sheet of one work item: what it is, its dates and progress, its items when it is an epic; a PMOS task can change status here. */
87
- export function openWorkSheet(ctx, w, all, onChanged) {
88
- const kids = (all || []).filter((x) => x.epic && x.epic === w.uid);
89
- const ini = w.ini;
90
- const body = el('div', { class: 'ini-form', 'data-ini': 'work-sheet' });
91
- const sh = ctx.openSheet({ title: (w.key ? w.key + ' ' : '') + w.title, icon: KIND_IC[w.kind] || 'check', body });
92
- async function setState(s) {
93
- const r = await ctx.api.post('/api/boards/tasks/state', { board: ctx.board.id, task: w.ref, state: s });
94
- if (!r || !r.ok) { ctx.toast({ text: 'The status did not change: ' + ((r && r.error) || 'no answer') + '.', tone: 'error' }); return; }
95
- sh.close(); dropItems(ctx);
96
- ctx.toast('"' + trunc(w.title, 40) + '" moved to ' + s + '.');
97
- if (onChanged) onChanged(r.item);
98
- }
99
- put(body,
100
- el('div', { class: 'chips2' }, srcTag(w), chip(icon(KIND_IC[w.kind] || 'check', 'sm'), w.kind), wkStatus(w), ini ? lk({ onclick: () => { sh.close(); ctx.openInitiative(ini); } }, icon('init', 'sm'), ini) : null),
101
- kv([['Owner', ownerText(w.owner)], ['Dates', w.start || w.end ? (day(w.start) || 'No start') + ' to ' + (day(w.end) || 'no end') : 'No dates yet'], ['Progress', progChip(w.progress || 0, w.status === 'Done' ? 'ok' : 'acc')]]),
102
- kids.length ? sect({ ic: 'bolt', title: 'In this epic', count: kids.length }, list(kids.map((k) => workRow(ctx, k, { all, epic: false, onChanged })))) : null,
103
- w.src === 'jira'
104
- ? el('div', { class: 'fold' }, icon('lock', 'sm'), el('b', null, 'Mirrored from Jira, read-only.'), ' Status, dates and owner are Jira\'s. Change them in Jira and PMOS mirrors them.')
105
- : w.kind === 'Epic' ? note('A PMOS epic groups PMOS tasks. Drag its tasks on the Timeline to change their dates.')
106
- : el('div', { class: 'ini-field' }, el('span', { class: 'dim mono ini-lbl' }, 'Move to'),
107
- el('div', { class: 'seg ini-seg', role: 'group', 'aria-label': 'Status' }, ...STATUSES.map((s) => pill({ class: '', 'aria-pressed': String(w.status === s), 'data-ini-state': s, disabled: w.status === s, onclick: () => setState(s) }, s)))));
108
- }
109
-
110
- /* ── timeline rows ── */
111
- export const iniTip = (i, b) => ({ t: i.id + ' ' + i.title, p: Math.round((i.progress || 0) * 100) + '%', st: (i.stage || 'No stage') + ' · ' + (i.status || 'no status'), o: i.owner || 'No owner',
112
- src: 'Initiative · ' + tplName(i, b) + ' workflow', hint: 'Click the row to show its epics' });
113
- const toneOfIni = (i) => (i.status === 'late' ? 'bad' : i.status === 'at risk' ? 'warn' : i.status === 'done' ? 'ok' : 'acc');
114
- export const iniTlRow = (ctx, i, kids, b, cls) => ({ uid: i.id, label: i.title, key: i.id, start: i.start, end: i.end, progress: i.progress || 0, tone: toneOfIni(i), cls: cls || 'ini',
115
- open: () => ctx.openInitiative(i.id, 'overview', b && b.id), tip: iniTip(i, b || ctx.board), kids });
116
- /** Epic > item rows of a set of items; items with no epic of the set come after. A PMOS task can be dragged; a Jira item is locked. */
117
- export function workTlRows(ctx, items, onChanged) {
118
- const wr = (w) => ({ uid: w.uid, label: w.title, key: w.key, src: w.src, start: w.start, end: w.end, progress: w.progress || 0, cls: w.kind === 'Epic' ? 'ep' : 'it',
119
- tone: w.blocked ? 'bad' : w.status === 'Done' ? 'ok' : w.src === 'pmos' ? 'pm' : 'acc', drag: w.src === 'pmos' && w.kind !== 'Epic' && w.ref ? w.ref : null, lock: w.src === 'jira' ? w.key : null,
120
- open: () => openWorkSheet(ctx, w, items, onChanged),
121
- tip: { t: (w.key ? w.key + ' ' : '') + w.title, p: Math.round((w.progress || 0) * 100) + '%', st: w.blocked ? 'Blocked' : w.status, o: w.owner || 'No owner', jira: w.src === 'jira',
122
- src: w.src === 'jira' ? 'Jira ' + w.kind.toLowerCase() + ' · read-only' : 'PMOS ' + w.kind.toLowerCase(), hint: w.src === 'jira' ? 'Dates come from Jira' : w.kind === 'Epic' ? 'Click to show its tasks' : 'Drag to reschedule' } });
123
- const by = (a, c) => String(a.start || '9').localeCompare(String(c.start || '9'));
124
- const epics = items.filter((w) => w.kind === 'Epic');
125
- const loose = items.filter((w) => w.kind !== 'Epic' && !(w.epic && epics.some((e) => e.uid === w.epic)));
126
- return [...epics.map((e) => ({ ...wr(e), kids: items.filter((w) => w.epic === e.uid).sort(by).map(wr) })), ...loose.sort(by).map(wr)];
127
- }
128
- /** Reschedule a PMOS task by whole days (a drag or an arrow key on the Timeline), with an Undo in the toast. */
129
- export async function rescheduleTask(ctx, taskId, days, onDone) {
130
- const r = await ctx.api.post('/api/boards/tasks/reschedule', { board: ctx.board.id, task: taskId, days });
131
- dropItems(ctx);
132
- if (!r || !r.ok) { ctx.toast({ text: 'The task was not rescheduled: ' + ((r && r.error) || 'no answer') + '.', tone: 'error' }); onDone(null); return; }
133
- const it = r.item || {};
134
- ctx.toast({ text: 'Rescheduled "' + trunc(it.title || '', 40) + '" to ' + day(it.start) + ' to ' + day(it.end) + '.', actionLabel: 'Undo', timeout: 8000,
135
- onAction: async () => { await ctx.api.post('/api/boards/tasks/reschedule', { board: ctx.board.id, task: taskId, days: -days }); dropItems(ctx); onDone(null, true); } });
136
- onDone(it);
137
- }
138
- export const lockedToast = (ctx, key) => ctx.toast(key + ' is a Jira item. Its dates and status come from Jira; change them there and PMOS mirrors them.');
139
- export { plural };
@@ -1,170 +0,0 @@
1
- /* pm/c3-init-extras.js — what the five Initiatives sub-views of /c3.html (Roadmap, Breakdown, Tickets, Documents, Signals) share.
2
- * The mockup (console3.html) draws every sub-view in one frame: the scope pills (All plus each initiative), the hero line `.lh` (icon,
3
- * headline, sub line, ring), the Calendar and Work links, then two columns: left = the Plan lens and deck, then the view's own cards;
4
- * right = the view's charts. This file draws that frame once (frame), makes a view out of a render function (makeView), and holds the
5
- * small drawing helpers the views use (hBars, dayLabel, short). The badges on the sub-view buttons are computed by each view's
6
- * `badge(ctx)` and drawn by c3-shell.js. Nothing here reads or writes the server. */
7
- import { el } from './dom.js';
8
- import { ensureComponentsCss } from './primitives.js';
9
- import { ensureC3Css, c3ic, c3ring, c3Phone } from './pm-work-view.js';
10
- import { attachExpand } from './c3-expand.js';
11
- import { attachSwipe } from './c3-swipe.js';
12
- import { renderCase } from './c3-case.js';
13
- import { toast } from './c3-toast.js';
14
-
15
- export const short = (t, n) => { t = String(t || ''); return t.length > n ? t.slice(0, n - 1) + '…' : t; };
16
- const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
17
- /** '2026-10-24' to '24 Oct' (the mockup's dlab); anything else comes back as it is. */
18
- export const dayLabel = (v) => { const m = /^\d{4}-(\d{2})-(\d{2})/.exec(String(v || '')); return m ? Number(m[2]) + ' ' + MON[Number(m[1]) - 1] : String(v || ''); };
19
-
20
- /** The mockup's hBars: rows of [label, fraction 0..1, colour, text]. */
21
- export function hBars(rows) {
22
- return el('div', { class: 'hbs' }, rows.map((r, i) => el('div', { class: 'hbr', style: '--c:' + r[2] },
23
- el('div', { class: 'l' }, el('span', null, r[0]), el('i', null, r[3])),
24
- el('div', { class: 'tk' }, el('u', { style: 'width:' + Math.max(2, Math.min(100, r[1] * 100)) + '%;animation-delay:' + (i * 90) + 'ms' })))));
25
- }
26
-
27
- /** A card: `<section class="card"><h3>icon Title <span class="dim">sub</span></h3> ...kids</section>` (the mockup's right-column card). */
28
- export function card(icon, title, sub, ...kids) {
29
- return el('section', { class: 'card' }, el('h3', null, c3ic(icon), title + (sub ? ' ' : ''), sub ? el('span', { class: 'dim', style: 'text-transform:none;letter-spacing:0' }, sub) : null), ...kids);
30
- }
31
-
32
- /** A list card: `section.card.sect > .sh2 (h2 icon Title bdg, right note) + ul.list`. */
33
- export function listCard(icon, title, count, note, rows, attrs) {
34
- return el('section', { class: 'card sect', ...(attrs || {}) },
35
- el('div', { class: 'sh2' }, el('h2', null, c3ic(icon, 'sm'), title, count == null ? null : [' ', el('span', { class: 'bdg g' }, String(count))]), note ? el('span', { class: 'dim', style: 'font-size:var(--fs-2)' }, note) : null),
36
- el('ul', { class: 'list' }, rows));
37
- }
38
-
39
- export const emptyRow = (icon, text, attr) => el('li', { class: 'fold', ...(attr || {}) }, c3ic(icon || 'check', 'sm'), text);
40
-
41
- /** The hero line. head = { icon, h, s, ring: [done, total] }. */
42
- export function heroLine(head) {
43
- return el('div', { class: 'lh', 'data-in-hero': '' }, el('span', { class: 'ki' }, c3ic(head.icon)),
44
- el('div', { style: 'min-width:0' }, el('b', null, head.h), el('div', { class: 'dim' }, head.s)),
45
- head.ring ? c3ring(head.ring[0], Math.max(1, head.ring[1]), 44, head.ring[0] + '/' + head.ring[1]) : null);
46
- }
47
-
48
- /** The scope pills: All plus the first few initiatives of ctx.rows. Pressing one sets V.scope (an initiative id or null) and draws again. */
49
- const PILLS = 5;
50
- export function scopePills(V) {
51
- const rows = V.ctx.rows || [];
52
- return el('div', { class: 'chips2', 'data-in-scope': '' },
53
- el('button', { type: 'button', class: 'pill', 'aria-pressed': String(!V.scope), onClick: () => { V.scope = null; V.render(); } }, 'All'),
54
- ...rows.slice(0, PILLS).map((r) => el('button', { type: 'button', class: 'pill', 'aria-pressed': String(V.scope === r.id), 'data-in-pill': r.id, title: r.title, onClick: () => { V.scope = r.id; V.render(); } }, short(r.title, 14))),
55
- rows.length > PILLS ? el('span', { class: 'dim mono', style: 'font-size:var(--fs-2)' }, '+' + (rows.length - PILLS) + ' more in the list') : null);
56
- }
57
-
58
- /** Draw the frame into V.root. spec = { head, left: [nodes], right: [nodes], notice? }. */
59
- export function frame(V, spec) {
60
- V.root.replaceChildren(el('div', { class: 'calwrap' },
61
- el('div', { class: 'calbar' }, scopePills(V)),
62
- el('div', { class: 'calbody' },
63
- heroLine(spec.head), V.ctx.links || null,
64
- spec.notice ? el('div', { class: 'fold w', role: 'alert' }, c3ic('alert', 'sm'), spec.notice) : null,
65
- el('div', { class: 'brief sbb' }, el('div', { class: 'bcols' },
66
- el('div', { class: 'bcol l' }, V.ctx.plan || null, ...(spec.left || [])),
67
- el('div', { class: 'bcol r' }, ...(spec.right || [])))))));
68
- }
69
-
70
- /** A view made from { id, init(V), render(V) }. V = { ctx, scope, root, open, data, disposed, render() }. init starts the reads and calls V.render() when they land.
71
- * Returns { mount(host, ctx), dispose(host) }, the two functions c3-shell.js calls. */
72
- export function makeView(id, def) {
73
- const views = new WeakMap();
74
- function mount(host, ctx) {
75
- let V = views.get(host);
76
- if (V && V.ctx.ws !== ctx.ws) { dispose(host); V = null; }
77
- if (V) { V.ctx = ctx; V.render(); if (host.firstChild !== V.root) host.replaceChildren(V.root); return; }
78
- ensureComponentsCss();
79
- ensureC3Css();
80
- V = { ctx, scope: null, open: {}, data: {}, disposed: false, root: el('div', { class: 'c3', 'data-in-view': id }) };
81
- V.render = () => { if (!V.disposed) def.render(V); };
82
- V.stopPhone = c3Phone(V.root);
83
- views.set(host, V);
84
- host.replaceChildren(V.root);
85
- V.render();
86
- if (def.init) def.init(V);
87
- }
88
- function dispose(host) {
89
- const V = views.get(host);
90
- if (!V) return;
91
- V.disposed = true;
92
- if (V.dispose) V.dispose();
93
- if (V.stopPhone) V.stopPhone();
94
- views.delete(host);
95
- if (V.root.parentNode === host) V.root.remove();
96
- }
97
- return { mount, dispose };
98
- }
99
-
100
- /* ── the row, as the mockup draws it: one object that opens in place, swipes and takes keys (console3.html rows 3763 to 3777, rowAct 2421, 3877) ── */
101
-
102
- /** A line under the page: a toast, with an Undo for 8 seconds when `undo` is given. */
103
- export function say(text, undo) {
104
- toast(undo ? { text, actionLabel: 'Undo', onAction: undo, timeout: 8000 } : { text, timeout: 4000 });
105
- }
106
-
107
- const typing = (n) => !!(n && n.closest && n.closest('input,textarea,select,[contenteditable=true]'));
108
-
109
- /** Wire a list row: tap or Enter opens its case file in place (state kept in V.open[key] over every redraw), swipe and the arrow keys run
110
- * sw.onRight / sw.onLeft, e and n are the mockup's keys for the same two, j and k walk the rows. sw = { onRight, onLeft, labelRight, labelLeft, iconRight, iconLeft }. */
111
- export function wireRow(V, li, xp, key, sw) {
112
- V.open = V.open || {};
113
- attachExpand(li, xp, { key, initial: !!V.open[key], onToggle: (on) => { V.open[key] = on; } });
114
- if (sw) attachSwipe(li, sw);
115
- li.addEventListener('keydown', (e) => {
116
- if (e.target !== li || e.metaKey || e.ctrlKey || e.altKey || typing(e.target)) return;
117
- if (e.key === 'j' || e.key === 'k') {
118
- const rows = [...V.root.querySelectorAll('li[data-expand]')].filter((r) => r.offsetWidth > 0);
119
- const at = rows.indexOf(li); const to = rows[at + (e.key === 'j' ? 1 : -1)];
120
- if (to) { e.preventDefault(); to.focus(); }
121
- } else if (sw && e.key === 'e' && sw.onRight) { e.preventDefault(); sw.onRight(li, 'right'); }
122
- else if (sw && e.key === 'n' && sw.onLeft) { e.preventDefault(); sw.onLeft(li, 'left'); }
123
- });
124
- return li;
125
- }
126
-
127
- /** The case file of a row: the shared primitive, bound to the view's state. `model` is the mockup's case ({ sit, conf, chg, opts, cta, unsure, ign, go }).
128
- * The picked option is kept in V.pick[key]; once the PM has slid, V.done[key] = { label, undo } draws the result and an undo chip instead. */
129
- export function caseNode(V, key, model, { onConfirm, onGo, outbox } = {}) {
130
- V.pick = V.pick || {}; V.done = V.done || {};
131
- const m = { ...model, id: key };
132
- const d = V.done[key];
133
- if (d) {
134
- return el('div', { class: 'case', 'data-case': key, 'data-case-done': '', style: '--tc:var(--acc)' }, el('p', { class: 'sit' }, m.sit || ''),
135
- el('div', { class: 'chips2' }, el('span', { class: 'st ok' }, c3ic('check', 'sm'), d.label),
136
- d.undo ? el('button', { type: 'button', class: 'chip2 lk', 'data-case-undo': key, onclick: async () => { delete V.done[key]; try { await d.undo(); } catch { /* the caller reports its own errors */ } V.render(); } }, c3ic('undo', 'sm'), 'undo') : null));
137
- }
138
- return renderCase(m, { picked: V.pick[key], onPick: (id) => { V.pick[key] = id; }, onConfirm: (r) => { if (onConfirm) onConfirm(r.option, r); }, onGo, outbox: !!outbox });
139
- }
140
-
141
- /** Mark a case as done: the slide has been used. `undo` (optional) is what the undo chip runs. */
142
- export function markDone(V, key, label, undo) { V.done = V.done || {}; V.done[key] = { label, undo }; V.render(); }
143
-
144
- /** A list row skeleton: `li.nrow` with the kind glyph, the title (a span, so a press or a drag on it reaches the row), the chips and the case panel inside `.nb`. */
145
- export function rowShell(V, { key, attrs, icon, iconColor, title, titleNode, chips, xpContent, sw, hint }) {
146
- const li = el('li', { class: 'nrow', 'data-row': '', tabindex: '0', ...(attrs || {}) });
147
- const xp = el('div', { class: 'xp' }, el('div', { class: 'xi' }, xpContent));
148
- li.append(...[el('span', { class: 'ki', style: iconColor ? 'color:' + iconColor : null }, c3ic(icon || 'check')),
149
- el('div', { class: 'nb' }, titleNode || el('span', { class: 'tt' }, title), el('div', { class: 'chips' }, (chips || []).filter(Boolean)), xp),
150
- hint === false ? null : el('span', { class: 'sg', title: (sw && sw.labelRight ? 'Drag right: ' + sw.labelRight + '. ' : '') + (sw && sw.labelLeft ? 'Drag left: ' + sw.labelLeft + '.' : '') },
151
- el('span', { class: 'g l' }, c3ic('moon')), el('span', { class: 'g r y' }, c3ic('check')))].filter(Boolean));
152
- wireRow(V, li, xp, key, sw);
153
- return li;
154
- }
155
-
156
- /** The mockup's `goinit` (console3.html line 2030): leave for the Initiatives tab with that initiative chosen. Presses the page's own tab, the Lifecycle button and the initiative's
157
- * scope pill (the rows are read after the tab opens, so the pill is looked for for up to two seconds). A page without the shell finds no tab and does nothing. */
158
- export function goInitiative(id) {
159
- const tab = document.querySelector('[data-c3-tab="init"]'); if (!tab) return false;
160
- tab.click();
161
- const lc = document.querySelector('[data-c3-init="lifecycle"]'); if (lc) lc.click();
162
- let n = 0;
163
- const find = () => {
164
- const p = [...document.querySelectorAll('[data-lc-pill]')].find((b) => b.getAttribute('data-lc-pill') === id);
165
- if (p) { p.click(); return; }
166
- if (++n < 20) setTimeout(find, 100);
167
- };
168
- setTimeout(find, 60);
169
- return true;
170
- }