@iebh/tera-fy 1.0.24 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/api.md +192 -207
- package/dist/terafy.es2019.js +1 -1
- package/dist/terafy.js +1 -1
- package/hints.md +0 -9
- package/lib/projectFile.js +2 -2
- package/lib/terafy.client.js +12 -21
- package/lib/terafy.server.js +77 -25
- package/package.json +2 -2
- package/widgets/tera-file-select.vue +19 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iebh/tera-fy",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "TERA website worker",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "esbuild --platform=browser --format=esm --bundle lib/terafy.client.js --outfile=dist/terafy.js --minify --serve --servedir=.",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
},
|
|
87
87
|
"commit-and-tag-version": {
|
|
88
88
|
"scripts": {
|
|
89
|
-
"prerelease": "npm run build && git add docs dist",
|
|
89
|
+
"prerelease": "npm run build && git add api.md docs dist",
|
|
90
90
|
"postcommit": "npm publish"
|
|
91
91
|
}
|
|
92
92
|
},
|
|
@@ -4,22 +4,27 @@
|
|
|
4
4
|
* Most of the options are copied from the $teraFy.selectProjectFile() API call that this component wraps
|
|
5
5
|
* @see https://github.com/IEBH/TERA-fy
|
|
6
6
|
*
|
|
7
|
-
* @
|
|
8
|
-
* @
|
|
9
|
-
* @param {Boolean} [allowUpload=true] Allow uploading new files
|
|
10
|
-
* @param {Boolean} [allowRefresh=true] Allow the user to manually refresh the file list
|
|
11
|
-
* @param {Boolean} [allowDownloadZip=true] Allow the user to download a Zip of all files
|
|
12
|
-
* @param {Boolean} [allowCancel=true] Allow cancelling the operation. Will throw `'CANCEL'` as the promise rejection if acationed
|
|
13
|
-
* @param {Boolean} [autoRequire=true] Run `requireProject()` automatically before continuing
|
|
14
|
-
* @param {FileFilters} [filters] Optional file filters, defaults to citation library selection only
|
|
15
|
-
* @param {String} [placeholder="Select a file..."] Placeholder text to show when no file is selected
|
|
7
|
+
* @prop {Boolean} [save=false] Prompt for either a new filename or overwriting an existing file, if false only show files to open
|
|
8
|
+
* @prop {String} [saveFilename] Optional suggested filename when saving
|
|
16
9
|
*
|
|
17
|
-
* @
|
|
10
|
+
* @prop {String} [title="Select a citation library"] The title of the file selection display
|
|
11
|
+
* @prop {String|Array<String>} [hint] Hints to identify the library to select in array order of preference. Generally corresponds to the previous stage
|
|
12
|
+
* @prop {Boolean} [allowUpload=true] Allow uploading new files
|
|
13
|
+
* @prop {Boolean} [allowRefresh=true] Allow the user to manually refresh the file list
|
|
14
|
+
* @prop {Boolean} [allowDownloadZip=true] Allow the user to download a Zip of all files
|
|
15
|
+
* @prop {Boolean} [allowCancel=true] Allow cancelling the operation. Will throw `'CANCEL'` as the promise rejection if acationed
|
|
16
|
+
* @prop {Boolean} [autoRequire=true] Run `requireProject()` automatically before continuing
|
|
17
|
+
* @prop {FileFilters} [filters] Optional file filters, defaults to citation library selection only
|
|
18
|
+
*
|
|
19
|
+
* @prop {String} [placeholder="Select a file..."] Placeholder text to show when no file is selected
|
|
20
|
+
*
|
|
21
|
+
* @emits change Fired as `(file:ProjectFile)` when the contents changes
|
|
18
22
|
*
|
|
19
23
|
* @slot selected Slot to show when a file is selected. Contains the bindings `({selected})`
|
|
20
24
|
* @slot deselected Slot to show when no file is selected. Contains the bindings `({})`
|
|
21
25
|
*/
|
|
22
26
|
export default {
|
|
27
|
+
emits: ['change'],
|
|
23
28
|
data() { return {
|
|
24
29
|
/**
|
|
25
30
|
* The currently selected library, if any
|
|
@@ -29,6 +34,8 @@ export default {
|
|
|
29
34
|
}},
|
|
30
35
|
props: {
|
|
31
36
|
// Props passed to $teraFy.selectProjectFile()
|
|
37
|
+
save: {type: Boolean, default: false},
|
|
38
|
+
saveFilename: {type: String},
|
|
32
39
|
title: {type: String, default: 'Select a citation library'},
|
|
33
40
|
hint: {type: [String, Array]},
|
|
34
41
|
allowUpload: {type: Boolean, default: true},
|
|
@@ -53,6 +60,8 @@ export default {
|
|
|
53
60
|
*/
|
|
54
61
|
async choose() {
|
|
55
62
|
this.selected = await this.$tera.selectProjectFile({
|
|
63
|
+
save: this.save,
|
|
64
|
+
saveFiename: this.saveFilename,
|
|
56
65
|
title: this.title,
|
|
57
66
|
hint: this.hint,
|
|
58
67
|
allowUpload: this.allowUpload,
|