glideshow 0.2.2__tar.gz → 0.4.0__tar.gz

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 (378) hide show
  1. glideshow-0.4.0/.assetsignore +12 -0
  2. glideshow-0.4.0/.github/workflows/checks.yml +35 -0
  3. {glideshow-0.2.2 → glideshow-0.4.0}/.github/workflows/tests.yml +39 -1
  4. {glideshow-0.2.2 → glideshow-0.4.0}/.gitignore +3 -0
  5. glideshow-0.4.0/CHANGELOG.md +24 -0
  6. glideshow-0.2.2/README.md → glideshow-0.4.0/PKG-INFO +38 -2
  7. glideshow-0.2.2/PKG-INFO → glideshow-0.4.0/README.md +24 -14
  8. glideshow-0.4.0/cloud/assets.js +20 -0
  9. {glideshow-0.2.2 → glideshow-0.4.0}/cloud/auth.js +26 -9
  10. {glideshow-0.2.2 → glideshow-0.4.0}/cloud/clean.js +31 -3
  11. {glideshow-0.2.2 → glideshow-0.4.0}/cloud/library.js +23 -7
  12. {glideshow-0.2.2 → glideshow-0.4.0}/cloud/pages.js +2 -2
  13. {glideshow-0.2.2 → glideshow-0.4.0}/cloud/share.js +54 -25
  14. {glideshow-0.2.2 → glideshow-0.4.0}/cloud/store-drive.js +22 -7
  15. {glideshow-0.2.2 → glideshow-0.4.0}/cloud/store-github.js +3 -3
  16. glideshow-0.4.0/cloud/worker.js +648 -0
  17. {glideshow-0.2.2 → glideshow-0.4.0}/cloud/wrangler.toml +21 -3
  18. glideshow-0.4.0/cloud/writes.js +350 -0
  19. glideshow-0.4.0/docs/agents-writes.md +163 -0
  20. {glideshow-0.2.2 → glideshow-0.4.0}/docs/agents.md +44 -9
  21. {glideshow-0.2.2 → glideshow-0.4.0}/docs/deck-format.md +29 -1
  22. {glideshow-0.2.2 → glideshow-0.4.0}/docs/self-hosting.md +31 -3
  23. glideshow-0.4.0/docs/state-machines.md +146 -0
  24. {glideshow-0.2.2 → glideshow-0.4.0}/editor/deck/base.css +3 -0
  25. {glideshow-0.2.2 → glideshow-0.4.0}/editor/deck/present.js +164 -37
  26. {glideshow-0.2.2 → glideshow-0.4.0}/editor/deck/shapes.js +8 -4
  27. {glideshow-0.2.2 → glideshow-0.4.0}/editor/editor.css +53 -11
  28. {glideshow-0.2.2 → glideshow-0.4.0}/editor/globals.d.ts +1 -0
  29. {glideshow-0.2.2 → glideshow-0.4.0}/editor/home.html +37 -13
  30. {glideshow-0.2.2 → glideshow-0.4.0}/editor/index.html +14 -11
  31. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/arrange.js +75 -20
  32. glideshow-0.4.0/editor/js/boot.js +123 -0
  33. glideshow-0.4.0/editor/js/boxes.js +48 -0
  34. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/charts.js +22 -14
  35. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/comments.js +11 -4
  36. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/dialogs.js +19 -14
  37. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/draw.js +5 -5
  38. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/file.js +65 -19
  39. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/find.js +4 -2
  40. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/keyboard.js +41 -33
  41. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/live.js +3 -3
  42. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/menubar.js +1 -0
  43. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/menus.js +4 -3
  44. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/motion.js +13 -5
  45. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/objects.js +53 -22
  46. glideshow-0.4.0/editor/js/offline.js +65 -0
  47. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/phone-edit.js +7 -4
  48. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/phone-sheets.js +27 -15
  49. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/phone-touch.js +7 -4
  50. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/phone-view.js +15 -4
  51. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/pointer.js +60 -15
  52. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/render.js +29 -8
  53. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/shortcuts.js +1 -1
  54. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/slides.js +20 -8
  55. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/state.js +44 -4
  56. glideshow-0.4.0/editor/js/storage.js +441 -0
  57. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/text.js +7 -5
  58. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/theme.js +1 -1
  59. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/toolbar.js +26 -3
  60. glideshow-0.4.0/editor/lib/pending.js +55 -0
  61. glideshow-0.4.0/editor/local/offline.js +474 -0
  62. {glideshow-0.2.2 → glideshow-0.4.0}/editor/local/sw.js +35 -16
  63. {glideshow-0.2.2 → glideshow-0.4.0}/editor/local/tsconfig.json +1 -1
  64. {glideshow-0.2.2 → glideshow-0.4.0}/editor/looks/thermal.css +7 -1
  65. {glideshow-0.2.2 → glideshow-0.4.0}/editor/phone.css +9 -0
  66. {glideshow-0.2.2 → glideshow-0.4.0}/editor/share/share.css +4 -1
  67. {glideshow-0.2.2 → glideshow-0.4.0}/editor/share/share.js +39 -10
  68. glideshow-0.4.0/editor/share/still.js +80 -0
  69. {glideshow-0.2.2 → glideshow-0.4.0}/editor/tsconfig.json +3 -2
  70. glideshow-0.4.0/editor/vendor/README.md +14 -0
  71. glideshow-0.4.0/editor/vendor/fonts/HankenGrotesk-00.woff2 +0 -0
  72. glideshow-0.4.0/editor/vendor/fonts/HankenGrotesk-01.woff2 +0 -0
  73. glideshow-0.4.0/editor/vendor/fonts/HankenGrotesk-02.woff2 +0 -0
  74. glideshow-0.4.0/editor/vendor/fonts/HankenGrotesk-03.woff2 +0 -0
  75. glideshow-0.4.0/editor/vendor/fonts/HankenGrotesk-OFL.txt +94 -0
  76. glideshow-0.4.0/editor/vendor/fonts/IBMPlexMono-00.woff2 +0 -0
  77. glideshow-0.4.0/editor/vendor/fonts/IBMPlexMono-01.woff2 +0 -0
  78. glideshow-0.4.0/editor/vendor/fonts/IBMPlexMono-02.woff2 +0 -0
  79. glideshow-0.4.0/editor/vendor/fonts/IBMPlexMono-03.woff2 +0 -0
  80. glideshow-0.4.0/editor/vendor/fonts/IBMPlexMono-04.woff2 +0 -0
  81. glideshow-0.4.0/editor/vendor/fonts/IBMPlexMono-05.woff2 +0 -0
  82. glideshow-0.4.0/editor/vendor/fonts/IBMPlexMono-06.woff2 +0 -0
  83. glideshow-0.4.0/editor/vendor/fonts/IBMPlexMono-07.woff2 +0 -0
  84. glideshow-0.4.0/editor/vendor/fonts/IBMPlexMono-08.woff2 +0 -0
  85. glideshow-0.4.0/editor/vendor/fonts/IBMPlexMono-09.woff2 +0 -0
  86. glideshow-0.4.0/editor/vendor/fonts/IBMPlexMono-OFL.txt +93 -0
  87. glideshow-0.4.0/editor/vendor/fonts/MaterialSymbolsOutlined-00.woff2 +0 -0
  88. glideshow-0.4.0/editor/vendor/fonts/MaterialSymbolsOutlined-LICENSE.txt +202 -0
  89. glideshow-0.4.0/editor/vendor/fonts/Roboto-00.woff2 +0 -0
  90. glideshow-0.4.0/editor/vendor/fonts/Roboto-01.woff2 +0 -0
  91. glideshow-0.4.0/editor/vendor/fonts/Roboto-02.woff2 +0 -0
  92. glideshow-0.4.0/editor/vendor/fonts/Roboto-03.woff2 +0 -0
  93. glideshow-0.4.0/editor/vendor/fonts/Roboto-04.woff2 +0 -0
  94. glideshow-0.4.0/editor/vendor/fonts/Roboto-05.woff2 +0 -0
  95. glideshow-0.4.0/editor/vendor/fonts/Roboto-06.woff2 +0 -0
  96. glideshow-0.4.0/editor/vendor/fonts/Roboto-07.woff2 +0 -0
  97. glideshow-0.4.0/editor/vendor/fonts/Roboto-08.woff2 +0 -0
  98. glideshow-0.4.0/editor/vendor/fonts/Roboto-OFL.txt +93 -0
  99. glideshow-0.4.0/editor/vendor/fonts/fonts.css +532 -0
  100. glideshow-0.4.0/editor/vendor/katex-0.16.11/LICENSE +21 -0
  101. glideshow-0.4.0/editor/vendor/katex-0.16.11/dist/contrib/auto-render.min.js +1 -0
  102. glideshow-0.4.0/editor/vendor/katex-0.16.11/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  103. glideshow-0.4.0/editor/vendor/katex-0.16.11/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  104. glideshow-0.4.0/editor/vendor/katex-0.16.11/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  105. glideshow-0.4.0/editor/vendor/katex-0.16.11/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  106. glideshow-0.4.0/editor/vendor/katex-0.16.11/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  107. glideshow-0.4.0/editor/vendor/katex-0.16.11/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
  108. glideshow-0.4.0/editor/vendor/katex-0.16.11/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  109. glideshow-0.4.0/editor/vendor/katex-0.16.11/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
  110. glideshow-0.4.0/editor/vendor/katex-0.16.11/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
  111. glideshow-0.4.0/editor/vendor/katex-0.16.11/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  112. glideshow-0.4.0/editor/vendor/katex-0.16.11/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
  113. glideshow-0.4.0/editor/vendor/katex-0.16.11/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  114. glideshow-0.4.0/editor/vendor/katex-0.16.11/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  115. glideshow-0.4.0/editor/vendor/katex-0.16.11/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  116. glideshow-0.4.0/editor/vendor/katex-0.16.11/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
  117. glideshow-0.4.0/editor/vendor/katex-0.16.11/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  118. glideshow-0.4.0/editor/vendor/katex-0.16.11/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  119. glideshow-0.4.0/editor/vendor/katex-0.16.11/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  120. glideshow-0.4.0/editor/vendor/katex-0.16.11/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  121. glideshow-0.4.0/editor/vendor/katex-0.16.11/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  122. glideshow-0.4.0/editor/vendor/katex-0.16.11/dist/katex.min.css +1 -0
  123. glideshow-0.4.0/editor/vendor/katex-0.16.11/dist/katex.min.js +1 -0
  124. glideshow-0.4.0/editor/vendor/reveal.js-5.1.0/LICENSE +19 -0
  125. glideshow-0.4.0/editor/vendor/reveal.js-5.1.0/dist/reveal.css +8 -0
  126. glideshow-0.4.0/editor/vendor/reveal.js-5.1.0/dist/reveal.js +9 -0
  127. glideshow-0.4.0/editor/vendor/reveal.js-5.1.0/plugin/highlight/highlight.js +5 -0
  128. glideshow-0.4.0/editor/vendor/reveal.js-5.1.0/plugin/notes/notes.js +1 -0
  129. glideshow-0.4.0/glidecore/__init__.py +2 -0
  130. {glideshow-0.2.2/glideshow → glideshow-0.4.0/glidecore}/merge.py +2 -2
  131. {glideshow-0.2.2/editor/lib → glideshow-0.4.0/glidecore/web}/browser-db.js +2 -2
  132. {glideshow-0.2.2/editor/lib → glideshow-0.4.0/glidecore/web}/library.js +147 -25
  133. {glideshow-0.2.2/editor/lib → glideshow-0.4.0/glidecore/web}/merge.js +2 -2
  134. {glideshow-0.2.2/editor/lib → glideshow-0.4.0/glidecore/web}/onefile.js +12 -3
  135. {glideshow-0.2.2 → glideshow-0.4.0}/glideshow/__init__.py +1 -1
  136. glideshow-0.4.0/glideshow/build.py +84 -0
  137. {glideshow-0.2.2 → glideshow-0.4.0}/glideshow/decks.py +14 -3
  138. {glideshow-0.2.2 → glideshow-0.4.0}/glideshow/fonts.py +1 -1
  139. {glideshow-0.2.2 → glideshow-0.4.0}/glideshow/gslides.py +1 -1
  140. {glideshow-0.2.2 → glideshow-0.4.0}/glideshow/history.py +27 -15
  141. {glideshow-0.2.2 → glideshow-0.4.0}/glideshow/movie.py +2 -2
  142. {glideshow-0.2.2 → glideshow-0.4.0}/glideshow/pptx_export.py +22 -1
  143. {glideshow-0.2.2 → glideshow-0.4.0}/glideshow/render.py +62 -8
  144. {glideshow-0.2.2 → glideshow-0.4.0}/glideshow/server.py +58 -15
  145. {glideshow-0.2.2 → glideshow-0.4.0}/glideshow/service.py +1 -1
  146. glideshow-0.4.0/glidewrites/__init__.py +1 -0
  147. glideshow-0.4.0/glidewrites/__main__.py +2 -0
  148. glideshow-0.4.0/glidewrites/agent.py +274 -0
  149. glideshow-0.4.0/glidewrites/claude_agent.py +174 -0
  150. glideshow-0.4.0/glidewrites/cli.py +100 -0
  151. glideshow-0.4.0/glidewrites/comment_cli.py +118 -0
  152. glideshow-0.4.0/glidewrites/comments.py +140 -0
  153. glideshow-0.4.0/glidewrites/convert.py +200 -0
  154. glideshow-0.4.0/glidewrites/docs.py +186 -0
  155. glideshow-0.4.0/glidewrites/docx_export.py +394 -0
  156. glideshow-0.4.0/glidewrites/docx_import.py +303 -0
  157. glideshow-0.4.0/glidewrites/gdocs.py +141 -0
  158. glideshow-0.4.0/glidewrites/history.py +131 -0
  159. glideshow-0.4.0/glidewrites/lan.py +92 -0
  160. glideshow-0.4.0/glidewrites/library.py +191 -0
  161. glideshow-0.4.0/glidewrites/markup.py +472 -0
  162. glideshow-0.4.0/glidewrites/pdf_export.py +30 -0
  163. glideshow-0.4.0/glidewrites/server.py +255 -0
  164. glideshow-0.4.0/glidewrites/service.py +70 -0
  165. glideshow-0.4.0/glidewrites/suggest.py +208 -0
  166. {glideshow-0.2.2 → glideshow-0.4.0}/pyproject.toml +9 -4
  167. {glideshow-0.2.2 → glideshow-0.4.0}/skills/glideshow/SKILL.md +6 -2
  168. glideshow-0.4.0/skills/glidewrites/SKILL.md +60 -0
  169. {glideshow-0.2.2 → glideshow-0.4.0}/test/agent.py +43 -2
  170. glideshow-0.4.0/test/caching.py +99 -0
  171. {glideshow-0.2.2 → glideshow-0.4.0}/test/cloud.py +100 -51
  172. {glideshow-0.2.2 → glideshow-0.4.0}/test/coedit.py +3 -3
  173. glideshow-0.4.0/test/fake_gdocs.py +75 -0
  174. glideshow-0.4.0/test/fixtures/gdocs-export.html +1 -0
  175. glideshow-0.4.0/test/gw_browser.py +53 -0
  176. {glideshow-0.2.2 → glideshow-0.4.0}/test/keys.py +2 -2
  177. {glideshow-0.2.2 → glideshow-0.4.0}/test/media.py +1 -1
  178. glideshow-0.4.0/test/offline.py +214 -0
  179. glideshow-0.4.0/test/offline_save.py +219 -0
  180. glideshow-0.4.0/test/offline_sw.py +275 -0
  181. glideshow-0.4.0/test/perf.py +225 -0
  182. {glideshow-0.2.2 → glideshow-0.4.0}/test/share.py +24 -5
  183. {glideshow-0.2.2 → glideshow-0.4.0}/test/smoke.py +142 -13
  184. glideshow-0.4.0/test/state_glideshow_edit.py +251 -0
  185. glideshow-0.4.0/test/state_glideshow_present.py +163 -0
  186. glideshow-0.4.0/test/state_glideshow_present_phone.py +93 -0
  187. glideshow-0.4.0/test/state_glideshow_sync.py +283 -0
  188. glideshow-0.4.0/test/state_glideshow_sync_cloud.py +180 -0
  189. glideshow-0.4.0/test/writes.py +117 -0
  190. glideshow-0.4.0/test/writes_agent.py +232 -0
  191. glideshow-0.4.0/test/writes_chips.py +147 -0
  192. glideshow-0.4.0/test/writes_claude.py +217 -0
  193. glideshow-0.4.0/test/writes_cloud.py +191 -0
  194. glideshow-0.4.0/test/writes_comments.py +250 -0
  195. glideshow-0.4.0/test/writes_drawings.py +177 -0
  196. glideshow-0.4.0/test/writes_e2e.py +332 -0
  197. glideshow-0.4.0/test/writes_emoji.py +138 -0
  198. glideshow-0.4.0/test/writes_engines.py +142 -0
  199. glideshow-0.4.0/test/writes_find.py +111 -0
  200. glideshow-0.4.0/test/writes_gdocs.py +116 -0
  201. glideshow-0.4.0/test/writes_gifs.py +155 -0
  202. glideshow-0.4.0/test/writes_history_more.py +169 -0
  203. glideshow-0.4.0/test/writes_house.py +84 -0
  204. glideshow-0.4.0/test/writes_insert.py +162 -0
  205. glideshow-0.4.0/test/writes_keys.py +251 -0
  206. glideshow-0.4.0/test/writes_lan.py +67 -0
  207. glideshow-0.4.0/test/writes_matrix.py +27 -0
  208. glideshow-0.4.0/test/writes_pages.py +498 -0
  209. glideshow-0.4.0/test/writes_paragraph.py +221 -0
  210. glideshow-0.4.0/test/writes_perf.py +119 -0
  211. glideshow-0.4.0/test/writes_phone.py +132 -0
  212. glideshow-0.4.0/test/writes_prefs.py +109 -0
  213. glideshow-0.4.0/test/writes_state.py +172 -0
  214. glideshow-0.4.0/test/writes_state_comments.py +170 -0
  215. glideshow-0.4.0/test/writes_state_comments_share.py +84 -0
  216. glideshow-0.4.0/test/writes_state_objects.py +274 -0
  217. glideshow-0.4.0/test/writes_state_server.py +202 -0
  218. glideshow-0.4.0/test/writes_suggest.py +248 -0
  219. glideshow-0.4.0/test/writes_tables.py +410 -0
  220. glideshow-0.4.0/test/writes_tabs.py +159 -0
  221. glideshow-0.4.0/test/writes_vim.py +122 -0
  222. {glideshow-0.2.2 → glideshow-0.4.0}/tools/check.sh +2 -1
  223. {glideshow-0.2.2 → glideshow-0.4.0}/tools/gslides2deck.py +3 -8
  224. glideshow-0.4.0/tools/make-writes-app.sh +74 -0
  225. glideshow-0.4.0/tools/split-core.py +160 -0
  226. glideshow-0.4.0/tools/vendor.py +57 -0
  227. {glideshow-0.2.2 → glideshow-0.4.0}/uv.lock +31 -12
  228. glideshow-0.4.0/writer/CORE-SPLIT.md +171 -0
  229. glideshow-0.4.0/writer/PLAN.md +547 -0
  230. glideshow-0.4.0/writer/RELEASE.md +109 -0
  231. glideshow-0.4.0/writer/a11y.css +63 -0
  232. glideshow-0.4.0/writer/apps.js +43 -0
  233. glideshow-0.4.0/writer/chips.css +24 -0
  234. glideshow-0.4.0/writer/cloud.css +41 -0
  235. glideshow-0.4.0/writer/comments.css +86 -0
  236. glideshow-0.4.0/writer/doc/doc.css +105 -0
  237. glideshow-0.4.0/writer/emoji-watermark.css +46 -0
  238. glideshow-0.4.0/writer/emoji.json +1 -0
  239. glideshow-0.4.0/writer/find.css +27 -0
  240. glideshow-0.4.0/writer/glidewrites-1024.png +0 -0
  241. glideshow-0.4.0/writer/glidewrites.svg +10 -0
  242. glideshow-0.4.0/writer/history.css +60 -0
  243. glideshow-0.4.0/writer/home.css +118 -0
  244. glideshow-0.4.0/writer/home.html +65 -0
  245. glideshow-0.4.0/writer/home.js +326 -0
  246. glideshow-0.4.0/writer/index.html +173 -0
  247. glideshow-0.4.0/writer/inserts.css +37 -0
  248. glideshow-0.4.0/writer/js/a11y.js +349 -0
  249. glideshow-0.4.0/writer/js/boot.js +118 -0
  250. glideshow-0.4.0/writer/js/chars.js +14 -0
  251. glideshow-0.4.0/writer/js/charts.js +121 -0
  252. glideshow-0.4.0/writer/js/chips.js +264 -0
  253. glideshow-0.4.0/writer/js/cloud.js +145 -0
  254. glideshow-0.4.0/writer/js/columns.js +114 -0
  255. glideshow-0.4.0/writer/js/comments.js +508 -0
  256. glideshow-0.4.0/writer/js/compat.js +15 -0
  257. glideshow-0.4.0/writer/js/context.js +78 -0
  258. glideshow-0.4.0/writer/js/doc.js +307 -0
  259. glideshow-0.4.0/writer/js/drawing.js +292 -0
  260. glideshow-0.4.0/writer/js/emoji.js +73 -0
  261. glideshow-0.4.0/writer/js/find.js +171 -0
  262. glideshow-0.4.0/writer/js/fnpages.js +147 -0
  263. glideshow-0.4.0/writer/js/format.js +310 -0
  264. glideshow-0.4.0/writer/js/glideshow.js +141 -0
  265. glideshow-0.4.0/writer/js/headers.js +434 -0
  266. glideshow-0.4.0/writer/js/history.js +333 -0
  267. glideshow-0.4.0/writer/js/images.js +454 -0
  268. glideshow-0.4.0/writer/js/inserts.js +246 -0
  269. glideshow-0.4.0/writer/js/io.js +33 -0
  270. glideshow-0.4.0/writer/js/keys.js +9 -0
  271. glideshow-0.4.0/writer/js/linenumbers.js +76 -0
  272. glideshow-0.4.0/writer/js/lists.js +147 -0
  273. glideshow-0.4.0/writer/js/menus.js +365 -0
  274. glideshow-0.4.0/writer/js/outline.js +29 -0
  275. glideshow-0.4.0/writer/js/overflow.js +48 -0
  276. glideshow-0.4.0/writer/js/pages.js +142 -0
  277. glideshow-0.4.0/writer/js/pagesetup.js +192 -0
  278. glideshow-0.4.0/writer/js/paragraph.js +228 -0
  279. glideshow-0.4.0/writer/js/phone-edit.js +120 -0
  280. glideshow-0.4.0/writer/js/prefs.js +167 -0
  281. glideshow-0.4.0/writer/js/ruler.js +136 -0
  282. glideshow-0.4.0/writer/js/sections.js +49 -0
  283. glideshow-0.4.0/writer/js/share.js +89 -0
  284. glideshow-0.4.0/writer/js/sidepanel.js +85 -0
  285. glideshow-0.4.0/writer/js/state.js +63 -0
  286. glideshow-0.4.0/writer/js/suggest.js +490 -0
  287. glideshow-0.4.0/writer/js/tables.js +711 -0
  288. glideshow-0.4.0/writer/js/tabs.js +270 -0
  289. glideshow-0.4.0/writer/js/undo.js +69 -0
  290. glideshow-0.4.0/writer/js/view.js +187 -0
  291. glideshow-0.4.0/writer/js/vim.js +849 -0
  292. glideshow-0.4.0/writer/js/watermark.js +139 -0
  293. glideshow-0.4.0/writer/js/webimages.js +130 -0
  294. glideshow-0.4.0/writer/lib/merge.js +75 -0
  295. glideshow-0.4.0/writer/looks/glide.css +263 -0
  296. glideshow-0.4.0/writer/looks/look.js +58 -0
  297. glideshow-0.4.0/writer/looks/updraft.css +66 -0
  298. glideshow-0.4.0/writer/looks/vellum.css +49 -0
  299. glideshow-0.4.0/writer/looks/wave.css +53 -0
  300. glideshow-0.4.0/writer/objects.css +177 -0
  301. glideshow-0.4.0/writer/pages.css +137 -0
  302. glideshow-0.4.0/writer/paragraph.css +49 -0
  303. glideshow-0.4.0/writer/phone-home.js +22 -0
  304. glideshow-0.4.0/writer/phone.css +89 -0
  305. glideshow-0.4.0/writer/phone.js +22 -0
  306. glideshow-0.4.0/writer/prefs.css +15 -0
  307. glideshow-0.4.0/writer/share-view.css +30 -0
  308. glideshow-0.4.0/writer/share-view.js +103 -0
  309. glideshow-0.4.0/writer/suggest.css +55 -0
  310. glideshow-0.4.0/writer/tabs.css +18 -0
  311. glideshow-0.4.0/writer/templates/letter.html +18 -0
  312. glideshow-0.4.0/writer/templates/notes.html +11 -0
  313. glideshow-0.4.0/writer/templates/proposal.html +14 -0
  314. glideshow-0.4.0/writer/templates/resume.html +18 -0
  315. glideshow-0.4.0/writer/tsconfig.json +6 -0
  316. glideshow-0.4.0/writer/writer.css +216 -0
  317. glideshow-0.2.2/.github/workflows/checks.yml +0 -16
  318. glideshow-0.2.2/cloud/worker.js +0 -353
  319. glideshow-0.2.2/editor/js/boot.js +0 -66
  320. glideshow-0.2.2/editor/js/boxes.js +0 -25
  321. glideshow-0.2.2/editor/js/storage.js +0 -255
  322. glideshow-0.2.2/glideshow/build.py +0 -54
  323. {glideshow-0.2.2 → glideshow-0.4.0}/.github/workflows/release.yml +0 -0
  324. {glideshow-0.2.2 → glideshow-0.4.0}/.github/workflows/staging.yml +0 -0
  325. {glideshow-0.2.2 → glideshow-0.4.0}/LICENSE +0 -0
  326. {glideshow-0.2.2 → glideshow-0.4.0}/bin/glideshow +0 -0
  327. {glideshow-0.2.2 → glideshow-0.4.0}/cloud/env.d.ts +0 -0
  328. {glideshow-0.2.2 → glideshow-0.4.0}/cloud/github-app.py +0 -0
  329. {glideshow-0.2.2 → glideshow-0.4.0}/cloud/setup.sh +0 -0
  330. {glideshow-0.2.2 → glideshow-0.4.0}/cloud/tsconfig.json +0 -0
  331. {glideshow-0.2.2 → glideshow-0.4.0}/docs/shortcuts.md +0 -0
  332. {glideshow-0.2.2 → glideshow-0.4.0}/editor/.assetsignore +0 -0
  333. {glideshow-0.2.2 → glideshow-0.4.0}/editor/apple-touch-icon.png +0 -0
  334. {glideshow-0.2.2 → glideshow-0.4.0}/editor/data/font-metrics.json +0 -0
  335. {glideshow-0.2.2 → glideshow-0.4.0}/editor/data/fonts.json +0 -0
  336. {glideshow-0.2.2 → glideshow-0.4.0}/editor/data/icons.json +0 -0
  337. {glideshow-0.2.2 → glideshow-0.4.0}/editor/data/symbols.js +0 -0
  338. {glideshow-0.2.2 → glideshow-0.4.0}/editor/data/themes.js +0 -0
  339. {glideshow-0.2.2 → glideshow-0.4.0}/editor/deck/template.html +0 -0
  340. {glideshow-0.2.2 → glideshow-0.4.0}/editor/glideshow-1024.png +0 -0
  341. {glideshow-0.2.2 → glideshow-0.4.0}/editor/glideshow.svg +0 -0
  342. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/context-menus.js +0 -0
  343. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/dock.js +0 -0
  344. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/format-panel.js +0 -0
  345. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/geometry.js +0 -0
  346. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/guides.js +0 -0
  347. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/insert.js +0 -0
  348. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/notes.js +0 -0
  349. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/people.js +0 -0
  350. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/phone-comments.js +0 -0
  351. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/phone-home.js +0 -0
  352. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/phone-mode.js +0 -0
  353. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/spacing.js +0 -0
  354. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/theme-toggle.js +0 -0
  355. {glideshow-0.2.2 → glideshow-0.4.0}/editor/js/toolbar-groups.js +0 -0
  356. {glideshow-0.2.2 → glideshow-0.4.0}/editor/lib/polygon-clipping.min.js +0 -0
  357. {glideshow-0.2.2 → glideshow-0.4.0}/editor/looks/glider.svg +0 -0
  358. {glideshow-0.2.2 → glideshow-0.4.0}/editor/looks/thermal-phone.css +0 -0
  359. {glideshow-0.2.2 → glideshow-0.4.0}/editor/manifest.json +0 -0
  360. {glideshow-0.2.2 → glideshow-0.4.0}/editor/share/speaker.html +0 -0
  361. {glideshow-0.2.2/glideshow → glideshow-0.4.0/glidecore}/osutil.py +0 -0
  362. {glideshow-0.2.2/editor/lib → glideshow-0.4.0/glidecore/web}/move-local.js +0 -0
  363. {glideshow-0.2.2/editor/lib → glideshow-0.4.0/glidecore/web}/store-browser.js +0 -0
  364. {glideshow-0.2.2/editor/lib → glideshow-0.4.0/glidecore/web}/store-folder.js +0 -0
  365. {glideshow-0.2.2 → glideshow-0.4.0}/glideshow/__main__.py +0 -0
  366. {glideshow-0.2.2 → glideshow-0.4.0}/glideshow/agent.py +0 -0
  367. {glideshow-0.2.2 → glideshow-0.4.0}/glideshow/cli.py +0 -0
  368. {glideshow-0.2.2 → glideshow-0.4.0}/glideshow/comments.py +0 -0
  369. {glideshow-0.2.2 → glideshow-0.4.0}/glideshow/figure.py +0 -0
  370. {glideshow-0.2.2 → glideshow-0.4.0}/glideshow/pptx_import.py +0 -0
  371. {glideshow-0.2.2 → glideshow-0.4.0}/glideshow/publish.py +0 -0
  372. {glideshow-0.2.2 → glideshow-0.4.0}/test/fake_drive.py +0 -0
  373. {glideshow-0.2.2 → glideshow-0.4.0}/test/fixtures/agent-deck.html +0 -0
  374. {glideshow-0.2.2 → glideshow-0.4.0}/test/fixtures/gslides-api.json +0 -0
  375. {glideshow-0.2.2 → glideshow-0.4.0}/test/fixtures/stack-deck.html +0 -0
  376. {glideshow-0.2.2 → glideshow-0.4.0}/test/snap.py +0 -0
  377. {glideshow-0.2.2 → glideshow-0.4.0}/tools/font_metrics.py +0 -0
  378. {glideshow-0.2.2 → glideshow-0.4.0}/tools/make-app.sh +0 -0
