react-globe.gl 2.28.0 → 2.28.1
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/react-globe.gl.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { Material, Object3D, Light, Scene, Camera, WebGLRenderer } from 'three';
|
|
3
3
|
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
|
|
4
4
|
import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js';
|
|
5
|
-
import
|
|
5
|
+
import { ConfigOptions, GlobeInstance } from 'globe.gl';
|
|
6
6
|
|
|
7
7
|
type Accessor<In, Out> = Out | string | ((obj: In) => Out);
|
|
8
8
|
type ObjAccessor<T> = Accessor<object, T>;
|
|
@@ -269,11 +269,11 @@ interface GlobeProps extends ConfigOptions {
|
|
|
269
269
|
interface GlobeMethods {
|
|
270
270
|
// Render control
|
|
271
271
|
pointOfView(): GeoCoords;
|
|
272
|
-
pointOfView(pov: { lat?: number, lng?: number, altitude?: number }, transitionMs?: number):
|
|
273
|
-
pauseAnimation():
|
|
274
|
-
resumeAnimation():
|
|
272
|
+
pointOfView(pov: { lat?: number, lng?: number, altitude?: number }, transitionMs?: number): GlobeInstance;
|
|
273
|
+
pauseAnimation(): GlobeInstance;
|
|
274
|
+
resumeAnimation(): GlobeInstance;
|
|
275
275
|
lights(): Light[];
|
|
276
|
-
lights(lights: Light[]):
|
|
276
|
+
lights(lights: Light[]): GlobeInstance;
|
|
277
277
|
scene(): Scene;
|
|
278
278
|
camera(): Camera;
|
|
279
279
|
renderer(): WebGLRenderer;
|
package/dist/react-globe.gl.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Version 2.28.
|
|
1
|
+
// Version 2.28.1 react-globe.gl - https://github.com/vasturiano/react-globe.gl
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react')) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['react'], factory) :
|
|
@@ -108,30 +108,6 @@
|
|
|
108
108
|
}))));
|
|
109
109
|
};
|
|
110
110
|
|
|
111
|
-
function getDefaultExportFromCjs (x) {
|
|
112
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/*! fromentries. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
116
|
-
|
|
117
|
-
var fromentries;
|
|
118
|
-
var hasRequiredFromentries;
|
|
119
|
-
|
|
120
|
-
function requireFromentries () {
|
|
121
|
-
if (hasRequiredFromentries) return fromentries;
|
|
122
|
-
hasRequiredFromentries = 1;
|
|
123
|
-
fromentries = function fromEntries (iterable) {
|
|
124
|
-
return [...iterable].reduce((obj, [key, val]) => {
|
|
125
|
-
obj[key] = val;
|
|
126
|
-
return obj
|
|
127
|
-
}, {})
|
|
128
|
-
};
|
|
129
|
-
return fromentries;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
var fromentriesExports = requireFromentries();
|
|
133
|
-
var fromEntries = /*@__PURE__*/getDefaultExportFromCjs(fromentriesExports);
|
|
134
|
-
|
|
135
111
|
function _arrayLikeToArray$8(r, a) {
|
|
136
112
|
(null == a || a > r.length) && (a = r.length);
|
|
137
113
|
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
@@ -182,15 +158,6 @@
|
|
|
182
158
|
function _toConsumableArray$6(r) {
|
|
183
159
|
return _arrayWithoutHoles$6(r) || _iterableToArray$6(r) || _unsupportedIterableToArray$8(r) || _nonIterableSpread$6();
|
|
184
160
|
}
|
|
185
|
-
function _typeof$1(o) {
|
|
186
|
-
"@babel/helpers - typeof";
|
|
187
|
-
|
|
188
|
-
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
189
|
-
return typeof o;
|
|
190
|
-
} : function (o) {
|
|
191
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
192
|
-
}, _typeof$1(o);
|
|
193
|
-
}
|
|
194
161
|
function _unsupportedIterableToArray$8(r, a) {
|
|
195
162
|
if (r) {
|
|
196
163
|
if ("string" == typeof r) return _arrayLikeToArray$8(r, a);
|
|
@@ -199,18 +166,8 @@
|
|
|
199
166
|
}
|
|
200
167
|
}
|
|
201
168
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
return o1[k] === o2[k];
|
|
205
|
-
});
|
|
206
|
-
};
|
|
207
|
-
function index$3 (kapsuleComponent, comboParam) {
|
|
208
|
-
var _ref = _typeof$1(comboParam) === 'object' ? comboParam : {
|
|
209
|
-
// support old schema for backwards compatibility
|
|
210
|
-
wrapperElementType: comboParam,
|
|
211
|
-
methodNames: (arguments.length <= 2 ? undefined : arguments[2]) || undefined,
|
|
212
|
-
initPropNames: (arguments.length <= 3 ? undefined : arguments[3]) || undefined
|
|
213
|
-
},
|
|
169
|
+
function index$3 (kapsuleComponent) {
|
|
170
|
+
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
214
171
|
_ref$wrapperElementTy = _ref.wrapperElementType,
|
|
215
172
|
wrapperElementType = _ref$wrapperElementTy === void 0 ? 'div' : _ref$wrapperElementTy,
|
|
216
173
|
_ref$nodeMapper = _ref.nodeMapper,
|
|
@@ -223,17 +180,10 @@
|
|
|
223
180
|
initPropNames = _ref$initPropNames === void 0 ? [] : _ref$initPropNames;
|
|
224
181
|
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
225
182
|
var domEl = React.useRef();
|
|
226
|
-
var _useState = React.useState({}),
|
|
227
|
-
_useState2 = _slicedToArray$7(_useState, 2),
|
|
228
|
-
prevProps = _useState2[0],
|
|
229
|
-
setPrevProps = _useState2[1];
|
|
230
|
-
React.useEffect(function () {
|
|
231
|
-
!shallowEq(props, prevProps) && setPrevProps(props);
|
|
232
|
-
}); // remember previous props
|
|
233
183
|
|
|
234
184
|
// instantiate the inner kapsule component with the defined initPropNames
|
|
235
185
|
var comp = React.useMemo(function () {
|
|
236
|
-
var configOptions = fromEntries(initPropNames.filter(function (p) {
|
|
186
|
+
var configOptions = Object.fromEntries(initPropNames.filter(function (p) {
|
|
237
187
|
return props.hasOwnProperty(p);
|
|
238
188
|
}).map(function (prop) {
|
|
239
189
|
return [prop, props[prop]];
|
|
@@ -258,16 +208,18 @@
|
|
|
258
208
|
, [comp]);
|
|
259
209
|
|
|
260
210
|
// propagate component props that have changed
|
|
261
|
-
var
|
|
262
|
-
Object.keys(
|
|
263
|
-
|
|
211
|
+
var prevPropsRef = React.useRef({});
|
|
212
|
+
Object.keys(omit(props, [].concat(_toConsumableArray$6(methodNames), _toConsumableArray$6(initPropNames)))) // initPropNames or methodNames should not be called
|
|
213
|
+
.filter(function (p) {
|
|
214
|
+
return prevPropsRef.current[p] !== props[p];
|
|
264
215
|
}).forEach(function (p) {
|
|
265
216
|
return _call(p, props[p]);
|
|
266
217
|
});
|
|
218
|
+
prevPropsRef.current = props;
|
|
267
219
|
|
|
268
220
|
// bind external methods to parent ref
|
|
269
221
|
React.useImperativeHandle(ref, function () {
|
|
270
|
-
return fromEntries(methodNames.map(function (method) {
|
|
222
|
+
return Object.fromEntries(methodNames.map(function (method) {
|
|
271
223
|
return [method, function () {
|
|
272
224
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
273
225
|
args[_key2] = arguments[_key2];
|
|
@@ -275,7 +227,7 @@
|
|
|
275
227
|
return _call.apply(void 0, [method].concat(args));
|
|
276
228
|
}];
|
|
277
229
|
}));
|
|
278
|
-
});
|
|
230
|
+
}, [_call]);
|
|
279
231
|
return /*#__PURE__*/React.createElement(wrapperElementType, {
|
|
280
232
|
ref: domEl
|
|
281
233
|
});
|
|
@@ -290,10 +242,10 @@
|
|
|
290
242
|
var destroyFunc = React.useRef();
|
|
291
243
|
var effectCalled = React.useRef(false);
|
|
292
244
|
var renderAfterCalled = React.useRef(false);
|
|
293
|
-
var
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
var setVal =
|
|
245
|
+
var _useState = React.useState(0),
|
|
246
|
+
_useState2 = _slicedToArray$7(_useState, 2);
|
|
247
|
+
_useState2[0];
|
|
248
|
+
var setVal = _useState2[1];
|
|
297
249
|
if (effectCalled.current) {
|
|
298
250
|
renderAfterCalled.current = true;
|
|
299
251
|
}
|
|
@@ -49266,6 +49218,10 @@ void main() {
|
|
|
49266
49218
|
}
|
|
49267
49219
|
}
|
|
49268
49220
|
|
|
49221
|
+
function getDefaultExportFromCjs (x) {
|
|
49222
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
49223
|
+
}
|
|
49224
|
+
|
|
49269
49225
|
var FrameTicker$4 = {exports: {}};
|
|
49270
49226
|
|
|
49271
49227
|
var FrameTicker$3 = FrameTicker$4.exports;
|