@azure/communication-react 1.22.0-alpha-202412100018 → 1.22.0-alpha-202412120017

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 (58) hide show
  1. package/dist/communication-react.d.ts +41 -39
  2. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-Bpez2mhK.js → ChatMessageComponentAsRichTextEditBox-BBGCXfci.js} +2 -2
  3. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-Bpez2mhK.js.map → ChatMessageComponentAsRichTextEditBox-BBGCXfci.js.map} +1 -1
  4. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-CrmMCuXY.js → RichTextSendBoxWrapper-CG_xsEdn.js} +2 -2
  5. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-CrmMCuXY.js.map → RichTextSendBoxWrapper-CG_xsEdn.js.map} +1 -1
  6. package/dist/dist-cjs/communication-react/{index-DIxf34Zj.js → index-BryVG9gm.js} +95 -50
  7. package/dist/dist-cjs/communication-react/index-BryVG9gm.js.map +1 -0
  8. package/dist/dist-cjs/communication-react/index.js +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  10. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  11. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +3 -3
  12. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +5 -5
  13. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  14. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.d.ts +2 -33
  15. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js +8 -15
  16. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
  17. package/dist/dist-esm/communication-react/src/index.d.ts +1 -1
  18. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  19. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.d.ts +9 -2
  20. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.js +20 -2
  21. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.js.map +1 -1
  22. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.d.ts +2 -0
  23. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.js +14 -0
  24. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.js.map +1 -1
  25. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.d.ts +1 -0
  26. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.js +11 -1
  27. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.js.map +1 -1
  28. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.d.ts +1 -0
  29. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +5 -1
  30. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +1 -1
  31. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js +4 -1
  32. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js.map +1 -1
  33. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.d.ts +2 -1
  34. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js +1 -0
  35. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js.map +1 -1
  36. package/dist/dist-esm/react-components/src/components/utils.js +5 -3
  37. package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
  38. package/dist/dist-esm/react-components/src/index.d.ts +1 -1
  39. package/dist/dist-esm/react-components/src/index.js.map +1 -1
  40. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +29 -1
  41. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +2 -2
  42. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +5 -5
  43. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  44. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +3 -3
  45. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  46. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +3 -3
  47. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  48. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +2 -2
  49. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +4 -4
  50. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  51. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +3 -3
  52. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  53. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +2 -2
  54. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +2 -2
  55. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  56. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +25 -1
  57. package/package.json +3 -3
  58. package/dist/dist-cjs/communication-react/index-DIxf34Zj.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"StatefulCallClient.js","sourceRoot":"","sources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ManagerDeclaratify } from './DeviceManagerDeclarative';\nimport {\n CallClient,\n CallClientOptions,\n CreateViewOptions,\n DeviceManager,\n Features\n} from '@azure/communication-calling';\nimport { CallClientState, LocalVideoStreamState, RemoteVideoStreamState } from './CallClientState';\n/* @conditional-compile-remove(together-mode) */\nimport { CallFeatureStreamState } from './CallClientState';\nimport { CallContext } from './CallContext';\nimport { callAgentDeclaratify, DeclarativeCallAgent } from './CallAgentDeclarative';\nimport { InternalCallContext } from './InternalCallContext';\nimport { createView, disposeView, CreateViewResult } from './StreamUtils';\nimport { CommunicationIdentifier, CommunicationUserIdentifier, getIdentifierKind } from '@azure/communication-common';\nimport {\n toFlatCommunicationIdentifier,\n _getApplicationId,\n _TelemetryImplementationHint\n} from '@internal/acs-ui-common';\nimport { callingStatefulLogger } from './Logger';\nimport { DeclarativeTeamsCallAgent, teamsCallAgentDeclaratify } from './TeamsCallAgentDeclarative';\nimport { MicrosoftTeamsUserIdentifier } from '@azure/communication-common';\nimport { videoStreamRendererViewDeclaratify } from './VideoStreamRendererViewDeclarative';\n/* @conditional-compile-remove(together-mode) */\nimport { createView as createCallFeatureView, disposeView as disposeCallFeatureView } from './CallFeatureStreamUtils';\n\n/**\n * Defines the methods that allow CallClient {@link @azure/communication-calling#CallClient} to be used statefully.\n * The interface provides access to proxied state and also allows registering a handler for state change events. For\n * state definition see {@link CallClientState}.\n *\n * State change events are driven by:\n * - Returned data from {@link @azure/communication-calling#DeviceManager} APIs.\n * - Returned data from {@link @azure/communication-calling#CallAgent} APIs.\n * - Listeners automatically attached to various azure communication-calling objects:\n * - CallAgent 'incomingCall'\n * - CallAgent 'callsUpdated'\n * - DeviceManager 'videoDevicesUpdated'\n * - DeviceManager 'audioDevicesUpdated\n * - DeviceManager 'selectedMicrophoneChanged'\n * - DeviceManager 'selectedSpeakerChanged'\n * - Call 'stateChanged'\n * - Call 'idChanged'\n * - Call 'isMutedChanged'\n * - Call 'isScreenSharingOnChanged'\n * - Call 'remoteParticipantsUpdated'\n * - Call 'localVideoStreamsUpdated'\n * - IncomingCall 'callEnded'\n * - RemoteParticipant 'stateChanged'\n * - RemoteParticipant 'isMutedChanged'\n * - RemoteParticipant 'displayNameChanged'\n * - RemoteParticipant 'isSpeakingChanged'\n * - RemoteParticipant 'videoStreamsUpdated'\n * - RemoteVideoStream 'isAvailableChanged'\n * - TranscriptionCallFeature 'isTranscriptionActiveChanged'\n * - RecordingCallFeature 'isRecordingActiveChanged'\n * - LocalRecordingCallFeature 'isLocalRecordingActiveChanged'\n * - RaiseHandCallFeature 'raisedHandEvent'\n * - RaiseHandCallFeature 'loweredHandEvent'\n * - PPTLiveCallFeature 'isAciveChanged'\n * - ReactionCallFeature 'reaction'\n *\n * @public\n */\nexport interface StatefulCallClient extends CallClient {\n /**\n * Holds all the state that we could proxy from CallClient {@link @azure/communication-calling#CallClient} as\n * CallClientState {@link CallClientState}.\n */\n getState(): CallClientState;\n /**\n * Allows a handler to be registered for 'stateChanged' events.\n *\n * @param handler - Callback to receive the state.\n */\n onStateChange(handler: (state: CallClientState) => void): void;\n /**\n * Allows unregistering for 'stateChanged' events.\n *\n * @param handler - Original callback to be unsubscribed.\n */\n offStateChange(handler: (state: CallClientState) => void): void;\n /**\n * Renders a {@link RemoteVideoStreamState} or {@link LocalVideoStreamState} and stores the resulting\n * {@link VideoStreamRendererViewState} under the relevant {@link RemoteVideoStreamState} or\n * {@link LocalVideoStreamState} or as unparented view in the state. Under the hood calls\n * {@link @azure/communication-calling#VideoStreamRenderer.createView}.\n *\n * Scenario 1: Render RemoteVideoStreamState\n * - CallId is required, participantId is required, and stream of type RemoteVideoStreamState is required\n * - Resulting {@link VideoStreamRendererViewState} is stored in the given callId and participantId in\n * {@link CallClientState}\n *\n * Scenario 2: Render LocalVideoStreamState for a call\n * - CallId is required, participantId must be undefined, and stream of type LocalVideoStreamState is required.\n * - The {@link @azure/communication-calling#Call.localVideoStreams} must already be started using\n * {@link @azure/communication-calling#Call.startVideo}.\n * - Resulting {@link VideoStreamRendererViewState} is stored in the given callId {@link CallState.localVideoStreams}\n * in {@link CallClientState}.\n *\n * - Scenario 2: Render LocalVideoStreamState not part of a call (example rendering camera for local preview)\n * - CallId must be undefined, participantId must be undefined, and stream of type LocalVideoStreamState is required.\n * - Resulting {@link VideoStreamRendererViewState} is stored in under the given LocalVideoStreamState in\n * {@link CallClientState.deviceManager.unparentedViews}\n *\n * @param callId - CallId for the given stream. Can be undefined if the stream is not part of any call.\n * @param participantId - {@link RemoteParticipant.identifier} associated with the given RemoteVideoStreamState. Could\n * be undefined if rendering LocalVideoStreamState.\n * @param stream - The LocalVideoStreamState or RemoteVideoStreamState to start rendering.\n * @param options - Options that are passed to the {@link @azure/communication-calling#VideoStreamRenderer}.\n */\n createView(\n callId: string | undefined,\n participantId: CommunicationIdentifier | undefined,\n stream: LocalVideoStreamState | RemoteVideoStreamState,\n options?: CreateViewOptions\n ): Promise<CreateViewResult | undefined>;\n /**\n * Stops rendering a {@link RemoteVideoStreamState} or {@link LocalVideoStreamState} and removes the\n * {@link VideoStreamRendererView} from the relevant {@link RemoteVideoStreamState} in {@link CallClientState} or\n * {@link LocalVideoStream} in {@link CallClientState} or appropriate\n * {@link CallClientState.deviceManager.unparentedViews} Under the hood calls\n * {@link @azure/communication-calling#VideoStreamRenderer.dispose}.\n *\n * Its important to disposeView to clean up resources properly.\n *\n * Scenario 1: Dispose RemoteVideoStreamState\n * - CallId is required, participantId is required, and stream of type RemoteVideoStreamState is required\n *\n * Scenario 2: Dispose LocalVideoStreamState for a call\n * - CallId is required, participantId must be undefined, and stream of type LocalVideoStreamState is required.\n *\n * - Scenario 2: Dispose LocalVideoStreamState not part of a call\n * - CallId must be undefined, participantId must be undefined, and stream of type LocalVideoStreamState is required.\n * - LocalVideoStreamState must be the original one passed to createView.\n *\n * @param callId - CallId for the given stream. Can be undefined if the stream is not part of any call.\n * @param participantId - {@link RemoteParticipant.identifier} associated with the given RemoteVideoStreamState. Could\n * be undefined if disposing LocalVideoStreamState.\n * @param stream - The LocalVideoStreamState or RemoteVideoStreamState to dispose.\n */\n disposeView(\n callId: string | undefined,\n participantId: CommunicationIdentifier | undefined,\n stream: LocalVideoStreamState | RemoteVideoStreamState\n ): void;\n\n /* @conditional-compile-remove(together-mode) */\n /**\n * Renders a {@link CallFeatureStreamState}\n * {@link VideoStreamRendererViewState} under the relevant {@link CallFeatureStreamState}\n * {@link @azure/communication-calling#VideoStreamRenderer.createView}.\n *\n * Scenario 1: Render CallFeatureStreamState\n * - CallId is required and stream of type CallFeatureStreamState is required\n * - Resulting {@link VideoStreamRendererViewState} is stored in the given callId and participantId in\n * {@link CallClientState}\n *\n * @param callId - CallId for the given stream. Can be undefined if the stream is not part of any call.\n * @param stream - The LocalVideoStreamState or RemoteVideoStreamState to start rendering.\n * @param options - Options that are passed to the {@link @azure/communication-calling#VideoStreamRenderer}.\n * @beta\n */\n createView(\n callId: string,\n stream: CallFeatureStreamState,\n options?: CreateViewOptions\n ): Promise<CreateViewResult | undefined>;\n\n /* @conditional-compile-remove(together-mode) */\n /**\n * Stops rendering a {@link CallFeatureStreamState} and removes the\n * {@link VideoStreamRendererView} from the relevant {@link CallFeatureStreamState} in {@link CallClientState} or\n * {@link @azure/communication-calling#VideoStreamRenderer.dispose}.\n *\n * Its important to disposeView to clean up resources properly.\n *\n * Scenario 1: Dispose CallFeatureStreamState\n * - CallId is required and stream of type CallFeatureStreamState is required\n *\n * @param callId - CallId for the given stream. Can be undefined if the stream is not part of any call.\n * @param stream - The LocalVideoStreamState or RemoteVideoStreamState to dispose.\n * @beta\n */\n disposeView(callId: string, stream: CallFeatureStreamState): void;\n /**\n * The CallAgent is used to handle calls.\n * To create the CallAgent, pass a CommunicationTokenCredential object provided from SDK.\n * - The CallClient can only have one active CallAgent instance at a time.\n * - You can create a new CallClient instance to create a new CallAgent.\n * - You can dispose of a CallClient's current active CallAgent, and call the CallClient's\n * createCallAgent() method again to create a new CallAgent.\n * @param tokenCredential - The token credential. Use AzureCommunicationTokenCredential from `@azure/communication-common` to create a credential.\n * @param options - The CallAgentOptions for additional options like display name.\n * @public\n */\n createCallAgent(...args: Parameters<CallClient['createCallAgent']>): Promise<DeclarativeCallAgent>;\n\n /**\n * The TeamsCallAgent is used to handle calls.\n * To create the TeamsCallAgent, pass a CommunicationTokenCredential object provided from SDK.\n * - The CallClient can only have one active TeamsCallAgent instance at a time.\n * - You can create a new CallClient instance to create a new TeamsCallAgent.\n * - You can dispose of a CallClient's current active TeamsCallAgent, and call the CallClient's\n * createTeamsCallAgent() method again to create a new TeamsCallAgent.\n * @param tokenCredential - The token credential. Use AzureCommunicationTokenCredential from `@azure/communication-common` to create a credential.\n * @param options - The TeamsCallAgentOptions for additional options like display name.\n * @public\n */\n createTeamsCallAgent(...args: Parameters<CallClient['createTeamsCallAgent']>): Promise<DeclarativeTeamsCallAgent>;\n}\n\n/**\n * A function to modify the state of the StatefulCallClient.\n *\n * Provided as a callback to the {@link StatefulCallClient.modifyState} method.\n *\n * The function must modify the provided state in place as much as possible.\n * Making large modifications can lead to bad performance by causing spurious rerendering of the UI.\n *\n * Consider using commonly used modifier functions exported from this package.\n */\nexport type CallStateModifier = (state: CallClientState) => void;\n\n/**\n * ProxyCallClient proxies CallClient {@link @azure/communication-calling#CallClient} and subscribes to all events that\n * affect state. ProxyCallClient keeps its own copy of the call state and when state is updated, ProxyCallClient emits\n * the event 'stateChanged'.\n */\nclass ProxyCallClient implements ProxyHandler<CallClient> {\n private _context: CallContext;\n private _internalContext: InternalCallContext;\n private _callAgent: DeclarativeCallAgent | DeclarativeTeamsCallAgent | undefined;\n private _deviceManager: DeviceManager | undefined;\n private _sdkDeviceManager: DeviceManager | undefined;\n\n constructor(context: CallContext, internalContext: InternalCallContext) {\n this._context = context;\n this._internalContext = internalContext;\n }\n\n public get<P extends keyof CallClient>(target: CallClient, prop: P): any {\n switch (prop) {\n case 'createCallAgent': {\n return this._context.withAsyncErrorTeedToState(\n async (...args: Parameters<CallClient['createCallAgent']>): Promise<DeclarativeCallAgent> => {\n // createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous\n // callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative\n // callAgent if the createCallAgent succeeds.\n const callAgent = await target.createCallAgent(...args);\n this._callAgent = callAgentDeclaratify(callAgent, this._context, this._internalContext);\n this._context.setCallAgent({\n displayName: this._callAgent.displayName\n });\n return this._callAgent;\n },\n 'CallClient.createCallAgent'\n );\n }\n case 'createTeamsCallAgent': {\n return this._context.withAsyncErrorTeedToState(\n async (...args: Parameters<CallClient['createTeamsCallAgent']>): Promise<DeclarativeTeamsCallAgent> => {\n // createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous\n // callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative\n // callAgent if the createCallAgent succeeds.\n const callAgent = await target.createTeamsCallAgent(...args);\n this._callAgent = teamsCallAgentDeclaratify(callAgent, this._context, this._internalContext);\n this._context.setCallAgent({\n displayName: undefined\n });\n return this._callAgent;\n },\n 'CallClient.createTeamsCallAgent'\n );\n }\n case 'getDeviceManager': {\n return this._context.withAsyncErrorTeedToState(async () => {\n // As of writing, the SDK always returns the same instance of DeviceManager so we keep a reference of\n // DeviceManager and if it does not change we return the cached DeclarativeDeviceManager. If it does not we'll\n // throw an error that indicate we need to fix this issue as our implementation has diverged from the SDK.\n const deviceManager = await target.getDeviceManager();\n if (this._sdkDeviceManager) {\n if (this._sdkDeviceManager === deviceManager) {\n return this._deviceManager;\n } else {\n throw new Error(\n 'Multiple DeviceManager not supported. This means a incompatible version of communication-calling is ' +\n 'used OR calling declarative was not properly updated to communication-calling version.'\n );\n }\n } else {\n this._sdkDeviceManager = deviceManager;\n }\n this._deviceManager = deviceManagerDeclaratify(deviceManager, this._context, this._internalContext);\n return this._deviceManager;\n }, 'CallClient.getDeviceManager');\n }\n case 'feature': {\n return this._context.withErrorTeedToState((...args: Parameters<CallClient['feature']>) => {\n if (args[0] === Features.DebugInfo) {\n const feature = target.feature(Features.DebugInfo);\n /**\n * add to this object if we want to proxy anything else off the DebugInfo feature object.\n */\n return {\n ...feature,\n getEnvironmentInfo: async () => {\n const environmentInfo = await feature.getEnvironmentInfo();\n this._context.setEnvironmentInfo(environmentInfo);\n return environmentInfo;\n }\n };\n }\n return Reflect.get(target, prop);\n }, 'CallClient.feature');\n }\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n\n/**\n * Arguments to construct the StatefulCallClient.\n *\n * @public\n */\nexport type StatefulCallClientArgs = {\n /**\n * UserId from SDK. This is provided for developer convenience to easily access the userId from the\n * state. It is not used by StatefulCallClient.\n */\n userId: CommunicationUserIdentifier | MicrosoftTeamsUserIdentifier;\n};\n\n/**\n * Options to construct the StatefulCallClient with.\n *\n * @public\n */\nexport type StatefulCallClientOptions = {\n /**\n * Options to construct the {@link @axure/communication-calling#CallClient} with.\n */\n callClientOptions: CallClientOptions;\n /**\n * Sets the max listeners limit of the 'stateChange' event. Defaults to the node.js EventEmitter.defaultMaxListeners\n * if not specified.\n */\n maxStateChangeListeners?: number;\n};\n\n/**\n * Creates a StatefulCallClient {@link StatefulCallClient} by proxying CallClient\n * {@link @azure/communication-calling#CallClient} with ProxyCallClient {@link ProxyCallClient} which then allows access\n * to state in a declarative way.\n *\n * It is important to use the {@link @azure/communication-calling#DeviceManager} and\n * {@link @azure/communication-calling#CallAgent} and {@link @azure/communication-calling#Call} (and etc.) that are\n * obtained from the StatefulCallClient in order for their state changes to be proxied properly.\n *\n * @param args - {@link StatefulCallClientArgs}\n * @param options - {@link StatefulCallClientOptions}\n *\n * @public\n */\nexport const createStatefulCallClient = (\n args: StatefulCallClientArgs,\n options?: StatefulCallClientOptions\n): StatefulCallClient => {\n return _createStatefulCallClientInner(args, options);\n};\n\n/**\n * This inner function is used to allow injection of TelemetryImplementationHint without changing the public API.\n *\n * @internal\n */\nexport const _createStatefulCallClientInner = (\n args: StatefulCallClientArgs,\n options?: StatefulCallClientOptions,\n telemetryImplementationHint: _TelemetryImplementationHint = 'StatefulComponents'\n): StatefulCallClient => {\n callingStatefulLogger.info(\n `Creating calling stateful client using library version: ${_getApplicationId(telemetryImplementationHint)}`\n );\n return createStatefulCallClientWithDeps(\n new CallClient(withTelemetryTag(telemetryImplementationHint, options?.callClientOptions)),\n new CallContext(getIdentifierKind(args.userId), options?.maxStateChangeListeners),\n new InternalCallContext()\n );\n};\n\n/**\n * Package-internal version of createStatefulCallClient that allows dependency injection.\n *\n * This function should not be exported from the package.\n */\nexport const createStatefulCallClientWithDeps = (\n callClient: CallClient,\n context: CallContext,\n internalContext: InternalCallContext\n): StatefulCallClient => {\n Object.defineProperty(callClient, 'getState', {\n configurable: false,\n value: () => context.getState()\n });\n Object.defineProperty(callClient, 'onStateChange', {\n configurable: false,\n value: (handler: (state: CallClientState) => void) => context.onStateChange(handler)\n });\n Object.defineProperty(callClient, 'offStateChange', {\n configurable: false,\n value: (handler: (state: CallClientState) => void) => context.offStateChange(handler)\n });\n Object.defineProperty(callClient, 'createView', {\n configurable: false,\n value: async (\n callId: string | undefined,\n participantId: CommunicationIdentifier | undefined,\n stream: LocalVideoStreamState | RemoteVideoStreamState,\n options?: CreateViewOptions\n ): Promise<CreateViewResult | undefined> => {\n const participantIdKind = participantId ? getIdentifierKind(participantId) : undefined;\n const result = await createView(context, internalContext, callId, participantIdKind, stream, options);\n // We only need to declaratify the VideoStreamRendererView object for remote participants. Because the updateScalingMode only needs to be called on remote participant stream views.\n if ('id' in stream && callId && participantId && result) {\n const participantKey = toFlatCommunicationIdentifier(participantId);\n result.view = videoStreamRendererViewDeclaratify(result.view, context, callId, participantKey, stream.id);\n }\n return result;\n }\n });\n /* @conditional-compile-remove(together-mode) */\n Object.defineProperty(callClient, 'createCallFeatureView', {\n configurable: false,\n value: async (\n callId: string | undefined,\n stream: CallFeatureStreamState,\n options?: CreateViewOptions\n ): Promise<CreateViewResult | undefined> => {\n const result = await createCallFeatureView(context, internalContext, callId, stream, options);\n return result;\n }\n });\n Object.defineProperty(callClient, 'disposeView', {\n configurable: false,\n value: (\n callId: string | undefined,\n participantId: CommunicationIdentifier | undefined,\n stream: LocalVideoStreamState | RemoteVideoStreamState\n ): void => {\n const participantIdKind = participantId ? getIdentifierKind(participantId) : undefined;\n disposeView(context, internalContext, callId, participantIdKind, stream);\n }\n });\n /* @conditional-compile-remove(together-mode) */\n Object.defineProperty(callClient, 'disposeCallFeatureView', {\n configurable: false,\n value: (callId: string | undefined, stream: CallFeatureStreamState): void => {\n disposeCallFeatureView(context, internalContext, callId, stream);\n }\n });\n\n const newStatefulCallClient = new Proxy(\n callClient,\n new ProxyCallClient(context, internalContext)\n ) as StatefulCallClient;\n\n // Populate initial state\n newStatefulCallClient.feature(Features.DebugInfo).getEnvironmentInfo();\n\n return newStatefulCallClient;\n};\n\nconst withTelemetryTag = (\n telemetryImplementationHint: _TelemetryImplementationHint,\n options?: CallClientOptions\n): CallClientOptions => {\n const tags = options?.diagnostics?.tags ?? [];\n tags.push(_getApplicationId(telemetryImplementationHint));\n return {\n ...options,\n diagnostics: {\n ...options?.diagnostics,\n tags\n }\n };\n};\n"]}