@@ -0,0 +1,12 @@
1
+ # glideshow.org's static files (cloud/wrangler.toml [assets], the repo root): only the two browser apps, editor/ and writer/,
2
+ # and what they share, glidecore/web/ (served at /core/).
3
+ # Everything else in the repo (code, tests, docs, secrets like cloud/.dev.vars) stays out.
4
+ /*
5
+ !/editor/
6
+ !/writer/
7
+ !/glidecore/
8
+ /glidecore/*
9
+ !/glidecore/web/
10
+ /editor/**/.DS_Store
11
+ /writer/**/.DS_Store
12
+ /writer/PLAN.md
@@ -0,0 +1,35 @@
1
+ # Every push: the type and lint checks (about a minute; no build step, they read the plain JS and Python).
2
+ # Locally: tools/check.sh. The browser tests are tests.yml.
3
+ name: checks
4
+ on: [push, pull_request]
5
+ permissions:
6
+ contents: read
7
+
8
+ jobs:
9
+ lint:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: astral-sh/setup-uv@v5
14
+ - uses: actions/setup-node@v4
15
+ with: { node-version: 22 }
16
+ - run: tools/check.sh
17
+
18
+ glidewrites-cli: # Glidewrites without a browser: a library, the agent commands, Markdown, Word and back (a minute)
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ - uses: astral-sh/setup-uv@v5
23
+ - run: git config --global user.name ci && git config --global user.email ci@example.org
24
+ - name: new, put, blocks, find, export, import
25
+ env: { GLIDEWRITES_HOME: /tmp/writes, GLIDEWRITES_PORT: "47990" }
26
+ run: |
27
+ set -e
28
+ d=$(uv run glidewrites new "CI check" --no-open --template proposal)
29
+ printf '<h2>From CI</h2>\n<ul class="checklist"><li data-checked="">built</li><li>tested</li></ul>\n' | uv run glidewrites put "$d" --after end
30
+ uv run glidewrites blocks "$d" --outline | grep -q "From CI"
31
+ test "$(uv run glidewrites find ci check)" = "$d"
32
+ uv run glidewrites export "$d" --to md -o /tmp/ci.md && grep -q -- "- \[x\] built" /tmp/ci.md
33
+ uv run glidewrites export "$d" --to docx -o /tmp/ci.docx
34
+ back=$(uv run glidewrites import /tmp/ci.docx) && grep -q 'class="checklist"' "$back/doc.html"
35
+ uv run glidewrites import /tmp/ci.md > /dev/null
@@ -1,4 +1,4 @@
1
- # The end-to-end tests in headless Chrome (about 30 minutes on macOS), by hand only (Actions → tests → Run workflow, or
1
+ # The end-to-end tests in headless Chrome (about 30 minutes on macOS; Glidewrites' another 30), by hand only (Actions → tests → Run workflow, or
2
2
  # `gh workflow run tests.yml`): the repo is private, where a macOS minute costs ten of the free ones. They gate nothing.
