@scalar/api-client 0.9.3 → 0.10.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 0.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - dccb83ab: feat: add default state for api client collapsed panels
8
+
9
+ ## 0.9.4
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [3d712d74]
14
+ - @scalar/use-codemirror@0.7.20
15
+
3
16
  ## 0.9.3
4
17
 
5
18
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/ApiClient/Request/RequestBody.vue.ts"],"names":[],"mappings":";;;;;;;AAkIA,wBASG;AAGH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC"}
1
+ {"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/ApiClient/Request/RequestBody.vue.ts"],"names":[],"mappings":";;;;;;;AAmIA,wBASG;AAGH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RequestCookies.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/ApiClient/Request/RequestCookies.vue.ts"],"names":[],"mappings":";;;;;AA4IA,wBAMG;AAGH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC"}
1
+ {"version":3,"file":"RequestCookies.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/ApiClient/Request/RequestCookies.vue.ts"],"names":[],"mappings":";;;;;AA6IA,wBAMG;AAGH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RequestHeaders.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/ApiClient/Request/RequestHeaders.vue.ts"],"names":[],"mappings":";;;;;AA4IA,wBAMG;AAGH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC"}
1
+ {"version":3,"file":"RequestHeaders.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/ApiClient/Request/RequestHeaders.vue.ts"],"names":[],"mappings":";;;;;AA6IA,wBAMG;AAGH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RequestQuery.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/ApiClient/Request/RequestQuery.vue.ts"],"names":[],"mappings":";;;;;AA6IA,wBAMG;AAGH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC"}
1
+ {"version":3,"file":"RequestQuery.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/ApiClient/Request/RequestQuery.vue.ts"],"names":[],"mappings":";;;;;AA8IA,wBAMG;AAGH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RequestVariables.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/ApiClient/Request/RequestVariables.vue.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;;;;;;AA0InD,wBAMG;AAGH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC"}
1
+ {"version":3,"file":"RequestVariables.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/ApiClient/Request/RequestVariables.vue.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;;;;;;AA2InD,wBAMG;AAGH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC"}
@@ -1,8 +1,16 @@
1
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
1
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
2
2
  title?: string | undefined;
3
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
3
+ defaultOpen?: boolean | undefined;
4
+ }>, {
5
+ defaultOpen: boolean;
6
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
4
7
  title?: string | undefined;
5
- }>>>, {}, {}>, {
8
+ defaultOpen?: boolean | undefined;
9
+ }>, {
10
+ defaultOpen: boolean;
11
+ }>>>, {
12
+ defaultOpen: boolean;
13
+ }, {}>, {
6
14
  options?(_: {}): any;
7
15
  default?(_: {}): any;
8
16
  }>;
@@ -16,6 +24,14 @@ type __VLS_TypePropsToRuntimeProps<T> = {
16
24
  required: true;
17
25
  };
18
26
  };
