@splunk/visualization-context 25.6.0 → 25.7.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.
@@ -110,7 +110,7 @@ var DataSourceContext = React.createContext({
110
110
  return function () {};
111
111
  }
112
112
  });
113
- DataSourceContext.displayName = "data-splunk-visualization-version-DataSourceContext-".concat("25.6.0 - f5eb3abf9");
113
+ DataSourceContext.displayName = "data-splunk-visualization-version-DataSourceContext-".concat("25.7.1 - 6a77c5530");
114
114
  exports.DataSourceContextProvider = DataSourceContext.Provider;
115
115
  exports.DataSourceContextConsumer = DataSourceContext.Consumer;
116
116
  exports.default = DataSourceContext;
package/EventsContext.js CHANGED
@@ -110,7 +110,7 @@ var EventsContext = React.createContext({
110
110
  fieldActions: {},
111
111
  isSplunkWebAvailable: false
112
112
  });
113
- EventsContext.displayName = "data-splunk-visualization-version-EventsContext-".concat("25.6.0 - f5eb3abf9");
113
+ EventsContext.displayName = "data-splunk-visualization-version-EventsContext-".concat("25.7.1 - 6a77c5530");
114
114
  exports.EventsContextProvider = EventsContext.Provider;
115
115
  exports.EventsContextConsumer = EventsContext.Consumer;
116
116
  exports.default = EventsContext;
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/EventsContext.tsx","webpack:///external \"react\""],"names":[],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;;;AClFA;;AAiBA,IAAM,aAAa,GAAG,KAAK,CAAC,aAAN,CAA4C;AAC9D,cAAY,EAAE,EADgD;AAE9D,cAAY,EAAE,EAFgD;AAG9D,sBAAoB,EAAE;AAHwC,CAA5C,CAAtB;AAKA,aAAa,CAAC,WAAd,6DAA+E,oBAA/E;AAEa,gCAAwB,aAAa,CAAC,QAAtC;AACA,gCAAwB,aAAa,CAAC,QAAtC;AACb,kBAAe,aAAf,C;;;;;;;AC1BA,kC","file":"EventsContext.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 18);\n","import * as React from 'react';\n\n// Global provided via webpack\n// eslint-disable-next-line no-underscore-dangle\ndeclare const __VISION_VERSION__: string;\n\nexport interface Action {\n label?: string;\n eventType?: string;\n}\n\nexport interface EventsContextInterface {\n eventActions: Action[];\n fieldActions: Record<string, Action[]>;\n isSplunkWebAvailable: boolean;\n}\n\nconst EventsContext = React.createContext<EventsContextInterface>({\n eventActions: [],\n fieldActions: {},\n isSplunkWebAvailable: false,\n});\nEventsContext.displayName = `data-splunk-visualization-version-EventsContext-${__VISION_VERSION__}`;\n\nexport const EventsContextProvider = EventsContext.Provider;\nexport const EventsContextConsumer = EventsContext.Consumer;\nexport default EventsContext;\n","module.exports = require(\"react\");"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/EventsContext.tsx","webpack:///external \"react\""],"names":[],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;;;AClFA;;AA0BA,IAAM,aAAa,GAAG,KAAK,CAAC,aAAN,CAA4C;AAC9D,cAAY,EAAE,EADgD;AAE9D,cAAY,EAAE,EAFgD;AAG9D,sBAAoB,EAAE;AAHwC,CAA5C,CAAtB;AAKA,aAAa,CAAC,WAAd,6DAA+E,oBAA/E;AAEa,gCAAwB,aAAa,CAAC,QAAtC;AACA,gCAAwB,aAAa,CAAC,QAAtC;AACb,kBAAe,aAAf,C;;;;;;;ACnCA,kC","file":"EventsContext.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 18);\n","import * as React from 'react';\n\n// Global provided via webpack\n// eslint-disable-next-line no-underscore-dangle\ndeclare const __VISION_VERSION__: string;\n\nexport interface Action {\n label: string;\n eventType: string;\n eventtypeValues?: string[];\n}\n\nexport type FieldAction = Action;\n\nexport type EventAction = Action & {\n fieldFilters?: string[];\n};\n\nexport type FieldActions = Record<string, FieldAction[]>;\n\nexport interface EventsContextInterface {\n eventActions: EventAction[];\n fieldActions: FieldActions;\n isSplunkWebAvailable: boolean;\n}\n\nconst EventsContext = React.createContext<EventsContextInterface>({\n eventActions: [],\n fieldActions: {},\n isSplunkWebAvailable: false,\n});\nEventsContext.displayName = `data-splunk-visualization-version-EventsContext-${__VISION_VERSION__}`;\n\nexport const EventsContextProvider = EventsContext.Provider;\nexport const EventsContextConsumer = EventsContext.Consumer;\nexport default EventsContext;\n","module.exports = require(\"react\");"],"sourceRoot":""}
@@ -104,7 +104,7 @@ __webpack_require__.r(__webpack_exports__);
104
104
  /* global __VISION_VERSION__ */
105
105
 
106
106
  var FeatureFlagContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext();
107
- FeatureFlagContext.displayName = "data-splunk-visualization-version-FeatureFlagContext-".concat("25.6.0 - f5eb3abf9");
107
+ FeatureFlagContext.displayName = "data-splunk-visualization-version-FeatureFlagContext-".concat("25.7.1 - 6a77c5530");
108
108
  var FeatureFlagContextProvider = FeatureFlagContext.Provider;
109
109
  var FeatureFlagContextConsumer = FeatureFlagContext.Consumer;
110
110
  /* harmony default export */ __webpack_exports__["default"] = (FeatureFlagContext);
@@ -0,0 +1,113 @@
1
+ /*!
2
+ * Copyright © 2018 Splunk Inc.
3
+ * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
+ * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
+ */
6
+ module.exports =
7
+ /******/ (function(modules) { // webpackBootstrap
8
+ /******/ // The module cache
9
+ /******/ var installedModules = {};
10
+ /******/
11
+ /******/ // The require function
12
+ /******/ function __webpack_require__(moduleId) {
13
+ /******/
14
+ /******/ // Check if module is in cache
15
+ /******/ if(installedModules[moduleId]) {
16
+ /******/ return installedModules[moduleId].exports;
17
+ /******/ }
18
+ /******/ // Create a new module (and put it into the cache)
19
+ /******/ var module = installedModules[moduleId] = {
20
+ /******/ i: moduleId,
21
+ /******/ l: false,
22
+ /******/ exports: {}
23
+ /******/ };
24
+ /******/
25
+ /******/ // Execute the module function
26
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
27
+ /******/
28
+ /******/ // Flag the module as loaded
29
+ /******/ module.l = true;
30
+ /******/
31
+ /******/ // Return the exports of the module
32
+ /******/ return module.exports;
33
+ /******/ }
34
+ /******/
35
+ /******/
36
+ /******/ // expose the modules object (__webpack_modules__)
37
+ /******/ __webpack_require__.m = modules;
38
+ /******/
39
+ /******/ // expose the module cache
40
+ /******/ __webpack_require__.c = installedModules;
41
+ /******/
42
+ /******/ // define getter function for harmony exports
43
+ /******/ __webpack_require__.d = function(exports, name, getter) {
44
+ /******/ if(!__webpack_require__.o(exports, name)) {
45
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
46
+ /******/ }
47
+ /******/ };
48
+ /******/
49
+ /******/ // define __esModule on exports
50
+ /******/ __webpack_require__.r = function(exports) {
51
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
52
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
53
+ /******/ }
54
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
55
+ /******/ };
56
+ /******/
57
+ /******/ // create a fake namespace object
58
+ /******/ // mode & 1: value is a module id, require it
59
+ /******/ // mode & 2: merge all properties of value into the ns
60
+ /******/ // mode & 4: return value when already ns object
61
+ /******/ // mode & 8|1: behave like require
62
+ /******/ __webpack_require__.t = function(value, mode) {
63
+ /******/ if(mode & 1) value = __webpack_require__(value);
64
+ /******/ if(mode & 8) return value;
65
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
66
+ /******/ var ns = Object.create(null);
67
+ /******/ __webpack_require__.r(ns);
68
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
69
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
70
+ /******/ return ns;
71
+ /******/ };
72
+ /******/
73
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
74
+ /******/ __webpack_require__.n = function(module) {
75
+ /******/ var getter = module && module.__esModule ?
76
+ /******/ function getDefault() { return module['default']; } :
77
+ /******/ function getModuleExports() { return module; };
78
+ /******/ __webpack_require__.d(getter, 'a', getter);
79
+ /******/ return getter;
80
+ /******/ };
81
+ /******/
82
+ /******/ // Object.prototype.hasOwnProperty.call
83
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
84
+ /******/
85
+ /******/ // __webpack_public_path__
86
+ /******/ __webpack_require__.p = "";
87
+ /******/
88
+ /******/
89
+ /******/ // Load entry module and return exports
90
+ /******/ return __webpack_require__(__webpack_require__.s = 20);
91
+ /******/ })
92
+ /************************************************************************/
93
+ /******/ ({
94
+
95
+ /***/ 20:
96
+ /***/ (function(module, exports, __webpack_require__) {
97
+
98
+ "use strict";
99
+
100
+
101
+ Object.defineProperty(exports, "__esModule", {
102
+ value: true
103
+ });
104
+ var defaultFeatureFlags = {
105
+ visualizations_useWebWorkersForDSL: false,
106
+ visualizations_enableTrellis: false
107
+ };
108
+ exports.default = defaultFeatureFlags;
109
+
110
+ /***/ })
111
+
112
+ /******/ });
113
+ //# sourceMappingURL=FeatureFlags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/FeatureFlags.tsx"],"names":[],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;AClFA,IAAM,mBAAmB,GAAG;AACxB,oCAAkC,EAAE,KADZ;AAExB,8BAA4B,EAAE;AAFN,CAA5B;AASA,kBAAe,mBAAf,C","file":"FeatureFlags.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 20);\n","const defaultFeatureFlags = {\n visualizations_useWebWorkersForDSL: false,\n visualizations_enableTrellis: false,\n};\n\ntype FeatureFlagKeys = keyof typeof defaultFeatureFlags | string;\n\nexport type FeatureFlags = Record<FeatureFlagKeys, boolean>;\n\nexport default defaultFeatureFlags as FeatureFlags;\n"],"sourceRoot":""}
package/GeoContext.js CHANGED
@@ -87,12 +87,12 @@ module.exports =
87
87
  /******/
