@orgajs/orgx 2.4.0 → 2.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.
Files changed (44) hide show
  1. package/{dist/index.d.ts → index.d.ts} +1 -0
  2. package/index.d.ts.map +1 -0
  3. package/{dist/lib → lib}/compile.d.ts +1 -0
  4. package/lib/compile.d.ts.map +1 -0
  5. package/{dist/lib → lib}/core.d.ts +2 -1
  6. package/lib/core.d.ts.map +1 -0
  7. package/lib/core.js +41 -41
  8. package/{dist/lib → lib}/evaluate.d.ts +1 -0
  9. package/lib/evaluate.d.ts.map +1 -0
  10. package/{dist/lib → lib}/plugin/recma-build-jsx-transform.d.ts +1 -0
  11. package/lib/plugin/recma-build-jsx-transform.d.ts.map +1 -0
  12. package/{dist/lib → lib}/plugin/recma-document.d.ts +2 -1
  13. package/lib/plugin/recma-document.d.ts.map +1 -0
  14. package/{dist/lib → lib}/plugin/recma-jsx-rewrite.d.ts +1 -0
  15. package/lib/plugin/recma-jsx-rewrite.d.ts.map +1 -0
  16. package/{dist/lib → lib}/plugin/rehype-recma.d.ts +1 -0
  17. package/lib/plugin/rehype-recma.d.ts.map +1 -0
  18. package/{dist/lib → lib}/run.d.ts +1 -0
  19. package/lib/run.d.ts.map +1 -0
  20. package/{dist/lib → lib}/types.d.ts +7 -6
  21. package/lib/types.d.ts.map +1 -0
  22. package/lib/types.ts +31 -29
  23. package/{dist/lib → lib}/util/estree-util-create.d.ts +1 -0
  24. package/lib/util/estree-util-create.d.ts.map +1 -0
  25. package/{dist/lib → lib}/util/estree-util-declaration-to-expression.d.ts +1 -0
  26. package/lib/util/estree-util-declaration-to-expression.d.ts.map +1 -0
  27. package/{dist/lib → lib}/util/estree-util-is-declaration.d.ts +1 -0
  28. package/lib/util/estree-util-is-declaration.d.ts.map +1 -0
  29. package/{dist/lib → lib}/util/estree-util-specifiers-to-declarations.d.ts +1 -0
  30. package/lib/util/estree-util-specifiers-to-declarations.d.ts.map +1 -0
  31. package/{dist/lib → lib}/util/estree-util-to-binary-addition.d.ts +1 -0
  32. package/lib/util/estree-util-to-binary-addition.d.ts.map +1 -0
  33. package/{dist/lib → lib}/util/estree-util-to-id-or-member-expression.d.ts +1 -0
  34. package/lib/util/estree-util-to-id-or-member-expression.d.ts.map +1 -0
  35. package/{dist/lib → lib}/util/is-org-content.d.ts +1 -0
  36. package/lib/util/is-org-content.d.ts.map +1 -0
  37. package/{dist/lib → lib}/util/render-error.d.ts +1 -0
  38. package/lib/util/render-error.d.ts.map +1 -0
  39. package/{dist/lib → lib}/util/resolve-evaluate-options.d.ts +1 -0
  40. package/lib/util/resolve-evaluate-options.d.ts.map +1 -0
  41. package/{dist/lib → lib}/util/resolve-file-and-options.d.ts +1 -0
  42. package/lib/util/resolve-file-and-options.d.ts.map +1 -0
  43. package/package.json +12 -16
  44. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -10,3 +10,4 @@ export type OrgProps = import("./lib/types.js").OrgProps;
10
10
  export { compile, compileSync } from "./lib/compile.js";
11
11
  export { evaluate, evaluateSync } from "./lib/evaluate.js";
12
12
  export { run, runSync } from "./lib/run.js";
