From aa464235ca7b82dab4e530c9545c7df002193075 Mon Sep 17 00:00:00 2001 From: Scenery <1507337624@qq.com> Date: Thu, 29 Feb 2024 18:04:07 +0800 Subject: [PATCH 1/4] chore: update submodule --- .../Components/BuildAppOnEmpty/BuildByTemplate/index.tsx | 7 +++++-- apps/builder/src/redux/currentApp/appInfo/appInfoState.ts | 3 ++- packages/illa-public-component | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/builder/src/page/App/Module/CanvasPanel/Components/BuildAppOnEmpty/BuildByTemplate/index.tsx b/apps/builder/src/page/App/Module/CanvasPanel/Components/BuildAppOnEmpty/BuildByTemplate/index.tsx index 22f10eb0b5..4413f54140 100644 --- a/apps/builder/src/page/App/Module/CanvasPanel/Components/BuildAppOnEmpty/BuildByTemplate/index.tsx +++ b/apps/builder/src/page/App/Module/CanvasPanel/Components/BuildAppOnEmpty/BuildByTemplate/index.tsx @@ -123,7 +123,10 @@ const BuildByTemplate: FC = ({ bd="none" w="200px" teamIdentifier={marketplace?.contributorTeam?.teamIdentifier} - handleForkApp={(appId: string, teamIdentifier?: string) => { + handleForkApp={async ( + appId: string, + teamIdentifier?: string, + ) => { track?.( ILLA_MIXPANEL_EVENT_TYPE.CLICK, { @@ -152,7 +155,7 @@ const BuildByTemplate: FC = ({ {showCreateFromTemplateModal && ( { + handleForkApp={async (appId: string, teamIdentifier?: string) => { track?.( ILLA_MIXPANEL_EVENT_TYPE.CLICK, { diff --git a/apps/builder/src/redux/currentApp/appInfo/appInfoState.ts b/apps/builder/src/redux/currentApp/appInfo/appInfoState.ts index 79a3b06fa4..d69d755816 100644 --- a/apps/builder/src/redux/currentApp/appInfo/appInfoState.ts +++ b/apps/builder/src/redux/currentApp/appInfo/appInfoState.ts @@ -1,4 +1,4 @@ -import { AppInfoShape } from "@illa-public/public-types" +import { APP_TYPE, AppInfoShape } from "@illa-public/public-types" export const DashboardAppInitialState: AppInfoShape = { updatedAt: "", @@ -11,6 +11,7 @@ export const DashboardAppInitialState: AppInfoShape = { waterMark: false, publishedToMarketplace: false, publishWithAIAgent: false, + appType: APP_TYPE.PC, }, appActivity: { modifier: "", diff --git a/packages/illa-public-component b/packages/illa-public-component index 73553d2e36..73dff9e845 160000 --- a/packages/illa-public-component +++ b/packages/illa-public-component @@ -1 +1 @@ -Subproject commit 73553d2e36c0bd6f3d77f11142a42ee21e2131c2 +Subproject commit 73dff9e845b41edfb99e513102109af13e1694e5 From 77c77f795c5434530839db055fd9565f65e27e9c Mon Sep 17 00:00:00 2001 From: Scenery <1507337624@qq.com> Date: Thu, 29 Feb 2024 18:33:04 +0800 Subject: [PATCH 2/4] [ci skip] Update package.json --- apps/builder/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/builder/package.json b/apps/builder/package.json index 6577ff667d..5ad84a6dbc 100644 --- a/apps/builder/package.json +++ b/apps/builder/package.json @@ -5,7 +5,7 @@ "private": true, "author": "ILLA Cloud ", "license": "Apache-2.0", - "version": "4.5.8", + "version": "4.5.9", "scripts": { "dev": "vite --strictPort --force", "build-cloud": "NODE_OPTIONS=--max-old-space-size=12288 vite build --mode cloud", From 75479c412683a78bf033b769ef64af66fc262f4b Mon Sep 17 00:00:00 2001 From: Scenery <1507337624@qq.com> Date: Thu, 29 Feb 2024 19:17:31 +0800 Subject: [PATCH 3/4] chore: update slef host mobile app card card type --- apps/cloud/src/page/workspace/apps/mobile/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/cloud/src/page/workspace/apps/mobile/index.tsx b/apps/cloud/src/page/workspace/apps/mobile/index.tsx index 090ee62ce3..0e0242e2be 100644 --- a/apps/cloud/src/page/workspace/apps/mobile/index.tsx +++ b/apps/cloud/src/page/workspace/apps/mobile/index.tsx @@ -67,6 +67,7 @@ export const MobileAppWorkspace = () => { appID={appInfo.appId} publishedToMarketplace={appInfo.config.publishedToMarketplace} editorInfo={appInfo.editedBy} + cardType="app" /> ))} From f3098ca588d8aa672c656ce4598f459ffc9f99b9 Mon Sep 17 00:00:00 2001 From: Scenery <1507337624@qq.com> Date: Fri, 1 Mar 2024 12:08:53 +0800 Subject: [PATCH 4/4] fix: list diff select from container or item --- .../Canvas/renderComponentCanvasContainer.tsx | 1 + .../renderComponentCanvasContainerWithJson.tsx | 1 + .../ListWidgetWithAutoPagination/index.tsx | 18 ++++++++++-------- .../ListWidgetWithServerPagination/index.tsx | 16 ++++++++++++---- .../widgetLibrary/GridListWidget/gridList.tsx | 12 +++++++++--- .../widgetLibrary/GridListWidget/interface.ts | 2 +- .../ListWidgetWithAutoPagination/index.tsx | 18 ++++++++++-------- .../ListWidgetWithServerPagination/index.tsx | 18 ++++++++++-------- .../src/widgetLibrary/ListWidget/interface.ts | 2 +- .../src/widgetLibrary/ListWidget/list.tsx | 12 +++++++++--- 10 files changed, 64 insertions(+), 36 deletions(-) diff --git a/apps/builder/src/page/App/components/DotPanel/components/Canvas/renderComponentCanvasContainer.tsx b/apps/builder/src/page/App/components/DotPanel/components/Canvas/renderComponentCanvasContainer.tsx index 1e5fd61881..bfe6727d56 100644 --- a/apps/builder/src/page/App/components/DotPanel/components/Canvas/renderComponentCanvasContainer.tsx +++ b/apps/builder/src/page/App/components/DotPanel/components/Canvas/renderComponentCanvasContainer.tsx @@ -558,6 +558,7 @@ const RenderComponentCanvasContainer: FC< data-canvas-container={displayName} data-column-number={columnNumber} data-unit-width={unitWidth} + data-list-widget-container > {isEditMode && ( {componentTree} diff --git a/apps/builder/src/widgetLibrary/GridListWidget/components/ListWidgetWithAutoPagination/index.tsx b/apps/builder/src/widgetLibrary/GridListWidget/components/ListWidgetWithAutoPagination/index.tsx index ac9669d553..824ee6ed1c 100644 --- a/apps/builder/src/widgetLibrary/GridListWidget/components/ListWidgetWithAutoPagination/index.tsx +++ b/apps/builder/src/widgetLibrary/GridListWidget/components/ListWidgetWithAutoPagination/index.tsx @@ -220,10 +220,11 @@ const ListWidgetWithAutoPagination: FC = ( loading, )} ref={itemRef} - onClick={() => { - handleUpdateSelectedItem( - selectIndexForMark === 0 ? undefined : 0, - ) + onClick={(e) => { + const isClickOnContainer = !!( + e.target as HTMLElement + )?.getAttribute("data-list-widget-container") + handleUpdateSelectedItem(0, isClickOnContainer) }} > = ( itemHeight, itemPadding?.size, )} - onClick={() => { - handleUpdateSelectedItem( - selectIndexForMark === index ? undefined : index, - ) + onClick={(e) => { + const isClickOnContainer = !!( + e.target as HTMLElement + )?.getAttribute("data-list-widget-container") + handleUpdateSelectedItem(index, isClickOnContainer) }} > = ( isEditMode, loading, )} - onClick={() => { - handleUpdateSelectedItem(0) + onClick={(e) => { + const isClickOnContainer = !!( + e.target as HTMLElement + )?.getAttribute("data-list-widget-container") + + handleUpdateSelectedItem(0, isClickOnContainer) }} > = ( itemPadding?.size, )} ref={itemRef} - onClick={() => { - handleUpdateSelectedItem(index) + onClick={(e) => { + const isClickOnContainer = !!( + e.target as HTMLElement + )?.getAttribute("data-list-widget-container") + + handleUpdateSelectedItem(index, isClickOnContainer) }} > = (props) => { }, [childrenNode, dataSources, transTemplateContainerNodes]) const handleUpdateSelectedItem = useCallback( - (index?: number) => { + (index?: number, isContainerClick?: boolean) => { if (!Array.isArray(dataSources) || disabled) return - if (selectIndexForMark === index || index === undefined) { + if ( + (selectIndexForMark === index && isContainerClick) || + index === undefined + ) { setSelectIndexForMark(undefined) } else { setSelectIndexForMark(index) } new Promise((resolve) => { let value - if (index === undefined || index < 0 || index > dataSources.length) { + if ( + index === undefined || + (selectIndexForMark === index && isContainerClick) + ) { value = { selectedItem: undefined, selectedIndex: undefined, diff --git a/apps/builder/src/widgetLibrary/GridListWidget/interface.ts b/apps/builder/src/widgetLibrary/GridListWidget/interface.ts index 4c4be7f2b9..de61188db0 100644 --- a/apps/builder/src/widgetLibrary/GridListWidget/interface.ts +++ b/apps/builder/src/widgetLibrary/GridListWidget/interface.ts @@ -79,6 +79,6 @@ export interface RenderCopyContainerProps { export interface ListWidgetPropsWithChildrenNodes extends GridListWidgetProps { copyComponents: ComponentTreeNode[] | null - handleUpdateSelectedItem: (index?: number) => void + handleUpdateSelectedItem: (index?: number, isContainerClick?: boolean) => void selectIndexForMark?: number } diff --git a/apps/builder/src/widgetLibrary/ListWidget/components/ListWidgetWithAutoPagination/index.tsx b/apps/builder/src/widgetLibrary/ListWidget/components/ListWidgetWithAutoPagination/index.tsx index 107a3debc6..d73e9a6487 100644 --- a/apps/builder/src/widgetLibrary/ListWidget/components/ListWidgetWithAutoPagination/index.tsx +++ b/apps/builder/src/widgetLibrary/ListWidget/components/ListWidgetWithAutoPagination/index.tsx @@ -184,10 +184,11 @@ const ListWidgetWithAutoPagination: FC = ( isEditMode, loading, )} - onClick={() => { - handleUpdateSelectedItem( - selectIndexForMark === 0 ? undefined : 0, - ) + onClick={(e) => { + const isClickOnContainer = !!( + e.target as HTMLElement + )?.getAttribute("data-list-widget-container") + handleUpdateSelectedItem(0, isClickOnContainer) }} > = ( itemPadding?.size, )} key={node.displayName} - onClick={() => { - handleUpdateSelectedItem( - selectIndexForMark === index ? undefined : index, - ) + onClick={(e) => { + const isClickOnContainer = !!( + e.target as HTMLElement + )?.getAttribute("data-list-widget-container") + handleUpdateSelectedItem(index, isClickOnContainer) }} > = ( isEditMode, loading, )} - onClick={() => { - handleUpdateSelectedItem( - selectIndexForMark === 0 ? undefined : 0, - ) + onClick={(e) => { + const isClickOnContainer = !!( + e.target as HTMLElement + )?.getAttribute("data-list-widget-container") + handleUpdateSelectedItem(0, isClickOnContainer) }} > = ( itemPadding?.size, )} key={node.displayName} - onClick={() => { - handleUpdateSelectedItem( - selectIndexForMark === index ? undefined : index, - ) + onClick={(e) => { + const isClickOnContainer = !!( + e.target as HTMLElement + )?.getAttribute("data-list-widget-container") + handleUpdateSelectedItem(index, isClickOnContainer) }} > void + handleUpdateSelectedItem: (index?: number, isContainerClick?: boolean) => void } diff --git a/apps/builder/src/widgetLibrary/ListWidget/list.tsx b/apps/builder/src/widgetLibrary/ListWidget/list.tsx index 05067cffb8..cf85b87fbf 100644 --- a/apps/builder/src/widgetLibrary/ListWidget/list.tsx +++ b/apps/builder/src/widgetLibrary/ListWidget/list.tsx @@ -175,16 +175,22 @@ export const ListWidget: FC = (props) => { }, [childrenNode, dataSources, transTemplateContainerNodes]) const handleUpdateSelectedItem = useCallback( - (index?: number) => { + (index?: number, isContainerClick?: boolean) => { if (!Array.isArray(dataSources) || disabled) return - if (selectIndexForMark === index || index === undefined) { + if ( + (selectIndexForMark === index && isContainerClick) || + index === undefined + ) { setSelectIndexForMark(undefined) } else { setSelectIndexForMark(index) } new Promise((resolve) => { let value - if (index === undefined || index < 0 || index > dataSources.length) { + if ( + index === undefined || + (selectIndexForMark === index && isContainerClick) + ) { value = { selectedItem: undefined, selectedIndex: undefined,