@floless/app 0.166.0 → 0.168.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 (261) hide show
  1. package/autostart.mjs +169 -63
  2. package/desktop-shell.mjs +335 -0
  3. package/dist/floless-server.cjs +20570 -14555
  4. package/dist/schemas/drawing-check.profile.v1.schema.json +1 -1
  5. package/dist/schemas/steel.model.v2.schema.json +4 -2
  6. package/dist/skills/floless-app-onboarding/SKILL.md +13 -4
  7. package/dist/skills/floless-app-onboarding/references/floless-surfaces.md +3 -0
  8. package/dist/skills/floless-app-steel-takeoff/SKILL.md +34 -3
  9. package/dist/skills/floless-app-ui/SKILL.md +2 -2
  10. package/dist/skills/floless-app-workflows/SKILL.md +2 -2
  11. package/dist/templates/college-phase-exporter.flo +11 -45
  12. package/dist/web/agents.js +1 -1
  13. package/dist/web/app.css +223 -8
  14. package/dist/web/app.js +53 -13
  15. package/dist/web/aware-update-client.js +13 -5
  16. package/dist/web/aware.js +559 -118
  17. package/dist/web/chat.css +23 -0
  18. package/dist/web/chat.js +1003 -83
  19. package/dist/web/commands-filter.js +28 -5
  20. package/dist/web/commands-shell.js +304 -18
  21. package/dist/web/commands-steel.js +1 -1
  22. package/dist/web/desktop-window.js +435 -0
  23. package/dist/web/drawing-check-editor.js +18 -10
  24. package/dist/web/failure-copy.js +14 -1
  25. package/dist/web/guide.js +75 -9
  26. package/dist/web/index.html +72 -12
  27. package/dist/web/instructor.js +1 -1
  28. package/dist/web/leave-guard.js +347 -14
  29. package/dist/web/pages.js +5 -1
  30. package/dist/web/panels.js +5 -2
  31. package/dist/web/pdf-view.js +421 -0
  32. package/dist/web/project-history.js +133 -11
  33. package/dist/web/project-modules.js +3 -1
  34. package/dist/web/project-rfis.js +3 -1
  35. package/dist/web/project-workflows.js +4 -2
  36. package/dist/web/reference-geometry-worker.js +11 -2
  37. package/dist/web/revit-editor.html +1 -0
  38. package/dist/web/revit-editor.js +37 -8
  39. package/dist/web/shared-prefs.js +364 -0
  40. package/dist/web/steel-ai-marks.js +45 -1
  41. package/dist/web/steel-editor.html +265 -58
  42. package/dist/web/steel-filter-flo.js +243 -23
  43. package/dist/web/steel-filter.html +58 -16
  44. package/dist/web/tab-signal.js +36 -1
  45. package/dist/web/tekla-editor.html +1 -0
  46. package/dist/web/terminal-requests.js +5 -0
  47. package/dist/web/tool-updates.js +220 -54
  48. package/dist/web/vector-3d.html +14 -3
  49. package/dist/web/vector-editor.html +10 -2
  50. package/dist/web/vendor/README.md +23 -0
  51. package/dist/web/vendor/pdfjs/LICENSE +177 -0
  52. package/dist/web/vendor/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
  53. package/dist/web/vendor/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
  54. package/dist/web/vendor/pdfjs/cmaps/78-H.bcmap +0 -0
  55. package/dist/web/vendor/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
  56. package/dist/web/vendor/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
  57. package/dist/web/vendor/pdfjs/cmaps/78-V.bcmap +0 -0
  58. package/dist/web/vendor/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
  59. package/dist/web/vendor/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
  60. package/dist/web/vendor/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
  61. package/dist/web/vendor/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
  62. package/dist/web/vendor/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
  63. package/dist/web/vendor/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
  64. package/dist/web/vendor/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
  65. package/dist/web/vendor/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
  66. package/dist/web/vendor/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
  67. package/dist/web/vendor/pdfjs/cmaps/Add-H.bcmap +0 -0
  68. package/dist/web/vendor/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
  69. package/dist/web/vendor/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
  70. package/dist/web/vendor/pdfjs/cmaps/Add-V.bcmap +0 -0
  71. package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
  72. package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
  73. package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
  74. package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
  75. package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
  76. package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
  77. package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
  78. package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  79. package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
  80. package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
  81. package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
  82. package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
  83. package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
  84. package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
  85. package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  86. package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
  87. package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
  88. package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
  89. package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
  90. package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
  91. package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
  92. package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
  93. package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  94. package/dist/web/vendor/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
  95. package/dist/web/vendor/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
  96. package/dist/web/vendor/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
  97. package/dist/web/vendor/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  98. package/dist/web/vendor/pdfjs/cmaps/B5-H.bcmap +0 -0
  99. package/dist/web/vendor/pdfjs/cmaps/B5-V.bcmap +0 -0
  100. package/dist/web/vendor/pdfjs/cmaps/B5pc-H.bcmap +0 -0
  101. package/dist/web/vendor/pdfjs/cmaps/B5pc-V.bcmap +0 -0
  102. package/dist/web/vendor/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
  103. package/dist/web/vendor/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
  104. package/dist/web/vendor/pdfjs/cmaps/CNS1-H.bcmap +0 -0
  105. package/dist/web/vendor/pdfjs/cmaps/CNS1-V.bcmap +0 -0
  106. package/dist/web/vendor/pdfjs/cmaps/CNS2-H.bcmap +0 -0
  107. package/dist/web/vendor/pdfjs/cmaps/CNS2-V.bcmap +3 -0
  108. package/dist/web/vendor/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
  109. package/dist/web/vendor/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
  110. package/dist/web/vendor/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
  111. package/dist/web/vendor/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
  112. package/dist/web/vendor/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
  113. package/dist/web/vendor/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
  114. package/dist/web/vendor/pdfjs/cmaps/EUC-H.bcmap +0 -0
  115. package/dist/web/vendor/pdfjs/cmaps/EUC-V.bcmap +0 -0
  116. package/dist/web/vendor/pdfjs/cmaps/Ext-H.bcmap +0 -0
  117. package/dist/web/vendor/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
  118. package/dist/web/vendor/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
  119. package/dist/web/vendor/pdfjs/cmaps/Ext-V.bcmap +0 -0
  120. package/dist/web/vendor/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
  121. package/dist/web/vendor/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
  122. package/dist/web/vendor/pdfjs/cmaps/GB-H.bcmap +4 -0
  123. package/dist/web/vendor/pdfjs/cmaps/GB-V.bcmap +0 -0
  124. package/dist/web/vendor/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
  125. package/dist/web/vendor/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
  126. package/dist/web/vendor/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
  127. package/dist/web/vendor/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
  128. package/dist/web/vendor/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
  129. package/dist/web/vendor/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
  130. package/dist/web/vendor/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
  131. package/dist/web/vendor/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
  132. package/dist/web/vendor/pdfjs/cmaps/GBT-H.bcmap +0 -0
  133. package/dist/web/vendor/pdfjs/cmaps/GBT-V.bcmap +0 -0
  134. package/dist/web/vendor/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
  135. package/dist/web/vendor/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
  136. package/dist/web/vendor/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
  137. package/dist/web/vendor/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
  138. package/dist/web/vendor/pdfjs/cmaps/H.bcmap +0 -0
  139. package/dist/web/vendor/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
  140. package/dist/web/vendor/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
  141. package/dist/web/vendor/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
  142. package/dist/web/vendor/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
  143. package/dist/web/vendor/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
  144. package/dist/web/vendor/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
  145. package/dist/web/vendor/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
  146. package/dist/web/vendor/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
  147. package/dist/web/vendor/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
  148. package/dist/web/vendor/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
  149. package/dist/web/vendor/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
  150. package/dist/web/vendor/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
  151. package/dist/web/vendor/pdfjs/cmaps/Hankaku.bcmap +0 -0
  152. package/dist/web/vendor/pdfjs/cmaps/Hiragana.bcmap +0 -0
  153. package/dist/web/vendor/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
  154. package/dist/web/vendor/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
  155. package/dist/web/vendor/pdfjs/cmaps/KSC-H.bcmap +0 -0
  156. package/dist/web/vendor/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
  157. package/dist/web/vendor/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
  158. package/dist/web/vendor/pdfjs/cmaps/KSC-V.bcmap +0 -0
  159. package/dist/web/vendor/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
  160. package/dist/web/vendor/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  161. package/dist/web/vendor/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  162. package/dist/web/vendor/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
  163. package/dist/web/vendor/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
  164. package/dist/web/vendor/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
  165. package/dist/web/vendor/pdfjs/cmaps/Katakana.bcmap +0 -0
  166. package/dist/web/vendor/pdfjs/cmaps/LICENSE +36 -0
  167. package/dist/web/vendor/pdfjs/cmaps/NWP-H.bcmap +0 -0
  168. package/dist/web/vendor/pdfjs/cmaps/NWP-V.bcmap +0 -0
  169. package/dist/web/vendor/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
  170. package/dist/web/vendor/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
  171. package/dist/web/vendor/pdfjs/cmaps/Roman.bcmap +0 -0
  172. package/dist/web/vendor/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  173. package/dist/web/vendor/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  174. package/dist/web/vendor/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  175. package/dist/web/vendor/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  176. package/dist/web/vendor/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  177. package/dist/web/vendor/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  178. package/dist/web/vendor/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  179. package/dist/web/vendor/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  180. package/dist/web/vendor/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
  181. package/dist/web/vendor/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
  182. package/dist/web/vendor/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
  183. package/dist/web/vendor/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
  184. package/dist/web/vendor/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
  185. package/dist/web/vendor/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
  186. package/dist/web/vendor/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
  187. package/dist/web/vendor/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
  188. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  189. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  190. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  191. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  192. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  193. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  194. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  195. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  196. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  197. package/dist/web/vendor/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  198. package/dist/web/vendor/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  199. package/dist/web/vendor/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  200. package/dist/web/vendor/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  201. package/dist/web/vendor/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  202. package/dist/web/vendor/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  203. package/dist/web/vendor/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  204. package/dist/web/vendor/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  205. package/dist/web/vendor/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  206. package/dist/web/vendor/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  207. package/dist/web/vendor/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  208. package/dist/web/vendor/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  209. package/dist/web/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  210. package/dist/web/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  211. package/dist/web/vendor/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
  212. package/dist/web/vendor/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
  213. package/dist/web/vendor/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
  214. package/dist/web/vendor/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
  215. package/dist/web/vendor/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
  216. package/dist/web/vendor/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
  217. package/dist/web/vendor/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
  218. package/dist/web/vendor/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
  219. package/dist/web/vendor/pdfjs/cmaps/V.bcmap +0 -0
  220. package/dist/web/vendor/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
  221. package/dist/web/vendor/pdfjs/iccs/CGATS001Compat-v2-micro.icc +0 -0
  222. package/dist/web/vendor/pdfjs/iccs/LICENSE +116 -0
  223. package/dist/web/vendor/pdfjs/pdf.min.mjs +28 -0
  224. package/dist/web/vendor/pdfjs/pdf.worker.mjs +64908 -0
  225. package/dist/web/vendor/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
  226. package/dist/web/vendor/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
  227. package/dist/web/vendor/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
  228. package/dist/web/vendor/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
  229. package/dist/web/vendor/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
  230. package/dist/web/vendor/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
  231. package/dist/web/vendor/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
  232. package/dist/web/vendor/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
  233. package/dist/web/vendor/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
  234. package/dist/web/vendor/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
  235. package/dist/web/vendor/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
  236. package/dist/web/vendor/pdfjs/standard_fonts/LICENSE_LIBERATION +363 -0
  237. package/dist/web/vendor/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
  238. package/dist/web/vendor/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
  239. package/dist/web/vendor/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
  240. package/dist/web/vendor/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
  241. package/dist/web/vendor/pdfjs/wasm/LICENSE_JBIG2 +196 -0
  242. package/dist/web/vendor/pdfjs/wasm/LICENSE_OPENJPEG +39 -0
  243. package/dist/web/vendor/pdfjs/wasm/LICENSE_PDFJS_JBIG2 +13 -0
  244. package/dist/web/vendor/pdfjs/wasm/LICENSE_PDFJS_OPENJPEG +22 -0
  245. package/dist/web/vendor/pdfjs/wasm/LICENSE_PDFJS_QCMS +19 -0
  246. package/dist/web/vendor/pdfjs/wasm/LICENSE_QCMS +21 -0
  247. package/dist/web/vendor/pdfjs/wasm/jbig2.wasm +0 -0
  248. package/dist/web/vendor/pdfjs/wasm/jbig2_nowasm_fallback.js +15 -0
  249. package/dist/web/vendor/pdfjs/wasm/openjpeg.wasm +0 -0
  250. package/dist/web/vendor/pdfjs/wasm/openjpeg_nowasm_fallback.js +17 -0
  251. package/dist/web/vendor/pdfjs/wasm/qcms_bg.wasm +0 -0
  252. package/dist/web/workspaces.js +527 -64
  253. package/home-env.mjs +28 -0
  254. package/install-path.mjs +59 -3
  255. package/launch-starting-page.mjs +35 -15
  256. package/launch.mjs +358 -51
  257. package/package.json +2 -1
  258. package/pin-home.mjs +6 -0
  259. package/post-update-marker.mjs +14 -0
  260. package/preferences-file.mjs +289 -0
  261. package/supervisor-lock.mjs +195 -0