3
3
  # Before tagging a release, run `uv run test/smoke.py` locally.
4
4
  name: tests
@@ -25,6 +25,44 @@ jobs:
25
25
  uses: actions/upload-artifact@v4
26
26
  with: { name: screenshots, path: "test/*.png", if-no-files-found: ignore }
27
27
 
28
+ writes: # Glidewrites in headless Chrome (the main suites), then the base and phone suites in WebKit (Safari's engine)
29
+ runs-on: macos-latest
30
+ timeout-minutes: 60
31
+ env: { GW_TEST_PORT: "47924" }
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ - uses: astral-sh/setup-uv@v5
35
+ - run: git config --global user.name ci && git config --global user.email ci@example.org # (the library is a git repo)
36
+ - run: uv run --with playwright python -m playwright install webkit
37
+ - run: uv run test/writes.py
38
+ - if: ${{ !cancelled() }} # (each suite runs even when one before it failed)
39
+ run: uv run test/writes_agent.py
40
+ - if: ${{ !cancelled() }}
41
+ run: uv run test/writes_e2e.py
42
+ - if: ${{ !cancelled() }}
43
+ run: uv run test/writes_pages.py
44
+ - if: ${{ !cancelled() }}
45
+ run: uv run test/writes_tables.py
46
+ - if: ${{ !cancelled() }}
47
+ run: uv run test/writes_comments.py
48
+ - if: ${{ !cancelled() }}
49
+ run: uv run test/writes_suggest.py
50
+ - if: ${{ !cancelled() }}
51
+ run: uv run test/writes_chips.py
52
+ - if: ${{ !cancelled() }}
53
+ run: uv run test/writes_prefs.py
54
+ - if: ${{ !cancelled() }}
55
+ run: uv run test/writes_gdocs.py # against test/fake_gdocs.py only, never Google
56
+ - if: ${{ !cancelled() }}
57
+ run: uv run test/writes_phone.py
58
+ - if: ${{ !cancelled() }}
59
+ run: GW_BROWSER=webkit uv run test/writes.py
60
+ - if: ${{ !cancelled() }}
61
+ run: GW_BROWSER=webkit uv run test/writes_phone.py
62
+ - if: failure()
63
+ uses: actions/upload-artifact@v4
64
+ with: { name: writes-screenshots, path: "test/shots/*.png", if-no-files-found: ignore }
65
+
28
66
  cloud: # glideshow.org (cloud/) on a local Worker: browser mode, a Google account's library in a stand-in Drive, sharing
