@ox-content/vite-plugin-react 0.0.1-alpha.0 → 0.3.0-alpha.13

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,7 +1,7 @@
1
- import { PluginOption } from 'vite';
2
- import { OxContentOptions } from 'vite-plugin-ox-content';
3
- export { oxContent } from 'vite-plugin-ox-content';
1
+ import { PluginOption } from "vite";
2
+ import { OxContentOptions, oxContent } from "@ox-content/vite-plugin";
4
3
 
4
+ //#region src/types.d.ts
5
5
  type ComponentsMap = Record<string, string>;
6
6
  /**
7
7
  * Component registration options.
@@ -9,54 +9,51 @@ type ComponentsMap = Record<string, string>;
9
9
  */
10
10
  type ComponentsOption = ComponentsMap | string | string[];
11
11
  interface ReactIntegrationOptions extends OxContentOptions {
12
- /**
13
- * Components to register for use in Markdown.
14
- * Can be a map of names to paths, a glob pattern, or an array of globs.
15
- * When using glob patterns, component names are derived from file names.
16
- *
17
- * @example
18
- * ```ts
19
- * // Glob pattern (recommended)
20
- * components: './src/components/*.tsx'
21
- *
22
- * // Explicit map
23
- * components: { Counter: './src/components/Counter.tsx' }
24
- * ```
25
- */
26
- components?: ComponentsOption;
27
- jsxRuntime?: 'automatic' | 'classic';
12
+ /**
13
+ * Components to register for use in Markdown.
14
+ * Can be a map of names to paths, a glob pattern, or an array of globs.
15
+ * When using glob patterns, component names are derived from file names.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * // Glob pattern (recommended)
20
+ * components: './src/components/*.tsx'
21
+ *
22
+ * // Explicit map
23
+ * components: { Counter: './src/components/Counter.tsx' }
24
+ * ```
25
+ */
26
+ components?: ComponentsOption;
27
+ jsxRuntime?: "automatic" | "classic";
28
28
  }
29
29
  interface ResolvedReactOptions {
30
- srcDir: string;
31
- outDir: string;
32
- base: string;
33
- gfm: boolean;
34
- frontmatter: boolean;
35
- toc: boolean;
36
- tocMaxDepth: number;
37
- components: ComponentsMap;
38
- jsxRuntime: 'automatic' | 'classic';
39
- root?: string;
30
+ srcDir: string;
31
+ outDir: string;
32
+ base: string;
33
+ gfm: boolean;
34
+ frontmatter: boolean;
35
+ toc: boolean;
36
+ tocMaxDepth: number;
37
+ components: ComponentsMap;
38
+ jsxRuntime: "automatic" | "classic";
39
+ root?: string;
40
40
  }
41
41
  interface ReactTransformResult {
42
- code: string;
43
- map: null;
44
- usedComponents: string[];
45
- frontmatter: Record<string, unknown>;
42
+ code: string;
43
+ map: null;
44
+ usedComponents: string[];
45
+ frontmatter: Record<string, unknown>;
46
46
  }
