@graffiti-garden/wrapper-vue 0.6.6 → 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 +332 -380
- package/dist/browser/plugin.mjs.map +1 -1
- package/dist/node/Discover.vue.d.ts +0 -4
- package/dist/node/Discover.vue.d.ts.map +1 -1
- package/dist/node/Get.vue.d.ts +0 -4
- package/dist/node/Get.vue.d.ts.map +1 -1
- package/dist/node/RecoverOrphans.vue.d.ts +0 -4
- package/dist/node/RecoverOrphans.vue.d.ts.map +1 -1
- package/dist/node/composables.d.ts +0 -6
- package/dist/node/composables.d.ts.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 +0 -24
- 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 +159 -207
- package/dist/node/plugin.mjs.map +1 -1
- package/package.json +3 -3
- package/src/Discover.vue +6 -11
- package/src/Get.vue +6 -11
- package/src/RecoverOrphans.vue +5 -10
- package/src/composables.ts +17 -62
- package/src/globals.ts +7 -8
- package/src/plugin.ts +3 -3
package/dist/node/plugin.mjs
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var p = (e, t,
|
|
4
|
-
import {
|
|
5
|
-
import { GraffitiSynchronize as
|
|
6
|
-
const
|
|
7
|
-
function
|
|
8
|
-
const e =
|
|
1
|
+
var M = Object.defineProperty;
|
|
2
|
+
var B = (e, t, r) => t in e ? M(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var p = (e, t, r) => B(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { ref as G, computed as L, watch as k, onScopeDispose as A, toValue as d, defineComponent as S, toRef as u, renderSlot as R, unref as g } from "vue";
|
|
5
|
+
import { GraffitiSynchronize as C } from "@graffiti-garden/wrapper-synchronize";
|
|
6
|
+
const b = {};
|
|
7
|
+
function w() {
|
|
8
|
+
const e = b.graffitiSynchronize;
|
|
9
9
|
if (!e)
|
|
10
10
|
throw new Error(
|
|
11
11
|
"No Graffiti instance provided, did you forget to install the plugin?"
|
|
12
12
|
);
|
|
13
13
|
return e;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return
|
|
15
|
+
function X() {
|
|
16
|
+
return w();
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
const e =
|
|
18
|
+
function F() {
|
|
19
|
+
const e = b.graffitiSession;
|
|
20
20
|
if (!e)
|
|
21
21
|
throw new Error(
|
|
22
22
|
"No Graffiti session provided, did you forget to install the plugin?"
|
|
23
23
|
);
|
|
24
24
|
return e;
|
|
25
25
|
}
|
|
26
|
-
var
|
|
26
|
+
var J = class _ extends Error {
|
|
27
27
|
constructor(t) {
|
|
28
28
|
super(t), this.name = "GraffitiErrorNotFound", Object.setPrototypeOf(this, _.prototype);
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
class
|
|
31
|
+
class U {
|
|
32
32
|
constructor(t) {
|
|
33
33
|
p(this, "poll", async (t) => {
|
|
34
|
-
let
|
|
35
|
-
const
|
|
34
|
+
let r;
|
|
35
|
+
const o = this.getter;
|
|
36
36
|
try {
|
|
37
|
-
|
|
37
|
+
r = await o();
|
|
38
38
|
} catch {
|
|
39
|
-
this.getter ===
|
|
39
|
+
this.getter === o && t(null);
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
|
-
this.getter ===
|
|
42
|
+
this.getter === o && t({ object: r });
|
|
43
43
|
});
|
|
44
44
|
this.getter = t;
|
|
45
45
|
}
|
|
@@ -55,26 +55,26 @@ class O {
|
|
|
55
55
|
if (this.continue)
|
|
56
56
|
try {
|
|
57
57
|
this.iterator = this.continue();
|
|
58
|
-
} catch (
|
|
59
|
-
if (
|
|
58
|
+
} catch (r) {
|
|
59
|
+
if (r instanceof J)
|
|
60
60
|
t("clear"), this.iterator = this.streamFactory();
|
|
61
61
|
else
|
|
62
|
-
throw
|
|
62
|
+
throw r;
|
|
63
63
|
}
|
|
64
64
|
else
|
|
65
65
|
this.iterator = this.streamFactory();
|
|
66
66
|
for (; this.iterator; ) {
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
69
|
-
if (
|
|
70
|
-
|
|
67
|
+
const r = this.iterator, o = await r.next();
|
|
68
|
+
if (r === this.iterator) {
|
|
69
|
+
if (o.done) {
|
|
70
|
+
o.value && (this.iterator = void 0, this.continue = o.value.continue);
|
|
71
71
|
break;
|
|
72
72
|
}
|
|
73
|
-
if (
|
|
74
|
-
console.error(
|
|
73
|
+
if (o.value.error) {
|
|
74
|
+
console.error(o.value.error);
|
|
75
75
|
continue;
|
|
76
76
|
}
|
|
77
|
-
t(
|
|
77
|
+
t(o.value);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
});
|
|
@@ -91,15 +91,15 @@ class O {
|
|
|
91
91
|
this.iterator = void 0, this.continue = void 0;
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function z(e, t) {
|
|
95
95
|
return !t || e.object.lastModified > t.object.lastModified || e.object.lastModified === t.object.lastModified && !e.tombstone && !!t.tombstone;
|
|
96
96
|
}
|
|
97
|
-
class
|
|
97
|
+
class V {
|
|
98
98
|
constructor() {
|
|
99
|
-
p(this, "entry",
|
|
99
|
+
p(this, "entry", G());
|
|
100
100
|
}
|
|
101
101
|
get result() {
|
|
102
|
-
return
|
|
102
|
+
return L(() => {
|
|
103
103
|
const t = this.entry.value;
|
|
104
104
|
return t && (t.tombstone ? null : t.object);
|
|
105
105
|
});
|
|
@@ -112,12 +112,12 @@ class x {
|
|
|
112
112
|
this.clear();
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
(!t ||
|
|
115
|
+
(!t || z(t, this.entry.value)) && (this.entry.value = t);
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
class
|
|
118
|
+
class T {
|
|
119
119
|
constructor(t) {
|
|
120
|
-
p(this, "results",
|
|
120
|
+
p(this, "results", G([]));
|
|
121
121
|
p(this, "resultsRaw", /* @__PURE__ */ new Map());
|
|
122
122
|
p(this, "batchFlattenTimer");
|
|
123
123
|
this.graffiti = t;
|
|
@@ -126,7 +126,7 @@ class $ {
|
|
|
126
126
|
this.resultsRaw.clear(), this.results.value = [], clearTimeout(this.batchFlattenTimer), this.batchFlattenTimer = void 0;
|
|
127
127
|
}
|
|
128
128
|
flattenResults() {
|
|
129
|
-
this.results.value = Array.from(this.resultsRaw.values()).reduce((t,
|
|
129
|
+
this.results.value = Array.from(this.resultsRaw.values()).reduce((t, r) => (r.tombstone || t.push(r.object), t), []);
|
|
130
130
|
}
|
|
131
131
|
onEntry(t) {
|
|
132
132
|
if (!t) return;
|
|
@@ -134,68 +134,74 @@ class $ {
|
|
|
134
134
|
this.clear();
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
|
-
const
|
|
138
|
-
|
|
137
|
+
const r = this.resultsRaw.get(t.object.url);
|
|
138
|
+
z(t, r) && (this.resultsRaw.set(t.object.url, t), this.batchFlattenTimer || (this.batchFlattenTimer = setTimeout(() => {
|
|
139
139
|
this.flattenResults(), this.batchFlattenTimer = void 0;
|
|
140
140
|
}, 0)));
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function E(e, t, r, o, n) {
|
|
144
144
|
let i;
|
|
145
|
-
async function
|
|
146
|
-
i =
|
|
147
|
-
for await (const
|
|
148
|
-
if (
|
|
149
|
-
console.error(
|
|
145
|
+
async function s() {
|
|
146
|
+
i = r();
|
|
147
|
+
for await (const c of i) {
|
|
148
|
+
if (c.error) {
|
|
149
|
+
console.error(c.error);
|
|
150
150
|
continue;
|
|
151
151
|
}
|
|
152
|
-
e.onEntry(
|
|
152
|
+
e.onEntry(c);
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
let
|
|
156
|
-
const
|
|
157
|
-
if (!a)
|
|
158
|
-
|
|
155
|
+
let f = !1, a;
|
|
156
|
+
const l = async () => {
|
|
157
|
+
if (f || !a) return;
|
|
158
|
+
const c = a;
|
|
159
|
+
f = !0;
|
|
160
|
+
try {
|
|
161
|
+
await c();
|
|
162
|
+
} finally {
|
|
163
|
+
if (c !== a) return;
|
|
164
|
+
f = !1, d(n) && l();
|
|
165
|
+
}
|
|
166
|
+
}, h = G(!1);
|
|
167
|
+
return k(
|
|
168
|
+
o,
|
|
169
|
+
async (c, m) => {
|
|
170
|
+
if (JSON.stringify(c) === JSON.stringify(m))
|
|
171
|
+
return;
|
|
172
|
+
i == null || i.return(null), e.clear(), t.clear(), s(), a = () => t.poll(e.onEntry.bind(e));
|
|
173
|
+
const y = a;
|
|
174
|
+
f = !1, h.value = !0;
|
|
159
175
|
try {
|
|
160
|
-
await
|
|
176
|
+
await l();
|
|
161
177
|
} finally {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
}, l = y(!1);
|
|
166
|
-
return A(
|
|
167
|
-
r,
|
|
168
|
-
async (f, g) => {
|
|
169
|
-
if (JSON.stringify(f) !== JSON.stringify(g)) {
|
|
170
|
-
i == null || i.return(null), e.clear(), t.clear(), o(), l.value = !0;
|
|
171
|
-
try {
|
|
172
|
-
await c();
|
|
173
|
-
} finally {
|
|
174
|
-
l.value = !1;
|
|
175
|
-
}
|
|
178
|
+
if (y !== a) return;
|
|
179
|
+
h.value = !1;
|
|
176
180
|
}
|
|
177
181
|
},
|
|
178
182
|
{
|
|
179
183
|
immediate: !0
|
|
180
184
|
}
|
|
181
|
-
),
|
|
185
|
+
), A(() => {
|
|
186
|
+
i == null || i.return(null), e.clear(), t.clear(), a = void 0;
|
|
187
|
+
}), { poll: l, isInitialPolling: h };
|
|
182
188
|
}
|
|
183
|
-
function
|
|
189
|
+
function $(e, t) {
|
|
184
190
|
return () => {
|
|
185
|
-
const
|
|
186
|
-
return
|
|
191
|
+
const r = d(t);
|
|
192
|
+
return r === void 0 ? e == null ? void 0 : e.value : r;
|
|
187
193
|
};
|
|
188
194
|
}
|
|
189
195
|
function v(e) {
|
|
190
196
|
return e.map((t) => t());
|
|
191
197
|
}
|
|
192
|
-
function
|
|
193
|
-
const n =
|
|
198
|
+
function x(e, t, r, o = !1) {
|
|
199
|
+
const n = w(), i = F(), s = () => d(e), f = () => d(t), a = $(i, r), l = [s, f, a], h = () => n.synchronizeDiscover(...v(l)), c = () => n.discover(...v(l)), m = new T(n), y = new O(c), { poll: P, isInitialPolling: j } = E(
|
|
194
200
|
m,
|
|
195
|
-
|
|
196
|
-
|
|
201
|
+
y,
|
|
202
|
+
h,
|
|
197
203
|
l,
|
|
198
|
-
|
|
204
|
+
o
|
|
199
205
|
);
|
|
200
206
|
return {
|
|
201
207
|
/**
|
|
@@ -203,14 +209,6 @@ function W(e, t, s, r = !1) {
|
|
|
203
209
|
* an array of Graffiti objects.
|
|
204
210
|
*/
|
|
205
211
|
objects: m.results,
|
|
206
|
-
/**
|
|
207
|
-
* @deprecated Use {@link objects} instead.
|
|
208
|
-
*/
|
|
209
|
-
get results() {
|
|
210
|
-
return console.warn(
|
|
211
|
-
"The `results` property is deprecated. Use `objects` instead."
|
|
212
|
-
), this.objects;
|
|
213
|
-
},
|
|
214
212
|
/**
|
|
215
213
|
* A method to poll for new results.
|
|
216
214
|
*/
|
|
@@ -224,28 +222,20 @@ function W(e, t, s, r = !1) {
|
|
|
224
222
|
* but it does not track ongoing polls from either calling
|
|
225
223
|
* {@link poll} or using the `autopoll` argument.
|
|
226
224
|
*/
|
|
227
|
-
isInitialPolling:
|
|
228
|
-
/**
|
|
229
|
-
* @deprecated Use {@link isInitialPolling} instead.
|
|
230
|
-
*/
|
|
231
|
-
get isPolling() {
|
|
232
|
-
return console.warn(
|
|
233
|
-
"The `isPolling` property is deprecated. Use `isInitialPolling` instead."
|
|
234
|
-
), this.isInitialPolling;
|
|
235
|
-
}
|
|
225
|
+
isInitialPolling: j
|
|
236
226
|
};
|
|
237
227
|
}
|
|
238
|
-
function
|
|
239
|
-
const n =
|
|
240
|
-
|
|
241
|
-
a,
|
|
242
|
-
c
|
|
243
|
-
], f = () => n.synchronizeGet(...v(l)), g = new x(), m = () => n.get(...v(l)), G = new V(m), { poll: P, isInitialPolling: w } = S(
|
|
244
|
-
g,
|
|
245
|
-
G,
|
|
228
|
+
function W(e, t, r, o = !1) {
|
|
229
|
+
const n = w(), i = F(), s = () => d(e), f = () => d(t), a = $(i, r), l = [
|
|
230
|
+
s,
|
|
246
231
|
f,
|
|
232
|
+
a
|
|
233
|
+
], h = () => n.synchronizeGet(...v(l)), c = new V(), m = () => n.get(...v(l)), y = new U(m), { poll: P, isInitialPolling: j } = E(
|
|
234
|
+
c,
|
|
235
|
+
y,
|
|
236
|
+
h,
|
|
247
237
|
l,
|
|
248
|
-
|
|
238
|
+
o
|
|
249
239
|
);
|
|
250
240
|
return {
|
|
251
241
|
/**
|
|
@@ -253,15 +243,7 @@ function q(e, t, s, r = !1) {
|
|
|
253
243
|
* the retrieved Graffiti object, if it exists. If the object has been deleted,
|
|
254
244
|
* the result is `null`. If the object is still being fetched, the result is `undefined`.
|
|
255
245
|
*/
|
|
256
|
-
object:
|
|
257
|
-
/**
|
|
258
|
-
* @deprecated Use {@link object} instead.
|
|
259
|
-
*/
|
|
260
|
-
get result() {
|
|
261
|
-
return console.warn(
|
|
262
|
-
"The `result` property is deprecated. Use `object` instead."
|
|
263
|
-
), this.object;
|
|
264
|
-
},
|
|
246
|
+
object: c.result,
|
|
265
247
|
/**
|
|
266
248
|
* A method to poll for new results.
|
|
267
249
|
*/
|
|
@@ -275,43 +257,27 @@ function q(e, t, s, r = !1) {
|
|
|
275
257
|
* but it does not track ongoing polls from either calling
|
|
276
258
|
* {@link poll} or using the `autopoll` argument.
|
|
277
259
|
*/
|
|
278
|
-
isInitialPolling:
|
|
279
|
-
/**
|
|
280
|
-
* @deprecated Use {@link isInitialPolling} instead.
|
|
281
|
-
*/
|
|
282
|
-
get isPolling() {
|
|
283
|
-
return console.warn(
|
|
284
|
-
"The `isPolling` property is deprecated. Use `isInitialPolling` instead."
|
|
285
|
-
), this.isInitialPolling;
|
|
286
|
-
}
|
|
260
|
+
isInitialPolling: j
|
|
287
261
|
};
|
|
288
262
|
}
|
|
289
|
-
function
|
|
290
|
-
const
|
|
291
|
-
c,
|
|
292
|
-
f,
|
|
263
|
+
function q(e, t, r = !1) {
|
|
264
|
+
const o = w(), s = [() => d(e), () => d(t)], f = () => o.synchronizeRecoverOrphans(...v(s)), a = new T(o), l = () => o.recoverOrphans(...v(s)), h = new O(l), { poll: c, isInitialPolling: m } = E(
|
|
293
265
|
a,
|
|
294
|
-
|
|
295
|
-
|
|
266
|
+
h,
|
|
267
|
+
f,
|
|
268
|
+
s,
|
|
269
|
+
r
|
|
296
270
|
);
|
|
297
271
|
return {
|
|
298
272
|
/**
|
|
299
273
|
* A [ref](https://vuejs.org/api/reactivity-core.html#ref) that contains
|
|
300
274
|
* an array of Graffiti objects.
|
|
301
275
|
*/
|
|
302
|
-
objects:
|
|
303
|
-
/**
|
|
304
|
-
* @deprecated Use {@link objects} instead.
|
|
305
|
-
*/
|
|
306
|
-
get results() {
|
|
307
|
-
return console.warn(
|
|
308
|
-
"The `result` property is deprecated. Use `object` instead."
|
|
309
|
-
), this.objects;
|
|
310
|
-
},
|
|
276
|
+
objects: a.results,
|
|
311
277
|
/**
|
|
312
278
|
* A method to poll for new results.
|
|
313
279
|
*/
|
|
314
|
-
poll:
|
|
280
|
+
poll: c,
|
|
315
281
|
/**
|
|
316
282
|
* A boolean [ref](https://vuejs.org/api/reactivity-core.html#ref)
|
|
317
283
|
* that indicates if the *first* poll is currently running.
|
|
@@ -321,18 +287,10 @@ function H(e, t, s = !1) {
|
|
|
321
287
|
* but it does not track ongoing polls from either calling
|
|
322
288
|
* {@link poll} or using the `autopoll` argument.
|
|
323
289
|
*/
|
|
324
|
-
isInitialPolling: m
|
|
325
|
-
/**
|
|
326
|
-
* @deprecated Use {@link isInitialPolling} instead.
|
|
327
|
-
*/
|
|
328
|
-
get isPolling() {
|
|
329
|
-
return console.warn(
|
|
330
|
-
"The `isPolling` property is deprecated. Use `isInitialPolling` instead."
|
|
331
|
-
), this.isInitialPolling;
|
|
332
|
-
}
|
|
290
|
+
isInitialPolling: m
|
|
333
291
|
};
|
|
334
292
|
}
|
|
335
|
-
const D = /* @__PURE__ */
|
|
293
|
+
const D = /* @__PURE__ */ S({
|
|
336
294
|
__name: "Discover",
|
|
337
295
|
props: {
|
|
338
296
|
channels: {},
|
|
@@ -341,21 +299,19 @@ const D = /* @__PURE__ */ j({
|
|
|
341
299
|
autopoll: { type: Boolean }
|
|
342
300
|
},
|
|
343
301
|
setup(e) {
|
|
344
|
-
const t = e, { objects:
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
302
|
+
const t = e, { objects: r, poll: o, isInitialPolling: n } = x(
|
|
303
|
+
u(t, "channels"),
|
|
304
|
+
u(t, "schema"),
|
|
305
|
+
u(t, "session"),
|
|
306
|
+
u(t, "autopoll")
|
|
349
307
|
);
|
|
350
|
-
return (
|
|
351
|
-
objects:
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
isPolling: u(i),
|
|
355
|
-
isInitialPolling: u(o)
|
|
308
|
+
return (i, s) => R(i.$slots, "default", {
|
|
309
|
+
objects: g(r),
|
|
310
|
+
poll: g(o),
|
|
311
|
+
isInitialPolling: g(n)
|
|
356
312
|
});
|
|
357
313
|
}
|
|
358
|
-
}),
|
|
314
|
+
}), I = /* @__PURE__ */ S({
|
|
359
315
|
__name: "Get",
|
|
360
316
|
props: {
|
|
361
317
|
url: {},
|
|
@@ -364,21 +320,19 @@ const D = /* @__PURE__ */ j({
|
|
|
364
320
|
autopoll: { type: Boolean }
|
|
365
321
|
},
|
|
366
322
|
setup(e) {
|
|
367
|
-
const t = e, { object:
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
323
|
+
const t = e, { object: r, poll: o, isInitialPolling: n } = W(
|
|
324
|
+
u(t, "url"),
|
|
325
|
+
u(t, "schema"),
|
|
326
|
+
u(t, "session"),
|
|
327
|
+
u(t, "autopoll")
|
|
372
328
|
);
|
|
373
|
-
return (
|
|
374
|
-
object:
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
isPolling: u(i),
|
|
378
|
-
isInitialPolling: u(o)
|
|
329
|
+
return (i, s) => R(i.$slots, "default", {
|
|
330
|
+
object: g(r),
|
|
331
|
+
poll: g(o),
|
|
332
|
+
isInitialPolling: g(n)
|
|
379
333
|
});
|
|
380
334
|
}
|
|
381
|
-
}),
|
|
335
|
+
}), N = /* @__PURE__ */ S({
|
|
382
336
|
__name: "RecoverOrphans",
|
|
383
337
|
props: {
|
|
384
338
|
schema: {},
|
|
@@ -386,55 +340,53 @@ const D = /* @__PURE__ */ j({
|
|
|
386
340
|
autopoll: { type: Boolean }
|
|
387
341
|
},
|
|
388
342
|
setup(e) {
|
|
389
|
-
const t = e, { objects:
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
343
|
+
const t = e, { objects: r, poll: o, isInitialPolling: n } = q(
|
|
344
|
+
u(t, "schema"),
|
|
345
|
+
u(t, "session"),
|
|
346
|
+
u(t, "autopoll")
|
|
393
347
|
);
|
|
394
|
-
return (
|
|
395
|
-
objects:
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
isPolling: u(i),
|
|
399
|
-
isInitialPolling: u(o)
|
|
348
|
+
return (i, s) => R(i.$slots, "default", {
|
|
349
|
+
objects: g(r),
|
|
350
|
+
poll: g(o),
|
|
351
|
+
isInitialPolling: g(n)
|
|
400
352
|
});
|
|
401
353
|
}
|
|
402
|
-
}),
|
|
354
|
+
}), Y = {
|
|
403
355
|
install(e, t) {
|
|
404
|
-
const
|
|
405
|
-
|
|
406
|
-
const
|
|
407
|
-
if (
|
|
408
|
-
const
|
|
409
|
-
if (
|
|
410
|
-
const
|
|
411
|
-
l.pathname.startsWith(
|
|
356
|
+
const r = t.graffiti, o = new C(r), n = G(void 0);
|
|
357
|
+
o.sessionEvents.addEventListener("initialized", async (i) => {
|
|
358
|
+
const s = i.detail;
|
|
359
|
+
if (s && s.error && console.error(s.error), s && s.href) {
|
|
360
|
+
const f = e.config.globalProperties.$router;
|
|
361
|
+
if (f) {
|
|
362
|
+
const a = f.options.history.base, l = new URL(s.href);
|
|
363
|
+
l.pathname.startsWith(a) && (l.pathname = l.pathname.slice(a.length)), await f.replace(l.pathname + l.search + l.hash);
|
|
412
364
|
}
|
|
413
365
|
}
|
|
414
366
|
n.value || (n.value = null);
|
|
415
|
-
}),
|
|
416
|
-
const
|
|
417
|
-
if (
|
|
418
|
-
console.error("Error logging in:"), console.error(
|
|
367
|
+
}), o.sessionEvents.addEventListener("login", (i) => {
|
|
368
|
+
const s = i.detail;
|
|
369
|
+
if (s.error) {
|
|
370
|
+
console.error("Error logging in:"), console.error(s.error);
|
|
419
371
|
return;
|
|
420
372
|
} else
|
|
421
|
-
n.value =
|
|
422
|
-
}),
|
|
423
|
-
const
|
|
424
|
-
|
|
425
|
-
}),
|
|
373
|
+
n.value = s.session;
|
|
374
|
+
}), o.sessionEvents.addEventListener("logout", (i) => {
|
|
375
|
+
const s = i.detail;
|
|
376
|
+
s.error ? (console.error("Error logging out:"), console.error(s.error)) : n.value = null;
|
|
377
|
+
}), b.graffitiSynchronize = o, b.graffitiSession = n, e.component("GraffitiDiscover", D), e.component("GraffitiGet", I), e.component("GraffitiRecoverOrphans", N), e.config.globalProperties.$graffiti = o, e.config.globalProperties.$graffitiSession = n;
|
|
426
378
|
}
|
|
427
|
-
},
|
|
379
|
+
}, Z = D, tt = I, et = N;
|
|
428
380
|
export {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
381
|
+
Z as GraffitiDiscover,
|
|
382
|
+
tt as GraffitiGet,
|
|
383
|
+
Y as GraffitiPlugin,
|
|
384
|
+
et as GraffitiRecoverOrphans,
|
|
385
|
+
X as useGraffiti,
|
|
386
|
+
x as useGraffitiDiscover,
|
|
387
|
+
W as useGraffitiGet,
|
|
388
|
+
q as useGraffitiRecoverOrphans,
|
|
389
|
+
F as useGraffitiSession,
|
|
390
|
+
w as useGraffitiSynchronize
|
|
439
391
|
};
|
|
440
392
|
//# sourceMappingURL=plugin.mjs.map
|