@leafer-in/html 1.0.0-rc.24 → 1.0.0-rc.26

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/html.cjs CHANGED
@@ -84,3 +84,5 @@ __decorate([
84
84
  exports.HTMLText = __decorate([
85
85
  draw.registerUI()
86
86
  ], exports.HTMLText);
87
+
88
+ exports.HTMLTextData = HTMLTextData;
package/dist/html.esm.js CHANGED
@@ -83,4 +83,4 @@ HTMLText = __decorate([
83
83
  registerUI()
84
84
  ], HTMLText);
85
85
 
86
- export { HTMLText };
86
+ export { HTMLText, HTMLTextData };
@@ -1 +1 @@
1
- import{ImageData as t,dataProcessor as e,boundsType as n,registerUI as o,Image as i}from"@leafer-ui/draw";function r(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var d=t.length-1;d>=0;d--)(i=t[d])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s}"function"==typeof SuppressedError&&SuppressedError;let s=class extends i{get __tag(){return"HTMLText"}constructor(t){super(t)}__updateBoxBounds(){if(this.__.__htmlChanged){const t=document.createElement("div"),{style:e}=t;e.all="initial",e.position="absolute",e.visibility="hidden",t.innerHTML=this.text,document.body.appendChild(t);const{width:n,height:o}=t.getBoundingClientRect(),i=10,r=`<svg xmlns="http://www.w3.org/2000/svg" width="${n+i}" height="${o}">\n <foreignObject width="${n+i}" height="${o}">\n <style>\n * {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n </style>\n <body xmlns="http://www.w3.org/1999/xhtml">\n ${this.text}\n </body>\n </foreignObject>\n </svg>`;this.__.__setImageFill("data:image/svg+xml,"+encodeURIComponent(r)),this.__.__htmlChanged=!1,t.remove()}super.__updateBoxBounds()}};r([e(class extends t{setText(t){this._text=t,this.__htmlChanged=!0}})],s.prototype,"__",void 0),r([n("")],s.prototype,"text",void 0),s=r([o()],s);export{s as HTMLText};
1
+ import{ImageData as t,dataProcessor as e,boundsType as n,registerUI as o,Image as i}from"@leafer-ui/draw";function r(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var d=t.length-1;d>=0;d--)(i=t[d])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s}"function"==typeof SuppressedError&&SuppressedError;class s extends t{setText(t){this._text=t,this.__htmlChanged=!0}}let d=class extends i{get __tag(){return"HTMLText"}constructor(t){super(t)}__updateBoxBounds(){if(this.__.__htmlChanged){const t=document.createElement("div"),{style:e}=t;e.all="initial",e.position="absolute",e.visibility="hidden",t.innerHTML=this.text,document.body.appendChild(t);const{width:n,height:o}=t.getBoundingClientRect(),i=10,r=`<svg xmlns="http://www.w3.org/2000/svg" width="${n+i}" height="${o}">\n <foreignObject width="${n+i}" height="${o}">\n <style>\n * {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n </style>\n <body xmlns="http://www.w3.org/1999/xhtml">\n ${this.text}\n </body>\n </foreignObject>\n </svg>`;this.__.__setImageFill("data:image/svg+xml,"+encodeURIComponent(r)),this.__.__htmlChanged=!1,t.remove()}super.__updateBoxBounds()}};r([e(s)],d.prototype,"__",void 0),r([n("")],d.prototype,"text",void 0),d=r([o()],d);export{d as HTMLText,s as HTMLTextData};
package/dist/html.js CHANGED
@@ -85,6 +85,8 @@ this.LeaferIN.html = (function (exports, draw) {
85
85
  draw.registerUI()
86
86
  ], exports.HTMLText);
87
87
 
88
+ exports.HTMLTextData = HTMLTextData;
89
+
88
90
  return exports;
89
91
 
90
92
  })({}, LeaferUI);
