@microsoft/live-share-react 1.0.0-preview.10 → 1.0.0-preview.11

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 (209) hide show
  1. package/README.md +88 -21
  2. package/package.json +13 -9
  3. package/src/live-hooks/useLiveCanvas.ts +11 -19
  4. package/src/live-hooks/useLiveEvent.ts +1 -1
  5. package/src/live-hooks/useLivePresence.ts +10 -9
  6. package/src/shared-hooks/index.ts +0 -1
  7. package/src/types/ActionTypes.ts +1 -1
  8. package/bin/index.d.ts +0 -7
  9. package/bin/index.d.ts.map +0 -1
  10. package/bin/index.js +0 -7
  11. package/bin/index.js.map +0 -1
  12. package/bin/interfaces/LiveInterfaceExtensions.d.ts +0 -9
  13. package/bin/interfaces/LiveInterfaceExtensions.d.ts.map +0 -1
  14. package/bin/interfaces/LiveInterfaceExtensions.js +0 -6
  15. package/bin/interfaces/LiveInterfaceExtensions.js.map +0 -1
  16. package/bin/interfaces/index.d.ts +0 -2
  17. package/bin/interfaces/index.d.ts.map +0 -1
  18. package/bin/interfaces/index.js +0 -2
  19. package/bin/interfaces/index.js.map +0 -1
  20. package/bin/internal-hooks/index.d.ts +0 -2
  21. package/bin/internal-hooks/index.d.ts.map +0 -1
  22. package/bin/internal-hooks/index.js +0 -2
  23. package/bin/internal-hooks/index.js.map +0 -1
  24. package/bin/internal-hooks/useDynamicDDSRegistry.d.ts +0 -14
  25. package/bin/internal-hooks/useDynamicDDSRegistry.d.ts.map +0 -1
  26. package/bin/internal-hooks/useDynamicDDSRegistry.js +0 -142
  27. package/bin/internal-hooks/useDynamicDDSRegistry.js.map +0 -1
  28. package/bin/internal-hooks/useSharedStateRegistry.d.ts +0 -31
  29. package/bin/internal-hooks/useSharedStateRegistry.d.ts.map +0 -1
  30. package/bin/internal-hooks/useSharedStateRegistry.js +0 -100
  31. package/bin/internal-hooks/useSharedStateRegistry.js.map +0 -1
  32. package/bin/internal-hooks/useStateRef.d.ts +0 -7
  33. package/bin/internal-hooks/useStateRef.d.ts.map +0 -1
  34. package/bin/internal-hooks/useStateRef.js +0 -15
  35. package/bin/internal-hooks/useStateRef.js.map +0 -1
  36. package/bin/live-hooks/index.d.ts +0 -7
  37. package/bin/live-hooks/index.d.ts.map +0 -1
  38. package/bin/live-hooks/index.js +0 -7
  39. package/bin/live-hooks/index.js.map +0 -1
  40. package/bin/live-hooks/useLiveAICompletion.d.ts +0 -29
  41. package/bin/live-hooks/useLiveAICompletion.d.ts.map +0 -1
  42. package/bin/live-hooks/useLiveAICompletion.js +0 -186
  43. package/bin/live-hooks/useLiveAICompletion.js.map +0 -1
  44. package/bin/live-hooks/useLiveCanvas.d.ts +0 -28
  45. package/bin/live-hooks/useLiveCanvas.d.ts.map +0 -1
  46. package/bin/live-hooks/useLiveCanvas.js +0 -167
  47. package/bin/live-hooks/useLiveCanvas.js.map +0 -1
  48. package/bin/live-hooks/useLiveCoPilot.d.ts +0 -28
  49. package/bin/live-hooks/useLiveCoPilot.d.ts.map +0 -1
  50. package/bin/live-hooks/useLiveCoPilot.js +0 -178
  51. package/bin/live-hooks/useLiveCoPilot.js.map +0 -1
  52. package/bin/live-hooks/useLiveEvent.d.ts +0 -22
  53. package/bin/live-hooks/useLiveEvent.d.ts.map +0 -1
  54. package/bin/live-hooks/useLiveEvent.js +0 -86
  55. package/bin/live-hooks/useLiveEvent.js.map +0 -1
  56. package/bin/live-hooks/useLivePresence.d.ts +0 -26
  57. package/bin/live-hooks/useLivePresence.d.ts.map +0 -1
  58. package/bin/live-hooks/useLivePresence.js +0 -93
  59. package/bin/live-hooks/useLivePresence.js.map +0 -1
  60. package/bin/live-hooks/useLiveState.d.ts +0 -19
  61. package/bin/live-hooks/useLiveState.d.ts.map +0 -1
  62. package/bin/live-hooks/useLiveState.js +0 -61
  63. package/bin/live-hooks/useLiveState.js.map +0 -1
  64. package/bin/live-hooks/useLiveTimer.d.ts +0 -8
  65. package/bin/live-hooks/useLiveTimer.d.ts.map +0 -1
  66. package/bin/live-hooks/useLiveTimer.js +0 -132
  67. package/bin/live-hooks/useLiveTimer.js.map +0 -1
  68. package/bin/live-hooks/useMediaSynchronizer.d.ts +0 -23
  69. package/bin/live-hooks/useMediaSynchronizer.d.ts.map +0 -1
  70. package/bin/live-hooks/useMediaSynchronizer.js +0 -162
  71. package/bin/live-hooks/useMediaSynchronizer.js.map +0 -1
  72. package/bin/live-share-turbo/AzureTurboClient.d.ts +0 -39
  73. package/bin/live-share-turbo/AzureTurboClient.d.ts.map +0 -1
  74. package/bin/live-share-turbo/AzureTurboClient.js +0 -56
  75. package/bin/live-share-turbo/AzureTurboClient.js.map +0 -1
  76. package/bin/live-share-turbo/LiveShareTurboClient.d.ts +0 -53
  77. package/bin/live-share-turbo/LiveShareTurboClient.d.ts.map +0 -1
  78. package/bin/live-share-turbo/LiveShareTurboClient.js +0 -69
  79. package/bin/live-share-turbo/LiveShareTurboClient.js.map +0 -1
  80. package/bin/live-share-turbo/dds-objects/TurboDataObject.d.ts +0 -31
  81. package/bin/live-share-turbo/dds-objects/TurboDataObject.d.ts.map +0 -1
  82. package/bin/live-share-turbo/dds-objects/TurboDataObject.js +0 -75
  83. package/bin/live-share-turbo/dds-objects/TurboDataObject.js.map +0 -1
  84. package/bin/live-share-turbo/dds-objects/TurboLiveCanvas.d.ts +0 -48
  85. package/bin/live-share-turbo/dds-objects/TurboLiveCanvas.d.ts.map +0 -1
  86. package/bin/live-share-turbo/dds-objects/TurboLiveCanvas.js +0 -104
  87. package/bin/live-share-turbo/dds-objects/TurboLiveCanvas.js.map +0 -1
  88. package/bin/live-share-turbo/dds-objects/TurboLiveEvent.d.ts +0 -28
  89. package/bin/live-share-turbo/dds-objects/TurboLiveEvent.d.ts.map +0 -1
  90. package/bin/live-share-turbo/dds-objects/TurboLiveEvent.js +0 -68
  91. package/bin/live-share-turbo/dds-objects/TurboLiveEvent.js.map +0 -1
  92. package/bin/live-share-turbo/dds-objects/TurboLiveMediaSession.d.ts +0 -60
  93. package/bin/live-share-turbo/dds-objects/TurboLiveMediaSession.d.ts.map +0 -1
  94. package/bin/live-share-turbo/dds-objects/TurboLiveMediaSession.js +0 -111
  95. package/bin/live-share-turbo/dds-objects/TurboLiveMediaSession.js.map +0 -1
  96. package/bin/live-share-turbo/dds-objects/TurboLivePresence.d.ts +0 -77
  97. package/bin/live-share-turbo/dds-objects/TurboLivePresence.d.ts.map +0 -1
  98. package/bin/live-share-turbo/dds-objects/TurboLivePresence.js +0 -137
  99. package/bin/live-share-turbo/dds-objects/TurboLivePresence.js.map +0 -1
  100. package/bin/live-share-turbo/dds-objects/TurboLiveState.d.ts +0 -30
  101. package/bin/live-share-turbo/dds-objects/TurboLiveState.d.ts.map +0 -1
  102. package/bin/live-share-turbo/dds-objects/TurboLiveState.js +0 -74
  103. package/bin/live-share-turbo/dds-objects/TurboLiveState.js.map +0 -1
  104. package/bin/live-share-turbo/dds-objects/TurboSharedMap.d.ts +0 -61
  105. package/bin/live-share-turbo/dds-objects/TurboSharedMap.d.ts.map +0 -1
  106. package/bin/live-share-turbo/dds-objects/TurboSharedMap.js +0 -108
  107. package/bin/live-share-turbo/dds-objects/TurboSharedMap.js.map +0 -1
  108. package/bin/live-share-turbo/dds-objects/index.d.ts +0 -8
  109. package/bin/live-share-turbo/dds-objects/index.d.ts.map +0 -1
  110. package/bin/live-share-turbo/dds-objects/index.js +0 -8
  111. package/bin/live-share-turbo/dds-objects/index.js.map +0 -1
  112. package/bin/live-share-turbo/index.d.ts +0 -5
  113. package/bin/live-share-turbo/index.d.ts.map +0 -1
  114. package/bin/live-share-turbo/index.js +0 -5
  115. package/bin/live-share-turbo/index.js.map +0 -1
  116. package/bin/live-share-turbo/interfaces/IFluidTurboClient.d.ts +0 -15
  117. package/bin/live-share-turbo/interfaces/IFluidTurboClient.d.ts.map +0 -1
  118. package/bin/live-share-turbo/interfaces/IFluidTurboClient.js +0 -2
  119. package/bin/live-share-turbo/interfaces/IFluidTurboClient.js.map +0 -1
  120. package/bin/live-share-turbo/interfaces/index.d.ts +0 -3
  121. package/bin/live-share-turbo/interfaces/index.d.ts.map +0 -1
  122. package/bin/live-share-turbo/interfaces/index.js +0 -3
  123. package/bin/live-share-turbo/interfaces/index.js.map +0 -1
  124. package/bin/live-share-turbo/internals/FluidTurboClient.d.ts +0 -39
  125. package/bin/live-share-turbo/internals/FluidTurboClient.d.ts.map +0 -1
  126. package/bin/live-share-turbo/internals/FluidTurboClient.js +0 -121
  127. package/bin/live-share-turbo/internals/FluidTurboClient.js.map +0 -1
  128. package/bin/live-share-turbo/internals/index.d.ts +0 -2
  129. package/bin/live-share-turbo/internals/index.d.ts.map +0 -1
  130. package/bin/live-share-turbo/internals/index.js +0 -2
  131. package/bin/live-share-turbo/internals/index.js.map +0 -1
  132. package/bin/live-share-turbo/internals/types.d.ts +0 -4
  133. package/bin/live-share-turbo/internals/types.d.ts.map +0 -1
  134. package/bin/live-share-turbo/internals/types.js +0 -2
  135. package/bin/live-share-turbo/internals/types.js.map +0 -1
  136. package/bin/providers/AzureProvider.d.ts +0 -34
  137. package/bin/providers/AzureProvider.d.ts.map +0 -1
  138. package/bin/providers/AzureProvider.js +0 -102
  139. package/bin/providers/AzureProvider.js.map +0 -1
  140. package/bin/providers/FluidContextProvider.d.ts +0 -34
  141. package/bin/providers/FluidContextProvider.d.ts.map +0 -1
  142. package/bin/providers/FluidContextProvider.js +0 -99
  143. package/bin/providers/FluidContextProvider.js.map +0 -1
  144. package/bin/providers/LiveShareContextProvider.d.ts +0 -42
  145. package/bin/providers/LiveShareContextProvider.d.ts.map +0 -1
  146. package/bin/providers/LiveShareContextProvider.js +0 -63
  147. package/bin/providers/LiveShareContextProvider.js.map +0 -1
  148. package/bin/providers/LiveShareProvider.d.ts +0 -42
  149. package/bin/providers/LiveShareProvider.d.ts.map +0 -1
  150. package/bin/providers/LiveShareProvider.js +0 -66
  151. package/bin/providers/LiveShareProvider.js.map +0 -1
  152. package/bin/providers/index.d.ts +0 -3
  153. package/bin/providers/index.d.ts.map +0 -1
  154. package/bin/providers/index.js +0 -3
  155. package/bin/providers/index.js.map +0 -1
  156. package/bin/shared-hooks/index.d.ts +0 -5
  157. package/bin/shared-hooks/index.d.ts.map +0 -1
  158. package/bin/shared-hooks/index.js +0 -5
  159. package/bin/shared-hooks/index.js.map +0 -1
  160. package/bin/shared-hooks/useDynamicDDS.d.ts +0 -19
  161. package/bin/shared-hooks/useDynamicDDS.d.ts.map +0 -1
  162. package/bin/shared-hooks/useDynamicDDS.js +0 -68
  163. package/bin/shared-hooks/useDynamicDDS.js.map +0 -1
  164. package/bin/shared-hooks/useLockedTask.d.ts +0 -11
  165. package/bin/shared-hooks/useLockedTask.d.ts.map +0 -1
  166. package/bin/shared-hooks/useLockedTask.js +0 -82
  167. package/bin/shared-hooks/useLockedTask.js.map +0 -1
  168. package/bin/shared-hooks/useSharedMap.d.ts +0 -22
  169. package/bin/shared-hooks/useSharedMap.d.ts.map +0 -1
  170. package/bin/shared-hooks/useSharedMap.js +0 -106
  171. package/bin/shared-hooks/useSharedMap.js.map +0 -1
  172. package/bin/shared-hooks/useSharedState.d.ts +0 -21
  173. package/bin/shared-hooks/useSharedState.d.ts.map +0 -1
  174. package/bin/shared-hooks/useSharedState.js +0 -63
  175. package/bin/shared-hooks/useSharedState.js.map +0 -1
  176. package/bin/shared-hooks/useTaskManager.d.ts +0 -13
  177. package/bin/shared-hooks/useTaskManager.d.ts.map +0 -1
  178. package/bin/shared-hooks/useTaskManager.js +0 -86
  179. package/bin/shared-hooks/useTaskManager.js.map +0 -1
  180. package/bin/types/ActionTypes.d.ts +0 -30
  181. package/bin/types/ActionTypes.d.ts.map +0 -1
  182. package/bin/types/ActionTypes.js +0 -6
  183. package/bin/types/ActionTypes.js.map +0 -1
  184. package/bin/types/PropTypes.d.ts +0 -8
  185. package/bin/types/PropTypes.d.ts.map +0 -1
  186. package/bin/types/PropTypes.js +0 -6
  187. package/bin/types/PropTypes.js.map +0 -1
  188. package/bin/types/ResultTypes.d.ts +0 -163
  189. package/bin/types/ResultTypes.d.ts.map +0 -1
  190. package/bin/types/ResultTypes.js +0 -6
  191. package/bin/types/ResultTypes.js.map +0 -1
  192. package/bin/types/index.d.ts +0 -4
  193. package/bin/types/index.d.ts.map +0 -1
  194. package/bin/types/index.js +0 -4
  195. package/bin/types/index.js.map +0 -1
  196. package/bin/utils/getContainerSchema.d.ts +0 -8
  197. package/bin/utils/getContainerSchema.d.ts.map +0 -1
  198. package/bin/utils/getContainerSchema.js +0 -41
  199. package/bin/utils/getContainerSchema.js.map +0 -1
  200. package/bin/utils/index.d.ts +0 -2
  201. package/bin/utils/index.d.ts.map +0 -1
  202. package/bin/utils/index.js +0 -2
  203. package/bin/utils/index.js.map +0 -1
  204. package/bin/utils/type-check.d.ts +0 -15
  205. package/bin/utils/type-check.d.ts.map +0 -1
  206. package/bin/utils/type-check.js +0 -54
  207. package/bin/utils/type-check.js.map +0 -1
  208. package/src/shared-hooks/useTaskManager.ts +0 -82
  209. package/tinylicious.log +0 -4
