@aslaluroba/help-center 1.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.
Files changed (63) hide show
  1. package/.editorconfig +17 -0
  2. package/README.md +76 -0
  3. package/angular.json +106 -0
  4. package/ng-package.json +29 -0
  5. package/package-lock.json +16479 -0
  6. package/package.json +62 -0
  7. package/postcss.config.js +6 -0
  8. package/proxy.conf.json +4 -0
  9. package/public/Shape.png +0 -0
  10. package/public/favicon.ico +0 -0
  11. package/public_api.ts +5 -0
  12. package/src/app/app.component.html +336 -0
  13. package/src/app/app.component.scss +0 -0
  14. package/src/app/app.component.spec.ts +29 -0
  15. package/src/app/app.component.ts +59 -0
  16. package/src/app/app.config.ts +47 -0
  17. package/src/app/app.routes.ts +3 -0
  18. package/src/app/chat/chat.component.html +102 -0
  19. package/src/app/chat/chat.component.ts +88 -0
  20. package/src/app/help-center-widget/help-center-widget.component.html +224 -0
  21. package/src/app/help-center-widget/help-center-widget.component.scss +427 -0
  22. package/src/app/help-center-widget/help-center-widget.component.spec.ts +23 -0
  23. package/src/app/help-center-widget/help-center-widget.component.ts +446 -0
  24. package/src/app/help-center-widget/help-center.module.ts +15 -0
  25. package/src/app/help-screen-data/help-screen-data.component.html +46 -0
  26. package/src/app/help-screen-data/help-screen-data.component.ts +83 -0
  27. package/src/app/language.service.ts +17 -0
  28. package/src/app/services/api.service.ts +89 -0
  29. package/src/app/services/help-center-config.service.ts +16 -0
  30. package/src/app/services/signalrService.service.ts +104 -0
  31. package/src/app/services/token.service.ts +44 -0
  32. package/src/app/shared/components/button/button.component.ts +81 -0
  33. package/src/app/shared/components/button/index.ts +1 -0
  34. package/src/app/shared/components/card/card.component.ts +106 -0
  35. package/src/app/shared/components/card/index.ts +1 -0
  36. package/src/app/shared/components/confirmation-dialog/confirmation-dialog.component.ts +40 -0
  37. package/src/app/shared/components/header/header.component.ts +119 -0
  38. package/src/app/shared/components/header/index.ts +1 -0
  39. package/src/app/shared/components/loading/loading.component.ts +14 -0
  40. package/src/app/shared/utils/class-utils.ts +9 -0
  41. package/src/app/transloco-loader.ts +12 -0
  42. package/src/assets/i18n/ar.json +17 -0
  43. package/src/assets/i18n/en.json +17 -0
  44. package/src/assets/icons/arrow-stripped-colored.svg +3 -0
  45. package/src/assets/icons/arrow-stripped.svg +3 -0
  46. package/src/assets/icons/chat.svg +4 -0
  47. package/src/assets/icons/close-circle.svg +3 -0
  48. package/src/assets/icons/menu.svg +3 -0
  49. package/src/assets/icons/person.svg +4 -0
  50. package/src/assets/icons/send.svg +3 -0
  51. package/src/assets/images/animatedLogo.gif +0 -0
  52. package/src/assets/images/seperator.svg +5 -0
  53. package/src/assets/images/stars.svg +7 -0
  54. package/src/assets/logo-primary.svg +6 -0
  55. package/src/assets/logo-white.svg +6 -0
  56. package/src/index.html +13 -0
  57. package/src/main.ts +5 -0
  58. package/src/styles.scss +43 -0
  59. package/tailwind.config.ts +175 -0
  60. package/transloco.config.ts +9 -0
  61. package/tsconfig.app.json +15 -0
  62. package/tsconfig.json +31 -0
  63. package/tsconfig.spec.json +15 -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/README.md ADDED
