@floless/app 0.167.0 → 0.169.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/autostart.mjs +169 -63
- package/cli-actions.mjs +8 -1
- package/desktop-shell.mjs +335 -0
- package/dist/floless-server.cjs +73121 -55759
- package/dist/schemas/steel.model.v2.schema.json +2 -1
- package/dist/skills/floless-app-onboarding/SKILL.md +13 -4
- package/dist/skills/floless-app-onboarding/references/floless-surfaces.md +3 -0
- package/dist/skills/floless-app-rfi/SKILL.md +4 -2
- package/dist/skills/floless-app-steel-takeoff/SKILL.md +21 -2
- package/dist/skills/floless-app-ui/SKILL.md +2 -2
- package/dist/skills/floless-app-workflows/SKILL.md +2 -2
- package/dist/templates/college-phase-exporter.flo +7 -2
- package/dist/templates/trimble-list-projects.flo +10 -2
- package/dist/web/agent-steps.js +2 -2
- package/dist/web/agents.js +50 -14
- package/dist/web/app.css +209 -11
- package/dist/web/app.js +99 -16
- package/dist/web/aware-update-client.js +14 -6
- package/dist/web/aware.js +583 -69
- package/dist/web/chat.css +12 -1
- package/dist/web/chat.js +627 -96
- package/dist/web/commands-drawing-check.js +3 -0
- package/dist/web/commands-filter.js +5 -5
- package/dist/web/commands-shell.js +283 -14
- package/dist/web/commands-steel.js +9 -2
- package/dist/web/commands-vector.js +69 -0
- package/dist/web/desktop-window.js +435 -0
- package/dist/web/drawing-check-editor.html +10 -0
- package/dist/web/drawing-check-editor.js +515 -187
- package/dist/web/failure-copy.js +33 -2
- package/dist/web/flo-3d.js +310 -0
- package/dist/web/flo-card.js +72 -0
- package/dist/web/guide.js +78 -10
- package/dist/web/index.html +90 -10
- package/dist/web/instructor.js +4 -1
- package/dist/web/leave-guard.js +347 -14
- package/dist/web/model-editor-steel-adapter.js +41 -1
- package/dist/web/model-viewport-toolbar.js +11 -0
- package/dist/web/pages.js +21 -14
- package/dist/web/panels.js +5 -2
- package/dist/web/pdf-view.js +421 -0
- package/dist/web/project-history.js +3 -2
- package/dist/web/project-modules.js +5 -3
- package/dist/web/project-reconciliation.js +1 -1
- package/dist/web/project-rfis.js +4 -2
- package/dist/web/project-workflows.js +8 -4
- package/dist/web/reference-geometry-worker.js +11 -2
- package/dist/web/renderers.js +6 -0
- package/dist/web/report-csp.js +68 -0
- package/dist/web/revit-editor.html +1 -0
- package/dist/web/revit-editor.js +37 -8
- package/dist/web/run-history.js +2 -3
- package/dist/web/shared-prefs.js +364 -0
- package/dist/web/steel-3d-flo.js +309 -0
- package/dist/web/steel-3d-view.js +159 -0
- package/dist/web/steel-editor.html +329 -47
- package/dist/web/steel-filter-flo.js +74 -18
- package/dist/web/steel-filter.html +22 -6
- package/dist/web/tab-signal.js +36 -1
- package/dist/web/tekla-editor.html +1 -0
- package/dist/web/terminal-requests.js +78 -0
- package/dist/web/tool-updates.js +160 -38
- package/dist/web/vector-3d.html +14 -3
- package/dist/web/vector-editor.html +60 -10
- package/dist/web/vendor/README.md +23 -0
- package/dist/web/vendor/pdfjs/LICENSE +177 -0
- package/dist/web/vendor/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/78-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/78-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Add-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Add-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/B5-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/B5-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/B5pc-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/B5pc-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/CNS1-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/CNS1-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/CNS2-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/CNS2-V.bcmap +3 -0
- package/dist/web/vendor/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
- package/dist/web/vendor/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/EUC-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/EUC-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Ext-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Ext-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/GB-H.bcmap +4 -0
- package/dist/web/vendor/pdfjs/cmaps/GB-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/GBT-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/GBT-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Hankaku.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Hiragana.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/KSC-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/KSC-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Katakana.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/LICENSE +36 -0
- package/dist/web/vendor/pdfjs/cmaps/NWP-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/NWP-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/Roman.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/V.bcmap +0 -0
- package/dist/web/vendor/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
- package/dist/web/vendor/pdfjs/iccs/CGATS001Compat-v2-micro.icc +0 -0
- package/dist/web/vendor/pdfjs/iccs/LICENSE +116 -0
- package/dist/web/vendor/pdfjs/pdf.min.mjs +28 -0
- package/dist/web/vendor/pdfjs/pdf.worker.mjs +64908 -0
- package/dist/web/vendor/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
- package/dist/web/vendor/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
- package/dist/web/vendor/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
- package/dist/web/vendor/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
- package/dist/web/vendor/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
- package/dist/web/vendor/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
- package/dist/web/vendor/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
- package/dist/web/vendor/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
- package/dist/web/vendor/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
- package/dist/web/vendor/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
- package/dist/web/vendor/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
- package/dist/web/vendor/pdfjs/standard_fonts/LICENSE_LIBERATION +363 -0
- package/dist/web/vendor/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
- package/dist/web/vendor/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
- package/dist/web/vendor/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
- package/dist/web/vendor/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
- package/dist/web/vendor/pdfjs/wasm/LICENSE_JBIG2 +196 -0
- package/dist/web/vendor/pdfjs/wasm/LICENSE_OPENJPEG +39 -0
- package/dist/web/vendor/pdfjs/wasm/LICENSE_PDFJS_JBIG2 +13 -0
- package/dist/web/vendor/pdfjs/wasm/LICENSE_PDFJS_OPENJPEG +22 -0
- package/dist/web/vendor/pdfjs/wasm/LICENSE_PDFJS_QCMS +19 -0
- package/dist/web/vendor/pdfjs/wasm/LICENSE_QCMS +21 -0
- package/dist/web/vendor/pdfjs/wasm/jbig2.wasm +0 -0
- package/dist/web/vendor/pdfjs/wasm/jbig2_nowasm_fallback.js +15 -0
- package/dist/web/vendor/pdfjs/wasm/openjpeg.wasm +0 -0
- package/dist/web/vendor/pdfjs/wasm/openjpeg_nowasm_fallback.js +17 -0
- package/dist/web/vendor/pdfjs/wasm/qcms_bg.wasm +0 -0
- package/dist/web/workspace-root-management.js +1 -1
- package/dist/web/workspaces.js +792 -165
- package/home-env.mjs +28 -0
- package/install-path.mjs +59 -3
- package/launch-starting-page.mjs +35 -15
- package/launch.mjs +363 -51
- package/package.json +9 -8
- package/pin-home.mjs +6 -0
- package/post-update-marker.mjs +14 -0
- package/preferences-file.mjs +289 -0
- package/supervisor-lock.mjs +195 -0
|
@@ -141,6 +141,75 @@
|
|
|
141
141
|
why: 'Shown as a percentage of the fitted view, so 100% is the whole page rather than the drawing’s real scale.',
|
|
142
142
|
});
|
|
143
143
|
|
|
144
|
+
/* ── a save conflict (#3143): the header chip, the bar at the bottom, the overwrite question ── */
|
|
145
|
+
|
|
146
|
+
def('vector.save-conflict', {
|
|
147
|
+
label: 'Save conflict',
|
|
148
|
+
actsOn: 'Shows why your latest changes did not save, and what you can do',
|
|
149
|
+
group: 'In the Trace header',
|
|
150
|
+
persistence: 'none',
|
|
151
|
+
interaction: 'instant',
|
|
152
|
+
risk: [],
|
|
153
|
+
guidance: 'on-demand',
|
|
154
|
+
why: 'Only appears when someone else saved this drawing after you opened it. Your edits are still on screen; the bar it opens lets you reload or save yours anyway.',
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
def('vector.conflict-reload', {
|
|
158
|
+
label: 'Reload',
|
|
159
|
+
actsOn: 'Loads the newest saved drawing',
|
|
160
|
+
group: 'On the Trace save-conflict bar',
|
|
161
|
+
persistence: 'none',
|
|
162
|
+
interaction: 'instant',
|
|
163
|
+
risk: ['destructive'],
|
|
164
|
+
guidance: 'on-demand',
|
|
165
|
+
why: 'Loads the drawing as it is saved now. Your edits that did not save are not kept.',
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
def('vector.conflict-save-mine', {
|
|
169
|
+
label: 'Save mine anyway',
|
|
170
|
+
actsOn: 'Asks before replacing the other saved version with yours',
|
|
171
|
+
group: 'On the Trace save-conflict bar',
|
|
172
|
+
persistence: 'none',
|
|
173
|
+
interaction: 'instant',
|
|
174
|
+
risk: [],
|
|
175
|
+
guidance: 'on-demand',
|
|
176
|
+
why: 'Nothing is replaced yet: it opens a question, and only Overwrite and save there replaces the other version.',
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
def('vector.conflict-dismiss', {
|
|
180
|
+
label: 'Hide the save-conflict bar',
|
|
181
|
+
actsOn: 'Hides the bar; your edits stay unsaved',
|
|
182
|
+
group: 'On the Trace save-conflict bar',
|
|
183
|
+
key: 'Also: Esc',
|
|
184
|
+
persistence: 'none',
|
|
185
|
+
interaction: 'instant',
|
|
186
|
+
risk: [],
|
|
187
|
+
guidance: 'on-demand',
|
|
188
|
+
why: 'The Save conflict button in the header opens it again. Closing the editor while the conflict stands asks first.',
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
def('vector.overwrite-cancel', {
|
|
192
|
+
label: 'Cancel',
|
|
193
|
+
actsOn: 'Leaves the overwrite question without replacing anything',
|
|
194
|
+
group: 'In the Trace dialogs',
|
|
195
|
+
key: 'Also: Esc',
|
|
196
|
+
persistence: 'none',
|
|
197
|
+
interaction: 'instant',
|
|
198
|
+
risk: [],
|
|
199
|
+
guidance: 'on-demand',
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
def('vector.overwrite-save', {
|
|
203
|
+
label: 'Overwrite and save',
|
|
204
|
+
actsOn: 'Replaces the newer saved drawing with the version open here',
|
|
205
|
+
group: 'In the Trace dialogs',
|
|
206
|
+
persistence: 'working',
|
|
207
|
+
interaction: 'instant',
|
|
208
|
+
risk: ['destructive'],
|
|
209
|
+
guidance: 'on-demand',
|
|
210
|
+
why: 'Only appears after a save conflict. The other person’s changes are gone for good.',
|
|
211
|
+
});
|
|
212
|
+
|
|
144
213
|
def('vector.pan-zoom', {
|
|
145
214
|
label: 'Pan and zoom the drawing',
|
|
146
215
|
actsOn: 'Moves the view only',
|
|
@@ -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
|
+
})();
|
|
@@ -103,6 +103,15 @@ h2{font-size:15px;font-weight:600;margin:0 0 4px}
|
|
|
103
103
|
.note{color:var(--mut);font-size:12px;line-height:1.45}
|
|
104
104
|
.err-line{color:var(--err);font-size:12px;line-height:1.45}
|
|
105
105
|
.band{border:1px solid var(--line);background:var(--btn);border-radius:8px;padding:9px 12px;margin:0 0 14px;line-height:1.45}
|
|
106
|
+
/* #3121: the changes another window's change kept from being saved, and the way back */
|
|
107
|
+
.band.unsaved p{margin:0 0 6px}
|
|
108
|
+
.band.unsaved .row-actions{margin:8px 0 0}
|
|
109
|
+
/* The band is filled with --btn, so a plain button on it would vanish in the dark theme: give it the panel fill. */
|
|
110
|
+
.band.unsaved button:not(.primary):not(.link){background:var(--panel);border-color:var(--line)}
|
|
111
|
+
.band.unsaved button:not(.primary):not(.link):hover{background:var(--btn-hover)}
|
|
112
|
+
.unsaved-list{margin:0 0 6px;padding-left:18px}
|
|
113
|
+
.unsaved-list.all{max-height:15em;overflow:auto}
|
|
114
|
+
.unsaved-state:focus{outline:none}
|
|
106
115
|
|
|
107
116
|
/* ── references ────────────────────────────────────────────── */
|
|
108
117
|
.drop{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-height:180px;border:1.5px dashed var(--line);border-radius:10px;color:var(--mut);text-align:center;padding:24px;cursor:pointer;background:none;width:100%}
|
|
@@ -320,6 +329,7 @@ label.field.client-field{max-width:360px;margin:0 0 14px}
|
|
|
320
329
|
<script src="commands-drawing-check.js"></script>
|
|
321
330
|
<script src="instructor-reporter.js"></script>
|
|
322
331
|
<script>window.InstructorReporter.mount({ surface: 'drawing-check-editor' });</script>
|
|
332
|
+
<script src="failure-copy.js"></script>
|
|
323
333
|
<script type="module" src="./drawing-check-editor.js"></script>
|
|
324
334
|
<script>
|
|
325
335
|
// Themed tooltips (replaces native title=): one shared element, shown on data-tip hover after a short
|