@blogmcp/sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (340) hide show
  1. package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
  2. package/dist/_virtual/constants.js +4 -0
  3. package/dist/_virtual/index.js +2 -0
  4. package/dist/_virtual/index2.js +4 -0
  5. package/dist/_virtual/index3.js +2 -0
  6. package/dist/_virtual/re.js +4 -0
  7. package/dist/core/article-seo.d.ts +27 -0
  8. package/dist/core/article-seo.js +25 -0
  9. package/dist/core/auth.d.ts +34 -0
  10. package/dist/core/auth.js +89 -0
  11. package/dist/core/blog-config.d.ts +5 -0
  12. package/dist/core/blog-config.js +14 -0
  13. package/dist/core/client-types.d.ts +51 -0
  14. package/dist/core/client.d.ts +159 -0
  15. package/dist/core/client.js +82 -0
  16. package/dist/core/i18n.d.ts +29 -0
  17. package/dist/core/i18n.js +34 -0
  18. package/dist/core/index.d.ts +26 -0
  19. package/dist/core/index.js +67 -0
  20. package/dist/core/markdown.d.ts +69 -0
  21. package/dist/core/markdown.js +47 -0
  22. package/dist/core/navigation.d.ts +70 -0
  23. package/dist/core/navigation.js +71 -0
  24. package/dist/core/queries.d.ts +34 -0
  25. package/dist/core/queries.js +363 -0
  26. package/dist/core/retry.d.ts +9 -0
  27. package/dist/core/retry.js +14 -0
  28. package/dist/core/seo.d.ts +142 -0
  29. package/dist/core/seo.js +166 -0
  30. package/dist/core/theme.d.ts +41 -0
  31. package/dist/core/theme.js +60 -0
  32. package/dist/core/translations/cs.json.js +27 -0
  33. package/dist/core/translations/en.json.js +27 -0
  34. package/dist/core/types.d.ts +184 -0
  35. package/dist/core/types.js +9 -0
  36. package/dist/core/view-model.d.ts +53 -0
  37. package/dist/core/view-model.js +47 -0
  38. package/dist/node_modules/@braintree/sanitize-url/dist/constants.js +8 -0
  39. package/dist/node_modules/@braintree/sanitize-url/dist/index.js +60 -0
  40. package/dist/node_modules/dompurify/dist/purify.es.js +662 -0
  41. package/dist/node_modules/semver/classes/comparator.js +56 -0
  42. package/dist/node_modules/semver/classes/range.js +148 -0
  43. package/dist/node_modules/semver/classes/semver.js +169 -0
  44. package/dist/node_modules/semver/functions/clean.js +14 -0
  45. package/dist/node_modules/semver/functions/cmp.js +39 -0
  46. package/dist/node_modules/semver/functions/coerce.js +33 -0
  47. package/dist/node_modules/semver/functions/compare-build.js +14 -0
  48. package/dist/node_modules/semver/functions/compare-loose.js +11 -0
  49. package/dist/node_modules/semver/functions/compare.js +11 -0
  50. package/dist/node_modules/semver/functions/diff.js +24 -0
  51. package/dist/node_modules/semver/functions/eq.js +11 -0
  52. package/dist/node_modules/semver/functions/gt.js +11 -0
  53. package/dist/node_modules/semver/functions/gte.js +11 -0
  54. package/dist/node_modules/semver/functions/inc.js +21 -0
  55. package/dist/node_modules/semver/functions/lt.js +11 -0
  56. package/dist/node_modules/semver/functions/lte.js +11 -0
  57. package/dist/node_modules/semver/functions/major.js +11 -0
  58. package/dist/node_modules/semver/functions/minor.js +11 -0
  59. package/dist/node_modules/semver/functions/neq.js +11 -0
  60. package/dist/node_modules/semver/functions/parse.js +21 -0
  61. package/dist/node_modules/semver/functions/patch.js +11 -0
  62. package/dist/node_modules/semver/functions/prerelease.js +14 -0
  63. package/dist/node_modules/semver/functions/rcompare.js +11 -0
  64. package/dist/node_modules/semver/functions/rsort.js +11 -0
  65. package/dist/node_modules/semver/functions/satisfies.js +18 -0
  66. package/dist/node_modules/semver/functions/sort.js +11 -0
  67. package/dist/node_modules/semver/functions/valid.js +14 -0
  68. package/dist/node_modules/semver/index.js +97 -0
  69. package/dist/node_modules/semver/internal/constants.js +28 -0
  70. package/dist/node_modules/semver/internal/debug.js +8 -0
  71. package/dist/node_modules/semver/internal/identifiers.js +18 -0
  72. package/dist/node_modules/semver/internal/lrucache.js +32 -0
  73. package/dist/node_modules/semver/internal/parse-options.js +10 -0
  74. package/dist/node_modules/semver/internal/re.js +32 -0
  75. package/dist/node_modules/semver/ranges/gtr.js +11 -0
  76. package/dist/node_modules/semver/ranges/intersects.js +11 -0
  77. package/dist/node_modules/semver/ranges/ltr.js +11 -0
  78. package/dist/node_modules/semver/ranges/max-satisfying.js +22 -0
  79. package/dist/node_modules/semver/ranges/min-satisfying.js +22 -0
  80. package/dist/node_modules/semver/ranges/min-version.js +42 -0
  81. package/dist/node_modules/semver/ranges/outside.js +44 -0
  82. package/dist/node_modules/semver/ranges/simplify.js +24 -0
  83. package/dist/node_modules/semver/ranges/subset.js +94 -0
  84. package/dist/node_modules/semver/ranges/to-comparators.js +11 -0
  85. package/dist/node_modules/semver/ranges/valid.js +17 -0
  86. package/dist/nuxt/composables/useAsyncKb.d.ts +32 -0
  87. package/dist/nuxt/composables/useAsyncKb.js +34 -0
  88. package/dist/nuxt/index.d.ts +1 -0
  89. package/dist/nuxt/index.js +6 -0
  90. package/dist/packages/mdx-render-vue/dist/_virtual/_plugin-vue_export-helper.js +9 -0
  91. package/dist/packages/mdx-render-vue/dist/_virtual/constants.js +4 -0
  92. package/dist/packages/mdx-render-vue/dist/_virtual/index.js +5 -0
  93. package/dist/packages/mdx-render-vue/dist/_virtual/index2.js +4 -0
  94. package/dist/packages/mdx-render-vue/dist/composables/useAudioPlayer.js +40 -0
  95. package/dist/packages/mdx-render-vue/dist/composables/useCallout.js +66 -0
  96. package/dist/packages/mdx-render-vue/dist/composables/useCodeBlock.js +62 -0
  97. package/dist/packages/mdx-render-vue/dist/composables/useGallery.js +68 -0
  98. package/dist/packages/mdx-render-vue/dist/composables/useMedia.js +9 -0
  99. package/dist/packages/mdx-render-vue/dist/composables/useYouTube.js +24 -0
  100. package/dist/packages/mdx-render-vue/dist/edit/AlertEdit.vue.js +4 -0
  101. package/dist/packages/mdx-render-vue/dist/edit/AlertEdit.vue2.js +16 -0
  102. package/dist/packages/mdx-render-vue/dist/edit/AudioPlayerEdit.vue.js +102 -0
  103. package/dist/packages/mdx-render-vue/dist/edit/AudioPlayerEdit.vue2.js +4 -0
  104. package/dist/packages/mdx-render-vue/dist/edit/BadgeEdit.vue.js +4 -0
  105. package/dist/packages/mdx-render-vue/dist/edit/BadgeEdit.vue2.js +11 -0
  106. package/dist/packages/mdx-render-vue/dist/edit/ButtonEdit.vue.js +4 -0
  107. package/dist/packages/mdx-render-vue/dist/edit/ButtonEdit.vue2.js +11 -0
  108. package/dist/packages/mdx-render-vue/dist/edit/CalloutEdit.vue.js +78 -0
  109. package/dist/packages/mdx-render-vue/dist/edit/CalloutEdit.vue2.js +4 -0
  110. package/dist/packages/mdx-render-vue/dist/edit/CardEdit.vue.js +4 -0
  111. package/dist/packages/mdx-render-vue/dist/edit/CardEdit.vue2.js +16 -0
  112. package/dist/packages/mdx-render-vue/dist/edit/CodeBlockEdit.vue.js +6 -0
  113. package/dist/packages/mdx-render-vue/dist/edit/CodeBlockEdit.vue2.js +74 -0
  114. package/dist/packages/mdx-render-vue/dist/edit/GalleryEdit.vue.js +56 -0
  115. package/dist/packages/mdx-render-vue/dist/edit/GalleryEdit.vue2.js +4 -0
  116. package/dist/packages/mdx-render-vue/dist/edit/IconEdit.vue.js +4 -0
  117. package/dist/packages/mdx-render-vue/dist/edit/IconEdit.vue2.js +11 -0
  118. package/dist/packages/mdx-render-vue/dist/edit/TooltipEdit.vue.js +4 -0
  119. package/dist/packages/mdx-render-vue/dist/edit/TooltipEdit.vue2.js +20 -0
  120. package/dist/packages/mdx-render-vue/dist/edit/YouTubeEdit.vue.js +34 -0
  121. package/dist/packages/mdx-render-vue/dist/edit/YouTubeEdit.vue2.js +4 -0
  122. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/_virtual/_rolldown/runtime.js +11 -0
  123. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/factory.js +29 -0
  124. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/presence/use-presence-context.js +6 -0
  125. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/presence/use-presence.js +32 -0
  126. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-arrow-tip.js +5 -0
  127. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-arrow-tip.vue_vue_type_script_setup_true_lang.js +18 -0
  128. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-arrow.js +5 -0
  129. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-arrow.vue_vue_type_script_setup_true_lang.js +18 -0
  130. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-content.js +5 -0
  131. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-content.vue_vue_type_script_setup_true_lang.js +20 -0
  132. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-context.js +5 -0
  133. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-context.vue_vue_type_script_setup_true_lang.js +12 -0
  134. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-positioner.js +5 -0
  135. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-positioner.vue_vue_type_script_setup_true_lang.js +19 -0
  136. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-root-provider.js +5 -0
  137. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-root-provider.vue_vue_type_script_setup_true_lang.js +29 -0
  138. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-root.js +5 -0
  139. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-root.vue_vue_type_script_setup_true_lang.js +59 -0
  140. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-trigger.js +5 -0
  141. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-trigger.vue_vue_type_script_setup_true_lang.js +21 -0
  142. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip.js +22 -0
  143. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/use-tooltip-context.js +6 -0
  144. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/use-tooltip.js +29 -0
  145. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/providers/environment/use-environment-context.js +12 -0
  146. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/providers/locale/use-locale-context.js +11 -0
  147. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/utils/clean-props.js +8 -0
  148. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/utils/create-context.js +12 -0
  149. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/utils/dynamic.js +25 -0
  150. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/utils/unref-element.js +8 -0
  151. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/utils/use-forward-expose.js +36 -0
  152. package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/utils/use-render-strategy.js +5 -0
  153. package/dist/packages/mdx-render-vue/dist/node_modules/@braintree/sanitize-url/dist/constants.js +8 -0
  154. package/dist/packages/mdx-render-vue/dist/node_modules/@braintree/sanitize-url/dist/index.js +60 -0
  155. package/dist/packages/mdx-render-vue/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +532 -0
  156. package/dist/packages/mdx-render-vue/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +403 -0
  157. package/dist/packages/mdx-render-vue/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +136 -0
  158. package/dist/packages/mdx-render-vue/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +128 -0
  159. package/dist/packages/mdx-render-vue/dist/node_modules/@iconify/vue/dist/iconify.js +1192 -0
  160. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/anatomy/dist/create-anatomy.js +26 -0
  161. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/core/dist/create-machine.js +21 -0
  162. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/core/dist/merge-props.js +45 -0
  163. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/core/dist/scope.js +16 -0
  164. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/core/dist/state.js +136 -0
  165. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/core/dist/types.js +5 -0
  166. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/chunk-QZ7TP4HQ.js +4 -0
  167. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/computed-style.js +8 -0
  168. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/event.js +31 -0
  169. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/node.js +49 -0
  170. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/overflow.js +19 -0
  171. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/platform.js +16 -0
  172. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/query.js +6 -0
  173. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/raf.js +41 -0
  174. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/set.js +14 -0
  175. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/shared.js +7 -0
  176. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/focus-visible/dist/index.js +90 -0
  177. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/popper/dist/get-anchor.js +34 -0
  178. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/popper/dist/get-placement.js +187 -0
  179. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/popper/dist/get-styles.js +47 -0
  180. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/popper/dist/middleware.js +56 -0
  181. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/popper/dist/placement.js +7 -0
  182. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/presence/dist/presence.connect.js +16 -0
  183. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/presence/dist/presence.machine.js +147 -0
  184. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/tooltip/dist/tooltip.anatomy.js +6 -0
  185. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/tooltip/dist/tooltip.connect.js +119 -0
  186. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/tooltip/dist/tooltip.dom.js +15 -0
  187. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/tooltip/dist/tooltip.machine.js +375 -0
  188. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/tooltip/dist/tooltip.store.js +9 -0
  189. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/types/dist/prop-types.js +10 -0
  190. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/utils/dist/array.js +6 -0
  191. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/utils/dist/equal.js +27 -0
  192. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/utils/dist/functions.js +10 -0
  193. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/utils/dist/guard.js +15 -0
  194. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/utils/dist/object.js +13 -0
  195. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/utils/dist/store.js +25 -0
  196. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/utils/dist/warning.js +25 -0
  197. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/vue/dist/bindable.js +37 -0
  198. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/vue/dist/machine.js +205 -0
  199. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/vue/dist/normalize-props.js +30 -0
  200. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/vue/dist/refs.js +14 -0
  201. package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/vue/dist/track.js +19 -0
  202. package/dist/packages/mdx-render-vue/dist/node_modules/dompurify/dist/purify.es.js +659 -0
  203. package/dist/packages/mdx-render-vue/dist/registry.js +154 -0
  204. package/dist/packages/mdx-render-vue/dist/render/alert/Alert.vue.js +4 -0
  205. package/dist/packages/mdx-render-vue/dist/render/alert/Alert.vue2.js +37 -0
  206. package/dist/packages/mdx-render-vue/dist/render/audioplayer/AudioPlayerDefault.vue.js +102 -0
  207. package/dist/packages/mdx-render-vue/dist/render/audioplayer/AudioPlayerDefault.vue2.js +4 -0
  208. package/dist/packages/mdx-render-vue/dist/render/badge/Badge.vue.js +4 -0
  209. package/dist/packages/mdx-render-vue/dist/render/badge/Badge.vue2.js +25 -0
  210. package/dist/packages/mdx-render-vue/dist/render/button/Button.vue.js +4 -0
  211. package/dist/packages/mdx-render-vue/dist/render/button/Button.vue2.js +37 -0
  212. package/dist/packages/mdx-render-vue/dist/render/callout/CalloutDefault.vue.js +79 -0
  213. package/dist/packages/mdx-render-vue/dist/render/callout/CalloutDefault.vue2.js +4 -0
  214. package/dist/packages/mdx-render-vue/dist/render/callout/CalloutMinimal.vue.js +22 -0
  215. package/dist/packages/mdx-render-vue/dist/render/callout/CalloutMinimal.vue2.js +4 -0
  216. package/dist/packages/mdx-render-vue/dist/render/card/Card.vue.js +4 -0
  217. package/dist/packages/mdx-render-vue/dist/render/card/Card.vue2.js +24 -0
  218. package/dist/packages/mdx-render-vue/dist/render/codeblock/CodeBlockDefault.vue.js +6 -0
  219. package/dist/packages/mdx-render-vue/dist/render/codeblock/CodeBlockDefault.vue2.js +77 -0
  220. package/dist/packages/mdx-render-vue/dist/render/gallery/GalleryGrid.vue.js +103 -0
  221. package/dist/packages/mdx-render-vue/dist/render/gallery/GalleryGrid.vue2.js +4 -0
  222. package/dist/packages/mdx-render-vue/dist/render/gallery/GalleryLightbox.vue.js +6 -0
  223. package/dist/packages/mdx-render-vue/dist/render/gallery/GalleryLightbox.vue2.js +142 -0
  224. package/dist/packages/mdx-render-vue/dist/render/icon/Icon.vue.js +4 -0
  225. package/dist/packages/mdx-render-vue/dist/render/icon/Icon.vue2.js +23 -0
  226. package/dist/packages/mdx-render-vue/dist/render/tooltip/Tooltip.vue.js +4 -0
  227. package/dist/packages/mdx-render-vue/dist/render/tooltip/Tooltip.vue2.js +54 -0
  228. package/dist/packages/mdx-render-vue/dist/render/youtube/YouTubeDefault.vue.js +69 -0
  229. package/dist/packages/mdx-render-vue/dist/render/youtube/YouTubeDefault.vue2.js +4 -0
  230. package/dist/packages/mdx-schema/dist/composables/useMdxParsing.js +139 -0
  231. package/dist/packages/mdx-schema/dist/metadata/index.js +415 -0
  232. package/dist/packages/mdx-schema/dist/prepareProps.js +46 -0
  233. package/dist/packages/mdx-schema/dist/styles/index.js +119 -0
  234. package/dist/packages/mdx-schema/dist/types/index.js +26 -0
  235. package/dist/packages/sanitize/dist/html.js +41 -0
  236. package/dist/react/KbMdxContent.d.ts +35 -0
  237. package/dist/react/KbMdxContent.js +102 -0
  238. package/dist/react/context.d.ts +11 -0
  239. package/dist/react/context.js +5 -0
  240. package/dist/react/hooks/useImageRenderer.d.ts +6 -0
  241. package/dist/react/hooks/useImageRenderer.js +9 -0
  242. package/dist/react/hooks/useKbClient.d.ts +3 -0
  243. package/dist/react/hooks/useKbClient.js +7 -0
  244. package/dist/react/hooks/useKbContext.d.ts +3 -0
  245. package/dist/react/hooks/useKbContext.js +11 -0
  246. package/dist/react/hooks/useKbI18n.d.ts +7 -0
  247. package/dist/react/hooks/useKbI18n.js +8 -0
  248. package/dist/react/hooks/useKbLanguage.d.ts +21 -0
  249. package/dist/react/hooks/useKbLanguage.js +63 -0
  250. package/dist/react/hooks/useKbSearch.d.ts +20 -0
  251. package/dist/react/hooks/useKbSearch.js +22 -0
  252. package/dist/react/hooks/useMdxContent.d.ts +18 -0
  253. package/dist/react/hooks/useMdxContent.js +11 -0
  254. package/dist/react/index.d.ts +21 -0
  255. package/dist/react/index.js +20 -0
  256. package/dist/react/provider.d.ts +25 -0
  257. package/dist/react/provider.js +29 -0
  258. package/dist/react/server/index.d.ts +38 -0
  259. package/dist/react/server/index.js +26 -0
  260. package/dist/sdk.css +1 -0
  261. package/dist/vue/components/KbAccessGate.vue.d.ts +36 -0
  262. package/dist/vue/components/KbAccessGate.vue.js +74 -0
  263. package/dist/vue/components/KbAccessGate.vue2.js +4 -0
  264. package/dist/vue/components/KbArticleCard.vue.d.ts +34 -0
  265. package/dist/vue/components/KbArticleCard.vue.js +87 -0
  266. package/dist/vue/components/KbArticleCard.vue2.js +4 -0
  267. package/dist/vue/components/KbMdxContent.vue.d.ts +5 -0
  268. package/dist/vue/components/KbMdxContent.vue.js +7 -0
  269. package/dist/vue/components/KbMdxContent.vue2.js +82 -0
  270. package/dist/vue/composables/useArticles.d.ts +30 -0
  271. package/dist/vue/composables/useArticles.js +36 -0
  272. package/dist/vue/composables/useImageRenderer.d.ts +6 -0
  273. package/dist/vue/composables/useImageRenderer.js +9 -0
  274. package/dist/vue/composables/useKbAuth.d.ts +27 -0
  275. package/dist/vue/composables/useKbAuth.js +83 -0
  276. package/dist/vue/composables/useKbClient.d.ts +6 -0
  277. package/dist/vue/composables/useKbClient.js +13 -0
  278. package/dist/vue/composables/useKbComments.d.ts +37 -0
  279. package/dist/vue/composables/useKbComments.js +160 -0
  280. package/dist/vue/composables/useKbI18n.d.ts +6 -0
  281. package/dist/vue/composables/useKbI18n.js +8 -0
  282. package/dist/vue/composables/useKbLanguage.d.ts +22 -0
  283. package/dist/vue/composables/useKbLanguage.js +63 -0
  284. package/dist/vue/composables/useNavigation.d.ts +18 -0
  285. package/dist/vue/composables/useNavigation.js +20 -0
  286. package/dist/vue/composables/useSearch.d.ts +21 -0
  287. package/dist/vue/composables/useSearch.js +20 -0
  288. package/dist/vue/composables/useTags.d.ts +17 -0
  289. package/dist/vue/composables/useTags.js +36 -0
  290. package/dist/vue/index.d.ts +22 -0
  291. package/dist/vue/index.js +36 -0
  292. package/dist/vue/plugin.d.ts +30 -0
  293. package/dist/vue/plugin.js +17 -0
  294. package/package.json +97 -0
  295. package/src/core/article-seo.ts +101 -0
  296. package/src/core/auth.ts +138 -0
  297. package/src/core/blog-config.ts +30 -0
  298. package/src/core/client-types.ts +58 -0
  299. package/src/core/client.ts +287 -0
  300. package/src/core/i18n.ts +84 -0
  301. package/src/core/index.ts +147 -0
  302. package/src/core/markdown.ts +178 -0
  303. package/src/core/navigation.ts +152 -0
  304. package/src/core/queries.ts +414 -0
  305. package/src/core/retry.ts +19 -0
  306. package/src/core/seo.ts +374 -0
  307. package/src/core/theme.ts +128 -0
  308. package/src/core/translations/cs.json +225 -0
  309. package/src/core/translations/en.json +225 -0
  310. package/src/core/types.ts +231 -0
  311. package/src/core/view-model.ts +98 -0
  312. package/src/nuxt/composables/useAsyncKb.ts +119 -0
  313. package/src/nuxt/index.ts +6 -0
  314. package/src/react/KbMdxContent.tsx +215 -0
  315. package/src/react/context.ts +25 -0
  316. package/src/react/hooks/useImageRenderer.ts +15 -0
  317. package/src/react/hooks/useKbClient.ts +9 -0
  318. package/src/react/hooks/useKbContext.ts +13 -0
  319. package/src/react/hooks/useKbI18n.ts +15 -0
  320. package/src/react/hooks/useKbLanguage.ts +105 -0
  321. package/src/react/hooks/useKbSearch.ts +50 -0
  322. package/src/react/hooks/useMdxContent.tsx +33 -0
  323. package/src/react/index.ts +31 -0
  324. package/src/react/provider.tsx +70 -0
  325. package/src/react/server/index.ts +70 -0
  326. package/src/vue/components/KbAccessGate.vue +86 -0
  327. package/src/vue/components/KbArticleCard.vue +102 -0
  328. package/src/vue/components/KbMdxContent.vue +211 -0
  329. package/src/vue/composables/useArticles.ts +78 -0
  330. package/src/vue/composables/useImageRenderer.ts +12 -0
  331. package/src/vue/composables/useKbAuth.ts +131 -0
  332. package/src/vue/composables/useKbClient.ts +17 -0
  333. package/src/vue/composables/useKbComments.ts +281 -0
  334. package/src/vue/composables/useKbI18n.ts +11 -0
  335. package/src/vue/composables/useKbLanguage.ts +103 -0
  336. package/src/vue/composables/useNavigation.ts +38 -0
  337. package/src/vue/composables/useSearch.ts +52 -0
  338. package/src/vue/composables/useTags.ts +64 -0
  339. package/src/vue/index.ts +27 -0
  340. package/src/vue/plugin.ts +73 -0
