@code-name-jack/ngx-linkifyjs 17.0.1 → 20.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 CHANGED
@@ -1,410 +1,24 @@
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
1
+ # NgxLinkifyjs
2
2
 
3
- [![npm version](https://badge.fury.io/js/ngx-linkifyjs.svg)](https://badge.fury.io/js/ngx-linkifyjs),
4
- [![npm](https://img.shields.io/badge/demo-online-ed1c46.svg)](https://anthonynahas.github.io/ngx-linkifyjs)
5
- [![Join the chat at (https://gitter.im/angular-material-extensions/Lobby](https://badges.gitter.im/ngx-auth-firebaseui/Lobby.svg)](https://gitter.im/angular-material-extensions/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
6
- [![CircleCI branch](https://img.shields.io/circleci/project/github/AnthonyNahas/ngx-linkifyjs/master.svg?label=circleci)](https://circleci.com/gh/AnthonyNahas/ngx-linkifyjs)
7
- [![Build Status](https://travis-ci.org/AnthonyNahas/ngx-linkifyjs.svg?branch=master)](https://travis-ci.org/AnthonyNahas/ngx-linkifyjs)
8
- [![Coverage Status](https://coveralls.io/repos/github/AnthonyNahas/ngx-linkifyjs/badge.svg?branch=master)](https://coveralls.io/github/AnthonyNahas/ngx-linkifyjs?branch=master)
9
- [![dependency Status](https://david-dm.org/anthonynahas/ngx-linkifyjs/status.svg)](https://david-dm.org/anthonynahas/ngx-linkifyjs)
10
- [![devDependency Status](https://david-dm.org/anthonynahas/ngx-linkifyjs/dev-status.svg?branch=master)](https://david-dm.org/anthonynahas/ngx-linkifyjs#info=devDependencies)
11
- [![Greenkeeper Badge](https://badges.greenkeeper.io/anthonynahas/ngx-linkifyjs.svg)](https://greenkeeper.io/)
12
- [![license](https://img.shields.io/github/license/anthonynahas/ngx-linkifyjs.svg?style=flat-square)](https://github.com/AnthonyNahas/ngx-linkifyjs/blob/master/LICENSE)
13
- [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/gdi2290/awesome-angular)
3
+ This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 14.
14
4
 
5
+ ## Code scaffolding
15
6
 
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>
7
+ Run `ng generate component component-name --project ngx-linkifyjs-v2` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ngx-linkifyjs-v2`.
8
+ > Note: Don't forget to add `--project ngx-linkifyjs-v2` or else it will be added to the default project in your `angular.json` file.
20
9
 
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)
10
+ ## Build
24
11
 
25
- If you like this project, support [ngx-linkifyjs](https://github.com/anthonynahas/ngx-linkifyjs)
26
- by starring :star: and sharing it :loudspeaker:
12
+ Run `ng build ngx-linkifyjs-v2` to build the project. The build artifacts will be stored in the `dist/` directory.
27
13
 
14
+ ## Publishing
28
15
 
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 --access=public`.
29
17
 
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)
18
+ ## Running unit tests
41
19
 
42
- <a name="demo"/>
20
+ Run `ng test ngx-linkifyjs-v2` to execute the unit tests via [Karma](https://karma-runner.github.io).
43
21
 
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
- ![jetbrains logo](assets/jetbrains-variant-4_logos/jetbrains-variant-4.png)
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)
22
+ ## Further help
410
23
 
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).
@@ -1,8 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Pipe, Injectable, InjectionToken, NgModule, Inject } from '@angular/core';
2
+ import { Pipe, Injectable, InjectionToken, NgModule } from '@angular/core';
3
3
  import linkifyStr from 'linkify-string';
4
4
  import * as linkify from 'linkifyjs';
5
- import { CommonModule } from '@angular/common';
6
5
 
7
6
  var LinkType;
8
7
  (function (LinkType) {
@@ -16,13 +15,14 @@ class NgxLinkifyjsPipe {
16
15
  transform(value, options) {
17
16
  return value ? linkifyStr(value, options) : value;
18
17
  }
18
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgxLinkifyjsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
19
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.9", ngImport: i0, type: NgxLinkifyjsPipe, isStandalone: true, name: "linkify" }); }
19
20
  }
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: [{
21
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgxLinkifyjsPipe, decorators: [{
23
22
  type: Pipe,
24
23
  args: [{
25
- name: 'linkify'
24
+ name: 'linkify',
25
+ standalone: true
26
26
  }]
27
27
  }] });
28
28
 
@@ -57,28 +57,31 @@ class NgxLinkifyjsService {
57
57
  }
58
58
  return value.find(v => !linkify.test(v)) === undefined;
59
59
  }
60
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgxLinkifyjsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
61
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgxLinkifyjsService }); }
60
62
  }
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: [{
63
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgxLinkifyjsService, decorators: [{
64
64
  type: Injectable
65
- }], ctorParameters: function () { return []; } });
65
+ }], ctorParameters: () => [] });
66
66
 
67
67
  const NgxLinkifyjsConfigToken = new InjectionToken('NgxLinkifyjsConfig');
68
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
- // }
69
+ // Conditionally import plugins based on configuration
70
+ let pluginsLoaded = false;
71
+ function loadPlugins(config) {
72
+ if (pluginsLoaded)
73
+ return;
74
+ if (config?.enableHash) {
75
+ import('linkify-plugin-hashtag').catch(err => console.error('Failed to load hashtag plugin:', err));
76
+ }
77
+ if (config?.enableMention) {
78
+ import('linkify-plugin-mention').catch(err => console.error('Failed to load mention plugin:', err));
80
79
  }
80
+ pluginsLoaded = true;
81
+ }
82
+ class NgxLinkifyjsModule {
81
83
  static forRoot(config = DEFAULT_CONFIG) {
84
+ loadPlugins(config);
82
85
  return {
83
86
  ngModule: NgxLinkifyjsModule,
84
87
  providers: [
@@ -86,27 +89,21 @@ class NgxLinkifyjsModule {
86
89
  {
87
90
  provide: NgxLinkifyjsConfigToken,
88
91
  useValue: config
89
- },
92
+ }
90
93
  ]
91
94
  };
92
95
  }
96
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgxLinkifyjsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
97
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.9", ngImport: i0, type: NgxLinkifyjsModule, imports: [NgxLinkifyjsPipe], exports: [NgxLinkifyjsPipe] }); }
98
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgxLinkifyjsModule }); }
93
99
  }
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: [{
100
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgxLinkifyjsModule, decorators: [{
98
101
  type: NgModule,
99
102
  args: [{
100
- imports: [
101
- CommonModule
102
- ],
103
- exports: [NgxLinkifyjsPipe],
104
- declarations: [NgxLinkifyjsPipe]
103
+ imports: [NgxLinkifyjsPipe],
104
+ exports: [NgxLinkifyjsPipe]
105
105
  }]
106
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
107
- type: Inject,
108
- args: [NgxLinkifyjsConfigToken]
109
- }] }]; } });
106
+ }] });
110
107
 
111
108
  /*
112
109
  * Public API Surface of ngx-linkifyjs
@@ -0,0 +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 standalone: true\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 {InjectionToken, ModuleWithProviders, NgModule} from '@angular/core';\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// Conditionally import plugins based on configuration\nlet pluginsLoaded = false;\n\nfunction loadPlugins(config: NgxLinkifyjsConfig) {\n if (pluginsLoaded) return;\n \n if (config?.enableHash) {\n import('linkify-plugin-hashtag').catch(err => console.error('Failed to load hashtag plugin:', err));\n }\n\n if (config?.enableMention) {\n import('linkify-plugin-mention').catch(err => console.error('Failed to load mention plugin:', err));\n }\n \n pluginsLoaded = true;\n}\n\n@NgModule({\n imports: [NgxLinkifyjsPipe],\n exports: [NgxLinkifyjsPipe]\n})\nexport class NgxLinkifyjsModule {\n\n static forRoot(config: NgxLinkifyjsConfig = DEFAULT_CONFIG): ModuleWithProviders<NgxLinkifyjsModule> {\n loadPlugins(config);\n \n return {\n ngModule: NgxLinkifyjsModule,\n providers: [\n NgxLinkifyjsService,\n {\n provide: NgxLinkifyjsConfigToken,\n useValue: config\n }\n ]\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;AAAZ,CAAA,UAAY,QAAQ,EAAA;AAClB,IAAA,QAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACX,IAAA,QAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,QAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,QAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACjB,CAAC,EALW,QAAQ,KAAR,QAAQ,GAAA,EAAA,CAAA,CAAA;;MCQP,gBAAgB,CAAA;IAE3B,SAAS,CAAC,KAAa,EAAE,OAA2B,EAAA;AAClD,QAAA,OAAO,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,KAAK;IACnD;8GAJW,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4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'./public-api';
6
- //# sourceMappingURL=code-name-jack-ngx-linkifyjs.d.ts.map
1
+ import * as i0 from '@angular/core';
2
+ import { PipeTransform, InjectionToken, ModuleWithProviders } from '@angular/core';
3
+
4
+ declare enum LinkType {
5
+ URL = "url",
6
+ HASHTAG = "hashtag",
7
+ MENTION = "mention",
8
+ EMAIL = "email"
9
+ }
10
+
11
+ interface Link {
12
+ type: string;
13
+ value: string;
14
+ href: string;
15
+ }
16
+ interface NgxLinkifyjsConfig {
17
+ enableHash?: boolean;
18
+ enableMention?: boolean;
19
+ }
20
+ interface NgxLinkifyOptions {
21
+ attributes?: any;
22
+ className?: string;
23
+ defaultProtocol?: string;
24
+ events?: any;
25
+ ignoreTags?: Array<any>;
26
+ nl2br?: boolean;
27
+ tagName?: string;
28
+ target?: {
29
+ url: string;
30
+ };
31
+ validate?: boolean;
32
+ format?(value: any, type: any): any;
33
+ formatHref?(href: any, type: any): any;
34
+ }
35
+
36
+ declare class NgxLinkifyjsPipe implements PipeTransform {
37
+ transform(value: string, options?: NgxLinkifyOptions): string;
38
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxLinkifyjsPipe, never>;
39
+ static ɵpipe: i0.ɵɵPipeDeclaration<NgxLinkifyjsPipe, "linkify", true>;
40
+ }
41
+
42
+ declare class NgxLinkifyjsService {
43
+ constructor();
44
+ /**
45
+ * Convert the passed text as a string to an appropriate url
46
+ *
47
+ * @param text - the string to convert
48
+ * @param options - options to pass it to the linkifyjs library
49
+ */
50
+ linkify(text: string, options?: NgxLinkifyOptions): string;
51
+ /**
52
+ * Find any links in a given text as a string
53
+ *
54
+ * @param text - the string to find some links
55
+ */
56
+ find(text: string): Array<Link>;
57
+ /**
58
+ * Test if a given value is a link or an array of all links
59
+ *
60
+ * @param value - the value to test
61
+ */
62
+ test(value: string | string[]): boolean;
63
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxLinkifyjsService, never>;
64
+ static ɵprov: i0.ɵɵInjectableDeclaration<NgxLinkifyjsService>;
65
+ }
66
+
67
+ declare const NgxLinkifyjsConfigToken: InjectionToken<NgxLinkifyjsConfig>;
68
+ declare const DEFAULT_CONFIG: NgxLinkifyjsConfig;
69
+ declare class NgxLinkifyjsModule {
70
+ static forRoot(config?: NgxLinkifyjsConfig): ModuleWithProviders<NgxLinkifyjsModule>;
71
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxLinkifyjsModule, never>;
72
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NgxLinkifyjsModule, never, [typeof NgxLinkifyjsPipe], [typeof NgxLinkifyjsPipe]>;
73
+ static ɵinj: i0.ɵɵInjectorDeclaration<NgxLinkifyjsModule>;
74
+ }
75
+
76
+ export { DEFAULT_CONFIG, LinkType, NgxLinkifyjsConfigToken, NgxLinkifyjsModule, NgxLinkifyjsPipe, NgxLinkifyjsService };
77
+ export type { Link, NgxLinkifyOptions, NgxLinkifyjsConfig };
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 &lt;a&gt; tags via linkifyjs",
4
- "version": "17.0.1",
4
+ "version": "20.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": ">=16.0.0"
34
+ "node": ">=18.0.0"
35
35
  },
