@bobfrankston/mailx 1.0.465 → 1.0.500

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 (344) hide show
  1. package/.globalize.json5 +25 -0
  2. package/README.md +17 -420
  3. package/bin/mailx.js +87 -84
  4. package/bin/mailx.js.map +1 -1
  5. package/bin/mailx.ts +87 -84
  6. package/client/android.html +5 -5
  7. package/client/app.js +42 -38
  8. package/client/components/folder-tree.js +7 -5
  9. package/client/components/message-list.js +485 -448
  10. package/client/components/message-viewer.js +36 -41
  11. package/client/index.html +8 -8
  12. package/client/lib/message-state.js +46 -65
  13. package/index.js +59 -0
  14. package/package.json +12 -114
  15. package/packages/mailx-send/mailsend/{package-lock.json → node_modules/.package-lock.json} +0 -16
  16. package/packages/mailx-send/mailsend/node_modules/@types/node/LICENSE +21 -0
  17. package/packages/mailx-send/mailsend/node_modules/@types/node/README.md +15 -0
  18. package/packages/mailx-send/mailsend/node_modules/@types/node/assert/strict.d.ts +111 -0
  19. package/packages/mailx-send/mailsend/node_modules/@types/node/assert.d.ts +1078 -0
  20. package/packages/mailx-send/mailsend/node_modules/@types/node/async_hooks.d.ts +603 -0
  21. package/packages/mailx-send/mailsend/node_modules/@types/node/buffer.buffer.d.ts +472 -0
  22. package/packages/mailx-send/mailsend/node_modules/@types/node/buffer.d.ts +1934 -0
  23. package/packages/mailx-send/mailsend/node_modules/@types/node/child_process.d.ts +1476 -0
  24. package/packages/mailx-send/mailsend/node_modules/@types/node/cluster.d.ts +578 -0
  25. package/packages/mailx-send/mailsend/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
  26. package/packages/mailx-send/mailsend/node_modules/@types/node/compatibility/index.d.ts +9 -0
  27. package/packages/mailx-send/mailsend/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
  28. package/packages/mailx-send/mailsend/node_modules/@types/node/compatibility/iterators.d.ts +20 -0
  29. package/packages/mailx-send/mailsend/node_modules/@types/node/console.d.ts +452 -0
  30. package/packages/mailx-send/mailsend/node_modules/@types/node/constants.d.ts +21 -0
  31. package/packages/mailx-send/mailsend/node_modules/@types/node/crypto.d.ts +4545 -0
  32. package/packages/mailx-send/mailsend/node_modules/@types/node/dgram.d.ts +600 -0
  33. package/packages/mailx-send/mailsend/node_modules/@types/node/diagnostics_channel.d.ts +578 -0
  34. package/packages/mailx-send/mailsend/node_modules/@types/node/dns/promises.d.ts +503 -0
  35. package/packages/mailx-send/mailsend/node_modules/@types/node/dns.d.ts +923 -0
  36. package/packages/mailx-send/mailsend/node_modules/@types/node/domain.d.ts +170 -0
  37. package/packages/mailx-send/mailsend/node_modules/@types/node/events.d.ts +976 -0
  38. package/packages/mailx-send/mailsend/node_modules/@types/node/fs/promises.d.ts +1295 -0
  39. package/packages/mailx-send/mailsend/node_modules/@types/node/fs.d.ts +4461 -0
  40. package/packages/mailx-send/mailsend/node_modules/@types/node/globals.d.ts +172 -0
  41. package/packages/mailx-send/mailsend/node_modules/@types/node/globals.typedarray.d.ts +38 -0
  42. package/packages/mailx-send/mailsend/node_modules/@types/node/http.d.ts +2089 -0
  43. package/packages/mailx-send/mailsend/node_modules/@types/node/http2.d.ts +2644 -0
  44. package/packages/mailx-send/mailsend/node_modules/@types/node/https.d.ts +579 -0
  45. package/packages/mailx-send/mailsend/node_modules/@types/node/index.d.ts +97 -0
  46. package/packages/mailx-send/mailsend/node_modules/@types/node/inspector.d.ts +253 -0
  47. package/packages/mailx-send/mailsend/node_modules/@types/node/inspector.generated.d.ts +4052 -0
  48. package/packages/mailx-send/mailsend/node_modules/@types/node/module.d.ts +891 -0
  49. package/packages/mailx-send/mailsend/node_modules/@types/node/net.d.ts +1057 -0
  50. package/packages/mailx-send/mailsend/node_modules/@types/node/os.d.ts +506 -0
  51. package/packages/mailx-send/mailsend/node_modules/@types/node/package.json +145 -0
  52. package/packages/mailx-send/mailsend/node_modules/@types/node/path.d.ts +200 -0
  53. package/packages/mailx-send/mailsend/node_modules/@types/node/perf_hooks.d.ts +968 -0
  54. package/packages/mailx-send/mailsend/node_modules/@types/node/process.d.ts +2084 -0
  55. package/packages/mailx-send/mailsend/node_modules/@types/node/punycode.d.ts +117 -0
  56. package/packages/mailx-send/mailsend/node_modules/@types/node/querystring.d.ts +152 -0
  57. package/packages/mailx-send/mailsend/node_modules/@types/node/readline/promises.d.ts +161 -0
  58. package/packages/mailx-send/mailsend/node_modules/@types/node/readline.d.ts +594 -0
  59. package/packages/mailx-send/mailsend/node_modules/@types/node/repl.d.ts +428 -0
  60. package/packages/mailx-send/mailsend/node_modules/@types/node/sea.d.ts +153 -0
  61. package/packages/mailx-send/mailsend/node_modules/@types/node/sqlite.d.ts +721 -0
  62. package/packages/mailx-send/mailsend/node_modules/@types/node/stream/consumers.d.ts +38 -0
  63. package/packages/mailx-send/mailsend/node_modules/@types/node/stream/promises.d.ts +90 -0
  64. package/packages/mailx-send/mailsend/node_modules/@types/node/stream/web.d.ts +622 -0
  65. package/packages/mailx-send/mailsend/node_modules/@types/node/stream.d.ts +1664 -0
  66. package/packages/mailx-send/mailsend/node_modules/@types/node/string_decoder.d.ts +67 -0
  67. package/packages/mailx-send/mailsend/node_modules/@types/node/test.d.ts +2163 -0
  68. package/packages/mailx-send/mailsend/node_modules/@types/node/timers/promises.d.ts +108 -0
  69. package/packages/mailx-send/mailsend/node_modules/@types/node/timers.d.ts +287 -0
  70. package/packages/mailx-send/mailsend/node_modules/@types/node/tls.d.ts +1319 -0
  71. package/packages/mailx-send/mailsend/node_modules/@types/node/trace_events.d.ts +197 -0
  72. package/packages/mailx-send/mailsend/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
  73. package/packages/mailx-send/mailsend/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +34 -0
  74. package/packages/mailx-send/mailsend/node_modules/@types/node/ts5.6/index.d.ts +97 -0
  75. package/packages/mailx-send/mailsend/node_modules/@types/node/tty.d.ts +208 -0
  76. package/packages/mailx-send/mailsend/node_modules/@types/node/url.d.ts +984 -0
  77. package/packages/mailx-send/mailsend/node_modules/@types/node/util.d.ts +2606 -0
  78. package/packages/mailx-send/mailsend/node_modules/@types/node/v8.d.ts +920 -0
  79. package/packages/mailx-send/mailsend/node_modules/@types/node/vm.d.ts +1000 -0
  80. package/packages/mailx-send/mailsend/node_modules/@types/node/wasi.d.ts +181 -0
  81. package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
  82. package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  83. package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/events.d.ts +97 -0
  84. package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/fetch.d.ts +55 -0
  85. package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/navigator.d.ts +22 -0
  86. package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/storage.d.ts +24 -0
  87. package/packages/mailx-send/mailsend/node_modules/@types/node/worker_threads.d.ts +784 -0
  88. package/packages/mailx-send/mailsend/node_modules/@types/node/zlib.d.ts +747 -0
  89. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/LICENSE +21 -0
  90. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/README.md +15 -0
  91. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/index.d.ts +82 -0
  92. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/addressparser/index.d.ts +31 -0
  93. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/base64/index.d.ts +22 -0
  94. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/dkim/index.d.ts +45 -0
  95. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/dkim/message-parser.d.ts +75 -0
  96. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/dkim/relaxed-body.d.ts +75 -0
  97. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/dkim/sign.d.ts +21 -0
  98. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/fetch/cookies.d.ts +54 -0
  99. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/fetch/index.d.ts +38 -0
  100. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/json-transport/index.d.ts +53 -0
  101. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mail-composer/index.d.ts +25 -0
  102. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mailer/index.d.ts +283 -0
  103. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mailer/mail-message.d.ts +32 -0
  104. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mime-funcs/index.d.ts +87 -0
  105. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mime-funcs/mime-types.d.ts +2 -0
  106. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mime-node/index.d.ts +224 -0
  107. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mime-node/last-newline.d.ts +9 -0
  108. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/qp/index.d.ts +23 -0
  109. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/sendmail-transport/index.d.ts +53 -0
  110. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/sendmail-transport/le-unix.d.ts +7 -0
  111. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/sendmail-transport/le-windows.d.ts +7 -0
  112. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/ses-transport/index.d.ts +146 -0
  113. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/shared/index.d.ts +58 -0
  114. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-connection/data-stream.d.ts +11 -0
  115. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-connection/http-proxy-client.d.ts +16 -0
  116. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-connection/index.d.ts +270 -0
  117. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-pool/index.d.ts +93 -0
  118. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-pool/pool-resource.d.ts +66 -0
  119. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-transport/index.d.ts +115 -0
  120. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/stream-transport/index.d.ts +59 -0
  121. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/well-known/index.d.ts +6 -0
  122. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/xoauth2/index.d.ts +114 -0
  123. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/package.json +38 -0
  124. package/packages/mailx-send/mailsend/node_modules/nodemailer/.ncurc.js +9 -0
  125. package/packages/mailx-send/mailsend/node_modules/nodemailer/.prettierignore +8 -0
  126. package/packages/mailx-send/mailsend/node_modules/nodemailer/.prettierrc +12 -0
  127. package/packages/mailx-send/mailsend/node_modules/nodemailer/.prettierrc.js +10 -0
  128. package/packages/mailx-send/mailsend/node_modules/nodemailer/.release-please-config.json +9 -0
  129. package/packages/mailx-send/mailsend/node_modules/nodemailer/LICENSE +16 -0
  130. package/packages/mailx-send/mailsend/node_modules/nodemailer/README.md +86 -0
  131. package/packages/mailx-send/mailsend/node_modules/nodemailer/SECURITY.txt +22 -0
  132. package/packages/mailx-send/mailsend/node_modules/nodemailer/eslint.config.js +88 -0
  133. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/addressparser/index.js +383 -0
  134. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/base64/index.js +139 -0
  135. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/dkim/index.js +253 -0
  136. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/dkim/message-parser.js +155 -0
  137. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/dkim/relaxed-body.js +154 -0
  138. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/dkim/sign.js +117 -0
  139. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/fetch/cookies.js +281 -0
  140. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/fetch/index.js +280 -0
  141. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/json-transport/index.js +82 -0
  142. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mail-composer/index.js +629 -0
  143. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mailer/index.js +441 -0
  144. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mailer/mail-message.js +316 -0
  145. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-funcs/index.js +625 -0
  146. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-funcs/mime-types.js +2113 -0
  147. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-node/index.js +1316 -0
  148. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-node/last-newline.js +33 -0
  149. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-node/le-unix.js +43 -0
  150. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-node/le-windows.js +52 -0
  151. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/nodemailer.js +157 -0
  152. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/punycode/index.js +460 -0
  153. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/qp/index.js +227 -0
  154. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/sendmail-transport/index.js +210 -0
  155. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/ses-transport/index.js +234 -0
  156. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/shared/index.js +754 -0
  157. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-connection/data-stream.js +108 -0
  158. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +143 -0
  159. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-connection/index.js +1870 -0
  160. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-pool/index.js +652 -0
  161. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +259 -0
  162. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-transport/index.js +421 -0
  163. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/stream-transport/index.js +135 -0
  164. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/well-known/index.js +47 -0
  165. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/well-known/services.json +611 -0
  166. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/xoauth2/index.js +427 -0
  167. package/packages/mailx-send/mailsend/node_modules/nodemailer/package.json +47 -0
  168. package/packages/mailx-send/mailsend/node_modules/undici-types/LICENSE +21 -0
  169. package/packages/mailx-send/mailsend/node_modules/undici-types/README.md +6 -0
  170. package/packages/mailx-send/mailsend/node_modules/undici-types/agent.d.ts +31 -0
  171. package/packages/mailx-send/mailsend/node_modules/undici-types/api.d.ts +43 -0
  172. package/packages/mailx-send/mailsend/node_modules/undici-types/balanced-pool.d.ts +29 -0
  173. package/packages/mailx-send/mailsend/node_modules/undici-types/cache.d.ts +36 -0
  174. package/packages/mailx-send/mailsend/node_modules/undici-types/client.d.ts +108 -0
  175. package/packages/mailx-send/mailsend/node_modules/undici-types/connector.d.ts +34 -0
  176. package/packages/mailx-send/mailsend/node_modules/undici-types/content-type.d.ts +21 -0
  177. package/packages/mailx-send/mailsend/node_modules/undici-types/cookies.d.ts +28 -0
  178. package/packages/mailx-send/mailsend/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
  179. package/packages/mailx-send/mailsend/node_modules/undici-types/dispatcher.d.ts +256 -0
  180. package/packages/mailx-send/mailsend/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
  181. package/packages/mailx-send/mailsend/node_modules/undici-types/errors.d.ts +149 -0
  182. package/packages/mailx-send/mailsend/node_modules/undici-types/eventsource.d.ts +61 -0
  183. package/packages/mailx-send/mailsend/node_modules/undici-types/fetch.d.ts +209 -0
  184. package/packages/mailx-send/mailsend/node_modules/undici-types/file.d.ts +39 -0
  185. package/packages/mailx-send/mailsend/node_modules/undici-types/filereader.d.ts +54 -0
  186. package/packages/mailx-send/mailsend/node_modules/undici-types/formdata.d.ts +108 -0
  187. package/packages/mailx-send/mailsend/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  188. package/packages/mailx-send/mailsend/node_modules/undici-types/global-origin.d.ts +7 -0
  189. package/packages/mailx-send/mailsend/node_modules/undici-types/handlers.d.ts +15 -0
  190. package/packages/mailx-send/mailsend/node_modules/undici-types/header.d.ts +4 -0
  191. package/packages/mailx-send/mailsend/node_modules/undici-types/index.d.ts +71 -0
  192. package/packages/mailx-send/mailsend/node_modules/undici-types/interceptors.d.ts +17 -0
  193. package/packages/mailx-send/mailsend/node_modules/undici-types/mock-agent.d.ts +50 -0
  194. package/packages/mailx-send/mailsend/node_modules/undici-types/mock-client.d.ts +25 -0
  195. package/packages/mailx-send/mailsend/node_modules/undici-types/mock-errors.d.ts +12 -0
  196. package/packages/mailx-send/mailsend/node_modules/undici-types/mock-interceptor.d.ts +93 -0
  197. package/packages/mailx-send/mailsend/node_modules/undici-types/mock-pool.d.ts +25 -0
  198. package/packages/mailx-send/mailsend/node_modules/undici-types/package.json +55 -0
  199. package/packages/mailx-send/mailsend/node_modules/undici-types/patch.d.ts +33 -0
  200. package/packages/mailx-send/mailsend/node_modules/undici-types/pool-stats.d.ts +19 -0
  201. package/packages/mailx-send/mailsend/node_modules/undici-types/pool.d.ts +39 -0
  202. package/packages/mailx-send/mailsend/node_modules/undici-types/proxy-agent.d.ts +28 -0
  203. package/packages/mailx-send/mailsend/node_modules/undici-types/readable.d.ts +65 -0
  204. package/packages/mailx-send/mailsend/node_modules/undici-types/retry-agent.d.ts +8 -0
  205. package/packages/mailx-send/mailsend/node_modules/undici-types/retry-handler.d.ts +116 -0
  206. package/packages/mailx-send/mailsend/node_modules/undici-types/util.d.ts +18 -0
  207. package/packages/mailx-send/mailsend/node_modules/undici-types/webidl.d.ts +228 -0
  208. package/packages/mailx-send/mailsend/node_modules/undici-types/websocket.d.ts +150 -0
  209. package/packages/mailx-server/index.js +1 -1
  210. package/packages/mailx-settings/cloud.js +12 -7
  211. package/packages/mailx-settings/index.js +22 -1
  212. package/client/.gitattributes +0 -10
  213. package/client/app.js.map +0 -1
  214. package/client/app.ts +0 -3190
  215. package/client/components/address-book.js.map +0 -1
  216. package/client/components/address-book.ts +0 -204
  217. package/client/components/alarms.js.map +0 -1
  218. package/client/components/alarms.ts +0 -276
  219. package/client/components/calendar-sidebar.js.map +0 -1
  220. package/client/components/calendar-sidebar.ts +0 -474
  221. package/client/components/calendar.js.map +0 -1
  222. package/client/components/calendar.ts +0 -211
  223. package/client/components/context-menu.js.map +0 -1
  224. package/client/components/context-menu.ts +0 -95
  225. package/client/components/folder-picker.js.map +0 -1
  226. package/client/components/folder-picker.ts +0 -127
  227. package/client/components/folder-tree.js.map +0 -1
  228. package/client/components/folder-tree.ts +0 -1069
  229. package/client/components/message-list.js.map +0 -1
  230. package/client/components/message-list.ts +0 -1129
  231. package/client/components/message-viewer.js.map +0 -1
  232. package/client/components/message-viewer.ts +0 -1257
  233. package/client/components/outbox-view.js.map +0 -1
  234. package/client/components/outbox-view.ts +0 -102
  235. package/client/components/tasks.js.map +0 -1
  236. package/client/components/tasks.ts +0 -234
  237. package/client/compose/compose.js.map +0 -1
  238. package/client/compose/compose.ts +0 -1231
  239. package/client/compose/editor.js.map +0 -1
  240. package/client/compose/editor.ts +0 -599
  241. package/client/compose/ghost-text.js.map +0 -1
  242. package/client/compose/ghost-text.ts +0 -140
  243. package/client/lib/android-bootstrap.js.map +0 -1
  244. package/client/lib/android-bootstrap.ts +0 -9
  245. package/client/lib/api-client.js.map +0 -1
  246. package/client/lib/api-client.ts +0 -439
  247. package/client/lib/local-service.js.map +0 -1
  248. package/client/lib/local-service.ts +0 -646
  249. package/client/lib/local-store.js.map +0 -1
  250. package/client/lib/local-store.ts +0 -283
  251. package/client/lib/message-state.js.map +0 -1
  252. package/client/lib/message-state.ts +0 -160
  253. package/client/tsconfig.json +0 -19
  254. package/packages/mailx-api/.gitattributes +0 -10
  255. package/packages/mailx-api/index.d.ts.map +0 -1
  256. package/packages/mailx-api/index.js.map +0 -1
  257. package/packages/mailx-api/index.ts +0 -283
  258. package/packages/mailx-api/tsconfig.json +0 -9
  259. package/packages/mailx-compose/.gitattributes +0 -10
  260. package/packages/mailx-compose/index.d.ts.map +0 -1
  261. package/packages/mailx-compose/index.js.map +0 -1
  262. package/packages/mailx-compose/index.ts +0 -85
  263. package/packages/mailx-compose/tsconfig.json +0 -9
  264. package/packages/mailx-host/.gitattributes +0 -10
  265. package/packages/mailx-host/index.d.ts +0 -21
  266. package/packages/mailx-host/index.d.ts.map +0 -1
  267. package/packages/mailx-host/index.js +0 -29
  268. package/packages/mailx-host/index.js.map +0 -1
  269. package/packages/mailx-host/index.ts +0 -38
  270. package/packages/mailx-host/package.json +0 -23
  271. package/packages/mailx-host/tsconfig.json +0 -9
  272. package/packages/mailx-host/types-shim.d.ts +0 -14
  273. package/packages/mailx-imap/.gitattributes +0 -10
  274. package/packages/mailx-imap/index.d.ts +0 -442
  275. package/packages/mailx-imap/index.d.ts.map +0 -1
  276. package/packages/mailx-imap/index.js +0 -3684
  277. package/packages/mailx-imap/index.js.map +0 -1
  278. package/packages/mailx-imap/index.ts +0 -3652
  279. package/packages/mailx-imap/package-lock.json +0 -131
  280. package/packages/mailx-imap/package.json +0 -28
  281. package/packages/mailx-imap/providers/gmail-api.d.ts +0 -8
  282. package/packages/mailx-imap/providers/gmail-api.d.ts.map +0 -1
  283. package/packages/mailx-imap/providers/gmail-api.js +0 -8
  284. package/packages/mailx-imap/providers/gmail-api.js.map +0 -1
  285. package/packages/mailx-imap/providers/gmail-api.ts +0 -8
  286. package/packages/mailx-imap/providers/outlook-api.ts +0 -7
  287. package/packages/mailx-imap/providers/types.d.ts +0 -9
  288. package/packages/mailx-imap/providers/types.d.ts.map +0 -1
  289. package/packages/mailx-imap/providers/types.js +0 -9
  290. package/packages/mailx-imap/providers/types.js.map +0 -1
  291. package/packages/mailx-imap/providers/types.ts +0 -9
  292. package/packages/mailx-imap/tsconfig.json +0 -9
  293. package/packages/mailx-imap/tsconfig.tsbuildinfo +0 -1
  294. package/packages/mailx-send/.gitattributes +0 -10
  295. package/packages/mailx-send/cli-queue.d.ts.map +0 -1
  296. package/packages/mailx-send/cli-queue.js.map +0 -1
  297. package/packages/mailx-send/cli-queue.ts +0 -62
  298. package/packages/mailx-send/cli-send.d.ts.map +0 -1
  299. package/packages/mailx-send/cli-send.js.map +0 -1
  300. package/packages/mailx-send/cli-send.ts +0 -83
  301. package/packages/mailx-send/cli.d.ts.map +0 -1
  302. package/packages/mailx-send/cli.js.map +0 -1
  303. package/packages/mailx-send/cli.ts +0 -126
  304. package/packages/mailx-send/index.d.ts.map +0 -1
  305. package/packages/mailx-send/index.js.map +0 -1
  306. package/packages/mailx-send/index.ts +0 -333
  307. package/packages/mailx-send/mailsend/cli.d.ts.map +0 -1
  308. package/packages/mailx-send/mailsend/cli.js.map +0 -1
  309. package/packages/mailx-send/mailsend/cli.ts +0 -81
  310. package/packages/mailx-send/mailsend/index.d.ts.map +0 -1
  311. package/packages/mailx-send/mailsend/index.js.map +0 -1
  312. package/packages/mailx-send/mailsend/index.ts +0 -333
  313. package/packages/mailx-send/mailsend/tsconfig.json +0 -21
  314. package/packages/mailx-send/package-lock.json +0 -65
  315. package/packages/mailx-send/tsconfig.json +0 -21
  316. package/packages/mailx-server/.gitattributes +0 -10
  317. package/packages/mailx-server/index.d.ts.map +0 -1
  318. package/packages/mailx-server/index.js.map +0 -1
  319. package/packages/mailx-server/index.ts +0 -429
  320. package/packages/mailx-server/tsconfig.json +0 -9
  321. package/packages/mailx-settings/.gitattributes +0 -10
  322. package/packages/mailx-settings/cloud.d.ts.map +0 -1
  323. package/packages/mailx-settings/cloud.js.map +0 -1
  324. package/packages/mailx-settings/cloud.ts +0 -388
  325. package/packages/mailx-settings/index.d.ts.map +0 -1
  326. package/packages/mailx-settings/index.js.map +0 -1
  327. package/packages/mailx-settings/index.ts +0 -892
  328. package/packages/mailx-settings/tsconfig.json +0 -9
  329. package/packages/mailx-store/.gitattributes +0 -10
  330. package/packages/mailx-store/db.d.ts.map +0 -1
  331. package/packages/mailx-store/db.js.map +0 -1
  332. package/packages/mailx-store/db.ts +0 -2007
  333. package/packages/mailx-store/file-store.d.ts.map +0 -1
  334. package/packages/mailx-store/file-store.js.map +0 -1
  335. package/packages/mailx-store/file-store.ts +0 -82
  336. package/packages/mailx-store/index.d.ts.map +0 -1
  337. package/packages/mailx-store/index.js.map +0 -1
  338. package/packages/mailx-store/index.ts +0 -7
  339. package/packages/mailx-store/tsconfig.json +0 -9
  340. package/packages/mailx-types/.gitattributes +0 -10
  341. package/packages/mailx-types/index.d.ts.map +0 -1
  342. package/packages/mailx-types/index.js.map +0 -1
  343. package/packages/mailx-types/index.ts +0 -498
  344. package/packages/mailx-types/tsconfig.json +0 -9
