@kurot/ui 3.5.0 → 3.6.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/CHANGELOG.md +58 -6
- package/README.md +49 -34
- package/dist/kurot/components/Label.d.ts +1 -1
- package/dist/kurot/components/Label.d.ts.map +1 -1
- package/dist/kurot/components/Label.js +13 -14
- package/dist/kurot/components/Label.js.map +1 -1
- package/dist/kurot/text/fit-label-text.d.ts.map +1 -1
- package/dist/kurot/text/fit-label-text.js +6 -4
- package/dist/kurot/text/fit-label-text.js.map +1 -1
- package/dist/kurot/text/label-text-bounds.d.ts +13 -0
- package/dist/kurot/text/label-text-bounds.d.ts.map +1 -0
- package/dist/kurot/text/label-text-bounds.js +42 -0
- package/dist/kurot/text/label-text-bounds.js.map +1 -0
- package/docs/ai-context.md +24 -16
- package/docs/architecture.md +1 -1
- package/docs/label-text-layout.md +61 -24
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,9 +4,58 @@ All notable changes to `@kurot/ui` are documented here.
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
## [3.6.0] — 2026-10-11
|
|
8
|
+
|
|
9
|
+
Prepared for publication; not yet published. Requires published Core ^2.5.2.
|
|
10
|
+
See [Label outline layout](docs/label-text-layout.md#outline-safe-layout-in-360).
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Dynamic Label outlines now reserve a symmetric internal safety inset in normal
|
|
15
|
+
layout and fitting. Automatic dimensions include this inset and any glyph
|
|
16
|
+
block taller than nominal rows; wrapping, painting and shrink checks share the
|
|
17
|
+
same content bounds. Scroller viewports retain complete edge outlines without
|
|
18
|
+
per-Scroller configuration or relaxed clips.
|
|
19
|
+
- Preserve authored alignment, state overrides, minimum overflow, blank rows,
|
|
20
|
+
automatic axes and stable top-aligned typewriter origins after clearing.
|
|
21
|
+
Empty/unoutlined Labels and EditableText retain native sizing/viewport rules.
|
|
22
|
+
RichLabel, BitmapLabel and Core nominal measurement are unchanged.
|
|
23
|
+
|
|
24
|
+
### Compatibility and adoption
|
|
25
|
+
|
|
26
|
+
Outlined Label dimensions and wrapping may change, including when fitting is
|
|
27
|
+
disabled. Recheck tightly sized captions and keep explicit top alignment for
|
|
28
|
+
progressively typed dialogue. Empty/unoutlined Labels, EditableText, RichLabel
|
|
29
|
+
and BitmapLabel retain their layout contracts. No public property or KUI/resource
|
|
30
|
+
format migration is added.
|
|
31
|
+
|
|
32
|
+
The Core peer and development range increase from ^2.4.0 to ^2.5.2 for public
|
|
33
|
+
glyph metrics and unified block alignment. Development installs registry 2.5.3;
|
|
34
|
+
the 2.5.2 minimum is tested separately. Core itself needs no new release.
|
|
35
|
+
ui-runtime 0.10.0 already accepts UI 3.6.0 through ^3.4.0; its host must also
|
|
36
|
+
satisfy the new UI Core peer. CLI and ui-document need no changes or releases.
|
|
37
|
+
|
|
38
|
+
After publication, applications adopt UI 3.6.0 and rebuild explicitly. Editor's
|
|
39
|
+
exact UI 3.5.0 pin must change; compatible example/template ranges can update
|
|
40
|
+
their installations and locks without changing their ranges. Existing application
|
|
41
|
+
and SDK development locks are unchanged by this release preparation.
|
|
42
|
+
|
|
43
|
+
### Verification
|
|
44
|
+
|
|
45
|
+
The clean prepublish build and all 371 unit tests pass with installed registry Core
|
|
46
|
+
2.5.3 and an isolated 2.5.2 minimum. All 18 minified browser tests pass, including
|
|
47
|
+
exact outline clips on Canvas/WebGL 1/2 at physical 1x/2x. An isolated packed-UI
|
|
48
|
+
consumer also passes all six backend/density checks for clipping, Japanese tails
|
|
49
|
+
and typewriter layout with Core 2.5.2; its strict TypeScript check passes.
|
|
50
|
+
The 3.6.0 tarball contains all 344 matching compiled/declaration/map files and
|
|
51
|
+
public documentation, excluding tests, node_modules and internal drafts;
|
|
52
|
+
frozen registry installation and `git diff --check` pass. The MilfMaster trial
|
|
53
|
+
harness verifies the actual compiled Drama skin and completed render frames
|
|
54
|
+
without replacing its registry dependencies.
|
|
55
|
+
|
|
7
56
|
## [3.5.0] — 2026-10-10
|
|
8
57
|
|
|
9
|
-
|
|
58
|
+
Published; verified on npm on 2026-10-10. Requires Core ^2.4.0, unchanged
|
|
10
59
|
from 3.4.0. See [Label fitting](docs/label-text-layout.md).
|
|
11
60
|
|
|
12
61
|
### Added
|
|
@@ -37,10 +86,11 @@ Core APIs, peer minima, KUI format and resource contracts are unchanged.
|
|
|
37
86
|
|
|
38
87
|
ui-runtime 0.10.0's UI ^3.4.0 peer already accepts 3.5.0. CLI and ui-document
|
|
39
88
|
already preserve the fitting fields; neither needs a new release. Applications
|
|
40
|
-
adopt the UI installation/lock and rebuild explicitly. Editor 0.28.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
89
|
+
adopt the UI installation/lock and rebuild explicitly. Editor 0.28.2 uses exact
|
|
90
|
+
registry UI 3.5.0 with a matching Bun lock and ordinary App build; its temporary
|
|
91
|
+
UI source binding is removed. The selected Tentax and MilfMaster templates
|
|
92
|
+
adopt ^3.5.0 with matching pnpm locks and rebuilt outputs. Other applications
|
|
93
|
+
and SDK development locks are unchanged.
|
|
44
94
|
|
|
45
95
|
### Verification
|
|
46
96
|
|
|
@@ -50,7 +100,9 @@ flips, independent RichLabel/BitmapLabel, multiline shrink on Canvas/WebGL 1/2
|
|
|
50
100
|
at 1x/2x and pixel-identical fitting toggles for all alignment combinations.
|
|
51
101
|
Local npm packing verifies version 3.5.0, unchanged Core ^2.4.0, compiled fitting
|
|
52
102
|
and alignment modules, declarations and public documentation, excluding tests,
|
|
53
|
-
node_modules and internal drafts.
|
|
103
|
+
node_modules and internal drafts. Registry latest, package download and integrity
|
|
104
|
+
are verified; the published Label/fitting modules match the tested build.
|
|
105
|
+
`git diff --check` passes.
|
|
54
106
|
|
|
55
107
|
## [3.4.0] — 2026-10-09
|
|
56
108
|
|
package/README.md
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
# @kurot/ui
|
|
2
2
|
|
|
3
|
-
**3.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
**3.6.0 is prepared for publication; it is not yet published.** Dynamic Label
|
|
4
|
+
outlines now fit inside their layout bounds, including Scroller viewports,
|
|
5
|
+
automatic dimensions, wrapping and text fitting. The release requires Core
|
|
6
|
+
^2.5.2 and develops against registry Core 2.5.3 without local overrides.
|
|
7
|
+
The latest verified published UI release is 3.5.0 (2026-10-10).
|
|
8
|
+
See [Label layout](docs/label-text-layout.md) for behavior and adoption.
|
|
8
9
|
|
|
9
10
|
UI component framework for [@kurot/core](https://github.com/kurot-engine/kurot/tree/main/packages/core). Migrated from Egret EUI, rewritten in modern TypeScript with clean class inheritance — no namespace hacks, no prototype manipulation.
|
|
10
11
|
|
|
11
|
-
> **Package version: 3.
|
|
12
|
+
> **Package version: 3.6.0 (prepared, unpublished).** Requires `@kurot/core@^2.5.2`. Targets ES2022 + evergreen browsers, same as core.
|
|
13
|
+
|
|
14
|
+
Outlined Label sizes and line breaks can change, including without `textFit`;
|
|
15
|
+
Scroller viewports need no extra configuration. Keep explicit top alignment for
|
|
16
|
+
progressively typed dialogue. No new KUI field, Core release or unrelated SDK
|
|
17
|
+
bump is required. After publication, applications must adopt UI 3.6.0 and rebuild
|
|
18
|
+
to receive the correction.
|
|
12
19
|
|
|
13
20
|
For the full list of changes in this release, see [CHANGELOG.md](./CHANGELOG.md).
|
|
14
21
|
|
|
@@ -20,8 +27,9 @@ Published Core 2.5.2 and earlier default to top. Explicit top/bottom and skin-st
|
|
|
20
27
|
overrides stay effective; multiline only controls line generation. Set top
|
|
21
28
|
explicitly when text should start at the top of a taller box.
|
|
22
29
|
UI 3.4.0's existing peer range accepts Core 2.5.3 without a UI release or a higher
|
|
23
|
-
minimum. Applications adopt the Core installation/lock
|
|
24
|
-
UI's
|
|
30
|
+
minimum for that default change alone. Applications adopt the Core installation/lock
|
|
31
|
+
and rebuild. UI 3.6.0's separate outline correction requires Core ^2.5.2;
|
|
32
|
+
the development installation is registry Core 2.5.3.
|
|
25
33
|
See [text layout](docs/label-text-layout.md#vertical-alignment-and-skin-defaults).
|
|
26
34
|
|
|
27
35
|
## Centered flips in 3.4.0
|
|
@@ -66,9 +74,11 @@ BitmapLabel now also honors maxWidth during automatic measurement. Both text
|
|
|
66
74
|
components remeasure automatic height when an authored width changes.
|
|
67
75
|
|
|
68
76
|
The unpublished UI 3.3.1 snapshot built and tested against registry Core 2.3.1.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
77
|
+
Published UI 3.5.0 was tested against Core 2.4.0; UI 3.6.0 builds and tests against
|
|
78
|
+
registry Core 2.5.3 and separately verifies its 2.5.2 minimum. Native KUI support
|
|
79
|
+
for RichLabel and BitmapLabel is available with ui-document >= 0.12.0, CLI >= 3.4.0
|
|
80
|
+
and ui-runtime >= 0.9.0. The current document 0.13.1, CLI 3.6.0 and runtime 0.10.0
|
|
81
|
+
retain that support; authoring applications adopt these packages separately.
|
|
72
82
|
|
|
73
83
|
## Label text fitting in 3.5.0
|
|
74
84
|
|
|
@@ -97,9 +107,11 @@ height on the Label, and enable `textFit = 'shrink'`. Complete wrapped content,
|
|
|
97
107
|
hard breaks and line spacing participate in fitting. If several rows fit at the
|
|
98
108
|
base size, the base size is retained. Automatic axes are unconstrained, so
|
|
99
109
|
width-only multiline captions normally wrap and grow taller without shrinking.
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
110
|
+
UI 3.6.0 reserves a symmetric outline inset in every nonempty dynamic
|
|
111
|
+
Label with a positive finite stroke, including normal layout. Automatic dimensions
|
|
112
|
+
contain the outline; fixed and maximum bounds wrap/fit inside it. Toggling fitting at unchanged drawing size
|
|
113
|
+
retains geometry and painting. Published 3.5.0 kept automatic dimensions nominal.
|
|
114
|
+
See [outline layout](docs/label-text-layout.md#outline-safe-layout-in-360).
|
|
103
115
|
|
|
104
116
|
```ts
|
|
105
117
|
const caption = new Label('Доказуемая честность');
|
|
@@ -128,27 +140,29 @@ only on Core.
|
|
|
128
140
|
## Installation
|
|
129
141
|
|
|
130
142
|
```bash
|
|
131
|
-
pnpm add @kurot/ui@^3.
|
|
143
|
+
pnpm add @kurot/ui@^3.6.0 @kurot/core@^2.5.2
|
|
132
144
|
```
|
|
133
145
|
|
|
134
146
|
`@kurot/ui` declares `@kurot/core` as a peer dependency. Install both packages explicitly so the application controls the resolved core version.
|
|
135
147
|
|
|
136
|
-
Run this
|
|
137
|
-
|
|
138
|
-
the native text APIs
|
|
139
|
-
bitmap-font dependency automatically.
|
|
140
|
-
|
|
141
|
-
string-valued `subkeys` in
|
|
148
|
+
Run this command after UI 3.6.0 is published. Its Core ^2.5.2 minimum supplies
|
|
149
|
+
the public glyph metrics and unified alignment used by outline-safe Label layout,
|
|
150
|
+
in addition to centered flips and the native text APIs from earlier releases.
|
|
151
|
+
Core installs its published bitmap-font dependency automatically. Update Core
|
|
152
|
+
installations older than 2.5.2 when adopting UI 3.6.0.
|
|
153
|
+
For legacy projects, refresh sheet manifests with string-valued `subkeys` in
|
|
154
|
+
Kurot Editor before launching the application on Core 2.x.
|
|
142
155
|
See the [resource migration guide](../ui-document/docs/resource-nine-slice.md).
|
|
143
156
|
|
|
144
|
-
Adopting 3.
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
157
|
+
Adopting 3.6.0 requires a UI installation/lock update and rebuild, plus an accepted
|
|
158
|
+
Core installation. Review outlined captions for the larger automatic dimensions
|
|
159
|
+
or earlier wraps. ui-runtime 0.10.0 accepts it through ^3.4.0; its development lock
|
|
160
|
+
may adopt it separately and its host must satisfy UI's Core peer. CLI/ui-document
|
|
161
|
+
need no release or XML migration. Editor currently pins registry UI 3.5.0 and
|
|
162
|
+
requires an explicit dependency update after publication. The selected Tentax
|
|
163
|
+
and MilfMaster templates' ^3.5.0 ranges and the game example's ^3.1.0 range accept
|
|
164
|
+
3.6.0; their installations/locks and rebuilds are separate adoption steps.
|
|
165
|
+
This release preparation does not upgrade applications or other SDK locks.
|
|
152
166
|
|
|
153
167
|
## Project style colors
|
|
154
168
|
|
|
@@ -169,8 +183,8 @@ The Label belongs to a Skin declaring the `disabled` state. Native Skin state
|
|
|
169
183
|
handling applies the compiled numeric color and restores the base color on
|
|
170
184
|
leaving that state. The same reference syntax works for base color properties.
|
|
171
185
|
UI does not read style.json or evaluate XML references itself; programmatic
|
|
172
|
-
components assign numeric colors.
|
|
173
|
-
|
|
186
|
+
components assign numeric colors. Label presets are expanded by CLI/document
|
|
187
|
+
consumers before rendering; UI itself provides no automatic live theme switching. See the
|
|
174
188
|
[project style contract](../ui-document/docs/project-styles.md).
|
|
175
189
|
|
|
176
190
|
## Quick Start
|
|
@@ -591,6 +605,7 @@ resource cache or caller retains ownership. Superseded async requests cannot
|
|
|
591
605
|
replace a newer assignment. Successful named loads dispatch Event.COMPLETE;
|
|
592
606
|
failed or incorrectly typed resources dispatch IOErrorEvent.IO_ERROR.
|
|
593
607
|
|
|
594
|
-
The component supports native code and programmatic skins.
|
|
595
|
-
|
|
596
|
-
|
|
608
|
+
The component supports native code and programmatic skins. Native KUI authoring
|
|
609
|
+
requires ui-document >= 0.12.0 and CLI >= 3.4.0; materialized previews require
|
|
610
|
+
ui-runtime >= 0.9.0. Editor adopts those contracts explicitly. Published UI 3.1.0
|
|
611
|
+
does not include BitmapLabel.
|
|
@@ -89,6 +89,6 @@ export declare class Label extends Component implements IDisplayText {
|
|
|
89
89
|
setLayoutBoundsSize(layoutWidth: number, layoutHeight: number): void;
|
|
90
90
|
updateDisplayList(unscaledWidth: number, unscaledHeight: number): void;
|
|
91
91
|
private _applyTextFit;
|
|
92
|
-
private
|
|
92
|
+
private _getTextContentWidth;
|
|
93
93
|
}
|
|
94
94
|
//# sourceMappingURL=Label.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../src/kurot/components/Label.ts"],"names":[],"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IAAW,iBAAiB,IAAI,OAAO,CAEtC;IAED,IAAW,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAK1C;IAIe,cAAc,IAAI,IAAI;IAUtB,cAAc,IAAI,IAAI;IAKtB,OAAO,IAAI,IAAI;IA2Bf,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI;IAgBpE,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI;IA+BtF,OAAO,CAAC,aAAa;IA+CrB,OAAO,CAAC,oBAAoB;CAI5B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Component } from './Component.js';
|
|
2
2
|
import { TextField, TextFieldType } from '@kurot/core';
|
|
3
3
|
import { fitLabelText } from '../text/fit-label-text.js';
|
|
4
|
+
import { getLabelOutlinePadding, getLabelTextHeight } from '../text/label-text-bounds.js';
|
|
4
5
|
import { PropertyEvent } from '../events/PropertyEvent.js';
|
|
5
6
|
/**
|
|
6
7
|
* Label component for displaying text.
|
|
@@ -277,8 +278,9 @@ export class Label extends Component {
|
|
|
277
278
|
: NaN;
|
|
278
279
|
this._applyTextFit(availableWidth, availableHeight);
|
|
279
280
|
try {
|
|
280
|
-
tf.width = this.
|
|
281
|
-
|
|
281
|
+
tf.width = this._getTextContentWidth(availableWidth);
|
|
282
|
+
const outline = getLabelOutlinePadding(tf) * 2;
|
|
283
|
+
this.setMeasuredSize(tf.textWidth + outline, getLabelTextHeight(tf) + outline);
|
|
282
284
|
}
|
|
283
285
|
finally {
|
|
284
286
|
tf.width = oldWidth;
|
|
@@ -317,16 +319,13 @@ export class Label extends Component {
|
|
|
317
319
|
if (previousSize !== this.renderedSize && (isNaN(this.$explicitWidth) || isNaN(this.$explicitHeight))) {
|
|
318
320
|
this.invalidateSize();
|
|
319
321
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
this._textField.
|
|
326
|
-
|
|
327
|
-
this._textField.y = 0;
|
|
328
|
-
this._textField.width = contentWidth;
|
|
329
|
-
this._textField.height = unscaledHeight;
|
|
322
|
+
// Measure, wrap, fit and paint reserve the same space exactly once. Core
|
|
323
|
+
// alignment remains authored and operates inside this inset text region.
|
|
324
|
+
const padding = getLabelOutlinePadding(this._textField);
|
|
325
|
+
this._textField.x = padding;
|
|
326
|
+
this._textField.y = padding;
|
|
327
|
+
this._textField.width = Math.max(0, unscaledWidth - padding * 2);
|
|
328
|
+
this._textField.height = Math.max(0, unscaledHeight - padding * 2);
|
|
330
329
|
}
|
|
331
330
|
// ── Private methods ────────────────────────────────────────────────────
|
|
332
331
|
_applyTextFit(width, height) {
|
|
@@ -376,8 +375,8 @@ export class Label extends Component {
|
|
|
376
375
|
this._textFitOverflow = fitted.overflow;
|
|
377
376
|
this._fitKey = key;
|
|
378
377
|
}
|
|
379
|
-
|
|
380
|
-
const outline =
|
|
378
|
+
_getTextContentWidth(width) {
|
|
379
|
+
const outline = getLabelOutlinePadding(this._textField) * 2;
|
|
381
380
|
return Number.isFinite(width) ? Math.max(0, width - outline) : NaN;
|
|
382
381
|
}
|
|
383
382
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.js","sourceRoot":"","sources":["../../../src/kurot/components/Label.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAO3D;;;;;GAKG;AACH,MAAM,OAAO,KAAM,SAAQ,SAAS;IACnC,yEAAyE;IAE/D,UAAU,CAAY;IAExB,gBAAgB,GAAG,GAAG,CAAC;IACvB,aAAa,GAAG,GAAG,CAAC;IACpB,SAAS,CAAS;IAClB,QAAQ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C,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IACpE,CAAC;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fit-label-text.d.ts","sourceRoot":"","sources":["../../../src/kurot/text/fit-label-text.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fit-label-text.d.ts","sourceRoot":"","sources":["../../../src/kurot/text/fit-label-text.ts"],"names":[],"mappings":"AAGA,UAAU,gBAAgB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CACf;AAED,UAAU,YAAY;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,gBAAgB,GAAG,YAAY,CA6CpE"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TextField } from '@kurot/core';
|
|
2
|
+
import { getLabelOutlinePadding, getLabelTextHeight } from './label-text-bounds.js';
|
|
2
3
|
/**
|
|
3
4
|
* Fits plain text using the same line generation as the rendered TextField.
|
|
4
5
|
* A finite zero bound is meaningful; NaN represents an unconstrained axis.
|
|
@@ -15,16 +16,17 @@ export function fitLabelText(metrics) {
|
|
|
15
16
|
field.multiline = metrics.multiline;
|
|
16
17
|
field.wordWrap = metrics.wordWrap;
|
|
17
18
|
field.lineSpacing = metrics.lineSpacing;
|
|
18
|
-
|
|
19
|
+
field.stroke = metrics.stroke;
|
|
20
|
+
const outline = getLabelOutlinePadding(field) * 2;
|
|
19
21
|
const width = Number.isFinite(metrics.width) ? Math.max(0, metrics.width - outline) : NaN;
|
|
20
22
|
const fits = (size) => {
|
|
21
23
|
// Core intentionally measures zero-width content as empty, not as overflow.
|
|
22
24
|
if (width === 0)
|
|
23
25
|
return false;
|
|
24
26
|
field.size = size;
|
|
25
|
-
|
|
26
|
-
return ((!Number.isFinite(metrics.width) ||
|
|
27
|
-
(!Number.isFinite(metrics.height) ||
|
|
27
|
+
field.width = width;
|
|
28
|
+
return ((!Number.isFinite(metrics.width) || field.textWidth + outline <= metrics.width) &&
|
|
29
|
+
(!Number.isFinite(metrics.height) || getLabelTextHeight(field) + outline <= metrics.height));
|
|
28
30
|
};
|
|
29
31
|
if (fits(metrics.size)) {
|
|
30
32
|
return { size: metrics.size, overflow: false };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fit-label-text.js","sourceRoot":"","sources":["../../../src/kurot/text/fit-label-text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"fit-label-text.js","sourceRoot":"","sources":["../../../src/kurot/text/fit-label-text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAsBpF;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,OAAyB;IACrD,IAAI,CAAC,OAAO,CAAC,IAAI;QAAE,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAClE,MAAM,KAAK,GAAG,IAAI,SAAS,EAAE,CAAC;IAC9B,KAAK,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAC1B,KAAK,CAAC,UAAU,GAAG,OAAO,CA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IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAChD,CAAC;IACD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACpB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1C,CAAC;IAED,IAAI,KAAK,GAAG,OAAO,CAAC;IACpB,IAAI,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IACzB,wEAAwE;IACxE,mEAAmE;IACnE,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,EAAE,IAAI,KAAK,GAAG,KAAK,GAAG,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC;QACtE,MAAM,SAAS,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QACtC,IAAI,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;YACrB,KAAK,GAAG,SAAS,CAAC;QACnB,CAAC;aAAM,CAAC;YACP,KAAK,GAAG,SAAS,CAAC;QACnB,CAAC;IACF,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;IAC5D,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAC/D,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { TextField } from '@kurot/core';
|
|
2
|
+
/**
|
|
3
|
+
* Dynamic outlines need layout space inside external clips. Keep this allowance
|
|
4
|
+
* independent of glyphs so a typewriter prefix cannot move its drawing origin.
|
|
5
|
+
* Input retains its native editing viewport and empty Labels add no inset.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getLabelOutlinePadding(field: TextField): number;
|
|
8
|
+
/**
|
|
9
|
+
* Preserve nominal rows, including blanks, while containing the complete glyph
|
|
10
|
+
* block of an outlined Label. Core measurement itself remains nominal.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getLabelTextHeight(field: TextField): number;
|
|
13
|
+
//# sourceMappingURL=label-text-bounds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label-text-bounds.d.ts","sourceRoot":"","sources":["../../../src/kurot/text/label-text-bounds.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,aAAa,CAAC;AAI3D;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAQ/D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAmB3D"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { TextFieldType } from '@kurot/core';
|
|
2
|
+
const heightCache = new WeakMap();
|
|
3
|
+
/**
|
|
4
|
+
* Dynamic outlines need layout space inside external clips. Keep this allowance
|
|
5
|
+
* independent of glyphs so a typewriter prefix cannot move its drawing origin.
|
|
6
|
+
* Input retains its native editing viewport and empty Labels add no inset.
|
|
7
|
+
*/
|
|
8
|
+
export function getLabelOutlinePadding(field) {
|
|
9
|
+
if (field.type === TextFieldType.INPUT || !field.text || !Number.isFinite(field.stroke) || field.stroke <= 0) {
|
|
10
|
+
return 0;
|
|
11
|
+
}
|
|
12
|
+
if (!field.multiline && !field.displayAsPassword && /^[\n\r\v\f\u0085\u2028\u2029]/u.test(field.text)) {
|
|
13
|
+
return 0;
|
|
14
|
+
}
|
|
15
|
+
return Math.ceil(field.stroke * 2) + 2;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Preserve nominal rows, including blanks, while containing the complete glyph
|
|
19
|
+
* block of an outlined Label. Core measurement itself remains nominal.
|
|
20
|
+
*/
|
|
21
|
+
export function getLabelTextHeight(field) {
|
|
22
|
+
const nominalHeight = field.textHeight;
|
|
23
|
+
if (getLabelOutlinePadding(field) === 0)
|
|
24
|
+
return nominalHeight;
|
|
25
|
+
const lines = field.getLinesArr();
|
|
26
|
+
const cached = heightCache.get(lines);
|
|
27
|
+
if (cached !== undefined)
|
|
28
|
+
return cached;
|
|
29
|
+
let top = Infinity;
|
|
30
|
+
let bottom = -Infinity;
|
|
31
|
+
let lineTop = 0;
|
|
32
|
+
for (const line of lines) {
|
|
33
|
+
const hasInk = line.inkAscent + line.inkDescent > 0;
|
|
34
|
+
top = Math.min(top, lineTop + (hasInk ? line.baseline - line.inkAscent : 0));
|
|
35
|
+
bottom = Math.max(bottom, lineTop + (hasInk ? line.baseline + line.inkDescent : line.height));
|
|
36
|
+
lineTop += line.height + field.lineSpacing;
|
|
37
|
+
}
|
|
38
|
+
const height = Math.max(nominalHeight, lines.length === 0 ? 0 : bottom - top);
|
|
39
|
+
heightCache.set(lines, height);
|
|
40
|
+
return height;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=label-text-bounds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label-text-bounds.js","sourceRoot":"","sources":["../../../src/kurot/text/label-text-bounds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,MAAM,WAAW,GAAG,IAAI,OAAO,EAA0B,CAAC;AAE1D;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAgB;IACtD,IAAI,KAAK,CAAC,IAAI,KAAK,aAAa,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QAC9G,OAAO,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AC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAC9F,OAAO,IAAI,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC;IAC5C,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;IAC9E,WAAW,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC;AACf,CAAC"}
|
package/docs/ai-context.md
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
# @kurot/ui — AI context map
|
|
2
2
|
|
|
3
|
-
UI 3.
|
|
4
|
-
Label
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
UI 3.6.0 is prepared for publication, not yet published. It adds outline-safe
|
|
4
|
+
Label layout to normal measurement, wrapping and fitting; outlined automatic
|
|
5
|
+
dimensions and line breaks can change. Its Core peer is ^2.5.2 for public line
|
|
6
|
+
ink metrics and unified block alignment. Development installs registry Core
|
|
7
|
+
2.5.3 with a matching lock, without local overrides; the 2.5.2 minimum is tested
|
|
8
|
+
separately. Published UI 3.5.0 (verified on 2026-10-10) introduced multiline
|
|
9
|
+
Label fitting and stable alignment when fitting is toggled, with Core ^2.4.0. Read
|
|
7
10
|
[centered flips](../../../docs/centered-flips.md) before changing transforms,
|
|
8
11
|
reflection frames, authored flags or dependency adoption.
|
|
9
12
|
|
|
@@ -11,7 +14,8 @@ Label/RichLabel/EditableText inherit TextField's vertical alignment;
|
|
|
11
14
|
BitmapLabel inherits BitmapText's. Published Core 2.5.3 defaults both to middle;
|
|
12
15
|
published Core 2.5.2 and earlier default to top. Explicit values remain effective
|
|
13
16
|
and multiline only controls line generation. UI has no default override and needs
|
|
14
|
-
no new release
|
|
17
|
+
no new release for this default change alone. The separate UI 3.6.0 outline
|
|
18
|
+
correction requires Core ^2.5.2.
|
|
15
19
|
Published document 0.13.1 supplies matching authoring defaults.
|
|
16
20
|
|
|
17
21
|
Read this before exploring `src/`. It is a compressed map so an agent
|
|
@@ -20,8 +24,8 @@ each session. Treat the package source and its `src/index.ts` barrel as the
|
|
|
20
24
|
authority for current behavior and exports; this file provides the compressed
|
|
21
25
|
map, runtime contracts and task→file lookup.
|
|
22
26
|
|
|
23
|
-
Package identity: `@kurot/ui@3.
|
|
24
|
-
`@kurot/core`.
|
|
27
|
+
Package identity: `@kurot/ui@3.6.0` (prepared, unpublished), EUI-compatible UI framework on top of
|
|
28
|
+
`@kurot/core`. Its peer is `@kurot/core@^2.5.2`; published 3.5.0 uses ^2.4.0. Rewritten with standard class
|
|
25
29
|
inheritance and delegation — no namespace mixins, no prototype copying.
|
|
26
30
|
Version 3.3.1 is preserved in commit 60e6404 and fixes transformed parent
|
|
27
31
|
allocations. It has not been published; UI 3.4.0 includes the same correction. Version 3.3.0 adds RichLabel and tests against published Core 2.3.1 through its
|
|
@@ -219,7 +223,7 @@ before patching core's transform code.
|
|
|
219
223
|
| Understand validation/render scheduling order | `core/Validator.ts`, core `player/SystemTicker.ts` |
|
|
220
224
|
| Measure UI validation/rendering performance | `examples/benchmark/` for the visual runner, scenarios, Playwright automation, and local JSON/Markdown reports |
|
|
221
225
|
|
|
222
|
-
## Label text layout contract in 3.
|
|
226
|
+
## Label text layout contract in 3.6.0
|
|
223
227
|
|
|
224
228
|
Label defaults to multiline; explicit false draws only the first hard-separated
|
|
225
229
|
line without wrapping. EditableText defaults to single-line and rejects
|
|
@@ -230,8 +234,11 @@ multiline is enabled.
|
|
|
230
234
|
UI 3.5.0 fits both line modes using complete Core measurement at each candidate
|
|
231
235
|
size; UI 3.1.0–3.4.0 fit only single-line Labels.
|
|
232
236
|
`multiline` stays authored and automatic axes stay unconstrained. Outline
|
|
233
|
-
allowance
|
|
234
|
-
frame or nominal automatic dimensions.
|
|
237
|
+
allowance affected fit checks and shared wrapping width, not the original alignment
|
|
238
|
+
frame or nominal automatic dimensions in 3.5.0. UI 3.6.0
|
|
239
|
+
uses `text/label-text-bounds.ts` to reserve symmetric stroke/AA insets
|
|
240
|
+
and contain complete ink in automatic dimensions. Measurement, wrapping, fitting
|
|
241
|
+
and painting share this area. Empty/input fields add no inset. `minFontSize` defaults to
|
|
235
242
|
12 and must be finite and >= 1.
|
|
236
243
|
`size` stays authored; `renderedSize` and `textFitOverflow` are read-only results
|
|
237
244
|
after validation. Fitting uses fixed axes, parent layout constraints or explicit
|
|
@@ -241,18 +248,19 @@ automatic bounds are not fed back as fit constraints.
|
|
|
241
248
|
|
|
242
249
|
`label.invalidateSize()` also invalidates Core line metrics. Call it after
|
|
243
250
|
late font loading, even if the family name did not change. This requires
|
|
244
|
-
Core >= 2.1.0 for that API;
|
|
245
|
-
|
|
251
|
+
Core >= 2.1.0 for that API; published UI 3.5.0 requires Core ^2.4.0 for centered
|
|
252
|
+
flips, while the UI 3.6.0 outline correction needs ^2.5.2.
|
|
246
253
|
|
|
247
254
|
Width/height setters refresh automatic text dimensions. Font readiness also
|
|
248
255
|
invalidates fitting in fixed-size boxes. Fitting toggles preserve unchanged text
|
|
249
|
-
positions, all nine alignments and
|
|
256
|
+
positions, all nine alignments and outline-safe automatic dimensions.
|
|
250
257
|
There is no global font-readiness listener.
|
|
251
258
|
|
|
252
259
|
Existing multiline `shrink` policies begin fitting upon adoption; no XML format
|
|
253
|
-
or authored-property migration is required. Runtime 0.10.0 accepts UI 3.
|
|
254
|
-
through its existing ^3.4.0 peer
|
|
255
|
-
|
|
260
|
+
or authored-property migration is required. Runtime 0.10.0 accepts UI 3.6.0
|
|
261
|
+
through its existing ^3.4.0 peer; its host must also satisfy UI's Core ^2.5.2 peer.
|
|
262
|
+
CLI/document APIs are unchanged. After publication, consumers update their own
|
|
263
|
+
UI installations/locks and rebuild; no other SDK bump is needed.
|
|
256
264
|
|
|
257
265
|
See [Label text layout](label-text-layout.md) for fit bounds, state restoration,
|
|
258
266
|
font readiness and shared-schema boundaries. Native UI still depends only on
|
package/docs/architecture.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @kurot/ui architecture
|
|
2
2
|
|
|
3
|
-
> Package version: 3.5.0 (
|
|
3
|
+
> Package version: 3.5.0 (published), with peerDependency `@kurot/core: ^2.4.0`.
|
|
4
4
|
> Development installs published Core 2.4.0 with a matching registry lockfile.
|
|
5
5
|
> No local Core override is needed for builds or centered-flip checks.
|
|
6
6
|
> See [CHANGELOG.md](../CHANGELOG.md) for release-by-release changes.
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Introduced in UI 3.1.0 with Core >= 2.1.0, fitting is single-line in UI 3.1.0–3.4.0.
|
|
4
4
|
UI 3.5.0 extends it to multiline Labels using Core's existing independent
|
|
5
|
-
measurement API. Version 3.5.0 is
|
|
6
|
-
Core ^2.4.0
|
|
5
|
+
measurement API. Version 3.5.0 is published, verified on npm on 2026-10-10, with
|
|
6
|
+
Core ^2.4.0. UI 3.6.0 is prepared, not yet published; it adds outline-safe layout
|
|
7
|
+
and requires Core ^2.5.2. The public
|
|
7
8
|
`TextFitMode` type is `none | shrink`. Native UI depends only on Core. KUI
|
|
8
9
|
authoring introduced fitting metadata in ui-document 0.9.0 and retains it in
|
|
9
10
|
0.13.1. Current CLI 3.6.0 and runtime 0.10.0 use document `^0.13.0`; runtime
|
|
@@ -12,6 +13,37 @@ automatically accept 0.13.0. Label presets expand into native properties before
|
|
|
12
13
|
rendering; their precedence does not change fitting behavior. See the
|
|
13
14
|
[project style contract](../../ui-document/docs/project-styles.md).
|
|
14
15
|
|
|
16
|
+
## Outline-safe layout in 3.6.0
|
|
17
|
+
|
|
18
|
+
Nonempty dynamic Labels with a positive finite `stroke` reserve
|
|
19
|
+
`ceil(2 * stroke) + 2` logical pixels on each side. This conservative allowance
|
|
20
|
+
contains the stroke and antialiasing inside the Label's external layout box.
|
|
21
|
+
The TextField is inset by that fixed amount; it does not change with a typewriter
|
|
22
|
+
prefix or fitting candidate. Scroller clips remain exact, with no new setting.
|
|
23
|
+
|
|
24
|
+
Automatic width includes both insets. Automatic height contains nominal rows
|
|
25
|
+
(including blank rows and line spacing), the complete glyph block if taller,
|
|
26
|
+
and both insets. Fixed/parent/max dimensions remain the outer box; line generation
|
|
27
|
+
and fitting use its inner area. Minimum-size overflow still reports failure
|
|
28
|
+
and permits clipping; a box too small for its inset does not become automatic.
|
|
29
|
+
Fitting toggles at unchanged drawing size retain identical geometry and pixels.
|
|
30
|
+
Unoutlined or empty Labels add no inset; empty-row measurements stay native.
|
|
31
|
+
EditableText, RichLabel and BitmapLabel do not adopt this layout change.
|
|
32
|
+
|
|
33
|
+
Keep explicit `verticalAlign="top"` for progressively typed dialogue. The origin
|
|
34
|
+
stays fixed after clearing/retyping; middle alignment intentionally follows its
|
|
35
|
+
changing glyph block and is not appropriate for that effect. Font readiness still
|
|
36
|
+
uses `invalidateSize()`. Outline/state changes invalidate the normal UI layout.
|
|
37
|
+
|
|
38
|
+
UI 3.6.0 is prepared for publication. Outlined Labels can measure larger
|
|
39
|
+
and wrap earlier than 3.5.0 even without `textFit`. No authored
|
|
40
|
+
properties or XML/resource formats change. Its manifest requires Core
|
|
41
|
+
^2.5.2 for public line ink metrics and unified vertical block alignment; development
|
|
42
|
+
installs published 2.5.3. Core itself needs no new release. After publication,
|
|
43
|
+
consumers must adopt UI 3.6.0, use an accepted Core installation and rebuild; compatible
|
|
44
|
+
CLI/document/runtime contracts need no new SDK release. Existing application
|
|
45
|
+
installations remain on their registry versions until explicitly updated.
|
|
46
|
+
|
|
15
47
|
## Lines and bounds
|
|
16
48
|
|
|
17
49
|
- `Label.multiline` defaults to `true`. Text wraps at a finite available width;
|
|
@@ -54,7 +86,8 @@ Published Core 2.5.2 makes dynamic top/middle/bottom use the same
|
|
|
54
86
|
complete glyph-block boundaries in single-line and multiline modes. Blank rows
|
|
55
87
|
retain their height. `multiline` controls only line generation. Input uses stable
|
|
56
88
|
editing-row boundaries in all three modes; its caret and selection remain stable.
|
|
57
|
-
|
|
89
|
+
Core measurements stay nominal; UI 3.6.0 reserves outline-safe
|
|
90
|
+
layout space separately. Older Core installations retain their
|
|
58
91
|
recorded text behavior; adopt the Core installation/lock and rebuild.
|
|
59
92
|
UI 3.4.0's peer accepts 2.5.2; this correction needs no UI release.
|
|
60
93
|
See [Core text layout](../../core/docs/text-layout.md#unified-vertical-alignment-core-252).
|
|
@@ -84,12 +117,12 @@ height clipping. If the base size fits across several rows it is retained.
|
|
|
84
117
|
Otherwise fitting searches smaller sizes, recalculating the row breaks each time.
|
|
85
118
|
No maximum row count is implied by a fixed height, and no `maxLines` is added.
|
|
86
119
|
|
|
87
|
-
| Available bounds
|
|
88
|
-
|
|
|
89
|
-
| Both automatic
|
|
120
|
+
| Available bounds | Multiline shrink behavior |
|
|
121
|
+
| ----------------------------------- | ------------------------------------------------------------------------------------------- |
|
|
122
|
+
| Both automatic | Retain base size; soft wrapping has no width constraint. |
|
|
90
123
|
| Width constrained, height automatic | Wrap and measure automatic height; shrink only if a protected sequence still exceeds width. |
|
|
91
|
-
| Width automatic, height constrained | Measure hard-separated rows without soft wrapping, then fit their complete height.
|
|
92
|
-
| Both constrained
|
|
124
|
+
| Width automatic, height constrained | Measure hard-separated rows without soft wrapping, then fit their complete height. |
|
|
125
|
+
| Both constrained | Wrap and shrink as needed to fit complete width and height. |
|
|
93
126
|
|
|
94
127
|
- `size` is always the authored/base size. `renderedSize` is the derived drawing
|
|
95
128
|
size after layout validation. State overrides capture and restore `size`.
|
|
@@ -97,16 +130,12 @@ No maximum row count is implied by a fixed height, and no `maxLines` is added.
|
|
|
97
130
|
larger region restores the base size; text never grows beyond it.
|
|
98
131
|
- `minFontSize` defaults to 12 logical pixels, must be finite and at least 1,
|
|
99
132
|
and acts as a lower bound. A minimum above `size` never enlarges the text.
|
|
100
|
-
- Measurement uses
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
width reserves outline space once, even when the measured Label is narrower.
|
|
107
|
-
Toggling fitting leaves unchanged text at unchanged size in its original
|
|
108
|
-
position. Core's nominal measurement, clipping and outline rendering rules
|
|
109
|
-
remain in effect.
|
|
133
|
+
- Measurement uses displayed text, font family, bold/italic settings and the
|
|
134
|
+
outline-safe layout bounds described above. Search, automatic measurement and
|
|
135
|
+
drawing reserve the same inset once. Both alignments operate inside that area;
|
|
136
|
+
symmetric insets preserve the horizontal center. Automatic measurements are
|
|
137
|
+
never recycled as fitting constraints. The published 3.5.0 baseline reserved
|
|
138
|
+
only twice the stroke in fit checks and kept automatic dimensions nominal.
|
|
110
139
|
- Available bounds come from fixed dimensions, parent layout constraints or
|
|
111
140
|
explicit maximum dimensions. Icon spacing belongs to the skin's Label
|
|
112
141
|
region. Automatic measured dimensions are not fed back as fit constraints.
|
|
@@ -133,12 +162,13 @@ Finite zero content width reports overflow for nonempty displayed text; it is
|
|
|
133
162
|
not mistaken for empty content by Core's zero-width measurement. Empty displayed
|
|
134
163
|
content retains its base size without overflow.
|
|
135
164
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
165
|
+
The 3.5.0 multiline extension required no Core or KUI-format change. The separate
|
|
166
|
+
3.6.0 outline correction raises UI's Core minimum to ^2.5.2. CLI/runtime already
|
|
167
|
+
pass the fields through; runtime 0.10.0's ^3.4.0 peer accepts UI 3.6.0, provided
|
|
168
|
+
its host also satisfies UI's Core peer. Applications adopt the UI installation/lock
|
|
169
|
+
and rebuild explicitly after publication. Editor currently pins registry UI 3.5.0;
|
|
170
|
+
Tentax and MilfMaster accept 3.6.0 through ^3.5.0 but retain their existing locks.
|
|
171
|
+
Preview and compiled games use the native Label behavior once their host adopts it.
|
|
142
172
|
|
|
143
173
|
Load fonts before constructing or measuring text where possible. If a font
|
|
144
174
|
becomes ready later, call `label.invalidateSize()` before the next validation;
|
|
@@ -174,3 +204,10 @@ WebGL 1 and WebGL 2 at 1x/2x, using independent Canvas width measurements.
|
|
|
174
204
|
Pixel comparisons verify unchanged painting across fitting toggles for all nine
|
|
175
205
|
horizontal/vertical alignments and automatic dimensions; icon-and-caption row
|
|
176
206
|
tests retain parent geometry.
|
|
207
|
+
|
|
208
|
+
UI 3.6.0 adds exact clipped/unclipped pixel comparisons in real
|
|
209
|
+
Scroller viewports, across all nine alignments, italic text, thick outlines,
|
|
210
|
+
automatic/fixed/maximum/fitted bounds, and Japanese scroll tails. Minified Canvas,
|
|
211
|
+
WebGL 1 and WebGL 2 tests use physical 1x/2x targets. Unit tests additionally
|
|
212
|
+
cover glyphs taller than nominal rows, state outline restoration, late fonts,
|
|
213
|
+
empty text, EditableText isolation and repeated top-aligned typewriter prefixes.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kurot/ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "EUI-compatible UI component framework for the Kurot game engine — skin-based components, layouts, data binding, view states",
|
|
5
5
|
"author": "Kelvin <kyia.x52@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"test:text-labels": "playwright test test/browser --workers=1"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@kurot/core": "^2.
|
|
37
|
+
"@kurot/core": "^2.5.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@kurot/core": "^2.
|
|
40
|
+
"@kurot/core": "^2.5.2",
|
|
41
41
|
"@playwright/test": "1.62.1",
|
|
42
42
|
"@types/node": "^22.0.0",
|
|
43
43
|
"esbuild": "^0.28.2",
|