@markdoc/markdoc 0.5.13 → 0.5.14

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 (86) hide show
  1. package/README.md +11 -0
  2. package/dist/index.d.ts +4 -4
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +467 -462
  5. package/dist/index.js.map +4 -4
  6. package/dist/index.mjs +467 -462
  7. package/dist/index.mjs.map +4 -4
  8. package/dist/react.js +1 -1
  9. package/dist/react.js.map +2 -2
  10. package/dist/src/ast/base.d.ts +1 -1
  11. package/dist/src/ast/base.d.ts.map +1 -1
  12. package/dist/src/ast/function.d.ts +1 -1
  13. package/dist/src/ast/function.d.ts.map +1 -1
  14. package/dist/src/ast/index.d.ts +2 -2
  15. package/dist/src/ast/index.d.ts.map +1 -1
  16. package/dist/src/ast/node.d.ts.map +1 -1
  17. package/dist/src/ast/variable.d.ts +1 -1
  18. package/dist/src/ast/variable.d.ts.map +1 -1
  19. package/dist/src/formatter.d.ts.map +1 -1
  20. package/dist/src/functions/index.d.ts.map +1 -1
  21. package/dist/src/parser.d.ts.map +1 -1
  22. package/dist/src/renderers/html.d.ts.map +1 -1
  23. package/dist/src/renderers/react/react.d.ts +2 -2
  24. package/dist/src/renderers/react/react.d.ts.map +1 -1
  25. package/dist/src/renderers/react/static.d.ts +1 -1
  26. package/dist/src/renderers/react/static.d.ts.map +1 -1
  27. package/dist/src/schema-types/class.d.ts +1 -1
  28. package/dist/src/schema-types/class.d.ts.map +1 -1
  29. package/dist/src/schema-types/conditional.d.ts +1 -1
  30. package/dist/src/schema-types/conditional.d.ts.map +1 -1
  31. package/dist/src/schema.d.ts.map +1 -1
  32. package/dist/src/tags/conditional.d.ts +1 -1
  33. package/dist/src/tags/conditional.d.ts.map +1 -1
  34. package/dist/src/tokenizer/index.d.ts.map +1 -1
  35. package/dist/src/tokenizer/plugins/annotations.d.ts.map +1 -1
  36. package/dist/src/transformer.d.ts.map +1 -1
  37. package/dist/src/validator.d.ts +1 -1
  38. package/dist/src/validator.d.ts.map +1 -1
  39. package/index.ts +21 -22
  40. package/package.json +7 -13
  41. package/spec/support/matchers.d.ts +6 -4
  42. package/src/ast/base.ts +2 -2
  43. package/src/ast/function.ts +1 -1
  44. package/src/ast/index.ts +3 -4
  45. package/src/ast/node.test.ts +60 -46
  46. package/src/ast/node.ts +3 -3
  47. package/src/ast/variable.test.ts +5 -4
  48. package/src/ast/variable.ts +1 -1
  49. package/src/formatter.test.ts +4 -3
  50. package/src/formatter.ts +11 -11
  51. package/src/functions/index.test.ts +8 -7
  52. package/src/functions/index.ts +1 -1
  53. package/src/grammar/tag.d.ts +1 -1
  54. package/src/grammar/tag.js +208 -285
  55. package/src/grammar/tag.pegjs +4 -4
  56. package/src/grammar/tag.test.ts +56 -52
  57. package/src/parser.test.ts +93 -70
  58. package/src/parser.ts +19 -6
  59. package/src/renderers/html.test.ts +56 -16
  60. package/src/renderers/html.ts +10 -2
  61. package/src/renderers/react/react.test.ts +29 -28
  62. package/src/renderers/react/react.ts +7 -8
  63. package/src/renderers/react/static.ts +5 -6
  64. package/src/schema-types/class.ts +1 -1
  65. package/src/schema-types/conditional.ts +1 -1
  66. package/src/schema.ts +9 -4
  67. package/src/tag.test.ts +2 -1
  68. package/src/tag.ts +1 -1
  69. package/src/tags/conditional.ts +4 -4
  70. package/src/tags/index.ts +2 -2
  71. package/src/tags/partial.ts +1 -1
  72. package/src/tokenizer/index.ts +6 -5
  73. package/src/tokenizer/plugins/annotations.test.ts +29 -28
  74. package/src/tokenizer/plugins/annotations.ts +12 -12
  75. package/src/tokenizer/plugins/comments.test.ts +11 -10
  76. package/src/tokenizer/plugins/comments.ts +2 -2
  77. package/src/tokenizer/plugins/frontmatter.test.ts +7 -6
  78. package/src/tokenizer/plugins/frontmatter.ts +2 -2
  79. package/src/tokenizer/plugins/link.test.ts +14 -13
  80. package/src/transformer.ts +7 -5
  81. package/src/transforms/table.test.ts +18 -17
  82. package/src/transforms/table.ts +1 -1
  83. package/src/utils.test.ts +23 -22
  84. package/src/utils.ts +3 -3
  85. package/src/validator.test.ts +60 -59
  86. package/src/validator.ts +13 -11
