|
@@ -13,11 +13,7 @@ import { RouteRegistry } from '../../base/react';
|
13
|
13
|
import { MiddlewareRegistry, ReducerRegistry } from '../../base/redux';
|
14
|
14
|
import { toURLString } from '../../base/util';
|
15
|
15
|
|
16
|
|
-import {
|
17
|
|
- appNavigate,
|
18
|
|
- appWillMount,
|
19
|
|
- appWillUnmount
|
20
|
|
-} from '../actions';
|
|
16
|
+import { appNavigate, appWillMount, appWillUnmount } from '../actions';
|
21
|
17
|
|
22
|
18
|
declare var APP: Object;
|
23
|
19
|
|
|
@@ -34,7 +30,7 @@ const DEFAULT_URL = 'https://meet.jit.si';
|
34
|
30
|
*/
|
35
|
31
|
export class AbstractApp extends Component {
|
36
|
32
|
/**
|
37
|
|
- * AbstractApp component's property types.
|
|
33
|
+ * {@code AbstractApp} component's property types.
|
38
|
34
|
*
|
39
|
35
|
* @static
|
40
|
36
|
*/
|
|
@@ -46,7 +42,7 @@ export class AbstractApp extends Component {
|
46
|
42
|
defaultURL: React.PropTypes.string,
|
47
|
43
|
|
48
|
44
|
/**
|
49
|
|
- * (Optional) Redux store for this app.
|
|
45
|
+ * (Optional) redux store for this app.
|
50
|
46
|
*/
|
51
|
47
|
store: React.PropTypes.object,
|
52
|
48
|
|
|
@@ -60,24 +56,24 @@ export class AbstractApp extends Component {
|
60
|
56
|
};
|
61
|
57
|
|
62
|
58
|
/**
|
63
|
|
- * Initializes a new AbstractApp instance.
|
|
59
|
+ * Initializes a new {@code AbstractApp} instance.
|
64
|
60
|
*
|
65
|
|
- * @param {Object} props - The read-only React Component props with which
|
66
|
|
- * the new instance is to be initialized.
|
|
61
|
+ * @param {Object} props - The read-only React {@code Component} props with
|
|
62
|
+ * which the new instance is to be initialized.
|
67
|
63
|
*/
|
68
|
64
|
constructor(props) {
|
69
|
65
|
super(props);
|
70
|
66
|
|
71
|
67
|
this.state = {
|
72
|
68
|
/**
|
73
|
|
- * The Route rendered by this AbstractApp.
|
|
69
|
+ * The Route rendered by this {@code AbstractApp}.
|
74
|
70
|
*
|
75
|
71
|
* @type {Route}
|
76
|
72
|
*/
|
77
|
73
|
route: undefined,
|
78
|
74
|
|
79
|
75
|
/**
|
80
|
|
- * The Redux store used by this AbstractApp.
|
|
76
|
+ * The redux store used by this {@code AbstractApp}.
|
81
|
77
|
*
|
82
|
78
|
* @type {Store}
|
83
|
79
|
*/
|
|
@@ -118,23 +114,23 @@ export class AbstractApp extends Component {
|
118
|
114
|
}
|
119
|
115
|
|
120
|
116
|
/**
|
121
|
|
- * Notifies this mounted React Component that it will receive new props.
|
122
|
|
- * Makes sure that this AbstractApp has a Redux store to use.
|
|
117
|
+ * Notifies this mounted React {@code Component} that it will receive new
|
|
118
|
+ * props. Makes sure that this {@code AbstractApp} has a redux store to use.
|
123
|
119
|
*
|
124
|
120
|
* @inheritdoc
|
125
|
|
- * @param {Object} nextProps - The read-only React Component props that this
|
126
|
|
- * instance will receive.
|
|
121
|
+ * @param {Object} nextProps - The read-only React {@code Component} props
|
|
122
|
+ * that this instance will receive.
|
127
|
123
|
* @returns {void}
|
128
|
124
|
*/
|
129
|
125
|
componentWillReceiveProps(nextProps) {
|
130
|
|
- // The consumer of this AbstractApp did not provide a Redux store.
|
|
126
|
+ // The consumer of this AbstractApp did not provide a redux store.
|
131
|
127
|
if (typeof nextProps.store === 'undefined'
|
132
|
128
|
|
133
|
|
- // The consumer of this AbstractApp did provide a Redux store
|
|
129
|
+ // The consumer of this AbstractApp did provide a redux store
|
134
|
130
|
// before. Which means that the consumer changed their mind. In
|
135
|
131
|
// such a case this instance should create its own internal
|
136
|
|
- // Redux store. If the consumer did not provide a Redux store
|
137
|
|
- // before, then this instance is using its own internal Redux
|
|
132
|
+ // redux store. If the consumer did not provide a redux store
|
|
133
|
+ // before, then this instance is using its own internal redux
|
138
|
134
|
// store already.
|
139
|
135
|
&& typeof this.props.store !== 'undefined') {
|
140
|
136
|
this.setState({
|
|
@@ -166,15 +162,16 @@ export class AbstractApp extends Component {
|
166
|
162
|
}
|
167
|
163
|
|
168
|
164
|
/**
|
169
|
|
- * Gets a Location object from the window with information about the current
|
170
|
|
- * location of the document. Explicitly defined to allow extenders to
|
171
|
|
- * override because React Native does not usually have a location property
|
172
|
|
- * on its window unless debugging remotely in which case the browser that is
|
173
|
|
- * the remote debugger will provide a location property on the window.
|
|
165
|
+ * Gets a {@code Location} object from the window with information about the
|
|
166
|
+ * current location of the document. Explicitly defined to allow extenders
|
|
167
|
+ * to override because React Native does not usually have a location
|
|
168
|
+ * property on its window unless debugging remotely in which case the
|
|
169
|
+ * browser that is the remote debugger will provide a location property on
|
|
170
|
+ * the window.
|
174
|
171
|
*
|
175
|
172
|
* @public
|
176
|
|
- * @returns {Location} A Location object with information about the current
|
177
|
|
- * location of the document.
|
|
173
|
+ * @returns {Location} A {@code Location} object with information about the
|
|
174
|
+ * current location of the document.
|
178
|
175
|
*/
|
179
|
176
|
getWindowLocation() {
|
180
|
177
|
return undefined;
|
|
@@ -205,14 +202,14 @@ export class AbstractApp extends Component {
|
205
|
202
|
}
|
206
|
203
|
|
207
|
204
|
/**
|
208
|
|
- * Create a ReactElement from the specified component, the specified props
|
209
|
|
- * and the props of this AbstractApp which are suitable for propagation to
|
210
|
|
- * the children of this Component.
|
|
205
|
+ * Creates a {@link ReactElement} from the specified component, the
|
|
206
|
+ * specified props and the props of this {@code AbstractApp} which are
|
|
207
|
+ * suitable for propagation to the children of this {@code Component}.
|
211
|
208
|
*
|
212
|
|
- * @param {Component} component - The component from which the ReactElement
|
213
|
|
- * is to be created.
|
214
|
|
- * @param {Object} props - The read-only React Component props with which
|
215
|
|
- * the ReactElement is to be initialized.
|
|
209
|
+ * @param {Component} component - The component from which the
|
|
210
|
+ * {@code ReactElement} is to be created.
|
|
211
|
+ * @param {Object} props - The read-only React {@code Component} props with
|
|
212
|
+ * which the {@code ReactElement} is to be initialized.
|
216
|
213
|
* @returns {ReactElement}
|
217
|
214
|
* @protected
|
218
|
215
|
*/
|
|
@@ -245,12 +242,12 @@ export class AbstractApp extends Component {
|
245
|
242
|
}
|
246
|
243
|
|
247
|
244
|
/**
|
248
|
|
- * Initializes a new Redux store instance suitable for use by
|
249
|
|
- * this AbstractApp.
|
|
245
|
+ * Initializes a new redux store instance suitable for use by this
|
|
246
|
+ * {@code AbstractApp}.
|
250
|
247
|
*
|
251
|
248
|
* @private
|
252
|
|
- * @returns {Store} - A new Redux store instance suitable for use by
|
253
|
|
- * this AbstractApp.
|
|
249
|
+ * @returns {Store} - A new redux store instance suitable for use by
|
|
250
|
+ * this {@code AbstractApp}.
|
254
|
251
|
*/
|
255
|
252
|
_createStore() {
|
256
|
253
|
// Create combined reducer from all reducers in ReducerRegistry.
|
|
@@ -275,10 +272,11 @@ export class AbstractApp extends Component {
|
275
|
272
|
}
|
276
|
273
|
|
277
|
274
|
/**
|
278
|
|
- * Gets the default URL to be opened when this App mounts.
|
|
275
|
+ * Gets the default URL to be opened when this {@code App} mounts.
|
279
|
276
|
*
|
280
|
277
|
* @protected
|
281
|
|
- * @returns {string} The default URL to be opened when this App mounts.
|
|
278
|
+ * @returns {string} The default URL to be opened when this {@code App}
|
|
279
|
+ * mounts.
|
282
|
280
|
*/
|
283
|
281
|
_getDefaultURL() {
|
284
|
282
|
// If the execution environment provides a Location abstraction, then
|
|
@@ -298,10 +296,10 @@ export class AbstractApp extends Component {
|
298
|
296
|
}
|
299
|
297
|
|
300
|
298
|
/**
|
301
|
|
- * Gets the Redux store used by this AbstractApp.
|
|
299
|
+ * Gets the redux store used by this {@code AbstractApp}.
|
302
|
300
|
*
|
303
|
301
|
* @protected
|
304
|
|
- * @returns {Store} - The Redux store used by this AbstractApp.
|
|
302
|
+ * @returns {Store} - The redux store used by this {@code AbstractApp}.
|
305
|
303
|
*/
|
306
|
304
|
_getStore() {
|
307
|
305
|
let store = this.state.store;
|
|
@@ -314,20 +312,21 @@ export class AbstractApp extends Component {
|
314
|
312
|
}
|
315
|
313
|
|
316
|
314
|
/**
|
317
|
|
- * Creates a Redux store to be used by this AbstractApp if such as store is
|
318
|
|
- * not defined by the consumer of this AbstractApp through its
|
319
|
|
- * read-only React Component props.
|
|
315
|
+ * Creates a redux store to be used by this {@code AbstractApp} if such as a
|
|
316
|
+ * store is not defined by the consumer of this {@code AbstractApp} through
|
|
317
|
+ * its read-only React {@code Component} props.
|
320
|
318
|
*
|
321
|
|
- * @param {Object} props - The read-only React Component props that will
|
322
|
|
- * eventually be received by this AbstractApp.
|
|
319
|
+ * @param {Object} props - The read-only React {@code Component} props that
|
|
320
|
+ * will eventually be received by this {@code AbstractApp}.
|
323
|
321
|
* @private
|
324
|
|
- * @returns {Store} - The Redux store to be used by this AbstractApp.
|
|
322
|
+ * @returns {Store} - The redux store to be used by this
|
|
323
|
+ * {@code AbstractApp}.
|
325
|
324
|
*/
|
326
|
325
|
_maybeCreateStore(props) {
|
327
|
|
- // The application Jitsi Meet is architected with Redux. However, I do
|
|
326
|
+ // The application Jitsi Meet is architected with redux. However, I do
|
328
|
327
|
// not want consumers of the App React Component to be forced into
|
329
|
|
- // dealing with Redux. If the consumer did not provide an external Redux
|
330
|
|
- // store, utilize an internal Redux store.
|
|
328
|
+ // dealing with redux. If the consumer did not provide an external redux
|
|
329
|
+ // store, utilize an internal redux store.
|
331
|
330
|
let store = props.store;
|
332
|
331
|
|
333
|
332
|
if (typeof store === 'undefined') {
|
|
@@ -380,7 +379,7 @@ export class AbstractApp extends Component {
|
380
|
379
|
}
|
381
|
380
|
|
382
|
381
|
/**
|
383
|
|
- * Notifies this App that a specific Route is about to be rendered.
|
|
382
|
+ * Notifies this {@code App} that a specific Route is about to be rendered.
|
384
|
383
|
*
|
385
|
384
|
* @param {Route} route - The Route that is about to be rendered.
|
386
|
385
|
* @private
|
|
@@ -394,10 +393,10 @@ export class AbstractApp extends Component {
|
394
|
393
|
}
|
395
|
394
|
|
396
|
395
|
/**
|
397
|
|
- * Navigates this AbstractApp to (i.e. opens) a specific URL.
|
|
396
|
+ * Navigates this {@code AbstractApp} to (i.e. opens) a specific URL.
|
398
|
397
|
*
|
399
|
|
- * @param {string|Object} url - The URL to navigate this AbstractApp to
|
400
|
|
- * (i.e. the URL to open).
|
|
398
|
+ * @param {string|Object} url - The URL to navigate this {@code AbstractApp}
|
|
399
|
+ * to (i.e. the URL to open).
|
401
|
400
|
* @protected
|
402
|
401
|
* @returns {void}
|
403
|
402
|
*/
|