@jant/core 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/bin/commands/site/import.js +2 -1
  2. package/dist/{app-CbOZ2Irh.js → app-C8dETvgL.js} +1429 -681
  3. package/dist/client/.vite/manifest.json +72 -83
  4. package/dist/client/_assets/chunks/{confirm-CMe01lne.js → confirm-BQebcuNB.js} +1 -1
  5. package/dist/client/_assets/chunks/{create-editor-hWapNE40.js → create-editor-B8KuszlS.js} +38 -38
  6. package/dist/client/_assets/chunks/footnote-rail-DUrqz0Py.js +2 -0
  7. package/dist/client/_assets/chunks/{jant-locale-picker-2L4rkDaz.js → jant-locale-picker-CLq0iKDH.js} +1 -1
  8. package/dist/client/_assets/chunks/lit-BN4mrI3j.js +2 -0
  9. package/dist/client/_assets/chunks/{settings-paths-BBVT8zKj.js → settings-paths-_fry4yWW.js} +1 -1
  10. package/dist/client/_assets/chunks/{slug-format-BuCPjSrB.js → slug-format-bcJ2ozr4.js} +1 -1
  11. package/dist/client/_assets/chunks/{sortable-list-DJXwkaOv.js → sortable-list-Bz2Na2E9.js} +2 -2
  12. package/dist/client/_assets/chunks/{unsafe-html-CWos3v6N.js → unsafe-html-OJ9m154w.js} +1 -1
  13. package/dist/client/_assets/chunks/unsafe-svg-DVJ4NPcb.js +1 -0
  14. package/dist/client/_assets/{client-D8Rrsd73.css → client-CoNHvipV.css} +1 -1
  15. package/dist/client/_assets/{client-auth-CsUGM718.js → client-auth-CbnZkLJ6.js} +99 -129
  16. package/dist/client/_assets/client-author-2WYBkgni.css +2 -0
  17. package/dist/client/_assets/{client-compose-BB4U7Wz0.js → client-compose-DYtDlYm-.js} +248 -244
  18. package/dist/client/_assets/{client-manage-CI9-eh-8.js → client-manage-BODyYP5Z.js} +157 -157
  19. package/dist/client/_assets/client-pq6sVS7y.js +354 -0
  20. package/dist/client/_assets/{client-settings-BnGPuqwc.js → client-settings-DDpe_tXJ.js} +166 -166
  21. package/dist/client/_assets/client-share-B9OsXx9p.js +149 -0
  22. package/dist/{constants-DEgyqWDl.js → constants-C2CdWAqt.js} +55 -5
  23. package/dist/index.js +1 -1
  24. package/dist/node.js +2 -2
  25. package/package.json +2 -1
  26. package/src/client/components/compose-types.ts +5 -1
  27. package/src/client/components/jant-compose-dialog.ts +25 -4
  28. package/src/client/components/jant-media-lightbox.ts +18 -3
  29. package/src/client/components/jant-nav-manager.ts +2 -0
  30. package/src/client/components/jant-post-menu.ts +42 -89
  31. package/src/client/components/nav-manager-types.ts +2 -0
  32. package/src/client/components/settings-types.ts +1 -1
  33. package/src/client/list-views.ts +382 -0
  34. package/src/client/media-lightbox-events.ts +12 -0
  35. package/src/client/runtime-paths.ts +12 -0
  36. package/src/client/share-capture.ts +63 -0
  37. package/src/client/share-launch.ts +36 -9
  38. package/src/client/tiptap/create-editor.ts +4 -0
  39. package/src/client/tiptap/embed-node.ts +3 -1
  40. package/src/client/tiptap/html-block-node.ts +3 -1
  41. package/src/client/tiptap/image-node.ts +3 -1
  42. package/src/client/view-confirm.ts +32 -4
  43. package/src/client.ts +1 -0
  44. package/src/db/migrations/0037_round_post.sql +16 -0
  45. package/src/db/migrations/0038_flashy_changeling.sql +15 -0
  46. package/src/db/migrations/0039_mixed_sister_grimm.sql +1 -0
  47. package/src/db/migrations/meta/0037_snapshot.json +2932 -0
  48. package/src/db/migrations/meta/0038_snapshot.json +2924 -0
  49. package/src/db/migrations/meta/0039_snapshot.json +2931 -0
  50. package/src/db/migrations/meta/_journal.json +21 -0
  51. package/src/db/migrations/pg/0035_flimsy_outlaw_kid.sql +3 -0
  52. package/src/db/migrations/pg/0036_milky_wolverine.sql +5 -0
  53. package/src/db/migrations/pg/0037_fuzzy_hammerhead.sql +1 -0
  54. package/src/db/migrations/pg/meta/0035_snapshot.json +3773 -0
  55. package/src/db/migrations/pg/meta/0036_snapshot.json +3766 -0
  56. package/src/db/migrations/pg/meta/0037_snapshot.json +3772 -0
  57. package/src/db/migrations/pg/meta/_journal.json +21 -0
  58. package/src/db/pg/schema.ts +1 -0
  59. package/src/db/post-visibility.ts +37 -6
  60. package/src/db/schema.ts +5 -2
  61. package/src/i18n/locales/glossary.zh-Hans.yml +4 -0
  62. package/src/i18n/locales/glossary.zh-Hant.yml +4 -0
  63. package/src/i18n/locales/public/en.po +21 -7
  64. package/src/i18n/locales/public/en.ts +1 -1
  65. package/src/i18n/locales/public/zh-Hans.po +20 -6
  66. package/src/i18n/locales/public/zh-Hans.ts +1 -1
  67. package/src/i18n/locales/public/zh-Hant.po +20 -6
  68. package/src/i18n/locales/public/zh-Hant.ts +1 -1
  69. package/src/i18n/locales/settings/en.po +10 -0
  70. package/src/i18n/locales/settings/en.ts +1 -1
  71. package/src/i18n/locales/settings/zh-Hans.po +10 -0
  72. package/src/i18n/locales/settings/zh-Hans.ts +1 -1
  73. package/src/i18n/locales/settings/zh-Hant.po +10 -0
  74. package/src/i18n/locales/settings/zh-Hant.ts +1 -1
  75. package/src/lib/api-public-posts.ts +10 -0
  76. package/src/lib/feed-policy.ts +2 -2
  77. package/src/lib/filter-dimensions.ts +11 -4
  78. package/src/lib/hugo-markdown.ts +7 -0
  79. package/src/lib/icons.ts +2 -0
  80. package/src/lib/link-preview.ts +499 -0
  81. package/src/lib/list-views.ts +117 -0
  82. package/src/lib/markdown-manager.ts +40 -1
  83. package/src/lib/navigation.ts +1 -1
  84. package/src/lib/share-card.ts +4 -3
  85. package/src/lib/thread-query.ts +6 -2
  86. package/src/lib/timeline.ts +12 -11
  87. package/src/lib/url-fetch.ts +291 -74
  88. package/src/lib/view-buffer.ts +2 -2
  89. package/src/lib/view-counting.ts +7 -6
  90. package/src/lib/view-token.ts +29 -7
  91. package/src/lib/view.ts +17 -0
  92. package/src/middleware/view-counter.ts +10 -5
  93. package/src/preset.css +5 -3
  94. package/src/routes/api/search.ts +1 -1
  95. package/src/routes/dash/settings.tsx +1 -1
  96. package/src/routes/feed/sitemap.ts +1 -1
  97. package/src/routes/pages/archive.tsx +25 -19
  98. package/src/routes/pages/collection.tsx +3 -3
  99. package/src/routes/pages/page.tsx +16 -4
  100. package/src/routes/pages/search.tsx +3 -3
  101. package/src/routes/view-confirm.ts +23 -15
  102. package/src/services/collection.ts +1 -1
  103. package/src/services/export-theme/assets/client-site.js +19 -19
  104. package/src/services/export-theme/layouts/archive/list.html +4 -2
  105. package/src/services/export-theme/layouts/partials/collection-members.html +4 -3
  106. package/src/services/export-theme/layouts/partials/featured-members.html +3 -3
  107. package/src/services/export-theme/layouts/partials/head.html +2 -0
  108. package/src/services/export-theme/layouts/partials/latest-members.html +4 -4
  109. package/src/services/export-theme/layouts/partials/post-card.html +1 -9
  110. package/src/services/export-theme/layouts/partials/reply.html +1 -9
  111. package/src/services/export-theme/layouts/partials/smart-collection-members.html +4 -3
  112. package/src/services/export-theme/layouts/post/list.html +1 -9
  113. package/src/services/export-theme/styles/main.css +2 -26
  114. package/src/services/export.ts +10 -3
  115. package/src/services/mcp.ts +5 -5
  116. package/src/services/navigation.ts +9 -4
  117. package/src/services/post.ts +102 -112
  118. package/src/services/search.ts +22 -7
  119. package/src/services/smart-collection.ts +3 -3
  120. package/src/services/stats.ts +12 -5
  121. package/src/services/thread.ts +6 -2
  122. package/src/styles/components-author.css +69 -7
  123. package/src/styles/tokens.css +28 -29
  124. package/src/styles/ui-author.css +140 -353
  125. package/src/styles/ui.css +34 -32
  126. package/src/types/constants.ts +68 -4
  127. package/src/types/entities.ts +1 -0
  128. package/src/types/views.ts +2 -0
  129. package/src/ui/compose/ComposeDialog.tsx +20 -1
  130. package/src/ui/dash/StatusBadge.tsx +11 -0
  131. package/src/ui/dash/appearance/FontThemeContent.tsx +1 -1
  132. package/src/ui/dash/appearance/NavigationContent.tsx +8 -0
  133. package/src/ui/dash/settings/StatsContent.tsx +29 -29
  134. package/src/ui/feed/LinkCard.tsx +19 -2
  135. package/src/ui/feed/PostStatusBadges.tsx +19 -3
  136. package/src/ui/feed/TimelineFeed.tsx +3 -0
  137. package/src/ui/font-themes.ts +32 -15
  138. package/src/ui/pages/ArchivePage.tsx +1 -0
  139. package/src/ui/shared/PostFooter.tsx +1 -22
  140. package/src/ui/shared/custom-icons.ts +5 -5
  141. package/dist/client/_assets/chunks/footnote-rail-9zwl6jtV.js +0 -2
  142. package/dist/client/_assets/chunks/lit-Bw_voPoW.js +0 -2
  143. package/dist/client/_assets/chunks/runtime-paths-y0_gHowM.js +0 -1
  144. package/dist/client/_assets/chunks/unsafe-svg-CUrgo4Xg.js +0 -1
  145. package/dist/client/_assets/client-BO8GOFfT.js +0 -354
  146. package/dist/client/_assets/client-author-QPm1whbO.css +0 -2
  147. package/dist/client/_assets/client-share-C59mOLJ1.js +0 -149
