@scalar/api-reference 1.35.7 → 1.36.1

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 (194) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/browser/standalone.js +14984 -15007
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  5. package/dist/components/ApiReferenceLayout.vue.js +1 -1
  6. package/dist/components/ApiReferenceLayout.vue2.js +148 -150
  7. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  8. package/dist/components/Content/Content.vue.js +44 -51
  9. package/dist/components/Content/Models/ClassicLayout.vue.d.ts +4 -1
  10. package/dist/components/Content/Models/ClassicLayout.vue.d.ts.map +1 -1
  11. package/dist/components/Content/Models/ClassicLayout.vue.js +1 -1
  12. package/dist/components/Content/Models/ClassicLayout.vue2.js +49 -40
  13. package/dist/components/Content/Models/Models.vue.d.ts +2 -2
  14. package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
  15. package/dist/components/Content/Models/Models.vue.js +25 -23
  16. package/dist/components/Content/Models/ModernLayout.vue.d.ts +1 -0
  17. package/dist/components/Content/Models/ModernLayout.vue.d.ts.map +1 -1
  18. package/dist/components/Content/Models/ModernLayout.vue.js +2 -2
  19. package/dist/components/Content/Models/ModernLayout.vue2.js +54 -51
  20. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +1 -2
  21. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
  22. package/dist/components/Content/Operations/TraversedEntry.vue.js +24 -24
  23. package/dist/components/Content/Operations/TraversedEntryContainer.vue.d.ts.map +1 -1
  24. package/dist/components/Content/Operations/TraversedEntryContainer.vue.js +1 -1
  25. package/dist/components/Content/Operations/get-current-index.d.ts +1 -1
  26. package/dist/components/Content/Operations/get-current-index.d.ts.map +1 -1
  27. package/dist/components/Content/Operations/get-current-index.js +1 -1
  28. package/dist/components/Content/Schema/Schema.vue.d.ts +3 -4
  29. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  30. package/dist/components/Content/Schema/Schema.vue.js +2 -2
  31. package/dist/components/Content/Schema/Schema.vue2.js +72 -75
  32. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +4 -5
  33. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  34. package/dist/components/Content/Schema/SchemaComposition.vue.js +46 -49
  35. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts +2 -7
  36. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -1
  37. package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +33 -54
  38. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +4 -6
  39. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  40. package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
  41. package/dist/components/Content/Schema/SchemaProperty.vue2.js +72 -76
  42. package/dist/components/Content/Schema/helpers/sort-property-names.d.ts +16 -0
  43. package/dist/components/Content/Schema/helpers/sort-property-names.d.ts.map +1 -0
  44. package/dist/components/Content/Schema/helpers/sort-property-names.js +36 -0
  45. package/dist/components/Content/Schema/types.d.ts +17 -0
  46. package/dist/components/Content/Schema/types.d.ts.map +1 -0
  47. package/dist/components/Content/Tags/ClassicLayout.vue.d.ts +1 -1
  48. package/dist/components/Content/Tags/ClassicLayout.vue.d.ts.map +1 -1
  49. package/dist/components/Content/Tags/ClassicLayout.vue.js +2 -2
  50. package/dist/components/Content/Tags/ClassicLayout.vue2.js +1 -1
  51. package/dist/components/Content/Tags/ModernLayout.vue.d.ts +1 -1
  52. package/dist/components/Content/Tags/ModernLayout.vue.d.ts.map +1 -1
  53. package/dist/components/Content/Tags/ModernLayout.vue.js +2 -2
  54. package/dist/components/Content/Tags/ModernLayout.vue2.js +2 -2
  55. package/dist/components/Content/Tags/Tag.vue.d.ts +1 -1
  56. package/dist/components/Content/Tags/Tag.vue.d.ts.map +1 -1
  57. package/dist/components/Content/Tags/TagSection.vue.d.ts +1 -1
  58. package/dist/components/Content/Tags/TagSection.vue.d.ts.map +1 -1
  59. package/dist/components/Content/Tags/TagSection.vue.js +4 -4
  60. package/dist/components/MobileHeader.vue.js +2 -2
  61. package/dist/components/MobileHeader.vue2.js +1 -1
  62. package/dist/components/OperationsList/OperationsList.vue.d.ts +1 -1
  63. package/dist/components/OperationsList/OperationsList.vue.d.ts.map +1 -1
  64. package/dist/components/OperationsList/OperationsList.vue.js +1 -1
  65. package/dist/components/OperationsList/OperationsList.vue2.js +9 -11
  66. package/dist/components/OperationsList/OperationsListItem.vue.d.ts +1 -1
  67. package/dist/components/OperationsList/OperationsListItem.vue.d.ts.map +1 -1
  68. package/dist/components/OperationsList/OperationsListItem.vue.js +2 -2
  69. package/dist/components/OperationsList/OperationsListItem.vue2.js +24 -27
  70. package/dist/components/Section/Section.vue.d.ts.map +1 -1
  71. package/dist/components/Section/Section.vue.js +2 -2
  72. package/dist/components/Section/Section.vue2.js +12 -13
  73. package/dist/components/Section/SectionAccordion.vue.d.ts.map +1 -1
  74. package/dist/components/Section/SectionAccordion.vue.js +1 -1
  75. package/dist/components/Section/SectionAccordion.vue2.js +36 -37
  76. package/dist/components/ShowMoreButton.vue.js +2 -2
  77. package/dist/components/ShowMoreButton.vue2.js +3 -3
  78. package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
  79. package/dist/features/Operation/Operation.vue.js +32 -22
  80. package/dist/features/Operation/components/Header.vue.d.ts +2 -0
  81. package/dist/features/Operation/components/Header.vue.d.ts.map +1 -1
  82. package/dist/features/Operation/components/Header.vue.js +15 -10
  83. package/dist/features/Operation/components/Headers.vue.d.ts +2 -0
  84. package/dist/features/Operation/components/Headers.vue.d.ts.map +1 -1
  85. package/dist/features/Operation/components/Headers.vue.js +1 -1
  86. package/dist/features/Operation/components/Headers.vue2.js +23 -21
  87. package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
  88. package/dist/features/Operation/components/ParameterListItem.vue.js +2 -2
  89. package/dist/features/Operation/components/ParameterListItem.vue2.js +55 -48
  90. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  91. package/dist/features/Operation/components/RequestBody.vue.js +1 -1
  92. package/dist/features/Operation/components/RequestBody.vue2.js +74 -49
  93. package/dist/features/Operation/helpers/get-first-server.d.ts +9 -0
  94. package/dist/features/Operation/helpers/get-first-server.d.ts.map +1 -0
  95. package/dist/features/Operation/helpers/get-first-server.js +20 -0
  96. package/dist/features/Search/components/SearchButton.vue.d.ts +2 -0
  97. package/dist/features/Search/components/SearchButton.vue.d.ts.map +1 -1
  98. package/dist/features/Search/components/SearchButton.vue.js +19 -17
  99. package/dist/features/Search/components/SearchModal.vue.d.ts +2 -1
  100. package/dist/features/Search/components/SearchModal.vue.d.ts.map +1 -1
  101. package/dist/features/Search/components/SearchModal.vue.js +2 -2
  102. package/dist/features/Search/components/SearchModal.vue2.js +74 -75
  103. package/dist/features/Search/helpers/create-search-index.d.ts +2 -2
  104. package/dist/features/Search/helpers/create-search-index.d.ts.map +1 -1
  105. package/dist/features/Search/helpers/create-search-index.js +68 -66
  106. package/dist/features/Search/hooks/useSearchIndex.d.ts +3 -2
  107. package/dist/features/Search/hooks/useSearchIndex.d.ts.map +1 -1
  108. package/dist/features/Search/hooks/useSearchIndex.js +13 -13
  109. package/dist/features/Search/types.d.ts +1 -1
  110. package/dist/features/Search/types.d.ts.map +1 -1
  111. package/dist/features/api-client-modal/useApiClient.d.ts +40 -40
  112. package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
  113. package/dist/helpers/convert-security-scheme.d.ts +1 -1
  114. package/dist/helpers/test-utils.d.ts +367 -5
  115. package/dist/helpers/test-utils.d.ts.map +1 -1
  116. package/dist/hooks/useNavState.d.ts +1 -15
  117. package/dist/hooks/useNavState.d.ts.map +1 -1
  118. package/dist/hooks/useNavState.js +29 -53
  119. package/dist/index.d.ts +5 -6
  120. package/dist/index.d.ts.map +1 -1
  121. package/dist/index.js +16 -20
  122. package/dist/style.css +1 -1
  123. package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.d.ts.map +1 -1
  124. package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.js +5 -6
  125. package/dist/{features/sidebar/components/Sidebar.vue.d.ts → v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue.d.ts} +1 -1
  126. package/dist/v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue.d.ts.map +1 -0
  127. package/dist/v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue.js +7 -0
  128. package/dist/{features/sidebar/components/Sidebar.vue2.js → v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue2.js} +15 -15
  129. package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarElement.vue.d.ts +1 -1
  130. package/dist/v2/blocks/scalar-sidebar-block/components/SidebarElement.vue.d.ts.map +1 -0
  131. package/dist/v2/blocks/scalar-sidebar-block/components/SidebarElement.vue.js +7 -0
  132. package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarElement.vue2.js +41 -43
  133. package/dist/v2/blocks/scalar-sidebar-block/components/SidebarGroup.vue.d.ts.map +1 -0
  134. package/dist/v2/blocks/scalar-sidebar-block/components/SidebarGroup.vue.js +7 -0
  135. package/dist/v2/blocks/scalar-sidebar-block/components/SidebarHttpBadge.vue.d.ts.map +1 -0
  136. package/dist/v2/blocks/scalar-sidebar-block/components/SidebarHttpBadge.vue.js +7 -0
  137. package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarHttpBadge.vue2.js +1 -1
  138. package/dist/v2/blocks/scalar-sidebar-block/helpers/create-sidebar.d.ts +385 -0
  139. package/dist/v2/blocks/scalar-sidebar-block/helpers/create-sidebar.d.ts.map +1 -0
  140. package/dist/v2/blocks/scalar-sidebar-block/helpers/create-sidebar.js +35 -0
  141. package/dist/v2/blocks/scalar-sidebar-block/helpers/generate-reverse-index.d.ts +189 -0
  142. package/dist/v2/blocks/scalar-sidebar-block/helpers/generate-reverse-index.d.ts.map +1 -0
  143. package/dist/v2/blocks/scalar-sidebar-block/helpers/generate-reverse-index.js +9 -0
  144. package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/hooks/useSidebar.d.ts +4 -8
  145. package/dist/v2/blocks/scalar-sidebar-block/hooks/useSidebar.d.ts.map +1 -0
  146. package/dist/v2/blocks/scalar-sidebar-block/hooks/useSidebar.js +18 -0
  147. package/dist/v2/blocks/scalar-sidebar-block/index.d.ts +4 -0
  148. package/dist/v2/blocks/scalar-sidebar-block/index.d.ts.map +1 -0
  149. package/dist/v2/helpers/map-configuration.d.ts.map +1 -1
  150. package/package.json +11 -11
  151. package/dist/features/sidebar/components/Sidebar.vue.d.ts.map +0 -1
  152. package/dist/features/sidebar/components/Sidebar.vue.js +0 -7
  153. package/dist/features/sidebar/components/SidebarElement.vue.d.ts.map +0 -1
  154. package/dist/features/sidebar/components/SidebarElement.vue.js +0 -7
  155. package/dist/features/sidebar/components/SidebarGroup.vue.d.ts.map +0 -1
  156. package/dist/features/sidebar/components/SidebarGroup.vue.js +0 -7
  157. package/dist/features/sidebar/components/SidebarHttpBadge.vue.d.ts.map +0 -1
  158. package/dist/features/sidebar/components/SidebarHttpBadge.vue.js +0 -7
  159. package/dist/features/sidebar/helpers/create-sidebar.d.ts +0 -28
  160. package/dist/features/sidebar/helpers/create-sidebar.d.ts.map +0 -1
  161. package/dist/features/sidebar/helpers/create-sidebar.js +0 -32
  162. package/dist/features/sidebar/hooks/useSidebar.d.ts.map +0 -1
  163. package/dist/features/sidebar/hooks/useSidebar.js +0 -18
  164. package/dist/features/sidebar/index.d.ts +0 -4
  165. package/dist/features/sidebar/index.d.ts.map +0 -1
  166. package/dist/features/traverse-schema/helpers/get-tag.d.ts +0 -6
  167. package/dist/features/traverse-schema/helpers/get-tag.d.ts.map +0 -1
  168. package/dist/features/traverse-schema/helpers/get-tag.js +0 -7
  169. package/dist/features/traverse-schema/helpers/traverse-description.d.ts +0 -11
  170. package/dist/features/traverse-schema/helpers/traverse-description.d.ts.map +0 -1
  171. package/dist/features/traverse-schema/helpers/traverse-description.js +0 -32
  172. package/dist/features/traverse-schema/helpers/traverse-document.d.ts +0 -16
  173. package/dist/features/traverse-schema/helpers/traverse-document.d.ts.map +0 -1
  174. package/dist/features/traverse-schema/helpers/traverse-document.js +0 -33
  175. package/dist/features/traverse-schema/helpers/traverse-paths.d.ts +0 -18
  176. package/dist/features/traverse-schema/helpers/traverse-paths.d.ts.map +0 -1
  177. package/dist/features/traverse-schema/helpers/traverse-paths.js +0 -30
  178. package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts +0 -8
  179. package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts.map +0 -1
  180. package/dist/features/traverse-schema/helpers/traverse-schemas.js +0 -21
  181. package/dist/features/traverse-schema/helpers/traverse-tags.d.ts +0 -11
  182. package/dist/features/traverse-schema/helpers/traverse-tags.d.ts.map +0 -1
  183. package/dist/features/traverse-schema/helpers/traverse-tags.js +0 -43
  184. package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts +0 -10
  185. package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts.map +0 -1
  186. package/dist/features/traverse-schema/helpers/traverse-webhooks.js +0 -24
  187. package/dist/features/traverse-schema/index.d.ts +0 -5
  188. package/dist/features/traverse-schema/index.d.ts.map +0 -1
  189. package/dist/features/traverse-schema/types.d.ts +0 -55
  190. package/dist/features/traverse-schema/types.d.ts.map +0 -1
  191. package/dist/libs/markdown.js +0 -18
  192. /package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarGroup.vue.d.ts +0 -0
  193. /package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarGroup.vue2.js +0 -0
  194. /package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarHttpBadge.vue.d.ts +0 -0
