Skip to content

Commit 229ac60

Browse files
committed
Fix: initial workspace element positions and updated docs
1 parent 59983e2 commit 229ac60

File tree

6 files changed

+57
-10
lines changed

6 files changed

+57
-10
lines changed

.storybook/preview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const preview: Preview = {
2626
reactRouter: {},
2727
options: {
2828
storySort: {
29-
order: ["Introduction", "Installation", "Customization"],
29+
order: ["Introduction", "Installation", "Customization", "Modifying State", "External Shapes"]
3030
},
3131
}
3232
},

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
Changelog
22

3+
# v3.0.0 [2024-08-27]
4+
5+
## Major Release
6+
7+
### Features
8+
- Complete UI overhaul with a new design system
9+
- Adds support for element rotation
10+
- Adds support for passing external shapes into the toolkit
11+
12+
---
13+
314
# v2.1.1 [2024-08-07]
415

516
## Patch Release

src/store/reducers/editor/seats.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,37 @@ const gap = 50;
66
export default () => [
77
...[...Array(10).keys()].map((p) => ({
88
id: uuidV4(),
9-
x: getWorkspaceCenterX() - gap * (p + 1),
9+
x: getWorkspaceCenterX() - gap * (p + 1.5),
1010
y: getWorkspaceHeight() * 0.48,
1111
label: p + 1
1212
})),
1313
...[...Array(10).keys()].map((p) => ({
1414
id: uuidV4(),
15-
x: getWorkspaceCenterX() + gap * (p + 1),
15+
x: getWorkspaceCenterX() + gap * (p + 0.5),
1616
y: getWorkspaceHeight() * 0.48,
1717
label: p + 1
1818
})),
1919
...[...Array(7).keys()].map((p) => ({
2020
id: uuidV4(),
21-
x: getWorkspaceCenterX() - gap * (p + 1),
21+
x: getWorkspaceCenterX() - gap * (p + 1.5),
2222
y: getWorkspaceHeight() * 0.58,
2323
label: p + 1
2424
})),
2525
...[...Array(7).keys()].map((p) => ({
2626
id: uuidV4(),
27-
x: getWorkspaceCenterX() + gap * (p + 1),
27+
x: getWorkspaceCenterX() + gap * (p + 0.5),
2828
y: getWorkspaceHeight() * 0.58,
2929
label: p + 1
3030
})),
3131
...[...Array(5).keys()].map((p) => ({
3232
id: uuidV4(),
33-
x: getWorkspaceCenterX() - gap * (p + 1),
33+
x: getWorkspaceCenterX() - gap * (p + 1.5),
3434
y: getWorkspaceHeight() * 0.68,
3535
label: p + 1
3636
})),
3737
...[...Array(5).keys()].map((p) => ({
3838
id: uuidV4(),
39-
x: getWorkspaceCenterX() + gap * (p + 1),
39+
x: getWorkspaceCenterX() + gap * (p + 0.5),
4040
y: getWorkspaceHeight() * 0.68,
4141
label: p + 1
4242
}))

src/store/reducers/editor/shapes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { getWorkspaceCenterX, getWorkspaceHeight } from "@/utils";
44
export default () => [
55
{
66
id: uuidV4(),
7-
x: getWorkspaceCenterX() - 550,
7+
x: getWorkspaceCenterX() - 600,
88
y: getWorkspaceHeight() * 0.18,
9-
width: 1100,
9+
width: 1150,
1010
height: 100,
1111
rx: 10,
1212
name: "RectangleHorizontal"

src/store/reducers/editor/text.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { getWorkspaceCenterX, getWorkspaceHeight } from "@/utils";
44
export default () => [
55
{
66
id: uuidV4(),
7-
x: getWorkspaceCenterX() - 58,
7+
x: getWorkspaceCenterX() - 78,
88
y: getWorkspaceHeight() * 0.27,
99
label: "STAGE",
1010
fontSize: 35,

src/stories/external-shapes.mdx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { Meta } from "@storybook/blocks";
2+
3+
<Meta title="External Shapes" />
4+
5+
<h1>External Shapes</h1>
6+
7+
<h4>You can control the shapes available to you within the toolkit by passing in an array of shapes in options as follows:</h4>
8+
9+
```tsx
10+
import { SeatToolkit } from "@mezh-hq/react-seat-toolkit";
11+
import { FireExtinguisher } from "lucide-react";
12+
13+
return <SeatToolkit
14+
mode="designer"
15+
options={{
16+
shapes: {
17+
icons: [
18+
FireExtinguisher
19+
],
20+
overrideDefaultIconset: false
21+
}
22+
}}
23+
/>
24+
```
25+
26+
<h4>Here, we are passing in an array of shapes with a single shape, FireExtinguisher, which will be added to the default shapes available in the toolkit.</h4>
27+
28+
<h4>If you need to completely override the default shapes available in the toolkit, you can set the overrideDefaultIconset property to true. This will remove all default shapes and keep only the shapes you pass </h4>
29+
30+
<br/>
31+
32+
---
33+
34+
<br/>
35+
36+
<h5> NOTE: The shapes you pass in should be React components that render an SVG and must contain a `displayName` property. If the `displayName` property is not present, the toolkit will not be able to render the shape. </h5>

0 commit comments

Comments
 (0)