Skip to content

Commit ec16693

Browse files
committed
Revert "Fix: exported store"
This reverts commit ad4b073.
1 parent ad4b073 commit ec16693

File tree

15 files changed

+25
-28
lines changed

15 files changed

+25
-28
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"scripts": {
2626
"build": "bun run ./esbuild.config.js",
2727
"build:css": "bunx tailwindcss -i src/styles/index.css -o ./dist/index.css --minify && cp -r src/styles dist/styles && rm dist/styles/storybook.css",
28-
"build:types": "bunx tsc --project ./tsconfig.declaration.json && tsc-alias --project ./tsconfig.declaration.json && cd dist && ls -d */ | grep -Ev 'actions|constants|store|types' | xargs rm -rf && cp ./index.d.ts ./index.slim.d.ts",
28+
"build:types": "bunx tsc --project ./tsconfig.declaration.json && tsc-alias --project ./tsconfig.declaration.json && cd dist && ls -d */ | grep -Ev 'actions|types' | xargs rm -rf && cp ./index.d.ts ./index.slim.d.ts",
2929
"bump-version": "bunx --bun automatic-versioning --disable-auto-sync --recursive $(if [ \"$TAG\" != \"latest\" ]; then echo --prerelease; fi) --prerelease-branch=development --prerelease-tag=$TAG --name=@mezh-hq/react-seat-toolkit --ignore-prefixes=ci",
3030
"format": "bunx prettier --write --cache \"**/*.{js,jsx,ts,tsx,md,css,yml}\"",
3131
"lint": "bun run --bun eslint . --ext js,jsx,ts,tsx --ignore-path .gitignore --fix --cache --report-unused-disable-directives",

src/components/controls/image.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { memo, useCallback, useState } from "react";
22
import { Image } from "lucide-react";
33
import { v4 as uuidV4 } from "uuid";
4-
import { Tool } from "@/constants";
54
import { store } from "@/store";
65
import { addImage, hideControls } from "@/store/reducers/editor";
76
import { selectTool } from "@/store/reducers/toolbar";
87
import { ISTKProps } from "@/types";
98
import { getImageDimensions, getWorkspaceCenterX, getWorkspaceCenterY, toBase64 } from "@/utils";
109
import { Button } from "../core";
10+
import { Tool } from "../toolbar/data";
1111

1212
const onUploadClick = () => document.getElementById("image-input").click();
1313

src/components/controls/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { X } from "lucide-react";
33
import { useSelector } from "react-redux";
44
import { twMerge } from "tailwind-merge";
55
import { dataAttributes, ids } from "@/constants";
6-
import { Tool } from "@/constants";
76
import { store } from "@/store";
87
import { toggleControls } from "@/store/reducers/editor";
98
import { ISTKProps } from "@/types";
109
import { AnimatedSwitcher, IconButton } from "../core";
10+
import { Tool } from "../toolbar/data";
1111
import { default as ImageControls } from "./image";
1212
import { default as NoControls } from "./no-controls";
1313
import { default as NoSelectedElement } from "./no-selection";

src/components/toolbar/data.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
import { CaseSensitive, Circle, Image, MousePointer2, Move, PenTool, Pentagon, Sparkles, Square } from "lucide-react";
22
import { twMerge } from "tailwind-merge";
3-
import { Tool } from "@/constants";
3+
4+
export enum Tool {
5+
Select = "Select",
6+
Eraser = "Eraser",
7+
Seat = "Seat",
8+
Pen = "Pen",
9+
Text = "Text",
10+
Shape = "Shapes",
11+
Image = "Image",
12+
Pan = "Pan"
13+
}
414

515
export const tools = {
616
[Tool.Select]: {

src/components/toolbar/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ import {
1212
TooltipTrigger
1313
} from "@/components";
1414
import { default as DockHandler } from "@/components/workspace/dock/handler";
15-
import { Tool, dataAttributes, ids } from "@/constants";
15+
import { dataAttributes, ids } from "@/constants";
1616
import { store } from "@/store";
1717
import { clearCursor, setCursor, setSelectedPolylineId, showControls } from "@/store/reducers/editor";
1818
import { clearTool, selectSubTool, selectTool } from "@/store/reducers/toolbar";
1919
import { ISTKProps } from "@/types";
2020
import { fallible } from "@/utils";
2121
import { selectFirstShape } from "../controls/shapes";
22-
import { tools } from "./data";
22+
import { Tool, tools } from "./data";
2323

2424
const ToolBar: React.FC<ISTKProps> = (props) => {
2525
const selectedTool = useSelector((state: any) => state.toolbar.selectedTool);

src/components/workspace/dock/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import { useSelector } from "react-redux";
44
import { default as debounce } from "lodash/debounce";
55
import { twMerge } from "tailwind-merge";
66
import { dataAttributes, ids, selectors } from "@/constants";
7-
import { Tool } from "@/constants";
87
import type { ISTKProps } from "@/types";
98
import { d3Extended, getScaleFactorAccountingForViewBoxWidth } from "@/utils";
109
import { Button } from "../../core";
10+
import { Tool } from "../../toolbar/data";
1111
import { showPostOffsetElements, showPreOffsetElements } from "../elements";
1212
import { default as Reload } from "../reload";
1313
import { default as DockHandler } from "./handler";

src/components/workspace/elements/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import { select } from "d3";
33
import { default as isEqual } from "lodash/isEqual";
44
import { twMerge } from "tailwind-merge";
55
import { dataAttributes } from "@/constants";
6-
import { Tool } from "@/constants";
76
import { store } from "@/store";
87
import { clearAndSelectElements, deselectElement, selectElement } from "@/store/reducers/editor";
98
import { ISTKProps, SeatStatus } from "@/types";
9+
import { Tool } from "../../toolbar/data";
1010
import {
1111
ElementType,
1212
elements,

src/components/workspace/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { useCallback } from "react";
22
import { useSelector } from "react-redux";
33
import { twMerge } from "tailwind-merge";
4-
import { Tool, dataAttributes, ids } from "@/constants";
4+
import { dataAttributes, ids } from "@/constants";
55
import { type ISTKProps, SeatStatus } from "@/types";
6-
import { tools } from "../toolbar/data";
6+
import { Tool, tools } from "../toolbar/data";
77
import { default as Crosshairs } from "./crosshairs";
88
import { default as Dock } from "./dock";
99
import { default as Element, ElementType } from "./elements";

src/constants/index.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,3 @@ export const seatStatusColors = {
5656
label: "#ffffff"
5757
}
5858
};
59-
60-
export enum Tool {
61-
Select = "Select",
62-
Eraser = "Eraser",
63-
Seat = "Seat",
64-
Pen = "Pen",
65-
Text = "Text",
66-
Shape = "Shapes",
67-
Image = "Image",
68-
Pan = "Pan"
69-
}

src/hooks/events/deselection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useEffect } from "react";
22
import { useSelector } from "react-redux";
3+
import { Tool } from "@/components/toolbar/data";
34
import { ElementType } from "@/components/workspace/elements";
4-
import { Tool } from "@/constants";
55
import { dataAttributes, ids } from "@/constants";
66
import { store } from "@/store";
77
import { clearElements } from "@/store/reducers/editor";

src/hooks/events/selection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useEffect, useLayoutEffect } from "react";
22
import { useSelector } from "react-redux";
3+
import { Tool } from "@/components/toolbar/data";
34
import { ElementType } from "@/components/workspace/elements";
4-
import { Tool } from "@/constants";
55
import { dataAttributes, ids, selectors } from "@/constants";
66
import { default as store } from "@/store";
77
import { clearAndSelectElements } from "@/store/reducers/editor";

src/hooks/events/workspace-click.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { useLayoutEffect } from "react";
22
import { RectangleHorizontal } from "lucide-react";
33
import { useSelector } from "react-redux";
44
import { v4 as uuidV4 } from "uuid";
5+
import { Tool } from "@/components/toolbar/data";
56
import { ElementType } from "@/components/workspace/elements";
67
import { resizableRectangle, shapeSize } from "@/components/workspace/elements/shape";
7-
import { Tool } from "@/constants";
88
import { dataAttributes, ids } from "@/constants";
99
import { store } from "@/store";
1010
import {

src/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import { type ISTKProps } from "./types";
66

77
export { actions } from "@/actions";
88

9-
export { store } from "@/store";
10-
119
export { SeatStatus } from "@/types/elements";
1210

1311
export const SeatToolkit = (props: ISTKProps) => {

src/store/reducers/toolbar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Reducer, createSlice } from "@reduxjs/toolkit";
2-
import { Tool } from "@/constants";
2+
import { Tool } from "@/components/toolbar/data";
33

44
const initialState = {
55
selectedTool: Tool.Select,

src/stories/customization.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ return <SeatToolkit
1616
styles={{
1717
root: {
1818
className: "bg-gray-100",
19-
properties: {
19+
style: {
2020
padding: "20px",
2121
borderRadius: "10px",
2222
boxShadow: "0 0 10px rgba(0, 0, 0, 0.1)"

0 commit comments

Comments
 (0)