From 9797cc95bb04659b121ef4ed67f587c79ca38e13 Mon Sep 17 00:00:00 2001 From: Ilia Znamenskii Date: Mon, 7 Oct 2024 13:35:04 +0200 Subject: [PATCH 1/6] remove fake message --- .../ui/wds/WDSAIChatWidget/widget/index.tsx | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/index.tsx b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/index.tsx index f94fb5935f7..94f920ecfd3 100644 --- a/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/index.tsx +++ b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/index.tsx @@ -43,24 +43,7 @@ class WDSAIChatWidget extends BaseWidget { static type = "WDS_AI_CHAT_WIDGET"; state = { - messages: [ - { - id: "1", - content: "Hello! How can I help you?", - role: "assistant" as const, - }, - { - id: "2", - content: "Find stuck support requests", - role: "user" as const, - }, - { - id: "3", - content: - "I'm finding these customer support requests that have been waiting for a response for over a day:", - role: "assistant" as const, - }, - ], + messages: [], prompt: "", isWaitingForResponse: false, }; From 54509b9ab49f6cbb4ca77a847b7959314782d629 Mon Sep 17 00:00:00 2001 From: Ilia Znamenskii Date: Mon, 7 Oct 2024 13:36:57 +0200 Subject: [PATCH 2/6] move AIChat component back to widgets --- app/client/packages/design-system/widgets/src/index.ts | 1 - .../modules/ui-builder/ui/wds/WDSAIChatWidget}/AIChat/index.ts | 0 .../ui-builder/ui/wds/WDSAIChatWidget}/AIChat/src/AIChat.tsx | 0 .../ui/wds/WDSAIChatWidget}/AIChat/src/ChatTitle/ChatTitle.tsx | 0 .../ui/wds/WDSAIChatWidget}/AIChat/src/ChatTitle/index.ts | 0 .../wds/WDSAIChatWidget}/AIChat/src/ChatTitle/styles.module.css | 0 .../ui/wds/WDSAIChatWidget}/AIChat/src/ChatTitle/types.ts | 0 .../WDSAIChatWidget}/AIChat/src/ThreadMessage/ThreadMessage.tsx | 0 .../ui/wds/WDSAIChatWidget}/AIChat/src/ThreadMessage/index.ts | 0 .../WDSAIChatWidget}/AIChat/src/ThreadMessage/styles.module.css | 0 .../ui/wds/WDSAIChatWidget}/AIChat/src/ThreadMessage/types.ts | 0 .../wds/WDSAIChatWidget}/AIChat/src/UserAvatar/UserAvatar.tsx | 0 .../ui/wds/WDSAIChatWidget}/AIChat/src/UserAvatar/index.ts | 0 .../WDSAIChatWidget}/AIChat/src/UserAvatar/styles.module.css | 0 .../ui/wds/WDSAIChatWidget}/AIChat/src/UserAvatar/types.ts | 0 .../ui-builder/ui/wds/WDSAIChatWidget}/AIChat/src/index.ts | 0 .../ui/wds/WDSAIChatWidget}/AIChat/src/styles.module.css | 0 .../ui-builder/ui/wds/WDSAIChatWidget}/AIChat/src/types.ts | 0 .../modules/ui-builder/ui/wds/WDSAIChatWidget/widget/index.tsx | 2 +- 19 files changed, 1 insertion(+), 2 deletions(-) rename app/client/{packages/design-system/widgets/src/components => src/modules/ui-builder/ui/wds/WDSAIChatWidget}/AIChat/index.ts (100%) rename app/client/{packages/design-system/widgets/src/components => src/modules/ui-builder/ui/wds/WDSAIChatWidget}/AIChat/src/AIChat.tsx (100%) rename app/client/{packages/design-system/widgets/src/components => src/modules/ui-builder/ui/wds/WDSAIChatWidget}/AIChat/src/ChatTitle/ChatTitle.tsx (100%) rename app/client/{packages/design-system/widgets/src/components => src/modules/ui-builder/ui/wds/WDSAIChatWidget}/AIChat/src/ChatTitle/index.ts (100%) rename app/client/{packages/design-system/widgets/src/components => src/modules/ui-builder/ui/wds/WDSAIChatWidget}/AIChat/src/ChatTitle/styles.module.css (100%) rename app/client/{packages/design-system/widgets/src/components => src/modules/ui-builder/ui/wds/WDSAIChatWidget}/AIChat/src/ChatTitle/types.ts (100%) rename app/client/{packages/design-system/widgets/src/components => src/modules/ui-builder/ui/wds/WDSAIChatWidget}/AIChat/src/ThreadMessage/ThreadMessage.tsx (100%) rename app/client/{packages/design-system/widgets/src/components => src/modules/ui-builder/ui/wds/WDSAIChatWidget}/AIChat/src/ThreadMessage/index.ts (100%) rename app/client/{packages/design-system/widgets/src/components => src/modules/ui-builder/ui/wds/WDSAIChatWidget}/AIChat/src/ThreadMessage/styles.module.css (100%) rename app/client/{packages/design-system/widgets/src/components => src/modules/ui-builder/ui/wds/WDSAIChatWidget}/AIChat/src/ThreadMessage/types.ts (100%) rename app/client/{packages/design-system/widgets/src/components => src/modules/ui-builder/ui/wds/WDSAIChatWidget}/AIChat/src/UserAvatar/UserAvatar.tsx (100%) rename app/client/{packages/design-system/widgets/src/components => src/modules/ui-builder/ui/wds/WDSAIChatWidget}/AIChat/src/UserAvatar/index.ts (100%) rename app/client/{packages/design-system/widgets/src/components => src/modules/ui-builder/ui/wds/WDSAIChatWidget}/AIChat/src/UserAvatar/styles.module.css (100%) rename app/client/{packages/design-system/widgets/src/components => src/modules/ui-builder/ui/wds/WDSAIChatWidget}/AIChat/src/UserAvatar/types.ts (100%) rename app/client/{packages/design-system/widgets/src/components => src/modules/ui-builder/ui/wds/WDSAIChatWidget}/AIChat/src/index.ts (100%) rename app/client/{packages/design-system/widgets/src/components => src/modules/ui-builder/ui/wds/WDSAIChatWidget}/AIChat/src/styles.module.css (100%) rename app/client/{packages/design-system/widgets/src/components => src/modules/ui-builder/ui/wds/WDSAIChatWidget}/AIChat/src/types.ts (100%) diff --git a/app/client/packages/design-system/widgets/src/index.ts b/app/client/packages/design-system/widgets/src/index.ts index 06aafcc9422..5f308407904 100644 --- a/app/client/packages/design-system/widgets/src/index.ts +++ b/app/client/packages/design-system/widgets/src/index.ts @@ -1,4 +1,3 @@ -export * from "./components/AIChat"; export * from "./components/Icon"; export * from "./components/Button"; export * from "./components/IconButton"; diff --git a/app/client/packages/design-system/widgets/src/components/AIChat/index.ts b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/index.ts similarity index 100% rename from app/client/packages/design-system/widgets/src/components/AIChat/index.ts rename to app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/index.ts diff --git a/app/client/packages/design-system/widgets/src/components/AIChat/src/AIChat.tsx b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/AIChat.tsx similarity index 100% rename from app/client/packages/design-system/widgets/src/components/AIChat/src/AIChat.tsx rename to app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/AIChat.tsx diff --git a/app/client/packages/design-system/widgets/src/components/AIChat/src/ChatTitle/ChatTitle.tsx b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/ChatTitle/ChatTitle.tsx similarity index 100% rename from app/client/packages/design-system/widgets/src/components/AIChat/src/ChatTitle/ChatTitle.tsx rename to app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/ChatTitle/ChatTitle.tsx diff --git a/app/client/packages/design-system/widgets/src/components/AIChat/src/ChatTitle/index.ts b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/ChatTitle/index.ts similarity index 100% rename from app/client/packages/design-system/widgets/src/components/AIChat/src/ChatTitle/index.ts rename to app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/ChatTitle/index.ts diff --git a/app/client/packages/design-system/widgets/src/components/AIChat/src/ChatTitle/styles.module.css b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/ChatTitle/styles.module.css similarity index 100% rename from app/client/packages/design-system/widgets/src/components/AIChat/src/ChatTitle/styles.module.css rename to app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/ChatTitle/styles.module.css diff --git a/app/client/packages/design-system/widgets/src/components/AIChat/src/ChatTitle/types.ts b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/ChatTitle/types.ts similarity index 100% rename from app/client/packages/design-system/widgets/src/components/AIChat/src/ChatTitle/types.ts rename to app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/ChatTitle/types.ts diff --git a/app/client/packages/design-system/widgets/src/components/AIChat/src/ThreadMessage/ThreadMessage.tsx b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/ThreadMessage/ThreadMessage.tsx similarity index 100% rename from app/client/packages/design-system/widgets/src/components/AIChat/src/ThreadMessage/ThreadMessage.tsx rename to app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/ThreadMessage/ThreadMessage.tsx diff --git a/app/client/packages/design-system/widgets/src/components/AIChat/src/ThreadMessage/index.ts b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/ThreadMessage/index.ts similarity index 100% rename from app/client/packages/design-system/widgets/src/components/AIChat/src/ThreadMessage/index.ts rename to app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/ThreadMessage/index.ts diff --git a/app/client/packages/design-system/widgets/src/components/AIChat/src/ThreadMessage/styles.module.css b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/ThreadMessage/styles.module.css similarity index 100% rename from app/client/packages/design-system/widgets/src/components/AIChat/src/ThreadMessage/styles.module.css rename to app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/ThreadMessage/styles.module.css diff --git a/app/client/packages/design-system/widgets/src/components/AIChat/src/ThreadMessage/types.ts b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/ThreadMessage/types.ts similarity index 100% rename from app/client/packages/design-system/widgets/src/components/AIChat/src/ThreadMessage/types.ts rename to app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/ThreadMessage/types.ts diff --git a/app/client/packages/design-system/widgets/src/components/AIChat/src/UserAvatar/UserAvatar.tsx b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/UserAvatar/UserAvatar.tsx similarity index 100% rename from app/client/packages/design-system/widgets/src/components/AIChat/src/UserAvatar/UserAvatar.tsx rename to app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/UserAvatar/UserAvatar.tsx diff --git a/app/client/packages/design-system/widgets/src/components/AIChat/src/UserAvatar/index.ts b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/UserAvatar/index.ts similarity index 100% rename from app/client/packages/design-system/widgets/src/components/AIChat/src/UserAvatar/index.ts rename to app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/UserAvatar/index.ts diff --git a/app/client/packages/design-system/widgets/src/components/AIChat/src/UserAvatar/styles.module.css b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/UserAvatar/styles.module.css similarity index 100% rename from app/client/packages/design-system/widgets/src/components/AIChat/src/UserAvatar/styles.module.css rename to app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/UserAvatar/styles.module.css diff --git a/app/client/packages/design-system/widgets/src/components/AIChat/src/UserAvatar/types.ts b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/UserAvatar/types.ts similarity index 100% rename from app/client/packages/design-system/widgets/src/components/AIChat/src/UserAvatar/types.ts rename to app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/UserAvatar/types.ts diff --git a/app/client/packages/design-system/widgets/src/components/AIChat/src/index.ts b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/index.ts similarity index 100% rename from app/client/packages/design-system/widgets/src/components/AIChat/src/index.ts rename to app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/index.ts diff --git a/app/client/packages/design-system/widgets/src/components/AIChat/src/styles.module.css b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/styles.module.css similarity index 100% rename from app/client/packages/design-system/widgets/src/components/AIChat/src/styles.module.css rename to app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/styles.module.css diff --git a/app/client/packages/design-system/widgets/src/components/AIChat/src/types.ts b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/types.ts similarity index 100% rename from app/client/packages/design-system/widgets/src/components/AIChat/src/types.ts rename to app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/types.ts diff --git a/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/index.tsx b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/index.tsx index 94f920ecfd3..b79b883408d 100644 --- a/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/index.tsx +++ b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/index.tsx @@ -1,4 +1,3 @@ -import { AIChat, type ChatMessage } from "@appsmith/wds"; import { EventType, type ExecutionResult, @@ -15,6 +14,7 @@ import type { DerivedPropertiesMap } from "WidgetProvider/factory"; import type { WidgetProps, WidgetState } from "widgets/BaseWidget"; import BaseWidget from "widgets/BaseWidget"; import type { ContainerWidgetProps } from "widgets/ContainerWidget/widget"; +import { AIChat, type ChatMessage } from "../AIChat"; import { anvilConfig, autocompleteConfig, From d19b3726a635ea59dc438dd71857b02039c03cd6 Mon Sep 17 00:00:00 2001 From: Ilia Znamenskii Date: Mon, 7 Oct 2024 15:45:35 +0200 Subject: [PATCH 3/6] remove AIChat and move widget index to ce/ee --- app/client/src/{ => ce}/widgets/index.ts | 126 ++++++----- app/client/src/ee/widgets/index.ts | 1 + .../ui/wds/WDSAIChatWidget/AIChat/index.ts | 1 - .../wds/WDSAIChatWidget/AIChat/src/AIChat.tsx | 81 -------- .../AIChat/src/ChatTitle/ChatTitle.tsx | 17 -- .../AIChat/src/ChatTitle/index.ts | 2 - .../AIChat/src/ChatTitle/styles.module.css | 22 -- .../AIChat/src/ChatTitle/types.ts | 5 - .../src/ThreadMessage/ThreadMessage.tsx | 64 ------ .../AIChat/src/ThreadMessage/index.ts | 2 - .../src/ThreadMessage/styles.module.css | 27 --- .../AIChat/src/ThreadMessage/types.ts | 7 - .../AIChat/src/UserAvatar/UserAvatar.tsx | 27 --- .../AIChat/src/UserAvatar/index.ts | 2 - .../AIChat/src/UserAvatar/styles.module.css | 13 -- .../AIChat/src/UserAvatar/types.ts | 5 - .../wds/WDSAIChatWidget/AIChat/src/index.ts | 2 - .../AIChat/src/styles.module.css | 48 ----- .../wds/WDSAIChatWidget/AIChat/src/types.ts | 18 -- .../ui/wds/WDSAIChatWidget/index.tsx | 3 - .../widget/config/anvilConfig.ts | 11 - .../widget/config/autocompleteConfig.ts | 5 - .../widget/config/defaultConfig.ts | 10 - .../WDSAIChatWidget/widget/config/index.ts | 17 -- .../widget/config/metaConfig.ts | 9 - .../widget/config/methodsConfig.ts | 6 - .../widget/config/propertyPaneContent.ts | 140 ------------- .../widget/config/propertyPaneStyle.ts | 1 - .../ui/wds/WDSAIChatWidget/widget/index.tsx | 196 ------------------ app/client/src/utils/editor/EditorUtils.ts | 2 +- .../src/utils/testPropertyPaneConfig.test.ts | 2 +- .../workers/common/DataTreeEvaluator/test.ts | 2 +- 32 files changed, 66 insertions(+), 808 deletions(-) rename app/client/src/{ => ce}/widgets/index.ts (53%) create mode 100644 app/client/src/ee/widgets/index.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/index.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/AIChat.tsx delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/ChatTitle/ChatTitle.tsx delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/ChatTitle/index.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/ChatTitle/styles.module.css delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/ChatTitle/types.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/ThreadMessage/ThreadMessage.tsx delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/ThreadMessage/index.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/ThreadMessage/styles.module.css delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/ThreadMessage/types.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/UserAvatar/UserAvatar.tsx delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/UserAvatar/index.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/UserAvatar/styles.module.css delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/UserAvatar/types.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/index.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/styles.module.css delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/types.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/index.tsx delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/anvilConfig.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/autocompleteConfig.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/defaultConfig.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/index.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/metaConfig.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/methodsConfig.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/propertyPaneContent.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/propertyPaneStyle.ts delete mode 100644 app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/index.tsx diff --git a/app/client/src/widgets/index.ts b/app/client/src/ce/widgets/index.ts similarity index 53% rename from app/client/src/widgets/index.ts rename to app/client/src/ce/widgets/index.ts index 23ca19c6934..098751c5a10 100644 --- a/app/client/src/widgets/index.ts +++ b/app/client/src/ce/widgets/index.ts @@ -1,69 +1,68 @@ -import AudioRecorderWidget from "./AudioRecorderWidget"; -import AudioWidget from "./AudioWidget"; -import ButtonGroupWidget from "./ButtonGroupWidget"; -import ButtonWidget from "./ButtonWidget"; -import SelectWidget from "./SelectWidget"; -import CameraWidget from "./CameraWidget"; -import CanvasWidget from "./CanvasWidget"; -import ChartWidget from "./ChartWidget"; -import CheckboxGroupWidget from "./CheckboxGroupWidget"; -import CheckboxWidget from "./CheckboxWidget"; -import CircularProgressWidget from "./CircularProgressWidget"; -import ContainerWidget from "./ContainerWidget"; -import CurrencyInputWidget from "./CurrencyInputWidget"; -import DatePickerWidget from "./DatePickerWidget"; -import DatePickerWidget2 from "./DatePickerWidget2"; -import DividerWidget from "./DividerWidget"; -import MultiSelectWidgetV2 from "./MultiSelectWidgetV2"; -import DocumentViewerWidget from "./DocumentViewerWidget"; -import DropdownWidget from "./DropdownWidget"; -import FilePickerWidget from "./FilepickerWidget"; -import FilePickerWidgetV2 from "./FilePickerWidgetV2"; -import FormButtonWidget from "./FormButtonWidget"; -import FormWidget from "./FormWidget"; -import IconButtonWidget from "./IconButtonWidget"; -import IconWidget from "./IconWidget"; -import IframeWidget from "./IframeWidget"; -import ImageWidget from "./ImageWidget"; -import InputWidget from "./InputWidget"; -import InputWidgetV2 from "./InputWidgetV2"; -import ListWidget from "./ListWidget"; -import MapChartWidget from "./MapChartWidget"; -import MapWidget from "./MapWidget"; -import MenuButtonWidget from "./MenuButtonWidget"; -import ModalWidget from "./ModalWidget"; -import MultiSelectTreeWidget from "./MultiSelectTreeWidget"; -import MultiSelectWidget from "./MultiSelectWidget"; -import PhoneInputWidget from "./PhoneInputWidget"; -import ProgressBarWidget from "./ProgressBarWidget"; -import RadioGroupWidget from "./RadioGroupWidget"; -import RateWidget from "./RateWidget"; -import RichTextEditorWidget from "./RichTextEditorWidget"; -import SingleSelectTreeWidget from "./SingleSelectTreeWidget"; -import SkeletonWidget from "./SkeletonWidget"; -import StatboxWidget from "./StatboxWidget"; -import JSONFormWidget from "./JSONFormWidget"; -import SwitchGroupWidget from "./SwitchGroupWidget"; -import SwitchWidget from "./SwitchWidget"; -import TableWidget from "./TableWidget"; -import TabsMigratorWidget from "./TabsMigrator"; -import TabsWidget from "./TabsWidget"; -import TextWidget from "./TextWidget"; -import VideoWidget from "./VideoWidget"; -import ProgressWidget from "./ProgressWidget"; -import TableWidgetV2 from "./TableWidgetV2"; -import NumberSliderWidget from "./NumberSliderWidget"; -import RangeSliderWidget from "./RangeSliderWidget"; -import CategorySliderWidget from "./CategorySliderWidget"; -import CodeScannerWidget from "./CodeScannerWidget"; -import ListWidgetV2 from "./ListWidgetV2"; -import { WDSAIChatWidget } from "modules/ui-builder/ui/wds/WDSAIChatWidget"; +import AudioRecorderWidget from "../../widgets/AudioRecorderWidget"; +import AudioWidget from "../../widgets/AudioWidget"; +import ButtonGroupWidget from "../../widgets/ButtonGroupWidget"; +import ButtonWidget from "../../widgets/ButtonWidget"; +import SelectWidget from "../../widgets/SelectWidget"; +import CameraWidget from "../../widgets/CameraWidget"; +import CanvasWidget from "../../widgets/CanvasWidget"; +import ChartWidget from "../../widgets/ChartWidget"; +import CheckboxGroupWidget from "../../widgets/CheckboxGroupWidget"; +import CheckboxWidget from "../../widgets/CheckboxWidget"; +import CircularProgressWidget from "../../widgets/CircularProgressWidget"; +import ContainerWidget from "../../widgets/ContainerWidget"; +import CurrencyInputWidget from "../../widgets/CurrencyInputWidget"; +import DatePickerWidget from "../../widgets/DatePickerWidget"; +import DatePickerWidget2 from "../../widgets/DatePickerWidget2"; +import DividerWidget from "../../widgets/DividerWidget"; +import MultiSelectWidgetV2 from "../../widgets/MultiSelectWidgetV2"; +import DocumentViewerWidget from "../../widgets/DocumentViewerWidget"; +import DropdownWidget from "../../widgets/DropdownWidget"; +import FilePickerWidget from "../../widgets/FilepickerWidget"; +import FilePickerWidgetV2 from "../../widgets/FilePickerWidgetV2"; +import FormButtonWidget from "../../widgets/FormButtonWidget"; +import FormWidget from "../../widgets/FormWidget"; +import IconButtonWidget from "../../widgets/IconButtonWidget"; +import IconWidget from "../../widgets/IconWidget"; +import IframeWidget from "../../widgets/IframeWidget"; +import ImageWidget from "../../widgets/ImageWidget"; +import InputWidget from "../../widgets/InputWidget"; +import InputWidgetV2 from "../../widgets/InputWidgetV2"; +import ListWidget from "../../widgets/ListWidget"; +import MapChartWidget from "../../widgets/MapChartWidget"; +import MapWidget from "../../widgets/MapWidget"; +import MenuButtonWidget from "../../widgets/MenuButtonWidget"; +import ModalWidget from "../../widgets/ModalWidget"; +import MultiSelectTreeWidget from "../../widgets/MultiSelectTreeWidget"; +import MultiSelectWidget from "../../widgets/MultiSelectWidget"; +import PhoneInputWidget from "../../widgets/PhoneInputWidget"; +import ProgressBarWidget from "../../widgets/ProgressBarWidget"; +import RadioGroupWidget from "../../widgets/RadioGroupWidget"; +import RateWidget from "../../widgets/RateWidget"; +import RichTextEditorWidget from "../../widgets/RichTextEditorWidget"; +import SingleSelectTreeWidget from "../../widgets/SingleSelectTreeWidget"; +import SkeletonWidget from "../../widgets/SkeletonWidget"; +import StatboxWidget from "../../widgets/StatboxWidget"; +import JSONFormWidget from "../../widgets/JSONFormWidget"; +import SwitchGroupWidget from "../../widgets/SwitchGroupWidget"; +import SwitchWidget from "../../widgets/SwitchWidget"; +import TableWidget from "../../widgets/TableWidget"; +import TabsMigratorWidget from "../../widgets/TabsMigrator"; +import TabsWidget from "../../widgets/TabsWidget"; +import TextWidget from "../../widgets/TextWidget"; +import VideoWidget from "../../widgets/VideoWidget"; +import ProgressWidget from "../../widgets/ProgressWidget"; +import TableWidgetV2 from "../../widgets/TableWidgetV2"; +import NumberSliderWidget from "../../widgets/NumberSliderWidget"; +import RangeSliderWidget from "../../widgets/RangeSliderWidget"; +import CategorySliderWidget from "../../widgets/CategorySliderWidget"; +import CodeScannerWidget from "../../widgets/CodeScannerWidget"; +import ListWidgetV2 from "../../widgets/ListWidgetV2"; import { WDSButtonWidget } from "modules/ui-builder/ui/wds/WDSButtonWidget"; import { WDSInputWidget } from "modules/ui-builder/ui/wds/WDSInputWidget"; import { WDSCheckboxWidget } from "modules/ui-builder/ui/wds/WDSCheckboxWidget"; import { WDSIconButtonWidget } from "modules/ui-builder/ui/wds/WDSIconButtonWidget"; -import type BaseWidget from "./BaseWidget"; -import ExternalWidget from "./ExternalWidget"; +import type BaseWidget from "../../widgets/BaseWidget"; +import ExternalWidget from "../../widgets/ExternalWidget"; import { WDSTableWidget } from "modules/ui-builder/ui/wds/WDSTableWidget"; import { WDSCurrencyInputWidget } from "modules/ui-builder/ui/wds/WDSCurrencyInputWidget"; import { WDSToolbarButtonsWidget } from "modules/ui-builder/ui/wds/WDSToolbarButtonsWidget"; @@ -74,7 +73,7 @@ import { WDSSwitchWidget } from "modules/ui-builder/ui/wds/WDSSwitchWidget"; import { WDSSwitchGroupWidget } from "modules/ui-builder/ui/wds/WDSSwitchGroupWidget"; import { WDSRadioGroupWidget } from "modules/ui-builder/ui/wds/WDSRadioGroupWidget"; import { WDSMenuButtonWidget } from "modules/ui-builder/ui/wds/WDSMenuButtonWidget"; -import CustomWidget from "./CustomWidget"; +import CustomWidget from "../../widgets/CustomWidget"; import { WDSSectionWidget } from "modules/ui-builder/ui/wds/WDSSectionWidget"; import { WDSZoneWidget } from "modules/ui-builder/ui/wds/WDSZoneWidget"; import { WDSHeadingWidget } from "modules/ui-builder/ui/wds/WDSHeadingWidget"; @@ -158,7 +157,6 @@ const DeprecatedWidgets = [ const WDSWidgets = [ // WDS Widgets - WDSAIChatWidget, WDSButtonWidget, WDSInputWidget, WDSCheckboxWidget, diff --git a/app/client/src/ee/widgets/index.ts b/app/client/src/ee/widgets/index.ts new file mode 100644 index 00000000000..ab94ad1cd24 --- /dev/null +++ b/app/client/src/ee/widgets/index.ts @@ -0,0 +1 @@ +export { default } from "ce/widgets"; diff --git a/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/index.ts b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/index.ts deleted file mode 100644 index 3bd16e178a0..00000000000 --- a/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./src"; diff --git a/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/AIChat.tsx b/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/AIChat.tsx deleted file mode 100644 index d6975d9750a..00000000000 --- a/app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/AIChat/src/AIChat.tsx +++ /dev/null @@ -1,81 +0,0 @@ -import { Button, Text, TextArea } from "@appsmith/wds"; -import type { FormEvent, ForwardedRef, KeyboardEvent } from "react"; -import React, { forwardRef, useCallback } from "react"; -import { ChatTitle } from "./ChatTitle"; -import styles from "./styles.module.css"; -import { ThreadMessage } from "./ThreadMessage"; -import type { AIChatProps, ChatMessage } from "./types"; -import { UserAvatar } from "./UserAvatar"; - -const MIN_PROMPT_LENGTH = 3; - -const _AIChat = (props: AIChatProps, ref: ForwardedRef) => { - const { - // assistantName, - chatTitle, - isWaitingForResponse = false, - onPromptChange, - onSubmit, - prompt, - promptInputPlaceholder, - thread, - username, - ...rest - } = props; - - const handleFormSubmit = useCallback( - (event: FormEvent) => { - event.preventDefault(); - onSubmit?.(); - }, - [onSubmit], - ); - - const handlePromptInputKeyDown = useCallback( - (event: KeyboardEvent) => { - if (event.key === "Enter" && event.shiftKey) { - event.preventDefault(); - onSubmit?.(); - } - }, - [onSubmit], - ); - - return ( -
-
- - -
- - - {username} - -
-
- -
    - {thread.map((message: ChatMessage) => ( - - ))} -
- -
-