@iebh/tera-fy 1.4.4 → 1.6.0
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/CHANGELOG.md +26 -0
- package/api.md +278 -243
- package/dist/plugin.vue2.es2019.js +1 -1
- package/dist/terafy.es2019.js +2 -2
- package/dist/terafy.js +2 -2
- package/lib/terafy.client.js +40 -3
- package/lib/terafy.server.js +60 -3
- package/package.json +6 -3
- package/plugins/vue2.js +5 -3
package/api.md
CHANGED
|
@@ -99,34 +99,38 @@
|
|
|
99
99
|
* [Parameters][95]
|
|
100
100
|
* [setProjectStateDefaults][96]
|
|
101
101
|
* [Parameters][97]
|
|
102
|
-
* [
|
|
103
|
-
* [
|
|
104
|
-
|
|
105
|
-
* [
|
|
102
|
+
* [setProjectStateFlush][98]
|
|
103
|
+
* [setProjectStateRefresh][99]
|
|
104
|
+
* [saveProjectState][100]
|
|
105
|
+
* [replaceProjectState][101]
|
|
106
106
|
* [Parameters][102]
|
|
107
|
-
* [
|
|
108
|
-
* [
|
|
109
|
-
|
|
110
|
-
* [
|
|
111
|
-
* [
|
|
112
|
-
* [
|
|
107
|
+
* [applyProjectStatePatch][103]
|
|
108
|
+
* [Parameters][104]
|
|
109
|
+
* [subscribeProjectState][105]
|
|
110
|
+
* [FileFilters][106]
|
|
111
|
+
* [Properties][107]
|
|
112
|
+
* [selectProjectFile][108]
|
|
113
113
|
* [Parameters][109]
|
|
114
|
-
* [
|
|
114
|
+
* [setProjectFile][110]
|
|
115
115
|
* [Parameters][111]
|
|
116
|
-
* [
|
|
116
|
+
* [selectProjectLibrary][112]
|
|
117
117
|
* [Parameters][113]
|
|
118
|
-
* [
|
|
118
|
+
* [getProjectLibrary][114]
|
|
119
119
|
* [Parameters][115]
|
|
120
|
-
* [
|
|
120
|
+
* [setProjectLibrary][116]
|
|
121
121
|
* [Parameters][117]
|
|
122
|
-
* [
|
|
122
|
+
* [projectLog][118]
|
|
123
123
|
* [Parameters][119]
|
|
124
|
-
* [
|
|
124
|
+
* [setPageUrl][120]
|
|
125
125
|
* [Parameters][121]
|
|
126
|
-
* [
|
|
126
|
+
* [setPageTitle][122]
|
|
127
127
|
* [Parameters][123]
|
|
128
|
-
* [
|
|
128
|
+
* [uiAlert][124]
|
|
129
129
|
* [Parameters][125]
|
|
130
|
+
* [uiSplat][126]
|
|
131
|
+
* [Parameters][127]
|
|
132
|
+
* [uiWindow][128]
|
|
133
|
+
* [Parameters][129]
|
|
130
134
|
|
|
131
135
|
## ProjectFile
|
|
132
136
|
|
|
@@ -136,99 +140,99 @@ A project file fetched from TERA
|
|
|
136
140
|
|
|
137
141
|
A UUID string representing the unique ID of the file
|
|
138
142
|
|
|
139
|
-
Type: [String][
|
|
143
|
+
Type: [String][130]
|
|
140
144
|
|
|
141
145
|
### name
|
|
142
146
|
|
|
143
147
|
Relative name path (can contain prefix directories) for the human readable file name
|
|
144
148
|
|
|
145
|
-
Type: [String][
|
|
149
|
+
Type: [String][130]
|
|
146
150
|
|
|
147
151
|
### icon
|
|
148
152
|
|
|
149
153
|
CSS class to use as the file icon
|
|
150
154
|
|
|
151
|
-
Type: [String][
|
|
155
|
+
Type: [String][130]
|
|
152
156
|
|
|
153
157
|
### path
|
|
154
158
|
|
|
155
159
|
Full path to the file
|
|
156
160
|
This is also used as the unique identifier within the project
|
|
157
161
|
|
|
158
|
-
Type: [String][
|
|
162
|
+
Type: [String][130]
|
|
159
163
|
|
|
160
164
|
### parsedName
|
|
161
165
|
|
|
162
166
|
An object representing meta file parts of a file name
|
|
163
167
|
|
|
164
|
-
Type: [Object][
|
|
168
|
+
Type: [Object][131]
|
|
165
169
|
|
|
166
170
|
#### Properties
|
|
167
171
|
|
|
168
|
-
* `basename` **[String][
|
|
169
|
-
* `filename` **[String][
|
|
170
|
-
* `ext` **[String][
|
|
171
|
-
* `dirName` **[String][
|
|
172
|
+
* `basename` **[String][130]** The filename + extention (i.e. everything without directory name)
|
|
173
|
+
* `filename` **[String][130]** The file portion of the name (basename without the extension)
|
|
174
|
+
* `ext` **[String][130]** The extension portion of the name (always lower case)
|
|
175
|
+
* `dirName` **[String][130]** The directory path portion of the name
|
|
172
176
|
|
|
173
177
|
### created
|
|
174
178
|
|
|
175
179
|
A date representing when the file was created
|
|
176
180
|
|
|
177
|
-
Type: [Date][
|
|
181
|
+
Type: [Date][132]
|
|
178
182
|
|
|
179
183
|
### createdFormatted
|
|
180
184
|
|
|
181
185
|
A human readable, formatted version of "created"
|
|
182
186
|
|
|
183
|
-
Type: [String][
|
|
187
|
+
Type: [String][130]
|
|
184
188
|
|
|
185
189
|
### modified
|
|
186
190
|
|
|
187
191
|
A date representing when the file was created
|
|
188
192
|
|
|
189
|
-
Type: [Date][
|
|
193
|
+
Type: [Date][132]
|
|
190
194
|
|
|
191
195
|
### modifiedFormatted
|
|
192
196
|
|
|
193
197
|
A human readable, formatted version of "modified"
|
|
194
198
|
|
|
195
|
-
Type: [String][
|
|
199
|
+
Type: [String][130]
|
|
196
200
|
|
|
197
201
|
### accessed
|
|
198
202
|
|
|
199
203
|
A date representing when the file was last accessed
|
|
200
204
|
|
|
201
|
-
Type: [Date][
|
|
205
|
+
Type: [Date][132]
|
|
202
206
|
|
|
203
207
|
### accessedFormatted
|
|
204
208
|
|
|
205
209
|
A human readable, formatted version of "accessed"
|
|
206
210
|
|
|
207
|
-
Type: [String][
|
|
211
|
+
Type: [String][130]
|
|
208
212
|
|
|
209
213
|
### size
|
|
210
214
|
|
|
211
215
|
Size, in bytes, of the file
|
|
212
216
|
|
|
213
|
-
Type: [Number][
|
|
217
|
+
Type: [Number][133]
|
|
214
218
|
|
|
215
219
|
### sizeFormatted
|
|
216
220
|
|
|
217
221
|
A human readable, formatted version of the file size
|
|
218
222
|
|
|
219
|
-
Type: [String][
|
|
223
|
+
Type: [String][130]
|
|
220
224
|
|
|
221
225
|
### mime
|
|
222
226
|
|
|
223
227
|
The associated mime type for the file
|
|
224
228
|
|
|
225
|
-
Type: [String][
|
|
229
|
+
Type: [String][130]
|
|
226
230
|
|
|
227
231
|
### meta
|
|
228
232
|
|
|
229
233
|
Additional meta information for the file
|
|
230
234
|
|
|
231
|
-
Type: [Object][
|
|
235
|
+
Type: [Object][131]
|
|
232
236
|
|
|
233
237
|
### getContents
|
|
234
238
|
|
|
@@ -246,9 +250,9 @@ Overwrite the contents of a file with new content
|
|
|
246
250
|
|
|
247
251
|
#### Parameters
|
|
248
252
|
|
|
249
|
-
* `contents` **(File | [Blob][
|
|
253
|
+
* `contents` **(File | [Blob][134] | [FormData][135] | [Object][131] | [Array][136])** The new file contents
|
|
250
254
|
|
|
251
|
-
Returns **[Promise][
|
|
255
|
+
Returns **[Promise][137]** A promise which resolves when the operation has completed
|
|
252
256
|
|
|
253
257
|
### getRefs
|
|
254
258
|
|
|
@@ -256,7 +260,7 @@ Returns **[Promise][133]** A promise which resolves when the operation has compl
|
|
|
256
260
|
|
|
257
261
|
Fetch the file contents as an array of Reflib refs
|
|
258
262
|
|
|
259
|
-
Returns **[Promise][
|
|
263
|
+
Returns **[Promise][137]<[Array][136]\<Ref>>** An eventual array of RefLib references
|
|
260
264
|
|
|
261
265
|
### setRefs
|
|
262
266
|
|
|
@@ -267,18 +271,18 @@ Overwrite the contents of a file with a new collection of Reflib refs
|
|
|
267
271
|
#### Parameters
|
|
268
272
|
|
|
269
273
|
* `refs`  
|
|
270
|
-
* `Collection` **[Array][
|
|
274
|
+
* `Collection` **[Array][136]\<RefLibRef>** of references for the selected library
|
|
271
275
|
|
|
272
|
-
Returns **[Promise][
|
|
276
|
+
Returns **[Promise][137]** A promise which resolves when the operation has completed
|
|
273
277
|
|
|
274
278
|
### serialize
|
|
275
279
|
|
|
276
|
-
* **See**: [https://developer.mozilla.org/en-US/docs/Web/API/Web\_Workers\_API/Structured\_clone\_algorithm][
|
|
280
|
+
* **See**: [https://developer.mozilla.org/en-US/docs/Web/API/Web\_Workers\_API/Structured\_clone\_algorithm][138]
|
|
277
281
|
|
|
278
282
|
Compress a file state down into a serializable entity
|
|
279
283
|
By default this computes a Structured Clone which can be stringified
|
|
280
284
|
|
|
281
|
-
Returns **[Object][
|
|
285
|
+
Returns **[Object][131]** A Structured Clone compatible representation of this ProjectFile instance
|
|
282
286
|
|
|
283
287
|
### deserialize
|
|
284
288
|
|
|
@@ -286,7 +290,7 @@ Restore an entity created with serialize
|
|
|
286
290
|
|
|
287
291
|
#### Parameters
|
|
288
292
|
|
|
289
|
-
* `data` **[Object][
|
|
293
|
+
* `data` **[Object][131]** An input object created via `ProjectFiles.serialize()`
|
|
290
294
|
|
|
291
295
|
Returns **[ProjectFile][1]** A ProjectFile instance setup against the deserializzed data
|
|
292
296
|
|
|
@@ -306,19 +310,19 @@ Main Tera-Fy Client (class singleton) to be used in a frontend browser
|
|
|
306
310
|
|
|
307
311
|
Various settings to configure behaviour
|
|
308
312
|
|
|
309
|
-
Type: [Object][
|
|
313
|
+
Type: [Object][131]
|
|
310
314
|
|
|
311
315
|
#### Properties
|
|
312
316
|
|
|
313
|
-
* `devMode` **[Boolean][
|
|
314
|
-
* `verbosity` **[Number][
|
|
317
|
+
* `devMode` **[Boolean][139]** Operate in devMode - i.e. force outer refresh when encountering an existing TeraFy instance
|
|
318
|
+
* `verbosity` **[Number][133]** Verbosity level, the higher the more chatty TeraFY will be. Set to zero to disable all `debug()` call output
|
|
315
319
|
* `mode` **(`"detect"` | `"parent"` | `"child"` | `"popup"`)** How to communicate with TERA. 'parent' assumes that the parent of the current document is TERA, 'child' spawns an iFrame and uses TERA there, 'detect' tries parent and switches to `modeFallback` if communication fails
|
|
316
|
-
* `modeFallback` **[String][
|
|
317
|
-
* `modeTimeout` **[Number][
|
|
318
|
-
* `siteUrl` **[String][
|
|
319
|
-
* `restrictOrigin` **[String][
|
|
320
|
-
* `List` **[Array][
|
|
321
|
-
* `handshakeInterval` **[Number][
|
|
320
|
+
* `modeFallback` **[String][130]** Method to use when all method detection fails
|
|
321
|
+
* `modeTimeout` **[Number][133]** How long entities have in 'detect' mode to identify themselves
|
|
322
|
+
* `siteUrl` **[String][130]** The TERA URL to connect to
|
|
323
|
+
* `restrictOrigin` **[String][130]** URL to restrict communications to
|
|
324
|
+
* `List` **[Array][136]<[String][130]>** of sandbox allowables for the embedded if in embed mode
|
|
325
|
+
* `handshakeInterval` **[Number][133]** Interval in milliseconds when sanning for a handshake
|
|
322
326
|
|
|
323
327
|
### events
|
|
324
328
|
|
|
@@ -330,13 +334,13 @@ Type: Mitt
|
|
|
330
334
|
|
|
331
335
|
DOMElements for this TeraFy instance
|
|
332
336
|
|
|
333
|
-
Type: [Object][
|
|
337
|
+
Type: [Object][131]
|
|
334
338
|
|
|
335
339
|
#### Properties
|
|
336
340
|
|
|
337
341
|
* `el` **DOMElement** The main tera-fy div wrapper
|
|
338
342
|
* `iframe` **DOMElement** The internal iFrame element (if `settings.mode == 'child'`)
|
|
339
|
-
* `popup` **[Window][
|
|
343
|
+
* `popup` **[Window][140]** The popup window context (if `settings.mode == 'popup'`)
|
|
340
344
|
* `stylesheet` **DOMElement** The corresponding stylesheet
|
|
341
345
|
|
|
342
346
|
### methods
|
|
@@ -344,13 +348,13 @@ Type: [Object][127]
|
|
|
344
348
|
List of function stubs mapped from the server to here
|
|
345
349
|
This array is forms the reference of `TeraFy.METHOD()` objects to provide locally which will be mapped via `TeraFy.rpc(METHOD, ...args)`
|
|
346
350
|
|
|
347
|
-
Type: [Array][
|
|
351
|
+
Type: [Array][136]<[String][130]>
|
|
348
352
|
|
|
349
353
|
### plugins
|
|
350
354
|
|
|
351
355
|
Loaded plugins via Use()
|
|
352
356
|
|
|
353
|
-
Type: [Array][
|
|
357
|
+
Type: [Array][136]\<TeraFyPlugin>
|
|
354
358
|
|
|
355
359
|
### send
|
|
356
360
|
|
|
@@ -358,9 +362,9 @@ Send a message + wait for a response object
|
|
|
358
362
|
|
|
359
363
|
#### Parameters
|
|
360
364
|
|
|
361
|
-
* `message` **[Object][
|
|
365
|
+
* `message` **[Object][131]** Message object to send
|
|
362
366
|
|
|
363
|
-
Returns **[Promise][
|
|
367
|
+
Returns **[Promise][137]\<any>** A promise which resolves when the operation has completed with the remote reply
|
|
364
368
|
|
|
365
369
|
### sendRaw
|
|
366
370
|
|
|
@@ -369,7 +373,7 @@ This function does not return or wait for a reply - use `send()` for that
|
|
|
369
373
|
|
|
370
374
|
#### Parameters
|
|
371
375
|
|
|
372
|
-
* `message` **[Object][
|
|
376
|
+
* `message` **[Object][131]** Message object to send
|
|
373
377
|
|
|
374
378
|
### rpc
|
|
375
379
|
|
|
@@ -377,10 +381,10 @@ Call an RPC function in the server instance
|
|
|
377
381
|
|
|
378
382
|
#### Parameters
|
|
379
383
|
|
|
380
|
-
* `method` **[String][
|
|
384
|
+
* `method` **[String][130]** The method name to call
|
|
381
385
|
* `args` **...any** 
|
|
382
386
|
|
|
383
|
-
Returns **[Promise][
|
|
387
|
+
Returns **[Promise][137]\<any>** The resolved output of the server function
|
|
384
388
|
|
|
385
389
|
### acceptMessage
|
|
386
390
|
|
|
@@ -389,7 +393,7 @@ Accept an incoming message
|
|
|
389
393
|
#### Parameters
|
|
390
394
|
|
|
391
395
|
* `rawMessage`  
|
|
392
|
-
* `Raw` **[MessageEvent][
|
|
396
|
+
* `Raw` **[MessageEvent][141]** message event to process
|
|
393
397
|
|
|
394
398
|
### acceptPostboxes
|
|
395
399
|
|
|
@@ -398,27 +402,27 @@ Listening postboxes, these correspond to outgoing message IDs that expect a resp
|
|
|
398
402
|
### createProjectStatePatch
|
|
399
403
|
|
|
400
404
|
Create + transmit a new project state patch base on the current and previous states
|
|
401
|
-
The transmitted patch follows the [JSPatch][
|
|
405
|
+
The transmitted patch follows the [JSPatch][142] standard
|
|
402
406
|
This function accepts an entire projectState instance, computes the delta and transmits that to the server for merging
|
|
403
407
|
|
|
404
408
|
#### Parameters
|
|
405
409
|
|
|
406
|
-
* `newState` **[Object][
|
|
407
|
-
* `oldState` **[Object][
|
|
410
|
+
* `newState` **[Object][131]** The local projectState to accept
|
|
411
|
+
* `oldState` **[Object][131]** The previous projectState to examine against
|
|
408
412
|
|
|
409
|
-
Returns **[Promise][
|
|
413
|
+
Returns **[Promise][137]** A promise which will resolve when the operation has completed
|
|
410
414
|
|
|
411
415
|
### applyProjectStatePatchLocal
|
|
412
416
|
|
|
413
417
|
Client function which accepts a patch from the server and applies it to local project state
|
|
414
|
-
The patch should follow the [JSPatch][
|
|
418
|
+
The patch should follow the [JSPatch][142] standard
|
|
415
419
|
This function is expected to be sub-classed by a plugin
|
|
416
420
|
|
|
417
421
|
#### Parameters
|
|
418
422
|
|
|
419
|
-
* `patch` **[Array][
|
|
423
|
+
* `patch` **[Array][136]** A JSPatch patch to apply
|
|
420
424
|
|
|
421
|
-
Returns **[Promise][
|
|
425
|
+
Returns **[Promise][137]** A promise which will resolve when the operation has completed
|
|
422
426
|
|
|
423
427
|
### init
|
|
424
428
|
|
|
@@ -427,28 +431,28 @@ This function can only be called once and will return the existing init() worker
|
|
|
427
431
|
|
|
428
432
|
#### Parameters
|
|
429
433
|
|
|
430
|
-
* `options` **[Object][
|
|
434
|
+
* `options` **[Object][131]?** Additional options to merge into `settings` via `set`
|
|
431
435
|
|
|
432
|
-
Returns **[Promise][
|
|
436
|
+
Returns **[Promise][137]<[TeraFy][29]>** An eventual promise which will resovle with this terafy instance
|
|
433
437
|
|
|
434
438
|
### detectMode
|
|
435
439
|
|
|
436
440
|
Populate `settings.mode`
|
|
437
441
|
Try to communicate with a parent frame, if none assume we need to fallback to child mode
|
|
438
442
|
|
|
439
|
-
Returns **[Promise][
|
|
443
|
+
Returns **[Promise][137]<[String][130]>** A promise which will resolve with the detected mode to use
|
|
440
444
|
|
|
441
445
|
### injectComms
|
|
442
446
|
|
|
443
447
|
Find an existing active TERA server OR initalize one
|
|
444
448
|
|
|
445
|
-
Returns **[Promise][
|
|
449
|
+
Returns **[Promise][137]** A promise which will resolve when the loading has completed and we have found a parent TERA instance or initiallized a child
|
|
446
450
|
|
|
447
451
|
### injectStylesheet
|
|
448
452
|
|
|
449
453
|
Inject a local stylesheet to handle TERA server functionality
|
|
450
454
|
|
|
451
|
-
Returns **[Promise][
|
|
455
|
+
Returns **[Promise][137]** A promise which will resolve when the loading has completed and we have found a parent TERA instance or initiallized a child
|
|
452
456
|
|
|
453
457
|
### injectMethods
|
|
454
458
|
|
|
@@ -463,7 +467,7 @@ This function will only act if `settings.devMode` is truthy
|
|
|
463
467
|
|
|
464
468
|
* `msg` **...any** 
|
|
465
469
|
* `method` **(`"INFO"` | `"LOG"` | `"WARN"` | `"ERROR"`)** Logging method to use (optional, default `'LOG'`)
|
|
466
|
-
* `verboseLevel` **[Number][
|
|
470
|
+
* `verboseLevel` **[Number][133]** The verbosity level to trigger at. If `settings.verbosity` is lower than this, the message is ignored (optional, default `1`)
|
|
467
471
|
|
|
468
472
|
### set
|
|
469
473
|
|
|
@@ -472,7 +476,7 @@ This function also routes 'special' keys like `devMode` to their internal handle
|
|
|
472
476
|
|
|
473
477
|
#### Parameters
|
|
474
478
|
|
|
475
|
-
* `key` **([String][
|
|
479
|
+
* `key` **([String][130] | [Object][131])** Either a single setting key to set or an object to merge
|
|
476
480
|
* `value` **any** The value to set if `key` is a string
|
|
477
481
|
|
|
478
482
|
Returns **[TeraFy][29]** This chainable terafy instance
|
|
@@ -485,7 +489,7 @@ Set or merge settings - but only in dev mode and only if the value is not undefi
|
|
|
485
489
|
|
|
486
490
|
#### Parameters
|
|
487
491
|
|
|
488
|
-
* `key` **([String][
|
|
492
|
+
* `key` **([String][130] | [Object][131])** Either a single setting key to set or an object to merge
|
|
489
493
|
* `value` **any** The value to set if `key` is a string
|
|
490
494
|
|
|
491
495
|
Returns **[TeraFy][29]** This chainable terafy instance
|
|
@@ -497,8 +501,8 @@ Include a TeraFy client plugin
|
|
|
497
501
|
#### Parameters
|
|
498
502
|
|
|
499
503
|
* `mod`  
|
|
500
|
-
* `options` **[Object][
|
|
501
|
-
* `The` **[Object][
|
|
504
|
+
* `options` **[Object][131]?** Additional options to mutate behaviour during construction (pass options to init() to intialize later options)
|
|
505
|
+
* `The` **[Object][131]** module function to include. Invoked as `(teraClient:TeraFy, options:Object)`
|
|
502
506
|
|
|
503
507
|
Returns **[TeraFy][29]** This chainable terafy instance
|
|
504
508
|
|
|
@@ -508,8 +512,8 @@ Internal function used by use() to merge an external declared singleton against
|
|
|
508
512
|
|
|
509
513
|
#### Parameters
|
|
510
514
|
|
|
511
|
-
* `target` **[Object][
|
|
512
|
-
* `source` **[Object][
|
|
515
|
+
* `target` **[Object][131]** Initalied class instance to extend
|
|
516
|
+
* `source` **[Object][131]** Initalized source object to extend from
|
|
513
517
|
|
|
514
518
|
### toggleDevMode
|
|
515
519
|
|
|
@@ -517,7 +521,7 @@ Set or toggle devMode
|
|
|
517
521
|
|
|
518
522
|
#### Parameters
|
|
519
523
|
|
|
520
|
-
* `devModeEnabled` **([String][
|
|
524
|
+
* `devModeEnabled` **([String][130] | [Boolean][139])** Optional boolean to force dev mode (optional, default `'toggle'`)
|
|
521
525
|
|
|
522
526
|
Returns **[TeraFy][29]** This chainable terafy instance
|
|
523
527
|
|
|
@@ -528,7 +532,7 @@ This is usually because the server component wants to perform some user activity
|
|
|
528
532
|
|
|
529
533
|
#### Parameters
|
|
530
534
|
|
|
531
|
-
* `isFocused` **([String][
|
|
535
|
+
* `isFocused` **([String][130] | [Boolean][139])** Whether to fullscreen the embedded component (optional, default `'toggle'`)
|
|
532
536
|
|
|
533
537
|
### selectProjectFile
|
|
534
538
|
|
|
@@ -540,7 +544,7 @@ This is an pre-requisite step for requireProject()
|
|
|
540
544
|
|
|
541
545
|
* `options`  
|
|
542
546
|
|
|
543
|
-
Returns **[Promise][
|
|
547
|
+
Returns **[Promise][137]** A promise which will resolve if the there is a user and they are logged in
|
|
544
548
|
|
|
545
549
|
### getProjectFiles
|
|
546
550
|
|
|
@@ -548,12 +552,12 @@ Fetch the files associated with a given project
|
|
|
548
552
|
|
|
549
553
|
#### Parameters
|
|
550
554
|
|
|
551
|
-
* `options` **[Object][
|
|
555
|
+
* `options` **[Object][131]** Options which mutate behaviour
|
|
552
556
|
|
|
553
|
-
* `options.autoRequire` **[Boolean][
|
|
554
|
-
* `options.meta` **[Boolean][
|
|
557
|
+
* `options.autoRequire` **[Boolean][139]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
558
|
+
* `options.meta` **[Boolean][139]** Pull meta information for each file entity (optional, default `true`)
|
|
555
559
|
|
|
556
|
-
Returns **[Promise][
|
|
560
|
+
Returns **[Promise][137]<[Array][136]<[ProjectFile][1]>>** A collection of project files for the given project
|
|
557
561
|
|
|
558
562
|
### getProjectFile
|
|
559
563
|
|
|
@@ -561,9 +565,9 @@ Fetch a project file
|
|
|
561
565
|
|
|
562
566
|
#### Parameters
|
|
563
567
|
|
|
564
|
-
* `path` **[String][
|
|
568
|
+
* `path` **[String][130]** File path to read
|
|
565
569
|
|
|
566
|
-
Returns **[Promise][
|
|
570
|
+
Returns **[Promise][137]<[Blob][134]>** The eventual fetched file as a blob
|
|
567
571
|
|
|
568
572
|
## handshake
|
|
569
573
|
|
|
@@ -571,9 +575,9 @@ Return basic server information as a form of validation
|
|
|
571
575
|
|
|
572
576
|
### Properties
|
|
573
577
|
|
|
574
|
-
* `date` **[Date][
|
|
578
|
+
* `date` **[Date][132]** Server date
|
|
575
579
|
|
|
576
|
-
Returns **[Promise][
|
|
580
|
+
Returns **[Promise][137]<[Object][131]>** Basic promise result
|
|
577
581
|
|
|
578
582
|
## User
|
|
579
583
|
|
|
@@ -581,16 +585,16 @@ User / active session within TERA
|
|
|
581
585
|
|
|
582
586
|
### Properties
|
|
583
587
|
|
|
584
|
-
* `id` **[String][
|
|
585
|
-
* `email` **[String][
|
|
586
|
-
* `name` **[String][
|
|
587
|
-
* `isSubscribed` **[Boolean][
|
|
588
|
+
* `id` **[String][130]** Unique identifier of the user
|
|
589
|
+
* `email` **[String][130]** The email address of the current user
|
|
590
|
+
* `name` **[String][130]** The provided full name of the user
|
|
591
|
+
* `isSubscribed` **[Boolean][139]** Whether the active user has a TERA subscription
|
|
588
592
|
|
|
589
593
|
## getUser
|
|
590
594
|
|
|
591
595
|
Fetch the current session user
|
|
592
596
|
|
|
593
|
-
Returns **[Promise][
|
|
597
|
+
Returns **[Promise][137]<[User][78]>** The current logged in user or null if none
|
|
594
598
|
|
|
595
599
|
## requireUser
|
|
596
600
|
|
|
@@ -600,11 +604,11 @@ This is an pre-requisite step for requireProject()
|
|
|
600
604
|
|
|
601
605
|
### Parameters
|
|
602
606
|
|
|
603
|
-
* `options` **[Object][
|
|
607
|
+
* `options` **[Object][131]?** Additional options to mutate behaviour
|
|
604
608
|
|
|
605
|
-
* `options.forceRetry` **[Boolean][
|
|
609
|
+
* `options.forceRetry` **[Boolean][139]** Forcabily try to refresh the user state (optional, default `false`)
|
|
606
610
|
|
|
607
|
-
Returns **[Promise][
|
|
611
|
+
Returns **[Promise][137]<[User][78]>** The current logged in user or null if none
|
|
608
612
|
|
|
609
613
|
## Project
|
|
610
614
|
|
|
@@ -614,13 +618,13 @@ Project entry within TERA
|
|
|
614
618
|
|
|
615
619
|
Get the currently active project, if any
|
|
616
620
|
|
|
617
|
-
Returns **[Promise][
|
|
621
|
+
Returns **[Promise][137]<([Project][83] | null)>** The currently active project, if any
|
|
618
622
|
|
|
619
623
|
## getProjects
|
|
620
624
|
|
|
621
625
|
Get a list of projects the current session user has access to
|
|
622
626
|
|
|
623
|
-
Returns **[Promise][
|
|
627
|
+
Returns **[Promise][137]<[Array][136]<[Project][83]>>** Collection of projects the user has access to
|
|
624
628
|
|
|
625
629
|
## setActiveProject
|
|
626
630
|
|
|
@@ -628,7 +632,7 @@ Set the currently active project within TERA
|
|
|
628
632
|
|
|
629
633
|
### Parameters
|
|
630
634
|
|
|
631
|
-
* `project` **([Object][
|
|
635
|
+
* `project` **([Object][131] | [String][130])** The project to set as active - either the full Project object or its ID
|
|
632
636
|
|
|
633
637
|
## requireProject
|
|
634
638
|
|
|
@@ -637,14 +641,14 @@ Note that this function will percist in asking the uesr even if they try to canc
|
|
|
637
641
|
|
|
638
642
|
### Parameters
|
|
639
643
|
|
|
640
|
-
* `options` **[Object][
|
|
644
|
+
* `options` **[Object][131]?** Additional options to mutate behaviour
|
|
641
645
|
|
|
642
|
-
* `options.autoSetActiveProject` **[Boolean][
|
|
643
|
-
* `options.title` **[String][
|
|
644
|
-
* `options.noSelectTitle` **[String][
|
|
645
|
-
* `options.noSelectBody` **[String][
|
|
646
|
+
* `options.autoSetActiveProject` **[Boolean][139]** After selecting a project set that project as active in TERA (optional, default `true`)
|
|
647
|
+
* `options.title` **[String][130]** The title of the dialog to display (optional, default `"Select a project to work with"`)
|
|
648
|
+
* `options.noSelectTitle` **[String][130]** Dialog title when warning the user they need to select something (optional, default `'Select project'`)
|
|
649
|
+
* `options.noSelectBody` **[String][130]** Dialog body when warning the user they need to select something (optional, default `'A project needs to be selected to continue'`)
|
|
646
650
|
|
|
647
|
-
Returns **[Promise][
|
|
651
|
+
Returns **[Promise][137]<[Project][83]>** The active project
|
|
648
652
|
|
|
649
653
|
## selectProject
|
|
650
654
|
|
|
@@ -652,13 +656,13 @@ Prompt the user to select a project from those available
|
|
|
652
656
|
|
|
653
657
|
### Parameters
|
|
654
658
|
|
|
655
|
-
* `options` **[Object][
|
|
659
|
+
* `options` **[Object][131]?** Additional options to mutate behaviour
|
|
656
660
|
|
|
657
|
-
* `options.title` **[String][
|
|
658
|
-
* `options.allowCancel` **[Boolean][
|
|
659
|
-
* `options.setActive` **[Boolean][
|
|
661
|
+
* `options.title` **[String][130]** The title of the dialog to display (optional, default `"Select a project to work with"`)
|
|
662
|
+
* `options.allowCancel` **[Boolean][139]** Advertise cancelling the operation, the dialog can still be cancelled by closing it (optional, default `true`)
|
|
663
|
+
* `options.setActive` **[Boolean][139]** Also set the project as active when selected (optional, default `false`)
|
|
660
664
|
|
|
661
|
-
Returns **[Promise][
|
|
665
|
+
Returns **[Promise][137]<[Project][83]>** The active project
|
|
662
666
|
|
|
663
667
|
## getProjectState
|
|
664
668
|
|
|
@@ -666,12 +670,12 @@ Return the current, full snapshot state of the active project
|
|
|
666
670
|
|
|
667
671
|
### Parameters
|
|
668
672
|
|
|
669
|
-
* `options` **[Object][
|
|
673
|
+
* `options` **[Object][131]?** Additional options to mutate behaviour
|
|
670
674
|
|
|
671
|
-
* `options.autoRequire` **[Boolean][
|
|
672
|
-
* `Paths` **[Array][
|
|
675
|
+
* `options.autoRequire` **[Boolean][139]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
676
|
+
* `Paths` **[Array][136]<[String][130]>** to subscribe to e.g. \['/users/'],
|
|
673
677
|
|
|
674
|
-
Returns **[Promise][
|
|
678
|
+
Returns **[Promise][137]<[Object][131]>** The current project state snapshot
|
|
675
679
|
|
|
676
680
|
## setProjectState
|
|
677
681
|
|
|
@@ -683,13 +687,13 @@ Paths can be any valid Lodash.set() value such as:
|
|
|
683
687
|
|
|
684
688
|
### Parameters
|
|
685
689
|
|
|
686
|
-
* `path` **([String][
|
|
690
|
+
* `path` **([String][130] | [Array][136]<[String][130]>)** The sub-path within the project state to set
|
|
687
691
|
* `value` **any** The value to set
|
|
688
|
-
* `options` **[Object][
|
|
692
|
+
* `options` **[Object][131]?** Additional options to mutate behaviour
|
|
689
693
|
|
|
690
|
-
* `options.save` **[Boolean][
|
|
694
|
+
* `options.save` **[Boolean][139]** Save the changes to the server immediately, disable to queue up multiple writes (optional, default `true`)
|
|
691
695
|
|
|
692
|
-
Returns **[Promise][
|
|
696
|
+
Returns **[Promise][137]** A promise which resolves when the operation has been dispatched to the server
|
|
693
697
|
|
|
694
698
|
## setProjectStateDefaults
|
|
695
699
|
|
|
@@ -699,17 +703,31 @@ Set a nested value within the project state - just like `setProjectState()` - bu
|
|
|
699
703
|
|
|
700
704
|
### Parameters
|
|
701
705
|
|
|
702
|
-
* `path` **([String][
|
|
706
|
+
* `path` **([String][130] | [Array][136]<[String][130]>)** The sub-path within the project state to set
|
|
703
707
|
* `value` **any** The value to set
|
|
704
|
-
* `options` **[Object][
|
|
708
|
+
* `options` **[Object][131]?** Additional options to mutate behaviour, see setProjectState() for the full list of supported options
|
|
705
709
|
|
|
706
|
-
Returns **[Promise][
|
|
710
|
+
Returns **[Promise][137]<[Boolean][139]>** A promise which resolves to whether any changes were made - True if defaults were applied, false otherwise
|
|
711
|
+
|
|
712
|
+
## setProjectStateFlush
|
|
713
|
+
|
|
714
|
+
Force copying local changes to the server
|
|
715
|
+
This is only ever needed when saving large quantities of data that need to be immediately available
|
|
716
|
+
|
|
717
|
+
Returns **[Promise][137]** A promise which resolves when the operation has completed
|
|
718
|
+
|
|
719
|
+
## setProjectStateRefresh
|
|
720
|
+
|
|
721
|
+
Force refetching the remote project state into local
|
|
722
|
+
This is only ever needed when saving large quantities of data that need to be immediately available
|
|
723
|
+
|
|
724
|
+
Returns **[Promise][137]** A promise which resolves when the operation has completed
|
|
707
725
|
|
|
708
726
|
## saveProjectState
|
|
709
727
|
|
|
710
728
|
Force-Save the currently active project state
|
|
711
729
|
|
|
712
|
-
Returns **[Promise][
|
|
730
|
+
Returns **[Promise][137]** A promise which resolves when the operation has completed
|
|
713
731
|
|
|
714
732
|
## replaceProjectState
|
|
715
733
|
|
|
@@ -720,9 +738,9 @@ You almost never want to use this function directly, see `setProjectState(path,
|
|
|
720
738
|
|
|
721
739
|
### Parameters
|
|
722
740
|
|
|
723
|
-
* `newState` **[Object][
|
|
741
|
+
* `newState` **[Object][131]** The new state to replace the current state with
|
|
724
742
|
|
|
725
|
-
Returns **[Promise][
|
|
743
|
+
Returns **[Promise][137]** A promise which resolves when the operation has completed
|
|
726
744
|
|
|
727
745
|
## applyProjectStatePatch
|
|
728
746
|
|
|
@@ -730,9 +748,9 @@ Apply a computed `just-diff` patch to the current project state
|
|
|
730
748
|
|
|
731
749
|
### Parameters
|
|
732
750
|
|
|
733
|
-
* `Patch` **[Object][
|
|
751
|
+
* `Patch` **[Object][131]** to apply
|
|
734
752
|
|
|
735
|
-
Returns **[Promise][
|
|
753
|
+
Returns **[Promise][137]** A promise which resolves when the operation has completed
|
|
736
754
|
|
|
737
755
|
## subscribeProjectState
|
|
738
756
|
|
|
@@ -740,7 +758,7 @@ Subscribe to project state changes
|
|
|
740
758
|
This will dispatch an RPC call to the source object `applyProjectStatePatchLocal()` function with the patch
|
|
741
759
|
If the above call fails the subscriber is assumed as dead and unsubscribed from the polling list
|
|
742
760
|
|
|
743
|
-
Returns **[Promise][
|
|
761
|
+
Returns **[Promise][137]<[Function][143]>** A promise which resolves when a subscription has been created, call the resulting function to unsubscribe
|
|
744
762
|
|
|
745
763
|
## FileFilters
|
|
746
764
|
|
|
@@ -748,10 +766,10 @@ Data structure for a file filter
|
|
|
748
766
|
|
|
749
767
|
### Properties
|
|
750
768
|
|
|
751
|
-
* `library` **[Boolean][
|
|
752
|
-
* `filename` **[String][
|
|
753
|
-
* `basename` **[String][
|
|
754
|
-
* `ext` **[String][
|
|
769
|
+
* `library` **[Boolean][139]?** Restrict to library files only
|
|
770
|
+
* `filename` **[String][130]?** CSV of @momsfriendlydevco/match expressions to filter the filename by (filenames are the basename sans extension)
|
|
771
|
+
* `basename` **[String][130]?** CSV of @momsfriendlydevco/match expressions to filter the basename by
|
|
772
|
+
* `ext` **[String][130]?** CSV of @momsfriendlydevco/match expressions to filter the file extension by
|
|
755
773
|
|
|
756
774
|
## selectProjectFile
|
|
757
775
|
|
|
@@ -759,20 +777,20 @@ Prompt the user to select a library to operate on
|
|
|
759
777
|
|
|
760
778
|
### Parameters
|
|
761
779
|
|
|
762
|
-
* `options` **[Object][
|
|
780
|
+
* `options` **[Object][131]?** Additional options to mutate behaviour
|
|
763
781
|
|
|
764
|
-
* `options.title` **[String][
|
|
765
|
-
* `options.hint` **([String][
|
|
766
|
-
* `options.save` **[Boolean][
|
|
767
|
-
* `options.filters` **[FileFilters][
|
|
768
|
-
* `options.allowUpload` **[Boolean][
|
|
769
|
-
* `options.allowRefresh` **[Boolean][
|
|
770
|
-
* `options.allowDownloadZip` **[Boolean][
|
|
771
|
-
* `options.allowCancel` **[Boolean][
|
|
772
|
-
* `options.autoRequire` **[Boolean][
|
|
773
|
-
* `options.filter` **[FileFilters][
|
|
782
|
+
* `options.title` **[String][130]** The title of the dialog to display (optional, default `"Select a file"`)
|
|
783
|
+
* `options.hint` **([String][130] | [Array][136]<[String][130]>)?** Hints to identify the file to select in array order of preference
|
|
784
|
+
* `options.save` **[Boolean][139]** Set to truthy if saving a new file, UI will adjust to allowing overwrite OR new file name input (optional, default `false`)
|
|
785
|
+
* `options.filters` **[FileFilters][106]?** Optional file filters
|
|
786
|
+
* `options.allowUpload` **[Boolean][139]** Allow uploading new files (optional, default `true`)
|
|
787
|
+
* `options.allowRefresh` **[Boolean][139]** Allow the user to manually refresh the file list (optional, default `true`)
|
|
788
|
+
* `options.allowDownloadZip` **[Boolean][139]** Allow the user to download a Zip of all files (optional, default `true`)
|
|
789
|
+
* `options.allowCancel` **[Boolean][139]** Allow cancelling the operation. Will throw `'CANCEL'` as the promise rejection if acationed (optional, default `true`)
|
|
790
|
+
* `options.autoRequire` **[Boolean][139]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
791
|
+
* `options.filter` **[FileFilters][106]?** Optional file filters
|
|
774
792
|
|
|
775
|
-
Returns **[Promise][
|
|
793
|
+
Returns **[Promise][137]<[ProjectFile][1]>** The eventually selected file
|
|
776
794
|
|
|
777
795
|
## setProjectFile
|
|
778
796
|
|
|
@@ -780,10 +798,10 @@ Replace a project files contents
|
|
|
780
798
|
|
|
781
799
|
### Parameters
|
|
782
800
|
|
|
783
|
-
* `path` **[String][
|
|
784
|
-
* `contents` **(File | [Blob][
|
|
801
|
+
* `path` **[String][130]** File path to write
|
|
802
|
+
* `contents` **(File | [Blob][134] | [FormData][135] | [Object][131] | [Array][136])** The new file contents
|
|
785
803
|
|
|
786
|
-
Returns **[Promise][
|
|
804
|
+
Returns **[Promise][137]** A promise which will resolve when the write operation has completed
|
|
787
805
|
|
|
788
806
|
## selectProjectLibrary
|
|
789
807
|
|
|
@@ -791,18 +809,18 @@ Prompt the user to select a library to operate on and return a array of referenc
|
|
|
791
809
|
|
|
792
810
|
### Parameters
|
|
793
811
|
|
|
794
|
-
* `options` **[Object][
|
|
812
|
+
* `options` **[Object][131]?** Additional options to mutate behaviour
|
|
795
813
|
|
|
796
|
-
* `options.title` **[String][
|
|
797
|
-
* `options.hint` **([String][
|
|
798
|
-
* `options.allowUpload` **[Boolean][
|
|
799
|
-
* `options.allowRefresh` **[Boolean][
|
|
800
|
-
* `options.allowDownloadZip` **[Boolean][
|
|
801
|
-
* `options.allowCancel` **[Boolean][
|
|
802
|
-
* `options.autoRequire` **[Boolean][
|
|
803
|
-
* `options.filters` **[FileFilters][
|
|
814
|
+
* `options.title` **[String][130]** The title of the dialog to display (optional, default `"Select a citation library"`)
|
|
815
|
+
* `options.hint` **([String][130] | [Array][136]<[String][130]>)?** Hints to identify the library to select in array order of preference. Generally corresponds to the previous stage - e.g. 'deduped', 'review1', 'review2', 'dedisputed'
|
|
816
|
+
* `options.allowUpload` **[Boolean][139]** Allow uploading new files (optional, default `true`)
|
|
817
|
+
* `options.allowRefresh` **[Boolean][139]** Allow the user to manually refresh the file list (optional, default `true`)
|
|
818
|
+
* `options.allowDownloadZip` **[Boolean][139]** Allow the user to download a Zip of all files (optional, default `true`)
|
|
819
|
+
* `options.allowCancel` **[Boolean][139]** Allow cancelling the operation. Will throw `'CANCEL'` as the promise rejection if acationed (optional, default `true`)
|
|
820
|
+
* `options.autoRequire` **[Boolean][139]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
821
|
+
* `options.filters` **[FileFilters][106]?** Optional file filters, defaults to citation library selection only
|
|
804
822
|
|
|
805
|
-
Returns **[Promise][
|
|
823
|
+
Returns **[Promise][137]<[Array][136]\<Ref>>** A collection of references from the selected file
|
|
806
824
|
|
|
807
825
|
## getProjectLibrary
|
|
808
826
|
|
|
@@ -810,15 +828,15 @@ Fetch + convert a project file into a library of citations
|
|
|
810
828
|
|
|
811
829
|
### Parameters
|
|
812
830
|
|
|
813
|
-
* `path` **[String][
|
|
814
|
-
* `options` **[Object][
|
|
831
|
+
* `path` **[String][130]** File path to read, if omitted the contents of `options` are used to guess at a suitable file
|
|
832
|
+
* `options` **[Object][131]?** Additional options to mutate behaviour
|
|
815
833
|
|
|
816
|
-
* `options.format` **[String][
|
|
817
|
-
* `options.autoRequire` **[Boolean][
|
|
818
|
-
* `options.filter` **[Function][
|
|
819
|
-
* `options.find` **[Function][
|
|
834
|
+
* `options.format` **[String][130]** Format for the file. ENUM: 'pojo' (return a parsed JS collection), 'blob' (raw JS Blob object), 'file' (named JS File object) (optional, default `'json'`)
|
|
835
|
+
* `options.autoRequire` **[Boolean][139]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
836
|
+
* `options.filter` **[Function][143]?** Optional async file filter, called each time as `(File:ProjectFile)`
|
|
837
|
+
* `options.find` **[Function][143]?** Optional async final stage file filter to reduce all candidates down to one subject file
|
|
820
838
|
|
|
821
|
-
Returns **([Promise][
|
|
839
|
+
Returns **([Promise][137]<[Array][136]\<Ref>> | [Promise][137]\<any>)** A collection of references (default bevahiour) or a whatever format was requested
|
|
822
840
|
|
|
823
841
|
## setProjectLibrary
|
|
824
842
|
|
|
@@ -826,33 +844,33 @@ Save back a citation library from some input
|
|
|
826
844
|
|
|
827
845
|
### Parameters
|
|
828
846
|
|
|
829
|
-
* `path` **[String][
|
|
830
|
-
* `refs` **([Array][
|
|
831
|
-
* `options` **[Object][
|
|
847
|
+
* `path` **[String][130]?** File path to save back to, if omitted one will be prompted for
|
|
848
|
+
* `refs` **([Array][136]\<RefLibRef> | [Blob][134] | File)?** Collection of references for the selected library or the raw Blob/File
|
|
849
|
+
* `options` **[Object][131]?** Additional options to mutate behaviour
|
|
832
850
|
|
|
833
|
-
* `options.path` **[String][
|
|
834
|
-
* `options.refs` **([Array][
|
|
835
|
-
* `options.format` **[String][
|
|
836
|
-
* `options.autoRequire` **[Boolean][
|
|
837
|
-
* `options.hint` **[String][
|
|
838
|
-
* `options.filename` **[String][
|
|
839
|
-
* `options.title` **[String][
|
|
840
|
-
* `options.overwrite` **[Boolean][
|
|
841
|
-
* `options.meta` **[Object][
|
|
851
|
+
* `options.path` **[String][130]?** Alternate method to specify the path to save as, if omitted one will be prompted for
|
|
852
|
+
* `options.refs` **([Array][136]\<RefLibRef> | [Blob][134] | File)?** Alternate method to specify the refs to save as an array or raw Blob/File
|
|
853
|
+
* `options.format` **[String][130]** Input format used. ENUM: 'pojo' (return a parsed JS collection), 'blob' (raw JS Blob object), 'file' (named JS File object) (optional, default `'json'`)
|
|
854
|
+
* `options.autoRequire` **[Boolean][139]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
855
|
+
* `options.hint` **[String][130]?** Hint to store against the library. Generally corresponds to the current operation being performed - e.g. 'deduped'
|
|
856
|
+
* `options.filename` **[String][130]?** Suggested filename if path is unspecified
|
|
857
|
+
* `options.title` **[String][130]** Dialog title if path is unspecified and we need to prompt (optional, default `'Save citation library'`)
|
|
858
|
+
* `options.overwrite` **[Boolean][139]** Allow existing file upsert (optional, default `true`)
|
|
859
|
+
* `options.meta` **[Object][131]?** Optional meta data to merge into the file data
|
|
842
860
|
|
|
843
|
-
Returns **[Promise][
|
|
861
|
+
Returns **[Promise][137]** A promise which resolves when the save operation has completed
|
|
844
862
|
|
|
845
863
|
## projectLog
|
|
846
864
|
|
|
847
865
|
Create a log entry for the currently active project
|
|
848
866
|
|
|
849
|
-
The required log object can be of various forms. See [https://tera-tools.com/api/logs.json][
|
|
867
|
+
The required log object can be of various forms. See [https://tera-tools.com/api/logs.json][144] for the full list
|
|
850
868
|
|
|
851
869
|
### Parameters
|
|
852
870
|
|
|
853
|
-
* `log` **[Object][
|
|
871
|
+
* `log` **[Object][131]** The log entry to create
|
|
854
872
|
|
|
855
|
-
Returns **[Promise][
|
|
873
|
+
Returns **[Promise][137]** A promise which resolves when the operation has completed
|
|
856
874
|
|
|
857
875
|
## setPageUrl
|
|
858
876
|
|
|
@@ -861,7 +879,16 @@ This only really makes a difference to tools within the tera-tools.com site wher
|
|
|
861
879
|
|
|
862
880
|
### Parameters
|
|
863
881
|
|
|
864
|
-
* `url` **[String][
|
|
882
|
+
* `url` **[String][130]** The URL to restore on next refresh
|
|
883
|
+
|
|
884
|
+
## setPageTitle
|
|
885
|
+
|
|
886
|
+
Set the active page title
|
|
887
|
+
This is usually called by a tool nested within the tera-tools.com embed
|
|
888
|
+
|
|
889
|
+
### Parameters
|
|
890
|
+
|
|
891
|
+
* `title` **[String][130]** The current page title
|
|
865
892
|
|
|
866
893
|
## uiAlert
|
|
867
894
|
|
|
@@ -869,13 +896,13 @@ Display simple text within TERA
|
|
|
869
896
|
|
|
870
897
|
### Parameters
|
|
871
898
|
|
|
872
|
-
* `text` **[String][
|
|
873
|
-
* `options` **[Object][
|
|
899
|
+
* `text` **[String][130]** The text to display
|
|
900
|
+
* `options` **[Object][131]?** Additional options to mutate behaviour
|
|
874
901
|
|
|
875
|
-
* `options.title` **[String][
|
|
876
|
-
* `options.isHtml` **[Boolean][
|
|
902
|
+
* `options.title` **[String][130]** The title of the alert box (optional, default `'TERA'`)
|
|
903
|
+
* `options.isHtml` **[Boolean][139]** If falsy the text is rendered as plain-text otherwise it will be assumed as HTML content (optional, default `false`)
|
|
877
904
|
|
|
878
|
-
Returns **[Promise][
|
|
905
|
+
Returns **[Promise][137]** A promise which resolves when the alert has been dismissed
|
|
879
906
|
|
|
880
907
|
## uiSplat
|
|
881
908
|
|
|
@@ -884,10 +911,10 @@ This function is ideally called within a requestFocus() wrapper
|
|
|
884
911
|
|
|
885
912
|
### Parameters
|
|
886
913
|
|
|
887
|
-
* `content` **(DOMElement | [String][
|
|
888
|
-
* `options` **[Object][
|
|
914
|
+
* `content` **(DOMElement | [String][130] | `false`)** Either a prepared DOM element or string to compile, set to falsy to remove existing content
|
|
915
|
+
* `options` **[Object][131]?** Additional options to mutate behaviour
|
|
889
916
|
|
|
890
|
-
* `options.logo` **([Boolean][
|
|
917
|
+
* `options.logo` **([Boolean][139] | [String][130])** Add a logo to the output, if boolean true the Tera-tools logo is used otherwise specify a path or URL (optional, default `false`)
|
|
891
918
|
|
|
892
919
|
## uiWindow
|
|
893
920
|
|
|
@@ -895,13 +922,13 @@ Open a popup window containing a new site
|
|
|
895
922
|
|
|
896
923
|
### Parameters
|
|
897
924
|
|
|
898
|
-
* `url` **[String][
|
|
899
|
-
* `options` **[Object][
|
|
925
|
+
* `url` **[String][130]** The URL to open
|
|
926
|
+
* `options` **[Object][131]?** Additional options to mutate behaviour
|
|
900
927
|
|
|
901
|
-
* `options.width` **[Number][
|
|
902
|
-
* `options.height` **[Number][
|
|
903
|
-
* `options.center` **[Boolean][
|
|
904
|
-
* `options.permissions` **[Object][
|
|
928
|
+
* `options.width` **[Number][133]** The desired width of the window (optional, default `500`)
|
|
929
|
+
* `options.height` **[Number][133]** The desired height of the window (optional, default `600`)
|
|
930
|
+
* `options.center` **[Boolean][139]** Attempt to center the window on the screen (optional, default `true`)
|
|
931
|
+
* `options.permissions` **[Object][131]?** Additional permissions to set on opening, defaults to a suitable set of permission for popups (see code)
|
|
905
932
|
|
|
906
933
|
Returns **WindowProxy** The opened window object (if `noopener` is not set in permissions)
|
|
907
934
|
|
|
@@ -1099,88 +1126,96 @@ Returns **WindowProxy** The opened window object (if `noopener` is not set in pe
|
|
|
1099
1126
|
|
|
1100
1127
|
[97]: #parameters-27
|
|
1101
1128
|
|
|
1102
|
-
[98]: #
|
|
1129
|
+
[98]: #setprojectstateflush
|
|
1130
|
+
|
|
1131
|
+
[99]: #setprojectstaterefresh
|
|
1132
|
+
|
|
1133
|
+
[100]: #saveprojectstate
|
|
1134
|
+
|
|
1135
|
+
[101]: #replaceprojectstate
|
|
1136
|
+
|
|
1137
|
+
[102]: #parameters-28
|
|
1103
1138
|
|
|
1104
|
-
[
|
|
1139
|
+
[103]: #applyprojectstatepatch
|
|
1105
1140
|
|
|
1106
|
-
[
|
|
1141
|
+
[104]: #parameters-29
|
|
1107
1142
|
|
|
1108
|
-
[
|
|
1143
|
+
[105]: #subscribeprojectstate
|
|
1109
1144
|
|
|
1110
|
-
[
|
|
1145
|
+
[106]: #filefilters
|
|
1111
1146
|
|
|
1112
|
-
[
|
|
1147
|
+
[107]: #properties-5
|
|
1113
1148
|
|
|
1114
|
-
[
|
|
1149
|
+
[108]: #selectprojectfile-1
|
|
1115
1150
|
|
|
1116
|
-
[
|
|
1151
|
+
[109]: #parameters-30
|
|
1117
1152
|
|
|
1118
|
-
[
|
|
1153
|
+
[110]: #setprojectfile
|
|
1119
1154
|
|
|
1120
|
-
[
|
|
1155
|
+
[111]: #parameters-31
|
|
1121
1156
|
|
|
1122
|
-
[
|
|
1157
|
+
[112]: #selectprojectlibrary
|
|
1123
1158
|
|
|
1124
|
-
[
|
|
1159
|
+
[113]: #parameters-32
|
|
1125
1160
|
|
|
1126
|
-
[
|
|
1161
|
+
[114]: #getprojectlibrary
|
|
1127
1162
|
|
|
1128
|
-
[
|
|
1163
|
+
[115]: #parameters-33
|
|
1129
1164
|
|
|
1130
|
-
[
|
|
1165
|
+
[116]: #setprojectlibrary
|
|
1131
1166
|
|
|
1132
|
-
[
|
|
1167
|
+
[117]: #parameters-34
|
|
1133
1168
|
|
|
1134
|
-
[
|
|
1169
|
+
[118]: #projectlog
|
|
1135
1170
|
|
|
1136
|
-
[
|
|
1171
|
+
[119]: #parameters-35
|
|
1137
1172
|
|
|
1138
|
-
[
|
|
1173
|
+
[120]: #setpageurl
|
|
1139
1174
|
|
|
1140
|
-
[
|
|
1175
|
+
[121]: #parameters-36
|
|
1141
1176
|
|
|
1142
|
-
[
|
|
1177
|
+
[122]: #setpagetitle
|
|
1143
1178
|
|
|
1144
|
-
[
|
|
1179
|
+
[123]: #parameters-37
|
|
1145
1180
|
|
|
1146
|
-
[
|
|
1181
|
+
[124]: #uialert
|
|
1147
1182
|
|
|
1148
|
-
[
|
|
1183
|
+
[125]: #parameters-38
|
|
1149
1184
|
|
|
1150
|
-
[
|
|
1185
|
+
[126]: #uisplat
|
|
1151
1186
|
|
|
1152
|
-
[
|
|
1187
|
+
[127]: #parameters-39
|
|
1153
1188
|
|
|
1154
|
-
[
|
|
1189
|
+
[128]: #uiwindow
|
|
1155
1190
|
|
|
1156
|
-
[
|
|
1191
|
+
[129]: #parameters-40
|
|
1157
1192
|
|
|
1158
|
-
[
|
|
1193
|
+
[130]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
1159
1194
|
|
|
1160
|
-
[
|
|
1195
|
+
[131]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
1161
1196
|
|
|
1162
|
-
[
|
|
1197
|
+
[132]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date
|
|
1163
1198
|
|
|
1164
|
-
[
|
|
1199
|
+
[133]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
1165
1200
|
|
|
1166
|
-
[
|
|
1201
|
+
[134]: https://developer.mozilla.org/docs/Web/API/Blob
|
|
1167
1202
|
|
|
1168
|
-
[
|
|
1203
|
+
[135]: https://developer.mozilla.org/docs/Web/API/FormData
|
|
1169
1204
|
|
|
1170
|
-
[
|
|
1205
|
+
[136]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
1171
1206
|
|
|
1172
|
-
[
|
|
1207
|
+
[137]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
1173
1208
|
|
|
1174
|
-
[
|
|
1209
|
+
[138]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
|
|
1175
1210
|
|
|
1176
|
-
[
|
|
1211
|
+
[139]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
|
|
1177
1212
|
|
|
1178
|
-
[
|
|
1213
|
+
[140]: https://developer.mozilla.org/docs/Web/API/Window
|
|
1179
1214
|
|
|
1180
|
-
[
|
|
1215
|
+
[141]: https://developer.mozilla.org/docs/Web/API/MessageEvent
|
|
1181
1216
|
|
|
1182
|
-
[
|
|
1217
|
+
[142]: http://jsonpatch.com
|
|
1183
1218
|
|
|
1184
|
-
[
|
|
1219
|
+
[143]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
|
|
1185
1220
|
|
|
1186
|
-
[
|
|
1221
|
+
[144]: https://tera-tools.com/api/logs.json
|