1
+ {"version":3,"file":"StatefulCallClient.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/StatefulCallClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EACL,UAAU,EAIV,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAItC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAwB,MAAM,wBAAwB,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAoB,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAwD,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACtH,OAAO,EACL,6BAA6B,EAC7B,iBAAiB,EAElB,gCAAgC;AACjC,OA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gB,GAAG,CACvB,2BAAyD,EACzD,OAA2B,EACR,EAAE;;IACrB,MAAM,IAAI,GAAG,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,0CAAE,IAAI,mCAAI,EAAE,CAAC;IAC9C,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,2BAA2B,CAAC,CAAC,CAAC;IAC1D,uCACK,OAAO,KACV,WAAW,kCACN,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,KACvB,IAAI,OAEN;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { deviceManagerDeclaratify } from './DeviceManagerDeclarative';\nimport {\n CallClient,\n CallClientOptions,\n CreateViewOptions,\n DeviceManager,\n Features\n} from '@azure/communication-calling';\nimport { CallClientState, LocalVideoStreamState, RemoteVideoStreamState } from './CallClientState';\n/* @conditional-compile-remove(together-mode) */\nimport { CallFeatureStreamState } from './CallClientState';\nimport { CallContext } from './CallContext';\nimport { callAgentDeclaratify, DeclarativeCallAgent } from './CallAgentDeclarative';\nimport { InternalCallContext } from './InternalCallContext';\nimport { createView, disposeView, CreateViewResult } from './StreamUtils';\nimport { CommunicationIdentifier, CommunicationUserIdentifier, getIdentifierKind } from '@azure/communication-common';\nimport {\n toFlatCommunicationIdentifier,\n _getApplicationId,\n _TelemetryImplementationHint\n} from '@internal/acs-ui-common';\nimport { callingStatefulLogger } from './Logger';\nimport { DeclarativeTeamsCallAgent, teamsCallAgentDeclaratify } from './TeamsCallAgentDeclarative';\nimport { MicrosoftTeamsUserIdentifier } from '@azure/communication-common';\nimport { videoStreamRendererViewDeclaratify } from './VideoStreamRendererViewDeclarative';\n/* @conditional-compile-remove(together-mode) */\nimport { createView as createCallFeatureView, disposeView as disposeCallFeatureView } from './CallFeatureStreamUtils';\n\n/**\n * Defines the methods that allow CallClient {@link @azure/communication-calling#CallClient} to be used statefully.\n * The interface provides access to proxied state and also allows registering a handler for state change events. For\n * state definition see {@link CallClientState}.\n *\n * State change events are driven by:\n * - Returned data from {@link @azure/communication-calling#DeviceManager} APIs.\n * - Returned data from {@link @azure/communication-calling#CallAgent} APIs.\n * - Listeners automatically attached to various azure communication-calling objects:\n * - CallAgent 'incomingCall'\n * - CallAgent 'callsUpdated'\n * - DeviceManager 'videoDevicesUpdated'\n * - DeviceManager 'audioDevicesUpdated\n * - DeviceManager 'selectedMicrophoneChanged'\n * - DeviceManager 'selectedSpeakerChanged'\n * - Call 'stateChanged'\n * - Call 'idChanged'\n * - Call 'isMutedChanged'\n * - Call 'isScreenSharingOnChanged'\n * - Call 'remoteParticipantsUpdated'\n * - Call 'localVideoStreamsUpdated'\n * - IncomingCall 'callEnded'\n * - RemoteParticipant 'stateChanged'\n * - RemoteParticipant 'isMutedChanged'\n * - RemoteParticipant 'displayNameChanged'\n * - RemoteParticipant 'isSpeakingChanged'\n * - RemoteParticipant 'videoStreamsUpdated'\n * - RemoteVideoStream 'isAvailableChanged'\n * - TranscriptionCallFeature 'isTranscriptionActiveChanged'\n * - RecordingCallFeature 'isRecordingActiveChanged'\n * - LocalRecordingCallFeature 'isLocalRecordingActiveChanged'\n * - RaiseHandCallFeature 'raisedHandEvent'\n * - RaiseHandCallFeature 'loweredHandEvent'\n * - PPTLiveCallFeature 'isAciveChanged'\n * - ReactionCallFeature 'reaction'\n *\n * @public\n */\nexport interface StatefulCallClient extends CallClient {\n /**\n * Holds all the state that we could proxy from CallClient {@link @azure/communication-calling#CallClient} as\n * CallClientState {@link CallClientState}.\n */\n getState(): CallClientState;\n /**\n * Allows a handler to be registered for 'stateChanged' events.\n *\n * @param handler - Callback to receive the state.\n */\n onStateChange(handler: (state: CallClientState) => void): void;\n /**\n * Allows unregistering for 'stateChanged' events.\n *\n * @param handler - Original callback to be unsubscribed.\n */\n offStateChange(handler: (state: CallClientState) => void): void;\n /**\n * Renders a {@link RemoteVideoStreamState} or {@link LocalVideoStreamState} and stores the resulting\n * {@link VideoStreamRendererViewState} under the relevant {@link RemoteVideoStreamState} or\n * {@link LocalVideoStreamState} or as unparented view in the state. Under the hood calls\n * {@link @azure/communication-calling#VideoStreamRenderer.createView}.\n *\n * Scenario 1: Render RemoteVideoStreamState\n * - CallId is required, participantId is required, and stream of type RemoteVideoStreamState is required\n * - Resulting {@link VideoStreamRendererViewState} is stored in the given callId and participantId in\n * {@link CallClientState}\n *\n * Scenario 2: Render LocalVideoStreamState for a call\n * - CallId is required, participantId must be undefined, and stream of type LocalVideoStreamState is required.\n * - The {@link @azure/communication-calling#Call.localVideoStreams} must already be started using\n * {@link @azure/communication-calling#Call.startVideo}.\n * - Resulting {@link VideoStreamRendererViewState} is stored in the given callId {@link CallState.localVideoStreams}\n * in {@link CallClientState}.\n *\n * - Scenario 2: Render LocalVideoStreamState not part of a call (example rendering camera for local preview)\n * - CallId must be undefined, participantId must be undefined, and stream of type LocalVideoStreamState is required.\n * - Resulting {@link VideoStreamRendererViewState} is stored in under the given LocalVideoStreamState in\n * {@link CallClientState.deviceManager.unparentedViews}\n *\n * @param callId - CallId for the given stream. Can be undefined if the stream is not part of any call.\n * @param participantId - {@link RemoteParticipant.identifier} associated with the given RemoteVideoStreamState. Could\n * be undefined if rendering LocalVideoStreamState.\n * @param stream - The LocalVideoStreamState or RemoteVideoStreamState to start rendering.\n * @param options - Options that are passed to the {@link @azure/communication-calling#VideoStreamRenderer}.\n */\n createView(\n callId: string | undefined,\n participantId: CommunicationIdentifier | undefined,\n stream:\n | LocalVideoStreamState\n | RemoteVideoStreamState\n | /* @conditional-compile-remove(together-mode) */ CallFeatureStreamState,\n options?: CreateViewOptions\n ): Promise<CreateViewResult | undefined>;\n /**\n * Stops rendering a {@link RemoteVideoStreamState} or {@link LocalVideoStreamState} and removes the\n * {@link VideoStreamRendererView} from the relevant {@link RemoteVideoStreamState} in {@link CallClientState} or\n * {@link LocalVideoStream} in {@link CallClientState} or appropriate\n * {@link CallClientState.deviceManager.unparentedViews} Under the hood calls\n * {@link @azure/communication-calling#VideoStreamRenderer.dispose}.\n *\n * Its important to disposeView to clean up resources properly.\n *\n * Scenario 1: Dispose RemoteVideoStreamState\n * - CallId is required, participantId is required, and stream of type RemoteVideoStreamState is required\n *\n * Scenario 2: Dispose LocalVideoStreamState for a call\n * - CallId is required, participantId must be undefined, and stream of type LocalVideoStreamState is required.\n *\n * - Scenario 2: Dispose LocalVideoStreamState not part of a call\n * - CallId must be undefined, participantId must be undefined, and stream of type LocalVideoStreamState is required.\n * - LocalVideoStreamState must be the original one passed to createView.\n *\n * @param callId - CallId for the given stream. Can be undefined if the stream is not part of any call.\n * @param participantId - {@link RemoteParticipant.identifier} associated with the given RemoteVideoStreamState. Could\n * be undefined if disposing LocalVideoStreamState.\n * @param stream - The LocalVideoStreamState or RemoteVideoStreamState to dispose.\n */\n disposeView(\n callId: string | undefined,\n participantId: CommunicationIdentifier | undefined,\n stream:\n | LocalVideoStreamState\n | RemoteVideoStreamState\n | /* @conditional-compile-remove(together-mode) */ CallFeatureStreamState\n ): void;\n /**\n * The CallAgent is used to handle calls.\n * To create the CallAgent, pass a CommunicationTokenCredential object provided from SDK.\n * - The CallClient can only have one active CallAgent instance at a time.\n * - You can create a new CallClient instance to create a new CallAgent.\n * - You can dispose of a CallClient's current active CallAgent, and call the CallClient's\n * createCallAgent() method again to create a new CallAgent.\n * @param tokenCredential - The token credential. Use AzureCommunicationTokenCredential from `@azure/communication-common` to create a credential.\n * @param options - The CallAgentOptions for additional options like display name.\n * @public\n */\n createCallAgent(...args: Parameters<CallClient['createCallAgent']>): Promise<DeclarativeCallAgent>;\n\n /**\n * The TeamsCallAgent is used to handle calls.\n * To create the TeamsCallAgent, pass a CommunicationTokenCredential object provided from SDK.\n * - The CallClient can only have one active TeamsCallAgent instance at a time.\n * - You can create a new CallClient instance to create a new TeamsCallAgent.\n * - You can dispose of a CallClient's current active TeamsCallAgent, and call the CallClient's\n * createTeamsCallAgent() method again to create a new TeamsCallAgent.\n * @param tokenCredential - The token credential. Use AzureCommunicationTokenCredential from `@azure/communication-common` to create a credential.\n * @param options - The TeamsCallAgentOptions for additional options like display name.\n * @public\n */\n createTeamsCallAgent(...args: Parameters<CallClient['createTeamsCallAgent']>): Promise<DeclarativeTeamsCallAgent>;\n}\n\n/**\n * A function to modify the state of the StatefulCallClient.\n *\n * Provided as a callback to the {@link StatefulCallClient.modifyState} method.\n *\n * The function must modify the provided state in place as much as possible.\n * Making large modifications can lead to bad performance by causing spurious rerendering of the UI.\n *\n * Consider using commonly used modifier functions exported from this package.\n */\nexport type CallStateModifier = (state: CallClientState) => void;\n\n/**\n * ProxyCallClient proxies CallClient {@link @azure/communication-calling#CallClient} and subscribes to all events that\n * affect state. ProxyCallClient keeps its own copy of the call state and when state is updated, ProxyCallClient emits\n * the event 'stateChanged'.\n */\nclass ProxyCallClient implements ProxyHandler<CallClient> {\n private _context: CallContext;\n private _internalContext: InternalCallContext;\n private _callAgent: DeclarativeCallAgent | DeclarativeTeamsCallAgent | undefined;\n private _deviceManager: DeviceManager | undefined;\n private _sdkDeviceManager: DeviceManager | undefined;\n\n constructor(context: CallContext, internalContext: InternalCallContext) {\n this._context = context;\n this._internalContext = internalContext;\n }\n\n public get<P extends keyof CallClient>(target: CallClient, prop: P): any {\n switch (prop) {\n case 'createCallAgent': {\n return this._context.withAsyncErrorTeedToState(\n async (...args: Parameters<CallClient['createCallAgent']>): Promise<DeclarativeCallAgent> => {\n // createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous\n // callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative\n // callAgent if the createCallAgent succeeds.\n const callAgent = await target.createCallAgent(...args);\n this._callAgent = callAgentDeclaratify(callAgent, this._context, this._internalContext);\n this._context.setCallAgent({\n displayName: this._callAgent.displayName\n });\n return this._callAgent;\n },\n 'CallClient.createCallAgent'\n );\n }\n case 'createTeamsCallAgent': {\n return this._context.withAsyncErrorTeedToState(\n async (...args: Parameters<CallClient['createTeamsCallAgent']>): Promise<DeclarativeTeamsCallAgent> => {\n // createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous\n // callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative\n // callAgent if the createCallAgent succeeds.\n const callAgent = await target.createTeamsCallAgent(...args);\n this._callAgent = teamsCallAgentDeclaratify(callAgent, this._context, this._internalContext);\n this._context.setCallAgent({\n displayName: undefined\n });\n return this._callAgent;\n },\n 'CallClient.createTeamsCallAgent'\n );\n }\n case 'getDeviceManager': {\n return this._context.withAsyncErrorTeedToState(async () => {\n // As of writing, the SDK always returns the same instance of DeviceManager so we keep a reference of\n // DeviceManager and if it does not change we return the cached DeclarativeDeviceManager. If it does not we'll\n // throw an error that indicate we need to fix this issue as our implementation has diverged from the SDK.\n const deviceManager = await target.getDeviceManager();\n if (this._sdkDeviceManager) {\n if (this._sdkDeviceManager === deviceManager) {\n return this._deviceManager;\n } else {\n throw new Error(\n 'Multiple DeviceManager not supported. This means a incompatible version of communication-calling is ' +\n 'used OR calling declarative was not properly updated to communication-calling version.'\n );\n }\n } else {\n this._sdkDeviceManager = deviceManager;\n }\n this._deviceManager = deviceManagerDeclaratify(deviceManager, this._context, this._internalContext);\n return this._deviceManager;\n }, 'CallClient.getDeviceManager');\n }\n case 'feature': {\n return this._context.withErrorTeedToState((...args: Parameters<CallClient['feature']>) => {\n if (args[0] === Features.DebugInfo) {\n const feature = target.feature(Features.DebugInfo);\n /**\n * add to this object if we want to proxy anything else off the DebugInfo feature object.\n */\n return {\n ...feature,\n getEnvironmentInfo: async () => {\n const environmentInfo = await feature.getEnvironmentInfo();\n this._context.setEnvironmentInfo(environmentInfo);\n return environmentInfo;\n }\n };\n }\n return Reflect.get(target, prop);\n }, 'CallClient.feature');\n }\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n\n/**\n * Arguments to construct the StatefulCallClient.\n *\n * @public\n */\nexport type StatefulCallClientArgs = {\n /**\n * UserId from SDK. This is provided for developer convenience to easily access the userId from the\n * state. It is not used by StatefulCallClient.\n */\n userId: CommunicationUserIdentifier | MicrosoftTeamsUserIdentifier;\n};\n\n/**\n * Options to construct the StatefulCallClient with.\n *\n * @public\n */\nexport type StatefulCallClientOptions = {\n /**\n * Options to construct the {@link @axure/communication-calling#CallClient} with.\n */\n callClientOptions: CallClientOptions;\n /**\n * Sets the max listeners limit of the 'stateChange' event. Defaults to the node.js EventEmitter.defaultMaxListeners\n * if not specified.\n */\n maxStateChangeListeners?: number;\n};\n\n/**\n * Creates a StatefulCallClient {@link StatefulCallClient} by proxying CallClient\n * {@link @azure/communication-calling#CallClient} with ProxyCallClient {@link ProxyCallClient} which then allows access\n * to state in a declarative way.\n *\n * It is important to use the {@link @azure/communication-calling#DeviceManager} and\n * {@link @azure/communication-calling#CallAgent} and {@link @azure/communication-calling#Call} (and etc.) that are\n * obtained from the StatefulCallClient in order for their state changes to be proxied properly.\n *\n * @param args - {@link StatefulCallClientArgs}\n * @param options - {@link StatefulCallClientOptions}\n *\n * @public\n */\nexport const createStatefulCallClient = (\n args: StatefulCallClientArgs,\n options?: StatefulCallClientOptions\n): StatefulCallClient => {\n return _createStatefulCallClientInner(args, options);\n};\n\n/**\n * This inner function is used to allow injection of TelemetryImplementationHint without changing the public API.\n *\n * @internal\n */\nexport const _createStatefulCallClientInner = (\n args: StatefulCallClientArgs,\n options?: StatefulCallClientOptions,\n telemetryImplementationHint: _TelemetryImplementationHint = 'StatefulComponents'\n): StatefulCallClient => {\n callingStatefulLogger.info(\n `Creating calling stateful client using library version: ${_getApplicationId(telemetryImplementationHint)}`\n );\n return createStatefulCallClientWithDeps(\n new CallClient(withTelemetryTag(telemetryImplementationHint, options?.callClientOptions)),\n new CallContext(getIdentifierKind(args.userId), options?.maxStateChangeListeners),\n new InternalCallContext()\n );\n};\n\n/**\n * Package-internal version of createStatefulCallClient that allows dependency injection.\n *\n * This function should not be exported from the package.\n */\nexport const createStatefulCallClientWithDeps = (\n callClient: CallClient,\n context: CallContext,\n internalContext: InternalCallContext\n): StatefulCallClient => {\n Object.defineProperty(callClient, 'getState', {\n configurable: false,\n value: () => context.getState()\n });\n Object.defineProperty(callClient, 'onStateChange', {\n configurable: false,\n value: (handler: (state: CallClientState) => void) => context.onStateChange(handler)\n });\n Object.defineProperty(callClient, 'offStateChange', {\n configurable: false,\n value: (handler: (state: CallClientState) => void) => context.offStateChange(handler)\n });\n Object.defineProperty(callClient, 'createView', {\n configurable: false,\n value: async (\n callId: string | undefined,\n participantId: CommunicationIdentifier | undefined,\n stream:\n | LocalVideoStreamState\n | RemoteVideoStreamState\n | /* @conditional-compile-remove(together-mode) */ CallFeatureStreamState,\n options?: CreateViewOptions\n ): Promise<CreateViewResult | undefined> => {\n /* @conditional-compile-remove(together-mode) */\n if ('feature' in stream) {\n return await createCallFeatureView(context, internalContext, callId, stream, options);\n }\n const participantIdKind = participantId ? getIdentifierKind(participantId) : undefined;\n const result = await createView(context, internalContext, callId, participantIdKind, stream, options);\n // We only need to declaratify the VideoStreamRendererView object for remote participants. Because the updateScalingMode only needs to be called on remote participant stream views.\n if ('id' in stream && callId && participantId && result) {\n const participantKey = toFlatCommunicationIdentifier(participantId);\n result.view = videoStreamRendererViewDeclaratify(result.view, context, callId, participantKey, stream.id);\n }\n return result;\n }\n });\n Object.defineProperty(callClient, 'disposeView', {\n configurable: false,\n value: (\n callId: string | undefined,\n participantId: CommunicationIdentifier | undefined,\n stream:\n | LocalVideoStreamState\n | RemoteVideoStreamState\n | /* @conditional-compile-remove(together-mode) */ CallFeatureStreamState\n ): void => {\n /* @conditional-compile-remove(together-mode) */\n if ('feature' in stream) {\n disposeCallFeatureView(context, internalContext, callId, stream);\n }\n const participantIdKind = participantId ? getIdentifierKind(participantId) : undefined;\n disposeView(context, internalContext, callId, participantIdKind, stream);\n }\n });\n\n const newStatefulCallClient = new Proxy(\n callClient,\n new ProxyCallClient(context, internalContext)\n ) as StatefulCallClient;\n\n // Populate initial state\n newStatefulCallClient.feature(Features.DebugInfo).getEnvironmentInfo();\n\n return newStatefulCallClient;\n};\n\nconst withTelemetryTag = (\n telemetryImplementationHint: _TelemetryImplementationHint,\n options?: CallClientOptions\n): CallClientOptions => {\n const tags = options?.diagnostics?.tags ?? [];\n tags.push(_getApplicationId(telemetryImplementationHint));\n return {\n ...options,\n diagnostics: {\n ...options?.diagnostics,\n tags\n }\n };\n};\n"]}
@@ -44,7 +44,7 @@ export type { CameraAndMicrophoneSitePermissionsStrings, CameraAndMicrophoneSite
44
44
  export type { ParticipantListStrings } from '../../react-components/src';
45
45
  export type { MentionOptions, MentionDisplayOptions, MentionLookupOptions, Mention, MentionPopoverStrings } from '../../react-components/src';
46
46
  export type { _IdentifierProviderProps, _Identifiers, ActiveErrorMessage, BaseCustomStyles, CallParticipantListParticipant, CameraButtonContextualMenuStyles, CameraButtonProps, CameraButtonStrings, CameraButtonStyles, ChatMessage, CommunicationParticipant, ComponentLocale, ComponentSlotStyle, ComponentStrings, ContentSystemMessage, ControlBarButtonProps, ControlBarButtonStrings, ControlBarButtonStyles, ControlBarLayout, ControlBarProps, CreateVideoStreamViewResult, CustomAvatarOptions, CustomMessage, DevicesButtonContextualMenuStyles, DevicesButtonProps, DevicesButtonStrings, DevicesButtonStyles, EndCallButtonProps, EndCallButtonStrings, ErrorBarProps, ErrorBarStrings, ErrorType, GridLayoutProps, GridLayoutStyles, HorizontalGalleryStyles, JumpToNewMessageButtonProps, LocalizationProviderProps, LocalVideoCameraCycleButtonProps, LoadingState, Message, MessageAttachedStatus, MessageCommon, MessageContentType, MessageProps, MessageRenderer, MessageStatusIndicatorProps, MessageStatusIndicatorStrings, MessageThreadProps, MessageThreadStrings, MessageThreadStyles, MicrophoneButtonContextualMenuStyles, MicrophoneButtonProps, MicrophoneButtonStrings, MicrophoneButtonStyles, OnRenderAvatarCallback, OptionsDevice, ParticipantAddedSystemMessage, ParticipantItemProps, ParticipantItemStrings, ParticipantItemStyles, ParticipantListItemStyles, ParticipantListParticipant, ParticipantListProps, ParticipantListStyles, ParticipantMenuItemsCallback, ParticipantRemovedSystemMessage, ParticipantState, ParticipantsButtonContextualMenuStyles, ParticipantsButtonProps, ParticipantsButtonStrings, ParticipantsButtonStyles, ReadReceiptsBySenderId, ScreenShareButtonProps, ScreenShareButtonStrings, SendBoxProps, SendBoxStrings, SendBoxStylesProps, StreamMediaProps, SystemMessage, SystemMessageCommon, TopicUpdatedSystemMessage, TypingIndicatorProps, TypingIndicatorStrings, TypingIndicatorStylesProps, UpdateMessageCallback, CancelEditCallback, VideoGalleryLayout, VideoGalleryLocalParticipant, VideoGalleryParticipant, VideoGalleryProps, VideoGalleryRemoteParticipant, VideoGalleryStream, VideoGalleryStrings, VideoGalleryStyles, VideoStreamOptions, VideoTileProps, VideoTileStylesProps, ViewScalingMode, VideoTileContextualMenuProps, VideoTileDrawerMenuProps, VideoTilesOptions } from '../../react-components/src';
47
- export type { TogetherModeStreamViewResult } from '../../react-components/src';
47
+ export type { TogetherModeStreamViewResult, VideoGalleryTogetherModeStreams, VideoGalleryTogetherModeParticipantPosition, VideoGalleryTogetherModeSeatingInfo, TogetherModeStreamOptions } from '../../react-components/src';
48
48
  export type { RaiseHandButtonProps, RaiseHandButtonStrings, RaisedHand } from '../../react-components/src';
49
49
  export type { ReactionButtonStrings, Reaction, ReactionButtonProps, ReactionResources, ReactionSprite, ReactionButtonReaction } from '../../react-components/src';
50
50
  export { ReactionButton } from '../../react-components/src';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,+BAA+B,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AA0CzG,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,OAAO,EACP,gBAAgB,EAChB,kBAAkB,EAClB,4BAA4B,EAC7B,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,iC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,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAqC7D,mDAAmD;AACnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAiBzE,cAAc,iDAAiD,CAAC;AAChE,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAE/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAiB1E,cAAc,yCAAyC,CAAC;AACxD,cAAc,eAAe,CAAC;AAE9B,sDAAsD;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAGhE,sDAAsD;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAGvE,sDAAsD;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAiBxE,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAc7E,sCAAsC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAItD,sCAAsC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGjE,sCAAsC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAC;AAQlF,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * `@azure/communication-react` is an npm package that exports the functionality of the Azure Communication Services - UI Library.\n *\n * This package makes it easy for you to build modern communications user experiences using Azure Communication Services. It gives you a library of production-ready UI components that you can drop into your applications:\n * - Composites: These components are turn-key solutions that implement common communication scenarios. You can quickly add video calling or chat experiences to your applications. Composites are open-source higher order components built using UI components.\n * - UI Components - These components are open-source building blocks that let you build custom communications experience. Components are offered for both calling and chat capabilities that can be combined to build experiences.\n *\n * These UI client libraries all use Microsoft's Fluent design language and assets. Fluent UI provides a foundational layer for the UI Library and is actively used across Microsoft products.\n *\n * In conjunction with the UI components, the UI Library exposes a stateful client library for calling and chat. This client is agnostic to any specific state management framework and can be integrated with common state managers like Redux or React Context.\n * This stateful client library can be used with the UI Components to pass props and methods for the UI Components to render data. For more information, see Stateful Client Overview.\n *\n * For more information visit: https://aka.ms/acsstorybook\n *\n * @packageDocumentation\n */\n\nexport { fromFlatCommunicationIdentifier, toFlatCommunicationIdentifier } from '../../acs-ui-common/src';\nexport type {\n AreEqual,\n CommonProperties,\n MessageStatus,\n Common,\n AreTypeEqual,\n AreParamEqual\n} from '../../acs-ui-common/src';\n\n// Not to export chat/calling specific hook from binding package\nexport type {\n CallClientProviderProps,\n CallAgentProviderProps,\n CallProviderProps,\n GetCallingSelector,\n CallingHandlers,\n CallingBaseSelectorProps,\n CommonCallingHandlers\n} from '../../calling-component-bindings/src';\n\nexport type {\n DeepNoiseSuppressionEffectDependency,\n VideoBackgroundEffectsDependency,\n CallingHandlersOptions\n} from '../../calling-component-bindings/src';\n\nexport type { CaptionsOptions } from '../../calling-component-bindings/src';\n\nexport type {\n ChatClientProviderProps,\n ChatThreadClientProviderProps,\n GetChatSelector,\n ChatHandlers,\n ChatBaseSelectorProps\n} from '../../chat-component-bindings/src';\n\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { MessageOptions, ChatMessageType } from '../../acs-ui-common/src';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nexport type { UploadChatImageResult } from '../../acs-ui-common/src';\n\nexport {\n CallClientProvider,\n CallAgentProvider,\n CallProvider,\n useCallClient,\n useCallAgent,\n useCall,\n useDeviceManager,\n getCallingSelector,\n createDefaultCallingHandlers\n} from '../../calling-component-bindings/src';\n\nexport {\n useTeamsCallAgent,\n useTeamsCall,\n createDefaultTeamsCallingHandlers\n} from '../../calling-component-bindings/src';\n\nexport type { TeamsCallingHandlers } from '../../calling-component-bindings/src';\n\nexport type {\n ScreenShareButtonSelector,\n CameraButtonSelector,\n VideoGallerySelector,\n DevicesButtonSelector,\n EmptySelector,\n ErrorBarSelector as CallErrorBarSelector,\n ParticipantListSelector,\n MicrophoneButtonSelector,\n ParticipantsButtonSelector,\n CreateDefaultCallingHandlers\n} from '../../calling-component-bindings/src';\nexport type { HoldButtonSelector } from '../../calling-component-bindings/src';\n\nexport type { RaiseHandButtonSelector } from '../../calling-component-bindings/src';\n\nexport type { NotificationStackSelector } from '../../calling-component-bindings/src';\nexport type { IncomingCallStackSelector } from '../../calling-component-bindings/src';\n\nexport {\n ChatClientProvider,\n ChatThreadClientProvider,\n useChatClient,\n useChatThreadClient,\n getChatSelector,\n createDefaultChatHandlers\n} from '../../chat-component-bindings/src';\n\nexport type {\n MessageThreadSelector,\n TypingIndicatorSelector,\n ChatParticipantListSelector,\n SendBoxSelector,\n ErrorBarSelector as ChatErrorBarSelector\n} from '../../chat-component-bindings/src';\n\nexport {\n _IdentifierProvider,\n CameraButton,\n ControlBar,\n ControlBarButton,\n DevicesButton,\n EndCallButton,\n ErrorBar,\n GridLayout,\n LocalizationProvider,\n MessageStatusIndicator,\n MessageThread,\n MicrophoneButton,\n ParticipantItem,\n ParticipantList,\n ParticipantsButton,\n ScreenShareButton,\n SendBox,\n StreamMedia,\n TypingIndicator,\n VideoGallery,\n VideoTile,\n COMPONENT_LOCALE_EN_GB,\n COMPONENT_LOCALE_AR_SA,\n COMPONENT_LOCALE_CS_CZ,\n COMPONENT_LOCALE_CY_GB,\n COMPONENT_LOCALE_DE_DE,\n COMPONENT_LOCALE_ES_ES,\n COMPONENT_LOCALE_ES_MX,\n COMPONENT_LOCALE_FI_FI,\n COMPONENT_LOCALE_FR_FR,\n COMPONENT_LOCALE_FR_CA,\n COMPONENT_LOCALE_HE_IL,\n COMPONENT_LOCALE_IT_IT,\n COMPONENT_LOCALE_JA_JP,\n COMPONENT_LOCALE_KO_KR,\n COMPONENT_LOCALE_NB_NO,\n COMPONENT_LOCALE_NL_NL,\n COMPONENT_LOCALE_PL_PL,\n COMPONENT_LOCALE_PT_BR,\n COMPONENT_LOCALE_RU_RU,\n COMPONENT_LOCALE_SV_SE,\n COMPONENT_LOCALE_TR_TR,\n COMPONENT_LOCALE_ZH_CN,\n COMPONENT_LOCALE_ZH_TW\n} from '../../react-components/src';\nexport { ImageOverlay } from '../../react-components/src';\nexport { HoldButton } from '../../react-components/src';\n\nexport { RaiseHandButton } from '../../react-components/src';\n\nexport { Dialpad } from '../../react-components/src';\n\nexport { IncomingCallNotification, IncomingCallStack } from '../../react-components/src';\nexport type {\n IncomingCallNotificationProps,\n IncomingCallNotificationStrings,\n IncomingCallNotificationStyles,\n IncomingCallStackProps,\n IncomingCallStackCall\n} from '../../react-components/src';\n\n/* @conditional-compile-remove(call-readiness) */\nexport {\n CameraAndMicrophoneSitePermissions,\n MicrophoneSitePermissions,\n CameraSitePermissions\n} from '../../react-components/src';\n/* @conditional-compile-remove(call-readiness) */\nexport type {\n CameraAndMicrophoneSitePermissionsStrings,\n CameraAndMicrophoneSitePermissionsProps,\n CameraSitePermissionsStrings,\n CameraSitePermissionsProps,\n CommonSitePermissionsProps,\n SitePermissionsStrings,\n SitePermissionsStyles,\n MicrophoneSitePermissionsStrings,\n MicrophoneSitePermissionsProps\n} from '../../react-components/src';\n\n/* @conditional-compile-remove(total-participant-count) */\nexport type { ParticipantListStrings } from '../../react-components/src';\n\n/* @conditional-compile-remove(mention) */\nexport type {\n MentionOptions,\n MentionDisplayOptions,\n MentionLookupOptions,\n Mention,\n MentionPopoverStrings\n} from '../../react-components/src';\n\nexport type {\n _IdentifierProviderProps,\n _Identifiers,\n ActiveErrorMessage,\n BaseCustomStyles,\n CallParticipantListParticipant,\n CameraButtonContextualMenuStyles,\n CameraButtonProps,\n CameraButtonStrings,\n CameraButtonStyles,\n ChatMessage,\n CommunicationParticipant,\n ComponentLocale,\n ComponentSlotStyle,\n ComponentStrings,\n ContentSystemMessage,\n ControlBarButtonProps,\n ControlBarButtonStrings,\n ControlBarButtonStyles,\n ControlBarLayout,\n ControlBarProps,\n CreateVideoStreamViewResult,\n CustomAvatarOptions,\n CustomMessage,\n DevicesButtonContextualMenuStyles,\n DevicesButtonProps,\n DevicesButtonStrings,\n DevicesButtonStyles,\n EndCallButtonProps,\n EndCallButtonStrings,\n ErrorBarProps,\n ErrorBarStrings,\n ErrorType,\n GridLayoutProps,\n GridLayoutStyles,\n HorizontalGalleryStyles,\n JumpToNewMessageButtonProps,\n LocalizationProviderProps,\n LocalVideoCameraCycleButtonProps,\n LoadingState,\n Message,\n MessageAttachedStatus,\n MessageCommon,\n MessageContentType,\n MessageProps,\n MessageRenderer,\n MessageStatusIndicatorProps,\n MessageStatusIndicatorStrings,\n MessageThreadProps,\n MessageThreadStrings,\n MessageThreadStyles,\n MicrophoneButtonContextualMenuStyles,\n MicrophoneButtonProps,\n MicrophoneButtonStrings,\n MicrophoneButtonStyles,\n OnRenderAvatarCallback,\n OptionsDevice,\n ParticipantAddedSystemMessage,\n ParticipantItemProps,\n ParticipantItemStrings,\n ParticipantItemStyles,\n ParticipantListItemStyles,\n ParticipantListParticipant,\n ParticipantListProps,\n ParticipantListStyles,\n ParticipantMenuItemsCallback,\n ParticipantRemovedSystemMessage,\n ParticipantState,\n ParticipantsButtonContextualMenuStyles,\n ParticipantsButtonProps,\n ParticipantsButtonStrings,\n ParticipantsButtonStyles,\n ReadReceiptsBySenderId,\n ScreenShareButtonProps,\n ScreenShareButtonStrings,\n SendBoxProps,\n SendBoxStrings,\n SendBoxStylesProps,\n StreamMediaProps,\n SystemMessage,\n SystemMessageCommon,\n TopicUpdatedSystemMessage,\n TypingIndicatorProps,\n TypingIndicatorStrings,\n TypingIndicatorStylesProps,\n UpdateMessageCallback,\n CancelEditCallback,\n VideoGalleryLayout,\n VideoGalleryLocalParticipant,\n VideoGalleryParticipant,\n VideoGalleryProps,\n VideoGalleryRemoteParticipant,\n VideoGalleryStream,\n VideoGalleryStrings,\n VideoGalleryStyles,\n VideoStreamOptions,\n VideoTileProps,\n VideoTileStylesProps,\n ViewScalingMode,\n VideoTileContextualMenuProps,\n VideoTileDrawerMenuProps,\n VideoTilesOptions\n} from '../../react-components/src';\n\n/* @conditional-compile-remove(together-mode) */\nexport type { TogetherModeStreamViewResult } from '../../react-components/src';\n\nexport type { RaiseHandButtonProps, RaiseHandButtonStrings, RaisedHand } from '../../react-components/src';\nexport type {\n ReactionButtonStrings,\n Reaction,\n ReactionButtonProps,\n ReactionResources,\n ReactionSprite,\n ReactionButtonReaction\n} from '../../react-components/src';\n\nexport { ReactionButton } from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor) */\nexport { RichTextSendBox } from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor) */\nexport type { RichTextSendBoxProps, RichTextSendBoxStrings, RichTextStrings } from '../../react-components/src';\nexport type { Spotlight } from '../../react-components/src';\nexport type { ImageOverlayProps, ImageOverlayStrings } from '../../react-components/src';\n/* @conditional-compile-remove(data-loss-prevention) */\nexport type { BlockedMessage } from '../../react-components/src';\nexport type {\n DialpadMode,\n DialpadProps,\n DialpadStrings,\n DialpadStyles,\n DtmfTone,\n LongPressTrigger\n} from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentOptions } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { SendBoxErrorBarError } from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nexport type { SendBoxErrorBarType } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentActionHandler } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type {\n AttachmentSelectionHandler,\n AttachmentRemovalHandler,\n AttachmentUploadOptions,\n AttachmentUploadTask\n} from '../../react-components/src';\nexport type { AttachmentMetadata } from '../../acs-ui-common/src';\n\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentMetadataInProgress, AttachmentProgressError } from '../../acs-ui-common/src';\n\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentMenuAction, AttachmentDownloadOptions } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport { defaultAttachmentMenuAction } from '../../react-components/src';\nexport type { ChatAttachmentType } from '../../react-components/src';\nexport type { InlineImageOptions, InlineImage } from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor) */\nexport type { RichTextEditorOptions, RichTextEditBoxOptions } from '../../react-components/src';\nexport type { HoldButtonProps, HoldButtonStrings } from '../../react-components/src';\nexport type { VideoTileStrings } from '../../react-components/src';\n/* @conditional-compile-remove(call-readiness) */\nexport type { BrowserPermissionDeniedStrings, BrowserPermissionDeniedProps } from '../../react-components/src';\n/* @conditional-compile-remove(call-readiness) */\nexport type {\n BrowserPermissionDeniedIOSStrings,\n BrowserPermissionDeniedStyles,\n BrowserPermissionDeniedIOSProps\n} from '../../react-components/src';\nexport type { OverflowGalleryPosition } from '../../react-components/src';\nexport type { LocalVideoTileSize } from '../../react-components/src';\nexport * from '../../react-components/src/localization/locales';\nexport * from '../../react-components/src/theming';\nexport * from '../../calling-stateful-client/src/index-public';\nexport type { DeclarativeCallAgent } from '../../calling-stateful-client/src';\nexport { createStatefulChatClient } from '../../chat-stateful-client/src';\nexport type {\n StatefulChatClient,\n StatefulChatClientArgs,\n StatefulChatClientOptions,\n ChatMessageWithStatus,\n ChatClientState,\n ChatError,\n ChatErrors,\n ChatThreadClientState,\n ChatThreadProperties,\n ChatErrorTarget\n} from '../../chat-stateful-client/src';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nexport type { MessagingPolicy } from '../../chat-stateful-client/src';\n\nexport type { ResourceFetchResult } from '../../chat-stateful-client/src';\nexport * from '../../react-composites/src/index-public';\nexport * from './mergedHooks';\n\n/* @conditional-compile-remove(unsupported-browser) */\nexport { UnsupportedBrowser } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport type { UnsupportedBrowserStrings, UnsupportedBrowserProps } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport { UnsupportedBrowserVersion } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport type { UnsupportedBrowserVersionStrings, UnsupportedBrowserVersionProps } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport { UnsupportedOperatingSystem } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport type { UnsupportedOperatingSystemStrings, UnsupportedOperatingSystemProps } from '../../react-components/src';\nexport type {\n VerticalGalleryStyles,\n VerticalGalleryStrings,\n VerticalGalleryControlBarStyles\n} from '../../react-components/src';\n\nexport type { SpokenLanguageStrings, CaptionLanguageStrings } from '../../react-components/src';\n\nexport type { SurveyIssues } from '../../react-components/src';\n\nexport type { SurveyIssuesHeadingStrings } from '../../react-components/src';\n\nexport type { CallSurveyImprovementSuggestions } from '../../react-components/src';\n\nexport { NotificationStack, Notification } from '../../react-components/src';\n\nexport type {\n NotificationStackProps,\n NotificationProps,\n NotificationStrings,\n NotificationStackStrings,\n NotificationType,\n ActiveNotification,\n NotificationStyles\n} from '../../react-components/src';\nexport type { MeetingConferencePhoneInfoModalStrings } from '../../react-components/src';\n/* @conditional-compile-remove(rtt) */\nexport type { RTTModalStrings, RTTModalProps } from '../../react-components/src';\n/* @conditional-compile-remove(rtt) */\nexport { RTTModal } from '../../react-components/src';\n\n/* @conditional-compile-remove(rtt) */\nexport type { RTTDisclosureBannerProps, RTTDisclosureBannerStrings } from '../../react-components/src';\n/* @conditional-compile-remove(rtt) */\nexport { RTTDisclosureBanner } from '../../react-components/src';\n/* @conditional-compile-remove(rtt) */\nexport type { RealTimeTextProps, RealTimeTextStrings } from '../../react-components/src/components/RealTimeText';\n/* @conditional-compile-remove(rtt) */\nexport { RealTimeText } from '../../react-components/src/components/RealTimeText';\n/* @conditional-compile-remove(media-access) */\nexport type { MediaAccess } from '../../react-components/src';\nexport type {\n CaptionsBannerProps,\n CaptionsInformation,\n CaptionsBannerStrings\n} from '../../react-components/src/components/CaptionsBanner';\nexport { CaptionsBanner } from '../../react-components/src/components/CaptionsBanner';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,+BAA+B,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AA0CzG,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,OAAO,EACP,gBAAgB,EAChB,kBAAkB,EAClB,4BAA4B,EAC7B,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,iCAAiC,EAClC,MAAM,sCAAsC,CAAC;AAuB9C,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,yBAAyB,EAC1B,MAAM,mCAAmC,CAAC;AAU3C,OAAO,EACL,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,QAAQ,EACR,UAAU,EACV,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,OAAO,EACP,WAAW,EACX,eAAe,EACf,YAAY,EACZ,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,E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corporation.\n// Licensed under the MIT License.\n\n/**\n * `@azure/communication-react` is an npm package that exports the functionality of the Azure Communication Services - UI Library.\n *\n * This package makes it easy for you to build modern communications user experiences using Azure Communication Services. It gives you a library of production-ready UI components that you can drop into your applications:\n * - Composites: These components are turn-key solutions that implement common communication scenarios. You can quickly add video calling or chat experiences to your applications. Composites are open-source higher order components built using UI components.\n * - UI Components - These components are open-source building blocks that let you build custom communications experience. Components are offered for both calling and chat capabilities that can be combined to build experiences.\n *\n * These UI client libraries all use Microsoft's Fluent design language and assets. Fluent UI provides a foundational layer for the UI Library and is actively used across Microsoft products.\n *\n * In conjunction with the UI components, the UI Library exposes a stateful client library for calling and chat. This client is agnostic to any specific state management framework and can be integrated with common state managers like Redux or React Context.\n * This stateful client library can be used with the UI Components to pass props and methods for the UI Components to render data. For more information, see Stateful Client Overview.\n *\n * For more information visit: https://aka.ms/acsstorybook\n *\n * @packageDocumentation\n */\n\nexport { fromFlatCommunicationIdentifier, toFlatCommunicationIdentifier } from '../../acs-ui-common/src';\nexport type {\n AreEqual,\n CommonProperties,\n MessageStatus,\n Common,\n AreTypeEqual,\n AreParamEqual\n} from '../../acs-ui-common/src';\n\n// Not to export chat/calling specific hook from binding package\nexport type {\n CallClientProviderProps,\n CallAgentProviderProps,\n CallProviderProps,\n GetCallingSelector,\n CallingHandlers,\n CallingBaseSelectorProps,\n CommonCallingHandlers\n} from '../../calling-component-bindings/src';\n\nexport type {\n DeepNoiseSuppressionEffectDependency,\n VideoBackgroundEffectsDependency,\n CallingHandlersOptions\n} from '../../calling-component-bindings/src';\n\nexport type { CaptionsOptions } from '../../calling-component-bindings/src';\n\nexport type {\n ChatClientProviderProps,\n ChatThreadClientProviderProps,\n GetChatSelector,\n ChatHandlers,\n ChatBaseSelectorProps\n} from '../../chat-component-bindings/src';\n\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { MessageOptions, ChatMessageType } from '../../acs-ui-common/src';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nexport type { UploadChatImageResult } from '../../acs-ui-common/src';\n\nexport {\n CallClientProvider,\n CallAgentProvider,\n CallProvider,\n useCallClient,\n useCallAgent,\n useCall,\n useDeviceManager,\n getCallingSelector,\n createDefaultCallingHandlers\n} from '../../calling-component-bindings/src';\n\nexport {\n useTeamsCallAgent,\n useTeamsCall,\n createDefaultTeamsCallingHandlers\n} from '../../calling-component-bindings/src';\n\nexport type { TeamsCallingHandlers } from '../../calling-component-bindings/src';\n\nexport type {\n ScreenShareButtonSelector,\n CameraButtonSelector,\n VideoGallerySelector,\n DevicesButtonSelector,\n EmptySelector,\n ErrorBarSelector as CallErrorBarSelector,\n ParticipantListSelector,\n MicrophoneButtonSelector,\n ParticipantsButtonSelector,\n CreateDefaultCallingHandlers\n} from '../../calling-component-bindings/src';\nexport type { HoldButtonSelector } from '../../calling-component-bindings/src';\n\nexport type { RaiseHandButtonSelector } from '../../calling-component-bindings/src';\n\nexport type { NotificationStackSelector } from '../../calling-component-bindings/src';\nexport type { IncomingCallStackSelector } from '../../calling-component-bindings/src';\n\nexport {\n ChatClientProvider,\n ChatThreadClientProvider,\n useChatClient,\n useChatThreadClient,\n getChatSelector,\n createDefaultChatHandlers\n} from '../../chat-component-bindings/src';\n\nexport type {\n MessageThreadSelector,\n TypingIndicatorSelector,\n ChatParticipantListSelector,\n SendBoxSelector,\n ErrorBarSelector as ChatErrorBarSelector\n} from '../../chat-component-bindings/src';\n\nexport {\n _IdentifierProvider,\n CameraButton,\n ControlBar,\n ControlBarButton,\n DevicesButton,\n EndCallButton,\n ErrorBar,\n GridLayout,\n LocalizationProvider,\n MessageStatusIndicator,\n MessageThread,\n MicrophoneButton,\n ParticipantItem,\n ParticipantList,\n ParticipantsButton,\n ScreenShareButton,\n SendBox,\n StreamMedia,\n TypingIndicator,\n VideoGallery,\n VideoTile,\n COMPONENT_LOCALE_EN_GB,\n COMPONENT_LOCALE_AR_SA,\n COMPONENT_LOCALE_CS_CZ,\n COMPONENT_LOCALE_CY_GB,\n COMPONENT_LOCALE_DE_DE,\n COMPONENT_LOCALE_ES_ES,\n COMPONENT_LOCALE_ES_MX,\n COMPONENT_LOCALE_FI_FI,\n COMPONENT_LOCALE_FR_FR,\n COMPONENT_LOCALE_FR_CA,\n COMPONENT_LOCALE_HE_IL,\n COMPONENT_LOCALE_IT_IT,\n COMPONENT_LOCALE_JA_JP,\n COMPONENT_LOCALE_KO_KR,\n COMPONENT_LOCALE_NB_NO,\n COMPONENT_LOCALE_NL_NL,\n COMPONENT_LOCALE_PL_PL,\n COMPONENT_LOCALE_PT_BR,\n COMPONENT_LOCALE_RU_RU,\n COMPONENT_LOCALE_SV_SE,\n COMPONENT_LOCALE_TR_TR,\n COMPONENT_LOCALE_ZH_CN,\n COMPONENT_LOCALE_ZH_TW\n} from '../../react-components/src';\nexport { ImageOverlay } from '../../react-components/src';\nexport { HoldButton } from '../../react-components/src';\n\nexport { RaiseHandButton } from '../../react-components/src';\n\nexport { Dialpad } from '../../react-components/src';\n\nexport { IncomingCallNotification, IncomingCallStack } from '../../react-components/src';\nexport type {\n IncomingCallNotificationProps,\n IncomingCallNotificationStrings,\n IncomingCallNotificationStyles,\n IncomingCallStackProps,\n IncomingCallStackCall\n} from '../../react-components/src';\n\n/* @conditional-compile-remove(call-readiness) */\nexport {\n CameraAndMicrophoneSitePermissions,\n MicrophoneSitePermissions,\n CameraSitePermissions\n} from '../../react-components/src';\n/* @conditional-compile-remove(call-readiness) */\nexport type {\n CameraAndMicrophoneSitePermissionsStrings,\n CameraAndMicrophoneSitePermissionsProps,\n CameraSitePermissionsStrings,\n CameraSitePermissionsProps,\n CommonSitePermissionsProps,\n SitePermissionsStrings,\n SitePermissionsStyles,\n MicrophoneSitePermissionsStrings,\n MicrophoneSitePermissionsProps\n} from '../../react-components/src';\n\n/* @conditional-compile-remove(total-participant-count) */\nexport type { ParticipantListStrings } from '../../react-components/src';\n\n/* @conditional-compile-remove(mention) */\nexport type {\n MentionOptions,\n MentionDisplayOptions,\n MentionLookupOptions,\n Mention,\n MentionPopoverStrings\n} from '../../react-components/src';\n\nexport type {\n _IdentifierProviderProps,\n _Identifiers,\n ActiveErrorMessage,\n BaseCustomStyles,\n CallParticipantListParticipant,\n CameraButtonContextualMenuStyles,\n CameraButtonProps,\n CameraButtonStrings,\n CameraButtonStyles,\n ChatMessage,\n CommunicationParticipant,\n ComponentLocale,\n ComponentSlotStyle,\n ComponentStrings,\n ContentSystemMessage,\n ControlBarButtonProps,\n ControlBarButtonStrings,\n ControlBarButtonStyles,\n ControlBarLayout,\n ControlBarProps,\n CreateVideoStreamViewResult,\n CustomAvatarOptions,\n CustomMessage,\n DevicesButtonContextualMenuStyles,\n DevicesButtonProps,\n DevicesButtonStrings,\n DevicesButtonStyles,\n EndCallButtonProps,\n EndCallButtonStrings,\n ErrorBarProps,\n ErrorBarStrings,\n ErrorType,\n GridLayoutProps,\n GridLayoutStyles,\n HorizontalGalleryStyles,\n JumpToNewMessageButtonProps,\n LocalizationProviderProps,\n LocalVideoCameraCycleButtonProps,\n LoadingState,\n Message,\n MessageAttachedStatus,\n MessageCommon,\n MessageContentType,\n MessageProps,\n MessageRenderer,\n MessageStatusIndicatorProps,\n MessageStatusIndicatorStrings,\n MessageThreadProps,\n MessageThreadStrings,\n MessageThreadStyles,\n MicrophoneButtonContextualMenuStyles,\n MicrophoneButtonProps,\n MicrophoneButtonStrings,\n MicrophoneButtonStyles,\n OnRenderAvatarCallback,\n OptionsDevice,\n ParticipantAddedSystemMessage,\n ParticipantItemProps,\n ParticipantItemStrings,\n ParticipantItemStyles,\n ParticipantListItemStyles,\n ParticipantListParticipant,\n ParticipantListProps,\n ParticipantListStyles,\n ParticipantMenuItemsCallback,\n ParticipantRemovedSystemMessage,\n ParticipantState,\n ParticipantsButtonContextualMenuStyles,\n ParticipantsButtonProps,\n ParticipantsButtonStrings,\n ParticipantsButtonStyles,\n ReadReceiptsBySenderId,\n ScreenShareButtonProps,\n ScreenShareButtonStrings,\n SendBoxProps,\n SendBoxStrings,\n SendBoxStylesProps,\n StreamMediaProps,\n SystemMessage,\n SystemMessageCommon,\n TopicUpdatedSystemMessage,\n TypingIndicatorProps,\n TypingIndicatorStrings,\n TypingIndicatorStylesProps,\n UpdateMessageCallback,\n CancelEditCallback,\n VideoGalleryLayout,\n VideoGalleryLocalParticipant,\n VideoGalleryParticipant,\n VideoGalleryProps,\n VideoGalleryRemoteParticipant,\n VideoGalleryStream,\n VideoGalleryStrings,\n VideoGalleryStyles,\n VideoStreamOptions,\n VideoTileProps,\n VideoTileStylesProps,\n ViewScalingMode,\n VideoTileContextualMenuProps,\n VideoTileDrawerMenuProps,\n VideoTilesOptions\n} from '../../react-components/src';\n\n/* @conditional-compile-remove(together-mode) */\nexport type {\n TogetherModeStreamViewResult,\n VideoGalleryTogetherModeStreams,\n VideoGalleryTogetherModeParticipantPosition,\n VideoGalleryTogetherModeSeatingInfo,\n TogetherModeStreamOptions\n} from '../../react-components/src';\n\nexport type { RaiseHandButtonProps, RaiseHandButtonStrings, RaisedHand } from '../../react-components/src';\nexport type {\n ReactionButtonStrings,\n Reaction,\n ReactionButtonProps,\n ReactionResources,\n ReactionSprite,\n ReactionButtonReaction\n} from '../../react-components/src';\n\nexport { ReactionButton } from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor) */\nexport { RichTextSendBox } from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor) */\nexport type { RichTextSendBoxProps, RichTextSendBoxStrings, RichTextStrings } from '../../react-components/src';\nexport type { Spotlight } from '../../react-components/src';\nexport type { ImageOverlayProps, ImageOverlayStrings } from '../../react-components/src';\n/* @conditional-compile-remove(data-loss-prevention) */\nexport type { BlockedMessage } from '../../react-components/src';\nexport type {\n DialpadMode,\n DialpadProps,\n DialpadStrings,\n DialpadStyles,\n DtmfTone,\n LongPressTrigger\n} from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentOptions } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { SendBoxErrorBarError } from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nexport type { SendBoxErrorBarType } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentActionHandler } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type {\n AttachmentSelectionHandler,\n AttachmentRemovalHandler,\n AttachmentUploadOptions,\n AttachmentUploadTask\n} from '../../react-components/src';\nexport type { AttachmentMetadata } from '../../acs-ui-common/src';\n\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentMetadataInProgress, AttachmentProgressError } from '../../acs-ui-common/src';\n\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentMenuAction, AttachmentDownloadOptions } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport { defaultAttachmentMenuAction } from '../../react-components/src';\nexport type { ChatAttachmentType } from '../../react-components/src';\nexport type { InlineImageOptions, InlineImage } from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor) */\nexport type { RichTextEditorOptions, RichTextEditBoxOptions } from '../../react-components/src';\nexport type { HoldButtonProps, HoldButtonStrings } from '../../react-components/src';\nexport type { VideoTileStrings } from '../../react-components/src';\n/* @conditional-compile-remove(call-readiness) */\nexport type { BrowserPermissionDeniedStrings, BrowserPermissionDeniedProps } from '../../react-components/src';\n/* @conditional-compile-remove(call-readiness) */\nexport type {\n BrowserPermissionDeniedIOSStrings,\n BrowserPermissionDeniedStyles,\n BrowserPermissionDeniedIOSProps\n} from '../../react-components/src';\nexport type { OverflowGalleryPosition } from '../../react-components/src';\nexport type { LocalVideoTileSize } from '../../react-components/src';\nexport * from '../../react-components/src/localization/locales';\nexport * from '../../react-components/src/theming';\nexport * from '../../calling-stateful-client/src/index-public';\nexport type { DeclarativeCallAgent } from '../../calling-stateful-client/src';\nexport { createStatefulChatClient } from '../../chat-stateful-client/src';\nexport type {\n StatefulChatClient,\n StatefulChatClientArgs,\n StatefulChatClientOptions,\n ChatMessageWithStatus,\n ChatClientState,\n ChatError,\n ChatErrors,\n ChatThreadClientState,\n ChatThreadProperties,\n ChatErrorTarget\n} from '../../chat-stateful-client/src';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nexport type { MessagingPolicy } from '../../chat-stateful-client/src';\n\nexport type { ResourceFetchResult } from '../../chat-stateful-client/src';\nexport * from '../../react-composites/src/index-public';\nexport * from './mergedHooks';\n\n/* @conditional-compile-remove(unsupported-browser) */\nexport { UnsupportedBrowser } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport type { UnsupportedBrowserStrings, UnsupportedBrowserProps } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport { UnsupportedBrowserVersion } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport type { UnsupportedBrowserVersionStrings, UnsupportedBrowserVersionProps } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport { UnsupportedOperatingSystem } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport type { UnsupportedOperatingSystemStrings, UnsupportedOperatingSystemProps } from '../../react-components/src';\nexport type {\n VerticalGalleryStyles,\n VerticalGalleryStrings,\n VerticalGalleryControlBarStyles\n} from '../../react-components/src';\n\nexport type { SpokenLanguageStrings, CaptionLanguageStrings } from '../../react-components/src';\n\nexport type { SurveyIssues } from '../../react-components/src';\n\nexport type { SurveyIssuesHeadingStrings } from '../../react-components/src';\n\nexport type { CallSurveyImprovementSuggestions } from '../../react-components/src';\n\nexport { NotificationStack, Notification } from '../../react-components/src';\n\nexport type {\n NotificationStackProps,\n NotificationProps,\n NotificationStrings,\n NotificationStackStrings,\n NotificationType,\n ActiveNotification,\n NotificationStyles\n} from '../../react-components/src';\nexport type { MeetingConferencePhoneInfoModalStrings } from '../../react-components/src';\n/* @conditional-compile-remove(rtt) */\nexport type { RTTModalStrings, RTTModalProps } from '../../react-components/src';\n/* @conditional-compile-remove(rtt) */\nexport { RTTModal } from '../../react-components/src';\n\n/* @conditional-compile-remove(rtt) */\nexport type { RTTDisclosureBannerProps, RTTDisclosureBannerStrings } from '../../react-components/src';\n/* @conditional-compile-remove(rtt) */\nexport { RTTDisclosureBanner } from '../../react-components/src';\n/* @conditional-compile-remove(rtt) */\nexport type { RealTimeTextProps, RealTimeTextStrings } from '../../react-components/src/components/RealTimeText';\n/* @conditional-compile-remove(rtt) */\nexport { RealTimeText } from '../../react-components/src/components/RealTimeText';\n/* @conditional-compile-remove(media-access) */\nexport type { MediaAccess } from '../../react-components/src';\nexport type {\n CaptionsBannerProps,\n CaptionsInformation,\n CaptionsBannerStrings\n} from '../../react-components/src/components/CaptionsBanner';\nexport { CaptionsBanner } from '../../react-components/src/components/CaptionsBanner';\n"]}
@@ -1,11 +1,18 @@
1
- import type { PluginEvent, EditorPlugin } from 'roosterjs-content-model-types';
1
+ import type { PluginEvent, EditorPlugin, IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * KeyboardInputPlugin is a plugin for handling keyboard events in the editor.
4
4
  */
5
5
  export declare class KeyboardInputPlugin implements EditorPlugin {
6
+ private editor;
7
+ private disposer;
6
8
  onKeyDown?: ((event: KeyboardEvent) => void) | null;
9
+ onCompositionUpdate?: (() => void) | null;
7
10
  getName(): string;
8
- initialize(): void;
11
+ /**
12
+ * Initialize this plugin
13
+ * @param editor The editor instance
14
+ */
15
+ initialize(editor: IEditor): void;
9
16
  dispose(): void;
10
17
  onPluginEvent(event: PluginEvent): void;
11
18
  }
@@ -6,14 +6,32 @@ import { PluginEventType } from '../../utils/RichTextEditorUtils';
6
6
  */
7
7
  export class KeyboardInputPlugin {
8
8
  constructor() {
9
+ this.editor = null;
10
+ this.disposer = null;
9
11
  // don't set callback in constructor to be able to update callback without plugin recreation
10
12
  this.onKeyDown = null;
13
+ this.onCompositionUpdate = null;
11
14
  }
12
15
  getName() {
13
16
  return 'KeyboardInputPlugin';
14
17
  }
15
- initialize() { }
16
- dispose() { }
18
+ /**
19
+ * Initialize this plugin
20
+ * @param editor The editor instance
21
+ */
22
+ initialize(editor) {
23
+ this.editor = editor;
24
+ this.disposer = this.editor.attachDomEvent({
25
+ compositionupdate: { beforeDispatch: this.onCompositionUpdate }
26
+ });
27
+ }
28
+ dispose() {
29
+ this.editor = null;
30
+ if (this.disposer) {
31
+ this.disposer();
32
+ this.disposer = null;
33
+ }
34
+ }
17
35
  onPluginEvent(event) {
18
36
  if (this.onKeyDown && event.eventType === PluginEventType.KeyDown && event.rawEvent instanceof KeyboardEvent) {
19
37
  this.onKeyDown(event.rawEvent);
@@ -1 +1 @@
1
- {"version":3,"file":"KeyboardInputPlugin.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAAhC;QACE,4FAA4F;QAC5F,cAAS,GAA6C,IAAI,CAAC;IAe7D,CAAC;IAbC,OAAO;QACL,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IAED,UAAU,KAAU,CAAC;IAErB,OAAO,KAAU,CAAC;IAElB,aAAa,CAAC,KAAkB;QAC9B,IAAI,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,KAAK,eAAe,CAAC,OAAO,IAAI,KAAK,CAAC,QAAQ,YAAY,aAAa,EAAE,CAAC;YAC7G,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { PluginEvent, EditorPlugin } from 'roosterjs-content-model-types';\nimport { PluginEventType } from '../../utils/RichTextEditorUtils';\n\n/**\n * KeyboardInputPlugin is a plugin for handling keyboard events in the editor.\n */\nexport class KeyboardInputPlugin implements EditorPlugin {\n // don't set callback in constructor to be able to update callback without plugin recreation\n onKeyDown?: ((event: KeyboardEvent) => void) | null = null;\n\n getName(): string {\n return 'KeyboardInputPlugin';\n }\n\n initialize(): void {}\n\n dispose(): void {}\n\n onPluginEvent(event: PluginEvent): void {\n if (this.onKeyDown && event.eventType === PluginEventType.KeyDown && event.rawEvent instanceof KeyboardEvent) {\n this.onKeyDown(event.rawEvent);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"KeyboardInputPlugin.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAAhC;QACU,WAAM,GAAmB,IAAI,CAAC;QAC9B,aAAQ,GAAwB,IAAI,CAAC;QAC7C,4FAA4F;QAC5F,cAAS,GAA6C,IAAI,CAAC;QAC3D,wBAAmB,GAAyB,IAAI,CAAC;IA8BnD,CAAC;IA5BC,OAAO;QACL,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IACD;;;OAGG;IACH,UAAU,CAAC,MAAe;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;YACzC,iBAAiB,EAAE,EAAE,cAAc,EAAE,IAAI,CAAC,mBAAmB,EAAE;SAChE,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QAEnB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,QAAQ,EAAE,CAAC;YAChB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACvB,CAAC;IACH,CAAC;IAED,aAAa,CAAC,KAAkB;QAC9B,IAAI,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,KAAK,eAAe,CAAC,OAAO,IAAI,KAAK,CAAC,QAAQ,YAAY,aAAa,EAAE,CAAC;YAC7G,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { PluginEvent, EditorPlugin, IEditor } from 'roosterjs-content-model-types';\nimport { PluginEventType } from '../../utils/RichTextEditorUtils';\n\n/**\n * KeyboardInputPlugin is a plugin for handling keyboard events in the editor.\n */\nexport class KeyboardInputPlugin implements EditorPlugin {\n private editor: IEditor | null = null;\n private disposer: (() => void) | null = null;\n // don't set callback in constructor to be able to update callback without plugin recreation\n onKeyDown?: ((event: KeyboardEvent) => void) | null = null;\n onCompositionUpdate?: (() => void) | null = null;\n\n getName(): string {\n return 'KeyboardInputPlugin';\n }\n /**\n * Initialize this plugin\n * @param editor The editor instance\n */\n initialize(editor: IEditor): void {\n this.editor = editor;\n this.disposer = this.editor.attachDomEvent({\n compositionupdate: { beforeDispatch: this.onCompositionUpdate }\n });\n }\n\n dispose(): void {\n this.editor = null;\n\n if (this.disposer) {\n this.disposer();\n this.disposer = null;\n }\n }\n\n onPluginEvent(event: PluginEvent): void {\n if (this.onKeyDown && event.eventType === PluginEventType.KeyDown && event.rawEvent instanceof KeyboardEvent) {\n this.onKeyDown(event.rawEvent);\n }\n }\n}\n"]}
@@ -6,10 +6,12 @@ import type { IEditor } from 'roosterjs-content-model-types';
6
6
  export declare class PlaceholderPlugin extends WatermarkPlugin {
7
7
  private isPlaceholderShown;
8
8
  private editorValue;
9
+ private disposer;
9
10
  updatePlaceholder(placeholder: string): void;
10
11
  initialize(editor: IEditor): void;
11
12
  dispose(): void;
12
13
  protected show(editor: IEditor): void;
13
14
  protected hide(editor: IEditor): void;
15
+ private onCompositionStart;
14
16
  }
15
17
  //# sourceMappingURL=PlaceholderPlugin.d.ts.map
@@ -9,6 +9,13 @@ export class PlaceholderPlugin extends WatermarkPlugin {
9
9
  super(...arguments);
10
10
  this.isPlaceholderShown = false;
11
11
  this.editorValue = null;
12
+ this.disposer = null;
13
+ this.onCompositionStart = () => {
14
+ if (this.editorValue && this.isPlaceholderShown) {
15
+ // Hide the placeholder when composition starts
16
+ this.hide(this.editorValue);
17
+ }
18
+ };
12
19
  }
13
20
  updatePlaceholder(placeholder) {
14
21
  this.watermark = placeholder;
@@ -25,9 +32,16 @@ export class PlaceholderPlugin extends WatermarkPlugin {
25
32
  // Hide/show the placeholder as workaround for the placeholder not hiding in some cases
26
33
  this.hide(this.editorValue);
27
34
  this.show(this.editorValue);
35
+ this.disposer = this.editorValue.attachDomEvent({
36
+ compositionstart: { beforeDispatch: this.onCompositionStart }
37
+ });
28
38
  }
29
39
  dispose() {
30
40
  this.editorValue = null;
41
+ if (this.disposer) {
42
+ this.disposer();
43
+ this.disposer = null;
44
+ }
31
45
  super.dispose();
32
46
  }
33
47
  show(editor) {
@@ -1 +1 @@
1
- {"version":3,"file":"PlaceholderPlugin.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGlE;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,eAAe;IAAtD;;QACU,uBAAkB,GAAY,KAAK,CAAC;QACpC,gBAAW,GAAmB,IAAI,CAAC;IA+B7C,CAAC;IA7BC,iBAAiB,CAAC,WAAmB;QACnC,IAAI,CAAC,SAAS,GAAG,WAAW,CAAC;QAC7B,uDAAuD;QACvD,mEAAmE;QACnE,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAChD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAC5B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;IACD,UAAU,CAAC,MAAe;QACxB,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;QAC1B,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAEzB,uFAAuF;QACvF,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC5B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO;QACL,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC;IACS,IAAI,CAAC,MAAe;QAC5B,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnB,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;IACjC,CAAC;IACS,IAAI,CAAC,MAAe;QAC5B,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnB,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;IAClC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { WatermarkPlugin } from 'roosterjs-content-model-plugins';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * PlaceholderPlugin is a plugin for displaying placeholder and handle localization for it in the editor.\n */\nexport class PlaceholderPlugin extends WatermarkPlugin {\n private isPlaceholderShown: boolean = false;\n private editorValue: IEditor | null = null;\n\n updatePlaceholder(placeholder: string): void {\n this.watermark = placeholder;\n // hide and show the placeholder to show the latest one\n // this needs to be done only if the placeholder is currently shown\n if (this.editorValue && this.isPlaceholderShown) {\n this.hide(this.editorValue);\n this.show(this.editorValue);\n }\n }\n initialize(editor: IEditor): void {\n this.editorValue = editor;\n super.initialize(editor);\n\n // Hide/show the placeholder as workaround for the placeholder not hiding in some cases\n this.hide(this.editorValue);\n this.show(this.editorValue);\n }\n dispose(): void {\n this.editorValue = null;\n super.dispose();\n }\n protected show(editor: IEditor): void {\n super.show(editor);\n this.isPlaceholderShown = true;\n }\n protected hide(editor: IEditor): void {\n super.hide(editor);\n this.isPlaceholderShown = false;\n }\n}\n"]}
1
+ {"version":3,"file":"PlaceholderPlugin.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGlE;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,eAAe;IAAtD;;QACU,uBAAkB,GAAY,KAAK,CAAC;QACpC,gBAAW,GAAmB,IAAI,CAAC;QACnC,aAAQ,GAAwB,IAAI,CAAC;QA0CrC,uBAAkB,GAAG,GAAS,EAAE;YACtC,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;gBAChD,+CAA+C;gBAC/C,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC,CAAC;IACJ,CAAC;IA9CC,iBAAiB,CAAC,WAAmB;QACnC,IAAI,CAAC,SAAS,GAAG,WAAW,CAAC;QAC7B,uDAAuD;QACvD,mEAAmE;QACnE,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAChD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAC5B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;IACD,UAAU,CAAC,MAAe;QACxB,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;QAC1B,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAEzB,uFAAuF;QACvF,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC5B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAE5B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC;YAC9C,gBAAgB,EAAE,EAAE,cAAc,EAAE,IAAI,CAAC,kBAAkB,EAAE;SAC9D,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,QAAQ,EAAE,CAAC;YAChB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACvB,CAAC;QACD,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC;IAES,IAAI,CAAC,MAAe;QAC5B,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnB,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;IACjC,CAAC;IACS,IAAI,CAAC,MAAe;QAC5B,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnB,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;IAClC,CAAC;CAQF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { WatermarkPlugin } from 'roosterjs-content-model-plugins';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * PlaceholderPlugin is a plugin for displaying placeholder and handle localization for it in the editor.\n */\nexport class PlaceholderPlugin extends WatermarkPlugin {\n private isPlaceholderShown: boolean = false;\n private editorValue: IEditor | null = null;\n private disposer: (() => void) | null = null;\n\n updatePlaceholder(placeholder: string): void {\n this.watermark = placeholder;\n // hide and show the placeholder to show the latest one\n // this needs to be done only if the placeholder is currently shown\n if (this.editorValue && this.isPlaceholderShown) {\n this.hide(this.editorValue);\n this.show(this.editorValue);\n }\n }\n initialize(editor: IEditor): void {\n this.editorValue = editor;\n super.initialize(editor);\n\n // Hide/show the placeholder as workaround for the placeholder not hiding in some cases\n this.hide(this.editorValue);\n this.show(this.editorValue);\n\n this.disposer = this.editorValue.attachDomEvent({\n compositionstart: { beforeDispatch: this.onCompositionStart }\n });\n }\n\n dispose(): void {\n this.editorValue = null;\n if (this.disposer) {\n this.disposer();\n this.disposer = null;\n }\n super.dispose();\n }\n\n protected show(editor: IEditor): void {\n super.show(editor);\n this.isPlaceholderShown = true;\n }\n protected hide(editor: IEditor): void {\n super.hide(editor);\n this.isPlaceholderShown = false;\n }\n\n private onCompositionStart = (): void => {\n if (this.editorValue && this.isPlaceholderShown) {\n // Hide the placeholder when composition starts\n this.hide(this.editorValue);\n }\n };\n}\n"]}
@@ -24,6 +24,7 @@ export declare class UpdateContentPlugin implements EditorPlugin {
24
24
  initialize(editor: IEditor): void;
25
25
  dispose(): void;
26
26
  onPluginEvent(event: PluginEvent): void;
27
+ private onCompositionUpdate;
27
28
  private onBlur;
28
29
  }
29
30
  //# sourceMappingURL=UpdateContentPlugin.d.ts.map
@@ -27,6 +27,12 @@ export class UpdateContentPlugin {
27
27
  this.disposer = null;
28
28
  // don't set callback in constructor to be able to update callback without plugin recreation
29
29
  this.onUpdate = null;
30
+ this.onCompositionUpdate = () => {
31
+ if (this.onUpdate === null) {
32
+ return;
33
+ }
34
+ this.onUpdate(UpdateEvent.ContentChanged);
35
+ };
30
36
  this.onBlur = () => {
31
37
  if (this.onUpdate === null) {
32
38
  return;
@@ -44,7 +50,8 @@ export class UpdateContentPlugin {
44
50
  initialize(editor) {
45
51
  this.editor = editor;
46
52
  this.disposer = this.editor.attachDomEvent({
47
- blur: { beforeDispatch: this.onBlur }
53
+ blur: { beforeDispatch: this.onBlur },
54
+ compositionupdate: { beforeDispatch: this.onCompositionUpdate }
48
55
  });
49
56
  }
50
57
  dispose() {
@@ -65,6 +72,9 @@ export class UpdateContentPlugin {
65
72
  case PluginEventType.BeforeDispose:
66
73
  this.onUpdate(UpdateEvent.Dispose);
67
74
  break;
75
+ case PluginEventType.CompositionEnd:
76
+ this.onUpdate(UpdateEvent.ContentChanged);
77
+ break;
68
78
  case PluginEventType.ContentChanged:
69
79
  if (event.source === ChangeSource.Cut ||
70
80
  // We need to add the paste source here for an edge case:
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateContentPlugin.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D;;GAEG;AACH,MAAM,CAAN,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,kCAAmB,CAAA;IACnB,gDAAiC,CAAA;IACjC,sCAAuB,CAAA;IACvB,4BAAa,CAAA;AACf,CAAC,EANW,WAAW,KAAX,WAAW,QAMtB;AAED,IAAW,IAGV;AAHD,WAAW,IAAI;IACb,yCAAa,CAAA;IACb,oCAAW,CAAA;AACb,CAAC,EAHU,IAAI,KAAJ,IAAI,QAGd;AAED;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAAhC;QACU,WAAM,GAAmB,IAAI,CAAC;QAC9B,aAAQ,GAAwB,IAAI,CAAC;QAC7C,4FAA4F;QAC5F,aAAQ,GAA8E,IAAI,CAAC;QA6DnF,WAAM,GAAG,GAAS,EAAE;YAC1B,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;gBAC3B,OAAO;YACT,CAAC;YACD,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC,CAAC;IACJ,CAAC;IAjEC,OAAO;QACL,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACH,UAAU,CAAC,MAAe;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;YACzC,IAAI,E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CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;gBACrC,MAAM;QACV,CAAC;IACH,CAAC;CAQF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { EditorPlugin, IEditor, PluginEvent } from 'roosterjs-content-model-types';\nimport { PluginEventType } from '../../utils/RichTextEditorUtils';\nimport { ChangeSource } from 'roosterjs-content-model-dom';\n\n/**\n * An update mode to indicate when the content update happens\n */\nexport enum UpdateEvent {\n Init = 'Init',\n Dispose = 'Dispose',\n ContentChanged = 'ContentChanged',\n UserInput = 'UserInput',\n Blur = 'Blur'\n}\n\nconst enum Keys {\n BACKSPACE = 8,\n DELETE = 46\n}\n\n/**\n * A plugin to handle content update\n */\nexport class UpdateContentPlugin implements EditorPlugin {\n private editor: IEditor | null = null;\n private disposer: (() => void) | null = null;\n // don't set callback in constructor to be able to update callback without plugin recreation\n onUpdate: ((event: UpdateEvent, shouldRemoveInlineImages?: boolean) => void) | null = null;\n\n getName(): string {\n return 'UpdateContentPlugin';\n }\n\n /**\n * Initialize this plugin\n * @param editor The editor instance\n */\n initialize(editor: IEditor): void {\n this.editor = editor;\n this.disposer = this.editor.attachDomEvent({\n blur: { beforeDispatch: this.onBlur }\n });\n }\n\n dispose(): void {\n this.editor = null;\n\n if (this.disposer) {\n this.disposer();\n this.disposer = null;\n }\n }\n\n onPluginEvent(event: PluginEvent): void {\n if (this.onUpdate === null) {\n return;\n }\n\n switch (event.eventType) {\n case PluginEventType.EditorReady:\n this.onUpdate(UpdateEvent.Init);\n break;\n\n case PluginEventType.BeforeDispose:\n this.onUpdate(UpdateEvent.Dispose);\n break;\n\n case PluginEventType.ContentChanged:\n if (\n event.source === ChangeSource.Cut ||\n // We need to add the paste source here for an edge case:\n // when user select an image that's already in the editor, then paste in an image to replace the selected one,\n // we will only get a paste event.\n // In this case, we need to update the removedInlineImage array to include the replaced image.\n event.source === ChangeSource.Paste ||\n (event.source === ChangeSource.Keyboard && (event.data === Keys.BACKSPACE || event.data === Keys.DELETE))\n ) {\n this.onUpdate(UpdateEvent.ContentChanged, true);\n }\n this.onUpdate(UpdateEvent.ContentChanged);\n break;\n\n case PluginEventType.Input:\n this.onUpdate(UpdateEvent.UserInput);\n break;\n }\n }\n\n private onBlur = (): void => {\n if (this.onUpdate === null) {\n return;\n }\n this.onUpdate(UpdateEvent.Blur);\n };\n}\n"]}
1
+ {"version":3,"file":"UpdateContentPlugin.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D;;GAEG;AACH,MAAM,CAAN,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,kCAAmB,CAAA;IACnB,gDAAiC,CAAA;IACjC,sCAAuB,CAAA;IACvB,4BAAa,CAAA;AACf,CAAC,EANW,WAAW,KAAX,WAAW,QAMtB;AAED,IAAW,IAGV;AAHD,WAAW,IAAI;IACb,yCAAa,CAAA;IACb,oCAAW,CAAA;AACb,CAAC,EAHU,IAAI,KAAJ,IAAI,QAGd;AAED;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAAhC;QACU,WAAM,GAAmB,IAAI,CAAC;QAC9B,aAAQ,GAAwB,IAAI,CAAC;QAC7C,4FAA4F;QAC5F,aAAQ,GAA8E,IAAI,CAAC;QAiEnF,wBAAmB,GAAG,GAAS,EAAE;YACvC,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;gBAC3B,OAAO;YACT,CAAC;YACD,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;QAC5C,CAAC,CAAC;QAEM,WAAM,GAAG,GAAS,EAAE;YAC1B,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,EAAE,C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D;oBACzD,8GAA8G;oBAC9G,kCAAkC;oBAClC,8FAA8F;oBAC9F,KAAK,CAAC,MAAM,KAAK,YAAY,CAAC,KAAK;oBACnC,CAAC,KAAK,CAAC,MAAM,KAAK,YAAY,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC,EACzG,CAAC;oBACD,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;gBAClD,CAAC;gBACD,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;gBAC1C,MAAM;YAER,KAAK,eAAe,CAAC,KAAK;gBACxB,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;gBACrC,MAAM;QACV,CAAC;IACH,CAAC;CAeF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { EditorPlugin, IEditor, PluginEvent } from 'roosterjs-content-model-types';\nimport { PluginEventType } from '../../utils/RichTextEditorUtils';\nimport { ChangeSource } from 'roosterjs-content-model-dom';\n\n/**\n * An update mode to indicate when the content update happens\n */\nexport enum UpdateEvent {\n Init = 'Init',\n Dispose = 'Dispose',\n ContentChanged = 'ContentChanged',\n UserInput = 'UserInput',\n Blur = 'Blur'\n}\n\nconst enum Keys {\n BACKSPACE = 8,\n DELETE = 46\n}\n\n/**\n * A plugin to handle content update\n */\nexport class UpdateContentPlugin implements EditorPlugin {\n private editor: IEditor | null = null;\n private disposer: (() => void) | null = null;\n // don't set callback in constructor to be able to update callback without plugin recreation\n onUpdate: ((event: UpdateEvent, shouldRemoveInlineImages?: boolean) => void) | null = null;\n\n getName(): string {\n return 'UpdateContentPlugin';\n }\n\n /**\n * Initialize this plugin\n * @param editor The editor instance\n */\n initialize(editor: IEditor): void {\n this.editor = editor;\n this.disposer = this.editor.attachDomEvent({\n blur: { beforeDispatch: this.onBlur },\n compositionupdate: { beforeDispatch: this.onCompositionUpdate }\n });\n }\n\n dispose(): void {\n this.editor = null;\n\n if (this.disposer) {\n this.disposer();\n this.disposer = null;\n }\n }\n\n onPluginEvent(event: PluginEvent): void {\n if (this.onUpdate === null) {\n return;\n }\n switch (event.eventType) {\n case PluginEventType.EditorReady:\n this.onUpdate(UpdateEvent.Init);\n break;\n\n case PluginEventType.BeforeDispose:\n this.onUpdate(UpdateEvent.Dispose);\n break;\n\n case PluginEventType.CompositionEnd:\n this.onUpdate(UpdateEvent.ContentChanged);\n break;\n\n case PluginEventType.ContentChanged:\n if (\n event.source === ChangeSource.Cut ||\n // We need to add the paste source here for an edge case:\n // when user select an image that's already in the editor, then paste in an image to replace the selected one,\n // we will only get a paste event.\n // In this case, we need to update the removedInlineImage array to include the replaced image.\n event.source === ChangeSource.Paste ||\n (event.source === ChangeSource.Keyboard && (event.data === Keys.BACKSPACE || event.data === Keys.DELETE))\n ) {\n this.onUpdate(UpdateEvent.ContentChanged, true);\n }\n this.onUpdate(UpdateEvent.ContentChanged);\n break;\n\n case PluginEventType.Input:\n this.onUpdate(UpdateEvent.UserInput);\n break;\n }\n }\n\n private onCompositionUpdate = (): void => {\n if (this.onUpdate === null) {\n return;\n }\n this.onUpdate(UpdateEvent.ContentChanged);\n };\n\n private onBlur = (): void => {\n if (this.onUpdate === null) {\n return;\n }\n this.onUpdate(UpdateEvent.Blur);\n };\n}\n"]}
@@ -19,6 +19,7 @@ export interface RichTextEditorProps {
19
19
  initialContent?: string;
20
20
  onChange: (newValue?: string, removedInlineImages?: Record<string, string>[]) => void;
21
21
  onKeyDown?: (ev: KeyboardEvent) => void;
22
+ onCompositionUpdate?: () => void;
22
23
  onContentModelUpdate?: (contentModel: ContentModelDocument | undefined) => void;
23
24
  contentModel?: ContentModelDocument | undefined;
24
25
  placeholderText?: string;
@@ -27,7 +27,7 @@ import UndoRedoPlugin from './Plugins/UndoRedoPlugin';
27
27
  * @beta
28
28
  */
29
29
  export const RichTextEditor = React.forwardRef((props, ref) => {
30
- const { initialContent, onChange, placeholderText, strings, showRichTextEditorFormatting, autoFocus, onKeyDown, onContentModelUpdate, contentModel,
30
+ const { initialContent, onChange, placeholderText, strings, showRichTextEditorFormatting, autoFocus, onKeyDown, onCompositionUpdate, onContentModelUpdate, contentModel,
31
31
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
32
32
  onPaste,
33
33
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
@@ -210,6 +210,10 @@ export const RichTextEditor = React.forwardRef((props, ref) => {
210
210
  // don't set callback in plugin constructor to update callback without plugin recreation
211
211
  keyboardInputPlugin.onKeyDown = onKeyDown;
212
212
  }, [keyboardInputPlugin, onKeyDown]);
213
+ useEffect(() => {
214
+ // don't set callback in plugin constructor to update callback without plugin recreation
215
+ keyboardInputPlugin.onCompositionUpdate = onCompositionUpdate;
216
+ }, [keyboardInputPlugin, onCompositionUpdate]);
213
217
  const tableContextMenuPlugin = useMemo(() => {
214
218
  return new TableEditContextMenuProvider();
215
219
  }, []);