@affectively/aeon-pages-react 0.2.0 → 0.3.0
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.
- package/dist/components/OfflineDiagnostics.d.ts +1 -1
- package/dist/components/PresenceKit.d.ts +84 -0
- package/dist/hooks/useAeonNavigation.d.ts +1 -2
- package/dist/hooks/usePilotNavigation.d.ts +1 -1
- package/dist/hooks.d.ts +31 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +2020 -13005
- package/dist/provider.d.ts +70 -4
- package/package.json +5 -4
package/dist/provider.d.ts
CHANGED
|
@@ -3,11 +3,55 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Provides:
|
|
5
5
|
* - Real-time sync via Aeon SyncCoordinator
|
|
6
|
-
* - Presence tracking via
|
|
6
|
+
* - Presence tracking via WebSocket channel
|
|
7
7
|
* - Offline support via OfflineOperationQueue
|
|
8
8
|
* - Schema versioning via SchemaVersionManager
|
|
9
9
|
*/
|
|
10
10
|
import { type ReactNode } from 'react';
|
|
11
|
+
export interface PresenceSelection {
|
|
12
|
+
start: number;
|
|
13
|
+
end: number;
|
|
14
|
+
direction?: 'forward' | 'backward' | 'none';
|
|
15
|
+
path?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface PresenceTyping {
|
|
18
|
+
isTyping: boolean;
|
|
19
|
+
field?: string;
|
|
20
|
+
isComposing?: boolean;
|
|
21
|
+
startedAt?: string;
|
|
22
|
+
stoppedAt?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface PresenceScroll {
|
|
25
|
+
depth: number;
|
|
26
|
+
y?: number;
|
|
27
|
+
viewportHeight?: number;
|
|
28
|
+
documentHeight?: number;
|
|
29
|
+
path?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface PresenceViewport {
|
|
32
|
+
width: number;
|
|
33
|
+
height: number;
|
|
34
|
+
}
|
|
35
|
+
export interface PresenceInputState {
|
|
36
|
+
field: string;
|
|
37
|
+
hasFocus: boolean;
|
|
38
|
+
valueLength?: number;
|
|
39
|
+
selectionStart?: number;
|
|
40
|
+
selectionEnd?: number;
|
|
41
|
+
isComposing?: boolean;
|
|
42
|
+
inputMode?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface PresenceEmotion {
|
|
45
|
+
primary?: string;
|
|
46
|
+
secondary?: string;
|
|
47
|
+
confidence?: number;
|
|
48
|
+
intensity?: number;
|
|
49
|
+
valence?: number;
|
|
50
|
+
arousal?: number;
|
|
51
|
+
dominance?: number;
|
|
52
|
+
source?: 'self-report' | 'inferred' | 'sensor' | 'hybrid';
|
|
53
|
+
updatedAt?: string;
|
|
54
|
+
}
|
|
11
55
|
export interface PresenceUser {
|
|
12
56
|
userId: string;
|
|
13
57
|
role: 'user' | 'assistant' | 'monitor' | 'admin';
|
|
@@ -15,6 +59,13 @@ export interface PresenceUser {
|
|
|
15
59
|
x: number;
|
|
16
60
|
y: number;
|
|
17
61
|
};
|
|
62
|
+
focusNode?: string;
|
|
63
|
+
selection?: PresenceSelection;
|
|
64
|
+
typing?: PresenceTyping;
|
|
65
|
+
scroll?: PresenceScroll;
|
|
66
|
+
viewport?: PresenceViewport;
|
|
67
|
+
inputState?: PresenceInputState;
|
|
68
|
+
emotion?: PresenceEmotion;
|
|
18
69
|
editing?: string;
|
|
19
70
|
status: 'online' | 'away' | 'offline';
|
|
20
71
|
lastActivity: string;
|
|
@@ -38,10 +89,18 @@ export interface AeonPageContextValue {
|
|
|
38
89
|
updateCursor: (position: {
|
|
39
90
|
x: number;
|
|
40
91
|
y: number;
|
|
41
|
-
}) => void;
|
|
92
|
+
}, path?: string) => void;
|
|
42
93
|
updateEditing: (elementPath: string | null) => void;
|
|
94
|
+
updateFocusNode: (nodePath: string) => void;
|
|
95
|
+
updateSelection: (selection: PresenceSelection) => void;
|
|
96
|
+
updateTyping: (isTyping: boolean, field?: string, isComposing?: boolean) => void;
|
|
97
|
+
updateScroll: (scroll: PresenceScroll) => void;
|
|
98
|
+
updateViewport: (viewport: PresenceViewport) => void;
|
|
99
|
+
updateInputState: (inputState: PresenceInputState) => void;
|
|
100
|
+
updateEmotionState: (emotion: PresenceEmotion) => void;
|
|
43
101
|
sync: SyncState;
|
|
44
102
|
forcSync: () => Promise<void>;
|
|
103
|
+
forceSync: () => Promise<void>;
|
|
45
104
|
version: VersionInfo;
|
|
46
105
|
migrate: (toVersion: string) => Promise<void>;
|
|
47
106
|
data: Record<string, unknown>;
|
|
@@ -57,7 +116,7 @@ export interface AeonPageProviderProps {
|
|
|
57
116
|
/**
|
|
58
117
|
* AeonPageProvider - Wraps a page with Aeon collaborative features
|
|
59
118
|
*/
|
|
60
|
-
export declare function AeonPageProvider({ route, children, initialData }: AeonPageProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
119
|
+
export declare function AeonPageProvider({ route, children, initialData, }: AeonPageProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
61
120
|
/**
|
|
62
121
|
* useAeonPage - Access Aeon page context
|
|
63
122
|
*/
|
|
@@ -71,8 +130,15 @@ export declare function usePresence(): {
|
|
|
71
130
|
updateCursor: (position: {
|
|
72
131
|
x: number;
|
|
73
132
|
y: number;
|
|
74
|
-
}) => void;
|
|
133
|
+
}, path?: string) => void;
|
|
75
134
|
updateEditing: (elementPath: string | null) => void;
|
|
135
|
+
updateFocusNode: (nodePath: string) => void;
|
|
136
|
+
updateSelection: (selection: PresenceSelection) => void;
|
|
137
|
+
updateTyping: (isTyping: boolean, field?: string, isComposing?: boolean) => void;
|
|
138
|
+
updateScroll: (scroll: PresenceScroll) => void;
|
|
139
|
+
updateViewport: (viewport: PresenceViewport) => void;
|
|
140
|
+
updateInputState: (inputState: PresenceInputState) => void;
|
|
141
|
+
updateEmotionState: (emotion: PresenceEmotion) => void;
|
|
76
142
|
};
|
|
77
143
|
/**
|
|
78
144
|
* useAeonSync - Just the sync state
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@affectively/aeon-pages-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "React bindings for @affectively/aeon-pages",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
6
7
|
"main": "./dist/index.js",
|
|
7
8
|
"types": "./dist/index.d.ts",
|
|
8
9
|
"exports": {
|
|
@@ -12,17 +13,17 @@
|
|
|
12
13
|
}
|
|
13
14
|
},
|
|
14
15
|
"scripts": {
|
|
15
|
-
"build": "bun build ./src/index.ts --
|
|
16
|
+
"build": "bun build ./src/index.ts --outfile ./dist/index.js --format esm --target browser --external react --external @affectively/aeon-pages-runtime && tsc --declaration --emitDeclarationOnly",
|
|
16
17
|
"dev": "bun --watch ./src/index.ts",
|
|
17
18
|
"test": "bun test",
|
|
18
|
-
"prepublishOnly": "
|
|
19
|
+
"prepublishOnly": "npm run build"
|
|
19
20
|
},
|
|
20
21
|
"files": [
|
|
21
22
|
"dist",
|
|
22
23
|
"README.md"
|
|
23
24
|
],
|
|
24
25
|
"dependencies": {
|
|
25
|
-
"@affectively/aeon-pages-runtime": "^0.
|
|
26
|
+
"@affectively/aeon-pages-runtime": "^0.9.0"
|
|
26
27
|
},
|
|
27
28
|
"peerDependencies": {
|
|
28
29
|
"react": ">=18.0.0"
|