36
36
  "peerDependencies": {
37
- "@angular/common": "~17.x",
38
- "@angular/core": "~17.x",
39
- "@schematics/angular": "~17.x",
37
+ "@angular/common": "^20.0.0",
38
+ "@angular/core": "^20.0.0",
39
+ "@schematics/angular": "^20.0.0",
40
40
  "linkify-plugin-hashtag": "^4.0.2",
41
41
  "linkify-plugin-mention": "^4.0.2",
42
42
  "linkify-string": "^4.0.2",
@@ -69,62 +69,7 @@
69
69
  "before:npm": "echo building the library..."
70
70
  }
71
71
  },
72
- "globals": {
73
- "ts-jest": {
74
- "tsConfig": "<rootDir>/tsconfig.spec.json",
75
- "stringifyContentPathRegex": "\\.html$",
76
- "astTransformers": [
77
- "jest-preset-angular/build/InlineFilesTransformer",
78
- "jest-preset-angular/build/StripStylesTransformer"
79
- ]
80
- }
81
- },
82
- "greenkeeper": {
83
- "ignore": [
84
- "@angular/core",
85
- "@angular/common",
86
- "@angular/compiler",
87
- "@angular/platform-server",
88
- "@angular/platform-browser",
89
- "@angular/platform-browser-dynamic",
90
- "@angular/compiler-cli",
91
- "zone.js",
92
- "rxjs",
93
- "tslint",
94
- "gulp-tslint",
95
- "typescript",
96
- "awesome-typescript-loader",
97
- "codelyzer",
98
- "@angular/animations",
99
- "linkifyjs",
100
- "@types/jasmine",
101
- "@types/jest",
102
- "@types/node",
103
- "conventional-github-releaser",
104
- "rollup-plugin-uglify"
105
- ]
106
- },
107
- "commitplease": {
108
- "style": "angular",
109
- "types": [
110
- "feat",
111
- "fix",
112
- "docs",
113
- "style",
114
- "refactor",
115
- "perf",
116
- "test",
117
- "chore",
118
- "revert",
119
- "demo"
120
- ],
121
- "scope": "\\S+.*"
122
- },
123
- "module": "fesm2015/code-name-jack-ngx-linkifyjs.mjs",
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",
72
+ "module": "fesm2022/code-name-jack-ngx-linkifyjs.mjs",
128
73
  "typings": "index.d.ts",