@@ -129,18 +129,18 @@
129
129
  "src": "../../node_modules/.pnpm/heic-to@1.5.2/node_modules/heic-to/dist/heic-to.js",
130
130
  "isDynamicEntry": true
131
131
  },
132
- "_confirm-CMe01lne.js": {
133
- "file": "_assets/chunks/confirm-CMe01lne.js",
132
+ "_confirm-BQebcuNB.js": {
133
+ "file": "_assets/chunks/confirm-BQebcuNB.js",
134
134
  "name": "confirm",
135
135
  "imports": [
136
- "_lit-Bw_voPoW.js"
136
+ "_lit-BN4mrI3j.js"
137
137
  ]
138
138
  },
139
- "_create-editor-hWapNE40.js": {
140
- "file": "_assets/chunks/create-editor-hWapNE40.js",
139
+ "_create-editor-B8KuszlS.js": {
140
+ "file": "_assets/chunks/create-editor-B8KuszlS.js",
141
141
  "name": "create-editor",
142
142
  "imports": [
143
- "_runtime-paths-y0_gHowM.js",
143
+ "_lit-BN4mrI3j.js",
144
144
  "_types-DrYFqJH2.js"
145
145
  ]
146
146
  },
@@ -151,8 +151,8 @@
151
151
  "_rolldown-runtime-hePW80VL.js"
152
152
  ]
153
153
  },
