@leaflink/stash 44.3.0 → 44.4.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"locale.js","sources":["../src/locales/en-US.ts","../src/locale.ts"],"sourcesContent":["export default {\n ll: {\n actions: 'Actions',\n all: 'All',\n allFilters: 'All Filters',\n apply: 'Apply',\n areYouSure: 'Are you sure?',\n cancel: 'Cancel',\n carousel: {\n imageLabel: 'Image {index} of {total}',\n paginationLabel: 'Go to image {index}',\n },\n clear: 'Clear',\n closeModal: 'Close modal',\n confirm: 'Confirm',\n copy: {\n copied: 'Copied!',\n copyToClipboard: 'Copy to clipboard',\n },\n datePicker: {\n dateFormat: 'Date format',\n today: 'Today',\n },\n pageStats: '{from} - {to} of {total}',\n emptyState: {\n noResults: 'No results',\n },\n fileUpload: {\n dragDropFileHere: 'Drag and drop your file here',\n errors: {\n incorrectFileType: 'Please drop a file with type: {fileTypes}',\n },\n or: 'or',\n remove: 'Remove',\n uploadFile: 'Upload File',\n },\n filter: 'Filter',\n filterBy: 'Filter by',\n filters: 'Filters',\n httpError: {\n 401: {\n title: 'Unauthorized',\n description: 'Sorry, you are not authorized to access the LeafLink portal!',\n },\n 403: {\n title: 'Access denied.',\n description: `Sorry, you can not access the page you are looking for. Talk to your account admin regarding your account's permission settings.`,\n },\n 404: {\n title: `Sorry, we can't find this page.`,\n description: `We couldn't find the page you're looking for.`,\n },\n 405: {\n title: 'Not allowed.',\n description: `We couldn't reach the page you're looking for this way.`,\n },\n '50X': {\n title: 'Please wait while we hash this out.',\n description: `You've encountered an error.`,\n },\n 504: {\n title: 'Your request got lost in the weeds.',\n description: `You've encountered an error.`,\n },\n },\n listView: {\n calculating: 'Calculating results...',\n clearSelection: 'Clear Selection',\n deselectAllCount: 'Deselect all ({count})',\n numItemsSelected: '{totalSelectedCount} of {totalCount} items selected',\n numberOfTotalSelected: '{num} of {total} selected',\n selectAll: 'Select all',\n selectAllCount: 'Select all ({count})',\n sortBy: 'Sort by',\n totalResults: 'Showing {num} of {total} results',\n },\n numberOfActiveFilters: 'Number of active filters',\n okay: 'Okay',\n optional: 'optional',\n pageNavigation: {\n more: 'More',\n },\n more: 'More',\n next: 'Next',\n previous: 'Previous',\n reset: 'Reset',\n resetAll: 'Reset all',\n search: 'Search',\n select: {\n self: 'Select',\n empty: 'No options',\n placeholder: 'Select option',\n selected: 'selected',\n },\n selectAll: 'Select all',\n sort: 'Sort',\n table: {\n collapseRow: 'Collapse row',\n expandRow: 'Expand row',\n },\n validation: {\n email: 'Email must be valid',\n maxValue: 'Must be at most {max}',\n minValue: 'Must be at least {min}',\n positiveNumber: 'Must be greater than 0',\n required: 'Required',\n price: 'Must have 2 decimal places',\n wholeNumber: 'Must be a Whole Number',\n },\n viewFilterGroup: 'View filter group',\n },\n};\n","import get from 'lodash-es/get';\n\nimport messages from './locales/en-US';\n\nexport let locale = 'en-US';\nlet i18nHandler;\n\n/**\n * Replaces params in a translation message with respective values\n * @param {string} path Translation path (foo.bar.baz)\n * @param {object} params Any params used in the translation message\n * @returns {string}\n */\nexport function format(path, params) {\n const pathParams = path.match(/({)([\\w]+)(})/g) || [];\n let message = path;\n\n pathParams.forEach((param) => {\n const prop = param.replace(/[{}]/g, '');\n\n message = message.replace(param, params[prop] || '');\n });\n\n return message;\n}\n\n/**\n * Returns a translation based on translation path\n * @param {string} path Translation path (foo.bar.baz)\n * @param {object} params Any params used in the translation message\n */\nfunction translate(path, params) {\n // Lookup translation\n const value = get(messages, path);\n\n // Return translation, otherwise the path\n return value ? format(value, params) : path;\n}\n\n/**\n * Calls the provided translation method `config.i18n.t` if provided, or the built-in\n * @param {...(string|object)} args\n * @param {string} path Translation path (foo.bar.baz)\n * @param {object} params Any params used in the translation message\n * @returns {string} Translation message\n */\nexport function t(...args) {\n const value = i18nHandler && i18nHandler(...args);\n\n // If value exists, but translation doesn't (returns translation key format (xx.xx)),\n // then fallback to default\n if (value && !/^\\w{2,}\\.\\w{2,}/.test(value)) {\n return value;\n }\n\n // @ts-ignore - todo: Fix \"A spread argument must either have a tuple type or be passed to a rest parameter.ts(2556)\"\n // Default English message\n return translate(...args);\n}\n\n/**\n * Sets the locale\n * @param {string} l locale\n */\nexport function use(l) {\n locale = l || locale;\n}\n\n/**\n * Sets the translate function `t()`\n * @param {function} fn Translate function `t()`\n */\nexport function i18n(fn) {\n i18nHandler = fn;\n}\n\nexport default { i18n, locale, t, use };\n"],"names":["messages","locale","i18nHandler","format","path","params","pathParams","message","param","prop","translate","value","get","t","args","use","l","i18n","fn","locale$1"],"mappings":";AAAA,MAAeA,IAAA;AAAA,EACb,IAAI;AAAA,IACF,SAAS;AAAA,IACT,KAAK;AAAA,IACL,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,UAAU;AAAA,MACR,YAAY;AAAA,MACZ,iBAAiB;AAAA,IACnB;AAAA,IACA,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,MAAM;AAAA,MACJ,QAAQ;AAAA,MACR,iBAAiB;AAAA,IACnB;AAAA,IACA,YAAY;AAAA,MACV,YAAY;AAAA,MACZ,OAAO;AAAA,IACT;AAAA,IACA,WAAW;AAAA,IACX,YAAY;AAAA,MACV,WAAW;AAAA,IACb;AAAA,IACA,YAAY;AAAA,MACV,kBAAkB;AAAA,MAClB,QAAQ;AAAA,QACN,mBAAmB;AAAA,MACrB;AAAA,MACA,IAAI;AAAA,MACJ,QAAQ;AAAA,MACR,YAAY;AAAA,IACd;AAAA,IACA,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,SAAS;AAAA,IACT,WAAW;AAAA,MACT,KAAK;AAAA,QACH,OAAO;AAAA,QACP,aAAa;AAAA,MACf;AAAA,MACA,KAAK;AAAA,QACH,OAAO;AAAA,QACP,aAAa;AAAA,MACf;AAAA,MACA,KAAK;AAAA,QACH,OAAO;AAAA,QACP,aAAa;AAAA,MAC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QC,GAAOH,EAAOI,CAAI,KAAK,EAAE;AAAA,EAAA,CACpD,GAEMF;AACT;AAOA,SAASG,EAAUN,GAAMC,GAAQ;AAEzB,QAAAM,IAAQC,EAAIZ,GAAUI,CAAI;AAGhC,SAAOO,IAAQR,EAAOQ,GAAON,CAAM,IAAID;AACzC;AASO,SAASS,KAAKC,GAAM;AACzB,QAAMH,IAAQT,KAAeA,EAAY,GAAGY,CAAI;AAIhD,SAAIH,KAAS,CAAC,kBAAkB,KAAKA,CAAK,IACjCA,IAKFD,EAAU,GAAGI,CAAI;AAC1B;AAMO,SAASC,EAAIC,GAAG;AACrB,EAAAf,IAASe,KAAKf;AAChB;AAMO,SAASgB,EAAKC,GAAI;AACT,EAAAhB,IAAAgB;AAChB;AAEA,MAAeC,IAAA,EAAE,MAAAF,GAAM,QAAAhB,GAAQ,GAAAY,GAAG,KAAAE,EAAI;"}
1
+ {"version":3,"file":"locale.js","sources":["../src/locales/en-US.ts","../src/locale.ts"],"sourcesContent":["export default {\n ll: {\n actions: 'Actions',\n all: 'All',\n allFilters: 'All Filters',\n apply: 'Apply',\n areYouSure: 'Are you sure?',\n cancel: 'Cancel',\n carousel: {\n imageLabel: 'Image {index} of {total}',\n paginationLabel: 'Go to image {index}',\n },\n clear: 'Clear',\n closeModal: 'Close modal',\n confirm: 'Confirm',\n copy: {\n copied: 'Copied!',\n copyToClipboard: 'Copy to clipboard',\n },\n datePicker: {\n dateFormat: 'Date format',\n today: 'Today',\n },\n pageStats: '{from} - {to} of {total}',\n emptyState: {\n noResults: 'No results',\n },\n fileUpload: {\n dragDropFileHere: 'Drag and drop your file here',\n errors: {\n incorrectFileType: 'Please drop a file with type: {fileTypes}',\n },\n or: 'or',\n remove: 'Remove',\n uploadFile: 'Upload File',\n },\n filter: 'Filter',\n filterBy: 'Filter by',\n filters: 'Filters',\n httpError: {\n 401: {\n title: 'Unauthorized',\n description: 'Sorry, you are not authorized to access the LeafLink portal!',\n },\n 403: {\n title: 'Access denied.',\n description: `Sorry, you can not access the page you are looking for. Talk to your account admin regarding your account's permission settings.`,\n },\n 404: {\n title: `Sorry, we can't find this page.`,\n description: `We couldn't find the page you're looking for.`,\n },\n 405: {\n title: 'Not allowed.',\n description: `We couldn't reach the page you're looking for this way.`,\n },\n '50X': {\n title: 'Please wait while we hash this out.',\n description: `You've encountered an error.`,\n },\n 504: {\n title: 'Your request got lost in the weeds.',\n description: `You've encountered an error.`,\n },\n },\n listView: {\n calculating: 'Calculating results...',\n clearSelection: 'Clear Selection',\n deselectAllCount: 'Deselect all ({count})',\n numItemsSelected: '{totalSelectedCount} of {totalCount} items selected',\n numberOfTotalSelected: '{num} of {total} selected',\n selectAll: 'Select all',\n selectAllCount: 'Select all ({count})',\n sortBy: 'Sort by',\n totalResults: 'Showing {num} of {total} results',\n },\n numberOfActiveFilters: 'Number of active filters',\n okay: 'Okay',\n optional: 'optional',\n pageNavigation: {\n more: 'More',\n },\n more: 'More',\n next: 'Next',\n previous: 'Previous',\n reset: 'Reset',\n resetAll: 'Reset all',\n search: 'Search',\n select: {\n self: 'Select',\n empty: 'No options',\n placeholder: 'Select option',\n selected: 'selected',\n },\n selectAll: 'Select all',\n sort: 'Sort',\n table: {\n collapseRow: 'Collapse row',\n expandRow: 'Expand row',\n },\n validation: {\n email: 'Email must be valid',\n maxLength: 'Must be at most {max} characters',\n maxValue: 'Must be at most {max}',\n minLength: 'Must be at least {min} characters',\n minValue: 'Must be at least {min}',\n positiveNumber: 'Must be greater than 0',\n price: 'Must have 2 decimal places',\n required: 'Required',\n wholeNumber: 'Must be a Whole Number',\n },\n viewFilterGroup: 'View filter group',\n },\n};\n","import get from 'lodash-es/get';\n\nimport messages from './locales/en-US';\n\nexport let locale = 'en-US';\nlet i18nHandler;\n\n/**\n * Replaces params in a translation message with respective values\n * @param {string} path Translation path (foo.bar.baz)\n * @param {object} params Any params used in the translation message\n * @returns {string}\n */\nexport function format(path, params) {\n const pathParams = path.match(/({)([\\w]+)(})/g) || [];\n let message = path;\n\n pathParams.forEach((param) => {\n const prop = param.replace(/[{}]/g, '');\n\n message = message.replace(param, params[prop] || '');\n });\n\n return message;\n}\n\n/**\n * Returns a translation based on translation path\n * @param {string} path Translation path (foo.bar.baz)\n * @param {object} params Any params used in the translation message\n */\nfunction translate(path, params) {\n // Lookup translation\n const value = get(messages, path);\n\n // Return translation, otherwise the path\n return value ? format(value, params) : path;\n}\n\n/**\n * Calls the provided translation method `config.i18n.t` if provided, or the built-in\n * @param {...(string|object)} args\n * @param {string} path Translation path (foo.bar.baz)\n * @param {object} params Any params used in the translation message\n * @returns {string} Translation message\n */\nexport function t(...args) {\n const value = i18nHandler && i18nHandler(...args);\n\n // If value exists, but translation doesn't (returns translation key format (xx.xx)),\n // then fallback to default\n if (value && !/^\\w{2,}\\.\\w{2,}/.test(value)) {\n return value;\n }\n\n // @ts-ignore - todo: Fix \"A spread argument must either have a tuple type or be passed to a rest parameter.ts(2556)\"\n // Default English message\n return translate(...args);\n}\n\n/**\n * Sets the locale\n * @param {string} l locale\n */\nexport function use(l) {\n locale = l || locale;\n}\n\n/**\n * Sets the translate function `t()`\n * @param {function} fn Translate function `t()`\n */\nexport function i18n(fn) {\n i18nHandler = fn;\n}\n\nexport default { i18n, locale, t, use };\n"],"names":["messages","locale","i18nHandler","format","path","params","pathParams","message","param","prop","translate","value","get","t","args","use","l","i18n","fn","locale$1"],"mappings":";AAAA,MAAeA,IAAA;AAAA,EACb,IAAI;AAAA,IACF,SAAS;AAAA,IACT,KAAK;AAAA,IACL,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,UAAU;AAAA,MACR,YAAY;AAAA,MACZ,iBAAiB;AAAA,IACnB;AAAA,IACA,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,MAAM;AAAA,MACJ,QAAQ;AAAA,MACR,iBAAiB;AAAA,IACnB;AAAA,IACA,YAAY;AAAA,MACV,YAAY;AAAA,MACZ,OA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ACL,aAAa;AAAA,MACb,WAAW;AAAA,IACb;AAAA,IACA,YAAY;AAAA,MACV,OAAO;AAAA,MACP,WAAW;AAAA,MACX,UAAU;AAAA,MACV,WAAW;AAAA,MACX,UAAU;AAAA,MACV,gBAAgB;AAAA,MAChB,OAAO;AAAA,MACP,UAAU;AAAA,MACV,aAAa;AAAA,IACf;AAAA,IACA,iBAAiB;AAAA,EACnB;AACF;AC7GO,IAAIC,IAAS,SAChBC;AAQY,SAAAC,EAAOC,GAAMC,GAAQ;AACnC,QAAMC,IAAaF,EAAK,MAAM,gBAAgB,KAAK,CAAA;AACnD,MAAIG,IAAUH;AAEH,SAAAE,EAAA,QAAQ,CAACE,MAAU;AAC5B,UAAMC,IAAOD,EAAM,QAAQ,SAAS,EAAE;AAEtC,IAAAD,IAAUA,EAAQ,QAAQC,GAAOH,EAAOI,CAAI,KAAK,EAAE;AAAA,EAAA,CACpD,GAEMF;AACT;AAOA,SAASG,EAAUN,GAAMC,GAAQ;AAEzB,QAAAM,IAAQC,EAAIZ,GAAUI,CAAI;AAGhC,SAAOO,IAAQR,EAAOQ,GAAON,CAAM,IAAID;AACzC;AASO,SAASS,KAAKC,GAAM;AACzB,QAAMH,IAAQT,KAAeA,EAAY,GAAGY,CAAI;AAIhD,SAAIH,KAAS,CAAC,kBAAkB,KAAKA,CAAK,IACjCA,IAKFD,EAAU,GAAGI,CAAI;AAC1B;AAMO,SAASC,EAAIC,GAAG;AACrB,EAAAf,IAASe,KAAKf;AAChB;AAMO,SAASgB,EAAKC,GAAI;AACT,EAAAhB,IAAAgB;AAChB;AAEA,MAAeC,IAAA,EAAE,MAAAF,GAAM,QAAAhB,GAAQ,GAAAY,GAAG,KAAAE,EAAI;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflink/stash",
3
- "version": "44.3.0",
3
+ "version": "44.4.0",
4
4
  "description": "LeafLink's design system.",
5
5
  "homepage": "https://stash.leaflink.com",
6
6
  "main": "./dist/index.ts",