@scalar/api-reference 1.40.0 → 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.
Files changed (34) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/dist/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  3. package/dist/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +10 -8
  4. package/dist/blocks/scalar-auth-selector-block/index.d.ts.map +1 -1
  5. package/dist/blocks/scalar-client-selector-block/index.d.ts.map +1 -1
  6. package/dist/blocks/scalar-info-block/index.d.ts.map +1 -1
  7. package/dist/blocks/scalar-server-selector-block/index.d.ts.map +1 -1
  8. package/dist/browser/standalone.js +17630 -17600
  9. package/dist/browser/webpack-stats.json +1 -1
  10. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  11. package/dist/components/ApiReference.vue.js +1 -1
  12. package/dist/components/ApiReference.vue2.js +10 -3
  13. package/dist/components/Content/Models/Model.vue.d.ts +1 -1
  14. package/dist/components/Content/Models/Model.vue.d.ts.map +1 -1
  15. package/dist/components/Content/Schema/helpers/get-ref-name.d.ts +1 -2
  16. package/dist/components/Content/Schema/helpers/get-ref-name.d.ts.map +1 -1
  17. package/dist/components/Content/Schema/helpers/get-schema-type.d.ts +1 -2
  18. package/dist/components/Content/Schema/helpers/get-schema-type.d.ts.map +1 -1
  19. package/dist/components/Content/Schema/helpers/schema-name.d.ts +1 -2
  20. package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -1
  21. package/dist/features/specification-extension/index.d.ts +1 -1
  22. package/dist/features/specification-extension/index.d.ts.map +1 -1
  23. package/dist/features/toolbar/ApiReferenceToolbarRegisterButton.vue.js +9 -9
  24. package/dist/features/toolbar/ApiReferenceToolbarShareTemporary.vue.js +9 -9
  25. package/dist/features/x-badges/XBadges.vue.d.ts +1 -1
  26. package/dist/features/x-badges/XBadges.vue.d.ts.map +1 -1
  27. package/dist/helpers/index.d.ts.map +1 -1
  28. package/dist/helpers/lazy-bus.d.ts +7 -0
  29. package/dist/helpers/lazy-bus.d.ts.map +1 -1
  30. package/dist/helpers/lazy-bus.js +7 -11
  31. package/dist/helpers/map-config-to-client-store.d.ts +2 -3
  32. package/dist/helpers/map-config-to-client-store.d.ts.map +1 -1
  33. package/dist/style.css +1152 -986
  34. package/package.json +20 -20
@@ -1 +1 @@
1
- {"version":3,"file":"ApiReference.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReference.vue"],"names":[],"mappings":"AA6nCA,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;AA+sCF,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oPAOnB,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-8817c068"]]);
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";
@@ -259,6 +259,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
259
259
  ...normalized.config,
260
260
  ...configurationOverrides.value
261
261
  };
262
+ const onDocumentSelectPromise = config.onDocumentSelect?.();
262
263
  syncSlugAndUrlWithDocument(slug, elementId, config);
263
264
  const isFirstLoad = !workspaceStore.workspace.documents[slug];
264
265
  if (isFirstLoad) {
@@ -275,8 +276,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
275
276
  config: mapConfiguration(config)
276
277
  }
277
278
  );
278
- config.onLoaded?.(slug);
279
279
  }