@@ -0,0 +1,385 @@
1
+ import type { WorkspaceStore } from '@scalar/workspace-store/client';
2
+ /**
3
+ * Creating sidebar with only one traversal of the spec
4
+ *
5
+ * TODO:
6
+ * - add the search index creation as well
7
+ * - update docs
8
+ * - tagged models
9
+ */
10
+ export declare const createSidebar: (store: WorkspaceStore) => {
11
+ collapsedSidebarItems: Record<string, boolean>;
12
+ isSidebarOpen: import("vue").Ref<boolean, boolean>;
13
+ items: import("vue").ComputedRef<{
14
+ entries: (({
15
+ title: string;
16
+ id: string;
17
+ } & {
18
+ description?: string | undefined;
19
+ children?: (({
20
+ title: string;
21
+ id: string;
22
+ } & /*elided*/ any) | ({
23
+ title: string;
24
+ id: string;
25
+ } & {
26
+ children?: (({
27
+ title: string;
28
+ id: string;
29
+ } & /*elided*/ any) | ({
30
+ title: string;
31
+ id: string;
32
+ } & /*elided*/ any) | ({
33
+ title: string;
34
+ id: string;
35
+ } & {
36
+ isDeprecated?: boolean | undefined;
37
+ path: string;
38
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
39
+ type: "operation";
40
+ ref: string;
41
+ }) | ({
42
+ title: string;
43
+ id: string;
44
+ } & {
45
+ type: "model";
46
+ ref: string;
47
+ name: string;
48
+ }) | ({
49
+ title: string;
50
+ id: string;
51
+ } & {
52
+ isDeprecated?: boolean | undefined;
53
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
54
+ type: "webhook";
55
+ ref: string;
56
+ name: string;
57
+ }))[] | undefined;
58
+ type: "text";
59
+ }) | ({
60
+ title: string;
61
+ id: string;
62
+ } & {
63
+ isDeprecated?: boolean | undefined;
64
+ path: string;
65
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
66
+ type: "operation";
67
+ ref: string;
68
+ }) | ({
69
+ title: string;
70
+ id: string;
71
+ } & {
72
+ type: "model";
73
+ ref: string;
74
+ name: string;
75
+ }) | ({
76
+ title: string;
77
+ id: string;
78
+ } & {
79
+ isDeprecated?: boolean | undefined;
80
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
81
+ type: "webhook";
82
+ ref: string;
83
+ name: string;
84
+ }))[] | undefined;
85
+ isWebhooks?: boolean | undefined;
86
+ xKeys?: {
87
+ [x: string]: unknown;
88
+ } | undefined;
89
+ type: "tag";
90
+ name: string;
91
+ isGroup: boolean;
92
+ }) | ({
93
+ title: string;
94
+ id: string;
95
+ } & {
96
+ children?: (({
97
+ title: string;
98
+ id: string;
99
+ } & {
100
+ description?: string | undefined;
101
+ children?: (({
102
+ title: string;
103
+ id: string;
104
+ } & /*elided*/ any) | ({
105
+ title: string;
106
+ id: string;
107
+ } & /*elided*/ any) | ({
108
+ title: string;
109
+ id: string;
110
+ } & {
111
+ isDeprecated?: boolean | undefined;
112
+ path: string;
113
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
114
+ type: "operation";
115
+ ref: string;
116
+ }) | ({
117
+ title: string;
118
+ id: string;
119
+ } & {
120
+ type: "model";
121
+ ref: string;
122
+ name: string;
123
+ }) | ({
124
+ title: string;
125
+ id: string;
126
+ } & {
127
+ isDeprecated?: boolean | undefined;
128
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
129
+ type: "webhook";
130
+ ref: string;
131
+ name: string;
132
+ }))[] | undefined;
133
+ isWebhooks?: boolean | undefined;
134
+ xKeys?: {
135
+ [x: string]: unknown;
136
+ } | undefined;
137
+ type: "tag";
138
+ name: string;
139
+ isGroup: boolean;
140
+ }) | ({
141
+ title: string;
142
+ id: string;
143
+ } & /*elided*/ any) | ({
144
+ title: string;
145
+ id: string;
146
+ } & {
147
+ isDeprecated?: boolean | undefined;
148
+ path: string;
149
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
150
+ type: "operation";
151
+ ref: string;
152
+ }) | ({
153
+ title: string;
154
+ id: string;
155
+ } & {
156
+ type: "model";
157
+ ref: string;
158
+ name: string;
159
+ }) | ({
160
+ title: string;
161
+ id: string;
162
+ } & {
163
+ isDeprecated?: boolean | undefined;
164
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
165
+ type: "webhook";
166
+ ref: string;
167
+ name: string;
168
+ }))[] | undefined;
169
+ type: "text";
170
+ }) | ({
171
+ title: string;
172
+ id: string;
173
+ } & {
174
+ isDeprecated?: boolean | undefined;
175
+ path: string;
176
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
177
+ type: "operation";
178
+ ref: string;
179
+ }) | ({
180
+ title: string;
181
+ id: string;
182
+ } & {
183
+ type: "model";
184
+ ref: string;
185
+ name: string;
186
+ }) | ({
187
+ title: string;
188
+ id: string;
189
+ } & {
190
+ isDeprecated?: boolean | undefined;
191
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
192
+ type: "webhook";
193
+ ref: string;
194
+ name: string;
195
+ }))[];
196
+ entities: Map<string, (({
197
+ title: string;
198
+ id: string;
199
+ } & {
200
+ description?: string | undefined;
201
+ children?: (({
202
+ title: string;
203
+ id: string;
204
+ } & /*elided*/ any) | ({
205
+ title: string;
206
+ id: string;
207
+ } & {
208
+ children?: (({
209
+ title: string;
210
+ id: string;
211
+ } & /*elided*/ any) | ({
212
+ title: string;
213
+ id: string;
214
+ } & /*elided*/ any) | ({
215
+ title: string;
216
+ id: string;
217
+ } & {
218
+ isDeprecated?: boolean | undefined;
219
+ path: string;
220
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
221
+ type: "operation";
222
+ ref: string;
223
+ }) | ({
224
+ title: string;
225
+ id: string;
226
+ } & {
227
+ type: "model";
228
+ ref: string;
229
+ name: string;
230
+ }) | ({
231
+ title: string;
232
+ id: string;
233
+ } & {
234
+ isDeprecated?: boolean | undefined;
235
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
236
+ type: "webhook";
237
+ ref: string;
238
+ name: string;
239
+ }))[] | undefined;
240
+ type: "text";
241
+ }) | ({
242
+ title: string;
243
+ id: string;
244
+ } & {
245
+ isDeprecated?: boolean | undefined;
246
+ path: string;
247
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
248
+ type: "operation";
249
+ ref: string;
250
+ }) | ({
251
+ title: string;
252
+ id: string;
253
+ } & {
254
+ type: "model";
255
+ ref: string;
256
+ name: string;
257
+ }) | ({
258
+ title: string;
259
+ id: string;
260
+ } & {
261
+ isDeprecated?: boolean | undefined;
262
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
263
+ type: "webhook";
264
+ ref: string;
265
+ name: string;
266
+ }))[] | undefined;
267
+ isWebhooks?: boolean | undefined;
268
+ xKeys?: {
269
+ [x: string]: unknown;
270
+ } | undefined;
271
+ type: "tag";
272
+ name: string;
273
+ isGroup: boolean;
274
+ }) | ({
275
+ title: string;
276
+ id: string;
277
+ } & {
278
+ children?: (({
279
+ title: string;
280
+ id: string;
281
+ } & {
282
+ description?: string | undefined;
283
+ children?: (({
284
+ title: string;
285
+ id: string;
286
+ } & /*elided*/ any) | ({
287
+ title: string;
288
+ id: string;
289
+ } & /*elided*/ any) | ({
290
+ title: string;
291
+ id: string;
292
+ } & {
293
+ isDeprecated?: boolean | undefined;
294
+ path: string;
295
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
296
+ type: "operation";
297
+ ref: string;
298
+ }) | ({
299
+ title: string;
300
+ id: string;
301
+ } & {
302
+ type: "model";
303
+ ref: string;
304
+ name: string;
305
+ }) | ({
306
+ title: string;
307
+ id: string;
308
+ } & {
309
+ isDeprecated?: boolean | undefined;
310
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
311
+ type: "webhook";
312
+ ref: string;
313
+ name: string;
314
+ }))[] | undefined;
315
+ isWebhooks?: boolean | undefined;
316
+ xKeys?: {
317
+ [x: string]: unknown;
318
+ } | undefined;
319
+ type: "tag";
320
+ name: string;
321
+ isGroup: boolean;
322
+ }) | ({
323
+ title: string;
324
+ id: string;
325
+ } & /*elided*/ any) | ({
326
+ title: string;
327
+ id: string;
328
+ } & {
329
+ isDeprecated?: boolean | undefined;
330
+ path: string;
331
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
332
+ type: "operation";
333
+ ref: string;
334
+ }) | ({
335
+ title: string;
336
+ id: string;
337
+ } & {
338
+ type: "model";
339
+ ref: string;
340
+ name: string;
341
+ }) | ({
342
+ title: string;
343
+ id: string;
344
+ } & {
345
+ isDeprecated?: boolean | undefined;
346
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
347
+ type: "webhook";
348
+ ref: string;
349
+ name: string;
350
+ }))[] | undefined;
351
+ type: "text";
352
+ }) | ({
353
+ title: string;
354
+ id: string;
355
+ } & {
356
+ isDeprecated?: boolean | undefined;
357
+ path: string;
358
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
359
+ type: "operation";
360
+ ref: string;
361
+ }) | ({
362
+ title: string;
363
+ id: string;
364
+ } & {
365
+ type: "model";
366
+ ref: string;
367
+ name: string;
368
+ }) | ({
369
+ title: string;
370
+ id: string;
371
+ } & {
372
+ isDeprecated?: boolean | undefined;
373
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
374
+ type: "webhook";
375
+ ref: string;
376
+ name: string;
377
+ })) & {
378
+ parent?: import("@scalar/workspace-store/schemas/v3.1/strict/openapi-document").TraversedEntry;
379
+ }>;
380
+ }>;
381
+ scrollToOperation: (operationId: string, focus?: boolean) => void;
382
+ setCollapsedSidebarItem: (key: string, value: boolean) => boolean;
383
+ toggleCollapsedSidebarItem: (key: string) => boolean;
384
+ };
385
+ //# sourceMappingURL=create-sidebar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-sidebar.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-sidebar-block/helpers/create-sidebar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAMpE;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCA4BT,MAAM,UAAU,OAAO;mCAvBzB,MAAM,SAAS,OAAO;sCADnB,MAAM;CAmDhD,CAAA"}
@@ -0,0 +1,35 @@
1
+ import { scrollToId as n } from "@scalar/helpers/dom/scroll-to-id";
2
+ import { reactive as d, ref as p, computed as u } from "vue";
3
+ import { generateReverseIndex as g } from "./generate-reverse-index.js";
4
+ import { lazyBus as b } from "../../../../components/Lazy/lazyBus.js";
5
+ const C = (i) => {
6
+ const r = d({}), a = p(!1), l = (e) => r[e] = !r[e], o = (e, t) => r[e] = t, c = u(() => {
7
+ const e = i.workspace.activeDocument?.["x-scalar-navigation"];
8
+ return i.config["x-scalar-reference-config"].features.expandAllTagSections && e?.forEach((t) => o(t.id, !0)), {
9
+ entries: e ?? [],
10
+ entities: g(e)
11
+ };
12
+ });
13
+ return {
14
+ collapsedSidebarItems: r,
15
+ isSidebarOpen: a,
16
+ items: c,
17
+ scrollToOperation: (e, t) => {
18
+ const s = c.value.entities.get(e)?.parent?.id;
19
+ if (s && s !== e)
20
+ if (r[s])
21
+ n(e, t);
22
+ else {
23
+ const f = b.on((m) => {
24
+ m.loaded === e && (n(e, t), f());
25
+ });
26
+ o(s, !0);
27
+ }
28
+ },
29
+ setCollapsedSidebarItem: o,
30
+ toggleCollapsedSidebarItem: l
31
+ };
32
+ };
33
+ export {
34
+ C as createSidebar
35
+ };
@@ -0,0 +1,189 @@
1
+ import type { OpenApiDocument, TraversedEntry } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
+ /**
3
+ * Generate a reverse index for fast lookups of entities by their IDs.
4
+ */
5
+ export declare const generateReverseIndex: (navigation?: OpenApiDocument["x-scalar-navigation"]) => Map<string, (({
6
+ title: string;
7
+ id: string;
8
+ } & {
9
+ description?: string | undefined;
10
+ children?: (({
11
+ title: string;
12
+ id: string;
13
+ } & /*elided*/ any) | ({
14
+ title: string;
15
+ id: string;
16
+ } & {
17
+ children?: (({
18
+ title: string;
19
+ id: string;
20
+ } & /*elided*/ any) | ({
21
+ title: string;
22
+ id: string;
23
+ } & /*elided*/ any) | ({
24
+ title: string;
25
+ id: string;
26
+ } & {
27
+ isDeprecated?: boolean | undefined;
28
+ path: string;
29
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
30
+ type: "operation";
31
+ ref: string;
32
+ }) | ({
33
+ title: string;
34
+ id: string;
35
+ } & {
36
+ type: "model";
37
+ ref: string;
38
+ name: string;
39
+ }) | ({
40
+ title: string;
41
+ id: string;
42
+ } & {
43
+ isDeprecated?: boolean | undefined;
44
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
45
+ type: "webhook";
46
+ ref: string;
47
+ name: string;
48
+ }))[] | undefined;
49
+ type: "text";
50
+ }) | ({
51
+ title: string;
52
+ id: string;
53
+ } & {
54
+ isDeprecated?: boolean | undefined;
55
+ path: string;
56
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
57
+ type: "operation";
58
+ ref: string;
59
+ }) | ({
60
+ title: string;
61
+ id: string;
62
+ } & {
63
+ type: "model";
64
+ ref: string;
65
+ name: string;
66
+ }) | ({
67
+ title: string;
68
+ id: string;
69
+ } & {
70
+ isDeprecated?: boolean | undefined;
71
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
72
+ type: "webhook";
73
+ ref: string;
74
+ name: string;
75
+ }))[] | undefined;
76
+ isWebhooks?: boolean | undefined;
77
+ xKeys?: {
78
+ [x: string]: unknown;
79
+ } | undefined;
80
+ type: "tag";
81
+ name: string;
82
+ isGroup: boolean;
83
+ }) | ({
84
+ title: string;
85
+ id: string;
86
+ } & {
87
+ children?: (({
88
+ title: string;
89
+ id: string;
90
+ } & {
91
+ description?: string | undefined;
92
+ children?: (({
93
+ title: string;
94
+ id: string;
95
+ } & /*elided*/ any) | ({
96
+ title: string;
97
+ id: string;
98
+ } & /*elided*/ any) | ({
99
+ title: string;
100
+ id: string;
101
+ } & {
102
+ isDeprecated?: boolean | undefined;
103
+ path: string;
104
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
105
+ type: "operation";
106
+ ref: string;
107
+ }) | ({
108
+ title: string;
109
+ id: string;
110
+ } & {
111
+ type: "model";
112
+ ref: string;
113
+ name: string;
114
+ }) | ({
115
+ title: string;
116
+ id: string;
117
+ } & {
118
+ isDeprecated?: boolean | undefined;
119
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
120
+ type: "webhook";
121
+ ref: string;
122
+ name: string;
123
+ }))[] | undefined;
124
+ isWebhooks?: boolean | undefined;
125
+ xKeys?: {
126
+ [x: string]: unknown;
127
+ } | undefined;
128
+ type: "tag";
129
+ name: string;
130
+ isGroup: boolean;
131
+ }) | ({
132
+ title: string;
133
+ id: string;
134
+ } & /*elided*/ any) | ({
135
+ title: string;
136
+ id: string;
137
+ } & {
138
+ isDeprecated?: boolean | undefined;
139
+ path: string;
140
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
141
+ type: "operation";
142
+ ref: string;
143
+ }) | ({
144
+ title: string;
145
+ id: string;
146
+ } & {
147
+ type: "model";
148
+ ref: string;
149
+ name: string;
150
+ }) | ({
151
+ title: string;
152
+ id: string;
153
+ } & {
154
+ isDeprecated?: boolean | undefined;
155
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
156
+ type: "webhook";
157
+ ref: string;
158
+ name: string;
159
+ }))[] | undefined;
160
+ type: "text";
161
+ }) | ({
162
+ title: string;
163
+ id: string;
164
+ } & {
165
+ isDeprecated?: boolean | undefined;
166
+ path: string;
167
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
168
+ type: "operation";
169
+ ref: string;
170
+ }) | ({
171
+ title: string;
172
+ id: string;
173
+ } & {
174
+ type: "model";
175
+ ref: string;
176
+ name: string;
177
+ }) | ({
178
+ title: string;
179
+ id: string;
180
+ } & {
181
+ isDeprecated?: boolean | undefined;
182
+ method: "head" | "connect" | "delete" | "get" | "options" | "patch" | "post" | "put" | "trace";
183
+ type: "webhook";
184
+ ref: string;
185
+ name: string;
186
+ })) & {
187
+ parent?: TraversedEntry;
188
+ }>;
189
+ //# sourceMappingURL=generate-reverse-index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-reverse-index.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-sidebar-block/helpers/generate-reverse-index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAA;AAEnH;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,aAAY,eAAe,CAAC,qBAAqB,CAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAE9B,cAAc;EAe3E,CAAA"}
@@ -0,0 +1,9 @@
1
+ const a = (t = []) => {
2
+ const r = /* @__PURE__ */ new Map(), n = (e) => {
3
+ r.set(e.id, e), "children" in e && e.children?.forEach((c) => n({ ...c, parent: e }));
4
+ };
5
+ return t.forEach(n), r;
6
+ };
7
+ export {
8
+ a as generateReverseIndex
9
+ };
@@ -1,22 +1,18 @@
1
- import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
- import { type InjectionKey, type Ref } from 'vue';
3
- import { createSidebar, type SidebarOptions } from '../../../features/sidebar/helpers/create-sidebar.js';
1
+ import type { WorkspaceStore } from '@scalar/workspace-store/client';
2
+ import { type InjectionKey } from 'vue';
3
+ import { createSidebar } from '../../../../v2/blocks/scalar-sidebar-block/helpers/create-sidebar.js';
4
4
  type Sidebar = ReturnType<typeof createSidebar>;