@@ -1,474 +0,0 @@
1
- /**
2
- * Calendar sidebar — Thunderbird Lightning "Events and Tasks" pane.
3
- *
4
- * Right-docked vertical panel showing:
5
- * - Day-grouped upcoming events (Today / Tomorrow / Friday Apr 24 / …)
6
- * - Tasks list (no due date — just a checkable to-do list)
7
- *
8
- * Toggled by the View menu's "Calendar sidebar" checkbox. Reads from the
9
- * primary account's Google Calendar / Tasks via the existing OAuth token.
10
- * Sidebar and the full-screen calendar modal (calendar.ts) read the SAME
11
- * underlying data — two views onto one source.
12
- *
13
- * All storage goes through the service-side two-way cache (calendar_events
14
- * and tasks tables); this file does not use localStorage for data.
15
- */
16
-
17
- import {
18
- getPrimaryAccount,
19
- getCalendarEvents, createCalendarEvent,
20
- getTasks, createTask, updateTask, deleteTask,
21
- reauthGoogleScopes,
22
- } from "../lib/api-client.js";
23
- import { showContextMenu } from "./context-menu.js";
24
-
25
- const SIDEBAR_PREF = "mailx-calendar-sidebar-on";
26
- const SHOW_RECURRING_PREF = "mailx-cal-show-recurring";
27
- const SHOW_DONE_PREF = "mailx-task-show-done";
28
- const HORIZON_DAYS_PREF = "mailx-cal-horizon-days";
29
- const HORIZON_DEFAULT_DAYS = 30;
30
-
31
- interface CalEvent {
32
- id: string;
33
- title: string;
34
- start: number; // ms since epoch
35
- end: number;
36
- allDay?: boolean;
37
- location?: string;
38
- notes?: string;
39
- source?: "local" | "google";
40
- recurringEventId?: string | null;
41
- htmlLink?: string | null;
42
- }
43
-
44
- let viewYear = new Date().getFullYear();
45
- let viewMonth = new Date().getMonth();
46
- let viewDay = new Date().getDate();
47
- let lastEvents: CalEvent[] = [];
48
-
49
- function getHorizonDays(): number {
50
- try {
51
- const v = localStorage.getItem(HORIZON_DAYS_PREF);
52
- const n = v ? parseInt(v, 10) : NaN;
53
- if (Number.isFinite(n) && n > 0 && n <= 365) return n;
54
- } catch { /* */ }
55
- return HORIZON_DEFAULT_DAYS;
56
- }
57
-
58
- function getShowRecurring(): boolean {
59
- try { return localStorage.getItem(SHOW_RECURRING_PREF) !== "false"; } catch { return true; }
60
- }
61
-
62
- /** Fetch events from the local two-way cache; service returns local rows
63
- * immediately and kicks a background refresh from Google. Next render
64
- * (view-nav or user action) picks up the refreshed rows. No localStorage
65
- * — everything lives in the service-side DB so phone / desktop share
66
- * the same events. */
67
- async function fetchUpcoming(from: Date): Promise<CalEvent[]> {
68
- const horizon = from.getTime() + getHorizonDays() * 86400_000;
69
- const rows = await getCalendarEvents(from.getTime(), horizon);
70
- const showRecurring = getShowRecurring();
71
- const filtered = showRecurring ? rows : rows.filter((r: any) => !r.recurringEventId);
72
- return filtered.map((r: any) => ({
73
- id: r.uuid,
74
- title: r.title,
75
- start: r.startMs,
76
- end: r.endMs,
77
- allDay: !!r.allDay,
78
- location: r.location,
79
- notes: r.notes,
80
- source: r.providerId ? "google" : "local",
81
- recurringEventId: r.recurringEventId,
82
- htmlLink: r.htmlLink,
83
- }));
84
- }
85
-
86
- function formatDayHeader(d: Date, today: Date, tomorrow: Date): string {
87
- const sameDay = (a: Date, b: Date) =>
88
- a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
89
- if (sameDay(d, today)) return "Today";
90
- if (sameDay(d, tomorrow)) return "Tomorrow";
91
- return d.toLocaleDateString(undefined, { weekday: "long", month: "long", day: "numeric" });
92
- }
93
-
94
- function formatTime(e: CalEvent): string {
95
- if (e.allDay) return "all day";
96
- return new Date(e.start).toLocaleTimeString(undefined, { hour: "2-digit", minute: "2-digit", hour12: false });
97
- }
98
-
99
- function escapeHtml(s: string): string {
100
- return s.replace(/[&<>"']/g, c => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", "\"": "&quot;", "'": "&#39;" }[c]!));
101
- }
102
-
103
- function renderHead(): void {
104
- const dateEl = document.getElementById("cal-side-date");
105
- if (!dateEl) return;
106
- const d = new Date(viewYear, viewMonth, viewDay);
107
- dateEl.innerHTML = `<strong>${d.getDate()}</strong> ${d.toLocaleDateString(undefined, { weekday: "short" })} <span class="cal-side-date-month">${d.toLocaleDateString(undefined, { month: "short", year: "numeric" })}</span>`;
108
- }
109
-
110
- function renderEvents(events: CalEvent[]): void {
111
- const body = document.getElementById("cal-side-body");
112
- if (!body) return;
113
- if (events.length === 0) {
114
- body.innerHTML = `<div class="cal-side-empty">No upcoming events. Click + New event to add one.</div>`;
115
- return;
116
- }
117
- const today = new Date(); today.setHours(0, 0, 0, 0);
118
- const tomorrow = new Date(today.getTime() + 86400_000);
119
-
120
- // Daily-recurring detection: group expanded instances by recurringEventId,
121
- // pull out series that fire (roughly) every day at the same time of day,
122
- // and render them once at the top instead of cluttering each per-day
123
- // section. "Daily" = same recurringEventId + same H:MM + appears on at
124
- // least 80% of the days in the rendered horizon (allows for the
125
- // occasional skipped day without losing the grouping).
126
- const horizonDays = getHorizonDays();
127
- const dailyThreshold = Math.max(2, Math.floor(horizonDays * 0.8));
128
- const byRecurId = new Map<string, CalEvent[]>();
129
- for (const e of events) {
130
- if (!e.recurringEventId) continue;
131
- let arr = byRecurId.get(e.recurringEventId);
132
- if (!arr) { arr = []; byRecurId.set(e.recurringEventId, arr); }
133
- arr.push(e);
134
- }
135
- const dailyKeys = new Set<string>();
136
- const dailyHeads: CalEvent[] = [];
137
- for (const [recId, instances] of byRecurId) {
138
- if (instances.length < dailyThreshold) continue;
139
- // Same time-of-day across all instances?
140
- const hm = (e: CalEvent) => {
141
- if (e.allDay) return "all";
142
- const d = new Date(e.start);
143
- return `${d.getHours()}:${d.getMinutes()}`;
144
- };
145
- const firstHm = hm(instances[0]);
146
- const allSameTime = instances.every(e => hm(e) === firstHm);
147
- if (!allSameTime) continue;
148
- dailyKeys.add(recId);
149
- // Use the earliest instance as the "head" entry (its htmlLink is
150
- // identical across instances of the same series).
151
- dailyHeads.push(instances.reduce((a, b) => a.start < b.start ? a : b));
152
- }
153
-
154
- let html = "";
155
- if (dailyHeads.length > 0) {
156
- html += `<div class="cal-side-day cal-side-day-daily">Daily</div>`;
157
- for (const e of dailyHeads) {
158
- const link = e.htmlLink || "";
159
- html += `<div class="cal-side-event" data-id="${e.id}" data-link="${escapeHtml(link)}" ${link ? 'title="Click to open in Google Calendar"' : ""}>
160
- <span class="cal-side-event-dot ${e.source === "google" ? "g" : "l"}"></span>
161
- <span class="cal-side-event-time">${escapeHtml(formatTime(e))}</span>
162
- <span class="cal-side-event-title">${escapeHtml(e.title)}<span class="cal-side-event-recur" title="Daily">↻</span></span>
163
- </div>`;
164
- }
165
- }
166
-
167
- let lastDayKey = "";
168
- for (const e of events) {
169
- // Filter out daily-grouped instances — they're shown once at top.
170
- if (e.recurringEventId && dailyKeys.has(e.recurringEventId)) continue;
171
- const d = new Date(e.start);
172
- const dayKey = `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`;
173
- if (dayKey !== lastDayKey) {
174
- html += `<div class="cal-side-day">${escapeHtml(formatDayHeader(d, today, tomorrow))}</div>`;
175
- lastDayKey = dayKey;
176
- }
177
- const recurMark = e.recurringEventId ? `<span class="cal-side-event-recur" title="Recurring event">↻</span>` : "";
178
- const link = e.htmlLink || "";
179
- html += `<div class="cal-side-event" data-id="${e.id}" data-link="${escapeHtml(link)}" ${link ? 'title="Click to open in Google Calendar"' : ""}>
180
- <span class="cal-side-event-dot ${e.source === "google" ? "g" : "l"}"></span>
181
- <span class="cal-side-event-time">${escapeHtml(formatTime(e))}</span>
182
- <span class="cal-side-event-title">${escapeHtml(e.title)}${recurMark}</span>
183
- </div>`;
184
- }
185
- body.innerHTML = html;
186
-
187
- // Click-to-open — interim per user 2026-04-23: route to Google Calendar's
188
- // web UI via openExternal until we build an in-app event editor.
189
- // Right-click gives a context menu with "View in browser" explicit.
190
- // Item 17: on Android, openCalendarEvent redirects to the native Calendar
191
- // app via ACTION_VIEW; desktop still falls through to the browser.
192
- const openInCalendar = (url: string): void => {
193
- const api = (window as any).mailxapi;
194
- if (api?.openCalendarEvent) { api.openCalendarEvent(url); return; }
195
- if (api?.openExternal) api.openExternal(url);
196
- else window.open(url, "_blank");
197
- };
198
- const openInBrowser = (url: string): void => {
199
- const api = (window as any).mailxapi;
200
- if (api?.openExternal) api.openExternal(url);
201
- else window.open(url, "_blank");
202
- };
203
- body.querySelectorAll<HTMLElement>(".cal-side-event").forEach(el => {
204
- el.addEventListener("click", () => {
205
- const link = el.dataset.link;
206
- if (link) openInCalendar(link);
207
- });
208
- el.addEventListener("contextmenu", (e) => {
209
- e.preventDefault();
210
- const link = el.dataset.link;
211
- const items = [];
212
- if (link) items.push({
213
- label: "View in browser",
214
- action: () => openInBrowser(link),
215
- });
216
- items.push({
217
- label: "Open Google Calendar",
218
- action: () => openInBrowser("https://calendar.google.com/"),
219
- });
220
- if (items.length > 0) showContextMenu(e.clientX, e.clientY, items);
221
- });
222
- });
223
- }
224
-
225
- async function renderTasks(): Promise<void> {
226
- const cb = document.getElementById("cal-side-show-done") as HTMLInputElement | null;
227
- const showDone = cb?.checked ?? false;
228
- const tasks = await getTasks(showDone);
229
- const host = document.getElementById("cal-side-tasks");
230
- if (!host) return;
231
- if (tasks.length === 0) {
232
- host.innerHTML = `<div class="cal-side-empty">No tasks.</div>`;
233
- return;
234
- }
235
- let html = "<div class='cal-side-task-head'>Title</div>";
236
- for (const t of tasks) {
237
- const done = !!t.completedMs;
238
- html += `<div class="cal-side-task" data-uuid="${t.uuid}">
239
- <input type="checkbox" ${done ? "checked" : ""} class="cal-side-task-check">
240
- <span class="cal-side-task-title${done ? " done" : ""}">${escapeHtml(t.title)}</span>
241
- <button class="cal-side-task-delete" title="Delete task" aria-label="Delete task">×</button>
242
- </div>`;
243
- }
244
- host.innerHTML = html;
245
- const openInBrowser = (url: string): void => {
246
- const api = (window as any).mailxapi;
247
- if (api?.openExternal) api.openExternal(url);
248
- else window.open(url, "_blank");
249
- };
250
- host.querySelectorAll<HTMLElement>(".cal-side-task").forEach(row => {
251
- const uuid = row.dataset.uuid!;
252
- row.querySelector<HTMLInputElement>(".cal-side-task-check")?.addEventListener("change", async (e) => {
253
- const checked = (e.target as HTMLInputElement).checked;
254
- await updateTask(uuid, { completedMs: checked ? Date.now() : null });
255
- renderTasks();
256
- });
257
- row.querySelector<HTMLButtonElement>(".cal-side-task-delete")?.addEventListener("click", async () => {
258
- await deleteTask(uuid);
259
- renderTasks();
260
- });
261
- row.addEventListener("contextmenu", (e) => {
262
- e.preventDefault();
263
- // Google Tasks doesn't have a per-task web URL; open the list view.
264
- showContextMenu(e.clientX, e.clientY, [
265
- { label: "View in Google Tasks", action: () => openInBrowser("https://tasks.google.com/") },
266
- { label: "", action: () => {}, separator: true },
267
- { label: "Delete task", action: async () => { await deleteTask(uuid); renderTasks(); } },
268
- ]);
269
- });
270
- });
271
- }
272
-
273
- async function refresh(): Promise<void> {
274
- renderHead();
275
- const from = new Date(viewYear, viewMonth, viewDay);
276
- lastEvents = await fetchUpcoming(from);
277
- renderEvents(lastEvents);
278
- renderTasks();
279
- }
280
-
281
- /** Show the sidebar (called from the View menu toggle). Idempotent. */
282
- export async function showCalendarSidebar(): Promise<void> {
283
- const el = document.getElementById("calendar-sidebar");
284
- if (!el) return;
285
- el.hidden = false;
286
- document.body.classList.add("calendar-sidebar-on");
287
- try { localStorage.setItem(SIDEBAR_PREF, "true"); } catch { /* */ }
288
- await refresh();
289
- }
290
-
291
- export function hideCalendarSidebar(): void {
292
- const el = document.getElementById("calendar-sidebar");
293
- if (!el) return;
294
- el.hidden = true;
295
- document.body.classList.remove("calendar-sidebar-on");
296
- try { localStorage.setItem(SIDEBAR_PREF, "false"); } catch { /* */ }
297
- }
298
-
299
- export function isCalendarSidebarOn(): boolean {
300
- // Default is ON — user-reported 2026-04-23 that the sidebar should be
301
- // visible by default, not hidden. An explicit "false" in localStorage
302
- // still hides it (the user's stored preference wins).
303
- try {
304
- const v = localStorage.getItem(SIDEBAR_PREF);
305
- return v === null ? true : v !== "false";
306
- } catch { return true; }
307
- }
308
-
309
- /** Wire one-time event handlers + restore from localStorage. Safe to call
310
- * multiple times — handlers are idempotent because the elements are stable. */
311
- export function initCalendarSidebar(): void {
312
- const wireOnce = (id: string, fn: () => void) => {
313
- const el = document.getElementById(id);
314
- if (!el || (el as any).__wired) return;
315
- (el as any).__wired = true;
316
- el.addEventListener("click", fn);
317
- };
318
- wireOnce("cal-side-prev", () => { const d = new Date(viewYear, viewMonth, viewDay - 1); viewYear = d.getFullYear(); viewMonth = d.getMonth(); viewDay = d.getDate(); refresh(); });
319
- wireOnce("cal-side-next", () => { const d = new Date(viewYear, viewMonth, viewDay + 1); viewYear = d.getFullYear(); viewMonth = d.getMonth(); viewDay = d.getDate(); refresh(); });
320
- wireOnce("cal-side-today", () => { const t = new Date(); viewYear = t.getFullYear(); viewMonth = t.getMonth(); viewDay = t.getDate(); refresh(); });
321
- wireOnce("cal-side-new", async () => {
322
- const title = prompt("Event title:");
323
- if (!title) return;
324
- const dateStr = prompt("Date and time (YYYY-MM-DD HH:MM, or YYYY-MM-DD for all-day):",
325
- new Date(viewYear, viewMonth, viewDay).toISOString().slice(0, 10) + " 09:00");
326
- if (!dateStr) return;
327
- const allDay = !/\d{1,2}:\d{2}/.test(dateStr);
328
- const start = Date.parse(dateStr.replace(" ", "T"));
329
- if (isNaN(start)) { alert("Couldn't parse that date."); return; }
330
- // Two-way cache: commit locally, service queues the push to Google.
331
- await createCalendarEvent({
332
- title, startMs: start, endMs: start + (allDay ? 86400_000 : 3600_000), allDay,
333
- });
334
- await refresh();
335
- });
336
- wireOnce("cal-side-new-task", async () => {
337
- const title = prompt("Task title:");
338
- if (!title) return;
339
- await createTask({ title });
340
- renderTasks();
341
- });
342
- // Manual refresh — getTasks on the service side already fires a Google
343
- // pull under the hood on every call, but the visible feedback (spinning
344
- // glyph for ~600 ms, disabled while in flight) makes it explicit that
345
- // the user asked for a fresh pull, not a cached redraw.
346
- wireOnce("cal-side-refresh-tasks", async () => {
347
- const btn = document.getElementById("cal-side-refresh-tasks") as HTMLButtonElement | null;
348
- if (btn?.classList.contains("cal-side-refreshing")) return;
349
- btn?.classList.add("cal-side-refreshing");
350
- (btn as HTMLButtonElement).disabled = true;
351
- try {
352
- // renderTasks() calls getTasks() on the service which triggers
353
- // the async Google pull; the subsequent tasksUpdated event
354
- // re-renders with the merged result.
355
- await renderTasks();
356
- } finally {
357
- setTimeout(() => {
358
- btn?.classList.remove("cal-side-refreshing");
359
- if (btn) btn.disabled = false;
360
- }, 600);
361
- }
362
- });
363
- // Manual events refresh — same pattern as tasks. fetchUpcoming hits the
364
- // service which kicks a Google pull under the hood.
365
- wireOnce("cal-side-refresh-events", async () => {
366
- const btn = document.getElementById("cal-side-refresh-events") as HTMLButtonElement | null;
367
- if (btn?.classList.contains("cal-side-refreshing")) return;
368
- btn?.classList.add("cal-side-refreshing");
369
- if (btn) btn.disabled = true;
370
- try {
371
- await refresh();
372
- } finally {
373
- setTimeout(() => {
374
- btn?.classList.remove("cal-side-refreshing");
375
- if (btn) btn.disabled = false;
376
- }, 600);
377
- }
378
- });
379
- const showDoneCb = document.getElementById("cal-side-show-done") as HTMLInputElement | null;
380
- if (showDoneCb && !(showDoneCb as any).__wired) {
381
- (showDoneCb as any).__wired = true;
382
- // Sticky: restore prior state and persist on change. Default off.
383
- try { showDoneCb.checked = localStorage.getItem(SHOW_DONE_PREF) === "true"; } catch { /* */ }
384
- showDoneCb.addEventListener("change", () => {
385
- try { localStorage.setItem(SHOW_DONE_PREF, String(showDoneCb.checked)); } catch { /* */ }
386
- renderTasks();
387
- });
388
- }
389
- // Recurring-events filter toggle — hides expanded recurring-series
390
- // instances when unchecked. Default on so new users see everything.
391
- const recurCb = document.getElementById("cal-side-show-recurring") as HTMLInputElement | null;
392
- if (recurCb && !(recurCb as any).__wired) {
393
- (recurCb as any).__wired = true;
394
- recurCb.checked = getShowRecurring();
395
- recurCb.addEventListener("change", () => {
396
- try { localStorage.setItem(SHOW_RECURRING_PREF, String(recurCb.checked)); } catch { /* */ }
397
- refresh();
398
- });
399
- }
400
- // Horizon input — how many days ahead to list events. Bounded 1..365.
401
- const horizonInput = document.getElementById("cal-side-horizon") as HTMLInputElement | null;
402
- if (horizonInput && !(horizonInput as any).__wired) {
403
- (horizonInput as any).__wired = true;
404
- horizonInput.value = String(getHorizonDays());
405
- const commit = () => {
406
- const n = parseInt(horizonInput.value, 10);
407
- const clamped = Number.isFinite(n) && n > 0 ? Math.min(365, Math.max(1, n)) : HORIZON_DEFAULT_DAYS;
408
- horizonInput.value = String(clamped);
409
- try { localStorage.setItem(HORIZON_DAYS_PREF, String(clamped)); } catch { /* */ }
410
- refresh();
411
- };
412
- horizonInput.addEventListener("change", commit);
413
- horizonInput.addEventListener("blur", commit);
414
- }
415
- // Subscribe to service events — when a background Google pull finishes
416
- // and upserted/reconciled rows, re-render without waiting for a nav
417
- // click. Uses the mailxapi.onEvent bus. Idempotent flag keeps multiple
418
- // initCalendarSidebar calls from dup-subscribing.
419
- if (!(window as any).__mailxCalEventsWired) {
420
- const api = (window as any).mailxapi;
421
- if (api?.onEvent) {
422
- (window as any).__mailxCalEventsWired = true;
423
- api.onEvent((event: any) => {
424
- if (event?.type === "calendarUpdated") refresh();
425
- else if (event?.type === "tasksUpdated") renderTasks();
426
- else if (event?.type === "quotaError") {
427
- // Surface a non-clickable banner — daily quota will reset
428
- // on its own, no user action helps. Idempotent so the
429
- // banner doesn't flash on repeat poll attempts.
430
- const host = event.feature === "tasks"
431
- ? document.getElementById("cal-side-tasks")
432
- : document.getElementById("cal-side-body");
433
- if (host && !host.querySelector(".cal-side-quota-error")) {
434
- const msg = event.message || `Google ${event.feature} quota exceeded — try again later.`;
435
- host.innerHTML = `<div class="cal-side-empty cal-side-quota-error">${escapeHtml(msg)}</div>`;
436
- }
437
- }
438
- else if (event?.type === "authScopeError") {
439
- // Surface a visible hint right in the affected pane so the
440
- // user doesn't stare at an empty list wondering why. Only
441
- // writes to the matching pane; other panes keep rendering.
442
- //
443
- // Idempotent: if the banner is already shown for this
444
- // feature (class `.cal-side-auth-error` present), don't
445
- // re-write the DOM — stops the "flashing on and off
446
- // continually" effect when the service re-emits on every
447
- // 5-min poll or sidebar-nav click.
448
- const host = event.feature === "tasks"
449
- ? document.getElementById("cal-side-tasks")
450
- : document.getElementById("cal-side-body");
451
- if (host && !host.querySelector(".cal-side-auth-error")) {
452
- const msg = event.message || "Google access needs re-consent.";
453
- host.innerHTML = `<div class="cal-side-empty cal-side-auth-error">
454
- <div style="margin-bottom:0.6em">${escapeHtml(msg)}</div>
455
- <button type="button" class="cal-side-reauth-btn" style="padding:0.3em 0.8em;border-radius:4px;border:1px solid currentColor;background:transparent;color:inherit;cursor:pointer;font-size:0.9em">Re-authenticate Now</button>
456
- </div>`;
457
- const btn = host.querySelector<HTMLButtonElement>(".cal-side-reauth-btn");
458
- btn?.addEventListener("click", async () => {
459
- btn.disabled = true;
460
- btn.textContent = "Opening browser…";
461
- try {
462
- await reauthGoogleScopes();
463
- btn.textContent = "Consent opened — complete it in the browser";
464
- } catch (err: any) {
465
- btn.disabled = false;
466
- btn.textContent = `Failed: ${err?.message || err}. Click to retry.`;
467
- }
468
- });
469
- }
470
- }
471
- });
472
- }
473
- }
474
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"calendar.js","sourceRoot":"","sources":["calendar.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAaH,MAAM,eAAe,GAAG,qBAAqB,CAAC;AAC9C,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,SAAS,UAAU;IACf,IAAI,CAAC;QACD,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;QAClD,IAAI,CAAC,GAAG;YAAE,OAAO,EAAE,CAAC;QACpB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC5B,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IACzC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,EAAE,CAAC;IAAC,CAAC;AAC1B,CAAC;AACD,SAAS,UAAU,CAAC,MAAkB;IAClC,IAAI,CAAC;QAAC,YAAY,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC;AAC1F,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY;IAC9B,IAAI,MAAM;QAAE,OAAO;IACnB,MAAM,GAAG,IAAI,CAAC;IAEd,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC/C,QAAQ,CAAC,SAAS,GAAG,sBAAsB,CAAC;IAC5C,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC5C,KAAK,CAAC,SAAS,GAAG,8BAA8B,CAAC;IACj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