mxcad 1.0.43 → 1.0.44

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/mxcad.es.js CHANGED
@@ -1774,7 +1774,7 @@ const EC = (B) => new Promise((D, C) => {
1774
1774
  console.log(a);
1775
1775
  }
1776
1776
  const s = await Y(o, "application/wasm");
1777
- return await EC(u), l && (C.mainScriptUrlOrBlob = r), C.locateFile = (a, m) => a === u ? m : a === i && l ? l : a === o ? s : F(a, m), await window[D](C);
1777
+ return await EC(u), l && (C.mainScriptUrlOrBlob = u), C.locateFile = (a, m) => a === A ? m : a === i && l ? l : a === o ? s : F(a, m), await window[D](C);
1778
1778
  };
1779
1779
  function FC(B) {
1780
1780
  return typeof ResizeObserver == "function" ? new ResizeObserver(B) : null;
@@ -1839,7 +1839,7 @@ class G {
1839
1839
  });
1840
1840
  }
1841
1841
  }
1842
- const MD = "1.0.42", tC = (B, D = self.location.href) => typeof process < "u" && process.env.NODE_ENV === "development" ? new URL(`/node_modules/mxcad/dist/wasm/2d/${B}`, import.meta.url || D).href : `https://unpkg.com/mxcad@${MD}/dist/wasm/2d/${B}`, iC = (B, D = self.location.href) => typeof process < "u" && process.env.NODE_ENV === "development" ? new URL(`/node_modules/mxcad/dist/wasm/3d/${B}`, import.meta.url || D).href : `https://unpkg.com/mxcad@${MD}/dist/wasm/3d/${B}`;
1842
+ const MD = "1.0.43", tC = (B, D = self.location.href) => typeof process < "u" && process.env.NODE_ENV === "development" ? new URL(`/node_modules/mxcad/dist/wasm/2d/${B}`, import.meta.url || D).href : `https://unpkg.com/mxcad@${MD}/dist/wasm/2d/${B}`, iC = (B, D = self.location.href) => typeof process < "u" && process.env.NODE_ENV === "development" ? new URL(`/node_modules/mxcad/dist/wasm/3d/${B}`, import.meta.url || D).href : `https://unpkg.com/mxcad@${MD}/dist/wasm/3d/${B}`;
1843
1843
  let n;
