@mintplayer/ng-bootstrap 22.16.0 → 22.17.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.
- package/fesm2022/mintplayer-ng-bootstrap-linify.mjs +8 -1
- package/fesm2022/mintplayer-ng-bootstrap-linify.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-slugify.mjs +12 -2
- package/fesm2022/mintplayer-ng-bootstrap-slugify.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-word-count.mjs +15 -10
- package/fesm2022/mintplayer-ng-bootstrap-word-count.mjs.map +1 -1
- package/package.json +1 -1
- package/types/mintplayer-ng-bootstrap-linify.d.ts +7 -0
- package/types/mintplayer-ng-bootstrap-slugify.d.ts +10 -0
- package/types/mintplayer-ng-bootstrap-word-count.d.ts +10 -0
|
@@ -2,9 +2,16 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Pipe } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
class BsLinifyPipe {
|
|
5
|
+
/**
|
|
6
|
+
* Splits text into lines, normalizing CRLF first.
|
|
7
|
+
*
|
|
8
|
+
* The `/g` flag is load-bearing: without it only the FIRST CRLF was rewritten
|
|
9
|
+
* and every later line of Windows-authored text kept a trailing `\r`, which
|
|
10
|
+
* then rode along into whatever the consumer rendered or compared.
|
|
11
|
+
*/
|
|
5
12
|
transform(value, removeEmptyEntries = true) {
|
|
6
13
|
const split = value
|
|
7
|
-
.replace(
|
|
14
|
+
.replace(/\r\n/g, '\n')
|
|
8
15
|
.split('\n');
|
|
9
16
|
return removeEmptyEntries
|
|
10
17
|
? split.filter((line) => line !== '')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-bootstrap-linify.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/linify/src/linify.pipe.ts","../../../../libs/mintplayer-ng-bootstrap/linify/mintplayer-ng-bootstrap-linify.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'bsLinify',\n})\nexport class BsLinifyPipe implements PipeTransform {\n transform(value: string, removeEmptyEntries = true) {\n const split = value\n .replace(
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-bootstrap-linify.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/linify/src/linify.pipe.ts","../../../../libs/mintplayer-ng-bootstrap/linify/mintplayer-ng-bootstrap-linify.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'bsLinify',\n})\nexport class BsLinifyPipe implements PipeTransform {\n /**\n * Splits text into lines, normalizing CRLF first.\n *\n * The `/g` flag is load-bearing: without it only the FIRST CRLF was rewritten\n * and every later line of Windows-authored text kept a trailing `\\r`, which\n * then rode along into whatever the consumer rendered or compared.\n */\n transform(value: string, removeEmptyEntries = true) {\n const split = value\n .replace(/\\r\\n/g, '\\n')\n .split('\\n');\n\n return removeEmptyEntries\n ? split.filter((line) => line !== '')\n : split;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAKa,YAAY,CAAA;AACvB;;;;;;AAMG;AACH,IAAA,SAAS,CAAC,KAAa,EAAE,kBAAkB,GAAG,IAAI,EAAA;QAChD,MAAM,KAAK,GAAG;AACX,aAAA,OAAO,CAAC,OAAO,EAAE,IAAI;aACrB,KAAK,CAAC,IAAI,CAAC;AAEd,QAAA,OAAO;AACL,cAAE,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,KAAK,EAAE;cAClC,KAAK;IACX;8GAhBW,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAAZ,YAAY,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,UAAA,EAAA,CAAA,CAAA;;2FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBAHxB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,UAAU;AACjB,iBAAA;;;ACJD;;AAEG;;;;"}
|
|
@@ -2,12 +2,22 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Pipe } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
class BsSlugifyPipe {
|
|
5
|
+
/**
|
|
6
|
+
* Turns a title into a URL slug.
|
|
7
|
+
*
|
|
8
|
+
* Latin text is still decomposed and stripped of diacritics, so `Crème` stays
|
|
9
|
+
* `creme` and existing slugs are unchanged. What changed is the character
|
|
10
|
+
* class: it keeps letters and numbers in ANY script (`\p{L}\p{N}`) instead of
|
|
11
|
+
* ASCII `\w`. The old class removed every character of a script with no Latin
|
|
12
|
+
* decomposition, so a non-Latin title slugified to the empty string — a route
|
|
13
|
+
* segment that cannot work rather than one that merely looks unfamiliar.
|
|
14
|
+
*/
|
|
5
15
|
transform(value) {
|
|
6
16
|
return value.toString().toLowerCase()
|
|
7
17
|
.replace(/\s+/g, '-') // Replace spaces with -
|
|
8
18
|
.normalize("NFD").replace(/[\u0300-\u036f]/g, "") // Remove diacritics
|
|
9
|
-
.replace(/[^\
|
|
10
|
-
.replace(
|
|
19
|
+
.replace(/[^\p{L}\p{N}_-]+/gu, '') // Remove all non-word chars
|
|
20
|
+
.replace(/-{2,}/g, '-') // Replace multiple - with single -
|
|
11
21
|
.replace(/^-+/, '') // Trim - from start of text
|
|
12
22
|
.replace(/-+$/, ''); // Trim - from end of text
|
|
13
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-bootstrap-slugify.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/slugify/src/slugify.pipe.ts","../../../../libs/mintplayer-ng-bootstrap/slugify/mintplayer-ng-bootstrap-slugify.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'bsSlugify',\n pure: true,\n})\nexport class BsSlugifyPipe implements PipeTransform {\n transform(value: string) {\n return value.toString().toLowerCase()\n .replace(/\\s+/g, '-') // Replace spaces with -\n .normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g, \"\") // Remove diacritics\n .replace(/[^\\
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-bootstrap-slugify.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/slugify/src/slugify.pipe.ts","../../../../libs/mintplayer-ng-bootstrap/slugify/mintplayer-ng-bootstrap-slugify.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'bsSlugify',\n pure: true,\n})\nexport class BsSlugifyPipe implements PipeTransform {\n /**\n * Turns a title into a URL slug.\n *\n * Latin text is still decomposed and stripped of diacritics, so `Crème` stays\n * `creme` and existing slugs are unchanged. What changed is the character\n * class: it keeps letters and numbers in ANY script (`\\p{L}\\p{N}`) instead of\n * ASCII `\\w`. The old class removed every character of a script with no Latin\n * decomposition, so a non-Latin title slugified to the empty string — a route\n * segment that cannot work rather than one that merely looks unfamiliar.\n */\n transform(value: string) {\n return value.toString().toLowerCase()\n .replace(/\\s+/g, '-') // Replace spaces with -\n .normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g, \"\") // Remove diacritics\n .replace(/[^\\p{L}\\p{N}_-]+/gu, '') // Remove all non-word chars\n .replace(/-{2,}/g, '-') // Replace multiple - with single -\n .replace(/^-+/, '') // Trim - from start of text\n .replace(/-+$/, ''); // Trim - from end of text\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAMa,aAAa,CAAA;AACxB;;;;;;;;;AASG;AACH,IAAA,SAAS,CAAC,KAAa,EAAA;AACrB,QAAA,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC,WAAW;AAChC,aAAA,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;aACpB,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;AAChD,aAAA,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC;AACjC,aAAA,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;AACtB,aAAA,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;AAClB,aAAA,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACxB;8GAnBW,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBAJzB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,WAAW;AACjB,oBAAA,IAAI,EAAE,IAAI;AACX,iBAAA;;;ACLD;;AAEG;;;;"}
|
|
@@ -2,18 +2,23 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Pipe } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
class BsWordCountPipe {
|
|
5
|
+
/**
|
|
6
|
+
* Counts words, where a word is any run of non-whitespace.
|
|
7
|
+
*
|
|
8
|
+
* Splits on `/\s+/` rather than collapsing whitespace and splitting on a
|
|
9
|
+
* literal space: the earlier version collapsed only runs of TWO or more
|
|
10
|
+
* whitespace characters, so a single newline or tab between two words was
|
|
11
|
+
* neither collapsed nor split on and the pair counted as one word — while two
|
|
12
|
+
* or more whitespace characters happened to work, which is what made it hard
|
|
13
|
+
* to notice.
|
|
14
|
+
*/
|
|
5
15
|
transform(value) {
|
|
6
|
-
if (
|
|
16
|
+
if (!value)
|
|
7
17
|
return 0;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
.replace(/\s{2,}/gi, ' ')
|
|
13
|
-
.split(' ')
|
|
14
|
-
.filter(w => w !== '')
|
|
15
|
-
.length;
|
|
16
|
-
}
|
|
18
|
+
return value
|
|
19
|
+
.split(/\s+/)
|
|
20
|
+
.filter((word) => word !== '')
|
|
21
|
+
.length;
|
|
17
22
|
}
|
|
18
23
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsWordCountPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
19
24
|
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.8", ngImport: i0, type: BsWordCountPipe, isStandalone: true, name: "bsWordCount" }); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-bootstrap-word-count.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/word-count/src/word-count.pipe.ts","../../../../libs/mintplayer-ng-bootstrap/word-count/mintplayer-ng-bootstrap-word-count.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'bsWordCount',\n pure: true,\n})\nexport class BsWordCountPipe implements PipeTransform {\n
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-bootstrap-word-count.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/word-count/src/word-count.pipe.ts","../../../../libs/mintplayer-ng-bootstrap/word-count/mintplayer-ng-bootstrap-word-count.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'bsWordCount',\n pure: true,\n})\nexport class BsWordCountPipe implements PipeTransform {\n /**\n * Counts words, where a word is any run of non-whitespace.\n *\n * Splits on `/\\s+/` rather than collapsing whitespace and splitting on a\n * literal space: the earlier version collapsed only runs of TWO or more\n * whitespace characters, so a single newline or tab between two words was\n * neither collapsed nor split on and the pair counted as one word — while two\n * or more whitespace characters happened to work, which is what made it hard\n * to notice.\n */\n transform(value: string) {\n if (!value) return 0;\n return value\n .split(/\\s+/)\n .filter((word) => word !== '')\n .length;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAMa,eAAe,CAAA;AAC1B;;;;;;;;;AASG;AACH,IAAA,SAAS,CAAC,KAAa,EAAA;AACrB,QAAA,IAAI,CAAC,KAAK;AAAE,YAAA,OAAO,CAAC;AACpB,QAAA,OAAO;aACJ,KAAK,CAAC,KAAK;aACX,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,KAAK,EAAE;AAC5B,aAAA,MAAM;IACX;8GAjBW,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAAf,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,aAAA,EAAA,CAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,aAAa;AACnB,oBAAA,IAAI,EAAE,IAAI;AACX,iBAAA;;;ACLD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -2,6 +2,13 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { PipeTransform } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
declare class BsLinifyPipe implements PipeTransform {
|
|
5
|
+
/**
|
|
6
|
+
* Splits text into lines, normalizing CRLF first.
|
|
7
|
+
*
|
|
8
|
+
* The `/g` flag is load-bearing: without it only the FIRST CRLF was rewritten
|
|
9
|
+
* and every later line of Windows-authored text kept a trailing `\r`, which
|
|
10
|
+
* then rode along into whatever the consumer rendered or compared.
|
|
11
|
+
*/
|
|
5
12
|
transform(value: string, removeEmptyEntries?: boolean): string[];
|
|
6
13
|
static ɵfac: i0.ɵɵFactoryDeclaration<BsLinifyPipe, never>;
|
|
7
14
|
static ɵpipe: i0.ɵɵPipeDeclaration<BsLinifyPipe, "bsLinify", true>;
|
|
@@ -2,6 +2,16 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { PipeTransform } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
declare class BsSlugifyPipe implements PipeTransform {
|
|
5
|
+
/**
|
|
6
|
+
* Turns a title into a URL slug.
|
|
7
|
+
*
|
|
8
|
+
* Latin text is still decomposed and stripped of diacritics, so `Crème` stays
|
|
9
|
+
* `creme` and existing slugs are unchanged. What changed is the character
|
|
10
|
+
* class: it keeps letters and numbers in ANY script (`\p{L}\p{N}`) instead of
|
|
11
|
+
* ASCII `\w`. The old class removed every character of a script with no Latin
|
|
12
|
+
* decomposition, so a non-Latin title slugified to the empty string — a route
|
|
13
|
+
* segment that cannot work rather than one that merely looks unfamiliar.
|
|
14
|
+
*/
|
|
5
15
|
transform(value: string): string;
|
|
6
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<BsSlugifyPipe, never>;
|
|
7
17
|
static ɵpipe: i0.ɵɵPipeDeclaration<BsSlugifyPipe, "bsSlugify", true>;
|
|
@@ -2,6 +2,16 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { PipeTransform } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
declare class BsWordCountPipe implements PipeTransform {
|
|
5
|
+
/**
|
|
6
|
+
* Counts words, where a word is any run of non-whitespace.
|
|
7
|
+
*
|
|
8
|
+
* Splits on `/\s+/` rather than collapsing whitespace and splitting on a
|
|
9
|
+
* literal space: the earlier version collapsed only runs of TWO or more
|
|
10
|
+
* whitespace characters, so a single newline or tab between two words was
|
|
11
|
+
* neither collapsed nor split on and the pair counted as one word — while two
|
|
12
|
+
* or more whitespace characters happened to work, which is what made it hard
|
|
13
|
+
* to notice.
|
|
14
|
+
*/
|
|
5
15
|
transform(value: string): number;
|
|
6
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<BsWordCountPipe, never>;
|
|
7
17
|
static ɵpipe: i0.ɵɵPipeDeclaration<BsWordCountPipe, "bsWordCount", true>;
|