@scalar/api-client-react 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,11 @@
1
- import type { ApiClientModal, RoutePayload } from '@scalar/api-client/v2/features/modal';
2
- import type { ApiClientConfiguration } from '@scalar/types/api-reference';
1
+ import type { ApiClientModal, ApiClientModalOptions, RoutePayload } from '@scalar/api-client/modal';
3
2
  import './style.css';
4
- /** We don't really need all of the content types so we just accept an object instead */
5
- export type ApiClientConfigurationReact = Partial<Omit<ApiClientConfiguration, 'content' | 'url'> & {
6
- content?: Record<string, unknown>;
7
- url?: string;
8
- }>;
3
+ export type ApiClientConfigurationReact = ApiClientModalOptions & {
4
+ url: string;
5
+ };
9
6
  export type UseApiClientModalProps = {
10
7
  /** Configuration for the Api Client (url or inline content) */
11
- configuration?: ApiClientConfigurationReact;
8
+ configuration: ApiClientConfigurationReact;
12
9
  };
13
10
  /**
14
11
  * Returns the singleton Api Client
@@ -20,7 +17,7 @@ export type UseApiClientModalProps = {
20
17
  * Subsequent calls from any component share the same instance of the client but can use the same
21
18
  * or different documents
22
19
  */
23
- export declare const useApiClient: ({ configuration, }?: UseApiClientModalProps) => (Omit<ApiClientModal, "open"> & {
20
+ export declare const useApiClient: ({ configuration, }: UseApiClientModalProps) => (Omit<ApiClientModal, "open"> & {
24
21
  open: (payload: RoutePayload) => void;
25
22
  }) | undefined;
26
23
  //# sourceMappingURL=use-api-client.d.ts.map
@@ -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,YAAY,EAAE,MAAM,sCAAsC,CAAA;AACxF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAGzE,OAAO,aAAa,CAAA;AAUpB,wFAAwF;AACxF,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAC/C,IAAI,CAAC,sBAAsB,EAAE,SAAS,GAAG,KAAK,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CACtG,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,+DAA+D;IAC/D,aAAa,CAAC,EAAE,2BAA2B,CAAA;CAC5C,CAAA;AAKD;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,GAAI,qBAE1B,sBAA2B,KAC1B,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,GAAG;IAAE,IAAI,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAA;CAAE,CAAC,GAC1E,SAsEH,CAAA"}
1
+ {"version":3,"file":"use-api-client.d.ts","sourceRoot":"","sources":["../src/use-api-client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGnG,OAAO,aAAa,CAAA;AAWpB,MAAM,MAAM,2BAA2B,GAAG,qBAAqB,GAAG;IAEhE,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.0",
22
+ "version": "2.0.2",
23
23
  "engines": {
24
24
  "node": ">=22"
25
25
  },
@@ -39,9 +39,9 @@
39
39
  "CHANGELOG.md"
40
40
  ],
41
41
  "dependencies": {
42
- "@scalar/workspace-store": "0.44.0",
43
- "@scalar/api-client": "2.42.0",
44
- "@scalar/types": "0.8.0"
42
+ "@scalar/helpers": "0.5.0",
43
+ "@scalar/workspace-store": "0.46.0",
44
+ "@scalar/api-client": "3.0.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@testing-library/dom": "^10.4.1",