nuxt-content-assets 1.8.1 → 1.8.3
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/module.d.mts +43 -0
- package/dist/module.d.ts +46 -0
- package/dist/module.json +1 -1
- package/dist/runtime/content/plugin.js +1 -1
- package/dist/types.d.mts +2 -6
- package/package.json +2 -2
package/dist/module.d.mts
CHANGED
|
@@ -1,3 +1,46 @@
|
|
|
1
|
+
interface ModuleOptions {
|
|
2
|
+
/**
|
|
3
|
+
* Image size hints
|
|
4
|
+
*
|
|
5
|
+
* @example 'attrs style url'
|
|
6
|
+
* @default 'style'
|
|
7
|
+
*/
|
|
8
|
+
imageSize?: string | string[] | false;
|
|
9
|
+
/**
|
|
10
|
+
* List of content extensions; anything else as an asset
|
|
11
|
+
*
|
|
12
|
+
* @example 'md'
|
|
13
|
+
* @default 'md csv ya?ml json'
|
|
14
|
+
*/
|
|
15
|
+
contentExtensions?: string | string[];
|
|
16
|
+
/**
|
|
17
|
+
* Display debug messages
|
|
18
|
+
*
|
|
19
|
+
* @example true
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
debug?: boolean;
|
|
23
|
+
}
|
|
24
|
+
type ImageSize = Array<'style' | 'src' | 'url' | 'attrs'>;
|
|
25
|
+
type AssetConfig = {
|
|
26
|
+
srcAttr: string;
|
|
27
|
+
content: string[];
|
|
28
|
+
width?: number;
|
|
29
|
+
height?: number;
|
|
30
|
+
};
|
|
31
|
+
interface AssetMessage {
|
|
32
|
+
event: 'update' | 'remove' | 'refresh';
|
|
33
|
+
src?: string;
|
|
34
|
+
width?: string;
|
|
35
|
+
height?: string;
|
|
36
|
+
}
|
|
37
|
+
type Callback = (data: any) => void;
|
|
38
|
+
interface SocketInstance {
|
|
39
|
+
send: (data: any) => SocketInstance;
|
|
40
|
+
addHandler: (handler: Callback) => SocketInstance;
|
|
41
|
+
}
|
|
42
|
+
|
|
1
43
|
declare const _default: any;
|
|
2
44
|
|
|
3
45
|
export { _default as default };
|
|
46
|
+
export type { AssetConfig, AssetMessage, ImageSize, ModuleOptions, SocketInstance };
|
package/dist/module.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
interface ModuleOptions {
|
|
2
|
+
/**
|
|
3
|
+
* Image size hints
|
|
4
|
+
*
|
|
5
|
+
* @example 'attrs style url'
|
|
6
|
+
* @default 'style'
|
|
7
|
+
*/
|
|
8
|
+
imageSize?: string | string[] | false;
|
|
9
|
+
/**
|
|
10
|
+
* List of content extensions; anything else as an asset
|
|
11
|
+
*
|
|
12
|
+
* @example 'md'
|
|
13
|
+
* @default 'md csv ya?ml json'
|
|
14
|
+
*/
|
|
15
|
+
contentExtensions?: string | string[];
|
|
16
|
+
/**
|
|
17
|
+
* Display debug messages
|
|
18
|
+
*
|
|
19
|
+
* @example true
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
debug?: boolean;
|
|
23
|
+
}
|
|
24
|
+
type ImageSize = Array<'style' | 'src' | 'url' | 'attrs'>;
|
|
25
|
+
type AssetConfig = {
|
|
26
|
+
srcAttr: string;
|
|
27
|
+
content: string[];
|
|
28
|
+
width?: number;
|
|
29
|
+
height?: number;
|
|
30
|
+
};
|
|
31
|
+
interface AssetMessage {
|
|
32
|
+
event: 'update' | 'remove' | 'refresh';
|
|
33
|
+
src?: string;
|
|
34
|
+
width?: string;
|
|
35
|
+
height?: string;
|
|
36
|
+
}
|
|
37
|
+
type Callback = (data: any) => void;
|
|
38
|
+
interface SocketInstance {
|
|
39
|
+
send: (data: any) => SocketInstance;
|
|
40
|
+
addHandler: (handler: Callback) => SocketInstance;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
declare const _default: any;
|
|
44
|
+
|
|
45
|
+
export { _default as default };
|
|
46
|
+
export type { AssetConfig, AssetMessage, ImageSize, ModuleOptions, SocketInstance };
|
package/dist/module.json
CHANGED
|
@@ -20,7 +20,7 @@ const plugin = async (nitro) => {
|
|
|
20
20
|
const { tag, props } = node;
|
|
21
21
|
for (const [prop, value] of Object.entries(props)) {
|
|
22
22
|
if (typeof value !== "string") {
|
|
23
|
-
|
|
23
|
+
continue;
|
|
24
24
|
}
|
|
25
25
|
const { srcAttr, width, height } = resolveAsset(content, value, true);
|
|
26
26
|
if (srcAttr) {
|
package/dist/types.d.mts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import type { NuxtModule } from '@nuxt/schema'
|
|
2
|
-
|
|
3
|
-
import type { default as Module } from './module.mjs'
|
|
4
|
-
|
|
5
|
-
export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
|
|
6
|
-
|
|
7
1
|
export { default } from './module.mjs'
|
|
2
|
+
|
|
3
|
+
export { type AssetConfig, type AssetMessage, type ImageSize, type ModuleOptions, type SocketInstance } from './module.mjs'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-content-assets",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.3",
|
|
4
4
|
"description": "Enable locally-located assets in Nuxt Content",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
-
"types": "./dist/
|
|
13
|
+
"types": "./dist/module.d.ts",
|
|
14
14
|
"import": "./dist/module.mjs"
|
|
15
15
|
}
|
|
16
16
|
},
|