88
88
  /******/
89
89
  /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 20);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 21);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
94
94
 
95
- /***/ 20:
95
+ /***/ 21:
96
96
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
97
97
 
98
98
  "use strict";
@@ -104,7 +104,7 @@ __webpack_require__.r(__webpack_exports__);
104
104
  /* global __VISION_VERSION__ */
105
105
 
106
106
  var GeoContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext();
107
- GeoContext.displayName = "data-splunk-visualization-version-GeoContext-".concat("25.6.0 - f5eb3abf9");
107
+ GeoContext.displayName = "data-splunk-visualization-version-GeoContext-".concat("25.7.1 - 6a77c5530");
108
108
  var GeoContextProvider = GeoContext.Provider;
109
109
  var GeoContextConsumer = GeoContext.Consumer;
110
110
  /* harmony default export */ __webpack_exports__["default"] = (GeoContext);
package/GeoContext.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/GeoContext.jsx","webpack:///external \"react\""],"names":["GeoContext","React","GeoContextProvider","GeoContextConsumer"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;AClFA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA,IAAMA,UAAU,gBAAGC,4CAAK,CAAxB,aAAmBA,EAAnB;AACAD,UAAU,CAAVA;AAEO,IAAME,kBAAkB,GAAGF,UAAU,CAArC;AACA,IAAMG,kBAAkB,GAAGH,UAAU,CAArC;AACP,2E;;;;;;;ACRA,kC","file":"GeoContext.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 20);\n","/* global __VISION_VERSION__ */\nimport React from 'react';\n\nconst GeoContext = React.createContext();\nGeoContext.displayName = `data-splunk-visualization-version-GeoContext-${__VISION_VERSION__}`;\n\nexport const GeoContextProvider = GeoContext.Provider;\nexport const GeoContextConsumer = GeoContext.Consumer;\nexport default GeoContext;\n","module.exports = require(\"react\");"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/GeoContext.jsx","webpack:///external \"react\""],"names":["GeoContext","React","GeoContextProvider","GeoContextConsumer"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;AClFA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA,IAAMA,UAAU,gBAAGC,4CAAK,CAAxB,aAAmBA,EAAnB;AACAD,UAAU,CAAVA;AAEO,IAAME,kBAAkB,GAAGF,UAAU,CAArC;AACA,IAAMG,kBAAkB,GAAGH,UAAU,CAArC;AACP,2E;;;;;;;ACRA,kC","file":"GeoContext.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 21);\n","/* global __VISION_VERSION__ */\nimport React from 'react';\n\nconst GeoContext = React.createContext();\nGeoContext.displayName = `data-splunk-visualization-version-GeoContext-${__VISION_VERSION__}`;\n\nexport const GeoContextProvider = GeoContext.Provider;\nexport const GeoContextConsumer = GeoContext.Consumer;\nexport default GeoContext;\n","module.exports = require(\"react\");"],"sourceRoot":""}
@@ -87,7 +87,7 @@ module.exports =
87
87
  /******/
88
88
  /******/
