traitify-widgets 3.1.0 → 3.1.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scripts/i18n-sync.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,WAAY,GAAIH,GACG,iBAAZC,QACdA,QAAkB,SAAID,IAEtBD,EAAe,SAAIC,GACpB,CATD,CASGK,MAAM,I,qBCJTH,EAAOD,QALP,SAAyBK,EAAUC,GACjC,KAAMD,aAAoBC,GACxB,MAAM,IAAIC,UAAU,oCAExB,EACkCN,EAAOD,QAAQQ,YAAa,EAAMP,EAAOD,QAAiB,QAAIC,EAAOD,O,gBCLvG,IAAIS,EAAgB,EAAQ,KAC5B,SAASC,EAAkBC,EAAQC,GACjC,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAME,OAAQD,IAAK,CACrC,IAAIE,EAAaH,EAAMC,GACvBE,EAAWC,WAAaD,EAAWC,aAAc,EACjDD,EAAWE,cAAe,EACtB,UAAWF,IAAYA,EAAWG,UAAW,GACjDC,OAAOC,eAAeT,EAAQF,EAAcM,EAAWM,KAAMN,EAC/D,CACF,CASAd,EAAOD,QARP,SAAsBM,EAAagB,EAAYC,GAM7C,OALID,GAAYZ,EAAkBJ,EAAYkB,UAAWF,GACrDC,GAAab,EAAkBJ,EAAaiB,GAChDJ,OAAOC,eAAed,EAAa,YAAa,CAC9CY,UAAU,IAELZ,CACT,EAC+BL,EAAOD,QAAQQ,YAAa,EAAMP,EAAOD,QAAiB,QAAIC,EAAOD,O,gBClBpG,IAAIS,EAAgB,EAAQ,KAe5BR,EAAOD,QAdP,SAAyByB,EAAKJ,EAAKK,GAYjC,OAXAL,EAAMZ,EAAcY,MACTI,EACTN,OAAOC,eAAeK,EAAKJ,EAAK,CAC9BK,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ADX,GC9BpBA,K","sources":["webpack://Traitify/webpack/universalModuleDefinition","webpack://Traitify/../node_modules/@babel/runtime/helpers/classCallCheck.js","webpack://Traitify/../node_modules/@babel/runtime/helpers/createClass.js","webpack://Traitify/../node_modules/@babel/runtime/helpers/defineProperty.js","webpack://Traitify/../node_modules/@babel/runtime/helpers/toPrimitive.js","webpack://Traitify/../node_modules/@babel/runtime/helpers/toPropertyKey.js","webpack://Traitify/../node_modules/@babel/runtime/helpers/typeof.js","webpack://Traitify/webpack/bootstrap","webpack://Traitify/webpack/runtime/compat get default export","webpack://Traitify/webpack/runtime/define property getters","webpack://Traitify/webpack/runtime/hasOwnProperty shorthand","webpack://Traitify/webpack/runtime/make namespace object","webpack://Traitify/external node-commonjs \"node:fs\"","webpack://Traitify/../scripts/lib/i18n-sync.js","webpack://Traitify/../scripts/i18n-sync.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Traitify\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Traitify\"] = factory();\n\telse\n\t\troot[\"Traitify\"] = factory();\n})(this, () => {\nreturn ","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\nmodule.exports = _classCallCheck, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nmodule.exports = _createClass, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nmodule.exports = toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar toPrimitive = require(\"./toPrimitive.js\");\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nmodule.exports = toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// 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};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"node:fs\");","/* eslint-disable no-console */\nimport fs from \"node:fs\";\n\nconst locales = {\n \"de-de\": {name: \"German\"},\n \"en-gb\": {name: \"English (GB)\"},\n \"en-us\": {name: \"English (US)\"},\n \"es-ec\": {name: \"Spanish (Ecuador)\"},\n \"es-pr\": {name: \"Spanish (Puerto Rico)\"},\n \"es-us\": {name: \"Spanish\"},\n \"fr-ca\": {name: \"French (Canadian)\"},\n \"fr-fr\": {name: \"French (France)\"},\n \"fr-us\": {name: \"French\"},\n \"ht-us\": {name: \"Creole\"},\n \"id-id\": {name: \"Indonesian\"},\n \"it-it\": {name: \"Italian\"},\n \"ja-jp\": {name: \"Japanese\"},\n \"ko-kr\": {name: \"Korean\"},\n \"nl-nl\": {name: \"Dutch\"},\n \"no-no\": {name: \"Norwegian\"},\n \"pt-br\": {name: \"Portuguese (Brazil)\"},\n \"pt-pt\": {name: \"Portuguese\"},\n \"ru-ru\": {name: \"Russian\"},\n \"sv-se\": {name: \"Swedish\"},\n \"th-th\": {name: \"Thai\"},\n \"vi-vn\": {name: \"Vietnamese\"},\n \"zh-cn\": {name: \"Chinese (Simplified)\"},\n \"zh-hant\": {name: \"Chinese (Traditional)\"}\n};\n\nconst stringify = (object) => JSON.stringify(object, null, 2);\n\nexport default class I18nSync {\n static run() { new I18nSync().run(); }\n constructor() {\n this.locales = Object.keys(locales).map((key) => ({code: key, ...locales[key]}));\n this.translations = this.locales.reduce((map, locale) => (\n {...map, [locale.code]: {...locale, data: []}}\n ), {});\n }\n buildFiles() {\n Object.keys(this.translations).forEach((key) => this.#buildFile(this.translations[key]));\n }\n importData() {\n const data = this.#fetchData();\n\n Object.keys(data).forEach((key) => this.#addLocale({code: key, tree: data[key]}));\n }\n run() {\n this.importData();\n this.buildFiles();\n this.validate();\n }\n validate() {\n this.validation = this.translations[\"en-us\"];\n this.validation.substitutions = this.validation.data\n .filter((translation) => /%{\\w*}/.test(translation.value))\n .map((translation) => ({\n key: translation.key,\n values: translation.value.match(/%\\{\\w*\\}/g)\n }));\n\n Object.keys(this.translations).forEach((key) => this.#validateLocale(this.translations[key]));\n }\n #addLocale({code, tree}) {\n const locale = this.locales.find(({code: key}) => key.toLowerCase() === code.toLowerCase());\n if(!locale) { return console.log(`Issue adding locale (${code}: ${stringify(tree)})`); }\n\n this.translations[locale.code].tree = tree;\n Object.keys(tree).forEach((key) => this.#addTranslation({key, locale, value: tree[key]}));\n }\n #addTranslation({key, locale, value}) {\n const translation = {key, locale: locale.code, value};\n\n if(typeof value === \"object\") {\n return Object.keys(value).forEach((nestedKey) => (\n this.#addTranslation({key: [key, nestedKey].join(\".\"), locale, value: value[nestedKey]})\n ));\n }\n\n this.translations[locale.code].data.push(translation);\n }\n #buildFile(locale) {\n if(!locale.tree) { return; }\n\n this.#writeFile(`./src/lib/i18n-data/${locale.code}.json`, locale.tree);\n }\n // TODO: Get locales from Xavier\n #fetchData() {\n return {\n \"es-pr\": {\n sub: {\n with_1: \"Yo estoy divertida\"\n }\n },\n \"es-us\": {\n sub: {\n with_1: \"%{name} estas divertida\",\n with_2: \"%{name} estas divertida\"\n },\n survey: {\n me: \"Yo Soy\",\n not_me: \"No Soy\"\n }\n },\n \"en-us\": {\n look: {\n at: {\n this: \"I'm missing\\n\\n from es-US\"\n }\n },\n sub: {\n with_1: \"%{name} is really exciting\",\n with_2: \"%{name} is really %{something}\"\n },\n survey: {\n me: \"Me\",\n not_me: \"Not Me\"\n }\n }\n };\n }\n #validateKeys(locale) {\n const warnings = [];\n\n this.validation.data.forEach((record) => {\n if(locale.data.find((t) => t.key === record.key)) { return; }\n\n warnings.push({key: record.key, value: record.value});\n });\n\n return warnings;\n }\n #validateLocale(locale) {\n const warnings = {locale: locale.data.length === 0};\n\n if(!warnings.locale) {\n warnings.keys = this.#validateKeys(locale);\n warnings.substitutions = this.#validateSubstitutions(locale);\n\n if(warnings.keys.length === 0 && warnings.substitutions.length === 0) { return; }\n }\n\n if(warnings.locale) {\n console.log(`Locale Missing: ${locale.code}`);\n }\n\n if(warnings.keys && warnings.keys.length > 0) {\n console.log(`Keys Missing for ${locale.code}:`);\n warnings.keys\n .forEach((warning) => console.log(` ${warning.key}: ${stringify(warning.value)}`));\n }\n\n if(warnings.substitutions && warnings.substitutions.length > 0) {\n console.log(`Substitutions Missing for ${locale.code}:`);\n warnings.substitutions\n .forEach((warning) => console.log(` ${warning.key}: ${warning.missing.join(\", \")}`));\n }\n\n console.log(\"\");\n }\n #validateSubstitutions(locale) {\n const warnings = [];\n\n this.validation.substitutions.forEach((record) => {\n const translation = locale.data.find((t) => t.key === record.key);\n if(!translation) { return; }\n\n const matches = translation.value.match(/%\\{\\w*\\}/g) || [];\n const missing = record.values.filter((value) => !matches.includes(value));\n if(missing.length === 0) { return; }\n\n warnings.push({key: record.key, missing});\n });\n\n return warnings;\n }\n #writeFile(file, data) {\n fs.writeFileSync(file, stringify(data));\n }\n}\n","import I18nSync from \"lib/i18n-sync\";\n\nI18nSync.run();\n"],"names":["root","factory","exports","module","define","amd","this","instance","Constructor","TypeError","__esModule","toPropertyKey","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","protoProps","staticProps","prototype","obj","value","_typeof","t","r","e","Symbol","toPrimitive","call","String","Number","o","iterator","constructor","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","d","a","definition","get","prop","hasOwnProperty","toStringTag","require","locales","name","stringify","object","JSON","_I18nSync_brand","WeakSet","_addLocale","_ref","_this4","code","tree","locale","find","_ref2","toLowerCase","console","log","concat","translations","keys","forEach","_assertClassBrand","_addTranslation","_ref3","_this5","translation","nestedKey","join","data","push","_buildFile","_writeFile","_fetchData","sub","with_1","with_2","survey","me","not_me","look","at","_validateKeys","warnings","validation","record","_validateLocale","substitutions","_validateSubstitutions","warning","missing","matches","match","values","filter","includes","file","fs","I18nSync","_classCallCheck","map","_objectSpread","reduce","_defineProperty","_createClass","_this","_this2","importData","buildFiles","validate","_this3","test","run"],"sourceRoot":""}