@scalar/api-client 0.11.0 → 0.11.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 0.11.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [b1f3cb49]
8
+ - @scalar/use-codemirror@0.8.1
9
+
3
10
  ## 0.11.0
4
11
 
5
12
  ### Minor Changes
package/dist/index.js CHANGED
@@ -25720,7 +25720,7 @@ const variables = () => ViewPlugin.fromClass(
25720
25720
  )
25721
25721
  }
25722
25722
  );
25723
- const hasProvider = (params) => "provider" in params;
25723
+ const hasProvider = (params) => "provider" in params && !!toValue(params.provider);
25724
25724
  const useCodeMirror = (params) => {
25725
25725
  const codeMirror = ref(null);
25726
25726
  watch(
@@ -25739,8 +25739,6 @@ const useCodeMirror = (params) => {
25739
25739
  function mountCodeMirror() {
25740
25740
  if (params.codeMirrorRef.value) {
25741
25741
  const extensions = getCodeMirrorExtensions(extensionConfig.value);
25742
- if (hasProvider(params))
25743
- extensions.push(params.provider);
25744
25742
  codeMirror.value = new EditorView({
25745
25743
  parent: params.codeMirrorRef.value,
25746
25744
  extensions
@@ -25757,7 +25755,9 @@ const useCodeMirror = (params) => {
25757
25755
  lineNumbers: toValue(params.lineNumbers),
25758
25756
  withVariables: toValue(params.withVariables),
25759
25757
  disableEnter: toValue(params.withVariables),
25760
- withoutTheme: toValue(params.withoutTheme)
25758
+ withoutTheme: toValue(params.withoutTheme),
25759
+ additionalExtensions: toValue(params.extensions),
25760
+ provider: hasProvider(params) ? toValue(params.provider) : null
25761
25761
  }));
25762
25762
  watch(
25763
25763
  extensionConfig,
@@ -25765,8 +25765,6 @@ const useCodeMirror = (params) => {
25765
25765
  if (!codeMirror.value)
25766
25766
  return;
25767
25767
  const extensions = getCodeMirrorExtensions(extensionConfig.value);
25768
- if (hasProvider(params))
25769
- extensions.push(params.provider);
25770
25768
  codeMirror.value.dispatch({
25771
25769
  effects: StateEffect.reconfigure.of(extensions)
25772
25770
  });
@@ -25830,13 +25828,15 @@ const syntaxHighlighting = {
25830
25828
  };
25831
25829
  function getCodeMirrorExtensions({
25832
25830
  onChange,
25831
+ provider,
25833
25832
  languages = [],
25834
25833
  classes = [],
25835
25834
  readOnly: readOnly2 = false,
25836
25835
  lineNumbers: lineNumbers$1 = false,
25837
25836
  withVariables = false,
25838
25837
  disableEnter = false,
25839
- withoutTheme = false
25838
+ withoutTheme = false,
25839
+ additionalExtensions = []
25840
25840
  }) {
25841
25841
  const extensions = [
25842
25842
  EditorView.theme({
@@ -25854,8 +25854,11 @@ function getCodeMirrorExtensions({
25854
25854
  onChange == null ? void 0 : onChange(v.state.doc.toString());
25855
25855
  }),
25856
25856
  // Add Classes
25857
- EditorView.editorAttributes.of({ class: classes.join(" ") })
25857
+ EditorView.editorAttributes.of({ class: classes.join(" ") }),
25858
+ ...additionalExtensions
25858
25859
  ];
25860
+ if (provider)
25861
+ extensions.push(provider);
25859
25862
  if (!withoutTheme)
25860
25863
  extensions.push(customTheme);
25861
25864
  if (readOnly2)
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "rest",
14
14
  "testing"
15
15
  ],
16
- "version": "0.11.0",
16
+ "version": "0.11.1",
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.8.0",
47
+ "@scalar/use-codemirror": "0.8.1",
48
48
  "@scalar/use-keyboard-event": "0.5.8",
49
49
  "@scalar/use-modal": "0.2.3"
50
50
  },
@@ -57,7 +57,7 @@
57
57
  "vite-plugin-css-injected-by-js": "^3.3.0",
58
58
  "vitest": "^0.34.4",
59
59
  "vue-tsc": "^1.8.19",
60
- "@scalar/api-client-proxy": "0.5.14",
60
+ "@scalar/api-client-proxy": "0.5.15",
61
61
  "@scalar/echo-server": "0.5.8"
62
62
  },
63
63
  "peerDependencies": {