@redocly/redoc-reef 0.140.0-next.3 → 0.140.0-next.5

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 (118) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/cli/generate/get-schema-template.js +1 -1
  3. package/dist/client/app/hooks/markdown/useMarkdocRenderer.js +1 -1
  4. package/dist/client/app/hooks/markdown/useMarkdownText.js +1 -1
  5. package/dist/client/app/markdoc/custom-components/openapi/use-markdown-adapter.d.ts +1 -33
  6. package/dist/constants/l10n/langs/ar.js +1 -1
  7. package/dist/constants/l10n/langs/de.js +1 -1
  8. package/dist/constants/l10n/langs/en.js +1 -1
  9. package/dist/constants/l10n/langs/es.js +1 -1
  10. package/dist/constants/l10n/langs/fr.js +1 -1
  11. package/dist/constants/l10n/langs/hi.js +1 -1
  12. package/dist/constants/l10n/langs/it.js +1 -1
  13. package/dist/constants/l10n/langs/ja.js +1 -1
  14. package/dist/constants/l10n/langs/ko.js +1 -1
  15. package/dist/constants/l10n/langs/pl.js +1 -1
  16. package/dist/constants/l10n/langs/pt-BR.js +1 -1
  17. package/dist/constants/l10n/langs/pt.js +1 -1
  18. package/dist/constants/l10n/langs/ru.js +1 -1
  19. package/dist/constants/l10n/langs/uk.js +1 -1
  20. package/dist/constants/l10n/langs/zh.js +1 -1
  21. package/dist/markdoc/attributes/definition-path.d.ts +1 -1
  22. package/dist/markdoc/attributes/json-example-ref.d.ts +1 -1
  23. package/dist/markdoc/attributes/json-schema-ref.d.ts +1 -1
  24. package/dist/markdoc/attributes/parsed-yaml.d.ts +1 -1
  25. package/dist/markdoc/attributes/raw-content.d.ts +1 -1
  26. package/dist/markdoc/attributes/sample-from-json-schema.d.ts +1 -1
  27. package/dist/markdoc/helpers/extract-rbac-from-condition-node.d.ts +1 -1
  28. package/dist/markdoc/helpers/get-inner-text.d.ts +1 -1
  29. package/dist/markdoc/helpers/get-node-attribute.d.ts +1 -1
  30. package/dist/markdoc/helpers/get-variable.d.ts +1 -1
  31. package/dist/markdoc/helpers/guards/is-conditional-node.d.ts +1 -1
  32. package/dist/markdoc/helpers/guards/is-function.d.ts +1 -1
  33. package/dist/markdoc/helpers/guards/is-node.d.ts +1 -1
  34. package/dist/markdoc/helpers/guards/is-prompt-node.d.ts +1 -1
  35. package/dist/markdoc/helpers/guards/is-tag.d.ts +1 -1
  36. package/dist/markdoc/helpers/guards/is-variable.d.ts +1 -1
  37. package/dist/markdoc/helpers/parse-partials.d.ts +1 -1
  38. package/dist/markdoc/helpers/parse-partials.js +1 -1
  39. package/dist/markdoc/helpers/remove-markdoc-tags.js +1 -1
  40. package/dist/markdoc/helpers/set-node-attribute-value.d.ts +1 -1
  41. package/dist/markdoc/nodes/fence/index.d.ts +1 -1
  42. package/dist/markdoc/nodes/fence/index.js +1 -1
  43. package/dist/markdoc/nodes/gfm-list-item.d.ts +1 -1
  44. package/dist/markdoc/nodes/gfm-list-item.js +1 -1
  45. package/dist/markdoc/nodes/heading.d.ts +1 -1
  46. package/dist/markdoc/nodes/heading.js +1 -1
  47. package/dist/markdoc/nodes/index.d.ts +6 -165
  48. package/dist/markdoc/nodes/index.js +1 -1
  49. package/dist/markdoc/nodes/table.d.ts +1 -1
  50. package/dist/markdoc/nodes/table.js +1 -1
  51. package/dist/markdoc/nodes/text.d.ts +1 -1
  52. package/dist/markdoc/tags/json-example.js +1 -1
  53. package/dist/server/esbuild/plugins/dependency-resolver.js +1 -1
  54. package/dist/server/plugins/api-docs/loader.d.ts +1 -1
  55. package/dist/server/plugins/markdown/attribute-resolvers/code-walkthrough/filesets-resolver.d.ts +1 -1
  56. package/dist/server/plugins/markdown/attribute-resolvers/helpers/load-openapi-bundle.d.ts +1 -1
  57. package/dist/server/plugins/markdown/attribute-resolvers/index.d.ts +1 -1
  58. package/dist/server/plugins/markdown/attribute-resolvers/resolve-code-snippet-from-file.d.ts +1 -1
  59. package/dist/server/plugins/markdown/attribute-resolvers/resolve-diagram-from-file.d.ts +1 -1
  60. package/dist/server/plugins/markdown/attribute-resolvers/resolve-html-href.d.ts +1 -1
  61. package/dist/server/plugins/markdown/attribute-resolvers/resolve-html-source-attribute.d.ts +1 -1
  62. package/dist/server/plugins/markdown/attribute-resolvers/resolve-image-gallery.d.ts +1 -1
  63. package/dist/server/plugins/markdown/attribute-resolvers/resolve-image-src-set.d.ts +1 -1
  64. package/dist/server/plugins/markdown/attribute-resolvers/resolve-image-src.d.ts +1 -1
  65. package/dist/server/plugins/markdown/attribute-resolvers/resolve-json-example-ref.d.ts +1 -1
  66. package/dist/server/plugins/markdown/attribute-resolvers/resolve-json-schema-ref.d.ts +1 -1
  67. package/dist/server/plugins/markdown/attribute-resolvers/resolve-link.d.ts +1 -1
  68. package/dist/server/plugins/markdown/attribute-resolvers/resolve-native-md-link.d.ts +1 -1
  69. package/dist/server/plugins/markdown/attribute-resolvers/resolve-nav-links.d.ts +1 -1
  70. package/dist/server/plugins/markdown/attribute-resolvers/resolve-open-api-ref.d.ts +1 -1
  71. package/dist/server/plugins/markdown/attribute-resolvers/resolve-openapi-code-samples.d.ts +1 -1
  72. package/dist/server/plugins/markdown/attribute-resolvers/resolve-openapi-response-samples.d.ts +1 -1
  73. package/dist/server/plugins/markdown/attribute-resolvers/resolve-parsed-yaml.d.ts +1 -1
  74. package/dist/server/plugins/markdown/attribute-resolvers/resolve-raw-content.d.ts +1 -1
  75. package/dist/server/plugins/markdown/attribute-resolvers/resolve-relative-or-cdn-icon.d.ts +1 -1
  76. package/dist/server/plugins/markdown/attribute-resolvers/resolve-relative-path.d.ts +1 -1
  77. package/dist/server/plugins/markdown/attribute-resolvers/resolve-sample-from-json-schema.d.ts +1 -1
  78. package/dist/server/plugins/markdown/attribute-resolvers/resolve-svg-content.d.ts +1 -1
  79. package/dist/server/plugins/markdown/attribute-resolvers/resolve-tag-raw-content.d.ts +1 -1
  80. package/dist/server/plugins/markdown/attribute-resolvers/resolve-tag-raw-content.js +2 -2
  81. package/dist/server/plugins/markdown/attribute-resolvers/utils.d.ts +1 -1
  82. package/dist/server/plugins/markdown/compiler.d.ts +1 -1
  83. package/dist/server/plugins/markdown/compiler.js +1 -1
  84. package/dist/server/plugins/markdown/errors.d.ts +1 -1
  85. package/dist/server/plugins/markdown/get-server-props.js +1 -1
  86. package/dist/server/plugins/markdown/html/normalize-html-headings.d.ts +1 -1
  87. package/dist/server/plugins/markdown/html/normalize-html-headings.js +1 -1
  88. package/dist/server/plugins/markdown/markdoc/functions/concat.d.ts +1 -1
  89. package/dist/server/plugins/markdown/markdoc/markdoc-options.d.ts +5 -165
  90. package/dist/server/plugins/markdown/markdoc/markdoc-options.js +1 -1
  91. package/dist/server/plugins/markdown/markdoc/partials.d.ts +1 -1
  92. package/dist/server/plugins/markdown/markdoc/plugins/headings.d.ts +1 -1
  93. package/dist/server/plugins/markdown/markdoc/plugins/utils.d.ts +1 -1
  94. package/dist/server/plugins/markdown/markdoc/reparse-example-fences.d.ts +1 -1
  95. package/dist/server/plugins/markdown/markdoc/reparse-example-fences.js +1 -1
  96. package/dist/server/plugins/markdown/runtime-transform.d.ts +2 -2
  97. package/dist/server/plugins/markdown/runtime-transform.js +1 -1
  98. package/dist/server/plugins/markdown/search/get-ai-search-documents.js +1 -1
  99. package/dist/server/plugins/markdown/search/nodes/section-node.d.ts +1 -1
  100. package/dist/server/plugins/markdown/search/search-resolver.js +1 -1
  101. package/dist/server/plugins/markdown/search/to-markdown.d.ts +1 -1
  102. package/dist/server/plugins/markdown/search/walk-sections.d.ts +1 -1
  103. package/dist/server/plugins/markdown/search/walk-sections.js +1 -1
  104. package/dist/server/plugins/markdown/utils/stringify-tag-children-objects.d.ts +1 -1
  105. package/dist/server/store.d.ts +1 -1
  106. package/dist/server/store.js +1 -1
  107. package/dist/server/types/plugins/common.d.ts +1 -1
  108. package/dist/server/utils/codeframes/codeframes.d.ts +1 -1
  109. package/dist/server/utils/codeframes/yaml-ast.d.ts +1 -1
  110. package/dist/types/errors.d.ts +1 -1
  111. package/dist/types/markdoc.d.ts +1 -1
  112. package/package.json +6 -6
  113. package/dist/server/plugins/markdown/html/html-jsx-attribute-mapping.d.ts +0 -6
  114. package/dist/server/plugins/markdown/html/html-jsx-attribute-mapping.js +0 -1
  115. package/dist/server/plugins/markdown/html/process-html-tokens.d.ts +0 -2
  116. package/dist/server/plugins/markdown/html/process-html-tokens.js +0 -1
  117. package/dist/server/plugins/markdown/source.d.ts +0 -4
  118. package/dist/server/plugins/markdown/source.js +0 -1