@@ -1,86 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import React from "react";
11
- import { useDynamicDDS } from "./useDynamicDDS";
12
- import { TaskManager } from "@fluid-experimental/task-manager";
13
- import { DynamicObjectRegistry } from "@microsoft/live-share";
14
- // Register TaskManager as dynamic object
15
- DynamicObjectRegistry.registerObjectClass(TaskManager, TaskManager.getFactory().type);
16
- /**
17
- * A hook for joining a queue to lock tasks for a given id. Guaranteed to have only one user assigned to a task at a time.
18
- *
19
- * @param uniqueKey the unique key for the TaskManager DDS
20
- * @param taskId the task id to lock
21
- * @returns stateful data about the status of the task lock
22
- */
23
- export const useTaskManager = (uniqueKey, taskId) => {
24
- /**
25
- * TaskId currently in queue for
26
- */
27
- const currentTaskIdRef = React.useRef(undefined);
28
- /**
29
- * Stateful boolean that is true when the user is currently assigned the task
30
- */
31
- const [lockedTask, setLockedTask] = React.useState(false);
32
- /**
33
- * User facing: dynamically load the TaskManager DDS for the given unique key.
34
- */
35
- const { dds: taskManager } = useDynamicDDS(uniqueKey, TaskManager);
36
- /**
37
- * When the task id changes, lock the task. When the task id is undefined, abandon the task.
38
- */
39
- React.useEffect(() => {
40
- let mounted = true;
41
- if (taskManager) {
42
- if (taskId && currentTaskIdRef.current !== taskId) {
43
- if (currentTaskIdRef.current) {
44
- taskManager.abandon(currentTaskIdRef.current);
45
- setLockedTask(false);
46
- }
47
- currentTaskIdRef.current = taskId;
48
- const onLockTask = () => __awaiter(void 0, void 0, void 0, function* () {
49
- try {
50
- yield taskManager.lockTask(taskId);
51
- if (mounted) {
52
- setLockedTask(true);
53
- }
54
- }
55
- catch (_a) {
56
- if (mounted) {
57
- setLockedTask(false);
58
- currentTaskIdRef.current = undefined;
59
- }
60
- }
61
- });
62
- onLockTask();
63
- }
64
- else if (!taskId && currentTaskIdRef.current) {
65
- taskManager.abandon(currentTaskIdRef.current);
66
- setLockedTask(false);
67
- currentTaskIdRef.current = undefined;
68
- }
69
- }
70
- /**
71
- * When the component unmounts, abandon the task if it is still locked
72
- */
73
- return () => {
74
- mounted = false;
75
- if (currentTaskIdRef.current) {
76
- taskManager === null || taskManager === void 0 ? void 0 : taskManager.abandon(currentTaskIdRef.current);
77
- }
78
- currentTaskIdRef.current = undefined;
79
- };
80
- }, [taskManager, taskId]);
81
- return {
82
- lockedTask,
83
- taskManager,
84
- };
85
- };
86
- //# sourceMappingURL=useTaskManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useTaskManager.js","sourceRoot":"","sources":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EAAE;4BACT,aAAa,CAAC,IAAI,CAAC,CAAC;yBACvB;qBACJ;oBAAC,WAAM;wBACJ,IAAI,OAAO,EAAE;4BACT,aAAa,CAAC,KAAK,CAAC,CAAC;4BACrB,gBAAgB,CAAC,OAAO,GAAG,SAAS,CAAC;yBACxC;qBACJ;gBACL,CAAC,CAAA,CAAA;gBACD,UAAU,EAAE,CAAC;aAChB;iBAAM,IAAI,CAAC,MAAM,IAAI,gBAAgB,CAAC,OAAO,EAAE;gBAC5C,WAAW,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;gBAC9C,aAAa,CAAC,KAAK,CAAC,CAAC;gBACrB,gBAAgB,CAAC,OAAO,GAAG,SAAS,CAAC;aACxC;SACJ;QACD;;WAEG;QACH,OAAO,GAAG,EAAE;YACR,OAAO,GAAG,KAAK,CAAC;YAChB,IAAI,gBAAgB,CAAC,OAAO,EAAE;gBAC1B,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;aAClD;YACD,gBAAgB,CAAC,OAAO,GAAG,SAAS,CAAC;QACzC,CAAC,CAAA;IACL,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;IAE1B,OAAO;QACH,UAAU;QACV,WAAW;KACd,CAAC;AACN,CAAC,CAAC"}
@@ -1,30 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the Microsoft Live Share SDK License.
4
- */
5
- import React from "react";
6
- import { IFluidLoadable } from "@fluidframework/core-interfaces";
7
- import { LoadableObjectClass } from "fluid-framework";
8
- import { ITimerConfig, PresenceState } from "@microsoft/live-share";
9
- export declare type SetSharedStateAction<T> = (state: T) => void;
10
- export declare type SetLocalStateAction = React.Dispatch<React.SetStateAction<any>>;
11
- export declare type RegisterDDSSetStateAction = <T extends IFluidLoadable>(uniqueKey: string, componentId: string, objectClass: LoadableObjectClass<T>, setLocalStateAction: SetLocalStateAction, onDidFirstInitialize?: (dds: T) => void) => void;
12
- export declare type UnregisterDDSSetStateAction = (uniqueKey: string, componentId: string) => void;
13
- export declare type RegisterSharedSetStateAction = (uniqueKey: string, componentId: string, setLocalStateAction: SetLocalStateAction) => void;
14
- export declare type UnregisterSharedSetStateAction = (uniqueKey: string, componentId: string) => void;
15
- export declare type UpdateSharedStateAction = (uniqueKey: string, value: any) => void;
16
- export declare type DeleteSharedStateAction = (uniqueKey: string) => void;
17
- export declare type DisposeSharedStateAction = () => void;
18
- export declare type SetLiveStateAction<TState = undefined> = (state: TState) => void;
19
- export declare type SendLiveEventAction<TEvent> = (event: TEvent) => void;
20
- export declare type OnReceivedLiveEventAction<TEvent> = (event: TEvent, local: boolean) => void;
21
- export declare type OnUpdateLivePresenceAction<TData extends object = object> = (state?: PresenceState | undefined, data?: TData | undefined) => void;
22
- export declare type OnStartTimerAction = (duration: number) => void;
23
- export declare type OnPlayTimerAction = () => void;
24
- export declare type OnPauseTimerAction = () => void;
25
- export declare type OnTimerTickAction = (milliRemaining: number) => void;
26
- export declare type OnTimerDidStartAction = (timerConfig: ITimerConfig) => void;
27
- export declare type OnTimerDidPauseAction = (timerConfig: ITimerConfig) => void;
28
- export declare type OnTimerDidPlayAction = (timerConfig: ITimerConfig) => void;
29
- export declare type OnTimerDidFinishAction = (timerConfig: ITimerConfig) => void;
30
- //# sourceMappingURL=ActionTypes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ActionTypes.d.ts","sourceRoot":"","sources":["../../src/types/ActionTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGpE,oBAAY,oBAAoB,CAAC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A0B,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,IAAI,CACpE,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,EACjC,IAAI,CAAC,EAAE,KAAK,GAAG,SAAS,KACvB,IAAI,CAAC;AAEV,oBAAY,kBAAkB,GAAG,CAC7B,QAAQ,EAAE,MAAM,KACf,IAAI,CAAC;AAEV,oBAAY,iBAAiB,GAAG,MAAM,IAAI,CAAC;AAE3C,oBAAY,kBAAkB,GAAG,MAAM,IAAI,CAAC;AAE5C,oBAAY,iBAAiB,GAAG,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;AACjE,oBAAY,qBAAqB,GAAG,CAAC,WAAW,EAAE,YAAY,KAAK,IAAI,CAAC;AACxE,oBAAY,qBAAqB,GAAG,CAAC,WAAW,EAAE,YAAY,KAAK,IAAI,CAAC;AACxE,oBAAY,oBAAoB,GAAG,CAAC,WAAW,EAAE,YAAY,KAAK,IAAI,CAAC;AACvE,oBAAY,sBAAsB,GAAG,CAAC,WAAW,EAAE,YAAY,KAAK,IAAI,CAAC"}
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the Microsoft Live Share SDK License.
4
- */
5
- export {};
6
- //# sourceMappingURL=ActionTypes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ActionTypes.js","sourceRoot":"","sources":["../../src/types/ActionTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -1,8 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the Microsoft Live Share SDK License.
4
- */
5
- export declare type SharedMapInitialData<T> = Map<string, T> | readonly (readonly [string, T])[] | {
6
- [key: string]: T;
7
- } | undefined;
8
- //# sourceMappingURL=PropTypes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PropTypes.d.ts","sourceRoot":"","sources":["../../src/types/PropTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,oBAAY,oBAAoB,CAAC,CAAC,IAC5B,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,GACd,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,GACjC;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAA;CAAE,GACpB,SAAS,CAAC"}
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the Microsoft Live Share SDK License.
4
- */
5
- export {};
6
- //# sourceMappingURL=PropTypes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PropTypes.js","sourceRoot":"","sources":["../../src/types/PropTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -1,163 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the Microsoft Live Share SDK License.
4
- */
5
- import { AzureContainerServices } from "@fluidframework/azure-client";
6
- import { ITimerConfig, LivePresenceUser, LiveEvent, LivePresence, LiveTimer } from "@microsoft/live-share";
7
- import { InkingManager, LiveCanvas } from "@microsoft/live-share-canvas";
8
- import { CoordinationWaitPoint, ExtendedMediaMetadata, MediaPlayerSynchronizer } from "@microsoft/live-share-media";
9
- import { IFluidContainer, SharedMap } from "fluid-framework";
10
- import { IReceiveLiveEvent } from "../interfaces";
11
- import { OnPauseTimerAction, OnPlayTimerAction, OnStartTimerAction, OnUpdateLivePresenceAction, SendLiveEventAction } from "./ActionTypes";
12
- export interface IAzureContainerResults {
13
- /**
14
- * Fluid Container.
15
- */
16
- container: IFluidContainer;
17
- /**
18
- * Azure container services which has information such as current socket connections.
19
- */
20
- services: AzureContainerServices;
21
- }
22
- export interface ILiveShareContainerResults extends IAzureContainerResults {
23
- /**
24
- * Whether the local user/client initially created the container.
25
- */
26
- created: boolean;
27
- }
28
- export interface IUseSharedMapResults<TData> {
29
- /**
30
- * Stateful map of most recent values from `SharedMap`.
31
- */
32
- map: ReadonlyMap<string, TData>;
33
- /**
34
- * Callback method to set/replace new entries in the `SharedMap`.
35
- */
36
- setEntry: (key: string, value: TData) => void;
37
- /**
38
- * Callback method to delete an existing entry in the `SharedMap`.
39
- */
40
- deleteEntry: (key: string) => void;
41
- /**
42
- * The Fluid `SharedMap` object, should you want to use it directly.
43
- */
44
- sharedMap: SharedMap | undefined;
45
- }
46
- export interface IUseLiveEventResults<TEvent extends object = object> {
47
- /**
48
- * The most recent event that has been received in the session.
49
- */
50
- latestEvent: IReceiveLiveEvent<TEvent> | undefined;
51
- /**
52
- * All received events since initializing this component, sorted from oldest -> newest.
53
- */
54
- allEvents: IReceiveLiveEvent<TEvent>[];
55
- /**
56
- * Callback method to send a new event to users in the session.
57
- */
58
- sendEvent: SendLiveEventAction<TEvent>;
59
- /**
60
- * The `LiveEvent` object, should you want to use it directly.
61
- */
62
- liveEvent: LiveEvent | undefined;
63
- }
64
- export interface IUseLiveTimerResults {
65
- /**
66
- * The current timer configuration.
67
- */
68
- timerConfig: ITimerConfig | undefined;
69
- /**
70
- * The time remaining in milliseconds.
71
- */
72
- milliRemaining: number | undefined;
73
- /**
74
- * The `LiveTimer` object, should you want to use it directly.
75
- */
76
- liveTimer: LiveTimer | undefined;
77
- /**
78
- * Start timer callback.
79
- */
80
- start: OnStartTimerAction;
81
- /**
82
- * Play timer callback.
83
- */
84
- play: OnPlayTimerAction;
85
- /**
86
- * Pause timer callback.
87
- */
88
- pause: OnPauseTimerAction;
89
- }
90
- export interface IUseLivePresenceResults<TData extends object = object> {
91
- /**
92
- * The local user's presence object.
93
- */
94
- localUser: LivePresenceUser<TData> | undefined;
95
- /**
96
- * List of non-local user's presence objects.
97
- */
98
- otherUsers: LivePresenceUser<TData>[];
99
- /**
100
- * List of all user's presence objects.
101
- */
102
- allUsers: LivePresenceUser<TData>[];
103
- /**
104
- * Live Share `LivePresence` object, should you want to use it directly.
105
- */
106
- livePresence: LivePresence<TData> | undefined;
107
- /**
108
- * Callback method to update the local user's presence.
109
- */
110
- updatePresence: OnUpdateLivePresenceAction<TData>;
111
- }
112
- export interface IUseMediaSynchronizerResults {
113
- /**
114
- * Stateful boolean on whether the session has an active suspension.
115
- */
116
- suspended: boolean;
117
- /**
118
- * Callback to initiate a play action for the group media session.
119
- */
120
- play: () => void;
121
- /**
122
- * Callback to initiate a pause action for the group media session.
123
- */
124
- pause: () => void;
125
- /**
126
- * Callback to initiate a seek action for the group media session.
127
- *
128
- * @param time timestamp of the video in seconds to seek to
129
- */
130
- seekTo: (time: number) => void;
131
- /**
132
- * Callback to change the track for the group media session.
133
- * @param track media metadata object, track src string, or null
134
- */
135
- setTrack: (track: Partial<ExtendedMediaMetadata> | string | null) => void;
136
- /**
137
- * Begin a new suspension. If a wait point is not set, the suspension will only impact the
138
- * local user.
139
- *
140
- * @param waitPoint Optional. Point in track to set the suspension at.
141
- * @see CoordinationWaitPoint
142
- */
143
- beginSuspension: (waitPoint?: CoordinationWaitPoint) => void;
144
- /**
145
- * End the currently active exception.
146
- */
147
- endSuspension: () => void;
148
- /**
149
- * Live Share `MediaPlayerSynchronizer` object, should you want to use it directly.
150
- */
151
- mediaSynchronizer: MediaPlayerSynchronizer | undefined;
152
- }
153
- export interface IUseLiveCanvasResults {
154
- /**
155
- * Inking manager for the canvas, which is synchronized by `liveCanvas`. It is set when loaded and undefined while loading.
156
- */
157
- inkingManager: InkingManager | undefined;
158
- /**
159
- * Live Canvas data object which synchronizes inking & cursors in the session. It is set when loaded and undefined while loading.
160
- */
161
- liveCanvas: LiveCanvas | undefined;
162
- }
163
- //# sourceMappingURL=ResultTypes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ResultTypes.d.ts","sourceRoot":"","sources":["../../src/types/ResultTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EACH,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,SAAS,EACZ,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7D;;OAEG;IACH,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B;;OAEG;IACH,iBAAiB,EAAE,uBAAuB,GAAG,SAAS,CAAC;CAC1D;AAED,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;IACzC;;OAEG;IACH,UAAU,EAAE,UAAU,GAAG,SAAS,CAAC;CACtC"}
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the Microsoft Live Share SDK License.
4
- */
5
- export {};
6
- //# sourceMappingURL=ResultTypes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ResultTypes.js","sourceRoot":"","sources":["../../src/types/ResultTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -1,4 +0,0 @@
1
- export * from "./ActionTypes";
2
- export * from "./ResultTypes";
3
- export * from "./PropTypes";
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from "./ActionTypes";
2
- export * from "./ResultTypes";
3
- export * from "./PropTypes";
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
@@ -1,8 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the Microsoft Live Share SDK License.
4
- */
5
- import { ContainerSchema, LoadableObjectClass } from "fluid-framework";
6
- export declare function getContainerSchema(additionalDynamicObjectTypes: LoadableObjectClass<any>[] | undefined): ContainerSchema;
7
- export declare function getLiveShareContainerSchema(additionalDynamicObjectTypes: LoadableObjectClass<any>[] | undefined): ContainerSchema;
8
- //# sourceMappingURL=getContainerSchema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getContainerSchema.d.ts","sourceRoot":"","sources":["../../src/utils/getContainerSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,OAAO,EACH,eAAe,EACf,mBAAmB,EAItB,MAAM,iBAAiB,CAAC;AAUzB,wBAAgB,kBAAkB,CAC9B,4BAA4B,EAAE,mBAAmB,CAAC,GAAG,CAAC,EAAE,GAAG,SAAS,GACrE,eAAe,CAUjB;AAED,wBAAgB,2BAA2B,CACvC,4BAA4B,EAAE,mBAAmB,CAAC,GAAG,CAAC,EAAE,GAAG,SAAS,mBAgBvE"}
@@ -1,41 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the Microsoft Live Share SDK License.
4
- */
5
- import { LiveEvent, LivePresence, LiveState, LiveTimer, } from "@microsoft/live-share";
6
- import { LiveCanvas } from "@microsoft/live-share-canvas";
7
- import { LiveMediaSession } from "@microsoft/live-share-media";
8
- import { SharedDirectory, SharedMap, SharedString, } from "fluid-framework";
9
- const schema = {
10
- initialObjects: {
11
- stateMap: SharedMap,
12
- dynamicObjects: SharedMap,
13
- },
14
- dynamicObjectTypes: [SharedMap, SharedString, SharedDirectory],
15
- };
16
- export function getContainerSchema(additionalDynamicObjectTypes) {
17
- const _additionalDynamicObjectTypes = additionalDynamicObjectTypes !== null && additionalDynamicObjectTypes !== void 0 ? additionalDynamicObjectTypes : [];
18
- return {
19
- initialObjects: schema.initialObjects,
20
- dynamicObjectTypes: [
21
- ...schema.dynamicObjectTypes,
22
- ..._additionalDynamicObjectTypes,
23
- ],
24
- };
25
- }
26
- export function getLiveShareContainerSchema(additionalDynamicObjectTypes) {
27
- const liveShareDynamicObjects = [
28
- LiveEvent,
29
- LivePresence,
30
- LiveState,
31
- LiveMediaSession,
32
- LiveTimer,
33
- LiveCanvas,
34
- ];
35
- const _additionalDynamicObjectTypes = additionalDynamicObjectTypes !== null && additionalDynamicObjectTypes !== void 0 ? additionalDynamicObjectTypes : [];
36
- return getContainerSchema([
37
- ...liveShareDynamicObjects,
38
- ..._additionalDynamicObjectTypes,
39
- ]);
40
- }
41
- //# sourceMappingURL=getContainerSchema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getContainerSchema.js","sourceRoot":"","sources":["../../src/utils/getContainerSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,SAAS,EACT,YAAY,EACZ,SAAS,EACT,SAAS,GACZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAGH,eAAe,EACf,SAAS,EACT,YAAY,GACf,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,GAAoB;IAC5B,cAAc,EAAE;QACZ,QAAQ,EAAE,SAAS;QACnB,cAAc,EAAE,SAAS;KAC5B;IACD,kBAAkB,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,eAAe,CAAC;CACjE,CAAC;AAEF,MAAM,UAAU,kBAAkB,CAC9B,4BAAoE;IAEpE,MAAM,6BAA6B,GAC/B,4BAA4B,aAA5B,4BAA4B,cAA5B,4BAA4B,GAAI,EAAE,CAAC;IACvC,OAAO;QACH,cAAc,EAAE,MAAM,CAAC,cAAc;QACrC,kBAAkB,EAAE;YAChB,GAAG,MAAM,CAAC,kBAAmB;YAC7B,GAAG,6BAA6B;SACnC;KACJ,CAAC;AACN,CAAC;AAED,MAAM,UAAU,2BAA2B,CACvC,4BAAoE;IAEpE,MAAM,uBAAuB,GAA+B;QACxD,SAAS;QACT,YAAY;QACZ,SAAS;QACT,gBAAgB;QAChB,SAAS;QACT,UAAU;KACb,CAAC;IACF,MAAM,6BAA6B,GAC/B,4BAA4B,aAA5B,4BAA4B,cAA5B,4BAA4B,GAAI,EAAE,CAAC;IACvC,OAAO,kBAAkB,CAAC;QACtB,GAAG,uBAAuB;QAC1B,GAAG,6BAA6B;KACnC,CAAC,CAAC;AACP,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from "./type-check";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from "./type-check";
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
@@ -1,15 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the Microsoft Live Share SDK License.
4
- */
5
- import { ExtendedMediaMetadata, IMediaPlayer } from "@microsoft/live-share-media";
6
- import React from "react";
7
- export declare function isRefObject<T>(value: any): value is React.RefObject<T>;
8
- export declare function isMediaElement(value: any): value is IMediaPlayer;
9
- export declare function isExtendedMediaMetadata(value: any): value is ExtendedMediaMetadata;
10
- export declare function isMap(value: any): value is Map<string, any>;
11
- export declare function isEntries(value: any): value is readonly (readonly [string, any])[];
12
- export declare function isJSON(value: any): value is {
13
- [key: string]: any;
14
- };
15
- //# sourceMappingURL=type-check.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"type-check.d.ts","sourceRoot":"","sources":["../../src/utils/type-check.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,qBAAqB,EACrB,YAAY,EACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAEtE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,YAAY,CAoBhE;AAED,wBAAgB,uBAAuB,CACnC,KAAK,EAAE,GAAG,GACX,KAAK,IAAI,qBAAqB,CAEhC;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAE3D;AAED,wBAAgB,SAAS,CACrB,KAAK,EAAE,GAAG,GACX,KAAK,IAAI,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,CAU9C;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAOlE"}
@@ -1,54 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the Microsoft Live Share SDK License.
4
- */
5
- export function isRefObject(value) {
6
- return value.current === null || !!value.current;
7
- }
8
- export function isMediaElement(value) {
9
- if (value) {
10
- return (value.currentSrc !== undefined &&
11
- value.currentTime !== undefined &&
12
- value.duration !== undefined &&
13
- value.ended !== undefined &&
14
- value.muted !== undefined &&
15
- value.paused !== undefined &&
16
- value.playbackRate !== undefined &&
17
- value.src !== undefined &&
18
- value.volume !== undefined &&
19
- value.load !== undefined &&
20
- value.pause !== undefined &&
21
- value.play !== undefined &&
22
- value.addEventListener !== undefined &&
23
- value.removeEventListener !== undefined);
24
- }
25
- return false;
26
- }
27
- export function isExtendedMediaMetadata(value) {
28
- return value === null || !!(value === null || value === void 0 ? void 0 : value.trackIdentifier);
29
- }
30
- export function isMap(value) {
31
- return value instanceof Map;
32
- }
33
- export function isEntries(value) {
34
- try {
35
- const tryValue = value;
36
- if (typeof tryValue[0][0] === "string") {
37
- return true;
38
- }
39
- return false;
40
- }
41
- catch (error) {
42
- return false;
43
- }
44
- }
45
- export function isJSON(value) {
46
- try {
47
- const tryValue = value;
48
- return Object.keys(tryValue).length > 0;
49
- }
50
- catch (error) {
51
- return false;
52
- }
53
- }
54
- //# sourceMappingURL=type-check.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"type-check.js","sourceRoot":"","sources":["../../src/utils/type-check.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,MAAM,UAAU,WAAW,CAAI,KAAU;IACrC,OAAO,KAAK,CAAC,OAAO,KAAK,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAU;IACrC,IAAI,KAAK,EAAE;QACP,OAAO,CACH,KAAK,CAAC,UAAU,KAAK,SAAS;YAC9B,KAAK,CAAC,WAAW,KAAK,SAAS;YAC/B,KAAK,CAAC,QAAQ,KAAK,SAAS;YAC5B,KAAK,CAAC,KAAK,KAAK,SAAS;YACzB,KAAK,CAAC,KAAK,KAAK,SAAS;YACzB,KAAK,CAAC,MAAM,KAAK,SAAS;YAC1B,KAAK,CAAC,YAAY,KAAK,SAAS;YAChC,KAAK,CAAC,GAAG,KAAK,SAAS;YACvB,KAAK,CAAC,MAAM,KAAK,SAAS;YAC1B,KAAK,CAAC,IAAI,KAAK,SAAS;YACxB,KAAK,CAAC,KAAK,KAAK,SAAS;YACzB,KAAK,CAAC,IAAI,KAAK,SAAS;YACxB,KAAK,CAAC,gBAAgB,KAAK,SAAS;YACpC,KAAK,CAAC,mBAAmB,KAAK,SAAS,CAC1C,CAAC;KACL;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,uBAAuB,CACnC,KAAU;IAEV,OAAO,KAAK,KAAK,IAAI,IAAI,CAAC,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,eAAe,CAAA,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,KAAU;IAC5B,OAAO,KAAK,YAAY,GAAG,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,SAAS,CACrB,KAAU;IAEV,IAAI;QACA,MAAM,QAAQ,GAAG,KAAyC,CAAC;QAC3D,IAAI,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE;YACpC,OAAO,IAAI,CAAC;SACf;QACD,OAAO,KAAK,CAAC;KAChB;IAAC,OAAO,KAAK,EAAE;QACZ,OAAO,KAAK,CAAC;KAChB;AACL,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,KAAU;IAC7B,IAAI;QACA,MAAM,QAAQ,GAAG,KAA+B,CAAC;QACjD,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;KAC3C;IAAC,OAAO,KAAK,EAAE;QACZ,OAAO,KAAK,CAAC;KAChB;AACL,CAAC"}
@@ -1,82 +0,0 @@
1
- import React from "react";
2
- import { useDynamicDDS } from "./useDynamicDDS";
3
- import { TaskManager } from "@fluid-experimental/task-manager";
4
- import { DynamicObjectRegistry } from "@microsoft/live-share";
5
-
6
- // Register TaskManager as dynamic object
7
- DynamicObjectRegistry.registerObjectClass(TaskManager, TaskManager.getFactory().type);
8
-
9
- /**
10
- * A hook for joining a queue to lock tasks for a given id. Guaranteed to have only one user assigned to a task at a time.
11
- *
12
- * @param uniqueKey the unique key for the TaskManager DDS
13
- * @param taskId the task id to lock
14
- * @returns stateful data about the status of the task lock
15
- */
16
- export const useTaskManager = (uniqueKey: string, taskId?: string): {
17
- lockedTask: boolean;
18
- taskManager: TaskManager | undefined;
19
- } => {
20
- /**
21
- * TaskId currently in queue for
22
- */
23
- const currentTaskIdRef = React.useRef<string | undefined>(undefined);
24
- /**
25
- * Stateful boolean that is true when the user is currently assigned the task
26
- */
27
- const [lockedTask, setLockedTask] = React.useState<boolean>(false);
28
-
29
- /**
30
- * User facing: dynamically load the TaskManager DDS for the given unique key.
31
- */
32
- const { dds: taskManager } = useDynamicDDS<TaskManager>(uniqueKey, TaskManager);
33
-
34
- /**
35
- * When the task id changes, lock the task. When the task id is undefined, abandon the task.
36
- */
37
- React.useEffect(() => {
38
- let mounted = true;
39
- if (taskManager) {
40
- if (taskId && currentTaskIdRef.current !== taskId) {
41
- if (currentTaskIdRef.current) {
42
- taskManager.abandon(currentTaskIdRef.current);
43
- setLockedTask(false);
44
- }
45
- currentTaskIdRef.current = taskId;
46
- const onLockTask = async () => {
47
- try {
48
- await taskManager.lockTask(taskId);
49
- if (mounted) {
50
- setLockedTask(true);
51
- }
52
- } catch {
53
- if (mounted) {
54
- setLockedTask(false);
55
- currentTaskIdRef.current = undefined;
56
- }
57
- }
58
- }
59
- onLockTask();
60
- } else if (!taskId && currentTaskIdRef.current) {
61
- taskManager.abandon(currentTaskIdRef.current);
62
- setLockedTask(false);
63
- currentTaskIdRef.current = undefined;
64
- }
65
- }
66
- /**
67
- * When the component unmounts, abandon the task if it is still locked
68
- */
69
- return () => {
70
- mounted = false;
71
- if (currentTaskIdRef.current) {
72
- taskManager?.abandon(currentTaskIdRef.current);
73
- }
74
- currentTaskIdRef.current = undefined;
75
- }
76
- }, [taskManager, taskId]);
77
-
78
- return {
79
- lockedTask,
80
- taskManager,
81
- };
82
- };
package/tinylicious.log DELETED
@@ -1,4 +0,0 @@
1
- npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
2
- info: Starting tinylicious@1.0.0-preview.4 {"label":"winston","timestamp":"2023-02-07T05:25:11.899Z"}
3
- info: Listening on port 7070 {"label":"winston","timestamp":"2023-02-07T05:25:11.921Z"}
4
- info: HEAD / 200 3.535 ms - 107 {"label":"winston","timestamp":"2023-02-07T05:25:13.499Z"}