@ox-content/vite-plugin-svelte 3.0.0-alpha.8 → 3.0.0-beta.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.cjs +616 -15
- package/dist/index.d.cts +28 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +28 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +616 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
package/dist/index.d.cts
CHANGED
|
@@ -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
|
*
|
|
@@ -93,10 +101,23 @@ interface SvelteIntegrationOptions extends OxContentOptions {
|
|
|
93
101
|
embeds?: BuiltinEmbedOptions | false;
|
|
94
102
|
/**
|
|
95
103
|
* Optional adapter hook that replaces island inner HTML at transform time.
|
|
104
|
+
* The fourth argument receives the original slot HTML, when present.
|
|
96
105
|
* The core renderer stays framework-neutral; do not import a framework SSR
|
|
97
106
|
* runtime from `@ox-content/vite-plugin`.
|
|
98
107
|
*/
|
|
99
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;
|
|
100
121
|
}
|
|
101
122
|
/**
|
|
102
123
|
* Fetch options for Svelte GitHub embeds.
|
|
@@ -189,6 +210,8 @@ interface ResolvedSvelteOptions {
|
|
|
189
210
|
mdx?: boolean;
|
|
190
211
|
root?: string;
|
|
191
212
|
renderIsland?: RenderIslandFn;
|
|
213
|
+
mdxDocumentProps: boolean;
|
|
214
|
+
ssr?: boolean;
|
|
192
215
|
}
|
|
193
216
|
interface SvelteTransformResult {
|
|
194
217
|
code: string;
|
|
@@ -208,6 +231,10 @@ interface ComponentIsland {
|
|
|
208
231
|
/**
|
|
209
232
|
* Creates the Ox Content Svelte integration plugin.
|
|
210
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
|
+
*
|
|
211
238
|
* @example
|
|
212
239
|
* ```ts
|
|
213
240
|
* // vite.config.ts
|
|
@@ -230,5 +257,5 @@ interface ComponentIsland {
|
|
|
230
257
|
*/
|
|
231
258
|
declare function oxContentSvelte(options?: SvelteIntegrationOptions): PluginOption[];
|
|
232
259
|
//#endregion
|
|
233
|
-
export { type BuiltinEmbedOptions, type ComponentIsland, type ComponentsMap, type ComponentsOption, type GitHubEmbedOptions, type HeadInput, type OpenGraphEmbedOptions, type RenderedHead, type ResolvedBuiltinEmbedOptions, type ResolvedSvelteOptions, type SvelteIntegrationOptions, type SvelteTransformResult, oxContent, oxContentSvelte, renderHead };
|
|
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 };
|
|
234
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
|
@@ -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
|
*
|
|
@@ -93,10 +101,23 @@ interface SvelteIntegrationOptions extends OxContentOptions {
|
|
|
93
101
|
embeds?: BuiltinEmbedOptions | false;
|
|
94
102
|
/**
|
|
95
103
|
* Optional adapter hook that replaces island inner HTML at transform time.
|
|
104
|
+
* The fourth argument receives the original slot HTML, when present.
|
|
96
105
|
* The core renderer stays framework-neutral; do not import a framework SSR
|
|
97
106
|
* runtime from `@ox-content/vite-plugin`.
|
|
98
107
|
*/
|
|
99
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;
|
|
100
121
|
}
|
|
101
122
|
/**
|
|
102
123
|
* Fetch options for Svelte GitHub embeds.
|
|
@@ -189,6 +210,8 @@ interface ResolvedSvelteOptions {
|
|
|
189
210
|
mdx?: boolean;
|
|
190
211
|
root?: string;
|
|
191
212
|
renderIsland?: RenderIslandFn;
|
|
213
|
+
mdxDocumentProps: boolean;
|
|
214
|
+
ssr?: boolean;
|
|
192
215
|
}
|
|
193
216
|
interface SvelteTransformResult {
|
|
194
217
|
code: string;
|
|
@@ -208,6 +231,10 @@ interface ComponentIsland {
|
|
|
208
231
|
/**
|
|
209
232
|
* Creates the Ox Content Svelte integration plugin.
|
|
210
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
|
+
*
|
|
211
238
|
* @example
|
|
212
239
|
* ```ts
|
|
213
240
|
* // vite.config.ts
|
|
@@ -230,5 +257,5 @@ interface ComponentIsland {
|
|
|
230
257
|
*/
|
|
231
258
|
declare function oxContentSvelte(options?: SvelteIntegrationOptions): PluginOption[];
|
|
232
259
|
//#endregion
|
|
233
|
-
export { type BuiltinEmbedOptions, type ComponentIsland, type ComponentsMap, type ComponentsOption, type GitHubEmbedOptions, type HeadInput, type OpenGraphEmbedOptions, type RenderedHead, type ResolvedBuiltinEmbedOptions, type ResolvedSvelteOptions, type SvelteIntegrationOptions, type SvelteTransformResult, oxContent, oxContentSvelte, renderHead };
|
|
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 };
|
|
234
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"}
|