@aidapt/caity-chat 3.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.
- package/README.md +73 -0
- package/dist/lib/_baseUniq-BVCT-t6P.js +477 -0
- package/dist/lib/arc-Kj6ZmwPS.js +83 -0
- package/dist/lib/architectureDiagram-Q4EWVU46-DA4kYaz_.js +4690 -0
- package/dist/lib/blockDiagram-DXYQGD6D-BWT5yya1.js +2295 -0
- package/dist/lib/c4Diagram-AHTNJAMY-BjY6DW3U.js +1577 -0
- package/dist/lib/caity-chat.tgz +0 -0
- package/dist/lib/channel-BjraetTo.js +5 -0
- package/dist/lib/chunk-4BX2VUAB-iSPZGgxQ.js +8 -0
- package/dist/lib/chunk-4TB4RGXK-DvnUcLoe.js +1465 -0
- package/dist/lib/chunk-55IACEB6-Mw25YX9j.js +8 -0
- package/dist/lib/chunk-EDXVE4YY-Dtbxz7df.js +19 -0
- package/dist/lib/chunk-FMBD7UC4-OCIy3top.js +19 -0
- package/dist/lib/chunk-OYMX7WX6-DFW9El2C.js +1383 -0
- package/dist/lib/chunk-QZHKN3VN-BYFTfk7k.js +15 -0
- package/dist/lib/chunk-YZCP3GAM-Cs-HTcyJ.js +68 -0
- package/dist/lib/classDiagram-6PBFFD2Q-CrDUlIYr.js +16 -0
- package/dist/lib/classDiagram-v2-HSJHXN6E-CrDUlIYr.js +16 -0
- package/dist/lib/clone-C0qEGPCz.js +8 -0
- package/dist/lib/cose-bilkent-S5V4N54A-H1-YbKvI.js +2609 -0
- package/dist/lib/cytoscape.esm-D_3MZVO6.js +18707 -0
- package/dist/lib/dagre-KV5264BT-DhEnTJ4D.js +443 -0
- package/dist/lib/defaultLocale-BgPVtth8.js +171 -0
- package/dist/lib/diagram-5BDNPKRD-CK6wgKxI.js +123 -0
- package/dist/lib/diagram-G4DWMVQ6-IhA_MJ0t.js +528 -0
- package/dist/lib/diagram-MMDJMWI5-DDuA1rYY.js +217 -0
- package/dist/lib/diagram-TYMM5635-_VI1en0S.js +142 -0
- package/dist/lib/erDiagram-SMLLAGMA-B1REwW7y.js +899 -0
- package/dist/lib/flowDiagram-DWJPFMVM-rWzOGDlg.js +1628 -0
- package/dist/lib/ganttDiagram-T4ZO3ILL-UhSvbAmM.js +2701 -0
- package/dist/lib/gitGraphDiagram-UUTBAWPF-DrsSMMoJ.js +815 -0
- package/dist/lib/graph-DMr8NrNW.js +738 -0
- package/dist/lib/index.d.ts +665 -0
- package/dist/lib/index.js +52 -0
- package/dist/lib/infoDiagram-42DDH7IO-CPF3XCNj.js +24 -0
- package/dist/lib/init-DjUOC4st.js +16 -0
- package/dist/lib/ishikawaDiagram-UXIWVN3A-B4Nt1TdW.js +621 -0
- package/dist/lib/journeyDiagram-VCZTEJTY-DW5yRsOM.js +834 -0
- package/dist/lib/kanban-definition-6JOO6SKY-5DmJRubo.js +724 -0
- package/dist/lib/layout-B00IQLgh.js +1441 -0
- package/dist/lib/linear-LLab47WO.js +259 -0
- package/dist/lib/main-C9dvh9CT.js +88771 -0
- package/dist/lib/mermaid.core-BrBkhL9h.js +15967 -0
- package/dist/lib/min-CJFyJhXg.js +38 -0
- package/dist/lib/mindmap-definition-QFDTVHPH-doqZCFNi.js +833 -0
- package/dist/lib/ordinal-B6-f3MAq.js +61 -0
- package/dist/lib/pieDiagram-DEJITSTG-DKi5GKup.js +163 -0
- package/dist/lib/quadrantDiagram-34T5L4WZ-COYWmEhy.js +1022 -0
- package/dist/lib/requirementDiagram-MS252O5E-D3odK6YH.js +882 -0
- package/dist/lib/sankeyDiagram-XADWPNL6-D36eaMCx.js +810 -0
- package/dist/lib/sequenceDiagram-FGHM5R23-NpESTwMk.js +2883 -0
- package/dist/lib/standalone.js +4 -0
- package/dist/lib/stateDiagram-FHFEXIEX-kXZ_Bn-a.js +263 -0
- package/dist/lib/stateDiagram-v2-QKLJ7IA2-B5xMdEuE.js +16 -0
- package/dist/lib/timeline-definition-GMOUNBTQ-DZDdcJwy.js +1055 -0
- package/dist/lib/vennDiagram-DHZGUBPP-Clhb6EGF.js +1557 -0
- package/dist/lib/wardley-RL74JXVD-CwSnyVu7.js +18396 -0
- package/dist/lib/wardleyDiagram-NUSXRM2D-DnXL4F04.js +594 -0
- package/dist/lib/xychartDiagram-5P7HB3ND-CweIkrg3.js +1342 -0
- package/package.json +95 -0
- package/src/types/caity-chat.d.ts +213 -0
- package/src/types/template-slots.d.ts +167 -0
package/package.json
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aidapt/caity-chat",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "3.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/lib/index.js",
|
|
7
|
+
"module": "./dist/lib/index.js",
|
|
8
|
+
"types": "./dist/lib/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/lib/index.d.ts",
|
|
12
|
+
"import": "./dist/lib/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./standalone": {
|
|
15
|
+
"import": "./dist/lib/standalone.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"sideEffects": [
|
|
19
|
+
"./dist/lib/standalone.js"
|
|
20
|
+
],
|
|
21
|
+
"files": [
|
|
22
|
+
"dist/lib/",
|
|
23
|
+
"src/types/caity-chat.d.ts",
|
|
24
|
+
"src/types/template-slots.d.ts"
|
|
25
|
+
],
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
28
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"dev": "vite --port 5175 --mode development --host",
|
|
32
|
+
"prod": "vite --host --mode production",
|
|
33
|
+
"build:debugger": "tsc -b && vite build --mode development",
|
|
34
|
+
"build": "tsc -b && vite build --mode production && npm run generate:schema && npm run generate:templates",
|
|
35
|
+
"build:lib": "tsc -b && vite build --mode lib && vite build --mode standalone",
|
|
36
|
+
"pack": "npm run build:lib && node scripts/pack.mjs",
|
|
37
|
+
"build:all": "npm run build && npm run build:debugger && npm run pack ",
|
|
38
|
+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
39
|
+
"format": "prettier --write './**/*.{js,jsx,ts,tsx,css,md,json}' --config ./.prettierrc",
|
|
40
|
+
"preview": "vite preview",
|
|
41
|
+
"test": "vitest",
|
|
42
|
+
"test:coverage": "vitest run --coverage",
|
|
43
|
+
"test:run": "vitest run",
|
|
44
|
+
"test:e2e": "npm run build && playwright test",
|
|
45
|
+
"generate:schema": "tsx scripts/generateAspectSchema.ts",
|
|
46
|
+
"generate:templates": "tsx scripts/generateTemplateManifest.ts",
|
|
47
|
+
"audit:colors": "tsx scripts/colorAudit.ts",
|
|
48
|
+
"test-ci:main": "bash scripts/test-ci.sh main",
|
|
49
|
+
"test-ci:release": "bash scripts/test-ci.sh release",
|
|
50
|
+
"test-ci:reset": "bash scripts/test-ci.sh reset"
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"abcjs": "^6.6.2",
|
|
54
|
+
"classnames": "^2.5.1",
|
|
55
|
+
"date-fns": "^4.1.0",
|
|
56
|
+
"katex": "^0.16.33",
|
|
57
|
+
"lucide-react": "^0.574.0",
|
|
58
|
+
"mermaid": "^11.14.0",
|
|
59
|
+
"react-dropzone": "^15.0.0",
|
|
60
|
+
"react-hook-form": "^7.71.1",
|
|
61
|
+
"react-markdown": "^10.1.0",
|
|
62
|
+
"react-syntax-highlighter": "^16.1.0",
|
|
63
|
+
"rehype-katex": "^7.0.1",
|
|
64
|
+
"remark-gfm": "^4.0.1",
|
|
65
|
+
"remark-math": "^6.0.0",
|
|
66
|
+
"sanitize-html": "^2.17.1",
|
|
67
|
+
"zustand": "^5.0.11"
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@eslint/js": "^9.39.1",
|
|
71
|
+
"@playwright/test": "^1.58.2",
|
|
72
|
+
"@tailwindcss/vite": "^4.1.18",
|
|
73
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
74
|
+
"@testing-library/react": "^16.3.2",
|
|
75
|
+
"@types/node": "^24.10.1",
|
|
76
|
+
"@types/react": "^19.2.7",
|
|
77
|
+
"@types/react-dom": "^19.2.3",
|
|
78
|
+
"@types/react-syntax-highlighter": "^15.5.13",
|
|
79
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
80
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
81
|
+
"eslint": "^9.39.1",
|
|
82
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
83
|
+
"eslint-plugin-react-refresh": "^0.4.24",
|
|
84
|
+
"globals": "^16.5.0",
|
|
85
|
+
"jsdom": "^28.1.0",
|
|
86
|
+
"tailwindcss": "^4.1.18",
|
|
87
|
+
"tsx": "^4.21.0",
|
|
88
|
+
"typescript": "~5.9.3",
|
|
89
|
+
"typescript-eslint": "^8.48.0",
|
|
90
|
+
"vite": "^7.3.1",
|
|
91
|
+
"vite-plugin-dts": "^4.5.4",
|
|
92
|
+
"vite-plugin-static-copy": "^3.2.0",
|
|
93
|
+
"vitest": "^4.0.18"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSX type definitions for CAITY Skill Chat Web Components.
|
|
3
|
+
*
|
|
4
|
+
* Usage: copy this file (and `template-slots.d.ts`) into your project's
|
|
5
|
+
* types folder and include them in your tsconfig.json.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import 'react';
|
|
9
|
+
import type { TemplateSlotDataMap } from './template-slots';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Attributi condivisi da tutti gli elementi template-slot.
|
|
13
|
+
*
|
|
14
|
+
* `TData` è il tipo dell'oggetto `data` passato alla render function:
|
|
15
|
+
* ```ts
|
|
16
|
+
* window[render](data: TData, container: HTMLElement, nodes: Node[]) => void
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* Esempio:
|
|
20
|
+
* ```tsx
|
|
21
|
+
* // data è tipato come Message grazie a CaitySlotProps<Message>
|
|
22
|
+
* window.myFn = (data, container) => { console.log(data.content) }
|
|
23
|
+
*
|
|
24
|
+
* <caity-msg-toolbox render="myFn">...</caity-msg-toolbox>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
type CaitySlotProps<TData = unknown> = React.DetailedHTMLProps<
|
|
28
|
+
React.HTMLAttributes<HTMLElement> & {
|
|
29
|
+
/**
|
|
30
|
+
* Nome di una funzione globale (`window[render]`) chiamata dopo
|
|
31
|
+
* ogni iniezione del template.
|
|
32
|
+
*
|
|
33
|
+
* Firma: `(data: TData, container: HTMLElement, nodes: Node[]) => void`
|
|
34
|
+
*/
|
|
35
|
+
render?: string;
|
|
36
|
+
},
|
|
37
|
+
HTMLElement
|
|
38
|
+
>;
|
|
39
|
+
|
|
40
|
+
declare module 'react' {
|
|
41
|
+
namespace JSX {
|
|
42
|
+
interface IntrinsicElements {
|
|
43
|
+
// ── Elemento host ──────────────────────────────────────────────────────
|
|
44
|
+
'caity-chat': React.DetailedHTMLProps<
|
|
45
|
+
React.HTMLAttributes<HTMLElement> & {
|
|
46
|
+
/** Identificatore dell'applicazione passato all'endpoint di setup. */
|
|
47
|
+
app?: string;
|
|
48
|
+
/** URL base dell'API. */
|
|
49
|
+
'api-url'?: string;
|
|
50
|
+
/** Token di autenticazione. */
|
|
51
|
+
token?: string;
|
|
52
|
+
/** Lingua di traduzione dei messaggi */
|
|
53
|
+
lang?: string
|
|
54
|
+
/** Skill Aspect di cortesia */
|
|
55
|
+
'skill-aspect'?: string
|
|
56
|
+
},
|
|
57
|
+
HTMLElement
|
|
58
|
+
>;
|
|
59
|
+
|
|
60
|
+
// TEMPLATE_SLOTS_BEGIN — sezione auto-generata da `npm run generate:templates`
|
|
61
|
+
|
|
62
|
+
/** data: `{ file: { name: string; type?: string; }; onRemove: () => void; removeTooltip: s…` */
|
|
63
|
+
'caity-attachment-chip': CaitySlotProps<TemplateSlotDataMap['caity-attachment-chip']>;
|
|
64
|
+
|
|
65
|
+
/** data: `{ attachments: File[]; retryFileRefs: FileReference[]; handleRemove: (index: num…` */
|
|
66
|
+
'caity-attachment-list': CaitySlotProps<TemplateSlotDataMap['caity-attachment-list']>;
|
|
67
|
+
|
|
68
|
+
/** data: `string` */
|
|
69
|
+
'caity-background-notice': CaitySlotProps<TemplateSlotDataMap['caity-background-notice']>;
|
|
70
|
+
|
|
71
|
+
/** data: nessuno */
|
|
72
|
+
'caity-bot-avatar-icon': CaitySlotProps<TemplateSlotDataMap['caity-bot-avatar-icon']>;
|
|
73
|
+
|
|
74
|
+
/** data: nessuno */
|
|
75
|
+
'caity-chat-container': CaitySlotProps<TemplateSlotDataMap['caity-chat-container']>;
|
|
76
|
+
|
|
77
|
+
/** data: `{ isChatOpen: boolean; onClick: () => void; }` */
|
|
78
|
+
'caity-chat-floating-button': CaitySlotProps<TemplateSlotDataMap['caity-chat-floating-button']>;
|
|
79
|
+
|
|
80
|
+
/** data: nessuno */
|
|
81
|
+
'caity-chat-window': CaitySlotProps<TemplateSlotDataMap['caity-chat-window']>;
|
|
82
|
+
|
|
83
|
+
/** data: `{ contextTitle: string | undefined; contextTooltip: string | undefined; }` */
|
|
84
|
+
'caity-context-message': CaitySlotProps<TemplateSlotDataMap['caity-context-message']>;
|
|
85
|
+
|
|
86
|
+
/** data: nessuno */
|
|
87
|
+
'caity-error-message': CaitySlotProps<TemplateSlotDataMap['caity-error-message']>;
|
|
88
|
+
|
|
89
|
+
/** data: nessuno */
|
|
90
|
+
'caity-footer': CaitySlotProps<TemplateSlotDataMap['caity-footer']>;
|
|
91
|
+
|
|
92
|
+
/** data: `string` */
|
|
93
|
+
'caity-greeting-message': CaitySlotProps<TemplateSlotDataMap['caity-greeting-message']>;
|
|
94
|
+
|
|
95
|
+
/** data: nessuno */
|
|
96
|
+
'caity-header': CaitySlotProps<TemplateSlotDataMap['caity-header']>;
|
|
97
|
+
|
|
98
|
+
/** data: `{}` */
|
|
99
|
+
'caity-header-dropdown': CaitySlotProps<TemplateSlotDataMap['caity-header-dropdown']>;
|
|
100
|
+
|
|
101
|
+
/** data: nessuno — modalità `inline` */
|
|
102
|
+
'caity-header-dropdown-item': CaitySlotProps<TemplateSlotDataMap['caity-header-dropdown-item']>;
|
|
103
|
+
|
|
104
|
+
/** data: nessuno */
|
|
105
|
+
'caity-header-item': CaitySlotProps<TemplateSlotDataMap['caity-header-item']>;
|
|
106
|
+
|
|
107
|
+
/** data: nessuno */
|
|
108
|
+
'caity-header-logo': CaitySlotProps<TemplateSlotDataMap['caity-header-logo']>;
|
|
109
|
+
|
|
110
|
+
/** data: nessuno */
|
|
111
|
+
'caity-input': CaitySlotProps<TemplateSlotDataMap['caity-input']>;
|
|
112
|
+
|
|
113
|
+
/** data: `{ availableCharsLabel: string; charLimit: CharLimitState; maxChars: number; curr…` */
|
|
114
|
+
'caity-input-chars-alert': CaitySlotProps<TemplateSlotDataMap['caity-input-chars-alert']>;
|
|
115
|
+
|
|
116
|
+
/** data: `{ value: string; disabled: boolean; placeholder: string | undefined; onChange: (…` */
|
|
117
|
+
'caity-input-textarea': CaitySlotProps<TemplateSlotDataMap['caity-input-textarea']>;
|
|
118
|
+
|
|
119
|
+
/** data: `{ message: Message; }` */
|
|
120
|
+
'caity-machine-message': CaitySlotProps<TemplateSlotDataMap['caity-machine-message']>;
|
|
121
|
+
|
|
122
|
+
/** data: `{ downloadFileFromUrl: (url: string, filename?: string) => Promise<void>; downlo…` */
|
|
123
|
+
'caity-machine-message-attachment-chip': CaitySlotProps<TemplateSlotDataMap['caity-machine-message-attachment-chip']>;
|
|
124
|
+
|
|
125
|
+
/** data: `Message[]` */
|
|
126
|
+
'caity-messages': CaitySlotProps<TemplateSlotDataMap['caity-messages']>;
|
|
127
|
+
|
|
128
|
+
/** data: `Message` */
|
|
129
|
+
'caity-msg-action-item': CaitySlotProps<TemplateSlotDataMap['caity-msg-action-item']>;
|
|
130
|
+
|
|
131
|
+
/** data: `Message` */
|
|
132
|
+
'caity-msg-actions': CaitySlotProps<TemplateSlotDataMap['caity-msg-actions']>;
|
|
133
|
+
|
|
134
|
+
/** data: `{ collapsedTooltip: string; uncollapsedTooltip: string; collapsed: boolean; onCo…` */
|
|
135
|
+
'caity-msg-collapse': CaitySlotProps<TemplateSlotDataMap['caity-msg-collapse']>;
|
|
136
|
+
|
|
137
|
+
/** data: `{ message: Message; tooltip: string; handleCopy: () => void; }` */
|
|
138
|
+
'caity-msg-copy': CaitySlotProps<TemplateSlotDataMap['caity-msg-copy']>;
|
|
139
|
+
|
|
140
|
+
/** data: `Message` */
|
|
141
|
+
'caity-msg-debug': CaitySlotProps<TemplateSlotDataMap['caity-msg-debug']>;
|
|
142
|
+
|
|
143
|
+
/** data: `{ message: Message; sendFeedback: (messageId: string, value: number, comment?: s…` */
|
|
144
|
+
'caity-msg-feedback': CaitySlotProps<TemplateSlotDataMap['caity-msg-feedback']>;
|
|
145
|
+
|
|
146
|
+
/** data: `{ message: Message; prepareRetry: (messageId: string) => void; cancelRetry: () =…` */
|
|
147
|
+
'caity-msg-retry': CaitySlotProps<TemplateSlotDataMap['caity-msg-retry']>;
|
|
148
|
+
|
|
149
|
+
/** data: `{ message: Message; option: string; idx: number; handleOptionClick: (option: str…` */
|
|
150
|
+
'caity-msg-select-option': CaitySlotProps<TemplateSlotDataMap['caity-msg-select-option']>;
|
|
151
|
+
|
|
152
|
+
/** data: `{ message: Message; handleOptionClick: (option: string) => void; }` */
|
|
153
|
+
'caity-msg-select-options': CaitySlotProps<TemplateSlotDataMap['caity-msg-select-options']>;
|
|
154
|
+
|
|
155
|
+
/** data: `{ message: Message; sourcesTooltip: string; }` */
|
|
156
|
+
'caity-msg-sources': CaitySlotProps<TemplateSlotDataMap['caity-msg-sources']>;
|
|
157
|
+
|
|
158
|
+
/** data: `{ timeLabel: string; enableMessageTime: true; }` */
|
|
159
|
+
'caity-msg-time': CaitySlotProps<TemplateSlotDataMap['caity-msg-time']>;
|
|
160
|
+
|
|
161
|
+
/** data: `Message` */
|
|
162
|
+
'caity-msg-toolbox': CaitySlotProps<TemplateSlotDataMap['caity-msg-toolbox']>;
|
|
163
|
+
|
|
164
|
+
/** data: `{ message: Message; tooltip: string; isActive: boolean; state: TTSState; ttsStat…` */
|
|
165
|
+
'caity-msg-tts': CaitySlotProps<TemplateSlotDataMap['caity-msg-tts']>;
|
|
166
|
+
|
|
167
|
+
/** data: `{ onClick: () => void; label: string; }` */
|
|
168
|
+
'caity-scroll-to-bottom-button': CaitySlotProps<TemplateSlotDataMap['caity-scroll-to-bottom-button']>;
|
|
169
|
+
|
|
170
|
+
/** data: nessuno */
|
|
171
|
+
'caity-slow-response-abort-message': CaitySlotProps<TemplateSlotDataMap['caity-slow-response-abort-message']>;
|
|
172
|
+
|
|
173
|
+
/** data: nessuno */
|
|
174
|
+
'caity-slow-response-warning-message': CaitySlotProps<TemplateSlotDataMap['caity-slow-response-warning-message']>;
|
|
175
|
+
|
|
176
|
+
/** data: `{ question: string; onClick: () => void; }` */
|
|
177
|
+
'caity-static-question-item': CaitySlotProps<TemplateSlotDataMap['caity-static-question-item']>;
|
|
178
|
+
|
|
179
|
+
/** data: `string[]` */
|
|
180
|
+
'caity-static-questions': CaitySlotProps<TemplateSlotDataMap['caity-static-questions']>;
|
|
181
|
+
|
|
182
|
+
/** data: nessuno */
|
|
183
|
+
'caity-time-divider-message': CaitySlotProps<TemplateSlotDataMap['caity-time-divider-message']>;
|
|
184
|
+
|
|
185
|
+
/** data: `{ disabled: boolean; sttButtonProps: { sttState: STTState; sttDuration: number; …` */
|
|
186
|
+
'caity-toolbox': CaitySlotProps<TemplateSlotDataMap['caity-toolbox']>;
|
|
187
|
+
|
|
188
|
+
/** data: nessuno — modalità `inline` */
|
|
189
|
+
'caity-toolbox-item': CaitySlotProps<TemplateSlotDataMap['caity-toolbox-item']>;
|
|
190
|
+
|
|
191
|
+
/** data: `{ disabled: boolean; open: () => void; enableAttachments: boolean; attachTooltip…` */
|
|
192
|
+
'caity-toolbox-item-attachment': CaitySlotProps<TemplateSlotDataMap['caity-toolbox-item-attachment']>;
|
|
193
|
+
|
|
194
|
+
/** data: `{ sendTooltip: string; disabled: boolean; onSend: () => void; }` */
|
|
195
|
+
'caity-toolbox-item-send': CaitySlotProps<TemplateSlotDataMap['caity-toolbox-item-send']>;
|
|
196
|
+
|
|
197
|
+
/** data: `{ sttState: STTState; sttDuration: number; sttError: string | null; startSTT: ()…` */
|
|
198
|
+
'caity-toolbox-item-stt': CaitySlotProps<TemplateSlotDataMap['caity-toolbox-item-stt']>;
|
|
199
|
+
|
|
200
|
+
/** data: `{ message: Message; isLastUserMessage?: boolean; isHidden?: boolean; isHiddenByG…` */
|
|
201
|
+
'caity-user-message': CaitySlotProps<TemplateSlotDataMap['caity-user-message']>;
|
|
202
|
+
|
|
203
|
+
/** data: `{ attachments: { fileName: string; id: string; }[]; }` */
|
|
204
|
+
'caity-user-message-attachment-container': CaitySlotProps<TemplateSlotDataMap['caity-user-message-attachment-container']>;
|
|
205
|
+
|
|
206
|
+
/** data: `{ message: Message; }` */
|
|
207
|
+
'caity-user-message-content': CaitySlotProps<TemplateSlotDataMap['caity-user-message-content']>;
|
|
208
|
+
|
|
209
|
+
// TEMPLATE_SLOTS_END
|
|
210
|
+
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
// Auto-generated by scripts/generateTemplateManifest.ts — DO NOT EDIT
|
|
2
|
+
// Rigenera con: npm run generate:templates
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Mappa ogni slot al tipo dell'oggetto `data` che riceve.
|
|
6
|
+
*
|
|
7
|
+
* Usa `TemplateSlotData<K>` per tipizzare le render function:
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* window.myRender = function(
|
|
11
|
+
* data: TemplateSlotData<'caity-msg-toolbox'>,
|
|
12
|
+
* container: HTMLElement,
|
|
13
|
+
* nodes: Node[],
|
|
14
|
+
* ) { ... }
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export interface TemplateSlotDataMap {
|
|
18
|
+
/** Slot definito in `src/components/chat/input/tools/attachments/AttachmentChip.tsx:42` */
|
|
19
|
+
'caity-attachment-chip': { file: { name: string; type?: string; }; onRemove: () => void; removeTooltip: string; ext: string; }
|
|
20
|
+
|
|
21
|
+
/** Slot definito in `src/components/chat/input/tools/attachments/AttachmentList.tsx:30` */
|
|
22
|
+
'caity-attachment-list': { attachments: File[]; retryFileRefs: FileReference[]; handleRemove: (index: number) => void; handleRemoveRetryRef: (index: number) => void; }
|
|
23
|
+
|
|
24
|
+
/** Slot definito in `src/components/chat/messages/BackgroundNotice.tsx:42` */
|
|
25
|
+
'caity-background-notice': string
|
|
26
|
+
|
|
27
|
+
/** Slot definito in `src/components/chat/messages/senders/MachineMessage.tsx:98` */
|
|
28
|
+
'caity-bot-avatar-icon': undefined
|
|
29
|
+
|
|
30
|
+
/** Slot definito in `src/components/chat/ChatContainer.tsx:51` */
|
|
31
|
+
'caity-chat-container': undefined
|
|
32
|
+
|
|
33
|
+
/** Slot definito in `src/components/chat/ChatFloatingTrigger.tsx:21` */
|
|
34
|
+
'caity-chat-floating-button': { isChatOpen: boolean; onClick: () => void; }
|
|
35
|
+
|
|
36
|
+
/** Slot definito in `src/components/chat/ChatContainer.tsx:44` */
|
|
37
|
+
'caity-chat-window': undefined
|
|
38
|
+
|
|
39
|
+
/** Slot definito in `src/components/chat/messages/system/ContextMessage.tsx:20` */
|
|
40
|
+
'caity-context-message': { contextTitle: string | undefined; contextTooltip: string | undefined; }
|
|
41
|
+
|
|
42
|
+
/** Slot definito in `src/components/chat/messages/senders/ErrorMessage.tsx:56` */
|
|
43
|
+
'caity-error-message': undefined
|
|
44
|
+
|
|
45
|
+
/** Slot definito in `src/components/chat/footer/ChatFooter.tsx:10` */
|
|
46
|
+
'caity-footer': undefined
|
|
47
|
+
|
|
48
|
+
/** Slot definito in `src/components/chat/messages/system/GreetingMessage.tsx:23` */
|
|
49
|
+
'caity-greeting-message': string
|
|
50
|
+
|
|
51
|
+
/** Slot definito in `src/components/chat/header/ChatHeader.tsx:14` */
|
|
52
|
+
'caity-header': undefined
|
|
53
|
+
|
|
54
|
+
/** Slot definito in `src/components/chat/header/ChatHeaderDropdown.tsx:140` */
|
|
55
|
+
'caity-header-dropdown': {}
|
|
56
|
+
|
|
57
|
+
/** Slot definito in `src/components/chat/header/ChatHeaderDropdown.tsx:153` */
|
|
58
|
+
'caity-header-dropdown-item': undefined
|
|
59
|
+
|
|
60
|
+
/** Slot definito in `src/components/chat/header/ChatHeader.tsx:36` */
|
|
61
|
+
'caity-header-item': undefined
|
|
62
|
+
|
|
63
|
+
/** Slot definito in `src/components/chat/header/ChatHeader.tsx:24` */
|
|
64
|
+
'caity-header-logo': undefined
|
|
65
|
+
|
|
66
|
+
/** Slot definito in `src/components/chat/input/ChatInput.tsx:134` */
|
|
67
|
+
'caity-input': undefined
|
|
68
|
+
|
|
69
|
+
/** Slot definito in `src/components/chat/input/tools/InputToolbox.tsx:66` */
|
|
70
|
+
'caity-input-chars-alert': { availableCharsLabel: string; charLimit: CharLimitState; maxChars: number; currentInputLength: number; }
|
|
71
|
+
|
|
72
|
+
/** Slot definito in `src/components/chat/input/InputTextarea.tsx:33` */
|
|
73
|
+
'caity-input-textarea': { value: string; disabled: boolean; placeholder: string | undefined; onChange: (value: string) => void; onKeyDown: (e: KeyboardEvent<HTMLTextAreaElement>) => void; }
|
|
74
|
+
|
|
75
|
+
/** Slot definito in `src/components/chat/messages/senders/MachineMessage.tsx:90` */
|
|
76
|
+
'caity-machine-message': { message: Message; }
|
|
77
|
+
|
|
78
|
+
/** Slot definito in `src/components/chat/messages/markdown/AssetLink.tsx:146` */
|
|
79
|
+
'caity-machine-message-attachment-chip': { downloadFileFromUrl: (url: string, filename?: string) => Promise<void>; downloadTooltip: string; ext: string; safeUrl: string; key: string; }
|
|
80
|
+
|
|
81
|
+
/** Slot definito in `src/components/chat/messages/ChatMessages.tsx:117` */
|
|
82
|
+
'caity-messages': Message[]
|
|
83
|
+
|
|
84
|
+
/** Slot definito in `src/components/chat/messages/toolbox/MachineToolbox.tsx:44` */
|
|
85
|
+
'caity-msg-action-item': Message
|
|
86
|
+
|
|
87
|
+
/** Slot definito in `src/components/chat/messages/toolbox/MachineToolbox.tsx:40` */
|
|
88
|
+
'caity-msg-actions': Message
|
|
89
|
+
|
|
90
|
+
/** Slot definito in `src/components/chat/messages/toolbox/tools/CollapseButton.tsx:20` */
|
|
91
|
+
'caity-msg-collapse': { collapsedTooltip: string; uncollapsedTooltip: string; collapsed: boolean; onCollapseToggle: () => void; }
|
|
92
|
+
|
|
93
|
+
/** Slot definito in `src/components/chat/messages/toolbox/tools/CopyButton.tsx:32` */
|
|
94
|
+
'caity-msg-copy': { message: Message; tooltip: string; handleCopy: () => void; }
|
|
95
|
+
|
|
96
|
+
/** Slot definito in `src/components/chat/messages/toolbox/tools/DebugButton.tsx:21` */
|
|
97
|
+
'caity-msg-debug': Message
|
|
98
|
+
|
|
99
|
+
/** Slot definito in `src/components/chat/messages/toolbox/tools/FeedbackButtons.tsx:39` */
|
|
100
|
+
'caity-msg-feedback': { message: Message; sendFeedback: (messageId: string, value: number, comment?: string) => Promise<void>; }
|
|
101
|
+
|
|
102
|
+
/** Slot definito in `src/components/chat/messages/toolbox/tools/RetryButton.tsx:34` */
|
|
103
|
+
'caity-msg-retry': { message: Message; prepareRetry: (messageId: string) => void; cancelRetry: () => void; isEditing: boolean; tooltip: string; disabled: boolean; }
|
|
104
|
+
|
|
105
|
+
/** Slot definito in `src/components/chat/messages/toolbox/forms/SelectOptions.tsx:53` */
|
|
106
|
+
'caity-msg-select-option': { message: Message; option: string; idx: number; handleOptionClick: (option: string) => void; }
|
|
107
|
+
|
|
108
|
+
/** Slot definito in `src/components/chat/messages/toolbox/forms/SelectOptions.tsx:46` */
|
|
109
|
+
'caity-msg-select-options': { message: Message; handleOptionClick: (option: string) => void; }
|
|
110
|
+
|
|
111
|
+
/** Slot definito in `src/components/chat/messages/toolbox/tools/SourcesChip.tsx:133` */
|
|
112
|
+
'caity-msg-sources': { message: Message; sourcesTooltip: string; }
|
|
113
|
+
|
|
114
|
+
/** Slot definito in `src/components/chat/messages/toolbox/tools/TimeLabel.tsx:23` */
|
|
115
|
+
'caity-msg-time': { timeLabel: string; enableMessageTime: true; }
|
|
116
|
+
|
|
117
|
+
/** Slot definito in `src/components/chat/messages/toolbox/MachineToolbox.tsx:37` */
|
|
118
|
+
'caity-msg-toolbox': Message
|
|
119
|
+
|
|
120
|
+
/** Slot definito in `src/components/chat/messages/toolbox/tools/TTSButton.tsx:30` */
|
|
121
|
+
'caity-msg-tts': { message: Message; tooltip: string; isActive: boolean; state: TTSState; ttsState: TTSState; playingMessageId: string | null; playTTS: (messageId: string, text: string) => void; stopTTS: () => void; }
|
|
122
|
+
|
|
123
|
+
/** Slot definito in `src/components/chat/messages/ScrollToBottomButton.tsx:13` */
|
|
124
|
+
'caity-scroll-to-bottom-button': { onClick: () => void; label: string; }
|
|
125
|
+
|
|
126
|
+
/** Slot definito in `src/components/chat/messages/senders/WarningMessage.tsx:22` */
|
|
127
|
+
'caity-slow-response-abort-message': undefined
|
|
128
|
+
|
|
129
|
+
/** Slot definito in `src/components/chat/messages/senders/WarningMessage.tsx:15` */
|
|
130
|
+
'caity-slow-response-warning-message': undefined
|
|
131
|
+
|
|
132
|
+
/** Slot definito in `src/components/chat/input/tools/StaticQuestions.tsx:24` */
|
|
133
|
+
'caity-static-question-item': { question: string; onClick: () => void; }
|
|
134
|
+
|
|
135
|
+
/** Slot definito in `src/components/chat/input/tools/StaticQuestions.tsx:14` */
|
|
136
|
+
'caity-static-questions': string[]
|
|
137
|
+
|
|
138
|
+
/** Slot definito in `src/components/chat/messages/system/TimeDividerMessage.tsx:16` */
|
|
139
|
+
'caity-time-divider-message': undefined
|
|
140
|
+
|
|
141
|
+
/** Slot definito in `src/components/chat/input/tools/InputToolbox.tsx:80` */
|
|
142
|
+
'caity-toolbox': { disabled: boolean; sttButtonProps: { sttState: STTState; sttDuration: number; sttError: string | null; startSTT: () => void; stopSTT: () => void; enableVoiceService: boolean | undefined; voiceOptions: VoiceServiceOptions | undefined; disabled: boolean; tooltip: string; }; attachmentButtonProps: { disabled: boolean; open: () => void; enableAttachments: boolean; attachTooltip: string; }; sendButtonProps: { disabled: boolean; onSend: () => void; sendTooltip: string; }; }
|
|
143
|
+
|
|
144
|
+
/** Slot definito in `src/components/chat/input/tools/InputToolbox.tsx:92` */
|
|
145
|
+
'caity-toolbox-item': undefined
|
|
146
|
+
|
|
147
|
+
/** Slot definito in `src/components/chat/input/tools/attachments/AttachmentButton.tsx:9` */
|
|
148
|
+
'caity-toolbox-item-attachment': { disabled: boolean; open: () => void; enableAttachments: boolean; attachTooltip: string; }
|
|
149
|
+
|
|
150
|
+
/** Slot definito in `src/components/chat/input/tools/SendButton.tsx:13` */
|
|
151
|
+
'caity-toolbox-item-send': { sendTooltip: string; disabled: boolean; onSend: () => void; }
|
|
152
|
+
|
|
153
|
+
/** Slot definito in `src/components/chat/input/tools/STTButton.tsx:41` */
|
|
154
|
+
'caity-toolbox-item-stt': { sttState: STTState; sttDuration: number; sttError: string | null; startSTT: () => void; stopSTT: () => void; enableVoiceService?: boolean; disabled: boolean; voiceServiceOptions?: VoiceServiceOptions; tooltip: string; }
|
|
155
|
+
|
|
156
|
+
/** Slot definito in `src/components/chat/messages/senders/UserMessage.tsx:104` */
|
|
157
|
+
'caity-user-message': { message: Message; isLastUserMessage?: boolean; isHidden?: boolean; isHiddenByGuardrail?: boolean; isOutOfContext?: boolean; }
|
|
158
|
+
|
|
159
|
+
/** Slot definito in `src/components/chat/messages/senders/UserMessage.tsx:112` */
|
|
160
|
+
'caity-user-message-attachment-container': { attachments: { fileName: string; id: string; }[]; }
|
|
161
|
+
|
|
162
|
+
/** Slot definito in `src/components/chat/messages/senders/UserMessage.tsx:150` */
|
|
163
|
+
'caity-user-message-content': { message: Message; }
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/** Estrae il tipo di `data` per uno slot specifico. */
|
|
167
|
+
export type TemplateSlotData<K extends keyof TemplateSlotDataMap> = TemplateSlotDataMap[K]
|