@owdproject/react 0.0.0-stage → 4.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +67 -2
  3. package/package.json +39 -4
package/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Open Web Desktop Team ~ github.com/owdproject
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
20
+ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,68 @@
1
- # Temporary Holding Version
1
+ <div align="center">
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ <h1>@owdproject/react</h1>
4
+
5
+ <p>
6
+ <strong>Official React 18 & 19 Adapter for Open Web Desktop.</strong><br /><br />
7
+ Concurrent-safe <code>useSyncExternalStore</code> hooks and pointer drag/resize<br />
8
+ bindings powered by <code>@owdproject/core</code>.
9
+ </p>
10
+
11
+ <br />
12
+
13
+ <p>
14
+ <a href="https://npmjs.com/package/@owdproject/react"><img src="https://img.shields.io/npm/v/@owdproject/react/alpha.svg?style=flat&colorA=020420&colorB=00DC82" alt="npm version" /></a>
15
+ <a href="https://react.dev"><img src="https://img.shields.io/badge/React-020420?logo=react" alt="React" /></a>
16
+ <a href="https://github.com/owdproject/core/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-00DC82.svg?style=flat&colorA=020420&colorB=00DC82" alt="License" /></a>
17
+ </p>
18
+
19
+ </div>
20
+
21
+ ---
22
+
23
+ ## Overview
24
+
25
+ `@owdproject/react` (`4.0.0-alpha.0`) connects [`@owdproject/core`](https://npmjs.com/package/@owdproject/core)'s frozen immutable snapshots (`Object.freeze`) directly to React 18/19 `useSyncExternalStore` with zero state tearing.
26
+
27
+ ---
28
+
29
+ ## Quick Start
30
+
31
+ ```bash
32
+ pnpm add @owdproject/core@4.0.0-alpha.0 @owdproject/react@4.0.0-alpha.0
33
+ ```
34
+
35
+ ```tsx
36
+ import { createDesktop, useDesktop, useWindowInstance, useDesktopDrag } from '@owdproject/react'
37
+
38
+ const desktop = createDesktop()
39
+
40
+ export function DesktopShell() {
41
+ const { windows, focusedWindow } = useDesktop(desktop)
42
+ return (
43
+ <div>
44
+ {windows.map((win) => (
45
+ <div key={win.id}>{win.config.title}</div>
46
+ ))}
47
+ </div>
48
+ )
49
+ }
50
+ ```
51
+
52
+ ---
53
+
54
+ ## Exported Hooks
55
+
56
+ | Hook | Description |
57
+ | :--- | :--- |
58
+ | **`useDesktop(instanceOrOptions?)`** | Subscribes to a `Desktop` instance via `useSyncExternalStore`. |
59
+ | **`useWindowManager(manager?)`** | Subscribes to `WindowManager` window lists and focus state. |
60
+ | **`useWindowInstance(instance)`** | Subscribes to an individual `WindowInstance` actor. |
61
+ | **`useDesktopDrag(options)`** | Returns `{ isDragging, activeSnapZone, startDrag, cancelDrag }`. |
62
+ | **`useDesktopResize(options)`** | Returns `{ isResizing, startResize, cancelResize }`. |
63
+
64
+ ---
65
+
66
+ ## License
67
+
68
+ [MIT](https://opensource.org/licenses/MIT)
package/package.json CHANGED
@@ -1,6 +1,41 @@
1
1
  {
2
2
  "name": "@owdproject/react",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "4.0.0-alpha.3",
4
+ "description": "Official React 18/19 adapter for @owdproject/react",
5
+ "homepage": "https://github.com/owdproject/react#readme",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/owdproject/react.git"
9
+ },
10
+ "author": {
11
+ "name": "Diego Villa (@dxlliv)",
12
+ "url": "https://github.com/dxlliv"
13
+ },
14
+ "license": "MIT",
15
+ "type": "module",
16
+ "main": "./dist/index.mjs",
17
+ "module": "./dist/index.mjs",
18
+ "types": "./dist/index.d.ts",
19
+ "files": [
20
+ "dist",
21
+ "README.md"
22
+ ],
23
+ "publishConfig": {
24
+ "access": "public",
25
+ "tag": "alpha",
26
+ "registry": "https://registry.npmjs.org/"
27
+ },
28
+ "exports": {
29
+ ".": {
30
+ "types": "./dist/index.d.ts",
31
+ "import": "./dist/index.mjs",
32
+ "default": "./dist/index.mjs"
33
+ }
34
+ },
35
+ "dependencies": {
36
+ "@owdproject/react": "^4.0.0-alpha.3"
37
+ },
38
+ "peerDependencies": {
39
+ "react": ">=18.0.0"
40
+ }
41
+ }