@kurot/ui 3.4.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 CHANGED
@@ -4,9 +4,58 @@ All notable changes to `@kurot/ui` are documented here.
4
4
 
5
5
  ---
6
6
 
7
+ ## [3.5.0] — 2026-10-10
8
+
9
+ Prepared for publication; not yet published. Requires Core ^2.4.0, unchanged
10
+ from 3.4.0. See [Label fitting](docs/label-text-layout.md).
11
+
12
+ ### Added
13
+
14
+ - Extend ordinary Label `textFit="shrink"` to complete multiline layouts,
15
+ including wrapping, hard breaks, blank/trailing rows and line spacing.
16
+ Recalculate wrapping at each candidate size while retaining the authored
17
+ `multiline`, text and base size. No row limit or new authored property is added.
18
+
19
+ ### Fixed
20
+
21
+ - Retain the original Label alignment frame and nominal automatic dimensions
22
+ while reserving outline allowance in fit checks and the shared wrapping width.
23
+ Toggling fitting does not move unchanged text or its icon-and-caption row.
24
+ - Refresh automatic dimensions after authored width/height changes and refit
25
+ fixed-size Labels after font readiness invalidation.
26
+ - Preserve unconstrained automatic axes, avoid repeatedly deducting outline
27
+ space under maximum widths, and report minimum or zero-content-width overflow
28
+ without confusing nonempty text with empty content.
29
+
30
+ ### Compatibility and adoption
31
+
32
+ Existing multiline Labels with `textFit="shrink"` begin fitting instead of
33
+ ignoring that policy. Omitted/true multiline continues to wrap; false remains
34
+ single-line. Minimums, password/first-line semantics and EditableText restrictions
35
+ are retained. `renderedSize` and `textFitOverflow` remain read-only results.
36
+ Core APIs, peer minima, KUI format and resource contracts are unchanged.
37
+
38
+ ui-runtime 0.10.0's UI ^3.4.0 peer already accepts 3.5.0. CLI and ui-document
39
+ already preserve the fitting fields; neither needs a new release. Applications
40
+ adopt the UI installation/lock and rebuild explicitly. Editor 0.28.1's local
41
+ trial includes this implementation through a built UI override; its exact UI
42
+ 3.4.0 registry baseline must adopt 3.5.0 after publication for ordinary builds.
43
+ Other SDKs, consumer manifests and locks are unchanged.
44
+
45
+ ### Verification
46
+
47
+ The clean prepublish build, all 359 unit tests and 12 minified browser tests
48
+ pass against installed registry Core 2.4.0. Browser coverage includes centered
49
+ flips, independent RichLabel/BitmapLabel, multiline shrink on Canvas/WebGL 1/2
50
+ at 1x/2x and pixel-identical fitting toggles for all alignment combinations.
51
+ Local npm packing verifies version 3.5.0, unchanged Core ^2.4.0, compiled fitting
52
+ and alignment modules, declarations and public documentation, excluding tests,
53
+ node_modules and internal drafts. `git diff --check` passes.
54
+
7
55
  ## [3.4.0] — 2026-10-09
8
56
 
9
- Prepared in source; not published.
57
+ Published; verified on npm on 2026-10-09. Requires published Core ^2.4.0.
58
+ Applications adopt the new UI and Core installation/lock explicitly and rebuild.
10
59
 
11
60
  ### Added
12
61
 
@@ -26,6 +75,9 @@ Editor type checks, 66 focused unit tests and one Electron Inspector/save/undo/r
26
75
 
27
76
  ## [3.3.1] — 2026-10-09
28
77
 
78
+ Not published separately. Preserved in commit 60e6404; its layout correction is
79
+ included in published UI 3.4.0.
80
+
29
81
  ### Fixed
30
82
 
31
83
  - Honor parent-space layout allocations for flipped, scaled, rotated and skewed
package/README.md CHANGED
@@ -1,15 +1,29 @@
1
1
  # @kurot/ui
2
2
 
