@hiai-gg/docsmint 2.1.1 → 2.1.3
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/README.md +4 -0
- package/dist/backend/index.js +132 -48
- package/dist/backend-account-runtime-cleanup.js +17 -1
- package/dist/frontend/{HiAiEditor-BQERr-cd.js → HiAiEditor-BHz46Iqd.js} +45 -44
- package/dist/frontend/collaboration.js +3 -1
- package/dist/frontend/components/editor/compact-editor.js +1 -1
- package/dist/frontend/components/editor/document-editor.js +1 -1
- package/dist/frontend/components/version-history.js +235 -166
- package/dist/frontend-ssr/assets/{HiAiEditor-DeHWAIj-.js → HiAiEditor-BQGlGd3z.js} +13 -14
- package/dist/frontend-ssr/collaboration.js +3 -1
- package/dist/frontend-ssr/components/editor/compact-editor.js +1 -1
- package/dist/frontend-ssr/components/editor/document-editor.js +1 -1
- package/dist/frontend-ssr/components/version-history.js +52 -8
- package/dist/mcp-cli.js +1 -1
- package/dist/mcp-server.js +1 -1
- package/package.json +1 -1
- package/packages/cli/src/index.ts +1 -1
- package/server.json +2 -2
|
@@ -8,18 +8,19 @@ import { t as o } from "../action_cancel-BdsWzQKU.js";
|
|
|
8
8
|
import { t as s } from "../action_loading-iQ0KsN6i.js";
|
|
9
9
|
import { t as c } from "../error_generic-BlWqOE-a.js";
|
|
10
10
|
import { l } from "../version_snapshot_label_placeholder-BhKq1NQ7.js";
|
|
11
|
-
import { a as u, c as d, d as f, f as p, i as m, l as
|
|
12
|
-
import { t as
|
|
13
|
-
import { t as
|
|
14
|
-
import { n as
|
|
15
|
-
import { t as
|
|
16
|
-
import { a as
|
|
11
|
+
import { a as u, c as d, d as f, f as p, i as m, l as ee, n as te, o as h, r as g, s as _, t as ne, u as v } from "../version_restored_from-DYFFSuQj.js";
|
|
12
|
+
import { t as y } from "../version_create_snapshot-D8xjbuCq.js";
|
|
13
|
+
import { t as re } from "../rotate-ccw-DAUX7np7.js";
|
|
14
|
+
import { n as b, t as x } from "../client-BDdDd84W.js";
|
|
15
|
+
import { t as S } from "../CreateSnapshotDialog-BLrtuYs5.js";
|
|
16
|
+
import { a as C } from "../route-context-6OHiGtfb.js";
|
|
17
17
|
import "svelte/internal/disclose-version";
|
|
18
|
-
import * as
|
|
18
|
+
import * as w from "svelte/internal/client";
|
|
19
|
+
import { onDestroy as T } from "svelte";
|
|
19
20
|
import "svelte/internal/flags/legacy";
|
|
20
21
|
// ../node_modules/.bun/lucide-svelte@1.0.1+5d720e49779a0e36/node_modules/lucide-svelte/dist/icons/history.svelte
|
|
21
|
-
function
|
|
22
|
-
let n =
|
|
22
|
+
function E(e, t) {
|
|
23
|
+
let n = w.legacy_rest_props(t, [
|
|
23
24
|
"children",
|
|
24
25
|
"$$slots",
|
|
25
26
|
"$$events",
|
|
@@ -29,269 +30,337 @@ function D(e, t) {
|
|
|
29
30
|
["path", { d: "M3 3v5h5" }],
|
|
30
31
|
["path", { d: "M12 7v5l4 2" }]
|
|
31
32
|
];
|
|
32
|
-
i(e,
|
|
33
|
+
i(e, w.spread_props({ name: "history" }, () => n, {
|
|
33
34
|
get iconNode() {
|
|
34
35
|
return r;
|
|
35
36
|
},
|
|
36
37
|
children: (e, n) => {
|
|
37
|
-
var r =
|
|
38
|
-
|
|
38
|
+
var r = w.comment(), i = w.first_child(r);
|
|
39
|
+
w.slot(i, t, "default", {}, null), w.append(e, r);
|
|
39
40
|
},
|
|
40
41
|
$$slots: { default: !0 }
|
|
41
42
|
}));
|
|
42
43
|
}
|
|
43
44
|
// ../node_modules/.bun/lucide-svelte@1.0.1+5d720e49779a0e36/node_modules/lucide-svelte/dist/icons/star.svelte
|
|
44
|
-
function
|
|
45
|
-
let n =
|
|
45
|
+
function D(e, t) {
|
|
46
|
+
let n = w.legacy_rest_props(t, [
|
|
46
47
|
"children",
|
|
47
48
|
"$$slots",
|
|
48
49
|
"$$events",
|
|
49
50
|
"$$legacy"
|
|
50
51
|
]), r = [["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" }]];
|
|
51
|
-
i(e,
|
|
52
|
+
i(e, w.spread_props({ name: "star" }, () => n, {
|
|
52
53
|
get iconNode() {
|
|
53
54
|
return r;
|
|
54
55
|
},
|
|
55
56
|
children: (e, n) => {
|
|
56
|
-
var r =
|
|
57
|
-
|
|
57
|
+
var r = w.comment(), i = w.first_child(r);
|
|
58
|
+
w.slot(i, t, "default", {}, null), w.append(e, r);
|
|
58
59
|
},
|
|
59
60
|
$$slots: { default: !0 }
|
|
60
61
|
}));
|
|
61
62
|
}
|
|
62
63
|
// src/lib/components/VersionHistory.svelte
|
|
63
|
-
var
|
|
64
|
-
function
|
|
65
|
-
|
|
66
|
-
let
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
var ie = w.from_html("<div class=\"inline-flex w-full overflow-hidden rounded-md border border-border text-xs\" role=\"tablist\"><button type=\"button\" role=\"tab\"> </button> <button type=\"button\" role=\"tab\"> </button></div>"), ae = w.from_html("<p role=\"status\" class=\"text-sm text-muted-foreground\">Opening version…</p>"), oe = w.from_html("<p role=\"alert\" class=\"text-sm text-destructive\"> </p>"), se = w.from_html("<button type=\"button\" class=\"self-start rounded-md border border-border px-3 py-2 text-sm\">Return to current</button>"), ce = w.from_html("<div class=\"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground\"><!> <span> </span></div>"), le = w.from_html("<p class=\"py-4 text-center text-xs text-destructive\"> </p>"), ue = w.from_html("<p class=\"py-4 text-center text-xs text-muted-foreground\"> </p>"), de = w.from_html("<span class=\"truncate text-xs font-medium text-foreground\"> </span>"), fe = w.from_html("<span class=\"truncate text-[11px] text-muted-foreground\"> </span>"), pe = w.from_html("<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\"><!> </span> <!></div>"), me = w.from_html("<div class=\"mt-1 inline-flex items-center gap-1 text-[11px] text-muted-foreground\"><!> <code class=\"rounded bg-muted px-1 font-mono text-[10px]\"> </code></div>"), he = w.from_html("<button type=\"button\" class=\"mt-1 block w-full truncate rounded text-left text-xs text-muted-foreground hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring\"> </button>"), ge = w.from_html("<p class=\"mt-1 truncate text-xs text-muted-foreground\"> </p>"), _e = w.from_html("<div class=\"flex items-start gap-3 rounded-md border border-border p-3 text-sm hover:bg-accent transition-colors\"><!> <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\"><!> <span class=\"text-xs text-muted-foreground\"> </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\"><!> </button></div> <!> <!> <!></div></div>"), ve = w.from_html("<div class=\"flex flex-col gap-1 overflow-y-auto max-h-80\"></div>"), ye = w.from_html("<p class=\"px-4 text-sm text-destructive\" role=\"alert\"> </p>"), be = w.from_html("<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\"><!> <span> </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\"><!> </button></div> <!> <!> <!> <!> <!></div> <!> <!> <!>", 1);
|
|
65
|
+
function O(i, O) {
|
|
66
|
+
w.push(O, !0);
|
|
67
|
+
let xe = w.prop(O, "refreshRevision", 3, 0), k = w.state(w.proxy([])), A = w.state(!0), j = w.state(null), M = w.state("all"), N = w.state(!1), P = w.state(!1), F = w.state(null), I = w.state(!1), L = w.state(null), R = C(), z, B, V = w.state(null), H = w.state(!1), U = w.state(null);
|
|
68
|
+
T(() => {
|
|
69
|
+
z?.abort(), B?.abort();
|
|
70
|
+
});
|
|
71
|
+
async function Se(e) {
|
|
72
|
+
z?.abort();
|
|
73
|
+
let t = new AbortController();
|
|
74
|
+
z = t;
|
|
75
|
+
let n = O.documentId;
|
|
76
|
+
w.set(H, !0), w.set(V, null);
|
|
77
|
+
try {
|
|
78
|
+
let r = await b(`/api/documents/${n}/versions/${e.id}`, { signal: t.signal }, R.fetch);
|
|
79
|
+
if (t.signal.aborted || n !== O.documentId) return;
|
|
80
|
+
w.set(U, e.id, !0), O.onPreview?.(r);
|
|
81
|
+
} catch {
|
|
82
|
+
!t.signal.aborted && n === O.documentId && w.set(V, "Could not open this version. Please try again.");
|
|
83
|
+
} finally {
|
|
84
|
+
z === t && w.set(H, !1);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function W() {
|
|
88
|
+
z?.abort(), w.set(H, !1), w.set(V, null), w.set(U, null), O.onPreview?.(null);
|
|
89
|
+
}
|
|
90
|
+
async function G() {
|
|
91
|
+
B?.abort();
|
|
92
|
+
let e = new AbortController();
|
|
93
|
+
B = e, w.set(A, !0), w.set(j, null);
|
|
69
94
|
try {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
95
|
+
let t = await b(`/api/documents/${O.documentId}/versions`, { signal: e.signal }, R.fetch);
|
|
96
|
+
e.signal.aborted || w.set(k, t, !0);
|
|
97
|
+
} catch (t) {
|
|
98
|
+
if (e.signal.aborted) return;
|
|
99
|
+
w.set(j, t instanceof Error ? t.message : String(t), !0), console.error("Failed to load versions", t);
|
|
73
100
|
} finally {
|
|
74
|
-
|
|
101
|
+
B === e && w.set(A, !1);
|
|
75
102
|
}
|
|
76
103
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}),
|
|
80
|
-
|
|
104
|
+
w.user_effect(() => {
|
|
105
|
+
O.documentId, W();
|
|
106
|
+
}), w.user_effect(() => {
|
|
107
|
+
xe(), G();
|
|
108
|
+
}), w.user_effect(() => {
|
|
109
|
+
w.get(P) || w.get(I) || w.get(F) !== null && w.set(F, null);
|
|
81
110
|
});
|
|
82
|
-
let
|
|
83
|
-
function
|
|
111
|
+
let K = w.derived(() => w.get(M) === "snapshots" ? w.get(k).filter((e) => e.isSnapshot === !0) : w.get(k)), Ce = w.derived(() => w.get(k).reduce((e, t) => t.isSnapshot ? e + 1 : e, 0)), we = w.derived(() => w.get(F)?.label ? `${g()} (${w.get(F).label})` : g());
|
|
112
|
+
function q(e) {
|
|
84
113
|
if (!e) return "";
|
|
85
114
|
let t = e.replace(/```[\s\S]*?```/g, "").replace(/[#*_`>~-]/g, "").replace(/\s+/g, " ").trim();
|
|
86
115
|
return t.length > 100 ? `${t.slice(0, 100)}…` : t;
|
|
87
116
|
}
|
|
88
|
-
function
|
|
117
|
+
function Te(e) {
|
|
89
118
|
let t = typeof e == "string" ? new Date(e) : e, n = Date.now() - t.getTime();
|
|
90
119
|
if (Number.isNaN(n)) return "";
|
|
91
120
|
let r = Math.floor(n / 6e4);
|
|
92
|
-
if (r < 1) return
|
|
93
|
-
if (r < 60) return
|
|
121
|
+
if (r < 1) return v({ count: 0 });
|
|
122
|
+
if (r < 60) return v({ count: r });
|
|
94
123
|
let i = Math.floor(r / 60);
|
|
95
124
|
return i < 24 ? f({ count: i }) : p({ count: Math.floor(i / 24) });
|
|
96
125
|
}
|
|
97
|
-
function
|
|
98
|
-
|
|
126
|
+
function Ee(e) {
|
|
127
|
+
w.set(F, e, !0), w.set(L, null), w.set(P, !0);
|
|
99
128
|
}
|
|
100
|
-
function
|
|
101
|
-
|
|
129
|
+
function De() {
|
|
130
|
+
w.get(I) || (w.set(F, null), w.set(L, null));
|
|
102
131
|
}
|
|
103
|
-
async function
|
|
104
|
-
let e =
|
|
105
|
-
if (e && !
|
|
106
|
-
|
|
132
|
+
async function Oe() {
|
|
133
|
+
let e = w.get(F);
|
|
134
|
+
if (e && !w.get(I)) {
|
|
135
|
+
w.set(I, !0), O.onRestoringChange?.(!0), w.set(L, null);
|
|
107
136
|
try {
|
|
108
|
-
|
|
109
|
-
|
|
137
|
+
let t = O.documentId;
|
|
138
|
+
if (O.beforeRestore && !await O.beforeRestore()) {
|
|
139
|
+
w.set(L, "Could not save the current changes. Try again before restoring.");
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (t !== O.documentId) return;
|
|
143
|
+
let n = await b(`/api/documents/${t}/versions/${e.id}/restore`, {
|
|
144
|
+
method: "POST",
|
|
145
|
+
body: {}
|
|
146
|
+
}, R.fetch);
|
|
147
|
+
if (t !== O.documentId) return;
|
|
148
|
+
w.set(F, null), w.set(P, !1), W(), await O.onRestored?.(e, n), G(), typeof window < "u" && window.dispatchEvent(new CustomEvent("version-restored", { detail: {
|
|
149
|
+
documentId: O.documentId,
|
|
110
150
|
versionId: e.id
|
|
111
151
|
} }));
|
|
112
152
|
} catch (e) {
|
|
113
|
-
e instanceof
|
|
153
|
+
e instanceof x ? w.set(L, `${l()}: ${e.message}`) : w.set(L, e instanceof Error ? e.message : c(), !0), console.error("Failed to restore version", e);
|
|
114
154
|
} finally {
|
|
115
|
-
|
|
155
|
+
w.set(I, !1), O.onRestoringChange?.(!1);
|
|
116
156
|
}
|
|
117
157
|
}
|
|
118
158
|
}
|
|
119
|
-
function
|
|
120
|
-
|
|
159
|
+
function ke() {
|
|
160
|
+
G();
|
|
121
161
|
}
|
|
122
|
-
function
|
|
162
|
+
function Ae(e) {
|
|
123
163
|
if (!e) return null;
|
|
124
|
-
let t =
|
|
164
|
+
let t = w.get(k).find((t) => t.id === e);
|
|
125
165
|
return t ? t.label ?? e.slice(0, 8) : e.slice(0, 8);
|
|
126
166
|
}
|
|
127
|
-
var
|
|
128
|
-
|
|
129
|
-
var
|
|
130
|
-
|
|
131
|
-
var
|
|
132
|
-
t(
|
|
133
|
-
var
|
|
134
|
-
|
|
135
|
-
var
|
|
136
|
-
var t =
|
|
137
|
-
|
|
138
|
-
|
|
167
|
+
var J = be(), Y = w.first_child(J), X = w.child(Y), Z = w.child(X), Q = w.child(Z);
|
|
168
|
+
E(Q, { class: "h-4 w-4" });
|
|
169
|
+
var je = w.sibling(Q, 2), Me = w.only_child(je, !0);
|
|
170
|
+
w.reset(Z);
|
|
171
|
+
var $ = w.sibling(Z, 2), Ne = w.child($);
|
|
172
|
+
t(Ne, { class: "h-3 w-3" });
|
|
173
|
+
var Pe = w.sibling(Ne);
|
|
174
|
+
w.reset($), w.reset(X);
|
|
175
|
+
var Fe = w.sibling(X, 2), Ie = (e) => {
|
|
176
|
+
var t = ie(), n = w.child(t), r = w.only_child(n), i = w.sibling(n, 2), a = w.only_child(i);
|
|
177
|
+
w.reset(t), w.template_effect((e, o, s) => {
|
|
178
|
+
w.set_attribute(t, "aria-label", e), w.set_attribute(n, "aria-selected", w.get(M) === "all"), w.set_class(n, 1, `flex-1 px-2 py-1 transition-colors ${w.get(M) === "all" ? "bg-primary text-primary-foreground" : "bg-background text-muted-foreground hover:bg-accent"}`), w.set_text(r, `${o ?? ""} (${w.get(k).length ?? ""})`), w.set_attribute(i, "aria-selected", w.get(M) === "snapshots"), w.set_class(i, 1, `flex-1 px-2 py-1 transition-colors ${w.get(M) === "snapshots" ? "bg-primary text-primary-foreground" : "bg-background text-muted-foreground hover:bg-accent"}`), w.set_text(a, `${s ?? ""} (${w.get(Ce) ?? ""})`);
|
|
139
179
|
}, [
|
|
140
180
|
() => d(),
|
|
141
181
|
() => d(),
|
|
142
|
-
() =>
|
|
143
|
-
]),
|
|
182
|
+
() => _()
|
|
183
|
+
]), w.delegated("click", n, () => w.set(M, "all")), w.delegated("click", i, () => w.set(M, "snapshots")), w.append(e, t);
|
|
184
|
+
};
|
|
185
|
+
w.if(Fe, (e) => {
|
|
186
|
+
w.get(k).length > 0 && e(Ie);
|
|
187
|
+
});
|
|
188
|
+
var Le = w.sibling(Fe, 2), Re = (e) => {
|
|
189
|
+
var t = ae();
|
|
190
|
+
w.append(e, t);
|
|
191
|
+
};
|
|
192
|
+
w.if(Le, (e) => {
|
|
193
|
+
w.get(H) && e(Re);
|
|
194
|
+
});
|
|
195
|
+
var ze = w.sibling(Le, 2), Be = (e) => {
|
|
196
|
+
var t = oe(), n = w.only_child(t, !0);
|
|
197
|
+
w.template_effect(() => w.set_text(n, w.get(V))), w.append(e, t);
|
|
198
|
+
};
|
|
199
|
+
w.if(ze, (e) => {
|
|
200
|
+
w.get(V) && e(Be);
|
|
201
|
+
});
|
|
202
|
+
var Ve = w.sibling(ze, 2), He = (e) => {
|
|
203
|
+
var t = se();
|
|
204
|
+
w.delegated("click", t, W), w.append(e, t);
|
|
144
205
|
};
|
|
145
|
-
|
|
146
|
-
|
|
206
|
+
w.if(Ve, (e) => {
|
|
207
|
+
w.get(U) && e(He);
|
|
147
208
|
});
|
|
148
|
-
var
|
|
149
|
-
var t =
|
|
209
|
+
var Ue = w.sibling(Ve, 2), We = (e) => {
|
|
210
|
+
var t = ce(), n = w.child(t);
|
|
150
211
|
a(n, { class: "h-3.5 w-3.5 animate-spin" });
|
|
151
|
-
var r =
|
|
152
|
-
|
|
153
|
-
},
|
|
154
|
-
var t =
|
|
155
|
-
|
|
156
|
-
},
|
|
157
|
-
var t =
|
|
158
|
-
|
|
159
|
-
},
|
|
160
|
-
var t =
|
|
161
|
-
|
|
162
|
-
var i =
|
|
212
|
+
var r = w.sibling(n, 2), i = w.only_child(r, !0);
|
|
213
|
+
w.reset(t), w.template_effect((e) => w.set_text(i, e), [() => s()]), w.append(e, t);
|
|
214
|
+
}, Ge = (e) => {
|
|
215
|
+
var t = le(), n = w.only_child(t, !0);
|
|
216
|
+
w.template_effect(() => w.set_text(n, w.get(j))), w.append(e, t);
|
|
217
|
+
}, Ke = (e) => {
|
|
218
|
+
var t = ue(), n = w.only_child(t, !0);
|
|
219
|
+
w.template_effect((e) => w.set_text(n, e), [() => h()]), w.append(e, t);
|
|
220
|
+
}, qe = (e) => {
|
|
221
|
+
var t = ve();
|
|
222
|
+
w.each(t, 21, () => w.get(K), (e) => e.id, (e, t) => {
|
|
223
|
+
var i = _e(), a = w.child(i), o = (e) => {
|
|
163
224
|
{
|
|
164
|
-
let t =
|
|
165
|
-
|
|
225
|
+
let t = w.derived(() => ee());
|
|
226
|
+
D(e, {
|
|
166
227
|
class: "mt-0.5 h-3.5 w-3.5 shrink-0 fill-amber-400 text-amber-500",
|
|
167
228
|
get "aria-label"() {
|
|
168
|
-
return
|
|
229
|
+
return w.get(t);
|
|
169
230
|
}
|
|
170
231
|
});
|
|
171
232
|
}
|
|
172
233
|
}, s = (e) => {
|
|
173
234
|
r(e, { class: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" });
|
|
174
235
|
};
|
|
175
|
-
|
|
176
|
-
|
|
236
|
+
w.if(a, (e) => {
|
|
237
|
+
w.get(t).isSnapshot ? e(o) : e(s, -1);
|
|
177
238
|
});
|
|
178
|
-
var c =
|
|
179
|
-
var n =
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}),
|
|
239
|
+
var c = w.sibling(a, 2), l = w.child(c), u = w.child(l), d = w.child(u), f = (e) => {
|
|
240
|
+
var n = de(), r = w.only_child(n, !0);
|
|
241
|
+
w.template_effect(() => {
|
|
242
|
+
w.set_attribute(n, "title", w.get(t).label), w.set_text(r, w.get(t).label);
|
|
243
|
+
}), w.append(e, n);
|
|
183
244
|
};
|
|
184
|
-
|
|
185
|
-
|
|
245
|
+
w.if(d, (e) => {
|
|
246
|
+
w.get(t).label && e(f);
|
|
186
247
|
});
|
|
187
|
-
var p =
|
|
188
|
-
|
|
189
|
-
var
|
|
190
|
-
|
|
191
|
-
var
|
|
192
|
-
|
|
193
|
-
var
|
|
194
|
-
var n =
|
|
195
|
-
|
|
196
|
-
var a =
|
|
197
|
-
|
|
198
|
-
var o =
|
|
199
|
-
var n =
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}),
|
|
248
|
+
var p = w.sibling(d, 2), h = w.only_child(p, !0);
|
|
249
|
+
w.reset(u);
|
|
250
|
+
var g = w.sibling(u, 2), _ = w.child(g);
|
|
251
|
+
re(_, { class: "h-3 w-3" });
|
|
252
|
+
var v = w.sibling(_);
|
|
253
|
+
w.reset(g), w.reset(l);
|
|
254
|
+
var y = w.sibling(l, 2), b = (e) => {
|
|
255
|
+
var n = pe(), r = w.child(n), i = w.child(r);
|
|
256
|
+
D(i, { class: "h-2.5 w-2.5" });
|
|
257
|
+
var a = w.sibling(i);
|
|
258
|
+
w.reset(r);
|
|
259
|
+
var o = w.sibling(r, 2), s = (e) => {
|
|
260
|
+
var n = fe(), r = w.only_child(n, !0);
|
|
261
|
+
w.template_effect(() => {
|
|
262
|
+
w.set_attribute(n, "title", w.get(t).description), w.set_text(r, w.get(t).description);
|
|
263
|
+
}), w.append(e, n);
|
|
203
264
|
};
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}),
|
|
265
|
+
w.if(o, (e) => {
|
|
266
|
+
w.get(t).description && e(s);
|
|
267
|
+
}), w.reset(n), w.template_effect((e) => w.set_text(a, ` ${e ?? ""}`), [() => ee()]), w.append(e, n);
|
|
207
268
|
};
|
|
208
|
-
|
|
209
|
-
|
|
269
|
+
w.if(y, (e) => {
|
|
270
|
+
w.get(t).isSnapshot && e(b);
|
|
210
271
|
});
|
|
211
|
-
var
|
|
212
|
-
var r =
|
|
272
|
+
var x = w.sibling(y, 2), S = (e) => {
|
|
273
|
+
var r = me(), i = w.child(r);
|
|
213
274
|
n(i, { class: "h-3 w-3" });
|
|
214
|
-
var a =
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
}, [() =>
|
|
275
|
+
var a = w.sibling(i), o = w.sibling(a), s = w.only_child(o, !0);
|
|
276
|
+
w.reset(r), w.template_effect((e, t) => {
|
|
277
|
+
w.set_text(a, ` ${e ?? ""} `), w.set_text(s, t);
|
|
278
|
+
}, [() => ne(), () => Ae(w.get(t).restoredFrom) ?? "—"]), w.append(e, r);
|
|
218
279
|
};
|
|
219
|
-
|
|
220
|
-
|
|
280
|
+
w.if(x, (e) => {
|
|
281
|
+
w.get(t).restoredFrom && e(S);
|
|
221
282
|
});
|
|
222
|
-
var
|
|
223
|
-
|
|
224
|
-
|
|
283
|
+
var C = w.sibling(x, 2), T = (e) => {
|
|
284
|
+
var n = he(), r = w.only_child(n, !0);
|
|
285
|
+
w.template_effect((e) => {
|
|
286
|
+
w.set_attribute(n, "aria-pressed", w.get(U) === w.get(t).id), n.disabled = w.get(I), w.set_text(r, e);
|
|
287
|
+
}, [() => q(w.get(t).content) || "View version"]), w.delegated("click", n, () => void Se(w.get(t))), w.append(e, n);
|
|
288
|
+
}, E = (e) => {
|
|
289
|
+
var n = ge(), r = w.only_child(n, !0);
|
|
290
|
+
w.template_effect((e) => w.set_text(r, e), [() => q(w.get(t).content)]), w.append(e, n);
|
|
291
|
+
};
|
|
292
|
+
w.if(C, (e) => {
|
|
293
|
+
O.onPreview ? e(T) : e(E, -1);
|
|
294
|
+
}), w.reset(c), w.reset(i), w.template_effect((e, t, n, r) => {
|
|
295
|
+
w.set_text(h, e), w.set_attribute(g, "title", t), w.set_attribute(g, "aria-label", n), w.set_text(v, ` ${r ?? ""}`);
|
|
225
296
|
}, [
|
|
226
|
-
() =>
|
|
297
|
+
() => Te(w.get(t).createdAt),
|
|
227
298
|
() => m(),
|
|
228
299
|
() => m(),
|
|
229
|
-
() =>
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
]), E.delegated("click", v, () => _e(E.get(t))), E.append(e, i);
|
|
233
|
-
}), E.reset(t), E.append(e, t);
|
|
300
|
+
() => te()
|
|
301
|
+
]), w.delegated("click", g, () => Ee(w.get(t))), w.append(e, i);
|
|
302
|
+
}), w.reset(t), w.append(e, t);
|
|
234
303
|
};
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}),
|
|
238
|
-
var
|
|
304
|
+
w.if(Ue, (e) => {
|
|
305
|
+
w.get(A) ? e(We) : w.get(j) ? e(Ge, 1) : w.get(K).length === 0 ? e(Ke, 2) : e(qe, -1);
|
|
306
|
+
}), w.reset(Y);
|
|
307
|
+
var Je = w.sibling(Y, 2);
|
|
239
308
|
{
|
|
240
|
-
let t =
|
|
241
|
-
e(
|
|
309
|
+
let t = w.derived(() => m()), n = w.derived(() => te()), r = w.derived(() => o());
|
|
310
|
+
e(Je, {
|
|
242
311
|
get title() {
|
|
243
|
-
return
|
|
312
|
+
return w.get(t);
|
|
244
313
|
},
|
|
245
314
|
get description() {
|
|
246
|
-
return
|
|
315
|
+
return w.get(we);
|
|
247
316
|
},
|
|
248
317
|
get confirmLabel() {
|
|
249
|
-
return
|
|
318
|
+
return w.get(n);
|
|
250
319
|
},
|
|
251
320
|
get cancelLabel() {
|
|
252
|
-
return
|
|
321
|
+
return w.get(r);
|
|
253
322
|
},
|
|
254
323
|
variant: "default",
|
|
255
324
|
get busy() {
|
|
256
|
-
return
|
|
325
|
+
return w.get(I);
|
|
257
326
|
},
|
|
258
|
-
onConfirm:
|
|
259
|
-
onCancel:
|
|
327
|
+
onConfirm: Oe,
|
|
328
|
+
onCancel: De,
|
|
260
329
|
get open() {
|
|
261
|
-
return
|
|
330
|
+
return w.get(P);
|
|
262
331
|
},
|
|
263
332
|
set open(e) {
|
|
264
|
-
|
|
333
|
+
w.set(P, e, !0);
|
|
265
334
|
}
|
|
266
335
|
});
|
|
267
336
|
}
|
|
268
|
-
var
|
|
269
|
-
var t =
|
|
270
|
-
|
|
337
|
+
var Ye = w.sibling(Je, 2), Xe = (e) => {
|
|
338
|
+
var t = ye(), n = w.only_child(t, !0);
|
|
339
|
+
w.template_effect(() => w.set_text(n, w.get(L))), w.append(e, t);
|
|
271
340
|
};
|
|
272
|
-
|
|
273
|
-
|
|
341
|
+
w.if(Ye, (e) => {
|
|
342
|
+
w.get(L) && e(Xe);
|
|
274
343
|
});
|
|
275
|
-
var
|
|
276
|
-
|
|
344
|
+
var Ze = w.sibling(Ye, 2);
|
|
345
|
+
S(Ze, {
|
|
277
346
|
get documentId() {
|
|
278
|
-
return
|
|
347
|
+
return O.documentId;
|
|
279
348
|
},
|
|
280
|
-
onSuccess:
|
|
349
|
+
onSuccess: ke,
|
|
281
350
|
get open() {
|
|
282
|
-
return
|
|
351
|
+
return w.get(N);
|
|
283
352
|
},
|
|
284
353
|
set open(e) {
|
|
285
|
-
|
|
354
|
+
w.set(N, e, !0);
|
|
286
355
|
}
|
|
287
|
-
}),
|
|
288
|
-
|
|
356
|
+
}), w.template_effect((e, t, n, r) => {
|
|
357
|
+
w.set_text(Me, e), $.disabled = w.get(A), w.set_attribute($, "title", t), w.set_attribute($, "aria-label", n), w.set_text(Pe, ` ${r ?? ""}`);
|
|
289
358
|
}, [
|
|
290
359
|
() => u(),
|
|
291
|
-
() =>
|
|
292
|
-
() =>
|
|
293
|
-
() =>
|
|
294
|
-
]),
|
|
360
|
+
() => y(),
|
|
361
|
+
() => y(),
|
|
362
|
+
() => y()
|
|
363
|
+
]), w.delegated("click", $, () => w.set(N, !0)), w.append(i, J), w.pop();
|
|
295
364
|
}
|
|
296
|
-
|
|
297
|
-
export {
|
|
365
|
+
w.delegate(["click"]);
|
|
366
|
+
export { O as VersionHistory };
|
|
@@ -2216,13 +2216,9 @@ function HiAiEditor($$renderer, $$props) {
|
|
|
2216
2216
|
const parse = async () => {
|
|
2217
2217
|
try {
|
|
2218
2218
|
const cached = cacheDocumentId && cacheUpdatedAt ? await getCachedParsedContent(cacheDocumentId, cacheUpdatedAt) : null;
|
|
2219
|
-
if (generation !== deferredParseGeneration || editor !== ed) return;
|
|
2219
|
+
if (generation !== deferredParseGeneration || editor !== ed || content !== source || contentJson) return;
|
|
2220
2220
|
const parsed = cached ?? sanitizeEditorContent(markdownToJson(source));
|
|
2221
2221
|
ed.commands.setContent(parsed, { emitUpdate: false });
|
|
2222
|
-
onUpdate({
|
|
2223
|
-
markdown: source,
|
|
2224
|
-
json: parsed
|
|
2225
|
-
});
|
|
2226
2222
|
if (!cached && cacheDocumentId && cacheUpdatedAt) cacheParsedContent(cacheDocumentId, cacheUpdatedAt, parsed);
|
|
2227
2223
|
} catch (err) {
|
|
2228
2224
|
if (generation === deferredParseGeneration) console.warn("HiAiEditor: deferred markdown parsing failed", err);
|
|
@@ -2340,15 +2336,18 @@ function HiAiEditor($$renderer, $$props) {
|
|
|
2340
2336
|
$$renderer.push(`<div class="editor-wrapper svelte-9hjz5q" role="presentation">`);
|
|
2341
2337
|
if (ready && editor) {
|
|
2342
2338
|
$$renderer.push("<!--[0-->");
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2339
|
+
if (editable) {
|
|
2340
|
+
$$renderer.push("<!--[0-->");
|
|
2341
|
+
EditorToolbar($$renderer, {
|
|
2342
|
+
editor,
|
|
2343
|
+
documentId,
|
|
2344
|
+
toolbarExtensions,
|
|
2345
|
+
editorActions,
|
|
2346
|
+
editorActionContext,
|
|
2347
|
+
minimal: minimalToolbar
|
|
2348
|
+
});
|
|
2349
|
+
} else $$renderer.push("<!--[-1-->");
|
|
2350
|
+
$$renderer.push(`<!--]--> <div${$.attr_class("editor-content svelte-9hjz5q", void 0, { "deferred-loading": deferredContentLoading })}${$.attr("aria-busy", deferredContentLoading)}>`);
|
|
2352
2351
|
if (deferredContentLoading) $$renderer.push(`<!--[0--><div class="large-document-loader svelte-9hjz5q" role="status" aria-live="polite"><div class="large-document-loader-heading svelte-9hjz5q"><span class="large-document-spinner svelte-9hjz5q" aria-hidden="true"></span> <span class="svelte-9hjz5q">Preparing large document…</span></div> <div class="large-document-loader-lines svelte-9hjz5q" aria-hidden="true"><span style="width: 72%" class="svelte-9hjz5q"></span> <span style="width: 94%" class="svelte-9hjz5q"></span> <span style="width: 83%" class="svelte-9hjz5q"></span> <span style="width: 61%" class="svelte-9hjz5q"></span></div></div>`);
|
|
2353
2352
|
else $$renderer.push("<!--[-1-->");
|
|
2354
2353
|
$$renderer.push(`<!--]--> `);
|
|
@@ -27,7 +27,9 @@ function startCollaboration(documentId, accessToken, onUpdate, realtime) {
|
|
|
27
27
|
});
|
|
28
28
|
provider.on("sync", (_synced) => {});
|
|
29
29
|
provider.on("status", (_status) => {});
|
|
30
|
-
provider.on("connection-close", () => {
|
|
30
|
+
provider.on("connection-close", (event) => {
|
|
31
|
+
if (event?.code === 4009) provider.disconnect();
|
|
32
|
+
});
|
|
31
33
|
const updateHandler = onUpdate;
|
|
32
34
|
if (updateHandler) doc.on("update", updateHandler);
|
|
33
35
|
const session = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as HiAiEditor } from "../../assets/HiAiEditor-
|
|
1
|
+
import { t as HiAiEditor } from "../../assets/HiAiEditor-BQGlGd3z.js";
|
|
2
2
|
import "svelte/internal/server";
|
|
3
3
|
// src/lib/components/editor/CompactEditor.svelte
|
|
4
4
|
function CompactEditor($$renderer, $$props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as DocsmintDocumentEditorHost } from "../../assets/HiAiEditor-
|
|
1
|
+
export { t as DocsmintDocumentEditorHost } from "../../assets/HiAiEditor-BQGlGd3z.js";
|