Skip to content

Commit d833b76

Browse files
committed
feat: more signals
1 parent 02e059c commit d833b76

File tree

30 files changed

+4030
-5317
lines changed

30 files changed

+4030
-5317
lines changed

eslint.config.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,34 @@ export default config(
198198
'config'
199199
],
200200
package: 'typescript-eslint'
201+
},
202+
{
203+
from: 'file',
204+
name: [
205+
// Library deprecations
206+
"MomentDateTimeModule",
207+
"NativeDateTimeModule",
208+
"DateTimeModule",
209+
"ColorPickerModule",
210+
"ready",
211+
"getCodeFromGist",
212+
"getCodeFromUrl",
213+
"GistDirective",
214+
"CodeFromUrlPipe",
215+
"DropzoneModule",
216+
"highlight",
217+
"highlightAuto",
218+
"highlightElement",
219+
"highlightAll",
220+
"registerLanguage",
221+
"debugMode",
222+
"safeMode",
223+
"getLanguage",
224+
"listLanguages",
225+
"unregisterLanguage",
226+
"registerAliases",
227+
"lineNumbersBlock"
228+
]
201229
}
202230
]
203231
}

package.json

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@
3131
"release": "lerna version --sync-workspace-lock"
3232
},
3333
"dependencies": {
34-
"@angular/animations": "^21.0.6",
35-
"@angular/cdk": "^21.0.5",
36-
"@angular/common": "^21.0.6",
37-
"@angular/compiler": "^21.0.6",
38-
"@angular/core": "^21.0.6",
39-
"@angular/forms": "^21.0.6",
40-
"@angular/localize": "^21.0.6",
41-
"@angular/platform-browser": "^21.0.6",
42-
"@angular/platform-server": "^21.0.6",
34+
"@angular/animations": "^21.0.8",
35+
"@angular/cdk": "^21.0.6",
36+
"@angular/common": "^21.0.8",
37+
"@angular/compiler": "^21.0.8",
38+
"@angular/core": "^21.0.8",
39+
"@angular/forms": "^21.0.8",
40+
"@angular/localize": "^21.0.8",
41+
"@angular/platform-browser": "^21.0.8",
42+
"@angular/platform-server": "^21.0.8",
4343
"dropzone": "^6.0.0-beta.2",
4444
"moment": "^2.30.1",
4545
"rxjs": "^7.8.2",
@@ -48,20 +48,20 @@
4848
"zone.js": "^0.16.0"
4949
},
5050
"devDependencies": {
51-
"@angular-devkit/architect": "^0.2100.4",
52-
"@angular-devkit/core": "^21.0.4",
53-
"@angular-devkit/schematics": "^21.0.4",
54-
"@angular/build": "^21.0.4",
55-
"@angular/cli": "^21.0.4",
56-
"@angular/compiler-cli": "^21.0.6",
57-
"@commitlint/cli": "^20.3.0",
58-
"@commitlint/config-conventional": "^20.3.0",
51+
"@angular-devkit/architect": "^0.2100.5",
52+
"@angular-devkit/core": "^21.0.5",
53+
"@angular-devkit/schematics": "^21.0.5",
54+
"@angular/build": "^21.0.5",
55+
"@angular/cli": "^21.0.5",
56+
"@angular/compiler-cli": "^21.0.8",
57+
"@commitlint/cli": "^20.3.1",
58+
"@commitlint/config-conventional": "^20.3.1",
5959
"@compodoc/compodoc": "^1.1.32",
60-
"@lerna-lite/cli": "^4.10.3",
61-
"@lerna-lite/version": "^4.10.3",
60+
"@lerna-lite/cli": "^4.10.5",
61+
"@lerna-lite/version": "^4.10.5",
6262
"@liquid-js/angular-cli-ghpages": "^2.0.4",
6363
"@liquid-js/commitlint-plugin-workspace-scopes": "^2.1.0",
64-
"@stylistic/eslint-plugin": "^5.6.1",
64+
"@stylistic/eslint-plugin": "^5.7.0",
6565
"@stylistic/stylelint-config": "^3.0.1",
6666
"@types/jasmine": "^5.1.13",
6767
"@types/node": "<25.0.0",
@@ -71,7 +71,7 @@
7171
"cross-env": "^10.1.0",
7272
"eslint": "^9.39.2",
7373
"eslint-plugin-import": "^2.32.0",
74-
"eslint-plugin-jsdoc": "^61.5.0",
74+
"eslint-plugin-jsdoc": "^62.0.0",
7575
"eslint-plugin-prefer-arrow-functions": "^3.9.1",
7676
"eslint-plugin-unused-imports": "^4.3.0",
7777
"globby": "^16.1.0",
@@ -93,25 +93,25 @@
9393
"ts-node-maintained": "^10.9.6",
9494
"typedoc": "^0.28.15",
9595
"typescript": ">=5.9 <6.0",
96-
"typescript-eslint": "^8.51.0"
96+
"typescript-eslint": "^8.52.0"
9797
},
9898
"packageManager": "yarn@4.12.0",
9999
"resolutions": {
100-
"@angular-devkit/architect": "^0.2100.4",
101-
"@angular-devkit/build-angular": "^21.0.4",
102-
"@angular-devkit/core": "^21.0.4",
103-
"@angular-devkit/schematics": "^21.0.4",
104-
"@angular/cli": "^21.0.4",
105-
"@angular/compiler-cli": "^21.0.6",
106-
"@angular/animations": "^21.0.6",
107-
"@angular/cdk": "^21.0.5",
108-
"@angular/common": "^21.0.6",
109-
"@angular/compiler": "^21.0.6",
110-
"@angular/core": "^21.0.6",
111-
"@angular/forms": "^21.0.6",
112-
"@angular/localize": "^21.0.6",
113-
"@angular/platform-browser": "^21.0.6",
114-
"@angular/platform-server": "^21.0.6",
115-
"@angular/router": "^21.0.6"
100+
"@angular-devkit/architect": "^0.2100.5",
101+
"@angular-devkit/build-angular": "^21.0.5",
102+
"@angular-devkit/core": "^21.0.5",
103+
"@angular-devkit/schematics": "^21.0.5",
104+
"@angular/cli": "^21.0.5",
105+
"@angular/compiler-cli": "^21.0.8",
106+
"@angular/animations": "^21.0.8",
107+
"@angular/cdk": "^21.0.6",
108+
"@angular/common": "^21.0.8",
109+
"@angular/compiler": "^21.0.8",
110+
"@angular/core": "^21.0.8",
111+
"@angular/forms": "^21.0.8",
112+
"@angular/localize": "^21.0.8",
113+
"@angular/platform-browser": "^21.0.8",
114+
"@angular/platform-server": "^21.0.8",
115+
"@angular/router": "^21.0.8"
116116
}
117117
}

