@mindfiredigital/textigniter-angular 1.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/.editorconfig +17 -0
- package/CHANGELOG.md +7 -0
- package/README.md +59 -0
- package/angular.json +134 -0
- package/package.json +42 -0
- package/projects/demo-app/public/favicon.ico +0 -0
- package/projects/demo-app/src/app/app.component.css +0 -0
- package/projects/demo-app/src/app/app.component.html +2 -0
- package/projects/demo-app/src/app/app.component.spec.ts +29 -0
- package/projects/demo-app/src/app/app.component.ts +34 -0
- package/projects/demo-app/src/app/app.config.ts +8 -0
- package/projects/demo-app/src/app/app.module.ts +18 -0
- package/projects/demo-app/src/app/app.routes.ts +3 -0
- package/projects/demo-app/src/index.html +13 -0
- package/projects/demo-app/src/main.ts +6 -0
- package/projects/demo-app/src/styles.css +1 -0
- package/projects/demo-app/tsconfig.app.json +15 -0
- package/projects/demo-app/tsconfig.spec.json +15 -0
- package/projects/text-igniter/README.md +106 -0
- package/projects/text-igniter/ng-package.json +10 -0
- package/projects/text-igniter/package.json +13 -0
- package/projects/text-igniter/src/lib/text-igniter.component.html +1 -0
- package/projects/text-igniter/src/lib/text-igniter.component.spec.ts +23 -0
- package/projects/text-igniter/src/lib/text-igniter.component.ts +54 -0
- package/projects/text-igniter/src/lib/text-igniter.module.ts +10 -0
- package/projects/text-igniter/src/lib/text-igniter.service.spec.ts +16 -0
- package/projects/text-igniter/src/lib/text-igniter.service.ts +9 -0
- package/projects/text-igniter/src/main.ts +10 -0
- package/projects/text-igniter/src/public-api.ts +9 -0
- package/projects/text-igniter/tsconfig.lib.json +15 -0
- package/projects/text-igniter/tsconfig.lib.prod.json +11 -0
- package/projects/text-igniter/tsconfig.spec.json +15 -0
- package/tsconfig.json +39 -0
package/.editorconfig
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Editor configuration, see https://editorconfig.org
|
|
2
|
+
root = true
|
|
3
|
+
|
|
4
|
+
[*]
|
|
5
|
+
charset = utf-8
|
|
6
|
+
indent_style = space
|
|
7
|
+
indent_size = 2
|
|
8
|
+
insert_final_newline = true
|
|
9
|
+
trim_trailing_whitespace = true
|
|
10
|
+
|
|
11
|
+
[*.ts]
|
|
12
|
+
quote_type = single
|
|
13
|
+
ij_typescript_use_double_quotes = false
|
|
14
|
+
|
|
15
|
+
[*.md]
|
|
16
|
+
max_line_length = off
|
|
17
|
+
trim_trailing_whitespace = false
|
package/CHANGELOG.md
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Angular
|
|
2
|
+
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.2.7.
|
|
4
|
+
|
|
5
|
+
## Development server
|
|
6
|
+
|
|
7
|
+
To start a local development server, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ng serve
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
|
|
14
|
+
|
|
15
|
+
## Code scaffolding
|
|
16
|
+
|
|
17
|
+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
ng generate component component-name
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
ng generate --help
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Building
|
|
30
|
+
|
|
31
|
+
To build the project run:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
ng build
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.
|
|
38
|
+
|
|
39
|
+
## Running unit tests
|
|
40
|
+
|
|
41
|
+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
ng test
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Running end-to-end tests
|
|
48
|
+
|
|
49
|
+
For end-to-end (e2e) testing, run:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
ng e2e
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
56
|
+
|
|
57
|
+
## Additional Resources
|
|
58
|
+
|
|
59
|
+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
package/angular.json
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"newProjectRoot": "projects",
|
|
5
|
+
"projects": {
|
|
6
|
+
"text-igniter": {
|
|
7
|
+
"projectType": "library",
|
|
8
|
+
"root": "projects/text-igniter",
|
|
9
|
+
"sourceRoot": "projects/text-igniter/src",
|
|
10
|
+
"prefix": "lib",
|
|
11
|
+
"architect": {
|
|
12
|
+
"build": {
|
|
13
|
+
"builder": "@angular-devkit/build-angular:ng-packagr",
|
|
14
|
+
"options": {
|
|
15
|
+
"project": "projects/text-igniter/ng-package.json"
|
|
16
|
+
},
|
|
17
|
+
"configurations": {
|
|
18
|
+
"production": {
|
|
19
|
+
"tsConfig": "projects/text-igniter/tsconfig.lib.prod.json"
|
|
20
|
+
},
|
|
21
|
+
"development": {
|
|
22
|
+
"tsConfig": "projects/text-igniter/tsconfig.lib.json"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"defaultConfiguration": "production"
|
|
26
|
+
},
|
|
27
|
+
"test": {
|
|
28
|
+
"builder": "@angular-devkit/build-angular:karma",
|
|
29
|
+
"options": {
|
|
30
|
+
"tsConfig": "projects/text-igniter/tsconfig.spec.json",
|
|
31
|
+
"polyfills": [
|
|
32
|
+
"zone.js",
|
|
33
|
+
"zone.js/testing"
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"serve": {
|
|
38
|
+
"options": {
|
|
39
|
+
"port": 4200
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"demo-app": {
|
|
45
|
+
"projectType": "application",
|
|
46
|
+
"schematics": {},
|
|
47
|
+
"root": "projects/demo-app",
|
|
48
|
+
"sourceRoot": "projects/demo-app/src",
|
|
49
|
+
"prefix": "app",
|
|
50
|
+
"architect": {
|
|
51
|
+
"build": {
|
|
52
|
+
"builder": "@angular-devkit/build-angular:application",
|
|
53
|
+
"options": {
|
|
54
|
+
"outputPath": "dist/demo-app",
|
|
55
|
+
"index": "projects/demo-app/src/index.html",
|
|
56
|
+
"browser": "projects/demo-app/src/main.ts",
|
|
57
|
+
"polyfills": [
|
|
58
|
+
"zone.js"
|
|
59
|
+
],
|
|
60
|
+
"tsConfig": "projects/demo-app/tsconfig.app.json",
|
|
61
|
+
"assets": [
|
|
62
|
+
{
|
|
63
|
+
"glob": "**/*",
|
|
64
|
+
"input": "projects/demo-app/public"
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"styles": [
|
|
68
|
+
"projects/demo-app/src/styles.css"
|
|
69
|
+
],
|
|
70
|
+
"scripts": []
|
|
71
|
+
},
|
|
72
|
+
"configurations": {
|
|
73
|
+
"production": {
|
|
74
|
+
"budgets": [
|
|
75
|
+
{
|
|
76
|
+
"type": "initial",
|
|
77
|
+
"maximumWarning": "500kB",
|
|
78
|
+
"maximumError": "1MB"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"type": "anyComponentStyle",
|
|
82
|
+
"maximumWarning": "4kB",
|
|
83
|
+
"maximumError": "8kB"
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"outputHashing": "all"
|
|
87
|
+
},
|
|
88
|
+
"development": {
|
|
89
|
+
"optimization": false,
|
|
90
|
+
"extractLicenses": false,
|
|
91
|
+
"sourceMap": true
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"defaultConfiguration": "production"
|
|
95
|
+
},
|
|
96
|
+
"serve": {
|
|
97
|
+
"builder": "@angular-devkit/build-angular:dev-server",
|
|
98
|
+
"configurations": {
|
|
99
|
+
"production": {
|
|
100
|
+
"buildTarget": "demo-app:build:production"
|
|
101
|
+
},
|
|
102
|
+
"development": {
|
|
103
|
+
"buildTarget": "demo-app:build:development"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"defaultConfiguration": "development"
|
|
107
|
+
},
|
|
108
|
+
"extract-i18n": {
|
|
109
|
+
"builder": "@angular-devkit/build-angular:extract-i18n"
|
|
110
|
+
},
|
|
111
|
+
"test": {
|
|
112
|
+
"builder": "@angular-devkit/build-angular:karma",
|
|
113
|
+
"options": {
|
|
114
|
+
"polyfills": [
|
|
115
|
+
"zone.js",
|
|
116
|
+
"zone.js/testing"
|
|
117
|
+
],
|
|
118
|
+
"tsConfig": "projects/demo-app/tsconfig.spec.json",
|
|
119
|
+
"assets": [
|
|
120
|
+
{
|
|
121
|
+
"glob": "**/*",
|
|
122
|
+
"input": "projects/demo-app/public"
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
"styles": [
|
|
126
|
+
"projects/demo-app/src/styles.css"
|
|
127
|
+
],
|
|
128
|
+
"scripts": []
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mindfiredigital/textigniter-angular",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Angular textigniter",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"ng": "ng",
|
|
8
|
+
"start": "ng serve",
|
|
9
|
+
"build": "ng build text-igniter",
|
|
10
|
+
"build-prod": "ng build text-igniter --configuration production",
|
|
11
|
+
"watch": "ng build --watch --configuration development",
|
|
12
|
+
"test": "ng test"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@angular/common": "^19.2.0",
|
|
16
|
+
"@angular/compiler": "^19.2.0",
|
|
17
|
+
"@angular/core": "^19.2.0",
|
|
18
|
+
"@angular/forms": "^19.2.0",
|
|
19
|
+
"@angular/platform-browser": "^19.2.0",
|
|
20
|
+
"@angular/platform-browser-dynamic": "^19.2.0",
|
|
21
|
+
"@angular/router": "^19.2.0",
|
|
22
|
+
"@mindfiredigital/textigniter": "workspace:^1.0.0",
|
|
23
|
+
"@mindfiredigital/textigniter-web-component": "workspace:^1.0.0",
|
|
24
|
+
"rxjs": "~7.8.0",
|
|
25
|
+
"tslib": "^2.3.0",
|
|
26
|
+
"zone.js": "~0.15.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@angular-devkit/build-angular": "^19.2.7",
|
|
30
|
+
"@angular/cli": "^19.2.7",
|
|
31
|
+
"@angular/compiler-cli": "^19.2.0",
|
|
32
|
+
"@types/jasmine": "~5.1.0",
|
|
33
|
+
"jasmine-core": "~5.6.0",
|
|
34
|
+
"karma": "~6.4.0",
|
|
35
|
+
"karma-chrome-launcher": "~3.2.0",
|
|
36
|
+
"karma-coverage": "~2.2.0",
|
|
37
|
+
"karma-jasmine": "~5.1.0",
|
|
38
|
+
"karma-jasmine-html-reporter": "~2.1.0",
|
|
39
|
+
"ng-packagr": "^19.2.0",
|
|
40
|
+
"typescript": "~5.7.2"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
Binary file
|
|
File without changes
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TestBed } from '@angular/core/testing';
|
|
2
|
+
import { AppComponent } from './app.component';
|
|
3
|
+
|
|
4
|
+
describe('AppComponent', () => {
|
|
5
|
+
beforeEach(async () => {
|
|
6
|
+
await TestBed.configureTestingModule({
|
|
7
|
+
imports: [AppComponent],
|
|
8
|
+
}).compileComponents();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('should create the app', () => {
|
|
12
|
+
const fixture = TestBed.createComponent(AppComponent);
|
|
13
|
+
const app = fixture.componentInstance;
|
|
14
|
+
expect(app).toBeTruthy();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it(`should have the 'demo-app' title`, () => {
|
|
18
|
+
const fixture = TestBed.createComponent(AppComponent);
|
|
19
|
+
const app = fixture.componentInstance;
|
|
20
|
+
expect(app.title).toEqual('demo-app');
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('should render title', () => {
|
|
24
|
+
const fixture = TestBed.createComponent(AppComponent);
|
|
25
|
+
fixture.detectChanges();
|
|
26
|
+
const compiled = fixture.nativeElement as HTMLElement;
|
|
27
|
+
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, demo-app');
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { RouterOutlet } from '@angular/router';
|
|
3
|
+
import { TextIgniterModule } from 'text-igniter';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'app-root',
|
|
7
|
+
imports: [RouterOutlet, TextIgniterModule],
|
|
8
|
+
templateUrl: './app.component.html',
|
|
9
|
+
styleUrl: './app.component.css'
|
|
10
|
+
})
|
|
11
|
+
export class AppComponent {
|
|
12
|
+
title = 'demo-app';
|
|
13
|
+
config = {
|
|
14
|
+
showToolbar: true,
|
|
15
|
+
features: [
|
|
16
|
+
'bold',
|
|
17
|
+
'italic',
|
|
18
|
+
'underline',
|
|
19
|
+
'hyperlink',
|
|
20
|
+
'fontFamily',
|
|
21
|
+
'fontSize',
|
|
22
|
+
'alignLeft',
|
|
23
|
+
'alignCenter',
|
|
24
|
+
'alignRight',
|
|
25
|
+
'unorderedList',
|
|
26
|
+
'orderedList',
|
|
27
|
+
'image',
|
|
28
|
+
'fontColor',
|
|
29
|
+
'bgColor',
|
|
30
|
+
'getHtmlContent',
|
|
31
|
+
'loadHtmlContent'
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
|
|
2
|
+
import { provideRouter } from '@angular/router';
|
|
3
|
+
|
|
4
|
+
import { routes } from './app.routes';
|
|
5
|
+
|
|
6
|
+
export const appConfig: ApplicationConfig = {
|
|
7
|
+
providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes)]
|
|
8
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { BrowserModule } from '@angular/platform-browser';
|
|
3
|
+
import { AppComponent } from './app.component';
|
|
4
|
+
import { TextIgniterModule } from '../../../text-igniter/src/public-api';
|
|
5
|
+
|
|
6
|
+
// Import your library module
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@NgModule({
|
|
10
|
+
declarations: [AppComponent],
|
|
11
|
+
imports: [
|
|
12
|
+
BrowserModule,
|
|
13
|
+
TextIgniterModule // Add your library module here
|
|
14
|
+
],
|
|
15
|
+
providers: [],
|
|
16
|
+
bootstrap: [AppComponent]
|
|
17
|
+
})
|
|
18
|
+
export class AppModule {}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>DemoApp</title>
|
|
6
|
+
<base href="/">
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
|
+
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<app-root></app-root>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* You can add global styles to this file, and also import other style files */
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"extends": "../../tsconfig.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"outDir": "../../out-tsc/app",
|
|
7
|
+
"types": []
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"src/main.ts"
|
|
11
|
+
],
|
|
12
|
+
"include": [
|
|
13
|
+
"src/**/*.d.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"extends": "../../tsconfig.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"outDir": "../../out-tsc/spec",
|
|
7
|
+
"types": [
|
|
8
|
+
"jasmine"
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"include": [
|
|
12
|
+
"src/**/*.spec.ts",
|
|
13
|
+
"src/**/*.d.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# TextIgniter
|
|
2
|
+
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.2.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ng generate component component-name
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
ng generate --help
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Building
|
|
20
|
+
|
|
21
|
+
To build the library, run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ng build text-igniter
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
|
28
|
+
|
|
29
|
+
### Publishing the Library
|
|
30
|
+
|
|
31
|
+
Once the project is built, you can publish your library by following these steps:
|
|
32
|
+
|
|
33
|
+
1. Navigate to the `dist` directory:
|
|
34
|
+
```bash
|
|
35
|
+
cd dist/text-igniter
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
2. Run the `npm publish` command to publish your library to the npm registry:
|
|
39
|
+
```bash
|
|
40
|
+
npm publish
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Running unit tests
|
|
44
|
+
|
|
45
|
+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
ng test
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Running end-to-end tests
|
|
52
|
+
|
|
53
|
+
For end-to-end (e2e) testing, run:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
ng e2e
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
60
|
+
|
|
61
|
+
## Additional Resources
|
|
62
|
+
|
|
63
|
+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
|
64
|
+
|
|
65
|
+
```javascript
|
|
66
|
+
//app.component.ts
|
|
67
|
+
import { Component } from '@angular/core';
|
|
68
|
+
import { RouterOutlet } from '@angular/router';
|
|
69
|
+
import { TextIgniterModule } from 'text-igniter';
|
|
70
|
+
|
|
71
|
+
@Component({
|
|
72
|
+
selector: 'app-root',
|
|
73
|
+
imports: [RouterOutlet, TextIgniterModule],
|
|
74
|
+
templateUrl: './app.component.html',
|
|
75
|
+
styleUrl: './app.component.css'
|
|
76
|
+
})
|
|
77
|
+
export class AppComponent {
|
|
78
|
+
title = 'demo-app';
|
|
79
|
+
config = {
|
|
80
|
+
showToolbar: true,
|
|
81
|
+
features: [
|
|
82
|
+
'bold',
|
|
83
|
+
'italic',
|
|
84
|
+
'underline',
|
|
85
|
+
'hyperlink',
|
|
86
|
+
'fontFamily',
|
|
87
|
+
'fontSize',
|
|
88
|
+
'alignLeft',
|
|
89
|
+
'alignCenter',
|
|
90
|
+
'alignRight',
|
|
91
|
+
'unorderedList',
|
|
92
|
+
'orderedList',
|
|
93
|
+
'image',
|
|
94
|
+
'fontColor',
|
|
95
|
+
'bgColor',
|
|
96
|
+
'getHtmlContent',
|
|
97
|
+
'loadHtmlContent'
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
```html
|
|
104
|
+
<!--app.component.html-->
|
|
105
|
+
<ngx-text-igniter [config]="config"></ngx-text-igniter>
|
|
106
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "text-igniter",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^19.2.0",
|
|
6
|
+
"@angular/core": "^19.2.0"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"tslib": "^2.3.0",
|
|
10
|
+
"@mindfiredigital/textigniter": "workspace:*"
|
|
11
|
+
},
|
|
12
|
+
"sideEffects": false
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<div [id]="editorId"></div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { TextIgniterComponent } from './text-igniter.component';
|
|
4
|
+
|
|
5
|
+
describe('TextIgniterComponent', () => {
|
|
6
|
+
let component: TextIgniterComponent;
|
|
7
|
+
let fixture: ComponentFixture<TextIgniterComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [TextIgniterComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(TextIgniterComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// import { Component } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
// @Component({
|
|
4
|
+
// selector: 'text-igniter',
|
|
5
|
+
// templateUrl: './text-igniter.component.html',
|
|
6
|
+
// styles: ``,
|
|
7
|
+
// standalone: false
|
|
8
|
+
// })
|
|
9
|
+
// export class TextIgniterComponent {
|
|
10
|
+
|
|
11
|
+
// }
|
|
12
|
+
|
|
13
|
+
import {
|
|
14
|
+
AfterViewInit,
|
|
15
|
+
Component,
|
|
16
|
+
Input,
|
|
17
|
+
OnChanges,
|
|
18
|
+
SimpleChanges,
|
|
19
|
+
} from '@angular/core';
|
|
20
|
+
|
|
21
|
+
import { TextIgniter } from '@mindfiredigital/textigniter/dist/TextIgniter';
|
|
22
|
+
|
|
23
|
+
@Component({
|
|
24
|
+
selector: 'ngx-text-igniter',
|
|
25
|
+
templateUrl: './text-igniter.component.html',
|
|
26
|
+
standalone: false,
|
|
27
|
+
})
|
|
28
|
+
export class TextIgniterComponent implements OnChanges, AfterViewInit {
|
|
29
|
+
@Input() config:
|
|
30
|
+
| {
|
|
31
|
+
showToolbar: boolean;
|
|
32
|
+
features: string[];
|
|
33
|
+
}
|
|
34
|
+
| undefined;
|
|
35
|
+
@Input() editorId: string | 'editor-ngId' = 'editor-ngId';
|
|
36
|
+
ngAfterViewInit(): void {
|
|
37
|
+
this.renderTable();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
ngOnChanges(changes: SimpleChanges): void {
|
|
41
|
+
if (changes['data'] && !changes['data'].firstChange) {
|
|
42
|
+
this.renderTable();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
private renderTable(): void {
|
|
47
|
+
if (this.editorId === 'editor') {
|
|
48
|
+
return console.log("editor-ngId can't be using name as id='editor' ");
|
|
49
|
+
}
|
|
50
|
+
if (this.config) {
|
|
51
|
+
new TextIgniter(this.editorId, this.config);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { TextIgniterComponent } from './text-igniter.component';
|
|
4
|
+
@NgModule({
|
|
5
|
+
declarations: [TextIgniterComponent],
|
|
6
|
+
imports: [CommonModule],
|
|
7
|
+
exports: [TextIgniterComponent],
|
|
8
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
9
|
+
})
|
|
10
|
+
export class TextIgniterModule { }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { TextIgniterService } from './text-igniter.service';
|
|
4
|
+
|
|
5
|
+
describe('TextIgniterService', () => {
|
|
6
|
+
let service: TextIgniterService;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
TestBed.configureTestingModule({});
|
|
10
|
+
service = TestBed.inject(TextIgniterService);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should be created', () => {
|
|
14
|
+
expect(service).toBeTruthy();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { bootstrapApplication } from '@angular/platform-browser';
|
|
2
|
+
import { TextIgniterComponent } from './lib/text-igniter.component';
|
|
3
|
+
|
|
4
|
+
import('@mindfiredigital/textigniter-web-component' as any)
|
|
5
|
+
.then(() => {
|
|
6
|
+
console.log('Web component loaded.');
|
|
7
|
+
// Then bootstrap Angular
|
|
8
|
+
bootstrapApplication(TextIgniterComponent)
|
|
9
|
+
})
|
|
10
|
+
.catch((err) => console.error(err));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Public API Surface of text-igniter
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export * from './lib/text-igniter.service';
|
|
6
|
+
export * from './lib/text-igniter.component';
|
|
7
|
+
export * from './lib/text-igniter.module';
|
|
8
|
+
// Import the web component to register it globally
|
|
9
|
+
import '@mindfiredigital/textigniter';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"extends": "../../tsconfig.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"outDir": "../../out-tsc/lib",
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"declarationMap": true,
|
|
9
|
+
"inlineSources": true,
|
|
10
|
+
"types": []
|
|
11
|
+
},
|
|
12
|
+
"exclude": [
|
|
13
|
+
"**/*.spec.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"extends": "./tsconfig.lib.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"declarationMap": false
|
|
7
|
+
},
|
|
8
|
+
"angularCompilerOptions": {
|
|
9
|
+
"compilationMode": "partial"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"extends": "../../tsconfig.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"outDir": "../../out-tsc/spec",
|
|
7
|
+
"types": [
|
|
8
|
+
"jasmine"
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"include": [
|
|
12
|
+
"**/*.spec.ts",
|
|
13
|
+
"**/*.d.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"compileOnSave": false,
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"outDir": "./dist/out-tsc",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noImplicitOverride": true,
|
|
9
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
10
|
+
"paths": {
|
|
11
|
+
"lib": [
|
|
12
|
+
"./dist/lib",
|
|
13
|
+
"./dist/lib"
|
|
14
|
+
],
|
|
15
|
+
"my-lib": [
|
|
16
|
+
"./dist/my-lib"
|
|
17
|
+
],
|
|
18
|
+
"text-igniter": [
|
|
19
|
+
"./dist/text-igniter"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"noImplicitReturns": true,
|
|
23
|
+
"noFallthroughCasesInSwitch": true,
|
|
24
|
+
"skipLibCheck": true,
|
|
25
|
+
"isolatedModules": true,
|
|
26
|
+
"esModuleInterop": true,
|
|
27
|
+
"experimentalDecorators": true,
|
|
28
|
+
"moduleResolution": "bundler",
|
|
29
|
+
"importHelpers": true,
|
|
30
|
+
"target": "ES2022",
|
|
31
|
+
"module": "ES2022"
|
|
32
|
+
},
|
|
33
|
+
"angularCompilerOptions": {
|
|
34
|
+
"enableI18nLegacyMessageIdFormat": false,
|
|
35
|
+
"strictInjectionParameters": true,
|
|
36
|
+
"strictInputAccessModifiers": true,
|
|
37
|
+
"strictTemplates": true
|
|
38
|
+
}
|
|
39
|
+
}
|