@scalar/api-client-react 1.0.1 → 1.0.3
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 +15 -0
- package/dist/ApiClientModalProvider.js +33 -0
- package/dist/index.js +3 -658
- package/dist/style.css +1 -1
- package/package.json +5 -3
- package/dist/index.cjs +0 -30
package/dist/index.cjs
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";var vr=Object.create;var Oe=Object.defineProperty;var pr=Object.getOwnPropertyDescriptor;var _r=Object.getOwnPropertyNames;var gr=Object.getPrototypeOf,yr=Object.prototype.hasOwnProperty;var br=(d,f,v,y)=>{if(f&&typeof f=="object"||typeof f=="function")for(let E of _r(f))!yr.call(d,E)&&E!==v&&Oe(d,E,{get:()=>f[E],enumerable:!(y=pr(f,E))||y.enumerable});return d};var Er=(d,f,v)=>(v=d!=null?vr(gr(d)):{},br(f||!d||!d.__esModule?Oe(v,"default",{value:d,enumerable:!0}):v,d));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react");var Q={exports:{}},W={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Se;function hr(){if(Se)return W;Se=1;var d=C,f=Symbol.for("react.element"),v=Symbol.for("react.fragment"),y=Object.prototype.hasOwnProperty,E=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,j={key:!0,ref:!0,__self:!0,__source:!0};function O(h,c,x){var b,T={},S=null,Y=null;x!==void 0&&(S=""+x),c.key!==void 0&&(S=""+c.key),c.ref!==void 0&&(Y=c.ref);for(b in c)y.call(c,b)&&!j.hasOwnProperty(b)&&(T[b]=c[b]);if(h&&h.defaultProps)for(b in c=h.defaultProps,c)T[b]===void 0&&(T[b]=c[b]);return{$$typeof:f,type:h,key:S,ref:Y,props:T,_owner:E.current}}return W.Fragment=v,W.jsx=O,W.jsxs=O,W}var $={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Pe;function Rr(){return Pe||(Pe=1,process.env.NODE_ENV!=="production"&&function(){var d=C,f=Symbol.for("react.element"),v=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),O=Symbol.for("react.provider"),h=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),ee=Symbol.iterator,xe="@@iterator";function ke(e){if(e===null||typeof e!="object")return null;var r=ee&&e[ee]||e[xe];return typeof r=="function"?r:null}var k=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function p(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Ae("error",e,t)}}function Ae(e,r,t){{var n=k.ReactDebugCurrentFrame,o=n.getStackAddendum();o!==""&&(r+="%s",t=t.concat([o]));var u=t.map(function(i){return String(i)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var De=!1,Fe=!1,Ie=!1,Me=!1,We=!1,re;re=Symbol.for("react.module.reference");function $e(e){return!!(typeof e=="string"||typeof e=="function"||e===y||e===j||We||e===E||e===x||e===b||Me||e===Y||De||Fe||Ie||typeof e=="object"&&e!==null&&(e.$$typeof===S||e.$$typeof===T||e.$$typeof===O||e.$$typeof===h||e.$$typeof===c||e.$$typeof===re||e.getModuleId!==void 0))}function Ye(e,r,t){var n=e.displayName;if(n)return n;var o=r.displayName||r.name||"";return o!==""?t+"("+o+")":t}function te(e){return e.displayName||"Context"}function m(e){if(e==null)return null;if(typeof e.tag=="number"&&p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case y:return"Fragment";case v:return"Portal";case j:return"Profiler";case E:return"StrictMode";case x:return"Suspense";case b:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case h:var r=e;return te(r)+".Consumer";case O:var t=e;return te(t._context)+".Provider";case c:return Ye(e,e.render,"ForwardRef");case T:var n=e.displayName||null;return n!==null?n:m(e.type)||"Memo";case S:{var o=e,u=o._payload,i=o._init;try{return m(i(u))}catch{return null}}}return null}var P=Object.assign,F=0,ne,ae,ie,oe,ue,se,le;function fe(){}fe.__reactDisabledLog=!0;function Ve(){{if(F===0){ne=console.log,ae=console.info,ie=console.warn,oe=console.error,ue=console.group,se=console.groupCollapsed,le=console.groupEnd;var e={configurable:!0,enumerable:!0,value:fe,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}F++}}function Le(){{if(F--,F===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:P({},e,{value:ne}),info:P({},e,{value:ae}),warn:P({},e,{value:ie}),error:P({},e,{value:oe}),group:P({},e,{value:ue}),groupCollapsed:P({},e,{value:se}),groupEnd:P({},e,{value:le})})}F<0&&p("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var J=k.ReactCurrentDispatcher,q;function V(e,r,t){{if(q===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);q=n&&n[1]||""}return`
|
|
18
|
-
`+q+e}}var B=!1,L;{var Ue=typeof WeakMap=="function"?WeakMap:Map;L=new Ue}function ce(e,r){if(!e||B)return"";{var t=L.get(e);if(t!==void 0)return t}var n;B=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=J.current,J.current=null,Ve();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(g){n=g}Reflect.construct(e,[],i)}else{try{i.call()}catch(g){n=g}e.call(i.prototype)}}else{try{throw Error()}catch(g){n=g}e()}}catch(g){if(g&&n&&typeof g.stack=="string"){for(var a=g.stack.split(`
|
|
19
|
-
`),_=n.stack.split(`
|
|
20
|
-
`),s=a.length-1,l=_.length-1;s>=1&&l>=0&&a[s]!==_[l];)l--;for(;s>=1&&l>=0;s--,l--)if(a[s]!==_[l]){if(s!==1||l!==1)do if(s--,l--,l<0||a[s]!==_[l]){var R=`
|
|
21
|
-
`+a[s].replace(" at new "," at ");return e.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",e.displayName)),typeof e=="function"&&L.set(e,R),R}while(s>=1&&l>=0);break}}}finally{B=!1,J.current=u,Le(),Error.prepareStackTrace=o}var D=e?e.displayName||e.name:"",w=D?V(D):"";return typeof e=="function"&&L.set(e,w),w}function Ne(e,r,t){return ce(e,!1)}function Je(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function U(e,r,t){if(e==null)return"";if(typeof e=="function")return ce(e,Je(e));if(typeof e=="string")return V(e);switch(e){case x:return V("Suspense");case b:return V("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case c:return Ne(e.render);case T:return U(e.type,r,t);case S:{var n=e,o=n._payload,u=n._init;try{return U(u(o),r,t)}catch{}}}return""}var I=Object.prototype.hasOwnProperty,de={},ve=k.ReactDebugCurrentFrame;function N(e){if(e){var r=e._owner,t=U(e.type,e._source,r?r.type:null);ve.setExtraStackFrame(t)}else ve.setExtraStackFrame(null)}function qe(e,r,t,n,o){{var u=Function.call.bind(I);for(var i in e)if(u(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var _=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw _.name="Invariant Violation",_}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(s){a=s}a&&!(a instanceof Error)&&(N(o),p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof a),N(null)),a instanceof Error&&!(a.message in de)&&(de[a.message]=!0,N(o),p("Failed %s type: %s",t,a.message),N(null))}}}var Be=Array.isArray;function K(e){return Be(e)}function Ke(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Ge(e){try{return pe(e),!1}catch{return!0}}function pe(e){return""+e}function _e(e){if(Ge(e))return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ke(e)),pe(e)}var M=k.ReactCurrentOwner,ze={key:!0,ref:!0,__self:!0,__source:!0},ge,ye,G;G={};function He(e){if(I.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Xe(e){if(I.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Ze(e,r){if(typeof e.ref=="string"&&M.current&&r&&M.current.stateNode!==r){var t=m(M.current.type);G[t]||(p('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',m(M.current.type),e.ref),G[t]=!0)}}function Qe(e,r){{var t=function(){ge||(ge=!0,p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function er(e,r){{var t=function(){ye||(ye=!0,p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var rr=function(e,r,t,n,o,u,i){var a={$$typeof:f,type:e,key:r,ref:t,props:i,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function tr(e,r,t,n,o){{var u,i={},a=null,_=null;t!==void 0&&(_e(t),a=""+t),Xe(r)&&(_e(r.key),a=""+r.key),He(r)&&(_=r.ref,Ze(r,o));for(u in r)I.call(r,u)&&!ze.hasOwnProperty(u)&&(i[u]=r[u]);if(e&&e.defaultProps){var s=e.defaultProps;for(u in s)i[u]===void 0&&(i[u]=s[u])}if(a||_){var l=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&Qe(i,l),_&&er(i,l)}return rr(e,a,_,o,n,M.current,i)}}var z=k.ReactCurrentOwner,be=k.ReactDebugCurrentFrame;function A(e){if(e){var r=e._owner,t=U(e.type,e._source,r?r.type:null);be.setExtraStackFrame(t)}else be.setExtraStackFrame(null)}var H;H=!1;function X(e){return typeof e=="object"&&e!==null&&e.$$typeof===f}function Ee(){{if(z.current){var e=m(z.current.type);if(e)return`
|
|
22
|
-
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function nr(e){return""}var he={};function ar(e){{var r=Ee();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
24
|
-
|
|
25
|
-
Check the top-level render call using <`+t+">.")}return r}}function Re(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ar(r);if(he[t])return;he[t]=!0;var n="";e&&e._owner&&e._owner!==z.current&&(n=" It was passed a child from "+m(e._owner.type)+"."),A(e),p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),A(null)}}function me(e,r){{if(typeof e!="object")return;if(K(e))for(var t=0;t<e.length;t++){var n=e[t];X(n)&&Re(n,r)}else if(X(e))e._store&&(e._store.validated=!0);else if(e){var o=ke(e);if(typeof o=="function"&&o!==e.entries)for(var u=o.call(e),i;!(i=u.next()).done;)X(i.value)&&Re(i.value,r)}}}function ir(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===c||r.$$typeof===T))t=r.propTypes;else return;if(t){var n=m(r);qe(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!H){H=!0;var o=m(r);p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function or(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){A(e),p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),A(null);break}}e.ref!==null&&(A(e),p("Invalid attribute `ref` supplied to `React.Fragment`."),A(null))}}var Te={};function Ce(e,r,t,n,o,u){{var i=$e(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var _=nr();_?a+=_:a+=Ee();var s;e===null?s="null":K(e)?s="array":e!==void 0&&e.$$typeof===f?(s="<"+(m(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,a)}var l=tr(e,r,t,o,u);if(l==null)return l;if(i){var R=r.children;if(R!==void 0)if(n)if(K(R)){for(var D=0;D<R.length;D++)me(R[D],e);Object.freeze&&Object.freeze(R)}else p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else me(R,e)}if(I.call(r,"key")){var w=m(e),g=Object.keys(r).filter(function(dr){return dr!=="key"}),Z=g.length>0?"{key: someKey, "+g.join(": ..., ")+": ...}":"{key: someKey}";if(!Te[w+Z]){var cr=g.length>0?"{"+g.join(": ..., ")+": ...}":"{}";p(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
-
let props = %s;
|
|
27
|
-
<%s {...props} />
|
|
28
|
-
React keys must be passed directly to JSX without using spread:
|
|
29
|
-
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,Z,w,cr,w),Te[w+Z]=!0}}return e===y?or(l):ir(l),l}}function ur(e,r,t){return Ce(e,r,t,!0)}function sr(e,r,t){return Ce(e,r,t,!1)}var lr=sr,fr=ur;$.Fragment=y,$.jsx=lr,$.jsxs=fr}()),$}process.env.NODE_ENV==="production"?Q.exports=hr():Q.exports=Rr();var we=Q.exports;const je=C.createContext(null);globalThis.__VUE_OPTIONS_API__=!0;globalThis.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__=!0;globalThis.__VUE_PROD_DEVTOOLS__=!1;const mr=({children:d,configuration:f={}})=>{const v=C.useRef(null),[y,E]=C.useState(null),[j,O]=C.useState(null);return C.useEffect(()=>{(async()=>{const{createApiClientModalSync:c}=await import("@scalar/api-client");E(()=>c)})()},[]),C.useEffect(()=>{if(!(v!=null&&v.current)||!y)return;const h=y(v.current,f,!0,!0);return O(h),f.spec&&h.updateSpec(f.spec),()=>{h.app.unmount(),O(null)}},[v,y]),we.jsxs(je.Provider,{value:j,children:[we.jsx("div",{ref:v}),d]})},Tr=()=>C.useContext(je);exports.ApiClientModalProvider=mr;exports.useApiClientModal=Tr;
|