packages/color-picker/src/lib/color-picker.directive.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ConnectedPosition, Overlay, OverlayRef } from '@angular/cdk/overlay'
22
import { ComponentPortal } from '@angular/cdk/portal'
3-
import { ApplicationRef, ComponentRef, Directive, ElementRef, HostListener, Injector, OnChanges, OnDestroy, SimpleChanges, ViewContainerRef, inject, output, input, linkedSignal } from '@angular/core'
3+
import { ApplicationRef, ComponentRef, Directive, ElementRef, Injector, OnChanges, OnDestroy, SimpleChanges, ViewContainerRef, inject, output, input, linkedSignal } from '@angular/core'
44
import { compositeColors, hsvaToRgba, stringToHsva } from '../util/color'
55
import { opaqueSliderLight } from '../util/contrast'
66
import { Hsva, Rgba } from '../util/formats'
@@ -10,7 +10,13 @@ import { ColorPickerComponent } from './color-picker/color-picker.component'
1010

1111
@Directive({
1212
selector: '[nxtColor]',
13-
exportAs: 'nxtColorPicker'
13+
exportAs: 'nxtColorPicker',
14+
host: {
15+
'(focus)': 'handleOpen($event)',
16+
'(click)': 'handleOpen($event)',
17+
'(input)': 'handleInput($event)',
18+
'(change)': 'handleInput($event)'
19+
}
1420
})
1521
export class ColorPickerDirective implements OnChanges, OnDestroy {
1622

@@ -186,8 +192,6 @@ export class ColorPickerDirective implements OnChanges, OnDestroy {
186192
private readonly overlay = inject(Overlay)
187193

188194
/** @internal */
189-
@HostListener('focus', ['$event'])
190-
@HostListener('click', ['$event'])
191195
handleOpen(event: Event) {
192196
const path = new Set(composedPath(event))
193197
const ignored = this.resIgnoredElements.find(el => path.has(el))
@@ -198,8 +202,6 @@ export class ColorPickerDirective implements OnChanges, OnDestroy {
198202
}
199203

200204
/** @internal */
201-
@HostListener('input', ['$event'])
202-
@HostListener('change', ['$event'])
203205
handleInput(event: Event) {
204206
const value = (((event?.target as HTMLInputElement | null)?.['value'] || '') + '').trim()
205207

packages/color-picker/src/lib/color-picker/color-picker.component.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AfterViewChecked, ChangeDetectorRef, Component, ElementRef, HostListener, inject, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core'
1+
import { AfterViewChecked, ChangeDetectorRef, Component, ElementRef, inject, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core'
22
import { cmykToRgb, denormalizeCMYK, denormalizeHSLA, denormalizeRGBA, formatCmyk, formatOutput, hslaToHsva, hsvaToHsla, hsvaToRgba, rgbaToCmyk, rgbaToHex, rgbaToHsva, stringToCmyk, stringToHsva } from '../../util/color'
33
import { opaqueSliderLight, transparentSliderLight } from '../../util/contrast'
44
import { Cmyk, Hsla, Hsva, Rgba } from '../../util/formats'
@@ -19,7 +19,14 @@ import { TextDirective } from '../text.directive'
1919
imports: [
2020
SliderDirective,
2121
TextDirective
22-
]
22+
],
23+
host: {
24+
'(document:keyup.esc)': 'onCancel($event)',
25+
'(document:keyup.enter)': 'onAccept($event)',
26+
'(document:mousedown)': 'onFocusChange($event)',
27+
'(document:focusin)': 'onFocusChange($event)',
28+
'(click)': 'onClick($event)'
29+
}
2330
})
2431
export class ColorPickerComponent implements OnInit, OnDestroy, AfterViewChecked {
2532

@@ -95,7 +102,6 @@ export class ColorPickerComponent implements OnInit, OnDestroy, AfterViewChecked
95102
private readonly cdRef = inject(ChangeDetectorRef)
96103
private readonly service = inject(ColorPickerService)
97104

98-
@HostListener('document:keyup.esc', ['$event'])
99105
onCancel(event: Event) {
100106
event.stopPropagation()
101107
event.preventDefault()
@@ -113,7 +119,6 @@ export class ColorPickerComponent implements OnInit, OnDestroy, AfterViewChecked
113119
}
114120
}
115121

116-
@HostListener('document:keyup.enter', ['$event'])
117122
onAccept(event: Event) {
118123
event.stopPropagation()
119124
event.preventDefault()
@@ -129,13 +134,10 @@ export class ColorPickerComponent implements OnInit, OnDestroy, AfterViewChecked
129134
}
130135
}
131136

132-
@HostListener('click', ['$event'])
133137
onClick(event: MouseEvent) {
134138
event.stopPropagation()
135139
}
136140

137-
@HostListener('document:mousedown', ['$event'])
138-
@HostListener('document:focusin', ['$event'])
139141
onFocusChange(event: MouseEvent | FocusEvent) {
140142
const path = new Set(composedPath(event))
141143
const intersect = this.ignoredElements?.find(el => path.has(el))

packages/color-picker/src/lib/slider.directive.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
import { Directive, ElementRef, HostListener, inject, input, output } from '@angular/core'
1+
import { Directive, ElementRef, inject, input, output } from '@angular/core'
22
import { CursorEvent } from '../util/helpers'
33

44
/**
55
* @internal
66
*/
77
@Directive({
8-
selector: '[nxtSlider]'
8+
selector: '[nxtSlider]',
9+
host: {
10+
'(mousedown)': 'onStart($event)',
11+
'(touchstart)': 'onStart($event)',
12+
'(document:mousemove)': 'onMove($event)',
13+
'(document:touchmove)': 'onMove($event)',
14+
'(document:mouseup)': 'onStop($event)',
15+
'(document:touchend)': 'onStop($event)'
16+
}
917
})
1018
export class SliderDirective {
1119

@@ -22,8 +30,6 @@ export class SliderDirective {
2230
readonly newValue = output<CursorEvent>()
2331
private readonly elRef = inject(ElementRef)
2432

25-
@HostListener('mousedown', ['$event'])
26-
@HostListener('touchstart', ['$event'])
2733
onStart(event: MouseEvent | TouchEvent) {
2834
event.stopPropagation()
2935
event.preventDefault()
@@ -33,8 +39,6 @@ export class SliderDirective {
3339
this.dragStart.emit(undefined)
3440
}
3541

36-
@HostListener('document:mousemove', ['$event'])
37-
@HostListener('document:touchmove', ['$event'])
3842
onMove(event: MouseEvent | TouchEvent) {
3943
if (this.isMoving) {
4044
event.stopPropagation()
@@ -44,8 +48,6 @@ export class SliderDirective {
4448
}
4549
}
4650

47-
@HostListener('document:mouseup', ['$event'])
48-
@HostListener('document:touchend', ['$event'])
4951
onStop(event: MouseEvent | TouchEvent) {
5052
if (this.isMoving) {
5153
event.stopPropagation()

packages/color-picker/src/lib/text.directive.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
import { Directive, HostListener, input, output } from '@angular/core'
1+
import { Directive, input, output } from '@angular/core'
22
import { TextEvent } from '../util/helpers'
33

44
/**
55
* @internal
66
*/
77
@Directive({
8-
selector: '[nxtText]'
8+
selector: '[nxtText]',
9+
host: {
10+
'(input)': 'inputChange($event)',
11+
'(change)': 'inputChange($event)'
12+
}
913
})
1014
export class TextDirective {
1115

@@ -14,8 +18,6 @@ export class TextDirective {
1418

1519
readonly newValue = output<TextEvent>()
1620

17-
@HostListener('input', ['$event'])
18-
@HostListener('change', ['$event'])
1921
inputChange(event: Event) {
2022
const value = (((event?.target as HTMLInputElement | null)?.['value'] || '') + '').trim()
2123

packages/demo/package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515
"lint:sass:fix": "yarn lint:sass --fix"
1616
},
1717
"dependencies": {
18-
"@angular/animations": "^21.0.6",
19-
"@angular/cdk": "^21.0.5",
20-
"@angular/common": "^21.0.6",
21-
"@angular/compiler": "^21.0.6",
22-
"@angular/core": "^21.0.6",
23-
"@angular/forms": "^21.0.6",
24-
"@angular/platform-browser": "^21.0.6",
25-
"@angular/platform-server": "^21.0.6",
26-
"@angular/router": "^21.0.6",
27-
"@angular/service-worker": "^21.0.6",
28-
"@angular/ssr": "^21.0.4",
18+
"@angular/animations": "^21.0.8",
19+
"@angular/cdk": "^21.0.6",
20+
"@angular/common": "^21.0.8",
21+
"@angular/compiler": "^21.0.8",
22+
"@angular/core": "^21.0.8",
23+
"@angular/forms": "^21.0.8",
24+
"@angular/platform-browser": "^21.0.8",
25+
"@angular/platform-server": "^21.0.8",
26+
"@angular/router": "^21.0.8",
27+
"@angular/service-worker": "^21.0.8",
28+
"@angular/ssr": "^21.0.5",
2929
"@popperjs/core": "^2.11.8",
3030
"bootstrap": "^5.3.8",
3131
"clipboard-polyfill": "^4.1.1",
@@ -35,7 +35,7 @@
3535
"jquery": "^3.7.1",
3636
"ngx-bootstrap": "^20.0.2",
3737
"rxjs": "^7.8.2",
38-
"sass": "^1.97.1",
38+
"sass": "^1.97.2",
3939
"sortablejs": "^1.15.6",
4040
"tslib": "^2.8.1",
4141
"zone.js": "^0.16.0"

packages/demo/src/app/code-block/code-block.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class CodeBlockComponent {
1818

1919
readonly code = input<string>()
2020

21-
readonly copy = input(true)
21+
readonly copy = input<boolean>(true)
2222

2323
readonly languages = input<string[]>()
2424

0 commit comments

Comments
 (0)