From 37f5b0bd305a3fab529d575524a9c1f57461980e Mon Sep 17 00:00:00 2001 From: Florian Duderstadt Date: Wed, 20 Mar 2024 14:35:16 +0100 Subject: [PATCH 1/5] remove ResizePanel --- src/workspace/SidebarBox/index.jsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/workspace/SidebarBox/index.jsx b/src/workspace/SidebarBox/index.jsx index 9161cd06..63c06dda 100644 --- a/src/workspace/SidebarBox/index.jsx +++ b/src/workspace/SidebarBox/index.jsx @@ -1,15 +1,15 @@ // @flow -import React, {useState, memo, useCallback} from "react" +import React, { useState, memo, useCallback } from "react" import Paper from "@mui/material/Paper" -import {createTheme, styled, ThemeProvider} from "@mui/material/styles" +import { createTheme, styled, ThemeProvider } from "@mui/material/styles" import ExpandIcon from "@mui/icons-material/ExpandMore" import IconButton from "@mui/material/IconButton" import Collapse from "@mui/material/Collapse" import classnames from "classnames" import useEventCallback from "use-event-callback" import Typography from "@mui/material/Typography" -import {useIconDictionary} from "../icon-dictionary.js" +import { useIconDictionary } from "../icon-dictionary.js" import ResizePanel from "../ResizePanel" import styles from "./styles.js" @@ -86,15 +86,13 @@ export const SidebarBox = ({ content ) : null ) : ( - - +
{content}
-
)} From d887d896dde1fb6d74cf1345152a7ecc613f879c Mon Sep 17 00:00:00 2001 From: github-ljprojectbuilder Date: Wed, 20 Mar 2024 13:37:03 +0000 Subject: [PATCH 2/5] chore(release): 5.0.2-0 --- CHANGELOG.md | 2 ++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c3d68b7..b6da0e80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [5.0.2-0](https://github.com/starwit/react-image-annotate/compare/5.0.1...5.0.2-0) (2024-03-20) + ### [5.0.1](https://github.com/starwit/react-image-annotate/compare/4.3.5...5.0.1) (2024-02-29) ## [5.0.0](https://github.com/starwit/react-image-annotate/compare/4.3.4...5.0.0) (2024-02-14) diff --git a/package-lock.json b/package-lock.json index 9c18f89a..e2584e64 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@starwit/react-image-annotate", - "version": "5.0.1", + "version": "5.0.2-0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@starwit/react-image-annotate", - "version": "5.0.1", + "version": "5.0.2-0", "dependencies": { "@emotion/react": "^11.11.3", "@emotion/styled": "^11.11.0", diff --git a/package.json b/package.json index 5f6100da..16658da6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@starwit/react-image-annotate", - "version": "5.0.1", + "version": "5.0.2-0", "private": false, "type": "module", "files": [ From d122b4124e7563b77dc3f349aac169689acd82a6 Mon Sep 17 00:00:00 2001 From: Florian Duderstadt Date: Wed, 20 Mar 2024 14:46:17 +0100 Subject: [PATCH 3/5] test commit --- src/workspace/SidebarBox/index.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/workspace/SidebarBox/index.jsx b/src/workspace/SidebarBox/index.jsx index 63c06dda..49f2e95f 100644 --- a/src/workspace/SidebarBox/index.jsx +++ b/src/workspace/SidebarBox/index.jsx @@ -91,6 +91,7 @@ export const SidebarBox = ({ className="panel" style={{ display: "block", overflow: "hidden", height: 150 }} > + {"passt"} {content} From 59ade20d789bdc89158bd7ff5d6ffa23c8bd674e Mon Sep 17 00:00:00 2001 From: github-ljprojectbuilder Date: Wed, 20 Mar 2024 13:53:56 +0000 Subject: [PATCH 4/5] chore(release): 5.0.2-1 --- CHANGELOG.md | 2 ++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6da0e80..e793c08a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [5.0.2-1](https://github.com/starwit/react-image-annotate/compare/5.0.2-0...5.0.2-1) (2024-03-20) + ### [5.0.2-0](https://github.com/starwit/react-image-annotate/compare/5.0.1...5.0.2-0) (2024-03-20) ### [5.0.1](https://github.com/starwit/react-image-annotate/compare/4.3.5...5.0.1) (2024-02-29) diff --git a/package-lock.json b/package-lock.json index e2584e64..d2b5ea9e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@starwit/react-image-annotate", - "version": "5.0.2-0", + "version": "5.0.2-1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@starwit/react-image-annotate", - "version": "5.0.2-0", + "version": "5.0.2-1", "dependencies": { "@emotion/react": "^11.11.3", "@emotion/styled": "^11.11.0", diff --git a/package.json b/package.json index 16658da6..08b2fc64 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@starwit/react-image-annotate", - "version": "5.0.2-0", + "version": "5.0.2-1", "private": false, "type": "module", "files": [ From 3692daaeafcf70bff1f5835d81378544ea2d2a43 Mon Sep 17 00:00:00 2001 From: Florian Duderstadt Date: Wed, 20 Mar 2024 15:25:33 +0100 Subject: [PATCH 5/5] remove ResizePanel --- src/workspace/ResizePanel/index.jsx | 176 --------------------- src/workspace/ResizePanel/index.module.css | 104 ------------ src/workspace/SidebarBox/index.jsx | 4 +- 3 files changed, 1 insertion(+), 283 deletions(-) delete mode 100644 src/workspace/ResizePanel/index.jsx delete mode 100644 src/workspace/ResizePanel/index.module.css diff --git a/src/workspace/ResizePanel/index.jsx b/src/workspace/ResizePanel/index.jsx deleted file mode 100644 index 28f7485b..00000000 --- a/src/workspace/ResizePanel/index.jsx +++ /dev/null @@ -1,176 +0,0 @@ -import React from "react"; -import { DraggableCore } from "react-draggable"; -import debounce from "lodash.debounce"; -import $ from "cash-dom"; -import classNames from "classnames/bind"; -import style from "./index.module.css"; -let cx = classNames.bind(style); - -class ResizePanel extends React.Component { - constructor(props) { - super(props); - this.state = { size: 0 }; - - this.contentRef = React.createRef(); - this.wrapperRef = React.createRef(); - this.validateSize = debounce(this.validateSize, 100).bind(this); - } - - isHorizontal = () => - this.props.direction === "w" || this.props.direction === "e"; - - componentDidMount() { - const content = this.contentRef.current; - const actualContent = content.children[0]; - let initialSize = this.isHorizontal() - ? $(actualContent).outerWidth(true) - : $(actualContent).outerHeight(true); - - // Initialize the size value based on the content's current size - this.setState({ size: initialSize }); - this.validateSize(); - } - - validateSize() { - const isHorizontal = this.isHorizontal(); - const content = this.contentRef.current; - const wrapper = this.wrapperRef.current; - if (!content || !wrapper) return; - const actualContent = content.children[0]; - let containerParent = wrapper.parentElement; - - // - // Or if our size doesn't equal the actual content size, then we - // must have pushed past the min size of the content, so resize back - //let minSize = isHorizontal ? $(actualContent).outerWidth(true) : $(actualContent).outerHeight(true); - let minSize = isHorizontal - ? actualContent.scrollWidth - : actualContent.scrollHeight; - - let margins = isHorizontal - ? $(actualContent).outerWidth(true) - $(actualContent).outerWidth() - : $(actualContent).outerHeight(true) - $(actualContent).outerHeight(); - minSize += margins; - - if (this.state.size !== minSize) { - this.setState({ - ...this.state, - size: minSize - }); - } else { - // If our resizing has left the parent container's content overflowing - // then we need to shrink back down to fit - let overflow = isHorizontal - ? containerParent.scrollWidth - containerParent.clientWidth - : containerParent.scrollHeight - containerParent.clientHeight; - - if (overflow) { - this.setState({ - ...this.state, - size: isHorizontal - ? actualContent.clientWidth - overflow - : actualContent.clientHeight - overflow - }); - } - } - } - - handleDrag = (e, ui) => { - const { direction } = this.props; - const factor = direction === "e" || direction === "s" ? -1 : 1; - - // modify the size based on the drag delta - let delta = this.isHorizontal() ? ui.deltaX : ui.deltaY; - this.setState((s, p) => ({ size: Math.max(10, s.size - delta * factor) })); - }; - - handleDragEnd = (e, ui) => { - this.validateSize(); - }; - - render() { - const dragHandlers = { - onDrag: this.handleDrag, - onStop: this.handleDragEnd - }; - const { direction } = this.props; - const isHorizontal = this.isHorizontal(); - - let containerClass = cx({ - ContainerHorizontal: isHorizontal, - ContainerVertical: !isHorizontal - }); - - if (this.props.containerClass) { - containerClass += ` ${this.props.containerClass}`; - } - - let containerStyle = { ...this.props.style } || {}; - if (this.state.size !== 0) { - containerStyle.flexGrow = 0; - containerStyle[isHorizontal ? "width" : "height"] = "auto"; - } - - let handleClasses = - this.props.handleClass || - cx({ - ResizeHandleHorizontal: isHorizontal, - ResizeHandleVertical: !isHorizontal - }); - - let resizeBarClasses = - this.props.borderClass || - cx({ - ResizeBarHorizontal: isHorizontal, - ResizeBarVertical: !isHorizontal - }); - - let contentStyle = isHorizontal - ? { width: this.state.size + "px" } - : { height: this.state.size + "px" }; - let contentClassName = cx("ResizeContent", { - ResizeContentHorizontal: isHorizontal, - ResizeContentVertical: !isHorizontal - }); - - let content = [ -
- {React.Children.only(this.props.children)} -
- ]; - - let handle = ( - -
-
- -
-
-
- ); - - // Insert the handle at the beginning of the content if our directio is west or north - if (direction === "w" || direction === "n") { - content.unshift(handle); - } else { - content.push(handle); - } - - return ( -
- {content} -
- ); - } -} - -export default ResizePanel; \ No newline at end of file diff --git a/src/workspace/ResizePanel/index.module.css b/src/workspace/ResizePanel/index.module.css deleted file mode 100644 index 985242f1..00000000 --- a/src/workspace/ResizePanel/index.module.css +++ /dev/null @@ -1,104 +0,0 @@ -.Container { - display: flex; - align-items: stretch; -} -.ContainerHorizontal { - composes: Container; - flex-flow: row nowrap; -} -.ContainerVertical { - composes: Container; - flex-flow: column nowrap; -} -.ResizeContent { - flex-grow: 1; - align-self: stretch; - display: flex; -} -.ResizeContentVertical { - flex-flow: column; -} -.ResizeContentHorizontal { - flex-flow: row; -} - -.ResizeBarHorizontal { - cursor: ew-resize; - width: 20px; - margin-left: -10px; - margin-right: -10px; - background: transparent; - display: flex; - z-index: 10; - align-items: center ; - align-content: center ; - justify-content: center; - -} - -.ResizeBarVertical { - cursor: ns-resize; - height: 20px; - margin-top: -10px; - margin-bottom: -10px; - background: transparent; - display: flex; - z-index: 10; - align-items: center ; - align-content: center ; - justify-content: center; - -} -.ResizeHandleHorizontal { - cursor: ew-resize; - width: 12px; - height: 50px; - background: white; - border: 2px solid lightgray; - border-radius: 8px; - text-align: center; - z-index: 10; - overflow: hidden; - display: flex; - align-items: center ; - -} - -.ResizeHandleVertical { - cursor: ns-resize; - width:50px; - height: 12px; - border-radius: 8px; - background: white; - border: 2px solid lightgray; - z-index: 10; - overflow: hidden; - display: flex; - justify-content: center; - -} - -.ResizeHandleHorizontal>span, .ResizeHandleVertical>span { - display: inline-block; - overflow: hidden; - font-size: 12px; - font-weight: bold; - font-family: sans-serif; - letter-spacing: 1px; - color: #b3b3b3; - text-shadow: 1px 0 1px rgb(90, 90, 90); -} -.ResizeHandleHorizontal>span { - line-height: 4px; -} -.ResizeHandleVertical>span { - text-align: center; - line-height: 12px; - margin-top: -3px; -} -.ResizeHandleHorizontal>span::after{ - content: '. . . . . . . .'; -} -.ResizeHandleVertical>span::after{ - content: '......'; -} \ No newline at end of file diff --git a/src/workspace/SidebarBox/index.jsx b/src/workspace/SidebarBox/index.jsx index 49f2e95f..6dc14242 100644 --- a/src/workspace/SidebarBox/index.jsx +++ b/src/workspace/SidebarBox/index.jsx @@ -10,7 +10,6 @@ import classnames from "classnames" import useEventCallback from "use-event-callback" import Typography from "@mui/material/Typography" import { useIconDictionary } from "../icon-dictionary.js" -import ResizePanel from "../ResizePanel" import styles from "./styles.js" const theme = createTheme() @@ -89,9 +88,8 @@ export const SidebarBox = ({
- {"passt"} {content}