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