@ox-content/vite-plugin-svelte 2.90.0 → 3.0.0-alpha.10

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.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,24 @@ 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 core renderer stays framework-neutral; do not import a framework SSR
105
+ * runtime from `@ox-content/vite-plugin`.
106
+ */
107
+ renderIsland?: RenderIslandFn;
108
+ /**
109
+ * Resolve MDX text expressions and component expression props from Svelte
110
+ * component props at render time.
111
+ *
112
+ * This is off by default so normal `.mdx` documents keep their static,
113
+ * no-evaluation output. When enabled, only identifiers and dotted property
114
+ * paths are accepted, for example `{title}` and `items={posts}`. Missing
115
+ * props throw a deterministic SSR error.
116
+ *
117
+ * @default false
118
+ */
119
+ mdxDocumentProps?: MdxDocumentPropsOption;
94
120
  }
95
121
  /**
96
122
  * Fetch options for Svelte GitHub embeds.
@@ -180,7 +206,11 @@ interface ResolvedSvelteOptions {
180
206
  components: ComponentsMap;
181
207
  runes: boolean;
182
208
  embeds: ResolvedBuiltinEmbedOptions;
209
+ mdx?: boolean;
183
210
  root?: string;
211
+ renderIsland?: RenderIslandFn;
212
+ mdxDocumentProps: boolean;
213
+ ssr?: boolean;
184
214
  }
185
215
  interface SvelteTransformResult {
186
216
  code: string;
@@ -200,6 +230,10 @@ interface ComponentIsland {
200
230
  /**
201
231
  * Creates the Ox Content Svelte integration plugin.
202
232
  *
233
+ * Forwards core options such as `ssg`, `redirects`, `feeds`, and `siteMaps`.
234
+ * The Svelte Markdown transform and environments replace the generic core
235
+ * transform/`markdown` environment; other build plugins are kept.
236
+ *
203
237
  * @example
204
238
  * ```ts
205
239
  * // vite.config.ts
@@ -222,5 +256,5 @@ interface ComponentIsland {
222
256
  */
223
257
  declare function oxContentSvelte(options?: SvelteIntegrationOptions): PluginOption[];
224
258
  //#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 };
259
+ 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
260
  //# sourceMappingURL=index.d.cts.map
@@ -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;;;;;;;;UASd,iCAAiC;;;;;;;;EAQhD;;;;;;;;;;;;;;;;;;EAmBA,aAAa;;;;;;;;EASb,4BAA4B;;;;;;;;;EAU5B;;;;;;;;;EAUA,SAAS;;;;;UAMM;;;;;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;;UAGe;EACf;EACA;EACA;EACA,aAAa;;UAGE;EACf;EACA,OAAO;EACP;EACA;EACA;;;;;;;;;;;;;;;;;;;;;;;;;;;iBC9Hc,gBAAgB,UAAS,2BAAgC"}
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;;;;;;EAOT,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBC1Jc,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,24 @@ 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 core renderer stays framework-neutral; do not import a framework SSR
105
+ * runtime from `@ox-content/vite-plugin`.
106
+ */
107
+ renderIsland?: RenderIslandFn;
108
+ /**
109
+ * Resolve MDX text expressions and component expression props from Svelte
110
+ * component props at render time.
111
+ *
112
+ * This is off by default so normal `.mdx` documents keep their static,
113
+ * no-evaluation output. When enabled, only identifiers and dotted property
114
+ * paths are accepted, for example `{title}` and `items={posts}`. Missing
115
+ * props throw a deterministic SSR error.
116
+ *
117
+ * @default false
118
+ */
119
+ mdxDocumentProps?: MdxDocumentPropsOption;
94
120
  }
95
121
  /**
96
122
  * Fetch options for Svelte GitHub embeds.
@@ -180,7 +206,11 @@ interface ResolvedSvelteOptions {
180
206
  components: ComponentsMap;
181
207
  runes: boolean;
182
208
  embeds: ResolvedBuiltinEmbedOptions;
209
+ mdx?: boolean;
183
210
  root?: string;
211
+ renderIsland?: RenderIslandFn;
212
+ mdxDocumentProps: boolean;
213
+ ssr?: boolean;
184
214
  }
185
215
  interface SvelteTransformResult {
186
216
  code: string;
@@ -200,6 +230,10 @@ interface ComponentIsland {
200
230
  /**
201
231
  * Creates the Ox Content Svelte integration plugin.
202
232
  *
233
+ * Forwards core options such as `ssg`, `redirects`, `feeds`, and `siteMaps`.
234
+ * The Svelte Markdown transform and environments replace the generic core
235
+ * transform/`markdown` environment; other build plugins are kept.
236
+ *
203
237
  * @example
204
238
  * ```ts
205
239
  * // vite.config.ts
@@ -222,5 +256,5 @@ interface ComponentIsland {
222
256
  */
223
257
  declare function oxContentSvelte(options?: SvelteIntegrationOptions): PluginOption[];
224
258
  //#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 };
259
+ 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
260
  //# sourceMappingURL=index.d.mts.map
@@ -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;;;;;;;;UASd,iCAAiC;;;;;;;;EAQhD;;;;;;;;;;;;;;;;;;EAmBA,aAAa;;;;;;;;EASb,4BAA4B;;;;;;;;;EAU5B;;;;;;;;;EAUA,SAAS;;;;;UAMM;;;;;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;;UAGe;EACf;EACA;EACA;EACA,aAAa;;UAGE;EACf;EACA,OAAO;EACP;EACA;EACA;;;;;;;;;;;;;;;;;;;;;;;;;;;iBC9Hc,gBAAgB,UAAS,2BAAgC"}
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;;;;;;EAOT,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBC1Jc,gBAAgB,UAAS,2BAAgC"}