@scalar/api-reference 1.40.1 → 1.40.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ApiReference.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReference.vue"],"names":[],"mappings":"AAqoCA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGxD,OAAO,EAEL,KAAK,4BAA4B,EAGlC,MAAM,6BAA6B,CAAA;AAqDpC,KAAK,WAAW,GAAG;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,4BAA4B,CAAA;CAC7C,CAAC;AAGF,KAAK,WAAW,GAAG;IACjB,eAAe,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IAC1C,aAAa,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IACxC,eAAe,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IAC1C,aAAa,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IACxC,oBAAoB,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IAC/C,MAAM,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;CAClC,CAAC;AAutCF,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oPAOnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe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nB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -4,7 +4,7 @@ import _sfc_main from "./ApiReference.vue2.js";
4
4
  /* empty css */
5
5
  /* empty css */
6
6
  import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
7
- const ApiReference = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bab13fc8"]]);
7
+ const ApiReference = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-624789fe"]]);
8
8
  export {
9
9
  ApiReference as default
10
10
  };
@@ -25,7 +25,7 @@ import _sfc_main$5 from "../features/toolbar/ApiReferenceToolbar.vue.js";
25
25
  import { getSystemModePreference } from "../helpers/color-mode.js";
26
26
  import { downloadDocument } from "../helpers/download.js";
27
27
  import { getIdFromUrl, makeUrlFromId } from "../helpers/id-routing.js";
28
- import { intersectionEnabled, scrollToLazy } from "../helpers/lazy-bus.js";
28
+ import { intersectionEnabled, scrollToLazy, blockIntersection } from "../helpers/lazy-bus.js";
29
29
  import { mapConfigToClientStore } from "../helpers/map-config-to-client-store.js";
30
30
  import { mapConfigToWorkspaceStore } from "../helpers/map-config-to-workspace-store.js";
31
31
  import { mapConfiguration } from "../helpers/map-configuration.js";
