@antv/g-lite 2.4.0 → 2.5.0
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/dist/index.esm.js +37 -24
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +37 -24
- package/dist/index.js.map +1 -1
- package/dist/index.umd.min.js +4 -4
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/types/dom/CustomEvent.d.ts +2 -1
- package/types/dom/CustomEvent.d.ts.map +1 -1
- package/types/dom/MutationObserver.d.ts +6 -6
- package/types/dom/MutationObserver.d.ts.map +1 -1
- package/types/dom/Node.d.ts +2 -0
- package/types/dom/Node.d.ts.map +1 -1
- package/types/services/RenderingService.d.ts.map +1 -1
- package/types/services/SceneGraphService.d.ts +0 -2
- package/types/services/SceneGraphService.d.ts.map +1 -1
- package/types/services/interfaces.d.ts +0 -1
- package/types/services/interfaces.d.ts.map +1 -1
- package/types/types.d.ts.map +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @antv/g-lite
|
|
3
3
|
* @description A core module for rendering engine implements DOM API.
|
|
4
|
-
* @version 2.
|
|
5
|
-
* @date 10/
|
|
4
|
+
* @version 2.5.0
|
|
5
|
+
* @date 12/10/2025, 8:42:24 AM
|
|
6
6
|
* @author AntVis
|
|
7
7
|
* @docs https://g.antv.antgroup.com/
|
|
8
8
|
*/
|
|
@@ -21,12 +21,15 @@ require('@babel/runtime/helpers/readOnlyError');
|
|
|
21
21
|
var util = require('@antv/util');
|
|
22
22
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
23
23
|
var _superPropGet = require('@babel/runtime/helpers/superPropGet');
|
|
24
|
+
var _arrayLikeToArray = require('@babel/runtime/helpers/arrayLikeToArray');
|
|
24
25
|
var gMath = require('@antv/g-math');
|
|
25
26
|
var _regeneratorRuntime = require('@babel/runtime/helpers/regeneratorRuntime');
|
|
26
27
|
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
27
28
|
var _createForOfIteratorHelper = require('@babel/runtime/helpers/createForOfIteratorHelper');
|
|
28
29
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
29
30
|
|
|
31
|
+
/// <reference types="webxr" />
|
|
32
|
+
|
|
30
33
|
var Shape = /*#__PURE__*/function (Shape) {
|
|
31
34
|
Shape["GROUP"] = "g";
|
|
32
35
|
Shape["FRAGMENT"] = "fragment";
|
|
@@ -8499,6 +8502,11 @@ var CustomEvent = /*#__PURE__*/function (_FederatedEvent) {
|
|
|
8499
8502
|
_this.type = eventName;
|
|
8500
8503
|
_this.detail = options === null || options === void 0 ? void 0 : options.detail;
|
|
8501
8504
|
|
|
8505
|
+
// compatible
|
|
8506
|
+
if (options && !('detail' in options)) {
|
|
8507
|
+
_this.detail = options;
|
|
8508
|
+
}
|
|
8509
|
+
|
|
8502
8510
|
// compatible with G 3.0
|
|
8503
8511
|
Object.assign(_this, options);
|
|
8504
8512
|
return _this;
|
|
@@ -8594,9 +8602,7 @@ var EventTarget = /*#__PURE__*/function () {
|
|
|
8594
8602
|
}, {
|
|
8595
8603
|
key: "emit",
|
|
8596
8604
|
value: function emit(eventName, object) {
|
|
8597
|
-
this.dispatchEvent(new CustomEvent(eventName,
|
|
8598
|
-
detail: object
|
|
8599
|
-
}));
|
|
8605
|
+
this.dispatchEvent(new CustomEvent(eventName, object));
|
|
8600
8606
|
}
|
|
8601
8607
|
}, {
|
|
8602
8608
|
key: "dispatchEventToSelf",
|
|
@@ -8694,6 +8700,7 @@ var Node = /*#__PURE__*/function (_EventTarget) {
|
|
|
8694
8700
|
* @see https://developer.mozilla.org/zh-CN/docs/Web/API/Node/nodeValue
|
|
8695
8701
|
*/
|
|
8696
8702
|
_this.nodeValue = null;
|
|
8703
|
+
_this.mutations = undefined;
|
|
8697
8704
|
/**
|
|
8698
8705
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/ParentNode
|
|
8699
8706
|
*/
|
|
@@ -10133,7 +10140,6 @@ var RenderingService = /*#__PURE__*/function () {
|
|
|
10133
10140
|
value: function destroy() {
|
|
10134
10141
|
this.inited = false;
|
|
10135
10142
|
this.hooks.destroy.call();
|
|
10136
|
-
this.globalRuntime.sceneGraphService.clearMutationObserverData();
|
|
10137
10143
|
}
|
|
10138
10144
|
}, {
|
|
10139
10145
|
key: "dirty",
|
|
@@ -10402,7 +10408,6 @@ var $rotate_ParentInvertRotation = glMatrix.quat.create();
|
|
|
10402
10408
|
var DefaultSceneGraphService = /*#__PURE__*/function () {
|
|
10403
10409
|
function DefaultSceneGraphService(runtime) {
|
|
10404
10410
|
_classCallCheck(this, DefaultSceneGraphService);
|
|
10405
|
-
this.mutationsMap = new Map();
|
|
10406
10411
|
this.displayObjectDependencyMap = new WeakMap();
|
|
10407
10412
|
this.runtime = runtime;
|
|
10408
10413
|
}
|
|
@@ -11091,7 +11096,6 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
|
|
|
11091
11096
|
key: "syncHierarchy",
|
|
11092
11097
|
value: function syncHierarchy(rootNode) {
|
|
11093
11098
|
var _transformable, _transformable2;
|
|
11094
|
-
// console.log('syncHierarchy');
|
|
11095
11099
|
var stack = [rootNode];
|
|
11096
11100
|
var ancestors = rootNode.parentNode ? [{
|
|
11097
11101
|
node: rootNode.parentNode,
|
|
@@ -11174,21 +11178,25 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
|
|
|
11174
11178
|
});
|
|
11175
11179
|
}
|
|
11176
11180
|
this.informDependentDisplayObjects(element);
|
|
11177
|
-
var
|
|
11178
|
-
|
|
11179
|
-
|
|
11181
|
+
var mutations = element.mutations || [];
|
|
11182
|
+
var boundChangeMutation = mutations.find(function (item) {
|
|
11183
|
+
return item.type === 'attributes' && item._boundsChangeData;
|
|
11184
|
+
});
|
|
11185
|
+
if (!boundChangeMutation) {
|
|
11186
|
+
boundChangeMutation = {
|
|
11180
11187
|
type: 'attributes',
|
|
11181
11188
|
target: element,
|
|
11182
11189
|
_boundsChangeData: {
|
|
11183
11190
|
affectChildren: affectChildren
|
|
11184
11191
|
}
|
|
11185
11192
|
};
|
|
11186
|
-
|
|
11193
|
+
mutations.push(boundChangeMutation);
|
|
11187
11194
|
} else {
|
|
11188
|
-
|
|
11189
|
-
affectChildren:
|
|
11195
|
+
boundChangeMutation._boundsChangeData = {
|
|
11196
|
+
affectChildren: boundChangeMutation._boundsChangeData.affectChildren || affectChildren
|
|
11190
11197
|
};
|
|
11191
11198
|
}
|
|
11199
|
+
element.mutations = mutations;
|
|
11192
11200
|
}
|
|
11193
11201
|
}, {
|
|
11194
11202
|
key: "dirtyFragment",
|
|
@@ -11208,16 +11216,21 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
|
|
|
11208
11216
|
}, {
|
|
11209
11217
|
key: "notifyMutationObservers",
|
|
11210
11218
|
value: function notifyMutationObservers(canvas) {
|
|
11211
|
-
var
|
|
11212
|
-
|
|
11219
|
+
var mutations = [];
|
|
11220
|
+
canvas.getRoot().forEach(function (item) {
|
|
11221
|
+
(item.mutations || []).forEach(function (mutation) {
|
|
11222
|
+
if (mutation.type === 'attributes' && mutation._boundsChangeData) {
|
|
11223
|
+
mutations.push(mutation);
|
|
11224
|
+
}
|
|
11225
|
+
});
|
|
11226
|
+
item.mutations = undefined;
|
|
11213
11227
|
});
|
|
11214
|
-
|
|
11215
|
-
|
|
11216
|
-
|
|
11217
|
-
|
|
11218
|
-
|
|
11219
|
-
|
|
11220
|
-
this.mutationsMap.clear();
|
|
11228
|
+
if (mutations.length > 0) {
|
|
11229
|
+
var event = new CustomEvent(ElementEvent.BOUNDS_CHANGED, {
|
|
11230
|
+
detail: mutations
|
|
11231
|
+
});
|
|
11232
|
+
canvas.dispatchEvent(event, true, true);
|
|
11233
|
+
}
|
|
11221
11234
|
}
|
|
11222
11235
|
}, {
|
|
11223
11236
|
key: "updateDisplayObjectDependency",
|
|
@@ -12361,7 +12374,7 @@ var Element = /*#__PURE__*/function (_Node) {
|
|
|
12361
12374
|
nodes[_key3] = arguments[_key3];
|
|
12362
12375
|
}
|
|
12363
12376
|
var first = nodes[0],
|
|
12364
|
-
rest = nodes.slice(1);
|
|
12377
|
+
rest = _arrayLikeToArray(nodes).slice(1);
|
|
12365
12378
|
this.parentNode.appendChild(first, index);
|
|
12366
12379
|
(_ref = first).after.apply(_ref, _toConsumableArray(rest));
|
|
12367
12380
|
}
|