89
89
  /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 21);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 22);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ([
@@ -157,7 +157,8 @@ module.exports = JSON.parse("{\"type\":\"FeatureCollection\",\"features\":[{\"ty
157
157
  /* 18 */,
158
158
  /* 19 */,
159
159
  /* 20 */,
160
- /* 21 */
160
+ /* 21 */,
161
+ /* 22 */
161
162
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
162
163
 
163
164
  "use strict";
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@babel/runtime/helpers/classCallCheck\"","webpack:///external \"@babel/runtime/helpers/createClass\"","webpack:///external \"@babel/runtime/helpers/getPrototypeOf\"","webpack:///external \"@splunk/visualization-context/Provider\"","webpack:///external \"@babel/runtime/helpers/inherits\"","webpack:///external \"@babel/runtime/helpers/possibleConstructorReturn\"","webpack:///./src/GeoJsonProvider.js"],"names":["GeoJsonProvider","mapId","_","offset","count","lists","id","url","Provider"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;AClFA,kD;;;;;;;ACAA,kE;;;;;;ACAA,+D;;;;;;;ACAA,kE;;;;;;ACAA,mE;;;;;;;ACAA,4D;;;;;;ACAA,6E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;;AACA;AACA;AACA;AACA;;IAEMA,e;;;;;AACF,6BAAc;AAAA;;AAAA;AAEb;AAED;AACJ;AACA;AACA;;;;;WACI,mBAAU;AACN;AACH;AAED;AACJ;AACA;AACA;AACA;AACA;;;;WACI,uBAAmB;AAAA,UAATC,KAAS,QAATA,KAAS;;AACf,UAAI,CAAJ,OAAY;AACR,cAAM,UAAUC,+DAAC,CAAjB,gBAAiB,CAAX,CAAN;AACH;;AAED,UAAID,KAAK,CAALA,kBAAJ,MAAkC;AAC9B;AACH;;AACD,UAAIA,KAAK,CAALA,kBAAJ,SAAqC;AACjC;AACH;;AAED,YAAM,UAAUC,+DAAC,CAAjB,2BAAiB,CAAX,CAAN;AACH;AAED;AACJ;AACA;AACA;AACA;AACA;AACA;;;;WACI,wBAAqC;AAAA,+BAA3BC,MAA2B;AAAA,UAA3BA,MAA2B,6BAAlB,CAAkB;AAAA,8BAAfC,KAAe;AAAA,UAAfA,KAAe,4BAAP,GAAO;AACjC,UAAMC,KAAK,GAAG,CACV;AACIC,UAAE,EADN;AAEIC,WAAG,EAAE;AAFT,OADU,EAKV;AACID,UAAE,EADN;AAEIC,WAAG,EAAE;AAFT,OALU,CAAd;AAWA,aAAOF,KAAK,CAALA,cAAoBF,MAAM,GAAjC,KAAOE,CAAP;MAGJ;;;;WACA,kBAAS,C,EAET;;;;WACA,sBAAa,CAAE;;;;EA5DWG,6E;;AA+D9B,gF","file":"GeoJsonProvider.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 21);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@babel/runtime/helpers/classCallCheck\");","module.exports = require(\"@babel/runtime/helpers/createClass\");","module.exports = require(\"@babel/runtime/helpers/getPrototypeOf\");","module.exports = require(\"@splunk/visualization-context/Provider\");","module.exports = require(\"@babel/runtime/helpers/inherits\");","module.exports = require(\"@babel/runtime/helpers/possibleConstructorReturn\");","/* eslint-disable class-methods-use-this,no-useless-constructor */\nimport { _ } from '@splunk/ui-utils/i18n';\nimport Provider from '@splunk/visualization-context/Provider';\nimport USGeoJson from './geoAssets/us.geo.json';\nimport WorldGeoJson from './geoAssets/world.geo.json';\n\nclass GeoJsonProvider extends Provider {\n constructor() {\n super();\n }\n\n /*\n * return provider type\n * @return {String} 'geo'\n */\n getType() {\n return 'geo';\n }\n\n /*\n * getById\n * Todo: if storageType === 'default', fetch geoJson from s3, else fetch from kvstore in scp provider\n * @params {Object} config.mapId 'us' or 'world'\n * @return {Json} USGeoJson or WorldGeoJson\n */\n getById({ mapId }) {\n if (!mapId) {\n throw new Error(_('Invalid mapId.'));\n }\n\n if (mapId.toLowerCase() === 'us') {\n return USGeoJson;\n }\n if (mapId.toLowerCase() === 'world') {\n return WorldGeoJson;\n }\n\n throw new Error(_('The geoJson is not found.'));\n }\n\n /*\n * Todo: link to storage service in the future\n * @params {Object} config\n * @params {Number} offset\n * @params {Number} count\n * @params {Array} [{id: \"us\", url: 'geo://default/us'}, {id: 'world', url: 'geo://default/world'}]\n */\n listIds({ offset = 0, count = 100 }) {\n const lists = [\n {\n id: 'world',\n url: 'geo://default/world',\n },\n {\n id: 'us',\n url: 'geo://default/us',\n },\n ];\n\n return lists.slice(offset, offset + count);\n }\n\n // Todo: be able to upload geoJson in the future\n upload() {}\n\n // Todo: be able to delete geoJson in the future\n deleteById() {}\n}\n\nexport default GeoJsonProvider;\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@babel/runtime/helpers/classCallCheck\"","webpack:///external \"@babel/runtime/helpers/createClass\"","webpack:///external \"@babel/runtime/helpers/getPrototypeOf\"","webpack:///external \"@splunk/visualization-context/Provider\"","webpack:///external \"@babel/runtime/helpers/inherits\"","webpack:///external \"@babel/runtime/helpers/possibleConstructorReturn\"","webpack:///./src/GeoJsonProvider.js"],"names":["GeoJsonProvider","mapId","_","offset","count","lists","id","url","Provider"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;AClFA,kD;;;;;;;ACAA,kE;;;;;;ACAA,+D;;;;;;;ACAA,kE;;;;;;ACAA,mE;;;;;;;ACAA,4D;;;;;;ACAA,6E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;;AACA;AACA;AACA;AACA;;IAEMA,e;;;;;AACF,6BAAc;AAAA;;AAAA;AAEb;AAED;AACJ;AACA;AACA;;;;;WACI,mBAAU;AACN;AACH;AAED;AACJ;AACA;AACA;AACA;AACA;;;;WACI,uBAAmB;AAAA,UAATC,KAAS,QAATA,KAAS;;AACf,UAAI,CAAJ,OAAY;AACR,cAAM,UAAUC,+DAAC,CAAjB,gBAAiB,CAAX,CAAN;AACH;;AAED,UAAID,KAAK,CAALA,kBAAJ,MAAkC;AAC9B;AACH;;AACD,UAAIA,KAAK,CAALA,kBAAJ,SAAqC;AACjC;AACH;;AAED,YAAM,UAAUC,+DAAC,CAAjB,2BAAiB,CAAX,CAAN;AACH;AAED;AACJ;AACA;AACA;AACA;AACA;AACA;;;;WACI,wBAAqC;AAAA,+BAA3BC,MAA2B;AAAA,UAA3BA,MAA2B,6BAAlB,CAAkB;AAAA,8BAAfC,KAAe;AAAA,UAAfA,KAAe,4BAAP,GAAO;AACjC,UAAMC,KAAK,GAAG,CACV;AACIC,UAAE,EADN;AAEIC,WAAG,EAAE;AAFT,OADU,EAKV;AACID,UAAE,EADN;AAEIC,WAAG,EAAE;AAFT,OALU,CAAd;AAWA,aAAOF,KAAK,CAALA,cAAoBF,MAAM,GAAjC,KAAOE,CAAP;MAGJ;;;;WACA,kBAAS,C,EAET;;;;WACA,sBAAa,CAAE;;;;EA5DWG,6E;;AA+D9B,gF","file":"GeoJsonProvider.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 22);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@babel/runtime/helpers/classCallCheck\");","module.exports = require(\"@babel/runtime/helpers/createClass\");","module.exports = require(\"@babel/runtime/helpers/getPrototypeOf\");","module.exports = require(\"@splunk/visualization-context/Provider\");","module.exports = require(\"@babel/runtime/helpers/inherits\");","module.exports = require(\"@babel/runtime/helpers/possibleConstructorReturn\");","/* eslint-disable class-methods-use-this,no-useless-constructor */\nimport { _ } from '@splunk/ui-utils/i18n';\nimport Provider from '@splunk/visualization-context/Provider';\nimport USGeoJson from './geoAssets/us.geo.json';\nimport WorldGeoJson from './geoAssets/world.geo.json';\n\nclass GeoJsonProvider extends Provider {\n constructor() {\n super();\n }\n\n /*\n * return provider type\n * @return {String} 'geo'\n */\n getType() {\n return 'geo';\n }\n\n /*\n * getById\n * Todo: if storageType === 'default', fetch geoJson from s3, else fetch from kvstore in scp provider\n * @params {Object} config.mapId 'us' or 'world'\n * @return {Json} USGeoJson or WorldGeoJson\n */\n getById({ mapId }) {\n if (!mapId) {\n throw new Error(_('Invalid mapId.'));\n }\n\n if (mapId.toLowerCase() === 'us') {\n return USGeoJson;\n }\n if (mapId.toLowerCase() === 'world') {\n return WorldGeoJson;\n }\n\n throw new Error(_('The geoJson is not found.'));\n }\n\n /*\n * Todo: link to storage service in the future\n * @params {Object} config\n * @params {Number} offset\n * @params {Number} count\n * @params {Array} [{id: \"us\", url: 'geo://default/us'}, {id: 'world', url: 'geo://default/world'}]\n */\n listIds({ offset = 0, count = 100 }) {\n const lists = [\n {\n id: 'world',\n url: 'geo://default/world',\n },\n {\n id: 'us',\n url: 'geo://default/us',\n },\n ];\n\n return lists.slice(offset, offset + count);\n }\n\n // Todo: be able to upload geoJson in the future\n upload() {}\n\n // Todo: be able to delete geoJson in the future\n deleteById() {}\n}\n\nexport default GeoJsonProvider;\n"],"sourceRoot":""}
package/GeoRegistry.js CHANGED
@@ -87,7 +87,7 @@ module.exports =
87
87
  /******/
88
88
  /******/
