@fileverse-dev/ddoc 7.0.3 → 7.1.1
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/dist/{ddoc-persistence-DLdSviUr.mjs → ddoc-persistence-DwgX_Jov.mjs} +1 -1
- package/dist/headless-editor-utils.es.js +1 -1
- package/dist/{index-DzUWhgai.mjs → index-DOFcNLkR.mjs} +1 -1
- package/dist/index.es.js +7997 -7573
- package/dist/package/components/inline-comment/comment-drawer-desktop.d.ts +1 -0
- package/dist/package/components/inline-comment/use-comment-drawer-filters.d.ts +6 -2
- package/dist/package/components/tabs/confirm-delete-modal.d.ts +1 -1
- package/dist/package/components/tabs/document-mobile-tab-panel.d.ts +3 -1
- package/dist/package/components/tabs/document-tabs-sidebar.d.ts +13 -4
- package/dist/package/components/tabs/tab-item.d.ts +9 -3
- package/dist/package/components/tabs/use-tab-tree-view.d.ts +36 -0
- package/dist/package/components/tabs/utils/__tests__/subtab-test-helpers.d.ts +11 -0
- package/dist/package/components/tabs/utils/__tests__/v7/v7-tab-ops.d.ts +15 -0
- package/dist/package/components/tabs/utils/__tests__/v7/v7-tab-utils.d.ts +45 -0
- package/dist/package/components/tabs/utils/tab-operations.d.ts +37 -0
- package/dist/package/components/tabs/utils/tab-utils.d.ts +25 -1
- package/dist/package/components/toc/document-outline.d.ts +1 -1
- package/dist/package/components/toc/types.d.ts +4 -0
- package/dist/package/extensions/resizable-media/media-paste-drop-plugin/media-paste-drop-plugin.d.ts +2 -1
- package/dist/package/hooks/use-tab-manager.d.ts +1 -0
- package/dist/package/types.d.ts +5 -0
- package/dist/package/use-ddoc-editor.d.ts +1 -0
- package/dist/package/utils/upload-images.d.ts +3 -1
- package/dist/persistence.es.js +1 -1
- package/dist/style.css +1 -1
- package/dist/tab-utils-Cvs3qmhi.mjs +340 -0
- package/dist/{use-headless-editor-CbMBM1S_.mjs → use-headless-editor-DjrTc5Rg.mjs} +29 -28
- package/package.json +2 -2
- package/dist/tab-utils-BNFvrUAj.mjs +0 -284
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import { fromUint8Array as L, toUint8Array as B } from "js-base64";
|
|
2
|
+
import * as h from "yjs";
|
|
3
|
+
const R = "default", j = "Tab 1", U = "ddocTabs", N = "tabs_order", C = "tabs_name_registry", b = "tabs_emoji_registry", z = "tabs_state", K = "tabs_delete_registry", O = "activeTabId", k = "tabs_parent_registry", P = 3, re = (e) => Math.min(Math.max(e.depth ?? 1, 1), P);
|
|
4
|
+
function E(e) {
|
|
5
|
+
return {
|
|
6
|
+
order: e.getArray(N),
|
|
7
|
+
nameById: e.getMap(C),
|
|
8
|
+
emojiById: e.getMap(b),
|
|
9
|
+
tabState: e.getMap(z),
|
|
10
|
+
// Soft-deleted tabs keep their fragment for undo and late peer updates.
|
|
11
|
+
// This tombstone stops self-heal from resurrecting deleted tabs from stale tab metadata.
|
|
12
|
+
deletedById: e.getMap(K),
|
|
13
|
+
// Reading a root that was never written adds nothing to the doc, so a doc
|
|
14
|
+
// without subtabs stays byte-for-byte the same.
|
|
15
|
+
parentById: e.getMap(k)
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function v(e, t) {
|
|
19
|
+
if (e)
|
|
20
|
+
try {
|
|
21
|
+
if (Array.isArray(e)) {
|
|
22
|
+
const n = e.map((r) => B(r));
|
|
23
|
+
h.applyUpdate(t, h.mergeUpdates(n), "self");
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
h.applyUpdate(t, B(e), "self");
|
|
27
|
+
} catch (n) {
|
|
28
|
+
console.log(n);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function M(e) {
|
|
32
|
+
return e ? e.toArray().filter((t) => typeof t == "string") : [];
|
|
33
|
+
}
|
|
34
|
+
function X(e) {
|
|
35
|
+
const t = e.getMap(U), n = t.get("order"), r = t.get("tabs"), s = t.get("activeTabId"), c = M(
|
|
36
|
+
n instanceof h.Array ? n : null
|
|
37
|
+
), o = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
|
|
38
|
+
return r instanceof h.Map && r.forEach((m, a) => {
|
|
39
|
+
if (!(m instanceof h.Map) || typeof a != "string") return;
|
|
40
|
+
const i = m.get("name"), l = m.get("emoji");
|
|
41
|
+
typeof i == "string" && o.set(a, i), (typeof l == "string" || l === null) && f.set(a, l);
|
|
42
|
+
}), {
|
|
43
|
+
order: c,
|
|
44
|
+
names: o,
|
|
45
|
+
emojis: f,
|
|
46
|
+
activeTabId: s instanceof h.Text && s.toString() || null,
|
|
47
|
+
deletedIds: /* @__PURE__ */ new Set(),
|
|
48
|
+
hasData: c.length > 0 || o.size > 0 || f.size > 0 || s instanceof h.Text && s.length > 0
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function V(e) {
|
|
52
|
+
const t = E(e), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set();
|
|
53
|
+
t.nameById.forEach((f, m) => {
|
|
54
|
+
typeof f == "string" && n.set(m, f);
|
|
55
|
+
}), t.emojiById.forEach((f, m) => {
|
|
56
|
+
(typeof f == "string" || f === null) && r.set(m, f);
|
|
57
|
+
}), t.deletedById.forEach((f, m) => {
|
|
58
|
+
f === !0 && s.add(m);
|
|
59
|
+
});
|
|
60
|
+
const c = t.tabState.get(O), o = typeof c == "string" ? c : null;
|
|
61
|
+
return {
|
|
62
|
+
order: M(t.order),
|
|
63
|
+
names: n,
|
|
64
|
+
emojis: r,
|
|
65
|
+
activeTabId: o,
|
|
66
|
+
deletedIds: s,
|
|
67
|
+
hasData: t.order.length > 0 || t.nameById.size > 0 || t.emojiById.size > 0 || t.deletedById.size > 0 || o !== null
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function S(e) {
|
|
71
|
+
const t = /* @__PURE__ */ new Set(), n = [];
|
|
72
|
+
return e.forEach((r) => {
|
|
73
|
+
t.has(r) || (t.add(r), n.push(r));
|
|
74
|
+
}), n;
|
|
75
|
+
}
|
|
76
|
+
function Y(e) {
|
|
77
|
+
return e === 0 ? j : `Tab ${e + 1}`;
|
|
78
|
+
}
|
|
79
|
+
function W(e, t) {
|
|
80
|
+
return S([
|
|
81
|
+
...e.order,
|
|
82
|
+
...t.order,
|
|
83
|
+
...Array.from(e.names.keys()),
|
|
84
|
+
...Array.from(e.emojis.keys()),
|
|
85
|
+
...Array.from(t.names.keys()),
|
|
86
|
+
...Array.from(t.emojis.keys())
|
|
87
|
+
]);
|
|
88
|
+
}
|
|
89
|
+
function G(e, t) {
|
|
90
|
+
const n = new Set(e.deletedIds);
|
|
91
|
+
t.forEach((a) => {
|
|
92
|
+
a.deletedIds.forEach((i) => n.add(i));
|
|
93
|
+
});
|
|
94
|
+
const r = /* @__PURE__ */ new Set(), s = [];
|
|
95
|
+
e.order.forEach((a) => {
|
|
96
|
+
!n.has(a) && !r.has(a) && (r.add(a), s.push(a));
|
|
97
|
+
});
|
|
98
|
+
const c = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
99
|
+
e.names.forEach((a, i) => {
|
|
100
|
+
n.has(i) || c.set(i, a);
|
|
101
|
+
}), e.emojis.forEach((a, i) => {
|
|
102
|
+
n.has(i) || o.set(i, a);
|
|
103
|
+
}), t.forEach((a) => {
|
|
104
|
+
a.order.forEach((i) => {
|
|
105
|
+
n.has(i) || (r.has(i) || (r.add(i), s.push(i)), !c.has(i) && a.names.has(i) && c.set(i, a.names.get(i) ?? j), o.has(i) || o.set(
|
|
106
|
+
i,
|
|
107
|
+
a.emojis.has(i) ? a.emojis.get(i) ?? null : null
|
|
108
|
+
));
|
|
109
|
+
});
|
|
110
|
+
}), s.forEach((a, i) => {
|
|
111
|
+
c.has(a) || c.set(a, Y(i)), (!o.has(a) || o.get(a) === void 0) && o.set(a, null);
|
|
112
|
+
});
|
|
113
|
+
const m = [
|
|
114
|
+
e.activeTabId,
|
|
115
|
+
...t.map((a) => a.activeTabId)
|
|
116
|
+
].find(
|
|
117
|
+
(a) => !!a && r.has(a) && !n.has(a)
|
|
118
|
+
) ?? s[0] ?? null;
|
|
119
|
+
return {
|
|
120
|
+
order: s,
|
|
121
|
+
names: c,
|
|
122
|
+
emojis: o,
|
|
123
|
+
activeTabId: m,
|
|
124
|
+
deletedIds: n
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function H(e, t, n) {
|
|
128
|
+
const r = (n == null ? void 0 : n.createDefaultTabIfMissing) ?? !1, s = new Set(e.deletedIds), c = W(
|
|
129
|
+
e,
|
|
130
|
+
t
|
|
131
|
+
).filter((l) => !s.has(l)), o = S([
|
|
132
|
+
...e.order,
|
|
133
|
+
...t.order
|
|
134
|
+
]);
|
|
135
|
+
c.forEach((l) => {
|
|
136
|
+
o.includes(l) || o.push(l);
|
|
137
|
+
}), o.length === 0 && r && o.push(R);
|
|
138
|
+
const f = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
|
|
139
|
+
o.forEach((l, y) => {
|
|
140
|
+
const p = e.names.get(l) ?? t.names.get(l) ?? Y(y), A = e.emojis.has(l) ? e.emojis.get(l) ?? null : t.emojis.has(l) ? t.emojis.get(l) ?? null : null;
|
|
141
|
+
f.set(l, p), m.set(l, A);
|
|
142
|
+
});
|
|
143
|
+
const i = [
|
|
144
|
+
e.activeTabId,
|
|
145
|
+
t.activeTabId
|
|
146
|
+
].find(
|
|
147
|
+
(l) => !!l && o.includes(l)
|
|
148
|
+
) ?? o[0] ?? null;
|
|
149
|
+
return {
|
|
150
|
+
order: o,
|
|
151
|
+
names: f,
|
|
152
|
+
emojis: m,
|
|
153
|
+
activeTabId: i,
|
|
154
|
+
deletedIds: s
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
function q(e, t) {
|
|
158
|
+
return e.length !== t.length ? !1 : e.every((n, r) => n === t[r]);
|
|
159
|
+
}
|
|
160
|
+
function J(e, t) {
|
|
161
|
+
const n = M(e);
|
|
162
|
+
return q(n, t) ? !1 : (e.length > 0 && e.delete(0, e.length), t.length > 0 && e.insert(0, t), !0);
|
|
163
|
+
}
|
|
164
|
+
function $(e, t, n) {
|
|
165
|
+
const r = e.get(t);
|
|
166
|
+
return n === null ? r === void 0 ? !1 : (e.delete(t), !0) : r === n ? !1 : (e.set(t, n), !0);
|
|
167
|
+
}
|
|
168
|
+
function _(e, t) {
|
|
169
|
+
let n = !1;
|
|
170
|
+
return Array.from(e.keys()).forEach((r) => {
|
|
171
|
+
t.has(r) || (e.delete(r), n = !0);
|
|
172
|
+
}), t.forEach((r, s) => {
|
|
173
|
+
e.get(s) !== r && (e.set(s, r), n = !0);
|
|
174
|
+
}), n;
|
|
175
|
+
}
|
|
176
|
+
function F(e, t, n = "self") {
|
|
177
|
+
const r = E(e);
|
|
178
|
+
let s = !1;
|
|
179
|
+
const c = new Map(
|
|
180
|
+
Array.from(t.deletedIds, (o) => [o, !0])
|
|
181
|
+
);
|
|
182
|
+
return e.transact(() => {
|
|
183
|
+
t.order.forEach((o) => {
|
|
184
|
+
e.getXmlFragment(o);
|
|
185
|
+
}), s = J(r.order, t.order) || s, s = _(r.nameById, t.names) || s, s = _(r.emojiById, t.emojis) || s, s = $(
|
|
186
|
+
r.tabState,
|
|
187
|
+
O,
|
|
188
|
+
t.activeTabId
|
|
189
|
+
) || s, s = _(r.deletedById, c) || s;
|
|
190
|
+
}, n), s;
|
|
191
|
+
}
|
|
192
|
+
function w(e, t) {
|
|
193
|
+
const n = V(e), r = X(e), s = H(
|
|
194
|
+
n,
|
|
195
|
+
r,
|
|
196
|
+
t
|
|
197
|
+
);
|
|
198
|
+
return {
|
|
199
|
+
tabSnapshotV2: n,
|
|
200
|
+
legacySnapshot: r,
|
|
201
|
+
resolvedTabState: s
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
function I(e, t, n = "self") {
|
|
205
|
+
const { resolvedTabState: r } = w(e, t);
|
|
206
|
+
return F(e, r, n);
|
|
207
|
+
}
|
|
208
|
+
function se(e, t, n) {
|
|
209
|
+
v(e, t);
|
|
210
|
+
const r = I(t, {
|
|
211
|
+
...n,
|
|
212
|
+
createDefaultTabIfMissing: (n == null ? void 0 : n.createDefaultTabIfMissing) ?? !0
|
|
213
|
+
}), s = E(t), c = x(s), o = Q(s) || R;
|
|
214
|
+
return {
|
|
215
|
+
tabList: c,
|
|
216
|
+
// A stored open tab that is not shown (under a deleted tab) opens the
|
|
217
|
+
// first tab instead.
|
|
218
|
+
activeTabId: c.length === 0 || c.some((f) => f.id === o) ? o : c[0].id,
|
|
219
|
+
didWrite: r
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
function ae(e) {
|
|
223
|
+
return E(e);
|
|
224
|
+
}
|
|
225
|
+
function oe(e, t, n = "self") {
|
|
226
|
+
const r = I(e, t, n);
|
|
227
|
+
return {
|
|
228
|
+
...E(e),
|
|
229
|
+
didWrite: r
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
function ie(e, t) {
|
|
233
|
+
const n = e.map((o) => {
|
|
234
|
+
const f = new h.Doc();
|
|
235
|
+
return v(o, f), w(f, t).resolvedTabState;
|
|
236
|
+
}), r = new h.Doc();
|
|
237
|
+
v(e, r);
|
|
238
|
+
const { resolvedTabState: s } = w(
|
|
239
|
+
r,
|
|
240
|
+
t
|
|
241
|
+
), c = G(
|
|
242
|
+
s,
|
|
243
|
+
n
|
|
244
|
+
);
|
|
245
|
+
return F(r, c), L(h.encodeStateAsUpdate(r));
|
|
246
|
+
}
|
|
247
|
+
function Q(e) {
|
|
248
|
+
const t = e.tabState.get(O);
|
|
249
|
+
return typeof t == "string" ? t : null;
|
|
250
|
+
}
|
|
251
|
+
function Z(e, t) {
|
|
252
|
+
return e.nameById.has(t) ? {
|
|
253
|
+
name: e.nameById.get(t) ?? j,
|
|
254
|
+
emoji: e.emojiById.has(t) ? e.emojiById.get(t) ?? null : null
|
|
255
|
+
} : null;
|
|
256
|
+
}
|
|
257
|
+
function x(e) {
|
|
258
|
+
const t = te(e), n = e.parentById;
|
|
259
|
+
return !n || n.size === 0 ? t : ee(t, n, e.deletedById);
|
|
260
|
+
}
|
|
261
|
+
function ee(e, t, n) {
|
|
262
|
+
const r = new Set(e.map((u) => u.id)), s = /* @__PURE__ */ new Set();
|
|
263
|
+
n == null || n.forEach((u, d) => {
|
|
264
|
+
u === !0 && !r.has(d) && s.add(d);
|
|
265
|
+
});
|
|
266
|
+
const c = (u) => {
|
|
267
|
+
const d = t.get(u);
|
|
268
|
+
return typeof d == "string" && d !== u ? d : null;
|
|
269
|
+
}, o = (u) => {
|
|
270
|
+
const d = /* @__PURE__ */ new Set([u]);
|
|
271
|
+
let g = c(u);
|
|
272
|
+
for (; g && !d.has(g); ) {
|
|
273
|
+
if (s.has(g)) return !0;
|
|
274
|
+
d.add(g), g = c(g);
|
|
275
|
+
}
|
|
276
|
+
return !1;
|
|
277
|
+
}, f = e.filter((u) => !o(u.id)), m = f.length > 0 ? f : e, a = new Set(m.map((u) => u.id)), i = (u) => {
|
|
278
|
+
const d = c(u);
|
|
279
|
+
if (!d || !a.has(d)) return null;
|
|
280
|
+
const g = /* @__PURE__ */ new Set();
|
|
281
|
+
let T = d;
|
|
282
|
+
for (; T && a.has(T) && !g.has(T); ) {
|
|
283
|
+
if (T === u) return null;
|
|
284
|
+
g.add(T), T = c(T);
|
|
285
|
+
}
|
|
286
|
+
return d;
|
|
287
|
+
}, l = "", y = /* @__PURE__ */ new Map();
|
|
288
|
+
m.forEach((u) => {
|
|
289
|
+
const d = i(u.id) ?? l, g = y.get(d);
|
|
290
|
+
g ? g.push(u) : y.set(d, [u]);
|
|
291
|
+
});
|
|
292
|
+
const p = [], A = (u, d) => {
|
|
293
|
+
var g;
|
|
294
|
+
(g = y.get(u)) == null || g.forEach((T) => {
|
|
295
|
+
var D;
|
|
296
|
+
p.push({
|
|
297
|
+
...T,
|
|
298
|
+
parentId: u === l ? null : u,
|
|
299
|
+
depth: d,
|
|
300
|
+
hasChildren: (((D = y.get(T.id)) == null ? void 0 : D.length) ?? 0) > 0
|
|
301
|
+
}), A(T.id, d + 1);
|
|
302
|
+
});
|
|
303
|
+
};
|
|
304
|
+
return A(l, 1), p;
|
|
305
|
+
}
|
|
306
|
+
function te(e) {
|
|
307
|
+
const t = /* @__PURE__ */ new Set();
|
|
308
|
+
return M(e.order).filter((n) => t.has(n) ? !1 : (t.add(n), !0)).map((n) => {
|
|
309
|
+
const r = Z(
|
|
310
|
+
e,
|
|
311
|
+
n
|
|
312
|
+
);
|
|
313
|
+
return r ? {
|
|
314
|
+
id: n,
|
|
315
|
+
name: r.name,
|
|
316
|
+
emoji: r.emoji
|
|
317
|
+
} : null;
|
|
318
|
+
}).filter((n) => n !== null);
|
|
319
|
+
}
|
|
320
|
+
function ce(e) {
|
|
321
|
+
return e.toArray().map((t) => t instanceof h.XmlElement || t instanceof h.XmlText ? t.clone() : null).filter((t) => t !== null);
|
|
322
|
+
}
|
|
323
|
+
export {
|
|
324
|
+
O as A,
|
|
325
|
+
R as D,
|
|
326
|
+
U as L,
|
|
327
|
+
P as M,
|
|
328
|
+
N as O,
|
|
329
|
+
z as S,
|
|
330
|
+
ae as a,
|
|
331
|
+
x as b,
|
|
332
|
+
Z as c,
|
|
333
|
+
Q as d,
|
|
334
|
+
ce as e,
|
|
335
|
+
se as f,
|
|
336
|
+
re as g,
|
|
337
|
+
j as h,
|
|
338
|
+
ie as m,
|
|
339
|
+
oe as s
|
|
340
|
+
};
|
|
@@ -40,7 +40,7 @@ import SC from "katex";
|
|
|
40
40
|
import { List as TC } from "react-window";
|
|
41
41
|
import { create as My, useStore as AC, createStore as EC } from "zustand";
|
|
42
42
|
import { fromUint8Array as fn, toUint8Array as yp } from "js-base64";
|
|
43
|
-
import { D as Hr, O as MC, L as NC, m as bp,
|
|
43
|
+
import { D as Hr, O as MC, L as NC, m as bp, a as OC, A as DC } from "./tab-utils-Cvs3qmhi.mjs";
|
|
44
44
|
import { getAddressName as IC } from "@fileverse/ens";
|
|
45
45
|
import RC from "embla-carousel-react";
|
|
46
46
|
import { useMediaQuery as Ny, useOnClickOutside as LC } from "usehooks-ts";
|
|
@@ -17830,51 +17830,51 @@ function am(t, e, n) {
|
|
|
17830
17830
|
const o = t.state.tr, s = t.state.doc.resolve(r), i = s.parent;
|
|
17831
17831
|
return i.isTextblock && i.content.size === 0 ? o.replaceWith(s.before(), s.after(), n) : o.replaceRangeWith(r, r, n), o.setMeta(Ws, { remove: { id: e } }), t.dispatch(o), !0;
|
|
17832
17832
|
}
|
|
17833
|
-
async function qs(t, e, n, r) {
|
|
17833
|
+
async function qs(t, e, n, r, { replaceSelection: o = !0 } = {}) {
|
|
17834
17834
|
if (!t.type.includes("image/")) {
|
|
17835
17835
|
console.log("file is not an image");
|
|
17836
17836
|
return;
|
|
17837
17837
|
}
|
|
17838
|
-
const
|
|
17838
|
+
const s = {};
|
|
17839
17839
|
try {
|
|
17840
|
-
const
|
|
17841
|
-
|
|
17840
|
+
const i = e.state.tr;
|
|
17841
|
+
o && !i.selection.empty && i.deleteSelection(), i.setMeta(Ws, {
|
|
17842
17842
|
add: {
|
|
17843
|
-
id:
|
|
17843
|
+
id: s,
|
|
17844
17844
|
pos: n - 1,
|
|
17845
17845
|
content: "Uploading image..."
|
|
17846
17846
|
}
|
|
17847
|
-
}), e.dispatch(
|
|
17848
|
-
const { schema:
|
|
17849
|
-
if (b0(e.state,
|
|
17847
|
+
}), e.dispatch(i);
|
|
17848
|
+
const { schema: a } = e.state;
|
|
17849
|
+
if (b0(e.state, s) == null) return;
|
|
17850
17850
|
if (t = await y0(t), r) {
|
|
17851
|
-
const { ipfsUrl:
|
|
17852
|
-
encryptionKey:
|
|
17853
|
-
ipfsUrl:
|
|
17854
|
-
nonce:
|
|
17851
|
+
const { ipfsUrl: c, encryptionKey: u, nonce: d, ipfsHash: f, authTag: p } = await r(t), h = a.nodes.resizableMedia.create({
|
|
17852
|
+
encryptionKey: u,
|
|
17853
|
+
ipfsUrl: c,
|
|
17854
|
+
nonce: d,
|
|
17855
17855
|
mimeType: t.type,
|
|
17856
17856
|
version: "2",
|
|
17857
|
-
ipfsHash:
|
|
17858
|
-
authTag:
|
|
17857
|
+
ipfsHash: f,
|
|
17858
|
+
authTag: p,
|
|
17859
17859
|
"media-type": "secure-img",
|
|
17860
17860
|
width: "100%",
|
|
17861
17861
|
height: "auto"
|
|
17862
17862
|
});
|
|
17863
|
-
am(e,
|
|
17863
|
+
am(e, s, h);
|
|
17864
17864
|
} else {
|
|
17865
|
-
const
|
|
17866
|
-
|
|
17867
|
-
const { schema:
|
|
17868
|
-
src:
|
|
17865
|
+
const c = new FileReader();
|
|
17866
|
+
c.readAsDataURL(t), c.onloadend = () => {
|
|
17867
|
+
const { schema: u } = e.state, d = c.result, f = u.nodes.resizableMedia.create({
|
|
17868
|
+
src: d,
|
|
17869
17869
|
"media-type": "img"
|
|
17870
17870
|
});
|
|
17871
|
-
am(e,
|
|
17871
|
+
am(e, s, f);
|
|
17872
17872
|
};
|
|
17873
17873
|
}
|
|
17874
|
-
} catch (
|
|
17875
|
-
console.error("Error during image upload: ",
|
|
17876
|
-
const
|
|
17877
|
-
e.dispatch(
|
|
17874
|
+
} catch (i) {
|
|
17875
|
+
console.error("Error during image upload: ", i);
|
|
17876
|
+
const a = e.state.tr.setMeta(Ws, { remove: { id: s } });
|
|
17877
|
+
e.dispatch(a);
|
|
17878
17878
|
}
|
|
17879
17879
|
}
|
|
17880
17880
|
const Ks = (t, e) => t.type.includes("image") && !["image/png", "image/jpeg", "image/gif", "image/svg+xml"].includes(
|
|
@@ -39983,7 +39983,7 @@ ${u}
|
|
|
39983
39983
|
f = h.showLoader(), p = h.removeLoader;
|
|
39984
39984
|
}
|
|
39985
39985
|
try {
|
|
39986
|
-
const h = await a.arrayBuffer(), { default: m } = await import("./index-
|
|
39986
|
+
const h = await a.arrayBuffer(), { default: m } = await import("./index-DOFcNLkR.mjs").then((v) => v.i), { value: g } = await m.convertToHtml(
|
|
39987
39987
|
{ arrayBuffer: h },
|
|
39988
39988
|
{
|
|
39989
39989
|
styleMap: hk,
|
|
@@ -41164,7 +41164,8 @@ const K4 = (t, e) => new G({
|
|
|
41164
41164
|
c,
|
|
41165
41165
|
n,
|
|
41166
41166
|
a.pos,
|
|
41167
|
-
e
|
|
41167
|
+
e,
|
|
41168
|
+
{ replaceSelection: !1 }
|
|
41168
41169
|
);
|
|
41169
41170
|
} catch (d) {
|
|
41170
41171
|
throw t(d.message || "Error uploading media"), new Error(
|
|
@@ -44301,7 +44302,7 @@ const G5 = (t, e) => {
|
|
|
44301
44302
|
async function d(f, p, h) {
|
|
44302
44303
|
if (f.type === "application/vnd.openxmlformats-officedocument.wordprocessingml.document" || f.name.endsWith(".docx"))
|
|
44303
44304
|
try {
|
|
44304
|
-
const m = await f.arrayBuffer(), { default: g } = await import("./index-
|
|
44305
|
+
const m = await f.arrayBuffer(), { default: g } = await import("./index-DOFcNLkR.mjs").then((C) => C.i), { value: y } = await g.convertToHtml(
|
|
44305
44306
|
{ arrayBuffer: m },
|
|
44306
44307
|
{
|
|
44307
44308
|
styleMap: hk,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@fileverse-dev/ddoc",
|
|
3
3
|
"private": false,
|
|
4
4
|
"description": "DDoc",
|
|
5
|
-
"version": "7.
|
|
5
|
+
"version": "7.1.1",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/fileverse/fileverse-ddocs.git"
|
|
@@ -205,4 +205,4 @@
|
|
|
205
205
|
"vitest": "^2.1.0",
|
|
206
206
|
"yjs": "13.6.30"
|
|
207
207
|
}
|
|
208
|
-
}
|
|
208
|
+
}
|