Skip to content

Commit ad4b073

Browse files
committed
Fix: exported store
1 parent dcd04c9 commit ad4b073

File tree

15 files changed

+28
-25
lines changed

15 files changed

+28
-25
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|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|constants|store|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";
45
import { store } from "@/store";
56
import { addImage, hideControls } from "@/store/reducers/editor";
67
import { selectTool } from "@/store/reducers/toolbar";
78
import { ISTKProps } from "@/types";
89
import { getImageDimensions, getWorkspaceCenterX, getWorkspaceCenterY, toBase64 } from "@/utils";
910
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";
67
import { store } from "@/store";
78
import { toggleControls } from "@/store/reducers/editor";
89
import { ISTKProps } from "@/types";
910
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: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
import { CaseSensitive, Circle, Image, MousePointer2, Move, PenTool, Pentagon, Sparkles, Square } from "lucide-react";
22
import { twMerge } from "tailwind-merge";
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-
}
3+
import { Tool } from "@/constants";
144

155
export const tools = {
166
[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 { dataAttributes, ids } from "@/constants";
15+
import { Tool, 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 { Tool, tools } from "./data";
22+
import { 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";
78
import type { ISTKProps } from "@/types";
89
import { d3Extended, getScaleFactorAccountingForViewBoxWidth } from "@/utils";
910
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";
67
import { store } from "@/store";
78
import { clearAndSelectElements, deselectElement, selectElement } from "@/store/reducers/editor";
89
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 { dataAttributes, ids } from "@/constants";
4+
import { Tool, dataAttributes, ids } from "@/constants";
55
import { type ISTKProps, SeatStatus } from "@/types";
6-
import { Tool, tools } from "../toolbar/data";
6+
import { 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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,14 @@ 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";
43
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";

0 commit comments

Comments
 (0)