89
89
  /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 22);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 23);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ([
@@ -529,7 +529,8 @@ var BaseRegistry = /*#__PURE__*/function () {
529
529
  /* 19 */,
530
530
  /* 20 */,
531
531
  /* 21 */,
532
- /* 22 */
532
+ /* 22 */,
533
+ /* 23 */
533
534
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
534
535
 
535
536
  "use strict";
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@babel/runtime/regenerator\"","webpack:///external \"@babel/runtime/helpers/classCallCheck\"","webpack:///external \"@babel/runtime/helpers/createClass\"","webpack:///external \"@babel/runtime/helpers/asyncToGenerator\"","webpack:///external \"@babel/runtime/helpers/getPrototypeOf\"","webpack:///external \"@splunk/visualization-context/Provider\"","webpack:///external \"@babel/runtime/helpers/inherits\"","webpack:///external \"@babel/runtime/helpers/possibleConstructorReturn\"","webpack:///external \"@babel/runtime/helpers/slicedToArray\"","webpack:///./src/BaseRegistry.js","webpack:///./src/GeoRegistry.js"],"names":["BaseRegistry","provider","_","console","cachedProvider","providerType","type","isDefault","url","id","obj","options","offset","count","ids","GeoRegistry","geoId","storageType","mapId","geoJson"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA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J;;;;WACA,kBAAS,C,EAET;;;;WACA,uBAAc,CAAE;;;WAxDhB,kBAAgB;AACZ,aAAO,IAAP,WAAO,EAAP;AACH;;;;EAHqBD,qD;;AA4D1B,4E","file":"GeoRegistry.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 22);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@babel/runtime/regenerator\");","module.exports = require(\"@babel/runtime/helpers/classCallCheck\");","module.exports = require(\"@babel/runtime/helpers/createClass\");","module.exports = require(\"@babel/runtime/helpers/asyncToGenerator\");","module.exports = require(\"@babel/runtime/helpers/getPrototypeOf\");","module.exports = require(\"@splunk/visualization-context/Provider\");","module.exports = require(\"@babel/runtime/helpers/inherits\");","module.exports = require(\"@babel/runtime/helpers/possibleConstructorReturn\");","module.exports = require(\"@babel/runtime/helpers/slicedToArray\");","/* eslint-disable class-methods-use-this */\nimport { _ } from '@splunk/ui-utils/i18n';\nimport Provider from '@splunk/visualization-context/Provider';\n\n/**\n * Base Registry\n */\nclass BaseRegistry {\n constructor() {\n this.cachedProviders = {};\n this.defaultProvider = null;\n }\n\n static create() {\n return new BaseRegistry();\n }\n\n /**\n * check whether user defined provider extends the base provider\n * @param {Provider} provider\n * @returns {Boolean}\n */\n isValidProvider(provider) {\n if (provider instanceof Provider) {\n return true;\n }\n throw new Error(_('Invalid Provider'));\n }\n\n /**\n * add default provider to cache\n * @param {Provider} provider\n */\n addDefaultProvider(provider) {\n if (this.isValidProvider(provider)) {\n this.addProvider(provider);\n this.defaultProvider = provider;\n }\n }\n\n /**\n * add provider to cache\n * @param {Provider} provider\n */\n addProvider(provider) {\n if (this.isValidProvider(provider)) {\n if (this.cachedProviders[provider.getType()]) {\n // eslint-disable-next-line\n console.warn(`The provider \"${provider.getType()}\" existed already.`);\n }\n this.cachedProviders[provider.getType()] = provider;\n }\n }\n\n /**\n * delete provider\n * @param {String} providerType\n */\n deleteProvider(providerType) {\n const cachedProvider = this.cachedProviders[providerType];\n if (!cachedProvider) {\n // eslint-disable-next-line\n console.warn(`The provider \"${providerType}\" does not existed`);\n return;\n }\n\n if (this.defaultProvider && providerType === this.defaultProvider.getType()) {\n this.defaultProvider = null;\n }\n delete this.cachedProviders[providerType];\n }\n\n /**\n * find provider from cache\n * @param {String} type\n * @returns {Provider} provider\n */\n findProvider(type) {\n const provider = this.cachedProviders[type];\n if (provider) {\n return provider;\n }\n throw new Error(_('Provider not found'));\n }\n\n /**\n * list all providers\n * @return {Object} provider = { type: 'local', isDefault: true }\n */\n listProviders() {\n return Object.keys(this.cachedProviders).map(type => ({\n type,\n isDefault: type === this.defaultProvider.getType(),\n }));\n }\n\n /**\n * check whether src is a http url or a url used for icon/image-registry (e.g. 'kvstore://image123')\n */\n isResourceURL(url) {\n if (!url || url.indexOf('://') < 0) {\n return false;\n }\n\n const { type } = this.parseURL(url);\n return type !== 'http' && type !== 'https';\n }\n\n /**\n * parse provider type and id from the url\n * @params {String} url 'kvstore://image123'\n * @returns {Object} obj\n * @returns {String} obj.type 'kvstore'\n * @returns {String} obj.id 'image123'\n */\n parseURL(url) {\n if (url) {\n const [type, id] = url.split('://');\n\n if (type && id) {\n return { type, id };\n }\n }\n throw new Error(_('Invalid url'));\n }\n\n /**\n * upload\n * @param {DataURI} dataURI\n * @param {Object} metaData\n * @param {String} providerType e.g. 'kvstore' or 'sui' or 'local'\n * @returns {String} id e.g. 'kvstore://image123'\n */\n async upload(dataURI, metaData, providerType) {\n if (providerType == null && this.defaultProvider == null) {\n throw new Error(_('No valid provider was found. Please add a provider'));\n }\n const provider = providerType ? this.findProvider(providerType) : this.defaultProvider;\n const id = await provider.upload(dataURI, metaData);\n return `${provider.getType()}://${id}`;\n }\n\n /**\n * get object by url\n * @param {String} url 'kvstore://image123'\n * @returns {Object} obj e.g. an image object or icon\n */\n async getByURL(url) {\n const { type, id } = this.parseURL(url);\n const provider = this.findProvider(type);\n const obj = await provider.getById(id);\n return obj;\n }\n\n /**\n * delete object by url\n * @param {String} url 'kvstore://image123' || 'sui://icon123'\n * @returns {Object} obj e.g. an image object or icon\n */\n async deleteByURL(url) {\n const { type, id } = this.parseURL(url);\n const provider = this.findProvider(type);\n const obj = await provider.deleteById(id);\n return obj;\n }\n\n /**\n * list all object ids\n * @params {String} providerType e.g. 'kvstore' or 'sui'\n * @params {Object} options\n * @returns {Array} ids\n */\n async listIds(providerType, options = { offset: 0, count: 100 }) {\n const provider = this.findProvider(providerType);\n const ids = await provider.listIds(options);\n return ids;\n }\n}\n\nexport default BaseRegistry;\n","/* eslint-disable class-methods-use-this */\nimport { _ } from '@splunk/ui-utils/i18n';\nimport BaseRegistry from './BaseRegistry';\n\nclass GeoRegistry extends BaseRegistry {\n static create() {\n return new GeoRegistry();\n }\n\n /*\n * parse url\n * @params {String} url the valid url should be geo://default/us\n * @return {Object}\n * {String} providerType 'geo'\n * {String} storageType 'default' for now // todo: add more in the future if geojson are allowed to save in other storages such as 'kvstore'\n * {String} mapId 'us' or 'world' for now\n */\n parseURL(url) {\n if (!/.+:\\/\\/.*\\/.+/.test(url)) {\n throw new Error(_('Invalid url.'));\n }\n\n const [providerType, geoId] = url.split('://');\n const [storageType, mapId] = geoId.split('/');\n return { providerType, storageType, mapId };\n }\n\n /*\n * get geoJson by url\n * @params {String} url e.g. geo://default/us\n * @return {Json} geoJson\n */\n getByURL(url) {\n try {\n const { providerType, storageType, mapId } = this.parseURL(url);\n const provider = this.findProvider(providerType);\n const geoJson = provider.getById({ storageType, mapId });\n return geoJson;\n } catch (error) {\n throw new Error(_('Cannot get geoJson data.'));\n }\n }\n\n // Todo: return map ids from storage\n /*\n * list all available geojson ids\n * @params {Object}\n * @params {String} providerType\n * @params {Object} options\n * @return {Array} ids [{id: \"us\", url: 'geo://default/us'}, {id: 'world', url: 'geo://default/world'}]\n */\n listIds({ providerType = 'geo', options = { offset: 0, count: 100 } }) {\n const provider = this.findProvider(providerType);\n const ids = provider.listIds(options);\n return ids;\n }\n\n // Todo: be able to upload geoJson in the future\n upload() {}\n\n // Todo: be able to delete geoJson in the future\n deleteByURL() {}\n}\n\nexport default GeoRegistry;\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@babel/runtime/regenerator\"","webpack:///external \"@babel/runtime/helpers/classCallCheck\"","webpack:///external \"@babel/runtime/helpers/createClass\"","webpack:///external \"@babel/runtime/helpers/asyncToGenerator\"","webpack:///external \"@babel/runtime/helpers/getPrototypeOf\"","webpack:///external \"@splunk/visualization-context/Provider\"","webpack:///external \"@babel/runtime/helpers/inherits\"","webpack:///external \"@babel/runtime/helpers/possibleConstructorReturn\"","webpack:///external \"@babel/runtime/helpers/slicedToArray\"","webpack:///./src/BaseRegistry.js","webpack:///./src/GeoRegistry.js"],"names":["BaseRegistry","provider","_","console","cachedProvider","providerType","type","isDefault","url","id","obj","options","offset","count","ids","GeoRegistry","geoId","storageType","mapId","geoJson"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;Q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AZ;AACA;MAGJ;;;;WACA,kBAAS,C,EAET;;;;WACA,uBAAc,CAAE;;;WAxDhB,kBAAgB;AACZ,aAAO,IAAP,WAAO,EAAP;AACH;;;;EAHqBD,qD;;AA4D1B,4E","file":"GeoRegistry.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 23);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@babel/runtime/regenerator\");","module.exports = require(\"@babel/runtime/helpers/classCallCheck\");","module.exports = require(\"@babel/runtime/helpers/createClass\");","module.exports = require(\"@babel/runtime/helpers/asyncToGenerator\");","module.exports = require(\"@babel/runtime/helpers/getPrototypeOf\");","module.exports = require(\"@splunk/visualization-context/Provider\");","module.exports = require(\"@babel/runtime/helpers/inherits\");","module.exports = require(\"@babel/runtime/helpers/possibleConstructorReturn\");","module.exports = require(\"@babel/runtime/helpers/slicedToArray\");","/* eslint-disable class-methods-use-this */\nimport { _ } from '@splunk/ui-utils/i18n';\nimport Provider from '@splunk/visualization-context/Provider';\n\n/**\n * Base Registry\n */\nclass BaseRegistry {\n constructor() {\n this.cachedProviders = {};\n this.defaultProvider = null;\n }\n\n static create() {\n return new BaseRegistry();\n }\n\n /**\n * check whether user defined provider extends the base provider\n * @param {Provider} provider\n * @returns {Boolean}\n */\n isValidProvider(provider) {\n if (provider instanceof Provider) {\n return true;\n }\n throw new Error(_('Invalid Provider'));\n }\n\n /**\n * add default provider to cache\n * @param {Provider} provider\n */\n addDefaultProvider(provider) {\n if (this.isValidProvider(provider)) {\n this.addProvider(provider);\n this.defaultProvider = provider;\n }\n }\n\n /**\n * add provider to cache\n * @param {Provider} provider\n */\n addProvider(provider) {\n if (this.isValidProvider(provider)) {\n if (this.cachedProviders[provider.getType()]) {\n // eslint-disable-next-line\n console.warn(`The provider \"${provider.getType()}\" existed already.`);\n }\n this.cachedProviders[provider.getType()] = provider;\n }\n }\n\n /**\n * delete provider\n * @param {String} providerType\n */\n deleteProvider(providerType) {\n const cachedProvider = this.cachedProviders[providerType];\n if (!cachedProvider) {\n // eslint-disable-next-line\n console.warn(`The provider \"${providerType}\" does not existed`);\n return;\n }\n\n if (this.defaultProvider && providerType === this.defaultProvider.getType()) {\n this.defaultProvider = null;\n }\n delete this.cachedProviders[providerType];\n }\n\n /**\n * find provider from cache\n * @param {String} type\n * @returns {Provider} provider\n */\n findProvider(type) {\n const provider = this.cachedProviders[type];\n if (provider) {\n return provider;\n }\n throw new Error(_('Provider not found'));\n }\n\n /**\n * list all providers\n * @return {Object} provider = { type: 'local', isDefault: true }\n */\n listProviders() {\n return Object.keys(this.cachedProviders).map(type => ({\n type,\n isDefault: type === this.defaultProvider.getType(),\n }));\n }\n\n /**\n * check whether src is a http url or a url used for icon/image-registry (e.g. 'kvstore://image123')\n */\n isResourceURL(url) {\n if (!url || url.indexOf('://') < 0) {\n return false;\n }\n\n const { type } = this.parseURL(url);\n return type !== 'http' && type !== 'https';\n }\n\n /**\n * parse provider type and id from the url\n * @params {String} url 'kvstore://image123'\n * @returns {Object} obj\n * @returns {String} obj.type 'kvstore'\n * @returns {String} obj.id 'image123'\n */\n parseURL(url) {\n if (url) {\n const [type, id] = url.split('://');\n\n if (type && id) {\n return { type, id };\n }\n }\n throw new Error(_('Invalid url'));\n }\n\n /**\n * upload\n * @param {DataURI} dataURI\n * @param {Object} metaData\n * @param {String} providerType e.g. 'kvstore' or 'sui' or 'local'\n * @returns {String} id e.g. 'kvstore://image123'\n */\n async upload(dataURI, metaData, providerType) {\n if (providerType == null && this.defaultProvider == null) {\n throw new Error(_('No valid provider was found. Please add a provider'));\n }\n const provider = providerType ? this.findProvider(providerType) : this.defaultProvider;\n const id = await provider.upload(dataURI, metaData);\n return `${provider.getType()}://${id}`;\n }\n\n /**\n * get object by url\n * @param {String} url 'kvstore://image123'\n * @returns {Object} obj e.g. an image object or icon\n */\n async getByURL(url) {\n const { type, id } = this.parseURL(url);\n const provider = this.findProvider(type);\n const obj = await provider.getById(id);\n return obj;\n }\n\n /**\n * delete object by url\n * @param {String} url 'kvstore://image123' || 'sui://icon123'\n * @returns {Object} obj e.g. an image object or icon\n */\n async deleteByURL(url) {\n const { type, id } = this.parseURL(url);\n const provider = this.findProvider(type);\n const obj = await provider.deleteById(id);\n return obj;\n }\n\n /**\n * list all object ids\n * @params {String} providerType e.g. 'kvstore' or 'sui'\n * @params {Object} options\n * @returns {Array} ids\n */\n async listIds(providerType, options = { offset: 0, count: 100 }) {\n const provider = this.findProvider(providerType);\n const ids = await provider.listIds(options);\n return ids;\n }\n}\n\nexport default BaseRegistry;\n","/* eslint-disable class-methods-use-this */\nimport { _ } from '@splunk/ui-utils/i18n';\nimport BaseRegistry from './BaseRegistry';\n\nclass GeoRegistry extends BaseRegistry {\n static create() {\n return new GeoRegistry();\n }\n\n /*\n * parse url\n * @params {String} url the valid url should be geo://default/us\n * @return {Object}\n * {String} providerType 'geo'\n * {String} storageType 'default' for now // todo: add more in the future if geojson are allowed to save in other storages such as 'kvstore'\n * {String} mapId 'us' or 'world' for now\n */\n parseURL(url) {\n if (!/.+:\\/\\/.*\\/.+/.test(url)) {\n throw new Error(_('Invalid url.'));\n }\n\n const [providerType, geoId] = url.split('://');\n const [storageType, mapId] = geoId.split('/');\n return { providerType, storageType, mapId };\n }\n\n /*\n * get geoJson by url\n * @params {String} url e.g. geo://default/us\n * @return {Json} geoJson\n */\n getByURL(url) {\n try {\n const { providerType, storageType, mapId } = this.parseURL(url);\n const provider = this.findProvider(providerType);\n const geoJson = provider.getById({ storageType, mapId });\n return geoJson;\n } catch (error) {\n throw new Error(_('Cannot get geoJson data.'));\n }\n }\n\n // Todo: return map ids from storage\n /*\n * list all available geojson ids\n * @params {Object}\n * @params {String} providerType\n * @params {Object} options\n * @return {Array} ids [{id: \"us\", url: 'geo://default/us'}, {id: 'world', url: 'geo://default/world'}]\n */\n listIds({ providerType = 'geo', options = { offset: 0, count: 100 } }) {\n const provider = this.findProvider(providerType);\n const ids = provider.listIds(options);\n return ids;\n }\n\n // Todo: be able to upload geoJson in the future\n upload() {}\n\n // Todo: be able to delete geoJson in the future\n deleteByURL() {}\n}\n\nexport default GeoRegistry;\n"],"sourceRoot":""}
package/IconContext.js CHANGED
@@ -87,12 +87,12 @@ module.exports =
87
87
  /******/
