@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.
- package/CHANGELOG.md +13 -0
- package/dist/browser/standalone.js +202 -202
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReference.vue.js +1 -1
- package/dist/components/ApiReference.vue.js.map +1 -1
- package/dist/components/ApiReference.vue.script.js +2 -2
- package/dist/components/ApiReference.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +1 -1
- package/dist/components/Content/Schema/Schema.vue.js.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.script.js +4 -4
- package/dist/components/Content/Schema/Schema.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.script.js +12 -12
- package/dist/components/Content/Schema/SchemaComposition.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.js.map +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js +15 -15
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js.map +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.d.ts.map +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.js.map +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.script.js +1 -2
- package/dist/features/example-responses/ExampleResponse.vue.script.js.map +1 -1
- package/dist/hooks/use-intersection.d.ts.map +1 -1
- package/dist/hooks/use-intersection.js +7 -9
- package/dist/hooks/use-intersection.js.map +1 -1
- package/dist/style.css +156 -144
- 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:
|
|
17
|
-
threshold:
|
|
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\
|
|
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"}
|