@iebh/tera-fy 1.1.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/api.md CHANGED
@@ -108,18 +108,16 @@
108
108
  * [Parameters][104]
109
109
  * [selectProjectLibrary][105]
110
110
  * [Parameters][106]
111
- * [parseProjectLibrary][107]
111
+ * [getProjectLibrary][107]
112
112
  * [Parameters][108]
113
113
  * [setProjectLibrary][109]
114
114
  * [Parameters][110]
115
- * [setProjectLibrary][111]
115
+ * [uiAlert][111]
116
116
  * [Parameters][112]
117
- * [uiAlert][113]
117
+ * [uiSplat][113]
118
118
  * [Parameters][114]
119
- * [uiSplat][115]
119
+ * [uiWindow][115]
120
120
  * [Parameters][116]
121
- * [uiWindow][117]
122
- * [Parameters][118]
123
121
 
124
122
  ## ProjectFile
125
123
 
@@ -137,87 +135,87 @@ Parent TeraClient instance used by all helper functions
137
135
 
138
136
  A UUID string representing the unique ID of the file
139
137
 
140
- Type: [String][119]
138
+ Type: [String][117]
141
139
 
142
140
  ### name
143
141
 
144
142
  Relative name path (can contain prefix directories) for the human readable file name
145
143
 
146
- Type: [String][119]
144
+ Type: [String][117]
147
145
 
148
146
  ### path
149
147
 
150
148
  Full path to the file
151
149
  This is also used as the unique identifier within the project
152
150
 
153
- Type: [String][119]
151
+ Type: [String][117]
154
152
 
155
153
  ### parsedName
156
154
 
157
155
  An object representing meta file parts of a file name
158
156
 
159
- Type: [Object][120]
157
+ Type: [Object][118]
160
158
 
161
159
  #### Properties
162
160
 
163
- * `basename` **[String][119]** The filename + extention (i.e. everything without directory name)
164
- * `filename` **[String][119]** The file portion of the name (basename without the extension)
165
- * `ext` **[String][119]** The extension portion of the name (always lower case)
166
- * `dirName` **[String][119]** The directory path portion of the name
161
+ * `basename` **[String][117]** The filename + extention (i.e. everything without directory name)
162
+ * `filename` **[String][117]** The file portion of the name (basename without the extension)
163
+ * `ext` **[String][117]** The extension portion of the name (always lower case)
164
+ * `dirName` **[String][117]** The directory path portion of the name
167
165
 
168
166
  ### created
169
167
 
170
168
  A date representing when the file was created
171
169
 
172
- Type: [Date][121]
170
+ Type: [Date][119]
173
171
 
174
172
  ### createdFormatted
175
173
 
176
174
  A human readable, formatted version of "created"
177
175
 
178
- Type: [String][119]
176
+ Type: [String][117]
179
177
 
180
178
  ### modified
181
179
 
182
180
  A date representing when the file was created
183
181
 
184
- Type: [Date][121]
182
+ Type: [Date][119]
185
183
 
186
184
  ### modifiedFormatted
187
185
 
188
186
  A human readable, formatted version of "modified"
189
187
 
190
- Type: [String][119]
188
+ Type: [String][117]
191
189
 
192
190
  ### accessed
193
191
 
194
192
  A date representing when the file was last accessed
195
193
 
196
- Type: [Date][121]
194
+ Type: [Date][119]
197
195
 
198
196
  ### accessedFormatted
199
197
 
200
198
  A human readable, formatted version of "accessed"
201
199
 
202
- Type: [String][119]
200
+ Type: [String][117]
203
201
 
204
202
  ### size
205
203
 
206
204
  Size, in bytes, of the file
207
205
 
208
- Type: [Number][122]
206
+ Type: [Number][120]
209
207
 
210
208
  ### sizeFormatted
211
209
 
212
210
  A human readable, formatted version of the file size
213
211
 
214
- Type: [String][119]
212
+ Type: [String][117]
215
213
 
216
214
  ### mime
217
215
 
218
216
  The associated mime type for the file
219
217
 
220
- Type: [String][119]
218
+ Type: [String][117]
221
219
 
222
220
  ### getContents
223
221
 
@@ -235,17 +233,17 @@ Overwrite the contents of a file with new content
235
233
 
236
234
  #### Parameters
237
235
 
238
- * `contents` **(File | [Blob][123] | [FormData][124] | [Object][120] | [Array][125])** The new file contents
236
+ * `contents` **(File | [Blob][121] | [FormData][122] | [Object][118] | [Array][123])** The new file contents
239
237
 
240
- Returns **[Promise][126]** A promise which resolves when the operation has completed
238
+ Returns **[Promise][124]** A promise which resolves when the operation has completed
241
239
 
242
240
  ### getRefs
243
241
 
244
- * **See**: parseProjectLibrary()
242
+ * **See**: getProjectLibrary()
245
243
 
246
244
  Fetch the file contents as an array of Reflib refs
247
245
 
248
- Returns **[Promise][126]<[Array][125]\<Ref>>** An eventual array of RefLib references
246
+ Returns **[Promise][124]<[Array][123]\<Ref>>** An eventual array of RefLib references
249
247
 
250
248
  ### setRefs
251
249
 
@@ -256,9 +254,9 @@ Overwrite the contents of a file with a new collection of Reflib refs
256
254
  #### Parameters
257
255
 
258
256
  * `refs` &#x20;
259
- * `Collection` **[Array][125]\<RefLibRef>** of references for the selected library
257
+ * `Collection` **[Array][123]\<RefLibRef>** of references for the selected library
260
258
 
261
- Returns **[Promise][126]** A promise which resolves when the operation has completed
259
+ Returns **[Promise][124]** A promise which resolves when the operation has completed
262
260
 
263
261
  ## TeraFy
264
262
 
@@ -268,18 +266,18 @@ Main Tera-Fy Client (class singleton) to be used in a frontend browser
268
266
 
269
267
  Various settings to configure behaviour
270
268
 
271
- Type: [Object][120]
269
+ Type: [Object][118]
272
270
 
273
271
  #### Properties
274
272
 
