@pushwoosh/dumb-components 1.1.16 → 1.1.17

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,12 +1,12 @@
1
1
  export function replaceLocalization(str, values) {
2
- const re = /{{([0-9A-Za-z_ \-.[\]]+)\|(text|html|color)\|([^}]*)?}}/g;
2
+ const re = /{{([^|{}]+)\|(text|html|color)\|([^}]*)?}}/g;
3
3
  return str.replace(re, (_, key, _type, defaultValue) => {
4
4
  return (key in values ? values[key] : defaultValue) || '';
5
5
  });
6
6
  }
7
7
  export function replacePlaceholders(str, values) {
8
8
  const allAvailableModifiers = ['CapitalizeFirst', 'CapitalizeAllFirst', 'UPPERCASE', 'lowercase', 'regular', 'cent', 'dollar', 'comma', 'euro', 'jpy', 'lira', 'M-d-y', 'm-d-y', 'M d y', 'M d Y', 'l', 'M d', 'H:i', 'm-d-y H:i'];
9
- const re = new RegExp(`{([0-9A-Za-z_ \\-]{1,64})\\|(${allAvailableModifiers.join('|')})(?:\\|([^}]*))?}`, 'g');
9
+ const re = new RegExp(`{([^|{}]{1,64})\\|(${allAvailableModifiers.join('|')})(?:\\|([^}]*))?}`, 'g');
10
10
  return str.replace(re, (_, key, _modifier, defaultValue) => {
11
11
  return (key in values ? values[key] : defaultValue) || '';
12
12
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "1.1.16",
3
+ "version": "1.1.17",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",