nxt-highlightjs 22.0.0-alpha.0 → 22.1.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 +67 -64
- package/fesm2022/nxt-highlightjs-extras.mjs +142 -142
- package/fesm2022/nxt-highlightjs-extras.mjs.map +1 -1
- package/fesm2022/nxt-highlightjs-line-numbers.mjs +228 -248
- package/fesm2022/nxt-highlightjs-line-numbers.mjs.map +1 -1
- package/fesm2022/nxt-highlightjs.mjs +527 -559
- package/fesm2022/nxt-highlightjs.mjs.map +1 -1
- package/package.json +1 -1
- package/types/nxt-highlightjs-extras.d.ts +106 -113
- package/types/nxt-highlightjs-line-numbers.d.ts +25 -18
- package/types/nxt-highlightjs.d.ts +154 -128
package/README.md
CHANGED
|
@@ -1,64 +1,67 @@
|
|
|
1
|
-
# Angular Highlight.js directives
|
|
2
|
-
|
|
3
|
-
[](https://github.com/Liquid-JS/nxt-components/blob/master/LICENSE)
|
|
4
|
-
[](https://www.npmjs.com/package/nxt-highlightjs)
|
|
5
|
-
[](https://www.npmjs.com/package/nxt-highlightjs)
|
|
6
|
-
|
|
7
|
-
Angular code highlighting directives with optional line numbers and support for SSR.
|
|
8
|
-
|
|
9
|
-
## Quick links
|
|
10
|
-
|
|
11
|
-
- [Demo](https://liquid-js.github.io/nxt-components/demo/highlightjs)
|
|
12
|
-
- [Getting started](https://liquid-js.github.io/nxt-components/demo/highlightjs/getting-started)
|
|
13
|
-
- [Extras](https://liquid-js.github.io/nxt-components/demo/highlightjs/extras)
|
|
14
|
-
- [API docs](https://liquid-js.github.io/nxt-components/nxt-highlightjs)
|
|
15
|
-
|
|
16
|
-
### Installing
|
|
17
|
-
|
|
18
|
-
```sh
|
|
19
|
-
npm install --save nxt-highlightjs highlight.js
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### Load and configure Highlight.js
|
|
23
|
-
|
|
24
|
-
```ts
|
|
25
|
-
import { ApplicationConfig } from '@angular/core'
|
|
26
|
-
import { provideHighlightOptions } from 'nxt-highlightjs'
|
|
27
|
-
|
|
28
|
-
export const appConfig: ApplicationConfig = {
|
|
29
|
-
providers: [
|
|
30
|
-
provideHighlightOptions({
|
|
31
|
-
fullLibraryLoader: () => import('highlight.js')
|
|
32
|
-
})
|
|
33
|
-
]
|
|
34
|
-
}
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
Above code loads the entire Highlight.js library. To improve performance you might want to load only the core library and neccesary languages.
|
|
38
|
-
|
|
39
|
-
```ts
|
|
40
|
-
import { ApplicationConfig } from '@angular/core'
|
|
41
|
-
import { provideHighlightOptions } from 'nxt-highlightjs'
|
|
42
|
-
|
|
43
|
-
export const appConfig: ApplicationConfig = {
|
|
44
|
-
providers: [
|
|
45
|
-
provideHighlightOptions({
|
|
46
|
-
coreLibraryLoader: () => import('highlight.js/lib/core'),
|
|
47
|
-
lineNumbersLoader: () => import('nxt-highlightjs/line-numbers'), // Optional, add line numbers if needed
|
|
48
|
-
languages: {
|
|
49
|
-
typescript: () => import('highlight.js/lib/languages/typescript'),
|
|
50
|
-
css: () => import('highlight.js/lib/languages/css'),
|
|
51
|
-
xml: () => import('highlight.js/lib/languages/xml')
|
|
52
|
-
},
|
|
53
|
-
themePath: 'path-to-theme.css' // Optional, useful for dynamic theme changes
|
|
54
|
-
})
|
|
55
|
-
]
|
|
56
|
-
}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### Use it in a template
|
|
60
|
-
|
|
61
|
-
```html
|
|
62
|
-
<pre><code [nxtHighlight]="code"
|
|
63
|
-
language="html"></code></pre>
|
|
64
|
-
```
|
|
1
|
+
# Angular Highlight.js directives
|
|
2
|
+
|
|
3
|
+
[](https://github.com/Liquid-JS/nxt-components/blob/master/LICENSE)
|
|
4
|
+
[](https://www.npmjs.com/package/nxt-highlightjs)
|
|
5
|
+
[](https://www.npmjs.com/package/nxt-highlightjs)
|
|
6
|
+
|
|
7
|
+
Angular code highlighting directives with optional line numbers and support for SSR.
|
|
8
|
+
|
|
9
|
+
## Quick links
|
|
10
|
+
|
|
11
|
+
- [Demo](https://liquid-js.github.io/nxt-components/demo/highlightjs)
|
|
12
|
+
- [Getting started](https://liquid-js.github.io/nxt-components/demo/highlightjs/getting-started)
|
|
13
|
+
- [Extras](https://liquid-js.github.io/nxt-components/demo/highlightjs/extras)
|
|
14
|
+
- [API docs](https://liquid-js.github.io/nxt-components/nxt-highlightjs)
|
|
15
|
+
|
|
16
|
+
### Installing
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npm install --save nxt-highlightjs highlight.js
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Load and configure Highlight.js
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { ApplicationConfig } from '@angular/core'
|
|
26
|
+
import { provideHighlightOptions } from 'nxt-highlightjs'
|
|
27
|
+
|
|
28
|
+
export const appConfig: ApplicationConfig = {
|
|
29
|
+
providers: [
|
|
30
|
+
provideHighlightOptions({
|
|
31
|
+
fullLibraryLoader: () => import('highlight.js').then(r => r.default)
|
|
32
|
+
})
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Above code loads the entire Highlight.js library. To improve performance you might want to load only the core library and neccesary languages.
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
import { ApplicationConfig } from '@angular/core'
|
|
41
|
+
import { provideHighlightOptions } from 'nxt-highlightjs'
|
|
42
|
+
|
|
43
|
+
export const appConfig: ApplicationConfig = {
|
|
44
|
+
providers: [
|
|
45
|
+
provideHighlightOptions({
|
|
46
|
+
coreLibraryLoader: () => import('highlight.js/lib/core').then(r => r.default),
|
|
47
|
+
lineNumbersLoader: () => import('nxt-highlightjs/line-numbers'), // Optional, add line numbers if needed
|
|
48
|
+
languages: {
|
|
49
|
+
typescript: () => import('highlight.js/lib/languages/typescript').then(r => r.default),
|
|
50
|
+
css: () => import('highlight.js/lib/languages/css').then(r => r.default),
|
|
51
|
+
xml: () => import('highlight.js/lib/languages/xml').then(r => r.default)
|
|
52
|
+
},
|
|
53
|
+
themePath: 'path-to-theme.css' // Optional, useful for dynamic theme changes
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Use it in a template
|
|
60
|
+
|
|
61
|
+
```html
|
|
62
|
+
<pre><code [nxtHighlight]="code"
|
|
63
|
+
language="html"></code></pre>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Until Highlight.js loads, and in a language that isn't loaded, the code shows as plain text. Code that's already
|
|
67
|
+
highlighted, e.g. by server-side rendering, stays as it is until Highlight.js loads, so hydration keeps it.
|
|
@@ -1,154 +1,154 @@
|
|
|
1
|
-
import { APP_BASE_HREF } from
|
|
2
|
-
import * as i0 from
|
|
3
|
-
import {
|
|
4
|
-
import { HttpClient, HttpParams } from
|
|
5
|
-
import { Observable, shareReplay
|
|
6
|
-
import { rxResource } from
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* Used to handle server-side rendering and to stub out during unit tests.
|
|
11
|
-
*/
|
|
12
|
-
const NXT_HIGHLIGHT_FILE_LOCATION = new InjectionToken('NXT_HIGHLIGHT_FILE_LOCATION', {
|
|
13
|
-
providedIn: 'root',
|
|
14
|
-
factory: CODE_FILE_LOCATION_FACTORY
|
|
1
|
+
import { APP_BASE_HREF } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { DOCUMENT, Injectable, InjectionToken, PendingTasks, Pipe, inject } from "@angular/core";
|
|
4
|
+
import { HttpClient, HttpParams } from "@angular/common/http";
|
|
5
|
+
import { EMPTY, Observable, shareReplay } from "rxjs";
|
|
6
|
+
import { rxResource } from "@angular/core/rxjs-interop";
|
|
7
|
+
const NXT_HIGHLIGHT_FILE_LOCATION = new InjectionToken("NXT_HIGHLIGHT_FILE_LOCATION", {
|
|
8
|
+
providedIn: "root",
|
|
9
|
+
factory: CODE_FILE_LOCATION_FACTORY
|
|
15
10
|
});
|
|
16
|
-
/** @internal */
|
|
17
11
|
function CODE_FILE_LOCATION_FACTORY() {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return origin + path;
|
|
28
|
-
let prefix = base ?? origin;
|
|
29
|
-
if (prefix)
|
|
30
|
-
prefix += '/';
|
|
31
|
-
return prefix + path;
|
|
32
|
-
}
|
|
33
|
-
};
|
|
12
|
+
const location = inject(DOCUMENT)?.location;
|
|
13
|
+
const base = inject(APP_BASE_HREF, { optional: true })?.replace(/\/+$/gim, "");
|
|
14
|
+
return { formatPathname: (path) => {
|
|
15
|
+
const origin = (location ? location.origin : "").replace(/\/+$/gim, "");
|
|
16
|
+
if (path.startsWith("/")) return origin + path;
|
|
17
|
+
let prefix = base ?? origin;
|
|
18
|
+
if (prefix) prefix += "/";
|
|
19
|
+
return prefix + path;
|
|
20
|
+
} };
|
|
34
21
|
}
|
|
35
|
-
|
|
36
|
-
/** @internal */
|
|
37
22
|
function isUrl(url) {
|
|
38
|
-
|
|
39
|
-
return regExp.test(url);
|
|
23
|
+
return /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!]))?/.test(url);
|
|
40
24
|
}
|
|
41
|
-
|
|
42
|
-
* @internal
|
|
43
|
-
*/
|
|
44
|
-
const NXT_GIST_OPTIONS = new InjectionToken('NXT_GIST_OPTIONS');
|
|
25
|
+
const NXT_GIST_OPTIONS = new InjectionToken("NXT_GIST_OPTIONS");
|
|
45
26
|
function provideGistOptions(options) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
];
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/** @internal */
|
|
55
|
-
class CodeLoader {
|
|
56
|
-
constructor() {
|
|
57
|
-
this.http = inject(HttpClient);
|
|
58
|
-
this.options = inject(NXT_GIST_OPTIONS, { optional: true });
|
|
59
|
-
this.pendingTasks = inject(PendingTasks);
|
|
60
|
-
}
|
|
61
|
-
fetchFile(url, options) {
|
|
62
|
-
// Check if URL is valid
|
|
63
|
-
if (isUrl(url)) {
|
|
64
|
-
return this.http.get(url, options).pipe(obs => new Observable(sub => {
|
|
65
|
-
const done = this.pendingTasks.add();
|
|
66
|
-
const s = obs.subscribe({
|
|
67
|
-
next: val => {
|
|
68
|
-
sub.next(val);
|
|
69
|
-
done();
|
|
70
|
-
},
|
|
71
|
-
error: err => {
|
|
72
|
-
sub.error(err);
|
|
73
|
-
console.log(err);
|
|
74
|
-
done();
|
|
75
|
-
},
|
|
76
|
-
complete: () => sub.complete()
|
|
77
|
-
});
|
|
78
|
-
s.add(() => done());
|
|
79
|
-
return s;
|
|
80
|
-
}),
|
|
81
|
-
// Catch response
|
|
82
|
-
shareReplay(1));
|
|
83
|
-
}
|
|
84
|
-
return EMPTY;
|
|
85
|
-
}
|
|
86
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CodeLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
87
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CodeLoader, providedIn: 'root' }); }
|
|
27
|
+
return [{
|
|
28
|
+
provide: NXT_GIST_OPTIONS,
|
|
29
|
+
useValue: options
|
|
30
|
+
}];
|
|
88
31
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
32
|
+
var CodeLoader = class CodeLoader {
|
|
33
|
+
constructor() {
|
|
34
|
+
this.http = inject(HttpClient);
|
|
35
|
+
this.options = inject(NXT_GIST_OPTIONS, { optional: true });
|
|
36
|
+
this.pendingTasks = inject(PendingTasks);
|
|
37
|
+
}
|
|
38
|
+
fetchFile(url, options) {
|
|
39
|
+
if (isUrl(url)) return this.http.get(url, options).pipe((obs) => new Observable((sub) => {
|
|
40
|
+
const done = this.pendingTasks.add();
|
|
41
|
+
const s = obs.subscribe({
|
|
42
|
+
next: (val) => {
|
|
43
|
+
sub.next(val);
|
|
44
|
+
done();
|
|
45
|
+
},
|
|
46
|
+
error: (err) => {
|
|
47
|
+
sub.error(err);
|
|
48
|
+
console.log(err);
|
|
49
|
+
done();
|
|
50
|
+
},
|
|
51
|
+
complete: () => sub.complete()
|
|
52
|
+
});
|
|
53
|
+
s.add(() => done());
|
|
54
|
+
return s;
|
|
55
|
+
}), shareReplay(1));
|
|
56
|
+
return EMPTY;
|
|
57
|
+
}
|
|
58
|
+
static {
|
|
59
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
60
|
+
minVersion: "12.0.0",
|
|
61
|
+
version: "22.2.5",
|
|
62
|
+
ngImport: i0,
|
|
63
|
+
type: CodeLoader,
|
|
64
|
+
deps: [],
|
|
65
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
static {
|
|
69
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
70
|
+
minVersion: "12.0.0",
|
|
71
|
+
version: "22.2.5",
|
|
72
|
+
ngImport: i0,
|
|
73
|
+
type: CodeLoader,
|
|
74
|
+
providedIn: "root"
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
79
|
+
minVersion: "12.0.0",
|
|
80
|
+
version: "22.2.5",
|
|
81
|
+
ngImport: i0,
|
|
82
|
+
type: CodeLoader,
|
|
83
|
+
decorators: [{
|
|
84
|
+
type: Injectable,
|
|
85
|
+
args: [{ providedIn: "root" }]
|
|
86
|
+
}]
|
|
87
|
+
});
|
|
100
88
|
function fileResource(url, _options = {}) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
89
|
+
const { formatUrl, ...options } = _options;
|
|
90
|
+
const cl = options?.injector ? options.injector.get(CodeLoader) : inject(CodeLoader);
|
|
91
|
+
const location = options?.injector ? options.injector.get(NXT_HIGHLIGHT_FILE_LOCATION) : inject(NXT_HIGHLIGHT_FILE_LOCATION);
|
|
92
|
+
return rxResource({
|
|
93
|
+
...options,
|
|
94
|
+
params: () => {
|
|
95
|
+
const fileUrl = typeof url == "string" ? url : url();
|
|
96
|
+
return isUrl(fileUrl) ? fileUrl : location.formatPathname(fileUrl);
|
|
97
|
+
},
|
|
98
|
+
stream: ({ params: fileUrl }) => cl.fetchFile(fileUrl, { responseType: "text" })
|
|
99
|
+
});
|
|
112
100
|
}
|
|
113
|
-
/**
|
|
114
|
-
* Gist resource by id
|
|
115
|
-
*
|
|
116
|
-
* @param id Gist ID
|
|
117
|
-
*/
|
|
118
101
|
function gistResource(id, options) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
102
|
+
const cl = options?.injector ? options.injector.get(CodeLoader) : inject(CodeLoader);
|
|
103
|
+
return rxResource({
|
|
104
|
+
...options,
|
|
105
|
+
params: () => typeof id == "string" ? id : id(),
|
|
106
|
+
stream: ({ params: gistId }) => {
|
|
107
|
+
let params;
|
|
108
|
+
if (cl.options?.clientId && cl.options?.clientSecret) params = new HttpParams().set("client_id", cl.options.clientId).set("client_secret", cl.options.clientSecret);
|
|
109
|
+
return cl.fetchFile(`https://api.github.com/gists/${gistId}`, {
|
|
110
|
+
params,
|
|
111
|
+
responseType: "json"
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
});
|
|
131
115
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
116
|
+
var GistFilePipe = class GistFilePipe {
|
|
117
|
+
transform(gist, fileName) {
|
|
118
|
+
if (!fileName) return;
|
|
119
|
+
return gist?.files?.[fileName];
|
|
120
|
+
}
|
|
121
|
+
static {
|
|
122
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
123
|
+
minVersion: "12.0.0",
|
|
124
|
+
version: "22.2.5",
|
|
125
|
+
ngImport: i0,
|
|
126
|
+
type: GistFilePipe,
|
|
127
|
+
deps: [],
|
|
128
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
static {
|
|
132
|
+
this.ɵpipe = i0.ɵɵngDeclarePipe({
|
|
133
|
+
minVersion: "14.0.0",
|
|
134
|
+
version: "22.2.5",
|
|
135
|
+
ngImport: i0,
|
|
136
|
+
type: GistFilePipe,
|
|
137
|
+
isStandalone: true,
|
|
138
|
+
name: "gistFile"
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
143
|
+
minVersion: "12.0.0",
|
|
144
|
+
version: "22.2.5",
|
|
145
|
+
ngImport: i0,
|
|
146
|
+
type: GistFilePipe,
|
|
147
|
+
decorators: [{
|
|
148
|
+
type: Pipe,
|
|
149
|
+
args: [{ name: "gistFile" }]
|
|
150
|
+
}]
|
|
151
|
+
});
|
|
153
152
|
export { CODE_FILE_LOCATION_FACTORY, CodeLoader, GistFilePipe, NXT_GIST_OPTIONS, NXT_HIGHLIGHT_FILE_LOCATION, fileResource, gistResource, isUrl, provideGistOptions };
|
|
154
|
-
|
|
153
|
+
|
|
154
|
+
//# sourceMappingURL=nxt-highlightjs-extras.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nxt-highlightjs-extras.mjs","sources":["../../../packages/highlightjs/extras/src/code-file-location.ts","../../../packages/highlightjs/extras/src/gist.model.ts","../../../packages/highlightjs/extras/src/code-loader.ts","../../../packages/highlightjs/extras/src/gist.ts","../../../packages/highlightjs/extras/src/nxt-highlightjs-extras.ts"],"sourcesContent":["import { APP_BASE_HREF } from '@angular/common'\r\nimport { inject, InjectionToken, DOCUMENT } from '@angular/core'\r\n\r\n/**\r\n * Injection token used to provide the current location to `codeFromUrl` pipe.\r\n * Used to handle server-side rendering and to stub out during unit tests.\r\n */\r\nexport const NXT_HIGHLIGHT_FILE_LOCATION = new InjectionToken<CodeFileLocation>('NXT_HIGHLIGHT_FILE_LOCATION', {\r\n providedIn: 'root',\r\n factory: CODE_FILE_LOCATION_FACTORY\r\n})\r\n\r\n/**\r\n * @internal\r\n */\r\nexport interface CodeFileLocation {\r\n formatPathname: (path: string) => string\r\n}\r\n\r\n/** @internal */\r\nexport function CODE_FILE_LOCATION_FACTORY() {\r\n const location = inject(DOCUMENT)?.location\r\n const base = inject(APP_BASE_HREF, { optional: true })?.replace(/\\/+$/igm, '')\r\n\r\n return {\r\n // Note that this needs to be a function, rather than a property, because Angular\r\n // will only resolve it once, but we want the current path on each call.\r\n // getPathname: () => (location ? location.pathname + location.search : ''),\r\n formatPathname: (path: string) => {\r\n const origin = (location ? location.origin : '').replace(/\\/+$/igm, '')\r\n if (path.startsWith('/'))\r\n return origin + path\r\n\r\n let prefix = base ?? origin\r\n if (prefix)\r\n prefix += '/'\r\n\r\n return prefix + path\r\n }\r\n }\r\n}\r\n","import { InjectionToken, Provider } from '@angular/core'\r\n\r\n/** @internal */\r\nexport function isUrl(url: string): boolean {\r\n const regExp: RegExp = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!]))?/\r\n return regExp.test(url)\r\n}\r\n\r\nexport interface GistOptions {\r\n clientId: string\r\n clientSecret: string\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport const NXT_GIST_OPTIONS = new InjectionToken<GistOptions>('NXT_GIST_OPTIONS')\r\n\r\nexport function provideGistOptions(options: GistOptions): Provider[] {\r\n return [\r\n {\r\n provide: NXT_GIST_OPTIONS,\r\n useValue: options\r\n }\r\n ]\r\n}\r\n\r\ninterface Owner {\r\n login: string\r\n id: number\r\n node_id: string\r\n avatar_url: string\r\n gravatar_id: string\r\n url: string\r\n html_url: string\r\n followers_url: string\r\n following_url: string\r\n gists_url: string\r\n starred_url: string\r\n subscriptions_url: string\r\n organizations_url: string\r\n repos_url: string\r\n events_url: string\r\n received_events_url: string\r\n type: string\r\n site_admin: boolean\r\n}\r\n\r\ninterface User {\r\n login: string\r\n id: number\r\n node_id: string\r\n avatar_url: string\r\n gravatar_id: string\r\n url: string\r\n html_url: string\r\n followers_url: string\r\n following_url: string\r\n gists_url: string\r\n starred_url: string\r\n subscriptions_url: string\r\n organizations_url: string\r\n repos_url: string\r\n events_url: string\r\n received_events_url: string\r\n type: string\r\n site_admin: boolean\r\n}\r\n\r\ninterface ChangeStatus {\r\n total: number\r\n additions: number\r\n deletions: number\r\n}\r\n\r\ninterface History {\r\n user: User\r\n version: string\r\n committed_at: Date\r\n change_status: ChangeStatus\r\n url: string\r\n}\r\n\r\nexport interface GistFile {\r\n filename: string\r\n type: string\r\n language: string\r\n raw_url: string\r\n size: number\r\n truncated: boolean\r\n content: string\r\n}\r\n\r\ninterface Files {\r\n [fileName: string]: GistFile\r\n}\r\n\r\nexport interface Gist {\r\n url: string\r\n forks_url: string\r\n commits_url: string\r\n id: string\r\n node_id: string\r\n git_pull_url: string\r\n git_push_url: string\r\n html_url: string\r\n files: Files\r\n public: boolean\r\n created_at: Date\r\n updated_at: Date\r\n description: string\r\n comments: number\r\n user?: any\r\n comments_url: string\r\n owner: Owner\r\n forks: any[]\r\n history: History[]\r\n truncated: boolean\r\n}\r\n\r\n","import { HttpClient, HttpParams } from '@angular/common/http'\nimport { inject, Injectable, PendingTasks, Signal } from '@angular/core'\nimport { EMPTY, Observable, shareReplay } from 'rxjs'\nimport { rxResource, RxResourceOptions } from '@angular/core/rxjs-interop'\nimport { Gist, isUrl, NXT_GIST_OPTIONS } from './gist.model'\nimport { NXT_HIGHLIGHT_FILE_LOCATION } from './code-file-location'\n\n/** @internal */\n@Injectable({\n providedIn: 'root'\n})\nexport class CodeLoader {\n\n readonly http = inject(HttpClient)\n readonly options = inject(NXT_GIST_OPTIONS, { optional: true })\n private readonly pendingTasks = inject(PendingTasks)\n\n fetchFile(url: string, options: any): Observable<any> {\n // Check if URL is valid\n if (isUrl(url)) {\n return this.http.get(url, options).pipe(\n obs => new Observable(sub => {\n const done = this.pendingTasks.add()\n const s = obs.subscribe({\n next: val => {\n sub.next(val)\n done()\n },\n error: err => {\n sub.error(err)\n console.log(err)\n done()\n },\n complete: () => sub.complete()\n })\n s.add(() => done())\n return s\n }),\n // Catch response\n shareReplay(1)\n )\n }\n return EMPTY\n }\n\n}\n\n/**\n * Code resource by URL\n *\n * @param url File raw link\n */\nexport function fileResource(url: string | Signal<string>, _options: Omit<RxResourceOptions<string, string>, 'params' | 'stream'> & { formatUrl?: boolean } = {}) {\n const { formatUrl, ...options } = _options\n const cl = options?.injector ? options.injector.get(CodeLoader) : inject(CodeLoader)\n const location = options?.injector ? options.injector.get(NXT_HIGHLIGHT_FILE_LOCATION) : inject(NXT_HIGHLIGHT_FILE_LOCATION)\n\n return rxResource({\n ...options,\n params: () => {\n const fileUrl = typeof url == 'string' ? url : url()\n return isUrl(fileUrl) ? fileUrl : location.formatPathname(fileUrl)\n },\n stream: ({ params: fileUrl }) => cl.fetchFile(fileUrl, { responseType: 'text' })\n })\n}\n\n/**\n * Gist resource by id\n *\n * @param id Gist ID\n */\nexport function gistResource(id: string | Signal<string>, options?: Omit<RxResourceOptions<Gist, string>, 'params' | 'stream'>) {\n const cl = options?.injector ? options.injector.get(CodeLoader) : inject(CodeLoader)\n return rxResource({\n ...options,\n params: () => typeof id == 'string' ? id : id(),\n stream: ({ params: gistId }) => {\n let params: HttpParams | undefined\n if (cl.options?.clientId && cl.options?.clientSecret) {\n params = new HttpParams().set('client_id', cl.options.clientId).set('client_secret', cl.options.clientSecret)\n }\n return cl.fetchFile(`https://api.github.com/gists/${gistId}`, { params, responseType: 'json' })\n }\n })\n}\n","import { Pipe, PipeTransform } from '@angular/core'\nimport { Gist, GistFile } from './gist.model'\n\n@Pipe({\n name: 'gistFile'\n})\nexport class GistFilePipe implements PipeTransform {\n transform(gist?: Gist | null, fileName?: string | null): GistFile | undefined {\n if (!fileName)\n return\n return gist?.files?.[fileName]\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAGA;;;AAGG;MACU,2BAA2B,GAAG,IAAI,cAAc,CAAmB,6BAA6B,EAAE;AAC3G,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE;AACZ,CAAA;AASD;SACgB,0BAA0B,GAAA;IACtC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,QAAQ;AAC3C,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;IAE9E,OAAO;;;;AAIH,QAAA,cAAc,EAAE,CAAC,IAAY,KAAI;YAC7B,MAAM,MAAM,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC,MAAM,GAAG,EAAE,EAAE,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;AACvE,YAAA,IAAI,IAAI,CAAC,UAAU,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EAAE,YAAY,EAAE,MAAM,EAAE,CAAC;QACnG;AACH,KAAA,CAAC;AACN;;MC/Ea,YAAY,CAAA;IACrB,SAAS,CAAC,IAAkB,EAAE,QAAwB,EAAA;AAClD,QAAA,IAAI,CAAC,QAAQ;YACT;AACJ,QAAA,OAAO,IAAI,EAAE,KAAK,GAAG,QAAQ,CAAC;IAClC;8GALS,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAAZ,YAAY,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,UAAA,EAAA,CAAA,CAAA;;2FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBAHxB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACF,oBAAA,IAAI,EAAE;AACT,iBAAA;;;ACLD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"nxt-highlightjs-extras.mjs","names":[],"sources":["../../../packages/highlightjs/extras/src/code-file-location.ts","../../../packages/highlightjs/extras/src/gist.model.ts","../../../packages/highlightjs/extras/src/code-loader.ts","../../../packages/highlightjs/extras/src/gist.ts"],"sourcesContent":["import { APP_BASE_HREF } from '@angular/common'\r\nimport { inject, InjectionToken, DOCUMENT } from '@angular/core'\r\n\r\n/**\r\n * Injection token used to provide the current location to `codeFromUrl` pipe.\r\n * Used to handle server-side rendering and to stub out during unit tests.\r\n */\r\nexport const NXT_HIGHLIGHT_FILE_LOCATION = new InjectionToken<CodeFileLocation>('NXT_HIGHLIGHT_FILE_LOCATION', {\r\n providedIn: 'root',\r\n factory: CODE_FILE_LOCATION_FACTORY\r\n})\r\n\r\n/**\r\n * @internal\r\n */\r\nexport interface CodeFileLocation {\r\n formatPathname: (path: string) => string\r\n}\r\n\r\n/** @internal */\r\nexport function CODE_FILE_LOCATION_FACTORY() {\r\n const location = inject(DOCUMENT)?.location\r\n const base = inject(APP_BASE_HREF, { optional: true })?.replace(/\\/+$/igm, '')\r\n\r\n return {\r\n // Note that this needs to be a function, rather than a property, because Angular\r\n // will only resolve it once, but we want the current path on each call.\r\n // getPathname: () => (location ? location.pathname + location.search : ''),\r\n formatPathname: (path: string) => {\r\n const origin = (location ? location.origin : '').replace(/\\/+$/igm, '')\r\n if (path.startsWith('/'))\r\n return origin + path\r\n\r\n let prefix = base ?? origin\r\n if (prefix)\r\n prefix += '/'\r\n\r\n return prefix + path\r\n }\r\n }\r\n}\r\n","import { InjectionToken, Provider } from '@angular/core'\r\n\r\n/** @internal */\r\nexport function isUrl(url: string): boolean {\r\n const regExp: RegExp = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!]))?/\r\n return regExp.test(url)\r\n}\r\n\r\nexport interface GistOptions {\r\n clientId: string\r\n clientSecret: string\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport const NXT_GIST_OPTIONS = new InjectionToken<GistOptions>('NXT_GIST_OPTIONS')\r\n\r\nexport function provideGistOptions(options: GistOptions): Provider[] {\r\n return [\r\n {\r\n provide: NXT_GIST_OPTIONS,\r\n useValue: options\r\n }\r\n ]\r\n}\r\n\r\ninterface Owner {\r\n login: string\r\n id: number\r\n node_id: string\r\n avatar_url: string\r\n gravatar_id: string\r\n url: string\r\n html_url: string\r\n followers_url: string\r\n following_url: string\r\n gists_url: string\r\n starred_url: string\r\n subscriptions_url: string\r\n organizations_url: string\r\n repos_url: string\r\n events_url: string\r\n received_events_url: string\r\n type: string\r\n site_admin: boolean\r\n}\r\n\r\ninterface User {\r\n login: string\r\n id: number\r\n node_id: string\r\n avatar_url: string\r\n gravatar_id: string\r\n url: string\r\n html_url: string\r\n followers_url: string\r\n following_url: string\r\n gists_url: string\r\n starred_url: string\r\n subscriptions_url: string\r\n organizations_url: string\r\n repos_url: string\r\n events_url: string\r\n received_events_url: string\r\n type: string\r\n site_admin: boolean\r\n}\r\n\r\ninterface ChangeStatus {\r\n total: number\r\n additions: number\r\n deletions: number\r\n}\r\n\r\ninterface History {\r\n user: User\r\n version: string\r\n committed_at: Date\r\n change_status: ChangeStatus\r\n url: string\r\n}\r\n\r\nexport interface GistFile {\r\n filename: string\r\n type: string\r\n language: string\r\n raw_url: string\r\n size: number\r\n truncated: boolean\r\n content: string\r\n}\r\n\r\ninterface Files {\r\n [fileName: string]: GistFile\r\n}\r\n\r\nexport interface Gist {\r\n url: string\r\n forks_url: string\r\n commits_url: string\r\n id: string\r\n node_id: string\r\n git_pull_url: string\r\n git_push_url: string\r\n html_url: string\r\n files: Files\r\n public: boolean\r\n created_at: Date\r\n updated_at: Date\r\n description: string\r\n comments: number\r\n user?: any\r\n comments_url: string\r\n owner: Owner\r\n forks: any[]\r\n history: History[]\r\n truncated: boolean\r\n}\r\n\r\n","import { HttpClient, HttpParams } from '@angular/common/http'\nimport { inject, Injectable, PendingTasks, Signal } from '@angular/core'\nimport { EMPTY, Observable, shareReplay } from 'rxjs'\nimport { rxResource, RxResourceOptions } from '@angular/core/rxjs-interop'\nimport { Gist, isUrl, NXT_GIST_OPTIONS } from './gist.model'\nimport { NXT_HIGHLIGHT_FILE_LOCATION } from './code-file-location'\n\n/** @internal */\n@Injectable({\n providedIn: 'root'\n})\nexport class CodeLoader {\n\n readonly http = inject(HttpClient)\n readonly options = inject(NXT_GIST_OPTIONS, { optional: true })\n private readonly pendingTasks = inject(PendingTasks)\n\n fetchFile(url: string, options: any): Observable<any> {\n // Check if URL is valid\n if (isUrl(url)) {\n return this.http.get(url, options).pipe(\n obs => new Observable(sub => {\n const done = this.pendingTasks.add()\n const s = obs.subscribe({\n next: val => {\n sub.next(val)\n done()\n },\n error: err => {\n sub.error(err)\n console.log(err)\n done()\n },\n complete: () => sub.complete()\n })\n s.add(() => done())\n return s\n }),\n // Catch response\n shareReplay(1)\n )\n }\n return EMPTY\n }\n\n}\n\n/**\n * Code resource by URL\n *\n * @param url File raw link\n */\nexport function fileResource(url: string | Signal<string>, _options: Omit<RxResourceOptions<string, string>, 'params' | 'stream'> & { formatUrl?: boolean } = {}) {\n const { formatUrl, ...options } = _options\n const cl = options?.injector ? options.injector.get(CodeLoader) : inject(CodeLoader)\n const location = options?.injector ? options.injector.get(NXT_HIGHLIGHT_FILE_LOCATION) : inject(NXT_HIGHLIGHT_FILE_LOCATION)\n\n return rxResource({\n ...options,\n params: () => {\n const fileUrl = typeof url == 'string' ? url : url()\n return isUrl(fileUrl) ? fileUrl : location.formatPathname(fileUrl)\n },\n stream: ({ params: fileUrl }) => cl.fetchFile(fileUrl, { responseType: 'text' })\n })\n}\n\n/**\n * Gist resource by id\n *\n * @param id Gist ID\n */\nexport function gistResource(id: string | Signal<string>, options?: Omit<RxResourceOptions<Gist, string>, 'params' | 'stream'>) {\n const cl = options?.injector ? options.injector.get(CodeLoader) : inject(CodeLoader)\n return rxResource({\n ...options,\n params: () => typeof id == 'string' ? id : id(),\n stream: ({ params: gistId }) => {\n let params: HttpParams | undefined\n if (cl.options?.clientId && cl.options?.clientSecret) {\n params = new HttpParams().set('client_id', cl.options.clientId).set('client_secret', cl.options.clientSecret)\n }\n return cl.fetchFile(`https://api.github.com/gists/${gistId}`, { params, responseType: 'json' })\n }\n })\n}\n","import { Pipe, PipeTransform } from '@angular/core'\nimport { Gist, GistFile } from './gist.model'\n\n@Pipe({\n name: 'gistFile'\n})\nexport class GistFilePipe implements PipeTransform {\n transform(gist?: Gist | null, fileName?: string | null): GistFile | undefined {\n if (!fileName)\n return\n return gist?.files?.[fileName]\n }\n}\n"],"mappings":";;;;;;AAOA,MAAa,8BAA8B,IAAI,eAAiC,+BAA+B;CAC3G,YAAY;CACZ,SAAS;AACZ,CAAA;AAUD,SAAgB,6BAA0B;CACtC,MAAM,WAAW,OAAO,QAAQ,CAAC,EAAE;CACnC,MAAM,OAAO,OAAO,eAAe,EAAE,UAAU,KAAI,CAAE,CAAC,EAAE,QAAQ,WAAW,EAAE;CAE7E,OAAO,EAIH,iBAAiB,SAAgB;EAC7B,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