@leafer-ui/miniapp 1.3.2 → 1.4.0

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.
@@ -487,7 +487,7 @@ class Layouter {
487
487
  }
488
488
  partLayout() {
489
489
  var _a;
490
- if (!((_a = this.__updatedList) === null || _a === void 0 ? void 0 : _a.length))
490
+ if (!((_a = this.__updatedList) === null || _a === undefined ? undefined : _a.length))
491
491
  return;
492
492
  const t = Run.start('PartLayout');
493
493
  const { target, __updatedList: updateList } = this;
@@ -1671,7 +1671,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1671
1671
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1672
1672
  PERFORMANCE OF THIS SOFTWARE.
1673
1673
  ***************************************************************************** */
1674
- /* global Reflect, Promise, SuppressedError, Symbol */
1674
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
1675
1675
 
1676
1676
 
1677
1677
  function __awaiter(thisArg, _arguments, P, generator) {
@@ -1732,7 +1732,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
1732
1732
  }
1733
1733
  else {
1734
1734
  if (!paint.patternTask) {
1735
- paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function* () {
1735
+ paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, undefined, undefined, function* () {
1736
1736
  paint.patternTask = null;
1737
1737
  if (canvas.bounds.hit(ui.__nowWorld))
1738
1738
  createPattern(ui, paint, pixelRatio);
@@ -1888,7 +1888,7 @@ function shadow(ui, current, shape) {
1888
1888
  const end = shadow.length - 1;
1889
1889
  toOffsetOutBounds$1(bounds, offsetOutBounds$1);
1890
1890
  shadow.forEach((item, index) => {
1891
- other.setWorldShadow((offsetOutBounds$1.offsetX + item.x * scaleX), (offsetOutBounds$1.offsetY + item.y * scaleY), item.blur * scaleX, item.color);
1891
+ other.setWorldShadow((offsetOutBounds$1.offsetX + item.x * scaleX), (offsetOutBounds$1.offsetY + item.y * scaleY), item.blur * scaleX, ColorConvert.string(item.color));
1892
1892
  spreadScale = item.spread ? 1 + item.spread * 2 / (__layout.boxBounds.width + (__layout.strokeBoxSpread || 0) * 2) : 0;
1893
1893
  drawWorldShadow(other, offsetOutBounds$1, spreadScale, shape);
1894
1894
  copyBounds = bounds;
@@ -1964,7 +1964,7 @@ function innerShadow(ui, current, shape) {
1964
1964
  other.copyWorld(shape.canvas, shapeBounds, bounds, 'source-out');
1965
1965
  copyBounds = bounds;
1966
1966
  }
1967
- other.fillWorld(copyBounds, item.color, 'source-in');
1967
+ other.fillWorld(copyBounds, ColorConvert.string(item.color), 'source-in');
1968
1968
  if (ui.__worldFlipped) {
1969
1969
  current.copyWorldByReset(other, copyBounds, nowWorld, item.blendMode);
1970
1970
  }
@@ -2322,11 +2322,11 @@ const TextMode = 2;
2322
2322
  function layoutChar(drawData, style, width, _height) {
2323
2323
  const { rows } = drawData;
2324
2324
  const { textAlign, paraIndent, letterSpacing } = style;
2325
- let charX, addWordWidth, indentWidth, mode, wordChar;
2325
+ let charX, addWordWidth, indentWidth, mode, wordChar, wordsLength;
2326
2326
  rows.forEach(row => {
2327
2327
  if (row.words) {
2328
- indentWidth = paraIndent && row.paraStart ? paraIndent : 0;
2329
- addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') && row.words.length > 1) ? (width - row.width - indentWidth) / (row.words.length - 1) : 0;
2328
+ indentWidth = paraIndent && row.paraStart ? paraIndent : 0, wordsLength = row.words.length;
2329
+ addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') && wordsLength > 1) ? (width - row.width - indentWidth) / (wordsLength - 1) : 0;
2330
2330
  mode = (letterSpacing || row.isOverflow) ? CharMode : (addWordWidth > 0.01 ? WordMode : TextMode);
2331
2331
  if (row.isOverflow && !letterSpacing)
2332
2332
  row.textMode = true;
@@ -2338,7 +2338,7 @@ function layoutChar(drawData, style, width, _height) {
2338
2338
  row.x += indentWidth;
2339
2339
  charX = row.x;
2340
2340
  row.data = [];
2341
- row.words.forEach(word => {
2341
+ row.words.forEach((word, index) => {
2342
2342
  if (mode === WordMode) {
2343
2343
  wordChar = { char: '', x: charX };
2344
2344
  charX = toWordChar(word.data, charX, wordChar);
@@ -2348,7 +2348,7 @@ function layoutChar(drawData, style, width, _height) {
2348
2348
  else {
2349
2349
  charX = toChar(word.data, charX, row.data, row.isOverflow);
2350
2350
  }
2351
- if (addWordWidth && (!row.paraEnd || textAlign === 'both')) {
2351
+ if (addWordWidth && (!row.paraEnd || textAlign === 'both') && (index !== wordsLength - 1)) {
2352
2352
  charX += addWordWidth;
2353
2353
  row.width += addWordWidth;
2354
2354
  }
@@ -2636,3 +2636,4 @@ if (platform === 'ios') {
2636
2636
  }
2637
2637
 
2638
2638
  export { Interaction, Layouter, LeaferCanvas, Picker, Renderer, Selector, Watcher, useCanvas };
2639
+ //# sourceMappingURL=miniapp.esm.js.map