Compare commits

..

8 Commits

Author SHA1 Message Date
semantic-release-bot
0da85355c2 chore(release): 4.2.0 [CI SKIP] 2024-06-27 04:07:06 +00:00
AAGaming
dcdbb2d6c7 feat(components): add ErrorBoundary 2024-06-27 00:06:32 -04:00
semantic-release-bot
58e3d35e1e chore(release): 4.1.1 [CI SKIP] 2024-06-27 03:19:49 +00:00
Ava Johnson
bd1dc85b92 fix(ReorderableList): avoid mutating props (#109)
Co-authored-by: AAGaming <aagaming@riseup.net>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-26 23:19:18 -04:00
semantic-release-bot
aa78f4c0a2 chore(release): 4.1.0 [CI SKIP] 2024-06-27 03:11:23 +00:00
AAGaming
b04044451a feat(release): release v4.1.0 2024-06-26 23:10:47 -04:00
semantic-release-bot
5d8f141114 chore(release): 4.0.1 [CI SKIP] 2024-06-27 03:10:04 +00:00
AAGaming
2bfe62409f fix(release): empty commit to bump to v4.0.1 2024-06-26 23:09:36 -04:00
6 changed files with 43 additions and 3 deletions

View File

@@ -14,6 +14,7 @@
],
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/github",
[
"@semantic-release/git",

View File

@@ -1,3 +1,31 @@
# [4.2.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v4.1.1...v4.2.0) (2024-06-27)
### Features
* **components:** add ErrorBoundary ([dcdbb2d](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/dcdbb2d6c7c0b72197f04153d7c3e73e9e71ea5c))
## [4.1.1](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v4.1.0...v4.1.1) (2024-06-27)
### Bug Fixes
* **ReorderableList:** avoid mutating props ([#109](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/109)) ([bd1dc85](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/bd1dc85b9202c8ec6ca994177417574fdd71cbd7))
# [4.1.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v4.0.1...v4.1.0) (2024-06-27)
### Features
* **release:** release v4.1.0 ([b040444](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/b04044451a9dc3633fe624e47dd58c7ea206d0a3))
## [4.0.1](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v4.0.0...v4.0.1) (2024-06-27)
### Bug Fixes
* **release:** empty commit to bump to v4.0.1 ([2bfe624](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/2bfe62409f775a69124e0f2e853ae0b1668a9c36))
# [4.0.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.25.0...v4.0.0) (2024-06-27)

View File

@@ -1,6 +1,6 @@
{
"name": "@decky/ui",
"version": "4.0.3",
"version": "4.2.0",
"description": "A library for interacting with the Steam frontend in Decky plugins and elsewhere.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@@ -85,5 +85,9 @@
"style": "module",
"parser": "typescript"
}
},
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"tag": "latest"
}
}

View File

@@ -0,0 +1,6 @@
import { Component, PropsWithChildren } from "react";
import { findModuleExport } from "../webpack";
export const ErrorBoundary = findModuleExport(
(e) => e.InstallErrorReportingStore && e?.prototype?.Reset && e?.prototype?.componentDidCatch,
) as Component<PropsWithChildren>;

View File

@@ -5,6 +5,7 @@ export * from './ControlsList';
export * from './Dialog';
export * from './DialogCheckbox';
export * from './Dropdown';
export * from './ErrorBoundary';
export * from './Field';
export * from './Focusable';
export * from './FocusRing';

View File

@@ -35,12 +35,12 @@ export type ReorderableListProps<T> = {
export function ReorderableList<T>(props: ReorderableListProps<T>) {
if (props.animate === undefined) props.animate = true;
const [entryList, setEntryList] = useState<ReorderableEntry<T>[]>(
props.entries.sort((a: ReorderableEntry<T>, b: ReorderableEntry<T>) => a.position - b.position),
[...props.entries].sort((a: ReorderableEntry<T>, b: ReorderableEntry<T>) => a.position - b.position),
);
const [reorderEnabled, setReorderEnabled] = useState<boolean>(false);
useEffect(() => {
setEntryList(props.entries.sort((a: ReorderableEntry<T>, b: ReorderableEntry<T>) => a.position - b.position));
setEntryList([...props.entries].sort((a: ReorderableEntry<T>, b: ReorderableEntry<T>) => a.position - b.position));
}, [props.entries]);
function toggleReorderEnabled(): void {