@sme.up/ketchup 9.6.0 → 9.6.2
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/{f-button-623dfcc3.js → f-button-4c346ca8.js} +1 -1
- package/dist/cjs/{f-cell-9c718d83.js → f-cell-8f3d12fd.js} +5 -5
- package/dist/cjs/{f-chip-c8efad5b.js → f-chip-a6c800be.js} +2 -2
- package/dist/cjs/{f-image-b61cc967.js → f-image-40476fa6.js} +1 -1
- package/dist/cjs/{f-paginator-utils-67dbc14c.js → f-paginator-utils-c652ceaa.js} +6 -6
- package/dist/cjs/{f-text-field-a09b1705.js → f-text-field-1f77ef23.js} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/ketchup.cjs.js +1 -1
- package/dist/cjs/kup-accordion.cjs.entry.js +2 -2
- package/dist/cjs/kup-autocomplete_27.cjs.entry.js +91 -66
- package/dist/cjs/kup-box.cjs.entry.js +76 -14
- package/dist/cjs/kup-calendar.cjs.entry.js +8 -6
- package/dist/cjs/kup-card-list.cjs.entry.js +1 -1
- package/dist/cjs/kup-cell.cjs.entry.js +6 -6
- package/dist/cjs/kup-dashboard.cjs.entry.js +4 -4
- package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
- package/dist/cjs/kup-echart.cjs.entry.js +1 -1
- package/dist/cjs/kup-editor.cjs.entry.js +1 -1
- package/dist/cjs/kup-family-tree.cjs.entry.js +3 -3
- package/dist/cjs/kup-grid.cjs.entry.js +1 -1
- package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
- package/dist/cjs/kup-image-list.cjs.entry.js +6 -6
- package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
- package/dist/cjs/kup-magic-box.cjs.entry.js +2 -2
- package/dist/cjs/{kup-manager-227c4be2.js → kup-manager-08f1585b.js} +54 -41
- package/dist/cjs/kup-nav-bar.cjs.entry.js +1 -1
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +2 -2
- package/dist/cjs/kup-photo-frame.cjs.entry.js +1 -1
- package/dist/cjs/kup-planner.cjs.entry.js +2 -2
- package/dist/cjs/kup-probe.cjs.entry.js +1 -1
- package/dist/cjs/kup-qlik.cjs.entry.js +1 -1
- package/dist/cjs/kup-snackbar.cjs.entry.js +3 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/assets/index.js +4 -0
- package/dist/collection/assets/planner-example-4.js +4 -4
- package/dist/collection/assets/planner-example-5.js +3175 -0
- package/dist/collection/components/kup-box/kup-box-declarations.js +11 -0
- package/dist/collection/components/kup-box/kup-box-state.js +2 -0
- package/dist/collection/components/kup-box/kup-box.js +169 -9
- package/dist/collection/components/kup-calendar/kup-calendar.js +4 -2
- package/dist/collection/components/kup-card/built-in/kup-card-openai.js +29 -1
- package/dist/collection/components/kup-card/kup-card.css +7 -0
- package/dist/collection/components/kup-data-table/kup-data-table.js +14 -17
- package/dist/collection/managers/kup-openai/kup-openai.js +53 -40
- package/dist/components/kup-autocomplete2.js +99 -74
- package/dist/components/kup-box2.js +74 -8
- package/dist/components/kup-button-list.js +1 -1
- package/dist/components/kup-button.js +1 -1
- package/dist/components/kup-calendar.js +5 -3
- package/dist/components/kup-card.js +1 -1
- package/dist/components/kup-chart.js +1 -1
- package/dist/components/kup-checkbox.js +1 -1
- package/dist/components/kup-chip.js +1 -1
- package/dist/components/kup-color-picker.js +1 -1
- package/dist/components/kup-combobox.js +1 -1
- package/dist/components/kup-dashboard.js +1 -1
- package/dist/components/kup-data-table.js +1 -1
- package/dist/components/kup-date-picker.js +1 -1
- package/dist/components/kup-dialog.js +1 -1
- package/dist/components/kup-dropdown-button.js +1 -1
- package/dist/components/kup-family-tree.js +1 -1
- package/dist/components/kup-form.js +1 -1
- package/dist/components/kup-gauge.js +1 -1
- package/dist/components/kup-image-list.js +1 -1
- package/dist/components/kup-image.js +1 -1
- package/dist/components/kup-list.js +1 -1
- package/dist/components/kup-magic-box.js +1 -1
- package/dist/components/kup-manager.js +54 -41
- package/dist/components/kup-numeric-picker.js +1 -1
- package/dist/components/kup-planner.js +1 -1
- package/dist/components/kup-progress-bar.js +1 -1
- package/dist/components/kup-radio.js +1 -1
- package/dist/components/kup-rating.js +1 -1
- package/dist/components/kup-snackbar.js +1 -1
- package/dist/components/kup-spinner.js +1 -1
- package/dist/components/kup-switch.js +1 -1
- package/dist/components/kup-tab-bar.js +1 -1
- package/dist/components/kup-text-field.js +1 -1
- package/dist/components/kup-time-picker.js +1 -1
- package/dist/components/kup-tree.js +1 -1
- package/dist/esm/{f-button-121958b3.js → f-button-90a7ea86.js} +1 -1
- package/dist/esm/{f-cell-959b83db.js → f-cell-fdd338c5.js} +5 -5
- package/dist/esm/{f-chip-915ddf53.js → f-chip-4e6341a6.js} +2 -2
- package/dist/esm/{f-image-98371dac.js → f-image-5210f0b3.js} +1 -1
- package/dist/esm/{f-paginator-utils-f5f4c666.js → f-paginator-utils-3f179999.js} +3 -3
- package/dist/esm/{f-text-field-0df308e4.js → f-text-field-8429a853.js} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/ketchup.js +1 -1
- package/dist/esm/kup-accordion.entry.js +2 -2
- package/dist/esm/kup-autocomplete_27.entry.js +91 -66
- package/dist/esm/kup-box.entry.js +76 -14
- package/dist/esm/kup-calendar.entry.js +8 -6
- package/dist/esm/kup-card-list.entry.js +1 -1
- package/dist/esm/kup-cell.entry.js +6 -6
- package/dist/esm/kup-dashboard.entry.js +4 -4
- package/dist/esm/kup-drawer.entry.js +1 -1
- package/dist/esm/kup-echart.entry.js +1 -1
- package/dist/esm/kup-editor.entry.js +1 -1
- package/dist/esm/kup-family-tree.entry.js +3 -3
- package/dist/esm/kup-grid.entry.js +1 -1
- package/dist/esm/kup-iframe.entry.js +1 -1
- package/dist/esm/kup-image-list.entry.js +6 -6
- package/dist/esm/kup-lazy.entry.js +1 -1
- package/dist/esm/kup-magic-box.entry.js +2 -2
- package/dist/esm/{kup-manager-33b051d6.js → kup-manager-8b39f876.js} +54 -41
- package/dist/esm/kup-nav-bar.entry.js +1 -1
- package/dist/esm/kup-numeric-picker.entry.js +2 -2
- package/dist/esm/kup-photo-frame.entry.js +1 -1
- package/dist/esm/kup-planner.entry.js +2 -2
- package/dist/esm/kup-probe.entry.js +1 -1
- package/dist/esm/kup-qlik.entry.js +1 -1
- package/dist/esm/kup-snackbar.entry.js +3 -3
- package/dist/esm/loader.js +1 -1
- package/dist/ketchup/index.esm.js +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/p-02820c2b.entry.js +1 -0
- package/dist/ketchup/{p-9d8d5070.entry.js → p-09d853c3.entry.js} +1 -1
- package/dist/ketchup/{p-81996620.entry.js → p-14e1a36b.entry.js} +1 -1
- package/dist/ketchup/{p-0a4595bd.entry.js → p-1936c6cd.entry.js} +1 -1
- package/dist/ketchup/{p-eb37ea7e.entry.js → p-318c9ecd.entry.js} +1 -1
- package/dist/ketchup/{p-e43d4ccc.js → p-35d503e2.js} +1 -1
- package/dist/ketchup/p-35dce86e.entry.js +1 -0
- package/dist/ketchup/{p-3ce8ce77.entry.js → p-4c20fefd.entry.js} +1 -1
- package/dist/ketchup/{p-9f31a129.entry.js → p-4eb70dd2.entry.js} +1 -1
- package/dist/ketchup/{p-3ff9a661.entry.js → p-5739cdc2.entry.js} +1 -1
- package/dist/ketchup/{p-41d6466e.entry.js → p-5ab3a88a.entry.js} +1 -1
- package/dist/ketchup/{p-7bda0684.js → p-5e16c9d3.js} +1 -1
- package/dist/ketchup/{p-a9b06bb8.js → p-6780a391.js} +1 -1
- package/dist/ketchup/{p-c1ade766.entry.js → p-67930d7c.entry.js} +1 -1
- package/dist/ketchup/{p-0dd0ae49.entry.js → p-6953f769.entry.js} +1 -1
- package/dist/ketchup/{p-babbffa4.entry.js → p-7d2fd8bd.entry.js} +1 -1
- package/dist/ketchup/{p-773bcc69.entry.js → p-8257141a.entry.js} +1 -1
- package/dist/ketchup/{p-9e63f56b.entry.js → p-82694fad.entry.js} +1 -1
- package/dist/ketchup/{p-ccc637ee.js → p-86f9b0d9.js} +1 -1
- package/dist/ketchup/{p-d5254caf.entry.js → p-8ea68d14.entry.js} +1 -1
- package/dist/ketchup/{p-4bf5e04f.entry.js → p-98c72335.entry.js} +1 -1
- package/dist/ketchup/{p-d15d1083.entry.js → p-ab8cac45.entry.js} +1 -1
- package/dist/ketchup/p-c089b961.js +1 -0
- package/dist/ketchup/{p-f0b882f4.entry.js → p-cdb24584.entry.js} +1 -1
- package/dist/ketchup/{p-ea625b2a.entry.js → p-d466d6d1.entry.js} +1 -1
- package/dist/ketchup/{p-b086727d.entry.js → p-ee30e274.entry.js} +1 -1
- package/dist/ketchup/{p-610a03d4.js → p-f31530fc.js} +2 -2
- package/dist/ketchup/{p-2f4055ba.entry.js → p-f353805e.entry.js} +1 -1
- package/dist/ketchup/p-f515308d.entry.js +9 -0
- package/dist/ketchup/{p-68e9379a.js → p-f9766625.js} +1 -1
- package/dist/types/components/kup-box/kup-box-declarations.d.ts +12 -0
- package/dist/types/components/kup-box/kup-box-state.d.ts +2 -0
- package/dist/types/components/kup-box/kup-box.d.ts +26 -1
- package/dist/types/components/kup-calendar/kup-calendar-declarations.d.ts +1 -0
- package/dist/types/components/kup-card/kup-card-declarations.d.ts +1 -0
- package/dist/types/components.d.ts +48 -6
- package/dist/types/managers/kup-openai/kup-openai-declarations.d.ts +7 -0
- package/dist/types/managers/kup-openai/kup-openai.d.ts +8 -12
- package/package.json +1 -1
- package/dist/ketchup/p-102866cd.js +0 -1
- package/dist/ketchup/p-6001882e.entry.js +0 -9
- package/dist/ketchup/p-662d2f9b.entry.js +0 -1
- package/dist/ketchup/p-d1268ac7.entry.js +0 -1
|
@@ -5,7 +5,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
5
5
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
6
6
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
7
7
|
};
|
|
8
|
-
var _KupOpenAI_instances,
|
|
8
|
+
var _KupOpenAI_instances, _KupOpenAI_invalidPassword, _KupOpenAI_create, _KupOpenAI_connect, _KupOpenAI_disconnect;
|
|
9
9
|
import { KupCardFamily } from "../../components/kup-card/kup-card-declarations";
|
|
10
10
|
import { KupDebugCategory } from "../kup-debug/kup-debug-declarations";
|
|
11
11
|
const dom = document.documentElement;
|
|
@@ -16,15 +16,31 @@ export class KupOpenAI {
|
|
|
16
16
|
constructor(url) {
|
|
17
17
|
_KupOpenAI_instances.add(this);
|
|
18
18
|
this.card = null;
|
|
19
|
+
this.context = '';
|
|
19
20
|
this.data = null;
|
|
20
21
|
this.dialog = null;
|
|
21
22
|
this.sessionInfo = null;
|
|
22
23
|
this.url = null;
|
|
24
|
+
this.getFunFromText = (text) => {
|
|
25
|
+
const pattern = /#\[(?:F|C|A)\(([^)]*)\)\s*(?:\d\(([^)]*)\)\s*)?(?:INPUT\(([^)]*)\)\s*)?(?:SP\(([^)]*)\)\s*)?(?:P\(([^]*)\)\s*)?(?:CRO\(([^)]*)\)\s*)?(?:SS\(([^)]*)\)\s*)?(?:SERVER\(([^)]*)\)\s*)?(?:SG\(([^)]*)\)\s*)?(?:G\(([^)]*)\)\s*)?(?:NOTIFY\(([^)]*)\)\s*)?]\#/g;
|
|
26
|
+
return [...text.matchAll(pattern)];
|
|
27
|
+
};
|
|
23
28
|
this.container = document.createElement('div');
|
|
24
29
|
this.container.setAttribute('kup-openai', '');
|
|
25
30
|
document.body.appendChild(this.container);
|
|
26
31
|
this.url = url;
|
|
27
32
|
}
|
|
33
|
+
setError(message, _this, dontRefreshCard) {
|
|
34
|
+
if (!_this) {
|
|
35
|
+
_this = this;
|
|
36
|
+
}
|
|
37
|
+
dom.ketchup.debug.logMessage(_this, message, KupDebugCategory.ERROR);
|
|
38
|
+
if (dontRefreshCard) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
_this.getCardOptions().state = 'error';
|
|
42
|
+
_this.card.refresh();
|
|
43
|
+
}
|
|
28
44
|
getCardOptions() {
|
|
29
45
|
if (!this.card.data) {
|
|
30
46
|
this.card.data = {};
|
|
@@ -37,27 +53,24 @@ export class KupOpenAI {
|
|
|
37
53
|
}
|
|
38
54
|
return this.card.data.options;
|
|
39
55
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
this.
|
|
47
|
-
|
|
48
|
-
__classPrivateFieldGet(this, _KupOpenAI_instances, "m", _KupOpenAI_create).call(this);
|
|
56
|
+
async show(parameters) {
|
|
57
|
+
this.context = parameters.context;
|
|
58
|
+
this.data = parameters.dataset;
|
|
59
|
+
if (parameters.onFunClick) {
|
|
60
|
+
this.onFunClick = parameters.onFunClick;
|
|
61
|
+
}
|
|
62
|
+
if (this.card) {
|
|
63
|
+
await this.hide();
|
|
49
64
|
}
|
|
65
|
+
__classPrivateFieldGet(this, _KupOpenAI_instances, "m", _KupOpenAI_create).call(this);
|
|
50
66
|
}
|
|
51
|
-
|
|
52
|
-
* Hides the component.
|
|
53
|
-
*/
|
|
54
|
-
hide() {
|
|
67
|
+
async hide() {
|
|
55
68
|
if (this.card) {
|
|
56
69
|
this.card.remove();
|
|
57
70
|
this.card = null;
|
|
58
71
|
this.dialog.remove();
|
|
59
72
|
this.dialog = null;
|
|
60
|
-
__classPrivateFieldGet(this, _KupOpenAI_instances, "m", _KupOpenAI_disconnect).call(this);
|
|
73
|
+
await __classPrivateFieldGet(this, _KupOpenAI_instances, "m", _KupOpenAI_disconnect).call(this);
|
|
61
74
|
}
|
|
62
75
|
}
|
|
63
76
|
async auth(event) {
|
|
@@ -77,13 +90,13 @@ export class KupOpenAI {
|
|
|
77
90
|
});
|
|
78
91
|
}
|
|
79
92
|
catch (e) {
|
|
80
|
-
|
|
93
|
+
openAI.setError(e.message, openAI);
|
|
81
94
|
return;
|
|
82
95
|
}
|
|
83
96
|
if (response) {
|
|
84
97
|
if (response.status != 200) {
|
|
85
98
|
__classPrivateFieldGet(openAI, _KupOpenAI_instances, "m", _KupOpenAI_invalidPassword).call(openAI, event);
|
|
86
|
-
//this
|
|
99
|
+
//this.setError(await response.text());
|
|
87
100
|
return;
|
|
88
101
|
}
|
|
89
102
|
const responseJson = await response.json();
|
|
@@ -98,6 +111,10 @@ export class KupOpenAI {
|
|
|
98
111
|
openAI.card.refresh();
|
|
99
112
|
}
|
|
100
113
|
async chat(disableInteractivity, inputArea) {
|
|
114
|
+
const openAI = dom.ketchup.openAI;
|
|
115
|
+
if (!openAI.card) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
101
118
|
const communicate = async (question) => {
|
|
102
119
|
if (!openAI.url) {
|
|
103
120
|
return;
|
|
@@ -114,6 +131,7 @@ export class KupOpenAI {
|
|
|
114
131
|
'Content-Type': 'application/json',
|
|
115
132
|
},
|
|
116
133
|
body: JSON.stringify({
|
|
134
|
+
context: openAI.sessionInfo.context,
|
|
117
135
|
fileId: openAI.sessionInfo.fileId,
|
|
118
136
|
threadId: openAI.sessionInfo.threadId,
|
|
119
137
|
question: question,
|
|
@@ -121,41 +139,31 @@ export class KupOpenAI {
|
|
|
121
139
|
});
|
|
122
140
|
}
|
|
123
141
|
catch (e) {
|
|
124
|
-
|
|
142
|
+
openAI.setError(e.message, openAI);
|
|
125
143
|
}
|
|
126
144
|
if (response) {
|
|
127
145
|
if (response.status != 200) {
|
|
128
|
-
|
|
146
|
+
openAI.setError(await response.text(), openAI);
|
|
129
147
|
return;
|
|
130
148
|
}
|
|
131
149
|
const responseJson = await response.json();
|
|
132
150
|
if (responseJson && responseJson.messages) {
|
|
133
|
-
|
|
151
|
+
for (let i = 0; i < responseJson.messages.length; i++) {
|
|
152
|
+
const m = responseJson.messages[i];
|
|
153
|
+
m.funs = openAI.getFunFromText(m.text);
|
|
154
|
+
responseMessages.push(m);
|
|
155
|
+
}
|
|
134
156
|
}
|
|
135
157
|
}
|
|
136
158
|
return responseMessages;
|
|
137
159
|
};
|
|
138
|
-
const openAI = dom.ketchup.openAI;
|
|
139
|
-
if (!openAI.card) {
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
160
|
disableInteractivity(true);
|
|
143
161
|
openAI.getCardOptions().messages = await communicate(await inputArea.getValue());
|
|
144
162
|
openAI.card.refresh();
|
|
145
163
|
disableInteractivity(false);
|
|
146
164
|
}
|
|
147
165
|
}
|
|
148
|
-
_KupOpenAI_instances = new WeakSet(),
|
|
149
|
-
if (!_this) {
|
|
150
|
-
_this = this;
|
|
151
|
-
}
|
|
152
|
-
dom.ketchup.debug.logMessage(_this, message, KupDebugCategory.ERROR);
|
|
153
|
-
if (dontRefreshCard) {
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
_this.getCardOptions().state = 'error';
|
|
157
|
-
_this.card.refresh();
|
|
158
|
-
}, _KupOpenAI_invalidPassword = function _KupOpenAI_invalidPassword(event) {
|
|
166
|
+
_KupOpenAI_instances = new WeakSet(), _KupOpenAI_invalidPassword = function _KupOpenAI_invalidPassword(event) {
|
|
159
167
|
const field = event.detail.comp;
|
|
160
168
|
field.helper = 'Invalid password.';
|
|
161
169
|
field.rootElement.classList.add('kup-danger');
|
|
@@ -195,20 +203,24 @@ _KupOpenAI_instances = new WeakSet(), _KupOpenAI_setError = function _KupOpenAI_
|
|
|
195
203
|
headers: {
|
|
196
204
|
'Content-Type': 'application/json',
|
|
197
205
|
},
|
|
198
|
-
body: JSON.stringify({
|
|
206
|
+
body: JSON.stringify({
|
|
207
|
+
context: this.context,
|
|
208
|
+
data: this.data,
|
|
209
|
+
}),
|
|
199
210
|
});
|
|
200
211
|
}
|
|
201
212
|
catch (e) {
|
|
202
|
-
|
|
213
|
+
this.setError(e.message);
|
|
203
214
|
return;
|
|
204
215
|
}
|
|
205
216
|
if (response) {
|
|
206
217
|
if (response.status != 200) {
|
|
207
|
-
|
|
218
|
+
this.setError(await response.text());
|
|
208
219
|
return;
|
|
209
220
|
}
|
|
210
221
|
const responseJson = await response.json();
|
|
211
222
|
this.sessionInfo = {
|
|
223
|
+
context: this.context,
|
|
212
224
|
fileId: responseJson.fileId,
|
|
213
225
|
threadId: responseJson.threadId,
|
|
214
226
|
};
|
|
@@ -233,18 +245,19 @@ _KupOpenAI_instances = new WeakSet(), _KupOpenAI_setError = function _KupOpenAI_
|
|
|
233
245
|
'Content-Type': 'application/json',
|
|
234
246
|
},
|
|
235
247
|
body: JSON.stringify({
|
|
248
|
+
context: this.sessionInfo.context,
|
|
236
249
|
fileId: this.sessionInfo.fileId,
|
|
237
250
|
threadId: this.sessionInfo.threadId,
|
|
238
251
|
}),
|
|
239
252
|
});
|
|
240
253
|
}
|
|
241
254
|
catch (e) {
|
|
242
|
-
|
|
255
|
+
this.setError(e.message, undefined, true);
|
|
243
256
|
}
|
|
244
257
|
this.sessionInfo = null;
|
|
245
258
|
if (response) {
|
|
246
259
|
if (response.status != 200) {
|
|
247
|
-
|
|
260
|
+
this.setError(await response.text(), undefined, true);
|
|
248
261
|
}
|
|
249
262
|
}
|
|
250
263
|
};
|