@genexus/genexus-ide-ui 0.0.75 → 0.0.77
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/dist/cjs/genexus-ide-ui.cjs.js +1 -1
- package/dist/cjs/gx-ide-ai-assistant.cjs.entry.js +50 -8
- package/dist/cjs/gx-ide-ai-message.cjs.entry.js +19 -6
- package/dist/cjs/gx-ide-kb-manager-import.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-new-environment.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-object-selector.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-team-dev-commit.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-team-dev-update.cjs.entry.js +1 -1
- package/dist/cjs/gx-ide-ww-images.cjs.entry.js +1 -1
- package/dist/cjs/{helpers-0a984c76.js → helpers-e25e57cb.js} +12 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/common/helpers.js +12 -3
- package/dist/collection/components/ai-assistant/ai-assistant.css +4 -21
- package/dist/collection/components/ai-assistant/ai-assistant.js +52 -7
- package/dist/collection/components/ai-assistant/ai-message.css +10 -16
- package/dist/collection/components/ai-assistant/ai-message.js +36 -4
- package/dist/collection/components/ai-assistant/gx-ide-assets/ai-assistant/langs/ai-assistant.lang.en.json +3 -1
- package/dist/components/ai-message.js +19 -5
- package/dist/components/gx-ide-ai-assistant.js +51 -8
- package/dist/components/helpers2.js +12 -3
- package/dist/esm/genexus-ide-ui.js +1 -1
- package/dist/esm/gx-ide-ai-assistant.entry.js +50 -8
- package/dist/esm/gx-ide-ai-message.entry.js +19 -6
- package/dist/esm/gx-ide-kb-manager-import.entry.js +1 -1
- package/dist/esm/gx-ide-new-environment.entry.js +1 -1
- package/dist/esm/gx-ide-object-selector.entry.js +1 -1
- package/dist/esm/gx-ide-team-dev-commit.entry.js +1 -1
- package/dist/esm/gx-ide-team-dev-update.entry.js +1 -1
- package/dist/esm/gx-ide-ww-images.entry.js +1 -1
- package/dist/esm/{helpers-91494352.js → helpers-a11a19fb.js} +12 -3
- package/dist/esm/loader.js +1 -1
- package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
- package/dist/genexus-ide-ui/gx-ide-assets/ai-assistant/langs/ai-assistant.lang.en.json +3 -1
- package/dist/genexus-ide-ui/{p-cb07fc99.entry.js → p-1b1fd856.entry.js} +1 -1
- package/dist/genexus-ide-ui/{p-440fe7b3.entry.js → p-1da59907.entry.js} +1 -1
- package/dist/genexus-ide-ui/{p-8c5919ec.entry.js → p-2b6a3afa.entry.js} +1 -1
- package/dist/genexus-ide-ui/{p-3d410e77.entry.js → p-33961b41.entry.js} +1 -1
- package/dist/genexus-ide-ui/{p-4758d51e.js → p-64d3885f.js} +1 -1
- package/dist/genexus-ide-ui/{p-13085dd7.entry.js → p-72fad9dd.entry.js} +1 -1
- package/dist/genexus-ide-ui/{p-e13a299b.entry.js → p-a43dc4e7.entry.js} +1 -1
- package/dist/genexus-ide-ui/p-ab4e48bc.entry.js +1 -0
- package/dist/genexus-ide-ui/p-e4e7e070.entry.js +1 -0
- package/dist/types/common/helpers.d.ts +1 -0
- package/dist/types/components/ai-assistant/ai-assistant.d.ts +11 -0
- package/dist/types/components/ai-assistant/ai-message.d.ts +7 -4
- package/dist/types/components.d.ts +9 -0
- package/package.json +1 -1
- package/dist/collection/components/ai-assistant/gx-ide-assets/ai-message/langs/ai-message.lang.en.json +0 -4
- package/dist/collection/components/ai-assistant/gx-ide-assets/ai-message/langs/ai-message.lang.ja.json +0 -3
- package/dist/collection/components/ai-assistant/gx-ide-assets/ai-message/langs/ai-message.lang.zh.json +0 -3
- package/dist/genexus-ide-ui/gx-ide-assets/ai-message/langs/ai-message.lang.en.json +0 -4
- package/dist/genexus-ide-ui/gx-ide-assets/ai-message/langs/ai-message.lang.ja.json +0 -3
- package/dist/genexus-ide-ui/gx-ide-assets/ai-message/langs/ai-message.lang.zh.json +0 -3
- package/dist/genexus-ide-ui/p-38dacc01.entry.js +0 -1
- package/dist/genexus-ide-ui/p-47f3b15b.entry.js +0 -1
|
@@ -106,10 +106,19 @@ export const setInitialComboValue = (options) => {
|
|
|
106
106
|
return options[0].value || options[0].id;
|
|
107
107
|
}
|
|
108
108
|
};
|
|
109
|
+
export const escapeRegExp = (str) => {
|
|
110
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
111
|
+
};
|
|
109
112
|
export const hiChar = function (text, filterValue) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
+
if (text && filterValue) {
|
|
114
|
+
/* this function highlights the character(s) that match(es) the filter value. (hi)light (Char)acters */
|
|
115
|
+
const escapedFilterValue = escapeRegExp(filterValue);
|
|
116
|
+
const re = new RegExp(escapedFilterValue, "gi");
|
|
117
|
+
return (h("span", { innerHTML: text.replace(re, '<span class="hiChar">$&</span>') }));
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
return text;
|
|
121
|
+
}
|
|
113
122
|
};
|
|
114
123
|
export const closeOnOutsideClickHandler = (eventInfo, ref) => {
|
|
115
124
|
if (!eventInfo.composedPath().includes(ref)) {
|
|
@@ -531,18 +531,6 @@ FORM ELEMENTS
|
|
|
531
531
|
height: 100%;
|
|
532
532
|
overflow-y: auto;
|
|
533
533
|
}
|
|
534
|
-
:host .header::before {
|
|
535
|
-
transition: 200ms background-color;
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
/*--- Assistant Status ---*/
|
|
539
|
-
:host(.assistant--success) .header__first-row::before {
|
|
540
|
-
background-color: var(--ai-dot-bg-color);
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
:host(.assistant--error) .header__first-row::before {
|
|
544
|
-
background-color: var(--color-error-dark);
|
|
545
|
-
}
|
|
546
534
|
|
|
547
535
|
.gx-ide-main-wrapper {
|
|
548
536
|
padding: 106px 10px 52px 10px;
|
|
@@ -571,14 +559,6 @@ FORM ELEMENTS
|
|
|
571
559
|
align-items: center;
|
|
572
560
|
justify-content: space-between;
|
|
573
561
|
}
|
|
574
|
-
.header__first-row::before {
|
|
575
|
-
content: "";
|
|
576
|
-
width: var(--spacing-comp-02);
|
|
577
|
-
height: var(--spacing-comp-02);
|
|
578
|
-
display: block;
|
|
579
|
-
border-radius: calc(var(--spacing-comp-02) / 2);
|
|
580
|
-
background-color: var(--ai-dot-bg-color);
|
|
581
|
-
}
|
|
582
562
|
.header__filter {
|
|
583
563
|
margin-block-start: var(--spacing-comp-02);
|
|
584
564
|
}
|
|
@@ -598,6 +578,9 @@ FORM ELEMENTS
|
|
|
598
578
|
.messages-wrapper {
|
|
599
579
|
position: relative;
|
|
600
580
|
overflow: auto;
|
|
581
|
+
display: flex;
|
|
582
|
+
flex-direction: column;
|
|
583
|
+
scroll-behavior: smooth;
|
|
601
584
|
/* Track */
|
|
602
585
|
/* Handle */
|
|
603
586
|
/* Handle on hover */
|
|
@@ -623,7 +606,7 @@ FORM ELEMENTS
|
|
|
623
606
|
|
|
624
607
|
.messages {
|
|
625
608
|
display: flex;
|
|
626
|
-
flex-direction: column
|
|
609
|
+
flex-direction: column;
|
|
627
610
|
list-style-type: none;
|
|
628
611
|
padding: 0;
|
|
629
612
|
margin: 0;
|
|
@@ -6,6 +6,8 @@ import { Locale } from "../../common/locale";
|
|
|
6
6
|
export class GxIdeTemplate {
|
|
7
7
|
constructor() {
|
|
8
8
|
this.renderedFirstTime = false;
|
|
9
|
+
this.setFocus = true;
|
|
10
|
+
this.scrollToBottomFlag = true;
|
|
9
11
|
// 9.LOCAL METHODS //
|
|
10
12
|
this.evaluateAiInProgress = () => {
|
|
11
13
|
var _a;
|
|
@@ -37,7 +39,7 @@ export class GxIdeTemplate {
|
|
|
37
39
|
};
|
|
38
40
|
this.renderMessage = (message, i) => {
|
|
39
41
|
if (message.text.length > 0) {
|
|
40
|
-
return (h("gx-ide-ai-message", { message: message.text, messageType: message.type, hidden: message.hidden, filterValue: this.filterValue, key: `${i.toString()}-${message.type}
|
|
42
|
+
return (h("gx-ide-ai-message", { message: message.text, messageType: message.type, hidden: message.hidden, filterValue: this.filterValue, key: `${i.toString()}-${message.type}`, translations: this._componentLocale.aiMessage }));
|
|
41
43
|
}
|
|
42
44
|
};
|
|
43
45
|
this.textAreaInputHandler = () => {
|
|
@@ -45,18 +47,25 @@ export class GxIdeTemplate {
|
|
|
45
47
|
this.showFilter = false;
|
|
46
48
|
this.filterEl.value = "";
|
|
47
49
|
this.filterValue = "";
|
|
50
|
+
this.scrollToBottomFlag = true;
|
|
48
51
|
};
|
|
49
52
|
this.promptEnterHandler = async (prompt) => {
|
|
50
|
-
/* First remove double spaces*/
|
|
53
|
+
/* First remove double spaces */
|
|
51
54
|
const promptTrimmed = prompt.detail.replace(/\s+/g, " ");
|
|
52
|
-
/* Update textarea value to get the proper height*/
|
|
55
|
+
/* Update textarea value to get the proper height */
|
|
53
56
|
this.textAreaEl.value = promptTrimmed;
|
|
54
57
|
setTimeout(() => {
|
|
55
|
-
/* Then save the actual height (setTimeOut required)*/
|
|
58
|
+
/* Then save the actual height (setTimeOut required) */
|
|
56
59
|
this.lastUserMessageHeight = this.textAreaEl.offsetHeight;
|
|
57
60
|
}, 0);
|
|
58
|
-
/* The clear the textarea*/
|
|
61
|
+
/* The clear the textarea */
|
|
59
62
|
this.textAreaEl.value = "";
|
|
63
|
+
/* Insert the user message */
|
|
64
|
+
this.addMessage({
|
|
65
|
+
type: "user",
|
|
66
|
+
text: promptTrimmed
|
|
67
|
+
});
|
|
68
|
+
/* Call the callback */
|
|
60
69
|
if (this.userMessageCallback && !this.aIInProgress) {
|
|
61
70
|
this.aIInProgress = true;
|
|
62
71
|
this.userMessageCallback(promptTrimmed).then(() => {
|
|
@@ -65,6 +74,7 @@ export class GxIdeTemplate {
|
|
|
65
74
|
}
|
|
66
75
|
};
|
|
67
76
|
this.filterMessagesHandler = (e) => {
|
|
77
|
+
this.scrollToBottomFlag = false;
|
|
68
78
|
this.filterValue = e.detail.toLowerCase();
|
|
69
79
|
const filteredMessages = [...this.messages];
|
|
70
80
|
filteredMessages.forEach(message => {
|
|
@@ -129,9 +139,24 @@ export class GxIdeTemplate {
|
|
|
129
139
|
this.filterEl.focus();
|
|
130
140
|
}
|
|
131
141
|
};
|
|
142
|
+
this.promptFocusHandler = () => {
|
|
143
|
+
this.promptHasFocus = true;
|
|
144
|
+
};
|
|
145
|
+
this.promptBlurHandler = () => {
|
|
146
|
+
this.promptHasFocus = false;
|
|
147
|
+
};
|
|
148
|
+
this.scrollToBottom = () => {
|
|
149
|
+
if (this.scrollToBottomFlag) {
|
|
150
|
+
this.messagesWrapperEl.scrollTo(0, this.messagesWrapperEl.scrollHeight);
|
|
151
|
+
this.messagesWrapperEl.scrollTop =
|
|
152
|
+
this.messagesWrapperEl.scrollHeight -
|
|
153
|
+
this.messagesWrapperEl.clientHeight;
|
|
154
|
+
}
|
|
155
|
+
};
|
|
132
156
|
this.userHasTyped = false;
|
|
133
157
|
this.aIInProgress = false;
|
|
134
158
|
this.showFilter = false;
|
|
159
|
+
this.promptHasFocus = false;
|
|
135
160
|
this.filterValue = undefined;
|
|
136
161
|
this.messages = [];
|
|
137
162
|
this.promptMaxHeight = "128px";
|
|
@@ -141,6 +166,11 @@ export class GxIdeTemplate {
|
|
|
141
166
|
this.promptValue = undefined;
|
|
142
167
|
this.filter = true;
|
|
143
168
|
}
|
|
169
|
+
watchAIInProgressHandler(aiInProgress) {
|
|
170
|
+
if (!aiInProgress) {
|
|
171
|
+
this.setFocus = true;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
144
174
|
watchMessagesHandler() {
|
|
145
175
|
this.evaluateAiInProgress();
|
|
146
176
|
this.evaluateAiStatus();
|
|
@@ -161,6 +191,16 @@ export class GxIdeTemplate {
|
|
|
161
191
|
this.componentDidRenderFirstTime.emit(this._componentLocale.componentName);
|
|
162
192
|
this.renderedFirstTime = true;
|
|
163
193
|
}
|
|
194
|
+
if (this.setFocus) {
|
|
195
|
+
setTimeout(() => {
|
|
196
|
+
/* Doesn't seems to work without the setTimeout */
|
|
197
|
+
this.textAreaEl.focus();
|
|
198
|
+
this.setFocus = false;
|
|
199
|
+
}, 0);
|
|
200
|
+
}
|
|
201
|
+
setTimeout(() => {
|
|
202
|
+
this.scrollToBottom();
|
|
203
|
+
}, 200);
|
|
164
204
|
}
|
|
165
205
|
// 7.LISTENERS //
|
|
166
206
|
// 8.PUBLIC METHODS API //
|
|
@@ -197,14 +237,15 @@ export class GxIdeTemplate {
|
|
|
197
237
|
"header__second-row--visible": this.showFilter
|
|
198
238
|
} }, h("div", { class: "filter-inner-wrapper" }, h("gxg-form-text", { class: "header__filter", onInput: this.filterMessagesHandler, ref: el => (this.filterEl = el) })))) : null), h("div", { class: {
|
|
199
239
|
"messages-wrapper": true
|
|
200
|
-
} }, ((_a = this.messages) === null || _a === void 0 ? void 0 : _a.length) ? (h("ol", { class: { messages: true } }, this.messages.map((message, i) => {
|
|
240
|
+
}, ref: el => (this.messagesWrapperEl = el) }, ((_a = this.messages) === null || _a === void 0 ? void 0 : _a.length) ? (h("ol", { class: { messages: true } }, this.messages.map((message, i) => {
|
|
201
241
|
return this.renderMessage(message, i);
|
|
202
242
|
}))) : null), h("div", { class: {
|
|
203
243
|
prompt: true
|
|
204
244
|
} }, h("gxg-form-textarea", { ai: true, class: "prompt__textarea", value: this.promptValue, maxHeight: this.promptMaxHeight, placeholder: this.aIInProgress
|
|
205
245
|
? this._componentLocale.processingQueryPlaceholder
|
|
206
|
-
: this._componentLocale.promptPlaceholder, onInput: this.textAreaInputHandler, onEnter: this.promptEnterHandler, onArrowUpPressed: this.promptArrowUpHandler, disabled: this.aIInProgress, ref: el => (this.textAreaEl = el) }), !this.userHasTyped &&
|
|
246
|
+
: this._componentLocale.promptPlaceholder, onInput: this.textAreaInputHandler, onEnter: this.promptEnterHandler, onArrowUpPressed: this.promptArrowUpHandler, onBlur: this.promptBlurHandler, onFocus: this.promptFocusHandler, disabled: this.aIInProgress, ref: el => (this.textAreaEl = el) }), !this.userHasTyped &&
|
|
207
247
|
!this.aIInProgress &&
|
|
248
|
+
!this.promptHasFocus &&
|
|
208
249
|
((_b = this.focusShortcuts) === null || _b === void 0 ? void 0 : _b.length) > 0 ? (h("div", { class: {
|
|
209
250
|
prompt__shortcuts: true
|
|
210
251
|
} }, this.focusShortcuts.map((shortcut, i) => {
|
|
@@ -363,6 +404,7 @@ export class GxIdeTemplate {
|
|
|
363
404
|
"userHasTyped": {},
|
|
364
405
|
"aIInProgress": {},
|
|
365
406
|
"showFilter": {},
|
|
407
|
+
"promptHasFocus": {},
|
|
366
408
|
"filterValue": {}
|
|
367
409
|
};
|
|
368
410
|
}
|
|
@@ -429,6 +471,9 @@ export class GxIdeTemplate {
|
|
|
429
471
|
static get elementRef() { return "el"; }
|
|
430
472
|
static get watchers() {
|
|
431
473
|
return [{
|
|
474
|
+
"propName": "aIInProgress",
|
|
475
|
+
"methodName": "watchAIInProgressHandler"
|
|
476
|
+
}, {
|
|
432
477
|
"propName": "messages",
|
|
433
478
|
"methodName": "watchMessagesHandler"
|
|
434
479
|
}];
|
|
@@ -6,7 +6,9 @@ Found on /common/helpers.tsx hiChar function is used to add a span/class to ever
|
|
|
6
6
|
*/
|
|
7
7
|
/*--- Messages ---*/
|
|
8
8
|
.message {
|
|
9
|
-
--
|
|
9
|
+
--user-bg-color: #242d36;
|
|
10
|
+
--ai-error-bg-color: #272124;
|
|
11
|
+
--ai-error-border-color: #a3585e;
|
|
10
12
|
--ai-message-error-color: var(--color-error-dark);
|
|
11
13
|
display: grid;
|
|
12
14
|
grid-template-rows: 0fr;
|
|
@@ -19,11 +21,10 @@ Found on /common/helpers.tsx hiChar function is used to add a span/class to ever
|
|
|
19
21
|
}
|
|
20
22
|
.message__inner-wrapper {
|
|
21
23
|
padding: var(--spacing-comp-01) var(--spacing-comp-02);
|
|
22
|
-
border-radius: var(--border-radius-
|
|
24
|
+
border-radius: var(--border-radius-sm);
|
|
23
25
|
border: var(--border-width-sm) solid transparent;
|
|
24
|
-
background-color: var(--
|
|
25
|
-
|
|
26
|
-
margin-block-end: var(--spacing-comp-02);
|
|
26
|
+
background-color: var(--gray-12);
|
|
27
|
+
margin-block-start: var(--spacing-comp-02);
|
|
27
28
|
}
|
|
28
29
|
.message__caption {
|
|
29
30
|
font-size: var(--mc-font-size-xxs);
|
|
@@ -36,6 +37,7 @@ Found on /common/helpers.tsx hiChar function is used to add a span/class to ever
|
|
|
36
37
|
.message--copying {
|
|
37
38
|
pointer-events: none;
|
|
38
39
|
}
|
|
40
|
+
.message--copying span:not(.copied),
|
|
39
41
|
.message--copying .message__caption {
|
|
40
42
|
color: transparent;
|
|
41
43
|
-webkit-user-select: none;
|
|
@@ -46,12 +48,7 @@ Found on /common/helpers.tsx hiChar function is used to add a span/class to ever
|
|
|
46
48
|
/* Standard syntax */
|
|
47
49
|
}
|
|
48
50
|
.message--user .message__inner-wrapper {
|
|
49
|
-
background-color: var(--
|
|
50
|
-
}
|
|
51
|
-
.message--user .message__inner-wrapper {
|
|
52
|
-
/*override default message border radius*/
|
|
53
|
-
border-top-left-radius: var(--border-radius-sm);
|
|
54
|
-
border-bottom-left-radius: var(--border-radius-sm);
|
|
51
|
+
background-color: var(--user-bg-color);
|
|
55
52
|
}
|
|
56
53
|
.message--assistant-action .message__inner-wrapper {
|
|
57
54
|
font-style: italic;
|
|
@@ -61,7 +58,6 @@ Found on /common/helpers.tsx hiChar function is used to add a span/class to ever
|
|
|
61
58
|
display: grid;
|
|
62
59
|
grid-template-columns: 1fr auto;
|
|
63
60
|
gap: var(--spacing-comp-02);
|
|
64
|
-
border-inline-start-color: var(--gray-02);
|
|
65
61
|
}
|
|
66
62
|
.message--assistant-in-progress .message__inner-wrapper .message__caption {
|
|
67
63
|
overflow: hidden;
|
|
@@ -72,11 +68,9 @@ Found on /common/helpers.tsx hiChar function is used to add a span/class to ever
|
|
|
72
68
|
.message--assistant-in-progress .message__inner-wrapper .animation-wrapper {
|
|
73
69
|
flex: none;
|
|
74
70
|
}
|
|
75
|
-
.message--assistant-chat .message__inner-wrapper, .message--assistant-action .message__inner-wrapper {
|
|
76
|
-
border-inline-start-color: var(--ai-message-success-color);
|
|
77
|
-
}
|
|
78
71
|
.message--assistant-error .message__inner-wrapper {
|
|
79
|
-
|
|
72
|
+
background-color: var(--ai-error-bg-color);
|
|
73
|
+
border-color: var(--ai-error-border-color);
|
|
80
74
|
}
|
|
81
75
|
.message--copyable {
|
|
82
76
|
cursor: pointer;
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
/* STENCIL IMPORTS */
|
|
2
2
|
import { h } from "@stencil/core";
|
|
3
|
-
import { Locale } from "../../common/locale";
|
|
4
3
|
import { hiChar } from "../../common/helpers";
|
|
5
4
|
export class GxIdeAiMessage {
|
|
6
5
|
constructor() {
|
|
6
|
+
/*
|
|
7
|
+
INDEX:
|
|
8
|
+
1.OWN PROPERTIES
|
|
9
|
+
2.REFERENCE TO ELEMENTS
|
|
10
|
+
3.STATE() VARIABLES
|
|
11
|
+
4.PUBLIC PROPERTY API | WATCH'S
|
|
12
|
+
5.EVENTS (EMIT)
|
|
13
|
+
6.COMPONENT LIFECYCLE METHODS
|
|
14
|
+
7.LISTENERS
|
|
15
|
+
8.PUBLIC METHODS API
|
|
16
|
+
9.LOCAL METHODS
|
|
17
|
+
10.RENDER() FUNCTION
|
|
18
|
+
*/
|
|
19
|
+
// 1.OWN PROPERTIES //
|
|
7
20
|
/* The message allows to be copied*/
|
|
8
21
|
this.copyable = false;
|
|
9
22
|
// 7.LISTENERS //
|
|
@@ -19,7 +32,7 @@ export class GxIdeAiMessage {
|
|
|
19
32
|
this.showCopiedMessage = true;
|
|
20
33
|
setTimeout(() => {
|
|
21
34
|
this.showCopiedMessage = false;
|
|
22
|
-
},
|
|
35
|
+
}, 1500);
|
|
23
36
|
};
|
|
24
37
|
this.visible = false;
|
|
25
38
|
this.showCopiedMessage = false;
|
|
@@ -27,11 +40,11 @@ export class GxIdeAiMessage {
|
|
|
27
40
|
this.messageType = undefined;
|
|
28
41
|
this.filterValue = undefined;
|
|
29
42
|
this.hidden = undefined;
|
|
43
|
+
this.translations = undefined;
|
|
30
44
|
}
|
|
31
45
|
// 5.EVENTS (EMIT) //
|
|
32
46
|
// 6.COMPONENT LIFECYCLE METHODS //
|
|
33
47
|
async componentWillLoad() {
|
|
34
|
-
this._componentLocale = await Locale.getComponentStrings(this.el);
|
|
35
48
|
this.evaluateMessageIsCopyable();
|
|
36
49
|
}
|
|
37
50
|
componentDidRender() {
|
|
@@ -58,7 +71,7 @@ export class GxIdeAiMessage {
|
|
|
58
71
|
"message__caption--in-progress": this.messageType === "assistant-in-progress"
|
|
59
72
|
} }, this.showCopiedMessage ? (h("span", { class: {
|
|
60
73
|
copied: true
|
|
61
|
-
} }, h("gxg-icon", { color: "mercury", type: "bpm/tasks" }), this.
|
|
74
|
+
} }, h("gxg-icon", { color: "mercury", type: "bpm/tasks" }), this.translations["copied"])) : null, hiChar(this.message, this.filterValue)), this.messageType === "assistant-in-progress" ? (h("div", { class: "animation-wrapper" }, h("div", { class: "dot-pulse" }))) : null))));
|
|
62
75
|
}
|
|
63
76
|
static get is() { return "gx-ide-ai-message"; }
|
|
64
77
|
static get encapsulation() { return "shadow"; }
|
|
@@ -147,6 +160,25 @@ export class GxIdeAiMessage {
|
|
|
147
160
|
},
|
|
148
161
|
"attribute": "hidden",
|
|
149
162
|
"reflect": false
|
|
163
|
+
},
|
|
164
|
+
"translations": {
|
|
165
|
+
"type": "unknown",
|
|
166
|
+
"mutable": false,
|
|
167
|
+
"complexType": {
|
|
168
|
+
"original": "Translations",
|
|
169
|
+
"resolved": "{ [key: string]: string; }",
|
|
170
|
+
"references": {
|
|
171
|
+
"Translations": {
|
|
172
|
+
"location": "local"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"required": false,
|
|
177
|
+
"optional": false,
|
|
178
|
+
"docs": {
|
|
179
|
+
"tags": [],
|
|
180
|
+
"text": "An object with the needed string translations."
|
|
181
|
+
}
|
|
150
182
|
}
|
|
151
183
|
};
|
|
152
184
|
}
|
|
@@ -1,16 +1,29 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { L as Locale } from './locale.js';
|
|
3
2
|
import { h as hiChar } from './helpers2.js';
|
|
4
3
|
import { d as defineCustomElement$2 } from './icon.js';
|
|
5
4
|
import { d as defineCustomElement$1 } from './icon2.js';
|
|
6
5
|
|
|
7
|
-
const aiMessageCss = ".message{--ai-
|
|
6
|
+
const aiMessageCss = ".message{--user-bg-color:#242d36;--ai-error-bg-color:#272124;--ai-error-border-color:#a3585e;--ai-message-error-color:var(--color-error-dark);display:grid;grid-template-rows:0fr;transition:grid-template-rows 100ms;transition:grid-template-rows 100ms, -ms-grid-rows 100ms;}.message__outer-wrapper{overflow:hidden}.message__inner-wrapper{padding:var(--spacing-comp-01) var(--spacing-comp-02);border-radius:var(--border-radius-sm);border:var(--border-width-sm) solid transparent;background-color:var(--gray-12);margin-block-start:var(--spacing-comp-02)}.message__caption{font-size:var(--mc-font-size-xxs);line-height:1.6em;position:relative}.message--visible{grid-template-rows:1fr}.message--copying{pointer-events:none}.message--copying span:not(.copied),.message--copying .message__caption{color:transparent;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.message--user .message__inner-wrapper{background-color:var(--user-bg-color)}.message--assistant-action .message__inner-wrapper{font-style:italic}.message--assistant-in-progress .message__inner-wrapper{font-style:italic;display:grid;grid-template-columns:1fr auto;gap:var(--spacing-comp-02)}.message--assistant-in-progress .message__inner-wrapper .message__caption{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex:1}.message--assistant-in-progress .message__inner-wrapper .animation-wrapper{flex:none}.message--assistant-error .message__inner-wrapper{background-color:var(--ai-error-bg-color);border-color:var(--ai-error-border-color)}.message--copyable{cursor:pointer}.message--copyable:hover{filter:brightness(1.2)}.message:last-child{margin-block-end:0}:host(:first-child) .message__inner-wrapper{margin-block-end:0}.animation-wrapper{width:45px;display:flex;align-items:center;justify-content:center}.dot-pulse{position:relative;left:-9999px;width:5px;height:5px;border-radius:2.5px;background-color:var(--gray-03);color:var(--gray-03);box-shadow:9999px 0 0 -5px;animation:dot-pulse 1.5s infinite linear;animation-delay:0.25s}.dot-pulse::before,.dot-pulse::after{content:\"\";display:inline-block;position:absolute;top:0;width:5px;height:5px;border-radius:2.5px;background-color:var(--gray-03);color:var(--gray-03)}.dot-pulse::before{box-shadow:9984px 0 0 -5px;animation:dot-pulse-before 1.5s infinite linear;animation-delay:0s}.dot-pulse::after{box-shadow:10014px 0 0 -5px;animation:dot-pulse-after 1.5s infinite linear;animation-delay:0.5s}@keyframes dot-pulse-before{0%{box-shadow:9984px 0 0 -5px}30%{box-shadow:9984px 0 0 2px}60%,100%{box-shadow:9984px 0 0 -5px}}@keyframes dot-pulse{0%{box-shadow:9999px 0 0 -5px}30%{box-shadow:9999px 0 0 2px}60%,100%{box-shadow:9999px 0 0 -5px}}@keyframes dot-pulse-after{0%{box-shadow:10014px 0 0 -5px}30%{box-shadow:10014px 0 0 2px}60%,100%{box-shadow:10014px 0 0 -5px}}.copied{position:absolute;width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:var(--color-on-background);display:flex;gap:var(--spacing-comp-01)}.hiChar{color:var(--gx-ide-hi-char-color);font-weight:600}";
|
|
8
7
|
|
|
9
8
|
const GxIdeAiMessage = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
10
9
|
constructor() {
|
|
11
10
|
super();
|
|
12
11
|
this.__registerHost();
|
|
13
12
|
this.__attachShadow();
|
|
13
|
+
/*
|
|
14
|
+
INDEX:
|
|
15
|
+
1.OWN PROPERTIES
|
|
16
|
+
2.REFERENCE TO ELEMENTS
|
|
17
|
+
3.STATE() VARIABLES
|
|
18
|
+
4.PUBLIC PROPERTY API | WATCH'S
|
|
19
|
+
5.EVENTS (EMIT)
|
|
20
|
+
6.COMPONENT LIFECYCLE METHODS
|
|
21
|
+
7.LISTENERS
|
|
22
|
+
8.PUBLIC METHODS API
|
|
23
|
+
9.LOCAL METHODS
|
|
24
|
+
10.RENDER() FUNCTION
|
|
25
|
+
*/
|
|
26
|
+
// 1.OWN PROPERTIES //
|
|
14
27
|
/* The message allows to be copied*/
|
|
15
28
|
this.copyable = false;
|
|
16
29
|
// 7.LISTENERS //
|
|
@@ -26,7 +39,7 @@ const GxIdeAiMessage = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
26
39
|
this.showCopiedMessage = true;
|
|
27
40
|
setTimeout(() => {
|
|
28
41
|
this.showCopiedMessage = false;
|
|
29
|
-
},
|
|
42
|
+
}, 1500);
|
|
30
43
|
};
|
|
31
44
|
this.visible = false;
|
|
32
45
|
this.showCopiedMessage = false;
|
|
@@ -34,11 +47,11 @@ const GxIdeAiMessage = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
34
47
|
this.messageType = undefined;
|
|
35
48
|
this.filterValue = undefined;
|
|
36
49
|
this.hidden = undefined;
|
|
50
|
+
this.translations = undefined;
|
|
37
51
|
}
|
|
38
52
|
// 5.EVENTS (EMIT) //
|
|
39
53
|
// 6.COMPONENT LIFECYCLE METHODS //
|
|
40
54
|
async componentWillLoad() {
|
|
41
|
-
this._componentLocale = await Locale.getComponentStrings(this.el);
|
|
42
55
|
this.evaluateMessageIsCopyable();
|
|
43
56
|
}
|
|
44
57
|
componentDidRender() {
|
|
@@ -65,7 +78,7 @@ const GxIdeAiMessage = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
65
78
|
"message__caption--in-progress": this.messageType === "assistant-in-progress"
|
|
66
79
|
} }, this.showCopiedMessage ? (h("span", { class: {
|
|
67
80
|
copied: true
|
|
68
|
-
} }, h("gxg-icon", { color: "mercury", type: "bpm/tasks" }), this.
|
|
81
|
+
} }, h("gxg-icon", { color: "mercury", type: "bpm/tasks" }), this.translations["copied"])) : null, hiChar(this.message, this.filterValue)), this.messageType === "assistant-in-progress" ? (h("div", { class: "animation-wrapper" }, h("div", { class: "dot-pulse" }))) : null))));
|
|
69
82
|
}
|
|
70
83
|
static get assetsDirs() { return ["gx-ide-assets/ai-message"]; }
|
|
71
84
|
get el() { return this; }
|
|
@@ -75,6 +88,7 @@ const GxIdeAiMessage = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
75
88
|
"messageType": [1, "message-type"],
|
|
76
89
|
"filterValue": [1, "filter-value"],
|
|
77
90
|
"hidden": [4],
|
|
91
|
+
"translations": [16],
|
|
78
92
|
"visible": [32],
|
|
79
93
|
"showCopiedMessage": [32]
|
|
80
94
|
}]);
|