27
+ type __VLS_WithDefaults<P, D> = {
28
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
29
+ default: D[K];
30
+ }> : P[K];
31
+ };
32
+ type __VLS_Prettify<T> = {
33
+ [K in keyof T]: T[K];
34
+ } & {};
19
35
  type __VLS_WithTemplateSlots<T, S> = T & {
20
36
  new (): {
21
37
  $slots: S;
@@ -1 +1 @@
1
- {"version":3,"file":"CollapsibleSection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CollapsibleSection/CollapsibleSection.vue.ts"],"names":[],"mappings":";;;;;;;;AAwLA,wBAAwG;AAGxG,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
1
+ {"version":3,"file":"CollapsibleSection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CollapsibleSection/CollapsibleSection.vue.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAgOA,wBAAwG;AAGxG,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACxE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AACN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AACxD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
package/dist/index.js CHANGED
@@ -14001,7 +14001,7 @@ function scaleBlock(block, scaler) {
14001
14001
  return new BlockInfo(block.from, block.length, bTop, bBottom - bTop, Array.isArray(block._content) ? block._content.map((b) => scaleBlock(b, scaler)) : block._content);
14002
14002
  }
14003
14003
  const theme = /* @__PURE__ */ Facet.define({ combine: (strs) => strs.join(" ") });
14004
- const darkTheme$1 = /* @__PURE__ */ Facet.define({ combine: (values2) => values2.indexOf(true) > -1 });
14004
+ const darkTheme = /* @__PURE__ */ Facet.define({ combine: (values2) => values2.indexOf(true) > -1 });
14005
14005
  const baseThemeID = /* @__PURE__ */ StyleModule.newName(), baseLightID = /* @__PURE__ */ StyleModule.newName(), baseDarkID = /* @__PURE__ */ StyleModule.newName();
14006
14006
  const lightDarkIDs = { "&light": "." + baseLightID, "&dark": "." + baseDarkID };
14007
14007
  function buildTheme(main, spec, scopes) {
@@ -15329,7 +15329,7 @@ class EditorView {
15329
15329
  Get the CSS classes for the currently active editor themes.
15330
15330
  */
15331
15331
  get themeClasses() {
15332
- return baseThemeID + " " + (this.state.facet(darkTheme$1) ? baseDarkID : baseLightID) + " " + this.state.facet(theme);
15332
+ return baseThemeID + " " + (this.state.facet(darkTheme) ? baseDarkID : baseLightID) + " " + this.state.facet(theme);
15333
15333
  }
15334
15334
  updateAttrs() {
15335
15335
  let editorAttrs = attrsFromFacet(this, editorAttributes, {
@@ -15765,7 +15765,7 @@ class EditorView {
15765
15765
  let prefix = StyleModule.newName();
15766
15766
  let result = [theme.of(prefix), styleModule.of(buildTheme(`.${prefix}`, spec))];
15767
15767
  if (options && options.dark)
15768
- result.push(darkTheme$1.of(true));
15768
+ result.push(darkTheme.of(true));
15769
15769
  return result;
15770
15770
  }
15771
15771
  /**
@@ -15803,7 +15803,7 @@ EditorView.decorations = decorations;
15803
15803
  EditorView.atomicRanges = atomicRanges;
15804
15804
  EditorView.bidiIsolatedRanges = bidiIsolatedRanges;
15805
15805
  EditorView.scrollMargins = scrollMargins;
15806
- EditorView.darkTheme = darkTheme$1;
15806
+ EditorView.darkTheme = darkTheme;
15807
15807
  EditorView.cspNonce = /* @__PURE__ */ Facet.define({ combine: (values2) => values2.length ? values2[0] : "" });
15808
15808
  EditorView.contentAttributes = contentAttributes;
15809
15809
  EditorView.editorAttributes = editorAttributes;
@@ -24756,7 +24756,7 @@ var createTheme = (_ref) => {
24756
24756
  var extension = [themeExtension, syntaxHighlighting(highlightStyle)];
24757
24757
  return extension;
24758
24758
  };
24759
- const lightTheme = createTheme({
24759
+ const customTheme = createTheme({
24760
24760
  theme: "light",
24761
24761
  settings: {
24762
24762
  background: "var(--theme-background-2, var(--default-theme-background-2))",
@@ -24842,95 +24842,8 @@ const lightTheme = createTheme({
24842
24842
  }
24843
24843
  ]
24844
24844
  });
24845
- const darkTheme = createTheme({
24846
- theme: "dark",
24847
- settings: {
24848
- background: "var(--theme-background-2, var(--default-theme-background-2))",
24849
- foreground: "var(--theme-color-1, var(--default-theme-color-1))",
24850
- caret: "var(--theme-color-1, var(--default-theme-color-1))",
24851
- selection: "var(--theme-background-3, var(--default-theme-background-3))",
24852
- selectionMatch: "#e3dcce",
24853
- gutterBackground: "var(--theme-background-2, var(--default-theme-background-2))",
24854
- gutterForeground: "var(--theme-color-3, var(--default-theme-color-3))",
24855
- gutterBorder: "transparent",
24856
- lineHighlight: "var(--theme-background-3, var(--default-theme-background-3))",
24857
- fontFamily: "var(--theme-font-code, var(--default-theme-font-code))"
24858
- },
24859
- styles: [
24860
- {
24861
- tag: [tags$1.standard(tags$1.tagName), tags$1.tagName],
24862
- color: "var(--theme-color-purple, var(--default-theme-color-purple))"
24863
- },
24864
- {
24865
- tag: [tags$1.comment],
24866
- color: "var(--theme-color-3, var(--default-theme-color-3))"
24867
- },
24868
- {
24869
- tag: [tags$1.className],
24870
- color: "var(--theme-color-orange, var(--default-theme-color-orange))"
24871
- },
24872
- {
24873
- tag: [tags$1.variableName, tags$1.propertyName, tags$1.attributeName],
24874
- color: "var(--theme-color-1, var(--default-theme-color-1))"
24875
- },
24876
- {
24877
- tag: [tags$1.operator],
24878
- color: "var(--theme-color-2, var(--default-theme-color-2))"
24879
- },
24880
- {
24881
- tag: [tags$1.keyword, tags$1.typeName, tags$1.typeOperator],
24882
- color: "var(--theme-color-green, var(--default-theme-color-green))"
24883
- },
24884
- {
24885
- tag: [tags$1.string],
24886
- color: "var(--theme-color-blue, var(--default-theme-color-blue))"
24887
- },
24888
- {
24889
- tag: [tags$1.bracket, tags$1.regexp, tags$1.meta],
24890
- color: "var(--theme-color-3, var(--default-theme-color-3))"
24891
- },
24892
- {
24893
- tag: [tags$1.number],
24894
- color: "var(--theme-color-blue, var(--default-theme-color-blue))"
24895
- },
24896
- {
24897
- tag: [tags$1.name, tags$1.quote],
24898
- color: "var(--theme-color-3, var(--default-theme-color-3))"
24899
- },
24900
- {
24901
- tag: [tags$1.heading],
24902
- color: "var(--theme-color-3, var(--default-theme-color-3))",
24903
- fontWeight: "bold"
24904
- },
24905
- {
24906
- tag: [tags$1.emphasis],
24907
- color: "var(--theme-color-3, var(--default-theme-color-3))",
24908
- fontStyle: "italic"
24909
- },
24910
- {
24911
- tag: [tags$1.deleted],
24912
- color: "var(--theme-color-3, var(--default-theme-color-3))",
24913
- backgroundColor: "transparent"
24914
- },
24915
- {
24916
- tag: [tags$1.atom, tags$1.bool, tags$1.special(tags$1.variableName)],
24917
- color: "var(--theme-color-3, var(--default-theme-color-3))"
24918
- },
24919
- {
24920
- tag: [tags$1.url, tags$1.escape, tags$1.regexp, tags$1.link],
24921
- color: "var(--theme-color-1, var(--default-theme-color-1))"
24922
- },
24923
- { tag: tags$1.link, textDecoration: "underline" },
24924
- { tag: tags$1.strikethrough, textDecoration: "line-through" },
24925
- {
24926
- tag: tags$1.invalid,
24927
- color: "var(--theme-color-3, var(--default-theme-color-3))"
24928
- }
24929
- ]
24930
- });
24931
- const isDark = ref(false);
24932
24845
  const useCodeMirror = (parameters) => {
24933
- const { extensions, content: content2, forceDarkMode, forceLightMode, withoutTheme } = parameters;
24846
+ const { extensions, content: content2, withoutTheme } = parameters;
24934
24847
  const value = ref(content2 ?? "");
24935
24848
  const codeMirrorRef = ref(null);
24936
24849
  const codeMirror = ref(null);
@@ -24950,55 +24863,20 @@ const useCodeMirror = (parameters) => {
24950
24863
  codeMirror.value = new EditorView(configuration);
24951
24864
  }
24952
24865
  };
24953
- const getCurrentTheme = () => {
24954
- if (withoutTheme) {
24955
- return null;
24956
- }
24957
- if (forceDarkMode) {
24958
- return darkTheme;
24959
- }
24960
- if (forceLightMode) {
24961
- return lightTheme;
24962
- }
24963
- if (isDark.value) {
24964
- return darkTheme;
24965
- }
24966
- return lightTheme;
24967
- };
24968
24866
  const addDefaultExtensions = (newExtensions = []) => {
24969
- const selectAllKeyBinding = {
24970
- key: "Mod-a",
24971
- run: (view) => {
24972
- view.dispatch({
24973
- selection: { anchor: 0, head: view.state.doc.length },
24974
- scrollIntoView: false
24975
- });
24976
- return true;
24977
- }
24978
- };
24979
24867
  const defaultExtensions = [
24980
- EditorView.theme(
24981
- {
24982
- ".cm-line": {
24983
- lineHeight: "20px"
24984
- },
24985
- ".cm-gutterElement": {
24986
- lineHeight: "20px"
24987
- }
24868
+ withoutTheme ? null : customTheme,
24869
+ EditorView.theme({
24870
+ ".cm-line": {
24871
+ lineHeight: "20px"
24988
24872
  },
24989
- { dark: forceDarkMode ? false : isDark.value }
24990
- ),
24991
- keymap.of([selectAllKeyBinding]),
24992
- getCurrentTheme()
24873
+ ".cm-gutterElement": {
24874
+ lineHeight: "20px"
24875
+ }
24876
+ })
24993
24877
  ].filter((extension) => extension !== null);
24994
24878
  return [...defaultExtensions, newExtensions];
24995
24879
  };
24996
- watch(isDark, () => {
24997
- const { extensions: configuredExtensions } = parameters;
24998
- if (!forceDarkMode) {
24999
- reconfigureCodeMirror(configuredExtensions);
25000
- }
25001
- });
25002
24880
  const destroyCodeMirror = () => {
25003
24881
  var _a2;
25004
24882
  (_a2 = codeMirror.value) == null ? void 0 : _a2.destroy();
@@ -25110,8 +24988,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
25110
24988
  withVariables: { type: Boolean },
25111
24989
  lineNumbers: { type: Boolean },
25112
24990
  withoutTheme: { type: Boolean },
25113
- disableEnter: { type: Boolean, default: false },
25114
- forceDarkMode: { type: Boolean, default: false }
24991
+ disableEnter: { type: Boolean, default: false }
25115
24992
  },
25116
24993
  emits: ["change"],
25117
24994
  setup(__props, { expose: __expose, emit }) {
@@ -25207,8 +25084,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
25207
25084
  } = useCodeMirror({
25208
25085
  content: props.content ?? "",
25209
25086
  extensions: getCodeMirrorExtensions(),
25210
- withoutTheme: props.withoutTheme,
25211
- forceDarkMode: props.forceDarkMode
25087
+ withoutTheme: props.withoutTheme
25212
25088
  });
25213
25089
  watch(
25214
25090
  () => props.content,
@@ -25225,7 +25101,6 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
25225
25101
  watch(
25226
25102
  [
25227
25103
  () => props.disableEnter,
25228
- () => props.forceDarkMode,
25229
25104
  () => props.languages,
25230
25105
  () => props.lineNumbers,
25231
25106
  () => props.readOnly,
@@ -26978,16 +26853,39 @@ const _hoisted_4$5 = { class: "scalar-api-client__item__content" };
26978
26853
  const _sfc_main$j = /* @__PURE__ */ defineComponent({
26979
26854
  __name: "CollapsibleSection",
26980
26855
  props: {
26981
- title: {}
26856
+ title: {},
26857
+ defaultOpen: { type: Boolean, default: true }
26982
26858
  },
26983
26859
  setup(__props) {
26860
+ const props = __props;
26861
+ const collapseButton = ref(null);
26862
+ const disclosureButton = ref(null);
26863
+ const openCopy = ref(props.defaultOpen);
26864
+ watch(
26865
+ () => props.defaultOpen,
26866
+ (newValue, oldValue) => {
26867
+ var _a2;
26868
+ if (newValue !== oldValue && newValue !== openCopy.value) {
26869
+ (_a2 = collapseButton.value) == null ? void 0 : _a2.el.click();
26870
+ }
26871
+ }
26872
+ );
26984
26873
  return (_ctx, _cache) => {
26985
- return openBlock(), createBlock(unref(Disclosure), { defaultOpen: true }, {
26874
+ return openBlock(), createBlock(unref(Disclosure), {
26875
+ ref_key: "disclosureButton",
26876
+ ref: disclosureButton,
26877
+ defaultOpen: _ctx.defaultOpen
26878
+ }, {
26986
26879
  default: withCtx(({ open }) => [
26987
26880
  createElementVNode("div", {
26988
26881
  class: normalizeClass(["scalar-api-client__item", { "scalar-api-client__item--open": open }])
26989
26882
  }, [
26990
- createVNode(unref(DisclosureButton), { class: "scalar-api-client__toggle" }, {
26883
+ createVNode(unref(DisclosureButton), {
26884
+ ref_key: "collapseButton",
26885
+ ref: collapseButton,
26886
+ class: "scalar-api-client__toggle",
26887
+ onClick: _cache[0] || (_cache[0] = ($event) => openCopy.value = !openCopy.value)
26888
+ }, {
26991
26889
  default: withCtx(() => [
26992
26890
  _hoisted_1$h,
26993
26891
  createElementVNode("span", _hoisted_2$b, toDisplayString(_ctx.title), 1),
@@ -26996,7 +26894,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
26996
26894
  ])) : createCommentVNode("", true)
26997
26895
  ]),
26998
26896
  _: 2
26999
- }, 1024),
26897
+ }, 1536),
27000
26898
  createVNode(unref(DisclosurePanel), null, {
27001
26899
  default: withCtx(() => [
27002
26900
  createElementVNode("div", _hoisted_4$5, [
@@ -27008,7 +26906,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
27008
26906
  ], 2)
27009
26907
  ]),
27010
26908
  _: 3
27011
- });
26909
+ }, 8, ["defaultOpen"]);
27012
26910
  };
27013
26911
  }
27014
26912
  });
@@ -27612,7 +27510,10 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
27612
27510
  (_a2 = activeRequest2.cookies) == null ? void 0 : _a2.push({ name: "", value: "", enabled: true });
27613
27511
  }
27614
27512
  return (_ctx, _cache) => {
27615
- return openBlock(), createBlock(unref(_sfc_main$j), { title: "Cookies" }, {
27513
+ return openBlock(), createBlock(unref(_sfc_main$j), {
27514
+ defaultOpen: unref(activeRequest2).cookies && unref(activeRequest2).cookies.length > 0,
27515
+ title: "Cookies"
27516
+ }, {
27616
27517
  default: withCtx(() => [
27617
27518
  !_ctx.cookies || _ctx.cookies.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_1$c, [
27618
27519
  createElementVNode("button", {
@@ -27632,7 +27533,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
27632
27533
  }, null, 8, ["items"]))
27633
27534
  ]),
27634
27535
  _: 1
27635
- });
27536
+ }, 8, ["defaultOpen"]);
27636
27537
  };
27637
27538
  }
27638
27539
  });
@@ -27677,7 +27578,10 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
27677
27578
  (_a2 = activeRequest2.headers) == null ? void 0 : _a2.push({ name: "", value: "", enabled: true });
27678
27579
  }
27679
27580
  return (_ctx, _cache) => {
27680
- return openBlock(), createBlock(unref(_sfc_main$j), { title: "Headers" }, {
27581
+ return openBlock(), createBlock(unref(_sfc_main$j), {
27582
+ defaultOpen: unref(activeRequest2).headers && unref(activeRequest2).headers.length > 0,
27583
+ title: "Headers"
27584
+ }, {
27681
27585
  default: withCtx(() => [
27682
27586
  !_ctx.headers || _ctx.headers.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
27683
27587
  createElementVNode("button", {
@@ -27697,7 +27601,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
27697
27601
  }, null, 8, ["items"]))
27698
27602
  ]),
27699
27603
  _: 1
27700
- });
27604
+ }, 8, ["defaultOpen"]);
27701
27605
  };
27702
27606
  }
27703
27607
  });
@@ -27742,7 +27646,10 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
27742
27646
  (_a2 = activeRequest2.query) == null ? void 0 : _a2.push({ name: "", value: "", enabled: true });
27743
27647
  }
27744
27648
  return (_ctx, _cache) => {
27745
- return openBlock(), createBlock(unref(_sfc_main$j), { title: "Query Parameters" }, {
27649
+ return openBlock(), createBlock(unref(_sfc_main$j), {
27650
+ defaultOpen: unref(activeRequest2).query && unref(activeRequest2).query.length > 0,
27651
+ title: "Query Parameters"
27652
+ }, {
27746
27653
  default: withCtx(() => [
27747
27654
  !_ctx.queries || _ctx.queries.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_1$a, [
27748
27655
  createElementVNode("button", {
@@ -27762,7 +27669,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
27762
27669
  }, null, 8, ["items"]))
27763
27670
  ]),
27764
27671
  _: 1
27765
- });
27672
+ }, 8, ["defaultOpen"]);
27766
27673
  };
27767
27674
  }
27768
27675
  });
@@ -27806,7 +27713,10 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
27806
27713
  (_a2 = activeRequest2.variables) == null ? void 0 : _a2.push({ name: "", value: "", enabled: true });
27807
27714
  }
27808
27715
  return (_ctx, _cache) => {
27809
- return openBlock(), createBlock(unref(_sfc_main$j), { title: "Variables" }, {
27716
+ return openBlock(), createBlock(unref(_sfc_main$j), {
27717
+ defaultOpen: unref(activeRequest2).variables && unref(activeRequest2).variables.length > 0,
27718
+ title: "Variables"
27719
+ }, {
27810
27720
  default: withCtx(() => [
27811
27721
  !_ctx.variables || _ctx.variables.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_1$9, [
27812
27722
  createElementVNode("button", {
@@ -27826,7 +27736,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
27826
27736
  }, null, 8, ["items"]))
27827
27737
  ]),
27828
27738
  _: 1
27829
- });
27739
+ }, 8, ["defaultOpen"]);
27830
27740
  };
27831
27741
  }
27832
27742
  });
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "rest",
14
14
  "testing"
15
15
  ],
16
- "version": "0.9.3",
16
+ "version": "0.10.0",
17
17
  "engines": {
18
18
  "node": ">=18"
19
19
  },
@@ -44,7 +44,7 @@
44
44
  "pretty-ms": "^8.0.0",
45
45
  "vue": "^3.3.0",
46
46
  "@scalar/themes": "0.5.4",
47
- "@scalar/use-codemirror": "0.7.19",
47
+ "@scalar/use-codemirror": "0.7.20",
48
48
  "@scalar/use-keyboard-event": "0.5.8",
49
49
  "@scalar/use-modal": "0.2.3"
50
50
  },