@@ -411,7 +411,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
411
411
  const handleSelectItem = (id) => {
412
412
  const item = sidebarState.getEntryById(id);
413
413
  if ((item?.type === "tag" || item?.type === "models") && sidebarState.isExpanded(id)) {
414
- return sidebarState.setExpanded(id, false);
414
+ const unblock = blockIntersection();
415
+ sidebarState.setExpanded(id, false);
416
+ unblock();
417
+ return;
415
418
  }
416
419
  if (item?.type !== "tag" && item?.type !== "models") {
417
420
  isSidebarOpen.value = false;
@@ -3,6 +3,12 @@
3
3
  * the rest of the content is loaded.
4
4
  */
5
5
  export declare const firstLazyLoadComplete: import("vue").Ref<boolean, boolean>;
6
+ type UnblockFn = () => void;
7
+ /**
8
+ * Adds a unique identifier to the intersection blockers set
9
+ * Intersection will not be enabled until the unblock callback is run
10
+ */
11
+ export declare const blockIntersection: () => UnblockFn;
6
12
  /** If there are any pending blocking operations we disable intersection */
7
13
  export declare const intersectionEnabled: import("vue").ComputedRef<boolean>;
8
14
  /**
@@ -36,4 +42,5 @@ export declare const scrollToLazy: (id: string, setExpanded: (id: string, value:
36
42
  }[];
37
43
  } | undefined) => void;
38
44
  export declare const freeze: (id: string) => () => void;
45
+ export {};
39
46
  //# sourceMappingURL=lazy-bus.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lazy-bus.d.ts","sourceRoot":"","sources":["../../src/helpers/lazy-bus.ts"],"names":[],"mappings":"AAqBA;;;GAGG;AACH,eAAO,MAAM,qBAAqB,qCAAa,CAAA;AA4B/C,2EAA2E;AAC3E,eAAO,MAAM,mBAAmB,oCAAkD,CAAA;AAmGlF;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM;;EAUpC;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,GACvB,IAAI,MAAM,EACV,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,EACjD,cAAc,CAAC,EAAE,EAAE,MAAM,KAAK;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IAAC,QAAQ,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,GAAG,SAAS,SAyD/G,CAAA;AAyBD,eAAO,MAAM,MAAM,GAAI,IAAI,MAAM,eAwBhC,CAAA"}
1
+ {"version":3,"file":"lazy-bus.d.ts","sourceRoot":"","sources":["../../src/helpers/lazy-bus.ts"],"names":[],"mappings":"AAqBA;;;GAGG;AACH,eAAO,MAAM,qBAAqB,qCAAa,CAAA;AAc/C,KAAK,SAAS,GAAG,MAAM,IAAI,CAAA;AAE3B;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAAO,SAMpC,CAAA;AAED,2EAA2E;AAC3E,eAAO,MAAM,mBAAmB,oCAAkD,CAAA;AA6FlF;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM;;EAUpC;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,GACvB,IAAI,MAAM,EACV,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,EACjD,cAAc,CAAC,EAAE,EAAE,MAAM,KAAK;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IAAC,QAAQ,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,GAAG,SAAS,SA2D/G,CAAA;AAyBD,eAAO,MAAM,MAAM,GAAI,IAAI,MAAM,eAwBhC,CAAA"}
@@ -25,19 +25,14 @@ const runLazyBus = () => {
25
25
  return;
26
26
  }
27
27
  const unblock = blockIntersection();
28
- const executeRender = async () => {
28
+ const processQueue = async () => {
29
29
  if (pendingQueue.size > 0 || priorityQueue.size > 0) {
30
30
  isRunning.value = true;
31
- for (const id of pendingQueue.values()) {
31
+ for (const id of [...pendingQueue, ...priorityQueue]) {
32
32
  readyQueue.add(id);
33
33
  pendingQueue.delete(id);
34
34
  priorityQueue.delete(id);
35
35
  }
36
- for (const id of priorityQueue.values()) {
37
- readyQueue.add(id);
38
- priorityQueue.delete(id);
39
- pendingQueue.delete(id);
40
- }
41
36
  }
42
37
  await nextTick();
43
38
  onRenderComplete.forEach((fn) => fn());
@@ -47,9 +42,9 @@ const runLazyBus = () => {
47
42
  firstLazyLoadComplete.value = true;
48
43
  };
49
44
  if (window.requestIdleCallback) {
50
- window.requestIdleCallback(executeRender, { timeout: 1500 });
45
+ window.requestIdleCallback(processQueue, { timeout: 1500 });
51
46
  } else {
52
- nextTick(executeRender);
47
+ nextTick(processQueue);
53
48
  }
54
49
  };
55
50
  watchDebounced(
@@ -62,12 +57,12 @@ watchDebounced(
62
57
  { debounce: 300, maxWait: 1500 }
63
58
  );
64
59
  const addToPendingQueue = (id) => {
65
- if (!!id && !readyQueue.has(id) && !priorityQueue.has(id)) {
60
+ if (!!id && !priorityQueue.has(id)) {
66
61
  pendingQueue.add(id);
67
62
  }
68
63
  };
69
64
  const addToPriorityQueue = (id) => {
70
- if (id && !readyQueue.has(id)) {
65
+ if (id) {
71
66
  priorityQueue.add(id);
72
67
  }
73
68
  };
@@ -153,6 +148,7 @@ const freeze = (id) => {
153
148
  };
154
149
  };
155
150
  export {
151
+ blockIntersection,
156
152
  firstLazyLoadComplete,
157
153
  freeze,
158
154
  intersectionEnabled,
package/dist/style.css CHANGED
@@ -11645,7 +11645,7 @@ to {
11645
11645
 
11646
11646
  /* Configurable Layout Variables */
11647
11647
  @layer scalar-config {
11648
- .scalar-api-reference[data-v-bab13fc8] {
11648
+ .scalar-api-reference[data-v-624789fe] {
11649
11649
  --refs-sidebar-width: var(--scalar-sidebar-width, 0px);
11650
11650
  /* The header height */
11651
11651
  --refs-header-height: calc(
@@ -11661,7 +11661,7 @@ to {
11661
11661
  );
11662
11662
  --refs-content-max-width: var(--scalar-content-max-width, 1540px);
11663
11663
  }
11664
- .scalar-api-reference.references-classic[data-v-bab13fc8] {
11664
+ .scalar-api-reference.references-classic[data-v-624789fe] {
11665
11665
  /* Classic layout is wider */
11666
11666
  --refs-content-max-width: var(--scalar-content-max-width, 1420px);
11667
11667
  min-height: 100dvh;
@@ -11669,14 +11669,14 @@ to {
11669
11669
  }
11670
11670
 
11671
11671
  /* When the toolbar is present, we need to offset the content */
11672
- .scalar-api-reference[data-v-bab13fc8]:has(.api-reference-toolbar) {
11672
+ .scalar-api-reference[data-v-624789fe]:has(.api-reference-toolbar) {
11673
11673
  --refs-content-offset: 48px;
11674
11674
  }
11675
11675
  }
11676
11676
 
11677
11677
  /* ----------------------------------------------------- */
11678
11678
  /* References Layout */
11679
- .references-layout[data-v-bab13fc8] {
11679
+ .references-layout[data-v-624789fe] {
11680
11680
  /* Try to fill the container */
11681
11681
  min-height: 100dvh;
11682
11682
  min-width: 100%;
@@ -11700,39 +11700,39 @@ to {
11700
11700
 
11701
11701
  background: var(--scalar-background-1);
11702
11702
  }
11703
- .references-editor[data-v-bab13fc8] {
11703
+ .references-editor[data-v-624789fe] {
11704
11704
  grid-area: editor;
11705
11705
  display: flex;
11706
11706
  min-width: 0;
11707
11707
  background: var(--scalar-background-1);
11708
11708
  }
11709
- .references-rendered[data-v-bab13fc8] {
11709
+ .references-rendered[data-v-624789fe] {
11710
11710
  position: relative;
11711
11711
  grid-area: rendered;
11712
11712
  min-width: 0;
11713
11713
  background: var(--scalar-background-1);
11714
11714
  }
11715
- .scalar-api-reference.references-classic[data-v-bab13fc8],
11716
- .references-classic .references-rendered[data-v-bab13fc8] {
11715
+ .scalar-api-reference.references-classic[data-v-624789fe],
11716
+ .references-classic .references-rendered[data-v-624789fe] {
11717
11717
  height: initial !important;
11718
11718
  max-height: initial !important;
11719
11719
  }
11720
11720
  @layer scalar-config {
11721
- .references-sidebar[data-v-bab13fc8] {
11721
+ .references-sidebar[data-v-624789fe] {
11722
11722
  /* Set a default width if references are enabled */
11723
11723
  --refs-sidebar-width: var(--scalar-sidebar-width, 280px);
11724
11724
  }
11725
11725
  }
11726
11726
 
11727
11727
  /* Footer */
11728
- .references-footer[data-v-bab13fc8] {
11728
+ .references-footer[data-v-624789fe] {
11729
11729
  grid-area: footer;
11730
11730
  }
11731
11731
  /* ----------------------------------------------------- */
11732
11732
  /* Responsive / Mobile Layout */
11733
11733
  @media (max-width: 1000px) {
11734
11734
  /* Stack view on mobile */
11735
- .references-layout[data-v-bab13fc8] {
11735
+ .references-layout[data-v-624789fe] {
11736
11736
  grid-template-columns: auto;
11737
11737
  grid-template-rows: var(--scalar-header-height, 0px) 0px auto auto;
11738
11738
 
@@ -11742,13 +11742,13 @@ to {
11742
11742
  'rendered'
11743
11743
  'footer';
11744
11744
  }
11745
- .references-editable[data-v-bab13fc8] {
11745
+ .references-editable[data-v-624789fe] {
11746
11746
  grid-template-areas:
11747
11747
  'header'
11748
11748
  'navigation'
11749
11749
  'editor';
11750
11750
  }
11751
- .references-rendered[data-v-bab13fc8] {
11751
+ .references-rendered[data-v-624789fe] {
11752
11752
  position: static;
11753
11753
  }
11754
11754
  }
@@ -11759,12 +11759,12 @@ to {
11759
11759
  * when the new elements are available
11760
11760
  */
11761
11761
  @media (max-width: 1000px) {
11762
- .scalar-api-references-standalone-mobile[data-v-bab13fc8] {
11762
+ .scalar-api-references-standalone-mobile[data-v-624789fe] {
11763
11763
  --scalar-header-height: 50px;
11764
11764
  }
11765
11765
  }
11766
11766
 
11767
- .darklight-reference[data-v-bab13fc8] {
11767
+ .darklight-reference[data-v-624789fe] {
11768
11768
  width: 100%;
11769
11769
  margin-top: auto;
11770
11770
  }
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "vue",
21
21
  "vue3"
22
22
  ],
23
- "version": "1.40.1",
23
+ "version": "1.40.2",
24
24
  "engines": {
25
25
  "node": ">=20"
26
26
  },
@@ -69,24 +69,24 @@
69
69
  "type-fest": "5.0.0",
70
70
  "vue": "^3.5.21",
71
71
  "zod": "4.1.11",
72
- "@scalar/api-client": "2.13.0",
73
- "@scalar/components": "0.16.5",
72
+ "@scalar/api-client": "2.14.0",
74
73
  "@scalar/code-highlight": "0.2.1",
75
- "@scalar/helpers": "0.1.3",
74
+ "@scalar/components": "0.16.6",
75
+ "@scalar/helpers": "0.2.0",
76
76
  "@scalar/icons": "0.5.0",
77
- "@scalar/oas-utils": "0.6.5",
78
- "@scalar/json-magic": "0.8.3",
79
- "@scalar/object-utils": "1.2.13",
80
- "@scalar/openapi-parser": "0.23.4",
77
+ "@scalar/oas-utils": "0.6.6",
78
+ "@scalar/object-utils": "1.2.14",
79
+ "@scalar/json-magic": "0.8.4",
80
+ "@scalar/openapi-parser": "0.23.5",
81
81
  "@scalar/openapi-types": "0.5.2",
82
+ "@scalar/sidebar": "0.5.1",
82
83
  "@scalar/openapi-upgrader": "0.1.5",
83
- "@scalar/sidebar": "0.5.0",
84
- "@scalar/types": "0.5.1",
85
84
  "@scalar/themes": "0.13.25",
86
- "@scalar/use-hooks": "0.3.1",
87
85
  "@scalar/snippetz": "0.5.4",
86
+ "@scalar/types": "0.5.1",
87
+ "@scalar/use-hooks": "0.3.2",
88
88
  "@scalar/use-toasts": "0.9.1",
89
- "@scalar/workspace-store": "0.22.0"
89
+ "@scalar/workspace-store": "0.22.1"
90
90
  },
91
91
  "devDependencies": {
92
92
  "@hono/node-server": "1.19.5",
@@ -107,7 +107,7 @@
107
107
  "vite-plugin-css-injected-by-js": "^3.4.0",
108
108
  "vitest": "3.2.4",
109
109
  "@scalar/build-tooling": "0.3.1",
110
- "@scalar/core": "0.3.24",
110
+ "@scalar/core": "0.3.25",
111
111
  "@scalar/galaxy": "0.5.12",
112
112
  "@scalar/react-renderer": "0.3.0"
113
113
  },