129
74
  "exports": {
130
75
  "./package.json": {
@@ -132,15 +77,11 @@
132
77
  },
133
78
  ".": {
134
79
  "types": "./index.d.ts",
135
- "esm2020": "./esm2020/code-name-jack-ngx-linkifyjs.mjs",
136
- "es2020": "./fesm2020/code-name-jack-ngx-linkifyjs.mjs",
137
- "es2015": "./fesm2015/code-name-jack-ngx-linkifyjs.mjs",
138
- "node": "./fesm2015/code-name-jack-ngx-linkifyjs.mjs",
139
- "default": "./fesm2020/code-name-jack-ngx-linkifyjs.mjs"
80
+ "default": "./fesm2022/code-name-jack-ngx-linkifyjs.mjs"
140
81
  }
141
82
  },
142
83
  "sideEffects": false,
143
84
  "dependencies": {
144
85
  "tslib": "^2.4.1"
145
86
  }
146
- }
87
+ }
@@ -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,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './public-api';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29kZS1uYW1lLWphY2stbmd4LWxpbmtpZnlqcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL25neC1saW5raWZ5anMtdjIvc3JjL2NvZGUtbmFtZS1qYWNrLW5neC1saW5raWZ5anMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==
@@ -1,8 +0,0 @@
1
- export var LinkType;
2
- (function (LinkType) {
3
- LinkType["URL"] = "url";
4
- LinkType["HASHTAG"] = "hashtag";
5
- LinkType["MENTION"] = "mention";
6
- LinkType["EMAIL"] = "email";
7
- })(LinkType || (LinkType = {}));
8
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGlua3R5cGUuZW51bS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25neC1saW5raWZ5anMtdjIvc3JjL2xpYi9lbnVtL2xpbmt0eXBlLmVudW0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxDQUFOLElBQVksUUFLWDtBQUxELFdBQVksUUFBUTtJQUNsQix1QkFBVyxDQUFBO0lBQ1gsK0JBQW1CLENBQUE7SUFDbkIsK0JBQW1CLENBQUE7SUFDbkIsMkJBQWUsQ0FBQTtBQUNqQixDQUFDLEVBTFcsUUFBUSxLQUFSLFFBQVEsUUFLbkIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZW51bSBMaW5rVHlwZSB7XG4gIFVSTCA9ICd1cmwnLFxuICBIQVNIVEFHID0gJ2hhc2h0YWcnLFxuICBNRU5USU9OID0gJ21lbnRpb24nLFxuICBFTUFJTCA9ICdlbWFpbCcsXG59XG4iXX0=
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWxpbmtpZnlqcy5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtbGlua2lmeWpzLXYyL3NyYy9saWIvaW50ZXJmYWNlcy9uZ3gtbGlua2lmeWpzLmludGVyZmFjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGludGVyZmFjZSBMaW5rIHtcbiAgdHlwZTogc3RyaW5nO1xuICB2YWx1ZTogc3RyaW5nO1xuICBocmVmOiBzdHJpbmc7XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgTmd4TGlua2lmeWpzQ29uZmlnIHtcbiAgZW5hYmxlSGFzaD86IGJvb2xlYW47XG4gIGVuYWJsZU1lbnRpb24/OiBib29sZWFuO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIE5neExpbmtpZnlPcHRpb25zIHtcbiAgYXR0cmlidXRlcz86IGFueTtcbiAgY2xhc3NOYW1lPzogc3RyaW5nO1xuICBkZWZhdWx0UHJvdG9jb2w/OiBzdHJpbmc7XG4gIGV2ZW50cz86IGFueTtcbiAgaWdub3JlVGFncz86IEFycmF5PGFueT47XG4gIG5sMmJyPzogYm9vbGVhbjtcbiAgdGFnTmFtZT86IHN0cmluZztcbiAgdGFyZ2V0PzogeyB1cmw6IHN0cmluZyB9O1xuICB2YWxpZGF0ZT86IGJvb2xlYW47XG5cbiAgZm9ybWF0Pyh2YWx1ZTogYW55LCB0eXBlOiBhbnkpOiBhbnk7XG5cbiAgZm9ybWF0SHJlZj8oaHJlZjogYW55LCB0eXBlOiBhbnkpOiBhbnk7XG59XG4iXX0=
@@ -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: [NgxLinkifyjsConfigToken]
55
- }] }]; } });
56
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWxpbmtpZnlqcy5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtbGlua2lmeWpzLXYyL3NyYy9saWIvbmd4LWxpbmtpZnlqcy5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYX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WxlIHtcblxuICBzdGF0aWMgZm9yUm9vdChjb25maWc6IE5neExpbmtpZnlqc0NvbmZpZyA9IERFRkFVTFRfQ09ORklHKTogTW9kdWxlV2l0aFByb3ZpZGVyczxOZ3hMaW5raWZ5anNNb2R1bGU+IHtcbiAgICByZXR1cm4ge1xuICAgICAgbmdNb2R1bGU6IE5neExpbmtpZnlqc01vZHVsZSxcbiAgICAgIHByb3ZpZGVyczpcbiAgICAgICAgW1xuICAgICAgICAgIE5neExpbmtpZnlqc1NlcnZpY2UsXG4gICAgICAgICAge1xuICAgICAgICAgICAgcHJvdmlkZTogTmd4TGlua2lmeWpzQ29uZmlnVG9rZW4sXG4gICAgICAgICAgICB1c2VWYWx1ZTogY29uZmlnXG4gICAgICAgICAgfSxcbiAgICAgICAgXVxuICAgIH07XG4gIH1cblxuICBjb25zdHJ1Y3RvcihASW5qZWN0KE5neExpbmtpZnlqc0NvbmZpZ1Rva2VuKVxuICAgICAgICAgICAgICBwdWJsaWMgY29uZmlnOiBOZ3hMaW5raWZ5anNDb25maWcpIHtcbiAgICAvLyBUT0RPIFJFTU9WRSBNRVxuICAgIC8vIGlmIChjb25maWcuZW5hYmxlSGFzaCkge1xuICAgIC8vICAgaGFzaHRhZyhsaW5raWZ5KTtcbiAgICAvLyB9XG4gICAgLy9cbiAgICAvLyBpZiAoY29uZmlnLmVuYWJsZU1lbnRpb24pIHtcbiAgICAvLyAgIG1lbnRpb24obGlua2lmeSk7XG4gICAgLy8gfVxuICB9XG5cbn1cbiJdfQ==
@@ -1,17 +0,0 @@
1
- import { Pipe } from '@angular/core';
2
- import linkifyStr from 'linkify-string';
3
- import * as i0 from "@angular/core";
4
- export class NgxLinkifyjsPipe {
5
- transform(value, options) {
6
- return value ? linkifyStr(value, options) : value;
7
- }
8
- }
9
- NgxLinkifyjsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
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: [{
12
- type: Pipe,
13
- args: [{
14
- name: 'linkify'
15
- }]
16
- }] });
17
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWxpbmtpZnlqcy5waXBlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LWxpbmtpZnlqcy12Mi9zcmMvbGliL3BpcGVzL25neC1saW5raWZ5anMucGlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsSUFBSSxFQUFnQixNQUFNLGVBQWUsQ0FBQztBQUVsRCxPQUFPLFVBQVUsTUFBTSxnQkFBZ0IsQ0FBQzs7QUFLeEMsTUFBTSxPQUFPLGdCQUFnQjtJQUUzQixTQUFTLENBQUMsS0FBYSxFQUFFLE9BQTJCO1FBQ2xELE9BQU8sS0FBSyxDQUFDLENBQUMsQ0FBQyxVQUFVLENBQUMsS0FBSyxFQUFFLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUM7SUFDcEQsQ0FBQzs7OEdBSlUsZ0JBQWdCOzRHQUFoQixnQkFBZ0I7NEZBQWhCLGdCQUFnQjtrQkFINUIsSUFBSTttQkFBQztvQkFDSixJQUFJLEVBQUUsU0FBUztpQkFDaEIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge1BpcGUsIFBpcGVUcmFuc2Zvcm19IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHtOZ3hMaW5raWZ5T3B0aW9uc30gZnJvbSAnLi4vaW50ZXJmYWNlcy9uZ3gtbGlua2lmeWpzLmludGVyZmFjZSc7XG5pbXBvcnQgbGlua2lmeVN0ciBmcm9tICdsaW5raWZ5LXN0cmluZyc7XG5cbkBQaXBlKHtcbiAgbmFtZTogJ2xpbmtpZnknXG59KVxuZXhwb3J0IGNsYXNzIE5neExpbmtpZnlqc1BpcGUgaW1wbGVtZW50cyBQaXBlVHJhbnNmb3JtIHtcblxuICB0cmFuc2Zvcm0odmFsdWU6IHN0cmluZywgb3B0aW9ucz86IE5neExpbmtpZnlPcHRpb25zKTogc3RyaW5nIHtcbiAgICByZXR1cm4gdmFsdWUgPyBsaW5raWZ5U3RyKHZhbHVlLCBvcHRpb25zKSA6IHZhbHVlO1xuICB9XG5cbn1cbiJdfQ==
@@ -1,42 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import * as linkify from 'linkifyjs';
3
- import linkifyStr from 'linkify-string';
4
- import * as i0 from "@angular/core";
5
- export class NgxLinkifyjsService {
6
- constructor() {
7
- }
8
- /**
9
- * Convert the passed text as a string to an appropriate url
10
- *
11
- * @param text - the string to convert
12
- * @param options - options to pass it to the linkifyjs library
13
- */
14
- linkify(text, options) {
15
- return linkifyStr(text, options);
16
- }
17
- /**
18
- * Find any links in a given text as a string
19
- *
20
- * @param text - the string to find some links
21
- */
22
- find(text) {
23
- return linkify.find(text);
24
- }
25
- /**
26
- * Test if a given value is a link or an array of all links
27
- *
28
- * @param value - the value to test
29
- */
30
- test(value) {
31
- if (typeof value === 'string') {
32
- return linkify.test(value);
33
- }
34
- return value.find(v => !linkify.test(v)) === undefined;
35
- }
36
- }
37
- NgxLinkifyjsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NgxLinkifyjsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
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: [{
40
- type: Injectable
41
- }], ctorParameters: function () { return []; } });
42
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWxpbmtpZnlqcy5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LWxpbmtpZnlqcy12Mi9zcmMvbGliL3NlcnZpY2Uvbmd4LWxpbmtpZnlqcy5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBQyxVQUFVLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDekMsT0FBTyxLQUFLLE9BQU8sTUFBTSxXQUFXLENBQUM7QUFDckMsT0FBTyxVQUFVLE1BQU0sZ0JBQWdCLENBQUM7O0FBSXhDLE1BQU0sT0FBTyxtQkFBbUI7SUFDOUI7SUFDQSxDQUFDO0lBRUQ7Ozs7O09BS0c7SUFDSCxPQUFPLENBQUMsSUFBWSxFQUFFLE9BQTJCO1FBQy9DLE9BQU8sVUFBVSxDQUFDLElBQUksRUFBRSxPQUFPLENBQUMsQ0FBQztJQUNuQyxDQUFDO0lBRUQ7Ozs7T0FJRztJQUNILElBQUksQ0FBQyxJQUFZO1FBQ2YsT0FBTyxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO0lBQzVCLENBQUM7SUFFRDs7OztPQUlHO0lBQ0gsSUFBSSxDQUFDLEtBQXdCO1FBQzNCLElBQUksT0FBTyxLQUFLLEtBQUssUUFBUSxFQUFFO1lBQzdCLE9BQU8sT0FBTyxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQztTQUM1QjtRQUNELE9BQU8sS0FBSyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsRUF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HQgLSB0aGUgc3RyaW5nIHRvIGZpbmQgc29tZSBsaW5rc1xuICAgKi9cbiAgZmluZCh0ZXh0OiBzdHJpbmcpOiBBcnJheTxMaW5rPiB7XG4gICAgcmV0dXJuIGxpbmtpZnkuZmluZCh0ZXh0KTtcbiAgfVxuXG4gIC8qKlxuICAgKiBUZXN0IGlmIGEgZ2l2ZW4gdmFsdWUgaXMgYSBsaW5rIG9yIGFuIGFycmF5IG9mIGFsbCBsaW5rc1xuICAgKlxuICAgKiBAcGFyYW0gdmFsdWUgLSB0aGUgdmFsdWUgdG8gdGVzdFxuICAgKi9cbiAgdGVzdCh2YWx1ZTogc3RyaW5nIHwgc3RyaW5nW10pOiBib29sZWFuIHtcbiAgICBpZiAodHlwZW9mIHZhbHVlID09PSAnc3RyaW5nJykge1xuICAgICAgcmV0dXJuIGxpbmtpZnkudGVzdCh2YWx1ZSk7XG4gICAgfVxuICAgIHJldHVybiB2YWx1ZS5maW5kKHYgPT4gIWxpbmtpZnkudGVzdCh2KSkgPT09IHVuZGVmaW5lZDtcbiAgfVxuXG59XG4iXX0=
@@ -1,9 +0,0 @@
1
- /*
2
- * Public API Surface of ngx-linkifyjs
3
- */
4
- export * from './lib/enum/linktype.enum';
5
- export * from './lib/interfaces/ngx-linkifyjs.interface';
6
- export * from './lib/pipes/ngx-linkifyjs.pipe';
7
- export * from './lib/service/ngx-linkifyjs.service';
8
- export * from './lib/ngx-linkifyjs.module';
9
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL25neC1saW5raWZ5anMtdjIvc3JjL3B1YmxpYy1hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLDBCQUEwQixDQUFDO0FBQ3pDLGNBQWMsMENBQTBDLENBQUM7QUFDekQsY0FBYyxnQ0FBZ0MsQ0FBQztBQUMvQyxjQUFjLHFDQUFxQyxDQUFDO0FBQ3BELGNBQWMsNEJBQTRCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKlxuICogUHVibGljIEFQSSBTdXJmYWNlIG9mIG5neC1saW5raWZ5anNcbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2xpYi9lbnVtL2xpbmt0eXBlLmVudW0nO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvaW50ZXJmYWNlcy9uZ3gtbGlua2lmeWpzLmludGVyZmFjZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9waXBlcy9uZ3gtbGlua2lmeWpzLnBpcGUnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvc2VydmljZS9uZ3gtbGlua2lmeWpzLnNlcnZpY2UnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvbmd4LWxpbmtpZnlqcy5tb2R1bGUnO1xuIl19
@@ -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,KAA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CAH7B,EAAA,OAAA,EAAA,CAAA,YAAY,aAEJ,gBAAgB,CAAA,EAAA,CAAA,CAAA;AAGf,kBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,YAL3B,YAAY,CAAA,EAAA,CAAA,CAAA;4FAKH,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;iBACjC,CAAA;;;8BAiBc,MAAM;+BAAC,uBAAuB,CAAA;;;;AC7C7C;;AAEG;;ACFH;;AAEG;;;;"}
@@ -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":";;;;;;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;;8GAJU,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAAhB,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uBAAuB,CAAA;;;AC7C7C;;AAEG;;ACFH;;AAEG;;;;"}
@@ -1,7 +0,0 @@
1
- export declare enum LinkType {
2
- URL = "url",
3
- HASHTAG = "hashtag",
4
- MENTION = "mention",
5
- EMAIL = "email"
6
- }
7
- //# sourceMappingURL=linktype.enum.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"linktype.enum.d.ts","sourceRoot":"","sources":["../../../../projects/ngx-linkifyjs-v2/src/lib/enum/linktype.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,GAAG,QAAQ;IACX,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;CAChB"}
@@ -1,25 +0,0 @@
1
- export interface Link {
2
- type: string;
3
- value: string;
4
- href: string;
5
- }
6
- export interface NgxLinkifyjsConfig {
7
- enableHash?: boolean;
8
- enableMention?: boolean;
9
- }
10
- export interface NgxLinkifyOptions {
11
- attributes?: any;
12
- className?: string;
13
- defaultProtocol?: string;
14
- events?: any;
15
- ignoreTags?: Array<any>;
16
- nl2br?: boolean;
17
- tagName?: string;
18
- target?: {
19
- url: string;
20
- };
21
- validate?: boolean;
22
- format?(value: any, type: any): any;
23
- formatHref?(href: any, type: any): any;
24
- }
25
- //# sourceMappingURL=ngx-linkifyjs.interface.d.ts.map
@@ -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,21 +0,0 @@
1
- import { InjectionToken, ModuleWithProviders } from '@angular/core';
2
- import { NgxLinkifyjsConfig } from './interfaces/ngx-linkifyjs.interface';
3
- import * as i0 from "@angular/core";
4
- import * as i1 from "./pipes/ngx-linkifyjs.pipe";
5
- import * as i2 from "@angular/common";
6
- export { Link } from './interfaces/ngx-linkifyjs.interface';
7
- export { LinkType } from './enum/linktype.enum';
8
- export { NgxLinkifyOptions } from './interfaces/ngx-linkifyjs.interface';
9
- export { NgxLinkifyjsPipe } from './pipes/ngx-linkifyjs.pipe';
10
- export { NgxLinkifyjsService } from './service/ngx-linkifyjs.service';
11
- export declare const NgxLinkifyjsConfigToken: InjectionToken<NgxLinkifyjsConfig>;
12
- export declare const DEFAULT_CONFIG: NgxLinkifyjsConfig;
13
- export declare class NgxLinkifyjsModule {
14
- config: NgxLinkifyjsConfig;
15
- static forRoot(config?: NgxLinkifyjsConfig): ModuleWithProviders<NgxLinkifyjsModule>;
16
- constructor(config: NgxLinkifyjsConfig);
17
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxLinkifyjsModule, never>;
18
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgxLinkifyjsModule, [typeof i1.NgxLinkifyjsPipe], [typeof i2.CommonModule], [typeof i1.NgxLinkifyjsPipe]>;
19
- static ɵinj: i0.ɵɵInjectorDeclaration<NgxLinkifyjsModule>;
20
- }
21
- //# sourceMappingURL=ngx-linkifyjs.module.d.ts.map
@@ -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,9 +0,0 @@
1
- import { PipeTransform } from '@angular/core';
2
- import { NgxLinkifyOptions } from '../interfaces/ngx-linkifyjs.interface';
3
- import * as i0 from "@angular/core";
4
- export declare class NgxLinkifyjsPipe implements PipeTransform {
5
- transform(value: string, options?: NgxLinkifyOptions): string;
6
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxLinkifyjsPipe, never>;
7
- static ɵpipe: i0.ɵɵPipeDeclaration<NgxLinkifyjsPipe, "linkify", false>;
8
- }
9
- //# sourceMappingURL=ngx-linkifyjs.pipe.d.ts.map
@@ -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,27 +0,0 @@
1
- import { Link, NgxLinkifyOptions } from '../interfaces/ngx-linkifyjs.interface';
2
- import * as i0 from "@angular/core";
3
- export declare class NgxLinkifyjsService {
4
- constructor();
5
- /**
6
- * Convert the passed text as a string to an appropriate url
7
- *
8
- * @param text - the string to convert
9
- * @param options - options to pass it to the linkifyjs library
10
- */
11
- linkify(text: string, options?: NgxLinkifyOptions): string;
12
- /**
13
- * Find any links in a given text as a string
14
- *
15
- * @param text - the string to find some links
16
- */
17
- find(text: string): Array<Link>;
18
- /**
19
- * Test if a given value is a link or an array of all links
20
- *
21
- * @param value - the value to test
22
- */
23
- test(value: string | string[]): boolean;
24
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxLinkifyjsService, never>;
25
- static ɵprov: i0.ɵɵInjectableDeclaration<NgxLinkifyjsService>;
26
- }
27
- //# sourceMappingURL=ngx-linkifyjs.service.d.ts.map
@@ -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 DELETED
@@ -1,6 +0,0 @@
1
- export * from './lib/enum/linktype.enum';
2
- export * from './lib/interfaces/ngx-linkifyjs.interface';
3
- export * from './lib/pipes/ngx-linkifyjs.pipe';
4
- export * from './lib/service/ngx-linkifyjs.service';
5
- export * from './lib/ngx-linkifyjs.module';
6
- //# sourceMappingURL=public-api.d.ts.map
@@ -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"}