@versa_ai/vmml-editor 1.0.47 → 1.0.48

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @versa_ai/vmml-editor@1.0.47 build D:\code\work\vmml-player\packages\editor
2
+ > @versa_ai/vmml-editor@1.0.48 build D:\code\work\vmml-player\packages\editor
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: src/index.tsx
@@ -9,7 +9,6 @@
9
9
  CLI Target: node16
10
10
  CJS Build start
11
11
  ESM Build start
12
- DTS Build start
13
12
 
14
13
   WARN  ▲ [WARNING] Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.
15
14
 
@@ -124,12 +123,13 @@ More info and automated migrator: https://sass-lang.com/d/slash-div [35
124
123
 
125
124
 
126
125
 
127
- ESM dist\index.mjs 115.63 KB
128
- ESM dist\index.mjs.map 224.90 KB
129
- ESM ⚡️ Build success in 918ms
130
- CJS dist\index.js 117.40 KB
131
- CJS dist\index.js.map 225.19 KB
132
- CJS ⚡️ Build success in 918ms
133
- DTS ⚡️ Build success in 2182ms
126
+ DTS Build start
127
+ ESM dist\index.mjs 115.85 KB
128
+ ESM dist\index.mjs.map 225.42 KB
129
+ ESM ⚡️ Build success in 914ms
130
+ CJS dist\index.js 117.63 KB
131
+ CJS dist\index.js.map 225.71 KB
132
+ CJS ⚡️ Build success in 915ms
133
+ DTS ⚡️ Build success in 1983ms
134
134
  DTS dist\index.d.ts 158.00 B
135
135
  DTS dist\index.d.mts 158.00 B
package/README.md CHANGED
@@ -1 +1 @@
1
- # `@versa_ai/vmml-editor`
1
+ # `@versa_ai/vmml-editor`
package/dist/index.js CHANGED
@@ -1344,6 +1344,8 @@ var EditorCanvas = react.forwardRef(
1344
1344
  window.dispatchEvent(event);
1345
1345
  };
1346
1346
  const createTextObjs = async ({ strokeW, stColor, fontAssetUrl = null, letterSpace, bgColor, textContent, textBasicInfo, textColor }) => {
1347
+ const { width, height } = vmml.template.dimension;
1348
+ const fontSize = vmmlUtils.getFontSize(width, height);
1347
1349
  let fontFamily = "sansMedium";
1348
1350
  if (fontAssetUrl) {
1349
1351
  const base64 = await loadFont(fontAssetUrl);
@@ -1354,7 +1356,9 @@ var EditorCanvas = react.forwardRef(
1354
1356
  }
1355
1357
  const lines = textContent.split("\n").filter((item) => item);
1356
1358
  const lineHeight = 22 + strokeW;
1357
- const paddingX = 7;
1359
+ const paddingX = 60 * 22 / fontSize;
1360
+ const paddingY = 50 * 22 / fontSize;
1361
+ const round = 40 * 22 / fontSize;
1358
1362
  const groupWidth = Math.max(...lines.map((l) => {
1359
1363
  let options = { fontSize: 22, fontFamily, strokeWidth: strokeW ?? 0 };
1360
1364
  if (letterSpace) options.charSpacing = letterSpace;
@@ -1406,13 +1410,13 @@ var EditorCanvas = react.forwardRef(
1406
1410
  });
1407
1411
  const bgRect = new fabric.fabric.Rect({
1408
1412
  width: groupWidth,
1409
- height: groupHeight + 13,
1413
+ height: groupHeight + paddingY * 2,
1410
1414
  // padddingY: 6.5
1411
1415
  fill: bgColor,
1412
1416
  originX: "left",
1413
1417
  originY: "center",
1414
- rx: 5,
1415
- ry: 5
1418
+ rx: round,
1419
+ ry: round
1416
1420
  });
1417
1421
  return {
1418
1422
  objects: [bgRect, ...textObjs],