@jant/core 0.6.7 → 0.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/commands/uploads/cleanup.js +2 -0
- package/dist/{app-L1UPUArB.js → app-C-jxWmAV.js} +12421 -12033
- package/dist/app-DqHzOwL5.js +6 -0
- package/dist/client/.vite/manifest.json +3 -3
- package/dist/client/_assets/client-CGf2m3qp.css +2 -0
- package/dist/client/_assets/{client-B0MvB2r0.js → client-DWy1LEEk.js} +2 -2
- package/dist/client/_assets/{client-auth-CwwuucF_.js → client-auth-Blg-a5Ep.js} +365 -345
- package/dist/{env-CoSe-1y4.js → env-OHRKGcMj.js} +1 -1
- package/dist/{export-DLukCOO3.js → export-C2DIB7mm.js} +34 -9
- package/dist/{github-api-UD4u_7fa.js → github-api-BgSiE71w.js} +1 -1
- package/dist/{github-app-DeX6Td1O.js → github-app-BbklkFmU.js} +1 -1
- package/dist/{github-sync-BeDecPen.js → github-sync-7XQ5ZM6z.js} +3 -3
- package/dist/{github-sync-BtHY2AST.js → github-sync-BEFCfLKK.js} +3 -3
- package/dist/index.js +5 -5
- package/dist/node.js +6 -6
- package/dist/{url-XF0GbKGO.js → url-BMYO-Zlt.js} +42 -2
- package/package.json +1 -1
- package/src/__tests__/bin/uploads-cleanup.test.ts +2 -0
- package/src/client/__tests__/compose-bridge.test.ts +105 -0
- package/src/client/__tests__/hydrate-partial.test.ts +27 -0
- package/src/client/__tests__/note-expand.test.ts +130 -0
- package/src/client/archive-nav.js +2 -1
- package/src/client/audio-player.ts +7 -3
- package/src/client/components/__tests__/compose-format-convert.test.ts +357 -0
- package/src/client/components/__tests__/jant-compose-dialog.test.ts +313 -0
- package/src/client/components/__tests__/jant-compose-editor.test.ts +2 -0
- package/src/client/components/__tests__/jant-compose-fullscreen.test.ts +2 -0
- package/src/client/components/__tests__/jant-settings-avatar.test.ts +5 -2
- package/src/client/components/__tests__/jant-settings-general.test.ts +55 -8
- package/src/client/components/compose-format-convert.ts +255 -0
- package/src/client/components/compose-types.ts +2 -0
- package/src/client/components/jant-compose-dialog.ts +110 -44
- package/src/client/components/jant-compose-editor.ts +64 -11
- package/src/client/components/jant-settings-general.ts +56 -18
- package/src/client/components/settings-types.ts +11 -0
- package/src/client/compose-bridge.ts +17 -0
- package/src/client/feed-video-player.ts +1 -1
- package/src/client/hydrate-partial.ts +25 -0
- package/src/client/note-expand.ts +63 -0
- package/src/client/settings-bridge.ts +3 -0
- package/src/client/tiptap/__tests__/mark-exit.test.ts +99 -0
- package/src/client/tiptap/bubble-menu.ts +37 -4
- package/src/client.ts +1 -0
- package/src/db/migrations/0026_absent_rhodey.sql +14 -0
- package/src/db/migrations/meta/0026_snapshot.json +2511 -0
- package/src/db/migrations/meta/_journal.json +7 -0
- package/src/db/migrations/pg/0024_high_violations.sql +14 -0
- package/src/db/migrations/pg/meta/0024_snapshot.json +3204 -0
- package/src/db/migrations/pg/meta/_journal.json +7 -0
- package/src/db/pg/schema.ts +36 -0
- package/src/db/schema.ts +36 -0
- package/src/i18n/__tests__/middleware.test.ts +46 -0
- package/src/i18n/locales/public/en.po +41 -0
- package/src/i18n/locales/public/en.ts +1 -1
- package/src/i18n/locales/public/zh-Hans.po +41 -0
- package/src/i18n/locales/public/zh-Hans.ts +1 -1
- package/src/i18n/locales/public/zh-Hant.po +41 -0
- package/src/i18n/locales/public/zh-Hant.ts +1 -1
- package/src/i18n/locales/settings/en.po +37 -22
- package/src/i18n/locales/settings/en.ts +1 -1
- package/src/i18n/locales/settings/zh-Hans.po +37 -22
- package/src/i18n/locales/settings/zh-Hans.ts +1 -1
- package/src/i18n/locales/settings/zh-Hant.po +37 -22
- package/src/i18n/locales/settings/zh-Hant.ts +1 -1
- package/src/i18n/middleware.ts +17 -8
- package/src/i18n/supported-locales.ts +5 -4
- package/src/lib/__tests__/markdown-to-tiptap.test.ts +1 -1
- package/src/lib/__tests__/markdown.test.ts +1 -1
- package/src/lib/__tests__/summary.test.ts +87 -0
- package/src/lib/__tests__/timeline.test.ts +48 -1
- package/src/lib/__tests__/tiptap-render.test.ts +4 -4
- package/src/lib/__tests__/url.test.ts +44 -0
- package/src/lib/__tests__/view.test.ts +168 -1
- package/src/lib/ids.ts +1 -0
- package/src/lib/navigation.ts +1 -0
- package/src/lib/resolve-config.ts +3 -2
- package/src/lib/summary.ts +42 -3
- package/src/lib/tiptap-render.ts +6 -2
- package/src/lib/upload.ts +16 -2
- package/src/lib/url.ts +41 -0
- package/src/lib/view.ts +102 -40
- package/src/preset.css +7 -1
- package/src/routes/api/__tests__/settings.test.ts +1 -4
- package/src/routes/api/__tests__/upload.test.ts +2 -0
- package/src/routes/api/internal/__tests__/uploads.test.ts +86 -0
- package/src/routes/api/internal/sites.ts +44 -1
- package/src/routes/api/public/__tests__/archive.test.ts +66 -0
- package/src/routes/api/public/archive.ts +22 -6
- package/src/routes/api/settings.ts +2 -1
- package/src/routes/api/telegram.ts +2 -1
- package/src/routes/auth/__tests__/setup.test.ts +14 -0
- package/src/routes/dash/__tests__/settings-avatar.test.ts +35 -17
- package/src/routes/dash/custom-urls.tsx +1 -1
- package/src/routes/dash/settings.tsx +23 -7
- package/src/routes/pages/__tests__/archive-params.test.ts +135 -0
- package/src/routes/pages/archive.tsx +116 -20
- package/src/routes/pages/collections.tsx +1 -0
- package/src/services/__tests__/media.test.ts +274 -30
- package/src/services/__tests__/post.test.ts +81 -0
- package/src/services/__tests__/settings.test.ts +55 -0
- package/src/services/bootstrap.ts +7 -0
- package/src/services/export-theme/assets/client-site.js +1 -1
- package/src/services/export-theme/layouts/_default/baseof.html +2 -1
- package/src/services/export-theme/styles/main.css +49 -15
- package/src/services/media.ts +199 -42
- package/src/services/post.ts +22 -2
- package/src/services/search.ts +4 -4
- package/src/services/settings.ts +49 -15
- package/src/services/upload-session.ts +28 -0
- package/src/styles/tokens.css +7 -5
- package/src/styles/ui.css +163 -34
- package/src/types/bindings.ts +1 -0
- package/src/types/config.ts +14 -1
- package/src/types/props.ts +3 -0
- package/src/ui/compose/ComposeDialog.tsx +13 -0
- package/src/ui/dash/settings/AccountMenuContent.tsx +0 -39
- package/src/ui/dash/settings/GeneralContent.tsx +38 -4
- package/src/ui/dash/settings/SettingsDirectory.tsx +26 -1
- package/src/ui/dash/settings/SettingsRootContent.tsx +46 -1
- package/src/ui/dash/settings/__tests__/SettingsRootContent.test.tsx +55 -0
- package/src/ui/feed/NoteCard.tsx +54 -5
- package/src/ui/feed/__tests__/timeline-cards.test.ts +73 -0
- package/src/ui/layouts/BaseLayout.tsx +1 -0
- package/src/ui/layouts/__tests__/BaseLayout.test.tsx +13 -0
- package/src/ui/pages/ArchivePage.tsx +89 -6
- package/src/ui/pages/CollectionsPage.tsx +7 -1
- package/src/ui/pages/__tests__/ArchivePage.test.tsx +37 -0
- package/src/ui/shared/CollectionDirectory.tsx +13 -3
- package/src/ui/shared/CollectionsManager.tsx +3 -0
- package/dist/app-C1QgMNRY.js +0 -6
- package/dist/client/_assets/client-BMPMuwvV.css +0 -2
|
@@ -37,6 +37,39 @@ interface BubbleBtn {
|
|
|
37
37
|
isActive: (view: EditorView) => boolean;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Toggle an inline mark on the current selection, then drop out of it.
|
|
42
|
+
*
|
|
43
|
+
* The toolbar mark buttons (bold, italic) format the *selection* — the same
|
|
44
|
+
* intent as the `**x**` / `~~x~~` markdown shortcuts, which auto-exit once you
|
|
45
|
+
* type the closing delimiter. These marks are inclusive, so a collapsed cursor
|
|
46
|
+
* sitting at the end of the formatted word stays "inside" the mark and keeps
|
|
47
|
+
* extending as the user types, with no obvious way to stop (the bubble menu is
|
|
48
|
+
* hidden once the selection collapses). After toggling, we collapse the cursor
|
|
49
|
+
* to the end of the selection and remove the just-applied mark from the stored
|
|
50
|
+
* set so the next character is plain. Use the keyboard shortcuts (Mod-B /
|
|
51
|
+
* Mod-I) for mode-style "keep typing in this format".
|
|
52
|
+
*/
|
|
53
|
+
export function toggleMarkAndExit(editor: Editor, markName: string): void {
|
|
54
|
+
const { to, empty } = editor.state.selection;
|
|
55
|
+
if (empty) {
|
|
56
|
+
// No selection (e.g. shortcut-driven): behave as a plain mode toggle.
|
|
57
|
+
editor.chain().focus().toggleMark(markName).run();
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const markType = editor.schema.marks[markName];
|
|
61
|
+
editor
|
|
62
|
+
.chain()
|
|
63
|
+
.focus()
|
|
64
|
+
.toggleMark(markName)
|
|
65
|
+
.setTextSelection(to)
|
|
66
|
+
.command(({ tr }) => {
|
|
67
|
+
if (markType) tr.removeStoredMark(markType);
|
|
68
|
+
return true;
|
|
69
|
+
})
|
|
70
|
+
.run();
|
|
71
|
+
}
|
|
72
|
+
|
|
40
73
|
function getButtons(
|
|
41
74
|
editor: Editor,
|
|
42
75
|
toolbarMode: FormattingToolbarMode,
|
|
@@ -47,14 +80,14 @@ function getButtons(
|
|
|
47
80
|
key: "bold",
|
|
48
81
|
icon: ICONS.bold,
|
|
49
82
|
title: "Bold",
|
|
50
|
-
action: () => editor
|
|
83
|
+
action: () => toggleMarkAndExit(editor, "bold"),
|
|
51
84
|
isActive: () => editor.isActive("bold"),
|
|
52
85
|
},
|
|
53
86
|
{
|
|
54
87
|
key: "italic",
|
|
55
88
|
icon: ICONS.italic,
|
|
56
89
|
title: "Italic",
|
|
57
|
-
action: () => editor
|
|
90
|
+
action: () => toggleMarkAndExit(editor, "italic"),
|
|
58
91
|
isActive: () => editor.isActive("italic"),
|
|
59
92
|
},
|
|
60
93
|
{
|
|
@@ -101,14 +134,14 @@ function getButtons(
|
|
|
101
134
|
key: "bold",
|
|
102
135
|
icon: ICONS.bold,
|
|
103
136
|
title: "Bold",
|
|
104
|
-
action: () => editor
|
|
137
|
+
action: () => toggleMarkAndExit(editor, "bold"),
|
|
105
138
|
isActive: () => editor.isActive("bold"),
|
|
106
139
|
},
|
|
107
140
|
{
|
|
108
141
|
key: "italic",
|
|
109
142
|
icon: ICONS.italic,
|
|
110
143
|
title: "Italic",
|
|
111
|
-
action: () => editor
|
|
144
|
+
action: () => toggleMarkAndExit(editor, "italic"),
|
|
112
145
|
isActive: () => editor.isActive("italic"),
|
|
113
146
|
},
|
|
114
147
|
{
|
package/src/client.ts
CHANGED
|
@@ -15,6 +15,7 @@ import "./client/components/jant-media-lightbox.js";
|
|
|
15
15
|
import "./client/components/jant-text-preview.js";
|
|
16
16
|
import "./client/toast.js";
|
|
17
17
|
import "./client/thread-context.js";
|
|
18
|
+
import "./client/note-expand.js";
|
|
18
19
|
import "./client/archive-nav.js";
|
|
19
20
|
import "./client/site-header-nav.js";
|
|
20
21
|
import "./client/collection-sort-menu.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
CREATE TABLE `storage_purge` (
|
|
2
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
3
|
+
`site_id` text NOT NULL,
|
|
4
|
+
`provider` text NOT NULL,
|
|
5
|
+
`storage_key` text NOT NULL,
|
|
6
|
+
`original_key` text NOT NULL,
|
|
7
|
+
`reason` text,
|
|
8
|
+
`purge_after` integer NOT NULL,
|
|
9
|
+
`created_at` integer NOT NULL,
|
|
10
|
+
FOREIGN KEY (`site_id`) REFERENCES `site`(`id`) ON UPDATE no action ON DELETE cascade
|
|
11
|
+
);
|
|
12
|
+
--> statement-breakpoint
|
|
13
|
+
CREATE UNIQUE INDEX `uq_storage_purge_provider_key` ON `storage_purge` (`provider`,`storage_key`);--> statement-breakpoint
|
|
14
|
+
CREATE INDEX `idx_storage_purge_site_provider_due` ON `storage_purge` (`site_id`,`provider`,`purge_after`);
|