@microsoft/live-share-react 2.0.0-internal.1 → 2.0.0-internal.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +64 -61
- package/README.md +173 -168
- package/bin/cjs/index.d.ts +7 -0
- package/bin/cjs/index.d.ts.map +1 -0
- package/bin/cjs/index.js +23 -0
- package/bin/cjs/index.js.map +1 -0
- package/bin/cjs/interfaces/LiveInterfaceExtensions.d.ts.map +1 -0
- package/bin/cjs/interfaces/LiveInterfaceExtensions.js +7 -0
- package/bin/cjs/interfaces/LiveInterfaceExtensions.js.map +1 -0
- package/bin/cjs/interfaces/index.d.ts +2 -0
- package/bin/cjs/interfaces/index.d.ts.map +1 -0
- package/bin/cjs/interfaces/index.js +18 -0
- package/bin/cjs/interfaces/index.js.map +1 -0
- package/bin/cjs/internal/errors.d.ts.map +1 -0
- package/bin/cjs/internal/errors.js +48 -0
- package/bin/cjs/internal/errors.js.map +1 -0
- package/bin/cjs/internal/index.d.ts +3 -0
- package/bin/cjs/internal/index.d.ts.map +1 -0
- package/bin/cjs/internal/index.js +19 -0
- package/bin/cjs/internal/index.js.map +1 -0
- package/bin/{internal → cjs/internal}/type-guards.d.ts +1 -1
- package/bin/cjs/internal/type-guards.d.ts.map +1 -0
- package/bin/cjs/internal/type-guards.js +24 -0
- package/bin/cjs/internal/type-guards.js.map +1 -0
- package/bin/cjs/live-hooks/index.d.ts +8 -0
- package/bin/cjs/live-hooks/index.d.ts.map +1 -0
- package/bin/cjs/live-hooks/index.js +24 -0
- package/bin/cjs/live-hooks/index.js.map +1 -0
- package/bin/cjs/live-hooks/useLiveCanvas.d.ts +80 -0
- package/bin/cjs/live-hooks/useLiveCanvas.d.ts.map +1 -0
- package/bin/cjs/live-hooks/useLiveCanvas.js +244 -0
- package/bin/cjs/live-hooks/useLiveCanvas.js.map +1 -0
- package/bin/{live-hooks → cjs/live-hooks}/useLiveEvent.d.ts +37 -1
- package/bin/cjs/live-hooks/useLiveEvent.d.ts.map +1 -0
- package/bin/cjs/live-hooks/useLiveEvent.js +150 -0
- package/bin/cjs/live-hooks/useLiveEvent.js.map +1 -0
- package/bin/cjs/live-hooks/useLiveFollowMode.d.ts +163 -0
- package/bin/cjs/live-hooks/useLiveFollowMode.d.ts.map +1 -0
- package/bin/cjs/live-hooks/useLiveFollowMode.js +360 -0
- package/bin/cjs/live-hooks/useLiveFollowMode.js.map +1 -0
- package/bin/cjs/live-hooks/useLivePresence.d.ts +76 -0
- package/bin/cjs/live-hooks/useLivePresence.d.ts.map +1 -0
- package/bin/cjs/live-hooks/useLivePresence.js +170 -0
- package/bin/cjs/live-hooks/useLivePresence.js.map +1 -0
- package/bin/{live-hooks → cjs/live-hooks}/useLiveState.d.ts +46 -1
- package/bin/cjs/live-hooks/useLiveState.d.ts.map +1 -0
- package/bin/cjs/live-hooks/useLiveState.js +134 -0
- package/bin/cjs/live-hooks/useLiveState.js.map +1 -0
- package/bin/{live-hooks → cjs/live-hooks}/useLiveTimer.d.ts +56 -1
- package/bin/cjs/live-hooks/useLiveTimer.d.ts.map +1 -0
- package/bin/cjs/live-hooks/useLiveTimer.js +233 -0
- package/bin/cjs/live-hooks/useLiveTimer.js.map +1 -0
- package/bin/cjs/live-hooks/useMediaSynchronizer.d.ts +86 -0
- package/bin/cjs/live-hooks/useMediaSynchronizer.d.ts.map +1 -0
- package/bin/cjs/live-hooks/useMediaSynchronizer.js +301 -0
- package/bin/cjs/live-hooks/useMediaSynchronizer.js.map +1 -0
- package/bin/cjs/package.json +1 -0
- package/bin/{providers → cjs/providers}/AzureProvider.d.ts +9 -9
- package/bin/cjs/providers/AzureProvider.d.ts.map +1 -0
- package/bin/cjs/providers/AzureProvider.js +127 -0
- package/bin/cjs/providers/AzureProvider.js.map +1 -0
- package/bin/{providers → cjs/providers}/LiveShareProvider.d.ts +106 -4
- package/bin/cjs/providers/LiveShareProvider.d.ts.map +1 -0
- package/bin/cjs/providers/LiveShareProvider.js +205 -0
- package/bin/cjs/providers/LiveShareProvider.js.map +1 -0
- package/bin/cjs/providers/index.d.ts +3 -0
- package/bin/cjs/providers/index.d.ts.map +1 -0
- package/bin/cjs/providers/index.js +19 -0
- package/bin/cjs/providers/index.js.map +1 -0
- package/bin/cjs/shared-hooks/index.d.ts +7 -0
- package/bin/cjs/shared-hooks/index.d.ts.map +1 -0
- package/bin/cjs/shared-hooks/index.js +23 -0
- package/bin/cjs/shared-hooks/index.js.map +1 -0
- package/bin/cjs/shared-hooks/internals/tree-node-constants.d.ts +3 -0
- package/bin/cjs/shared-hooks/internals/tree-node-constants.d.ts.map +1 -0
- package/bin/cjs/shared-hooks/internals/tree-node-constants.js +6 -0
- package/bin/cjs/shared-hooks/internals/tree-node-constants.js.map +1 -0
- package/bin/cjs/shared-hooks/internals/tree-node-types.d.ts +10 -0
- package/bin/cjs/shared-hooks/internals/tree-node-types.d.ts.map +1 -0
- package/bin/cjs/shared-hooks/internals/tree-node-types.js +23 -0
- package/bin/cjs/shared-hooks/internals/tree-node-types.js.map +1 -0
- package/bin/cjs/shared-hooks/internals/tree-node-utils.d.ts +33 -0
- package/bin/cjs/shared-hooks/internals/tree-node-utils.d.ts.map +1 -0
- package/bin/cjs/shared-hooks/internals/tree-node-utils.js +193 -0
- package/bin/cjs/shared-hooks/internals/tree-node-utils.js.map +1 -0
- package/bin/{shared-hooks → cjs/shared-hooks}/useDynamicDDS.d.ts +4 -4
- package/bin/cjs/shared-hooks/useDynamicDDS.d.ts.map +1 -0
- package/bin/cjs/shared-hooks/useDynamicDDS.js +87 -0
- package/bin/cjs/shared-hooks/useDynamicDDS.js.map +1 -0
- package/bin/{shared-hooks → cjs/shared-hooks}/useSharedMap.d.ts +4 -2
- package/bin/cjs/shared-hooks/useSharedMap.d.ts.map +1 -0
- package/bin/cjs/shared-hooks/useSharedMap.js +134 -0
- package/bin/cjs/shared-hooks/useSharedMap.js.map +1 -0
- package/bin/{shared-hooks → cjs/shared-hooks}/useSharedState.d.ts +1 -1
- package/bin/cjs/shared-hooks/useSharedState.d.ts.map +1 -0
- package/bin/cjs/shared-hooks/useSharedState.js +80 -0
- package/bin/cjs/shared-hooks/useSharedState.js.map +1 -0
- package/bin/{shared-hooks → cjs/shared-hooks}/useSharedStateRegistry.d.ts +1 -1
- package/bin/cjs/shared-hooks/useSharedStateRegistry.d.ts.map +1 -0
- package/bin/cjs/shared-hooks/useSharedStateRegistry.js +120 -0
- package/bin/cjs/shared-hooks/useSharedStateRegistry.js.map +1 -0
- package/bin/cjs/shared-hooks/useSharedTree.d.ts +57 -0
- package/bin/cjs/shared-hooks/useSharedTree.d.ts.map +1 -0
- package/bin/cjs/shared-hooks/useSharedTree.js +123 -0
- package/bin/cjs/shared-hooks/useSharedTree.js.map +1 -0
- package/bin/cjs/shared-hooks/useTreeNode.d.ts +96 -0
- package/bin/cjs/shared-hooks/useTreeNode.d.ts.map +1 -0
- package/bin/cjs/shared-hooks/useTreeNode.js +135 -0
- package/bin/cjs/shared-hooks/useTreeNode.js.map +1 -0
- package/bin/{types → cjs/types}/ActionTypes.d.ts +7 -7
- package/bin/cjs/types/ActionTypes.d.ts.map +1 -0
- package/bin/cjs/types/ActionTypes.js +7 -0
- package/bin/cjs/types/ActionTypes.js.map +1 -0
- package/bin/cjs/types/PropTypes.d.ts +56 -0
- package/bin/cjs/types/PropTypes.d.ts.map +1 -0
- package/bin/cjs/types/PropTypes.js +7 -0
- package/bin/cjs/types/PropTypes.js.map +1 -0
- package/bin/{types → cjs/types}/ResultTypes.d.ts +50 -18
- package/bin/cjs/types/ResultTypes.d.ts.map +1 -0
- package/bin/cjs/types/ResultTypes.js +7 -0
- package/bin/cjs/types/ResultTypes.js.map +1 -0
- package/bin/cjs/types/index.d.ts +4 -0
- package/bin/cjs/types/index.d.ts.map +1 -0
- package/bin/cjs/types/index.js +20 -0
- package/bin/cjs/types/index.js.map +1 -0
- package/bin/cjs/utils/index.d.ts +2 -0
- package/bin/cjs/utils/index.d.ts.map +1 -0
- package/bin/cjs/utils/index.js +18 -0
- package/bin/cjs/utils/index.js.map +1 -0
- package/bin/cjs/utils/type-check.d.ts.map +1 -0
- package/bin/cjs/utils/type-check.js +62 -0
- package/bin/cjs/utils/type-check.js.map +1 -0
- package/bin/esm/index.d.ts +7 -0
- package/bin/esm/index.d.ts.map +1 -0
- package/bin/esm/index.js +7 -0
- package/bin/esm/index.js.map +1 -0
- package/bin/esm/interfaces/LiveInterfaceExtensions.d.ts +26 -0
- package/bin/esm/interfaces/LiveInterfaceExtensions.d.ts.map +1 -0
- package/bin/esm/interfaces/LiveInterfaceExtensions.js.map +1 -0
- package/bin/esm/interfaces/index.d.ts +2 -0
- package/bin/esm/interfaces/index.d.ts.map +1 -0
- package/bin/esm/interfaces/index.js +2 -0
- package/bin/esm/interfaces/index.js.map +1 -0
- package/bin/esm/internal/errors.d.ts +41 -0
- package/bin/esm/internal/errors.d.ts.map +1 -0
- package/bin/esm/internal/errors.js.map +1 -0
- package/bin/esm/internal/index.d.ts +3 -0
- package/bin/esm/internal/index.d.ts.map +1 -0
- package/bin/esm/internal/index.js +3 -0
- package/bin/esm/internal/index.js.map +1 -0
- package/bin/esm/internal/type-guards.d.ts +11 -0
- package/bin/esm/internal/type-guards.d.ts.map +1 -0
- package/bin/esm/internal/type-guards.js.map +1 -0
- package/bin/esm/live-hooks/index.d.ts +8 -0
- package/bin/esm/live-hooks/index.d.ts.map +1 -0
- package/bin/esm/live-hooks/index.js +8 -0
- package/bin/esm/live-hooks/index.js.map +1 -0
- package/bin/esm/live-hooks/useLiveCanvas.d.ts +80 -0
- package/bin/esm/live-hooks/useLiveCanvas.d.ts.map +1 -0
- package/bin/esm/live-hooks/useLiveCanvas.js +238 -0
- package/bin/esm/live-hooks/useLiveCanvas.js.map +1 -0
- package/bin/esm/live-hooks/useLiveEvent.d.ts +59 -0
- package/bin/esm/live-hooks/useLiveEvent.d.ts.map +1 -0
- package/bin/{live-hooks → esm/live-hooks}/useLiveEvent.js +41 -5
- package/bin/esm/live-hooks/useLiveEvent.js.map +1 -0
- package/bin/esm/live-hooks/useLiveFollowMode.d.ts +163 -0
- package/bin/esm/live-hooks/useLiveFollowMode.d.ts.map +1 -0
- package/bin/{live-hooks → esm/live-hooks}/useLiveFollowMode.js +148 -5
- package/bin/esm/live-hooks/useLiveFollowMode.js.map +1 -0
- package/bin/esm/live-hooks/useLivePresence.d.ts +76 -0
- package/bin/esm/live-hooks/useLivePresence.d.ts.map +1 -0
- package/bin/{live-hooks → esm/live-hooks}/useLivePresence.js +71 -13
- package/bin/esm/live-hooks/useLivePresence.js.map +1 -0
- package/bin/esm/live-hooks/useLiveState.d.ts +66 -0
- package/bin/esm/live-hooks/useLiveState.d.ts.map +1 -0
- package/bin/{live-hooks → esm/live-hooks}/useLiveState.js +54 -5
- package/bin/esm/live-hooks/useLiveState.js.map +1 -0
- package/bin/esm/live-hooks/useLiveTimer.d.ts +80 -0
- package/bin/esm/live-hooks/useLiveTimer.d.ts.map +1 -0
- package/bin/{live-hooks → esm/live-hooks}/useLiveTimer.js +58 -3
- package/bin/esm/live-hooks/useLiveTimer.js.map +1 -0
- package/bin/esm/live-hooks/useMediaSynchronizer.d.ts +86 -0
- package/bin/esm/live-hooks/useMediaSynchronizer.d.ts.map +1 -0
- package/bin/{live-hooks → esm/live-hooks}/useMediaSynchronizer.js +66 -5
- package/bin/esm/live-hooks/useMediaSynchronizer.js.map +1 -0
- package/bin/esm/providers/AzureProvider.d.ts +113 -0
- package/bin/esm/providers/AzureProvider.d.ts.map +1 -0
- package/bin/{providers → esm/providers}/AzureProvider.js +10 -10
- package/bin/esm/providers/AzureProvider.js.map +1 -0
- package/bin/esm/providers/LiveShareProvider.d.ts +193 -0
- package/bin/esm/providers/LiveShareProvider.d.ts.map +1 -0
- package/bin/{providers → esm/providers}/LiveShareProvider.js +111 -9
- package/bin/esm/providers/LiveShareProvider.js.map +1 -0
- package/bin/esm/providers/index.d.ts +3 -0
- package/bin/esm/providers/index.d.ts.map +1 -0
- package/bin/esm/providers/index.js +3 -0
- package/bin/esm/providers/index.js.map +1 -0
- package/bin/esm/shared-hooks/index.d.ts +7 -0
- package/bin/esm/shared-hooks/index.d.ts.map +1 -0
- package/bin/esm/shared-hooks/index.js +7 -0
- package/bin/esm/shared-hooks/index.js.map +1 -0
- package/bin/esm/shared-hooks/internals/tree-node-constants.d.ts +3 -0
- package/bin/esm/shared-hooks/internals/tree-node-constants.d.ts.map +1 -0
- package/bin/esm/shared-hooks/internals/tree-node-constants.js +3 -0
- package/bin/esm/shared-hooks/internals/tree-node-constants.js.map +1 -0
- package/bin/esm/shared-hooks/internals/tree-node-types.d.ts +10 -0
- package/bin/esm/shared-hooks/internals/tree-node-types.d.ts.map +1 -0
- package/bin/esm/shared-hooks/internals/tree-node-types.js +18 -0
- package/bin/esm/shared-hooks/internals/tree-node-types.js.map +1 -0
- package/bin/esm/shared-hooks/internals/tree-node-utils.d.ts +33 -0
- package/bin/esm/shared-hooks/internals/tree-node-utils.d.ts.map +1 -0
- package/bin/esm/shared-hooks/internals/tree-node-utils.js +188 -0
- package/bin/esm/shared-hooks/internals/tree-node-utils.js.map +1 -0
- package/bin/esm/shared-hooks/useDynamicDDS.d.ts +23 -0
- package/bin/esm/shared-hooks/useDynamicDDS.d.ts.map +1 -0
- package/bin/{shared-hooks → esm/shared-hooks}/useDynamicDDS.js +20 -11
- package/bin/esm/shared-hooks/useDynamicDDS.js.map +1 -0
- package/bin/esm/shared-hooks/useSharedMap.d.ts +25 -0
- package/bin/esm/shared-hooks/useSharedMap.d.ts.map +1 -0
- package/bin/{shared-hooks → esm/shared-hooks}/useSharedMap.js +27 -13
- package/bin/esm/shared-hooks/useSharedMap.js.map +1 -0
- package/bin/esm/shared-hooks/useSharedState.d.ts +22 -0
- package/bin/esm/shared-hooks/useSharedState.d.ts.map +1 -0
- package/bin/{shared-hooks → esm/shared-hooks}/useSharedState.js +2 -2
- package/bin/esm/shared-hooks/useSharedState.js.map +1 -0
- package/bin/esm/shared-hooks/useSharedStateRegistry.d.ts +37 -0
- package/bin/esm/shared-hooks/useSharedStateRegistry.d.ts.map +1 -0
- package/bin/{shared-hooks → esm/shared-hooks}/useSharedStateRegistry.js +27 -19
- package/bin/esm/shared-hooks/useSharedStateRegistry.js.map +1 -0
- package/bin/esm/shared-hooks/useSharedTree.d.ts +57 -0
- package/bin/esm/shared-hooks/useSharedTree.d.ts.map +1 -0
- package/bin/esm/shared-hooks/useSharedTree.js +117 -0
- package/bin/esm/shared-hooks/useSharedTree.js.map +1 -0
- package/bin/esm/shared-hooks/useTreeNode.d.ts +96 -0
- package/bin/esm/shared-hooks/useTreeNode.d.ts.map +1 -0
- package/bin/esm/shared-hooks/useTreeNode.js +132 -0
- package/bin/esm/shared-hooks/useTreeNode.js.map +1 -0
- package/bin/esm/types/ActionTypes.d.ts +112 -0
- package/bin/esm/types/ActionTypes.d.ts.map +1 -0
- package/bin/esm/types/ActionTypes.js.map +1 -0
- package/bin/esm/types/PropTypes.d.ts +56 -0
- package/bin/esm/types/PropTypes.d.ts.map +1 -0
- package/bin/esm/types/PropTypes.js.map +1 -0
- package/bin/esm/types/ResultTypes.d.ts +334 -0
- package/bin/esm/types/ResultTypes.d.ts.map +1 -0
- package/bin/esm/types/ResultTypes.js.map +1 -0
- package/bin/esm/types/index.d.ts +4 -0
- package/bin/esm/types/index.d.ts.map +1 -0
- package/bin/esm/types/index.js +4 -0
- package/bin/esm/types/index.js.map +1 -0
- package/bin/esm/utils/index.d.ts +2 -0
- package/bin/esm/utils/index.d.ts.map +1 -0
- package/bin/esm/utils/index.js +2 -0
- package/bin/esm/utils/index.js.map +1 -0
- package/bin/esm/utils/type-check.d.ts +15 -0
- package/bin/esm/utils/type-check.d.ts.map +1 -0
- package/bin/esm/utils/type-check.js.map +1 -0
- package/package.json +61 -47
- package/src/index.ts +6 -6
- package/src/interfaces/index.ts +1 -1
- package/src/internal/index.ts +2 -2
- package/src/internal/type-guards.ts +1 -1
- package/src/live-hooks/index.ts +7 -7
- package/src/live-hooks/useLiveCanvas.ts +154 -82
- package/src/live-hooks/useLiveEvent.ts +43 -7
- package/src/live-hooks/useLiveFollowMode.ts +149 -6
- package/src/live-hooks/useLivePresence.ts +80 -17
- package/src/live-hooks/useLiveState.ts +54 -6
- package/src/live-hooks/useLiveTimer.ts +59 -4
- package/src/live-hooks/useMediaSynchronizer.ts +71 -6
- package/src/providers/AzureProvider.tsx +21 -21
- package/src/providers/LiveShareProvider.tsx +115 -13
- package/src/providers/index.ts +2 -2
- package/src/shared-hooks/index.ts +6 -4
- package/src/shared-hooks/internals/tree-node-constants.ts +2 -0
- package/src/shared-hooks/internals/tree-node-types.ts +26 -0
- package/src/shared-hooks/internals/tree-node-utils.ts +269 -0
- package/src/shared-hooks/useDynamicDDS.ts +28 -17
- package/src/shared-hooks/useSharedMap.ts +42 -17
- package/src/shared-hooks/useSharedState.ts +6 -3
- package/src/shared-hooks/useSharedStateRegistry.ts +44 -22
- package/src/shared-hooks/useSharedTree.ts +144 -0
- package/src/shared-hooks/useTreeNode.ts +147 -0
- package/src/types/ActionTypes.ts +13 -9
- package/src/types/PropTypes.ts +57 -0
- package/src/types/ResultTypes.ts +71 -17
- package/src/types/index.ts +3 -3
- package/src/utils/index.ts +1 -1
- package/tsconfig.cjs.json +14 -0
- package/tsconfig.json +65 -70
- package/.nycrc.json +0 -10
- package/bin/index.d.ts +0 -7
- package/bin/index.d.ts.map +0 -1
- package/bin/index.js +0 -7
- package/bin/index.js.map +0 -1
- package/bin/interfaces/LiveInterfaceExtensions.d.ts.map +0 -1
- package/bin/interfaces/LiveInterfaceExtensions.js.map +0 -1
- package/bin/interfaces/index.d.ts +0 -2
- package/bin/interfaces/index.d.ts.map +0 -1
- package/bin/interfaces/index.js +0 -2
- package/bin/interfaces/index.js.map +0 -1
- package/bin/internal/errors.d.ts.map +0 -1
- package/bin/internal/errors.js.map +0 -1
- package/bin/internal/index.d.ts +0 -3
- package/bin/internal/index.d.ts.map +0 -1
- package/bin/internal/index.js +0 -3
- package/bin/internal/index.js.map +0 -1
- package/bin/internal/type-guards.d.ts.map +0 -1
- package/bin/internal/type-guards.js.map +0 -1
- package/bin/live-hooks/index.d.ts +0 -8
- package/bin/live-hooks/index.d.ts.map +0 -1
- package/bin/live-hooks/index.js +0 -8
- package/bin/live-hooks/index.js.map +0 -1
- package/bin/live-hooks/useLiveCanvas.d.ts +0 -29
- package/bin/live-hooks/useLiveCanvas.d.ts.map +0 -1
- package/bin/live-hooks/useLiveCanvas.js +0 -160
- package/bin/live-hooks/useLiveCanvas.js.map +0 -1
- package/bin/live-hooks/useLiveEvent.d.ts.map +0 -1
- package/bin/live-hooks/useLiveEvent.js.map +0 -1
- package/bin/live-hooks/useLiveFollowMode.d.ts +0 -24
- package/bin/live-hooks/useLiveFollowMode.d.ts.map +0 -1
- package/bin/live-hooks/useLiveFollowMode.js.map +0 -1
- package/bin/live-hooks/useLivePresence.d.ts +0 -26
- package/bin/live-hooks/useLivePresence.d.ts.map +0 -1
- package/bin/live-hooks/useLivePresence.js.map +0 -1
- package/bin/live-hooks/useLiveState.d.ts.map +0 -1
- package/bin/live-hooks/useLiveState.js.map +0 -1
- package/bin/live-hooks/useLiveTimer.d.ts.map +0 -1
- package/bin/live-hooks/useLiveTimer.js.map +0 -1
- package/bin/live-hooks/useMediaSynchronizer.d.ts +0 -25
- package/bin/live-hooks/useMediaSynchronizer.d.ts.map +0 -1
- package/bin/live-hooks/useMediaSynchronizer.js.map +0 -1
- package/bin/providers/AzureProvider.d.ts.map +0 -1
- package/bin/providers/AzureProvider.js.map +0 -1
- package/bin/providers/LiveShareProvider.d.ts.map +0 -1
- package/bin/providers/LiveShareProvider.js.map +0 -1
- package/bin/providers/index.d.ts +0 -3
- package/bin/providers/index.d.ts.map +0 -1
- package/bin/providers/index.js +0 -3
- package/bin/providers/index.js.map +0 -1
- package/bin/shared-hooks/index.d.ts +0 -5
- package/bin/shared-hooks/index.d.ts.map +0 -1
- package/bin/shared-hooks/index.js +0 -5
- package/bin/shared-hooks/index.js.map +0 -1
- package/bin/shared-hooks/useDynamicDDS.d.ts.map +0 -1
- package/bin/shared-hooks/useDynamicDDS.js.map +0 -1
- package/bin/shared-hooks/useSharedMap.d.ts.map +0 -1
- package/bin/shared-hooks/useSharedMap.js.map +0 -1
- package/bin/shared-hooks/useSharedState.d.ts.map +0 -1
- package/bin/shared-hooks/useSharedState.js.map +0 -1
- package/bin/shared-hooks/useSharedStateRegistry.d.ts.map +0 -1
- package/bin/shared-hooks/useSharedStateRegistry.js.map +0 -1
- package/bin/types/ActionTypes.d.ts.map +0 -1
- package/bin/types/ActionTypes.js.map +0 -1
- package/bin/types/PropTypes.d.ts +0 -8
- package/bin/types/PropTypes.d.ts.map +0 -1
- package/bin/types/PropTypes.js.map +0 -1
- package/bin/types/ResultTypes.d.ts.map +0 -1
- package/bin/types/ResultTypes.js.map +0 -1
- package/bin/types/index.d.ts +0 -4
- package/bin/types/index.d.ts.map +0 -1
- package/bin/types/index.js +0 -4
- package/bin/types/index.js.map +0 -1
- package/bin/utils/index.d.ts +0 -2
- package/bin/utils/index.d.ts.map +0 -1
- package/bin/utils/index.js +0 -2
- package/bin/utils/index.js.map +0 -1
- package/bin/utils/type-check.d.ts.map +0 -1
- package/bin/utils/type-check.js.map +0 -1
- package/tsconfig.build.json +0 -6
- /package/bin/{interfaces → cjs/interfaces}/LiveInterfaceExtensions.d.ts +0 -0
- /package/bin/{internal → cjs/internal}/errors.d.ts +0 -0
- /package/bin/{utils → cjs/utils}/type-check.d.ts +0 -0
- /package/bin/{interfaces → esm/interfaces}/LiveInterfaceExtensions.js +0 -0
- /package/bin/{internal → esm/internal}/errors.js +0 -0
- /package/bin/{internal → esm/internal}/type-guards.js +0 -0
- /package/bin/{types → esm/types}/ActionTypes.js +0 -0
- /package/bin/{types → esm/types}/PropTypes.js +0 -0
- /package/bin/{types → esm/types}/ResultTypes.js +0 -0
- /package/bin/{utils → esm/utils}/type-check.js +0 -0
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Licensed under the Microsoft Live Share SDK License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { ContainerSchema, IFluidContainer } from "fluid-framework";
|
|
6
6
|
import React from "react";
|
|
7
7
|
import { AzureClientProps, AzureContainerServices } from "@fluidframework/azure-client";
|
|
8
|
-
import { IAzureContainerResults } from "../types";
|
|
9
|
-
import { ISharedStateRegistryResponse } from "../shared-hooks";
|
|
10
|
-
import {
|
|
8
|
+
import { IAzureContainerResults } from "../types/index.js";
|
|
9
|
+
import { ISharedStateRegistryResponse } from "../shared-hooks/index.js";
|
|
10
|
+
import { BaseLiveShareClient } from "@microsoft/live-share/internal";
|
|
11
11
|
/**
|
|
12
12
|
* React Context provider values for `<AzureProvider>` and `<LiveShareProvider>`.
|
|
13
13
|
*
|
|
@@ -18,7 +18,7 @@ export interface IFluidContext extends ISharedStateRegistryResponse {
|
|
|
18
18
|
/**
|
|
19
19
|
* The Fluid Turbo client used for connecting to the Fluid container.
|
|
20
20
|
*/
|
|
21
|
-
clientRef: React.MutableRefObject<
|
|
21
|
+
clientRef: React.MutableRefObject<BaseLiveShareClient>;
|
|
22
22
|
/**
|
|
23
23
|
* Stateful Fluid container.
|
|
24
24
|
*/
|
|
@@ -41,7 +41,7 @@ export interface IFluidContext extends ISharedStateRegistryResponse {
|
|
|
41
41
|
* @param initialObjects Optional. initial object schema, which should match that passed to `createContainer()`.
|
|
42
42
|
* @returns promise that returns a results object once complete (e.g., container, services, etc.)
|
|
43
43
|
*/
|
|
44
|
-
getContainer: (containerId: string,
|
|
44
|
+
getContainer: (containerId: string, fluidContainerSchema?: ContainerSchema) => Promise<IAzureContainerResults>;
|
|
45
45
|
/**
|
|
46
46
|
* React callback function to create and connect to a new Fluid container.
|
|
47
47
|
*
|
|
@@ -52,7 +52,7 @@ export interface IFluidContext extends ISharedStateRegistryResponse {
|
|
|
52
52
|
* @param onInitializeContainer Optional. A callback for when the container is first initialized, which is useful for setting default values to objects in `initialObjects`.
|
|
53
53
|
* @returns promise that returns a results object once complete (e.g., container, services, etc.)
|
|
54
54
|
*/
|
|
55
|
-
createContainer: (
|
|
55
|
+
createContainer: (fluidContainerSchema?: ContainerSchema, onInitializeContainer?: (container: IFluidContainer) => void) => Promise<IAzureContainerResults>;
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* @hidden
|
|
@@ -95,9 +95,9 @@ export interface IAzureProviderProps {
|
|
|
95
95
|
*/
|
|
96
96
|
createOnLoad?: boolean;
|
|
97
97
|
/**
|
|
98
|
-
* The initial
|
|
98
|
+
* The initial schema to use when {@link joinOnLoad} or {@link createOnLoad} is true.
|
|
99
99
|
*/
|
|
100
|
-
|
|
100
|
+
fluidContainerSchema?: ContainerSchema;
|
|
101
101
|
/**
|
|
102
102
|
* Flag to control whether or not to connect to an existing container on first mount.
|
|
103
103
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AzureProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/AzureProvider.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACH,gBAAgB,EAChB,sBAAsB,EACzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EACH,4BAA4B,EAE/B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAErE;;;;;GAKG;AACH,MAAM,WAAW,aAAc,SAAQ,4BAA4B;IAC/D;;OAEG;IACH,SAAS,EAAE,KAAK,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,CAAC;IACvD;;OAEG;IACH,SAAS,EAAE,eAAe,GAAG,SAAS,CAAC;IACvC;;OAEG;IACH,QAAQ,EAAE,sBAAsB,GAAG,SAAS,CAAC;IAC7C;;OAEG;IACH,SAAS,EAAE,KAAK,GAAG,SAAS,CAAC;IAC7B;;;;;;;;;OASG;IACH,YAAY,EAAE,CACV,WAAW,EAAE,MAAM,EACnB,oBAAoB,CAAC,EAAE,eAAe,KACrC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACrC;;;;;;;;;OASG;IACH,eAAe,EAAE,CACb,oBAAoB,CAAC,EAAE,eAAe,EACtC,qBAAqB,CAAC,EAAE,CAAC,SAAS,EAAE,eAAe,KAAK,IAAI,KAC3D,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACxC;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,8BAExB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,QAAO,aAQzC,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,aAAa,EAAE,gBAAgB,CAAC;IAChC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,oBAAoB,CAAC,EAAE,eAAe,CAAC;IACvC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAoHvD,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.AzureProvider = exports.useFluidObjectsContext = exports.FluidContext = void 0;
|
|
16
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
17
|
+
const react_1 = __importDefault(require("react"));
|
|
18
|
+
const index_js_1 = require("../shared-hooks/index.js");
|
|
19
|
+
const live_share_1 = require("@microsoft/live-share");
|
|
20
|
+
/**
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
exports.FluidContext = react_1.default.createContext({});
|
|
24
|
+
/**
|
|
25
|
+
* Hook to get the latest React context state for `FluidContext`.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* This hook can only be used in a child component of `<LiveShareProvider>` or `<AzureProvider>`.
|
|
29
|
+
*
|
|
30
|
+
* @returns current state of `LiveShareContext`
|
|
31
|
+
*/
|
|
32
|
+
const useFluidObjectsContext = () => {
|
|
33
|
+
const context = react_1.default.useContext(exports.FluidContext);
|
|
34
|
+
if (!isFluidObjectsContext(context)) {
|
|
35
|
+
throw new Error("@microsoft/live-share-react: attempting to use `useFluidObjectsContext()` from a component that is not a child of `<LiveShareProvider>` or `<AzureProvider>`.\nTo fix this error, ensure that you are only using Live Share hooks (e.g., `useLiveState`) from a child component of `<LiveShareProvider>` or `<AzureProvider>`.");
|
|
36
|
+
}
|
|
37
|
+
return context;
|
|
38
|
+
};
|
|
39
|
+
exports.useFluidObjectsContext = useFluidObjectsContext;
|
|
40
|
+
/**
|
|
41
|
+
* React Context provider component for using Fluid data objects & joining/creating a Fluid document `AzureClient`.
|
|
42
|
+
*/
|
|
43
|
+
const AzureProvider = (props) => {
|
|
44
|
+
var _a;
|
|
45
|
+
const startedRef = react_1.default.useRef(false);
|
|
46
|
+
const clientRef = react_1.default.useRef(new live_share_1.AzureLiveShareClient(props.clientOptions));
|
|
47
|
+
const [results, setResults] = react_1.default.useState();
|
|
48
|
+
const [joinError, setJoinError] = react_1.default.useState();
|
|
49
|
+
const stateRegistryCallbacks = (0, index_js_1.useSharedStateRegistry)(results);
|
|
50
|
+
/**
|
|
51
|
+
* Get the container for a given containerId using AzureClient
|
|
52
|
+
*/
|
|
53
|
+
const getContainer = react_1.default.useCallback((containerId, fluidContainerSchema) => __awaiter(void 0, void 0, void 0, function* () {
|
|
54
|
+
return new Promise((resolve, reject) => __awaiter(void 0, void 0, void 0, function* () {
|
|
55
|
+
try {
|
|
56
|
+
const results = yield clientRef.current.getContainer(containerId, fluidContainerSchema);
|
|
57
|
+
setResults(results);
|
|
58
|
+
resolve(results);
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
if (error instanceof Error) {
|
|
62
|
+
setJoinError(error);
|
|
63
|
+
}
|
|
64
|
+
reject(error);
|
|
65
|
+
}
|
|
66
|
+
}));
|
|
67
|
+
}), [props.containerId, setResults]);
|
|
68
|
+
/**
|
|
69
|
+
* Create container callback to create a new container using AzureClient
|
|
70
|
+
*/
|
|
71
|
+
const createContainer = react_1.default.useCallback((fluidContainerSchema, onInitializeContainer) => __awaiter(void 0, void 0, void 0, function* () {
|
|
72
|
+
return new Promise((resolve, reject) => __awaiter(void 0, void 0, void 0, function* () {
|
|
73
|
+
try {
|
|
74
|
+
const results = yield clientRef.current.createContainer(fluidContainerSchema);
|
|
75
|
+
if (onInitializeContainer) {
|
|
76
|
+
onInitializeContainer(results.container);
|
|
77
|
+
}
|
|
78
|
+
const containerId = yield results.container.attach();
|
|
79
|
+
window.location.hash = containerId;
|
|
80
|
+
setResults(results);
|
|
81
|
+
resolve(results);
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
if (error instanceof Error) {
|
|
85
|
+
setJoinError(error);
|
|
86
|
+
}
|
|
87
|
+
reject(error);
|
|
88
|
+
}
|
|
89
|
+
}));
|
|
90
|
+
}), [props.containerId, setResults]);
|
|
91
|
+
/**
|
|
92
|
+
* Joins a container if `props.joinOnLoad` is true and `props.containerId` is known. Creates a new container if `props.createOnLoad` is true
|
|
93
|
+
* and `props.containerId` is not known.
|
|
94
|
+
*/
|
|
95
|
+
react_1.default.useEffect(() => {
|
|
96
|
+
var _a;
|
|
97
|
+
// This hook should only be called once, so we use a ref to track if it has been called.
|
|
98
|
+
// This is a workaround for the fact that useEffect is called twice on initial render in React V18.
|
|
99
|
+
// We are not doing this here for backwards compatibility. View the README for more information.
|
|
100
|
+
if (((_a = results === null || results === void 0 ? void 0 : results.container) === null || _a === void 0 ? void 0 : _a.connectionState) !== undefined ||
|
|
101
|
+
startedRef.current)
|
|
102
|
+
return;
|
|
103
|
+
startedRef.current = true;
|
|
104
|
+
if (props.containerId && props.joinOnLoad) {
|
|
105
|
+
getContainer(props.containerId, props.fluidContainerSchema);
|
|
106
|
+
}
|
|
107
|
+
else if (!props.containerId && props.createOnLoad) {
|
|
108
|
+
createContainer(props.fluidContainerSchema);
|
|
109
|
+
}
|
|
110
|
+
}, [
|
|
111
|
+
(_a = results === null || results === void 0 ? void 0 : results.container) === null || _a === void 0 ? void 0 : _a.connectionState,
|
|
112
|
+
props.containerId,
|
|
113
|
+
props.createOnLoad,
|
|
114
|
+
props.joinOnLoad,
|
|
115
|
+
props.fluidContainerSchema,
|
|
116
|
+
getContainer,
|
|
117
|
+
createContainer,
|
|
118
|
+
]);
|
|
119
|
+
return ((0, jsx_runtime_1.jsx)(exports.FluidContext.Provider, { value: Object.assign({ clientRef, container: results === null || results === void 0 ? void 0 : results.container, services: results === null || results === void 0 ? void 0 : results.services, joinError,
|
|
120
|
+
createContainer,
|
|
121
|
+
getContainer }, stateRegistryCallbacks), children: props.children }));
|
|
122
|
+
};
|
|
123
|
+
exports.AzureProvider = AzureProvider;
|
|
124
|
+
function isFluidObjectsContext(value) {
|
|
125
|
+
return !!(value === null || value === void 0 ? void 0 : value.clientRef);
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=AzureProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AzureProvider.js","sourceRoot":"","sources":["../../../src/providers/AzureProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAMA,kDAA0B;AAM1B,uDAGkC;AAClC,sDAA6D;AAwD7D;;GAEG;AACU,QAAA,YAAY,GAAG,eAAK,CAAC,aAAa,CAC3C,EAAmB,CACtB,CAAC;AAEF;;;;;;;GAOG;AACI,MAAM,sBAAsB,GAAG,GAAkB,EAAE;IACtD,MAAM,OAAO,GAAG,eAAK,CAAC,UAAU,CAAC,oBAAY,CAAC,CAAC;IAC/C,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CACX,gUAAgU,CACnU,CAAC;IACN,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;AARW,QAAA,sBAAsB,0BAQjC;AA0CF;;GAEG;AACI,MAAM,aAAa,GAAkC,CAAC,KAAK,EAAE,EAAE;;IAClE,MAAM,UAAU,GAAG,eAAK,CAAC,MAAM,CAAU,KAAK,CAAC,CAAC;IAChD,MAAM,SAAS,GAAG,eAAK,CAAC,MAAM,CAC1B,IAAI,iCAAoB,CAAC,KAAK,CAAC,aAAa,CAAC,CAChD,CAAC;IACF,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,eAAK,CAAC,QAAQ,EAEzC,CAAC;IACJ,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,eAAK,CAAC,QAAQ,EAAqB,CAAC;IAEtE,MAAM,sBAAsB,GAAG,IAAA,iCAAsB,EAAC,OA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AAO,uBAAP,OAAO,CAAE,QAAQ,EAC3B,SAAS;YACT,eAAe;YACf,YAAY,IACT,sBAAsB,aAG5B,KAAK,CAAC,QAAQ,GACK,CAC3B,CAAC;AACN,CAAC,CAAC;AApHW,QAAA,aAAa,iBAoHxB;AAEF,SAAS,qBAAqB,CAAC,KAAU;IACrC,OAAO,CAAC,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,CAAA,CAAC;AAC9B,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Licensed under the Microsoft Live Share SDK License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { ContainerSchema, IFluidContainer } from "fluid-framework";
|
|
6
6
|
import React from "react";
|
|
7
7
|
import { ILiveShareClientOptions, ILiveShareHost, ILiveShareJoinResults, ITimestampProvider } from "@microsoft/live-share";
|
|
8
8
|
/**
|
|
@@ -40,7 +40,7 @@ export interface ILiveShareContext {
|
|
|
40
40
|
* @param onInitializeContainer Optional. Callback for when the container is first created.
|
|
41
41
|
* @returns Promise with `ILiveShareJoinResults`, which includes the Fluid container
|
|
42
42
|
*/
|
|
43
|
-
join: (
|
|
43
|
+
join: (fluidContainerSchema?: ContainerSchema, onInitializeContainer?: (container: IFluidContainer) => void) => Promise<ILiveShareJoinResults>;
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* @hidden
|
|
@@ -54,6 +54,57 @@ export declare const LiveShareContext: React.Context<ILiveShareContext>;
|
|
|
54
54
|
* See `useFluidObjectsContext` for other information related to the Live Share session, such as the `container`.
|
|
55
55
|
*
|
|
56
56
|
* @returns current state of `LiveShareContext`
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
```jsx
|
|
60
|
+
// LiveShareApp.jsx
|
|
61
|
+
import { LiveShareProvider } from "@microsoft/live-share-react";
|
|
62
|
+
import { LiveShareHost } from "@microsoft/teams-js";
|
|
63
|
+
|
|
64
|
+
const host = LiveShareHost.create();
|
|
65
|
+
|
|
66
|
+
export function LiveShareApp() {
|
|
67
|
+
// Call app.initialize() from teams-js before rendering LiveShareProvider
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<LiveShareProvider
|
|
71
|
+
joinOnLoad={true}
|
|
72
|
+
host={host}
|
|
73
|
+
>
|
|
74
|
+
<LiveShareLoader>
|
|
75
|
+
<LiveCheckbox />
|
|
76
|
+
</LiveShareLoader>
|
|
77
|
+
</LiveShareProvider>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// LiveShareLoader.jsx
|
|
82
|
+
import { useLiveShareContext } from "@microsoft/live-share-react";
|
|
83
|
+
|
|
84
|
+
export function LiveShareLoader({ children }) {
|
|
85
|
+
const { joined, joinError } = useLiveShareContext();
|
|
86
|
+
|
|
87
|
+
if (joinError) return <>{joinError.message}</>;
|
|
88
|
+
if (!joined) return <>Joining Live Share session...</>;
|
|
89
|
+
return <>{children}</>
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// LiveCheckbox.jsx
|
|
93
|
+
import { useLiveState } from "@microsoft/live-share-react";
|
|
94
|
+
|
|
95
|
+
export function LiveCheckbox() {
|
|
96
|
+
const [checked, setChecked] = useLiveState("MY-UNIQUE-ID", false);
|
|
97
|
+
return (
|
|
98
|
+
<input
|
|
99
|
+
type="checkbox"
|
|
100
|
+
checked={checked}
|
|
101
|
+
onChange={() => {
|
|
102
|
+
setChecked(!checked);
|
|
103
|
+
}}
|
|
104
|
+
/>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
```
|
|
57
108
|
*/
|
|
58
109
|
export declare const useLiveShareContext: () => ILiveShareContext;
|
|
59
110
|
/**
|
|
@@ -76,9 +127,9 @@ export interface ILiveShareProviderProps {
|
|
|
76
127
|
*/
|
|
77
128
|
host: ILiveShareHost;
|
|
78
129
|
/**
|
|
79
|
-
* The
|
|
130
|
+
* The schema to use when {@link joinOnLoad} is true.
|
|
80
131
|
*/
|
|
81
|
-
|
|
132
|
+
fluidContainerSchema?: ContainerSchema;
|
|
82
133
|
/**
|
|
83
134
|
* Optional. Flag to determine whether to join Fluid container on load.
|
|
84
135
|
*/
|
|
@@ -86,6 +137,57 @@ export interface ILiveShareProviderProps {
|
|
|
86
137
|
}
|
|
87
138
|
/**
|
|
88
139
|
* React Context provider component for using Live Share data objects & joining a Live Share session using `LiveShareClient`.
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
```jsx
|
|
143
|
+
// LiveShareApp.jsx
|
|
144
|
+
import { LiveShareProvider } from "@microsoft/live-share-react";
|
|
145
|
+
import { LiveShareHost } from "@microsoft/teams-js";
|
|
146
|
+
|
|
147
|
+
const host = LiveShareHost.create();
|
|
148
|
+
|
|
149
|
+
export function LiveShareApp() {
|
|
150
|
+
// Call app.initialize() from teams-js before rendering LiveShareProvider
|
|
151
|
+
|
|
152
|
+
return (
|
|
153
|
+
<LiveShareProvider
|
|
154
|
+
joinOnLoad={true}
|
|
155
|
+
host={host}
|
|
156
|
+
>
|
|
157
|
+
<LiveShareLoader>
|
|
158
|
+
<LiveCheckbox />
|
|
159
|
+
</LiveShareLoader>
|
|
160
|
+
</LiveShareProvider>
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// LiveShareLoader.jsx
|
|
165
|
+
import { useLiveShareContext } from "@microsoft/live-share-react";
|
|
166
|
+
|
|
167
|
+
export function LiveShareLoader({ children }) {
|
|
168
|
+
const { joined, joinError } = useLiveShareContext();
|
|
169
|
+
|
|
170
|
+
if (joinError) return <>{joinError.message}</>;
|
|
171
|
+
if (!joined) return <>Joining Live Share session...</>;
|
|
172
|
+
return <>{children}</>
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// LiveCheckbox.jsx
|
|
176
|
+
import { useLiveState } from "@microsoft/live-share-react";
|
|
177
|
+
|
|
178
|
+
export function LiveCheckbox() {
|
|
179
|
+
const [checked, setChecked] = useLiveState("MY-UNIQUE-ID", false);
|
|
180
|
+
return (
|
|
181
|
+
<input
|
|
182
|
+
type="checkbox"
|
|
183
|
+
checked={checked}
|
|
184
|
+
onChange={() => {
|
|
185
|
+
setChecked(!checked);
|
|
186
|
+
}}
|
|
187
|
+
/>
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
```
|
|
89
191
|
*/
|
|
90
192
|
export declare const LiveShareProvider: React.FC<ILiveShareProviderProps>;
|
|
91
193
|
//# sourceMappingURL=LiveShareProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveShareProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/LiveShareProvider.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACH,uBAAuB,EACvB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAErB,MAAM,uBAAuB,CAAC;AAI/B;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAC9B;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,SAAS,EAAE,KAAK,GAAG,SAAS,CAAC;IAC7B;;;OAGG;IACH,iBAAiB,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAClD;;;;;;;;;OASG;IACH,IAAI,EAAE,CACF,oBAAoB,CAAC,EAAE,eAAe,EACtC,qBAAqB,CAAC,EAAE,CAAC,SAAS,EAAE,eAAe,KAAK,IAAI,KAC3D,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACvC;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,kCAE5B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,eAAO,MAAM,mBAAmB,QAAO,iBAQtC,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,aAAa,CAAC,EAAE,uBAAuB,CAAC;IACxC;;;;;OAKG;IACH,IAAI,EAAE,cAAc,CAAC;IACrB;;OAEG;IACH,oBAAoB,CAAC,EAAE,eAAe,CAAC;IACvC;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAkG/D,CAAC"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.LiveShareProvider = exports.useLiveShareContext = exports.LiveShareContext = void 0;
|
|
16
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
17
|
+
const react_1 = __importDefault(require("react"));
|
|
18
|
+
const index_js_1 = require("../shared-hooks/index.js");
|
|
19
|
+
const live_share_1 = require("@microsoft/live-share");
|
|
20
|
+
const AzureProvider_js_1 = require("./AzureProvider.js");
|
|
21
|
+
const index_js_2 = require("../internal/index.js");
|
|
22
|
+
/**
|
|
23
|
+
* @hidden
|
|
24
|
+
*/
|
|
25
|
+
exports.LiveShareContext = react_1.default.createContext({});
|
|
26
|
+
/**
|
|
27
|
+
* Hook to get the latest React context state for `LiveShareContext`.
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* This hook can only be used in a child component of `<LiveShareProvider>`.
|
|
31
|
+
* See `useFluidObjectsContext` for other information related to the Live Share session, such as the `container`.
|
|
32
|
+
*
|
|
33
|
+
* @returns current state of `LiveShareContext`
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
```jsx
|
|
37
|
+
// LiveShareApp.jsx
|
|
38
|
+
import { LiveShareProvider } from "@microsoft/live-share-react";
|
|
39
|
+
import { LiveShareHost } from "@microsoft/teams-js";
|
|
40
|
+
|
|
41
|
+
const host = LiveShareHost.create();
|
|
42
|
+
|
|
43
|
+
export function LiveShareApp() {
|
|
44
|
+
// Call app.initialize() from teams-js before rendering LiveShareProvider
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<LiveShareProvider
|
|
48
|
+
joinOnLoad={true}
|
|
49
|
+
host={host}
|
|
50
|
+
>
|
|
51
|
+
<LiveShareLoader>
|
|
52
|
+
<LiveCheckbox />
|
|
53
|
+
</LiveShareLoader>
|
|
54
|
+
</LiveShareProvider>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// LiveShareLoader.jsx
|
|
59
|
+
import { useLiveShareContext } from "@microsoft/live-share-react";
|
|
60
|
+
|
|
61
|
+
export function LiveShareLoader({ children }) {
|
|
62
|
+
const { joined, joinError } = useLiveShareContext();
|
|
63
|
+
|
|
64
|
+
if (joinError) return <>{joinError.message}</>;
|
|
65
|
+
if (!joined) return <>Joining Live Share session...</>;
|
|
66
|
+
return <>{children}</>
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// LiveCheckbox.jsx
|
|
70
|
+
import { useLiveState } from "@microsoft/live-share-react";
|
|
71
|
+
|
|
72
|
+
export function LiveCheckbox() {
|
|
73
|
+
const [checked, setChecked] = useLiveState("MY-UNIQUE-ID", false);
|
|
74
|
+
return (
|
|
75
|
+
<input
|
|
76
|
+
type="checkbox"
|
|
77
|
+
checked={checked}
|
|
78
|
+
onChange={() => {
|
|
79
|
+
setChecked(!checked);
|
|
80
|
+
}}
|
|
81
|
+
/>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
*/
|
|
86
|
+
const useLiveShareContext = () => {
|
|
87
|
+
const context = react_1.default.useContext(exports.LiveShareContext);
|
|
88
|
+
if (!isLiveShareContext(context)) {
|
|
89
|
+
throw new Error("@microsoft/live-share-react: attempting to use `useLiveShareContext()` from a component that is not a child of `<LiveShareProvider>`.\nTo fix this error, ensure that you are only using Live Share hooks (e.g., `useLiveState`) from a child component of `<LiveShareProvider>`.");
|
|
90
|
+
}
|
|
91
|
+
return context;
|
|
92
|
+
};
|
|
93
|
+
exports.useLiveShareContext = useLiveShareContext;
|
|
94
|
+
/**
|
|
95
|
+
* React Context provider component for using Live Share data objects & joining a Live Share session using `LiveShareClient`.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
```jsx
|
|
99
|
+
// LiveShareApp.jsx
|
|
100
|
+
import { LiveShareProvider } from "@microsoft/live-share-react";
|
|
101
|
+
import { LiveShareHost } from "@microsoft/teams-js";
|
|
102
|
+
|
|
103
|
+
const host = LiveShareHost.create();
|
|
104
|
+
|
|
105
|
+
export function LiveShareApp() {
|
|
106
|
+
// Call app.initialize() from teams-js before rendering LiveShareProvider
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<LiveShareProvider
|
|
110
|
+
joinOnLoad={true}
|
|
111
|
+
host={host}
|
|
112
|
+
>
|
|
113
|
+
<LiveShareLoader>
|
|
114
|
+
<LiveCheckbox />
|
|
115
|
+
</LiveShareLoader>
|
|
116
|
+
</LiveShareProvider>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// LiveShareLoader.jsx
|
|
121
|
+
import { useLiveShareContext } from "@microsoft/live-share-react";
|
|
122
|
+
|
|
123
|
+
export function LiveShareLoader({ children }) {
|
|
124
|
+
const { joined, joinError } = useLiveShareContext();
|
|
125
|
+
|
|
126
|
+
if (joinError) return <>{joinError.message}</>;
|
|
127
|
+
if (!joined) return <>Joining Live Share session...</>;
|
|
128
|
+
return <>{children}</>
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// LiveCheckbox.jsx
|
|
132
|
+
import { useLiveState } from "@microsoft/live-share-react";
|
|
133
|
+
|
|
134
|
+
export function LiveCheckbox() {
|
|
135
|
+
const [checked, setChecked] = useLiveState("MY-UNIQUE-ID", false);
|
|
136
|
+
return (
|
|
137
|
+
<input
|
|
138
|
+
type="checkbox"
|
|
139
|
+
checked={checked}
|
|
140
|
+
onChange={() => {
|
|
141
|
+
setChecked(!checked);
|
|
142
|
+
}}
|
|
143
|
+
/>
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
*/
|
|
148
|
+
const LiveShareProvider = (props) => {
|
|
149
|
+
const startedRef = react_1.default.useRef(false);
|
|
150
|
+
const clientRef = react_1.default.useRef(new live_share_1.LiveShareClient(props.host, props.clientOptions));
|
|
151
|
+
const [results, setResults] = react_1.default.useState();
|
|
152
|
+
const [joinError, setJoinError] = react_1.default.useState();
|
|
153
|
+
const stateRegistryCallbacks = (0, index_js_1.useSharedStateRegistry)(results);
|
|
154
|
+
/**
|
|
155
|
+
* Join container callback for joining the Live Share session
|
|
156
|
+
*/
|
|
157
|
+
const join = react_1.default.useCallback((fluidContainerSchema, onInitializeContainer) => __awaiter(void 0, void 0, void 0, function* () {
|
|
158
|
+
startedRef.current = true;
|
|
159
|
+
const results = yield clientRef.current.join(fluidContainerSchema, onInitializeContainer);
|
|
160
|
+
setResults(results);
|
|
161
|
+
return results;
|
|
162
|
+
}), []);
|
|
163
|
+
/**
|
|
164
|
+
* Joins the container on load if `props.joinOnLoad` is true
|
|
165
|
+
*/
|
|
166
|
+
react_1.default.useEffect(() => {
|
|
167
|
+
// This hook should only be called once, so we use a ref to track if it has been called.
|
|
168
|
+
// This is a workaround for the fact that useEffect is called twice on initial render in React V18.
|
|
169
|
+
// We are not doing this here for backwards compatibility. View the README for more information.
|
|
170
|
+
if (results !== undefined || startedRef.current || !props.joinOnLoad)
|
|
171
|
+
return;
|
|
172
|
+
join(props.fluidContainerSchema).catch((error) => {
|
|
173
|
+
var _a;
|
|
174
|
+
console.error(error);
|
|
175
|
+
if (error instanceof Error) {
|
|
176
|
+
setJoinError(error);
|
|
177
|
+
}
|
|
178
|
+
else if ((0, index_js_2.isITeamsJsSdkError)(error)) {
|
|
179
|
+
setJoinError(new Error(`[${error.errorCode}] ${(_a = error.message) !== null && _a !== void 0 ? _a : "An unknown error occurred while joining container."}`));
|
|
180
|
+
}
|
|
181
|
+
else if (typeof error == "string") {
|
|
182
|
+
setJoinError(new Error(error));
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
setJoinError(new Error("LiveShareProvider: An unknown error occurred while joining container."));
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
}, [results, props.joinOnLoad, props.fluidContainerSchema, join]);
|
|
189
|
+
return ((0, jsx_runtime_1.jsx)(exports.LiveShareContext.Provider, { value: {
|
|
190
|
+
created: !!(results === null || results === void 0 ? void 0 : results.created),
|
|
191
|
+
timestampProvider: results === null || results === void 0 ? void 0 : results.timestampProvider,
|
|
192
|
+
joined: !!(results === null || results === void 0 ? void 0 : results.container),
|
|
193
|
+
joinError,
|
|
194
|
+
join,
|
|
195
|
+
}, children: (0, jsx_runtime_1.jsx)(AzureProvider_js_1.FluidContext.Provider, { value: Object.assign({ clientRef, container: results === null || results === void 0 ? void 0 : results.container, services: results === null || results === void 0 ? void 0 : results.services, joinError, getContainer: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
196
|
+
throw new Error("Cannot join new container through getContainer in LiveShareProvider");
|
|
197
|
+
}), createContainer: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
198
|
+
throw new Error("Cannot create new container through createContainer in LiveShareProvider");
|
|
199
|
+
}) }, stateRegistryCallbacks), children: props.children }) }));
|
|
200
|
+
};
|
|
201
|
+
exports.LiveShareProvider = LiveShareProvider;
|
|
202
|
+
function isLiveShareContext(value) {
|
|
203
|
+
return (typeof (value === null || value === void 0 ? void 0 : value.created) === "boolean" && typeof (value === null || value === void 0 ? void 0 : value.join) === "function");
|
|
204
|
+
}
|
|
205
|
+
//# sourceMappingURL=LiveShareProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveShareProvider.js","sourceRoot":"","sources":["../../../src/providers/LiveShareProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAMA,kDAA0B;AAC1B,uDAAkE;AAClE,sDAM+B;AAC/B,yDAA0E;AAC1E,mDAA0D;AA2C1D;;GAEG;AACU,QAAA,gBAAgB,GAAG,eAAK,CAAC,aAAa,CAC/C,EAAuB,CAC1B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACI,MAAM,mBAAmB,GAAG,GAAsB,EAAE;IACvD,MAAM,OAAO,GAAG,eAAK,CAAC,UAAU,CAAC,wBAAgB,CAAC,CAAC;IACnD,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CACX,mRAAmR,CACtR,CAAC;IACN,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;AARW,QAAA,mBAAmB,uBAQ9B;AA+BF;;;;;;;;;;;;;;;;;;;;;;;;;;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AE;oBACxB,MAAM,IAAI,KAAK,CACX,0EAA0E,CAC7E,CAAC;gBACN,CAAC,CAAA,IACE,sBAAsB,aAG5B,KAAK,CAAC,QAAQ,GACK,GACA,CAC/B,CAAC;AACN,CAAC,CAAC;AAlGW,QAAA,iBAAiB,qBAkG5B;AAEF,SAAS,kBAAkB,CAAC,KAAU;IAClC,OAAO,CACH,OAAO,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,CAAA,KAAK,SAAS,IAAI,OAAO,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,CAAA,KAAK,UAAU,CAC3E,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
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("./AzureProvider.js"), exports);
|
|
18
|
+
__exportStar(require("./LiveShareProvider.js"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/providers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,yDAAuC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./useSharedState.js";
|
|
2
|
+
export * from "./useSharedMap.js";
|
|
3
|
+
export * from "./useDynamicDDS.js";
|
|
4
|
+
export * from "./useSharedStateRegistry.js";
|
|
5
|
+
export * from "./useSharedTree.js";
|
|
6
|
+
export * from "./useTreeNode.js";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared-hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
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("./useSharedState.js"), exports);
|
|
18
|
+
__exportStar(require("./useSharedMap.js"), exports);
|
|
19
|
+
__exportStar(require("./useDynamicDDS.js"), exports);
|
|
20
|
+
__exportStar(require("./useSharedStateRegistry.js"), exports);
|
|
21
|
+
__exportStar(require("./useSharedTree.js"), exports);
|
|
22
|
+
__exportStar(require("./useTreeNode.js"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared-hooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,oDAAkC;AAClC,qDAAmC;AACnC,8DAA4C;AAC5C,qDAAmC;AACnC,mDAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-node-constants.d.ts","sourceRoot":"","sources":["../../../../src/shared-hooks/internals/tree-node-constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,sBAAsB,CAAC;AAC/C,eAAO,MAAM,kBAAkB,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.proxiedChildrenKey = exports.rawTNodeKey = void 0;
|
|
4
|
+
exports.rawTNodeKey = "[[FluidTreeNode]]";
|
|
5
|
+
exports.proxiedChildrenKey = "[[FluidChildNodes]]";
|
|
6
|
+
//# sourceMappingURL=tree-node-constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-node-constants.js","sourceRoot":"","sources":["../../../../src/shared-hooks/internals/tree-node-constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,mBAAmB,CAAC;AAClC,QAAA,kBAAkB,GAAG,qBAAqB,CAAC"}
|