@@ -0,0 +1,435 @@
1
+ /* ──────────────────────────────────────────────────────────────────────────
2
+ The FloLess window (Electron shell) — the page's half of the shell <-> page contract.
3
+
4
+ The shell (desktop/src/preload.cjs) exposes window.flolessDesktop on the server's own origin only. This file
5
+ feature-detects it (apiVersion 2 or newer) and, ONLY then:
6
+ - puts `desktop` on <html>, which every window-only style in app.css hangs off (the title bar, the narrow
7
+ header, the window wording);
8
+ - tells the shell the header's real colours (read from CSS, never hard-coded) and the app theme, now and
9
+ on every theme switch, so the native caption buttons and dialogs match;
10
+ - answers the shell's close request through the leave guard (a "Close FloLess?" question when work is unsaved);
11
+ - apiVersion 3: explains close-to-tray once ("FloLess keeps running"), and opens the Stop FloLess question when the tray's
12
+ "Stop FloLess…" asks for it (the page owns that question because /api/app/stop answers only to the page's own origin);
13
+ - hands app windows and the app's own floless://start link to the shell, whose main-frame check is the only
14
+ trusted opener (the shell's open handler never creates an app window);
15
+ - shows ≡ → Open in browser.
16
+ In a browser tab (no bridge, or an older one) none of that runs and the page is exactly the tab it always was —
17
+ except ≡ → Open in app, which is offered when the server says the window is installed.
18
+ This file is loaded in <head> so the class is on <html> before the first paint (no layout jump).
19
+ ────────────────────────────────────────────────────────────────────────── */
20
+ (function () {
21
+ 'use strict';
22
+
23
+ var doc = document;
24
+ var root = doc.documentElement;
25
+
26
+ /** The bridge, or null: an older shell (apiVersion 1) and a plain tab both mean "behave as the tab does". */
27
+ function bridge() {
28
+ var b = window.flolessDesktop;
29
+ return b && typeof b.apiVersion === 'number' && b.apiVersion >= 2 ? b : null;
30
+ }
31
+ var desktop = !!bridge();
32
+ if (desktop) root.classList.add('desktop');
33
+
34
+ /* ── colours ───────────────────────────────────────────────────────────── */
35
+
36
+ var hex2 = function (n) { var h = Math.max(0, Math.min(255, Math.round(n))).toString(16); return h.length < 2 ? '0' + h : h; };
37
+
38
+ /** A computed CSS colour as { hex: '#rrggbb', alpha } — or null when it cannot be read. Computed colours arrive as
39
+ * rgb()/rgba(), or color(srgb …) for colour-mix(); anything else is rasterised by a canvas (real browsers). */
40
+ function parseColor(css) {
41
+ var s = String(css || '').trim();
42
+ var m = /^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:\s*[,/]\s*([\d.]+%?))?\s*\)$/i.exec(s);
43
+ var r; var g; var b; var a = 1;
44
+ if (m) {
45
+ r = +m[1]; g = +m[2]; b = +m[3];
46
+ if (m[4] !== undefined) a = /%$/.test(m[4]) ? parseFloat(m[4]) / 100 : parseFloat(m[4]);
47
+ } else {
48
+ m = /^color\(\s*srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+%?))?\s*\)$/i.exec(s);
49
+ if (m) {
50
+ r = +m[1] * 255; g = +m[2] * 255; b = +m[3] * 255;
51
+ if (m[4] !== undefined) a = /%$/.test(m[4]) ? parseFloat(m[4]) / 100 : parseFloat(m[4]);
52
+ } else {
53
+ try {
54
+ var ctx = doc.createElement('canvas').getContext('2d', { willReadFrequently: true });
55
+ ctx.clearRect(0, 0, 1, 1);
56
+ ctx.fillStyle = s;
57
+ ctx.fillRect(0, 0, 1, 1);
58
+ var d = ctx.getImageData(0, 0, 1, 1).data;
59
+ r = d[0]; g = d[1]; b = d[2]; a = d[3] / 255;
60
+ } catch (_) { return null; }
61
+ }
62
+ }
63
+ if (![r, g, b, a].every(function (n) { return isFinite(n); })) return null;
64
+ return { hex: '#' + hex2(r) + hex2(g) + hex2(b), alpha: a };
65
+ }
66
+
67
+ /** The header's background (the first opaque one from the header outwards) and its text colour. */
68
+ function headerColors() {
69
+ var header = doc.querySelector('header');
70
+ if (!header || typeof getComputedStyle !== 'function') return null;
71
+ var bg = null;
72
+ for (var n = header; n && !bg; n = n.parentElement) {
73
+ var c = parseColor(getComputedStyle(n).backgroundColor);
74
+ if (c && c.alpha > 0.99) bg = c.hex;
75
+ }
76
+ var fg = parseColor(getComputedStyle(header).color);
77
+ return bg && fg ? { bg: bg, fg: fg.hex } : null;
78
+ }
79
+
80
+ var lastColors = '';
81
+ var lastTheme = '';
82
+ function swallow(p) { if (p && typeof p.catch === 'function') p.catch(function () { /* the shell is going away */ }); }
83
+
84
+ /** Push the header colours and the app theme to the shell. Cheap to call: unchanged values are not re-sent. */
85
+ function syncChrome() {
86
+ var b = bridge();
87
+ if (!b) return;
88
+ var theme = root.dataset.theme === 'light' ? 'light' : 'dark';
89
+ if (theme !== lastTheme && typeof b.setTheme === 'function') { lastTheme = theme; swallow(b.setTheme(theme)); }
90
+ var colors = headerColors();
91
+ if (colors && typeof b.setTitleBarColors === 'function') {
92
+ var key = colors.bg + '/' + colors.fg;
93
+ if (key !== lastColors) { lastColors = key; swallow(b.setTitleBarColors(colors)); }
94
+ }
95
+ }
96
+
97
+ /* ── the shell's close request ─────────────────────────────────────────── */
98
+
99
+ /** Ask the leave guard (a clean page answers at once), then tell the shell. Always answers — a guard that is missing
100
+ * or breaks must not leave the window unclosable, which is also what the preload does when no handler exists. */
101
+ async function answerCloseRequest() {
102
+ var b = bridge();
103
+ if (!b) return;
104
+ var ok = true;
105
+ try {
106
+ var guard = window.flolessLeaveGuard;
107
+ if (guard && typeof guard.confirmClose === 'function') ok = (await guard.confirmClose()) === true;
108
+ } catch (_) { ok = true; }
109
+ if (ok) window.__flolessLeaving = true; // no browser "Leave site?" prompt on top of the answer
110
+ swallow(b.answerClose(ok));
111
+ }
112
+
113
+ /* ── close to the tray (apiVersion 3) ──────────────────────────────────── */
114
+
115
+ /** The shell asks on EVERY X press while the tray is on, until the person ticks "Don't show this again" and chooses Got it
116
+ * (that is what records trayExplained; Stop FloLess… and cancelling record nothing, so the question comes back next time).
117
+ * The answer goes back with the request's id; a newer press supersedes an open question (same dialog, newer id). */
118
+ var trayAsk = null; // { id, returnFocus, covered, onKey, onDown, onClick }
119
+
120
+ function bridge3() {
121
+ var b = bridge();
122
+ return b && b.apiVersion >= 3 && typeof b.answerCloseToTray === 'function' ? b : null;
123
+ }
124
+
125
+ function answerTray(choice) {
126
+ var ask = trayAsk;
127
+ var b = bridge3();
128
+ if (!ask) return;
129
+ if (choice === 'hide' && doc.getElementById('close-tray-dont').checked && window.flolessPrefs && typeof window.flolessPrefs.set === 'function') {
130
+ window.flolessPrefs.set('trayExplained', true);
131
+ }
132
+ closeTrayDialog();
133
+ if (b) swallow(b.answerCloseToTray(ask.id, choice));
134
+ if (choice === 'cancel' && ask.returnFocus && ask.returnFocus.isConnected && typeof ask.returnFocus.focus === 'function') ask.returnFocus.focus();
135
+ }
136
+
137
+ function closeTrayDialog() {
138
+ var ask = trayAsk;
139
+ if (!ask) return;
140
+ trayAsk = null;
141
+ var modal = doc.getElementById('close-tray-modal');
142
+ modal.classList.remove('show');
143
+ doc.removeEventListener('keydown', ask.onKey, true);
144
+ modal.removeEventListener('mousedown', ask.onDown);
145
+ modal.removeEventListener('click', ask.onClick);
146
+ ask.covered.forEach(function (c) {
147
+ c.m.inert = c.inert;
148
+ if (c.hidden === null) c.m.removeAttribute('aria-hidden'); else c.m.setAttribute('aria-hidden', c.hidden);
149
+ });
150
+ }
151
+
152
+ function showCloseToTray(request) {
153
+ var b = bridge3();
154
+ if (!b) return;
155
+ var id = request && typeof request.id === 'string' ? request.id : '';
156
+ var modal = doc.getElementById('close-tray-modal');
157
+ if (!id) return;
158
+ if (trayAsk) { trayAsk.id = id; return; } // pressed X again: the open question now answers the newest press
159
+ // Already explained (ticked "Don't show this again"): hide at once. The shell learns the preference only on its next
160
+ // status poll, so the page, which holds the fresh value, is the one that must not ask a second time.
161
+ if (window.flolessPrefs && typeof window.flolessPrefs.get === 'function' && window.flolessPrefs.get('trayExplained') === true) {
162
+ swallow(b.answerCloseToTray(id, 'hide'));
163
+ return;
164
+ }
165
+ if (!modal) { swallow(b.answerCloseToTray(id, 'hide')); return; } // no dialog to show: the shell's own default, never a refusal
166
+ var covered = Array.prototype.slice.call(doc.querySelectorAll('.modal-backdrop.show'))
167
+ .filter(function (m) { return m !== modal; })
168
+ .map(function (m) { return { m: m, inert: !!m.inert, hidden: m.getAttribute('aria-hidden') }; });
169
+ covered.forEach(function (c) { c.m.inert = true; c.m.setAttribute('aria-hidden', 'true'); });
170
+ var downOnBackdrop = false;
171
+ var ask = {
172
+ id: id,
173
+ returnFocus: doc.activeElement && doc.activeElement.focus ? doc.activeElement : null,
174
+ covered: covered,
175
+ onKey: function (e) {
176
+ if (e.key === 'Escape') { e.preventDefault(); e.stopPropagation(); answerTray('cancel'); return; }
177
+ if (e.key !== 'Tab') return;
178
+ e.stopPropagation();
179
+ var focusable = Array.prototype.slice.call(modal.querySelectorAll('button:not([disabled]), input:not([disabled])'))
180
+ .filter(function (n) { return n.getClientRects().length; });
181
+ if (!focusable.length) { e.preventDefault(); return; }
182
+ var first = focusable[0]; var last = focusable[focusable.length - 1];
183
+ if (e.shiftKey && (doc.activeElement === first || !modal.contains(doc.activeElement))) { e.preventDefault(); last.focus(); }
184
+ else if (!e.shiftKey && (doc.activeElement === last || !modal.contains(doc.activeElement))) { e.preventDefault(); first.focus(); }
185
+ },
186
+ onDown: function (e) { downOnBackdrop = e.target === modal; },
187
+ onClick: function (e) { var hit = e.target === modal && downOnBackdrop; downOnBackdrop = false; if (hit) answerTray('cancel'); },
188
+ };
189
+ trayAsk = ask;
190
+ doc.getElementById('close-tray-dont').checked = false;
191
+ // Capture: this question sits above everything else, so its keys must not reach another dialog.
192
+ doc.addEventListener('keydown', ask.onKey, true);
193
+ modal.addEventListener('mousedown', ask.onDown);
194
+ modal.addEventListener('click', ask.onClick);
195
+ modal.classList.add('show');
196
+ setTimeout(function () { var ok = doc.getElementById('close-tray-ok'); if (ok && typeof ok.focus === 'function') ok.focus(); }, 0);
197
+ }
198
+
199
+ function wireCloseTray() {
200
+ var ok = doc.getElementById('close-tray-ok');
201
+ var stop = doc.getElementById('close-tray-stop');
202
+ if (ok) ok.addEventListener('click', function () { answerTray('hide'); });
203
+ if (stop) stop.addEventListener('click', function () { answerTray('stop'); });
204
+ }
205
+
206
+ /** The tray's commands. Only 'stop' exists: it opens the leave guard's Stop FloLess question here, in the page. True means
207
+ * "the question is on screen" (the shell shows the person a message when it does not hear that). Never stops anything itself. */
208
+ function onShellCommand(message) {
209
+ if (!message || message.command !== 'stop') return false;
210
+ var guard = window.flolessLeaveGuard;
211
+ if (window.__flolessStopped) return true; // already stopped: the stopped screen is the answer
212
+ if (!guard || typeof guard.stopApp !== 'function') return false;
213
+ var open = typeof guard.openAction === 'function' ? guard.openAction() : null;
214
+ if (open === 'stop') return true; // already asking
215
+ if (open) return false; // another question is open; this one cannot be shown over it
216
+ try { var run = guard.stopApp(); if (run && typeof run.catch === 'function') run.catch(function () { /* the question reports its own failures */ }); }
217
+ catch (_) { return false; }
218
+ return typeof guard.openAction === 'function' ? guard.openAction() === 'stop' : true;
219
+ }
220
+
221
+ /* ── opening things ────────────────────────────────────────────────────── */
222
+
223
+ function here() { return location.pathname + location.search; }
224
+
225
+ function openInBrowser() {
226
+ var b = bridge();
227
+ if (b) swallow(b.openInBrowser(here()));
228
+ }
229
+
230
+ function toast(text) {
231
+ if (typeof window.showToast !== 'function') return;
232
+ // The server's own sentence, written for people: showToast would swap raw-looking text for its generic line.
233
+ var authored = typeof window.authoredToastCopy === 'function' ? window.authoredToastCopy(text) : text;
234
+ window.showToast(authored, 'warn');
235
+ }
236
+
237
+ /** ≡ → Open in app: the server starts the window through its launcher. When it cannot, the person is told why and
238
+ * keeps working here; when the request itself fails, the registered floless://window link is the fallback. */
239
+ async function openInApp() {
240
+ var answer = null;
241
+ try {
242
+ var res = await fetch('/api/desktop/open-window', { method: 'POST' });
243
+ if (!res.ok) throw new Error('refused');
244
+ answer = await res.json();
245
+ } catch (_) {
246
+ var a = doc.createElement('a');
247
+ a.href = 'floless://window';
248
+ a.hidden = true;
249
+ doc.body.appendChild(a);
250
+ a.click();
251
+ a.remove();
252
+ return;
253
+ }
254
+ if (answer && answer.started === false) {
255
+ toast(typeof answer.message === 'string' && answer.message
256
+ ? answer.message
257
+ : 'FloLess could not open its window from here. You can keep working in this tab.');
258
+ }
259
+ }
260
+
261
+ /** Only a shipped top-level UI page opens as an app window; everything else (a blob: report, a download, a
262
+ * website) keeps going through window.open to the shell's own handler. */
263
+ function isAppPagePath(pathname) {
264
+ return pathname === '/' || /^\/[A-Za-z0-9._-]+\.html$/.test(pathname);
265
+ }
266
+
267
+ function installWindowOpen() {
268
+ var native = window.open;
269
+ window.open = function (url) {
270
+ var b = bridge();
271
+ if (b && typeof url === 'string' && url) {
272
+ var target = null;
273
+ try { target = new URL(url, location.href); } catch (_) { target = null; }
274
+ if (target && target.origin === location.origin && isAppPagePath(target.pathname)) {
275
+ swallow(b.openAppWindow(target.pathname + target.search));
276
+ return null;
277
+ }
278
+ }
279
+ return native.apply(window, arguments);
280
+ };
281
+ }
282
+
283
+ /** The app's own floless://start link (the stopped screen, the offline overlay, the footer restart). In the window the
284
+ * shell hands it to the registered protocol handler; a tab leaves the plain link alone. */
285
+ function onDocumentClick(event) {
286
+ var b = bridge();
287
+ if (!b || typeof b.openFloless !== 'function') return;
288
+ var link = event.target && event.target.closest ? event.target.closest('a[href]') : null;
289
+ if (!link || link.getAttribute('href') !== 'floless://start') return;
290
+ event.preventDefault();
291
+ swallow(b.openFloless('start'));
292
+ }
293
+
294
+ /* ── the ≡ items ───────────────────────────────────────────────────────── */
295
+
296
+ var shellInstalled = false;
297
+ var TRAY_ON = 'Closing this window leaves FloLess running, with its icon near the clock.';
298
+ var TRAY_OFF = 'The icon near the clock is removed. Closing this window then closes the window only; FloLess keeps running and your routines still run.';
299
+ var SAVE_FAILED = 'FloLess could not save that. Try again in a moment.';
300
+ var saveFailed = { client: false, tray: false };
301
+
302
+ function prefs() { return window.flolessPrefs && typeof window.flolessPrefs.get === 'function' ? window.flolessPrefs : null; }
303
+
304
+ /** Open in browser / Open in app, "Open FloLess in" (Window | Browser) and "Keep FloLess in the tray", each from live state. */
305
+ function paintMenu() {
306
+ var inBrowser = doc.getElementById('menu-open-in-browser');
307
+ var inApp = doc.getElementById('menu-open-in-app');
308
+ if (inBrowser) inBrowser.hidden = !desktop;
309
+ if (inApp) inApp.hidden = desktop || !shellInstalled;
310
+ var p = prefs();
311
+ var client = doc.getElementById('menu-client');
312
+ if (client) {
313
+ // Only where the window exists: always inside it, in a tab only once the server reports it installed.
314
+ client.hidden = !(p && (desktop || shellInstalled));
315
+ var chosen = p && p.get('client') === 'window' ? 'window' : 'browser';
316
+ Array.prototype.forEach.call(client.querySelectorAll('.client-btn'), function (b) {
317
+ var on = b.getAttribute('data-client') === chosen;
318
+ b.classList.toggle('active', on);
319
+ b.setAttribute('aria-checked', on ? 'true' : 'false');
320
+ });
321
+ }
322
+ var tray = doc.getElementById('menu-tray');
323
+ if (tray) {
324
+ tray.hidden = !(p && desktop && bridge3());
325
+ var toggle = doc.getElementById('menu-tray-toggle');
326
+ var on = !p || p.get('tray') !== false;
327
+ if (toggle) toggle.checked = on;
328
+ var hint = doc.getElementById('menu-tray-hint');
329
+ if (hint) hint.textContent = saveFailed.tray ? SAVE_FAILED : (on ? TRAY_ON : TRAY_OFF);
330
+ }
331
+ var clientHint = doc.getElementById('menu-client-hint');
332
+ if (clientHint) { clientHint.textContent = saveFailed.client ? SAVE_FAILED : ''; clientHint.hidden = !saveFailed.client; }
333
+ }
334
+
335
+ /** Save a preference; when it does not save, repaint from what is really stored and say so once, in the control's hint.
336
+ * The sentence clears on the next success. */
337
+ function savePref(key, value) {
338
+ var p = prefs();
339
+ if (!p) return;
340
+ var result;
341
+ try { result = p.set(key, value); } catch (_) { result = false; }
342
+ Promise.resolve(result).then(function (ok) { return ok !== false; }, function () { return false; }).then(function (ok) {
343
+ saveFailed[key] = !ok;
344
+ paintMenu();
345
+ });
346
+ }
347
+
348
+ function wireMenu() {
349
+ var client = doc.getElementById('menu-client');
350
+ if (client) {
351
+ Array.prototype.forEach.call(client.querySelectorAll('.client-btn'), function (b) {
352
+ b.addEventListener('click', function () {
353
+ if (!prefs()) return;
354
+ savePref('client', b.getAttribute('data-client') === 'window' ? 'window' : 'browser');
355
+ paintMenu();
356
+ });
357
+ });
358
+ }
359
+ var toggle = doc.getElementById('menu-tray-toggle');
360
+ if (toggle) {
361
+ toggle.addEventListener('change', function () {
362
+ if (!prefs()) { paintMenu(); return; }
363
+ savePref('tray', toggle.checked);
364
+ paintMenu();
365
+ });
366
+ }
367
+ var p = prefs();
368
+ if (p && typeof p.onChange === 'function') p.onChange(paintMenu);
369
+ var menuBtn = doc.getElementById('menu-btn');
370
+ // The other client may have changed these meanwhile: look again whenever the menu opens.
371
+ if (menuBtn && p && typeof p.refetch === 'function') menuBtn.addEventListener('click', function () { void p.refetch(false); });
372
+ }
373
+
374
+ /** Whether the window is installed next to this server (GET /api/health → desktopShell.installed). Only a tab asks. */
375
+ async function refreshInstalled() {
376
+ if (desktop) return;
377
+ try {
378
+ if (window.flolessStartupAdmission && typeof window.flolessStartupAdmission.admit === 'function') {
379
+ await window.flolessStartupAdmission.admit('/api/health');
380
+ }
381
+ var res = await fetch('/api/health');
382
+ if (!res.ok) return;
383
+ var health = await res.json();
384
+ shellInstalled = !!(health && health.desktopShell && health.desktopShell.installed === true);
385
+ } catch (_) { shellInstalled = false; }
386
+ paintMenu();
387
+ }
388
+
389
+ /* ── start ─────────────────────────────────────────────────────────────── */
390
+
391
+ function start() {
392
+ wireMenu();
393
+ wireCloseTray();
394
+ paintMenu();
395
+ var b = bridge();
396
+ if (b) {
397
+ syncChrome();
398
+ if (typeof b.onCloseRequested === 'function') b.onCloseRequested(answerCloseRequest);
399
+ // apiVersion 3. Registered at page start, as soon as the leave guard exists, so a tray "Stop FloLess…" is not lost.
400
+ if (b.apiVersion >= 3) {
401
+ if (typeof b.onCloseToTray === 'function') b.onCloseToTray(showCloseToTray);
402
+ if (typeof b.onShellCommand === 'function') b.onShellCommand(onShellCommand);
403
+ }
404
+ if (typeof MutationObserver === 'function') {
405
+ new MutationObserver(syncChrome).observe(root, { attributes: true, attributeFilter: ['data-theme'] });
406
+ }
407
+ // Late stylesheet or font work can move the header colours after first paint.
408
+ window.addEventListener('load', syncChrome);
409
+ doc.addEventListener('click', onDocumentClick, true);
410
+ installWindowOpen();
411
+ } else {
412
+ void refreshInstalled();
413
+ var menuBtn = doc.getElementById('menu-btn');
414
+ // The window can be installed or removed while the tab is open: ask again whenever the menu opens.
415
+ if (menuBtn) menuBtn.addEventListener('click', function () { void refreshInstalled(); });
416
+ }
417
+ }
418
+
419
+ if (doc.readyState === 'loading') doc.addEventListener('DOMContentLoaded', start);
420
+ else start();
421
+
422
+ window.flolessDesktopWindow = {
423
+ isDesktop: function () { return desktop; },
424
+ syncChrome: syncChrome,
425
+ headerColors: headerColors,
426
+ parseColor: parseColor,
427
+ openInBrowser: openInBrowser,
428
+ openInApp: openInApp,
429
+ refreshInstalled: refreshInstalled,
430
+ answerCloseRequest: answerCloseRequest,
431
+ showCloseToTray: showCloseToTray,
432
+ onShellCommand: onShellCommand,
433
+ paintMenu: paintMenu,
434
+ };
435
+ })();
@@ -787,6 +787,14 @@ function boot() {
787
787
  <main>${S.loadError ? `<section role="tabpanel"><div class="wrap"><p class="${S.accessError ? 'band' : 'err-line'}" role="alert">${esc(S.loadError)}</p><button type="button" data-act="reload" data-command-id="drawing-check.reload">Reload</button></div></section>` : panel()}</main>`);
788
788
  if (S.tab === 'runs' && S.run) mountRunView();
789
789
  }
790
+ /** Repaint without moving the tab's scrolled list: render() replaces the scrolling panel, which starts at the top. */
791
+ function renderKeepingScroll() {
792
+ const scroller = root.querySelector('section[role=tabpanel]');
793
+ const top = scroller ? scroller.scrollTop : 0;
794
+ render();
795
+ const again = root.querySelector('section[role=tabpanel]');
796
+ if (again && top) again.scrollTop = top;
797
+ }
790
798
  function panel() {
791
799
  const attrs = (k, cls = '') => `role="tabpanel" id="panel-${k}" aria-labelledby="tab-${k}"${cls ? ` class="${cls}"` : ''}`;
792
800
  if (S.tab === 'references') return `<section ${attrs('references')}>${referencesHtml()}</section>`;
@@ -1213,14 +1221,14 @@ function boot() {
1213
1221
  const { body } = await call(`${base}/items`, jsonOpts('PUT', { items: edits }, S.etag ? { 'if-match': S.etag } : {}));
1214
1222
  S.etag = body.etag;
1215
1223
  // Only the LAST answer replaces the list: an earlier one predates ticks still queued behind it,
1216
- // and painting it would flick those ticks back until their own answer arrived.
1217
- if (itemsInFlight === 1) { S.draft.items = body.items; await loadReview(); render(); }
1224
+ // and painting it would flick those ticks back until their own answer arrived. The list keeps its scroll.
1225
+ if (itemsInFlight === 1) { S.draft.items = body.items; await loadReview(); renderKeepingScroll(); }
1218
1226
  return body;
1219
1227
  } catch (e) {
1220
1228
  if (e.status === 412 || e.status === 428) S.conflict = true;
1221
1229
  else S.checklistError = e.message;
1222
1230
  await loadDraft().catch(() => {}); // show what the profile really holds, not the optimistic ticks
1223
- render();
1231
+ renderKeepingScroll();
1224
1232
  return null;
1225
1233
  } finally { itemsInFlight--; }
1226
1234
  });
@@ -2359,8 +2367,12 @@ function boot() {
2359
2367
  return;
2360
2368
  }
2361
2369
  if (t.dataset.item) {
2362
- // Optimistic: the box stays as clicked while its PUT waits its turn behind any earlier tick.
2363
- const it = items().find((i) => i.id === t.dataset.item); if (it) it.enabled = t.checked;
2370
+ // Optimistic: the box stays as clicked while its PUT waits its turn behind any earlier tick, and the page
2371
+ // is painted now, so the footer's "N of M items ticked" counts it at once rather than when the save and the
2372
+ // review after it have answered (#2570). Focus stays on the box (paintKeepingFocus) and the list where it was
2373
+ // scrolled; an earlier tick's error is not announced again as if this one had failed.
2374
+ const it = items().find((i) => i.id === t.dataset.item);
2375
+ if (it) { it.enabled = t.checked; S.checklistError = ''; renderKeepingScroll(); }
2364
2376
  await putItems([{ id: t.dataset.item, enabled: t.checked }]);
2365
2377
  root.querySelector(`[data-item="${CSS.escape(t.dataset.item)}"]`)?.focus();
2366
2378
  return;
@@ -2456,11 +2468,7 @@ function boot() {
2456
2468
  // The run on screen does not show the references or the design set: it is left alone, and the next paint shows
2457
2469
  // what was read.
2458
2470
  if (S.tab === 'runs' && S.run) return;
2459
- const scroller = root.querySelector('section[role=tabpanel]');
2460
- const top = scroller ? scroller.scrollTop : 0;
2461
- render();
2462
- const again = root.querySelector('section[role=tabpanel]');
2463
- if (again && top) again.scrollTop = top;
2471
+ renderKeepingScroll();
2464
2472
  });
2465
2473
  }
2466
2474
  // The workspace relays what changed (from its own event stream; this page opens none, see tellModelFrame in
@@ -163,6 +163,19 @@ function failureCopy(error, ctx) {
163
163
  return { kind, type: 'err', text: said([`Couldn’t ${action}, and FloLess couldn’t tell why.`, unsure, report]) };
164
164
  }
165
165
 
166
+ /**
167
+ * #3097: the same sentence for a page's own empty or error state, which shows a headline and a line under it: the first
168
+ * sentence (what could not be done) is the headline, the rest (why, and what to do) the detail. Standalone pages
169
+ * (the Drawing Filter, the editors) load this file for it, so no page builds its own "(error 403)" again.
170
+ * @returns {{ kind: string, type: 'warn'|'err', headline: string, detail: string }}
171
+ */
172
+ function failureParts(error, ctx) {
173
+ const copy = failureCopy(error, ctx);
174
+ const cut = copy.text.search(/[.!?](?=\s)/);
175
+ if (cut < 0) return { kind: copy.kind, type: copy.type, headline: copy.text, detail: '' };
176
+ return { kind: copy.kind, type: copy.type, headline: copy.text.slice(0, cut + 1), detail: copy.text.slice(cut + 1).trim() };
177
+ }
178
+
166
179
  if (typeof module !== 'undefined' && module.exports) {
167
- module.exports = { failureKind, failureCopy, FAILURE_BUSY_CODES, FAILURE_BUSY_WORK };
180
+ module.exports = { failureKind, failureCopy, failureParts, FAILURE_BUSY_CODES, FAILURE_BUSY_WORK };
168
181
  }