@aakash58/chatbot 1.1.20 → 1.1.21
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/.vscode/extensions.json +4 -0
- package/.vscode/launch.json +41 -0
- package/.vscode/settings.json +14 -0
- package/.vscode/tasks.json +60 -0
- package/README.md +298 -22
- package/angular.json +132 -0
- package/docs/PUBLISHING_GUIDE.md +104 -0
- package/package.json +75 -29
- package/projects/app-doohbot/public/assets/const/app-const.json +15 -0
- package/projects/app-doohbot/public/assets/const/doohclick_license.json +6 -0
- package/projects/app-doohbot/public/favicon.ico +0 -0
- package/projects/app-doohbot/src/app/app.config.ts +13 -0
- package/projects/app-doohbot/src/app/app.html +31 -0
- package/projects/app-doohbot/src/app/app.routes.ts +3 -0
- package/projects/app-doohbot/src/app/app.scss +279 -0
- package/projects/app-doohbot/src/app/app.spec.ts +23 -0
- package/projects/app-doohbot/src/app/app.ts +72 -0
- package/projects/app-doohbot/src/index.html +15 -0
- package/projects/app-doohbot/src/main.ts +6 -0
- package/projects/app-doohbot/src/styles.scss +15 -0
- package/projects/app-doohbot/tsconfig.app.json +15 -0
- package/projects/app-doohbot/tsconfig.spec.json +14 -0
- package/projects/doohbot/README.md +64 -0
- package/projects/doohbot/docs/README.md +140 -0
- package/projects/doohbot/ng-package.json +10 -0
- package/projects/doohbot/package.json +16 -0
- package/projects/doohbot/src/lib/app/chat/chat-ui-state.service.ts +194 -0
- package/projects/doohbot/src/lib/app/chat/chat.service.ts +547 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-button/chat-button.component.html +27 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-button/chat-button.component.scss +115 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-button/chat-button.component.ts +35 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-footer/chat-footer.component.html +3 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-footer/chat-footer.component.scss +20 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-footer/chat-footer.component.ts +12 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-header/chat-header.component.html +34 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-header/chat-header.component.scss +78 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-header/chat-header.component.ts +52 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.html +77 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.scss +346 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.ts +188 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-window/chat-window.component.html +146 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-window/chat-window.component.scss +187 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-window/chat-window.component.ts +256 -0
- package/projects/doohbot/src/lib/app/chat/components/message-input/message-input.component.html +17 -0
- package/projects/doohbot/src/lib/app/chat/components/message-input/message-input.component.scss +59 -0
- package/projects/doohbot/src/lib/app/chat/components/message-input/message-input.component.ts +28 -0
- package/projects/doohbot/src/lib/app/chat/components/message-list/message-list.component.html +138 -0
- package/projects/doohbot/src/lib/app/chat/components/message-list/message-list.component.scss +436 -0
- package/projects/doohbot/src/lib/app/chat/components/message-list/message-list.component.ts +106 -0
- package/projects/doohbot/src/lib/app/chat/model/chat-history.model.ts +57 -0
- package/projects/doohbot/src/lib/app/chat/model/chat-request.model.ts +17 -0
- package/projects/doohbot/src/lib/app/chat/model/chat-response.model.ts +9 -0
- package/projects/doohbot/src/lib/app/chat/model/chat-session.model.ts +14 -0
- package/{lib/app/chat/model/chat-stream-message.model.d.ts → projects/doohbot/src/lib/app/chat/model/chat-stream-message.model.ts} +6 -5
- package/projects/doohbot/src/lib/app/chat/model/chat-stream-response.model.ts +12 -0
- package/projects/doohbot/src/lib/app/chat/services/chat-api.service.ts +82 -0
- package/projects/doohbot/src/lib/app/chat/services/chat-audio.service.ts +44 -0
- package/projects/doohbot/src/lib/app/chat/services/chat-history.service.ts +303 -0
- package/projects/doohbot/src/lib/app/login/login-form.component.html +80 -0
- package/projects/doohbot/src/lib/app/login/login-form.component.scss +189 -0
- package/projects/doohbot/src/lib/app/login/login-form.component.ts +45 -0
- package/projects/doohbot/src/lib/app/personalization/personalization-dialog.component.html +81 -0
- package/projects/doohbot/src/lib/app/personalization/personalization-dialog.component.scss +179 -0
- package/projects/doohbot/src/lib/app/personalization/personalization-dialog.component.ts +217 -0
- package/projects/doohbot/src/lib/app/personalization/personalization.service.ts +197 -0
- package/projects/doohbot/src/lib/app/personalization/sections/account/account-section.component.html +111 -0
- package/projects/doohbot/src/lib/app/personalization/sections/account/account-section.component.scss +218 -0
- package/projects/doohbot/src/lib/app/personalization/sections/account/account-section.component.ts +121 -0
- package/projects/doohbot/src/lib/app/personalization/sections/instructions/instructions-section.component.html +46 -0
- package/projects/doohbot/src/lib/app/personalization/sections/instructions/instructions-section.component.scss +138 -0
- package/projects/doohbot/src/lib/app/personalization/sections/instructions/instructions-section.component.ts +28 -0
- package/projects/doohbot/src/lib/app/personalization/sections/preferences/color-picker-dialog.component.ts +92 -0
- package/projects/doohbot/src/lib/app/personalization/sections/preferences/preferences-section.component.html +198 -0
- package/projects/doohbot/src/lib/app/personalization/sections/preferences/preferences-section.component.scss +107 -0
- package/projects/doohbot/src/lib/app/personalization/sections/preferences/preferences-section.component.ts +103 -0
- package/projects/doohbot/src/lib/app/personalization/sections/profile/profile-section.component.html +46 -0
- package/projects/doohbot/src/lib/app/personalization/sections/profile/profile-section.component.scss +131 -0
- package/projects/doohbot/src/lib/app/personalization/sections/profile/profile-section.component.ts +23 -0
- package/projects/doohbot/src/lib/app/personalization/sections/settings/setting-section.component.html +33 -0
- package/projects/doohbot/src/lib/app/personalization/sections/settings/setting-section.component.scss +61 -0
- package/projects/doohbot/src/lib/app/personalization/sections/settings/setting-section.component.ts +20 -0
- package/projects/doohbot/src/lib/app/personalization/sections/terms/terms-section.component.html +30 -0
- package/projects/doohbot/src/lib/app/personalization/sections/terms/terms-section.component.scss +59 -0
- package/projects/doohbot/src/lib/app/personalization/sections/terms/terms-section.component.ts +12 -0
- package/projects/doohbot/src/lib/constant/doohbot-constant.ts +40 -0
- package/projects/doohbot/src/lib/constant/html-entities.ts +8 -0
- package/projects/doohbot/src/lib/constant/utf8.ts +9 -0
- package/projects/doohbot/src/lib/core/app-const.ts +63 -0
- package/projects/doohbot/src/lib/core/auth/account-api.service.ts +53 -0
- package/projects/doohbot/src/lib/core/auth/auth.service.ts +478 -0
- package/projects/doohbot/src/lib/core/auth/models/auth-result.model.ts +4 -0
- package/projects/doohbot/src/lib/core/auth/models/federated-login-request.model.ts +5 -0
- package/projects/doohbot/src/lib/core/auth/models/login-request.model.ts +6 -0
- package/projects/doohbot/src/lib/core/auth/storage.service.ts +113 -0
- package/projects/doohbot/src/lib/core/directives/draggable/draggable-dialog.directive.ts +123 -0
- package/projects/doohbot/src/lib/core/directives/draggable/draggable-dialog.module.ts +9 -0
- package/projects/doohbot/src/lib/core/directives/fullscreen/fullscreen.directive.ts +58 -0
- package/projects/doohbot/src/lib/core/directives/fullscreen/fullscreen.module.ts +9 -0
- package/projects/doohbot/src/lib/core/directives/popout/popout.directive.ts +169 -0
- package/projects/doohbot/src/lib/core/directives/popout/popout.module.ts +9 -0
- package/projects/doohbot/src/lib/core/directives/resizable/resizable-dialog.directive.ts +197 -0
- package/projects/doohbot/src/lib/core/directives/resizable/resizable-dialog.module.ts +9 -0
- package/projects/doohbot/src/lib/core/enums/api-request-state.enum.ts +9 -0
- package/projects/doohbot/src/lib/core/environments/environment.prod.ts +14 -0
- package/projects/doohbot/src/lib/core/environments/environment.ts +14 -0
- package/projects/doohbot/src/lib/core/helpers/crypto-helper.service.ts +72 -0
- package/projects/doohbot/src/lib/core/http/http-stream.service.ts +105 -0
- package/projects/doohbot/src/lib/core/http/http.service.ts +148 -0
- package/projects/doohbot/src/lib/core/interceptors/auth.interceptor.ts +118 -0
- package/projects/doohbot/src/lib/core/interceptors/license.interceptor.ts +50 -0
- package/projects/doohbot/src/lib/core/models/api-config.model.ts +82 -0
- package/projects/doohbot/src/lib/core/models/api-request.model.ts +92 -0
- package/projects/doohbot/src/lib/core/models/api-response.model.ts +13 -0
- package/projects/doohbot/src/lib/core/models/doohbot-config.model.ts +109 -0
- package/{lib/core/models/license.model.d.ts → projects/doohbot/src/lib/core/models/license.model.ts} +27 -23
- package/projects/doohbot/src/lib/core/models/message.ts +18 -0
- package/projects/doohbot/src/lib/core/models/theme-config.model.ts +48 -0
- package/projects/doohbot/src/lib/core/services/core-config.service.ts +53 -0
- package/projects/doohbot/src/lib/core/services/doohbot-api.service.ts +207 -0
- package/projects/doohbot/src/lib/core/services/license.service.ts +171 -0
- package/projects/doohbot/src/lib/core/services/markdown.service.ts +73 -0
- package/projects/doohbot/src/lib/core/services/theme.service.ts +305 -0
- package/{lib/core/types/auth-mode.type.d.ts → projects/doohbot/src/lib/core/types/auth-mode.type.ts} +4 -4
- package/{lib/core/types/auth-status.type.d.ts → projects/doohbot/src/lib/core/types/auth-status.type.ts} +5 -4
- package/{lib/core/types/chat-stream.type.d.ts → projects/doohbot/src/lib/core/types/chat-stream.type.ts} +4 -4
- package/{lib/core/types/message-role.type.d.ts → projects/doohbot/src/lib/core/types/message-role.type.ts} +4 -4
- package/{lib/core/types/prompt-mode.type.d.ts → projects/doohbot/src/lib/core/types/prompt-mode.type.ts} +5 -4
- package/{lib/core/types/snackbar-error.type.d.ts → projects/doohbot/src/lib/core/types/snackbar-error.type.ts} +5 -4
- package/{lib/core/types/tenant-resolution-strategy.type.d.ts → projects/doohbot/src/lib/core/types/tenant-resolution-strategy.type.ts} +4 -4
- package/projects/doohbot/src/lib/core/utils/error-handler.util.ts +31 -0
- package/projects/doohbot/src/lib/core/utils/logger.service.ts +45 -0
- package/projects/doohbot/src/lib/doohbot-input.ts +19 -0
- package/projects/doohbot/src/lib/doohbot.component.html +34 -0
- package/projects/doohbot/src/lib/doohbot.component.scss +17 -0
- package/projects/doohbot/src/lib/doohbot.component.spec.ts +31 -0
- package/projects/doohbot/src/lib/doohbot.component.ts +545 -0
- package/projects/doohbot/src/lib/elements.ts +25 -0
- package/projects/doohbot/src/lib/predefined_messages.ts +14 -0
- package/projects/doohbot/src/lib/shared/chips/chips.component.html +9 -0
- package/projects/doohbot/src/lib/shared/chips/chips.component.scss +29 -0
- package/projects/doohbot/src/lib/shared/chips/chips.component.spec.ts +22 -0
- package/projects/doohbot/src/lib/shared/chips/chips.component.ts +20 -0
- package/projects/doohbot/src/lib/shared/dialog/dialog.component.html +29 -0
- package/projects/doohbot/src/lib/shared/dialog/dialog.component.scss +100 -0
- package/projects/doohbot/src/lib/shared/dialog/dialog.component.ts +42 -0
- package/projects/doohbot/src/lib/shared/dialog/dialog.service.ts +62 -0
- package/projects/doohbot/src/lib/shared/dialog/dialog.utils.ts +102 -0
- package/projects/doohbot/src/lib/shared/dropdown-menu/dropdown-menu.component.html +30 -0
- package/projects/doohbot/src/lib/shared/dropdown-menu/dropdown-menu.component.scss +53 -0
- package/projects/doohbot/src/lib/shared/dropdown-menu/dropdown-menu.component.spec.ts +22 -0
- package/projects/doohbot/src/lib/shared/dropdown-menu/dropdown-menu.component.ts +35 -0
- package/projects/doohbot/src/lib/shared/input-dialog/input-dialog.component.html +16 -0
- package/projects/doohbot/src/lib/shared/input-dialog/input-dialog.component.scss +45 -0
- package/projects/doohbot/src/lib/shared/input-dialog/input-dialog.component.ts +46 -0
- package/projects/doohbot/src/lib/shared/menu-item/menu-item.component.html +5 -0
- package/projects/doohbot/src/lib/shared/menu-item/menu-item.component.scss +0 -0
- package/projects/doohbot/src/lib/shared/menu-item/menu-item.component.spec.ts +22 -0
- package/projects/doohbot/src/lib/shared/menu-item/menu-item.component.ts +20 -0
- package/projects/doohbot/src/lib/shared/pipes/simple-markdown.pipe.ts +19 -0
- package/projects/doohbot/src/lib/shared/popout/popout.html +1 -0
- package/projects/doohbot/src/lib/shared/popout/popout.scss +0 -0
- package/projects/doohbot/src/lib/shared/popout/popout.spec.ts +23 -0
- package/projects/doohbot/src/lib/shared/popout/popout.ts +11 -0
- package/projects/doohbot/src/lib/shared/snackbar/snackbar.component.html +7 -0
- package/projects/doohbot/src/lib/shared/snackbar/snackbar.component.scss +125 -0
- package/projects/doohbot/src/lib/shared/snackbar/snackbar.component.spec.ts +21 -0
- package/projects/doohbot/src/lib/shared/snackbar/snackbar.component.ts +44 -0
- package/projects/doohbot/src/lib/shared/snackbar/snackbar.service.ts +54 -0
- package/{lib/shared/snackbar/snackbar.utils.d.ts → projects/doohbot/src/lib/shared/snackbar/snackbar.utils.ts} +49 -33
- package/projects/doohbot/src/lib/styles/_theme.scss +132 -0
- package/projects/doohbot/src/lib/styles/material-override.scss +302 -0
- package/projects/doohbot/src/lib/styles/utility.scss +588 -0
- package/projects/doohbot/src/public-api.ts +42 -0
- package/projects/doohbot/tsconfig.lib.json +15 -0
- package/projects/doohbot/tsconfig.lib.prod.json +11 -0
- package/projects/doohbot/tsconfig.spec.json +10 -0
- package/proxy.conf.json +8 -0
- package/publish.config.js +25 -0
- package/scripts/publishing/index.ts +67 -0
- package/scripts/publishing/pipeline/01-clean.ts +11 -0
- package/scripts/publishing/pipeline/02-validate-pre.ts +8 -0
- package/scripts/publishing/pipeline/03-build.ts +7 -0
- package/scripts/publishing/pipeline/04-validate-post.ts +8 -0
- package/scripts/publishing/pipeline/05-prepare-package.ts +29 -0
- package/scripts/publishing/pipeline/06-version.ts +23 -0
- package/scripts/publishing/pipeline/07-publish.ts +14 -0
- package/scripts/publishing/pipeline/08-cleanup.ts +5 -0
- package/scripts/publishing/types.ts +36 -0
- package/scripts/publishing/utils/command.ts +15 -0
- package/scripts/publishing/utils/config.ts +17 -0
- package/scripts/validate.ts +166 -0
- package/tsconfig.json +45 -0
- package/tsconfig.scripts.json +15 -0
- package/esm2022/aakash58-chatbot.mjs +0 -5
- package/esm2022/lib/app/chat/chat-ui-state.service.mjs +0 -170
- package/esm2022/lib/app/chat/chat.service.mjs +0 -445
- package/esm2022/lib/app/chat/components/chat-button/chat-button.component.mjs +0 -50
- package/esm2022/lib/app/chat/components/chat-footer/chat-footer.component.mjs +0 -12
- package/esm2022/lib/app/chat/components/chat-header/chat-header.component.mjs +0 -66
- package/esm2022/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.mjs +0 -186
- package/esm2022/lib/app/chat/components/chat-window/chat-window.component.mjs +0 -312
- package/esm2022/lib/app/chat/components/message-input/message-input.component.mjs +0 -36
- package/esm2022/lib/app/chat/components/message-list/message-list.component.mjs +0 -115
- package/esm2022/lib/app/chat/model/chat-history.model.mjs +0 -2
- package/esm2022/lib/app/chat/model/chat-request.model.mjs +0 -2
- package/esm2022/lib/app/chat/model/chat-response.model.mjs +0 -2
- package/esm2022/lib/app/chat/model/chat-session.model.mjs +0 -2
- package/esm2022/lib/app/chat/model/chat-stream-message.model.mjs +0 -2
- package/esm2022/lib/app/chat/model/chat-stream-response.model.mjs +0 -2
- package/esm2022/lib/app/chat/services/chat-api.service.mjs +0 -61
- package/esm2022/lib/app/chat/services/chat-audio.service.mjs +0 -50
- package/esm2022/lib/app/chat/services/chat-history.service.mjs +0 -252
- package/esm2022/lib/app/login/login-form.component.mjs +0 -46
- package/esm2022/lib/app/personalization/personalization-dialog.component.mjs +0 -194
- package/esm2022/lib/app/personalization/personalization.service.mjs +0 -149
- package/esm2022/lib/app/personalization/sections/account/account-section.component.mjs +0 -122
- package/esm2022/lib/app/personalization/sections/preferences/color-picker-dialog.component.mjs +0 -86
- package/esm2022/lib/app/personalization/sections/preferences/preferences-section.component.mjs +0 -115
- package/esm2022/lib/app/personalization/sections/profile/profile-section.component.mjs +0 -29
- package/esm2022/lib/app/personalization/sections/settings/setting-section.component.mjs +0 -30
- package/esm2022/lib/app/personalization/sections/terms/terms-section.component.mjs +0 -12
- package/esm2022/lib/constant/doohbot-constant.mjs +0 -28
- package/esm2022/lib/constant/html-entities.mjs +0 -9
- package/esm2022/lib/constant/utf8.mjs +0 -10
- package/esm2022/lib/core/app-const.mjs +0 -61
- package/esm2022/lib/core/auth/account-api.service.mjs +0 -40
- package/esm2022/lib/core/auth/auth.service.mjs +0 -391
- package/esm2022/lib/core/auth/models/auth-result.model.mjs +0 -3
- package/esm2022/lib/core/auth/models/federated-login-request.model.mjs +0 -6
- package/esm2022/lib/core/auth/models/login-request.model.mjs +0 -6
- package/esm2022/lib/core/auth/storage.service.mjs +0 -110
- package/esm2022/lib/core/directives/draggable/draggable-dialog.directive.mjs +0 -112
- package/esm2022/lib/core/directives/fullscreen/fullscreen.directive.mjs +0 -55
- package/esm2022/lib/core/directives/resizable/resizable-dialog.directive.mjs +0 -179
- package/esm2022/lib/core/environments/environment.mjs +0 -15
- package/esm2022/lib/core/environments/environment.prod.mjs +0 -15
- package/esm2022/lib/core/helpers/crypto-helper.service.mjs +0 -52
- package/esm2022/lib/core/http/http-stream.service.mjs +0 -97
- package/esm2022/lib/core/http/http.service.mjs +0 -103
- package/esm2022/lib/core/interceptors/auth.interceptor.mjs +0 -96
- package/esm2022/lib/core/interceptors/license.interceptor.mjs +0 -44
- package/esm2022/lib/core/models/api-config.model.mjs +0 -18
- package/esm2022/lib/core/models/api-request.model.mjs +0 -2
- package/esm2022/lib/core/models/api-response.model.mjs +0 -8
- package/esm2022/lib/core/models/doohbot-config.model.mjs +0 -18
- package/esm2022/lib/core/models/license.model.mjs +0 -2
- package/esm2022/lib/core/models/message.mjs +0 -2
- package/esm2022/lib/core/models/theme-config.model.mjs +0 -2
- package/esm2022/lib/core/services/core-config.service.mjs +0 -52
- package/esm2022/lib/core/services/license.service.mjs +0 -145
- package/esm2022/lib/core/services/markdown.service.mjs +0 -64
- package/esm2022/lib/core/services/theme.service.mjs +0 -248
- package/esm2022/lib/core/types/auth-mode.type.mjs +0 -2
- package/esm2022/lib/core/types/auth-status.type.mjs +0 -5
- package/esm2022/lib/core/types/chat-stream.type.mjs +0 -2
- package/esm2022/lib/core/types/message-role.type.mjs +0 -2
- package/esm2022/lib/core/types/prompt-mode.type.mjs +0 -5
- package/esm2022/lib/core/types/snackbar-error.type.mjs +0 -5
- package/esm2022/lib/core/types/tenant-resolution-strategy.type.mjs +0 -2
- package/esm2022/lib/core/utils/logger.service.mjs +0 -42
- package/esm2022/lib/doohbot-input.mjs +0 -20
- package/esm2022/lib/doohbot.component.mjs +0 -444
- package/esm2022/lib/predefined_messages.mjs +0 -15
- package/esm2022/lib/shared/chips/chips.component.mjs +0 -28
- package/esm2022/lib/shared/dialog/dialog.component.mjs +0 -36
- package/esm2022/lib/shared/dialog/dialog.service.mjs +0 -64
- package/esm2022/lib/shared/dialog/dialog.utils.mjs +0 -85
- package/esm2022/lib/shared/dropdown-menu/dropdown-menu.component.mjs +0 -29
- package/esm2022/lib/shared/input-dialog/input-dialog.component.mjs +0 -38
- package/esm2022/lib/shared/menu-item/menu-item.component.mjs +0 -24
- package/esm2022/lib/shared/pipes/simple-markdown.pipe.mjs +0 -27
- package/esm2022/lib/shared/snackbar/snackbar.component.mjs +0 -43
- package/esm2022/lib/shared/snackbar/snackbar.service.mjs +0 -46
- package/esm2022/lib/shared/snackbar/snackbar.utils.mjs +0 -43
- package/esm2022/public-api.mjs +0 -37
- package/fesm2022/aakash58-chatbot.mjs +0 -5193
- package/fesm2022/aakash58-chatbot.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/app/chat/chat-ui-state.service.d.ts +0 -96
- package/lib/app/chat/chat.service.d.ts +0 -88
- package/lib/app/chat/components/chat-button/chat-button.component.d.ts +0 -16
- package/lib/app/chat/components/chat-footer/chat-footer.component.d.ts +0 -5
- package/lib/app/chat/components/chat-header/chat-header.component.d.ts +0 -24
- package/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.d.ts +0 -49
- package/lib/app/chat/components/chat-window/chat-window.component.d.ts +0 -107
- package/lib/app/chat/components/message-input/message-input.component.d.ts +0 -12
- package/lib/app/chat/components/message-list/message-list.component.d.ts +0 -40
- package/lib/app/chat/model/chat-history.model.d.ts +0 -51
- package/lib/app/chat/model/chat-request.model.d.ts +0 -10
- package/lib/app/chat/model/chat-response.model.d.ts +0 -9
- package/lib/app/chat/model/chat-session.model.d.ts +0 -12
- package/lib/app/chat/model/chat-stream-response.model.d.ts +0 -10
- package/lib/app/chat/services/chat-api.service.d.ts +0 -30
- package/lib/app/chat/services/chat-audio.service.d.ts +0 -19
- package/lib/app/chat/services/chat-history.service.d.ts +0 -53
- package/lib/app/login/login-form.component.d.ts +0 -20
- package/lib/app/personalization/personalization-dialog.component.d.ts +0 -53
- package/lib/app/personalization/personalization.service.d.ts +0 -66
- package/lib/app/personalization/sections/account/account-section.component.d.ts +0 -30
- package/lib/app/personalization/sections/preferences/color-picker-dialog.component.d.ts +0 -17
- package/lib/app/personalization/sections/preferences/preferences-section.component.d.ts +0 -27
- package/lib/app/personalization/sections/profile/profile-section.component.d.ts +0 -17
- package/lib/app/personalization/sections/settings/setting-section.component.d.ts +0 -10
- package/lib/app/personalization/sections/terms/terms-section.component.d.ts +0 -5
- package/lib/constant/doohbot-constant.d.ts +0 -12
- package/lib/constant/html-entities.d.ts +0 -8
- package/lib/constant/utf8.d.ts +0 -9
- package/lib/core/app-const.d.ts +0 -11
- package/lib/core/auth/account-api.service.d.ts +0 -20
- package/lib/core/auth/auth.service.d.ts +0 -90
- package/lib/core/auth/models/auth-result.model.d.ts +0 -4
- package/lib/core/auth/models/federated-login-request.model.d.ts +0 -5
- package/lib/core/auth/models/login-request.model.d.ts +0 -6
- package/lib/core/auth/storage.service.d.ts +0 -21
- package/lib/core/directives/draggable/draggable-dialog.directive.d.ts +0 -23
- package/lib/core/directives/fullscreen/fullscreen.directive.d.ts +0 -14
- package/lib/core/directives/resizable/resizable-dialog.directive.d.ts +0 -30
- package/lib/core/environments/environment.d.ts +0 -7
- package/lib/core/environments/environment.prod.d.ts +0 -7
- package/lib/core/helpers/crypto-helper.service.d.ts +0 -12
- package/lib/core/http/http-stream.service.d.ts +0 -18
- package/lib/core/http/http.service.d.ts +0 -20
- package/lib/core/interceptors/auth.interceptor.d.ts +0 -18
- package/lib/core/interceptors/license.interceptor.d.ts +0 -11
- package/lib/core/models/api-config.model.d.ts +0 -58
- package/lib/core/models/api-request.model.d.ts +0 -77
- package/lib/core/models/api-response.model.d.ts +0 -6
- package/lib/core/models/doohbot-config.model.d.ts +0 -81
- package/lib/core/models/message.d.ts +0 -16
- package/lib/core/models/theme-config.model.d.ts +0 -28
- package/lib/core/services/core-config.service.d.ts +0 -23
- package/lib/core/services/license.service.d.ts +0 -33
- package/lib/core/services/markdown.service.d.ts +0 -8
- package/lib/core/services/theme.service.d.ts +0 -40
- package/lib/core/utils/logger.service.d.ts +0 -11
- package/lib/doohbot-input.d.ts +0 -19
- package/lib/doohbot.component.d.ts +0 -108
- package/lib/predefined_messages.d.ts +0 -2
- package/lib/shared/chips/chips.component.d.ts +0 -10
- package/lib/shared/dialog/dialog.component.d.ts +0 -19
- package/lib/shared/dialog/dialog.service.d.ts +0 -29
- package/lib/shared/dialog/dialog.utils.d.ts +0 -41
- package/lib/shared/dropdown-menu/dropdown-menu.component.d.ts +0 -11
- package/lib/shared/input-dialog/input-dialog.component.d.ts +0 -20
- package/lib/shared/menu-item/menu-item.component.d.ts +0 -9
- package/lib/shared/pipes/simple-markdown.pipe.d.ts +0 -10
- package/lib/shared/snackbar/snackbar.component.d.ts +0 -14
- package/lib/shared/snackbar/snackbar.service.d.ts +0 -19
- package/public-api.d.ts +0 -11
- /package/{src → projects/doohbot/src}/assets/bot.mp3 +0 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { Injectable, signal, inject, effect } from '@angular/core';
|
|
2
|
+
import { StorageService } from '../../core/auth/storage.service';
|
|
3
|
+
import { AuthService } from '../../core/auth/auth.service';
|
|
4
|
+
import { toSignal } from '@angular/core/rxjs-interop';
|
|
5
|
+
|
|
6
|
+
export interface Characteristics {
|
|
7
|
+
warm: string;
|
|
8
|
+
enthusiastic: string;
|
|
9
|
+
headersAndLists: string;
|
|
10
|
+
emoji: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface AboutYou {
|
|
14
|
+
nickname: string;
|
|
15
|
+
occupation: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface CustomInstructions {
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
aboutUser: string;
|
|
21
|
+
responseStyle: string;
|
|
22
|
+
characteristics: Characteristics;
|
|
23
|
+
aboutYou: AboutYou;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface AppearanceSettings {
|
|
27
|
+
theme: 'light' | 'dark' | 'auto';
|
|
28
|
+
primaryColor: string;
|
|
29
|
+
buttonStyle: 'fab' | 'sidebar' | 'sidebar-top' | 'sidebar-bottom';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface PersonalizationSettings {
|
|
33
|
+
customInstructions: CustomInstructions;
|
|
34
|
+
appearance: AppearanceSettings;
|
|
35
|
+
meta: {
|
|
36
|
+
version: number;
|
|
37
|
+
lastUpdated: number;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const BASE_STORAGE_KEY = 'app.personalization.v1';
|
|
42
|
+
|
|
43
|
+
const DEFAULT_SETTINGS: PersonalizationSettings = {
|
|
44
|
+
customInstructions: {
|
|
45
|
+
enabled: false,
|
|
46
|
+
aboutUser: '',
|
|
47
|
+
responseStyle: '',
|
|
48
|
+
characteristics: {
|
|
49
|
+
warm: 'Default',
|
|
50
|
+
enthusiastic: 'Default',
|
|
51
|
+
headersAndLists: 'Default',
|
|
52
|
+
emoji: 'Default',
|
|
53
|
+
},
|
|
54
|
+
aboutYou: {
|
|
55
|
+
nickname: '',
|
|
56
|
+
occupation: '',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
appearance: {
|
|
60
|
+
theme: 'auto',
|
|
61
|
+
primaryColor: 'default', // Standard primary color (resolves to developer default)
|
|
62
|
+
buttonStyle: 'fab',
|
|
63
|
+
},
|
|
64
|
+
meta: {
|
|
65
|
+
version: 1,
|
|
66
|
+
lastUpdated: Date.now(),
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
@Injectable({
|
|
71
|
+
providedIn: 'root',
|
|
72
|
+
})
|
|
73
|
+
export class PersonalizationService {
|
|
74
|
+
private storage = inject(StorageService);
|
|
75
|
+
private authService = inject(AuthService);
|
|
76
|
+
|
|
77
|
+
// Reactive Authentication Status
|
|
78
|
+
private authStatus = toSignal(this.authService.authStatus$);
|
|
79
|
+
|
|
80
|
+
// State Signals
|
|
81
|
+
private _settings = signal<PersonalizationSettings>(DEFAULT_SETTINGS);
|
|
82
|
+
public settings = this._settings.asReadonly();
|
|
83
|
+
|
|
84
|
+
// Developer-provided defaults (from DoohbotInput)
|
|
85
|
+
private _developerDefaults = signal<Partial<AppearanceSettings>>({});
|
|
86
|
+
public readonly developerDefaults = this._developerDefaults.asReadonly();
|
|
87
|
+
|
|
88
|
+
constructor() {
|
|
89
|
+
// Reload settings when auth status changes (user logins or logouts)
|
|
90
|
+
effect(
|
|
91
|
+
() => {
|
|
92
|
+
const status = this.authStatus();
|
|
93
|
+
this._settings.set(this.loadSettings());
|
|
94
|
+
},
|
|
95
|
+
{ allowSignalWrites: true }, // TODO
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
// Automatically persist changes when settings signal updates
|
|
99
|
+
effect(() => {
|
|
100
|
+
const currentSettings = this._settings();
|
|
101
|
+
this.saveSettings(currentSettings);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
private getStorageKey(): string {
|
|
106
|
+
const userId = this.authService.getUserId();
|
|
107
|
+
return userId ? `${BASE_STORAGE_KEY}_${userId}` : BASE_STORAGE_KEY;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Update custom instructions
|
|
112
|
+
*/
|
|
113
|
+
updateInstructions(instructions: Partial<CustomInstructions>) {
|
|
114
|
+
this._settings.update((s) => ({
|
|
115
|
+
...s,
|
|
116
|
+
customInstructions: { ...s.customInstructions, ...instructions },
|
|
117
|
+
meta: { ...s.meta, lastUpdated: Date.now() },
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Update appearance settings
|
|
123
|
+
*/
|
|
124
|
+
updateAppearance(appearance: Partial<AppearanceSettings>) {
|
|
125
|
+
this._settings.update((s) => ({
|
|
126
|
+
...s,
|
|
127
|
+
appearance: { ...s.appearance, ...appearance },
|
|
128
|
+
meta: { ...s.meta, lastUpdated: Date.now() },
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Set initial developer defaults (called from DoohbotComponent)
|
|
134
|
+
*/
|
|
135
|
+
setDeveloperDefaults(defaults: Partial<AppearanceSettings>) {
|
|
136
|
+
this._developerDefaults.set(defaults);
|
|
137
|
+
// Refresh settings to apply defaults if no user settings are saved
|
|
138
|
+
this._settings.set(this.loadSettings());
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Reset all personalization to defaults
|
|
143
|
+
*/
|
|
144
|
+
resetToDefaults() {
|
|
145
|
+
this._settings.set({
|
|
146
|
+
...DEFAULT_SETTINGS,
|
|
147
|
+
meta: { ...DEFAULT_SETTINGS.meta, lastUpdated: Date.now() },
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Get the formatted instructions block for chat requests
|
|
153
|
+
*/
|
|
154
|
+
getFormattedInstructions(): string {
|
|
155
|
+
const s = this._settings().customInstructions;
|
|
156
|
+
if (!s.enabled) return '';
|
|
157
|
+
|
|
158
|
+
let block = '--- CUSTOM INSTRUCTIONS ---\n';
|
|
159
|
+
if (s.aboutUser) {
|
|
160
|
+
block += `USER CONTEXT: ${s.aboutUser}\n`;
|
|
161
|
+
}
|
|
162
|
+
if (s.responseStyle) {
|
|
163
|
+
block += `RESPONSE STYLE: ${s.responseStyle}\n`;
|
|
164
|
+
}
|
|
165
|
+
block += '---------------------------';
|
|
166
|
+
|
|
167
|
+
return s.aboutUser || s.responseStyle ? block : '';
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
private loadSettings(): PersonalizationSettings {
|
|
171
|
+
try {
|
|
172
|
+
const key = this.getStorageKey();
|
|
173
|
+
// StorageService.get handles decryption/parsing
|
|
174
|
+
const saved = this.storage.get(key);
|
|
175
|
+
if (saved) {
|
|
176
|
+
return { ...DEFAULT_SETTINGS, ...saved };
|
|
177
|
+
}
|
|
178
|
+
} catch (e) {
|
|
179
|
+
console.error('Failed to load personalization settings', e);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Return defaults merged with developer overrides
|
|
183
|
+
return {
|
|
184
|
+
...DEFAULT_SETTINGS,
|
|
185
|
+
appearance: {
|
|
186
|
+
...DEFAULT_SETTINGS.appearance,
|
|
187
|
+
...this._developerDefaults(),
|
|
188
|
+
primaryColor: 'default', //! Force 'default' for fresh loads so it resolves dynamically
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
private saveSettings(settings: PersonalizationSettings) {
|
|
194
|
+
const key = this.getStorageKey();
|
|
195
|
+
this.storage.set(key, settings);
|
|
196
|
+
}
|
|
197
|
+
}
|
package/projects/doohbot/src/lib/app/personalization/sections/account/account-section.component.html
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<div class="account-container">
|
|
2
|
+
<div class="settings-list">
|
|
3
|
+
|
|
4
|
+
<!-- Delete all chats row -->
|
|
5
|
+
<div class="settings-row">
|
|
6
|
+
<div class="row-info">
|
|
7
|
+
<span class="row-label">Delete all chats</span>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="row-action">
|
|
10
|
+
<button class="pill-btn danger" (click)="confirmDeleteAllHistory()">Delete all</button>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<!-- Export data row -->
|
|
15
|
+
<div class="settings-row">
|
|
16
|
+
<div class="row-info">
|
|
17
|
+
<span class="row-label">Export data</span>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="row-action">
|
|
20
|
+
<button class="pill-btn">Export</button>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<!-- Org ID row -->
|
|
25
|
+
<div class="settings-row">
|
|
26
|
+
<div class="row-info">
|
|
27
|
+
<span class="row-label">Organization ID</span>
|
|
28
|
+
<span class="row-sublabel">Used for workspace identification</span>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="row-action">
|
|
31
|
+
<code class="org-id">{{ organizationId }}</code>
|
|
32
|
+
<button mat-icon-button (click)="copyOrgId()" [matTooltip]="isCopied ? 'Copied!' : 'Copy ID'">
|
|
33
|
+
<mat-icon>{{ isCopied ? 'check' : 'content_copy' }}</mat-icon>
|
|
34
|
+
</button>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<!-- Logout all row -->
|
|
39
|
+
<div class="settings-row">
|
|
40
|
+
<div class="row-info">
|
|
41
|
+
<span class="row-label">Global Logout</span>
|
|
42
|
+
<span class="row-sublabel">Sign out from all active devices</span>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="row-action">
|
|
45
|
+
<button class="pill-btn danger" (click)="confirmLogoutAll()">Logout all</button>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<!-- Delete account row -->
|
|
50
|
+
<div class="settings-row no-border">
|
|
51
|
+
<div class="row-info">
|
|
52
|
+
<span class="row-label danger-text">Delete account</span>
|
|
53
|
+
<span class="row-sublabel">Permanently delete your profile and data</span>
|
|
54
|
+
</div>
|
|
55
|
+
<div class="row-action">
|
|
56
|
+
<button class="pill-btn danger-filled" (click)="confirmDeleteAccount()">Delete Account</button>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<!-- Active Sessions Section -->
|
|
62
|
+
<div class="sessions-section">
|
|
63
|
+
<h3>Active sessions</h3>
|
|
64
|
+
<div class="sessions-table-container">
|
|
65
|
+
<table class="sessions-table">
|
|
66
|
+
<thead>
|
|
67
|
+
<tr>
|
|
68
|
+
<th>Device</th>
|
|
69
|
+
<th>Location</th>
|
|
70
|
+
<th>Created</th>
|
|
71
|
+
<th>Updated</th>
|
|
72
|
+
<th></th>
|
|
73
|
+
</tr>
|
|
74
|
+
</thead>
|
|
75
|
+
<tbody>
|
|
76
|
+
@for (session of sessions; track session.id) {
|
|
77
|
+
<tr [class.current]="session.isCurrent">
|
|
78
|
+
<td>
|
|
79
|
+
<div class="device-cell">
|
|
80
|
+
<mat-icon>{{ session.device.includes('Windows') ? 'laptop' : 'smartphone' }}</mat-icon>
|
|
81
|
+
<div class="device-info">
|
|
82
|
+
<span class="device-name">{{ session.device }}</span>
|
|
83
|
+
@if (session.isCurrent) {
|
|
84
|
+
<span class="current-badge">Current</span>
|
|
85
|
+
}
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
</td>
|
|
89
|
+
<td>{{ session.location }}</td>
|
|
90
|
+
<td>{{ session.created }}</td>
|
|
91
|
+
<td>{{ session.updated }}</td>
|
|
92
|
+
<td class="action-cell">
|
|
93
|
+
@if (!session.isCurrent) {
|
|
94
|
+
<button mat-icon-button [matMenuTriggerFor]="sessionMenu">
|
|
95
|
+
<mat-icon>more_vert</mat-icon>
|
|
96
|
+
</button>
|
|
97
|
+
<mat-menu #sessionMenu="matMenu" xPosition="before">
|
|
98
|
+
<button mat-menu-item (click)="confirmLogoutSession(session)">
|
|
99
|
+
<mat-icon>logout</mat-icon>
|
|
100
|
+
<span>Log out of session</span>
|
|
101
|
+
</button>
|
|
102
|
+
</mat-menu>
|
|
103
|
+
}
|
|
104
|
+
</td>
|
|
105
|
+
</tr>
|
|
106
|
+
}
|
|
107
|
+
</tbody>
|
|
108
|
+
</table>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
package/projects/doohbot/src/lib/app/personalization/sections/account/account-section.component.scss
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
.account-container {
|
|
2
|
+
padding: 32px 48px;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
gap: 48px;
|
|
6
|
+
animation: fadeIn 0.3s ease-out;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.settings-list {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
background: rgba(var(--black-rgb), 0.02);
|
|
13
|
+
border-radius: 16px;
|
|
14
|
+
border: 1px solid rgba(var(--black-rgb), 0.05);
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.settings-row {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
padding: 20px 24px;
|
|
23
|
+
border-bottom: 1px solid rgba(var(--black-rgb), 0.05);
|
|
24
|
+
transition: background 0.2s ease;
|
|
25
|
+
|
|
26
|
+
&.clickable {
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
|
|
29
|
+
&:hover {
|
|
30
|
+
background: rgba(var(--black-rgb), 0.04);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&.no-border {
|
|
35
|
+
border-bottom: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.row-info {
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
gap: 4px;
|
|
42
|
+
|
|
43
|
+
.row-label {
|
|
44
|
+
font-size: 1.05rem;
|
|
45
|
+
font-weight: 500;
|
|
46
|
+
color: var(--text-color);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.row-sublabel {
|
|
50
|
+
font-size: 0.9rem;
|
|
51
|
+
color: var(--secondary-text-color);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.danger-text {
|
|
55
|
+
color: var(--warn-color);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.row-action {
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
gap: 16px;
|
|
63
|
+
|
|
64
|
+
.status-text {
|
|
65
|
+
font-size: 0.95rem;
|
|
66
|
+
color: var(--secondary-text-color);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.chevron {
|
|
70
|
+
color: var(--secondary-text-color);
|
|
71
|
+
font-size: 20px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.org-id {
|
|
75
|
+
font-family: 'Space Mono', monospace;
|
|
76
|
+
padding: 4px 12px;
|
|
77
|
+
background: rgba(var(--primary-rgb), 0.05);
|
|
78
|
+
border-radius: 6px;
|
|
79
|
+
font-size: 0.9rem;
|
|
80
|
+
color: var(--primary-color);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.pill-btn {
|
|
86
|
+
background: none;
|
|
87
|
+
border: 1.5px solid rgba(var(--black-rgb), 0.15);
|
|
88
|
+
border-radius: 100px;
|
|
89
|
+
padding: 8px 24px;
|
|
90
|
+
font-size: 0.9rem;
|
|
91
|
+
font-weight: 600;
|
|
92
|
+
color: var(--text-color);
|
|
93
|
+
cursor: pointer;
|
|
94
|
+
transition: all 0.2s ease;
|
|
95
|
+
|
|
96
|
+
&:hover {
|
|
97
|
+
background: rgba(var(--black-rgb), 0.05);
|
|
98
|
+
border-color: rgba(var(--black-rgb), 0.3);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&.danger {
|
|
102
|
+
color: var(--warn-color);
|
|
103
|
+
border-color: rgba(var(--warn-rgb), 0.3);
|
|
104
|
+
|
|
105
|
+
&:hover {
|
|
106
|
+
background: rgba(var(--warn-rgb), 0.05);
|
|
107
|
+
border-color: var(--warn-color);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&.danger-filled {
|
|
112
|
+
background: transparent;
|
|
113
|
+
color: var(--text-color);
|
|
114
|
+
border: var(--red);
|
|
115
|
+
|
|
116
|
+
&:hover {
|
|
117
|
+
background: var(--red);
|
|
118
|
+
box-shadow: 0 4px 12px rgba(var(--warn-rgb), 0.2);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.sessions-section {
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-direction: column;
|
|
126
|
+
gap: 20px;
|
|
127
|
+
|
|
128
|
+
h3 {
|
|
129
|
+
margin: 0;
|
|
130
|
+
font-size: 1.25rem;
|
|
131
|
+
font-weight: 700;
|
|
132
|
+
color: var(--text-color);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.sessions-table-container {
|
|
137
|
+
border: 1px solid rgba(var(--black-rgb), 0.05);
|
|
138
|
+
border-radius: 16px;
|
|
139
|
+
background: rgba(var(--black-rgb), 0.01);
|
|
140
|
+
overflow: hidden;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.sessions-table {
|
|
144
|
+
width: 100%;
|
|
145
|
+
border-collapse: collapse;
|
|
146
|
+
text-align: left;
|
|
147
|
+
|
|
148
|
+
th {
|
|
149
|
+
padding: 16px 20px;
|
|
150
|
+
background: rgba(var(--black-rgb), 0.03);
|
|
151
|
+
font-size: 0.8rem;
|
|
152
|
+
font-weight: 700;
|
|
153
|
+
color: var(--secondary-text-color);
|
|
154
|
+
text-transform: uppercase;
|
|
155
|
+
letter-spacing: 0.05em;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
td {
|
|
159
|
+
padding: 20px;
|
|
160
|
+
border-top: 1px solid rgba(var(--black-rgb), 0.05);
|
|
161
|
+
font-size: 0.95rem;
|
|
162
|
+
color: var(--text-color);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
tr.current {
|
|
166
|
+
background: rgba(var(--primary-rgb), 0.03);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.action-cell {
|
|
170
|
+
text-align: right;
|
|
171
|
+
padding-right: 12px;
|
|
172
|
+
color: var(--secondary-text-color);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.device-cell {
|
|
177
|
+
display: flex;
|
|
178
|
+
align-items: center;
|
|
179
|
+
gap: 16px;
|
|
180
|
+
|
|
181
|
+
mat-icon {
|
|
182
|
+
font-size: 24px;
|
|
183
|
+
color: var(--secondary-text-color);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.device-info {
|
|
187
|
+
display: flex;
|
|
188
|
+
flex-direction: column;
|
|
189
|
+
gap: 4px;
|
|
190
|
+
|
|
191
|
+
.device-name {
|
|
192
|
+
font-weight: 600;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.current-badge {
|
|
196
|
+
font-size: 0.7rem;
|
|
197
|
+
color: var(--primary-color);
|
|
198
|
+
background: rgba(var(--primary-rgb), 0.1);
|
|
199
|
+
padding: 2px 8px;
|
|
200
|
+
border-radius: 4px;
|
|
201
|
+
width: fit-content;
|
|
202
|
+
font-weight: 700;
|
|
203
|
+
text-transform: uppercase;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
@keyframes fadeIn {
|
|
209
|
+
from {
|
|
210
|
+
opacity: 0;
|
|
211
|
+
transform: translateY(10px);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
to {
|
|
215
|
+
opacity: 1;
|
|
216
|
+
transform: translateY(0);
|
|
217
|
+
}
|
|
218
|
+
}
|
package/projects/doohbot/src/lib/app/personalization/sections/account/account-section.component.ts
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { Component, Input, Output, EventEmitter, inject, ChangeDetectorRef } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
4
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
5
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
6
|
+
import { MatMenuModule } from '@angular/material/menu';
|
|
7
|
+
import { DialogService } from '../../../../shared/dialog/dialog.service';
|
|
8
|
+
import { AuthService } from '../../../../core/auth/auth.service';
|
|
9
|
+
|
|
10
|
+
export interface ActiveSession {
|
|
11
|
+
id: string;
|
|
12
|
+
device: string;
|
|
13
|
+
location: string;
|
|
14
|
+
created: string;
|
|
15
|
+
updated: string;
|
|
16
|
+
isCurrent?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@Component({
|
|
20
|
+
selector: 'app-account-section',
|
|
21
|
+
standalone: true,
|
|
22
|
+
imports: [CommonModule, MatIconModule, MatButtonModule, MatTooltipModule, MatMenuModule],
|
|
23
|
+
templateUrl: './account-section.component.html',
|
|
24
|
+
styleUrls: ['./account-section.component.scss']
|
|
25
|
+
})
|
|
26
|
+
export class AccountSectionComponent {
|
|
27
|
+
private dialogService = inject(DialogService);
|
|
28
|
+
private authService = inject(AuthService);
|
|
29
|
+
private cd = inject(ChangeDetectorRef);
|
|
30
|
+
|
|
31
|
+
@Input() organizationId: string = '';
|
|
32
|
+
public isCopied = false;
|
|
33
|
+
|
|
34
|
+
ngOnInit() {
|
|
35
|
+
if (!this.organizationId) {
|
|
36
|
+
this.organizationId = this.authService.getOrganizationId() || '';
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@Output() onDeleteAllHistory = new EventEmitter<void>();
|
|
41
|
+
@Output() onLogoutAll = new EventEmitter<void>();
|
|
42
|
+
@Output() onLogoutSession = new EventEmitter<string>();
|
|
43
|
+
@Output() onDeleteAccount = new EventEmitter<void>();
|
|
44
|
+
|
|
45
|
+
public sessions: ActiveSession[] = [
|
|
46
|
+
{
|
|
47
|
+
id: 'session-1',
|
|
48
|
+
device: 'Chrome (Windows)',
|
|
49
|
+
location: 'Kathmandu, Bagmati Province, NP',
|
|
50
|
+
created: 'Jan 9, 2026, 9:21 AM',
|
|
51
|
+
updated: 'Jan 9, 2026, 9:21 AM',
|
|
52
|
+
isCurrent: true
|
|
53
|
+
}
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
copyOrgId() {
|
|
57
|
+
const orgId = this.authService.getOrganizationId();
|
|
58
|
+
if (orgId) {
|
|
59
|
+
navigator.clipboard.writeText(orgId);
|
|
60
|
+
this.isCopied = true;
|
|
61
|
+
this.cd.detectChanges();
|
|
62
|
+
|
|
63
|
+
setTimeout(() => {
|
|
64
|
+
this.isCopied = false;
|
|
65
|
+
this.cd.detectChanges();
|
|
66
|
+
}, 800);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
confirmLogoutAll() {
|
|
71
|
+
this.dialogService.open({
|
|
72
|
+
title: 'Log out of all devices',
|
|
73
|
+
message: 'Are you sure you want to log out of all active devices? You will be signed out everywhere except here.',
|
|
74
|
+
confirmText: 'Log out all',
|
|
75
|
+
cancelText: 'Cancel',
|
|
76
|
+
confirmButtonColor: 'warn',
|
|
77
|
+
icon: 'logout'
|
|
78
|
+
}).subscribe(confirmed => {
|
|
79
|
+
if (confirmed) this.onLogoutAll.emit();
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
confirmLogoutSession(session: ActiveSession) {
|
|
84
|
+
this.dialogService.open({
|
|
85
|
+
title: 'Log out of session',
|
|
86
|
+
message: `Are you sure you want to log out from ${session.device} at ${session.location}?`,
|
|
87
|
+
confirmText: 'Log out',
|
|
88
|
+
cancelText: 'Cancel',
|
|
89
|
+
confirmButtonColor: 'warn',
|
|
90
|
+
icon: 'logout'
|
|
91
|
+
}).subscribe(confirmed => {
|
|
92
|
+
if (confirmed) this.onLogoutSession.emit(session.id);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
confirmDeleteAllHistory() {
|
|
97
|
+
this.dialogService.open({
|
|
98
|
+
title: 'Clear All History',
|
|
99
|
+
message: 'Are you sure you want to delete all chat history? This action cannot be undone.',
|
|
100
|
+
confirmText: 'Clear All',
|
|
101
|
+
cancelText: 'Cancel',
|
|
102
|
+
confirmButtonColor: 'warn',
|
|
103
|
+
icon: 'delete_sweep'
|
|
104
|
+
}).subscribe(confirmed => {
|
|
105
|
+
if (confirmed) this.onDeleteAllHistory.emit();
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
confirmDeleteAccount() {
|
|
110
|
+
this.dialogService.open({
|
|
111
|
+
title: 'Delete Your Account',
|
|
112
|
+
message: 'This will permanently delete your account and all associated data. This action is irreversible. Are you absolutely sure?',
|
|
113
|
+
confirmText: 'Delete Account',
|
|
114
|
+
cancelText: 'Cancel',
|
|
115
|
+
confirmButtonColor: 'warn',
|
|
116
|
+
icon: 'person_remove'
|
|
117
|
+
}).subscribe(confirmed => {
|
|
118
|
+
if (confirmed) this.onDeleteAccount.emit();
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<div class="instructions-container">
|
|
2
|
+
<header class="pane-header">
|
|
3
|
+
<h1>Custom Instructions</h1>
|
|
4
|
+
<p>Tell us more about yourself and how you want the assistant to respond.</p>
|
|
5
|
+
</header>
|
|
6
|
+
|
|
7
|
+
<div class="settings-list">
|
|
8
|
+
<!-- Enable Toggle Row -->
|
|
9
|
+
<div class="settings-row">
|
|
10
|
+
<div class="row-info">
|
|
11
|
+
<span class="row-label">Enable Custom Instructions</span>
|
|
12
|
+
<span class="row-sublabel">Apply these preferences to all new conversations</span>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="row-action">
|
|
15
|
+
<mat-slide-toggle [(ngModel)]="settings.customInstructions.enabled" color="primary"></mat-slide-toggle>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<div class="instruction-fields" [class.disabled]="!settings.customInstructions.enabled">
|
|
21
|
+
<div class="field-item">
|
|
22
|
+
<div class="field-header">
|
|
23
|
+
<label>What should the assistant know about you?</label>
|
|
24
|
+
<mat-icon
|
|
25
|
+
matTooltip="e.g. I prefer code examples in TypeScript, I'm a senior dev...">info_outline</mat-icon>
|
|
26
|
+
</div>
|
|
27
|
+
<mat-form-field appearance="outline" class="full-width no-label" subscriptSizing="dynamic">
|
|
28
|
+
<textarea matInput rows="4" [(ngModel)]="settings.customInstructions.aboutUser"
|
|
29
|
+
placeholder="Provide some context about yourself..."
|
|
30
|
+
[disabled]="!settings.customInstructions.enabled"></textarea>
|
|
31
|
+
</mat-form-field>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class="field-item">
|
|
35
|
+
<div class="field-header">
|
|
36
|
+
<label>How should the assistant respond?</label>
|
|
37
|
+
<mat-icon matTooltip="e.g. Be concise, use bullet points, avoid jargon...">info_outline</mat-icon>
|
|
38
|
+
</div>
|
|
39
|
+
<mat-form-field appearance="outline" class="full-width no-label" subscriptSizing="dynamic">
|
|
40
|
+
<textarea matInput rows="4" [(ngModel)]="settings.customInstructions.responseStyle"
|
|
41
|
+
placeholder="Describe the response style you'd like..."
|
|
42
|
+
[disabled]="!settings.customInstructions.enabled"></textarea>
|
|
43
|
+
</mat-form-field>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|