3
- Source prepares **3.4.0**, not published. Its development installation and lock
4
- now resolve published Core 2.4.0 without local overrides. See
5
- [centered flips](../../docs/centered-flips.md) for APIs and remaining release order.
3
+ **3.5.0 is prepared for publication; not yet published.** It adds multiline
4
+ Label shrinking and retains the original text alignment when fitting is toggled.
5
+ The Core ^2.4.0 peer and registry Core 2.4.0 development installation/lock are
6
+ unchanged. UI 3.4.0 is the previously verified published release (2026-10-09).
7
+ See [Label fitting](docs/label-text-layout.md) for behavior and adoption.
6
8
 
7
9
  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.
8
10
 
9
- > **Package version: 3.4.0 (unpublished).** Requires `@kurot/core@^2.4.0`. Targets ES2022 + evergreen browsers, same as core.
11
+ > **Package version: 3.5.0 (prepared, not yet published).** Requires `@kurot/core@^2.4.0`. Targets ES2022 + evergreen browsers, same as core.
10
12
 
11
13
  For the full list of changes in this release, see [CHANGELOG.md](./CHANGELOG.md).
12
14
 
15
+ ## Text alignment inherited from Core
16
+
17
+ Label, RichLabel and EditableText inherit TextField's default alignment;
18
+ BitmapLabel inherits BitmapText's. With published Core 2.5.3 they default to middle.
19
+ Published Core 2.5.2 and earlier default to top. Explicit top/bottom and skin-state
20
+ overrides stay effective; multiline only controls line generation. Set top
21
+ explicitly when text should start at the top of a taller box.
22
+ 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 and rebuild;
24
+ UI's development installation remains registry Core 2.4.0.
25
+ See [text layout](docs/label-text-layout.md#vertical-alignment-and-skin-defaults).
26
+
13
27
  ## Centered flips in 3.4.0
14
28
 
15
29
  All UI display components inherit independent boolean `flipX` and `flipY`,
@@ -27,9 +41,8 @@ image.percentHeight = 100;
27
41
  Core 2.4.0 supplies the effective transform for rendering and input. The authored
28
42
  `matrix` stays independent of the flags. Layout remains deferred; validate first
29
43
  when reading coordinates or rendering manually. KUI authoring requires document
30
- 0.13.0 and CLI 3.5.0; materialized previews require runtime 0.10.0. These versions
31
- remain prepared but unpublished; Core 2.4.0 is published. No existing skin is
32
- converted automatically.
44
+ 0.13.0 and CLI 3.5.0; materialized previews require runtime 0.10.0. Core 2.4.0,
45
+ UI 3.4.0, document 0.13.0, CLI 3.5.0 and runtime 0.10.0 are published. No existing skin is converted automatically.
33
46
 
34
47
  ## RichLabel in 3.3.0
35
48
 
@@ -52,13 +65,16 @@ See [RichLabel](docs/rich-label.md) for defaults, measurement and font readiness
52
65
  BitmapLabel now also honors maxWidth during automatic measurement. Both text
53
66
  components remeasure automatic height when an authored width changes.
54
67
 
55
- UI 3.3.1 builds and tests against published Core 2.3.1 without local overrides.
68
+ The unpublished UI 3.3.1 snapshot built and tested against registry Core 2.3.1.
69
+ Current UI 3.5.0 builds and tests against registry Core 2.4.0 without overrides.
56
70
  These native APIs do
57
71
  not add KUI tags or an Editor rich-text authoring interface by themselves.
58
72
 
59
- ## Label text fitting in 3.1.0
73
+ ## Label text fitting in 3.5.0
60
74
 
61
- Single-line Labels can shrink their drawing size to fit the available region:
75
+ Labels can shrink their drawing size to fit the available region. UI 3.5.0
76
+ supports both single-line and multiline fitting; UI 3.1.0–3.4.0 fit only
77
+ single-line Labels:
62
78
 
63
79
  ```ts
64
80
  import { Label } from '@kurot/ui';
@@ -74,8 +90,28 @@ amount.minFontSize = 16;
74
90
  `size` stays authored; `renderedSize` and `textFitOverflow` are read-only results
75
91
  after layout validation. Shorter text or larger bounds restore the base size.
76
92
  Put a Button's fitting policy on its `labelDisplay` skin part, so icon spacing
77
- and state overrides are respected. EditableText rejects shrinking; multiline
78
- Labels retain their base size.
93
+ and state overrides are respected. EditableText rejects shrinking.
94
+
95
+ For a multiline caption, keep `multiline = true` (the default), set width and
96
+ height on the Label, and enable `textFit = 'shrink'`. Complete wrapped content,
97
+ hard breaks and line spacing participate in fitting. If several rows fit at the
98
+ base size, the base size is retained. Automatic axes are unconstrained, so
99
+ width-only multiline captions normally wrap and grow taller without shrinking.
100
+ Outline allowance participates in fitting and its shared wrap width. Text keeps
101
+ the original Label alignment frame; automatic measurement remains nominal,
102
+ without implicit outline padding or a position change when fitting is toggled.
103
+
104
+ ```ts
105
+ const caption = new Label('Доказуемая честность');
106
+ caption.width = 120;
107
+ caption.height = 44;
108
+ caption.size = 30;
109
+ caption.wordWrap = true;
110
+ caption.lineSpacing = 2;
111
+ caption.stroke = 1;
112
+ caption.textFit = 'shrink';
113
+ caption.minFontSize = 14;
114
+ ```
79
115
 
80
116
  Label defaults to multiline, while explicit `multiline = false` displays one
81
117
  unwrapped first line. Remove an old false flag or set it to true for text
@@ -84,28 +120,44 @@ measurement; after late loading, call `label.invalidateSize()` to refresh
84
120
  metrics even if the family name is unchanged.
85
121
 
86
122
  See the [text layout and fitting contract](docs/label-text-layout.md). Fitting
87
- metadata was introduced in ui-document 0.9.0 and remains supported in 0.11.0.
88
- Native text KUI projects use published CLI 3.4.0 with ui-document `^0.12.0`;
89
- published ui-runtime 0.9.0 uses the same kernel range. Programmatic UI depends
123
+ metadata was introduced in document 0.9.0 and remains supported in 0.13.0.
124
+ Current CLI 3.6.0 and runtime 0.10.0 use document `^0.13.0`.
125
+ Runtime 0.10.0 also requires UI `^3.4.0` and Core `^2.4.0`. Programmatic UI depends
90
126
  only on Core.
91
127
 
92
128
  ## Installation
93
129
 
94
130
  ```bash
95
- pnpm add @kurot/ui@^3.4.0 @kurot/core@^2.4.0
131
+ pnpm add @kurot/ui@^3.5.0 @kurot/core@^2.4.0
96
132
  ```
97
133
 
98
134
  `@kurot/ui` declares `@kurot/core` as a peer dependency. Install both packages explicitly so the application controls the resolved core version.
99
135
 
100
- UI 3.3 requires Core 2.3.0 or later within Core 2.x for independent rich-text
101
- measurement as well as BitmapText rendering and font resources. Core installs its published bitmap-font dependency automatically.
136
+ Run this installation command after UI 3.5.0 is published. UI 3.5.0 retains
137
+ Core ^2.4.0 for the centered-flip frame hook, in addition to
138
+ the native text APIs introduced in Core 2.2/2.3. Core installs its published
139
+ bitmap-font dependency automatically.
102
140
  Refresh older Core/UI lockfiles and old sheet manifests with
103
141
  string-valued `subkeys` in Kurot Editor before launching the application.
104
142
  See the [resource migration guide](../ui-document/docs/resource-nine-slice.md).
105
143
 
144
+ Adopting 3.5.0 needs only a UI installation/lock update and rebuild when the
145
+ application's range already accepts it. Existing multiline Labels with `shrink`
146
+ start fitting; ordinary Labels without that policy keep their behavior. No KUI
147
+ or resource migration is required. ui-runtime 0.10.0 accepts it through ^3.4.0;
148
+ its development lock may adopt it separately. CLI/ui-document need no release.
149
+ Editor 0.28.1 already removes the multiline Inspector restriction in its local
150
+ trial, but its exact registry UI 3.4.0 dependency must adopt 3.5.0 after publication.
151
+ Templates and other applications retain their own dependency trees and resources.
152
+
106
153
  ## Project style colors
107
154
 
108
- CLI 3.3.0 resolves Label presets and named colors from the optional
155
+ Default artwork and XML skins belong to CLI game templates and the application,
156
+ not the UI runtime package. The CLI 3.6.0 [rounded KUI skin kit](../cli/docs/default-ui-skins.md)
157
+ replaces the template's EUI atlas without changing the component APIs or requiring
158
+ a UI package release. The kit needs published Core ^2.5.0; CLI 3.6.0 is also published. Existing applications keep their own theme resources.
159
+
160
+ CLI 3.5.0 resolves Label presets and named colors from the optional
109
161
  `resource/config/style.json` into native UI properties, including state overrides:
110
162
 
111
163
  ```xml
@@ -192,8 +244,8 @@ transformed rectangle, including negative scale on either axis. A flipped Image
192
244
  with 100% width/height fills its parent allocation, rather than reverting to the
193
245
  texture dimensions. This behavior is shared by Group and Component subclasses.
194
246
  Local minima/maxima still apply; infeasible transformed aspect ratios fit within
195
- the allocation when the local minimum dimensions permit it. The 3.3.1 layout repair adds no new flip property
196
- is introduced by this correction.
247
+ the allocation when the local minimum dimensions permit it. Published UI 3.4.0
248
+ includes this repair alongside the independent centered-flip properties.
197
249
 
198
250
  ### Skin system
199
251
 
@@ -2,7 +2,7 @@ import { Component } from './Component.js';
2
2
  import { TextField } from '@kurot/core';
3
3
  import type { IDisplayText } from '../core/IDisplayText.js';
4
4
  /**
5
- * Optional single-line font fitting policy.
5
+ * Optional font fitting policy, independent of line generation.
6
6
  */
7
7
  export type TextFitMode = 'none' | 'shrink';
8
8
  /**
@@ -21,6 +21,10 @@ export declare class Label extends Component implements IDisplayText {
21
21
  private _textFitOverflow;
22
22
  private _fitKey?;
23
23
  constructor(text?: string);
24
+ get width(): number;
25
+ set width(value: number);
26
+ get height(): number;
27
+ set height(value: number);
24
28
  get text(): string;
25
29
  set text(value: string);
26
30
  get fontFamily(): string;
@@ -28,8 +32,8 @@ export declare class Label extends Component implements IDisplayText {
28
32
  get size(): number;
29
33
  set size(value: number);
30
34
  /**
31
- * Shrink applies only to noneditable, single-line text with finite bounds.
32
- * Multiline text retains the authored size; editable text rejects shrink.
35
+ * Shrink fits the laid-out text within finite bounds, retaining multiline.
36
+ * Editable text rejects shrink; automatic axes do not constrain fitting.
33
37
  */
34
38
  get textFit(): TextFitMode;
35
39
  set textFit(value: TextFitMode);
@@ -85,5 +89,6 @@ export declare class Label extends Component implements IDisplayText {
85
89
  setLayoutBoundsSize(layoutWidth: number, layoutHeight: number): void;
86
90
  updateDisplayList(unscaledWidth: number, unscaledHeight: number): void;
87
91
  private _applyTextFit;
92
+ private _getFitContentWidth;
88
93
  }
89
94
  //# sourceMappingURL=Label.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../src/kurot/components/Label.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAiB,MAAM,aAAa,CAAC;AAGvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAG5D;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE5C;;;;;GAKG;AACH,qBAAa,KAAM,SAAQ,SAAU,YAAW,YAAY;IAG3D,SAAS,CAAC,UAAU,EAAE,SAAS,CAAC;IAEhC,OAAO,CAAC,gBAAgB,CAAO;IAC/B,OAAO,CAAC,aAAa,CAAO;IAC5B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,YAAY,CAAM;IAC1B,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,OAAO,CAAC,CAAS;gBAIN,IAAI,CAAC,EAAE,MAAM;IAUhC,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,IAAW,IAAI,CAAC,KAAK,EAAE,MAAM,EAM5B;IAED,IAAW,UAAU,IAAI,MAAM,CAE9B;IAED,IAAW,UAAU,CAAC,KAAK,EAAE,MAAM,EAMlC;IAED,I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AAO,CAE9B;IAED,IAAW,SAAS,CAAC,KAAK,EAAE,OAAO,EAOlC;IAED;;OAEG;IACH,IAAW,QAAQ,IAAI,OAAO,CAE7B;IAED,IAAW,QAAQ,CAAC,KAAK,EAAE,OAAO,EAMjC;IAED,IAAW,WAAW,IAAI,MAAM,CAE/B;IAED,IAAW,WAAW,CAAC,KAAK,EAAE,MAAM,EAMnC;IAED,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,IAAW,QAAQ,CAAC,KAAK,EAAE,MAAM,EAEhC;IAED,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;IA0Bf,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI;IAgBpE,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI;IAkCtF,OAAO,CAAC,aAAa;IA+CrB,OAAO,CAAC,mBAAmB;CAI3B"}
@@ -28,6 +28,24 @@ export class Label extends Component {
28
28
  this.text = text;
29
29
  }
30
30
  // ── Getters / Setters ─────────────────────────────────────────────────
31
+ get width() {
32
+ return super.width;
33
+ }
34
+ set width(value) {
35
+ if (Object.is(this.$explicitWidth, value))
36
+ return;
37
+ super.width = value;
38
+ this.invalidateSize();
39
+ }
40
+ get height() {
41
+ return super.height;
42
+ }
43
+ set height(value) {
44
+ if (Object.is(this.$explicitHeight, value))
45
+ return;
46
+ super.height = value;
47
+ this.invalidateSize();
48
+ }
31
49
  get text() {
32
50
  return this._textField.text;
33
51
  }
@@ -62,8 +80,8 @@ export class Label extends Component {
62
80
  }
63
81
  }
