babylonjs-gui 7.15.1 → 7.15.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -4205,7 +4205,11 @@ export enum TextWrapping {
4205
4205
  /**
4206
4206
  * Wrap the text word-wise and clip the text when the text's height is larger than the Control.height, and shrink the last line with trailing … .
4207
4207
  */
4208
- WordWrapEllipsis = 3
4208
+ WordWrapEllipsis = 3,
4209
+ /**
4210
+ * Use HTML to wrap the text. This is the only mode that supports east-asian languages.
4211
+ */
4212
+ HTML = 4
4209
4213
  }
4210
4214
  /**
4211
4215
  * Class used to create text block control
@@ -4241,6 +4245,16 @@ export class TextBlock extends Control {
4241
4245
  * Function used to split a string into words. By default, a string is split at each space character found
4242
4246
  */
4243
4247
  wordSplittingFunction: Nullable<(line: string) => string[]>;
4248
+ /**
4249
+ * This function will be called when a new HTML element is generated to be used for word wrapping.
4250
+ * This is only used when wrapping mode HTML is selected.
4251
+ * Using this function you can adjust word-break, overflow-wrap, hyphens, or any other CSS properties of the HTML element, language-dependent.
4252
+ */
4253
+ adjustWordWrappingHTMLElement: Nullable<(element: HTMLElement) => void>;
4254
+ /**
4255
+ * Gets or sets a boolean indicating if the HTML element generated for word wrapping should be reused or removed after each wrapping.
4256
+ */
4257
+ reuseHTMLForWordWrapping: boolean;
4244
4258
  /**
4245
4259
  * Return the line list (you may need to use the onLinesReadyObservable to make sure the list is ready)
4246
4260
  */
@@ -4368,6 +4382,8 @@ export class TextBlock extends Control {
4368
4382
  protected _applyStates(context: ICanvasRenderingContext): void;
4369
4383
  private _linesTemp;
4370
4384
  protected _breakLines(refWidth: number, refHeight: number, context: ICanvasRenderingContext): object[];
4385
+ private _htmlElement;
4386
+ protected _parseHTMLText(refWidth: number, refHeight: number, context: ICanvasRenderingContext): string[];
4371
4387
  protected _parseLine(line: string | undefined, context: ICanvasRenderingContext): object;
4372
4388
  private _getCharsToRemove;
4373
4389
  protected _parseLineEllipsis(line: string | undefined, width: number, context: ICanvasRenderingContext): object;
@@ -12825,7 +12841,11 @@ declare module BABYLON.GUI {
12825
12841
  /**
12826
12842
  * Wrap the text word-wise and clip the text when the text's height is larger than the Control.height, and shrink the last line with trailing … .
12827
12843
  */
12828
- WordWrapEllipsis = 3
12844
+ WordWrapEllipsis = 3,
12845
+ /**
12846
+ * Use HTML to wrap the text. This is the only mode that supports east-asian languages.
12847
+ */
12848
+ HTML = 4
12829
12849
  }
12830
12850
  /**
12831
12851
  * Class used to create text block control
@@ -12861,6 +12881,16 @@ declare module BABYLON.GUI {
12861
12881
  * Function used to split a string into words. By default, a string is split at each space character found
12862
12882
  */
12863
12883
  wordSplittingFunction: BABYLON.Nullable<(line: string) => string[]>;
12884
+ /**
12885
+ * This function will be called when a new HTML element is generated to be used for word wrapping.
12886
+ * This is only used when wrapping mode HTML is selected.
12887
+ * Using this function you can adjust word-break, overflow-wrap, hyphens, or any other CSS properties of the HTML element, language-dependent.
12888
+ */
12889
+ adjustWordWrappingHTMLElement: BABYLON.Nullable<(element: HTMLElement) => void>;
12890
+ /**
12891
+ * Gets or sets a boolean indicating if the HTML element generated for word wrapping should be reused or removed after each wrapping.
12892
+ */
12893
+ reuseHTMLForWordWrapping: boolean;
12864
12894
  /**
12865
12895
  * Return the line list (you may need to use the onLinesReadyObservable to make sure the list is ready)
12866
12896
  */
@@ -12986,6 +13016,8 @@ declare module BABYLON.GUI {
12986
13016
  protected _applyStates(context: BABYLON.ICanvasRenderingContext): void;
12987
13017
  private _linesTemp;
12988
13018
  protected _breakLines(refWidth: number, refHeight: number, context: BABYLON.ICanvasRenderingContext): object[];
13019
+ private _htmlElement;
13020
+ protected _parseHTMLText(refWidth: number, refHeight: number, context: BABYLON.ICanvasRenderingContext): string[];
12989
13021
  protected _parseLine(line: string | undefined, context: BABYLON.ICanvasRenderingContext): object;
12990
13022
  private _getCharsToRemove;
12991
13023
  protected _parseLineEllipsis(line: string | undefined, width: number, context: BABYLON.ICanvasRenderingContext): object;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babylonjs-gui",
3
- "version": "7.15.1",
3
+ "version": "7.15.2",
4
4
  "main": "babylon.gui.js",
5
5
  "types": "babylon.gui.module.d.ts",
6
6
  "files": [
@@ -15,7 +15,7 @@
15
15
  "test:escheck": "es-check es6 ./babylon.gui.js"
16
16
  },
17
17
  "dependencies": {
18
- "babylonjs": "^7.15.1"
18
+ "babylonjs": "^7.15.2"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@dev/build-tools": "1.0.0",