@shijiu/jsview 1.9.731 → 1.9.759

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.
Files changed (124) hide show
  1. package/dom/jsv-browser-debug-dom.js +12 -5
  2. package/dom/jsv-code-debug.mjs +14 -0
  3. package/dom/jsv-dom.js +12 -5
  4. package/dom/jsv-engine-js-browser.js +12 -5
  5. package/dom/jsv-forge-define.js +17 -5
  6. package/package.json +14 -17
  7. package/patches/node_modules/react-scripts/config/paths.js +161 -0
  8. package/patches/node_modules/react-scripts/config/webpack.config.js +825 -0
  9. package/patches/node_modules/react-scripts/package.json +108 -0
  10. package/patches/node_modules/vite/dist/node/chunks/dep-0fc8e132.js +8 -1
  11. package/patches/node_modules/vite/dist/node/jsview.vite.config.js +15 -7
  12. package/tools/common.js +7 -2
  13. package/tools/jsview-post-build.js +3 -3
  14. package/tools/jsview-post-install-react.js +1 -3
  15. package/tools/jsview-post-install.js +1 -1
  16. package/dom/jsview-dom/README.md +0 -5
  17. package/dom/jsview-dom/package-lock.json-perfect +0 -3898
  18. package/dom/jsview-dom/package.json +0 -23
  19. package/dom/jsview-dom/rollup/browser-debug-dom.rollup.config.js +0 -15
  20. package/dom/jsview-dom/rollup/dom.rollup.config.js +0 -14
  21. package/dom/jsview-dom/rollup/engine-js-browser.rollup.config.js +0 -14
  22. package/dom/jsview-dom/rollup/forge-define.rollup.config.js +0 -14
  23. package/dom/jsview-dom/scripts/release_dist.sh +0 -36
  24. package/dom/jsview-dom/src/dom-browser-hook/HookDocument.js +0 -118
  25. package/dom/jsview-dom/src/dom-browser-hook/OriginDocument.js +0 -19
  26. package/dom/jsview-dom/src/dom-browser-hook/StyleFormatCheck.js +0 -559
  27. package/dom/jsview-dom/src/dom-browser-hook/index.js +0 -6
  28. package/dom/jsview-dom/src/dom-wrapper/ForgeExtension.js +0 -226
  29. package/dom/jsview-dom/src/dom-wrapper/JsViewForgeApp.js +0 -85
  30. package/dom/jsview-dom/src/dom-wrapper/JsViewProxy.js +0 -51
  31. package/dom/jsview-dom/src/dom-wrapper/event/AnimationEvent.js +0 -7
  32. package/dom/jsview-dom/src/dom-wrapper/event/Event.js +0 -12
  33. package/dom/jsview-dom/src/dom-wrapper/event/FocusEvent.js +0 -9
  34. package/dom/jsview-dom/src/dom-wrapper/event/KeyboardEvent.js +0 -43
  35. package/dom/jsview-dom/src/dom-wrapper/event/LoadEvent.js +0 -8
  36. package/dom/jsview-dom/src/dom-wrapper/index.js +0 -16
  37. package/dom/jsview-dom/src/dom-wrapper/node/AnchorElement.js +0 -24
  38. package/dom/jsview-dom/src/dom-wrapper/node/AudioElement.js +0 -60
  39. package/dom/jsview-dom/src/dom-wrapper/node/Comment.js +0 -10
  40. package/dom/jsview-dom/src/dom-wrapper/node/DivElement.js +0 -498
  41. package/dom/jsview-dom/src/dom-wrapper/node/Document.js +0 -274
  42. package/dom/jsview-dom/src/dom-wrapper/node/Element.js +0 -852
  43. package/dom/jsview-dom/src/dom-wrapper/node/FDivElement.js +0 -48
  44. package/dom/jsview-dom/src/dom-wrapper/node/HeadElement.js +0 -47
  45. package/dom/jsview-dom/src/dom-wrapper/node/ImageElement.js +0 -203
  46. package/dom/jsview-dom/src/dom-wrapper/node/JsvAudioTrackElement.js +0 -22
  47. package/dom/jsview-dom/src/dom-wrapper/node/JsvElement.js +0 -40
  48. package/dom/jsview-dom/src/dom-wrapper/node/LinkElement.js +0 -48
  49. package/dom/jsview-dom/src/dom-wrapper/node/MediaElement.js +0 -230
  50. package/dom/jsview-dom/src/dom-wrapper/node/Node.js +0 -178
  51. package/dom/jsview-dom/src/dom-wrapper/node/SVGElement.js +0 -9
  52. package/dom/jsview-dom/src/dom-wrapper/node/ScriptElement.js +0 -45
  53. package/dom/jsview-dom/src/dom-wrapper/node/StyleElement.js +0 -33
  54. package/dom/jsview-dom/src/dom-wrapper/node/StyleElementCache.js +0 -41
  55. package/dom/jsview-dom/src/dom-wrapper/node/Text.js +0 -22
  56. package/dom/jsview-dom/src/dom-wrapper/node/UnknownElement.js +0 -4
  57. package/dom/jsview-dom/src/dom-wrapper/node/VideoElement.js +0 -237
  58. package/dom/jsview-dom/src/dom-wrapper/style/BorderImage.js +0 -25
  59. package/dom/jsview-dom/src/dom-wrapper/style/Inset.js +0 -26
  60. package/dom/jsview-dom/src/dom-wrapper/style/JsvStyleVariable.js +0 -65
  61. package/dom/jsview-dom/src/dom-wrapper/style/KeyframeRule.js +0 -11
  62. package/dom/jsview-dom/src/dom-wrapper/style/StyleDeclaration.js +0 -609
  63. package/dom/jsview-dom/src/dom-wrapper/style/StyleSheet.js +0 -51
  64. package/dom/jsview-dom/src/dom-wrapper/style/StyleValue.js +0 -385
  65. package/dom/jsview-dom/src/dom-wrapper/style/TextStylePackMap.js +0 -43
  66. package/dom/jsview-dom/src/dom-wrapper/style/URL.js +0 -144
  67. package/dom/jsview-dom/src/dom-wrapper/utils/EventHandler.js +0 -42
  68. package/dom/jsview-dom/src/dom-wrapper/utils/FDivRoot.js +0 -86
  69. package/dom/jsview-dom/src/dom-wrapper/utils/JsvLazySyncCache.js +0 -64
  70. package/dom/jsview-dom/src/dom-wrapper/utils/Log.js +0 -42
  71. package/dom/jsview-dom/src/dom-wrapper/utils/MutationObserver.js +0 -32
  72. package/dom/jsview-dom/src/dom-wrapper/utils/focusableNode.js +0 -715
  73. package/dom/jsview-dom/src/engine-js/ForgeDefine.js +0 -8
  74. package/dom/jsview-dom/src/engine-js/ForgeExtensionDefine.js +0 -14
  75. package/dom/jsview-dom/src/engine-js/browser/PlatformUtils.js +0 -100
  76. package/dom/jsview-dom/src/engine-js/browser/animation_base.js +0 -313
  77. package/dom/jsview-dom/src/engine-js/browser/animation_keyframe.js +0 -64
  78. package/dom/jsview-dom/src/engine-js/browser/animation_progress.js +0 -287
  79. package/dom/jsview-dom/src/engine-js/browser/animation_proxy.js +0 -906
  80. package/dom/jsview-dom/src/engine-js/browser/apic_decoder/demux.js +0 -143
  81. package/dom/jsview-dom/src/engine-js/browser/apic_decoder/gifDecoder.js +0 -12
  82. package/dom/jsview-dom/src/engine-js/browser/apic_decoder/libwebp-0.6.0.min.js +0 -160
  83. package/dom/jsview-dom/src/engine-js/browser/console_log.js +0 -25
  84. package/dom/jsview-dom/src/engine-js/browser/dynamic_key_frames.js +0 -95
  85. package/dom/jsview-dom/src/engine-js/browser/easing.js +0 -114
  86. package/dom/jsview-dom/src/engine-js/browser/html_shared_tools/element_transform.js +0 -122
  87. package/dom/jsview-dom/src/engine-js/browser/html_shared_tools/gjk.js +0 -450
  88. package/dom/jsview-dom/src/engine-js/browser/html_shared_tools/mat.js +0 -102
  89. package/dom/jsview-dom/src/engine-js/browser/html_shared_tools/range_model.js +0 -296
  90. package/dom/jsview-dom/src/engine-js/browser/html_shared_tools/test_collide.js +0 -10
  91. package/dom/jsview-dom/src/engine-js/browser/index.js +0 -38
  92. package/dom/jsview-dom/src/engine-js/browser/latex_parse.js +0 -336
  93. package/dom/jsview-dom/src/engine-js/browser/layout_params.js +0 -113
  94. package/dom/jsview-dom/src/engine-js/browser/layout_view.js +0 -3545
  95. package/dom/jsview-dom/src/engine-js/browser/layout_view_debug.js +0 -15
  96. package/dom/jsview-dom/src/engine-js/browser/media.js +0 -379
  97. package/dom/jsview-dom/src/engine-js/browser/page_base.js +0 -941
  98. package/dom/jsview-dom/src/engine-js/browser/particle_view.js +0 -526
  99. package/dom/jsview-dom/src/engine-js/browser/platform_timer.js +0 -61
  100. package/dom/jsview-dom/src/engine-js/browser/react_utils.js +0 -5
  101. package/dom/jsview-dom/src/engine-js/browser/rect_utils.js +0 -91
  102. package/dom/jsview-dom/src/engine-js/browser/render_bridge.js +0 -128
  103. package/dom/jsview-dom/src/engine-js/browser/render_texture_proxy.js +0 -155
  104. package/dom/jsview-dom/src/engine-js/browser/renderer_deprecated.js +0 -75
  105. package/dom/jsview-dom/src/engine-js/browser/sound_pool.js +0 -139
  106. package/dom/jsview-dom/src/engine-js/browser/steps_animation.js +0 -192
  107. package/dom/jsview-dom/src/engine-js/browser/text_style_cache.js +0 -454
  108. package/dom/jsview-dom/src/engine-js/browser/text_utils.js +0 -299
  109. package/dom/jsview-dom/src/engine-js/browser/text_view.js +0 -428
  110. package/dom/jsview-dom/src/engine-js/browser/texture_manager.js +0 -1060
  111. package/dom/jsview-dom/src/engine-js/browser/url.js +0 -69
  112. package/dom/jsview-dom/src/engine-js/browser/velocity.js +0 -40
  113. package/dom/jsview-dom/src/engine-js/browser/view_sensor/autofroze_sensor.js +0 -77
  114. package/dom/jsview-dom/src/engine-js/browser/view_sensor/drag_impact_sensor.js +0 -67
  115. package/dom/jsview-dom/src/engine-js/browser/view_sensor/impact_sensor.js +0 -98
  116. package/dom/jsview-dom/src/engine-js/browser/view_sensor/impact_sensor_callback.js +0 -21
  117. package/dom/jsview-dom/src/engine-js/browser/view_sensor/impact_sensor_manager.js +0 -24
  118. package/dom/jsview-dom/src/engine-js/browser/view_sensor/index.js +0 -9
  119. package/dom/jsview-dom/src/engine-js/browser/view_sensor/view_sensor.js +0 -268
  120. package/dom/jsview-dom/src/engine-js/browser/view_sensor/view_sensor_manager.js +0 -84
  121. package/dom/jsview-dom/src/engine-js/browser/view_sensor/visible_sensor.js +0 -213
  122. package/dom/jsview-dom/src/engine-js/browser/view_store.js +0 -41
  123. package/dom/jsview-dom/src/engine-js/index.js +0 -2
  124. package/dom/jsview-dom/src/engine-js/native/README.md +0 -1