@@ -0,0 +1,76 @@
1
+ # @babylai/help-center
2
+
3
+ A customizable help center widget for Angular applications that provides chat functionality and documentation support.
4
+
5
+ ## Installation
6
+
7
+ Install the package and its peer dependencies:
8
+
9
+ ```bash
10
+ npm install @babylai/help-center
11
+ ```
12
+
13
+ ### Markdown Support
14
+
15
+ This library uses [ngx-markdown](https://github.com/jfcere/ngx-markdown) for rendering markdown content. Please refer to their [official documentation](https://github.com/jfcere/ngx-markdown) for detailed installation and configuration instructions, including:
16
+
17
+ - Syntax highlighting with Prism.js
18
+ - Emoji support
19
+ - Math expression rendering with KaTeX
20
+ - Diagrams and charts with Mermaid
21
+ - Copy-to-clipboard functionality
22
+
23
+ ## Basic Usage
24
+
25
+ 1. Import the HelpCenterModule in your app.module.ts:
26
+
27
+ ```typescript
28
+ typescript
29
+ import { HelpCenterModule } from '@babylai/help-center'
30
+ @NgModule({
31
+ imports: [
32
+ // ... other imports
33
+ HelpCenterModule
34
+ ]
35
+ })
36
+ export class AppModule {}
37
+ ```
38
+
39
+ 2. Add the HelpCenterComponent to your template:
40
+ ```typescript
41
+ import { HelpCenterWidgetComponent } from '@babylai/help-center';
42
+
43
+ @Component({
44
+ selector: 'app-root',
45
+ imports: [RouterOutlet, HelpCenterWidgetComponent],
46
+ templateUrl: './app.component.html',
47
+ })
48
+ ```
49
+
50
+ ```html
51
+ <app-help-center-widget
52
+ [getToken]="getTokenFunction"
53
+ [helpScreenId]="yourHelpScreenId"
54
+ [user]="currentUser"
55
+ [showArrow]="true"
56
+ [messageLabel]="'Need help? Click here!'"
57
+ >
58
+ </app-help-center-widget>
59
+ ```
60
+
61
+ ## Configuration Options
62
+
63
+ The widget accepts the following inputs:
64
+
65
+ - `getToken`: () => Promise<string> - A function that returns a promise resolving to an authentication token
66
+ - `helpScreenId`: string - The ID of the help screen to display
67
+ - `user`: Object - (Optional) Current user information
68
+ ```typescript
69
+ {
70
+ id: string
71
+ name: string
72
+ email: string
73
+ }
74
+ ```
75
+ - `showArrow`: boolean - (Optional) Whether to show the attention arrow animation
76
+ - `messageLabel`: string - (Optional) Custom message for the arrow tooltip
package/angular.json ADDED
@@ -0,0 +1,106 @@
1
+ {
2
+ "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3
+ "version": 1,
4
+ "newProjectRoot": "projects",
5
+ "projects": {
6
+ "angular-help-center": {
7
+ "projectType": "application",
8
+ "schematics": {
9
+ "@schematics/angular:component": {
10
+ "style": "scss"
11
+ }
12
+ },
13
+ "root": "",
14
+ "sourceRoot": "src",
15
+ "prefix": "app",
16
+ "architect": {
17
+ "build": {
18
+ "builder": "@angular-devkit/build-angular:application",
19
+ "options": {
20
+ "outputPath": "dist/angular-help-center",
21
+ "index": "src/index.html",
22
+ "browser": "src/main.ts",
23
+ "polyfills": ["zone.js"],
24
+ "tsConfig": "tsconfig.app.json",
25
+ "inlineStyleLanguage": "scss",
26
+ "assets": [
27
+ {
28
+ "glob": "**/*",
29
+ "input": "public"
30
+ },
31
+ {
32
+ "glob": "**/*",
33
+ "input": "src/assets"
34
+ }
35
+ ],
36
+ "styles": ["src/styles.scss"],
37
+ "scripts": []
38
+ },
39
+ "configurations": {
40
+ "production": {
41
+ "budgets": [
42
+ {
43
+ "type": "initial",
44
+ "maximumWarning": "500kB",
45
+ "maximumError": "1MB"
46
+ },
47
+ {
48
+ "type": "anyComponentStyle",
49
+ "maximumWarning": "4kB",
50
+ "maximumError": "8kB"
51
+ }
52
+ ],
53
+ "outputHashing": "all"
54
+ },
55
+ "development": {
56
+ "optimization": false,
57
+ "extractLicenses": false,
58
+ "sourceMap": true
59
+ }
60
+ },
61
+ "defaultConfiguration": "production"
62
+ },
63
+ "serve": {
64
+ "builder": "@angular-devkit/build-angular:dev-server",
65
+ "options": {
66
+ "proxyConfig": "proxy.conf.json",
67
+ "port": 3000
68
+ },
69
+ "configurations": {
70
+ "production": {
71
+ "buildTarget": "angular-help-center:build:production"
72
+ },
73
+ "development": {
74
+ "buildTarget": "angular-help-center:build:development"
75
+ }
76
+ },
77
+ "defaultConfiguration": "development"
78
+ },
79
+ "extract-i18n": {
80
+ "builder": "@angular-devkit/build-angular:extract-i18n"
81
+ },
82
+ "test": {
83
+ "builder": "@angular-devkit/build-angular:karma",
84
+ "options": {
85
+ "polyfills": ["zone.js", "zone.js/testing"],
86
+ "tsConfig": "tsconfig.spec.json",
87
+ "inlineStyleLanguage": "scss",
88
+ "assets": [
89
+ "src/assets",
90
+ {
91
+ "glob": "**/*",
92
+ "input": "public"
93
+ },
94
+ {
95
+ "glob": "**/*",
96
+ "input": "src/assets"
97
+ }
98
+ ],
99
+ "styles": ["src/styles.scss"],
100
+ "scripts": []
101
+ }
102
+ }
103
+ }
104
+ }
105
+ }
106
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "$schema": "./node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "./dist/help-center",
4
+ "lib": {
5
+ "entryFile": "./public_api.ts"
6
+ },
7
+ "allowedNonPeerDependencies": [
8
+ "@angular/animations",
9
+ "@angular/common",
10
+ "@angular/compiler",
11
+ "@angular/core",
12
+ "@angular/forms",
13
+ "@angular/platform-browser",
14
+ "@angular/platform-browser-dynamic",
15
+ "@angular/router",
16
+ "@jsverse/transloco",
17
+ "@microsoft/signalr",
18
+ "clsx",
19
+ "marked",
20
+ "ngx-markdown",
21
+ "prismjs",
22
+ "rxjs",
23
+ "tailwind-merge",
24
+ "tailwindcss-animate",
25
+ "tailwindcss-rtl",
26
+ "tslib",
27
+ "zone.js"
28
+ ]
29
+ }