@chayns-components/format 5.0.0-beta.981 → 5.0.0-beta.995

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.
@@ -8,7 +8,7 @@ exports.findFirstBBCode = findFirstBBCode;
8
8
  // @ts-ignore
9
9
  const BB_REGEX = /(\[([a-zA-Z0-9_]*)(.*?)\])(.*?)(\[\/\2\])/s;
10
10
  // Also matches "\" before quote to fix button for voucher messages
11
- const PARAMETER_REGEX = /([\w]*?)=\\?["](.*?)["]/g;
11
+ const PARAMETER_REGEX = /([\w]*?)=\\?["„“‚'‘](.*?)["“”‘'’]/g;
12
12
  // TODO Use external package instead of RegExp to parse BBCode.
13
13
  // It is not recommended to use RegExp to parse markup languages like BBCode, because it is not possible to parse nested tags with it.
14
14
 
@@ -1 +1 @@
1
- {"version":3,"file":"findBBCode.js","names":["BB_REGEX","PARAMETER_REGEX","findFirstBBCode","inputString","matches","exec","fullMatch","openingTag","tag","params","content","closingTag","index","undefined","parameters","match","key","value"],"sources":["../../../../../src/utils/formatString/bb-code/findBBCode.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst BB_REGEX = /(\\[([a-zA-Z0-9_]*)(.*?)\\])(.*?)(\\[\\/\\2\\])/s;\n// Also matches \"\\\" before quote to fix button for voucher messages\nconst PARAMETER_REGEX = /([\\w]*?)=\\\\?[\"](.*?)[\"]/g;\n\nexport interface BBCodeMatch {\n fullMatch: string;\n tag: string;\n parameters: Record<string, string>;\n content: string;\n index: number;\n openingTag: string;\n closingTag: string;\n}\n\n// TODO Use external package instead of RegExp to parse BBCode.\n// It is not recommended to use RegExp to parse markup languages like BBCode, because it is not possible to parse nested tags with it.\n\n// Finds and returns the first BBCode tag in the input string.\nexport function findFirstBBCode(inputString: string): BBCodeMatch | null {\n const matches = BB_REGEX.exec(inputString);\n\n if (matches !== null) {\n const [fullMatch, openingTag, tag, params, content, closingTag] = matches;\n const { index } = matches;\n\n if (\n fullMatch === undefined ||\n tag === undefined ||\n params === undefined ||\n content === undefined ||\n openingTag === undefined ||\n closingTag === undefined\n )\n return null;\n\n const parameters: Record<string, string> = {};\n\n let match: RegExpExecArray | null = null;\n // eslint-disable-next-line no-cond-assign\n while ((match = PARAMETER_REGEX.exec(params))) {\n const [, key, value] = match;\n\n if (value) {\n parameters[key || 'url'] = value;\n }\n }\n\n return {\n fullMatch,\n tag,\n parameters,\n content,\n index,\n openingTag,\n closingTag,\n };\n }\n\n return null;\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA,MAAMA,QAAQ,GAAG,4CAA4C;AAC7D;AACA,MAAMC,eAAe,GAAG,4BAA4B;AAYpD;AACA;;AAEA;AACO,SAASC,eAAeA,CAACC,WAAmB,EAAsB;EACrE,MAAMC,OAAO,GAAGJ,QAAQ,CAACK,IAAI,CAACF,WAAW,CAAC;EAE1C,IAAIC,OAAO,KAAK,IAAI,EAAE;IAClB,MAAM,CAACE,SAAS,EAAEC,UAAU,EAAEC,GAAG,EAAEC,MAAM,EAAEC,OAAO,EAAEC,UAAU,CAAC,GAAGP,OAAO;IACzE,MAAM;MAAEQ;IAAM,CAAC,GAAGR,OAAO;IAEzB,IACIE,SAAS,KAAKO,SAAS,IACvBL,GAAG,KAAKK,SAAS,IACjBJ,MAAM,KAAKI,SAAS,IACpBH,OAAO,KAAKG,SAAS,IACrBN,UAAU,KAAKM,SAAS,IACxBF,UAAU,KAAKE,SAAS,EAExB,OAAO,IAAI;IAEf,MAAMC,UAAkC,GAAG,CAAC,CAAC;IAE7C,IAAIC,KAA6B,GAAG,IAAI;IACxC;IACA,OAAQA,KAAK,GAAGd,eAAe,CAACI,IAAI,CAACI,MAAM,CAAC,EAAG;MAC3C,MAAM,GAAGO,GAAG,EAAEC,KAAK,CAAC,GAAGF,KAAK;MAE5B,IAAIE,KAAK,EAAE;QACPH,UAAU,CAACE,GAAG,IAAI,KAAK,CAAC,GAAGC,KAAK;MACpC;IACJ;IAEA,OAAO;MACHX,SAAS;MACTE,GAAG;MACHM,UAAU;MACVJ,OAAO;MACPE,KAAK;MACLL,UAAU;MACVI;IACJ,CAAC;EACL;EAEA,OAAO,IAAI;AACf","ignoreList":[]}
1
+ {"version":3,"file":"findBBCode.js","names":["BB_REGEX","PARAMETER_REGEX","findFirstBBCode","inputString","matches","exec","fullMatch","openingTag","tag","params","content","closingTag","index","undefined","parameters","match","key","value"],"sources":["../../../../../src/utils/formatString/bb-code/findBBCode.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst BB_REGEX = /(\\[([a-zA-Z0-9_]*)(.*?)\\])(.*?)(\\[\\/\\2\\])/s;\n// Also matches \"\\\" before quote to fix button for voucher messages\nconst PARAMETER_REGEX = /([\\w]*?)=\\\\?[\"„“‚'‘](.*?)[\"“”‘'’]/g;\n\nexport interface BBCodeMatch {\n fullMatch: string;\n tag: string;\n parameters: Record<string, string>;\n content: string;\n index: number;\n openingTag: string;\n closingTag: string;\n}\n\n// TODO Use external package instead of RegExp to parse BBCode.\n// It is not recommended to use RegExp to parse markup languages like BBCode, because it is not possible to parse nested tags with it.\n\n// Finds and returns the first BBCode tag in the input string.\nexport function findFirstBBCode(inputString: string): BBCodeMatch | null {\n const matches = BB_REGEX.exec(inputString);\n\n if (matches !== null) {\n const [fullMatch, openingTag, tag, params, content, closingTag] = matches;\n const { index } = matches;\n\n if (\n fullMatch === undefined ||\n tag === undefined ||\n params === undefined ||\n content === undefined ||\n openingTag === undefined ||\n closingTag === undefined\n )\n return null;\n\n const parameters: Record<string, string> = {};\n\n let match: RegExpExecArray | null = null;\n // eslint-disable-next-line no-cond-assign\n while ((match = PARAMETER_REGEX.exec(params))) {\n const [, key, value] = match;\n\n if (value) {\n parameters[key || 'url'] = value;\n }\n }\n\n return {\n fullMatch,\n tag,\n parameters,\n content,\n index,\n openingTag,\n closingTag,\n };\n }\n\n return null;\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA,MAAMA,QAAQ,GAAG,4CAA4C;AAC7D;AACA,MAAMC,eAAe,GAAG,oCAAoC;AAY5D;AACA;;AAEA;AACO,SAASC,eAAeA,CAACC,WAAmB,EAAsB;EACrE,MAAMC,OAAO,GAAGJ,QAAQ,CAACK,IAAI,CAACF,WAAW,CAAC;EAE1C,IAAIC,OAAO,KAAK,IAAI,EAAE;IAClB,MAAM,CAACE,SAAS,EAAEC,UAAU,EAAEC,GAAG,EAAEC,MAAM,EAAEC,OAAO,EAAEC,UAAU,CAAC,GAAGP,OAAO;IACzE,MAAM;MAAEQ;IAAM,CAAC,GAAGR,OAAO;IAEzB,IACIE,SAAS,KAAKO,SAAS,IACvBL,GAAG,KAAKK,SAAS,IACjBJ,MAAM,KAAKI,SAAS,IACpBH,OAAO,KAAKG,SAAS,IACrBN,UAAU,KAAKM,SAAS,IACxBF,UAAU,KAAKE,SAAS,EAExB,OAAO,IAAI;IAEf,MAAMC,UAAkC,GAAG,CAAC,CAAC;IAE7C,IAAIC,KAA6B,GAAG,IAAI;IACxC;IACA,OAAQA,KAAK,GAAGd,eAAe,CAACI,IAAI,CAACI,MAAM,CAAC,EAAG;MAC3C,MAAM,GAAGO,GAAG,EAAEC,KAAK,CAAC,GAAGF,KAAK;MAE5B,IAAIE,KAAK,EAAE;QACPH,UAAU,CAACE,GAAG,IAAI,KAAK,CAAC,GAAGC,KAAK;MACpC;IACJ;IAEA,OAAO;MACHX,SAAS;MACTE,GAAG;MACHM,UAAU;MACVJ,OAAO;MACPE,KAAK;MACLL,UAAU;MACVI;IACJ,CAAC;EACL;EAEA,OAAO,IAAI;AACf","ignoreList":[]}
@@ -2,7 +2,7 @@
2
2
  // @ts-ignore
3
3
  const BB_REGEX = /(\[([a-zA-Z0-9_]*)(.*?)\])(.*?)(\[\/\2\])/s;
4
4
  // Also matches "\" before quote to fix button for voucher messages
5
- const PARAMETER_REGEX = /([\w]*?)=\\?["](.*?)["]/g;
5
+ const PARAMETER_REGEX = /([\w]*?)=\\?["„“‚'‘](.*?)["“”‘'’]/g;
6
6
  // TODO Use external package instead of RegExp to parse BBCode.
7
7
  // It is not recommended to use RegExp to parse markup languages like BBCode, because it is not possible to parse nested tags with it.
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"findBBCode.js","names":["BB_REGEX","PARAMETER_REGEX","findFirstBBCode","inputString","matches","exec","fullMatch","openingTag","tag","params","content","closingTag","index","undefined","parameters","match","key","value"],"sources":["../../../../../src/utils/formatString/bb-code/findBBCode.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst BB_REGEX = /(\\[([a-zA-Z0-9_]*)(.*?)\\])(.*?)(\\[\\/\\2\\])/s;\n// Also matches \"\\\" before quote to fix button for voucher messages\nconst PARAMETER_REGEX = /([\\w]*?)=\\\\?[\"](.*?)[\"]/g;\n\nexport interface BBCodeMatch {\n fullMatch: string;\n tag: string;\n parameters: Record<string, string>;\n content: string;\n index: number;\n openingTag: string;\n closingTag: string;\n}\n\n// TODO Use external package instead of RegExp to parse BBCode.\n// It is not recommended to use RegExp to parse markup languages like BBCode, because it is not possible to parse nested tags with it.\n\n// Finds and returns the first BBCode tag in the input string.\nexport function findFirstBBCode(inputString: string): BBCodeMatch | null {\n const matches = BB_REGEX.exec(inputString);\n\n if (matches !== null) {\n const [fullMatch, openingTag, tag, params, content, closingTag] = matches;\n const { index } = matches;\n\n if (\n fullMatch === undefined ||\n tag === undefined ||\n params === undefined ||\n content === undefined ||\n openingTag === undefined ||\n closingTag === undefined\n )\n return null;\n\n const parameters: Record<string, string> = {};\n\n let match: RegExpExecArray | null = null;\n // eslint-disable-next-line no-cond-assign\n while ((match = PARAMETER_REGEX.exec(params))) {\n const [, key, value] = match;\n\n if (value) {\n parameters[key || 'url'] = value;\n }\n }\n\n return {\n fullMatch,\n tag,\n parameters,\n content,\n index,\n openingTag,\n closingTag,\n };\n }\n\n return null;\n}\n"],"mappings":"AAAA;AACA;AACA,MAAMA,QAAQ,GAAG,4CAA4C;AAC7D;AACA,MAAMC,eAAe,GAAG,4BAA4B;AAYpD;AACA;;AAEA;AACA,OAAO,SAASC,eAAeA,CAACC,WAAmB,EAAsB;EACrE,MAAMC,OAAO,GAAGJ,QAAQ,CAACK,IAAI,CAACF,WAAW,CAAC;EAE1C,IAAIC,OAAO,KAAK,IAAI,EAAE;IAClB,MAAM,CAACE,SAAS,EAAEC,UAAU,EAAEC,GAAG,EAAEC,MAAM,EAAEC,OAAO,EAAEC,UAAU,CAAC,GAAGP,OAAO;IACzE,MAAM;MAAEQ;IAAM,CAAC,GAAGR,OAAO;IAEzB,IACIE,SAAS,KAAKO,SAAS,IACvBL,GAAG,KAAKK,SAAS,IACjBJ,MAAM,KAAKI,SAAS,IACpBH,OAAO,KAAKG,SAAS,IACrBN,UAAU,KAAKM,SAAS,IACxBF,UAAU,KAAKE,SAAS,EAExB,OAAO,IAAI;IAEf,MAAMC,UAAkC,GAAG,CAAC,CAAC;IAE7C,IAAIC,KAA6B,GAAG,IAAI;IACxC;IACA,OAAQA,KAAK,GAAGd,eAAe,CAACI,IAAI,CAACI,MAAM,CAAC,EAAG;MAC3C,MAAM,GAAGO,GAAG,EAAEC,KAAK,CAAC,GAAGF,KAAK;MAE5B,IAAIE,KAAK,EAAE;QACPH,UAAU,CAACE,GAAG,IAAI,KAAK,CAAC,GAAGC,KAAK;MACpC;IACJ;IAEA,OAAO;MACHX,SAAS;MACTE,GAAG;MACHM,UAAU;MACVJ,OAAO;MACPE,KAAK;MACLL,UAAU;MACVI;IACJ,CAAC;EACL;EAEA,OAAO,IAAI;AACf","ignoreList":[]}
1
+ {"version":3,"file":"findBBCode.js","names":["BB_REGEX","PARAMETER_REGEX","findFirstBBCode","inputString","matches","exec","fullMatch","openingTag","tag","params","content","closingTag","index","undefined","parameters","match","key","value"],"sources":["../../../../../src/utils/formatString/bb-code/findBBCode.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst BB_REGEX = /(\\[([a-zA-Z0-9_]*)(.*?)\\])(.*?)(\\[\\/\\2\\])/s;\n// Also matches \"\\\" before quote to fix button for voucher messages\nconst PARAMETER_REGEX = /([\\w]*?)=\\\\?[\"„“‚'‘](.*?)[\"“”‘'’]/g;\n\nexport interface BBCodeMatch {\n fullMatch: string;\n tag: string;\n parameters: Record<string, string>;\n content: string;\n index: number;\n openingTag: string;\n closingTag: string;\n}\n\n// TODO Use external package instead of RegExp to parse BBCode.\n// It is not recommended to use RegExp to parse markup languages like BBCode, because it is not possible to parse nested tags with it.\n\n// Finds and returns the first BBCode tag in the input string.\nexport function findFirstBBCode(inputString: string): BBCodeMatch | null {\n const matches = BB_REGEX.exec(inputString);\n\n if (matches !== null) {\n const [fullMatch, openingTag, tag, params, content, closingTag] = matches;\n const { index } = matches;\n\n if (\n fullMatch === undefined ||\n tag === undefined ||\n params === undefined ||\n content === undefined ||\n openingTag === undefined ||\n closingTag === undefined\n )\n return null;\n\n const parameters: Record<string, string> = {};\n\n let match: RegExpExecArray | null = null;\n // eslint-disable-next-line no-cond-assign\n while ((match = PARAMETER_REGEX.exec(params))) {\n const [, key, value] = match;\n\n if (value) {\n parameters[key || 'url'] = value;\n }\n }\n\n return {\n fullMatch,\n tag,\n parameters,\n content,\n index,\n openingTag,\n closingTag,\n };\n }\n\n return null;\n}\n"],"mappings":"AAAA;AACA;AACA,MAAMA,QAAQ,GAAG,4CAA4C;AAC7D;AACA,MAAMC,eAAe,GAAG,oCAAoC;AAY5D;AACA;;AAEA;AACA,OAAO,SAASC,eAAeA,CAACC,WAAmB,EAAsB;EACrE,MAAMC,OAAO,GAAGJ,QAAQ,CAACK,IAAI,CAACF,WAAW,CAAC;EAE1C,IAAIC,OAAO,KAAK,IAAI,EAAE;IAClB,MAAM,CAACE,SAAS,EAAEC,UAAU,EAAEC,GAAG,EAAEC,MAAM,EAAEC,OAAO,EAAEC,UAAU,CAAC,GAAGP,OAAO;IACzE,MAAM;MAAEQ;IAAM,CAAC,GAAGR,OAAO;IAEzB,IACIE,SAAS,KAAKO,SAAS,IACvBL,GAAG,KAAKK,SAAS,IACjBJ,MAAM,KAAKI,SAAS,IACpBH,OAAO,KAAKG,SAAS,IACrBN,UAAU,KAAKM,SAAS,IACxBF,UAAU,KAAKE,SAAS,EAExB,OAAO,IAAI;IAEf,MAAMC,UAAkC,GAAG,CAAC,CAAC;IAE7C,IAAIC,KAA6B,GAAG,IAAI;IACxC;IACA,OAAQA,KAAK,GAAGd,eAAe,CAACI,IAAI,CAACI,MAAM,CAAC,EAAG;MAC3C,MAAM,GAAGO,GAAG,EAAEC,KAAK,CAAC,GAAGF,KAAK;MAE5B,IAAIE,KAAK,EAAE;QACPH,UAAU,CAACE,GAAG,IAAI,KAAK,CAAC,GAAGC,KAAK;MACpC;IACJ;IAEA,OAAO;MACHX,SAAS;MACTE,GAAG;MACHM,UAAU;MACVJ,OAAO;MACPE,KAAK;MACLL,UAAU;MACVI;IACJ,CAAC;EACL;EAEA,OAAO,IAAI;AACf","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chayns-components/format",
3
- "version": "5.0.0-beta.981",
3
+ "version": "5.0.0-beta.995",
4
4
  "description": "A set of beautiful React components for developing your own applications with chayns.",
5
5
  "sideEffects": false,
6
6
  "browserslist": [
@@ -73,5 +73,5 @@
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "gitHead": "a5d2942d7a6adea7b282fcbcb9f490af90517978"
76
+ "gitHead": "fe0672daa5fec362c812b5101a13762494490c58"
77
77
  }