47
- interface ComponentSlot {
48
- name: string;
49
- props: Record<string, unknown>;
50
- position: number;
51
- id: string;
47
+ interface ComponentIsland {
48
+ name: string;
49
+ props: Record<string, unknown>;
50
+ position: number;
51
+ id: string;
52
+ content?: string;
52
53
  }
53
-
54
- /**
55
- * Vite Plugin for Ox Content React Integration
56
- *
57
- * Uses Vite's Environment API to enable embedding React components in Markdown.
58
- */
59
-
54
+ //# sourceMappingURL=types.d.ts.map
55
+ //#endregion
56
+ //#region src/index.d.ts
60
57
  /**
61
58
  * Creates the Ox Content React integration plugin.
62
59
  *
@@ -81,5 +78,6 @@ interface ComponentSlot {
81
78
  * ```
82
79
  */
83
80
  declare function oxContentReact(options?: ReactIntegrationOptions): PluginOption[];
84
-
85
- export { type ComponentSlot, type ComponentsMap, type ComponentsOption, type ReactIntegrationOptions, type ReactTransformResult, type ResolvedReactOptions, oxContentReact };
81
+ //#endregion
82
+ export { type ComponentIsland, type ComponentsMap, type ComponentsOption, type ReactIntegrationOptions, type ReactTransformResult, type ResolvedReactOptions, oxContent, oxContentReact };
83
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/index.ts"],"sourcesContent":[],"mappings":";;;;KAEY,aAAA,GAAgB;;;AAA5B;AAMA;AAEiB,KAFL,gBAAA,GAAmB,aAEU,GAAA,MAAA,GAAA,MAAA,EAAA;AAAA,UAAxB,uBAAA,SAAgC,gBAAR,CAAA;;;;AAmBzC;AAaA;AAOA;;;;ACEA;;;;;eD1Be;;;UAIE,oBAAA;;;;;;;;cAQH;;;;UAKG,oBAAA;;;;eAIF;;UAGE,eAAA;;SAER;;;;;;;;;;;AAtBT;AAaA;AAOA;;;;ACEA;;;;;;;;;;;;;;iBAAgB,cAAA,WAAwB,0BAA+B"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { PluginOption } from 'vite';
2
- import { OxContentOptions } from 'vite-plugin-ox-content';
3
- export { oxContent } from 'vite-plugin-ox-content';
1
+ import { OxContentOptions, oxContent } from "@ox-content/vite-plugin";
2
+ import { PluginOption } from "vite";
4
3
 
4
+ //#region src/types.d.ts
5
5
  type ComponentsMap = Record<string, string>;
6
6
  /**
7
7
  * Component registration options.
@@ -9,54 +9,51 @@ type ComponentsMap = Record<string, string>;
9
9
  */
10
10
  type ComponentsOption = ComponentsMap | string | string[];
11
11
  interface ReactIntegrationOptions extends OxContentOptions {
12
- /**
13
- * Components to register for use in Markdown.
14
- * Can be a map of names to paths, a glob pattern, or an array of globs.
15
- * When using glob patterns, component names are derived from file names.
16
- *
17
- * @example
18
- * ```ts
19
- * // Glob pattern (recommended)
20
- * components: './src/components/*.tsx'
21
- *
22
- * // Explicit map
23
- * components: { Counter: './src/components/Counter.tsx' }
24
- * ```
25
- */
26
- components?: ComponentsOption;
27
- jsxRuntime?: 'automatic' | 'classic';
12
+ /**
13
+ * Components to register for use in Markdown.
14
+ * Can be a map of names to paths, a glob pattern, or an array of globs.
15
+ * When using glob patterns, component names are derived from file names.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * // Glob pattern (recommended)
20
+ * components: './src/components/*.tsx'
21
+ *
22
+ * // Explicit map
23
+ * components: { Counter: './src/components/Counter.tsx' }
24
+ * ```
25
+ */
26
+ components?: ComponentsOption;
27
+ jsxRuntime?: "automatic" | "classic";
28
28
  }
29
29
  interface ResolvedReactOptions {
30
- srcDir: string;
31
- outDir: string;
32
- base: string;
33
- gfm: boolean;
34
- frontmatter: boolean;
35
- toc: boolean;
36
- tocMaxDepth: number;
37
- components: ComponentsMap;
38
- jsxRuntime: 'automatic' | 'classic';
39
- root?: string;
30
+ srcDir: string;
31
+ outDir: string;
32
+ base: string;
33
+ gfm: boolean;
34
+ frontmatter: boolean;
35
+ toc: boolean;
36
+ tocMaxDepth: number;
37
+ components: ComponentsMap;
38
+ jsxRuntime: "automatic" | "classic";
39
+ root?: string;
40
40
  }
41
41
  interface ReactTransformResult {
42
- code: string;
43
- map: null;
44
- usedComponents: string[];
45
- frontmatter: Record<string, unknown>;
42
+ code: string;
43
+ map: null;
44
+ usedComponents: string[];
45
+ frontmatter: Record<string, unknown>;
46
46
  }
47
- interface ComponentSlot {
48
- name: string;
49
- props: Record<string, unknown>;
50
- position: number;
51
- id: string;
47
+ interface ComponentIsland {
48
+ name: string;
49
+ props: Record<string, unknown>;
50
+ position: number;
51
+ id: string;
52
+ content?: string;
52
53
  }
53
-
54
- /**
55
- * Vite Plugin for Ox Content React Integration
56
- *
57
- * Uses Vite's Environment API to enable embedding React components in Markdown.
58
- */
59
-
54
+ //# sourceMappingURL=types.d.ts.map
55
+ //#endregion
56
+ //#region src/index.d.ts
60
57
  /**
61
58
  * Creates the Ox Content React integration plugin.
62
59
  *
@@ -81,5 +78,6 @@ interface ComponentSlot {
81
78
  * ```
82
79
  */
83
80
  declare function oxContentReact(options?: ReactIntegrationOptions): PluginOption[];
84
-
85
- export { type ComponentSlot, type ComponentsMap, type ComponentsOption, type ReactIntegrationOptions, type ReactTransformResult, type ResolvedReactOptions, oxContentReact };
81
+ //#endregion
82
+ export { type ComponentIsland, type ComponentsMap, type ComponentsOption, type ReactIntegrationOptions, type ReactTransformResult, type ResolvedReactOptions, oxContent, oxContentReact };
83
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/index.ts"],"sourcesContent":[],"mappings":";;;;KAEY,aAAA,GAAgB;;;AAA5B;AAMA;AAEiB,KAFL,gBAAA,GAAmB,aAEU,GAAA,MAAA,GAAA,MAAA,EAAA;AAAA,UAAxB,uBAAA,SAAgC,gBAAR,CAAA;;;;AAmBzC;AAaA;AAOA;;;;ACEA;;;;;eD1Be;;;UAIE,oBAAA;;;;;;;;cAQH;;;;UAKG,oBAAA;;;;eAIF;;UAGE,eAAA;;SAER;;;;;;;;;;;AAtBT;AAaA;AAOA;;;;ACEA;;;;;;;;;;;;;;iBAAgB,cAAA,WAAwB,0BAA+B"}