-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: image component, richtext support for textcomponents, quality u…
…pdates
- Loading branch information
Showing
22 changed files
with
176 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,29 @@ | ||
{ | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"jsx": true, | ||
"useJSXTextNode": true, | ||
"ecmaVersion": 2018, | ||
"sourceType": "module", | ||
"project": "./tsconfig.json" | ||
}, | ||
"ignorePatterns": ["/out"], | ||
"plugins": ["@typescript-eslint", "roblox-ts", "unused-imports", "simple-import-sort"], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:roblox-ts/recommended" | ||
], | ||
"rules": { | ||
"unused-imports/no-unused-imports": "warn", | ||
"simple-import-sort/imports": "warn", | ||
"simple-import-sort/exports": "warn" | ||
} | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"jsx": true, | ||
"useJSXTextNode": true, | ||
"ecmaVersion": 2018, | ||
"sourceType": "module", | ||
"project": "./tsconfig.json" | ||
}, | ||
"ignorePatterns": [ | ||
"/out" | ||
], | ||
"plugins": [ | ||
"@typescript-eslint", | ||
"roblox-ts", | ||
"unused-imports", | ||
"simple-import-sort" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:roblox-ts/recommended" | ||
], | ||
"rules": { | ||
"unused-imports/no-unused-imports": "warn", | ||
"simple-import-sort/imports": "warn", | ||
"simple-import-sort/exports": "warn" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { BaseComponent } from "../helpers"; | ||
import { ColorOrHex, resolveColor3 } from "../utils"; | ||
import { mapBinding } from "@rbxts/pretty-react-hooks"; | ||
|
||
export interface ImageRect { | ||
offset: Vector2; | ||
size: Vector2; | ||
} | ||
|
||
export interface ImageProps { | ||
image?: string, | ||
imageColor?: ColorOrHex, | ||
imageTransparency?: number, | ||
imageRect?: ImageRect | ||
} | ||
|
||
export const ImageComponent = BaseComponent | ||
.expand<ImageLabel, ImageProps>((props) => ({ | ||
Image: props.image, | ||
ImageColor3: resolveColor3(props.imageColor), | ||
ImageTransparency: props.imageTransparency, | ||
|
||
ImageRectOffset: mapBinding(props.imageRect, (rect) => rect?.offset ?? new Vector2()), | ||
ImageRectSize: mapBinding(props.imageRect, (rect) => rect?.size ?? new Vector2()), | ||
})); | ||
|
||
export const Image = ImageComponent.build("imagelabel"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
{ | ||
"name": "rbxts-react-example", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "rbxtsc", | ||
"watch": "rbxtsc -w", | ||
"devInstall": "pnpm un @rbxts/better-react-components && pnpm add ../package.tgz" | ||
}, | ||
"devDependencies": { | ||
"@rbxts/compiler-types": "2.2.0-types.0", | ||
"@rbxts/types": "^1.0.763", | ||
"roblox-ts": "2.3.0-dev-a25975b", | ||
"typescript": "^5.4.2" | ||
}, | ||
"dependencies": { | ||
"@rbxts/better-react-components": "file:../package.tgz", | ||
"@rbxts/catppuccin": "^1.0.2", | ||
"@rbxts/pretty-react-hooks": "^0.4.2", | ||
"@rbxts/react": "^0.1.1", | ||
"@rbxts/react-roblox": "^0.3.4", | ||
"@rbxts/services": "^1.5.4" | ||
} | ||
"name": "rbxts-react-example", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "rbxtsc", | ||
"watch": "rbxtsc -w", | ||
"devInstall": "pnpm un @rbxts/better-react-components && pnpm add ../package.tgz" | ||
}, | ||
"devDependencies": { | ||
"@rbxts/compiler-types": "2.2.0-types.0", | ||
"@rbxts/types": "^1.0.763", | ||
"roblox-ts": "2.3.0-dev-a25975b", | ||
"typescript": "^5.4.2" | ||
}, | ||
"dependencies": { | ||
"@rbxts/better-react-components": "file:../package.tgz", | ||
"@rbxts/catppuccin": "^1.0.2", | ||
"@rbxts/pretty-react-hooks": "^0.4.2", | ||
"@rbxts/react": "^0.1.1", | ||
"@rbxts/react-roblox": "^0.3.4", | ||
"@rbxts/services": "^1.5.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.