xframelib 0.9.9 → 1.0.2

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.
@@ -362,11 +362,11 @@ export default class H5Tool {
362
362
  * 如果 div 元素不可编辑,通常情况下是无法触发 paste 事件的。只有设置了 contenteditable="true" 的元素,才会在用户粘贴内容时触发该事件.
363
363
  * @param onPasteCallback 粘贴的回调函数
364
364
  */
365
- static onPasteHandler(onPasteCallback: (pasteContent: string | Array<File> | undefined) => {}): void;
365
+ static onPasteHandler(onPasteCallback: (pasteContent: string | Array<File> | undefined) => {}, inputElement?: Window | HTMLElement | any): void;
366
366
  /**
367
367
  * 移除document粘贴处理事件
368
368
  */
369
- static offPasteHandler(): void;
369
+ static offPasteHandler(inputElement?: Window | HTMLElement | any): void;
370
370
  /**
371
371
  * 动态写入引入js文件
372
372
  * @param url
package/package.json CHANGED
@@ -1,69 +1,70 @@
1
- {
2
- "name": "xframelib",
3
- "version": "0.9.9",
4
- "description": "积累的前端开发基础库,来源于项目和服务于项目。",
5
- "main": "dist/index.js",
6
- "common": "dist/index.cjs",
7
- "typings": "dist/index.d.ts",
8
- "type": "module",
9
- "scripts": {
10
- "build": "vite build",
11
- "lib": "rollup -c ",
12
- "clean": "rimraf dist && rimraf package-lock.json && rimraf node_modules/.cache && rimraf node_modules/.vite"
13
- },
14
- "keywords": [
15
- "hprose",
16
- "rpc",
17
- "typescript"
18
- ],
19
- "author": {
20
- "name": "zorrowm",
21
- "email": "zorrowm@126.com"
22
- },
23
- "repository": {
24
- "type": "git",
25
- "url": "https://github.com/zorrowm/vue-widget-template.git"
26
- },
27
- "homepage": "https://zorrowm.github.io/doc/template.html",
28
- "license": "MIT",
29
- "dependencies": {
30
- "@hprose/io": "^3.0.10",
31
- "@hprose/rpc-core": "^3.0.10",
32
- "@hprose/rpc-html5": "^3.0.10",
33
- "@iconify/vue": "^5.0.0",
34
- "@microsoft/signalr": "^8.0.7",
35
- "axios": "^1.9.0",
36
- "fflate": "^0.8.2",
37
- "iconv-lite": "^0.6.3",
38
- "localforage": "^1.10.0",
39
- "loglevel": "^1.9.2",
40
- "qs": "^6.14.0",
41
- "spark-md5": "^3.0.2",
42
- "xhr": "^2.6.0"
43
- },
44
- "devDependencies": {
45
- "@rollup/plugin-alias": "^5.1.1",
46
- "@rollup/plugin-commonjs": "^28.0.3",
47
- "@rollup/plugin-json": "^6.1.0",
48
- "@rollup/plugin-node-resolve": "^16.0.1",
49
- "@rollup/plugin-terser": "^0.4.4",
50
- "@rollup/plugin-typescript": "^12.1.2",
51
- "@vitejs/plugin-vue": "^5.2.4",
52
- "esbuild": "^0.25.5",
53
- "rollup-plugin-copy": "^3.5.0",
54
- "rollup-plugin-esbuild": "^6.2.1",
55
- "rollup-plugin-scss": "^4.0.1",
56
- "rollup-plugin-typescript2": "^0.36.0",
57
- "rollup-plugin-vue": "^6.0.0",
58
- "sass": "^1.89.0",
59
- "typescript": "^5.8.3",
60
- "vite": "^6.3.5",
61
- "vite-plugin-comlink": "^5.1.0",
62
- "vite-plugin-commonjs": "^0.10.4",
63
- "vite-plugin-dts": "^4.5.4",
64
- "vite-plugin-node-polyfills": "^0.23.0",
65
- "vite-plugin-static-copy": "^3.0.0",
66
- "vue": "^3.5.16",
67
- "vue-router": "^4.5.1"
68
- }
69
- }
1
+ {
2
+ "name": "xframelib",
3
+ "version": "1.0.2",
4
+ "description": "积累的前端开发基础库,来源于项目,服务于项目。",
5
+ "main": "dist/index.js",
6
+ "common": "dist/index.cjs",
7
+ "typings": "dist/index.d.ts",
8
+ "type": "module",
9
+ "scripts": {
10
+ "build": "vite build",
11
+ "lib": "rollup -c ",
12
+ "clean": "rimraf dist && rimraf package-lock.json && rimraf node_modules/.cache && rimraf node_modules/.vite"
13
+ },
14
+ "keywords": [
15
+ "hprose",
16
+ "rpc",
17
+ "typescript"
18
+ ],
19
+ "author": {
20
+ "name": "zorrowm",
21
+ "email": "zorrowm@126.com"
22
+ },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/zorrowm/vue-widget-template.git"
26
+ },
27
+ "homepage": "https://zorrowm.github.io/doc/template.html",
28
+ "license": "MIT",
29
+ "dependencies": {
30
+ "@hprose/io": "^3.0.10",
31
+ "@hprose/rpc-core": "^3.0.10",
32
+ "@hprose/rpc-html5": "^3.0.10",
33
+ "@iconify-icons/ant-design": "^1.2.7",
34
+ "@iconify/vue": "^5.0.0",
35
+ "@microsoft/signalr": "^8.0.7",
36
+ "axios": "^1.10.0",
37
+ "fflate": "^0.8.2",
38
+ "iconv-lite": "^0.6.3",
39
+ "localforage": "^1.10.0",
40
+ "loglevel": "^1.9.2",
41
+ "qs": "^6.14.0",
42
+ "spark-md5": "^3.0.2",
43
+ "xhr": "^2.6.0"
44
+ },
45
+ "devDependencies": {
46
+ "@rollup/plugin-alias": "^5.1.1",
47
+ "@rollup/plugin-commonjs": "^28.0.6",
48
+ "@rollup/plugin-json": "^6.1.0",
49
+ "@rollup/plugin-node-resolve": "^16.0.1",
50
+ "@rollup/plugin-terser": "^0.4.4",
51
+ "@rollup/plugin-typescript": "^12.1.4",
52
+ "@vitejs/plugin-vue": "^6.0.0",
53
+ "esbuild": "^0.25.6",
54
+ "rollup-plugin-copy": "^3.5.0",
55
+ "rollup-plugin-esbuild": "^6.2.1",
56
+ "rollup-plugin-scss": "^4.0.1",
57
+ "rollup-plugin-typescript2": "^0.36.0",
58
+ "rollup-plugin-vue": "^6.0.0",
59
+ "sass": "^1.89.2",
60
+ "typescript": "^5.8.3",
61
+ "vite": "^7.0.4",
62
+ "vite-plugin-comlink": "^5.1.0",
63
+ "vite-plugin-commonjs": "^0.10.4",
64
+ "vite-plugin-dts": "^4.5.4",
65
+ "vite-plugin-node-polyfills": "^0.24.0",
66
+ "vite-plugin-static-copy": "^3.1.0",
67
+ "vue": "^3.5.17",
68
+ "vue-router": "^4.5.1"
69
+ }
70
+ }
@@ -1,6 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2019 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- const e=Symbol("Comlink.proxy"),r=Symbol("Comlink.endpoint"),n=Symbol("Comlink.releaseProxy"),t=Symbol("Comlink.finalizer"),a=Symbol("Comlink.thrown"),o=e=>"object"==typeof e&&null!==e||"function"==typeof e,i={canHandle:r=>o(r)&&r[e],serialize(e){const{port1:r,port2:n}=new MessageChannel;return c(e,r),[n,[n]]},deserialize:e=>(e.start(),function(e,r){const n=new Map;return e.addEventListener("message",(function(e){const{data:r}=e;if(!r||!r.id)return;const t=n.get(r.id);if(t)try{t(r)}finally{n.delete(r.id)}})),p(e,n,[],r)}(e))},s=new Map([["proxy",i],["throw",{canHandle:e=>o(e)&&a in e,serialize({value:e}){let r;return r=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[r,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function c(r,n=globalThis,o=["*"]){n.addEventListener("message",(function i(s){if(!s||!s.data)return;if(!function(e,r){for(const n of e){if(r===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(r))return!0}return!1}(o,s.origin))return void console.warn(`Invalid origin '${s.origin}' for comlink proxy`);const{id:f,type:l,path:g}=Object.assign({path:[]},s.data),h=(s.data.argumentList||[]).map(v);let p;try{const n=g.slice(0,-1).reduce(((e,r)=>e[r]),r),t=g.reduce(((e,r)=>e[r]),r);switch(l){case"GET":p=t;break;case"SET":n[g.slice(-1)[0]]=v(s.data.value),p=!0;break;case"APPLY":p=t.apply(n,h);break;case"CONSTRUCT":p=function(r){return Object.assign(r,{[e]:!0})}(new t(...h));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;c(r,n),p=function(e,r){return d.set(e,r),e}(e,[e])}break;case"RELEASE":p=void 0;break;default:return}}catch(e){p={value:e,[a]:0}}Promise.resolve(p).catch((e=>({value:e,[a]:0}))).then((e=>{const[a,o]=w(e);n.postMessage(Object.assign(Object.assign({},a),{id:f}),o),"RELEASE"===l&&(n.removeEventListener("message",i),u(n),t in r&&"function"==typeof r[t]&&r[t]())})).catch((e=>{const[r,t]=w({value:new TypeError("Unserializable return value"),[a]:0});n.postMessage(Object.assign(Object.assign({},r),{id:f}),t)}))})),n.start&&n.start()}function u(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function f(e){if(e)throw new Error("Proxy has been released and is not useable")}function l(e){return m(e,new Map,{type:"RELEASE"}).then((()=>{u(e)}))}const g=new WeakMap,h="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const r=(g.get(e)||0)-1;g.set(e,r),0===r&&l(e)}));function p(e,t,a=[],o=function(){}){let i=!1;const s=new Proxy(o,{get(r,o){if(f(i),o===n)return()=>{!function(e){h&&h.unregister(e)}(s),l(e),t.clear(),i=!0};if("then"===o){if(0===a.length)return{then:()=>s};const r=m(e,t,{type:"GET",path:a.map((e=>e.toString()))}).then(v);return r.then.bind(r)}return p(e,t,[...a,o])},set(r,n,o){f(i);const[s,c]=w(o);return m(e,t,{type:"SET",path:[...a,n].map((e=>e.toString())),value:s},c).then(v)},apply(n,o,s){f(i);const c=a[a.length-1];if(c===r)return m(e,t,{type:"ENDPOINT"}).then(v);if("bind"===c)return p(e,t,a.slice(0,-1));const[u,l]=y(s);return m(e,t,{type:"APPLY",path:a.map((e=>e.toString())),argumentList:u},l).then(v)},construct(r,n){f(i);const[o,s]=y(n);return m(e,t,{type:"CONSTRUCT",path:a.map((e=>e.toString())),argumentList:o},s).then(v)}});return function(e,r){const n=(g.get(r)||0)+1;g.set(r,n),h&&h.register(e,r,e)}(s,e),s}function y(e){const r=e.map(w);return[r.map((e=>e[0])),(n=r.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const d=new WeakMap;function w(e){for(const[r,n]of s)if(n.canHandle(e)){const[t,a]=n.serialize(e);return[{type:"HANDLER",name:r,value:t},a]}return[{type:"RAW",value:e},d.get(e)||[]]}function v(e){switch(e.type){case"HANDLER":return s.get(e.name).deserialize(e.value);case"RAW":return e.value}}function m(e,r,n,t){return new Promise((a=>{const o=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");r.set(o,a),e.start&&e.start(),e.postMessage(Object.assign({id:o},n),t)}))}let b=!0;try{String.fromCharCode.apply(String,[1,2])}catch(e){b=!1,Object.defineProperty(Array.prototype,"subarray",{value:Array.prototype.slice})}var E=2654435769;function S(e,r){var n=e.length,t=n<<2;if(r){var a=e[n-1];if(a<(t-=4)-3||a>t)return null;t=a}for(var o=new Uint8Array(t),i=0;i<t;++i)o[i]=e[i>>2]>>((3&i)<<3);return o}function C(e,r){var n,t=e.length,a=t>>2;3&t&&++a,r?(n=new Uint32Array(a+1))[a]=t:n=new Uint32Array(a);for(var o=0;o<t;++o)n[o>>2]|=e[o]<<((3&o)<<3);return n}function A(e){return 4294967295&e}function U(e,r,n,t,a,o){return(n>>>5^r<<2)+(r>>>3^n<<4)^(e^r)+(o[3&t^a]^n)}function k(e){if(e.length<16){var r=new Uint8Array(16);r.set(e),e=r}return e}function T(e){for(var r=e.length,n=new Uint8Array(3*r),t=0,a=0;a<r;a++){var o=e.charCodeAt(a);if(o<128)n[t++]=o;else if(o<2048)n[t++]=192|o>>6,n[t++]=128|63&o;else{if(!(o<55296||o>57343)){if(a+1<r){var i=e.charCodeAt(a+1);if(o<56320&&56320<=i&&i<=57343){var s=65536+((1023&o)<<10|1023&i);n[t++]=240|s>>18,n[t++]=128|s>>12&63,n[t++]=128|s>>6&63,n[t++]=128|63&s,a++;continue}}throw new Error("Malformed string")}n[t++]=224|o>>12,n[t++]=128|o>>6&63,n[t++]=128|63&o}}return n.subarray(0,t)}function M(e){var r=e.length;return 0===r?"":r<32767?function(e,r){for(var n=new Array(r),t=0,a=0,o=e.length;t<r&&a<o;t++){var i=e[a++];switch(i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:n[t]=i;break;case 12:case 13:if(!(a<o))throw new Error("Unfinished UTF-8 octet sequence");n[t]=(31&i)<<6|63&e[a++];break;case 14:if(!(a+1<o))throw new Error("Unfinished UTF-8 octet sequence");n[t]=(15&i)<<12|(63&e[a++])<<6|63&e[a++];break;case 15:if(!(a+2<o))throw new Error("Unfinished UTF-8 octet sequence");var s=((7&i)<<18|(63&e[a++])<<12|(63&e[a++])<<6|63&e[a++])-65536;if(!(0<=s&&s<=1048575))throw new Error("Character outside valid Unicode range: 0x"+s.toString(16));n[t++]=s>>10&1023|55296,n[t]=1023&s|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+i.toString(16))}}return t<r&&(n.length=t),String.fromCharCode.apply(String,n)}(e,r):function(e,r){for(var n=[],t=new Array(32768),a=0,o=0,i=e.length;a<r&&o<i;a++){var s=e[o++];switch(s>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:t[a]=s;break;case 12:case 13:if(!(o<i))throw new Error("Unfinished UTF-8 octet sequence");t[a]=(31&s)<<6|63&e[o++];break;case 14:if(!(o+1<i))throw new Error("Unfinished UTF-8 octet sequence");t[a]=(15&s)<<12|(63&e[o++])<<6|63&e[o++];break;case 15:if(!(o+2<i))throw new Error("Unfinished UTF-8 octet sequence");var c=((7&s)<<18|(63&e[o++])<<12|(63&e[o++])<<6|63&e[o++])-65536;if(!(0<=c&&c<=1048575))throw new Error("Character outside valid Unicode range: 0x"+c.toString(16));t[a++]=c>>10&1023|55296,t[a]=1023&c|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+s.toString(16))}if(a>=32766){var u=a+1;t.length=u,n.push(String.fromCharCode.apply(String,t)),r-=u,a=-1}}return a>0&&(t.length=a,n.push(String.fromCharCode.apply(String,t))),n.join("")}(e,r)}function j(e){var r=e.length;if(0===r)return"";var n=b?e:function(e){for(var r=e.length,n=new Array(e.length),t=0;t<r;++t)n[t]=e[t];return n}(e);if(r<65535)return String.fromCharCode.apply(String,n);for(var t=32767&r,a=r>>15,o=new Array(t?a+1:a),i=0;i<a;++i)o[i]=String.fromCharCode.apply(String,n.subarray(i<<15,i+1<<15));return t&&(o[a]=String.fromCharCode.apply(String,n.subarray(a<<15,r))),o.join("")}function O(e,r){return"string"==typeof e&&(e=T(e)),"string"==typeof r&&(r=T(r)),null==e||0===e.length?e:S(function(e,r){var n,t,a,o,i,s,c=e.length,u=c-1;for(t=e[u],a=0,s=0|Math.floor(6+52/c);s>0;--s){for(o=(a=A(a+E))>>>2&3,i=0;i<u;++i)n=e[i+1],t=e[i]=A(e[i]+U(a,n,t,i,o,r));n=e[0],t=e[u]=A(e[u]+U(a,n,t,u,o,r))}return e}(C(e,!0),C(k(r),!1)),!1)}function L(e,r){return"string"==typeof e&&(e=function(e){for(var r=window.atob(e),n=r.length,t=new Uint8Array(n),a=0;a<n;a++)t[a]=r.charCodeAt(a);return t}(e)),"string"==typeof r&&(r=T(r)),null==e||0===e.length?e:S(function(e,r){var n,t,a,o,i,s=e.length,c=s-1;for(n=e[0],a=A(Math.floor(6+52/s)*E);0!==a;a=A(a-E)){for(o=a>>>2&3,i=c;i>0;--i)t=e[i-1],n=e[i]=A(e[i]-U(a,n,t,i,o,r));t=e[c],n=e[0]=A(e[0]-U(a,n,t,0,o,r))}return e}(C(e,!1),C(k(r),!1)),!0)}c(Object.freeze({__proto__:null,decrypt:L,decryptToString:function(e,r){return M(L(e,r))},encrypt:O,encryptToString:function(e,r){return window.btoa(j(O(e,r)))},toBytes:T,toString:M}));