ice-render 1.0.4 → 1.0.6
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/LICENSE +0 -0
- package/README.md +229 -141
- package/dist/THIRD-PARTY-NOTICES.txt +32 -0
- package/dist/index.cjs +30 -0
- package/dist/index.mjs +30 -0
- package/dist/index.umd.js +6 -1
- package/dist/types/FrameManager.d.mts +26 -0
- package/dist/types/FrameManager.d.ts +26 -26
- package/dist/types/ICE.d.mts +369 -0
- package/dist/types/ICE.d.ts +369 -107
- package/dist/types/a11y/accessibility.d.mts +46 -0
- package/dist/types/a11y/accessibility.d.ts +46 -0
- package/dist/types/animation/AnimationManager.d.mts +96 -0
- package/dist/types/animation/AnimationManager.d.ts +96 -25
- package/dist/types/animation/Easing.d.mts +33 -0
- package/dist/types/animation/Easing.d.ts +33 -32
- package/dist/types/consts/BIG_ZINDEX_NUMBER.d.mts +14 -0
- package/dist/types/consts/BIG_ZINDEX_NUMBER.d.ts +14 -14
- package/dist/types/consts/COMPONENT_TYPE_MAPPING.d.mts +45 -0
- package/dist/types/consts/COMPONENT_TYPE_MAPPING.d.ts +45 -36
- package/dist/types/consts/DOM_EVENT_MAPPING_CONSTS.d.mts +37 -0
- package/dist/types/consts/DOM_EVENT_MAPPING_CONSTS.d.ts +37 -19
- package/dist/types/consts/ICE_EVENT_NAME_CONSTS.d.mts +27 -0
- package/dist/types/consts/ICE_EVENT_NAME_CONSTS.d.ts +27 -20
- package/dist/types/control-panel/AlignmentGuideManager.d.mts +92 -0
- package/dist/types/control-panel/AlignmentGuideManager.d.ts +92 -0
- package/dist/types/control-panel/ICEControlPanel.d.mts +37 -0
- package/dist/types/control-panel/ICEControlPanel.d.ts +37 -37
- package/dist/types/control-panel/ICEControlPanelManager.d.mts +25 -0
- package/dist/types/control-panel/ICEControlPanelManager.d.ts +25 -23
- package/dist/types/control-panel/link-controls/LineControlPanel.d.mts +39 -0
- package/dist/types/control-panel/link-controls/LineControlPanel.d.ts +39 -39
- package/dist/types/control-panel/transform-controls/ResizeControl.d.mts +38 -0
- package/dist/types/control-panel/transform-controls/ResizeControl.d.ts +38 -38
- package/dist/types/control-panel/transform-controls/RotateControl.d.mts +12 -0
- package/dist/types/control-panel/transform-controls/RotateControl.d.ts +12 -12
- package/dist/types/control-panel/transform-controls/TransformControlPanel.d.mts +83 -0
- package/dist/types/control-panel/transform-controls/TransformControlPanel.d.ts +83 -74
- package/dist/types/control-panel/transform-controls/constraints.d.mts +24 -0
- package/dist/types/control-panel/transform-controls/constraints.d.ts +24 -0
- package/dist/types/cross-platform/PolyfillPath2D.d.mts +31 -0
- package/dist/types/cross-platform/PolyfillPath2D.d.ts +31 -0
- package/dist/types/cross-platform/root.d.mts +7 -0
- package/dist/types/cross-platform/root.d.ts +7 -2
- package/dist/types/event/DOMEventDispatcher.d.mts +68 -0
- package/dist/types/event/DOMEventDispatcher.d.ts +68 -29
- package/dist/types/event/DOMEventInterceptor.d.mts +36 -0
- package/dist/types/event/DOMEventInterceptor.d.ts +36 -7
- package/dist/types/event/EventBus.d.mts +27 -0
- package/dist/types/event/EventBus.d.ts +27 -27
- package/dist/types/event/ICEEvent.d.mts +46 -0
- package/dist/types/event/ICEEvent.d.ts +46 -46
- package/dist/types/event/ICEEventTarget.d.mts +106 -0
- package/dist/types/event/ICEEventTarget.d.ts +106 -106
- package/dist/types/event/input-normalize.d.mts +75 -0
- package/dist/types/event/input-normalize.d.ts +75 -0
- package/dist/types/geometry/GeoLine.d.mts +24 -0
- package/dist/types/geometry/GeoLine.d.ts +24 -23
- package/dist/types/geometry/GeoPoint.d.mts +53 -0
- package/dist/types/geometry/GeoPoint.d.ts +53 -66
- package/dist/types/geometry/GeoUtil.d.mts +73 -0
- package/dist/types/geometry/GeoUtil.d.ts +73 -37
- package/dist/types/geometry/ICEBoundingBox.d.mts +81 -0
- package/dist/types/geometry/ICEBoundingBox.d.ts +81 -81
- package/dist/types/graphic/ICEComponent.d.mts +436 -0
- package/dist/types/graphic/ICEComponent.d.ts +436 -264
- package/dist/types/graphic/ICEDotPath.d.mts +99 -0
- package/dist/types/graphic/ICEDotPath.d.ts +99 -63
- package/dist/types/graphic/ICEImage.d.mts +17 -0
- package/dist/types/graphic/ICEImage.d.ts +17 -17
- package/dist/types/graphic/ICEPath.d.mts +39 -0
- package/dist/types/graphic/ICEPath.d.ts +39 -36
- package/dist/types/graphic/container/ICEGroup.d.mts +101 -0
- package/dist/types/graphic/container/ICEGroup.d.ts +101 -53
- package/dist/types/graphic/link/ICEBezier.d.mts +23 -0
- package/dist/types/graphic/link/ICEBezier.d.ts +23 -15
- package/dist/types/graphic/link/ICELinkHook.d.mts +52 -0
- package/dist/types/graphic/link/ICELinkHook.d.ts +52 -52
- package/dist/types/graphic/link/ICELinkSlot.d.mts +54 -0
- package/dist/types/graphic/link/ICELinkSlot.d.ts +54 -46
- package/dist/types/graphic/link/ICELinkSlotManager.d.mts +28 -0
- package/dist/types/graphic/link/ICELinkSlotManager.d.ts +28 -28
- package/dist/types/graphic/link/ICEPolyLine.d.mts +292 -0
- package/dist/types/graphic/link/ICEPolyLine.d.ts +292 -219
- package/dist/types/graphic/link/ICEVisioLink.d.mts +163 -0
- package/dist/types/graphic/link/ICEVisioLink.d.ts +163 -129
- package/dist/types/graphic/shape/ICECircle.d.mts +19 -0
- package/dist/types/graphic/shape/ICECircle.d.ts +19 -19
- package/dist/types/graphic/shape/ICEEllipse.d.mts +29 -0
- package/dist/types/graphic/shape/ICEEllipse.d.ts +29 -23
- package/dist/types/graphic/shape/ICEIsogon.d.mts +52 -0
- package/dist/types/graphic/shape/ICEIsogon.d.ts +52 -52
- package/dist/types/graphic/shape/ICERect.d.mts +10 -0
- package/dist/types/graphic/shape/ICERect.d.ts +10 -17
- package/dist/types/graphic/shape/ICERose.d.mts +41 -0
- package/dist/types/graphic/shape/ICERose.d.ts +41 -41
- package/dist/types/graphic/shape/ICEStar.d.mts +45 -0
- package/dist/types/graphic/shape/ICEStar.d.ts +45 -45
- package/dist/types/graphic/text/ICEText.d.mts +137 -0
- package/dist/types/graphic/text/ICEText.d.ts +137 -65
- package/dist/types/index.d.mts +55 -0
- package/dist/types/index.d.ts +55 -41
- package/dist/types/layout/ICEBorderLayout.d.mts +34 -0
- package/dist/types/layout/ICEBorderLayout.d.ts +34 -0
- package/dist/types/layout/ICEBoxLayout.d.mts +30 -0
- package/dist/types/layout/ICEBoxLayout.d.ts +30 -0
- package/dist/types/layout/ICECardLayout.d.mts +36 -0
- package/dist/types/layout/ICECardLayout.d.ts +36 -0
- package/dist/types/layout/ICEFlowLayout.d.mts +31 -0
- package/dist/types/layout/ICEFlowLayout.d.ts +31 -0
- package/dist/types/layout/ICEGridLayout.d.mts +33 -0
- package/dist/types/layout/ICEGridLayout.d.ts +33 -0
- package/dist/types/layout/ICELayeredLayout.d.mts +49 -0
- package/dist/types/layout/ICELayeredLayout.d.ts +49 -0
- package/dist/types/layout/ICELayoutManager.d.mts +33 -0
- package/dist/types/layout/ICELayoutManager.d.ts +33 -0
- package/dist/types/layout/ICEOverlayLayout.d.mts +25 -0
- package/dist/types/layout/ICEOverlayLayout.d.ts +25 -0
- package/dist/types/persistence/Deserializer.d.mts +43 -0
- package/dist/types/persistence/Deserializer.d.ts +43 -14
- package/dist/types/persistence/Serializer.d.mts +35 -0
- package/dist/types/persistence/Serializer.d.ts +35 -26
- package/dist/types/plugin/PluginHost.d.mts +86 -0
- package/dist/types/plugin/PluginHost.d.ts +86 -0
- package/dist/types/renderer/CanvasRenderer.d.mts +150 -0
- package/dist/types/renderer/CanvasRenderer.d.ts +150 -22
- package/dist/types/renderer/ObjectCache.d.mts +79 -0
- package/dist/types/renderer/ObjectCache.d.ts +79 -0
- package/dist/types/renderer/dirty-rect-util.d.mts +86 -0
- package/dist/types/renderer/dirty-rect-util.d.ts +86 -0
- package/dist/types/theme/ICETheme.d.mts +382 -0
- package/dist/types/theme/ICETheme.d.ts +382 -0
- package/dist/types/util/ImageCache.d.mts +19 -0
- package/dist/types/util/ImageCache.d.ts +19 -19
- package/dist/types/util/data-util.d.mts +43 -0
- package/dist/types/util/data-util.d.ts +43 -19
- package/dist/types/util/gl-matrix-skew.d.mts +14 -0
- package/dist/types/util/gl-matrix-skew.d.ts +14 -14
- package/dist/types/util/lang.d.mts +28 -0
- package/dist/types/util/lang.d.ts +28 -0
- package/dist/types/util/uuid.d.mts +1 -0
- package/dist/types/util/uuid.d.ts +1 -1
- package/package.json +118 -81
- package/dist/index.cjs.js +0 -25
- package/dist/index.js +0 -25
|
@@ -1,65 +1,137 @@
|
|
|
1
|
-
import ICEComponent from '../ICEComponent';
|
|
2
|
-
/**
|
|
3
|
-
* TODO:draw text along Path2D
|
|
4
|
-
* @class ICEText 文本
|
|
5
|
-
* @author 大漠穷秋<damoqiongqiu@126.com>
|
|
6
|
-
*/
|
|
7
|
-
declare class ICEText extends ICEComponent {
|
|
8
|
-
/**
|
|
9
|
-
* @cfg
|
|
10
|
-
* {
|
|
11
|
-
* text:'文本内容',
|
|
12
|
-
* left:0,
|
|
13
|
-
* top:0,
|
|
14
|
-
* style:{
|
|
15
|
-
* fontWeight:24,
|
|
16
|
-
* fontSize:48,
|
|
17
|
-
* fontFamily:'Arial',
|
|
18
|
-
* lineWidth:1,
|
|
19
|
-
* textBaseline:'bottom',
|
|
20
|
-
* paddingTop:0, //number 型,不可加单位
|
|
21
|
-
* paddingBottom:0, //number 型,不可加单位
|
|
22
|
-
* paddingLeft:0, //number 型,不可加单位
|
|
23
|
-
* paddingRight:0, //number 型,不可加单位
|
|
24
|
-
* }
|
|
25
|
-
* }
|
|
26
|
-
* @param props
|
|
27
|
-
*/
|
|
28
|
-
constructor(props?: any);
|
|
29
|
-
protected static arrangeParam(props: any): any;
|
|
30
|
-
/**
|
|
31
|
-
* @overwrite
|
|
32
|
-
*
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
*
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
*
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*/
|
|
56
|
-
private
|
|
57
|
-
/**
|
|
58
|
-
*
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
1
|
+
import ICEComponent from '../ICEComponent';
|
|
2
|
+
/**
|
|
3
|
+
* TODO:draw text along Path2D
|
|
4
|
+
* @class ICEText 文本
|
|
5
|
+
* @author 大漠穷秋<damoqiongqiu@126.com>
|
|
6
|
+
*/
|
|
7
|
+
declare class ICEText extends ICEComponent {
|
|
8
|
+
/**
|
|
9
|
+
* @cfg
|
|
10
|
+
* {
|
|
11
|
+
* text:'文本内容',
|
|
12
|
+
* left:0,
|
|
13
|
+
* top:0,
|
|
14
|
+
* style:{
|
|
15
|
+
* fontWeight:24,
|
|
16
|
+
* fontSize:48,
|
|
17
|
+
* fontFamily:'Arial',
|
|
18
|
+
* lineWidth:1,
|
|
19
|
+
* textBaseline:'bottom',
|
|
20
|
+
* paddingTop:0, //number 型,不可加单位
|
|
21
|
+
* paddingBottom:0, //number 型,不可加单位
|
|
22
|
+
* paddingLeft:0, //number 型,不可加单位
|
|
23
|
+
* paddingRight:0, //number 型,不可加单位
|
|
24
|
+
* }
|
|
25
|
+
* }
|
|
26
|
+
* @param props
|
|
27
|
+
*/
|
|
28
|
+
constructor(props?: any);
|
|
29
|
+
protected static arrangeParam(props: any): any;
|
|
30
|
+
/**
|
|
31
|
+
* @overwrite
|
|
32
|
+
* 双击进入内联编辑态。
|
|
33
|
+
*/
|
|
34
|
+
protected initEvents(): void;
|
|
35
|
+
/**
|
|
36
|
+
* 进入编辑前的 draggable 原值,退出编辑时恢复。
|
|
37
|
+
*/
|
|
38
|
+
private __originalDraggable;
|
|
39
|
+
/**
|
|
40
|
+
* 编辑态叠加的 HTML input(用于支持中文 IME 输入)。浏览器环境下存在;
|
|
41
|
+
* 无 document 的运行时(Node/小程序)为 null,降级为 canvas keydown 输入。
|
|
42
|
+
*/
|
|
43
|
+
private __editInput;
|
|
44
|
+
/**
|
|
45
|
+
* 进入内联编辑态:光标定位到文本末尾,隐藏变换面板、禁用拖拽(避免编辑时误拖动)。
|
|
46
|
+
*/
|
|
47
|
+
startEditing(): void;
|
|
48
|
+
/**
|
|
49
|
+
* 退出内联编辑态(提交文本)。退出后不自动恢复变换面板——用户若需再变换组件,重新点击组件即可。
|
|
50
|
+
*/
|
|
51
|
+
stopEditing(): void;
|
|
52
|
+
/**
|
|
53
|
+
* 创建透明的 HTML input 覆盖在文本上,捕获输入(含中文 IME)。
|
|
54
|
+
* input 文字设为透明(canvas 负责显示),只保留可见光标。
|
|
55
|
+
*/
|
|
56
|
+
private __mountEditInput;
|
|
57
|
+
/**
|
|
58
|
+
* 移除编辑态的 HTML input。
|
|
59
|
+
*/
|
|
60
|
+
private __unmountEditInput;
|
|
61
|
+
/**
|
|
62
|
+
* 全局 mousedown 处理器:点击的组件不是自身时,退出编辑(失焦退出)。
|
|
63
|
+
*/
|
|
64
|
+
private __globalMouseDownHandler;
|
|
65
|
+
/**
|
|
66
|
+
* 设置文本内容(会重新测量宽高)。
|
|
67
|
+
*/
|
|
68
|
+
setText(text: string): this;
|
|
69
|
+
getText(): string;
|
|
70
|
+
/**
|
|
71
|
+
* @overwrite
|
|
72
|
+
* 编辑态下接管键盘输入:字符插入 / Backspace / Delete / 方向键移动光标 / Enter 提交。
|
|
73
|
+
*/
|
|
74
|
+
protected keyboardEvtHandler(evt: any): void;
|
|
75
|
+
/**
|
|
76
|
+
* 在编辑态下渲染光标(垂直竖线),位置由 caretIndex + ctx.measureText 计算。
|
|
77
|
+
*/
|
|
78
|
+
private renderCaret;
|
|
79
|
+
/**
|
|
80
|
+
* @overwrite
|
|
81
|
+
* @method calcComponentParams
|
|
82
|
+
* - 计算组件最原始的宽高和位置,此时没有经过任何变换,也没有移动坐标原点。
|
|
83
|
+
* - 在计算组件的原始尺寸时还没有确定原点坐标,所以只能基于组件本地坐标系的左上角 (0,0) 点进行计算。
|
|
84
|
+
* - 此方法不能依赖原点位置和 transform 矩阵。
|
|
85
|
+
* - 此方法会在 render() 中调用,所以不需要在构造函数中调用。
|
|
86
|
+
* - 此方法中不能使用 setState() ,如果需要修改状态,直接赋值,如:this.state.width = 100;
|
|
87
|
+
* - 子类可以覆盖此方法,实现自己的计算逻辑。
|
|
88
|
+
* @returns
|
|
89
|
+
*/
|
|
90
|
+
protected calcComponentParams(): {
|
|
91
|
+
width: any;
|
|
92
|
+
height: any;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* @method measureText
|
|
96
|
+
*
|
|
97
|
+
* - Canvas 中没有提供原生的计算文本高度的有效方法,文本宽高的计算需要使用特殊的方法,这里使用的方法来自 https://longviewcoder.com/2021/02/11/html5-canvas-text-line-height-measurement/
|
|
98
|
+
* - 计算原始的宽高、位置,此时没有经过任何变换,也没有移动坐标原点。
|
|
99
|
+
* - 在计算组件的原始尺寸时还没有确定原点坐标,所以只能基于组件本地坐标系的左上角 (0,0) 点进行计算。
|
|
100
|
+
*
|
|
101
|
+
* FIXME:这里有性能瓶颈,需要进一步优化
|
|
102
|
+
* FIXME:某些运行时环境可能不支持动态插入 HTML 标签,以上测量文本宽高的方法可能存在兼容性问题。
|
|
103
|
+
* FIXME:对文本位置的控制需要更精细的计算方法。
|
|
104
|
+
*/
|
|
105
|
+
private measureText;
|
|
106
|
+
/**
|
|
107
|
+
* 计算换行后的行数组;返回 null 表示「不换行,按 \n 拆」。
|
|
108
|
+
*/
|
|
109
|
+
private __computeWrappedLines;
|
|
110
|
+
/** 统一的测宽函数:优先 ctx.measureText;无 ctx 时按 fontSize 粗估。 */
|
|
111
|
+
private __measureFn;
|
|
112
|
+
/**
|
|
113
|
+
* 按 grapheme cluster 切分。
|
|
114
|
+
* 优先 Intl.Segmenter(Baseline 2024),能把 emoji / ZWJ 序列 / 组合字符合成一个单元;
|
|
115
|
+
* 不可用时退化为码点切分(至少不会把代理对拆开)。
|
|
116
|
+
*/
|
|
117
|
+
private __graphemes;
|
|
118
|
+
/** 贪心换行:逐 grapheme 累加,超过可用宽度即断行。保留段落自身的 \n。 */
|
|
119
|
+
private __wrapText;
|
|
120
|
+
/**
|
|
121
|
+
* 超过 maxLines 时截断末行并追加省略号;逐 grapheme 回退直到「内容+省略号」放得下。
|
|
122
|
+
*/
|
|
123
|
+
private __truncateLines;
|
|
124
|
+
/** 用 Canvas TextMetrics.actualBoundingBox* 测量文本真实宽高;不支持则返回 null 降级。 */
|
|
125
|
+
private __measureByCanvas;
|
|
126
|
+
private __applyMeasuredSize;
|
|
127
|
+
/** DOM 降级测量:line-height 归一为 1,减少 leading 干扰(旧环境/小程序)。 */
|
|
128
|
+
private __measureByDOM;
|
|
129
|
+
/**
|
|
130
|
+
* @method doRender
|
|
131
|
+
* @overwrite
|
|
132
|
+
* 文本是基于 baseline 绘制的,文本是从 y 坐标向屏幕上方绘制的,48 是文本高度,这里需要补偿文本高度。
|
|
133
|
+
* 同时把移动坐标轴原点的偏移量计算进去。
|
|
134
|
+
*/
|
|
135
|
+
protected doRender(): void;
|
|
136
|
+
}
|
|
137
|
+
export default ICEText;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export { default as AnimationManager } from './animation/AnimationManager.mjs';
|
|
9
|
+
export { default as ICEControlPanel } from './control-panel/ICEControlPanel.mjs';
|
|
10
|
+
export { default as ICEControlPanelManager } from './control-panel/ICEControlPanelManager.mjs';
|
|
11
|
+
export { default as AlignmentGuideManager } from './control-panel/AlignmentGuideManager.mjs';
|
|
12
|
+
export { default as LineControlPanel } from './control-panel/link-controls/LineControlPanel.mjs';
|
|
13
|
+
export { default as ResizeControl } from './control-panel/transform-controls/ResizeControl.mjs';
|
|
14
|
+
export { default as RotateControl } from './control-panel/transform-controls/RotateControl.mjs';
|
|
15
|
+
export { default as TransformControlPanel } from './control-panel/transform-controls/TransformControlPanel.mjs';
|
|
16
|
+
export { default as DOMEventDispatcher } from './event/DOMEventDispatcher.mjs';
|
|
17
|
+
export { default as DOMEventInterceptor } from './event/DOMEventInterceptor.mjs';
|
|
18
|
+
export { default as EventBus } from './event/EventBus.mjs';
|
|
19
|
+
export { default as ICEEventTarget } from './event/ICEEventTarget.mjs';
|
|
20
|
+
export { default as GeoLine } from './geometry/GeoLine.mjs';
|
|
21
|
+
export { default as GeoPoint } from './geometry/GeoPoint.mjs';
|
|
22
|
+
export { default as GeoUtil } from './geometry/GeoUtil.mjs';
|
|
23
|
+
export { default as ICEBoundingBox } from './geometry/ICEBoundingBox.mjs';
|
|
24
|
+
export { default as ICEGroup } from './graphic/container/ICEGroup.mjs';
|
|
25
|
+
export { default as ICEComponent } from './graphic/ICEComponent.mjs';
|
|
26
|
+
export { default as ICEDotPath } from './graphic/ICEDotPath.mjs';
|
|
27
|
+
export { default as ICEImage } from './graphic/ICEImage.mjs';
|
|
28
|
+
export { default as ICEPath } from './graphic/ICEPath.mjs';
|
|
29
|
+
export { default as ICEBezier } from './graphic/link/ICEBezier.mjs';
|
|
30
|
+
export { default as ICELinkHook } from './graphic/link/ICELinkHook.mjs';
|
|
31
|
+
export { default as ICELinkSlot } from './graphic/link/ICELinkSlot.mjs';
|
|
32
|
+
export { default as ICEPolyLine } from './graphic/link/ICEPolyLine.mjs';
|
|
33
|
+
export { default as ICEVisioLink } from './graphic/link/ICEVisioLink.mjs';
|
|
34
|
+
export { default as ICECircle } from './graphic/shape/ICECircle.mjs';
|
|
35
|
+
export { default as ICEEllipse } from './graphic/shape/ICEEllipse.mjs';
|
|
36
|
+
export { default as ICEIsogon } from './graphic/shape/ICEIsogon.mjs';
|
|
37
|
+
export { default as ICERect } from './graphic/shape/ICERect.mjs';
|
|
38
|
+
export { default as ICERose } from './graphic/shape/ICERose.mjs';
|
|
39
|
+
export { default as ICEStar } from './graphic/shape/ICEStar.mjs';
|
|
40
|
+
export { default as ICEText } from './graphic/text/ICEText.mjs';
|
|
41
|
+
export { default as ICELayoutManager } from './layout/ICELayoutManager.mjs';
|
|
42
|
+
export { default as ICEFlowLayout } from './layout/ICEFlowLayout.mjs';
|
|
43
|
+
export { default as ICEGridLayout } from './layout/ICEGridLayout.mjs';
|
|
44
|
+
export { default as ICEBorderLayout } from './layout/ICEBorderLayout.mjs';
|
|
45
|
+
export { default as ICEBoxLayout } from './layout/ICEBoxLayout.mjs';
|
|
46
|
+
export { default as ICECardLayout } from './layout/ICECardLayout.mjs';
|
|
47
|
+
export { default as ICEOverlayLayout } from './layout/ICEOverlayLayout.mjs';
|
|
48
|
+
export { default as ICELayeredLayout } from './layout/ICELayeredLayout.mjs';
|
|
49
|
+
export { default as ICETheme, baseTokens, DEFAULT_THEME, DARK_THEME, registerTheme, setTheme, getTheme, STYLE_PRESETS, } from './theme/ICETheme.mjs';
|
|
50
|
+
export { default as ICE } from './ICE.mjs';
|
|
51
|
+
export { default as CanvasRenderer } from './renderer/CanvasRenderer.mjs';
|
|
52
|
+
export { default as PluginHost } from './plugin/PluginHost.mjs';
|
|
53
|
+
export type { ICEPlugin, ICEPluginTool, ICERenderHook, ICERenderFrame } from './plugin/PluginHost.mjs';
|
|
54
|
+
export { buildAccessibilityTree } from './a11y/accessibility.mjs';
|
|
55
|
+
export type { ICEAccessibleNode, ICEAccessibleRole, ICEAccessibilityOptions } from './a11y/accessibility.mjs';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,41 +1,55 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
export { default as AnimationManager } from './animation/AnimationManager';
|
|
9
|
-
export { default as ICEControlPanel } from './control-panel/ICEControlPanel';
|
|
10
|
-
export { default as ICEControlPanelManager } from './control-panel/ICEControlPanelManager';
|
|
11
|
-
export { default as
|
|
12
|
-
export { default as
|
|
13
|
-
export { default as
|
|
14
|
-
export { default as
|
|
15
|
-
export { default as
|
|
16
|
-
export { default as
|
|
17
|
-
export { default as
|
|
18
|
-
export { default as
|
|
19
|
-
export { default as
|
|
20
|
-
export { default as
|
|
21
|
-
export { default as
|
|
22
|
-
export { default as
|
|
23
|
-
export { default as
|
|
24
|
-
export { default as
|
|
25
|
-
export { default as
|
|
26
|
-
export { default as
|
|
27
|
-
export { default as
|
|
28
|
-
export { default as
|
|
29
|
-
export { default as
|
|
30
|
-
export { default as
|
|
31
|
-
export { default as
|
|
32
|
-
export { default as
|
|
33
|
-
export { default as
|
|
34
|
-
export { default as
|
|
35
|
-
export { default as
|
|
36
|
-
export { default as
|
|
37
|
-
export { default as
|
|
38
|
-
export { default as
|
|
39
|
-
export { default as
|
|
40
|
-
export { default as
|
|
41
|
-
export { default as
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export { default as AnimationManager } from './animation/AnimationManager';
|
|
9
|
+
export { default as ICEControlPanel } from './control-panel/ICEControlPanel';
|
|
10
|
+
export { default as ICEControlPanelManager } from './control-panel/ICEControlPanelManager';
|
|
11
|
+
export { default as AlignmentGuideManager } from './control-panel/AlignmentGuideManager';
|
|
12
|
+
export { default as LineControlPanel } from './control-panel/link-controls/LineControlPanel';
|
|
13
|
+
export { default as ResizeControl } from './control-panel/transform-controls/ResizeControl';
|
|
14
|
+
export { default as RotateControl } from './control-panel/transform-controls/RotateControl';
|
|
15
|
+
export { default as TransformControlPanel } from './control-panel/transform-controls/TransformControlPanel';
|
|
16
|
+
export { default as DOMEventDispatcher } from './event/DOMEventDispatcher';
|
|
17
|
+
export { default as DOMEventInterceptor } from './event/DOMEventInterceptor';
|
|
18
|
+
export { default as EventBus } from './event/EventBus';
|
|
19
|
+
export { default as ICEEventTarget } from './event/ICEEventTarget';
|
|
20
|
+
export { default as GeoLine } from './geometry/GeoLine';
|
|
21
|
+
export { default as GeoPoint } from './geometry/GeoPoint';
|
|
22
|
+
export { default as GeoUtil } from './geometry/GeoUtil';
|
|
23
|
+
export { default as ICEBoundingBox } from './geometry/ICEBoundingBox';
|
|
24
|
+
export { default as ICEGroup } from './graphic/container/ICEGroup';
|
|
25
|
+
export { default as ICEComponent } from './graphic/ICEComponent';
|
|
26
|
+
export { default as ICEDotPath } from './graphic/ICEDotPath';
|
|
27
|
+
export { default as ICEImage } from './graphic/ICEImage';
|
|
28
|
+
export { default as ICEPath } from './graphic/ICEPath';
|
|
29
|
+
export { default as ICEBezier } from './graphic/link/ICEBezier';
|
|
30
|
+
export { default as ICELinkHook } from './graphic/link/ICELinkHook';
|
|
31
|
+
export { default as ICELinkSlot } from './graphic/link/ICELinkSlot';
|
|
32
|
+
export { default as ICEPolyLine } from './graphic/link/ICEPolyLine';
|
|
33
|
+
export { default as ICEVisioLink } from './graphic/link/ICEVisioLink';
|
|
34
|
+
export { default as ICECircle } from './graphic/shape/ICECircle';
|
|
35
|
+
export { default as ICEEllipse } from './graphic/shape/ICEEllipse';
|
|
36
|
+
export { default as ICEIsogon } from './graphic/shape/ICEIsogon';
|
|
37
|
+
export { default as ICERect } from './graphic/shape/ICERect';
|
|
38
|
+
export { default as ICERose } from './graphic/shape/ICERose';
|
|
39
|
+
export { default as ICEStar } from './graphic/shape/ICEStar';
|
|
40
|
+
export { default as ICEText } from './graphic/text/ICEText';
|
|
41
|
+
export { default as ICELayoutManager } from './layout/ICELayoutManager';
|
|
42
|
+
export { default as ICEFlowLayout } from './layout/ICEFlowLayout';
|
|
43
|
+
export { default as ICEGridLayout } from './layout/ICEGridLayout';
|
|
44
|
+
export { default as ICEBorderLayout } from './layout/ICEBorderLayout';
|
|
45
|
+
export { default as ICEBoxLayout } from './layout/ICEBoxLayout';
|
|
46
|
+
export { default as ICECardLayout } from './layout/ICECardLayout';
|
|
47
|
+
export { default as ICEOverlayLayout } from './layout/ICEOverlayLayout';
|
|
48
|
+
export { default as ICELayeredLayout } from './layout/ICELayeredLayout';
|
|
49
|
+
export { default as ICETheme, baseTokens, DEFAULT_THEME, DARK_THEME, registerTheme, setTheme, getTheme, STYLE_PRESETS, } from './theme/ICETheme';
|
|
50
|
+
export { default as ICE } from './ICE';
|
|
51
|
+
export { default as CanvasRenderer } from './renderer/CanvasRenderer';
|
|
52
|
+
export { default as PluginHost } from './plugin/PluginHost';
|
|
53
|
+
export type { ICEPlugin, ICEPluginTool, ICERenderHook, ICERenderFrame } from './plugin/PluginHost';
|
|
54
|
+
export { buildAccessibilityTree } from './a11y/accessibility';
|
|
55
|
+
export type { ICEAccessibleNode, ICEAccessibleRole, ICEAccessibilityOptions } from './a11y/accessibility';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type ICEGroup from '../graphic/container/ICEGroup.mjs';
|
|
9
|
+
import ICELayoutManager from './ICELayoutManager.mjs';
|
|
10
|
+
/**
|
|
11
|
+
* @class ICEBorderLayout 五区域布局
|
|
12
|
+
*
|
|
13
|
+
* 对齐 Java Swing 的 BorderLayout:把容器分成五个区域——north(上)/south(下)/east(右)/west(左)/center(中)。
|
|
14
|
+
* 子组件通过 state.layoutConstraint 指定所属区域(默认 'center'):
|
|
15
|
+
*
|
|
16
|
+
* ```
|
|
17
|
+
* new ICERect({ layoutConstraint: 'north', ... }) // 顶部
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* 规则:north/south 占满整宽、高度取自身;east/west 占左右剩余高度;center 填充中间剩余区域。
|
|
21
|
+
*
|
|
22
|
+
* @author 大漠穷秋<damoqiongqiu@126.com>
|
|
23
|
+
*/
|
|
24
|
+
declare class ICEBorderLayout extends ICELayoutManager {
|
|
25
|
+
private gap;
|
|
26
|
+
constructor(props?: {
|
|
27
|
+
gap?: number;
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* @overwrite
|
|
31
|
+
*/
|
|
32
|
+
layoutContainer(container: ICEGroup): void;
|
|
33
|
+
}
|
|
34
|
+
export default ICEBorderLayout;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type ICEGroup from '../graphic/container/ICEGroup';
|
|
9
|
+
import ICELayoutManager from './ICELayoutManager';
|
|
10
|
+
/**
|
|
11
|
+
* @class ICEBorderLayout 五区域布局
|
|
12
|
+
*
|
|
13
|
+
* 对齐 Java Swing 的 BorderLayout:把容器分成五个区域——north(上)/south(下)/east(右)/west(左)/center(中)。
|
|
14
|
+
* 子组件通过 state.layoutConstraint 指定所属区域(默认 'center'):
|
|
15
|
+
*
|
|
16
|
+
* ```
|
|
17
|
+
* new ICERect({ layoutConstraint: 'north', ... }) // 顶部
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* 规则:north/south 占满整宽、高度取自身;east/west 占左右剩余高度;center 填充中间剩余区域。
|
|
21
|
+
*
|
|
22
|
+
* @author 大漠穷秋<damoqiongqiu@126.com>
|
|
23
|
+
*/
|
|
24
|
+
declare class ICEBorderLayout extends ICELayoutManager {
|
|
25
|
+
private gap;
|
|
26
|
+
constructor(props?: {
|
|
27
|
+
gap?: number;
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* @overwrite
|
|
31
|
+
*/
|
|
32
|
+
layoutContainer(container: ICEGroup): void;
|
|
33
|
+
}
|
|
34
|
+
export default ICEBorderLayout;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type ICEGroup from '../graphic/container/ICEGroup.mjs';
|
|
9
|
+
import ICELayoutManager from './ICELayoutManager.mjs';
|
|
10
|
+
/**
|
|
11
|
+
* @class ICEBoxLayout 箱式布局
|
|
12
|
+
*
|
|
13
|
+
* 对齐 Java Swing 的 BoxLayout:子组件沿单轴(横向 x / 纵向 y)依次排列,不换行。
|
|
14
|
+
*
|
|
15
|
+
* @author 大漠穷秋<damoqiongqiu@126.com>
|
|
16
|
+
*/
|
|
17
|
+
declare class ICEBoxLayout extends ICELayoutManager {
|
|
18
|
+
private axis;
|
|
19
|
+
private gap;
|
|
20
|
+
constructor(props?: {
|
|
21
|
+
axis?: 'x' | 'y';
|
|
22
|
+
gap?: number;
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* @overwrite
|
|
26
|
+
* 沿单轴依次排列,横向时 left 递增,纵向时 top 递增。
|
|
27
|
+
*/
|
|
28
|
+
layoutContainer(container: ICEGroup): void;
|
|
29
|
+
}
|
|
30
|
+
export default ICEBoxLayout;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type ICEGroup from '../graphic/container/ICEGroup';
|
|
9
|
+
import ICELayoutManager from './ICELayoutManager';
|
|
10
|
+
/**
|
|
11
|
+
* @class ICEBoxLayout 箱式布局
|
|
12
|
+
*
|
|
13
|
+
* 对齐 Java Swing 的 BoxLayout:子组件沿单轴(横向 x / 纵向 y)依次排列,不换行。
|
|
14
|
+
*
|
|
15
|
+
* @author 大漠穷秋<damoqiongqiu@126.com>
|
|
16
|
+
*/
|
|
17
|
+
declare class ICEBoxLayout extends ICELayoutManager {
|
|
18
|
+
private axis;
|
|
19
|
+
private gap;
|
|
20
|
+
constructor(props?: {
|
|
21
|
+
axis?: 'x' | 'y';
|
|
22
|
+
gap?: number;
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* @overwrite
|
|
26
|
+
* 沿单轴依次排列,横向时 left 递增,纵向时 top 递增。
|
|
27
|
+
*/
|
|
28
|
+
layoutContainer(container: ICEGroup): void;
|
|
29
|
+
}
|
|
30
|
+
export default ICEBoxLayout;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type ICEGroup from '../graphic/container/ICEGroup.mjs';
|
|
9
|
+
import ICELayoutManager from './ICELayoutManager.mjs';
|
|
10
|
+
/**
|
|
11
|
+
* @class ICECardLayout 卡片布局
|
|
12
|
+
*
|
|
13
|
+
* 对齐 Java Swing 的 CardLayout:一次只显示一个子组件(卡片),其余隐藏。
|
|
14
|
+
* 通过 show(index) / next() / previous() 切换当前显示的卡片。
|
|
15
|
+
*
|
|
16
|
+
* @author 大漠穷秋<damoqiongqiu@126.com>
|
|
17
|
+
*/
|
|
18
|
+
declare class ICECardLayout extends ICELayoutManager {
|
|
19
|
+
private currentIndex;
|
|
20
|
+
private container;
|
|
21
|
+
constructor(props?: {
|
|
22
|
+
currentIndex?: number;
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* @overwrite
|
|
26
|
+
* 只显示当前卡片(display=true),其余隐藏(display=false),当前卡片对齐到左上角。
|
|
27
|
+
*/
|
|
28
|
+
layoutContainer(container: ICEGroup): void;
|
|
29
|
+
/**
|
|
30
|
+
* 切换到指定卡片。
|
|
31
|
+
*/
|
|
32
|
+
show(index: number): void;
|
|
33
|
+
next(): void;
|
|
34
|
+
previous(): void;
|
|
35
|
+
}
|
|
36
|
+
export default ICECardLayout;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type ICEGroup from '../graphic/container/ICEGroup';
|
|
9
|
+
import ICELayoutManager from './ICELayoutManager';
|
|
10
|
+
/**
|
|
11
|
+
* @class ICECardLayout 卡片布局
|
|
12
|
+
*
|
|
13
|
+
* 对齐 Java Swing 的 CardLayout:一次只显示一个子组件(卡片),其余隐藏。
|
|
14
|
+
* 通过 show(index) / next() / previous() 切换当前显示的卡片。
|
|
15
|
+
*
|
|
16
|
+
* @author 大漠穷秋<damoqiongqiu@126.com>
|
|
17
|
+
*/
|
|
18
|
+
declare class ICECardLayout extends ICELayoutManager {
|
|
19
|
+
private currentIndex;
|
|
20
|
+
private container;
|
|
21
|
+
constructor(props?: {
|
|
22
|
+
currentIndex?: number;
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* @overwrite
|
|
26
|
+
* 只显示当前卡片(display=true),其余隐藏(display=false),当前卡片对齐到左上角。
|
|
27
|
+
*/
|
|
28
|
+
layoutContainer(container: ICEGroup): void;
|
|
29
|
+
/**
|
|
30
|
+
* 切换到指定卡片。
|
|
31
|
+
*/
|
|
32
|
+
show(index: number): void;
|
|
33
|
+
next(): void;
|
|
34
|
+
previous(): void;
|
|
35
|
+
}
|
|
36
|
+
export default ICECardLayout;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type ICEGroup from '../graphic/container/ICEGroup.mjs';
|
|
9
|
+
import ICELayoutManager from './ICELayoutManager.mjs';
|
|
10
|
+
/**
|
|
11
|
+
* @class ICEFlowLayout 流式布局
|
|
12
|
+
*
|
|
13
|
+
* 对齐 Java Swing 的 FlowLayout:子组件从左到右依次排列,一行放不下(超出容器宽度)则换行。
|
|
14
|
+
* 支持 left / center / right 三种对齐,以及 gap 间距。
|
|
15
|
+
*
|
|
16
|
+
* @author 大漠穷秋<damoqiongqiu@126.com>
|
|
17
|
+
*/
|
|
18
|
+
declare class ICEFlowLayout extends ICELayoutManager {
|
|
19
|
+
private gap;
|
|
20
|
+
private align;
|
|
21
|
+
constructor(props?: {
|
|
22
|
+
gap?: number;
|
|
23
|
+
align?: 'left' | 'center' | 'right';
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* @overwrite
|
|
27
|
+
* 从左到右排列子组件,超出容器宽度则换行。
|
|
28
|
+
*/
|
|
29
|
+
layoutContainer(container: ICEGroup): void;
|
|
30
|
+
}
|
|
31
|
+
export default ICEFlowLayout;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type ICEGroup from '../graphic/container/ICEGroup';
|
|
9
|
+
import ICELayoutManager from './ICELayoutManager';
|
|
10
|
+
/**
|
|
11
|
+
* @class ICEFlowLayout 流式布局
|
|
12
|
+
*
|
|
13
|
+
* 对齐 Java Swing 的 FlowLayout:子组件从左到右依次排列,一行放不下(超出容器宽度)则换行。
|
|
14
|
+
* 支持 left / center / right 三种对齐,以及 gap 间距。
|
|
15
|
+
*
|
|
16
|
+
* @author 大漠穷秋<damoqiongqiu@126.com>
|
|
17
|
+
*/
|
|
18
|
+
declare class ICEFlowLayout extends ICELayoutManager {
|
|
19
|
+
private gap;
|
|
20
|
+
private align;
|
|
21
|
+
constructor(props?: {
|
|
22
|
+
gap?: number;
|
|
23
|
+
align?: 'left' | 'center' | 'right';
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* @overwrite
|
|
27
|
+
* 从左到右排列子组件,超出容器宽度则换行。
|
|
28
|
+
*/
|
|
29
|
+
layoutContainer(container: ICEGroup): void;
|
|
30
|
+
}
|
|
31
|
+
export default ICEFlowLayout;
|