@sme.up/ketchup 9.5.0 → 9.5.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-033ed6d4.js → f-button-357a3dff.js} +1 -1
- package/dist/cjs/{f-cell-ef276797.js → f-cell-1de0ea69.js} +5 -5
- package/dist/cjs/{f-chip-d4e26a2b.js → f-chip-bd5882a0.js} +2 -2
- package/dist/cjs/{f-image-33be7baf.js → f-image-30531fd0.js} +1 -1
- package/dist/cjs/{f-paginator-utils-5a18cc19.js → f-paginator-utils-ad8a4635.js} +2 -2
- package/dist/cjs/{f-text-field-f03e97f8.js → f-text-field-be758970.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 +125 -20
- package/dist/cjs/kup-box.cjs.entry.js +7 -7
- package/dist/cjs/kup-calendar.cjs.entry.js +4 -4
- 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-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-f90f1b6d.js → kup-manager-cefb1999.js} +492 -365
- 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/card.js +46 -0
- package/dist/collection/collection-manifest.json +0 -1
- package/dist/collection/components/kup-card/built-in/kup-card-built-in.js +9 -0
- package/dist/collection/components/kup-card/built-in/kup-card-openai.js +74 -0
- package/dist/collection/components/kup-card/kup-card-declarations.js +1 -0
- package/dist/collection/components/kup-card/kup-card.css +86 -0
- package/dist/collection/components/kup-card/kup-card.js +6 -0
- package/dist/collection/components/kup-data-table/kup-data-table.js +2 -3
- package/dist/collection/components/kup-dialog/kup-dialog.css +3 -3
- package/dist/collection/components/kup-dialog/kup-dialog.js +19 -5
- package/dist/collection/managers/kup-manager/kup-manager.js +6 -123
- package/dist/collection/managers/kup-openai/kup-openai-declarations.js +1 -0
- package/dist/collection/managers/kup-openai/kup-openai.js +247 -0
- package/dist/components/kup-autocomplete2.js +776 -546
- package/dist/components/kup-manager.js +492 -365
- package/dist/esm/{f-button-ccde4447.js → f-button-856a189a.js} +1 -1
- package/dist/esm/{f-cell-2ad41d52.js → f-cell-6324d838.js} +5 -5
- package/dist/esm/{f-chip-3df1c255.js → f-chip-e15fba8a.js} +2 -2
- package/dist/esm/{f-image-5434b351.js → f-image-26b1bc14.js} +1 -1
- package/dist/esm/{f-paginator-utils-b90cdd2b.js → f-paginator-utils-e8f62783.js} +2 -2
- package/dist/esm/{f-text-field-f0b81f8b.js → f-text-field-bbe1f236.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 +125 -20
- package/dist/esm/kup-box.entry.js +7 -7
- package/dist/esm/kup-calendar.entry.js +4 -4
- 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-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-e33d8d8c.js → kup-manager-8d1df189.js} +492 -365
- 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-f81d7218.entry.js → p-07bed934.entry.js} +1 -1
- package/dist/ketchup/{p-5b3d8636.entry.js → p-0c124f99.entry.js} +1 -1
- package/dist/ketchup/{p-58798e2d.entry.js → p-0f6cb6e4.entry.js} +1 -1
- package/dist/ketchup/p-177f8008.entry.js +9 -0
- package/dist/ketchup/{p-f0e4e190.js → p-269a9af8.js} +1 -1
- package/dist/ketchup/p-2ab02da0.entry.js +1 -0
- package/dist/ketchup/{p-1a594e06.entry.js → p-3f028a71.entry.js} +1 -1
- package/dist/ketchup/{p-6a8fcb02.entry.js → p-4a18db68.entry.js} +1 -1
- package/dist/ketchup/{p-01aaf3e4.entry.js → p-4eb6d4e8.entry.js} +1 -1
- package/dist/ketchup/{p-eea1ee1b.js → p-63031c77.js} +1 -1
- package/dist/ketchup/{p-4725191c.entry.js → p-753f30d8.entry.js} +1 -1
- package/dist/ketchup/{p-a5229d3d.entry.js → p-8042dcd5.entry.js} +1 -1
- package/dist/ketchup/{p-1dbfcab5.entry.js → p-81c1d557.entry.js} +1 -1
- package/dist/ketchup/p-937a322f.js +29 -0
- package/dist/ketchup/{p-4afe8662.js → p-9ba8f169.js} +1 -1
- package/dist/ketchup/{p-645d881d.entry.js → p-a2d3aec9.entry.js} +1 -1
- package/dist/ketchup/{p-2940b559.entry.js → p-b115e1ec.entry.js} +1 -1
- package/dist/ketchup/{p-11e7be94.js → p-b396d0f8.js} +1 -1
- package/dist/ketchup/{p-7e5d8532.entry.js → p-c12a9759.entry.js} +1 -1
- package/dist/ketchup/{p-190d0bc5.entry.js → p-cadeb53d.entry.js} +1 -1
- package/dist/ketchup/{p-9df95b9f.js → p-caeed3c3.js} +1 -1
- package/dist/ketchup/{p-b104afb6.entry.js → p-d300948a.entry.js} +1 -1
- package/dist/ketchup/{p-95b31ede.js → p-d76cd8d6.js} +1 -1
- package/dist/ketchup/{p-b857aab2.entry.js → p-d9a1e5a4.entry.js} +1 -1
- package/dist/ketchup/{p-788da2d9.entry.js → p-dc370227.entry.js} +1 -1
- package/dist/ketchup/{p-5fa089cd.entry.js → p-f1cae1e1.entry.js} +1 -1
- package/dist/ketchup/{p-269a1dfe.entry.js → p-f417e794.entry.js} +1 -1
- package/dist/ketchup/{p-c0c65349.entry.js → p-f753c13f.entry.js} +1 -1
- package/dist/ketchup/{p-ddd25869.entry.js → p-f7980061.entry.js} +1 -1
- package/dist/types/components/kup-card/built-in/kup-card-built-in.d.ts +6 -0
- package/dist/types/components/kup-card/built-in/kup-card-openai.d.ts +3 -0
- package/dist/types/components/kup-card/kup-card-declarations.d.ts +20 -1
- package/dist/types/components.d.ts +0 -86
- package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +2 -14
- package/dist/types/managers/kup-manager/kup-manager.d.ts +3 -17
- package/dist/types/managers/kup-openai/kup-openai-declarations.d.ts +4 -0
- package/dist/types/managers/kup-openai/kup-openai.d.ts +29 -0
- package/package.json +1 -1
- package/dist/cjs/kup-openai-interface.cjs.entry.js +0 -146
- package/dist/collection/components/kup-openai-interface/kup-openai-interface-declarations.js +0 -11
- package/dist/collection/components/kup-openai-interface/kup-openai-interface.css +0 -64
- package/dist/collection/components/kup-openai-interface/kup-openai-interface.js +0 -340
- package/dist/components/kup-openai-interface.d.ts +0 -11
- package/dist/components/kup-openai-interface.js +0 -301
- package/dist/esm/kup-openai-interface.entry.js +0 -142
- package/dist/ketchup/p-23e4caa1.entry.js +0 -9
- package/dist/ketchup/p-2681d3a2.entry.js +0 -1
- package/dist/ketchup/p-39ba3355.js +0 -29
- package/dist/ketchup/p-6f108540.entry.js +0 -1
- package/dist/types/components/kup-openai-interface/kup-openai-interface-declarations.d.ts +0 -10
- package/dist/types/components/kup-openai-interface/kup-openai-interface.d.ts +0 -59
|
@@ -2622,44 +2622,6 @@ export namespace Components {
|
|
|
2622
2622
|
*/
|
|
2623
2623
|
"setValue": (value: string) => Promise<void>;
|
|
2624
2624
|
}
|
|
2625
|
-
interface KupOpenaiInterface {
|
|
2626
|
-
/**
|
|
2627
|
-
* Custom style of the component.
|
|
2628
|
-
* @default ""
|
|
2629
|
-
* @see https://ketchup.smeup.com/ketchup-showcase/#/customization
|
|
2630
|
-
*/
|
|
2631
|
-
"customStyle": string;
|
|
2632
|
-
/**
|
|
2633
|
-
* Sets the data that will be used for OpenAI comunication.
|
|
2634
|
-
* @default null
|
|
2635
|
-
*/
|
|
2636
|
-
"data": KupDataDataset;
|
|
2637
|
-
/**
|
|
2638
|
-
* Sets the dialog title
|
|
2639
|
-
* @default "Open AI integration"
|
|
2640
|
-
*/
|
|
2641
|
-
"dialogTitle": string;
|
|
2642
|
-
/**
|
|
2643
|
-
* Used to retrieve component's props values.
|
|
2644
|
-
* @param descriptions - When provided and true, the result will be the list of props with their description.
|
|
2645
|
-
* @returns List of props as object, each key will be a prop.
|
|
2646
|
-
*/
|
|
2647
|
-
"getProps": (descriptions?: boolean) => Promise<GenericObject>;
|
|
2648
|
-
/**
|
|
2649
|
-
* Sets the text area label
|
|
2650
|
-
* @default "Insert natural language request..."
|
|
2651
|
-
*/
|
|
2652
|
-
"label": string;
|
|
2653
|
-
/**
|
|
2654
|
-
* This method is used to trigger a new render of the component.
|
|
2655
|
-
*/
|
|
2656
|
-
"refresh": () => Promise<void>;
|
|
2657
|
-
/**
|
|
2658
|
-
* Sets the props to the component.
|
|
2659
|
-
* @param props - Object containing props that will be set to the component.
|
|
2660
|
-
*/
|
|
2661
|
-
"setProps": (props: GenericObject) => Promise<void>;
|
|
2662
|
-
}
|
|
2663
2625
|
interface KupPhotoFrame {
|
|
2664
2626
|
/**
|
|
2665
2627
|
* Custom style of the component.
|
|
@@ -3947,10 +3909,6 @@ export interface KupNumericPickerCustomEvent<T> extends CustomEvent<T> {
|
|
|
3947
3909
|
detail: T;
|
|
3948
3910
|
target: HTMLKupNumericPickerElement;
|
|
3949
3911
|
}
|
|
3950
|
-
export interface KupOpenaiInterfaceCustomEvent<T> extends CustomEvent<T> {
|
|
3951
|
-
detail: T;
|
|
3952
|
-
target: HTMLKupOpenaiInterfaceElement;
|
|
3953
|
-
}
|
|
3954
3912
|
export interface KupPhotoFrameCustomEvent<T> extends CustomEvent<T> {
|
|
3955
3913
|
detail: T;
|
|
3956
3914
|
target: HTMLKupPhotoFrameElement;
|
|
@@ -4646,23 +4604,6 @@ declare global {
|
|
|
4646
4604
|
prototype: HTMLKupNumericPickerElement;
|
|
4647
4605
|
new (): HTMLKupNumericPickerElement;
|
|
4648
4606
|
};
|
|
4649
|
-
interface HTMLKupOpenaiInterfaceElementEventMap {
|
|
4650
|
-
"kup-openai-interface-ready": KupEventPayload;
|
|
4651
|
-
}
|
|
4652
|
-
interface HTMLKupOpenaiInterfaceElement extends Components.KupOpenaiInterface, HTMLStencilElement {
|
|
4653
|
-
addEventListener<K extends keyof HTMLKupOpenaiInterfaceElementEventMap>(type: K, listener: (this: HTMLKupOpenaiInterfaceElement, ev: KupOpenaiInterfaceCustomEvent<HTMLKupOpenaiInterfaceElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
4654
|
-
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
4655
|
-
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
4656
|
-
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
4657
|
-
removeEventListener<K extends keyof HTMLKupOpenaiInterfaceElementEventMap>(type: K, listener: (this: HTMLKupOpenaiInterfaceElement, ev: KupOpenaiInterfaceCustomEvent<HTMLKupOpenaiInterfaceElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
4658
|
-
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
4659
|
-
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
4660
|
-
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
4661
|
-
}
|
|
4662
|
-
var HTMLKupOpenaiInterfaceElement: {
|
|
4663
|
-
prototype: HTMLKupOpenaiInterfaceElement;
|
|
4664
|
-
new (): HTMLKupOpenaiInterfaceElement;
|
|
4665
|
-
};
|
|
4666
4607
|
interface HTMLKupPhotoFrameElementEventMap {
|
|
4667
4608
|
"kup-photoframe-placeholderload": KupEventPayload;
|
|
4668
4609
|
"kup-photoframe-resourceload": KupEventPayload;
|
|
@@ -5001,7 +4942,6 @@ declare global {
|
|
|
5001
4942
|
"kup-magic-box": HTMLKupMagicBoxElement;
|
|
5002
4943
|
"kup-nav-bar": HTMLKupNavBarElement;
|
|
5003
4944
|
"kup-numeric-picker": HTMLKupNumericPickerElement;
|
|
5004
|
-
"kup-openai-interface": HTMLKupOpenaiInterfaceElement;
|
|
5005
4945
|
"kup-photo-frame": HTMLKupPhotoFrameElement;
|
|
5006
4946
|
"kup-planner": HTMLKupPlannerElement;
|
|
5007
4947
|
"kup-planner-renderer": HTMLKupPlannerRendererElement;
|
|
@@ -7054,30 +6994,6 @@ declare namespace LocalJSX {
|
|
|
7054
6994
|
"onKup-numericpicker-itemclick"?: (event: KupNumericPickerCustomEvent<KupNumericPickerEventPayload>) => void;
|
|
7055
6995
|
"onKup-numericpicker-textfieldsubmit"?: (event: KupNumericPickerCustomEvent<KupNumericPickerEventPayload>) => void;
|
|
7056
6996
|
}
|
|
7057
|
-
interface KupOpenaiInterface {
|
|
7058
|
-
/**
|
|
7059
|
-
* Custom style of the component.
|
|
7060
|
-
* @default ""
|
|
7061
|
-
* @see https://ketchup.smeup.com/ketchup-showcase/#/customization
|
|
7062
|
-
*/
|
|
7063
|
-
"customStyle"?: string;
|
|
7064
|
-
/**
|
|
7065
|
-
* Sets the data that will be used for OpenAI comunication.
|
|
7066
|
-
* @default null
|
|
7067
|
-
*/
|
|
7068
|
-
"data"?: KupDataDataset;
|
|
7069
|
-
/**
|
|
7070
|
-
* Sets the dialog title
|
|
7071
|
-
* @default "Open AI integration"
|
|
7072
|
-
*/
|
|
7073
|
-
"dialogTitle"?: string;
|
|
7074
|
-
/**
|
|
7075
|
-
* Sets the text area label
|
|
7076
|
-
* @default "Insert natural language request..."
|
|
7077
|
-
*/
|
|
7078
|
-
"label"?: string;
|
|
7079
|
-
"onKup-openai-interface-ready"?: (event: KupOpenaiInterfaceCustomEvent<KupEventPayload>) => void;
|
|
7080
|
-
}
|
|
7081
6997
|
interface KupPhotoFrame {
|
|
7082
6998
|
/**
|
|
7083
6999
|
* Custom style of the component.
|
|
@@ -8165,7 +8081,6 @@ declare namespace LocalJSX {
|
|
|
8165
8081
|
"kup-magic-box": KupMagicBox;
|
|
8166
8082
|
"kup-nav-bar": KupNavBar;
|
|
8167
8083
|
"kup-numeric-picker": KupNumericPicker;
|
|
8168
|
-
"kup-openai-interface": KupOpenaiInterface;
|
|
8169
8084
|
"kup-photo-frame": KupPhotoFrame;
|
|
8170
8085
|
"kup-planner": KupPlanner;
|
|
8171
8086
|
"kup-planner-renderer": KupPlannerRenderer;
|
|
@@ -8235,7 +8150,6 @@ declare module "@stencil/core" {
|
|
|
8235
8150
|
"kup-magic-box": LocalJSX.KupMagicBox & JSXBase.HTMLAttributes<HTMLKupMagicBoxElement>;
|
|
8236
8151
|
"kup-nav-bar": LocalJSX.KupNavBar & JSXBase.HTMLAttributes<HTMLKupNavBarElement>;
|
|
8237
8152
|
"kup-numeric-picker": LocalJSX.KupNumericPicker & JSXBase.HTMLAttributes<HTMLKupNumericPickerElement>;
|
|
8238
|
-
"kup-openai-interface": LocalJSX.KupOpenaiInterface & JSXBase.HTMLAttributes<HTMLKupOpenaiInterfaceElement>;
|
|
8239
8153
|
"kup-photo-frame": LocalJSX.KupPhotoFrame & JSXBase.HTMLAttributes<HTMLKupPhotoFrameElement>;
|
|
8240
8154
|
"kup-planner": LocalJSX.KupPlanner & JSXBase.HTMLAttributes<HTMLKupPlannerElement>;
|
|
8241
8155
|
"kup-planner-renderer": LocalJSX.KupPlannerRenderer & JSXBase.HTMLAttributes<HTMLKupPlannerRendererElement>;
|
|
@@ -22,7 +22,7 @@ import type { ResizeObserver } from 'resize-observer';
|
|
|
22
22
|
import { KupMathLocales } from '../kup-math/kup-math-declarations';
|
|
23
23
|
import { KupTooltipCallbacks } from '../kup-tooltip/kup-tooltip-declarations';
|
|
24
24
|
import { Options } from 'html2canvas';
|
|
25
|
-
import {
|
|
25
|
+
import { KupOpenAI } from '../kup-openai/kup-openai';
|
|
26
26
|
/**
|
|
27
27
|
* Interface used to define the HTML element with Ketchup specific properties.
|
|
28
28
|
*/
|
|
@@ -41,8 +41,7 @@ export interface KupManager {
|
|
|
41
41
|
interact: KupInteract;
|
|
42
42
|
language: KupLanguage;
|
|
43
43
|
magicBox: HTMLKupMagicBoxElement;
|
|
44
|
-
openAI:
|
|
45
|
-
openAIInterface: KupManagerOpenAIInterface;
|
|
44
|
+
openAI: KupOpenAI;
|
|
46
45
|
math: KupMath;
|
|
47
46
|
objects: KupObjects;
|
|
48
47
|
overrides?: KupManagerInitialization;
|
|
@@ -56,10 +55,6 @@ export interface KupManager {
|
|
|
56
55
|
showMagicBox: () => void;
|
|
57
56
|
hideMagicBox: () => void;
|
|
58
57
|
toggleMagicBox: () => void;
|
|
59
|
-
showOpenAI: (data: KupDataTableDataset) => Promise<void>;
|
|
60
|
-
hideOpenAI: () => Promise<void>;
|
|
61
|
-
toggleOpenAI: (data: KupDataTableDataset) => void;
|
|
62
|
-
interactOpenAI(_question: string): Promise<string[]>;
|
|
63
58
|
setLibraryLocalization: (locale: KupDatesLocales) => void;
|
|
64
59
|
addClickCallback: (cb: KupManagerClickCb, async?: boolean) => void;
|
|
65
60
|
getEventPath: (currentEl: unknown, rootElement: HTMLElement) => HTMLElement[];
|
|
@@ -168,10 +163,3 @@ export interface KupManagerTooltipSettings {
|
|
|
168
163
|
export interface KupManagerStringFinderPayload {
|
|
169
164
|
string: string;
|
|
170
165
|
}
|
|
171
|
-
export interface KupManagerOpenAIInterface {
|
|
172
|
-
url?: string;
|
|
173
|
-
sessionInfo?: {
|
|
174
|
-
fileId: string;
|
|
175
|
-
threadId: string;
|
|
176
|
-
};
|
|
177
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { KupManagerClickCb, KupManagerInitialization,
|
|
1
|
+
import type { KupManagerClickCb, KupManagerInitialization, KupManagerUtilities } from './kup-manager-declarations';
|
|
2
2
|
import { KupDebug } from '../kup-debug/kup-debug';
|
|
3
3
|
import { KupDynamicPosition } from '../kup-dynamic-position/kup-dynamic-position';
|
|
4
4
|
import { KupInteract } from '../kup-interact/kup-interact';
|
|
@@ -15,7 +15,7 @@ import { KupSearch } from '../kup-search/kup-search';
|
|
|
15
15
|
import { KupMath } from '../kup-math/kup-math';
|
|
16
16
|
import { KupTooltip } from '../kup-tooltip/kup-tooltip';
|
|
17
17
|
import { Options } from 'html2canvas';
|
|
18
|
-
import {
|
|
18
|
+
import { KupOpenAI } from '../kup-openai/kup-openai';
|
|
19
19
|
/**
|
|
20
20
|
* This class controls every other Ketchup utility suite.
|
|
21
21
|
* @module KupManager
|
|
@@ -28,8 +28,7 @@ export declare class KupManager {
|
|
|
28
28
|
interact: KupInteract;
|
|
29
29
|
language: KupLanguage;
|
|
30
30
|
magicBox: HTMLKupMagicBoxElement;
|
|
31
|
-
openAI:
|
|
32
|
-
openAIInterface: KupManagerOpenAIInterface;
|
|
31
|
+
openAI: KupOpenAI;
|
|
33
32
|
math: KupMath;
|
|
34
33
|
objects: KupObjects;
|
|
35
34
|
overrides?: KupManagerInitialization;
|
|
@@ -56,19 +55,6 @@ export declare class KupManager {
|
|
|
56
55
|
* Creates or removes kup-magic-box component depending on its existence.
|
|
57
56
|
*/
|
|
58
57
|
toggleMagicBox(): void;
|
|
59
|
-
/**
|
|
60
|
-
* Creates OpenAI component interface.
|
|
61
|
-
*/
|
|
62
|
-
showOpenAI(data: KupDataTableDataset): Promise<void>;
|
|
63
|
-
/**
|
|
64
|
-
* Removes OpenAI component interface.
|
|
65
|
-
*/
|
|
66
|
-
hideOpenAI(): Promise<void>;
|
|
67
|
-
/**
|
|
68
|
-
* Creates or removes OpenAI component interface depending on its existence.
|
|
69
|
-
*/
|
|
70
|
-
toggleOpenAI(data: KupDataTableDataset): void;
|
|
71
|
-
interactOpenAI(question: string): Promise<string[]>;
|
|
72
58
|
/**
|
|
73
59
|
* Sets both locale and language library-wide.
|
|
74
60
|
* @param {KupDatesLocales} locale - The supported locale.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { KupDataTableDataset, KupTextFieldCustomEvent, KupTextFieldEventPayload } from '../../components';
|
|
2
|
+
import { KupCardBuiltInOpenAIOptions } from '../../components/kup-card/kup-card-declarations';
|
|
3
|
+
import { KupOpenAISessionInfo } from './kup-openai-declarations';
|
|
4
|
+
export declare class KupOpenAI {
|
|
5
|
+
#private;
|
|
6
|
+
card: HTMLKupCardElement;
|
|
7
|
+
container: HTMLElement;
|
|
8
|
+
data: KupDataTableDataset;
|
|
9
|
+
dialog: HTMLKupDialogElement;
|
|
10
|
+
sessionInfo: KupOpenAISessionInfo;
|
|
11
|
+
url: string;
|
|
12
|
+
/**
|
|
13
|
+
* Initializes KupOpenAI.
|
|
14
|
+
*/
|
|
15
|
+
constructor(url: string);
|
|
16
|
+
getCardOptions(): KupCardBuiltInOpenAIOptions;
|
|
17
|
+
/**
|
|
18
|
+
* Shows the component
|
|
19
|
+
* @param data
|
|
20
|
+
* @param options
|
|
21
|
+
*/
|
|
22
|
+
show(data: KupDataTableDataset): void;
|
|
23
|
+
/**
|
|
24
|
+
* Hides the component.
|
|
25
|
+
*/
|
|
26
|
+
hide(): void;
|
|
27
|
+
auth(event: KupTextFieldCustomEvent<KupTextFieldEventPayload>): Promise<void>;
|
|
28
|
+
chat(disableInteractivity: any, inputArea: HTMLKupTextFieldElement): Promise<void>;
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-8f2f4159.js');
|
|
6
|
-
const kupManager = require('./kup-manager-f90f1b6d.js');
|
|
7
|
-
const GenericVariables = require('./GenericVariables-1d52ba57.js');
|
|
8
|
-
const fImage = require('./f-image-33be7baf.js');
|
|
9
|
-
require('./kup-dates-0e59b05d.js');
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Props of the kup-openai-interface component.
|
|
13
|
-
* Used to export every prop in an object.
|
|
14
|
-
*/
|
|
15
|
-
var KupOpenAiInterfaceProps;
|
|
16
|
-
(function (KupOpenAiInterfaceProps) {
|
|
17
|
-
KupOpenAiInterfaceProps["customStyle"] = "Custom style of the component.";
|
|
18
|
-
KupOpenAiInterfaceProps["data"] = "Sets the data that will be used for OpenAI comunication.";
|
|
19
|
-
KupOpenAiInterfaceProps["dialogTitle"] = "Sets the dialog title";
|
|
20
|
-
KupOpenAiInterfaceProps["label"] = "Sets the text area label";
|
|
21
|
-
})(KupOpenAiInterfaceProps || (KupOpenAiInterfaceProps = {}));
|
|
22
|
-
|
|
23
|
-
const kupOpenaiInterfaceCss = ":host{--kup_dialog_header_height:var(--kup-dialog-header-height, 2em);background-color:var(--kup-background-color);color:var(--kup-text-color);display:block;height:auto;min-width:500px;width:500px}.header{background-color:var(--kup-title-background-color);color:var(--kup-title-color);display:flex;flex-direction:row;height:var(--kup_dialog_header_height);position:relative;width:100%}.header__title{font-weight:bold;line-height:2em;padding-left:0.5em;padding-right:2em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.header__close.f-image{--kup-icon-color:var(--kup-title-color);cursor:pointer;margin-right:0;transition:opacity 0.25s;position:absolute;right:0;background:var(--kup-title-background-color);height:var(--kup_image_height);width:var(--kup_image_width)}.header__close.f-image:hover{opacity:0.5}.header__close.f-image .f-image__icon{height:var(--kup_image_height);width:var(--kup_image_width)}kup-text-field{padding-top:12px;padding-right:3px;padding-left:3px}kup-button{padding-top:8px;padding-left:3px;padding-bottom:2px}kup-data-table{padding-top:8px;padding-left:3px;padding-bottom:2px}";
|
|
24
|
-
|
|
25
|
-
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
26
|
-
if (kind === "a" && !f)
|
|
27
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
28
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
29
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
30
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
31
|
-
};
|
|
32
|
-
var _KupOpenAiInterface_instances, _KupOpenAiInterface_openAiInteract, _KupOpenAiInterface_dataTableData;
|
|
33
|
-
const KupOpenAiInterface = class {
|
|
34
|
-
constructor(hostRef) {
|
|
35
|
-
index.registerInstance(this, hostRef);
|
|
36
|
-
this.kupReady = index.createEvent(this, "kup-openai-interface-ready", 6);
|
|
37
|
-
_KupOpenAiInterface_instances.add(this);
|
|
38
|
-
/*-------------------------------------------------*/
|
|
39
|
-
/* I n t e r n a l V a r i a b l e s */
|
|
40
|
-
/*-------------------------------------------------*/
|
|
41
|
-
this.dragHandler = null;
|
|
42
|
-
this.kupManager = kupManager.kupManagerInstance();
|
|
43
|
-
this.textArea = null;
|
|
44
|
-
this.dataTable = null;
|
|
45
|
-
this.button = null;
|
|
46
|
-
this.messages = [];
|
|
47
|
-
this.customStyle = '';
|
|
48
|
-
this.data = null;
|
|
49
|
-
this.dialogTitle = 'Open AI integration';
|
|
50
|
-
this.label = 'Insert natural language request...';
|
|
51
|
-
}
|
|
52
|
-
/*-------------------------------------------------*/
|
|
53
|
-
/* P u b l i c M e t h o d s */
|
|
54
|
-
/*-------------------------------------------------*/
|
|
55
|
-
/**
|
|
56
|
-
* Used to retrieve component's props values.
|
|
57
|
-
* @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
|
|
58
|
-
* @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
|
|
59
|
-
*/
|
|
60
|
-
async getProps(descriptions) {
|
|
61
|
-
return kupManager.getProps(this, KupOpenAiInterfaceProps, descriptions);
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* This method is used to trigger a new render of the component.
|
|
65
|
-
*/
|
|
66
|
-
async refresh() {
|
|
67
|
-
index.forceUpdate(this);
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Sets the props to the component.
|
|
71
|
-
* @param {GenericObject} props - Object containing props that will be set to the component.
|
|
72
|
-
*/
|
|
73
|
-
async setProps(props) {
|
|
74
|
-
kupManager.setProps(this, KupOpenAiInterfaceProps, props);
|
|
75
|
-
}
|
|
76
|
-
/*-------------------------------------------------*/
|
|
77
|
-
/* L i f e c y c l e H o o k s */
|
|
78
|
-
/*-------------------------------------------------*/
|
|
79
|
-
componentWillLoad() {
|
|
80
|
-
this.kupManager.debug.logLoad(this, false);
|
|
81
|
-
this.kupManager.language.register(this);
|
|
82
|
-
this.kupManager.theme.register(this);
|
|
83
|
-
}
|
|
84
|
-
componentDidLoad() {
|
|
85
|
-
this.dragHandler =
|
|
86
|
-
this.rootElement.shadowRoot.querySelector('#drag-handle');
|
|
87
|
-
this.kupManager.interact.dialogify(this.rootElement, this.dragHandler);
|
|
88
|
-
this.kupReady.emit({
|
|
89
|
-
comp: this,
|
|
90
|
-
id: this.rootElement.id,
|
|
91
|
-
});
|
|
92
|
-
this.kupManager.debug.logLoad(this, true);
|
|
93
|
-
}
|
|
94
|
-
componentWillRender() {
|
|
95
|
-
this.kupManager.debug.logRender(this, false);
|
|
96
|
-
}
|
|
97
|
-
componentDidRender() {
|
|
98
|
-
this.kupManager.debug.logRender(this, true);
|
|
99
|
-
}
|
|
100
|
-
render() {
|
|
101
|
-
const dataTableProps = {};
|
|
102
|
-
dataTableProps.data = __classPrivateFieldGet(this, _KupOpenAiInterface_instances, "m", _KupOpenAiInterface_dataTableData).call(this);
|
|
103
|
-
const textAreaProps = {};
|
|
104
|
-
textAreaProps.textArea = true;
|
|
105
|
-
textAreaProps.label = this.label;
|
|
106
|
-
const buttonProps = {};
|
|
107
|
-
buttonProps.label = 'Confirm';
|
|
108
|
-
buttonProps.icon = 'check';
|
|
109
|
-
buttonProps.showSpinner = false;
|
|
110
|
-
return (index.h(index.Host, null, index.h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)), index.h("div", { id: GenericVariables.componentWrapperId }, index.h("div", { class: "openai-interface-wrapper" }, index.h("div", { class: "actions", id: "drag-handle" }, index.h("div", { class: "header" }, this.dialogTitle ? (index.h("div", { class: "header__title" }, this.dialogTitle)) : null, index.h(fImage.FImage, { onClick: () => this.kupManager.hideOpenAI(), sizeX: "1.25em", sizeY: "1.25em", resource: "clear", wrapperClass: "header__close" })), index.h("kup-text-field", Object.assign({}, textAreaProps, { ref: (el) => (this.textArea = el) })), index.h("kup-button", Object.assign({}, buttonProps, { ref: (el) => (this.button = el), "onKup-button-click": () => __classPrivateFieldGet(this, _KupOpenAiInterface_instances, "m", _KupOpenAiInterface_openAiInteract).call(this) })), index.h("kup-data-table", Object.assign({}, dataTableProps, { ref: (el) => (this.dataTable = el) })))))));
|
|
111
|
-
}
|
|
112
|
-
disconnectedCallback() {
|
|
113
|
-
this.kupManager.language.unregister(this);
|
|
114
|
-
this.kupManager.theme.unregister(this);
|
|
115
|
-
}
|
|
116
|
-
get rootElement() { return index.getElement(this); }
|
|
117
|
-
};
|
|
118
|
-
_KupOpenAiInterface_instances = new WeakSet(), _KupOpenAiInterface_openAiInteract =
|
|
119
|
-
/*-------------------------------------------------*/
|
|
120
|
-
/* P r i v a t e M e t h o d s */
|
|
121
|
-
/*-------------------------------------------------*/
|
|
122
|
-
async function _KupOpenAiInterface_openAiInteract() {
|
|
123
|
-
this.button.showSpinner = true;
|
|
124
|
-
this.messages = await this.kupManager.interactOpenAI(await this.textArea.getValue());
|
|
125
|
-
this.dataTable.data = __classPrivateFieldGet(this, _KupOpenAiInterface_instances, "m", _KupOpenAiInterface_dataTableData).call(this);
|
|
126
|
-
this.button.showSpinner = false;
|
|
127
|
-
}, _KupOpenAiInterface_dataTableData = function _KupOpenAiInterface_dataTableData() {
|
|
128
|
-
const data = {};
|
|
129
|
-
data.columns = [{ name: 'mess', title: 'Message' }];
|
|
130
|
-
data.rows = [];
|
|
131
|
-
if (this.messages) {
|
|
132
|
-
for (let i = 0; i < this.messages.length; i++) {
|
|
133
|
-
const mess = this.messages[i];
|
|
134
|
-
if (mess) {
|
|
135
|
-
data.rows.push({
|
|
136
|
-
unselectable: true,
|
|
137
|
-
cells: { mess: { value: mess } },
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
return data;
|
|
143
|
-
};
|
|
144
|
-
KupOpenAiInterface.style = kupOpenaiInterfaceCss;
|
|
145
|
-
|
|
146
|
-
exports.kup_openai_interface = KupOpenAiInterface;
|
package/dist/collection/components/kup-openai-interface/kup-openai-interface-declarations.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Props of the kup-openai-interface component.
|
|
3
|
-
* Used to export every prop in an object.
|
|
4
|
-
*/
|
|
5
|
-
export var KupOpenAiInterfaceProps;
|
|
6
|
-
(function (KupOpenAiInterfaceProps) {
|
|
7
|
-
KupOpenAiInterfaceProps["customStyle"] = "Custom style of the component.";
|
|
8
|
-
KupOpenAiInterfaceProps["data"] = "Sets the data that will be used for OpenAI comunication.";
|
|
9
|
-
KupOpenAiInterfaceProps["dialogTitle"] = "Sets the dialog title";
|
|
10
|
-
KupOpenAiInterfaceProps["label"] = "Sets the text area label";
|
|
11
|
-
})(KupOpenAiInterfaceProps || (KupOpenAiInterfaceProps = {}));
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
--kup_dialog_header_height: var(--kup-dialog-header-height, 2em);
|
|
3
|
-
background-color: var(--kup-background-color);
|
|
4
|
-
color: var(--kup-text-color);
|
|
5
|
-
display: block;
|
|
6
|
-
height: auto;
|
|
7
|
-
min-width: 500px;
|
|
8
|
-
width: 500px;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.header {
|
|
12
|
-
background-color: var(--kup-title-background-color);
|
|
13
|
-
color: var(--kup-title-color);
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-direction: row;
|
|
16
|
-
height: var(--kup_dialog_header_height);
|
|
17
|
-
position: relative;
|
|
18
|
-
width: 100%;
|
|
19
|
-
}
|
|
20
|
-
.header__title {
|
|
21
|
-
font-weight: bold;
|
|
22
|
-
line-height: 2em;
|
|
23
|
-
padding-left: 0.5em;
|
|
24
|
-
padding-right: 2em;
|
|
25
|
-
white-space: nowrap;
|
|
26
|
-
overflow: hidden;
|
|
27
|
-
text-overflow: ellipsis;
|
|
28
|
-
}
|
|
29
|
-
.header__close.f-image {
|
|
30
|
-
--kup-icon-color: var(--kup-title-color);
|
|
31
|
-
cursor: pointer;
|
|
32
|
-
margin-right: 0;
|
|
33
|
-
transition: opacity 0.25s;
|
|
34
|
-
position: absolute;
|
|
35
|
-
right: 0;
|
|
36
|
-
background: var(--kup-title-background-color);
|
|
37
|
-
height: var(--kup_image_height);
|
|
38
|
-
width: var(--kup_image_width);
|
|
39
|
-
}
|
|
40
|
-
.header__close.f-image:hover {
|
|
41
|
-
opacity: 0.5;
|
|
42
|
-
}
|
|
43
|
-
.header__close.f-image .f-image__icon {
|
|
44
|
-
height: var(--kup_image_height);
|
|
45
|
-
width: var(--kup_image_width);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
kup-text-field {
|
|
49
|
-
padding-top: 12px;
|
|
50
|
-
padding-right: 3px;
|
|
51
|
-
padding-left: 3px;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
kup-button {
|
|
55
|
-
padding-top: 8px;
|
|
56
|
-
padding-left: 3px;
|
|
57
|
-
padding-bottom: 2px;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
kup-data-table {
|
|
61
|
-
padding-top: 8px;
|
|
62
|
-
padding-left: 3px;
|
|
63
|
-
padding-bottom: 2px;
|
|
64
|
-
}
|