@graffiti-garden/wrapper-vue 0.6.3 → 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 +475 -366
- 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 +262 -152
- package/dist/node/plugin.mjs.map +1 -1
- package/dist/node/pollers.d.ts +1 -1
- package/dist/node/pollers.d.ts.map +1 -1
- package/dist/node/reducers.d.ts +3 -3
- package/dist/node/reducers.d.ts.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/src/pollers.ts +14 -2
- package/src/reducers.ts +11 -3
package/dist/node/plugin.mjs
CHANGED
|
@@ -1,40 +1,45 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { inject as
|
|
5
|
-
import { GraffitiSynchronize as
|
|
6
|
-
const
|
|
7
|
-
function
|
|
8
|
-
const e =
|
|
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
|
+
const e = E(F);
|
|
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 Z() {
|
|
16
|
+
return b();
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
const 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
|
-
class
|
|
26
|
+
var K = class _ extends Error {
|
|
27
27
|
constructor(t) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
super(t), this.name = "GraffitiErrorNotFound", Object.setPrototypeOf(this, _.prototype);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
class V {
|
|
32
|
+
constructor(t) {
|
|
33
|
+
p(this, "poll", async (t) => {
|
|
34
|
+
let s;
|
|
35
|
+
const r = this.getter;
|
|
31
36
|
try {
|
|
32
|
-
|
|
37
|
+
s = await r();
|
|
33
38
|
} catch {
|
|
34
|
-
this.getter ===
|
|
39
|
+
this.getter === r && t(null);
|
|
35
40
|
return;
|
|
36
41
|
}
|
|
37
|
-
this.getter ===
|
|
42
|
+
this.getter === r && t({ object: s });
|
|
38
43
|
});
|
|
39
44
|
this.getter = t;
|
|
40
45
|
}
|
|
@@ -43,21 +48,33 @@ class U {
|
|
|
43
48
|
}
|
|
44
49
|
class O {
|
|
45
50
|
constructor(t) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
p(this, "iterator");
|
|
52
|
+
p(this, "continue");
|
|
53
|
+
p(this, "poll", async (t) => {
|
|
54
|
+
if (!this.iterator)
|
|
55
|
+
if (this.continue)
|
|
56
|
+
try {
|
|
57
|
+
this.iterator = this.continue();
|
|
58
|
+
} catch (s) {
|
|
59
|
+
if (s instanceof K)
|
|
60
|
+
t("clear"), this.iterator = this.streamFactory();
|
|
61
|
+
else
|
|
62
|
+
throw s;
|
|
63
|
+
}
|
|
64
|
+
else
|
|
65
|
+
this.iterator = this.streamFactory();
|
|
66
|
+
for (; this.iterator; ) {
|
|
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);
|
|
54
71
|
break;
|
|
55
72
|
}
|
|
56
|
-
if (
|
|
57
|
-
console.error(
|
|
73
|
+
if (r.value.error) {
|
|
74
|
+
console.error(r.value.error);
|
|
58
75
|
continue;
|
|
59
76
|
}
|
|
60
|
-
t(
|
|
77
|
+
t(r.value);
|
|
61
78
|
}
|
|
62
79
|
}
|
|
63
80
|
});
|
|
@@ -74,15 +91,15 @@ class O {
|
|
|
74
91
|
this.iterator = void 0, this.continue = void 0;
|
|
75
92
|
}
|
|
76
93
|
}
|
|
77
|
-
function
|
|
94
|
+
function U(e, t) {
|
|
78
95
|
return !t || e.object.lastModified > t.object.lastModified || e.object.lastModified === t.object.lastModified && !e.tombstone && !!t.tombstone;
|
|
79
96
|
}
|
|
80
|
-
class
|
|
97
|
+
class x {
|
|
81
98
|
constructor() {
|
|
82
|
-
|
|
99
|
+
p(this, "entry", y());
|
|
83
100
|
}
|
|
84
101
|
get result() {
|
|
85
|
-
return
|
|
102
|
+
return k(() => {
|
|
86
103
|
const t = this.entry.value;
|
|
87
104
|
return t && (t.tombstone ? null : t.object);
|
|
88
105
|
});
|
|
@@ -91,240 +108,333 @@ class V {
|
|
|
91
108
|
this.entry.value = void 0;
|
|
92
109
|
}
|
|
93
110
|
onEntry(t) {
|
|
94
|
-
(
|
|
111
|
+
if (t === "clear") {
|
|
112
|
+
this.clear();
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
(!t || U(t, this.entry.value)) && (this.entry.value = t);
|
|
95
116
|
}
|
|
96
117
|
}
|
|
97
118
|
class $ {
|
|
98
119
|
constructor(t) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
120
|
+
p(this, "results", y([]));
|
|
121
|
+
p(this, "resultsRaw", /* @__PURE__ */ new Map());
|
|
122
|
+
p(this, "batchFlattenTimer");
|
|
102
123
|
this.graffiti = t;
|
|
103
124
|
}
|
|
104
125
|
clear() {
|
|
105
126
|
this.resultsRaw.clear(), this.results.value = [], clearTimeout(this.batchFlattenTimer), this.batchFlattenTimer = void 0;
|
|
106
127
|
}
|
|
107
128
|
flattenResults() {
|
|
108
|
-
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), []);
|
|
109
130
|
}
|
|
110
131
|
onEntry(t) {
|
|
111
132
|
if (!t) return;
|
|
112
|
-
|
|
113
|
-
|
|
133
|
+
if (t === "clear") {
|
|
134
|
+
this.clear();
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
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(() => {
|
|
114
139
|
this.flattenResults(), this.batchFlattenTimer = void 0;
|
|
115
140
|
}, 0)));
|
|
116
141
|
}
|
|
117
142
|
}
|
|
118
|
-
function S(e, t, r,
|
|
119
|
-
let
|
|
120
|
-
async function
|
|
121
|
-
|
|
122
|
-
for await (const
|
|
123
|
-
if (
|
|
124
|
-
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);
|
|
125
150
|
continue;
|
|
126
151
|
}
|
|
127
|
-
e.onEntry(
|
|
152
|
+
e.onEntry(f);
|
|
128
153
|
}
|
|
129
154
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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;
|
|
136
171
|
try {
|
|
137
|
-
await
|
|
172
|
+
await c();
|
|
138
173
|
} finally {
|
|
139
|
-
|
|
174
|
+
l.value = !1;
|
|
140
175
|
}
|
|
141
176
|
}
|
|
142
177
|
},
|
|
143
178
|
{
|
|
144
179
|
immediate: !0
|
|
145
180
|
}
|
|
146
|
-
),
|
|
181
|
+
), C(() => i == null ? void 0 : i.return(null)), { poll: c, isInitialPolling: l };
|
|
147
182
|
}
|
|
148
183
|
function z(e, t) {
|
|
149
184
|
return () => {
|
|
150
|
-
const
|
|
151
|
-
return
|
|
185
|
+
const s = d(t);
|
|
186
|
+
return s === void 0 ? e == null ? void 0 : e.value : s;
|
|
152
187
|
};
|
|
153
188
|
}
|
|
154
|
-
function
|
|
189
|
+
function v(e) {
|
|
155
190
|
return e.map((t) => t());
|
|
156
191
|
}
|
|
157
|
-
function
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
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
|
|
163
199
|
);
|
|
164
200
|
return {
|
|
165
201
|
/**
|
|
166
|
-
* A [
|
|
167
|
-
* an array of Graffiti objects.
|
|
202
|
+
* A [ref](https://vuejs.org/api/reactivity-core.html#ref) that contains
|
|
203
|
+
* an array of Graffiti objects.
|
|
168
204
|
*/
|
|
169
|
-
|
|
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
|
+
},
|
|
170
214
|
/**
|
|
171
215
|
* A method to poll for new results.
|
|
172
216
|
*/
|
|
173
|
-
poll:
|
|
217
|
+
poll: P,
|
|
174
218
|
/**
|
|
175
|
-
* A boolean [
|
|
176
|
-
* 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.
|
|
177
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.
|
|
226
|
+
*/
|
|
227
|
+
isInitialPolling: w,
|
|
228
|
+
/**
|
|
229
|
+
* @deprecated Use {@link isInitialPolling} instead.
|
|
178
230
|
*/
|
|
179
|
-
isPolling
|
|
231
|
+
get isPolling() {
|
|
232
|
+
return console.warn(
|
|
233
|
+
"The `isPolling` property is deprecated. Use `isInitialPolling` instead."
|
|
234
|
+
), this.isInitialPolling;
|
|
235
|
+
}
|
|
180
236
|
};
|
|
181
237
|
}
|
|
182
|
-
function
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
|
|
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,
|
|
241
|
+
a,
|
|
186
242
|
c
|
|
187
|
-
],
|
|
243
|
+
], f = () => n.synchronizeGet(...v(l)), g = new x(), m = () => n.get(...v(l)), G = new V(m), { poll: P, isInitialPolling: w } = S(
|
|
188
244
|
g,
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
l
|
|
245
|
+
G,
|
|
246
|
+
f,
|
|
247
|
+
l,
|
|
248
|
+
r
|
|
192
249
|
);
|
|
193
250
|
return {
|
|
194
251
|
/**
|
|
195
|
-
* A [
|
|
252
|
+
* A [ref](https://vuejs.org/api/reactivity-core.html#ref) that contains
|
|
196
253
|
* the retrieved Graffiti object, if it exists. If the object has been deleted,
|
|
197
254
|
* the result is `null`. If the object is still being fetched, the result is `undefined`.
|
|
198
255
|
*/
|
|
199
|
-
|
|
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
|
+
},
|
|
200
265
|
/**
|
|
201
266
|
* A method to poll for new results.
|
|
202
267
|
*/
|
|
203
|
-
poll:
|
|
268
|
+
poll: P,
|
|
204
269
|
/**
|
|
205
|
-
* A boolean [
|
|
206
|
-
* 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.
|
|
207
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.
|
|
208
281
|
*/
|
|
209
|
-
isPolling
|
|
282
|
+
get isPolling() {
|
|
283
|
+
return console.warn(
|
|
284
|
+
"The `isPolling` property is deprecated. Use `isInitialPolling` instead."
|
|
285
|
+
), this.isInitialPolling;
|
|
286
|
+
}
|
|
210
287
|
};
|
|
211
288
|
}
|
|
212
|
-
function
|
|
213
|
-
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(
|
|
214
291
|
c,
|
|
292
|
+
f,
|
|
215
293
|
a,
|
|
216
|
-
|
|
217
|
-
|
|
294
|
+
o,
|
|
295
|
+
s
|
|
218
296
|
);
|
|
219
297
|
return {
|
|
220
298
|
/**
|
|
221
|
-
* A [
|
|
222
|
-
* 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.
|
|
223
305
|
*/
|
|
224
|
-
results
|
|
306
|
+
get results() {
|
|
307
|
+
return console.warn(
|
|
308
|
+
"The `result` property is deprecated. Use `object` instead."
|
|
309
|
+
), this.objects;
|
|
310
|
+
},
|
|
225
311
|
/**
|
|
226
312
|
* A method to poll for new results.
|
|
227
313
|
*/
|
|
228
314
|
poll: g,
|
|
229
315
|
/**
|
|
230
|
-
* A boolean [
|
|
231
|
-
* 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.
|
|
232
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.
|
|
323
|
+
*/
|
|
324
|
+
isInitialPolling: m,
|
|
325
|
+
/**
|
|
326
|
+
* @deprecated Use {@link isInitialPolling} instead.
|
|
233
327
|
*/
|
|
234
|
-
isPolling
|
|
328
|
+
get isPolling() {
|
|
329
|
+
return console.warn(
|
|
330
|
+
"The `isPolling` property is deprecated. Use `isInitialPolling` instead."
|
|
331
|
+
), this.isInitialPolling;
|
|
332
|
+
}
|
|
235
333
|
};
|
|
236
334
|
}
|
|
237
|
-
const D = /* @__PURE__ */
|
|
335
|
+
const D = /* @__PURE__ */ j({
|
|
238
336
|
__name: "Discover",
|
|
239
337
|
props: {
|
|
240
338
|
channels: {},
|
|
241
339
|
schema: {},
|
|
242
|
-
session: {}
|
|
340
|
+
session: {},
|
|
341
|
+
autopoll: { type: Boolean }
|
|
243
342
|
},
|
|
244
343
|
setup(e) {
|
|
245
|
-
const t = e, { results: r, poll:
|
|
344
|
+
const t = e, { objects: s, results: r, poll: n, isPolling: i, isInitialPolling: o } = W(
|
|
246
345
|
h(t, "channels"),
|
|
247
346
|
h(t, "schema"),
|
|
248
|
-
h(t, "session")
|
|
347
|
+
h(t, "session"),
|
|
348
|
+
h(t, "autopoll")
|
|
249
349
|
);
|
|
250
|
-
return (
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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)
|
|
254
356
|
});
|
|
255
357
|
}
|
|
256
|
-
}),
|
|
358
|
+
}), N = /* @__PURE__ */ j({
|
|
257
359
|
__name: "Get",
|
|
258
360
|
props: {
|
|
259
361
|
url: {},
|
|
260
362
|
schema: {},
|
|
261
|
-
session: {}
|
|
363
|
+
session: {},
|
|
364
|
+
autopoll: { type: Boolean }
|
|
262
365
|
},
|
|
263
366
|
setup(e) {
|
|
264
|
-
const t = e, { result: r, poll:
|
|
367
|
+
const t = e, { object: s, result: r, poll: n, isPolling: i, isInitialPolling: o } = q(
|
|
265
368
|
h(t, "url"),
|
|
266
369
|
h(t, "schema"),
|
|
267
|
-
h(t, "session")
|
|
370
|
+
h(t, "session"),
|
|
371
|
+
h(t, "autopoll")
|
|
268
372
|
);
|
|
269
|
-
return (
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
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)
|
|
273
379
|
});
|
|
274
380
|
}
|
|
275
|
-
}),
|
|
381
|
+
}), M = /* @__PURE__ */ j({
|
|
276
382
|
__name: "RecoverOrphans",
|
|
277
383
|
props: {
|
|
278
384
|
schema: {},
|
|
279
|
-
session: {}
|
|
385
|
+
session: {},
|
|
386
|
+
autopoll: { type: Boolean }
|
|
280
387
|
},
|
|
281
388
|
setup(e) {
|
|
282
|
-
const t = e, { results: r, poll:
|
|
389
|
+
const t = e, { objects: s, results: r, poll: n, isPolling: i, isInitialPolling: o } = H(
|
|
283
390
|
h(t, "schema"),
|
|
284
|
-
h(t, "session")
|
|
391
|
+
h(t, "session"),
|
|
392
|
+
h(t, "autopoll")
|
|
285
393
|
);
|
|
286
|
-
return (
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
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)
|
|
290
400
|
});
|
|
291
401
|
}
|
|
292
|
-
}),
|
|
402
|
+
}), tt = {
|
|
293
403
|
install(e, t) {
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
const
|
|
297
|
-
if (
|
|
298
|
-
const
|
|
299
|
-
if (
|
|
300
|
-
const
|
|
301
|
-
|
|
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);
|
|
302
412
|
}
|
|
303
413
|
}
|
|
304
|
-
|
|
305
|
-
}),
|
|
306
|
-
const
|
|
307
|
-
if (
|
|
308
|
-
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);
|
|
309
419
|
return;
|
|
310
420
|
} else
|
|
311
|
-
|
|
312
|
-
}),
|
|
313
|
-
const
|
|
314
|
-
|
|
315
|
-
}), e.provide(
|
|
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;
|
|
316
426
|
}
|
|
317
|
-
},
|
|
427
|
+
}, et = D, st = N, rt = M;
|
|
318
428
|
export {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
429
|
+
et as GraffitiDiscover,
|
|
430
|
+
st as GraffitiGet,
|
|
431
|
+
tt as GraffitiPlugin,
|
|
432
|
+
rt as GraffitiRecoverOrphans,
|
|
433
|
+
Z as useGraffiti,
|
|
434
|
+
W as useGraffitiDiscover,
|
|
435
|
+
q as useGraffitiGet,
|
|
436
|
+
H as useGraffitiRecoverOrphans,
|
|
437
|
+
T as useGraffitiSession,
|
|
438
|
+
b as useGraffitiSynchronize
|
|
329
439
|
};
|
|
330
440
|
//# sourceMappingURL=plugin.mjs.map
|