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