@scalar/api-reference 1.57.4 → 1.58.0

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 (196) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/browser/chunks/AgentScalarChatInterface-DIIVMX31.js +27 -0
  3. package/dist/browser/chunks/ScalarTextInput.vue-DDsQgpOo.js +27 -0
  4. package/dist/browser/chunks/basic-shape-diamond.svg-BTEOT1FL.js +15 -0
  5. package/dist/browser/chunks/basic-shape-hexagon.svg-BSPzaCgF.js +15 -0
  6. package/dist/browser/chunks/basic-shape-primary-circle-ellipse-round.svg-DKmZ8UUU.js +15 -0
  7. package/dist/browser/chunks/basic-shape-primary-square-rectangle.svg-n2YRykHD.js +15 -0
  8. package/dist/browser/chunks/basic-shape-shield.svg-Bec9cJDA.js +15 -0
  9. package/dist/browser/chunks/browser-67K6wmG9.js +129 -0
  10. package/dist/browser/chunks/computer-device-desktop-monitor.svg-m6j893Hb.js +15 -0
  11. package/dist/browser/chunks/computer-device-desktop.svg-Dk1VVO7k.js +15 -0
  12. package/dist/browser/chunks/computer-device-laptop.svg-BNGVUCYS.js +15 -0
  13. package/dist/browser/chunks/computer-device-mobile-phone-android-samsung-back.svg-CC4UUTFw.js +15 -0
  14. package/dist/browser/chunks/computer-device-mobile-phone-android-samsung.svg-D8ExpMpL.js +15 -0
  15. package/dist/browser/chunks/computer-device-mobile-phone-iphone-x-back.svg-CLm7sgMM.js +15 -0
  16. package/dist/browser/chunks/computer-device-mobile-phone-iphone-x.svg-Xrttg6_7.js +15 -0
  17. package/dist/browser/chunks/computer-device-mobile-tablet-touch.svg-DQ2oTvOG.js +15 -0
  18. package/dist/browser/chunks/computer-device-mobile-tablet.svg-DCr0XlRc.js +15 -0
  19. package/dist/browser/chunks/computer-device-network-ethernet-cat6.svg-AK9l0iOl.js +15 -0
  20. package/dist/browser/chunks/computer-device-network-lan-www.svg-gUIdFBlE.js +15 -0
  21. package/dist/browser/chunks/computer-device-network-wifi-connection.svg-Be-EMm4e.js +15 -0
  22. package/dist/browser/chunks/computer-device-network-wifi-router.svg-Dc2VzyqK.js +15 -0
  23. package/dist/browser/chunks/ecology-science-erlenmeyer-flask.svg-DHgy7Jfd.js +15 -0
  24. package/dist/browser/chunks/image-flash-lightning.svg-EETR_y1q.js +15 -0
  25. package/dist/browser/chunks/image-picture-flower.svg-DN1AYzJU.js +15 -0
  26. package/dist/browser/chunks/interface-alert-exclamation-diamond.svg-C5NozMV_.js +15 -0
  27. package/dist/browser/chunks/interface-alert-exclamation-triangle-warning.svg-DaAg2fF5.js +15 -0
  28. package/dist/browser/chunks/interface-alert-information-circle.svg-ckkkt9Mv.js +15 -0
  29. package/dist/browser/chunks/interface-award-crown.svg-pjvn9hY-.js +15 -0
  30. package/dist/browser/chunks/interface-bookmark-tag.svg-r2r-lQq4.js +15 -0
  31. package/dist/browser/chunks/interface-bookmark.svg-BK9HKQBT.js +15 -0
  32. package/dist/browser/chunks/interface-calendar-date-one.svg-DNnF0M1I.js +15 -0
  33. package/dist/browser/chunks/interface-content-book-open-pages.svg-CQj_w9Vp.js +15 -0
  34. package/dist/browser/chunks/interface-content-book-page.svg-DppoeJRe.js +15 -0
  35. package/dist/browser/chunks/interface-content-file.svg-CvcD7OiY.js +15 -0
  36. package/dist/browser/chunks/interface-content-folder.svg-BmtS5I9A.js +15 -0
  37. package/dist/browser/chunks/interface-copy-clipboard.svg-Be6EI50X.js +15 -0
  38. package/dist/browser/chunks/interface-edit-attachment.svg-G5TKzpWX.js +15 -0
  39. package/dist/browser/chunks/interface-edit-binocular.svg-jzL-DvGB.js +15 -0
  40. package/dist/browser/chunks/interface-edit-magic-wand.svg-BOTlymvp.js +15 -0
  41. package/dist/browser/chunks/interface-edit-tool-paint-roller.svg-s9dwryx7.js +15 -0
  42. package/dist/browser/chunks/interface-edit-tool-pencil.svg-C7v0dbB3.js +15 -0
  43. package/dist/browser/chunks/interface-favorite-award.svg-CYHUgUG0.js +15 -0
  44. package/dist/browser/chunks/interface-favorite-flag.svg-C10zlKOb.js +15 -0
  45. package/dist/browser/chunks/interface-favorite-heart.svg-eoduXxlz.js +15 -0
  46. package/dist/browser/chunks/interface-favorite-star.svg-BSmxJetr.js +15 -0
  47. package/dist/browser/chunks/interface-favorite-stars-sparkles.svg-JTFLj3Ls.js +15 -0
  48. package/dist/browser/chunks/interface-hierarchy-flowchart.svg-Cg_Wy0kN.js +15 -0
  49. package/dist/browser/chunks/interface-home-house.svg-DytoGRnv.js +15 -0
  50. package/dist/browser/chunks/interface-hyperlink.svg-CuEfmmQI.js +15 -0
  51. package/dist/browser/chunks/interface-lighting-brightness.svg-DSK0h_Pa.js +15 -0
  52. package/dist/browser/chunks/interface-lock-closed.svg-Cn6TaLYv.js +15 -0
  53. package/dist/browser/chunks/interface-lock-open-unlock.svg-CVkG5-9W.js +15 -0
  54. package/dist/browser/chunks/interface-login-key.svg-y-cwwXjN.js +15 -0
  55. package/dist/browser/chunks/interface-search.svg-S-puVFJB.js +15 -0
  56. package/dist/browser/chunks/interface-setting-cog.svg-CTH4_lLg.js +15 -0
  57. package/dist/browser/chunks/interface-share-megaphone-bullhorn.svg-Pbp39MyC.js +15 -0
  58. package/dist/browser/chunks/interface-share-rocket.svg-BgCsIRZO.js +15 -0
  59. package/dist/browser/chunks/interface-share-satellite.svg-DAMN9d5G.js +15 -0
  60. package/dist/browser/chunks/interface-share-space-ship.svg-Dt-Mejxk.js +15 -0
  61. package/dist/browser/chunks/interface-share.svg-vFYTXSti.js +15 -0
  62. package/dist/browser/chunks/interface-signal-square.svg-DNG4LpAe.js +15 -0
  63. package/dist/browser/chunks/interface-time-clock-circle.svg-Bpz-nLxo.js +15 -0
  64. package/dist/browser/chunks/interface-time-hour-glass.svg-D7agfKsH.js +15 -0
  65. package/dist/browser/chunks/interface-users-multiple.svg-CkPJBBnG.js +15 -0
  66. package/dist/browser/chunks/interface-weather-moon.svg-CaTZFMPO.js +15 -0
  67. package/dist/browser/chunks/mail-chat-bubble-square.svg-DC8RIihp.js +15 -0
  68. package/dist/browser/chunks/mail-send-email-paper-airplane.svg-D8OLs9jz.js +15 -0
  69. package/dist/browser/chunks/mail-send-envelope.svg-CV33h5Sx.js +15 -0
  70. package/dist/browser/chunks/modal-BA6EnLMO.js +15 -0
  71. package/dist/browser/chunks/modal-DW-P3H1k.js +66 -0
  72. package/dist/browser/chunks/money-cashier-receipt.svg-CJL8C2gs.js +15 -0
  73. package/dist/browser/chunks/money-currency-dollar-pay.svg-VdBplCTx.js +15 -0
  74. package/dist/browser/chunks/money-graph-arrow-increase.svg-DcRov3zk.js +15 -0
  75. package/dist/browser/chunks/money-graph-bar-chart-increase.svg-Cc7KxjX-.js +15 -0
  76. package/dist/browser/chunks/nature-ecology-leaf.svg-DR3cTZxt.js +15 -0
  77. package/dist/browser/chunks/phone-telephone.svg-DyY0gUlk.js +15 -0
  78. package/dist/browser/chunks/programming-bug.svg-BHLT-Qhp.js +15 -0
  79. package/dist/browser/chunks/programming-cloud.svg-B6YW33ba.js +15 -0
  80. package/dist/browser/chunks/programming-computer-database-server.svg-B6o5Sdn-.js +15 -0
  81. package/dist/browser/chunks/programming-computer-database.svg-Cl7OVtpJ.js +15 -0
  82. package/dist/browser/chunks/programming-module-four-layout.svg-BQrerL1x.js +15 -0
  83. package/dist/browser/chunks/programming-module-three.svg-B2KTQzBM.js +15 -0
  84. package/dist/browser/chunks/programming-module.svg-CiID7kPm.js +15 -0
  85. package/dist/browser/chunks/programming-script-code.svg-D1M5rtkN.js +15 -0
  86. package/dist/browser/chunks/runtime-core.esm-bundler-Byrbbu5Q.js +17 -0
  87. package/dist/browser/chunks/shopping-cart.svg-BEegiIR9.js +15 -0
  88. package/dist/browser/chunks/shopping-gift-present.svg-BUHwuLix.js +15 -0
  89. package/dist/browser/chunks/shopping-shipping-box-parcel-package.svg-D6fxWdYx.js +15 -0
  90. package/dist/browser/chunks/tag-new-circle.svg-jsg1bGs0.js +15 -0
  91. package/dist/browser/chunks/travel-map-earth-globe.svg-ClbMiU-f.js +15 -0
  92. package/dist/browser/chunks/vendor-Ad2vN5Ro.js +333 -0
  93. package/dist/browser/standalone.esm.js +1852 -0
  94. package/dist/browser/standalone.js +253 -255
  95. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  96. package/dist/components/ApiReference.vue.js +1 -1
  97. package/dist/components/ApiReference.vue.js.map +1 -1
  98. package/dist/components/ApiReference.vue.script.js +61 -26
  99. package/dist/components/ApiReference.vue.script.js.map +1 -1
  100. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.d.ts +16 -0
  101. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.d.ts.map +1 -0
  102. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.js +7 -0
  103. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.js.map +1 -0
  104. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js +164 -0
  105. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js.map +1 -0
  106. package/dist/components/Content/AsyncApi/Channel.vue.d.ts +14 -0
  107. package/dist/components/Content/AsyncApi/Channel.vue.d.ts.map +1 -0
  108. package/dist/components/Content/AsyncApi/Channel.vue.js +9 -0
  109. package/dist/components/Content/AsyncApi/Channel.vue.js.map +1 -0
  110. package/dist/components/Content/AsyncApi/Channel.vue.script.js +108 -0
  111. package/dist/components/Content/AsyncApi/Channel.vue.script.js.map +1 -0
  112. package/dist/components/Content/AsyncApi/index.d.ts +2 -0
  113. package/dist/components/Content/AsyncApi/index.d.ts.map +1 -0
  114. package/dist/components/Content/Content.vue.d.ts +3 -3
  115. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  116. package/dist/components/Content/Content.vue.js.map +1 -1
  117. package/dist/components/Content/Content.vue.script.js +19 -3
  118. package/dist/components/Content/Content.vue.script.js.map +1 -1
  119. package/dist/components/Content/Models/ModelTag.vue.d.ts +2 -0
  120. package/dist/components/Content/Models/ModelTag.vue.d.ts.map +1 -1
  121. package/dist/components/Content/Models/ModelTag.vue.js.map +1 -1
  122. package/dist/components/Content/Models/ModelTag.vue.script.js +11 -12
  123. package/dist/components/Content/Models/ModelTag.vue.script.js.map +1 -1
  124. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +1 -1
  125. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
  126. package/dist/components/Content/Operations/TraversedEntry.vue.js.map +1 -1
  127. package/dist/components/Content/Operations/TraversedEntry.vue.script.js +4 -2
  128. package/dist/components/Content/Operations/TraversedEntry.vue.script.js.map +1 -1
  129. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -1
  130. package/dist/components/Content/Schema/SchemaObjectProperties.vue.js.map +1 -1
  131. package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js +4 -6
  132. package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js.map +1 -1
  133. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts +2 -1
  134. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts.map +1 -1
  135. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +40 -25
  136. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js.map +1 -1
  137. package/dist/components/index.js +1 -1
  138. package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
  139. package/dist/features/Operation/components/ParameterListItem.vue.js.map +1 -1
  140. package/dist/features/Operation/components/ParameterListItem.vue.script.js +9 -9
  141. package/dist/features/Operation/components/ParameterListItem.vue.script.js.map +1 -1
  142. package/dist/features/Search/components/SearchButton.vue.d.ts +4 -1
  143. package/dist/features/Search/components/SearchButton.vue.d.ts.map +1 -1
  144. package/dist/features/Search/components/SearchButton.vue.js.map +1 -1
  145. package/dist/features/Search/components/SearchButton.vue.script.js +7 -8
  146. package/dist/features/Search/components/SearchButton.vue.script.js.map +1 -1
  147. package/dist/features/Search/components/SearchModal.vue.d.ts +4 -1
  148. package/dist/features/Search/components/SearchModal.vue.d.ts.map +1 -1
  149. package/dist/features/Search/components/SearchModal.vue.js +1 -1
  150. package/dist/features/Search/components/SearchModal.vue.js.map +1 -1
  151. package/dist/features/Search/components/SearchModal.vue.script.js +5 -2
  152. package/dist/features/Search/components/SearchModal.vue.script.js.map +1 -1
  153. package/dist/features/Search/components/SearchResult.vue.d.ts +2 -0
  154. package/dist/features/Search/components/SearchResult.vue.d.ts.map +1 -1
  155. package/dist/features/Search/components/SearchResult.vue.js.map +1 -1
  156. package/dist/features/Search/components/SearchResult.vue.script.js +8 -6
  157. package/dist/features/Search/components/SearchResult.vue.script.js.map +1 -1
  158. package/dist/features/Search/helpers/create-search-index.d.ts +9 -1
  159. package/dist/features/Search/helpers/create-search-index.d.ts.map +1 -1
  160. package/dist/features/Search/helpers/create-search-index.js +27 -8
  161. package/dist/features/Search/helpers/create-search-index.js.map +1 -1
  162. package/dist/features/Search/hooks/useSearchIndex.d.ts +4 -2
  163. package/dist/features/Search/hooks/useSearchIndex.d.ts.map +1 -1
  164. package/dist/features/Search/hooks/useSearchIndex.js +4 -3
  165. package/dist/features/Search/hooks/useSearchIndex.js.map +1 -1
  166. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.d.ts +1 -1
  167. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.d.ts.map +1 -1
  168. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.js.map +1 -1
  169. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js +11 -9
  170. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js.map +1 -1
  171. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.d.ts.map +1 -1
  172. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.js.map +1 -1
  173. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.script.js +9 -1
  174. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.script.js.map +1 -1
  175. package/dist/helpers/get-async-api-model-schema.d.ts +15 -0
  176. package/dist/helpers/get-async-api-model-schema.d.ts.map +1 -0
  177. package/dist/helpers/get-async-api-model-schema.js +32 -0
  178. package/dist/helpers/get-async-api-model-schema.js.map +1 -0
  179. package/dist/helpers/id-routing.d.ts +18 -0
  180. package/dist/helpers/id-routing.d.ts.map +1 -1
  181. package/dist/helpers/id-routing.js +41 -1
  182. package/dist/helpers/id-routing.js.map +1 -1
  183. package/dist/plugins/index.d.ts +1 -1
  184. package/dist/plugins/index.js +1 -1
  185. package/dist/plugins/{persistance-plugin.d.ts → persistence-plugin.d.ts} +2 -8
  186. package/dist/plugins/persistence-plugin.d.ts.map +1 -0
  187. package/dist/plugins/{persistance-plugin.js → persistence-plugin.js} +4 -13
  188. package/dist/plugins/persistence-plugin.js.map +1 -0
  189. package/dist/standalone.esm.d.ts +4 -0
  190. package/dist/standalone.esm.d.ts.map +1 -0
  191. package/dist/style.css +110 -98
  192. package/dist/vue-styles.css +104 -96
  193. package/package.json +20 -18
  194. package/dist/browser/webpack-stats.json +0 -1
  195. package/dist/plugins/persistance-plugin.d.ts.map +0 -1
  196. package/dist/plugins/persistance-plugin.js.map +0 -1