@@ -1 +1 @@
1
- import l from"@markdoc/markdoc";import{SampleFromJsonSchema as m,JsonExampleRef as n}from"../attributes/index.js";const v={schema:{attributes:{value:{type:n,required:!1},schema:{type:m,required:!1},mode:{type:String,matches:["read","write"],required:!1},title:{type:String,required:!1},valueResolved:{required:!1},valueResolvedErrors:{type:Array,default:[]},schemaResolved:{required:!1},schemaResolvedErrors:{type:Array,default:[]}},render:"JsonExample",selfClosing:!0,dynamicComponentLib:"openapi",transform:(e,r)=>{const o=e.transformAttributes(r),{valueResolved:a,schemaResolved:u,schemaResolvedErrors:i,valueResolvedErrors:t,title:s}=o;return a||t.length?new l.Tag("JsonExample",{title:s,json:a,errors:t}):new l.Tag("JsonExample",{title:s,json:u,errors:i})},validate(e){const r=[];return e.attributes.schema&&e.attributes.value&&r.push({id:"schema-and-value-attributes-are-mutually-exclusive",level:"error",message:'The "schema" and "value" attributes are mutually exclusive, you can only use one.'}),!e.attributes.schema&&!e.attributes.value&&r.push({id:"schema-or-value-attribute-required",level:"error",message:'This tag requires the "schema" or "value" attribute to render correctly.'}),r}},tagName:"json-example"};export{v as jsonExample};
1
+ import l from"@redocly/markdoc";import{SampleFromJsonSchema as m,JsonExampleRef as n}from"../attributes/index.js";const v={schema:{attributes:{value:{type:n,required:!1},schema:{type:m,required:!1},mode:{type:String,matches:["read","write"],required:!1},title:{type:String,required:!1},valueResolved:{required:!1},valueResolvedErrors:{type:Array,default:[]},schemaResolved:{required:!1},schemaResolvedErrors:{type:Array,default:[]}},render:"JsonExample",selfClosing:!0,dynamicComponentLib:"openapi",transform:(e,r)=>{const o=e.transformAttributes(r),{valueResolved:a,schemaResolved:u,schemaResolvedErrors:i,valueResolvedErrors:t,title:s}=o;return a||t.length?new l.Tag("JsonExample",{title:s,json:a,errors:t}):new l.Tag("JsonExample",{title:s,json:u,errors:i})},validate(e){const r=[];return e.attributes.schema&&e.attributes.value&&r.push({id:"schema-and-value-attributes-are-mutually-exclusive",level:"error",message:'The "schema" and "value" attributes are mutually exclusive, you can only use one.'}),!e.attributes.schema&&!e.attributes.value&&r.push({id:"schema-or-value-attribute-required",level:"error",message:'This tag requires the "schema" or "value" attribute to render correctly.'}),r}},tagName:"json-example"};export{v as jsonExample};
@@ -1 +1 @@
1
- import{generatePortalResolverDir as a}from"./codegen/generate-resolver-dir.js";const d=()=>{const t={},l=a(),p=["react","styled-components"];return{name:"dependency-resolver",setup(n){for(const c of p){const i=r(c);n.onResolve({filter:i,namespace:"file"},async e=>{if(e.resolveDir==="")return;if(t[e.path]!==void 0)return t[e.path];const o=!!n.initialOptions.external?.some(s=>r(s).test(e.path));return o?(t[e.path]=Promise.resolve({path:e.path,external:o}),t[e.path]):(t[e.path]=n.resolve(e.path,{kind:e.kind,resolveDir:l}),t[e.path])})}}}};function r(t){return new RegExp(`^${t}(/|$)`)}export{d as DependencyResolver};
1
+ import{generatePortalResolverDir as u}from"./codegen/generate-resolver-dir.js";const l={"@markdoc/markdoc":"@redocly/markdoc"},v=()=>{const t={},a=u(),i=["react","styled-components",...Object.keys(l)];return{name:"dependency-resolver",setup(n){for(const o of i){const p=s(o),m=l[o]??o;n.onResolve({filter:p,namespace:"file"},async e=>{if(e.resolveDir==="")return;if(t[e.path]!==void 0)return t[e.path];const r=m+e.path.slice(o.length),c=!!n.initialOptions.external?.some(d=>s(d).test(r));return c?(t[e.path]=Promise.resolve({path:r,external:c}),t[e.path]):(t[e.path]=n.resolve(r,{kind:e.kind,resolveDir:a}),t[e.path])})}}}};function s(t){return new RegExp(`^${t}(/|$)`)}export{v as DependencyResolver};
@@ -1,6 +1,6 @@
1
1
  import { type ASTNode, type DocumentNode } from 'graphql';
2
2
  import type { OpenAPIDefinition, AsyncApiDefinition, ApiSpecType, RawApiDocsOptions } from '@redocly/api-docs';
3
- import type { Node as MarkdocNode } from '@markdoc/markdoc';
3
+ import type { Node as MarkdocNode } from '@redocly/markdoc';
4
4
  import type { LifecycleContext } from '../../types';
5
5
  import type { RedoclyConfig } from '@redocly/config';
