@kepler.gl/cloud-providers 3.3.0-alpha.2 → 3.3.0-alpha.21

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.
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.Base = void 0;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
+ var _react = _interopRequireDefault(require("react"));
11
+ var _excluded = ["height", "width", "viewBox", "style", "children", "predefinedClassName", "className", "colors", "totalColor"]; // SPDX-License-Identifier: MIT
12
+ // Copyright contributors to the kepler.gl project
13
+ var getStyleClassFromColor = function getStyleClassFromColor(totalColor, colors) {
14
+ return new Array(totalColor).fill(1).reduce(function (accu, c, i) {
15
+ return "".concat(accu, ".cr").concat(i + 1, " {fill:").concat(colors[i % colors.length], ";}");
16
+ }, '');
17
+ };
18
+ var nop = function nop() {
19
+ return;
20
+ };
21
+ var DEFAULT_STYLE = {
22
+ fill: 'currentColor'
23
+ };
24
+ var Base = exports.Base = function Base(_ref) {
25
+ var _ref$height = _ref.height,
26
+ height = _ref$height === void 0 ? undefined : _ref$height,
27
+ _ref$width = _ref.width,
28
+ width = _ref$width === void 0 ? undefined : _ref$width,
29
+ _ref$viewBox = _ref.viewBox,
30
+ viewBox = _ref$viewBox === void 0 ? '0 0 64 64' : _ref$viewBox,
31
+ _ref$style = _ref.style,
32
+ style = _ref$style === void 0 ? DEFAULT_STYLE : _ref$style,
33
+ children = _ref.children,
34
+ _ref$predefinedClassN = _ref.predefinedClassName,
35
+ predefinedClassName = _ref$predefinedClassN === void 0 ? '' : _ref$predefinedClassN,
36
+ _ref$className = _ref.className,
37
+ className = _ref$className === void 0 ? '' : _ref$className,
38
+ colors = _ref.colors,
39
+ totalColor = _ref.totalColor,
40
+ props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
41
+ var svgHeight = height;
42
+ var svgWidth = width || svgHeight;
43
+ var fillStyle = Array.isArray(colors) && totalColor && getStyleClassFromColor(totalColor, colors);
44
+ return /*#__PURE__*/_react["default"].createElement("svg", (0, _extends2["default"])({
45
+ viewBox: viewBox,
46
+ width: svgWidth,
47
+ height: svgHeight,
48
+ style: style,
49
+ className: "".concat(predefinedClassName, " ").concat(className),
50
+ onClick: nop
51
+ }, props), fillStyle ? /*#__PURE__*/_react["default"].createElement("style", {
52
+ type: "text/css"
53
+ }, fillStyle) : null, children);
54
+ };
55
+ Base.displayName = 'Base Icon';
56
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.js","names":["_react","_interopRequireDefault","require","_excluded","getStyleClassFromColor","totalColor","colors","Array","fill","reduce","accu","c","i","concat","length","nop","DEFAULT_STYLE","Base","exports","_ref","_ref$height","height","undefined","_ref$width","width","_ref$viewBox","viewBox","_ref$style","style","children","_ref$predefinedClassN","predefinedClassName","_ref$className","className","props","_objectWithoutProperties2","svgHeight","svgWidth","fillStyle","isArray","createElement","_extends2","onClick","type","displayName"],"sources":["../../src/base.tsx"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright contributors to the kepler.gl project\n\nimport React, {CSSProperties} from 'react';\n\nconst getStyleClassFromColor = (totalColor: number, colors: string[]) =>\n new Array(totalColor)\n .fill(1)\n .reduce((accu, c, i) => `${accu}.cr${i + 1} {fill:${colors[i % colors.length]};}`, '');\n\nconst nop = () => {\n return;\n};\n\nconst DEFAULT_STYLE: CSSProperties = {\n fill: 'currentColor'\n};\n\nexport type BaseProps = {\n /** Set the height of the icon, ex. '16px' */\n height?: string;\n /** Set the width of the icon, ex. '16px' */\n width?: string;\n /** Set the viewbox of the svg */\n viewBox?: string;\n /** Path element */\n\n predefinedClassName?: string;\n className?: string;\n style?: CSSProperties;\n colors?: string[];\n totalColor?: number;\n} & React.SVGAttributes<SVGSVGElement> &\n React.DOMAttributes<SVGSVGElement>;\n\nexport const Base: React.FC<BaseProps> = ({\n height = undefined,\n width = undefined,\n viewBox = '0 0 64 64',\n style = DEFAULT_STYLE,\n children,\n predefinedClassName = '',\n className = '',\n colors,\n totalColor,\n ...props\n}) => {\n const svgHeight = height;\n const svgWidth = width || svgHeight;\n\n const fillStyle =\n Array.isArray(colors) && totalColor && getStyleClassFromColor(totalColor, colors);\n\n return (\n <svg\n viewBox={viewBox}\n width={svgWidth}\n height={svgHeight}\n style={style}\n className={`${predefinedClassName} ${className}`}\n onClick={nop}\n {...props}\n >\n {fillStyle ? <style type=\"text/css\">{fillStyle}</style> : null}\n {children}\n </svg>\n );\n};\n\nBase.displayName = 'Base Icon';\n"],"mappings":";;;;;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,IAAAC,SAAA,oHAH3C;AACA;AAIA,IAAMC,sBAAsB,GAAG,SAAzBA,sBAAsBA,CAAIC,UAAkB,EAAEC,MAAgB;EAAA,OAClE,IAAIC,KAAK,CAACF,UAAU,CAAC,CAClBG,IAAI,CAAC,CAAC,CAAC,CACPC,MAAM,CAAC,UAACC,IAAI,EAAEC,CAAC,EAAEC,CAAC;IAAA,UAAAC,MAAA,CAAQH,IAAI,SAAAG,MAAA,CAAMD,CAAC,GAAG,CAAC,aAAAC,MAAA,CAAUP,MAAM,CAACM,CAAC,GAAGN,MAAM,CAACQ,MAAM,CAAC;EAAA,CAAI,EAAE,EAAE,CAAC;AAAA;AAE1F,IAAMC,GAAG,GAAG,SAANA,GAAGA,CAAA,EAAS;EAChB;AACF,CAAC;AAED,IAAMC,aAA4B,GAAG;EACnCR,IAAI,EAAE;AACR,CAAC;AAmBM,IAAMS,IAAyB,GAAAC,OAAA,CAAAD,IAAA,GAAG,SAA5BA,IAAyBA,CAAAE,IAAA,EAWhC;EAAA,IAAAC,WAAA,GAAAD,IAAA,CAV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EAAC;EAAU,GAAEL,SAAiB,CAAC,GAAG,IAAI,EAC7DT,QACE,CAAC;AAEV,CAAC;AAEDZ,IAAI,CAAC2B,WAAW,GAAG,WAAW","ignoreList":[]}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ Object.defineProperty(exports, "FILE_CONFLICT_MSG", {
9
+ enumerable: true,
10
+ get: function get() {
11
+ return _provider.FILE_CONFLICT_MSG;
12
+ }
13
+ });
14
+ Object.defineProperty(exports, "KEPLER_FORMAT", {
15
+ enumerable: true,
16
+ get: function get() {
17
+ return _provider.KEPLER_FORMAT;
18
+ }
19
+ });
20
+ Object.defineProperty(exports, "Provider", {
21
+ enumerable: true,
22
+ get: function get() {
23
+ return _provider["default"];
24
+ }
25
+ });
26
+ Object.defineProperty(exports, "Upload", {
27
+ enumerable: true,
28
+ get: function get() {
29
+ return _upload["default"];
30
+ }
31
+ });
32
+ var _provider = _interopRequireWildcard(require("./provider"));
33
+ var _upload = _interopRequireDefault(require("./upload"));
34
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_provider","_interopRequireWildcard","require","_upload","_interopRequireDefault","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor"],"sources":["../../src/index.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright contributors to the kepler.gl project\n\nexport {default as Provider, FILE_CONFLICT_MSG, KEPLER_FORMAT} from './provider';\n// eslint-disable-next-line prettier/prettier\nexport type {MapListItem, Thumbnail, ProviderProps, IconProps, CloudUser} from './provider';\nexport {default as Upload} from './upload';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,SAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA2C,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,wBAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,mBAAAT,CAAA,iBAAAA,CAAA,gBAAAU,OAAA,CAAAV,CAAA,0BAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,cAAAM,EAAA,IAAAd,CAAA,gBAAAc,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,EAAA,OAAAP,CAAA,IAAAD,CAAA,GAAAW,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAnB,CAAA,EAAAc,EAAA,OAAAP,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAM,EAAA,EAAAP,CAAA,IAAAC,CAAA,CAAAM,EAAA,IAAAd,CAAA,CAAAc,EAAA,WAAAN,CAAA,KAAAR,CAAA,EAAAC,CAAA","ignoreList":[]}
@@ -0,0 +1,425 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = exports.KEPLER_FORMAT = exports.FILE_CONFLICT_MSG = void 0;
8
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
12
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
+ var _upload = _interopRequireDefault(require("./upload"));
14
+ // SPDX-License-Identifier: MIT
15
+ // Copyright contributors to the kepler.gl project
16
+
17
+ var NAME = 'cloud-provider';
18
+ var DISPLAY_NAME = 'Cloud Provider';
19
+ var THUMBNAIL = {
20
+ width: 300,
21
+ height: 200
22
+ };
23
+ var ICON = _upload["default"];
24
+ var KEPLER_FORMAT = exports.KEPLER_FORMAT = 'keplergl';
25
+ var FILE_CONFLICT_MSG = exports.FILE_CONFLICT_MSG = 'file_conflict';
26
+
27
+ /**
28
+ * The default provider class
29
+ * @param {object} props
30
+ * @param {string} props.name
31
+ * @param {string} props.displayName
32
+ * @param {React.Component} props.icon - React element
33
+ * @param {object} props.thumbnail - thumbnail size object
34
+ * @param {number} props.thumbnail.width - thumbnail width in pixels
35
+ * @param {number} props.thumbnail.height - thumbnail height in pixels
36
+ * @public
37
+ * @example
38
+ *
39
+ * const myProvider = new Provider({
40
+ * name: 'foo',
41
+ * displayName: 'Foo Storage'
42
+ * icon: Icon,
43
+ * thumbnail: {width: 300, height: 200}
44
+ * })
45
+ */
46
+ var Provider = exports["default"] = /*#__PURE__*/function () {
47
+ function Provider(props) {
48
+ (0, _classCallCheck2["default"])(this, Provider);
49
+ (0, _defineProperty2["default"])(this, "name", void 0);
50
+ (0, _defineProperty2["default"])(this, "displayName", void 0);
51
+ (0, _defineProperty2["default"])(this, "storageMessage", void 0);
52
+ (0, _defineProperty2["default"])(this, "icon", void 0);
53
+ (0, _defineProperty2["default"])(this, "thumbnail", void 0);
54
+ (0, _defineProperty2["default"])(this, "isNew", false);
55
+ this.name = props.name || NAME;
56
+ this.displayName = props.displayName || DISPLAY_NAME;
57
+ this.storageMessage = props.storageMessage;
58
+ this.icon = props.icon || ICON;
59
+ this.thumbnail = props.thumbnail || THUMBNAIL;
60
+ }
61
+
62
+ /**
63
+ * Whether this provider support upload map to a private storage. If truthy, user will be displayed with the storage save icon on the top right of the side bar.
64
+ * @returns
65
+ * @public
66
+ */
67
+ return (0, _createClass2["default"])(Provider, [{
68
+ key: "hasPrivateStorage",
69
+ value: function hasPrivateStorage() {
70
+ return true;
71
+ }
72
+
73
+ /**
74
+ * Whether this provider support share map via a public url, if truthy, user will be displayed with a share map via url under the export map option on the top right of the side bar
75
+ * @returns
76
+ * @public
77
+ */
78
+ }, {
79
+ key: "hasSharingUrl",
80
+ value: function hasSharingUrl() {
81
+ return false;
82
+ }
83
+
84
+ /**
85
+ * This method is called after user share a map, to display the share url.
86
+ * @param fullUrl - Whether to return the full url with domain, or just the location
87
+ * @returns shareUrl
88
+ * @public
89
+ */
90
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
91
+ }, {
92
+ key: "getShareUrl",
93
+ value: function getShareUrl() {
94
+ var fullUrl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
95
+ return '';
96
+ }
97
+
98
+ /**
99
+ * This method is called by kepler.gl demo app to pushes a new location to history, becoming the current location.
100
+ * @returns mapUrl
101
+ * @public
102
+ */
103
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
104
+ }, {
105
+ key: "getMapUrl",
106
+ value: function getMapUrl(loadParams) {
107
+ return '';
108
+ }
109
+
110
+ /**
111
+ * This method is called to determine whether user already logged in to this provider
112
+ * @public
113
+ * @returns {Promise<string>} return the access token if a user already logged in
114
+ */
115
+ }, {
116
+ key: "getAccessToken",
117
+ value: (function () {
118
+ var _getAccessToken = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
119
+ return _regenerator["default"].wrap(function _callee$(_context) {
120
+ while (1) switch (_context.prev = _context.next) {
121
+ case 0:
122
+ return _context.abrupt("return", Promise.reject('You must implement getAccessToken'));
123
+ case 1:
124
+ case "end":
125
+ return _context.stop();
126
+ }
127
+ }, _callee);
128
+ }));
129
+ function getAccessToken() {
130
+ return _getAccessToken.apply(this, arguments);
131
+ }
132
+ return getAccessToken;
133
+ }()
134
+ /**
135
+ * This method is called to get the user name of the current user. It will be displayed in the cloud provider tile.
136
+ * @public
137
+ * @deprecated please use getUser
138
+ * @returns true if a user already logged in
139
+ */
140
+ )
141
+ }, {
142
+ key: "getUserName",
143
+ value: function getUserName() {
144
+ return '';
145
+ }
146
+
147
+ /**
148
+ * return a Promise with the user object
149
+ */
150
+ }, {
151
+ key: "getUser",
152
+ value: (function () {
153
+ var _getUser = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
154
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
155
+ while (1) switch (_context2.prev = _context2.next) {
156
+ case 0:
157
+ return _context2.abrupt("return", Promise.reject('You must implement getUser'));
158
+ case 1:
159
+ case "end":
160
+ return _context2.stop();
161
+ }
162
+ }, _callee2);
163
+ }));
164
+ function getUser() {
165
+ return _getUser.apply(this, arguments);
166
+ }
167
+ return getUser;
168
+ }()
169
+ /**
170
+ * This return a standard error that will trigger the overwrite map modal
171
+ */
172
+ )
173
+ }, {
174
+ key: "getFileConflictError",
175
+ value: function getFileConflictError() {
176
+ return new Error(FILE_CONFLICT_MSG);
177
+ }
178
+
179
+ /**
180
+ * This method will be called when user click the login button in the cloud provider tile.
181
+ * Upon login success and return the user Object {name, email, abbreviated}
182
+ * @public
183
+ */
184
+ }, {
185
+ key: "login",
186
+ value: (function () {
187
+ var _login = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3() {
188
+ return _regenerator["default"].wrap(function _callee3$(_context3) {
189
+ while (1) switch (_context3.prev = _context3.next) {
190
+ case 0:
191
+ return _context3.abrupt("return", Promise.reject(new Error('you must implement the `login` method')));
192
+ case 1:
193
+ case "end":
194
+ return _context3.stop();
195
+ }
196
+ }, _callee3);
197
+ }));
198
+ function login() {
199
+ return _login.apply(this, arguments);
200
+ }
201
+ return login;
202
+ }()
203
+ /**
204
+ * This method will be called when user click the logout button under the cloud provider tile.
205
+ * Upon login success
206
+ * @public
207
+ */
208
+ )
209
+ }, {
210
+ key: "logout",
211
+ value: (function () {
212
+ var _logout = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4() {
213
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
214
+ while (1) switch (_context4.prev = _context4.next) {
215
+ case 0:
216
+ return _context4.abrupt("return", Promise.reject(new Error('you must implement the `logout` method')));
217
+ case 1:
218
+ case "end":
219
+ return _context4.stop();
220
+ }
221
+ }, _callee4);
222
+ }));
223
+ function logout() {
224
+ return _logout.apply(this, arguments);
225
+ }
226
+ return logout;
227
+ }()
228
+ /**
229
+ * This method will be called to upload map for saving and sharing. Kepler.gl will package map data, config, title, description and thumbnail for upload to storage.
230
+ * With the option to overwrite already saved map, and upload as private or public map.
231
+ *
232
+ * @param {Object} param
233
+ * @param {Object} param.mapData - the map object
234
+ * @param {Object} param.mapData.map - {datasets. config, info: {title, description}}
235
+ * @param {Blob} param.mapData.thumbnail - A thumbnail of current map. thumbnail size can be defined by provider by this.thumbnail
236
+ * @param {object} [param.options]
237
+ * @param {boolean} [param.options.overwrite] - whether user choose to overwrite already saved map under the same name
238
+ * @param {boolean} [param.options.isPublic] - whether user wish to share the map with others. if isPublic is truthy, kepler will call this.getShareUrl() to display an URL they can share with others
239
+ * @public
240
+ */
241
+ )
242
+ }, {
243
+ key: "uploadMap",
244
+ value: (function () {
245
+ var _uploadMap = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5(_ref) {
246
+ var mapData, _ref$options, options;
247
+ return _regenerator["default"].wrap(function _callee5$(_context5) {
248
+ while (1) switch (_context5.prev = _context5.next) {
249
+ case 0:
250
+ mapData = _ref.mapData, _ref$options = _ref.options, options = _ref$options === void 0 ? {} : _ref$options;
251
+ return _context5.abrupt("return", Promise.reject('You must implement uploadMap'));
252
+ case 2:
253
+ case "end":
254
+ return _context5.stop();
255
+ }
256
+ }, _callee5);
257
+ }));
258
+ function uploadMap(_x) {
259
+ return _uploadMap.apply(this, arguments);
260
+ }
261
+ return uploadMap;
262
+ }()
263
+ /**
264
+ * This method is called to get a list of maps saved by the current logged in user.
265
+ * @returns visualizations an array of Viz objects
266
+ * @public
267
+ * @example
268
+ * async listMaps() {
269
+ * return [
270
+ * {
271
+ * id: 'a',
272
+ * title: 'My map',
273
+ * description: 'My first kepler map',
274
+ * imageUrl: 'http://',
275
+ * updatedAt: 1582677787000,
276
+ * privateMap: false,
277
+ * loadParams: {}
278
+ * }
279
+ * ];
280
+ * }
281
+ */
282
+ )
283
+ }, {
284
+ key: "listMaps",
285
+ value: (function () {
286
+ var _listMaps = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6() {
287
+ return _regenerator["default"].wrap(function _callee6$(_context6) {
288
+ while (1) switch (_context6.prev = _context6.next) {
289
+ case 0:
290
+ return _context6.abrupt("return", []);
291
+ case 1:
292
+ case "end":
293
+ return _context6.stop();
294
+ }
295
+ }, _callee6);
296
+ }));
297
+ function listMaps() {
298
+ return _listMaps.apply(this, arguments);
299
+ }
300
+ return listMaps;
301
+ }()
302
+ /**
303
+ * Optional: resolve a map preview when the storage gallery tile becomes visible.
304
+ * Providers that omit thumbnails from `listMaps` can implement this to lazy-load them.
305
+ * Default returns `map.thumbnail` when already present.
306
+ * @param map - list item from `listMaps`
307
+ * @returns thumbnail data URL / URL, or undefined
308
+ * @public
309
+ */
310
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
311
+ )
312
+ }, {
313
+ key: "getMapThumbnail",
314
+ value: (function () {
315
+ var _getMapThumbnail = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee7(map) {
316
+ return _regenerator["default"].wrap(function _callee7$(_context7) {
317
+ while (1) switch (_context7.prev = _context7.next) {
318
+ case 0:
319
+ return _context7.abrupt("return", map.thumbnail || undefined);
320
+ case 1:
321
+ case "end":
322
+ return _context7.stop();
323
+ }
324
+ }, _callee7);
325
+ }));
326
+ function getMapThumbnail(_x2) {
327
+ return _getMapThumbnail.apply(this, arguments);
328
+ }
329
+ return getMapThumbnail;
330
+ }()
331
+ /**
332
+ * When true, storage gallery tiles call `getMapThumbnail` once they become visible
333
+ * instead of expecting `listMaps` to include thumbnail bytes/URLs.
334
+ * @public
335
+ */
336
+ )
337
+ }, {
338
+ key: "hasLazyThumbnails",
339
+ value: function hasLazyThumbnails() {
340
+ return false;
341
+ }
342
+
343
+ /**
344
+ * This method will be called when user select a map to load from the storage map viewer
345
+ * @param {*} loadParams - the loadParams property of each visualization object
346
+ * @returns mapResponse - the map object containing dataset config info and format option
347
+ * @public
348
+ * @example
349
+ * async downloadMap(loadParams) {
350
+ * const mockResponse = {
351
+ * map: {
352
+ * datasets: [],
353
+ * config: {},
354
+ * info: {
355
+ * app: 'kepler.gl',
356
+ * created_at: ''
357
+ * title: 'test map',
358
+ * description: 'Hello this is my test dropbox map'
359
+ * }
360
+ * },
361
+ * // pass csv here if your provider currently only support save / load file as csv
362
+ * format: 'keplergl'
363
+ * };
364
+ *
365
+ * return downloadMap;
366
+ * }
367
+ */
368
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
369
+ }, {
370
+ key: "downloadMap",
371
+ value: (function () {
372
+ var _downloadMap = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee8(loadParams) {
373
+ return _regenerator["default"].wrap(function _callee8$(_context8) {
374
+ while (1) switch (_context8.prev = _context8.next) {
375
+ case 0:
376
+ return _context8.abrupt("return", Promise.reject('You must implement downloadMap'));
377
+ case 1:
378
+ case "end":
379
+ return _context8.stop();
380
+ }
381
+ }, _callee8);
382
+ }));
383
+ function downloadMap(_x3) {
384
+ return _downloadMap.apply(this, arguments);
385
+ }
386
+ return downloadMap;
387
+ }()
388
+ /**
389
+ * @return {string} return the storage location url for the current provider
390
+ * @public
391
+ */
392
+ )
393
+ }, {
394
+ key: "getManagementUrl",
395
+ value: function getManagementUrl() {
396
+ throw new Error('You must implement getManagementUrl');
397
+ }
398
+
399
+ /**
400
+ * @typedef {Object} Viz
401
+ * @property {string} id - An unique id
402
+ * @property {string} title - The title of the map
403
+ * @property {string} description - The description of the map
404
+ * @property {string} imageUrl - The imageUrl of the map
405
+ * @property {number} updatedAt - An epoch timestamp in milliseconds
406
+ * @property {boolean} privateMap - Optional, whether if this map is private to the user, or can be accessed by others via URL
407
+ * @property {*} loadParams - A property to be passed to `downloadMap`
408
+ * @public
409
+ */
410
+
411
+ /**
412
+ * The returned object of `downloadMap`. The response object should contain: datasets: [], config: {}, and info: {}
413
+ * each dataset object should be {info: {id, label}, data: {...}}
414
+ * to inform how kepler should process your data object, pass in `format`
415
+ * @typedef {Object} MapResponse
416
+ * @property {Object} map
417
+ * @property {Array<Object>} map.datasets
418
+ * @property {Object} map.config
419
+ * @property {Object} map.info
420
+ * @property {string} format - one of 'csv': csv file string, 'geojson': geojson object, 'row': row object, 'keplergl': datasets array saved using KeplerGlSchema.save
421
+ * @public
422
+ */
423
+ }]);
424
+ }();
425
+ //# sourceMappingURL=provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.js","names":["_upload","_interopRequireDefault","require","NAME","DISPLAY_NAME","THUMBNAIL","width","height","ICON","Upload","KEPLER_FORMAT","exports","FILE_CONFLICT_MSG","Provider","props","_classCallCheck2","_defineProperty2","name","displayName","storageMessage","icon","thumbnail","_createClass2","key","value","hasPrivateStorage","hasSharingUrl","getShareUrl","fullUrl","arguments","length","undefined","getMapUrl","loadParams","_getAccessToken","_asyncToGenerator2","_regenerator","mark","_callee","wrap","_callee$","_context","prev","next","abrupt","Promise","reject","stop","getAccessToken","apply","getUserName","_getUser","_callee2","_callee2$","_context2","getUser","getFileConflictError","Error","_login","_callee3","_callee3$","_context3","login","_logout","_callee4","_callee4$","_context4","logout","_uploadMap","_callee5","_ref","mapData","_ref$options","options","_callee5$","_context5","uploadMap","_x","_listMaps","_callee6","_callee6$","_context6","listMaps","_getMapThumbnail","_callee7","map","_callee7$","_context7","getMapThumbnail","_x2","hasLazyThumbnails","_downloadMap","_callee8","_callee8$","_context8","downloadMap","_x3","getManagementUrl"],"sources":["../../src/provider.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright contributors to the kepler.gl project\n\nimport Upload from './upload';\nimport {MapData, ExportFileOptions, Millisecond, SavedMap} from '@kepler.gl/types';\nimport {ComponentType} from 'react';\n\nexport type MapItemLoadParams = {\n id: string;\n path: string;\n};\n\nexport type MapListItem = {\n id: string;\n title: string;\n description: string;\n loadParams: any;\n imageUrl?: string;\n /** Data URL or remote URL for the map preview; may be filled lazily via getMapThumbnail */\n thumbnail?: string;\n updatedAt?: Millisecond;\n privateMap?: boolean;\n};\n\nexport type CloudUser = {\n name: string;\n email: string;\n thumbnail?: string;\n};\n\nexport type Thumbnail = {\n width: number;\n height: number;\n};\n\nexport type ProviderProps = {\n name?: string;\n displayName?: string;\n storageMessage?: string;\n icon?: ComponentType<IconProps>;\n thumbnail?: Thumbnail;\n};\n\nexport interface IconProps {\n height?: string;\n width?: string;\n}\n\nconst NAME = 'cloud-provider';\nconst DISPLAY_NAME = 'Cloud Provider';\nconst THUMBNAIL = {width: 300, height: 200};\nconst ICON = Upload;\nexport const KEPLER_FORMAT = 'keplergl';\nexport const FILE_CONFLICT_MSG = 'file_conflict';\n\n/**\n * The default provider class\n * @param {object} props\n * @param {string} props.name\n * @param {string} props.displayName\n * @param {React.Component} props.icon - React element\n * @param {object} props.thumbnail - thumbnail size object\n * @param {number} props.thumbnail.width - thumbnail width in pixels\n * @param {number} props.thumbnail.height - thumbnail height in pixels\n * @public\n * @example\n *\n * const myProvider = new Provider({\n * name: 'foo',\n * displayName: 'Foo Storage'\n * icon: Icon,\n * thumbnail: {width: 300, height: 200}\n * })\n */\nexport default class Provider {\n name: string;\n displayName: string;\n storageMessage?: string;\n icon: ComponentType<IconProps>;\n thumbnail: Thumbnail;\n isNew = false;\n\n constructor(props: ProviderProps) {\n this.name = props.name || NAME;\n this.displayName = props.displayName || DISPLAY_NAME;\n this.storageMessage = props.storageMessage;\n this.icon = props.icon || ICON;\n this.thumbnail = props.thumbnail || THUMBNAIL;\n }\n\n /**\n * Whether this provider support upload map to a private storage. If truthy, user will be displayed with the storage save icon on the top right of the side bar.\n * @returns\n * @public\n */\n hasPrivateStorage(): boolean {\n return true;\n }\n\n /**\n * Whether this provider support share map via a public url, if truthy, user will be displayed with a share map via url under the export map option on the top right of the side bar\n * @returns\n * @public\n */\n hasSharingUrl(): boolean {\n return false;\n }\n\n /**\n * This method is called after user share a map, to display the share url.\n * @param fullUrl - Whether to return the full url with domain, or just the location\n * @returns shareUrl\n * @public\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getShareUrl(fullUrl = false): string {\n return '';\n }\n\n /**\n * This method is called by kepler.gl demo app to pushes a new location to history, becoming the current location.\n * @returns mapUrl\n * @public\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getMapUrl(loadParams: MapItemLoadParams): string {\n return '';\n }\n\n /**\n * This method is called to determine whether user already logged in to this provider\n * @public\n * @returns {Promise<string>} return the access token if a user already logged in\n */\n async getAccessToken(): Promise<string | null> {\n return Promise.reject('You must implement getAccessToken');\n }\n\n /**\n * This method is called to get the user name of the current user. It will be displayed in the cloud provider tile.\n * @public\n * @deprecated please use getUser\n * @returns true if a user already logged in\n */\n getUserName(): string {\n return '';\n }\n\n /**\n * return a Promise with the user object\n */\n async getUser(): Promise<CloudUser | null> {\n return Promise.reject('You must implement getUser');\n }\n\n /**\n * This return a standard error that will trigger the overwrite map modal\n */\n getFileConflictError() {\n return new Error(FILE_CONFLICT_MSG);\n }\n\n /**\n * This method will be called when user click the login button in the cloud provider tile.\n * Upon login success and return the user Object {name, email, abbreviated}\n * @public\n */\n async login() {\n return Promise.reject(new Error('you must implement the `login` method'));\n }\n\n /**\n * This method will be called when user click the logout button under the cloud provider tile.\n * Upon login success\n * @public\n */\n async logout(): Promise<void> {\n return Promise.reject(new Error('you must implement the `logout` method'));\n }\n\n /**\n * This method will be called to upload map for saving and sharing. Kepler.gl will package map data, config, title, description and thumbnail for upload to storage.\n * With the option to overwrite already saved map, and upload as private or public map.\n *\n * @param {Object} param\n * @param {Object} param.mapData - the map object\n * @param {Object} param.mapData.map - {datasets. config, info: {title, description}}\n * @param {Blob} param.mapData.thumbnail - A thumbnail of current map. thumbnail size can be defined by provider by this.thumbnail\n * @param {object} [param.options]\n * @param {boolean} [param.options.overwrite] - whether user choose to overwrite already saved map under the same name\n * @param {boolean} [param.options.isPublic] - whether user wish to share the map with others. if isPublic is truthy, kepler will call this.getShareUrl() to display an URL they can share with others\n * @public\n */\n async uploadMap({\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n mapData,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n options = {}\n }: {\n mapData: MapData;\n options: ExportFileOptions;\n }): Promise<MapListItem> {\n return Promise.reject('You must implement uploadMap');\n }\n\n /**\n * This method is called to get a list of maps saved by the current logged in user.\n * @returns visualizations an array of Viz objects\n * @public\n * @example\n * async listMaps() {\n * return [\n * {\n * id: 'a',\n * title: 'My map',\n * description: 'My first kepler map',\n * imageUrl: 'http://',\n * updatedAt: 1582677787000,\n * privateMap: false,\n * loadParams: {}\n * }\n * ];\n * }\n */\n async listMaps(): Promise<MapListItem[]> {\n return [];\n }\n\n /**\n * Optional: resolve a map preview when the storage gallery tile becomes visible.\n * Providers that omit thumbnails from `listMaps` can implement this to lazy-load them.\n * Default returns `map.thumbnail` when already present.\n * @param map - list item from `listMaps`\n * @returns thumbnail data URL / URL, or undefined\n * @public\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async getMapThumbnail(map: MapListItem): Promise<string | undefined> {\n return map.thumbnail || undefined;\n }\n\n /**\n * When true, storage gallery tiles call `getMapThumbnail` once they become visible\n * instead of expecting `listMaps` to include thumbnail bytes/URLs.\n * @public\n */\n hasLazyThumbnails(): boolean {\n return false;\n }\n\n /**\n * This method will be called when user select a map to load from the storage map viewer\n * @param {*} loadParams - the loadParams property of each visualization object\n * @returns mapResponse - the map object containing dataset config info and format option\n * @public\n * @example\n * async downloadMap(loadParams) {\n * const mockResponse = {\n * map: {\n * datasets: [],\n * config: {},\n * info: {\n * app: 'kepler.gl',\n * created_at: ''\n * title: 'test map',\n * description: 'Hello this is my test dropbox map'\n * }\n * },\n * // pass csv here if your provider currently only support save / load file as csv\n * format: 'keplergl'\n * };\n *\n * return downloadMap;\n * }\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async downloadMap(loadParams): Promise<{map: SavedMap; format: string}> {\n return Promise.reject('You must implement downloadMap');\n }\n\n /**\n * @return {string} return the storage location url for the current provider\n * @public\n */\n getManagementUrl(): string {\n throw new Error('You must implement getManagementUrl');\n }\n\n /**\n * @typedef {Object} Viz\n * @property {string} id - An unique id\n * @property {string} title - The title of the map\n * @property {string} description - The description of the map\n * @property {string} imageUrl - The imageUrl of the map\n * @property {number} updatedAt - An epoch timestamp in milliseconds\n * @property {boolean} privateMap - Optional, whether if this map is private to the user, or can be accessed by others via URL\n * @property {*} loadParams - A property to be passed to `downloadMap`\n * @public\n */\n\n /**\n * The returned object of `downloadMap`. The response object should contain: datasets: [], config: {}, and info: {}\n * each dataset object should be {info: {id, label}, data: {...}}\n * to inform how kepler should process your data object, pass in `format`\n * @typedef {Object} MapResponse\n * @property {Object} map\n * @property {Array<Object>} map.datasets\n * @property {Object} map.config\n * @property {Object} map.info\n * @property {string} format - one of 'csv': csv file string, 'geojson': geojson object, 'row': row object, 'keplergl': datasets array saved using KeplerGlSchema.save\n * @public\n */\n}\n"],"mappings":";;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;;AA+CA,IAAMC,IAAI,GAAG,gBAAgB;AAC7B,IAAMC,YAAY,GAAG,gBAAgB;AACrC,IAAMC,SAAS,GAAG;EAACC,KAAK,EAAE,GAAG;EAAEC,MAAM,EAAE;AAAG,CAAC;AAC3C,IAAMC,IAAI,GAAGC,kBAAM;AACZ,IAAMC,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,UAAU;AAChC,IAAME,iBAAiB,GAAAD,OAAA,CAAAC,iBAAA,GAAG,eAAe;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAlBA,IAmBqBC,QAAQ,GAAAF,OAAA;EAQ3B,SAAAE,SAAYC,KAAoB,EAAE;IAAA,IAAAC,gBAAA,mBAAAF,QAAA;IAAA,IAAAG,gBAAA;IAAA,IAAAA,gBAAA;IAAA,IAAAA,gBAAA;IAAA,IAAAA,gBAAA;IAAA,IAAAA,gBAAA;IAAA,IAAAA,gBAAA,4BAF1B,KAAK;IAGX,IAAI,CAACC,IAAI,GAAGH,KAAK,CAACG,IAAI,IAAId,IAAI;IAC9B,IAAI,CAACe,WAAW,GAAGJ,KAAK,CAACI,WAAW,IAAId,YAAY;IACpD,IAAI,CAACe,cAAc,GAAGL,KAAK,CAACK,cAAc;IAC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AACA;AACA;AACA;EAXE;AAAA","ignoreList":[]}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
+ var _react = _interopRequireDefault(require("react"));
11
+ var _base = require("./base");
12
+ var _excluded = ["height", "predefinedClassName"]; // SPDX-License-Identifier: MIT
13
+ // Copyright contributors to the kepler.gl project
14
+ var Upload = function Upload(_ref) {
15
+ var _ref$height = _ref.height,
16
+ height = _ref$height === void 0 ? '16px' : _ref$height,
17
+ _ref$predefinedClassN = _ref.predefinedClassName,
18
+ predefinedClassName = _ref$predefinedClassN === void 0 ? 'data-ex-icons-upload' : _ref$predefinedClassN,
19
+ props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
20
+ return /*#__PURE__*/_react["default"].createElement(_base.Base, (0, _extends2["default"])({
21
+ height: height,
22
+ predefinedClassName: predefinedClassName
23
+ }, props), /*#__PURE__*/_react["default"].createElement("path", {
24
+ d: "M52 9v6a1 1 0 0 1-1 1H13a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h38a1 1 0 0 1 1 1zm-4 31L34.426 21.336a3 3 0 0 0-4.852 0L16 40h8v16h16V40h8z"
25
+ }));
26
+ };
27
+ var _default = exports["default"] = Upload;
28
+ //# sourceMappingURL=upload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload.js","names":["_react","_interopRequireDefault","require","_base","_excluded","Upload","_ref","_ref$height","height","_ref$predefinedClassN","predefinedClassName","props","_objectWithoutProperties2","createElement","Base","_extends2","d","_default","exports"],"sources":["../../src/upload.tsx"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright contributors to the kepler.gl project\n\nimport React from 'react';\nimport {Base, BaseProps} from './base';\n\nconst Upload: React.FC<Partial<BaseProps>> = ({\n height = '16px',\n predefinedClassName = 'data-ex-icons-upload',\n ...props\n}) => (\n <Base height={height} predefinedClassName={predefinedClassName} {...props}>\n <path d=\"M52 9v6a1 1 0 0 1-1 1H13a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h38a1 1 0 0 1 1 1zm-4 31L34.426 21.336a3 3 0 0 0-4.852 0L16 40h8v16h16V40h8z\" />\n </Base>\n);\n\nexport default Upload;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAuC,IAAAE,SAAA,sCAJvC;AACA;AAKA,IAAMC,MAAoC,GAAG,SAAvCA,MAAoCA,CAAAC,IAAA;EAAA,IAAAC,WAAA,GAAAD,IAAA,CACxCE,MAAM;IAANA,MAAM,GAAAD,WAAA,cAAG,MAAM,GAAAA,WAAA;IAAAE,qBAAA,GAAAH,IAAA,CACfI,mBAAmB;IAAnBA,mBAAmB,GAAAD,qBAAA,cAAG,sBAAsB,GAAAA,qBAAA;IACzCE,KAAK,OAAAC,yBAAA,aAAAN,IAAA,EAAAF,SAAA;EAAA,oBAERJ,MAAA,YAAAa,aAAA,CAACV,KAAA,CAAAW,IAAI,MAAAC,SAAA;IAACP,MAAM,EAAEA,MAAO;IAACE,mBAAmB,EAAEA;EAAoB,GAAKC,KAAK,gBACvEX,MAAA,YAAAa,aAAA;IAAMG,CAAC,EAAC;EAAoI,CAAE,CAC1I,CAAC;AAAA,CACR;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEab,MAAM","ignoreList":[]}
@@ -0,0 +1,51 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ var _excluded = ["height", "width", "viewBox", "style", "children", "predefinedClassName", "className", "colors", "totalColor"];
4
+ // SPDX-License-Identifier: MIT
5
+ // Copyright contributors to the kepler.gl project
6
+
7
+ import React from 'react';
8
+ var getStyleClassFromColor = function getStyleClassFromColor(totalColor, colors) {
9
+ return new Array(totalColor).fill(1).reduce(function (accu, c, i) {
10
+ return "".concat(accu, ".cr").concat(i + 1, " {fill:").concat(colors[i % colors.length], ";}");
11
+ }, '');
12
+ };
13
+ var nop = function nop() {
14
+ return;
15
+ };
16
+ var DEFAULT_STYLE = {
17
+ fill: 'currentColor'
18
+ };
19
+ export var Base = function Base(_ref) {
20
+ var _ref$height = _ref.height,
21
+ height = _ref$height === void 0 ? undefined : _ref$height,
22
+ _ref$width = _ref.width,
23
+ width = _ref$width === void 0 ? undefined : _ref$width,
24
+ _ref$viewBox = _ref.viewBox,
25
+ viewBox = _ref$viewBox === void 0 ? '0 0 64 64' : _ref$viewBox,
26
+ _ref$style = _ref.style,
27
+ style = _ref$style === void 0 ? DEFAULT_STYLE : _ref$style,
28
+ children = _ref.children,
29
+ _ref$predefinedClassN = _ref.predefinedClassName,
30
+ predefinedClassName = _ref$predefinedClassN === void 0 ? '' : _ref$predefinedClassN,
31
+ _ref$className = _ref.className,
32
+ className = _ref$className === void 0 ? '' : _ref$className,
33
+ colors = _ref.colors,
34
+ totalColor = _ref.totalColor,
35
+ props = _objectWithoutProperties(_ref, _excluded);
36
+ var svgHeight = height;
37
+ var svgWidth = width || svgHeight;
38
+ var fillStyle = Array.isArray(colors) && totalColor && getStyleClassFromColor(totalColor, colors);
39
+ return /*#__PURE__*/React.createElement("svg", _extends({
40
+ viewBox: viewBox,
41
+ width: svgWidth,
42
+ height: svgHeight,
43
+ style: style,
44
+ className: "".concat(predefinedClassName, " ").concat(className),
45
+ onClick: nop
46
+ }, props), fillStyle ? /*#__PURE__*/React.createElement("style", {
47
+ type: "text/css"
48
+ }, fillStyle) : null, children);
49
+ };
50
+ Base.displayName = 'Base Icon';
51
+ //# sourceMappingURL=base.js.map