Skip to content

Commit fdc2581

Browse files
authored
Merge pull request #5 from philenius/develop
Upgrade to Angular v11
2 parents c2da60b + af4e13d commit fdc2581

22 files changed

+7661
-5996
lines changed

.eslintrc.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"root": true,
3+
"ignorePatterns": [
4+
"projects/**/*"
5+
],
6+
"overrides": [
7+
{
8+
"files": [
9+
"*.ts"
10+
],
11+
"parserOptions": {
12+
"project": [
13+
"tsconfig.json",
14+
"e2e/tsconfig.json"
15+
],
16+
"createDefaultProgram": true
17+
},
18+
"extends": [
19+
"plugin:@angular-eslint/recommended",
20+
"plugin:@angular-eslint/template/process-inline-templates"
21+
],
22+
"rules": {
23+
"@angular-eslint/component-selector": [
24+
"error",
25+
{
26+
"prefix": "lib",
27+
"style": "kebab-case",
28+
"type": "element"
29+
}
30+
],
31+
"@angular-eslint/directive-selector": [
32+
"error",
33+
{
34+
"prefix": "lib",
35+
"style": "camelCase",
36+
"type": "attribute"
37+
}
38+
]
39+
}
40+
},
41+
{
42+
"files": [
43+
"*.html"
44+
],
45+
"extends": [
46+
"plugin:@angular-eslint/template/recommended"
47+
],
48+
"rules": {}
49+
}
50+
]
51+
}

.vscode/extensions.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"dbaeumer.vscode-eslint",
4+
"Angular.ng-template"
5+
]
6+
}

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ An Angular component library for interactively highlighting / annotating parts o
88

99
## Features
1010

11-
* :raised_hand: Interactively mark entities such as cities, numbers, dates, etc.
12-
* :x: Remove annotations / marked entities.
11+
* :point_up_2: Interactively mark entities such as cities, numbers, dates, etc.
12+
* :wastebasket: Interactively remove annotations / marked entities.
1313
* :tada: Purely based on CSS. No magic, no canvas, and no SVGs.
1414

1515

@@ -95,7 +95,7 @@ For the demo application, please see the Angular app in `./src/app/`. Screen rec
9595
border-radius: 0rem !important;
9696
}
9797
```
98-
98+
9999
100100
101101
@@ -105,22 +105,23 @@ For the demo application, please see the Angular app in `./src/app/`. Screen rec
105105
106106
| Input | Description | Type | Default value |
107107
| :-------------- | ------------------------------------------------------------ | ------------ | :------------ |
108-
| annotations | Represents the parts of the given text which shall be annotated. | Annotation[] | [] |
109-
| annotationClass | An optional CSS class applied to all elements which wrap the annotated parts of the given text. | string | |
110-
| removable | Determines whether annotations shall have a small button in the top right corner so that the user can remove an annotation. | boolean | true |
111-
| text | The text which shall be displayed and annotated. | string | |
108+
| annotations | Represents the parts of the given text which shall be annotated. | `Annotation[]` | `[]` |
109+
| annotationClass | An optional CSS class applied to all elements which wrap the annotated parts of the given text. | `string\|undefined` | `undefined` |
110+
| removable | Determines whether annotations shall have a small button in the top right corner so that the user can remove an annotation. | `boolean` | `true` |
111+
| text | The text which shall be displayed and annotated. | `string` | empty string |
112112
113113
### Outputs
114114
115115
| Output | Description | Type |
116116
| ----------------- | ------------------------------------------------------------ | -------------------------- |
117-
| annotationsChange | Emits the list of existing annotations after an element has been removed by the user. | EventEmitter<Annotation[]> |
117+
| annotationsChange | Emits the list of existing annotations after an element has been removed by the user. | `EventEmitter<Annotation[]>` |
118118
119119
### Methods
120120
121-
| Method | Description | Return type |
122-
| ----------------------- | ------------------------------------------------------------ | ----------- |
123-
| getCurrentTextSelection | Returns the start index and end index of the currently selected text range. Returns `undefined` if no text is currently selected. | ISelection |
121+
| Method | Description | Return type |
122+
| ------------------------------------ | ------------------------------------------------------------ | ----------- |
123+
| getCurrentTextSelection | Returns the start index and end index of the currently selected text range. Returns `undefined` if no text is currently selected. | `ISelection\|undefined` |
124+
| isOverlappingWithExistingAnnotations | Returns true if the given text selection is (partially) overlapping with an existing annotation. Returns false otherwise. | `boolean` |
124125
125126
126127
@@ -132,7 +133,7 @@ Run `ng build ngx-annotate-text` to build the project. The build artifacts will
132133
133134
### Running linting tools
134135
135-
Run `ng lint ngx-annotate-text ` to execute TSLint.
136+
Run `ng lint ngx-annotate-text ` to execute ESLint.
136137
137138
### Running unit tests
138139

angular.json

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,11 @@
9595
}
9696
},
9797
"lint": {
98-
"builder": "@angular-devkit/build-angular:tslint",
98+
"builder": "@angular-eslint/builder:lint",
9999
"options": {
100-
"tsConfig": [
101-
"tsconfig.app.json",
102-
"tsconfig.spec.json",
103-
"e2e/tsconfig.json"
104-
],
105-
"exclude": [
106-
"**/node_modules/**"
100+
"lintFilePatterns": [
101+
"src/**/*.ts",
102+
"src/**/*.html"
107103
]
108104
}
109105
},
@@ -148,18 +144,19 @@
148144
}
149145
},
150146
"lint": {
151-
"builder": "@angular-devkit/build-angular:tslint",
147+
"builder": "@angular-eslint/builder:lint",
152148
"options": {
153-
"tsConfig": [
154-
"projects/ngx-annotate-text/tsconfig.lib.json",
155-
"projects/ngx-annotate-text/tsconfig.spec.json"
156-
],
157-
"exclude": [
158-
"**/node_modules/**"
149+
"lintFilePatterns": [
150+
"projects/ngx-annotate-text/**/*.ts",
151+
"projects/ngx-annotate-text/**/*.html"
159152
]
160153
}
161154
}
162155
}
163-
}},
164-
"defaultProject": "ngx-annotate-text-workspace"
156+
}
157+
},
158+
"defaultProject": "ngx-annotate-text-workspace",
159+
"cli": {
160+
"defaultCollection": "@angular-eslint/schematics"
161+
}
165162
}

0 commit comments

Comments
 (0)