@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 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.14
5
- * @date 1/2/2025, 2:54:20 AM
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
  */
@@ -1571,8 +1571,31 @@ function combine(out, a, b, scale1, scale2) {
1571
1571
  */
1572
1572
 
1573
1573
  var CameraType = /*#__PURE__*/function (CameraType) {
1574
+ /**
1575
+ * Performs all the rotational operations with the focal point instead of the camera position.
1576
+ * This type of camera is useful in applications(like CAD) where 3D objects are being designed or explored.
1577
+ * Camera cannot orbits over the north & south poles.
1578
+ * @see http://voxelent.com/tutorial-cameras/
1579
+ *
1580
+ * In Three.js it's used in OrbitControls.
1581
+ * @see https://threejs.org/docs/#examples/zh/controls/OrbitControls
1582
+ */
1574
1583
  CameraType[CameraType["ORBITING"] = 0] = "ORBITING";
1584
+ /**
1585
+ * It's similar to the ORBITING camera, but it allows the camera to orbit over the north or south poles.
1586
+ *
1587
+ * In Three.js it's used in OrbitControls.
1588
+ * @see https://threejs.org/docs/#examples/en/controls/TrackballControls
1589
+ */
1575
1590
  CameraType[CameraType["EXPLORING"] = 1] = "EXPLORING";
1591
+ /**
1592
+ * Performs all the rotational operations with the camera position.
1593
+ * It's useful in first person shooting games.
1594
+ * Camera cannot orbits over the north & south poles.
1595
+ *
1596
+ * In Three.js it's used in FirstPersonControls.
1597
+ * @see https://threejs.org/docs/#examples/en/controls/FirstPersonControls
1598
+ */
1576
1599
  CameraType[CameraType["TRACKING"] = 2] = "TRACKING";
1577
1600
  return CameraType;
1578
1601
  }({});
@@ -2466,20 +2489,57 @@ var EMPTY_PARSED_PATH = {
2466
2489
  * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type
2467
2490
  */
2468
2491
  var PropertySyntax = /*#__PURE__*/function (PropertySyntax) {
2492
+ /**
2493
+ * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#coordinate
2494
+ */
2469
2495
  PropertySyntax["COORDINATE"] = "<coordinate>";
2496
+ /**
2497
+ * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#color
2498
+ */
2470
2499
  PropertySyntax["COLOR"] = "<color>";
2500
+ /**
2501
+ * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#paint
2502
+ */
2471
2503
  PropertySyntax["PAINT"] = "<paint>";
2504
+ /**
2505
+ * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#number
2506
+ */
2472
2507
  PropertySyntax["NUMBER"] = "<number>";
2508
+ /**
2509
+ * @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/angle
2510
+ */
2473
2511
  PropertySyntax["ANGLE"] = "<angle>";
2512
+ /**
2513
+ * <number> with range 0..1
2514
+ * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#opacity_value
2515
+ */
2474
2516
  PropertySyntax["OPACITY_VALUE"] = "<opacity-value>";
2517
+ /**
2518
+ * <number> with range 0..Infinity
2519
+ */
2475
2520
  PropertySyntax["SHADOW_BLUR"] = "<shadow-blur>";
2521
+ /**
2522
+ * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#length
2523
+ */
2476
2524
  PropertySyntax["LENGTH"] = "<length>";
2525
+ /**
2526
+ * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#percentage
2527
+ */
2477
2528
  PropertySyntax["PERCENTAGE"] = "<percentage>";
2478
2529
  PropertySyntax["LENGTH_PERCENTAGE"] = "<length> | <percentage>";
2479
2530
  PropertySyntax["LENGTH_PERCENTAGE_12"] = "[<length> | <percentage>]{1,2}";
2531
+ /**
2532
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/margin#formal_syntax
2533
+ */
2480
2534
  PropertySyntax["LENGTH_PERCENTAGE_14"] = "[<length> | <percentage>]{1,4}";
2535
+ /**
2536
+ * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#list-of-ts
2537
+ */
2481
2538
  PropertySyntax["LIST_OF_POINTS"] = "<list-of-points>";
2482
2539
  PropertySyntax["PATH"] = "<path>";
2540
+ /**
2541
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/filter#formal_syntax
2542
+ */
2483
2543
  PropertySyntax["FILTER"] = "<filter>";
2484
2544
  PropertySyntax["Z_INDEX"] = "<z-index>";
2485
2545
  PropertySyntax["OFFSET_DISTANCE"] = "<offset-distance>";
@@ -2510,9 +2570,16 @@ function memoize(func, resolver) {
2510
2570
  return result;
2511
2571
  };
2512
2572
  _memoized.cache = new (memoize.Cache || Map)();
2573
+ memoize.cacheList.push(_memoized.cache);
2513
2574
  return _memoized;
2514
2575
  }
2515
2576
  memoize.Cache = Map;
2577
+ memoize.cacheList = [];
2578
+ memoize.clearCache = function () {
2579
+ memoize.cacheList.forEach(function (cache) {
2580
+ return cache.clear();
2581
+ });
2582
+ };
2516
2583
 
2517
2584
  // These units are iterated through, so be careful when adding or changing the
2518
2585
  // order.
@@ -2520,30 +2587,88 @@ var UnitType = /*#__PURE__*/function (UnitType) {
2520
2587
  UnitType[UnitType["kUnknown"] = 0] = "kUnknown";
2521
2588
  UnitType[UnitType["kNumber"] = 1] = "kNumber";
2522
2589
  UnitType[UnitType["kPercentage"] = 2] = "kPercentage";
2590
+ // Length units
2523
2591
  UnitType[UnitType["kEms"] = 3] = "kEms";
2592
+ // kExs,
2524
2593
  UnitType[UnitType["kPixels"] = 4] = "kPixels";
2594
+ // kCentimeters,
2595
+ // kMillimeters,
2596
+ // kInches,
2597
+ // kPoints,
2598
+ // kPicas,
2599
+ // kQuarterMillimeters,
2600
+ // https://drafts.csswg.org/css-values-4/#viewport-relative-lengths
2601
+ //
2602
+ // See also IsViewportPercentageLength.
2603
+ // kViewportWidth,
2604
+ // kViewportHeight,
2605
+ // kViewportInlineSize,
2606
+ // kViewportBlockSize,
2607
+ // kViewportMin,
2608
+ // kViewportMax,
2609
+ // kSmallViewportWidth,
2610
+ // kSmallViewportHeight,
2611
+ // kSmallViewportInlineSize,
2612
+ // kSmallViewportBlockSize,
2613
+ // kSmallViewportMin,
2614
+ // kSmallViewportMax,
2615
+ // kLargeViewportWidth,
2616
+ // kLargeViewportHeight,
2617
+ // kLargeViewportInlineSize,
2618
+ // kLargeViewportBlockSize,
2619
+ // kLargeViewportMin,
2620
+ // kLargeViewportMax,
2621
+ // kDynamicViewportWidth,
2622
+ // kDynamicViewportHeight,
2623
+ // kDynamicViewportInlineSize,
2624
+ // kDynamicViewportBlockSize,
2625
+ // kDynamicViewportMin,
2626
+ // kDynamicViewportMax,
2627
+ // https://drafts.csswg.org/css-contain-3/#container-lengths
2628
+ //
2629
+ // See also IsContainerPercentageLength.
2630
+ // kContainerWidth,
2631
+ // kContainerHeight,
2632
+ // kContainerInlineSize,
2633
+ // kContainerBlockSize,
2634
+ // kContainerMin,
2635
+ // kContainerMax,
2525
2636
  UnitType[UnitType["kRems"] = 5] = "kRems";
2637
+ // kChs,
2638
+ // kUserUnits, // The SVG term for unitless lengths
2639
+ // Angle units
2526
2640
  UnitType[UnitType["kDegrees"] = 6] = "kDegrees";
2527
2641
  UnitType[UnitType["kRadians"] = 7] = "kRadians";
2528
2642
  UnitType[UnitType["kGradians"] = 8] = "kGradians";
2529
2643
  UnitType[UnitType["kTurns"] = 9] = "kTurns";
2644
+ // Time units
2530
2645
  UnitType[UnitType["kMilliseconds"] = 10] = "kMilliseconds";
2531
2646
  UnitType[UnitType["kSeconds"] = 11] = "kSeconds";
2532
- UnitType[UnitType["kInteger"] = 12] = "kInteger";
2647
+ // kHertz,
2648
+ // kKilohertz,
2649
+ // Resolution
2650
+ // kDotsPerPixel,
2651
+ // kDotsPerInch,
2652
+ // kDotsPerCentimeter,
2653
+ // Other units
2654
+ // kFraction,
2655
+ UnitType[UnitType["kInteger"] = 12] = "kInteger"; // This value is used to handle quirky margins in reflow roots (body, td,
2656
+ // and th) like WinIE. The basic idea is that a stylesheet can use the value
2657
+ // __qem (for quirky em) instead of em. When the quirky value is used, if
2658
+ // you're in quirks mode, the margin will collapse away inside a table cell.
2659
+ // This quirk is specified in the HTML spec but our impl is different.
2660
+ // TODO: Remove this. crbug.com/443952
2661
+ // kQuirkyEms,
2533
2662
  return UnitType;
2534
- }({}); // This value is used to handle quirky margins in reflow roots (body, td,
2535
- // and th) like WinIE. The basic idea is that a stylesheet can use the value
2536
- // __qem (for quirky em) instead of em. When the quirky value is used, if
2537
- // you're in quirks mode, the margin will collapse away inside a table cell.
2538
- // This quirk is specified in the HTML spec but our impl is different.
2539
- // TODO: Remove this. crbug.com/443952
2540
- // kQuirkyEms,
2663
+ }({});
2541
2664
  var UnitCategory = /*#__PURE__*/function (UnitCategory) {
2542
2665
  UnitCategory[UnitCategory["kUNumber"] = 0] = "kUNumber";
2543
2666
  UnitCategory[UnitCategory["kUPercent"] = 1] = "kUPercent";
2544
2667
  UnitCategory[UnitCategory["kULength"] = 2] = "kULength";
2545
2668
  UnitCategory[UnitCategory["kUAngle"] = 3] = "kUAngle";
2546
2669
  UnitCategory[UnitCategory["kUTime"] = 4] = "kUTime";
2670
+ // kUFrequency,
2671
+ // kUResolution,
2547
2672
  UnitCategory[UnitCategory["kUOther"] = 5] = "kUOther";
2548
2673
  return UnitCategory;
2549
2674
  }({});
@@ -2780,6 +2905,7 @@ var CSSStyleValueType = /*#__PURE__*/function (CSSStyleValueType) {
2780
2905
  CSSStyleValueType[CSSStyleValueType["kUnknownType"] = 0] = "kUnknownType";
2781
2906
  CSSStyleValueType[CSSStyleValueType["kUnparsedType"] = 1] = "kUnparsedType";
2782
2907
  CSSStyleValueType[CSSStyleValueType["kKeywordType"] = 2] = "kKeywordType";
2908
+ // Start of CSSNumericValue subclasses
2783
2909
  CSSStyleValueType[CSSStyleValueType["kUnitType"] = 3] = "kUnitType";
2784
2910
  CSSStyleValueType[CSSStyleValueType["kSumType"] = 4] = "kSumType";
2785
2911
  CSSStyleValueType[CSSStyleValueType["kProductType"] = 5] = "kProductType";
@@ -2788,6 +2914,7 @@ var CSSStyleValueType = /*#__PURE__*/function (CSSStyleValueType) {
2788
2914
  CSSStyleValueType[CSSStyleValueType["kMinType"] = 8] = "kMinType";
2789
2915
  CSSStyleValueType[CSSStyleValueType["kMaxType"] = 9] = "kMaxType";
2790
2916
  CSSStyleValueType[CSSStyleValueType["kClampType"] = 10] = "kClampType";
2917
+ // End of CSSNumericValue subclasses
2791
2918
  CSSStyleValueType[CSSStyleValueType["kTransformType"] = 11] = "kTransformType";
2792
2919
  CSSStyleValueType[CSSStyleValueType["kPositionType"] = 12] = "kPositionType";
2793
2920
  CSSStyleValueType[CSSStyleValueType["kURLImageType"] = 13] = "kURLImageType";
@@ -9658,8 +9785,7 @@ var EventService = /*#__PURE__*/function () {
9658
9785
  }, {
9659
9786
  key: "notifyTarget",
9660
9787
  value: function notifyTarget(e, type) {
9661
- var _type;
9662
- type = (_type = type) !== null && _type !== void 0 ? _type : e.type;
9788
+ type = type !== null && type !== void 0 ? type : e.type;
9663
9789
  var key = e.eventPhase === e.CAPTURING_PHASE || e.eventPhase === e.AT_TARGET ? "".concat(type, "capture") : type;
9664
9790
  this.notifyListeners(e, key);
9665
9791
  if (e.eventPhase === e.AT_TARGET) {
@@ -10203,11 +10329,30 @@ var DefaultSceneGraphSelector = /*#__PURE__*/function () {
10203
10329
  * @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
10204
10330
  */
10205
10331
  var ElementEvent = /*#__PURE__*/function (ElementEvent) {
10332
+ // --- @see https://developer.mozilla.org/en-US/docs/Web/API/MutationEvent
10333
+ /**
10334
+ * @see https://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMAttrModified
10335
+ */
10206
10336
  ElementEvent["ATTR_MODIFIED"] = "DOMAttrModified";
10337
+ /**
10338
+ * it has been inserted
10339
+ * @see https://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMNodeInserted
10340
+ */
10207
10341
  ElementEvent["INSERTED"] = "DOMNodeInserted";
10342
+ /**
10343
+ * @see https://www.w3.org/TR/DOM-Level-3-Events/#domnodeinsertedintodocument
10344
+ */
10208
10345
  ElementEvent["MOUNTED"] = "DOMNodeInsertedIntoDocument";
10346
+ /**
10347
+ * it is being removed
10348
+ * @see https://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMNodeRemoved
10349
+ */
10209
10350
  ElementEvent["REMOVED"] = "removed";
10351
+ /**
10352
+ * @see https://www.w3.org/TR/DOM-Level-3-Events/#domnoderemovedfromdocument
10353
+ */
10210
10354
  ElementEvent["UNMOUNTED"] = "DOMNodeRemovedFromDocument";
10355
+ // ---
10211
10356
  ElementEvent["REPARENT"] = "reparent";
10212
10357
  ElementEvent["DESTROY"] = "destroy";
10213
10358
  ElementEvent["BOUNDS_CHANGED"] = "bounds-changed";
@@ -15568,6 +15713,7 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
15568
15713
  value: function destroy() {
15569
15714
  var cleanUp = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
15570
15715
  var skipTriggerEvent = arguments.length > 1 ? arguments[1] : undefined;
15716
+ memoize.clearCache();
15571
15717
  if (!skipTriggerEvent) {
15572
15718
  this.dispatchEvent(new CustomEvent(CanvasEvent.BEFORE_DESTROY));
15573
15719
  }