package/dist/html.min.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var e=require("@leafer-ui/draw");function t(e,t,n,o){var r,s=arguments.length,i=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,o);else for(var d=e.length-1;d>=0;d--)(r=e[d])&&(i=(s<3?r(i):s>3?r(t,n,i):r(t,n))||i);return s>3&&i&&Object.defineProperty(t,n,i),i}"function"==typeof SuppressedError&&SuppressedError;class n extends e.ImageData{setText(e){this._text=e,this.__htmlChanged=!0}}exports.HTMLText=class extends e.Image{get __tag(){return"HTMLText"}constructor(e){super(e)}__updateBoxBounds(){if(this.__.__htmlChanged){const e=document.createElement("div"),{style:t}=e;t.all="initial",t.position="absolute",t.visibility="hidden",e.innerHTML=this.text,document.body.appendChild(e);const{width:n,height:o}=e.getBoundingClientRect(),r=10,s=`<svg xmlns="http://www.w3.org/2000/svg" width="${n+r}" height="${o}">\n <foreignObject width="${n+r}" height="${o}">\n <style>\n * {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n </style>\n <body xmlns="http://www.w3.org/1999/xhtml">\n ${this.text}\n </body>\n </foreignObject>\n </svg>`;this.__.__setImageFill("data:image/svg+xml,"+encodeURIComponent(s)),this.__.__htmlChanged=!1,e.remove()}super.__updateBoxBounds()}},t([e.dataProcessor(n)],exports.HTMLText.prototype,"__",void 0),t([e.boundsType("")],exports.HTMLText.prototype,"text",void 0),exports.HTMLText=t([e.registerUI()],exports.HTMLText);
1
+ "use strict";var e=require("@leafer-ui/draw");function t(e,t,n,o){var r,s=arguments.length,i=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,o);else for(var d=e.length-1;d>=0;d--)(r=e[d])&&(i=(s<3?r(i):s>3?r(t,n,i):r(t,n))||i);return s>3&&i&&Object.defineProperty(t,n,i),i}"function"==typeof SuppressedError&&SuppressedError;class n extends e.ImageData{setText(e){this._text=e,this.__htmlChanged=!0}}exports.HTMLText=class extends e.Image{get __tag(){return"HTMLText"}constructor(e){super(e)}__updateBoxBounds(){if(this.__.__htmlChanged){const e=document.createElement("div"),{style:t}=e;t.all="initial",t.position="absolute",t.visibility="hidden",e.innerHTML=this.text,document.body.appendChild(e);const{width:n,height:o}=e.getBoundingClientRect(),r=10,s=`<svg xmlns="http://www.w3.org/2000/svg" width="${n+r}" height="${o}">\n <foreignObject width="${n+r}" height="${o}">\n <style>\n * {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n </style>\n <body xmlns="http://www.w3.org/1999/xhtml">\n ${this.text}\n </body>\n </foreignObject>\n </svg>`;this.__.__setImageFill("data:image/svg+xml,"+encodeURIComponent(s)),this.__.__htmlChanged=!1,e.remove()}super.__updateBoxBounds()}},t([e.dataProcessor(n)],exports.HTMLText.prototype,"__",void 0),t([e.boundsType("")],exports.HTMLText.prototype,"text",void 0),exports.HTMLText=t([e.registerUI()],exports.HTMLText),exports.HTMLTextData=n;
package/dist/html.min.js CHANGED
@@ -1 +1 @@
1
- this.LeaferIN=this.LeaferIN||{},this.LeaferIN.html=function(e,t){"use strict";function n(e,t,n,o){var i,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var d=e.length-1;d>=0;d--)(i=e[d])&&(s=(r<3?i(s):r>3?i(t,n,s):i(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s}"function"==typeof SuppressedError&&SuppressedError;class o extends t.ImageData{setText(e){this._text=e,this.__htmlChanged=!0}}return e.HTMLText=class extends t.Image{get __tag(){return"HTMLText"}constructor(e){super(e)}__updateBoxBounds(){if(this.__.__htmlChanged){const e=document.createElement("div"),{style:t}=e;t.all="initial",t.position="absolute",t.visibility="hidden",e.innerHTML=this.text,document.body.appendChild(e);const{width:n,height:o}=e.getBoundingClientRect(),i=10,r=`<svg xmlns="http://www.w3.org/2000/svg" width="${n+i}" height="${o}">\n <foreignObject width="${n+i}" height="${o}">\n <style>\n * {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n </style>\n <body xmlns="http://www.w3.org/1999/xhtml">\n ${this.text}\n </body>\n </foreignObject>\n </svg>`;this.__.__setImageFill("data:image/svg+xml,"+encodeURIComponent(r)),this.__.__htmlChanged=!1,e.remove()}super.__updateBoxBounds()}},n([t.dataProcessor(o)],e.HTMLText.prototype,"__",void 0),n([t.boundsType("")],e.HTMLText.prototype,"text",void 0),e.HTMLText=n([t.registerUI()],e.HTMLText),e}({},LeaferUI);
1
+ this.LeaferIN=this.LeaferIN||{},this.LeaferIN.html=function(e,t){"use strict";function n(e,t,n,o){var i,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var d=e.length-1;d>=0;d--)(i=e[d])&&(s=(r<3?i(s):r>3?i(t,n,s):i(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s}"function"==typeof SuppressedError&&SuppressedError;class o extends t.ImageData{setText(e){this._text=e,this.__htmlChanged=!0}}return e.HTMLText=class extends t.Image{get __tag(){return"HTMLText"}constructor(e){super(e)}__updateBoxBounds(){if(this.__.__htmlChanged){const e=document.createElement("div"),{style:t}=e;t.all="initial",t.position="absolute",t.visibility="hidden",e.innerHTML=this.text,document.body.appendChild(e);const{width:n,height:o}=e.getBoundingClientRect(),i=10,r=`<svg xmlns="http://www.w3.org/2000/svg" width="${n+i}" height="${o}">\n <foreignObject width="${n+i}" height="${o}">\n <style>\n * {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n </style>\n <body xmlns="http://www.w3.org/1999/xhtml">\n ${this.text}\n </body>\n </foreignObject>\n </svg>`;this.__.__setImageFill("data:image/svg+xml,"+encodeURIComponent(r)),this.__.__htmlChanged=!1,e.remove()}super.__updateBoxBounds()}},n([t.dataProcessor(o)],e.HTMLText.prototype,"__",void 0),n([t.boundsType("")],e.HTMLText.prototype,"text",void 0),e.HTMLText=n([t.registerUI()],e.HTMLText),e.HTMLTextData=o,e}({},LeaferUI);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-in/html",
3
- "version": "1.0.0-rc.24",
3
+ "version": "1.0.0-rc.26",
4
4
  "description": "@leafer-in/html",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -34,8 +34,8 @@
34
34
  "leaferjs"
35
35
  ],
36
36
  "dependencies": {
37
- "@leafer-ui/draw": "1.0.0-rc.24",
38
- "@leafer-ui/interface": "1.0.0-rc.24",
39
- "@leafer-in/interface": "1.0.0-rc.24"
37
+ "@leafer-ui/draw": "1.0.0-rc.26",
38
+ "@leafer-ui/interface": "1.0.0-rc.26",
39
+ "@leafer-in/interface": "1.0.0-rc.26"
40
40
  }
41
41
  }
package/src/index.ts CHANGED
@@ -1 +1,2 @@
1
- export { HTMLText } from './HTMLText'
1
+ export { HTMLText } from './HTMLText'
2
+ export { HTMLTextData } from './data/HTMLTextData'
package/types/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { IImage, IString } from '@leafer-ui/interface';
2
- import { Image } from '@leafer-ui/draw';
2
+ import { Image, ImageData } from '@leafer-ui/draw';
3
3
  import { IHTMLTextData, IHTMLTextInputData } from '@leafer-in/interface';
4
4
 
5
5
  declare class HTMLText extends Image implements IImage {
@@ -10,4 +10,10 @@ declare class HTMLText extends Image implements IImage {
10
10
  __updateBoxBounds(): void;
11
11
  }
12
12
 
13
- export { HTMLText };
13
+ declare class HTMLTextData extends ImageData implements IHTMLTextData {
14
+ _text: string;
15
+ __htmlChanged: boolean;
16
+ setText(value: IString): void;
17
+ }
18
+
19
+ export { HTMLText, HTMLTextData };