@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,4 +1,4 @@
1
- import M from"@markdoc/markdoc";import D from"node:path";import{AI_SEARCH_CHUNK_SIZE as R,AI_SEARCH_DOCUMENT_CHUNK_SIZE as v}from"../../../constants/plugins/search.js";import{slugger as I}from"../../../../utils/slugger.js";import{joinSectionContent as N}from"./join-section-content.js";import{toMarkdown as P}from"./to-markdown.js";import{AstToSearchNodeTransformer as w}from"./walk-sections.js";import{createRenderTagFn as x}from"./create-render-tag-fn.js";import{getBuildTranslateContext as K}from"../../../utils/l10n/get-build-translate-context.js";import{getLocaleFromRelativePath as L}from"../../../fs/utils/get-locale-from-relative-path.js";import{HeadingNode as b}from"./nodes/heading-node.js";import{extractDocumentSearchFacets as U}from"./search-facets.js";import{formatDocumentMetadata as y}from"../../search/utils.js";import{TagNode as H}from"./nodes/tag-node.js";import{MARKDOC_PARTIALS_DATA_KEY as O}from"../../../constants/common.js";const j=Symbol(),at=(n,o)=>async(e,r,i,c)=>{if(o?.excludeFromSearch)return;I.reset();const l=await e.getNavText?.()||D.basename(e.fsPath),f=M.Ast.fromJSON(r.ast),{locale:g,translate:A}=await K(e.slug,c.getGlobalData?.().l10n),s=new w({partials:c.getGlobalConfig(O)||{},renderTag:x(c.markdocOptions.tags,g,A),getInnerContent:P,ast:f,skipConditionals:!0}),d=Array.from(s.transform());return{async getLLMsTxts(){const u=o?.seo,t=u&&typeof u=="object"&&"description"in u?String(u.description):void 0,a=N(d);return[{title:l,description:t,slug:e.slug,fsPath:e.fsPath,content:a,includeInLLMsTxt:!0}]},async getSearchDocuments(){return F(e,d,n,l)}}};function F(n,o,e,r){const i=n.slug,c=new Map,l=n.metadata||{},f=U(l,e),g=y(l),A=g?`Metadata:
1
+ import M from"@redocly/markdoc";import D from"node:path";import{AI_SEARCH_CHUNK_SIZE as R,AI_SEARCH_DOCUMENT_CHUNK_SIZE as v}from"../../../constants/plugins/search.js";import{slugger as I}from"../../../../utils/slugger.js";import{joinSectionContent as N}from"./join-section-content.js";import{toMarkdown as P}from"./to-markdown.js";import{AstToSearchNodeTransformer as w}from"./walk-sections.js";import{createRenderTagFn as x}from"./create-render-tag-fn.js";import{getBuildTranslateContext as K}from"../../../utils/l10n/get-build-translate-context.js";import{getLocaleFromRelativePath as L}from"../../../fs/utils/get-locale-from-relative-path.js";import{HeadingNode as b}from"./nodes/heading-node.js";import{extractDocumentSearchFacets as U}from"./search-facets.js";import{formatDocumentMetadata as y}from"../../search/utils.js";import{TagNode as H}from"./nodes/tag-node.js";import{MARKDOC_PARTIALS_DATA_KEY as O}from"../../../constants/common.js";const j=Symbol(),at=(n,o)=>async(e,r,i,c)=>{if(o?.excludeFromSearch)return;I.reset();const l=await e.getNavText?.()||D.basename(e.fsPath),f=M.Ast.fromJSON(r.ast),{locale:g,translate:A}=await K(e.slug,c.getGlobalData?.().l10n),s=new w({partials:c.getGlobalConfig(O)||{},renderTag:x(c.markdocOptions.tags,g,A),getInnerContent:P,ast:f,skipConditionals:!0}),d=Array.from(s.transform());return{async getLLMsTxts(){const u=o?.seo,t=u&&typeof u=="object"&&"description"in u?String(u.description):void 0,a=N(d);return[{title:l,description:t,slug:e.slug,fsPath:e.fsPath,content:a,includeInLLMsTxt:!0}]},async getSearchDocuments(){return F(e,d,n,l)}}};function F(n,o,e,r){const i=n.slug,c=new Map,l=n.metadata||{},f=U(l,e),g=y(l),A=g?`Metadata:
2
2
  ${g}
3
3
  `:"",s=[];for(const t of o)if(t instanceof b){s.splice(t.attributes.level-1,6);const a=t.attributes.level>2,m=s[s.length-1]?.title,T=s[s.length-1]?.url,C=a&&m?m:W(r,t),S=a&&T?T:t.getUrl(i),p={title:C,content:"",url:S,level:t.attributes.level,toc:s.map(E=>h(E.section)).join(`
4
4
  `)};(t.attributes.level>1||h(t)!==r)&&(p.content+=p.content?`
@@ -1,4 +1,4 @@
1
- import type { Node } from '@markdoc/markdoc';
1
+ import type { Node } from '@redocly/markdoc';
2
2
  import type { SearchParentNode } from './types.js';
3
3
  export type SectionNodeParams = {
4
4
  node: Node;
@@ -1 +1 @@
1
- import d from"@markdoc/markdoc";import{REDOCLY_ROUTE_RBAC as l,REDOCLY_TEAMS_RBAC as A}from"@redocly/config";import{getInnerText as T}from"../../../../markdoc/helpers/get-inner-text.js";import{skipAgentsOnlyContent as h}from"@redocly/theme/markdoc/tags/visibility";import{getSearchDocuments as g}from"./get-search-documents.js";import{AstToSearchNodeTransformer as C}from"./walk-sections.js";import{setDocumentSearchFacets as R,extractDocumentSearchFacets as S}from"./search-facets.js";import{MARKDOC_PARTIALS_DATA_KEY as D}from"../../../constants/common.js";import{normalizeFrontmatterKeywords as _}from"../../helpers/normalize-frontmatter-keywords.js";function Y(e,m,o,c){return async(t,r,a)=>{if(e?.excludeFromSearch)return[];const i=d.Ast.fromJSON(r.ast),f=new C({ast:i,getInnerContent:T,partials:a.getGlobalConfig(D)||{},renderTag:h,indexPromptTitles:!0}),p=t.metadata||{},n=S(p,o);R(n,o,c);const u=e?.seo?.title||m,{result:s}=_(e?.keywords);return g(f,t.slug,u,r[A],r[l],n,s||void 0)}}export{Y as searchResolver};
1
+ import d from"@redocly/markdoc";import{REDOCLY_ROUTE_RBAC as l,REDOCLY_TEAMS_RBAC as A}from"@redocly/config";import{getInnerText as T}from"../../../../markdoc/helpers/get-inner-text.js";import{skipAgentsOnlyContent as h}from"@redocly/theme/markdoc/tags/visibility";import{getSearchDocuments as g}from"./get-search-documents.js";import{AstToSearchNodeTransformer as C}from"./walk-sections.js";import{setDocumentSearchFacets as R,extractDocumentSearchFacets as S}from"./search-facets.js";import{MARKDOC_PARTIALS_DATA_KEY as D}from"../../../constants/common.js";import{normalizeFrontmatterKeywords as _}from"../../helpers/normalize-frontmatter-keywords.js";function Y(e,m,o,c){return async(t,r,a)=>{if(e?.excludeFromSearch)return[];const i=d.Ast.fromJSON(r.ast),f=new C({ast:i,getInnerContent:T,partials:a.getGlobalConfig(D)||{},renderTag:h,indexPromptTitles:!0}),p=t.metadata||{},n=S(p,o);R(n,o,c);const u=e?.seo?.title||m,{result:s}=_(e?.keywords);return g(f,t.slug,u,r[A],r[l],n,s||void 0)}}export{Y as searchResolver};
@@ -1,4 +1,4 @@
1
- import type { Function, Node, RenderableTreeNode, Variable } from '@markdoc/markdoc';
1
+ import type { Function, Node, RenderableTreeNode, Variable } from '@redocly/markdoc';
2
2
  import type { GetInnerContentFnOptions } from '../../../../types/index.js';
3
3
  export declare function toMarkdown(children: (RenderableTreeNode | Node | Variable | Function)[], options?: GetInnerContentFnOptions): string;
4
4
  //# sourceMappingURL=to-markdown.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 { GetInnerContentFn } from '../../../../types/index.js';
3
3
  import type { SearchNode } from './nodes/types.js';
4
4
  import type { RenderTagFn } from '../../../types/plugins/markdown.js';
@@ -1,3 +1,3 @@
1
- import{PROMPT_TAG as a}from"@redocly/theme/core/constants";import{logger as w}from"../../../tools/notifiers/logger.js";import{isNode as p}from"../../../../markdoc/helpers/guards/is-node.js";import{isConditionalNode as N}from"../../../../markdoc/helpers/guards/is-conditional-node.js";import{isContentNode as m}from"../../../../markdoc/helpers/guards/is-content-node.js";import{getNodeAttribute as f}from"../../../../markdoc/helpers/get-node-attribute.js";import{extractRbacFromCondition as b}from"../../../../markdoc/helpers/extract-rbac-from-condition-node.js";import{TextNode as n}from"./nodes/text-node.js";import{TAG_TITLE_ATTRIBUTES as g,TagNode as u}from"./nodes/tag-node.js";import{HeadingNode as y}from"./nodes/heading-node.js";import{joinSectionContent as d}from"./join-section-content.js";class G{#r;#e;#o;#s;#c;#n;constructor({ast:i,partials:t,skipConditionals:s=!1,getInnerContent:r,renderTag:e,indexPromptTitles:o=!1}){if(this.#r=i,this.#e=t,this.#o=s,this.#s=r,this.#c=e,this.#n=o,!this.#r||!p(this.#r))throw new Error("ast is not a valid Markdoc Node.")}#i(i={}){return{skipConditionals:this.#o,renderTag:this.#c,...i}}*transform(){yield*this.#l(this.#r,{parentNode:null})}*#l(i,t,s=this.#s){if(!(!i||!p(i))){if(N(i)){if(this.#o)return;const r=b(i);r&&r.length>0&&(yield*this.#t(i,{...t,rbacTeams:r},s));return}if(m(i)){yield new n({node:i,content:s([i],this.#i()),...t});return}if(i.type==="heading"){yield new y({node:i,content:s([i],this.#i()),rbacTeams:t?.rbacTeams});return}if(i.type==="tag"){yield*this.#h(i,t,s);return}yield*this.#t(i,t,s)}}*#h(i,t,s=this.#s){switch(i.tag){case"partial":{const r=i.attributes.file,e=i.attributes.variables??{};if(r&&this.#e[r]){yield*this.#l(this.#e[r],t,(o,h)=>s(o,{...h,variables:e}));return}w.warn(`Could not create search indexes for partial \u201C${r}\u201D: file not found`);return}case"html":case"cards":case"tabs":case"code-walkthrough":{yield*this.#t(i,t,s);return}case a:{const r=f(i,"title");this.#n&&r&&(yield new u({node:i,content:r,...t}));return}case"markdoc-example":{const r=s([i],this.#i());yield new n({node:i,content:r,...t});return}case"code-snippet":{const r=f(i,"title"),e=s([i],this.#i());if(r){const o=new u({node:i,content:r,...t});t={...t,parentNode:o},yield o}e&&(yield new n({node:i,content:e,...t}));return}default:{const r=this.#f(i,t,s);if(r!==void 0){yield new n({node:i,content:k(r),...t});return}const e=g.find(l=>l in i.attributes),o=(e&&f(i,e))??"",h=typeof o=="string"?o:s([o]);if(h){const l=new u({node:i,content:h,...t});t={...t,parentNode:l},yield l}if(T(i))yield*this.#t(i,t,s);else{const l=s([i],this.#i());l&&(yield new n({node:i,content:l,...t}))}return}}}#f(i,t,s){const r=()=>T(i)?d([...this.#t(i,t,s)]):"";return this.#c?.(i,{getBody:r})}*#t(i,t,s=this.#s){for(const r of[...Object.values(i.slots),...i.children])for(const e of this.#l(r,t,s))e instanceof y&&(t={...t,parentNode:e}),yield e}}function T(c){return c.children.length>0||Object.keys(c.slots).length>0}function k(c){return c.endsWith(`
1
+ import{PROMPT_TAG as a}from"@redocly/theme/core/constants";import{logger as w}from"../../../tools/notifiers/logger.js";import{isNode as p}from"../../../../markdoc/helpers/guards/is-node.js";import{isConditionalNode as N}from"../../../../markdoc/helpers/guards/is-conditional-node.js";import{isContentNode as m}from"../../../../markdoc/helpers/guards/is-content-node.js";import{getNodeAttribute as f}from"../../../../markdoc/helpers/get-node-attribute.js";import{extractRbacFromCondition as b}from"../../../../markdoc/helpers/extract-rbac-from-condition-node.js";import{TextNode as n}from"./nodes/text-node.js";import{TAG_TITLE_ATTRIBUTES as g,TagNode as u}from"./nodes/tag-node.js";import{HeadingNode as y}from"./nodes/heading-node.js";import{joinSectionContent as d}from"./join-section-content.js";class G{#r;#e;#o;#s;#c;#n;constructor({ast:i,partials:t,skipConditionals:s=!1,getInnerContent:r,renderTag:e,indexPromptTitles:o=!1}){if(this.#r=i,this.#e=t,this.#o=s,this.#s=r,this.#c=e,this.#n=o,!this.#r||!p(this.#r))throw new Error("ast is not a valid Markdoc Node.")}#i(i={}){return{skipConditionals:this.#o,renderTag:this.#c,...i}}*transform(){yield*this.#l(this.#r,{parentNode:null})}*#l(i,t,s=this.#s){if(!(!i||!p(i))){if(N(i)){if(this.#o)return;const r=b(i);r&&r.length>0&&(yield*this.#t(i,{...t,rbacTeams:r},s));return}if(m(i)){yield new n({node:i,content:s([i],this.#i()),...t});return}if(i.type==="heading"){yield new y({node:i,content:s([i],this.#i()),rbacTeams:t?.rbacTeams});return}if(i.type==="tag"){yield*this.#h(i,t,s);return}yield*this.#t(i,t,s)}}*#h(i,t,s=this.#s){switch(i.tag){case"partial":{const r=i.attributes.file,e=i.attributes.variables??{};if(r&&this.#e[r]){yield*this.#l(this.#e[r],t,(o,h)=>s(o,{...h,variables:e}));return}w.warn(`Could not create search indexes for partial \u201C${r}\u201D: file not found`);return}case"html":case"cards":case"tabs":case"code-walkthrough":{yield*this.#t(i,t,s);return}case a:{const r=f(i,"title");this.#n&&r&&(yield new u({node:i,content:r,...t}));return}case"markdoc-example":{const r=s([i],this.#i());yield new n({node:i,content:r,...t});return}case"code-snippet":{const r=f(i,"title"),e=s([i],this.#i());if(r){const o=new u({node:i,content:r,...t});t={...t,parentNode:o},yield o}e&&(yield new n({node:i,content:e,...t}));return}default:{const r=this.#f(i,t,s);if(r!==void 0){yield new n({node:i,content:k(r),...t});return}const e=g.find(l=>l in i.attributes),o=(e&&f(i,e))??"",h=typeof o=="string"?o:s([o]);if(h){const l=new u({node:i,content:h,...t});t={...t,parentNode:l},yield l}if(T(i))yield*this.#t(i,t,s);else{const l=s([i],this.#i());l&&(yield new n({node:i,content:l,...t}))}return}}}#f(i,t,s){const r=()=>T(i)?d([...this.#t(i,t,s)]):"";return this.#c?.(i,{getBody:r})}*#t(i,t,s=this.#s){for(const r of[...Object.values(i.slots??{}),...i.children])for(const e of this.#l(r,t,s))e instanceof y&&(t={...t,parentNode:e}),yield e}}function T(c){return c.children.length>0||Object.keys(c.slots??{}).length>0}function k(c){return c.endsWith(`
2
2
  `)?c:`${c}
3
3
  `}export{G as AstToSearchNodeTransformer};
@@ -1,3 +1,3 @@
1
- import type { Tag } from '@markdoc/markdoc';
1
+ import type { Tag } from '@redocly/markdoc';
2
2
  export declare function stringifyTagChildrenObjects(tag?: Tag | null): void;
3
3
  //# sourceMappingURL=stringify-tag-children-objects.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 { JSX } from 'react';
3
3
  import type { CommonError, GlobalData } from '../types/index.js';
4
4
  import type { MiddlewareDetails, PageRouteInit, PageRouteDetails, RouteDetails, LifecycleContext, ApiRoute, ParseMarkdocOpts, WildcardRedirectsTree, StaticFilePaths, RedirectOptions, McpToolRegistration, McpToolSchema, MarkdocOptions } from './types';
@@ -1 +1 @@
1
- import A from"@markdoc/markdoc";import{parseAndResolveMarkdoc as T}from"./plugins/markdown/compiler.js";import{getPathnameForLocale as M}from"@redocly/theme/core/utils";import{DEFAULT_LOCALE_PLACEHOLDER as g}from"../constants/common.js";import{DEFAULT_TITLE as O,MARKDOC_PARTIALS_DATA_KEY as m,MARKDOC_PARTIALS_DEPS_KEY as k}from"./constants/common.js";import{GATED_MARKDOC_TAGS as R}from"./constants/entitlements.js";import{isObject as L}from"../utils/guards/is-object.js";import{mapObject as H}from"../utils/object/map-object.js";import{getValueDeep as y}from"../utils/object/get-value-deep.js";import{removeTrailingSlash as D}from"../utils/url/remove-trailing-slash.js";import{normalizeRouteSlug as u}from"../utils/path/normalize-route-slug.js";import{isLocalLink as S}from"../utils/path/is-local-link.js";import{reporter as w}from"./tools/notifiers/reporter.js";import{logger as h}from"./tools/notifiers/logger.js";import{sha1 as F}from"./utils/crypto/sha1.js";import{envConfig as G,setEnv as _}from"./config/env-config.js";import{KvService as B}from"./persistence/kv/services/kv-service.js";import{SandboxContext as I}from"./utils/sandbox-context.js";import{writeSharedData as N}from"./utils/index.js";import{renderComponents as V}from"./ssr/render.js";import{readStaticData as q,writeStaticData as j}from"./utils/static-data.js";import{getMarkdocOptions as U}from"./plugins/markdown/markdoc/markdoc-options.js";import{EntitlementsProvider as v}from"./entitlements/entitlements-provider.js";import{isRouteReserved as x}from"./plugins/get-reserved-routes.js";import{isL10nPath as K}from"./fs/utils/is-l10n-path.js";import{resolveGlobMapValue as J}from"./utils/globs.js";import{replaceEnvVariablesDeep as W}from"./utils/envs/replace-env-variables-deep.js";import{findRedirect as $}from"./utils/redirects/find-redirect.js";import{followRedirectChain as z}from"./utils/redirects/follow-redirect-chain.js";import{addWildcardRedirectToTree as Y}from"./utils/redirects/add-wildcard-redirect-to-tree.js";import{telemetryTraceStep as Z}from"../cli/telemetry/helpers/trace-step.js";const E={routesBySlug:"map",staticFilePaths:"object",apiRoutes:"object",middleware:"object",routesByFsPath:"map",routesSharedData:"map",globalData:"object",config:"object",ssr:"object",searchFacets:"map",routesPartials:"map",mcpToolHandlers:"map",skills:"map",devLogin:"object"},P="PLAN_GATES",Q=["OAUTH_CLIENT_ID","OAUTH_CLIENT_SECRET","ORGANIZATION_SLUG","ORGANIZATION_ID","ORG_ID"],ke="userDefinedApiFunctions";class b{routesBySlug=new Map;staticFilePaths={};replacedEnvVars={};unsetEnvVars=new Set;lifecycleContext;newRoutes=[];#t={};routesByFsPath=new Map;apiRoutes=[];middleware=[];routesSharedData=new Map;sharedDataDeps=new Map;sharedDataMarkdocComponents=new Map;routesDynamicComponents=new Map;routesPartials=new Map;ssr={preBodyTags:[],postBodyTags:[],headTags:[]};searchFacets=new Map;searchEngine;templates=new Map;browserPlugins=new Set;apiRoutesRequestHandlers=new Map;mcpToolHandlers=new Map;skills=new Map;serverPropsGetters=new Map;pagePropsGetters=new Map;listeners=new Map;globalData={};devLogin=!1;#o=void 0;config={configFilePath:"",redirects:{},wildcardRedirectsTree:{},access:{rbac:{},requiresLogin:!1},directoryPermissions:{},devLogin:!1,ssoDirect:{}};#i;serverMode;serverOutDir;outdir;buildRevision=0;hasSitemap=!1;compilationErrors=[];#n;userCodeReady;#s=Promise.resolve();#c;#l=Promise.resolve();#d;#h=Promise.resolve();#u;#e=!1;#r=0;#f=0;#a=new Map;constructor({outdir:e,contentDir:s,serverMode:t=!1,serverOutDir:r}){this.#i=s,this.outdir=e,this.serverMode=t,this.serverOutDir=r,I.register({serverOutDir:r,readRoots:[e,process.cwd()]}),this.userCodeReady=new Promise(a=>{this.#n=a})}on(e,s){const t=this.listeners.get(e);t?t.add(s):this.listeners.set(e,new Set([s]))}queueEvent=(e,s,...t)=>{this.#a.set(e+String(s),[e,s,...t])};runListeners=(e,s,...t)=>{for(const r of this.listeners.get(e)||new Set)s?r(s,...t):r(...t)};startPluginsRun(){this.clear(),this.#s=new Promise(e=>{this.#c=e})}waitForPluginsLifecycle(){return Promise.all([this.#s,this.#l,this.#h])}waitForPluginsRun(){return this.#s}finishPluginsRun(){this.#c?.();for(const e of this.#a.values())this.runListeners(...e);this.#a.clear()}startEsbuildRun(){this.#l=new Promise(e=>{this.#d=e})}finishEsbuildRun(){this.#d?.()}markRequestHandlersEntryOutdated(){this.#r++,!this.#e&&(this.#e=!0,this.#h=new Promise(e=>{this.#u=e}))}noteRequestHandlersEntryBuildStart(){this.#f=this.#r}markRequestHandlersEntryUpdated(){this.#e&&(this.#r>this.#f||(this.#e=!1,this.#u?.()))}get contentDir(){if(this.serverMode)throw new Error("contentDir should not be used in server mode");return this.#i}markUserCodeReady(){this.#n?.(!0)}async reloadMarkdocOptions(){await Z("com.redocly.build.reloadMarkdocOptions",async()=>{const e=v.instance(),s=await U(this.serverOutDir),t=Object.fromEntries(Object.entries(s.tags).filter(([r])=>R[r]!=null?e.canAccessFeature(R[r]):!0));this.#o={...s,tags:t}})}get markdocOptions(){return{...this.#o,partials:this.getGlobalConfig(m),themeConfig:this.config.markdown}}setGlobalData=e=>{const s=this.globalData,t={...this.globalData,...e};this.globalData=t,JSON.stringify(t)!==JSON.stringify(s)&&this.queueEvent("global-data-updated",void 0,t)};getGlobalData=()=>this.globalData;getKv=async()=>B.getInstance({baseDbDir:this.serverOutDir});parseMarkdoc=async({input:e,context:s,deps:t,resource:r})=>{const{data:{info:a,ast:i},compoundHash:l}=await T(e,this.markdocOptions,{actions:this,context:s},r);for(const o of a.sharedDataDeps||[]){for(const n of t?.routeSlugs||[])this.addRouteSharedData(n,o,o);for(const n of t?.sharedDataIds||[]){const c=this.sharedDataDeps.get(n)||new Set;c.add(o),this.sharedDataDeps.set(n,c)}}for(const o of a.dynamicMarkdocComponents||[]){for(const n of t?.routeSlugs||[]){const c=this.routesDynamicComponents.get(n)||new Set;c.add(o),this.routesDynamicComponents.set(n,c)}for(const n of t?.sharedDataIds||[]){const c=this.sharedDataMarkdocComponents.get(n)||new Set;c.add(o),this.sharedDataMarkdocComponents.set(n,c)}}if(t?.routeSlugs&&a.partials?.length)for(const o of t.routeSlugs){const n=this.routesPartials.get(o)||[];for(const c of a.partials)n.includes(c)||n.push(c);this.routesPartials.set(o,n)}return{info:a,ast:i,compoundHash:l}};async loadApiDocuments(e){return(await e.cache.load(".","api-docs")).data}setSearchEngine(e){this.searchEngine=e}setSearchFacets=e=>{this.searchFacets=e};setStaticFilePaths=e=>{this.staticFilePaths=e};setGlobalConfig=e=>{const s=Object.keys(e);for(const l of s)for(const o in this.replacedEnvVars)if(o===l||o.startsWith(`${l}:`)){const n=o.split(":"),{error:c,value:d}=y(e,n);(c||d!==this.replacedEnvVars[o].replaced)&&delete this.replacedEnvVars[o]}const{resolvedObj:t,unsetEnvVars:r,replacedValues:a}=W(e);for(const l of r)this.unsetEnvVars.add(l);Object.assign(this.replacedEnvVars,a);const i=t.seo?.siteUrl?.trim();i&&(t.seo={...t.seo,siteUrl:URL.canParse(i)?new URL(i).origin:D(i)}),Object.assign(this.config,t)};getConfig=()=>this.config;getGlobalConfig=e=>this.config[e];getSearchFacets=()=>this.searchFacets;addRedirect=(e,s,t={})=>{if(!v.instance().canAccessFeature("redirects")&&e!=="/")return;this.config.redirects||(this.config.redirects={});const i=u(e).toLowerCase();this.config.redirects[i]=s;const{trackOriginalSource:l=!0}=t,o=this.getGlobalConfig("originalRedirectSources");l&&Array.isArray(o)&&!o.includes(i)&&o.push(i),i.endsWith("*")&&Y(this.config.wildcardRedirectsTree,i)};getRedirect=e=>{const s=u(e).toLowerCase(),t=$(s,this.config.redirects,this.config.wildcardRedirectsTree,this.staticFilePaths);if(!t)return null;if(S(t.to)){const r=u(t.to).toLowerCase();if(!r.endsWith("*")&&z(r,[s],this.config.redirects,this.config.wildcardRedirectsTree).type==="cycle")return null}return{to:t.to,type:t.type}};createSharedData=async(e,s,t)=>{if(t&&this.#t[e]===t)return e;const r=JSON.stringify(s),a=t??F(r);return this.#t[e]===a||(this.#t[e]=a,await N(e,r,this.outdir),this.queueEvent("shared-data-updated",e)),e};addRouteSharedData=(e,s,t)=>{const r=D(e),a=this.routesSharedData.get(r)||{};a[s]=t,this.routesSharedData.set(r,a),h.verbose(`Adding shared data to ${e}, ${s}, ${t}`)};getRouteSharedDataByFsPath=e=>{const s=this.routesByFsPath.get(e);return s?this.routesSharedData.get(s)||{}:{}};getPartialsForRoute=e=>{const s=this.getGlobalConfig(m)||{},t=this.routesPartials.get(e);if(!t||t.length===0)return{};const r=this.getGlobalConfig(k)||{},a=new Set(t),i=Array.from(t);for(let o=0;o<i.length;o++){const n=i[o],c=r[n]?.partials??[];for(const d of c)a.has(d)||(a.add(d),i.push(d))}const l={};for(const o of a)s[o]&&(l[o]=s[o]);return l};addRoute=e=>{const t={...J(e.fsPath,this.config.metadataGlobs),...e.metadata||{}};this.newRoutes.push({...e,metadata:t}),h.verbose("Created route %s",e.slug)};addRouteSharedDataToAllLocales=(e,s,t)=>{const r=[g,...this.lifecycleContext?.fs.localeFolders||[]].map(a=>({code:a,name:a}));for(const a of r){const i=M(e,g,a.code,r);this.addRouteSharedData(i,s,t)}};addApiRoute=e=>{this.apiRoutes.push(e),h.verbose("Created API route %s",e.slug)};addMcpTools=(e,s)=>{for(const t of s){const r=this.mcpToolHandlers.get(t.name);r&&r.importPath!==e&&h.warn('MCP tool "%s" from %s overwrites the tool registered from %s',t.name,e,r.importPath),this.mcpToolHandlers.set(t.name,{...t,importPath:e}),h.verbose("Created MCP tool %s",t.name)}};getMcpTools=()=>Array.from(this.mcpToolHandlers.values());markGatedMcpTools=e=>{for(const s of e){const t=this.mcpToolHandlers.get(s);t&&this.mcpToolHandlers.set(s,{...t,hasAvailabilityGate:!0})}};addSkills=e=>{for(const s of e)this.skills.set(s.slug,s),h.verbose("Discovered skill %s",s.slug)};getSkills=()=>Array.from(this.skills.values());removeMcpTools=e=>{for(const s of e)this.mcpToolHandlers.delete(s)};addMiddleware=e=>{this.middleware.push(e),h.verbose("Created middleware %s",e.id)};setResourceResponseHeaders=(e,s)=>{this.config.responseHeaders||(this.config.responseHeaders={});const t=new Set(s.map(i=>i.name.toLowerCase())),a=[...(this.config.responseHeaders[e]??[]).filter(i=>!t.has(i.name.toLowerCase())),...s];this.config.responseHeaders[e]=a};getRouteByFsPath=e=>{const s=this.routesByFsPath.get(e);return s?this.getRouteBySlug(s):void 0};getRouteBySlug=(e,s={})=>{const{followRedirect:t=!0}=s,r=this.getRedirect(e);return t&&r?this.routesBySlug.get(u(r.to)):this.routesBySlug.get(e)};hasRouteOrRedirectBySlug=e=>{if(this.routesBySlug.has(e)||x(e,this.getConfig()))return!0;const s=this.getRedirect(e);if(!s)return!1;if(!S(s.to))return!0;const t=u(s.to);return this.routesBySlug.has(t)};getRoutesByTemplateId=e=>this.newRoutes.filter(s=>s.templateId===e);getAllRoutesForLocale=(e=g)=>{const s=Array.from(this.routesBySlug.values()),t=e.toLowerCase();return s.filter(r=>e===g?!K(r.fsPath):r.slug.startsWith(`/${t}`))};getAllRoutes=()=>Array.from(this.routesBySlug.values());getAllApiRoutes=()=>this.apiRoutes;getAllMiddleware=()=>this.middleware;getTemplate=e=>this.templates.get(e);getRequestHandler=e=>this.apiRoutesRequestHandlers.get(e);createTemplate=(e,s)=>(this.templates.set(e,s),e);addBrowserPlugin=e=>{this.browserPlugins.add(e)};createRequestHandler=(e,s)=>(this.apiRoutesRequestHandlers.set(e,s),e);clearRequestHandlersByPrefix=e=>{for(const s of this.apiRoutesRequestHandlers.keys())s.startsWith(e)&&this.apiRoutesRequestHandlers.delete(s)};registerServerPropsGetter=(e,s)=>(this.serverPropsGetters.set(e,s),e);registerPagePropsGetter=(e,s)=>{this.pagePropsGetters.set(e,s)};async writeRouteStaticData(e,s){const t=await this.resolveRouteStaticData(e,s,!1);t&&j(e.slug,t,this.outdir)}async resolveRouteStaticData(e,s,t){if(this.serverMode)return q(e.slug,this.outdir);const r={...this,contentDir:this.contentDir,parseMarkdoc:({input:c,context:d,resource:f})=>this.parseMarkdoc({input:c,context:d,deps:{routeSlugs:[e.slug]},resource:f})},a=await e.getStaticData?.(e,r)||{},i=new Set(this.routesDynamicComponents.get(e.slug)),l=this.routesSharedData.get(e.slug)||{};for(const c of Object.values(l)){const d=this.sharedDataMarkdocComponents.get(c);d&&d.forEach(p=>i.add(p));const f=this.sharedDataDeps.get(c);f&&f.forEach(p=>this.addRouteSharedData(e.slug,p,p))}const o=this.getGlobalConfig("seo"),n=a?.frontmatter||{};return{...a,frontmatter:{...n,seo:{...n?.seo,title:n?.seo?.title||await e.getNavText?.()}},props:{...a.props,dynamicMarkdocComponents:Array.from(i),metadata:{...a?.props?.metadata,...e.metadata},seo:{title:O,...o,...a.props?.seo,siteUrl:o?.siteUrl},compilationErrors:this.compilationErrors},lastModified:t||!e.fsPath?null:await this.lifecycleContext?.fs.getLastModified(e.fsPath)}}addSsrComponents(e,s){if(!e?.length)return;const t=typeof e[0]=="string"?e.join(""):V(e);t&&(s==="head"?this.ssr.headTags.push(t):s==="preBody"?this.ssr.preBodyTags.push(t):this.ssr.postBodyTags.push(t))}clear=()=>{this.routesByFsPath.clear(),this.templates.clear(),this.newRoutes=[],this.routesBySlug.clear(),this.apiRoutes=[],this.middleware=[],this.routesSharedData.clear(),this.sharedDataDeps.clear(),this.sharedDataMarkdocComponents.clear(),this.routesDynamicComponents.clear(),this.routesPartials.clear(),this.skills.clear(),this.config.redirects={},this.config.wildcardRedirectsTree={},this.config.directoryPermissions={},this.ssr={preBodyTags:[],postBodyTags:[],headTags:[]}};async toJson(){const e=[];for(const[t,r]of Object.entries(E))switch(r){case"map":{const a=Array.from(this[t].entries());e.push([t,a]);break}case"object":if(t==="config"){e.push([t,await this.getConfigWithEnvPlaceholders()]);break}e.push([t,this[t]]);break;default:throw new Error("Invalid format")}const s=Object.fromEntries(e);return s[P]=G.PLAN_GATES,s}static fromJson(e,s){const t=new b(s);for(const[a,i]of Object.entries(E))switch(i){case"map":t[a]=new Map(e[a]);break;case"object":if(a==="config"){t.setGlobalConfig(e[a]);break}t[a]=e[a];break;default:throw new Error("Invalid format")}t.config[m]=X(t.config[m]||{});const r=e[P];return r&&_("PLAN_GATES",r),t}async getConfigWithEnvPlaceholders(){const e=JSON.parse(JSON.stringify(this.config));for(const s in this.replacedEnvVars){const{original:t}=this.replacedEnvVars[s],r=s.split(":"),a=r.pop(),{error:i,value:l}=y(e,r);if(i||!L(l)&&!Array.isArray(l)){await w.panicOnBuild(`Failed to replace env var with env name for ${s}`);continue}l[a]=t}return e}async reportUnsetEnvVars(){if(this.unsetEnvVars.size===0)return;const e=Array.from(this.unsetEnvVars).filter(t=>!Q.includes(t));if(e.length===0)return;const s=`Failed to resolve config. The following environment variables are not set: ${e.join(", ")}`;await w.panicOnBuildContentError(s)}}function X(C){return H(C,e=>A.Ast.fromJSON(JSON.stringify(e)))}export{b as Store,ke as USER_DEFINED_API_FUNCTIONS_COUNTER_KEY};
1
+ import A from"@redocly/markdoc";import{parseAndResolveMarkdoc as T}from"./plugins/markdown/compiler.js";import{getPathnameForLocale as M}from"@redocly/theme/core/utils";import{DEFAULT_LOCALE_PLACEHOLDER as g}from"../constants/common.js";import{DEFAULT_TITLE as O,MARKDOC_PARTIALS_DATA_KEY as m,MARKDOC_PARTIALS_DEPS_KEY as k}from"./constants/common.js";import{GATED_MARKDOC_TAGS as R}from"./constants/entitlements.js";import{isObject as L}from"../utils/guards/is-object.js";import{mapObject as H}from"../utils/object/map-object.js";import{getValueDeep as y}from"../utils/object/get-value-deep.js";import{removeTrailingSlash as D}from"../utils/url/remove-trailing-slash.js";import{normalizeRouteSlug as u}from"../utils/path/normalize-route-slug.js";import{isLocalLink as S}from"../utils/path/is-local-link.js";import{reporter as w}from"./tools/notifiers/reporter.js";import{logger as h}from"./tools/notifiers/logger.js";import{sha1 as F}from"./utils/crypto/sha1.js";import{envConfig as G,setEnv as _}from"./config/env-config.js";import{KvService as B}from"./persistence/kv/services/kv-service.js";import{SandboxContext as I}from"./utils/sandbox-context.js";import{writeSharedData as N}from"./utils/index.js";import{renderComponents as V}from"./ssr/render.js";import{readStaticData as q,writeStaticData as j}from"./utils/static-data.js";import{getMarkdocOptions as U}from"./plugins/markdown/markdoc/markdoc-options.js";import{EntitlementsProvider as v}from"./entitlements/entitlements-provider.js";import{isRouteReserved as x}from"./plugins/get-reserved-routes.js";import{isL10nPath as K}from"./fs/utils/is-l10n-path.js";import{resolveGlobMapValue as J}from"./utils/globs.js";import{replaceEnvVariablesDeep as W}from"./utils/envs/replace-env-variables-deep.js";import{findRedirect as $}from"./utils/redirects/find-redirect.js";import{followRedirectChain as z}from"./utils/redirects/follow-redirect-chain.js";import{addWildcardRedirectToTree as Y}from"./utils/redirects/add-wildcard-redirect-to-tree.js";import{telemetryTraceStep as Z}from"../cli/telemetry/helpers/trace-step.js";const E={routesBySlug:"map",staticFilePaths:"object",apiRoutes:"object",middleware:"object",routesByFsPath:"map",routesSharedData:"map",globalData:"object",config:"object",ssr:"object",searchFacets:"map",routesPartials:"map",mcpToolHandlers:"map",skills:"map",devLogin:"object"},P="PLAN_GATES",Q=["OAUTH_CLIENT_ID","OAUTH_CLIENT_SECRET","ORGANIZATION_SLUG","ORGANIZATION_ID","ORG_ID"],ke="userDefinedApiFunctions";class b{routesBySlug=new Map;staticFilePaths={};replacedEnvVars={};unsetEnvVars=new Set;lifecycleContext;newRoutes=[];#t={};routesByFsPath=new Map;apiRoutes=[];middleware=[];routesSharedData=new Map;sharedDataDeps=new Map;sharedDataMarkdocComponents=new Map;routesDynamicComponents=new Map;routesPartials=new Map;ssr={preBodyTags:[],postBodyTags:[],headTags:[]};searchFacets=new Map;searchEngine;templates=new Map;browserPlugins=new Set;apiRoutesRequestHandlers=new Map;mcpToolHandlers=new Map;skills=new Map;serverPropsGetters=new Map;pagePropsGetters=new Map;listeners=new Map;globalData={};devLogin=!1;#o=void 0;config={configFilePath:"",redirects:{},wildcardRedirectsTree:{},access:{rbac:{},requiresLogin:!1},directoryPermissions:{},devLogin:!1,ssoDirect:{}};#i;serverMode;serverOutDir;outdir;buildRevision=0;hasSitemap=!1;compilationErrors=[];#n;userCodeReady;#s=Promise.resolve();#c;#l=Promise.resolve();#d;#h=Promise.resolve();#u;#e=!1;#r=0;#f=0;#a=new Map;constructor({outdir:e,contentDir:s,serverMode:t=!1,serverOutDir:r}){this.#i=s,this.outdir=e,this.serverMode=t,this.serverOutDir=r,I.register({serverOutDir:r,readRoots:[e,process.cwd()]}),this.userCodeReady=new Promise(a=>{this.#n=a})}on(e,s){const t=this.listeners.get(e);t?t.add(s):this.listeners.set(e,new Set([s]))}queueEvent=(e,s,...t)=>{this.#a.set(e+String(s),[e,s,...t])};runListeners=(e,s,...t)=>{for(const r of this.listeners.get(e)||new Set)s?r(s,...t):r(...t)};startPluginsRun(){this.clear(),this.#s=new Promise(e=>{this.#c=e})}waitForPluginsLifecycle(){return Promise.all([this.#s,this.#l,this.#h])}waitForPluginsRun(){return this.#s}finishPluginsRun(){this.#c?.();for(const e of this.#a.values())this.runListeners(...e);this.#a.clear()}startEsbuildRun(){this.#l=new Promise(e=>{this.#d=e})}finishEsbuildRun(){this.#d?.()}markRequestHandlersEntryOutdated(){this.#r++,!this.#e&&(this.#e=!0,this.#h=new Promise(e=>{this.#u=e}))}noteRequestHandlersEntryBuildStart(){this.#f=this.#r}markRequestHandlersEntryUpdated(){this.#e&&(this.#r>this.#f||(this.#e=!1,this.#u?.()))}get contentDir(){if(this.serverMode)throw new Error("contentDir should not be used in server mode");return this.#i}markUserCodeReady(){this.#n?.(!0)}async reloadMarkdocOptions(){await Z("com.redocly.build.reloadMarkdocOptions",async()=>{const e=v.instance(),s=await U(this.serverOutDir),t=Object.fromEntries(Object.entries(s.tags).filter(([r])=>R[r]!=null?e.canAccessFeature(R[r]):!0));this.#o={...s,tags:t}})}get markdocOptions(){return{...this.#o,partials:this.getGlobalConfig(m),themeConfig:this.config.markdown}}setGlobalData=e=>{const s=this.globalData,t={...this.globalData,...e};this.globalData=t,JSON.stringify(t)!==JSON.stringify(s)&&this.queueEvent("global-data-updated",void 0,t)};getGlobalData=()=>this.globalData;getKv=async()=>B.getInstance({baseDbDir:this.serverOutDir});parseMarkdoc=async({input:e,context:s,deps:t,resource:r})=>{const{data:{info:a,ast:i},compoundHash:l}=await T(e,this.markdocOptions,{actions:this,context:s},r);for(const o of a.sharedDataDeps||[]){for(const n of t?.routeSlugs||[])this.addRouteSharedData(n,o,o);for(const n of t?.sharedDataIds||[]){const c=this.sharedDataDeps.get(n)||new Set;c.add(o),this.sharedDataDeps.set(n,c)}}for(const o of a.dynamicMarkdocComponents||[]){for(const n of t?.routeSlugs||[]){const c=this.routesDynamicComponents.get(n)||new Set;c.add(o),this.routesDynamicComponents.set(n,c)}for(const n of t?.sharedDataIds||[]){const c=this.sharedDataMarkdocComponents.get(n)||new Set;c.add(o),this.sharedDataMarkdocComponents.set(n,c)}}if(t?.routeSlugs&&a.partials?.length)for(const o of t.routeSlugs){const n=this.routesPartials.get(o)||[];for(const c of a.partials)n.includes(c)||n.push(c);this.routesPartials.set(o,n)}return{info:a,ast:i,compoundHash:l}};async loadApiDocuments(e){return(await e.cache.load(".","api-docs")).data}setSearchEngine(e){this.searchEngine=e}setSearchFacets=e=>{this.searchFacets=e};setStaticFilePaths=e=>{this.staticFilePaths=e};setGlobalConfig=e=>{const s=Object.keys(e);for(const l of s)for(const o in this.replacedEnvVars)if(o===l||o.startsWith(`${l}:`)){const n=o.split(":"),{error:c,value:d}=y(e,n);(c||d!==this.replacedEnvVars[o].replaced)&&delete this.replacedEnvVars[o]}const{resolvedObj:t,unsetEnvVars:r,replacedValues:a}=W(e);for(const l of r)this.unsetEnvVars.add(l);Object.assign(this.replacedEnvVars,a);const i=t.seo?.siteUrl?.trim();i&&(t.seo={...t.seo,siteUrl:URL.canParse(i)?new URL(i).origin:D(i)}),Object.assign(this.config,t)};getConfig=()=>this.config;getGlobalConfig=e=>this.config[e];getSearchFacets=()=>this.searchFacets;addRedirect=(e,s,t={})=>{if(!v.instance().canAccessFeature("redirects")&&e!=="/")return;this.config.redirects||(this.config.redirects={});const i=u(e).toLowerCase();this.config.redirects[i]=s;const{trackOriginalSource:l=!0}=t,o=this.getGlobalConfig("originalRedirectSources");l&&Array.isArray(o)&&!o.includes(i)&&o.push(i),i.endsWith("*")&&Y(this.config.wildcardRedirectsTree,i)};getRedirect=e=>{const s=u(e).toLowerCase(),t=$(s,this.config.redirects,this.config.wildcardRedirectsTree,this.staticFilePaths);if(!t)return null;if(S(t.to)){const r=u(t.to).toLowerCase();if(!r.endsWith("*")&&z(r,[s],this.config.redirects,this.config.wildcardRedirectsTree).type==="cycle")return null}return{to:t.to,type:t.type}};createSharedData=async(e,s,t)=>{if(t&&this.#t[e]===t)return e;const r=JSON.stringify(s),a=t??F(r);return this.#t[e]===a||(this.#t[e]=a,await N(e,r,this.outdir),this.queueEvent("shared-data-updated",e)),e};addRouteSharedData=(e,s,t)=>{const r=D(e),a=this.routesSharedData.get(r)||{};a[s]=t,this.routesSharedData.set(r,a),h.verbose(`Adding shared data to ${e}, ${s}, ${t}`)};getRouteSharedDataByFsPath=e=>{const s=this.routesByFsPath.get(e);return s?this.routesSharedData.get(s)||{}:{}};getPartialsForRoute=e=>{const s=this.getGlobalConfig(m)||{},t=this.routesPartials.get(e);if(!t||t.length===0)return{};const r=this.getGlobalConfig(k)||{},a=new Set(t),i=Array.from(t);for(let o=0;o<i.length;o++){const n=i[o],c=r[n]?.partials??[];for(const d of c)a.has(d)||(a.add(d),i.push(d))}const l={};for(const o of a)s[o]&&(l[o]=s[o]);return l};addRoute=e=>{const t={...J(e.fsPath,this.config.metadataGlobs),...e.metadata||{}};this.newRoutes.push({...e,metadata:t}),h.verbose("Created route %s",e.slug)};addRouteSharedDataToAllLocales=(e,s,t)=>{const r=[g,...this.lifecycleContext?.fs.localeFolders||[]].map(a=>({code:a,name:a}));for(const a of r){const i=M(e,g,a.code,r);this.addRouteSharedData(i,s,t)}};addApiRoute=e=>{this.apiRoutes.push(e),h.verbose("Created API route %s",e.slug)};addMcpTools=(e,s)=>{for(const t of s){const r=this.mcpToolHandlers.get(t.name);r&&r.importPath!==e&&h.warn('MCP tool "%s" from %s overwrites the tool registered from %s',t.name,e,r.importPath),this.mcpToolHandlers.set(t.name,{...t,importPath:e}),h.verbose("Created MCP tool %s",t.name)}};getMcpTools=()=>Array.from(this.mcpToolHandlers.values());markGatedMcpTools=e=>{for(const s of e){const t=this.mcpToolHandlers.get(s);t&&this.mcpToolHandlers.set(s,{...t,hasAvailabilityGate:!0})}};addSkills=e=>{for(const s of e)this.skills.set(s.slug,s),h.verbose("Discovered skill %s",s.slug)};getSkills=()=>Array.from(this.skills.values());removeMcpTools=e=>{for(const s of e)this.mcpToolHandlers.delete(s)};addMiddleware=e=>{this.middleware.push(e),h.verbose("Created middleware %s",e.id)};setResourceResponseHeaders=(e,s)=>{this.config.responseHeaders||(this.config.responseHeaders={});const t=new Set(s.map(i=>i.name.toLowerCase())),a=[...(this.config.responseHeaders[e]??[]).filter(i=>!t.has(i.name.toLowerCase())),...s];this.config.responseHeaders[e]=a};getRouteByFsPath=e=>{const s=this.routesByFsPath.get(e);return s?this.getRouteBySlug(s):void 0};getRouteBySlug=(e,s={})=>{const{followRedirect:t=!0}=s,r=this.getRedirect(e);return t&&r?this.routesBySlug.get(u(r.to)):this.routesBySlug.get(e)};hasRouteOrRedirectBySlug=e=>{if(this.routesBySlug.has(e)||x(e,this.getConfig()))return!0;const s=this.getRedirect(e);if(!s)return!1;if(!S(s.to))return!0;const t=u(s.to);return this.routesBySlug.has(t)};getRoutesByTemplateId=e=>this.newRoutes.filter(s=>s.templateId===e);getAllRoutesForLocale=(e=g)=>{const s=Array.from(this.routesBySlug.values()),t=e.toLowerCase();return s.filter(r=>e===g?!K(r.fsPath):r.slug.startsWith(`/${t}`))};getAllRoutes=()=>Array.from(this.routesBySlug.values());getAllApiRoutes=()=>this.apiRoutes;getAllMiddleware=()=>this.middleware;getTemplate=e=>this.templates.get(e);getRequestHandler=e=>this.apiRoutesRequestHandlers.get(e);createTemplate=(e,s)=>(this.templates.set(e,s),e);addBrowserPlugin=e=>{this.browserPlugins.add(e)};createRequestHandler=(e,s)=>(this.apiRoutesRequestHandlers.set(e,s),e);clearRequestHandlersByPrefix=e=>{for(const s of this.apiRoutesRequestHandlers.keys())s.startsWith(e)&&this.apiRoutesRequestHandlers.delete(s)};registerServerPropsGetter=(e,s)=>(this.serverPropsGetters.set(e,s),e);registerPagePropsGetter=(e,s)=>{this.pagePropsGetters.set(e,s)};async writeRouteStaticData(e,s){const t=await this.resolveRouteStaticData(e,s,!1);t&&j(e.slug,t,this.outdir)}async resolveRouteStaticData(e,s,t){if(this.serverMode)return q(e.slug,this.outdir);const r={...this,contentDir:this.contentDir,parseMarkdoc:({input:c,context:d,resource:f})=>this.parseMarkdoc({input:c,context:d,deps:{routeSlugs:[e.slug]},resource:f})},a=await e.getStaticData?.(e,r)||{},i=new Set(this.routesDynamicComponents.get(e.slug)),l=this.routesSharedData.get(e.slug)||{};for(const c of Object.values(l)){const d=this.sharedDataMarkdocComponents.get(c);d&&d.forEach(p=>i.add(p));const f=this.sharedDataDeps.get(c);f&&f.forEach(p=>this.addRouteSharedData(e.slug,p,p))}const o=this.getGlobalConfig("seo"),n=a?.frontmatter||{};return{...a,frontmatter:{...n,seo:{...n?.seo,title:n?.seo?.title||await e.getNavText?.()}},props:{...a.props,dynamicMarkdocComponents:Array.from(i),metadata:{...a?.props?.metadata,...e.metadata},seo:{title:O,...o,...a.props?.seo,siteUrl:o?.siteUrl},compilationErrors:this.compilationErrors},lastModified:t||!e.fsPath?null:await this.lifecycleContext?.fs.getLastModified(e.fsPath)}}addSsrComponents(e,s){if(!e?.length)return;const t=typeof e[0]=="string"?e.join(""):V(e);t&&(s==="head"?this.ssr.headTags.push(t):s==="preBody"?this.ssr.preBodyTags.push(t):this.ssr.postBodyTags.push(t))}clear=()=>{this.routesByFsPath.clear(),this.templates.clear(),this.newRoutes=[],this.routesBySlug.clear(),this.apiRoutes=[],this.middleware=[],this.routesSharedData.clear(),this.sharedDataDeps.clear(),this.sharedDataMarkdocComponents.clear(),this.routesDynamicComponents.clear(),this.routesPartials.clear(),this.skills.clear(),this.config.redirects={},this.config.wildcardRedirectsTree={},this.config.directoryPermissions={},this.ssr={preBodyTags:[],postBodyTags:[],headTags:[]}};async toJson(){const e=[];for(const[t,r]of Object.entries(E))switch(r){case"map":{const a=Array.from(this[t].entries());e.push([t,a]);break}case"object":if(t==="config"){e.push([t,await this.getConfigWithEnvPlaceholders()]);break}e.push([t,this[t]]);break;default:throw new Error("Invalid format")}const s=Object.fromEntries(e);return s[P]=G.PLAN_GATES,s}static fromJson(e,s){const t=new b(s);for(const[a,i]of Object.entries(E))switch(i){case"map":t[a]=new Map(e[a]);break;case"object":if(a==="config"){t.setGlobalConfig(e[a]);break}t[a]=e[a];break;default:throw new Error("Invalid format")}t.config[m]=X(t.config[m]||{});const r=e[P];return r&&_("PLAN_GATES",r),t}async getConfigWithEnvPlaceholders(){const e=JSON.parse(JSON.stringify(this.config));for(const s in this.replacedEnvVars){const{original:t}=this.replacedEnvVars[s],r=s.split(":"),a=r.pop(),{error:i,value:l}=y(e,r);if(i||!L(l)&&!Array.isArray(l)){await w.panicOnBuild(`Failed to replace env var with env name for ${s}`);continue}l[a]=t}return e}async reportUnsetEnvVars(){if(this.unsetEnvVars.size===0)return;const e=Array.from(this.unsetEnvVars).filter(t=>!Q.includes(t));if(e.length===0)return;const s=`Failed to resolve config. The following environment variables are not set: ${e.join(", ")}`;await w.panicOnBuildContentError(s)}}function X(C){return H(C,e=>A.Ast.fromJSON(JSON.stringify(e)))}export{b as Store,ke as USER_DEFINED_API_FUNCTIONS_COUNTER_KEY};
@@ -1,7 +1,7 @@
1
1
  import type { REDOCLY_ROUTE_RBAC, REDOCLY_TEAMS_RBAC, RbacScopeItems, RedirectConfig, RedoclyConfig, ServerPropsContext, ServerPropsRequest, PageProps, PageStaticData, NavItem, ResolvedNavItem, Version, MdOptions, KvService } from '@redocly/config';
2
2
  import type { JSX } from 'react';
3
3
  import type { JSONSchemaType } from '@redocly/ajv';
4
- import type { Node } from '@markdoc/markdoc';
4
+ import type { Node } from '@redocly/markdoc';
5
5
  import type { ProductConfig } from '@redocly/theme/config';
6
6
  import type { SearchFacet } from '@redocly/theme/core/types';
7
7
  import type { GlobalData, Feature } from '../../../types/index.js';
@@ -1,4 +1,4 @@
1
- import type { LocationEdge } from '@markdoc/markdoc';
1
+ import type { LocationEdge } from '@redocly/markdoc';
2
2
  import type { NormalizedLocation } from '../../plugins/markdown/errors';
3
3
  export declare function getCodeframe(location: NormalizedLocation, color: boolean, indent?: string): {
4
4
  frame: string;
@@ -1,4 +1,4 @@
1
- import type { LocationEdge } from '@markdoc/markdoc';
1
+ import type { LocationEdge } from '@redocly/markdoc';
2
2
  export declare function getYamlLocationByPointer(source: string, pointer: (string | number)[], reportOnKey?: boolean): {
3
3
  start: Required<LocationEdge>;
4
4
  end: Required<LocationEdge>;
@@ -1,4 +1,4 @@
1
- import type { LocationEdge } from '@markdoc/markdoc';
1
+ import type { LocationEdge } from '@redocly/markdoc';
2
2
  import type { MARKDOC_ERROR_TYPES } from '../constants/common.js';
3
3
  export type ErrorSeverity = 'PANIC' | 'ERROR';
4
4
  export type CommonError = {
@@ -1,4 +1,4 @@
1
- import type { Node, Variable, RenderableTreeNode, Function } from '@markdoc/markdoc';
1
+ import type { Node, Variable, RenderableTreeNode, Function } from '@redocly/markdoc';
2
2
  import type { RenderForLlmsRenderContext } from '@redocly/theme/markdoc/tags/types';
3
3
  export type RenderTagFn = (node: Node, context: RenderForLlmsRenderContext) => string | undefined;
4
4
  export type GetInnerContentFnOptions = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/redoc-reef",
3
- "version": "0.140.0-next.3",
3
+ "version": "0.140.0-next.5",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "bin": {
@@ -20,7 +20,7 @@
20
20
  "@hono/zod-validator": "0.8.0",
21
21
  "@jitl/quickjs-singlefile-mjs-release-sync": "0.32.0",
22
22
  "@libsql/client": "0.17.3",
23
- "@markdoc/markdoc": "0.5.2",
23
+ "@markdoc/markdoc": "npm:@redocly/markdoc@0.7.0-beta.2",
24
24
  "@modelcontextprotocol/server": "2.0.0",
25
25
  "@opentelemetry/api": "1.9.1",
26
26
  "@opentelemetry/context-zone": "2.0.1",
@@ -33,13 +33,14 @@
33
33
  "@opentelemetry/sdk-trace-web": "2.8.0",
34
34
  "@opentelemetry/semantic-conventions": "1.40.0",
35
35
  "@redocly/ajv": "8.18.0",
36
- "@redocly/api-docs": "0.5.0-next.1",
36
+ "@redocly/api-docs": "0.5.0-next.3",
37
37
  "@redocly/config": "0.67.0",
38
+ "@redocly/markdoc": "0.7.0-beta.2",
38
39
  "@redocly/openapi-core": "2.66.0",
39
40
  "@redocly/portal-legacy-ui": "0.19.0",
40
- "@redocly/portal-plugin-mock-server": "0.24.0",
41
+ "@redocly/portal-plugin-mock-server": "0.25.0-next.0",
41
42
  "@redocly/realm-asyncapi-sdk": "0.17.0",
42
- "@redocly/theme": "0.72.0-next.0",
43
+ "@redocly/theme": "0.72.0-next.2",
43
44
  "@shikijs/transformers": "3.21.0",
44
45
  "@tanstack/react-query": "5.62.3",
45
46
  "@tanstack/react-table": "8.21.3",
@@ -62,7 +63,6 @@
62
63
  "flexsearch": "0.7.43",
63
64
  "graphql": "16.14.2",
64
65
  "hono": "4.13.13",
65
- "htmlparser2": "8.0.2",
66
66
  "i18next": "22.4.15",
67
67
  "is-glob": "4.0.3",
68
68
  "js-yaml": "4.3.2",
@@ -1,6 +0,0 @@
1
- export declare function getJsxConvertedAttributes(attrs: {
2
- [key: string]: string;
3
- }, tagName?: string): {
4
- [key: string]: string | boolean | object;
5
- };
6
- //# sourceMappingURL=html-jsx-attribute-mapping.d.ts.map
@@ -1 +0,0 @@
1
- const a={for:"htmlFor",class:"className","accept-charset":"acceptCharset",accesskey:"accessKey",allowfullscreen:"allowFullScreen",allowtransparency:"allowTransparency",autocomplete:"autoComplete",autoplay:"autoPlay",cellpadding:"cellPadding",cellspacing:"cellSpacing",charset:"charSet",classid:"classID",colspan:"colSpan",contenteditable:"contentEditable",contextmenu:"contextMenu",crossorigin:"crossOrigin",datetime:"dateTime",enctype:"encType",formaction:"formAction",formenctype:"formEncType",formmethod:"formMethod",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",hreflang:"hrefLang","http-equiv":"httpEquiv",inputmode:"inputMode",keyparams:"keyParams",keytype:"keyType",marginheight:"marginHeight",marginwidth:"marginWidth",maxlength:"maxLength",mediagroup:"mediaGroup",minlength:"minLength",novalidate:"noValidate",playsinline:"playsInline",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rowspan:"rowSpan",spellcheck:"spellCheck",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex",usemap:"useMap",autocapitalize:"autoCapitalize",autocorrect:"autoCorrect",autosave:"autoSave",itemprop:"itemProp",itemscope:"itemScope",itemtype:"itemType",itemid:"itemID",itemref:"itemRef","accent-height":"accentHeight","alignment-baseline":"alignmentBaseline","arabic-form":"arabicForm","baseline-shift":"baselineShift","cap-height":"capHeight","clip-path":"clipPath","clip-rule":"clipRule","color-interpolation":"colorInterpolation","color-interpolation-filters":"colorInterpolationFilters","color-profile":"colorProfile","color-rendering":"colorRendering","dominant-baseline":"dominantBaseline","enable-background":"enableBackground","fill-opacity":"fillOpacity","fill-rule":"fillRule","flood-color":"floodColor","flood-opacity":"floodOpacity","font-family":"fontFamily","font-size":"fontSize","font-size-adjust":"fontSizeAdjust","font-stretch":"fontStretch","font-style":"fontStyle","font-variant":"fontVariant","font-weight":"fontWeight","glyph-name":"glyphName","glyph-orientation-horizontal":"glyphOrientationHorizontal","glyph-orientation-vertical":"glyphOrientationVertical","horiz-adv-x":"horizAdvX","horiz-origin-x":"horizOriginX","image-rendering":"imageRendering","letter-spacing":"letterSpacing","lighting-color":"lightingColor","marker-end":"markerEnd","marker-mid":"markerMid","marker-start":"markerStart","overline-position":"overlinePosition","overline-thickness":"overlineThickness","paint-order":"paintOrder","panose-1":"panose1","pointer-events":"pointerEvents","rendering-intent":"renderingIntent","shape-rendering":"shapeRendering","stop-color":"stopColor","stop-opacity":"stopOpacity","strikethrough-position":"strikethroughPosition","strikethrough-thickness":"strikethroughThickness","stroke-dasharray":"strokeDasharray","stroke-dashoffset":"strokeDashoffset","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","stroke-miterlimit":"strokeMiterlimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-anchor":"textAnchor","text-decoration":"textDecoration","text-rendering":"textRendering","underline-position":"underlinePosition","underline-thickness":"underlineThickness","unicode-bidi":"unicodeBidi","unicode-range":"unicodeRange","units-per-em":"unitsPerEm","v-alphabetic":"vAlphabetic","v-hanging":"vHanging","v-ideographic":"vIdeographic","v-mathematical":"vMathematical","vector-effect":"vectorEffect","vert-adv-y":"vertAdvY","vert-origin-x":"vertOriginX","vert-origin-y":"vertOriginY","word-spacing":"wordSpacing","writing-mode":"writingMode","x-height":"xHeight","xlink:actuate":"xlinkActuate","xlink:arcrole":"xlinkArcrole","xlink:href":"xlinkHref","xlink:role":"xlinkRole","xlink:show":"xlinkShow","xlink:title":"xlinkTitle","xlink:type":"xlinkType","xml:base":"xmlBase","xmlns:xlink":"xmlnsXlink","xml:lang":"xmlLang","xml:space":"xmlSpace"};function s(r,t){const e={};for(const[i,n]of Object.entries(r))switch(i){case"value":t==="input"||t==="textarea"?e.defaultValue=n:e.value=n;break;case"checked":t==="input"?e.defaultChecked=!0:e.checked=n;break;case"style":e.style=c(n);break;default:e[a[i]||i]=n}return e}function l(r){return r.match(/^--/)?r:r.replace(/-[a-z]/g,t=>t[1].toUpperCase())}function c(r){return r.split(";").filter(t=>t.trim().length).reduce((t,e)=>{const i=e.indexOf(":"),n=i===-1?e:e.slice(0,i),o=i===-1?"":e.slice(i+1);return t[l(n.trim())]=o.trim(),t},{})}export{s as getJsxConvertedAttributes};
@@ -1,2 +0,0 @@
1
- export declare function processHtmlTokens(tokens: any): any[];
2
- //# sourceMappingURL=process-html-tokens.d.ts.map
@@ -1 +0,0 @@
1
- import{Parser as p}from"htmlparser2";import{getJsxConvertedAttributes as i}from"./html-jsx-attribute-mapping.js";function l(r){const e=[],n=[];let o=null;const s=new p({onopentag(t,a){n.push({name:t,token:o}),e.push({type:"tag_open",nesting:1,meta:{tag:"html",attributes:[{type:"attribute",name:"name",value:t},{type:"attribute",name:"attrs",value:i(a,t)}]}})},ontext(t){t?.trim().length>0&&e.push({type:"text",content:t})},onclosetag(){n.pop(),e.push({type:"tag_close",nesting:-1,meta:{tag:"html"}})}});for(const t of r){if(t.type.startsWith("html")){o=t,s.write(t.content);continue}t.type==="inline"&&(t.children=l(t.children)),e.push(t)}for(const t of n)e.push({type:"error",meta:{error:{message:`HTML tag <${t.name}> is not closed, opened at`,location:t?.token?.map?{start:{line:t.token.map[0]},end:{line:t.token.map[1]}}:void 0}}}),e.push({type:"tag_close",nesting:-1,meta:{tag:"html"}});return e}export{l as processHtmlTokens};
@@ -1,4 +0,0 @@
1
- import type { Node } from '@markdoc/markdoc';
2
- export declare function getSourceRange(node: Node, linesOfCode: string[]): any;
3
- export declare function hashSourceContent(content: string): string;
4
- //# sourceMappingURL=source.d.ts.map
@@ -1 +0,0 @@
1
- function s(e,t){if(e.lines.length===0)return"";let l="",i=[];if(e.location){const n=e.lines[0]+1;if(l+=`#L${n}`,n!==e.lines[e.lines.length-1]){const r=e.lines[e.lines.length-1];l+=`-L${e.lines[e.lines.length-1]}`,i=t.slice(n-1,r)}else i=[t[n-1]]}return{range:l,source:i}}function h(e){let t=5381,l=e.length;for(;l;)t=t*33^e.charCodeAt(--l);return(t>>>0).toString(16)}export{s as getSourceRange,h as hashSourceContent};