@cloudflare/realtimekit-react-native 0.1.4-staging.8 → 0.2.0-staging.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/ReactHooks.js.map +1 -1
- package/lib/commonjs/utils/version.js +1 -1
- package/lib/commonjs/utils/version.js.map +1 -1
- package/lib/module/ReactHooks.js.map +1 -1
- package/lib/module/utils/version.js +1 -1
- package/lib/module/utils/version.js.map +1 -1
- package/lib/typescript/ReactHooks.d.ts +2 -2
- package/lib/typescript/utils/version.d.ts +1 -1
- package/package.json +1 -1
- package/plugin/build/withRTK.js +17 -0
- package/plugin/src/withRTK.ts +21 -0
- package/lib/commonjs/utils/constants.js +0 -7
- package/lib/commonjs/utils/constants.js.map +0 -1
- package/lib/module/utils/constants.js +0 -5
- package/lib/module/utils/constants.js.map +0 -1
- package/lib/typescript/utils/constants.d.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_realtimekit","_interopRequireDefault","_ReactContext","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","e","__esModule","default","useRealtimeKitClient","client","setClient","useState","initClient","options","cli","RealtimeKitClient","init","shouldUpdate","slice","newSlice","Array","isArray","length","useRTKSelector","selector","useRealtimeKitSelector","meeting","updates","useContext","RealtimeKitContext","Error","state","useRef","forceUpdate","useReducer","c","useEffect","currentState","listener","newStateSlice","current","addListener","removeListener"],"sources":["ReactHooks.tsx"],"sourcesContent":["import { useState, useEffect, useRef, useReducer, useContext } from 'react';\nimport RealtimeKitClient from '@cloudflare/realtimekit';\nimport { RealtimeKitContext } from './ReactContext';\n\n/**\n * Hook which manages a RealtimeKitClient instance\n */\nexport const useRealtimeKitClient = (): [\n RealtimeKitClient | undefined,\n (options:
|
|
1
|
+
{"version":3,"names":["_react","require","_realtimekit","_interopRequireDefault","_ReactContext","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","e","__esModule","default","useRealtimeKitClient","client","setClient","useState","initClient","options","cli","RealtimeKitClient","init","shouldUpdate","slice","newSlice","Array","isArray","length","useRTKSelector","selector","useRealtimeKitSelector","meeting","updates","useContext","RealtimeKitContext","Error","state","useRef","forceUpdate","useReducer","c","useEffect","currentState","listener","newStateSlice","current","addListener","removeListener"],"sources":["ReactHooks.tsx"],"sourcesContent":["import { useState, useEffect, useRef, useReducer, useContext } from 'react';\nimport RealtimeKitClient, {\n RealtimeKitClientOptions,\n} from '@cloudflare/realtimekit';\nimport { RealtimeKitContext } from './ReactContext';\n\n/**\n * Hook which manages a RealtimeKitClient instance\n */\nexport const useRealtimeKitClient = (): [\n RealtimeKitClient | undefined,\n (options: RealtimeKitClientOptions) => {}\n] => {\n const [client, setClient] = useState<RealtimeKitClient>();\n const initClient = async (\n options: RealtimeKitClientOptions\n ): Promise<RealtimeKitClient> => {\n const cli = await RealtimeKitClient.init(options);\n setClient(cli);\n return cli;\n };\n return [client, initClient];\n};\n\n/**\n * Utility function which determines whether to trigger update or not\n */\nconst shouldUpdate = <StateSlice,>(\n slice: StateSlice,\n newSlice: StateSlice\n): boolean => {\n if (slice !== newSlice) {\n return true;\n }\n if (Array.isArray(slice) && Array.isArray(newSlice)) {\n if (slice.length !== newSlice.length) {\n return true;\n }\n }\n\n return false;\n};\n\ntype StateSelector<T extends object, U> = (state: T) => U;\n\n/**\n * @deprecated Use `useRealtimeKitSelector` instead.\n * Hook which extracts data from the RealtimeKitClient object\n */\nexport const useRTKSelector = <StateSlice,>(\n selector: StateSelector<RealtimeKitClient, StateSlice>\n) => {\n return useRealtimeKitSelector(selector);\n};\n\n/**\n * Hook which extracts data from the RealtimeKitClient object\n */\nexport const useRealtimeKitSelector = <StateSlice,>(\n selector: StateSelector<RealtimeKitClient, StateSlice>\n) => {\n const { meeting, updates } = useContext(RealtimeKitContext);\n if (!meeting)\n throw new Error(\n 'useRealtimeKitSelector must be used within the RealtimeKitProvider'\n );\n const state = useRef(selector(meeting));\n const [, forceUpdate] = useReducer((c) => c + 1, 0) as [never, () => void];\n\n useEffect(() => {\n const currentState = meeting && selector(meeting);\n const listener = () => {\n const newStateSlice = meeting && selector(meeting);\n if (shouldUpdate(state.current, newStateSlice)) {\n state.current = newStateSlice;\n forceUpdate();\n }\n };\n if (\n currentState &&\n typeof currentState === 'object' &&\n 'addListener' in currentState\n ) {\n (currentState as any).addListener('*', forceUpdate);\n return () => {\n (currentState as any).removeListener('*', forceUpdate);\n };\n }\n updates?.addListener(listener);\n return () => {\n updates?.removeListener(listener);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [meeting, updates]);\n return state.current;\n};\n\nexport * from './ReactContext';\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,aAAA,GAAAH,OAAA;AA6FAI,MAAA,CAAAC,IAAA,CAAAF,aAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,aAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,aAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAA+B,SAAAL,uBAAAc,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AA3F/B;AACA;AACA;AACO,MAAMG,oBAAoB,GAAGA,CAAA,KAG/B;EACH,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAG,IAAAC,eAAQ,EAAoB,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AAGX,OAAO,IAAIF,QAAQ,CAACE,OAAO,CAAC;IACjD,MAAMY,QAAQ,GAAGA,CAAA,KAAM;MACrB,MAAMC,aAAa,GAAGb,OAAO,IAAIF,QAAQ,CAACE,OAAO,CAAC;MAClD,IAAIT,YAAY,CAACc,KAAK,CAACS,OAAO,EAAED,aAAa,CAAC,EAAE;QAC9CR,KAAK,CAACS,OAAO,GAAGD,aAAa;QAC7BN,WAAW,CAAC,CAAC;MACf;IACF,CAAC;IACD,IACEI,YAAY,IACZ,OAAOA,YAAY,KAAK,QAAQ,IAChC,aAAa,IAAIA,YAAY,EAC7B;MACCA,YAAY,CAASI,WAAW,CAAC,GAAG,EAAER,WAAW,CAAC;MACnD,OAAO,MAAM;QACVI,YAAY,CAASK,cAAc,CAAC,GAAG,EAAET,WAAW,CAAC;MACxD,CAAC;IACH;IACAN,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEc,WAAW,CAACH,QAAQ,CAAC;IAC9B,OAAO,MAAM;MACXX,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEe,cAAc,CAACJ,QAAQ,CAAC;IACnC,CAAC;IACD;EACF,CAAC,EAAE,CAACZ,OAAO,EAAEC,OAAO,CAAC,CAAC;EACtB,OAAOI,KAAK,CAACS,OAAO;AACtB,CAAC;AAACvC,OAAA,CAAAwB,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SDK_VERSION","exports"],"sources":["version.ts"],"sourcesContent":["export const SDK_VERSION = '0.
|
|
1
|
+
{"version":3,"names":["SDK_VERSION","exports"],"sources":["version.ts"],"sourcesContent":["export const SDK_VERSION = '0.2.0-staging.1';\n"],"mappings":";;;;;;AAAO,MAAMA,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,iBAAiB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useState","useEffect","useRef","useReducer","useContext","RealtimeKitClient","RealtimeKitContext","useRealtimeKitClient","client","setClient","initClient","options","cli","init","shouldUpdate","slice","newSlice","Array","isArray","length","useRTKSelector","selector","useRealtimeKitSelector","meeting","updates","Error","state","forceUpdate","c","currentState","listener","newStateSlice","current","addListener","removeListener"],"sources":["ReactHooks.tsx"],"sourcesContent":["import { useState, useEffect, useRef, useReducer, useContext } from 'react';\nimport RealtimeKitClient from '@cloudflare/realtimekit';\nimport { RealtimeKitContext } from './ReactContext';\n\n/**\n * Hook which manages a RealtimeKitClient instance\n */\nexport const useRealtimeKitClient = (): [\n RealtimeKitClient | undefined,\n (options:
|
|
1
|
+
{"version":3,"names":["useState","useEffect","useRef","useReducer","useContext","RealtimeKitClient","RealtimeKitContext","useRealtimeKitClient","client","setClient","initClient","options","cli","init","shouldUpdate","slice","newSlice","Array","isArray","length","useRTKSelector","selector","useRealtimeKitSelector","meeting","updates","Error","state","forceUpdate","c","currentState","listener","newStateSlice","current","addListener","removeListener"],"sources":["ReactHooks.tsx"],"sourcesContent":["import { useState, useEffect, useRef, useReducer, useContext } from 'react';\nimport RealtimeKitClient, {\n RealtimeKitClientOptions,\n} from '@cloudflare/realtimekit';\nimport { RealtimeKitContext } from './ReactContext';\n\n/**\n * Hook which manages a RealtimeKitClient instance\n */\nexport const useRealtimeKitClient = (): [\n RealtimeKitClient | undefined,\n (options: RealtimeKitClientOptions) => {}\n] => {\n const [client, setClient] = useState<RealtimeKitClient>();\n const initClient = async (\n options: RealtimeKitClientOptions\n ): Promise<RealtimeKitClient> => {\n const cli = await RealtimeKitClient.init(options);\n setClient(cli);\n return cli;\n };\n return [client, initClient];\n};\n\n/**\n * Utility function which determines whether to trigger update or not\n */\nconst shouldUpdate = <StateSlice,>(\n slice: StateSlice,\n newSlice: StateSlice\n): boolean => {\n if (slice !== newSlice) {\n return true;\n }\n if (Array.isArray(slice) && Array.isArray(newSlice)) {\n if (slice.length !== newSlice.length) {\n return true;\n }\n }\n\n return false;\n};\n\ntype StateSelector<T extends object, U> = (state: T) => U;\n\n/**\n * @deprecated Use `useRealtimeKitSelector` instead.\n * Hook which extracts data from the RealtimeKitClient object\n */\nexport const useRTKSelector = <StateSlice,>(\n selector: StateSelector<RealtimeKitClient, StateSlice>\n) => {\n return useRealtimeKitSelector(selector);\n};\n\n/**\n * Hook which extracts data from the RealtimeKitClient object\n */\nexport const useRealtimeKitSelector = <StateSlice,>(\n selector: StateSelector<RealtimeKitClient, StateSlice>\n) => {\n const { meeting, updates } = useContext(RealtimeKitContext);\n if (!meeting)\n throw new Error(\n 'useRealtimeKitSelector must be used within the RealtimeKitProvider'\n );\n const state = useRef(selector(meeting));\n const [, forceUpdate] = useReducer((c) => c + 1, 0) as [never, () => void];\n\n useEffect(() => {\n const currentState = meeting && selector(meeting);\n const listener = () => {\n const newStateSlice = meeting && selector(meeting);\n if (shouldUpdate(state.current, newStateSlice)) {\n state.current = newStateSlice;\n forceUpdate();\n }\n };\n if (\n currentState &&\n typeof currentState === 'object' &&\n 'addListener' in currentState\n ) {\n (currentState as any).addListener('*', forceUpdate);\n return () => {\n (currentState as any).removeListener('*', forceUpdate);\n };\n }\n updates?.addListener(listener);\n return () => {\n updates?.removeListener(listener);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [meeting, updates]);\n return state.current;\n};\n\nexport * from './ReactContext';\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,SAAS,EAAEC,MAAM,EAAEC,UAAU,EAAEC,UAAU,QAAQ,OAAO;AAC3E,OAAOC,iBAAiB,MAEjB,yBAAyB;AAChC,SAASC,kBAAkB,QAAQ,gBAAgB;;AAEnD;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,GAAGA,CAAA,KAG/B;EACH,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGT,QAAQ,CAAoB,CAAC;EACzD,MAAMU,UAAU,GAAG,MACjBC,OAAiC,IACF;IAC/B,MAAMC,GAAG,GAAG,MAAMP,iBAAiB,CAACQ,IAAI,CAACF,OAAO,CAAC;IACjDF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AC9CL,KAAK,CAACM,OAAO,GAAGD,aAAa;QAC7BJ,WAAW,CAAC,CAAC;MACf;IACF,CAAC;IACD,IACEE,YAAY,IACZ,OAAOA,YAAY,KAAK,QAAQ,IAChC,aAAa,IAAIA,YAAY,EAC7B;MACCA,YAAY,CAASI,WAAW,CAAC,GAAG,EAAEN,WAAW,CAAC;MACnD,OAAO,MAAM;QACVE,YAAY,CAASK,cAAc,CAAC,GAAG,EAAEP,WAAW,CAAC;MACxD,CAAC;IACH;IACAH,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAES,WAAW,CAACH,QAAQ,CAAC;IAC9B,OAAO,MAAM;MACXN,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEU,cAAc,CAACJ,QAAQ,CAAC;IACnC,CAAC;IACD;EACF,CAAC,EAAE,CAACP,OAAO,EAAEC,OAAO,CAAC,CAAC;EACtB,OAAOE,KAAK,CAACM,OAAO;AACtB,CAAC;AAED,cAAc,gBAAgB","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const SDK_VERSION = '0.
|
|
1
|
+
export const SDK_VERSION = '0.2.0-staging.1';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SDK_VERSION"],"sources":["version.ts"],"sourcesContent":["export const SDK_VERSION = '0.
|
|
1
|
+
{"version":3,"names":["SDK_VERSION"],"sources":["version.ts"],"sourcesContent":["export const SDK_VERSION = '0.2.0-staging.1';\n"],"mappings":"AAAA,OAAO,MAAMA,WAAW,GAAG,iBAAiB","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import RealtimeKitClient from '@cloudflare/realtimekit';
|
|
1
|
+
import RealtimeKitClient, { RealtimeKitClientOptions } from '@cloudflare/realtimekit';
|
|
2
2
|
/**
|
|
3
3
|
* Hook which manages a RealtimeKitClient instance
|
|
4
4
|
*/
|
|
5
|
-
export declare const useRealtimeKitClient: () => [RealtimeKitClient | undefined, (options:
|
|
5
|
+
export declare const useRealtimeKitClient: () => [RealtimeKitClient | undefined, (options: RealtimeKitClientOptions) => {}];
|
|
6
6
|
type StateSelector<T extends object, U> = (state: T) => U;
|
|
7
7
|
/**
|
|
8
8
|
* @deprecated Use `useRealtimeKitSelector` instead.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
1
|
+
export declare const SDK_VERSION = "0.2.0-staging.1";
|
package/package.json
CHANGED
package/plugin/build/withRTK.js
CHANGED
|
@@ -97,6 +97,22 @@ const withAndroidScreenshare = (config) => {
|
|
|
97
97
|
return _config;
|
|
98
98
|
});
|
|
99
99
|
};
|
|
100
|
+
const withAndroidBlobProviderAuthority = (config) => {
|
|
101
|
+
return (0, config_plugins_1.withStringsXml)(config, async (_config) => {
|
|
102
|
+
// Avoid duplicates
|
|
103
|
+
const existing = _config.modResults.resources.string?.find((item) => item.$.name === 'blob_provider_authority');
|
|
104
|
+
if (!existing) {
|
|
105
|
+
_config.modResults.resources.string = [
|
|
106
|
+
...(_config.modResults.resources.string || []),
|
|
107
|
+
{
|
|
108
|
+
$: { name: 'blob_provider_authority' },
|
|
109
|
+
_: 'com.cloudflare.realtimekit.expo.blobs',
|
|
110
|
+
},
|
|
111
|
+
];
|
|
112
|
+
}
|
|
113
|
+
return _config;
|
|
114
|
+
});
|
|
115
|
+
};
|
|
100
116
|
const withVoice = (config, props = {}) => {
|
|
101
117
|
const _props = props ? props : {};
|
|
102
118
|
config = withIosPermissions(config, _props);
|
|
@@ -104,6 +120,7 @@ const withVoice = (config, props = {}) => {
|
|
|
104
120
|
config = withAndroidPermissions(config);
|
|
105
121
|
}
|
|
106
122
|
config = withAndroidScreenshare(config);
|
|
123
|
+
config = withAndroidBlobProviderAuthority(config);
|
|
107
124
|
return config;
|
|
108
125
|
};
|
|
109
126
|
exports.default = (0, config_plugins_1.createRunOncePlugin)(withVoice, '@cloudflare/realtimekit-react-native');
|
package/plugin/src/withRTK.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
createRunOncePlugin,
|
|
6
6
|
withAndroidManifest,
|
|
7
7
|
withInfoPlist,
|
|
8
|
+
withStringsXml,
|
|
8
9
|
} from '@expo/config-plugins';
|
|
9
10
|
|
|
10
11
|
const MICROPHONE = 'Allow $(PRODUCT_NAME) to access the microphone';
|
|
@@ -146,6 +147,25 @@ const withAndroidScreenshare: ConfigPlugin = (config) => {
|
|
|
146
147
|
});
|
|
147
148
|
};
|
|
148
149
|
|
|
150
|
+
const withAndroidBlobProviderAuthority: ConfigPlugin = (config) => {
|
|
151
|
+
return withStringsXml(config, async (_config) => {
|
|
152
|
+
// Avoid duplicates
|
|
153
|
+
const existing = _config.modResults.resources.string?.find(
|
|
154
|
+
(item) => item.$.name === 'blob_provider_authority'
|
|
155
|
+
);
|
|
156
|
+
if (!existing) {
|
|
157
|
+
_config.modResults.resources.string = [
|
|
158
|
+
...(_config.modResults.resources.string || []),
|
|
159
|
+
{
|
|
160
|
+
$: { name: 'blob_provider_authority' },
|
|
161
|
+
_: 'com.cloudflare.realtimekit.expo.blobs',
|
|
162
|
+
},
|
|
163
|
+
];
|
|
164
|
+
}
|
|
165
|
+
return _config;
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
|
|
149
169
|
const withVoice: ConfigPlugin<Props | void> = (config, props = {}) => {
|
|
150
170
|
const _props = props ? props : {};
|
|
151
171
|
config = withIosPermissions(config, _props);
|
|
@@ -153,6 +173,7 @@ const withVoice: ConfigPlugin<Props | void> = (config, props = {}) => {
|
|
|
153
173
|
config = withAndroidPermissions(config);
|
|
154
174
|
}
|
|
155
175
|
config = withAndroidScreenshare(config);
|
|
176
|
+
config = withAndroidBlobProviderAuthority(config);
|
|
156
177
|
return config;
|
|
157
178
|
};
|
|
158
179
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["BASE_SDK_VERSION","module","exports"],"sources":["constants.js"],"sourcesContent":["const BASE_SDK_VERSION = '0.1.4';\nmodule.exports = { BASE_SDK_VERSION };\n"],"mappings":";;AAAA,MAAMA,gBAAgB,GAAG,OAAO;AAChCC,MAAM,CAACC,OAAO,GAAG;EAAEF;AAAiB,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["BASE_SDK_VERSION","module","exports"],"sources":["constants.js"],"sourcesContent":["const BASE_SDK_VERSION = '0.1.4';\nmodule.exports = { BASE_SDK_VERSION };\n"],"mappings":"AAAA,MAAMA,gBAAgB,GAAG,OAAO;AAChCC,MAAM,CAACC,OAAO,GAAG;EAAEF;AAAiB,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const BASE_SDK_VERSION: "0.1.4";
|