jsxc-react-hook 0.0.6 → 0.0.7
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/jsxc-react-hook.js +255 -604
- package/dist/jsxc-react-hook.umd.cjs +7 -15
- package/package.json +3 -3
- package/src/Sel.tsx +2 -2
- package/src/lib/assets/.fuse_hidden00043c3c00000004 +2 -0
- package/src/main.tsx +0 -1
- package/vite.config.ts +1 -1
@@ -1,30 +1,22 @@
|
|
1
|
-
(function(
|
1
|
+
(function(l,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],b):(l=typeof globalThis<"u"?globalThis:l||self,b(l["jsxc-react-hook"]={},l.React))})(this,function(l,b){"use strict";var C={exports:{}},x={};/**
|
2
2
|
* @license React
|
3
|
-
* react-jsx-runtime.production.
|
3
|
+
* react-jsx-runtime.production.js
|
4
4
|
*
|
5
|
-
* Copyright (c)
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
6
6
|
*
|
7
7
|
* This source code is licensed under the MIT license found in the
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
9
|
-
*/var
|
9
|
+
*/var J;function Z(){if(J)return x;J=1;var s=Symbol.for("react.transitional.element"),m=Symbol.for("react.fragment");function d(f,a,c){var E=null;if(c!==void 0&&(E=""+c),a.key!==void 0&&(E=""+a.key),"key"in a){c={};for(var w in a)w!=="key"&&(c[w]=a[w])}else c=a;return a=c.ref,{$$typeof:s,type:f,key:E,ref:a!==void 0?a:null,props:c}}return x.Fragment=m,x.jsx=d,x.jsxs=d,x}var y={};/**
|
10
10
|
* @license React
|
11
11
|
* react-jsx-runtime.development.js
|
12
12
|
*
|
13
|
-
* Copyright (c)
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
14
14
|
*
|
15
15
|
* This source code is licensed under the MIT license found in the
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
17
|
-
*/var
|
18
|
-
`+re+e}}var te=!1,z;{var qe=typeof WeakMap=="function"?WeakMap:Map;z=new qe}function Re(e,r){if(!e||te)return"";{var t=z.get(e);if(t!==void 0)return t}var n;te=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=ee.current,ee.current=null,Be();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(p){n=p}Reflect.construct(e,[],o)}else{try{o.call()}catch(p){n=p}e.call(o.prototype)}}else{try{throw Error()}catch(p){n=p}e()}}catch(p){if(p&&n&&typeof p.stack=="string"){for(var a=p.stack.split(`
|
19
|
-
`),v=n.stack.split(`
|
20
|
-
`),u=a.length-1,l=v.length-1;u>=1&&l>=0&&a[u]!==v[l];)l--;for(;u>=1&&l>=0;u--,l--)if(a[u]!==v[l]){if(u!==1||l!==1)do if(u--,l--,l<0||a[u]!==v[l]){var h=`
|
21
|
-
`+a[u].replace(" at new "," at ");return e.displayName&&h.includes("<anonymous>")&&(h=h.replace("<anonymous>",e.displayName)),typeof e=="function"&&z.set(e,h),h}while(u>=1&&l>=0);break}}}finally{te=!1,ee.current=s,Je(),Error.prepareStackTrace=i}var Y=e?e.displayName||e.name:"",k=Y?K(Y):"";return typeof e=="function"&&z.set(e,k),k}function Ke(e,r,t){return Re(e,!1)}function ze(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function G(e,r,t){if(e==null)return"";if(typeof e=="function")return Re(e,ze(e));if(typeof e=="string")return K(e);switch(e){case R:return K("Suspense");case d:return K("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return Ke(e.render);case y:return G(e.type,r,t);case _:{var n=e,i=n._payload,s=n._init;try{return G(s(i),r,t)}catch{}}}return""}var U=Object.prototype.hasOwnProperty,_e={},we=C.ReactDebugCurrentFrame;function X(e){if(e){var r=e._owner,t=G(e.type,e._source,r?r.type:null);we.setExtraStackFrame(t)}else we.setExtraStackFrame(null)}function Ge(e,r,t,n,i){{var s=Function.call.bind(U);for(var o in e)if(s(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var v=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw v.name="Invariant Violation",v}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(u){a=u}a&&!(a instanceof Error)&&(X(i),c("%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,o,typeof a),X(null)),a instanceof Error&&!(a.message in _e)&&(_e[a.message]=!0,X(i),c("Failed %s type: %s",t,a.message),X(null))}}}var Xe=Array.isArray;function ne(e){return Xe(e)}function He(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Ze(e){try{return je(e),!1}catch{return!0}}function je(e){return""+e}function xe(e){if(Ze(e))return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",He(e)),je(e)}var V=C.ReactCurrentOwner,Qe={key:!0,ref:!0,__self:!0,__source:!0},Te,Ce,ae;ae={};function er(e){if(U.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function rr(e){if(U.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function tr(e,r){if(typeof e.ref=="string"&&V.current&&r&&V.current.stateNode!==r){var t=m(V.current.type);ae[t]||(c('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(V.current.type),e.ref),ae[t]=!0)}}function nr(e,r){{var t=function(){Te||(Te=!0,c("%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 ar(e,r){{var t=function(){Ce||(Ce=!0,c("%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 or=function(e,r,t,n,i,s,o){var a={$$typeof:x,type:e,key:r,ref:t,props:o,_owner:s};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:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function ir(e,r,t,n,i){{var s,o={},a=null,v=null;t!==void 0&&(xe(t),a=""+t),rr(r)&&(xe(r.key),a=""+r.key),er(r)&&(v=r.ref,tr(r,i));for(s in r)U.call(r,s)&&!Qe.hasOwnProperty(s)&&(o[s]=r[s]);if(e&&e.defaultProps){var u=e.defaultProps;for(s in u)o[s]===void 0&&(o[s]=u[s])}if(a||v){var l=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&nr(o,l),v&&ar(o,l)}return or(e,a,v,i,n,V.current,o)}}var oe=C.ReactCurrentOwner,Oe=C.ReactDebugCurrentFrame;function W(e){if(e){var r=e._owner,t=G(e.type,e._source,r?r.type:null);Oe.setExtraStackFrame(t)}else Oe.setExtraStackFrame(null)}var ie;ie=!1;function se(e){return typeof e=="object"&&e!==null&&e.$$typeof===x}function Pe(){{if(oe.current){var e=m(oe.current.type);if(e)return`
|
22
|
-
|
23
|
-
Check the render method of \``+e+"`."}return""}}function sr(e){return""}var Se={};function ur(e){{var r=Pe();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 ke(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ur(r);if(Se[t])return;Se[t]=!0;var n="";e&&e._owner&&e._owner!==oe.current&&(n=" It was passed a child from "+m(e._owner.type)+"."),W(e),c('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),W(null)}}function Ae(e,r){{if(typeof e!="object")return;if(ne(e))for(var t=0;t<e.length;t++){var n=e[t];se(n)&&ke(n,r)}else if(se(e))e._store&&(e._store.validated=!0);else if(e){var i=Q(e);if(typeof i=="function"&&i!==e.entries)for(var s=i.call(e),o;!(o=s.next()).done;)se(o.value)&&ke(o.value,r)}}}function cr(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===f||r.$$typeof===y))t=r.propTypes;else return;if(t){var n=m(r);Ge(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!ie){ie=!0;var i=m(r);c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function lr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){W(e),c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),W(null);break}}e.ref!==null&&(W(e),c("Invalid attribute `ref` supplied to `React.Fragment`."),W(null))}}var De={};function Fe(e,r,t,n,i,s){{var o=Ve(e);if(!o){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 v=sr();v?a+=v:a+=Pe();var u;e===null?u="null":ne(e)?u="array":e!==void 0&&e.$$typeof===x?(u="<"+(m(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):u=typeof e,c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",u,a)}var l=ir(e,r,t,i,s);if(l==null)return l;if(o){var h=r.children;if(h!==void 0)if(n)if(ne(h)){for(var Y=0;Y<h.length;Y++)Ae(h[Y],e);Object.freeze&&Object.freeze(h)}else c("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 Ae(h,e)}if(U.call(r,"key")){var k=m(e),p=Object.keys(r).filter(function(yr){return yr!=="key"}),ue=p.length>0?"{key: someKey, "+p.join(": ..., ")+": ...}":"{key: someKey}";if(!De[k+ue]){var hr=p.length>0?"{"+p.join(": ..., ")+": ...}":"{}";c(`A props object containing a "key" prop is being spread into JSX:
|
17
|
+
*/var $;function Q(){return $||($=1,process.env.NODE_ENV!=="production"&&function(){function s(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case W:return"Profiler";case I:return"StrictMode";case S:return"Suspense";case te:return"SuspenseList";case ne:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case Y:return"Portal";case v:return(e.displayName||"Context")+".Provider";case g:return(e._context.displayName||"Context")+".Consumer";case i:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case re:return t=e.displayName||null,t!==null?t:s(e.type)||"Memo";case z:t=e._payload,e=e._init;try{return s(e(t))}catch{}}return null}function m(e){return""+e}function d(e){try{m(e);var t=!1}catch{t=!0}if(t){t=console;var r=t.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),m(e)}}function f(e){if(e===T)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===z)return"<...>";try{var t=s(e);return t?"<"+t+">":"<...>"}catch{return"<...>"}}function a(){var e=D.A;return e===null?null:e.getOwner()}function c(){return Error("react-stack-top-frame")}function E(e){if(q.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function w(e,t){function r(){V||(V=!0,console.error("%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://react.dev/link/special-props)",t))}r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}function N(){var e=s(this.type);return B[e]||(B[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function k(e,t,r,n,p,u,L,M){return r=u.ref,e={$$typeof:j,type:e,key:t,props:u,_owner:p},(r!==void 0?r:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:N}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:L}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:M}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function P(e,t,r,n,p,u,L,M){var o=t.children;if(o!==void 0)if(n)if(ae(o)){for(n=0;n<o.length;n++)O(o[n]);Object.freeze&&Object.freeze(o)}else console.error("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 O(o);if(q.call(t,"key")){o=s(e);var R=Object.keys(t).filter(function(se){return se!=="key"});n=0<R.length?"{key: someKey, "+R.join(": ..., ")+": ...}":"{key: someKey}",H[o+n]||(R=0<R.length?"{"+R.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
26
18
|
let props = %s;
|
27
19
|
<%s {...props} />
|
28
20
|
React keys must be passed directly to JSX without using spread:
|
29
21
|
let props = %s;
|
30
|
-
<%s key={someKey} {...props} />`,
|
22
|
+
<%s key={someKey} {...props} />`,n,o,R,o),H[o+n]=!0)}if(o=null,r!==void 0&&(d(r),o=""+r),E(t)&&(d(t.key),o=""+t.key),"key"in t){r={};for(var U in t)U!=="key"&&(r[U]=t[U])}else r=t;return o&&w(r,typeof e=="function"?e.displayName||e.name||"Unknown":e),k(e,o,u,p,a(),r,L,M)}function O(e){typeof e=="object"&&e!==null&&e.$$typeof===j&&e._store&&(e._store.validated=1)}var h=b,j=Symbol.for("react.transitional.element"),Y=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),W=Symbol.for("react.profiler"),g=Symbol.for("react.consumer"),v=Symbol.for("react.context"),i=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),re=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),ne=Symbol.for("react.activity"),oe=Symbol.for("react.client.reference"),D=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=Object.prototype.hasOwnProperty,ae=Array.isArray,F=console.createTask?console.createTask:function(){return null};h={"react-stack-bottom-frame":function(e){return e()}};var V,B={},G=h["react-stack-bottom-frame"].bind(h,c)(),X=F(f(c)),H={};y.Fragment=T,y.jsx=function(e,t,r,n,p){var u=1e4>D.recentlyCreatedOwnerStacks++;return P(e,t,r,!1,n,p,u?Error("react-stack-top-frame"):G,u?F(f(e)):X)},y.jsxs=function(e,t,r,n,p){var u=1e4>D.recentlyCreatedOwnerStacks++;return P(e,t,r,!0,n,p,u?Error("react-stack-top-frame"):G,u?F(f(e)):X)}}()),y}process.env.NODE_ENV==="production"?C.exports=Z():C.exports=Q();var _=C.exports;let A="";async function K(s){if(!A)throw"user jid is empty, please initialize jsxc";await window.jsxc.getAccount(A).account.getConnection().getRosterService().addContact(new window.jsxc.JID(s),""),window.jsxc.getAccount(A).getContact(s).openChatWindow()}function ee(s){const m="roster-append",d="windowlist-append",f="dialog-append",{jqueryUrl:a="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.js",marginTop:c="40px",marginLeft:E="40px",marginBottom:w="40px",marginRight:N="40px",contactId:k=null,showMenu:P,fullscreen:O,boshUrl:h,id:j,pw:Y,showAudioButton:T,showVideoButton:I,showOfflineButton:W}=s;return A=j,b.useEffect(()=>{if(window.jsxc){k&&window.jsxc.getAccount(j).getContact(k).openChatWindow();return}O&&(document.getElementsByTagName("body")[0].className="jsxc-fullscreen");const g=document.createElement("script");g.type="text/javascript",g.src=a,document.head.appendChild(g);let v=document.createElement("script");v.type="text/javascript",v.src="/jsxc.bundle.js",document.head.appendChild(v);const i=document.documentElement;i.style.setProperty("--jsxc-margin-top",c),i.style.setProperty("--jsxc-margin-left",E),i.style.setProperty("--jsxc-margin-bottom",w),i.style.setProperty("--jsxc-margin-right",N),v.onload=()=>{localStorage.removeItem("jsxc2:accounts");let S=new window.JSXC({rosterAppend:"#"+m,dialogAppend:"#"+f,windowListAppend:"#"+d,lang:"zh"});window.jsxc=S,S.start(h,j,Y)},P==="no"&&i.style.setProperty("--jsxc-show-menu","none"),T==="no"&&i.style.setProperty("--jsxc-show-audio-button","none"),I==="no"&&i.style.setProperty("--jsxc-show-video-button","none"),W==="no"&&i.style.setProperty("--jsxc-show-offline-button","none")},[]),_.jsxs("div",{id:"jsxc-containers",style:{width:"100%",height:"100%"},children:[_.jsx("div",{style:{width:"100%",height:"100%"},id:m}),_.jsx("div",{style:{width:"100%",height:"100%"},id:f}),_.jsx("div",{style:{width:"100%",height:"100%"},id:d})]})}l.Jsxc=ee,l.directOpenChatWindow=K,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
"main": "./dist/jsxc-react-hook.js",
|
5
5
|
"description": " This is a react function version for JSXC. So you can use it in react application.",
|
6
6
|
"keywords": "jsxc xmpp react-hooks ",
|
7
|
-
"version": "0.0.
|
7
|
+
"version": "0.0.7",
|
8
8
|
"respository": "https://github.com/narutogo/jsxc-react-hook",
|
9
9
|
"type": "module",
|
10
10
|
"types": "./dist/Jsxc.d.ts",
|
@@ -15,9 +15,9 @@
|
|
15
15
|
"preview": "vite preview"
|
16
16
|
},
|
17
17
|
"dependencies": {
|
18
|
-
"react": "^
|
18
|
+
"react": "^19.1.0",
|
19
19
|
"react-activation": "^0.12.4",
|
20
|
-
"react-dom": "^
|
20
|
+
"react-dom": "^19.1.0",
|
21
21
|
"vite-plugin-libcss": "^1.1.1"
|
22
22
|
},
|
23
23
|
"devDependencies": {
|
package/src/Sel.tsx
CHANGED
@@ -11,8 +11,8 @@ export default function Sel() {
|
|
11
11
|
}
|
12
12
|
}>
|
13
13
|
{sel &&
|
14
|
-
<Jsxc boshUrl = '
|
15
|
-
|
14
|
+
<Jsxc boshUrl = 'http://localhost:3001/api/xmpp/bosh' fullscreen={true}
|
15
|
+
id="81205653@miwang.net.cn" pw="d5dc8d0e28"
|
16
16
|
showMenu={'yes'} showAudioButton={'no'} showVideoButton={'yes'}
|
17
17
|
showOfflineButton='yes'
|
18
18
|
/>
|