6
6
  export type MarkdocChunk = {
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { MarkdocResolveContext } from '../../../../types';
3
3
  export declare function resolveCodeWalkthroughFilesets(node: Node, attributeName: string, pageRelativePath: string, markdocResolveContext: MarkdocResolveContext): Promise<void>;
4
4
  //# sourceMappingURL=filesets-resolver.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { OpenAPIDefinition, RawApiDocsOptions } from '@redocly/api-docs';
3
3
  import type { LifecycleContext } from '../../../../types';
4
4
  export type OpenapiBundle = {
@@ -1,5 +1,5 @@
1
1
  import type { MarkdocResolveContext, WithOriginalAttr } from '../../../types';
2
- import type { Node } from '@markdoc/markdoc';
2
+ import type { Node } from '@redocly/markdoc';
3
3
  type ResolverFunction = (node: WithOriginalAttr<Node>, attrName: string, relativePath: string, context: MarkdocResolveContext) => Promise<{
4
4
  sharedDataId?: string;
5
5
  } | undefined | void>;
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { MarkdocResolveContext, WithOriginalAttr } from '../../../types';
3
3
  export declare function resolveCodeSnippetFromFile(node: WithOriginalAttr<Node>, attributeName: string, pageRelativePath: string, { actions: { contentDir }, context }: MarkdocResolveContext): Promise<void>;
4
4
  //# sourceMappingURL=resolve-code-snippet-from-file.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { MarkdocResolveContext, WithOriginalAttr } from '../../../types';
3
3
  export declare function resolveDiagramFromFile(node: WithOriginalAttr<Node>, attributeName: string, pageRelativePath: string, { actions: { contentDir }, context }: MarkdocResolveContext): Promise<void>;
4
4
  //# sourceMappingURL=resolve-diagram-from-file.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { MarkdocResolveContext, WithOriginalAttr } from '../../../types';
3
3
  /**
4
4
  * Resolves HTML href attributes (e.g., `<a href="...">`) using the existing `resolveLink` logic
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { MarkdocResolveContext, WithOriginalAttr } from '../../../types';
3
3
  export declare function resolveHtmlSourceAttribute(node: WithOriginalAttr<Node>, attributeName: string, pageRelativePath: string, { actions: { contentDir, outdir, getRouteBySlug }, context }: MarkdocResolveContext): Promise<void>;
4
4
  //# sourceMappingURL=resolve-html-source-attribute.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { MarkdocResolveContext, WithOriginalAttr } from '../../../types';
3
3
  export declare function resolveImageGallery(node: WithOriginalAttr<Node>, attributeName: string, pageRelativePath: string, { actions: { contentDir, outdir }, context }: MarkdocResolveContext): Promise<void>;
4
4
  //# sourceMappingURL=resolve-image-gallery.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { MarkdocResolveContext, WithOriginalAttr } from '../../../types';
3
3
  export declare function resolveImageSrcSet(node: WithOriginalAttr<Node>, attributeName: string, pageRelativePath: string, { actions: { contentDir, outdir }, context }: MarkdocResolveContext): Promise<void>;
4
4
  //# sourceMappingURL=resolve-image-src-set.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { MarkdocResolveContext, WithOriginalAttr } from '../../../types';
3
3
  export declare function resolveImageSrc(node: WithOriginalAttr<Node>, attributeName: string, pageRelativePath: string, { actions: { contentDir, outdir }, context }: MarkdocResolveContext): Promise<void>;
4
4
  //# sourceMappingURL=resolve-image-src.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { MarkdocResolveContext } from '../../../types';
3
3
  export declare function resolveJsonExampleRef(node: Node, attrName: string, relativePath: string, { context, actions }: MarkdocResolveContext): Promise<void>;
4
4
  //# sourceMappingURL=resolve-json-example-ref.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { MarkdocResolveContext } from '../../../types';
3
3
  export declare function resolveJsonSchemaRef(node: Node, attrName: string, relativePath: string, { context, actions }: MarkdocResolveContext): Promise<{
4
4
  sharedDataId?: string;
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { MarkdocResolveContext, WithOriginalAttr } from '../../../types';
3
3
  export declare function resolveLink(node: WithOriginalAttr<Node>, attributeName: string, fromPage: string, { actions, context }: MarkdocResolveContext): Promise<{
4
4
  sharedDataId?: string;
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { MarkdocResolveContext, WithOriginalAttr } from '../../../types';
3
3
  /**
4
4
  * Resolves native Markdown links/images (e.g., `[]()` or `![]()`) using `resolveLink` and then applies the global
@@ -1,4 +1,4 @@
1
1
  import type { MarkdocResolveContext, WithOriginalAttr } from '../../../types';
2
- import type { Node } from '@markdoc/markdoc';
2
+ import type { Node } from '@redocly/markdoc';
3
3
  export declare function resolveNavLinks(node: WithOriginalAttr<Node, any>, attrName: string, relativePath: string, { context, actions }: MarkdocResolveContext): Promise<void>;
4
4
  //# sourceMappingURL=resolve-nav-links.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { MarkdocResolveContext, WithOriginalAttr } from '../../../types';
3
3
  export declare function resolveOpenApiRef(node: WithOriginalAttr<Node>, attrName: string, relativePath: string, { context }: MarkdocResolveContext): Promise<{
4
4
  sharedDataId: string;
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { MarkdocResolveContext } from '../../../types';
3
3
  export declare function resolveOpenapiCodeSamples(node: Node, attrName: string, _relativePath: string, { context }: MarkdocResolveContext): Promise<void>;
4
4
  //# sourceMappingURL=resolve-openapi-code-samples.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { MarkdocResolveContext } from '../../../types';
3
3
  export declare function resolveOpenapiResponseSamples(node: Node, attrName: string, _relativePath: string, { context }: MarkdocResolveContext): Promise<void>;
4
4
  //# sourceMappingURL=resolve-openapi-response-samples.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { MarkdocResolveContext } from '../../../types';
3
3
  export declare function resolveParsedYaml(node: Node, attrName: string, relativePath: string, { context }: MarkdocResolveContext): Promise<void>;
4
4
  //# sourceMappingURL=resolve-parsed-yaml.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { MarkdocResolveContext } from '../../../types';
3
3
  export declare function resolveRawContent(node: Node, attrName: string, relativePath: string, { context, actions }: MarkdocResolveContext): Promise<void>;
4
4
  //# sourceMappingURL=resolve-raw-content.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { MarkdocResolveContext, WithOriginalAttr } from '../../../types';
3
3
  export declare function resolveRelativeOrCdnIcon(node: WithOriginalAttr<Node>, attrName: string, relativePath: string, { context, actions }: MarkdocResolveContext): Promise<void>;
4
4
  //# sourceMappingURL=resolve-relative-or-cdn-icon.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { MarkdocResolveContext, WithOriginalAttr } from '../../../types';
3
3
  export declare function resolveRelativePath(node: WithOriginalAttr<Node>, attrName: string, relativePath: string, context: MarkdocResolveContext): Promise<void>;
4
4
  //# sourceMappingURL=resolve-relative-path.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { MarkdocResolveContext } from '../../../types';
3
3
  export declare function resolveSampleFromJsonSchema(node: Node, attrName: string, relativePath: string, { context, actions }: MarkdocResolveContext): Promise<void>;
4
4
  //# sourceMappingURL=resolve-sample-from-json-schema.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { MarkdocResolveContext } from '../../../types';
3
3
  export declare function resolveSvgContent(node: Node, attrName: string, relativePath: string, { context, actions }: MarkdocResolveContext): Promise<void>;
4
4
  //# sourceMappingURL=resolve-svg-content.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { MarkdocResolveContext } from '../../../types';
3
3
  export declare function resolveTagRawContent(node: Node, attrName: string, _relativePath: string, { readSourceLines }: MarkdocResolveContext): Promise<void>;
4
4
  //# sourceMappingURL=resolve-tag-raw-content.d.ts.map
@@ -1,2 +1,2 @@
1
- import l from"@markdoc/markdoc";import{setNodeAttributeValue as u}from"../../../../markdoc/helpers/set-node-attribute-value.js";async function P(t,r,e,{readSourceLines:n}){if(t.children.length===0&&typeof t.attributes[r]=="string")return;if(t.inline){u(t,r,m(t)),t.children=[];return}if(n===void 0)return;const[i,c,o]=t.lines;if(i===void 0||c===void 0||o===void 0)return;const s=n(),f=p(s[i]??""),a=s.slice(c,o).map(h=>g(h,f)),d=b(a).join(`
2
- `).replace(/^(?:[ \t]*\n)+/,"").trimEnd();u(t,r,d),t.children=[]}function m(t){return l.format(new l.Ast.Node("inline",{},t.children)).trim()}function p(t){return t.slice(0,Math.max(t.indexOf("{%"),0)).split(">").length-1}function g(t,r){let e=t;for(let n=0;n<r;n+=1){const i=e.match(/^ {0,3}> ?/);if(!i)break;e=e.slice(i[0].length)}return e}function b(t){const r=t.filter(n=>n.trim()!=="").map(n=>n.match(/^[ \t]*/)?.[0]??""),e=r.reduce(x,r[0]??"");return t.map(n=>n.startsWith(e)?n.slice(e.length):n.trimStart())}function x(t,r){let e=0;for(;e<t.length&&e<r.length&&t[e]===r[e];)e+=1;return t.slice(0,e)}export{P as resolveTagRawContent};
1
+ import s from"@redocly/markdoc";import{setNodeAttributeValue as c}from"../../../../markdoc/helpers/set-node-attribute-value.js";async function k(t,i,e,{readSourceLines:n}){if(t.children.length===0&&typeof t.attributes[i]=="string")return;if(t.inline){c(t,i,p(t)),t.children=[];return}if(n===void 0)return;const r=t.location?.start.line,f=t.location?.end.line;if(r===void 0||f===void 0)return;const l=n(),o=g(l.slice(r,f),t.tag);if(o===void 0)return;const u=x(l[r]??""),d=l.slice(r+o.start,r+o.end).map(h=>w(h,u)),a=y(d).join(`
2
+ `).replace(/^(?:[ \t]*\n)+/,"").trimEnd();c(t,i,a),t.children=[]}function g(t,i){const e=m(t);if(e===void 0||i===void 0)return;const n=new RegExp(`\\{%\\s*/${i}(?![\\w-])`);let r=t.length-1;for(;r>e&&!n.test(t[r]??"");)r-=1;return r>e?{start:e+1,end:r}:void 0}function m(t){let i=!1;for(let e=0;e<t.length;e+=1){const n=t[e]??"";for(let r=e===0?n.indexOf("{%")+2:0;r<n.length;r+=1)if(i)n[r]==="\\"?r+=1:n[r]==='"'&&(i=!1);else if(n[r]==='"')i=!0;else if(n[r]==="%"&&n[r+1]==="}")return e}}function p(t){return s.format(new s.Ast.Node("inline",{},t.children)).trim()}function x(t){return t.slice(0,Math.max(t.indexOf("{%"),0)).split(">").length-1}function w(t,i){let e=t;for(let n=0;n<i;n+=1){const r=e.match(/^ {0,3}> ?/);if(!r)break;e=e.slice(r[0].length)}return e}function y(t){const i=t.filter(n=>n.trim()!=="").map(n=>n.match(/^[ \t]*/)?.[0]??""),e=i.reduce(E,i[0]??"");return t.map(n=>n.startsWith(e)?n.slice(e.length):n.trimStart())}function E(t,i){let e=0;for(;e<t.length&&e<i.length&&t[e]===i[e];)e+=1;return t.slice(0,e)}export{k as resolveTagRawContent};
@@ -1,4 +1,4 @@
1
- import type { Node, Tag } from '@markdoc/markdoc';
1
+ import type { Node, Tag } from '@redocly/markdoc';
2
2
  export declare function getLinkOriginalAttrName(attributeName: string): `redocly:::linkOriginal:${string}`;
