@visactor/vrender-core 1.1.0-alpha.24 → 1.1.0-alpha.25
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/cjs/allocator/bounds-allocate.js +1 -2
- package/cjs/canvas/constants.js +2 -1
- package/cjs/common/bezier-utils.js +1 -2
- package/cjs/common/event-transformer.js +2 -1
- package/cjs/common/performance-raf.js +1 -2
- package/cjs/common/polygon.js +2 -2
- package/cjs/common/rect-utils.js +1 -1
- package/cjs/common/render-area.js +1 -1
- package/cjs/common/render-command-list.js +1 -1
- package/cjs/common/render-curve.js +1 -1
- package/cjs/common/render-utils.js +1 -1
- package/cjs/common/seg-context.js +1 -1
- package/cjs/container.d.ts +2 -0
- package/cjs/container.js +50 -0
- package/cjs/container.js.map +1 -0
- package/cjs/core/application.js +1 -1
- package/cjs/core/camera.js +1 -1
- package/cjs/core/constants.js +1 -1
- package/cjs/core/core-modules.js +1 -1
- package/cjs/core/global-module.js +2 -0
- package/cjs/core/global.js +1 -1
- package/cjs/core/graphic-utils.js +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/layer-service.js +2 -1
- package/cjs/core/layer.js +1 -1
- package/cjs/core/light.js +1 -1
- package/cjs/core/stage.d.ts +0 -9
- package/cjs/core/stage.js +12 -30
- package/cjs/core/stage.js.map +1 -1
- package/cjs/core/window.js +1 -1
- package/cjs/entries/miniapp.d.ts +0 -1
- package/cjs/entries/miniapp.js +1 -5
- package/cjs/entries/miniapp.js.map +1 -1
- package/cjs/entries/node.d.ts +0 -1
- package/cjs/entries/node.js +1 -5
- package/cjs/entries/node.js.map +1 -1
- package/cjs/env.d.ts +1 -0
- package/cjs/env.js +25 -0
- package/cjs/env.js.map +1 -0
- package/cjs/event/public-constant.d.ts +7 -0
- package/cjs/event/public-constant.js +100 -0
- package/cjs/event/public-constant.js.map +1 -0
- package/cjs/event/util.d.ts +1 -1
- package/cjs/graphic/base.d.ts +2 -0
- package/cjs/graphic/base.js +15 -0
- package/cjs/graphic/base.js.map +1 -0
- package/cjs/graphic/creator.d.ts +16 -0
- package/cjs/graphic/creator.js +160 -0
- package/cjs/graphic/creator.js.map +1 -0
- package/cjs/graphic/glyph.js +4 -8
- package/cjs/graphic/glyph.js.map +1 -1
- package/cjs/graphic/graphic.d.ts +19 -29
- package/cjs/graphic/graphic.js +121 -199
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/graphic/group.d.ts +1 -3
- package/cjs/graphic/group.js +22 -28
- package/cjs/graphic/group.js.map +1 -1
- package/cjs/graphic/modules.d.ts +16 -0
- package/cjs/graphic/modules.js +150 -0
- package/cjs/graphic/modules.js.map +1 -0
- package/cjs/graphic/node-tree.d.ts +3 -3
- package/cjs/graphic/node-tree.js +1 -0
- package/cjs/graphic/node-tree.js.map +1 -1
- package/cjs/graphic/state/shared-state-refresh.js +11 -32
- package/cjs/graphic/state/shared-state-refresh.js.map +1 -1
- package/cjs/graphic/state/shared-state-scope.d.ts +2 -5
- package/cjs/graphic/state/shared-state-scope.js +8 -27
- package/cjs/graphic/state/shared-state-scope.js.map +1 -1
- package/cjs/graphic/state/state-definition-compiler.js +4 -5
- package/cjs/graphic/state/state-definition-compiler.js.map +1 -1
- package/cjs/graphic/state/state-definition.d.ts +2 -5
- package/cjs/graphic/state/state-definition.js.map +1 -1
- package/cjs/graphic/state/state-engine.d.ts +0 -5
- package/cjs/graphic/state/state-engine.js +20 -70
- package/cjs/graphic/state/state-engine.js.map +1 -1
- package/cjs/graphic/state/state-transition-orchestrator.d.ts +7 -9
- package/cjs/graphic/state/state-transition-orchestrator.js +10 -13
- package/cjs/graphic/state/state-transition-orchestrator.js.map +1 -1
- package/cjs/interface/graphic/group.d.ts +0 -2
- package/cjs/interface/graphic/group.js.map +1 -1
- package/cjs/interface/graphic.d.ts +1 -5
- package/cjs/interface/graphic.js.map +1 -1
- package/cjs/interface/index.js.map +1 -1
- package/cjs/interface/node-tree.d.ts +3 -0
- package/cjs/interface/node-tree.js.map +1 -1
- package/cjs/interface/stage.d.ts +0 -7
- package/cjs/interface/stage.js.map +1 -1
- package/cjs/interpolate.d.ts +2 -0
- package/cjs/interpolate.js +34 -0
- package/cjs/interpolate.js.map +1 -0
- package/cjs/modules.js.map +1 -1
- package/cjs/path.d.ts +4 -0
- package/cjs/path.js +33 -0
- package/cjs/path.js.map +1 -0
- package/cjs/plugin/3d.d.ts +3 -0
- package/cjs/plugin/3d.js +33 -0
- package/cjs/plugin/3d.js.map +1 -0
- package/cjs/plugin/attribute.d.ts +2 -0
- package/cjs/plugin/attribute.js +24 -0
- package/cjs/plugin/attribute.js.map +1 -0
- package/cjs/plugin/flex-layout.d.ts +1 -0
- package/cjs/plugin/flex-layout.js +15 -0
- package/cjs/plugin/flex-layout.js.map +1 -0
- package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +8 -8
- package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
- package/cjs/plugins/index.d.ts +0 -4
- package/cjs/plugins/index.js +1 -3
- package/cjs/plugins/index.js.map +1 -1
- package/cjs/plugins/plugin-service.d.ts +0 -1
- package/cjs/plugins/plugin-service.js +2 -3
- package/cjs/plugins/plugin-service.js.map +1 -1
- package/cjs/plugins/types.d.ts +1 -8
- package/cjs/plugins/types.js.map +1 -1
- package/cjs/register/graphic.d.ts +19 -0
- package/cjs/register/graphic.js +177 -0
- package/cjs/register/graphic.js.map +1 -0
- package/cjs/registry/contribution-registry.d.ts +0 -1
- package/cjs/registry/contribution-registry.js +0 -3
- package/cjs/registry/contribution-registry.js.map +1 -1
- package/cjs/registry/picker-registry.d.ts +0 -1
- package/cjs/registry/picker-registry.js +0 -3
- package/cjs/registry/picker-registry.js.map +1 -1
- package/cjs/registry/renderer-registry.d.ts +0 -1
- package/cjs/registry/renderer-registry.js +0 -3
- package/cjs/registry/renderer-registry.js.map +1 -1
- package/cjs/registry/types.d.ts +0 -3
- package/cjs/registry/types.js.map +1 -1
- package/cjs/svg.d.ts +1 -0
- package/cjs/svg.js +15 -0
- package/cjs/svg.js.map +1 -0
- package/cjs/text.d.ts +2 -0
- package/cjs/text.js +29 -0
- package/cjs/text.js.map +1 -0
- package/dist/index.es.js +279 -1591
- package/es/allocator/bounds-allocate.js +1 -2
- package/es/canvas/constants.js +2 -1
- package/es/common/bezier-utils.js +1 -2
- package/es/common/event-transformer.js +2 -1
- package/es/common/performance-raf.js +1 -2
- package/es/common/polygon.js +1 -1
- package/es/common/rect-utils.js +1 -1
- package/es/common/render-area.js +1 -1
- package/es/common/render-command-list.js +1 -1
- package/es/common/render-curve.js +1 -1
- package/es/common/render-utils.js +1 -1
- package/es/common/seg-context.js +1 -1
- package/es/container.d.ts +2 -0
- package/es/container.js +2 -0
- package/es/container.js.map +1 -0
- package/es/core/application.js +1 -1
- package/es/core/camera.js +1 -1
- package/es/core/constants.js +1 -1
- package/es/core/core-modules.js +1 -1
- package/es/core/global-module.js +2 -0
- package/es/core/global.js +1 -1
- package/es/core/graphic-utils.js +1 -1
- package/es/core/index.js +1 -1
- package/es/core/layer-service.js +2 -1
- package/es/core/layer.js +1 -1
- package/es/core/light.js +1 -1
- package/es/core/stage.d.ts +0 -9
- package/es/core/stage.js +10 -31
- package/es/core/stage.js.map +1 -1
- package/es/core/window.js +1 -1
- package/es/entries/miniapp.d.ts +0 -1
- package/es/entries/miniapp.js +1 -5
- package/es/entries/miniapp.js.map +1 -1
- package/es/entries/node.d.ts +0 -1
- package/es/entries/node.js +1 -5
- package/es/entries/node.js.map +1 -1
- package/es/env.d.ts +1 -0
- package/es/env.js +2 -0
- package/es/env.js.map +1 -0
- package/es/event/public-constant.d.ts +7 -0
- package/es/event/public-constant.js +12 -0
- package/es/event/public-constant.js.map +1 -0
- package/es/event/util.d.ts +1 -1
- package/es/graphic/base.d.ts +2 -0
- package/es/graphic/base.js +2 -0
- package/es/graphic/base.js.map +1 -0
- package/es/graphic/creator.d.ts +16 -0
- package/es/graphic/creator.js +32 -0
- package/es/graphic/creator.js.map +1 -0
- package/es/graphic/glyph.js +4 -8
- package/es/graphic/glyph.js.map +1 -1
- package/es/graphic/graphic.d.ts +19 -29
- package/es/graphic/graphic.js +120 -204
- package/es/graphic/graphic.js.map +1 -1
- package/es/graphic/group.d.ts +1 -3
- package/es/graphic/group.js +22 -28
- package/es/graphic/group.js.map +1 -1
- package/es/graphic/modules.d.ts +16 -0
- package/es/graphic/modules.js +32 -0
- package/es/graphic/modules.js.map +1 -0
- package/es/graphic/node-tree.d.ts +3 -3
- package/es/graphic/node-tree.js +1 -0
- package/es/graphic/node-tree.js.map +1 -1
- package/es/graphic/state/shared-state-refresh.js +8 -28
- package/es/graphic/state/shared-state-refresh.js.map +1 -1
- package/es/graphic/state/shared-state-scope.d.ts +2 -5
- package/es/graphic/state/shared-state-scope.js +7 -28
- package/es/graphic/state/shared-state-scope.js.map +1 -1
- package/es/graphic/state/state-definition-compiler.js +4 -5
- package/es/graphic/state/state-definition-compiler.js.map +1 -1
- package/es/graphic/state/state-definition.d.ts +2 -5
- package/es/graphic/state/state-definition.js.map +1 -1
- package/es/graphic/state/state-engine.d.ts +0 -5
- package/es/graphic/state/state-engine.js +17 -67
- package/es/graphic/state/state-engine.js.map +1 -1
- package/es/graphic/state/state-transition-orchestrator.d.ts +7 -9
- package/es/graphic/state/state-transition-orchestrator.js +10 -13
- package/es/graphic/state/state-transition-orchestrator.js.map +1 -1
- package/es/interface/graphic/group.d.ts +0 -2
- package/es/interface/graphic/group.js.map +1 -1
- package/es/interface/graphic.d.ts +1 -5
- package/es/interface/graphic.js.map +1 -1
- package/es/interface/index.js.map +1 -1
- package/es/interface/node-tree.d.ts +3 -0
- package/es/interface/node-tree.js.map +1 -1
- package/es/interface/stage.d.ts +0 -7
- package/es/interface/stage.js.map +1 -1
- package/es/interpolate.d.ts +2 -0
- package/es/interpolate.js +4 -0
- package/es/interpolate.js.map +1 -0
- package/es/modules.js.map +1 -1
- package/es/path.d.ts +4 -0
- package/es/path.js +6 -0
- package/es/path.js.map +1 -0
- package/es/plugin/3d.d.ts +3 -0
- package/es/plugin/3d.js +6 -0
- package/es/plugin/3d.js.map +1 -0
- package/es/plugin/attribute.d.ts +2 -0
- package/es/plugin/attribute.js +4 -0
- package/es/plugin/attribute.js.map +1 -0
- package/es/plugin/flex-layout.d.ts +1 -0
- package/es/plugin/flex-layout.js +2 -0
- package/es/plugin/flex-layout.js.map +1 -0
- package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +8 -8
- package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
- package/es/plugins/index.d.ts +0 -4
- package/es/plugins/index.js +0 -8
- package/es/plugins/index.js.map +1 -1
- package/es/plugins/plugin-service.d.ts +0 -1
- package/es/plugins/plugin-service.js +2 -3
- package/es/plugins/plugin-service.js.map +1 -1
- package/es/plugins/types.d.ts +1 -8
- package/es/plugins/types.js.map +1 -1
- package/es/register/graphic.d.ts +19 -0
- package/es/register/graphic.js +38 -0
- package/es/register/graphic.js.map +1 -0
- package/es/registry/contribution-registry.d.ts +0 -1
- package/es/registry/contribution-registry.js +0 -3
- package/es/registry/contribution-registry.js.map +1 -1
- package/es/registry/picker-registry.d.ts +0 -1
- package/es/registry/picker-registry.js +0 -3
- package/es/registry/picker-registry.js.map +1 -1
- package/es/registry/renderer-registry.d.ts +0 -1
- package/es/registry/renderer-registry.js +0 -3
- package/es/registry/renderer-registry.js.map +1 -1
- package/es/registry/types.d.ts +0 -3
- package/es/registry/types.js.map +1 -1
- package/es/svg.d.ts +1 -0
- package/es/svg.js +2 -0
- package/es/svg.js.map +1 -0
- package/es/text.d.ts +2 -0
- package/es/text.js +4 -0
- package/es/text.js.map +1 -0
- package/package.json +247 -3
- package/cjs/graphic/state/state-batch-scheduler.d.ts +0 -42
- package/cjs/graphic/state/state-batch-scheduler.js +0 -285
- package/cjs/graphic/state/state-batch-scheduler.js.map +0 -1
- package/cjs/graphic/state/state-model.d.ts +0 -43
- package/cjs/graphic/state/state-model.js +0 -143
- package/cjs/graphic/state/state-model.js.map +0 -1
- package/cjs/graphic/state/state-perf-monitor.d.ts +0 -120
- package/cjs/graphic/state/state-perf-monitor.js +0 -224
- package/cjs/graphic/state/state-perf-monitor.js.map +0 -1
- package/cjs/graphic/state/state-style-resolver.d.ts +0 -13
- package/cjs/graphic/state/state-style-resolver.js +0 -50
- package/cjs/graphic/state/state-style-resolver.js.map +0 -1
- package/cjs/interface/animate.d.ts +0 -1
- package/cjs/interface/animate.js +0 -3
- package/cjs/interface/animate.js.map +0 -1
- package/cjs/plugins/base-plugin.d.ts +0 -8
- package/cjs/plugins/base-plugin.js +0 -15
- package/cjs/plugins/base-plugin.js.map +0 -1
- package/cjs/plugins/browser-env-plugin.d.ts +0 -8
- package/cjs/plugins/browser-env-plugin.js +0 -24
- package/cjs/plugins/browser-env-plugin.js.map +0 -1
- package/cjs/plugins/picker-plugin.d.ts +0 -7
- package/cjs/plugins/picker-plugin.js +0 -19
- package/cjs/plugins/picker-plugin.js.map +0 -1
- package/cjs/plugins/renderer-plugin.d.ts +0 -7
- package/cjs/plugins/renderer-plugin.js +0 -19
- package/cjs/plugins/renderer-plugin.js.map +0 -1
- package/es/graphic/state/state-batch-scheduler.d.ts +0 -42
- package/es/graphic/state/state-batch-scheduler.js +0 -278
- package/es/graphic/state/state-batch-scheduler.js.map +0 -1
- package/es/graphic/state/state-model.d.ts +0 -43
- package/es/graphic/state/state-model.js +0 -135
- package/es/graphic/state/state-model.js.map +0 -1
- package/es/graphic/state/state-perf-monitor.d.ts +0 -120
- package/es/graphic/state/state-perf-monitor.js +0 -214
- package/es/graphic/state/state-perf-monitor.js.map +0 -1
- package/es/graphic/state/state-style-resolver.d.ts +0 -13
- package/es/graphic/state/state-style-resolver.js +0 -42
- package/es/graphic/state/state-style-resolver.js.map +0 -1
- package/es/interface/animate.d.ts +0 -1
- package/es/interface/animate.js +0 -3
- package/es/interface/animate.js.map +0 -1
- package/es/plugins/base-plugin.d.ts +0 -8
- package/es/plugins/base-plugin.js +0 -7
- package/es/plugins/base-plugin.js.map +0 -1
- package/es/plugins/browser-env-plugin.d.ts +0 -8
- package/es/plugins/browser-env-plugin.js +0 -16
- package/es/plugins/browser-env-plugin.js.map +0 -1
- package/es/plugins/picker-plugin.d.ts +0 -7
- package/es/plugins/picker-plugin.js +0 -11
- package/es/plugins/picker-plugin.js.map +0 -1
- package/es/plugins/renderer-plugin.d.ts +0 -7
- package/es/plugins/renderer-plugin.js +0 -11
- package/es/plugins/renderer-plugin.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visactor/vrender-core",
|
|
3
|
-
"version": "1.1.0-alpha.
|
|
3
|
+
"version": "1.1.0-alpha.25",
|
|
4
4
|
"description": "",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"./src/modules.ts",
|
|
@@ -10,6 +10,100 @@
|
|
|
10
10
|
"main": "cjs/index.js",
|
|
11
11
|
"module": "es/index.js",
|
|
12
12
|
"types": "es/index.d.ts",
|
|
13
|
+
"typesVersions": {
|
|
14
|
+
"*": {
|
|
15
|
+
"application": [
|
|
16
|
+
"es/application.d.ts"
|
|
17
|
+
],
|
|
18
|
+
"color-string": [
|
|
19
|
+
"es/color-string/index.d.ts"
|
|
20
|
+
],
|
|
21
|
+
"common/diff": [
|
|
22
|
+
"es/common/diff.d.ts"
|
|
23
|
+
],
|
|
24
|
+
"common/generator": [
|
|
25
|
+
"es/common/generator.d.ts"
|
|
26
|
+
],
|
|
27
|
+
"common/performance-raf": [
|
|
28
|
+
"es/common/performance-raf.d.ts"
|
|
29
|
+
],
|
|
30
|
+
"constants": [
|
|
31
|
+
"es/constants.d.ts"
|
|
32
|
+
],
|
|
33
|
+
"container": [
|
|
34
|
+
"es/container.d.ts"
|
|
35
|
+
],
|
|
36
|
+
"entries/browser": [
|
|
37
|
+
"es/entries/browser.d.ts"
|
|
38
|
+
],
|
|
39
|
+
"entries/runtime-installer": [
|
|
40
|
+
"es/entries/runtime-installer.d.ts"
|
|
41
|
+
],
|
|
42
|
+
"env": [
|
|
43
|
+
"es/env.d.ts"
|
|
44
|
+
],
|
|
45
|
+
"event/constant": [
|
|
46
|
+
"es/event/public-constant.d.ts"
|
|
47
|
+
],
|
|
48
|
+
"global": [
|
|
49
|
+
"es/global.d.ts"
|
|
50
|
+
],
|
|
51
|
+
"graphic/base": [
|
|
52
|
+
"es/graphic/base.d.ts"
|
|
53
|
+
],
|
|
54
|
+
"graphic/builtin-symbol": [
|
|
55
|
+
"es/graphic/builtin-symbol/index.d.ts"
|
|
56
|
+
],
|
|
57
|
+
"graphic/creator": [
|
|
58
|
+
"es/graphic/creator.d.ts"
|
|
59
|
+
],
|
|
60
|
+
"graphic/group": [
|
|
61
|
+
"es/graphic/group.d.ts"
|
|
62
|
+
],
|
|
63
|
+
"graphic/modules": [
|
|
64
|
+
"es/graphic/modules.d.ts"
|
|
65
|
+
],
|
|
66
|
+
"graphic/symbol": [
|
|
67
|
+
"es/graphic/symbol.d.ts"
|
|
68
|
+
],
|
|
69
|
+
"interpolate": [
|
|
70
|
+
"es/interpolate.d.ts"
|
|
71
|
+
],
|
|
72
|
+
"legacy/bootstrap": [
|
|
73
|
+
"es/legacy/bootstrap.d.ts"
|
|
74
|
+
],
|
|
75
|
+
"path": [
|
|
76
|
+
"es/path.d.ts"
|
|
77
|
+
],
|
|
78
|
+
"picker/constants": [
|
|
79
|
+
"es/picker/constants.d.ts"
|
|
80
|
+
],
|
|
81
|
+
"plugin/3d": [
|
|
82
|
+
"es/plugin/3d.d.ts"
|
|
83
|
+
],
|
|
84
|
+
"plugin/attribute": [
|
|
85
|
+
"es/plugin/attribute.d.ts"
|
|
86
|
+
],
|
|
87
|
+
"plugin/flex-layout": [
|
|
88
|
+
"es/plugin/flex-layout.d.ts"
|
|
89
|
+
],
|
|
90
|
+
"register/graphic": [
|
|
91
|
+
"es/register/graphic.d.ts"
|
|
92
|
+
],
|
|
93
|
+
"render/draw-interceptor": [
|
|
94
|
+
"es/render/contributions/render/draw-interceptor.d.ts"
|
|
95
|
+
],
|
|
96
|
+
"render/symbol": [
|
|
97
|
+
"es/render/contributions/render/symbol.d.ts"
|
|
98
|
+
],
|
|
99
|
+
"svg": [
|
|
100
|
+
"es/svg.d.ts"
|
|
101
|
+
],
|
|
102
|
+
"text": [
|
|
103
|
+
"es/text.d.ts"
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
},
|
|
13
107
|
"files": [
|
|
14
108
|
"cjs",
|
|
15
109
|
"es",
|
|
@@ -36,8 +130,8 @@
|
|
|
36
130
|
"typescript": "4.9.5",
|
|
37
131
|
"cross-env": "^7.0.3",
|
|
38
132
|
"@internal/bundler": "0.0.1",
|
|
39
|
-
"@internal/
|
|
40
|
-
"@internal/
|
|
133
|
+
"@internal/ts-config": "0.0.1",
|
|
134
|
+
"@internal/eslint-config": "0.0.1"
|
|
41
135
|
},
|
|
42
136
|
"keywords": [
|
|
43
137
|
"VisActor",
|
|
@@ -61,6 +155,156 @@
|
|
|
61
155
|
".": {
|
|
62
156
|
"import": "./es/index.js",
|
|
63
157
|
"require": "./cjs/index.js"
|
|
158
|
+
},
|
|
159
|
+
"./application": {
|
|
160
|
+
"types": "./es/application.d.ts",
|
|
161
|
+
"import": "./es/application.js",
|
|
162
|
+
"require": "./cjs/application.js"
|
|
163
|
+
},
|
|
164
|
+
"./common/generator": {
|
|
165
|
+
"types": "./es/common/generator.d.ts",
|
|
166
|
+
"import": "./es/common/generator.js",
|
|
167
|
+
"require": "./cjs/common/generator.js"
|
|
168
|
+
},
|
|
169
|
+
"./common/diff": {
|
|
170
|
+
"types": "./es/common/diff.d.ts",
|
|
171
|
+
"import": "./es/common/diff.js",
|
|
172
|
+
"require": "./cjs/common/diff.js"
|
|
173
|
+
},
|
|
174
|
+
"./common/performance-raf": {
|
|
175
|
+
"types": "./es/common/performance-raf.d.ts",
|
|
176
|
+
"import": "./es/common/performance-raf.js",
|
|
177
|
+
"require": "./cjs/common/performance-raf.js"
|
|
178
|
+
},
|
|
179
|
+
"./color-string": {
|
|
180
|
+
"types": "./es/color-string/index.d.ts",
|
|
181
|
+
"import": "./es/color-string/index.js",
|
|
182
|
+
"require": "./cjs/color-string/index.js"
|
|
183
|
+
},
|
|
184
|
+
"./constants": {
|
|
185
|
+
"types": "./es/constants.d.ts",
|
|
186
|
+
"import": "./es/constants.js",
|
|
187
|
+
"require": "./cjs/constants.js"
|
|
188
|
+
},
|
|
189
|
+
"./container": {
|
|
190
|
+
"types": "./es/container.d.ts",
|
|
191
|
+
"import": "./es/container.js",
|
|
192
|
+
"require": "./cjs/container.js"
|
|
193
|
+
},
|
|
194
|
+
"./entries/browser": {
|
|
195
|
+
"types": "./es/entries/browser.d.ts",
|
|
196
|
+
"import": "./es/entries/browser.js",
|
|
197
|
+
"require": "./cjs/entries/browser.js"
|
|
198
|
+
},
|
|
199
|
+
"./entries/runtime-installer": {
|
|
200
|
+
"types": "./es/entries/runtime-installer.d.ts",
|
|
201
|
+
"import": "./es/entries/runtime-installer.js",
|
|
202
|
+
"require": "./cjs/entries/runtime-installer.js"
|
|
203
|
+
},
|
|
204
|
+
"./env": {
|
|
205
|
+
"types": "./es/env.d.ts",
|
|
206
|
+
"import": "./es/env.js",
|
|
207
|
+
"require": "./cjs/env.js"
|
|
208
|
+
},
|
|
209
|
+
"./event/constant": {
|
|
210
|
+
"types": "./es/event/public-constant.d.ts",
|
|
211
|
+
"import": "./es/event/public-constant.js",
|
|
212
|
+
"require": "./cjs/event/public-constant.js"
|
|
213
|
+
},
|
|
214
|
+
"./global": {
|
|
215
|
+
"types": "./es/global.d.ts",
|
|
216
|
+
"import": "./es/global.js",
|
|
217
|
+
"require": "./cjs/global.js"
|
|
218
|
+
},
|
|
219
|
+
"./graphic/base": {
|
|
220
|
+
"types": "./es/graphic/base.d.ts",
|
|
221
|
+
"import": "./es/graphic/base.js",
|
|
222
|
+
"require": "./cjs/graphic/base.js"
|
|
223
|
+
},
|
|
224
|
+
"./graphic/builtin-symbol": {
|
|
225
|
+
"types": "./es/graphic/builtin-symbol/index.d.ts",
|
|
226
|
+
"import": "./es/graphic/builtin-symbol/index.js",
|
|
227
|
+
"require": "./cjs/graphic/builtin-symbol/index.js"
|
|
228
|
+
},
|
|
229
|
+
"./graphic/creator": {
|
|
230
|
+
"types": "./es/graphic/creator.d.ts",
|
|
231
|
+
"import": "./es/graphic/creator.js",
|
|
232
|
+
"require": "./cjs/graphic/creator.js"
|
|
233
|
+
},
|
|
234
|
+
"./graphic/group": {
|
|
235
|
+
"types": "./es/graphic/group.d.ts",
|
|
236
|
+
"import": "./es/graphic/group.js",
|
|
237
|
+
"require": "./cjs/graphic/group.js"
|
|
238
|
+
},
|
|
239
|
+
"./graphic/modules": {
|
|
240
|
+
"types": "./es/graphic/modules.d.ts",
|
|
241
|
+
"import": "./es/graphic/modules.js",
|
|
242
|
+
"require": "./cjs/graphic/modules.js"
|
|
243
|
+
},
|
|
244
|
+
"./graphic/symbol": {
|
|
245
|
+
"types": "./es/graphic/symbol.d.ts",
|
|
246
|
+
"import": "./es/graphic/symbol.js",
|
|
247
|
+
"require": "./cjs/graphic/symbol.js"
|
|
248
|
+
},
|
|
249
|
+
"./interpolate": {
|
|
250
|
+
"types": "./es/interpolate.d.ts",
|
|
251
|
+
"import": "./es/interpolate.js",
|
|
252
|
+
"require": "./cjs/interpolate.js"
|
|
253
|
+
},
|
|
254
|
+
"./legacy/bootstrap": {
|
|
255
|
+
"types": "./es/legacy/bootstrap.d.ts",
|
|
256
|
+
"import": "./es/legacy/bootstrap.js",
|
|
257
|
+
"require": "./cjs/legacy/bootstrap.js"
|
|
258
|
+
},
|
|
259
|
+
"./path": {
|
|
260
|
+
"types": "./es/path.d.ts",
|
|
261
|
+
"import": "./es/path.js",
|
|
262
|
+
"require": "./cjs/path.js"
|
|
263
|
+
},
|
|
264
|
+
"./picker/constants": {
|
|
265
|
+
"types": "./es/picker/constants.d.ts",
|
|
266
|
+
"import": "./es/picker/constants.js",
|
|
267
|
+
"require": "./cjs/picker/constants.js"
|
|
268
|
+
},
|
|
269
|
+
"./plugin/3d": {
|
|
270
|
+
"types": "./es/plugin/3d.d.ts",
|
|
271
|
+
"import": "./es/plugin/3d.js",
|
|
272
|
+
"require": "./cjs/plugin/3d.js"
|
|
273
|
+
},
|
|
274
|
+
"./plugin/attribute": {
|
|
275
|
+
"types": "./es/plugin/attribute.d.ts",
|
|
276
|
+
"import": "./es/plugin/attribute.js",
|
|
277
|
+
"require": "./cjs/plugin/attribute.js"
|
|
278
|
+
},
|
|
279
|
+
"./plugin/flex-layout": {
|
|
280
|
+
"types": "./es/plugin/flex-layout.d.ts",
|
|
281
|
+
"import": "./es/plugin/flex-layout.js",
|
|
282
|
+
"require": "./cjs/plugin/flex-layout.js"
|
|
283
|
+
},
|
|
284
|
+
"./register/graphic": {
|
|
285
|
+
"types": "./es/register/graphic.d.ts",
|
|
286
|
+
"import": "./es/register/graphic.js",
|
|
287
|
+
"require": "./cjs/register/graphic.js"
|
|
288
|
+
},
|
|
289
|
+
"./render/draw-interceptor": {
|
|
290
|
+
"types": "./es/render/contributions/render/draw-interceptor.d.ts",
|
|
291
|
+
"import": "./es/render/contributions/render/draw-interceptor.js",
|
|
292
|
+
"require": "./cjs/render/contributions/render/draw-interceptor.js"
|
|
293
|
+
},
|
|
294
|
+
"./render/symbol": {
|
|
295
|
+
"types": "./es/render/contributions/render/symbol.d.ts",
|
|
296
|
+
"import": "./es/render/contributions/render/symbol.js",
|
|
297
|
+
"require": "./cjs/render/contributions/render/symbol.js"
|
|
298
|
+
},
|
|
299
|
+
"./svg": {
|
|
300
|
+
"types": "./es/svg.d.ts",
|
|
301
|
+
"import": "./es/svg.js",
|
|
302
|
+
"require": "./cjs/svg.js"
|
|
303
|
+
},
|
|
304
|
+
"./text": {
|
|
305
|
+
"types": "./es/text.d.ts",
|
|
306
|
+
"import": "./es/text.js",
|
|
307
|
+
"require": "./cjs/text.js"
|
|
64
308
|
}
|
|
65
309
|
},
|
|
66
310
|
"publishConfig": {
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { IGraphic, IGroup, ILayer, IStage } from '../../interface';
|
|
2
|
-
import { type IDeferredStateConfig, type StatePerfMonitor } from './state-perf-monitor';
|
|
3
|
-
type StateBatchJobKind = 'apply_states';
|
|
4
|
-
type StateBatchIntentKey = string;
|
|
5
|
-
export interface IStateBatchJob {
|
|
6
|
-
id: number;
|
|
7
|
-
kind: StateBatchJobKind;
|
|
8
|
-
intentKey: StateBatchIntentKey;
|
|
9
|
-
status: 'pending' | 'running' | 'completed' | 'cancelled';
|
|
10
|
-
targetStates: string[];
|
|
11
|
-
targetStatesKey: string;
|
|
12
|
-
pendingGraphics: Set<IGraphic>;
|
|
13
|
-
orderedGraphics: IGraphic[];
|
|
14
|
-
config: Required<IDeferredStateConfig>;
|
|
15
|
-
contextOwner: IStage | ILayer | IGroup;
|
|
16
|
-
contextOwnerId: number;
|
|
17
|
-
configFingerprint: string;
|
|
18
|
-
createdAt: number;
|
|
19
|
-
processedCount: number;
|
|
20
|
-
}
|
|
21
|
-
export declare class StateBatchScheduler {
|
|
22
|
-
private readonly stage;
|
|
23
|
-
private readonly perfMonitor?;
|
|
24
|
-
readonly jobsByIntentKey: Map<string, IStateBatchJob>;
|
|
25
|
-
readonly pendingIntentByGraphic: Map<IGraphic<Partial<import("../../interface").IGraphicAttribute>>, string>;
|
|
26
|
-
private nextJobId;
|
|
27
|
-
private readonly runningJobs;
|
|
28
|
-
constructor(stage: IStage, perfMonitor?: StatePerfMonitor);
|
|
29
|
-
schedule(graphics: IGraphic[], targetStates: string[]): void;
|
|
30
|
-
release(): void;
|
|
31
|
-
private resolveEligibility;
|
|
32
|
-
private resolveDeferredContext;
|
|
33
|
-
private classifyGraphicTargetStates;
|
|
34
|
-
private enqueueDeferredIntent;
|
|
35
|
-
private removeGraphicFromPending;
|
|
36
|
-
private removeGraphicFromIntentJob;
|
|
37
|
-
private ensureJobRunning;
|
|
38
|
-
private runJob;
|
|
39
|
-
private waitForNextFrame;
|
|
40
|
-
private commitSynchronously;
|
|
41
|
-
}
|
|
42
|
-
export {};
|
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __awaiter = this && this.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
4
|
-
return new (P || (P = Promise))((function(resolve, reject) {
|
|
5
|
-
function fulfilled(value) {
|
|
6
|
-
try {
|
|
7
|
-
step(generator.next(value));
|
|
8
|
-
} catch (e) {
|
|
9
|
-
reject(e);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
function rejected(value) {
|
|
13
|
-
try {
|
|
14
|
-
step(generator.throw(value));
|
|
15
|
-
} catch (e) {
|
|
16
|
-
reject(e);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
function step(result) {
|
|
20
|
-
var value;
|
|
21
|
-
result.done ? resolve(result.value) : (value = result.value, value instanceof P ? value : new P((function(resolve) {
|
|
22
|
-
resolve(value);
|
|
23
|
-
}))).then(fulfilled, rejected);
|
|
24
|
-
}
|
|
25
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
26
|
-
}));
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
Object.defineProperty(exports, "__esModule", {
|
|
30
|
-
value: !0
|
|
31
|
-
}), exports.StateBatchScheduler = void 0;
|
|
32
|
-
|
|
33
|
-
const attribute_update_classifier_1 = require("./attribute-update-classifier"), state_perf_monitor_1 = require("./state-perf-monitor");
|
|
34
|
-
|
|
35
|
-
function isRenderableGraphic(graphic) {
|
|
36
|
-
return !!graphic.stage && "released" !== graphic.releaseStatus;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function createTargetStatesKey(targetStates) {
|
|
40
|
-
return targetStates.length ? targetStates.join("|") : "__clear__";
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function createIntentKey(contextOwnerId, configFingerprint, targetStatesKey) {
|
|
44
|
-
return `${contextOwnerId}:${configFingerprint}:${targetStatesKey}`;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function hasMeaningfulDeferredConfig(config) {
|
|
48
|
-
const normalized = (0, state_perf_monitor_1.normalizeDeferredStateOwnerConfig)(config);
|
|
49
|
-
return !!normalized && (null != normalized.localEnabled || null != normalized.deferred);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function getGraphicCompiledDefinitions(graphic) {
|
|
53
|
-
const graphicAny = graphic;
|
|
54
|
-
if ("function" == typeof graphicAny.resolveEffectiveCompiledDefinitions) {
|
|
55
|
-
const result = graphicAny.resolveEffectiveCompiledDefinitions();
|
|
56
|
-
return {
|
|
57
|
-
compiledDefinitions: result.compiledDefinitions,
|
|
58
|
-
stateProxyEligibility: result.stateProxyEligibility
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
return {};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function getCurrentStateNames(graphic) {
|
|
65
|
-
var _a, _b;
|
|
66
|
-
return null !== (_b = null === (_a = graphic.currentStates) || void 0 === _a ? void 0 : _a.slice()) && void 0 !== _b ? _b : [];
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
class StateBatchScheduler {
|
|
70
|
-
constructor(stage, perfMonitor) {
|
|
71
|
-
this.stage = stage, this.perfMonitor = perfMonitor, this.jobsByIntentKey = new Map,
|
|
72
|
-
this.pendingIntentByGraphic = new Map, this.nextJobId = 1, this.runningJobs = new Map;
|
|
73
|
-
}
|
|
74
|
-
schedule(graphics, targetStates) {
|
|
75
|
-
const batchOperation = graphics.length > 1;
|
|
76
|
-
graphics.forEach((graphic => {
|
|
77
|
-
const eligibility = this.resolveEligibility(graphic, targetStates, batchOperation, !0);
|
|
78
|
-
if ("reason" in eligibility) return this.removeGraphicFromPending(graphic), void ("graphic_unavailable" !== eligibility.reason && this.commitSynchronously(graphic, targetStates));
|
|
79
|
-
this.enqueueDeferredIntent(graphic, targetStates, eligibility.context, eligibility.targetStatesKey);
|
|
80
|
-
}));
|
|
81
|
-
}
|
|
82
|
-
release() {
|
|
83
|
-
var _a;
|
|
84
|
-
this.jobsByIntentKey.forEach((job => {
|
|
85
|
-
job.status = "cancelled";
|
|
86
|
-
})), this.jobsByIntentKey.clear(), this.pendingIntentByGraphic.clear(), this.runningJobs.clear(),
|
|
87
|
-
null === (_a = this.perfMonitor) || void 0 === _a || _a.updateBatchPending(0);
|
|
88
|
-
}
|
|
89
|
-
resolveEligibility(graphic, targetStates, batchOperation, recordObservability) {
|
|
90
|
-
var _a, _b, _c, _d, _e, _f;
|
|
91
|
-
if (!isRenderableGraphic(graphic)) return recordObservability && (null === (_a = this.perfMonitor) || void 0 === _a || _a.recordDeferredIneligible("graphic_unavailable")),
|
|
92
|
-
{
|
|
93
|
-
eligible: !1,
|
|
94
|
-
reason: "graphic_unavailable"
|
|
95
|
-
};
|
|
96
|
-
if (!batchOperation) return recordObservability && (null === (_b = this.perfMonitor) || void 0 === _b || _b.recordDeferredIneligible("non_batch_operation")),
|
|
97
|
-
{
|
|
98
|
-
eligible: !1,
|
|
99
|
-
reason: "non_batch_operation"
|
|
100
|
-
};
|
|
101
|
-
const context = this.resolveDeferredContext(graphic);
|
|
102
|
-
if (!context) return recordObservability && (null === (_c = this.perfMonitor) || void 0 === _c || _c.recordDeferredIneligible("graphic_unavailable")),
|
|
103
|
-
{
|
|
104
|
-
eligible: !1,
|
|
105
|
-
reason: "graphic_unavailable"
|
|
106
|
-
};
|
|
107
|
-
if (!context.config.enabled) {
|
|
108
|
-
const normalizedOwnerConfig = (0, state_perf_monitor_1.normalizeDeferredStateOwnerConfig)(context.contextOwner.deferredStateConfig), reason = !1 === (null == normalizedOwnerConfig ? void 0 : normalizedOwnerConfig.localEnabled) ? "context_disabled" : "config_disabled";
|
|
109
|
-
return recordObservability && (null === (_d = this.perfMonitor) || void 0 === _d || _d.recordDeferredIneligible(reason)),
|
|
110
|
-
{
|
|
111
|
-
eligible: !1,
|
|
112
|
-
reason: reason
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
const classification = this.classifyGraphicTargetStates(graphic, targetStates);
|
|
116
|
-
return classification.reason ? (recordObservability && (null === (_e = this.perfMonitor) || void 0 === _e || _e.recordDeferredIneligible(classification.reason)),
|
|
117
|
-
{
|
|
118
|
-
eligible: !1,
|
|
119
|
-
reason: classification.reason
|
|
120
|
-
}) : classification.category !== attribute_update_classifier_1.UpdateCategory.PAINT ? (recordObservability && (null === (_f = this.perfMonitor) || void 0 === _f || _f.recordDeferredIneligible("mixed_update_category")),
|
|
121
|
-
{
|
|
122
|
-
eligible: !1,
|
|
123
|
-
reason: "mixed_update_category"
|
|
124
|
-
}) : {
|
|
125
|
-
eligible: !0,
|
|
126
|
-
context: context,
|
|
127
|
-
targetStatesKey: createTargetStatesKey(targetStates)
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
resolveDeferredContext(graphic) {
|
|
131
|
-
var _a;
|
|
132
|
-
const stage = graphic.stage;
|
|
133
|
-
if (!stage) return;
|
|
134
|
-
let owner = stage, config = (0, state_perf_monitor_1.normalizeDeferredStateConfig)(void 0);
|
|
135
|
-
const ownerConfigs = [ stage ], parents = [];
|
|
136
|
-
let parent = graphic.parent;
|
|
137
|
-
for (;parent && parent !== stage; ) parents.push(parent), parent = parent.parent;
|
|
138
|
-
parents.reverse().forEach((current => ownerConfigs.push(current))), ownerConfigs.forEach((current => {
|
|
139
|
-
const deferredStateConfig = (0, state_perf_monitor_1.normalizeDeferredStateOwnerConfig)(current.deferredStateConfig);
|
|
140
|
-
deferredStateConfig && (deferredStateConfig.deferred && (config = Object.assign(Object.assign({}, config), deferredStateConfig.deferred)),
|
|
141
|
-
null != deferredStateConfig.localEnabled && (config.enabled = deferredStateConfig.localEnabled),
|
|
142
|
-
hasMeaningfulDeferredConfig(current.deferredStateConfig) && (owner = current));
|
|
143
|
-
}));
|
|
144
|
-
const normalized = (0, state_perf_monitor_1.normalizeDeferredStateConfig)(config);
|
|
145
|
-
return {
|
|
146
|
-
contextOwner: owner,
|
|
147
|
-
contextOwnerId: null !== (_a = owner._uid) && void 0 !== _a ? _a : 0,
|
|
148
|
-
config: normalized,
|
|
149
|
-
configFingerprint: (0, state_perf_monitor_1.fingerprintDeferredStateConfig)(normalized)
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
classifyGraphicTargetStates(graphic, targetStates) {
|
|
153
|
-
const {compiledDefinitions: compiledDefinitions, stateProxyEligibility: stateProxyEligibility} = getGraphicCompiledDefinitions(graphic), candidateStates = Array.from(new Set([ ...getCurrentStateNames(graphic), ...targetStates ]));
|
|
154
|
-
let category = attribute_update_classifier_1.UpdateCategory.NONE;
|
|
155
|
-
return candidateStates.forEach((stateName => {
|
|
156
|
-
if (null == stateProxyEligibility ? void 0 : stateProxyEligibility(stateName)) return void (category = attribute_update_classifier_1.UpdateCategory.NONE);
|
|
157
|
-
const definition = null == compiledDefinitions ? void 0 : compiledDefinitions.get(stateName);
|
|
158
|
-
definition && (definition.hasResolver && 0 === definition.affectedKeys.size ? category = attribute_update_classifier_1.UpdateCategory.NONE : category |= (0,
|
|
159
|
-
attribute_update_classifier_1.classifyAffectedKeys)(definition.affectedKeys));
|
|
160
|
-
})), candidateStates.some((stateName => null == stateProxyEligibility ? void 0 : stateProxyEligibility(stateName))) || candidateStates.some((stateName => {
|
|
161
|
-
const definition = null == compiledDefinitions ? void 0 : compiledDefinitions.get(stateName);
|
|
162
|
-
return !!(null == definition ? void 0 : definition.hasResolver) && 0 === definition.affectedKeys.size;
|
|
163
|
-
})) ? {
|
|
164
|
-
category: attribute_update_classifier_1.UpdateCategory.NONE,
|
|
165
|
-
reason: "resolver_unstable_keys"
|
|
166
|
-
} : {
|
|
167
|
-
category: category === attribute_update_classifier_1.UpdateCategory.NONE ? attribute_update_classifier_1.UpdateCategory.PAINT : category
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
enqueueDeferredIntent(graphic, targetStates, context, targetStatesKey) {
|
|
171
|
-
var _a, _b, _c, _d, _e, _f;
|
|
172
|
-
const nextIntentKey = createIntentKey(context.contextOwnerId, context.configFingerprint, targetStatesKey), prevIntentKey = this.pendingIntentByGraphic.get(graphic);
|
|
173
|
-
if (prevIntentKey === nextIntentKey) return void (null === (_a = this.perfMonitor) || void 0 === _a || _a.incrementCounter("deferredJobsCoalesced"));
|
|
174
|
-
prevIntentKey && this.removeGraphicFromIntentJob(graphic, prevIntentKey);
|
|
175
|
-
let job = this.jobsByIntentKey.get(nextIntentKey);
|
|
176
|
-
job ? null === (_d = this.perfMonitor) || void 0 === _d || _d.incrementCounter("deferredJobsCoalesced") : (job = {
|
|
177
|
-
id: this.nextJobId++,
|
|
178
|
-
kind: "apply_states",
|
|
179
|
-
intentKey: nextIntentKey,
|
|
180
|
-
status: "pending",
|
|
181
|
-
targetStates: [ ...targetStates ],
|
|
182
|
-
targetStatesKey: targetStatesKey,
|
|
183
|
-
pendingGraphics: new Set,
|
|
184
|
-
orderedGraphics: [],
|
|
185
|
-
config: context.config,
|
|
186
|
-
contextOwner: context.contextOwner,
|
|
187
|
-
contextOwnerId: context.contextOwnerId,
|
|
188
|
-
configFingerprint: context.configFingerprint,
|
|
189
|
-
createdAt: Date.now(),
|
|
190
|
-
processedCount: 0
|
|
191
|
-
}, this.jobsByIntentKey.set(nextIntentKey, job), null === (_b = this.perfMonitor) || void 0 === _b || _b.incrementCounter("deferredJobsCreated"),
|
|
192
|
-
null === (_c = this.perfMonitor) || void 0 === _c || _c.updateBatchPending(this.jobsByIntentKey.size)),
|
|
193
|
-
job.pendingGraphics.has(graphic) || (job.pendingGraphics.add(graphic), job.orderedGraphics.push(graphic),
|
|
194
|
-
this.pendingIntentByGraphic.set(graphic, nextIntentKey), null === (_e = this.perfMonitor) || void 0 === _e || _e.recordAllocation("batchEntriesCreated"),
|
|
195
|
-
null === (_f = this.perfMonitor) || void 0 === _f || _f.updateMaxGraphicsInJob(job.pendingGraphics.size)),
|
|
196
|
-
this.ensureJobRunning(job);
|
|
197
|
-
}
|
|
198
|
-
removeGraphicFromPending(graphic) {
|
|
199
|
-
const prevIntentKey = this.pendingIntentByGraphic.get(graphic);
|
|
200
|
-
prevIntentKey && this.removeGraphicFromIntentJob(graphic, prevIntentKey);
|
|
201
|
-
}
|
|
202
|
-
removeGraphicFromIntentJob(graphic, intentKey) {
|
|
203
|
-
var _a, _b, _c;
|
|
204
|
-
const job = this.jobsByIntentKey.get(intentKey);
|
|
205
|
-
job ? (job.pendingGraphics.delete(graphic), this.pendingIntentByGraphic.get(graphic) === intentKey && this.pendingIntentByGraphic.delete(graphic),
|
|
206
|
-
0 === job.pendingGraphics.size && "completed" !== job.status && (job.status = "cancelled",
|
|
207
|
-
this.jobsByIntentKey.delete(intentKey), null === (_a = this.perfMonitor) || void 0 === _a || _a.incrementCounter("deferredJobsCancelled"),
|
|
208
|
-
null === (_b = this.perfMonitor) || void 0 === _b || _b.recordEvent("deferred-job-cancel", {
|
|
209
|
-
intentKey: intentKey,
|
|
210
|
-
jobId: job.id
|
|
211
|
-
}), null === (_c = this.perfMonitor) || void 0 === _c || _c.updateBatchPending(this.jobsByIntentKey.size))) : this.pendingIntentByGraphic.delete(graphic);
|
|
212
|
-
}
|
|
213
|
-
ensureJobRunning(job) {
|
|
214
|
-
if (this.runningJobs.has(job.intentKey)) return;
|
|
215
|
-
const runner = this.runJob(job).then((() => {
|
|
216
|
-
this.runningJobs.delete(job.intentKey);
|
|
217
|
-
}), (() => {
|
|
218
|
-
this.runningJobs.delete(job.intentKey);
|
|
219
|
-
}));
|
|
220
|
-
this.runningJobs.set(job.intentKey, runner);
|
|
221
|
-
}
|
|
222
|
-
runJob(job) {
|
|
223
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
224
|
-
return __awaiter(this, void 0, void 0, (function*() {
|
|
225
|
-
if ("cancelled" === job.status) return;
|
|
226
|
-
if (yield this.waitForNextFrame(), "cancelled" === job.status) return;
|
|
227
|
-
job.status = "running", null === (_a = this.perfMonitor) || void 0 === _a || _a.recordEvent("deferred-job-start", {
|
|
228
|
-
intentKey: job.intentKey,
|
|
229
|
-
jobId: job.id
|
|
230
|
-
});
|
|
231
|
-
let index = 0, frameStart = performance.now(), processedInFrame = 0, committedInSlice = 0;
|
|
232
|
-
for (;index < job.orderedGraphics.length; ) {
|
|
233
|
-
if ("cancelled" === job.status) return;
|
|
234
|
-
processedInFrame > 0 && (processedInFrame >= job.config.maxGraphicsPerFrame || performance.now() - frameStart >= job.config.frameBudget) && (null === (_b = this.perfMonitor) || void 0 === _b || _b.incrementCounter("deferredBudgetYields"),
|
|
235
|
-
null === (_c = this.perfMonitor) || void 0 === _c || _c.recordCost("batchSlice", performance.now() - frameStart),
|
|
236
|
-
null === (_d = this.perfMonitor) || void 0 === _d || _d.recordEvent("deferred-job-yield", {
|
|
237
|
-
intentKey: job.intentKey,
|
|
238
|
-
jobId: job.id,
|
|
239
|
-
processedInFrame: processedInFrame
|
|
240
|
-
}), committedInSlice > 0 && this.stage.renderNextFrame(), yield this.waitForNextFrame(),
|
|
241
|
-
frameStart = performance.now(), processedInFrame = 0, committedInSlice = 0);
|
|
242
|
-
const graphic = job.orderedGraphics[index++];
|
|
243
|
-
if (!job.pendingGraphics.has(graphic)) continue;
|
|
244
|
-
if (!isRenderableGraphic(graphic)) {
|
|
245
|
-
job.pendingGraphics.delete(graphic), this.pendingIntentByGraphic.get(graphic) === job.intentKey && this.pendingIntentByGraphic.delete(graphic);
|
|
246
|
-
continue;
|
|
247
|
-
}
|
|
248
|
-
if (this.pendingIntentByGraphic.get(graphic) !== job.intentKey) {
|
|
249
|
-
job.pendingGraphics.delete(graphic);
|
|
250
|
-
continue;
|
|
251
|
-
}
|
|
252
|
-
const nextEligibility = this.resolveEligibility(graphic, job.targetStates, !0, !1);
|
|
253
|
-
if (!nextEligibility.eligible) {
|
|
254
|
-
job.pendingGraphics.delete(graphic), this.pendingIntentByGraphic.delete(graphic),
|
|
255
|
-
this.commitSynchronously(graphic, job.targetStates);
|
|
256
|
-
continue;
|
|
257
|
-
}
|
|
258
|
-
createIntentKey(nextEligibility.context.contextOwnerId, nextEligibility.context.configFingerprint, nextEligibility.targetStatesKey) === job.intentKey ? (this.commitSynchronously(graphic, job.targetStates),
|
|
259
|
-
job.pendingGraphics.delete(graphic), this.pendingIntentByGraphic.delete(graphic),
|
|
260
|
-
job.processedCount += 1, processedInFrame += 1, committedInSlice += 1, null === (_e = this.perfMonitor) || void 0 === _e || _e.incrementCounter("deferredGraphicsCommitted")) : (job.pendingGraphics.delete(graphic),
|
|
261
|
-
this.pendingIntentByGraphic.delete(graphic), this.enqueueDeferredIntent(graphic, job.targetStates, nextEligibility.context, nextEligibility.targetStatesKey));
|
|
262
|
-
}
|
|
263
|
-
processedInFrame > 0 && (null === (_f = this.perfMonitor) || void 0 === _f || _f.recordCost("batchSlice", performance.now() - frameStart),
|
|
264
|
-
this.stage.renderNextFrame()), 0 === job.pendingGraphics.size && this.jobsByIntentKey.get(job.intentKey) === job && (job.status = "completed",
|
|
265
|
-
this.jobsByIntentKey.delete(job.intentKey), null === (_g = this.perfMonitor) || void 0 === _g || _g.incrementCounter("deferredJobsCompleted"),
|
|
266
|
-
null === (_h = this.perfMonitor) || void 0 === _h || _h.recordEvent("deferred-job-complete", {
|
|
267
|
-
intentKey: job.intentKey,
|
|
268
|
-
jobId: job.id,
|
|
269
|
-
processedCount: job.processedCount
|
|
270
|
-
}), null === (_j = this.perfMonitor) || void 0 === _j || _j.updateBatchPending(this.jobsByIntentKey.size));
|
|
271
|
-
}));
|
|
272
|
-
}
|
|
273
|
-
waitForNextFrame() {
|
|
274
|
-
const stageGlobal = this.stage.global;
|
|
275
|
-
return (null == stageGlobal ? void 0 : stageGlobal.getSpecifiedPerformanceRAF) ? stageGlobal.getSpecifiedPerformanceRAF(this.stage.rafId).wait() : new Promise((resolve => {
|
|
276
|
-
null == stageGlobal || stageGlobal.getSpecifiedRequestAnimationFrame(this.stage.rafId)((() => resolve()));
|
|
277
|
-
}));
|
|
278
|
-
}
|
|
279
|
-
commitSynchronously(graphic, targetStates) {
|
|
280
|
-
isRenderableGraphic(graphic) && (targetStates.length ? graphic.useStates(targetStates, !1) : graphic.clearStates(!1));
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
exports.StateBatchScheduler = StateBatchScheduler;
|
|
285
|
-
//# sourceMappingURL=state-batch-scheduler.js.map
|