package/dist/react.js CHANGED
@@ -41,7 +41,7 @@ function dynamic(node, React, { components = {}, resolveTagName = tagName } = {}
41
41
  if (className) attrs.className = className;
42
42
  return React.createElement(
43
43
  resolveTagName(name, components),
44
- Object.keys(attrs).length == 0 ? null : deepRender(attrs),
44
+ Object.keys(attrs).length === 0 ? null : deepRender(attrs),
45
45
  ...children.map(render)
46
46
  );
47
47
  }
package/dist/react.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/tag.ts", "../src/renderers/react/react.ts"],
4
- "sourcesContent": ["import type { RenderableTreeNode } from './types';\n\nexport default class Tag<\n N extends string = string,\n A extends Record<string, any> = Record<string, any>,\n> {\n readonly $$mdtype = 'Tag' as const;\n\n static isTag = (tag: any): tag is Tag => {\n return !!(tag?.$$mdtype === 'Tag');\n };\n\n name: N;\n attributes: A;\n children: RenderableTreeNode[];\n\n constructor(\n name = 'div' as N,\n attributes = {} as A,\n children: RenderableTreeNode[] = []\n ) {\n this.name = name;\n this.attributes = attributes;\n this.children = children;\n }\n}\n", "import Tag from '../../tag';\nimport { RenderableTreeNodes } from '../../types';\n\nimport type { createElement, ComponentType, Fragment, ReactNode } from 'react';\n\ntype ReactShape = Readonly<{\n createElement: typeof createElement;\n Fragment: typeof Fragment;\n}>;\n\ntype Component = ComponentType<any>;\n\nfunction tagName(\n name: string,\n components: Record<string, Component> | ((string: string) => Component)\n): string | Component {\n return typeof name !== 'string'\n ? name // This can be an object, e.g. when React.forwardRef is used\n : name[0] !== name[0].toUpperCase()\n ? name\n : components instanceof Function\n ? components(name)\n : components[name];\n}\n\nexport type RenderOpts = {\n components?: Record<string, Component> | ((string: string) => Component);\n resolveTagName?: typeof tagName;\n};\nexport default function dynamic(\n node: RenderableTreeNodes,\n React: ReactShape,\n { components = {}, resolveTagName = tagName }: RenderOpts = {}\n) {\n function deepRender(value: any): any {\n if (value == null || typeof value !== 'object') return value;\n\n if (Array.isArray(value)) return value.map((item) => deepRender(item));\n\n if (value.$$mdtype === 'Tag') return render(value);\n\n if (typeof value !== 'object') return value;\n\n return Object.fromEntries(\n Object.entries(value).map(([k, v]) => [k, deepRender(v)])\n );\n }\n\n function render(node: RenderableTreeNodes): ReactNode {\n if (Array.isArray(node))\n return React.createElement(React.Fragment, null, ...node.map(render));\n\n if (node === null || typeof node !== 'object' || !Tag.isTag(node)) {\n // Preserve passthrough values from custom transforms, including React elements.\n return node as ReactNode;\n }\n\n const {\n name,\n attributes: { class: className, ...attrs } = {},\n children = [],\n } = node;\n\n if (className) attrs.className = className;\n\n return React.createElement(\n resolveTagName(name, components),\n Object.keys(attrs).length == 0 ? null : deepRender(attrs),\n ...children.map(render)\n );\n }\n\n return render(node);\n}\n"],
5
- "mappings": ";AAEA,IAAqB,MAArB,MAGE;AAAA,EAWA,YACE,OAAO,OACP,aAAa,CAAC,GACd,WAAiC,CAAC,GAClC;AAdF,SAAS,WAAW;AAelB,SAAK,OAAO;AACZ,SAAK,aAAa;AAClB,SAAK,WAAW;AAAA,EAClB;AAAA,EAhBA;AAAA,SAAO,QAAQ,CAAC,QAAyB;AACvC,aAAO,CAAC,EAAE,KAAK,aAAa;AAAA,IAC9B;AAAA;AAeF;;;ACbA,SAAS,QACP,MACA,YACoB;AACpB,SAAO,OAAO,SAAS,WACnB,OACA,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,YAAY,IAC9B,OACA,sBAAsB,WACpB,WAAW,IAAI,IACf,WAAW,IAAI;AACzB;AAMe,SAAR,QACL,MACA,OACA,EAAE,aAAa,CAAC,GAAG,iBAAiB,QAAQ,IAAgB,CAAC,GAC7D;AACA,WAAS,WAAW,OAAiB;AACnC,QAAI,SAAS,QAAQ,OAAO,UAAU,SAAU,QAAO;AAEvD,QAAI,MAAM,QAAQ,KAAK,EAAG,QAAO,MAAM,IAAI,CAAC,SAAS,WAAW,IAAI,CAAC;AAErE,QAAI,MAAM,aAAa,MAAO,QAAO,OAAO,KAAK;AAEjD,QAAI,OAAO,UAAU,SAAU,QAAO;AAEtC,WAAO,OAAO;AAAA,MACZ,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC;AAAA,IAC1D;AAAA,EACF;AAEA,WAAS,OAAOA,OAAsC;AACpD,QAAI,MAAM,QAAQA,KAAI;AACpB,aAAO,MAAM,cAAc,MAAM,UAAU,MAAM,GAAGA,MAAK,IAAI,MAAM,CAAC;AAEtE,QAAIA,UAAS,QAAQ,OAAOA,UAAS,YAAY,CAAC,IAAI,MAAMA,KAAI,GAAG;AAEjE,aAAOA;AAAA,IACT;AAEA,UAAM;AAAA,MACJ;AAAA,MACA,YAAY,EAAE,OAAO,WAAW,GAAG,MAAM,IAAI,CAAC;AAAA,MAC9C,WAAW,CAAC;AAAA,IACd,IAAIA;AAEJ,QAAI,UAAW,OAAM,YAAY;AAEjC,WAAO,MAAM;AAAA,MACX,eAAe,MAAM,UAAU;AAAA,MAC/B,OAAO,KAAK,KAAK,EAAE,UAAU,IAAI,OAAO,WAAW,KAAK;AAAA,MACxD,GAAG,SAAS,IAAI,MAAM;AAAA,IACxB;AAAA,EACF;AAEA,SAAO,OAAO,IAAI;AACpB;",
4
+ "sourcesContent": ["import type { RenderableTreeNode } from './types';\n\nexport default class Tag<\n N extends string = string,\n A extends Record<string, any> = Record<string, any>,\n> {\n readonly $$mdtype = 'Tag' as const;\n\n static isTag = (tag: any): tag is Tag => {\n return !!(tag?.$$mdtype === 'Tag');\n };\n\n name: N;\n attributes: A;\n children: RenderableTreeNode[];\n\n constructor(\n name = 'div' as N,\n attributes = {} as A,\n children: RenderableTreeNode[] = [],\n ) {\n this.name = name;\n this.attributes = attributes;\n this.children = children;\n }\n}\n", "import type { ComponentType, createElement, Fragment, ReactNode } from 'react';\nimport Tag from '../../tag';\nimport type { RenderableTreeNodes } from '../../types';\n\ntype ReactShape = Readonly<{\n createElement: typeof createElement;\n Fragment: typeof Fragment;\n}>;\n\ntype Component = ComponentType<any>;\n\nfunction tagName(\n name: string,\n components: Record<string, Component> | ((string: string) => Component),\n): string | Component {\n return typeof name !== 'string'\n ? name // This can be an object, e.g. when React.forwardRef is used\n : name[0] !== name[0].toUpperCase()\n ? name\n : components instanceof Function\n ? components(name)\n : components[name];\n}\n\nexport type RenderOpts = {\n components?: Record<string, Component> | ((string: string) => Component);\n resolveTagName?: typeof tagName;\n};\nexport default function dynamic(\n node: RenderableTreeNodes,\n React: ReactShape,\n { components = {}, resolveTagName = tagName }: RenderOpts = {},\n) {\n function deepRender(value: any): any {\n if (value == null || typeof value !== 'object') return value;\n\n if (Array.isArray(value)) return value.map((item) => deepRender(item));\n\n if (value.$$mdtype === 'Tag') return render(value);\n\n if (typeof value !== 'object') return value;\n\n return Object.fromEntries(\n Object.entries(value).map(([k, v]) => [k, deepRender(v)]),\n );\n }\n\n function render(node: RenderableTreeNodes): ReactNode {\n if (Array.isArray(node))\n return React.createElement(React.Fragment, null, ...node.map(render));\n\n if (node === null || typeof node !== 'object' || !Tag.isTag(node)) {\n // Preserve passthrough values from custom transforms, including React elements.\n return node as ReactNode;\n }\n\n const {\n name,\n attributes: { class: className, ...attrs } = {},\n children = [],\n } = node;\n\n if (className) attrs.className = className;\n\n return React.createElement(\n resolveTagName(name, components),\n Object.keys(attrs).length === 0 ? null : deepRender(attrs),\n ...children.map(render),\n );\n }\n\n return render(node);\n}\n"],
5
+ "mappings": ";AAEA,IAAqB,MAArB,MAGE;AAAA,EAWA,YACE,OAAO,OACP,aAAa,CAAC,GACd,WAAiC,CAAC,GAClC;AAdF,SAAS,WAAW;AAelB,SAAK,OAAO;AACZ,SAAK,aAAa;AAClB,SAAK,WAAW;AAAA,EAClB;AAAA,EAhBA;AAAA,SAAO,QAAQ,CAAC,QAAyB;AACvC,aAAO,CAA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AAI,MAAM;AAAA,IACxB;AAAA,EACF;AAEA,SAAO,OAAO,IAAI;AACpB;",
6
6
  "names": ["node"]
