@superinterface/react 2.6.1 → 2.7.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/dist/index.cjs CHANGED
@@ -461,12 +461,10 @@ var useSuperinterfaceContext = function() {
461
461
  // src/components/core/SuperinterfaceProvider/index.tsx
462
462
  var import_jsx_runtime = require("react/jsx-runtime");
463
463
  var SuperinterfaceProvider = function(param) {
464
- var children = param.children, baseUrl2 = param.baseUrl, publicApiKey = param.publicApiKey, variables = param.variables, defaultOptions = param.defaultOptions, threadIdCookieOptions = param.threadIdCookieOptions;
464
+ var children = param.children, baseUrl2 = param.baseUrl, variables = param.variables, defaultOptions = param.defaultOptions, threadIdCookieOptions = param.threadIdCookieOptions;
465
465
  var superinterfaceContext = useSuperinterfaceContext();
466
466
  var value = merge(superinterfaceContext, _object_spread({}, baseUrl2 ? {
467
467
  baseUrl: baseUrl2
468
- } : {}, publicApiKey ? {
469
- publicApiKey: publicApiKey
470
468
  } : {}, variables ? {
471
469
  variables: variables
472
470
  } : {}, defaultOptions ? {
@@ -525,11 +523,7 @@ var queryOptions = function(param) {
525
523
  })));
526
524
  return [
527
525
  2,
528
- fetch("".concat(superinterfaceContext.baseUrl).concat(path, "?").concat(params), _object_spread({}, superinterfaceContext.publicApiKey ? {
529
- headers: {
530
- Authorization: "Bearer ".concat(superinterfaceContext.publicApiKey)
531
- }
532
- } : {})).then(function() {
526
+ fetch("".concat(superinterfaceContext.baseUrl).concat(path, "?").concat(params)).then(function() {
533
527
  var _ref = _async_to_generator(function(response) {
534
528
  var errorResponse, error;
535
529
  return _ts_generator(this, function(_state) {
@@ -2148,17 +2142,13 @@ var mutationFn = function(param) {
2148
2142
  case 0:
2149
2143
  return [
2150
2144
  4,
2151
- fetch("".concat(superinterfaceContext.baseUrl, "/messages"), _object_spread({
2145
+ fetch("".concat(superinterfaceContext.baseUrl, "/messages"), {
2152
2146
  method: "POST",
2153
2147
  body: JSON.stringify(body({
2154
2148
  variables: variables,
2155
2149
  superinterfaceContext: superinterfaceContext
2156
2150
  }))
2157
- }, superinterfaceContext.publicApiKey ? {
2158
- headers: {
2159
- Authorization: "Bearer ".concat(superinterfaceContext.publicApiKey)
2160
- }
2161
- } : {}))
2151
+ })
2162
2152
  ];
2163
2153
  case 1:
2164
2154
  response = _state.sent();
@@ -3142,10 +3132,8 @@ var useMessageAudio = function(param) {
3142
3132
  });
3143
3133
  var searchParams = new URLSearchParams(_object_spread({
3144
3134
  input: firstUnplayedMessageSentence.sentence
3145
- }, isHtmlAudioSupported && superinterfaceContext.publicApiKey ? {
3146
- publicApiKey: superinterfaceContext.publicApiKey
3147
- } : {}));
3148
- audioPlayer.load("".concat(superinterfaceContext.baseUrl, "/tts?").concat(searchParams), _object_spread({
3135
+ }, superinterfaceContext.variables));
3136
+ audioPlayer.load("".concat(superinterfaceContext.baseUrl, "/tts?").concat(searchParams), {
3149
3137
  format: "mp3",
3150
3138
  autoplay: true,
3151
3139
  html5: isHtmlAudioSupported,
@@ -3155,13 +3143,7 @@ var useMessageAudio = function(param) {
3155
3143
  onEnd();
3156
3144
  }
3157
3145
  }
3158
- }, isHtmlAudioSupported ? {} : {
3159
- xhr: _object_spread({}, superinterfaceContext.publicApiKey ? {
3160
- headers: {
3161
- Authorization: "Bearer ".concat(superinterfaceContext.publicApiKey)
3162
- }
3163
- } : {})
3164
- }));
3146
+ });
3165
3147
  }, [
3166
3148
  unplayedMessageSentences,
3167
3149
  isPlaying,