From c8d069fb76445318f8dc2bd447e1722cbf57a2a4 Mon Sep 17 00:00:00 2001 From: Faran Javed Date: Thu, 20 Mar 2025 17:06:38 +0500 Subject: [PATCH 1/4] add root node_modules in gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b044fc2c8..d2a57a1fe 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ application-dev-localhost.yaml server/api-service/lowcoder-server/src/main/resources/application-local-dev.yaml translations/locales/node_modules/ server/api-service/lowcoder-server/src/main/resources/application-local-dev-ee.yaml +node_modules From a7e34c9e68b4b68f1212951abed202b30c03e14e Mon Sep 17 00:00:00 2001 From: Faran Javed Date: Thu, 20 Mar 2025 22:39:08 +0500 Subject: [PATCH 2/4] [FIX] GlobalCSS styling for Modals/Drawers --- client/packages/lowcoder-core/src/eval/utils/evalStyle.ts | 2 +- client/packages/lowcoder/src/comps/hooks/drawerComp.tsx | 5 ++++- client/packages/lowcoder/src/comps/hooks/modalComp.tsx | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/client/packages/lowcoder-core/src/eval/utils/evalStyle.ts b/client/packages/lowcoder-core/src/eval/utils/evalStyle.ts index b54322727..a7956a5d9 100644 --- a/client/packages/lowcoder-core/src/eval/utils/evalStyle.ts +++ b/client/packages/lowcoder-core/src/eval/utils/evalStyle.ts @@ -6,7 +6,7 @@ function styleNamespace(id: string) { export function evalStyle(id: string, css: string[], globalStyle?: boolean) { const styleId = styleNamespace(id); - const prefixId = globalStyle ? id : `#${id}` + const prefixId = globalStyle ? id : `.${id}`; let compiledCSS = ""; css.forEach((i) => { if (!i.trim()) { diff --git a/client/packages/lowcoder/src/comps/hooks/drawerComp.tsx b/client/packages/lowcoder/src/comps/hooks/drawerComp.tsx index 45e8cb9b9..d607c3211 100644 --- a/client/packages/lowcoder/src/comps/hooks/drawerComp.tsx +++ b/client/packages/lowcoder/src/comps/hooks/drawerComp.tsx @@ -26,6 +26,8 @@ import { isNumeric } from "util/stringUtils"; import { NameConfig, withExposingConfigs } from "../generators/withExposing"; import { title } from "process"; import { SliderControl } from "../controls/sliderControl"; +import clsx from "clsx"; +import { useApplicationId } from "util/hooks"; const EventOptions = [closeEvent] as const; @@ -119,6 +121,7 @@ let TmpDrawerComp = (function () { const isTopBom = ["top", "bottom"].includes(props.placement); const { items, ...otherContainerProps } = props.container; const userViewMode = useUserViewMode(); + const appID = useApplicationId(); const resizable = !userViewMode && (!isTopBom || !props.autoHeight); const onResizeStop = useCallback( ( @@ -172,7 +175,7 @@ let TmpDrawerComp = (function () { zIndex={Layers.drawer} maskClosable={props.maskClosable} mask={props.showMask} - className={props.className as string} + className={clsx(`app-${appID}`, props.className)} data-testid={props.dataTestId as string} > {props.toggleClose && ( diff --git a/client/packages/lowcoder/src/comps/hooks/modalComp.tsx b/client/packages/lowcoder/src/comps/hooks/modalComp.tsx index b97eb5be2..7cdcbe4fd 100644 --- a/client/packages/lowcoder/src/comps/hooks/modalComp.tsx +++ b/client/packages/lowcoder/src/comps/hooks/modalComp.tsx @@ -24,6 +24,8 @@ import { BoolControl } from "comps/controls/boolControl"; import { withDefault } from "comps/generators"; import { SliderControl } from "../controls/sliderControl"; import { getBackgroundStyle } from "@lowcoder-ee/util/styleUtils"; +import clsx from "clsx"; +import { useApplicationId } from "util/hooks"; const EventOptions = [ { label: trans("modalComp.open"), value: "open", description: trans("modalComp.openDesc") }, @@ -113,6 +115,7 @@ let TmpModalComp = (function () { }, (props, dispatch) => { const userViewMode = useUserViewMode(); + const appID = useApplicationId(); const bodyStyle: CSSProperties = { padding: 0 }; const width = transToPxSize(props.width || DEFAULT_WIDTH); let height = undefined; @@ -177,7 +180,7 @@ let TmpModalComp = (function () { zIndex={Layers.modal} modalRender={(node) => {node}} mask={props.showMask} - className={props.className as string} + className={clsx(`app-${appID}`, props.className)} data-testid={props.dataTestId as string} > Date: Fri, 21 Mar 2025 02:43:11 +0500 Subject: [PATCH 3/4] [FIX] GlobalCSS add class name in root --- client/packages/lowcoder/src/comps/comps/rootComp.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/packages/lowcoder/src/comps/comps/rootComp.tsx b/client/packages/lowcoder/src/comps/comps/rootComp.tsx index b28e4c045..edf1f3a34 100644 --- a/client/packages/lowcoder/src/comps/comps/rootComp.tsx +++ b/client/packages/lowcoder/src/comps/comps/rootComp.tsx @@ -35,6 +35,7 @@ import { useUserViewMode } from "util/hooks"; import React from "react"; import { isEqual } from "lodash"; import {LoadingBarHideTrigger} from "@lowcoder-ee/util/hideLoading"; +import clsx from "clsx"; const EditorView = lazy( () => import("pages/editor/editorView"), ); @@ -130,7 +131,11 @@ const RootView = React.memo((props: RootViewProps) => { } return ( -
+
From fa461882cc5843bcdd622b8303f69c82ea3c25a3 Mon Sep 17 00:00:00 2001 From: RAHEEL Date: Sat, 22 Mar 2025 00:31:22 +0500 Subject: [PATCH 4/4] update in lowcoder-code build --- client/packages/lowcoder-core/lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/packages/lowcoder-core/lib/index.js b/client/packages/lowcoder-core/lib/index.js index 66045110c..32166ca50 100644 --- a/client/packages/lowcoder-core/lib/index.js +++ b/client/packages/lowcoder-core/lib/index.js @@ -3331,7 +3331,7 @@ function styleNamespace(id) { function evalStyle(id, css, globalStyle) { var _a; var styleId = styleNamespace(id); - var prefixId = globalStyle ? id : "#".concat(id); + var prefixId = globalStyle ? id : ".".concat(id); var compiledCSS = ""; css.forEach(function (i) { if (!i.trim()) {