pptx-svelte-viewer 4.24.2 → 4.25.0
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/CHANGELOG.md +62 -0
- package/README.md +8 -8
- package/dist/{AiChatPanel-JXBBiQki.js → AiChatPanel-ge7sxUZk.js} +2 -2
- package/dist/awareness-BwmJcSKy.js +533 -0
- package/dist/{export-BBxggq0e.js → export-CS0tkkRj.js} +30858 -30443
- package/dist/index.js +47 -47
- package/dist/internals.js +17 -17
- package/dist/{transition-overlay-CKLt2lTg.js → transition-overlay-B2a8i_wG.js} +45241 -44390
- package/dist/viewer/index.d.ts +1 -39
- package/dist/viewer/index.js +10 -10
- package/dist/{y-webrtc-y-xCsKw4.js → y-webrtc-DPABhqQq.js} +1 -1
- package/dist/{y-websocket-Uj4wJVyw.js → y-websocket-B2EqYBBC.js} +1 -1
- package/package.json +8 -7
- package/dist/awareness-CWh9V5ZH.js +0 -530
package/dist/viewer/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { Component } from 'svelte';
|
|
|
3
3
|
import { PptxTheme, PptxThemeColorRef, PptxLayoutPreview, PptxTransitionType, PptxSlideTransition, TextSegment, MasterViewTab, PptxElement, PptxSection, PptxSlide, ShapePptxElement, PptxHandler, TextStyle, PptxData, SvgExportOptions, PptxSaveFormat, PptxChartData, PptxComment, PptxSlideMaster, PptxNotesMaster, PptxHandoutMaster, PptxAnimationPreset, MergeShapeOperation, PptxHeaderFooter, PptxPresentationProperties, PptxCustomShow, PptxCoreProperties, PptxAppProperties, PptxCustomProperty, PptxTagCollection, PptxLayoutOption, PptxTableData, PptxViewProperties, PptxModernCommentAuthor, PptxCommentAuthor, PptxSlideSize, ParsedTableStyleMap, PptxModifyVerifier, PptxCompatibilityWarning, PptxEmbeddedFont, PptxThemeOption, PptxThemeColorScheme, PptxHandlerLoadOptions, PptxHandlerSaveOptions } from 'ooxml-core/pptx';
|
|
4
4
|
import { Doc } from 'yjs';
|
|
5
5
|
import { LanguageModel, ChatTransport, UIMessage, ToolSet } from 'ai';
|
|
6
|
+
import { AlignEdge, DistributeAxis, SnapGuideInput, SnapLine } from 'pptx-viewer-core/geometry';
|
|
6
7
|
|
|
7
8
|
//#region src/theme/types.d.ts
|
|
8
9
|
/**
|
|
@@ -628,35 +629,6 @@ interface CellRect {
|
|
|
628
629
|
endRow: number;
|
|
629
630
|
endCol: number;
|
|
630
631
|
}
|
|
631
|
-
//#endregion
|
|
632
|
-
//#region src/render/element-align.d.ts
|
|
633
|
-
/**
|
|
634
|
-
* Pure geometry helpers for the align / distribute editor operations.
|
|
635
|
-
*
|
|
636
|
-
* These functions operate over a list of slide elements (anything carrying the
|
|
637
|
-
* `{ id, x, y, width, height }` bounding-box fields of {@link PptxElement}) and
|
|
638
|
-
* return a `Map` keyed by element `id` describing the *new* position(s) for the
|
|
639
|
-
* elements that need to move. Elements that already sit on the target edge (or
|
|
640
|
-
* the two outer-most elements during distribution) are still included with
|
|
641
|
-
* their unchanged coordinate so callers can apply the whole map uniformly; the
|
|
642
|
-
* map only ever contains the axis that the operation touches.
|
|
643
|
-
*
|
|
644
|
-
* The reference box the selection is aligned against is either the union of
|
|
645
|
-
* the selected boxes (PowerPoint's "Align Selected Objects") or the slide
|
|
646
|
-
* itself ("Align to Slide"). PowerPoint defaults to the slide whenever a
|
|
647
|
-
* single object is selected, which is why a one-element selection is not a
|
|
648
|
-
* no-op once a `slideSize` is supplied: Align Center on a lone title is one
|
|
649
|
-
* of the commonest arrange gestures there is.
|
|
650
|
-
*
|
|
651
|
-
* The helpers are deliberately framework-agnostic: no DOM, no Vue reactivity,
|
|
652
|
-
* no side effects. The host wires them into the editor by feeding the current
|
|
653
|
-
* selection in and applying the returned `Map` via its element-transform
|
|
654
|
-
* operation (one batched history entry per call).
|
|
655
|
-
*/
|
|
656
|
-
/** Edge / centre that {@link alignElements} can snap a selection to. */
|
|
657
|
-
type AlignEdge = 'left' | 'centerH' | 'right' | 'top' | 'middle' | 'bottom';
|
|
658
|
-
/** Axis along which {@link distributeElements} evenly spaces a selection. */
|
|
659
|
-
type DistributeAxis = 'horizontal' | 'vertical';
|
|
660
632
|
/** Minimum section metadata needed to build sidebar groups. */
|
|
661
633
|
interface SectionGroupDescriptor {
|
|
662
634
|
id: string;
|
|
@@ -697,16 +669,6 @@ interface SlideTemplateBuildOptions {
|
|
|
697
669
|
*/
|
|
698
670
|
translate?: (key: string) => string;
|
|
699
671
|
}
|
|
700
|
-
/** A user-placed alignment guide: `axis: 'v'` is a vertical line at x=`position`. */
|
|
701
|
-
interface SnapGuideInput {
|
|
702
|
-
axis: 'h' | 'v';
|
|
703
|
-
position: number;
|
|
704
|
-
}
|
|
705
|
-
/** A snap alignment line: `axis: 'v'` is a vertical line at x=`position`. */
|
|
706
|
-
interface SnapLine {
|
|
707
|
-
axis: 'h' | 'v';
|
|
708
|
-
position: number;
|
|
709
|
-
}
|
|
710
672
|
/** Framework-neutral picture-bullet source, sizing, and accessible fallback. */
|
|
711
673
|
interface PictureBulletMarker {
|
|
712
674
|
src?: string;
|
package/dist/viewer/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { D as e, M as a, N as o, O as r, a as n, c as d, d as b, f as p, i as c, j as s, k as
|
|
3
|
-
var
|
|
1
|
+
import { iv as l, rv as v } from "../transition-overlay-B2a8i_wG.js";
|
|
2
|
+
import { D as e, M as a, N as o, O as r, a as n, c as d, d as b, f as p, i as c, j as s, k as i, l as m, n as g, o as x, p as w, r as C, s as T, t as $, u as y } from "../export-CS0tkkRj.js";
|
|
3
|
+
var P = o, V = a, f = i, u = r, A = e, O = s;
|
|
4
4
|
export {
|
|
5
|
-
|
|
5
|
+
u as CollaborationCursors,
|
|
6
6
|
O as EditorLayer,
|
|
7
7
|
$ as PowerPointViewer,
|
|
8
8
|
c as PresentationLoader,
|
|
9
9
|
A as RemoteSelectionOverlay,
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
P as Ribbon,
|
|
11
|
+
f as SlideCanvas,
|
|
12
12
|
C as ViewerState,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
V as ViewerToolbar,
|
|
14
|
+
y as clampSlideIndex,
|
|
15
15
|
w as createSvelteAiBridge,
|
|
16
16
|
g as createViewerState,
|
|
17
17
|
n as exportAllSlidesToSvg,
|
|
@@ -21,6 +21,6 @@ export {
|
|
|
21
21
|
m as exportSlideToSvgBlob,
|
|
22
22
|
b as fitScale,
|
|
23
23
|
p as resolveNavigationKey,
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
v as zoomInPercent,
|
|
25
|
+
l as zoomOutPercent
|
|
26
26
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as Fe, r as pr, t as gr } from "./rolldown-runtime--eTHp1Qs.js";
|
|
2
|
-
import { $ as yr, A as br, B as Ct, D as mr, E as ut, F as _r, G as Ye, H as vr, I as Mt, J as je, K as wr, L as lt, M as se, O as Er, P as ae, R as ce, S as Cr, T as Rr, U as Rt, V as Sr, W as St, X as Tr, Y as ht, Z as Ar, _ as kr, a as Or, at as xr, b as Ge, c as Nr, d as Lr, et as Mr, f as Dr, g as Ir, i as Tt, it as Pr, j as it, k as Dt, l as jr, m as Ur, n as Br, nt as ft, o as It, ot as Fr, p as $r, q as Pt, r as $e, rt as jt, s as qr, st, t as Wr, tt as dt, u as Hr, v as Vr, w as Ut, x as Yr, y as Gr, z as Le } from "./awareness-
|
|
2
|
+
import { $ as yr, A as br, B as Ct, D as mr, E as ut, F as _r, G as Ye, H as vr, I as Mt, J as je, K as wr, L as lt, M as se, O as Er, P as ae, R as ce, S as Cr, T as Rr, U as Rt, V as Sr, W as St, X as Tr, Y as ht, Z as Ar, _ as kr, a as Or, at as xr, b as Ge, c as Nr, d as Lr, et as Mr, f as Dr, g as Ir, i as Tt, it as Pr, j as it, k as Dt, l as jr, m as Ur, n as Br, nt as ft, o as It, ot as Fr, p as $r, q as Pt, r as $e, rt as jt, s as qr, st, t as Wr, tt as dt, u as Hr, v as Vr, w as Ut, x as Yr, y as Gr, z as Le } from "./awareness-BwmJcSKy.js";
|
|
3
3
|
import "yjs";
|
|
4
4
|
var zr = 1200, Kr = 2500, qe = 3e4, ot = (r) => {
|
|
5
5
|
if (r.shouldConnect && r.ws === null) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as R, C as V, E as L, J as _, M as o, N as H, P as a, Q as E, R as i, Z as N, a as Q, c as $, d as O, et as j, h as U, i as k, j as z, k as J, l as r, n as Z, o as S, r as w, s as q, t as F, u as G, z as m } from "./awareness-
|
|
1
|
+
import { A as R, C as V, E as L, J as _, M as o, N as H, P as a, Q as E, R as i, Z as N, a as Q, c as $, d as O, et as j, h as U, i as k, j as z, k as J, l as r, n as Z, o as S, r as w, s as q, t as F, u as G, z as m } from "./awareness-BwmJcSKy.js";
|
|
2
2
|
import "yjs";
|
|
3
3
|
var K = (s, n, e) => {
|
|
4
4
|
R(s) === 0 && e(n, J(s));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pptx-svelte-viewer",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.25.0",
|
|
4
4
|
"description": "pptx-viewer for Svelte 5: a PowerPoint viewer and editor component to render, edit, present, and export PPTX slides in the browser.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"office",
|
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
"svelte5",
|
|
18
18
|
"viewer"
|
|
19
19
|
],
|
|
20
|
-
"homepage": "https://github.
|
|
20
|
+
"homepage": "https://christophervr.github.io/ooxml/pptx/",
|
|
21
21
|
"bugs": {
|
|
22
|
-
"url": "https://github.com/ChristopherVR/
|
|
22
|
+
"url": "https://github.com/ChristopherVR/ooxml/issues"
|
|
23
23
|
},
|
|
24
24
|
"license": "Apache-2.0",
|
|
25
25
|
"author": "ChristopherVR",
|
|
26
26
|
"repository": {
|
|
27
27
|
"type": "git",
|
|
28
|
-
"url": "https://github.com/ChristopherVR/
|
|
29
|
-
"directory": "packages/svelte"
|
|
28
|
+
"url": "git+https://github.com/ChristopherVR/ooxml.git",
|
|
29
|
+
"directory": "viewers/pptx/packages/svelte"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"dist/",
|
|
@@ -116,9 +116,9 @@
|
|
|
116
116
|
"html2canvas-pro": "^2.5.1",
|
|
117
117
|
"jspdf": "^4.2.1",
|
|
118
118
|
"jszip": "^3.10.2",
|
|
119
|
-
"ooxml-ui": "^0.
|
|
119
|
+
"ooxml-ui": "^0.30.0",
|
|
120
120
|
"opentype.js": "^2.0.0",
|
|
121
|
-
"pptx-viewer-mcp": "^2.7.
|
|
121
|
+
"pptx-viewer-mcp": "^2.7.2"
|
|
122
122
|
},
|
|
123
123
|
"devDependencies": {
|
|
124
124
|
"@ai-sdk/svelte": "^5.0.127",
|
|
@@ -127,6 +127,7 @@
|
|
|
127
127
|
"@types/opentype.js": "^1.3.10",
|
|
128
128
|
"ai": "^7.0.127",
|
|
129
129
|
"happy-dom": "^20.14.5",
|
|
130
|
+
"pptx-viewer-core": "^4.12.0",
|
|
130
131
|
"rollup": "^4.64.0",
|
|
131
132
|
"rollup-plugin-dts": "^6.5.1",
|
|
132
133
|
"svelte": "^5.57.1",
|
|
@@ -1,530 +0,0 @@
|
|
|
1
|
-
import * as M from "yjs";
|
|
2
|
-
var h = () => /* @__PURE__ */ new Map(), D = (e, t, r) => {
|
|
3
|
-
let s = e.get(t);
|
|
4
|
-
return s === void 0 && e.set(t, s = r()), s;
|
|
5
|
-
}, mt = (e, t) => {
|
|
6
|
-
const r = [];
|
|
7
|
-
for (const [s, a] of e) r.push(t(a, s));
|
|
8
|
-
return r;
|
|
9
|
-
}, F = () => /* @__PURE__ */ new Set(), Z = Array.from, wt = (e, t) => {
|
|
10
|
-
for (let r = 0; r < e.length; r++) if (!t(e[r], r, e)) return !1;
|
|
11
|
-
return !0;
|
|
12
|
-
}, dt = (e, t) => {
|
|
13
|
-
for (let r = 0; r < e.length; r++) if (t(e[r], r, e)) return !0;
|
|
14
|
-
return !1;
|
|
15
|
-
}, fe = (e, t) => {
|
|
16
|
-
const r = new Array(e);
|
|
17
|
-
for (let s = 0; s < e; s++) r[s] = t(s, r);
|
|
18
|
-
return r;
|
|
19
|
-
}, ce = Array.isArray, St = class {
|
|
20
|
-
constructor() {
|
|
21
|
-
this._observers = h();
|
|
22
|
-
}
|
|
23
|
-
on(e, t) {
|
|
24
|
-
return D(this._observers, e, F).add(t), t;
|
|
25
|
-
}
|
|
26
|
-
once(e, t) {
|
|
27
|
-
const r = (...s) => {
|
|
28
|
-
this.off(e, r), t(...s);
|
|
29
|
-
};
|
|
30
|
-
this.on(e, r);
|
|
31
|
-
}
|
|
32
|
-
off(e, t) {
|
|
33
|
-
const r = this._observers.get(e);
|
|
34
|
-
r !== void 0 && (r.delete(t), r.size === 0 && this._observers.delete(e));
|
|
35
|
-
}
|
|
36
|
-
emit(e, t) {
|
|
37
|
-
return Z((this._observers.get(e) || h()).values()).forEach((r) => r(...t));
|
|
38
|
-
}
|
|
39
|
-
destroy() {
|
|
40
|
-
this._observers = h();
|
|
41
|
-
}
|
|
42
|
-
}, ue = class {
|
|
43
|
-
constructor() {
|
|
44
|
-
this._observers = h();
|
|
45
|
-
}
|
|
46
|
-
on(e, t) {
|
|
47
|
-
D(this._observers, e, F).add(t);
|
|
48
|
-
}
|
|
49
|
-
once(e, t) {
|
|
50
|
-
const r = (...s) => {
|
|
51
|
-
this.off(e, r), t(...s);
|
|
52
|
-
};
|
|
53
|
-
this.on(e, r);
|
|
54
|
-
}
|
|
55
|
-
off(e, t) {
|
|
56
|
-
const r = this._observers.get(e);
|
|
57
|
-
r !== void 0 && (r.delete(t), r.size === 0 && this._observers.delete(e));
|
|
58
|
-
}
|
|
59
|
-
emit(e, t) {
|
|
60
|
-
return Z((this._observers.get(e) || h()).values()).forEach((r) => r(...t));
|
|
61
|
-
}
|
|
62
|
-
destroy() {
|
|
63
|
-
this._observers = h();
|
|
64
|
-
}
|
|
65
|
-
}, w = Math.floor, ve = Math.abs, Ut = Math.log10, he = (e, t) => e < t ? e : t, K = (e, t) => e > t ? e : t, At = Number.isNaN, It = Math.pow, pe = (e) => e !== 0 ? e < 0 : 1 / e < 0, I = Date.now, C = (e) => new Error(e), Ct = () => {
|
|
66
|
-
throw C("Method unimplemented");
|
|
67
|
-
}, _t = () => {
|
|
68
|
-
throw C("Unexpected case");
|
|
69
|
-
};
|
|
70
|
-
var Q = Number.MAX_SAFE_INTEGER, kt = Number.MIN_SAFE_INTEGER, ge = Number.isInteger || ((e) => typeof e == "number" && isFinite(e) && w(e) === e), Lt = Number.isNaN, Et = Number.parseInt, W = String.fromCharCode, Nt = String.fromCodePoint, Bt = W(65535), ye = (e) => e.toLowerCase(), be = /^\s*/g, me = (e) => e.replace(be, ""), we = /([A-Z])/g, $ = (e, t) => me(e.replace(we, (r) => `${t}${ye(r)}`)), de = (e) => {
|
|
71
|
-
const t = unescape(encodeURIComponent(e)), r = t.length, s = new Uint8Array(r);
|
|
72
|
-
for (let a = 0; a < r; a++) s[a] = t.codePointAt(a);
|
|
73
|
-
return s;
|
|
74
|
-
}, d = typeof TextEncoder < "u" ? new TextEncoder() : null, Se = (e) => d.encode(e), Ue = d ? Se : de, b = typeof TextDecoder > "u" ? null : new TextDecoder("utf-8", {
|
|
75
|
-
fatal: !0,
|
|
76
|
-
ignoreBOM: !0
|
|
77
|
-
});
|
|
78
|
-
b && b.decode(/* @__PURE__ */ new Uint8Array()).length === 1 && (b = null);
|
|
79
|
-
var Ot = (e, t) => fe(t, () => e).join(""), Ae = class {
|
|
80
|
-
constructor() {
|
|
81
|
-
this.cpos = 0, this.cbuf = /* @__PURE__ */ new Uint8Array(100), this.bufs = [];
|
|
82
|
-
}
|
|
83
|
-
}, Ie = () => new Ae(), Ce = (e) => {
|
|
84
|
-
let t = e.cpos;
|
|
85
|
-
for (let r = 0; r < e.bufs.length; r++) t += e.bufs[r].length;
|
|
86
|
-
return t;
|
|
87
|
-
}, _e = (e) => {
|
|
88
|
-
const t = new Uint8Array(Ce(e));
|
|
89
|
-
let r = 0;
|
|
90
|
-
for (let s = 0; s < e.bufs.length; s++) {
|
|
91
|
-
const a = e.bufs[s];
|
|
92
|
-
t.set(a, r), r += a.length;
|
|
93
|
-
}
|
|
94
|
-
return t.set(new Uint8Array(e.cbuf.buffer, 0, e.cpos), r), t;
|
|
95
|
-
}, ke = (e, t) => {
|
|
96
|
-
const r = e.cbuf.length;
|
|
97
|
-
r - e.cpos < t && (e.bufs.push(new Uint8Array(e.cbuf.buffer, 0, e.cpos)), e.cbuf = new Uint8Array(K(r, t) * 2), e.cpos = 0);
|
|
98
|
-
}, o = (e, t) => {
|
|
99
|
-
const r = e.cbuf.length;
|
|
100
|
-
e.cpos === r && (e.bufs.push(e.cbuf), e.cbuf = new Uint8Array(r * 2), e.cpos = 0), e.cbuf[e.cpos++] = t;
|
|
101
|
-
}, Tt = o, c = (e, t) => {
|
|
102
|
-
for (; t > 127; )
|
|
103
|
-
o(e, 128 | 127 & t), t = w(t / 128);
|
|
104
|
-
o(e, 127 & t);
|
|
105
|
-
}, Le = (e, t) => {
|
|
106
|
-
const r = pe(t);
|
|
107
|
-
for (r && (t = -t), o(e, (t > 63 ? 128 : 0) | (r ? 64 : 0) | 63 & t), t = w(t / 64); t > 0; )
|
|
108
|
-
o(e, (t > 127 ? 128 : 0) | 127 & t), t = w(t / 128);
|
|
109
|
-
}, k = /* @__PURE__ */ new Uint8Array(3e4), Ee = k.length / 3, Ne = (e, t) => {
|
|
110
|
-
if (t.length < Ee) {
|
|
111
|
-
const r = d.encodeInto(t, k).written || 0;
|
|
112
|
-
c(e, r);
|
|
113
|
-
for (let s = 0; s < r; s++) o(e, k[s]);
|
|
114
|
-
} else S(e, Ue(t));
|
|
115
|
-
}, Be = (e, t) => {
|
|
116
|
-
const r = unescape(encodeURIComponent(t)), s = r.length;
|
|
117
|
-
c(e, s);
|
|
118
|
-
for (let a = 0; a < s; a++) o(e, r.codePointAt(a));
|
|
119
|
-
}, L = d && d.encodeInto ? Ne : Be, Oe = (e, t) => {
|
|
120
|
-
const r = e.cbuf.length, s = e.cpos, a = he(r - s, t.length), n = t.length - a;
|
|
121
|
-
e.cbuf.set(t.subarray(0, a), s), e.cpos += a, n > 0 && (e.bufs.push(e.cbuf), e.cbuf = new Uint8Array(K(r * 2, n)), e.cbuf.set(t.subarray(a)), e.cpos = n);
|
|
122
|
-
}, S = (e, t) => {
|
|
123
|
-
c(e, t.byteLength), Oe(e, t);
|
|
124
|
-
}, V = (e, t) => {
|
|
125
|
-
ke(e, t);
|
|
126
|
-
const r = new DataView(e.cbuf.buffer, e.cpos, t);
|
|
127
|
-
return e.cpos += t, r;
|
|
128
|
-
}, Te = (e, t) => V(e, 4).setFloat32(0, t, !1), Me = (e, t) => V(e, 8).setFloat64(0, t, !1), De = (e, t) => V(e, 8).setBigInt64(0, t, !1), Y = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(4)), Fe = (e) => (Y.setFloat32(0, e), Y.getFloat32(0) === e), q = (e, t) => {
|
|
129
|
-
switch (typeof t) {
|
|
130
|
-
case "string":
|
|
131
|
-
o(e, 119), L(e, t);
|
|
132
|
-
break;
|
|
133
|
-
case "number":
|
|
134
|
-
ge(t) && ve(t) <= 2147483647 ? (o(e, 125), Le(e, t)) : Fe(t) ? (o(e, 124), Te(e, t)) : (o(e, 123), Me(e, t));
|
|
135
|
-
break;
|
|
136
|
-
case "bigint":
|
|
137
|
-
o(e, 122), De(e, t);
|
|
138
|
-
break;
|
|
139
|
-
case "object":
|
|
140
|
-
if (t === null) o(e, 126);
|
|
141
|
-
else if (ce(t)) {
|
|
142
|
-
o(e, 117), c(e, t.length);
|
|
143
|
-
for (let r = 0; r < t.length; r++) q(e, t[r]);
|
|
144
|
-
} else if (t instanceof Uint8Array)
|
|
145
|
-
o(e, 116), S(e, t);
|
|
146
|
-
else {
|
|
147
|
-
o(e, 118);
|
|
148
|
-
const r = Object.keys(t);
|
|
149
|
-
c(e, r.length);
|
|
150
|
-
for (let s = 0; s < r.length; s++) {
|
|
151
|
-
const a = r[s];
|
|
152
|
-
L(e, a), q(e, t[a]);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
break;
|
|
156
|
-
case "boolean":
|
|
157
|
-
o(e, t ? 120 : 121);
|
|
158
|
-
break;
|
|
159
|
-
default:
|
|
160
|
-
o(e, 127);
|
|
161
|
-
}
|
|
162
|
-
}, H = C("Unexpected end of array"), ee = C("Integer out of Range"), Ve = class {
|
|
163
|
-
constructor(e) {
|
|
164
|
-
this.arr = e, this.pos = 0;
|
|
165
|
-
}
|
|
166
|
-
}, Pe = (e) => new Ve(e), xe = (e, t) => {
|
|
167
|
-
const r = new Uint8Array(e.arr.buffer, e.pos + e.arr.byteOffset, t);
|
|
168
|
-
return e.pos += t, r;
|
|
169
|
-
}, _ = (e) => xe(e, p(e)), E = (e) => e.arr[e.pos++], p = (e) => {
|
|
170
|
-
let t = 0, r = 1;
|
|
171
|
-
const s = e.arr.length;
|
|
172
|
-
for (; e.pos < s; ) {
|
|
173
|
-
const a = e.arr[e.pos++];
|
|
174
|
-
if (t = t + (a & 127) * r, r *= 128, a < 128) return t;
|
|
175
|
-
if (t > Q) throw ee;
|
|
176
|
-
}
|
|
177
|
-
throw H;
|
|
178
|
-
}, Re = (e) => {
|
|
179
|
-
let t = e.arr[e.pos++], r = t & 63, s = 64;
|
|
180
|
-
const a = (t & 64) > 0 ? -1 : 1;
|
|
181
|
-
if ((t & 128) === 0) return a * r;
|
|
182
|
-
const n = e.arr.length;
|
|
183
|
-
for (; e.pos < n; ) {
|
|
184
|
-
if (t = e.arr[e.pos++], r = r + (t & 127) * s, s *= 128, t < 128) return a * r;
|
|
185
|
-
if (r > Q) throw ee;
|
|
186
|
-
}
|
|
187
|
-
throw H;
|
|
188
|
-
}, je = (e) => {
|
|
189
|
-
let t = p(e);
|
|
190
|
-
if (t === 0) return "";
|
|
191
|
-
{
|
|
192
|
-
let r = String.fromCodePoint(E(e));
|
|
193
|
-
if (--t < 100) for (; t--; ) r += String.fromCodePoint(E(e));
|
|
194
|
-
else for (; t > 0; ) {
|
|
195
|
-
const s = t < 1e4 ? t : 1e4, a = e.arr.subarray(e.pos, e.pos + s);
|
|
196
|
-
e.pos += s, r += String.fromCodePoint.apply(null, a), t -= s;
|
|
197
|
-
}
|
|
198
|
-
return decodeURIComponent(escape(r));
|
|
199
|
-
}
|
|
200
|
-
}, ze = (e) => b.decode(_(e)), N = b ? ze : je, P = (e, t) => {
|
|
201
|
-
const r = new DataView(e.arr.buffer, e.arr.byteOffset + e.pos, t);
|
|
202
|
-
return e.pos += t, r;
|
|
203
|
-
}, $e = (e) => P(e, 4).getFloat32(0, !1), Ye = (e) => P(e, 8).getFloat64(0, !1), qe = (e) => P(e, 8).getBigInt64(0, !1), Ge = [
|
|
204
|
-
(e) => {
|
|
205
|
-
},
|
|
206
|
-
(e) => null,
|
|
207
|
-
Re,
|
|
208
|
-
$e,
|
|
209
|
-
Ye,
|
|
210
|
-
qe,
|
|
211
|
-
(e) => !1,
|
|
212
|
-
(e) => !0,
|
|
213
|
-
N,
|
|
214
|
-
(e) => {
|
|
215
|
-
const t = p(e), r = {};
|
|
216
|
-
for (let s = 0; s < t; s++) {
|
|
217
|
-
const a = N(e);
|
|
218
|
-
r[a] = G(e);
|
|
219
|
-
}
|
|
220
|
-
return r;
|
|
221
|
-
},
|
|
222
|
-
(e) => {
|
|
223
|
-
const t = p(e), r = [];
|
|
224
|
-
for (let s = 0; s < t; s++) r.push(G(e));
|
|
225
|
-
return r;
|
|
226
|
-
},
|
|
227
|
-
_
|
|
228
|
-
], G = (e) => Ge[127 - E(e)](e), X = (e) => e === void 0 ? null : e, Xe = class {
|
|
229
|
-
constructor() {
|
|
230
|
-
this.map = /* @__PURE__ */ new Map();
|
|
231
|
-
}
|
|
232
|
-
setItem(e, t) {
|
|
233
|
-
this.map.set(e, t);
|
|
234
|
-
}
|
|
235
|
-
getItem(e) {
|
|
236
|
-
return this.map.get(e);
|
|
237
|
-
}
|
|
238
|
-
}, te = new Xe(), x = !0;
|
|
239
|
-
try {
|
|
240
|
-
typeof localStorage < "u" && localStorage && (te = localStorage, x = !1);
|
|
241
|
-
} catch {
|
|
242
|
-
}
|
|
243
|
-
var re = te, Je = (e) => x || addEventListener("storage", e), Ze = (e) => x || removeEventListener("storage", e), B = /* @__PURE__ */ Symbol("Equality"), Mt = (e, t) => e === t || !!e?.[B]?.(t) || !1, Dt = (e) => typeof e == "object", Ke = Object.keys, Ft = (e, t) => {
|
|
244
|
-
const r = [];
|
|
245
|
-
for (const s in e) r.push(t(e[s], s));
|
|
246
|
-
return r;
|
|
247
|
-
}, J = (e) => Ke(e).length, Vt = (e, t) => {
|
|
248
|
-
for (const r in e) if (!t(e[r], r)) return !1;
|
|
249
|
-
return !0;
|
|
250
|
-
}, Qe = (e, t) => Object.prototype.hasOwnProperty.call(e, t), Pt = () => {
|
|
251
|
-
}, m = (e, t) => {
|
|
252
|
-
if (e === t) return !0;
|
|
253
|
-
if (e == null || t == null || e.constructor !== t.constructor && (e.constructor || Object) !== (t.constructor || Object)) return !1;
|
|
254
|
-
if (e[B] != null) return e[B](t);
|
|
255
|
-
switch (e.constructor) {
|
|
256
|
-
case ArrayBuffer:
|
|
257
|
-
e = new Uint8Array(e), t = new Uint8Array(t);
|
|
258
|
-
case Uint8Array:
|
|
259
|
-
if (e.byteLength !== t.byteLength) return !1;
|
|
260
|
-
for (let r = 0; r < e.length; r++) if (e[r] !== t[r]) return !1;
|
|
261
|
-
break;
|
|
262
|
-
case Set:
|
|
263
|
-
if (e.size !== t.size) return !1;
|
|
264
|
-
for (const r of e) if (!t.has(r)) return !1;
|
|
265
|
-
break;
|
|
266
|
-
case Map:
|
|
267
|
-
if (e.size !== t.size) return !1;
|
|
268
|
-
for (const r of e.keys()) if (!t.has(r) || !m(e.get(r), t.get(r))) return !1;
|
|
269
|
-
break;
|
|
270
|
-
case void 0:
|
|
271
|
-
case Object:
|
|
272
|
-
if (J(e) !== J(t)) return !1;
|
|
273
|
-
for (const r in e) if (!Qe(e, r) || !m(e[r], t[r])) return !1;
|
|
274
|
-
break;
|
|
275
|
-
case Array:
|
|
276
|
-
if (e.length !== t.length) return !1;
|
|
277
|
-
for (let r = 0; r < e.length; r++) if (!m(e[r], t[r])) return !1;
|
|
278
|
-
break;
|
|
279
|
-
default:
|
|
280
|
-
return !1;
|
|
281
|
-
}
|
|
282
|
-
return !0;
|
|
283
|
-
}, We = (e, t) => t.includes(e), y = typeof process < "u" && process.release && /node|io\.js/.test(process.release.name) && Object.prototype.toString.call(typeof process < "u" ? process : 0) === "[object process]", se = typeof window < "u" && typeof document < "u" && !y, xt = typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1, u, He = [], et = () => {
|
|
284
|
-
if (u === void 0)
|
|
285
|
-
if (y) {
|
|
286
|
-
u = h();
|
|
287
|
-
const e = process.argv;
|
|
288
|
-
let t = null;
|
|
289
|
-
for (let r = 0; r < e.length; r++) {
|
|
290
|
-
const s = e[r];
|
|
291
|
-
s[0] === "-" ? (t !== null && u.set(t, ""), t = s) : t !== null ? (u.set(t, s), t = null) : He.push(s);
|
|
292
|
-
}
|
|
293
|
-
t !== null && u.set(t, "");
|
|
294
|
-
} else typeof location == "object" ? (u = h(), (location.search || "?").slice(1).split("&").forEach((e) => {
|
|
295
|
-
if (e.length !== 0) {
|
|
296
|
-
const [t, r] = e.split("=");
|
|
297
|
-
u.set(`--${$(t, "-")}`, r), u.set(`-${$(t, "-")}`, r);
|
|
298
|
-
}
|
|
299
|
-
})) : u = h();
|
|
300
|
-
return u;
|
|
301
|
-
}, O = (e) => et().has(e), T = (e) => X(y ? process.env[e.toUpperCase().replaceAll("-", "_")] : re.getItem(e)), ae = (e) => O("--" + e) || T(e) !== null, Rt = ae("production"), tt = y && We(process.env.FORCE_COLOR, [
|
|
302
|
-
"true",
|
|
303
|
-
"1",
|
|
304
|
-
"2"
|
|
305
|
-
]), jt = tt || !O("--no-colors") && !ae("no-color") && (!y || process.stdout.isTTY) && (!y || O("--color") || T("COLORTERM") !== null || (T("TERM") || "").includes("color")), rt = (e) => new Uint8Array(e), st = (e, t, r) => new Uint8Array(e, t, r), at = (e) => new Uint8Array(e), nt = (e) => {
|
|
306
|
-
let t = "";
|
|
307
|
-
for (let r = 0; r < e.byteLength; r++) t += W(e[r]);
|
|
308
|
-
return btoa(t);
|
|
309
|
-
}, ot = (e) => Buffer.from(e.buffer, e.byteOffset, e.byteLength).toString("base64"), lt = (e) => {
|
|
310
|
-
const t = atob(e), r = rt(t.length);
|
|
311
|
-
for (let s = 0; s < t.length; s++) r[s] = t.charCodeAt(s);
|
|
312
|
-
return r;
|
|
313
|
-
}, it = (e) => {
|
|
314
|
-
const t = Buffer.from(e, "base64");
|
|
315
|
-
return st(t.buffer, t.byteOffset, t.byteLength);
|
|
316
|
-
}, ft = se ? nt : ot, ct = se ? lt : it, ne = /* @__PURE__ */ new Map(), ut = class {
|
|
317
|
-
constructor(e) {
|
|
318
|
-
this.room = e, this.onmessage = null, this._onChange = (t) => t.key === e && this.onmessage !== null && this.onmessage({ data: ct(t.newValue || "") }), Je(this._onChange);
|
|
319
|
-
}
|
|
320
|
-
postMessage(e) {
|
|
321
|
-
re.setItem(this.room, ft(at(e)));
|
|
322
|
-
}
|
|
323
|
-
close() {
|
|
324
|
-
Ze(this._onChange);
|
|
325
|
-
}
|
|
326
|
-
}, vt = typeof BroadcastChannel > "u" ? ut : BroadcastChannel, R = (e) => D(ne, e, () => {
|
|
327
|
-
const t = F(), r = new vt(e);
|
|
328
|
-
return r.onmessage = (s) => t.forEach((a) => a(s.data, "broadcastchannel")), {
|
|
329
|
-
bc: r,
|
|
330
|
-
subs: t
|
|
331
|
-
};
|
|
332
|
-
}), zt = (e, t) => (R(e).subs.add(t), t), $t = (e, t) => {
|
|
333
|
-
const r = R(e), s = r.subs.delete(t);
|
|
334
|
-
return s && r.subs.size === 0 && (r.bc.close(), ne.delete(e)), s;
|
|
335
|
-
}, Yt = (e, t, r = null) => {
|
|
336
|
-
const s = R(e);
|
|
337
|
-
s.bc.postMessage(t), s.subs.forEach((a) => a(t, r));
|
|
338
|
-
};
|
|
339
|
-
var qt = (e, t) => {
|
|
340
|
-
c(e, 0);
|
|
341
|
-
const r = M.encodeStateVector(t);
|
|
342
|
-
S(e, r);
|
|
343
|
-
}, ht = (e, t, r) => {
|
|
344
|
-
c(e, 1), S(e, M.encodeStateAsUpdate(t, r));
|
|
345
|
-
}, pt = (e, t, r) => ht(t, r, _(e)), oe = (e, t, r, s) => {
|
|
346
|
-
try {
|
|
347
|
-
M.applyUpdate(t, _(e), r);
|
|
348
|
-
} catch (a) {
|
|
349
|
-
s?.(a), console.error("Caught error while handling a Yjs update", a);
|
|
350
|
-
}
|
|
351
|
-
}, Gt = (e, t) => {
|
|
352
|
-
c(e, 2), S(e, t);
|
|
353
|
-
}, gt = oe, Xt = (e, t, r, s, a) => {
|
|
354
|
-
const n = p(e);
|
|
355
|
-
switch (n) {
|
|
356
|
-
case 0:
|
|
357
|
-
pt(e, t, r);
|
|
358
|
-
break;
|
|
359
|
-
case 1:
|
|
360
|
-
oe(e, r, s, a);
|
|
361
|
-
break;
|
|
362
|
-
case 2:
|
|
363
|
-
gt(e, r, s, a);
|
|
364
|
-
break;
|
|
365
|
-
default:
|
|
366
|
-
throw new Error("Unknown message type");
|
|
367
|
-
}
|
|
368
|
-
return n;
|
|
369
|
-
}, yt = 3e4, Jt = class extends ue {
|
|
370
|
-
constructor(e) {
|
|
371
|
-
super(), this.doc = e, this.clientID = e.clientID, this.states = /* @__PURE__ */ new Map(), this.meta = /* @__PURE__ */ new Map(), this._checkInterval = setInterval(() => {
|
|
372
|
-
const t = I();
|
|
373
|
-
this.getLocalState() !== null && 3e4 / 2 <= t - this.meta.get(this.clientID).lastUpdated && this.setLocalState(this.getLocalState());
|
|
374
|
-
const r = [];
|
|
375
|
-
this.meta.forEach((s, a) => {
|
|
376
|
-
a !== this.clientID && 3e4 <= t - s.lastUpdated && this.states.has(a) && r.push(a);
|
|
377
|
-
}), r.length > 0 && bt(this, r, "timeout");
|
|
378
|
-
}, w(yt / 10)), e.on("destroy", () => {
|
|
379
|
-
this.destroy();
|
|
380
|
-
}), this.setLocalState({});
|
|
381
|
-
}
|
|
382
|
-
destroy() {
|
|
383
|
-
this.emit("destroy", [this]), this.setLocalState(null), super.destroy(), clearInterval(this._checkInterval);
|
|
384
|
-
}
|
|
385
|
-
getLocalState() {
|
|
386
|
-
return this.states.get(this.clientID) || null;
|
|
387
|
-
}
|
|
388
|
-
setLocalState(e) {
|
|
389
|
-
const t = this.clientID, r = this.meta.get(t), s = r === void 0 ? 0 : r.clock + 1, a = this.states.get(t);
|
|
390
|
-
e === null ? this.states.delete(t) : this.states.set(t, e), this.meta.set(t, {
|
|
391
|
-
clock: s,
|
|
392
|
-
lastUpdated: I()
|
|
393
|
-
});
|
|
394
|
-
const n = [], l = [], v = [], i = [];
|
|
395
|
-
e === null ? i.push(t) : a == null ? e != null && n.push(t) : (l.push(t), m(a, e) || v.push(t)), (n.length > 0 || v.length > 0 || i.length > 0) && this.emit("change", [{
|
|
396
|
-
added: n,
|
|
397
|
-
updated: v,
|
|
398
|
-
removed: i
|
|
399
|
-
}, "local"]), this.emit("update", [{
|
|
400
|
-
added: n,
|
|
401
|
-
updated: l,
|
|
402
|
-
removed: i
|
|
403
|
-
}, "local"]);
|
|
404
|
-
}
|
|
405
|
-
setLocalStateField(e, t) {
|
|
406
|
-
const r = this.getLocalState();
|
|
407
|
-
r !== null && this.setLocalState({
|
|
408
|
-
...r,
|
|
409
|
-
[e]: t
|
|
410
|
-
});
|
|
411
|
-
}
|
|
412
|
-
getStates() {
|
|
413
|
-
return this.states;
|
|
414
|
-
}
|
|
415
|
-
}, bt = (e, t, r) => {
|
|
416
|
-
const s = [];
|
|
417
|
-
for (let a = 0; a < t.length; a++) {
|
|
418
|
-
const n = t[a];
|
|
419
|
-
if (e.states.has(n)) {
|
|
420
|
-
if (e.states.delete(n), n === e.clientID) {
|
|
421
|
-
const l = e.meta.get(n);
|
|
422
|
-
e.meta.set(n, {
|
|
423
|
-
clock: l.clock + 1,
|
|
424
|
-
lastUpdated: I()
|
|
425
|
-
});
|
|
426
|
-
}
|
|
427
|
-
s.push(n);
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
s.length > 0 && (e.emit("change", [{
|
|
431
|
-
added: [],
|
|
432
|
-
updated: [],
|
|
433
|
-
removed: s
|
|
434
|
-
}, r]), e.emit("update", [{
|
|
435
|
-
added: [],
|
|
436
|
-
updated: [],
|
|
437
|
-
removed: s
|
|
438
|
-
}, r]));
|
|
439
|
-
}, Zt = (e, t, r = e.states) => {
|
|
440
|
-
const s = t.length, a = Ie();
|
|
441
|
-
c(a, s);
|
|
442
|
-
for (let n = 0; n < s; n++) {
|
|
443
|
-
const l = t[n], v = r.get(l) || null, i = e.meta.get(l).clock;
|
|
444
|
-
c(a, l), c(a, i), L(a, JSON.stringify(v));
|
|
445
|
-
}
|
|
446
|
-
return _e(a);
|
|
447
|
-
}, Kt = (e, t, r) => {
|
|
448
|
-
const s = Pe(t), a = I(), n = [], l = [], v = [], i = [], le = p(s);
|
|
449
|
-
for (let j = 0; j < le; j++) {
|
|
450
|
-
const f = p(s);
|
|
451
|
-
let U = p(s);
|
|
452
|
-
const g = JSON.parse(N(s)), A = e.meta.get(f), ie = e.states.get(f), z = A === void 0 ? 0 : A.clock;
|
|
453
|
-
(z < U || z === U && g === null && e.states.has(f)) && (g === null ? f === e.clientID && e.getLocalState() != null ? U++ : e.states.delete(f) : e.states.set(f, g), e.meta.set(f, {
|
|
454
|
-
clock: U,
|
|
455
|
-
lastUpdated: a
|
|
456
|
-
}), A === void 0 && g !== null ? n.push(f) : A !== void 0 && g === null ? i.push(f) : g !== null && (m(g, ie) || v.push(f), l.push(f)));
|
|
457
|
-
}
|
|
458
|
-
(n.length > 0 || v.length > 0 || i.length > 0) && e.emit("change", [{
|
|
459
|
-
added: n,
|
|
460
|
-
updated: v,
|
|
461
|
-
removed: i
|
|
462
|
-
}, r]), (n.length > 0 || l.length > 0 || i.length > 0) && e.emit("update", [{
|
|
463
|
-
added: n,
|
|
464
|
-
updated: l,
|
|
465
|
-
removed: i
|
|
466
|
-
}, r]);
|
|
467
|
-
};
|
|
468
|
-
export {
|
|
469
|
-
ue as $,
|
|
470
|
-
p as A,
|
|
471
|
-
Ue as B,
|
|
472
|
-
Ft as C,
|
|
473
|
-
G as D,
|
|
474
|
-
Pe as E,
|
|
475
|
-
q as F,
|
|
476
|
-
C as G,
|
|
477
|
-
Ot as H,
|
|
478
|
-
Tt as I,
|
|
479
|
-
I as J,
|
|
480
|
-
Ct as K,
|
|
481
|
-
L,
|
|
482
|
-
Ie as M,
|
|
483
|
-
Ce as N,
|
|
484
|
-
E as O,
|
|
485
|
-
_e as P,
|
|
486
|
-
It as Q,
|
|
487
|
-
c as R,
|
|
488
|
-
Dt as S,
|
|
489
|
-
Mt as T,
|
|
490
|
-
Q as U,
|
|
491
|
-
W as V,
|
|
492
|
-
kt as W,
|
|
493
|
-
Ut as X,
|
|
494
|
-
w as Y,
|
|
495
|
-
he as Z,
|
|
496
|
-
jt as _,
|
|
497
|
-
Xt as a,
|
|
498
|
-
h as at,
|
|
499
|
-
Vt as b,
|
|
500
|
-
Gt as c,
|
|
501
|
-
$t as d,
|
|
502
|
-
St as et,
|
|
503
|
-
ct as f,
|
|
504
|
-
Rt as g,
|
|
505
|
-
y as h,
|
|
506
|
-
bt as i,
|
|
507
|
-
F as it,
|
|
508
|
-
_ as j,
|
|
509
|
-
N as k,
|
|
510
|
-
Yt as l,
|
|
511
|
-
T as m,
|
|
512
|
-
Kt as n,
|
|
513
|
-
ce as nt,
|
|
514
|
-
qt as o,
|
|
515
|
-
mt as ot,
|
|
516
|
-
ft as p,
|
|
517
|
-
_t as q,
|
|
518
|
-
Zt as r,
|
|
519
|
-
dt as rt,
|
|
520
|
-
ht as s,
|
|
521
|
-
D as st,
|
|
522
|
-
Jt as t,
|
|
523
|
-
wt as tt,
|
|
524
|
-
zt as u,
|
|
525
|
-
m as v,
|
|
526
|
-
B as w,
|
|
527
|
-
Qe as x,
|
|
528
|
-
Pt as y,
|
|
529
|
-
S as z
|
|
530
|
-
};
|