@ztl-uwu/nuxt-content 2.13.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/LICENSE +21 -0
- package/README.md +64 -0
- package/dist/module.d.mts +1176 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +696 -0
- package/dist/runtime/app.vue +3 -0
- package/dist/runtime/app.vue.d.ts +2 -0
- package/dist/runtime/components/ContentDoc.vue +108 -0
- package/dist/runtime/components/ContentDoc.vue.d.ts +118 -0
- package/dist/runtime/components/ContentList.vue +59 -0
- package/dist/runtime/components/ContentList.vue.d.ts +59 -0
- package/dist/runtime/components/ContentNavigation.vue +61 -0
- package/dist/runtime/components/ContentNavigation.vue.d.ts +35 -0
- package/dist/runtime/components/ContentQuery.vue +212 -0
- package/dist/runtime/components/ContentQuery.vue.d.ts +0 -0
- package/dist/runtime/components/ContentRenderer.vue +78 -0
- package/dist/runtime/components/ContentRenderer.vue.d.ts +56 -0
- package/dist/runtime/components/ContentRendererMarkdown.vue +69 -0
- package/dist/runtime/components/ContentRendererMarkdown.vue.d.ts +73 -0
- package/dist/runtime/components/ContentSlot.vue +25 -0
- package/dist/runtime/components/ContentSlot.vue.d.ts +37 -0
- package/dist/runtime/components/DocumentDrivenEmpty.vue +18 -0
- package/dist/runtime/components/DocumentDrivenEmpty.vue.d.ts +17 -0
- package/dist/runtime/components/DocumentDrivenNotFound.vue +9 -0
- package/dist/runtime/components/DocumentDrivenNotFound.vue.d.ts +5 -0
- package/dist/runtime/components/Markdown.vue +29 -0
- package/dist/runtime/components/Markdown.vue.d.ts +31 -0
- package/dist/runtime/components/Prose/ProseCode.vue +32 -0
- package/dist/runtime/components/Prose/ProseCode.vue.d.ts +110 -0
- package/dist/runtime/components/Prose/ProseCodeInline.vue +3 -0
- package/dist/runtime/components/Prose/ProseCodeInline.vue.d.ts +14 -0
- package/dist/runtime/components/Prose/ProsePre.vue +42 -0
- package/dist/runtime/components/Prose/ProsePre.vue.d.ts +146 -0
- package/dist/runtime/composables/client-db.d.ts +14 -0
- package/dist/runtime/composables/client-db.js +105 -0
- package/dist/runtime/composables/content.d.ts +19 -0
- package/dist/runtime/composables/content.js +41 -0
- package/dist/runtime/composables/head.d.ts +4 -0
- package/dist/runtime/composables/head.js +94 -0
- package/dist/runtime/composables/helpers.d.ts +7 -0
- package/dist/runtime/composables/helpers.js +66 -0
- package/dist/runtime/composables/navigation.d.ts +2 -0
- package/dist/runtime/composables/navigation.js +34 -0
- package/dist/runtime/composables/preview.d.ts +5 -0
- package/dist/runtime/composables/preview.js +41 -0
- package/dist/runtime/composables/query.d.ts +10 -0
- package/dist/runtime/composables/query.js +64 -0
- package/dist/runtime/composables/search.d.ts +130 -0
- package/dist/runtime/composables/search.js +59 -0
- package/dist/runtime/composables/useUnwrap.d.ts +5 -0
- package/dist/runtime/composables/useUnwrap.js +5 -0
- package/dist/runtime/composables/utils.d.ts +6 -0
- package/dist/runtime/composables/utils.js +36 -0
- package/dist/runtime/composables/web-socket.d.ts +3 -0
- package/dist/runtime/composables/web-socket.js +65 -0
- package/dist/runtime/legacy/composables/client-db.d.ts +12 -0
- package/dist/runtime/legacy/composables/client-db.js +105 -0
- package/dist/runtime/legacy/composables/navigation.d.ts +2 -0
- package/dist/runtime/legacy/composables/navigation.js +34 -0
- package/dist/runtime/legacy/composables/query.d.ts +10 -0
- package/dist/runtime/legacy/composables/query.js +61 -0
- package/dist/runtime/legacy/plugins/documentDriven.d.ts +2 -0
- package/dist/runtime/legacy/plugins/documentDriven.js +231 -0
- package/dist/runtime/legacy/server.d.ts +3 -0
- package/dist/runtime/legacy/server.js +3 -0
- package/dist/runtime/legacy/types.d.ts +5 -0
- package/dist/runtime/pages/document-driven.vue +27 -0
- package/dist/runtime/pages/document-driven.vue.d.ts +2 -0
- package/dist/runtime/plugins/documentDriven.d.ts +2 -0
- package/dist/runtime/plugins/documentDriven.js +222 -0
- package/dist/runtime/plugins/ws.d.ts +2 -0
- package/dist/runtime/plugins/ws.js +7 -0
- package/dist/runtime/query/match/index.d.ts +6 -0
- package/dist/runtime/query/match/index.js +123 -0
- package/dist/runtime/query/match/pipeline-legacy.d.ts +2 -0
- package/dist/runtime/query/match/pipeline-legacy.js +22 -0
- package/dist/runtime/query/match/pipeline.d.ts +2 -0
- package/dist/runtime/query/match/pipeline.js +104 -0
- package/dist/runtime/query/match/utils.d.ts +35 -0
- package/dist/runtime/query/match/utils.js +65 -0
- package/dist/runtime/query/query.d.ts +12 -0
- package/dist/runtime/query/query.js +61 -0
- package/dist/runtime/server/api/cache.d.ts +7 -0
- package/dist/runtime/server/api/cache.js +18 -0
- package/dist/runtime/server/api/navigation-qid-params.d.ts +1 -0
- package/dist/runtime/server/api/navigation-qid-params.js +1 -0
- package/dist/runtime/server/api/navigation-qid.d.ts +1 -0
- package/dist/runtime/server/api/navigation-qid.js +1 -0
- package/dist/runtime/server/api/navigation.d.ts +2 -0
- package/dist/runtime/server/api/navigation.js +42 -0
- package/dist/runtime/server/api/query-qid-params.d.ts +1 -0
- package/dist/runtime/server/api/query-qid-params.js +1 -0
- package/dist/runtime/server/api/query-qid.d.ts +1 -0
- package/dist/runtime/server/api/query-qid.js +1 -0
- package/dist/runtime/server/api/query.d.ts +2 -0
- package/dist/runtime/server/api/query.js +32 -0
- package/dist/runtime/server/api/search.d.ts +8 -0
- package/dist/runtime/server/api/search.js +16 -0
- package/dist/runtime/server/content-index.d.ts +4 -0
- package/dist/runtime/server/content-index.js +37 -0
- package/dist/runtime/server/index.d.ts +1 -0
- package/dist/runtime/server/index.js +1 -0
- package/dist/runtime/server/navigation.d.ts +5 -0
- package/dist/runtime/server/navigation.js +96 -0
- package/dist/runtime/server/plugins/refresh-cache.d.ts +2 -0
- package/dist/runtime/server/plugins/refresh-cache.js +15 -0
- package/dist/runtime/server/preview.d.ts +5 -0
- package/dist/runtime/server/preview.js +9 -0
- package/dist/runtime/server/search.d.ts +14 -0
- package/dist/runtime/server/search.js +70 -0
- package/dist/runtime/server/storage.d.ts +35 -0
- package/dist/runtime/server/storage.js +238 -0
- package/dist/runtime/transformers/component-resolver.d.ts +2 -0
- package/dist/runtime/transformers/component-resolver.js +44 -0
- package/dist/runtime/transformers/csv/create-tokenizer.d.ts +39 -0
- package/dist/runtime/transformers/csv/create-tokenizer.js +307 -0
- package/dist/runtime/transformers/csv/from-csv.d.ts +13 -0
- package/dist/runtime/transformers/csv/from-csv.js +203 -0
- package/dist/runtime/transformers/csv/index.d.ts +2 -0
- package/dist/runtime/transformers/csv/index.js +50 -0
- package/dist/runtime/transformers/csv/parser.d.ts +24 -0
- package/dist/runtime/transformers/csv/parser.js +154 -0
- package/dist/runtime/transformers/index.d.ts +7 -0
- package/dist/runtime/transformers/index.js +50 -0
- package/dist/runtime/transformers/json.d.ts +2 -0
- package/dist/runtime/transformers/json.js +29 -0
- package/dist/runtime/transformers/markdown.d.ts +2 -0
- package/dist/runtime/transformers/markdown.js +88 -0
- package/dist/runtime/transformers/path-meta.d.ts +27 -0
- package/dist/runtime/transformers/path-meta.js +59 -0
- package/dist/runtime/transformers/utils.d.ts +3 -0
- package/dist/runtime/transformers/utils.js +12 -0
- package/dist/runtime/transformers/yaml.d.ts +2 -0
- package/dist/runtime/transformers/yaml.js +21 -0
- package/dist/runtime/utils/config.d.ts +4 -0
- package/dist/runtime/utils/config.js +7 -0
- package/dist/runtime/utils/html-tags.d.ts +2 -0
- package/dist/runtime/utils/html-tags.js +119 -0
- package/dist/runtime/utils/json.d.ts +10 -0
- package/dist/runtime/utils/json.js +20 -0
- package/dist/runtime/utils/query.d.ts +5 -0
- package/dist/runtime/utils/query.js +77 -0
- package/dist/runtime/virtual/transformers.d.ts +2 -0
- package/dist/types.d.mts +9 -0
- package/dist/web-types.json +572 -0
- package/package.json +111 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent, watch, h, useSlots } from "vue";
|
|
3
|
+
import ContentRendererMarkdown from "./ContentRendererMarkdown.vue";
|
|
4
|
+
export default defineComponent({
|
|
5
|
+
name: "ContentRenderer",
|
|
6
|
+
props: {
|
|
7
|
+
/**
|
|
8
|
+
* The document to render.
|
|
9
|
+
*/
|
|
10
|
+
value: {
|
|
11
|
+
type: Object,
|
|
12
|
+
required: false,
|
|
13
|
+
default: () => ({})
|
|
14
|
+
},
|
|
15
|
+
/**
|
|
16
|
+
* Whether or not to render the excerpt.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
excerpt: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: false
|
|
22
|
+
},
|
|
23
|
+
/**
|
|
24
|
+
* The tag to use for the renderer element if it is used.
|
|
25
|
+
* @default 'div'
|
|
26
|
+
*/
|
|
27
|
+
tag: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: "div"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
setup(props) {
|
|
33
|
+
watch(
|
|
34
|
+
() => props.excerpt,
|
|
35
|
+
(newExcerpt) => {
|
|
36
|
+
if (newExcerpt && !props.value?.excerpt) {
|
|
37
|
+
console.warn(`No excerpt found for document content/${props?.value?._path}.${props?.value?._extension}!`);
|
|
38
|
+
console.warn("Make sure to use <!--more--> in your content if you want to use excerpt feature.");
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
immediate: true
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
},
|
|
46
|
+
/**
|
|
47
|
+
* Content empty fallback
|
|
48
|
+
* @slot empty
|
|
49
|
+
*/
|
|
50
|
+
render(ctx) {
|
|
51
|
+
const slots = useSlots();
|
|
52
|
+
const { value, excerpt, tag } = ctx;
|
|
53
|
+
const markdownAST = excerpt ? value?.excerpt : value?.body;
|
|
54
|
+
if (!markdownAST?.children?.length && slots?.empty) {
|
|
55
|
+
return slots.empty({ value, excerpt, tag, ...this.$attrs });
|
|
56
|
+
}
|
|
57
|
+
if (slots?.default) {
|
|
58
|
+
return slots.default({ value, excerpt, tag, ...this.$attrs });
|
|
59
|
+
}
|
|
60
|
+
if (markdownAST?.type === "root" && markdownAST?.children?.length) {
|
|
61
|
+
return h(
|
|
62
|
+
ContentRendererMarkdown,
|
|
63
|
+
{
|
|
64
|
+
value,
|
|
65
|
+
excerpt,
|
|
66
|
+
tag,
|
|
67
|
+
...this.$attrs
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
return h(
|
|
72
|
+
"pre",
|
|
73
|
+
null,
|
|
74
|
+
JSON.stringify({ message: "You should use slots with <ContentRenderer>", value, excerpt, tag }, null, 2)
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
</script>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
/**
|
|
3
|
+
* The document to render.
|
|
4
|
+
*/
|
|
5
|
+
value: {
|
|
6
|
+
type: ObjectConstructor;
|
|
7
|
+
required: false;
|
|
8
|
+
default: () => {};
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Whether or not to render the excerpt.
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
excerpt: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* The tag to use for the renderer element if it is used.
|
|
20
|
+
* @default 'div'
|
|
21
|
+
*/
|
|
22
|
+
tag: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
}>, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
27
|
+
/**
|
|
28
|
+
* The document to render.
|
|
29
|
+
*/
|
|
30
|
+
value: {
|
|
31
|
+
type: ObjectConstructor;
|
|
32
|
+
required: false;
|
|
33
|
+
default: () => {};
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Whether or not to render the excerpt.
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
excerpt: {
|
|
40
|
+
type: BooleanConstructor;
|
|
41
|
+
default: boolean;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The tag to use for the renderer element if it is used.
|
|
45
|
+
* @default 'div'
|
|
46
|
+
*/
|
|
47
|
+
tag: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
default: string;
|
|
50
|
+
};
|
|
51
|
+
}>> & Readonly<{}>, {
|
|
52
|
+
value: Record<string, any>;
|
|
53
|
+
tag: string;
|
|
54
|
+
excerpt: boolean;
|
|
55
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
56
|
+
export default _default;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<MDCRenderer
|
|
3
|
+
:body="body"
|
|
4
|
+
:data="data"
|
|
5
|
+
:tag="tag"
|
|
6
|
+
:components="mdcComponents"
|
|
7
|
+
:data-content-id="debug ? value._id : void 0"
|
|
8
|
+
/>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup>
|
|
12
|
+
import { computed } from "vue";
|
|
13
|
+
import { useContentPreview } from "../composables/preview";
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
/**
|
|
16
|
+
* Content to render
|
|
17
|
+
*/
|
|
18
|
+
value: {
|
|
19
|
+
type: Object,
|
|
20
|
+
required: true
|
|
21
|
+
},
|
|
22
|
+
/**
|
|
23
|
+
* Render only the excerpt
|
|
24
|
+
*/
|
|
25
|
+
excerpt: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: false
|
|
28
|
+
},
|
|
29
|
+
/**
|
|
30
|
+
* Root tag to use for rendering
|
|
31
|
+
*/
|
|
32
|
+
tag: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: "div"
|
|
35
|
+
},
|
|
36
|
+
/**
|
|
37
|
+
* The map of custom components to use for rendering.
|
|
38
|
+
*/
|
|
39
|
+
components: {
|
|
40
|
+
type: Object,
|
|
41
|
+
default: () => ({})
|
|
42
|
+
},
|
|
43
|
+
data: {
|
|
44
|
+
type: Object,
|
|
45
|
+
default: () => ({})
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
const debug = import.meta.dev || useContentPreview().isEnabled();
|
|
49
|
+
const body = computed(() => {
|
|
50
|
+
let body2 = props.value.body || props.value;
|
|
51
|
+
if (props.excerpt && props.value.excerpt) {
|
|
52
|
+
body2 = props.value.excerpt;
|
|
53
|
+
}
|
|
54
|
+
return body2;
|
|
55
|
+
});
|
|
56
|
+
const data = computed(() => {
|
|
57
|
+
const { body: body2, excerpt, ...data2 } = props.value;
|
|
58
|
+
return {
|
|
59
|
+
...data2,
|
|
60
|
+
...props.data
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
const mdcComponents = computed(() => {
|
|
64
|
+
return {
|
|
65
|
+
...props.components,
|
|
66
|
+
...data.value._components || {}
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
</script>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
/**
|
|
3
|
+
* Content to render
|
|
4
|
+
*/
|
|
5
|
+
value: {
|
|
6
|
+
type: ObjectConstructor;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Render only the excerpt
|
|
11
|
+
*/
|
|
12
|
+
excerpt: {
|
|
13
|
+
type: BooleanConstructor;
|
|
14
|
+
default: boolean;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Root tag to use for rendering
|
|
18
|
+
*/
|
|
19
|
+
tag: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The map of custom components to use for rendering.
|
|
25
|
+
*/
|
|
26
|
+
components: {
|
|
27
|
+
type: ObjectConstructor;
|
|
28
|
+
default: () => {};
|
|
29
|
+
};
|
|
30
|
+
data: {
|
|
31
|
+
type: ObjectConstructor;
|
|
32
|
+
default: () => {};
|
|
33
|
+
};
|
|
34
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
35
|
+
/**
|
|
36
|
+
* Content to render
|
|
37
|
+
*/
|
|
38
|
+
value: {
|
|
39
|
+
type: ObjectConstructor;
|
|
40
|
+
required: true;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Render only the excerpt
|
|
44
|
+
*/
|
|
45
|
+
excerpt: {
|
|
46
|
+
type: BooleanConstructor;
|
|
47
|
+
default: boolean;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Root tag to use for rendering
|
|
51
|
+
*/
|
|
52
|
+
tag: {
|
|
53
|
+
type: StringConstructor;
|
|
54
|
+
default: string;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* The map of custom components to use for rendering.
|
|
58
|
+
*/
|
|
59
|
+
components: {
|
|
60
|
+
type: ObjectConstructor;
|
|
61
|
+
default: () => {};
|
|
62
|
+
};
|
|
63
|
+
data: {
|
|
64
|
+
type: ObjectConstructor;
|
|
65
|
+
default: () => {};
|
|
66
|
+
};
|
|
67
|
+
}>> & Readonly<{}>, {
|
|
68
|
+
data: Record<string, any>;
|
|
69
|
+
tag: string;
|
|
70
|
+
excerpt: boolean;
|
|
71
|
+
components: Record<string, any>;
|
|
72
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
73
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent, h, resolveComponent } from "vue";
|
|
3
|
+
export default defineComponent({
|
|
4
|
+
props: {
|
|
5
|
+
/**
|
|
6
|
+
* A slot name or function
|
|
7
|
+
*/
|
|
8
|
+
use: {
|
|
9
|
+
type: Function,
|
|
10
|
+
default: void 0
|
|
11
|
+
},
|
|
12
|
+
/**
|
|
13
|
+
* Tags to unwrap separated by spaces
|
|
14
|
+
* Example: 'ul li'
|
|
15
|
+
*/
|
|
16
|
+
unwrap: {
|
|
17
|
+
type: [Boolean, String],
|
|
18
|
+
default: false
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
render(props) {
|
|
22
|
+
return h(resolveComponent("MDCSlot"), props);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
/**
|
|
3
|
+
* A slot name or function
|
|
4
|
+
*/
|
|
5
|
+
use: {
|
|
6
|
+
type: FunctionConstructor;
|
|
7
|
+
default: undefined;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Tags to unwrap separated by spaces
|
|
11
|
+
* Example: 'ul li'
|
|
12
|
+
*/
|
|
13
|
+
unwrap: {
|
|
14
|
+
type: (BooleanConstructor | StringConstructor)[];
|
|
15
|
+
default: boolean;
|
|
16
|
+
};
|
|
17
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
18
|
+
/**
|
|
19
|
+
* A slot name or function
|
|
20
|
+
*/
|
|
21
|
+
use: {
|
|
22
|
+
type: FunctionConstructor;
|
|
23
|
+
default: undefined;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Tags to unwrap separated by spaces
|
|
27
|
+
* Example: 'ul li'
|
|
28
|
+
*/
|
|
29
|
+
unwrap: {
|
|
30
|
+
type: (BooleanConstructor | StringConstructor)[];
|
|
31
|
+
default: boolean;
|
|
32
|
+
};
|
|
33
|
+
}>> & Readonly<{}>, {
|
|
34
|
+
unwrap: string | boolean;
|
|
35
|
+
use: Function;
|
|
36
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
37
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent, h } from "vue";
|
|
3
|
+
export default defineComponent({
|
|
4
|
+
name: "DocumentDrivenEmpty",
|
|
5
|
+
props: {
|
|
6
|
+
value: {
|
|
7
|
+
type: Object,
|
|
8
|
+
required: true
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
render({ value }) {
|
|
12
|
+
return h("div", void 0, [
|
|
13
|
+
h("p", "Document is empty"),
|
|
14
|
+
h("p", `Add content to it by opening ${value._source}/${value._file} file.`)
|
|
15
|
+
]);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
</script>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
import type { ParsedContent } from '@nuxt/content';
|
|
3
|
+
/**
|
|
4
|
+
* Used in `src/runtime/pages/document-driven.vue`
|
|
5
|
+
*/
|
|
6
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
7
|
+
value: {
|
|
8
|
+
type: PropType<ParsedContent>;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
12
|
+
value: {
|
|
13
|
+
type: PropType<ParsedContent>;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Used in `src/runtime/pages/document-driven.vue`
|
|
3
|
+
*/
|
|
4
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import ContentSlot from "./ContentSlot.vue";
|
|
3
|
+
import { defineComponent, getCurrentInstance, useSlots, computed } from "#imports";
|
|
4
|
+
let showDeprecatedMessage = true;
|
|
5
|
+
export default defineComponent({
|
|
6
|
+
name: "Markdown",
|
|
7
|
+
extends: ContentSlot,
|
|
8
|
+
setup(props) {
|
|
9
|
+
if (import.meta.dev && showDeprecatedMessage) {
|
|
10
|
+
console.warn("[deprecation] <Markdown> component is deprecated. Please use <ContentSlot> instead.");
|
|
11
|
+
showDeprecatedMessage = false;
|
|
12
|
+
}
|
|
13
|
+
const { parent } = getCurrentInstance();
|
|
14
|
+
const { between, default: fallbackSlot } = useSlots();
|
|
15
|
+
const tags = computed(() => {
|
|
16
|
+
if (typeof props.unwrap === "string") {
|
|
17
|
+
return props.unwrap.split(" ");
|
|
18
|
+
}
|
|
19
|
+
return ["*"];
|
|
20
|
+
});
|
|
21
|
+
return {
|
|
22
|
+
fallbackSlot,
|
|
23
|
+
tags,
|
|
24
|
+
between,
|
|
25
|
+
parent
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
</script>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Markdown component
|
|
3
|
+
*/
|
|
4
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
5
|
+
fallbackSlot: import("vue").Slot<any> | undefined;
|
|
6
|
+
tags: import("vue").ComputedRef<string[]>;
|
|
7
|
+
between: import("vue").Slot<any> | undefined;
|
|
8
|
+
parent: import("vue").ComponentInternalInstance | null;
|
|
9
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
10
|
+
use: {
|
|
11
|
+
type: FunctionConstructor;
|
|
12
|
+
default: undefined;
|
|
13
|
+
};
|
|
14
|
+
unwrap: {
|
|
15
|
+
type: (BooleanConstructor | StringConstructor)[];
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
18
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
+
use: {
|
|
20
|
+
type: FunctionConstructor;
|
|
21
|
+
default: undefined;
|
|
22
|
+
};
|
|
23
|
+
unwrap: {
|
|
24
|
+
type: (BooleanConstructor | StringConstructor)[];
|
|
25
|
+
default: boolean;
|
|
26
|
+
};
|
|
27
|
+
}>> & Readonly<{}>, {
|
|
28
|
+
unwrap: string | boolean;
|
|
29
|
+
use: Function;
|
|
30
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<slot />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
defineProps({
|
|
7
|
+
code: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: ""
|
|
10
|
+
},
|
|
11
|
+
language: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: null
|
|
14
|
+
},
|
|
15
|
+
filename: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: null
|
|
18
|
+
},
|
|
19
|
+
highlights: {
|
|
20
|
+
type: Array,
|
|
21
|
+
default: () => []
|
|
22
|
+
},
|
|
23
|
+
meta: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: null
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<style>
|
|
31
|
+
pre code .line{display:block;min-height:1rem}
|
|
32
|
+
</style>
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
2
|
+
declare var __VLS_1: {};
|
|
3
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
4
|
+
default?: (props: typeof __VLS_1) => any;
|
|
5
|
+
}>;
|
|
6
|
+
declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
7
|
+
code: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
language: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
default: null;
|
|
14
|
+
};
|
|
15
|
+
filename: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: null;
|
|
18
|
+
};
|
|
19
|
+
highlights: {
|
|
20
|
+
type: () => number[];
|
|
21
|
+
default: () => never[];
|
|
22
|
+
};
|
|
23
|
+
meta: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: null;
|
|
26
|
+
};
|
|
27
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
28
|
+
code: {
|
|
29
|
+
type: StringConstructor;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
32
|
+
language: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
default: null;
|
|
35
|
+
};
|
|
36
|
+
filename: {
|
|
37
|
+
type: StringConstructor;
|
|
38
|
+
default: null;
|
|
39
|
+
};
|
|
40
|
+
highlights: {
|
|
41
|
+
type: () => number[];
|
|
42
|
+
default: () => never[];
|
|
43
|
+
};
|
|
44
|
+
meta: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
default: null;
|
|
47
|
+
};
|
|
48
|
+
}>> & Readonly<{}>, {
|
|
49
|
+
meta: string;
|
|
50
|
+
code: string;
|
|
51
|
+
language: string;
|
|
52
|
+
filename: string;
|
|
53
|
+
highlights: number[];
|
|
54
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
55
|
+
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
56
|
+
code: {
|
|
57
|
+
type: StringConstructor;
|
|
58
|
+
default: string;
|
|
59
|
+
};
|
|
60
|
+
language: {
|
|
61
|
+
type: StringConstructor;
|
|
62
|
+
default: null;
|
|
63
|
+
};
|
|
64
|
+
filename: {
|
|
65
|
+
type: StringConstructor;
|
|
66
|
+
default: null;
|
|
67
|
+
};
|
|
68
|
+
highlights: {
|
|
69
|
+
type: () => number[];
|
|
70
|
+
default: () => never[];
|
|
71
|
+
};
|
|
72
|
+
meta: {
|
|
73
|
+
type: StringConstructor;
|
|
74
|
+
default: null;
|
|
75
|
+
};
|
|
76
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
77
|
+
code: {
|
|
78
|
+
type: StringConstructor;
|
|
79
|
+
default: string;
|
|
80
|
+
};
|
|
81
|
+
language: {
|
|
82
|
+
type: StringConstructor;
|
|
83
|
+
default: null;
|
|
84
|
+
};
|
|
85
|
+
filename: {
|
|
86
|
+
type: StringConstructor;
|
|
87
|
+
default: null;
|
|
88
|
+
};
|
|
89
|
+
highlights: {
|
|
90
|
+
type: () => number[];
|
|
91
|
+
default: () => never[];
|
|
92
|
+
};
|
|
93
|
+
meta: {
|
|
94
|
+
type: StringConstructor;
|
|
95
|
+
default: null;
|
|
96
|
+
};
|
|
97
|
+
}>> & Readonly<{}>, {
|
|
98
|
+
meta: string;
|
|
99
|
+
code: string;
|
|
100
|
+
language: string;
|
|
101
|
+
filename: string;
|
|
102
|
+
highlights: number[];
|
|
103
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
104
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
105
|
+
export default _default;
|
|
106
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
107
|
+
new (): {
|
|
108
|
+
$slots: S;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
2
|
+
declare var __VLS_1: {};
|
|
3
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
4
|
+
default?: (props: typeof __VLS_1) => any;
|
|
5
|
+
}>;
|
|
6
|
+
declare const __VLS_self: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
7
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
8
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
9
|
+
export default _default;
|
|
10
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
11
|
+
new (): {
|
|
12
|
+
$slots: S;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ProseCode :code="code" :language="language" :filename="filename" :highlights="highlights" :meta="meta">
|
|
3
|
+
<pre :class="$props.class" :style="style"><slot /></pre>
|
|
4
|
+
</ProseCode>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
defineProps({
|
|
9
|
+
code: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: ""
|
|
12
|
+
},
|
|
13
|
+
language: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: null
|
|
16
|
+
},
|
|
17
|
+
filename: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: null
|
|
20
|
+
},
|
|
21
|
+
highlights: {
|
|
22
|
+
type: Array,
|
|
23
|
+
default: () => []
|
|
24
|
+
},
|
|
25
|
+
meta: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: null
|
|
28
|
+
},
|
|
29
|
+
class: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: null
|
|
32
|
+
},
|
|
33
|
+
style: {
|
|
34
|
+
type: [String, Object],
|
|
35
|
+
default: null
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<style>
|
|
41
|
+
pre code .line{display:block;min-height:1rem}
|
|
42
|
+
</style>
|