Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: package-version and mermaid integration
  • Loading branch information
Aqib Mirza committed May 18, 2023
commit 8833e9c7e80df2ced4b78eec0822ba5145a4cbf8
10 changes: 9 additions & 1 deletion client/packages/lowcoder-comps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"big.js": "^6.2.1",
"lowcoder-cli": "workspace:^",
"lowcoder-sdk": "workspace:^",
"mermaid": "^10.0.2",
"mermaid": "^10.1.x0",
"react": "17",
"react-dom": "17",
"typescript": "4.8.4"
Expand Down Expand Up @@ -47,6 +47,14 @@
"w": 15,
"h": 60
}
},
"mermaid": {
"name": "Mermaid",
"icon": "./icons/icon-chart.svg",
"layoutInfo": {
"w": 15,
"h": 60
}
}
}
},
Expand Down
2 changes: 2 additions & 0 deletions client/packages/lowcoder-comps/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { ChartCompWithDefault } from "./comps/chartComp/chartComp";
import { ImageEditorComp } from "./comps/imageEditorComp/index";
import { CalendarComp } from "./comps/calendarComp/calendarComp";
import { MermaidComp } from "./comps/mermaidComp";

export default {
chart: ChartCompWithDefault,
imageEditor: ImageEditorComp,
calendar: CalendarComp,
mermaid: MermaidComp,
};
1 change: 1 addition & 0 deletions client/packages/lowcoder-design/src/icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ export { ReactComponent as HelpDiscordIcon } from "./icon-help-discord.svg";
export { ReactComponent as LeftAudio } from "./icon-left-comp-audio.svg";
export { ReactComponent as LeftButton } from "./icon-left-comp-button.svg";
export { ReactComponent as LeftChart } from "./icon-left-comp-chart.svg";
export { ReactComponent as LeftMermaid } from "./icon-left-comp-chart.svg";
export { ReactComponent as LeftCheckbox } from "./icon-left-comp-checkbox.svg";
export { ReactComponent as LeftCommon } from "./icon-left-comp-common.svg";
export { ReactComponent as LeftContainer } from "./icon-left-comp-container.svg";
Expand Down
27 changes: 24 additions & 3 deletions client/packages/lowcoder/src/comps/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { ModalComp } from "comps/hooks/modalComp";
import { ButtonComp } from "./comps/buttonComp/buttonComp";
import { DropdownComp } from "./comps/buttonComp/dropdownComp";
import { LinkComp } from "./comps/buttonComp/linkComp";
import { ContainerComp, defaultContainerData } from "./comps/containerComp/containerComp";
import {
ContainerComp,
defaultContainerData,
} from "./comps/containerComp/containerComp";
import { CustomComp } from "./comps/customComp/customComp";
import { DatePickerComp, DateRangeComp } from "./comps/dateComp/dateComp";
import { DividerComp } from "./comps/dividerComp";
Expand Down Expand Up @@ -95,7 +98,12 @@ import {

import { defaultFormData, FormComp } from "./comps/formComp/formComp";
import { IFrameComp } from "./comps/iframeComp";
import { defaultGridData, defaultListViewData, GridComp, ListViewComp } from "./comps/listViewComp";
import {
defaultGridData,
defaultListViewData,
GridComp,
ListViewComp,
} from "./comps/listViewComp";
import { ModuleComp } from "./comps/moduleComp/moduleComp";
import { NavComp } from "./comps/navComp/navComp";
import { TableComp } from "./comps/tableComp";
Expand Down Expand Up @@ -774,6 +782,19 @@ const uiCompMap: Registry = {
h: 35,
},
},
mermaid: {
name: trans("uiComp.mermaidCompName"),
enName: "Mermaid",
description: trans("uiComp.mermaidCompDesc"),
categories: ["dataDisplay", "common"],
icon: ChartCompIcon,
comp: remoteComp({ ...builtInRemoteComps, compName: "mermaid" }),
keywords: trans("uiComp.mermaidCompKeywords"),
layoutInfo: {
w: 11,
h: 35,
},
},
imageEditor: {
name: trans("uiComp.imageEditorCompName"),
enName: "Image Editor",
Expand Down Expand Up @@ -807,7 +828,7 @@ const uiCompMap: Registry = {
layoutInfo: {
w: 24,
h: 60,
}
},
},
signature: {
name: trans("uiComp.signatureCompName"),
Expand Down
11 changes: 9 additions & 2 deletions client/packages/lowcoder/src/comps/uiCompRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import { JSONValue } from "util/jsonTypes";
import { EditorState } from "./editorState";
import { trans } from "i18n";

export type ExposingMultiCompConstructor = ReturnType<typeof withExposingConfigs>;
export type ExposingMultiCompConstructor = ReturnType<
typeof withExposingConfigs
>;
// Required when the container generates default child comps
type CompDefaultDataFunction = (
compName: string,
Expand Down Expand Up @@ -53,6 +55,7 @@ export type UICompType =
| "moduleContainer"
| "textArea"
| "chart"
| "mermaid"
| "imageEditor"
| "calendar"
| "password"
Expand Down Expand Up @@ -83,6 +86,7 @@ export type UICompType =
| "progress"
| "progressCircle"
| "chart"
| "mermaid"
| "fileViewer"
| "divider"
| "qrCode"
Expand Down Expand Up @@ -113,7 +117,10 @@ export type UICompType =

export const uiCompRegistry = {} as Record<UICompType | string, UICompManifest>;

export function registerComp(compType: UICompType | string, manifest: UICompManifest) {
export function registerComp(
compType: UICompType | string,
manifest: UICompManifest
) {
uiCompRegistry[compType] = {
...manifest,
keywords: [manifest.name, manifest.enName, manifest.keywords]
Expand Down
Loading