@fluidframework/react 0.41.4 → 2.62.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (342) hide show
  1. package/.eslintrc.cjs +11 -0
  2. package/.mocharc.cjs +15 -0
  3. package/CHANGELOG.md +282 -0
  4. package/README.md +122 -273
  5. package/api-extractor/api-extractor-lint-alpha.cjs.json +5 -0
  6. package/api-extractor/api-extractor-lint-alpha.esm.json +5 -0
  7. package/api-extractor/api-extractor-lint-beta.cjs.json +5 -0
  8. package/api-extractor/api-extractor-lint-beta.esm.json +5 -0
  9. package/api-extractor/api-extractor-lint-bundle.json +5 -0
  10. package/api-extractor/api-extractor-lint-public.cjs.json +5 -0
  11. package/api-extractor/api-extractor-lint-public.esm.json +5 -0
  12. package/api-extractor-lint.json +4 -0
  13. package/api-extractor.json +2 -2
  14. package/api-report/react.alpha.api.md +114 -0
  15. package/api-report/react.beta.api.md +7 -0
  16. package/api-report/react.public.api.md +7 -0
  17. package/biome.jsonc +4 -0
  18. package/dist/alpha.d.ts +45 -0
  19. package/dist/beta.d.ts +15 -0
  20. package/dist/index.d.ts +11 -7
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +19 -17
  23. package/dist/index.js.map +1 -1
  24. package/dist/package.json +4 -0
  25. package/dist/propNode.d.ts +114 -0
  26. package/dist/propNode.d.ts.map +1 -0
  27. package/dist/propNode.js +43 -0
  28. package/dist/propNode.js.map +1 -0
  29. package/dist/public.d.ts +15 -0
  30. package/dist/reactSharedTreeView.d.ts +119 -0
  31. package/dist/reactSharedTreeView.d.ts.map +1 -0
  32. package/dist/reactSharedTreeView.js +206 -0
  33. package/dist/reactSharedTreeView.js.map +1 -0
  34. package/dist/simpleIdentifier.d.ts +19 -0
  35. package/dist/simpleIdentifier.d.ts.map +1 -0
  36. package/dist/simpleIdentifier.js +33 -0
  37. package/dist/simpleIdentifier.js.map +1 -0
  38. package/dist/useObservation.d.ts +83 -0
  39. package/dist/useObservation.d.ts.map +1 -0
  40. package/dist/useObservation.js +295 -0
  41. package/dist/useObservation.js.map +1 -0
  42. package/dist/useTree.d.ts +80 -0
  43. package/dist/useTree.d.ts.map +1 -0
  44. package/dist/useTree.js +137 -0
  45. package/dist/useTree.js.map +1 -0
  46. package/lib/alpha.d.ts +45 -0
  47. package/lib/beta.d.ts +15 -0
  48. package/lib/index.d.ts +16 -0
  49. package/lib/index.d.ts.map +1 -0
  50. package/lib/index.js +4 -7
  51. package/lib/index.js.map +1 -1
  52. package/lib/package.json +4 -0
  53. package/lib/propNode.d.ts +114 -0
  54. package/lib/propNode.d.ts.map +1 -0
  55. package/lib/propNode.js +36 -0
  56. package/lib/propNode.js.map +1 -0
  57. package/lib/public.d.ts +15 -0
  58. package/lib/reactSharedTreeView.d.ts +119 -0
  59. package/lib/reactSharedTreeView.d.ts.map +1 -0
  60. package/lib/reactSharedTreeView.js +176 -0
  61. package/lib/reactSharedTreeView.js.map +1 -0
  62. package/lib/simpleIdentifier.d.ts +19 -0
  63. package/lib/simpleIdentifier.d.ts.map +1 -0
  64. package/lib/simpleIdentifier.js +29 -0
  65. package/lib/simpleIdentifier.js.map +1 -0
  66. package/lib/test/propNode.spec.js +120 -0
  67. package/lib/test/propNode.spec.js.map +1 -0
  68. package/lib/test/reactSharedTreeView.spec.js +71 -0
  69. package/lib/test/reactSharedTreeView.spec.js.map +1 -0
  70. package/lib/test/simpleIdentifier.spec.js +18 -0
  71. package/lib/test/simpleIdentifier.spec.js.map +1 -0
  72. package/lib/test/useObservation.spec.js +162 -0
  73. package/lib/test/useObservation.spec.js.map +1 -0
  74. package/lib/test/useTree.spec.js +165 -0
  75. package/lib/test/useTree.spec.js.map +1 -0
  76. package/lib/tsdoc-metadata.json +11 -0
  77. package/lib/useObservation.d.ts +83 -0
  78. package/lib/useObservation.d.ts.map +1 -0
  79. package/lib/useObservation.js +266 -0
  80. package/lib/useObservation.js.map +1 -0
  81. package/lib/useTree.d.ts +80 -0
  82. package/lib/useTree.d.ts.map +1 -0
  83. package/lib/useTree.js +105 -0
  84. package/lib/useTree.js.map +1 -0
  85. package/package.json +150 -51
  86. package/react.test-files.tar +0 -0
  87. package/src/index.ts +42 -7
  88. package/src/propNode.ts +164 -0
  89. package/src/reactSharedTreeView.tsx +327 -0
  90. package/src/simpleIdentifier.ts +31 -0
  91. package/src/useObservation.ts +376 -0
  92. package/src/useTree.ts +147 -0
  93. package/tsconfig.cjs.json +7 -0
  94. package/tsconfig.json +12 -15
  95. package/tsdoc.json +4 -0
  96. package/.eslintrc.js +0 -11
  97. package/dist/createContextFluid.d.ts +0 -7
  98. package/dist/createContextFluid.d.ts.map +0 -1
  99. package/dist/createContextFluid.js +0 -46
  100. package/dist/createContextFluid.js.map +0 -1
  101. package/dist/helpers/generateFluidObjectSchema.d.ts +0 -16
  102. package/dist/helpers/generateFluidObjectSchema.d.ts.map +0 -1
  103. package/dist/helpers/generateFluidObjectSchema.js +0 -75
  104. package/dist/helpers/generateFluidObjectSchema.js.map +0 -1
  105. package/dist/helpers/getFluidFromView.d.ts +0 -15
  106. package/dist/helpers/getFluidFromView.d.ts.map +0 -1
  107. package/dist/helpers/getFluidFromView.js +0 -30
  108. package/dist/helpers/getFluidFromView.js.map +0 -1
  109. package/dist/helpers/getFluidState.d.ts +0 -15
  110. package/dist/helpers/getFluidState.d.ts.map +0 -1
  111. package/dist/helpers/getFluidState.js +0 -47
  112. package/dist/helpers/getFluidState.js.map +0 -1
  113. package/dist/helpers/getSchema.d.ts +0 -13
  114. package/dist/helpers/getSchema.d.ts.map +0 -1
  115. package/dist/helpers/getSchema.js +0 -15
  116. package/dist/helpers/getSchema.js.map +0 -1
  117. package/dist/helpers/getViewFromFluid.d.ts +0 -18
  118. package/dist/helpers/getViewFromFluid.d.ts.map +0 -1
  119. package/dist/helpers/getViewFromFluid.js +0 -47
  120. package/dist/helpers/getViewFromFluid.js.map +0 -1
  121. package/dist/helpers/index.d.ts +0 -16
  122. package/dist/helpers/index.d.ts.map +0 -1
  123. package/dist/helpers/index.js +0 -28
  124. package/dist/helpers/index.js.map +0 -1
  125. package/dist/helpers/initializeState.d.ts +0 -22
  126. package/dist/helpers/initializeState.d.ts.map +0 -1
  127. package/dist/helpers/initializeState.js +0 -77
  128. package/dist/helpers/initializeState.js.map +0 -1
  129. package/dist/helpers/internalInterface.d.ts +0 -15
  130. package/dist/helpers/internalInterface.d.ts.map +0 -1
  131. package/dist/helpers/internalInterface.js +0 -7
  132. package/dist/helpers/internalInterface.js.map +0 -1
  133. package/dist/helpers/rootCallbackListener.d.ts +0 -24
  134. package/dist/helpers/rootCallbackListener.d.ts.map +0 -1
  135. package/dist/helpers/rootCallbackListener.js +0 -55
  136. package/dist/helpers/rootCallbackListener.js.map +0 -1
  137. package/dist/helpers/setComponentSchema.d.ts +0 -14
  138. package/dist/helpers/setComponentSchema.d.ts.map +0 -1
  139. package/dist/helpers/setComponentSchema.js +0 -18
  140. package/dist/helpers/setComponentSchema.js.map +0 -1
  141. package/dist/helpers/setFluidState.d.ts +0 -20
  142. package/dist/helpers/setFluidState.d.ts.map +0 -1
  143. package/dist/helpers/setFluidState.js +0 -94
  144. package/dist/helpers/setFluidState.js.map +0 -1
  145. package/dist/helpers/syncState.d.ts +0 -25
  146. package/dist/helpers/syncState.d.ts.map +0 -1
  147. package/dist/helpers/syncState.js +0 -98
  148. package/dist/helpers/syncState.js.map +0 -1
  149. package/dist/helpers/updateStateAndFluidObjectMap.d.ts +0 -29
  150. package/dist/helpers/updateStateAndFluidObjectMap.d.ts.map +0 -1
  151. package/dist/helpers/updateStateAndFluidObjectMap.js +0 -30
  152. package/dist/helpers/updateStateAndFluidObjectMap.js.map +0 -1
  153. package/dist/helpers/utils.d.ts +0 -12
  154. package/dist/helpers/utils.d.ts.map +0 -1
  155. package/dist/helpers/utils.js +0 -74
  156. package/dist/helpers/utils.js.map +0 -1
  157. package/dist/interface.d.ts +0 -444
  158. package/dist/interface.d.ts.map +0 -1
  159. package/dist/interface.js +0 -18
  160. package/dist/interface.js.map +0 -1
  161. package/dist/reactView.d.ts +0 -32
  162. package/dist/reactView.d.ts.map +0 -1
  163. package/dist/reactView.js +0 -79
  164. package/dist/reactView.js.map +0 -1
  165. package/dist/syncedDataObject.d.ts +0 -80
  166. package/dist/syncedDataObject.d.ts.map +0 -1
  167. package/dist/syncedDataObject.js +0 -249
  168. package/dist/syncedDataObject.js.map +0 -1
  169. package/dist/syncedObjects/array/fluidSyncedArray.d.ts +0 -11
  170. package/dist/syncedObjects/array/fluidSyncedArray.d.ts.map +0 -1
  171. package/dist/syncedObjects/array/fluidSyncedArray.js +0 -78
  172. package/dist/syncedObjects/array/fluidSyncedArray.js.map +0 -1
  173. package/dist/syncedObjects/array/index.d.ts +0 -7
  174. package/dist/syncedObjects/array/index.d.ts.map +0 -1
  175. package/dist/syncedObjects/array/index.js +0 -19
  176. package/dist/syncedObjects/array/index.js.map +0 -1
  177. package/dist/syncedObjects/array/interface.d.ts +0 -33
  178. package/dist/syncedObjects/array/interface.d.ts.map +0 -1
  179. package/dist/syncedObjects/array/interface.js +0 -3
  180. package/dist/syncedObjects/array/interface.js.map +0 -1
  181. package/dist/syncedObjects/array/syncedArray.d.ts +0 -30
  182. package/dist/syncedObjects/array/syncedArray.d.ts.map +0 -1
  183. package/dist/syncedObjects/array/syncedArray.js +0 -42
  184. package/dist/syncedObjects/array/syncedArray.js.map +0 -1
  185. package/dist/syncedObjects/counter/fluidSyncedCounter.d.ts +0 -11
  186. package/dist/syncedObjects/counter/fluidSyncedCounter.d.ts.map +0 -1
  187. package/dist/syncedObjects/counter/fluidSyncedCounter.js +0 -79
  188. package/dist/syncedObjects/counter/fluidSyncedCounter.js.map +0 -1
  189. package/dist/syncedObjects/counter/index.d.ts +0 -7
  190. package/dist/syncedObjects/counter/index.d.ts.map +0 -1
  191. package/dist/syncedObjects/counter/index.js +0 -19
  192. package/dist/syncedObjects/counter/index.js.map +0 -1
  193. package/dist/syncedObjects/counter/interface.d.ts +0 -32
  194. package/dist/syncedObjects/counter/interface.d.ts.map +0 -1
  195. package/dist/syncedObjects/counter/interface.js +0 -3
  196. package/dist/syncedObjects/counter/interface.js.map +0 -1
  197. package/dist/syncedObjects/counter/syncedCounter.d.ts +0 -29
  198. package/dist/syncedObjects/counter/syncedCounter.d.ts.map +0 -1
  199. package/dist/syncedObjects/counter/syncedCounter.js +0 -36
  200. package/dist/syncedObjects/counter/syncedCounter.js.map +0 -1
  201. package/dist/syncedObjects/index.d.ts +0 -9
  202. package/dist/syncedObjects/index.d.ts.map +0 -1
  203. package/dist/syncedObjects/index.js +0 -21
  204. package/dist/syncedObjects/index.js.map +0 -1
  205. package/dist/syncedObjects/object/index.d.ts +0 -7
  206. package/dist/syncedObjects/object/index.d.ts.map +0 -1
  207. package/dist/syncedObjects/object/index.js +0 -19
  208. package/dist/syncedObjects/object/index.js.map +0 -1
  209. package/dist/syncedObjects/object/interface.d.ts +0 -13
  210. package/dist/syncedObjects/object/interface.d.ts.map +0 -1
  211. package/dist/syncedObjects/object/interface.js +0 -7
  212. package/dist/syncedObjects/object/interface.js.map +0 -1
  213. package/dist/syncedObjects/object/syncedObject.d.ts +0 -22
  214. package/dist/syncedObjects/object/syncedObject.d.ts.map +0 -1
  215. package/dist/syncedObjects/object/syncedObject.js +0 -46
  216. package/dist/syncedObjects/object/syncedObject.js.map +0 -1
  217. package/dist/syncedObjects/string/index.d.ts +0 -7
  218. package/dist/syncedObjects/string/index.d.ts.map +0 -1
  219. package/dist/syncedObjects/string/index.js +0 -19
  220. package/dist/syncedObjects/string/index.js.map +0 -1
  221. package/dist/syncedObjects/string/interface.d.ts +0 -16
  222. package/dist/syncedObjects/string/interface.d.ts.map +0 -1
  223. package/dist/syncedObjects/string/interface.js +0 -7
  224. package/dist/syncedObjects/string/interface.js.map +0 -1
  225. package/dist/syncedObjects/string/syncedString.d.ts +0 -25
  226. package/dist/syncedObjects/string/syncedString.d.ts.map +0 -1
  227. package/dist/syncedObjects/string/syncedString.js +0 -53
  228. package/dist/syncedObjects/string/syncedString.js.map +0 -1
  229. package/dist/useReducerFluid.d.ts +0 -7
  230. package/dist/useReducerFluid.d.ts.map +0 -1
  231. package/dist/useReducerFluid.js +0 -219
  232. package/dist/useReducerFluid.js.map +0 -1
  233. package/dist/useStateFluid.d.ts +0 -10
  234. package/dist/useStateFluid.d.ts.map +0 -1
  235. package/dist/useStateFluid.js +0 -67
  236. package/dist/useStateFluid.js.map +0 -1
  237. package/lib/createContextFluid.js +0 -23
  238. package/lib/createContextFluid.js.map +0 -1
  239. package/lib/helpers/generateFluidObjectSchema.js +0 -71
  240. package/lib/helpers/generateFluidObjectSchema.js.map +0 -1
  241. package/lib/helpers/getFluidFromView.js +0 -26
  242. package/lib/helpers/getFluidFromView.js.map +0 -1
  243. package/lib/helpers/getFluidState.js +0 -43
  244. package/lib/helpers/getFluidState.js.map +0 -1
  245. package/lib/helpers/getSchema.js +0 -11
  246. package/lib/helpers/getSchema.js.map +0 -1
  247. package/lib/helpers/getViewFromFluid.js +0 -43
  248. package/lib/helpers/getViewFromFluid.js.map +0 -1
  249. package/lib/helpers/index.js +0 -16
  250. package/lib/helpers/index.js.map +0 -1
  251. package/lib/helpers/initializeState.js +0 -73
  252. package/lib/helpers/initializeState.js.map +0 -1
  253. package/lib/helpers/internalInterface.js +0 -6
  254. package/lib/helpers/internalInterface.js.map +0 -1
  255. package/lib/helpers/rootCallbackListener.js +0 -51
  256. package/lib/helpers/rootCallbackListener.js.map +0 -1
  257. package/lib/helpers/setComponentSchema.js +0 -14
  258. package/lib/helpers/setComponentSchema.js.map +0 -1
  259. package/lib/helpers/setFluidState.js +0 -90
  260. package/lib/helpers/setFluidState.js.map +0 -1
  261. package/lib/helpers/syncState.js +0 -94
  262. package/lib/helpers/syncState.js.map +0 -1
  263. package/lib/helpers/updateStateAndFluidObjectMap.js +0 -26
  264. package/lib/helpers/updateStateAndFluidObjectMap.js.map +0 -1
  265. package/lib/helpers/utils.js +0 -67
  266. package/lib/helpers/utils.js.map +0 -1
  267. package/lib/interface.js +0 -8
  268. package/lib/interface.js.map +0 -1
  269. package/lib/reactView.js +0 -56
  270. package/lib/reactView.js.map +0 -1
  271. package/lib/syncedDataObject.js +0 -245
  272. package/lib/syncedDataObject.js.map +0 -1
  273. package/lib/syncedObjects/array/fluidSyncedArray.js +0 -72
  274. package/lib/syncedObjects/array/fluidSyncedArray.js.map +0 -1
  275. package/lib/syncedObjects/array/index.js +0 -7
  276. package/lib/syncedObjects/array/index.js.map +0 -1
  277. package/lib/syncedObjects/array/interface.js +0 -2
  278. package/lib/syncedObjects/array/interface.js.map +0 -1
  279. package/lib/syncedObjects/array/syncedArray.js +0 -37
  280. package/lib/syncedObjects/array/syncedArray.js.map +0 -1
  281. package/lib/syncedObjects/counter/fluidSyncedCounter.js +0 -73
  282. package/lib/syncedObjects/counter/fluidSyncedCounter.js.map +0 -1
  283. package/lib/syncedObjects/counter/index.js +0 -7
  284. package/lib/syncedObjects/counter/index.js.map +0 -1
  285. package/lib/syncedObjects/counter/interface.js +0 -2
  286. package/lib/syncedObjects/counter/interface.js.map +0 -1
  287. package/lib/syncedObjects/counter/syncedCounter.js +0 -31
  288. package/lib/syncedObjects/counter/syncedCounter.js.map +0 -1
  289. package/lib/syncedObjects/index.js +0 -9
  290. package/lib/syncedObjects/index.js.map +0 -1
  291. package/lib/syncedObjects/object/index.js +0 -7
  292. package/lib/syncedObjects/object/index.js.map +0 -1
  293. package/lib/syncedObjects/object/interface.js +0 -6
  294. package/lib/syncedObjects/object/interface.js.map +0 -1
  295. package/lib/syncedObjects/object/syncedObject.js +0 -41
  296. package/lib/syncedObjects/object/syncedObject.js.map +0 -1
  297. package/lib/syncedObjects/string/index.js +0 -7
  298. package/lib/syncedObjects/string/index.js.map +0 -1
  299. package/lib/syncedObjects/string/interface.js +0 -6
  300. package/lib/syncedObjects/string/interface.js.map +0 -1
  301. package/lib/syncedObjects/string/syncedString.js +0 -48
  302. package/lib/syncedObjects/string/syncedString.js.map +0 -1
  303. package/lib/useReducerFluid.js +0 -196
  304. package/lib/useReducerFluid.js.map +0 -1
  305. package/lib/useStateFluid.js +0 -44
  306. package/lib/useStateFluid.js.map +0 -1
  307. package/src/createContextFluid.tsx +0 -33
  308. package/src/helpers/generateFluidObjectSchema.ts +0 -95
  309. package/src/helpers/getFluidFromView.ts +0 -38
  310. package/src/helpers/getFluidState.ts +0 -67
  311. package/src/helpers/getSchema.ts +0 -18
  312. package/src/helpers/getViewFromFluid.ts +0 -68
  313. package/src/helpers/index.tsx +0 -16
  314. package/src/helpers/initializeState.ts +0 -162
  315. package/src/helpers/internalInterface.ts +0 -16
  316. package/src/helpers/rootCallbackListener.ts +0 -104
  317. package/src/helpers/setComponentSchema.ts +0 -21
  318. package/src/helpers/setFluidState.ts +0 -116
  319. package/src/helpers/syncState.ts +0 -159
  320. package/src/helpers/updateStateAndFluidObjectMap.ts +0 -85
  321. package/src/helpers/utils.tsx +0 -109
  322. package/src/interface.ts +0 -617
  323. package/src/reactView.tsx +0 -108
  324. package/src/syncedDataObject.ts +0 -337
  325. package/src/syncedObjects/array/fluidSyncedArray.ts +0 -126
  326. package/src/syncedObjects/array/index.ts +0 -7
  327. package/src/syncedObjects/array/interface.ts +0 -45
  328. package/src/syncedObjects/array/syncedArray.ts +0 -65
  329. package/src/syncedObjects/counter/fluidSyncedCounter.ts +0 -122
  330. package/src/syncedObjects/counter/index.ts +0 -7
  331. package/src/syncedObjects/counter/interface.ts +0 -44
  332. package/src/syncedObjects/counter/syncedCounter.ts +0 -64
  333. package/src/syncedObjects/index.ts +0 -9
  334. package/src/syncedObjects/object/index.ts +0 -7
  335. package/src/syncedObjects/object/interface.ts +0 -14
  336. package/src/syncedObjects/object/syncedObject.ts +0 -55
  337. package/src/syncedObjects/string/index.ts +0 -7
  338. package/src/syncedObjects/string/interface.ts +0 -17
  339. package/src/syncedObjects/string/syncedString.ts +0 -61
  340. package/src/useReducerFluid.tsx +0 -436
  341. package/src/useStateFluid.tsx +0 -84
  342. package/tscon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,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAC7B,yEAAyE;SACxE;aAAM,IAAI,cAAc,EAAE;YACvB,mBAAS,CACL,IAAI,EACJ,IAAI,CAAC,cAAc,EACnB,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,UAAU,CAAC,OAAO,EACvB,QAAQ,EACR,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EACzB,IAAI,CAAC,UAAU,CAAC,cAAc,EAC9B,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,YAAY,CACpB,CAAC;SACL;aAAM;YACH,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;SAC3B;IACL,CAAC;IAED;;;OAGG;IACI,QAAQ,CAAC,QAAY;QACxB,mBAAS,CACL,KAAK,EACL,IAAI,CAAC,cAAc,EACnB,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,UAAU,CAAC,OAAO,EACvB,QAAQ,EACR,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EACzB,IAAI,CAAC,UAAU,CAAC,cAAc,EAC9B,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,YAAY,CACpB,CAAC;IACN,CAAC;CACJ;AAvFD,wCAuFC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as React from \"react\";\nimport {\n IFluidProps,\n IFluidState,\n IViewState,\n IFluidConverter,\n IViewConverter,\n IFluidDataProps,\n ISyncedState,\n} from \"./interface\";\nimport { syncState, initializeState } from \"./helpers\";\n\n/**\n * A React view with a synced state, initial props, and a Fluid-to-view state two-way mapping\n */\nexport abstract class FluidReactView<SV extends IViewState,\n SF extends IFluidState> extends React.Component<IFluidProps<SV, SF>, SV> {\n private readonly _syncedStateId: string;\n private readonly _syncedState: ISyncedState;\n private readonly _dataProps: IFluidDataProps;\n private readonly _viewToFluid: Map<keyof SV, IFluidConverter<SV, SF>>;\n private readonly _fluidToView: Map<keyof SF, IViewConverter<SV, SF>>;\n constructor(props: IFluidProps<SV, SF>) {\n super(props);\n const {\n syncedStateId,\n syncedDataObject,\n } = props;\n const config = syncedDataObject.getConfig(syncedStateId);\n if (config === undefined) {\n throw Error(`Failed to find configuration for synced state ID: ${syncedStateId}`);\n }\n this._viewToFluid = config.viewToFluid as any;\n this._fluidToView = config.fluidToView as any;\n this._syncedStateId = syncedStateId;\n this._syncedState = syncedDataObject.syncedState;\n this._dataProps = syncedDataObject.dataProps;\n this.state = config.defaultViewState;\n }\n\n public async componentDidMount() {\n await initializeState(\n this._syncedStateId,\n this._syncedState,\n this._dataProps,\n this.state,\n this._setState.bind(this),\n this._fluidToView,\n this._viewToFluid,\n );\n }\n\n /**\n * Function to update the state from both synced state updates or local ones. Only updates the synced state\n * on local updates\n * @param newState - the new state to be set\n * @param fromRootUpdate - is this update coming locally or from a synced state value change\n * @param isLocal - should this update be applied only locally\n */\n private _setState(\n newState: SV,\n fromRootUpdate?: boolean,\n isLocal?: boolean,\n ) {\n // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n if (isLocal) {\n super.setState(newState);\n // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n } else if (fromRootUpdate) {\n syncState(\n true,\n this._syncedStateId,\n this._syncedState,\n this._dataProps.runtime,\n newState,\n this._setState.bind(this),\n this._dataProps.fluidObjectMap,\n this._fluidToView,\n this._viewToFluid,\n );\n } else {\n this.setState(newState);\n }\n }\n\n /**\n * Function to update the current state. It overloads the React setState function\n * @param newState - New state to be set both locally and on the synced state\n */\n public setState(newState: SV) {\n syncState(\n false,\n this._syncedStateId,\n this._syncedState,\n this._dataProps.runtime,\n newState,\n this._setState.bind(this),\n this._dataProps.fluidObjectMap,\n this._fluidToView,\n this._viewToFluid,\n );\n }\n}\n"]}
