@microsoft/live-share-react 1.0.0-preview.5

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 (233) hide show
  1. package/.nycrc.json +10 -0
  2. package/LICENSE +87 -0
  3. package/README.md +543 -0
  4. package/bin/index.d.ts +7 -0
  5. package/bin/index.d.ts.map +1 -0
  6. package/bin/index.js +7 -0
  7. package/bin/index.js.map +1 -0
  8. package/bin/interfaces/LiveInterfaceExtensions.d.ts +9 -0
  9. package/bin/interfaces/LiveInterfaceExtensions.d.ts.map +1 -0
  10. package/bin/interfaces/LiveInterfaceExtensions.js +6 -0
  11. package/bin/interfaces/LiveInterfaceExtensions.js.map +1 -0
  12. package/bin/interfaces/index.d.ts +2 -0
  13. package/bin/interfaces/index.d.ts.map +1 -0
  14. package/bin/interfaces/index.js +2 -0
  15. package/bin/interfaces/index.js.map +1 -0
  16. package/bin/internal-hooks/index.d.ts +2 -0
  17. package/bin/internal-hooks/index.d.ts.map +1 -0
  18. package/bin/internal-hooks/index.js +2 -0
  19. package/bin/internal-hooks/index.js.map +1 -0
  20. package/bin/internal-hooks/useDynamicDDSRegistry.d.ts +14 -0
  21. package/bin/internal-hooks/useDynamicDDSRegistry.d.ts.map +1 -0
  22. package/bin/internal-hooks/useDynamicDDSRegistry.js +142 -0
  23. package/bin/internal-hooks/useDynamicDDSRegistry.js.map +1 -0
  24. package/bin/internal-hooks/useSharedStateRegistry.d.ts +31 -0
  25. package/bin/internal-hooks/useSharedStateRegistry.d.ts.map +1 -0
  26. package/bin/internal-hooks/useSharedStateRegistry.js +100 -0
  27. package/bin/internal-hooks/useSharedStateRegistry.js.map +1 -0
  28. package/bin/internal-hooks/useStateRef.d.ts +7 -0
  29. package/bin/internal-hooks/useStateRef.d.ts.map +1 -0
  30. package/bin/internal-hooks/useStateRef.js +15 -0
  31. package/bin/internal-hooks/useStateRef.js.map +1 -0
  32. package/bin/live-hooks/index.d.ts +7 -0
  33. package/bin/live-hooks/index.d.ts.map +1 -0
  34. package/bin/live-hooks/index.js +7 -0
  35. package/bin/live-hooks/index.js.map +1 -0
  36. package/bin/live-hooks/useLiveAICompletion.d.ts +29 -0
  37. package/bin/live-hooks/useLiveAICompletion.d.ts.map +1 -0
  38. package/bin/live-hooks/useLiveAICompletion.js +186 -0
  39. package/bin/live-hooks/useLiveAICompletion.js.map +1 -0
  40. package/bin/live-hooks/useLiveCanvas.d.ts +28 -0
  41. package/bin/live-hooks/useLiveCanvas.d.ts.map +1 -0
  42. package/bin/live-hooks/useLiveCanvas.js +167 -0
  43. package/bin/live-hooks/useLiveCanvas.js.map +1 -0
  44. package/bin/live-hooks/useLiveCoPilot.d.ts +28 -0
  45. package/bin/live-hooks/useLiveCoPilot.d.ts.map +1 -0
  46. package/bin/live-hooks/useLiveCoPilot.js +178 -0
  47. package/bin/live-hooks/useLiveCoPilot.js.map +1 -0
  48. package/bin/live-hooks/useLiveEvent.d.ts +22 -0
  49. package/bin/live-hooks/useLiveEvent.d.ts.map +1 -0
  50. package/bin/live-hooks/useLiveEvent.js +86 -0
  51. package/bin/live-hooks/useLiveEvent.js.map +1 -0
  52. package/bin/live-hooks/useLivePresence.d.ts +26 -0
  53. package/bin/live-hooks/useLivePresence.d.ts.map +1 -0
  54. package/bin/live-hooks/useLivePresence.js +93 -0
  55. package/bin/live-hooks/useLivePresence.js.map +1 -0
  56. package/bin/live-hooks/useLiveState.d.ts +20 -0
  57. package/bin/live-hooks/useLiveState.d.ts.map +1 -0
  58. package/bin/live-hooks/useLiveState.js +71 -0
  59. package/bin/live-hooks/useLiveState.js.map +1 -0
  60. package/bin/live-hooks/useLiveTimer.d.ts +8 -0
  61. package/bin/live-hooks/useLiveTimer.d.ts.map +1 -0
  62. package/bin/live-hooks/useLiveTimer.js +132 -0
  63. package/bin/live-hooks/useLiveTimer.js.map +1 -0
  64. package/bin/live-hooks/useMediaSynchronizer.d.ts +23 -0
  65. package/bin/live-hooks/useMediaSynchronizer.d.ts.map +1 -0
  66. package/bin/live-hooks/useMediaSynchronizer.js +162 -0
  67. package/bin/live-hooks/useMediaSynchronizer.js.map +1 -0
  68. package/bin/live-share-turbo/AzureTurboClient.d.ts +39 -0
  69. package/bin/live-share-turbo/AzureTurboClient.d.ts.map +1 -0
  70. package/bin/live-share-turbo/AzureTurboClient.js +56 -0
  71. package/bin/live-share-turbo/AzureTurboClient.js.map +1 -0
  72. package/bin/live-share-turbo/LiveShareTurboClient.d.ts +53 -0
  73. package/bin/live-share-turbo/LiveShareTurboClient.d.ts.map +1 -0
  74. package/bin/live-share-turbo/LiveShareTurboClient.js +69 -0
  75. package/bin/live-share-turbo/LiveShareTurboClient.js.map +1 -0
  76. package/bin/live-share-turbo/dds-objects/TurboDataObject.d.ts +31 -0
  77. package/bin/live-share-turbo/dds-objects/TurboDataObject.d.ts.map +1 -0
  78. package/bin/live-share-turbo/dds-objects/TurboDataObject.js +75 -0
  79. package/bin/live-share-turbo/dds-objects/TurboDataObject.js.map +1 -0
  80. package/bin/live-share-turbo/dds-objects/TurboLiveCanvas.d.ts +48 -0
  81. package/bin/live-share-turbo/dds-objects/TurboLiveCanvas.d.ts.map +1 -0
  82. package/bin/live-share-turbo/dds-objects/TurboLiveCanvas.js +104 -0
  83. package/bin/live-share-turbo/dds-objects/TurboLiveCanvas.js.map +1 -0
  84. package/bin/live-share-turbo/dds-objects/TurboLiveEvent.d.ts +28 -0
  85. package/bin/live-share-turbo/dds-objects/TurboLiveEvent.d.ts.map +1 -0
  86. package/bin/live-share-turbo/dds-objects/TurboLiveEvent.js +68 -0
  87. package/bin/live-share-turbo/dds-objects/TurboLiveEvent.js.map +1 -0
  88. package/bin/live-share-turbo/dds-objects/TurboLiveMediaSession.d.ts +60 -0
  89. package/bin/live-share-turbo/dds-objects/TurboLiveMediaSession.d.ts.map +1 -0
  90. package/bin/live-share-turbo/dds-objects/TurboLiveMediaSession.js +111 -0
  91. package/bin/live-share-turbo/dds-objects/TurboLiveMediaSession.js.map +1 -0
  92. package/bin/live-share-turbo/dds-objects/TurboLivePresence.d.ts +77 -0
  93. package/bin/live-share-turbo/dds-objects/TurboLivePresence.d.ts.map +1 -0
  94. package/bin/live-share-turbo/dds-objects/TurboLivePresence.js +137 -0
  95. package/bin/live-share-turbo/dds-objects/TurboLivePresence.js.map +1 -0
  96. package/bin/live-share-turbo/dds-objects/TurboLiveState.d.ts +30 -0
  97. package/bin/live-share-turbo/dds-objects/TurboLiveState.d.ts.map +1 -0
  98. package/bin/live-share-turbo/dds-objects/TurboLiveState.js +74 -0
  99. package/bin/live-share-turbo/dds-objects/TurboLiveState.js.map +1 -0
  100. package/bin/live-share-turbo/dds-objects/TurboSharedMap.d.ts +61 -0
  101. package/bin/live-share-turbo/dds-objects/TurboSharedMap.d.ts.map +1 -0
  102. package/bin/live-share-turbo/dds-objects/TurboSharedMap.js +108 -0
  103. package/bin/live-share-turbo/dds-objects/TurboSharedMap.js.map +1 -0
  104. package/bin/live-share-turbo/dds-objects/index.d.ts +8 -0
  105. package/bin/live-share-turbo/dds-objects/index.d.ts.map +1 -0
  106. package/bin/live-share-turbo/dds-objects/index.js +8 -0
  107. package/bin/live-share-turbo/dds-objects/index.js.map +1 -0
  108. package/bin/live-share-turbo/index.d.ts +5 -0
  109. package/bin/live-share-turbo/index.d.ts.map +1 -0
  110. package/bin/live-share-turbo/index.js +5 -0
  111. package/bin/live-share-turbo/index.js.map +1 -0
  112. package/bin/live-share-turbo/interfaces/IFluidTurboClient.d.ts +15 -0
  113. package/bin/live-share-turbo/interfaces/IFluidTurboClient.d.ts.map +1 -0
  114. package/bin/live-share-turbo/interfaces/IFluidTurboClient.js +2 -0
  115. package/bin/live-share-turbo/interfaces/IFluidTurboClient.js.map +1 -0
  116. package/bin/live-share-turbo/interfaces/index.d.ts +3 -0
  117. package/bin/live-share-turbo/interfaces/index.d.ts.map +1 -0
  118. package/bin/live-share-turbo/interfaces/index.js +3 -0
  119. package/bin/live-share-turbo/interfaces/index.js.map +1 -0
  120. package/bin/live-share-turbo/internals/FluidTurboClient.d.ts +39 -0
  121. package/bin/live-share-turbo/internals/FluidTurboClient.d.ts.map +1 -0
  122. package/bin/live-share-turbo/internals/FluidTurboClient.js +121 -0
  123. package/bin/live-share-turbo/internals/FluidTurboClient.js.map +1 -0
  124. package/bin/live-share-turbo/internals/index.d.ts +2 -0
  125. package/bin/live-share-turbo/internals/index.d.ts.map +1 -0
  126. package/bin/live-share-turbo/internals/index.js +2 -0
  127. package/bin/live-share-turbo/internals/index.js.map +1 -0
  128. package/bin/live-share-turbo/internals/types.d.ts +4 -0
  129. package/bin/live-share-turbo/internals/types.d.ts.map +1 -0
  130. package/bin/live-share-turbo/internals/types.js +2 -0
  131. package/bin/live-share-turbo/internals/types.js.map +1 -0
  132. package/bin/providers/AzureProvider.d.ts +34 -0
  133. package/bin/providers/AzureProvider.d.ts.map +1 -0
  134. package/bin/providers/AzureProvider.js +102 -0
  135. package/bin/providers/AzureProvider.js.map +1 -0
  136. package/bin/providers/FluidContextProvider.d.ts +34 -0
  137. package/bin/providers/FluidContextProvider.d.ts.map +1 -0
  138. package/bin/providers/FluidContextProvider.js +99 -0
  139. package/bin/providers/FluidContextProvider.js.map +1 -0
  140. package/bin/providers/LiveShareContextProvider.d.ts +42 -0
  141. package/bin/providers/LiveShareContextProvider.d.ts.map +1 -0
  142. package/bin/providers/LiveShareContextProvider.js +63 -0
  143. package/bin/providers/LiveShareContextProvider.js.map +1 -0
  144. package/bin/providers/LiveShareProvider.d.ts +42 -0
  145. package/bin/providers/LiveShareProvider.d.ts.map +1 -0
  146. package/bin/providers/LiveShareProvider.js +66 -0
  147. package/bin/providers/LiveShareProvider.js.map +1 -0
  148. package/bin/providers/index.d.ts +3 -0
  149. package/bin/providers/index.d.ts.map +1 -0
  150. package/bin/providers/index.js +3 -0
  151. package/bin/providers/index.js.map +1 -0
  152. package/bin/shared-hooks/index.d.ts +5 -0
  153. package/bin/shared-hooks/index.d.ts.map +1 -0
  154. package/bin/shared-hooks/index.js +5 -0
  155. package/bin/shared-hooks/index.js.map +1 -0
  156. package/bin/shared-hooks/useDynamicDDS.d.ts +19 -0
  157. package/bin/shared-hooks/useDynamicDDS.d.ts.map +1 -0
  158. package/bin/shared-hooks/useDynamicDDS.js +68 -0
  159. package/bin/shared-hooks/useDynamicDDS.js.map +1 -0
  160. package/bin/shared-hooks/useLockedTask.d.ts +11 -0
  161. package/bin/shared-hooks/useLockedTask.d.ts.map +1 -0
  162. package/bin/shared-hooks/useLockedTask.js +82 -0
  163. package/bin/shared-hooks/useLockedTask.js.map +1 -0
  164. package/bin/shared-hooks/useSharedMap.d.ts +22 -0
  165. package/bin/shared-hooks/useSharedMap.d.ts.map +1 -0
  166. package/bin/shared-hooks/useSharedMap.js +106 -0
  167. package/bin/shared-hooks/useSharedMap.js.map +1 -0
  168. package/bin/shared-hooks/useSharedState.d.ts +21 -0
  169. package/bin/shared-hooks/useSharedState.d.ts.map +1 -0
  170. package/bin/shared-hooks/useSharedState.js +63 -0
  171. package/bin/shared-hooks/useSharedState.js.map +1 -0
  172. package/bin/shared-hooks/useTaskManager.d.ts +13 -0
  173. package/bin/shared-hooks/useTaskManager.d.ts.map +1 -0
  174. package/bin/shared-hooks/useTaskManager.js +86 -0
  175. package/bin/shared-hooks/useTaskManager.js.map +1 -0
  176. package/bin/types/ActionTypes.d.ts +30 -0
  177. package/bin/types/ActionTypes.d.ts.map +1 -0
  178. package/bin/types/ActionTypes.js +6 -0
  179. package/bin/types/ActionTypes.js.map +1 -0
  180. package/bin/types/PropTypes.d.ts +8 -0
  181. package/bin/types/PropTypes.d.ts.map +1 -0
  182. package/bin/types/PropTypes.js +6 -0
  183. package/bin/types/PropTypes.js.map +1 -0
  184. package/bin/types/ResultTypes.d.ts +163 -0
  185. package/bin/types/ResultTypes.d.ts.map +1 -0
  186. package/bin/types/ResultTypes.js +6 -0
  187. package/bin/types/ResultTypes.js.map +1 -0
  188. package/bin/types/index.d.ts +4 -0
  189. package/bin/types/index.d.ts.map +1 -0
  190. package/bin/types/index.js +4 -0
  191. package/bin/types/index.js.map +1 -0
  192. package/bin/utils/getContainerSchema.d.ts +8 -0
  193. package/bin/utils/getContainerSchema.d.ts.map +1 -0
  194. package/bin/utils/getContainerSchema.js +41 -0
  195. package/bin/utils/getContainerSchema.js.map +1 -0
  196. package/bin/utils/index.d.ts +2 -0
  197. package/bin/utils/index.d.ts.map +1 -0
  198. package/bin/utils/index.js +2 -0
  199. package/bin/utils/index.js.map +1 -0
  200. package/bin/utils/type-check.d.ts +15 -0
  201. package/bin/utils/type-check.d.ts.map +1 -0
  202. package/bin/utils/type-check.js +54 -0
  203. package/bin/utils/type-check.js.map +1 -0
  204. package/package.json +47 -0
  205. package/src/index.ts +6 -0
  206. package/src/interfaces/LiveInterfaceExtensions.ts +9 -0
  207. package/src/interfaces/index.ts +1 -0
  208. package/src/internal-hooks/index.ts +1 -0
  209. package/src/internal-hooks/useSharedStateRegistry.ts +163 -0
  210. package/src/live-hooks/index.ts +6 -0
  211. package/src/live-hooks/useLiveCanvas.ts +198 -0
  212. package/src/live-hooks/useLiveEvent.ts +117 -0
  213. package/src/live-hooks/useLivePresence.ts +124 -0
  214. package/src/live-hooks/useLiveState.ts +108 -0
  215. package/src/live-hooks/useLiveTimer.ts +184 -0
  216. package/src/live-hooks/useMediaSynchronizer.ts +200 -0
  217. package/src/providers/AzureProvider.tsx +177 -0
  218. package/src/providers/LiveShareProvider.tsx +140 -0
  219. package/src/providers/index.ts +2 -0
  220. package/src/shared-hooks/index.ts +4 -0
  221. package/src/shared-hooks/useDynamicDDS.ts +71 -0
  222. package/src/shared-hooks/useSharedMap.ts +132 -0
  223. package/src/shared-hooks/useSharedState.ts +85 -0
  224. package/src/shared-hooks/useTaskManager.ts +82 -0
  225. package/src/types/ActionTypes.ts +76 -0
  226. package/src/types/PropTypes.ts +10 -0
  227. package/src/types/ResultTypes.ts +187 -0
  228. package/src/types/index.ts +3 -0
  229. package/src/utils/index.ts +1 -0
  230. package/src/utils/type-check.ts +69 -0
  231. package/tinylicious.log +4 -0
  232. package/tsconfig.build.json +6 -0
  233. package/tsconfig.json +72 -0