@@ -1,10 +1,12 @@
1
+ import { type ModelsSectionLabel } from '@scalar/types/api-reference';
2
+ import type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1';
1
3
  import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
4
  import { type MaybeRefOrGetter } from 'vue';
3
5
  import type { FuseData } from '../types';
4
6
  /**
5
- * Creates the search index from an OpenAPI document.
7
+ * Creates the search index from an OpenAPI or AsyncAPI document.
6
8
  */
7
- export declare function useSearchIndex(document: MaybeRefOrGetter<OpenApiDocument | undefined>): {
9
+ export declare function useSearchIndex(document: MaybeRefOrGetter<OpenApiDocument | AsyncApiDocument | undefined>, modelsSectionLabel?: MaybeRefOrGetter<ModelsSectionLabel | undefined>): {
8
10
  results: import("vue").ComputedRef<{
9
11
  item: FuseData;
10
12
  refIndex: number;
@@ -1 +1 @@
1
- {"version":3,"file":"useSearchIndex.d.ts","sourceRoot":"","sources":["../../../../src/features/Search/hooks/useSearchIndex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAEnG,OAAO,EAAE,KAAK,gBAAgB,EAA0B,MAAM,KAAK,CAAA;AAInE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAIxC;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,gBAAgB,CAAC,eAAe,GAAG,SAAS,CAAC;;;;;;EAiCrF"}
1
+ {"version":3,"file":"useSearchIndex.d.ts","sourceRoot":"","sources":["../../../../src/features/Search/hooks/useSearchIndex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AACnG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAEnG,OAAO,EAAE,KAAK,gBAAgB,EAA0B,MAAM,KAAK,CAAA;AAInE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAIxC;;GAEG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,gBAAgB,CAAC,eAAe,GAAG,gBAAgB,GAAG,SAAS,CAAC,EAC1E,kBAAkB,GAAE,gBAAgB,CAAC,kBAAkB,GAAG,SAAS,CAAgC;;;;;;EAsCpG"}
@@ -1,13 +1,14 @@
1
1
  import { createFuseInstance } from "../helpers/create-fuse-instance.js";
2
2
  import { createSearchIndex } from "../helpers/create-search-index.js";
3
3
  import { computed, ref, toValue } from "vue";
4
+ import { DEFAULT_MODELS_SECTION_LABEL } from "@scalar/types/api-reference";
4
5
  //#region src/features/Search/hooks/useSearchIndex.ts
5
6
  var MAX_SEARCH_RESULTS = 25;
6
7
  /**
7
- * Creates the search index from an OpenAPI document.
8
+ * Creates the search index from an OpenAPI or AsyncAPI document.
8
9
  */
9
- function useSearchIndex(document) {
10
- const searchIndex = computed(() => createSearchIndex(toValue(document)));
10
+ function useSearchIndex(document, modelsSectionLabel = DEFAULT_MODELS_SECTION_LABEL) {
11
+ const searchIndex = computed(() => createSearchIndex(toValue(document), { modelsSectionLabel: toValue(modelsSectionLabel) ?? DEFAULT_MODELS_SECTION_LABEL }));
11
12
  /** When the document changes we replace the search index */
12
13
  const fuse = computed(() => {
13
14
  const instance = createFuseInstance();
@@ -1 +1 @@
1
- {"version":3,"file":"useSearchIndex.js","names":[],"sources":["../../../../src/features/Search/hooks/useSearchIndex.ts"],"sourcesContent":["import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport type { FuseResult } from 'fuse.js'\nimport { type MaybeRefOrGetter, computed, ref, toValue } from 'vue'\n\nimport { createFuseInstance } from '../helpers/create-fuse-instance'\nimport { createSearchIndex } from '../helpers/create-search-index'\nimport type { FuseData } from '../types'\n\nconst MAX_SEARCH_RESULTS = 25\n\n/**\n * Creates the search index from an OpenAPI document.\n */\nexport function useSearchIndex(document: MaybeRefOrGetter<OpenApiDocument | undefined>) {\n const searchIndex = computed<FuseData[]>(() => createSearchIndex(toValue(document)))\n\n /** When the document changes we replace the search index */\n const fuse = computed(() => {\n const instance = createFuseInstance()\n instance.setCollection(searchIndex.value)\n return instance\n })\n\n const query = ref<string>('')\n\n const results = computed(() => {\n if (query.value.length !== 0) {\n return fuse.value.search(query.value, {\n limit: MAX_SEARCH_RESULTS,\n })\n }\n\n // Show a few entries as a placeholder\n return searchIndex.value.slice(0, MAX_SEARCH_RESULTS).map(\n (item: FuseData, index: number) =>\n ({\n item,\n refIndex: index,\n }) satisfies FuseResult<FuseData>,\n )\n })\n\n return {\n results,\n query,\n }\n}\n"],"mappings":";;;;AAQA,IAAM,qBAAqB;;;;AAK3B,SAAgB,eAAe,UAAyD;CACtF,MAAM,cAAc,eAA2B,kBAAkB,QAAQ,SAAS,CAAC,CAAC;;CAGpF,MAAM,OAAO,eAAe;EAC1B,MAAM,WAAW,oBAAoB;AACrC,WAAS,cAAc,YAAY,MAAM;AACzC,SAAO;GACP;CAEF,MAAM,QAAQ,IAAY,GAAG;AAmB7B,QAAO;EACL,SAlBc,eAAe;AAC7B,OAAI,MAAM,MAAM,WAAW,EACzB,QAAO,KAAK,MAAM,OAAO,MAAM,OAAO,EACpC,OAAO,oBACR,CAAC;AAIJ,UAAO,YAAY,MAAM,MAAM,GAAG,mBAAmB,CAAC,KACnD,MAAgB,WACd;IACC;IACA,UAAU;IACX,EACJ;IACD;EAIA;EACD"}
1
+ {"version":3,"file":"useSearchIndex.js","names":[],"sources":["../../../../src/features/Search/hooks/useSearchIndex.ts"],"sourcesContent":["import { DEFAULT_MODELS_SECTION_LABEL, type ModelsSectionLabel } from '@scalar/types/api-reference'\nimport type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport type { FuseResult } from 'fuse.js'\nimport { type MaybeRefOrGetter, computed, ref, toValue } from 'vue'\n\nimport { createFuseInstance } from '../helpers/create-fuse-instance'\nimport { createSearchIndex } from '../helpers/create-search-index'\nimport type { FuseData } from '../types'\n\nconst MAX_SEARCH_RESULTS = 25\n\n/**\n * Creates the search index from an OpenAPI or AsyncAPI document.\n */\nexport function useSearchIndex(\n document: MaybeRefOrGetter<OpenApiDocument | AsyncApiDocument | undefined>,\n modelsSectionLabel: MaybeRefOrGetter<ModelsSectionLabel | undefined> = DEFAULT_MODELS_SECTION_LABEL,\n) {\n const searchIndex = computed<FuseData[]>(() =>\n createSearchIndex(toValue(document), {\n modelsSectionLabel: toValue(modelsSectionLabel) ?? DEFAULT_MODELS_SECTION_LABEL,\n }),\n )\n\n /** When the document changes we replace the search index */\n const fuse = computed(() => {\n const instance = createFuseInstance()\n instance.setCollection(searchIndex.value)\n return instance\n })\n\n const query = ref<string>('')\n\n const results = computed(() => {\n if (query.value.length !== 0) {\n return fuse.value.search(query.value, {\n limit: MAX_SEARCH_RESULTS,\n })\n }\n\n // Show a few entries as a placeholder\n return searchIndex.value.slice(0, MAX_SEARCH_RESULTS).map(\n (item: FuseData, index: number) =>\n ({\n item,\n refIndex: index,\n }) satisfies FuseResult<FuseData>,\n )\n })\n\n return {\n results,\n query,\n }\n}\n"],"mappings":";;;;;AAUA,IAAM,qBAAqB;;;;AAK3B,SAAgB,eACd,UACA,qBAAuE,8BACvE;CACA,MAAM,cAAc,eAClB,kBAAkB,QAAQ,SAAS,EAAE,EACnC,oBAAoB,QAAQ,mBAAmB,IAAI,8BACpD,CAAC,CACH;;CAGD,MAAM,OAAO,eAAe;EAC1B,MAAM,WAAW,oBAAoB;AACrC,WAAS,cAAc,YAAY,MAAM;AACzC,SAAO;GACP;CAEF,MAAM,QAAQ,IAAY,GAAG;AAmB7B,QAAO;EACL,SAlBc,eAAe;AAC7B,OAAI,MAAM,MAAM,WAAW,EACzB,QAAO,KAAK,MAAM,OAAO,MAAM,OAAO,EACpC,OAAO,oBACR,CAAC;AAIJ,UAAO,YAAY,MAAM,MAAM,GAAG,mBAAmB,CAAC,KACnD,MAAgB,WACd;IACC;IACA,UAAU;IACX,EACJ;IACD;EAIA;EACD"}
@@ -1,4 +1,4 @@
1
- import type { ApiReferenceConfiguration } from '@scalar/types/api-reference';
1
+ import { type ApiReferenceConfiguration } from '@scalar/types/api-reference';
2
2
  type LayoutOptions = {
3
3
  showSidebar?: boolean;
4
4
  defaultOpenFirstTag?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"ApiReferenceToolbarConfigLayoutOptions.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue"],"names":[],"mappings":"AA6GA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAE5E,KAAK,aAAa,GAAG;IACnB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,KAAK,WAAW,GAAG;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAA;CACnD,CAAC;AA8BF,KAAK,gBAAgB,GAAG;IACxB,UAAU,CAAC,EAAE,aAAa,CAAC;CAC1B,CAAC;AAKF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AA6QxD,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"ApiReferenceToolbarConfigLayoutOptions.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue"],"names":[],"mappings":"AAqHA,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,6BAA6B,CAAA;AAGpC,KAAK,aAAa,GAAG;IACnB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,KAAK,WAAW,GAAG;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAA;CACnD,CAAC;AAkCF,KAAK,gBAAgB,GAAG;IACxB,UAAU,CAAC,EAAE,aAAa,CAAC;CAC1B,CAAC;AAKF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AAgRxD,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ApiReferenceToolbarConfigLayoutOptions.vue.js","names":[],"sources":["../../../../src/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarFormInputGroup } from '@scalar/components/form'\nimport { ScalarToggleInput } from '@scalar/components/toggle'\nimport type { ApiReferenceConfiguration } from '@scalar/types/api-reference'\n\ntype LayoutOptions = {\n showSidebar?: boolean\n defaultOpenFirstTag?: boolean\n defaultOpenAllTags?: boolean\n expandAllModelSections?: boolean\n expandAllResponses?: boolean\n hideClientButton?: boolean\n hideDarkModeToggle?: boolean\n hideModels?: boolean\n hideSearch?: boolean\n hideTestRequestButton?: boolean\n showOperationId?: boolean\n}\n\nconst { configuration } = defineProps<{\n configuration?: Partial<ApiReferenceConfiguration>\n}>()\n\nconst model = defineModel<LayoutOptions>({\n default: {},\n})\n\nfunction getValue(key: keyof LayoutOptions, defaultValue: boolean = false) {\n return model.value[key] ?? configuration?.[key] ?? defaultValue\n}\n\nfunction setValue(\n key: keyof LayoutOptions,\n value: boolean,\n defaultValue: boolean = false,\n) {\n if (value !== defaultValue) {\n model.value = { ...model.value, [key]: value }\n } else {\n model.value = Object.fromEntries(\n Object.entries(model.value).filter(([k]) => key !== k),\n )\n }\n}\n</script>\n<template>\n <ScalarFormInputGroup>\n <ScalarToggleInput\n :modelValue=\"getValue('showSidebar', true)\"\n @update:modelValue=\"(v) => setValue('showSidebar', !!v, true)\">\n Show Sidebar\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('defaultOpenFirstTag', true)\"\n @update:modelValue=\"(v) => setValue('defaultOpenFirstTag', !!v, true)\">\n Default Open First Tag\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('defaultOpenAllTags')\"\n @update:modelValue=\"(v) => setValue('defaultOpenAllTags', !!v)\">\n Default Open All Tags\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('expandAllModelSections')\"\n @update:modelValue=\"(v) => setValue('expandAllModelSections', !!v)\">\n Expand All Model Sections\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('expandAllResponses')\"\n @update:modelValue=\"(v) => setValue('expandAllResponses', !!v)\">\n Expand All Responses\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('hideClientButton')\"\n @update:modelValue=\"(v) => setValue('hideClientButton', !!v)\">\n Hide Client Button\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('hideDarkModeToggle')\"\n @update:modelValue=\"(v) => setValue('hideDarkModeToggle', !!v)\">\n Hide Dark Mode Toggle\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('hideModels')\"\n @update:modelValue=\"(v) => setValue('hideModels', !!v)\">\n Hide Models\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('hideSearch')\"\n @update:modelValue=\"(v) => setValue('hideSearch', !!v)\">\n Hide Search\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('showOperationId')\"\n @update:modelValue=\"(v) => setValue('showOperationId', !!v)\">\n Show Operation ID\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('hideTestRequestButton')\"\n @update:modelValue=\"(v) => setValue('hideTestRequestButton', !!v)\">\n Hide Test Request Button\n </ScalarToggleInput>\n </ScalarFormInputGroup>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"ApiReferenceToolbarConfigLayoutOptions.vue.js","names":[],"sources":["../../../../src/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarFormInputGroup } from '@scalar/components/form'\nimport { ScalarToggleInput } from '@scalar/components/toggle'\nimport {\n DEFAULT_MODELS_SECTION_LABEL,\n type ApiReferenceConfiguration,\n} from '@scalar/types/api-reference'\nimport { computed } from 'vue'\n\ntype LayoutOptions = {\n showSidebar?: boolean\n defaultOpenFirstTag?: boolean\n defaultOpenAllTags?: boolean\n expandAllModelSections?: boolean\n expandAllResponses?: boolean\n hideClientButton?: boolean\n hideDarkModeToggle?: boolean\n hideModels?: boolean\n hideSearch?: boolean\n hideTestRequestButton?: boolean\n showOperationId?: boolean\n}\n\nconst { configuration } = defineProps<{\n configuration?: Partial<ApiReferenceConfiguration>\n}>()\n\nconst model = defineModel<LayoutOptions>({\n default: {},\n})\n\nfunction getValue(key: keyof LayoutOptions, defaultValue: boolean = false) {\n return model.value[key] ?? configuration?.[key] ?? defaultValue\n}\n\nfunction setValue(\n key: keyof LayoutOptions,\n value: boolean,\n defaultValue: boolean = false,\n) {\n if (value !== defaultValue) {\n model.value = { ...model.value, [key]: value }\n } else {\n model.value = Object.fromEntries(\n Object.entries(model.value).filter(([k]) => key !== k),\n )\n }\n}\n\nconst modelsSectionLabel = computed(\n () => configuration?.modelsSectionLabel ?? DEFAULT_MODELS_SECTION_LABEL,\n)\n</script>\n<template>\n <ScalarFormInputGroup>\n <ScalarToggleInput\n :modelValue=\"getValue('showSidebar', true)\"\n @update:modelValue=\"(v) => setValue('showSidebar', !!v, true)\">\n Show Sidebar\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('defaultOpenFirstTag', true)\"\n @update:modelValue=\"(v) => setValue('defaultOpenFirstTag', !!v, true)\">\n Default Open First Tag\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('defaultOpenAllTags')\"\n @update:modelValue=\"(v) => setValue('defaultOpenAllTags', !!v)\">\n Default Open All Tags\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('expandAllModelSections')\"\n @update:modelValue=\"(v) => setValue('expandAllModelSections', !!v)\">\n Expand All {{ modelsSectionLabel }}\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('expandAllResponses')\"\n @update:modelValue=\"(v) => setValue('expandAllResponses', !!v)\">\n Expand All Responses\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('hideClientButton')\"\n @update:modelValue=\"(v) => setValue('hideClientButton', !!v)\">\n Hide Client Button\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('hideDarkModeToggle')\"\n @update:modelValue=\"(v) => setValue('hideDarkModeToggle', !!v)\">\n Hide Dark Mode Toggle\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('hideModels')\"\n @update:modelValue=\"(v) => setValue('hideModels', !!v)\">\n Hide {{ modelsSectionLabel }}\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('hideSearch')\"\n @update:modelValue=\"(v) => setValue('hideSearch', !!v)\">\n Hide Search\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('showOperationId')\"\n @update:modelValue=\"(v) => setValue('showOperationId', !!v)\">\n Show Operation ID\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('hideTestRequestButton')\"\n @update:modelValue=\"(v) => setValue('hideTestRequestButton', !!v)\">\n Hide Test Request Button\n </ScalarToggleInput>\n </ScalarFormInputGroup>\n</template>\n"],"mappings":""}
@@ -1,4 +1,5 @@
1
- import { createBlock, createTextVNode, createVNode, defineComponent, mergeModels, openBlock, unref, useModel, withCtx } from "vue";
1
+ import { computed, createBlock, createTextVNode, createVNode, defineComponent, mergeModels, openBlock, toDisplayString, unref, useModel, withCtx } from "vue";
2
+ import { DEFAULT_MODELS_SECTION_LABEL } from "@scalar/types/api-reference";
2
3
  import { ScalarFormInputGroup } from "@scalar/components/form";
3
4
  import { ScalarToggleInput } from "@scalar/components/toggle";
4
5
  //#region src/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue?vue&type=script&setup=true&lang.ts
@@ -21,6 +22,7 @@ var ApiReferenceToolbarConfigLayoutOptions_vue_vue_type_script_setup_true_lang_d
21
22
  };
22
23
  else model.value = Object.fromEntries(Object.entries(model.value).filter(([k]) => key !== k));
23
24
  }
25
+ const modelsSectionLabel = computed(() => __props.configuration?.modelsSectionLabel ?? DEFAULT_MODELS_SECTION_LABEL);
24
26
  return (_ctx, _cache) => {
25
27
  return openBlock(), createBlock(unref(ScalarFormInputGroup), null, {
26
28
  default: withCtx(() => [
@@ -49,56 +51,56 @@ var ApiReferenceToolbarConfigLayoutOptions_vue_vue_type_script_setup_true_lang_d
49
51
  modelValue: getValue("expandAllModelSections"),
50
52
  "onUpdate:modelValue": _cache[3] || (_cache[3] = (v) => setValue("expandAllModelSections", !!v))
51
53
  }, {
52
- default: withCtx(() => [..._cache[14] || (_cache[14] = [createTextVNode(" Expand All Model Sections ", -1)])]),
54
+ default: withCtx(() => [createTextVNode(" Expand All " + toDisplayString(modelsSectionLabel.value), 1)]),
53
55
  _: 1
54
56
  }, 8, ["modelValue"]),
55
57
  createVNode(unref(ScalarToggleInput), {
56
58
  modelValue: getValue("expandAllResponses"),
57
59
  "onUpdate:modelValue": _cache[4] || (_cache[4] = (v) => setValue("expandAllResponses", !!v))
58
60
  }, {
59
- default: withCtx(() => [..._cache[15] || (_cache[15] = [createTextVNode(" Expand All Responses ", -1)])]),
61
+ default: withCtx(() => [..._cache[14] || (_cache[14] = [createTextVNode(" Expand All Responses ", -1)])]),
60
62
  _: 1
61
63
  }, 8, ["modelValue"]),
62
64
  createVNode(unref(ScalarToggleInput), {
63
65
  modelValue: getValue("hideClientButton"),
64
66
  "onUpdate:modelValue": _cache[5] || (_cache[5] = (v) => setValue("hideClientButton", !!v))
65
67
  }, {
66
- default: withCtx(() => [..._cache[16] || (_cache[16] = [createTextVNode(" Hide Client Button ", -1)])]),
68
+ default: withCtx(() => [..._cache[15] || (_cache[15] = [createTextVNode(" Hide Client Button ", -1)])]),
67
69
  _: 1
68
70
  }, 8, ["modelValue"]),
69
71
  createVNode(unref(ScalarToggleInput), {
70
72
  modelValue: getValue("hideDarkModeToggle"),
71
73
  "onUpdate:modelValue": _cache[6] || (_cache[6] = (v) => setValue("hideDarkModeToggle", !!v))
72
74
  }, {
73
- default: withCtx(() => [..._cache[17] || (_cache[17] = [createTextVNode(" Hide Dark Mode Toggle ", -1)])]),
75
+ default: withCtx(() => [..._cache[16] || (_cache[16] = [createTextVNode(" Hide Dark Mode Toggle ", -1)])]),
74
76
  _: 1
75
77
  }, 8, ["modelValue"]),
76
78
  createVNode(unref(ScalarToggleInput), {
77
79
  modelValue: getValue("hideModels"),
78
80
  "onUpdate:modelValue": _cache[7] || (_cache[7] = (v) => setValue("hideModels", !!v))
79
81
  }, {
80
- default: withCtx(() => [..._cache[18] || (_cache[18] = [createTextVNode(" Hide Models ", -1)])]),
82
+ default: withCtx(() => [createTextVNode(" Hide " + toDisplayString(modelsSectionLabel.value), 1)]),
81
83
  _: 1
82
84
  }, 8, ["modelValue"]),
83
85
  createVNode(unref(ScalarToggleInput), {
84
86
  modelValue: getValue("hideSearch"),
85
87
  "onUpdate:modelValue": _cache[8] || (_cache[8] = (v) => setValue("hideSearch", !!v))
86
88
  }, {
87
- default: withCtx(() => [..._cache[19] || (_cache[19] = [createTextVNode(" Hide Search ", -1)])]),
89
+ default: withCtx(() => [..._cache[17] || (_cache[17] = [createTextVNode(" Hide Search ", -1)])]),
88
90
  _: 1
89
91
  }, 8, ["modelValue"]),
90
92
  createVNode(unref(ScalarToggleInput), {
91
93
  modelValue: getValue("showOperationId"),
92
94
  "onUpdate:modelValue": _cache[9] || (_cache[9] = (v) => setValue("showOperationId", !!v))
93
95
  }, {
94
- default: withCtx(() => [..._cache[20] || (_cache[20] = [createTextVNode(" Show Operation ID ", -1)])]),
96
+ default: withCtx(() => [..._cache[18] || (_cache[18] = [createTextVNode(" Show Operation ID ", -1)])]),
95
97
  _: 1
96
98
  }, 8, ["modelValue"]),
97
99
  createVNode(unref(ScalarToggleInput), {
98
100
  modelValue: getValue("hideTestRequestButton"),
99
101
  "onUpdate:modelValue": _cache[10] || (_cache[10] = (v) => setValue("hideTestRequestButton", !!v))
100
102
  }, {
101
- default: withCtx(() => [..._cache[21] || (_cache[21] = [createTextVNode(" Hide Test Request Button ", -1)])]),
103
+ default: withCtx(() => [..._cache[19] || (_cache[19] = [createTextVNode(" Hide Test Request Button ", -1)])]),
102
104
  _: 1
103
105
  }, 8, ["modelValue"])
104
106
  ]),
@@ -1 +1 @@
1
- {"version":3,"file":"ApiReferenceToolbarConfigLayoutOptions.vue.script.js","names":[],"sources":["../../../../src/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarFormInputGroup } from '@scalar/components/form'\nimport { ScalarToggleInput } from '@scalar/components/toggle'\nimport type { ApiReferenceConfiguration } from '@scalar/types/api-reference'\n\ntype LayoutOptions = {\n showSidebar?: boolean\n defaultOpenFirstTag?: boolean\n defaultOpenAllTags?: boolean\n expandAllModelSections?: boolean\n expandAllResponses?: boolean\n hideClientButton?: boolean\n hideDarkModeToggle?: boolean\n hideModels?: boolean\n hideSearch?: boolean\n hideTestRequestButton?: boolean\n showOperationId?: boolean\n}\n\nconst { configuration } = defineProps<{\n configuration?: Partial<ApiReferenceConfiguration>\n}>()\n\nconst model = defineModel<LayoutOptions>({\n default: {},\n})\n\nfunction getValue(key: keyof LayoutOptions, defaultValue: boolean = false) {\n return model.value[key] ?? configuration?.[key] ?? defaultValue\n}\n\nfunction setValue(\n key: keyof LayoutOptions,\n value: boolean,\n defaultValue: boolean = false,\n) {\n if (value !== defaultValue) {\n model.value = { ...model.value, [key]: value }\n } else {\n model.value = Object.fromEntries(\n Object.entries(model.value).filter(([k]) => key !== k),\n )\n }\n}\n</script>\n<template>\n <ScalarFormInputGroup>\n <ScalarToggleInput\n :modelValue=\"getValue('showSidebar', true)\"\n @update:modelValue=\"(v) => setValue('showSidebar', !!v, true)\">\n Show Sidebar\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('defaultOpenFirstTag', true)\"\n @update:modelValue=\"(v) => setValue('defaultOpenFirstTag', !!v, true)\">\n Default Open First Tag\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('defaultOpenAllTags')\"\n @update:modelValue=\"(v) => setValue('defaultOpenAllTags', !!v)\">\n Default Open All Tags\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('expandAllModelSections')\"\n @update:modelValue=\"(v) => setValue('expandAllModelSections', !!v)\">\n Expand All Model Sections\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('expandAllResponses')\"\n @update:modelValue=\"(v) => setValue('expandAllResponses', !!v)\">\n Expand All Responses\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('hideClientButton')\"\n @update:modelValue=\"(v) => setValue('hideClientButton', !!v)\">\n Hide Client Button\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('hideDarkModeToggle')\"\n @update:modelValue=\"(v) => setValue('hideDarkModeToggle', !!v)\">\n Hide Dark Mode Toggle\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('hideModels')\"\n @update:modelValue=\"(v) => setValue('hideModels', !!v)\">\n Hide Models\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('hideSearch')\"\n @update:modelValue=\"(v) => setValue('hideSearch', !!v)\">\n Hide Search\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('showOperationId')\"\n @update:modelValue=\"(v) => setValue('showOperationId', !!v)\">\n Show Operation ID\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('hideTestRequestButton')\"\n @update:modelValue=\"(v) => setValue('hideTestRequestButton', !!v)\">\n Hide Test Request Button\n </ScalarToggleInput>\n </ScalarFormInputGroup>\n</template>\n"],"mappings":";;;;;;;;;;;;EAuBA,MAAM,QAAQ,SAA0B,SAAA,aAEvC;EAED,SAAS,SAAS,KAA0B,eAAwB,OAAO;AACzE,UAAO,MAAM,MAAM,QAAQ,QAAA,gBAAgB,QAAQ;;EAGrD,SAAS,SACP,KACA,OACA,eAAwB,OACxB;AACA,OAAI,UAAU,aACZ,OAAM,QAAQ;IAAE,GAAG,MAAM;KAAQ,MAAM;IAAM;OAE7C,OAAM,QAAQ,OAAO,YACnB,OAAO,QAAQ,MAAM,MAAM,CAAC,QAAQ,CAAC,OAAO,QAAQ,EAAE,CACxD;;;uBAKF,YAwDuB,MAAA,qBAAA,EAAA,MAAA;2BAnDD;KAJpB,YAIoB,MAAA,kBAAA,EAAA;MAHjB,YAAY,SAAQ,eAAA,KAAA;MACpB,uBAAiB,OAAA,OAAA,OAAA,MAAG,MAAM,SAAQ,eAAA,CAAA,CAAkB,GAAC,KAAA;;6BAExD,CAAA,GAAA,OAAA,QAAA,OAAA,MAAA,CAAA,gBAFiE,kBAEjE,GAAA,CAAA,EAAA,CAAA;;;KACA,YAIoB,MAAA,kBAAA,EAAA;MAHjB,YAAY,SAAQ,uBAAA,KAAA;MACpB,uBAAiB,OAAA,OAAA,OAAA,MAAG,MAAM,SAAQ,uBAAA,CAAA,CAA0B,GAAC,KAAA;;6BAEhE,CAAA,GAAA,OAAA,QAAA,OAAA,MAAA,CAAA,gBAFyE,4BAEzE,GAAA,CAAA,EAAA,CAAA;;;KACA,YAIoB,MAAA,kBAAA,EAAA;M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,cAAA,CAAA,CAAiB,EAAC;;6BAEvD,CAAA,GAAA,OAAA,QAAA,OAAA,MAAA,CAAA,gBAF0D,iBAE1D,GAAA,CAAA,EAAA,CAAA;;;KACA,YAIoB,MAAA,kBAAA,EAAA;MAHjB,YAAY,SAAQ,aAAA;MACpB,uBAAiB,OAAA,OAAA,OAAA,MAAG,MAAM,SAAQ,cAAA,CAAA,CAAiB,EAAC;;6BAEvD,CAAA,GAAA,OAAA,QAAA,OAAA,MAAA,CAAA,gBAF0D,iBAE1D,GAAA,CAAA,EAAA,CAAA;;;KACA,YAIoB,MAAA,kBAAA,EAAA;MAHjB,YAAY,SAAQ,kBAAA;MACpB,uBAAiB,OAAA,OAAA,OAAA,MAAG,MAAM,SAAQ,mBAAA,CAAA,CAAsB,EAAC;;6BAE5D,CAAA,GAAA,OAAA,QAAA,OAAA,MAAA,CAAA,gBAF+D,uBAE/D,GAAA,CAAA,EAAA,CAAA;;;KACA,YAIoB,MAAA,kBAAA,EAAA;MAHjB,YAAY,SAAQ,wBAAA;MACpB,uBAAiB,OAAA,QAAA,OAAA,OAAG,MAAM,SAAQ,yBAAA,CAAA,CAA4B,EAAC;;6BAElE,CAAA,GAAA,OAAA,QAAA,OAAA,MAAA,CAAA,gBAFqE,8BAErE,GAAA,CAAA,EAAA,CAAA"}
1
+ {"version":3,"file":"ApiReferenceToolbarConfigLayoutOptions.vue.script.js","names":[],"sources":["../../../../src/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarFormInputGroup } from '@scalar/components/form'\nimport { ScalarToggleInput } from '@scalar/components/toggle'\nimport {\n DEFAULT_MODELS_SECTION_LABEL,\n type ApiReferenceConfiguration,\n} from '@scalar/types/api-reference'\nimport { computed } from 'vue'\n\ntype LayoutOptions = {\n showSidebar?: boolean\n defaultOpenFirstTag?: boolean\n defaultOpenAllTags?: boolean\n expandAllModelSections?: boolean\n expandAllResponses?: boolean\n hideClientButton?: boolean\n hideDarkModeToggle?: boolean\n hideModels?: boolean\n hideSearch?: boolean\n hideTestRequestButton?: boolean\n showOperationId?: boolean\n}\n\nconst { configuration } = defineProps<{\n configuration?: Partial<ApiReferenceConfiguration>\n}>()\n\nconst model = defineModel<LayoutOptions>({\n default: {},\n})\n\nfunction getValue(key: keyof LayoutOptions, defaultValue: boolean = false) {\n return model.value[key] ?? configuration?.[key] ?? defaultValue\n}\n\nfunction setValue(\n key: keyof LayoutOptions,\n value: boolean,\n defaultValue: boolean = false,\n) {\n if (value !== defaultValue) {\n model.value = { ...model.value, [key]: value }\n } else {\n model.value = Object.fromEntries(\n Object.entries(model.value).filter(([k]) => key !== k),\n )\n }\n}\n\nconst modelsSectionLabel = computed(\n () => configuration?.modelsSectionLabel ?? DEFAULT_MODELS_SECTION_LABEL,\n)\n</script>\n<template>\n <ScalarFormInputGroup>\n <ScalarToggleInput\n :modelValue=\"getValue('showSidebar', true)\"\n @update:modelValue=\"(v) => setValue('showSidebar', !!v, true)\">\n Show Sidebar\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('defaultOpenFirstTag', true)\"\n @update:modelValue=\"(v) => setValue('defaultOpenFirstTag', !!v, true)\">\n Default Open First Tag\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('defaultOpenAllTags')\"\n @update:modelValue=\"(v) => setValue('defaultOpenAllTags', !!v)\">\n Default Open All Tags\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('expandAllModelSections')\"\n @update:modelValue=\"(v) => setValue('expandAllModelSections', !!v)\">\n Expand All {{ modelsSectionLabel }}\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('expandAllResponses')\"\n @update:modelValue=\"(v) => setValue('expandAllResponses', !!v)\">\n Expand All Responses\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('hideClientButton')\"\n @update:modelValue=\"(v) => setValue('hideClientButton', !!v)\">\n Hide Client Button\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('hideDarkModeToggle')\"\n @update:modelValue=\"(v) => setValue('hideDarkModeToggle', !!v)\">\n Hide Dark Mode Toggle\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('hideModels')\"\n @update:modelValue=\"(v) => setValue('hideModels', !!v)\">\n Hide {{ modelsSectionLabel }}\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('hideSearch')\"\n @update:modelValue=\"(v) => setValue('hideSearch', !!v)\">\n Hide Search\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('showOperationId')\"\n @update:modelValue=\"(v) => setValue('showOperationId', !!v)\">\n Show Operation ID\n </ScalarToggleInput>\n <ScalarToggleInput\n :modelValue=\"getValue('hideTestRequestButton')\"\n @update:modelValue=\"(v) => setValue('hideTestRequestButton', !!v)\">\n Hide Test Request Button\n </ScalarToggleInput>\n </ScalarFormInputGroup>\n</template>\n"],"mappings":";;;;;;;;;;;;;EA2BA,MAAM,QAAQ,SAA0B,SAAA,aAEvC;EAED,SAAS,SAAS,KAA0B,eAAwB,OAAO;AACzE,UAAO,MAAM,MAAM,QAAQ,QAAA,gBAAgB,QAAQ;;EAGrD,SAAS,SACP,KACA,OACA,eAAwB,OACxB;AACA,OAAI,UAAU,aACZ,OAAM,QAAQ;IAAE,GAAG,MAAM;KAAQ,MAAM;IAAM;OAE7C,OAAM,QAAQ,OAAO,YACnB,OAAO,QAAQ,MAAM,MAAM,CAAC,QAAQ,CAAC,OAAO,QAAQ,EAAE,CACxD;;EAIJ,MAAM,qBAAqB,eACnB,QAAA,eAAe,sBAAsB,6BAC7C;;uBAGE,YAwDuB,MAAA,qBAAA,EAAA,MAAA;2BAnDD;KAJpB,YAIoB,MAAA,kBAAA,EAAA;MAHjB,YAAY,SAAQ,eAAA,KAAA;MACpB,uBAAiB,OAAA,OAAA,OAAA,MAAG,MAAM,SAAQ,eAAA,CAAA,CAAkB,GAAC,K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../../../../src/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue"],"names":[],"mappings":"AA+EA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAKpE,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,cAAc,CAAA;IACzB,YAAY,EAAE,YAAY,CAAA;CAC3B,CAAC;AAoGF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"ApiReferenceToolbarShareRegister.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue"],"names":[],"mappings":"AAqFA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAKpE,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,cAAc,CAAA;IACzB,YAAY,EAAE,YAAY,CAAA;CAC3B,CAAC;AAsGF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ApiReferenceToolbarShareRegister.vue.js","names":[],"sources":["../../../../src/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport {\n ScalarIconBookOpen,\n ScalarIconBracketsCurly,\n ScalarIconCloud,\n ScalarIconFileMd,\n ScalarIconGitBranch,\n ScalarIconGlobeSimple,\n ScalarIconLockSimple,\n ScalarIconWarningOctagon,\n} from '@scalar/icons'\nimport { type ScalarIconComponent } from '@scalar/icons/types'\nimport type { ExternalUrls } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\n\nimport ApiReferenceToolbarBlurb from './ApiReferenceToolbarBlurb.vue'\nimport ApiReferenceToolbarRegisterButton from './ApiReferenceToolbarRegisterButton.vue'\n\nconst { workspace, externalUrls } = defineProps<{\n workspace: WorkspaceStore\n externalUrls: ExternalUrls\n}>()\n\nconst FEATURES = [\n { icon: ScalarIconLockSimple, label: 'Password Protection' },\n { icon: ScalarIconGlobeSimple, label: 'Custom Domains' },\n { icon: ScalarIconBookOpen, label: 'Free-form content' },\n { icon: ScalarIconCloud, label: 'CDN Infrastructure' },\n { icon: ScalarIconGitBranch, label: 'Pull from GitHub' },\n { icon: ScalarIconFileMd, label: 'Markdown/MDX' },\n { icon: ScalarIconWarningOctagon, label: 'Spectral Linting' },\n { icon: ScalarIconBracketsCurly, label: 'JSON Schema Hosting' },\n] as const satisfies ReadonlyArray<{\n icon: ScalarIconComponent\n label: string\n}>\n</script>\n<template>\n <ul class=\"text-c-2 mb-2 grid grid-cols-2 gap-2.5 font-medium\">\n <li\n v-for=\"feature in FEATURES\"\n :key=\"feature.label\"\n class=\"flex items-center gap-2\">\n <component\n :is=\"feature.icon\"\n class=\"text-c-3 size-3.5\"\n weight=\"bold\" />\n {{ feature.label }}\n </li>\n </ul>\n <ApiReferenceToolbarRegisterButton\n :externalUrls\n :workspace>\n Deploy on Scalar\n </ApiReferenceToolbarRegisterButton>\n <ApiReferenceToolbarBlurb>\n Deploy your documentation for free. <br />\n Additional features might require\n <a\n href=\"https://scalar.com/products/docs/getting-started\"\n target=\"_blank\"\n >Scalar Pro</a\n >.\n </ApiReferenceToolbarBlurb>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"ApiReferenceToolbarShareRegister.vue.js","names":[],"sources":["../../../../src/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport {\n ScalarIconBookOpen,\n ScalarIconBracketsCurly,\n ScalarIconCloud,\n ScalarIconFileMd,\n ScalarIconGitBranch,\n ScalarIconGlobeSimple,\n ScalarIconLockSimple,\n ScalarIconPlugsConnected,\n ScalarIconSparkle,\n ScalarIconWarningOctagon,\n} from '@scalar/icons'\nimport { type ScalarIconComponent } from '@scalar/icons/types'\nimport type { ExternalUrls } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\n\nimport ApiReferenceToolbarBlurb from './ApiReferenceToolbarBlurb.vue'\nimport ApiReferenceToolbarRegisterButton from './ApiReferenceToolbarRegisterButton.vue'\n\nconst { workspace, externalUrls } = defineProps<{\n workspace: WorkspaceStore\n externalUrls: ExternalUrls\n}>()\n\nconst FEATURES = [\n { icon: ScalarIconLockSimple, label: 'Password Protection' },\n { icon: ScalarIconGlobeSimple, label: 'Custom Domains' },\n { icon: ScalarIconBookOpen, label: 'Free-form content' },\n { icon: ScalarIconCloud, label: 'CDN Infrastructure' },\n { icon: ScalarIconGitBranch, label: 'Pull from GitHub' },\n { icon: ScalarIconFileMd, label: 'Markdown/MDX' },\n { icon: ScalarIconWarningOctagon, label: 'Spectral Linting' },\n { icon: ScalarIconBracketsCurly, label: 'JSON Schema Hosting' },\n { icon: ScalarIconSparkle, label: 'Ask AI' },\n { icon: ScalarIconPlugsConnected, label: 'MCP Servers' },\n] as const satisfies ReadonlyArray<{\n icon: ScalarIconComponent\n label: string\n}>\n</script>\n<template>\n <ul class=\"text-c-2 mb-2 grid grid-cols-2 gap-2.5 font-medium\">\n <li\n v-for=\"feature in FEATURES\"\n :key=\"feature.label\"\n class=\"flex items-center gap-2\">\n <component\n :is=\"feature.icon\"\n class=\"text-c-3 size-3.5\"\n weight=\"bold\" />\n {{ feature.label }}\n </li>\n </ul>\n <ApiReferenceToolbarRegisterButton\n :externalUrls\n :workspace>\n Deploy on Scalar\n </ApiReferenceToolbarRegisterButton>\n <ApiReferenceToolbarBlurb>\n Deploy your documentation for free. <br />\n Additional features might require\n <a\n href=\"https://scalar.com/products/docs/getting-started\"\n target=\"_blank\"\n >Scalar Pro</a\n >.\n </ApiReferenceToolbarBlurb>\n</template>\n"],"mappings":""}
@@ -1,7 +1,7 @@
1
1
  import ApiReferenceToolbarBlurb_default from "./ApiReferenceToolbarBlurb.vue.js";
2
2
  import ApiReferenceToolbarRegisterButton_default from "./ApiReferenceToolbarRegisterButton.vue.js";
3
3
  import { Fragment, createBlock, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, renderList, resolveDynamicComponent, toDisplayString, withCtx } from "vue";
4
- import { ScalarIconBookOpen, ScalarIconBracketsCurly, ScalarIconCloud, ScalarIconFileMd, ScalarIconGitBranch, ScalarIconGlobeSimple, ScalarIconLockSimple, ScalarIconWarningOctagon } from "@scalar/icons";
4
+ import { ScalarIconBookOpen, ScalarIconBracketsCurly, ScalarIconCloud, ScalarIconFileMd, ScalarIconGitBranch, ScalarIconGlobeSimple, ScalarIconLockSimple, ScalarIconPlugsConnected, ScalarIconSparkle, ScalarIconWarningOctagon } from "@scalar/icons";
5
5
  //#region src/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue?vue&type=script&setup=true&lang.ts
6
6
  var _hoisted_1 = { class: "text-c-2 mb-2 grid grid-cols-2 gap-2.5 font-medium" };
7
7
  var ApiReferenceToolbarShareRegister_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
@@ -43,6 +43,14 @@ var ApiReferenceToolbarShareRegister_vue_vue_type_script_setup_true_lang_default
43
43
  {
44
44
  icon: ScalarIconBracketsCurly,
45
45
  label: "JSON Schema Hosting"
46
+ },
47
+ {
48
+ icon: ScalarIconSparkle,
49
+ label: "Ask AI"
50
+ },
51
+ {
52
+ icon: ScalarIconPlugsConnected,
53
+ label: "MCP Servers"
46
54
  }
47
55
  ];
48
56
  return (_ctx, _cache) => {
@@ -1 +1 @@
1
- {"version":3,"file":"ApiReferenceToolbarShareRegister.vue.script.js","names":[],"sources":["../../../../src/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport {\n ScalarIconBookOpen,\n ScalarIconBracketsCurly,\n ScalarIconCloud,\n ScalarIconFileMd,\n ScalarIconGitBranch,\n ScalarIconGlobeSimple,\n ScalarIconLockSimple,\n ScalarIconWarningOctagon,\n} from '@scalar/icons'\nimport { type ScalarIconComponent } from '@scalar/icons/types'\nimport type { ExternalUrls } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\n\nimport ApiReferenceToolbarBlurb from './ApiReferenceToolbarBlurb.vue'\nimport ApiReferenceToolbarRegisterButton from './ApiReferenceToolbarRegisterButton.vue'\n\nconst { workspace, externalUrls } = defineProps<{\n workspace: WorkspaceStore\n externalUrls: ExternalUrls\n}>()\n\nconst FEATURES = [\n { icon: ScalarIconLockSimple, label: 'Password Protection' },\n { icon: ScalarIconGlobeSimple, label: 'Custom Domains' },\n { icon: ScalarIconBookOpen, label: 'Free-form content' },\n { icon: ScalarIconCloud, label: 'CDN Infrastructure' },\n { icon: ScalarIconGitBranch, label: 'Pull from GitHub' },\n { icon: ScalarIconFileMd, label: 'Markdown/MDX' },\n { icon: ScalarIconWarningOctagon, label: 'Spectral Linting' },\n { icon: ScalarIconBracketsCurly, label: 'JSON Schema Hosting' },\n] as const satisfies ReadonlyArray<{\n icon: ScalarIconComponent\n label: string\n}>\n</script>\n<template>\n <ul class=\"text-c-2 mb-2 grid grid-cols-2 gap-2.5 font-medium\">\n <li\n v-for=\"feature in FEATURES\"\n :key=\"feature.label\"\n class=\"flex items-center gap-2\">\n <component\n :is=\"feature.icon\"\n class=\"text-c-3 size-3.5\"\n weight=\"bold\" />\n {{ feature.label }}\n </li>\n </ul>\n <ApiReferenceToolbarRegisterButton\n :externalUrls\n :workspace>\n Deploy on Scalar\n </ApiReferenceToolbarRegisterButton>\n <ApiReferenceToolbarBlurb>\n Deploy your documentation for free. <br />\n Additional features might require\n <a\n href=\"https://scalar.com/products/docs/getting-started\"\n target=\"_blank\"\n >Scalar Pro</a\n >.\n </ApiReferenceToolbarBlurb>\n</template>\n"],"mappings":";;;;;;;;;;;;;EAuBA,MAAM,WAAW;GACf;IAAE,MAAM;IAAsB,OAAO;IAAuB;GAC5D;IAAE,MAAM;IAAuB,OAAO;IAAkB;GACxD;IAAE,MAAM;IAAoB,OAAO;IAAqB;GACxD;IAAE,MAAM;IAAiB,OAAO;IAAsB;GACtD;IAAE,MAAM;IAAqB,OAAO;IAAoB;GACxD;IAAE,MAAM;IAAkB,OAAO;IAAgB;GACjD;IAAE,MAAM;IAA0B,OAAO;IAAoB;GAC7D;IAAE,MAAM;IAAyB,OAAO;IAAuB;GAChE;;;IAMC,mBAWK,MAXL,YAWK,EAAA,WAAA,EAVH,mBASK,UAAA,MAAA,WARe,WAAX,YAAO;YADhB,mBASK,MAAA;MAPF,KAAK,QAAQ;MACd,OAAM;uBACN,YAGkB,wBAFX,QAAQ,KAAI,EAAA;MACjB,OAAM;MACN,QAAO;0BAAS,MAClB,gBAAG,QAAQ,MAAK,EAAA,EAAA,CAAA,CAAA;;IAGpB,YAIoC,2CAAA;KAHjC,cAAA,QAAA;KACA,WAAA,QAAA;;4BAEH,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAFa,sBAEb,GAAA,CAAA,EAAA,CAAA;;;IACA,YAQ2B,kCAAA,MAAA;4BAPW,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA;sBADZ,yCACY,GAAA;MAAA,mBAAM,MAAA,MAAA,MAAA,GAAA;sBAAA,uCAE1C,GAAA;MAAA,mBAIC,KAAA;OAHC,MAAK;OACL,QAAO;SACN,cAAU,GAAA;sBACZ,MACH,GAAA"}
1
+ {"version":3,"file":"ApiReferenceToolbarShareRegister.vue.script.js","names":[],"sources":["../../../../src/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport {\n ScalarIconBookOpen,\n ScalarIconBracketsCurly,\n ScalarIconCloud,\n ScalarIconFileMd,\n ScalarIconGitBranch,\n ScalarIconGlobeSimple,\n ScalarIconLockSimple,\n ScalarIconPlugsConnected,\n ScalarIconSparkle,\n ScalarIconWarningOctagon,\n} from '@scalar/icons'\nimport { type ScalarIconComponent } from '@scalar/icons/types'\nimport type { ExternalUrls } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\n\nimport ApiReferenceToolbarBlurb from './ApiReferenceToolbarBlurb.vue'\nimport ApiReferenceToolbarRegisterButton from './ApiReferenceToolbarRegisterButton.vue'\n\nconst { workspace, externalUrls } = defineProps<{\n workspace: WorkspaceStore\n externalUrls: ExternalUrls\n}>()\n\nconst FEATURES = [\n { icon: ScalarIconLockSimple, label: 'Password Protection' },\n { icon: ScalarIconGlobeSimple, label: 'Custom Domains' },\n { icon: ScalarIconBookOpen, label: 'Free-form content' },\n { icon: ScalarIconCloud, label: 'CDN Infrastructure' },\n { icon: ScalarIconGitBranch, label: 'Pull from GitHub' },\n { icon: ScalarIconFileMd, label: 'Markdown/MDX' },\n { icon: ScalarIconWarningOctagon, label: 'Spectral Linting' },\n { icon: ScalarIconBracketsCurly, label: 'JSON Schema Hosting' },\n { icon: ScalarIconSparkle, label: 'Ask AI' },\n { icon: ScalarIconPlugsConnected, label: 'MCP Servers' },\n] as const satisfies ReadonlyArray<{\n icon: ScalarIconComponent\n label: string\n}>\n</script>\n<template>\n <ul class=\"text-c-2 mb-2 grid grid-cols-2 gap-2.5 font-medium\">\n <li\n v-for=\"feature in FEATURES\"\n :key=\"feature.label\"\n class=\"flex items-center gap-2\">\n <component\n :is=\"feature.icon\"\n class=\"text-c-3 size-3.5\"\n weight=\"bold\" />\n {{ feature.label }}\n </li>\n </ul>\n <ApiReferenceToolbarRegisterButton\n :externalUrls\n :workspace>\n Deploy on Scalar\n </ApiReferenceToolbarRegisterButton>\n <ApiReferenceToolbarBlurb>\n Deploy your documentation for free. <br />\n Additional features might require\n <a\n href=\"https://scalar.com/products/docs/getting-started\"\n target=\"_blank\"\n >Scalar Pro</a\n >.\n </ApiReferenceToolbarBlurb>\n</template>\n"],"mappings":";;;;;;;;;;;;;EAyBA,MAAM,WAAW;GACf;IAAE,MAAM;IAAsB,OAAO;IAAuB;GAC5D;IAAE,MAAM;IAAuB,OAAO;IAAkB;GACxD;IAAE,MAAM;IAAoB,OAAO;IAAqB;GACxD;IAAE,MAAM;IAAiB,OAAO;IAAsB;GACtD;IAAE,MAAM;IAAqB,OAAO;IAAoB;GACxD;IAAE,MAAM;IAAkB,OAAO;IAAgB;GACjD;IAAE,MAAM;IAA0B,OAAO;IAAoB;GAC7D;IAAE,MAAM;IAAyB,OAAO;IAAuB;GAC/D;IAAE,MAAM;IAAmB,OAAO;IAAU;GAC5C;IAAE,MAAM;IAA0B,OAAO;IAAe;GACzD;;;IAMC,mBAWK,MAXL,YAWK,EAAA,WAAA,EAVH,mBASK,UAAA,MAAA,WARe,WAAX,YAAO;YADhB,mBASK,MAAA;MAPF,KAAK,QAAQ;MACd,OAAM;uBACN,YAGkB,wBAFX,QAAQ,KAAI,EAAA;MACjB,OAAM;MACN,QAAO;0BAAS,MAClB,gBAAG,QAAQ,MAAK,EAAA,EAAA,CAAA,CAAA;;IAGpB,YAIoC,2CAAA;KAHjC,cAAA,QAAA;KACA,WAAA,QAAA;;4BAEH,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAFa,sBAEb,GAAA,CAAA,EAAA,CAAA;;;IACA,YAQ2B,kCAAA,MAAA;4BAPW,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA;sBADZ,yCACY,GAAA;MAAA,mBAAM,MAAA,MAAA,MAAA,GAAA;sBAAA,uCAE1C,GAAA;MAAA,mBAIC,KAAA;OAHC,MAAK;OACL,QAAO;SACN,cAAU,GAAA;sBACZ,MACH,GAAA"}
@@ -0,0 +1,15 @@
1
+ import type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1';
2
+ import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
3
+ /**
4
+ * Resolves a named schema from an AsyncAPI document's `components.schemas` into the `SchemaObject`
5
+ * shape the shared OpenAPI Model components and search indexing expect.
6
+ *
7
+ * AsyncAPI keeps reusable schemas in the same place OpenAPI does, but an entry may need extra handling:
8
+ * - `components` or the schema itself may be a `$ref`; siblings are merged so keys declared alongside
9
+ * a `$ref` are kept rather than dropped.
10
+ * - A Multi Format Schema Object (`schemaFormat` plus a nested `schema`) is unwrapped to its payload,
11
+ * so we index and render the inner JSON Schema rather than the wrapper.
12
+ * - Boolean (`true`/`false`) and non-JSON-Schema payloads are skipped.
13
+ */
14
+ export declare const getAsyncApiModelSchema: (document: AsyncApiDocument, name: string) => SchemaObject | undefined;
15
+ //# sourceMappingURL=get-async-api-model-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-async-api-model-schema.d.ts","sourceRoot":"","sources":["../../src/helpers/get-async-api-model-schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAElE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAShG;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,GAAI,UAAU,gBAAgB,EAAE,MAAM,MAAM,KAAG,YAAY,GAAG,SAmBhG,CAAA"}
@@ -0,0 +1,32 @@
1
+ import { getResolvedRef, mergeSiblingReferences } from "@scalar/workspace-store/helpers/get-resolved-ref";
2
+ import { isObject } from "@scalar/helpers/object/is-object";
3
+ //#region src/helpers/get-async-api-model-schema.ts
4
+ /**
5
+ * A resolved `components.schemas` entry may be a JSON Schema object, a boolean (`true`/`false`)
6
+ * schema, or a Multi Format Schema wrapper, so accept only plain objects and treat them as the
7
+ * `SchemaObject` the shared Model rendering and search helpers expect.
8
+ */
9
+ var isSchemaObject = (value) => isObject(value);
10
+ /**
11
+ * Resolves a named schema from an AsyncAPI document's `components.schemas` into the `SchemaObject`
12
+ * shape the shared OpenAPI Model components and search indexing expect.
13
+ *
14
+ * AsyncAPI keeps reusable schemas in the same place OpenAPI does, but an entry may need extra handling:
15
+ * - `components` or the schema itself may be a `$ref`; siblings are merged so keys declared alongside
16
+ * a `$ref` are kept rather than dropped.
17
+ * - A Multi Format Schema Object (`schemaFormat` plus a nested `schema`) is unwrapped to its payload,
18
+ * so we index and render the inner JSON Schema rather than the wrapper.
19
+ * - Boolean (`true`/`false`) and non-JSON-Schema payloads are skipped.
20
+ */
21
+ var getAsyncApiModelSchema = (document, name) => {
22
+ if (!document.components) return;
23
+ const entry = getResolvedRef(document.components, mergeSiblingReferences).schemas?.[name];
24
+ if (entry === void 0) return;
25
+ const resolved = getResolvedRef(entry);
26
+ const schema = isObject(resolved) && "schemaFormat" in resolved ? getResolvedRef(resolved.schema) : resolved;
27
+ return isSchemaObject(schema) ? schema : void 0;
28
+ };
29
+ //#endregion
30
+ export { getAsyncApiModelSchema };
31
+
32
+ //# sourceMappingURL=get-async-api-model-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-async-api-model-schema.js","names":[],"sources":["../../src/helpers/get-async-api-model-schema.ts"],"sourcesContent":["import { isObject } from '@scalar/helpers/object/is-object'\nimport type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1'\nimport { getResolvedRef, mergeSiblingReferences } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\n/**\n * A resolved `components.schemas` entry may be a JSON Schema object, a boolean (`true`/`false`)\n * schema, or a Multi Format Schema wrapper, so accept only plain objects and treat them as the\n * `SchemaObject` the shared Model rendering and search helpers expect.\n */\nconst isSchemaObject = (value: unknown): value is SchemaObject => isObject(value)\n\n/**\n * Resolves a named schema from an AsyncAPI document's `components.schemas` into the `SchemaObject`\n * shape the shared OpenAPI Model components and search indexing expect.\n *\n * AsyncAPI keeps reusable schemas in the same place OpenAPI does, but an entry may need extra handling:\n * - `components` or the schema itself may be a `$ref`; siblings are merged so keys declared alongside\n * a `$ref` are kept rather than dropped.\n * - A Multi Format Schema Object (`schemaFormat` plus a nested `schema`) is unwrapped to its payload,\n * so we index and render the inner JSON Schema rather than the wrapper.\n * - Boolean (`true`/`false`) and non-JSON-Schema payloads are skipped.\n */\nexport const getAsyncApiModelSchema = (document: AsyncApiDocument, name: string): SchemaObject | undefined => {\n if (!document.components) {\n return undefined\n }\n\n // Merge siblings at the components level so schemas declared alongside a `$ref` are kept.\n const components = getResolvedRef(document.components, mergeSiblingReferences)\n const entry = components.schemas?.[name]\n if (entry === undefined) {\n return undefined\n }\n\n // Resolve the schema itself the same way OpenAPI model rendering does (plain `$ref-value`).\n const resolved = getResolvedRef(entry)\n\n // Multi Format Schema Objects carry the real schema under `schema`; unwrap to that payload.\n const schema = isObject(resolved) && 'schemaFormat' in resolved ? getResolvedRef(resolved.schema) : resolved\n\n return isSchemaObject(schema) ? schema : undefined\n}\n"],"mappings":";;;;;;;;AAUA,IAAM,kBAAkB,UAA0C,SAAS,MAAM;;;;;;;;;;;;AAajF,IAAa,0BAA0B,UAA4B,SAA2C;AAC5G,KAAI,CAAC,SAAS,WACZ;CAKF,MAAM,QADa,eAAe,SAAS,YAAY,uBAAuB,CACrD,UAAU;AACnC,KAAI,UAAU,KAAA,EACZ;CAIF,MAAM,WAAW,eAAe,MAAM;CAGtC,MAAM,SAAS,SAAS,SAAS,IAAI,kBAAkB,WAAW,eAAe,SAAS,OAAO,GAAG;AAEpG,QAAO,eAAe,OAAO,GAAG,SAAS,KAAA"}
@@ -24,6 +24,24 @@ export declare const getIdFromUrl: (url: string | URL, basePath: string | undefi
24
24
  * @param isMultiDocument - Whether the document is multi-document or single-document. Single-document documents will strip the document slug from the id
25
25
  */
26
26
  export declare const makeUrlFromId: (_id: string, basePath: string | undefined, isMultiDocument: boolean) => URL | undefined;
27
+ /**
28
+ * Rewrite legacy `/model/<name>` URL segments to the current section's slug.
29
+ *
30
+ * Earlier versions hardcoded `model/` (singular) as the prefix for individual schema entries
31
+ * even though the section itself was `models/`. We now use the same plural slug for both,
32
+ * so old bookmarks like `#default/model/User` would 404. This rewrites them in place.
33
+ *
34
+ * The regex is anchored to the legacy structural shape so unrelated `/model/` occurrences
35
+ * inside operation paths (e.g. `POST /model/train` for an AI/ML API → `default/POST/model/train`)
36
+ * and a tag literally named "model" are left alone.
37
+ *
38
+ * Trade-off: in single-document mode the URL strips the document slug, which makes
39
+ * `#tag/<slug>/model/<name>` ambiguous with an operation under a tag named "model".
40
+ * Single-doc tagged-model bookmarks are not rewritten — only top-level models.
41
+ *
42
+ * Returns the canonicalized URL when a rewrite happens, or null otherwise.
43
+ */
44
+ export declare const redirectLegacyModelUrl: (url: string | URL, modelsSectionSlug: string, documentSlug: string, isMultiDocument: boolean, basePath?: string) => URL | null;
27
45
  /** Extracts the schema parameters from the id if they are present */
28
46
  export declare const getSchemaParamsFromId: (id: string) => {
29
47
  rawId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"id-routing.d.ts","sourceRoot":"","sources":["../../src/helpers/id-routing.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,GAAI,UAAU,MAAM,WAEhD,CAAA;AAwBD,mEAAmE;AACnE,eAAO,MAAM,aAAa,GAAI,UAAU,MAAM,GAAG,GAAG,EAAE,YAAY,MAAM,GAAG,SAAS,WAMnF,CAAA;AACD,mEAAmE;AACnE,eAAO,MAAM,aAAa,GAAI,UAAU,MAAM,GAAG,GAAG,EAAE,UAAU,MAAM,EAAE,YAAY,MAAM,GAAG,SAAS,WAqBrG,CAAA;AAED,2DAA2D;AAC3D,eAAO,MAAM,qBAAqB,GAAI,UAAU,MAAM,GAAG,GAAG,EAAE,UAAU,MAAM,EAAE,YAAY,MAAM,GAAG,SAAS,WAW7G,CAAA;AAED,8DAA8D;AAC9D,eAAO,MAAM,eAAe,GAAI,UAAU,MAAM,GAAG,GAAG,EAAE,UAAU,MAAM,YAiBvE,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,GAAG,GAAG,EAAE,UAAU,MAAM,GAAG,SAAS,EAAE,YAAY,MAAM,GAAG,SAAS,WAQ3G,CAAA;AAmBD;;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,mBAAmB,MAAM,EACzB,cAAc,MAAM,EACpB,iBAAiB,OAAO,EACxB,WAAW,MAAM,KAChB,GAAG,GAAG,IAwCR,CAAA;AAED,qEAAqE;AACrE,eAAO,MAAM,qBAAqB,GAAI,IAAI,MAAM,KAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAajF,CAAA"}
@@ -89,6 +89,46 @@ var makeUrlFromId = (_id, basePath, isMultiDocument) => {
89
89
  else url.hash = id;
90
90
  return url;
91
91
  };
92
+ var escapeRegex = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
93
+ /**
94
+ * Rewrite legacy `/model/<name>` URL segments to the current section's slug.
95
+ *
96
+ * Earlier versions hardcoded `model/` (singular) as the prefix for individual schema entries
97
+ * even though the section itself was `models/`. We now use the same plural slug for both,
98
+ * so old bookmarks like `#default/model/User` would 404. This rewrites them in place.
99
+ *
100
+ * The regex is anchored to the legacy structural shape so unrelated `/model/` occurrences
101
+ * inside operation paths (e.g. `POST /model/train` for an AI/ML API → `default/POST/model/train`)
102
+ * and a tag literally named "model" are left alone.
103
+ *
104
+ * Trade-off: in single-document mode the URL strips the document slug, which makes
105
+ * `#tag/<slug>/model/<name>` ambiguous with an operation under a tag named "model".
106
+ * Single-doc tagged-model bookmarks are not rewritten — only top-level models.
107
+ *
108
+ * Returns the canonicalized URL when a rewrite happens, or null otherwise.
109
+ */
110
+ var redirectLegacyModelUrl = (url, modelsSectionSlug, documentSlug, isMultiDocument, basePath) => {
111
+ if (!documentSlug) return null;
112
+ const next = typeof url === "string" ? new URL(url) : new URL(url.toString());
113
+ const escapedDoc = escapeRegex(documentSlug);
114
+ const tagPrefix = "(?:(?:tag-group\\/[^/]+\\/)?tag\\/[^/]+\\/)?";
115
+ const slugAnchoredHash = new RegExp(`^(#${escapedDoc}\\/${tagPrefix})model\\/`);
116
+ const replacement = `$1${modelsSectionSlug}/`;
117
+ let newHash = next.hash.replace(slugAnchoredHash, replacement);
118
+ if (newHash === next.hash && !isMultiDocument) newHash = next.hash.replace(/^(#)model\//, replacement);
119
+ let newPathname = next.pathname;
120
+ if (basePath !== void 0 && !basePath.startsWith("#")) {
121
+ const escapedBase = escapeRegex(sanitizeBasePath(basePath));
122
+ const basePrefix = escapedBase ? `\\/${escapedBase}` : "";
123
+ const slugAnchoredPath = new RegExp(`^(${basePrefix}\\/${escapedDoc}\\/${tagPrefix})model\\/`);
124
+ newPathname = next.pathname.replace(slugAnchoredPath, replacement);
125
+ if (newPathname === next.pathname && !isMultiDocument) newPathname = next.pathname.replace(new RegExp(`^(${basePrefix}\\/)model\\/`), replacement);
126
+ }
127
+ if (newHash === next.hash && newPathname === next.pathname) return null;
128
+ next.hash = newHash;
129
+ next.pathname = newPathname;
130
+ return next;
131
+ };
92
132
  /** Extracts the schema parameters from the id if they are present */
93
133
  var getSchemaParamsFromId = (id) => {
94
134
  const matcher = id.match(/(.*)(\.body\.|\.path\.|\.query\.|\.header\.)(.*)/);
@@ -102,6 +142,6 @@ var getSchemaParamsFromId = (id) => {
102
142
  };
103
143
  };
104
144
  //#endregion
105
- export { getIdFromUrl, getSchemaParamsFromId, makeUrlFromId, matchesBasePath };
145
+ export { getIdFromUrl, getSchemaParamsFromId, makeUrlFromId, matchesBasePath, redirectLegacyModelUrl };
106
146
 
107
147
  //# sourceMappingURL=id-routing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"id-routing.js","names":[],"sources":["../../src/helpers/id-routing.ts"],"sourcesContent":["export const sanitizeBasePath = (basePath: string) => {\n return basePath.replace(/^\\/+|\\/+$/g, '')\n}\n\nconst isHashBasePath = (basePath: string) => basePath.startsWith('#')\n\nconst sanitizeHashBasePath = (basePath: string) => {\n return basePath.replace(/^#+/, '').replace(/\\/+$/g, '')\n}\n\nconst applySlugPrefix = (base: string, slugPrefix: string | undefined) => {\n return slugPrefix ? `${slugPrefix}${base ? '/' : ''}${base}` : base\n}\n\nconst stripBasePathPrefix = (value: string, basePath: string) => {\n if (value === basePath) {\n return ''\n }\n\n if (value.startsWith(`${basePath}/`)) {\n return value.slice(basePath.length + 1)\n }\n\n return null\n}\n\n/** Extracts an element id from the hash when using hash routing */\nexport const getIdFromHash = (location: string | URL, slugPrefix: string | undefined) => {\n const url = typeof location === 'string' ? new URL(location) : location\n\n const base = decodeURIComponent(url.hash.slice(1))\n\n return applySlugPrefix(base, slugPrefix)\n}\n/** Extracts an element id from the path when using path routing */\nexport const getIdFromPath = (location: string | URL, basePath: string, slugPrefix: string | undefined) => {\n const url = typeof location === 'string' ? new URL(location) : location\n const sanitized = sanitizeBasePath(basePath)\n\n // Construct the full basePath with leading slash and encode it for matching\n // We need to encode each segment separately to match how URLs encode pathnames\n const basePathWithSlash = sanitized\n ? `/${sanitized\n .split('/')\n .map((segment) => encodeURIComponent(segment))\n .join('/')}`\n : ''\n\n // Extract the portion after the basePath\n if (url.pathname.startsWith(basePathWithSlash)) {\n const remainder = url.pathname.slice(basePathWithSlash.length)\n const base = decodeURIComponent(remainder.startsWith('/') ? remainder.slice(1) : remainder)\n return applySlugPrefix(base, slugPrefix)\n }\n\n return slugPrefix ?? ''\n}\n\n/** Extracts an element id from a hash-prefixed basePath */\nexport const getIdFromHashBasePath = (location: string | URL, basePath: string, slugPrefix: string | undefined) => {\n const url = typeof location === 'string' ? new URL(location) : location\n const hash = decodeURIComponent(url.hash.slice(1))\n const sanitized = sanitizeHashBasePath(basePath)\n\n const remainder = stripBasePathPrefix(hash, sanitized)\n if (remainder !== null) {\n return applySlugPrefix(remainder, slugPrefix)\n }\n\n return slugPrefix ?? ''\n}\n\n/** Determines whether a URL matches the provided basePath. */\nexport const matchesBasePath = (location: string | URL, basePath: string) => {\n const url = typeof location === 'string' ? new URL(location) : location\n\n if (isHashBasePath(basePath)) {\n const hash = decodeURIComponent(url.hash)\n return hash === basePath || hash.startsWith(`${basePath}/`)\n }\n\n const sanitized = sanitizeBasePath(basePath)\n const basePathWithSlash = sanitized\n ? `/${sanitized\n .split('/')\n .map((segment) => encodeURIComponent(segment))\n .join('/')}`\n : ''\n\n return url.pathname === basePathWithSlash || url.pathname.startsWith(`${basePathWithSlash}/`)\n}\n\n/**\n * Extracts a navigation id from a URL based on the routing type\n *\n * @param url - The URL to extract the id from\n * @param basePath - The base path used in path routing\n * @param slugPrefix - If the document slug is not expected in the URL then we must prefix it\n */\nexport const getIdFromUrl = (url: string | URL, basePath: string | undefined, slugPrefix: string | undefined) => {\n if (typeof basePath !== 'string') {\n return getIdFromHash(url, slugPrefix)\n }\n\n return isHashBasePath(basePath)\n ? getIdFromHashBasePath(url, basePath, slugPrefix)\n : getIdFromPath(url, basePath, slugPrefix)\n}\n\n/**\n * Strips the first segment from an id and preserves trailing slashes\n * Used in single-document mode where the document slug is not needed in the URL\n *\n * @param id - The full id to process\n * @returns The id with the first segment removed, preserving trailing slash if present\n */\nconst stripFirstSegment = (id: string): string => {\n // For preserving trailing slash in the id\n const hasTrailingSlash = id.endsWith('/')\n const segments = id.split('/').filter(Boolean).slice(1)\n const result = segments.join('/')\n\n // Only preserve trailing slash if there's actual content\n return hasTrailingSlash && result ? `${result}/` : result\n}\n\n/**\n * Generate a new URL and applies the ID to the path or hash\n * depending on the type of routing used\n *\n * @param id - The id to apply to the URL\n * @param basePath - The base path used in path routing\n * @param isMultiDocument - Whether the document is multi-document or single-document. Single-document documents will strip the document slug from the id\n */\nexport const makeUrlFromId = (_id: string, basePath: string | undefined, isMultiDocument: boolean) => {\n if (typeof window === 'undefined') {\n return undefined\n }\n\n /** When there is only 1 document we don't need to include the document name in the URL */\n const id = isMultiDocument ? _id : stripFirstSegment(_id)\n const url = new URL(window.location.href)\n\n if (typeof basePath === 'string') {\n if (isHashBasePath(basePath)) {\n const base = sanitizeHashBasePath(basePath)\n url.hash = [base, id].filter(Boolean).join('/')\n } else {\n const base = sanitizeBasePath(basePath)\n url.pathname = `${base}/${id}`\n }\n } else {\n url.hash = id\n }\n\n return url\n}\n\n/** Extracts the schema parameters from the id if they are present */\nexport const getSchemaParamsFromId = (id: string): { rawId: string; params: string } => {\n const matcher = id.match(/(.*)(\\.body\\.|\\.path\\.|\\.query\\.|\\.header\\.)(.*)/)\n\n if (matcher && typeof matcher[1] === 'string' && typeof matcher[2] === 'string') {\n return {\n rawId: matcher[1],\n params: matcher[2].slice(1) + matcher[3],\n }\n }\n return {\n rawId: id,\n params: '',\n }\n}\n"],"mappings":";AAAA,IAAa,oBAAoB,aAAqB;AACpD,QAAO,SAAS,QAAQ,cAAc,GAAG;;AAG3C,IAAM,kBAAkB,aAAqB,SAAS,WAAW,IAAI;AAErE,IAAM,wBAAwB,aAAqB;AACjD,QAAO,SAAS,QAAQ,OAAO,GAAG,CAAC,QAAQ,SAAS,GAAG;;AAGzD,IAAM,mBAAmB,MAAc,eAAmC;AACxE,QAAO,aAAa,GAAG,aAAa,OAAO,MAAM,KAAK,SAAS;;AAGjE,IAAM,uBAAuB,OAAe,aAAqB;AAC/D,KAAI,UAAU,SACZ,QAAO;AAGT,KAAI,MAAM,WAAW,GAAG,SAAS,GAAG,CAClC,QAAO,MAAM,MAAM,SAAS,SAAS,EAAE;AAGzC,QAAO;;;AAIT,IAAa,iBAAiB,UAAwB,eAAmC;CACvF,MAAM,MAAM,OAAO,aAAa,WAAW,IAAI,IAAI,SAAS,GAAG;AAI/D,QAAO,gBAFM,mBAAmB,IAAI,KAAK,MAAM,EAAE,CAAC,EAErB,WAAW;;;AAG1C,IAAa,iBAAiB,UAAwB,UAAkB,eAAmC;CACzG,MAAM,MAAM,OAAO,aAAa,WAAW,IAAI,IAAI,SAAS,GAAG;CAC/D,MAAM,YAAY,iBAAiB,SAAS;CAI5C,MAAM,oBAAoB,YACtB,IAAI,UACD,MAAM,IAAI,CACV,KAAK,YAAY,mBAAmB,QAAQ,CAAC,CAC7C,KAAK,IAAI,KACZ;AAGJ,KAAI,IAAI,SAAS,WAAW,kBAAkB,EAAE;EAC9C,MAAM,YAAY,IAAI,SAAS,MAAM,kBAAkB,OAAO;AAE9D,S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K;;;;;;;;;;AAWrD,IAAa,iBAAiB,KAAa,UAA8B,oBAA6B;AACpG,KAAI,OAAO,WAAW,YACpB;;CAIF,MAAM,KAAK,kBAAkB,MAAM,kBAAkB,IAAI;CACzD,MAAM,MAAM,IAAI,IAAI,OAAO,SAAS,KAAK;AAEzC,KAAI,OAAO,aAAa,SACtB,KAAI,eAAe,SAAS,CAE1B,KAAI,OAAO,CADE,qBAAqB,SAAS,EACzB,GAAG,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;KAG/C,KAAI,WAAW,GADF,iBAAiB,SAAS,CAChB,GAAG;KAG5B,KAAI,OAAO;AAGb,QAAO;;;AAIT,IAAa,yBAAyB,OAAkD;CACtF,MAAM,UAAU,GAAG,MAAM,mDAAmD;AAE5E,KAAI,WAAW,OAAO,QAAQ,OAAO,YAAY,OAAO,QAAQ,OAAO,SACrE,QAAO;EACL,OAAO,QAAQ;EACf,QAAQ,QAAQ,GAAG,MAAM,EAAE,GAAG,QAAQ;EACvC;AAEH,QAAO;EACL,OAAO;EACP,QAAQ;EACT"}
1
+ {"version":3,"file":"id-routing.js","names":[],"sources":["../../src/helpers/id-routing.ts"],"sourcesContent":["export const sanitizeBasePath = (basePath: string) => {\n return basePath.replace(/^\\/+|\\/+$/g, '')\n}\n\nconst isHashBasePath = (basePath: string) => basePath.startsWith('#')\n\nconst sanitizeHashBasePath = (basePath: string) => {\n return basePath.replace(/^#+/, '').replace(/\\/+$/g, '')\n}\n\nconst applySlugPrefix = (base: string, slugPrefix: string | undefined) => {\n return slugPrefix ? `${slugPrefix}${base ? '/' : ''}${base}` : base\n}\n\nconst stripBasePathPrefix = (value: string, basePath: string) => {\n if (value === basePath) {\n return ''\n }\n\n if (value.startsWith(`${basePath}/`)) {\n return value.slice(basePath.length + 1)\n }\n\n return null\n}\n\n/** Extracts an element id from the hash when using hash routing */\nexport const getIdFromHash = (location: string | URL, slugPrefix: string | undefined) => {\n const url = typeof location === 'string' ? new URL(location) : location\n\n const base = decodeURIComponent(url.hash.slice(1))\n\n return applySlugPrefix(base, slugPrefix)\n}\n/** Extracts an element id from the path when using path routing */\nexport const getIdFromPath = (location: string | URL, basePath: string, slugPrefix: string | undefined) => {\n const url = typeof location === 'string' ? new URL(location) : location\n const sanitized = sanitizeBasePath(basePath)\n\n // Construct the full basePath with leading slash and encode it for matching\n // We need to encode each segment separately to match how URLs encode pathnames\n const basePathWithSlash = sanitized\n ? `/${sanitized\n .split('/')\n .map((segment) => encodeURIComponent(segment))\n .join('/')}`\n : ''\n\n // Extract the portion after the basePath\n if (url.pathname.startsWith(basePathWithSlash)) {\n const remainder = url.pathname.slice(basePathWithSlash.length)\n const base = decodeURIComponent(remainder.startsWith('/') ? remainder.slice(1) : remainder)\n return applySlugPrefix(base, slugPrefix)\n }\n\n return slugPrefix ?? ''\n}\n\n/** Extracts an element id from a hash-prefixed basePath */\nexport const getIdFromHashBasePath = (location: string | URL, basePath: string, slugPrefix: string | undefined) => {\n const url = typeof location === 'string' ? new URL(location) : location\n const hash = decodeURIComponent(url.hash.slice(1))\n const sanitized = sanitizeHashBasePath(basePath)\n\n const remainder = stripBasePathPrefix(hash, sanitized)\n if (remainder !== null) {\n return applySlugPrefix(remainder, slugPrefix)\n }\n\n return slugPrefix ?? ''\n}\n\n/** Determines whether a URL matches the provided basePath. */\nexport const matchesBasePath = (location: string | URL, basePath: string) => {\n const url = typeof location === 'string' ? new URL(location) : location\n\n if (isHashBasePath(basePath)) {\n const hash = decodeURIComponent(url.hash)\n return hash === basePath || hash.startsWith(`${basePath}/`)\n }\n\n const sanitized = sanitizeBasePath(basePath)\n const basePathWithSlash = sanitized\n ? `/${sanitized\n .split('/')\n .map((segment) => encodeURIComponent(segment))\n .join('/')}`\n : ''\n\n return url.pathname === basePathWithSlash || url.pathname.startsWith(`${basePathWithSlash}/`)\n}\n\n/**\n * Extracts a navigation id from a URL based on the routing type\n *\n * @param url - The URL to extract the id from\n * @param basePath - The base path used in path routing\n * @param slugPrefix - If the document slug is not expected in the URL then we must prefix it\n */\nexport const getIdFromUrl = (url: string | URL, basePath: string | undefined, slugPrefix: string | undefined) => {\n if (typeof basePath !== 'string') {\n return getIdFromHash(url, slugPrefix)\n }\n\n return isHashBasePath(basePath)\n ? getIdFromHashBasePath(url, basePath, slugPrefix)\n : getIdFromPath(url, basePath, slugPrefix)\n}\n\n/**\n * Strips the first segment from an id and preserves trailing slashes\n * Used in single-document mode where the document slug is not needed in the URL\n *\n * @param id - The full id to process\n * @returns The id with the first segment removed, preserving trailing slash if present\n */\nconst stripFirstSegment = (id: string): string => {\n // For preserving trailing slash in the id\n const hasTrailingSlash = id.endsWith('/')\n const segments = id.split('/').filter(Boolean).slice(1)\n const result = segments.join('/')\n\n // Only preserve trailing slash if there's actual content\n return hasTrailingSlash && result ? `${result}/` : result\n}\n\n/**\n * Generate a new URL and applies the ID to the path or hash\n * depending on the type of routing used\n *\n * @param id - The id to apply to the URL\n * @param basePath - The base path used in path routing\n * @param isMultiDocument - Whether the document is multi-document or single-document. Single-document documents will strip the document slug from the id\n */\nexport const makeUrlFromId = (_id: string, basePath: string | undefined, isMultiDocument: boolean) => {\n if (typeof window === 'undefined') {\n return undefined\n }\n\n /** When there is only 1 document we don't need to include the document name in the URL */\n const id = isMultiDocument ? _id : stripFirstSegment(_id)\n const url = new URL(window.location.href)\n\n if (typeof basePath === 'string') {\n if (isHashBasePath(basePath)) {\n const base = sanitizeHashBasePath(basePath)\n url.hash = [base, id].filter(Boolean).join('/')\n } else {\n const base = sanitizeBasePath(basePath)\n url.pathname = `${base}/${id}`\n }\n } else {\n url.hash = id\n }\n\n return url\n}\n\nconst escapeRegex = (value: string) => value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n\n/**\n * Rewrite legacy `/model/<name>` URL segments to the current section's slug.\n *\n * Earlier versions hardcoded `model/` (singular) as the prefix for individual schema entries\n * even though the section itself was `models/`. We now use the same plural slug for both,\n * so old bookmarks like `#default/model/User` would 404. This rewrites them in place.\n *\n * The regex is anchored to the legacy structural shape so unrelated `/model/` occurrences\n * inside operation paths (e.g. `POST /model/train` for an AI/ML API → `default/POST/model/train`)\n * and a tag literally named \"model\" are left alone.\n *\n * Trade-off: in single-document mode the URL strips the document slug, which makes\n * `#tag/<slug>/model/<name>` ambiguous with an operation under a tag named \"model\".\n * Single-doc tagged-model bookmarks are not rewritten — only top-level models.\n *\n * Returns the canonicalized URL when a rewrite happens, or null otherwise.\n */\nexport const redirectLegacyModelUrl = (\n url: string | URL,\n modelsSectionSlug: string,\n documentSlug: string,\n isMultiDocument: boolean,\n basePath?: string,\n): URL | null => {\n if (!documentSlug) {\n return null\n }\n\n const next = typeof url === 'string' ? new URL(url) : new URL(url.toString())\n const escapedDoc = escapeRegex(documentSlug)\n // Optional `(tag-group/<n>/)?tag/<slug>/` block in front of `model/`.\n const tagPrefix = '(?:(?:tag-group\\\\/[^/]+\\\\/)?tag\\\\/[^/]+\\\\/)?'\n const slugAnchoredHash = new RegExp(`^(#${escapedDoc}\\\\/${tagPrefix})model\\\\/`)\n const replacement = `$1${modelsSectionSlug}/`\n\n // Always try the slug-anchored form first — old bookmarks may include the doc slug\n // even in single-document mode.\n let newHash = next.hash.replace(slugAnchoredHash, replacement)\n if (newHash === next.hash && !isMultiDocument) {\n // Single-doc fallback: URL omits the doc slug (`#model/<name>`). We can only\n // safely rewrite top-level models here — `#tag/<slug>/model/<name>` is\n // ambiguous with an operation under a tag literally named \"model\".\n newHash = next.hash.replace(/^(#)model\\//, replacement)\n }\n\n let newPathname = next.pathname\n if (basePath !== undefined && !basePath.startsWith('#')) {\n const escapedBase = escapeRegex(sanitizeBasePath(basePath))\n const basePrefix = escapedBase ? `\\\\/${escapedBase}` : ''\n const slugAnchoredPath = new RegExp(`^(${basePrefix}\\\\/${escapedDoc}\\\\/${tagPrefix})model\\\\/`)\n newPathname = next.pathname.replace(slugAnchoredPath, replacement)\n if (newPathname === next.pathname && !isMultiDocument) {\n newPathname = next.pathname.replace(new RegExp(`^(${basePrefix}\\\\/)model\\\\/`), replacement)\n }\n }\n\n if (newHash === next.hash && newPathname === next.pathname) {\n return null\n }\n\n next.hash = newHash\n next.pathname = newPathname\n return next\n}\n\n/** Extracts the schema parameters from the id if they are present */\nexport const getSchemaParamsFromId = (id: string): { rawId: string; params: string } => {\n const matcher = id.match(/(.*)(\\.body\\.|\\.path\\.|\\.query\\.|\\.header\\.)(.*)/)\n\n if (matcher && typeof matcher[1] === 'string' && typeof matcher[2] === 'string') {\n return {\n rawId: matcher[1],\n params: matcher[2].slice(1) + matcher[3],\n }\n }\n return {\n rawId: id,\n params: '',\n }\n}\n"],"mappings":";AAAA,IAAa,oBAAoB,aAAqB;AACpD,QAAO,SAAS,QAAQ,cAAc,GAAG;;AAG3C,IAAM,kBAAkB,aAAqB,SAAS,WAAW,IAAI;AAErE,IAAM,wBAAwB,aAAqB;AACjD,QAAO,SAAS,QAAQ,OAAO,GAAG,CAAC,QAAQ,SAAS,GAAG;;AAGzD,IAAM,mBAAmB,MAAc,eAAmC;AACxE,QAAO,aAAa,GAAG,aAAa,OAAO,MAAM,KAAK,SAAS;;AAGjE,IAAM,uBAAuB,OAAe,aAAqB;AAC/D,KAAI,UAAU,SACZ,QAAO;AAGT,KAAI,MAAM,WAAW,GAAG,SAAS,GAAG,CAClC,QAAO,MAAM,MAAM,SAAS,SAAS,EAAE;AAGzC,QAAO;;;AAIT,IAAa,iBAAiB,UAAwB,eAAmC;CACvF,MAAM,MAAM,OAAO,aAAa,WAAW,IAAI,IAAI,SAAS,GAAG;AAI/D,QAAO,gBAFM,mBAAmB,IAAI,KAAK,MAAM,EAAE,CAAC,EAErB,WAAW;;;AAG1C,IAAa,iBAAiB,UAAwB,UAAkB,eAAmC;CACzG,MAAM,MAAM,OAAO,aAAa,WAAW,IAAI,IAAI,SAAS,GAAG;CAC/D,MAAM,YAAY,iBAAiB,SAAS;CAI5C,MAAM,oBAAoB,YACtB,IAAI,UACD,MAAM,IAAI,CACV,KAAK,YAAY,mBAAmB,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gBAAgB;EACvD,MAAM,mBAAmB,IAAI,OAAO,KAAK,WAAW,KAAK,WAAW,KAAK,UAAU,WAAW;AAC9F,gBAAc,KAAK,SAAS,QAAQ,kBAAkB,YAAY;AAClE,MAAI,gBAAgB,KAAK,YAAY,CAAC,gBACpC,eAAc,KAAK,SAAS,QAAQ,IAAI,OAAO,KAAK,WAAW,cAAc,EAAE,YAAY;;AAI/F,KAAI,YAAY,KAAK,QAAQ,gBAAgB,KAAK,SAChD,QAAO;AAGT,MAAK,OAAO;AACZ,MAAK,WAAW;AAChB,QAAO;;;AAIT,IAAa,yBAAyB,OAAkD;CACtF,MAAM,UAAU,GAAG,MAAM,mDAAmD;AAE5E,KAAI,WAAW,OAAO,QAAQ,OAAO,YAAY,OAAO,QAAQ,OAAO,SACrE,QAAO;EACL,OAAO,QAAQ;EACf,QAAQ,QAAQ,GAAG,MAAM,EAAE,GAAG,QAAQ;EACvC;AAEH,QAAO;EACL,OAAO;EACP,QAAQ;EACT"}
@@ -1,4 +1,4 @@
1
1
  export { PLUGIN_MANAGER_SYMBOL, usePluginManager } from '../plugins/hooks/usePluginManager.js';
2
2
  export { type ApiReferencePlugin, type PluginManager, createPluginManager, } from '../plugins/plugin-manager.js';
3
- export { persistencePlugin } from './persistance-plugin.js';
3
+ export { persistencePlugin } from './persistence-plugin.js';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
1
  import { createPluginManager } from "./plugin-manager.js";
2
2
  import { PLUGIN_MANAGER_SYMBOL, usePluginManager } from "./hooks/usePluginManager.js";
3
- import { persistencePlugin } from "./persistance-plugin.js";
3
+ import { persistencePlugin } from "./persistence-plugin.js";
4
4
  export { PLUGIN_MANAGER_SYMBOL, createPluginManager, persistencePlugin, usePluginManager };
@@ -2,16 +2,10 @@ import type { WorkspacePlugin } from '@scalar/workspace-store/workspace-plugin';
2
2
  /**
3
3
  * Plugin to persist workspace state changes with debounced writes.
4
4
  */
5
- export declare const persistencePlugin: ({ debounceDelay, maxWait, prefix, persistAuth, }: {
5
+ export declare const persistencePlugin: ({ debounceDelay, maxWait, persistAuth, }: {
6
6
  debounceDelay?: number;
7
7
  /** Maximum time in milliseconds to wait before forcing execution, even with continuous calls. */
8
8
  maxWait?: number;
9
- /**
10
- * Prefix to use for local storage keys.
11
- * This can be a string or a function returning a string.
12
- * For example, to persist data per document, use the document name as the prefix.
13
- */
14
- prefix?: string | (() => string);
15
9
  /**
16
10
  * Determines whether authentication details should be persisted.
17
11
  * Accepts a boolean or a function that returns a boolean.
@@ -19,4 +13,4 @@ export declare const persistencePlugin: ({ debounceDelay, maxWait, prefix, persi
19
13
  */
20
14
  persistAuth?: boolean | (() => boolean);
21
15
  }) => WorkspacePlugin;
22
- //# sourceMappingURL=persistance-plugin.d.ts.map
16
+ //# sourceMappingURL=persistence-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"persistence-plugin.d.ts","sourceRoot":"","sources":["../../src/plugins/persistence-plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAA;AAI/E;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,0CAI/B;IACD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,iGAAiG;IACjG,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,CAAC,MAAM,OAAO,CAAC,CAAA;CACxC,KAAG,eA4CH,CAAA"}
@@ -1,25 +1,16 @@
1
1
  import { authStorage, clientStorage } from "../helpers/storage.js";
2
2
  import { debounce } from "@scalar/helpers/general/debounce";
3
- //#region src/plugins/persistance-plugin.ts
3
+ //#region src/plugins/persistence-plugin.ts
4
4
  /**
5
5
  * Plugin to persist workspace state changes with debounced writes.
6
6
  */
7
- var persistencePlugin = ({ debounceDelay = 500, maxWait = 1e4, prefix = "", persistAuth = false }) => {
7
+ var persistencePlugin = ({ debounceDelay = 500, maxWait = 1e4, persistAuth = false }) => {
8
8
  const { execute } = debounce({
9
9
  delay: debounceDelay,
10
10
  maxWait
11
11
  });
12
12
  const authPersistence = authStorage();
13
13
  const clientPersistence = clientStorage();
14
- /**
15
- * Resolves the prefix to use for local storage keys.
16
- * If 'prefix' is a string, returns it directly.
17
- * If 'prefix' is a function, calls and returns its value.
18
- */
19
- const getPrefix = () => {
20
- if (typeof prefix === "string") return prefix;
21
- return prefix();
22
- };
23
14
  const getPersistAuth = () => {
24
15
  if (typeof persistAuth === "function") return persistAuth();
25
16
  return persistAuth;
@@ -30,10 +21,10 @@ var persistencePlugin = ({ debounceDelay = 500, maxWait = 1e4, prefix = "", pers
30
21
  if (defaultClient !== void 0) execute("x-scalar-default-client", () => clientPersistence.set(defaultClient));
31
22
  return;
32
23
  }
33
- if (getPersistAuth() && event.type === "auth") execute("auth", () => authPersistence.setAuth(getPrefix(), event.value));
24
+ if (getPersistAuth() && event.type === "auth") execute(`auth-${event.documentName}`, () => authPersistence.setAuth(event.documentName, event.value));
34
25
  } } };
35
26
  };
36
27
  //#endregion
37
28
  export { persistencePlugin };
38
29
 
39
- //# sourceMappingURL=persistance-plugin.js.map
30
+ //# sourceMappingURL=persistence-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"persistence-plugin.js","names":[],"sources":["../../src/plugins/persistence-plugin.ts"],"sourcesContent":["import { debounce } from '@scalar/helpers/general/debounce'\nimport type { WorkspacePlugin } from '@scalar/workspace-store/workspace-plugin'\n\nimport { authStorage, clientStorage } from '@/helpers/storage'\n\n/**\n * Plugin to persist workspace state changes with debounced writes.\n */\nexport const persistencePlugin = ({\n debounceDelay = 500,\n maxWait = 10000,\n persistAuth = false,\n}: {\n debounceDelay?: number\n /** Maximum time in milliseconds to wait before forcing execution, even with continuous calls. */\n maxWait?: number\n /**\n * Determines whether authentication details should be persisted.\n * Accepts a boolean or a function that returns a boolean.\n * Allows for conditional persistence logic, e.g., based on environment or user settings.\n */\n persistAuth?: boolean | (() => boolean)\n}): WorkspacePlugin => {\n // Debounced execute function for batching similar state changes\n const { execute } = debounce({ delay: debounceDelay, maxWait })\n const authPersistence = authStorage()\n const clientPersistence = clientStorage()\n\n const getPersistAuth = () => {\n if (typeof persistAuth === 'function') {\n return persistAuth()\n }\n\n return persistAuth\n }\n\n return {\n hooks: {\n /**\n * Handles all workspace state change events.\n * Each write is debounced by a key to prevent frequent writes for the same entity.\n */\n onWorkspaceStateChanges(event) {\n // If the event is for workspace meta data, debounce by workspaceId\n if (event.type === 'meta') {\n // Persist the meta fields\n const defaultClient = event.value['x-scalar-default-client']\n if (defaultClient !== undefined) {\n execute('x-scalar-default-client', () => clientPersistence.set(defaultClient))\n }\n return\n }\n\n // Persist auth and [server](TODO)\n // Use event.documentName as both the debounce key and the storage key so that\n // concurrent auth changes across multiple documents do not clobber each other and\n // the correct slug is used even when the active document has already changed.\n if (getPersistAuth() && event.type === 'auth') {\n execute(`auth-${event.documentName}`, () => authPersistence.setAuth(event.documentName, event.value))\n }\n\n // No action for other event types\n return\n },\n },\n }\n}\n"],"mappings":";;;;;;AAQA,IAAa,qBAAqB,EAChC,gBAAgB,KAChB,UAAU,KACV,cAAc,YAWO;CAErB,MAAM,EAAE,YAAY,SAAS;EAAE,OAAO;EAAe;EAAS,CAAC;CAC/D,MAAM,kBAAkB,aAAa;CACrC,MAAM,oBAAoB,eAAe;CAEzC,MAAM,uBAAuB;AAC3B,MAAI,OAAO,gBAAgB,WACzB,QAAO,aAAa;AAGtB,SAAO;;AAGT,QAAO,EACL,OAAO,EAKL,wBAAwB,OAAO;AAE7B,MAAI,MAAM,SAAS,QAAQ;GAEzB,MAAM,gBAAgB,MAAM,MAAM;AAClC,OAAI,kBAAkB,KAAA,EACpB,SAAQ,iCAAiC,kBAAkB,IAAI,cAAc,CAAC;AAEhF;;AAOF,MAAI,gBAAgB,IAAI,MAAM,SAAS,OACrC,SAAQ,QAAQ,MAAM,sBAAsB,gBAAgB,QAAQ,MAAM,cAAc,MAAM,MAAM,CAAC;IAM1G,EACF"}
@@ -0,0 +1,4 @@
1
+ import './style.css';
2
+ import { createApiReference } from './standalone/lib/html-api.js';
3
+ export { createApiReference };
4
+ //# sourceMappingURL=standalone.esm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standalone.esm.d.ts","sourceRoot":"","sources":["../src/standalone.esm.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAEpB,OAAO,EAAE,kBAAkB,EAA0D,MAAM,2BAA2B,CAAA;AAStH,OAAO,EAAE,kBAAkB,EAAE,CAAA"}