29
67
  runs-on: macos-latest # (the sandbox, passes, comments), reports and takedowns. No real accounts: the secrets are made up.
30
68
  timeout-minutes: 20
@@ -5,9 +5,12 @@ __pycache__/
5
5
  # local only: Google Slides screenshots used as the visual reference, and generated test output
6
6
  reference/
7
7
  test/shots/*.png
8
+ test/shots/*.pdf
8
9
  test/*.png
9
10
  replicate/
10
11
  dist/
12
+ # (but the vendored libraries keep their npm layout: editor/vendor/<pkg>-<ver>/dist/)
13
+ !editor/vendor/**/dist/
11
14
  # secrets for `wrangler dev` (cloud/)
12
15
  cloud/.dev.vars
13
16
  cloud/.wrangler/
@@ -0,0 +1,24 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ### Glidewrites (new): documents you own
6
+
7
+ Glideshow's sister app, in the same package: `uv tool install glideshow` now also gives the `glidewrites` command. A
8
+ Google Docs–style editor whose documents are plain HTML folders (`doc.html` + `assets/`, in `~/writes`), versioned in
9
+ git, that agents edit alongside you.
10
+
11
+ - **Editor**: Docs' chrome and shortcuts; pages with headers, footers, page numbers, columns, footnotes and a table
12
+ of contents (pageless in browsers without CSS `column-wrap`: Safari, Firefox, Chrome before 145); styles, fonts, lists,
13
+ checklists, tables, images, drawings, charts, equations, special characters, emoji, watermarks, smart chips and the
14
+ @-menu; comments, Suggesting mode, version history, find and replace; Tools › Preferences (autocorrect, smart quotes,
15
+ link and list detection, substitutions).
16
+ - **Agents**: `glidewrites blocks / put / find / rename / docs`; every block has a `data-bid`, so an agent's edit and
17
+ your typing merge block by block while the editor is open; an `AGENTS.md` in each document; a Claude Code skill in
18
+ `skills/glidewrites`.
19
+ - **Import and export**: Word (.docx) both ways, Markdown both ways, HTML in (Google Docs' export too) and out, PDF out;
20
+ Google Docs in and out through the Drive API (Glideshow's OAuth client).
21
+ - **Home screen**: templates, folders, list and grid, sort, rename / move / remove (to `.trash/`, with Undo), upload.
22
+ - **Phone**: the Google Docs iPhone app's layout (read, then edit with a formatting bar and sheets).
23
+ - **Install**: `glidewrites install` (the server at login), `tools/make-writes-app.sh` (a macOS Dock app).
24
+ - **Tests**: `test/writes*.py`, each in Chrome, WebKit or Firefox (`GW_BROWSER`), `test/writes_matrix.py` for all three.
@@ -1,3 +1,17 @@
1
+ Metadata-Version: 2.5
2
+ Name: glideshow
3
+ Version: 0.4.0
4
+ Summary: Slides and documents you own: Glideshow (Google Slides-style) and Glidewrites (Google Docs-style) editors over plain HTML folders that AI agents can edit
5
+ Project-URL: Homepage, https://glideshow.org
6
+ License-Expression: AGPL-3.0-or-later
7
+ License-File: LICENSE
8
+ Requires-Python: >=3.10
9
+ Provides-Extra: docx
10
+ Requires-Dist: python-docx>=1.1; extra == 'docx'
11
+ Provides-Extra: pptx
12
+ Requires-Dist: python-pptx>=0.6.23; extra == 'pptx'
13
+ Description-Content-Type: text/markdown
14
+
1
15
  <img src="editor/glideshow.svg" width="72" alt="">
2
16
 
3
17
  # Glideshow <sup>alpha</sup>
@@ -14,7 +28,7 @@ presents in any browser. Every save is a version in git.
14
28
  Needs Python 3.10+ and Chrome; macOS, Linux and Windows.
15
29
 
16
30
  ```console
17
- $ uv tool install glideshow
31
+ $ uv tool install glideshow # both apps: the glideshow and glidewrites commands
18
32
  $ glideshow # the home screen: your decks (in ~/decks)
19
33
  $ glideshow new "Lab meeting" # a new deck, opened in the editor
20
34
  $ glideshow build lab-meeting out/ # a copy that presents offline
@@ -30,10 +44,32 @@ Or use it online, with nothing to install, at [glideshow.org](https://glideshow.
30
44
  - [Keyboard shortcuts](docs/shortcuts.md)
31
45
  - [Running it online](docs/self-hosting.md): your own glideshow.org on Cloudflare.
32
46
 
47
+ ## Glidewrites
48
+
49
+ <img src="writer/glidewrites.svg" width="48" alt="">
50
+
51
+ Glideshow's sister app: documents you own, in a Google Docs–style editor. A document is `doc.html` (blocks of plain HTML)
52
+ plus `assets/`, kept in `~/writes`; agents edit the same file while you type, and the editor merges both. It opens Word,
53
+ Markdown and HTML files and saves Word, Markdown, HTML and PDF. On a phone it looks like the Docs app.
54
+
55
+ Installed with Glideshow (one package, two commands):
56
+
57
+ ```console
58
+ $ glidewrites # the home screen: your documents (in ~/writes)
59
+ $ glidewrites new "Trip plan" # a new document, opened in the editor
60
+ $ glidewrites import notes.docx # a Word, Markdown or HTML file as a document
61
+ $ glidewrites install # start its server at login (macOS, Linux, Windows)
62
+ $ bash tools/make-writes-app.sh # macOS: Glidewrites.app for the Dock
63
+ ```
64
+
65
+ - [For agents](docs/agents-writes.md): the commands (`blocks`, `put`, `find`, `export`), the format and recipes; every
66
+ document gets a copy as `AGENTS.md`. The Claude Code skill is in `skills/glidewrites`.
67
+
33
68
  ## Contributing
34
69
 
35
70
  Issues and pull requests are welcome. Before sending one, run `tools/check.sh` (types and lint) and `uv run test/smoke.py`
36
- (the editor end to end, in Chrome).
71
+ (the editor end to end, in Chrome); for Glidewrites, `uv run test/writes_matrix.py` (every `test/writes*.py` suite in
72
+ Chrome, WebKit and Firefox; `GW_BROWSER=webkit uv run test/writes.py` for one).
37
73
 
38
74
  ## Releasing
39
75
 
@@ -1,15 +1,3 @@
1
- Metadata-Version: 2.5
2
- Name: glideshow
3
- Version: 0.2.2
4
- Summary: Slides you own: a Google Slides-style editor whose decks are plain HTML folders that AI agents can edit
5
- Project-URL: Homepage, https://glideshow.org
6
- License-Expression: AGPL-3.0-or-later
7
- License-File: LICENSE
8
- Requires-Python: >=3.10
9
- Provides-Extra: pptx
10
- Requires-Dist: python-pptx>=0.6.23; extra == 'pptx'
11
- Description-Content-Type: text/markdown
12
-
13
1
  <img src="editor/glideshow.svg" width="72" alt="">
14
2
 
15
3
  # Glideshow <sup>alpha</sup>
@@ -26,7 +14,7 @@ presents in any browser. Every save is a version in git.
26
14
  Needs Python 3.10+ and Chrome; macOS, Linux and Windows.
27
15
 
28
16
  ```console
29
- $ uv tool install glideshow
17
+ $ uv tool install glideshow # both apps: the glideshow and glidewrites commands
30
18
  $ glideshow # the home screen: your decks (in ~/decks)
31
19
  $ glideshow new "Lab meeting" # a new deck, opened in the editor
32
20
  $ glideshow build lab-meeting out/ # a copy that presents offline
@@ -42,10 +30,32 @@ Or use it online, with nothing to install, at [glideshow.org](https://glideshow.
42
30
  - [Keyboard shortcuts](docs/shortcuts.md)
43
31
  - [Running it online](docs/self-hosting.md): your own glideshow.org on Cloudflare.
44
32
 
33
+ ## Glidewrites
34
+
35
+ <img src="writer/glidewrites.svg" width="48" alt="">
36
+
37
+ Glideshow's sister app: documents you own, in a Google Docs–style editor. A document is `doc.html` (blocks of plain HTML)
38
+ plus `assets/`, kept in `~/writes`; agents edit the same file while you type, and the editor merges both. It opens Word,
39
+ Markdown and HTML files and saves Word, Markdown, HTML and PDF. On a phone it looks like the Docs app.
40
+
41
+ Installed with Glideshow (one package, two commands):
42
+
43
+ ```console
44
+ $ glidewrites # the home screen: your documents (in ~/writes)
45
+ $ glidewrites new "Trip plan" # a new document, opened in the editor
46
+ $ glidewrites import notes.docx # a Word, Markdown or HTML file as a document
47
+ $ glidewrites install # start its server at login (macOS, Linux, Windows)
48
+ $ bash tools/make-writes-app.sh # macOS: Glidewrites.app for the Dock
49
+ ```
50
+
51
+ - [For agents](docs/agents-writes.md): the commands (`blocks`, `put`, `find`, `export`), the format and recipes; every
52
+ document gets a copy as `AGENTS.md`. The Claude Code skill is in `skills/glidewrites`.
53
+
45
54
  ## Contributing
46
55
 
47
56
  Issues and pull requests are welcome. Before sending one, run `tools/check.sh` (types and lint) and `uv run test/smoke.py`
48
- (the editor end to end, in Chrome).
57
+ (the editor end to end, in Chrome); for Glidewrites, `uv run test/writes_matrix.py` (every `test/writes*.py` suite in
58
+ Chrome, WebKit and Firefox; `GW_BROWSER=webkit uv run test/writes.py` for one).
49
59
 
50
60
  ## Releasing
51
61
 
@@ -0,0 +1,20 @@
1
+ /* glideshow.org's static files are the repo's two browser apps (wrangler.toml [assets] is the repo root, .assetsignore
2
+ keeps only editor/ and writer/). Glideshow's code asks for its files as if editor/ were the root ('/index.html',
3
+ 'https://assets.local/deck/base.css'), so the binding it gets puts '/editor' in front; Glidewrites' files are asked
4
+ for under '/writer/' on the raw binding (writerAsset). */
5
+
6
+ /** env with ASSETS rooted at editor/ (what Glideshow's Worker and library expect), the raw binding kept as ALL_ASSETS. */
7
+ export function editorEnv(env) {
8
+ if (!env?.ASSETS || env.ALL_ASSETS) return env;
9
+ const raw = env.ASSETS;
10
+ const ASSETS = { fetch: (req, init) => {
11
+ const r = req instanceof Request ? req : new Request(req, init), u = new URL(r.url);
12
+ u.pathname = '/editor' + u.pathname;
13
+ return raw.fetch(new Request(u, r));
14
+ } };
15
+ return new Proxy(env, { get: (t, k) => k === 'ASSETS' ? ASSETS : k === 'ALL_ASSETS' ? raw : t[k] });
16
+ }
17
+ /** One of Glidewrites' files (path: '/writer/…'). */
18
+ export function writerAsset(env, path, origin = 'https://assets.local') {
19
+ return (env.ALL_ASSETS || env.ASSETS).fetch(new Request(new URL(path, origin)));
20
+ }
@@ -12,7 +12,14 @@ export const SESSION_DAYS = 90;
12
12
  const enc = s => new TextEncoder().encode(s);
13
13
 
14
14
  export const cookie = (name, value, maxAge) => `${name}=${value}; Path=/; Max-Age=${maxAge}; HttpOnly; Secure; SameSite=Lax`;
15
+ /* The session's and sign-in's cookies carry the __Host- prefix: the browser takes such a cookie only host-only (no Domain),
16
+ Secure and on Path=/, so a page on a subdomain (a shared deck's own host, worker.js deckHost: its scripts are the deck
17
+ owner's) can't set one that glideshow.org would read: "cookie tossing", which would sign the viewer in as someone else
18
+ or spoil a sign-in. Before 2026-11 they were plain `session` and `oauth`: see legacySession. */
19
+ export const SESSION = '__Host-session', OAUTH = '__Host-oauth';
15
20
  export const getCookie = (req, name) => (req.headers.get('cookie') || '').split(/;\s*/).find(c => c.startsWith(name + '='))?.slice(name.length + 1) || '';
21
+ /* If-None-Match names this version: compared weakly, as Cloudflare may weaken an ETag on the way (W/"x" is "x") */
22
+ export const sameTag = (req, etag) => (req.headers.get('if-none-match') || '').split(/\s*,\s*/).some(t => t.replace(/^W\//, '') === etag.replace(/^W\//, ''));
16
23
  export const json = (obj, status = 200, headers = {}) => new Response(JSON.stringify(obj), { status, headers: { 'content-type': 'application/json', ...headers } });
17
24
  export const redirect = (location, headers = {}) => new Response(null, { status: 303, headers: { location, ...headers } });
18
25
  export const safeNext = asked => /^\/(?![\/\\])/.test(asked || '') ? asked : '/'; // only a path on this site
@@ -51,7 +58,17 @@ export async function unlock(env, value) {
51
58
  }
52
59
 
53
60
  /* The person signed in, or null: {p: 'github'|'google', u: id, l: login, n: name, e: [emails], x: expiry}. */
54
- export async function session(req, env) { return unseal(env, getCookie(req, 'session')); }
61
+ export async function session(req, env) { return await unseal(env, getCookie(req, SESSION)) || unseal(env, await legacySession(req, env)); }
62
+ /* A session still under its old name (`session`), as signed in before the rename: taken (and reissued under the new name:
63
+ worker.js) only when there is no new one, and only if it was issued before OLD_SESSIONS_BEFORE (wrangler.toml, the day
64
+ the rename was deployed). A subdomain can toss a `session` cookie for Domain=glideshow.org, and its value would be a
65
+ real sealed session (anyone's own, copied from their browser): issued after the rename, it is never read under the old
66
+ name, so tossing one does nothing. The sealed value is the same under either name. */
67
+ export async function legacySession(req, env) {
68
+ if (getCookie(req, SESSION) || !env.OLD_SESSIONS_BEFORE) return '';
69
+ const v = getCookie(req, 'session'), o = v ? await unseal(env, v) : null;
70
+ return o && (o.x - SESSION_DAYS * 86400) * 1000 < Date.parse(env.OLD_SESSIONS_BEFORE) ? v : '';
71
+ }
55
72
  const listed = (list, x) => (list || '').split(',').map(a => a.trim().toLowerCase()).some(a => a === '*' || a === x.toLowerCase());
56
73
  /* Who may take shared decks down and suspend accounts (/admin): GitHub logins on ADMINS. */
57
74
  export const isAdmin = (s, env) => s?.p === 'github' && !!env.ADMINS && listed(env.ADMINS.replace(/\*/g, ''), s.l);
@@ -60,7 +77,7 @@ export const isOwner = (s, env) => s?.p === 'github' ? listed(env.ALLOWED_USERS,
60
77
  export const libraryFor = (env, who) => env.LIB.get(env.LIB.idFromName(who.p === 'google' ? 'user:g:' + who.u : 'user:' + who.u));
61
78
  async function signIn(env, who, next) {
62
79
  const x = Math.floor(Date.now() / 1000) + SESSION_DAYS * 86400;
63
- return redirect(next, { 'set-cookie': cookie('session', await seal(env, { ...who, x }), SESSION_DAYS * 86400) });
80
+ return redirect(next, { 'set-cookie': cookie(SESSION, await seal(env, { ...who, x }), SESSION_DAYS * 86400) });
64
81
  }
65
82
 
66
83
  /* ---------- GitHub: sign in through the Glideshow app ---------- */
@@ -69,12 +86,12 @@ export async function githubStart(env, url) {
69
86
  const state = await seal(env, { next: safeNext(url.searchParams.get('next')), x: Math.floor(Date.now() / 1000) + 600, n: crypto.randomUUID() });
70
87
  const to = new URL('https://github.com/login/oauth/authorize');
71
88
  to.searchParams.set('client_id', env.GITHUB_CLIENT_ID); to.searchParams.set('redirect_uri', url.origin + '/auth/github/callback'); to.searchParams.set('state', state);
72
- return redirect(to.href, { 'set-cookie': cookie('oauth', state, 600) });
89
+ return redirect(to.href, { 'set-cookie': cookie(OAUTH, state, 600) });
73
90
  }
74
91
 
75
92
  export async function githubCallback(req, env, url) {
76
93
  const state = url.searchParams.get('state') || '', st = await unseal(env, state);
77
- if (!st || state !== getCookie(req, 'oauth')) return page('Sign-in expired', '<p>That sign-in took too long or came from elsewhere. <a href="/login">Try again</a>.</p>', 400);
94
+ if (!st || state !== getCookie(req, OAUTH)) return page('Sign-in expired', '<p>That sign-in took too long or came from elsewhere. <a href="/login">Try again</a>.</p>', 400);
78
95
  const r = await fetch('https://github.com/login/oauth/access_token', { method: 'POST', headers: { accept: 'application/json', 'content-type': 'application/json' },
79
96
  body: JSON.stringify({ client_id: env.GITHUB_CLIENT_ID, client_secret: env.GITHUB_CLIENT_SECRET, code: url.searchParams.get('code'), redirect_uri: url.origin + '/auth/github/callback' }) });
80
97
  const tok = (await r.json().catch(() => ({}))).access_token;
@@ -84,7 +101,7 @@ export async function githubCallback(req, env, url) {
84
101
  if (!user) return page('Sign-in failed', '<p>GitHub didn\'t say who you are. <a href="/login">Try again</a>.</p>', 400);
85
102
  const who = { p: 'github', u: String(user.id), l: user.login, n: user.name || user.login, e: user.email ? [user.email.toLowerCase()] : [] };
86
103
  const res = await signIn(env, who, st.next);
87
- res.headers.append('set-cookie', cookie('oauth', '', 0));
104
+ res.headers.append('set-cookie', cookie(OAUTH, '', 0));
88
105
  if (isOwner(who, env)) await libraryFor(env, who).signedIn(who, tok); // the token lists the repos it may use, for setup
89
106
  return res;
90
107
  }
@@ -102,12 +119,12 @@ export async function googleStart(env, url) {
102
119
  ...(drive ? { scope: 'openid email profile https://www.googleapis.com/auth/drive.file', access_type: 'offline', prompt: url.searchParams.get('hint') ? 'consent' : 'select_account consent', include_granted_scopes: 'true', login_hint: url.searchParams.get('hint') || '' }
103
120
  : { scope: 'openid email profile', prompt: 'select_account' }) };
104
121
  for (const [k, v] of Object.entries(params)) if (v) to.searchParams.set(k, v);
105
- return redirect(to.href, { 'set-cookie': cookie('oauth', state, 600) });
122
+ return redirect(to.href, { 'set-cookie': cookie(OAUTH, state, 600) });
106
123
  }
107
124
 
108
125
  export async function googleCallback(req, env, url) {
109
126
  const state = url.searchParams.get('state') || '', st = await unseal(env, state);
110
- if (!st || state !== getCookie(req, 'oauth')) return page('Sign-in expired', '<p>That sign-in took too long or came from elsewhere. <a href="/login">Try again</a>.</p>', 400);
127
+ if (!st || state !== getCookie(req, OAUTH)) return page('Sign-in expired', '<p>That sign-in took too long or came from elsewhere. <a href="/login">Try again</a>.</p>', 400);
111
128
  const r = await fetch('https://oauth2.googleapis.com/token', { method: 'POST', headers: { 'content-type': 'application/x-www-form-urlencoded' },
112
129
  body: new URLSearchParams({ code: url.searchParams.get('code') || '', client_id: env.GOOGLE_CLIENT_ID, client_secret: env.GOOGLE_CLIENT_SECRET, redirect_uri: url.origin + '/auth/google/callback', grant_type: 'authorization_code' }) });
113
130
  const tokens = await r.json().catch(() => ({})), idToken = tokens.id_token;
@@ -124,7 +141,7 @@ export async function googleCallback(req, env, url) {
124
141
  else if (next === '/' && !(await lib.info()).ready) next = `/setup`; // only someone who came to make decks, not a viewer of a link
125
142
  }
126
143
  const res = await signIn(env, who, next);
127
- res.headers.append('set-cookie', cookie('oauth', '', 0));
144
+ res.headers.append('set-cookie', cookie(OAUTH, '', 0));
128
145
  return res;
129
146
  }
130
147
 
@@ -207,7 +224,7 @@ export function page(title, body, status = 200, opts = {}) {
207
224
  return new Response(`<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
208
225
  ${meta(opts.full || (title === 'Glideshow' ? title : title + ' · Glideshow'), opts)}<link rel="icon" href="/favicon.svg" type="image/svg+xml"><link rel="apple-touch-icon" href="/apple-touch-icon.png"><title>${esc(opts.full || (title === 'Glideshow' ? title : title + ' · Glideshow'))}</title>
209
226
  <script>try { const v = localStorage.getItem('slides-dark'); if (v) document.documentElement.dataset.theme = v === '1' ? 'dark' : 'light'; } catch {}</script>
210
- <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@300;400;500;600&display=swap"><style>
227
+ <link rel="stylesheet" href="/editor/vendor/fonts/fonts.css"><style>
211
228
  .stage { display: inline-block; margin-left: .5em; padding: .15em .55em; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .32em; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; vertical-align: .55em; } /* alpha (the front page) */
212
229
  :root { --card: #fff; --ink: #14204a; --muted: #5c6b87; --line: #dbe2ea; --accent: #2f6bff; --on-accent: #fff; --err: #b3261e; --hover: #f1f4f9;
213
230
  --sky: radial-gradient(120% 140% at 88% 130%, #ffe1a8 0%, rgba(255, 225, 168, 0) 58%), linear-gradient(180deg, #a9c8ff 0%, #d4e3ff 48%, #f3f6fb 100%); --grain-blend: multiply; --grain: .14; }
@@ -20,7 +20,7 @@
20
20
  const TAGS = new Set(['section', 'div', 'span', 'p', 'br', 'b', 'strong', 'i', 'em', 'u', 's', 'strike', 'del', 'ins', 'sub', 'sup',
21
21
  'small', 'mark', 'a', 'ul', 'ol', 'li', 'table', 'thead', 'tbody', 'tfoot', 'tr', 'td', 'th', 'col', 'colgroup', 'caption',
22
22
  'pre', 'code', 'blockquote', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'img', 'video', 'source', 'aside', 'figure',
23
- 'figcaption', 'font',
23
+ 'figcaption', 'font', 'time',
24
24
  // SVG drawn by the editor (shapes, connectors, icons): drawing only
25
25
  'svg', 'g', 'path', 'rect', 'circle', 'ellipse', 'line', 'polyline', 'polygon', 'text', 'tspan', 'defs',
26
26
  'lineargradient', 'radialgradient', 'stop', 'clippath', 'marker']);
@@ -34,7 +34,7 @@ const PER_TAG = {
34
34
  a: ['href', 'target', 'rel'], img: ['src', 'alt', 'width', 'height', 'loading', 'decoding'],
35
35
  video: ['src', 'poster', 'controls', 'playsinline', 'muted', 'loop', 'autoplay', 'preload', 'width', 'height'], source: ['src', 'type'],
36
36
  td: ['colspan', 'rowspan'], th: ['colspan', 'rowspan', 'scope'], col: ['span', 'width'], colgroup: ['span'], ol: ['start', 'type', 'reversed'],
37
- font: ['color', 'size', 'face'], aside: [], section: [],
37
+ font: ['color', 'size', 'face'], aside: [], section: [], time: ['datetime'],
38
38
  svg: ['viewbox', 'preserveaspectratio', 'width', 'height', 'xmlns', 'fill', 'stroke', 'overflow'],
39
39
  };
40
40
  const SVG_ATTRS = ['d', 'fill', 'fill-rule', 'fill-opacity', 'stroke', 'stroke-width', 'stroke-linejoin', 'stroke-linecap', 'stroke-dasharray',
@@ -105,7 +105,8 @@ function cleaning(rw, approved, scope = '') {
105
105
  const own = new Set(PER_TAG[tag] || []);
106
106
  for (const [name, value] of [...e.attributes]) {
107
107
  const k = name.toLowerCase();
108
- let ok = GLOBAL.has(k) || own.has(k) || (/^data-[a-z0-9-]+$/.test(k) && SAFE_DATA(value)) || /^aria-[a-z]+$/.test(k);
108
+ let ok = GLOBAL.has(k) || own.has(k) || (/^data-[a-z0-9-]+$/.test(k) && SAFE_DATA(value)) || /^aria-[a-z]+$/.test(k)
109
+ || (tag === 'svg' && (k === 'data-drawing' || k === 'data-chart') && value.length < 400_000 && !/[<>]|javascript:|vbscript:/i.test(value)); // a Glidewrites drawing's or chart's source (JSON; never a URL or style)
109
110
  if (ok && URL_ATTRS.has(k)) ok = safeURL(value, k, tag);
110
111
  if (ok && k === 'class') ok = CLASS_OK(value);
111
112
  if (ok && k === 'id') ok = ID_OK(value);
@@ -191,3 +192,30 @@ export async function deckForCollaborator(ownerDeck) {
191
192
  .on('*', { element(e) { for (const [k, v] of [...e.attributes]) if (/^on/i.test(k) || /^\s*javascript:/i.test(v)) e.removeAttribute(k); } });
192
193
  return rw.transform(new Response(ownerDeck)).text();
193
194
  }
195
+
196
+ /* ---------- Glidewrites documents (writes.js): a collaborator's save, and the document they open ----------
197
+ A document is doc.html: Docs' styles in its head, its blocks in <article class="doc">. What a collaborator saves keeps
198
+ the owner's head (their styles, anything an agent put there) and takes only their blocks, through the same allow-list
199
+ as slides (doc blocks are what the editor writes: paragraphs, lists, tables, pictures, drawings and charts as SVG);
200
+ each block whose cleaned text is the same as the owner's cleaned one comes back as the owner's own, exactly. */
201
+ const NONE = { iframes: new Set(), styles: new Set() };
202
+ const W = () => /** @type {any} */ (globalThis).writeMerge; // writer/lib/merge.js (writes.js imports it)
203
+ async function cleanBlocks(inner) { return cleaning(new HTMLRewriter().onDocument({ comments(c) { c.remove(); } }), NONE).transform(new Response(inner)).text(); }
204
+ /** The owner's document with the collaborator's blocks (cleaned, or the owner's own where untouched) and title. */
205
+ export async function composeDoc(ownerDoc, theirDoc) {
206
+ const { docParts, splitBlocks, bidOf } = W(), mine = docParts(ownerDoc), theirs = docParts(theirDoc);
207
+ const ownRaw = new Map(), ownClean = new Map();
208
+ const ownBlocks = splitBlocks(mine.inner), ownCleaned = splitBlocks(await cleanBlocks(mine.inner));
209
+ if (ownBlocks.length === ownCleaned.length) ownBlocks.forEach((b, i) => { const id = bidOf(b); if (id && !ownRaw.has(id)) { ownRaw.set(id, b); ownClean.set(id, ownCleaned[i]); } });
210
+ const blocks = splitBlocks(await cleanBlocks(theirs.inner)).map(b => { const id = bidOf(b); return id && ownClean.get(id) === b ? ownRaw.get(id) : b; });
211
+ const t = /<title>([\s\S]*?)<\/title>/i.exec(theirDoc)?.[1] ?? '', title = t.replace(/<[^>]*>/g, '').replace(/[<>]/g, '').trim().slice(0, 200);
212
+ const head = title ? mine.head.replace(/<title>[\s\S]*?<\/title>/i, `<title>${title}</title>`) : mine.head;
213
+ return head + '\n' + blocks.join('\n') + '\n' + mine.tail;
214
+ }
215
+ /** The owner's document as a collaborator's editor gets it: its blocks cleaned, and no script or handler anywhere. */
216
+ export async function docForCollaborator(ownerDoc) {
217
+ const p = W().docParts(ownerDoc), inner = await cleanBlocks(p.inner);
218
+ const strip = h => new HTMLRewriter().on('script', { element(e) { e.remove(); } })
219
+ .on('*', { element(e) { for (const [k, v] of [...e.attributes]) if (/^on/i.test(k) || /^\s*javascript:/i.test(v)) e.removeAttribute(k); } }).transform(new Response(h)).text();
220
+ return (await strip(p.head)) + inner + (await strip(p.tail));
221
+ }
@@ -1,24 +1,29 @@
1
1
  /* One person's library on glideshow.org: a Durable Object per person (user:<GitHub id>, user:g:<Google id>), over their
2
2
  GitHub repo (store-github.js) or the Glideshow folder in their Drive (store-drive.js). The logic is the editor's
3
- lib/library.js, which a library kept in a browser runs too (editor/local/sw.js); this adds the Durable Object, the two
3
+ glidecore/web/library.js, which a library kept in a browser runs too (editor/local/sw.js); this adds the Durable Object, the two
4
4
  stores and sharing (share.js). The Mac pulls the commits it makes (history.py `sync`), and this side picks up pushes
5
5
  within seconds. */
6
6
 
7
7
  import { DurableObject } from 'cloudflare:workers';
8
- import { LibraryCore } from '../editor/lib/library.js';
8
+ import { LibraryCore, b64url } from '../glidecore/web/library.js';
9
9
  import { GitHubStore } from './store-github.js';
10
10
  import { DriveStore, makeRoot } from './store-drive.js';
11
11
  import { shareRoutes, publishAPI, commentsAPI, collabRoutes, collabDeck } from './share.js';
12
- export * from '../editor/lib/library.js';
12
+ import { writesRoutes, writesShare, writesLive, writesMessage, writesClose } from './writes.js';
13
+ import { editorEnv } from './assets.js';
14
+ export * from '../glidecore/web/library.js';
13
15
 
14
16
  /* Every editor open on a deck holds a WebSocket here, tagged with the deck's file (the Durable Object sleeps with them open);
15
17
  a save of that file, here or come from GitHub or Drive, sends them its new version (editor/js/boot.js remoteVersion). */
16
- const notify = (lib, path, v, here = false) => { // by: who saved it here (the owner, or the collaborator share.js names); none for a push or Drive
18
+ const notify = (lib, path, v, here = false, by = '') => { // by: who saved it here (the owner, or the collaborator share.js names); none for a push or Drive
17
19
  const both = lib.merged?.[path]?.v === v ? lib.merged[path].both : undefined; // a save merged with a push: where the save's version was kept
18
- const msg = JSON.stringify({ deck: path.slice(0, -'/deck.html'.length), v, by: here ? lib.by || lib.cfg.user?.n || lib.cfg.user?.l || '' : '', ...(both?.length ? { both } : {}) });
20
+ const msg = JSON.stringify({ deck: path.slice(0, -'/deck.html'.length), v, by: here ? by || lib.cfg.user?.n || lib.cfg.user?.l || '' : '', ...(both?.length ? { both } : {}) });
19
21
  for (const ws of lib.ctx.getWebSockets(path)) try { ws.send(msg); } catch {}
20
22
  };
21
- const deps = { store: lib => lib.cfg.kind === 'drive' ? new DriveStore(lib) : new GitHubStore(lib), makeRoot, share: { shareRoutes, publishAPI, commentsAPI, collabRoutes }, notify };
23
+ /* A file saved here and changed in the store meanwhile, other than a deck or the library's JSON (LibraryCore rebasePending):
24
+ a Glidewrites document merges as its editor does; anything else is kept beside theirs (null). */
25
+ const mergeFile = (path, base, mine, theirs) => /^writes\/.+\/doc\.html$/.test(path) ? (/** @type {any} */ (globalThis).writeMerge?.mergeDocs(base, mine, theirs) ?? null) : null;
26
+ const deps = { store: lib => lib.cfg.kind === 'drive' ? new DriveStore(lib) : new GitHubStore(lib), makeRoot, share: { shareRoutes, publishAPI, commentsAPI, collabRoutes }, notify, mergeFile };
22
27
 
23
28
  /* Requests a day, per library (every HTTP request here, an alarm, a WebSocket message as the 1/20 Cloudflare bills it):
24
29
  the free plan allows 100,000 Durable Object requests a day for the whole account, so one runaway editor (2026-10-21: a
@@ -55,7 +60,7 @@ const marked = (res, level) => { // the load level on a response (not on a Web
55
60
  const pausedResponse = () => new Response(JSON.stringify({ error: 'paused', load: 'paused' }), { status: 429, headers: { 'content-type': 'application/json', 'x-glideshow-load': 'paused', 'retry-after': '3600' } });
56
61
 
57
62
  export class Library extends DurableObject {
58
- constructor(ctx, env) { super(ctx, env); LibraryCore.prototype.init.call(this, ctx, env, deps); }
63
+ constructor(ctx, env) { super(ctx, env); LibraryCore.prototype.init.call(this, ctx, editorEnv(env), deps); }
59
64
  }
60
65
  // LibraryCore's methods become the Durable Object's own: its RPC methods and its fetch and alarm handlers
61
66
  for (const k of Object.getOwnPropertyNames(LibraryCore.prototype)) {
@@ -84,6 +89,13 @@ Object.defineProperty(Library.prototype, 'pushed', { value: async function (bran
84
89
  await this.refresh(true); return true;
85
90
  } });
86
91
  const libraryFetch = async function (req, path) {
92
+ if (path.startsWith('/__writes/') || path.startsWith('/__wshare/')) { // Glidewrites: documents under writes/ (writes.js)
93
+ await this.loaded; if (!this.ready()) return new Response(JSON.stringify({ error: 'No library yet: set it up at /setup.' }), { status: 409, headers: { 'content-type': 'application/json' } });
94
+ await this.refresh();
95
+ const live = path.match(/^\/__writes\/api\/live$/) || path.match(/^\/__wshare\/([^/]+)\/api\/live$/);
96
+ if (live && req.headers.get('upgrade')?.toLowerCase() === 'websocket') return writesLive(this, req, new URL(req.url), live[1] ? decodeURIComponent(live[1]) : '');
97
+ return path.startsWith('/__writes/') ? writesRoutes(this, req, new URL(req.url)) : writesShare(this, req, new URL(req.url));
98
+ }
87
99
  const collab = path.match(/^\/__collab\/([^/]+)\/api\/live$/);
88
100
  if ((path === '/api/live' || collab) && req.headers.get('upgrade')?.toLowerCase() === 'websocket') {
89
101
  await this.loaded; if (!this.ready()) return new Response('no library', { status: 409 });
@@ -92,6 +104,8 @@ const libraryFetch = async function (req, path) {
92
104
  if (collab) { const c = await collabDeck(this, req, collab[1]); if (c.error) return c.error; deck = c.deck; } // a collaborator: the deck they may edit
93
105
  else deck = this.current(req);
94
106
  if (!deck) return new Response('no deck', { status: 404 });
107
+ const asked = new URL(req.url).searchParams.get('deck'); // the deck the page opened: another opened in this browser since is not its deck (library.js handle)
108
+ if (!collab && asked && asked !== b64url(deck)) return new Response('switched', { status: 409, headers: { 'x-glideshow-switched': '1' } });
95
109
  const pair = new WebSocketPair(), [client, server] = [pair[0], pair[1]], tag = deck + '/deck.html';
96
110
  this.ctx.acceptWebSocket(server, [tag]);
97
111
  const v = collab ? JSON.parse(req.headers.get('x-viewer') || '{}') : null, me = this.cfg.user || {};
@@ -117,6 +131,7 @@ function tellPeople(lib, tag, gone = '') {
117
131
  Object.defineProperty(Library.prototype, 'webSocketMessage', { async value(ws, data) {
118
132
  if (await meter(this, 1 / 20) === 'paused') { try { ws.close(4429, 'paused'); } catch {} return; }
119
133
  const a = ws.deserializeAttachment(); if (!a || typeof data !== 'string' || data.length > 4000) return;
134
+ if (a.w) return writesMessage(this, ws, data); // a Glidewrites document's socket (writes.js)
120
135
  let here; try { here = JSON.parse(data).here; } catch { return; }
121
136
  if (!here || typeof here !== 'object') return;
122
137
  const id = x => typeof x === 'string' && /^[\w:.-]{1,80}$/.test(x) ? x : '';
@@ -125,6 +140,7 @@ Object.defineProperty(Library.prototype, 'webSocketMessage', { async value(ws, d
125
140
  } });
126
141
  Object.defineProperty(Library.prototype, 'webSocketClose', { value(ws) {
127
142
  const a = ws.deserializeAttachment();
143
+ if (a?.w) return writesClose(this, ws, a);
128
144
  try { ws.close(); } catch {}
129
145
  if (a) tellPeople(this, a.tag, a.id);
130
146
  } });
@@ -14,13 +14,13 @@ GitHub repo. You see every version, and AI agents can read and edit them with yo
14
14
  <a class="btn primary" href="/start">Start a deck</a><a class="btn" href="/login">Sign in</a>
15
15
  <button class="btn" id="use-folder" type="button" hidden>Use a folder on this computer</button>
16
16
  <small id="use-folder-note" hidden>Your decks as real folders you pick, only on this computer: not synced, and they can't be shared.</small>
17
- <script>{ // Chrome and Edge on a computer can keep the decks in a folder the person picks (editor/lib/store-folder.js);
17
+ <script>{ // Chrome and Edge on a computer can keep the decks in a folder the person picks (glidecore/web/store-folder.js);
18
18
  // the others can't, and on a phone or tablet (a touch screen, no mouse) there is no folder to speak of
19
19
  const b = document.getElementById('use-folder');
20
20
  if ('showDirectoryPicker' in window && matchMedia('(pointer: fine)').matches) { b.hidden = false; document.getElementById('use-folder-note').hidden = false; }
21
21
  b.onclick = async () => {
22
22
  let dir; try { dir = await window.showDirectoryPicker({ mode: 'readwrite', id: 'glideshow' }); } catch { return; } // closed without picking
23
- await (await import('/editor/lib/store-folder.js')).setFolder(dir);
23
+ await (await import('/core/store-folder.js')).setFolder(dir);
24
24
  location.href = '/start';
25
25
  };
26
26
  }</script>