88
88
  /******/
89
89
  /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 23);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 24);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
94
94
 
95
- /***/ 23:
95
+ /***/ 24:
96
96
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
97
97
 
98
98
  "use strict";
@@ -104,7 +104,7 @@ __webpack_require__.r(__webpack_exports__);
104
104
  /* global __VISION_VERSION__ */
105
105
 
106
106
  var IconContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext();
107
- IconContext.displayName = "data-splunk-visualization-version-IconContext-".concat("25.6.0 - f5eb3abf9");
107
+ IconContext.displayName = "data-splunk-visualization-version-IconContext-".concat("25.7.1 - 6a77c5530");
108
108
  var IconContextProvider = IconContext.Provider;
109
109
  var IconContextConsumer = IconContext.Consumer;
110
110
  /* harmony default export */ __webpack_exports__["default"] = (IconContext);
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/IconContext.jsx","webpack:///external \"react\""],"names":["IconContext","React","IconContextProvider","IconContextConsumer"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;AClFA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA,IAAMA,WAAW,gBAAGC,4CAAK,CAAzB,aAAoBA,EAApB;AACAD,WAAW,CAAXA;AAEO,IAAME,mBAAmB,GAAGF,WAAW,CAAvC;AACA,IAAMG,mBAAmB,GAAGH,WAAW,CAAvC;AACP,4E;;;;;;;ACRA,kC","file":"IconContext.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 23);\n","/* global __VISION_VERSION__ */\nimport React from 'react';\n\nconst IconContext = React.createContext();\nIconContext.displayName = `data-splunk-visualization-version-IconContext-${__VISION_VERSION__}`;\n\nexport const IconContextProvider = IconContext.Provider;\nexport const IconContextConsumer = IconContext.Consumer;\nexport default IconContext;\n","module.exports = require(\"react\");"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/IconContext.jsx","webpack:///external \"react\""],"names":["IconContext","React","IconContextProvider","IconContextConsumer"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;AClFA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA,IAAMA,WAAW,gBAAGC,4CAAK,CAAzB,aAAoBA,EAApB;AACAD,WAAW,CAAXA;AAEO,IAAME,mBAAmB,GAAGF,WAAW,CAAvC;AACA,IAAMG,mBAAmB,GAAGH,WAAW,CAAvC;AACP,4E;;;;;;;ACRA,kC","file":"IconContext.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 24);\n","/* global __VISION_VERSION__ */\nimport React from 'react';\n\nconst IconContext = React.createContext();\nIconContext.displayName = `data-splunk-visualization-version-IconContext-${__VISION_VERSION__}`;\n\nexport const IconContextProvider = IconContext.Provider;\nexport const IconContextConsumer = IconContext.Consumer;\nexport default IconContext;\n","module.exports = require(\"react\");"],"sourceRoot":""}
package/IconRegistry.js CHANGED
@@ -87,7 +87,7 @@ module.exports =
87
87
  /******/
