@antv/l7-renderer 2.17.11 → 2.18.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.
@@ -1,5 +1,5 @@
1
1
  import { IAttribute, IAttributeInitializationOptions } from '@antv/l7-core';
2
- import regl from 'l7regl';
2
+ import regl from 'regl';
3
3
  /**
4
4
  * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#attributes
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import { IBuffer, IBufferInitializationOptions } from '@antv/l7-core';
2
- import regl from 'l7regl';
2
+ import regl from 'regl';
3
3
  /**
4
4
  * adaptor for regl.Buffer
5
5
  * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#buffers
@@ -1,5 +1,5 @@
1
1
  import { IElements, IElementsInitializationOptions } from '@antv/l7-core';
2
- import regl from 'l7regl';
2
+ import regl from 'regl';
3
3
  /**
4
4
  * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#elements
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import { IFramebuffer, IFramebufferInitializationOptions } from '@antv/l7-core';
2
- import regl from 'l7regl';
2
+ import regl from 'regl';
3
3
  /**
4
4
  * adaptor for regl.Framebuffer
5
5
  * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#framebuffers
@@ -1,5 +1,5 @@
1
1
  import { IAttribute, IElements, IModel, IModelDrawOptions, IModelInitializationOptions, IUniform } from '@antv/l7-core';
2
- import regl from 'l7regl';
2
+ import regl from 'regl';
3
3
  /**
4
4
  * adaptor for regl.DrawCommand
5
5
  */
@@ -4,8 +4,11 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
4
  import _createClass from "@babel/runtime/helpers/esm/createClass";
5
5
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
6
6
  import { gl } from '@antv/l7-core';
7
- import { isPlainObject, isTypedArray } from 'lodash';
7
+ import { lodashUtil } from '@antv/l7-utils';
8
8
  import { blendEquationMap, blendFuncMap, cullFaceMap, depthFuncMap, primitiveMap, stencilFuncMap, stencilOpMap } from "./constants";
9
+ var isPlainObject = lodashUtil.isPlainObject,
10
+ isTypedArray = lodashUtil.isTypedArray;
11
+
9
12
  /**
10
13
  * adaptor for regl.DrawCommand
11
14
  */
@@ -1,5 +1,5 @@
1
1
  import { IRenderbuffer, IRenderbufferInitializationOptions } from '@antv/l7-core';
2
- import regl from 'l7regl';
2
+ import regl from 'regl';
3
3
  /**
4
4
  * adaptor for regl.Renderbuffer
5
5
  * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#renderbuffers
@@ -1,5 +1,5 @@
1
1
  import { ITexture2D, ITexture2DInitializationOptions } from '@antv/l7-core';
2
- import regl from 'l7regl';
2
+ import regl from 'regl';
3
3
  /**
4
4
  * adaptor for regl.Buffer
5
5
  * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#buffers
@@ -1,4 +1,4 @@
1
- import regl from 'l7regl';
1
+ import regl from 'regl';
2
2
  export declare const primitiveMap: {
3
3
  [key: string]: 'points' | 'lines' | 'line loop' | 'line strip' | 'triangles' | 'triangle strip' | 'triangle fan';
4
4
  };
@@ -3,8 +3,8 @@
3
3
  * @see https://github.com/regl-project/regl/blob/gh-pages/API.md
4
4
  */
5
5
  import { IAttribute, IAttributeInitializationOptions, IBuffer, IBufferInitializationOptions, IClearOptions, IElements, IElementsInitializationOptions, IExtensions, IFramebuffer, IFramebufferInitializationOptions, IModel, IModelInitializationOptions, IReadPixelsOptions, IRenderConfig, IRendererService, ITexture2D, ITexture2DInitializationOptions } from '@antv/l7-core';
6
- import regl from 'l7regl';
7
6
  import 'reflect-metadata';
7
+ import regl from 'regl';
8
8
  import ReglFramebuffer from './ReglFramebuffer';
9
9
  /**
10
10
  * regl renderer
package/es/regl/index.js CHANGED
@@ -9,10 +9,9 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
9
9
  * @see https://github.com/regl-project/regl/blob/gh-pages/API.md
10
10
  */
11
11
 
12
- import { isMini } from '@antv/l7-utils';
13
12
  import { injectable } from 'inversify';
14
- import regl from 'l7regl';
15
13
  import 'reflect-metadata';
14
+ import regl from 'regl';
16
15
  import ReglAttribute from "./ReglAttribute";
17
16
  import ReglBuffer from "./ReglBuffer";
18
17
  import ReglElements from "./ReglElements";
@@ -102,12 +101,8 @@ var ReglRendererService = (_dec = injectable(), _dec(_class = /*#__PURE__*/funct
102
101
  };
103
102
  });
