@kurot/ui 3.3.0 → 3.5.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 +90 -0
- package/README.md +98 -13
- package/dist/kurot/components/ComboBox.d.ts.map +1 -1
- package/dist/kurot/components/ComboBox.js +5 -3
- package/dist/kurot/components/ComboBox.js.map +1 -1
- package/dist/kurot/components/Component.d.ts +1 -0
- package/dist/kurot/components/Component.d.ts.map +1 -1
- package/dist/kurot/components/Component.js +3 -0
- package/dist/kurot/components/Component.js.map +1 -1
- package/dist/kurot/components/Group.d.ts +1 -0
- package/dist/kurot/components/Group.d.ts.map +1 -1
- package/dist/kurot/components/Group.js +3 -0
- package/dist/kurot/components/Group.js.map +1 -1
- package/dist/kurot/components/Label.d.ts +8 -3
- package/dist/kurot/components/Label.d.ts.map +1 -1
- package/dist/kurot/components/Label.js +47 -6
- package/dist/kurot/components/Label.js.map +1 -1
- package/dist/kurot/core/UIState.d.ts +4 -0
- package/dist/kurot/core/UIState.d.ts.map +1 -1
- package/dist/kurot/core/UIState.js +15 -7
- package/dist/kurot/core/UIState.js.map +1 -1
- package/dist/kurot/core/fit-transformed-bounds.d.ts +14 -0
- package/dist/kurot/core/fit-transformed-bounds.d.ts.map +1 -0
- package/dist/kurot/core/fit-transformed-bounds.js +149 -0
- package/dist/kurot/core/fit-transformed-bounds.js.map +1 -0
- package/dist/kurot/text/fit-label-text.d.ts +4 -1
- package/dist/kurot/text/fit-label-text.d.ts.map +1 -1
- package/dist/kurot/text/fit-label-text.js +24 -8
- package/dist/kurot/text/fit-label-text.js.map +1 -1
- package/docs/ai-context.md +56 -11
- package/docs/architecture.md +20 -2
- package/docs/bitmap-label.md +15 -4
- package/docs/label-text-layout.md +87 -10
- package/docs/rich-label.md +15 -5
- package/package.json +3 -3
package/docs/ai-context.md
CHANGED
|
@@ -1,15 +1,30 @@
|
|
|
1
1
|
# @kurot/ui — AI context map
|
|
2
2
|
|
|
3
|
+
UI 3.5.0 is prepared for publication, not yet published. It adds multiline
|
|
4
|
+
Label fitting and stable alignment when fitting is toggled. UI 3.4.0 is the
|
|
5
|
+
previous verified published release (2026-10-09). Development still installs
|
|
6
|
+
published Core 2.4.0 with a matching registry lockfile, without local overrides. Read
|
|
7
|
+
[centered flips](../../../docs/centered-flips.md) before changing transforms,
|
|
8
|
+
reflection frames, authored flags or dependency adoption.
|
|
9
|
+
|
|
10
|
+
Label/RichLabel/EditableText inherit TextField's vertical alignment;
|
|
11
|
+
BitmapLabel inherits BitmapText's. Published Core 2.5.3 defaults both to middle;
|
|
12
|
+
published Core 2.5.2 and earlier default to top. Explicit values remain effective
|
|
13
|
+
and multiline only controls line generation. UI has no default override and needs
|
|
14
|
+
no new release/peer minimum; its installed development Core remains 2.4.0.
|
|
15
|
+
Published document 0.13.1 supplies matching authoring defaults.
|
|
16
|
+
|
|
3
17
|
Read this before exploring `src/`. It is a compressed map so an agent
|
|
4
18
|
unfamiliar with Kurot does not need to re-derive the architecture from scratch
|
|
5
19
|
each session. Treat the package source and its `src/index.ts` barrel as the
|
|
6
20
|
authority for current behavior and exports; this file provides the compressed
|
|
7
21
|
map, runtime contracts and task→file lookup.
|
|
8
22
|
|
|
9
|
-
Package identity: `@kurot/ui@3.
|
|
10
|
-
`@kurot/core`. Peer-depends on `@kurot/core@^2.
|
|
23
|
+
Package identity: `@kurot/ui@3.5.0`, EUI-compatible UI framework on top of
|
|
24
|
+
`@kurot/core`. Peer-depends on `@kurot/core@^2.4.0`. Rewritten with standard class
|
|
11
25
|
inheritance and delegation — no namespace mixins, no prototype copying.
|
|
12
|
-
Version 3.3.
|
|
26
|
+
Version 3.3.1 is preserved in commit 60e6404 and fixes transformed parent
|
|
27
|
+
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
|
|
13
28
|
development installation and lockfile, without overrides. Version 3.2.0 is published with BitmapLabel against published Core 2.2.0,
|
|
14
29
|
without local dependency overrides. Published UI 3.1.0 does not contain BitmapLabel.
|
|
15
30
|
|
|
@@ -49,6 +64,12 @@ src/kurot/
|
|
|
49
64
|
|
|
50
65
|
## 2. Non-obvious current behavior
|
|
51
66
|
|
|
67
|
+
- `flipX`/`flipY` are native Core booleans inherited by every UI display
|
|
68
|
+
component. Group and Component provide their validated, unscaled actual frame
|
|
69
|
+
through `$getFlipBounds()`. `UIState.getActualBounds()` reads this frame without
|
|
70
|
+
validating recursively. Layout uses the authored matrix, independent of flips;
|
|
71
|
+
negative scale remains anchor-based. Resizing moves the reflection center.
|
|
72
|
+
|
|
52
73
|
- **`Skin` is NOT a `Group`/DisplayObject subclass.** `components/Skin.ts`
|
|
53
74
|
defines `class Skin extends EventDispatcher<SkinEvents>` — a plain data
|
|
54
75
|
holder, not a visual container. A skin's
|
|
@@ -94,6 +115,13 @@ skin)` signature, but `Group._commitCurrentState()` passes `this` cast
|
|
|
94
115
|
- Anchor/percent constraints (`left`/`right`/`percentWidth`, etc.) have zero
|
|
95
116
|
effect until the component is added to a `Group` that has a `layout`
|
|
96
117
|
assigned. Setting them on a standalone/unparented component is a no-op.
|
|
118
|
+
- **Since 3.3.1: transformed allocations use parent-space dimensions.**
|
|
119
|
+
`core/fit-transformed-bounds.ts` converts them to local sizes for negative scale,
|
|
120
|
+
rotation and skew. UIState tracks the allocated local axes so width/height
|
|
121
|
+
reads do not discard a rotated one-axis allocation. Anchor/translation affect
|
|
122
|
+
positioning, not size. Incompatible aspect ratios fit the largest contained
|
|
123
|
+
local rectangle; local minima win when containment is impossible. The published
|
|
124
|
+
UI 3.3.0 still falls back to preferred dimensions for non-identity transforms.
|
|
97
125
|
- `isUIComponent()` is duck-typed (`'ui' in obj`) — any object with a `.ui`
|
|
98
126
|
property passes, not necessarily a real `Group`/`Component`.
|
|
99
127
|
- **Virtual layout defaults to OFF.**
|
|
@@ -191,29 +219,45 @@ before patching core's transform code.
|
|
|
191
219
|
| Understand validation/render scheduling order | `core/Validator.ts`, core `player/SystemTicker.ts` |
|
|
192
220
|
| Measure UI validation/rendering performance | `examples/benchmark/` for the visual runner, scenarios, Playwright automation, and local JSON/Markdown reports |
|
|
193
221
|
|
|
194
|
-
## Label text layout contract in 3.
|
|
222
|
+
## Label text layout contract in 3.5.0
|
|
195
223
|
|
|
196
224
|
Label defaults to multiline; explicit false draws only the first hard-separated
|
|
197
225
|
line without wrapping. EditableText defaults to single-line and rejects
|
|
198
226
|
shrinking. `wordWrap` chooses Unicode versus character boundaries only while
|
|
199
227
|
multiline is enabled.
|
|
200
228
|
|
|
201
|
-
`TextFitMode` is exported with Label. `textFit` is `none` by default or `shrink
|
|
202
|
-
|
|
229
|
+
`TextFitMode` is exported with Label. `textFit` is `none` by default or `shrink`.
|
|
230
|
+
UI 3.5.0 fits both line modes using complete Core measurement at each candidate
|
|
231
|
+
size; UI 3.1.0–3.4.0 fit only single-line Labels.
|
|
232
|
+
`multiline` stays authored and automatic axes stay unconstrained. Outline
|
|
233
|
+
allowance affects fit checks and shared wrapping width, not the original alignment
|
|
234
|
+
frame or nominal automatic dimensions. `minFontSize` defaults to
|
|
235
|
+
12 and must be finite and >= 1.
|
|
203
236
|
`size` stays authored; `renderedSize` and `textFitOverflow` are read-only results
|
|
204
237
|
after validation. Fitting uses fixed axes, parent layout constraints or explicit
|
|
205
|
-
maximums, reserves outline thickness and caches unchanged metrics
|
|
238
|
+
maximums, reserves outline thickness and caches unchanged metrics, including
|
|
239
|
+
multiline/wordWrap/lineSpacing. Measured
|
|
206
240
|
automatic bounds are not fed back as fit constraints.
|
|
207
241
|
|
|
208
242
|
`label.invalidateSize()` also invalidates Core line metrics. Call it after
|
|
209
243
|
late font loading, even if the family name did not change. This requires
|
|
210
|
-
Core >= 2.1.0 for that API; UI 3.
|
|
244
|
+
Core >= 2.1.0 for that API; current UI 3.5.0 requires Core ^2.4.0 for its
|
|
245
|
+
centered-flip frame hook.
|
|
246
|
+
|
|
247
|
+
Width/height setters refresh automatic text dimensions. Font readiness also
|
|
248
|
+
invalidates fitting in fixed-size boxes. Fitting toggles preserve unchanged text
|
|
249
|
+
positions, all nine alignments and nominal automatic dimensions.
|
|
211
250
|
There is no global font-readiness listener.
|
|
212
251
|
|
|
252
|
+
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.5.0
|
|
254
|
+
through its existing ^3.4.0 peer. CLI/document APIs are unchanged. Consumers
|
|
255
|
+
update their own UI installations/locks and rebuild; no other SDK bump is needed.
|
|
256
|
+
|
|
213
257
|
See [Label text layout](label-text-layout.md) for fit bounds, state restoration,
|
|
214
258
|
font readiness and shared-schema boundaries. Native UI still depends only on
|
|
215
|
-
Core; KUI authoring uses
|
|
216
|
-
|
|
259
|
+
Core; current KUI authoring uses document 0.13.1, CLI 3.6.0 and runtime 0.10.0.
|
|
260
|
+
Label presets expand in consumer-owned
|
|
217
261
|
copies before native rendering; UI does not read style.json or consume textStyle.
|
|
218
262
|
|
|
219
263
|
## Bitmap labels in 3.2.0
|
|
@@ -237,4 +281,5 @@ wordWrap, lineSpacing, textAlign and verticalAlign remain component-level.
|
|
|
237
281
|
Task → `components/RichLabel.ts`, `test/RichLabel.test.ts`,
|
|
238
282
|
`test/browser/text-labels.spec.ts`. Run `pnpm test:text-labels` after building
|
|
239
283
|
Core and UI. BitmapLabel automatic measurement now uses maxWidth too. The KUI
|
|
240
|
-
catalog
|
|
284
|
+
catalog is available in published ui-document 0.12.0+, CLI 3.4.0+ and
|
|
285
|
+
ui-runtime 0.9.0+. Editor adoption remains an explicit application update.
|
package/docs/architecture.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# @kurot/ui architecture
|
|
2
2
|
|
|
3
|
-
> Package version: 3.
|
|
4
|
-
> Core 2.
|
|
3
|
+
> Package version: 3.5.0 (prepared, not yet published), with peerDependency `@kurot/core: ^2.4.0`.
|
|
4
|
+
> Development installs published Core 2.4.0 with a matching registry lockfile.
|
|
5
|
+
> No local Core override is needed for builds or centered-flip checks.
|
|
5
6
|
> See [CHANGELOG.md](../CHANGELOG.md) for release-by-release changes.
|
|
6
7
|
> The [AI context map](./ai-context.md) provides directory, behavior, terminology
|
|
7
8
|
> and task-to-file references. This document explains design decisions and internal
|
|
@@ -306,6 +307,23 @@ A trailing percent sign selects percentage calculation; otherwise the value is
|
|
|
306
307
|
converted to a number. There is no separate runtime type tag for percentages
|
|
307
308
|
versus pixels.
|
|
308
309
|
|
|
310
|
+
The 3.3.1 transform-allocation correction uses
|
|
311
|
+
`core/fit-transformed-bounds.ts` from UIState. Allocated dimensions describe the
|
|
312
|
+
parent-space rectangle, while explicit, preferred and minimum/maximum sizes stay
|
|
313
|
+
local. The solver uses the absolute linear matrix coefficients to obtain that
|
|
314
|
+
rectangle's width and height. Anchors and translation affect only its position.
|
|
315
|
+
It fills both requested axes when possible, otherwise chooses the largest local
|
|
316
|
+
rectangle contained by the allocation. Local minimum sizes take precedence if
|
|
317
|
+
no contained rectangle can satisfy them. With one allocated axis, an authored
|
|
318
|
+
single local dimension is retained when possible; the unconstrained parent extent
|
|
319
|
+
is minimized otherwise. Unallocated transforms preserve local measurement.
|
|
320
|
+
|
|
321
|
+
UIState also maps the allocation flags to the affected local axes. A quarter-turn
|
|
322
|
+
width allocation controls local height, so reading height must retain the fitted
|
|
323
|
+
value rather than restoring the authored height. A zero scale column keeps its
|
|
324
|
+
natural local dimension without division by zero. Group and Component share
|
|
325
|
+
this behavior, including Image, text, buttons and other component subclasses.
|
|
326
|
+
|
|
309
327
|
LinearLayoutBase.flexChildrenProportionally(), shared by VerticalLayout and
|
|
310
328
|
HorizontalLayout, iteratively allocates percentages with min/max constraints.
|
|
311
329
|
A do...while loop identifies children whose proportional allocation exceeds a
|
package/docs/bitmap-label.md
CHANGED
|
@@ -11,6 +11,9 @@ width nor an explicit width is present, so wrapped height matches rendering.
|
|
|
11
11
|
Changing an authored width also invalidates automatic height after layout.
|
|
12
12
|
UI 3.3.0 builds and tests against published Core 2.3.1 without local overrides.
|
|
13
13
|
|
|
14
|
+
Current UI 3.5.0 retains BitmapLabel and requires Core ^2.4.0 for centered flips.
|
|
15
|
+
Its development installation and lock use published Core 2.4.0.
|
|
16
|
+
|
|
14
17
|
```ts
|
|
15
18
|
import { BitmapLabel } from '@kurot/ui';
|
|
16
19
|
|
|
@@ -41,7 +44,15 @@ DisplayObject tint. Alignments position glyphs without scaling them. Set scaleX
|
|
|
41
44
|
and scaleY for decorative number sizing. Default multiline=true; explicit false
|
|
42
45
|
keeps the first hard-separated line unwrapped.
|
|
43
46
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
Vertical alignment inherits BitmapText's default: middle with published Core 2.5.3,
|
|
48
|
+
top with published 2.5.2 and earlier. Explicit top/bottom remain effective in either
|
|
49
|
+
line mode. Bitmap-font metrics and glyph offsets are unchanged. UI 3.4.0 accepts
|
|
50
|
+
the patch without another UI release; applications update their Core installation/
|
|
51
|
+
lock and rebuild. Published document 0.13.1 supplies the matching
|
|
52
|
+
catalog default.
|
|
53
|
+
|
|
54
|
+
Authoring support was introduced in document 0.12.0, CLI 3.4.0 and runtime 0.9.0.
|
|
55
|
+
Current document 0.13.1, CLI 3.6.0 and runtime 0.10.0 retain BitmapLabel
|
|
56
|
+
authoring, KUI compilation and materialization. Earlier compilers do not accept
|
|
57
|
+
this built-in XML tag; update applications explicitly when adopting it. Editor
|
|
58
|
+
controls are owned by the separate application.
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# Label text layout and fitting
|
|
2
2
|
|
|
3
|
-
Introduced in UI 3.1.0 with Core >= 2.1.0,
|
|
4
|
-
|
|
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
|
+
UI 3.5.0 extends it to multiline Labels using Core's existing independent
|
|
5
|
+
measurement API. Version 3.5.0 is prepared, not yet published. Its peer remains
|
|
6
|
+
Core ^2.4.0 for centered flips. The public
|
|
5
7
|
`TextFitMode` type is `none | shrink`. Native UI depends only on Core. KUI
|
|
6
8
|
authoring introduced fitting metadata in ui-document 0.9.0 and retains it in
|
|
7
|
-
0.
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
0.13.1. Current CLI 3.6.0 and runtime 0.10.0 use document `^0.13.0`; runtime
|
|
10
|
+
also requires UI `^3.4.0` and Core `^2.4.0`. Older 0.x kernel ranges do not
|
|
11
|
+
automatically accept 0.13.0. Label presets expand into native properties before
|
|
10
12
|
rendering; their precedence does not change fitting behavior. See the
|
|
11
13
|
[project style contract](../../ui-document/docs/project-styles.md).
|
|
12
14
|
|
|
@@ -33,6 +35,30 @@ Explicit `multiline="false"` in older skins now means a real single line.
|
|
|
33
35
|
Remove it or set it to `true` for text intended to wrap. No files are migrated
|
|
34
36
|
automatically; omitted Label flags continue to allow wrapping.
|
|
35
37
|
|
|
38
|
+
## Vertical alignment and skin defaults
|
|
39
|
+
|
|
40
|
+
Label, RichLabel and EditableText inherit TextField's default; BitmapLabel
|
|
41
|
+
inherits BitmapText's. With published Core 2.5.3 they default to
|
|
42
|
+
`verticalAlign="middle"`. Published Core 2.5.2 and earlier default to top. Button
|
|
43
|
+
skins in the native KUI kit already set middle explicitly. Button does not
|
|
44
|
+
overwrite an authored top/bottom or a skin state. Use explicit top for content
|
|
45
|
+
intended to start at the top of a taller box. `verticalCenter` positions the
|
|
46
|
+
Label box in its parent; it does not align text inside the Label.
|
|
47
|
+
|
|
48
|
+
Published document 0.13.1 reports the new middle default without writing omitted
|
|
49
|
+
properties into XML. Adopting editors need matching Core/catalog installations;
|
|
50
|
+
UI 3.4.0 itself requires no release or higher peer minimum. Existing applications
|
|
51
|
+
retain their installed behavior until they update their locks and rebuild.
|
|
52
|
+
|
|
53
|
+
Published Core 2.5.2 makes dynamic top/middle/bottom use the same
|
|
54
|
+
complete glyph-block boundaries in single-line and multiline modes. Blank rows
|
|
55
|
+
retain their height. `multiline` controls only line generation. Input uses stable
|
|
56
|
+
editing-row boundaries in all three modes; its caret and selection remain stable.
|
|
57
|
+
Measurements and fitting stay nominal. Older Core installations retain their
|
|
58
|
+
recorded text behavior; adopt the Core installation/lock and rebuild.
|
|
59
|
+
UI 3.4.0's peer accepts 2.5.2; this correction needs no UI release.
|
|
60
|
+
See [Core text layout](../../core/docs/text-layout.md#unified-vertical-alignment-core-252).
|
|
61
|
+
|
|
36
62
|
## Shrink to fit
|
|
37
63
|
|
|
38
64
|
```xml
|
|
@@ -41,10 +67,30 @@ automatically; omitted Label flags continue to allow wrapping.
|
|
|
41
67
|
```
|
|
42
68
|
|
|
43
69
|
`textFit` accepts `none` (default) and `shrink`. Shrinking applies to ordinary
|
|
44
|
-
|
|
45
|
-
|
|
70
|
+
Labels in either line mode. `multiline` always chooses line generation; fitting
|
|
71
|
+
never changes it based on height or the selected size. EditableText rejects
|
|
72
|
+
`shrink`, including through the shared authoring schema. Put the policy
|
|
46
73
|
on a Button's `labelDisplay` skin part rather than on the Button itself.
|
|
47
74
|
|
|
75
|
+
```xml
|
|
76
|
+
<Label text="Доказуемая честность" width="120" height="44" size="20"
|
|
77
|
+
wordWrap="true" lineSpacing="2" textFit="shrink" minFontSize="14" />
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
This uses the default multiline mode. At each candidate size, Core lays out
|
|
81
|
+
the complete displayed text under the effective content width. Measurement
|
|
82
|
+
includes hard breaks, blank/trailing rows and line spacing, independently of
|
|
83
|
+
height clipping. If the base size fits across several rows it is retained.
|
|
84
|
+
Otherwise fitting searches smaller sizes, recalculating the row breaks each time.
|
|
85
|
+
No maximum row count is implied by a fixed height, and no `maxLines` is added.
|
|
86
|
+
|
|
87
|
+
| Available bounds | Multiline shrink behavior |
|
|
88
|
+
| --- | --- |
|
|
89
|
+
| Both automatic | Retain base size; soft wrapping has no width constraint. |
|
|
90
|
+
| 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 | Wrap and shrink as needed to fit complete width and height. |
|
|
93
|
+
|
|
48
94
|
- `size` is always the authored/base size. `renderedSize` is the derived drawing
|
|
49
95
|
size after layout validation. State overrides capture and restore `size`.
|
|
50
96
|
- Fit starts from that base size on every metric change. Shorter text or a
|
|
@@ -52,13 +98,21 @@ on a Button's `labelDisplay` skin part rather than on the Button itself.
|
|
|
52
98
|
- `minFontSize` defaults to 12 logical pixels, must be finite and at least 1,
|
|
53
99
|
and acts as a lower bound. A minimum above `size` never enlarges the text.
|
|
54
100
|
- Measurement uses the displayed text, font family, bold and italic settings,
|
|
55
|
-
and reserves twice the outline thickness on each constrained axis.
|
|
56
|
-
|
|
101
|
+
and reserves twice the outline thickness on each constrained axis. Search,
|
|
102
|
+
measurement and drawing use the same reserved wrapping width. Horizontal
|
|
103
|
+
alignment retains the original Label's left edge, center or right edge;
|
|
104
|
+
vertical alignment retains the full original height. Fitting adds no implicit
|
|
105
|
+
padding or outline inflation to automatic measured dimensions. A maximum
|
|
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.
|
|
57
110
|
- Available bounds come from fixed dimensions, parent layout constraints or
|
|
58
111
|
explicit maximum dimensions. Icon spacing belongs to the skin's Label
|
|
59
112
|
region. Automatic measured dimensions are not fed back as fit constraints.
|
|
60
113
|
- A finite zero-sized region is constrained. An automatic axis is unconstrained.
|
|
61
|
-
- Search performs at most 16 metric comparisons after the endpoint checks
|
|
114
|
+
- Search performs at most 16 metric comparisons after the endpoint checks,
|
|
115
|
+
followed by verification of the rounded result.
|
|
62
116
|
Intermediate results are rounded down to tenths of a logical pixel while
|
|
63
117
|
retaining the minimum. Base sizes and minimums may be fractional.
|
|
64
118
|
- If text still cannot fit at the minimum, `textFitOverflow` is true after
|
|
@@ -72,6 +126,20 @@ These two read-only results are runtime observations, not authored KUI fields.
|
|
|
72
126
|
CLI emits the policy and base size; ui-runtime uses the same native Label. Neither
|
|
73
127
|
writes the derived size into XML, styles, semantic documents or history.
|
|
74
128
|
|
|
129
|
+
Existing multiline Labels with an authored `shrink` policy begin fitting when
|
|
130
|
+
they adopt UI 3.5.0; the published 3.4.0 runtime ignored that
|
|
131
|
+
combination. Single-line hard-separator/password semantics remain effective.
|
|
132
|
+
Finite zero content width reports overflow for nonempty displayed text; it is
|
|
133
|
+
not mistaken for empty content by Core's zero-width measurement. Empty displayed
|
|
134
|
+
content retains its base size without overflow.
|
|
135
|
+
|
|
136
|
+
Core, KUI format and dependency minima require no change. CLI/runtime already
|
|
137
|
+
pass the fields through; runtime 0.10.0's ^3.4.0 peer accepts UI 3.5.0.
|
|
138
|
+
Applications adopt the UI installation/lock and rebuild explicitly. Editor
|
|
139
|
+
0.28.1's local trial removes the old single-line Inspector restriction and binds
|
|
140
|
+
built UI. Its exact registry 3.4.0 dependency must adopt 3.5.0 after publication
|
|
141
|
+
for ordinary builds. Preview and compiled games use the native Label behavior.
|
|
142
|
+
|
|
75
143
|
Load fonts before constructing or measuring text where possible. If a font
|
|
76
144
|
becomes ready later, call `label.invalidateSize()` before the next validation;
|
|
77
145
|
this clears both fitting and Core line metrics even when the family name stays
|
|
@@ -97,3 +165,12 @@ single-line fitting, Unicode wrapping without leading separator spaces, outline
|
|
|
97
165
|
allowance, minimum overflow, native Button state restoration and invalidation
|
|
98
166
|
after a font finishes loading. Fitted sizes are platform-dependent; these checks
|
|
99
167
|
assert the layout contract rather than a universal numeric result.
|
|
168
|
+
|
|
169
|
+
Multiline tests cover complete-height fitting, blank/trailing rows, line spacing,
|
|
170
|
+
Unicode and grapheme boundaries, password text, minimum/zero-width overflow,
|
|
171
|
+
outline allowance, automatic axes, font readiness and parent resize recovery.
|
|
172
|
+
Minified browser tests validate native Russian/Chinese layouts in Canvas,
|
|
173
|
+
WebGL 1 and WebGL 2 at 1x/2x, using independent Canvas width measurements.
|
|
174
|
+
Pixel comparisons verify unchanged painting across fitting toggles for all nine
|
|
175
|
+
horizontal/vertical alignments and automatic dimensions; icon-and-caption row
|
|
176
|
+
tests retain parent geometry.
|
package/docs/rich-label.md
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
Native API introduced in UI 3.3.0, requiring Core ^2.3.0. Core 2.3.1 is
|
|
4
4
|
published and installed from npm for this release's build and verification.
|
|
5
5
|
|
|
6
|
+
Current UI 3.5.0 retains RichLabel and requires Core ^2.4.0 for centered flips.
|
|
7
|
+
Its development installation and lock use published Core 2.4.0.
|
|
8
|
+
|
|
6
9
|
```ts
|
|
7
10
|
import { RichLabel } from '@kurot/ui';
|
|
8
11
|
|
|
@@ -43,9 +46,15 @@ available, together with these text-layout properties:
|
|
|
43
46
|
| wordWrap | true | Unicode line-break opportunities; false wraps between graphemes. |
|
|
44
47
|
| lineSpacing | 0 | Finite, nonnegative distance between lines. |
|
|
45
48
|
| textAlign | left | left, center or right. |
|
|
46
|
-
| verticalAlign |
|
|
49
|
+
| verticalAlign | Host Core | top, middle or bottom. |
|
|
47
50
|
| textWidth / textHeight | Read-only | Complete content metrics under the current width, before height clipping. |
|
|
48
51
|
|
|
52
|
+
Vertical alignment inherits TextField's default: middle with published Core 2.5.3,
|
|
53
|
+
top with published 2.5.2 and earlier. Explicit values remain effective in either
|
|
54
|
+
line mode. UI 3.4.0 accepts the Core patch without another UI release; adopt the
|
|
55
|
+
application installation/lock and rebuild. Published document
|
|
56
|
+
0.13.1 supplies the matching catalog default.
|
|
57
|
+
|
|
49
58
|
Measurement uses parent-assigned width first, then explicit width, then a
|
|
50
59
|
configured maxWidth, otherwise unconstrained width. Automatic height includes
|
|
51
60
|
every wrapped line and inter-line spacing. Each line uses the largest font size
|
|
@@ -67,10 +76,11 @@ call `label.invalidateSize()` to clear both component and native text metrics,
|
|
|
67
76
|
then allow normal layout validation. RichLabel does not load font files or
|
|
68
77
|
install global font-loading listeners.
|
|
69
78
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
79
|
+
Authoring support was introduced in document 0.12.0, CLI 3.4.0 and runtime 0.9.0.
|
|
80
|
+
Current document 0.13.1, CLI 3.6.0 and runtime 0.10.0 retain RichLabel
|
|
81
|
+
authoring, KUI compilation and materialization. Earlier versions lack these
|
|
82
|
+
built-in registrations. Editor controls are owned by the separate application;
|
|
83
|
+
all consumers retain textFlow ownership and separation from Label presets.
|
|
74
84
|
|
|
75
85
|
See [Core text layout](../../core/docs/text-layout.md) for Unicode wrapping,
|
|
76
86
|
single-line behavior and independent measurement. Run `pnpm test:text-labels`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kurot/ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.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.4.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@kurot/core": "^2.
|
|
40
|
+
"@kurot/core": "^2.4.0",
|
|
41
41
|
"@playwright/test": "1.62.1",
|
|
42
42
|
"@types/node": "^22.0.0",
|
|
43
43
|
"esbuild": "^0.28.2",
|