nuxt-studio 1.5.0 → 1.5.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/app/main.d.ts +34 -34
- package/dist/app/service-worker.d.ts +34 -34
- package/dist/app/service-worker.js +1 -1
- package/dist/app/shared.d.ts +34 -34
- package/dist/module/module.json +1 -1
- package/dist/module/module.mjs +2 -2
- package/dist/module/runtime/server/utils/media/ipx.js +1 -1
- package/package.json +1 -1
package/dist/app/main.d.ts
CHANGED
|
@@ -531,15 +531,6 @@ export declare enum VideoFileExtension {
|
|
|
531
531
|
export { }
|
|
532
532
|
|
|
533
533
|
|
|
534
|
-
declare module '@tiptap/core' {
|
|
535
|
-
interface Commands<ReturnType> {
|
|
536
|
-
Element: {
|
|
537
|
-
setElement: (tag: string, slot?: string) => ReturnType;
|
|
538
|
-
};
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
|
|
543
534
|
declare module '@tiptap/vue-3' {
|
|
544
535
|
interface Commands<ReturnType> {
|
|
545
536
|
imagePicker: {
|
|
@@ -549,15 +540,6 @@ declare module '@tiptap/vue-3' {
|
|
|
549
540
|
}
|
|
550
541
|
|
|
551
542
|
|
|
552
|
-
declare module '@tiptap/vue-3' {
|
|
553
|
-
interface Commands<ReturnType> {
|
|
554
|
-
videoPicker: {
|
|
555
|
-
insertVideoPicker: () => ReturnType;
|
|
556
|
-
};
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
|
|
561
543
|
declare module '@tiptap/core' {
|
|
562
544
|
interface Commands<ReturnType> {
|
|
563
545
|
Slot: {
|
|
@@ -572,11 +554,8 @@ declare module '@tiptap/core' {
|
|
|
572
554
|
|
|
573
555
|
declare module '@tiptap/core' {
|
|
574
556
|
interface Commands<ReturnType> {
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
* Toggle a InlineElement
|
|
578
|
-
*/
|
|
579
|
-
setInlineElement: (tag: string) => ReturnType;
|
|
557
|
+
Element: {
|
|
558
|
+
setElement: (tag: string, slot?: string) => ReturnType;
|
|
580
559
|
};
|
|
581
560
|
}
|
|
582
561
|
}
|
|
@@ -584,19 +563,11 @@ declare module '@tiptap/core' {
|
|
|
584
563
|
|
|
585
564
|
declare module '@tiptap/core' {
|
|
586
565
|
interface Commands<ReturnType> {
|
|
587
|
-
|
|
588
|
-
/**
|
|
589
|
-
* Insert a binding node
|
|
590
|
-
*/
|
|
591
|
-
setBinding: (attrs: BindingAttrs) => ReturnType;
|
|
592
|
-
/**
|
|
593
|
-
* Update the current binding node attributes
|
|
594
|
-
*/
|
|
595
|
-
updateBinding: (attrs: BindingAttrs) => ReturnType;
|
|
566
|
+
InlineElement: {
|
|
596
567
|
/**
|
|
597
|
-
*
|
|
568
|
+
* Toggle a InlineElement
|
|
598
569
|
*/
|
|
599
|
-
|
|
570
|
+
setInlineElement: (tag: string) => ReturnType;
|
|
600
571
|
};
|
|
601
572
|
}
|
|
602
573
|
}
|
|
@@ -622,6 +593,15 @@ declare module '@tiptap/core' {
|
|
|
622
593
|
}
|
|
623
594
|
|
|
624
595
|
|
|
596
|
+
declare module '@tiptap/vue-3' {
|
|
597
|
+
interface Commands<ReturnType> {
|
|
598
|
+
videoPicker: {
|
|
599
|
+
insertVideoPicker: () => ReturnType;
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
|
|
625
605
|
declare module '@tiptap/core' {
|
|
626
606
|
interface Commands<ReturnType> {
|
|
627
607
|
callout: {
|
|
@@ -631,6 +611,26 @@ declare module '@tiptap/core' {
|
|
|
631
611
|
}
|
|
632
612
|
|
|
633
613
|
|
|
614
|
+
declare module '@tiptap/core' {
|
|
615
|
+
interface Commands<ReturnType> {
|
|
616
|
+
Binding: {
|
|
617
|
+
/**
|
|
618
|
+
* Insert a binding node
|
|
619
|
+
*/
|
|
620
|
+
setBinding: (attrs: BindingAttrs) => ReturnType;
|
|
621
|
+
/**
|
|
622
|
+
* Update the current binding node attributes
|
|
623
|
+
*/
|
|
624
|
+
updateBinding: (attrs: BindingAttrs) => ReturnType;
|
|
625
|
+
/**
|
|
626
|
+
* Remove current binding node
|
|
627
|
+
*/
|
|
628
|
+
unsetBinding: () => ReturnType;
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
|
|
634
634
|
declare module '@tiptap/core' {
|
|
635
635
|
interface Commands<ReturnType> {
|
|
636
636
|
completion: {
|
|
@@ -3,15 +3,6 @@ export declare const serviceWorker: () => string;
|
|
|
3
3
|
export { }
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
declare module '@tiptap/core' {
|
|
7
|
-
interface Commands<ReturnType> {
|
|
8
|
-
Element: {
|
|
9
|
-
setElement: (tag: string, slot?: string) => ReturnType;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
6
|
declare module '@tiptap/vue-3' {
|
|
16
7
|
interface Commands<ReturnType> {
|
|
17
8
|
imagePicker: {
|
|
@@ -21,15 +12,6 @@ declare module '@tiptap/vue-3' {
|
|
|
21
12
|
}
|
|
22
13
|
|
|
23
14
|
|
|
24
|
-
declare module '@tiptap/vue-3' {
|
|
25
|
-
interface Commands<ReturnType> {
|
|
26
|
-
videoPicker: {
|
|
27
|
-
insertVideoPicker: () => ReturnType;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
15
|
declare module '@tiptap/core' {
|
|
34
16
|
interface Commands<ReturnType> {
|
|
35
17
|
Slot: {
|
|
@@ -44,11 +26,8 @@ declare module '@tiptap/core' {
|
|
|
44
26
|
|
|
45
27
|
declare module '@tiptap/core' {
|
|
46
28
|
interface Commands<ReturnType> {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
* Toggle a InlineElement
|
|
50
|
-
*/
|
|
51
|
-
setInlineElement: (tag: string) => ReturnType;
|
|
29
|
+
Element: {
|
|
30
|
+
setElement: (tag: string, slot?: string) => ReturnType;
|
|
52
31
|
};
|
|
53
32
|
}
|
|
54
33
|
}
|
|
@@ -56,19 +35,11 @@ declare module '@tiptap/core' {
|
|
|
56
35
|
|
|
57
36
|
declare module '@tiptap/core' {
|
|
58
37
|
interface Commands<ReturnType> {
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Insert a binding node
|
|
62
|
-
*/
|
|
63
|
-
setBinding: (attrs: BindingAttrs) => ReturnType;
|
|
64
|
-
/**
|
|
65
|
-
* Update the current binding node attributes
|
|
66
|
-
*/
|
|
67
|
-
updateBinding: (attrs: BindingAttrs) => ReturnType;
|
|
38
|
+
InlineElement: {
|
|
68
39
|
/**
|
|
69
|
-
*
|
|
40
|
+
* Toggle a InlineElement
|
|
70
41
|
*/
|
|
71
|
-
|
|
42
|
+
setInlineElement: (tag: string) => ReturnType;
|
|
72
43
|
};
|
|
73
44
|
}
|
|
74
45
|
}
|
|
@@ -94,6 +65,15 @@ declare module '@tiptap/core' {
|
|
|
94
65
|
}
|
|
95
66
|
|
|
96
67
|
|
|
68
|
+
declare module '@tiptap/vue-3' {
|
|
69
|
+
interface Commands<ReturnType> {
|
|
70
|
+
videoPicker: {
|
|
71
|
+
insertVideoPicker: () => ReturnType;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
97
77
|
declare module '@tiptap/core' {
|
|
98
78
|
interface Commands<ReturnType> {
|
|
99
79
|
callout: {
|
|
@@ -103,6 +83,26 @@ declare module '@tiptap/core' {
|
|
|
103
83
|
}
|
|
104
84
|
|
|
105
85
|
|
|
86
|
+
declare module '@tiptap/core' {
|
|
87
|
+
interface Commands<ReturnType> {
|
|
88
|
+
Binding: {
|
|
89
|
+
/**
|
|
90
|
+
* Insert a binding node
|
|
91
|
+
*/
|
|
92
|
+
setBinding: (attrs: BindingAttrs) => ReturnType;
|
|
93
|
+
/**
|
|
94
|
+
* Update the current binding node attributes
|
|
95
|
+
*/
|
|
96
|
+
updateBinding: (attrs: BindingAttrs) => ReturnType;
|
|
97
|
+
/**
|
|
98
|
+
* Remove current binding node
|
|
99
|
+
*/
|
|
100
|
+
unsetBinding: () => ReturnType;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
|
|
106
106
|
declare module '@tiptap/core' {
|
|
107
107
|
interface Commands<ReturnType> {
|
|
108
108
|
completion: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const n=()=>"\nconst DB_NAME = 'studio-media'\nconst STORE_NAME = 'drafts'\n\nconst DraftStatus = {\n Deleted: 'deleted',\n Created: 'created',\n Updated: 'updated',\n Pristine: 'pristine'\n}\n\nconst MEDIA_EXTENSIONS = [\n 'png',\n 'jpg',\n 'jpeg',\n 'svg',\n 'webp',\n 'avif',\n 'ico',\n 'gif',\n 'mp4',\n 'mov',\n 'avi',\n 'mkv',\n 'webm',\n 'ogg',\n 'mp3',\n 'wav',\n 'aac',\n 'm4a',\n 'm4v',\n 'm4b',\n]\n\nfunction extractImagePath(url) {\n const pathname = url.pathname;\n if (pathname.startsWith('/_ipx/_/')) {\n return pathname.replace('/_ipx/_', '')\n }\n\n if (pathname.startsWith('/_vercel/image')) {\n return url.searchParams.get('url') || null\n }\n\n if (MEDIA_EXTENSIONS.includes(pathname.split('.').pop())) {\n return pathname\n }\n\n return null\n}\n\nself.addEventListener('install', event => {\n self.skipWaiting()\n})\n\nself.addEventListener('activate', event => {\n event.waitUntil(self.clients.claim())\n})\n\nself.addEventListener('fetch', event => {\n const url = new URL(event.request.url);\n const isSameDomain = url.origin === self.location.origin;\n\n if (!isSameDomain) {\n return\n }\n\n const imageUrl = extractImagePath(url);\n if (imageUrl) {\n return event.respondWith(fetchFromIndexedDB(event, imageUrl));\n }\n})\n\nfunction fetchFromIndexedDB(event, url) {\n const dbKey = url.replace(/^\\//g, '').replace(/\\//g, ':')\n return getData(dbKey).then(data => {\n if (!data) {\n return fetch(event.request);\n }\n\n const dbItem = JSON.parse(data)\n\n console.log('Data found in IndexedDB:', dbItem);\n\n // Deleted file\n if (dbItem.status === DraftStatus.Deleted) {\n return fetch('https://placehold.co/1200x800?text=Deleted');\n }\n\n // Renamed file\n if (dbItem.original?.path) {\n return fetch(dbItem.original.path);\n }\n\n // Created file\n const parsed = parseDataUrl(dbItem.modified.raw);\n const bytes = base64ToUint8Array(parsed.base64);\n\n return new Response(bytes, {\n headers: { 'Content-Type': parsed.mime }\n });\n })\n}\n\nfunction parseDataUrl(dataUrl) {\n // Example: data:image/png;base64,iVBORw0KG...\n const match = dataUrl.match(/^data:(.+);base64,(.+)$/);\n if (!match) return null;\n return {\n mime: match[1],\n base64: match[2]\n };\n}\n\nfunction base64ToUint8Array(base64) {\n const binary = atob(base64);\n const len = binary.length;\n const bytes = new Uint8Array(len);\n for (let i = 0; i < len; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes;\n}\n\n// IndexedDB\nfunction openDB() {\n return new Promise((resolve, reject) => {\n const request = indexedDB.open(DB_NAME, 1);\n request.onupgradeneeded = event => {\n const db = event.target.result;\n db.createObjectStore(STORE_NAME
|
|
1
|
+
const n=()=>"\nconst DB_NAME = 'studio-media'\nconst STORE_NAME = 'drafts'\n\nconst DraftStatus = {\n Deleted: 'deleted',\n Created: 'created',\n Updated: 'updated',\n Pristine: 'pristine'\n}\n\nconst MEDIA_EXTENSIONS = [\n 'png',\n 'jpg',\n 'jpeg',\n 'svg',\n 'webp',\n 'avif',\n 'ico',\n 'gif',\n 'mp4',\n 'mov',\n 'avi',\n 'mkv',\n 'webm',\n 'ogg',\n 'mp3',\n 'wav',\n 'aac',\n 'm4a',\n 'm4v',\n 'm4b',\n]\n\nfunction extractImagePath(url) {\n const pathname = url.pathname;\n if (pathname.startsWith('/_ipx/_/')) {\n return pathname.replace('/_ipx/_', '')\n }\n\n if (pathname.startsWith('/_vercel/image')) {\n return url.searchParams.get('url') || null\n }\n\n if (MEDIA_EXTENSIONS.includes(pathname.split('.').pop())) {\n return pathname\n }\n\n return null\n}\n\nself.addEventListener('install', event => {\n self.skipWaiting()\n})\n\nself.addEventListener('activate', event => {\n event.waitUntil(self.clients.claim())\n})\n\nself.addEventListener('fetch', event => {\n const url = new URL(event.request.url);\n const isSameDomain = url.origin === self.location.origin;\n\n if (!isSameDomain) {\n return\n }\n\n const imageUrl = extractImagePath(url);\n if (imageUrl) {\n return event.respondWith(fetchFromIndexedDB(event, imageUrl));\n }\n})\n\nfunction fetchFromIndexedDB(event, url) {\n const dbKey = url.replace(/^\\//g, '').replace(/\\//g, ':')\n return getData(dbKey).then(data => {\n if (!data) {\n return fetch(event.request);\n }\n\n const dbItem = JSON.parse(data)\n\n console.log('Data found in IndexedDB:', dbItem);\n\n // Deleted file\n if (dbItem.status === DraftStatus.Deleted) {\n return fetch('https://placehold.co/1200x800?text=Deleted');\n }\n\n // Renamed file\n if (dbItem.original?.path) {\n return fetch(dbItem.original.path);\n }\n\n // Created file\n const parsed = parseDataUrl(dbItem.modified.raw);\n const bytes = base64ToUint8Array(parsed.base64);\n\n return new Response(bytes, {\n headers: { 'Content-Type': parsed.mime }\n });\n }).catch(() => fetch(event.request))\n}\n\nfunction parseDataUrl(dataUrl) {\n // Example: data:image/png;base64,iVBORw0KG...\n const match = dataUrl.match(/^data:(.+);base64,(.+)$/);\n if (!match) return null;\n return {\n mime: match[1],\n base64: match[2]\n };\n}\n\nfunction base64ToUint8Array(base64) {\n const binary = atob(base64);\n const len = binary.length;\n const bytes = new Uint8Array(len);\n for (let i = 0; i < len; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes;\n}\n\n// IndexedDB\nfunction openDB() {\n return new Promise((resolve, reject) => {\n const request = indexedDB.open(DB_NAME, 1);\n request.onupgradeneeded = event => {\n const db = event.target.result;\n db.createObjectStore(STORE_NAME);\n };\n request.onsuccess = event => resolve(event.target.result);\n request.onerror = event => reject(event.target.error);\n });\n}\n\n// Read data from the object store\nfunction getData(key) {\n return openDB().then(db => {\n return new Promise((resolve, reject) => {\n const tx = db.transaction('drafts', 'readonly');\n const store = tx.objectStore('drafts');\n const request = store.get(key);\n request.onsuccess = () => resolve(request.result);\n request.onerror = () => reject(request.error);\n });\n });\n}\n";export{n as serviceWorker};
|
package/dist/app/shared.d.ts
CHANGED
|
@@ -87,15 +87,6 @@ export declare function remarkEmojiPlugin(): (tree: Nodes) => void;
|
|
|
87
87
|
export { }
|
|
88
88
|
|
|
89
89
|
|
|
90
|
-
declare module '@tiptap/core' {
|
|
91
|
-
interface Commands<ReturnType> {
|
|
92
|
-
Element: {
|
|
93
|
-
setElement: (tag: string, slot?: string) => ReturnType;
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
90
|
declare module '@tiptap/vue-3' {
|
|
100
91
|
interface Commands<ReturnType> {
|
|
101
92
|
imagePicker: {
|
|
@@ -105,15 +96,6 @@ declare module '@tiptap/vue-3' {
|
|
|
105
96
|
}
|
|
106
97
|
|
|
107
98
|
|
|
108
|
-
declare module '@tiptap/vue-3' {
|
|
109
|
-
interface Commands<ReturnType> {
|
|
110
|
-
videoPicker: {
|
|
111
|
-
insertVideoPicker: () => ReturnType;
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
99
|
declare module '@tiptap/core' {
|
|
118
100
|
interface Commands<ReturnType> {
|
|
119
101
|
Slot: {
|
|
@@ -128,11 +110,8 @@ declare module '@tiptap/core' {
|
|
|
128
110
|
|
|
129
111
|
declare module '@tiptap/core' {
|
|
130
112
|
interface Commands<ReturnType> {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
* Toggle a InlineElement
|
|
134
|
-
*/
|
|
135
|
-
setInlineElement: (tag: string) => ReturnType;
|
|
113
|
+
Element: {
|
|
114
|
+
setElement: (tag: string, slot?: string) => ReturnType;
|
|
136
115
|
};
|
|
137
116
|
}
|
|
138
117
|
}
|
|
@@ -140,19 +119,11 @@ declare module '@tiptap/core' {
|
|
|
140
119
|
|
|
141
120
|
declare module '@tiptap/core' {
|
|
142
121
|
interface Commands<ReturnType> {
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Insert a binding node
|
|
146
|
-
*/
|
|
147
|
-
setBinding: (attrs: BindingAttrs) => ReturnType;
|
|
148
|
-
/**
|
|
149
|
-
* Update the current binding node attributes
|
|
150
|
-
*/
|
|
151
|
-
updateBinding: (attrs: BindingAttrs) => ReturnType;
|
|
122
|
+
InlineElement: {
|
|
152
123
|
/**
|
|
153
|
-
*
|
|
124
|
+
* Toggle a InlineElement
|
|
154
125
|
*/
|
|
155
|
-
|
|
126
|
+
setInlineElement: (tag: string) => ReturnType;
|
|
156
127
|
};
|
|
157
128
|
}
|
|
158
129
|
}
|
|
@@ -178,6 +149,15 @@ declare module '@tiptap/core' {
|
|
|
178
149
|
}
|
|
179
150
|
|
|
180
151
|
|
|
152
|
+
declare module '@tiptap/vue-3' {
|
|
153
|
+
interface Commands<ReturnType> {
|
|
154
|
+
videoPicker: {
|
|
155
|
+
insertVideoPicker: () => ReturnType;
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
|
|
181
161
|
declare module '@tiptap/core' {
|
|
182
162
|
interface Commands<ReturnType> {
|
|
183
163
|
callout: {
|
|
@@ -187,6 +167,26 @@ declare module '@tiptap/core' {
|
|
|
187
167
|
}
|
|
188
168
|
|
|
189
169
|
|
|
170
|
+
declare module '@tiptap/core' {
|
|
171
|
+
interface Commands<ReturnType> {
|
|
172
|
+
Binding: {
|
|
173
|
+
/**
|
|
174
|
+
* Insert a binding node
|
|
175
|
+
*/
|
|
176
|
+
setBinding: (attrs: BindingAttrs) => ReturnType;
|
|
177
|
+
/**
|
|
178
|
+
* Update the current binding node attributes
|
|
179
|
+
*/
|
|
180
|
+
updateBinding: (attrs: BindingAttrs) => ReturnType;
|
|
181
|
+
/**
|
|
182
|
+
* Remove current binding node
|
|
183
|
+
*/
|
|
184
|
+
unsetBinding: () => ReturnType;
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
|
|
190
190
|
declare module '@tiptap/core' {
|
|
191
191
|
interface Commands<ReturnType> {
|
|
192
192
|
completion: {
|
package/dist/module/module.json
CHANGED
package/dist/module/module.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { createStorage } from 'unstorage';
|
|
|
7
7
|
import { withLeadingSlash } from 'ufo';
|
|
8
8
|
import { readFile } from 'node:fs/promises';
|
|
9
9
|
|
|
10
|
-
const version = "1.5.
|
|
10
|
+
const version = "1.5.1";
|
|
11
11
|
|
|
12
12
|
const VIRTUAL_MEDIA_COLLECTION_NAME = "public-assets";
|
|
13
13
|
|
|
@@ -283,7 +283,7 @@ const module$1 = defineNuxtModule({
|
|
|
283
283
|
if (isProdBuild) {
|
|
284
284
|
const detectedRepo = detectRepositoryFromCI();
|
|
285
285
|
if (detectedRepo) {
|
|
286
|
-
options.repository = defu(
|
|
286
|
+
options.repository = defu(options.repository, detectedRepo);
|
|
287
287
|
}
|
|
288
288
|
logger.info(`Using repository: ${options.repository?.provider}:${options.repository?.owner}/${options.repository?.repo}#${options.repository?.branch}`);
|
|
289
289
|
}
|
|
@@ -89,7 +89,7 @@ export function parseIpxPath(pathname) {
|
|
|
89
89
|
message: "IPX modifiers are required."
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
const id = decodeURIComponent(idSegments.join("/"));
|
|
92
|
+
const id = decodeURIComponent(idSegments.join("/")).replace(/^(https?:\/)([^/])/, "$1/$2");
|
|
93
93
|
if (!id) {
|
|
94
94
|
throw createError({
|
|
95
95
|
statusCode: 400,
|