@wcardinal/wcardinal-ui 0.415.0 → 0.418.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/index.d.ts +1 -0
- package/dist/types/wcardinal/ui/util/dynamic-font-atlas-font.d.ts +1 -0
- package/dist/types/wcardinal/ui/util/dynamic-sdf-font-atlas-font.d.ts +12 -0
- package/dist/types/wcardinal/ui/util/dynamic-sdf-font-atlas.d.ts +2 -9
- package/dist/types/wcardinal/ui/util/index.d.ts +1 -0
- package/dist/types/wcardinal/ui/util/util-font.d.ts +7 -2
- package/dist/wcardinal/ui/index.js +1 -0
- package/dist/wcardinal/ui/index.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-font.js +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-font.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-font.js +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-font.js.map +1 -1
- package/dist/wcardinal/ui/util/dynamic-font-atlas-font.js +3 -4
- package/dist/wcardinal/ui/util/dynamic-font-atlas-font.js.map +1 -1
- package/dist/wcardinal/ui/util/dynamic-font-atlas.js +5 -3
- package/dist/wcardinal/ui/util/dynamic-font-atlas.js.map +1 -1
- package/dist/wcardinal/ui/util/dynamic-sdf-font-atlas-font.js +30 -0
- package/dist/wcardinal/ui/util/dynamic-sdf-font-atlas-font.js.map +1 -0
- package/dist/wcardinal/ui/util/dynamic-sdf-font-atlas.js +13 -27
- package/dist/wcardinal/ui/util/dynamic-sdf-font-atlas.js.map +1 -1
- 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-font.js +14 -21
- package/dist/wcardinal/ui/util/util-font.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark-en-us.js +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/wcardinal-ui-theme-dark.min.js +2 -2
- package/dist/wcardinal-ui-theme-white-en-us.js +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/wcardinal-ui-theme-white.min.js +2 -2
- package/dist/wcardinal-ui.cjs.js +115 -106
- package/dist/wcardinal-ui.js +113 -104
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
package/dist/wcardinal-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.
|
|
2
|
+
Winter Cardinal UI v0.418.0
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -21221,6 +21221,34 @@
|
|
|
21221
21221
|
LETTER_RNB: LETTER_RNB
|
|
21222
21222
|
};
|
|
21223
21223
|
|
|
21224
|
+
/*
|
|
21225
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
21226
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
21227
|
+
*/
|
|
21228
|
+
var DynamicSDFFontAtlasFont = /** @class */ (function () {
|
|
21229
|
+
function DynamicSDFFontAtlasFont(fontFamily) {
|
|
21230
|
+
this.id = DynamicSDFFontAtlasFont.toFontFamily(fontFamily);
|
|
21231
|
+
this.size = 32;
|
|
21232
|
+
this.italic = false;
|
|
21233
|
+
this.measured = false;
|
|
21234
|
+
this.ascent = 0;
|
|
21235
|
+
this.descent = 0;
|
|
21236
|
+
}
|
|
21237
|
+
DynamicSDFFontAtlasFont.toFontFamily = function (fontFamily) {
|
|
21238
|
+
return fontFamily === "auto" ? DynamicSDFFontAtlasFont.getAutoFontFamily() : fontFamily;
|
|
21239
|
+
};
|
|
21240
|
+
DynamicSDFFontAtlasFont.getAutoFontFamily = function () {
|
|
21241
|
+
if (DynamicSDFFontAtlasFont.FONT_FAMILY_AUTO == null) {
|
|
21242
|
+
DynamicSDFFontAtlasFont.FONT_FAMILY_AUTO = DThemes.getInstance()
|
|
21243
|
+
.get("DBase")
|
|
21244
|
+
.getFontFamilly();
|
|
21245
|
+
}
|
|
21246
|
+
return DynamicSDFFontAtlasFont.FONT_FAMILY_AUTO;
|
|
21247
|
+
};
|
|
21248
|
+
DynamicSDFFontAtlasFont.FONT_FAMILY_AUTO = null;
|
|
21249
|
+
return DynamicSDFFontAtlasFont;
|
|
21250
|
+
}());
|
|
21251
|
+
|
|
21224
21252
|
/*
|
|
21225
21253
|
* Copyright (C) 2019 Toshiba Corporation
|
|
21226
21254
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -21509,6 +21537,69 @@
|
|
|
21509
21537
|
return DynamicSDFFontGenerator;
|
|
21510
21538
|
}());
|
|
21511
21539
|
|
|
21540
|
+
/*
|
|
21541
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
21542
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
21543
|
+
*/
|
|
21544
|
+
var UtilFont = /** @class */ (function () {
|
|
21545
|
+
function UtilFont() {
|
|
21546
|
+
}
|
|
21547
|
+
UtilFont.measure = function (context, font) {
|
|
21548
|
+
if (!font.measured) {
|
|
21549
|
+
if ("fontBoundingBoxAscent" in window.TextMetrics.prototype) {
|
|
21550
|
+
var metrics = context.measureText(pixi_js.TextMetrics.METRICS_STRING);
|
|
21551
|
+
font.ascent = metrics.fontBoundingBoxAscent;
|
|
21552
|
+
font.descent = metrics.fontBoundingBoxDescent;
|
|
21553
|
+
}
|
|
21554
|
+
else {
|
|
21555
|
+
var measured = pixi_js.TextMetrics.measureFont(font.id);
|
|
21556
|
+
font.ascent = measured.ascent;
|
|
21557
|
+
font.descent = measured.descent;
|
|
21558
|
+
}
|
|
21559
|
+
font.measured = true;
|
|
21560
|
+
}
|
|
21561
|
+
};
|
|
21562
|
+
UtilFont.toSize = function (font) {
|
|
21563
|
+
this.setup(font);
|
|
21564
|
+
return parseFloat(window.getComputedStyle(this._span).fontSize);
|
|
21565
|
+
};
|
|
21566
|
+
UtilFont.setup = function (font) {
|
|
21567
|
+
var span = this._span;
|
|
21568
|
+
if (span == null) {
|
|
21569
|
+
span = document.createElement("span");
|
|
21570
|
+
span.innerText = "|ÉqÅ";
|
|
21571
|
+
span.style.border = "none";
|
|
21572
|
+
span.style.margin = "0px";
|
|
21573
|
+
this._span = span;
|
|
21574
|
+
}
|
|
21575
|
+
var block = this._block;
|
|
21576
|
+
if (block == null) {
|
|
21577
|
+
block = document.createElement("div");
|
|
21578
|
+
block.style.display = "inline-block";
|
|
21579
|
+
block.style.width = "0px";
|
|
21580
|
+
block.style.height = "0px";
|
|
21581
|
+
block.style.border = "none";
|
|
21582
|
+
block.style.margin = "0px";
|
|
21583
|
+
block.style.verticalAlign = "baseline";
|
|
21584
|
+
this._block = block;
|
|
21585
|
+
}
|
|
21586
|
+
var div = this._div;
|
|
21587
|
+
if (div == null) {
|
|
21588
|
+
div = document.createElement("div");
|
|
21589
|
+
div.style.position = "absolute";
|
|
21590
|
+
div.style.padding = "0px";
|
|
21591
|
+
div.style.margin = "0px";
|
|
21592
|
+
div.style.visibility = "hidden";
|
|
21593
|
+
div.appendChild(span);
|
|
21594
|
+
div.appendChild(block);
|
|
21595
|
+
document.body.appendChild(div);
|
|
21596
|
+
this._div = div;
|
|
21597
|
+
}
|
|
21598
|
+
span.style.font = font;
|
|
21599
|
+
};
|
|
21600
|
+
return UtilFont;
|
|
21601
|
+
}());
|
|
21602
|
+
|
|
21512
21603
|
/*
|
|
21513
21604
|
* Copyright (C) 2019 Toshiba Corporation
|
|
21514
21605
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -21518,11 +21609,7 @@
|
|
|
21518
21609
|
this._id = "font-atlas:".concat(fontFamily);
|
|
21519
21610
|
this._generator = DynamicSDFFontGenerator.getInstance().init();
|
|
21520
21611
|
this._canvas = document.createElement("canvas");
|
|
21521
|
-
this._font =
|
|
21522
|
-
family: DynamicSDFFontAtlas.toFontFamily(fontFamily),
|
|
21523
|
-
size: 32,
|
|
21524
|
-
italic: false
|
|
21525
|
-
};
|
|
21612
|
+
this._font = new DynamicSDFFontAtlasFont(fontFamily);
|
|
21526
21613
|
this._characters = {};
|
|
21527
21614
|
this._length = 0;
|
|
21528
21615
|
this._width = 1;
|
|
@@ -21541,7 +21628,7 @@
|
|
|
21541
21628
|
return this._font;
|
|
21542
21629
|
},
|
|
21543
21630
|
set: function (font) {
|
|
21544
|
-
this._font.
|
|
21631
|
+
this._font.id = font.id;
|
|
21545
21632
|
this._font.size = font.size;
|
|
21546
21633
|
this._font.italic = font.italic;
|
|
21547
21634
|
},
|
|
@@ -21666,19 +21753,20 @@
|
|
|
21666
21753
|
var font = this._font;
|
|
21667
21754
|
var characters = this._characters;
|
|
21668
21755
|
var characterSize = font.size + 14;
|
|
21669
|
-
var width =
|
|
21756
|
+
var width = this.toPowerOf2(Math.ceil(Math.sqrt(this._length)) * characterSize);
|
|
21670
21757
|
this._width = width;
|
|
21671
|
-
var fontStyle = (font.italic ? "italic " : "") + (font.size + "px ") + font.
|
|
21758
|
+
var fontStyle = (font.italic ? "italic " : "") + (font.size + "px ") + font.id;
|
|
21672
21759
|
context.font = fontStyle;
|
|
21673
21760
|
context.textAlign = "left";
|
|
21674
|
-
context.textBaseline = "
|
|
21761
|
+
context.textBaseline = "alphabetic";
|
|
21675
21762
|
context.lineWidth = 0;
|
|
21676
21763
|
context.lineCap = "round";
|
|
21677
21764
|
context.lineJoin = "miter";
|
|
21678
|
-
context.miterLimit =
|
|
21765
|
+
context.miterLimit = 10;
|
|
21679
21766
|
context.fillStyle = "#FFFFFF";
|
|
21767
|
+
UtilFont.measure(context, font);
|
|
21680
21768
|
var offsetX = 7;
|
|
21681
|
-
var offsetY = characterSize
|
|
21769
|
+
var offsetY = Math.round((characterSize - (font.ascent + font.descent)) * 0.5 + font.ascent);
|
|
21682
21770
|
var x = 0;
|
|
21683
21771
|
var y = 0;
|
|
21684
21772
|
for (var id in characters) {
|
|
@@ -21707,11 +21795,11 @@
|
|
|
21707
21795
|
canvas.height = height;
|
|
21708
21796
|
context.font = fontStyle;
|
|
21709
21797
|
context.textAlign = "left";
|
|
21710
|
-
context.textBaseline = "
|
|
21798
|
+
context.textBaseline = "alphabetic";
|
|
21711
21799
|
context.lineWidth = 0;
|
|
21712
21800
|
context.lineCap = "round";
|
|
21713
21801
|
context.lineJoin = "miter";
|
|
21714
|
-
context.miterLimit =
|
|
21802
|
+
context.miterLimit = 10;
|
|
21715
21803
|
context.fillStyle = "#FFFFFF";
|
|
21716
21804
|
context.clearRect(0, 0, width, height);
|
|
21717
21805
|
for (var id in characters) {
|
|
@@ -21760,25 +21848,13 @@
|
|
|
21760
21848
|
delete characters[id];
|
|
21761
21849
|
}
|
|
21762
21850
|
};
|
|
21763
|
-
DynamicSDFFontAtlas.
|
|
21764
|
-
return fontFamily === "auto" ? DynamicSDFFontAtlas.getAutoFontFamily() : fontFamily;
|
|
21765
|
-
};
|
|
21766
|
-
DynamicSDFFontAtlas.toPowerOf2 = function (size) {
|
|
21851
|
+
DynamicSDFFontAtlas.prototype.toPowerOf2 = function (size) {
|
|
21767
21852
|
var result = 32;
|
|
21768
21853
|
while (result < size) {
|
|
21769
21854
|
result <<= 1;
|
|
21770
21855
|
}
|
|
21771
21856
|
return result;
|
|
21772
21857
|
};
|
|
21773
|
-
DynamicSDFFontAtlas.getAutoFontFamily = function () {
|
|
21774
|
-
if (DynamicSDFFontAtlas.FONT_FAMILY_AUTO == null) {
|
|
21775
|
-
DynamicSDFFontAtlas.FONT_FAMILY_AUTO = DThemes.getInstance()
|
|
21776
|
-
.get("DBase")
|
|
21777
|
-
.getFontFamilly();
|
|
21778
|
-
}
|
|
21779
|
-
return DynamicSDFFontAtlas.FONT_FAMILY_AUTO;
|
|
21780
|
-
};
|
|
21781
|
-
DynamicSDFFontAtlas.FONT_FAMILY_AUTO = null;
|
|
21782
21858
|
return DynamicSDFFontAtlas;
|
|
21783
21859
|
}());
|
|
21784
21860
|
|
|
@@ -29123,77 +29199,6 @@
|
|
|
29123
29199
|
return DDynamicTextGeometry;
|
|
29124
29200
|
}(pixi_js.MeshGeometry));
|
|
29125
29201
|
|
|
29126
|
-
/*
|
|
29127
|
-
* Copyright (C) 2019 Toshiba Corporation
|
|
29128
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
29129
|
-
*/
|
|
29130
|
-
var UtilFont = /** @class */ (function () {
|
|
29131
|
-
function UtilFont() {
|
|
29132
|
-
}
|
|
29133
|
-
UtilFont.measure = function (font) {
|
|
29134
|
-
var results = this._results;
|
|
29135
|
-
if (results == null) {
|
|
29136
|
-
results = new Map();
|
|
29137
|
-
this._results = results;
|
|
29138
|
-
}
|
|
29139
|
-
var result = results.get(font);
|
|
29140
|
-
if (result != null) {
|
|
29141
|
-
return result;
|
|
29142
|
-
}
|
|
29143
|
-
this.setup(font);
|
|
29144
|
-
var blockRect = this._block.getBoundingClientRect();
|
|
29145
|
-
var blockRectTop = blockRect.top;
|
|
29146
|
-
var spanRect = this._span.getBoundingClientRect();
|
|
29147
|
-
var ascent = blockRectTop - spanRect.top;
|
|
29148
|
-
var descent = spanRect.bottom - blockRectTop;
|
|
29149
|
-
result = {
|
|
29150
|
-
ascent: ascent,
|
|
29151
|
-
descent: descent
|
|
29152
|
-
};
|
|
29153
|
-
results.set(font, result);
|
|
29154
|
-
return result;
|
|
29155
|
-
};
|
|
29156
|
-
UtilFont.toSize = function (font) {
|
|
29157
|
-
this.setup(font);
|
|
29158
|
-
return parseFloat(window.getComputedStyle(this._span).fontSize);
|
|
29159
|
-
};
|
|
29160
|
-
UtilFont.setup = function (font) {
|
|
29161
|
-
var span = this._span;
|
|
29162
|
-
if (span == null) {
|
|
29163
|
-
span = document.createElement("span");
|
|
29164
|
-
span.innerText = "|ÉqÅ";
|
|
29165
|
-
span.style.border = "none";
|
|
29166
|
-
span.style.margin = "0px";
|
|
29167
|
-
this._span = span;
|
|
29168
|
-
}
|
|
29169
|
-
var block = this._block;
|
|
29170
|
-
if (block == null) {
|
|
29171
|
-
block = document.createElement("div");
|
|
29172
|
-
block.style.display = "inline-block";
|
|
29173
|
-
block.style.width = "0px";
|
|
29174
|
-
block.style.height = "0px";
|
|
29175
|
-
block.style.border = "none";
|
|
29176
|
-
block.style.margin = "0px";
|
|
29177
|
-
block.style.verticalAlign = "baseline";
|
|
29178
|
-
this._block = block;
|
|
29179
|
-
}
|
|
29180
|
-
var div = this._div;
|
|
29181
|
-
if (div == null) {
|
|
29182
|
-
div = document.createElement("div");
|
|
29183
|
-
div.style.position = "absolute";
|
|
29184
|
-
div.style.padding = "0px";
|
|
29185
|
-
div.style.margin = "0px";
|
|
29186
|
-
div.style.visibility = "hidden";
|
|
29187
|
-
div.appendChild(span);
|
|
29188
|
-
div.appendChild(block);
|
|
29189
|
-
document.body.appendChild(div);
|
|
29190
|
-
this._div = div;
|
|
29191
|
-
}
|
|
29192
|
-
span.style.font = font;
|
|
29193
|
-
};
|
|
29194
|
-
return UtilFont;
|
|
29195
|
-
}());
|
|
29196
|
-
|
|
29197
29202
|
/*
|
|
29198
29203
|
* Copyright (C) 2019 Toshiba Corporation
|
|
29199
29204
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -48225,9 +48230,9 @@
|
|
|
48225
48230
|
this.size = size;
|
|
48226
48231
|
this.color = pixi_js.utils.hex2string(color);
|
|
48227
48232
|
this.height = size + padding * 2;
|
|
48228
|
-
|
|
48229
|
-
this.ascent =
|
|
48230
|
-
this.descent =
|
|
48233
|
+
this.measured = false;
|
|
48234
|
+
this.ascent = 0;
|
|
48235
|
+
this.descent = 0;
|
|
48231
48236
|
}
|
|
48232
48237
|
return DynamicFontAtlasFont;
|
|
48233
48238
|
}());
|
|
@@ -48428,7 +48433,7 @@
|
|
|
48428
48433
|
context.lineWidth = 0;
|
|
48429
48434
|
context.lineCap = "round";
|
|
48430
48435
|
context.lineJoin = "miter";
|
|
48431
|
-
context.miterLimit =
|
|
48436
|
+
context.miterLimit = 10;
|
|
48432
48437
|
context.fillStyle = font.color;
|
|
48433
48438
|
context.strokeStyle = "#0000ff";
|
|
48434
48439
|
}
|
|
@@ -48445,7 +48450,6 @@
|
|
|
48445
48450
|
var characters = this._characters;
|
|
48446
48451
|
var width = (this._width = this.toPowerOf2(Math.ceil(Math.sqrt(this._length)) * fontHeight));
|
|
48447
48452
|
var offsetX = this._padding;
|
|
48448
|
-
var offsetY = Math.round((fontHeight - (font.ascent + font.descent)) * 0.5 + font.ascent);
|
|
48449
48453
|
var x = 0;
|
|
48450
48454
|
var y = 0;
|
|
48451
48455
|
for (var key in characters) {
|
|
@@ -48457,7 +48461,6 @@
|
|
|
48457
48461
|
character.x = x;
|
|
48458
48462
|
character.y = y;
|
|
48459
48463
|
character.origin.x = x + offsetX;
|
|
48460
|
-
character.origin.y = y + offsetY;
|
|
48461
48464
|
x += character.width;
|
|
48462
48465
|
}
|
|
48463
48466
|
var height = (this._height = y + fontHeight);
|
|
@@ -48472,11 +48475,14 @@
|
|
|
48472
48475
|
canvas.height = realHeight;
|
|
48473
48476
|
var context = this.getContext();
|
|
48474
48477
|
if (context != null) {
|
|
48478
|
+
UtilFont.measure(context, font);
|
|
48479
|
+
var offsetY = Math.round((fontHeight - (font.ascent + font.descent)) * 0.5 + font.ascent);
|
|
48475
48480
|
context.save();
|
|
48476
48481
|
context.scale(resolution, resolution);
|
|
48477
48482
|
context.clearRect(0, 0, width, height);
|
|
48478
48483
|
for (var key in characters) {
|
|
48479
48484
|
var character = characters[key];
|
|
48485
|
+
character.origin.y = character.y + offsetY;
|
|
48480
48486
|
context.fillText(key, character.origin.x, character.origin.y);
|
|
48481
48487
|
}
|
|
48482
48488
|
context.restore();
|
|
@@ -79071,6 +79077,7 @@
|
|
|
79071
79077
|
DynamicFontAtlasFont: DynamicFontAtlasFont,
|
|
79072
79078
|
DynamicFontAtlas: DynamicFontAtlas,
|
|
79073
79079
|
DynamicFontAtlases: DynamicFontAtlases,
|
|
79080
|
+
DynamicSDFFontAtlasFont: DynamicSDFFontAtlasFont,
|
|
79074
79081
|
DynamicSDFFontAtlas: DynamicSDFFontAtlas,
|
|
79075
79082
|
DynamicSDFFontAtlases: DynamicSDFFontAtlases,
|
|
79076
79083
|
DynamicSDFFontGenerator: DynamicSDFFontGenerator,
|
|
@@ -79593,6 +79600,8 @@
|
|
|
79593
79600
|
DTableCategoryColumnImpl: DTableCategoryColumnImpl,
|
|
79594
79601
|
DTableCategoryContainerImpl: DTableCategoryContainerImpl,
|
|
79595
79602
|
DTableCategory: DTableCategory,
|
|
79603
|
+
DTableCellEdgeHovered: DTableCellEdgeHovered,
|
|
79604
|
+
DTableCellEdge: DTableCellEdge,
|
|
79596
79605
|
DTableColumnContainerImpl: DTableColumnContainerImpl,
|
|
79597
79606
|
DTableColumnImpl: DTableColumnImpl,
|
|
79598
79607
|
DTableColumnType: DTableColumnType,
|