Skip to content

Commit

Permalink
chore: convert package names
Browse files Browse the repository at this point in the history
  • Loading branch information
PhearZero committed Jun 28, 2024
1 parent a98c1ac commit fe0e8e4
Show file tree
Hide file tree
Showing 27 changed files with 38 additions and 44 deletions.
14 changes: 3 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/nft-bitmap-kit/src/Position.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type Position = { x: number; y: number };
2 changes: 1 addition & 1 deletion packages/nft-bitmap-kit/src/colors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Position } from "nft-bitmap-react/lib/components/Position";
import type { Position } from "./Position.ts";

export type Color = {
key?: string;
Expand Down
1 change: 1 addition & 0 deletions packages/nft-bitmap-kit/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from "./client.js";
export * from "./colors.js";
export * from "./Position.js";
export * from "./transactions.js";
2 changes: 1 addition & 1 deletion packages/nft-bitmap-kit/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["./src/**.algo.ts", "./lib/**/*", "./scripts/**/*", "./src/**.spec.ts"]
"exclude": ["./src/**.algo.ts", "./lib/**/*", "./scripts/**/*", "./src/**.spec.ts", "vitest.config.ts"]
}
4 changes: 2 additions & 2 deletions packages/nft-bitmap-react/lib/components/Bitmap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import type {
CSSProperties,
MouseEvent as ReactMouseEvent
} from "react";
import {type Color, getRandomBitmap} from "nft-bitmap-kit/colors";
import {type Position} from "./Position";
import {type Color, getRandomBitmap} from "@nft-bitmap/kit/colors";
import {type Position} from "@nft-bitmap/kit";
import {Cell} from './Cell.tsx'
import {NoOp} from "../controllers/NoOp.ts";

Expand Down
2 changes: 1 addition & 1 deletion packages/nft-bitmap-react/lib/components/BitmapViewer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {getRandomBitmap} from "nft-bitmap-kit/colors";
import {getRandomBitmap} from "@nft-bitmap/kit/colors";
import {Bitmap, BitmapProps} from "./Bitmap.tsx";
import {useCellSize} from "../hooks/useCellSize.ts";

Expand Down
4 changes: 2 additions & 2 deletions packages/nft-bitmap-react/lib/components/Cell.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {Color} from "nft-bitmap-kit/colors";
import {Position} from "./Position";
import type {Color} from "@nft-bitmap/kit/colors";
import {Position} from "@nft-bitmap/kit";
import {CSSProperties, HTMLAttributes} from "react";

