@slidev/types 51.4.0 → 51.5.0
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/index.d.mts +32 -2
- package/dist/index.mjs +3 -1
- package/package.json +7 -7
package/dist/index.d.mts
CHANGED
|
@@ -8,6 +8,7 @@ import { KatexOptions } from 'katex';
|
|
|
8
8
|
import { MermaidConfig } from 'mermaid';
|
|
9
9
|
import * as monaco from 'monaco-editor';
|
|
10
10
|
import { VitePluginConfig } from 'unocss/vite';
|
|
11
|
+
import { Plugin } from 'vite';
|
|
11
12
|
import MagicString from 'magic-string-stack';
|
|
12
13
|
import Vue from '@vitejs/plugin-vue';
|
|
13
14
|
import VueJsx from '@vitejs/plugin-vue-jsx';
|
|
@@ -180,6 +181,10 @@ interface SourceSlideInfo extends SlideInfoBase {
|
|
|
180
181
|
contentStart: number;
|
|
181
182
|
end: number;
|
|
182
183
|
raw: string;
|
|
184
|
+
/**
|
|
185
|
+
* Raw content before being processed by preparsers (if any)
|
|
186
|
+
*/
|
|
187
|
+
contentRaw: string;
|
|
183
188
|
/**
|
|
184
189
|
* Slides import by this slide.
|
|
185
190
|
*/
|
|
@@ -266,6 +271,7 @@ interface SlidevPreparserExtension {
|
|
|
266
271
|
name?: string;
|
|
267
272
|
transformRawLines?: (lines: string[]) => Promise<void> | void;
|
|
268
273
|
transformSlide?: (content: string, frontmatter: any) => Promise<string | undefined>;
|
|
274
|
+
transformNote?: (note: string | undefined, frontmatter: any) => Promise<string | undefined>;
|
|
269
275
|
}
|
|
270
276
|
type PreparserExtensionLoader = (headmatter: Record<string, unknown>, filepath: string, mode?: string) => Promise<SlidevPreparserExtension[]>;
|
|
271
277
|
type RenderContext = 'none' | 'slide' | 'overview' | 'presenter' | 'previewNext';
|
|
@@ -382,7 +388,7 @@ interface HeadmatterConfig extends TransitionOptions {
|
|
|
382
388
|
*
|
|
383
389
|
* @default '16/9'
|
|
384
390
|
*/
|
|
385
|
-
aspectRatio?: number;
|
|
391
|
+
aspectRatio?: number | string;
|
|
386
392
|
/**
|
|
387
393
|
* The actual width for slides canvas.
|
|
388
394
|
* unit in px.
|
|
@@ -537,6 +543,12 @@ interface HeadmatterConfig extends TransitionOptions {
|
|
|
537
543
|
* @default []
|
|
538
544
|
*/
|
|
539
545
|
monacoRunAdditionalDeps?: string[];
|
|
546
|
+
/**
|
|
547
|
+
* Seo meta tags settings
|
|
548
|
+
*
|
|
549
|
+
* @default {}
|
|
550
|
+
*/
|
|
551
|
+
seoMeta?: SeoMeta;
|
|
540
552
|
}
|
|
541
553
|
interface Frontmatter extends TransitionOptions {
|
|
542
554
|
/**
|
|
@@ -727,11 +739,27 @@ interface TransitionGroupProps {
|
|
|
727
739
|
leaveActiveClass?: string;
|
|
728
740
|
leaveToClass?: string;
|
|
729
741
|
}
|
|
742
|
+
/**
|
|
743
|
+
* The following type should map to unhead MataFlat type
|
|
744
|
+
*/
|
|
745
|
+
interface SeoMeta {
|
|
746
|
+
ogTitle?: string;
|
|
747
|
+
ogDescription?: string;
|
|
748
|
+
ogImage?: string;
|
|
749
|
+
ogUrl?: string;
|
|
750
|
+
twitterCard?: 'summary' | 'summary_large_image' | 'app' | 'player';
|
|
751
|
+
twitterSite?: string;
|
|
752
|
+
twitterTitle?: string;
|
|
753
|
+
twitterDescription?: string;
|
|
754
|
+
twitterImage?: string;
|
|
755
|
+
twitterUrl?: string;
|
|
756
|
+
}
|
|
730
757
|
|
|
731
758
|
interface ResolvedSlidevConfigSub {
|
|
732
759
|
export: ResolvedExportOptions;
|
|
733
760
|
drawings: ResolvedDrawingsOptions;
|
|
734
761
|
fonts: ResolvedFontOptions;
|
|
762
|
+
aspectRatio: number;
|
|
735
763
|
}
|
|
736
764
|
interface SlidevConfig extends Omit<Required<HeadmatterConfig>, keyof ResolvedSlidevConfigSub>, ResolvedSlidevConfigSub {
|
|
737
765
|
}
|
|
@@ -917,6 +945,7 @@ type PreparserSetup = (context: {
|
|
|
917
945
|
headmatter: Record<string, unknown>;
|
|
918
946
|
mode?: string;
|
|
919
947
|
}) => Awaitable<SlidevPreparserExtension[]>;
|
|
948
|
+
type VitePluginsSetup = (options: ResolvedSlidevOptions) => Awaitable<Plugin[]>;
|
|
920
949
|
type MonacoSetup = (m: typeof monaco) => Awaitable<MonacoSetupReturn | void>;
|
|
921
950
|
type AppSetup = (context: AppContext) => Awaitable<void>;
|
|
922
951
|
type RootSetup = () => Awaitable<void>;
|
|
@@ -936,6 +965,7 @@ declare const defineKatexSetup: (fn: KatexSetup) => KatexSetup;
|
|
|
936
965
|
declare const defineShortcutsSetup: (fn: ShortcutsSetup) => ShortcutsSetup;
|
|
937
966
|
declare const defineTransformersSetup: (fn: TransformersSetup) => TransformersSetup;
|
|
938
967
|
declare const definePreparserSetup: (fn: PreparserSetup) => PreparserSetup;
|
|
968
|
+
declare const defineVitePluginsSetup: (fn: VitePluginsSetup) => VitePluginsSetup;
|
|
939
969
|
declare const defineCodeRunnersSetup: (fn: CodeRunnersSetup) => CodeRunnersSetup;
|
|
940
970
|
declare const defineContextMenuSetup: (fn: ContextMenuSetup) => ContextMenuSetup;
|
|
941
971
|
|
|
@@ -975,4 +1005,4 @@ declare module 'vite' {
|
|
|
975
1005
|
}
|
|
976
1006
|
}
|
|
977
1007
|
|
|
978
|
-
export { type AppContext, type AppSetup, type BuildArgs, type BuiltinSlideTransition, type ClicksContext, type ClicksElement, type ClicksInfo, type CodeRunner, type CodeRunnerContext, type CodeRunnerOutput, type CodeRunnerOutputDom, type CodeRunnerOutputError, type CodeRunnerOutputHtml, type CodeRunnerOutputText, type CodeRunnerOutputTextArray, type CodeRunnerOutputs, type CodeRunnerProviders, type CodeRunnersSetup, type CommonArgs, type ContextMenuItem, type ContextMenuSetup, type DrawingsOptions, type ExportArgs, type FontOptions, type Frontmatter, type FrontmatterStyle, type Headmatter, type HeadmatterConfig, type KatexSetup, type MarkdownTransformContext, type MarkdownTransformer, type MermaidSetup, type MonacoSetup, type MonacoSetupReturn, type NavOperations, type NormalizedAtValue, type NormalizedRangeClickValue, type NormalizedSingleClickValue, type PreparserExtensionLoader, type PreparserSetup, type RawAtValue, type RawRangeAtValue, type RawSingleAtValue, type RenderContext, type ResolvedDrawingsOptions, type ResolvedExportOptions, type ResolvedFontOptions, type ResolvedSlidevConfigSub, type ResolvedSlidevOptions, type ResolvedSlidevUtils, type RootSetup, type RootsInfo, type RoutesSetup, type ShikiContext, type ShikiSetup, type ShikiSetupReturn, type ShortcutOptions, type ShortcutsSetup, type SlideInfo, type SlideInfoBase, type SlidePatch, type SlideRoute, type SlidevConfig, type SlidevData, type SlidevDetectedFeatures, type SlidevEntryOptions, type SlidevMarkdown, type SlidevPluginOptions, type SlidevPreparserExtension, type SlidevServerOptions, type SlidevThemeConfig, type SlidevThemeMeta, type SourceSlideInfo, type TocItem, type TransformersSetup, type TransformersSetupReturn, type TransitionGroupProps, type TransitionOptions, type UnoSetup, defineAppSetup, defineCodeRunnersSetup, defineContextMenuSetup, defineKatexSetup, defineMermaidSetup, defineMonacoSetup, definePreparserSetup, defineRootSetup, defineRoutesSetup, defineShikiSetup, defineShortcutsSetup, defineTransformersSetup, defineUnoSetup };
|
|
1008
|
+
export { type AppContext, type AppSetup, type BuildArgs, type BuiltinSlideTransition, type ClicksContext, type ClicksElement, type ClicksInfo, type CodeRunner, type CodeRunnerContext, type CodeRunnerOutput, type CodeRunnerOutputDom, type CodeRunnerOutputError, type CodeRunnerOutputHtml, type CodeRunnerOutputText, type CodeRunnerOutputTextArray, type CodeRunnerOutputs, type CodeRunnerProviders, type CodeRunnersSetup, type CommonArgs, type ContextMenuItem, type ContextMenuSetup, type DrawingsOptions, type ExportArgs, type FontOptions, type Frontmatter, type FrontmatterStyle, type Headmatter, type HeadmatterConfig, type KatexSetup, type MarkdownTransformContext, type MarkdownTransformer, type MermaidSetup, type MonacoSetup, type MonacoSetupReturn, type NavOperations, type NormalizedAtValue, type NormalizedRangeClickValue, type NormalizedSingleClickValue, type PreparserExtensionLoader, type PreparserSetup, type RawAtValue, type RawRangeAtValue, type RawSingleAtValue, type RenderContext, type ResolvedDrawingsOptions, type ResolvedExportOptions, type ResolvedFontOptions, type ResolvedSlidevConfigSub, type ResolvedSlidevOptions, type ResolvedSlidevUtils, type RootSetup, type RootsInfo, type RoutesSetup, type SeoMeta, type ShikiContext, type ShikiSetup, type ShikiSetupReturn, type ShortcutOptions, type ShortcutsSetup, type SlideInfo, type SlideInfoBase, type SlidePatch, type SlideRoute, type SlidevConfig, type SlidevData, type SlidevDetectedFeatures, type SlidevEntryOptions, type SlidevMarkdown, type SlidevPluginOptions, type SlidevPreparserExtension, type SlidevServerOptions, type SlidevThemeConfig, type SlidevThemeMeta, type SourceSlideInfo, type TocItem, type TransformersSetup, type TransformersSetupReturn, type TransitionGroupProps, type TransitionOptions, type UnoSetup, type VitePluginsSetup, defineAppSetup, defineCodeRunnersSetup, defineContextMenuSetup, defineKatexSetup, defineMermaidSetup, defineMonacoSetup, definePreparserSetup, defineRootSetup, defineRoutesSetup, defineShikiSetup, defineShortcutsSetup, defineTransformersSetup, defineUnoSetup, defineVitePluginsSetup };
|
package/dist/index.mjs
CHANGED
|
@@ -13,6 +13,7 @@ var defineKatexSetup = defineSetup;
|
|
|
13
13
|
var defineShortcutsSetup = defineSetup;
|
|
14
14
|
var defineTransformersSetup = defineSetup;
|
|
15
15
|
var definePreparserSetup = defineSetup;
|
|
16
|
+
var defineVitePluginsSetup = defineSetup;
|
|
16
17
|
var defineCodeRunnersSetup = defineSetup;
|
|
17
18
|
var defineContextMenuSetup = defineSetup;
|
|
18
19
|
export {
|
|
@@ -28,5 +29,6 @@ export {
|
|
|
28
29
|
defineShikiSetup,
|
|
29
30
|
defineShortcutsSetup,
|
|
30
31
|
defineTransformersSetup,
|
|
31
|
-
defineUnoSetup
|
|
32
|
+
defineUnoSetup,
|
|
33
|
+
defineVitePluginsSetup
|
|
32
34
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/types",
|
|
3
|
-
"version": "51.
|
|
3
|
+
"version": "51.5.0",
|
|
4
4
|
"description": "Shared types declarations for Slidev",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,18 +24,18 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@antfu/utils": "^9.1.0",
|
|
27
|
-
"@shikijs/markdown-it": "^3.1
|
|
28
|
-
"@vitejs/plugin-vue": "^5.2.
|
|
29
|
-
"@vitejs/plugin-vue-jsx": "^4.1.
|
|
27
|
+
"@shikijs/markdown-it": "^3.2.1",
|
|
28
|
+
"@vitejs/plugin-vue": "^5.2.3",
|
|
29
|
+
"@vitejs/plugin-vue-jsx": "^4.1.2",
|
|
30
30
|
"katex": "^0.16.21",
|
|
31
|
-
"mermaid": "^11.
|
|
31
|
+
"mermaid": "^11.6.0",
|
|
32
32
|
"monaco-editor": "0.51.0",
|
|
33
|
-
"shiki": "^3.1
|
|
33
|
+
"shiki": "^3.2.1",
|
|
34
34
|
"unocss": "^66.0.0",
|
|
35
35
|
"unplugin-icons": "^22.1.0",
|
|
36
36
|
"unplugin-vue-markdown": "^28.3.1",
|
|
37
37
|
"vite-plugin-inspect": "^11.0.0",
|
|
38
|
-
"vite-plugin-remote-assets": "^
|
|
38
|
+
"vite-plugin-remote-assets": "^2.0.0",
|
|
39
39
|
"vite-plugin-static-copy": "^2.3.0",
|
|
40
40
|
"vite-plugin-vue-server-ref": "^1.0.0",
|
|
41
41
|
"vue": "^3.5.13",
|