@epam/ai-dial-skills 1.2.0-dev.15 → 1.2.0-dev.153
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/components/ChatSkill/ChatSkill.d.ts +3 -2
- package/components/ChatSkill/ChatSkill.d.ts.map +1 -1
- package/components/FavoriteSkillsPanel/FavoriteSkillsPanel.d.ts.map +1 -1
- package/components/SkillArchiveUploadDialog/SkillArchiveUploadDialog.d.ts +9 -0
- package/components/SkillArchiveUploadDialog/SkillArchiveUploadDialog.d.ts.map +1 -0
- package/components/SkillInfoTooltipContent/SkillInfoTooltipContent.d.ts.map +1 -1
- package/components/SkillSelectorField/SkillSelectorField.d.ts +5 -0
- package/components/SkillSelectorField/SkillSelectorField.d.ts.map +1 -0
- package/constants/public-class-names.d.ts +15 -0
- package/constants/public-class-names.d.ts.map +1 -0
- package/hooks/useSkillMentions/useSkillMentions.d.ts +50 -0
- package/hooks/useSkillMentions/useSkillMentions.d.ts.map +1 -0
- package/hooks/useSkillSelectorOverlay/useSkillSelectorOverlay.d.ts +5 -4
- package/hooks/useSkillSelectorOverlay/useSkillSelectorOverlay.d.ts.map +1 -1
- package/index.css +2 -2
- package/index.d.ts +14 -1
- package/index.d.ts.map +1 -1
- package/index.js +523 -206
- package/models/chat-skill-props.d.ts +7 -0
- package/models/chat-skill-props.d.ts.map +1 -1
- package/models/favorite-skills-panel-props.d.ts +32 -5
- package/models/favorite-skills-panel-props.d.ts.map +1 -1
- package/models/skill-archive-upload-dialog-props.d.ts +33 -0
- package/models/skill-archive-upload-dialog-props.d.ts.map +1 -0
- package/models/skill-info-tooltip-content-props.d.ts +6 -0
- package/models/skill-info-tooltip-content-props.d.ts.map +1 -1
- package/models/skill-mention-anchor.d.ts +12 -0
- package/models/skill-mention-anchor.d.ts.map +1 -0
- package/models/skill-selector-field-props.d.ts +80 -0
- package/models/skill-selector-field-props.d.ts.map +1 -0
- package/models/skill-selector-overlay.d.ts +107 -55
- package/models/skill-selector-overlay.d.ts.map +1 -1
- package/package.json +5 -5
- package/test-setup.d.ts +1 -0
- package/utils/skill-mention-matching.d.ts +25 -0
- package/utils/skill-mention-matching.d.ts.map +1 -0
- package/utils/skill-mention-tracking.d.ts +39 -0
- package/utils/skill-mention-tracking.d.ts.map +1 -0
|
@@ -9,6 +9,8 @@ export interface ChatSkillLabels {
|
|
|
9
9
|
*/
|
|
10
10
|
unsupportedTooltipLabel?: string;
|
|
11
11
|
}
|
|
12
|
+
/** How a skill chip opens its description card. */
|
|
13
|
+
export type ChatSkillDetailsTrigger = 'hover' | 'click';
|
|
12
14
|
/** Props for the ChatSkill component. */
|
|
13
15
|
export interface ChatSkillProps {
|
|
14
16
|
/** Display name, rendered after the `/` prefix in the button's label. */
|
|
@@ -40,6 +42,11 @@ export interface ChatSkillProps {
|
|
|
40
42
|
* `isUnsupported` is set. Defaults to `'bg-error'`.
|
|
41
43
|
*/
|
|
42
44
|
unsupportedClassName?: string;
|
|
45
|
+
/**
|
|
46
|
+
* How the description card opens. Defaults to `'hover'` so existing hosts
|
|
47
|
+
* retain their hover-and-focus behaviour.
|
|
48
|
+
*/
|
|
49
|
+
detailsTrigger?: ChatSkillDetailsTrigger;
|
|
43
50
|
/** Called with the skill's path when the tooltip's "View details" button is clicked. */
|
|
44
51
|
onViewDetails: (path: string) => void;
|
|
45
52
|
/** Localizable string overrides. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-skill-props.d.ts","sourceRoot":"","sources":["../../src/models/chat-skill-props.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,MAAM,WAAW,eAAe;IAC9B,mFAAmF;IACnF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC7B,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,yFAAyF;IACzF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,wFAAwF;IACxF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,wFAAwF;IACxF,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,oCAAoC;IACpC,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B"}
|
|
1
|
+
{"version":3,"file":"chat-skill-props.d.ts","sourceRoot":"","sources":["../../src/models/chat-skill-props.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,MAAM,WAAW,eAAe;IAC9B,mFAAmF;IACnF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,mDAAmD;AACnD,MAAM,MAAM,uBAAuB,GAAG,OAAO,GAAG,OAAO,CAAC;AAExD,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC7B,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,yFAAyF;IACzF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,wFAAwF;IACxF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,uBAAuB,CAAC;IACzC,wFAAwF;IACxF,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,oCAAoC;IACpC,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B"}
|
|
@@ -31,14 +31,18 @@ export interface FavoriteSkillsPanelColors {
|
|
|
31
31
|
export interface FavoriteSkillsPanelProps {
|
|
32
32
|
/** The user's favorited skills, already resolved by the host. */
|
|
33
33
|
favorites: FavoriteSkillItem[];
|
|
34
|
-
/** Called when a row is activated (click, Enter, or Space). */
|
|
34
|
+
/** Called when a row is activated (click, Enter, or Space — or, in listbox mode, Enter in the owning text field while the row is active). */
|
|
35
35
|
onSelect: (item: FavoriteSkillItem) => void;
|
|
36
|
-
/**
|
|
37
|
-
onToggleFavorite
|
|
36
|
+
/** Removes a favorite by id; omitted hides the star action. */
|
|
37
|
+
onToggleFavorite?: (id: string) => void;
|
|
38
38
|
/** Called when the "Browse" button is clicked. */
|
|
39
39
|
onBrowse: () => void;
|
|
40
|
-
/**
|
|
41
|
-
onViewDetails
|
|
40
|
+
/** Opens skill details; omitted hides the details tooltip. */
|
|
41
|
+
onViewDetails?: (item: FavoriteSkillItem) => void;
|
|
42
|
+
/** Additional classes applied to the panel root. */
|
|
43
|
+
className?: string;
|
|
44
|
+
/** Additional classes applied to each favorite row. */
|
|
45
|
+
rowClassName?: string;
|
|
42
46
|
/**
|
|
43
47
|
* When provided, the panel enters search mode: rows are filtered to names
|
|
44
48
|
* containing this string case-insensitively and matched names render with a
|
|
@@ -46,6 +50,29 @@ export interface FavoriteSkillsPanelProps {
|
|
|
46
50
|
* favorites unfiltered.
|
|
47
51
|
*/
|
|
48
52
|
searchQuery?: string;
|
|
53
|
+
/**
|
|
54
|
+
* When provided, the list renders as a `role="listbox"` with this `id` and
|
|
55
|
+
* each row as a `role="option"` — the shape a list autocomplete (e.g. the
|
|
56
|
+
* conversation input's `commandMenu`) drives from its text field. In this
|
|
57
|
+
* mode Tab moves from row to row: a row's star and its tooltip's "View
|
|
58
|
+
* details" stay clickable but leave the Tab sequence. Omit for the plain
|
|
59
|
+
* list of button rows.
|
|
60
|
+
*/
|
|
61
|
+
listboxId?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Renders the rows and the "Browse" action as `role="menuitem"` for a host
|
|
64
|
+
* that mounts the panel inside a `role="menu"` container (e.g. a submenu
|
|
65
|
+
* whose arrow keys move between menu items). Ignored with `listboxId`.
|
|
66
|
+
* Defaults to `false`: rows are `role="button"`.
|
|
67
|
+
*/
|
|
68
|
+
isMenu?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* `id` of the row the owning text field has active, rendered with
|
|
71
|
+
* `aria-selected="true"` and the row highlight — pass through the id the
|
|
72
|
+
* text field reports; row ids are derived from `listboxId` and each item's
|
|
73
|
+
* id. Used only with `listboxId`.
|
|
74
|
+
*/
|
|
75
|
+
activeOptionId?: string | null;
|
|
49
76
|
/** Localizable string overrides. */
|
|
50
77
|
labels?: FavoriteSkillsPanelLabels;
|
|
51
78
|
/** Color overrides applied as CSS custom properties. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"favorite-skills-panel-props.d.ts","sourceRoot":"","sources":["../../src/models/favorite-skills-panel-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,kFAAkF;AAClF,MAAM,WAAW,yBAAyB;IACxC,sEAAsE;IACtE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,2FAA2F;IAC3F,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6GAA6G;IAC7G,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,qFAAqF;IACrF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oGAAoG;IACpG,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,6DAA6D;AAC7D,MAAM,WAAW,yBAAyB;IACxC,2EAA2E;IAC3E,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sFAAsF;IACtF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,+CAA+C;AAC/C,MAAM,WAAW,wBAAwB;IACvC,iEAAiE;IACjE,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAC/B
|
|
1
|
+
{"version":3,"file":"favorite-skills-panel-props.d.ts","sourceRoot":"","sources":["../../src/models/favorite-skills-panel-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,kFAAkF;AAClF,MAAM,WAAW,yBAAyB;IACxC,sEAAsE;IACtE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,2FAA2F;IAC3F,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6GAA6G;IAC7G,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,qFAAqF;IACrF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oGAAoG;IACpG,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,6DAA6D;AAC7D,MAAM,WAAW,yBAAyB;IACxC,2EAA2E;IAC3E,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sFAAsF;IACtF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,+CAA+C;AAC/C,MAAM,WAAW,wBAAwB;IACvC,iEAAiE;IACjE,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAC/B,6IAA6I;IAC7I,QAAQ,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5C,+DAA+D;IAC/D,gBAAgB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,kDAAkD;IAClD,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,8DAA8D;IAC9D,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAClD,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,oCAAoC;IACpC,MAAM,CAAC,EAAE,yBAAyB,CAAC;IACnC,wDAAwD;IACxD,MAAM,CAAC,EAAE,yBAAyB,CAAC;IACnC,gFAAgF;IAChF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oIAAoI;IACpI,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sFAAsF;IACtF,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** Labels for {@link SkillArchiveUploadDialogProps}; each has an English default. */
|
|
2
|
+
export interface SkillArchiveUploadDialogLabels {
|
|
3
|
+
/** Dialog header. Defaults to `'Upload skill'`. */
|
|
4
|
+
dialogTitle?: string;
|
|
5
|
+
/** Drop-zone label shown on desktop widths. Defaults to `'Drag and drop it or click here to upload'`. */
|
|
6
|
+
dropZoneLabel?: string;
|
|
7
|
+
/** Drop-zone label shown on mobile widths. Defaults to `'Click here to upload'`. */
|
|
8
|
+
dropZoneMobileLabel?: string;
|
|
9
|
+
/** Sentence describing accepted formats, shown under the drop zone. Defaults to `'File formats .zip and SKILL.md'`. */
|
|
10
|
+
formatsLabel?: string;
|
|
11
|
+
/** Accessible name for the native file input. Defaults to `'Upload a skill ZIP archive or a SKILL.md file'`. */
|
|
12
|
+
fileInputAriaLabel?: string;
|
|
13
|
+
/** Accessible name for the dialog's close button. Defaults to `'Close'`. */
|
|
14
|
+
closeAriaLabel?: string;
|
|
15
|
+
}
|
|
16
|
+
/** Props for {@link SkillArchiveUploadDialog}. */
|
|
17
|
+
export interface SkillArchiveUploadDialogProps {
|
|
18
|
+
/** Whether the dialog is open. */
|
|
19
|
+
isOpen: boolean;
|
|
20
|
+
/** Rejection message rendered under the drop area; omit when nothing was rejected. */
|
|
21
|
+
errorText?: string;
|
|
22
|
+
/** `accept` value forwarded to the drop zone/native file input. Defaults to `'.zip,.md'`. */
|
|
23
|
+
accept?: string;
|
|
24
|
+
/** Labels rendered by the dialog; each falls back to an English default. */
|
|
25
|
+
labels?: SkillArchiveUploadDialogLabels;
|
|
26
|
+
/** Called on Escape, the close button, or an outside click. */
|
|
27
|
+
onClose: () => void;
|
|
28
|
+
/** Called with the picked or dropped files that `accept` allowed through. */
|
|
29
|
+
onFilesSelected: (files: File[]) => void;
|
|
30
|
+
/** Called when a drop carried files that `accept` excluded. */
|
|
31
|
+
onFilesRejected: () => void;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=skill-archive-upload-dialog-props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-archive-upload-dialog-props.d.ts","sourceRoot":"","sources":["../../src/models/skill-archive-upload-dialog-props.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,MAAM,WAAW,8BAA8B;IAC7C,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yGAAyG;IACzG,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oFAAoF;IACpF,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,uHAAuH;IACvH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gHAAgH;IAChH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,kDAAkD;AAClD,MAAM,WAAW,6BAA6B;IAC5C,kCAAkC;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,sFAAsF;IACtF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6FAA6F;IAC7F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,8BAA8B,CAAC;IACxC,+DAA+D;IAC/D,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,6EAA6E;IAC7E,eAAe,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IACzC,+DAA+D;IAC/D,eAAe,EAAE,MAAM,IAAI,CAAC;CAC7B"}
|
|
@@ -11,5 +11,11 @@ export interface SkillInfoTooltipContentProps {
|
|
|
11
11
|
viewDetailsLabel?: string;
|
|
12
12
|
/** Called when the "View details" button is clicked. Unused while `unsupportedMessage` is set. */
|
|
13
13
|
onViewDetails?: () => void;
|
|
14
|
+
/**
|
|
15
|
+
* `tabIndex` of the "View details" button. Pass `-1` to keep it out of the
|
|
16
|
+
* Tab sequence (still clickable) where the tooltip hangs off a list row and
|
|
17
|
+
* Tab should move from row to row. Unset keeps the button's default.
|
|
18
|
+
*/
|
|
19
|
+
viewDetailsTabIndex?: number;
|
|
14
20
|
}
|
|
15
21
|
//# sourceMappingURL=skill-info-tooltip-content-props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-info-tooltip-content-props.d.ts","sourceRoot":"","sources":["../../src/models/skill-info-tooltip-content-props.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,MAAM,WAAW,4BAA4B;IAC3C,sFAAsF;IACtF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yEAAyE;IACzE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kGAAkG;IAClG,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"skill-info-tooltip-content-props.d.ts","sourceRoot":"","sources":["../../src/models/skill-info-tooltip-content-props.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,MAAM,WAAW,4BAA4B;IAC3C,sFAAsF;IACtF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yEAAyE;IACzE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kGAAkG;IAClG,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** A skill mention's location within the current plain-text draft. */
|
|
2
|
+
export interface SkillMentionAnchor {
|
|
3
|
+
/** The mentioned skill's resource URL — the value sent as this entry's `{ url }`. */
|
|
4
|
+
url: string;
|
|
5
|
+
/** Display name at the time of insertion (`/${name}` is what actually sits in the text). */
|
|
6
|
+
name: string;
|
|
7
|
+
/** Character offset of the leading `/` in the current draft string. */
|
|
8
|
+
start: number;
|
|
9
|
+
/** Length of the `/{name}` run, `1 + name.length`. */
|
|
10
|
+
length: number;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=skill-mention-anchor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-mention-anchor.d.ts","sourceRoot":"","sources":["../../src/models/skill-mention-anchor.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,MAAM,WAAW,kBAAkB;IACjC,qFAAqF;IACrF,GAAG,EAAE,MAAM,CAAC;IACZ,4FAA4F;IAC5F,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { FavoriteSkillItem } from './favorite-skill-item';
|
|
3
|
+
import { FavoriteSkillsPanelLabels } from './favorite-skills-panel-props';
|
|
4
|
+
import { SkillCatalogModalProps } from './skill-catalog-modal-props';
|
|
5
|
+
/** Translated text for a controlled skill field. */
|
|
6
|
+
export interface SkillSelectorFieldLabels {
|
|
7
|
+
/** Empty selection text. */
|
|
8
|
+
placeholder: string;
|
|
9
|
+
/** Browse dialog title. */
|
|
10
|
+
modalTitle: string;
|
|
11
|
+
/** Accessible name of the removal control. */
|
|
12
|
+
removeSkillLabel: string;
|
|
13
|
+
/** Explanation shown when the selected model cannot use skills. */
|
|
14
|
+
unsupportedTooltipLabel: string;
|
|
15
|
+
/** Favorites panel text; omitted entries use the panel's English defaults. */
|
|
16
|
+
panelLabels?: FavoriteSkillsPanelLabels;
|
|
17
|
+
/** Favorites search label and placeholder. Defaults to 'Search skills'. */
|
|
18
|
+
searchPlaceholder?: string;
|
|
19
|
+
/** Accessible search clear label. Defaults to 'Clear search'. */
|
|
20
|
+
clearSearchLabel?: string;
|
|
21
|
+
}
|
|
22
|
+
/** Per-instance theme and typography overrides for the skill field. */
|
|
23
|
+
export interface SkillSelectorFieldStyles {
|
|
24
|
+
/** Field color overrides; omitted values use the host theme. */
|
|
25
|
+
colors?: {
|
|
26
|
+
/** Text color. */
|
|
27
|
+
text?: string;
|
|
28
|
+
/** Field background. */
|
|
29
|
+
background?: string;
|
|
30
|
+
/** Field border. */
|
|
31
|
+
border?: string;
|
|
32
|
+
/** Invalid-state text and border. */
|
|
33
|
+
error?: string;
|
|
34
|
+
};
|
|
35
|
+
/** Label typography overrides. */
|
|
36
|
+
typography?: {
|
|
37
|
+
/** CSS classes applied to the value. Defaults to 'dial-small-text'. */
|
|
38
|
+
fontClassName?: string;
|
|
39
|
+
};
|
|
40
|
+
/** Additional classes applied to the input wrapper. */
|
|
41
|
+
triggerClassName?: string;
|
|
42
|
+
/** CSS custom properties merged after the typed overrides. */
|
|
43
|
+
cssVars?: CSSProperties;
|
|
44
|
+
}
|
|
45
|
+
/** Host-controlled selection; catalog data and rendering belong to the caller. */
|
|
46
|
+
export interface SkillSelectorFieldProps {
|
|
47
|
+
/** Selected reference, independent of catalog loading. */
|
|
48
|
+
value?: string;
|
|
49
|
+
/** Called to replace or remove the selected reference. */
|
|
50
|
+
onChange: (value: string | undefined) => void;
|
|
51
|
+
/** Resolved name; defaults to the full selected reference. */
|
|
52
|
+
displayName?: string;
|
|
53
|
+
/** Host-resolved favorite skills. Defaults to an empty list. */
|
|
54
|
+
favorites?: FavoriteSkillItem[];
|
|
55
|
+
/** Removes a skill from favorites; omitted hides the star action. */
|
|
56
|
+
onToggleFavorite?: (id: string) => void;
|
|
57
|
+
/** Opens host-owned skill details; omitted hides the details tooltip. */
|
|
58
|
+
onViewDetails?: (item: FavoriteSkillItem) => void;
|
|
59
|
+
/** Optional popup presentation, such as a mobile sheet. Defaults to a dropdown. */
|
|
60
|
+
renderOverlay?: (panel: ReactNode, isOpen: boolean, onClose: () => void) => ReactNode;
|
|
61
|
+
/** Explicit skill support for the selected model. */
|
|
62
|
+
isSkillsSupported: boolean;
|
|
63
|
+
/** Disables all controls. Defaults to false. */
|
|
64
|
+
isDisabled?: boolean;
|
|
65
|
+
/** Host validation state. Defaults to false. */
|
|
66
|
+
isInvalid?: boolean;
|
|
67
|
+
/** ID of the host-rendered label. */
|
|
68
|
+
labelledById: string;
|
|
69
|
+
/** ID of host-rendered feedback. */
|
|
70
|
+
describedById?: string;
|
|
71
|
+
/** Translated visible and accessible text. */
|
|
72
|
+
labels: SkillSelectorFieldLabels;
|
|
73
|
+
/** Catalog content that calls back with the selected reference. */
|
|
74
|
+
renderCatalogContent: SkillCatalogModalProps['renderContent'];
|
|
75
|
+
/** Additional classes applied to the root. */
|
|
76
|
+
className?: string;
|
|
77
|
+
/** Theme and typography overrides. */
|
|
78
|
+
styles?: SkillSelectorFieldStyles;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=skill-selector-field-props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-selector-field-props.d.ts","sourceRoot":"","sources":["../../src/models/skill-selector-field-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAE1E,oDAAoD;AACpD,MAAM,WAAW,wBAAwB;IACvC,4BAA4B;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,gBAAgB,EAAE,MAAM,CAAC;IACzB,mEAAmE;IACnE,uBAAuB,EAAE,MAAM,CAAC;IAChC,8EAA8E;IAC9E,WAAW,CAAC,EAAE,yBAAyB,CAAC;IACxC,2EAA2E;IAC3E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,uEAAuE;AACvE,MAAM,WAAW,wBAAwB;IACvC,gEAAgE;IAChE,MAAM,CAAC,EAAE;QACP,kBAAkB;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,wBAAwB;QACxB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,oBAAoB;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,qCAAqC;QACrC,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,kCAAkC;IAClC,UAAU,CAAC,EAAE;QACX,uEAAuE;QACvE,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,uDAAuD;IACvD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,8DAA8D;IAC9D,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,kFAAkF;AAClF,MAAM,WAAW,uBAAuB;IACtC,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC9C,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gEAAgE;IAChE,SAAS,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAChC,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,yEAAyE;IACzE,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAClD,mFAAmF;IACnF,aAAa,CAAC,EAAE,CACd,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,MAAM,IAAI,KAChB,SAAS,CAAC;IACf,qDAAqD;IACrD,iBAAiB,EAAE,OAAO,CAAC;IAC3B,gDAAgD;IAChD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gDAAgD;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,qCAAqC;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,8CAA8C;IAC9C,MAAM,EAAE,wBAAwB,CAAC;IACjC,mEAAmE;IACnE,oBAAoB,EAAE,sBAAsB,CAAC,eAAe,CAAC,CAAC;IAC9D,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,MAAM,CAAC,EAAE,wBAAwB,CAAC;CACnC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { RequestSkill } from '
|
|
2
|
-
import { CommandMenuConfig, MenuOverlayConfig } from '@epam/ai-dial-conversation-input';
|
|
1
|
+
import { RequestSkill } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
import { CommandMenuConfig, HighlightedTextRange, MenuOverlayConfig } from '@epam/ai-dial-conversation-input';
|
|
3
3
|
import { ComponentType, ReactNode } from 'react';
|
|
4
|
+
import { ChatSkillDetailsTrigger } from './chat-skill-props';
|
|
4
5
|
import { SkillListingEntry } from './favorite-skill-item';
|
|
5
6
|
import { FavoriteSkillsPanelLabels } from './favorite-skills-panel-props';
|
|
6
7
|
/**
|
|
@@ -28,11 +29,6 @@ export interface SkillSelectorOverlayLabels {
|
|
|
28
29
|
* is open with an empty query. Defaults to `'Type to filter'`.
|
|
29
30
|
*/
|
|
30
31
|
emptyQueryHintLabel?: string;
|
|
31
|
-
/**
|
|
32
|
-
* Message shown alone in the selected skill chip's error-state tooltip
|
|
33
|
-
* while the current deployment does not support skills.
|
|
34
|
-
*/
|
|
35
|
-
unsupportedTooltipLabel?: string;
|
|
36
32
|
/** Labels forwarded to the favorites panel rendered as the overlay. */
|
|
37
33
|
panelLabels?: FavoriteSkillsPanelLabels;
|
|
38
34
|
}
|
|
@@ -46,9 +42,13 @@ export interface UseSkillSelectorOverlayOptions {
|
|
|
46
42
|
/**
|
|
47
43
|
* Whether the input's current deployment supports skills. While `false`
|
|
48
44
|
* (with the flow enabled) the entry points are omitted — no Add-menu item
|
|
49
|
-
* and no slash menu — but
|
|
50
|
-
*
|
|
51
|
-
*
|
|
45
|
+
* and no slash menu — but a tracked mention stays in the draft text and
|
|
46
|
+
* folds into `isSkillUnsupported` for the host's own send-disabled
|
|
47
|
+
* condition. The host resolves this from its own deployment data. Note: a
|
|
48
|
+
* live-composing mention has no per-mention error styling of its own (it
|
|
49
|
+
* renders as a plain highlighted run, not a `ChatSkill`); only the sent
|
|
50
|
+
* `custom_content.skills`/history rendering, and this boolean fold, reflect
|
|
51
|
+
* the unsupported state.
|
|
52
52
|
*/
|
|
53
53
|
isSkillsSupported: boolean;
|
|
54
54
|
/** The user's own skills. */
|
|
@@ -71,6 +71,11 @@ export interface UseSkillSelectorOverlayOptions {
|
|
|
71
71
|
* to that line. Unset falls back to the chip's own default label class.
|
|
72
72
|
*/
|
|
73
73
|
historyChipLabelClassName?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Trigger used by mentions rendered in an active composer. Unset retains
|
|
76
|
+
* `ChatSkill`'s hover-and-focus default; history chips are unaffected.
|
|
77
|
+
*/
|
|
78
|
+
activeMentionDetailsTrigger?: ChatSkillDetailsTrigger;
|
|
74
79
|
/**
|
|
75
80
|
* Renders the browse modal's picker content (e.g. a host catalog view);
|
|
76
81
|
* receives the selection and close callbacks to wire into it, and is
|
|
@@ -84,18 +89,18 @@ export interface UseSkillSelectorOverlayOptions {
|
|
|
84
89
|
export interface UseSkillSelectorOverlayResult {
|
|
85
90
|
/**
|
|
86
91
|
* The Skills entry for the `menuOverlays` prop of
|
|
87
|
-
* `ConversationInput`/`Input`. `undefined` while the flow
|
|
88
|
-
* current deployment does not support skills: the host
|
|
89
|
-
* entirely when this is `undefined`, so a stub renderer
|
|
90
|
-
* menu item in place with nothing behind it.
|
|
92
|
+
* `ConversationInput`/`EditMessageInput`/`Input`. `undefined` while the flow
|
|
93
|
+
* is disabled or the current deployment does not support skills: the host
|
|
94
|
+
* omits the entry entirely when this is `undefined`, so a stub renderer
|
|
95
|
+
* would leave the menu item in place with nothing behind it.
|
|
91
96
|
*/
|
|
92
97
|
skillMenuOverlay?: MenuOverlayConfig;
|
|
93
98
|
/**
|
|
94
99
|
* The Skills entry for the `commandMenu` prop of
|
|
95
|
-
* `ConversationInput`/`Input`: typing `/` into an empty
|
|
96
|
-
* favorites panel in search mode above the input.
|
|
97
|
-
* flow is disabled or the current deployment does not
|
|
98
|
-
* disabling the slash menu entirely.
|
|
100
|
+
* `ConversationInput`/`EditMessageInput`/`Input`: typing `/` into an empty
|
|
101
|
+
* textarea opens the favorites panel in search mode above the input.
|
|
102
|
+
* `undefined` while the flow is disabled or the current deployment does not
|
|
103
|
+
* support skills, disabling the slash menu entirely.
|
|
99
104
|
*/
|
|
100
105
|
commandMenu?: CommandMenuConfig;
|
|
101
106
|
/**
|
|
@@ -109,55 +114,102 @@ export interface UseSkillSelectorOverlayResult {
|
|
|
109
114
|
*/
|
|
110
115
|
skillDetailsPanel: ReactNode;
|
|
111
116
|
/**
|
|
112
|
-
* The
|
|
113
|
-
* `
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
117
|
+
* The composer's message text after the most recent skill selection, with
|
|
118
|
+
* every `/{name}` mention spliced in. Pass straight through to
|
|
119
|
+
* `ConversationInput`/`EditMessageInput`'s own `message` prop alongside
|
|
120
|
+
* `messageRevision` — like that prop's existing "populated by a starter
|
|
121
|
+
* selection" use, this is a one-shot push applied on a `messageRevision`
|
|
122
|
+
* bump, not a value the host feeds back on every keystroke (ordinary typing
|
|
123
|
+
* is tracked separately through `onDraftChange`).
|
|
119
124
|
*/
|
|
120
|
-
|
|
125
|
+
message: string;
|
|
121
126
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
* `
|
|
127
|
+
* Token that forces `message` to re-apply even when its string value is
|
|
128
|
+
* unchanged from the last push (e.g. the same skill selected again).
|
|
129
|
+
* Bumped on every call to the selection handlers backing `skillMenuOverlay`
|
|
130
|
+
* and `commandMenu`. Pass straight through to the composer's own
|
|
131
|
+
* `messageRevision` prop.
|
|
126
132
|
*/
|
|
127
|
-
|
|
133
|
+
messageRevision: number;
|
|
128
134
|
/**
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
* `
|
|
132
|
-
* disabled.
|
|
135
|
+
* Every currently-tracked skill mention's character range within the
|
|
136
|
+
* composer's live draft text, for `ConversationInput`/`EditMessageInput`/
|
|
137
|
+
* `Input`'s `activeMentions` prop (the live-composing highlighted-run
|
|
138
|
+
* render). Empty while nothing is mentioned or the flow is disabled.
|
|
133
139
|
*/
|
|
134
|
-
|
|
140
|
+
activeMentions: HighlightedTextRange[];
|
|
135
141
|
/**
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
142
|
+
* Reconciles tracked mentions against an external edit to the composer's
|
|
143
|
+
* draft text (ordinary typing, deleting, pasting, undo/redo). Wire to the
|
|
144
|
+
* composer's own `onChange` callback, in addition to whatever the host
|
|
145
|
+
* already does with that value — this keeps `activeMentions`/
|
|
146
|
+
* `selectedSkills` in sync with live edits between selections.
|
|
139
147
|
*/
|
|
140
|
-
|
|
148
|
+
onDraftChange: (nextValue: string) => void;
|
|
141
149
|
/**
|
|
142
|
-
*
|
|
143
|
-
* any
|
|
150
|
+
* Looks up the mention whose run ends exactly at `caretPosition`, without
|
|
151
|
+
* mutating any state. Pass straight through to the composer's
|
|
152
|
+
* `onBackspaceAtCaret` prop, which performs the actual whole-mention
|
|
153
|
+
* deletion through the textarea's native editing pipeline and reports the
|
|
154
|
+
* result back through `onDraftChange`. Returns `undefined` when the caret
|
|
155
|
+
* isn't at a mention boundary.
|
|
144
156
|
*/
|
|
145
|
-
|
|
157
|
+
onBackspaceAtCaret: (caretPosition: number) => HighlightedTextRange | undefined;
|
|
146
158
|
/**
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
159
|
+
* Caret offset to place the cursor at immediately after the most recent
|
|
160
|
+
* skill selection applies `message`/`messageRevision` — the position right
|
|
161
|
+
* after the inserted mention's text. Pass straight through to the
|
|
162
|
+
* composer's `caretPositionOverride` prop. `undefined` before any selection
|
|
163
|
+
* has been made this session.
|
|
150
164
|
*/
|
|
151
|
-
|
|
165
|
+
caretPositionOverride: number | undefined;
|
|
166
|
+
/**
|
|
167
|
+
* Whether at least one skill is mentioned while the current deployment does
|
|
168
|
+
* not support skills — hosts must fold this into their send-disabled
|
|
169
|
+
* conditions. Always `false` while `isEnabled` is `false`.
|
|
170
|
+
*/
|
|
171
|
+
isSkillUnsupported: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* Every currently-tracked mention as the send-time `custom_content.skills`
|
|
174
|
+
* payload, in left-to-right text order — `undefined` while nothing is
|
|
175
|
+
* mentioned or the flow is disabled, so `custom_content.skills` is omitted
|
|
176
|
+
* entirely. Cleared to `undefined` by `resetSkillMentions` after a
|
|
177
|
+
* successful send.
|
|
178
|
+
*/
|
|
179
|
+
selectedSkills: RequestSkill[] | undefined;
|
|
152
180
|
/**
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
*
|
|
160
|
-
* `
|
|
181
|
+
* Clears every tracked mention and the draft text alongside it. Call after
|
|
182
|
+
* a successful send, matching the per-message selection-clears semantics of
|
|
183
|
+
* `custom_content.skills`.
|
|
184
|
+
*/
|
|
185
|
+
resetSkillMentions: () => void;
|
|
186
|
+
/**
|
|
187
|
+
* Seeds the draft and its tracked mentions from a persisted message — runs
|
|
188
|
+
* `matchSkillMentions` once against `content`/`skills` and initializes
|
|
189
|
+
* `message`/`activeMentions` from the result (bumping `messageRevision`).
|
|
190
|
+
* Call once when entering edit mode on a message that carries
|
|
191
|
+
* `custom_content.skills`.
|
|
192
|
+
*/
|
|
193
|
+
seedSkillMentions: (content: string, skills: RequestSkill[] | undefined) => void;
|
|
194
|
+
/**
|
|
195
|
+
* Renders a user message's `content` and `custom_content.skills` as an
|
|
196
|
+
* ordered array interleaving plain-text runs and `ChatSkill` elements at
|
|
197
|
+
* each mention's actual text position — for `UserMessageBubble`'s
|
|
198
|
+
* `textSegments` prop. Resolves each entry's name from the listing pools
|
|
199
|
+
* matched on its url, falling back to the url's last non-empty segment,
|
|
200
|
+
* sharing the "View details" panel with the favorite rows. Returns `null`
|
|
201
|
+
* while `isEnabled` is `false` or `skills` is empty/absent; a mention
|
|
202
|
+
* `matchSkillMentions` cannot locate in `content` is simply omitted from
|
|
203
|
+
* the render (see `matchSkillMentions`'s own doc for that heuristic).
|
|
204
|
+
*/
|
|
205
|
+
renderHistorySkillSegments: (content: string, skills: RequestSkill[] | undefined) => ReactNode[] | null;
|
|
206
|
+
/**
|
|
207
|
+
* Renders every entry of `skills` as a flat list of `ChatSkill` elements,
|
|
208
|
+
* ignoring text position — for `AssistantMessageBubble`'s `beforeContent`
|
|
209
|
+
* slot, since assistant text is model-generated markdown and never
|
|
210
|
+
* authors positioned mentions. Each entry's name/description resolve the
|
|
211
|
+
* same way as `renderHistorySkillSegments`. Returns `null` while
|
|
212
|
+
* `isEnabled` is `false` or the array is empty/absent.
|
|
161
213
|
*/
|
|
162
214
|
renderHistorySkills: (skills: RequestSkill[] | undefined) => ReactNode;
|
|
163
215
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-selector-overlay.d.ts","sourceRoot":"","sources":["../../src/models/skill-selector-overlay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE/E;;;;;GAKG;AACH,MAAM,WAAW,+BAA+B;IAC9C,iFAAiF;IACjF,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,2EAA2E;IAC3E,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,qEAAqE;AACrE,MAAM,WAAW,0BAA0B;IACzC,2EAA2E;IAC3E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gFAAgF;IAChF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B
|
|
1
|
+
{"version":3,"file":"skill-selector-overlay.d.ts","sourceRoot":"","sources":["../../src/models/skill-selector-overlay.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-skills",
|
|
3
3
|
"description": "Host-agnostic UI for picking a favorite skill to attach to a chat input",
|
|
4
|
-
"version": "1.2.0-dev.
|
|
4
|
+
"version": "1.2.0-dev.153",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@tabler/icons-react": "^3.44.0",
|
|
21
|
-
"@epam/ai-dial-catalog": "1.2.0-dev.
|
|
22
|
-
"@epam/ai-dial-conversation-input": "1.2.0-dev.
|
|
21
|
+
"@epam/ai-dial-catalog": "1.2.0-dev.153",
|
|
22
|
+
"@epam/ai-dial-conversation-input": "1.2.0-dev.153"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@epam/ai-dial-chat-shared": "1.2.0-dev.
|
|
26
|
-
"@epam/ai-dial-ui-kit": "^0.
|
|
25
|
+
"@epam/ai-dial-chat-shared": "1.2.0-dev.153",
|
|
26
|
+
"@epam/ai-dial-ui-kit": "^0.15.0-dev.19",
|
|
27
27
|
"react": "^19.2.8"
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|
package/test-setup.d.ts
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { RequestSkill } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
/** One resolved mention location, or omitted for a skill whose text mention could not be found. */
|
|
3
|
+
export interface ResolvedSkillMention {
|
|
4
|
+
/** Index into the input `skills` array this location resolves. */
|
|
5
|
+
skillIndex: number;
|
|
6
|
+
/** Character offset of the leading `/` in `text`. */
|
|
7
|
+
start: number;
|
|
8
|
+
/** Length of the matched `/{name}` run. */
|
|
9
|
+
length: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Matches each entry of `skills` (in array order) to the next available
|
|
13
|
+
* `/{name}` occurrence in `text`, where `name` is that entry's display name
|
|
14
|
+
* resolved via `resolveName(url)` — the current listing name, falling back to
|
|
15
|
+
* the url's last path segment (`getSkillFallbackName`). Scans left to right,
|
|
16
|
+
* consuming text as it goes, so two skills with the same resolved name are
|
|
17
|
+
* still matched to distinct, successive occurrences in the text. A skill
|
|
18
|
+
* whose exact `/{name}` cannot be found at or after the current scan position
|
|
19
|
+
* (e.g. the user's later edit broke the mention) is omitted from the result —
|
|
20
|
+
* it still counts as a real `custom_content.skills` entry for sending, it
|
|
21
|
+
* simply renders nowhere in particular, and later entries still get their own
|
|
22
|
+
* independent forward search from the same unmoved cursor.
|
|
23
|
+
*/
|
|
24
|
+
export declare const matchSkillMentions: (text: string, skills: RequestSkill[], resolveName: (url: string) => string) => ResolvedSkillMention[];
|
|
25
|
+
//# sourceMappingURL=skill-mention-matching.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-mention-matching.d.ts","sourceRoot":"","sources":["../../src/utils/skill-mention-matching.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,mGAAmG;AACnG,MAAM,WAAW,oBAAoB;IACnC,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;CAChB;AAKD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB,GAC7B,MAAM,MAAM,EACZ,QAAQ,YAAY,EAAE,EACtB,aAAa,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,KACnC,oBAAoB,EA0BtB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { SkillMentionAnchor } from '../models/skill-mention-anchor';
|
|
2
|
+
/** A single-region text edit, expressed as the replaced range in the previous string. */
|
|
3
|
+
export interface TextChange {
|
|
4
|
+
/** Character offset where the previous and next strings first diverge. */
|
|
5
|
+
start: number;
|
|
6
|
+
/** Number of characters removed from the previous string at `start`. */
|
|
7
|
+
deletedLength: number;
|
|
8
|
+
/** Number of characters inserted at `start` in the next string. */
|
|
9
|
+
insertedLength: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Diffs two strings produced by a single-cursor edit (typing, deleting,
|
|
13
|
+
* pasting, cutting, undo/redo) via their common prefix and common suffix —
|
|
14
|
+
* cheap (O(n)) and exact for that class of edit, which is everything a
|
|
15
|
+
* textarea actually produces.
|
|
16
|
+
*/
|
|
17
|
+
export declare const diffTextChange: (previous: string, next: string) => TextChange;
|
|
18
|
+
/**
|
|
19
|
+
* Applies a text change to a set of tracked mention anchors: an anchor
|
|
20
|
+
* entirely before the edited region is untouched, one entirely after is
|
|
21
|
+
* shifted by the edit's length delta, and one that overlaps the edited region
|
|
22
|
+
* is dropped — the user edited into the middle of a mention, so it reverts to
|
|
23
|
+
* plain text and no longer contributes a `custom_content.skills` entry.
|
|
24
|
+
*/
|
|
25
|
+
export declare const reconcileAnchors: (anchors: SkillMentionAnchor[], change: TextChange) => SkillMentionAnchor[];
|
|
26
|
+
/**
|
|
27
|
+
* Inserts a new mention anchor at `atIndex` and shifts every anchor at or
|
|
28
|
+
* after that index by the inserted `/{name}` run's length — plus one more
|
|
29
|
+
* when `hasTrailingSpace` — keeping the result ordered by `start`
|
|
30
|
+
* (left-to-right reading order).
|
|
31
|
+
*/
|
|
32
|
+
export declare const insertAnchor: (anchors: SkillMentionAnchor[], atIndex: number, url: string, name: string, hasTrailingSpace: boolean) => SkillMentionAnchor[];
|
|
33
|
+
/**
|
|
34
|
+
* Finds the anchor whose mention run ends exactly at `caretPosition` — the
|
|
35
|
+
* caret sitting immediately after that mention — or `undefined` if none does.
|
|
36
|
+
* Used to detect the whole-mention Backspace gesture.
|
|
37
|
+
*/
|
|
38
|
+
export declare const findMentionAtCaret: (anchors: SkillMentionAnchor[], caretPosition: number) => SkillMentionAnchor | undefined;
|
|
39
|
+
//# sourceMappingURL=skill-mention-tracking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-mention-tracking.d.ts","sourceRoot":"","sources":["../../src/utils/skill-mention-tracking.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,yFAAyF;AACzF,MAAM,WAAW,UAAU;IACzB,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,aAAa,EAAE,MAAM,CAAC;IACtB,mEAAmE;IACnE,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,MAAM,EAAE,MAAM,MAAM,KAAG,UAyB/D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAC3B,SAAS,kBAAkB,EAAE,EAC7B,QAAQ,UAAU,KACjB,kBAAkB,EAmBpB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GACvB,SAAS,kBAAkB,EAAE,EAC7B,SAAS,MAAM,EACf,KAAK,MAAM,EACX,MAAM,MAAM,EACZ,kBAAkB,OAAO,KACxB,kBAAkB,EAkBpB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAC7B,SAAS,kBAAkB,EAAE,EAC7B,eAAe,MAAM,KACpB,kBAAkB,GAAG,SACkD,CAAC"}
|