7
7
  }
@@ -1,4 +1,4 @@
1
- import type { AstType, Config, Function as AstFunction, Variable as AstVariable } from '../types';
1
+ import type { Function as AstFunction, AstType, Variable as AstVariable, Config } from '../types';
2
2
  export declare function isAst(value?: any): value is AstType;
3
3
  export declare function isFunction(value?: any): value is AstFunction;
4
4
  export declare function isVariable(value?: any): value is AstVariable;
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/ast/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,MAAM,EACN,QAAQ,IAAI,WAAW,EAEvB,QAAQ,IAAI,WAAW,EACxB,MAAM,UAAU,CAAC;AAIlB,wBAAgB,KAAK,CAAC,KAAK,CAAC,EAAE,GAAG,GAAG,KAAK,IAAI,OAAO,CAEnD;AAED,wBAAgB,UAAU,CAAC,KAAK,CAAC,EAAE,GAAG,GAAG,KAAK,IAAI,WAAW,CAE5D;AAED,wBAAgB,UAAU,CAAC,KAAK,CAAC,EAAE,GAAG,GAAG,KAAK,IAAI,WAAW,CAE5D;AAED,wBAAiB,YAAY,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAW3E;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,GAAE,MAAW,GAAG,GAAG,CAyB5D"}
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/ast/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,IAAI,WAAW,EACvB,OAAO,EACP,QAAQ,IAAI,WAAW,EACvB,MAAM,EAEP,MAAM,UAAU,CAAC;AAIlB,wBAAgB,KAAK,CAAC,KAAK,CAAC,EAAE,GAAG,GAAG,KAAK,IAAI,OAAO,CAEnD;AAED,wBAAgB,UAAU,CAAC,KAAK,CAAC,EAAE,GAAG,GAAG,KAAK,IAAI,WAAW,CAE5D;AAED,wBAAgB,UAAU,CAAC,KAAK,CAAC,EAAE,GAAG,GAAG,KAAK,IAAI,WAAW,CAE5D;AAED,wBAAiB,YAAY,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAW3E;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,GAAE,MAAW,GAAG,GAAG,CAyB5D"}
@@ -1,4 +1,4 @@
1
- import type { Config, AstType } from '../types';
1
+ import type { AstType, Config } from '../types';
2
2
  export default class Function implements AstType {
3
3
  readonly $$mdtype = "Function";
4
4
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../../../src/ast/function.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,CAAC,OAAO,OAAO,QAAS,YAAW,OAAO;IAC9C,QAAQ,CAAC,QAAQ,cAAc;IAE/B,IAAI,SAAC;IACL,UAAU,sBAAC;gBAEC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAKzD,OAAO,CAAC,MAAM,GAAE,MAAW;CAO5B"}
1
+ {"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../../../src/ast/function.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGhD,MAAM,CAAC,OAAO,OAAO,QAAS,YAAW,OAAO;IAC9C,QAAQ,CAAC,QAAQ,cAAc;IAE/B,IAAI,SAAC;IACL,UAAU,sBAAC;gBAEC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAKzD,OAAO,CAAC,MAAM,GAAE,MAAW;CAO5B"}
@@ -1,7 +1,7 @@
1
- import Node from './node';
1
+ import type { AstType } from '../types';
2
2
  import Function from './function';
3
+ import Node from './node';
3
4
  import Variable from './variable';
4
- import type { AstType } from '../types';
5
5
  declare function fromJSON(text: string): Node | Node[];
6
6
  declare const _default: {
7
7
  fromJSON: typeof fromJSON;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ast/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAGlC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAcxC,iBAAS,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,EAAE,CAE7C;;;;;;;;;;;;AAED,wBAIE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ast/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAclC,iBAAS,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,EAAE,CAE7C;;;;;;;;;;;;AAED,wBAIE"}
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/ast/node.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,EACN,eAAe,EAChB,MAAM,UAAU,CAAC;AAElB,MAAM,CAAC,OAAO,OAAO,IAAK,YAAW,OAAO;IAC1C,QAAQ,CAAC,QAAQ,UAAU;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UAAU;IAE3B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC5B,QAAQ,EAAE,IAAI,EAAE,CAAC;IACjB,MAAM,EAAE,eAAe,EAAE,CAAM;IAC/B,KAAK,EAAE,MAAM,EAAE,CAAM;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,cAAc,EAAE,CAAC;IAE9B,MAAM,UAAS;IACf,QAAQ,CAAC,EAAE,QAAQ,CAAC;gBAGlB,IAAI,GAAE,QAAiB,EACvB,UAAU,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EACpC,QAAQ,GAAE,IAAI,EAAO,EACrB,GAAG,CAAC,EAAE,MAAM;IAUb,IAAI,IAAI,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC;IAOvC,IAAI,CAAC,IAAI,EAAE,IAAI;IAIf,OAAO,CAAC,MAAM,GAAE,MAAW,GAAG,IAAI;IAalC,UAAU,CAAC,MAAM,GAAE,MAAW,GAAG,MAAM,GAAG,SAAS;IAInD,mBAAmB,CAAC,MAAM,GAAE,MAAW;IAIvC,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,kBAAkB,EAAE;IAIvD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAAC,mBAAmB,CAAC;CAG7D"}
@@ -1,4 +1,4 @@
1
- import type { Config, AstType } from '../types';
1
+ import type { AstType, Config } from '../types';
2
2
  export default class Variable implements AstType {
3
3
  readonly $$mdtype = "Variable";
4
4
  path: (string | number)[];
@@ -1 +1 @@
1
- {"version":3,"file":"variable.d.ts","sourceRoot":"","sources":["../../../src/ast/variable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,CAAC,OAAO,OAAO,QAAS,YAAW,OAAO;IAC9C,QAAQ,CAAC,QAAQ,cAAc;IAE/B,IAAI,sBAAC;gBAEO,IAAI,GAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAO;IAI1C,OAAO,CAAC,EAAE,SAAS,EAAE,GAAE,MAAW;CAKnC"}
1
+ {"version":3,"file":"variable.d.ts","sourceRoot":"","sources":["../../../src/ast/variable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,CAAC,OAAO,OAAO,QAAS,YAAW,OAAO;IAC9C,QAAQ,CAAC,QAAQ,cAAc;IAE/B,IAAI,sBAAC;gBAEO,IAAI,GAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAO;IAI1C,OAAO,CAAC,EAAE,SAAS,EAAE,GAAE,MAAW;CAKnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../../src/formatter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAA4B,IAAI,EAAE,KAAK,EAAY,MAAM,SAAS,CAAC;AAE/E,KAAK,OAAO,GAAG;IACb,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,WAAW,GAAG,QAAQ,CAAC;IACzC,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AA2eF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,CAAC,EAAE,KAAK,GAAG,KAAK,EAAE,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAI5E"}
1
+ {"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../../src/formatter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA4B,IAAI,EAAE,KAAK,EAAY,MAAM,SAAS,CAAC;AAG/E,KAAK,OAAO,GAAG;IACb,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,WAAW,GAAG,QAAQ,CAAC;IACzC,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AA2eF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,CAAC,EAAE,KAAK,GAAG,KAAK,EAAE,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAI5E"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/functions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;;;;;;;;;AA4C/C,wBAAmE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/functions/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;;;;;;;;;AA2C/C,wBAAmE"}
@@ -1 +1 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/parser.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,YAAY,CAAC;AAI9B,OAAO,KAAK,EAA4B,UAAU,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAiN3E,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,QAoBzE"}
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/parser.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,YAAY,CAAC;AAE9B,OAAO,KAAK,EAA4B,UAAU,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAgO3E,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,QAoBzE"}
@@ -1 +1 @@
1
- {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../src/renderers/html.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAsBpD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CAuBhE"}
1
+ {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../src/renderers/html.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AA6BpD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CAwBhE"}
@@ -1,5 +1,5 @@
1
- import { RenderableTreeNodes } from '../../types';
2
- import type { createElement, ComponentType, Fragment, ReactNode } from 'react';
1
+ import type { ComponentType, createElement, Fragment, ReactNode } from 'react';
2
+ import type { RenderableTreeNodes } from '../../types';
3
3
  type ReactShape = Readonly<{
4
4
  createElement: typeof createElement;
5
5
  Fragment: typeof Fragment;
@@ -1 +1 @@
1
- {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../../src/renderers/react/react.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE/E,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,aAAa,EAAE,OAAO,aAAa,CAAC;IACpC,QAAQ,EAAE,OAAO,QAAQ,CAAC;CAC3B,CAAC,CAAC;AAEH,KAAK,SAAS,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;AAEpC,iBAAS,OAAO,CACd,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,CAA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M,CAAC,OAAO,UAAU,OAAO,CAC7B,IAAI,EAAE,mBAAmB,EACzB,KAAK,EAAE,UAAU,EACjB,EAAE,UAAe,EAAE,cAAwB,EAAE,GAAE,UAAe,aAyC/D"}
@@ -1,5 +1,5 @@
1
- import { RenderableTreeNodes } from '../../types';
2
1
  import type { ComponentType } from 'react';
2
+ import type { RenderableTreeNodes } from '../../types';
3
3
  type Component = ComponentType<unknown>;
4
4
  declare function tagName(name: string, components: Record<string, Component> | ((string: string) => Component)): string | Component;
5
5
  export default function reactStatic(node: RenderableTreeNodes, { resolveTagName }?: {
@@ -1 +1 @@
1
- {"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../../../../src/renderers/react/static.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,KAAK,SAAS,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;AAExC,iBAAS,OAAO,CACd,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,SAAS,CAAC,GACtE,MAAM,GAAG,SAAS,CAQpB;AA4CD,MAAM,CAAC,OAAO,UAAU,WAAW,CACjC,IAAI,EAAE,mBAAmB,EACzB,EAAE,cAAwB,EAAE,GAAE;IAAE,cAAc,CAAC,EAAE,OAAO,OAAO,CAAA;CAAO,GACrE,MAAM,CAYR"}
1
+ {"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../../../../src/renderers/react/static.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,KAAK,EAAsB,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE3E,KAAK,SAAS,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;AAExC,iBAAS,OAAO,CACd,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,SAAS,CAAC,GACtE,MAAM,GAAG,SAAS,CAQpB;AA4CD,MAAM,CAAC,OAAO,UAAU,WAAW,CACjC,IAAI,EAAE,mBAAmB,EACzB,EAAE,cAAwB,EAAE,GAAE;IAAE,cAAc,CAAC,EAAE,OAAO,OAAO,CAAA;CAAO,GACrE,MAAM,CAYR"}
@@ -1,4 +1,4 @@
1
- import { Config, CustomAttributeTypeInterface, ValidationError } from '../types';
1
+ import type { Config, CustomAttributeTypeInterface, ValidationError } from '../types';
2
2
  export declare class Class implements CustomAttributeTypeInterface {
3
3
  validate(value: any, _config: Config, key: string): ValidationError[];
4
4
  transform(value: any): any;
@@ -1 +1 @@
1
- {"version":3,"file":"class.d.ts","sourceRoot":"","sources":["../../../src/schema-types/class.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,4BAA4B,EAC5B,eAAe,EAChB,MAAM,UAAU,CAAC;AAElB,qBAAa,KAAM,YAAW,4BAA4B;IACxD,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,eAAe,EAAE;IAYrE,SAAS,CAAC,KAAK,EAAE,GAAG;CAOrB"}
1
+ {"version":3,"file":"class.d.ts","sourceRoot":"","sources":["../../../src/schema-types/class.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,4BAA4B,EAC5B,eAAe,EAChB,MAAM,UAAU,CAAC;AAElB,qBAAa,KAAM,YAAW,4BAA4B;IACxD,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,eAAe,EAAE;IAYrE,SAAS,CAAC,KAAK,EAAE,GAAG;CAOrB"}
@@ -1,4 +1,4 @@
1
- import { Config, CustomAttributeTypeInterface, ValidationError } from '../types';
1
+ import type { Config, CustomAttributeTypeInterface, ValidationError } from '../types';
2
2
  /**
3
3
  * Conditional attribute type for Markdoc {% if /%} and {% else /%} tags.
4
4
  *
@@ -1 +1 @@
1
- {"version":3,"file":"conditional.d.ts","sourceRoot":"","sources":["../../../src/schema-types/conditional.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,4BAA4B,EAC5B,eAAe,EAChB,MAAM,UAAU,CAAC;AAElB;;;;;;;GAOG;AACH,qBAAa,wBAAyB,YAAW,4BAA4B;IAC3E,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,eAAe,EAAE;CAkBtE"}
1
+ {"version":3,"file":"conditional.d.ts","sourceRoot":"","sources":["../../../src/schema-types/conditional.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,4BAA4B,EAC5B,eAAe,EAChB,MAAM,UAAU,CAAC;AAElB;;;;;;;GAOG;AACH,qBAAa,wBAAyB,YAAW,4BAA4B;IAC3E,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,eAAe,EAAE;CAkBtE"}
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGtC,eAAO,MAAM,QAAQ,EAAE,MAiBtB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,MAYrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,MAGvB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,MAQnB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,MAenB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,MAaxB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,MAclB,CAAC;AAEF,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AEF,eAAO,MAAM,IAAI,EAAE,MAclB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,MAclB,CAAC;AAEF,eAAO,MAAM,EAAE,EAAE,MAEhB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,MAEnB,CAAC;AAEF,eAAO,MAAM,EAAE,EAAE,MAmBhB,CAAC;AAEF,eAAO,MAAM,EAAE,EAAE,MAQhB,CAAC;AAEF,eAAO,MAAM,EAAE,EAAE,MAGhB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,MAGnB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,MAGnB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,MAMpB,CAAC;AAEF,eAAO,MAAM,EAAE,EAAE,MAMhB,CAAC;AAEF,eAAO,MAAM,CAAC,EAAE,MAGf,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,MAcpB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,MAOlB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,MASlB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,MAOlB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,MAEvB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,MAIvB,CAAC;AAEF,eAAO,MAAM,OAAO;;;;;;;CAInB,CAAC;AAEF,eAAO,MAAM,KAAK,IAAK,CAAC;AACxB,eAAO,MAAM,IAAI,IAAK,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Schema } from '../types';
1
+ import type { Schema } from '../types';
2
2
  export declare function truthy(value: any): boolean;
3
3
  export declare const tagIf: Schema;
4
4
  export declare const tagElse: Schema;
@@ -1 +1 @@
1
- {"version":3,"file":"conditional.d.ts","sourceRoot":"","sources":["../../../src/tags/conditional.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,MAAM,EAEP,MAAM,UAAU,CAAC;AAKlB,wBAAgB,MAAM,CAAC,KAAK,EAAE,GAAG,WAEhC;AAmBD,eAAO,MAAM,KAAK,EAAE,MAmBnB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,MAKrB,CAAC"}
1
+ {"version":3,"file":"conditional.d.ts","sourceRoot":"","sources":["../../../src/tags/conditional.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAKV,MAAM,EAEP,MAAM,UAAU,CAAC;AAKlB,wBAAgB,MAAM,CAAC,KAAK,EAAE,GAAG,WAEhC;AAmBD,eAAO,MAAM,KAAK,EAAE,MAmBnB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,MAKrB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tokenizer/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,MAAM,MAAM,iBAAiB,GAAG;IAAE,kBAAkB,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAIjE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,SAAS,CAAC,EACR,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,IAAI,CAAC;IAC7E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,qBAAqB,CAAC,EAAE,iBAAiB,CAAC;CAC3C,CAAC;AAEF,M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"","sources":["../../../../src/tokenizer/plugins/annotations.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAEV,UAAU,EAKX,MAAM,aAAa,CAAC;AA4IrB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,EAAE,UAAU,QAM5C"}
1
+ {"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../../../src/tokenizer/plugins/annotations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,UAAU,EAKX,MAAM,aAAa,CAAC;AAkJrB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,EAAE,UAAU,QAM5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"transformer.d.ts","sourceRoot":"","sources":["../../src/transformer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAMV,MAAM,EACN,WAAW,EACZ,MAAM,SAAS,CAAC;AAEjB,KAAK,gBAAgB,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;AAE7C,eAAO,MAAM,gBAAgB,EAAE,gBAG9B,CAAC;wBAuEG,WAAW;AArEhB,wBAqEiB"}
1
+ {"version":3,"file":"transformer.d.ts","sourceRoot":"","sources":["../../src/transformer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAMV,MAAM,EACN,WAAW,EACZ,MAAM,SAAS,CAAC;AAGjB,KAAK,gBAAgB,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;AAE7C,eAAO,MAAM,gBAAgB,EAAE,gBAG9B,CAAC;wBAyEG,WAAW;AAvEhB,wBAuEiB"}
@@ -1,4 +1,4 @@
1
- import type { Node, Config, SchemaAttribute, ValidateError, ValidationError, Value } from './types';
1
+ import type { Config, Node, SchemaAttribute, ValidateError, ValidationError, Value } from './types';
2
2
  type TypeParam = NonNullable<SchemaAttribute['type']>;
3
3
  export declare function validateType(type: TypeParam, value: Value, config: Config, key: string): boolean | ValidationError[];
4
4
  export default function validator(node: Node, config: Config): ValidationError[] | Promise<ValidationError[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/validator.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,IAAI,EAEJ,MAAM,EACN,eAAe,EACf,aAAa,EACb,eAAe,EACf,KAAK,EACN,MAAM,SAAS,CAAC;AAUjB,KAAK,SAAS,GAAG,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;AAEtD,wBAAgB,YAAY,CAC1B,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,GACV,OAAO,GAAG,eAAe,EAAE,CA2B7B;AA2ED,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kDA0K3D;AAED,wBAAiB,eAAe,CAC9B,IAAI,EAAE,IAAI,EACV,OAAO,GAAE,IAAI,EAAO,GACnB,SAAS,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAI3B;AA6BD,wBAAgB,YAAY,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,2EAoBzD"}
1
+ {"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/validator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,MAAM,EAGN,IAAI,EACJ,eAAe,EACf,aAAa,EACb,eAAe,EACf,KAAK,EACN,MAAM,SAAS,CAAC;AAWjB,KAAK,SAAS,GAAG,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;AAEtD,wBAAgB,YAAY,CAC1B,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,GACV,OAAO,GAAG,eAAe,EAAE,CA2B7B;AA2ED,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kDA6K3D;AAED,wBAAiB,eAAe,CAC9B,IAAI,EAAE,IAAI,EACV,OAAO,GAAE,IAAI,EAAO,GACnB,SAAS,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAI3B;AA6BD,wBAAgB,YAAY,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,2EAoBzD"}
package/index.ts CHANGED
@@ -3,17 +3,14 @@ import Node from './src/ast/node';
3
3
  import format from './src/formatter';
4
4
  import functions from './src/functions';
5
5
  import parser from './src/parser';
6
- import * as nodes from './src/schema';
7
6
  import renderers from './src/renderers';
7
+ import * as nodes from './src/schema';
8
8
  import Tag from './src/tag';
9
9
  import tags from './src/tags';
10
10
  import { truthy } from './src/tags/conditional';
11
11
  import Tokenizer from './src/tokenizer';
12
12
  import transformer, { globalAttributes } from './src/transformer';
13
13
  import transforms from './src/transforms';
14
- import { parseTags } from './src/utils';
15
- import validator, { validateTree } from './src/validator';
16
-
17
14
  import type {
18
15
  Config,
19
16
  ParserArgs,
@@ -21,9 +18,11 @@ import type {
21
18
  Token,
22
19
  ValidateError,
23
20
  } from './src/types';
21
+ import { parseTags } from './src/utils';
22
+ import validator, { validateTree } from './src/validator';
24
23
 
25
- export * from './src/types';
26
24
  export type { TokenizerOptions } from './src/tokenizer';
25
+ export * from './src/types';
27
26
 
28
27
  const tokenizer = new Tokenizer();
29
28
 
@@ -47,7 +46,7 @@ function mergeConfig(config: Config = {}): Config {
47
46
 
48
47
  export function parse(
49
48
  content: string | Token[],
50
- args?: string | ParserArgs
49
+ args?: string | ParserArgs,
51
50
  ): Node {
52
51
  if (typeof content === 'string') content = tokenizer.tokenize(content);
53
52
  return parser(content, args);
@@ -55,15 +54,15 @@ export function parse(
55
54
 
56
55
  export function resolve<C extends Config = Config>(
57
56
  content: Node,
58
- config: C
57
+ config: C,
59
58
  ): Node;
60
59
  export function resolve<C extends Config = Config>(
61
60
  content: Node[],
62
- config: C
61
+ config: C,
63
62
  ): Node[];
64
63
  export function resolve<C extends Config = Config>(
65
64
  content: any,
66
- config: C
65
+ config: C,
67
66
  ): any {
68
67
  if (Array.isArray(content))
69
68
  return content.flatMap((child) => child.resolve(config));
@@ -73,15 +72,15 @@ export function resolve<C extends Config = Config>(
73
72
 
74
73
  export function transform<C extends Config = Config>(
75
74
  node: Node,
76
- config?: C
75
+ config?: C,
77
76
  ): RenderableTreeNode;
78
77
  export function transform<C extends Config = Config>(
79
78
  nodes: Node[],
80
- config?: C
79
+ config?: C,
81
80
  ): RenderableTreeNode[];
82
81
  export function transform<C extends Config = Config>(
83
82
  nodes: any,
84
- options?: C
83
+ options?: C,
85
84
  ): any {
86
85
  const config = mergeConfig(options);
87
86
  const content = resolve(nodes, config);
@@ -93,11 +92,11 @@ export function transform<C extends Config = Config>(
93
92
 
94
93
  export function validate<C extends Config = Config>(
95
94
  node: Node,
96
- options?: C
95
+ options?: C,
97
96
  ): ValidateError[];
98
97
  export function validate<C extends Config = Config>(
99
98
  content: any,
100
- options?: C
99
+ options?: C,
101
100
  ): any {
102
101
  const config = mergeConfig(options);
103
102
  return validateTree(content, config);
@@ -112,21 +111,21 @@ export function createElement(
112
111
  }
113
112
 
114
113
  export {
115
- nodes,
116
- tags,
114
+ Ast,
115
+ format,
117
116
  functions,
118
117
  globalAttributes,
119
- transforms,
120
- renderers,
121
- Ast,
122
118
  Node,
119
+ nodes,
120
+ parseTags,
121
+ renderers,
123
122
  Tag,
124
123
  Tokenizer,
125
- parseTags,
124
+ tags,
126
125
  transformer,
127
- validator,
126
+ transforms,
128
127
  truthy,
129
- format,
128
+ validator,
130
129
  };
131
130
 
132
131
  export default class Markdoc {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@markdoc/markdoc",
3
3
  "author": "Ryan Paul",
4
- "version": "0.5.13",
4
+ "version": "0.5.14",
5
5
  "description": "A text markup language for documentation",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.mjs",
@@ -27,24 +27,18 @@
27
27
  }
28
28
  },
29
29
  "devDependencies": {
30
- "@eslint/js": "^10.0.1",
31
- "@types/jasmine": "^7.0.0",
32
30
  "@types/node": "^24.19.2",
33
31
  "@types/react": "^19.3.0",
34
32
  "deep-assert": "0.3.0",
35
33
  "diff": "^9.0.0",
36
34
  "esbuild": "0.28.2",
37
- "eslint": "10.14.0",
38
- "globals": "^17.14.0",
39
- "jasmine": "7.0.0",
40
35
  "jest-diff": "^30.5.2",
41
36
  "markdown-it": "15.0.1",
42
37
  "pegjs": "0.11.0-master.b7b87ea",
43
- "prettier": "^3.9.10",
44
38
  "tsx": "4.23.15",
45
39
  "typedoc": "0.28.20",
46
40
  "typescript": "^6.0.3",
47
- "typescript-eslint": "^8.72.1",
41
+ "vitest": "5.0.4",
48
42
  "yaml-js": "^0.3.1"
49
43
  },
50
44
  "repository": {
@@ -57,16 +51,16 @@
57
51
  },
58
52
  "homepage": "https://markdoc.dev",
59
53
  "scripts": {
60
- "test": "node --import tsx ./node_modules/jasmine/bin/jasmine.js",
54
+ "test": "vitest run",
61
55
  "test:types": "node spec/types/check.mjs",
62
56
  "marktest": "node --import tsx ${INSPECT:+--inspect-brk} spec/marktest/index.ts spec/marktest/tests.yaml",
63
57
  "build": "pnpm run build:common && pnpm run build:types",
64
58
  "build:common": "node build.js",
65
59
  "build:types": "tsc --emitDeclarationOnly --outDir dist",
66
- "lint": "eslint .",
67
- "grammar": "pegjs -o src/grammar/tag.js src/grammar/tag.pegjs && prettier --write src/grammar/tag.js",
68
- "prettier": "prettier --write index.ts src spec",
69
- "prettier:check": "prettier --check index.ts src spec",
60
+ "lint": "biome check --error-on-warnings .",
61
+ "lint:fix": "biome check --write --error-on-warnings .",
62
+ "format": "biome format --write .",
63
+ "grammar": "pegjs -o src/grammar/tag.js src/grammar/tag.pegjs",
70
64
  "type:check": "tsc --noEmit",
71
65
  "typedoc": "typedoc index.ts --includeVersion --readme none --excludePrivate --excludeExternals --excludeInternal --sort source-order --out types"
72
66
  }
@@ -1,6 +1,8 @@
1
- declare namespace jasmine {
2
- interface Matchers<T> {
3
- toDeepEqual(expected: any, expectationFailureOutput?: T): boolean;
4
- toDeepEqualSubset(expected: any, expectationFailureOutput?: T): boolean;
1
+ import 'vitest';
2
+
3
+ declare module 'vitest' {
4
+ interface Assertion {
5
+ toDeepEqual(expected: unknown): void;
6
+ toDeepEqualSubset(expected: unknown): void;
5
7
  }
6
8
  }
package/src/ast/base.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import type {
2
+ Function as AstFunction,
2
3
  AstType,
4
+ Variable as AstVariable,
3
5
  Config,
4
- Function as AstFunction,
5
6
  Scalar,
6
- Variable as AstVariable,
7
7
  } from '../types';
8
8
  import FunctionNode from './function';
9
9
  import VariableNode from './variable';
@@ -1,5 +1,5 @@
1
+ import type { AstType, Config } from '../types';
1
2
  import { resolve } from './base';
2
- import type { Config, AstType } from '../types';
3
3
 
4
4
  export default class Function implements AstType {
5
5
  readonly $$mdtype = 'Function';
package/src/ast/index.ts CHANGED
@@ -1,9 +1,8 @@
1
- import Node from './node';
1
+ import type { AstType } from '../types';
2
+ import * as base from './base';
2
3
  import Function from './function';
4
+ import Node from './node';
3
5
  import Variable from './variable';
4
- import * as base from './base';
5
-
6
- import type { AstType } from '../types';
7
6
 
8
7
  const AstTypes = {
9
8
  Function,