@@ -1,14 +0,0 @@
1
- /**
2
- * Created by luocf on 2020/1/17.
3
- */
4
-
5
- /* eslint-disable no-extra-boolean-cast */
6
- var ForgeExtension = {}
7
- if (!!window.JsView) {
8
- if (!(window.JsView.Dom&&window.JsView.Dom.Extension)) {
9
- window.JsView.Dom.Extension = ForgeExtension
10
- }
11
- ForgeExtension = window.JsView.Dom.Extension
12
- }
13
-
14
- export default ForgeExtension
@@ -1,100 +0,0 @@
1
- /* eslint-disable no-unused-vars */
2
- class PlatformUtils {
3
- static getTextPixelWith(text, fontStyle) {
4
- if (PlatformUtils.sCanvas === null) {
5
- PlatformUtils.sCanvas = window.originDocument.createElement("canvas"); // 创建 canvas 画布
6
- }
7
-
8
- const context = PlatformUtils.sCanvas.getContext("2d"); // 获取 canvas 绘图上下文环境
9
- context.font = fontStyle; // 设置字体样式,使用前设置好对应的 font 样式才能准确获取文字的像素长度
10
- const dimension = context.measureText(text); // 测量文字
11
- return Math.ceil(dimension.width);
12
- }
13
-
14
- static GetTextWidth(font_params) {
15
- let bold = "";
16
- if (font_params.bold) {
17
- bold = "bold";
18
- }
19
- let italic = "";
20
- if (font_params.italic) {
21
- italic = "italic";
22
- }
23
- return this.getTextPixelWith(font_params.str, `${bold} ${italic} ${font_params.size}px ${font_params.font}`);
24
- }
25
-
26
- static GetTextRect(str, max_rect, font_params, text_attr, line_height) {
27
- const rows = Math.ceil((font_params.size * str.length) / max_rect.width);
28
- let height = rows * line_height;
29
- if (height > max_rect.height) {
30
- height = max_rect.height;
31
- }
32
- const ret_json = {
33
- width: max_rect.width,
34
- height
35
- };
36
- return ret_json;
37
- }
38
-
39
- static GetCursorOffset(str, max_rect, font_params, text_attr, line_height, pos_x, pos_y) {
40
- // TODO 目前只考虑单行
41
- let bold = "";
42
- if (font_params.bold) {
43
- bold = "bold";
44
- }
45
- let italic = "";
46
- if (font_params.italic) {
47
- italic = "italic";
48
- }
49
- let cursor_offset = 0;
50
- if (font_params.alignment === "right") {
51
- const width = this.getTextPixelWith(str, `${bold} ${italic} ${font_params.size}px ${font_params.font}`);
52
- pos_x -= (max_rect.width - width);
53
- if (pos_x < 0) {
54
- pos_x = 0;
55
- }
56
- }
57
-
58
- let sub_width = 0;
59
- while (pos_x >= sub_width) {
60
- if (cursor_offset === str.length) {
61
- break;
62
- }
63
- sub_width = this.getTextPixelWith(str.substr(0, cursor_offset + 1), `${bold} ${italic} ${font_params.size}px ${font_params.font}`);
64
- if (pos_x >= sub_width) {
65
- cursor_offset++;
66
- }
67
- }
68
-
69
- return cursor_offset;
70
- }
71
-
72
- static GetCursorPosition(str, max_rect, font_params, text_attr, line_height, cursor_offset) {
73
- // TODO 目前只考虑单行
74
- let bold = "";
75
- if (font_params.bold) {
76
- bold = "bold";
77
- }
78
- let italic = "";
79
- if (font_params.italic) {
80
- italic = "italic";
81
- }
82
-
83
- let width = 0;
84
- let sub_str = str;
85
- if (cursor_offset < str.length) {
86
- sub_str = sub_str.substr(0, cursor_offset);
87
- }
88
-
89
- width = this.getTextPixelWith(sub_str, `${bold} ${italic} ${font_params.size}px ${font_params.font}`);
90
- if (font_params.alignment === "right") {
91
- // 总长度
92
- const total_width = this.getTextPixelWith(str, `${bold} ${italic} ${font_params.size}px ${font_params.font}`);
93
- width = max_rect.width - total_width + width;
94
- }
95
-
96
- return { x: width, y: 0 };
97
- }
98
- }
99
- PlatformUtils.sCanvas = null;
100
- window.PlatformUtils = PlatformUtils;
@@ -1,313 +0,0 @@
1
- /* eslint-disable no-unused-vars */
2
- import Forge from "../ForgeDefine";
3
-
4
- let sIdTokenGenerator = 0;
5
-
6
- class AnimationBase {
7
- constructor() {
8
- this.IdToken = sIdTokenGenerator++;
9
- this._AttachedGroup = null;
10
- this.AnimationListenerObj = null;
11
- this._AnimationClose = false;
12
- this._LayoutViewRef = null;
13
- this._IsTextureAnim = false;
14
- }
15
-
16
- /**
17
- * 设置动画起始/结束的监听回调
18
- *
19
- * @public
20
- * @func SetAnimationListener
21
- * @memberof Forge.AnimationBase
22
- * @instance
23
- * @param {Forge.AnimationListener} listener 动画起始/结束的监听回调
24
- * */
25
- SetAnimationListener(listener) {
26
- this.AnimationListenerObj = listener;
27
- this.OnNewListener(listener);
28
- }
29
-
30
- /**
31
- * 追加动画起始/结束的监听回调
32
- *
33
- * @public
34
- * @func AddAnimationListener
35
- * @memberof Forge.AnimationBase
36
- * @instance
37
- * @param {Forge.AnimationListener} listener 动画起始/结束的监听回调
38
- * */
39
- AddAnimationListener(listener) {
40
- if (this.AnimationListenerObj) {
41
- listener.AddInherit(this.AnimationListenerObj);
42
- }
43
-
44
- this.AnimationListenerObj = listener;
45
- this.OnNewListener(listener);
46
- }
47
-
48
- OnNewListener(listener) {
49
- // Can override if needed
50
- }
51
-
52
- /**
53
- * 获得当前动画的启动/结束监听接口
54
- *
55
- * @public
56
- * @func GetAnimationListener
57
- * @memberof Forge.AnimationBase
58
- * @instance
59
- * @return {Forge.AnimationListener} 动画起始/结束的监听回调
60
- * */
61
- GetAnimationListener() {
62
- return this.AnimationListenerObj;
63
- }
64
-
65
- // public from customer
66
- Cancel(by_other_animation) {
67
- if (this._LayoutViewRef) {
68
- this._LayoutViewRef.DetachAnimation(this);
69
- }
70
- const listener = this.AnimationListenerObj;
71
- if (listener && listener.OnAnimationEnd && !this._AnimationClose) {
72
- this._AnimationClose = true;
73
- listener.OnAnimationEnd(false);
74
- }
75
-
76
- if (this._AttachedGroup) {
77
- let cancel_whole_group = true;
78
- if (by_other_animation) {
79
- cancel_whole_group = (by_other_animation._AttachedGroup !== this._AttachedGroup);
80
- }
81
-
82
- if (cancel_whole_group) {
83
- this._AttachedGroup.CancelFromInternalAnimation(this);
84
- this._AttachedGroup = null;
85
- }
86
- }
87
- }
88
-
89
- /**
90
- * 将当前动画加入动画组
91
- * hide public
92
- *
93
- * @func AttachToGroup
94
- * @memberof Forge.AnimationBase
95
- * @instance
96
- * @param {Forge.AnimationGroup} group 要加入的动画组
97
- * */
98
- AttachToGroup(group) {
99
- if (this._AttachedGroup !== null) {
100
- Forge.ThrowError("ERROR: In TransformAnimation.AttachToGroup(), animation already attached to other group");
101
- }
102
- this._AttachedGroup = group;
103
- }
104
-
105
- /**
106
- * 从动画组脱离
107
- * hide public
108
- *
109
- * @func RemoveFromGroup
110
- * @memberof Forge.AnimationBase
111
- * @instance
112
- * */
113
- RemoveFromGroup() {
114
- this._AttachedGroup = null;
115
- }
116
-
117
- // hide public
118
- AsTextureAnimation() {
119
- this._IsTextureAnim = true;
120
- }
121
-
122
- Start(layout_view) {
123
- this._LayoutViewRef = layout_view;
124
- }
125
-
126
- SetCannotDisable(can_disable) {
127
-
128
- }
129
-
130
- // hide public
131
- OnStart() {
132
- const listener = this.AnimationListenerObj;
133
- if (listener && listener.OnAnimationStart) {
134
- listener.OnAnimationStart();
135
- }
136
- }
137
-
138
- // hide public
139
- OnEnd(keep_animation) {
140
- if (this._LayoutViewRef && !keep_animation) {
141
- this._LayoutViewRef.DetachAnimation(this);
142
- this._LayoutViewRef = null;
143
- }
144
-
145
- const listener = this.AnimationListenerObj;
146
- if (listener && listener.OnAnimationEnd && !this._AnimationClose) {
147
- this._AnimationClose = true;
148
- listener.OnAnimationEnd(true);
149
- }
150
- }
151
-
152
- // hide public
153
- OnRepeatEvent() {
154
- const listener = this.AnimationListenerObj;
155
- if (listener && listener.OnAnimRepeat) {
156
- listener.OnAnimRepeat();
157
- }
158
- }
159
-
160
- // hide public
161
- OnViewHide() {
162
- const listener = this.AnimationListenerObj;
163
- if (listener && listener.OnViewNoVisible) {
164
- listener.OnViewNoVisible();
165
- }
166
- }
167
-
168
- // hide public
169
- OnFinalProgress(progress) {
170
- const listener = this.AnimationListenerObj;
171
- if (listener && listener.OnAnimFinal) {
172
- listener.OnAnimFinal(progress);
173
- }
174
- }
175
-
176
- OnAnimAdvance(progress) {
177
- const listener = this.AnimationListenerObj;
178
- if (listener && listener.OnAnimAdvance) {
179
- listener.OnAnimAdvance(progress);
180
- }
181
- }
182
- }
183
- Forge.AnimationBase = AnimationBase;
184
-
185
- class AnimationListener {
186
- /**
187
- * 监听动画启动和结束时间的接口
188
- *
189
- * @public
190
- * @constructor Forge.AnimationListener
191
- * @author donglin donglin.lu@qcast.cn
192
- * @param {function} on_start 监听动画启动事件(无参数)
193
- * @param {function} on_end 监听动画结束事件(无参数)
194
- * @param {function} on_view_hide 当更新过程中检测到动画对应的View已经不可见的回调<br>
195
- * 需要和LayoutView.OnDrawResumed(callback)配合使用<br>
196
- * 参数(LayoutView:对象View, TransformAnimation:监听的动画句柄)
197
- * */
198
- constructor(on_start, on_end, on_view_hide) {
199
- this.OnAnimationStart = on_start;
200
- this._OnAnimationStart = on_start;
201
- this.OnAnimationEnd = on_end;
202
- this._OnAnimationEnd = on_end;
203
- this.OnViewNoVisible = on_view_hide;
204
- this._OnViewNoVisible = on_view_hide;
205
- this.OnAnimFinal = null;
206
- this._OnAnimFinal = null;
207
- this.OnAnimRepeat = null;
208
- this._OnAnimRepeat = null;
209
- this._AttachedGroup = null;
210
- this._InheritListener = [];
211
- this._OnAnimAdvance = null;
212
- this.OnAnimAdvance = null;
213
- }
214
-
215
- OnStart(on_start) {
216
- this._OnAnimationStart = on_start;
217
- this.OnAnimationStart = on_start;
218
- return this;
219
- }
220
-
221
- OnEnd(on_end) {
222
- this._OnAnimationEnd = on_end;
223
- this.OnAnimationEnd = on_end;
224
- return this;
225
- }
226
-
227
- OnAdvance(on_advance) {
228
- this._OnAnimAdvance = on_advance;
229
- this.OnAnimAdvance = on_advance;
230
- return this;
231
- }
232
-
233
- OnFinalProgress(on_final) {
234
- this._OnAnimFinal = on_final;
235
- this.OnAnimFinal = on_final;
236
- return this;
237
- }
238
-
239
- OnRepeat(on_repeat) {
240
- this._OnAnimRepeat = on_repeat;
241
- this.OnAnimRepeat = on_repeat;
242
- return this;
243
- }
244
-
245
- /**
246
- * 添加继承的监听者,当本监听接口被调用后,会继续调用继承者的监听接口
247
- *
248
- * @public
249
- * @param {Forge.AnimationListener} inherit_listener 继承的监听者
250
- * */
251
- AddInherit(inherit_listener) {
252
- if (!inherit_listener) {
253
- return;
254
- }
255
-
256
- if (this._InheritListener.length === 0) {
257
- // Init for first inherit
258
- const that = this;
259
- this.OnAnimationStart = function() {
260
- if (that._OnAnimationStart) that._OnAnimationStart();
261
- for (let i = 0; i < that._InheritListener.length; i++) {
262
- if (that._InheritListener[i].OnAnimationStart) {
263
- that._InheritListener[i].OnAnimationStart();
264
- }
265
- }
266
- };
267
- this.OnAnimationEnd = function(normal_end) {
268
- if (that._OnAnimationEnd) that._OnAnimationEnd(normal_end);
269
- for (let i = 0; i < that._InheritListener.length; i++) {
270
- if (that._InheritListener[i].OnAnimationEnd) {
271
- that._InheritListener[i].OnAnimationEnd(normal_end);
272
- }
273
- }
274
- };
275
- this.OnViewNoVisible = function() {
276
- if (that._OnViewNoVisible) that._OnViewNoVisible();
277
- for (let i = 0; i < that._InheritListener.length; i++) {
278
- if (that._InheritListener[i].OnViewNoVisible) {
279
- that._InheritListener[i].OnViewNoVisible();
280
- }
281
- }
282
- };
283
- this.OnAnimFinal = function(progress) {
284
- if (that._OnAnimFinal) that._OnAnimFinal(progress);
285
- for (let i = 0; i < that._InheritListener.length; i++) {
286
- if (that._InheritListener[i].OnAnimFinal) {
287
- that._InheritListener[i].OnAnimFinal(progress);
288
- }
289
- }
290
- };
291
- this.OnAnimRepeat = function() {
292
- if (that._OnAnimRepeat) that._OnAnimRepeat();
293
- for (let i = 0; i < that._InheritListener.length; i++) {
294
- if (that._InheritListener[i].OnAnimRepeat) {
295
- that._InheritListener[i].OnAnimRepeat();
296
- }
297
- }
298
- };
299
-
300
- this.OnAnimAdvance = function() {
301
- if (that._OnAnimAdvance) that._OnAnimAdvance();
302
- for (let i = 0; i < that._InheritListener.length; i++) {
303
- if (that._InheritListener[i].OnAnimAdvance) {
304
- that._InheritListener[i].OnAnimAdvance();
305
- }
306
- }
307
- };
308
- }
309
-
310
- this._InheritListener.push(inherit_listener);
311
- }
312
- }
313
- Forge.AnimationListener = AnimationListener;
@@ -1,64 +0,0 @@
1
- /**
2
- * Created by ludl on 6/11/20.
3
- */
4
- // 工具类,用于将Animation配置转换成KeyFrame
5
- import Forge from "../ForgeDefine";
6
- import { getKeyFramesGroup } from "./dynamic_key_frames";
7
-
8
- let sKeyFrameControl = null;
9
- function getStaticFrameControl() {
10
- if (sKeyFrameControl === null) {
11
- sKeyFrameControl = getKeyFramesGroup();
12
- }
13
- return sKeyFrameControl;
14
- }
15
-
16
- function _ConvertTimingFunc(easing_info) {
17
- let timing_function = "linear";
18
- if (easing_info && typeof easing_info.T !== "undefined") {
19
- switch (easing_info.T) {
20
- case Forge.EasingTypeIn:
21
- timing_function = "ease-in";
22
- break;
23
- case Forge.EasingTypeOut:
24
- timing_function = "ease-out";
25
- break;
26
- case Forge.EasingTypeInOut:
27
- timing_function = "ease-in-out";
28
- break;
29
- case Forge.EasingTypeBezier:
30
- timing_function = `cubic-bezier(${easing_info.St.X1},${easing_info.St.Y1},${easing_info.St.X2},${easing_info.St.Y2})`;
31
- break;
32
- case Forge.EasingTypeSteps:
33
- timing_function = `steps(${easing_info.St.S},${easing_info.St.T === 0 ? "start" : "end"})`;
34
- break;
35
- case Forge.EasingTypeBlink:
36
- case Forge.EasingTypeDeceleration:
37
- default:
38
- break;
39
- }
40
- }
41
- return timing_function;
42
- }
43
-
44
- // 将Forge.AnimationDelegate信息转化成style.animation的填写内容
45
- function animationToStyle(animation_ref, keyframe_name) {
46
- const repeat = (animation_ref.repeatTimes === -1 ? "infinite" : animation_ref.repeatTimes);
47
- let timing_func = "linear";
48
- if (animation_ref.easing) {
49
- timing_func = _ConvertTimingFunc(animation_ref.easing);
50
- }
51
-
52
- const style_animation = `${keyframe_name} ${animation_ref.duration / 1000}s ${
53
- timing_func} ${animation_ref.delayedTime / 1000}s ${
54
- repeat}`;
55
- // console.log(`animationToStyle style_anim:${style_animation}`);
56
-
57
- return style_animation;
58
- }
59
-
60
- export {
61
- getStaticFrameControl,
62
- animationToStyle,
63
- _ConvertTimingFunc as convertTimingFunc,
64
- };