@@ -0,0 +1,178 @@
1
+ /**
2
+ * Configurable marked instance factory.
3
+ *
4
+ * Creates a Marked instance with pluggable image renderer and an optional
5
+ * HTML sanitizer. The default image renderer outputs plain <img> with lazy
6
+ * loading; consumers can provide their own (IPX, Cloudinary, etc.).
7
+ *
8
+ * Sanitization is opt-in via the `sanitize` callback — the SDK core has
9
+ * zero dependency on DOMPurify. Reference renderers wire `sanitizeHtml`
10
+ * from `@blogmcp/sanitize`. Headless consumers either bring their own
11
+ * sanitizer or omit the option and own the trust contract at their
12
+ * downstream render boundary. See:
13
+ * competitor-monitor/docs/internal/sanitization-trust-contract.md
14
+ */
15
+
16
+ import { Marked } from 'marked'
17
+ import type { ImageHtmlRenderer, SanitizeFn } from './client-types'
18
+
19
+ function escapeHtml(str: string): string {
20
+ return str
21
+ .replace(/&/g, '&amp;')
22
+ .replace(/</g, '&lt;')
23
+ .replace(/>/g, '&gt;')
24
+ .replace(/"/g, '&quot;')
25
+ }
26
+
27
+ /**
28
+ * Belt-and-suspenders URL safe-scheme gate, applied inside marked's link
29
+ * and image renderers. Catches the case where markdown-link syntax
30
+ * `[text](javascript:alert(1))` produces a hostile `<a href="…">` from a
31
+ * source string containing no raw HTML — i.e. a source that
32
+ * `parseMarkdownSafe`'s fast-path would skip DOMPurify on.
33
+ *
34
+ * Returns `'about:blank'` for dangerous schemes, the input verbatim
35
+ * otherwise. Strips control characters and entity-encoded variants
36
+ * before checking so common obfuscations don't slip through.
37
+ *
38
+ * Allowed schemes: http, https, mailto, tel, ftp, sms, plus site-relative
39
+ * (`/`), fragment (`#`), protocol-relative (`//`), and the empty string.
40
+ *
41
+ * Inline here (not `@braintree/sanitize-url` or `@blogmcp/sanitize`) so
42
+ * the SDK core stays dep-free — headless consumers don't have to install
43
+ * a sanitize package to get safe URL emission.
44
+ */
45
+ function safeUrl(url: string | undefined | null): string {
46
+ if (!url) return ''
47
+ // Strip control chars (incl. tab / newline) before scheme check —
48
+ // `java\tscript:alert(1)` decodes to `javascript:` after stripping
49
+ const normalized = url.replace(/[\x00-\x1f\x7f]/g, '').trim()
50
+ // Bare relative / anchor / protocol-relative — safe
51
+ if (/^(\/|#|\?|\.\/|\.\.\/|\/\/)/.test(normalized)) return url
52
+ // Scheme check — allow only the explicit safe list
53
+ const schemeMatch = normalized.match(/^([a-z][a-z0-9+.-]*):/i)
54
+ if (!schemeMatch) return url // schemeless = safe (relative-by-default)
55
+ const scheme = schemeMatch[1].toLowerCase()
56
+ const ALLOWED_SCHEMES = ['http', 'https', 'mailto', 'tel', 'ftp', 'sms']
57
+ return ALLOWED_SCHEMES.includes(scheme) ? url : 'about:blank'
58
+ }
59
+
60
+ /** Default image renderer — plain <img> with lazy loading + safe URL */
61
+ export function defaultImageHtml(
62
+ href: string,
63
+ alt: string,
64
+ title?: string | null,
65
+ ): string {
66
+ const titleAttr = title ? ` title="${escapeHtml(title)}"` : ''
67
+ return `<img src="${escapeHtml(safeUrl(href))}" alt="${escapeHtml(alt)}"${titleAttr} loading="lazy">`
68
+ }
69
+
70
+ /**
71
+ * Detects whether a markdown source string contains anything that looks
72
+ * like raw HTML — used by the fast-path skip in {@link parseMarkdownSafe}.
73
+ *
74
+ * Matches:
75
+ * - `<` followed by a letter (tag opener: `<div`, `<a`, `<script`)
76
+ * - `<!` (HTML comment / DOCTYPE)
77
+ * - `</` (closing tag)
78
+ *
79
+ * Does NOT match:
80
+ * - bare `<` in text content (`x < 3`)
81
+ * - HTML entities (`&amp;`) — marked auto-decodes these from plain
82
+ * markdown text, so they appear in the output anyway; presence in
83
+ * source doesn't indicate unsafe HTML
84
+ *
85
+ * False-positive bias: when in doubt, sanitize. The cost of a false
86
+ * positive is ~10ms; the cost of a false negative is XSS.
87
+ */
88
+ const HAS_RAW_HTML_RE = /<[a-zA-Z!/]/
89
+
90
+ export interface CreateMarkedOptions {
91
+ /** Custom image HTML generator. Defaults to plain <img>. */
92
+ imageRenderer?: ImageHtmlRenderer
93
+ /**
94
+ * Optional HTML sanitizer applied as the last step of `marked.parse()`.
95
+ * Pass a function (e.g. `sanitizeHtml` from `@blogmcp/sanitize`), or
96
+ * omit to skip sanitization.
97
+ *
98
+ * Reference renderers in this monorepo wire this in via `@blogmcp/sanitize`.
99
+ * Headless consumers may pass their own sanitizer or omit the option
100
+ * and own the trust contract at their downstream renderer.
101
+ */
102
+ sanitize?: SanitizeFn
103
+ }
104
+
105
+ /**
106
+ * Create a configured Marked instance.
107
+ *
108
+ * If `sanitize` is provided, every `marked.parse(source)` result is
109
+ * passed through it before being returned. This always-sanitize path
110
+ * is the safe default — call sites don't need to remember anything.
111
+ *
112
+ * Performance: ISR amortizes sanitization to ~one call per cache window.
113
+ * For deeper optimization on hot paths, use {@link parseMarkdownSafe}
114
+ * which adds a source-pre-scan fast-path that skips DOMPurify when the
115
+ * markdown source contains no raw HTML.
116
+ */
117
+ export function createMarkedInstance(opts: CreateMarkedOptions = {}): Marked {
118
+ const { imageRenderer = defaultImageHtml, sanitize } = opts
119
+ return new Marked({
120
+ renderer: {
121
+ image({ href, title, text }) {
122
+ if (!href) return ''
123
+ return imageRenderer(safeUrl(href), text, title)
124
+ },
125
+ link({ href, title, text }) {
126
+ const titleAttr = title ? ` title="${escapeHtml(title)}"` : ''
127
+ const safe = safeUrl(href)
128
+ if (safe && /^https?:\/\//.test(safe)) {
129
+ return `<a href="${escapeHtml(safe)}"${titleAttr} target="_blank" rel="noopener noreferrer">${text}</a>`
130
+ }
131
+ return `<a href="${escapeHtml(safe)}"${titleAttr}>${text}</a>`
132
+ },
133
+ },
134
+ hooks: {
135
+ postprocess(html) {
136
+ const wrapped = html
137
+ .replace(/<table>/g, '<div class="overflow-x-auto -mx-4 px-4"><table>')
138
+ .replace(/<\/table>/g, '</table></div>')
139
+ .replace(/<th>/g, '<th scope="col">')
140
+ return sanitize ? sanitize(wrapped) : wrapped
141
+ },
142
+ },
143
+ })
144
+ }
145
+
146
+ /**
147
+ * Parse markdown with an optional fast-path skip on the sanitizer.
148
+ *
149
+ * When `sanitize` is provided, the source is pre-scanned for raw HTML
150
+ * (`<` followed by a letter, comment, or closing tag). If none is found,
151
+ * `marked`'s output is safe by construction (it only emits a known tag
152
+ * whitelist for pure markdown), so DOMPurify is skipped — saving ~5–20ms
153
+ * SSR per call on the typical pure-markdown article.
154
+ *
155
+ * For sources containing raw HTML, full sanitization runs.
156
+ *
157
+ * **Use this instead of `marked.parse(source)` when the source string
158
+ * is available and you want the fast-path.** When wiring `createMarkedInstance`
159
+ * with `sanitize`, calling plain `marked.parse(source)` runs sanitize
160
+ * unconditionally — equally safe, slightly slower per call, but immune
161
+ * to consumer wiring mistakes.
162
+ *
163
+ * Beware: if you wired `createMarkedInstance({sanitize})` AND call this
164
+ * helper, sanitization runs twice (once in postprocess, once here). Pick
165
+ * one path per render surface. The recommended pattern for hot surfaces
166
+ * is: `createMarkedInstance({ imageRenderer })` (no sanitize) + always
167
+ * call `parseMarkdownSafe(source, marked, sanitizeHtml)`.
168
+ */
169
+ export function parseMarkdownSafe(
170
+ source: string,
171
+ marked: Marked,
172
+ sanitize?: SanitizeFn,
173
+ ): string {
174
+ const html = marked.parse(source) as string
175
+ if (!sanitize) return html
176
+ if (!HAS_RAW_HTML_RE.test(source)) return html
177
+ return sanitize(html)
178
+ }
@@ -0,0 +1,152 @@
1
+ /**
2
+ * Navigation tree — the resolved + localized menu returned by the `kbNavigation`
3
+ * GraphQL query, plus pure traversal helpers for consumers (breadcrumbs, siblings,
4
+ * prev/next, subtree).
5
+ *
6
+ * This is the SDK-side mirror of the server's localized node shape. The SDK stays
7
+ * standalone (no @blogmcp/nav-core dependency); the server resolves/merges/
8
+ * localizes, the SDK consumes the flat localized result.
9
+ */
10
+
11
+ export type NavNodeType = 'article-ref' | 'group' | 'external-link' | 'generated-section' | 'separator'
12
+
13
+ export interface NavBadge {
14
+ text: string
15
+ variant?: string
16
+ class?: string
17
+ }
18
+
19
+ export type NavGroupLink = { kind: 'article'; ref: string } | { kind: 'generated'; slug: string }
20
+
21
+ /** A resolved, localized navigation node (children pre-sorted by the server). */
22
+ export interface NavNode {
23
+ id: string
24
+ type: NavNodeType
25
+ /** Resolved label for the requested locale (may be absent for separators). */
26
+ label?: string
27
+ order?: number
28
+ badge?: NavBadge
29
+ icon?: string
30
+ hidden?: boolean
31
+ /** article-ref: the article id; external-link: the URL; generated-section: the slug. */
32
+ ref?: string
33
+ owned?: boolean
34
+ href?: string
35
+ slug?: string
36
+ /** group: optional clickable heading target. */
37
+ link?: NavGroupLink
38
+ collapsed?: boolean
39
+ collapsible?: boolean
40
+ data?: Record<string, unknown>
41
+ children: NavNode[]
42
+ }
43
+
44
+ /** Depth-first pre-order walk. Return `false` from the visitor to stop early. */
45
+ export function navWalk(
46
+ tree: readonly NavNode[],
47
+ visitor: (node: NavNode, parent: NavNode | null, depth: number) => void | boolean,
48
+ ): void {
49
+ const recur = (nodes: readonly NavNode[], parent: NavNode | null, depth: number): boolean => {
50
+ for (const node of nodes) {
51
+ if (visitor(node, parent, depth) === false) return false
52
+ if (node.children?.length && !recur(node.children, node, depth + 1)) return false
53
+ }
54
+ return true
55
+ }
56
+ recur(tree, null, 0)
57
+ }
58
+
59
+ /** Find a node by id. */
60
+ export function findNavNode(tree: readonly NavNode[], id: string): NavNode | undefined {
61
+ let found: NavNode | undefined
62
+ navWalk(tree, (node) => {
63
+ if (node.id === id) {
64
+ found = node
65
+ return false
66
+ }
67
+ })
68
+ return found
69
+ }
70
+
71
+ /** Ancestor path root→node inclusive, or [] if not found. */
72
+ function pathTo(tree: readonly NavNode[], id: string): NavNode[] {
73
+ const path: NavNode[] = []
74
+ let found = false
75
+ const recur = (nodes: readonly NavNode[]): boolean => {
76
+ for (const node of nodes) {
77
+ path.push(node)
78
+ if (node.id === id) {
79
+ found = true
80
+ return true
81
+ }
82
+ if (node.children?.length && recur(node.children)) return true
83
+ path.pop()
84
+ }
85
+ return false
86
+ }
87
+ recur(tree)
88
+ return found ? path : []
89
+ }
90
+
91
+ /** Ancestors of a node, root→parent (excludes the node itself). */
92
+ export function navBreadcrumbs(tree: readonly NavNode[], id: string): NavNode[] {
93
+ return pathTo(tree, id).slice(0, -1)
94
+ }
95
+
96
+ /** Siblings of a node (same parent), excluding itself. */
97
+ export function navSiblings(tree: readonly NavNode[], id: string): NavNode[] {
98
+ const path = pathTo(tree, id)
99
+ if (path.length === 0) return []
100
+ const parent = path.length >= 2 ? path[path.length - 2] : null
101
+ const siblings = parent ? parent.children : tree
102
+ return siblings.filter((n) => n.id !== id)
103
+ }
104
+
105
+ /** The node together with its descendants, or undefined. */
106
+ export function navSubtree(tree: readonly NavNode[], id: string): NavNode | undefined {
107
+ return findNavNode(tree, id)
108
+ }
109
+
110
+ /** Default "navigable" predicate: visible article references. */
111
+ export function isNavigable(node: NavNode): boolean {
112
+ return node.type === 'article-ref' && node.hidden !== true
113
+ }
114
+
115
+ export interface NavNextPrev {
116
+ prev: NavNode | null
117
+ next: NavNode | null
118
+ }
119
+
120
+ /** Previous/next navigable node in depth-first order (visible article-refs by default). */
121
+ export function navNextPrev(
122
+ tree: readonly NavNode[],
123
+ id: string,
124
+ predicate: (node: NavNode) => boolean = isNavigable,
125
+ ): NavNextPrev {
126
+ const seq: NavNode[] = []
127
+ navWalk(tree, (node) => {
128
+ if (predicate(node)) seq.push(node)
129
+ })
130
+ const idx = seq.findIndex((n) => n.id === id)
131
+ if (idx === -1) return { prev: null, next: null }
132
+ return {
133
+ prev: idx > 0 ? seq[idx - 1]! : null,
134
+ next: idx < seq.length - 1 ? seq[idx + 1]! : null,
135
+ }
136
+ }
137
+
138
+ /** Flatten to id/parentId/depth rows in display order. */
139
+ export interface FlatNavNode {
140
+ id: string
141
+ parentId: string | null
142
+ type: NavNodeType
143
+ depth: number
144
+ }
145
+
146
+ export function flattenNav(tree: readonly NavNode[]): FlatNavNode[] {
147
+ const out: FlatNavNode[] = []
148
+ navWalk(tree, (node, parent, depth) => {
149
+ out.push({ id: node.id, parentId: parent?.id ?? null, type: node.type, depth })
150
+ })
151
+ return out
152
+ }