5
5
  /**
6
6
  * Injection key for the sidebar instance.
7
7
  * This ensures type safety when injecting the sidebar.
8
8
  */
9
9
  export declare const SIDEBAR_SYMBOL: InjectionKey<Sidebar>;
10
- type UseSidebar = {
11
- (): Sidebar;
12
- (content: Ref<OpenAPIV3_1.Document>, options: SidebarOptions): Sidebar;
13
- };
14
10
  /**
15
11
  * Composable for managing the sidebar state.
16
12
  *
17
13
  * When called with a collection and options, it creates and provides a new sidebar instance.
18
14
  * When called without parameters, it returns the injected sidebar state.
19
15
  */
20
- export declare const useSidebar: UseSidebar;
16
+ export declare const useSidebar: (store?: WorkspaceStore) => ReturnType<typeof createSidebar>;
21
17
  export {};
22
18
  //# sourceMappingURL=useSidebar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSidebar.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-sidebar-block/hooks/useSidebar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,KAAK,YAAY,EAAmB,MAAM,KAAK,CAAA;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,yDAAyD,CAAA;AAEvF,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAA;AAE/C;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,YAAY,CAAC,OAAO,CAAqB,CAAA;AAEtE;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,QAAQ,cAAc,KAAG,UAAU,CAAC,OAAO,aAAa,CAoBlF,CAAA"}
@@ -0,0 +1,18 @@
1
+ import { provide as t, inject as a } from "vue";
2
+ import { createSidebar as n } from "../helpers/create-sidebar.js";
3
+ const i = Symbol("sidebar"), d = (e) => {
4
+ if (e) {
5
+ const o = n(e);
6
+ return t(i, o), o;
7
+ }
8
+ const r = a(i);
9
+ if (!r)
10
+ throw new Error(
11
+ "useSidebar() was called without a collection and no sidebar instance was found. Make sure to call useSidebar(collection) in a parent component first."
12
+ );
13
+ return r;
14
+ };
15
+ export {
16
+ i as SIDEBAR_SYMBOL,
17
+ d as useSidebar
18
+ };
@@ -0,0 +1,4 @@
1
+ export { default as SidebarBlock } from './components/SidebarBlock.vue.js';
2
+ export { default as SidebarHttpBadge } from './components/SidebarHttpBadge.vue.js';
3
+ export { SIDEBAR_SYMBOL, useSidebar } from './hooks/useSidebar.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/scalar-sidebar-block/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AAC/E,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA"}