@kosdev-code/kos-ui-sdk 2.0.37 → 2.0.39
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/index.cjs +18 -17
- package/index.cjs.map +1 -1
- package/index.js +593 -562
- package/index.js.map +1 -1
- package/models/models/canvas-dispatcher/types/index.d.ts +2 -1
- package/models/models/canvas-dispatcher/utils/renderers/scrolling-text-renderer.d.ts +6 -1
- package/models/models/canvas-dispatcher/utils/renderers/scrolling-text-renderer.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -86,9 +86,10 @@ declare interface MatrixRenderDataSpecification {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
declare interface TextRenderDataSpecification {
|
|
89
|
-
text: string; // The text to display
|
|
89
|
+
text: string; // The text to display (use \n for line breaks)
|
|
90
90
|
fontSize?: number; // Font size in pixels (default: 8, optimized for small LED panels)
|
|
91
91
|
fontFamily?: string; // Font family name (default: monospace font stack for LED readability)
|
|
92
|
+
lineHeight?: number; // Line height in pixels (default: fontSize + 2 for spacing)
|
|
92
93
|
color?: { r: number; g: number; b: number } | string; // Text color (RGB object or hex string, default: white)
|
|
93
94
|
duration?: number; // how long to display in milliseconds (for static text)
|
|
94
95
|
loop?: boolean | number; // for repeating display or scrolling
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Canvas2DRendererBase } from './base/canvas-2d-renderer';
|
|
2
|
-
import { DoneAware,
|
|
2
|
+
import { DoneAware, Renderer, TextRenderDataSpecification } from '../../types';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Enhanced text renderer with scrolling capabilities.
|
|
@@ -14,8 +14,10 @@ import { DoneAware, TextRenderDataSpecification, Renderer } from '../../types';
|
|
|
14
14
|
*/
|
|
15
15
|
export declare class ScrollingTextRenderer extends Canvas2DRendererBase implements Renderer, DoneAware {
|
|
16
16
|
private text;
|
|
17
|
+
private lines;
|
|
17
18
|
private fontSize;
|
|
18
19
|
private fontFamily;
|
|
20
|
+
private lineHeight;
|
|
19
21
|
private textColor;
|
|
20
22
|
private scrollConfig;
|
|
21
23
|
private loopConfig;
|
|
@@ -32,6 +34,7 @@ export declare class ScrollingTextRenderer extends Canvas2DRendererBase implemen
|
|
|
32
34
|
private pauseStartTime;
|
|
33
35
|
private textWidth;
|
|
34
36
|
private textHeight;
|
|
37
|
+
private lineWidths;
|
|
35
38
|
private textMeasured;
|
|
36
39
|
constructor(data: TextRenderDataSpecification);
|
|
37
40
|
private measureText;
|
|
@@ -41,6 +44,8 @@ export declare class ScrollingTextRenderer extends Canvas2DRendererBase implemen
|
|
|
41
44
|
renderFrame(width: number, height: number): void;
|
|
42
45
|
private drawStaticText;
|
|
43
46
|
private drawScrollingText;
|
|
47
|
+
private drawMultiLineScrollText;
|
|
48
|
+
private drawTextBlock;
|
|
44
49
|
private checkScrollCompletion;
|
|
45
50
|
private startPauseOrNextLoop;
|
|
46
51
|
private handleCompletion;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrolling-text-renderer.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/canvas-dispatcher/utils/renderers/scrolling-text-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,
|
|
1
|
+
{"version":3,"file":"scrolling-text-renderer.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/canvas-dispatcher/utils/renderers/scrolling-text-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,QAAQ,EACR,2BAA2B,EAC5B,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE;;;;;;;;;;GAUG;AACH,qBAAa,qBACX,SAAQ,oBACR,YAAW,QAAQ,EAAE,SAAS;IAE9B,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,KAAK,CAAW;IACxB,O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|
"name": "@kosdev-code/kos-ui-sdk",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.39",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.cjs",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"kos": {
|
|
38
38
|
"build": {
|
|
39
|
-
"gitHash": "
|
|
39
|
+
"gitHash": "335ce8a059d94cf2db2d6d483aa048ccc52dc70e"
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
}
|