@graffiti-garden/wrapper-vue 1.0.4 → 1.0.8
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 +1272 -628
- package/dist/browser/plugin.mjs.map +1 -1
- package/dist/node/components/ObjectInfo.vue.d.ts.map +1 -1
- package/dist/node/composables/discover.d.ts.map +1 -1
- package/dist/node/composables/resolve-string.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 +967 -332
- package/dist/node/plugin.mjs.map +1 -1
- package/package.json +5 -5
- package/src/components/Discover.vue +1 -1
- package/src/components/GetMedia.vue +2 -2
- package/src/components/ObjectInfo.vue +53 -69
- package/src/composables/discover.ts +4 -2
- package/src/composables/resolve-string.ts +2 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graffiti-garden/wrapper-vue",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "Vue.js wrapper for the Graffiti API",
|
|
5
5
|
"types": "./dist/node/plugin.d.ts",
|
|
6
6
|
"module": "./dist/node/plugin.mjs",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"url": "https://github.com/graffiti-garden/wrapper-vue/issues"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@graffiti-garden/api": "^1.0.
|
|
48
|
-
"@graffiti-garden/wrapper-synchronize": "^1.0.
|
|
47
|
+
"@graffiti-garden/api": "^1.0.8",
|
|
48
|
+
"@graffiti-garden/wrapper-synchronize": "^1.0.8"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@graffiti-garden/implementation-local": "^1.0.
|
|
51
|
+
"@graffiti-garden/implementation-local": "^1.0.8",
|
|
52
52
|
"@types/node": "^25.0.6",
|
|
53
53
|
"@vitejs/plugin-vue": "^6.0.3",
|
|
54
54
|
"@vue/typescript-plugin": "^3.2.2",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"typedoc-plugin-vue": "^1.5.1",
|
|
57
57
|
"vite": "^7.3.1",
|
|
58
58
|
"vite-plugin-dts": "^4.5.4",
|
|
59
|
-
"vite-plugin-node-polyfills": "^0.
|
|
59
|
+
"vite-plugin-node-polyfills": "^0.25.0",
|
|
60
60
|
"vue": "^3.5.26",
|
|
61
61
|
"vue-router": "^4.6.4"
|
|
62
62
|
},
|
|
@@ -64,12 +64,12 @@ function downloadMedia() {
|
|
|
64
64
|
type="application/pdf"
|
|
65
65
|
:alt="`PDF by ${media.actor}`"
|
|
66
66
|
/>
|
|
67
|
-
<button v-else-if="media" @click="downloadMedia">Download</button>
|
|
67
|
+
<button v-else-if="media" @click="downloadMedia">Download media</button>
|
|
68
68
|
<p v-else-if="media === null">
|
|
69
69
|
<em>Media not found</em>
|
|
70
70
|
</p>
|
|
71
71
|
<p v-else>
|
|
72
|
-
<em>
|
|
72
|
+
<em> Media loading... </em>
|
|
73
73
|
</p>
|
|
74
74
|
</slot>
|
|
75
75
|
</template>
|
|
@@ -29,8 +29,10 @@ async function deleteObject(
|
|
|
29
29
|
|
|
30
30
|
<template>
|
|
31
31
|
<article v-if="object" :data-url="object.url">
|
|
32
|
-
<
|
|
33
|
-
|
|
32
|
+
<p>@<ActorToHandle :actor="object.actor" /> posted:</p>
|
|
33
|
+
<pre>{{ object.value }}</pre>
|
|
34
|
+
<details>
|
|
35
|
+
<summary>Show object properties</summary>
|
|
34
36
|
|
|
35
37
|
<dl>
|
|
36
38
|
<dt>Object URL</dt>
|
|
@@ -47,81 +49,63 @@ async function deleteObject(
|
|
|
47
49
|
<dd>
|
|
48
50
|
<ActorToHandle :actor="object.actor" />
|
|
49
51
|
</dd>
|
|
50
|
-
</dl>
|
|
51
|
-
</header>
|
|
52
|
-
|
|
53
|
-
<section>
|
|
54
|
-
<h3>Content</h3>
|
|
55
|
-
<pre>{{ object.value }}</pre>
|
|
56
|
-
</section>
|
|
57
|
-
|
|
58
|
-
<section>
|
|
59
|
-
<h3>Allowed Actors</h3>
|
|
60
52
|
|
|
61
|
-
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
<em>Noone</em>
|
|
66
|
-
</p>
|
|
67
|
-
<ul>
|
|
68
|
-
<li v-for="actor in object.allowed" :key="actor">
|
|
69
|
-
<dl>
|
|
70
|
-
<dt>Actor</dt>
|
|
71
|
-
<dd>
|
|
72
|
-
<code>{{ actor }}</code>
|
|
73
|
-
</dd>
|
|
74
|
-
<dt>Handle</dt>
|
|
75
|
-
<dd>
|
|
76
|
-
<ActorToHandle :actor="actor" />
|
|
77
|
-
</dd>
|
|
78
|
-
</dl>
|
|
79
|
-
</li>
|
|
80
|
-
</ul>
|
|
81
|
-
</section>
|
|
82
|
-
|
|
83
|
-
<section>
|
|
84
|
-
<h3>Channels</h3>
|
|
53
|
+
<dt>Content</dt>
|
|
54
|
+
<dd>
|
|
55
|
+
<pre>{{ object.value }}</pre>
|
|
56
|
+
</dd>
|
|
85
57
|
|
|
86
|
-
|
|
87
|
-
<
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
58
|
+
<dt>Allowed actors</dt>
|
|
59
|
+
<dd>
|
|
60
|
+
<p v-if="!Array.isArray(object.allowed)">
|
|
61
|
+
<em>Public</em>
|
|
62
|
+
</p>
|
|
63
|
+
<p v-else-if="object.allowed.length === 0">
|
|
64
|
+
<em>No one is allowed (except you)</em>
|
|
65
|
+
</p>
|
|
66
|
+
<ul>
|
|
67
|
+
<li v-for="actor in object.allowed" :key="actor">
|
|
68
|
+
<dl>
|
|
69
|
+
<dt>Actor</dt>
|
|
70
|
+
<dd>
|
|
71
|
+
<code>{{ actor }}</code>
|
|
72
|
+
</dd>
|
|
73
|
+
<dt>Handle</dt>
|
|
74
|
+
<dd>
|
|
75
|
+
<ActorToHandle :actor="actor" />
|
|
76
|
+
</dd>
|
|
77
|
+
</dl>
|
|
78
|
+
</li>
|
|
79
|
+
</ul>
|
|
80
|
+
</dd>
|
|
95
81
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
82
|
+
<dt>Channels</dt>
|
|
83
|
+
<dd>
|
|
84
|
+
<ul v-if="object.channels?.length">
|
|
85
|
+
<li v-for="channel in object.channels" :key="channel">
|
|
86
|
+
<code>{{ channel }}</code>
|
|
87
|
+
</li>
|
|
88
|
+
</ul>
|
|
89
|
+
<p v-else>
|
|
90
|
+
<em>No channels</em>
|
|
91
|
+
</p>
|
|
92
|
+
</dd>
|
|
93
|
+
</dl>
|
|
94
|
+
</details>
|
|
95
|
+
<button
|
|
96
|
+
v-if="$graffitiSession.value?.actor === object.actor"
|
|
97
|
+
:disabled="deleting"
|
|
98
|
+
@click="deleteObject(object, $graffitiSession.value)"
|
|
99
|
+
>
|
|
100
|
+
{{ deleting ? "Deleting..." : "Delete" }}
|
|
101
|
+
</button>
|
|
112
102
|
</article>
|
|
113
103
|
|
|
114
104
|
<article v-else-if="object === null">
|
|
115
|
-
<
|
|
116
|
-
<h2>Graffiti Object</h2>
|
|
117
|
-
</header>
|
|
118
|
-
<p><em>Object not found</em></p>
|
|
105
|
+
<p><em>Graffiti object not found</em></p>
|
|
119
106
|
</article>
|
|
120
107
|
|
|
121
108
|
<article v-else>
|
|
122
|
-
<
|
|
123
|
-
<h2>Graffiti Object</h2>
|
|
124
|
-
</header>
|
|
125
|
-
<p><em>Loading...</em></p>
|
|
109
|
+
<p><em>Graffiti object loading...</em></p>
|
|
126
110
|
</article>
|
|
127
111
|
</template>
|
|
@@ -7,7 +7,7 @@ import type {
|
|
|
7
7
|
GraffitiSession,
|
|
8
8
|
JSONSchema,
|
|
9
9
|
} from "@graffiti-garden/api";
|
|
10
|
-
import {
|
|
10
|
+
import { GraffitiErrorCursorExpired } from "@graffiti-garden/api";
|
|
11
11
|
import type { MaybeRefOrGetter, Ref } from "vue";
|
|
12
12
|
import { ref, toValue, watch, onScopeDispose } from "vue";
|
|
13
13
|
import { useGraffitiSynchronize } from "../globals";
|
|
@@ -155,11 +155,13 @@ export function useGraffitiDiscover<Schema extends JSONSchema>(
|
|
|
155
155
|
try {
|
|
156
156
|
result = await myDiscoverIterator.next();
|
|
157
157
|
} catch (e) {
|
|
158
|
-
if (e instanceof
|
|
158
|
+
if (e instanceof GraffitiErrorCursorExpired) {
|
|
159
159
|
// The cursor has expired, we need to start from scratch.
|
|
160
160
|
return restartWatch();
|
|
161
161
|
} else {
|
|
162
162
|
// If something else went wrong, wait a bit before retrying
|
|
163
|
+
console.error("Fatal error in discover");
|
|
164
|
+
console.error(e);
|
|
163
165
|
return restartWatch(5000);
|
|
164
166
|
}
|
|
165
167
|
}
|
|
@@ -24,9 +24,8 @@ export function useResolveString(
|
|
|
24
24
|
} catch (err) {
|
|
25
25
|
if (!active) return;
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} else {
|
|
27
|
+
output.value = null;
|
|
28
|
+
if (!(err instanceof GraffitiErrorNotFound)) {
|
|
30
29
|
console.error(err);
|
|
31
30
|
}
|
|
32
31
|
}
|