@scalar/api-reference 1.55.0 → 1.55.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @scalar/api-reference
2
2
 
3
+ ## 1.55.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#9023](https://github.com/scalar/scalar/pull/9023): chore: use homemade slugger
8
+
3
9
  ## 1.55.0
4
10
 
5
11
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"InfoDescription.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-info-block/components/InfoDescription.vue"],"names":[],"mappings":"AA4GA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAMvE,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,oBAAoB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;IAClD,wBAAwB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAC;AAkHF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"InfoDescription.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-info-block/components/InfoDescription.vue"],"names":[],"mappings":"AA6GA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAKvE,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,oBAAoB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;IAClD,wBAAwB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAC;AAkHF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_exp
2
2
  import InfoDescription_vue_vue_type_script_setup_true_lang_default from "./InfoDescription.vue.script.js";
3
3
  /* empty css */
4
4
  //#region src/blocks/scalar-info-block/components/InfoDescription.vue
5
- var InfoDescription_default = /* @__PURE__ */ _plugin_vue_export_helper_default(InfoDescription_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-5065bb4a"]]);
5
+ var InfoDescription_default = /* @__PURE__ */ _plugin_vue_export_helper_default(InfoDescription_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-0370764f"]]);
6
6
  //#endregion
7
7
  export { InfoDescription_default as default };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"InfoDescription.vue.js","names":[],"sources":["../../../../src/blocks/scalar-info-block/components/InfoDescription.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n getHeadings,\n isHeading,\n splitContent,\n textFromNode,\n type Node,\n} from '@scalar/code-highlight/markdown'\nimport type { Heading } from '@scalar/types/legacy'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport GitHubSlugger from 'github-slugger'\nimport { computed } from 'vue'\n\nimport InfoMarkdownSection from './InfoMarkdownSection.vue'\n\nconst { description, headingSlugGenerator } = defineProps<{\n eventBus: WorkspaceEventBus | null\n headingSlugGenerator: (heading: Heading) => string\n /** Markdown document */\n description?: string\n}>()\n\n/**\n * Descriptions, but split into multiple sections.\n * We need this to wrap the headings in IntersectionObserver components.\n */\nconst sections = computed(() => {\n if (!description) {\n return []\n }\n\n const slugger = new GitHubSlugger()\n\n const items = splitContent(description).map((markdown) => {\n // Get “first” (and only) heading, if available\n const headings = getHeadings(markdown)\n const heading = headings[0]\n\n // Generate an id for the heading\n const id = heading\n ? headingSlugGenerator({\n ...heading,\n slug: slugger.slug(heading.value),\n })\n : undefined\n\n return {\n id,\n content: markdown,\n }\n })\n\n return items\n})\n\n/** Add ids to all headings */\nconst transformHeading = (node: Node) => {\n if (!isHeading(node)) {\n return node\n }\n\n const slugger = new GitHubSlugger()\n\n const value = textFromNode(node)\n\n node.data = {\n hProperties: {\n id: headingSlugGenerator({\n depth: node.depth,\n value,\n slug: slugger.slug(value),\n }),\n },\n }\n\n return node\n}\n</script>\n\n<template>\n <div\n v-if=\"description\"\n class=\"introduction-description mt-6 flex flex-col\">\n <InfoMarkdownSection\n v-for=\"section in sections\"\n :id=\"section.id\"\n :key=\"section.id\"\n :content=\"section.content\"\n :eventBus=\"eventBus\"\n :transformHeading=\"transformHeading\" />\n </div>\n</template>\n\n<style scoped>\n.references-classic .introduction-description :deep(img) {\n max-width: 720px;\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"InfoDescription.vue.js","names":[],"sources":["../../../../src/blocks/scalar-info-block/components/InfoDescription.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n getHeadings,\n isHeading,\n splitContent,\n textFromNode,\n type Node,\n} from '@scalar/code-highlight/markdown'\nimport { slugger } from '@scalar/helpers/string/slugger'\nimport type { Heading } from '@scalar/types/legacy'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { computed } from 'vue'\n\nimport InfoMarkdownSection from './InfoMarkdownSection.vue'\n\nconst { description, headingSlugGenerator } = defineProps<{\n eventBus: WorkspaceEventBus | null\n headingSlugGenerator: (heading: Heading) => string\n /** Markdown document */\n description?: string\n}>()\n\n/**\n * Descriptions, but split into multiple sections.\n * We need this to wrap the headings in IntersectionObserver components.\n */\nconst sections = computed(() => {\n if (!description) {\n return []\n }\n\n const { slug } = slugger()\n\n const items = splitContent(description).map((markdown) => {\n // Get “first” (and only) heading, if available\n const headings = getHeadings(markdown)\n const heading = headings[0]\n\n // Generate an id for the heading\n const id = heading\n ? headingSlugGenerator({\n ...heading,\n slug: slug(heading.value),\n })\n : undefined\n\n return {\n id,\n content: markdown,\n }\n })\n\n return items\n})\n\n/** Add ids to all headings */\nconst transformHeading = (node: Node) => {\n if (!isHeading(node)) {\n return node\n }\n\n const { slug } = slugger()\n\n const value = textFromNode(node)\n\n node.data = {\n hProperties: {\n id: headingSlugGenerator({\n depth: node.depth,\n value,\n slug: slug(value),\n }),\n },\n }\n\n return node\n}\n</script>\n\n<template>\n <div\n v-if=\"description\"\n class=\"introduction-description mt-6 flex flex-col\">\n <InfoMarkdownSection\n v-for=\"section in sections\"\n :id=\"section.id\"\n :key=\"section.id\"\n :content=\"section.content\"\n :eventBus=\"eventBus\"\n :transformHeading=\"transformHeading\" />\n </div>\n</template>\n\n<style scoped>\n.references-classic .introduction-description :deep(img) {\n max-width: 720px;\n}\n</style>\n"],"mappings":""}
@@ -1,7 +1,7 @@
1
1
  import InfoMarkdownSection_default from "./InfoMarkdownSection.vue.js";
2
2
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, defineComponent, openBlock, renderList } from "vue";
3
3
  import { getHeadings, isHeading, splitContent, textFromNode } from "@scalar/code-highlight/markdown";
4
- import GithubSlugger from "github-slugger";
4
+ import { slugger } from "@scalar/helpers/string/slugger";
5
5
  //#region src/blocks/scalar-info-block/components/InfoDescription.vue?vue&type=script&setup=true&lang.ts
6
6
  var _hoisted_1 = {
7
7
  key: 0,
@@ -21,13 +21,13 @@ var InfoDescription_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
21
21
  */
22
22
  const sections = computed(() => {
23
23
  if (!__props.description) return [];
24
- const slugger = new GithubSlugger();
24
+ const { slug } = slugger();
25
25
  return splitContent(__props.description).map((markdown) => {
26
26
  const heading = getHeadings(markdown)[0];
27
27
  return {
28
28
  id: heading ? __props.headingSlugGenerator({
29
29
  ...heading,
30
- slug: slugger.slug(heading.value)
30
+ slug: slug(heading.value)
31
31
  }) : void 0,
32
32
  content: markdown
33
33
  };
@@ -36,12 +36,12 @@ var InfoDescription_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
36
36
  /** Add ids to all headings */
37
37
  const transformHeading = (node) => {
38
38
  if (!isHeading(node)) return node;
39
- const slugger = new GithubSlugger();
39
+ const { slug } = slugger();
40
40
  const value = textFromNode(node);
41
41
  node.data = { hProperties: { id: __props.headingSlugGenerator({
42
42
  depth: node.depth,
43
43
  value,
44
- slug: slugger.slug(value)
44
+ slug: slug(value)
45
45
  }) } };
46
46
  return node;
47
47
  };
@@ -1 +1 @@
1
- {"version":3,"file":"InfoDescription.vue.script.js","names":[],"sources":["../../../../src/blocks/scalar-info-block/components/InfoDescription.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n getHeadings,\n isHeading,\n splitContent,\n textFromNode,\n type Node,\n} from '@scalar/code-highlight/markdown'\nimport type { Heading } from '@scalar/types/legacy'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport GitHubSlugger from 'github-slugger'\nimport { computed } from 'vue'\n\nimport InfoMarkdownSection from './InfoMarkdownSection.vue'\n\nconst { description, headingSlugGenerator } = defineProps<{\n eventBus: WorkspaceEventBus | null\n headingSlugGenerator: (heading: Heading) => string\n /** Markdown document */\n description?: string\n}>()\n\n/**\n * Descriptions, but split into multiple sections.\n * We need this to wrap the headings in IntersectionObserver components.\n */\nconst sections = computed(() => {\n if (!description) {\n return []\n }\n\n const slugger = new GitHubSlugger()\n\n const items = splitContent(description).map((markdown) => {\n // Get “first” (and only) heading, if available\n const headings = getHeadings(markdown)\n const heading = headings[0]\n\n // Generate an id for the heading\n const id = heading\n ? headingSlugGenerator({\n ...heading,\n slug: slugger.slug(heading.value),\n })\n : undefined\n\n return {\n id,\n content: markdown,\n }\n })\n\n return items\n})\n\n/** Add ids to all headings */\nconst transformHeading = (node: Node) => {\n if (!isHeading(node)) {\n return node\n }\n\n const slugger = new GitHubSlugger()\n\n const value = textFromNode(node)\n\n node.data = {\n hProperties: {\n id: headingSlugGenerator({\n depth: node.depth,\n value,\n slug: slugger.slug(value),\n }),\n },\n }\n\n return node\n}\n</script>\n\n<template>\n <div\n v-if=\"description\"\n class=\"introduction-description mt-6 flex flex-col\">\n <InfoMarkdownSection\n v-for=\"section in sections\"\n :id=\"section.id\"\n :key=\"section.id\"\n :content=\"section.content\"\n :eventBus=\"eventBus\"\n :transformHeading=\"transformHeading\" />\n </div>\n</template>\n\n<style scoped>\n.references-classic .introduction-description :deep(img) {\n max-width: 720px;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EA0BA,MAAM,WAAW,eAAe;AAC9B,OAAI,CAAC,QAAA,YACH,QAAO,EAAC;GAGV,MAAM,UAAU,IAAI,eAAc;AAqBlC,UAnBc,aAAa,QAAA,YAAY,CAAC,KAAK,aAAa;IAGxD,MAAM,UADW,YAAY,SAAQ,CACZ;AAUzB,WAAO;KACL,IARS,UACP,QAAA,qBAAqB;MACnB,GAAG;MACH,MAAM,QAAQ,KAAK,QAAQ,MAAM;MAClC,CAAA,GACD,KAAA;KAIF,SAAS;KACX;KACD;IAGF;;EAGD,MAAM,oBAAoB,SAAe;AACvC,OAAI,CAAC,UAAU,KAAK,CAClB,QAAO;GAGT,MAAM,UAAU,IAAI,eAAc;GAElC,MAAM,QAAQ,aAAa,KAAI;AAE/B,QAAK,OAAO,EACV,aAAa,EACX,IAAI,QAAA,qBAAqB;IACvB,OAAO,KAAK;IACZ;IACA,MAAM,QAAQ,KAAK,MAAM;IAC1B,CAAC,EACH,EACH;AAEA,UAAO;;;UAMC,QAAA,eAAA,WAAA,EADR,mBAUM,OAVN,YAUM,EAAA,UAAA,KAAA,EAPJ,mBAMyC,UAAA,MAAA,WALrB,SAAA,QAAX,YAAO;wBADhB,YAMyC,6BAAA;KAJtC,IAAI,QAAQ;KACZ,KAAK,QAAQ;KACb,SAAS,QAAQ;KACjB,UAAU,QAAA;KACQ"}
1
+ {"version":3,"file":"InfoDescription.vue.script.js","names":[],"sources":["../../../../src/blocks/scalar-info-block/components/InfoDescription.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n getHeadings,\n isHeading,\n splitContent,\n textFromNode,\n type Node,\n} from '@scalar/code-highlight/markdown'\nimport { slugger } from '@scalar/helpers/string/slugger'\nimport type { Heading } from '@scalar/types/legacy'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { computed } from 'vue'\n\nimport InfoMarkdownSection from './InfoMarkdownSection.vue'\n\nconst { description, headingSlugGenerator } = defineProps<{\n eventBus: WorkspaceEventBus | null\n headingSlugGenerator: (heading: Heading) => string\n /** Markdown document */\n description?: string\n}>()\n\n/**\n * Descriptions, but split into multiple sections.\n * We need this to wrap the headings in IntersectionObserver components.\n */\nconst sections = computed(() => {\n if (!description) {\n return []\n }\n\n const { slug } = slugger()\n\n const items = splitContent(description).map((markdown) => {\n // Get “first” (and only) heading, if available\n const headings = getHeadings(markdown)\n const heading = headings[0]\n\n // Generate an id for the heading\n const id = heading\n ? headingSlugGenerator({\n ...heading,\n slug: slug(heading.value),\n })\n : undefined\n\n return {\n id,\n content: markdown,\n }\n })\n\n return items\n})\n\n/** Add ids to all headings */\nconst transformHeading = (node: Node) => {\n if (!isHeading(node)) {\n return node\n }\n\n const { slug } = slugger()\n\n const value = textFromNode(node)\n\n node.data = {\n hProperties: {\n id: headingSlugGenerator({\n depth: node.depth,\n value,\n slug: slug(value),\n }),\n },\n }\n\n return node\n}\n</script>\n\n<template>\n <div\n v-if=\"description\"\n class=\"introduction-description mt-6 flex flex-col\">\n <InfoMarkdownSection\n v-for=\"section in sections\"\n :id=\"section.id\"\n :key=\"section.id\"\n :content=\"section.content\"\n :eventBus=\"eventBus\"\n :transformHeading=\"transformHeading\" />\n </div>\n</template>\n\n<style scoped>\n.references-classic .introduction-description :deep(img) {\n max-width: 720px;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EA0BA,MAAM,WAAW,eAAe;AAC9B,OAAI,CAAC,QAAA,YACH,QAAO,EAAC;GAGV,MAAM,EAAE,SAAS,SAAQ;AAqBzB,UAnBc,aAAa,QAAA,YAAY,CAAC,KAAK,aAAa;IAGxD,MAAM,UADW,YAAY,SAAQ,CACZ;AAUzB,WAAO;KACL,IARS,UACP,QAAA,qBAAqB;MACnB,GAAG;MACH,MAAM,KAAK,QAAQ,MAAM;MAC1B,CAAA,GACD,KAAA;KAIF,SAAS;KACX;KACD;IAGF;;EAGD,MAAM,oBAAoB,SAAe;AACvC,OAAI,CAAC,UAAU,KAAK,CAClB,QAAO;GAGT,MAAM,EAAE,SAAS,SAAQ;GAEzB,MAAM,QAAQ,aAAa,KAAI;AAE/B,QAAK,OAAO,EACV,aAAa,EACX,IAAI,QAAA,qBAAqB;IACvB,OAAO,KAAK;IACZ;IACA,MAAM,KAAK,MAAM;IAClB,CAAC,EACH,EACH;AAEA,UAAO;;;UAMC,QAAA,eAAA,WAAA,EADR,mBAUM,OAVN,YAUM,EAAA,UAAA,KAAA,EAPJ,mBAMyC,UAAA,MAAA,WALrB,SAAA,QAAX,YAAO;wBADhB,YAMyC,6BAAA;KAJtC,IAAI,QAAQ;KACZ,KAAK,QAAQ;KACb,SAAS,QAAQ;KACjB,UAAU,QAAA;KACQ"}