104
103
  _defineProperty(this, "getContainer", function () {
105
- if (isMini) {
106
- return _this.canvas;
107
- } else {
108
- var _this$canvas;
109
- return (_this$canvas = _this.canvas) === null || _this$canvas === void 0 ? void 0 : _this$canvas.parentElement;
110
- }
104
+ var _this$canvas;
105
+ return (_this$canvas = _this.canvas) === null || _this$canvas === void 0 ? void 0 : _this$canvas.parentElement;
111
106
  });
112
107
  _defineProperty(this, "getCanvas", function () {
113
108
  // return this.$container?.getElementsByTagName('canvas')[0] || null;
@@ -23,8 +23,9 @@ __export(ReglModel_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(ReglModel_exports);
25
25
  var import_l7_core = require("@antv/l7-core");
26
- var import_lodash = require("lodash");
26
+ var import_l7_utils = require("@antv/l7-utils");
27
27
  var import_constants = require("./constants");
28
+ var { isPlainObject, isTypedArray } = import_l7_utils.lodashUtil;
28
29
  var ReglModel = class {
29
30
  constructor(reGl, options) {
30
31
  this.destroyed = false;
@@ -270,13 +271,13 @@ var ReglModel = class {
270
271
  if (uniformValue === null || typeof uniformValue === "number" || // u_A: 1
271
272
  typeof uniformValue === "boolean" || // u_A: false
272
273
  Array.isArray(uniformValue) && typeof uniformValue[0] === "number" || // u_A: [1, 2, 3]
273
- (0, import_lodash.isTypedArray)(uniformValue) || // u_A: Float32Array
274
+ isTypedArray(uniformValue) || // u_A: Float32Array
274
275
  // @ts-ignore
275
276
  uniformValue === "" || "resize" in uniformValue) {
276
277
  uniforms[`${prefix && prefix + "."}${uniformName}`] = uniformValue;
277
278
  return;
278
279
  }
279
- if ((0, import_lodash.isPlainObject)(uniformValue)) {
280
+ if (isPlainObject(uniformValue)) {
280
281
  Object.keys(uniformValue).forEach((childName) => {
281
282
  this.extractUniformsRecursively(
282
283
  childName,
package/lib/regl/index.js CHANGED
@@ -41,10 +41,9 @@ __export(regl_exports, {
41
41
  default: () => ReglRendererService
42
42
  });
43
43
  module.exports = __toCommonJS(regl_exports);
44
- var import_l7_utils = require("@antv/l7-utils");
45
44
  var import_inversify = require("inversify");
46
- var import_l7regl = __toESM(require("l7regl"));
47
45
  var import_reflect_metadata = require("reflect-metadata");
46
+ var import_regl = __toESM(require("regl"));
48
47
  var import_ReglAttribute = __toESM(require("./ReglAttribute"));
49
48
  var import_ReglBuffer = __toESM(require("./ReglBuffer"));
50
49
  var import_ReglElements = __toESM(require("./ReglElements"));
@@ -107,11 +106,7 @@ var ReglRendererService = class {
107
106
  };
108
107
  this.getContainer = () => {
109
108
  var _a;
110
- if (import_l7_utils.isMini) {
111
- return this.canvas;
112
- } else {
113
- return (_a = this.canvas) == null ? void 0 : _a.parentElement;
114
- }
109
+ return (_a = this.canvas) == null ? void 0 : _a.parentElement;
115
110
  };
116
111
  this.getCanvas = () => {
117
112
  return this.canvas;
@@ -133,7 +128,7 @@ var ReglRendererService = class {
133
128
  this.gl = gl;
134
129
  } else {
135
130
  this.gl = await new Promise((resolve, reject) => {
136
- (0, import_l7regl.default)({
131
+ (0, import_regl.default)({
137
132
  canvas: this.canvas,
138
133
  attributes: {
139
134
  alpha: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/l7-renderer",
3
- "version": "2.17.11",
3
+ "version": "2.18.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -25,19 +25,18 @@
25
25
  "author": "xiaoiver",
26
26
  "license": "ISC",
27
27
  "devDependencies": {
28
- "@antv/l7-test-utils": "2.17.11",
28
+ "@antv/l7-test-utils": "2.18.0",
29
29
  "gl": "^5.0.3"
30
30
  },
31
31
  "dependencies": {
32
- "@antv/l7-core": "2.17.11",
33
- "@antv/l7-utils": "2.17.11",
32
+ "@antv/l7-core": "2.18.0",
33
+ "@antv/l7-utils": "2.18.0",
34
34
  "@babel/runtime": "^7.7.7",
35
35
  "inversify": "^5.0.1",
36
- "l7regl": "^0.0.20",
37
- "lodash": "^4.17.15",
38
- "reflect-metadata": "^0.1.13"
36
+ "reflect-metadata": "^0.1.13",
37
+ "regl": "^1.7.0"
39
38
  },
40
- "gitHead": "eb65a689e6078899cfae55ae15232c36d3366e58",
39
+ "gitHead": "89fc0b84737ea58f9eda2fe28d70773a900939f6",
41
40
  "publishConfig": {
42
41
  "access": "public"
43
42
  }