@graffiti-garden/wrapper-vue 0.7.0 → 0.7.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/browser/plugin.mjs +148 -148
- package/dist/browser/plugin.mjs.map +1 -1
- package/dist/node/globals.d.ts +5 -3
- package/dist/node/globals.d.ts.map +1 -1
- package/dist/node/plugin.d.ts.map +1 -1
- package/dist/node/plugin.js +1 -1
- package/dist/node/plugin.js.map +1 -1
- package/dist/node/plugin.mjs +97 -97
- package/dist/node/plugin.mjs.map +1 -1
- package/package.json +3 -3
- package/src/globals.ts +7 -8
- package/src/plugin.ts +3 -3
package/dist/browser/plugin.mjs
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var v = (t, n, e) =>
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
const t =
|
|
1
|
+
var fe = Object.defineProperty;
|
|
2
|
+
var he = (t, n, e) => n in t ? fe(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
|
|
3
|
+
var v = (t, n, e) => he(t, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { ref as B, computed as pe, watch as de, onScopeDispose as ye, toValue as P, defineComponent as W, toRef as b, renderSlot as J, unref as g } from "vue";
|
|
5
|
+
const q = {};
|
|
6
|
+
function M() {
|
|
7
|
+
const t = q.graffitiSynchronize;
|
|
8
8
|
if (!t)
|
|
9
9
|
throw new Error(
|
|
10
10
|
"No Graffiti instance provided, did you forget to install the plugin?"
|
|
11
11
|
);
|
|
12
12
|
return t;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
return
|
|
14
|
+
function $e() {
|
|
15
|
+
return M();
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
const t =
|
|
17
|
+
function Y() {
|
|
18
|
+
const t = q.graffitiSession;
|
|
19
19
|
if (!t)
|
|
20
20
|
throw new Error(
|
|
21
21
|
"No Graffiti session provided, did you forget to install the plugin?"
|
|
22
22
|
);
|
|
23
23
|
return t;
|
|
24
24
|
}
|
|
25
|
-
var
|
|
26
|
-
},
|
|
25
|
+
var ve = class {
|
|
26
|
+
}, me = class Z extends Error {
|
|
27
27
|
constructor(n) {
|
|
28
|
-
super(n), this.name = "GraffitiErrorNotFound", Object.setPrototypeOf(this,
|
|
28
|
+
super(n), this.name = "GraffitiErrorNotFound", Object.setPrototypeOf(this, Z.prototype);
|
|
29
29
|
}
|
|
30
|
-
},
|
|
30
|
+
}, be = class ee extends Error {
|
|
31
31
|
constructor(n) {
|
|
32
|
-
super(n), this.name = "GraffitiErrorInvalidSchema", Object.setPrototypeOf(this,
|
|
32
|
+
super(n), this.name = "GraffitiErrorInvalidSchema", Object.setPrototypeOf(this, ee.prototype);
|
|
33
33
|
}
|
|
34
|
-
},
|
|
34
|
+
}, we = class te extends Error {
|
|
35
35
|
constructor(n) {
|
|
36
|
-
super(n), this.name = "GraffitiErrorPatchTestFailed", Object.setPrototypeOf(this,
|
|
36
|
+
super(n), this.name = "GraffitiErrorPatchTestFailed", Object.setPrototypeOf(this, te.prototype);
|
|
37
37
|
}
|
|
38
|
-
},
|
|
38
|
+
}, ge = class ne extends Error {
|
|
39
39
|
constructor(n) {
|
|
40
|
-
super(n), this.name = "GraffitiErrorPatchError", Object.setPrototypeOf(this,
|
|
40
|
+
super(n), this.name = "GraffitiErrorPatchError", Object.setPrototypeOf(this, ne.prototype);
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
class
|
|
43
|
+
class Pe {
|
|
44
44
|
constructor(n) {
|
|
45
45
|
v(this, "poll", async (n) => {
|
|
46
46
|
let e;
|
|
@@ -58,7 +58,7 @@ class xe {
|
|
|
58
58
|
clear() {
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
class
|
|
61
|
+
class re {
|
|
62
62
|
constructor(n) {
|
|
63
63
|
v(this, "iterator");
|
|
64
64
|
v(this, "continue");
|
|
@@ -68,7 +68,7 @@ class oe {
|
|
|
68
68
|
try {
|
|
69
69
|
this.iterator = this.continue();
|
|
70
70
|
} catch (e) {
|
|
71
|
-
if (e instanceof
|
|
71
|
+
if (e instanceof me)
|
|
72
72
|
n("clear"), this.iterator = this.streamFactory();
|
|
73
73
|
else
|
|
74
74
|
throw e;
|
|
@@ -103,15 +103,15 @@ class oe {
|
|
|
103
103
|
this.iterator = void 0, this.continue = void 0;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function ie(t, n) {
|
|
107
107
|
return !n || t.object.lastModified > n.object.lastModified || t.object.lastModified === n.object.lastModified && !t.tombstone && !!n.tombstone;
|
|
108
108
|
}
|
|
109
|
-
class
|
|
109
|
+
class je {
|
|
110
110
|
constructor() {
|
|
111
|
-
v(this, "entry",
|
|
111
|
+
v(this, "entry", B());
|
|
112
112
|
}
|
|
113
113
|
get result() {
|
|
114
|
-
return
|
|
114
|
+
return pe(() => {
|
|
115
115
|
const n = this.entry.value;
|
|
116
116
|
return n && (n.tombstone ? null : n.object);
|
|
117
117
|
});
|
|
@@ -124,12 +124,12 @@ class Oe {
|
|
|
124
124
|
this.clear();
|
|
125
125
|
return;
|
|
126
126
|
}
|
|
127
|
-
(!n ||
|
|
127
|
+
(!n || ie(n, this.entry.value)) && (this.entry.value = n);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
class
|
|
130
|
+
class oe {
|
|
131
131
|
constructor(n) {
|
|
132
|
-
v(this, "results",
|
|
132
|
+
v(this, "results", B([]));
|
|
133
133
|
v(this, "resultsRaw", /* @__PURE__ */ new Map());
|
|
134
134
|
v(this, "batchFlattenTimer");
|
|
135
135
|
this.graffiti = n;
|
|
@@ -147,12 +147,12 @@ class ae {
|
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
149
|
const e = this.resultsRaw.get(n.object.url);
|
|
150
|
-
|
|
150
|
+
ie(n, e) && (this.resultsRaw.set(n.object.url, n), this.batchFlattenTimer || (this.batchFlattenTimer = setTimeout(() => {
|
|
151
151
|
this.flattenResults(), this.batchFlattenTimer = void 0;
|
|
152
152
|
}, 0)));
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function H(t, n, e, r, o) {
|
|
156
156
|
let i;
|
|
157
157
|
async function a() {
|
|
158
158
|
i = e();
|
|
@@ -175,8 +175,8 @@ function J(t, n, e, r, o) {
|
|
|
175
175
|
if (h !== c) return;
|
|
176
176
|
l = !1, P(o) && s();
|
|
177
177
|
}
|
|
178
|
-
}, f =
|
|
179
|
-
return
|
|
178
|
+
}, f = B(!1);
|
|
179
|
+
return de(
|
|
180
180
|
r,
|
|
181
181
|
async (h, u) => {
|
|
182
182
|
if (JSON.stringify(h) === JSON.stringify(u))
|
|
@@ -194,11 +194,11 @@ function J(t, n, e, r, o) {
|
|
|
194
194
|
{
|
|
195
195
|
immediate: !0
|
|
196
196
|
}
|
|
197
|
-
),
|
|
197
|
+
), ye(() => {
|
|
198
198
|
i == null || i.return(null), t.clear(), n.clear(), c = void 0;
|
|
199
199
|
}), { poll: s, isInitialPolling: f };
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function se(t, n) {
|
|
202
202
|
return () => {
|
|
203
203
|
const e = P(n);
|
|
204
204
|
return e === void 0 ? t == null ? void 0 : t.value : e;
|
|
@@ -207,8 +207,8 @@ function ue(t, n) {
|
|
|
207
207
|
function E(t) {
|
|
208
208
|
return t.map((n) => n());
|
|
209
209
|
}
|
|
210
|
-
function
|
|
211
|
-
const o =
|
|
210
|
+
function xe(t, n, e, r = !1) {
|
|
211
|
+
const o = M(), i = Y(), a = () => P(t), l = () => P(n), c = se(i, e), s = [a, l, c], f = () => o.synchronizeDiscover(...E(s)), h = () => o.discover(...E(s)), u = new oe(o), d = new re(h), { poll: p, isInitialPolling: y } = H(
|
|
212
212
|
u,
|
|
213
213
|
d,
|
|
214
214
|
f,
|
|
@@ -237,12 +237,12 @@ function Se(t, n, e, r = !1) {
|
|
|
237
237
|
isInitialPolling: y
|
|
238
238
|
};
|
|
239
239
|
}
|
|
240
|
-
function
|
|
241
|
-
const o =
|
|
240
|
+
function Oe(t, n, e, r = !1) {
|
|
241
|
+
const o = M(), i = Y(), a = () => P(t), l = () => P(n), c = se(i, e), s = [
|
|
242
242
|
a,
|
|
243
243
|
l,
|
|
244
244
|
c
|
|
245
|
-
], f = () => o.synchronizeGet(...E(s)), h = new
|
|
245
|
+
], f = () => o.synchronizeGet(...E(s)), h = new je(), u = () => o.get(...E(s)), d = new Pe(u), { poll: p, isInitialPolling: y } = H(
|
|
246
246
|
h,
|
|
247
247
|
d,
|
|
248
248
|
f,
|
|
@@ -272,8 +272,8 @@ function Ee(t, n, e, r = !1) {
|
|
|
272
272
|
isInitialPolling: y
|
|
273
273
|
};
|
|
274
274
|
}
|
|
275
|
-
function
|
|
276
|
-
const r =
|
|
275
|
+
function Se(t, n, e = !1) {
|
|
276
|
+
const r = M(), a = [() => P(t), () => P(n)], l = () => r.synchronizeRecoverOrphans(...E(a)), c = new oe(r), s = () => r.recoverOrphans(...E(a)), f = new re(s), { poll: h, isInitialPolling: u } = H(
|
|
277
277
|
c,
|
|
278
278
|
f,
|
|
279
279
|
l,
|
|
@@ -302,7 +302,7 @@ function Ge(t, n, e = !1) {
|
|
|
302
302
|
isInitialPolling: u
|
|
303
303
|
};
|
|
304
304
|
}
|
|
305
|
-
const
|
|
305
|
+
const ae = /* @__PURE__ */ W({
|
|
306
306
|
__name: "Discover",
|
|
307
307
|
props: {
|
|
308
308
|
channels: {},
|
|
@@ -311,19 +311,19 @@ const ce = /* @__PURE__ */ L({
|
|
|
311
311
|
autopoll: { type: Boolean }
|
|
312
312
|
},
|
|
313
313
|
setup(t) {
|
|
314
|
-
const n = t, { objects: e, poll: r, isInitialPolling: o } =
|
|
314
|
+
const n = t, { objects: e, poll: r, isInitialPolling: o } = xe(
|
|
315
315
|
b(n, "channels"),
|
|
316
316
|
b(n, "schema"),
|
|
317
317
|
b(n, "session"),
|
|
318
318
|
b(n, "autopoll")
|
|
319
319
|
);
|
|
320
|
-
return (i, a) =>
|
|
320
|
+
return (i, a) => J(i.$slots, "default", {
|
|
321
321
|
objects: g(e),
|
|
322
322
|
poll: g(r),
|
|
323
323
|
isInitialPolling: g(o)
|
|
324
324
|
});
|
|
325
325
|
}
|
|
326
|
-
}),
|
|
326
|
+
}), ue = /* @__PURE__ */ W({
|
|
327
327
|
__name: "Get",
|
|
328
328
|
props: {
|
|
329
329
|
url: {},
|
|
@@ -332,19 +332,19 @@ const ce = /* @__PURE__ */ L({
|
|
|
332
332
|
autopoll: { type: Boolean }
|
|
333
333
|
},
|
|
334
334
|
setup(t) {
|
|
335
|
-
const n = t, { object: e, poll: r, isInitialPolling: o } =
|
|
335
|
+
const n = t, { object: e, poll: r, isInitialPolling: o } = Oe(
|
|
336
336
|
b(n, "url"),
|
|
337
337
|
b(n, "schema"),
|
|
338
338
|
b(n, "session"),
|
|
339
339
|
b(n, "autopoll")
|
|
340
340
|
);
|
|
341
|
-
return (i, a) =>
|
|
341
|
+
return (i, a) => J(i.$slots, "default", {
|
|
342
342
|
object: g(e),
|
|
343
343
|
poll: g(r),
|
|
344
344
|
isInitialPolling: g(o)
|
|
345
345
|
});
|
|
346
346
|
}
|
|
347
|
-
}),
|
|
347
|
+
}), ce = /* @__PURE__ */ W({
|
|
348
348
|
__name: "RecoverOrphans",
|
|
349
349
|
props: {
|
|
350
350
|
schema: {},
|
|
@@ -352,12 +352,12 @@ const ce = /* @__PURE__ */ L({
|
|
|
352
352
|
autopoll: { type: Boolean }
|
|
353
353
|
},
|
|
354
354
|
setup(t) {
|
|
355
|
-
const n = t, { objects: e, poll: r, isInitialPolling: o } =
|
|
355
|
+
const n = t, { objects: e, poll: r, isInitialPolling: o } = Se(
|
|
356
356
|
b(n, "schema"),
|
|
357
357
|
b(n, "session"),
|
|
358
358
|
b(n, "autopoll")
|
|
359
359
|
);
|
|
360
|
-
return (i, a) =>
|
|
360
|
+
return (i, a) => J(i.$slots, "default", {
|
|
361
361
|
objects: g(e),
|
|
362
362
|
poll: g(r),
|
|
363
363
|
isInitialPolling: g(o)
|
|
@@ -378,15 +378,15 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
378
378
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
379
379
|
PERFORMANCE OF THIS SOFTWARE.
|
|
380
380
|
***************************************************************************** */
|
|
381
|
-
var
|
|
382
|
-
return
|
|
381
|
+
var $ = function(t, n) {
|
|
382
|
+
return $ = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
|
|
383
383
|
e.__proto__ = r;
|
|
384
384
|
} || function(e, r) {
|
|
385
385
|
for (var o in r) r.hasOwnProperty(o) && (e[o] = r[o]);
|
|
386
|
-
},
|
|
386
|
+
}, $(t, n);
|
|
387
387
|
};
|
|
388
|
-
function
|
|
389
|
-
|
|
388
|
+
function Ee(t, n) {
|
|
389
|
+
$(t, n);
|
|
390
390
|
function e() {
|
|
391
391
|
this.constructor = t;
|
|
392
392
|
}
|
|
@@ -489,10 +489,10 @@ function _(t) {
|
|
|
489
489
|
};
|
|
490
490
|
throw new TypeError(n ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
491
491
|
}
|
|
492
|
-
function
|
|
493
|
-
return this instanceof
|
|
492
|
+
function R(t) {
|
|
493
|
+
return this instanceof R ? (this.v = t, this) : new R(t);
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function Ge(t, n, e) {
|
|
496
496
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
497
497
|
var r = e.apply(t, n || []), o, i = [];
|
|
498
498
|
return o = {}, a("next"), a("throw"), a("return"), o[Symbol.asyncIterator] = function() {
|
|
@@ -513,7 +513,7 @@ function Re(t, n, e) {
|
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
515
|
function c(u) {
|
|
516
|
-
u.value instanceof
|
|
516
|
+
u.value instanceof R ? Promise.resolve(u.value.v).then(s, f) : h(i[0][2], u);
|
|
517
517
|
}
|
|
518
518
|
function s(u) {
|
|
519
519
|
l("next", u);
|
|
@@ -525,10 +525,10 @@ function Re(t, n, e) {
|
|
|
525
525
|
u(d), i.shift(), i.length && l(i[0][0], i[0][1]);
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
|
-
var
|
|
528
|
+
var le = (
|
|
529
529
|
/** @class */
|
|
530
530
|
function(t) {
|
|
531
|
-
|
|
531
|
+
Ee(n, t);
|
|
532
532
|
function n(e) {
|
|
533
533
|
var r = t.call(this, e) || this;
|
|
534
534
|
return Object.defineProperty(r, "name", {
|
|
@@ -621,10 +621,10 @@ var he = (
|
|
|
621
621
|
return this._q.shift();
|
|
622
622
|
}, t;
|
|
623
623
|
})();
|
|
624
|
-
function
|
|
625
|
-
t != null && typeof t.then == "function" && t.then(
|
|
624
|
+
function U(t) {
|
|
625
|
+
t != null && typeof t.then == "function" && t.then(N, N);
|
|
626
626
|
}
|
|
627
|
-
var
|
|
627
|
+
var C = 0, X = 1, O = 2, D = 3, L = 4, A = 1024, N = function() {
|
|
628
628
|
};
|
|
629
629
|
function S(t) {
|
|
630
630
|
var n = t.err, e = Promise.resolve(t.execution).then(function(r) {
|
|
@@ -639,9 +639,9 @@ function S(t) {
|
|
|
639
639
|
});
|
|
640
640
|
}
|
|
641
641
|
function x(t, n) {
|
|
642
|
-
var e = t.state >=
|
|
642
|
+
var e = t.state >= D;
|
|
643
643
|
return Promise.resolve(n).then(function(r) {
|
|
644
|
-
return !e && t.state >=
|
|
644
|
+
return !e && t.state >= L ? S(t).then(function(o) {
|
|
645
645
|
return {
|
|
646
646
|
value: o,
|
|
647
647
|
done: !0
|
|
@@ -649,11 +649,11 @@ function x(t, n) {
|
|
|
649
649
|
}) : { value: r, done: e };
|
|
650
650
|
});
|
|
651
651
|
}
|
|
652
|
-
function
|
|
652
|
+
function Q(t, n) {
|
|
653
653
|
var e, r;
|
|
654
654
|
if (!(t.state >= O))
|
|
655
655
|
if (t.state = O, t.onnext(), t.onstop(), t.err == null && (t.err = n), t.pushes.length === 0 && (typeof t.buffer > "u" || t.buffer.empty))
|
|
656
|
-
|
|
656
|
+
z(t);
|
|
657
657
|
else
|
|
658
658
|
try {
|
|
659
659
|
for (var o = _(t.pushes), i = o.next(); !i.done; i = o.next()) {
|
|
@@ -670,10 +670,10 @@ function K(t, n) {
|
|
|
670
670
|
}
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
|
-
function
|
|
673
|
+
function z(t) {
|
|
674
674
|
var n, e;
|
|
675
|
-
if (!(t.state >=
|
|
676
|
-
t.state < O &&
|
|
675
|
+
if (!(t.state >= D)) {
|
|
676
|
+
t.state < O && Q(t), t.state = D, t.buffer = void 0;
|
|
677
677
|
try {
|
|
678
678
|
for (var r = _(t.nexts), o = r.next(); !o.done; o = r.next()) {
|
|
679
679
|
var i = o.value, a = t.pending === void 0 ? S(t) : t.pending.then(function() {
|
|
@@ -693,19 +693,19 @@ function R(t) {
|
|
|
693
693
|
t.pushes = [], t.nexts = [];
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
|
-
function
|
|
697
|
-
t.state >=
|
|
696
|
+
function K(t) {
|
|
697
|
+
t.state >= L || (t.state < D && z(t), t.state = L);
|
|
698
698
|
}
|
|
699
|
-
function
|
|
700
|
-
if (
|
|
701
|
-
throw new
|
|
699
|
+
function _e(t, n) {
|
|
700
|
+
if (U(n), t.pushes.length >= A)
|
|
701
|
+
throw new le("No more than " + A + " pending calls to push are allowed on a single repeater.");
|
|
702
702
|
if (t.state >= O)
|
|
703
703
|
return Promise.resolve(void 0);
|
|
704
704
|
var e = t.pending === void 0 ? Promise.resolve(n) : t.pending.then(function() {
|
|
705
705
|
return n;
|
|
706
706
|
});
|
|
707
707
|
e = e.catch(function(c) {
|
|
708
|
-
t.state < O && (t.err = c),
|
|
708
|
+
t.state < O && (t.err = c), K(t);
|
|
709
709
|
});
|
|
710
710
|
var r;
|
|
711
711
|
if (t.nexts.length) {
|
|
@@ -727,27 +727,27 @@ function ze(t, n) {
|
|
|
727
727
|
}, a.finally = r.finally.bind(r), t.pending = e.then(function() {
|
|
728
728
|
return l;
|
|
729
729
|
}).catch(function(c) {
|
|
730
|
-
t.err = c,
|
|
730
|
+
t.err = c, K(t);
|
|
731
731
|
}), a;
|
|
732
732
|
}
|
|
733
|
-
function
|
|
734
|
-
var n =
|
|
733
|
+
function ze(t) {
|
|
734
|
+
var n = Q.bind(null, t), e = new Promise(function(r) {
|
|
735
735
|
return t.onstop = r;
|
|
736
736
|
});
|
|
737
737
|
return n.then = e.then.bind(e), n.catch = e.catch.bind(e), n.finally = e.finally.bind(e), n;
|
|
738
738
|
}
|
|
739
|
-
function
|
|
740
|
-
if (!(t.state >=
|
|
741
|
-
t.state =
|
|
742
|
-
var n =
|
|
739
|
+
function Re(t) {
|
|
740
|
+
if (!(t.state >= X)) {
|
|
741
|
+
t.state = X;
|
|
742
|
+
var n = _e.bind(null, t), e = ze(t);
|
|
743
743
|
t.execution = new Promise(function(r) {
|
|
744
744
|
return r(t.executor(n, e));
|
|
745
745
|
}), t.execution.catch(function() {
|
|
746
|
-
return
|
|
746
|
+
return Q(t);
|
|
747
747
|
});
|
|
748
748
|
}
|
|
749
749
|
}
|
|
750
|
-
var F = /* @__PURE__ */ new WeakMap(),
|
|
750
|
+
var F = /* @__PURE__ */ new WeakMap(), k = (
|
|
751
751
|
/** @class */
|
|
752
752
|
function() {
|
|
753
753
|
function t(n, e) {
|
|
@@ -755,23 +755,23 @@ var F = /* @__PURE__ */ new WeakMap(), I = (
|
|
|
755
755
|
executor: n,
|
|
756
756
|
buffer: e,
|
|
757
757
|
err: void 0,
|
|
758
|
-
state:
|
|
758
|
+
state: C,
|
|
759
759
|
pushes: [],
|
|
760
760
|
nexts: [],
|
|
761
761
|
pending: void 0,
|
|
762
762
|
execution: void 0,
|
|
763
|
-
onnext:
|
|
764
|
-
onstop:
|
|
763
|
+
onnext: N,
|
|
764
|
+
onstop: N
|
|
765
765
|
});
|
|
766
766
|
}
|
|
767
767
|
return t.prototype.next = function(n) {
|
|
768
|
-
|
|
768
|
+
U(n);
|
|
769
769
|
var e = F.get(this);
|
|
770
770
|
if (e === void 0)
|
|
771
771
|
throw new Error("WeakMap error");
|
|
772
|
-
if (e.nexts.length >=
|
|
773
|
-
throw new
|
|
774
|
-
if (e.state <=
|
|
772
|
+
if (e.nexts.length >= A)
|
|
773
|
+
throw new le("No more than " + A + " pending calls to next are allowed on a single repeater.");
|
|
774
|
+
if (e.state <= C && Re(e), e.onnext(n), typeof e.buffer < "u" && !e.buffer.empty) {
|
|
775
775
|
var r = x(e, e.buffer.remove());
|
|
776
776
|
if (e.pushes.length) {
|
|
777
777
|
var o = e.pushes.shift();
|
|
@@ -782,42 +782,42 @@ var F = /* @__PURE__ */ new WeakMap(), I = (
|
|
|
782
782
|
var i = e.pushes.shift();
|
|
783
783
|
return e.onnext = i.resolve, x(e, i.value);
|
|
784
784
|
} else if (e.state >= O)
|
|
785
|
-
return
|
|
785
|
+
return z(e), x(e, S(e));
|
|
786
786
|
return new Promise(function(a) {
|
|
787
787
|
return e.nexts.push({ resolve: a, value: n });
|
|
788
788
|
});
|
|
789
789
|
}, t.prototype.return = function(n) {
|
|
790
|
-
|
|
790
|
+
U(n);
|
|
791
791
|
var e = F.get(this);
|
|
792
792
|
if (e === void 0)
|
|
793
793
|
throw new Error("WeakMap error");
|
|
794
|
-
return
|
|
794
|
+
return z(e), e.execution = Promise.resolve(e.execution).then(function() {
|
|
795
795
|
return n;
|
|
796
796
|
}), x(e, S(e));
|
|
797
797
|
}, t.prototype.throw = function(n) {
|
|
798
798
|
var e = F.get(this);
|
|
799
799
|
if (e === void 0)
|
|
800
800
|
throw new Error("WeakMap error");
|
|
801
|
-
return e.state <=
|
|
801
|
+
return e.state <= C || e.state >= O || typeof e.buffer < "u" && !e.buffer.empty ? (z(e), e.err == null && (e.err = n), x(e, S(e))) : this.next(Promise.reject(n));
|
|
802
802
|
}, t.prototype[Symbol.asyncIterator] = function() {
|
|
803
803
|
return this;
|
|
804
|
-
}, t.race =
|
|
804
|
+
}, t.race = ke, t.merge = Ie, t.zip = Te, t.latest = Fe, t;
|
|
805
805
|
}()
|
|
806
806
|
);
|
|
807
|
-
function
|
|
807
|
+
function V(t, n) {
|
|
808
808
|
var e, r, o = [], i = function(s) {
|
|
809
809
|
s != null && typeof s[Symbol.asyncIterator] == "function" ? o.push(s[Symbol.asyncIterator]()) : s != null && typeof s[Symbol.iterator] == "function" ? o.push(s[Symbol.iterator]()) : o.push(function() {
|
|
810
|
-
return
|
|
810
|
+
return Ge(this, arguments, function() {
|
|
811
811
|
return j(this, function(u) {
|
|
812
812
|
switch (u.label) {
|
|
813
813
|
case 0:
|
|
814
|
-
return n.yieldValues ? [4,
|
|
814
|
+
return n.yieldValues ? [4, R(s)] : [3, 3];
|
|
815
815
|
case 1:
|
|
816
816
|
return [4, u.sent()];
|
|
817
817
|
case 2:
|
|
818
818
|
u.sent(), u.label = 3;
|
|
819
819
|
case 3:
|
|
820
|
-
return n.returnValues ? [4,
|
|
820
|
+
return n.returnValues ? [4, R(s)] : [3, 5];
|
|
821
821
|
case 4:
|
|
822
822
|
return [2, u.sent()];
|
|
823
823
|
case 5:
|
|
@@ -846,9 +846,9 @@ function M(t, n) {
|
|
|
846
846
|
}
|
|
847
847
|
return o;
|
|
848
848
|
}
|
|
849
|
-
function
|
|
850
|
-
var n = this, e =
|
|
851
|
-
return new
|
|
849
|
+
function ke(t) {
|
|
850
|
+
var n = this, e = V(t, { returnValues: !0 });
|
|
851
|
+
return new k(function(r, o) {
|
|
852
852
|
return G(n, void 0, void 0, function() {
|
|
853
853
|
var i, a, l, c, s, f;
|
|
854
854
|
return j(this, function(h) {
|
|
@@ -864,7 +864,7 @@ function Te(t) {
|
|
|
864
864
|
}), h.label = 1;
|
|
865
865
|
case 1:
|
|
866
866
|
h.trys.push([1, , 5, 7]), c = void 0, s = 0, f = function() {
|
|
867
|
-
var u, d, p, y, m,
|
|
867
|
+
var u, d, p, y, m, I;
|
|
868
868
|
return j(this, function(T) {
|
|
869
869
|
switch (T.label) {
|
|
870
870
|
case 0:
|
|
@@ -880,7 +880,7 @@ function Te(t) {
|
|
|
880
880
|
m = { error: w };
|
|
881
881
|
} finally {
|
|
882
882
|
try {
|
|
883
|
-
p && !p.done && (
|
|
883
|
+
p && !p.done && (I = d.return) && I.call(d);
|
|
884
884
|
} finally {
|
|
885
885
|
if (m) throw m.error;
|
|
886
886
|
}
|
|
@@ -925,9 +925,9 @@ function Te(t) {
|
|
|
925
925
|
});
|
|
926
926
|
});
|
|
927
927
|
}
|
|
928
|
-
function
|
|
929
|
-
var n = this, e =
|
|
930
|
-
return new
|
|
928
|
+
function Ie(t) {
|
|
929
|
+
var n = this, e = V(t, { yieldValues: !0 });
|
|
930
|
+
return new k(function(r, o) {
|
|
931
931
|
return G(n, void 0, void 0, function() {
|
|
932
932
|
var i, a, l, c = this;
|
|
933
933
|
return j(this, function(s) {
|
|
@@ -1018,9 +1018,9 @@ function Fe(t) {
|
|
|
1018
1018
|
});
|
|
1019
1019
|
});
|
|
1020
1020
|
}
|
|
1021
|
-
function
|
|
1022
|
-
var n = this, e =
|
|
1023
|
-
return new
|
|
1021
|
+
function Te(t) {
|
|
1022
|
+
var n = this, e = V(t, { returnValues: !0 });
|
|
1023
|
+
return new k(function(r, o) {
|
|
1024
1024
|
return G(n, void 0, void 0, function() {
|
|
1025
1025
|
var i, a, l, c;
|
|
1026
1026
|
return j(this, function(s) {
|
|
@@ -1075,12 +1075,12 @@ function qe(t) {
|
|
|
1075
1075
|
});
|
|
1076
1076
|
});
|
|
1077
1077
|
}
|
|
1078
|
-
function
|
|
1079
|
-
var n = this, e =
|
|
1078
|
+
function Fe(t) {
|
|
1079
|
+
var n = this, e = V(t, {
|
|
1080
1080
|
yieldValues: !0,
|
|
1081
1081
|
returnValues: !0
|
|
1082
1082
|
});
|
|
1083
|
-
return new
|
|
1083
|
+
return new k(function(r, o) {
|
|
1084
1084
|
return G(n, void 0, void 0, function() {
|
|
1085
1085
|
var i, a, l, c, s, f = this;
|
|
1086
1086
|
return j(this, function(h) {
|
|
@@ -1096,8 +1096,8 @@ function De(t) {
|
|
|
1096
1096
|
var m = y.value;
|
|
1097
1097
|
m();
|
|
1098
1098
|
}
|
|
1099
|
-
} catch (
|
|
1100
|
-
u = { error:
|
|
1099
|
+
} catch (I) {
|
|
1100
|
+
u = { error: I };
|
|
1101
1101
|
} finally {
|
|
1102
1102
|
try {
|
|
1103
1103
|
y && !y.done && (d = p.return) && d.call(p);
|
|
@@ -1178,36 +1178,36 @@ function De(t) {
|
|
|
1178
1178
|
});
|
|
1179
1179
|
});
|
|
1180
1180
|
}
|
|
1181
|
-
function
|
|
1181
|
+
function qe(t) {
|
|
1182
1182
|
return typeof t == "string" ? t : t.url;
|
|
1183
1183
|
}
|
|
1184
|
-
function
|
|
1184
|
+
function De(t, n, e, r) {
|
|
1185
1185
|
const o = e[n];
|
|
1186
1186
|
if (!(!o || !o.length))
|
|
1187
1187
|
try {
|
|
1188
1188
|
r[n] = t(r[n], o, !0, !1).newDocument;
|
|
1189
1189
|
} catch (i) {
|
|
1190
|
-
throw typeof i == "object" && i && "name" in i && typeof i.name == "string" && "message" in i && typeof i.message == "string" ? i.name === "TEST_OPERATION_FAILED" ? new
|
|
1190
|
+
throw typeof i == "object" && i && "name" in i && typeof i.name == "string" && "message" in i && typeof i.message == "string" ? i.name === "TEST_OPERATION_FAILED" ? new we(i.message) : new ge(i.name + ": " + i.message) : i;
|
|
1191
1191
|
}
|
|
1192
1192
|
}
|
|
1193
|
-
function
|
|
1193
|
+
function Ae(t, n) {
|
|
1194
1194
|
try {
|
|
1195
1195
|
return t.compile(n);
|
|
1196
1196
|
} catch (e) {
|
|
1197
|
-
throw new
|
|
1197
|
+
throw new be(
|
|
1198
1198
|
e instanceof Error ? e.message : void 0
|
|
1199
1199
|
);
|
|
1200
1200
|
}
|
|
1201
1201
|
}
|
|
1202
|
-
function
|
|
1202
|
+
function Ne(t, n, e) {
|
|
1203
1203
|
t.actor !== (e == null ? void 0 : e.actor) && (t.allowed = t.allowed && e ? [e.actor] : void 0, t.channels = t.channels.filter(
|
|
1204
1204
|
(r) => n.includes(r)
|
|
1205
1205
|
));
|
|
1206
1206
|
}
|
|
1207
|
-
function
|
|
1207
|
+
function Be(t, n) {
|
|
1208
1208
|
return t.allowed === void 0 || t.allowed === null || !!(n != null && n.actor) && (t.actor === n.actor || t.allowed.includes(n.actor));
|
|
1209
1209
|
}
|
|
1210
|
-
class
|
|
1210
|
+
class Me extends ve {
|
|
1211
1211
|
/**
|
|
1212
1212
|
* Wraps a Graffiti API instance to provide the synchronize methods.
|
|
1213
1213
|
* The GraffitiSyncrhonize class rather than the Graffiti class
|
|
@@ -1249,7 +1249,7 @@ class Ce extends be {
|
|
|
1249
1249
|
v(this, "patch", async (...e) => {
|
|
1250
1250
|
const r = await this.graffiti.patch(...e), o = { ...r };
|
|
1251
1251
|
for (const i of ["value", "channels", "allowed"])
|
|
1252
|
-
|
|
1252
|
+
De(await this.applyPatch, i, e[0], o);
|
|
1253
1253
|
return await this.synchronizeDispatch(
|
|
1254
1254
|
{
|
|
1255
1255
|
tombstone: !0,
|
|
@@ -1297,17 +1297,17 @@ class Ce extends be {
|
|
|
1297
1297
|
}
|
|
1298
1298
|
synchronize(e, r, o, i) {
|
|
1299
1299
|
const a = /* @__PURE__ */ new Set();
|
|
1300
|
-
return new
|
|
1300
|
+
return new k(
|
|
1301
1301
|
async (c, s) => {
|
|
1302
|
-
const f =
|
|
1302
|
+
const f = Ae(await this.ajv, o), h = (u, d) => {
|
|
1303
1303
|
for (const p of [d, u])
|
|
1304
1304
|
if (p != null && p.tombstone)
|
|
1305
1305
|
a.has(p.object.url) && c(p);
|
|
1306
|
-
else if (p && e(p.object) && (this.options.omniscient ||
|
|
1306
|
+
else if (p && e(p.object) && (this.options.omniscient || Be(p.object, i))) {
|
|
1307
1307
|
const y = JSON.parse(
|
|
1308
1308
|
JSON.stringify(p.object)
|
|
1309
1309
|
);
|
|
1310
|
-
if (this.options.omniscient ||
|
|
1310
|
+
if (this.options.omniscient || Ne(y, r, i), f(y)) {
|
|
1311
1311
|
c({ object: y }), a.add(y.url);
|
|
1312
1312
|
break;
|
|
1313
1313
|
}
|
|
@@ -1350,7 +1350,7 @@ class Ce extends be {
|
|
|
1350
1350
|
* @group Synchronize Methods
|
|
1351
1351
|
*/
|
|
1352
1352
|
synchronizeGet(...e) {
|
|
1353
|
-
const [r, o, i] = e, a =
|
|
1353
|
+
const [r, o, i] = e, a = qe(r);
|
|
1354
1354
|
function l(c) {
|
|
1355
1355
|
return c.url === a;
|
|
1356
1356
|
}
|
|
@@ -1423,9 +1423,9 @@ class Ce extends be {
|
|
|
1423
1423
|
}();
|
|
1424
1424
|
}
|
|
1425
1425
|
}
|
|
1426
|
-
const
|
|
1426
|
+
const Ue = {
|
|
1427
1427
|
install(t, n) {
|
|
1428
|
-
const e = n.graffiti, r = new
|
|
1428
|
+
const e = n.graffiti, r = new Me(e), o = B(void 0);
|
|
1429
1429
|
r.sessionEvents.addEventListener("initialized", async (i) => {
|
|
1430
1430
|
const a = i.detail;
|
|
1431
1431
|
if (a && a.error && console.error(a.error), a && a.href) {
|
|
@@ -1446,19 +1446,19 @@ const We = {
|
|
|
1446
1446
|
}), r.sessionEvents.addEventListener("logout", (i) => {
|
|
1447
1447
|
const a = i.detail;
|
|
1448
1448
|
a.error ? (console.error("Error logging out:"), console.error(a.error)) : o.value = null;
|
|
1449
|
-
}),
|
|
1449
|
+
}), q.graffitiSynchronize = r, q.graffitiSession = o, t.component("GraffitiDiscover", ae), t.component("GraffitiGet", ue), t.component("GraffitiRecoverOrphans", ce), t.config.globalProperties.$graffiti = r, t.config.globalProperties.$graffitiSession = o;
|
|
1450
1450
|
}
|
|
1451
|
-
},
|
|
1451
|
+
}, Le = ae, We = ue, Je = ce;
|
|
1452
1452
|
export {
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1453
|
+
Le as GraffitiDiscover,
|
|
1454
|
+
We as GraffitiGet,
|
|
1455
|
+
Ue as GraffitiPlugin,
|
|
1456
|
+
Je as GraffitiRecoverOrphans,
|
|
1457
|
+
$e as useGraffiti,
|
|
1458
|
+
xe as useGraffitiDiscover,
|
|
1459
|
+
Oe as useGraffitiGet,
|
|
1460
|
+
Se as useGraffitiRecoverOrphans,
|
|
1461
|
+
Y as useGraffitiSession,
|
|
1462
|
+
M as useGraffitiSynchronize
|
|
1463
1463
|
};
|
|
1464
1464
|
//# sourceMappingURL=plugin.mjs.map
|