@wcardinal/wcardinal-ui 0.400.0 → 0.401.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/theme/white/d-theme-white-indicator-processing.d.ts +1 -1
- package/dist/types/wcardinal/ui/util/util-svg-atlas-builder.d.ts +13 -2
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-atlas.js +6 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-atlas.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-indicator-processing.js +7 -13
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-indicator-processing.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-atlas.js +6 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-atlas.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-indicator-processing.js +7 -13
- package/dist/wcardinal/ui/theme/white/d-theme-white-indicator-processing.js.map +1 -1
- package/dist/wcardinal/ui/util/util-svg-atlas-builder.js +14 -9
- package/dist/wcardinal/ui/util/util-svg-atlas-builder.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark-en-us.js +15 -18
- 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 +15 -18
- 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 +15 -18
- package/dist/wcardinal-ui-theme-dark.min.js +2 -2
- package/dist/wcardinal-ui-theme-white-en-us.js +15 -18
- 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 +15 -18
- 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 +15 -18
- package/dist/wcardinal-ui-theme-white.min.js +2 -2
- package/dist/wcardinal-ui.cjs.js +48 -45
- package/dist/wcardinal-ui.js +14 -9
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { DisplayObject, Texture } from "pixi.js";
|
|
2
2
|
import type { DThemeIndicatorProcessing } from "../../d-indicator-processing";
|
|
3
3
|
import type { DStateAwareOrValueMightBe } from "../../d-state-aware";
|
|
4
4
|
export declare abstract class DThemeWhiteIndicatorProcess<VALUE = unknown> implements DThemeIndicatorProcessing<VALUE> {
|
|
@@ -1,20 +1,31 @@
|
|
|
1
|
-
import { Rectangle, SCALE_MODES, Texture } from "pixi.js";
|
|
1
|
+
import { MIPMAP_MODES, Rectangle, SCALE_MODES, Texture } from "pixi.js";
|
|
2
2
|
export interface UtilSvgAtlasBuilderBuildOptions {
|
|
3
3
|
force?: boolean;
|
|
4
4
|
scaling?: SCALE_MODES;
|
|
5
5
|
resolution?: number;
|
|
6
6
|
}
|
|
7
|
+
export interface UtilSvgAtlasBuilderOptions {
|
|
8
|
+
width?: number;
|
|
9
|
+
ratio?: number;
|
|
10
|
+
margin?: number;
|
|
11
|
+
resolution?: number;
|
|
12
|
+
scaling?: SCALE_MODES;
|
|
13
|
+
mipmap?: MIPMAP_MODES;
|
|
14
|
+
}
|
|
7
15
|
export declare class UtilSvgAtlasBuilder {
|
|
8
16
|
protected _width: number;
|
|
9
17
|
protected _ratio: number;
|
|
10
18
|
protected _margin: number;
|
|
19
|
+
protected _resolution: number;
|
|
20
|
+
protected _scaling: SCALE_MODES;
|
|
21
|
+
protected _mipmap: MIPMAP_MODES;
|
|
11
22
|
protected _frames: Record<string, Rectangle>;
|
|
12
23
|
protected _svg: string;
|
|
13
24
|
protected _nextX: number;
|
|
14
25
|
protected _nextY: number;
|
|
15
26
|
protected _height: number;
|
|
16
27
|
protected _built?: Record<string, Texture>;
|
|
17
|
-
constructor(
|
|
28
|
+
constructor(options: UtilSvgAtlasBuilderOptions);
|
|
18
29
|
get width(): number;
|
|
19
30
|
get ratio(): number;
|
|
20
31
|
get margin(): number;
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
* Copyright (C) 2019 Toshiba Corporation
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
+
import { MIPMAP_MODES, SCALE_MODES } from "pixi.js";
|
|
5
6
|
import { UtilSvgAtlasBuilder } from "../../util/util-svg-atlas-builder";
|
|
6
|
-
export var DThemeDarkAtlas = new UtilSvgAtlasBuilder(
|
|
7
|
+
export var DThemeDarkAtlas = new UtilSvgAtlasBuilder({
|
|
8
|
+
width: 1024,
|
|
9
|
+
scaling: SCALE_MODES.LINEAR,
|
|
10
|
+
mipmap: MIPMAP_MODES.OFF
|
|
11
|
+
});
|
|
7
12
|
//# sourceMappingURL=d-theme-dark-atlas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-theme-dark-atlas.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/dark/d-theme-dark-atlas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE,MAAM,CAAC,IAAM,eAAe,GAAG,IAAI,mBAAmB,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { UtilSvgAtlasBuilder } from \"../../util/util-svg-atlas-builder\";\n\nexport const DThemeDarkAtlas = new UtilSvgAtlasBuilder(1024
|
|
1
|
+
{"version":3,"file":"d-theme-dark-atlas.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/dark/d-theme-dark-atlas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE,MAAM,CAAC,IAAM,eAAe,GAAG,IAAI,mBAAmB,CAAC;IACtD,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,WAAW,CAAC,MAAM;IAC3B,MAAM,EAAE,YAAY,CAAC,GAAG;CACxB,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { MIPMAP_MODES, SCALE_MODES } from \"pixi.js\";\nimport { UtilSvgAtlasBuilder } from \"../../util/util-svg-atlas-builder\";\n\nexport const DThemeDarkAtlas = new UtilSvgAtlasBuilder({\n\twidth: 1024,\n\tscaling: SCALE_MODES.LINEAR,\n\tmipmap: MIPMAP_MODES.OFF\n});\n"]}
|
|
@@ -4,10 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { DThemeDarkAtlas } from "./d-theme-dark-atlas";
|
|
6
6
|
import { DBaseState } from "../../d-base-state";
|
|
7
|
-
import { toSvgTexture } from "../../util/to-svg-texture";
|
|
8
7
|
// Material Design icons by Google.
|
|
9
8
|
// Apache license version 2.0.
|
|
10
9
|
/* eslint-disable prettier/prettier */
|
|
10
|
+
DThemeDarkAtlas.add("button_process_processing", 24, 24, "<g transform=\"scale(0.025,0.025) translate(0,960)\">" +
|
|
11
|
+
"<path d=\"M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-155.5t86-127Q252-817 325-848.5T" +
|
|
12
|
+
"480-880q17 0 28.5 11.5T520-840q0 17-11.5 28.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160q133" +
|
|
13
|
+
" 0 226.5-93.5T800-480q0-17 11.5-28.5T840-520q17 0 28.5 11.5T880-480q0 82-31.5 155t-86 127.5q-54.5 54.5-127 8" +
|
|
14
|
+
"6T480-80Z\" fill=\"#fff\"/>" +
|
|
15
|
+
"</g>");
|
|
11
16
|
DThemeDarkAtlas.add("button_process_success", 24, 24, "<g transform=\"scale(0.025,0.025) translate(0,960)\">" +
|
|
12
17
|
"<path d=\"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z\" fill=\"#fff\" />" +
|
|
13
18
|
"</g>");
|
|
@@ -15,20 +20,9 @@ DThemeDarkAtlas.add("button_process_fail", 24, 24, "<g transform=\"scale(0.025,0
|
|
|
15
20
|
"<path d=\"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z\" fill=\"#fff\" />" +
|
|
16
21
|
"</g>");
|
|
17
22
|
/* eslint-enable prettier/prettier */
|
|
18
|
-
var newProcessingTexture = function () {
|
|
19
|
-
var resolution = (window.devicePixelRatio || 1) * 2;
|
|
20
|
-
var size = 24 * resolution;
|
|
21
|
-
return toSvgTexture("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(size, "px\" height=\"").concat(size, "px\" viewBox=\"0 -960 960 960\">") +
|
|
22
|
-
"<path d=\"M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-155.5t86-127Q252-817 325-848.5T" +
|
|
23
|
-
"480-880q17 0 28.5 11.5T520-840q0 17-11.5 28.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160q133" +
|
|
24
|
-
" 0 226.5-93.5T800-480q0-17 11.5-28.5T840-520q17 0 28.5 11.5T880-480q0 82-31.5 155t-86 127.5q-54.5 54.5-127 8" +
|
|
25
|
-
"6T480-80Z\" fill=\"#fff\"/>" +
|
|
26
|
-
"</svg>", resolution);
|
|
27
|
-
};
|
|
28
|
-
var processingTexture;
|
|
29
23
|
var imageSource = function (state) {
|
|
30
24
|
if (state.isProcessing) {
|
|
31
|
-
return
|
|
25
|
+
return DThemeDarkAtlas.mappings.button_process_processing;
|
|
32
26
|
}
|
|
33
27
|
else if (state.isSucceeded) {
|
|
34
28
|
return DThemeDarkAtlas.mappings.button_process_success;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-theme-dark-indicator-processing.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/dark/d-theme-dark-indicator-processing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"d-theme-dark-indicator-processing.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/dark/d-theme-dark-indicator-processing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,mCAAmC;AACnC,8BAA8B;AAC9B,sCAAsC;AACtC,eAAe,CAAC,GAAG,CAAC,2BAA2B,EAAE,EAAE,EAAE,EAAE,EACtD,uDAAqD;IACpD,+GAA8G;IAC9G,8GAA8G;IAC9G,8GAA8G;IAC9G,6BAA0B;IAC3B,MAAM,CACN,CAAC;AAGF,eAAe,CAAC,GAAG,CAAC,wBAAwB,EAAE,EAAE,EAAE,EAAE,EACnD,uDAAqD;IACpD,oFAAgF;IACjF,MAAM,CACN,CAAC;AAEF,eAAe,CAAC,GAAG,CAAC,qBAAqB,EAAE,EAAE,EAAE,EAAE,EAChD,uDAAqD;IACpD,gIAA4H;IAC7H,MAAM,CACN,CAAC;AACF,qCAAqC;AAErC,IAAM,WAAW,GAAG,UAAC,KAAoB;IACxC,IAAI,KAAK,CAAC,YAAY,EAAE;QACvB,OAAO,eAAe,CAAC,QAAQ,CAAC,yBAAyB,CAAC;KAC1D;SAAM,IAAI,KAAK,CAAC,WAAW,EAAE;QAC7B,OAAO,eAAe,CAAC,QAAQ,CAAC,sBAAsB,CAAC;KACvD;SAAM;QACN,OAAO,eAAe,CAAC,QAAQ,CAAC,mBAAmB,CAAC;KACpD;AACF,CAAC,CAAC;AAEF,IAAM,aAAa,GAAG,UAAC,KAAoB;IAC1C,IAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IACnD,IAAI,KAAK,IAAI,IAAI,EAAE;QAClB,OAAO,KAAK,GAAG,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC;KAC9B;IACD,OAAO,CAAC,CAAC;AACV,CAAC,CAAC;AAEF;IAAA;IAgCA,CAAC;IA7BA,wDAAmB,GAAnB;QACC,OAAO,GAAG,CAAC;IACZ,CAAC;IAED,yDAAoB,GAApB;QACC,OAAO,IAAI,CAAC;IACb,CAAC;IAED,yDAAoB,GAApB;QACC,OAAO,KAAK,CAAC;IACd,CAAC;IAID,0DAAqB,GAArB;QACC,OAAO,IAAI,CAAC;IACb,CAAC;IAED,yDAAoB,GAApB;QACC,OAAO,CAAC,CAAC;IACV,CAAC;IAED,0DAAqB,GAArB;QACC,OAAO,WAAW,CAAC;IACpB,CAAC;IAED,4DAAuB,GAAvB;QACC,OAAO,aAAa,CAAC;IACtB,CAAC;IACF,iCAAC;AAAD,CAAC,AAhCD,IAgCC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { DisplayObject, Texture } from \"pixi.js\";\nimport type { DBaseStateSet } from \"../../d-base-state-set\";\nimport type { DThemeIndicatorProcessing } from \"../../d-indicator-processing\";\nimport type { DStateAwareOrValueMightBe } from \"../../d-state-aware\";\nimport { DThemeDarkAtlas } from \"./d-theme-dark-atlas\";\nimport { DBaseState } from \"../../d-base-state\";\n\n// Material Design icons by Google.\n// Apache license version 2.0.\n/* eslint-disable prettier/prettier */\nDThemeDarkAtlas.add(\"button_process_processing\", 24, 24,\n\t`<g transform=\"scale(0.025,0.025) translate(0,960)\">` +\n\t\t`<path d=\"M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-155.5t86-127Q252-817 325-848.5T` +\n\t\t`480-880q17 0 28.5 11.5T520-840q0 17-11.5 28.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160q133` +\n\t\t` 0 226.5-93.5T800-480q0-17 11.5-28.5T840-520q17 0 28.5 11.5T880-480q0 82-31.5 155t-86 127.5q-54.5 54.5-127 8` +\n\t\t`6T480-80Z\" fill=\"#fff\"/>` +\n\t`</g>`\n);\n\n\nDThemeDarkAtlas.add(\"button_process_success\", 24, 24,\n\t`<g transform=\"scale(0.025,0.025) translate(0,960)\">` +\n\t\t`<path d=\"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z\" fill=\"#fff\" />` +\n\t`</g>`\n);\n\nDThemeDarkAtlas.add(\"button_process_fail\", 24, 24,\n\t`<g transform=\"scale(0.025,0.025) translate(0,960)\">` +\n\t\t`<path d=\"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z\" fill=\"#fff\" />` +\n\t`</g>`\n);\n/* eslint-enable prettier/prettier */\n\nconst imageSource = (state: DBaseStateSet): Texture | DisplayObject | null => {\n\tif (state.isProcessing) {\n\t\treturn DThemeDarkAtlas.mappings.button_process_processing;\n\t} else if (state.isSucceeded) {\n\t\treturn DThemeDarkAtlas.mappings.button_process_success;\n\t} else {\n\t\treturn DThemeDarkAtlas.mappings.button_process_fail;\n\t}\n};\n\nconst imageRotation = (state: DBaseStateSet): number => {\n\tconst value = state.valueOf(DBaseState.PROCESSING);\n\tif (value != null) {\n\t\treturn value * Math.PI * 0.02;\n\t}\n\treturn 0;\n};\n\nexport abstract class DThemeDarkIndicatorProcess<VALUE = unknown>\n\timplements DThemeIndicatorProcessing<VALUE>\n{\n\tgetProcessDoneDelay(): number {\n\t\treturn 400;\n\t}\n\n\tgetProcessCloseDelay(): number | null {\n\t\treturn 3000;\n\t}\n\n\tisProcessTextEnabled(): boolean {\n\t\treturn false;\n\t}\n\n\tabstract newProcessTextValue(): DStateAwareOrValueMightBe<VALUE>;\n\n\tisProcessImageEnabled(): boolean {\n\t\treturn true;\n\t}\n\n\tgetProcessImageIndex(): number {\n\t\treturn 0;\n\t}\n\n\tnewProcessImageSource(): DStateAwareOrValueMightBe<Texture | DisplayObject | null> {\n\t\treturn imageSource;\n\t}\n\n\tnewProcessImageRotation(): DStateAwareOrValueMightBe<number> {\n\t\treturn imageRotation;\n\t}\n}\n"]}
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
* Copyright (C) 2019 Toshiba Corporation
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
+
import { MIPMAP_MODES, SCALE_MODES } from "pixi.js";
|
|
5
6
|
import { UtilSvgAtlasBuilder } from "../../util/util-svg-atlas-builder";
|
|
6
|
-
export var DThemeWhiteAtlas = new UtilSvgAtlasBuilder(
|
|
7
|
+
export var DThemeWhiteAtlas = new UtilSvgAtlasBuilder({
|
|
8
|
+
width: 1024,
|
|
9
|
+
scaling: SCALE_MODES.LINEAR,
|
|
10
|
+
mipmap: MIPMAP_MODES.OFF
|
|
11
|
+
});
|
|
7
12
|
//# sourceMappingURL=d-theme-white-atlas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-theme-white-atlas.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/white/d-theme-white-atlas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE,MAAM,CAAC,IAAM,gBAAgB,GAAG,IAAI,mBAAmB,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { UtilSvgAtlasBuilder } from \"../../util/util-svg-atlas-builder\";\n\nexport const DThemeWhiteAtlas = new UtilSvgAtlasBuilder(1024
|
|
1
|
+
{"version":3,"file":"d-theme-white-atlas.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/white/d-theme-white-atlas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE,MAAM,CAAC,IAAM,gBAAgB,GAAG,IAAI,mBAAmB,CAAC;IACvD,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,WAAW,CAAC,MAAM;IAC3B,MAAM,EAAE,YAAY,CAAC,GAAG;CACxB,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { MIPMAP_MODES, SCALE_MODES } from \"pixi.js\";\nimport { UtilSvgAtlasBuilder } from \"../../util/util-svg-atlas-builder\";\n\nexport const DThemeWhiteAtlas = new UtilSvgAtlasBuilder({\n\twidth: 1024,\n\tscaling: SCALE_MODES.LINEAR,\n\tmipmap: MIPMAP_MODES.OFF\n});\n"]}
|
|
@@ -4,10 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { DThemeWhiteAtlas } from "./d-theme-white-atlas";
|
|
6
6
|
import { DBaseState } from "../../d-base-state";
|
|
7
|
-
import { toSvgTexture } from "../../util/to-svg-texture";
|
|
8
7
|
// Material Design icons by Google.
|
|
9
8
|
// Apache license version 2.0.
|
|
10
9
|
/* eslint-disable prettier/prettier */
|
|
10
|
+
DThemeWhiteAtlas.add("button_process_processing", 24, 24, "<g transform=\"scale(0.025,0.025) translate(0,960)\">" +
|
|
11
|
+
"<path d=\"M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-155.5t86-127Q252-817 325-848.5T" +
|
|
12
|
+
"480-880q17 0 28.5 11.5T520-840q0 17-11.5 28.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160q133" +
|
|
13
|
+
" 0 226.5-93.5T800-480q0-17 11.5-28.5T840-520q17 0 28.5 11.5T880-480q0 82-31.5 155t-86 127.5q-54.5 54.5-127 8" +
|
|
14
|
+
"6T480-80Z\" fill=\"#fff\"/>" +
|
|
15
|
+
"</g>");
|
|
11
16
|
DThemeWhiteAtlas.add("button_process_success", 24, 24, "<g transform=\"scale(0.025,0.025) translate(0,960)\">" +
|
|
12
17
|
"<path d=\"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z\" fill=\"#fff\" />" +
|
|
13
18
|
"</g>");
|
|
@@ -15,20 +20,9 @@ DThemeWhiteAtlas.add("button_process_fail", 24, 24, "<g transform=\"scale(0.025,
|
|
|
15
20
|
"<path d=\"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z\" fill=\"#fff\" />" +
|
|
16
21
|
"</g>");
|
|
17
22
|
/* eslint-enable prettier/prettier */
|
|
18
|
-
var newProcessingTexture = function () {
|
|
19
|
-
var resolution = (window.devicePixelRatio || 1) * 2;
|
|
20
|
-
var size = 24 * resolution;
|
|
21
|
-
return toSvgTexture("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(size, "px\" height=\"").concat(size, "px\" viewBox=\"0 -960 960 960\">") +
|
|
22
|
-
"<path d=\"M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-155.5t86-127Q252-817 325-848.5T" +
|
|
23
|
-
"480-880q17 0 28.5 11.5T520-840q0 17-11.5 28.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160q133" +
|
|
24
|
-
" 0 226.5-93.5T800-480q0-17 11.5-28.5T840-520q17 0 28.5 11.5T880-480q0 82-31.5 155t-86 127.5q-54.5 54.5-127 8" +
|
|
25
|
-
"6T480-80Z\" fill=\"#fff\"/>" +
|
|
26
|
-
"</svg>", resolution);
|
|
27
|
-
};
|
|
28
|
-
var processingTexture;
|
|
29
23
|
var imageSource = function (state) {
|
|
30
24
|
if (state.isProcessing) {
|
|
31
|
-
return
|
|
25
|
+
return DThemeWhiteAtlas.mappings.button_process_processing;
|
|
32
26
|
}
|
|
33
27
|
else if (state.isSucceeded) {
|
|
34
28
|
return DThemeWhiteAtlas.mappings.button_process_success;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-theme-white-indicator-processing.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/white/d-theme-white-indicator-processing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"d-theme-white-indicator-processing.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/white/d-theme-white-indicator-processing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,mCAAmC;AACnC,8BAA8B;AAC9B,sCAAsC;AACtC,gBAAgB,CAAC,GAAG,CAAC,2BAA2B,EAAE,EAAE,EAAE,EAAE,EACvD,uDAAqD;IACpD,+GAA8G;IAC9G,8GAA8G;IAC9G,8GAA8G;IAC9G,6BAA0B;IAC3B,MAAM,CACN,CAAC;AAEF,gBAAgB,CAAC,GAAG,CAAC,wBAAwB,EAAE,EAAE,EAAE,EAAE,EACpD,uDAAqD;IACpD,oFAAgF;IACjF,MAAM,CACN,CAAC;AAEF,gBAAgB,CAAC,GAAG,CAAC,qBAAqB,EAAE,EAAE,EAAE,EAAE,EACjD,uDAAqD;IACpD,gIAA4H;IAC7H,MAAM,CACN,CAAC;AACF,qCAAqC;AAErC,IAAM,WAAW,GAAG,UAAC,KAAoB;IACxC,IAAI,KAAK,CAAC,YAAY,EAAE;QACvB,OAAO,gBAAgB,CAAC,QAAQ,CAAC,yBAAyB,CAAC;KAC3D;SAAM,IAAI,KAAK,CAAC,WAAW,EAAE;QAC7B,OAAO,gBAAgB,CAAC,QAAQ,CAAC,sBAAsB,CAAC;KACxD;SAAM;QACN,OAAO,gBAAgB,CAAC,QAAQ,CAAC,mBAAmB,CAAC;KACrD;AACF,CAAC,CAAC;AAEF,IAAM,aAAa,GAAG,UAAC,KAAoB;IAC1C,IAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IACnD,IAAI,KAAK,IAAI,IAAI,EAAE;QAClB,OAAO,KAAK,GAAG,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC;KAC9B;IACD,OAAO,CAAC,CAAC;AACV,CAAC,CAAC;AAEF;IAAA;IAgCA,CAAC;IA7BA,yDAAmB,GAAnB;QACC,OAAO,GAAG,CAAC;IACZ,CAAC;IAED,0DAAoB,GAApB;QACC,OAAO,IAAI,CAAC;IACb,CAAC;IAED,0DAAoB,GAApB;QACC,OAAO,KAAK,CAAC;IACd,CAAC;IAID,2DAAqB,GAArB;QACC,OAAO,IAAI,CAAC;IACb,CAAC;IAED,0DAAoB,GAApB;QACC,OAAO,CAAC,CAAC;IACV,CAAC;IAED,2DAAqB,GAArB;QACC,OAAO,WAAW,CAAC;IACpB,CAAC;IAED,6DAAuB,GAAvB;QACC,OAAO,aAAa,CAAC;IACtB,CAAC;IACF,kCAAC;AAAD,CAAC,AAhCD,IAgCC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DisplayObject, Texture } from \"pixi.js\";\nimport type { DBaseStateSet } from \"../../d-base-state-set\";\nimport type { DThemeIndicatorProcessing } from \"../../d-indicator-processing\";\nimport type { DStateAwareOrValueMightBe } from \"../../d-state-aware\";\nimport { DThemeWhiteAtlas } from \"./d-theme-white-atlas\";\nimport { DBaseState } from \"../../d-base-state\";\n\n// Material Design icons by Google.\n// Apache license version 2.0.\n/* eslint-disable prettier/prettier */\nDThemeWhiteAtlas.add(\"button_process_processing\", 24, 24,\n\t`<g transform=\"scale(0.025,0.025) translate(0,960)\">` +\n\t\t`<path d=\"M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-155.5t86-127Q252-817 325-848.5T` +\n\t\t`480-880q17 0 28.5 11.5T520-840q0 17-11.5 28.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160q133` +\n\t\t` 0 226.5-93.5T800-480q0-17 11.5-28.5T840-520q17 0 28.5 11.5T880-480q0 82-31.5 155t-86 127.5q-54.5 54.5-127 8` +\n\t\t`6T480-80Z\" fill=\"#fff\"/>` +\n\t`</g>`\n);\n\nDThemeWhiteAtlas.add(\"button_process_success\", 24, 24,\n\t`<g transform=\"scale(0.025,0.025) translate(0,960)\">` +\n\t\t`<path d=\"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z\" fill=\"#fff\" />` +\n\t`</g>`\n);\n\nDThemeWhiteAtlas.add(\"button_process_fail\", 24, 24,\n\t`<g transform=\"scale(0.025,0.025) translate(0,960)\">` +\n\t\t`<path d=\"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z\" fill=\"#fff\" />` +\n\t`</g>`\n);\n/* eslint-enable prettier/prettier */\n\nconst imageSource = (state: DBaseStateSet): Texture | DisplayObject | null => {\n\tif (state.isProcessing) {\n\t\treturn DThemeWhiteAtlas.mappings.button_process_processing;\n\t} else if (state.isSucceeded) {\n\t\treturn DThemeWhiteAtlas.mappings.button_process_success;\n\t} else {\n\t\treturn DThemeWhiteAtlas.mappings.button_process_fail;\n\t}\n};\n\nconst imageRotation = (state: DBaseStateSet): number => {\n\tconst value = state.valueOf(DBaseState.PROCESSING);\n\tif (value != null) {\n\t\treturn value * Math.PI * 0.02;\n\t}\n\treturn 0;\n};\n\nexport abstract class DThemeWhiteIndicatorProcess<VALUE = unknown>\n\timplements DThemeIndicatorProcessing<VALUE>\n{\n\tgetProcessDoneDelay(): number {\n\t\treturn 400;\n\t}\n\n\tgetProcessCloseDelay(): number | null {\n\t\treturn 3000;\n\t}\n\n\tisProcessTextEnabled(): boolean {\n\t\treturn false;\n\t}\n\n\tabstract newProcessTextValue(): DStateAwareOrValueMightBe<VALUE>;\n\n\tisProcessImageEnabled(): boolean {\n\t\treturn true;\n\t}\n\n\tgetProcessImageIndex(): number {\n\t\treturn 0;\n\t}\n\n\tnewProcessImageSource(): DStateAwareOrValueMightBe<Texture | DisplayObject | null> {\n\t\treturn imageSource;\n\t}\n\n\tnewProcessImageRotation(): DStateAwareOrValueMightBe<number> {\n\t\treturn imageRotation;\n\t}\n}\n"]}
|
|
@@ -2,13 +2,17 @@
|
|
|
2
2
|
* Copyright (C) 2019 Toshiba Corporation
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
import { BaseTexture, Rectangle,
|
|
5
|
+
import { BaseTexture, Rectangle, Texture, settings } from "pixi.js";
|
|
6
6
|
import { toSvgUrl } from "./to-svg-url";
|
|
7
7
|
var UtilSvgAtlasBuilder = /** @class */ (function () {
|
|
8
|
-
function UtilSvgAtlasBuilder(
|
|
9
|
-
|
|
10
|
-
this.
|
|
11
|
-
this.
|
|
8
|
+
function UtilSvgAtlasBuilder(options) {
|
|
9
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
10
|
+
this._width = (_a = options.width) !== null && _a !== void 0 ? _a : 256;
|
|
11
|
+
this._ratio = (_b = options.ratio) !== null && _b !== void 0 ? _b : 1;
|
|
12
|
+
this._margin = (_c = options.margin) !== null && _c !== void 0 ? _c : 3;
|
|
13
|
+
this._resolution = (_e = (_d = options.resolution) !== null && _d !== void 0 ? _d : window.devicePixelRatio) !== null && _e !== void 0 ? _e : 1;
|
|
14
|
+
this._scaling = (_f = options.scaling) !== null && _f !== void 0 ? _f : settings.SCALE_MODE;
|
|
15
|
+
this._mipmap = (_g = options.mipmap) !== null && _g !== void 0 ? _g : settings.MIPMAP_TEXTURES;
|
|
12
16
|
this._frames = {};
|
|
13
17
|
this._svg = "";
|
|
14
18
|
this._nextX = 0;
|
|
@@ -73,10 +77,10 @@ var UtilSvgAtlasBuilder = /** @class */ (function () {
|
|
|
73
77
|
configurable: true
|
|
74
78
|
});
|
|
75
79
|
UtilSvgAtlasBuilder.prototype.build = function (options) {
|
|
76
|
-
var _a, _b
|
|
80
|
+
var _a, _b;
|
|
77
81
|
var built = this._built;
|
|
78
82
|
if (built == null || (options === null || options === void 0 ? void 0 : options.force)) {
|
|
79
|
-
var resolution = (
|
|
83
|
+
var resolution = (_a = options === null || options === void 0 ? void 0 : options.resolution) !== null && _a !== void 0 ? _a : this._resolution;
|
|
80
84
|
var width = this._width;
|
|
81
85
|
var height = Math.pow(2, Math.ceil(Math.log(this._nextY + this._height) / Math.LN2));
|
|
82
86
|
var realWidth = width * resolution;
|
|
@@ -87,10 +91,11 @@ var UtilSvgAtlasBuilder = /** @class */ (function () {
|
|
|
87
91
|
var attrViewBox = "viewBox=\"0 0 ".concat(width * ratio, " ").concat(height * ratio, "\"");
|
|
88
92
|
var attrXmlns = "xmlns=\"http://www.w3.org/2000/svg\"";
|
|
89
93
|
var url = toSvgUrl("<svg ".concat(attrWidth, " ").concat(attrHeight, " ").concat(attrViewBox, " ").concat(attrXmlns, ">").concat(this._svg, "</svg>"));
|
|
90
|
-
var scaleMode = (
|
|
94
|
+
var scaleMode = (_b = options === null || options === void 0 ? void 0 : options.scaling) !== null && _b !== void 0 ? _b : this._scaling;
|
|
91
95
|
var baseTexture = BaseTexture.from(url, {
|
|
92
96
|
resolution: resolution,
|
|
93
|
-
scaleMode: scaleMode
|
|
97
|
+
scaleMode: scaleMode,
|
|
98
|
+
mipmap: this._mipmap
|
|
94
99
|
});
|
|
95
100
|
var frames_1 = this._frames;
|
|
96
101
|
built = this._built = {};
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"util-svg-atlas-builder.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/util/util-svg-atlas-builder.ts"],"names":[],"mappings":"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","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\tthis._resolution = options.resolution ?? window.devicePixelRatio ?? 1;\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"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.
|
|
2
|
+
Winter Cardinal UI v0.401.0
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
6
6
|
Material Design icons by Google
|
|
7
7
|
Apache license version 2.0.
|
|
8
8
|
*/
|
|
9
|
-
(function () {
|
|
9
|
+
(function (pixi_js) {
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
12
|
const UtilSvgAtlasBuilder = wcardinal.ui.UtilSvgAtlasBuilder;
|
|
@@ -15,7 +15,11 @@
|
|
|
15
15
|
* Copyright (C) 2019 Toshiba Corporation
|
|
16
16
|
* SPDX-License-Identifier: Apache-2.0
|
|
17
17
|
*/
|
|
18
|
-
var DThemeDarkAtlas = new UtilSvgAtlasBuilder(
|
|
18
|
+
var DThemeDarkAtlas = new UtilSvgAtlasBuilder({
|
|
19
|
+
width: 1024,
|
|
20
|
+
scaling: pixi_js.SCALE_MODES.LINEAR,
|
|
21
|
+
mipmap: pixi_js.MIPMAP_MODES.OFF
|
|
22
|
+
});
|
|
19
23
|
|
|
20
24
|
/*
|
|
21
25
|
* Copyright (C) 2019 Toshiba Corporation
|
|
@@ -9669,8 +9673,6 @@
|
|
|
9669
9673
|
loadThemeDarkMenu();
|
|
9670
9674
|
};
|
|
9671
9675
|
|
|
9672
|
-
const toSvgTexture = wcardinal.ui.toSvgTexture;
|
|
9673
|
-
|
|
9674
9676
|
/*
|
|
9675
9677
|
* Copyright (C) 2019 Toshiba Corporation
|
|
9676
9678
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -9678,6 +9680,12 @@
|
|
|
9678
9680
|
// Material Design icons by Google.
|
|
9679
9681
|
// Apache license version 2.0.
|
|
9680
9682
|
/* eslint-disable prettier/prettier */
|
|
9683
|
+
DThemeDarkAtlas.add("button_process_processing", 24, 24, "<g transform=\"scale(0.025,0.025) translate(0,960)\">" +
|
|
9684
|
+
"<path d=\"M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-155.5t86-127Q252-817 325-848.5T" +
|
|
9685
|
+
"480-880q17 0 28.5 11.5T520-840q0 17-11.5 28.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160q133" +
|
|
9686
|
+
" 0 226.5-93.5T800-480q0-17 11.5-28.5T840-520q17 0 28.5 11.5T880-480q0 82-31.5 155t-86 127.5q-54.5 54.5-127 8" +
|
|
9687
|
+
"6T480-80Z\" fill=\"#fff\"/>" +
|
|
9688
|
+
"</g>");
|
|
9681
9689
|
DThemeDarkAtlas.add("button_process_success", 24, 24, "<g transform=\"scale(0.025,0.025) translate(0,960)\">" +
|
|
9682
9690
|
"<path d=\"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z\" fill=\"#fff\" />" +
|
|
9683
9691
|
"</g>");
|
|
@@ -9685,20 +9693,9 @@
|
|
|
9685
9693
|
"<path d=\"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z\" fill=\"#fff\" />" +
|
|
9686
9694
|
"</g>");
|
|
9687
9695
|
/* eslint-enable prettier/prettier */
|
|
9688
|
-
var newProcessingTexture = function () {
|
|
9689
|
-
var resolution = (window.devicePixelRatio || 1) * 2;
|
|
9690
|
-
var size = 24 * resolution;
|
|
9691
|
-
return toSvgTexture("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(size, "px\" height=\"").concat(size, "px\" viewBox=\"0 -960 960 960\">") +
|
|
9692
|
-
"<path d=\"M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-155.5t86-127Q252-817 325-848.5T" +
|
|
9693
|
-
"480-880q17 0 28.5 11.5T520-840q0 17-11.5 28.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160q133" +
|
|
9694
|
-
" 0 226.5-93.5T800-480q0-17 11.5-28.5T840-520q17 0 28.5 11.5T880-480q0 82-31.5 155t-86 127.5q-54.5 54.5-127 8" +
|
|
9695
|
-
"6T480-80Z\" fill=\"#fff\"/>" +
|
|
9696
|
-
"</svg>", resolution);
|
|
9697
|
-
};
|
|
9698
|
-
var processingTexture;
|
|
9699
9696
|
var imageSource = function (state) {
|
|
9700
9697
|
if (state.isProcessing) {
|
|
9701
|
-
return
|
|
9698
|
+
return DThemeDarkAtlas.mappings.button_process_processing;
|
|
9702
9699
|
}
|
|
9703
9700
|
else if (state.isSucceeded) {
|
|
9704
9701
|
return DThemeDarkAtlas.mappings.button_process_success;
|
|
@@ -10181,4 +10178,4 @@
|
|
|
10181
10178
|
dest[name_1] = src[name_1];
|
|
10182
10179
|
}
|
|
10183
10180
|
|
|
10184
|
-
})();
|
|
10181
|
+
})(PIXI);
|