@@ -1,80 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { DataObject } from "@fluidframework/aqueduct";
6
- import { IFluidObject } from "@fluidframework/core-interfaces";
7
- import { IEvent } from "@fluidframework/common-definitions";
8
- import { IFluidHTMLView } from "@fluidframework/view-interfaces";
9
- import type { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions";
10
- import { FluidObjectMap, ISyncedStateConfig, IViewState, IFluidState, ISyncedState } from "./interface";
11
- /**
12
- * SyncedDataObject is a base class for Fluid data objects with views. It extends DataObject.
13
- * In addition to the root and task manager, the SyncedDataObject also provides a syncedStateConfig
14
- * and assures that the syncedState will be initialized according the config by the time the view
15
- * is rendered.
16
- *
17
- * As this is used for views, it also implements the IFluidHTMLView interface, and requires
18
- * the render function to be filled in.
19
- */
20
- export declare abstract class SyncedDataObject<P extends IFluidObject = object, S = undefined, E extends IEvent = IEvent> extends DataObject<P, S, E> implements IFluidHTMLView {
21
- private readonly syncedStateConfig;
22
- private readonly fluidObjectMap;
23
- private readonly syncedStateDirectoryId;
24
- private internalSyncedState;
25
- get IFluidHTMLView(): this;
26
- /**
27
- * Runs the first time the SyncedDataObject is generated and sets up all necessary data structures for the view
28
- * To extend this function, please call super() prior to adding to functionality to ensure correct initializing
29
- */
30
- protected initializingFirstTime(): Promise<void>;
31
- /**
32
- * Runs any time the SyncedDataObject is rendered again. It sets up all necessary data structures for the view,
33
- * along with any additional ones that may have been added due to user behavior
34
- * To extend this function, please call super() prior to adding to functionality to ensure correct initializing
35
- */
36
- protected initializingFromExisting(): Promise<void>;
37
- /**
38
- * Returns an interface to interact with the stored synced state for the SyncedDataObject.
39
- * Views can get and fetch values from it based on their syncedStateId to retrieve their view-specific information.
40
- * They can also attach listeners using the addValueChangedListener
41
- */
42
- get syncedState(): ISyncedState;
43
- /**
44
- * Returns the data props used by the view to manage the different DDSes and add any new ones
45
- */
46
- get dataProps(): {
47
- runtime: IFluidDataStoreRuntime;
48
- fluidObjectMap: FluidObjectMap;
49
- };
50
- /**
51
- * Set values to the syncedStateConfig where the view and Fluid states have the same values defined by S.
52
- * Each view with a unique syncedStateId needs its own value in the syncedStateConfig.
53
- * @param key - The syncedStateId that maps to the view that will be using these definitions
54
- * @param value - The config value containing the syncedStateId and the fluidToView and viewToFluid maps
55
- */
56
- setConfig<S>(key: string, value: ISyncedStateConfig<S, S>): void;
57
- /**
58
- * Set values to the syncedStateConfig with different view and Fluid state definitions.
59
- * Each view with a unique syncedStateId needs its own value in the syncedStateConfig,
60
- * with SV being the view state definition and SF being the Fluid state definition.
61
- * @param key - The syncedStateId that maps to the view that will be using these definitions
62
- * @param value - The config value containing the syncedStateId and the fluidToView and viewToFluid maps
63
- * that establish the relationship between SV and SF
64
- */
65
- setFluidConfig<SV extends IViewState, SF extends IFluidState>(key: string, value: ISyncedStateConfig<SV, SF>): void;
66
- /**
67
- * Get a config for a specific view with the key as its syncedStateId
68
- * @param key - The syncedStateId to get the config for
69
- */
70
- getConfig(key: string): ISyncedStateConfig<any, any> | undefined;
71
- /**
72
- * Returns a view. This function need to be implemented for any consumer of SyncedDataObject
73
- * to render values that have been initialized using the syncedStateConfig
74
- * @param element - The document that the rendered value will be displayed in
75
- */
76
- render(element: HTMLElement): void;
77
- private initializeStateFirstTime;
78
- private initializeStateFromExisting;
79
- }
80
- //# sourceMappingURL=syncedDataObject.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"syncedDataObject.d.ts","sourceRoot":"","sources":["../src/syncedDataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EACH,YAAY,EAEf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAEpF,OAAO,EACH,cAAc,EAEd,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,YAAY,EACf,MAAM,aAAa,CAAC;AAOrB;;;;;;;;GAQG;AACH,8BAAsB,gBAAgB,CAElC,CAAC,SAAS,YAAY,GAAG,MAAM,EAC/B,CAAC,GAAG,SAAS,EACb,CAAC,SAAS,MAAM,GAAG,MAAM,CACvB,SAAQ,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAE,YAAW,cAAc;IACvD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAgC;IAClE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA6B;IAC5D,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAiB;IACxD,OAAO,CAAC,mBAAmB,CAAyB;IAEpD,IAAW,cAAc,SAExB;IAED;;;OAGG;cACa,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC;IAMtD;;;;OAIG;cACa,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC;IAKzD;;;;OAIG;IACH,IAAW,WAAW,IAAI,YAAY,CAgBrC;IAED;;OAEG;IACH,IAAW,SAAS;;;MAOnB;IAED;;;;;OAKG;IAEI,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC;IAIhE;;;;;;;OAOG;IACI,cAAc,CACjB,EAAE,SAAS,UAAU,EACrB,EAAE,SAAS,WAAW,EACxB,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,CAAC,EAAE,EAAE,EAAE,CAAC;IAIhD;;;OAGG;IACI,SAAS,CAAC,GAAG,EAAE,MAAM;IAI5B;;;;OAIG;IACI,MAAM,CAAC,OAAO,EAAE,WAAW;YAIpB,wBAAwB;YA4FxB,2BAA2B;CA8F5C"}
@@ -1,249 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SyncedDataObject = void 0;
4
- /*!
5
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
6
- * Licensed under the MIT License.
7
- */
8
- const aqueduct_1 = require("@fluidframework/aqueduct");
9
- const map_1 = require("@fluidframework/map");
10
- const helpers_1 = require("./helpers");
11
- /**
12
- * SyncedDataObject is a base class for Fluid data objects with views. It extends DataObject.
13
- * In addition to the root and task manager, the SyncedDataObject also provides a syncedStateConfig
14
- * and assures that the syncedState will be initialized according the config by the time the view
15
- * is rendered.
16
- *
17
- * As this is used for views, it also implements the IFluidHTMLView interface, and requires
18
- * the render function to be filled in.
19
- */
20
- class SyncedDataObject extends aqueduct_1.DataObject {
21
- constructor() {
22
- super(...arguments);
23
- this.syncedStateConfig = new Map();
24
- this.fluidObjectMap = new Map();
25
- this.syncedStateDirectoryId = "syncedState";
26
- }
27
- get IFluidHTMLView() {
28
- return this;
29
- }
30
- /**
31
- * Runs the first time the SyncedDataObject is generated and sets up all necessary data structures for the view
32
- * To extend this function, please call super() prior to adding to functionality to ensure correct initializing
33
- */
34
- async initializingFirstTime() {
35
- // Initialize our synced state map for the first time using our
36
- // syncedStateConfig values
37
- await this.initializeStateFirstTime();
38
- }
39
- /**
40
- * Runs any time the SyncedDataObject is rendered again. It sets up all necessary data structures for the view,
41
- * along with any additional ones that may have been added due to user behavior
42
- * To extend this function, please call super() prior to adding to functionality to ensure correct initializing
43
- */
44
- async initializingFromExisting() {
45
- // Load our existing state values to be ready for the render lifecycle
46
- await this.initializeStateFromExisting();
47
- }
48
- /**
49
- * Returns an interface to interact with the stored synced state for the SyncedDataObject.
50
- * Views can get and fetch values from it based on their syncedStateId to retrieve their view-specific information.
51
- * They can also attach listeners using the addValueChangedListener
52
- */
53
- get syncedState() {
54
- if (this.internalSyncedState === undefined) {
55
- throw new Error(this.getUninitializedErrorString(`syncedState`));
56
- }
57
- return {
58
- set: this.internalSyncedState.set.bind(this.internalSyncedState),
59
- get: this.internalSyncedState.get.bind(this.internalSyncedState),
60
- addValueChangedListener: (callback) => {
61
- if (this.internalSyncedState === undefined) {
62
- throw new Error(this.getUninitializedErrorString(`syncedState`));
63
- }
64
- this.internalSyncedState.on("valueChanged", callback);
65
- },
66
- };
67
- }
68
- /**
69
- * Returns the data props used by the view to manage the different DDSes and add any new ones
70
- */
71
- get dataProps() {
72
- return {
73
- // The return type is defined explicitly here to prevent TypeScript from generating dynamic imports
74
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
75
- runtime: this.runtime,
76
- fluidObjectMap: this.fluidObjectMap,
77
- };
78
- }
79
- /**
80
- * Set values to the syncedStateConfig where the view and Fluid states have the same values defined by S.
81
- * Each view with a unique syncedStateId needs its own value in the syncedStateConfig.
82
- * @param key - The syncedStateId that maps to the view that will be using these definitions
83
- * @param value - The config value containing the syncedStateId and the fluidToView and viewToFluid maps
84
- */
85
- // eslint-disable-next-line @typescript-eslint/no-shadow
86
- setConfig(key, value) {
87
- this.syncedStateConfig.set(key, value);
88
- }
89
- /**
90
- * Set values to the syncedStateConfig with different view and Fluid state definitions.
91
- * Each view with a unique syncedStateId needs its own value in the syncedStateConfig,
92
- * with SV being the view state definition and SF being the Fluid state definition.
93
- * @param key - The syncedStateId that maps to the view that will be using these definitions
94
- * @param value - The config value containing the syncedStateId and the fluidToView and viewToFluid maps
95
- * that establish the relationship between SV and SF
96
- */
97
- setFluidConfig(key, value) {
98
- this.syncedStateConfig.set(key, value);
99
- }
100
- /**
101
- * Get a config for a specific view with the key as its syncedStateId
102
- * @param key - The syncedStateId to get the config for
103
- */
104
- getConfig(key) {
105
- return this.syncedStateConfig.get(key);
106
- }
107
- /**
108
- * Returns a view. This function need to be implemented for any consumer of SyncedDataObject
109
- * to render values that have been initialized using the syncedStateConfig
110
- * @param element - The document that the rendered value will be displayed in
111
- */
112
- render(element) {
113
- throw Error("Render function was not implemented");
114
- }
115
- async initializeStateFirstTime() {
116
- var _a;
117
- this.internalSyncedState = map_1.SharedMap.create(this.runtime, this.syncedStateDirectoryId);
118
- this.internalSyncedState.bindToContext();
119
- for (const stateConfig of this.syncedStateConfig.values()) {
120
- const { syncedStateId, fluidToView, viewToFluid, defaultViewState, } = stateConfig;
121
- // Add the SharedMap to store the Fluid state
122
- const storedFluidState = map_1.SharedMap.create(this.runtime);
123
- // Add it to the Fluid object map so that it will have a listener added to it once
124
- // we enter the render lifecycle
125
- this.fluidObjectMap.set(storedFluidState.handle.absolutePath, {
126
- fluidObject: storedFluidState,
127
- isRuntimeMap: true,
128
- });
129
- // Add the state to our map of synced states so that we can load it later for persistence
130
- this.syncedState.set(`syncedState-${syncedStateId}`, storedFluidState.handle);
131
- // Initialize any DDSes needed for the state or fetch any values from the root if they are stored
132
- // on the root under a different key
133
- for (const [key, value] of fluidToView.entries()) {
134
- const fluidKey = key;
135
- const rootKey = value.rootKey;
136
- const createCallback = value.sharedObjectCreate;
137
- if (createCallback !== undefined) {
138
- const sharedObject = createCallback(this.runtime);
139
- this.fluidObjectMap.set(sharedObject.handle.absolutePath, {
140
- fluidObject: sharedObject,
141
- listenedEvents: (_a = value.listenedEvents) !== null && _a !== void 0 ? _a : ["valueChanged"],
142
- });
143
- storedFluidState.set(fluidKey, sharedObject.handle);
144
- if (rootKey !== undefined) {
145
- this.root.set(rootKey, sharedObject.handle);
146
- }
147
- }
148
- else if (rootKey !== undefined) {
149
- storedFluidState.set(fluidKey, this.root.get(rootKey));
150
- }
151
- }
152
- // Generate our schema and store it, so that we don't need to parse our maps each time
153
- const schema = helpers_1.generateFluidObjectSchema(this.runtime, defaultViewState, fluidToView, viewToFluid);
154
- const schemaHandles = {
155
- fluidMatchingMapHandle: schema.fluidMatchingMap
156
- .handle,
157
- viewMatchingMapHandle: schema.viewMatchingMap
158
- .handle,
159
- storedHandleMapHandle: schema.storedHandleMap
160
- .handle,
161
- };
162
- this.fluidObjectMap.set(schema.fluidMatchingMap.handle.absolutePath, {
163
- fluidObject: schema.fluidMatchingMap,
164
- isRuntimeMap: true,
165
- });
166
- this.fluidObjectMap.set(schema.viewMatchingMap.handle.absolutePath, {
167
- fluidObject: schema.viewMatchingMap,
168
- isRuntimeMap: true,
169
- });
170
- this.fluidObjectMap.set(schema.storedHandleMap.handle.absolutePath, {
171
- fluidObject: schema.storedHandleMap,
172
- isRuntimeMap: true,
173
- });
174
- helpers_1.setSchema(syncedStateId, this.syncedState, schemaHandles);
175
- }
176
- }
177
- async initializeStateFromExisting() {
178
- var _a, _b;
179
- // Fetch our synced state that stores all of our information to re-initialize the view state
180
- this.internalSyncedState = (await this.runtime.getChannel(this.syncedStateDirectoryId));
181
- // Reload the stored state for each config provided
182
- for (const stateConfig of this.syncedStateConfig.values()) {
183
- const { syncedStateId, fluidToView } = stateConfig;
184
- // Fetch this specific view's state using the syncedStateId
185
- const storedFluidStateHandle = this.syncedState.get(`syncedState-${syncedStateId}`);
186
- if (storedFluidStateHandle === undefined) {
187
- throw new Error(this.getUninitializedErrorString(`syncedState-${syncedStateId}`));
188
- }
189
- const storedFluidState = await storedFluidStateHandle.get();
190
- // Add it to the Fluid object map so that it will have a listener added to it once
191
- // we enter the render lifecycle
192
- this.fluidObjectMap.set(storedFluidStateHandle.absolutePath, {
193
- fluidObject: storedFluidState,
194
- isRuntimeMap: true,
195
- });
196
- // If the view is using any Fluid data stores or SharedObjects, asynchronously fetch them
197
- // from their stored handles
198
- for (const [key, value] of fluidToView.entries()) {
199
- const fluidKey = key;
200
- const rootKey = value.rootKey;
201
- const createCallback = value.sharedObjectCreate;
202
- if (createCallback !== undefined) {
203
- const handle = rootKey !== undefined
204
- ? this.root.get(rootKey)
205
- : storedFluidState.get(fluidKey);
206
- if (handle === undefined) {
207
- throw new Error(`Failed to find ${fluidKey} in synced state`);
208
- }
209
- this.fluidObjectMap.set(handle.absolutePath, {
210
- fluidObject: await handle.get(),
211
- listenedEvents: (_a = value.listenedEvents) !== null && _a !== void 0 ? _a : ["valueChanged"],
212
- });
213
- }
214
- else {
215
- const storedValue = rootKey !== undefined
216
- ? this.root.get(rootKey)
217
- : storedFluidState.get(fluidKey);
218
- const handle = storedValue === null || storedValue === void 0 ? void 0 : storedValue.IFluidHandle;
219
- if (handle !== undefined) {
220
- this.fluidObjectMap.set(handle.absolutePath, {
221
- fluidObject: await handle.get(),
222
- listenedEvents: (_b = value.listenedEvents) !== null && _b !== void 0 ? _b : [
223
- "valueChanged",
224
- ],
225
- });
226
- }
227
- }
228
- }
229
- const schemaHandles = helpers_1.getSchema(syncedStateId, this.syncedState);
230
- if (schemaHandles === undefined) {
231
- throw new Error(this.getUninitializedErrorString(`schema-${syncedStateId}`));
232
- }
233
- this.fluidObjectMap.set(schemaHandles.fluidMatchingMapHandle.absolutePath, {
234
- fluidObject: await schemaHandles.fluidMatchingMapHandle.get(),
235
- isRuntimeMap: true,
236
- });
237
- this.fluidObjectMap.set(schemaHandles.viewMatchingMapHandle.absolutePath, {
238
- fluidObject: await schemaHandles.viewMatchingMapHandle.get(),
239
- isRuntimeMap: true,
240
- });
241
- this.fluidObjectMap.set(schemaHandles.storedHandleMapHandle.absolutePath, {
242
- fluidObject: await schemaHandles.storedHandleMapHandle.get(),
243
- isRuntimeMap: true,
244
- });
245
- }
246
- }
247
- }
248
- exports.SyncedDataObject = SyncedDataObject;
249
- //# sourceMappingURL=syncedDataObject.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"syncedDataObject.js","sourceRoot":"","sources":["../src/syncedDataObject.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uDAAsD;AAMtD,6CAA4D;AAY5D,uCAImB;AAEnB;;;;;;;;GAQG;AACH,MAAsB,gBAKhB,SAAQ,qBAAmB;IALjC;;QAMqB,sBAAiB,GAAsB,IAAI,GAAG,EAAE,CAAC;QACjD,mBAAc,GAAmB,IAAI,GAAG,EAAE,CAAC;QAC3C,2BAAsB,GAAG,aAAa,CAAC;IAmS5D,CAAC;IAhSG,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;OAGG;IACO,KAAK,CAAC,qBAAqB;QACjC,+DAA+D;QAC/D,2BAA2B;QAC3B,MAAM,IAAI,CAAC,wBAAwB,EAAE,CAAC;IAC1C,CAAC;IAED;;;;OAIG;IACO,KA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b,IAAI,CAAC,WAAW,CACnB,CAAC;YACF,IAAI,aAAa,KAAK,SAAS,EAAE;gBAC7B,MAAM,IAAI,KAAK,CACX,IAAI,CAAC,2BAA2B,CAC5B,UAAU,aAAa,EAAE,CAC5B,CACJ,CAAC;aACL;YACD,IAAI,CAAC,cAAc,CAAC,GAAG,CACnB,aAAa,CAAC,sBAAsB,CAAC,YAAY,EACjD;gBACI,WAAW,EAAE,MAAM,aAAa,CAAC,sBAAsB,CAAC,GAAG,EAAE;gBAC7D,YAAY,EAAE,IAAI;aACrB,CACJ,CAAC;YACF,IAAI,CAAC,cAAc,CAAC,GAAG,CACnB,aAAa,CAAC,qBAAqB,CAAC,YAAY,EAChD;gBACI,WAAW,EAAE,MAAM,aAAa,CAAC,qBAAqB,CAAC,GAAG,EAAE;gBAC5D,YAAY,EAAE,IAAI;aACrB,CACJ,CAAC;YACF,IAAI,CAAC,cAAc,CAAC,GAAG,CACnB,aAAa,CAAC,qBAAqB,CAAC,YAAY,EAChD;gBACI,WAAW,EAAE,MAAM,aAAa,CAAC,qBAAqB,CAAC,GAAG,EAAE;gBAC5D,YAAY,EAAE,IAAI;aACrB,CACJ,CAAC;SACL;IACL,CAAC;CACJ;AA3SD,4CA2SC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { DataObject } from \"@fluidframework/aqueduct\";\nimport {\n IFluidObject,\n IFluidHandle,\n} from \"@fluidframework/core-interfaces\";\nimport { IEvent } from \"@fluidframework/common-definitions\";\nimport { SharedMap, ISharedMap } from \"@fluidframework/map\";\nimport { IFluidHTMLView } from \"@fluidframework/view-interfaces\";\nimport type { IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\n\nimport {\n FluidObjectMap,\n SyncedStateConfig,\n ISyncedStateConfig,\n IViewState,\n IFluidState,\n ISyncedState,\n} from \"./interface\";\nimport {\n generateFluidObjectSchema,\n setSchema,\n getSchema,\n} from \"./helpers\";\n\n/**\n * SyncedDataObject is a base class for Fluid data objects with views. It extends DataObject.\n * In addition to the root and task manager, the SyncedDataObject also provides a syncedStateConfig\n * and assures that the syncedState will be initialized according the config by the time the view\n * is rendered.\n *\n * As this is used for views, it also implements the IFluidHTMLView interface, and requires\n * the render function to be filled in.\n */\nexport abstract class SyncedDataObject<\n // eslint-disable-next-line @typescript-eslint/ban-types\n P extends IFluidObject = object,\n S = undefined,\n E extends IEvent = IEvent\n > extends DataObject<P, S, E> implements IFluidHTMLView {\n private readonly syncedStateConfig: SyncedStateConfig = new Map();\n private readonly fluidObjectMap: FluidObjectMap = new Map();\n private readonly syncedStateDirectoryId = \"syncedState\";\n private internalSyncedState: ISharedMap | undefined;\n\n public get IFluidHTMLView() {\n return this;\n }\n\n /**\n * Runs the first time the SyncedDataObject is generated and sets up all necessary data structures for the view\n * To extend this function, please call super() prior to adding to functionality to ensure correct initializing\n */\n protected async initializingFirstTime(): Promise<void> {\n // Initialize our synced state map for the first time using our\n // syncedStateConfig values\n await this.initializeStateFirstTime();\n }\n\n /**\n * Runs any time the SyncedDataObject is rendered again. It sets up all necessary data structures for the view,\n * along with any additional ones that may have been added due to user behavior\n * To extend this function, please call super() prior to adding to functionality to ensure correct initializing\n */\n protected async initializingFromExisting(): Promise<void> {\n // Load our existing state values to be ready for the render lifecycle\n await this.initializeStateFromExisting();\n }\n\n /**\n * Returns an interface to interact with the stored synced state for the SyncedDataObject.\n * Views can get and fetch values from it based on their syncedStateId to retrieve their view-specific information.\n * They can also attach listeners using the addValueChangedListener\n */\n public get syncedState(): ISyncedState {\n if (this.internalSyncedState === undefined) {\n throw new Error(this.getUninitializedErrorString(`syncedState`));\n }\n return {\n set: this.internalSyncedState.set.bind(this.internalSyncedState),\n get: this.internalSyncedState.get.bind(this.internalSyncedState),\n addValueChangedListener: (callback) => {\n if (this.internalSyncedState === undefined) {\n throw new Error(\n this.getUninitializedErrorString(`syncedState`),\n );\n }\n this.internalSyncedState.on(\"valueChanged\", callback);\n },\n };\n }\n\n /**\n * Returns the data props used by the view to manage the different DDSes and add any new ones\n */\n public get dataProps() {\n return {\n // The return type is defined explicitly here to prevent TypeScript from generating dynamic imports\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n runtime: this.runtime as IFluidDataStoreRuntime,\n fluidObjectMap: this.fluidObjectMap,\n };\n }\n\n /**\n * Set values to the syncedStateConfig where the view and Fluid states have the same values defined by S.\n * Each view with a unique syncedStateId needs its own value in the syncedStateConfig.\n * @param key - The syncedStateId that maps to the view that will be using these definitions\n * @param value - The config value containing the syncedStateId and the fluidToView and viewToFluid maps\n */\n // eslint-disable-next-line @typescript-eslint/no-shadow\n public setConfig<S>(key: string, value: ISyncedStateConfig<S, S>) {\n this.syncedStateConfig.set(key, value);\n }\n\n /**\n * Set values to the syncedStateConfig with different view and Fluid state definitions.\n * Each view with a unique syncedStateId needs its own value in the syncedStateConfig,\n * with SV being the view state definition and SF being the Fluid state definition.\n * @param key - The syncedStateId that maps to the view that will be using these definitions\n * @param value - The config value containing the syncedStateId and the fluidToView and viewToFluid maps\n * that establish the relationship between SV and SF\n */\n public setFluidConfig<\n SV extends IViewState,\n SF extends IFluidState\n >(key: string, value: ISyncedStateConfig<SV, SF>) {\n this.syncedStateConfig.set(key, value);\n }\n\n /**\n * Get a config for a specific view with the key as its syncedStateId\n * @param key - The syncedStateId to get the config for\n */\n public getConfig(key: string) {\n return this.syncedStateConfig.get(key);\n }\n\n /**\n * Returns a view. This function need to be implemented for any consumer of SyncedDataObject\n * to render values that have been initialized using the syncedStateConfig\n * @param element - The document that the rendered value will be displayed in\n */\n public render(element: HTMLElement) {\n throw Error(\"Render function was not implemented\");\n }\n\n private async initializeStateFirstTime() {\n this.internalSyncedState = SharedMap.create(\n this.runtime,\n this.syncedStateDirectoryId,\n );\n this.internalSyncedState.bindToContext();\n for (const stateConfig of this.syncedStateConfig.values()) {\n const {\n syncedStateId,\n fluidToView,\n viewToFluid,\n defaultViewState,\n } = stateConfig;\n // Add the SharedMap to store the Fluid state\n const storedFluidState = SharedMap.create(this.runtime);\n // Add it to the Fluid object map so that it will have a listener added to it once\n // we enter the render lifecycle\n this.fluidObjectMap.set(storedFluidState.handle.absolutePath, {\n fluidObject: storedFluidState,\n isRuntimeMap: true,\n });\n // Add the state to our map of synced states so that we can load it later for persistence\n this.syncedState.set(\n `syncedState-${syncedStateId}`,\n storedFluidState.handle,\n );\n // Initialize any DDSes needed for the state or fetch any values from the root if they are stored\n // on the root under a different key\n for (const [key, value] of fluidToView.entries()) {\n const fluidKey = key as string;\n const rootKey = value.rootKey;\n const createCallback = value.sharedObjectCreate;\n if (createCallback !== undefined) {\n const sharedObject = createCallback(this.runtime);\n this.fluidObjectMap.set(sharedObject.handle.absolutePath, {\n fluidObject: sharedObject,\n listenedEvents: value.listenedEvents ?? [\"valueChanged\"],\n });\n storedFluidState.set(fluidKey, sharedObject.handle);\n if (rootKey !== undefined) {\n this.root.set(rootKey, sharedObject.handle);\n }\n } else if (rootKey !== undefined) {\n storedFluidState.set(fluidKey, this.root.get(rootKey));\n }\n }\n\n // Generate our schema and store it, so that we don't need to parse our maps each time\n const schema = generateFluidObjectSchema(\n this.runtime,\n defaultViewState,\n fluidToView,\n viewToFluid,\n );\n const schemaHandles = {\n fluidMatchingMapHandle: schema.fluidMatchingMap\n .handle as IFluidHandle<SharedMap>,\n viewMatchingMapHandle: schema.viewMatchingMap\n .handle as IFluidHandle<SharedMap>,\n storedHandleMapHandle: schema.storedHandleMap\n .handle as IFluidHandle<SharedMap>,\n };\n this.fluidObjectMap.set(\n schema.fluidMatchingMap.handle.absolutePath,\n {\n fluidObject: schema.fluidMatchingMap,\n isRuntimeMap: true,\n },\n );\n this.fluidObjectMap.set(\n schema.viewMatchingMap.handle.absolutePath,\n {\n fluidObject: schema.viewMatchingMap,\n isRuntimeMap: true,\n },\n );\n this.fluidObjectMap.set(\n schema.storedHandleMap.handle.absolutePath,\n {\n fluidObject: schema.storedHandleMap,\n isRuntimeMap: true,\n },\n );\n\n setSchema(\n syncedStateId,\n this.syncedState,\n schemaHandles,\n );\n }\n }\n\n private async initializeStateFromExisting() {\n // Fetch our synced state that stores all of our information to re-initialize the view state\n this.internalSyncedState = (await this.runtime.getChannel(\n this.syncedStateDirectoryId,\n )) as ISharedMap;\n // Reload the stored state for each config provided\n for (const stateConfig of this.syncedStateConfig.values()) {\n const { syncedStateId, fluidToView } = stateConfig;\n // Fetch this specific view's state using the syncedStateId\n const storedFluidStateHandle = this.syncedState.get<\n IFluidHandle<ISharedMap>\n >(`syncedState-${syncedStateId}`);\n if (storedFluidStateHandle === undefined) {\n throw new Error(\n this.getUninitializedErrorString(\n `syncedState-${syncedStateId}`,\n ),\n );\n }\n const storedFluidState = await storedFluidStateHandle.get();\n // Add it to the Fluid object map so that it will have a listener added to it once\n // we enter the render lifecycle\n this.fluidObjectMap.set(storedFluidStateHandle.absolutePath, {\n fluidObject: storedFluidState,\n isRuntimeMap: true,\n });\n // If the view is using any Fluid data stores or SharedObjects, asynchronously fetch them\n // from their stored handles\n for (const [key, value] of fluidToView.entries()) {\n const fluidKey = key as string;\n const rootKey = value.rootKey;\n const createCallback = value.sharedObjectCreate;\n if (createCallback !== undefined) {\n const handle = rootKey !== undefined\n ? this.root.get(rootKey)\n : storedFluidState.get(fluidKey);\n if (handle === undefined) {\n throw new Error(\n `Failed to find ${fluidKey} in synced state`,\n );\n }\n this.fluidObjectMap.set(handle.absolutePath, {\n fluidObject: await handle.get(),\n listenedEvents: value.listenedEvents ?? [\"valueChanged\"],\n });\n } else {\n const storedValue = rootKey !== undefined\n ? this.root.get(rootKey)\n : storedFluidState.get(fluidKey);\n const handle = storedValue?.IFluidHandle;\n if (handle !== undefined) {\n this.fluidObjectMap.set(handle.absolutePath, {\n fluidObject: await handle.get(),\n listenedEvents: value.listenedEvents ?? [\n \"valueChanged\",\n ],\n });\n }\n }\n }\n const schemaHandles = getSchema(\n syncedStateId,\n this.syncedState,\n );\n if (schemaHandles === undefined) {\n throw new Error(\n this.getUninitializedErrorString(\n `schema-${syncedStateId}`,\n ),\n );\n }\n this.fluidObjectMap.set(\n schemaHandles.fluidMatchingMapHandle.absolutePath,\n {\n fluidObject: await schemaHandles.fluidMatchingMapHandle.get(),\n isRuntimeMap: true,\n },\n );\n this.fluidObjectMap.set(\n schemaHandles.viewMatchingMapHandle.absolutePath,\n {\n fluidObject: await schemaHandles.viewMatchingMapHandle.get(),\n isRuntimeMap: true,\n },\n );\n this.fluidObjectMap.set(\n schemaHandles.storedHandleMapHandle.absolutePath,\n {\n fluidObject: await schemaHandles.storedHandleMapHandle.get(),\n isRuntimeMap: true,\n },\n );\n }\n }\n}\n"]}
@@ -1,11 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { SharedObjectSequence } from "@fluidframework/sequence";
6
- import { IViewState, IFluidState, SyncedDataObject, ICombinedState, IFluidDataProps } from "../..";
7
- import { IFluidSyncedArrayReducer } from "./interface";
8
- export declare function setFluidSyncedArrayConfig<SV extends IViewState, SF extends IFluidState>(syncedDataObject: SyncedDataObject, syncedStateId: string, viewKey: keyof SV, fluidKey: keyof SF, defaultViewState: SV, sharedObjectCreate?: typeof SharedObjectSequence.create): void;
9
- export declare function generateSyncedArrayReducer<SV extends IViewState, SF extends IFluidState>(viewKey: keyof SV, fluidKey: keyof SF): IFluidSyncedArrayReducer<SV, SF>;
10
- export declare function useSyncedArrayReducerFluid<SV extends IViewState, SF extends IFluidState>(syncedDataObject: SyncedDataObject, syncedStateId: string, viewKey: keyof SV, fluidKey: keyof SF, defaultViewState: SV): [ICombinedState<SV, SF, IFluidDataProps>, IFluidSyncedArrayReducer<SV, SF>, {}];
11
- //# sourceMappingURL=fluidSyncedArray.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fluidSyncedArray.d.ts","sourceRoot":"","sources":["../../../src/syncedObjects/array/fluidSyncedArray.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EACH,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,eAAe,EAElB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD,wBAAgB,yBAAyB,CACrC,EAAE,SAAS,UAAU,EACrB,EAAE,SAAS,WAAW,EAEtB,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EAAE,EACjB,QAAQ,EAAE,MAAM,EAAE,EAClB,gBAAgB,EAAE,EAAE,EACpB,kBAAkB,qCAA8B,QA4CnD;AAED,wBAAgB,0BAA0B,CACtC,EAAE,SAAS,UAAU,EACrB,EAAE,SAAS,WAAW,EACxB,OAAO,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,wBAAwB,CAAC,EAAE,EAAE,EAAE,CAAC,CAqBzE;AAED,wBAAgB,0BAA0B,CACtC,EAAE,SAAS,UAAU,EACrB,EAAE,SAAS,WAAW,EAEtB,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EAAE,EACjB,QAAQ,EAAE,MAAM,EAAE,EAClB,gBAAgB,EAAE,EAAE,GAErB,CAAC,cAAc,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,CAAC,EAAE,wBAAwB,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAkBjF"}
@@ -1,78 +0,0 @@
1
- "use strict";
2
- /*!
3
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
- * Licensed under the MIT License.
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.useSyncedArrayReducerFluid = exports.generateSyncedArrayReducer = exports.setFluidSyncedArrayConfig = void 0;
8
- const sequence_1 = require("@fluidframework/sequence");
9
- const __1 = require("../..");
10
- function setFluidSyncedArrayConfig(syncedDataObject, syncedStateId, viewKey, fluidKey, defaultViewState, sharedObjectCreate = sequence_1.SharedObjectSequence.create) {
11
- syncedDataObject.setFluidConfig(syncedStateId, {
12
- syncedStateId,
13
- fluidToView: new Map([
14
- [
15
- fluidKey,
16
- {
17
- type: sequence_1.SharedObjectSequence.name,
18
- viewKey,
19
- viewConverter: (viewState, fluidState) => {
20
- if (fluidState[fluidKey] === undefined) {
21
- throw Error("Fluid state was not initialized");
22
- }
23
- viewState[viewKey] = fluidState[fluidKey].getItems(0);
24
- return viewState;
25
- },
26
- sharedObjectCreate,
27
- listenedEvents: ["valueChanged"],
28
- },
29
- ],
30
- ]),
31
- viewToFluid: new Map([
32
- [
33
- viewKey,
34
- {
35
- type: "array",
36
- fluidKey,
37
- fluidConverter: (viewState, fluidState) => {
38
- if (fluidState[fluidKey] === undefined) {
39
- throw Error("Fluid state was not initialized");
40
- }
41
- viewState[viewKey] = fluidState[fluidKey].getItems(0);
42
- return fluidState;
43
- },
44
- },
45
- ],
46
- ]),
47
- defaultViewState,
48
- });
49
- }
50
- exports.setFluidSyncedArrayConfig = setFluidSyncedArrayConfig;
51
- function generateSyncedArrayReducer(viewKey, fluidKey) {
52
- const syncedArrayReducer = {
53
- add: {
54
- function: (state, value) => {
55
- var _a;
56
- if (((_a = state === null || state === void 0 ? void 0 : state.fluidState) === null || _a === void 0 ? void 0 : _a[fluidKey]) === undefined) {
57
- throw Error("State was not initialized prior to dispatch call");
58
- }
59
- state.fluidState[fluidKey].insert(state.fluidState[fluidKey].getLength(), [Object.assign({}, value)]);
60
- state.viewState[viewKey] = state.fluidState[fluidKey].getItems(0);
61
- return { state };
62
- },
63
- },
64
- };
65
- return syncedArrayReducer;
66
- }
67
- exports.generateSyncedArrayReducer = generateSyncedArrayReducer;
68
- function useSyncedArrayReducerFluid(syncedDataObject, syncedStateId, viewKey, fluidKey, defaultViewState) {
69
- const syncedArrayReducer = generateSyncedArrayReducer(viewKey, fluidKey);
70
- return __1.useReducerFluid({
71
- syncedDataObject,
72
- syncedStateId,
73
- reducer: syncedArrayReducer,
74
- selector: {},
75
- }, defaultViewState);
76
- }
77
- exports.useSyncedArrayReducerFluid = useSyncedArrayReducerFluid;
78
- //# sourceMappingURL=fluidSyncedArray.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fluidSyncedArray.js","sourceRoot":"","sources":["../../../src/syncedObjects/array/fluidSyncedArray.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAAgE;AAChE,6BAOe;AAGf,SAAgB,yBAAyB,CAIrC,gBAAkC,EAClC,aAAqB,EACrB,OAAiB,EACjB,QAAkB,EAClB,gBAAoB,EACpB,kBAAkB,GAAG,+BAAoB,CAAC,MAAM;IAEhD,gBAAgB,CAAC,cAAc,CAAS,aAAa,EAAE;QACnD,aAAa;QACb,WAAW,EAAE,IAAI,GAAG,CAAC;YACjB;gBACI,QAAQ;gBACR;oBACI,IAAI,EAAE,+BAAoB,CAAC,IAAI;oBAC/B,OAAO;oBACP,aAAa,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,EAAE;wBACrC,IAAI,UAAU,CAAC,QAAQ,CAAC,KAAK,SAAS,EAAE;4BACpC,MAAM,KAAK,CAAC,iCAAiC,CAAC,CAAC;yBAClD;wBACD,SAAS,CAAC,OAAO,CAAC,GAAI,UAAU,CAC5B,QAAQ,CACH,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;wBACtB,OAAO,SAAS,CAAC;oBACrB,CAAC;oBACD,kBAAkB;oBAClB,cAAc,EAAE,CAAC,cAAc,CAAC;iBACnC;aACJ;SACJ,CAAC;QACF,WAAW,EAAE,IAAI,GAAG,CAAC;YACjB;gBACI,OAAO;gBACP;oBACI,IAAI,EAAE,OAAO;oBACb,QAAQ;oBACR,cAAc,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,EAAE;wBACtC,IAAI,UAAU,CAAC,QAAQ,CAAC,KAAK,SAAS,EAAE;4BACpC,MAAM,KA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gB,CACnB,CAAC;AACN,CAAC;AA5BD,gEA4BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { SharedObjectSequence } from \"@fluidframework/sequence\";\nimport {\n IViewState,\n IFluidState,\n SyncedDataObject,\n ICombinedState,\n IFluidDataProps,\n useReducerFluid,\n} from \"../..\";\nimport { IFluidSyncedArrayReducer } from \"./interface\";\n\nexport function setFluidSyncedArrayConfig<\n SV extends IViewState,\n SF extends IFluidState\n>(\n syncedDataObject: SyncedDataObject,\n syncedStateId: string,\n viewKey: keyof SV,\n fluidKey: keyof SF,\n defaultViewState: SV,\n sharedObjectCreate = SharedObjectSequence.create,\n) {\n syncedDataObject.setFluidConfig<SV, SF>(syncedStateId, {\n syncedStateId,\n fluidToView: new Map([\n [\n fluidKey,\n {\n type: SharedObjectSequence.name,\n viewKey,\n viewConverter: (viewState, fluidState) => {\n if (fluidState[fluidKey] === undefined) {\n throw Error(\"Fluid state was not initialized\");\n }\n viewState[viewKey] = (fluidState[\n fluidKey\n ] as any).getItems(0);\n return viewState;\n },\n sharedObjectCreate,\n listenedEvents: [\"valueChanged\"],\n },\n ],\n ]),\n viewToFluid: new Map([\n [\n viewKey,\n {\n type: \"array\",\n fluidKey,\n fluidConverter: (viewState, fluidState) => {\n if (fluidState[fluidKey] === undefined) {\n throw Error(\"Fluid state was not initialized\");\n }\n viewState[viewKey] = (fluidState[\n fluidKey\n ] as any).getItems(0);\n return fluidState;\n },\n },\n ],\n ]),\n defaultViewState,\n });\n}\n\nexport function generateSyncedArrayReducer<\n SV extends IViewState,\n SF extends IFluidState\n>(viewKey: keyof SV, fluidKey: keyof SF): IFluidSyncedArrayReducer<SV, SF> {\n const syncedArrayReducer = {\n add: {\n function: (state, value: any) => {\n if (state?.fluidState?.[fluidKey] === undefined) {\n throw Error(\n \"State was not initialized prior to dispatch call\",\n );\n }\n state.fluidState[fluidKey].insert(\n state.fluidState[fluidKey].getLength(),\n [{ ...value }],\n );\n state.viewState[viewKey] = state.fluidState[fluidKey].getItems(\n 0,\n );\n return { state };\n },\n },\n };\n return syncedArrayReducer;\n}\n\nexport function useSyncedArrayReducerFluid<\n SV extends IViewState,\n SF extends IFluidState\n>(\n syncedDataObject: SyncedDataObject,\n syncedStateId: string,\n viewKey: keyof SV,\n fluidKey: keyof SF,\n defaultViewState: SV,\n// eslint-disable-next-line @typescript-eslint/ban-types\n): [ICombinedState<SV, SF, IFluidDataProps>, IFluidSyncedArrayReducer<SV, SF>, {}] {\n const syncedArrayReducer = generateSyncedArrayReducer(viewKey, fluidKey);\n return useReducerFluid<\n SV,\n SF,\n IFluidSyncedArrayReducer<SV, SF>,\n // eslint-disable-next-line @typescript-eslint/ban-types\n {},\n IFluidDataProps\n >(\n {\n syncedDataObject,\n syncedStateId,\n reducer: syncedArrayReducer,\n selector: {},\n },\n defaultViewState,\n );\n}\n"]}
@@ -1,7 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- export * from "./syncedArray";
6
- export * from "./interface";
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/syncedObjects/array/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- /*!
3
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
- * Licensed under the MIT License.
5
- */
6
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
- if (k2 === undefined) k2 = k;
8
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./syncedArray"), exports);
18
- __exportStar(require("./interface"), exports);
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/syncedObjects/array/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;AAEH,gDAA8B;AAC9B,8CAA4B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport * from \"./syncedArray\";\nexport * from \"./interface\";\n"]}
@@ -1,33 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { SharedObjectSequence } from "@fluidframework/sequence";
6
- import { IViewState, IFluidState, IFluidReducer, IFluidDataProps, FluidStateUpdateFunction } from "../..";
7
- /**
8
- * The state interface exposed to the view for the synced array
9
- */
10
- export interface ISyncedArrayViewState<T> extends IViewState {
11
- values: T[];
12
- }
13
- /**
14
- * The state interface for the Fluid data source that powers the synced array
15
- */
16
- export interface ISyncedArrayFluidState<T> extends IFluidState {
17
- values: SharedObjectSequence<T>;
18
- }
19
- /**
20
- * The reducer interface for modifying the synced array
21
- * TODO: Add more functions that further expose the SharedObjectSequence interface for use
22
- */
23
- export interface ISyncedArrayReducer<T> {
24
- add: (value: T) => void;
25
- }
26
- /**
27
- * The underlying reducer interface passed to the useReducerFluid hook to bind the view and Fluid
28
- * state definitions together
29
- */
30
- export interface IFluidSyncedArrayReducer<SV extends IViewState, SF extends IFluidState> extends IFluidReducer<SV, SF, IFluidDataProps> {
31
- add: FluidStateUpdateFunction<SV, SF, IFluidDataProps>;
32
- }
33
- //# sourceMappingURL=interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../src/syncedObjects/array/interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EACH,UAAU,EACV,WAAW,EACX,aAAa,EACb,eAAe,EACf,wBAAwB,EAC3B,MAAM,OAAO,CAAC;AAEf;;GAEG;AACH,MAAM,WAAW,qBAAqB,CAAC,CAAC,CAAE,SAAQ,UAAU;IACxD,MAAM,EAAE,CAAC,EAAE,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB,CAAC,CAAC,CAAE,SAAQ,WAAW;IAC1D,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC;IAClC,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB,CACrC,EAAE,SAAS,UAAU,EACrB,EAAE,SAAS,WAAW,CACpB,SAAQ,aAAa,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,CAAC;IAChD,GAAG,EAAE,wBAAwB,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,CAAC,CAAC;CAC1D"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../src/syncedObjects/array/interface.ts"],"names":[],"mappings":"","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { SharedObjectSequence } from \"@fluidframework/sequence\";\nimport {\n IViewState,\n IFluidState,\n IFluidReducer,\n IFluidDataProps,\n FluidStateUpdateFunction,\n} from \"../..\";\n\n/**\n * The state interface exposed to the view for the synced array\n */\nexport interface ISyncedArrayViewState<T> extends IViewState {\n values: T[];\n}\n\n/**\n * The state interface for the Fluid data source that powers the synced array\n */\nexport interface ISyncedArrayFluidState<T> extends IFluidState {\n values: SharedObjectSequence<T>;\n}\n\n/**\n * The reducer interface for modifying the synced array\n * TODO: Add more functions that further expose the SharedObjectSequence interface for use\n */\nexport interface ISyncedArrayReducer<T> {\n add: (value: T) => void;\n}\n\n/**\n * The underlying reducer interface passed to the useReducerFluid hook to bind the view and Fluid\n * state definitions together\n */\nexport interface IFluidSyncedArrayReducer<\n SV extends IViewState,\n SF extends IFluidState\n > extends IFluidReducer<SV, SF, IFluidDataProps> {\n add: FluidStateUpdateFunction<SV, SF, IFluidDataProps>;\n}\n"]}
@@ -1,30 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { SharedObjectSequence } from "@fluidframework/sequence";
6
- import { SyncedDataObject } from "../..";
7
- import { ISyncedArrayReducer } from "./interface";
8
- /**
9
- * Function to set the config for a synced array on a syncedDataObject's SharedMap synced state. This
10
- * will initialize and provide a SharedObjectSequence<T> for the view to use through a T[] interface.
11
- * This SharedObjectSequence provided is automatically bound to the state update of the
12
- * functional view useSyncedArray is called in.
13
- * @param syncedDataObject - The Fluid data object on which the synced state config is being set
14
- * @param syncedStateId - The ID of the view state that this config schema is being set for
15
- * @param defaultValue - The default values in the view array prior to the SharedObjectSequence initializing
16
- * @param sharedObjectCreate - The creation function for the SharedObjectSequence. This can be set to
17
- * pre-increment the sequence with initial values.
18
- */
19
- export declare function setSyncedArrayConfig<T>(syncedDataObject: SyncedDataObject, syncedStateId: string, defaultValue?: T[], sharedObjectCreate?: typeof SharedObjectSequence.create): void;
20
- /**
21
- * Function to use the synced array state powered by a SharedObjectSequence<T> that has been prepared for this view
22
- * @param syncedDataObject - The Fluid data object that holds the synced state config for this view
23
- * @param syncedStateId - The ID of this view state
24
- * @returns [
25
- * the array of T objects currently in the SharedObjectSequence,
26
- * the reducer to modify values on the SharedObjectSequence
27
- * ]
28
- */
29
- export declare function useSyncedArray<T>(syncedDataObject: SyncedDataObject, syncedStateId: string, defaultValue?: T[]): [T[], ISyncedArrayReducer<T>];
30
- //# sourceMappingURL=syncedArray.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"syncedArray.d.ts","sourceRoot":"","sources":["../../../src/syncedObjects/array/syncedArray.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAiD,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGjG;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAClC,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,MAAM,EACrB,YAAY,GAAE,CAAC,EAAO,EACtB,kBAAkB,qCAA8B,QAUnD;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC5B,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,MAAM,EACrB,YAAY,MAAY,GACzB,CAAC,CAAC,EAAE,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAe/B"}