280
+ void (async () => {
281
+ await onDocumentSelectPromise;
282
+ void config.onLoaded?.(slug);
283
+ })();
280
284
  if (elementId && elementId !== slug) {
281
285
  scrollToLazyElement(elementId);
282
286
  } else {
@@ -407,7 +411,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
407
411
  const handleSelectItem = (id) => {
408
412
  const item = sidebarState.getEntryById(id);
409
413
  if ((item?.type === "tag" || item?.type === "models") && sidebarState.isExpanded(id)) {
410
- return sidebarState.setExpanded(id, false);
414
+ const unblock = blockIntersection();
415
+ sidebarState.setExpanded(id, false);
416
+ unblock();
417
+ return;
411
418
  }
412
419
  if (item?.type !== "tag" && item?.type !== "models") {
413
420
  isSidebarOpen.value = false;
@@ -1,5 +1,5 @@
1
1
  import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
2
- import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/schema';
2
+ import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
3
3
  type __VLS_Props = {
4
4
  id: string;
5
5
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Model.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Models/Model.vue"],"names":[],"mappings":"AAmDA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAA;AAQtF,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,YAAY,GAAG,SAAS,CAAA;IAChC,WAAW,EAAE,OAAO,CAAA;IACpB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,OAAO,EAAE;QACP,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAA;QAC5B,4BAA4B,EAAE,OAAO,GAAG,SAAS,CAAA;QACjD,uBAAuB,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CAAA;KAC1D,CAAA;CACF,CAAC;;AAoFF,wBAMG"}
1
+ {"version":3,"file":"Model.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Models/Model.vue"],"names":[],"mappings":"AAmDA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAQhG,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,YAAY,GAAG,SAAS,CAAA;IAChC,WAAW,EAAE,OAAO,CAAA;IACpB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,OAAO,EAAE;QACP,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAA;QAC5B,4BAA4B,EAAE,OAAO,GAAG,SAAS,CAAA;QACjD,uBAAuB,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CAAA;KAC1D,CAAA;CACF,CAAC;;AAoFF,wBAMG"}
@@ -1,5 +1,4 @@
1
- import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
- import type { ReferenceType } from '@scalar/workspace-store/schemas/v3.1/strict/reference';
1
+ import type { ReferenceType, SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
3
2
  /**
4
3
  * Gets the "name" of the schema from the ref path
5
4
  * TODO: this will change so fix it when the new refs are out
@@ -1 +1 @@
1
- {"version":3,"file":"get-ref-name.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/get-ref-name.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAChG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAA;AAE1F;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,QAAQ,aAAa,CAAC,YAAY,CAAC,8BAiB7D,CAAA"}
1
+ {"version":3,"file":"get-ref-name.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/get-ref-name.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAE/G;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,QAAQ,aAAa,CAAC,YAAY,CAAC,8BAiB7D,CAAA"}
@@ -1,5 +1,4 @@
1
- import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
- import type { ReferenceType } from '@scalar/workspace-store/schemas/v3.1/strict/reference';
1
+ import type { ReferenceType, SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
3
2
  /**
4
3
  * Computes the human-readable type for a schema.
5
4
  *
@@ -1 +1 @@
1
- {"version":3,"file":"get-schema-type.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/get-schema-type.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAChG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAA;AAoC1F;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,GAAI,YAAY,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC,KAAG,MA0DtF,CAAA"}
1
+ {"version":3,"file":"get-schema-type.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/get-schema-type.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAoC/G;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,GAAI,YAAY,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC,KAAG,MA0DtF,CAAA"}
@@ -1,5 +1,4 @@
1
- import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
- import type { ReferenceType } from '@scalar/workspace-store/schemas/v3.1/strict/reference';
1
+ import type { ReferenceType, SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
3
2
  /**
4
3
  * Extract schema name from various schema formats
5
4
  *
@@ -1 +1 @@
1
- {"version":3,"file":"schema-name.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/schema-name.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAChG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAA;AAK1F;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,aAAa,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC,KAAG,MAAM,GAAG,IAyBzG,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,OAAO,CAAC,YAAY,EAAE;IAAE,IAAI,EAAE,GAAG,CAAA;CAAE,CAAC,CAAC,MAAM,CAAC,EAAE,WAAW,MAAM,KAAG,MACrD,CAAA;AAEvD;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,YAAY,EAAE,wBAAsB,KAAG,MAAM,GAAG,IA+CnF,CAAA"}
1
+ {"version":3,"file":"schema-name.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/schema-name.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAK/G;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,aAAa,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC,KAAG,MAAM,GAAG,IAyBzG,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,OAAO,CAAC,YAAY,EAAE;IAAE,IAAI,EAAE,GAAG,CAAA;CAAE,CAAC,CAAC,MAAM,CAAC,EAAE,WAAW,MAAM,KAAG,MACrD,CAAA;AAEvD;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,YAAY,EAAE,wBAAsB,KAAG,MAAM,GAAG,IA+CnF,CAAA"}
@@ -1,3 +1,3 @@
1
- export { default as SpecificationExtension } from './SpecificationExtension.vue.js';
2
1
  export { getXKeysFromObject } from './helpers.js';
2
+ export { default as SpecificationExtension } from './SpecificationExtension.vue.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/specification-extension/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/specification-extension/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,8BAA8B,CAAA"}
@@ -16,7 +16,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
16
16
  setup(__props) {
17
17
  const tempDocUrl = useModel(__props, "url");
18
18
  const { toast } = useToasts();
19
- const loading = useLoadingState();
19
+ const loader = useLoadingState();
20
20
  function openRegisterLink(docUrl) {
21
21
  const url = new URL(DASHBOARD_REGISTER_URL);
22
22
  url.searchParams.set("url", docUrl);
@@ -24,36 +24,36 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
24
24
  window.open(url.toString(), "_blank");
25
25
  }
26
26
  async function generateRegisterLink() {
27
- if (loading.isLoading || !__props.workspace) {
27
+ if (loader.isLoading || !__props.workspace) {
28
28
  return;
29
29
  }
30
30
  if (tempDocUrl.value) {
31
31
  openRegisterLink(tempDocUrl.value);
32
32
  return;
33
33
  }
34
- loading.startLoading();
34
+ loader.start();
35
35
  const document = __props.workspace.exportActiveDocument("json");
36
36
  if (!document) {
37
37
  toast("Unable to export active document", "error");
38
- loading.invalidate();
38
+ await loader.invalidate();
39
39
  return;
40
40
  }
41
41
  try {
42
42
  tempDocUrl.value = await uploadTempDocument(document);
43
- await loading.validate(600);
43
+ await loader.validate();
44
44
  openRegisterLink(tempDocUrl.value);
45
45
  await nextTick();
46
- loading.clear();
46
+ await loader.clear();
47
47
  } catch (error) {
48
48
  const message = error instanceof Error ? error.message : "An unknown error occurred";
49
49
  toast(message, "error");
50
- loading.invalidate();
50
+ await loader.invalidate();
51
51
  }
52
52
  }
53
53
  return (_ctx, _cache) => {
54
54
  return openBlock(), createBlock(unref(ScalarButton), {
55
55
  class: "h-auto p-2.5",
56
- loading: unref(loading),
56
+ loader: unref(loader),
57
57
  onClick: generateRegisterLink
58
58
  }, {
59
59
  default: withCtx(() => [
@@ -62,7 +62,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
62
62
  ])
63
63
  ]),
64
64
  _: 3
65
- }, 8, ["loading"]);
65
+ }, 8, ["loader"]);
66
66
  };
67
67
  }
68
68
  });
@@ -17,27 +17,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
17
17
  emits: ["update:url"],
18
18
  setup(__props) {
19
19
  const { toast } = useToasts();
20
- const loading = useLoadingState();
20
+ const loader = useLoadingState();
21
21
  const tempDocUrl = useModel(__props, "url");
22
22
  async function generateTemporaryLink() {
23
- if (loading.isLoading || !__props.workspace || !!tempDocUrl.value) {
23
+ if (loader.isLoading || !__props.workspace || !!tempDocUrl.value) {
24
24
  return;
25
25
  }
26
- loading.startLoading();
26
+ loader.start();
27
27
  const document = __props.workspace.exportActiveDocument("json");
28
28
  if (!document) {
29
29
  toast("Unable to export active document", "error");
30
- loading.invalidate();
30
+ await loader.invalidate();
31
31
  return;
32
32
  }
33
33
  try {
34
34
  tempDocUrl.value = await uploadTempDocument(document);
35
- copyToClipboard(tempDocUrl.value);
36
- loading.validate();
35
+ await copyToClipboard(tempDocUrl.value);
36
+ await loader.validate();
37
37
  } catch (error) {
38
38
  const message = error instanceof Error ? error.message : "An unknown error occurred";
39
39
  toast(message, "error");
40
- loading.invalidate();
40
+ await loader.invalidate();
41
41
  }
42
42
  }
43
43
  const { copyToClipboard } = useClipboard();
@@ -66,7 +66,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
66
66
  createVNode(unref(ScalarButton), {
67
67
  class: "h-auto p-2.5",
68
68
  disabled: !!tempDocUrl.value,
69
- loading: unref(loading),
69
+ loader: unref(loader),
70
70
  variant: "outlined",
71
71
  onClick: generateTemporaryLink
72
72
  }, {
@@ -74,7 +74,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
74
74
  createTextVNode(" Generate ", -1)
75
75
  ])]),
76
76
  _: 1
77
- }, 8, ["disabled", "loading"]),
77
+ }, 8, ["disabled", "loader"]),
78
78
  createVNode(ApiReferenceToolbarBlurb, { class: "-mt-1" }, {
79
79
  default: withCtx(() => [..._cache[3] || (_cache[3] = [
80
80
  createTextVNode(" Shared documents will automatically be deleted after 7 days. ", -1)
@@ -1,4 +1,4 @@
1
- import type { XBadge } from '@scalar/workspace-store/schemas/extensions/operation/x-badge';
1
+ import type { XBadge } from '@scalar/workspace-store/schemas/extensions/operation';
2
2
  type __VLS_Props = {
3
3
  position: 'before' | 'after';
4
4
  badges: XBadge[] | unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"XBadges.vue.d.ts","sourceRoot":"","sources":["../../../src/features/x-badges/XBadges.vue"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8DAA8D,CAAA;AAK1F,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAA;IAC5B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;CAC3B,CAAC;;AA2DF,wBAMG"}
1
+ {"version":3,"file":"XBadges.vue.d.ts","sourceRoot":"","sources":["../../../src/features/x-badges/XBadges.vue"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sDAAsD,CAAA;AAKlF,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAA;IAC5B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;CAC3B,CAAC;;AA2DF,wBAMG"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAE5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,KAAK,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAE5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,KAAK,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA"}
@@ -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,
@@ -2,8 +2,7 @@ import type { HttpMethod } from '@scalar/helpers/http/http-methods';
2
2
  import type { OpenAPIV3_1 } from '@scalar/openapi-types';
3
3
  import type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference';
4
4
  import type { WorkspaceStore } from '@scalar/workspace-store/client';
5
- import type { SecurityRequirementObject } from '@scalar/workspace-store/schemas/v3.1/strict/security-requirement';
6
- import type { SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.1/strict/security-scheme';
5
+ import type { SecurityRequirementObject, SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
7
6
  import { type MaybeRefOrGetter } from '@vueuse/core';
8
7
  import { type Ref } from 'vue';
9
8
  /**
@@ -56,7 +55,7 @@ export declare function mapConfigToClientStore({ config, workspaceStore, el, roo
56
55
  };
57
56
  hotKeyConfig?: {
58
57
  modifiers: ("default" | "Meta" | "Control" | "Shift" | "Alt")[];
59
- hotKeys?: Partial<Record<"" | "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "0" | "Space" | "Backspace" | "Tab" | "Enter" | "Escape" | "ArrowDown" | "ArrowLeft" | "ArrowRight" | "ArrowUp" | "End" | "Home" | "PageDown" | "PageUp" | "Delete" | "*" | "+" | "-" | "." | "/" | "F1" | "F2" | "F3" | "F4" | "F5" | "F6" | "F7" | "F8" | "F9" | "F10" | "F11" | "F12" | ";" | "=" | "," | "`" | "[" | "\\" | "]" | "4" | "1" | "2" | "3" | "5" | "6" | "7" | "8" | "9", {
58
+ hotKeys?: Partial<Record<"" | "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "0" | "." | "2" | "-" | "," | "/" | "1" | "Space" | "Backspace" | "Tab" | "Enter" | "Escape" | "ArrowDown" | "ArrowLeft" | "ArrowRight" | "ArrowUp" | "End" | "Home" | "PageDown" | "PageUp" | "Delete" | "*" | "+" | "F1" | "F2" | "F3" | "F4" | "F5" | "F6" | "F7" | "F8" | "F9" | "F10" | "F11" | "F12" | ";" | "=" | "`" | "[" | "\\" | "]" | "4" | "3" | "5" | "6" | "7" | "8" | "9", {
60
59
  event: "addTopNav" | "closeModal" | "closeTopNav" | "createNew" | "executeRequest" | "focusAddressBar" | "focusRequestSearch" | "jumpToLastTab" | "jumpToTab" | "navigateSearchResultsDown" | "navigateSearchResultsUp" | "navigateTopNavLeft" | "navigateTopNavRight" | "openCommandPalette" | "selectSearchResult" | "toggleSidebar";
61
60
  modifiers?: ("default" | "Meta" | "Control" | "Shift" | "Alt")[] | undefined;
62
61
  }>> | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"map-config-to-client-store.d.ts","sourceRoot":"","sources":["../../src/helpers/map-config-to-client-store.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAC/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAEpE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kEAAkE,CAAA;AACjH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAA;AACvG,OAAO,EAAE,KAAK,gBAAgB,EAAkB,MAAM,cAAc,CAAA;AAEpE,OAAO,EAAE,KAAK,GAAG,EAA4C,MAAM,KAAK,CAAA;AAKxE;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,cAAc,EACd,EAAE,EACF,IAAI,EACJ,oBAAoB,EACpB,WAAW,GACZ,EAAE;IACD,4CAA4C;IAC5C,EAAE,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAC3B,oDAAoD;IACpD,IAAI,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAC7B,0CAA0C;IAC1C,MAAM,EAAE,gBAAgB,CAAC,4BAA4B,CAAC,CAAA;IACtD,gCAAgC;IAChC,cAAc,EAAE,cAAc,CAAA;IAC9B,oBAAoB,EAAE,gBAAgB,CAAC,WAAW,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAA;IACnE,mBAAmB;IACnB,WAAW,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