Skip to content

Commit

Permalink
Merge pull request #471 from illa-family/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
AruSeito authored Nov 10, 2022
2 parents e6cfb34 + 7d8d945 commit e479c52
Show file tree
Hide file tree
Showing 111 changed files with 7,060 additions and 273 deletions.
8 changes: 4 additions & 4 deletions apps/builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
"@fontsource/fira-code": "^4.5.10",
"@illa-design/react": "*",
"@reduxjs/toolkit": "^1.8.1",
"@sentry/react": "^7.17.3",
"@sentry/tracing": "^7.17.3",
"@uiw/react-color": "^1.1.0",
"@uiw/react-color-sketch": "^1.1.0",
"@uiw/react-color-swatch": "^1.1.0",
Expand Down Expand Up @@ -53,17 +55,15 @@
"react-markdown": "^8.0.3",
"react-redux": "^8.0.1",
"react-rnd": "^10.3.7",
"react-router-dom": "^6.3.0",
"react-router-dom": "^6.4.3",
"react-use": "^17.4.0",
"react-use-measure": "^2.1.1",
"redux": "^4.2.0",
"redux-logger": "^3.0.6",
"remark-gfm": "^3.0.1",
"tern": "^0.24.3",
"toposort": "^2.0.2",
"uuid": "^8.3.2",
"@sentry/react": "^7.17.3",
"@sentry/tracing": "^7.17.3"
"uuid": "^8.3.2"
},
"devDependencies": {
"@changesets/changelog-github": "^0.4.2",
Expand Down
20 changes: 9 additions & 11 deletions apps/builder/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css, Global } from "@emotion/react"
import { BrowserRouter } from "react-router-dom"
import { BrowserRouter, RouterProvider } from "react-router-dom"
import { globalStyle } from "./style"
import { ConfigProvider } from "@illa-design/config-provider"
import "@/api/base"
Expand Down Expand Up @@ -27,16 +27,14 @@ function App() {
}, [currentUserLanguage, i18n])

return (
<BrowserRouter>
<DndProvider backend={HTML5Backend}>
<GlobalDataProvider>
<ConfigProvider locale={configLanguage}>
<Global styles={css(globalStyle)} />
<ILLARoute />
</ConfigProvider>
</GlobalDataProvider>
</DndProvider>
</BrowserRouter>
<DndProvider backend={HTML5Backend}>
<GlobalDataProvider>
<ConfigProvider locale={configLanguage}>
<Global styles={css(globalStyle)} />
<RouterProvider router={ILLARoute} />
</ConfigProvider>
</GlobalDataProvider>
</DndProvider>
)
}

Expand Down
3 changes: 3 additions & 0 deletions apps/builder/src/assets/change-layout.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions apps/builder/src/assets/dataWorkspace/homepage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions apps/builder/src/assets/rightPagePanel/frame-fixed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions apps/builder/src/assets/rightPagePanel/frame-responsive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions apps/builder/src/assets/rightPagePanel/layout/default.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions apps/builder/src/assets/rightPagePanel/layout/preset-a.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions apps/builder/src/assets/rightPagePanel/layout/preset-b.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions apps/builder/src/assets/rightPagePanel/layout/preset-c.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions apps/builder/src/assets/rightPagePanel/layout/preset-d.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions apps/builder/src/assets/rightPagePanel/layout/preset-e.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 17 additions & 3 deletions apps/builder/src/components/PanelBar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { FC, memo, useCallback, useState } from "react"
import { FC, memo, useCallback, useState, MouseEvent } from "react"
import {
addIconHotpotStyle,
applyPanelBarOpenedIconStyle,
panelBarHeaderStyle,
panelBarItemAnimation,
Expand All @@ -8,7 +9,7 @@ import {
} from "./style"
import { PanelBarProps } from "./interface"
import { AnimatePresence, motion } from "framer-motion"
import { UpIcon } from "@illa-design/icon"
import { PlusIcon, UpIcon } from "@illa-design/icon"

export const PanelBar: FC<PanelBarProps> = memo((props: PanelBarProps) => {
const {
Expand All @@ -17,6 +18,8 @@ export const PanelBar: FC<PanelBarProps> = memo((props: PanelBarProps) => {
isOpened = true,
saveToggleState,
onIllaFocus,
isAddIcon = false,
addAction,
} = props
const [isOpenedState, setIsOpenedState] = useState(isOpened)

Expand All @@ -25,12 +28,23 @@ export const PanelBar: FC<PanelBarProps> = memo((props: PanelBarProps) => {
setIsOpenedState(!isOpenedState)
}, [isOpenedState, saveToggleState])

const handleClickAddIcon = (e: MouseEvent<HTMLDivElement>) => {
e.stopPropagation()
addAction?.()
}

return (
<>
<div css={panelBarHeaderStyle} onClick={handleToggle}>
<span css={panelBarTitleStyle}>{title}</span>
<span>
<UpIcon css={applyPanelBarOpenedIconStyle(isOpenedState)} />
{isAddIcon ? (
<div css={addIconHotpotStyle} onClick={handleClickAddIcon}>
<PlusIcon />
</div>
) : (
<UpIcon css={applyPanelBarOpenedIconStyle(isOpenedState)} />
)}
</span>
</div>
<AnimatePresence initial={false}>
Expand Down
2 changes: 2 additions & 0 deletions apps/builder/src/components/PanelBar/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ export interface PanelBarProps {
title: string
children?: ReactNode
isOpened?: boolean
isAddIcon?: boolean
addAction?: () => void
saveToggleState?: (value: boolean) => void
onIllaFocus?: () => void
}
16 changes: 16 additions & 0 deletions apps/builder/src/components/PanelBar/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,19 @@ export const panelBarItemAnimation: Variants = {
enter: { height: "auto", opacity: 1 },
exit: { height: 0, opacity: 0 },
}

export const addIconHotpotStyle = css`
font-size: 12px;
width: 16px;
height: 16px;
display: flex;
align-items: center;
justify-content: center;
color: ${globalColor(`--${illaPrefix}-grayBlue-04`)};
:hover {
color: ${globalColor(`--${illaPrefix}-grayBlue-02`)};
}
:active {
color: ${globalColor(`--${illaPrefix}-grayBlue-02`)};
}
`
Loading

0 comments on commit e479c52

Please sign in to comment.