@antv/g-lite 2.2.14 → 2.2.15
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 +158 -12
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +158 -12
- package/dist/index.js.map +1 -1
- package/dist/index.umd.min.js +5 -5
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/types/Canvas.d.ts.map +1 -1
- package/types/utils/memoize.d.ts +2 -0
- package/types/utils/memoize.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.2.
|
|
5
|
-
* @date 1/
|
|
4
|
+
* @version 2.2.15
|
|
5
|
+
* @date 1/17/2025, 2:05:37 PM
|
|
6
6
|
* @author AntVis
|
|
7
7
|
* @docs https://g.antv.antgroup.com/
|
|
8
8
|
*/
|
|
@@ -1592,8 +1592,31 @@ function combine(out, a, b, scale1, scale2) {
|
|
|
1592
1592
|
*/
|
|
1593
1593
|
|
|
1594
1594
|
var CameraType = /*#__PURE__*/function (CameraType) {
|
|
1595
|
+
/**
|
|
1596
|
+
* Performs all the rotational operations with the focal point instead of the camera position.
|
|
1597
|
+
* This type of camera is useful in applications(like CAD) where 3D objects are being designed or explored.
|
|
1598
|
+
* Camera cannot orbits over the north & south poles.
|
|
1599
|
+
* @see http://voxelent.com/tutorial-cameras/
|
|
1600
|
+
*
|
|
1601
|
+
* In Three.js it's used in OrbitControls.
|
|
1602
|
+
* @see https://threejs.org/docs/#examples/zh/controls/OrbitControls
|
|
1603
|
+
*/
|
|
1595
1604
|
CameraType[CameraType["ORBITING"] = 0] = "ORBITING";
|
|
1605
|
+
/**
|
|
1606
|
+
* It's similar to the ORBITING camera, but it allows the camera to orbit over the north or south poles.
|
|
1607
|
+
*
|
|
1608
|
+
* In Three.js it's used in OrbitControls.
|
|
1609
|
+
* @see https://threejs.org/docs/#examples/en/controls/TrackballControls
|
|
1610
|
+
*/
|
|
1596
1611
|
CameraType[CameraType["EXPLORING"] = 1] = "EXPLORING";
|
|
1612
|
+
/**
|
|
1613
|
+
* Performs all the rotational operations with the camera position.
|
|
1614
|
+
* It's useful in first person shooting games.
|
|
1615
|
+
* Camera cannot orbits over the north & south poles.
|
|
1616
|
+
*
|
|
1617
|
+
* In Three.js it's used in FirstPersonControls.
|
|
1618
|
+
* @see https://threejs.org/docs/#examples/en/controls/FirstPersonControls
|
|
1619
|
+
*/
|
|
1597
1620
|
CameraType[CameraType["TRACKING"] = 2] = "TRACKING";
|
|
1598
1621
|
return CameraType;
|
|
1599
1622
|
}({});
|
|
@@ -2487,20 +2510,57 @@ var EMPTY_PARSED_PATH = {
|
|
|
2487
2510
|
* @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type
|
|
2488
2511
|
*/
|
|
2489
2512
|
var PropertySyntax = /*#__PURE__*/function (PropertySyntax) {
|
|
2513
|
+
/**
|
|
2514
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#coordinate
|
|
2515
|
+
*/
|
|
2490
2516
|
PropertySyntax["COORDINATE"] = "<coordinate>";
|
|
2517
|
+
/**
|
|
2518
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#color
|
|
2519
|
+
*/
|
|
2491
2520
|
PropertySyntax["COLOR"] = "<color>";
|
|
2521
|
+
/**
|
|
2522
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#paint
|
|
2523
|
+
*/
|
|
2492
2524
|
PropertySyntax["PAINT"] = "<paint>";
|
|
2525
|
+
/**
|
|
2526
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#number
|
|
2527
|
+
*/
|
|
2493
2528
|
PropertySyntax["NUMBER"] = "<number>";
|
|
2529
|
+
/**
|
|
2530
|
+
* @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/angle
|
|
2531
|
+
*/
|
|
2494
2532
|
PropertySyntax["ANGLE"] = "<angle>";
|
|
2533
|
+
/**
|
|
2534
|
+
* <number> with range 0..1
|
|
2535
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#opacity_value
|
|
2536
|
+
*/
|
|
2495
2537
|
PropertySyntax["OPACITY_VALUE"] = "<opacity-value>";
|
|
2538
|
+
/**
|
|
2539
|
+
* <number> with range 0..Infinity
|
|
2540
|
+
*/
|
|
2496
2541
|
PropertySyntax["SHADOW_BLUR"] = "<shadow-blur>";
|
|
2542
|
+
/**
|
|
2543
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#length
|
|
2544
|
+
*/
|
|
2497
2545
|
PropertySyntax["LENGTH"] = "<length>";
|
|
2546
|
+
/**
|
|
2547
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#percentage
|
|
2548
|
+
*/
|
|
2498
2549
|
PropertySyntax["PERCENTAGE"] = "<percentage>";
|
|
2499
2550
|
PropertySyntax["LENGTH_PERCENTAGE"] = "<length> | <percentage>";
|
|
2500
2551
|
PropertySyntax["LENGTH_PERCENTAGE_12"] = "[<length> | <percentage>]{1,2}";
|
|
2552
|
+
/**
|
|
2553
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/margin#formal_syntax
|
|
2554
|
+
*/
|
|
2501
2555
|
PropertySyntax["LENGTH_PERCENTAGE_14"] = "[<length> | <percentage>]{1,4}";
|
|
2556
|
+
/**
|
|
2557
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#list-of-ts
|
|
2558
|
+
*/
|
|
2502
2559
|
PropertySyntax["LIST_OF_POINTS"] = "<list-of-points>";
|
|
2503
2560
|
PropertySyntax["PATH"] = "<path>";
|
|
2561
|
+
/**
|
|
2562
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/filter#formal_syntax
|
|
2563
|
+
*/
|
|
2504
2564
|
PropertySyntax["FILTER"] = "<filter>";
|
|
2505
2565
|
PropertySyntax["Z_INDEX"] = "<z-index>";
|
|
2506
2566
|
PropertySyntax["OFFSET_DISTANCE"] = "<offset-distance>";
|
|
@@ -2531,9 +2591,16 @@ function memoize(func, resolver) {
|
|
|
2531
2591
|
return result;
|
|
2532
2592
|
};
|
|
2533
2593
|
_memoized.cache = new (memoize.Cache || Map)();
|
|
2594
|
+
memoize.cacheList.push(_memoized.cache);
|
|
2534
2595
|
return _memoized;
|
|
2535
2596
|
}
|
|
2536
2597
|
memoize.Cache = Map;
|
|
2598
|
+
memoize.cacheList = [];
|
|
2599
|
+
memoize.clearCache = function () {
|
|
2600
|
+
memoize.cacheList.forEach(function (cache) {
|
|
2601
|
+
return cache.clear();
|
|
2602
|
+
});
|
|
2603
|
+
};
|
|
2537
2604
|
|
|
2538
2605
|
// These units are iterated through, so be careful when adding or changing the
|
|
2539
2606
|
// order.
|
|
@@ -2541,30 +2608,88 @@ var UnitType = /*#__PURE__*/function (UnitType) {
|
|
|
2541
2608
|
UnitType[UnitType["kUnknown"] = 0] = "kUnknown";
|
|
2542
2609
|
UnitType[UnitType["kNumber"] = 1] = "kNumber";
|
|
2543
2610
|
UnitType[UnitType["kPercentage"] = 2] = "kPercentage";
|
|
2611
|
+
// Length units
|
|
2544
2612
|
UnitType[UnitType["kEms"] = 3] = "kEms";
|
|
2613
|
+
// kExs,
|
|
2545
2614
|
UnitType[UnitType["kPixels"] = 4] = "kPixels";
|
|
2615
|
+
// kCentimeters,
|
|
2616
|
+
// kMillimeters,
|
|
2617
|
+
// kInches,
|
|
2618
|
+
// kPoints,
|
|
2619
|
+
// kPicas,
|
|
2620
|
+
// kQuarterMillimeters,
|
|
2621
|
+
// https://drafts.csswg.org/css-values-4/#viewport-relative-lengths
|
|
2622
|
+
//
|
|
2623
|
+
// See also IsViewportPercentageLength.
|
|
2624
|
+
// kViewportWidth,
|
|
2625
|
+
// kViewportHeight,
|
|
2626
|
+
// kViewportInlineSize,
|
|
2627
|
+
// kViewportBlockSize,
|
|
2628
|
+
// kViewportMin,
|
|
2629
|
+
// kViewportMax,
|
|
2630
|
+
// kSmallViewportWidth,
|
|
2631
|
+
// kSmallViewportHeight,
|
|
2632
|
+
// kSmallViewportInlineSize,
|
|
2633
|
+
// kSmallViewportBlockSize,
|
|
2634
|
+
// kSmallViewportMin,
|
|
2635
|
+
// kSmallViewportMax,
|
|
2636
|
+
// kLargeViewportWidth,
|
|
2637
|
+
// kLargeViewportHeight,
|
|
2638
|
+
// kLargeViewportInlineSize,
|
|
2639
|
+
// kLargeViewportBlockSize,
|
|
2640
|
+
// kLargeViewportMin,
|
|
2641
|
+
// kLargeViewportMax,
|
|
2642
|
+
// kDynamicViewportWidth,
|
|
2643
|
+
// kDynamicViewportHeight,
|
|
2644
|
+
// kDynamicViewportInlineSize,
|
|
2645
|
+
// kDynamicViewportBlockSize,
|
|
2646
|
+
// kDynamicViewportMin,
|
|
2647
|
+
// kDynamicViewportMax,
|
|
2648
|
+
// https://drafts.csswg.org/css-contain-3/#container-lengths
|
|
2649
|
+
//
|
|
2650
|
+
// See also IsContainerPercentageLength.
|
|
2651
|
+
// kContainerWidth,
|
|
2652
|
+
// kContainerHeight,
|
|
2653
|
+
// kContainerInlineSize,
|
|
2654
|
+
// kContainerBlockSize,
|
|
2655
|
+
// kContainerMin,
|
|
2656
|
+
// kContainerMax,
|
|
2546
2657
|
UnitType[UnitType["kRems"] = 5] = "kRems";
|
|
2658
|
+
// kChs,
|
|
2659
|
+
// kUserUnits, // The SVG term for unitless lengths
|
|
2660
|
+
// Angle units
|
|
2547
2661
|
UnitType[UnitType["kDegrees"] = 6] = "kDegrees";
|
|
2548
2662
|
UnitType[UnitType["kRadians"] = 7] = "kRadians";
|
|
2549
2663
|
UnitType[UnitType["kGradians"] = 8] = "kGradians";
|
|
2550
2664
|
UnitType[UnitType["kTurns"] = 9] = "kTurns";
|
|
2665
|
+
// Time units
|
|
2551
2666
|
UnitType[UnitType["kMilliseconds"] = 10] = "kMilliseconds";
|
|
2552
2667
|
UnitType[UnitType["kSeconds"] = 11] = "kSeconds";
|
|
2553
|
-
|
|
2668
|
+
// kHertz,
|
|
2669
|
+
// kKilohertz,
|
|
2670
|
+
// Resolution
|
|
2671
|
+
// kDotsPerPixel,
|
|
2672
|
+
// kDotsPerInch,
|
|
2673
|
+
// kDotsPerCentimeter,
|
|
2674
|
+
// Other units
|
|
2675
|
+
// kFraction,
|
|
2676
|
+
UnitType[UnitType["kInteger"] = 12] = "kInteger"; // This value is used to handle quirky margins in reflow roots (body, td,
|
|
2677
|
+
// and th) like WinIE. The basic idea is that a stylesheet can use the value
|
|
2678
|
+
// __qem (for quirky em) instead of em. When the quirky value is used, if
|
|
2679
|
+
// you're in quirks mode, the margin will collapse away inside a table cell.
|
|
2680
|
+
// This quirk is specified in the HTML spec but our impl is different.
|
|
2681
|
+
// TODO: Remove this. crbug.com/443952
|
|
2682
|
+
// kQuirkyEms,
|
|
2554
2683
|
return UnitType;
|
|
2555
|
-
}({});
|
|
2556
|
-
// and th) like WinIE. The basic idea is that a stylesheet can use the value
|
|
2557
|
-
// __qem (for quirky em) instead of em. When the quirky value is used, if
|
|
2558
|
-
// you're in quirks mode, the margin will collapse away inside a table cell.
|
|
2559
|
-
// This quirk is specified in the HTML spec but our impl is different.
|
|
2560
|
-
// TODO: Remove this. crbug.com/443952
|
|
2561
|
-
// kQuirkyEms,
|
|
2684
|
+
}({});
|
|
2562
2685
|
var UnitCategory = /*#__PURE__*/function (UnitCategory) {
|
|
2563
2686
|
UnitCategory[UnitCategory["kUNumber"] = 0] = "kUNumber";
|
|
2564
2687
|
UnitCategory[UnitCategory["kUPercent"] = 1] = "kUPercent";
|
|
2565
2688
|
UnitCategory[UnitCategory["kULength"] = 2] = "kULength";
|
|
2566
2689
|
UnitCategory[UnitCategory["kUAngle"] = 3] = "kUAngle";
|
|
2567
2690
|
UnitCategory[UnitCategory["kUTime"] = 4] = "kUTime";
|
|
2691
|
+
// kUFrequency,
|
|
2692
|
+
// kUResolution,
|
|
2568
2693
|
UnitCategory[UnitCategory["kUOther"] = 5] = "kUOther";
|
|
2569
2694
|
return UnitCategory;
|
|
2570
2695
|
}({});
|
|
@@ -2801,6 +2926,7 @@ var CSSStyleValueType = /*#__PURE__*/function (CSSStyleValueType) {
|
|
|
2801
2926
|
CSSStyleValueType[CSSStyleValueType["kUnknownType"] = 0] = "kUnknownType";
|
|
2802
2927
|
CSSStyleValueType[CSSStyleValueType["kUnparsedType"] = 1] = "kUnparsedType";
|
|
2803
2928
|
CSSStyleValueType[CSSStyleValueType["kKeywordType"] = 2] = "kKeywordType";
|
|
2929
|
+
// Start of CSSNumericValue subclasses
|
|
2804
2930
|
CSSStyleValueType[CSSStyleValueType["kUnitType"] = 3] = "kUnitType";
|
|
2805
2931
|
CSSStyleValueType[CSSStyleValueType["kSumType"] = 4] = "kSumType";
|
|
2806
2932
|
CSSStyleValueType[CSSStyleValueType["kProductType"] = 5] = "kProductType";
|
|
@@ -2809,6 +2935,7 @@ var CSSStyleValueType = /*#__PURE__*/function (CSSStyleValueType) {
|
|
|
2809
2935
|
CSSStyleValueType[CSSStyleValueType["kMinType"] = 8] = "kMinType";
|
|
2810
2936
|
CSSStyleValueType[CSSStyleValueType["kMaxType"] = 9] = "kMaxType";
|
|
2811
2937
|
CSSStyleValueType[CSSStyleValueType["kClampType"] = 10] = "kClampType";
|
|
2938
|
+
// End of CSSNumericValue subclasses
|
|
2812
2939
|
CSSStyleValueType[CSSStyleValueType["kTransformType"] = 11] = "kTransformType";
|
|
2813
2940
|
CSSStyleValueType[CSSStyleValueType["kPositionType"] = 12] = "kPositionType";
|
|
2814
2941
|
CSSStyleValueType[CSSStyleValueType["kURLImageType"] = 13] = "kURLImageType";
|
|
@@ -9679,8 +9806,7 @@ var EventService = /*#__PURE__*/function () {
|
|
|
9679
9806
|
}, {
|
|
9680
9807
|
key: "notifyTarget",
|
|
9681
9808
|
value: function notifyTarget(e, type) {
|
|
9682
|
-
|
|
9683
|
-
type = (_type = type) !== null && _type !== void 0 ? _type : e.type;
|
|
9809
|
+
type = type !== null && type !== void 0 ? type : e.type;
|
|
9684
9810
|
var key = e.eventPhase === e.CAPTURING_PHASE || e.eventPhase === e.AT_TARGET ? "".concat(type, "capture") : type;
|
|
9685
9811
|
this.notifyListeners(e, key);
|
|
9686
9812
|
if (e.eventPhase === e.AT_TARGET) {
|
|
@@ -10224,11 +10350,30 @@ var DefaultSceneGraphSelector = /*#__PURE__*/function () {
|
|
|
10224
10350
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
|
|
10225
10351
|
*/
|
|
10226
10352
|
var ElementEvent = /*#__PURE__*/function (ElementEvent) {
|
|
10353
|
+
// --- @see https://developer.mozilla.org/en-US/docs/Web/API/MutationEvent
|
|
10354
|
+
/**
|
|
10355
|
+
* @see https://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMAttrModified
|
|
10356
|
+
*/
|
|
10227
10357
|
ElementEvent["ATTR_MODIFIED"] = "DOMAttrModified";
|
|
10358
|
+
/**
|
|
10359
|
+
* it has been inserted
|
|
10360
|
+
* @see https://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMNodeInserted
|
|
10361
|
+
*/
|
|
10228
10362
|
ElementEvent["INSERTED"] = "DOMNodeInserted";
|
|
10363
|
+
/**
|
|
10364
|
+
* @see https://www.w3.org/TR/DOM-Level-3-Events/#domnodeinsertedintodocument
|
|
10365
|
+
*/
|
|
10229
10366
|
ElementEvent["MOUNTED"] = "DOMNodeInsertedIntoDocument";
|
|
10367
|
+
/**
|
|
10368
|
+
* it is being removed
|
|
10369
|
+
* @see https://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMNodeRemoved
|
|
10370
|
+
*/
|
|
10230
10371
|
ElementEvent["REMOVED"] = "removed";
|
|
10372
|
+
/**
|
|
10373
|
+
* @see https://www.w3.org/TR/DOM-Level-3-Events/#domnoderemovedfromdocument
|
|
10374
|
+
*/
|
|
10231
10375
|
ElementEvent["UNMOUNTED"] = "DOMNodeRemovedFromDocument";
|
|
10376
|
+
// ---
|
|
10232
10377
|
ElementEvent["REPARENT"] = "reparent";
|
|
10233
10378
|
ElementEvent["DESTROY"] = "destroy";
|
|
10234
10379
|
ElementEvent["BOUNDS_CHANGED"] = "bounds-changed";
|
|
@@ -15589,6 +15734,7 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
|
|
|
15589
15734
|
value: function destroy() {
|
|
15590
15735
|
var cleanUp = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
15591
15736
|
var skipTriggerEvent = arguments.length > 1 ? arguments[1] : undefined;
|
|
15737
|
+
memoize.clearCache();
|
|
15592
15738
|
if (!skipTriggerEvent) {
|
|
15593
15739
|
this.dispatchEvent(new CustomEvent(CanvasEvent.BEFORE_DESTROY));
|
|
15594
15740
|
}
|