3
3
  export declare function getOptionalAttribute<T>(node: Node | Tag, attrName: string): T | undefined;
4
4
  //# sourceMappingURL=utils.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { Config, Node, ValidationType } from '@markdoc/markdoc';
1
+ import type { Config, Node, ValidationType } from '@redocly/markdoc';
2
2
  import type { Store } from '../../store.js';
3
3
  import type { LifecycleContext, MarkdownParseInput, MarkdocResolveContext } from '../../types';
4
4
  import type { MarkdocError } from '../../../types/index.js';
@@ -1 +1 @@
1
- import M from"@markdoc/markdoc";import*as _ from"path";import{GATED_MARKDOC_TAGS as F}from"../../constants/entitlements.js";import{logger as H}from"../../tools/notifiers/logger.js";import{reporter as z}from"../../tools/notifiers/reporter.js";import{sha1 as B}from"../../utils/crypto/sha1.js";import{formatMarkdocError as G}from"./errors.js";import{extractFirstHeading as C,SKIP as K,visit as j}from"./markdoc/plugins/utils.js";import{isPromptNode as $}from"../../../markdoc/helpers/guards/is-prompt-node.js";import{attributeResolvers as R}from"./attribute-resolvers/index.js";import{MdResolveError as V}from"./attribute-resolvers/md-resolve-error.js";import{processHtmlTokens as q}from"./html/process-html-tokens.js";import{normalizeHtmlHeadings as J}from"./html/normalize-html-headings.js";import{resolveRawPartials as Q}from"./markdoc/resolve-raw-partials.js";import{exampleContentTrees as X,reparseExampleFences as Z}from"./markdoc/reparse-example-fences.js";import{EntitlementsProvider as tt}from"../../entitlements/entitlements-provider.js";import{MARKDOC_PARTIALS_DEPS_KEY as et}from"../../constants/common.js";import{getLinkOriginalAttrName as at}from"./attribute-resolvers/utils.js";import{createSourceLinesReader as rt}from"./create-source-lines-reader.js";const ot="EMPTY";async function st(e,o,a){const n=tt.instance(),{actions:s}=a,{relativePath:l,resolveErrors:E}=e,w={...a,readSourceLines:rt(e.rawContent)},g=new Set,u=new Set,m=new Set,b=new Set,c={},y=new Set,L={},T={};function P(t,r){const D=r||ot;t[D]=(t[D]||0)+1}const I=[];e.resolveErrors.length=0;const x=X(e.ast),O=t=>{const r=D();I.push(r.then(k=>{k?.sharedDataIds&&k.sharedDataIds.forEach(d=>g.add(d))}).catch(Y(t)));async function D(){const k=[];switch(t.type){case"fence":P(L,t.attributes.language);break;case"link":case"image":await R.nativeMdLink(t,t.type==="link"?"href":"src",l,w);break;case"tag":{if(!t.tag)break;const d=o?.tags?.[t.tag];if(!d){F[t.tag]&&!n.canAccessFeature(F[t.tag])&&(t.errors.push({level:"warning",id:"invalid-tag",message:`Undefined tag: ${t.tag}`}),t.tag="",t.type="error",t.attributes={});break}const v=t.tag==="html"?t.attributes.name:t.tag;if((t.tag==="html"?y:b).add(v),c[v]=(c[v]||0)+1,v==="code-snippet"&&P(L,t.attributes.language),d.attributes?.__idx&&(t.attributes.__idx=c[t.tag]),d.dynamicComponentLib&&u.add(d.dynamicComponentLib),!d.attributes)break;if(v==="partial"&&t.attributes?.file){const i=at("file"),f=t[i]||t.attributes.file,h=f.startsWith("/")?f.slice(1):_.posix.normalize(_.posix.join(_.posix.dirname(l),f));m.add(h);const p=(s.getGlobalConfig(et)||{})[h];if(p?.dynamicComponents)for(const S of p.dynamicComponents)u.add(S);if(p?.sharedDataDeps)for(const S of p.sharedDataDeps)g.add(S)}for(const[i,f]of Object.entries(d.attributes)){const h=f.type;if(h&&(h.resolver||f.resolver)){const N=R[h.resolver||f.resolver],p=await N?.(t,i,l,w);p?.sharedDataId&&k.push(p.sharedDataId)}}if(v==="code-walkthrough")for(const i of t.attributes.resolvedFilesets||[])for(const f of i.files||[])P(T,f.language);const A=t.attributes?.attrs;if(A&&t.tag==="html")for(const i of Object.keys(A))i==="src"||i==="srcSet"?await R.htmlSourceAttribute(t,i,l,w):i==="href"&&await R.htmlHref(t,i,l,w);break}}return{sharedDataIds:k}}};function Y(t){return async r=>{if(!(r instanceof V)){await z.panicOnBuild(r.message);return}E.push(G({type:"resolve_link",meta:{...r.meta,link:r.meta.link??r.meta.rawLink},lines:t.lines,location:t.location,error:{id:"",level:"error",message:r.message,location:t.location}},e.relativePath,e.rawContent))}}j(e.ast,t=>(O(t),$(t)?K:void 0));for(const t of x)j(t,r=>(r.type==="tag"&&O(r),$(r)?K:void 0));return await Promise.all(I),e.sharedDataDeps=g,e.dynamicMarkdocComponents=u,e.validatedAtRevision<s.buildRevision&&(e.markdocErrors=[e.ast,...x].flatMap(t=>M.validate(t,o)).map(t=>G(t,l,e.rawContent)),e.validatedAtRevision=s.buildRevision),{sharedDataDeps:e.sharedDataDeps,dynamicMarkdocComponents:Array.from(e.dynamicMarkdocComponents?.values()??[]),partials:Array.from(m),tagList:Array.from(b),htmlTagsList:Array.from(y),tagOccurrence:c,codeSnippetLanguages:L,codeWalkthroughLanguages:T}}const U=new M.Tokenizer({html:!0,allowIndentation:!0,allowComments:!0});U.parser.block.ruler.getRules("reference").length=0;function W(e,o){const a=U.tokenize(e),n=q(a),s=M.parse(n,o);return J(s),s}function it(e,o){const a=W(o,{file:e,slots:!0});return Z(a,s=>W(s,{file:e})),{ast:a,rawContent:o,resolveErrors:[],markdocErrors:[],relativePath:e,sharedDataDeps:void 0,validatedAtRevision:-1}}async function Pt(e,o){const{data:a}=await o.cache.load(e,"markdown-ast");return C(a.ast)}async function St(e,o){z.clearMarkdocProblems();const a=e.getAllRoutes();let n=0;const s=H.isInteractive();for(const l of a)await e.resolveRouteStaticData(l,o,!0),n++,s&&n%100===0&&H.logInFooter("validate",` \u{1F50D} Status: validating markdoc (${n}/${a.length})`)}async function Mt(e,o,a,n){const s=e.content?B(e.content):"";return await a.context.cache.load(n||e.relativePath,{loader:E,name:"markdown-inline-parser"},[s,String(a.actions.buildRevision)]);async function E(w,g,u){let m;if(e.content){const c=await g.getConfig(),y=await Q(e.content,e.relativePath,c.markdown?.partialsFolders,g);m=it(e.relativePath,y)}else m=(await g.cache.load(e.relativePath,"markdown-ast")).data;let b={};if(a.actions.buildRevision!==0&&(b=await st(m,o,a)),!e.isVirtual){for(const c of m.markdocErrors)u(c);for(const c of m.resolveErrors)u(c)}return{ast:m.ast,info:b}}}export{Pt as extractMdFirstHeading,it as getAst,Mt as parseAndResolveMarkdoc,st as resolveAndValidateMarkdoc,St as validateAllMarkdowns};
1
+ import N from"@redocly/markdoc";import{htmlTags as B}from"@redocly/markdoc/html";import*as M from"path";import{convertGithubAlertToAdmonition as H}from"@redocly/theme/markdoc/tags/admonition";import{GATED_MARKDOC_TAGS as F}from"../../constants/entitlements.js";import{logger as G}from"../../tools/notifiers/logger.js";import{reporter as K}from"../../tools/notifiers/reporter.js";import{sha1 as V}from"../../utils/crypto/sha1.js";import{formatMarkdocError as U}from"./errors.js";import{extractFirstHeading as q,SKIP as j,visit as $}from"./markdoc/plugins/utils.js";import{isPromptNode as z}from"../../../markdoc/helpers/guards/is-prompt-node.js";import{attributeResolvers as E}from"./attribute-resolvers/index.js";import{MdResolveError as J}from"./attribute-resolvers/md-resolve-error.js";import{normalizeHtmlHeadings as Q}from"./html/normalize-html-headings.js";import{resolveRawPartials as X}from"./markdoc/resolve-raw-partials.js";import{exampleContentTrees as Z,reparseExampleFences as tt}from"./markdoc/reparse-example-fences.js";import{EntitlementsProvider as at}from"../../entitlements/entitlements-provider.js";import{MARKDOC_PARTIALS_DEPS_KEY as rt}from"../../constants/common.js";import{getLinkOriginalAttrName as et}from"./attribute-resolvers/utils.js";import{createSourceLinesReader as ot}from"./create-source-lines-reader.js";const it="EMPTY";async function st(a,r,e){const f=at.instance(),{actions:n}=e,{relativePath:c,resolveErrors:S}=a,w={...e,readSourceLines:ot(a.rawContent)},g=new Set,u=new Set,l=new Set,b=new Set,s={},D=new Set,L={},_={};function P(t,o){const k=o||it;t[k]=(t[k]||0)+1}const T=[];a.resolveErrors.length=0;const A=Z(a.ast),I=t=>{H(t);const o=k();T.push(o.then(y=>{y?.sharedDataIds&&y.sharedDataIds.forEach(d=>g.add(d))}).catch(Y(t)));async function k(){const y=[];switch(t.type){case"fence":P(L,t.attributes.language);break;case"link":case"image":await E.nativeMdLink(t,t.type==="link"?"href":"src",c,w);break;case"tag":{if(!t.tag)break;const d=r?.tags?.[t.tag];if(!d){F[t.tag]&&!f.canAccessFeature(F[t.tag])&&(t.addError({level:"warning",id:"invalid-tag",message:`Undefined tag: ${t.tag}`}),t.tag="",t.type="error",t.attributes={});break}const v=t.tag==="html"?t.attributes.name:t.tag;if((t.tag==="html"?D:b).add(v),s[v]=(s[v]||0)+1,v==="code-snippet"&&P(L,t.attributes.language),d.attributes?.__idx&&(t.attributes.__idx=s[t.tag]),d.dynamicComponentLib&&u.add(d.dynamicComponentLib),!d.attributes)break;if(v==="partial"&&t.attributes?.file){const i=et("file"),m=t[i]||t.attributes.file,h=m.startsWith("/")?m.slice(1):M.posix.normalize(M.posix.join(M.posix.dirname(c),m));l.add(h);const p=(n.getGlobalConfig(rt)||{})[h];if(p?.dynamicComponents)for(const R of p.dynamicComponents)u.add(R);if(p?.sharedDataDeps)for(const R of p.sharedDataDeps)g.add(R)}for(const[i,m]of Object.entries(d.attributes)){const h=m.type;if(h&&(h.resolver||m.resolver)){const x=E[h.resolver||m.resolver],p=await x?.(t,i,c,w);p?.sharedDataId&&y.push(p.sharedDataId)}}if(v==="code-walkthrough")for(const i of t.attributes.resolvedFilesets||[])for(const m of i.files||[])P(_,m.language);const O=t.attributes?.attrs;if(O&&t.tag==="html")for(const i of Object.keys(O))i==="src"||i==="srcSet"?await E.htmlSourceAttribute(t,i,c,w):i==="href"&&await E.htmlHref(t,i,c,w);break}}return{sharedDataIds:y}}};function Y(t){return async o=>{if(!(o instanceof J)){await K.panicOnBuild(o.message);return}S.push(U({type:"resolve_link",meta:{...o.meta,link:o.meta.link??o.meta.rawLink},lines:t.location?[t.location.start.line,t.location.end.line]:[],location:t.location,error:{id:"",level:"error",message:o.message,location:t.location}},a.relativePath,a.rawContent))}}$(a.ast,t=>(I(t),z(t)?j:void 0));for(const t of A)$(t,o=>(H(o),o.type==="tag"&&I(o),z(o)?j:void 0));return await Promise.all(T),a.sharedDataDeps=g,a.dynamicMarkdocComponents=u,a.validatedAtRevision<n.buildRevision&&(a.markdocErrors=[a.ast,...A].flatMap(t=>N.validate(t,r)).map(t=>U(t,c,a.rawContent)),a.validatedAtRevision=n.buildRevision),{sharedDataDeps:a.sharedDataDeps,dynamicMarkdocComponents:Array.from(a.dynamicMarkdocComponents?.values()??[]),partials:Array.from(l),tagList:Array.from(b),htmlTagsList:Array.from(D),tagOccurrence:s,codeSnippetLanguages:L,codeWalkthroughLanguages:_}}const C="unclosed-html",nt={html:B({errorTag:C}),allowIndentation:!0,allowComments:!0};function W(a,r){const e=N.parse(a,{...nt,...r});return ct(e),Q(e),e}function ct(a){for(const r of a.walk())r.type!=="tag"||r.tag!==C||(r.type="error",r.errors.push({id:"parse-error",level:"critical",message:String(r.attributes.message),location:r.location}))}function lt(a,r){const e=W(r,{file:a,slots:!0});return tt(e,n=>W(n,{file:a})),{ast:e,rawContent:r,resolveErrors:[],markdocErrors:[],relativePath:a,sharedDataDeps:void 0,validatedAtRevision:-1}}async function Tt(a,r){const{data:e}=await r.cache.load(a,"markdown-ast");return q(e.ast)}async function At(a,r){K.clearMarkdocProblems();const e=a.getAllRoutes();let f=0;const n=G.isInteractive();for(const c of e)await a.resolveRouteStaticData(c,r,!0),f++,n&&f%100===0&&G.logInFooter("validate",` \u{1F50D} Status: validating markdoc (${f}/${e.length})`)}async function It(a,r,e,f){const n=a.content?V(a.content):"";return await e.context.cache.load(f||a.relativePath,{loader:S,name:"markdown-inline-parser"},[n,String(e.actions.buildRevision)]);async function S(w,g,u){let l;if(a.content){const s=await g.getConfig(),D=await X(a.content,a.relativePath,s.markdown?.partialsFolders,g);l=lt(a.relativePath,D)}else l=(await g.cache.load(a.relativePath,"markdown-ast")).data;let b={};if(e.actions.buildRevision!==0&&(b=await st(l,r,e)),!a.isVirtual){for(const s of l.markdocErrors)u(s);for(const s of l.resolveErrors)u(s)}return{ast:l.ast,info:b}}}export{Tt as extractMdFirstHeading,lt as getAst,It as parseAndResolveMarkdoc,st as resolveAndValidateMarkdoc,At as validateAllMarkdowns};
@@ -1,5 +1,5 @@
1
1
  import type { NormalizedProblem } from '@redocly/openapi-core';
