@scalar/api-client-react 2.0.3 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/index.js.map +1 -1
- package/dist/lazy-load.d.ts +3 -3
- package/dist/lazy-load.d.ts.map +1 -1
- package/dist/style.css +92 -69
- package/dist/use-api-client.d.ts +2 -2
- package/dist/use-api-client.d.ts.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/lazy-load.ts","../src/use-api-client.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/lazy-load.ts","../src/use-api-client.ts"],"sourcesContent":["import type { ApiClientOptions } from '@scalar/api-client/modal'\n\n/**\n * Creates a lazy singleton getter: the factory runs at most once, caches the resulting promise,\n * and clears the cache on failure so the next call can retry.\n *\n * Optional args are forwarded to the factory on the first (cache-miss) call only.\n * Subsequent calls return the cached promise regardless of the args passed.\n */\nconst makeLazySingleton = <T, Args extends unknown[] = []>(\n factory: (...args: Args) => Promise<T>,\n): ((...args: Args) => Promise<T>) => {\n let cached: Promise<T> | undefined\n return (...args: Args) => {\n cached ??= factory(...args).catch((error) => {\n cached = undefined\n throw error\n })\n return cached\n }\n}\n\n/** Lazy load the client modal creator */\nexport const getClientModalCreator = makeLazySingleton(() =>\n import('@scalar/api-client/modal').then(({ createApiClientModal }) => createApiClientModal),\n)\n\n/** Module-scoped singleton workspace store (lazy-loaded on first use). */\nexport const getWorkspaceStoreSingleton = makeLazySingleton(() =>\n import('@scalar/workspace-store/client').then(({ createWorkspaceStore }) => createWorkspaceStore()),\n)\n\n/** Module-scoped singleton workspace event bus (lazy-loaded on first use). */\nexport const getWorkspaceEventBusSingleton = makeLazySingleton(() =>\n import('@scalar/workspace-store/events').then(({ createWorkspaceEventBus }) => createWorkspaceEventBus()),\n)\n\n/**\n * Lazily creates the singleton Vue app, mounts it as the last child of document.body,\n * and returns the controller. Subsequent calls return the same promise.\n *\n * Only modal-supported options are accepted here. Document-specific fields\n * (`url`, `content`) must be registered via `workspaceStore.addDocument` after the client\n * is ready — they are not part of the modal constructor.\n */\nexport const getOrCreateApiClient = makeLazySingleton(async (options: ApiClientOptions = {}) => {\n const el = document.createElement('div')\n el.className = 'scalar-app'\n document.body.appendChild(el)\n\n try {\n const [createModal, workspaceStore, eventBus] = await Promise.all([\n getClientModalCreator(),\n getWorkspaceStoreSingleton(),\n getWorkspaceEventBusSingleton(),\n ])\n\n const apiClient = createModal({\n el,\n eventBus,\n workspaceStore,\n options,\n // TODO: map plugins from configuration when available\n // plugins: mapConfigPlugins(options),\n })\n\n return { apiClient, workspaceStore }\n } catch (error) {\n el.remove()\n throw error\n }\n})\n","'use client'\n\nimport type { ApiClientModal, ApiClientOptions, RoutePayload } from '@scalar/api-client/modal'\nimport { useEffect, useRef, useState } from 'react'\n\nimport './style.css'\n\nimport { isObjectEqual } from '@scalar/helpers/object/is-object-equal'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\n\nimport { getOrCreateApiClient } from './lazy-load'\n\nglobalThis.__VUE_OPTIONS_API__ = true\nglobalThis.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = true\nglobalThis.__VUE_PROD_DEVTOOLS__ = false\n\nexport type ApiClientConfigurationReact = ApiClientOptions & {\n // content?: Record<string, unknown>\n url: string\n}\n\nexport type UseApiClientModalProps = {\n /** Configuration for the Api Client (url or inline content) */\n configuration: ApiClientConfigurationReact\n}\n\n/** Tracks which documents are/have been loaded so we dont duplicate */\nconst documentSet = new Set<string>()\n\n/**\n * Returns the singleton Api Client\n *\n * On first call the Vue app is lazily created and appended to document.body where it\n * lives for the lifetime of the page — it is never unmounted, so it survives client-side\n * navigation without losing state.\n *\n * Subsequent calls from any component share the same instance of the client but can use the same\n * or different documents\n */\nexport const useApiClient = ({\n configuration,\n}: UseApiClientModalProps): (Omit<ApiClientModal, 'open'> & { open: (payload: RoutePayload) => void }) | undefined => {\n const [client, setClient] = useState<ApiClientModal | undefined>(undefined)\n const [workspaceStore, setWorkspaceStore] = useState<WorkspaceStore | undefined>(undefined)\n const documentSlugRef = useRef('')\n const previousModalOptionsRef = useRef<ApiClientOptions | undefined>(undefined)\n\n /** Small wrapper to set the documentSlug */\n const open = (payload: RoutePayload) => client?.open({ documentSlug: documentSlugRef.current, ...payload })\n\n useEffect(() => {\n let cancelled = false\n\n // Strip document-specific fields before passing to the modal constructor.\n const { url, ...modalOptions } = configuration\n\n void getOrCreateApiClient(modalOptions)?.then((_client) => {\n if (cancelled || !_client) {\n return\n }\n\n // Compute the slug here so we can batch all three state updates into one render,\n // preventing a render where `client` is set but `documentSlug` is still ''.\n const slug = url || ''\n\n // React always provides the complete modal option set for this hook instance,\n // so we overwrite to clear options removed by consumers.\n _client.apiClient.updateOptions(modalOptions, true)\n previousModalOptionsRef.current = modalOptions\n\n setClient(_client.apiClient)\n setWorkspaceStore(_client.workspaceStore)\n documentSlugRef.current = slug\n\n if (slug && !documentSet.has(slug)) {\n documentSet.add(slug)\n void _client.workspaceStore.addDocument({ name: slug, url })\n }\n })\n\n return () => {\n cancelled = true\n }\n\n // Only run once per mount\n }, [])\n\n // Register new document when we detect the url has changed\n useEffect(() => {\n if (!client || !workspaceStore) {\n return\n }\n\n const slug = configuration.url || 'default'\n documentSlugRef.current = slug\n\n if (documentSet.has(slug)) {\n return\n }\n documentSet.add(slug)\n\n void workspaceStore.addDocument({ name: slug, url: configuration.url })\n }, [client, configuration.url, workspaceStore])\n\n // Update the modal options when the configuration changes\n useEffect(() => {\n if (!client || !configuration) {\n return\n }\n\n const { url: _, ...modalOptions } = configuration\n if (isObjectEqual(previousModalOptionsRef.current, modalOptions)) {\n return\n }\n\n client.updateOptions(modalOptions, true)\n previousModalOptionsRef.current = modalOptions\n }, [client, configuration])\n\n return client\n ? {\n ...client,\n open,\n }\n : undefined\n}\n"],"mappings":";;;;;;;;;;;AASA,IAAM,qBACJ,YACoC;CACpC,IAAI;AACJ,SAAQ,GAAG,SAAe;AACxB,aAAW,QAAQ,GAAG,KAAK,CAAC,OAAO,UAAU;AAC3C,YAAS,KAAA;AACT,SAAM;IACN;AACF,SAAO;;;;AAKX,IAAa,wBAAwB,wBACnC,OAAO,4BAA4B,MAAM,EAAE,2BAA2B,qBAAqB,CAC5F;;AAGD,IAAa,6BAA6B,wBACxC,OAAO,kCAAkC,MAAM,EAAE,2BAA2B,sBAAsB,CAAC,CACpG;;AAGD,IAAa,gCAAgC,wBAC3C,OAAO,kCAAkC,MAAM,EAAE,8BAA8B,yBAAyB,CAAC,CAC1G;;;;;;;;;AAUD,IAAa,uBAAuB,kBAAkB,OAAO,UAA4B,EAAE,KAAK;CAC9F,MAAM,KAAK,SAAS,cAAc,MAAM;AACxC,IAAG,YAAY;AACf,UAAS,KAAK,YAAY,GAAG;AAE7B,KAAI;EACF,MAAM,CAAC,aAAa,gBAAgB,YAAY,MAAM,QAAQ,IAAI;GAChE,uBAAuB;GACvB,4BAA4B;GAC5B,+BAAA;GACD,CAAC;AAWF,SAAO;GAAE,WATS,YAAY;IAC5B;IACA;IACA;IACA;IAGD,CAAC;GAEkB;GAAgB;UAC7B,OAAO;AACd,KAAG,QAAQ;AACX,QAAM;;EAER;;;AC3DF,WAAW,sBAAsB;AACjC,WAAW,0CAA0C;AACrD,WAAW,wBAAwB;;AAanC,IAAM,8BAAc,IAAI,KAAa;;;;;;;;;;;AAYrC,IAAa,gBAAgB,EAC3B,oBACoH;CACpH,MAAM,CAAC,QAAQ,aAAa,SAAqC,KAAA,EAAU;CAC3E,MAAM,CAAC,gBAAgB,qBAAqB,SAAqC,KAAA,EAAU;CAC3F,MAAM,kBAAkB,OAAO,GAAG;CAClC,MAAM,0BAA0B,OAAqC,KAAA,EAAU;;CAG/E,MAAM,QAAQ,YAA0B,QAAQ,KAAK;EAAE,cAAc,gBAAgB;EAAS,GAAG;EAAS,CAAC;AAE3G,iBAAgB;EACd,IAAI,YAAY;EAGhB,MAAM,EAAE,KAAK,GAAG,iBAAiB;AAE5B,uBAAqB,aAAa,EAAE,MAAM,YAAY;AACzD,OAAI,aAAa,CAAC,QAChB;GAKF,MAAM,OAAO,OAAO;AAIpB,WAAQ,UAAU,cAAc,cAAc,KAAK;AACnD,2BAAwB,UAAU;AAElC,aAAU,QAAQ,UAAU;AAC5B,qBAAkB,QAAQ,eAAe;AACzC,mBAAgB,UAAU;AAE1B,OAAI,QAAQ,CAAC,YAAY,IAAI,KAAK,EAAE;AAClC,gBAAY,IAAI,KAAK;AAChB,YAAQ,eAAe,YAAY;KAAE,MAAM;KAAM;KAAK,CAAC;;IAE9D;AAEF,eAAa;AACX,eAAY;;IAIb,EAAE,CAAC;AAGN,iBAAgB;AACd,MAAI,CAAC,UAAU,CAAC,eACd;EAGF,MAAM,OAAO,cAAc,OAAO;AAClC,kBAAgB,UAAU;AAE1B,MAAI,YAAY,IAAI,KAAK,CACvB;AAEF,cAAY,IAAI,KAAK;AAEhB,iBAAe,YAAY;GAAE,MAAM;GAAM,KAAK,cAAc;GAAK,CAAC;IACtE;EAAC;EAAQ,cAAc;EAAK;EAAe,CAAC;AAG/C,iBAAgB;AACd,MAAI,CAAC,UAAU,CAAC,cACd;EAGF,MAAM,EAAE,KAAK,GAAG,GAAG,iBAAiB;AACpC,MAAI,cAAc,wBAAwB,SAAS,aAAa,CAC9D;AAGF,SAAO,cAAc,cAAc,KAAK;AACxC,0BAAwB,UAAU;IACjC,CAAC,QAAQ,cAAc,CAAC;AAE3B,QAAO,SACH;EACE,GAAG;EACH;EACD,GACD,KAAA"}
|
package/dist/lazy-load.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ApiClientOptions } from '@scalar/api-client/modal';
|
|
2
2
|
/** Lazy load the client modal creator */
|
|
3
3
|
export declare const getClientModalCreator: () => Promise<({ el, eventBus, mountOnInitialize, plugins, workspaceStore, options, }: {
|
|
4
4
|
el: HTMLElement | null;
|
|
@@ -6,7 +6,7 @@ export declare const getClientModalCreator: () => Promise<({ el, eventBus, mount
|
|
|
6
6
|
eventBus?: import("@scalar/workspace-store/events").WorkspaceEventBus;
|
|
7
7
|
workspaceStore: import("@scalar/workspace-store/client").WorkspaceStore;
|
|
8
8
|
plugins?: import("@scalar/oas-utils/helpers").ClientPlugin[];
|
|
9
|
-
options?: import("vue").MaybeRefOrGetter<
|
|
9
|
+
options?: import("vue").MaybeRefOrGetter<ApiClientOptions>;
|
|
10
10
|
}) => import("@scalar/api-client/modal").ApiClientModal>;
|
|
11
11
|
/** Module-scoped singleton workspace store (lazy-loaded on first use). */
|
|
12
12
|
export declare const getWorkspaceStoreSingleton: () => Promise<import("@scalar/workspace-store/client").WorkspaceStore>;
|
|
@@ -20,7 +20,7 @@ export declare const getWorkspaceEventBusSingleton: () => Promise<import("@scala
|
|
|
20
20
|
* (`url`, `content`) must be registered via `workspaceStore.addDocument` after the client
|
|
21
21
|
* is ready — they are not part of the modal constructor.
|
|
22
22
|
*/
|
|
23
|
-
export declare const getOrCreateApiClient: (options?:
|
|
23
|
+
export declare const getOrCreateApiClient: (options?: ApiClientOptions | undefined) => Promise<{
|
|
24
24
|
apiClient: import("@scalar/api-client/modal").ApiClientModal;
|
|
25
25
|
workspaceStore: import("@scalar/workspace-store/client").WorkspaceStore;
|
|
26
26
|
}>;
|
package/dist/lazy-load.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy-load.d.ts","sourceRoot":"","sources":["../src/lazy-load.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"lazy-load.d.ts","sourceRoot":"","sources":["../src/lazy-load.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAsBhE,yCAAyC;AACzC,eAAO,MAAM,qBAAqB;;;;;;;wDAEjC,CAAA;AAED,0EAA0E;AAC1E,eAAO,MAAM,0BAA0B,wEAEtC,CAAA;AAED,8EAA8E;AAC9E,eAAO,MAAM,6BAA6B,2EAEzC,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB;;;EA0B/B,CAAA"}
|
package/dist/style.css
CHANGED
|
@@ -2564,8 +2564,8 @@
|
|
|
2564
2564
|
.scalar-app .left-2\.5 {
|
|
2565
2565
|
left: 10px;
|
|
2566
2566
|
}
|
|
2567
|
-
.scalar-app .left-
|
|
2568
|
-
left:
|
|
2567
|
+
.scalar-app .left-3 {
|
|
2568
|
+
left: 12px;
|
|
2569
2569
|
}
|
|
2570
2570
|
.scalar-app .left-border {
|
|
2571
2571
|
left: var(--scalar-border-width);
|
|
@@ -3616,6 +3616,9 @@
|
|
|
3616
3616
|
.scalar-app .top-4 {
|
|
3617
3617
|
top: 16px;
|
|
3618
3618
|
}
|
|
3619
|
+
.scalar-app .top-14 {
|
|
3620
|
+
top: 56px;
|
|
3621
|
+
}
|
|
3619
3622
|
.scalar-app .top-\[calc\(100\%\+4px\)\] {
|
|
3620
3623
|
top: calc(100% + 4px);
|
|
3621
3624
|
}
|
|
@@ -3661,8 +3664,8 @@
|
|
|
3661
3664
|
.scalar-app .left-2 {
|
|
3662
3665
|
left: 8px;
|
|
3663
3666
|
}
|
|
3664
|
-
.scalar-app .left-
|
|
3665
|
-
left:
|
|
3667
|
+
.scalar-app .left-4 {
|
|
3668
|
+
left: 16px;
|
|
3666
3669
|
}
|
|
3667
3670
|
.scalar-app .-z-1 {
|
|
3668
3671
|
z-index: calc(1 * -1);
|
|
@@ -3673,9 +3676,6 @@
|
|
|
3673
3676
|
.scalar-app .z-1 {
|
|
3674
3677
|
z-index: 1;
|
|
3675
3678
|
}
|
|
3676
|
-
.scalar-app .z-2 {
|
|
3677
|
-
z-index: 2;
|
|
3678
|
-
}
|
|
3679
3679
|
.scalar-app .z-10 {
|
|
3680
3680
|
z-index: 10;
|
|
3681
3681
|
z-index: 10;
|
|
@@ -3684,12 +3684,12 @@
|
|
|
3684
3684
|
z-index: 50;
|
|
3685
3685
|
z-index: 50;
|
|
3686
3686
|
}
|
|
3687
|
+
.scalar-app .z-60 {
|
|
3688
|
+
z-index: 60;
|
|
3689
|
+
}
|
|
3687
3690
|
.scalar-app .z-\[1\] {
|
|
3688
3691
|
z-index: 1;
|
|
3689
3692
|
}
|
|
3690
|
-
.scalar-app .z-\[60\] {
|
|
3691
|
-
z-index: 60;
|
|
3692
|
-
}
|
|
3693
3693
|
.scalar-app .z-context {
|
|
3694
3694
|
z-index: 1000;
|
|
3695
3695
|
}
|
|
@@ -4031,6 +4031,9 @@
|
|
|
4031
4031
|
.scalar-app .h-full {
|
|
4032
4032
|
height: 100%;
|
|
4033
4033
|
}
|
|
4034
|
+
.scalar-app .h-header {
|
|
4035
|
+
height: 48px;
|
|
4036
|
+
}
|
|
4034
4037
|
.scalar-app .h-min {
|
|
4035
4038
|
height: min-content;
|
|
4036
4039
|
}
|
|
@@ -5921,18 +5924,22 @@
|
|
|
5921
5924
|
position: absolute !important;
|
|
5922
5925
|
}
|
|
5923
5926
|
|
|
5924
|
-
.scalar-app .max-md\:fixed\! {
|
|
5925
|
-
position: fixed !important;
|
|
5926
|
-
}
|
|
5927
|
-
|
|
5928
5927
|
.scalar-app .max-md\:inset-y-0 {
|
|
5929
5928
|
inset-block: 0;
|
|
5930
5929
|
}
|
|
5931
5930
|
|
|
5931
|
+
.scalar-app .max-md\:top-4 {
|
|
5932
|
+
top: 16px;
|
|
5933
|
+
}
|
|
5934
|
+
|
|
5932
5935
|
.scalar-app .max-md\:z-2 {
|
|
5933
5936
|
z-index: 2;
|
|
5934
5937
|
}
|
|
5935
5938
|
|
|
5939
|
+
.scalar-app .max-md\:z-5 {
|
|
5940
|
+
z-index: 5;
|
|
5941
|
+
}
|
|
5942
|
+
|
|
5936
5943
|
.scalar-app .max-md\:flex\! {
|
|
5937
5944
|
display: flex !important;
|
|
5938
5945
|
}
|
|
@@ -5945,9 +5952,25 @@
|
|
|
5945
5952
|
width: 100% !important;
|
|
5946
5953
|
}
|
|
5947
5954
|
|
|
5955
|
+
.scalar-app .max-md\:pt-2 {
|
|
5956
|
+
padding-top: 8px;
|
|
5957
|
+
}
|
|
5958
|
+
|
|
5948
5959
|
.scalar-app .max-md\:pt-12 {
|
|
5949
5960
|
padding-top: 48px;
|
|
5950
5961
|
}
|
|
5962
|
+
|
|
5963
|
+
.scalar-app .max-md\:pl-4\! {
|
|
5964
|
+
padding-left: 16px !important;
|
|
5965
|
+
}
|
|
5966
|
+
|
|
5967
|
+
.scalar-app .max-md\:pl-10 {
|
|
5968
|
+
padding-left: 40px;
|
|
5969
|
+
}
|
|
5970
|
+
|
|
5971
|
+
.scalar-app .max-md\:pl-14 {
|
|
5972
|
+
padding-left: 56px;
|
|
5973
|
+
}
|
|
5951
5974
|
}
|
|
5952
5975
|
@media (min-width: 600px) {
|
|
5953
5976
|
.scalar-app .sm\:not-sr-only {
|
|
@@ -6298,23 +6321,23 @@
|
|
|
6298
6321
|
/*
|
|
6299
6322
|
Deep styling for customizing Codemirror
|
|
6300
6323
|
*/
|
|
6301
|
-
[data-v-
|
|
6324
|
+
[data-v-6499ec1f] .cm-editor {
|
|
6302
6325
|
height: 100%;
|
|
6303
6326
|
outline: none;
|
|
6304
6327
|
padding: 0;
|
|
6305
6328
|
background: transparent;
|
|
6306
6329
|
}
|
|
6307
|
-
[data-v-
|
|
6330
|
+
[data-v-6499ec1f] .cm-placeholder {
|
|
6308
6331
|
color: var(--scalar-color-3);
|
|
6309
6332
|
}
|
|
6310
|
-
[data-v-
|
|
6333
|
+
[data-v-6499ec1f] .cm-content {
|
|
6311
6334
|
font-family: var(--scalar-font-code);
|
|
6312
6335
|
font-size: var(--scalar-small);
|
|
6313
6336
|
max-height: 20px;
|
|
6314
6337
|
padding: 8px 0;
|
|
6315
6338
|
}
|
|
6316
6339
|
/* Tooltip helper */
|
|
6317
|
-
[data-v-
|
|
6340
|
+
[data-v-6499ec1f] .cm-tooltip {
|
|
6318
6341
|
background: transparent !important;
|
|
6319
6342
|
filter: brightness(var(--scalar-lifted-brightness));
|
|
6320
6343
|
border-radius: var(--scalar-radius);
|
|
@@ -6323,43 +6346,43 @@
|
|
|
6323
6346
|
outline: none !important;
|
|
6324
6347
|
overflow: hidden !important;
|
|
6325
6348
|
}
|
|
6326
|
-
[data-v-
|
|
6349
|
+
[data-v-6499ec1f] .cm-tooltip-autocomplete ul li {
|
|
6327
6350
|
padding: 3px 6px !important;
|
|
6328
6351
|
}
|
|
6329
|
-
[data-v-
|
|
6352
|
+
[data-v-6499ec1f] .cm-completionIcon-type:after {
|
|
6330
6353
|
color: var(--scalar-color-3) !important;
|
|
6331
6354
|
}
|
|
6332
|
-
[data-v-
|
|
6355
|
+
[data-v-6499ec1f] .cm-tooltip-autocomplete ul li[aria-selected] {
|
|
6333
6356
|
background: var(--scalar-background-2) !important;
|
|
6334
6357
|
color: var(--scalar-color-1) !important;
|
|
6335
6358
|
}
|
|
6336
|
-
[data-v-
|
|
6359
|
+
[data-v-6499ec1f] .cm-tooltip-autocomplete ul {
|
|
6337
6360
|
padding: 6px !important;
|
|
6338
6361
|
position: relative;
|
|
6339
6362
|
}
|
|
6340
|
-
[data-v-
|
|
6363
|
+
[data-v-6499ec1f] .cm-tooltip-autocomplete ul li:hover {
|
|
6341
6364
|
border-radius: 3px;
|
|
6342
6365
|
color: var(--scalar-color-1) !important;
|
|
6343
6366
|
background: var(--scalar-background-3) !important;
|
|
6344
6367
|
}
|
|
6345
6368
|
/* Disable active line highlighting */
|
|
6346
|
-
[data-v-
|
|
6369
|
+
[data-v-6499ec1f] .cm-activeLine,[data-v-6499ec1f] .cm-activeLineGutter {
|
|
6347
6370
|
background-color: transparent;
|
|
6348
6371
|
}
|
|
6349
6372
|
/* Color selection matching */
|
|
6350
|
-
[data-v-
|
|
6373
|
+
[data-v-6499ec1f] .cm-selectionMatch,[data-v-6499ec1f] .cm-matchingBracket {
|
|
6351
6374
|
border-radius: var(--scalar-radius);
|
|
6352
6375
|
background: var(--scalar-background-4) !important;
|
|
6353
6376
|
}
|
|
6354
6377
|
/* Color Picker Swatches */
|
|
6355
|
-
[data-v-
|
|
6378
|
+
[data-v-6499ec1f] .cm-css-color-picker-wrapper {
|
|
6356
6379
|
display: inline-flex;
|
|
6357
6380
|
outline: 1px solid var(--scalar-background-3);
|
|
6358
6381
|
border-radius: 3px;
|
|
6359
6382
|
overflow: hidden;
|
|
6360
6383
|
}
|
|
6361
6384
|
/* Number gutter */
|
|
6362
|
-
[data-v-
|
|
6385
|
+
[data-v-6499ec1f] .cm-gutters {
|
|
6363
6386
|
background-color: transparent;
|
|
6364
6387
|
border-right: none;
|
|
6365
6388
|
color: var(--scalar-color-3);
|
|
@@ -6367,7 +6390,7 @@
|
|
|
6367
6390
|
line-height: 22px;
|
|
6368
6391
|
border-radius: 0 0 0 3px;
|
|
6369
6392
|
}
|
|
6370
|
-
[data-v-
|
|
6393
|
+
[data-v-6499ec1f] .cm-gutters:before {
|
|
6371
6394
|
content: '';
|
|
6372
6395
|
position: absolute;
|
|
6373
6396
|
top: 2px;
|
|
@@ -6377,7 +6400,7 @@
|
|
|
6377
6400
|
border-radius: var(--scalar-radius) 0 0 var(--scalar-radius);
|
|
6378
6401
|
background-color: var(--scalar-background-1);
|
|
6379
6402
|
}
|
|
6380
|
-
[data-v-
|
|
6403
|
+
[data-v-6499ec1f] .cm-gutterElement {
|
|
6381
6404
|
font-family: var(--scalar-font-code) !important;
|
|
6382
6405
|
padding-left: 0px !important;
|
|
6383
6406
|
padding-right: 6px !important;
|
|
@@ -6386,16 +6409,16 @@
|
|
|
6386
6409
|
justify-content: flex-end;
|
|
6387
6410
|
position: relative;
|
|
6388
6411
|
}
|
|
6389
|
-
[data-v-
|
|
6412
|
+
[data-v-6499ec1f] .cm-lineNumbers .cm-gutterElement {
|
|
6390
6413
|
min-width: fit-content;
|
|
6391
6414
|
}
|
|
6392
|
-
[data-v-
|
|
6415
|
+
[data-v-6499ec1f] .cm-gutter + .cm-gutter :not(.cm-foldGutter) .cm-gutterElement {
|
|
6393
6416
|
padding-left: 0 !important;
|
|
6394
6417
|
}
|
|
6395
|
-
[data-v-
|
|
6418
|
+
[data-v-6499ec1f] .cm-scroller {
|
|
6396
6419
|
overflow: auto;
|
|
6397
6420
|
}
|
|
6398
|
-
.line-wrapping[data-v-
|
|
6421
|
+
.line-wrapping[data-v-6499ec1f]:focus-within .cm-content {
|
|
6399
6422
|
display: inline-table;
|
|
6400
6423
|
min-height: fit-content;
|
|
6401
6424
|
padding: 3px 6px;
|
|
@@ -6712,7 +6735,7 @@
|
|
|
6712
6735
|
var(--scalar-background-2) 20px
|
|
6713
6736
|
);
|
|
6714
6737
|
}
|
|
6715
|
-
[data-v-
|
|
6738
|
+
[data-v-06778e40] .cm-content {
|
|
6716
6739
|
font-size: var(--scalar-small);
|
|
6717
6740
|
}
|
|
6718
6741
|
.form-group[data-v-678c9f4a] {
|
|
@@ -6730,10 +6753,10 @@
|
|
|
6730
6753
|
-ms-overflow-style: none;
|
|
6731
6754
|
scrollbar-width: none;
|
|
6732
6755
|
}
|
|
6733
|
-
[data-v-
|
|
6756
|
+
[data-v-819cea32] .cm-editor {
|
|
6734
6757
|
padding: 0;
|
|
6735
6758
|
}
|
|
6736
|
-
[data-v-
|
|
6759
|
+
[data-v-819cea32] .cm-content {
|
|
6737
6760
|
align-items: center;
|
|
6738
6761
|
background-color: transparent;
|
|
6739
6762
|
display: flex;
|
|
@@ -6742,30 +6765,30 @@
|
|
|
6742
6765
|
padding: 5px 8px;
|
|
6743
6766
|
width: 100%;
|
|
6744
6767
|
}
|
|
6745
|
-
[data-v-
|
|
6768
|
+
[data-v-819cea32] .cm-content:has(.cm-pill) {
|
|
6746
6769
|
padding: 5px 8px;
|
|
6747
6770
|
}
|
|
6748
|
-
[data-v-
|
|
6771
|
+
[data-v-819cea32] .cm-content .cm-pill:not(:last-of-type) {
|
|
6749
6772
|
margin-right: 0.5px;
|
|
6750
6773
|
}
|
|
6751
|
-
[data-v-
|
|
6774
|
+
[data-v-819cea32] .cm-content .cm-pill:not(:first-of-type) {
|
|
6752
6775
|
margin-left: 0.5px;
|
|
6753
6776
|
}
|
|
6754
|
-
[data-v-
|
|
6777
|
+
[data-v-819cea32] .cm-line {
|
|
6755
6778
|
overflow: hidden;
|
|
6756
6779
|
padding: 0;
|
|
6757
6780
|
text-overflow: ellipsis;
|
|
6758
6781
|
word-break: break-word;
|
|
6759
6782
|
}
|
|
6760
|
-
.required[data-v-
|
|
6783
|
+
.required[data-v-819cea32]::after {
|
|
6761
6784
|
content: 'Required';
|
|
6762
6785
|
}
|
|
6763
6786
|
/* Tailwind placeholder is busted */
|
|
6764
|
-
input[data-v-
|
|
6787
|
+
input[data-v-819cea32]::placeholder {
|
|
6765
6788
|
color: var(--scalar-color-3);
|
|
6766
6789
|
}
|
|
6767
6790
|
/* we want our inputs to look like a password input but not be one */
|
|
6768
|
-
.scalar-password-input[data-v-
|
|
6791
|
+
.scalar-password-input[data-v-819cea32] {
|
|
6769
6792
|
text-security: disc;
|
|
6770
6793
|
-webkit-text-security: disc;
|
|
6771
6794
|
-moz-text-security: disc;
|
|
@@ -6910,33 +6933,33 @@ to {
|
|
|
6910
6933
|
transform: translateY(0);
|
|
6911
6934
|
}
|
|
6912
6935
|
}
|
|
6913
|
-
.request-card[data-v-
|
|
6936
|
+
.request-card[data-v-59da314d] {
|
|
6914
6937
|
font-size: var(--scalar-font-size-3);
|
|
6915
6938
|
}
|
|
6916
|
-
.request-method[data-v-
|
|
6939
|
+
.request-method[data-v-59da314d] {
|
|
6917
6940
|
font-family: var(--scalar-font-code);
|
|
6918
6941
|
text-transform: uppercase;
|
|
6919
6942
|
margin-right: 6px;
|
|
6920
6943
|
}
|
|
6921
|
-
.request-card-footer[data-v-
|
|
6944
|
+
.request-card-footer[data-v-59da314d] {
|
|
6922
6945
|
display: flex;
|
|
6923
6946
|
justify-content: flex-end;
|
|
6924
6947
|
padding: 6px;
|
|
6925
6948
|
flex-shrink: 0;
|
|
6926
6949
|
position: relative;
|
|
6927
6950
|
}
|
|
6928
|
-
.request-card-footer-addon[data-v-
|
|
6951
|
+
.request-card-footer-addon[data-v-59da314d] {
|
|
6929
6952
|
display: flex;
|
|
6930
6953
|
align-items: center;
|
|
6931
6954
|
|
|
6932
6955
|
flex: 1;
|
|
6933
6956
|
min-width: 0;
|
|
6934
6957
|
}
|
|
6935
|
-
.request-editor-section[data-v-
|
|
6958
|
+
.request-editor-section[data-v-59da314d] {
|
|
6936
6959
|
display: flex;
|
|
6937
6960
|
flex: 1;
|
|
6938
6961
|
}
|
|
6939
|
-
.request-card-simple[data-v-
|
|
6962
|
+
.request-card-simple[data-v-59da314d] {
|
|
6940
6963
|
display: flex;
|
|
6941
6964
|
align-items: center;
|
|
6942
6965
|
justify-content: space-between;
|
|
@@ -6945,7 +6968,7 @@ to {
|
|
|
6945
6968
|
|
|
6946
6969
|
font-size: var(--scalar-small);
|
|
6947
6970
|
}
|
|
6948
|
-
.code-snippet[data-v-
|
|
6971
|
+
.code-snippet[data-v-59da314d] {
|
|
6949
6972
|
display: flex;
|
|
6950
6973
|
flex-direction: column;
|
|
6951
6974
|
width: 100%;
|
|
@@ -6994,27 +7017,27 @@ to {
|
|
|
6994
7017
|
.dark-mode .download-app-button[data-v-9b609275]:hover {
|
|
6995
7018
|
background: linear-gradient(rgba(0, 0, 0, 0.15), rgba(255, 255, 255, 0.1));
|
|
6996
7019
|
}
|
|
6997
|
-
.empty-sidebar-item-content[data-v-
|
|
7020
|
+
.empty-sidebar-item-content[data-v-8269f62b] {
|
|
6998
7021
|
display: none;
|
|
6999
7022
|
}
|
|
7000
|
-
.empty-sidebar-item .empty-sidebar-item-content[data-v-
|
|
7023
|
+
.empty-sidebar-item .empty-sidebar-item-content[data-v-8269f62b] {
|
|
7001
7024
|
display: block;
|
|
7002
7025
|
}
|
|
7003
|
-
.rabbitjump[data-v-
|
|
7026
|
+
.rabbitjump[data-v-8269f62b] {
|
|
7004
7027
|
opacity: 0;
|
|
7005
7028
|
}
|
|
7006
|
-
.empty-sidebar-item:hover .rabbitjump[data-v-
|
|
7029
|
+
.empty-sidebar-item:hover .rabbitjump[data-v-8269f62b] {
|
|
7007
7030
|
opacity: 1;
|
|
7008
|
-
animation: rabbitAnimation-
|
|
7031
|
+
animation: rabbitAnimation-8269f62b 0.5s steps(1) infinite;
|
|
7009
7032
|
}
|
|
7010
|
-
.empty-sidebar-item:hover .rabbitsit[data-v-
|
|
7033
|
+
.empty-sidebar-item:hover .rabbitsit[data-v-8269f62b] {
|
|
7011
7034
|
opacity: 0;
|
|
7012
|
-
animation: rabbitAnimation2-
|
|
7035
|
+
animation: rabbitAnimation2-8269f62b 0.5s steps(1) infinite;
|
|
7013
7036
|
}
|
|
7014
|
-
.empty-sidebar-item:hover .rabbit-ascii[data-v-
|
|
7015
|
-
animation: rabbitRun-
|
|
7037
|
+
.empty-sidebar-item:hover .rabbit-ascii[data-v-8269f62b] {
|
|
7038
|
+
animation: rabbitRun-8269f62b 8s infinite linear;
|
|
7016
7039
|
}
|
|
7017
|
-
@keyframes rabbitRun-
|
|
7040
|
+
@keyframes rabbitRun-8269f62b {
|
|
7018
7041
|
0% {
|
|
7019
7042
|
transform: translate3d(0, 0, 0);
|
|
7020
7043
|
}
|
|
@@ -7034,7 +7057,7 @@ to {
|
|
|
7034
7057
|
transform: translate3d(0, 0, 0);
|
|
7035
7058
|
}
|
|
7036
7059
|
}
|
|
7037
|
-
@keyframes rabbitAnimation-
|
|
7060
|
+
@keyframes rabbitAnimation-8269f62b {
|
|
7038
7061
|
0%,
|
|
7039
7062
|
100% {
|
|
7040
7063
|
opacity: 1;
|
|
@@ -7043,7 +7066,7 @@ to {
|
|
|
7043
7066
|
opacity: 0;
|
|
7044
7067
|
}
|
|
7045
7068
|
}
|
|
7046
|
-
@keyframes rabbitAnimation2-
|
|
7069
|
+
@keyframes rabbitAnimation2-8269f62b {
|
|
7047
7070
|
0%,
|
|
7048
7071
|
100% {
|
|
7049
7072
|
opacity: 0;
|
|
@@ -7400,15 +7423,15 @@ to {
|
|
|
7400
7423
|
.full-size-styles:has(.sync-conflict-modal-root)::after {
|
|
7401
7424
|
display: none;
|
|
7402
7425
|
}
|
|
7403
|
-
.scalar-collection-auth[data-v-
|
|
7426
|
+
.scalar-collection-auth[data-v-d3bc49bd] {
|
|
7404
7427
|
border: var(--scalar-border-width) solid var(--scalar-border-color);
|
|
7405
7428
|
border-radius: var(--scalar-radius-lg);
|
|
7406
7429
|
overflow: hidden;
|
|
7407
7430
|
}
|
|
7408
|
-
[data-v-
|
|
7431
|
+
[data-v-2f13118d] .cm-editor {
|
|
7409
7432
|
padding: 0;
|
|
7410
7433
|
}
|
|
7411
|
-
[data-v-
|
|
7434
|
+
[data-v-2f13118d] .cm-content {
|
|
7412
7435
|
align-items: center;
|
|
7413
7436
|
background-color: transparent;
|
|
7414
7437
|
display: flex;
|
|
@@ -7417,16 +7440,16 @@ to {
|
|
|
7417
7440
|
padding: 5px 8px;
|
|
7418
7441
|
width: 100%;
|
|
7419
7442
|
}
|
|
7420
|
-
[data-v-
|
|
7443
|
+
[data-v-2f13118d] .cm-content:has(.cm-pill) {
|
|
7421
7444
|
padding: 5px 8px;
|
|
7422
7445
|
}
|
|
7423
|
-
[data-v-
|
|
7446
|
+
[data-v-2f13118d] .cm-content .cm-pill:not(:last-of-type) {
|
|
7424
7447
|
margin-right: 0.5px;
|
|
7425
7448
|
}
|
|
7426
|
-
[data-v-
|
|
7449
|
+
[data-v-2f13118d] .cm-content .cm-pill:not(:first-of-type) {
|
|
7427
7450
|
margin-left: 0.5px;
|
|
7428
7451
|
}
|
|
7429
|
-
[data-v-
|
|
7452
|
+
[data-v-2f13118d] .cm-line {
|
|
7430
7453
|
overflow: hidden;
|
|
7431
7454
|
padding: 0;
|
|
7432
7455
|
text-overflow: ellipsis;
|
package/dist/use-api-client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ApiClientModal,
|
|
1
|
+
import type { ApiClientModal, ApiClientOptions, RoutePayload } from '@scalar/api-client/modal';
|
|
2
2
|
import './style.css';
|
|
3
|
-
export type ApiClientConfigurationReact =
|
|
3
|
+
export type ApiClientConfigurationReact = ApiClientOptions & {
|
|
4
4
|
url: string;
|
|
5
5
|
};
|
|
6
6
|
export type UseApiClientModalProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-api-client.d.ts","sourceRoot":"","sources":["../src/use-api-client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"use-api-client.d.ts","sourceRoot":"","sources":["../src/use-api-client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAG9F,OAAO,aAAa,CAAA;AAWpB,MAAM,MAAM,2BAA2B,GAAG,gBAAgB,GAAG;IAE3D,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,+DAA+D;IAC/D,aAAa,EAAE,2BAA2B,CAAA;CAC3C,CAAA;AAKD;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,GAAI,oBAE1B,sBAAsB,KAAG,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,GAAG;IAAE,IAAI,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAA;CAAE,CAAC,GAAG,SAoFxG,CAAA"}
|
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"testing",
|
|
20
20
|
"react"
|
|
21
21
|
],
|
|
22
|
-
"version": "2.0.
|
|
22
|
+
"version": "2.0.5",
|
|
23
23
|
"engines": {
|
|
24
24
|
"node": ">=22"
|
|
25
25
|
},
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"CHANGELOG.md"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@scalar/
|
|
43
|
-
"@scalar/
|
|
44
|
-
"@scalar/
|
|
42
|
+
"@scalar/api-client": "3.2.1",
|
|
43
|
+
"@scalar/workspace-store": "0.46.2",
|
|
44
|
+
"@scalar/helpers": "0.5.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@testing-library/dom": "^10.4.1",
|