@microsoft/live-share-react 2.0.0-internal.17 → 2.0.0-internal.19
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/README.md +6 -0
- package/bin/esm/live-hooks/useLiveCanvas.js +29 -30
- package/bin/esm/live-hooks/useLiveCanvas.js.map +1 -1
- package/bin/esm/live-hooks/useLiveEvent.js +6 -15
- package/bin/esm/live-hooks/useLiveEvent.js.map +1 -1
- package/bin/esm/live-hooks/useLiveFollowMode.js +25 -34
- package/bin/esm/live-hooks/useLiveFollowMode.js.map +1 -1
- package/bin/esm/live-hooks/useLivePresence.js +5 -14
- package/bin/esm/live-hooks/useLivePresence.js.map +1 -1
- package/bin/esm/live-hooks/useLiveState.js +4 -13
- package/bin/esm/live-hooks/useLiveState.js.map +1 -1
- package/bin/esm/live-hooks/useLiveTimer.js +22 -31
- package/bin/esm/live-hooks/useLiveTimer.js.map +1 -1
- package/bin/esm/live-hooks/useMediaSynchronizer.js +24 -33
- package/bin/esm/live-hooks/useMediaSynchronizer.js.map +1 -1
- package/bin/esm/providers/AzureProvider.js +22 -27
- package/bin/esm/providers/AzureProvider.js.map +1 -1
- package/bin/esm/providers/LiveShareProvider.js +20 -21
- package/bin/esm/providers/LiveShareProvider.js.map +1 -1
- package/bin/esm/shared-hooks/internals/tree-node-types.js +1 -1
- package/bin/esm/shared-hooks/internals/tree-node-types.js.map +1 -1
- package/bin/esm/shared-hooks/internals/tree-node-utils.js +2 -4
- package/bin/esm/shared-hooks/internals/tree-node-utils.js.map +1 -1
- package/bin/esm/shared-hooks/useDynamicDDS.js +3 -12
- package/bin/esm/shared-hooks/useDynamicDDS.js.map +1 -1
- package/bin/esm/shared-hooks/useSharedMap.js +1 -1
- package/bin/esm/shared-hooks/useSharedMap.js.map +1 -1
- package/bin/esm/shared-hooks/useSharedStateRegistry.js +13 -10
- package/bin/esm/shared-hooks/useSharedStateRegistry.js.map +1 -1
- package/bin/esm/shared-hooks/useSharedTree.js +4 -4
- package/bin/esm/shared-hooks/useSharedTree.js.map +1 -1
- package/bin/esm/types/FluidMap.d.ts +151 -0
- package/bin/esm/types/FluidMap.d.ts.map +1 -0
- package/bin/esm/types/FluidMap.js +24 -0
- package/bin/esm/types/FluidMap.js.map +1 -0
- package/bin/esm/types/ResultTypes.d.ts +15 -1
- package/bin/esm/types/ResultTypes.d.ts.map +1 -1
- package/bin/esm/utils/type-check.js +1 -1
- package/bin/esm/utils/type-check.js.map +1 -1
- package/package.json +11 -21
- package/src/types/FluidMap.ts +169 -0
- package/src/types/ResultTypes.ts +18 -1
- package/tsconfig.json +3 -4
- package/bin/cjs/index.d.ts +0 -7
- package/bin/cjs/index.d.ts.map +0 -1
- package/bin/cjs/index.js +0 -23
- package/bin/cjs/index.js.map +0 -1
- package/bin/cjs/interfaces/LiveInterfaceExtensions.d.ts +0 -26
- package/bin/cjs/interfaces/LiveInterfaceExtensions.d.ts.map +0 -1
- package/bin/cjs/interfaces/LiveInterfaceExtensions.js +0 -7
- package/bin/cjs/interfaces/LiveInterfaceExtensions.js.map +0 -1
- package/bin/cjs/interfaces/index.d.ts +0 -2
- package/bin/cjs/interfaces/index.d.ts.map +0 -1
- package/bin/cjs/interfaces/index.js +0 -18
- package/bin/cjs/interfaces/index.js.map +0 -1
- package/bin/cjs/internal/errors.d.ts +0 -41
- package/bin/cjs/internal/errors.d.ts.map +0 -1
- package/bin/cjs/internal/errors.js +0 -48
- package/bin/cjs/internal/errors.js.map +0 -1
- package/bin/cjs/internal/index.d.ts +0 -3
- package/bin/cjs/internal/index.d.ts.map +0 -1
- package/bin/cjs/internal/index.js +0 -19
- package/bin/cjs/internal/index.js.map +0 -1
- package/bin/cjs/internal/type-guards.d.ts +0 -11
- package/bin/cjs/internal/type-guards.d.ts.map +0 -1
- package/bin/cjs/internal/type-guards.js +0 -24
- package/bin/cjs/internal/type-guards.js.map +0 -1
- package/bin/cjs/live-hooks/index.d.ts +0 -8
- package/bin/cjs/live-hooks/index.d.ts.map +0 -1
- package/bin/cjs/live-hooks/index.js +0 -24
- package/bin/cjs/live-hooks/index.js.map +0 -1
- package/bin/cjs/live-hooks/useLiveCanvas.d.ts +0 -80
- package/bin/cjs/live-hooks/useLiveCanvas.d.ts.map +0 -1
- package/bin/cjs/live-hooks/useLiveCanvas.js +0 -244
- package/bin/cjs/live-hooks/useLiveCanvas.js.map +0 -1
- package/bin/cjs/live-hooks/useLiveEvent.d.ts +0 -59
- package/bin/cjs/live-hooks/useLiveEvent.d.ts.map +0 -1
- package/bin/cjs/live-hooks/useLiveEvent.js +0 -150
- package/bin/cjs/live-hooks/useLiveEvent.js.map +0 -1
- package/bin/cjs/live-hooks/useLiveFollowMode.d.ts +0 -163
- package/bin/cjs/live-hooks/useLiveFollowMode.d.ts.map +0 -1
- package/bin/cjs/live-hooks/useLiveFollowMode.js +0 -360
- package/bin/cjs/live-hooks/useLiveFollowMode.js.map +0 -1
- package/bin/cjs/live-hooks/useLivePresence.d.ts +0 -76
- package/bin/cjs/live-hooks/useLivePresence.d.ts.map +0 -1
- package/bin/cjs/live-hooks/useLivePresence.js +0 -170
- package/bin/cjs/live-hooks/useLivePresence.js.map +0 -1
- package/bin/cjs/live-hooks/useLiveState.d.ts +0 -66
- package/bin/cjs/live-hooks/useLiveState.d.ts.map +0 -1
- package/bin/cjs/live-hooks/useLiveState.js +0 -134
- package/bin/cjs/live-hooks/useLiveState.js.map +0 -1
- package/bin/cjs/live-hooks/useLiveTimer.d.ts +0 -80
- package/bin/cjs/live-hooks/useLiveTimer.d.ts.map +0 -1
- package/bin/cjs/live-hooks/useLiveTimer.js +0 -233
- package/bin/cjs/live-hooks/useLiveTimer.js.map +0 -1
- package/bin/cjs/live-hooks/useMediaSynchronizer.d.ts +0 -86
- package/bin/cjs/live-hooks/useMediaSynchronizer.d.ts.map +0 -1
- package/bin/cjs/live-hooks/useMediaSynchronizer.js +0 -301
- package/bin/cjs/live-hooks/useMediaSynchronizer.js.map +0 -1
- package/bin/cjs/package.json +0 -1
- package/bin/cjs/providers/AzureProvider.d.ts +0 -113
- package/bin/cjs/providers/AzureProvider.d.ts.map +0 -1
- package/bin/cjs/providers/AzureProvider.js +0 -127
- package/bin/cjs/providers/AzureProvider.js.map +0 -1
- package/bin/cjs/providers/LiveShareProvider.d.ts +0 -193
- package/bin/cjs/providers/LiveShareProvider.d.ts.map +0 -1
- package/bin/cjs/providers/LiveShareProvider.js +0 -205
- package/bin/cjs/providers/LiveShareProvider.js.map +0 -1
- package/bin/cjs/providers/index.d.ts +0 -3
- package/bin/cjs/providers/index.d.ts.map +0 -1
- package/bin/cjs/providers/index.js +0 -19
- package/bin/cjs/providers/index.js.map +0 -1
- package/bin/cjs/shared-hooks/index.d.ts +0 -7
- package/bin/cjs/shared-hooks/index.d.ts.map +0 -1
- package/bin/cjs/shared-hooks/index.js +0 -23
- package/bin/cjs/shared-hooks/index.js.map +0 -1
- package/bin/cjs/shared-hooks/internals/tree-node-constants.d.ts +0 -3
- package/bin/cjs/shared-hooks/internals/tree-node-constants.d.ts.map +0 -1
- package/bin/cjs/shared-hooks/internals/tree-node-constants.js +0 -6
- package/bin/cjs/shared-hooks/internals/tree-node-constants.js.map +0 -1
- package/bin/cjs/shared-hooks/internals/tree-node-types.d.ts +0 -10
- package/bin/cjs/shared-hooks/internals/tree-node-types.d.ts.map +0 -1
- package/bin/cjs/shared-hooks/internals/tree-node-types.js +0 -23
- package/bin/cjs/shared-hooks/internals/tree-node-types.js.map +0 -1
- package/bin/cjs/shared-hooks/internals/tree-node-utils.d.ts +0 -33
- package/bin/cjs/shared-hooks/internals/tree-node-utils.d.ts.map +0 -1
- package/bin/cjs/shared-hooks/internals/tree-node-utils.js +0 -193
- package/bin/cjs/shared-hooks/internals/tree-node-utils.js.map +0 -1
- package/bin/cjs/shared-hooks/useDynamicDDS.d.ts +0 -23
- package/bin/cjs/shared-hooks/useDynamicDDS.d.ts.map +0 -1
- package/bin/cjs/shared-hooks/useDynamicDDS.js +0 -87
- package/bin/cjs/shared-hooks/useDynamicDDS.js.map +0 -1
- package/bin/cjs/shared-hooks/useSharedMap.d.ts +0 -25
- package/bin/cjs/shared-hooks/useSharedMap.d.ts.map +0 -1
- package/bin/cjs/shared-hooks/useSharedMap.js +0 -134
- package/bin/cjs/shared-hooks/useSharedMap.js.map +0 -1
- package/bin/cjs/shared-hooks/useSharedState.d.ts +0 -22
- package/bin/cjs/shared-hooks/useSharedState.d.ts.map +0 -1
- package/bin/cjs/shared-hooks/useSharedState.js +0 -80
- package/bin/cjs/shared-hooks/useSharedState.js.map +0 -1
- package/bin/cjs/shared-hooks/useSharedStateRegistry.d.ts +0 -37
- package/bin/cjs/shared-hooks/useSharedStateRegistry.d.ts.map +0 -1
- package/bin/cjs/shared-hooks/useSharedStateRegistry.js +0 -120
- package/bin/cjs/shared-hooks/useSharedStateRegistry.js.map +0 -1
- package/bin/cjs/shared-hooks/useSharedTree.d.ts +0 -57
- package/bin/cjs/shared-hooks/useSharedTree.d.ts.map +0 -1
- package/bin/cjs/shared-hooks/useSharedTree.js +0 -123
- package/bin/cjs/shared-hooks/useSharedTree.js.map +0 -1
- package/bin/cjs/shared-hooks/useTreeNode.d.ts +0 -96
- package/bin/cjs/shared-hooks/useTreeNode.d.ts.map +0 -1
- package/bin/cjs/shared-hooks/useTreeNode.js +0 -135
- package/bin/cjs/shared-hooks/useTreeNode.js.map +0 -1
- package/bin/cjs/types/ActionTypes.d.ts +0 -112
- package/bin/cjs/types/ActionTypes.d.ts.map +0 -1
- package/bin/cjs/types/ActionTypes.js +0 -7
- package/bin/cjs/types/ActionTypes.js.map +0 -1
- package/bin/cjs/types/PropTypes.d.ts +0 -56
- package/bin/cjs/types/PropTypes.d.ts.map +0 -1
- package/bin/cjs/types/PropTypes.js +0 -7
- package/bin/cjs/types/PropTypes.js.map +0 -1
- package/bin/cjs/types/ResultTypes.d.ts +0 -334
- package/bin/cjs/types/ResultTypes.d.ts.map +0 -1
- package/bin/cjs/types/ResultTypes.js +0 -7
- package/bin/cjs/types/ResultTypes.js.map +0 -1
- package/bin/cjs/types/index.d.ts +0 -4
- package/bin/cjs/types/index.d.ts.map +0 -1
- package/bin/cjs/types/index.js +0 -20
- package/bin/cjs/types/index.js.map +0 -1
- package/bin/cjs/utils/index.d.ts +0 -2
- package/bin/cjs/utils/index.d.ts.map +0 -1
- package/bin/cjs/utils/index.js +0 -18
- package/bin/cjs/utils/index.js.map +0 -1
- package/bin/cjs/utils/type-check.d.ts +0 -15
- package/bin/cjs/utils/type-check.d.ts.map +0 -1
- package/bin/cjs/utils/type-check.js +0 -62
- package/bin/cjs/utils/type-check.js.map +0 -1
- package/bin/index.d.ts +0 -7
- package/bin/index.d.ts.map +0 -1
- package/bin/index.js +0 -7
- package/bin/index.js.map +0 -1
- package/bin/interfaces/LiveInterfaceExtensions.d.ts +0 -26
- package/bin/interfaces/LiveInterfaceExtensions.d.ts.map +0 -1
- package/bin/interfaces/LiveInterfaceExtensions.js +0 -6
- package/bin/interfaces/LiveInterfaceExtensions.js.map +0 -1
- package/bin/interfaces/index.d.ts +0 -2
- package/bin/interfaces/index.d.ts.map +0 -1
- package/bin/interfaces/index.js +0 -2
- package/bin/interfaces/index.js.map +0 -1
- package/bin/internal/errors.d.ts +0 -41
- package/bin/internal/errors.d.ts.map +0 -1
- package/bin/internal/errors.js +0 -42
- package/bin/internal/errors.js.map +0 -1
- package/bin/internal/index.d.ts +0 -3
- package/bin/internal/index.d.ts.map +0 -1
- package/bin/internal/index.js +0 -3
- package/bin/internal/index.js.map +0 -1
- package/bin/internal/type-guards.d.ts +0 -11
- package/bin/internal/type-guards.d.ts.map +0 -1
- package/bin/internal/type-guards.js +0 -20
- package/bin/internal/type-guards.js.map +0 -1
- package/bin/live-hooks/index.d.ts +0 -8
- package/bin/live-hooks/index.d.ts.map +0 -1
- package/bin/live-hooks/index.js +0 -8
- package/bin/live-hooks/index.js.map +0 -1
- package/bin/live-hooks/useLiveCanvas.d.ts +0 -29
- package/bin/live-hooks/useLiveCanvas.d.ts.map +0 -1
- package/bin/live-hooks/useLiveCanvas.js +0 -160
- package/bin/live-hooks/useLiveCanvas.js.map +0 -1
- package/bin/live-hooks/useLiveEvent.d.ts +0 -23
- package/bin/live-hooks/useLiveEvent.d.ts.map +0 -1
- package/bin/live-hooks/useLiveEvent.js +0 -108
- package/bin/live-hooks/useLiveEvent.js.map +0 -1
- package/bin/live-hooks/useLiveFollowMode.d.ts +0 -24
- package/bin/live-hooks/useLiveFollowMode.d.ts.map +0 -1
- package/bin/live-hooks/useLiveFollowMode.js +0 -211
- package/bin/live-hooks/useLiveFollowMode.js.map +0 -1
- package/bin/live-hooks/useLivePresence.d.ts +0 -26
- package/bin/live-hooks/useLivePresence.d.ts.map +0 -1
- package/bin/live-hooks/useLivePresence.js +0 -106
- package/bin/live-hooks/useLivePresence.js.map +0 -1
- package/bin/live-hooks/useLiveState.d.ts +0 -21
- package/bin/live-hooks/useLiveState.d.ts.map +0 -1
- package/bin/live-hooks/useLiveState.js +0 -83
- package/bin/live-hooks/useLiveState.js.map +0 -1
- package/bin/live-hooks/useLiveTimer.d.ts +0 -25
- package/bin/live-hooks/useLiveTimer.d.ts.map +0 -1
- package/bin/live-hooks/useLiveTimer.js +0 -172
- package/bin/live-hooks/useLiveTimer.js.map +0 -1
- package/bin/live-hooks/useMediaSynchronizer.d.ts +0 -25
- package/bin/live-hooks/useMediaSynchronizer.d.ts.map +0 -1
- package/bin/live-hooks/useMediaSynchronizer.js +0 -234
- package/bin/live-hooks/useMediaSynchronizer.js.map +0 -1
- package/bin/providers/AzureProvider.d.ts +0 -113
- package/bin/providers/AzureProvider.d.ts.map +0 -1
- package/bin/providers/AzureProvider.js +0 -119
- package/bin/providers/AzureProvider.js.map +0 -1
- package/bin/providers/LiveShareProvider.d.ts +0 -91
- package/bin/providers/LiveShareProvider.d.ts.map +0 -1
- package/bin/providers/LiveShareProvider.js +0 -95
- package/bin/providers/LiveShareProvider.js.map +0 -1
- package/bin/providers/index.d.ts +0 -3
- package/bin/providers/index.d.ts.map +0 -1
- package/bin/providers/index.js +0 -3
- package/bin/providers/index.js.map +0 -1
- package/bin/shared-hooks/index.d.ts +0 -5
- package/bin/shared-hooks/index.d.ts.map +0 -1
- package/bin/shared-hooks/index.js +0 -5
- package/bin/shared-hooks/index.js.map +0 -1
- package/bin/shared-hooks/useDynamicDDS.d.ts +0 -23
- package/bin/shared-hooks/useDynamicDDS.d.ts.map +0 -1
- package/bin/shared-hooks/useDynamicDDS.js +0 -72
- package/bin/shared-hooks/useDynamicDDS.js.map +0 -1
- package/bin/shared-hooks/useSharedMap.d.ts +0 -23
- package/bin/shared-hooks/useSharedMap.d.ts.map +0 -1
- package/bin/shared-hooks/useSharedMap.js +0 -114
- package/bin/shared-hooks/useSharedMap.js.map +0 -1
- package/bin/shared-hooks/useSharedState.d.ts +0 -22
- package/bin/shared-hooks/useSharedState.d.ts.map +0 -1
- package/bin/shared-hooks/useSharedState.js +0 -74
- package/bin/shared-hooks/useSharedState.js.map +0 -1
- package/bin/shared-hooks/useSharedStateRegistry.d.ts +0 -37
- package/bin/shared-hooks/useSharedStateRegistry.d.ts.map +0 -1
- package/bin/shared-hooks/useSharedStateRegistry.js +0 -105
- package/bin/shared-hooks/useSharedStateRegistry.js.map +0 -1
- package/bin/types/ActionTypes.d.ts +0 -112
- package/bin/types/ActionTypes.d.ts.map +0 -1
- package/bin/types/ActionTypes.js +0 -6
- package/bin/types/ActionTypes.js.map +0 -1
- package/bin/types/PropTypes.d.ts +0 -8
- package/bin/types/PropTypes.d.ts.map +0 -1
- package/bin/types/PropTypes.js +0 -6
- package/bin/types/PropTypes.js.map +0 -1
- package/bin/types/ResultTypes.d.ts +0 -302
- package/bin/types/ResultTypes.d.ts.map +0 -1
- package/bin/types/ResultTypes.js +0 -6
- package/bin/types/ResultTypes.js.map +0 -1
- package/bin/types/index.d.ts +0 -4
- package/bin/types/index.d.ts.map +0 -1
- package/bin/types/index.js +0 -4
- package/bin/types/index.js.map +0 -1
- package/bin/utils/index.d.ts +0 -2
- package/bin/utils/index.d.ts.map +0 -1
- package/bin/utils/index.js +0 -2
- package/bin/utils/index.js.map +0 -1
- package/bin/utils/type-check.d.ts +0 -15
- package/bin/utils/type-check.d.ts.map +0 -1
- package/bin/utils/type-check.js +0 -54
- package/bin/utils/type-check.js.map +0 -1
- package/tsconfig.cjs.json +0 -14
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the Microsoft Live Share SDK License.
|
|
4
|
-
*/
|
|
5
|
-
import { LiveState, UserMeetingRole } from "@microsoft/live-share";
|
|
6
|
-
import { SetLiveStateAction } from "../types/index.js";
|
|
7
|
-
/**
|
|
8
|
-
* React hook for using a Live Share `LiveState`.
|
|
9
|
-
*
|
|
10
|
-
* @remarks
|
|
11
|
-
* Use this hook if you want to synchronize app state that will reset when all users leave the session.
|
|
12
|
-
* This hook can only be used in a child component of `<LiveShareProvider>` or `<AzureProvider>`.
|
|
13
|
-
*
|
|
14
|
-
* @param uniqueKey the unique key for the `LiveEvent`. If one does not yet exist, a new one will be created, otherwise it will use the existing one.
|
|
15
|
-
* @param initialState Optional. the initial state value of type TState
|
|
16
|
-
* @param allowedRoles Optional. the user roles that are allowed to mutate the synchronized state
|
|
17
|
-
* @returns ordered values: first value is the synchronized state value and the second is a setter to change the state value.
|
|
18
|
-
* The setter returns a void promise, which will throw if the user does not have the required roles to set.
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
```jsx
|
|
22
|
-
import { useLiveState } from "@microsoft/live-share-react";
|
|
23
|
-
|
|
24
|
-
const planets = [
|
|
25
|
-
"Mercury",
|
|
26
|
-
"Venus",
|
|
27
|
-
"Earth",
|
|
28
|
-
"Mars",
|
|
29
|
-
"Jupiter",
|
|
30
|
-
"Saturn",
|
|
31
|
-
"Uranus",
|
|
32
|
-
"Neptune",
|
|
33
|
-
];
|
|
34
|
-
|
|
35
|
-
// Define a unique key that differentiates this usage of `useLiveState` from others in your app
|
|
36
|
-
const MY_UNIQUE_KEY = "selected-planet-key";
|
|
37
|
-
|
|
38
|
-
// Example component for using useLiveState
|
|
39
|
-
export const MyCustomState = () => {
|
|
40
|
-
const [planet, setPlanet, liveState] = useLiveState(MY_UNIQUE_KEY, planets[0]);
|
|
41
|
-
|
|
42
|
-
// Render loading UI when creating LiveState instance for first time
|
|
43
|
-
if (!liveState) return <>Loading...</>;
|
|
44
|
-
|
|
45
|
-
// Render UI
|
|
46
|
-
return (
|
|
47
|
-
<div>
|
|
48
|
-
{`Current planet: ${planet}`}
|
|
49
|
-
{"Select a planet below:"}
|
|
50
|
-
{planets.map((planet) => (
|
|
51
|
-
<button
|
|
52
|
-
key={planet}
|
|
53
|
-
onClick={() => {
|
|
54
|
-
setPlanet(planet);
|
|
55
|
-
}}
|
|
56
|
-
>
|
|
57
|
-
{planet}
|
|
58
|
-
</button>
|
|
59
|
-
))}
|
|
60
|
-
</div>
|
|
61
|
-
);
|
|
62
|
-
};
|
|
63
|
-
```
|
|
64
|
-
*/
|
|
65
|
-
export declare function useLiveState<TState = any>(uniqueKey: string, initialState: TState, allowedRoles?: UserMeetingRole[]): [TState, SetLiveStateAction<TState>, LiveState<TState> | undefined];
|
|
66
|
-
//# sourceMappingURL=useLiveState.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLiveState.d.ts","sourceRoot":"","sources":["../../../src/live-hooks/useLiveState.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEH,SAAS,EACT,eAAe,EAClB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAUvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,wBAAgB,YAAY,CAAC,MAAM,GAAG,GAAG,EACrC,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,YAAY,CAAC,EAAE,eAAe,EAAE,GACjC,CAAC,MAAM,EAAE,kBAAkB,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,CAwErE"}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
* Licensed under the Microsoft Live Share SDK License.
|
|
5
|
-
*/
|
|
6
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
7
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
9
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
10
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
11
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
12
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.useLiveState = useLiveState;
|
|
20
|
-
const live_share_1 = require("@microsoft/live-share");
|
|
21
|
-
const react_1 = __importDefault(require("react"));
|
|
22
|
-
const index_js_1 = require("../shared-hooks/index.js");
|
|
23
|
-
const index_js_2 = require("../providers/index.js");
|
|
24
|
-
const index_js_3 = require("../internal/index.js");
|
|
25
|
-
/**
|
|
26
|
-
* React hook for using a Live Share `LiveState`.
|
|
27
|
-
*
|
|
28
|
-
* @remarks
|
|
29
|
-
* Use this hook if you want to synchronize app state that will reset when all users leave the session.
|
|
30
|
-
* This hook can only be used in a child component of `<LiveShareProvider>` or `<AzureProvider>`.
|
|
31
|
-
*
|
|
32
|
-
* @param uniqueKey the unique key for the `LiveEvent`. If one does not yet exist, a new one will be created, otherwise it will use the existing one.
|
|
33
|
-
* @param initialState Optional. the initial state value of type TState
|
|
34
|
-
* @param allowedRoles Optional. the user roles that are allowed to mutate the synchronized state
|
|
35
|
-
* @returns ordered values: first value is the synchronized state value and the second is a setter to change the state value.
|
|
36
|
-
* The setter returns a void promise, which will throw if the user does not have the required roles to set.
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
```jsx
|
|
40
|
-
import { useLiveState } from "@microsoft/live-share-react";
|
|
41
|
-
|
|
42
|
-
const planets = [
|
|
43
|
-
"Mercury",
|
|
44
|
-
"Venus",
|
|
45
|
-
"Earth",
|
|
46
|
-
"Mars",
|
|
47
|
-
"Jupiter",
|
|
48
|
-
"Saturn",
|
|
49
|
-
"Uranus",
|
|
50
|
-
"Neptune",
|
|
51
|
-
];
|
|
52
|
-
|
|
53
|
-
// Define a unique key that differentiates this usage of `useLiveState` from others in your app
|
|
54
|
-
const MY_UNIQUE_KEY = "selected-planet-key";
|
|
55
|
-
|
|
56
|
-
// Example component for using useLiveState
|
|
57
|
-
export const MyCustomState = () => {
|
|
58
|
-
const [planet, setPlanet, liveState] = useLiveState(MY_UNIQUE_KEY, planets[0]);
|
|
59
|
-
|
|
60
|
-
// Render loading UI when creating LiveState instance for first time
|
|
61
|
-
if (!liveState) return <>Loading...</>;
|
|
62
|
-
|
|
63
|
-
// Render UI
|
|
64
|
-
return (
|
|
65
|
-
<div>
|
|
66
|
-
{`Current planet: ${planet}`}
|
|
67
|
-
{"Select a planet below:"}
|
|
68
|
-
{planets.map((planet) => (
|
|
69
|
-
<button
|
|
70
|
-
key={planet}
|
|
71
|
-
onClick={() => {
|
|
72
|
-
setPlanet(planet);
|
|
73
|
-
}}
|
|
74
|
-
>
|
|
75
|
-
{planet}
|
|
76
|
-
</button>
|
|
77
|
-
))}
|
|
78
|
-
</div>
|
|
79
|
-
);
|
|
80
|
-
};
|
|
81
|
-
```
|
|
82
|
-
*/
|
|
83
|
-
function useLiveState(uniqueKey, initialState, allowedRoles) {
|
|
84
|
-
const [currentState, setCurrentState] = react_1.default.useState(initialState);
|
|
85
|
-
/**
|
|
86
|
-
* User facing: dynamically load the DDS for the given unique key.
|
|
87
|
-
*/
|
|
88
|
-
const { dds: liveState } = (0, index_js_1.useDynamicDDS)(uniqueKey, (live_share_1.LiveState));
|
|
89
|
-
const { container } = (0, index_js_2.useFluidObjectsContext)();
|
|
90
|
-
/**
|
|
91
|
-
* Change state callback that is user facing
|
|
92
|
-
* @param state TState to set
|
|
93
|
-
* @returns void promise, which will throw if the user does not have the required roles
|
|
94
|
-
*/
|
|
95
|
-
const setState = react_1.default.useCallback((state) => __awaiter(this, void 0, void 0, function* () {
|
|
96
|
-
if (!container) {
|
|
97
|
-
throw new index_js_3.ActionContainerNotJoinedError("liveState", "setState");
|
|
98
|
-
}
|
|
99
|
-
if (liveState === undefined) {
|
|
100
|
-
throw new index_js_3.ActionLiveDataObjectUndefinedError("liveState", "setState");
|
|
101
|
-
}
|
|
102
|
-
if (!liveState.isInitialized) {
|
|
103
|
-
throw new index_js_3.ActionLiveDataObjectInitializedError("liveState", "setState");
|
|
104
|
-
}
|
|
105
|
-
const valueToSet = (0, index_js_3.isPrevStateCallback)(state)
|
|
106
|
-
? state(liveState.state)
|
|
107
|
-
: state;
|
|
108
|
-
return yield liveState.set(valueToSet);
|
|
109
|
-
}), [container, liveState]);
|
|
110
|
-
/**
|
|
111
|
-
* Setup change listeners and start `LiveState` if needed
|
|
112
|
-
*/
|
|
113
|
-
react_1.default.useEffect(() => {
|
|
114
|
-
if (liveState === undefined)
|
|
115
|
-
return;
|
|
116
|
-
const onStateChanged = (state) => {
|
|
117
|
-
setCurrentState(state);
|
|
118
|
-
};
|
|
119
|
-
liveState.on("stateChanged", onStateChanged);
|
|
120
|
-
if (liveState.initializeState === live_share_1.LiveDataObjectInitializeState.needed) {
|
|
121
|
-
liveState
|
|
122
|
-
.initialize(initialState, allowedRoles)
|
|
123
|
-
.then(() => onStateChanged(liveState.state));
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
onStateChanged(liveState.state);
|
|
127
|
-
}
|
|
128
|
-
return () => {
|
|
129
|
-
liveState === null || liveState === void 0 ? void 0 : liveState.off("stateChanged", onStateChanged);
|
|
130
|
-
};
|
|
131
|
-
}, [liveState]);
|
|
132
|
-
return [currentState, setState, liveState];
|
|
133
|
-
}
|
|
134
|
-
//# sourceMappingURL=useLiveState.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLiveState.js","sourceRoot":"","sources":["../../../src/live-hooks/useLiveState.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;AA4EH,oCA4EC;AAtJD,sDAI+B;AAC/B,kDAA0B;AAE1B,uDAAyD;AACzD,oDAA+D;AAC/D,mDAK8B;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,SAAgB,YAAY,CACxB,SAAiB,EACjB,YAAoB,EACpB,YAAgC;IAEhC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GACjC,eAAK,CAAC,QAAQ,CAAS,YAAY,CAAC,CAAC;IACzC;;OAEG;IACH,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,IAAA,wBAAa,EACpC,SAAS,EACT,CAAA,sBAAiB,CAAA,CACpB,CAAC;IAEF,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,iCAAsB,GAAE,CAAC;IAE/C;;;;OAIG;IACH,MAAM,QAAQ,GAAG,eAAK,CAAC,WAAW,CAC9B,CAAO,KAA+C,EAAE,EAAE;QACtD,IAAI,CAAC,SAAS,EAAE,CAAC;YACb,MAAM,IAAI,wCAA6B,CACnC,WAAW,EACX,UAAU,CACb,CAAC;QACN,CAAC;QACD,IAAI,SA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AY,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the Microsoft Live Share SDK License.
|
|
4
|
-
*/
|
|
5
|
-
import { UserMeetingRole } from "@microsoft/live-share";
|
|
6
|
-
import { IUseLiveTimerResults, OnTimerDidFinishAction, OnTimerDidPauseAction, OnTimerDidPlayAction, OnTimerDidStartAction, OnTimerTickAction } from "../types/index.js";
|
|
7
|
-
/**
|
|
8
|
-
* React hook for using Live Share's `LiveTimer` DDS.
|
|
9
|
-
*
|
|
10
|
-
* @remarks
|
|
11
|
-
* Use this hook to create a synchronized countdown timer in your app or to schedule synchronized tasks.
|
|
12
|
-
* This hook can only be used in a child component of `<LiveShareProvider>` or `<AzureProvider>`.
|
|
13
|
-
*
|
|
14
|
-
* @param uniqueKey the unique key for the `LiveTimer`. If one does not yet exist, a new one will be created, otherwise it will use the existing one.
|
|
15
|
-
* @param allowedRoles Optional. the user roles that are allowed to start/stop/pause the timer.
|
|
16
|
-
* @param tickRate Optional. the interval in which the `milliRemaining` state should be updated and the `onTick` callback will trigger.
|
|
17
|
-
* @param onTick Optional. event handler callback for when an active timer ticks.
|
|
18
|
-
* @param onStart Optional. event handler callback for when the timer is started.
|
|
19
|
-
* @param onPause Optional. event handler callback for when the timer is paused.
|
|
20
|
-
* @param onPlay Optional. event handler callback for when the timer is resumed.
|
|
21
|
-
* @param onFinish Optional. event handler callback for when the timer finishes.
|
|
22
|
-
* @returns results and callbacks exposed via the hook.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
```jsx
|
|
26
|
-
import { useLiveTimer } from "@microsoft/live-share-react";
|
|
27
|
-
|
|
28
|
-
// Define a unique key that differentiates this usage of `useLiveTimer` from others in your app
|
|
29
|
-
const MY_UNIQUE_KEY = "timer-key";
|
|
30
|
-
|
|
31
|
-
// Example component for using useLiveTimer
|
|
32
|
-
export function CountdownTimer() {
|
|
33
|
-
const {
|
|
34
|
-
milliRemaining,
|
|
35
|
-
timerConfig,
|
|
36
|
-
liveTimer,
|
|
37
|
-
start,
|
|
38
|
-
pause,
|
|
39
|
-
play,
|
|
40
|
-
} = useLiveTimer("TIMER-ID");
|
|
41
|
-
|
|
42
|
-
// Render loading UI when creating LiveTimer instance for first time
|
|
43
|
-
if (!liveTimer) return <>Loading...</>;
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<div>
|
|
47
|
-
<button
|
|
48
|
-
onClick={() => {
|
|
49
|
-
start(60 * 1000);
|
|
50
|
-
}}
|
|
51
|
-
>
|
|
52
|
-
{timerConfig === undefined ? "Start" : "Reset"}
|
|
53
|
-
</button>
|
|
54
|
-
{timerConfig !== undefined && (
|
|
55
|
-
<button
|
|
56
|
-
onClick={() => {
|
|
57
|
-
if (timerConfig.running) {
|
|
58
|
-
pause();
|
|
59
|
-
} else {
|
|
60
|
-
play();
|
|
61
|
-
}
|
|
62
|
-
}}
|
|
63
|
-
>
|
|
64
|
-
{timerConfig.running ? "Pause" : "Play"}
|
|
65
|
-
</button>
|
|
66
|
-
)}
|
|
67
|
-
{milliRemaining !== undefined && (
|
|
68
|
-
<p>
|
|
69
|
-
{`${Math.round(milliRemaining / 1000)} / ${
|
|
70
|
-
Math.round(timerConfig.duration) / 1000
|
|
71
|
-
}`}
|
|
72
|
-
</p>
|
|
73
|
-
)}
|
|
74
|
-
</div>
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
```
|
|
78
|
-
*/
|
|
79
|
-
export declare function useLiveTimer(uniqueKey: string, allowedRoles?: UserMeetingRole[], tickRate?: number, onTick?: OnTimerTickAction, onStart?: OnTimerDidStartAction, onPause?: OnTimerDidPauseAction, onPlay?: OnTimerDidPlayAction, onFinish?: OnTimerDidFinishAction): IUseLiveTimerResults;
|
|
80
|
-
//# sourceMappingURL=useLiveTimer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLiveTimer.d.ts","sourceRoot":"","sources":["../../../src/live-hooks/useLiveTimer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGH,eAAe,EAGlB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACH,oBAAoB,EAIpB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACpB,MAAM,mBAAmB,CAAC;AAS3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH,wBAAgB,YAAY,CACxB,SAAS,EAAE,MAAM,EACjB,YAAY,CAAC,EAAE,eAAe,EAAE,EAChC,QAAQ,CAAC,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,iBAAiB,EAC1B,OAAO,CAAC,EAAE,qBAAqB,EAC/B,OAAO,CAAC,EAAE,qBAAqB,EAC/B,MAAM,CAAC,EAAE,oBAAoB,EAC7B,QAAQ,CAAC,EAAE,sBAAsB,GAClC,oBAAoB,CA8JtB"}
|
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
* Licensed under the Microsoft Live Share SDK License.
|
|
5
|
-
*/
|
|
6
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
7
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
9
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
10
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
11
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
12
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.useLiveTimer = useLiveTimer;
|
|
20
|
-
const live_share_1 = require("@microsoft/live-share");
|
|
21
|
-
const react_1 = __importDefault(require("react"));
|
|
22
|
-
const index_js_1 = require("../shared-hooks/index.js");
|
|
23
|
-
const index_js_2 = require("../providers/index.js");
|
|
24
|
-
const index_js_3 = require("../internal/index.js");
|
|
25
|
-
/**
|
|
26
|
-
* React hook for using Live Share's `LiveTimer` DDS.
|
|
27
|
-
*
|
|
28
|
-
* @remarks
|
|
29
|
-
* Use this hook to create a synchronized countdown timer in your app or to schedule synchronized tasks.
|
|
30
|
-
* This hook can only be used in a child component of `<LiveShareProvider>` or `<AzureProvider>`.
|
|
31
|
-
*
|
|
32
|
-
* @param uniqueKey the unique key for the `LiveTimer`. If one does not yet exist, a new one will be created, otherwise it will use the existing one.
|
|
33
|
-
* @param allowedRoles Optional. the user roles that are allowed to start/stop/pause the timer.
|
|
34
|
-
* @param tickRate Optional. the interval in which the `milliRemaining` state should be updated and the `onTick` callback will trigger.
|
|
35
|
-
* @param onTick Optional. event handler callback for when an active timer ticks.
|
|
36
|
-
* @param onStart Optional. event handler callback for when the timer is started.
|
|
37
|
-
* @param onPause Optional. event handler callback for when the timer is paused.
|
|
38
|
-
* @param onPlay Optional. event handler callback for when the timer is resumed.
|
|
39
|
-
* @param onFinish Optional. event handler callback for when the timer finishes.
|
|
40
|
-
* @returns results and callbacks exposed via the hook.
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
```jsx
|
|
44
|
-
import { useLiveTimer } from "@microsoft/live-share-react";
|
|
45
|
-
|
|
46
|
-
// Define a unique key that differentiates this usage of `useLiveTimer` from others in your app
|
|
47
|
-
const MY_UNIQUE_KEY = "timer-key";
|
|
48
|
-
|
|
49
|
-
// Example component for using useLiveTimer
|
|
50
|
-
export function CountdownTimer() {
|
|
51
|
-
const {
|
|
52
|
-
milliRemaining,
|
|
53
|
-
timerConfig,
|
|
54
|
-
liveTimer,
|
|
55
|
-
start,
|
|
56
|
-
pause,
|
|
57
|
-
play,
|
|
58
|
-
} = useLiveTimer("TIMER-ID");
|
|
59
|
-
|
|
60
|
-
// Render loading UI when creating LiveTimer instance for first time
|
|
61
|
-
if (!liveTimer) return <>Loading...</>;
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<div>
|
|
65
|
-
<button
|
|
66
|
-
onClick={() => {
|
|
67
|
-
start(60 * 1000);
|
|
68
|
-
}}
|
|
69
|
-
>
|
|
70
|
-
{timerConfig === undefined ? "Start" : "Reset"}
|
|
71
|
-
</button>
|
|
72
|
-
{timerConfig !== undefined && (
|
|
73
|
-
<button
|
|
74
|
-
onClick={() => {
|
|
75
|
-
if (timerConfig.running) {
|
|
76
|
-
pause();
|
|
77
|
-
} else {
|
|
78
|
-
play();
|
|
79
|
-
}
|
|
80
|
-
}}
|
|
81
|
-
>
|
|
82
|
-
{timerConfig.running ? "Pause" : "Play"}
|
|
83
|
-
</button>
|
|
84
|
-
)}
|
|
85
|
-
{milliRemaining !== undefined && (
|
|
86
|
-
<p>
|
|
87
|
-
{`${Math.round(milliRemaining / 1000)} / ${
|
|
88
|
-
Math.round(timerConfig.duration) / 1000
|
|
89
|
-
}`}
|
|
90
|
-
</p>
|
|
91
|
-
)}
|
|
92
|
-
</div>
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
```
|
|
96
|
-
*/
|
|
97
|
-
function useLiveTimer(uniqueKey, allowedRoles, tickRate, onTick, onStart, onPause, onPlay, onFinish) {
|
|
98
|
-
/**
|
|
99
|
-
* User facing: Stateful timer config.
|
|
100
|
-
*/
|
|
101
|
-
const [timerConfig, setTimerConfig] = react_1.default.useState();
|
|
102
|
-
/**
|
|
103
|
-
* User facing: Stateful time remaining.
|
|
104
|
-
*/
|
|
105
|
-
const [milliRemaining, setMilliRemaining] = react_1.default.useState();
|
|
106
|
-
/**
|
|
107
|
-
* User facing: dynamically load the DDS for the given unique key.
|
|
108
|
-
*/
|
|
109
|
-
const { dds: liveTimer } = (0, index_js_1.useDynamicDDS)(uniqueKey, live_share_1.LiveTimer);
|
|
110
|
-
const { container } = (0, index_js_2.useFluidObjectsContext)();
|
|
111
|
-
/**
|
|
112
|
-
* Callback to send event through `LiveTimer`
|
|
113
|
-
* @param duration the duration for the timer in milliseconds
|
|
114
|
-
* @returns void promise that will throw when user does not have required roles
|
|
115
|
-
*/
|
|
116
|
-
const start = react_1.default.useCallback((duration) => __awaiter(this, void 0, void 0, function* () {
|
|
117
|
-
if (!container) {
|
|
118
|
-
throw new index_js_3.ActionContainerNotJoinedError("liveTimer", "start");
|
|
119
|
-
}
|
|
120
|
-
if (liveTimer === undefined) {
|
|
121
|
-
throw new index_js_3.ActionLiveDataObjectUndefinedError("liveTimer", "start");
|
|
122
|
-
}
|
|
123
|
-
if (!liveTimer.isInitialized) {
|
|
124
|
-
throw new index_js_3.ActionLiveDataObjectInitializedError("liveTimer", "start");
|
|
125
|
-
}
|
|
126
|
-
return yield liveTimer.start(duration);
|
|
127
|
-
}), [container, liveTimer]);
|
|
128
|
-
/**
|
|
129
|
-
* Callback to send event through `LiveTimer`
|
|
130
|
-
* @returns void promise that will throw when user does not have required roles
|
|
131
|
-
*/
|
|
132
|
-
const play = react_1.default.useCallback(() => __awaiter(this, void 0, void 0, function* () {
|
|
133
|
-
if (!container) {
|
|
134
|
-
throw new index_js_3.ActionContainerNotJoinedError("liveTimer", "play");
|
|
135
|
-
}
|
|
136
|
-
if (liveTimer === undefined) {
|
|
137
|
-
throw new index_js_3.ActionLiveDataObjectUndefinedError("liveTimer", "play");
|
|
138
|
-
}
|
|
139
|
-
if (!liveTimer.isInitialized) {
|
|
140
|
-
throw new index_js_3.ActionLiveDataObjectInitializedError("liveTimer", "play");
|
|
141
|
-
}
|
|
142
|
-
return yield liveTimer.play();
|
|
143
|
-
}), [container, liveTimer]);
|
|
144
|
-
/**
|
|
145
|
-
* Callback to send event through `LiveTimer`
|
|
146
|
-
* @returns void promise that will throw when user does not have required roles
|
|
147
|
-
*/
|
|
148
|
-
const pause = react_1.default.useCallback(() => __awaiter(this, void 0, void 0, function* () {
|
|
149
|
-
if (!container) {
|
|
150
|
-
throw new index_js_3.ActionContainerNotJoinedError("liveTimer", "pause");
|
|
151
|
-
}
|
|
152
|
-
if (liveTimer === undefined) {
|
|
153
|
-
throw new index_js_3.ActionLiveDataObjectUndefinedError("liveTimer", "pause");
|
|
154
|
-
}
|
|
155
|
-
if (!liveTimer.isInitialized) {
|
|
156
|
-
throw new index_js_3.ActionLiveDataObjectInitializedError("liveTimer", "pause");
|
|
157
|
-
}
|
|
158
|
-
return yield liveTimer.pause();
|
|
159
|
-
}), [container, liveTimer]);
|
|
160
|
-
/**
|
|
161
|
-
* Setup change listeners and start `LiveTimer` if needed
|
|
162
|
-
*/
|
|
163
|
-
react_1.default.useEffect(() => {
|
|
164
|
-
if (liveTimer === undefined)
|
|
165
|
-
return;
|
|
166
|
-
// Reset default values, which is needed for when the `id` changes and a new DDS is loaded.
|
|
167
|
-
// React does not re-render if the values are already set to defaults (e.g., initial DDS).
|
|
168
|
-
setTimerConfig(undefined);
|
|
169
|
-
setMilliRemaining(undefined);
|
|
170
|
-
// Register event listeners
|
|
171
|
-
const onTimerConfigChange = (config) => {
|
|
172
|
-
setTimerConfig(config);
|
|
173
|
-
};
|
|
174
|
-
const onDidStart = (config) => {
|
|
175
|
-
onTimerConfigChange(config);
|
|
176
|
-
onStart === null || onStart === void 0 ? void 0 : onStart(config);
|
|
177
|
-
setMilliRemaining(config.duration);
|
|
178
|
-
};
|
|
179
|
-
const onDidFinish = (config) => {
|
|
180
|
-
onTimerConfigChange(config);
|
|
181
|
-
onFinish === null || onFinish === void 0 ? void 0 : onFinish(config);
|
|
182
|
-
setMilliRemaining(0);
|
|
183
|
-
};
|
|
184
|
-
const onDidPlay = (config) => {
|
|
185
|
-
onTimerConfigChange(config);
|
|
186
|
-
onPlay === null || onPlay === void 0 ? void 0 : onPlay(config);
|
|
187
|
-
};
|
|
188
|
-
const onDidPause = (config) => {
|
|
189
|
-
onTimerConfigChange(config);
|
|
190
|
-
onPause === null || onPause === void 0 ? void 0 : onPause(config);
|
|
191
|
-
};
|
|
192
|
-
const onDidTick = (milliseconds) => {
|
|
193
|
-
setMilliRemaining(milliseconds);
|
|
194
|
-
onTick === null || onTick === void 0 ? void 0 : onTick(milliseconds);
|
|
195
|
-
};
|
|
196
|
-
liveTimer.on(live_share_1.LiveTimerEvents.started, onDidStart);
|
|
197
|
-
liveTimer.on(live_share_1.LiveTimerEvents.finished, onDidFinish);
|
|
198
|
-
liveTimer.on(live_share_1.LiveTimerEvents.played, onDidPlay);
|
|
199
|
-
liveTimer.on(live_share_1.LiveTimerEvents.paused, onDidPause);
|
|
200
|
-
liveTimer.on(live_share_1.LiveTimerEvents.onTick, onDidTick);
|
|
201
|
-
if (liveTimer.initializeState === live_share_1.LiveDataObjectInitializeState.needed) {
|
|
202
|
-
// Start live event
|
|
203
|
-
liveTimer.initialize(allowedRoles);
|
|
204
|
-
}
|
|
205
|
-
return () => {
|
|
206
|
-
// on unmount, remove event listeners
|
|
207
|
-
liveTimer === null || liveTimer === void 0 ? void 0 : liveTimer.off(live_share_1.LiveTimerEvents.started, onDidStart);
|
|
208
|
-
liveTimer === null || liveTimer === void 0 ? void 0 : liveTimer.off(live_share_1.LiveTimerEvents.finished, onDidFinish);
|
|
209
|
-
liveTimer === null || liveTimer === void 0 ? void 0 : liveTimer.off(live_share_1.LiveTimerEvents.played, onDidPlay);
|
|
210
|
-
liveTimer === null || liveTimer === void 0 ? void 0 : liveTimer.off(live_share_1.LiveTimerEvents.paused, onDidPause);
|
|
211
|
-
liveTimer === null || liveTimer === void 0 ? void 0 : liveTimer.off(live_share_1.LiveTimerEvents.onTick, onDidTick);
|
|
212
|
-
};
|
|
213
|
-
}, [liveTimer, onTick, onStart, onFinish, onPlay, onPause]);
|
|
214
|
-
/**
|
|
215
|
-
* Change tick rate if changes in props
|
|
216
|
-
*/
|
|
217
|
-
react_1.default.useEffect(() => {
|
|
218
|
-
if (tickRate !== undefined &&
|
|
219
|
-
(liveTimer === null || liveTimer === void 0 ? void 0 : liveTimer.tickRate) !== undefined &&
|
|
220
|
-
tickRate !== (liveTimer === null || liveTimer === void 0 ? void 0 : liveTimer.tickRate)) {
|
|
221
|
-
liveTimer.tickRate = tickRate;
|
|
222
|
-
}
|
|
223
|
-
}, [tickRate, liveTimer === null || liveTimer === void 0 ? void 0 : liveTimer.tickRate]);
|
|
224
|
-
return {
|
|
225
|
-
liveTimer,
|
|
226
|
-
milliRemaining,
|
|
227
|
-
pause,
|
|
228
|
-
play,
|
|
229
|
-
start,
|
|
230
|
-
timerConfig,
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
//# sourceMappingURL=useLiveTimer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLiveTimer.js","sourceRoot":"","sources":["../../../src/live-hooks/useLiveTimer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;AAqGH,oCAuKC;AA1QD,sDAM+B;AAC/B,kDAA0B;AAY1B,uDAAyD;AACzD,oDAA+D;AAC/D,mDAI8B;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH,SAAgB,YAAY,CACxB,SAAiB,EACjB,YAAgC,EAChC,QAAiB,EACjB,MAA0B,EAC1B,OAA+B,EAC/B,OAA+B,EAC/B,MAA6B,EAC7B,QAAiC;IAEjC;;OAEG;IACH,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,eAAK,CAAC,QAAQ,EAAgB,CAAC;IACrE;;OAEG;IACH,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|
4
|
-
*/
|
|
5
|
-
import { UserMeetingRole } from "@microsoft/live-share";
|
|
6
|
-
import React from "react";
|
|
7
|
-
import { ExtendedMediaMetadata, IMediaPlayer } from "@microsoft/live-share-media";
|
|
8
|
-
import { IUseMediaSynchronizerResults } from "../types/index.js";
|
|
9
|
-
/**
|
|
10
|
-
* React hook for using a Live Share media `MediaPlayerSynchronizer`.
|
|
11
|
-
*
|
|
12
|
-
* @remarks
|
|
13
|
-
* Use this hook if you want to synchronize the playback position of a video or audio element during a Live Share session.
|
|
14
|
-
* This hook can only be used in a child component of `<LiveShareProvider>` or `<AzureProvider>`.
|
|
15
|
-
*
|
|
16
|
-
* @param uniqueKey uniqueKey value for the `LiveMediaSession` DDS object used by `MediaPlayerSynchronizer`.
|
|
17
|
-
* @param mediaPlayerElement React RefObject containing object/element conforming to IMediaPlayer interface, `IMediaPlayer` object, or string id for <video> / <audio> element.
|
|
18
|
-
* @param initialTrack initial track to load. Either ExtendedMediaMetadata, trackId string, or null.
|
|
19
|
-
* @param allowedRoles Optional. Array of user roles that are eligible to modify group playback state.
|
|
20
|
-
* @param viewOnly Optional. Flag for whether or not the media synchronizer should be in viewOnly mode.
|
|
21
|
-
* @param canSendPositionUpdates Optional. Controls whether or not the local client is allowed to send position updates to the group.
|
|
22
|
-
* @returns IUseMediaSynchronizerResults object.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
```jsx
|
|
26
|
-
import { useMediaSynchronizer } from "@microsoft/live-share-react";
|
|
27
|
-
import { UserMeetingRole } from "@microsoft/live-share";
|
|
28
|
-
import { MediaPlayerSynchronizerEvents } from "@microsoft/live-share-media";
|
|
29
|
-
import { useRef, useEffect } from "react";
|
|
30
|
-
|
|
31
|
-
const ALLOWED_ROLES = [UserMeetingRole.organizer, UserMeetingRole.presenter];
|
|
32
|
-
|
|
33
|
-
const INITIAL_TRACK = "<YOUR_VIDEO_URL>";
|
|
34
|
-
|
|
35
|
-
// Define a unique key that distinguishes this `useMediaSynchronizer` from others in your app
|
|
36
|
-
const UNIQUE_KEY = "MEDIA-SESSION-ID";
|
|
37
|
-
|
|
38
|
-
export function VideoPlayer() {
|
|
39
|
-
const videoRef = useRef(null);
|
|
40
|
-
const { play, pause, seekTo, mediaSynchronizer } = useMediaSynchronizer(
|
|
41
|
-
UNIQUE_KEY,
|
|
42
|
-
videoRef,
|
|
43
|
-
INITIAL_TRACK,
|
|
44
|
-
ALLOWED_ROLES
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
// Listen for groupaction events (optional)
|
|
48
|
-
useEffect(() => {
|
|
49
|
-
// Listen for player group actions for errors (e.g., play error)
|
|
50
|
-
const onGroupAction = (evt: IMediaPlayerSynchronizerEvent) => {
|
|
51
|
-
// See which user made the change (e.g., to display a notification)
|
|
52
|
-
const clientInfo = await synchronizer.mediaSession.getClientInfo(evt.details.clientId);
|
|
53
|
-
};
|
|
54
|
-
mediaSynchronizer?.addEventListener(
|
|
55
|
-
MediaPlayerSynchronizerEvents.groupaction,
|
|
56
|
-
onGroupAction
|
|
57
|
-
);
|
|
58
|
-
return () => {
|
|
59
|
-
mediaSynchronizer?.removeEventListener(
|
|
60
|
-
MediaPlayerSynchronizerEvents.groupaction,
|
|
61
|
-
onGroupAction
|
|
62
|
-
);
|
|
63
|
-
};
|
|
64
|
-
}, [mediaSynchronizer]);
|
|
65
|
-
|
|
66
|
-
return (
|
|
67
|
-
<div>
|
|
68
|
-
<video ref={videoRef} />
|
|
69
|
-
<button onClick={play}>
|
|
70
|
-
Play
|
|
71
|
-
</button>
|
|
72
|
-
<button onClick={pause}>
|
|
73
|
-
Pause
|
|
74
|
-
</button>
|
|
75
|
-
<button onClick={() => {
|
|
76
|
-
seekTo(0);
|
|
77
|
-
}}>
|
|
78
|
-
Start over
|
|
79
|
-
</button>
|
|
80
|
-
</div>
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
```
|
|
84
|
-
*/
|
|
85
|
-
export declare function useMediaSynchronizer(uniqueKey: string, mediaPlayerElement: React.RefObject<IMediaPlayer> | IMediaPlayer | string | null, initialTrack: Partial<ExtendedMediaMetadata> | string | null, allowedRoles?: UserMeetingRole[], viewOnly?: boolean, canSendPositionUpdates?: boolean): IUseMediaSynchronizerResults;
|
|
86
|
-
//# sourceMappingURL=useMediaSynchronizer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useMediaSynchronizer.d.ts","sourceRoot":"","sources":["../../../src/live-hooks/useMediaSynchronizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEH,eAAe,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEH,qBAAqB,EACrB,YAAY,EAIf,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AAOjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2EG;AACH,wBAAgB,oBAAoB,CAChC,SAAS,EAAE,MAAM,EACjB,kBAAkB,EACZ,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,GAC7B,YAAY,GACZ,MAAM,GACN,IAAI,EACV,YAAY,EAAE,OAAO,CAAC,qBAAqB,CAAC,GAAG,MAAM,GAAG,IAAI,EAC5D,YAAY,CAAC,EAAE,eAAe,EAAE,EAChC,QAAQ,CAAC,EAAE,OAAO,EAClB,sBAAsB,CAAC,EAAE,OAAO,GACjC,4BAA4B,CAiP9B"}
|