275
- * `devMode` **[Boolean][127]** Operate in devMode - i.e. force outer refresh when encountering an existing TeraFy instance
273
+ * `devMode` **[Boolean][125]** Operate in devMode - i.e. force outer refresh when encountering an existing TeraFy instance
276
274
  * `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
277
- * `modeFallback` **[String][119]** Method to use when all method detection fails
278
- * `modeTimeout` **[Number][122]** How long entities have in 'detect' mode to identify themselves
279
- * `siteUrl` **[String][119]** The TERA URL to connect to
280
- * `restrictOrigin` **[String][119]** URL to restrict communications to
281
- * `List` **[Array][125]<[String][119]>** of sandbox allowables for the embedded if in embed mode
282
- * `handshakeInterval` **[Number][122]** Interval in milliseconds when sanning for a handshake
275
+ * `modeFallback` **[String][117]** Method to use when all method detection fails
276
+ * `modeTimeout` **[Number][120]** How long entities have in 'detect' mode to identify themselves
277
+ * `siteUrl` **[String][117]** The TERA URL to connect to
278
+ * `restrictOrigin` **[String][117]** URL to restrict communications to
279
+ * `List` **[Array][123]<[String][117]>** of sandbox allowables for the embedded if in embed mode
280
+ * `handshakeInterval` **[Number][120]** Interval in milliseconds when sanning for a handshake
283
281
 
284
282
  ### events
285
283
 
@@ -291,27 +289,27 @@ Type: Mitt
291
289
 
292
290
  DOMElements for this TeraFy instance
293
291
 
294
- Type: [Object][120]
292
+ Type: [Object][118]
295
293
 
296
294
  #### Properties
297
295
 
298
296
  * `el` **DOMElement** The main tera-fy div wrapper
299
297
  * `iframe` **DOMElement** The internal iFrame element (if `settings.mode == 'child'`)
300
- * `popup` **[Window][128]** The popup window context (if `settings.mode == 'popup'`)
298
+ * `popup` **[Window][126]** The popup window context (if `settings.mode == 'popup'`)
301
299
  * `stylesheet` **DOMElement** The corresponding stylesheet
302
300
 
303
301
  ### methods
304
302
 
305
- List of function stubs mapped here from the server
303
+ List of function stubs mapped from the server to here
306
304
  This array is forms the reference of `TeraFy.METHOD()` objects to provide locally which will be mapped via `TeraFy.rpc(METHOD, ...args)`
307
305
 
308
- Type: [Array][125]<[String][119]>
306
+ Type: [Array][123]<[String][117]>
309
307
 
310
308
  ### plugins
311
309
 
312
310
  Loaded plugins via Use()
313
311
 
314
- Type: [Array][125]\<TeraFyPlugin>
312
+ Type: [Array][123]\<TeraFyPlugin>
315
313
 
316
314
  ### send
317
315
 
@@ -319,9 +317,9 @@ Send a message + wait for a response object
319
317
 
320
318
  #### Parameters
321
319
 
322
- * `message` **[Object][120]** Message object to send
320
+ * `message` **[Object][118]** Message object to send
323
321
 
324
- Returns **[Promise][126]\<any>** A promise which resolves when the operation has completed with the remote reply
322
+ Returns **[Promise][124]\<any>** A promise which resolves when the operation has completed with the remote reply
325
323
 
326
324
  ### sendRaw
327
325
 
@@ -330,7 +328,7 @@ This function does not return or wait for a reply - use `send()` for that
330
328
 
331
329
  #### Parameters
332
330
 
333
- * `message` **[Object][120]** Message object to send
331
+ * `message` **[Object][118]** Message object to send
334
332
 
335
333
  ### rpc
336
334
 
@@ -338,10 +336,10 @@ Call an RPC function in the server instance
338
336
 
339
337
  #### Parameters
340
338
 
341
- * `method` **[String][119]** The method name to call
339
+ * `method` **[String][117]** The method name to call
342
340
  * `args` **...any**&#x20;
343
341
 
344
- Returns **[Promise][126]\<any>** The resolved output of the server function
342
+ Returns **[Promise][124]\<any>** The resolved output of the server function
345
343
 
346
344
  ### acceptMessage
347
345
 
@@ -350,7 +348,7 @@ Accept an incoming message
350
348
  #### Parameters
351
349
 
352
350
  * `rawMessage` &#x20;
353
- * `Raw` **[MessageEvent][129]** message event to process
351
+ * `Raw` **[MessageEvent][127]** message event to process
354
352
 
355
353
  ### acceptPostboxes
356
354
 
@@ -359,27 +357,27 @@ Listening postboxes, these correspond to outgoing message IDs that expect a resp
359
357
  ### createProjectStatePatch
360
358
 
361
359
  Create + transmit a new project state patch base on the current and previous states
362
- The transmitted patch follows the [JSPatch][130] standard
360
+ The transmitted patch follows the [JSPatch][128] standard
363
361
  This function accepts an entire projectState instance, computes the delta and transmits that to the server for merging
364
362
 
365
363
  #### Parameters
366
364
 
367
- * `newState` **[Object][120]** The local projectState to accept
368
- * `oldState` **[Object][120]** The previous projectState to examine against
365
+ * `newState` **[Object][118]** The local projectState to accept
366
+ * `oldState` **[Object][118]** The previous projectState to examine against
369
367
 
370
- Returns **[Promise][126]** A promise which will resolve when the operation has completed
368
+ Returns **[Promise][124]** A promise which will resolve when the operation has completed
371
369
 
372
370
  ### applyProjectStatePatchLocal
373
371
 
374
372
  Client function which accepts a patch from the server and applies it to local project state
375
- The patch should follow the [JSPatch][130] standard
373
+ The patch should follow the [JSPatch][128] standard
376
374
  This function is expected to be sub-classed by a plugin
377
375
 
378
376
  #### Parameters
379
377
 
380
- * `patch` **[Array][125]** A JSPatch patch to apply
378
+ * `patch` **[Array][123]** A JSPatch patch to apply
381
379
 
382
- Returns **[Promise][126]** A promise which will resolve when the operation has completed
380
+ Returns **[Promise][124]** A promise which will resolve when the operation has completed
383
381
 
384
382
  ### init
385
383
 
@@ -388,22 +386,22 @@ This function can only be called once and will return the existing init() worker
388
386
 
389
387
  #### Parameters
390
388
 
391
- * `options` **[Object][120]?** Additional options to merge into `settings` via `set`
389
+ * `options` **[Object][118]?** Additional options to merge into `settings` via `set`
392
390
 
393
- Returns **[Promise][126]<[TeraFy][24]>** An eventual promise which will resovle with this terafy instance
391
+ Returns **[Promise][124]<[TeraFy][24]>** An eventual promise which will resovle with this terafy instance
394
392
 
395
393
  ### detectMode
396
394
 
397
395
  Populate `settings.mode`
398
396
  Try to communicate with a parent frame, if none assume we need to fallback to child mode
399
397
 
400
- Returns **[Promise][126]<[String][119]>** A promise which will resolve with the detected mode to use
398
+ Returns **[Promise][124]<[String][117]>** A promise which will resolve with the detected mode to use
401
399
 
402
400
  ### injectComms
403
401
 
404
402
  Find an existing active TERA server OR initalize one
405
403
 
406
- Returns **[Promise][126]** A promise which will resolve when the loading has completed and we have found a parent TERA instance or initiallized a child
404
+ Returns **[Promise][124]** A promise which will resolve when the loading has completed and we have found a parent TERA instance or initiallized a child
407
405
 
408
406
  ### injectStylesheet
409
407
 
@@ -430,7 +428,7 @@ This function also routes 'special' keys like `devMode` to their internal handle
430
428
 
431
429
  #### Parameters
432
430
 
433
- * `key` **([String][119] | [Object][120])** Either a single setting key to set or an object to merge
431
+ * `key` **([String][117] | [Object][118])** Either a single setting key to set or an object to merge
434
432
  * `value` **any** The value to set if `key` is a string
435
433
 
436
434
  Returns **[TeraFy][24]** This chainable terafy instance
@@ -443,7 +441,7 @@ Set or merge settings - but only in dev mode and only if the value is not undefi
443
441
 
444
442
  #### Parameters
445
443
 
446
- * `key` **([String][119] | [Object][120])** Either a single setting key to set or an object to merge
444
+ * `key` **([String][117] | [Object][118])** Either a single setting key to set or an object to merge
447
445
  * `value` **any** The value to set if `key` is a string
448
446
 
449
447
  Returns **[TeraFy][24]** This chainable terafy instance
@@ -455,8 +453,8 @@ Include a TeraFy client plugin
455
453
  #### Parameters
456
454
 
457
455
  * `mod` &#x20;
458
- * `options` **[Object][120]?** Additional options to mutate behaviour during construction (pass options to init() to intialize later options)
459
- * `The` **[Object][120]** module function to include. Invoked as `(teraClient:TeraFy, options:Object)`
456
+ * `options` **[Object][118]?** Additional options to mutate behaviour during construction (pass options to init() to intialize later options)
457
+ * `The` **[Object][118]** module function to include. Invoked as `(teraClient:TeraFy, options:Object)`
460
458
 
461
459
  Returns **[TeraFy][24]** This chainable terafy instance
462
460
 
@@ -466,8 +464,8 @@ Internal function used by use() to merge an external declared singleton against
466
464
 
467
465
  #### Parameters
468
466
 
469
- * `target` **[Object][120]** Initalied class instance to extend
470
- * `source` **[Object][120]** Initalized source object to extend from
467
+ * `target` **[Object][118]** Initalied class instance to extend
468
+ * `source` **[Object][118]** Initalized source object to extend from
471
469
 
472
470
  ### toggleDevMode
473
471
 
@@ -475,7 +473,7 @@ Set or toggle devMode
475
473
 
476
474
  #### Parameters
477
475
 
478
- * `devModeEnabled` **([String][119] | [Boolean][127])** Optional boolean to force dev mode (optional, default `'toggle'`)
476
+ * `devModeEnabled` **([String][117] | [Boolean][125])** Optional boolean to force dev mode (optional, default `'toggle'`)
479
477
 
480
478
  Returns **[TeraFy][24]** This chainable terafy instance
481
479
 
@@ -486,7 +484,7 @@ This is usually because the server component wants to perform some user activity
486
484
 
487
485
  #### Parameters
488
486
 
489
- * `isFocused` **([String][119] | [Boolean][127])** Whether to fullscreen the embedded component (optional, default `'toggle'`)
487
+ * `isFocused` **([String][117] | [Boolean][125])** Whether to fullscreen the embedded component (optional, default `'toggle'`)
490
488
 
491
489
  ### selectProjectFile
492
490
 
@@ -498,7 +496,7 @@ This is an pre-requisite step for requireProject()
498
496
 
499
497
  * `options` &#x20;
500
498
 
501
- Returns **[Promise][126]** A promise which will resolve if the there is a user and they are logged in
499
+ Returns **[Promise][124]** A promise which will resolve if the there is a user and they are logged in
502
500
 
503
501
  ### getProjectFiles
504
502
 
@@ -506,12 +504,12 @@ Fetch the files associated with a given project
506
504
 
507
505
  #### Parameters
508
506
 
509
- * `options` **[Object][120]** Options which mutate behaviour
507
+ * `options` **[Object][118]** Options which mutate behaviour
510
508
 
511
- * `options.autoRequire` **[Boolean][127]** Run `requireProject()` automatically before continuing (optional, default `true`)
512
- * `options.meta` **[Boolean][127]** Pull meta information for each file entity (optional, default `true`)
509
+ * `options.autoRequire` **[Boolean][125]** Run `requireProject()` automatically before continuing (optional, default `true`)
510
+ * `options.meta` **[Boolean][125]** Pull meta information for each file entity (optional, default `true`)
513
511
 
514
- Returns **[Promise][126]<[Array][125]<[ProjectFile][1]>>** A collection of project files for the given project
512
+ Returns **[Promise][124]<[Array][123]<[ProjectFile][1]>>** A collection of project files for the given project
515
513
 
516
514
  ### getProjectFile
517
515
 
@@ -519,9 +517,9 @@ Fetch a project file
519
517
 
520
518
  #### Parameters
521
519
 
522
- * `path` **[String][119]** File path to read
520
+ * `path` **[String][117]** File path to read
523
521
 
524
- Returns **[Promise][126]<[Blob][123]>** The eventual fetched file as a blob
522
+ Returns **[Promise][124]<[Blob][121]>** The eventual fetched file as a blob
525
523
 
526
524
  ## handshake
527
525
 
@@ -529,9 +527,9 @@ Return basic server information as a form of validation
529
527
 
530
528
  ### Properties
531
529
 
532
- * `date` **[Date][121]** Server date
530
+ * `date` **[Date][119]** Server date
533
531
 
534
- Returns **[Promise][126]<[Object][120]>** Basic promise result
532
+ Returns **[Promise][124]<[Object][118]>** Basic promise result
535
533
 
536
534
  ## User
537
535
 
@@ -539,16 +537,16 @@ User / active session within TERA
539
537
 
540
538
  ### Properties
541
539
 
542
- * `id` **[String][119]** Unique identifier of the user
543
- * `email` **[String][119]** The email address of the current user
544
- * `name` **[String][119]** The provided full name of the user
545
- * `isSubscribed` **[Boolean][127]** Whether the active user has a TERA subscription
540
+ * `id` **[String][117]** Unique identifier of the user
541
+ * `email` **[String][117]** The email address of the current user
542
+ * `name` **[String][117]** The provided full name of the user
543
+ * `isSubscribed` **[Boolean][125]** Whether the active user has a TERA subscription
546
544
 
547
545
  ## getUser
548
546
 
549
547
  Fetch the current session user
550
548
 
551
- Returns **[Promise][126]<[User][73]>** The current logged in user or null if none
549
+ Returns **[Promise][124]<[User][73]>** The current logged in user or null if none
552
550
 
553
551
  ## requireUser
554
552
 
@@ -558,11 +556,11 @@ This is an pre-requisite step for requireProject()
558
556
 
559
557
  ### Parameters
560
558
 
561
- * `options` **[Object][120]?** Additional options to mutate behaviour
559
+ * `options` **[Object][118]?** Additional options to mutate behaviour
562
560
 
563
- * `options.forceRetry` **[Boolean][127]** Forcabily try to refresh the user state (optional, default `false`)
561
+ * `options.forceRetry` **[Boolean][125]** Forcabily try to refresh the user state (optional, default `false`)
564
562
 
565
- Returns **[Promise][126]<[User][73]>** The current logged in user or null if none
563
+ Returns **[Promise][124]<[User][73]>** The current logged in user or null if none
566
564
 
567
565
  ## Project
568
566
 
@@ -572,13 +570,13 @@ Project entry within TERA
572
570
 
573
571
  Get the currently active project, if any
574
572
 
575
- Returns **[Promise][126]<([Project][78] | null)>** The currently active project, if any
573
+ Returns **[Promise][124]<([Project][78] | null)>** The currently active project, if any
576
574
 
577
575
  ## getProjects
578
576
 
579
577
  Get a list of projects the current session user has access to
580
578
 
581
- Returns **[Promise][126]<[Array][125]<[Project][78]>>** Collection of projects the user has access to
579
+ Returns **[Promise][124]<[Array][123]<[Project][78]>>** Collection of projects the user has access to
582
580
 
583
581
  ## setActiveProject
584
582
 
@@ -586,7 +584,7 @@ Set the currently active project within TERA
586
584
 
587
585
  ### Parameters
588
586
 
589
- * `project` **([Object][120] | [String][119])** The project to set as active - either the full Project object or its ID
587
+ * `project` **([Object][118] | [String][117])** The project to set as active - either the full Project object or its ID
590
588
 
591
589
  ## requireProject
592
590
 
@@ -595,14 +593,14 @@ Note that this function will percist in asking the uesr even if they try to canc
595
593
 
596
594
  ### Parameters
597
595
 
598
- * `options` **[Object][120]?** Additional options to mutate behaviour
596
+ * `options` **[Object][118]?** Additional options to mutate behaviour
599
597
 
600
- * `options.autoSetActiveProject` **[Boolean][127]** After selecting a project set that project as active in TERA (optional, default `true`)
601
- * `options.title` **[String][119]** The title of the dialog to display (optional, default `"Select a project to work with"`)
602
- * `options.noSelectTitle` **[String][119]** Dialog title when warning the user they need to select something (optional, default `'Select project'`)
603
- * `options.noSelectBody` **[String][119]** Dialog body when warning the user they need to select something (optional, default `'A project needs to be selected to continue'`)
598
+ * `options.autoSetActiveProject` **[Boolean][125]** After selecting a project set that project as active in TERA (optional, default `true`)
599
+ * `options.title` **[String][117]** The title of the dialog to display (optional, default `"Select a project to work with"`)
600
+ * `options.noSelectTitle` **[String][117]** Dialog title when warning the user they need to select something (optional, default `'Select project'`)
601
+ * `options.noSelectBody` **[String][117]** Dialog body when warning the user they need to select something (optional, default `'A project needs to be selected to continue'`)
604
602
 
605
- Returns **[Promise][126]<[Project][78]>** The active project
603
+ Returns **[Promise][124]<[Project][78]>** The active project
606
604
 
607
605
  ## selectProject
608
606
 
@@ -610,13 +608,13 @@ Prompt the user to select a project from those available
610
608
 
611
609
  ### Parameters
612
610
 
613
- * `options` **[Object][120]?** Additional options to mutate behaviour
611
+ * `options` **[Object][118]?** Additional options to mutate behaviour
614
612
 
615
- * `options.title` **[String][119]** The title of the dialog to display (optional, default `"Select a project to work with"`)
616
- * `options.allowCancel` **[Boolean][127]** Advertise cancelling the operation, the dialog can still be cancelled by closing it (optional, default `true`)
617
- * `options.setActive` **[Boolean][127]** Also set the project as active when selected (optional, default `false`)
613
+ * `options.title` **[String][117]** The title of the dialog to display (optional, default `"Select a project to work with"`)
614
+ * `options.allowCancel` **[Boolean][125]** Advertise cancelling the operation, the dialog can still be cancelled by closing it (optional, default `true`)
615
+ * `options.setActive` **[Boolean][125]** Also set the project as active when selected (optional, default `false`)
618
616
 
619
- Returns **[Promise][126]<[Project][78]>** The active project
617
+ Returns **[Promise][124]<[Project][78]>** The active project
620
618
 
621
619
  ## getProjectState
622
620
 
@@ -624,12 +622,12 @@ Return the current, full snapshot state of the active project
624
622
 
625
623
  ### Parameters
626
624
 
627
- * `options` **[Object][120]?** Additional options to mutate behaviour
625
+ * `options` **[Object][118]?** Additional options to mutate behaviour
628
626
 
629
- * `options.autoRequire` **[Boolean][127]** Run `requireProject()` automatically before continuing (optional, default `true`)
630
- * `Paths` **[Array][125]<[String][119]>** to subscribe to e.g. \['/users/'],
627
+ * `options.autoRequire` **[Boolean][125]** Run `requireProject()` automatically before continuing (optional, default `true`)
628
+ * `Paths` **[Array][123]<[String][117]>** to subscribe to e.g. \['/users/'],
631
629
 
632
- Returns **[Promise][126]<[Object][120]>** The current project state snapshot
630
+ Returns **[Promise][124]<[Object][118]>** The current project state snapshot
633
631
 
634
632
  ## setProjectState
635
633
 
@@ -641,13 +639,13 @@ Paths can be any valid Lodash.set() value such as:
641
639
 
642
640
  ### Parameters
643
641
 
644
- * `path` **([String][119] | [Array][125]<[String][119]>)** The sub-path within the project state to set
642
+ * `path` **([String][117] | [Array][123]<[String][117]>)** The sub-path within the project state to set
645
643
  * `value` **any** The value to set
646
- * `options` **[Object][120]?** Additional options to mutate behaviour
644
+ * `options` **[Object][118]?** Additional options to mutate behaviour
647
645
 
648
- * `options.save` **[Boolean][127]** Save the changes to the server immediately, disable to queue up multiple writes (optional, default `true`)
646
+ * `options.save` **[Boolean][125]** Save the changes to the server immediately, disable to queue up multiple writes (optional, default `true`)
649
647
 
650
- Returns **[Promise][126]** A promise which resolves when the operation has been dispatched to the server
648
+ Returns **[Promise][124]** A promise which resolves when the operation has been dispatched to the server
651
649
 
652
650
  ## setProjectStateDefaults
653
651
 
@@ -657,17 +655,17 @@ Set a nested value within the project state - just like `setProjectState()` - bu
657
655
 
658
656
  ### Parameters
659
657
 
660
- * `path` **([String][119] | [Array][125]<[String][119]>)** The sub-path within the project state to set
658
+ * `path` **([String][117] | [Array][123]<[String][117]>)** The sub-path within the project state to set
661
659
  * `value` **any** The value to set
662
- * `options` **[Object][120]?** Additional options to mutate behaviour, see setProjectState() for the full list of supported options
660
+ * `options` **[Object][118]?** Additional options to mutate behaviour, see setProjectState() for the full list of supported options
663
661
 
664
- Returns **[Promise][126]<[Boolean][127]>** A promise which resolves to whether any changes were made - True if defaults were applied, false otherwise
662
+ Returns **[Promise][124]<[Boolean][125]>** A promise which resolves to whether any changes were made - True if defaults were applied, false otherwise
665
663
 
666
664
  ## saveProjectState
667
665
 
668
666
  Force-Save the currently active project state
669
667
 
670
- Returns **[Promise][126]** A promise which resolves when the operation has completed
668
+ Returns **[Promise][124]** A promise which resolves when the operation has completed
671
669
 
672
670
  ## replaceProjectState
673
671
 
@@ -678,9 +676,9 @@ You almost never want to use this function directly, see `setProjectState(path,
678
676
 
679
677
  ### Parameters
680
678
 
681
- * `newState` **[Object][120]** The new state to replace the current state with
679
+ * `newState` **[Object][118]** The new state to replace the current state with
682
680
 
683
- Returns **[Promise][126]** A promise which resolves when the operation has completed
681
+ Returns **[Promise][124]** A promise which resolves when the operation has completed
684
682
 
685
683
  ## applyProjectStatePatch
686
684
 
@@ -688,9 +686,9 @@ Apply a computed `just-diff` patch to the current project state
688
686
 
689
687
  ### Parameters
690
688
 
691
- * `Patch` **[Object][120]** to apply
689
+ * `Patch` **[Object][118]** to apply
692
690
 
693
- Returns **[Promise][126]** A promise which resolves when the operation has completed
691
+ Returns **[Promise][124]** A promise which resolves when the operation has completed
694
692
 
695
693
  ## subscribeProjectState
696
694
 
@@ -698,7 +696,7 @@ Subscribe to project state changes
698
696
  This will dispatch an RPC call to the source object `applyProjectStatePatchLocal()` function with the patch
699
697
  If the above call fails the subscriber is assumed as dead and unsubscribed from the polling list
700
698
 
701
- Returns **[Promise][126]<[Function][131]>** A promise which resolves when a subscription has been created, call the resulting function to unsubscribe
699
+ Returns **[Promise][124]<[Function][129]>** A promise which resolves when a subscription has been created, call the resulting function to unsubscribe
702
700
 
703
701
  ## FileFilters
704
702
 
@@ -706,10 +704,10 @@ Data structure for a file filter
706
704
 
707
705
  ### Properties
708
706
 
709
- * `library` **[Boolean][127]?** Restrict to library files only
710
- * `filename` **[String][119]?** CSV of @momsfriendlydevco/match expressions to filter the filename by (filenames are the basename sans extension)
711
- * `basename` **[String][119]?** CSV of @momsfriendlydevco/match expressions to filter the basename by
712
- * `ext` **[String][119]?** CSV of @momsfriendlydevco/match expressions to filter the file extension by
707
+ * `library` **[Boolean][125]?** Restrict to library files only
708
+ * `filename` **[String][117]?** CSV of @momsfriendlydevco/match expressions to filter the filename by (filenames are the basename sans extension)
709
+ * `basename` **[String][117]?** CSV of @momsfriendlydevco/match expressions to filter the basename by
710
+ * `ext` **[String][117]?** CSV of @momsfriendlydevco/match expressions to filter the file extension by
713
711
 
714
712
  ## selectProjectFile
715
713
 
@@ -717,20 +715,20 @@ Prompt the user to select a library to operate on
717
715
 
718
716
  ### Parameters
719
717
 
720
- * `options` **[Object][120]?** Additional options to mutate behaviour
718
+ * `options` **[Object][118]?** Additional options to mutate behaviour
721
719
 
722
- * `options.title` **[String][119]** The title of the dialog to display (optional, default `"Select a file"`)
723
- * `options.hint` **([String][119] | [Array][125]<[String][119]>)?** Hints to identify the file to select in array order of preference
724
- * `options.save` **[Boolean][127]** Set to truthy if saving a new file, UI will adjust to allowing overwrite OR new file name input (optional, default `false`)
720
+ * `options.title` **[String][117]** The title of the dialog to display (optional, default `"Select a file"`)
721
+ * `options.hint` **([String][117] | [Array][123]<[String][117]>)?** Hints to identify the file to select in array order of preference
722
+ * `options.save` **[Boolean][125]** Set to truthy if saving a new file, UI will adjust to allowing overwrite OR new file name input (optional, default `false`)
725
723
  * `options.filters` **[FileFilters][99]?** Optional file filters
726
- * `options.allowUpload` **[Boolean][127]** Allow uploading new files (optional, default `true`)
727
- * `options.allowRefresh` **[Boolean][127]** Allow the user to manually refresh the file list (optional, default `true`)
728
- * `options.allowDownloadZip` **[Boolean][127]** Allow the user to download a Zip of all files (optional, default `true`)
729
- * `options.allowCancel` **[Boolean][127]** Allow cancelling the operation. Will throw `'CANCEL'` as the promise rejection if acationed (optional, default `true`)
730
- * `options.autoRequire` **[Boolean][127]** Run `requireProject()` automatically before continuing (optional, default `true`)
724
+ * `options.allowUpload` **[Boolean][125]** Allow uploading new files (optional, default `true`)
725
+ * `options.allowRefresh` **[Boolean][125]** Allow the user to manually refresh the file list (optional, default `true`)
726
+ * `options.allowDownloadZip` **[Boolean][125]** Allow the user to download a Zip of all files (optional, default `true`)
727
+ * `options.allowCancel` **[Boolean][125]** Allow cancelling the operation. Will throw `'CANCEL'` as the promise rejection if acationed (optional, default `true`)
728
+ * `options.autoRequire` **[Boolean][125]** Run `requireProject()` automatically before continuing (optional, default `true`)
731
729
  * `options.filter` **[FileFilters][99]?** Optional file filters
732
730
 
733
- Returns **[Promise][126]<[ProjectFile][1]>** The eventually selected file
731
+ Returns **[Promise][124]<[ProjectFile][1]>** The eventually selected file
734
732
 
735
733
  ## setProjectFile
736
734
 
@@ -738,10 +736,10 @@ Replace a project files contents
738
736
 
739
737
  ### Parameters
740
738
 
741
- * `path` **[String][119]** File path to write
742
- * `contents` **(File | [Blob][123] | [FormData][124] | [Object][120] | [Array][125])** The new file contents
739
+ * `path` **[String][117]** File path to write
740
+ * `contents` **(File | [Blob][121] | [FormData][122] | [Object][118] | [Array][123])** The new file contents
743
741
 
744
- Returns **[Promise][126]** A promise which will resolve when the write operation has completed
742
+ Returns **[Promise][124]** A promise which will resolve when the write operation has completed
745
743
 
746
744
  ## selectProjectLibrary
747
745
 
@@ -749,34 +747,34 @@ Prompt the user to select a library to operate on and return a array of referenc
749
747
 
750
748
  ### Parameters
751
749
 
752
- * `options` **[Object][120]?** Additional options to mutate behaviour
750
+ * `options` **[Object][118]?** Additional options to mutate behaviour
753
751
 
754
- * `options.title` **[String][119]** The title of the dialog to display (optional, default `"Select a citation library"`)
755
- * `options.hint` **([String][119] | [Array][125]<[String][119]>)?** Hints to identify the library to select in array order of preference. Generally corresponds to the previous stage - e.g. 'deduped', 'review1', 'review2', 'dedisputed'
756
- * `options.allowUpload` **[Boolean][127]** Allow uploading new files (optional, default `true`)
757
- * `options.allowRefresh` **[Boolean][127]** Allow the user to manually refresh the file list (optional, default `true`)
758
- * `options.allowDownloadZip` **[Boolean][127]** Allow the user to download a Zip of all files (optional, default `true`)
759
- * `options.allowCancel` **[Boolean][127]** Allow cancelling the operation. Will throw `'CANCEL'` as the promise rejection if acationed (optional, default `true`)
760
- * `options.autoRequire` **[Boolean][127]** Run `requireProject()` automatically before continuing (optional, default `true`)
752
+ * `options.title` **[String][117]** The title of the dialog to display (optional, default `"Select a citation library"`)
753
+ * `options.hint` **([String][117] | [Array][123]<[String][117]>)?** Hints to identify the library to select in array order of preference. Generally corresponds to the previous stage - e.g. 'deduped', 'review1', 'review2', 'dedisputed'
754
+ * `options.allowUpload` **[Boolean][125]** Allow uploading new files (optional, default `true`)
755
+ * `options.allowRefresh` **[Boolean][125]** Allow the user to manually refresh the file list (optional, default `true`)
756
+ * `options.allowDownloadZip` **[Boolean][125]** Allow the user to download a Zip of all files (optional, default `true`)
757
+ * `options.allowCancel` **[Boolean][125]** Allow cancelling the operation. Will throw `'CANCEL'` as the promise rejection if acationed (optional, default `true`)
758
+ * `options.autoRequire` **[Boolean][125]** Run `requireProject()` automatically before continuing (optional, default `true`)
761
759
  * `options.filters` **[FileFilters][99]?** Optional file filters, defaults to citation library selection only
762
760
 
763
- Returns **[Promise][126]<[Array][125]\<Ref>>** A collection of references from the selected file
761
+ Returns **[Promise][124]<[Array][123]\<Ref>>** A collection of references from the selected file
764
762
 
765
- ## parseProjectLibrary
763
+ ## getProjectLibrary
766
764
 
767
- Convert a project file into a library of citations
765
+ Fetch + convert a project file into a library of citations
768
766
 
769
767
  ### Parameters
770
768
 
771
- * `path` **[String][119]** File path to read, if omitted the contents of `options` are used to guess at a suitable file
772
- * `options` **[Object][120]?** Additional options to mutate behaviour
769
+ * `path` **[String][117]** File path to read, if omitted the contents of `options` are used to guess at a suitable file
770
+ * `options` **[Object][118]?** Additional options to mutate behaviour
773
771
 
774
- * `options.format` **[String][119]** Format for the file. ENUM: 'pojo' (return a parsed JS collection), 'blob' (raw JS Blob object), 'file' (named JS File object) (optional, default `'json'`)
775
- * `options.autoRequire` **[Boolean][127]** Run `requireProject()` automatically before continuing (optional, default `true`)
776
- * `options.filter` **[Function][131]?** Optional async file filter, called each time as `(File:ProjectFile)`
777
- * `options.find` **[Function][131]?** Optional async final stage file filter to reduce all candidates down to one subject file
772
+ * `options.format` **[String][117]** Format for the file. ENUM: 'pojo' (return a parsed JS collection), 'blob' (raw JS Blob object), 'file' (named JS File object) (optional, default `'json'`)
773
+ * `options.autoRequire` **[Boolean][125]** Run `requireProject()` automatically before continuing (optional, default `true`)
774
+ * `options.filter` **[Function][129]?** Optional async file filter, called each time as `(File:ProjectFile)`
775
+ * `options.find` **[Function][129]?** Optional async final stage file filter to reduce all candidates down to one subject file
778
776
 
779
- Returns **([Promise][126]<[Array][125]\<Ref>> | [Promise][126]\<any>)** A collection of references (default bevahiour) or a whatever format was requested
777
+ Returns **([Promise][124]<[Array][123]\<Ref>> | [Promise][124]\<any>)** A collection of references (default bevahiour) or a whatever format was requested
780
778
 
781
779
  ## setProjectLibrary
782
780
 
@@ -784,31 +782,21 @@ Save back a citation library from some input
784
782
 
785
783
  ### Parameters
786
784
 
787
- * `path` **[String][119]?** File path to save back to
788
- * `Collection` **[Array][125]\<RefLibRef>** of references for the selected library
789
- * `options` **[Object][120]?** Additional options to mutate behaviour
785
+ * `path` **[String][117]?** File path to save back to, if omitted one will be prompted for
786
+ * `refs` **([Array][123]\<RefLibRef> | [Blob][121] | File)?** Collection of references for the selected library or the raw Blob/File
787
+ * `options` **[Object][118]?** Additional options to mutate behaviour
790
788
 
791
- * `options.format` **[String][119]** Input format used. ENUM: 'pojo' (return a parsed JS collection), 'blob' (raw JS Blob object), 'file' (named JS File object) (optional, default `'json'`)
792
- * `options.autoRequire` **[Boolean][127]** Run `requireProject()` automatically before continuing (optional, default `true`)
793
- * `options.hint` **[String][119]?** Hint to store against the library. Generally corresponds to the current operation being performed - e.g. 'deduped'
794
- * `options.overwrite` **[Boolean][127]** Allow existing file upsert (optional, default `true`)
795
- * `options.meta` **[Object][120]?** Optional meta data to merge into the file data
789
+ * `options.path` **[String][117]?** Alternate method to specify the path to save as, if omitted one will be prompted for
790
+ * `options.refs` **([Array][123]\<RefLibRef> | [Blob][121] | File)?** Alternate method to specify the refs to save as an array or raw Blob/File
791
+ * `options.format` **[String][117]** Input format used. ENUM: 'pojo' (return a parsed JS collection), 'blob' (raw JS Blob object), 'file' (named JS File object) (optional, default `'json'`)
792
+ * `options.autoRequire` **[Boolean][125]** Run `requireProject()` automatically before continuing (optional, default `true`)
793
+ * `options.hint` **[String][117]?** Hint to store against the library. Generally corresponds to the current operation being performed - e.g. 'deduped'
794
+ * `options.filename` **[String][117]?** Suggested filename if path is unspecified
795
+ * `options.title` **[String][117]** Dialog title if path is unspecified and we need to prompt (optional, default `'Save citation library'`)
796
+ * `options.overwrite` **[Boolean][125]** Allow existing file upsert (optional, default `true`)
797
+ * `options.meta` **[Object][118]?** Optional meta data to merge into the file data
796
798
 
797
- Returns **[Promise][126]** A promise which resolves when the save operation has completed
798
-
799
- ## setProjectLibrary
800
-
801
- Save back a projects citation library
802
-
803
- ### Parameters
804
-
805
- * `Collection` **[Array][125]\<RefLibRef>** of references for the selected library
806
- * `options` **[Object][120]?** Additional options to mutate behaviour
807
-
808
- * `options.autoRequire` **[Boolean][127]** Run `requireProject()` automatically before continuing (optional, default `true`)
809
- * `options.hint` **[String][119]?** Hint to store against the library. Generally corresponds to the current operation being performed - e.g. 'deduped'
810
-
811
- Returns **[Promise][126]** A promise which resolves when the save operation has completed
799
+ Returns **[Promise][124]** A promise which resolves when the save operation has completed
812
800
 
813
801
  ## uiAlert
814
802
 
@@ -816,13 +804,13 @@ Display simple text within TERA
816
804
 
817
805
  ### Parameters
818
806
 
819
- * `text` **[String][119]** The text to display
820
- * `options` **[Object][120]?** Additional options to mutate behaviour
807
+ * `text` **[String][117]** The text to display
808
+ * `options` **[Object][118]?** Additional options to mutate behaviour
821
809
 
822
- * `options.title` **[String][119]** The title of the alert box (optional, default `'TERA'`)
823
- * `options.isHtml` **[Boolean][127]** If falsy the text is rendered as plain-text otherwise it will be assumed as HTML content (optional, default `false`)
810
+ * `options.title` **[String][117]** The title of the alert box (optional, default `'TERA'`)
811
+ * `options.isHtml` **[Boolean][125]** If falsy the text is rendered as plain-text otherwise it will be assumed as HTML content (optional, default `false`)
824
812
 
825
- Returns **[Promise][126]** A promise which resolves when the alert has been dismissed
813
+ Returns **[Promise][124]** A promise which resolves when the alert has been dismissed
826
814
 
827
815
  ## uiSplat
828
816
 
@@ -831,10 +819,10 @@ This function is ideally called within a requestFocus() wrapper
831
819
 
832
820
  ### Parameters
833
821
 
834
- * `content` **(DOMElement | [String][119] | `false`)** Either a prepared DOM element or string to compile, set to falsy to remove existing content
835
- * `options` **[Object][120]?** Additional options to mutate behaviour
822
+ * `content` **(DOMElement | [String][117] | `false`)** Either a prepared DOM element or string to compile, set to falsy to remove existing content
823
+ * `options` **[Object][118]?** Additional options to mutate behaviour
836
824
 
837
- * `options.logo` **([Boolean][127] | [String][119])** Add a logo to the output, if boolean true the Tera-tools logo is used otherwise specify a path or URL (optional, default `false`)
825
+ * `options.logo` **([Boolean][125] | [String][117])** Add a logo to the output, if boolean true the Tera-tools logo is used otherwise specify a path or URL (optional, default `false`)
838
826
 
839
827
  ## uiWindow
840
828
 
@@ -842,13 +830,13 @@ Open a popup window containing a new site
842
830
 
843
831
  ### Parameters
844
832
 
845
- * `url` **[String][119]** The URL to open
846
- * `options` **[Object][120]?** Additional options to mutate behaviour
833
+ * `url` **[String][117]** The URL to open
834
+ * `options` **[Object][118]?** Additional options to mutate behaviour
847
835
 
848
- * `options.width` **[Number][122]** The desired width of the window (optional, default `500`)
849
- * `options.height` **[Number][122]** The desired height of the window (optional, default `600`)
850
- * `options.center` **[Boolean][127]** Attempt to center the window on the screen (optional, default `true`)
851
- * `options.permissions` **[Object][120]?** Additional permissions to set on opening, defaults to a suitable set of permission for popups (see code)
836
+ * `options.width` **[Number][120]** The desired width of the window (optional, default `500`)
837
+ * `options.height` **[Number][120]** The desired height of the window (optional, default `600`)
838
+ * `options.center` **[Boolean][125]** Attempt to center the window on the screen (optional, default `true`)
839
+ * `options.permissions` **[Object][118]?** Additional permissions to set on opening, defaults to a suitable set of permission for popups (see code)
852
840
 
853
841
  Returns **WindowProxy** The opened window object (if `noopener` is not set in permissions)
854
842
 
@@ -1064,7 +1052,7 @@ Returns **WindowProxy** The opened window object (if `noopener` is not set in pe
1064
1052
 
1065
1053
  [106]: #parameters-31
1066
1054
 
1067
- [107]: #parseprojectlibrary
1055
+ [107]: #getprojectlibrary
1068
1056
 
1069
1057
  [108]: #parameters-32
1070
1058
 
@@ -1072,44 +1060,40 @@ Returns **WindowProxy** The opened window object (if `noopener` is not set in pe
1072
1060
 
1073
1061
  [110]: #parameters-33
1074
1062
 
1075
- [111]: #setprojectlibrary-1
1063
+ [111]: #uialert
1076
1064
 
1077
1065
  [112]: #parameters-34
1078
1066
 
1079
- [113]: #uialert
1067
+ [113]: #uisplat
1080
1068
 
1081
1069
  [114]: #parameters-35
1082
1070
 
1083
- [115]: #uisplat
1071
+ [115]: #uiwindow
1084
1072
 
1085
1073
  [116]: #parameters-36
1086
1074
 
1087
- [117]: #uiwindow
1088
-
1089
- [118]: #parameters-37
1090
-
1091
- [119]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
1075
+ [117]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
1092
1076
 
1093
- [120]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
1077
+ [118]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
1094
1078
 
1095
- [121]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date
1079
+ [119]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date
1096
1080
 
1097
- [122]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
1081
+ [120]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
1098
1082
 
1099
- [123]: https://developer.mozilla.org/docs/Web/API/Blob
1083
+ [121]: https://developer.mozilla.org/docs/Web/API/Blob
1100
1084
 
1101
- [124]: https://developer.mozilla.org/docs/Web/API/FormData
1085
+ [122]: https://developer.mozilla.org/docs/Web/API/FormData
1102
1086
 
1103
- [125]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
1087
+ [123]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
1104
1088
 
1105
- [126]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
1089
+ [124]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
1106
1090
 
1107
- [127]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
1091
+ [125]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
1108
1092
 
1109
- [128]: https://developer.mozilla.org/docs/Web/API/Window
1093
+ [126]: https://developer.mozilla.org/docs/Web/API/Window
1110
1094
 
1111
- [129]: https://developer.mozilla.org/docs/Web/API/MessageEvent
1095
+ [127]: https://developer.mozilla.org/docs/Web/API/MessageEvent
1112
1096
 
1113
- [130]: http://jsonpatch.com
1097
+ [128]: http://jsonpatch.com
1114
1098
 
1115
- [131]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
1099
+ [129]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function