adtec-core-package 1.4.8 → 1.4.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adtec-core-package",
3
- "version": "1.4.8",
3
+ "version": "1.4.9",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -70,7 +70,7 @@ const fontSizes = [
70
70
  { name: "小初", pt: 36, px: 42 },
71
71
  { name: "初号", pt: 42, px: 49 }
72
72
  ];
73
- function convertPxToPt(html) {
73
+ function convertPxToPt(html: string) {
74
74
  const regex = /font-size: (\d+)px/g;
75
75
  return html.replace(regex, (match, pxValue) => {
76
76
  const px = parseInt(pxValue, 10);
@@ -81,7 +81,7 @@ function convertPxToPt(html) {
81
81
  return match;
82
82
  });
83
83
  }
84
- function convertPtToPx(html) {
84
+ function convertPtToPx(html: string) {
85
85
  const regex = /font-size: (\d+)pt/g;
86
86
  return html.replace(regex, (match, ptValue) => {
87
87
  const pt = parseFloat(ptValue);
@@ -158,7 +158,7 @@ function calcImagesHeight(html: string) {
158
158
  const map = new Map()
159
159
  const imageElements = divRef.value.querySelectorAll('img.resize-obj');
160
160
  if (imageElements.length > 0) {
161
- imageElements.forEach((imageElement) => {
161
+ imageElements.forEach((imageElement: any) => {
162
162
  const width = imageElement.offsetWidth;
163
163
  const height = imageElement.offsetHeight;
164
164
  if (width > 1 && height > 1) {
@@ -211,7 +211,7 @@ function customStringReplacement(str: string, startMarker: string, endMarker: st
211
211
  // }
212
212
  // },
213
213
  // )
214
- function initHtml(html) {
214
+ function initHtml(html: string) {
215
215
  html = customStringReplacement(html, '<img', '>', 'height="[0-9]+"', 'height="auto"')
216
216
  return convertPtToPx(html)
217
217
  }