@wcardinal/wcardinal-ui 0.402.0 → 0.404.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/types/wcardinal/ui/d-base-overflow-mask-simple.d.ts +3 -0
- package/dist/types/wcardinal/ui/d-base-overflow-mask.d.ts +6 -0
- package/dist/wcardinal/ui/d-base-overflow-mask-simple.js +9 -0
- package/dist/wcardinal/ui/d-base-overflow-mask-simple.js.map +1 -1
- package/dist/wcardinal/ui/d-base-overflow-mask.js +19 -2
- package/dist/wcardinal/ui/d-base-overflow-mask.js.map +1 -1
- package/dist/wcardinal/ui/util/util-svg-atlas-builder.js +11 -4
- package/dist/wcardinal/ui/util/util-svg-atlas-builder.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark-en-us.js +1 -1
- package/dist/wcardinal-ui-theme-dark-en-us.min.js +1 -1
- package/dist/wcardinal-ui-theme-dark-ja-jp.js +1 -1
- package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +1 -1
- package/dist/wcardinal-ui-theme-dark.js +1 -1
- package/dist/wcardinal-ui-theme-dark.min.js +1 -1
- package/dist/wcardinal-ui-theme-white-en-us.js +1 -1
- package/dist/wcardinal-ui-theme-white-en-us.min.js +1 -1
- package/dist/wcardinal-ui-theme-white-ja-jp.js +1 -1
- package/dist/wcardinal-ui-theme-white-ja-jp.min.js +1 -1
- package/dist/wcardinal-ui-theme-white.js +1 -1
- package/dist/wcardinal-ui-theme-white.min.js +1 -1
- package/dist/wcardinal-ui.cjs.js +40 -7
- package/dist/wcardinal-ui.js +40 -7
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,6 +2,9 @@ import { Graphics, Renderer } from "pixi.js";
|
|
|
2
2
|
import { DBase } from "./d-base";
|
|
3
3
|
import { DBaseReflowable } from "./d-base-reflowable";
|
|
4
4
|
export declare class DBaseOverflowMaskSimple extends Graphics implements DBaseReflowable {
|
|
5
|
+
protected _isInitialized: boolean;
|
|
6
|
+
protected _width: number;
|
|
7
|
+
protected _height: number;
|
|
5
8
|
constructor(parent: DBase);
|
|
6
9
|
render(renderer: Renderer): void;
|
|
7
10
|
onReflow(base: DBase, width: number, height: number): void;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { Graphics, Renderer } from "pixi.js";
|
|
2
2
|
import { DBase } from "./d-base";
|
|
3
3
|
import { DBaseReflowable } from "./d-base-reflowable";
|
|
4
|
+
import { DCornerMask } from "./d-corner-mask";
|
|
4
5
|
export declare class DBaseOverflowMask extends Graphics implements DBaseReflowable {
|
|
6
|
+
protected _isInitialized: boolean;
|
|
7
|
+
protected _width: number;
|
|
8
|
+
protected _height: number;
|
|
9
|
+
protected _cornderRadius: number;
|
|
10
|
+
protected _cornerMask: DCornerMask;
|
|
5
11
|
constructor(parent: DBase);
|
|
6
12
|
render(renderer: Renderer): void;
|
|
7
13
|
onReflow(base: DBase, width: number, height: number): void;
|
|
@@ -9,6 +9,9 @@ var DBaseOverflowMaskSimple = /** @class */ (function (_super) {
|
|
|
9
9
|
function DBaseOverflowMaskSimple(parent) {
|
|
10
10
|
var _this = _super.call(this) || this;
|
|
11
11
|
_this.parent = parent;
|
|
12
|
+
_this._isInitialized = false;
|
|
13
|
+
_this._width = _this.width;
|
|
14
|
+
_this._height = _this.height;
|
|
12
15
|
return _this;
|
|
13
16
|
}
|
|
14
17
|
DBaseOverflowMaskSimple.prototype.render = function (renderer) {
|
|
@@ -16,6 +19,12 @@ var DBaseOverflowMaskSimple = /** @class */ (function (_super) {
|
|
|
16
19
|
_super.prototype.render.call(this, renderer);
|
|
17
20
|
};
|
|
18
21
|
DBaseOverflowMaskSimple.prototype.onReflow = function (base, width, height) {
|
|
22
|
+
if (this._isInitialized && this._width === width && this._height === height) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
this._isInitialized = true;
|
|
26
|
+
this._width = width;
|
|
27
|
+
this._height = height;
|
|
19
28
|
this.clear();
|
|
20
29
|
this.beginFill(0xffffff, 1);
|
|
21
30
|
this.drawRect(0, 0, width, height);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-base-overflow-mask-simple.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-base-overflow-mask-simple.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,QAAQ,EAAY,MAAM,SAAS,CAAC;AAI7C;IAA6C,2CAAQ;
|
|
1
|
+
{"version":3,"file":"d-base-overflow-mask-simple.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-base-overflow-mask-simple.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,QAAQ,EAAY,MAAM,SAAS,CAAC;AAI7C;IAA6C,2CAAQ;IAKpD,iCAAY,MAAa;QAAzB,YACC,iBAAO,SAMP;QALA,KAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,KAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAC5B,KAAI,CAAC,MAAM,GAAG,KAAI,CAAC,KAAK,CAAC;QACzB,KAAI,CAAC,OAAO,GAAG,KAAI,CAAC,MAAM,CAAC;;IAC5B,CAAC;IAED,wCAAM,GAAN,UAAO,QAAkB;QACxB,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,iBAAM,MAAM,YAAC,QAAQ,CAAC,CAAC;IACxB,CAAC;IAED,0CAAQ,GAAR,UAAS,IAAW,EAAE,KAAa,EAAE,MAAc;QAClD,IAAI,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK,IAAI,IAAI,CAAC,OAAO,KAAK,MAAM,EAAE;YAC5E,OAAO;SACP;QACD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAEtB,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QAC5B,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QACnC,IAAI,CAAC,OAAO,EAAE,CAAC;IAChB,CAAC;IACF,8BAAC;AAAD,CAAC,AAhCD,CAA6C,QAAQ,GAgCpD","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Graphics, Renderer } from \"pixi.js\";\nimport { DBase } from \"./d-base\";\nimport { DBaseReflowable } from \"./d-base-reflowable\";\n\nexport class DBaseOverflowMaskSimple extends Graphics implements DBaseReflowable {\n\tprotected _isInitialized: boolean;\n\tprotected _width: number;\n\tprotected _height: number;\n\n\tconstructor(parent: DBase) {\n\t\tsuper();\n\t\tthis.parent = parent;\n\n\t\tthis._isInitialized = false;\n\t\tthis._width = this.width;\n\t\tthis._height = this.height;\n\t}\n\n\trender(renderer: Renderer): void {\n\t\tthis.updateTransform();\n\t\tsuper.render(renderer);\n\t}\n\n\tonReflow(base: DBase, width: number, height: number): void {\n\t\tif (this._isInitialized && this._width === width && this._height === height) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isInitialized = true;\n\t\tthis._width = width;\n\t\tthis._height = height;\n\n\t\tthis.clear();\n\t\tthis.beginFill(0xffffff, 1);\n\t\tthis.drawRect(0, 0, width, height);\n\t\tthis.endFill();\n\t}\n}\n"]}
|
|
@@ -10,6 +10,11 @@ var DBaseOverflowMask = /** @class */ (function (_super) {
|
|
|
10
10
|
function DBaseOverflowMask(parent) {
|
|
11
11
|
var _this = _super.call(this) || this;
|
|
12
12
|
_this.parent = parent;
|
|
13
|
+
_this._isInitialized = false;
|
|
14
|
+
_this._width = 0;
|
|
15
|
+
_this._height = 0;
|
|
16
|
+
_this._cornderRadius = 0;
|
|
17
|
+
_this._cornerMask = DCornerMask.NONE;
|
|
13
18
|
return _this;
|
|
14
19
|
}
|
|
15
20
|
DBaseOverflowMask.prototype.render = function (renderer) {
|
|
@@ -17,11 +22,23 @@ var DBaseOverflowMask = /** @class */ (function (_super) {
|
|
|
17
22
|
_super.prototype.render.call(this, renderer);
|
|
18
23
|
};
|
|
19
24
|
DBaseOverflowMask.prototype.onReflow = function (base, width, height) {
|
|
20
|
-
var x = 0;
|
|
21
|
-
var y = 0;
|
|
22
25
|
var corner = base.corner;
|
|
23
26
|
var cornerRadius = Math.max(0, corner.getRadius() - 0.5);
|
|
24
27
|
var cornerMask = corner.getMask();
|
|
28
|
+
if (this._isInitialized &&
|
|
29
|
+
this._width === width &&
|
|
30
|
+
this._height === height &&
|
|
31
|
+
this._cornderRadius === cornerRadius &&
|
|
32
|
+
this._cornerMask === cornerMask) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
this._isInitialized = true;
|
|
36
|
+
this._width = width;
|
|
37
|
+
this._height = height;
|
|
38
|
+
this._cornderRadius = cornerRadius;
|
|
39
|
+
this._cornerMask = cornerMask;
|
|
40
|
+
var x = 0;
|
|
41
|
+
var y = 0;
|
|
25
42
|
var tl = cornerMask & DCornerMask.TOP_LEFT ? 0 : cornerRadius;
|
|
26
43
|
var tr = cornerMask & DCornerMask.TOP_RIGHT ? 0 : cornerRadius;
|
|
27
44
|
var bl = cornerMask & DCornerMask.BOTTOM_LEFT ? 0 : cornerRadius;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-base-overflow-mask.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-base-overflow-mask.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,QAAQ,EAAY,MAAM,SAAS,CAAC;AAG7C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C;IAAuC,qCAAQ;
|
|
1
|
+
{"version":3,"file":"d-base-overflow-mask.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui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AAI,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC;aAC1B;YACD,IAAI,CAAC,GAAG,EAAE,EAAE;gBACX,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,EAAE,CAAC,CAAC;aACrD;iBAAM;gBACN,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC;aACnC;YACD,IAAI,CAAC,GAAG,EAAE,EAAE;gBACX,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;aACpC;iBAAM;gBACN,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC;aAC3B;YACD,IAAI,CAAC,GAAG,EAAE,EAAE;gBACX,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;aACnC;iBAAM;gBACN,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;aAClB;SACD;QACD,IAAI,CAAC,OAAO,EAAE,CAAC;IAChB,CAAC;IACF,wBAAC;AAAD,CAAC,AA9ED,CAAuC,QAAQ,GA8E9C","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Graphics, Renderer } from \"pixi.js\";\nimport { DBase } from \"./d-base\";\nimport { DBaseReflowable } from \"./d-base-reflowable\";\nimport { DCornerMask } from \"./d-corner-mask\";\n\nexport class DBaseOverflowMask extends Graphics implements DBaseReflowable {\n\tprotected _isInitialized: boolean;\n\tprotected _width: number;\n\tprotected _height: number;\n\tprotected _cornderRadius: number;\n\tprotected _cornerMask: DCornerMask;\n\n\tconstructor(parent: DBase) {\n\t\tsuper();\n\t\tthis.parent = parent;\n\n\t\tthis._isInitialized = false;\n\t\tthis._width = 0;\n\t\tthis._height = 0;\n\t\tthis._cornderRadius = 0;\n\t\tthis._cornerMask = DCornerMask.NONE;\n\t}\n\n\trender(renderer: Renderer): void {\n\t\tthis.updateTransform();\n\t\tsuper.render(renderer);\n\t}\n\n\tonReflow(base: DBase, width: number, height: number): void {\n\t\tconst corner = base.corner;\n\t\tconst cornerRadius = Math.max(0, corner.getRadius() - 0.5);\n\t\tconst cornerMask = corner.getMask();\n\t\tif (\n\t\t\tthis._isInitialized &&\n\t\t\tthis._width === width &&\n\t\t\tthis._height === height &&\n\t\t\tthis._cornderRadius === cornerRadius &&\n\t\t\tthis._cornerMask === cornerMask\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isInitialized = true;\n\t\tthis._width = width;\n\t\tthis._height = height;\n\t\tthis._cornderRadius = cornerRadius;\n\t\tthis._cornerMask = cornerMask;\n\n\t\tconst x = 0;\n\t\tconst y = 0;\n\t\tconst tl = cornerMask & DCornerMask.TOP_LEFT ? 0 : cornerRadius;\n\t\tconst tr = cornerMask & DCornerMask.TOP_RIGHT ? 0 : cornerRadius;\n\t\tconst bl = cornerMask & DCornerMask.BOTTOM_LEFT ? 0 : cornerRadius;\n\t\tconst br = cornerMask & DCornerMask.BOTTOM_RIGHT ? 0 : cornerRadius;\n\t\tthis.clear();\n\t\tthis.beginFill(0xffffff, 1);\n\t\tthis.lineStyle(0, 0, 0, 0, false);\n\t\tif (tl <= 0 && tr <= 0 && bl <= 0 && br <= 0) {\n\t\t\tthis.drawRect(x, y, width, height);\n\t\t} else {\n\t\t\tthis.moveTo(x + tl, y);\n\t\t\tif (0 < tr) {\n\t\t\t\tthis.arcTo(x + width, y, x + width, y + height, tr);\n\t\t\t} else {\n\t\t\t\tthis.lineTo(x + width, y);\n\t\t\t}\n\t\t\tif (0 < br) {\n\t\t\t\tthis.arcTo(x + width, y + height, x, y + height, br);\n\t\t\t} else {\n\t\t\t\tthis.lineTo(x + width, y + height);\n\t\t\t}\n\t\t\tif (0 < bl) {\n\t\t\t\tthis.arcTo(x, y + height, x, y, bl);\n\t\t\t} else {\n\t\t\t\tthis.lineTo(x, y + height);\n\t\t\t}\n\t\t\tif (0 < tl) {\n\t\t\t\tthis.arcTo(x, y, x + width, y, tl);\n\t\t\t} else {\n\t\t\t\tthis.lineTo(x, y);\n\t\t\t}\n\t\t}\n\t\tthis.endFill();\n\t}\n}\n"]}
|
|
@@ -6,13 +6,20 @@ import { BaseTexture, Rectangle, Texture, settings } from "pixi.js";
|
|
|
6
6
|
import { toSvgUrl } from "./to-svg-url";
|
|
7
7
|
var UtilSvgAtlasBuilder = /** @class */ (function () {
|
|
8
8
|
function UtilSvgAtlasBuilder(options) {
|
|
9
|
-
var _a, _b, _c, _d, _e, _f
|
|
9
|
+
var _a, _b, _c, _d, _e, _f;
|
|
10
10
|
this._width = (_a = options.width) !== null && _a !== void 0 ? _a : 256;
|
|
11
11
|
this._ratio = (_b = options.ratio) !== null && _b !== void 0 ? _b : 1;
|
|
12
12
|
this._margin = (_c = options.margin) !== null && _c !== void 0 ? _c : 3;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
var resolution = options.resolution;
|
|
14
|
+
if (resolution != null) {
|
|
15
|
+
this._resolution = resolution;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
var dpr = (_d = window.devicePixelRatio) !== null && _d !== void 0 ? _d : 1;
|
|
19
|
+
this._resolution = 2 < dpr ? dpr : dpr * 2;
|
|
20
|
+
}
|
|
21
|
+
this._scaling = (_e = options.scaling) !== null && _e !== void 0 ? _e : settings.SCALE_MODE;
|
|
22
|
+
this._mipmap = (_f = options.mipmap) !== null && _f !== void 0 ? _f : settings.MIPMAP_TEXTURES;
|
|
16
23
|
this._frames = {};
|
|
17
24
|
this._svg = "";
|
|
18
25
|
this._nextX = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util-svg-atlas-builder.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/util/util-svg-atlas-builder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAgB,SAAS,EAAe,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/F,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAiBxC;IAgBC,6BAAY,OAAmC;;QAC9C,IAAI,CAAC,MAAM,GAAG,MAAA,OAAO,CAAC,KAAK,mCAAI,GAAG,CAAC;QACnC,IAAI,CAAC,MAAM,GAAG,MAAA,OAAO,CAAC,KAAK,mCAAI,CAAC,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,MAAA,OAAO,CAAC,MAAM,mCAAI,CAAC,CAAC;QACnC,IAAI,CAAC,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"util-svg-atlas-builder.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/util/util-svg-atlas-builder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAgB,SAAS,EAAe,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/F,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAiBxC;IAgBC,6BAAY,OAAmC;;QAC9C,IAAI,CAAC,MAAM,GAAG,MAAA,OAAO,CAAC,KAAK,mCAAI,GAAG,CAAC;QACnC,IAAI,CAAC,MAAM,GAAG,MAAA,OAAO,CAAC,KAAK,mCAAI,CAAC,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,MAAA,OAAO,CAAC,MAAM,mCAAI,CAAC,CAAC;QACnC,IAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACtC,IAAI,UAAU,IAAI,IAAI,EAAE;YACvB,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;SAC9B;aAAM;YACN,IAAM,GAA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AAG,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;YACzB,KAAK,IAAM,MAAI,IAAI,QAAM,EAAE;gBAC1B,KAAK,CAAC,MAAI,CAAC,GAAG,IAAI,OAAO,CAAC,WAAW,EAAE,QAAM,CAAC,MAAI,CAAC,CAAC,CAAC;aACrD;SACD;QACD,OAAO,KAAK,CAAC;IACd,CAAC;IACF,0BAAC;AAAD,CAAC,AA5ID,IA4IC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { BaseTexture, MIPMAP_MODES, Rectangle, SCALE_MODES, Texture, settings } from \"pixi.js\";\nimport { toSvgUrl } from \"./to-svg-url\";\n\nexport interface UtilSvgAtlasBuilderBuildOptions {\n\tforce?: boolean;\n\tscaling?: SCALE_MODES;\n\tresolution?: number;\n}\n\nexport interface UtilSvgAtlasBuilderOptions {\n\twidth?: number;\n\tratio?: number;\n\tmargin?: number;\n\tresolution?: number;\n\tscaling?: SCALE_MODES;\n\tmipmap?: MIPMAP_MODES;\n}\n\nexport class UtilSvgAtlasBuilder {\n\tprotected _width: number;\n\tprotected _ratio: number;\n\tprotected _margin: number;\n\tprotected _resolution: number;\n\tprotected _scaling: SCALE_MODES;\n\tprotected _mipmap: MIPMAP_MODES;\n\n\tprotected _frames: Record<string, Rectangle>;\n\tprotected _svg: string;\n\tprotected _nextX: number;\n\tprotected _nextY: number;\n\tprotected _height: number;\n\n\tprotected _built?: Record<string, Texture>;\n\n\tconstructor(options: UtilSvgAtlasBuilderOptions) {\n\t\tthis._width = options.width ?? 256;\n\t\tthis._ratio = options.ratio ?? 1;\n\t\tthis._margin = options.margin ?? 3;\n\t\tconst resolution = options.resolution;\n\t\tif (resolution != null) {\n\t\t\tthis._resolution = resolution;\n\t\t} else {\n\t\t\tconst dpr = window.devicePixelRatio ?? 1;\n\t\t\tthis._resolution = 2 < dpr ? dpr : dpr * 2;\n\t\t}\n\t\tthis._scaling = options.scaling ?? settings.SCALE_MODE;\n\t\tthis._mipmap = options.mipmap ?? settings.MIPMAP_TEXTURES;\n\n\t\tthis._frames = {};\n\t\tthis._svg = \"\";\n\t\tthis._nextX = 0;\n\t\tthis._nextY = 0;\n\t\tthis._height = 0;\n\t}\n\n\tget width(): number {\n\t\treturn this._width;\n\t}\n\n\tget ratio(): number {\n\t\treturn this._ratio;\n\t}\n\n\tget margin(): number {\n\t\treturn this._margin;\n\t}\n\n\tadd(name: string, width: number, height: number, path: string): boolean;\n\tadd(\n\t\tname: string,\n\t\twidth: number,\n\t\theight: number,\n\t\tpath: string,\n\t\tframeX: number,\n\t\tframeY: number,\n\t\tframeWidth: number,\n\t\tframeHeight: number\n\t): boolean;\n\tadd(\n\t\tname: string,\n\t\twidth: number,\n\t\theight: number,\n\t\tpath: string,\n\t\tframeX?: number,\n\t\tframeY?: number,\n\t\tframeWidth?: number,\n\t\tframeHeight?: number\n\t): boolean {\n\t\tconst frames = this._frames;\n\t\tif (!(name in frames)) {\n\t\t\t// Position\n\t\t\tconst margin = this._margin;\n\t\t\tlet x = this._nextX;\n\t\t\tlet y = this._nextY;\n\t\t\tif (this._width <= x + width) {\n\t\t\t\tx = 0;\n\t\t\t\ty = this._nextY + this._height + margin;\n\t\t\t\tthis._height = height;\n\t\t\t\tthis._nextY = y;\n\t\t\t} else {\n\t\t\t\tthis._height = Math.max(this._height, height);\n\t\t\t}\n\t\t\tthis._nextX = x + width + margin;\n\n\t\t\t// Frame\n\t\t\tframes[name] = new Rectangle(\n\t\t\t\tx + (frameX ?? 0),\n\t\t\t\ty + (frameY ?? 0),\n\t\t\t\tframeWidth ?? width,\n\t\t\t\tframeHeight ?? height\n\t\t\t);\n\n\t\t\t// Svg\n\t\t\tconst ratio = this._ratio;\n\t\t\tthis._svg += `<g transform=\"translate(${x * ratio},${y * ratio})\">${path}</g>`;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\thas(name: string): boolean {\n\t\treturn name in this._frames;\n\t}\n\n\tget mappings(): Record<string, Texture> {\n\t\treturn this.build();\n\t}\n\n\tbuild(options?: UtilSvgAtlasBuilderBuildOptions): Record<string, Texture> {\n\t\tlet built = this._built;\n\t\tif (built == null || options?.force) {\n\t\t\tconst resolution = options?.resolution ?? this._resolution;\n\t\t\tconst width = this._width;\n\t\t\tconst height = Math.pow(2, Math.ceil(Math.log(this._nextY + this._height) / Math.LN2));\n\t\t\tconst realWidth = width * resolution;\n\t\t\tconst realHeight = height * resolution;\n\t\t\tconst ratio = this._ratio;\n\t\t\tconst attrWidth = `width=\"${realWidth}\"`;\n\t\t\tconst attrHeight = `height=\"${realHeight}\"`;\n\t\t\tconst attrViewBox = `viewBox=\"0 0 ${width * ratio} ${height * ratio}\"`;\n\t\t\tconst attrXmlns = `xmlns=\"http://www.w3.org/2000/svg\"`;\n\t\t\tconst url = toSvgUrl(\n\t\t\t\t`<svg ${attrWidth} ${attrHeight} ${attrViewBox} ${attrXmlns}>${this._svg}</svg>`\n\t\t\t);\n\t\t\tconst scaleMode = options?.scaling ?? this._scaling;\n\t\t\tconst baseTexture = BaseTexture.from(url, {\n\t\t\t\tresolution,\n\t\t\t\tscaleMode,\n\t\t\t\tmipmap: this._mipmap\n\t\t\t});\n\t\t\tconst frames = this._frames;\n\t\t\tbuilt = this._built = {};\n\t\t\tfor (const name in frames) {\n\t\t\t\tbuilt[name] = new Texture(baseTexture, frames[name]);\n\t\t\t}\n\t\t}\n\t\treturn built;\n\t}\n}\n"]}
|
package/dist/wcardinal-ui.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.
|
|
2
|
+
Winter Cardinal UI v0.404.0
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -15222,6 +15222,11 @@ var DBaseOverflowMask = /** @class */ (function (_super) {
|
|
|
15222
15222
|
function DBaseOverflowMask(parent) {
|
|
15223
15223
|
var _this = _super.call(this) || this;
|
|
15224
15224
|
_this.parent = parent;
|
|
15225
|
+
_this._isInitialized = false;
|
|
15226
|
+
_this._width = 0;
|
|
15227
|
+
_this._height = 0;
|
|
15228
|
+
_this._cornderRadius = 0;
|
|
15229
|
+
_this._cornerMask = DCornerMask.NONE;
|
|
15225
15230
|
return _this;
|
|
15226
15231
|
}
|
|
15227
15232
|
DBaseOverflowMask.prototype.render = function (renderer) {
|
|
@@ -15229,11 +15234,23 @@ var DBaseOverflowMask = /** @class */ (function (_super) {
|
|
|
15229
15234
|
_super.prototype.render.call(this, renderer);
|
|
15230
15235
|
};
|
|
15231
15236
|
DBaseOverflowMask.prototype.onReflow = function (base, width, height) {
|
|
15232
|
-
var x = 0;
|
|
15233
|
-
var y = 0;
|
|
15234
15237
|
var corner = base.corner;
|
|
15235
15238
|
var cornerRadius = Math.max(0, corner.getRadius() - 0.5);
|
|
15236
15239
|
var cornerMask = corner.getMask();
|
|
15240
|
+
if (this._isInitialized &&
|
|
15241
|
+
this._width === width &&
|
|
15242
|
+
this._height === height &&
|
|
15243
|
+
this._cornderRadius === cornerRadius &&
|
|
15244
|
+
this._cornerMask === cornerMask) {
|
|
15245
|
+
return;
|
|
15246
|
+
}
|
|
15247
|
+
this._isInitialized = true;
|
|
15248
|
+
this._width = width;
|
|
15249
|
+
this._height = height;
|
|
15250
|
+
this._cornderRadius = cornerRadius;
|
|
15251
|
+
this._cornerMask = cornerMask;
|
|
15252
|
+
var x = 0;
|
|
15253
|
+
var y = 0;
|
|
15237
15254
|
var tl = cornerMask & DCornerMask.TOP_LEFT ? 0 : cornerRadius;
|
|
15238
15255
|
var tr = cornerMask & DCornerMask.TOP_RIGHT ? 0 : cornerRadius;
|
|
15239
15256
|
var bl = cornerMask & DCornerMask.BOTTOM_LEFT ? 0 : cornerRadius;
|
|
@@ -28161,6 +28178,9 @@ var DBaseOverflowMaskSimple = /** @class */ (function (_super) {
|
|
|
28161
28178
|
function DBaseOverflowMaskSimple(parent) {
|
|
28162
28179
|
var _this = _super.call(this) || this;
|
|
28163
28180
|
_this.parent = parent;
|
|
28181
|
+
_this._isInitialized = false;
|
|
28182
|
+
_this._width = _this.width;
|
|
28183
|
+
_this._height = _this.height;
|
|
28164
28184
|
return _this;
|
|
28165
28185
|
}
|
|
28166
28186
|
DBaseOverflowMaskSimple.prototype.render = function (renderer) {
|
|
@@ -28168,6 +28188,12 @@ var DBaseOverflowMaskSimple = /** @class */ (function (_super) {
|
|
|
28168
28188
|
_super.prototype.render.call(this, renderer);
|
|
28169
28189
|
};
|
|
28170
28190
|
DBaseOverflowMaskSimple.prototype.onReflow = function (base, width, height) {
|
|
28191
|
+
if (this._isInitialized && this._width === width && this._height === height) {
|
|
28192
|
+
return;
|
|
28193
|
+
}
|
|
28194
|
+
this._isInitialized = true;
|
|
28195
|
+
this._width = width;
|
|
28196
|
+
this._height = height;
|
|
28171
28197
|
this.clear();
|
|
28172
28198
|
this.beginFill(0xffffff, 1);
|
|
28173
28199
|
this.drawRect(0, 0, width, height);
|
|
@@ -47171,13 +47197,20 @@ var ESnapper = /** @class */ (function (_super) {
|
|
|
47171
47197
|
*/
|
|
47172
47198
|
var UtilSvgAtlasBuilder = /** @class */ (function () {
|
|
47173
47199
|
function UtilSvgAtlasBuilder(options) {
|
|
47174
|
-
var _a, _b, _c, _d, _e, _f
|
|
47200
|
+
var _a, _b, _c, _d, _e, _f;
|
|
47175
47201
|
this._width = (_a = options.width) !== null && _a !== void 0 ? _a : 256;
|
|
47176
47202
|
this._ratio = (_b = options.ratio) !== null && _b !== void 0 ? _b : 1;
|
|
47177
47203
|
this._margin = (_c = options.margin) !== null && _c !== void 0 ? _c : 3;
|
|
47178
|
-
|
|
47179
|
-
|
|
47180
|
-
|
|
47204
|
+
var resolution = options.resolution;
|
|
47205
|
+
if (resolution != null) {
|
|
47206
|
+
this._resolution = resolution;
|
|
47207
|
+
}
|
|
47208
|
+
else {
|
|
47209
|
+
var dpr = (_d = window.devicePixelRatio) !== null && _d !== void 0 ? _d : 1;
|
|
47210
|
+
this._resolution = 2 < dpr ? dpr : dpr * 2;
|
|
47211
|
+
}
|
|
47212
|
+
this._scaling = (_e = options.scaling) !== null && _e !== void 0 ? _e : pixi_js.settings.SCALE_MODE;
|
|
47213
|
+
this._mipmap = (_f = options.mipmap) !== null && _f !== void 0 ? _f : pixi_js.settings.MIPMAP_TEXTURES;
|
|
47181
47214
|
this._frames = {};
|
|
47182
47215
|
this._svg = "";
|
|
47183
47216
|
this._nextX = 0;
|
package/dist/wcardinal-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.
|
|
2
|
+
Winter Cardinal UI v0.404.0
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -15219,6 +15219,11 @@
|
|
|
15219
15219
|
function DBaseOverflowMask(parent) {
|
|
15220
15220
|
var _this = _super.call(this) || this;
|
|
15221
15221
|
_this.parent = parent;
|
|
15222
|
+
_this._isInitialized = false;
|
|
15223
|
+
_this._width = 0;
|
|
15224
|
+
_this._height = 0;
|
|
15225
|
+
_this._cornderRadius = 0;
|
|
15226
|
+
_this._cornerMask = DCornerMask.NONE;
|
|
15222
15227
|
return _this;
|
|
15223
15228
|
}
|
|
15224
15229
|
DBaseOverflowMask.prototype.render = function (renderer) {
|
|
@@ -15226,11 +15231,23 @@
|
|
|
15226
15231
|
_super.prototype.render.call(this, renderer);
|
|
15227
15232
|
};
|
|
15228
15233
|
DBaseOverflowMask.prototype.onReflow = function (base, width, height) {
|
|
15229
|
-
var x = 0;
|
|
15230
|
-
var y = 0;
|
|
15231
15234
|
var corner = base.corner;
|
|
15232
15235
|
var cornerRadius = Math.max(0, corner.getRadius() - 0.5);
|
|
15233
15236
|
var cornerMask = corner.getMask();
|
|
15237
|
+
if (this._isInitialized &&
|
|
15238
|
+
this._width === width &&
|
|
15239
|
+
this._height === height &&
|
|
15240
|
+
this._cornderRadius === cornerRadius &&
|
|
15241
|
+
this._cornerMask === cornerMask) {
|
|
15242
|
+
return;
|
|
15243
|
+
}
|
|
15244
|
+
this._isInitialized = true;
|
|
15245
|
+
this._width = width;
|
|
15246
|
+
this._height = height;
|
|
15247
|
+
this._cornderRadius = cornerRadius;
|
|
15248
|
+
this._cornerMask = cornerMask;
|
|
15249
|
+
var x = 0;
|
|
15250
|
+
var y = 0;
|
|
15234
15251
|
var tl = cornerMask & DCornerMask.TOP_LEFT ? 0 : cornerRadius;
|
|
15235
15252
|
var tr = cornerMask & DCornerMask.TOP_RIGHT ? 0 : cornerRadius;
|
|
15236
15253
|
var bl = cornerMask & DCornerMask.BOTTOM_LEFT ? 0 : cornerRadius;
|
|
@@ -28158,6 +28175,9 @@
|
|
|
28158
28175
|
function DBaseOverflowMaskSimple(parent) {
|
|
28159
28176
|
var _this = _super.call(this) || this;
|
|
28160
28177
|
_this.parent = parent;
|
|
28178
|
+
_this._isInitialized = false;
|
|
28179
|
+
_this._width = _this.width;
|
|
28180
|
+
_this._height = _this.height;
|
|
28161
28181
|
return _this;
|
|
28162
28182
|
}
|
|
28163
28183
|
DBaseOverflowMaskSimple.prototype.render = function (renderer) {
|
|
@@ -28165,6 +28185,12 @@
|
|
|
28165
28185
|
_super.prototype.render.call(this, renderer);
|
|
28166
28186
|
};
|
|
28167
28187
|
DBaseOverflowMaskSimple.prototype.onReflow = function (base, width, height) {
|
|
28188
|
+
if (this._isInitialized && this._width === width && this._height === height) {
|
|
28189
|
+
return;
|
|
28190
|
+
}
|
|
28191
|
+
this._isInitialized = true;
|
|
28192
|
+
this._width = width;
|
|
28193
|
+
this._height = height;
|
|
28168
28194
|
this.clear();
|
|
28169
28195
|
this.beginFill(0xffffff, 1);
|
|
28170
28196
|
this.drawRect(0, 0, width, height);
|
|
@@ -47776,13 +47802,20 @@
|
|
|
47776
47802
|
*/
|
|
47777
47803
|
var UtilSvgAtlasBuilder = /** @class */ (function () {
|
|
47778
47804
|
function UtilSvgAtlasBuilder(options) {
|
|
47779
|
-
var _a, _b, _c, _d, _e, _f
|
|
47805
|
+
var _a, _b, _c, _d, _e, _f;
|
|
47780
47806
|
this._width = (_a = options.width) !== null && _a !== void 0 ? _a : 256;
|
|
47781
47807
|
this._ratio = (_b = options.ratio) !== null && _b !== void 0 ? _b : 1;
|
|
47782
47808
|
this._margin = (_c = options.margin) !== null && _c !== void 0 ? _c : 3;
|
|
47783
|
-
|
|
47784
|
-
|
|
47785
|
-
|
|
47809
|
+
var resolution = options.resolution;
|
|
47810
|
+
if (resolution != null) {
|
|
47811
|
+
this._resolution = resolution;
|
|
47812
|
+
}
|
|
47813
|
+
else {
|
|
47814
|
+
var dpr = (_d = window.devicePixelRatio) !== null && _d !== void 0 ? _d : 1;
|
|
47815
|
+
this._resolution = 2 < dpr ? dpr : dpr * 2;
|
|
47816
|
+
}
|
|
47817
|
+
this._scaling = (_e = options.scaling) !== null && _e !== void 0 ? _e : pixi_js.settings.SCALE_MODE;
|
|
47818
|
+
this._mipmap = (_f = options.mipmap) !== null && _f !== void 0 ? _f : pixi_js.settings.MIPMAP_TEXTURES;
|
|
47786
47819
|
this._frames = {};
|
|
47787
47820
|
this._svg = "";
|
|
47788
47821
|
this._nextX = 0;
|