@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.
- package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/_virtual/constants.js +4 -0
- package/dist/_virtual/index.js +2 -0
- package/dist/_virtual/index2.js +4 -0
- package/dist/_virtual/index3.js +2 -0
- package/dist/_virtual/re.js +4 -0
- package/dist/core/article-seo.d.ts +27 -0
- package/dist/core/article-seo.js +25 -0
- package/dist/core/auth.d.ts +34 -0
- package/dist/core/auth.js +89 -0
- package/dist/core/blog-config.d.ts +5 -0
- package/dist/core/blog-config.js +14 -0
- package/dist/core/client-types.d.ts +51 -0
- package/dist/core/client.d.ts +159 -0
- package/dist/core/client.js +82 -0
- package/dist/core/i18n.d.ts +29 -0
- package/dist/core/i18n.js +34 -0
- package/dist/core/index.d.ts +26 -0
- package/dist/core/index.js +67 -0
- package/dist/core/markdown.d.ts +69 -0
- package/dist/core/markdown.js +47 -0
- package/dist/core/navigation.d.ts +70 -0
- package/dist/core/navigation.js +71 -0
- package/dist/core/queries.d.ts +34 -0
- package/dist/core/queries.js +363 -0
- package/dist/core/retry.d.ts +9 -0
- package/dist/core/retry.js +14 -0
- package/dist/core/seo.d.ts +142 -0
- package/dist/core/seo.js +166 -0
- package/dist/core/theme.d.ts +41 -0
- package/dist/core/theme.js +60 -0
- package/dist/core/translations/cs.json.js +27 -0
- package/dist/core/translations/en.json.js +27 -0
- package/dist/core/types.d.ts +184 -0
- package/dist/core/types.js +9 -0
- package/dist/core/view-model.d.ts +53 -0
- package/dist/core/view-model.js +47 -0
- package/dist/node_modules/@braintree/sanitize-url/dist/constants.js +8 -0
- package/dist/node_modules/@braintree/sanitize-url/dist/index.js +60 -0
- package/dist/node_modules/dompurify/dist/purify.es.js +662 -0
- package/dist/node_modules/semver/classes/comparator.js +56 -0
- package/dist/node_modules/semver/classes/range.js +148 -0
- package/dist/node_modules/semver/classes/semver.js +169 -0
- package/dist/node_modules/semver/functions/clean.js +14 -0
- package/dist/node_modules/semver/functions/cmp.js +39 -0
- package/dist/node_modules/semver/functions/coerce.js +33 -0
- package/dist/node_modules/semver/functions/compare-build.js +14 -0
- package/dist/node_modules/semver/functions/compare-loose.js +11 -0
- package/dist/node_modules/semver/functions/compare.js +11 -0
- package/dist/node_modules/semver/functions/diff.js +24 -0
- package/dist/node_modules/semver/functions/eq.js +11 -0
- package/dist/node_modules/semver/functions/gt.js +11 -0
- package/dist/node_modules/semver/functions/gte.js +11 -0
- package/dist/node_modules/semver/functions/inc.js +21 -0
- package/dist/node_modules/semver/functions/lt.js +11 -0
- package/dist/node_modules/semver/functions/lte.js +11 -0
- package/dist/node_modules/semver/functions/major.js +11 -0
- package/dist/node_modules/semver/functions/minor.js +11 -0
- package/dist/node_modules/semver/functions/neq.js +11 -0
- package/dist/node_modules/semver/functions/parse.js +21 -0
- package/dist/node_modules/semver/functions/patch.js +11 -0
- package/dist/node_modules/semver/functions/prerelease.js +14 -0
- package/dist/node_modules/semver/functions/rcompare.js +11 -0
- package/dist/node_modules/semver/functions/rsort.js +11 -0
- package/dist/node_modules/semver/functions/satisfies.js +18 -0
- package/dist/node_modules/semver/functions/sort.js +11 -0
- package/dist/node_modules/semver/functions/valid.js +14 -0
- package/dist/node_modules/semver/index.js +97 -0
- package/dist/node_modules/semver/internal/constants.js +28 -0
- package/dist/node_modules/semver/internal/debug.js +8 -0
- package/dist/node_modules/semver/internal/identifiers.js +18 -0
- package/dist/node_modules/semver/internal/lrucache.js +32 -0
- package/dist/node_modules/semver/internal/parse-options.js +10 -0
- package/dist/node_modules/semver/internal/re.js +32 -0
- package/dist/node_modules/semver/ranges/gtr.js +11 -0
- package/dist/node_modules/semver/ranges/intersects.js +11 -0
- package/dist/node_modules/semver/ranges/ltr.js +11 -0
- package/dist/node_modules/semver/ranges/max-satisfying.js +22 -0
- package/dist/node_modules/semver/ranges/min-satisfying.js +22 -0
- package/dist/node_modules/semver/ranges/min-version.js +42 -0
- package/dist/node_modules/semver/ranges/outside.js +44 -0
- package/dist/node_modules/semver/ranges/simplify.js +24 -0
- package/dist/node_modules/semver/ranges/subset.js +94 -0
- package/dist/node_modules/semver/ranges/to-comparators.js +11 -0
- package/dist/node_modules/semver/ranges/valid.js +17 -0
- package/dist/nuxt/composables/useAsyncKb.d.ts +32 -0
- package/dist/nuxt/composables/useAsyncKb.js +34 -0
- package/dist/nuxt/index.d.ts +1 -0
- package/dist/nuxt/index.js +6 -0
- package/dist/packages/mdx-render-vue/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/packages/mdx-render-vue/dist/_virtual/constants.js +4 -0
- package/dist/packages/mdx-render-vue/dist/_virtual/index.js +5 -0
- package/dist/packages/mdx-render-vue/dist/_virtual/index2.js +4 -0
- package/dist/packages/mdx-render-vue/dist/composables/useAudioPlayer.js +40 -0
- package/dist/packages/mdx-render-vue/dist/composables/useCallout.js +66 -0
- package/dist/packages/mdx-render-vue/dist/composables/useCodeBlock.js +62 -0
- package/dist/packages/mdx-render-vue/dist/composables/useGallery.js +68 -0
- package/dist/packages/mdx-render-vue/dist/composables/useMedia.js +9 -0
- package/dist/packages/mdx-render-vue/dist/composables/useYouTube.js +24 -0
- package/dist/packages/mdx-render-vue/dist/edit/AlertEdit.vue.js +4 -0
- package/dist/packages/mdx-render-vue/dist/edit/AlertEdit.vue2.js +16 -0
- package/dist/packages/mdx-render-vue/dist/edit/AudioPlayerEdit.vue.js +102 -0
- package/dist/packages/mdx-render-vue/dist/edit/AudioPlayerEdit.vue2.js +4 -0
- package/dist/packages/mdx-render-vue/dist/edit/BadgeEdit.vue.js +4 -0
- package/dist/packages/mdx-render-vue/dist/edit/BadgeEdit.vue2.js +11 -0
- package/dist/packages/mdx-render-vue/dist/edit/ButtonEdit.vue.js +4 -0
- package/dist/packages/mdx-render-vue/dist/edit/ButtonEdit.vue2.js +11 -0
- package/dist/packages/mdx-render-vue/dist/edit/CalloutEdit.vue.js +78 -0
- package/dist/packages/mdx-render-vue/dist/edit/CalloutEdit.vue2.js +4 -0
- package/dist/packages/mdx-render-vue/dist/edit/CardEdit.vue.js +4 -0
- package/dist/packages/mdx-render-vue/dist/edit/CardEdit.vue2.js +16 -0
- package/dist/packages/mdx-render-vue/dist/edit/CodeBlockEdit.vue.js +6 -0
- package/dist/packages/mdx-render-vue/dist/edit/CodeBlockEdit.vue2.js +74 -0
- package/dist/packages/mdx-render-vue/dist/edit/GalleryEdit.vue.js +56 -0
- package/dist/packages/mdx-render-vue/dist/edit/GalleryEdit.vue2.js +4 -0
- package/dist/packages/mdx-render-vue/dist/edit/IconEdit.vue.js +4 -0
- package/dist/packages/mdx-render-vue/dist/edit/IconEdit.vue2.js +11 -0
- package/dist/packages/mdx-render-vue/dist/edit/TooltipEdit.vue.js +4 -0
- package/dist/packages/mdx-render-vue/dist/edit/TooltipEdit.vue2.js +20 -0
- package/dist/packages/mdx-render-vue/dist/edit/YouTubeEdit.vue.js +34 -0
- package/dist/packages/mdx-render-vue/dist/edit/YouTubeEdit.vue2.js +4 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/factory.js +29 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/presence/use-presence-context.js +6 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/presence/use-presence.js +32 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-arrow-tip.js +5 -0
- 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
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-arrow.js +5 -0
- 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
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-content.js +5 -0
- 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
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-context.js +5 -0
- 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
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-positioner.js +5 -0
- 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
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-root-provider.js +5 -0
- 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
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-root.js +5 -0
- 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
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-trigger.js +5 -0
- 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
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip.js +22 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/use-tooltip-context.js +6 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/use-tooltip.js +29 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/providers/environment/use-environment-context.js +12 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/providers/locale/use-locale-context.js +11 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/utils/clean-props.js +8 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/utils/create-context.js +12 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/utils/dynamic.js +25 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/utils/unref-element.js +8 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/utils/use-forward-expose.js +36 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/utils/use-render-strategy.js +5 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@braintree/sanitize-url/dist/constants.js +8 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@braintree/sanitize-url/dist/index.js +60 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +532 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +403 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +136 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +128 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@iconify/vue/dist/iconify.js +1192 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/anatomy/dist/create-anatomy.js +26 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/core/dist/create-machine.js +21 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/core/dist/merge-props.js +45 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/core/dist/scope.js +16 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/core/dist/state.js +136 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/core/dist/types.js +5 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/chunk-QZ7TP4HQ.js +4 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/computed-style.js +8 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/event.js +31 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/node.js +49 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/overflow.js +19 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/platform.js +16 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/query.js +6 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/raf.js +41 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/set.js +14 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/shared.js +7 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/focus-visible/dist/index.js +90 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/popper/dist/get-anchor.js +34 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/popper/dist/get-placement.js +187 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/popper/dist/get-styles.js +47 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/popper/dist/middleware.js +56 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/popper/dist/placement.js +7 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/presence/dist/presence.connect.js +16 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/presence/dist/presence.machine.js +147 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/tooltip/dist/tooltip.anatomy.js +6 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/tooltip/dist/tooltip.connect.js +119 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/tooltip/dist/tooltip.dom.js +15 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/tooltip/dist/tooltip.machine.js +375 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/tooltip/dist/tooltip.store.js +9 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/types/dist/prop-types.js +10 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/utils/dist/array.js +6 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/utils/dist/equal.js +27 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/utils/dist/functions.js +10 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/utils/dist/guard.js +15 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/utils/dist/object.js +13 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/utils/dist/store.js +25 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/utils/dist/warning.js +25 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/vue/dist/bindable.js +37 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/vue/dist/machine.js +205 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/vue/dist/normalize-props.js +30 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/vue/dist/refs.js +14 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/vue/dist/track.js +19 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/dompurify/dist/purify.es.js +659 -0
- package/dist/packages/mdx-render-vue/dist/registry.js +154 -0
- package/dist/packages/mdx-render-vue/dist/render/alert/Alert.vue.js +4 -0
- package/dist/packages/mdx-render-vue/dist/render/alert/Alert.vue2.js +37 -0
- package/dist/packages/mdx-render-vue/dist/render/audioplayer/AudioPlayerDefault.vue.js +102 -0
- package/dist/packages/mdx-render-vue/dist/render/audioplayer/AudioPlayerDefault.vue2.js +4 -0
- package/dist/packages/mdx-render-vue/dist/render/badge/Badge.vue.js +4 -0
- package/dist/packages/mdx-render-vue/dist/render/badge/Badge.vue2.js +25 -0
- package/dist/packages/mdx-render-vue/dist/render/button/Button.vue.js +4 -0
- package/dist/packages/mdx-render-vue/dist/render/button/Button.vue2.js +37 -0
- package/dist/packages/mdx-render-vue/dist/render/callout/CalloutDefault.vue.js +79 -0
- package/dist/packages/mdx-render-vue/dist/render/callout/CalloutDefault.vue2.js +4 -0
- package/dist/packages/mdx-render-vue/dist/render/callout/CalloutMinimal.vue.js +22 -0
- package/dist/packages/mdx-render-vue/dist/render/callout/CalloutMinimal.vue2.js +4 -0
- package/dist/packages/mdx-render-vue/dist/render/card/Card.vue.js +4 -0
- package/dist/packages/mdx-render-vue/dist/render/card/Card.vue2.js +24 -0
- package/dist/packages/mdx-render-vue/dist/render/codeblock/CodeBlockDefault.vue.js +6 -0
- package/dist/packages/mdx-render-vue/dist/render/codeblock/CodeBlockDefault.vue2.js +77 -0
- package/dist/packages/mdx-render-vue/dist/render/gallery/GalleryGrid.vue.js +103 -0
- package/dist/packages/mdx-render-vue/dist/render/gallery/GalleryGrid.vue2.js +4 -0
- package/dist/packages/mdx-render-vue/dist/render/gallery/GalleryLightbox.vue.js +6 -0
- package/dist/packages/mdx-render-vue/dist/render/gallery/GalleryLightbox.vue2.js +142 -0
- package/dist/packages/mdx-render-vue/dist/render/icon/Icon.vue.js +4 -0
- package/dist/packages/mdx-render-vue/dist/render/icon/Icon.vue2.js +23 -0
- package/dist/packages/mdx-render-vue/dist/render/tooltip/Tooltip.vue.js +4 -0
- package/dist/packages/mdx-render-vue/dist/render/tooltip/Tooltip.vue2.js +54 -0
- package/dist/packages/mdx-render-vue/dist/render/youtube/YouTubeDefault.vue.js +69 -0
- package/dist/packages/mdx-render-vue/dist/render/youtube/YouTubeDefault.vue2.js +4 -0
- package/dist/packages/mdx-schema/dist/composables/useMdxParsing.js +139 -0
- package/dist/packages/mdx-schema/dist/metadata/index.js +415 -0
- package/dist/packages/mdx-schema/dist/prepareProps.js +46 -0
- package/dist/packages/mdx-schema/dist/styles/index.js +119 -0
- package/dist/packages/mdx-schema/dist/types/index.js +26 -0
- package/dist/packages/sanitize/dist/html.js +41 -0
- package/dist/react/KbMdxContent.d.ts +35 -0
- package/dist/react/KbMdxContent.js +102 -0
- package/dist/react/context.d.ts +11 -0
- package/dist/react/context.js +5 -0
- package/dist/react/hooks/useImageRenderer.d.ts +6 -0
- package/dist/react/hooks/useImageRenderer.js +9 -0
- package/dist/react/hooks/useKbClient.d.ts +3 -0
- package/dist/react/hooks/useKbClient.js +7 -0
- package/dist/react/hooks/useKbContext.d.ts +3 -0
- package/dist/react/hooks/useKbContext.js +11 -0
- package/dist/react/hooks/useKbI18n.d.ts +7 -0
- package/dist/react/hooks/useKbI18n.js +8 -0
- package/dist/react/hooks/useKbLanguage.d.ts +21 -0
- package/dist/react/hooks/useKbLanguage.js +63 -0
- package/dist/react/hooks/useKbSearch.d.ts +20 -0
- package/dist/react/hooks/useKbSearch.js +22 -0
- package/dist/react/hooks/useMdxContent.d.ts +18 -0
- package/dist/react/hooks/useMdxContent.js +11 -0
- package/dist/react/index.d.ts +21 -0
- package/dist/react/index.js +20 -0
- package/dist/react/provider.d.ts +25 -0
- package/dist/react/provider.js +29 -0
- package/dist/react/server/index.d.ts +38 -0
- package/dist/react/server/index.js +26 -0
- package/dist/sdk.css +1 -0
- package/dist/vue/components/KbAccessGate.vue.d.ts +36 -0
- package/dist/vue/components/KbAccessGate.vue.js +74 -0
- package/dist/vue/components/KbAccessGate.vue2.js +4 -0
- package/dist/vue/components/KbArticleCard.vue.d.ts +34 -0
- package/dist/vue/components/KbArticleCard.vue.js +87 -0
- package/dist/vue/components/KbArticleCard.vue2.js +4 -0
- package/dist/vue/components/KbMdxContent.vue.d.ts +5 -0
- package/dist/vue/components/KbMdxContent.vue.js +7 -0
- package/dist/vue/components/KbMdxContent.vue2.js +82 -0
- package/dist/vue/composables/useArticles.d.ts +30 -0
- package/dist/vue/composables/useArticles.js +36 -0
- package/dist/vue/composables/useImageRenderer.d.ts +6 -0
- package/dist/vue/composables/useImageRenderer.js +9 -0
- package/dist/vue/composables/useKbAuth.d.ts +27 -0
- package/dist/vue/composables/useKbAuth.js +83 -0
- package/dist/vue/composables/useKbClient.d.ts +6 -0
- package/dist/vue/composables/useKbClient.js +13 -0
- package/dist/vue/composables/useKbComments.d.ts +37 -0
- package/dist/vue/composables/useKbComments.js +160 -0
- package/dist/vue/composables/useKbI18n.d.ts +6 -0
- package/dist/vue/composables/useKbI18n.js +8 -0
- package/dist/vue/composables/useKbLanguage.d.ts +22 -0
- package/dist/vue/composables/useKbLanguage.js +63 -0
- package/dist/vue/composables/useNavigation.d.ts +18 -0
- package/dist/vue/composables/useNavigation.js +20 -0
- package/dist/vue/composables/useSearch.d.ts +21 -0
- package/dist/vue/composables/useSearch.js +20 -0
- package/dist/vue/composables/useTags.d.ts +17 -0
- package/dist/vue/composables/useTags.js +36 -0
- package/dist/vue/index.d.ts +22 -0
- package/dist/vue/index.js +36 -0
- package/dist/vue/plugin.d.ts +30 -0
- package/dist/vue/plugin.js +17 -0
- package/package.json +97 -0
- package/src/core/article-seo.ts +101 -0
- package/src/core/auth.ts +138 -0
- package/src/core/blog-config.ts +30 -0
- package/src/core/client-types.ts +58 -0
- package/src/core/client.ts +287 -0
- package/src/core/i18n.ts +84 -0
- package/src/core/index.ts +147 -0
- package/src/core/markdown.ts +178 -0
- package/src/core/navigation.ts +152 -0
- package/src/core/queries.ts +414 -0
- package/src/core/retry.ts +19 -0
- package/src/core/seo.ts +374 -0
- package/src/core/theme.ts +128 -0
- package/src/core/translations/cs.json +225 -0
- package/src/core/translations/en.json +225 -0
- package/src/core/types.ts +231 -0
- package/src/core/view-model.ts +98 -0
- package/src/nuxt/composables/useAsyncKb.ts +119 -0
- package/src/nuxt/index.ts +6 -0
- package/src/react/KbMdxContent.tsx +215 -0
- package/src/react/context.ts +25 -0
- package/src/react/hooks/useImageRenderer.ts +15 -0
- package/src/react/hooks/useKbClient.ts +9 -0
- package/src/react/hooks/useKbContext.ts +13 -0
- package/src/react/hooks/useKbI18n.ts +15 -0
- package/src/react/hooks/useKbLanguage.ts +105 -0
- package/src/react/hooks/useKbSearch.ts +50 -0
- package/src/react/hooks/useMdxContent.tsx +33 -0
- package/src/react/index.ts +31 -0
- package/src/react/provider.tsx +70 -0
- package/src/react/server/index.ts +70 -0
- package/src/vue/components/KbAccessGate.vue +86 -0
- package/src/vue/components/KbArticleCard.vue +102 -0
- package/src/vue/components/KbMdxContent.vue +211 -0
- package/src/vue/composables/useArticles.ts +78 -0
- package/src/vue/composables/useImageRenderer.ts +12 -0
- package/src/vue/composables/useKbAuth.ts +131 -0
- package/src/vue/composables/useKbClient.ts +17 -0
- package/src/vue/composables/useKbComments.ts +281 -0
- package/src/vue/composables/useKbI18n.ts +11 -0
- package/src/vue/composables/useKbLanguage.ts +103 -0
- package/src/vue/composables/useNavigation.ts +38 -0
- package/src/vue/composables/useSearch.ts +52 -0
- package/src/vue/composables/useTags.ts +64 -0
- package/src/vue/index.ts +27 -0
- package/src/vue/plugin.ts +73 -0
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
const t = `
|
|
2
|
+
query AccessibleArticles($status: String, $tags: [String!], $tagMode: String, $limit: Int, $offset: Int) {
|
|
3
|
+
accessibleKbArticles(status: $status, tags: $tags, tagMode: $tagMode, limit: $limit, offset: $offset) {
|
|
4
|
+
articles {
|
|
5
|
+
id
|
|
6
|
+
filename
|
|
7
|
+
title
|
|
8
|
+
description
|
|
9
|
+
contentType
|
|
10
|
+
status
|
|
11
|
+
publishedAt
|
|
12
|
+
updatedAt
|
|
13
|
+
tags
|
|
14
|
+
featuredImageUrl
|
|
15
|
+
}
|
|
16
|
+
totalCount
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
`, a = `
|
|
20
|
+
query ArticleWithTranslation($filename: String!, $languageCode: String!) {
|
|
21
|
+
articleWithTranslation(filename: $filename, languageCode: $languageCode) {
|
|
22
|
+
id
|
|
23
|
+
filename
|
|
24
|
+
contentType
|
|
25
|
+
status
|
|
26
|
+
description
|
|
27
|
+
sourceLanguageCode
|
|
28
|
+
createdAt
|
|
29
|
+
updatedAt
|
|
30
|
+
publishedAt
|
|
31
|
+
title
|
|
32
|
+
content
|
|
33
|
+
languageCode
|
|
34
|
+
isSource
|
|
35
|
+
isFallback
|
|
36
|
+
featuredImageUrl
|
|
37
|
+
featuredImageGeo {
|
|
38
|
+
latitude
|
|
39
|
+
longitude
|
|
40
|
+
altitude
|
|
41
|
+
placeName
|
|
42
|
+
}
|
|
43
|
+
contentImagesGeo {
|
|
44
|
+
url
|
|
45
|
+
latitude
|
|
46
|
+
longitude
|
|
47
|
+
altitude
|
|
48
|
+
placeName
|
|
49
|
+
}
|
|
50
|
+
accessRights
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
`, n = `
|
|
54
|
+
query ArticleAliasTarget($filename: String!) {
|
|
55
|
+
articleAliasTarget(filename: $filename)
|
|
56
|
+
}
|
|
57
|
+
`, o = `
|
|
58
|
+
query SearchKnowledgeBase($query: String!, $tags: [String!], $contentType: String, $limit: Int, $minSimilarity: Float, $searchMode: SearchMode) {
|
|
59
|
+
searchKnowledgeBase(query: $query, tags: $tags, contentType: $contentType, limit: $limit, minSimilarity: $minSimilarity, searchMode: $searchMode) {
|
|
60
|
+
articleId
|
|
61
|
+
filename
|
|
62
|
+
title
|
|
63
|
+
chunkText
|
|
64
|
+
similarity
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
`, r = `
|
|
68
|
+
query GetKBContext($query: String!, $maxChunks: Int) {
|
|
69
|
+
getKBContext(query: $query, maxChunks: $maxChunks) {
|
|
70
|
+
chunks {
|
|
71
|
+
filename
|
|
72
|
+
title
|
|
73
|
+
text
|
|
74
|
+
similarity
|
|
75
|
+
}
|
|
76
|
+
totalChunks
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
`, i = `
|
|
80
|
+
query KbNavigation($scope: String, $locale: String) {
|
|
81
|
+
kbNavigation(scope: $scope, locale: $locale)
|
|
82
|
+
}
|
|
83
|
+
`, s = `
|
|
84
|
+
query AccessibleTags {
|
|
85
|
+
accessibleKbTags {
|
|
86
|
+
tags {
|
|
87
|
+
id
|
|
88
|
+
slug
|
|
89
|
+
name
|
|
90
|
+
description
|
|
91
|
+
color
|
|
92
|
+
}
|
|
93
|
+
totalCount
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
`, c = `
|
|
97
|
+
query LocalizedTags($languageCode: String!) {
|
|
98
|
+
localizedTags(languageCode: $languageCode) {
|
|
99
|
+
id
|
|
100
|
+
name
|
|
101
|
+
slug
|
|
102
|
+
description
|
|
103
|
+
color
|
|
104
|
+
accessLevel
|
|
105
|
+
languageCode
|
|
106
|
+
isFallback
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
`, l = `
|
|
110
|
+
query KBLanguages {
|
|
111
|
+
kbLanguages {
|
|
112
|
+
id
|
|
113
|
+
code
|
|
114
|
+
name
|
|
115
|
+
nativeName
|
|
116
|
+
isSource
|
|
117
|
+
isEnabled
|
|
118
|
+
sortOrder
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
`, m = `
|
|
122
|
+
query ArticleTranslations($sourceFilename: String!) {
|
|
123
|
+
listArticleTranslations(sourceFilename: $sourceFilename) {
|
|
124
|
+
id
|
|
125
|
+
languageCode
|
|
126
|
+
title
|
|
127
|
+
syncStatus
|
|
128
|
+
reviewed
|
|
129
|
+
updatedAt
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
`, u = `
|
|
133
|
+
query GetTranslation($sourceFilename: String!, $languageCode: String!) {
|
|
134
|
+
getTranslation(sourceFilename: $sourceFilename, languageCode: $languageCode) {
|
|
135
|
+
id
|
|
136
|
+
articleId
|
|
137
|
+
languageCode
|
|
138
|
+
title
|
|
139
|
+
content
|
|
140
|
+
syncStatus
|
|
141
|
+
reviewed
|
|
142
|
+
translatedBy
|
|
143
|
+
updatedAt
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
`, e = `
|
|
147
|
+
id
|
|
148
|
+
articleId
|
|
149
|
+
userId
|
|
150
|
+
userName
|
|
151
|
+
parentCommentId
|
|
152
|
+
displayContent
|
|
153
|
+
displayLanguageCode
|
|
154
|
+
sourceLanguageCode
|
|
155
|
+
sourceContent
|
|
156
|
+
isPendingTranslation
|
|
157
|
+
isTranslated
|
|
158
|
+
isEdited
|
|
159
|
+
createdAt
|
|
160
|
+
`, d = `
|
|
161
|
+
query ArticleComments($articleId: ID!, $languageCode: String!) {
|
|
162
|
+
articleComments(articleId: $articleId, languageCode: $languageCode) {
|
|
163
|
+
comments {
|
|
164
|
+
${e}
|
|
165
|
+
replies {
|
|
166
|
+
${e}
|
|
167
|
+
replies {
|
|
168
|
+
${e}
|
|
169
|
+
replies {
|
|
170
|
+
${e}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
totalCount
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
`, g = `
|
|
179
|
+
query GetComment($commentId: ID!, $languageCode: String!) {
|
|
180
|
+
comment(commentId: $commentId, languageCode: $languageCode) {
|
|
181
|
+
${e}
|
|
182
|
+
replies {
|
|
183
|
+
${e}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
`, $ = `
|
|
188
|
+
mutation CreateComment($articleId: ID!, $content: String!, $sourceLanguageCode: String!, $parentCommentId: ID) {
|
|
189
|
+
createComment(articleId: $articleId, content: $content, sourceLanguageCode: $sourceLanguageCode, parentCommentId: $parentCommentId) {
|
|
190
|
+
success
|
|
191
|
+
error
|
|
192
|
+
comment {
|
|
193
|
+
${e}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
`, C = `
|
|
198
|
+
mutation UpdateComment($commentId: ID!, $content: String!) {
|
|
199
|
+
updateComment(commentId: $commentId, content: $content) {
|
|
200
|
+
success
|
|
201
|
+
error
|
|
202
|
+
comment {
|
|
203
|
+
${e}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
`, S = `
|
|
208
|
+
mutation DeleteComment($commentId: ID!) {
|
|
209
|
+
deleteComment(commentId: $commentId) {
|
|
210
|
+
success
|
|
211
|
+
error
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
`, I = `
|
|
215
|
+
subscription CommentUpdates($articleId: ID!) {
|
|
216
|
+
commentUpdates(articleId: $articleId) {
|
|
217
|
+
type
|
|
218
|
+
commentId
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
`, p = `
|
|
222
|
+
mutation Login($email: String!, $password: String!) {
|
|
223
|
+
login(email: $email, password: $password) {
|
|
224
|
+
success
|
|
225
|
+
token
|
|
226
|
+
user {
|
|
227
|
+
id
|
|
228
|
+
email
|
|
229
|
+
name
|
|
230
|
+
accessLevel
|
|
231
|
+
}
|
|
232
|
+
error
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
`, T = `
|
|
236
|
+
mutation Register($email: String!, $password: String!, $name: String) {
|
|
237
|
+
register(email: $email, password: $password, name: $name) {
|
|
238
|
+
success
|
|
239
|
+
message
|
|
240
|
+
error
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
`, E = `
|
|
244
|
+
mutation VerifyEmail($token: String!) {
|
|
245
|
+
verifyEmail(token: $token) {
|
|
246
|
+
success
|
|
247
|
+
error
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
`, A = `
|
|
251
|
+
mutation ForgotPassword($email: String!) {
|
|
252
|
+
forgotPassword(email: $email) {
|
|
253
|
+
success
|
|
254
|
+
message
|
|
255
|
+
error
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
`, R = `
|
|
259
|
+
mutation ResetPassword($token: String!, $password: String!) {
|
|
260
|
+
resetPassword(token: $token, password: $password) {
|
|
261
|
+
success
|
|
262
|
+
error
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
`, f = `
|
|
266
|
+
mutation ResendVerification($email: String!) {
|
|
267
|
+
resendVerification(email: $email) {
|
|
268
|
+
success
|
|
269
|
+
message
|
|
270
|
+
error
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
`, y = `
|
|
274
|
+
mutation ChangePassword($currentPassword: String!, $newPassword: String!) {
|
|
275
|
+
changePassword(currentPassword: $currentPassword, newPassword: $newPassword) {
|
|
276
|
+
success
|
|
277
|
+
error
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
`, N = `
|
|
281
|
+
mutation UpdateMyProfile($name: String, $email: String) {
|
|
282
|
+
updateMyProfile(name: $name, email: $email) {
|
|
283
|
+
success
|
|
284
|
+
emailChanged
|
|
285
|
+
user {
|
|
286
|
+
id
|
|
287
|
+
email
|
|
288
|
+
name
|
|
289
|
+
accessLevel
|
|
290
|
+
}
|
|
291
|
+
error
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
`, L = `
|
|
295
|
+
query MyReportSettings {
|
|
296
|
+
myReportSettings {
|
|
297
|
+
autoReportErrors
|
|
298
|
+
autoReportContent
|
|
299
|
+
autoReportPerformance
|
|
300
|
+
includeContextData
|
|
301
|
+
rateLimitPerHour
|
|
302
|
+
emailNotifications
|
|
303
|
+
feedbackNotifications
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
`, P = `
|
|
307
|
+
mutation UpdateMyReportSettings(
|
|
308
|
+
$autoReportErrors: String
|
|
309
|
+
$autoReportContent: String
|
|
310
|
+
$autoReportPerformance: String
|
|
311
|
+
$includeContextData: Boolean
|
|
312
|
+
$rateLimitPerHour: Int
|
|
313
|
+
$emailNotifications: String
|
|
314
|
+
$feedbackNotifications: String
|
|
315
|
+
) {
|
|
316
|
+
updateMyReportSettings(
|
|
317
|
+
autoReportErrors: $autoReportErrors
|
|
318
|
+
autoReportContent: $autoReportContent
|
|
319
|
+
autoReportPerformance: $autoReportPerformance
|
|
320
|
+
includeContextData: $includeContextData
|
|
321
|
+
rateLimitPerHour: $rateLimitPerHour
|
|
322
|
+
emailNotifications: $emailNotifications
|
|
323
|
+
feedbackNotifications: $feedbackNotifications
|
|
324
|
+
) {
|
|
325
|
+
autoReportErrors
|
|
326
|
+
autoReportContent
|
|
327
|
+
autoReportPerformance
|
|
328
|
+
includeContextData
|
|
329
|
+
rateLimitPerHour
|
|
330
|
+
emailNotifications
|
|
331
|
+
feedbackNotifications
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
`;
|
|
335
|
+
export {
|
|
336
|
+
t as ACCESSIBLE_ARTICLES,
|
|
337
|
+
s as ACCESSIBLE_TAGS,
|
|
338
|
+
n as ARTICLE_ALIAS_TARGET,
|
|
339
|
+
d as ARTICLE_COMMENTS,
|
|
340
|
+
m as ARTICLE_TRANSLATIONS,
|
|
341
|
+
a as ARTICLE_WITH_TRANSLATION,
|
|
342
|
+
y as CHANGE_PASSWORD,
|
|
343
|
+
I as COMMENT_UPDATES_SUBSCRIPTION,
|
|
344
|
+
$ as CREATE_COMMENT,
|
|
345
|
+
S as DELETE_COMMENT,
|
|
346
|
+
A as FORGOT_PASSWORD,
|
|
347
|
+
g as GET_COMMENT,
|
|
348
|
+
r as GET_KB_CONTEXT,
|
|
349
|
+
u as GET_TRANSLATION,
|
|
350
|
+
l as KB_LANGUAGES,
|
|
351
|
+
i as KB_NAVIGATION,
|
|
352
|
+
c as LOCALIZED_TAGS,
|
|
353
|
+
p as LOGIN,
|
|
354
|
+
L as MY_REPORT_SETTINGS,
|
|
355
|
+
T as REGISTER,
|
|
356
|
+
f as RESEND_VERIFICATION,
|
|
357
|
+
R as RESET_PASSWORD,
|
|
358
|
+
o as SEARCH_KNOWLEDGE_BASE,
|
|
359
|
+
C as UPDATE_COMMENT,
|
|
360
|
+
N as UPDATE_MY_PROFILE,
|
|
361
|
+
P as UPDATE_MY_REPORT_SETTINGS,
|
|
362
|
+
E as VERIFY_EMAIL
|
|
363
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retry a function with exponential backoff.
|
|
3
|
+
* Used for startup fetches that may fail if upstream services aren't ready yet.
|
|
4
|
+
*/
|
|
5
|
+
export declare function retryWithBackoff<T>(fn: () => Promise<T>, { retries, initialDelay, maxDelay }?: {
|
|
6
|
+
retries?: number | undefined;
|
|
7
|
+
initialDelay?: number | undefined;
|
|
8
|
+
maxDelay?: number | undefined;
|
|
9
|
+
}): Promise<T>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
async function i(a, { retries: r = 3, initialDelay: e = 500, maxDelay: o = 5e3 } = {}) {
|
|
2
|
+
for (let t = 1; t <= r; t++)
|
|
3
|
+
try {
|
|
4
|
+
return await a();
|
|
5
|
+
} catch (n) {
|
|
6
|
+
if (t === r) throw n;
|
|
7
|
+
const c = Math.min(e * Math.pow(2, t - 1), o);
|
|
8
|
+
await new Promise((h) => setTimeout(h, c));
|
|
9
|
+
}
|
|
10
|
+
throw new Error("Unreachable");
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
i as retryWithBackoff
|
|
14
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework-agnostic SEO model builders.
|
|
3
|
+
*
|
|
4
|
+
* These compute the complete SEO surface (title, description, canonical,
|
|
5
|
+
* hreflang, Open Graph, Twitter card, schema.org JSON-LD) for the blog's page
|
|
6
|
+
* types ONCE, in pure code, so the Nuxt and Next.js reference implementations
|
|
7
|
+
* cannot drift. Each framework only maps the returned `SeoModel` into its own
|
|
8
|
+
* head mechanism (`useHead` for Nuxt, `generateMetadata` + a JSON-LD script for
|
|
9
|
+
* Next.js).
|
|
10
|
+
*
|
|
11
|
+
* i18n stays in the framework layer: callers pass already-translated strings
|
|
12
|
+
* (page title pieces, brand suffix, description).
|
|
13
|
+
*/
|
|
14
|
+
import type { MediaGeo, ContentImageGeo } from './types';
|
|
15
|
+
export type LocalePrefixStrategy = 'prefix_except_default';
|
|
16
|
+
export interface SeoConfig {
|
|
17
|
+
/** Absolute site origin, no trailing slash, e.g. `https://blog.example.com`. */
|
|
18
|
+
siteUrl: string;
|
|
19
|
+
/** Human site name used for `og:site_name` and the WebSite/Organization name. */
|
|
20
|
+
siteName: string;
|
|
21
|
+
/** Enabled locale codes in display order, e.g. `['cs', 'en']`. */
|
|
22
|
+
locales: string[];
|
|
23
|
+
/** Default locale (rendered without a URL prefix). */
|
|
24
|
+
defaultLocale: string;
|
|
25
|
+
/** URL strategy. Only `prefix_except_default` is supported today. */
|
|
26
|
+
localePrefixStrategy?: LocalePrefixStrategy;
|
|
27
|
+
}
|
|
28
|
+
export interface SeoHreflang {
|
|
29
|
+
hreflang: string;
|
|
30
|
+
href: string;
|
|
31
|
+
}
|
|
32
|
+
export interface SeoOpenGraph {
|
|
33
|
+
title: string;
|
|
34
|
+
description: string;
|
|
35
|
+
type: 'website' | 'article';
|
|
36
|
+
url: string;
|
|
37
|
+
siteName: string;
|
|
38
|
+
image?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface SeoTwitter {
|
|
41
|
+
card: 'summary' | 'summary_large_image';
|
|
42
|
+
title: string;
|
|
43
|
+
description: string;
|
|
44
|
+
image?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface SeoModel {
|
|
47
|
+
/** The document `<title>`. */
|
|
48
|
+
title: string;
|
|
49
|
+
description: string;
|
|
50
|
+
/** Absolute canonical URL of the current page. */
|
|
51
|
+
canonical: string;
|
|
52
|
+
/** `<html lang>` value. */
|
|
53
|
+
htmlLang: string;
|
|
54
|
+
/** Alternate-language links, including an `x-default` pointing at the default locale. */
|
|
55
|
+
hreflang: SeoHreflang[];
|
|
56
|
+
og: SeoOpenGraph;
|
|
57
|
+
twitter: SeoTwitter;
|
|
58
|
+
/** Present only for article pages. */
|
|
59
|
+
articleMeta?: {
|
|
60
|
+
publishedTime?: string;
|
|
61
|
+
modifiedTime?: string;
|
|
62
|
+
};
|
|
63
|
+
/** schema.org JSON-LD object (serialize into a `<script type="application/ld+json">`). */
|
|
64
|
+
jsonLd: Record<string, unknown>;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Build a locale-aware path from a locale-agnostic logical path.
|
|
68
|
+
*
|
|
69
|
+
* Mirrors Nuxt i18n `prefix_except_default`: the default locale gets no prefix,
|
|
70
|
+
* every other locale gets a `/<locale>` prefix.
|
|
71
|
+
*/
|
|
72
|
+
export declare function localizedHref(logicalPath: string, locale: string, config: SeoConfig): string;
|
|
73
|
+
/**
|
|
74
|
+
* Remove a leading non-default locale prefix from a path, yielding the
|
|
75
|
+
* locale-agnostic logical path. `/en/articles/x` → `/articles/x`, `/en` → `/`.
|
|
76
|
+
*/
|
|
77
|
+
export declare function stripLocalePrefix(path: string, config: SeoConfig): string;
|
|
78
|
+
/**
|
|
79
|
+
* Join a site origin and a path into an absolute URL. The root path collapses to
|
|
80
|
+
* the bare origin (no trailing slash) so that trailing-slash-normalizing SSR
|
|
81
|
+
* frameworks (Next.js, default `trailingSlash:false`) and non-normalizing ones
|
|
82
|
+
* (Nuxt) emit byte-identical canonical/hreflang URLs for the home page.
|
|
83
|
+
*/
|
|
84
|
+
export declare function pageUrl(siteUrl: string, path: string): string;
|
|
85
|
+
/** Minimal structural shape an article needs to expose for SEO. */
|
|
86
|
+
export interface ArticleSeoSource {
|
|
87
|
+
title?: string;
|
|
88
|
+
description?: string | null;
|
|
89
|
+
content?: string;
|
|
90
|
+
featuredImageUrl?: string | null;
|
|
91
|
+
/**
|
|
92
|
+
* Geo of the featured image — present ONLY when the image opted in (the API
|
|
93
|
+
* gates this). When set, the JSON-LD image becomes an ImageObject with
|
|
94
|
+
* `contentLocation`, and the article gains `spatialCoverage`.
|
|
95
|
+
*/
|
|
96
|
+
featuredImageGeo?: MediaGeo | null;
|
|
97
|
+
/**
|
|
98
|
+
* Geo for opted-in images referenced in the article body. Each becomes an
|
|
99
|
+
* additional ImageObject (with `contentLocation`) in the JSON-LD `image`
|
|
100
|
+
* array. Gated server-side — only opted-in images appear here.
|
|
101
|
+
*/
|
|
102
|
+
contentImagesGeo?: ContentImageGeo[] | null;
|
|
103
|
+
publishedAt?: string | null;
|
|
104
|
+
updatedAt?: string | null;
|
|
105
|
+
}
|
|
106
|
+
export interface BuildArticleSeoOptions {
|
|
107
|
+
article: ArticleSeoSource;
|
|
108
|
+
config: SeoConfig;
|
|
109
|
+
/** Locale currently being rendered. */
|
|
110
|
+
locale: string;
|
|
111
|
+
/** Current request path including any locale prefix, e.g. `/en/articles/x`. */
|
|
112
|
+
routePath: string;
|
|
113
|
+
/** Translated brand suffix appended to the title (e.g. "Knowledge Base"). */
|
|
114
|
+
brandSuffix: string;
|
|
115
|
+
/** Translated fallback used when the article has no title (e.g. "Articles"). */
|
|
116
|
+
fallbackTitle: string;
|
|
117
|
+
}
|
|
118
|
+
export declare function buildArticleSeo(opts: BuildArticleSeoOptions): SeoModel;
|
|
119
|
+
export interface BuildListPageSeoOptions {
|
|
120
|
+
/** Fully-composed page title (caller includes the brand suffix). */
|
|
121
|
+
title: string;
|
|
122
|
+
description: string;
|
|
123
|
+
config: SeoConfig;
|
|
124
|
+
locale: string;
|
|
125
|
+
routePath: string;
|
|
126
|
+
/** schema.org `CollectionPage` name; defaults to `title`. */
|
|
127
|
+
jsonLdName?: string;
|
|
128
|
+
/** Optional social image (absolutized if relative). */
|
|
129
|
+
image?: string | null;
|
|
130
|
+
}
|
|
131
|
+
/** Builds SEO for `/articles`, `/topics`, and `/topics/[slug]` (CollectionPage). */
|
|
132
|
+
export declare function buildListPageSeo(opts: BuildListPageSeoOptions): SeoModel;
|
|
133
|
+
export interface BuildHomeSeoOptions {
|
|
134
|
+
/** Translated home title (the document `<title>`). */
|
|
135
|
+
title: string;
|
|
136
|
+
description: string;
|
|
137
|
+
config: SeoConfig;
|
|
138
|
+
locale: string;
|
|
139
|
+
routePath: string;
|
|
140
|
+
}
|
|
141
|
+
/** Builds SEO for the home page (WebSite JSON-LD with a SearchAction). */
|
|
142
|
+
export declare function buildHomeSeo(opts: BuildHomeSeoOptions): SeoModel;
|
package/dist/core/seo.js
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { generateDescription as O } from "./article-seo.js";
|
|
2
|
+
const T = 25;
|
|
3
|
+
function S(t, e, i) {
|
|
4
|
+
const a = t.startsWith("/") ? t : `/${t}`;
|
|
5
|
+
return e === i.defaultLocale ? a : a === "/" ? `/${e}` : `/${e}${a}`;
|
|
6
|
+
}
|
|
7
|
+
function v(t, e) {
|
|
8
|
+
for (const i of e.locales)
|
|
9
|
+
if (i !== e.defaultLocale) {
|
|
10
|
+
if (t === `/${i}`) return "/";
|
|
11
|
+
if (t.startsWith(`/${i}/`)) return t.slice(i.length + 1);
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
}
|
|
15
|
+
function d(t, e) {
|
|
16
|
+
return e === "/" ? t : `${t}${e}`;
|
|
17
|
+
}
|
|
18
|
+
function L(t, e) {
|
|
19
|
+
const i = v(t, e), a = e.locales.map((n) => ({
|
|
20
|
+
hreflang: n,
|
|
21
|
+
href: d(e.siteUrl, S(i, n, e))
|
|
22
|
+
}));
|
|
23
|
+
return a.push({
|
|
24
|
+
hreflang: "x-default",
|
|
25
|
+
href: d(e.siteUrl, S(i, e.defaultLocale, e))
|
|
26
|
+
}), a;
|
|
27
|
+
}
|
|
28
|
+
function N(t, e) {
|
|
29
|
+
if (t)
|
|
30
|
+
return t.startsWith("http") ? t : `${e}${t}`;
|
|
31
|
+
}
|
|
32
|
+
function j(t) {
|
|
33
|
+
if (!(!t || typeof t.latitude != "number" || typeof t.longitude != "number"))
|
|
34
|
+
return {
|
|
35
|
+
"@type": "Place",
|
|
36
|
+
...t.placeName ? { name: t.placeName } : {},
|
|
37
|
+
geo: {
|
|
38
|
+
"@type": "GeoCoordinates",
|
|
39
|
+
latitude: t.latitude,
|
|
40
|
+
longitude: t.longitude,
|
|
41
|
+
...t.altitude != null ? { elevation: t.altitude } : {}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function C(t) {
|
|
46
|
+
const { article: e, config: i, locale: a, routePath: n, brandSuffix: l, fallbackTitle: o } = t, m = e.title || "", s = m || o, c = `${s} | ${l}`, f = e.description || O(e.content || "") || l, h = d(i.siteUrl, n), r = N(e.featuredImageUrl, i.siteUrl), x = {
|
|
47
|
+
title: s,
|
|
48
|
+
description: f,
|
|
49
|
+
type: "article",
|
|
50
|
+
url: h,
|
|
51
|
+
siteName: i.siteName,
|
|
52
|
+
...r ? { image: r } : {}
|
|
53
|
+
}, I = {
|
|
54
|
+
card: r ? "summary_large_image" : "summary",
|
|
55
|
+
title: s,
|
|
56
|
+
description: f,
|
|
57
|
+
...r ? { image: r } : {}
|
|
58
|
+
}, U = {
|
|
59
|
+
...e.publishedAt ? { publishedTime: e.publishedAt } : {},
|
|
60
|
+
...e.updatedAt ? { modifiedTime: e.updatedAt } : {}
|
|
61
|
+
}, g = j(e.featuredImageGeo), u = [], b = /* @__PURE__ */ new Set();
|
|
62
|
+
let y;
|
|
63
|
+
r && (b.add(r), u.push(g ? { "@type": "ImageObject", url: r, contentLocation: g } : r));
|
|
64
|
+
for (const _ of e.contentImagesGeo ?? []) {
|
|
65
|
+
if (u.length >= T) break;
|
|
66
|
+
const p = N(_.url, i.siteUrl);
|
|
67
|
+
if (!p || b.has(p)) continue;
|
|
68
|
+
const A = j(_);
|
|
69
|
+
A && (b.add(p), y || (y = A), u.push({ "@type": "ImageObject", url: p, contentLocation: A }));
|
|
70
|
+
}
|
|
71
|
+
const $ = u.length > 1 ? u : u[0], P = g ?? y, w = {
|
|
72
|
+
"@context": "https://schema.org",
|
|
73
|
+
"@type": "Article",
|
|
74
|
+
headline: m,
|
|
75
|
+
description: f,
|
|
76
|
+
url: h,
|
|
77
|
+
...$ !== void 0 ? { image: $ } : {},
|
|
78
|
+
...P ? { spatialCoverage: P } : {},
|
|
79
|
+
...e.publishedAt ? { datePublished: e.publishedAt } : {},
|
|
80
|
+
...e.updatedAt ? { dateModified: e.updatedAt } : {},
|
|
81
|
+
publisher: { "@type": "Organization", name: i.siteName }
|
|
82
|
+
};
|
|
83
|
+
return {
|
|
84
|
+
title: c,
|
|
85
|
+
description: f,
|
|
86
|
+
canonical: h,
|
|
87
|
+
htmlLang: a,
|
|
88
|
+
hreflang: L(n, i),
|
|
89
|
+
og: x,
|
|
90
|
+
twitter: I,
|
|
91
|
+
...Object.keys(U).length ? { articleMeta: U } : {},
|
|
92
|
+
jsonLd: w
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function M(t) {
|
|
96
|
+
const { title: e, description: i, config: a, locale: n, routePath: l, jsonLdName: o, image: m } = t, s = d(a.siteUrl, l), c = N(m, a.siteUrl);
|
|
97
|
+
return {
|
|
98
|
+
title: e,
|
|
99
|
+
description: i,
|
|
100
|
+
canonical: s,
|
|
101
|
+
htmlLang: n,
|
|
102
|
+
hreflang: L(l, a),
|
|
103
|
+
og: {
|
|
104
|
+
title: e,
|
|
105
|
+
description: i,
|
|
106
|
+
type: "website",
|
|
107
|
+
url: s,
|
|
108
|
+
siteName: a.siteName,
|
|
109
|
+
...c ? { image: c } : {}
|
|
110
|
+
},
|
|
111
|
+
twitter: {
|
|
112
|
+
card: c ? "summary_large_image" : "summary",
|
|
113
|
+
title: e,
|
|
114
|
+
description: i,
|
|
115
|
+
...c ? { image: c } : {}
|
|
116
|
+
},
|
|
117
|
+
jsonLd: {
|
|
118
|
+
"@context": "https://schema.org",
|
|
119
|
+
"@type": "CollectionPage",
|
|
120
|
+
name: o ?? e,
|
|
121
|
+
description: i,
|
|
122
|
+
url: s
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
function W(t) {
|
|
127
|
+
const { title: e, description: i, config: a, locale: n, routePath: l } = t, o = d(a.siteUrl, l);
|
|
128
|
+
return {
|
|
129
|
+
title: e,
|
|
130
|
+
description: i,
|
|
131
|
+
canonical: o,
|
|
132
|
+
htmlLang: n,
|
|
133
|
+
hreflang: L(l, a),
|
|
134
|
+
og: {
|
|
135
|
+
title: a.siteName,
|
|
136
|
+
description: i,
|
|
137
|
+
type: "website",
|
|
138
|
+
url: o,
|
|
139
|
+
siteName: a.siteName
|
|
140
|
+
},
|
|
141
|
+
twitter: {
|
|
142
|
+
card: "summary",
|
|
143
|
+
title: a.siteName,
|
|
144
|
+
description: i
|
|
145
|
+
},
|
|
146
|
+
jsonLd: {
|
|
147
|
+
"@context": "https://schema.org",
|
|
148
|
+
"@type": "WebSite",
|
|
149
|
+
name: a.siteName,
|
|
150
|
+
url: o,
|
|
151
|
+
potentialAction: {
|
|
152
|
+
"@type": "SearchAction",
|
|
153
|
+
target: `${a.siteUrl}/search?q={search_term_string}`,
|
|
154
|
+
"query-input": "required name=search_term_string"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
export {
|
|
160
|
+
C as buildArticleSeo,
|
|
161
|
+
W as buildHomeSeo,
|
|
162
|
+
M as buildListPageSeo,
|
|
163
|
+
S as localizedHref,
|
|
164
|
+
d as pageUrl,
|
|
165
|
+
v as stripLocalePrefix
|
|
166
|
+
};
|