1844
1844
  async function rC(B, D = tC, C) {
1845
1845
  if (n || (n = new HD()), n.mxcadassemblyimp) {
package/dist/mxcad.umd.js CHANGED
@@ -35,4 +35,4 @@
35
35
  \u6307\u5B9A\u53E6\u4E00\u6761\u534A\u8F74\u957F\u5EA6`),B.setKeyWords(""),e()},()=>{}),e=y(B,()=>{B.setMessage(`
36
36
  \u6307\u5B9A\u8D77\u59CB\u89D2\u5EA6`),B.setKeyWords(""),B.setUserDraw((n,o)=>{D.startAngle=FD(n.x,n.y,E.x,E.y)-D.rotation,o.drawLine(E,n),o.drawCustomEntity(D)}),i()},()=>{}),i=y(B,()=>{B.setUserDraw((n,o)=>{D.endAngle=FD(n.x,n.y,E.x,E.y)-D.rotation,o.drawLine(E,n),o.drawCustomEntity(D)}),B.setMessage(`
37
37
  \u6307\u5B9A\u7EC8\u6B62\u89D2\u5EA6`),B.setKeyWords(""),s()},()=>{}),s=y(B,()=>{r.MxFun.getCurrentDraw().addMxEntity(D)},()=>{})}r.store.events.on("MxDbEntityRegister",()=>{r.MxFun.addCommand("Mx_EllipseArc",sD)});async function aD(){(await K.selectEnt(`
38
- \u9009\u62E9\u5220\u9664\u5BF9\u8C61`)).forEach(D=>{D.erase()})}r.store.events.on("MxDbEntityRegister",()=>{r.MxFun.addCommand("Mx_Erase",aD)});const _D=B=>new Promise((D,C)=>{const E=document.createElement("script");E.src=B,E.crossOrigin="anonymous",document.body.appendChild(E),E.onload=()=>{D()},E.onerror=F=>{C(F)}}),oD=async(B,D)=>{console.log("info",`fetch ${B}`);const C=await(await fetch(B)).arrayBuffer();console.log("info",`${B} file size = ${C.byteLength} bytes`);const E=new Blob([C],{type:D}),F=URL.createObjectURL(E);return console.log("info",`${B} blob URL = ${F}`),F},bD=async(B,D,C)=>{const{locateFile:E}=C,F=(...u)=>E(...u),A=B+".js",e=B+".worker.js",i=B+".wasm",s=F(A),n=F(e),o=F(i),l=await oD(s,"application/javascript");let c;try{c=await oD(n,"application/javascript")}catch(u){console.log(u)}const a=await oD(o,"application/wasm");return await _D(l),c&&(C.mainScriptUrlOrBlob=s),C.locateFile=(u,p)=>u===l?p:u===n&&c?c:u===o?a:F(u,p),await window[D](C)};function zD(B){return typeof ResizeObserver=="function"?new ResizeObserver(B):null}function HD(B,D){const C=()=>requestAnimationFrame(D);let E=zD(C);if(E){E.observe(B);return}if(MutationObserver){new MutationObserver(C).observe(B,{attributes:!0});return}}function qD(B,D){let C=null;return function(...E){C||(C=setTimeout(()=>{B.apply(this,E),C=null},D))}}class L{static onloadWasmMxDraw3dModel;canvas;constructor(D){const C=()=>{const l=this.canvas.parentElement?.clientWidth||window.innerWidth,c=this.canvas.parentElement?.clientHeight||window.innerHeight;let a=Math.min(l,window.screen.availWidth),u=Math.min(c,window.screen.availHeight);a=Math.max(A,a),u=Math.max(e,u),this.canvas.style.width=a+1+"px",this.canvas.style.height=u+"px";const p=window.devicePixelRatio||1;this.canvas.width=a*p,this.canvas.height=u*p},E=qD(C,50),{canvas:F,minWidth:A=300,minHeight:e=300,updateCanvasSize:i=E,...s}=D;let n=typeof F=="string"?document.querySelectorAll(F)[0]:F,o=n.getContext("webgl2",{alpha:!1,depth:!0,antialias:!1,preserveDrawingBuffer:!0});o==null&&(o=n.getContext("webgl",{alpha:!1,depth:!0,antialias:!1,preserveDrawingBuffer:!0})),this.canvas=n,this.ctx=o,s.canvas=this.canvas;for(let l in s)this[l]=s[l];if(this.canvas instanceof HTMLCanvasElement){const l=this.canvas.parentElement||document.body;HD(l,i)}else console.error("createMxDraw3d canvas \u53C2\u6570\u4E0D\u6B63\u786E \u65E0\u6CD5\u83B7\u53D6\u5230canvas\u5143\u7D20");window.onresize=C,C(),bD("mxdraw3d_min","mxdraw3d",this).then(()=>{L.onloadWasmMxDraw3dModel&&L.onloadWasmMxDraw3dModel(this),this.updateCanvasSize=i,this.open3DFile=l=>{const c=new FileReader;c.onload=()=>{if(!!c.result&&c.result instanceof ArrayBuffer){var a=new Uint8Array(c.result);const u=this._malloc(a.length);this.HEAPU8.set(a,u),this.openFromMemory(l.name,u,a.length,!0),this.displayGround(!0),this.canvas.focus()}},c.readAsArrayBuffer(l)}})}}const wD="1.0.42",$D=(B,D=self.location.href)=>typeof process<"u"&&process.env.NODE_ENV==="development"?new URL(`/node_modules/mxcad/dist/wasm/2d/${B}`,(typeof document>"u"&&typeof location>"u"?new(require("url")).URL("file:"+__filename).href:typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||new URL("mxcad.umd.js",document.baseURI).href)||D).href:`https://unpkg.com/mxcad@${wD}/dist/wasm/2d/${B}`,JD=(B,D=self.location.href)=>typeof process<"u"&&process.env.NODE_ENV==="development"?new URL(`/node_modules/mxcad/dist/wasm/3d/${B}`,(typeof document>"u"&&typeof location>"u"?new(require("url")).URL("file:"+__filename).href:typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||new URL("mxcad.umd.js",document.baseURI).href)||D).href:`https://unpkg.com/mxcad@${wD}/dist/wasm/3d/${B}`;t.MxCpp=void 0;async function yD(B,D=$D,C){if(t.MxCpp||(t.MxCpp=new vD),t.MxCpp.mxcadassemblyimp){B(t.MxCpp);return}const F=await bD("mxdrawassembly_min","mxdrawassembly",{locateFile:D,wasmBinary:C});t.MxCpp.mxcadassemblyimp=F;let A=new F.McApp;A.Init(),t.MxCpp.App.init(A),B(t.MxCpp)}function gD(B,D){return new Promise(async(C,E)=>{try{B.locateFile||(B.locateFile=JD);const F=new L(B);L.onloadWasmMxDraw3dModel=()=>{C(F),D&&D(F)}}catch(F){E(F)}})}const XD=Object.freeze(Object.defineProperty({__proto__:null,fetchAndInstantiate:uD,b64Encode:z,b64Decode:H,saveAsFileDialog:q,downloadFile:$,MxTools:v,drawText:lD,drawCircle:J,drawLine:AD,drawMText:hD,drawPolyLine:eD,drawPolygon:tD,drawArc:nD,drawEllipticalArc:sD,mxErase:aD,McObject:R,McRxObject:P,McDbDatabase:Q,McDbLayerTable:Y,McDbEntity:k,McDbCurve:j,McDbLine:U,McDbText:G,McDbCircle:N,get McDb(){return t.McDb},McDrawUtility:K,McObjectId:w,McDrawResbuf:DD,McDbPolyline:Z,McDbBlockTable:ED,McDbBlockTableIterator:BD,McDbBlockTableRecord:W,McDbBlockTableRecordIterator:CD,MxDraw3d:L,get MxCpp(){return t.MxCpp},loadMxCADassembly:yD,loadMxCADassembly3d:gD},Symbol.toStringTag,{value:"Module"}));t.McDbBlockTable=ED,t.McDbBlockTableIterator=BD,t.McDbBlockTableRecord=W,t.McDbBlockTableRecordIterator=CD,t.McDbCircle=N,t.McDbCurve=j,t.McDbDatabase=Q,t.McDbEntity=k,t.McDbLayerTable=Y,t.McDbLine=U,t.McDbPolyline=Z,t.McDbText=G,t.McDrawResbuf=DD,t.McDrawUtility=K,t.McObject=R,t.McObjectId=w,t.McRxObject=P,t.MxDraw3d=L,t.MxTools=v,t.b64Decode=H,t.b64Encode=z,t.default=XD,t.downloadFile=$,t.drawArc=nD,t.drawCircle=J,t.drawEllipticalArc=sD,t.drawLine=AD,t.drawMText=hD,t.drawPolyLine=eD,t.drawPolygon=tD,t.drawText=lD,t.fetchAndInstantiate=uD,t.loadMxCADassembly=yD,t.loadMxCADassembly3d=gD,t.mxErase=aD,t.saveAsFileDialog=q,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
38
+ \u9009\u62E9\u5220\u9664\u5BF9\u8C61`)).forEach(D=>{D.erase()})}r.store.events.on("MxDbEntityRegister",()=>{r.MxFun.addCommand("Mx_Erase",aD)});const _D=B=>new Promise((D,C)=>{const E=document.createElement("script");E.src=B,E.crossOrigin="anonymous",document.body.appendChild(E),E.onload=()=>{D()},E.onerror=F=>{C(F)}}),oD=async(B,D)=>{console.log("info",`fetch ${B}`);const C=await(await fetch(B)).arrayBuffer();console.log("info",`${B} file size = ${C.byteLength} bytes`);const E=new Blob([C],{type:D}),F=URL.createObjectURL(E);return console.log("info",`${B} blob URL = ${F}`),F},bD=async(B,D,C)=>{const{locateFile:E}=C,F=(...u)=>E(...u),A=B+".js",e=B+".worker.js",i=B+".wasm",s=F(A),n=F(e),o=F(i),l=await oD(s,"application/javascript");let c;try{c=await oD(n,"application/javascript")}catch(u){console.log(u)}const a=await oD(o,"application/wasm");return await _D(l),c&&(C.mainScriptUrlOrBlob=l),C.locateFile=(u,p)=>u===A?p:u===n&&c?c:u===o?a:F(u,p),await window[D](C)};function zD(B){return typeof ResizeObserver=="function"?new ResizeObserver(B):null}function HD(B,D){const C=()=>requestAnimationFrame(D);let E=zD(C);if(E){E.observe(B);return}if(MutationObserver){new MutationObserver(C).observe(B,{attributes:!0});return}}function qD(B,D){let C=null;return function(...E){C||(C=setTimeout(()=>{B.apply(this,E),C=null},D))}}class L{static onloadWasmMxDraw3dModel;canvas;constructor(D){const C=()=>{const l=this.canvas.parentElement?.clientWidth||window.innerWidth,c=this.canvas.parentElement?.clientHeight||window.innerHeight;let a=Math.min(l,window.screen.availWidth),u=Math.min(c,window.screen.availHeight);a=Math.max(A,a),u=Math.max(e,u),this.canvas.style.width=a+1+"px",this.canvas.style.height=u+"px";const p=window.devicePixelRatio||1;this.canvas.width=a*p,this.canvas.height=u*p},E=qD(C,50),{canvas:F,minWidth:A=300,minHeight:e=300,updateCanvasSize:i=E,...s}=D;let n=typeof F=="string"?document.querySelectorAll(F)[0]:F,o=n.getContext("webgl2",{alpha:!1,depth:!0,antialias:!1,preserveDrawingBuffer:!0});o==null&&(o=n.getContext("webgl",{alpha:!1,depth:!0,antialias:!1,preserveDrawingBuffer:!0})),this.canvas=n,this.ctx=o,s.canvas=this.canvas;for(let l in s)this[l]=s[l];if(this.canvas instanceof HTMLCanvasElement){const l=this.canvas.parentElement||document.body;HD(l,i)}else console.error("createMxDraw3d canvas \u53C2\u6570\u4E0D\u6B63\u786E \u65E0\u6CD5\u83B7\u53D6\u5230canvas\u5143\u7D20");window.onresize=C,C(),bD("mxdraw3d_min","mxdraw3d",this).then(()=>{L.onloadWasmMxDraw3dModel&&L.onloadWasmMxDraw3dModel(this),this.updateCanvasSize=i,this.open3DFile=l=>{const c=new FileReader;c.onload=()=>{if(!!c.result&&c.result instanceof ArrayBuffer){var a=new Uint8Array(c.result);const u=this._malloc(a.length);this.HEAPU8.set(a,u),this.openFromMemory(l.name,u,a.length,!0),this.displayGround(!0),this.canvas.focus()}},c.readAsArrayBuffer(l)}})}}const wD="1.0.43",$D=(B,D=self.location.href)=>typeof process<"u"&&process.env.NODE_ENV==="development"?new URL(`/node_modules/mxcad/dist/wasm/2d/${B}`,(typeof document>"u"&&typeof location>"u"?new(require("url")).URL("file:"+__filename).href:typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||new URL("mxcad.umd.js",document.baseURI).href)||D).href:`https://unpkg.com/mxcad@${wD}/dist/wasm/2d/${B}`,JD=(B,D=self.location.href)=>typeof process<"u"&&process.env.NODE_ENV==="development"?new URL(`/node_modules/mxcad/dist/wasm/3d/${B}`,(typeof document>"u"&&typeof location>"u"?new(require("url")).URL("file:"+__filename).href:typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||new URL("mxcad.umd.js",document.baseURI).href)||D).href:`https://unpkg.com/mxcad@${wD}/dist/wasm/3d/${B}`;t.MxCpp=void 0;async function yD(B,D=$D,C){if(t.MxCpp||(t.MxCpp=new vD),t.MxCpp.mxcadassemblyimp){B(t.MxCpp);return}const F=await bD("mxdrawassembly_min","mxdrawassembly",{locateFile:D,wasmBinary:C});t.MxCpp.mxcadassemblyimp=F;let A=new F.McApp;A.Init(),t.MxCpp.App.init(A),B(t.MxCpp)}function gD(B,D){return new Promise(async(C,E)=>{try{B.locateFile||(B.locateFile=JD);const F=new L(B);L.onloadWasmMxDraw3dModel=()=>{C(F),D&&D(F)}}catch(F){E(F)}})}const XD=Object.freeze(Object.defineProperty({__proto__:null,fetchAndInstantiate:uD,b64Encode:z,b64Decode:H,saveAsFileDialog:q,downloadFile:$,MxTools:v,drawText:lD,drawCircle:J,drawLine:AD,drawMText:hD,drawPolyLine:eD,drawPolygon:tD,drawArc:nD,drawEllipticalArc:sD,mxErase:aD,McObject:R,McRxObject:P,McDbDatabase:Q,McDbLayerTable:Y,McDbEntity:k,McDbCurve:j,McDbLine:U,McDbText:G,McDbCircle:N,get McDb(){return t.McDb},McDrawUtility:K,McObjectId:w,McDrawResbuf:DD,McDbPolyline:Z,McDbBlockTable:ED,McDbBlockTableIterator:BD,McDbBlockTableRecord:W,McDbBlockTableRecordIterator:CD,MxDraw3d:L,get MxCpp(){return t.MxCpp},loadMxCADassembly:yD,loadMxCADassembly3d:gD},Symbol.toStringTag,{value:"Module"}));t.McDbBlockTable=ED,t.McDbBlockTableIterator=BD,t.McDbBlockTableRecord=W,t.McDbBlockTableRecordIterator=CD,t.McDbCircle=N,t.McDbCurve=j,t.McDbDatabase=Q,t.McDbEntity=k,t.McDbLayerTable=Y,t.McDbLine=U,t.McDbPolyline=Z,t.McDbText=G,t.McDrawResbuf=DD,t.McDrawUtility=K,t.McObject=R,t.McObjectId=w,t.McRxObject=P,t.MxDraw3d=L,t.MxTools=v,t.b64Decode=H,t.b64Encode=z,t.default=XD,t.downloadFile=$,t.drawArc=nD,t.drawCircle=J,t.drawEllipticalArc=sD,t.drawLine=AD,t.drawMText=hD,t.drawPolyLine=eD,t.drawPolygon=tD,t.drawText=lD,t.fetchAndInstantiate=uD,t.loadMxCADassembly=yD,t.loadMxCADassembly3d=gD,t.mxErase=aD,t.saveAsFileDialog=q,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mxcad",
3
- "version": "1.0.43",
3
+ "version": "1.0.44",
4
4
  "main": "./dist/mxcad.umd.js",
5
5
  "module": "./dist/mxcad.es.js",
6
6
  "typings": "dist/mxcad.d.ts",
@@ -29,7 +29,8 @@
29
29
  "cz": "czg",
30
30
  "dev:docs": "node docs/typedoc.js && vitepress dev docs",
31
31
  "build:docs": "node docs/typedoc.js && vitepress build docs",
32
- "pub": "npm run add-commit && release-it",
32
+ "npm-pub": "npm run add-commit && release-it",
33
+ "docs-pub": "docs-deploy.sh",
33
34
  "add-commit": "npm run build && git add docs dist && npx git-cz",
34
35
  "pub-init": "git init && git remote add origin https://github.com/mxcad/mxcad_docs.git -f && git add docs dist && git commit -m\"init\" && git branch --set-upstream-to=origin/master master",
35
36
  "test:coverage": "jest --runInBand --coverage",