88
88
  /******/
89
89
  /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 24);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 25);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ([
@@ -541,7 +541,8 @@ module.exports = require("@babel/runtime/helpers/get");
541
541
  /* 21 */,
542
542
  /* 22 */,
543
543
  /* 23 */,
544
- /* 24 */
544
+ /* 24 */,
545
+ /* 25 */
545
546
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
546
547
 
547
548
  "use strict";
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@babel/runtime/regenerator\"","webpack:///external \"@babel/runtime/helpers/classCallCheck\"","webpack:///external \"@babel/runtime/helpers/createClass\"","webpack:///external \"@babel/runtime/helpers/asyncToGenerator\"","webpack:///external \"@babel/runtime/helpers/getPrototypeOf\"","webpack:///external \"@splunk/visualization-context/Provider\"","webpack:///external \"@babel/runtime/helpers/inherits\"","webpack:///external \"@babel/runtime/helpers/possibleConstructorReturn\"","webpack:///external \"@babel/runtime/helpers/defineProperty\"","webpack:///external \"@babel/runtime/helpers/slicedToArray\"","webpack:///./src/BaseRegistry.js","webpack:///external \"@babel/runtime/helpers/get\"","webpack:///./src/IconRegistry.js"],"names":["BaseRegistry","provider","_","console","cachedProvider","providerType","type","isDefault","url","id","obj","options","offset","count","ids","IconRegistry","dataURI"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;AClFA,kD;;;;;;ACAA,uD;;;;;;ACAA,kE;;;;;;ACAA,+D;;;;;;ACAA,oE;;;;;;ACAA,kE;;;;;;ACAA,mE;;;;;;;ACAA,4D;;;;;;ACAA,6E;;;;;;ACAA,kE;;;;;;ACAA,iE;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;AACA;AACA;AAEA;AACA;AACA;;IACMA,Y;AACF,0BAAc;AAAA;;AACV;AACA;AACH;;;;;AAMD;AACJ;AACA;AACA;AACA;AACI,uCAA0B;AACtB,UAAIC,QAAQ,YAAZ,+EAAkC;AAC9B;AACH;;AACD,YAAM,UAAUC,+DAAC,CAAjB,kBAAiB,CAAX,CAAN;AACH;AAED;AACJ;AACA;AACA;;;;WACI,sCAA6B;AACzB,UAAI,qBAAJ,QAAI,CAAJ,EAAoC;AAChC;AACA;AACH;AACJ;AAED;AACJ;AACA;AACA;;;;WACI,+BAAsB;AAClB,UAAI,qBAAJ,QAAI,CAAJ,EAAoC;AAChC,YAAI,qBAAqBD,QAAQ,CAAjC,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AAAA;AAA4BC,uBAA5B,8DAAsC;AAAEC,wBAAM,EAAR;AAAaC,uBAAK,EAAE;AAApB,iBAAVF;AAClBV,wBADV,GACqB,kBADrB,YACqB,CAAXA;AADV;AAAA,uBAEsBA,QAAQ,CAARA,QAFtB,OAEsBA,CAFtB;;AAAA;AAEUa,mBAFV,iBAEUA;AAFV;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;WA/JA,kBAAgB;AACZ,aAAO,IAAP,YAAO,EAAP;AACH;;;;;;AAoKL,6E;;;;;;ACnLA,uD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;;AACA;AACA;AAEA;AACA;AACA;;IACMC,Y;;;;;;;;;;;;;;AAOF;AACJ;AACA;AACA;AACA;AACI,uCAA0B;AACtB,aAAO,YAAY,CAAZ,uBAAoC,gBAAI;AAAA,eAAIC,OAAO,CAAPA,iCAAmC,CAAvC;AAA/C,OAAO,CAAP;AACH;AAED;AACJ;AACA;AACA;AACA;AACA;AACA;;;;WACI,iDAAwC;AACpC,UAAI,CAAC,sBAAL,OAAK,CAAL,EAAqC;AACjC,cAAM,UAAUd,+DAAC,CAAjB,2EAAiB,CAAX,CAAN;AACH;;AAED;AACH;;;WA5BD,kBAAgB;AACZ,aAAO,IAAP,YAAO,EAAP;AACH;;;;EAHsBF,qD;;6EAArBe,Y,uBAKyB,O;;AA2B/B,6E","file":"IconRegistry.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 24);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@babel/runtime/regenerator\");","module.exports = require(\"@babel/runtime/helpers/classCallCheck\");","module.exports = require(\"@babel/runtime/helpers/createClass\");","module.exports = require(\"@babel/runtime/helpers/asyncToGenerator\");","module.exports = require(\"@babel/runtime/helpers/getPrototypeOf\");","module.exports = require(\"@splunk/visualization-context/Provider\");","module.exports = require(\"@babel/runtime/helpers/inherits\");","module.exports = require(\"@babel/runtime/helpers/possibleConstructorReturn\");","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/slicedToArray\");","/* eslint-disable class-methods-use-this */\nimport { _ } from '@splunk/ui-utils/i18n';\nimport Provider from '@splunk/visualization-context/Provider';\n\n/**\n * Base Registry\n */\nclass BaseRegistry {\n constructor() {\n this.cachedProviders = {};\n this.defaultProvider = null;\n }\n\n static create() {\n return new BaseRegistry();\n }\n\n /**\n * check whether user defined provider extends the base provider\n * @param {Provider} provider\n * @returns {Boolean}\n */\n isValidProvider(provider) {\n if (provider instanceof Provider) {\n return true;\n }\n throw new Error(_('Invalid Provider'));\n }\n\n /**\n * add default provider to cache\n * @param {Provider} provider\n */\n addDefaultProvider(provider) {\n if (this.isValidProvider(provider)) {\n this.addProvider(provider);\n this.defaultProvider = provider;\n }\n }\n\n /**\n * add provider to cache\n * @param {Provider} provider\n */\n addProvider(provider) {\n if (this.isValidProvider(provider)) {\n if (this.cachedProviders[provider.getType()]) {\n // eslint-disable-next-line\n console.warn(`The provider \"${provider.getType()}\" existed already.`);\n }\n this.cachedProviders[provider.getType()] = provider;\n }\n }\n\n /**\n * delete provider\n * @param {String} providerType\n */\n deleteProvider(providerType) {\n const cachedProvider = this.cachedProviders[providerType];\n if (!cachedProvider) {\n // eslint-disable-next-line\n console.warn(`The provider \"${providerType}\" does not existed`);\n return;\n }\n\n if (this.defaultProvider && providerType === this.defaultProvider.getType()) {\n this.defaultProvider = null;\n }\n delete this.cachedProviders[providerType];\n }\n\n /**\n * find provider from cache\n * @param {String} type\n * @returns {Provider} provider\n */\n findProvider(type) {\n const provider = this.cachedProviders[type];\n if (provider) {\n return provider;\n }\n throw new Error(_('Provider not found'));\n }\n\n /**\n * list all providers\n * @return {Object} provider = { type: 'local', isDefault: true }\n */\n listProviders() {\n return Object.keys(this.cachedProviders).map(type => ({\n type,\n isDefault: type === this.defaultProvider.getType(),\n }));\n }\n\n /**\n * check whether src is a http url or a url used for icon/image-registry (e.g. 'kvstore://image123')\n */\n isResourceURL(url) {\n if (!url || url.indexOf('://') < 0) {\n return false;\n }\n\n const { type } = this.parseURL(url);\n return type !== 'http' && type !== 'https';\n }\n\n /**\n * parse provider type and id from the url\n * @params {String} url 'kvstore://image123'\n * @returns {Object} obj\n * @returns {String} obj.type 'kvstore'\n * @returns {String} obj.id 'image123'\n */\n parseURL(url) {\n if (url) {\n const [type, id] = url.split('://');\n\n if (type && id) {\n return { type, id };\n }\n }\n throw new Error(_('Invalid url'));\n }\n\n /**\n * upload\n * @param {DataURI} dataURI\n * @param {Object} metaData\n * @param {String} providerType e.g. 'kvstore' or 'sui' or 'local'\n * @returns {String} id e.g. 'kvstore://image123'\n */\n async upload(dataURI, metaData, providerType) {\n if (providerType == null && this.defaultProvider == null) {\n throw new Error(_('No valid provider was found. Please add a provider'));\n }\n const provider = providerType ? this.findProvider(providerType) : this.defaultProvider;\n const id = await provider.upload(dataURI, metaData);\n return `${provider.getType()}://${id}`;\n }\n\n /**\n * get object by url\n * @param {String} url 'kvstore://image123'\n * @returns {Object} obj e.g. an image object or icon\n */\n async getByURL(url) {\n const { type, id } = this.parseURL(url);\n const provider = this.findProvider(type);\n const obj = await provider.getById(id);\n return obj;\n }\n\n /**\n * delete object by url\n * @param {String} url 'kvstore://image123' || 'sui://icon123'\n * @returns {Object} obj e.g. an image object or icon\n */\n async deleteByURL(url) {\n const { type, id } = this.parseURL(url);\n const provider = this.findProvider(type);\n const obj = await provider.deleteById(id);\n return obj;\n }\n\n /**\n * list all object ids\n * @params {String} providerType e.g. 'kvstore' or 'sui'\n * @params {Object} options\n * @returns {Array} ids\n */\n async listIds(providerType, options = { offset: 0, count: 100 }) {\n const provider = this.findProvider(providerType);\n const ids = await provider.listIds(options);\n return ids;\n }\n}\n\nexport default BaseRegistry;\n","module.exports = require(\"@babel/runtime/helpers/get\");","/* eslint-disable class-methods-use-this */\nimport { _ } from '@splunk/ui-utils/i18n';\nimport BaseRegistry from './BaseRegistry';\n\n/**\n * Icon Registry\n */\nclass IconRegistry extends BaseRegistry {\n static create() {\n return new IconRegistry();\n }\n\n static VALID_MEDIA_TYPES = ['svg'];\n\n /**\n * check if the the media type from the dataURI belongs to the supported types\n * @param {DataURI} dataURI\n * @returns {Boolean}\n */\n isValidMediaType(dataURI) {\n return IconRegistry.VALID_MEDIA_TYPES.some(type => dataURI.indexOf(`image/${type}`) > -1);\n }\n\n /**\n * upload image if the image format is supported\n * @param {DataURI} dataURI\n * @param {Object} metaData\n * @param {String} providerType e.g. 'kvstore', or 'sui'\n * @returns {String} id e.g. 'kvstore://image123'\n */\n upload(dataURI, metaData, providerType) {\n if (!this.isValidMediaType(dataURI)) {\n throw new Error(_('The format of the uploaded file is not supported. Please upload svg file.'));\n }\n\n return super.upload(dataURI, metaData, providerType);\n }\n}\n\nexport default IconRegistry;\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@babel/runtime/regenerator\"","webpack:///external \"@babel/runtime/helpers/classCallCheck\"","webpack:///external \"@babel/runtime/helpers/createClass\"","webpack:///external \"@babel/runtime/helpers/asyncToGenerator\"","webpack:///external \"@babel/runtime/helpers/getPrototypeOf\"","webpack:///external \"@splunk/visualization-context/Provider\"","webpack:///external \"@babel/runtime/helpers/inherits\"","webpack:///external \"@babel/runtime/helpers/possibleConstructorReturn\"","webpack:///external \"@babel/runtime/helpers/defineProperty\"","webpack:///external \"@babel/runtime/helpers/slicedToArray\"","webpack:///./src/BaseRegistry.js","webpack:///external \"@babel/runtime/helpers/get\"","webpack:///./src/IconRegistry.js"],"names":["BaseRegistry","provider","_","console","cachedProvider","providerType","type","isDefault","url","id","obj","options","offset","count","ids","IconRegistry","dataURI"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;AClFA,kD;;;;;;ACAA,uD;;;;;;ACAA,kE;;;;;;ACAA,+D;;;;;;ACAA,oE;;;;;;ACAA,kE;;;;;;ACAA,mE;;;;;;;ACAA,4D;;;;;;ACAA,6E;;;;;;ACAA,kE;;;;;;ACAA,iE;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;AACA;AACA;AAEA;AACA;AACA;;IACMA,Y;AACF,0BAAc;AAAA;;AACV;AACA;AACH;;;;;AAMD;AACJ;AACA;AACA;AACA;AACI,uCAA0B;AACtB,UAAIC,QAAQ,YAAZ,+EAAkC;AAC9B;AACH;;AACD,YAAM,UAAUC,+DAAC,CAAjB,kBAAiB,CAAX,CAAN;AACH;AAED;AACJ;AACA;AACA;;;;WACI,sCAA6B;AACzB,UAAI,q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AA;AAGUS,mBAHV,iBAGUA;AAHV;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;AAOA;AACJ;AACA;AACA;AACA;AACA;;;;;yLACI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA4BC,uBAA5B,8DAAsC;AAAEC,wBAAM,EAAR;AAAaC,uBAAK,EAAE;AAApB,iBAAVF;AAClBV,wBADV,GACqB,kBADrB,YACqB,CAAXA;AADV;AAAA,uBAEsBA,QAAQ,CAARA,QAFtB,OAEsBA,CAFtB;;AAAA;AAEUa,mBAFV,iBAEUA;AAFV;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;WA/JA,kBAAgB;AACZ,aAAO,IAAP,YAAO,EAAP;AACH;;;;;;AAoKL,6E;;;;;;ACnLA,uD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;;AACA;AACA;AAEA;AACA;AACA;;IACMC,Y;;;;;;;;;;;;;;AAOF;AACJ;AACA;AACA;AACA;AACI,uCAA0B;AACtB,aAAO,YAAY,CAAZ,uBAAoC,gBAAI;AAAA,eAAIC,OAAO,CAAPA,iCAAmC,CAAvC;AAA/C,OAAO,CAAP;AACH;AAED;AACJ;AACA;AACA;AACA;AACA;AACA;;;;WACI,iDAAwC;AACpC,UAAI,CAAC,sBAAL,OAAK,CAAL,EAAqC;AACjC,cAAM,UAAUd,+DAAC,CAAjB,2EAAiB,CAAX,CAAN;AACH;;AAED;AACH;;;WA5BD,kBAAgB;AACZ,aAAO,IAAP,YAAO,EAAP;AACH;;;;EAHsBF,qD;;6EAArBe,Y,uBAKyB,O;;AA2B/B,6E","file":"IconRegistry.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 25);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@babel/runtime/regenerator\");","module.exports = require(\"@babel/runtime/helpers/classCallCheck\");","module.exports = require(\"@babel/runtime/helpers/createClass\");","module.exports = require(\"@babel/runtime/helpers/asyncToGenerator\");","module.exports = require(\"@babel/runtime/helpers/getPrototypeOf\");","module.exports = require(\"@splunk/visualization-context/Provider\");","module.exports = require(\"@babel/runtime/helpers/inherits\");","module.exports = require(\"@babel/runtime/helpers/possibleConstructorReturn\");","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/slicedToArray\");","/* eslint-disable class-methods-use-this */\nimport { _ } from '@splunk/ui-utils/i18n';\nimport Provider from '@splunk/visualization-context/Provider';\n\n/**\n * Base Registry\n */\nclass BaseRegistry {\n constructor() {\n this.cachedProviders = {};\n this.defaultProvider = null;\n }\n\n static create() {\n return new BaseRegistry();\n }\n\n /**\n * check whether user defined provider extends the base provider\n * @param {Provider} provider\n * @returns {Boolean}\n */\n isValidProvider(provider) {\n if (provider instanceof Provider) {\n return true;\n }\n throw new Error(_('Invalid Provider'));\n }\n\n /**\n * add default provider to cache\n * @param {Provider} provider\n */\n addDefaultProvider(provider) {\n if (this.isValidProvider(provider)) {\n this.addProvider(provider);\n this.defaultProvider = provider;\n }\n }\n\n /**\n * add provider to cache\n * @param {Provider} provider\n */\n addProvider(provider) {\n if (this.isValidProvider(provider)) {\n if (this.cachedProviders[provider.getType()]) {\n // eslint-disable-next-line\n console.warn(`The provider \"${provider.getType()}\" existed already.`);\n }\n this.cachedProviders[provider.getType()] = provider;\n }\n }\n\n /**\n * delete provider\n * @param {String} providerType\n */\n deleteProvider(providerType) {\n const cachedProvider = this.cachedProviders[providerType];\n if (!cachedProvider) {\n // eslint-disable-next-line\n console.warn(`The provider \"${providerType}\" does not existed`);\n return;\n }\n\n if (this.defaultProvider && providerType === this.defaultProvider.getType()) {\n this.defaultProvider = null;\n }\n delete this.cachedProviders[providerType];\n }\n\n /**\n * find provider from cache\n * @param {String} type\n * @returns {Provider} provider\n */\n findProvider(type) {\n const provider = this.cachedProviders[type];\n if (provider) {\n return provider;\n }\n throw new Error(_('Provider not found'));\n }\n\n /**\n * list all providers\n * @return {Object} provider = { type: 'local', isDefault: true }\n */\n listProviders() {\n return Object.keys(this.cachedProviders).map(type => ({\n type,\n isDefault: type === this.defaultProvider.getType(),\n }));\n }\n\n /**\n * check whether src is a http url or a url used for icon/image-registry (e.g. 'kvstore://image123')\n */\n isResourceURL(url) {\n if (!url || url.indexOf('://') < 0) {\n return false;\n }\n\n const { type } = this.parseURL(url);\n return type !== 'http' && type !== 'https';\n }\n\n /**\n * parse provider type and id from the url\n * @params {String} url 'kvstore://image123'\n * @returns {Object} obj\n * @returns {String} obj.type 'kvstore'\n * @returns {String} obj.id 'image123'\n */\n parseURL(url) {\n if (url) {\n const [type, id] = url.split('://');\n\n if (type && id) {\n return { type, id };\n }\n }\n throw new Error(_('Invalid url'));\n }\n\n /**\n * upload\n * @param {DataURI} dataURI\n * @param {Object} metaData\n * @param {String} providerType e.g. 'kvstore' or 'sui' or 'local'\n * @returns {String} id e.g. 'kvstore://image123'\n */\n async upload(dataURI, metaData, providerType) {\n if (providerType == null && this.defaultProvider == null) {\n throw new Error(_('No valid provider was found. Please add a provider'));\n }\n const provider = providerType ? this.findProvider(providerType) : this.defaultProvider;\n const id = await provider.upload(dataURI, metaData);\n return `${provider.getType()}://${id}`;\n }\n\n /**\n * get object by url\n * @param {String} url 'kvstore://image123'\n * @returns {Object} obj e.g. an image object or icon\n */\n async getByURL(url) {\n const { type, id } = this.parseURL(url);\n const provider = this.findProvider(type);\n const obj = await provider.getById(id);\n return obj;\n }\n\n /**\n * delete object by url\n * @param {String} url 'kvstore://image123' || 'sui://icon123'\n * @returns {Object} obj e.g. an image object or icon\n */\n async deleteByURL(url) {\n const { type, id } = this.parseURL(url);\n const provider = this.findProvider(type);\n const obj = await provider.deleteById(id);\n return obj;\n }\n\n /**\n * list all object ids\n * @params {String} providerType e.g. 'kvstore' or 'sui'\n * @params {Object} options\n * @returns {Array} ids\n */\n async listIds(providerType, options = { offset: 0, count: 100 }) {\n const provider = this.findProvider(providerType);\n const ids = await provider.listIds(options);\n return ids;\n }\n}\n\nexport default BaseRegistry;\n","module.exports = require(\"@babel/runtime/helpers/get\");","/* eslint-disable class-methods-use-this */\nimport { _ } from '@splunk/ui-utils/i18n';\nimport BaseRegistry from './BaseRegistry';\n\n/**\n * Icon Registry\n */\nclass IconRegistry extends BaseRegistry {\n static create() {\n return new IconRegistry();\n }\n\n static VALID_MEDIA_TYPES = ['svg'];\n\n /**\n * check if the the media type from the dataURI belongs to the supported types\n * @param {DataURI} dataURI\n * @returns {Boolean}\n */\n isValidMediaType(dataURI) {\n return IconRegistry.VALID_MEDIA_TYPES.some(type => dataURI.indexOf(`image/${type}`) > -1);\n }\n\n /**\n * upload image if the image format is supported\n * @param {DataURI} dataURI\n * @param {Object} metaData\n * @param {String} providerType e.g. 'kvstore', or 'sui'\n * @returns {String} id e.g. 'kvstore://image123'\n */\n upload(dataURI, metaData, providerType) {\n if (!this.isValidMediaType(dataURI)) {\n throw new Error(_('The format of the uploaded file is not supported. Please upload svg file.'));\n }\n\n return super.upload(dataURI, metaData, providerType);\n }\n}\n\nexport default IconRegistry;\n"],"sourceRoot":""}
package/ImageContext.js CHANGED
@@ -87,12 +87,12 @@ module.exports =
87
87
  /******/
88
88
  /******/
89
89
  /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 25);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 26);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
94
94
 
95
- /***/ 25:
95
+ /***/ 26:
96
96
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
97
97
 
98
98
  "use strict";
@@ -104,7 +104,7 @@ __webpack_require__.r(__webpack_exports__);
104
104
  /* global __VISION_VERSION__ */
105
105
 
106
106
  var ImageContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext();
107
- ImageContext.displayName = "data-splunk-visualization-version-ImageContext-".concat("25.6.0 - f5eb3abf9");
107
+ ImageContext.displayName = "data-splunk-visualization-version-ImageContext-".concat("25.7.1 - 6a77c5530");
108
108
  var ImageContextProvider = ImageContext.Provider;
109
109
  var ImageContextConsumer = ImageContext.Consumer;
110
110
  /* harmony default export */ __webpack_exports__["default"] = (ImageContext);