@joystick.js/ui-canary 0.0.0-canary.7 → 0.0.0-canary.71
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/api/get.js +1 -1
- package/dist/api/index.js +1 -1
- package/dist/api/set.js +1 -1
- package/dist/attachJoystickToWindow.js +1 -1
- package/dist/component/class/data/compile.js +1 -1
- package/dist/component/class/data/loadDataFromWindow.js +1 -1
- package/dist/component/class/events/registerListeners.js +1 -1
- package/dist/component/class/index.js +10 -10
- package/dist/component/class/methods/compile.js +1 -1
- package/dist/component/class/options/allowedComponentOptions.js +1 -1
- package/dist/component/class/options/registerOptions.js +15 -15
- package/dist/component/class/options/validateOptions.js +1 -1
- package/dist/component/class/options/validators/index.js +1 -1
- package/dist/component/class/options/validators/test.js +1 -0
- package/dist/component/class/render/forMount.js +1 -1
- package/dist/component/class/render/getUpdatedDOM.js +1 -1
- package/dist/component/class/render/toHTML.js +1 -1
- package/dist/component/class/render/wrapHTML.js +1 -1
- package/dist/component/class/renderMethods/compile.js +1 -1
- package/dist/component/class/renderMethods/component.js +1 -1
- package/dist/component/class/renderMethods/i18n.js +1 -1
- package/dist/component/class/renderMethods/index.js +1 -1
- package/dist/component/index.js +10 -10
- package/dist/index.js +10 -10
- package/dist/lib/generateCookieHeader.js +1 -0
- package/dist/mount/index.js +1 -1
- package/dist/test/createFile.js +1 -0
- package/dist/test/index.js +1 -0
- package/dist/test/trackFunctionCall.js +1 -0
- package/dist/upload/index.js +1 -1
- package/dist/websockets/client.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o=(t=128,n="test.txt",e="text/plain")=>{let l=t instanceof Blob;return new File(l?t:new Blob(new Uint8Array(t||128),{type:e}),n,{type:e})};export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o=(t=128,e="test.txt",n="text/plain")=>{let l=t instanceof Blob;return new File(l?t:new Blob(new Uint8Array(t||128),{type:n}),e,{type:n})};var i=(t="",e=[])=>{typeof window!="undefined"&&!!window.__joystick_test__&&(window.test={...window.test||{},functionCalls:{...window?.test?.functionCalls||{},[t]:[...window?.test?.functionCalls&&window?.test?.functionCalls[t]||[],{calledAt:new Date().toISOString(),args:e}]}})};var c={utils:{createFile:o,trackFunctionCall:i}};export{c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i=(t="",n=[])=>{typeof window!="undefined"&&!!window.__joystick_test__&&(window.test={...window.test||{},functionCalls:{...window?.test?.functionCalls||{},[t]:[...window?.test?.functionCalls&&window?.test?.functionCalls[t]||[],{calledAt:new Date().toISOString(),args:n}]}})};export{i as default};
|
package/dist/upload/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var g="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890".split(""),
|
|
1
|
+
var g="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890".split(""),c=(e=16)=>{let t="",o=0;for(;o<e;)t+=g[Math.floor(Math.random()*(g.length-1))],o+=1;return t};var i=(e="",t={})=>{throw new Error(`[joystick${e?`.${e}`:""}] ${t.message||t.reason||t}`)};var m=(e="",t=[])=>{try{console.error(`${e} failed with the following errors:`),t.forEach(o=>{console.log(o.message),o.stack&&console.log(o.stack)})}catch(o){i(e,o)}};var w=(e="",t=[])=>{typeof window!="undefined"&&!!window.__joystick_test__&&(window.test={...window.test||{},functionCalls:{...window?.test?.functionCalls||{},[e]:[...window?.test?.functionCalls&&window?.test?.functionCalls[e]||[],{calledAt:new Date().toISOString(),args:t}]}})};var d=null,u=0,k=(e={},t=null)=>{try{if(window?.__joystick_test__)return t();let o=e?.url;e?.query&&(o=`${o}?${new URLSearchParams(e.query).toString()}`);let l=new WebSocket(o);d&&(clearInterval(d),d=null);let n={client:l,send:(r={})=>(w(`ui.websockets.${e?.test?.name||c()}.send`,[r]),l.send(JSON.stringify(r)))};return l.addEventListener("open",()=>{e?.options?.logging&&console.log(`[joystick.websockets] Connected to ${e?.url}`),e?.events?.onOpen&&(e.events.onOpen(n),w(`ui.websockets.${e?.test?.name||c()}.onOpen`,[n])),u=0}),l.addEventListener("message",r=>{r?.data&&e?.events?.onMessage&&(e.events.onMessage(JSON.parse(r.data||{}),n),w(`ui.websockets.${e?.test?.name||c()}.onMessage`,[r.data||{},n]))}),l.addEventListener("close",r=>{e?.options?.logging&&console.log(`[joystick.websockets] Disconnected from ${e?.url}`),e?.events?.onClose&&(e.events.onClose(r?.code,r?.reason,n),w(`ui.websockets.${e?.test?.name||c()}.onClose`,[r.data||{},n])),l=null;let s=[1e3,1001].includes(r?.code);e?.options?.autoReconnect&&!d&&!s&&(d=setInterval(()=>{l=null,u<(e?.options?.reconnectAttempts||12)?(k(e,t),e?.options?.logging&&console.log(`[joystick.websockets] Attempting to reconnect (${u+1}/12)...`),u+=1):clearInterval(d)},e?.options?.reconnectDelayInSeconds*1e3||5e3))}),t&&t(n),n}catch(o){i("websockets.client",o)}},p=k;var D=(e="",t={})=>{try{return new Promise((o,l)=>{let n=c(),r=0;p({url:`${window?.process?.env.NODE_ENV==="development"?"ws":"wss"}://${location.host}/api/_websockets/uploaders`,options:{logging:!1,autoReconnect:!0,reconnectAttempts:12,reconnectDelayInSeconds:5},query:{id:n},events:{onMessage:(s={})=>{s?.type==="PROGRESS"&&t?.onProgress&&r<100&&r!==s?.progress&&(r=s?.progress,t.onProgress(s?.progress,s?.provider))}}},()=>{let s;t?.files?.length>0&&(s=new FormData,console.log(FormData),Array.from(t?.files).forEach(f=>{s.append("files",f,f.name)})),fetch(`${window.location.origin}/api/_uploaders/${e}`,{method:"POST",headers:{"x-joystick-upload-id":n,"x-joystick-upload-input":JSON.stringify(t?.input||{})},body:s}).then(async f=>{let a=await f.json();console.log(a),a&&a.errors?(m("upload",a.errors),l({errors:a.errors})):o(a?.uploads)})})})}catch(o){i("upload",o)}};export{D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var d=(e="",t={})=>{throw new Error(`[joystick${e?`.${e}`:""}] ${t.message||t.reason||t}`)};var c=(e="",t=[])=>{typeof window!="undefined"&&!!window.__joystick_test__&&(window.test={...window.test||{},functionCalls:{...window?.test?.functionCalls||{},[e]:[...window?.test?.functionCalls&&window?.test?.functionCalls[e]||[],{calledAt:new Date().toISOString(),args:t}]}})};var w="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890".split(""),a=(e=16)=>{let t="",s=0;for(;s<e;)t+=w[Math.floor(Math.random()*(w.length-1))],s+=1;return t};var o=null,i=0,u=(e={},t=null)=>{try{if(window?.__joystick_test__)return t();let s=e?.url;e?.query&&(s=`${s}?${new URLSearchParams(e.query).toString()}`);let l=new WebSocket(s);o&&(clearInterval(o),o=null);let r={client:l,send:(n={})=>(c(`ui.websockets.${e?.test?.name||a()}.send`,[n]),l.send(JSON.stringify(n)))};return l.addEventListener("open",()=>{e?.options?.logging&&console.log(`[joystick.websockets] Connected to ${e?.url}`),e?.events?.onOpen&&(e.events.onOpen(r),c(`ui.websockets.${e?.test?.name||a()}.onOpen`,[r])),i=0}),l.addEventListener("message",n=>{n?.data&&e?.events?.onMessage&&(e.events.onMessage(JSON.parse(n.data||{}),r),c(`ui.websockets.${e?.test?.name||a()}.onMessage`,[n.data||{},r]))}),l.addEventListener("close",n=>{e?.options?.logging&&console.log(`[joystick.websockets] Disconnected from ${e?.url}`),e?.events?.onClose&&(e.events.onClose(n?.code,n?.reason,r),c(`ui.websockets.${e?.test?.name||a()}.onClose`,[n.data||{},r])),l=null;let f=[1e3,1001].includes(n?.code);e?.options?.autoReconnect&&!o&&!f&&(o=setInterval(()=>{l=null,i<(e?.options?.reconnectAttempts||12)?(u(e,t),e?.options?.logging&&console.log(`[joystick.websockets] Attempting to reconnect (${i+1}/12)...`),i+=1):clearInterval(o)},e?.options?.reconnectDelayInSeconds*1e3||5e3))}),t&&t(r),r}catch(s){d("websockets.client",s)}},C=u;export{C as default};
|
package/package.json
CHANGED