64
82
  /**
65
- * Shrink applies only to noneditable, single-line text with finite bounds.
66
- * Multiline text retains the authored size; editable text rejects shrink.
83
+ * Shrink fits the laid-out text within finite bounds, retaining multiline.
84
+ * Editable text rejects shrink; automatic axes do not constrain fitting.
67
85
  */
68
86
  get textFit() {
69
87
  return this._textFit;
@@ -232,6 +250,9 @@ export class Label extends Component {
232
250
  this._fitKey = undefined;
233
251
  this._textField?.invalidateTextMetrics();
234
252
  super.invalidateSize();
253
+ if (this.textFit === 'shrink') {
254
+ this.invalidateDisplayList();
255
+ }
235
256
  }
236
257
  createChildren() {
237
258
  super.createChildren();
@@ -256,7 +277,7 @@ export class Label extends Component {
256
277
  : NaN;
257
278
  this._applyTextFit(availableWidth, availableHeight);
258
279
  try {
259
- tf.width = availableWidth;
280
+ tf.width = this._getFitContentWidth(availableWidth);
260
281
  this.setMeasuredSize(tf.textWidth, tf.textHeight);
261
282
  }
262
283
  finally {
@@ -296,13 +317,21 @@ export class Label extends Component {
296
317
  if (previousSize !== this.renderedSize && (isNaN(this.$explicitWidth) || isNaN(this.$explicitHeight))) {
297
318
  this.invalidateSize();
298
319
  }
299
- this._textField.width = unscaledWidth;
320
+ const contentWidth = Number.isFinite(fitWidth)
321
+ ? Math.min(unscaledWidth, this._getFitContentWidth(fitWidth))
322
+ : unscaledWidth;
323
+ // Wrapping reserves outline width; alignment still uses the original Label frame.
324
+ const remainingWidth = unscaledWidth - contentWidth;
325
+ this._textField.x =
326
+ this.textAlign === 'right' ? remainingWidth : this.textAlign === 'center' ? remainingWidth / 2 : 0;
327
+ this._textField.y = 0;
328
+ this._textField.width = contentWidth;
300
329
  this._textField.height = unscaledHeight;
301
330
  }
302
331
  // ── Private methods ────────────────────────────────────────────────────
303
332
  _applyTextFit(width, height) {
304
333
  const tf = this._textField;
305
- if (this.textFit !== 'shrink' || this.multiline || tf.type === TextFieldType.INPUT) {
334
+ if (this.textFit !== 'shrink' || tf.type === TextFieldType.INPUT) {
306
335
  tf.size = this._baseSize;
307
336
  this._textFitOverflow = false;
308
337
  this._fitKey = undefined;
@@ -310,7 +339,9 @@ export class Label extends Component {
310
339
  }
311
340
  const text = tf.displayAsPassword
312
341
  ? '*'.repeat(this.text.length)
313
- : this.text.split(/\r\n|[\n\r\v\f\u0085\u2028\u2029]/, 1)[0];
342
+ : this.multiline
343
+ ? this.text
344
+ : this.text.split(/\r\n|[\n\r\v\f\u0085\u2028\u2029]/, 1)[0];
314
345
  const key = JSON.stringify([
315
346
  text,
316
347
  tf.fontFamily,
@@ -319,6 +350,9 @@ export class Label extends Component {
319
350
  tf.bold,
320
351
  tf.italic,
321
352
  tf.stroke,
353
+ tf.multiline,
354
+ tf.wordWrap,
355
+ tf.lineSpacing,
322
356
  width,
323
357
  height,
324
358
  ]);
@@ -332,6 +366,9 @@ export class Label extends Component {
332
366
  bold: tf.bold,
333
367
  italic: tf.italic,
334
368
  stroke: tf.stroke,
369
+ multiline: tf.multiline,
370
+ wordWrap: tf.wordWrap,
371
+ lineSpacing: tf.lineSpacing,
335
372
  width,
336
373
  height,
337
374
  });
@@ -339,5 +376,9 @@ export class Label extends Component {
339
376
  this._textFitOverflow = fitted.overflow;
340
377
  this._fitKey = key;
341
378
  }
379
+ _getFitContentWidth(width) {
380
+ const outline = this.textFit === 'shrink' && this.text ? Math.max(0, this.stroke) * 2 : 0;
381
+ return Number.isFinite(width) ? Math.max(0, width - outline) : NaN;
382
+ }
342
383
  }
343
384
  //# sourceMappingURL=Label.js.map
@@ -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,aAA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zB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,WAAW;YACzB,IAAI,EAAE,EAAE,CAAC,IAAI;YACb,MAAM,EAAE,EAAE,CAAC,MAAM;YACjB,MAAM,EAAE,EAAE,CAAC,MAAM;YACjB,SAAS,EAAE,EAAE,CAAC,SAAS;YACvB,QAAQ,EAAE,EAAE,CAAC,QAAQ;YACrB,WAAW,EAAE,EAAE,CAAC,WAAW;YAC3B,KAAK;YACL,MAAM;SACN,CAAC,CAAC;QACH,EAAE,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,QAAQ,CAAC;QACxC,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;IACpB,CAAC;IAEO,mBAAmB,CAAC,KAAa;QACxC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1F,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IACpE,CAAC;CACD"}
@@ -6,6 +6,9 @@ interface LabelTextMetrics {
6
6
  bold: boolean;
7
7
  italic: boolean;
8
8
  stroke: number;
9
+ multiline: boolean;
10
+ wordWrap: boolean;
11
+ lineSpacing: number;
9
12
  width: number;
10
13
  height: number;
11
14
  }
@@ -14,7 +17,7 @@ interface LabelTextFit {
14
17
  overflow: boolean;
15
18
  }
16
19
  /**
17
- * Fits one plain-text line within externally constrained logical bounds.
20
+ * Fits plain text using the same line generation as the rendered TextField.
18
21
  * A finite zero bound is meaningful; NaN represents an unconstrained axis.
19
22
  * Never changes authored size or text, and always measures from the base size.
20
23
  */
@@ -1 +1 @@
1
- {"version":3,"file":"fit-label-text.d.ts","sourceRoot":"","sources":["../../../src/kurot/text/fit-label-text.ts"],"names":[],"mappings":"AAEA,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,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,CA8BpE"}
1
+ {"version":3,"file":"fit-label-text.d.ts","sourceRoot":"","sources":["../../../src/kurot/text/fit-label-text.ts"],"names":[],"mappings":"AAEA,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,CA4CpE"}
@@ -1,17 +1,32 @@
1
- import { measureText } from '@kurot/core';
1
+ import { TextField } from '@kurot/core';
2
2
  /**
3
- * Fits one plain-text line within externally constrained logical bounds.
3
+ * Fits plain text using the same line generation as the rendered TextField.
4
4
  * A finite zero bound is meaningful; NaN represents an unconstrained axis.
5
5
  * Never changes authored size or text, and always measures from the base size.
6
6
  */
7
7
  export function fitLabelText(metrics) {
8
+ if (!metrics.text)
9
+ return { size: metrics.size, overflow: false };
10
+ const field = new TextField();
11
+ field.text = metrics.text;
12
+ field.fontFamily = metrics.fontFamily;
13
+ field.bold = metrics.bold;
14
+ field.italic = metrics.italic;
15
+ field.multiline = metrics.multiline;
16
+ field.wordWrap = metrics.wordWrap;
17
+ field.lineSpacing = metrics.lineSpacing;
18
+ const outline = Math.max(0, metrics.stroke) * 2;
19
+ const width = Number.isFinite(metrics.width) ? Math.max(0, metrics.width - outline) : NaN;
8
20
  const fits = (size) => {
9
- const width = measureText(metrics.text, metrics.fontFamily, size, metrics.bold, metrics.italic);
10
- const outline = metrics.stroke * 2;
11
- return ((!Number.isFinite(metrics.width) || width + outline <= metrics.width) &&
12
- (!Number.isFinite(metrics.height) || size + outline <= metrics.height));
21
+ // Core intentionally measures zero-width content as empty, not as overflow.
22
+ if (width === 0)
23
+ return false;
24
+ field.size = size;
25
+ const measured = field.measureText(width);
26
+ return ((!Number.isFinite(metrics.width) || measured.width + outline <= metrics.width) &&
27
+ (!Number.isFinite(metrics.height) || measured.height + outline <= metrics.height));
13
28
  };
14
- if (!metrics.text || fits(metrics.size)) {
29
+ if (fits(metrics.size)) {
15
30
  return { size: metrics.size, overflow: false };
16
31
  }
17
32
  const minimum = Math.min(metrics.minimum, metrics.size);
@@ -31,6 +46,7 @@ export function fitLabelText(metrics) {
31
46
  upper = candidate;
32
47
  }
33
48
  }
34
- return { size: Math.max(minimum, Math.floor(lower * 10) / 10), overflow: false };
49
+ const size = Math.max(minimum, Math.floor(lower * 10) / 10);
50
+ return { size: fits(size) ? size : minimum, overflow: false };
35
51
  }
36
52
  //# sourceMappingURL=fit-label-text.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fit-label-text.js","sourceRoot":"","sources":["../../../src/kurot/text/fit-label-text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAmB1C;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,OAAyB;IACrD,MAAM,IAAI,GAAG,CAAC,IAAY,EAAW,EAAE;QACtC,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAChG,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;QACnC,OAAO,CACN,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC;YACrE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CACtE,CAAC;IACH,CAAC,CAAC;IACF,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACzC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,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,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C;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"}
@@ -1,18 +1,26 @@
1
1
  # @kurot/ui — AI context map
2
2
 
3
- Source prepares UI 3.4.0 and installs published Core 2.4.0 with a matching
4
- registry lockfile, without local overrides. The released baseline below is
5
- historical. Read
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
6
7
  [centered flips](../../../docs/centered-flips.md) before changing transforms,
7
8
  reflection frames, authored flags or dependency adoption.
8
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
+
9
17
  Read this before exploring `src/`. It is a compressed map so an agent
10
18
  unfamiliar with Kurot does not need to re-derive the architecture from scratch
11
19
  each session. Treat the package source and its `src/index.ts` barrel as the
12
20
  authority for current behavior and exports; this file provides the compressed
13
21
  map, runtime contracts and task→file lookup.
14
22
 
15
- Package identity: `@kurot/ui@3.4.0`, EUI-compatible UI framework on top of
23
+ Package identity: `@kurot/ui@3.5.0`, EUI-compatible UI framework on top of
16
24
  `@kurot/core`. Peer-depends on `@kurot/core@^2.4.0`. Rewritten with standard class
17
25
  inheritance and delegation — no namespace mixins, no prototype copying.
18
26
  Version 3.3.1 is preserved in commit 60e6404 and fixes transformed parent
@@ -211,29 +219,45 @@ before patching core's transform code.
211
219
  | Understand validation/render scheduling order | `core/Validator.ts`, core `player/SystemTicker.ts` |
212
220
  | Measure UI validation/rendering performance | `examples/benchmark/` for the visual runner, scenarios, Playwright automation, and local JSON/Markdown reports |
213
221
 
214
- ## Label text layout contract in 3.1.0
222
+ ## Label text layout contract in 3.5.0
215
223
 
216
224
  Label defaults to multiline; explicit false draws only the first hard-separated
217
225
  line without wrapping. EditableText defaults to single-line and rejects
218
226
  shrinking. `wordWrap` chooses Unicode versus character boundaries only while
219
227
  multiline is enabled.
220
228
 
221
- `TextFitMode` is exported with Label. `textFit` is `none` by default or `shrink`
222
- for single-line Labels. `minFontSize` defaults to 12 and must be finite and >= 1.
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.
223
236
  `size` stays authored; `renderedSize` and `textFitOverflow` are read-only results
224
237
  after validation. Fitting uses fixed axes, parent layout constraints or explicit
225
- maximums, reserves outline thickness and caches unchanged metrics. Measured
238
+ maximums, reserves outline thickness and caches unchanged metrics, including
239
+ multiline/wordWrap/lineSpacing. Measured
226
240
  automatic bounds are not fed back as fit constraints.
227
241
 
228
242
  `label.invalidateSize()` also invalidates Core line metrics. Call it after
229
243
  late font loading, even if the family name did not change. This requires
230
- Core >= 2.1.0 for that API; UI 3.3.0's package requirement is Core ^2.3.0.
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.
231
250
  There is no global font-readiness listener.
232
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
+
233
257
  See [Label text layout](label-text-layout.md) for fit bounds, state restoration,
234
258
  font readiness and shared-schema boundaries. Native UI still depends only on
235
- Core; KUI authoring uses ui-document 0.11.x, published CLI 3.3.0 and
236
- published ui-runtime 0.8.2. Label presets expand in consumer-owned
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
237
261
  copies before native rendering; UI does not read style.json or consume textStyle.
238
262
 
239
263
  ## Bitmap labels in 3.2.0
@@ -257,4 +281,5 @@ wordWrap, lineSpacing, textAlign and verticalAlign remain component-level.
257
281
  Task → `components/RichLabel.ts`, `test/RichLabel.test.ts`,
258
282
  `test/browser/text-labels.spec.ts`. Run `pnpm test:text-labels` after building
259
283
  Core and UI. BitmapLabel automatic measurement now uses maxWidth too. The KUI
260
- catalog, CLI and Editor must adopt these native components in a later phase.
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.
@@ -1,6 +1,6 @@
1
1
  # @kurot/ui architecture
2
2
 
3
- > Package version: 3.4.0 (unpublished), with peerDependency `@kurot/core: ^2.4.0`.
3
+ > Package version: 3.5.0 (prepared, not yet 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.
@@ -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
- Published ui-document 0.12.0, CLI 3.4.0 and ui-runtime 0.9.0 support BitmapLabel
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
45
56
  authoring, KUI compilation and materialization. Earlier compilers do not accept
46
57
  this built-in XML tag; update applications explicitly when adopting it. Editor
47
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, this contract is unchanged in UI 3.2.0,
4
- which requires Core ^2.2.0. The public
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.11.0. Published CLI 3.3.0 and ui-runtime 0.8.2 use ui-document `^0.11.0`.
8
- Runtime 0.8.0's `^0.9.0` and runtime 0.8.1's `^0.10.0` peer ranges exclude
9
- the current kernel. Label presets are expanded into native properties before
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
- single-line Labels. Multiline Labels retain their authored size; EditableText
45
- rejects `shrink`, including through the shared authoring schema. Put the policy
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. The
56
- ordinary Core clipping and outline rendering rules remain in effect.
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.
@@ -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 | top | top, middle or bottom. |
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,7 +76,8 @@ 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
- Published ui-document 0.12.0, CLI 3.4.0 and ui-runtime 0.9.0 provide RichLabel
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
71
81
  authoring, KUI compilation and materialization. Earlier versions lack these
72
82
  built-in registrations. Editor controls are owned by the separate application;
73
83
  all consumers retain textFlow ownership and separation from Label presets.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kurot/ui",
3
- "version": "3.4.0",
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",