type CellProps = HTMLAttributes<HTMLButtonElement> & {
Expand Down
4 changes: 2 additions & 2 deletions packages/nft-bitmap-react/lib/components/Details.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {Color} from "nft-bitmap-kit/colors";
import {Position} from "./Position";
import type {Color} from "@nft-bitmap/kit/colors";
import {Position} from "@nft-bitmap/kit";

export type DetailsProps = {
color: Color,
Expand Down
1 change: 0 additions & 1 deletion packages/nft-bitmap-react/lib/components/Position.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/nft-bitmap-react/lib/components/Toolbox.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {CSSProperties, PropsWithChildren, useMemo, useState} from "react";
import {getColorPaletteBitmap, type Color} from "nft-bitmap-kit/colors";
import {getColorPaletteBitmap, type Color} from "@nft-bitmap/kit/colors";
import {UploadIconButton, UploadImageControl} from "./controls/Upload.tsx";
import {SettingsControl, SettingsIconButton} from "./controls/Settings.tsx";
import {SaveControl, SaveIconButton} from "./controls/Save.tsx";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {WalletManager} from "@txnlab/use-wallet-react";
import {Color} from "nft-bitmap-kit/colors";
import {Color} from "@nft-bitmap/kit/colors";

export type ControlProps = {
onClose: () => void
Expand Down
4 changes: 2 additions & 2 deletions packages/nft-bitmap-react/lib/components/controls/Deploy.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {ToolIconButton, IconButtonProps} from "../ToolIconButton.tsx";
import {Color} from "nft-bitmap-kit/colors";
import {Color} from "@nft-bitmap/kit/colors";
import {AtomicTransactionComposer} from "algosdk";
import {NftBitmapClient} from "nft-bitmap-kit";
import {NftBitmapClient} from "@nft-bitmap/kit/client";
import type {TransactionSignerAccount} from "@algorandfoundation/algokit-utils/types/account";
import {Transaction} from "algosdk";
import {ControlProps} from "./ControlProps.ts";
Expand Down
2 changes: 1 addition & 1 deletion packages/nft-bitmap-react/lib/components/controls/Open.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {useGalleryStore} from "@/stores.ts";
import {Color} from "nft-bitmap-kit/colors";
import {Color} from "@nft-bitmap/kit/colors";
import {ToolIconButton, IconButtonProps} from "../ToolIconButton.tsx";
import {ToolName} from "../Toolbox.tsx";
import {ControlProps} from "./ControlProps.ts";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {useEffect, useState} from "react";
import {Color, COLORS, getRandomBitmap} from "nft-bitmap-kit/colors";
import {Color, COLORS, getRandomBitmap} from "@nft-bitmap/kit/colors";
import {Pixelizer, RgbColor} from '@/controllers/Pixelizer.ts'
import {useEditorImage} from "@/stores.ts";
import {ToolIconButton, IconButtonProps} from "../ToolIconButton.tsx";
Expand Down
1 change: 0 additions & 1 deletion packages/nft-bitmap-react/lib/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ export * from './Bitmap.tsx'
export * from './BitmapViewer.tsx'
export * from './Cell.tsx'
export * from './Details.tsx'
export * from './Position.ts'
export * from './Toolbox.tsx'
export * from './ToolIconButton.tsx'
2 changes: 1 addition & 1 deletion packages/nft-bitmap-react/lib/controllers/Pixelizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @author José Moreira @ <https://github.com/giventofly/pixelit>
* @author Michael Feher @ <https://github.com/PhearZero>
**/
import {Color, getRandomBitmap} from "nft-bitmap-kit/colors";
import {Color, getRandomBitmap} from "@nft-bitmap/kit/colors";

export const DRAWFROM_NOT_DEFINED_MESSAGE = "drawfrom is not defined";
export const DRAWTO_NOT_DEFINED_MESSAGE = "drawto is not defined";
Expand Down
2 changes: 1 addition & 1 deletion packages/nft-bitmap-react/lib/hooks/useLiveImage.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {useQuery} from "@tanstack/react-query";
import {Algodv2, decodeUint64} from "algosdk";
import {Color, COLORS} from "nft-bitmap-kit/colors";
import {Color, COLORS} from "@nft-bitmap/kit/colors";
import {toByteArray} from "base64-js";

type KeyPair = { key: string, value: { bytes: string } }
Expand Down
2 changes: 1 addition & 1 deletion packages/nft-bitmap-react/lib/hooks/useNFTClient.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {useMemo} from "react";

import {NftBitmapClient} from "nft-bitmap-kit";
import {NftBitmapClient} from "@nft-bitmap/kit/client";

import type {TransactionSignerAccount} from "@algorandfoundation/algokit-utils/types/account";
import type {WalletManager} from "@txnlab/use-wallet-react";
Expand Down
4 changes: 2 additions & 2 deletions packages/nft-bitmap-react/lib/stores.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {create} from 'zustand'
import {persist} from 'zustand/middleware'
import {getRandomBitmap, getSingleColorBitmap, type Color} from "nft-bitmap-kit/colors";
import type {Position} from "@/components/Position";
import {getRandomBitmap, getSingleColorBitmap, type Color} from "@nft-bitmap/kit/colors";
import type {Position} from "@nft-bitmap/kit";

export interface ImageState {
image: Color[][]
Expand Down
2 changes: 1 addition & 1 deletion packages/nft-bitmap-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
},
"peerDependencies": {
"@algorandfoundation/algokit-utils": "^6.0.5",
"@nft-bitmap/kit": "^0.0.1",
"@tanstack/react-query": "^5.45.1",
"@txnlab/use-wallet-react": "^3.0.0-rc.2",
"algosdk": "2.7.0",
"nft-bitmap-kit": "^0.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"zustand": "^4.5.2"
Expand Down
3 changes: 2 additions & 1 deletion packages/nft-bitmap-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
"dependencies": {
"@agoralabs-sh/avm-web-provider": "^1.6.2",
"@blockshake/defly-connect": "^1.1.6",
"@nft-bitmap/kit": "^0.0.1",
"@nft-bitmap/ui": "^0.0.0",
"@perawallet/connect": "^1.3.4",
"@tanstack/react-query": "^5.48.0",
"@tanstack/react-query-devtools": "^5.48.0",
"@txnlab/use-wallet-react": "^3.0.0-rc.2",
"@walletconnect/socket-transport": "github:awesome-algorand/walletconnect-socket-transport",
"lute-connect": "^1.2.0",
"nft-bitmap-react": "^0.0.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.24.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/nft-bitmap-ui/src/hooks/useColorParam.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {useCallback, useMemo} from "react";
import {Color, COLORS} from "nft-bitmap-kit/colors";
import {Color, COLORS} from "@nft-bitmap/kit/colors";
import {useSearchParams} from "react-router-dom";

export function useColorParam(){
Expand Down
2 changes: 1 addition & 1 deletion packages/nft-bitmap-ui/src/hooks/useToolParam.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {useCallback, useMemo} from "react";
import {ToolName} from "nft-bitmap-react/components";
import {ToolName} from "@nft-bitmap/react/components";
import {useSearchParams} from "react-router-dom";

export function useToolParam() {
Expand Down
2 changes: 1 addition & 1 deletion packages/nft-bitmap-ui/src/layout/Providers.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {NetworkId, SupportedWallet, WalletId, WalletManager, WalletProvider} from "@txnlab/use-wallet-react";
import {createContext, PropsWithChildren, useContext, useMemo, useState} from "react";
import type {AlgodSettings} from "nft-bitmap-react/components";
import type {AlgodSettings} from "@nft-bitmap/react/components";
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
const queryClient = new QueryClient()

Expand Down
4 changes: 2 additions & 2 deletions packages/nft-bitmap-ui/src/layout/TetrisBackground.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {useMemo} from "react";
import {COLORS} from "nft-bitmap-kit/colors";
import {COLORS} from "@nft-bitmap/kit/colors";

import {Cell} from "nft-bitmap-react/components";
import {Cell} from "@nft-bitmap/react/components";
import styles from './TetrisBackground.module.css'

/**
Expand Down
9 changes: 5 additions & 4 deletions packages/nft-bitmap-ui/src/pages/App.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {useEffect, useMemo, useState, MouseEvent as ReactMouseEvent} from "react";
import {Color, COLORS, fillColor} from "nft-bitmap-kit/colors";
import {type Position, Toolbox, Details, BitmapViewer} from "nft-bitmap-react/components";
import {useNFTClient, useLiveImage, useTransactionSelector} from "nft-bitmap-react/hooks"
import {useEditorImage} from "nft-bitmap-react/stores";
import {Color, COLORS, fillColor} from "@nft-bitmap/kit/colors";
import {Position} from "@nft-bitmap/kit";
import {Toolbox, Details, BitmapViewer} from "@nft-bitmap/react/components";
import {useNFTClient, useLiveImage, useTransactionSelector} from "@nft-bitmap/react/hooks"
import {useEditorImage} from "@nft-bitmap/react/stores";
import {useMove} from "react-aria";
import {useWallet, WalletManager} from "@txnlab/use-wallet-react";
import {useNavigate, useParams} from "react-router-dom";
Expand Down

0 comments on commit fe0e8e4

Please sign in to comment.