@jsreport/jsreport-localization
Advanced tools
+32
-5
@@ -7,2 +7,6 @@ const fs = require('fs').promises | ||
| reporter.localization = { | ||
| cacheRequestsMap: new Map() | ||
| } | ||
| reporter.initializeListeners.add('assets', async () => { | ||
@@ -22,2 +26,10 @@ helpers = (await fs.readFile(path.join(__dirname, '../static/helpers.js'))).toString() | ||
| reporter.afterRenderListeners.add(definition.name, (req) => { | ||
| reporter.localization.cacheRequestsMap.delete(req.context.rootId) | ||
| }) | ||
| reporter.renderErrorListeners.add(definition.name, (req) => { | ||
| reporter.localization.cacheRequestsMap.delete(req.context.rootId) | ||
| }) | ||
| reporter.extendProxy((proxy, req) => { | ||
@@ -53,12 +65,27 @@ proxy.localization = { | ||
| if (!reporter.localization.cacheRequestsMap.has(req.context.rootId)) { | ||
| reporter.localization.cacheRequestsMap.set(req.context.rootId, {}) | ||
| } | ||
| const cache = reporter.localization.cacheRequestsMap.get(req.context.rootId) | ||
| const localizationDataPath = path.posix.join(folder, `${language || 'en'}.json`) | ||
| const resolvedCurrentDirectoryPath = await proxy.currentDirectoryPath() | ||
| const resolvedValue = await proxy.folders.resolveEntityFromPath(localizationDataPath, 'assets', { currentPath: resolvedCurrentDirectoryPath }) | ||
| if (!resolvedValue) { | ||
| throw new Error('localize helper couldn\'t find asset with data at ' + localizationDataPath) | ||
| const localizationCacheKey = path.posix.join(resolvedCurrentDirectoryPath || '/', localizationDataPath) | ||
| if (cache[localizationCacheKey] == null) { | ||
| cache[localizationCacheKey] = (async () => { | ||
| const resolvedValue = await proxy.folders.resolveEntityFromPath(localizationDataPath, 'assets', { currentPath: resolvedCurrentDirectoryPath }) | ||
| if (!resolvedValue) { | ||
| throw new Error('localize helper couldn\'t find asset with data at ' + localizationDataPath) | ||
| } | ||
| return JSON.parse(resolvedValue.entity.content.toString()) | ||
| })() | ||
| } | ||
| const localizedData = JSON.parse(resolvedValue.entity.content.toString()) | ||
| return localizedData[key] | ||
| const localizationData = await cache[localizationCacheKey] | ||
| return localizationData[key] | ||
| } | ||
@@ -65,0 +92,0 @@ } |
+7
-7
| { | ||
| "name": "@jsreport/jsreport-localization", | ||
| "version": "3.2.2", | ||
| "version": "4.0.0", | ||
| "description": "jsreport extension adding localize helper", | ||
@@ -36,7 +36,7 @@ "keywords": [ | ||
| "handlebars": "4.7.7", | ||
| "@jsreport/jsreport-assets": "3.6.0", | ||
| "@jsreport/jsreport-core": "3.11.0", | ||
| "@jsreport/jsreport-components": "3.3.0", | ||
| "@jsreport/jsreport-child-templates": "3.1.0", | ||
| "@jsreport/jsreport-handlebars": "3.2.1", | ||
| "@jsreport/jsreport-assets": "4.0.0", | ||
| "@jsreport/jsreport-core": "4.0.0", | ||
| "@jsreport/jsreport-components": "4.0.0", | ||
| "@jsreport/jsreport-child-templates": "4.0.0", | ||
| "@jsreport/jsreport-handlebars": "4.0.0", | ||
| "@jsreport/studio-dev": "3.2.1", | ||
@@ -48,3 +48,3 @@ "mocha": "8.3.2", | ||
| "engines": { | ||
| "node": ">=16.11" | ||
| "node": ">=18.15" | ||
| }, | ||
@@ -51,0 +51,0 @@ "standard": { |
+6
-0
@@ -10,2 +10,8 @@ # jsreport-localization | ||
| ### 4.0.0 | ||
| - cache localization calls to improve performance | ||
| - minimum node.js version is now `18.15.0` | ||
| - update studio build against new webpack and babel | ||
| ### 3.2.2 | ||
@@ -12,0 +18,0 @@ |
+130
-190
@@ -1,206 +0,146 @@ | ||
| /******/ (function(modules) { // webpackBootstrap | ||
| /******/ (() => { // webpackBootstrap | ||
| /******/ "use strict"; | ||
| /******/ var __webpack_modules__ = ([ | ||
| /* 0 */, | ||
| /* 1 */ | ||
| /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | ||
| __webpack_require__.r(__webpack_exports__); | ||
| /* harmony export */ __webpack_require__.d(__webpack_exports__, { | ||
| /* harmony export */ "default": () => (/* binding */ LocalizationProperties) | ||
| /* harmony export */ }); | ||
| /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); | ||
| /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | ||
| class LocalizationProperties extends react__WEBPACK_IMPORTED_MODULE_0__.Component { | ||
| static title(entity, entities) { | ||
| if (!entity.localization) { | ||
| return 'localization'; | ||
| } | ||
| return `localization: ${entity.localization.language || ''}`; | ||
| } | ||
| render() { | ||
| const { | ||
| entity, | ||
| onChange | ||
| } = this.props; | ||
| const localization = (entity.localization || {}).language; | ||
| return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { | ||
| className: "properties-section" | ||
| }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { | ||
| className: "form-group" | ||
| }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", null, "Template language ", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", { | ||
| href: "http://jsreport.net/learn/localization", | ||
| target: "_blank", | ||
| rel: "noreferrer" | ||
| }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", { | ||
| className: "fa fa-question" | ||
| }), " ")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", { | ||
| type: "text", | ||
| placeholder: "en", | ||
| value: localization || '', | ||
| onChange: v => onChange({ | ||
| _id: entity._id, | ||
| localization: { | ||
| language: v.target.value | ||
| } | ||
| }) | ||
| }))); | ||
| } | ||
| } | ||
| /***/ }), | ||
| /* 2 */ | ||
| /***/ ((module) => { | ||
| module.exports = Studio.libraries['react']; | ||
| /***/ }), | ||
| /* 3 */ | ||
| /***/ ((module) => { | ||
| module.exports = Studio; | ||
| /***/ }) | ||
| /******/ ]); | ||
| /************************************************************************/ | ||
| /******/ // The module cache | ||
| /******/ var installedModules = {}; | ||
| /******/ | ||
| /******/ var __webpack_module_cache__ = {}; | ||
| /******/ | ||
| /******/ // The require function | ||
| /******/ function __webpack_require__(moduleId) { | ||
| /******/ | ||
| /******/ // Check if module is in cache | ||
| /******/ if(installedModules[moduleId]) { | ||
| /******/ return installedModules[moduleId].exports; | ||
| /******/ var cachedModule = __webpack_module_cache__[moduleId]; | ||
| /******/ if (cachedModule !== undefined) { | ||
| /******/ return cachedModule.exports; | ||
| /******/ } | ||
| /******/ // Create a new module (and put it into the cache) | ||
| /******/ var module = installedModules[moduleId] = { | ||
| /******/ i: moduleId, | ||
| /******/ l: false, | ||
| /******/ var module = __webpack_module_cache__[moduleId] = { | ||
| /******/ // no module.id needed | ||
| /******/ // no module.loaded needed | ||
| /******/ exports: {} | ||
| /******/ }; | ||
| /******/ | ||
| /******/ | ||
| /******/ // Execute the module function | ||
| /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | ||
| /******/ | ||
| /******/ // Flag the module as loaded | ||
| /******/ module.l = true; | ||
| /******/ | ||
| /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); | ||
| /******/ | ||
| /******/ // Return the exports of the module | ||
| /******/ return module.exports; | ||
| /******/ } | ||
| /******/ | ||
| /******/ | ||
| /******/ // expose the modules object (__webpack_modules__) | ||
| /******/ __webpack_require__.m = modules; | ||
| /******/ | ||
| /******/ // expose the module cache | ||
| /******/ __webpack_require__.c = installedModules; | ||
| /******/ | ||
| /******/ // define getter function for harmony exports | ||
| /******/ __webpack_require__.d = function(exports, name, getter) { | ||
| /******/ if(!__webpack_require__.o(exports, name)) { | ||
| /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); | ||
| /******/ } | ||
| /******/ }; | ||
| /******/ | ||
| /******/ // define __esModule on exports | ||
| /******/ __webpack_require__.r = function(exports) { | ||
| /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | ||
| /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
| /******/ } | ||
| /******/ Object.defineProperty(exports, '__esModule', { value: true }); | ||
| /******/ }; | ||
| /******/ | ||
| /******/ // create a fake namespace object | ||
| /******/ // mode & 1: value is a module id, require it | ||
| /******/ // mode & 2: merge all properties of value into the ns | ||
| /******/ // mode & 4: return value when already ns object | ||
| /******/ // mode & 8|1: behave like require | ||
| /******/ __webpack_require__.t = function(value, mode) { | ||
| /******/ if(mode & 1) value = __webpack_require__(value); | ||
| /******/ if(mode & 8) return value; | ||
| /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; | ||
| /******/ var ns = Object.create(null); | ||
| /******/ __webpack_require__.r(ns); | ||
| /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); | ||
| /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); | ||
| /******/ return ns; | ||
| /******/ }; | ||
| /******/ | ||
| /******/ // getDefaultExport function for compatibility with non-harmony modules | ||
| /******/ __webpack_require__.n = function(module) { | ||
| /******/ var getter = module && module.__esModule ? | ||
| /******/ function getDefault() { return module['default']; } : | ||
| /******/ function getModuleExports() { return module; }; | ||
| /******/ __webpack_require__.d(getter, 'a', getter); | ||
| /******/ return getter; | ||
| /******/ }; | ||
| /******/ | ||
| /******/ // Object.prototype.hasOwnProperty.call | ||
| /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; | ||
| /******/ | ||
| /******/ // __webpack_public_path__ | ||
| /******/ __webpack_require__.p = ""; | ||
| /******/ | ||
| /******/ | ||
| /******/ // Load entry module and return exports | ||
| /******/ return __webpack_require__(__webpack_require__.s = 0); | ||
| /******/ }) | ||
| /******/ | ||
| /************************************************************************/ | ||
| /******/ ([ | ||
| /* 0 */ | ||
| /***/ (function(module, exports, __webpack_require__) { | ||
| /******/ /* webpack/runtime/compat get default export */ | ||
| /******/ (() => { | ||
| /******/ // getDefaultExport function for compatibility with non-harmony modules | ||
| /******/ __webpack_require__.n = (module) => { | ||
| /******/ var getter = module && module.__esModule ? | ||
| /******/ () => (module['default']) : | ||
| /******/ () => (module); | ||
| /******/ __webpack_require__.d(getter, { a: getter }); | ||
| /******/ return getter; | ||
| /******/ }; | ||
| /******/ })(); | ||
| /******/ | ||
| /******/ /* webpack/runtime/define property getters */ | ||
| /******/ (() => { | ||
| /******/ // define getter functions for harmony exports | ||
| /******/ __webpack_require__.d = (exports, definition) => { | ||
| /******/ for(var key in definition) { | ||
| /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { | ||
| /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); | ||
| /******/ } | ||
| /******/ } | ||
| /******/ }; | ||
| /******/ })(); | ||
| /******/ | ||
| /******/ /* webpack/runtime/hasOwnProperty shorthand */ | ||
| /******/ (() => { | ||
| /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) | ||
| /******/ })(); | ||
| /******/ | ||
| /******/ /* webpack/runtime/make namespace object */ | ||
| /******/ (() => { | ||
| /******/ // define __esModule on exports | ||
| /******/ __webpack_require__.r = (exports) => { | ||
| /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | ||
| /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
| /******/ } | ||
| /******/ Object.defineProperty(exports, '__esModule', { value: true }); | ||
| /******/ }; | ||
| /******/ })(); | ||
| /******/ | ||
| /************************************************************************/ | ||
| var __webpack_exports__ = {}; | ||
| // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. | ||
| (() => { | ||
| __webpack_require__.r(__webpack_exports__); | ||
| /* harmony import */ var _LocalizationProperties_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); | ||
| /* harmony import */ var jsreport_studio__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); | ||
| /* harmony import */ var jsreport_studio__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jsreport_studio__WEBPACK_IMPORTED_MODULE_1__); | ||
| "use strict"; | ||
| jsreport_studio__WEBPACK_IMPORTED_MODULE_1___default().addPropertiesComponent(_LocalizationProperties_js__WEBPACK_IMPORTED_MODULE_0__["default"].title, _LocalizationProperties_js__WEBPACK_IMPORTED_MODULE_0__["default"], entity => entity.__entitySet === 'templates'); | ||
| })(); | ||
| var _LocalizationProperties = __webpack_require__(1); | ||
| var _LocalizationProperties2 = _interopRequireDefault(_LocalizationProperties); | ||
| var _jsreportStudio = __webpack_require__(3); | ||
| var _jsreportStudio2 = _interopRequireDefault(_jsreportStudio); | ||
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
| _jsreportStudio2.default.addPropertiesComponent(_LocalizationProperties2.default.title, _LocalizationProperties2.default, function (entity) { | ||
| return entity.__entitySet === 'templates'; | ||
| }); | ||
| /***/ }), | ||
| /* 1 */ | ||
| /***/ (function(module, exports, __webpack_require__) { | ||
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
| var _react = __webpack_require__(2); | ||
| var _react2 = _interopRequireDefault(_react); | ||
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
| function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
| function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
| function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
| var LocalizationProperties = function (_Component) { | ||
| _inherits(LocalizationProperties, _Component); | ||
| function LocalizationProperties() { | ||
| _classCallCheck(this, LocalizationProperties); | ||
| return _possibleConstructorReturn(this, (LocalizationProperties.__proto__ || Object.getPrototypeOf(LocalizationProperties)).apply(this, arguments)); | ||
| } | ||
| _createClass(LocalizationProperties, [{ | ||
| key: 'render', | ||
| value: function render() { | ||
| var _props = this.props, | ||
| entity = _props.entity, | ||
| _onChange = _props.onChange; | ||
| var localization = (entity.localization || {}).language; | ||
| return _react2.default.createElement( | ||
| 'div', | ||
| { className: 'properties-section' }, | ||
| _react2.default.createElement( | ||
| 'div', | ||
| { className: 'form-group' }, | ||
| _react2.default.createElement( | ||
| 'label', | ||
| null, | ||
| 'Template language ', | ||
| _react2.default.createElement( | ||
| 'a', | ||
| { href: 'http://jsreport.net/learn/localization', target: '_blank', rel: 'noreferrer' }, | ||
| _react2.default.createElement('i', { className: 'fa fa-question' }), | ||
| ' ' | ||
| ) | ||
| ), | ||
| _react2.default.createElement('input', { | ||
| type: 'text', placeholder: 'en', value: localization || '', | ||
| onChange: function onChange(v) { | ||
| return _onChange({ _id: entity._id, localization: { language: v.target.value } }); | ||
| } | ||
| }) | ||
| ) | ||
| ); | ||
| } | ||
| }], [{ | ||
| key: 'title', | ||
| value: function title(entity, entities) { | ||
| if (!entity.localization) { | ||
| return 'localization'; | ||
| } | ||
| return 'localization: ' + (entity.localization.language || ''); | ||
| } | ||
| }]); | ||
| return LocalizationProperties; | ||
| }(_react.Component); | ||
| exports.default = LocalizationProperties; | ||
| /***/ }), | ||
| /* 2 */ | ||
| /***/ (function(module, exports) { | ||
| module.exports = Studio.libraries['react']; | ||
| /***/ }), | ||
| /* 3 */ | ||
| /***/ (function(module, exports) { | ||
| module.exports = Studio; | ||
| /***/ }) | ||
| /******/ ]); | ||
| /******/ })() | ||
| ; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./studio/main_dev.js","webpack:///./studio/LocalizationProperties.js","webpack:///external \"Studio.libraries['react']\"","webpack:///external \"Studio\""],"names":["Studio","addPropertiesComponent","LocalizationProperties","title","entity","__entitySet","props","onChange","localization","language","v","_id","target","value","entities","Component"],"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;;;;AACA;;;;;;AAEAA,yBAAOC,sBAAP,CAA8BC,iCAAuBC,KAArD,EAA4DD,gCAA5D,EAAoF,UAACE,MAAD;AAAA,SAAYA,OAAOC,WAAP,KAAuB,WAAnC;AAAA,CAApF,E;;;;;;;;;;;;;;;ACHA;;;;;;;;;;;;IACqBH,sB;;;;;;;;;;;6BAST;AAAA,mBACqB,KAAKI,KAD1B;AAAA,UACAF,MADA,UACAA,MADA;AAAA,UACQG,SADR,UACQA,QADR;;AAER,UAAMC,eAAe,CAACJ,OAAOI,YAAP,IAAuB,EAAxB,EAA4BC,QAAjD;;AAEA,aACE;AAAA;AAAA,UAAK,WAAU,oBAAf;AACE;AAAA;AAAA,YAAK,WAAU,YAAf;AACE;AAAA;AAAA;AAAA;AAAyB;AAAA;AAAA,gBAAG,MAAK,wCAAR,EAAiD,QAAO,QAAxD,EAAiE,KAAI,YAArE;AAAkF,mDAAG,WAAU,gBAAb,GAAlF;AAAA;AAAA;AAAzB,WADF;AAEE;AACE,kBAAK,MADP,EACc,aAAY,IAD1B,EAC+B,OAAOD,gBAAgB,EADtD;AAEE,sBAAU,kBAACE,CAAD;AAAA,qBAAOH,UAAS,EAAEI,KAAKP,OAAOO,GAAd,EAAmBH,cAAc,EAAEC,UAAUC,EAAEE,MAAF,CAASC,KAArB,EAAjC,EAAT,CAAP;AAAA;AAFZ;AAFF;AADF,OADF;AAWD;;;0BAvBaT,M,EAAQU,Q,EAAU;AAC9B,UAAI,CAACV,OAAOI,YAAZ,EAA0B;AACxB,eAAO,cAAP;AACD;;AAED,iCAAwBJ,OAAOI,YAAP,CAAoBC,QAApB,IAAgC,EAAxD;AACD;;;;EAPiDM,gB;;kBAA/Bb,sB;;;;;;ACDrB,2C;;;;;;ACAA,wB","file":"main.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 = 0);\n","import LocalizationProperties from './LocalizationProperties.js'\nimport Studio from 'jsreport-studio'\n\nStudio.addPropertiesComponent(LocalizationProperties.title, LocalizationProperties, (entity) => entity.__entitySet === 'templates')\n","import React, { Component } from 'react'\nexport default class LocalizationProperties extends Component {\n static title (entity, entities) {\n if (!entity.localization) {\n return 'localization'\n }\n\n return `localization: ${entity.localization.language || ''}`\n }\n\n render () {\n const { entity, onChange } = this.props\n const localization = (entity.localization || {}).language\n\n return (\n <div className='properties-section'>\n <div className='form-group'>\n <label>Template language <a href='http://jsreport.net/learn/localization' target='_blank' rel='noreferrer'><i className='fa fa-question' /> </a></label>\n <input\n type='text' placeholder='en' value={localization || ''}\n onChange={(v) => onChange({ _id: entity._id, localization: { language: v.target.value } })}\n />\n </div>\n </div>\n )\n }\n}\n","module.exports = Studio.libraries['react'];","module.exports = Studio;"],"sourceRoot":""} | ||
| {"version":3,"file":"main.js","mappings":";;;;;;;;;;;;;AAAwC;AACzB,MAAME,sBAAsB,SAASD,4CAAS,CAAC;EAC5D,OAAOE,KAAKA,CAAEC,MAAM,EAAEC,QAAQ,EAAE;IAC9B,IAAI,CAACD,MAAM,CAACE,YAAY,EAAE;MACxB,OAAO,cAAc;IACvB;IAEA,OAAQ,iBAAgBF,MAAM,CAACE,YAAY,CAACC,QAAQ,IAAI,EAAG,EAAC;EAC9D;EAEAC,MAAMA,CAAA,EAAI;IACR,MAAM;MAAEJ,MAAM;MAAEK;IAAS,CAAC,GAAG,IAAI,CAACC,KAAK;IACvC,MAAMJ,YAAY,GAAG,CAACF,MAAM,CAACE,YAAY,IAAI,CAAC,CAAC,EAAEC,QAAQ;IAEzD,oBACEP,0DAAA;MAAKY,SAAS,EAAC;IAAoB,gBACjCZ,0DAAA;MAAKY,SAAS,EAAC;IAAY,gBACzBZ,0DAAA,gBAAO,oBAAkB,eAAAA,0DAAA;MAAGa,IAAI,EAAC,wCAAwC;MAACC,MAAM,EAAC,QAAQ;MAACC,GAAG,EAAC;IAAY,gBAACf,0DAAA;MAAGY,SAAS,EAAC;IAAgB,CAAE,CAAC,KAAI,CAAQ,CAAC,eACxJZ,0DAAA;MACEgB,IAAI,EAAC,MAAM;MAACC,WAAW,EAAC,IAAI;MAACC,KAAK,EAAEZ,YAAY,IAAI,EAAG;MACvDG,QAAQ,EAAGU,CAAC,IAAKV,QAAQ,CAAC;QAAEW,GAAG,EAAEhB,MAAM,CAACgB,GAAG;QAAEd,YAAY,EAAE;UAAEC,QAAQ,EAAEY,CAAC,CAACL,MAAM,CAACI;QAAM;MAAE,CAAC;IAAE,CAC5F,CACE,CACF,CAAC;EAEV;AACF;;;;;;AC1BA;;;;;;ACAA;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;ACNgE;AAC5B;AAEpCG,6EAA6B,CAACnB,kEAAsB,CAACC,KAAK,EAAED,kEAAsB,EAAGE,MAAM,IAAKA,MAAM,CAACmB,WAAW,KAAK,WAAW,CAAC,C","sources":["webpack://@jsreport/jsreport-localization/./studio/LocalizationProperties.js","webpack://@jsreport/jsreport-localization/external var \"Studio.libraries['react']\"","webpack://@jsreport/jsreport-localization/external var \"Studio\"","webpack://@jsreport/jsreport-localization/webpack/bootstrap","webpack://@jsreport/jsreport-localization/webpack/runtime/compat get default export","webpack://@jsreport/jsreport-localization/webpack/runtime/define property getters","webpack://@jsreport/jsreport-localization/webpack/runtime/hasOwnProperty shorthand","webpack://@jsreport/jsreport-localization/webpack/runtime/make namespace object","webpack://@jsreport/jsreport-localization/./studio/main_dev.js"],"sourcesContent":["import React, { Component } from 'react'\nexport default class LocalizationProperties extends Component {\n static title (entity, entities) {\n if (!entity.localization) {\n return 'localization'\n }\n\n return `localization: ${entity.localization.language || ''}`\n }\n\n render () {\n const { entity, onChange } = this.props\n const localization = (entity.localization || {}).language\n\n return (\n <div className='properties-section'>\n <div className='form-group'>\n <label>Template language <a href='http://jsreport.net/learn/localization' target='_blank' rel='noreferrer'><i className='fa fa-question' /> </a></label>\n <input\n type='text' placeholder='en' value={localization || ''}\n onChange={(v) => onChange({ _id: entity._id, localization: { language: v.target.value } })}\n />\n </div>\n </div>\n )\n }\n}\n","module.exports = Studio.libraries['react'];","module.exports = Studio;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import LocalizationProperties from './LocalizationProperties.js'\nimport Studio from 'jsreport-studio'\n\nStudio.addPropertiesComponent(LocalizationProperties.title, LocalizationProperties, (entity) => entity.__entitySet === 'templates')\n"],"names":["React","Component","LocalizationProperties","title","entity","entities","localization","language","render","onChange","props","createElement","className","href","target","rel","type","placeholder","value","v","_id","Studio","addPropertiesComponent","__entitySet"],"sourceRoot":""} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
36
20%18635
-9.59%262
-6.76%1
Infinity%