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