2
- import type { ValidateError, LocationEdge } from '@markdoc/markdoc';
2
+ import type { ValidateError, LocationEdge } from '@redocly/markdoc';
3
3
  import type { MarkdocError, BrokenLinkType } from '../../../types/index.js';
4
4
  export type ValidateErrorWithMeta = ValidateError & {
5
5
  meta?: {
@@ -1 +1 @@
1
- import e from"@markdoc/markdoc";import{getPublicEnvVariables as u}from"../../utils/envs/get-public-env-variables.js";import{transformMdAst as i}from"./runtime-transform";const v=async(A,o,t,s)=>{const{ast:l,frontmatter:r,props:n,editPage:f,lastModified:m,isTranslationFallback:b}=o,{headings:d,renderableAst:p}=await i(e.Ast.fromJSON(l),{partials:t.partials,variables:{frontmatter:r,...t.variables,env:u()}},s.serverOutDir);return Array.isArray(r.banner)&&(r.banner=await Promise.all(r.banner.map(async a=>{if(a.ast){const{renderableAst:c}=await i(e.Ast.fromJSON(a.ast),{partials:{},variables:{}},s.serverOutDir);return{...a,ast:c}}return a}))),{...n,ast:p,headings:d,frontmatter:r,editPage:f,lastModified:m,...b?{isTranslationFallback:!0}:{}}};var k=v;export{k as default};
1
+ import e from"@redocly/markdoc";import{getPublicEnvVariables as u}from"../../utils/envs/get-public-env-variables.js";import{transformMdAst as i}from"./runtime-transform";const v=async(A,o,t,s)=>{const{ast:l,frontmatter:r,props:n,editPage:f,lastModified:m,isTranslationFallback:b}=o,{headings:d,renderableAst:p}=await i(e.Ast.fromJSON(l),{partials:t.partials,variables:{frontmatter:r,...t.variables,env:u()}},s.serverOutDir);return Array.isArray(r.banner)&&(r.banner=await Promise.all(r.banner.map(async a=>{if(a.ast){const{renderableAst:c}=await i(e.Ast.fromJSON(a.ast),{partials:{},variables:{}},s.serverOutDir);return{...a,ast:c}}return a}))),{...n,ast:p,headings:d,frontmatter:r,editPage:f,lastModified:m,...b?{isTranslationFallback:!0}:{}}};var k=v;export{k as default};
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  /**
3
3
  * Rewrites block-level raw HTML `<h1>`…`<h6>` elements into Markdoc `heading` nodes,
4
4
  * so they get an anchor id, a TOC entry and a search section like Markdown headings.
@@ -1 +1 @@
1
- import s from"@markdoc/markdoc";const o=/^h([1-6])$/;function u(t){r(t,!1)}function r(t,i){const n=i||t.type==="inline";t.children=t.children.map(e=>{const l=(n?void 0:a(e))??e;return r(l,n),l});for(const e of Object.values(t.slots))r(e,n)}function a(t){if(t.type!=="tag"||t.tag!=="html")return;const i=o.exec(t.attributes.name)?.[1];if(!i)return;const n=t.attributes.attrs?.id,e=new s.Ast.Node("heading",{level:Number(i),...typeof n=="string"&&{id:n}},[new s.Ast.Node("inline",{},t.children)]);return e.lines=t.lines,e.location=t.location,e}export{u as normalizeHtmlHeadings};
1
+ import l from"@redocly/markdoc";const s=/^h([1-6])$/;function u(t){r(t,!1)}function r(t,i){const n=i||t.type==="inline";t.children=t.children.map(e=>{const o=(n?void 0:a(e))??e;return r(o,n),o});for(const e of Object.values(t.slots))r(e,n)}function a(t){if(t.type!=="tag"||t.tag!=="html")return;const i=s.exec(t.attributes.name)?.[1];if(!i)return;const n=t.attributes.attrs?.id,e=new l.Ast.Node("heading",{level:Number(i),...typeof n=="string"&&{id:n}},[new l.Ast.Node("inline",{},t.children)]);return e.location=t.location,e}export{u as normalizeHtmlHeadings};
@@ -1,4 +1,4 @@
1
- import type { Scalar } from '@markdoc/markdoc';
1
+ import type { Scalar } from '@redocly/markdoc';
2
2
  export declare const concat: {
3
3
  transform(parameters: {
4
4
  [key: string]: Scalar;
@@ -7,171 +7,11 @@ export declare function getMarkdocOptions(serverOutDir?: string, _templateId?: s
7
7
  td: import("@markdoc/markdoc").Schema;
8
8
  th: import("@markdoc/markdoc").Schema;
9
9
  text: import("@markdoc/markdoc").Schema;
10
- strong: {
11
- render?: string | undefined;
12
- attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute>;
13
- slots?: Record<string, import("@markdoc/markdoc").SchemaSlot>;
14
- selfClosing?: boolean;
15
- inline?: boolean;
16
- transform?(node: import("@markdoc/markdoc").Node, config: Readonly<Partial<{
17
- nodes: Partial<Record<import("@markdoc/markdoc").NodeType, import("@markdoc/markdoc").Schema<Partial</*elided*/ any>, string>>>;
18
- tags: Record<string, import("@markdoc/markdoc").Schema>;
19
- variables: Record<string, any>;
20
- functions: Record<string, import("@markdoc/markdoc").ConfigFunction>;
21
- partials: Record<string, any>;
22
- validation?: {
23
- parents?: import("@markdoc/markdoc").Node[];
24
- validateFunctions?: boolean;
25
- environment?: string;
26
- };
27
- }>>): import("@markdoc/markdoc").MaybePromise<import("@markdoc/markdoc").RenderableTreeNodes>;
28
- validate?(node: import("@markdoc/markdoc").Node, config: Readonly<Partial<{
29
- nodes: Partial<Record<import("@markdoc/markdoc").NodeType, import("@markdoc/markdoc").Schema<Partial<any>, string>>>;
30
- tags: Record<string, import("@markdoc/markdoc").Schema>;
31
- variables: Record<string, any>;
32
- functions: Record<string, import("@markdoc/markdoc").ConfigFunction>;
33
- partials: Record<string, any>;
34
- validation?: {
35
- parents?: import("@markdoc/markdoc").Node[];
36
- validateFunctions?: boolean;
37
- environment?: string;
38
- };
39
- }>>): import("@markdoc/markdoc").MaybePromise<import("@markdoc/markdoc").ValidationError[]>;
40
- description?: string;
41
- children: string[];
42
- };
43
- em: {
44
- render?: string | undefined;
45
- attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute>;
46
- slots?: Record<string, import("@markdoc/markdoc").SchemaSlot>;
47
- selfClosing?: boolean;
48
- inline?: boolean;
49
- transform?(node: import("@markdoc/markdoc").Node, config: Readonly<Partial<{
50
- nodes: Partial<Record<import("@markdoc/markdoc").NodeType, import("@markdoc/markdoc").Schema<Partial<any>, string>>>;
51
- tags: Record<string, import("@markdoc/markdoc").Schema>;
52
- variables: Record<string, any>;
53
- functions: Record<string, import("@markdoc/markdoc").ConfigFunction>;
54
- partials: Record<string, any>;
55
- validation?: {
56
- parents?: import("@markdoc/markdoc").Node[];
57
- validateFunctions?: boolean;
58
- environment?: string;
59
- };
60
- }>>): import("@markdoc/markdoc").MaybePromise<import("@markdoc/markdoc").RenderableTreeNodes>;
61
- validate?(node: import("@markdoc/markdoc").Node, config: Readonly<Partial<{
62
- nodes: Partial<Record<import("@markdoc/markdoc").NodeType, import("@markdoc/markdoc").Schema<Partial<any>, string>>>;
63
- tags: Record<string, import("@markdoc/markdoc").Schema>;
64
- variables: Record<string, any>;
65
- functions: Record<string, import("@markdoc/markdoc").ConfigFunction>;
66
- partials: Record<string, any>;
67
- validation?: {
68
- parents?: import("@markdoc/markdoc").Node[];
69
- validateFunctions?: boolean;
70
- environment?: string;
71
- };
72
- }>>): import("@markdoc/markdoc").MaybePromise<import("@markdoc/markdoc").ValidationError[]>;
73
- description?: string;
74
- children: string[];
75
- };
76
- s: {
77
- render?: string | undefined;
78
- attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute>;
79
- slots?: Record<string, import("@markdoc/markdoc").SchemaSlot>;
80
- selfClosing?: boolean;
81
- inline?: boolean;
82
- transform?(node: import("@markdoc/markdoc").Node, config: Readonly<Partial<{
83
- nodes: Partial<Record<import("@markdoc/markdoc").NodeType, import("@markdoc/markdoc").Schema<Partial<any>, string>>>;
84
- tags: Record<string, import("@markdoc/markdoc").Schema>;
85
- variables: Record<string, any>;
86
- functions: Record<string, import("@markdoc/markdoc").ConfigFunction>;
87
- partials: Record<string, any>;
88
- validation?: {
89
- parents?: import("@markdoc/markdoc").Node[];
90
- validateFunctions?: boolean;
91
- environment?: string;
92
- };
93
- }>>): import("@markdoc/markdoc").MaybePromise<import("@markdoc/markdoc").RenderableTreeNodes>;
94
- validate?(node: import("@markdoc/markdoc").Node, config: Readonly<Partial<{
95
- nodes: Partial<Record<import("@markdoc/markdoc").NodeType, import("@markdoc/markdoc").Schema<Partial<any>, string>>>;
96
- tags: Record<string, import("@markdoc/markdoc").Schema>;
97
- variables: Record<string, any>;
98
- functions: Record<string, import("@markdoc/markdoc").ConfigFunction>;
99
- partials: Record<string, any>;
100
- validation?: {
101
- parents?: import("@markdoc/markdoc").Node[];
102
- validateFunctions?: boolean;
103
- environment?: string;
104
- };
105
- }>>): import("@markdoc/markdoc").MaybePromise<import("@markdoc/markdoc").ValidationError[]>;
106
- description?: string;
107
- children: string[];
108
- };
109
- link: {
110
- attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute>;
111
- slots?: Record<string, import("@markdoc/markdoc").SchemaSlot>;
112
- selfClosing?: boolean;
113
- inline?: boolean;
114
- transform?(node: import("@markdoc/markdoc").Node, config: Readonly<Partial<{
115
- nodes: Partial<Record<import("@markdoc/markdoc").NodeType, import("@markdoc/markdoc").Schema<Partial<any>, string>>>;
116
- tags: Record<string, import("@markdoc/markdoc").Schema>;
117
- variables: Record<string, any>;
118
- functions: Record<string, import("@markdoc/markdoc").ConfigFunction>;
119
- partials: Record<string, any>;
120
- validation?: {
121
- parents?: import("@markdoc/markdoc").Node[];
122
- validateFunctions?: boolean;
123
- environment?: string;
124
- };
125
- }>>): import("@markdoc/markdoc").MaybePromise<import("@markdoc/markdoc").RenderableTreeNodes>;
126
- validate?(node: import("@markdoc/markdoc").Node, config: Readonly<Partial<{
127
- nodes: Partial<Record<import("@markdoc/markdoc").NodeType, import("@markdoc/markdoc").Schema<Partial<any>, string>>>;
128
- tags: Record<string, import("@markdoc/markdoc").Schema>;
129
- variables: Record<string, any>;
130
- functions: Record<string, import("@markdoc/markdoc").ConfigFunction>;
131
- partials: Record<string, any>;
132
- validation?: {
133
- parents?: import("@markdoc/markdoc").Node[];
134
- validateFunctions?: boolean;
135
- environment?: string;
136
- };
137
- }>>): import("@markdoc/markdoc").MaybePromise<import("@markdoc/markdoc").ValidationError[]>;
138
- description?: string;
139
- render: string;
140
- children: string[];
141
- };
142
- document: {
143
- render?: string | undefined;
144
- attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute>;
145
- slots?: Record<string, import("@markdoc/markdoc").SchemaSlot>;
146
- selfClosing?: boolean;
147
- inline?: boolean;
148
- transform?(node: import("@markdoc/markdoc").Node, config: Readonly<Partial<{
149
- nodes: Partial<Record<import("@markdoc/markdoc").NodeType, import("@markdoc/markdoc").Schema<Partial<any>, string>>>;
150
- tags: Record<string, import("@markdoc/markdoc").Schema>;
151
- variables: Record<string, any>;
152
- functions: Record<string, import("@markdoc/markdoc").ConfigFunction>;
153
- partials: Record<string, any>;
154
- validation?: {
155
- parents?: import("@markdoc/markdoc").Node[];
156
- validateFunctions?: boolean;
157
- environment?: string;
158
- };
159
- }>>): import("@markdoc/markdoc").MaybePromise<import("@markdoc/markdoc").RenderableTreeNodes>;
160
- validate?(node: import("@markdoc/markdoc").Node, config: Readonly<Partial<{
161
- nodes: Partial<Record<import("@markdoc/markdoc").NodeType, import("@markdoc/markdoc").Schema<Partial<any>, string>>>;
162
- tags: Record<string, import("@markdoc/markdoc").Schema>;
163
- variables: Record<string, any>;
164
- functions: Record<string, import("@markdoc/markdoc").ConfigFunction>;
165
- partials: Record<string, any>;
166
- validation?: {
167
- parents?: import("@markdoc/markdoc").Node[];
168
- validateFunctions?: boolean;
169
- environment?: string;
170
- };
171
- }>>): import("@markdoc/markdoc").MaybePromise<import("@markdoc/markdoc").ValidationError[]>;
172
- description?: string;
173
- children: string[];
174
- };
10
+ strong: import("@markdoc/markdoc").Schema;
11
+ em: import("@markdoc/markdoc").Schema;
12
+ s: import("@markdoc/markdoc").Schema;
13
+ link: import("@markdoc/markdoc").Schema;
14
+ document: import("@markdoc/markdoc").Schema;
175
15
  };
