diff --git a/README-CN.md b/README-CN.md index 73a42e2207..ac0611da9d 100644 --- a/README-CN.md +++ b/README-CN.md @@ -16,11 +16,10 @@

- GitHub - Readme - jp + GitHub - Readme - jp

- [![Discord](https://img.shields.io/badge/chat-Discord-7289DA?logo=discord)](https://discord.gg/illacloud) [![Twitter](https://img.shields.io/badge/Twitter-1DA1F2?logo=x&logoColor=white)](https://twitter.com/illa_cloud) [![Discussions](https://img.shields.io/badge/discussions-GitHub-333333?logo=github)](https://github.com/orgs/illacloud/discussions) @@ -96,7 +95,8 @@ ILLA CLI 使您能够以超乎想象的速度部署 ILLA Builder。 [单击此 加入微信群: -![IMG_5405](https://github.com/illacloud/illa-builder/assets/112603073/9fd62305-13d0-487c-b9cd-ed7fb88d7448) +![IMG_5468](https://github.com/illacloud/illa-builder/assets/112603073/bbdc47f4-97bd-4258-bc89-893ce28cbe53) + Discord与Github社区入口 diff --git a/README-DE.md b/README-DE.md index fb15a91457..80d7f76740 100644 --- a/README-DE.md +++ b/README-DE.md @@ -15,7 +15,7 @@

- GitHub - Readme - jp + GitHub - Readme - jp

diff --git a/README-JP.md b/README-JP.md index 6799aa46e6..92be403809 100644 --- a/README-JP.md +++ b/README-JP.md @@ -16,7 +16,7 @@

- GitHub - Readme - jp + GitHub - Readme - jp

diff --git a/README.md b/README.md index 35b7694ddd..895bad1374 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ English | - Github(1) + Github(1)

diff --git a/apps/builder/package.json b/apps/builder/package.json index 9ae8c055e6..1cf1b92a6a 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.4.13", + "version": "4.5.2", "scripts": { "dev": "vite --strictPort --force", "build-cloud": "NODE_OPTIONS=--max-old-space-size=12288 vite build --mode cloud", diff --git a/apps/builder/src/hooks/utils/fixComponentsUtils/likeInput.ts b/apps/builder/src/hooks/utils/fixComponentsUtils/likeInput.ts index d8769dc220..de2352f368 100644 --- a/apps/builder/src/hooks/utils/fixComponentsUtils/likeInput.ts +++ b/apps/builder/src/hooks/utils/fixComponentsUtils/likeInput.ts @@ -7,7 +7,7 @@ export const fixedLikeInputComponentDefaultValue = ( ...component, props: { ...component.props, - value: "", + value: undefined, defaultValue: component.props?.defaultValue || "", }, } diff --git a/apps/builder/src/widgetLibrary/InputWidget/widgetConfig.tsx b/apps/builder/src/widgetLibrary/InputWidget/widgetConfig.tsx index 26ce6a5dbe..1f92e82dfc 100644 --- a/apps/builder/src/widgetLibrary/InputWidget/widgetConfig.tsx +++ b/apps/builder/src/widgetLibrary/InputWidget/widgetConfig.tsx @@ -14,7 +14,7 @@ export const INPUT_WIDGET_CONFIG: WidgetConfig = { resizeDirection: RESIZE_DIRECTION.HORIZONTAL, version: 0, defaults: { - value: "", + value: undefined, defaultValue: "", label: "Label", labelAlign: "left", diff --git a/apps/builder/src/widgetLibrary/JsonEditorWidget/jsonEditor.tsx b/apps/builder/src/widgetLibrary/JsonEditorWidget/jsonEditor.tsx index eab6d67417..e593ee5224 100644 --- a/apps/builder/src/widgetLibrary/JsonEditorWidget/jsonEditor.tsx +++ b/apps/builder/src/widgetLibrary/JsonEditorWidget/jsonEditor.tsx @@ -23,23 +23,33 @@ export const JsonEditorWidget: FC = (props) => { const cacheValue = useRef(value) const debounceUpdateOnChange = useRef( - debounce((value: unknown) => { - if (typeof value === "string") { - handleUpdateMultiExecutionResult([ - { - displayName, - value: { - value: value, + debounce( + ( + value: unknown, + triggerEventHandler: JsonEditorWidgetProps["triggerEventHandler"], + ) => { + if (typeof value === "string") { + handleUpdateMultiExecutionResult([ + { + displayName, + value: { + value: value, + }, }, - }, - ]) - } - }, 180), + ]) + triggerEventHandler("change") + } + }, + 180, + ), ) - const updateOnChange = useCallback((value: unknown) => { - debounceUpdateOnChange.current(value) - }, []) + const updateOnChange = useCallback( + (value: unknown) => { + debounceUpdateOnChange.current(value, triggerEventHandler) + }, + [triggerEventHandler], + ) const handleOnFocus = useCallback(() => { triggerEventHandler("focus") @@ -49,22 +59,34 @@ export const JsonEditorWidget: FC = (props) => { triggerEventHandler("blur") }, [triggerEventHandler]) - const handleOnChange = useCallback(() => { - triggerEventHandler("change") - }, [triggerEventHandler]) - useEffect(() => { if (cacheDefaultValue.current !== defaultValue) { cacheDefaultValue.current = defaultValue } - }, [defaultValue, handleOnChange]) + }, [defaultValue]) + + useEffect(() => { + if ( + cacheDefaultValue.current === defaultValue && + cacheValue.current !== cacheDefaultValue.current + ) { + handleUpdateMultiExecutionResult([ + { + displayName, + value: { + value: defaultValue, + }, + }, + ]) + cacheValue.current = defaultValue + } + }, [defaultValue, displayName, handleUpdateMultiExecutionResult]) useEffect(() => { if (cacheValue.current !== value) { - handleOnChange() cacheValue.current = value } - }, [handleOnChange, value]) + }, [value]) useEffect(() => { updateComponentRuntimeProps({ diff --git a/apps/builder/src/widgetLibrary/JsonEditorWidget/widgetConfig.tsx b/apps/builder/src/widgetLibrary/JsonEditorWidget/widgetConfig.tsx index 3a59e9493c..33a51d2593 100644 --- a/apps/builder/src/widgetLibrary/JsonEditorWidget/widgetConfig.tsx +++ b/apps/builder/src/widgetLibrary/JsonEditorWidget/widgetConfig.tsx @@ -15,14 +15,7 @@ export const JSON_EDITOR_WIDGET_CONFIG: WidgetConfig = { defaults: { colorScheme: "grayBlue", hidden: false, - value: `[{ - language: "en-US", - userConfig: { "0-16": "planA", "17-24": "planB", "25+": "planC" }, -}, -{ - language: "ja-JP", - userConfig: { "0-16": "planD", "17-24": "planE", "25+": "planF" }, -}]`, + value: undefined, defaultValue: `[{ language: "en-US", userConfig: { "0-16": "planA", "17-24": "planB", "25+": "planC" }, diff --git a/apps/builder/src/widgetLibrary/NumberInputWidget/numberInput.tsx b/apps/builder/src/widgetLibrary/NumberInputWidget/numberInput.tsx index ea5e346878..ae0005e26a 100644 --- a/apps/builder/src/widgetLibrary/NumberInputWidget/numberInput.tsx +++ b/apps/builder/src/widgetLibrary/NumberInputWidget/numberInput.tsx @@ -97,15 +97,20 @@ export const NumberInputWidget: FC = (props) => { ) useEffect(() => { - setNumberInputValue(defaultValue) - handleUpdateMultiExecutionResult([ - { - displayName, - value: { - value: defaultValue || "", + if ( + typeof defaultValue === "undefined" || + typeof defaultValue === "number" + ) { + setNumberInputValue(defaultValue) + handleUpdateMultiExecutionResult([ + { + displayName, + value: { + value: (defaultValue as unknown) === "" ? undefined : defaultValue, + }, }, - }, - ]) + ]) + } }, [defaultValue, displayName, handleUpdateMultiExecutionResult]) const debounceOnChange = useRef( @@ -127,7 +132,7 @@ export const NumberInputWidget: FC = (props) => { { displayName, value: { - value: value === undefined ? "" : value, + value: (value as unknown) === "" ? undefined : value, validateMessage: message, }, }, @@ -193,7 +198,7 @@ export const NumberInputWidget: FC = (props) => { numberInputRef.current?.focus() }, setValue: (value: number) => { - if (typeof value === "number") { + if (typeof value === "number" || typeof value === "undefined") { handleOnChange(value) } }, diff --git a/apps/builder/src/widgetLibrary/NumberInputWidget/widgetConfig.tsx b/apps/builder/src/widgetLibrary/NumberInputWidget/widgetConfig.tsx index b12296c1da..09749c710e 100644 --- a/apps/builder/src/widgetLibrary/NumberInputWidget/widgetConfig.tsx +++ b/apps/builder/src/widgetLibrary/NumberInputWidget/widgetConfig.tsx @@ -16,7 +16,7 @@ export const NUMBER_INPUT_WIDGET_CONFIG: WidgetConfig = { defaults: { label: "Label", defaultValue: "", - value: "", + value: undefined, labelAlign: "left", labelPosition: "left", labelWidth: "{{33}}", diff --git a/apps/builder/src/widgetLibrary/SliderWidget/widgetConfig.tsx b/apps/builder/src/widgetLibrary/SliderWidget/widgetConfig.tsx index 9ef76855ed..bb00a5bb17 100644 --- a/apps/builder/src/widgetLibrary/SliderWidget/widgetConfig.tsx +++ b/apps/builder/src/widgetLibrary/SliderWidget/widgetConfig.tsx @@ -14,7 +14,7 @@ export const SLIDER_WIDGET_CONFIG: WidgetConfig = { resizeDirection: RESIZE_DIRECTION.HORIZONTAL, version: 0, defaults: { - value: "{{2}}", + value: undefined, defaultValue: "{{2}}", min: "{{0}}", max: "{{10}}", diff --git a/apps/builder/src/widgetLibrary/TextAreaWidget/widgetConfig.tsx b/apps/builder/src/widgetLibrary/TextAreaWidget/widgetConfig.tsx index 3603744006..dffb89c6e6 100644 --- a/apps/builder/src/widgetLibrary/TextAreaWidget/widgetConfig.tsx +++ b/apps/builder/src/widgetLibrary/TextAreaWidget/widgetConfig.tsx @@ -13,7 +13,7 @@ export const TEXTAREA_WIDGET_CONFIG: WidgetConfig = { h: 8, version: 0, defaults: { - value: "", + value: undefined, defaultValue: "", label: "Label", labelAlign: "left", diff --git a/packages/illa-design b/packages/illa-design index 75dee71ddd..06c3957793 160000 --- a/packages/illa-design +++ b/packages/illa-design @@ -1 +1 @@ -Subproject commit 75dee71ddd8e042681700398c95ce3858eb4b9bb +Subproject commit 06c39577934bf596d6722f51ca8331a4c2a17104