@code-name-jack/ngx-linkifyjs 17.0.0 → 18.0.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/README.md +399 -13
- package/esm2022/lib/ngx-linkifyjs.module.mjs +57 -0
- package/{esm2020 → esm2022}/lib/pipes/ngx-linkifyjs.pipe.mjs +4 -4
- package/{esm2020 → esm2022}/lib/service/ngx-linkifyjs.service.mjs +5 -5
- package/{fesm2020 → fesm2022}/code-name-jack-ngx-linkifyjs.mjs +25 -24
- package/{fesm2020 → fesm2022}/code-name-jack-ngx-linkifyjs.mjs.map +1 -1
- package/index.d.ts +0 -1
- package/lib/enum/linktype.enum.d.ts +0 -1
- package/lib/interfaces/ngx-linkifyjs.interface.d.ts +0 -1
- package/lib/ngx-linkifyjs.module.d.ts +0 -1
- package/lib/pipes/ngx-linkifyjs.pipe.d.ts +0 -1
- package/lib/service/ngx-linkifyjs.service.d.ts +0 -1
- package/package.json +9 -15
- package/public-api.d.ts +0 -1
- package/code-name-jack-ngx-linkifyjs.d.ts.map +0 -1
- package/esm2020/lib/ngx-linkifyjs.module.mjs +0 -56
- package/fesm2015/code-name-jack-ngx-linkifyjs.mjs +0 -122
- package/fesm2015/code-name-jack-ngx-linkifyjs.mjs.map +0 -1
- package/lib/enum/linktype.enum.d.ts.map +0 -1
- package/lib/interfaces/ngx-linkifyjs.interface.d.ts.map +0 -1
- package/lib/ngx-linkifyjs.module.d.ts.map +0 -1
- package/lib/pipes/ngx-linkifyjs.pipe.d.ts.map +0 -1
- package/lib/service/ngx-linkifyjs.service.d.ts.map +0 -1
- package/public-api.d.ts.map +0 -1
- /package/{esm2020 → esm2022}/code-name-jack-ngx-linkifyjs.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/enum/linktype.enum.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/interfaces/ngx-linkifyjs.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/public-api.mjs +0 -0
package/README.md
CHANGED
|
@@ -1,24 +1,410 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ngx-linkifyjs-v2 - Angular 17 wrapper for linkifyjs - library for finding links in plain text and converting them to HTML <a> tags via linkifyjs
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://badge.fury.io/js/ngx-linkifyjs),
|
|
4
|
+
[](https://anthonynahas.github.io/ngx-linkifyjs)
|
|
5
|
+
[](https://gitter.im/angular-material-extensions/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
6
|
+
[](https://circleci.com/gh/AnthonyNahas/ngx-linkifyjs)
|
|
7
|
+
[](https://travis-ci.org/AnthonyNahas/ngx-linkifyjs)
|
|
8
|
+
[](https://coveralls.io/github/AnthonyNahas/ngx-linkifyjs?branch=master)
|
|
9
|
+
[](https://david-dm.org/anthonynahas/ngx-linkifyjs)
|
|
10
|
+
[](https://david-dm.org/anthonynahas/ngx-linkifyjs#info=devDependencies)
|
|
11
|
+
[](https://greenkeeper.io/)
|
|
12
|
+
[](https://github.com/AnthonyNahas/ngx-linkifyjs/blob/master/LICENSE)
|
|
13
|
+
[](https://github.com/gdi2290/awesome-angular)
|
|
4
14
|
|
|
5
|
-
## Code scaffolding
|
|
6
15
|
|
|
7
|
-
|
|
8
|
-
|
|
16
|
+
<p align="center">
|
|
17
|
+
<img alt="ngx-linkifyjs demo" width="320px" style="text-align: center;"
|
|
18
|
+
src="https://cdn.jsdelivr.net/gh/anthonynahas/ngx-linkifyjs@master/assets/demo.gif">
|
|
19
|
+
</p>
|
|
9
20
|
|
|
10
|
-
##
|
|
21
|
+
## Built by and for developers :heart:
|
|
22
|
+
Do you have any question or suggestion ? Please do not hesitate to contact us!
|
|
23
|
+
Alternatively, provide a PR | open an appropriate issue [here](https://github.com/anthonynahas/ngx-linkifyjs/issues)
|
|
11
24
|
|
|
12
|
-
|
|
25
|
+
If you like this project, support [ngx-linkifyjs](https://github.com/anthonynahas/ngx-linkifyjs)
|
|
26
|
+
by starring :star: and sharing it :loudspeaker:
|
|
13
27
|
|
|
14
|
-
## Publishing
|
|
15
28
|
|
|
16
|
-
After building your library with `ng build ngx-linkifyjs-v2`, go to the dist folder `cd dist/ngx-linkifyjs-v2` and run `npm publish`.
|
|
17
29
|
|
|
18
|
-
##
|
|
30
|
+
## Table of Contents
|
|
31
|
+
- [Demo](#demo)
|
|
32
|
+
- [Features](#features)
|
|
33
|
+
- [Documentation](#documentation)
|
|
34
|
+
- [Installation](#installation)
|
|
35
|
+
- [Usage](#usage)
|
|
36
|
+
- [Config](#config)
|
|
37
|
+
- [Run Demo App Locally](#run-demo-app-locally)
|
|
38
|
+
- [Other Angular Libraries](#other-angular-libraries)
|
|
39
|
+
- [Support](#support)
|
|
40
|
+
- [License](#license)
|
|
19
41
|
|
|
20
|
-
|
|
42
|
+
<a name="demo"/>
|
|
21
43
|
|
|
22
|
-
##
|
|
44
|
+
## Demo
|
|
45
|
+
|
|
46
|
+
View all the directives in action at https://anthonynahas.github.io/ngx-linkifyjs
|
|
47
|
+
|
|
48
|
+
<a name="documentation"/>
|
|
49
|
+
|
|
50
|
+
## [Documentation](https://anthonynahas.github.io/ngx-linkifyjs/doc/index.html)
|
|
51
|
+
|
|
52
|
+
<a name="dependencies"/>
|
|
53
|
+
|
|
54
|
+
## Dependencies
|
|
55
|
+
* [Angular](https://angular.io) (*requires* Angular 2 or higher, tested with 7.x)
|
|
56
|
+
|
|
57
|
+
<a name="installation"/>
|
|
58
|
+
|
|
59
|
+
# Installation
|
|
60
|
+
|
|
61
|
+
## 1. Install via *ng add*. (Recommended)
|
|
62
|
+
|
|
63
|
+
Now add the library via the `angular schematics`
|
|
64
|
+
```shell
|
|
65
|
+
ng add ngx-linkifyjs
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## 2. Install via *npm*. (Alternative)
|
|
69
|
+
|
|
70
|
+
Now install `ngx-linkifyjs` via:
|
|
71
|
+
```shell
|
|
72
|
+
npm i -s ngx-linkifyjs
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
##### SystemJS
|
|
77
|
+
>**Note**:If you are using `SystemJS`, you should adjust your configuration to point to the UMD bundle.
|
|
78
|
+
In your systemjs config file, `map` needs to tell the System loader where to look for `ngx-linkifyjs`:
|
|
79
|
+
```js
|
|
80
|
+
{
|
|
81
|
+
'ngx-linkifyjs';: 'node_modules/ngx-linkifyjs/bundles/ngx-linkifyjs.umd.js',
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
Once installed you need to import the main module:
|
|
87
|
+
```js
|
|
88
|
+
import { NgxLinkifyjsModule } from 'ngx-linkifyjs';
|
|
89
|
+
```
|
|
90
|
+
The only remaining part is to list the imported module in your application module. The exact method will be slightly
|
|
91
|
+
different for the root (top-level) module for which you should end up with the code similar to (notice ` NgxLinkifyjsModule .forRoot()`):
|
|
92
|
+
```typescript
|
|
93
|
+
import { NgxLinkifyjsModule } from 'ngx-linkifyjs';
|
|
94
|
+
|
|
95
|
+
@NgModule({
|
|
96
|
+
declarations: [AppComponent, ...],
|
|
97
|
+
imports: [NgxLinkifyjsModule.forRoot(), ...],
|
|
98
|
+
bootstrap: [AppComponent]
|
|
99
|
+
})
|
|
100
|
+
export class AppModule {
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Other modules in your application can simply import ` NgxLinkifyjsModule `:
|
|
105
|
+
|
|
106
|
+
```js
|
|
107
|
+
import { NgxLinkifyjsModule } from 'ngx-linkifyjs';
|
|
108
|
+
|
|
109
|
+
@NgModule({
|
|
110
|
+
declarations: [OtherComponent, ...],
|
|
111
|
+
imports: [NgxLinkifyjsModule, ...],
|
|
112
|
+
})
|
|
113
|
+
export class OtherModule {
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
<a name="usage"/>
|
|
118
|
+
|
|
119
|
+
## Usage
|
|
120
|
+
|
|
121
|
+
Once the library is imported, you can use its components, directives and pipes in your Angular application:
|
|
122
|
+
|
|
123
|
+
### Options
|
|
124
|
+
|
|
125
|
+
`ngx-linkifyjs` provides an appropriate option interface called `NgxLinkifyOptions` to access [the native options of the linkifyjs library](https://soapbox.github.io/linkifyjs/docs/options.html)
|
|
126
|
+
and all of them are optional
|
|
127
|
+
- Default values
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
|
|
131
|
+
import { NgxLinkifyOptions } from 'ngx-linkifyjs';
|
|
132
|
+
|
|
133
|
+
const options: NgxLinkifyOptions =
|
|
134
|
+
{
|
|
135
|
+
attributes: null,
|
|
136
|
+
className: 'linkified',
|
|
137
|
+
defaultProtocol: 'http',
|
|
138
|
+
events: null,
|
|
139
|
+
format: function (value, type) {
|
|
140
|
+
return value;
|
|
141
|
+
},
|
|
142
|
+
formatHref: function (href, type) {
|
|
143
|
+
return href;
|
|
144
|
+
},
|
|
145
|
+
ignoreTags: [],
|
|
146
|
+
nl2br: false,
|
|
147
|
+
tagName: 'a',
|
|
148
|
+
target: {
|
|
149
|
+
url: '_blank'
|
|
150
|
+
},
|
|
151
|
+
validate: true
|
|
152
|
+
};
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Pipe
|
|
156
|
+
|
|
157
|
+
`{{text | linkify}}`
|
|
158
|
+
|
|
159
|
+
```html
|
|
160
|
+
<span [innerHTML]="'Linkify the following URL: https://github.com/anthonynahas/ngx-linkifyjs and share it <3' | linkify"></span>
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**result**: Linkify the following URL: [https://github.com/anthonynahas/ngx-linkifyjs](https://github.com/anthonynahas/ngx-linkifyjs) and share it <3
|
|
164
|
+
|
|
165
|
+
if you prefer to provide your own option to the `pipe`, you can use it like the following:
|
|
166
|
+
|
|
167
|
+
- `{{text | linkify: 'options' }}`
|
|
168
|
+
- `{{text | linkify: '{/*your options*/}' }}`
|
|
169
|
+
- `{{text | linkify: '{target {url: "_self" }}' }}`
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
### Service
|
|
173
|
+
|
|
174
|
+
Inject the `NgxLinkifyjsService` service
|
|
175
|
+
|
|
176
|
+
```typescript
|
|
177
|
+
import {NgxLinkifyjsService, Link, LinkType} from 'ngx-linkifyjs';
|
|
178
|
+
|
|
179
|
+
constructor(public; NgxLinkifyjsService;) {
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
<a name="linkify_method"/>
|
|
185
|
+
|
|
186
|
+
#### linkify _(text: string, options?: NgxLinkifyOptions): string_
|
|
187
|
+
|
|
188
|
+
Convert a basic text string to a valid linkified text
|
|
189
|
+
|
|
190
|
+
**Params**
|
|
191
|
+
|
|
192
|
+
* **`text`** : _`String`_ Text to linkify --> to convert with links
|
|
193
|
+
* **`options`** : _`NgxLinkifyjsService`_ options to pass it to the linkifyjs library and it's optional
|
|
194
|
+
|
|
195
|
+
**Returns** _`String`_ converted text with links
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
```typescript
|
|
199
|
+
import {NgxLinkifyjsService, Link, LinkType, NgxLinkifyOptions} from 'ngx-linkifyjs';
|
|
200
|
+
|
|
201
|
+
constructor(public; NgxLinkifyjsService;) {
|
|
202
|
+
|
|
203
|
+
const options: NgxLinkifyOptions =
|
|
204
|
+
{
|
|
205
|
+
className: 'linkifiedYES',
|
|
206
|
+
target : {
|
|
207
|
+
url : '_self'
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
this.linkifyService.linkify('For help with GitHub.com, please email support@github.com');
|
|
212
|
+
// result 1 --> see below
|
|
213
|
+
|
|
214
|
+
this.linkifyService.linkify('For help with GitHub.com, please email support@github.com', options);
|
|
215
|
+
// result 2 --> see below
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
result 1
|
|
221
|
+
```typescript
|
|
222
|
+
'For help with <a href=\"http://github.com\" class=\"linkified\" target=\"_blank\">GitHub.com</a>, please email <a href=\"mailto:support@github.com\" class=\"linkified\">support@github.com</a>'
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
result 2
|
|
226
|
+
```typescript
|
|
227
|
+
'For help with <a href=\"http://github.com\" class=\"linkifiedYES\" target=\"_self\">GitHub.com</a>, please email <a href=\"mailto:support@github.com\" class=\"linkifiedYES\">support@github.com</a>'
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
#### `find` method
|
|
231
|
+
|
|
232
|
+
Finds all links in the given string
|
|
233
|
+
|
|
234
|
+
**Params**
|
|
235
|
+
|
|
236
|
+
* **`text`** : _`String`_ search text string
|
|
237
|
+
|
|
238
|
+
**Returns** _`Array<Link>`_ List of links where each element is a hash with properties type, value, and href:
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
* **type** is the type of entity found. Possible values are
|
|
242
|
+
- `'url'`
|
|
243
|
+
- `'email'`
|
|
244
|
+
- `'hashtag'` (if Hashtag is enabled via config/default `true`)
|
|
245
|
+
- `'mention'` (if Mention is enabled via config/default `true`)
|
|
246
|
+
* **value** is the original entity substring.
|
|
247
|
+
* **href** should be the value of this link's `href` attribute.
|
|
248
|
+
|
|
249
|
+
```typescript
|
|
250
|
+
import {Component, OnInit} from '@angular/core';
|
|
251
|
+
import {NgxLinkifyjsService, Link, LinkType} from 'ngx-linkifyjs';
|
|
252
|
+
|
|
253
|
+
@Component({
|
|
254
|
+
selector: 'app-home',
|
|
255
|
+
templateUrl: './home.component.html',
|
|
256
|
+
styleUrls: ['./home.component.scss']
|
|
257
|
+
})
|
|
258
|
+
export class HomeComponent {
|
|
259
|
+
|
|
260
|
+
constructor(public linkifyService: NgxLinkifyjsService) {
|
|
261
|
+
const foundLinks: Link[] = this.linkifyService.find('Any links to github.com here? If not, contact test@example.com');
|
|
262
|
+
|
|
263
|
+
// result - output --> see below
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
}
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
```typescript
|
|
270
|
+
// Result
|
|
271
|
+
[
|
|
272
|
+
{
|
|
273
|
+
type: LinkType.URL,
|
|
274
|
+
value: 'github.com',
|
|
275
|
+
href: 'http://github.com'
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
type: LinkType.EMAIL,
|
|
279
|
+
value: 'test@example.com',
|
|
280
|
+
href: 'mailto:test@example.com'
|
|
281
|
+
}
|
|
282
|
+
]
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
#### `test` method
|
|
286
|
+
|
|
287
|
+
Is the given string a link? Not to be used for strict validation - See [Caveats](caveats.html)
|
|
288
|
+
|
|
289
|
+
**Params**
|
|
290
|
+
|
|
291
|
+
* **`value`** : _`String`_ | _`Array<String>`_ Test string
|
|
292
|
+
|
|
293
|
+
**Returns** _`Boolean`_
|
|
294
|
+
|
|
295
|
+
```typescript
|
|
296
|
+
import {Component, OnInit} from '@angular/core';
|
|
297
|
+
import {NgxLinkifyjsService} from 'ngx-linkifyjs';
|
|
298
|
+
|
|
299
|
+
@Component({
|
|
300
|
+
selector: 'app-home',
|
|
301
|
+
templateUrl: './home.component.html',
|
|
302
|
+
styleUrls: ['./home.component.scss']
|
|
303
|
+
})
|
|
304
|
+
export class HomeComponent {
|
|
305
|
+
|
|
306
|
+
constructor(public linkifyService: NgxLinkifyjsService) {
|
|
307
|
+
this.linkifyService.test('github.com'); // return true
|
|
308
|
+
this.linkifyService.test('dev@example.com'); // return true
|
|
309
|
+
this.linkifyService.test(['github.com', 'email']); // return false
|
|
310
|
+
this.linkifyService.test('helloWorld'); // return false
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
<a name="config"/>
|
|
316
|
+
|
|
317
|
+
#### Enable/Disable the hash and mention
|
|
318
|
+
|
|
319
|
+
The config argument is 100% optional, otherwise we will take the default values `true`
|
|
320
|
+
|
|
321
|
+
```typescript
|
|
322
|
+
import { NgxLinkifyjsModule } from 'ngx-linkifyjs';
|
|
323
|
+
|
|
324
|
+
@NgModule({
|
|
325
|
+
declarations: [AppComponent, ...],
|
|
326
|
+
imports: [NgxLinkifyjsModule.forRoot(
|
|
327
|
+
{
|
|
328
|
+
enableHash: false, // optional - default true
|
|
329
|
+
enableMention: false // optional - default true
|
|
330
|
+
}), ...],
|
|
331
|
+
bootstrap: [AppComponent]
|
|
332
|
+
})
|
|
333
|
+
export class AppModule {
|
|
334
|
+
}
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
take a look @ [@angular-material-extensions/link-preview](https://github.com/angular-material-extensions/link-preview) which is using `ngx-linkifyjs`
|
|
338
|
+
|
|
339
|
+
## Run Demo App Locally
|
|
340
|
+
|
|
341
|
+
- [clone this repo](https://github.com/AnthonyNahas/ngx-linkifyjs.git) by running
|
|
342
|
+
```bash
|
|
343
|
+
$ git clone https://github.com/AnthonyNahas/ngx-linkifyjs.git
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
- setup the ngx-linkifyjs package
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
$ gulp steup
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
- navigate to the demo app directory
|
|
353
|
+
```bash
|
|
354
|
+
$ cd demo
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
- install the dependencies and run the app locally
|
|
358
|
+
```bash
|
|
359
|
+
$ npm i && npm start
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
- the app is now hosted by `http://localhost:4200/`
|
|
363
|
+
|
|
364
|
+
---
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
<a name="other-angular-libraries"/>
|
|
368
|
+
|
|
369
|
+
## Other Angular Libraries
|
|
370
|
+
- [ngx-auth-firebaseui](https://github.com/anthonynahas/ngx-auth-firebaseui)
|
|
371
|
+
- [@firebaseui/ng-bootstrap](https://github.com/firebaseui/ng-bootstrap)
|
|
372
|
+
- [@angular-material-extensions/password-strength](https://github.com/angular-material-extensions/password-strength)
|
|
373
|
+
- [@angular-material-extensions/link-preview](https://github.com/angular-material-extensions/link-preview)
|
|
374
|
+
- [@angular-material-extensions/select-country](https://github.com/angular-material-extensions/select-country)
|
|
375
|
+
- [@angular-material-extensions/pages](https://github.com/angular-material-extensions/pages)
|
|
376
|
+
- [@angular-material-extensions/contacts](https://github.com/angular-material-extensions/contacts)
|
|
377
|
+
- [@angular-material-extensions/faq](https://github.com/angular-material-extensions/faq)
|
|
378
|
+
- [@angular-material-extensions/jumbotron](https://github.com/angular-material-extensions/jumbotron)
|
|
379
|
+
- [@angular-material-extensions/google-maps-autocomplete](https://github.com/angular-material-extensions/google-maps-autocomplete)
|
|
380
|
+
- [@angular-material-extensions/combination-generator](https://github.com/angular-material-extensions/combination-generator)
|
|
381
|
+
|
|
382
|
+
---
|
|
383
|
+
|
|
384
|
+
<a name="support"/>
|
|
385
|
+
|
|
386
|
+
## Support
|
|
387
|
+
+ Drop an email to: [Anthony Nahas](mailto:anthony.na@hotmail.de)
|
|
388
|
+
+ or open an appropriate [issue](https://github.com/anthonynahas/ngx-linkifyjs/issues)
|
|
389
|
+
+ let us chat on [Gitter](https://gitter.im/angular-material-extensions/Lobby)
|
|
390
|
+
|
|
391
|
+
Built by and for developers :heart: we will help you :punch:
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
395
|
+
---
|
|
396
|
+
|
|
397
|
+

|
|
398
|
+
|
|
399
|
+
This project is supported by [jetbrains](https://www.jetbrains.com/) with 1 ALL PRODUCTS PACK OS LICENSE incl. [webstorm](https://www.jetbrains.com/webstorm)
|
|
400
|
+
|
|
401
|
+
---
|
|
402
|
+
|
|
403
|
+
<a name="license"/>
|
|
404
|
+
|
|
405
|
+
## License
|
|
406
|
+
|
|
407
|
+
Copyright (c) 2018 Anthony Nahas
|
|
408
|
+
Copyright (c) 2022 Ethan Gerardot
|
|
409
|
+
Licensed under the MIT License (MIT)
|
|
23
410
|
|
|
24
|
-
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { Inject, InjectionToken, NgModule } from '@angular/core';
|
|
3
|
+
// TODO REMOVE ME
|
|
4
|
+
// import * as linkify from 'linkifyjs';
|
|
5
|
+
// import hashtag from 'linkify-plugin-hashtag';
|
|
6
|
+
// import mention from 'linkify-plugin-mention';
|
|
7
|
+
import { NgxLinkifyjsService } from './service/ngx-linkifyjs.service';
|
|
8
|
+
import { NgxLinkifyjsPipe } from './pipes/ngx-linkifyjs.pipe';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
export { LinkType } from './enum/linktype.enum';
|
|
11
|
+
export { NgxLinkifyjsPipe } from './pipes/ngx-linkifyjs.pipe';
|
|
12
|
+
export { NgxLinkifyjsService } from './service/ngx-linkifyjs.service';
|
|
13
|
+
export const NgxLinkifyjsConfigToken = new InjectionToken('NgxLinkifyjsConfig');
|
|
14
|
+
export const DEFAULT_CONFIG = { enableHash: true, enableMention: true };
|
|
15
|
+
export class NgxLinkifyjsModule {
|
|
16
|
+
config;
|
|
17
|
+
static forRoot(config = DEFAULT_CONFIG) {
|
|
18
|
+
return {
|
|
19
|
+
ngModule: NgxLinkifyjsModule,
|
|
20
|
+
providers: [
|
|
21
|
+
NgxLinkifyjsService,
|
|
22
|
+
{
|
|
23
|
+
provide: NgxLinkifyjsConfigToken,
|
|
24
|
+
useValue: config
|
|
25
|
+
},
|
|
26
|
+
]
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
constructor(config) {
|
|
30
|
+
this.config = config;
|
|
31
|
+
// TODO REMOVE ME
|
|
32
|
+
// if (config.enableHash) {
|
|
33
|
+
// hashtag(linkify);
|
|
34
|
+
// }
|
|
35
|
+
//
|
|
36
|
+
// if (config.enableMention) {
|
|
37
|
+
// mention(linkify);
|
|
38
|
+
// }
|
|
39
|
+
}
|
|
40
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgxLinkifyjsModule, deps: [{ token: NgxLinkifyjsConfigToken }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
41
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: NgxLinkifyjsModule, declarations: [NgxLinkifyjsPipe], imports: [CommonModule], exports: [NgxLinkifyjsPipe] });
|
|
42
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgxLinkifyjsModule, imports: [CommonModule] });
|
|
43
|
+
}
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgxLinkifyjsModule, decorators: [{
|
|
45
|
+
type: NgModule,
|
|
46
|
+
args: [{
|
|
47
|
+
imports: [
|
|
48
|
+
CommonModule
|
|
49
|
+
],
|
|
50
|
+
exports: [NgxLinkifyjsPipe],
|
|
51
|
+
declarations: [NgxLinkifyjsPipe]
|
|
52
|
+
}]
|
|
53
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
54
|
+
type: Inject,
|
|
55
|
+
args: [NgxLinkifyjsConfigToken]
|
|
56
|
+
}] }] });
|
|
57
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWxpbmtpZnlqcy5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtbGlua2lmeWpzLXYyL3NyYy9saWIvbmd4LWxpbmtpZnlqcy5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLFlBQVksRUFBQyxNQUFNLGlCQUFpQixDQUFDO0FBQzdDLE9BQU8sRUFBQyxNQUFNLEVBQUUsY0FBYyxFQUF1QixRQUFRLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDcEYs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B7XG4gICAgICBuZ01vZHVsZTogTmd4TGlua2lmeWpzTW9kdWxlLFxuICAgICAgcHJvdmlkZXJzOlxuICAgICAgICBbXG4gICAgICAgICAgTmd4TGlua2lmeWpzU2VydmljZSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBwcm92aWRlOiBOZ3hMaW5raWZ5anNDb25maWdUb2tlbixcbiAgICAgICAgICAgIHVzZVZhbHVlOiBjb25maWdcbiAgICAgICAgICB9LFxuICAgICAgICBdXG4gICAgfTtcbiAgfVxuXG4gIGNvbnN0cnVjdG9yKEBJbmplY3QoTmd4TGlua2lmeWpzQ29uZmlnVG9rZW4pXG4gICAgICAgICAgICAgIHB1YmxpYyBjb25maWc6IE5neExpbmtpZnlqc0NvbmZpZykge1xuICAgIC8vIFRPRE8gUkVNT1ZFIE1FXG4gICAgLy8gaWYgKGNvbmZpZy5lbmFibGVIYXNoKSB7XG4gICAgLy8gICBoYXNodGFnKGxpbmtpZnkpO1xuICAgIC8vIH1cbiAgICAvL1xuICAgIC8vIGlmIChjb25maWcuZW5hYmxlTWVudGlvbikge1xuICAgIC8vICAgbWVudGlvbihsaW5raWZ5KTtcbiAgICAvLyB9XG4gIH1cblxufVxuIl19
|
|
@@ -5,13 +5,13 @@ export class NgxLinkifyjsPipe {
|
|
|
5
5
|
transform(value, options) {
|
|
6
6
|
return value ? linkifyStr(value, options) : value;
|
|
7
7
|
}
|
|
8
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgxLinkifyjsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
9
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: NgxLinkifyjsPipe, name: "linkify" });
|
|
8
10
|
}
|
|
9
|
-
|
|
10
|
-
NgxLinkifyjsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsPipe, name: "linkify" });
|
|
11
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsPipe, decorators: [{
|
|
11
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgxLinkifyjsPipe, decorators: [{
|
|
12
12
|
type: Pipe,
|
|
13
13
|
args: [{
|
|
14
14
|
name: 'linkify'
|
|
15
15
|
}]
|
|
16
16
|
}] });
|
|
17
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
17
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWxpbmtpZnlqcy5waXBlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LWxpbmtpZnlqcy12Mi9zcmMvbGliL3BpcGVzL25neC1saW5raWZ5anMucGlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsSUFBSSxFQUFnQixNQUFNLGVBQWUsQ0FBQztBQUVsRCxPQUFPLFVBQVUsTUFBTSxnQkFBZ0IsQ0FBQzs7QUFLeEMsTUFBTSxPQUFPLGdCQUFnQjtJQUUzQixTQUFTLENBQUMsS0FBYSxFQUFFLE9BQTJCO1FBQ2xELE9BQU8sS0FBSyxDQUFDLENBQUMsQ0FBQyxVQUFVLENBQUMsS0FBSyxFQUFFLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUM7SUFDcEQsQ0FBQzt1R0FKVSxnQkFBZ0I7cUdBQWhCLGdCQUFnQjs7MkZBQWhCLGdCQUFnQjtrQkFINUIsSUFBSTttQkFBQztvQkFDSixJQUFJLEVBQUUsU0FBUztpQkFDaEIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge1BpcGUsIFBpcGVUcmFuc2Zvcm19IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHtOZ3hMaW5raWZ5T3B0aW9uc30gZnJvbSAnLi4vaW50ZXJmYWNlcy9uZ3gtbGlua2lmeWpzLmludGVyZmFjZSc7XG5pbXBvcnQgbGlua2lmeVN0ciBmcm9tICdsaW5raWZ5LXN0cmluZyc7XG5cbkBQaXBlKHtcbiAgbmFtZTogJ2xpbmtpZnknXG59KVxuZXhwb3J0IGNsYXNzIE5neExpbmtpZnlqc1BpcGUgaW1wbGVtZW50cyBQaXBlVHJhbnNmb3JtIHtcblxuICB0cmFuc2Zvcm0odmFsdWU6IHN0cmluZywgb3B0aW9ucz86IE5neExpbmtpZnlPcHRpb25zKTogc3RyaW5nIHtcbiAgICByZXR1cm4gdmFsdWUgPyBsaW5raWZ5U3RyKHZhbHVlLCBvcHRpb25zKSA6IHZhbHVlO1xuICB9XG5cbn1cbiJdfQ==
|
|
@@ -33,10 +33,10 @@ export class NgxLinkifyjsService {
|
|
|
33
33
|
}
|
|
34
34
|
return value.find(v => !linkify.test(v)) === undefined;
|
|
35
35
|
}
|
|
36
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgxLinkifyjsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
37
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgxLinkifyjsService });
|
|
36
38
|
}
|
|
37
|
-
|
|
38
|
-
NgxLinkifyjsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsService });
|
|
39
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsService, decorators: [{
|
|
39
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgxLinkifyjsService, decorators: [{
|
|
40
40
|
type: Injectable
|
|
41
|
-
}], ctorParameters:
|
|
42
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
41
|
+
}], ctorParameters: () => [] });
|
|
42
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWxpbmtpZnlqcy5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LWxpbmtpZnlqcy12Mi9zcmMvbGliL3NlcnZpY2Uvbmd4LWxpbmtpZnlqcy5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBQyxVQUFVLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDekMsT0FBTyxLQUFLLE9BQU8sTUFBTSxXQUFXLENBQUM7QUFDckMsT0FBTyxVQUFVLE1BQU0sZ0JBQWdCLENBQUM7O0FBSXhDLE1BQU0sT0FBTyxtQkFBbUI7SUFDOUI7SUFDQSxDQUFDO0lBRUQ7Ozs7O09BS0c7SUFDSCxPQUFPLENBQUMsSUFBWSxFQUFFLE9BQTJCO1FBQy9DLE9BQU8sVUFBVSxDQUFDLElBQUksRUFBRSxPQUFPLENBQUMsQ0FBQztJQUNuQyxDQUFDO0lBRUQ7Ozs7T0FJRztJQUNILElBQUksQ0FBQyxJQUFZO1FBQ2YsT0FBTyxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO0lBQzVCLENBQUM7SUFFRDs7OztPQUlHO0lBQ0gsSUFBSSxDQUFDLEtBQXdCO1FBQzNCLElBQUksT0FBTyxLQUFLLEtBQUssUUFBUSxFQUFFO1lBQzdCLE9BQU8sT0FBTyxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQztTQUM1QjtRQUNELE9BQU8sS0FBSyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsRUFBRS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gLSB0aGUgc3RyaW5nIHRvIGZpbmQgc29tZSBsaW5rc1xuICAgKi9cbiAgZmluZCh0ZXh0OiBzdHJpbmcpOiBBcnJheTxMaW5rPiB7XG4gICAgcmV0dXJuIGxpbmtpZnkuZmluZCh0ZXh0KTtcbiAgfVxuXG4gIC8qKlxuICAgKiBUZXN0IGlmIGEgZ2l2ZW4gdmFsdWUgaXMgYSBsaW5rIG9yIGFuIGFycmF5IG9mIGFsbCBsaW5rc1xuICAgKlxuICAgKiBAcGFyYW0gdmFsdWUgLSB0aGUgdmFsdWUgdG8gdGVzdFxuICAgKi9cbiAgdGVzdCh2YWx1ZTogc3RyaW5nIHwgc3RyaW5nW10pOiBib29sZWFuIHtcbiAgICBpZiAodHlwZW9mIHZhbHVlID09PSAnc3RyaW5nJykge1xuICAgICAgcmV0dXJuIGxpbmtpZnkudGVzdCh2YWx1ZSk7XG4gICAgfVxuICAgIHJldHVybiB2YWx1ZS5maW5kKHYgPT4gIWxpbmtpZnkudGVzdCh2KSkgPT09IHVuZGVmaW5lZDtcbiAgfVxuXG59XG4iXX0=
|
|
@@ -16,10 +16,10 @@ class NgxLinkifyjsPipe {
|
|
|
16
16
|
transform(value, options) {
|
|
17
17
|
return value ? linkifyStr(value, options) : value;
|
|
18
18
|
}
|
|
19
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgxLinkifyjsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
20
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: NgxLinkifyjsPipe, name: "linkify" });
|
|
19
21
|
}
|
|
20
|
-
|
|
21
|
-
NgxLinkifyjsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsPipe, name: "linkify" });
|
|
22
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsPipe, decorators: [{
|
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgxLinkifyjsPipe, decorators: [{
|
|
23
23
|
type: Pipe,
|
|
24
24
|
args: [{
|
|
25
25
|
name: 'linkify'
|
|
@@ -57,27 +57,17 @@ class NgxLinkifyjsService {
|
|
|
57
57
|
}
|
|
58
58
|
return value.find(v => !linkify.test(v)) === undefined;
|
|
59
59
|
}
|
|
60
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgxLinkifyjsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
61
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgxLinkifyjsService });
|
|
60
62
|
}
|
|
61
|
-
|
|
62
|
-
NgxLinkifyjsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsService });
|
|
63
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsService, decorators: [{
|
|
63
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgxLinkifyjsService, decorators: [{
|
|
64
64
|
type: Injectable
|
|
65
|
-
}], ctorParameters:
|
|
65
|
+
}], ctorParameters: () => [] });
|
|
66
66
|
|
|
67
67
|
const NgxLinkifyjsConfigToken = new InjectionToken('NgxLinkifyjsConfig');
|
|
68
68
|
const DEFAULT_CONFIG = { enableHash: true, enableMention: true };
|
|
69
69
|
class NgxLinkifyjsModule {
|
|
70
|
-
|
|
71
|
-
this.config = config;
|
|
72
|
-
// TODO REMOVE ME
|
|
73
|
-
// if (config.enableHash) {
|
|
74
|
-
// hashtag(linkify);
|
|
75
|
-
// }
|
|
76
|
-
//
|
|
77
|
-
// if (config.enableMention) {
|
|
78
|
-
// mention(linkify);
|
|
79
|
-
// }
|
|
80
|
-
}
|
|
70
|
+
config;
|
|
81
71
|
static forRoot(config = DEFAULT_CONFIG) {
|
|
82
72
|
return {
|
|
83
73
|
ngModule: NgxLinkifyjsModule,
|
|
@@ -90,11 +80,22 @@ class NgxLinkifyjsModule {
|
|
|
90
80
|
]
|
|
91
81
|
};
|
|
92
82
|
}
|
|
83
|
+
constructor(config) {
|
|
84
|
+
this.config = config;
|
|
85
|
+
// TODO REMOVE ME
|
|
86
|
+
// if (config.enableHash) {
|
|
87
|
+
// hashtag(linkify);
|
|
88
|
+
// }
|
|
89
|
+
//
|
|
90
|
+
// if (config.enableMention) {
|
|
91
|
+
// mention(linkify);
|
|
92
|
+
// }
|
|
93
|
+
}
|
|
94
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgxLinkifyjsModule, deps: [{ token: NgxLinkifyjsConfigToken }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
95
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: NgxLinkifyjsModule, declarations: [NgxLinkifyjsPipe], imports: [CommonModule], exports: [NgxLinkifyjsPipe] });
|
|
96
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgxLinkifyjsModule, imports: [CommonModule] });
|
|
93
97
|
}
|
|
94
|
-
|
|
95
|
-
NgxLinkifyjsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsModule, declarations: [NgxLinkifyjsPipe], imports: [CommonModule], exports: [NgxLinkifyjsPipe] });
|
|
96
|
-
NgxLinkifyjsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsModule, imports: [CommonModule] });
|
|
97
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsModule, decorators: [{
|
|
98
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgxLinkifyjsModule, decorators: [{
|
|
98
99
|
type: NgModule,
|
|
99
100
|
args: [{
|
|
100
101
|
imports: [
|
|
@@ -103,10 +104,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
103
104
|
exports: [NgxLinkifyjsPipe],
|
|
104
105
|
declarations: [NgxLinkifyjsPipe]
|
|
105
106
|
}]
|
|
106
|
-
}], ctorParameters:
|
|
107
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
107
108
|
type: Inject,
|
|
108
109
|
args: [NgxLinkifyjsConfigToken]
|
|
109
|
-
}] }]
|
|
110
|
+
}] }] });
|
|
110
111
|
|
|
111
112
|
/*
|
|
112
113
|
* Public API Surface of ngx-linkifyjs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-name-jack-ngx-linkifyjs.mjs","sources":["../../../projects/ngx-linkifyjs-v2/src/lib/enum/linktype.enum.ts","../../../projects/ngx-linkifyjs-v2/src/lib/pipes/ngx-linkifyjs.pipe.ts","../../../projects/ngx-linkifyjs-v2/src/lib/service/ngx-linkifyjs.service.ts","../../../projects/ngx-linkifyjs-v2/src/lib/ngx-linkifyjs.module.ts","../../../projects/ngx-linkifyjs-v2/src/public-api.ts","../../../projects/ngx-linkifyjs-v2/src/code-name-jack-ngx-linkifyjs.ts"],"sourcesContent":["export enum LinkType {\n URL = 'url',\n HASHTAG = 'hashtag',\n MENTION = 'mention',\n EMAIL = 'email',\n}\n","import {Pipe, PipeTransform} from '@angular/core';\nimport {NgxLinkifyOptions} from '../interfaces/ngx-linkifyjs.interface';\nimport linkifyStr from 'linkify-string';\n\n@Pipe({\n name: 'linkify'\n})\nexport class NgxLinkifyjsPipe implements PipeTransform {\n\n transform(value: string, options?: NgxLinkifyOptions): string {\n return value ? linkifyStr(value, options) : value;\n }\n\n}\n","import {Injectable} from '@angular/core';\nimport * as linkify from 'linkifyjs';\nimport linkifyStr from 'linkify-string';\nimport {Link, NgxLinkifyOptions} from '../interfaces/ngx-linkifyjs.interface';\n\n@Injectable()\nexport class NgxLinkifyjsService {\n constructor() {\n }\n\n /**\n * Convert the passed text as a string to an appropriate url\n *\n * @param text - the string to convert\n * @param options - options to pass it to the linkifyjs library\n */\n linkify(text: string, options?: NgxLinkifyOptions): string {\n return linkifyStr(text, options);\n }\n\n /**\n * Find any links in a given text as a string\n *\n * @param text - the string to find some links\n */\n find(text: string): Array<Link> {\n return linkify.find(text);\n }\n\n /**\n * Test if a given value is a link or an array of all links\n *\n * @param value - the value to test\n */\n test(value: string | string[]): boolean {\n if (typeof value === 'string') {\n return linkify.test(value);\n }\n return value.find(v => !linkify.test(v)) === undefined;\n }\n\n}\n","import {CommonModule} from '@angular/common';\nimport {Inject, InjectionToken, ModuleWithProviders, NgModule} from '@angular/core';\n// TODO REMOVE ME\n// import * as linkify from 'linkifyjs';\n// import hashtag from 'linkify-plugin-hashtag';\n// import mention from 'linkify-plugin-mention';\n\nimport {NgxLinkifyjsService} from './service/ngx-linkifyjs.service';\nimport {NgxLinkifyjsPipe} from './pipes/ngx-linkifyjs.pipe';\n\n// Export module's public API\nexport {Link} from './interfaces/ngx-linkifyjs.interface';\nimport {NgxLinkifyjsConfig} from './interfaces/ngx-linkifyjs.interface';\n\nexport {LinkType} from './enum/linktype.enum';\nexport {NgxLinkifyOptions} from './interfaces/ngx-linkifyjs.interface';\nexport {NgxLinkifyjsPipe} from './pipes/ngx-linkifyjs.pipe';\nexport {NgxLinkifyjsService} from './service/ngx-linkifyjs.service';\n\nexport const NgxLinkifyjsConfigToken = new InjectionToken<NgxLinkifyjsConfig>('NgxLinkifyjsConfig');\nexport const DEFAULT_CONFIG: NgxLinkifyjsConfig = {enableHash: true, enableMention: true};\n\n@NgModule({\n imports: [\n CommonModule\n ],\n exports: [NgxLinkifyjsPipe],\n declarations: [NgxLinkifyjsPipe]\n})\nexport class NgxLinkifyjsModule {\n\n static forRoot(config: NgxLinkifyjsConfig = DEFAULT_CONFIG): ModuleWithProviders<NgxLinkifyjsModule> {\n return {\n ngModule: NgxLinkifyjsModule,\n providers:\n [\n NgxLinkifyjsService,\n {\n provide: NgxLinkifyjsConfigToken,\n useValue: config\n },\n ]\n };\n }\n\n constructor(@Inject(NgxLinkifyjsConfigToken)\n public config: NgxLinkifyjsConfig) {\n // TODO REMOVE ME\n // if (config.enableHash) {\n // hashtag(linkify);\n // }\n //\n // if (config.enableMention) {\n // mention(linkify);\n // }\n }\n\n}\n","/*\n * Public API Surface of ngx-linkifyjs\n */\n\nexport * from './lib/enum/linktype.enum';\nexport * from './lib/interfaces/ngx-linkifyjs.interface';\nexport * from './lib/pipes/ngx-linkifyjs.pipe';\nexport * from './lib/service/ngx-linkifyjs.service';\nexport * from './lib/ngx-linkifyjs.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;IAAY,SAKX;AALD,CAAA,UAAY,QAAQ,EAAA;AAClB,IAAA,QAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;AACX,IAAA,QAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,QAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,QAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACjB,CAAC,EALW,QAAQ,KAAR,QAAQ,GAKnB,EAAA,CAAA,CAAA;;MCEY,gBAAgB,CAAA;IAE3B,SAAS,CAAC,KAAa,EAAE,OAA2B,EAAA;AAClD,QAAA,OAAO,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC;KACnD
|
|
1
|
+
{"version":3,"file":"code-name-jack-ngx-linkifyjs.mjs","sources":["../../../projects/ngx-linkifyjs-v2/src/lib/enum/linktype.enum.ts","../../../projects/ngx-linkifyjs-v2/src/lib/pipes/ngx-linkifyjs.pipe.ts","../../../projects/ngx-linkifyjs-v2/src/lib/service/ngx-linkifyjs.service.ts","../../../projects/ngx-linkifyjs-v2/src/lib/ngx-linkifyjs.module.ts","../../../projects/ngx-linkifyjs-v2/src/public-api.ts","../../../projects/ngx-linkifyjs-v2/src/code-name-jack-ngx-linkifyjs.ts"],"sourcesContent":["export enum LinkType {\n URL = 'url',\n HASHTAG = 'hashtag',\n MENTION = 'mention',\n EMAIL = 'email',\n}\n","import {Pipe, PipeTransform} from '@angular/core';\nimport {NgxLinkifyOptions} from '../interfaces/ngx-linkifyjs.interface';\nimport linkifyStr from 'linkify-string';\n\n@Pipe({\n name: 'linkify'\n})\nexport class NgxLinkifyjsPipe implements PipeTransform {\n\n transform(value: string, options?: NgxLinkifyOptions): string {\n return value ? linkifyStr(value, options) : value;\n }\n\n}\n","import {Injectable} from '@angular/core';\nimport * as linkify from 'linkifyjs';\nimport linkifyStr from 'linkify-string';\nimport {Link, NgxLinkifyOptions} from '../interfaces/ngx-linkifyjs.interface';\n\n@Injectable()\nexport class NgxLinkifyjsService {\n constructor() {\n }\n\n /**\n * Convert the passed text as a string to an appropriate url\n *\n * @param text - the string to convert\n * @param options - options to pass it to the linkifyjs library\n */\n linkify(text: string, options?: NgxLinkifyOptions): string {\n return linkifyStr(text, options);\n }\n\n /**\n * Find any links in a given text as a string\n *\n * @param text - the string to find some links\n */\n find(text: string): Array<Link> {\n return linkify.find(text);\n }\n\n /**\n * Test if a given value is a link or an array of all links\n *\n * @param value - the value to test\n */\n test(value: string | string[]): boolean {\n if (typeof value === 'string') {\n return linkify.test(value);\n }\n return value.find(v => !linkify.test(v)) === undefined;\n }\n\n}\n","import {CommonModule} from '@angular/common';\nimport {Inject, InjectionToken, ModuleWithProviders, NgModule} from '@angular/core';\n// TODO REMOVE ME\n// import * as linkify from 'linkifyjs';\n// import hashtag from 'linkify-plugin-hashtag';\n// import mention from 'linkify-plugin-mention';\n\nimport {NgxLinkifyjsService} from './service/ngx-linkifyjs.service';\nimport {NgxLinkifyjsPipe} from './pipes/ngx-linkifyjs.pipe';\n\n// Export module's public API\nexport {Link} from './interfaces/ngx-linkifyjs.interface';\nimport {NgxLinkifyjsConfig} from './interfaces/ngx-linkifyjs.interface';\n\nexport {LinkType} from './enum/linktype.enum';\nexport {NgxLinkifyOptions} from './interfaces/ngx-linkifyjs.interface';\nexport {NgxLinkifyjsPipe} from './pipes/ngx-linkifyjs.pipe';\nexport {NgxLinkifyjsService} from './service/ngx-linkifyjs.service';\n\nexport const NgxLinkifyjsConfigToken = new InjectionToken<NgxLinkifyjsConfig>('NgxLinkifyjsConfig');\nexport const DEFAULT_CONFIG: NgxLinkifyjsConfig = {enableHash: true, enableMention: true};\n\n@NgModule({\n imports: [\n CommonModule\n ],\n exports: [NgxLinkifyjsPipe],\n declarations: [NgxLinkifyjsPipe]\n})\nexport class NgxLinkifyjsModule {\n\n static forRoot(config: NgxLinkifyjsConfig = DEFAULT_CONFIG): ModuleWithProviders<NgxLinkifyjsModule> {\n return {\n ngModule: NgxLinkifyjsModule,\n providers:\n [\n NgxLinkifyjsService,\n {\n provide: NgxLinkifyjsConfigToken,\n useValue: config\n },\n ]\n };\n }\n\n constructor(@Inject(NgxLinkifyjsConfigToken)\n public config: NgxLinkifyjsConfig) {\n // TODO REMOVE ME\n // if (config.enableHash) {\n // hashtag(linkify);\n // }\n //\n // if (config.enableMention) {\n // mention(linkify);\n // }\n }\n\n}\n","/*\n * Public API Surface of ngx-linkifyjs\n */\n\nexport * from './lib/enum/linktype.enum';\nexport * from './lib/interfaces/ngx-linkifyjs.interface';\nexport * from './lib/pipes/ngx-linkifyjs.pipe';\nexport * from './lib/service/ngx-linkifyjs.service';\nexport * from './lib/ngx-linkifyjs.module';\n","/**\n * Generated bundle index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AA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,EAFd,YAAA,EAAA,CAAA,gBAAgB,CAH7B,EAAA,OAAA,EAAA,CAAA,YAAY,aAEJ,gBAAgB,CAAA,EAAA,CAAA,CAAA;AAGf,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,YAL3B,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAKH,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAP9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;oBACD,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,YAAY,EAAE,CAAC,gBAAgB,CAAC;AACjC,iBAAA,CAAA;;0BAiBc,MAAM;2BAAC,uBAAuB,CAAA;;;AC7C7C;;AAEG;;ACFH;;AAEG;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -18,4 +18,3 @@ export declare class NgxLinkifyjsModule {
|
|
|
18
18
|
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxLinkifyjsModule, [typeof i1.NgxLinkifyjsPipe], [typeof i2.CommonModule], [typeof i1.NgxLinkifyjsPipe]>;
|
|
19
19
|
static ɵinj: i0.ɵɵInjectorDeclaration<NgxLinkifyjsModule>;
|
|
20
20
|
}
|
|
21
|
-
//# sourceMappingURL=ngx-linkifyjs.module.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-name-jack/ngx-linkifyjs",
|
|
3
3
|
"description": "Angular wrapper for linkifyjs(v4) - library for finding links in plain text and converting them to HTML <a> tags via linkifyjs",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "18.0.0",
|
|
5
5
|
"homepage": "https://github.com/code-name-jack/ngx-linkifyjs-v2",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Code Name Jack",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"url": "https://github.com/code-name-jack/ngx-linkifyjs-v2/issues"
|
|
32
32
|
},
|
|
33
33
|
"engines": {
|
|
34
|
-
"node": ">=
|
|
34
|
+
"node": ">=18.0.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@angular/common": "~
|
|
38
|
-
"@angular/core": "~
|
|
39
|
-
"@schematics/angular": "~
|
|
37
|
+
"@angular/common": "~18.x",
|
|
38
|
+
"@angular/core": "~18.x",
|
|
39
|
+
"@schematics/angular": "~18.x",
|
|
40
40
|
"linkify-plugin-hashtag": "^4.0.2",
|
|
41
41
|
"linkify-plugin-mention": "^4.0.2",
|
|
42
42
|
"linkify-string": "^4.0.2",
|
|
@@ -120,11 +120,7 @@
|
|
|
120
120
|
],
|
|
121
121
|
"scope": "\\S+.*"
|
|
122
122
|
},
|
|
123
|
-
"module": "
|
|
124
|
-
"es2020": "fesm2020/code-name-jack-ngx-linkifyjs.mjs",
|
|
125
|
-
"esm2020": "esm2020/code-name-jack-ngx-linkifyjs.mjs",
|
|
126
|
-
"fesm2020": "fesm2020/code-name-jack-ngx-linkifyjs.mjs",
|
|
127
|
-
"fesm2015": "fesm2015/code-name-jack-ngx-linkifyjs.mjs",
|
|
123
|
+
"module": "fesm2022/code-name-jack-ngx-linkifyjs.mjs",
|
|
128
124
|
"typings": "index.d.ts",
|
|
129
125
|
"exports": {
|
|
130
126
|
"./package.json": {
|
|
@@ -132,11 +128,9 @@
|
|
|
132
128
|
},
|
|
133
129
|
".": {
|
|
134
130
|
"types": "./index.d.ts",
|
|
135
|
-
"
|
|
136
|
-
"
|
|
137
|
-
"
|
|
138
|
-
"node": "./fesm2015/code-name-jack-ngx-linkifyjs.mjs",
|
|
139
|
-
"default": "./fesm2020/code-name-jack-ngx-linkifyjs.mjs"
|
|
131
|
+
"esm2022": "./esm2022/code-name-jack-ngx-linkifyjs.mjs",
|
|
132
|
+
"esm": "./esm2022/code-name-jack-ngx-linkifyjs.mjs",
|
|
133
|
+
"default": "./fesm2022/code-name-jack-ngx-linkifyjs.mjs"
|
|
140
134
|
}
|
|
141
135
|
},
|
|
142
136
|
"sideEffects": false,
|
package/public-api.d.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"code-name-jack-ngx-linkifyjs.d.ts","sourceRoot":"","sources":["../../projects/ngx-linkifyjs-v2/src/code-name-jack-ngx-linkifyjs.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,cAAc,cAAc,CAAC"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { Inject, InjectionToken, NgModule } from '@angular/core';
|
|
3
|
-
// TODO REMOVE ME
|
|
4
|
-
// import * as linkify from 'linkifyjs';
|
|
5
|
-
// import hashtag from 'linkify-plugin-hashtag';
|
|
6
|
-
// import mention from 'linkify-plugin-mention';
|
|
7
|
-
import { NgxLinkifyjsService } from './service/ngx-linkifyjs.service';
|
|
8
|
-
import { NgxLinkifyjsPipe } from './pipes/ngx-linkifyjs.pipe';
|
|
9
|
-
import * as i0 from "@angular/core";
|
|
10
|
-
export { LinkType } from './enum/linktype.enum';
|
|
11
|
-
export { NgxLinkifyjsPipe } from './pipes/ngx-linkifyjs.pipe';
|
|
12
|
-
export { NgxLinkifyjsService } from './service/ngx-linkifyjs.service';
|
|
13
|
-
export const NgxLinkifyjsConfigToken = new InjectionToken('NgxLinkifyjsConfig');
|
|
14
|
-
export const DEFAULT_CONFIG = { enableHash: true, enableMention: true };
|
|
15
|
-
export class NgxLinkifyjsModule {
|
|
16
|
-
constructor(config) {
|
|
17
|
-
this.config = config;
|
|
18
|
-
// TODO REMOVE ME
|
|
19
|
-
// if (config.enableHash) {
|
|
20
|
-
// hashtag(linkify);
|
|
21
|
-
// }
|
|
22
|
-
//
|
|
23
|
-
// if (config.enableMention) {
|
|
24
|
-
// mention(linkify);
|
|
25
|
-
// }
|
|
26
|
-
}
|
|
27
|
-
static forRoot(config = DEFAULT_CONFIG) {
|
|
28
|
-
return {
|
|
29
|
-
ngModule: NgxLinkifyjsModule,
|
|
30
|
-
providers: [
|
|
31
|
-
NgxLinkifyjsService,
|
|
32
|
-
{
|
|
33
|
-
provide: NgxLinkifyjsConfigToken,
|
|
34
|
-
useValue: config
|
|
35
|
-
},
|
|
36
|
-
]
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
NgxLinkifyjsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsModule, deps: [{ token: NgxLinkifyjsConfigToken }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
41
|
-
NgxLinkifyjsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsModule, declarations: [NgxLinkifyjsPipe], imports: [CommonModule], exports: [NgxLinkifyjsPipe] });
|
|
42
|
-
NgxLinkifyjsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsModule, imports: [CommonModule] });
|
|
43
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsModule, decorators: [{
|
|
44
|
-
type: NgModule,
|
|
45
|
-
args: [{
|
|
46
|
-
imports: [
|
|
47
|
-
CommonModule
|
|
48
|
-
],
|
|
49
|
-
exports: [NgxLinkifyjsPipe],
|
|
50
|
-
declarations: [NgxLinkifyjsPipe]
|
|
51
|
-
}]
|
|
52
|
-
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
53
|
-
type: Inject,
|
|
54
|
-
args: [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gLy8gfVxuICB9XG5cbn1cbiJdfQ==
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Pipe, Injectable, InjectionToken, NgModule, Inject } from '@angular/core';
|
|
3
|
-
import linkifyStr from 'linkify-string';
|
|
4
|
-
import * as linkify from 'linkifyjs';
|
|
5
|
-
import { CommonModule } from '@angular/common';
|
|
6
|
-
|
|
7
|
-
var LinkType;
|
|
8
|
-
(function (LinkType) {
|
|
9
|
-
LinkType["URL"] = "url";
|
|
10
|
-
LinkType["HASHTAG"] = "hashtag";
|
|
11
|
-
LinkType["MENTION"] = "mention";
|
|
12
|
-
LinkType["EMAIL"] = "email";
|
|
13
|
-
})(LinkType || (LinkType = {}));
|
|
14
|
-
|
|
15
|
-
class NgxLinkifyjsPipe {
|
|
16
|
-
transform(value, options) {
|
|
17
|
-
return value ? linkifyStr(value, options) : value;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
NgxLinkifyjsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
21
|
-
NgxLinkifyjsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsPipe, name: "linkify" });
|
|
22
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsPipe, decorators: [{
|
|
23
|
-
type: Pipe,
|
|
24
|
-
args: [{
|
|
25
|
-
name: 'linkify'
|
|
26
|
-
}]
|
|
27
|
-
}] });
|
|
28
|
-
|
|
29
|
-
class NgxLinkifyjsService {
|
|
30
|
-
constructor() {
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Convert the passed text as a string to an appropriate url
|
|
34
|
-
*
|
|
35
|
-
* @param text - the string to convert
|
|
36
|
-
* @param options - options to pass it to the linkifyjs library
|
|
37
|
-
*/
|
|
38
|
-
linkify(text, options) {
|
|
39
|
-
return linkifyStr(text, options);
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Find any links in a given text as a string
|
|
43
|
-
*
|
|
44
|
-
* @param text - the string to find some links
|
|
45
|
-
*/
|
|
46
|
-
find(text) {
|
|
47
|
-
return linkify.find(text);
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Test if a given value is a link or an array of all links
|
|
51
|
-
*
|
|
52
|
-
* @param value - the value to test
|
|
53
|
-
*/
|
|
54
|
-
test(value) {
|
|
55
|
-
if (typeof value === 'string') {
|
|
56
|
-
return linkify.test(value);
|
|
57
|
-
}
|
|
58
|
-
return value.find(v => !linkify.test(v)) === undefined;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
NgxLinkifyjsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
62
|
-
NgxLinkifyjsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsService });
|
|
63
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsService, decorators: [{
|
|
64
|
-
type: Injectable
|
|
65
|
-
}], ctorParameters: function () { return []; } });
|
|
66
|
-
|
|
67
|
-
const NgxLinkifyjsConfigToken = new InjectionToken('NgxLinkifyjsConfig');
|
|
68
|
-
const DEFAULT_CONFIG = { enableHash: true, enableMention: true };
|
|
69
|
-
class NgxLinkifyjsModule {
|
|
70
|
-
constructor(config) {
|
|
71
|
-
this.config = config;
|
|
72
|
-
// TODO REMOVE ME
|
|
73
|
-
// if (config.enableHash) {
|
|
74
|
-
// hashtag(linkify);
|
|
75
|
-
// }
|
|
76
|
-
//
|
|
77
|
-
// if (config.enableMention) {
|
|
78
|
-
// mention(linkify);
|
|
79
|
-
// }
|
|
80
|
-
}
|
|
81
|
-
static forRoot(config = DEFAULT_CONFIG) {
|
|
82
|
-
return {
|
|
83
|
-
ngModule: NgxLinkifyjsModule,
|
|
84
|
-
providers: [
|
|
85
|
-
NgxLinkifyjsService,
|
|
86
|
-
{
|
|
87
|
-
provide: NgxLinkifyjsConfigToken,
|
|
88
|
-
useValue: config
|
|
89
|
-
},
|
|
90
|
-
]
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
NgxLinkifyjsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsModule, deps: [{ token: NgxLinkifyjsConfigToken }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
95
|
-
NgxLinkifyjsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsModule, declarations: [NgxLinkifyjsPipe], imports: [CommonModule], exports: [NgxLinkifyjsPipe] });
|
|
96
|
-
NgxLinkifyjsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsModule, imports: [CommonModule] });
|
|
97
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsModule, decorators: [{
|
|
98
|
-
type: NgModule,
|
|
99
|
-
args: [{
|
|
100
|
-
imports: [
|
|
101
|
-
CommonModule
|
|
102
|
-
],
|
|
103
|
-
exports: [NgxLinkifyjsPipe],
|
|
104
|
-
declarations: [NgxLinkifyjsPipe]
|
|
105
|
-
}]
|
|
106
|
-
}], ctorParameters: function () {
|
|
107
|
-
return [{ type: undefined, decorators: [{
|
|
108
|
-
type: Inject,
|
|
109
|
-
args: [NgxLinkifyjsConfigToken]
|
|
110
|
-
}] }];
|
|
111
|
-
} });
|
|
112
|
-
|
|
113
|
-
/*
|
|
114
|
-
* Public API Surface of ngx-linkifyjs
|
|
115
|
-
*/
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Generated bundle index. Do not edit.
|
|
119
|
-
*/
|
|
120
|
-
|
|
121
|
-
export { DEFAULT_CONFIG, LinkType, NgxLinkifyjsConfigToken, NgxLinkifyjsModule, NgxLinkifyjsPipe, NgxLinkifyjsService };
|
|
122
|
-
//# sourceMappingURL=code-name-jack-ngx-linkifyjs.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"code-name-jack-ngx-linkifyjs.mjs","sources":["../../../projects/ngx-linkifyjs-v2/src/lib/enum/linktype.enum.ts","../../../projects/ngx-linkifyjs-v2/src/lib/pipes/ngx-linkifyjs.pipe.ts","../../../projects/ngx-linkifyjs-v2/src/lib/service/ngx-linkifyjs.service.ts","../../../projects/ngx-linkifyjs-v2/src/lib/ngx-linkifyjs.module.ts","../../../projects/ngx-linkifyjs-v2/src/public-api.ts","../../../projects/ngx-linkifyjs-v2/src/code-name-jack-ngx-linkifyjs.ts"],"sourcesContent":["export enum LinkType {\n URL = 'url',\n HASHTAG = 'hashtag',\n MENTION = 'mention',\n EMAIL = 'email',\n}\n","import {Pipe, PipeTransform} from '@angular/core';\nimport {NgxLinkifyOptions} from '../interfaces/ngx-linkifyjs.interface';\nimport linkifyStr from 'linkify-string';\n\n@Pipe({\n name: 'linkify'\n})\nexport class NgxLinkifyjsPipe implements PipeTransform {\n\n transform(value: string, options?: NgxLinkifyOptions): string {\n return value ? linkifyStr(value, options) : value;\n }\n\n}\n","import {Injectable} from '@angular/core';\nimport * as linkify from 'linkifyjs';\nimport linkifyStr from 'linkify-string';\nimport {Link, NgxLinkifyOptions} from '../interfaces/ngx-linkifyjs.interface';\n\n@Injectable()\nexport class NgxLinkifyjsService {\n constructor() {\n }\n\n /**\n * Convert the passed text as a string to an appropriate url\n *\n * @param text - the string to convert\n * @param options - options to pass it to the linkifyjs library\n */\n linkify(text: string, options?: NgxLinkifyOptions): string {\n return linkifyStr(text, options);\n }\n\n /**\n * Find any links in a given text as a string\n *\n * @param text - the string to find some links\n */\n find(text: string): Array<Link> {\n return linkify.find(text);\n }\n\n /**\n * Test if a given value is a link or an array of all links\n *\n * @param value - the value to test\n */\n test(value: string | string[]): boolean {\n if (typeof value === 'string') {\n return linkify.test(value);\n }\n return value.find(v => !linkify.test(v)) === undefined;\n }\n\n}\n","import {CommonModule} from '@angular/common';\nimport {Inject, InjectionToken, ModuleWithProviders, NgModule} from '@angular/core';\n// TODO REMOVE ME\n// import * as linkify from 'linkifyjs';\n// import hashtag from 'linkify-plugin-hashtag';\n// import mention from 'linkify-plugin-mention';\n\nimport {NgxLinkifyjsService} from './service/ngx-linkifyjs.service';\nimport {NgxLinkifyjsPipe} from './pipes/ngx-linkifyjs.pipe';\n\n// Export module's public API\nexport {Link} from './interfaces/ngx-linkifyjs.interface';\nimport {NgxLinkifyjsConfig} from './interfaces/ngx-linkifyjs.interface';\n\nexport {LinkType} from './enum/linktype.enum';\nexport {NgxLinkifyOptions} from './interfaces/ngx-linkifyjs.interface';\nexport {NgxLinkifyjsPipe} from './pipes/ngx-linkifyjs.pipe';\nexport {NgxLinkifyjsService} from './service/ngx-linkifyjs.service';\n\nexport const NgxLinkifyjsConfigToken = new InjectionToken<NgxLinkifyjsConfig>('NgxLinkifyjsConfig');\nexport const DEFAULT_CONFIG: NgxLinkifyjsConfig = {enableHash: true, enableMention: true};\n\n@NgModule({\n imports: [\n CommonModule\n ],\n exports: [NgxLinkifyjsPipe],\n declarations: [NgxLinkifyjsPipe]\n})\nexport class NgxLinkifyjsModule {\n\n static forRoot(config: NgxLinkifyjsConfig = DEFAULT_CONFIG): ModuleWithProviders<NgxLinkifyjsModule> {\n return {\n ngModule: NgxLinkifyjsModule,\n providers:\n [\n NgxLinkifyjsService,\n {\n provide: NgxLinkifyjsConfigToken,\n useValue: config\n },\n ]\n };\n }\n\n constructor(@Inject(NgxLinkifyjsConfigToken)\n public config: NgxLinkifyjsConfig) {\n // TODO REMOVE ME\n // if (config.enableHash) {\n // hashtag(linkify);\n // }\n //\n // if (config.enableMention) {\n // mention(linkify);\n // }\n }\n\n}\n","/*\n * Public API Surface of ngx-linkifyjs\n */\n\nexport * from './lib/enum/linktype.enum';\nexport * from './lib/interfaces/ngx-linkifyjs.interface';\nexport * from './lib/pipes/ngx-linkifyjs.pipe';\nexport * from './lib/service/ngx-linkifyjs.service';\nexport * from './lib/ngx-linkifyjs.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAAY,IAAA,SAKX;AALD,CAAA,UAAY,QAAQ,EAAA;AAClB,IAAA,QAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;AACX,IAAA,QAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,QAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,QAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACjB,CAAC,EALW,QAAQ,KAAR,QAAQ,GAKnB,EAAA,CAAA,CAAA;;MCEY,gBAAgB,CAAA;IAE3B,SAAS,CAAC,KAAa,EAAE,OAA2B,EAAA;AAClD,QAAA,OAAO,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC;KACnD;;8GAJU,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAAhB,gBAAgB,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,CAAA;4FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAH5B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,SAAS;iBAChB,CAAA;;;MCAY,mBAAmB,CAAA;AAC9B,IAAA,WA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AG,QAAQ;IACX,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;CAChB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-linkifyjs.interface.d.ts","sourceRoot":"","sources":["../../../../projects/ngx-linkifyjs-v2/src/lib/interfaces/ngx-linkifyjs.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,UAAU,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,MAAM,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,GAAG,CAAC;IAEpC,UAAU,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,GAAG,CAAC;CACxC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-linkifyjs.module.d.ts","sourceRoot":"","sources":["../../../projects/ngx-linkifyjs-v2/src/lib/ngx-linkifyjs.module.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,cAAc,EAAE,mBAAmB,EAAW,MAAM,eAAe,CAAC;AAWpF,OAAO,EAAC,kBAAkB,EAAC,MAAM,sCAAsC,CAAC;;;;AADxE,OAAO,EAAC,IAAI,EAAC,MAAM,sCAAsC,CAAC;AAG1D,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAC,iBAAiB,EAAC,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAC,gBAAgB,EAAC,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAC,mBAAmB,EAAC,MAAM,iCAAiC,CAAC;AAEpE,eAAO,MAAM,uBAAuB,oCAA+D,CAAC;AACpG,eAAO,MAAM,cAAc,EAAE,kBAA4D,CAAC;AAE1F,qBAOa,kBAAkB;IAiBV,MAAM,EAAE,kBAAkB;IAf7C,MAAM,CAAC,OAAO,CAAC,MAAM,GAAE,kBAAmC,GAAG,mBAAmB,CAAC,kBAAkB,CAAC;gBAejF,MAAM,EAAE,kBAAkB;yCAjBlC,kBAAkB;0CAAlB,kBAAkB;0CAAlB,kBAAkB;CA4B9B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-linkifyjs.pipe.d.ts","sourceRoot":"","sources":["../../../../projects/ngx-linkifyjs-v2/src/lib/pipes/ngx-linkifyjs.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,aAAa,EAAC,MAAM,eAAe,CAAC;AAClD,OAAO,EAAC,iBAAiB,EAAC,MAAM,uCAAuC,CAAC;;AAGxE,qBAGa,gBAAiB,YAAW,aAAa;IAEpD,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,MAAM;yCAFlD,gBAAgB;uCAAhB,gBAAgB;CAM5B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-linkifyjs.service.d.ts","sourceRoot":"","sources":["../../../../projects/ngx-linkifyjs-v2/src/lib/service/ngx-linkifyjs.service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,IAAI,EAAE,iBAAiB,EAAC,MAAM,uCAAuC,CAAC;;AAE9E,qBACa,mBAAmB;;IAI9B;;;;;OAKG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,MAAM;IAI1D;;;;OAIG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC;IAI/B;;;;OAIG;IACH,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO;yCA5B5B,mBAAmB;6CAAnB,mBAAmB;CAmC/B"}
|
package/public-api.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../../projects/ngx-linkifyjs-v2/src/public-api.ts"],"names":[],"mappings":"AAIA,cAAc,0BAA0B,CAAC;AACzC,cAAc,0CAA0C,CAAC;AACzD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAAc,4BAA4B,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|