176
16
  tags: {
177
17
  schemaDefinition: {
@@ -1 +1 @@
1
- import f from"@markdoc/markdoc";import*as p from"@redocly/theme/markdoc/default";import{reporter as g}from"../../../tools/notifiers/reporter.js";import*as u from"../../../../markdoc/nodes/index.js";import d from"../../../../markdoc/tags/index.js";import{normalizeCustomTags as l}from"../../../../markdoc/helpers/normalize-custom-tags.js";import{includes as h}from"./functions/includes.js";import{importUserTags as O}from"./import-user-tags.js";import{concat as y}from"./functions/concat.js";const T=p.tags;function b(s){const{tags:c,functions:e={},...r}=s,n={...c,...r},a=Object.entries(n),o=[],t=[];for(const[i,m]of a)i in f.nodes?o.push([i,m]):t.push([i,m]);return{nodes:Object.fromEntries(o),tags:Object.fromEntries(t),functions:e}}async function _(s="../../../esbuild/cache/server/",c=""){let e;try{e=(await O(s)).schema}catch(t){throw t.code==="ERR_MODULE_NOT_FOUND"?(g.printErrors(),new Error("Please fix the errors above and try again.")):t}const{tags:r={},nodes:n={},functions:a={}}=b(e),o={tags:{schemaDefinition:{render:"SchemaDefinition",attributes:{schemaRef:{type:String},exampleRef:{type:String},showReadOnly:{type:Boolean},showWriteOnly:{type:Boolean}}}}};return{nodes:{...u,...n},tags:{...d,...T,...l(r),...o.tags},functions:{...f.functions,...a,includes:h,concat:y}}}export{_ as getMarkdocOptions};
1
+ import f from"@redocly/markdoc";import*as p from"@redocly/theme/markdoc/default";import{reporter as g}from"../../../tools/notifiers/reporter.js";import*as u from"../../../../markdoc/nodes/index.js";import d from"../../../../markdoc/tags/index.js";import{normalizeCustomTags as l}from"../../../../markdoc/helpers/normalize-custom-tags.js";import{includes as h}from"./functions/includes.js";import{importUserTags as O}from"./import-user-tags.js";import{concat as y}from"./functions/concat.js";const T=p.tags;function b(s){const{tags:c,functions:e={},...r}=s,n={...c,...r},a=Object.entries(n),o=[],t=[];for(const[i,m]of a)i in f.nodes?o.push([i,m]):t.push([i,m]);return{nodes:Object.fromEntries(o),tags:Object.fromEntries(t),functions:e}}async function _(s="../../../esbuild/cache/server/",c=""){let e;try{e=(await O(s)).schema}catch(t){throw t.code==="ERR_MODULE_NOT_FOUND"?(g.printErrors(),new Error("Please fix the errors above and try again.")):t}const{tags:r={},nodes:n={},functions:a={}}=b(e),o={tags:{schemaDefinition:{render:"SchemaDefinition",attributes:{schemaRef:{type:String},exampleRef:{type:String},showReadOnly:{type:Boolean},showWriteOnly:{type:Boolean}}}}};return{nodes:{...u,...n},tags:{...d,...T,...l(r),...o.tags},functions:{...f.functions,...a,includes:h,concat:y}}}export{_ as getMarkdocOptions};
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { LifecycleContext, AfterRoutesCreatedActions } from '../../../types';
3
3
  export declare function prepareMarkdocPartials(context: LifecycleContext, actions: AfterRoutesCreatedActions): Promise<Record<string, Node>>;
4
4
  //# sourceMappingURL=partials.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { Tag, Node } from '@markdoc/markdoc';
1
+ import type { Tag, Node } from '@redocly/markdoc';
2
2
  export declare function getHeadingData(node: Tag | Node): {
3
3
  value: string;
4
4
  id: any;
@@ -1,4 +1,4 @@
1
- import type { Node, Tag } from '@markdoc/markdoc';
1
+ import type { Node, Tag } from '@redocly/markdoc';
2
2
  export declare function getHeadingData(node: Tag | Node): {
3
3
  value: string;
4
4
  id: any;
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  type ParseMarkdownFn = (content: string) => Node;
3
3
  /** Parse each `{% markdoc-example %}` fence body onto the fence, out of the page tree. */
4
4
  export declare function reparseExampleFences(ast: Node, parseMarkdown: ParseMarkdownFn): void;
@@ -1 +1 @@
1
- import{EXAMPLE_CONTENT_ATTRIBUTE as s}from"@redocly/theme/core/constants";import{isExampleNode as l}from"../../../../markdoc/helpers/guards/is-example-node.js";import{isFenceNode as a}from"../../../../markdoc/helpers/guards/is-fence-node.js";const u="no-inline-annotations";function p(o,n){for(const e of c(o)){if(!e.children.length)continue;const{content:t}=e.attributes;if(typeof t!="string")continue;const i=n(t),f=(e.lines[0]??0)+1;for(const r of i.children)m(r,f);e.children=[],e.slots={},e.errors=e.errors.filter(r=>r.id!==u),e.attributes[s]=i,p(i,n)}}function d(o){const n=[];for(const e of c(o)){const t=e.attributes[s];t&&n.push(t,...d(t))}return n}function*c(o){for(const n of o.walk()){if(!l(n))continue;const[e]=n.children;a(e)&&(yield e)}}function m(o,n){for(const e of[o,...o.walk()]){e.lines=e.lines.map(i=>i+n);const{location:t}=e;t&&(typeof t.start?.line=="number"&&(t.start.line+=n),typeof t.end?.line=="number"&&(t.end.line+=n))}}export{d as exampleContentTrees,p as reparseExampleFences};
1
+ import{EXAMPLE_CONTENT_ATTRIBUTE as c}from"@redocly/theme/core/constants";import{isExampleNode as l}from"../../../../markdoc/helpers/guards/is-example-node.js";import{isFenceNode as a}from"../../../../markdoc/helpers/guards/is-fence-node.js";const u="no-inline-annotations";function d(o,t){for(const e of s(o)){if(!e.children.length)continue;const{content:n}=e.attributes;if(typeof n!="string")continue;const i=t(n),f=(e.location?.start.line??0)+1;for(const r of i.children)m(r,f);e.children=[],e.slots={},e.errors=e.errors.filter(r=>r.id!==u),e.attributes[c]=i,d(i,t)}}function p(o){const t=[];for(const e of s(o)){const n=e.attributes[c];n&&t.push(n,...p(n))}return t}function*s(o){for(const t of o.walk()){if(!l(t))continue;const[e]=t.children;a(e)&&(yield e)}}function m(o,t){for(const e of[o,...o.walk()]){const{location:n}=e;n&&(typeof n.start?.line=="number"&&(n.start.line+=t),typeof n.end?.line=="number"&&(n.end.line+=t))}}export{p as exampleContentTrees,d as reparseExampleFences};
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { MdOptions } from '@redocly/config';
3
3
  export declare function transformMdAst(ast: Node, config: MdOptions, serverOutDir: string): Promise<{
4
4
  headings: {
@@ -6,7 +6,7 @@ export declare function transformMdAst(ast: Node, config: MdOptions, serverOutDi
6
6
  id: string;
7
7
  depth: number;
8
8
  }[];
9
- renderableAst: import("@markdoc/markdoc").RenderableTreeNode;
9
+ renderableAst: import("@markdoc/markdoc").RenderableTreeNodes;
10
10
  pageProps: any;
11
11
  }>;
12
12
  //# sourceMappingURL=runtime-transform.d.ts.map
@@ -1 +1 @@
1
- import c from"@markdoc/markdoc";import{isTag as b}from"../../../markdoc/helpers/guards/is-tag.js";import{slugger as f}from"../../utils/index.js";import{getMarkdocOptions as l}from"./markdoc/markdoc-options.js";import{visit as h,getHeadingData as k,getNumberedItemHeadingData as D}from"./markdoc/plugins/utils.js";import{renderDiagramsWithVariants as H}from"./markdoc/plugins/render-diagrams.js";import{deepStringify as v}from"./markdoc/utils/deep-stringify.js";import{stringifyTagChildrenObjects as y}from"./utils/stringify-tag-children-objects.js";async function S(d,e,p){const g=await l(p),i=[],a=[],o=v(e.variables?.pageProps),{headers:T,...u}=e.variables||{};f.reset();const m=c.transform(d,{...g,...e,variables:{...u,pageProps:o}});let n=0;h(m,r=>{if(b(r)){switch(r.name){case"Heading":{r.attributes.__idx=n,n++;const t=k(r);t&&i.push(t);break}case"NumberedItem":{const t=D(r);t&&i.push(t);break}case"Diagram":a.push({tag:r,input:{type:r.attributes.diagramType,source:r.attributes.diagramSource}});break}y(r)}});const s=await H(a.map(r=>r.input));for(let r=0;r<a.length;r++)a[r].tag.attributes.diagramError=s[r].error,a[r].tag.attributes.diagramHtml=s[r].light,a[r].tag.attributes.diagramHtmlDark=s[r].dark;return{headings:i,renderableAst:m,pageProps:o}}export{S as transformMdAst};
1
+ import c from"@redocly/markdoc";import{isTag as b}from"../../../markdoc/helpers/guards/is-tag.js";import{slugger as f}from"../../utils/index.js";import{getMarkdocOptions as l}from"./markdoc/markdoc-options.js";import{visit as h,getHeadingData as k,getNumberedItemHeadingData as D}from"./markdoc/plugins/utils.js";import{renderDiagramsWithVariants as H}from"./markdoc/plugins/render-diagrams.js";import{deepStringify as v}from"./markdoc/utils/deep-stringify.js";import{stringifyTagChildrenObjects as y}from"./utils/stringify-tag-children-objects.js";async function S(d,e,p){const g=await l(p),i=[],a=[],o=v(e.variables?.pageProps),{headers:T,...u}=e.variables||{};f.reset();const m=c.transform(d,{...g,...e,variables:{...u,pageProps:o}});let n=0;h(m,r=>{if(b(r)){switch(r.name){case"Heading":{r.attributes.__idx=n,n++;const t=k(r);t&&i.push(t);break}case"NumberedItem":{const t=D(r);t&&i.push(t);break}case"Diagram":a.push({tag:r,input:{type:r.attributes.diagramType,source:r.attributes.diagramSource}});break}y(r)}});const s=await H(a.map(r=>r.input));for(let r=0;r<a.length;r++)a[r].tag.attributes.diagramError=s[r].error,a[r].tag.attributes.diagramHtml=s[r].light,a[r].tag.attributes.diagramHtmlDark=s[r].dark;return{headings:i,renderableAst:m,pageProps:o}}export{S as transformMdAst};