13
+ //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":";;+BACa,OAAO,eAAe,EAAE,gBAAgB;6BACxC,OAAO,kBAAkB,EAAE,cAAc;8BACzC,OAAO,mBAAmB,EAAE,eAAe;4BAC3C,OAAO,gBAAgB,EAAE,aAAa;yBACtC,OAAO,gBAAgB,EAAE,UAAU;wBACnC,OAAO,gBAAgB,EAAE,SAAS;uBAClC,OAAO,gBAAgB,EAAE,QAAQ"}
@@ -43,3 +43,4 @@ export type ExtraOptions = {
43
43
  * Configuration.
44
44
  */
45
45
  export type CompileOptions = CoreProcessorOptions & PluginOptions & ExtraOptions;
46
+ //# sourceMappingURL=compile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["compile.js"],"names":[],"mappings":"AAuBA;;;;;;;;;;GAUG;AACH,yCARW,eAAe,mBAGf,cAAc,GAAG,IAAI,GAAG,SAAS,GAEhC,OAAO,CAAC,KAAK,CAAC,CAMzB;AAED;;;;;;;;;;GAUG;AACH,6CARW,eAAe,mBAGf,cAAc,GAAG,IAAI,GAAG,SAAS,GAEhC,KAAK,CAMhB;oBApDY,OAAO,OAAO,EAAE,KAAK;8BACrB,OAAO,OAAO,EAAE,eAAe;4BAC/B,OAAO,WAAW,EAAE,aAAa;mCACjC,OAAO,WAAW,EAAE,oBAAoB;;;;mCAIxC,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC;;;;;;;;aAKnC,QAAQ,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS;;;;;6BAG3C,oBAAoB,GAAG,aAAa,GAAG,YAAY"}
@@ -28,7 +28,7 @@ export type BaseProcessorOptions = {
28
28
  /**
29
29
  * Whether to compile to a whole program or a function body..
30
30
  */
31
- outputFormat?: "function-body" | "program" | undefined;
31
+ outputFormat?: "function-body" | "program";
32
32
  /**
33
33
  * List of recma (esast, JavaScript) plugins.
34
34
  */
@@ -57,3 +57,4 @@ export type ProcessorOptions = BaseProcessorOptions & PluginOptions;
57
57
  import type { Program } from 'estree-jsx';
58
58
  import type { Processor } from 'unified';
59
59
  import type { PluggableList } from 'unified';
60
+ //# sourceMappingURL=core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["core.js"],"names":[],"mappings":"AA4CA;;;;;;;;;;;;GAYG;AACH,0CANW,QAAQ,CAAC,gBAAgB,CAAC,GAAG,IAAI,GAAG,SAAS,GAE5C,UAAU,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAkDjE;iCApGY,OAAO,0BAA0B,EAAE,OAAO;mCAC1C,OAAO,4BAA4B,EAAE,oBAAoB;oCACzD,OAAO,iBAAiB,EAAE,OAAO;qCACjC,OAAO,+BAA+B,EAAE,sBAAsB;;;;;;;;;UAM7D,OAAO,GAAG,IAAI,GAAG,SAAS;;;;mBAG1B,eAAe,GAAG,SAAS;;;;mBAE3B,aAAa,GAAG,IAAI,GAAG,SAAS;;;;mBAEhC,aAAa,GAAG,IAAI,GAAG,SAAS;;;;oBAEhC,aAAa,GAAG,IAAI,GAAG,SAAS;;;;yBAEhC,OAAO,sBAAsB,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS;;;;;4BAG1D,IAAI,CAAC,kBAAkB,GAAG,oBAAoB,GAAG,qBAAqB,GAAG,sBAAsB,EAAE,cAAc,CAAC;;;;+BAGhH,oBAAoB,GAAG,aAAa;6BA5BvB,YAAY;+BACK,SAAS;mCAAT,SAAS"}
package/lib/core.js CHANGED
@@ -56,49 +56,49 @@ import { recmaBuildJsxTransform } from './plugin/recma-build-jsx-transform.js'
56
56
 
57
57
  */
58
58
  export function createProcessor(options) {
59
- const {
60
- development,
61
- jsx,
62
- outputFormat,
63
- providerImportSource,
64
- recmaPlugins,
65
- rehypePlugins,
66
- reorgPlugins,
67
- reorgRehypeOptions,
68
- elementAttributeNameCase,
69
- stylePropertyNameCase,
70
- SourceMapGenerator,
71
- ...rest
72
- } = options || {}
73
- const dev = development ?? false
59
+ const {
60
+ development,
61
+ jsx,
62
+ outputFormat,
63
+ providerImportSource,
64
+ recmaPlugins,
65
+ rehypePlugins,
66
+ reorgPlugins,
67
+ reorgRehypeOptions,
68
+ elementAttributeNameCase,
69
+ stylePropertyNameCase,
70
+ SourceMapGenerator,
71
+ ...rest
72
+ } = options || {}
73
+ const dev = development ?? false
74
74
 
75
- const pipeline = unified()
76
- .use(reorgParse)
77
- .use(reorgPlugins || [])
78
- .use(reorgRehype, {
79
- ...reorgRehypeOptions,
80
- allowDangerousHtml: true,
81
- })
82
- .use(rehypePlugins || [])
83
- .use(rehypeRecma, { elementAttributeNameCase, stylePropertyNameCase })
84
- .use(recmaDocument, { ...rest, outputFormat })
85
- .use(recmaJsxRewrite, {
86
- development: dev,
87
- providerImportSource,
88
- outputFormat,
89
- })
75
+ const pipeline = unified()
76
+ .use(reorgParse)
77
+ .use(reorgPlugins || [])
78
+ .use(reorgRehype, {
79
+ ...reorgRehypeOptions,
80
+ allowDangerousHtml: true,
81
+ })
82
+ .use(rehypePlugins || [])
83
+ .use(rehypeRecma, { elementAttributeNameCase, stylePropertyNameCase })
84
+ .use(recmaDocument, { ...rest, outputFormat })
85
+ .use(recmaJsxRewrite, {
86
+ development: dev,
87
+ providerImportSource,
88
+ outputFormat,
89
+ })
90
90
 
91
- if (!jsx) {
92
- pipeline
93
- .use(recmaBuildJsx, { development: dev, outputFormat })
94
- .use(recmaBuildJsxTransform, { outputFormat })
95
- }
91
+ if (!jsx) {
92
+ pipeline
93
+ .use(recmaBuildJsx, { development: dev, outputFormat })
94
+ .use(recmaBuildJsxTransform, { outputFormat })
95
+ }
96
96
 
97
- pipeline
98
- .use(recmaJsx)
99
- .use(recmaStringify, { SourceMapGenerator })
100
- .use(recmaPlugins || [])
97
+ pipeline
98
+ .use(recmaJsx)
99
+ .use(recmaStringify, { SourceMapGenerator })
100
+ .use(recmaPlugins || [])
101
101
 
102
- // @ts-expect-error: TS doesn’t get the plugins we added with if-statements.
103
- return pipeline
102
+ // @ts-expect-error: TS doesn’t get the plugins we added with if-statements.
103
+ return pipeline
104
104
  }
@@ -25,3 +25,4 @@ export function evaluateSync(vfileCompatible: VFileCompatible, evaluateOptions:
25
25
  export type ExportMap = import("./types.js").OrgModule;
26
26
  export type VFileCompatible = import("vfile").VFileCompatible;
27
27
  export type EvaluateOptions = import("./util/resolve-evaluate-options.js").EvaluateOptions;
28
+ //# sourceMappingURL=evaluate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["evaluate.js"],"names":[],"mappings":"AAUA;;;;;;;;;;GAUG;AACH,0CARW,eAAe,mBAGf,eAAe,GAEd,OAAO,CAAC,SAAS,CAAC,CAM7B;AAED;;;;;;;;;;GAUG;AACH,8CARW,eAAe,mBAGf,eAAe,GAEd,SAAS,CAMpB;wBAvCY,OAAO,YAAY,EAAE,SAAS;8BAC9B,OAAO,OAAO,EAAE,eAAe;8BAC/B,OAAO,oCAAoC,EAAE,eAAe"}
@@ -18,3 +18,4 @@ export type Options = {
18
18
  outputFormat?: "function-body" | "program" | null | undefined;
19
19
  };
20
20
  import type { Program } from 'estree-jsx';
21
+ //# sourceMappingURL=recma-build-jsx-transform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recma-build-jsx-transform.d.ts","sourceRoot":"","sources":["recma-build-jsx-transform.js"],"names":[],"mappings":"AAeA;;;;;;;GAOG;AACH,iDALW,QAAQ,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,UAUlC,OAAO,KAEL,SAAS,CAiDvB;;;;;;;;;mBAxEa,eAAe,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS;;6BANlC,YAAY"}
@@ -1,4 +1,4 @@
1
- export function recmaDocument(this: import("unified").Processor, ...parameters: [] | [RecmaDocumentOptions | null | undefined]): void | import("unified").Transformer<import("estree").Program, import("estree").Program> | undefined;
1
+ export function recmaDocument(this: import("unified").Processor, ...parameters: [RecmaDocumentOptions | null | undefined] | []): void | import("unified").Transformer<import("estree").Program, import("estree").Program> | undefined;
2
2
  export type Directive = import("estree-jsx").Directive;
3
3
  export type ExportAllDeclaration = import("estree-jsx").ExportAllDeclaration;
4
4
  export type ExportDefaultDeclaration = import("estree-jsx").ExportDefaultDeclaration;
@@ -61,3 +61,4 @@ export type RecmaDocumentOptions = {
61
61
  */
62
62
  jsxRuntime?: "automatic" | "classic" | null | undefined;
63
63
  };
64
+ //# sourceMappingURL=recma-document.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recma-document.d.ts","sourceRoot":"","sources":["recma-document.js"],"names":[],"mappings":";wBACa,OAAO,YAAY,EAAE,SAAS;mCAC9B,OAAO,YAAY,EAAE,oBAAoB;uCACzC,OAAO,YAAY,EAAE,wBAAwB;qCAC7C,OAAO,YAAY,EAAE,sBAAsB;8BAC3C,OAAO,YAAY,EAAE,eAAe;yBACpC,OAAO,YAAY,EAAE,UAAU;kCAC/B,OAAO,YAAY,EAAE,mBAAmB;gCACxC,OAAO,YAAY,EAAE,iBAAiB;qCACtC,OAAO,YAAY,EAAE,sBAAsB;+BAC3C,OAAO,YAAY,EAAE,gBAAgB;8BACrC,OAAO,YAAY,EAAE,eAAe;sBACpC,OAAO,YAAY,EAAE,OAAO;yBAC5B,OAAO,YAAY,EAAE,UAAU;gCAC/B,OAAO,YAAY,EAAE,iBAAiB;mBACtC,OAAO,YAAY,EAAE,IAAI;sBACzB,OAAO,YAAY,EAAE,OAAO;uBAC5B,OAAO,YAAY,EAAE,QAAQ;4BAC7B,OAAO,YAAY,EAAE,aAAa;4BAClC,OAAO,YAAY,EAAE,aAAa;wBAClC,OAAO,YAAY,EAAE,SAAS;iCAC9B,OAAO,YAAY,EAAE,kBAAkB;;;;;;;;;;mBAMtC,eAAe,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS;;;;;uBAI9C,OAAO,GAAG,IAAI,GAAG,SAAS;;;;;cAG1B,MAAM,GAAG,IAAI,GAAG,SAAS;;;;aAGzB,MAAM,GAAG,IAAI,GAAG,SAAS;;;;iBAEzB,MAAM,GAAG,IAAI,GAAG,SAAS;;;;yBAEzB,MAAM,GAAG,IAAI,GAAG,SAAS;;;;sBAEzB,MAAM,GAAG,IAAI,GAAG,SAAS;;;;iBAEzB,WAAW,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS"}
@@ -48,3 +48,4 @@ export type StackEntry = {
48
48
  idToInvalidComponentName: Map<string | number, string>;
49
49
  node: EstreeFunction;
50
50
  };
51
+ //# sourceMappingURL=recma-jsx-rewrite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recma-jsx-rewrite.d.ts","sourceRoot":"","sources":["recma-jsx-rewrite.js"],"names":[],"mappings":";yBACa,OAAO,YAAY,EAAE,UAAU;6BAC/B,OAAO,YAAY,EAAE,QAAQ;yBAC7B,OAAO,YAAY,EAAE,UAAU;8BAC/B,OAAO,YAAY,EAAE,eAAe;yBACpC,OAAO,YAAY,EAAE,UAAU;gCAC/B,OAAO,YAAY,EAAE,iBAAiB;mBACtC,OAAO,YAAY,EAAE,IAAI;4BACzB,OAAO,YAAY,EAAE,aAAa;sBAClC,OAAO,YAAY,EAAE,OAAO;uBAC5B,OAAO,YAAY,EAAE,QAAQ;wBAC7B,OAAO,YAAY,EAAE,SAAS;iCAC9B,OAAO,YAAY,EAAE,kBAAkB;oBAEvC,OAAO,YAAY,EAAE,KAAK,GAAG;IAAC,IAAI,EAAE,IAAI,CAAA;CAAC;;;;;;;;mBAMxC,eAAe,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS;;;;2BAE9C,MAAM,GAAG,IAAI,GAAG,SAAS;;;;;;;;;;kBAEzB,OAAO,GAAG,IAAI,GAAG,SAAS;;;aAU1B,KAAK,CAAC,MAAM,CAAC;gBACb,KAAK,CAAC,MAAM,CAAC;UACb,KAAK,CAAC,MAAM,CAAC;gBACb,MAAM,CAAC,MAAM,EAAE;QAAC,IAAI,EAAE,UAAU,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAC,CAAC;8BACtD,GAAG,CAAC,MAAM,GAAC,MAAM,EAAE,MAAM,CAAC;UAC1B,cAAc"}
@@ -12,3 +12,4 @@ export const handleJsx: import("hast-util-to-estree").Handle;
12
12
  export type Options = import("hast-util-to-estree").Options;
13
13
  import type { Program } from 'estree';
14
14
  import type { Root } from 'hast';
15
+ //# sourceMappingURL=rehype-recma.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rehype-recma.d.ts","sourceRoot":"","sources":["rehype-recma.js"],"names":[],"mappings":"AAWA;;;;;;;GAOG;AACH,8CALW,OAAO,GAAG,IAAI,GAAG,SAAS,UAOxB,IAAI,KAEF,OAAO,CAmCrB;AA2BD,mDAAmD;AACnD,wBADW,OAAO,qBAAqB,EAAE,MAAM,CA+B9C;sBAjHY,OAAO,qBAAqB,EAAE,OAAO;6BADO,QAAQ;0BAD1C,MAAM"}
@@ -24,3 +24,4 @@ export function run(file: {
24
24
  export function runSync(file: {
25
25
  toString(): string;
26
26
  }, options: unknown): any;
27
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["run.js"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,0BAPW;IAAC,QAAQ,IAAI,MAAM,CAAA;CAAC,WAEpB,OAAO,GAEN,OAAO,CAAC,GAAG,CAAC,CAKvB;AAED;;;;;;;;;GASG;AACH,8BAPW;IAAC,QAAQ,IAAI,MAAM,CAAA;CAAC,WAEpB,OAAO,GAEN,GAAG,CAMd"}
@@ -1,11 +1,11 @@
1
- type FunctionComponent<Props> = (props: Props) => JSX.Element | null;
2
- type ClassComponent<Props> = new (props: Props) => JSX.ElementClass;
3
- type Component<Props> = FunctionComponent<Props> | ClassComponent<Props> | keyof JSX.IntrinsicElements;
1
+ type FunctionComponent<Props> = (props: Props) => React.JSX.Element | null;
2
+ type ClassComponent<Props> = new (props: Props) => React.JSX.ElementClass;
3
+ type Component<Props> = FunctionComponent<Props> | ClassComponent<Props> | keyof React.JSX.IntrinsicElements;
4
4
  interface NestedOrgComponents {
5
5
  [key: string]: NestedOrgComponents | Component<any>;
6
6
  }
7
7
  export type OrgComponents = NestedOrgComponents & {
8
- [Key in keyof JSX.IntrinsicElements]?: Component<JSX.IntrinsicElements[Key]>;
8
+ [Key in keyof React.JSX.IntrinsicElements]?: Component<React.JSX.IntrinsicElements[Key]>;
9
9
  } & {
10
10
  /**
11
11
  * If a wrapper component is defined, the org content will be wrapped inside of it.
@@ -23,15 +23,16 @@ export interface OrgProps {
23
23
  */
24
24
  components?: OrgComponents;
25
25
  }
26
- export type OrgContent = (props: OrgProps) => JSX.Element;
26
+ export type OrgContent = (props: OrgProps) => React.JSX.Element;
27
27
  export interface OrgModule {
28
28
  /**
29
29
  * This could be any value that is exported from the org file.
30
30
  */
31
31
  [key: string]: unknown;
32
32
  /**
33
- * A functional JSX component which renders the content of the org file.
33
+ * A functional React.JSX component which renders the content of the org file.
34
34
  */
35
35
  default: OrgContent;
36
36
  }
37
37
  export {};
38
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA,KAAK,iBAAiB,CAAC,KAAK,IAAI,CAAC,KAAK,EAAE,KAAK,KAAK,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAAA;AAC1E,KAAK,cAAc,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE,KAAK,KAAK,KAAK,CAAC,GAAG,CAAC,YAAY,CAAA;AACzE,KAAK,SAAS,CAAC,KAAK,IACjB,iBAAiB,CAAC,KAAK,CAAC,GACxB,cAAc,CAAC,KAAK,CAAC,GACrB,MAAM,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAA;AAEpC,UAAU,mBAAmB;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAAC,GAAG,CAAC,CAAA;CACnD;AAED,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG;KAChD,GAAG,IAAI,MAAM,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,EAAE,SAAS,CACrD,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAChC;CACD,GAAG;IACH;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,CAAA;CACxB,CAAA;AAED,MAAM,WAAW,QAAQ;IACxB;;;OAGG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;IAEtB;;OAEG;IACH,UAAU,CAAC,EAAE,aAAa,CAAA;CAC1B;AAED,MAAM,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,QAAQ,KAAK,KAAK,CAAC,GAAG,CAAC,OAAO,CAAA;AAE/D,MAAM,WAAW,SAAS;IACzB;;OAEG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;IAEtB;;OAEG;IACH,OAAO,EAAE,UAAU,CAAA;CACnB"}
package/lib/types.ts CHANGED
@@ -1,46 +1,48 @@
1
- type FunctionComponent<Props> = (props: Props) => JSX.Element | null
2
- type ClassComponent<Props> = new (props: Props) => JSX.ElementClass
1
+ type FunctionComponent<Props> = (props: Props) => React.JSX.Element | null
2
+ type ClassComponent<Props> = new (props: Props) => React.JSX.ElementClass
3
3
  type Component<Props> =
4
- | FunctionComponent<Props>
5
- | ClassComponent<Props>
6
- | keyof JSX.IntrinsicElements
4
+ | FunctionComponent<Props>
5
+ | ClassComponent<Props>
6
+ | keyof React.JSX.IntrinsicElements
7
7
 
8
8
  interface NestedOrgComponents {
9
- [key: string]: NestedOrgComponents | Component<any>
9
+ [key: string]: NestedOrgComponents | Component<any>
10
10
  }
11
11
 
12
12
  export type OrgComponents = NestedOrgComponents & {
13
- [Key in keyof JSX.IntrinsicElements]?: Component<JSX.IntrinsicElements[Key]>
13
+ [Key in keyof React.JSX.IntrinsicElements]?: Component<
14
+ React.JSX.IntrinsicElements[Key]
15
+ >
14
16
  } & {
15
- /**
16
- * If a wrapper component is defined, the org content will be wrapped inside of it.
17
- */
18
- wrapper?: Component<any>
17
+ /**
18
+ * If a wrapper component is defined, the org content will be wrapped inside of it.
19
+ */
20
+ wrapper?: Component<any>
19
21
  }
20
22
 
21
23
  export interface OrgProps {
22
- /**
23
- * Which props exactly may be passed into the component depends on the contents of the org
24
- * file.
25
- */
26
- [key: string]: unknown
24
+ /**
25
+ * Which props exactly may be passed into the component depends on the contents of the org
26
+ * file.
27
+ */
28
+ [key: string]: unknown
27
29
 
28
- /**
29
- * This prop may be used to customize how certain components are rendered.
30
- */
31
- components?: OrgComponents
30
+ /**
31
+ * This prop may be used to customize how certain components are rendered.
32
+ */
33
+ components?: OrgComponents
32
34
  }
33
35
 
34
- export type OrgContent = (props: OrgProps) => JSX.Element
36
+ export type OrgContent = (props: OrgProps) => React.JSX.Element
35
37
 
36
38
  export interface OrgModule {
37
- /**
38
- * This could be any value that is exported from the org file.
39
- */
40
- [key: string]: unknown
39
+ /**
40
+ * This could be any value that is exported from the org file.
41
+ */
42
+ [key: string]: unknown
41
43
 
42
- /**
43
- * A functional JSX component which renders the content of the org file.
44
- */
45
- default: OrgContent
44
+ /**
45
+ * A functional React.JSX component which renders the content of the org file.
46
+ */
47
+ default: OrgContent
46
48
  }
@@ -11,3 +11,4 @@
11
11
  */
12
12
  export function create(from: Node, to: Node): void;
13
13
  export type Node = import("estree-jsx").Node;
14
+ //# sourceMappingURL=estree-util-create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"estree-util-create.d.ts","sourceRoot":"","sources":["estree-util-create.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;GAOG;AACH,6BAPW,IAAI,MAEJ,IAAI,GAEF,IAAI,CAiBhB;mBAzBY,OAAO,YAAY,EAAE,IAAI"}
@@ -17,3 +17,4 @@
17
17
  export function declarationToExpression(declaration: Declaration): Expression;
18
18
  export type Declaration = import("estree-jsx").Declaration;
19
19
  export type Expression = import("estree-jsx").Expression;
20
+ //# sourceMappingURL=estree-util-declaration-to-expression.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"estree-util-declaration-to-expression.d.ts","sourceRoot":"","sources":["estree-util-declaration-to-expression.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;GAWG;AACH,qDALW,WAAW,GAET,UAAU,CAiBtB;0BA9BY,OAAO,YAAY,EAAE,WAAW;yBAChC,OAAO,YAAY,EAAE,UAAU"}
@@ -13,3 +13,4 @@
13
13
  export function isDeclaration(node: Node): node is Declaration;
14
14
  export type Node = import("estree-jsx").Node;
15
15
  export type Declaration = import("estree-jsx").Declaration;
16
+ //# sourceMappingURL=estree-util-is-declaration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"estree-util-is-declaration.d.ts","sourceRoot":"","sources":["estree-util-is-declaration.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AACH,oCALW,IAAI,GAEF,IAAI,IAAI,WAAW,CAS/B;mBAlBY,OAAO,YAAY,EAAE,IAAI;0BACzB,OAAO,YAAY,EAAE,WAAW"}
@@ -12,3 +12,4 @@ export type ImportDefaultSpecifier = import("estree-jsx").ImportDefaultSpecifier
12
12
  export type ImportNamespaceSpecifier = import("estree-jsx").ImportNamespaceSpecifier;
13
13
  export type ImportSpecifier = import("estree-jsx").ImportSpecifier;
14
14
  export type VariableDeclarator = import("estree-jsx").VariableDeclarator;
15
+ //# sourceMappingURL=estree-util-specifiers-to-declarations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"estree-util-specifiers-to-declarations.d.ts","sourceRoot":"","sources":["estree-util-specifiers-to-declarations.js"],"names":[],"mappings":"AAaA;;;;GAIG;AACH,qDAJW,KAAK,CAAC,eAAe,GAAG,sBAAsB,GAAG,wBAAwB,GAAG,eAAe,CAAC,QAC5F,UAAU,GACR,KAAK,CAAC,kBAAkB,CAAC,CA6ErC;iCA5FY,OAAO,YAAY,EAAE,kBAAkB;8BACvC,OAAO,YAAY,EAAE,eAAe;yBACpC,OAAO,YAAY,EAAE,UAAU;yBAC/B,OAAO,YAAY,EAAE,UAAU;qCAC/B,OAAO,YAAY,EAAE,sBAAsB;uCAC3C,OAAO,YAAY,EAAE,wBAAwB;8BAC7C,OAAO,YAAY,EAAE,eAAe;iCACpC,OAAO,YAAY,EAAE,kBAAkB"}
@@ -6,3 +6,4 @@
6
6
  */
7
7
  export function toBinaryAddition(expressions: Array<Expression>): import("estree").Expression;
8
8
  export type Expression = import("estree-jsx").Expression;
9
+ //# sourceMappingURL=estree-util-to-binary-addition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"estree-util-to-binary-addition.d.ts","sourceRoot":"","sources":["estree-util-to-binary-addition.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,8CAFW,KAAK,CAAC,UAAU,CAAC,+BAiB3B;yBArBY,OAAO,YAAY,EAAE,UAAU"}
@@ -9,3 +9,4 @@ export type JSXIdentifier = import("estree-jsx").JSXIdentifier;
9
9
  export type JSXMemberExpression = import("estree-jsx").JSXMemberExpression;
10
10
  export type Literal = import("estree-jsx").Literal;
11
11
  export type MemberExpression = import("estree-jsx").MemberExpression;
12
+ //# sourceMappingURL=estree-util-to-id-or-member-expression.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"estree-util-to-id-or-member-expression.d.ts","sourceRoot":"","sources":["estree-util-to-id-or-member-expression.js"],"names":[],"mappings":"AAsCE;;;GAGG;AACH,4CAHW,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,GACpB,UAAU,GAAG,gBAAgB,CAwCzC;AA5DH,wCAEa,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,aAAa,GAAG,mBAAmB,CAO9E;yBA5BU,OAAO,YAAY,EAAE,UAAU;4BAC/B,OAAO,YAAY,EAAE,aAAa;kCAClC,OAAO,YAAY,EAAE,mBAAmB;sBACxC,OAAO,YAAY,EAAE,OAAO;+BAC5B,OAAO,YAAY,EAAE,gBAAgB"}
@@ -4,3 +4,4 @@
4
4
  * @returns {boolean}
5
5
  */
6
6
  export function isOrgContent(node: import("react").ReactNode): boolean;
7
+ //# sourceMappingURL=is-org-content.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-org-content.d.ts","sourceRoot":"","sources":["is-org-content.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,mCAHW,OAAO,OAAO,EAAE,SAAS,GACvB,OAAO,CAUnB"}
@@ -1,2 +1,3 @@
1
1
  declare function _default(error: SyntaxError, bg?: string, color?: string): import("estree-jsx").Program;
2
2
  export default _default;
3
+ //# sourceMappingURL=render-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-error.d.ts","sourceRoot":"","sources":["render-error.js"],"names":[],"mappings":"AAMe,iCALJ,WAAW,OACX,MAAM,UACN,MAAM,GACJ,OAAO,YAAY,EAAE,OAAO,CAsFxC"}
@@ -64,3 +64,4 @@ export type EvaluateProcessorOptions = Omit<ProcessorOptions, "jsx" | "jsxImport
64
64
  * Configuration for evaluation.
65
65
  */
66
66
  export type EvaluateOptions = EvaluateProcessorOptions & RunnerOptions;
67
+ //# sourceMappingURL=resolve-evaluate-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-evaluate-options.d.ts","sourceRoot":"","sources":["resolve-evaluate-options.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;GAKG;AACH,gDAHW,eAAe,GAAG,IAAI,GAAG,SAAS,GAChC;IAAC,WAAW,EAAE,gBAAgB,CAAC;IAAC,OAAO,EAAE,aAAa,CAAA;CAAC,CAoCnE;+BA9DY,OAAO,YAAY,EAAE,gBAAgB;;;;;;;;cAIpC,GAAG;;;;UAEH,GAAG;;;;WAEH,GAAG;;;;aAEH,GAAG;;;;uBAEH,GAAG;;;;;uCAGJ,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,iBAAiB,GAAG,YAAY,GAAG,QAAQ,GAAG,YAAY,GAAG,oBAAoB,GAAG,sBAAsB,GAAG,cAAc,CAAC;;;;8BAG3J,wBAAwB,GAAG,aAAa"}
@@ -14,3 +14,4 @@ export type VFileCompatible = import("vfile").VFileCompatible;
14
14
  export type ProcessorOptions = import("../core.js").ProcessorOptions;
15
15
  export type CompileOptions = import("../compile.js").CompileOptions;
16
16
  import { VFile } from 'vfile';
17
+ //# sourceMappingURL=resolve-file-and-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-file-and-options.d.ts","sourceRoot":"","sources":["resolve-file-and-options.js"],"names":[],"mappings":"AAQA;;;;;;;GAOG;AACH,uDAJW,eAAe,YACf,cAAc,GAAG,IAAI,GAAG,SAAS,GAC/B;IAAC,IAAI,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,gBAAgB,CAAA;CAAC,CAYpD;8BAzBY,OAAO,OAAO,EAAE,eAAe;+BAC/B,OAAO,YAAY,EAAE,gBAAgB;6BACrC,OAAO,eAAe,EAAE,cAAc;sBAG7B,OAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orgajs/orgx",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "orga compiler with jsx support",
5
5
  "author": "Xiaoxing Hu <hi@xiaoxing.dev>",
6
6
  "license": "MIT",
@@ -11,27 +11,25 @@
11
11
  "directory": "packages/orgx"
12
12
  },
13
13
  "type": "module",
14
- "exports": {
15
- ".": "./index.js"
16
- },
17
- "types": "dist/index.d.ts",
18
- "browser": {
19
- "./lib/condition.js": "./lib/condition.browser.js"
20
- },
21
14
  "files": [
22
15
  "lib/",
23
- "dist",
24
16
  "index.js",
17
+ "index.d.ts",
18
+ "index.d.ts.map",
25
19
  "types.d.ts"
26
20
  ],
21
+ "exports": {
22
+ ".": "./index.js"
23
+ },
27
24
  "devDependencies": {
28
25
  "@types/estree": "^1.0.6",
29
26
  "@types/estree-jsx": "^1.0.5",
30
27
  "@types/hast": "^3.0.4",
31
28
  "@types/node": "^20.5.7",
32
- "@types/react": "^18.2.21",
33
- "react": "^18.2.0",
34
- "react-dom": "^18.2.0"
29
+ "@types/react": "^19.0.8",
30
+ "react": "^19.0.0",
31
+ "react-dom": "^19.0.0",
32
+ "typescript": "^5.7.3"
35
33
  },
36
34
  "dependencies": {
37
35
  "acorn": "^8.14.0",
@@ -51,12 +49,10 @@
51
49
  "unist-util-position-from-estree": "^2.0.0",
52
50
  "unist-util-stringify-position": "^4.0.0",
53
51
  "vfile": "^6.0.3",
54
- "@orgajs/reorg-parse": "^4.2.0",
55
- "@orgajs/reorg-rehype": "^4.2.0"
52
+ "@orgajs/reorg-parse": "^4.3.0",
53
+ "@orgajs/reorg-rehype": "^4.3.0"
56
54
  },
57
55
  "scripts": {
58
- "clean": "tsc --build --clean",
59
- "build": "tsc --build",
60
56
  "test": "node --test tests/*.test.js"
61
57
  }
62
58
  }
@@ -1 +0,0 @@
1
- {"root":["../lib/compile.js","../lib/core.js","../lib/evaluate.js","../lib/run.js","../lib/types.ts","../lib/plugin/recma-build-jsx-transform.js","../lib/plugin/recma-document.js","../lib/plugin/recma-jsx-rewrite.js","../lib/plugin/rehype-recma.js","../lib/util/estree-util-create.js","../lib/util/estree-util-declaration-to-expression.js","../lib/util/estree-util-is-declaration.js","../lib/util/estree-util-specifiers-to-declarations.js","../lib/util/estree-util-to-binary-addition.js","../lib/util/estree-util-to-id-or-member-expression.js","../lib/util/is-org-content.js","../lib/util/render-error.js","../lib/util/resolve-evaluate-options.js","../lib/util/resolve-file-and-options.js","../index.js"],"version":"5.7.3"}