package/.nycrc.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "cache": false,
3
+ "extension": [".ts"],
4
+ "check-coverage": true,
5
+ "include": ["src/**"],
6
+ "statements": 90,
7
+ "branches": 90,
8
+ "functions": 95,
9
+ "lines": 90
10
+ }
package/LICENSE ADDED
@@ -0,0 +1,87 @@
1
+ MICROSOFT SOFTWARE LICENSE TERMS
2
+
3
+ MICROSOFT LIVE SHARE SDK – PRE-RELEASE VERSION
4
+ ________________________________________
5
+
6
+ These license terms are an agreement between you and Microsoft Corporation (or one of its affiliates). They apply to the software named above and any Microsoft services or software updates (except to the extent such services or updates are accompanied by new or additional terms, in which case those different terms apply prospectively and do not alter your or Microsoft’s rights relating to pre-updated software or services). IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW. BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS.
7
+
8
+ 1. INSTALLATION AND USE RIGHTS.
9
+ a) General. You may install and use any number of copies of the software to develop and test your applications, solely for the purpose stated in 1(b) below and otherwise for your internal business purposes.
10
+ b) Purpose. The use of this license provided under these terms is specifically limited to developing applications that interact solely within the Microsoft Teams Ecosystem. You may distribute the software according to Section 3 of these terms.
11
+ c) Third Party Components. The software may include third party components with separate legal notices or governed by other agreements, as may be described in the ThirdPartyNotices file(s) accompanying the software.
12
+ d) Microsoft Terms of Use. Some features of the software provide access to, or rely on, online services. The use of those services (but not the software) is governed by separate terms. This includes the Microsoft APIs Terms of Use which can be found at https://docs.microsoft.com/en-us/legal/microsoft-apis/terms-of-use and the Supplemental Terms of Use for Microsoft Azure which can be found at https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms. Please read them. The services may not be available in all regions.
13
+
14
+ 2. PRE-RELEASE SOFTWARE. The software is a pre-release version, and comes with no warranties as provided under Section 13. It may not operate correctly. We may change or discontinue the software at any time without notice. We may also choose not to make this software generally commercially available. It may be different from the commercially released version.
15
+
16
+ 3. DISTRIBUTABLE CODE. The software contains code you are permitted to distribute (i.e. make available for third parties) in applications you develop, as described in this Section.
17
+ a) Distribution Rights. The code and test files are distributable if included with the software.
18
+ i. Third Party Distribution. You may permit distributors of your applications to copy and distribute any of this distributable code you elect to distribute with your applications.
19
+ b) Distribution Requirements. For any code you distribute, you must:
20
+ i. adhere to the Purpose stated in Section 1(b); and
21
+ ii. indemnify, defend, and hold harmless Microsoft from any claims, including attorneys’ fees, related to the distribution or use of your applications, except to the extent that any claim is based solely on the unmodified distributable code.
22
+ c) Distribution Restrictions. You may not:
23
+ i. use Microsoft’s trademarks or trade dress in your application in any way that suggests your application comes from or is endorsed by Microsoft; or
24
+ ii. modify or distribute the source code of any distributable code so that any part of it becomes subject to any license that requires that the distributable code, any other part of the software, or any of Microsoft’s other intellectual property be disclosed or distributed in source code form, or that others have the right to modify it.
25
+
26
+ 4. SCOPE OF LICENSE. The software is licensed, not sold. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you will not (and have no right to):
27
+ a) remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software;software;
28
+ b) use the software in any way that is against the law or to create or propagate malware; or
29
+ c) share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.
30
+
31
+ 5. Data Protection. There are also some features in the software that may enable you to collect data from users of your applications. If you use these features to enable data collection in your applications, you must comply with applicable law, including providing appropriate notices to and obtaining consent from users of your applications. You can learn more about data collection and use in the help documentation and the privacy statement at https://aka.ms/privacy. Your use of the software operates as your consent to these practices.
32
+
33
+ 6. CODE OF CONDUCT. By agreeing to these license terms, you’re agreeing that, when using the software, you will follow these rules:
34
+ a) Don’t do anything illegal.
35
+ b) Don’t engage in any activity that exploits, harms, or threatens to harm children.
36
+ c) Don’t send spam. Spam is unwanted or unsolicited bulk email, postings, contact requests, SMS (text messages), or instant messages.
37
+ d) Don’t publicly display or use the software to share inappropriate content or material (involving, for example, nudity, bestiality, pornography, offensive language, graphic violence, or criminal activity).
38
+ e) Don’t engage in activity that is fraudulent, false or misleading (e.g., asking for money under false pretenses, impersonating someone else, manipulating the software to increase play count, or affect rankings, ratings, or comments).
39
+ f) Don’t circumvent any restrictions on access to or availability of the software.
40
+ g) Don’t engage in activity that is harmful to you, the software, or others (e.g., transmitting viruses, stalking, posting terrorist content, communicating hate speech, or advocating violence against others).
41
+ h) Don’t infringe upon the rights of others (e.g., unauthorized sharing of copyrighted music or other copyrighted material, resale or other distribution of Bing maps, or photographs).
42
+ i) Don’t engage in activity that violates the privacy of others.
43
+ j) Don’t help others break these rules.
44
+
45
+ 7. EXPORT RESTRICTIONS. You must comply with all domestic and international export laws and regulations that apply to the software, which include restrictions on destinations, end users, and end use. For further information on export restrictions, visit https://aka.ms/exporting.
46
+
47
+ 8. SUPPORT SERVICES. Microsoft is not obligated under this agreement to provide any support services for the software. Any support provided is “as is”, “with all faults”, and without warranty of any kind.
48
+
49
+ 9. ENTIRE AGREEMENT. This agreement, terms referenced herein, and any other terms Microsoft may provide for supplements, updates, or third-party applications, is the entire agreement for the software.
50
+
51
+ 10. APPLICABLE LAW AND PLACE TO RESOLVE DISPUTES. If you acquired the software in the United States or Canada, the laws of the state or province where you live (or, if a business, where your principal place of business is located) govern the interpretation of this agreement, claims for its breach, and all other claims (including consumer protection, unfair competition, and tort claims), regardless of conflict of laws principles, except that the FAA governs everything related to arbitration. If you acquired the software in any other country, its laws apply, except that the FAA governs everything related to arbitration. If U.S. federal jurisdiction exists, you and Microsoft consent to exclusive jurisdiction and venue in the federal court in King County, Washington for all disputes heard in court (excluding arbitration). If not, you and Microsoft consent to exclusive jurisdiction and venue in the Superior Court of King County, Washington for all disputes heard in court (excluding arbitration).
52
+
53
+ 11. CONSUMER RIGHTS; REGIONAL VARIATIONS. This agreement describes certain legal rights. You may have other rights, including consumer rights, under the laws of your state or country. Separate and apart from your relationship with Microsoft, you may also have rights with respect to the party from which you acquired the software. This agreement does not change those other rights if the laws of your state or country do not permit it to do so. For example, if you acquired the software in one of the below regions, or mandatory country law applies, then the following provisions apply to you:
54
+ a. Australia. You have statutory guarantees under the Australian Consumer Law and nothing in this agreement is intended to affect those rights.
55
+ b. Canada. If you acquired this software in Canada, you may stop receiving updates by turning off the automatic update feature, disconnecting your device from the Internet (if and when you re-connect to the Internet, however, the software will resume checking for and installing updates), or uninstalling the software. The product documentation, if any, may also specify how to turn off updates for your specific device or software.
56
+ c. Germany and Austria.
57
+ • Warranty. The properly licensed software will perform substantially as described in any Microsoft materials that accompany the software. However, Microsoft gives no contractual guarantee in relation to the licensed software.
58
+ • Limitation of Liability. In case of intentional conduct, gross negligence, claims based on the Product Liability Act, as well as, in case of death or personal or physical injury, Microsoft is liable according to the statutory law.
59
+ • Subject to the foregoing clause ii., Microsoft will only be liable for slight negligence if Microsoft is in breach of such material contractual obligations, the fulfillment of which facilitate the due performance of this agreement, the breach of which would endanger the purpose of this agreement and the compliance with which a party may constantly trust in (so-called "cardinal obligations"). In other cases of slight negligence, Microsoft will not be liable for slight negligence.
60
+
61
+ 12. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS IS.” YOU BEAR THE RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES, OR CONDITIONS. TO THE EXTENT PERMITTED UNDER APPLICABLE LAWS, MICROSOFT EXCLUDES ALL IMPLIED WARRANTIES, INCLUDING MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
62
+
63
+ 13. PRE-RELEASE DISCLAIMER. AS A PRE-RELEASE VERSION, THIS SOFTWARE AND UNDERLYING SERVICES, ARE PROVIDED "AS-IS," "WITH ALL FAULTS," AND "AS AVAILABLE," AND ARE EXCLUDED FROM THE SERVICE LEVEL AGREEMENTS AND LIMITED WARRANTY. Pre-release versions may not be covered by customer support, and may be subject to reduced or different security, compliance and privacy commitments, as further explained in the Microsoft Privacy Statement, Microsoft Azure Trust Center, the Product Terms, the DPA, and any additional notices provided with the software. Where applicable, the following terms in the DPA do not apply to Previews: Processing of Personal Data; GDPR, Data Security.
64
+
65
+ 14. LIMITATION ON AND EXCLUSION OF DAMAGES. IF YOU HAVE ANY BASIS FOR RECOVERING DAMAGES DESPITE THE PRECEDING DISCLAIMER OF WARRANTY, YOU CAN RECOVER FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, SPECIAL, INDIRECT, OR INCIDENTAL DAMAGES.
66
+
67
+ This limitation applies to (a) anything related to the software, services, content (including code) on third party Internet sites, or third party applications; and (b) claims for breach of contract, warranty, guarantee, or condition; strict liability, negligence, or other tort; or any other claim; in each case to the extent permitted by applicable law.
68
+
69
+ It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your state, province, or country may not allow the exclusion or limitation of incidental, consequential, or other damages.
70
+
71
+ Please note: As this software is distributed in Canada, some of the clauses in this agreement are provided below in French.
72
+
73
+ Remarque: Ce logiciel étant distribué au Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en français.
74
+
75
+ EXONÉRATION DE GARANTIE. Le logiciel visé par une licence est offert « tel quel ». Toute utilisation de ce logiciel est à votre seule risque et péril. Microsoft n’accorde aucune autre garantie expresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local sur la protection des consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualité marchande, d’adéquation à un usage particulier et d’absence de contrefaçon sont exclues.
76
+
77
+ LIMITATION DES DOMMAGES-INTÉRÊTS ET EXCLUSION DE RESPONSABILITÉ POUR LES DOMMAGES. Vous pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de dommages directs uniquement à hauteur de 5,00 $ US. Vous ne pouvez prétendre à aucune indemnisation pour les autres dommages, y compris les dommages spéciaux, indirects ou accessoires et pertes de bénéfices.
78
+
79
+ Cette limitation concerne:
80
+
81
+ • tout ce qui est relié au logiciel, aux services ou au contenu (y compris le code) figurant sur des sites Internet tiers ou dans des programmes tiers; et
82
+
83
+ • les réclamations au titre de violation de contrat ou de garantie, ou au titre de responsabilité stricte, de négligence ou d’une autre faute dans la limite autorisée par la loi en vigueur.
84
+
85
+ Elle s’applique également, même si Microsoft connaissait ou devrait connaître l’éventualité d’un tel dommage. Si votre pays n’autorise pas l’exclusion ou la limitation de responsabilité pour les dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou l’exclusion ci-dessus ne s’appliquera pas à votre égard.
86
+
87
+ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir d’autres droits prévus par les lois de votre pays. Le présent contrat ne modifie pas les droits que vous confèrent les lois de votre pays si celles-ci ne le permettent pas.
package/README.md ADDED
@@ -0,0 +1,543 @@
1
+ # Live Share React
2
+
3
+ Live Share React is designed to make building collaborative apps in React simple and intuitive, all using familiar patterns from functional React.
4
+
5
+ Here is a simple example of how to get started:
6
+
7
+ ```javascript
8
+ // LiveShareApp.jsx
9
+ import { LiveShareProvider } from "@microsoft/live-share-react";
10
+ import { LiveShareHost } from "@microsoft/teams-js";
11
+
12
+ const host = LiveShareHost.create();
13
+
14
+ export function LiveShareApp() {
15
+ // Call app.initialize() from teams-js before rendering LiveShareProvider
16
+
17
+ return (
18
+ <LiveShareProvider
19
+ joinOnLoad={true}
20
+ host={host}
21
+ >
22
+ <SharedCheckbox />
23
+ </LiveShareProvider>
24
+ );
25
+ }
26
+
27
+ // SharedCheckbox.jsx
28
+ import { useSharedState } from "@microsoft/live-share-react";
29
+
30
+ export function SharedCheckbox() {
31
+ const [checked, setChecked] = useSharedState("MY-UNIQUE-ID", false);
32
+ return (
33
+ <input
34
+ type="checkbox"
35
+ checked={checked}
36
+ onChange={() => {
37
+ setChecked(!checked);
38
+ }}
39
+ />
40
+ );
41
+ }
42
+ ```
43
+
44
+ ## Getting started
45
+
46
+ ## Installing
47
+
48
+ To add the latest version of the SDK to your application using NPM:
49
+
50
+ ```bash
51
+ npm install @microsoft/live-share-react --save
52
+ ```
53
+
54
+ or using [Yarn](https://yarnpkg.com/):
55
+
56
+ ```bash
57
+ yarn add @microsoft/live-share-react
58
+ ```
59
+
60
+ ### Building package
61
+
62
+ After cloning the [GitHub repository](https://www.github.com/microsoft/live-share-sdk), navigate to the root folder and perform:
63
+
64
+ ```bash
65
+ npm install
66
+ npm run build
67
+ ```
68
+
69
+ This will use lerna to hoist and build all dependencies.
70
+
71
+ ### Sample app
72
+
73
+ After installing/building the packages, you can also try out a [working sample here](../../samples/04.live-share-react/).
74
+
75
+ ## Live Share React vs. Vanilla Fluid
76
+
77
+ Fluid Framework and Live Share are powerful frameworks that can greatly simplify the effort of building collaborative applications, but for many React applications, it can take time to get used to. This experimental package aims to strip away as much of that learning curve as possible.
78
+
79
+ Where traditional Fluid utilizes a developer-defined object schema with a hierarchal structure, this package abstracts that out on your behalf. While you can still tap into more complicated hierarchies with this library, it is designed to behave more like blob storage / NoSQL.
80
+
81
+ To use Fluid's distributed-data structures (DDS) or Live Share's live objects, you can simply use the corresponding React hook, providing a unique identifier for that DDS. If no DDS exists when the component is first mounted, we automatically create one for you. Otherwise, we will connect to the existing one.
82
+
83
+ Much like React itself, this package is opinionated, and it may not be for everyone. To learn more about using Live Share the traditional way, see our [Live Share README](../live-share/README.md).
84
+
85
+ ## Types of hooks
86
+
87
+ Live Share supports all of the live data structures provided through Live Share, and most of the officially supported DDS's available through Fluid Framework. If you have custom data objects, this package also exposes some underlying APIs for building your own custom React hooks.
88
+
89
+ Here are the hooks provided by this library:
90
+
91
+ ### useSharedState
92
+
93
+ Inspired by React's own `useState` hook, `useSharedState` should feel familiar to React developers. Under the hood, this hook uses a Fluid `SharedMap` dedicated for `useSharedState`, listening for changes to the key provided and automatically updating the shared state with any changes. And yes, if two components in the same application use the same key, those components will be in sync with each other!
94
+
95
+ Since these keys are a `string` you provide while calling `useSharedState`, you can dynamically load these into your app as needed. With this in mind, we've also provided an optional `disposeState` action if the state is no longer relevant to your app. If you don't dispose it, then the data will persist in the container should you access it later (up to the lifetime of the Fluid container).
96
+
97
+ The following example shows how `useSharedState` can be used to dynamically create collaborative features in your app on the fly:
98
+
99
+ ```javascript
100
+ import { useSharedState } from "@microsoft/live-share-react";
101
+
102
+ export function CounterCard({ card, onDelete }) {
103
+ const [count, setCount, disposeCount] = useSharedState(
104
+ `card-count:${card.id}`,
105
+ 0
106
+ );
107
+ return (
108
+ <div className="card">
109
+ <h3>{card.title}</h3>
110
+ <button
111
+ onClick={() => {
112
+ setCount(count + 1);
113
+ }}
114
+ >
115
+ {"+1"}
116
+ </button>
117
+ <span>{`${count} `}</span>
118
+ <button
119
+ onClick={() => {
120
+ onDelete(card.id);
121
+ disposeCount();
122
+ }}
123
+ >
124
+ {"Delete"}
125
+ </button>
126
+ </div>
127
+ );
128
+ }
129
+ ```
130
+
131
+ _NOTE:_ While this hook will get you pretty far on its own, carefully consider which of our React hook is best for your scenario.
132
+
133
+ ### useSharedMap
134
+
135
+ This hook loads a Fluid `SharedMap` corresponding with the key you provide. Compared to `useSharedState`, this hook allows you to render a collection of items with less risk of conflict when multiple users may be writing to the same object simultaneously. For example, rather than storing an entire list of objects in a single key of `useSharedState`, the map allows each item in the list to have its own unique key.
136
+
137
+ While you write to keys individually, the `map` object exposed through the hook uses React state itself. Lets see an example in action:
138
+
139
+ ```javascript
140
+ import { useSharedMap } from "@microsoft/live-share-react";
141
+ import { v4 as uuid } from "uuid";
142
+
143
+ export function CardList() {
144
+ const { map, setEntry, deleteEntry } = useSharedMap("CUSTOM-MAP-ID");
145
+ return (
146
+ <div>
147
+ <h2>{"Cards"}</h2>
148
+ <button
149
+ onClick={() => {
150
+ const id = uuid();
151
+ setEntry(id, {
152
+ id,
153
+ title: "Custom Card",
154
+ });
155
+ }}
156
+ >
157
+ {"+ Add card"}
158
+ </button>
159
+ <div className="flex wrap row hAlign">
160
+ {[...map.values()].map((cardValue) => (
161
+ <CounterCard
162
+ key={cardValue.id}
163
+ card={cardValue}
164
+ onDelete={deleteEntry}
165
+ />
166
+ ))}
167
+ </div>
168
+ </div>
169
+ );
170
+ }
171
+ ```
172
+
173
+ ### useLivePresence
174
+
175
+ Presence makes it easy to track which users are currently in the session and assign custom data to them. Unlike other hooks, `useLivePresence` has a default ID set for you, but you can override it with your own if you'd like.
176
+
177
+ ```javascript
178
+ import { useLivePresence } from "@microsoft/live-share-react";
179
+ import { PresenceState } from "@microsoft/live-share";
180
+
181
+ export function OnlineUsers() {
182
+ const { localUser, allUsers, updatePresence } = useLivePresence(
183
+ "CUSTOM-USER-ID", // optional user id
184
+ { name: "First Last" } // optional custom data object
185
+ );
186
+ return (
187
+ <div>
188
+ <h1>{"Online Users:"}</h1>
189
+ <div>
190
+ {allUsers
191
+ .filter((user) => user.state === PresenceState.online)
192
+ .map((user) => (
193
+ <div key={user.userId}>{user.name}</div>
194
+ ))}
195
+ </div>
196
+ <button
197
+ onClick={() => {
198
+ updatePresence(
199
+ localUser?.state === PresenceState.offline
200
+ ? PresenceState.online
201
+ : PresenceState.offline,
202
+ localUser.data
203
+ );
204
+ }}
205
+ >
206
+ {`Toggle status`}
207
+ </button>
208
+ </div>
209
+ );
210
+ }
211
+ ```
212
+
213
+ ### useLiveState
214
+
215
+ Unlike `useSharedState`, `useLiveState` is only stateful while one or more users are connected to it. This can make it easy to have state that behaves more closely to a regular React `useState`, when desireable.
216
+
217
+ This component also features role verification, which allows you to choose the Teams meeting roles which are eligible to edit the state, if needed.
218
+
219
+ ```javascript
220
+ import { useLiveState } from "@microsoft/live-share-react";
221
+ import { UserMeetingRole } from "@microsoft/live-share";
222
+
223
+ const ALLOWED_ROLES = [UserMeetingRole.organizer, UserMeetingRole.presenter ];
224
+
225
+ export function AppState() {
226
+ const [state, data, setState] = useLiveState("CUSTOM-STATE-ID", ALLOWED_ROLES, ExampleAppState.WAITING);
227
+
228
+ if (state === ExampleAppState.WAITING) {
229
+ return (
230
+ <div>
231
+ <h2>{"Waiting"}</h2>
232
+ <button
233
+ onClick={() => {
234
+ setState(ExampleAppState.START, {
235
+ startedBy: "First Last",
236
+ });
237
+ }}
238
+ >
239
+ {"Start"}
240
+ </button>
241
+ </div>
242
+ );
243
+ }
244
+ return (
245
+ <div>
246
+ <h2>{`Started by: ${data!.startedBy}`}</h2>
247
+ <button
248
+ onClick={() => {
249
+ setState(ExampleAppState.WAITING, undefined);
250
+ }}
251
+ >
252
+ {"End"}
253
+ </button>
254
+ </div>
255
+ );
256
+ };
257
+ ```
258
+
259
+ ### useLiveEvent
260
+
261
+ If you want to generic JSON between clients that is completely transient, then `useLiveEvent` is a great choice. A good example of that is a reactions feature similar to that in Microsoft Teams meetings, since people joining a meeting late don't need to see reactions from earlier in the meeting.
262
+
263
+ Here is a simple example:
264
+
265
+ ```javascript
266
+ import { useLiveEvent } from "@microsoft/live-share-react";
267
+
268
+ export function Reactions() {
269
+ const { latestEvent, sendEvent } = useLiveEvent("EVENT-ID");
270
+
271
+ return (
272
+ <div>
273
+ {/* Buttons for sending reactions */}
274
+ <button
275
+ onClick={() => {
276
+ sendEvent({ emoji: "❤️" });
277
+ }}
278
+ >
279
+ {"❤️"}
280
+ </button>
281
+ <button
282
+ onClick={() => {
283
+ sendEvent({ emoji: "😂" });
284
+ }}
285
+ >
286
+ {"😂"}
287
+ </button>
288
+ {/* Show latest reaction */}
289
+ {latestEvent?.local === false && (
290
+ <div>{`Received: ${latestEvent?.event.emoji}`}</div>
291
+ )}
292
+ {latestEvent?.local === true && (
293
+ <div>{`Sent: ${latestEvent?.event.emoji}`}</div>
294
+ )}
295
+ </div>
296
+ );
297
+ }
298
+ ```
299
+
300
+ ### useLiveTimer
301
+
302
+ You can use the `useLiveTimer` hook to build a synchronized countdown timer. A good example of that might be a meditation timer or a countdown for a round in a group activity.
303
+
304
+ Here is a simple example:
305
+
306
+ ```javascript
307
+ import { useLiveTimer } from "@microsoft/live-share-react";
308
+
309
+ export function CountdownTimer() {
310
+ const { milliRemaining, timerConfig, start, pause, play } = useLiveTimer("TIMER-ID");
311
+
312
+ return (
313
+ <div>
314
+ <button
315
+ onClick={() => {
316
+ start(60 * 1000);
317
+ }}
318
+ >
319
+ { timerConfig === undefined ? "Start" : "Reset" }
320
+ </button>
321
+ { timerConfig !== undefined && (
322
+ <button
323
+ onClick={() => {
324
+ if (timerConfig.running) {
325
+ pause();
326
+ } else {
327
+ play();
328
+ }
329
+ }}
330
+ >
331
+ {timerConfig.running ? "Pause" : "Play" }
332
+ </button>
333
+ )}
334
+ { milliRemaining !== undefined && (
335
+ <p>
336
+ { `${Math.round(milliRemaining / 1000)} / ${Math.round(timerConfig.duration) / 1000}` }
337
+ </p>
338
+ )}
339
+ </div>
340
+ );
341
+ }
342
+ ```
343
+
344
+ ### useMediaSynchronizer
345
+
346
+ If you want to synchronize video content, `@microsoft/live-share-media` is also supported by this package through the `useMediaSynchronizer` hook. Using any `HTMLMediaPlayer` element, or a delegate object matching our `IMediaPlayer` interface, you can easily build watch together capabilities into your app.
347
+
348
+ Let's see this in action:
349
+
350
+ ```javascript
351
+ import { useMediaSynchronizer } from "@microsoft/live-share-react";
352
+ import { UserMeetingRole } from "@microsoft/live-share";
353
+ import { useRef } from "react";
354
+
355
+ const ALLOWED_ROLES = [UserMeetingRole.organizer, UserMeetingRole.presenter];
356
+
357
+ const INITIAL_TRACK =
358
+ "https://storage.googleapis.com/media-session/big-buck-bunny/trailer.mov";
359
+
360
+ export function VideoPlayer() {
361
+ const videoRef = useRef(null);
362
+ const { play, pause } = useMediaSynchronizer(
363
+ "MEDIA-SESSION-ID",
364
+ videoRef,
365
+ INITIAL_TRACK,
366
+ ALLOWED_ROLES
367
+ );
368
+
369
+ return (
370
+ <div>
371
+ <video ref={videoRef} />
372
+ <button onClick={play}>{"Play"}</button>
373
+ <button onClick={pause}>{"Pause"}</button>
374
+ </div>
375
+ );
376
+ }
377
+ ```
378
+
379
+ ### useLiveCanvas
380
+
381
+ If you want to add turn-key inking & cursors, use the `useLiveCanvas` hook, powered by `@microsoft/live-share-canvas`.
382
+
383
+ Let's see this in action:
384
+
385
+ ```javascript
386
+ import { useLiveCanvas } from "@microsoft/live-share-react";
387
+ import { InkingTool } from "@microsoft/live-share-canvas";
388
+ import { useRef } from "react";
389
+
390
+ export const ExampleLiveCanvas = () => {
391
+ const liveCanvasRef = useRef(null);
392
+ const { liveCanvas, inkingManager } = useLiveCanvas(
393
+ "CUSTOM-LIVE-CANVAS",
394
+ liveCanvasRef,
395
+ );
396
+
397
+ return (
398
+ {/** Canvas currently needs to be a child of a parent with absolute styling */}
399
+ <div style={{ position: "absolute"}}>
400
+ <div
401
+ ref={liveCanvasRef}
402
+ // Best practice is to not define inline styles
403
+ style={{ width: "556px", height: "224px" }}
404
+ />
405
+ {!!liveCanvas && (
406
+ <div>
407
+ <button
408
+ onClick={() => {
409
+ inkingManager.tool = InkingTool.pen;
410
+ }}
411
+ >
412
+ {"Pen"}
413
+ </button>
414
+ <button
415
+ onClick={() => {
416
+ inkingManager.tool = InkingTool.laserPointer;
417
+ }}
418
+ >
419
+ {"Laser pointer"}
420
+ </button>
421
+ </div>
422
+ )}
423
+ </div>
424
+ );
425
+ };
426
+ ```
427
+
428
+ ### useTaskManager
429
+
430
+ If you want to ensure that only one user is responsible for a given task, you can use `useTaskManager`, which uses Fluid's `TaskManager` DDS.
431
+
432
+ Let's see this in action:
433
+
434
+ ```javascript
435
+ import { useTaskManager } from "@microsoft/live-share-react";
436
+
437
+ export const ExampleTaskManager = () => {
438
+ const [taskId, setTaskId] = useState(undefined);
439
+ const { lockedTask } = useTaskManager(
440
+ "CUSTOM-TASK-MANAGER",
441
+ taskId,
442
+ );
443
+
444
+ const displayText = lockedTask
445
+ ? "You are assigned the task"
446
+ : "Waiting for task assignment";
447
+
448
+ return (
449
+ <div>
450
+ {!taskId && (
451
+ <button
452
+ onClick={() => {
453
+ setTaskId("task-id")
454
+ }}
455
+ >
456
+ {'Join task queue'}
457
+ </button>
458
+ )}
459
+ {taskId && (
460
+ <button
461
+ onClick={() => {
462
+ setTaskId(undefined)
463
+ }}
464
+ >
465
+ {'Leave task queue'}
466
+ </button>
467
+ )}
468
+ <p>{displayText}</p>
469
+ </div>
470
+ );
471
+ };
472
+ ```
473
+
474
+ ### Custom Fluid object hooks
475
+
476
+ If you want to dynamically load a custom Fluid object in your app, use the `useDynamicDDS` to create a custom hook. This is the same hook that Live Share React uses internally within our custom hooks, such as `useLiveEvent`. If you made a custom data object or are using one of Fluid's experimental data structures, you also must register your Fluid `LoadableObjectClass` with `DynamicObjectRegistry.registerObjectClass` to `@microsoft/live-share`, if it is not already.
477
+
478
+ Implementations may vary for each dynamic object & hook. We will try and update this package periodically with new packages released by Fluid Framework and Live Share, as they are published.
479
+
480
+ Example:
481
+
482
+ ```javascript
483
+ import { DynamicObjectRegistry } from "@microsoft/live-share";
484
+ import { useDynamicDDS } from "@microsoft/live-share-react";
485
+ import { SharedTree } from "@fluid-experimental/shared-tree";
486
+ import { useCallback } from "react";
487
+
488
+ // Register the experimental `SharedTree` DDS
489
+ DynamicObjectRegistry.registerObjectClass(SharedTree, "SharedTree");
490
+
491
+ // Custom useSharedTree hook
492
+ export const useSharedTree = (uniqueKey) => {
493
+ const onFirstInitialize = useCallback((dds) => {
494
+ // Set initial values for the newly created SharedTree dds here
495
+ }. []);
496
+ const { dds: sharedTree } = useDynamicDDS(uniqueKey, SharedTree, onFirstInitialize);
497
+ return {
498
+ sharedTree,
499
+ };
500
+ }
501
+ ```
502
+
503
+ ## Code samples
504
+
505
+ | Sample name | Description | Javascript |
506
+ | ----------------- | ----------------------------------------------------------------------- | ----------------------------------------------------- |
507
+ | Live Share React | Simple example with each of our custom Live Share React hooks. | [View](../../samples/javascript/04.live-share-react) |
508
+
509
+ ## React version compatibility
510
+
511
+ This package is compatible with React versions `^16.8.0` and greater, including React v18. In order to ensure compatibility with different versions React, this project does not currently use React Suspense for data fetching on load. We are closely monitoring React guidelines and may post updates as this evolves further. If you have feedback or thoughts on this topic, join the [discussion](https://github.com/microsoft/live-share-sdk/discussions/442).
512
+
513
+ ## Package Compatibility
514
+
515
+ The Live Share SDK contains dependencies for [@microsoft/teams-js](https://www.npmjs.com/package/@microsoft/teams-js) and [fluid-framework](https://www.npmjs.com/package/fluid-framework) packages among others. Both of these packages are sensitive to the package version your app any libraries use. You will likely run into issues if the package version your app uses doesn't match the version other libraries you depend on use.
516
+
517
+ **It is critical that your app use the package dependencies listed in the table below.** Lookup the version of the `@microsoft/live-share` you're using and set any other dependencies in your package.json file to match:
518
+
519
+ | @microsoft/live-share | @microsoft/teams-js | fluid-framework | @microsoft/live-share-\* | @fluidframework/azure-client | @microsoft/TeamsFx | @microsoft/TeamsFx-react |
520
+ | --------------------- | -------------------- | --------------- | -------------------------- | ---------------------------- | ------------------------------- | ------------------------------- |
521
+ | 1.0.0-preview.5 | ^2.5.0 | ~1.2.3 | 1.0.0-preview.5 (optional) | ~1.0.2 (optional) | ^2.5.0 (optional) | ^2.5.0 (optional) |
522
+ | 1.0.0-preview.3 | 2.0.0-experimental.1 | ~1.2.3 | 1.0.0-preview.3 (optional) | ~1.0.2 (optional) | 2.0.0-experimental.0 (optional) | 2.0.0-experimental.0 (optional) |
523
+ | ~0.5.1 | 2.0.0-experimental.1 | ~1.2.3 | ~0.5.1 (optional) | ~1.0.2 (optional) | 2.0.0-experimental.0 (optional) | 2.0.0-experimental.0 (optional) |
524
+ | ~0.3.1 | 2.0.0-experimental.0 | ~0.59.0 | ~0.3.1 (optional) | ~0.59.0 (optional) | 2.0.0-experimental.0 (optional) | 2.0.0-experimental.0 (optional) |
525
+
526
+ ## Contributing
527
+
528
+ There are several ways you can [contribute](../../CONTRIBUTING.md) to this project:
529
+
530
+ - [Submit bugs](https://github.com/microsoft/live-share-sdk/issues) and help us verify fixes as they are checked in.
531
+ - Review the source code changes.
532
+ - Engage with other Live Share developers on [StackOverflow](https://stackoverflow.com/questions/tagged/live-share).
533
+ - [Contribute bug fixes](../../CONTRIBUTING.md).
534
+
535
+ This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact opencode@microsoft.com with any additional questions or comments.
536
+
537
+ ## Reporting Security Issues
538
+
539
+ Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) at secure@microsoft.com. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the [MSRC PGP](https://technet.microsoft.com/en-us/security/dn606155) key, can be found in the [Security TechCenter](https://technet.microsoft.com/en-us/security/default).
540
+
541
+ Copyright (c) Microsoft Corporation. All rights reserved.
542
+
543
+ Licensed under a special [Microsoft](../../LICENSE) License.
package/bin/index.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export * from "./providers";
2
+ export * from "./shared-hooks";
3
+ export * from "./live-hooks";
4
+ export * from "./types";
5
+ export * from "./providers";
6
+ export * from "./interfaces";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
package/bin/index.js ADDED
@@ -0,0 +1,7 @@
1
+ export * from "./providers";
2
+ export * from "./shared-hooks";
3
+ export * from "./live-hooks";
4
+ export * from "./types";
5
+ export * from "./providers";
6
+ export * from "./interfaces";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}