@wcardinal/wcardinal-ui 0.442.0 → 0.444.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-picker-color.d.ts +3 -0
- package/dist/types/wcardinal/ui/d-table-column-state.d.ts +4 -1
- package/dist/types/wcardinal/ui/d-table-state.d.ts +4 -0
- package/dist/types/wcardinal/ui/theme/common/new-svg-rounded-checkerboard.d.ts +1 -0
- package/dist/types/wcardinal/ui/theme/common/new-svg-rounded-rect.d.ts +1 -0
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-picker-color.d.ts +3 -0
- package/dist/types/wcardinal/ui/theme/dark/new-dark-svg-rounded-checkerboard.d.ts +1 -0
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-picker-color.d.ts +3 -0
- package/dist/types/wcardinal/ui/theme/white/new-white-svg-rounded-checkerboard.d.ts +1 -0
- package/dist/types/wcardinal/ui/util/index.d.ts +1 -0
- package/dist/types/wcardinal/ui/util/util-extract.d.ts +13 -2
- package/dist/types/wcardinal/ui/util/util-extractor-canvas.d.ts +18 -0
- package/dist/types/wcardinal/ui/util/util-extractor.d.ts +3 -2
- package/dist/wcardinal/ui/d-image-piece-impl.js +8 -0
- package/dist/wcardinal/ui/d-image-piece-impl.js.map +1 -1
- package/dist/wcardinal/ui/d-picker-color.js +5 -4
- package/dist/wcardinal/ui/d-picker-color.js.map +1 -1
- package/dist/wcardinal/ui/d-table-body.js +3 -2
- package/dist/wcardinal/ui/d-table-body.js.map +1 -1
- package/dist/wcardinal/ui/d-table-column-state.js.map +1 -1
- package/dist/wcardinal/ui/d-table-state.js +4 -0
- package/dist/wcardinal/ui/d-table-state.js.map +1 -1
- package/dist/wcardinal/ui/theme/common/new-svg-rounded-checkerboard.js +20 -0
- package/dist/wcardinal/ui/theme/common/new-svg-rounded-checkerboard.js.map +1 -0
- package/dist/wcardinal/ui/theme/common/new-svg-rounded-rect.js +15 -0
- package/dist/wcardinal/ui/theme/common/new-svg-rounded-rect.js.map +1 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-button-color-gradient.js +2 -5
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-button-color-gradient.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-button-color.js +3 -6
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-button-color.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-picker-color.js +24 -35
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-picker-color.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-table-body-cells.js +7 -2
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-table-body-cells.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/new-dark-svg-rounded-checkerboard.js +5 -0
- package/dist/wcardinal/ui/theme/dark/new-dark-svg-rounded-checkerboard.js.map +1 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-button-color-gradient.js +2 -5
- package/dist/wcardinal/ui/theme/white/d-theme-white-button-color-gradient.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-button-color.js +3 -6
- package/dist/wcardinal/ui/theme/white/d-theme-white-button-color.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-picker-color.js +24 -35
- package/dist/wcardinal/ui/theme/white/d-theme-white-picker-color.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-table-body-cells.js +7 -2
- package/dist/wcardinal/ui/theme/white/d-theme-white-table-body-cells.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/new-white-svg-rounded-checkerboard.js +5 -0
- package/dist/wcardinal/ui/theme/white/new-white-svg-rounded-checkerboard.js.map +1 -0
- package/dist/wcardinal/ui/util/index.js +1 -0
- package/dist/wcardinal/ui/util/index.js.map +1 -1
- package/dist/wcardinal/ui/util/util-extract.js +34 -10
- package/dist/wcardinal/ui/util/util-extract.js.map +1 -1
- package/dist/wcardinal/ui/util/util-extractor-canvas.js +110 -0
- package/dist/wcardinal/ui/util/util-extractor-canvas.js.map +1 -0
- package/dist/wcardinal/ui/util/util-extractor.js +45 -20
- package/dist/wcardinal/ui/util/util-extractor.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark-en-us.js +71 -49
- package/dist/wcardinal-ui-theme-dark-en-us.min.js +2 -2
- package/dist/wcardinal-ui-theme-dark-en-us.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark-ja-jp.js +71 -49
- package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +2 -2
- package/dist/wcardinal-ui-theme-dark-ja-jp.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark.js +71 -49
- package/dist/wcardinal-ui-theme-dark.min.js +2 -2
- package/dist/wcardinal-ui-theme-white-en-us.js +71 -49
- package/dist/wcardinal-ui-theme-white-en-us.min.js +2 -2
- package/dist/wcardinal-ui-theme-white-en-us.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-white-ja-jp.js +71 -49
- package/dist/wcardinal-ui-theme-white-ja-jp.min.js +2 -2
- package/dist/wcardinal-ui-theme-white-ja-jp.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-white.js +71 -49
- package/dist/wcardinal-ui-theme-white.min.js +2 -2
- package/dist/wcardinal-ui.cjs.js +313 -132
- package/dist/wcardinal-ui.js +207 -36
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,12 +6,9 @@ import { __extends } from "tslib";
|
|
|
6
6
|
import { DColorGradientObservable } from "../../d-color-gradient-observable";
|
|
7
7
|
import { DThemeWhiteAtlas } from "./d-theme-white-atlas";
|
|
8
8
|
import { DThemeWhiteButton } from "./d-theme-white-button";
|
|
9
|
-
|
|
10
|
-
// Apache license version 2.0.
|
|
9
|
+
import { newSvgRoundedRect } from "../common/new-svg-rounded-rect";
|
|
11
10
|
/* eslint-disable prettier/prettier */
|
|
12
|
-
DThemeWhiteAtlas.add("button_color_gradient_sample", 21, 21,
|
|
13
|
-
"<path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\" fill=\"#fff\"/>" +
|
|
14
|
-
"</g>");
|
|
11
|
+
DThemeWhiteAtlas.add("button_color_gradient_sample", 21, 21, newSvgRoundedRect(3, 3, 15, 15, "#fff", "#eee", 1));
|
|
15
12
|
/* eslint-enable prettier/prettier */
|
|
16
13
|
var formatter = function () {
|
|
17
14
|
return "";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-theme-white-button-color-gradient.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/white/d-theme-white-button-color-gradient.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAIH,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAE7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"d-theme-white-button-color-gradient.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/white/d-theme-white-button-color-gradient.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAIH,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAE7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,sCAAsC;AACtC,gBAAgB,CAAC,GAAG,CAAC,8BAA8B,EAAE,EAAE,EAAE,EAAE,EAC1D,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAClD,CAAC;AACF,qCAAqC;AAErC,IAAM,SAAS,GAAG;IACjB,OAAO,EAAE,CAAC;AACX,CAAC,CAAC;AAEF;IACS,kDAA2C;IADpD;;IAmBA,CAAC;IAfA,2DAAkB,GAAlB;QACC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,4BAA4B,CAAC;IAC/D,CAAC;IAED,yDAAgB,GAAhB;QACC,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,qDAAY,GAAZ;QACC,OAAO,IAAI,wBAAwB,EAAE,CAAC;IACvC,CAAC;IAED,yDAAgB,GAAhB;QACC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACrB,CAAC;IACF,qCAAC;AAAD,CAAC,AAnBD,CACS,iBAAiB,GAkBzB","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Texture } from \"pixi.js\";\nimport { DButtonColorGradient, DThemeButtonColorGradient } from \"../../d-button-color-gradient\";\nimport { DColorGradientObservable } from \"../../d-color-gradient-observable\";\nimport { DStateAwareOrValueMightBe } from \"../../d-state-aware\";\nimport { DThemeWhiteAtlas } from \"./d-theme-white-atlas\";\nimport { DThemeWhiteButton } from \"./d-theme-white-button\";\nimport { newSvgRoundedRect } from \"../common/new-svg-rounded-rect\";\n\n/* eslint-disable prettier/prettier */\nDThemeWhiteAtlas.add(\"button_color_gradient_sample\", 21, 21,\n\tnewSvgRoundedRect(3, 3, 15, 15, \"#fff\", \"#eee\", 1)\n);\n/* eslint-enable prettier/prettier */\n\nconst formatter = (): string => {\n\treturn \"\";\n};\n\nexport class DThemeWhiteButtonColorGradient\n\textends DThemeWhiteButton<DColorGradientObservable>\n\timplements DThemeButtonColorGradient\n{\n\tgetViewBaseTexture(): Texture | null {\n\t\treturn DThemeWhiteAtlas.mappings.button_color_gradient_sample;\n\t}\n\n\tgetTextFormatter(): (value: DColorGradientObservable, caller: DButtonColorGradient) => string {\n\t\treturn formatter;\n\t}\n\n\tnewTextValue(): DStateAwareOrValueMightBe<DColorGradientObservable> {\n\t\treturn new DColorGradientObservable();\n\t}\n\n\tgetCheckerColors(): [number, number] {\n\t\treturn [0.75, 0.65];\n\t}\n}\n"]}
|
|
@@ -6,12 +6,9 @@ import { __extends } from "tslib";
|
|
|
6
6
|
import { UtilRgb } from "../../util/util-rgb";
|
|
7
7
|
import { DThemeWhiteAtlas } from "./d-theme-white-atlas";
|
|
8
8
|
import { DThemeWhiteButton } from "./d-theme-white-button";
|
|
9
|
-
|
|
10
|
-
// Apache license version 2.0.
|
|
9
|
+
import { newSvgRoundedRect } from "../common/new-svg-rounded-rect";
|
|
11
10
|
/* eslint-disable prettier/prettier */
|
|
12
|
-
DThemeWhiteAtlas.add("button_color_sample", 21, 21,
|
|
13
|
-
"<path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\" fill=\"#fff\"/>" +
|
|
14
|
-
"</g>");
|
|
11
|
+
DThemeWhiteAtlas.add("button_color_sample", 21, 21, newSvgRoundedRect(3, 3, 15, 15, "#fff", "#eee", 1));
|
|
15
12
|
/* eslint-enable prettier/prettier */
|
|
16
13
|
var formatter = function (colorAndAlpha) {
|
|
17
14
|
return "#".concat(UtilRgb.toCode(colorAndAlpha.color), " A").concat(colorAndAlpha.alpha.toFixed(2));
|
|
@@ -22,7 +19,7 @@ var DThemeWhiteButtonColor = /** @class */ (function (_super) {
|
|
|
22
19
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
23
20
|
}
|
|
24
21
|
DThemeWhiteButtonColor.prototype.getImageTintColor = function (state) {
|
|
25
|
-
return
|
|
22
|
+
return 0xffffff;
|
|
26
23
|
};
|
|
27
24
|
DThemeWhiteButtonColor.prototype.getImageSource = function (state) {
|
|
28
25
|
return DThemeWhiteAtlas.mappings.button_color_sample;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-theme-white-button-color.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/white/d-theme-white-button-color.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAOH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"d-theme-white-button-color.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/white/d-theme-white-button-color.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAOH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,sCAAsC;AACtC,gBAAgB,CAAC,GAAG,CAAC,qBAAqB,EAAE,EAAE,EAAE,EAAE,EACjD,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAClD,CAAC;AACF,qCAAqC;AAErC,IAAM,SAAS,GAAG,UAAC,aAA6B;IAC/C,OAAO,WAAI,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,eAAK,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAE,CAAC;AACrF,CAAC,CAAC;AAEF;IACS,0CAAiC;IAD1C;;IAsBA,CAAC;IAlBA,kDAAiB,GAAjB,UAAkB,KAAoB;QACrC,OAAO,QAAQ,CAAC;IACjB,CAAC;IAED,+CAAc,GAAd,UAAe,KAAoB;QAClC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IACtD,CAAC;IAED,iDAAgB,GAAhB;QACC,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,6CAAY,GAAZ;QACC,OAAO;YACN,KAAK,EAAE,QAAQ;YACf,KAAK,EAAE,CAAC;SACR,CAAC;IACH,CAAC;IACF,6BAAC;AAAD,CAAC,AAtBD,CACS,iBAAiB,GAqBzB","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Texture } from \"pixi.js\";\nimport { DBaseStateSet } from \"../../d-base-state-set\";\nimport { DButtonColor, DThemeButtonColor } from \"../../d-button-color\";\nimport { DColorAndAlpha } from \"../../d-color-and-alpha\";\nimport { DStateAwareOrValueMightBe } from \"../../d-state-aware\";\nimport { UtilRgb } from \"../../util/util-rgb\";\nimport { DThemeWhiteAtlas } from \"./d-theme-white-atlas\";\nimport { DThemeWhiteButton } from \"./d-theme-white-button\";\nimport { newSvgRoundedRect } from \"../common/new-svg-rounded-rect\";\n\n/* eslint-disable prettier/prettier */\nDThemeWhiteAtlas.add(\"button_color_sample\", 21, 21,\n\tnewSvgRoundedRect(3, 3, 15, 15, \"#fff\", \"#eee\", 1)\n);\n/* eslint-enable prettier/prettier */\n\nconst formatter = (colorAndAlpha: DColorAndAlpha): string => {\n\treturn `#${UtilRgb.toCode(colorAndAlpha.color)} A${colorAndAlpha.alpha.toFixed(2)}`;\n};\n\nexport class DThemeWhiteButtonColor\n\textends DThemeWhiteButton<DColorAndAlpha>\n\timplements DThemeButtonColor\n{\n\tgetImageTintColor(state: DBaseStateSet): number | null {\n\t\treturn 0xffffff;\n\t}\n\n\tgetImageSource(state: DBaseStateSet): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.button_color_sample;\n\t}\n\n\tgetTextFormatter(): (value: DColorAndAlpha, caller: DButtonColor) => string {\n\t\treturn formatter;\n\t}\n\n\tnewTextValue(): DStateAwareOrValueMightBe<DColorAndAlpha> {\n\t\treturn {\n\t\t\tcolor: 0xffffff,\n\t\t\talpha: 1\n\t\t};\n\t}\n}\n"]}
|
|
@@ -6,21 +6,10 @@ import { __extends } from "tslib";
|
|
|
6
6
|
import { DBaseInteractive } from "../../d-base-interactive";
|
|
7
7
|
import { DThemeWhiteAtlas } from "./d-theme-white-atlas";
|
|
8
8
|
import { DThemeWhiteBase } from "./d-theme-white-base";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var DARK = "#a5a5a5";
|
|
12
|
-
var result = "<g>";
|
|
13
|
-
for (var ih = 0; ih < height; ++ih) {
|
|
14
|
-
for (var iw = 0; iw < width; ++iw) {
|
|
15
|
-
var color = (iw + ih) % 2 === 0 ? LIGHT : DARK;
|
|
16
|
-
result += "<rect x=\"".concat(9 * iw, "\" y=\"").concat(9 * ih, "\" width=\"9\" height=\"9\" fill=\"").concat(color, "\" />");
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
result += "</g>";
|
|
20
|
-
return result;
|
|
21
|
-
};
|
|
9
|
+
import { newSvgRoundedRect } from "../common/new-svg-rounded-rect";
|
|
10
|
+
import { newWhiteSvgRoundedCheckerboard } from "./new-white-svg-rounded-checkerboard";
|
|
22
11
|
/* eslint-disable prettier/prettier */
|
|
23
|
-
DThemeWhiteAtlas.add("picker_color_main",
|
|
12
|
+
DThemeWhiteAtlas.add("picker_color_main", 234, 162, "<g>" +
|
|
24
13
|
"<linearGradient id=\"fs7w3iusfdnb\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">" +
|
|
25
14
|
"<stop stop-color=\"#FFFFFF\" stop-opacity=\"0\" offset=\"0\"/>" +
|
|
26
15
|
"<stop stop-color=\"#FFFFFF\" stop-opacity=\"1\" offset=\"1\"/>" +
|
|
@@ -29,13 +18,11 @@ DThemeWhiteAtlas.add("picker_color_main", 236, 164, "<g>" +
|
|
|
29
18
|
"<stop stop-color=\"#000000\" stop-opacity=\"0\" offset=\"0\"/>" +
|
|
30
19
|
"<stop stop-color=\"#000000\" stop-opacity=\"1\" offset=\"1\"/>" +
|
|
31
20
|
"</linearGradient>" +
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"</g>"
|
|
35
|
-
DThemeWhiteAtlas.add("picker_color_main_base",
|
|
36
|
-
|
|
37
|
-
"</g>", 1, 1, 234, 162);
|
|
38
|
-
DThemeWhiteAtlas.add("picker_color_alpha_checkerboard", 234, 18, makeCheckerboard(26, 2));
|
|
21
|
+
newSvgRoundedRect(0, 0, 234, 162, "url(#fs7w3iusfdnb)") +
|
|
22
|
+
newSvgRoundedRect(0, 0, 234, 162, "url(#2rfcfe9874bw)") +
|
|
23
|
+
"</g>");
|
|
24
|
+
DThemeWhiteAtlas.add("picker_color_main_base", 234, 162, "<rect x=\"0\" y=\"0\" width=\"236\" height=\"164\" fill=\"#fff\" />");
|
|
25
|
+
DThemeWhiteAtlas.add("picker_color_alpha_checkerboard", 234, 18, newWhiteSvgRoundedCheckerboard(234, 18));
|
|
39
26
|
DThemeWhiteAtlas.add("picker_color_alpha", 234, 18, "<g>" +
|
|
40
27
|
"<linearGradient id=\"s48afbuh44\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">" +
|
|
41
28
|
"<stop stop-color=\"#FFFFFF\" stop-opacity=\"0\" offset=\"0\"/>" +
|
|
@@ -53,20 +40,15 @@ DThemeWhiteAtlas.add("picker_color_base", 234, 18, "<g>" +
|
|
|
53
40
|
"<stop stop-color=\"#FF00FF\" offset=\"0.833\"/>" +
|
|
54
41
|
"<stop stop-color=\"#FF0000\" offset=\"1\"/>" +
|
|
55
42
|
"</linearGradient>" +
|
|
56
|
-
|
|
43
|
+
newSvgRoundedRect(0, 0, 234, 18, "url(#ni2rbisdf3)") +
|
|
57
44
|
"</g>");
|
|
58
45
|
DThemeWhiteAtlas.add("picker_color_base_pointer", 16.2, 31.8, "<rect x=\"4.5\" y=\"4.5\" width=\"7.2\" height=\"22.8\" stroke=\"#5f5f5f\" stroke-width=\"2.4\" fill=\"none\" />");
|
|
59
46
|
DThemeWhiteAtlas.add("picker_color_pointer", 25.8, 25.8, "<circle cx=\"12.9\" cy=\"12.9\" r=\"4.8\" stroke=\"#5f5f5f\" stroke-width=\"2.4\" fill=\"none\" />" +
|
|
60
47
|
"<circle cx=\"12.9\" cy=\"12.9\" r=\"7.2\" stroke=\"#ffffff\" stroke-width=\"2.4\" fill=\"none\" />");
|
|
61
|
-
DThemeWhiteAtlas.add("picker_color_recent_checkerboard",
|
|
62
|
-
DThemeWhiteAtlas.add("picker_color_recent",
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"</g>", 9, 9, 18, 18);
|
|
66
|
-
DThemeWhiteAtlas.add("picker_color_sample_checkerboard", 45, 63, makeCheckerboard(5, 7));
|
|
67
|
-
DThemeWhiteAtlas.add("picker_color_sample", 47, 65, "<g>" +
|
|
68
|
-
"<rect x=\"0\" y=\"0\" width=\"47\" height=\"65\" fill=\"#fff\" />" +
|
|
69
|
-
"</g>", 1, 1, 45, 63);
|
|
48
|
+
DThemeWhiteAtlas.add("picker_color_recent_checkerboard", 18, 18, newWhiteSvgRoundedCheckerboard(18, 18));
|
|
49
|
+
DThemeWhiteAtlas.add("picker_color_recent", 18, 18, newSvgRoundedRect(0, 0, 18, 18, "#fff", "#eee", 1));
|
|
50
|
+
DThemeWhiteAtlas.add("picker_color_sample_checkerboard", 42, 66, newWhiteSvgRoundedCheckerboard(42, 66, "#fff", 1, 0));
|
|
51
|
+
DThemeWhiteAtlas.add("picker_color_sample", 42, 66, newSvgRoundedRect(0, 0, 42, 66, "#fff", "#eee", 1));
|
|
70
52
|
DThemeWhiteAtlas.add("picker_color_anchor_outlined", 25.8, 25.8, "<circle cx=\"12.9\" cy=\"12.9\" r=\"8.4\" stroke=\"none\" fill=\"#ffffff\" />" +
|
|
71
53
|
"<circle cx=\"12.9\" cy=\"12.9\" r=\"9.6\" stroke=\"#5f5f5f\" stroke-width=\"2.4\" fill=\"none\" />");
|
|
72
54
|
DThemeWhiteAtlas.add("picker_color_anchor", 28.2, 28.2, "<circle cx=\"14.1\" cy=\"14.1\" r=\"6\" stroke=\"none\" fill=\"#ffffff\" />" +
|
|
@@ -74,9 +56,7 @@ DThemeWhiteAtlas.add("picker_color_anchor", 28.2, 28.2, "<circle cx=\"14.1\" cy=
|
|
|
74
56
|
DThemeWhiteAtlas.add("picker_color_direction", 12, 30, "<path d=\"M0.6 25.8 L 12.0375 5.9895\" stroke=\"#5f5f5f\" stroke-width=\"1.2\" fill=\"none\" />" +
|
|
75
57
|
"<path d=\"M8.5125 25.8 A 8.475 8.475 0 0 0 4.275 18.4605\" stroke=\"#5f5f5f\" stroke-width=\"1.2\" fill=\"none\" />" +
|
|
76
58
|
"<rect x=\"0.6\" y=\"24.6\" width=\"11.4375\" height=\"1.2\" rx=\"0.6\" ry=\"0.6\" stroke=\"none\" fill=\"#5f5f5f\" />");
|
|
77
|
-
DThemeWhiteAtlas.add("picker_color_standard", 18, 18, "
|
|
78
|
-
"<rect x=\"0\" y=\"0\" width=\"18\" height=\"18\" fill=\"#fff\" stroke-width=\"1\" stroke=\"#eee\" />" +
|
|
79
|
-
"</g>");
|
|
59
|
+
DThemeWhiteAtlas.add("picker_color_standard", 18, 18, newSvgRoundedRect(0, 0, 18, 18, "#fff", "#eee", 1));
|
|
80
60
|
/* eslint-enable prettier/prettier */
|
|
81
61
|
var DThemeWhitePickerColor = /** @class */ (function (_super) {
|
|
82
62
|
__extends(DThemeWhitePickerColor, _super);
|
|
@@ -168,7 +148,16 @@ var DThemeWhitePickerColor = /** @class */ (function (_super) {
|
|
|
168
148
|
return this.getBaseMargin();
|
|
169
149
|
};
|
|
170
150
|
DThemeWhitePickerColor.prototype.getInputLabelWidth = function () {
|
|
171
|
-
return
|
|
151
|
+
return 18;
|
|
152
|
+
};
|
|
153
|
+
DThemeWhitePickerColor.prototype.getSampleWidth = function () {
|
|
154
|
+
return 42;
|
|
155
|
+
};
|
|
156
|
+
DThemeWhitePickerColor.prototype.getSampleHeight = function () {
|
|
157
|
+
return 66;
|
|
158
|
+
};
|
|
159
|
+
DThemeWhitePickerColor.prototype.getSampleMargin = function () {
|
|
160
|
+
return this.getBaseMargin();
|
|
172
161
|
};
|
|
173
162
|
DThemeWhitePickerColor.prototype.getSampleCheckerboardOldTexture = function () {
|
|
174
163
|
return DThemeWhiteAtlas.mappings.picker_color_sample_checkerboard;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-theme-white-picker-color.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/white/d-theme-white-picker-color.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,IAAM,gBAAgB,GAAG,UAAC,KAAa,EAAE,MAAc;IACtD,IAAM,KAAK,GAAG,SAAS,CAAC;IACxB,IAAM,IAAI,GAAG,SAAS,CAAC;IACvB,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,EAAE,EAAE;QACnC,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE,EAAE;YAClC,IAAM,KAAK,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;YACjD,MAAM,IAAI,oBAAY,CAAC,GAAG,EAAE,oBAAQ,CAAC,GAAG,EAAE,gDAAgC,KAAK,UAAM,CAAC;SACtF;KACD;IACD,MAAM,IAAI,MAAM,CAAC;IACjB,OAAO,MAAM,CAAC;AACf,CAAC,CAAC;AAEF,sCAAsC;AACtC,gBAAgB,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,EAAE,GAAG,EACjD,KAAK;IACJ,gFAAsE;IACrE,gEAA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IAED,mDAAkB,GAAlB;QACC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,qBAAqB,CAAC;IACxD,CAAC;IAED,mDAAkB,GAAlB,UAAmB,KAAoB;QACtC,OAAO,IAAI,CAAC;IACb,CAAC;IAED,+CAAc,GAAd,UAAe,KAAoB;QAClC,OAAO,IAAI,CAAC;IACb,CAAC;IAED,+CAAc,GAAd;QACC,OAAO,gBAAgB,CAAC,QAAQ,CAAC;IAClC,CAAC;IAED,yCAAQ,GAAR,UAAS,KAAoB;QAC5B,iBAAM,QAAQ,YAAC,KAAK,CAAC,CAAC;QACtB,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;IAGF,6BAAC;AAAD,CAAC,AA3KD,CAAqD,eAAe,GA2KnE","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Texture } from \"pixi.js\";\nimport { DBaseInteractive } from \"../../d-base-interactive\";\nimport { DBaseStateSet } from \"../../d-base-state-set\";\nimport { DThemePickerColor } from \"../../d-picker-color\";\nimport { DThemeWhiteAtlas } from \"./d-theme-white-atlas\";\nimport { DThemeWhiteBase } from \"./d-theme-white-base\";\nimport { DColorType } from \"../../d-color-type\";\n\nconst makeCheckerboard = (width: number, height: number): string => {\n\tconst LIGHT = \"#bfbfbf\";\n\tconst DARK = \"#a5a5a5\";\n\tlet result = `<g>`;\n\tfor (let ih = 0; ih < height; ++ih) {\n\t\tfor (let iw = 0; iw < width; ++iw) {\n\t\t\tconst color = (iw + ih) % 2 === 0 ? LIGHT : DARK;\n\t\t\tresult += `<rect x=\"${9 * iw}\" y=\"${9 * ih}\" width=\"9\" height=\"9\" fill=\"${color}\" />`;\n\t\t}\n\t}\n\tresult += \"</g>\";\n\treturn result;\n};\n\n/* eslint-disable prettier/prettier */\nDThemeWhiteAtlas.add(\"picker_color_main\", 236, 164,\n\t`<g>` +\n\t\t`<linearGradient id=\"fs7w3iusfdnb\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">` +\n\t\t\t`<stop stop-color=\"#FFFFFF\" stop-opacity=\"0\" offset=\"0\"/>` +\n\t\t\t`<stop stop-color=\"#FFFFFF\" stop-opacity=\"1\" offset=\"1\"/>` +\n\t\t`</linearGradient>` +\n\t\t`<linearGradient id=\"2rfcfe9874bw\" x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\">` +\n\t\t\t`<stop stop-color=\"#000000\" stop-opacity=\"0\" offset=\"0\"/>` +\n\t\t\t`<stop stop-color=\"#000000\" stop-opacity=\"1\" offset=\"1\"/>` +\n\t\t`</linearGradient>` +\n\t\t`<rect x=\"0\" y=\"0\" width=\"236\" height=\"164\" fill=\"url(#fs7w3iusfdnb)\" />` +\n\t\t`<rect x=\"0\" y=\"0\" width=\"236\" height=\"164\" fill=\"url(#2rfcfe9874bw)\" />` +\n\t`</g>`\n\t, 1, 1, 234, 162);\n\nDThemeWhiteAtlas.add(\"picker_color_main_base\", 236, 164,\n\t`<g>` +\n\t\t`<rect x=\"0\" y=\"0\" width=\"236\" height=\"164\" fill=\"#fff\" />` +\n\t`</g>`\n, 1, 1, 234, 162);\n\nDThemeWhiteAtlas.add(\"picker_color_alpha_checkerboard\", 234, 18, makeCheckerboard(26, 2));\n\nDThemeWhiteAtlas.add(\"picker_color_alpha\", 234, 18,\n\t`<g>` +\n\t\t`<linearGradient id=\"s48afbuh44\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">` +\n\t\t\t`<stop stop-color=\"#FFFFFF\" stop-opacity=\"0\" offset=\"0\"/>` +\n\t\t\t`<stop stop-color=\"#FFFFFF\" stop-opacity=\"1\" offset=\"1\"/>` +\n\t\t`</linearGradient>` +\n\t\t`<rect x=\"0\" y=\"0\" width=\"234\" height=\"18\" fill=\"url(#s48afbuh44)\" />` +\n\t`</g>`\n);\n\nDThemeWhiteAtlas.add(\"picker_color_base\", 234, 18,\n\t`<g>` +\n\t\t`<linearGradient id=\"ni2rbisdf3\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">` +\n\t\t\t`<stop stop-color=\"#FF0000\" offset=\"0\"/>` +\n\t\t\t`<stop stop-color=\"#FFFF00\" offset=\"0.167\"/>` +\n\t\t\t`<stop stop-color=\"#00FF00\" offset=\"0.333\"/>` +\n\t\t\t`<stop stop-color=\"#00FFFF\" offset=\"0.5\"/>` +\n\t\t\t`<stop stop-color=\"#0000FF\" offset=\"0.667\"/>` +\n\t\t\t`<stop stop-color=\"#FF00FF\" offset=\"0.833\"/>` +\n\t\t\t`<stop stop-color=\"#FF0000\" offset=\"1\"/>` +\n\t\t`</linearGradient>` +\n\t\t`<rect x=\"0\" y=\"0\" width=\"234\" height=\"18\" fill=\"url(#ni2rbisdf3)\" />` +\n\t`</g>`\n);\n\nDThemeWhiteAtlas.add(\"picker_color_base_pointer\", 16.2, 31.8,\n\t`<rect x=\"4.5\" y=\"4.5\" width=\"7.2\" height=\"22.8\" stroke=\"#5f5f5f\" stroke-width=\"2.4\" fill=\"none\" />`\n);\n\nDThemeWhiteAtlas.add(\"picker_color_pointer\", 25.8, 25.8,\n\t`<circle cx=\"12.9\" cy=\"12.9\" r=\"4.8\" stroke=\"#5f5f5f\" stroke-width=\"2.4\" fill=\"none\" />` +\n\t`<circle cx=\"12.9\" cy=\"12.9\" r=\"7.2\" stroke=\"#ffffff\" stroke-width=\"2.4\" fill=\"none\" />`\n);\n\nDThemeWhiteAtlas.add(\"picker_color_recent_checkerboard\", 36, 36, makeCheckerboard(4, 4), 9, 9, 18, 18);\n\nDThemeWhiteAtlas.add(\"picker_color_recent\", 36, 36,\n\t`<g>` +\n\t\t`<rect x=\"0\" y=\"0\" width=\"36\" height=\"36\" fill=\"#fff\" />` +\n\t\t`<path x=\"0\" y=\"0\" d=\"M9 9 h18 v18 h-18 v-18 m1 1 v16 h16 v-16 h-16 z\" fill=\"#eee\" />` +\n\t`</g>`\n, 9, 9, 18, 18);\n\nDThemeWhiteAtlas.add(\"picker_color_sample_checkerboard\", 45, 63, makeCheckerboard(5, 7));\n\nDThemeWhiteAtlas.add(\"picker_color_sample\", 47, 65,\n\t`<g>` +\n\t\t`<rect x=\"0\" y=\"0\" width=\"47\" height=\"65\" fill=\"#fff\" />` +\n\t`</g>`\n, 1, 1, 45, 63);\n\nDThemeWhiteAtlas.add(\"picker_color_anchor_outlined\", 25.8, 25.8,\n\t`<circle cx=\"12.9\" cy=\"12.9\" r=\"8.4\" stroke=\"none\" fill=\"#ffffff\" />` +\n\t`<circle cx=\"12.9\" cy=\"12.9\" r=\"9.6\" stroke=\"#5f5f5f\" stroke-width=\"2.4\" fill=\"none\" />`\n);\n\nDThemeWhiteAtlas.add(\"picker_color_anchor\", 28.2, 28.2,\n\t`<circle cx=\"14.1\" cy=\"14.1\" r=\"6\" stroke=\"none\" fill=\"#ffffff\" />` +\n\t`<circle cx=\"14.1\" cy=\"14.1\" r=\"7.2\" stroke=\"#5f5f5f\" stroke-width=\"2.4\" fill=\"none\" />`\n);\n\nDThemeWhiteAtlas.add(\"picker_color_direction\", 12, 30,\n\t`<path d=\"M0.6 25.8 L 12.0375 5.9895\" stroke=\"#5f5f5f\" stroke-width=\"1.2\" fill=\"none\" />` +\n\t`<path d=\"M8.5125 25.8 A 8.475 8.475 0 0 0 4.275 18.4605\" stroke=\"#5f5f5f\" stroke-width=\"1.2\" fill=\"none\" />` +\n\t`<rect x=\"0.6\" y=\"24.6\" width=\"11.4375\" height=\"1.2\" rx=\"0.6\" ry=\"0.6\" stroke=\"none\" fill=\"#5f5f5f\" />`\n);\n\nDThemeWhiteAtlas.add(\"picker_color_standard\", 18, 18,\n\t`<g>` +\n\t\t`<rect x=\"0\" y=\"0\" width=\"18\" height=\"18\" fill=\"#fff\" stroke-width=\"1\" stroke=\"#eee\" />` +\n\t`</g>`\n);\n/* eslint-enable prettier/prettier */\n\nexport abstract class DThemeWhitePickerColor extends DThemeWhiteBase implements DThemePickerColor {\n\tgetMainWidth(): number {\n\t\treturn 234;\n\t}\n\n\tgetMainHeight(): number {\n\t\treturn 162;\n\t}\n\n\tgetMainTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_main;\n\t}\n\n\tgetMainBaseTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_main_base;\n\t}\n\n\tgetMainPointerTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_pointer;\n\t}\n\n\tgetMainPointerColor(): number {\n\t\treturn 0xffffff;\n\t}\n\n\tgetMainPointerAlpha(): number {\n\t\treturn 1;\n\t}\n\n\tgetBaseHeight(): number {\n\t\treturn 18;\n\t}\n\n\tgetBaseMargin(): number {\n\t\treturn 6;\n\t}\n\n\tgetBaseTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_base;\n\t}\n\n\tgetBasePointerTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_base_pointer;\n\t}\n\n\tgetBasePointerColor(): number {\n\t\treturn 0xffffff;\n\t}\n\n\tgetBasePointerAlpha(): number {\n\t\treturn this.getMainPointerAlpha();\n\t}\n\n\tgetAlphaHeight(): number {\n\t\treturn this.getBaseHeight();\n\t}\n\n\tgetAlphaMargin(): number {\n\t\treturn this.getBaseMargin();\n\t}\n\n\tgetAlphaTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_alpha;\n\t}\n\n\tgetAlphaCheckerboardTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_alpha_checkerboard;\n\t}\n\n\tgetAlphaPointerTexture(): Texture {\n\t\treturn this.getBasePointerTexture();\n\t}\n\n\tgetAlphaPointerColor(): number {\n\t\treturn this.getBasePointerColor();\n\t}\n\n\tgetAlphaPointerAlpha(): number {\n\t\treturn this.getMainPointerAlpha();\n\t}\n\n\tgetRecentMargin(): number {\n\t\treturn this.getBaseMargin();\n\t}\n\n\tgetRecentColorWidth(): number {\n\t\treturn this.getBaseHeight();\n\t}\n\n\tgetRecentColorHeight(): number {\n\t\treturn this.getRecentColorWidth();\n\t}\n\n\tgetRecentColorMargin(): number {\n\t\treturn this.getRecentMargin();\n\t}\n\n\tgetRecentColorCount(): number {\n\t\treturn 10;\n\t}\n\n\tgetRecentCheckerboardTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_recent_checkerboard;\n\t}\n\n\tgetRecentTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_recent;\n\t}\n\n\tgetInputMargin(): number {\n\t\treturn this.getBaseMargin();\n\t}\n\n\tgetInputLabelWidth(): number {\n\t\treturn 15;\n\t}\n\n\tgetSampleCheckerboardOldTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_sample_checkerboard;\n\t}\n\n\tgetSampleCheckerboardNewTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_sample_checkerboard;\n\t}\n\n\tgetSampleOldTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_sample;\n\t}\n\n\tgetSampleNewTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_sample;\n\t}\n\n\tgetStandardColorCount(): number {\n\t\treturn 80;\n\t}\n\n\tgetStandardColorWidth(): number {\n\t\treturn this.getBaseHeight();\n\t}\n\n\tgetStandardColorHeight(): number {\n\t\treturn this.getStandardColorWidth();\n\t}\n\n\tgetStandardColorMargin(): number {\n\t\treturn this.getBaseMargin();\n\t}\n\n\tgetStandardTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_standard;\n\t}\n\n\tgetBackgroundColor(state: DBaseStateSet): number | null {\n\t\treturn null;\n\t}\n\n\tgetBorderColor(state: DBaseStateSet): number | null {\n\t\treturn null;\n\t}\n\n\tgetInteractive(): DBaseInteractive {\n\t\treturn DBaseInteractive.CHILDREN;\n\t}\n\n\tnewState(state: DBaseStateSet): void {\n\t\tsuper.newState(state);\n\t\tstate.isFocusable = false;\n\t}\n\n\tabstract toColorTypeLabel(type: DColorType): string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"d-theme-white-picker-color.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/white/d-theme-white-picker-color.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AAEtF,sCAAsC;AACtC,gBAAgB,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,EAAE,GAAG,EACjD,KAAK;IACJ,gFAAsE;IACrE,gEAA0D;IAC1D,gEAA0D;IAC3D,mBAAmB;IACnB,gFAAsE;IACrE,gEAA0D;IAC1D,gEAA0D;IAC3D,mBAAmB;IACnB,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,oBAAoB,CAAC;IACvD,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,oBAAoB,CAAC;IACxD,MAAM,CACN,CAAC;AAEF,gBAAgB,CAAC,GAAG,CAAC,wBAAwB,EAAE,GAAG,EAAE,GAAG,EACtD,qEAA2D,CAC3D,CAAC;AAEF,gBAAgB,CAAC,GAAG,CAAC,iCAAiC,EAAE,GAAG,EAAE,EAAE,EAAE,8BAA8B,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;AAE1G,gBAAgB,CAAC,GAAG,CAAC,oBAAoB,EAAE,GAAG,EAAE,EAAE,EACjD,KAAK;IACJ,8EAAoE;IACnE,gEAA0D;IAC1D,gEAA0D;IAC3D,mBAAmB;IACnB,gFAAsE;IACvE,MAAM,CACN,CAAC;AAEF,gBAA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C,KAAK,CAAC,CAAC;QACtB,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;IAGF,6BAAC;AAAD,CAAC,AAvLD,CAAqD,eAAe,GAuLnE","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Texture } from \"pixi.js\";\nimport { DBaseInteractive } from \"../../d-base-interactive\";\nimport { DBaseStateSet } from \"../../d-base-state-set\";\nimport { DThemePickerColor } from \"../../d-picker-color\";\nimport { DThemeWhiteAtlas } from \"./d-theme-white-atlas\";\nimport { DThemeWhiteBase } from \"./d-theme-white-base\";\nimport { DColorType } from \"../../d-color-type\";\nimport { newSvgRoundedRect } from \"../common/new-svg-rounded-rect\";\nimport { newWhiteSvgRoundedCheckerboard } from \"./new-white-svg-rounded-checkerboard\";\n\n/* eslint-disable prettier/prettier */\nDThemeWhiteAtlas.add(\"picker_color_main\", 234, 162,\n\t`<g>` +\n\t\t`<linearGradient id=\"fs7w3iusfdnb\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">` +\n\t\t\t`<stop stop-color=\"#FFFFFF\" stop-opacity=\"0\" offset=\"0\"/>` +\n\t\t\t`<stop stop-color=\"#FFFFFF\" stop-opacity=\"1\" offset=\"1\"/>` +\n\t\t`</linearGradient>` +\n\t\t`<linearGradient id=\"2rfcfe9874bw\" x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\">` +\n\t\t\t`<stop stop-color=\"#000000\" stop-opacity=\"0\" offset=\"0\"/>` +\n\t\t\t`<stop stop-color=\"#000000\" stop-opacity=\"1\" offset=\"1\"/>` +\n\t\t`</linearGradient>` +\n\t\tnewSvgRoundedRect(0, 0, 234, 162, \"url(#fs7w3iusfdnb)\") +\n\t\tnewSvgRoundedRect(0, 0, 234, 162, \"url(#2rfcfe9874bw)\") +\n\t`</g>`\n);\n\nDThemeWhiteAtlas.add(\"picker_color_main_base\", 234, 162,\n\t`<rect x=\"0\" y=\"0\" width=\"236\" height=\"164\" fill=\"#fff\" />`\n);\n\nDThemeWhiteAtlas.add(\"picker_color_alpha_checkerboard\", 234, 18, newWhiteSvgRoundedCheckerboard(234, 18));\n\nDThemeWhiteAtlas.add(\"picker_color_alpha\", 234, 18,\n\t`<g>` +\n\t\t`<linearGradient id=\"s48afbuh44\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">` +\n\t\t\t`<stop stop-color=\"#FFFFFF\" stop-opacity=\"0\" offset=\"0\"/>` +\n\t\t\t`<stop stop-color=\"#FFFFFF\" stop-opacity=\"1\" offset=\"1\"/>` +\n\t\t`</linearGradient>` +\n\t\t`<rect x=\"0\" y=\"0\" width=\"234\" height=\"18\" fill=\"url(#s48afbuh44)\" />` +\n\t`</g>`\n);\n\nDThemeWhiteAtlas.add(\"picker_color_base\", 234, 18,\n\t`<g>` +\n\t\t`<linearGradient id=\"ni2rbisdf3\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">` +\n\t\t\t`<stop stop-color=\"#FF0000\" offset=\"0\"/>` +\n\t\t\t`<stop stop-color=\"#FFFF00\" offset=\"0.167\"/>` +\n\t\t\t`<stop stop-color=\"#00FF00\" offset=\"0.333\"/>` +\n\t\t\t`<stop stop-color=\"#00FFFF\" offset=\"0.5\"/>` +\n\t\t\t`<stop stop-color=\"#0000FF\" offset=\"0.667\"/>` +\n\t\t\t`<stop stop-color=\"#FF00FF\" offset=\"0.833\"/>` +\n\t\t\t`<stop stop-color=\"#FF0000\" offset=\"1\"/>` +\n\t\t`</linearGradient>` +\n\t\tnewSvgRoundedRect(0, 0, 234, 18, \"url(#ni2rbisdf3)\") +\n\t`</g>`\n);\n\nDThemeWhiteAtlas.add(\"picker_color_base_pointer\", 16.2, 31.8,\n\t`<rect x=\"4.5\" y=\"4.5\" width=\"7.2\" height=\"22.8\" stroke=\"#5f5f5f\" stroke-width=\"2.4\" fill=\"none\" />`\n);\n\nDThemeWhiteAtlas.add(\"picker_color_pointer\", 25.8, 25.8,\n\t`<circle cx=\"12.9\" cy=\"12.9\" r=\"4.8\" stroke=\"#5f5f5f\" stroke-width=\"2.4\" fill=\"none\" />` +\n\t`<circle cx=\"12.9\" cy=\"12.9\" r=\"7.2\" stroke=\"#ffffff\" stroke-width=\"2.4\" fill=\"none\" />`\n);\n\nDThemeWhiteAtlas.add(\"picker_color_recent_checkerboard\", 18, 18, newWhiteSvgRoundedCheckerboard(18, 18));\n\nDThemeWhiteAtlas.add(\"picker_color_recent\", 18, 18, newSvgRoundedRect(0, 0, 18, 18, \"#fff\", \"#eee\", 1));\n\nDThemeWhiteAtlas.add(\"picker_color_sample_checkerboard\", 42, 66, newWhiteSvgRoundedCheckerboard(42, 66, \"#fff\", 1, 0));\n\nDThemeWhiteAtlas.add(\"picker_color_sample\", 42, 66, newSvgRoundedRect(0, 0, 42, 66, \"#fff\", \"#eee\", 1));\n\nDThemeWhiteAtlas.add(\"picker_color_anchor_outlined\", 25.8, 25.8,\n\t`<circle cx=\"12.9\" cy=\"12.9\" r=\"8.4\" stroke=\"none\" fill=\"#ffffff\" />` +\n\t`<circle cx=\"12.9\" cy=\"12.9\" r=\"9.6\" stroke=\"#5f5f5f\" stroke-width=\"2.4\" fill=\"none\" />`\n);\n\nDThemeWhiteAtlas.add(\"picker_color_anchor\", 28.2, 28.2,\n\t`<circle cx=\"14.1\" cy=\"14.1\" r=\"6\" stroke=\"none\" fill=\"#ffffff\" />` +\n\t`<circle cx=\"14.1\" cy=\"14.1\" r=\"7.2\" stroke=\"#5f5f5f\" stroke-width=\"2.4\" fill=\"none\" />`\n);\n\nDThemeWhiteAtlas.add(\"picker_color_direction\", 12, 30,\n\t`<path d=\"M0.6 25.8 L 12.0375 5.9895\" stroke=\"#5f5f5f\" stroke-width=\"1.2\" fill=\"none\" />` +\n\t`<path d=\"M8.5125 25.8 A 8.475 8.475 0 0 0 4.275 18.4605\" stroke=\"#5f5f5f\" stroke-width=\"1.2\" fill=\"none\" />` +\n\t`<rect x=\"0.6\" y=\"24.6\" width=\"11.4375\" height=\"1.2\" rx=\"0.6\" ry=\"0.6\" stroke=\"none\" fill=\"#5f5f5f\" />`\n);\n\nDThemeWhiteAtlas.add(\"picker_color_standard\", 18, 18, newSvgRoundedRect(0, 0, 18, 18, \"#fff\", \"#eee\", 1));\n/* eslint-enable prettier/prettier */\n\nexport abstract class DThemeWhitePickerColor extends DThemeWhiteBase implements DThemePickerColor {\n\tgetMainWidth(): number {\n\t\treturn 234;\n\t}\n\n\tgetMainHeight(): number {\n\t\treturn 162;\n\t}\n\n\tgetMainTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_main;\n\t}\n\n\tgetMainBaseTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_main_base;\n\t}\n\n\tgetMainPointerTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_pointer;\n\t}\n\n\tgetMainPointerColor(): number {\n\t\treturn 0xffffff;\n\t}\n\n\tgetMainPointerAlpha(): number {\n\t\treturn 1;\n\t}\n\n\tgetBaseHeight(): number {\n\t\treturn 18;\n\t}\n\n\tgetBaseMargin(): number {\n\t\treturn 6;\n\t}\n\n\tgetBaseTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_base;\n\t}\n\n\tgetBasePointerTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_base_pointer;\n\t}\n\n\tgetBasePointerColor(): number {\n\t\treturn 0xffffff;\n\t}\n\n\tgetBasePointerAlpha(): number {\n\t\treturn this.getMainPointerAlpha();\n\t}\n\n\tgetAlphaHeight(): number {\n\t\treturn this.getBaseHeight();\n\t}\n\n\tgetAlphaMargin(): number {\n\t\treturn this.getBaseMargin();\n\t}\n\n\tgetAlphaTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_alpha;\n\t}\n\n\tgetAlphaCheckerboardTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_alpha_checkerboard;\n\t}\n\n\tgetAlphaPointerTexture(): Texture {\n\t\treturn this.getBasePointerTexture();\n\t}\n\n\tgetAlphaPointerColor(): number {\n\t\treturn this.getBasePointerColor();\n\t}\n\n\tgetAlphaPointerAlpha(): number {\n\t\treturn this.getMainPointerAlpha();\n\t}\n\n\tgetRecentMargin(): number {\n\t\treturn this.getBaseMargin();\n\t}\n\n\tgetRecentColorWidth(): number {\n\t\treturn this.getBaseHeight();\n\t}\n\n\tgetRecentColorHeight(): number {\n\t\treturn this.getRecentColorWidth();\n\t}\n\n\tgetRecentColorMargin(): number {\n\t\treturn this.getRecentMargin();\n\t}\n\n\tgetRecentColorCount(): number {\n\t\treturn 10;\n\t}\n\n\tgetRecentCheckerboardTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_recent_checkerboard;\n\t}\n\n\tgetRecentTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_recent;\n\t}\n\n\tgetInputMargin(): number {\n\t\treturn this.getBaseMargin();\n\t}\n\n\tgetInputLabelWidth(): number {\n\t\treturn 18;\n\t}\n\n\tgetSampleWidth(): number {\n\t\treturn 42;\n\t}\n\n\tgetSampleHeight(): number {\n\t\treturn 66;\n\t}\n\n\tgetSampleMargin(): number {\n\t\treturn this.getBaseMargin();\n\t}\n\n\tgetSampleCheckerboardOldTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_sample_checkerboard;\n\t}\n\n\tgetSampleCheckerboardNewTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_sample_checkerboard;\n\t}\n\n\tgetSampleOldTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_sample;\n\t}\n\n\tgetSampleNewTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_sample;\n\t}\n\n\tgetStandardColorCount(): number {\n\t\treturn 80;\n\t}\n\n\tgetStandardColorWidth(): number {\n\t\treturn this.getBaseHeight();\n\t}\n\n\tgetStandardColorHeight(): number {\n\t\treturn this.getStandardColorWidth();\n\t}\n\n\tgetStandardColorMargin(): number {\n\t\treturn this.getBaseMargin();\n\t}\n\n\tgetStandardTexture(): Texture {\n\t\treturn DThemeWhiteAtlas.mappings.picker_color_standard;\n\t}\n\n\tgetBackgroundColor(state: DBaseStateSet): number | null {\n\t\treturn null;\n\t}\n\n\tgetBorderColor(state: DBaseStateSet): number | null {\n\t\treturn null;\n\t}\n\n\tgetInteractive(): DBaseInteractive {\n\t\treturn DBaseInteractive.CHILDREN;\n\t}\n\n\tnewState(state: DBaseStateSet): void {\n\t\tsuper.newState(state);\n\t\tstate.isFocusable = false;\n\t}\n\n\tabstract toColorTypeLabel(type: DColorType): string;\n}\n"]}
|
|
@@ -62,8 +62,13 @@ var DThemeWhiteTableBodyCells = /** @class */ (function () {
|
|
|
62
62
|
return DThemeWhiteConstants.COLOR;
|
|
63
63
|
};
|
|
64
64
|
DThemeWhiteTableBodyCells.getAlpha = function (state) {
|
|
65
|
-
if (state.
|
|
66
|
-
|
|
65
|
+
if (state.in(DTableState.HAS_DATA)) {
|
|
66
|
+
if (state.inEnabled) {
|
|
67
|
+
return 1.0;
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
return 0.5;
|
|
71
|
+
}
|
|
67
72
|
}
|
|
68
73
|
return 0;
|
|
69
74
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-theme-white-table-body-cells.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/white/d-theme-white-table-body-cells.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE;IAAA;
|
|
1
|
+
{"version":3,"file":"d-theme-white-table-body-cells.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/white/d-theme-white-table-body-cells.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE;IAAA;IAwFA,CAAC;IA3EO,4CAAkB,GAAzB,UAA0B,KAAoB;QAC7C,IAAI,KAAK,CAAC,UAAU,EAAE;YACrB,IAAI,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE;gBACjC,OAAO,KAAK,CAAC,YAAY;oBACxB,CAAC,CAAC,IAAI,CAAC,2BAA2B;oBAClC,CAAC,CAAC,IAAI,CAAC,4BAA4B,CAAC;aACrC;iBAAM;gBACN,OAAO,IAAI,CAAC;aACZ;SACD;aAAM,IAAI,KAAK,CAAC,SAAS,EAAE;YAC3B,OAAO,oBAAoB,CAAC,wBAAwB,CAAC;SACrD;aAAM,IAAI,KAAK,CAAC,WAAW,EAAE;YAC7B,OAAO,oBAAoB,CAAC,0BAA0B,CAAC;SACvD;aAAM,IAAI,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,EAAE;YAC9C,OAAO,oBAAoB,CAAC,+BAA+B,CAAC;SAC5D;aAAM;YACN,IAAI,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE;gBACjC,OAAO,KAAK,CAAC,YAAY;oBACxB,CAAC,CAAC,IAAI,CAAC,2BAA2B;oBAClC,CAAC,CAAC,IAAI,CAAC,4BAA4B,CAA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AG,CAAC;IACxB,CAAC;;;IAtFyB,0CAAgB,GAAG,oBAAoB,CAAC,yBAAyB,AAAjD,CAAkD;IAClE,sDAA4B,GAAG,OAAO,CAAC,MAAM,CACtE,EAAI,CAAC,gBAAgB,EACrB,KAAK,CACL,AAHqD,CAGpD;IACwB,qDAA2B,GAAG,OAAO,CAAC,MAAM,CACrE,EAAI,CAAC,4BAA4B,EACjC,KAAK,CACL,AAHoD,CAGnD;IACwB,sCAAY,GAAG,OAAO,CAAC,MAAM,CAAC,EAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,AAA/C,CAAgD;IAC5D,6CAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,EAAI,CAAC,YAAY,EAAE,KAAK,CAAC,AAA3C,CAA4C;IA6E1F,gCAAC;CAAA,AAxFD,IAwFC;SAxFY,yBAAyB","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DBaseStateSet } from \"../../d-base-state-set\";\nimport { DBorderMask } from \"../../d-border-mask\";\nimport { DCoordinateSize } from \"../../d-coordinate\";\nimport { DCornerMask } from \"../../d-corner-mask\";\nimport { DTableState } from \"../../d-table-state\";\nimport { UtilRgb } from \"../../util/util-rgb\";\nimport { DThemeWhiteConstants } from \"./d-theme-white-constants\";\n\nexport class DThemeWhiteTableBodyCells {\n\tprotected static readonly BACKGROUND_COLOR = DThemeWhiteConstants.BACKGROUND_COLOR_ON_BOARD;\n\tprotected static readonly BACKGROUND_COLOR_FROZEN_EVEN = UtilRgb.darken(\n\t\tthis.BACKGROUND_COLOR,\n\t\t0.015\n\t);\n\tprotected static readonly BACKGROUND_COLOR_FROZEN_ODD = UtilRgb.darken(\n\t\tthis.BACKGROUND_COLOR_FROZEN_EVEN,\n\t\t0.015\n\t);\n\tprotected static readonly BORDER_COLOR = UtilRgb.darken(this.BACKGROUND_COLOR, 0.035);\n\tprotected static readonly BORDER_COLOR_FROZEN = UtilRgb.darken(this.BORDER_COLOR, 0.035);\n\n\tstatic getBackgroundColor(state: DBaseStateSet): number | null {\n\t\tif (state.inDisabled) {\n\t\t\tif (state.is(DTableState.FROZEN)) {\n\t\t\t\treturn state.onAlternated\n\t\t\t\t\t? this.BACKGROUND_COLOR_FROZEN_ODD\n\t\t\t\t\t: this.BACKGROUND_COLOR_FROZEN_EVEN;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t} else if (state.isInvalid) {\n\t\t\treturn DThemeWhiteConstants.INVALID_BLENDED_ON_BOARD;\n\t\t} else if (state.underActive) {\n\t\t\treturn DThemeWhiteConstants.HIGHLIGHT_BLENDED_ON_BOARD;\n\t\t} else if (state.onHovered || state.isHovered) {\n\t\t\treturn DThemeWhiteConstants.WEAK_HIGHLIGHT_BLENDED_ON_BOARD;\n\t\t} else {\n\t\t\tif (state.is(DTableState.FROZEN)) {\n\t\t\t\treturn state.onAlternated\n\t\t\t\t\t? this.BACKGROUND_COLOR_FROZEN_ODD\n\t\t\t\t\t: this.BACKGROUND_COLOR_FROZEN_EVEN;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t}\n\n\tstatic getBackgroundAlpha(state: DBaseStateSet): number {\n\t\treturn 1;\n\t}\n\n\tstatic getBorderColor(state: DBaseStateSet): number | null {\n\t\tif (state.is(DTableState.FROZEN_END)) {\n\t\t\treturn this.BORDER_COLOR_FROZEN;\n\t\t}\n\t\treturn this.BORDER_COLOR;\n\t}\n\n\tstatic getBorderMask(state: DBaseStateSet): DBorderMask {\n\t\tif (state.is(DTableState.END)) {\n\t\t\treturn DBorderMask.ALL;\n\t\t} else {\n\t\t\treturn DBorderMask.NOT_RIGHT;\n\t\t}\n\t}\n\n\tstatic getColor(state: DBaseStateSet): number {\n\t\treturn DThemeWhiteConstants.COLOR;\n\t}\n\n\tstatic getAlpha(state: DBaseStateSet): number {\n\t\tif (state.in(DTableState.HAS_DATA)) {\n\t\t\tif (state.inEnabled) {\n\t\t\t\treturn 1.0;\n\t\t\t} else {\n\t\t\t\treturn 0.5;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\n\tstatic getImageTintColor(state: DBaseStateSet, isActive?: boolean): number | null {\n\t\tif (state.inDisabled || state.inReadOnly || !(state.isActive || isActive)) {\n\t\t\treturn DThemeWhiteConstants.WEAK_HIGHLIGHT_COLOR;\n\t\t} else {\n\t\t\treturn DThemeWhiteConstants.HIGHLIGHT_COLOR;\n\t\t}\n\t}\n\n\tstatic getHeight(): DCoordinateSize {\n\t\treturn \"padding\";\n\t}\n\n\tstatic getCornerMask(): DCornerMask {\n\t\treturn DCornerMask.ALL;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { newSvgRoundedCheckerboard } from "../common/new-svg-rounded-checkerboard";
|
|
2
|
+
export var newWhiteSvgRoundedCheckerboard = function (width, height, stroke, strokeWidth, strokeOpacity) {
|
|
3
|
+
return newSvgRoundedCheckerboard(width, height, "#bfbfbf", "#a5a5a5", stroke, strokeWidth, strokeOpacity);
|
|
4
|
+
};
|
|
5
|
+
//# sourceMappingURL=new-white-svg-rounded-checkerboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-white-svg-rounded-checkerboard.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/white/new-white-svg-rounded-checkerboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAEnF,MAAM,CAAC,IAAM,8BAA8B,GAAG,UAC7C,KAAa,EACb,MAAc,EACd,MAAe,EACf,WAAoB,EACpB,aAAsB;IAEtB,OAAO,yBAAyB,CAC/B,KAAK,EACL,MAAM,EACN,SAAS,EACT,SAAS,EACT,MAAM,EACN,WAAW,EACX,aAAa,CACb,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { newSvgRoundedCheckerboard } from \"../common/new-svg-rounded-checkerboard\";\n\nexport const newWhiteSvgRoundedCheckerboard = (\n\twidth: number,\n\theight: number,\n\tstroke?: string,\n\tstrokeWidth?: number,\n\tstrokeOpacity?: number\n): string => {\n\treturn newSvgRoundedCheckerboard(\n\t\twidth,\n\t\theight,\n\t\t\"#bfbfbf\",\n\t\t\"#a5a5a5\",\n\t\tstroke,\n\t\tstrokeWidth,\n\t\tstrokeOpacity\n\t);\n};\n"]}
|
|
@@ -61,6 +61,7 @@ export * from "./util-gesture-tap";
|
|
|
61
61
|
export * from "./util-gesture-target";
|
|
62
62
|
export * from "./util-gesture";
|
|
63
63
|
export * from "./util-extract";
|
|
64
|
+
export * from "./util-extractor-canvas";
|
|
64
65
|
export * from "./util-extractor-pixels";
|
|
65
66
|
export * from "./util-extractor";
|
|
66
67
|
export * from "./util-file-downloader";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/util/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wCAAwC,CAAC;AACvD,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9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AAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport * from \"./format-node\";\nexport * from \"./character\";\nexport * from \"./deep-partial\";\nexport * from \"./dynamic-atlas-item-empty\";\nexport * from \"./dynamic-atlas-item-font-atlas\";\nexport * from \"./dynamic-atlas-item-image\";\nexport * from \"./dynamic-atlas-item-text\";\nexport * from \"./dynamic-atlas-item-white\";\nexport * from \"./dynamic-atlas-item\";\nexport * from \"./dynamic-atlas\";\nexport * from \"./dynamic-font-atlas-chaaracter-origin\";\nexport * from \"./dynamic-font-atlas-character-type\";\nexport * from \"./dynamic-font-atlas-character\";\nexport * from \"./dynamic-font-atlas-characters\";\nexport * from \"./dynamic-font-atlas-font\";\nexport * from \"./dynamic-font-atlas\";\nexport * from \"./dynamic-font-atlases\";\nexport * from \"./dynamic-sdf-font-atlas-font\";\nexport * from \"./dynamic-sdf-font-atlas\";\nexport * from \"./dynamic-sdf-font-atlases\";\nexport * from \"./dynamic-sdf-font-generator\";\nexport * from \"./is-array\";\nexport * from \"./is-function\";\nexport * from \"./is-nan\";\nexport * from \"./is-number\";\nexport * from \"./is-object\";\nexport * from \"./is-string\";\nexport * from \"./lazy\";\nexport * from \"./number-formatter-function\";\nexport * from \"./number-formatter-impl\";\nexport * from \"./number-formatter\";\nexport * from \"./number-formatters\";\nexport * from \"./to-ceiling-index\";\nexport * from \"./to-cloned\";\nexport * from \"./to-enum\";\nexport * from \"./to-id\";\nexport * from \"./to-index-of\";\nexport * from \"./to-label\";\nexport * from \"./to-merged\";\nexport * from \"./to-padded\";\nexport * from \"./to-string\";\nexport * from \"./to-svg-texture\";\nexport * from \"./to-svg-url\";\nexport * from \"./util-alpha\";\nexport * from \"./util-svg-atlas-builder\";\nexport * from \"./util-attach\";\nexport * from \"./util-character-iterator\";\nexport * from \"./util-click-outside\";\nexport * from \"./util-clipboard\";\nexport * from \"./util-gesture-data\";\nexport * from \"./util-gesture-easing-history\";\nexport * from \"./util-gesture-easing\";\nexport * from \"./util-gesture-mode\";\nexport * from \"./util-gesture-modifier\";\nexport * from \"./util-gesture-modifiers\";\nexport * from \"./util-gesture-tap\";\nexport * from \"./util-gesture-target\";\nexport * from \"./util-gesture\";\nexport * from \"./util-extract\";\nexport * from \"./util-extractor-pixels\";\nexport * from \"./util-extractor\";\nexport * from \"./util-file-downloader\";\nexport * from \"./util-file-opener\";\nexport * from \"./util-font\";\nexport * from \"./util-hsv\";\nexport * from \"./util-html-element-clipper-ex-impl\";\nexport * from \"./util-html-element-clipper-ex-rects-impl\";\nexport * from \"./util-html-element-clipper-ex-rects\";\nexport * from \"./util-html-element-clipper-ex\";\nexport * from \"./util-html-element-when\";\nexport * from \"./util-html-element\";\nexport * from \"./util-input-input\";\nexport * from \"./util-input-number\";\nexport * from \"./util-input-text-area\";\nexport * from \"./util-input-text\";\nexport * from \"./util-input\";\nexport * from \"./util-keyboard-event\";\nexport * from \"./util-name\";\nexport * from \"./util-overlay\";\nexport * from \"./util-pointer-event\";\nexport * from \"./util-rgb\";\nexport * from \"./util-rgba\";\nexport * from \"./util-state-blinker\";\nexport * from \"./util-transition\";\nexport * from \"./util-wheel-event\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/util/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;A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C1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,qCAAqC,CAAC;AACpD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport * from \"./format-node\";\nexport * from \"./character\";\nexport * from \"./deep-partial\";\nexport * from \"./dynamic-atlas-item-empty\";\nexport * from \"./dynamic-atlas-item-font-atlas\";\nexport * from \"./dynamic-atlas-item-image\";\nexport * from \"./dynamic-atlas-item-text\";\nexport * from \"./dynamic-atlas-item-white\";\nexport * from \"./dynamic-atlas-item\";\nexport * from \"./dynamic-atlas\";\nexport * from \"./dynamic-font-atlas-chaaracter-origin\";\nexport * from \"./dynamic-font-atlas-character-type\";\nexport * from \"./dynamic-font-atlas-character\";\nexport * from \"./dynamic-font-atlas-characters\";\nexport * from \"./dynamic-font-atlas-font\";\nexport * from \"./dynamic-font-atlas\";\nexport * from \"./dynamic-font-atlases\";\nexport * from \"./dynamic-sdf-font-atlas-font\";\nexport * from \"./dynamic-sdf-font-atlas\";\nexport * from \"./dynamic-sdf-font-atlases\";\nexport * from \"./dynamic-sdf-font-generator\";\nexport * from \"./is-array\";\nexport * from \"./is-function\";\nexport * from \"./is-nan\";\nexport * from \"./is-number\";\nexport * from \"./is-object\";\nexport * from \"./is-string\";\nexport * from \"./lazy\";\nexport * from \"./number-formatter-function\";\nexport * from \"./number-formatter-impl\";\nexport * from \"./number-formatter\";\nexport * from \"./number-formatters\";\nexport * from \"./to-ceiling-index\";\nexport * from \"./to-cloned\";\nexport * from \"./to-enum\";\nexport * from \"./to-id\";\nexport * from \"./to-index-of\";\nexport * from \"./to-label\";\nexport * from \"./to-merged\";\nexport * from \"./to-padded\";\nexport * from \"./to-string\";\nexport * from \"./to-svg-texture\";\nexport * from \"./to-svg-url\";\nexport * from \"./util-alpha\";\nexport * from \"./util-svg-atlas-builder\";\nexport * from \"./util-attach\";\nexport * from \"./util-character-iterator\";\nexport * from \"./util-click-outside\";\nexport * from \"./util-clipboard\";\nexport * from \"./util-gesture-data\";\nexport * from \"./util-gesture-easing-history\";\nexport * from \"./util-gesture-easing\";\nexport * from \"./util-gesture-mode\";\nexport * from \"./util-gesture-modifier\";\nexport * from \"./util-gesture-modifiers\";\nexport * from \"./util-gesture-tap\";\nexport * from \"./util-gesture-target\";\nexport * from \"./util-gesture\";\nexport * from \"./util-extract\";\nexport * from \"./util-extractor-canvas\";\nexport * from \"./util-extractor-pixels\";\nexport * from \"./util-extractor\";\nexport * from \"./util-file-downloader\";\nexport * from \"./util-file-opener\";\nexport * from \"./util-font\";\nexport * from \"./util-hsv\";\nexport * from \"./util-html-element-clipper-ex-impl\";\nexport * from \"./util-html-element-clipper-ex-rects-impl\";\nexport * from \"./util-html-element-clipper-ex-rects\";\nexport * from \"./util-html-element-clipper-ex\";\nexport * from \"./util-html-element-when\";\nexport * from \"./util-html-element\";\nexport * from \"./util-input-input\";\nexport * from \"./util-input-number\";\nexport * from \"./util-input-text-area\";\nexport * from \"./util-input-text\";\nexport * from \"./util-input\";\nexport * from \"./util-keyboard-event\";\nexport * from \"./util-name\";\nexport * from \"./util-overlay\";\nexport * from \"./util-pointer-event\";\nexport * from \"./util-rgb\";\nexport * from \"./util-rgba\";\nexport * from \"./util-state-blinker\";\nexport * from \"./util-transition\";\nexport * from \"./util-wheel-event\";\n"]}
|
|
@@ -7,6 +7,7 @@ import { DApplications } from "../d-applications";
|
|
|
7
7
|
import { isNumber } from "./is-number";
|
|
8
8
|
import { UtilExtractor } from "./util-extractor";
|
|
9
9
|
import { UtilFileDownloader } from "./util-file-downloader";
|
|
10
|
+
import { UtilExtractorCanvas } from "./util-extractor-canvas";
|
|
10
11
|
var toResolution = function (options) {
|
|
11
12
|
var _a;
|
|
12
13
|
var target = options.target;
|
|
@@ -76,8 +77,15 @@ var UtilExtract = /** @class */ (function () {
|
|
|
76
77
|
// Create a render texture
|
|
77
78
|
var target = options.target;
|
|
78
79
|
var scale = target.transform.scale;
|
|
79
|
-
var width = Math.
|
|
80
|
-
var height = Math.
|
|
80
|
+
var width = Math.ceil(target.width * scale.x);
|
|
81
|
+
var height = Math.ceil(target.height * scale.y);
|
|
82
|
+
if (width <= 0 || height <= 0) {
|
|
83
|
+
return {
|
|
84
|
+
width: width,
|
|
85
|
+
height: height,
|
|
86
|
+
array: new Uint8Array(0)
|
|
87
|
+
};
|
|
88
|
+
}
|
|
81
89
|
var resolution = toResolution(options);
|
|
82
90
|
var renderTexture = UtilExtract.WORK_RENDER_TEXTURE;
|
|
83
91
|
if (renderTexture == null) {
|
|
@@ -125,16 +133,27 @@ var UtilExtract = /** @class */ (function () {
|
|
|
125
133
|
var scale = toScale(pixels, options);
|
|
126
134
|
return UtilExtractor.toCanvas(pixels, scale, ignorePremutipliedAlpha);
|
|
127
135
|
};
|
|
136
|
+
/**
|
|
137
|
+
* Extracts Base64 data URL from the target.
|
|
138
|
+
* This method internally creates a render texture and a canvas render target.
|
|
139
|
+
* They are used to extract pixels from the target.
|
|
140
|
+
* To free the allocated render texture and canvas render target, please call {@link destroy()}.
|
|
141
|
+
*
|
|
142
|
+
* @param options an extraction options
|
|
143
|
+
* @returns extracted Base64 data URL
|
|
144
|
+
*/
|
|
128
145
|
UtilExtract.base64 = function (options) {
|
|
129
|
-
var
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
146
|
+
var _a, _b, _c;
|
|
147
|
+
var pixels = this.pixels(options);
|
|
148
|
+
var ignorePremutipliedAlpha = (_b = (_a = options.alpha) === null || _a === void 0 ? void 0 : _a.premultiplied) === null || _b === void 0 ? void 0 : _b.ignore;
|
|
149
|
+
var scale = toScale(pixels, options);
|
|
150
|
+
var canvas = ((_c = this.WORK_CANVAS) !== null && _c !== void 0 ? _c : (this.WORK_CANVAS = new UtilExtractorCanvas(pixels.width, pixels.height)));
|
|
151
|
+
UtilExtractor.toCanvas(pixels, scale, ignorePremutipliedAlpha, canvas);
|
|
152
|
+
var element = canvas.getElement();
|
|
153
|
+
if (element != null) {
|
|
154
|
+
return UtilExtractor.toBase64(element, options.format, options.quality);
|
|
137
155
|
}
|
|
156
|
+
return "data:,";
|
|
138
157
|
};
|
|
139
158
|
UtilExtract.file = function (options) {
|
|
140
159
|
UtilFileDownloader.downloadUrl(options.filename, this.base64(options));
|
|
@@ -148,6 +167,11 @@ var UtilExtract = /** @class */ (function () {
|
|
|
148
167
|
this.WORK_RENDER_TEXTURE = undefined;
|
|
149
168
|
texture.destroy(true);
|
|
150
169
|
}
|
|
170
|
+
var canvas = this.WORK_CANVAS;
|
|
171
|
+
if (canvas != null) {
|
|
172
|
+
this.WORK_CANVAS = undefined;
|
|
173
|
+
canvas.destroy();
|
|
174
|
+
}
|
|
151
175
|
};
|
|
152
176
|
return UtilExtract;
|
|
153
177
|
}());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util-extract.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/util/util-extract.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAY,aAAa,EAAE,WAAW,EAAS,MAAM,SAAS,CAAC;AAG9E,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AA+C5D,IAAM,YAAY,GAAG,UAAC,OAAkC;;IACvD,IAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC9B,IAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IACtC,IAAI,UAAU,IAAI,IAAI,EAAE;QACvB,IAAI,QAAQ,CAAC,UAAU,CAAC,EAAE;YACzB,OAAO,UAAU,CAAC;SAClB;aAAM;YACN,IAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC;YACrC,IAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACvE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;SAC3C;KACD;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MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACpC,IAAM,uBAAuB,GAAG,MAAA,MAAA,OAAO,CAAC,KAAK,0CAAE,aAAa,0CAAE,MAAM,CAAC;QACrE,IAAM,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACvC,OAAO,aAAa,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,uBAAuB,CAAC,CAAC;IACvE,CAAC;IAEM,kBAAM,GAAb,UAAc,OAAiC;QAC9C,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACpC,IAAI;YACH,OAAO,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;SAC9E;gBAAS;YACT,IAAI,MAAM,EAAE;gBACX,MAAM,CAAC,OAAO,EAAE,CAAC;aACjB;SACD;IACF,CAAC;IAEM,gBAAI,GAAX,UAAY,OAA+B;QAC1C,kBAAkB,CAAC,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IACxE,CAAC;IAED;;OAEG;IACI,mBAAO,GAAd;QACC,IAAM,OAAO,GAAG,IAAI,CAAC,mBAAmB,CAAC;QACzC,IAAI,OAAO,IAAI,IAAI,EAAE;YACpB,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC;YACrC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SACtB;IACF,CAAC;IACF,kBAAC;AAAD,CAAC,AA1GD,IA0GC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Matrix, Renderer, RenderTexture, SCALE_MODES, utils } from \"pixi.js\";\nimport { DApplicationLayerLike } from \"../d-application-layer-like\";\nimport { DApplicationLike } from \"../d-application-like\";\nimport { DApplications } from \"../d-applications\";\nimport { DBase } from \"../d-base\";\nimport { isNumber } from \"./is-number\";\nimport { UtilExtractor } from \"./util-extractor\";\nimport { UtilExtractorPixels } from \"./util-extractor-pixels\";\nimport { UtilFileDownloader } from \"./util-file-downloader\";\n\nexport interface UtilExtractTextureResolutionOptions {\n\tsize: number;\n}\n\nexport interface UtilExtractTextureTransformOptions {\n\tupdate?: boolean;\n}\n\nexport interface UtilExtractTextureOptions {\n\ttarget: DBase;\n\tresolution?: number | UtilExtractTextureResolutionOptions;\n\ttransform?: UtilExtractTextureTransformOptions;\n\tclear?: boolean;\n}\n\nexport interface UtilExtractPixelsOptions extends UtilExtractTextureOptions {\n\trenderer?: Renderer;\n\tapplication?: DApplicationLike;\n\tlayer?: DApplicationLayerLike;\n}\n\nexport interface UtilExtractCanvasScaleOptions {\n\tsize: number;\n}\n\nexport interface UtilExtractCanvasAlphaOptions {\n\tpremultiplied?: {\n\t\tignore?: boolean;\n\t};\n}\n\nexport interface UtilExtractCanvasOptions extends UtilExtractPixelsOptions {\n\tscale?: number | UtilExtractCanvasScaleOptions;\n\talpha?: UtilExtractCanvasAlphaOptions;\n}\n\nexport interface UtilExtractBase64Options extends UtilExtractCanvasOptions {\n\tformat?: string;\n\tquality?: number;\n}\n\nexport interface UtilExtractFileOptions extends UtilExtractBase64Options {\n\tfilename: string;\n}\n\nconst toResolution = (options: UtilExtractTextureOptions): number => {\n\tconst target = options.target;\n\tconst resolution = options.resolution;\n\tif (resolution != null) {\n\t\tif (isNumber(resolution)) {\n\t\t\treturn resolution;\n\t\t} else {\n\t\t\tconst scale = target.transform.scale;\n\t\t\tconst size = Math.max(target.width * scale.x, target.height * scale.y);\n\t\t\treturn Math.min(1, resolution.size / size);\n\t\t}\n\t} else {\n\t\treturn window.devicePixelRatio ?? 1;\n\t}\n};\n\nconst toScale = (\n\tpixels: UtilExtractorPixels,\n\toptions: UtilExtractCanvasOptions\n): number | undefined => {\n\tconst scale = options.scale;\n\tif (scale != null) {\n\t\tif (isNumber(scale)) {\n\t\t\treturn scale;\n\t\t} else {\n\t\t\tconst size = scale.size;\n\t\t\treturn Math.min(1, size / pixels.width, size / pixels.height);\n\t\t}\n\t}\n};\n\nconst toRenderer = (options: UtilExtractPixelsOptions): Renderer => {\n\tconst renderer = options.renderer;\n\tif (renderer) {\n\t\treturn renderer;\n\t}\n\tconst application = options.application;\n\tif (application) {\n\t\treturn application.getLayerBase().renderer;\n\t}\n\tconst layer = options.layer || DApplications.getLayer(options.target);\n\tif (layer) {\n\t\treturn layer.renderer;\n\t}\n\tthrow new Error(\"No renderer / application / layer found.\");\n};\n\nexport class UtilExtract {\n\tprotected static WORK_RENDER_TEXTURE?: RenderTexture;\n\n\tstatic texture(options: UtilExtractTextureOptions): RenderTexture {\n\t\tconst target = options.target;\n\t\tconst resolution = toResolution(options);\n\t\tconst skipUpdateTransform = options.transform?.update;\n\t\treturn UtilExtractor.toTexture(target, resolution, options.clear, skipUpdateTransform);\n\t}\n\n\t/**\n\t * Extracts pixels from the target.\n\t * This method internally creates one render texture and use that to extract pixels from the target.\n\t * To free the allocated render texture, please call {@link destroy()}.\n\t *\n\t * @param options an extraction options\n\t * @returns extracted pixels\n\t */\n\tstatic pixels(options: UtilExtractPixelsOptions): UtilExtractorPixels {\n\t\tconst renderer = toRenderer(options);\n\n\t\t// Create a render texture\n\t\tconst target = options.target;\n\t\tconst scale = target.transform.scale;\n\t\tconst width = Math.floor(target.width * scale.x);\n\t\tconst height = Math.floor(target.height * scale.y);\n\t\tconst resolution = toResolution(options);\n\t\tlet renderTexture = UtilExtract.WORK_RENDER_TEXTURE;\n\t\tif (renderTexture == null) {\n\t\t\trenderTexture = RenderTexture.create({\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\tscaleMode: SCALE_MODES.LINEAR,\n\t\t\t\tresolution\n\t\t\t});\n\t\t\tUtilExtract.WORK_RENDER_TEXTURE = renderTexture;\n\t\t} else {\n\t\t\tconst baseTexture = renderTexture.baseTexture;\n\t\t\tconst baseTextureWidth = baseTexture.width;\n\t\t\tconst baseTextureHeight = baseTexture.height;\n\t\t\tconst isWidthDirty = baseTextureWidth < width;\n\t\t\tconst isHeightDirty = baseTextureHeight < height;\n\t\t\tconst isResolutionDirty = renderTexture.resolution !== resolution;\n\t\t\tif (isResolutionDirty || isWidthDirty || isHeightDirty) {\n\t\t\t\tif (isResolutionDirty) {\n\t\t\t\t\tbaseTexture.resolution = resolution;\n\t\t\t\t}\n\t\t\t\trenderTexture.resize(\n\t\t\t\t\tMath.max(width, baseTextureWidth),\n\t\t\t\t\tMath.max(height, baseTextureHeight),\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Render to the render texture\n\t\tconst frame = renderTexture.frame;\n\t\tif (frame.x !== 0 || frame.y !== 0 || frame.width !== width || frame.height !== height) {\n\t\t\tframe.x = 0;\n\t\t\tframe.y = 0;\n\t\t\tframe.width = width;\n\t\t\tframe.height = height;\n\t\t\trenderTexture.frame = frame;\n\t\t}\n\n\t\tconst targetPosition = target.position;\n\t\tconst matrix = new Matrix(1, 0, 0, 1, -targetPosition.x, -targetPosition.y);\n\n\t\trenderer.render(target, renderTexture, options.clear, matrix, options.transform?.update);\n\n\t\t// Extract pixels\n\t\treturn UtilExtractor.toPixels(renderTexture, renderer);\n\t}\n\n\tstatic canvas(options: UtilExtractCanvasOptions): utils.CanvasRenderTarget {\n\t\tconst pixels = this.pixels(options);\n\t\tconst ignorePremutipliedAlpha = options.alpha?.premultiplied?.ignore;\n\t\tconst scale = toScale(pixels, options);\n\t\treturn UtilExtractor.toCanvas(pixels, scale, ignorePremutipliedAlpha);\n\t}\n\n\tstatic base64(options: UtilExtractBase64Options): string {\n\t\tconst canvas = this.canvas(options);\n\t\ttry {\n\t\t\treturn UtilExtractor.toBase64(canvas.canvas, options.format, options.quality);\n\t\t} finally {\n\t\t\tif (canvas) {\n\t\t\t\tcanvas.destroy();\n\t\t\t}\n\t\t}\n\t}\n\n\tstatic file(options: UtilExtractFileOptions): void {\n\t\tUtilFileDownloader.downloadUrl(options.filename, this.base64(options));\n\t}\n\n\t/**\n\t * Clears all the memories.\n\t */\n\tstatic destroy(): void {\n\t\tconst texture = this.WORK_RENDER_TEXTURE;\n\t\tif (texture != null) {\n\t\t\tthis.WORK_RENDER_TEXTURE = undefined;\n\t\t\ttexture.destroy(true);\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"util-extract.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/util/util-extract.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAY,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGvE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AA+C9D,IAAM,YAAY,GAAG,UAAC,OAAkC;;IACvD,IAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC9B,IAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IACtC,IAAI,UAAU,IAAI,IAAI,EAAE;QACvB,IAAI,QAAQ,CAAC,UAAU,CAAC,EAAE;YACzB,OAAO,UAAU,CAAC;SAClB;aAAM;YACN,IAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC;YACrC,IAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACvE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,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AAC;SACxE;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;IAEM,gBAAI,GAAX,UAAY,OAA+B;QAC1C,kBAAkB,CAAC,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IACxE,CAAC;IAED;;OAEG;IACI,mBAAO,GAAd;QACC,IAAM,OAAO,GAAG,IAAI,CAAC,mBAAmB,CAAC;QACzC,IAAI,OAAO,IAAI,IAAI,EAAE;YACpB,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC;YACrC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SACtB;QAED,IAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC;QAChC,IAAI,MAAM,IAAI,IAAI,EAAE;YACnB,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;YAC7B,MAAM,CAAC,OAAO,EAAE,CAAC;SACjB;IACF,CAAC;IACF,kBAAC;AAAD,CAAC,AApID,IAoIC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Matrix, Renderer, RenderTexture, SCALE_MODES } from \"pixi.js\";\nimport { DApplicationLayerLike } from \"../d-application-layer-like\";\nimport { DApplicationLike } from \"../d-application-like\";\nimport { DApplications } from \"../d-applications\";\nimport { DBase } from \"../d-base\";\nimport { isNumber } from \"./is-number\";\nimport { UtilExtractor } from \"./util-extractor\";\nimport { UtilExtractorPixels } from \"./util-extractor-pixels\";\nimport { UtilFileDownloader } from \"./util-file-downloader\";\nimport { UtilExtractorCanvas } from \"./util-extractor-canvas\";\n\nexport interface UtilExtractTextureResolutionOptions {\n\tsize: number;\n}\n\nexport interface UtilExtractTextureTransformOptions {\n\tupdate?: boolean;\n}\n\nexport interface UtilExtractTextureOptions {\n\ttarget: DBase;\n\tresolution?: number | UtilExtractTextureResolutionOptions;\n\ttransform?: UtilExtractTextureTransformOptions;\n\tclear?: boolean;\n}\n\nexport interface UtilExtractPixelsOptions extends UtilExtractTextureOptions {\n\trenderer?: Renderer;\n\tapplication?: DApplicationLike;\n\tlayer?: DApplicationLayerLike;\n}\n\nexport interface UtilExtractCanvasScaleOptions {\n\tsize: number;\n}\n\nexport interface UtilExtractCanvasAlphaOptions {\n\tpremultiplied?: {\n\t\tignore?: boolean;\n\t};\n}\n\nexport interface UtilExtractCanvasOptions extends UtilExtractPixelsOptions {\n\tscale?: number | UtilExtractCanvasScaleOptions;\n\talpha?: UtilExtractCanvasAlphaOptions;\n}\n\nexport interface UtilExtractBase64Options extends UtilExtractCanvasOptions {\n\tformat?: string;\n\tquality?: number;\n}\n\nexport interface UtilExtractFileOptions extends UtilExtractBase64Options {\n\tfilename: string;\n}\n\nconst toResolution = (options: UtilExtractTextureOptions): number => {\n\tconst target = options.target;\n\tconst resolution = options.resolution;\n\tif (resolution != null) {\n\t\tif (isNumber(resolution)) {\n\t\t\treturn resolution;\n\t\t} else {\n\t\t\tconst scale = target.transform.scale;\n\t\t\tconst size = Math.max(target.width * scale.x, target.height * scale.y);\n\t\t\treturn Math.min(1, resolution.size / size);\n\t\t}\n\t} else {\n\t\treturn window.devicePixelRatio ?? 1;\n\t}\n};\n\nconst toScale = (\n\tpixels: UtilExtractorPixels,\n\toptions: UtilExtractCanvasOptions\n): number | undefined => {\n\tconst scale = options.scale;\n\tif (scale != null) {\n\t\tif (isNumber(scale)) {\n\t\t\treturn scale;\n\t\t} else {\n\t\t\tconst size = scale.size;\n\t\t\treturn Math.min(1, size / pixels.width, size / pixels.height);\n\t\t}\n\t}\n};\n\nconst toRenderer = (options: UtilExtractPixelsOptions): Renderer => {\n\tconst renderer = options.renderer;\n\tif (renderer) {\n\t\treturn renderer;\n\t}\n\tconst application = options.application;\n\tif (application) {\n\t\treturn application.getLayerBase().renderer;\n\t}\n\tconst layer = options.layer || DApplications.getLayer(options.target);\n\tif (layer) {\n\t\treturn layer.renderer;\n\t}\n\tthrow new Error(\"No renderer / application / layer found.\");\n};\n\nexport class UtilExtract {\n\tprotected static WORK_RENDER_TEXTURE?: RenderTexture;\n\tprotected static WORK_CANVAS?: UtilExtractorCanvas;\n\n\tstatic texture(options: UtilExtractTextureOptions): RenderTexture {\n\t\tconst target = options.target;\n\t\tconst resolution = toResolution(options);\n\t\tconst skipUpdateTransform = options.transform?.update;\n\t\treturn UtilExtractor.toTexture(target, resolution, options.clear, skipUpdateTransform);\n\t}\n\n\t/**\n\t * Extracts pixels from the target.\n\t * This method internally creates one render texture and use that to extract pixels from the target.\n\t * To free the allocated render texture, please call {@link destroy()}.\n\t *\n\t * @param options an extraction options\n\t * @returns extracted pixels\n\t */\n\tstatic pixels(options: UtilExtractPixelsOptions): UtilExtractorPixels {\n\t\tconst renderer = toRenderer(options);\n\n\t\t// Create a render texture\n\t\tconst target = options.target;\n\t\tconst scale = target.transform.scale;\n\t\tconst width = Math.ceil(target.width * scale.x);\n\t\tconst height = Math.ceil(target.height * scale.y);\n\t\tif (width <= 0 || height <= 0) {\n\t\t\treturn {\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\tarray: new Uint8Array(0)\n\t\t\t};\n\t\t}\n\n\t\tconst resolution = toResolution(options);\n\t\tlet renderTexture = UtilExtract.WORK_RENDER_TEXTURE;\n\t\tif (renderTexture == null) {\n\t\t\trenderTexture = RenderTexture.create({\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\tscaleMode: SCALE_MODES.LINEAR,\n\t\t\t\tresolution\n\t\t\t});\n\t\t\tUtilExtract.WORK_RENDER_TEXTURE = renderTexture;\n\t\t} else {\n\t\t\tconst baseTexture = renderTexture.baseTexture;\n\t\t\tconst baseTextureWidth = baseTexture.width;\n\t\t\tconst baseTextureHeight = baseTexture.height;\n\t\t\tconst isWidthDirty = baseTextureWidth < width;\n\t\t\tconst isHeightDirty = baseTextureHeight < height;\n\t\t\tconst isResolutionDirty = renderTexture.resolution !== resolution;\n\t\t\tif (isResolutionDirty || isWidthDirty || isHeightDirty) {\n\t\t\t\tif (isResolutionDirty) {\n\t\t\t\t\tbaseTexture.resolution = resolution;\n\t\t\t\t}\n\t\t\t\trenderTexture.resize(\n\t\t\t\t\tMath.max(width, baseTextureWidth),\n\t\t\t\t\tMath.max(height, baseTextureHeight),\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Render to the render texture\n\t\tconst frame = renderTexture.frame;\n\t\tif (frame.x !== 0 || frame.y !== 0 || frame.width !== width || frame.height !== height) {\n\t\t\tframe.x = 0;\n\t\t\tframe.y = 0;\n\t\t\tframe.width = width;\n\t\t\tframe.height = height;\n\t\t\trenderTexture.frame = frame;\n\t\t}\n\n\t\tconst targetPosition = target.position;\n\t\tconst matrix = new Matrix(1, 0, 0, 1, -targetPosition.x, -targetPosition.y);\n\n\t\trenderer.render(target, renderTexture, options.clear, matrix, options.transform?.update);\n\n\t\t// Extract pixels\n\t\treturn UtilExtractor.toPixels(renderTexture, renderer);\n\t}\n\n\tstatic canvas(options: UtilExtractCanvasOptions): UtilExtractorCanvas {\n\t\tconst pixels = this.pixels(options);\n\t\tconst ignorePremutipliedAlpha = options.alpha?.premultiplied?.ignore;\n\t\tconst scale = toScale(pixels, options);\n\t\treturn UtilExtractor.toCanvas(pixels, scale, ignorePremutipliedAlpha);\n\t}\n\n\t/**\n\t * Extracts Base64 data URL from the target.\n\t * This method internally creates a render texture and a canvas render target.\n\t * They are used to extract pixels from the target.\n\t * To free the allocated render texture and canvas render target, please call {@link destroy()}.\n\t *\n\t * @param options an extraction options\n\t * @returns extracted Base64 data URL\n\t */\n\tstatic base64(options: UtilExtractBase64Options): string {\n\t\tconst pixels = this.pixels(options);\n\t\tconst ignorePremutipliedAlpha = options.alpha?.premultiplied?.ignore;\n\t\tconst scale = toScale(pixels, options);\n\t\tconst canvas = (this.WORK_CANVAS ??= new UtilExtractorCanvas(pixels.width, pixels.height));\n\t\tUtilExtractor.toCanvas(pixels, scale, ignorePremutipliedAlpha, canvas);\n\t\tconst element = canvas.getElement();\n\t\tif (element != null) {\n\t\t\treturn UtilExtractor.toBase64(element, options.format, options.quality);\n\t\t}\n\t\treturn \"data:,\";\n\t}\n\n\tstatic file(options: UtilExtractFileOptions): void {\n\t\tUtilFileDownloader.downloadUrl(options.filename, this.base64(options));\n\t}\n\n\t/**\n\t * Clears all the memories.\n\t */\n\tstatic destroy(): void {\n\t\tconst texture = this.WORK_RENDER_TEXTURE;\n\t\tif (texture != null) {\n\t\t\tthis.WORK_RENDER_TEXTURE = undefined;\n\t\t\ttexture.destroy(true);\n\t\t}\n\n\t\tconst canvas = this.WORK_CANVAS;\n\t\tif (canvas != null) {\n\t\t\tthis.WORK_CANVAS = undefined;\n\t\t\tcanvas.destroy();\n\t\t}\n\t}\n}\n"]}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
var UtilExtractorCanvas = /** @class */ (function () {
|
|
2
|
+
function UtilExtractorCanvas(width, height) {
|
|
3
|
+
var element = document.createElement("canvas");
|
|
4
|
+
this._element = element;
|
|
5
|
+
var context = this._element.getContext("2d", {
|
|
6
|
+
willReadFrequently: true
|
|
7
|
+
});
|
|
8
|
+
this._context = context;
|
|
9
|
+
element.width = width;
|
|
10
|
+
element.height = height;
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(UtilExtractorCanvas.prototype, "element", {
|
|
13
|
+
get: function () {
|
|
14
|
+
var result = this._element;
|
|
15
|
+
if (result != null) {
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
throw new Error("No Element Available");
|
|
19
|
+
},
|
|
20
|
+
enumerable: false,
|
|
21
|
+
configurable: true
|
|
22
|
+
});
|
|
23
|
+
UtilExtractorCanvas.prototype.getElement = function () {
|
|
24
|
+
return this._element;
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(UtilExtractorCanvas.prototype, "canvas", {
|
|
27
|
+
get: function () {
|
|
28
|
+
return this.element;
|
|
29
|
+
},
|
|
30
|
+
enumerable: false,
|
|
31
|
+
configurable: true
|
|
32
|
+
});
|
|
33
|
+
Object.defineProperty(UtilExtractorCanvas.prototype, "context", {
|
|
34
|
+
get: function () {
|
|
35
|
+
var result = this._context;
|
|
36
|
+
if (result != null) {
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
throw new Error("No Context Available");
|
|
40
|
+
},
|
|
41
|
+
enumerable: false,
|
|
42
|
+
configurable: true
|
|
43
|
+
});
|
|
44
|
+
UtilExtractorCanvas.prototype.getContext = function () {
|
|
45
|
+
return this._context;
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(UtilExtractorCanvas.prototype, "resolution", {
|
|
48
|
+
get: function () {
|
|
49
|
+
return 1;
|
|
50
|
+
},
|
|
51
|
+
enumerable: false,
|
|
52
|
+
configurable: true
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(UtilExtractorCanvas.prototype, "width", {
|
|
55
|
+
get: function () {
|
|
56
|
+
var element = this._element;
|
|
57
|
+
if (element != null) {
|
|
58
|
+
return element.width;
|
|
59
|
+
}
|
|
60
|
+
return 0;
|
|
61
|
+
},
|
|
62
|
+
set: function (width) {
|
|
63
|
+
var element = this._element;
|
|
64
|
+
if (element != null) {
|
|
65
|
+
element.width = width;
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
enumerable: false,
|
|
69
|
+
configurable: true
|
|
70
|
+
});
|
|
71
|
+
Object.defineProperty(UtilExtractorCanvas.prototype, "height", {
|
|
72
|
+
get: function () {
|
|
73
|
+
var element = this._element;
|
|
74
|
+
if (element != null) {
|
|
75
|
+
return element.height;
|
|
76
|
+
}
|
|
77
|
+
return 0;
|
|
78
|
+
},
|
|
79
|
+
set: function (height) {
|
|
80
|
+
var element = this._element;
|
|
81
|
+
if (element != null) {
|
|
82
|
+
element.height = height;
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
enumerable: false,
|
|
86
|
+
configurable: true
|
|
87
|
+
});
|
|
88
|
+
UtilExtractorCanvas.prototype.clear = function () {
|
|
89
|
+
var element = this._element;
|
|
90
|
+
var context = this._context;
|
|
91
|
+
if (element != null && context != null) {
|
|
92
|
+
context.setTransform(1, 0, 0, 1, 0, 0);
|
|
93
|
+
context.clearRect(0, 0, element.width, element.height);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
UtilExtractorCanvas.prototype.resize = function (width, height) {
|
|
97
|
+
var element = this._element;
|
|
98
|
+
if (element != null) {
|
|
99
|
+
element.width = width;
|
|
100
|
+
element.height = height;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
UtilExtractorCanvas.prototype.destroy = function () {
|
|
104
|
+
this._context = null;
|
|
105
|
+
this._element = null;
|
|
106
|
+
};
|
|
107
|
+
return UtilExtractorCanvas;
|
|
108
|
+
}());
|
|
109
|
+
export { UtilExtractorCanvas };
|
|
110
|
+
//# sourceMappingURL=util-extractor-canvas.js.map
|