@iebh/tera-fy 1.0.24 → 1.1.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 CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [1.1.0](https://github.com/IEBH/TERA-fy/compare/v1.0.24...v1.1.0) (2024-04-09)
6
+
7
+
8
+ ### Features
9
+
10
+ * File saving UI ([b2f8809](https://github.com/IEBH/TERA-fy/commit/b2f8809a960880b951072127d7492b31aa29b03a))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * Yet more files added to prerelease step ([399c6f8](https://github.com/IEBH/TERA-fy/commit/399c6f8d6c5080238c079c12b16add7eebeb1d7e))
16
+
5
17
  ## [1.0.24](https://github.com/IEBH/TERA-fy/compare/v1.0.23...v1.0.24) (2024-04-05)
6
18
 
7
19
 
package/api.md CHANGED
@@ -721,6 +721,7 @@ Prompt the user to select a library to operate on
721
721
 
722
722
  * `options.title` **[String][119]** The title of the dialog to display (optional, default `"Select a file"`)
723
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`)
724
725
  * `options.filters` **[FileFilters][99]?** Optional file filters
725
726
  * `options.allowUpload` **[Boolean][127]** Allow uploading new files (optional, default `true`)
726
727
  * `options.allowRefresh` **[Boolean][127]** Allow the user to manually refresh the file list (optional, default `true`)
@@ -854,6 +854,7 @@ export default class TeraFy {
854
854
  * @param {Object} [options] Additional options to mutate behaviour
855
855
  * @param {String} [options.title="Select a file"] The title of the dialog to display
856
856
  * @param {String|Array<String>} [options.hint] Hints to identify the file to select in array order of preference
857
+ * @param {Boolean} [options.save=false] Set to truthy if saving a new file, UI will adjust to allowing overwrite OR new file name input
857
858
  * @param {FileFilters} [options.filters] Optional file filters
858
859
  * @param {Boolean} [options.allowUpload=true] Allow uploading new files
859
860
  * @param {Boolean} [options.allowRefresh=true] Allow the user to manually refresh the file list
@@ -886,6 +886,8 @@ export default class TeraFyServer {
886
886
  * @param {Object} [options] Additional options to mutate behaviour
887
887
  * @param {String} [options.title="Select a file"] The title of the dialog to display
888
888
  * @param {String|Array<String>} [options.hint] Hints to identify the file to select in array order of preference
889
+ * @param {Boolean} [options.save=false] Set to truthy if saving a new file, UI will adjust to allowing overwrite OR new file name input
890
+ * @param {String} [options.saveFilename] File name to save as, if omitted the hinting system is used otherwise 'My File.unknown' is assumed
889
891
  * @param {FileFilters} [options.filters] Optional file filters
890
892
  * @param {Boolean} [options.allowUpload=true] Allow uploading new files
891
893
  * @param {Boolean} [options.allowRefresh=true] Allow the user to manually refresh the file list
@@ -900,6 +902,8 @@ export default class TeraFyServer {
900
902
  let settings = {
901
903
  title: 'Select a file',
902
904
  hint: null,
905
+ save: false,
906
+ saveFilename: null,
903
907
  filters: {},
904
908
  allowUpload: true,
905
909
  allowRefresh: true,
@@ -914,9 +918,10 @@ export default class TeraFyServer {
914
918
  .then(files => this.requestFocus(()=>
915
919
  app.service('$prompt').dialog({
916
920
  title: settings.title,
917
- component: 'filesSelect',
921
+ component: settings.save ? 'filesSave' : 'filesOpen',
918
922
  componentProps: {
919
923
  hint: settings.hint,
924
+ saveFilename: settings.saveFilename,
920
925
  allowNavigate: false,
921
926
  allowUpload: settings.allowUpload,
922
927
  allowRefresh: settings.allowRefresh,
@@ -926,6 +931,9 @@ export default class TeraFyServer {
926
931
  filters: settings.filters,
927
932
  },
928
933
  componentEvents: {
934
+ fileSave(filePath) {
935
+ app.service('$prompt').close(true, filePath);
936
+ },
929
937
  fileSelect(file) {
930
938
  app.service('$prompt').close(true, file);
931
939
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iebh/tera-fy",
3
- "version": "1.0.24",
3
+ "version": "1.1.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
  },