@scalar/api-reference 1.49.5 → 1.49.7

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 (27) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/browser/standalone.js +202 -202
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReference.vue.js +1 -1
  5. package/dist/components/ApiReference.vue.js.map +1 -1
  6. package/dist/components/ApiReference.vue.script.js +2 -2
  7. package/dist/components/ApiReference.vue.script.js.map +1 -1
  8. package/dist/components/Content/Schema/Schema.vue.js +1 -1
  9. package/dist/components/Content/Schema/Schema.vue.js.map +1 -1
  10. package/dist/components/Content/Schema/Schema.vue.script.js +4 -4
  11. package/dist/components/Content/Schema/Schema.vue.script.js.map +1 -1
  12. package/dist/components/Content/Schema/SchemaComposition.vue.js.map +1 -1
  13. package/dist/components/Content/Schema/SchemaComposition.vue.script.js +12 -12
  14. package/dist/components/Content/Schema/SchemaComposition.vue.script.js.map +1 -1
  15. package/dist/components/Content/Schema/SchemaObjectProperties.vue.js.map +1 -1
  16. package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js +15 -15
  17. package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js.map +1 -1
  18. package/dist/features/example-responses/ExampleResponse.vue.d.ts.map +1 -1
  19. package/dist/features/example-responses/ExampleResponse.vue.js +1 -1
  20. package/dist/features/example-responses/ExampleResponse.vue.js.map +1 -1
  21. package/dist/features/example-responses/ExampleResponse.vue.script.js +1 -2
  22. package/dist/features/example-responses/ExampleResponse.vue.script.js.map +1 -1
  23. package/dist/hooks/use-intersection.d.ts.map +1 -1
  24. package/dist/hooks/use-intersection.js +7 -9
  25. package/dist/hooks/use-intersection.js.map +1 -1
  26. package/dist/style.css +156 -144
  27. package/package.json +11 -11
@@ -1,20 +1,18 @@
1
1
  import { onMounted } from "vue";
2
2
  import { useIntersectionObserver } from "@vueuse/core";
3
3
  //#region src/hooks/use-intersection.ts
4
+ /**
5
+ * Shrinks the observation root to a thin horizontal strip at the vertical middle of
6
+ * the viewport (~2% of viewport height). Emits only while the target overlaps that line.
7
+ */
8
+ var VIEWPORT_VERTICAL_CENTER_ROOT_MARGIN = "-49% 0px -49% 0px";
4
9
  var useIntersection = (el, onIntersect) => {
5
- const calculateRootMargin = (element) => {
6
- const height = element.offsetHeight;
7
- return `${height / 2}px 0px ${height / 2}px 0px`;
8
- };
9
- const calculateThreshold = (element) => {
10
- return element.offsetHeight < window.innerHeight ? .8 : .5;
11
- };
12
10
  onMounted(() => {
13
11
  if (el.value) useIntersectionObserver(el, ([entry]) => {
14
12
  if (entry?.isIntersecting) onIntersect();
15
13
  }, {
16
- rootMargin: calculateRootMargin(el.value),
17
- threshold: calculateThreshold(el.value)
14
+ rootMargin: VIEWPORT_VERTICAL_CENTER_ROOT_MARGIN,
15
+ threshold: 0
18
16
  });
19
17
  });
20
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"use-intersection.js","names":[],"sources":["../../src/hooks/use-intersection.ts"],"sourcesContent":["import { useIntersectionObserver } from '@vueuse/core'\nimport { type TemplateRef, onMounted } from 'vue'\n\nexport const useIntersection = (el: TemplateRef<HTMLElement | undefined>, onIntersect: () => void) => {\n const calculateRootMargin = (element: HTMLElement) => {\n const height = element.offsetHeight\n // Use of a margin on height to ensure sooner intersection detection.\n return `${height / 2}px 0px ${height / 2}px 0px`\n }\n\n const calculateThreshold = (element: HTMLElement) => {\n const height = element.offsetHeight\n // Favor larger threshold if the element is smaller that the screen\n // to ensure that it is selected\n return height < window.innerHeight ? 0.8 : 0.5\n }\n\n onMounted(() => {\n if (el.value) {\n const options = {\n rootMargin: calculateRootMargin(el.value),\n threshold: calculateThreshold(el.value),\n }\n\n useIntersectionObserver(\n el,\n ([entry]) => {\n if (entry?.isIntersecting) {\n onIntersect()\n }\n },\n options,\n )\n }\n })\n}\n"],"mappings":";;;AAGA,IAAa,mBAAmB,IAA0C,gBAA4B;CACpG,MAAM,uBAAuB,YAAyB;EACpD,MAAM,SAAS,QAAQ;AAEvB,SAAO,GAAG,SAAS,EAAE,SAAS,SAAS,EAAE;;CAG3C,MAAM,sBAAsB,YAAyB;AAInD,SAHe,QAAQ,eAGP,OAAO,cAAc,KAAM;;AAG7C,iBAAgB;AACd,MAAI,GAAG,MAML,yBACE,KACC,CAAC,WAAW;AACX,OAAI,OAAO,eACT,cAAa;KATH;GACd,YAAY,oBAAoB,GAAG,MAAM;GACzC,WAAW,mBAAmB,GAAG,MAAM;GACxC,CAUA;GAEH"}
1
+ {"version":3,"file":"use-intersection.js","names":[],"sources":["../../src/hooks/use-intersection.ts"],"sourcesContent":["import { useIntersectionObserver } from '@vueuse/core'\nimport { type TemplateRef, onMounted } from 'vue'\n\n/**\n * Shrinks the observation root to a thin horizontal strip at the vertical middle of\n * the viewport (~2% of viewport height). Emits only while the target overlaps that line.\n */\nconst VIEWPORT_VERTICAL_CENTER_ROOT_MARGIN = '-49% 0px -49% 0px'\n\nexport const useIntersection = (el: TemplateRef<HTMLElement | undefined>, onIntersect: () => void) => {\n onMounted(() => {\n if (el.value) {\n const observerOptions = {\n rootMargin: VIEWPORT_VERTICAL_CENTER_ROOT_MARGIN,\n threshold: 0,\n }\n\n useIntersectionObserver(\n el,\n ([entry]) => {\n if (entry?.isIntersecting) {\n onIntersect()\n }\n },\n observerOptions,\n )\n }\n })\n}\n"],"mappings":";;;;;;;AAOA,IAAM,uCAAuC;AAE7C,IAAa,mBAAmB,IAA0C,gBAA4B;AACpG,iBAAgB;AACd,MAAI,GAAG,MAML,yBACE,KACC,CAAC,WAAW;AACX,OAAI,OAAO,eACT,cAAa;KATK;GACtB,YAAY;GACZ,WAAW;GACZ,CAUA;GAEH"}