@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,80 @@
|
|
|
1
|
+
import { t as Icon } from "./Icon-B0Zqppjo.js";
|
|
2
|
+
import * as $ from "svelte/internal/server";
|
|
3
|
+
//#region ../node_modules/.bun/lucide-svelte@1.0.1+ff5f301bb2db9a0d/node_modules/lucide-svelte/dist/icons/folder.svelte
|
|
4
|
+
function Folder($$renderer, $$props) {
|
|
5
|
+
const $$sanitized_props = $.sanitize_props($$props);
|
|
6
|
+
/**
|
|
7
|
+
* @license lucide-svelte v1.0.1 - ISC
|
|
8
|
+
*
|
|
9
|
+
* ISC License
|
|
10
|
+
*
|
|
11
|
+
* Copyright (c) 2026 Lucide Icons and Contributors
|
|
12
|
+
*
|
|
13
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
14
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
15
|
+
* copyright notice and this permission notice appear in all copies.
|
|
16
|
+
*
|
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
18
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
19
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
20
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
21
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
22
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
23
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
24
|
+
*
|
|
25
|
+
* ---
|
|
26
|
+
*
|
|
27
|
+
* The following Lucide icons are derived from the Feather project:
|
|
28
|
+
*
|
|
29
|
+
* 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
|
|
30
|
+
*
|
|
31
|
+
* The MIT License (MIT) (for the icons listed above)
|
|
32
|
+
*
|
|
33
|
+
* Copyright (c) 2013-present Cole Bemis
|
|
34
|
+
*
|
|
35
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
36
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
37
|
+
* in the Software without restriction, including without limitation the rights
|
|
38
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
39
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
40
|
+
* furnished to do so, subject to the following conditions:
|
|
41
|
+
*
|
|
42
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
43
|
+
* copies or substantial portions of the Software.
|
|
44
|
+
*
|
|
45
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
46
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
47
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
48
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
49
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
50
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
51
|
+
* SOFTWARE.
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
54
|
+
Icon($$renderer, $.spread_props([
|
|
55
|
+
{ name: "folder" },
|
|
56
|
+
$$sanitized_props,
|
|
57
|
+
{
|
|
58
|
+
/**
|
|
59
|
+
* @component @name Folder
|
|
60
|
+
* @description Lucide SVG icon component, renders SVG Element with children.
|
|
61
|
+
*
|
|
62
|
+
* @preview  - https://lucide.dev/icons/folder
|
|
63
|
+
* @see https://lucide.dev/guide/packages/lucide-svelte - Documentation
|
|
64
|
+
*
|
|
65
|
+
* @param {Object} props - Lucide icons props and any valid SVG attribute
|
|
66
|
+
* @returns {FunctionalComponent} Svelte component
|
|
67
|
+
*
|
|
68
|
+
*/
|
|
69
|
+
iconNode: [["path", { "d": "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" }]],
|
|
70
|
+
children: ($$renderer) => {
|
|
71
|
+
$$renderer.push(`<!--[-->`);
|
|
72
|
+
$.slot($$renderer, $$props, "default", {}, null);
|
|
73
|
+
$$renderer.push(`<!--]-->`);
|
|
74
|
+
},
|
|
75
|
+
$$slots: { default: true }
|
|
76
|
+
}
|
|
77
|
+
]));
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
export { Folder as t };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { n as apiFetch } from "./client-DZMkDkDn.js";
|
|
2
|
+
//#region src/lib/api/folders.ts
|
|
3
|
+
function toFolder(f) {
|
|
4
|
+
return {
|
|
5
|
+
id: f.id,
|
|
6
|
+
name: f.name,
|
|
7
|
+
parentId: f.parentId,
|
|
8
|
+
categoryId: f.categoryId ?? null,
|
|
9
|
+
order: f.order ?? 0,
|
|
10
|
+
documentCount: f.documentCount ?? 0,
|
|
11
|
+
subfolderCount: f.subfolderCount ?? 0,
|
|
12
|
+
children: [],
|
|
13
|
+
documents: [],
|
|
14
|
+
createdAt: f.createdAt,
|
|
15
|
+
updatedAt: f.updatedAt
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function toDocument(d, folderName = "") {
|
|
19
|
+
const content = d.content ?? "";
|
|
20
|
+
return {
|
|
21
|
+
id: d.id,
|
|
22
|
+
title: d.title,
|
|
23
|
+
content,
|
|
24
|
+
folderId: d.folderId,
|
|
25
|
+
folderName,
|
|
26
|
+
tags: [],
|
|
27
|
+
createdAt: d.createdAt,
|
|
28
|
+
updatedAt: d.updatedAt,
|
|
29
|
+
excerpt: content.length > 200 ? `${content.slice(0, 200)}…` : content
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** Get a single folder by ID. Backend: `GET /api/folders/:id`. */
|
|
33
|
+
async function getFolder(id, fetcher) {
|
|
34
|
+
const data = await apiFetch(`/api/folders/${encodeURIComponent(id)}`, {}, fetcher);
|
|
35
|
+
const folder = toFolder(data);
|
|
36
|
+
if (data.children) folder.children = data.children.map(toFolder);
|
|
37
|
+
if (data.documents) folder.documents = data.documents.map((d) => toDocument(d));
|
|
38
|
+
return folder;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* List folders under a given parent.
|
|
42
|
+
*
|
|
43
|
+
* - `listFolders(null)` returns a single-element array whose first element is a
|
|
44
|
+
* synthetic root folder whose `children` are the user's top-level folders.
|
|
45
|
+
* This matches the contract that `FolderTree.svelte` depends on
|
|
46
|
+
* (`result[0].children`).
|
|
47
|
+
* - `listFolders(parentId)` returns the flat immediate children of `parentId`.
|
|
48
|
+
*
|
|
49
|
+
* The backend returns flat rows keyed by `parentId`; the tree shape is
|
|
50
|
+
* composed client-side.
|
|
51
|
+
*/
|
|
52
|
+
async function listFolders(parentId = null, all = false, fetcher) {
|
|
53
|
+
const params = new URLSearchParams();
|
|
54
|
+
if (parentId) params.append("parentId", parentId);
|
|
55
|
+
if (all) params.append("all", "true");
|
|
56
|
+
const folders = (await apiFetch(`/api/folders${params.toString() ? `?${params.toString()}` : ""}`, {}, fetcher)).map(toFolder);
|
|
57
|
+
if (parentId === null && !all) {
|
|
58
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
59
|
+
return [{
|
|
60
|
+
id: "root",
|
|
61
|
+
name: "Workspace",
|
|
62
|
+
parentId: null,
|
|
63
|
+
order: 0,
|
|
64
|
+
documentCount: 0,
|
|
65
|
+
subfolderCount: 0,
|
|
66
|
+
children: folders,
|
|
67
|
+
documents: [],
|
|
68
|
+
createdAt: now,
|
|
69
|
+
updatedAt: now
|
|
70
|
+
}];
|
|
71
|
+
}
|
|
72
|
+
return folders;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Get the breadcrumb path from the workspace root down to the given folder.
|
|
76
|
+
*
|
|
77
|
+
* Walks up the parent chain via repeated `GET /api/folders/:id` calls and
|
|
78
|
+
* reverses the collected ancestors so the returned array is ordered
|
|
79
|
+
* root-first. Includes a cycle guard so a malformed parent chain cannot loop
|
|
80
|
+
* forever.
|
|
81
|
+
*/
|
|
82
|
+
async function getFolderPath(folderId, fetcher) {
|
|
83
|
+
const path = [];
|
|
84
|
+
const visited = /* @__PURE__ */ new Set();
|
|
85
|
+
let currentId = folderId;
|
|
86
|
+
while (currentId && !visited.has(currentId)) {
|
|
87
|
+
visited.add(currentId);
|
|
88
|
+
const folder = await apiFetch(`/api/folders/${encodeURIComponent(currentId)}`, {}, fetcher);
|
|
89
|
+
path.unshift({
|
|
90
|
+
id: folder.id,
|
|
91
|
+
name: folder.name
|
|
92
|
+
});
|
|
93
|
+
currentId = folder.parentId;
|
|
94
|
+
}
|
|
95
|
+
return path;
|
|
96
|
+
}
|
|
97
|
+
/** Create a new folder. Backend: `POST /api/folders`. */
|
|
98
|
+
async function createFolder(data) {
|
|
99
|
+
return toFolder(await apiFetch("/api/folders", {
|
|
100
|
+
method: "POST",
|
|
101
|
+
body: JSON.stringify(data)
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
/** Update a folder (rename or move). Backend: `PATCH /api/folders/:id`. */
|
|
105
|
+
async function updateFolder(id, data) {
|
|
106
|
+
return toFolder(await apiFetch(`/api/folders/${encodeURIComponent(id)}`, {
|
|
107
|
+
method: "PATCH",
|
|
108
|
+
body: JSON.stringify(data)
|
|
109
|
+
}));
|
|
110
|
+
}
|
|
111
|
+
/** Delete a folder. Backend: `DELETE /api/folders/:id`. */
|
|
112
|
+
async function deleteFolder(id) {
|
|
113
|
+
await apiFetch(`/api/folders/${encodeURIComponent(id)}`, { method: "DELETE" });
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Duplicate a document. The new copy is suffixed with ` (Copy)` on the title.
|
|
117
|
+
* Backend: `POST /api/documents/:id/duplicate`.
|
|
118
|
+
*/
|
|
119
|
+
async function duplicateDocument(docId) {
|
|
120
|
+
return toDocument(await apiFetch(`/api/documents/${encodeURIComponent(docId)}/duplicate`, { method: "POST" }));
|
|
121
|
+
}
|
|
122
|
+
/** Delete a document. Backend: `DELETE /api/documents/:id`. */
|
|
123
|
+
async function deleteDocument(docId) {
|
|
124
|
+
await apiFetch(`/api/documents/${encodeURIComponent(docId)}`, { method: "DELETE" });
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
export { getFolder as a, updateFolder as c, duplicateDocument as i, deleteDocument as n, getFolderPath as o, deleteFolder as r, listFolders as s, createFolder as t };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { n as getSession } from "./auth-client-x26kqY8Z.js";
|
|
2
|
+
//#region src/lib/offline/identity.ts
|
|
3
|
+
var OWNER_ID_CACHE_KEY = "hiai-docs:offline-owner-id";
|
|
4
|
+
var OFFLINE_BINDING_KEY = "hiai-docs:offline-binding";
|
|
5
|
+
var OFFLINE_ACCESS_KEY = "hiai-docs:offline-access-enabled";
|
|
6
|
+
var MAX_BINDING_AGE_MS = 10080 * 60 * 1e3;
|
|
7
|
+
function config() {
|
|
8
|
+
return {
|
|
9
|
+
appId: "hiai-docs",
|
|
10
|
+
deploymentId: "hiai-docs-pwa-local"
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function isNetworkFailure(error) {
|
|
14
|
+
return error instanceof TypeError || typeof navigator !== "undefined" && !navigator.onLine;
|
|
15
|
+
}
|
|
16
|
+
function offlineAccessEnabled() {
|
|
17
|
+
return typeof localStorage !== "undefined" && localStorage.getItem(OFFLINE_ACCESS_KEY) === "1";
|
|
18
|
+
}
|
|
19
|
+
function enableOfflineAccess(identity) {
|
|
20
|
+
if (typeof localStorage === "undefined") return;
|
|
21
|
+
localStorage.setItem(OFFLINE_ACCESS_KEY, "1");
|
|
22
|
+
localStorage.setItem(OFFLINE_BINDING_KEY, JSON.stringify({
|
|
23
|
+
identity,
|
|
24
|
+
verifiedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
function disableOfflineAccess() {
|
|
28
|
+
if (typeof localStorage === "undefined") return;
|
|
29
|
+
localStorage.removeItem(OFFLINE_ACCESS_KEY);
|
|
30
|
+
localStorage.removeItem(OFFLINE_BINDING_KEY);
|
|
31
|
+
localStorage.removeItem(OWNER_ID_CACHE_KEY);
|
|
32
|
+
}
|
|
33
|
+
function readBinding() {
|
|
34
|
+
if (!offlineAccessEnabled() || typeof localStorage === "undefined") return null;
|
|
35
|
+
try {
|
|
36
|
+
const value = JSON.parse(localStorage.getItem(OFFLINE_BINDING_KEY) ?? "null");
|
|
37
|
+
if (!value?.identity?.ownerId || !value.verifiedAt) return null;
|
|
38
|
+
if (Date.now() - Date.parse(value.verifiedAt) > MAX_BINDING_AGE_MS) return null;
|
|
39
|
+
return {
|
|
40
|
+
identity: value.identity,
|
|
41
|
+
verifiedAt: value.verifiedAt
|
|
42
|
+
};
|
|
43
|
+
} catch {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Build the IndexedDB database name for a given identity. The name encodes
|
|
49
|
+
* every scoping dimension so two different users (or deployments) never
|
|
50
|
+
* share the same on-disk database.
|
|
51
|
+
*/
|
|
52
|
+
function offlineDbName(identity) {
|
|
53
|
+
return `hiai-docs-offline::${identity.appId}::${identity.deploymentId}::${identity.ownerId}::${identity.tenantId ?? "none"}`;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Resolve the current offline identity from the environment and the active
|
|
57
|
+
* Better Auth session.
|
|
58
|
+
*
|
|
59
|
+
* `getSession()` is async, so this function is async too (the plan's sync
|
|
60
|
+
* signature is adjusted because the session is only available via an
|
|
61
|
+
* async call). When offline (or not yet authenticated) we fall back to a
|
|
62
|
+
* locally cached owner id so the DB can still be scoped consistently.
|
|
63
|
+
*/
|
|
64
|
+
async function resolveOfflineIdentityResolution() {
|
|
65
|
+
const { appId, deploymentId } = config();
|
|
66
|
+
try {
|
|
67
|
+
const { data } = await getSession();
|
|
68
|
+
if (!data?.user?.id) {
|
|
69
|
+
disableOfflineAccess();
|
|
70
|
+
return { kind: "verified-unauthenticated" };
|
|
71
|
+
}
|
|
72
|
+
const identity = {
|
|
73
|
+
appId,
|
|
74
|
+
deploymentId,
|
|
75
|
+
ownerId: data.user.id,
|
|
76
|
+
tenantId: void 0
|
|
77
|
+
};
|
|
78
|
+
if (typeof localStorage !== "undefined") localStorage.setItem(OWNER_ID_CACHE_KEY, identity.ownerId);
|
|
79
|
+
if (offlineAccessEnabled()) enableOfflineAccess(identity);
|
|
80
|
+
return {
|
|
81
|
+
kind: "verified-authenticated",
|
|
82
|
+
identity
|
|
83
|
+
};
|
|
84
|
+
} catch (error) {
|
|
85
|
+
const binding = isNetworkFailure(error) ? readBinding() : null;
|
|
86
|
+
return binding ? {
|
|
87
|
+
kind: "offline-bound",
|
|
88
|
+
...binding
|
|
89
|
+
} : { kind: "unavailable" };
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/** Resolve a usable partition; never returns an anonymous or stale owner. */
|
|
93
|
+
async function resolveOfflineIdentity() {
|
|
94
|
+
const result = await resolveOfflineIdentityResolution();
|
|
95
|
+
if (result.kind === "verified-authenticated" || result.kind === "offline-bound") return result.identity;
|
|
96
|
+
throw new Error("Offline identity unavailable");
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
export { resolveOfflineIdentity as a, offlineDbName as i, enableOfflineAccess as n, resolveOfflineIdentityResolution as o, offlineAccessEnabled as r, disableOfflineAccess as t };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { t as cn } from "./utils-DtlPPXpJ.js";
|
|
2
|
+
import * as $ from "svelte/internal/server";
|
|
3
|
+
//#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.0.8+3149ccaa93f654b8/node_modules/@hiai-gg/hiai-ui/dist/components/ui/input/input.svelte
|
|
4
|
+
function Input($$renderer, $$props) {
|
|
5
|
+
$$renderer.component(($$renderer) => {
|
|
6
|
+
let { ref = null, class: className, value = "", $$slots, $$events, ...restProps } = $$props;
|
|
7
|
+
$$renderer.push(`<input${$.attributes({
|
|
8
|
+
value,
|
|
9
|
+
class: $.clsx(cn("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", className)),
|
|
10
|
+
...restProps
|
|
11
|
+
}, void 0, void 0, void 0, 4)}/>`);
|
|
12
|
+
$.bind_props($$props, {
|
|
13
|
+
ref,
|
|
14
|
+
value
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { Input as t };
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import "svelte/internal/server";
|
|
2
|
+
//#region src/lib/stores/keyboard.svelte.ts
|
|
3
|
+
var isQuickSearchOpen = false;
|
|
4
|
+
var isShortcutHelpOpen = false;
|
|
5
|
+
var keyboardRegistry = /* @__PURE__ */ new Map();
|
|
6
|
+
var MODIFIER_ORDER = [
|
|
7
|
+
"mod",
|
|
8
|
+
"ctrl",
|
|
9
|
+
"alt",
|
|
10
|
+
"shift",
|
|
11
|
+
"meta"
|
|
12
|
+
];
|
|
13
|
+
function normaliseKeys(keys) {
|
|
14
|
+
const tokens = keys.split("+").map((t) => t.trim().toLowerCase()).filter(Boolean).map((t) => {
|
|
15
|
+
if (t === "cmd" || t === "meta") return "mod";
|
|
16
|
+
if (t === "esc") return "escape";
|
|
17
|
+
if (t === "slash") return "/";
|
|
18
|
+
if (t === "question") return "?";
|
|
19
|
+
return t;
|
|
20
|
+
});
|
|
21
|
+
const mods = [];
|
|
22
|
+
let key = "";
|
|
23
|
+
for (const token of tokens) if (MODIFIER_ORDER.includes(token)) {
|
|
24
|
+
if (!mods.includes(token)) mods.push(token);
|
|
25
|
+
} else key = token;
|
|
26
|
+
mods.sort((a, b) => MODIFIER_ORDER.indexOf(a) - MODIFIER_ORDER.indexOf(b));
|
|
27
|
+
return [...mods, key].filter(Boolean).join("+");
|
|
28
|
+
}
|
|
29
|
+
/** True when the event target is a text-entry element we should ignore. */
|
|
30
|
+
function isEditableTarget(target) {
|
|
31
|
+
if (!(target instanceof HTMLElement)) return false;
|
|
32
|
+
if (target.isContentEditable) return true;
|
|
33
|
+
const tag = target.tagName;
|
|
34
|
+
if (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT") return true;
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
/** True when the given KeyboardEvent matches the normalised key combo. */
|
|
38
|
+
function eventMatches(event, normalised) {
|
|
39
|
+
const parts = normalised.split("+");
|
|
40
|
+
if (parts.length === 0) return false;
|
|
41
|
+
const key = parts[parts.length - 1];
|
|
42
|
+
if (!key) return false;
|
|
43
|
+
if ([
|
|
44
|
+
"shift",
|
|
45
|
+
"ctrl",
|
|
46
|
+
"alt",
|
|
47
|
+
"meta",
|
|
48
|
+
"mod"
|
|
49
|
+
].includes(key)) return false;
|
|
50
|
+
const wantMod = parts.includes("mod");
|
|
51
|
+
const wantCtrl = parts.includes("ctrl");
|
|
52
|
+
const wantAlt = parts.includes("alt");
|
|
53
|
+
const wantShift = parts.includes("shift");
|
|
54
|
+
const wantMeta = parts.includes("meta");
|
|
55
|
+
const modOk = wantMod ? event.ctrlKey || event.metaKey : !event.ctrlKey && !event.metaKey;
|
|
56
|
+
const ctrlOk = wantCtrl === event.ctrlKey;
|
|
57
|
+
const altOk = wantAlt === event.altKey;
|
|
58
|
+
const shiftOk = wantShift === event.shiftKey;
|
|
59
|
+
const metaOk = wantMeta === event.metaKey;
|
|
60
|
+
if (!(modOk && ctrlOk && altOk && shiftOk && metaOk)) return false;
|
|
61
|
+
return event.key.toLowerCase() === key;
|
|
62
|
+
}
|
|
63
|
+
function registerShortcut(shortcut) {
|
|
64
|
+
if (!shortcut.id) return;
|
|
65
|
+
const normalised = {
|
|
66
|
+
...shortcut,
|
|
67
|
+
keys: normaliseKeys(shortcut.keys),
|
|
68
|
+
scope: shortcut.scope ?? "global",
|
|
69
|
+
enabled: shortcut.enabled ?? true
|
|
70
|
+
};
|
|
71
|
+
keyboardRegistry.set(shortcut.id, normalised);
|
|
72
|
+
}
|
|
73
|
+
function unregisterShortcut(id) {
|
|
74
|
+
keyboardRegistry.delete(id);
|
|
75
|
+
}
|
|
76
|
+
function getShortcut(id) {
|
|
77
|
+
return keyboardRegistry.get(id);
|
|
78
|
+
}
|
|
79
|
+
function getShortcutsByScope(scope) {
|
|
80
|
+
const result = [];
|
|
81
|
+
for (const shortcut of keyboardRegistry.values()) if ((shortcut.scope ?? "global") === scope) result.push(shortcut);
|
|
82
|
+
return result;
|
|
83
|
+
}
|
|
84
|
+
function clearShortcuts() {
|
|
85
|
+
keyboardRegistry.clear();
|
|
86
|
+
}
|
|
87
|
+
function toggleQuickSearch() {
|
|
88
|
+
isQuickSearchOpen = !isQuickSearchOpen;
|
|
89
|
+
}
|
|
90
|
+
function setQuickSearchOpen(open) {
|
|
91
|
+
isQuickSearchOpen = open;
|
|
92
|
+
}
|
|
93
|
+
function toggleShortcutHelp() {
|
|
94
|
+
isShortcutHelpOpen = !isShortcutHelpOpen;
|
|
95
|
+
}
|
|
96
|
+
function setShortcutHelpOpen(open) {
|
|
97
|
+
isShortcutHelpOpen = open;
|
|
98
|
+
}
|
|
99
|
+
var defaultsRegistered = false;
|
|
100
|
+
function registerDefaultShortcuts() {
|
|
101
|
+
if (defaultsRegistered) return;
|
|
102
|
+
defaultsRegistered = true;
|
|
103
|
+
registerShortcut({
|
|
104
|
+
id: "quick-search",
|
|
105
|
+
keys: "mod+k",
|
|
106
|
+
description: "Open quick search",
|
|
107
|
+
scope: "global",
|
|
108
|
+
handler: () => toggleQuickSearch(),
|
|
109
|
+
overrideInput: true
|
|
110
|
+
});
|
|
111
|
+
registerShortcut({
|
|
112
|
+
id: "shortcut-help",
|
|
113
|
+
keys: "shift+?",
|
|
114
|
+
description: "Show keyboard shortcuts",
|
|
115
|
+
scope: "global",
|
|
116
|
+
handler: () => toggleShortcutHelp(),
|
|
117
|
+
overrideInput: false
|
|
118
|
+
});
|
|
119
|
+
registerShortcut({
|
|
120
|
+
id: "escape-close",
|
|
121
|
+
keys: "escape",
|
|
122
|
+
description: "Close dialog or panel",
|
|
123
|
+
scope: "global",
|
|
124
|
+
handler: () => {
|
|
125
|
+
if (isQuickSearchOpen) setQuickSearchOpen(false);
|
|
126
|
+
else if (isShortcutHelpOpen) setShortcutHelpOpen(false);
|
|
127
|
+
},
|
|
128
|
+
overrideInput: true
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Match a KeyboardEvent against the registry and invoke the first matching
|
|
133
|
+
* enabled handler. Returns `true` if a handler fired (so callers can
|
|
134
|
+
* `preventDefault()` if they want to stop further propagation).
|
|
135
|
+
*/
|
|
136
|
+
function handleKeyEvent(event) {
|
|
137
|
+
const inEditable = isEditableTarget(event.target);
|
|
138
|
+
for (const shortcut of keyboardRegistry.values()) {
|
|
139
|
+
if (shortcut.enabled === false) continue;
|
|
140
|
+
if (inEditable && !shortcut.overrideInput) continue;
|
|
141
|
+
if (!eventMatches(event, shortcut.keys)) continue;
|
|
142
|
+
try {
|
|
143
|
+
shortcut.handler(event);
|
|
144
|
+
} catch (err) {
|
|
145
|
+
console.error(`[keyboard] handler for "${shortcut.id}" threw`, err);
|
|
146
|
+
}
|
|
147
|
+
return true;
|
|
148
|
+
}
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
function getIsQuickSearchOpen() {
|
|
152
|
+
return isQuickSearchOpen;
|
|
153
|
+
}
|
|
154
|
+
function getIsShortcutHelpOpen() {
|
|
155
|
+
return isShortcutHelpOpen;
|
|
156
|
+
}
|
|
157
|
+
var keyboardStore = {
|
|
158
|
+
get isQuickSearchOpen() {
|
|
159
|
+
return isQuickSearchOpen;
|
|
160
|
+
},
|
|
161
|
+
get isShortcutHelpOpen() {
|
|
162
|
+
return isShortcutHelpOpen;
|
|
163
|
+
},
|
|
164
|
+
toggleQuickSearch,
|
|
165
|
+
setQuickSearchOpen,
|
|
166
|
+
toggleShortcutHelp,
|
|
167
|
+
setShortcutHelpOpen,
|
|
168
|
+
register: registerShortcut,
|
|
169
|
+
unregister: unregisterShortcut,
|
|
170
|
+
getShortcutsByScope,
|
|
171
|
+
handleKeyEvent
|
|
172
|
+
};
|
|
173
|
+
//#endregion
|
|
174
|
+
export { getShortcutsByScope as a, normaliseKeys as c, setQuickSearchOpen as d, setShortcutHelpOpen as f, unregisterShortcut as h, getShortcut as i, registerDefaultShortcuts as l, toggleShortcutHelp as m, getIsQuickSearchOpen as n, handleKeyEvent as o, toggleQuickSearch as p, getIsShortcutHelpOpen as r, keyboardStore as s, clearShortcuts as t, registerShortcut as u };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { t as cn } from "./utils-DtlPPXpJ.js";
|
|
2
|
+
import * as $ from "svelte/internal/server";
|
|
3
|
+
//#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.0.8+3149ccaa93f654b8/node_modules/@hiai-gg/hiai-ui/dist/components/ui/label/label.svelte
|
|
4
|
+
function Label($$renderer, $$props) {
|
|
5
|
+
$$renderer.component(($$renderer) => {
|
|
6
|
+
let { ref = null, class: className, children, $$slots, $$events, ...restProps } = $$props;
|
|
7
|
+
$$renderer.push(`<label${$.attributes({
|
|
8
|
+
class: $.clsx(cn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", className)),
|
|
9
|
+
...restProps
|
|
10
|
+
})}>`);
|
|
11
|
+
if (children) {
|
|
12
|
+
$$renderer.push("<!--[0-->");
|
|
13
|
+
children($$renderer);
|
|
14
|
+
$$renderer.push(`<!---->`);
|
|
15
|
+
} else $$renderer.push("<!--[-1-->");
|
|
16
|
+
$$renderer.push(`<!--]--></label>`);
|
|
17
|
+
$.bind_props($$props, { ref });
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Label as t };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { t as Icon } from "./Icon-B0Zqppjo.js";
|
|
2
|
+
import * as $ from "svelte/internal/server";
|
|
3
|
+
//#region ../node_modules/.bun/lucide-svelte@1.0.1+ff5f301bb2db9a0d/node_modules/lucide-svelte/dist/icons/loader-circle.svelte
|
|
4
|
+
function Loader_circle($$renderer, $$props) {
|
|
5
|
+
const $$sanitized_props = $.sanitize_props($$props);
|
|
6
|
+
/**
|
|
7
|
+
* @license lucide-svelte v1.0.1 - ISC
|
|
8
|
+
*
|
|
9
|
+
* ISC License
|
|
10
|
+
*
|
|
11
|
+
* Copyright (c) 2026 Lucide Icons and Contributors
|
|
12
|
+
*
|
|
13
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
14
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
15
|
+
* copyright notice and this permission notice appear in all copies.
|
|
16
|
+
*
|
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
18
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
19
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
20
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
21
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
22
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
23
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
24
|
+
*
|
|
25
|
+
* ---
|
|
26
|
+
*
|
|
27
|
+
* The following Lucide icons are derived from the Feather project:
|
|
28
|
+
*
|
|
29
|
+
* 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
|
|
30
|
+
*
|
|
31
|
+
* The MIT License (MIT) (for the icons listed above)
|
|
32
|
+
*
|
|
33
|
+
* Copyright (c) 2013-present Cole Bemis
|
|
34
|
+
*
|
|
35
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
36
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
37
|
+
* in the Software without restriction, including without limitation the rights
|
|
38
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
39
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
40
|
+
* furnished to do so, subject to the following conditions:
|
|
41
|
+
*
|
|
42
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
43
|
+
* copies or substantial portions of the Software.
|
|
44
|
+
*
|
|
45
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
46
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
47
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
48
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
49
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
50
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
51
|
+
* SOFTWARE.
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
54
|
+
Icon($$renderer, $.spread_props([
|
|
55
|
+
{ name: "loader-circle" },
|
|
56
|
+
$$sanitized_props,
|
|
57
|
+
{
|
|
58
|
+
/**
|
|
59
|
+
* @component @name LoaderCircle
|
|
60
|
+
* @description Lucide SVG icon component, renders SVG Element with children.
|
|
61
|
+
*
|
|
62
|
+
* @preview  - https://lucide.dev/icons/loader-circle
|
|
63
|
+
* @see https://lucide.dev/guide/packages/lucide-svelte - Documentation
|
|
64
|
+
*
|
|
65
|
+
* @param {Object} props - Lucide icons props and any valid SVG attribute
|
|
66
|
+
* @returns {FunctionalComponent} Svelte component
|
|
67
|
+
*
|
|
68
|
+
*/
|
|
69
|
+
iconNode: [["path", { "d": "M21 12a9 9 0 1 1-6.219-8.56" }]],
|
|
70
|
+
children: ($$renderer) => {
|
|
71
|
+
$$renderer.push(`<!--[-->`);
|
|
72
|
+
$.slot($$renderer, $$props, "default", {}, null);
|
|
73
|
+
$$renderer.push(`<!--]-->`);
|
|
74
|
+
},
|
|
75
|
+
$$slots: { default: true }
|
|
76
|
+
}
|
|
77
|
+
]));
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
export { Loader_circle as t };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { r as editorExtensions } from "./editorExtensions-DUzwndMy.js";
|
|
2
|
+
import { MarkdownManager } from "@tiptap/markdown";
|
|
3
|
+
//#region src/lib/components/editor/markdown.ts
|
|
4
|
+
var managerSingleton = null;
|
|
5
|
+
function getManager() {
|
|
6
|
+
if (managerSingleton) return managerSingleton;
|
|
7
|
+
managerSingleton = new MarkdownManager({ extensions: editorExtensions });
|
|
8
|
+
return managerSingleton;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Parse a markdown string into a ProseMirror document matching the
|
|
12
|
+
* HiAiEditor schema. Returns `{ type: "doc", content: [...] }`.
|
|
13
|
+
*
|
|
14
|
+
* Browser-only: relies on `window.DOMParser` inside `generateJSON`.
|
|
15
|
+
*/
|
|
16
|
+
function markdownToJson(markdown) {
|
|
17
|
+
return getManager().parse(markdown);
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { markdownToJson as t };
|