@ox-content/vite-plugin-svelte 3.0.0-alpha.1 → 3.0.0-alpha.11
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.cjs +542 -59
- package/dist/index.d.cts +37 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +37 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +538 -61
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PluginOption } from "vite";
|
|
2
|
-
import { OxContentOptions, oxContent } from "@ox-content/vite-plugin";
|
|
2
|
+
import { HeadInput, OxContentOptions, RenderIslandFn, RenderedHead, oxContent, renderHead } from "@ox-content/vite-plugin";
|
|
3
3
|
//#region src/types.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Code annotation options for the Svelte integration.
|
|
@@ -31,6 +31,14 @@ type ComponentsMap = Record<string, string>;
|
|
|
31
31
|
* `configResolved`.
|
|
32
32
|
*/
|
|
33
33
|
type ComponentsOption = ComponentsMap | string | string[];
|
|
34
|
+
/**
|
|
35
|
+
* Opt-in build-time props for MDX documents imported as Svelte components.
|
|
36
|
+
*
|
|
37
|
+
* Keep this disabled for static content documents. Enable it when a custom
|
|
38
|
+
* `ssg: false` host renders `.mdx` files as page templates and passes data
|
|
39
|
+
* through Svelte component props during SSR.
|
|
40
|
+
*/
|
|
41
|
+
type MdxDocumentPropsOption = boolean;
|
|
34
42
|
/**
|
|
35
43
|
* Svelte integration plugin options.
|
|
36
44
|
*
|
|
@@ -91,6 +99,25 @@ interface SvelteIntegrationOptions extends OxContentOptions {
|
|
|
91
99
|
* @default { github: true, openGraph: true }
|
|
92
100
|
*/
|
|
93
101
|
embeds?: BuiltinEmbedOptions | false;
|
|
102
|
+
/**
|
|
103
|
+
* Optional adapter hook that replaces island inner HTML at transform time.
|
|
104
|
+
* The fourth argument receives the original slot HTML, when present.
|
|
105
|
+
* The core renderer stays framework-neutral; do not import a framework SSR
|
|
106
|
+
* runtime from `@ox-content/vite-plugin`.
|
|
107
|
+
*/
|
|
108
|
+
renderIsland?: RenderIslandFn;
|
|
109
|
+
/**
|
|
110
|
+
* Resolve MDX text expressions and component expression props from Svelte
|
|
111
|
+
* component props at render time.
|
|
112
|
+
*
|
|
113
|
+
* This is off by default so normal `.mdx` documents keep their static,
|
|
114
|
+
* no-evaluation output. When enabled, only identifiers and dotted property
|
|
115
|
+
* paths are accepted, for example `{title}` and `items={posts}`. Missing
|
|
116
|
+
* props throw a deterministic SSR error.
|
|
117
|
+
*
|
|
118
|
+
* @default false
|
|
119
|
+
*/
|
|
120
|
+
mdxDocumentProps?: MdxDocumentPropsOption;
|
|
94
121
|
}
|
|
95
122
|
/**
|
|
96
123
|
* Fetch options for Svelte GitHub embeds.
|
|
@@ -180,7 +207,11 @@ interface ResolvedSvelteOptions {
|
|
|
180
207
|
components: ComponentsMap;
|
|
181
208
|
runes: boolean;
|
|
182
209
|
embeds: ResolvedBuiltinEmbedOptions;
|
|
210
|
+
mdx?: boolean;
|
|
183
211
|
root?: string;
|
|
212
|
+
renderIsland?: RenderIslandFn;
|
|
213
|
+
mdxDocumentProps: boolean;
|
|
214
|
+
ssr?: boolean;
|
|
184
215
|
}
|
|
185
216
|
interface SvelteTransformResult {
|
|
186
217
|
code: string;
|
|
@@ -200,6 +231,10 @@ interface ComponentIsland {
|
|
|
200
231
|
/**
|
|
201
232
|
* Creates the Ox Content Svelte integration plugin.
|
|
202
233
|
*
|
|
234
|
+
* Forwards core options such as `ssg`, `redirects`, `feeds`, and `siteMaps`.
|
|
235
|
+
* The Svelte Markdown transform and environments replace the generic core
|
|
236
|
+
* transform/`markdown` environment; other build plugins are kept.
|
|
237
|
+
*
|
|
203
238
|
* @example
|
|
204
239
|
* ```ts
|
|
205
240
|
* // vite.config.ts
|
|
@@ -222,5 +257,5 @@ interface ComponentIsland {
|
|
|
222
257
|
*/
|
|
223
258
|
declare function oxContentSvelte(options?: SvelteIntegrationOptions): PluginOption[];
|
|
224
259
|
//#endregion
|
|
225
|
-
export { type BuiltinEmbedOptions, type ComponentIsland, type ComponentsMap, type ComponentsOption, type GitHubEmbedOptions, type OpenGraphEmbedOptions, type ResolvedBuiltinEmbedOptions, type ResolvedSvelteOptions, type SvelteIntegrationOptions, type SvelteTransformResult, oxContent, oxContentSvelte };
|
|
260
|
+
export { type BuiltinEmbedOptions, type ComponentIsland, type ComponentsMap, type ComponentsOption, type GitHubEmbedOptions, type HeadInput, type MdxDocumentPropsOption, type OpenGraphEmbedOptions, type RenderedHead, type ResolvedBuiltinEmbedOptions, type ResolvedSvelteOptions, type SvelteIntegrationOptions, type SvelteTransformResult, oxContent, oxContentSvelte, renderHead };
|
|
226
261
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/index.ts"],"mappings":";;;;;;;;;UAQiB;;;;;;EAMf;;UAGe;EACf;EACA;;;;;KAMU,gBAAgB;;;;;;;;KAShB,mBAAmB;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/index.ts"],"mappings":";;;;;;;;;UAQiB;;;;;;EAMf;;UAGe;EACf;EACA;;;;;KAMU,gBAAgB;;;;;;;;KAShB,mBAAmB;;;;;;;;KASnB;;;;;;;;UASK,iCAAiC;;;;;;;;EAQhD;;;;;;;;;;;;;;;;;;EAmBA,aAAa;;;;;;;;EASb,4BAA4B;;;;;;;;;EAU5B;;;;;;;;;EAUA,SAAS;;;;;;;EAQT,eAAe;;;;;;;;;;;;EAaf,mBAAmB;;;;;UAMJ;;;;;EAKf;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;UAMe;;;;;EAKf;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;UAMe;;;;;EAKf,mBAAmB;;;;;EAMnB,sBAAsB;;UAGP;EACf,QAAQ;EACR,WAAW;;UAGI;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,iBAAiB;EACjB,YAAY;EACZ;EACA,QAAQ;EACR;EACA;EACA,eAAe;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA,aAAa;;UAGE;EACf;EACA,OAAO;EACP;EACA;EACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBC3Jc,gBAAgB,UAAS,2BAAgC"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OxContentOptions, oxContent } from "@ox-content/vite-plugin";
|
|
1
|
+
import { HeadInput, OxContentOptions, RenderIslandFn, RenderedHead, oxContent, renderHead } from "@ox-content/vite-plugin";
|
|
2
2
|
import { PluginOption } from "vite";
|
|
3
3
|
//#region src/types.d.ts
|
|
4
4
|
/**
|
|
@@ -31,6 +31,14 @@ type ComponentsMap = Record<string, string>;
|
|
|
31
31
|
* `configResolved`.
|
|
32
32
|
*/
|
|
33
33
|
type ComponentsOption = ComponentsMap | string | string[];
|
|
34
|
+
/**
|
|
35
|
+
* Opt-in build-time props for MDX documents imported as Svelte components.
|
|
36
|
+
*
|
|
37
|
+
* Keep this disabled for static content documents. Enable it when a custom
|
|
38
|
+
* `ssg: false` host renders `.mdx` files as page templates and passes data
|
|
39
|
+
* through Svelte component props during SSR.
|
|
40
|
+
*/
|
|
41
|
+
type MdxDocumentPropsOption = boolean;
|
|
34
42
|
/**
|
|
35
43
|
* Svelte integration plugin options.
|
|
36
44
|
*
|
|
@@ -91,6 +99,25 @@ interface SvelteIntegrationOptions extends OxContentOptions {
|
|
|
91
99
|
* @default { github: true, openGraph: true }
|
|
92
100
|
*/
|
|
93
101
|
embeds?: BuiltinEmbedOptions | false;
|
|
102
|
+
/**
|
|
103
|
+
* Optional adapter hook that replaces island inner HTML at transform time.
|
|
104
|
+
* The fourth argument receives the original slot HTML, when present.
|
|
105
|
+
* The core renderer stays framework-neutral; do not import a framework SSR
|
|
106
|
+
* runtime from `@ox-content/vite-plugin`.
|
|
107
|
+
*/
|
|
108
|
+
renderIsland?: RenderIslandFn;
|
|
109
|
+
/**
|
|
110
|
+
* Resolve MDX text expressions and component expression props from Svelte
|
|
111
|
+
* component props at render time.
|
|
112
|
+
*
|
|
113
|
+
* This is off by default so normal `.mdx` documents keep their static,
|
|
114
|
+
* no-evaluation output. When enabled, only identifiers and dotted property
|
|
115
|
+
* paths are accepted, for example `{title}` and `items={posts}`. Missing
|
|
116
|
+
* props throw a deterministic SSR error.
|
|
117
|
+
*
|
|
118
|
+
* @default false
|
|
119
|
+
*/
|
|
120
|
+
mdxDocumentProps?: MdxDocumentPropsOption;
|
|
94
121
|
}
|
|
95
122
|
/**
|
|
96
123
|
* Fetch options for Svelte GitHub embeds.
|
|
@@ -180,7 +207,11 @@ interface ResolvedSvelteOptions {
|
|
|
180
207
|
components: ComponentsMap;
|
|
181
208
|
runes: boolean;
|
|
182
209
|
embeds: ResolvedBuiltinEmbedOptions;
|
|
210
|
+
mdx?: boolean;
|
|
183
211
|
root?: string;
|
|
212
|
+
renderIsland?: RenderIslandFn;
|
|
213
|
+
mdxDocumentProps: boolean;
|
|
214
|
+
ssr?: boolean;
|
|
184
215
|
}
|
|
185
216
|
interface SvelteTransformResult {
|
|
186
217
|
code: string;
|
|
@@ -200,6 +231,10 @@ interface ComponentIsland {
|
|
|
200
231
|
/**
|
|
201
232
|
* Creates the Ox Content Svelte integration plugin.
|
|
202
233
|
*
|
|
234
|
+
* Forwards core options such as `ssg`, `redirects`, `feeds`, and `siteMaps`.
|
|
235
|
+
* The Svelte Markdown transform and environments replace the generic core
|
|
236
|
+
* transform/`markdown` environment; other build plugins are kept.
|
|
237
|
+
*
|
|
203
238
|
* @example
|
|
204
239
|
* ```ts
|
|
205
240
|
* // vite.config.ts
|
|
@@ -222,5 +257,5 @@ interface ComponentIsland {
|
|
|
222
257
|
*/
|
|
223
258
|
declare function oxContentSvelte(options?: SvelteIntegrationOptions): PluginOption[];
|
|
224
259
|
//#endregion
|
|
225
|
-
export { type BuiltinEmbedOptions, type ComponentIsland, type ComponentsMap, type ComponentsOption, type GitHubEmbedOptions, type OpenGraphEmbedOptions, type ResolvedBuiltinEmbedOptions, type ResolvedSvelteOptions, type SvelteIntegrationOptions, type SvelteTransformResult, oxContent, oxContentSvelte };
|
|
260
|
+
export { type BuiltinEmbedOptions, type ComponentIsland, type ComponentsMap, type ComponentsOption, type GitHubEmbedOptions, type HeadInput, type MdxDocumentPropsOption, type OpenGraphEmbedOptions, type RenderedHead, type ResolvedBuiltinEmbedOptions, type ResolvedSvelteOptions, type SvelteIntegrationOptions, type SvelteTransformResult, oxContent, oxContentSvelte, renderHead };
|
|
226
261
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/index.ts"],"mappings":";;;;;;;;;UAQiB;;;;;;EAMf;;UAGe;EACf;EACA;;;;;KAMU,gBAAgB;;;;;;;;KAShB,mBAAmB;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/index.ts"],"mappings":";;;;;;;;;UAQiB;;;;;;EAMf;;UAGe;EACf;EACA;;;;;KAMU,gBAAgB;;;;;;;;KAShB,mBAAmB;;;;;;;;KASnB;;;;;;;;UASK,iCAAiC;;;;;;;;EAQhD;;;;;;;;;;;;;;;;;;EAmBA,aAAa;;;;;;;;EASb,4BAA4B;;;;;;;;;EAU5B;;;;;;;;;EAUA,SAAS;;;;;;;EAQT,eAAe;;;;;;;;;;;;EAaf,mBAAmB;;;;;UAMJ;;;;;EAKf;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;UAMe;;;;;EAKf;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;UAMe;;;;;EAKf,mBAAmB;;;;;EAMnB,sBAAsB;;UAGP;EACf,QAAQ;EACR,WAAW;;UAGI;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,iBAAiB;EACjB,YAAY;EACZ;EACA,QAAQ;EACR;EACA;EACA,eAAe;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA,aAAa;;UAGE;EACf;EACA,OAAO;EACP;EACA;EACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBC3Jc,gBAAgB,UAAS,2BAAgC"}
|