154
- "_footnote-rail-9zwl6jtV.js": {
155
- "file": "_assets/chunks/footnote-rail-9zwl6jtV.js",
154
+ "_footnote-rail-DUrqz0Py.js": {
155
+ "file": "_assets/chunks/footnote-rail-DUrqz0Py.js",
156
156
  "name": "footnote-rail",
157
157
  "imports": [
158
158
  "_preload-helper-Czpn1I53.js"
@@ -164,15 +164,15 @@
164
164
  "src/client-share.ts"
165
165
  ]
166
166
  },
167
- "_jant-locale-picker-2L4rkDaz.js": {
168
- "file": "_assets/chunks/jant-locale-picker-2L4rkDaz.js",
167
+ "_jant-locale-picker-CLq0iKDH.js": {
168
+ "file": "_assets/chunks/jant-locale-picker-CLq0iKDH.js",
169
169
  "name": "jant-locale-picker",
170
170
  "imports": [
171
- "_lit-Bw_voPoW.js"
171
+ "_lit-BN4mrI3j.js"
172
172
  ]
173
173
  },
174
- "_lit-Bw_voPoW.js": {
175
- "file": "_assets/chunks/lit-Bw_voPoW.js",
174
+ "_lit-BN4mrI3j.js": {
175
+ "file": "_assets/chunks/lit-BN4mrI3j.js",
176
176
  "name": "lit"
177
177
  },
178
178
  "_mediabunny-DRaCQ1r-.js": {
@@ -190,19 +190,14 @@
190
190
  "file": "_assets/chunks/rolldown-runtime-hePW80VL.js",
191
191
  "name": "rolldown-runtime"
192
192
  },
193
- "_runtime-paths-y0_gHowM.js": {
194
- "file": "_assets/chunks/runtime-paths-y0_gHowM.js",
195
- "name": "runtime-paths"
196
- },
197
- "_settings-paths-BBVT8zKj.js": {
198
- "file": "_assets/chunks/settings-paths-BBVT8zKj.js",
193
+ "_settings-paths-_fry4yWW.js": {
194
+ "file": "_assets/chunks/settings-paths-_fry4yWW.js",
199
195
  "name": "settings-paths",
200
196
  "imports": [
201
- "_runtime-paths-y0_gHowM.js",
202
- "_lit-Bw_voPoW.js",
197
+ "_lit-BN4mrI3j.js",
203
198
  "_preload-helper-Czpn1I53.js",
204
199
  "_types-DrYFqJH2.js",
205
- "_slug-format-BuCPjSrB.js"
200
+ "_slug-format-bcJ2ozr4.js"
206
201
  ],
207
202
  "dynamicImports": [
208
203
  "src/lib/slugify.ts"
@@ -212,80 +207,77 @@
212
207
  "file": "_assets/chunks/site-header-nav-DzXsFk05.js",
213
208
  "name": "site-header-nav"
214
209
  },
215
- "_slug-format-BuCPjSrB.js": {
216
- "file": "_assets/chunks/slug-format-BuCPjSrB.js",
210
+ "_slug-format-bcJ2ozr4.js": {
211
+ "file": "_assets/chunks/slug-format-bcJ2ozr4.js",
217
212
  "name": "slug-format",
218
213
  "imports": [
219
- "_lit-Bw_voPoW.js",
220
- "_unsafe-html-CWos3v6N.js",
214
+ "_lit-BN4mrI3j.js",
215
+ "_unsafe-html-OJ9m154w.js",
221
216
  "_types-DrYFqJH2.js"
222
217
  ]
223
218
  },
224
- "_sortable-list-DJXwkaOv.js": {
225
- "file": "_assets/chunks/sortable-list-DJXwkaOv.js",
219
+ "_sortable-list-Bz2Na2E9.js": {
220
+ "file": "_assets/chunks/sortable-list-Bz2Na2E9.js",
226
221
  "name": "sortable-list",
227
222
  "imports": [
228
- "_runtime-paths-y0_gHowM.js",
229
- "_lit-Bw_voPoW.js",
230
- "_unsafe-html-CWos3v6N.js",
231
- "_create-editor-hWapNE40.js"
223
+ "_lit-BN4mrI3j.js",
224
+ "_unsafe-html-OJ9m154w.js",
225
+ "_create-editor-B8KuszlS.js"
232
226
  ]
233
227
  },
234
228
  "_types-DrYFqJH2.js": {
235
229
  "file": "_assets/chunks/types-DrYFqJH2.js",
236
230
  "name": "types"
237
231
  },
238
- "_unsafe-html-CWos3v6N.js": {
239
- "file": "_assets/chunks/unsafe-html-CWos3v6N.js",
232
+ "_unsafe-html-OJ9m154w.js": {
233
+ "file": "_assets/chunks/unsafe-html-OJ9m154w.js",
240
234
  "name": "unsafe-html",
241
235
  "imports": [
242
- "_lit-Bw_voPoW.js"
236
+ "_lit-BN4mrI3j.js"
243
237
  ]
244
238
  },
245
- "_unsafe-svg-CUrgo4Xg.js": {
246
- "file": "_assets/chunks/unsafe-svg-CUrgo4Xg.js",
239
+ "_unsafe-svg-DVJ4NPcb.js": {
240
+ "file": "_assets/chunks/unsafe-svg-DVJ4NPcb.js",
247
241
  "name": "unsafe-svg",
248
242
  "imports": [
249
- "_footnote-rail-9zwl6jtV.js",
250
- "_lit-Bw_voPoW.js",
251
- "_unsafe-html-CWos3v6N.js",
243
+ "_lit-BN4mrI3j.js",
244
+ "_footnote-rail-DUrqz0Py.js",
245
+ "_unsafe-html-OJ9m154w.js",
252
246
  "_types-DrYFqJH2.js"
253
247
  ]
254
248
  },
255
249
  "src/client-auth.ts": {
256
- "file": "_assets/client-auth-CsUGM718.js",
250
+ "file": "_assets/client-auth-CbnZkLJ6.js",
257
251
  "name": "client-auth",
258
252
  "src": "src/client-auth.ts",
259
253
  "isEntry": true,
260
254
  "imports": [
261
- "_runtime-paths-y0_gHowM.js",
262
- "_footnote-rail-9zwl6jtV.js",
263
- "_lit-Bw_voPoW.js",
255
+ "_lit-BN4mrI3j.js",
256
+ "_footnote-rail-DUrqz0Py.js",
264
257
  "src/client.ts",
265
258
  "src/client.ts",
266
- "_confirm-CMe01lne.js",
267
- "_unsafe-svg-CUrgo4Xg.js",
259
+ "_confirm-BQebcuNB.js",
260
+ "_unsafe-svg-DVJ4NPcb.js",
268
261
  "_types-DrYFqJH2.js",
269
- "_slug-format-BuCPjSrB.js",
270
- "_settings-paths-BBVT8zKj.js"
262
+ "_slug-format-bcJ2ozr4.js",
263
+ "_settings-paths-_fry4yWW.js"
271
264
  ]
272
265
  },
273
266
  "src/client-compose.ts": {
274
- "file": "_assets/client-compose-BB4U7Wz0.js",
267
+ "file": "_assets/client-compose-DYtDlYm-.js",
275
268
  "name": "client-compose",
276
269
  "src": "src/client-compose.ts",
277
270
  "isEntry": true,
278
271
  "imports": [
279
- "_runtime-paths-y0_gHowM.js",
280
- "_footnote-rail-9zwl6jtV.js",
281
- "_lit-Bw_voPoW.js",
282
- "_unsafe-html-CWos3v6N.js",
272
+ "_lit-BN4mrI3j.js",
273
+ "_footnote-rail-DUrqz0Py.js",
274
+ "_unsafe-html-OJ9m154w.js",
283
275
  "_preload-helper-Czpn1I53.js",
284
- "_unsafe-svg-CUrgo4Xg.js",
276
+ "_unsafe-svg-DVJ4NPcb.js",
285
277
  "_types-DrYFqJH2.js",
286
- "_slug-format-BuCPjSrB.js",
287
- "_sortable-list-DJXwkaOv.js",
288
- "_create-editor-hWapNE40.js"
278
+ "_slug-format-bcJ2ozr4.js",
279
+ "_sortable-list-Bz2Na2E9.js",
280
+ "_create-editor-B8KuszlS.js"
289
281
  ],
290
282
  "dynamicImports": [
291
283
  "_emoji-mart-C4RpRKcU.js",
@@ -294,58 +286,55 @@
294
286
  ]
295
287
  },
296
288
  "src/client-manage.ts": {
297
- "file": "_assets/client-manage-CI9-eh-8.js",
289
+ "file": "_assets/client-manage-BODyYP5Z.js",
298
290
  "name": "client-manage",
299
291
  "src": "src/client-manage.ts",
300
292
  "isEntry": true,
301
293
  "imports": [
302
- "_runtime-paths-y0_gHowM.js",
303
- "_lit-Bw_voPoW.js",
304
- "_unsafe-html-CWos3v6N.js",
294
+ "_lit-BN4mrI3j.js",
295
+ "_unsafe-html-OJ9m154w.js",
305
296
  "_site-header-nav-DzXsFk05.js",
306
- "_confirm-CMe01lne.js",
297
+ "_confirm-BQebcuNB.js",
307
298
  "_types-DrYFqJH2.js",
308
- "_slug-format-BuCPjSrB.js",
309
- "_settings-paths-BBVT8zKj.js",
310
- "_sortable-list-DJXwkaOv.js",
311
- "_create-editor-hWapNE40.js"
299
+ "_slug-format-bcJ2ozr4.js",
300
+ "_settings-paths-_fry4yWW.js",
301
+ "_sortable-list-Bz2Na2E9.js",
302
+ "_create-editor-B8KuszlS.js"
312
303
  ]
313
304
  },
314
305
  "src/client-settings.ts": {
315
- "file": "_assets/client-settings-BnGPuqwc.js",
306
+ "file": "_assets/client-settings-DDpe_tXJ.js",
316
307
  "name": "client-settings",
317
308
  "src": "src/client-settings.ts",
318
309
  "isEntry": true,
319
310
  "imports": [
320
- "_runtime-paths-y0_gHowM.js",
321
- "_jant-locale-picker-2L4rkDaz.js",
322
- "_lit-Bw_voPoW.js",
323
- "_confirm-CMe01lne.js",
311
+ "_lit-BN4mrI3j.js",
312
+ "_jant-locale-picker-CLq0iKDH.js",
313
+ "_confirm-BQebcuNB.js",
324
314
  "_types-DrYFqJH2.js",
325
- "_create-editor-hWapNE40.js"
315
+ "_create-editor-B8KuszlS.js"
326
316
  ]
327
317
  },
328
318
  "src/client-share.ts": {
329
- "file": "_assets/client-share-C59mOLJ1.js",
319
+ "file": "_assets/client-share-B9OsXx9p.js",
330
320
  "name": "client-share",
331
321
  "src": "src/client-share.ts",
332
322
  "isEntry": true,
333
323
  "imports": [
334
- "_lit-Bw_voPoW.js",
335
- "_unsafe-html-CWos3v6N.js"
324
+ "_lit-BN4mrI3j.js",
325
+ "_unsafe-html-OJ9m154w.js"
336
326
  ]
337
327
  },
338
328
  "src/client.ts": {
339
- "file": "_assets/client-BO8GOFfT.js",
329
+ "file": "_assets/client-pq6sVS7y.js",
340
330
  "name": "client",
341
331
  "src": "src/client.ts",
342
332
  "isEntry": true,
343
333
  "imports": [
344
- "_runtime-paths-y0_gHowM.js",
345
- "_footnote-rail-9zwl6jtV.js",
346
- "_jant-locale-picker-2L4rkDaz.js",
347
- "_lit-Bw_voPoW.js",
348
- "_unsafe-html-CWos3v6N.js",
334
+ "_lit-BN4mrI3j.js",
335
+ "_footnote-rail-DUrqz0Py.js",
336
+ "_jant-locale-picker-CLq0iKDH.js",
337
+ "_unsafe-html-OJ9m154w.js",
349
338
  "_site-header-nav-DzXsFk05.js"
350
339
  ]
351
340
  },
@@ -359,7 +348,7 @@
359
348
  ]
360
349
  },
361
350
  "src/style-author.css": {
362
- "file": "_assets/client-author-QPm1whbO.css",
351
+ "file": "_assets/client-author-2WYBkgni.css",
363
352
  "name": "style-author",
364
353
  "names": [
365
354
  "style-author.css"
@@ -1063,7 +1052,7 @@
1063
1052
  "isEntry": true
1064
1053
  },
1065
1054
  "src/style.css": {
1066
- "file": "_assets/client-D8Rrsd73.css",
1055
+ "file": "_assets/client-CoNHvipV.css",
1067
1056
  "name": "style",
1068
1057
  "names": [
1069
1058
  "style.css"
@@ -1,4 +1,4 @@
1
- import{i as e,n as t,t as n}from"./lit-Bw_voPoW.js";var r=`default`,i=class extends n{static properties={_open:{state:!0},_title:{state:!0},_message:{state:!0},_confirmLabel:{state:!0},_cancelLabel:{state:!0},_tone:{state:!0}};#e=[];#t=null;createRenderRoot(){return this.innerHTML=``,this}constructor(){super(),this._open=!1,this._title=``,this._message=``,this._confirmLabel=``,this._cancelLabel=``,this._tone=r}disconnectedCallback(){super.disconnectedCallback();let e=this.#t;this.#t=null,e?.resolve(!1);for(let e of this.#e.splice(0))e.resolve(!1)}async confirm(e){return await new Promise(t=>{this.#e.push({...e,tone:e.tone??r,resolve:t}),this.#t||this.#n()})}async#n(){if(this.#t||this.#e.length===0)return;let e=this.#e.shift();if(!e)return;this.#t=e,this._title=e.title??``,this._message=e.message,this._confirmLabel=e.confirmLabel,this._cancelLabel=e.cancelLabel,this._tone=e.tone??r,this._open=!0,await this.updateComplete;let t=this.querySelector(`.confirm-dialog`);t&&(t.open||t.showModal(),t.querySelector(`.confirm-dialog-panel`)?.focus())}#r(e){let t=this.#t;if(!t)return;this.#t=null;let n=this.querySelector(`.confirm-dialog`);n?.open&&n.close(),this._open=!1,this._title=``,this._message=``,this._confirmLabel=``,this._cancelLabel=``,this._tone=r,t.resolve(e),queueMicrotask(()=>void this.#n())}#i=e=>{e.preventDefault(),this.#r(!1)};#a=e=>{e.target===e.currentTarget&&this.#r(!1)};#o=e=>{if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),this.#r(!1);return}let t=e.target,n=t instanceof HTMLButtonElement||t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLAnchorElement;e.key===`Enter`&&!e.defaultPrevented&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey&&!n&&(e.preventDefault(),this.#r(!0))};#s(){if(this._title)return{title:this._title,message:this._message};let e=this._message.match(/^(.+?[??])\s+(.+)$/u);return e?{title:e[1],message:e[2]}:{title:this._message,message:``}}render(){if(!this._open)return t;let{title:n,message:r}=this.#s(),i=this._tone===`danger`?`btn-destructive`:`btn`;return e`
1
+ import{i as e,n as t,t as n}from"./lit-BN4mrI3j.js";var r=`default`,i=class extends n{static properties={_open:{state:!0},_title:{state:!0},_message:{state:!0},_confirmLabel:{state:!0},_cancelLabel:{state:!0},_tone:{state:!0}};#e=[];#t=null;createRenderRoot(){return this.innerHTML=``,this}constructor(){super(),this._open=!1,this._title=``,this._message=``,this._confirmLabel=``,this._cancelLabel=``,this._tone=r}disconnectedCallback(){super.disconnectedCallback();let e=this.#t;this.#t=null,e?.resolve(!1);for(let e of this.#e.splice(0))e.resolve(!1)}async confirm(e){return await new Promise(t=>{this.#e.push({...e,tone:e.tone??r,resolve:t}),this.#t||this.#n()})}async#n(){if(this.#t||this.#e.length===0)return;let e=this.#e.shift();if(!e)return;this.#t=e,this._title=e.title??``,this._message=e.message,this._confirmLabel=e.confirmLabel,this._cancelLabel=e.cancelLabel,this._tone=e.tone??r,this._open=!0,await this.updateComplete;let t=this.querySelector(`.confirm-dialog`);t&&(t.open||t.showModal(),t.querySelector(`.confirm-dialog-panel`)?.focus())}#r(e){let t=this.#t;if(!t)return;this.#t=null;let n=this.querySelector(`.confirm-dialog`);n?.open&&n.close(),this._open=!1,this._title=``,this._message=``,this._confirmLabel=``,this._cancelLabel=``,this._tone=r,t.resolve(e),queueMicrotask(()=>void this.#n())}#i=e=>{e.preventDefault(),this.#r(!1)};#a=e=>{e.target===e.currentTarget&&this.#r(!1)};#o=e=>{if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),this.#r(!1);return}let t=e.target,n=t instanceof HTMLButtonElement||t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLAnchorElement;e.key===`Enter`&&!e.defaultPrevented&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey&&!n&&(e.preventDefault(),this.#r(!0))};#s(){if(this._title)return{title:this._title,message:this._message};let e=this._message.match(/^(.+?[??])\s+(.+)$/u);return e?{title:e[1],message:e[2]}:{title:this._message,message:``}}render(){if(!this._open)return t;let{title:n,message:r}=this.#s(),i=this._tone===`danger`?`btn-destructive`:`btn`;return e`
2
2
  <dialog
3
3
  class="dialog confirm-dialog"
4
4
  @cancel=${this.#i}