@multiplayer-app/session-recorder-react 1.3.35 → 1.3.37
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/dist/context/SessionRecorderContext.js +2 -2
- package/dist/context/SessionRecorderStore.d.ts.map +1 -1
- package/dist/context/SessionRecorderStore.js.map +1 -1
- package/dist/context/useSessionRecorderStore.d.ts.map +1 -1
- package/dist/context/useSessionRecorderStore.js.map +1 -1
- package/dist/context/useStoreSelector.d.ts.map +1 -1
- package/dist/context/useStoreSelector.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/utils/shallowEqual.js.map +1 -1
- package/eslint.config.js +226 -0
- package/package.json +5 -5
- package/src/context/SessionRecorderContext.tsx +2 -2
- package/src/context/SessionRecorderStore.ts +3 -3
- package/src/context/useSessionRecorderStore.ts +9 -9
- package/src/context/useStoreSelector.ts +19 -19
- package/src/utils/shallowEqual.ts +9 -9
|
@@ -13,7 +13,7 @@ export const SessionRecorderProvider = ({ children, options }) => {
|
|
|
13
13
|
useEffect(() => {
|
|
14
14
|
sessionRecorderStore.setState({
|
|
15
15
|
sessionState: SessionRecorder.sessionState,
|
|
16
|
-
sessionType: SessionRecorder.sessionType
|
|
16
|
+
sessionType: SessionRecorder.sessionType,
|
|
17
17
|
});
|
|
18
18
|
const onStateChange = (sessionState) => {
|
|
19
19
|
sessionRecorderStore.setState({ sessionState });
|
|
@@ -53,7 +53,7 @@ export const SessionRecorderProvider = ({ children, options }) => {
|
|
|
53
53
|
pauseSession,
|
|
54
54
|
resumeSession,
|
|
55
55
|
cancelSession,
|
|
56
|
-
saveSession
|
|
56
|
+
saveSession,
|
|
57
57
|
}, children: children }));
|
|
58
58
|
};
|
|
59
59
|
export const useSessionRecorder = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionRecorderStore.d.ts","sourceRoot":"","sources":["../../src/context/SessionRecorderStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"SessionRecorderStore.d.ts","sourceRoot":"","sources":["../../src/context/SessionRecorderStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAA;AAGrF,MAAM,MAAM,oBAAoB,GAAG;IACjC,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,oBAAoB,CAOzD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionRecorderStore.js","sourceRoot":"","sources":["../../src/context/SessionRecorderStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAc,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"SessionRecorderStore.js","sourceRoot":"","sources":["../../src/context/SessionRecorderStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAc,MAAM,eAAe,CAAA;AAYvD,MAAM,CAAC,MAAM,oBAAoB,GAC/B,WAAW,CAAuB;IAChC,aAAa,EAAE,KAAK;IACpB,WAAW,EAAE,IAAI;IACjB,YAAY,EAAE,IAAI;IAClB,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,IAAI;CACZ,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSessionRecorderStore.d.ts","sourceRoot":"","sources":["../../src/context/useSessionRecorderStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,2CAA2C,
|
|
1
|
+
{"version":3,"file":"useSessionRecorderStore.d.ts","sourceRoot":"","sources":["../../src/context/useSessionRecorderStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAA;AAErF,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,wBAAwB,CAAA;AAG/B;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAC5C,QAAQ,EAAE,CAAC,CAAC,EAAE,oBAAoB,KAAK,MAAM,EAC7C,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,OAAO,GAC7C,MAAM,CAMR;AAED;;GAEG;AACH,wBAAgB,wBAAwB,wBAEvC;AAED;;GAEG;AACH,wBAAgB,cAAc,uBAE7B;AAED;;GAEG;AACH,wBAAgB,gBAAgB,YAE/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSessionRecorderStore.js","sourceRoot":"","sources":["../../src/context/useSessionRecorderStore.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,oBAAoB,GACrB,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"useSessionRecorderStore.js","sourceRoot":"","sources":["../../src/context/useSessionRecorderStore.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,oBAAoB,GACrB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD;;;;;;;GAOG;AACH,MAAM,UAAU,uBAAuB,CACrC,QAA6C,EAC7C,UAA8C;IAE9C,OAAO,gBAAgB,CACrB,oBAAoB,EACpB,QAAQ,EACR,UAAU,CACX,CAAA;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB;IACtC,OAAO,uBAAuB,CAAsB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAA;AAC5E,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,uBAAuB,CAAqB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAA;AAC1E,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,uBAAuB,CAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAA;AACjE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStoreSelector.d.ts","sourceRoot":"","sources":["../../src/context/useStoreSelector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"useStoreSelector.d.ts","sourceRoot":"","sources":["../../src/context/useStoreSelector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEpD,wBAAgB,gBAAgB,CAAC,MAAM,SAAS,MAAM,EAAE,MAAM,EAC5D,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,EACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,EACnC,UAAU,GAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,OAAmB,GACxD,MAAM,CAyBR;AAED,eAAO,MAAM,OAAO,qBAAe,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStoreSelector.js","sourceRoot":"","sources":["../../src/context/useStoreSelector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"useStoreSelector.js","sourceRoot":"","sources":["../../src/context/useStoreSelector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEpD,MAAM,UAAU,gBAAgB,CAC9B,KAAoB,EACpB,QAAmC,EACnC,aAAgD,MAAM,CAAC,EAAE;IAEzD,MAAM,iBAAiB,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;IAC1C,MAAM,iBAAiB,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;IAC5C,iBAAiB,CAAC,OAAO,GAAG,QAAQ,CAAA;IACpC,iBAAiB,CAAC,OAAO,GAAG,UAAU,CAAA;IAEtC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAS,GAAG,EAAE,CAC9C,iBAAiB,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAC5C,CAAA;IAED,SAAS,CAAC,GAAG,EAAE;QACb,SAAS,YAAY,CAAC,SAAiB,EAAE,SAAiB;YACxD,MAAM,SAAS,GAAG,iBAAiB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;YACtD,MAAM,SAAS,GAAG,iBAAiB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;YACtD,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC;gBACrD,QAAQ,CAAC,SAAS,CAAC,CAAA;YACrB,CAAC;QACH,CAAC;QACD,MAAM,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAA;QACjD,sDAAsD;QACtD,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;QAChD,OAAO,WAAW,CAAA;IACpB,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;IAEX,OAAO,KAAK,CAAA;AACd,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../src/errorboundary.tsx","../src/index.ts","../src/navigation.ts","../src/context/sessionrecordercontext.tsx","../src/context/sessionrecorderstore.ts","../src/context/createstore.ts","../src/context/usesessionrecorderstore.ts","../src/context/usestoreselector.ts","../src/utils/shallowequal.ts"],"version":"5.7.3"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shallowEqual.js","sourceRoot":"","sources":["../../src/utils/shallowEqual.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,YAAY,CAC1B,CAAI,EACJ,CAAI;IAEJ,IAAI,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QAAE,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"shallowEqual.js","sourceRoot":"","sources":["../../src/utils/shallowEqual.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,YAAY,CAC1B,CAAI,EACJ,CAAI;IAEJ,IAAI,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QAAE,OAAO,IAAI,CAAA;IAChC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAA;IAC1B,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAC5B,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAC5B,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;QAAE,OAAO,KAAK,CAAA;IAC/C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;QACpB,IACE,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,GAAI,CAAC;YAC9C,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,GAAI,CAAC,EAAE,CAAC,CAAC,GAAI,CAAC,CAAC,EAC5B,CAAC;YACD,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import js from '@eslint/js'
|
|
2
|
+
import globals from 'globals'
|
|
3
|
+
import tseslint from '@typescript-eslint/eslint-plugin'
|
|
4
|
+
import tsparser from '@typescript-eslint/parser'
|
|
5
|
+
|
|
6
|
+
export default [
|
|
7
|
+
js.configs.recommended,
|
|
8
|
+
{
|
|
9
|
+
ignores: [
|
|
10
|
+
'node_modules/**',
|
|
11
|
+
'dist/**',
|
|
12
|
+
'build/**',
|
|
13
|
+
'coverage/**',
|
|
14
|
+
'*.min.js',
|
|
15
|
+
'*.bundle.js',
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
files: ['**/*.ts', '**/*.tsx'],
|
|
20
|
+
languageOptions: {
|
|
21
|
+
parser: tsparser,
|
|
22
|
+
parserOptions: {
|
|
23
|
+
ecmaVersion: 'latest',
|
|
24
|
+
sourceType: 'module',
|
|
25
|
+
},
|
|
26
|
+
globals: {
|
|
27
|
+
...globals.browser,
|
|
28
|
+
// Browser globals
|
|
29
|
+
window: 'readonly',
|
|
30
|
+
document: 'readonly',
|
|
31
|
+
navigator: 'readonly',
|
|
32
|
+
localStorage: 'readonly',
|
|
33
|
+
sessionStorage: 'readonly',
|
|
34
|
+
console: 'readonly',
|
|
35
|
+
setTimeout: 'readonly',
|
|
36
|
+
clearTimeout: 'readonly',
|
|
37
|
+
setInterval: 'readonly',
|
|
38
|
+
clearInterval: 'readonly',
|
|
39
|
+
requestAnimationFrame: 'readonly',
|
|
40
|
+
cancelAnimationFrame: 'readonly',
|
|
41
|
+
fetch: 'readonly',
|
|
42
|
+
Headers: 'readonly',
|
|
43
|
+
HeadersInit: 'readonly',
|
|
44
|
+
Request: 'readonly',
|
|
45
|
+
RequestInfo: 'readonly',
|
|
46
|
+
Response: 'readonly',
|
|
47
|
+
FormData: 'readonly',
|
|
48
|
+
File: 'readonly',
|
|
49
|
+
Blob: 'readonly',
|
|
50
|
+
URL: 'readonly',
|
|
51
|
+
URLSearchParams: 'readonly',
|
|
52
|
+
AbortController: 'readonly',
|
|
53
|
+
AbortSignal: 'readonly',
|
|
54
|
+
ReadableStream: 'readonly',
|
|
55
|
+
WritableStream: 'readonly',
|
|
56
|
+
TransformStream: 'readonly',
|
|
57
|
+
TextEncoder: 'readonly',
|
|
58
|
+
TextDecoder: 'readonly',
|
|
59
|
+
HTMLElement: 'readonly',
|
|
60
|
+
HTMLButtonElement: 'readonly',
|
|
61
|
+
HTMLInputElement: 'readonly',
|
|
62
|
+
HTMLTextAreaElement: 'readonly',
|
|
63
|
+
HTMLAnchorElement: 'readonly',
|
|
64
|
+
XMLHttpRequest: 'readonly',
|
|
65
|
+
XMLHttpRequestBodyInit: 'readonly',
|
|
66
|
+
MouseEvent: 'readonly',
|
|
67
|
+
InputEvent: 'readonly',
|
|
68
|
+
MessageEvent: 'readonly',
|
|
69
|
+
EventListener: 'readonly',
|
|
70
|
+
MutationObserver: 'readonly',
|
|
71
|
+
NodeJS: 'readonly',
|
|
72
|
+
Window: 'readonly',
|
|
73
|
+
Document: 'readonly',
|
|
74
|
+
IDBDatabase: 'readonly',
|
|
75
|
+
indexedDB: 'readonly',
|
|
76
|
+
// Node.js globals
|
|
77
|
+
process: 'readonly',
|
|
78
|
+
Buffer: 'readonly',
|
|
79
|
+
__dirname: 'readonly',
|
|
80
|
+
__filename: 'readonly',
|
|
81
|
+
global: 'readonly',
|
|
82
|
+
module: 'readonly',
|
|
83
|
+
require: 'readonly',
|
|
84
|
+
exports: 'readonly',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
plugins: {
|
|
88
|
+
'@typescript-eslint': tseslint,
|
|
89
|
+
},
|
|
90
|
+
rules: {
|
|
91
|
+
// TypeScript specific rules
|
|
92
|
+
'no-namespace': 'off',
|
|
93
|
+
'no-useless-escape': 'off',
|
|
94
|
+
'no-self-assign': 'off',
|
|
95
|
+
'no-useless-catch': 'off',
|
|
96
|
+
'prefer-namespace-keyword': 'off',
|
|
97
|
+
'no-empty-function': 'off',
|
|
98
|
+
'no-unused-vars': 'off',
|
|
99
|
+
'no-explicit-any': 'off',
|
|
100
|
+
'ban-types': 'off',
|
|
101
|
+
'object-curly-spacing': ['error', 'always'],
|
|
102
|
+
'space-before-blocks': 'error',
|
|
103
|
+
'keyword-spacing': 'error',
|
|
104
|
+
|
|
105
|
+
// General rules
|
|
106
|
+
'prefer-const': 'error',
|
|
107
|
+
'block-spacing': ['error', 'always'],
|
|
108
|
+
'keyword-spacing': [
|
|
109
|
+
'error',
|
|
110
|
+
{
|
|
111
|
+
before: true,
|
|
112
|
+
after: true,
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
'indent': ['error', 2, { SwitchCase: 1 }],
|
|
116
|
+
'linebreak-style': ['error', 'unix'],
|
|
117
|
+
'quotes': ['error', 'single'],
|
|
118
|
+
'semi': ['error', 'never'],
|
|
119
|
+
'comma-dangle': ['error', 'always-multiline'],
|
|
120
|
+
'no-console': 'warn',
|
|
121
|
+
'object-curly-spacing': ['error', 'always'],
|
|
122
|
+
'space-in-parens': ['error', 'never'],
|
|
123
|
+
'array-bracket-spacing': ['error', 'never'],
|
|
124
|
+
'no-trailing-spaces': 'error',
|
|
125
|
+
'no-multi-spaces': 'error',
|
|
126
|
+
'no-lonely-if': 'error',
|
|
127
|
+
'key-spacing': 'error',
|
|
128
|
+
'no-useless-escape': 'error',
|
|
129
|
+
'no-self-assign': 'error',
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
files: ['**/*.js', '**/*.mjs'],
|
|
134
|
+
languageOptions: {
|
|
135
|
+
ecmaVersion: 'latest',
|
|
136
|
+
sourceType: 'module',
|
|
137
|
+
globals: {
|
|
138
|
+
// Browser globals
|
|
139
|
+
window: 'readonly',
|
|
140
|
+
document: 'readonly',
|
|
141
|
+
navigator: 'readonly',
|
|
142
|
+
localStorage: 'readonly',
|
|
143
|
+
sessionStorage: 'readonly',
|
|
144
|
+
console: 'readonly',
|
|
145
|
+
setTimeout: 'readonly',
|
|
146
|
+
clearTimeout: 'readonly',
|
|
147
|
+
setInterval: 'readonly',
|
|
148
|
+
clearInterval: 'readonly',
|
|
149
|
+
requestAnimationFrame: 'readonly',
|
|
150
|
+
cancelAnimationFrame: 'readonly',
|
|
151
|
+
fetch: 'readonly',
|
|
152
|
+
Headers: 'readonly',
|
|
153
|
+
HeadersInit: 'readonly',
|
|
154
|
+
Request: 'readonly',
|
|
155
|
+
RequestInfo: 'readonly',
|
|
156
|
+
Response: 'readonly',
|
|
157
|
+
FormData: 'readonly',
|
|
158
|
+
File: 'readonly',
|
|
159
|
+
Blob: 'readonly',
|
|
160
|
+
URL: 'readonly',
|
|
161
|
+
URLSearchParams: 'readonly',
|
|
162
|
+
AbortController: 'readonly',
|
|
163
|
+
AbortSignal: 'readonly',
|
|
164
|
+
ReadableStream: 'readonly',
|
|
165
|
+
WritableStream: 'readonly',
|
|
166
|
+
TransformStream: 'readonly',
|
|
167
|
+
TextEncoder: 'readonly',
|
|
168
|
+
TextDecoder: 'readonly',
|
|
169
|
+
HTMLElement: 'readonly',
|
|
170
|
+
HTMLButtonElement: 'readonly',
|
|
171
|
+
HTMLInputElement: 'readonly',
|
|
172
|
+
HTMLTextAreaElement: 'readonly',
|
|
173
|
+
HTMLAnchorElement: 'readonly',
|
|
174
|
+
XMLHttpRequest: 'readonly',
|
|
175
|
+
XMLHttpRequestBodyInit: 'readonly',
|
|
176
|
+
MouseEvent: 'readonly',
|
|
177
|
+
InputEvent: 'readonly',
|
|
178
|
+
MessageEvent: 'readonly',
|
|
179
|
+
EventListener: 'readonly',
|
|
180
|
+
MutationObserver: 'readonly',
|
|
181
|
+
NodeJS: 'readonly',
|
|
182
|
+
Window: 'readonly',
|
|
183
|
+
Document: 'readonly',
|
|
184
|
+
IDBDatabase: 'readonly',
|
|
185
|
+
indexedDB: 'readonly',
|
|
186
|
+
// Node.js globals
|
|
187
|
+
process: 'readonly',
|
|
188
|
+
Buffer: 'readonly',
|
|
189
|
+
__dirname: 'readonly',
|
|
190
|
+
__filename: 'readonly',
|
|
191
|
+
global: 'readonly',
|
|
192
|
+
module: 'readonly',
|
|
193
|
+
require: 'readonly',
|
|
194
|
+
exports: 'readonly',
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
rules: {
|
|
198
|
+
'no-useless-escape': 'off',
|
|
199
|
+
'no-self-assign': 'off',
|
|
200
|
+
'prefer-const': 'error',
|
|
201
|
+
'block-spacing': ['error', 'always'],
|
|
202
|
+
'keyword-spacing': [
|
|
203
|
+
'error',
|
|
204
|
+
{
|
|
205
|
+
before: true,
|
|
206
|
+
after: true,
|
|
207
|
+
},
|
|
208
|
+
],
|
|
209
|
+
'indent': ['error', 2, { SwitchCase: 1 }],
|
|
210
|
+
'linebreak-style': ['error', 'unix'],
|
|
211
|
+
'quotes': ['error', 'single'],
|
|
212
|
+
'semi': ['error', 'never'],
|
|
213
|
+
'comma-dangle': ['error', 'always-multiline'],
|
|
214
|
+
'no-console': 'warn',
|
|
215
|
+
'object-curly-spacing': ['error', 'always'],
|
|
216
|
+
'space-in-parens': ['error', 'never'],
|
|
217
|
+
'array-bracket-spacing': ['error', 'never'],
|
|
218
|
+
'no-trailing-spaces': 'error',
|
|
219
|
+
'no-multi-spaces': 'error',
|
|
220
|
+
'no-lonely-if': 'error',
|
|
221
|
+
'key-spacing': 'error',
|
|
222
|
+
'no-useless-escape': 'error',
|
|
223
|
+
'no-self-assign': 'error',
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multiplayer-app/session-recorder-react",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.37",
|
|
4
4
|
"description": "Multiplayer Fullstack Session Recorder for React (browser wrapper)",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Multiplayer Software, Inc.",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"scripts": {
|
|
28
|
-
"lint": "eslint src/**/*.{ts,tsx}",
|
|
28
|
+
"lint": "eslint src/**/*.{ts,tsx} --config eslint.config.js",
|
|
29
29
|
"build": "rm -rf dist tsconfig.tsbuildinfo && tsc --build tsconfig.json",
|
|
30
30
|
"prepublishOnly": "npm run build"
|
|
31
31
|
},
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"@opentelemetry/api": "^1.9.0"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@multiplayer-app/session-recorder-browser": "1.3.
|
|
39
|
-
"@multiplayer-app/session-recorder-common": "1.3.
|
|
38
|
+
"@multiplayer-app/session-recorder-browser": "1.3.37",
|
|
39
|
+
"@multiplayer-app/session-recorder-common": "1.3.37"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"eslint": "
|
|
42
|
+
"eslint": "10.1.0",
|
|
43
43
|
"typescript": "5.7.3",
|
|
44
44
|
"@types/react": "^18.2.66"
|
|
45
45
|
}
|
|
@@ -31,7 +31,7 @@ export const SessionRecorderProvider: React.FC<SessionRecorderProviderProps> = (
|
|
|
31
31
|
useEffect(() => {
|
|
32
32
|
sessionRecorderStore.setState({
|
|
33
33
|
sessionState: SessionRecorder.sessionState,
|
|
34
|
-
sessionType: SessionRecorder.sessionType
|
|
34
|
+
sessionType: SessionRecorder.sessionType,
|
|
35
35
|
})
|
|
36
36
|
|
|
37
37
|
const onStateChange = (sessionState: SessionState) => {
|
|
@@ -82,7 +82,7 @@ export const SessionRecorderProvider: React.FC<SessionRecorderProviderProps> = (
|
|
|
82
82
|
pauseSession,
|
|
83
83
|
resumeSession,
|
|
84
84
|
cancelSession,
|
|
85
|
-
saveSession
|
|
85
|
+
saveSession,
|
|
86
86
|
}}
|
|
87
87
|
>
|
|
88
88
|
{children}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createStore, type Store } from './createStore'
|
|
2
|
-
import { SessionState, SessionType } from '@multiplayer-app/session-recorder-browser'
|
|
1
|
+
import { createStore, type Store } from './createStore'
|
|
2
|
+
import { SessionState, SessionType } from '@multiplayer-app/session-recorder-browser'
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
export type SessionRecorderState = {
|
|
@@ -17,4 +17,4 @@ export const sessionRecorderStore: Store<SessionRecorderState> =
|
|
|
17
17
|
sessionState: null,
|
|
18
18
|
isOnline: true,
|
|
19
19
|
error: null,
|
|
20
|
-
})
|
|
20
|
+
})
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { SessionState, SessionType } from '@multiplayer-app/session-recorder-browser'
|
|
1
|
+
import { SessionState, SessionType } from '@multiplayer-app/session-recorder-browser'
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
type SessionRecorderState,
|
|
5
5
|
sessionRecorderStore,
|
|
6
|
-
} from './SessionRecorderStore'
|
|
7
|
-
import { useStoreSelector } from './useStoreSelector'
|
|
6
|
+
} from './SessionRecorderStore'
|
|
7
|
+
import { useStoreSelector } from './useStoreSelector'
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Select a derived slice from the shared Session Recorder store.
|
|
@@ -16,32 +16,32 @@ import { useStoreSelector } from './useStoreSelector';
|
|
|
16
16
|
*/
|
|
17
17
|
export function useSessionRecorderStore<TSlice>(
|
|
18
18
|
selector: (s: SessionRecorderState) => TSlice,
|
|
19
|
-
equalityFn?: (a: TSlice, b: TSlice) => boolean
|
|
19
|
+
equalityFn?: (a: TSlice, b: TSlice) => boolean,
|
|
20
20
|
): TSlice {
|
|
21
21
|
return useStoreSelector<SessionRecorderState, TSlice>(
|
|
22
22
|
sessionRecorderStore,
|
|
23
23
|
selector,
|
|
24
|
-
equalityFn
|
|
25
|
-
)
|
|
24
|
+
equalityFn,
|
|
25
|
+
)
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* Read the current session recording state (started, paused, stopped).
|
|
30
30
|
*/
|
|
31
31
|
export function useSessionRecordingState() {
|
|
32
|
-
return useSessionRecorderStore<SessionState | null>((s) => s.sessionState)
|
|
32
|
+
return useSessionRecorderStore<SessionState | null>((s) => s.sessionState)
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* Read the current session type (MANUAL/CONTINUOUS).
|
|
37
37
|
*/
|
|
38
38
|
export function useSessionType() {
|
|
39
|
-
return useSessionRecorderStore<SessionType | null>((s) => s.sessionType)
|
|
39
|
+
return useSessionRecorderStore<SessionType | null>((s) => s.sessionType)
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Check whether the Session Recorder has been initialized.
|
|
44
44
|
*/
|
|
45
45
|
export function useIsInitialized() {
|
|
46
|
-
return useSessionRecorderStore<boolean>((s) => s.isInitialized)
|
|
46
|
+
return useSessionRecorderStore<boolean>((s) => s.isInitialized)
|
|
47
47
|
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from 'react'
|
|
2
|
-
import { type Store } from './createStore'
|
|
3
|
-
import { shallowEqual } from '../utils/shallowEqual'
|
|
1
|
+
import { useEffect, useRef, useState } from 'react'
|
|
2
|
+
import { type Store } from './createStore'
|
|
3
|
+
import { shallowEqual } from '../utils/shallowEqual'
|
|
4
4
|
|
|
5
5
|
export function useStoreSelector<TState extends object, TSlice>(
|
|
6
6
|
store: Store<TState>,
|
|
7
7
|
selector: (state: TState) => TSlice,
|
|
8
|
-
equalityFn: (a: TSlice, b: TSlice) => boolean = Object.is
|
|
8
|
+
equalityFn: (a: TSlice, b: TSlice) => boolean = Object.is,
|
|
9
9
|
): TSlice {
|
|
10
|
-
const latestSelectorRef = useRef(selector)
|
|
11
|
-
const latestEqualityRef = useRef(equalityFn)
|
|
12
|
-
latestSelectorRef.current = selector
|
|
13
|
-
latestEqualityRef.current = equalityFn
|
|
10
|
+
const latestSelectorRef = useRef(selector)
|
|
11
|
+
const latestEqualityRef = useRef(equalityFn)
|
|
12
|
+
latestSelectorRef.current = selector
|
|
13
|
+
latestEqualityRef.current = equalityFn
|
|
14
14
|
|
|
15
15
|
const [slice, setSlice] = useState<TSlice>(() =>
|
|
16
|
-
latestSelectorRef.current(store.getState())
|
|
17
|
-
)
|
|
16
|
+
latestSelectorRef.current(store.getState()),
|
|
17
|
+
)
|
|
18
18
|
|
|
19
19
|
useEffect(() => {
|
|
20
20
|
function handleChange(nextState: TState, prevState: TState) {
|
|
21
|
-
const nextSlice = latestSelectorRef.current(nextState)
|
|
22
|
-
const prevSlice = latestSelectorRef.current(prevState)
|
|
21
|
+
const nextSlice = latestSelectorRef.current(nextState)
|
|
22
|
+
const prevSlice = latestSelectorRef.current(prevState)
|
|
23
23
|
if (!latestEqualityRef.current(nextSlice, prevSlice)) {
|
|
24
|
-
setSlice(nextSlice)
|
|
24
|
+
setSlice(nextSlice)
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
const unsubscribe = store.subscribe(handleChange)
|
|
27
|
+
const unsubscribe = store.subscribe(handleChange)
|
|
28
28
|
// Sync once in case changed between render and effect
|
|
29
|
-
handleChange(store.getState(), store.getState())
|
|
30
|
-
return unsubscribe
|
|
31
|
-
}, [store])
|
|
29
|
+
handleChange(store.getState(), store.getState())
|
|
30
|
+
return unsubscribe
|
|
31
|
+
}, [store])
|
|
32
32
|
|
|
33
|
-
return slice
|
|
33
|
+
return slice
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
export const shallow = shallowEqual
|
|
36
|
+
export const shallow = shallowEqual
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
export function shallowEqual<T extends Record<string, any>>(
|
|
2
2
|
a: T,
|
|
3
|
-
b: T
|
|
3
|
+
b: T,
|
|
4
4
|
): boolean {
|
|
5
|
-
if (Object.is(a, b)) return true
|
|
6
|
-
if (!a || !b) return false
|
|
7
|
-
const aKeys = Object.keys(a)
|
|
8
|
-
const bKeys = Object.keys(b)
|
|
9
|
-
if (aKeys.length !== bKeys.length) return false
|
|
5
|
+
if (Object.is(a, b)) return true
|
|
6
|
+
if (!a || !b) return false
|
|
7
|
+
const aKeys = Object.keys(a)
|
|
8
|
+
const bKeys = Object.keys(b)
|
|
9
|
+
if (aKeys.length !== bKeys.length) return false
|
|
10
10
|
for (let i = 0; i < aKeys.length; i++) {
|
|
11
|
-
const key = aKeys[i]
|
|
11
|
+
const key = aKeys[i]
|
|
12
12
|
if (
|
|
13
13
|
!Object.prototype.hasOwnProperty.call(b, key!) ||
|
|
14
14
|
!Object.is(a[key!], b[key!])
|
|
15
15
|
) {
|
|
16
|
-
return false
|
|
16
|
+
return false
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
return true
|
|
19
|
+
return true
|
|
20
20
|
}
|