@hiai-gg/docsmint 0.3.7 → 0.3.8
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/backend/src/lib/logger.ts +45 -15
- package/dist/backend/index.js +238 -150
- package/dist/frontend/CategoryDialog-DphkZqIB.js +611 -0
- package/dist/frontend/ConfirmDialog-BLF3x_hr.js +214 -0
- package/dist/frontend/CreateSnapshotDialog-D5vPvFTL.js +216 -0
- package/dist/frontend/DatePicker-CLNTdvTk.js +259 -0
- package/dist/frontend/DeleteDialog-DxYFJivN.js +174 -0
- package/dist/frontend/FolderDialog-CRVZM2Oi.js +250 -0
- package/dist/frontend/FolderNode-C2zG7uii.js +298 -0
- package/dist/frontend/FolderTreeSelector-CyB8y2Sm.js +103 -0
- package/dist/frontend/Icon-CooFj4Ee.js +64 -0
- package/dist/frontend/SettingsDialog-DCM4-N6_.js +1016 -0
- package/dist/frontend/ShareDialog-DYu3RKQu.js +165 -0
- package/dist/frontend/TagCreateDialog-DXQs2bL9.js +260 -0
- package/dist/frontend/camera-iKXDOOWT.js +29 -0
- package/dist/frontend/check-D-UuvBuh.js +25 -0
- package/dist/frontend/chevron-down-CiPtYyFh.js +25 -0
- package/dist/frontend/circle-check-tSPE1V6t.js +29 -0
- package/dist/frontend/clock-DJHbHZb8.js +29 -0
- package/dist/frontend/{bundle-mjs-CP6Owz-8.js → clsx-C7bIvsDS.js} +16 -1
- package/dist/frontend/components/category-dialog.js +1 -1
- package/dist/frontend/components/create-snapshot-dialog.js +1 -1
- package/dist/frontend/components/delete-dialog.js +1 -1
- package/dist/frontend/components/editor/document-editor.js +1364 -1353
- package/dist/frontend/components/editor/document-title.js +25 -25
- package/dist/frontend/components/editor/markdown-toggle.js +45 -45
- package/dist/frontend/components/folder-node.js +1 -1
- package/dist/frontend/components/folder-tree-selector.js +1 -1
- package/dist/frontend/components/save-as-dialog.js +169 -151
- package/dist/frontend/components/settings.js +1 -1
- package/dist/frontend/components/share-dialog.js +1 -1
- package/dist/frontend/components/sidebar.js +1161 -1153
- package/dist/frontend/components/tag-create-dialog.js +1 -1
- package/dist/frontend/components/version-history.js +188 -187
- package/dist/frontend/copy-GppwRMjX.js +32 -0
- package/dist/frontend/dashboard.js +1188 -1156
- package/dist/frontend/dialog-D6NxYVmy.js +213 -0
- package/dist/frontend/doc-tabs.js +2 -2
- package/dist/frontend/ellipsis-vertical-P9MHvCps.js +530 -0
- package/dist/frontend/extension.js +8 -8
- package/dist/frontend/{floating-layer-anchor-C51M4l6v.js → floating-layer-anchor-CPwucTfd.js} +1414 -1412
- package/dist/frontend/folder-DeWhnD7O.js +45 -0
- package/dist/frontend/folder-refresh.js +1 -1
- package/dist/frontend/input-B5Rak-5G.js +23 -0
- package/dist/frontend/keyboard.js +1 -1
- package/dist/frontend/{keyboard.svelte-D7H8DihC.js → keyboard.svelte-CApmX0vl.js} +53 -53
- package/dist/frontend/label-CW9rxoAb.js +30 -0
- package/dist/frontend/{loader-circle-Bk-WFz9g.js → loader-circle-BA6aLO71.js} +86 -85
- package/dist/frontend/rotate-ccw-B4Q7brmV.js +25 -0
- package/dist/frontend/search.js +680 -654
- package/dist/frontend/select-value-sF86Geyh.js +1446 -0
- package/dist/frontend/shared-document.js +94 -94
- package/dist/frontend/subfolders-refresh-store.svelte-B2dKVmgz.js +65 -0
- package/dist/frontend/tag-HxRazVN_.js +54 -0
- package/dist/frontend/tag-store.svelte-CqrUXo0o.js +29 -0
- package/dist/frontend/textarea-i1720bE7.js +23 -0
- package/dist/frontend/theme.js +1 -1
- package/dist/frontend/theme.svelte-DKfCy12k.js +49 -0
- package/dist/frontend/{utils-C0OW2678.js → utils-CffiyuTo.js} +2 -3
- package/dist/frontend/{utils-D8kmM3ub.js → utils-hzdMVeCv.js} +2 -3
- package/dist/frontend/utils.js +1 -1
- package/dist/frontend/x-CzBsnJ2x.js +25 -0
- package/dist/frontend-ssr/api/attachments.js +2 -0
- package/dist/frontend-ssr/api/categories.js +2 -0
- package/dist/frontend-ssr/api/documents.js +2 -0
- package/dist/frontend-ssr/api/folders.js +2 -0
- package/dist/frontend-ssr/api/settings.js +2 -0
- package/dist/frontend-ssr/api/share.js +2 -0
- package/dist/frontend-ssr/api/tags.js +2 -0
- package/dist/frontend-ssr/assets/CategoryDialog-C2xaZKHq.js +584 -0
- package/dist/frontend-ssr/assets/ConfirmDialog-DjMFKc0V.js +420 -0
- package/dist/frontend-ssr/assets/CreateSnapshotDialog-BRw1xJW1.js +214 -0
- package/dist/frontend-ssr/assets/DatePicker-DnXniwlZ.js +312 -0
- package/dist/frontend-ssr/assets/DeleteDialog-BCfZy3Zn.js +154 -0
- package/dist/frontend-ssr/assets/FolderDialog-Dq7I2cKZ.js +429 -0
- package/dist/frontend-ssr/assets/FolderNode-DRfBfpft.js +171 -0
- package/dist/frontend-ssr/assets/FolderTreeSelector-DZNZ2oI6.js +147 -0
- package/dist/frontend-ssr/assets/Icon-B0Zqppjo.js +231 -0
- package/dist/frontend-ssr/assets/SettingsDialog-CX8Noa8A.js +1107 -0
- package/dist/frontend-ssr/assets/ShareDialog-Cge49ZdJ.js +54 -0
- package/dist/frontend-ssr/assets/TagCreateDialog-EAChgBF-.js +264 -0
- package/dist/frontend-ssr/assets/api-keys-DFqX39MT.js +35 -0
- package/dist/frontend-ssr/assets/attachments-CWBxE3Vz.js +85 -0
- package/dist/frontend-ssr/assets/auth-client-x26kqY8Z.js +1286 -0
- package/dist/frontend-ssr/assets/camera-CdxscTw-.js +84 -0
- package/dist/frontend-ssr/assets/categories-AOqgcsn4.js +75 -0
- package/dist/frontend-ssr/assets/chevron-down-CSSNGNh_.js +80 -0
- package/dist/frontend-ssr/assets/chevron-right-B4p7Sk6X.js +80 -0
- package/dist/frontend-ssr/assets/circle-check-CI1v4vYh.js +84 -0
- package/dist/frontend-ssr/assets/client-DZMkDkDn.js +129 -0
- package/dist/frontend-ssr/assets/clipboard-CXOaoz2W.js +30 -0
- package/dist/frontend-ssr/assets/clock-IL-eX2di.js +84 -0
- package/dist/frontend-ssr/assets/context-jz1GGEUi.js +45 -0
- package/dist/frontend-ssr/assets/copy-CjV57nGQ.js +87 -0
- package/dist/frontend-ssr/assets/db-CnxeO66n.js +65 -0
- package/dist/frontend-ssr/assets/dialog-BOV1u6zP.js +157 -0
- package/dist/frontend-ssr/assets/dndzone-DMvTO_Jz.js +2114 -0
- package/dist/frontend-ssr/assets/document-drop-coordinator-CEaYACsC.js +109 -0
- package/dist/frontend-ssr/assets/documents-BnOTRdTY.js +108 -0
- package/dist/frontend-ssr/assets/editorExtensions-DUzwndMy.js +186 -0
- package/dist/frontend-ssr/assets/ellipsis-vertical-C-0hgkZn.js +555 -0
- package/dist/frontend-ssr/assets/floating-layer-anchor-uzw9K8qN.js +6114 -0
- package/dist/frontend-ssr/assets/folder-DChhG7qN.js +80 -0
- package/dist/frontend-ssr/assets/folders-CTfbS24J.js +127 -0
- package/dist/frontend-ssr/assets/identity-B3uHoDtf.js +99 -0
- package/dist/frontend-ssr/assets/input-DezGsU3y.js +19 -0
- package/dist/frontend-ssr/assets/keyboard.svelte-BgF47N3L.js +174 -0
- package/dist/frontend-ssr/assets/label-Bj8-TfFN.js +21 -0
- package/dist/frontend-ssr/assets/loader-circle-DZsrZ-er.js +80 -0
- package/dist/frontend-ssr/assets/markdown-CjqvGi5W.js +20 -0
- package/dist/frontend-ssr/assets/messages-DhXqlcJI.js +11125 -0
- package/dist/frontend-ssr/assets/resolve-BqHozBXl.js +32 -0
- package/dist/frontend-ssr/assets/rotate-ccw-BlgWwaiq.js +80 -0
- package/dist/frontend-ssr/assets/select-value-DngdSmLI.js +1526 -0
- package/dist/frontend-ssr/assets/settings-E6qSAWM2.js +64 -0
- package/dist/frontend-ssr/assets/share-BTBJelxA.js +30 -0
- package/dist/frontend-ssr/assets/subfolders-refresh-store.svelte-DAh4gT16.js +77 -0
- package/dist/frontend-ssr/assets/tag-GZEuGWk1.js +166 -0
- package/dist/frontend-ssr/assets/tag-store.svelte-DPodKj6Z.js +21 -0
- package/dist/frontend-ssr/assets/tags-BId2wdYd.js +49 -0
- package/dist/frontend-ssr/assets/textarea-Dev-qSEc.js +21 -0
- package/dist/frontend-ssr/assets/theme.svelte-Co0-ssaD.js +67 -0
- package/dist/frontend-ssr/assets/utils-DtlPPXpJ.js +9 -0
- package/dist/frontend-ssr/assets/utils-DvZnctjz.js +23 -0
- package/dist/frontend-ssr/collaboration.js +39 -0
- package/dist/frontend-ssr/components/category-dialog.js +2 -0
- package/dist/frontend-ssr/components/create-snapshot-dialog.js +2 -0
- package/dist/frontend-ssr/components/delete-dialog.js +2 -0
- package/dist/frontend-ssr/components/editor/document-editor.js +2499 -0
- package/dist/frontend-ssr/components/editor/document-title.js +11 -0
- package/dist/frontend-ssr/components/editor/docx-serializer.js +186 -0
- package/dist/frontend-ssr/components/editor/extensions.js +2 -0
- package/dist/frontend-ssr/components/editor/markdown-toggle.js +20 -0
- package/dist/frontend-ssr/components/editor/markdown.js +2 -0
- package/dist/frontend-ssr/components/folder-node.js +2 -0
- package/dist/frontend-ssr/components/folder-tree-selector.js +2 -0
- package/dist/frontend-ssr/components/save-as-dialog.js +280 -0
- package/dist/frontend-ssr/components/settings.js +2 -0
- package/dist/frontend-ssr/components/share-dialog.js +2 -0
- package/dist/frontend-ssr/components/sidebar.js +2033 -0
- package/dist/frontend-ssr/components/tag-create-dialog.js +2 -0
- package/dist/frontend-ssr/components/version-history.js +370 -0
- package/dist/frontend-ssr/dashboard.js +2542 -0
- package/dist/frontend-ssr/doc-tabs.js +23 -0
- package/dist/frontend-ssr/document-drop-coordinator.js +2 -0
- package/dist/frontend-ssr/extension.js +13 -0
- package/dist/frontend-ssr/folder-refresh.js +2 -0
- package/dist/frontend-ssr/i18n.js +10 -0
- package/dist/frontend-ssr/keyboard.js +2 -0
- package/dist/frontend-ssr/offline/identity.js +2 -0
- package/dist/frontend-ssr/search.js +332 -0
- package/dist/frontend-ssr/shared-document.js +273 -0
- package/dist/frontend-ssr/theme.js +9 -0
- package/dist/frontend-ssr/types.js +1 -0
- package/dist/frontend-ssr/utils/clipboard.js +2 -0
- package/dist/frontend-ssr/utils/dndzone.js +2 -0
- package/dist/frontend-ssr/utils.js +2 -0
- package/package.json +22 -1
- package/packages/cli/src/index.ts +1 -1
- package/packages/db/src/schema.ts +3 -0
- package/packages/mcp-server/src/index.ts +1 -1
- package/dist/frontend/CategoryDialog--rIE7FrH.js +0 -580
- package/dist/frontend/ConfirmDialog-Cpzyb55f.js +0 -212
- package/dist/frontend/CreateSnapshotDialog-CmkV-n2A.js +0 -216
- package/dist/frontend/DatePicker-Byynca7V.js +0 -257
- package/dist/frontend/DeleteDialog-ap6nOywZ.js +0 -174
- package/dist/frontend/FolderDialog-DmN_trV0.js +0 -247
- package/dist/frontend/FolderNode-C4B8a2fd.js +0 -317
- package/dist/frontend/FolderTreeSelector-D6ijiZTA.js +0 -100
- package/dist/frontend/Icon-DtNo0N1U.js +0 -64
- package/dist/frontend/SettingsDialog-2kTaTXAs.js +0 -992
- package/dist/frontend/ShareDialog-BBDGNF5n.js +0 -165
- package/dist/frontend/TagCreateDialog-DiLZnJo4.js +0 -258
- package/dist/frontend/camera-B7dAOd4s.js +0 -28
- package/dist/frontend/check-CDwRlG9T.js +0 -24
- package/dist/frontend/chevron-down-B7ZrjUmT.js +0 -24
- package/dist/frontend/circle-check-CDqeMB2d.js +0 -28
- package/dist/frontend/client-Bc5Fzx40.js +0 -2785
- package/dist/frontend/clock-Ck5Sn-Zl.js +0 -28
- package/dist/frontend/clsx-nmtDPO_P.js +0 -16
- package/dist/frontend/copy-CMAA6GP0.js +0 -31
- package/dist/frontend/dialog-BDkiG42a.js +0 -213
- package/dist/frontend/disclose-version-5I57E3LD.js +0 -3
- package/dist/frontend/ellipsis-vertical-BBuPldbW.js +0 -519
- package/dist/frontend/folder-TQjKY4yn.js +0 -44
- package/dist/frontend/index-client-jobkrWVL.js +0 -86
- package/dist/frontend/input-CBI6p4Xl.js +0 -23
- package/dist/frontend/label-C-GkhEp4.js +0 -30
- package/dist/frontend/rotate-ccw-CleZtJ5D.js +0 -24
- package/dist/frontend/select-value-CvrWRkXW.js +0 -1436
- package/dist/frontend/subfolders-refresh-store.svelte-BsheoQma.js +0 -65
- package/dist/frontend/tag-Dx3SmucJ.js +0 -53
- package/dist/frontend/tag-store.svelte-CIaF4sdZ.js +0 -29
- package/dist/frontend/textarea-Dfp78XlL.js +0 -23
- package/dist/frontend/theme.svelte-CROg1Hi5.js +0 -49
- package/dist/frontend/x-DaTdeDXv.js +0 -24
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
import { Ct as version_filter_all, Ft as version_restore, It as version_history_title, Mt as version_create_snapshot, Nt as version_restore_confirm, Pt as version_restore_short, St as version_filter_snapshots, an as time_days_ago, bt as version_restored_from, cn as action_loading, hn as action_cancel, on as time_hours_ago, sn as time_minutes_ago, vn as error_generic, w as version_history_empty, xt as version_badge_snapshot, yt as version_restore_failed } from "../assets/messages-DhXqlcJI.js";
|
|
2
|
+
import { t as Icon } from "../assets/Icon-B0Zqppjo.js";
|
|
3
|
+
import { t as Camera } from "../assets/camera-CdxscTw-.js";
|
|
4
|
+
import { t as Clock } from "../assets/clock-IL-eX2di.js";
|
|
5
|
+
import { t as Rotate_ccw } from "../assets/rotate-ccw-BlgWwaiq.js";
|
|
6
|
+
import { t as Circle_check } from "../assets/circle-check-CI1v4vYh.js";
|
|
7
|
+
import { t as Loader_circle } from "../assets/loader-circle-DZsrZ-er.js";
|
|
8
|
+
import { t as ConfirmDialog } from "../assets/ConfirmDialog-DjMFKc0V.js";
|
|
9
|
+
import { n as apiFetch, t as ApiError } from "../assets/client-DZMkDkDn.js";
|
|
10
|
+
import { t as CreateSnapshotDialog } from "../assets/CreateSnapshotDialog-BRw1xJW1.js";
|
|
11
|
+
import * as $ from "svelte/internal/server";
|
|
12
|
+
//#region ../node_modules/.bun/lucide-svelte@1.0.1+ff5f301bb2db9a0d/node_modules/lucide-svelte/dist/icons/history.svelte
|
|
13
|
+
function History($$renderer, $$props) {
|
|
14
|
+
const $$sanitized_props = $.sanitize_props($$props);
|
|
15
|
+
/**
|
|
16
|
+
* @license lucide-svelte v1.0.1 - ISC
|
|
17
|
+
*
|
|
18
|
+
* ISC License
|
|
19
|
+
*
|
|
20
|
+
* Copyright (c) 2026 Lucide Icons and Contributors
|
|
21
|
+
*
|
|
22
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
23
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
24
|
+
* copyright notice and this permission notice appear in all copies.
|
|
25
|
+
*
|
|
26
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
27
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
28
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
29
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
30
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
31
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
32
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
33
|
+
*
|
|
34
|
+
* ---
|
|
35
|
+
*
|
|
36
|
+
* The following Lucide icons are derived from the Feather project:
|
|
37
|
+
*
|
|
38
|
+
* airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out
|
|
39
|
+
*
|
|
40
|
+
* The MIT License (MIT) (for the icons listed above)
|
|
41
|
+
*
|
|
42
|
+
* Copyright (c) 2013-present Cole Bemis
|
|
43
|
+
*
|
|
44
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
45
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
46
|
+
* in the Software without restriction, including without limitation the rights
|
|
47
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
48
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
49
|
+
* furnished to do so, subject to the following conditions:
|
|
50
|
+
*
|
|
51
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
52
|
+
* copies or substantial portions of the Software.
|
|
53
|
+
*
|
|
54
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
55
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
56
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
57
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
58
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
59
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
60
|
+
* SOFTWARE.
|
|
61
|
+
*
|
|
62
|
+
*/
|
|
63
|
+
Icon($$renderer, $.spread_props([
|
|
64
|
+
{ name: "history" },
|
|
65
|
+
$$sanitized_props,
|
|
66
|
+
{
|
|
67
|
+
/**
|
|
68
|
+
* @component @name History
|
|
69
|
+
* @description Lucide SVG icon component, renders SVG Element with children.
|
|
70
|
+
*
|
|
71
|
+
* @preview  - https://lucide.dev/icons/history
|
|
72
|
+
* @see https://lucide.dev/guide/packages/lucide-svelte - Documentation
|
|
73
|
+
*
|
|
74
|
+
* @param {Object} props - Lucide icons props and any valid SVG attribute
|
|
75
|
+
* @returns {FunctionalComponent} Svelte component
|
|
76
|
+
*
|
|
77
|
+
*/
|
|
78
|
+
iconNode: [
|
|
79
|
+
["path", { "d": "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }],
|
|
80
|
+
["path", { "d": "M3 3v5h5" }],
|
|
81
|
+
["path", { "d": "M12 7v5l4 2" }]
|
|
82
|
+
],
|
|
83
|
+
children: ($$renderer) => {
|
|
84
|
+
$$renderer.push(`<!--[-->`);
|
|
85
|
+
$.slot($$renderer, $$props, "default", {}, null);
|
|
86
|
+
$$renderer.push(`<!--]-->`);
|
|
87
|
+
},
|
|
88
|
+
$$slots: { default: true }
|
|
89
|
+
}
|
|
90
|
+
]));
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region ../node_modules/.bun/lucide-svelte@1.0.1+ff5f301bb2db9a0d/node_modules/lucide-svelte/dist/icons/star.svelte
|
|
94
|
+
function Star($$renderer, $$props) {
|
|
95
|
+
const $$sanitized_props = $.sanitize_props($$props);
|
|
96
|
+
/**
|
|
97
|
+
* @license lucide-svelte v1.0.1 - ISC
|
|
98
|
+
*
|
|
99
|
+
* ISC License
|
|
100
|
+
*
|
|
101
|
+
* Copyright (c) 2026 Lucide Icons and Contributors
|
|
102
|
+
*
|
|
103
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
104
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
105
|
+
* copyright notice and this permission notice appear in all copies.
|
|
106
|
+
*
|
|
107
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
108
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
109
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
110
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
111
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
112
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
113
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
114
|
+
*
|
|
115
|
+
* ---
|
|
116
|
+
*
|
|
117
|
+
* The following Lucide icons are derived from the Feather project:
|
|
118
|
+
*
|
|
119
|
+
* airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out
|
|
120
|
+
*
|
|
121
|
+
* The MIT License (MIT) (for the icons listed above)
|
|
122
|
+
*
|
|
123
|
+
* Copyright (c) 2013-present Cole Bemis
|
|
124
|
+
*
|
|
125
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
126
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
127
|
+
* in the Software without restriction, including without limitation the rights
|
|
128
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
129
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
130
|
+
* furnished to do so, subject to the following conditions:
|
|
131
|
+
*
|
|
132
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
133
|
+
* copies or substantial portions of the Software.
|
|
134
|
+
*
|
|
135
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
136
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
137
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
138
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
139
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
140
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
141
|
+
* SOFTWARE.
|
|
142
|
+
*
|
|
143
|
+
*/
|
|
144
|
+
Icon($$renderer, $.spread_props([
|
|
145
|
+
{ name: "star" },
|
|
146
|
+
$$sanitized_props,
|
|
147
|
+
{
|
|
148
|
+
/**
|
|
149
|
+
* @component @name Star
|
|
150
|
+
* @description Lucide SVG icon component, renders SVG Element with children.
|
|
151
|
+
*
|
|
152
|
+
* @preview  - https://lucide.dev/icons/star
|
|
153
|
+
* @see https://lucide.dev/guide/packages/lucide-svelte - Documentation
|
|
154
|
+
*
|
|
155
|
+
* @param {Object} props - Lucide icons props and any valid SVG attribute
|
|
156
|
+
* @returns {FunctionalComponent} Svelte component
|
|
157
|
+
*
|
|
158
|
+
*/
|
|
159
|
+
iconNode: [["path", { "d": "M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z" }]],
|
|
160
|
+
children: ($$renderer) => {
|
|
161
|
+
$$renderer.push(`<!--[-->`);
|
|
162
|
+
$.slot($$renderer, $$props, "default", {}, null);
|
|
163
|
+
$$renderer.push(`<!--]-->`);
|
|
164
|
+
},
|
|
165
|
+
$$slots: { default: true }
|
|
166
|
+
}
|
|
167
|
+
]));
|
|
168
|
+
}
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/lib/components/VersionHistory.svelte
|
|
171
|
+
function VersionHistory($$renderer, $$props) {
|
|
172
|
+
$$renderer.component(($$renderer) => {
|
|
173
|
+
const { documentId, onRestored } = $$props;
|
|
174
|
+
let versions = [];
|
|
175
|
+
let loading = true;
|
|
176
|
+
let loadError = null;
|
|
177
|
+
let snapshotDialogOpen = false;
|
|
178
|
+
let restoreDialogOpen = false;
|
|
179
|
+
let pendingRestore = null;
|
|
180
|
+
let restoring = false;
|
|
181
|
+
let restoreError = null;
|
|
182
|
+
async function loadVersions() {
|
|
183
|
+
loading = true;
|
|
184
|
+
loadError = null;
|
|
185
|
+
try {
|
|
186
|
+
versions = await apiFetch(`/api/documents/${documentId}/versions`);
|
|
187
|
+
} catch (e) {
|
|
188
|
+
loadError = e instanceof Error ? e.message : String(e);
|
|
189
|
+
console.error("Failed to load versions", e);
|
|
190
|
+
} finally {
|
|
191
|
+
loading = false;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
const visibleVersions = $.derived(() => {
|
|
195
|
+
return versions;
|
|
196
|
+
});
|
|
197
|
+
const snapshotCount = $.derived(() => versions.reduce((n, v) => v.isSnapshot ? n + 1 : n, 0));
|
|
198
|
+
const restoreDialogDescription = $.derived(() => pendingRestore?.label ? `${version_restore_confirm()} (${pendingRestore.label})` : version_restore_confirm());
|
|
199
|
+
/** Trim content to a single-line preview (strip markdown + truncate). */
|
|
200
|
+
function previewFromContent(content) {
|
|
201
|
+
if (!content) return "";
|
|
202
|
+
const stripped = content.replace(/```[\s\S]*?```/g, "").replace(/[#*_`>~-]/g, "").replace(/\s+/g, " ").trim();
|
|
203
|
+
return stripped.length > 100 ? `${stripped.slice(0, 100)}…` : stripped;
|
|
204
|
+
}
|
|
205
|
+
function relativeTime(value) {
|
|
206
|
+
const created = typeof value === "string" ? new Date(value) : value;
|
|
207
|
+
const diff = Date.now() - created.getTime();
|
|
208
|
+
if (Number.isNaN(diff)) return "";
|
|
209
|
+
const mins = Math.floor(diff / 6e4);
|
|
210
|
+
if (mins < 1) return time_minutes_ago({ count: 0 });
|
|
211
|
+
if (mins < 60) return time_minutes_ago({ count: mins });
|
|
212
|
+
const hrs = Math.floor(mins / 60);
|
|
213
|
+
if (hrs < 24) return time_hours_ago({ count: hrs });
|
|
214
|
+
return time_days_ago({ count: Math.floor(hrs / 24) });
|
|
215
|
+
}
|
|
216
|
+
function cancelRestore() {
|
|
217
|
+
if (restoring) return;
|
|
218
|
+
pendingRestore = null;
|
|
219
|
+
restoreError = null;
|
|
220
|
+
}
|
|
221
|
+
async function confirmRestore() {
|
|
222
|
+
const target = pendingRestore;
|
|
223
|
+
if (!target || restoring) return;
|
|
224
|
+
restoring = true;
|
|
225
|
+
restoreError = null;
|
|
226
|
+
try {
|
|
227
|
+
await apiFetch(`/api/documents/${documentId}/versions/${target.id}/restore`, { method: "POST" });
|
|
228
|
+
await loadVersions();
|
|
229
|
+
pendingRestore = null;
|
|
230
|
+
restoreDialogOpen = false;
|
|
231
|
+
onRestored?.(target);
|
|
232
|
+
if (typeof window !== "undefined") window.dispatchEvent(new CustomEvent("version-restored", { detail: {
|
|
233
|
+
documentId,
|
|
234
|
+
versionId: target.id
|
|
235
|
+
} }));
|
|
236
|
+
} catch (e) {
|
|
237
|
+
if (e instanceof ApiError) restoreError = `${version_restore_failed()}: ${e.message}`;
|
|
238
|
+
else restoreError = e instanceof Error ? e.message : error_generic();
|
|
239
|
+
console.error("Failed to restore version", e);
|
|
240
|
+
} finally {
|
|
241
|
+
restoring = false;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
function handleSnapshotCreated() {
|
|
245
|
+
loadVersions();
|
|
246
|
+
}
|
|
247
|
+
function findVersionLabel(id) {
|
|
248
|
+
if (!id) return null;
|
|
249
|
+
const v = versions.find((vv) => vv.id === id);
|
|
250
|
+
if (!v) return id.slice(0, 8);
|
|
251
|
+
return v.label ?? id.slice(0, 8);
|
|
252
|
+
}
|
|
253
|
+
let $$settled = true;
|
|
254
|
+
let $$inner_renderer;
|
|
255
|
+
function $$render_inner($$renderer) {
|
|
256
|
+
$$renderer.push(`<div class="flex flex-col gap-2 p-4"><div class="flex items-center justify-between gap-2"><div class="flex items-center gap-2 text-sm font-medium text-foreground">`);
|
|
257
|
+
History($$renderer, { class: "h-4 w-4" });
|
|
258
|
+
$$renderer.push(`<!----> <span>${$.escape(version_history_title())}</span></div> <button type="button" class="inline-flex items-center gap-1 rounded-md border border-border bg-background px-2 py-1 text-xs font-medium hover:bg-accent disabled:opacity-50"${$.attr("disabled", loading, true)}${$.attr("title", version_create_snapshot())}${$.attr("aria-label", version_create_snapshot())}>`);
|
|
259
|
+
Camera($$renderer, { class: "h-3 w-3" });
|
|
260
|
+
$$renderer.push(`<!----> ${$.escape(version_create_snapshot())}</button></div> `);
|
|
261
|
+
if (versions.length > 0) {
|
|
262
|
+
$$renderer.push("<!--[0-->");
|
|
263
|
+
$$renderer.push(`<div class="inline-flex w-full overflow-hidden rounded-md border border-border text-xs" role="tablist"${$.attr("aria-label", version_filter_all())}><button type="button" role="tab"${$.attr("aria-selected", true)}${$.attr_class(`flex-1 px-2 py-1 transition-colors bg-primary text-primary-foreground`)}>${$.escape(version_filter_all())} (${$.escape(versions.length)})</button> <button type="button" role="tab"${$.attr("aria-selected", false)}${$.attr_class(`flex-1 px-2 py-1 transition-colors bg-background text-muted-foreground hover:bg-accent`)}>${$.escape(version_filter_snapshots())} (${$.escape(snapshotCount())})</button></div>`);
|
|
264
|
+
} else $$renderer.push("<!--[-1-->");
|
|
265
|
+
$$renderer.push(`<!--]--> `);
|
|
266
|
+
if (loading) {
|
|
267
|
+
$$renderer.push("<!--[0-->");
|
|
268
|
+
$$renderer.push(`<div class="flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground">`);
|
|
269
|
+
Loader_circle($$renderer, { class: "h-3.5 w-3.5 animate-spin" });
|
|
270
|
+
$$renderer.push(`<!----> <span>${$.escape(action_loading())}</span></div>`);
|
|
271
|
+
} else if (loadError) {
|
|
272
|
+
$$renderer.push("<!--[1-->");
|
|
273
|
+
$$renderer.push(`<p class="py-4 text-center text-xs text-destructive">${$.escape(loadError)}</p>`);
|
|
274
|
+
} else if (visibleVersions().length === 0) {
|
|
275
|
+
$$renderer.push("<!--[2-->");
|
|
276
|
+
$$renderer.push(`<p class="py-4 text-center text-xs text-muted-foreground">${$.escape(version_history_empty())}</p>`);
|
|
277
|
+
} else {
|
|
278
|
+
$$renderer.push("<!--[-1-->");
|
|
279
|
+
$$renderer.push(`<div class="flex flex-col gap-1 overflow-y-auto max-h-80"><!--[-->`);
|
|
280
|
+
const each_array = $.ensure_array_like(visibleVersions());
|
|
281
|
+
for (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) {
|
|
282
|
+
let version = each_array[$$index];
|
|
283
|
+
$$renderer.push(`<div class="flex items-start gap-3 rounded-md border border-border p-3 text-sm hover:bg-accent transition-colors">`);
|
|
284
|
+
if (version.isSnapshot) {
|
|
285
|
+
$$renderer.push("<!--[0-->");
|
|
286
|
+
Star($$renderer, {
|
|
287
|
+
class: "mt-0.5 h-3.5 w-3.5 shrink-0 fill-amber-400 text-amber-500",
|
|
288
|
+
"aria-label": version_badge_snapshot()
|
|
289
|
+
});
|
|
290
|
+
} else {
|
|
291
|
+
$$renderer.push("<!--[-1-->");
|
|
292
|
+
Clock($$renderer, { class: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" });
|
|
293
|
+
}
|
|
294
|
+
$$renderer.push(`<!--]--> <div class="flex-1 min-w-0"><div class="flex items-center justify-between gap-2"><div class="flex flex-col gap-0.5 min-w-0">`);
|
|
295
|
+
if (version.label) {
|
|
296
|
+
$$renderer.push("<!--[0-->");
|
|
297
|
+
$$renderer.push(`<span class="truncate text-xs font-medium text-foreground"${$.attr("title", version.label)}>${$.escape(version.label)}</span>`);
|
|
298
|
+
} else $$renderer.push("<!--[-1-->");
|
|
299
|
+
$$renderer.push(`<!--]--> <span class="text-xs text-muted-foreground">${$.escape(relativeTime(version.createdAt))}</span></div> <button type="button" class="inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-background hover:text-foreground transition-colors"${$.attr("title", version_restore())}${$.attr("aria-label", version_restore())}>`);
|
|
300
|
+
Rotate_ccw($$renderer, { class: "h-3 w-3" });
|
|
301
|
+
$$renderer.push(`<!----> ${$.escape(version_restore_short())}</button></div> `);
|
|
302
|
+
if (version.isSnapshot) {
|
|
303
|
+
$$renderer.push("<!--[0-->");
|
|
304
|
+
$$renderer.push(`<div class="mt-1 flex flex-wrap items-center gap-1"><span class="inline-flex items-center gap-1 rounded-full bg-amber-100 px-2 py-0.5 text-[10px] font-medium text-amber-800 dark:bg-amber-900/30 dark:text-amber-300">`);
|
|
305
|
+
Star($$renderer, { class: "h-2.5 w-2.5" });
|
|
306
|
+
$$renderer.push(`<!----> ${$.escape(version_badge_snapshot())}</span> `);
|
|
307
|
+
if (version.description) {
|
|
308
|
+
$$renderer.push("<!--[0-->");
|
|
309
|
+
$$renderer.push(`<span class="truncate text-[11px] text-muted-foreground"${$.attr("title", version.description)}>${$.escape(version.description)}</span>`);
|
|
310
|
+
} else $$renderer.push("<!--[-1-->");
|
|
311
|
+
$$renderer.push(`<!--]--></div>`);
|
|
312
|
+
} else $$renderer.push("<!--[-1-->");
|
|
313
|
+
$$renderer.push(`<!--]--> `);
|
|
314
|
+
if (version.restoredFrom) {
|
|
315
|
+
$$renderer.push("<!--[0-->");
|
|
316
|
+
$$renderer.push(`<div class="mt-1 inline-flex items-center gap-1 text-[11px] text-muted-foreground">`);
|
|
317
|
+
Circle_check($$renderer, { class: "h-3 w-3" });
|
|
318
|
+
$$renderer.push(`<!----> ${$.escape(version_restored_from())} <code class="rounded bg-muted px-1 font-mono text-[10px]">${$.escape(findVersionLabel(version.restoredFrom) ?? "—")}</code></div>`);
|
|
319
|
+
} else $$renderer.push("<!--[-1-->");
|
|
320
|
+
$$renderer.push(`<!--]--> <p class="mt-1 truncate text-xs text-muted-foreground"${$.attr("title", previewFromContent(version.content))}>${$.escape(previewFromContent(version.content))}</p></div></div>`);
|
|
321
|
+
}
|
|
322
|
+
$$renderer.push(`<!--]--></div>`);
|
|
323
|
+
}
|
|
324
|
+
$$renderer.push(`<!--]--></div> `);
|
|
325
|
+
ConfirmDialog($$renderer, {
|
|
326
|
+
title: version_restore(),
|
|
327
|
+
description: restoreDialogDescription(),
|
|
328
|
+
confirmLabel: version_restore_short(),
|
|
329
|
+
cancelLabel: action_cancel(),
|
|
330
|
+
variant: "default",
|
|
331
|
+
busy: restoring,
|
|
332
|
+
onConfirm: confirmRestore,
|
|
333
|
+
onCancel: cancelRestore,
|
|
334
|
+
get open() {
|
|
335
|
+
return restoreDialogOpen;
|
|
336
|
+
},
|
|
337
|
+
set open($$value) {
|
|
338
|
+
restoreDialogOpen = $$value;
|
|
339
|
+
$$settled = false;
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
$$renderer.push(`<!----> `);
|
|
343
|
+
if (restoreError) {
|
|
344
|
+
$$renderer.push("<!--[0-->");
|
|
345
|
+
$$renderer.push(`<p class="sr-only" role="alert">${$.escape(restoreError)}</p>`);
|
|
346
|
+
} else $$renderer.push("<!--[-1-->");
|
|
347
|
+
$$renderer.push(`<!--]--> `);
|
|
348
|
+
CreateSnapshotDialog($$renderer, {
|
|
349
|
+
documentId,
|
|
350
|
+
onSuccess: handleSnapshotCreated,
|
|
351
|
+
get open() {
|
|
352
|
+
return snapshotDialogOpen;
|
|
353
|
+
},
|
|
354
|
+
set open($$value) {
|
|
355
|
+
snapshotDialogOpen = $$value;
|
|
356
|
+
$$settled = false;
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
$$renderer.push(`<!---->`);
|
|
360
|
+
}
|
|
361
|
+
do {
|
|
362
|
+
$$settled = true;
|
|
363
|
+
$$inner_renderer = $$renderer.copy();
|
|
364
|
+
$$render_inner($$inner_renderer);
|
|
365
|
+
} while (!$$settled);
|
|
366
|
+
$$renderer.subsume($$inner_renderer);
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
//#endregion
|
|
370
|
+
export { VersionHistory };
|