ns migrate

This commit is contained in:
vishnuraghavb 2021-04-01 18:59:26 +05:30
parent 4a45529a13
commit 80dd4c2018
6 changed files with 552 additions and 648 deletions

View file

@ -301,7 +301,7 @@ import {
Observable, Observable,
} from "@nativescript/core"; } from "@nativescript/core";
import * as Permissions from "@nativescript-community/perms"; import * as Permissions from "@nativescript-community/perms";
import * as Filepicker from "nativescript-plugin-filepicker"; // import * as Filepicker from "nativescript-plugin-filepicker";
import { ImageCropper } from "nativescript-imagecropper"; import { ImageCropper } from "nativescript-imagecropper";
import { localize } from "@nativescript/localize"; import { localize } from "@nativescript/localize";
import { mapState, mapActions } from "vuex"; import { mapState, mapActions } from "vuex";
@ -831,42 +831,42 @@ export default {
}, },
imagePicker() { imagePicker() {
ApplicationSettings.setBoolean("storagePermissionAsked", true); ApplicationSettings.setBoolean("storagePermissionAsked", true);
Filepicker.create({ // Filepicker.create({
mode: "single", // mode: "single",
extensions: ["png", "jpeg", "jpg"], // extensions: ["png", "jpeg", "jpg"],
}) // })
.present() // .present()
.then((selection) => { // .then((selection) => {
this.cacheImagePath = path.join( // this.cacheImagePath = path.join(
knownFolders.temp().path, // knownFolders.temp().path,
`${this.getRandomID()}.jpg` // `${this.getRandomID()}.jpg`
); // );
let imgPath = selection[0]; // let imgPath = selection[0];
ImageSource.fromFile(imgPath).then((image) => { // ImageSource.fromFile(imgPath).then((image) => {
ImageCropper.prototype // ImageCropper.prototype
.show( // .show(
image, // image,
{ // {
width: 1080, // width: 1080,
height: 1080, // height: 1080,
}, // },
{ // {
hideBottomControls: true, // hideBottomControls: true,
toolbarTitle: localize("cPic"), // toolbarTitle: localize("cPic"),
statusBarColor: "#ff5200", // statusBarColor: "#ff5200",
toolbarTextColor: // toolbarTextColor:
this.appTheme == "light" ? "#1A1A1A" : "#e9ecef", // this.appTheme == "light" ? "#1A1A1A" : "#e9ecef",
toolbarColor: // toolbarColor:
this.appTheme == "light" ? "#e9ecef" : "#1A1A1A", // this.appTheme == "light" ? "#e9ecef" : "#1A1A1A",
cropFrameColor: "#ff5200", // cropFrameColor: "#ff5200",
} // }
) // )
.then((cropped) => { // .then((cropped) => {
cropped.image.saveToFile(this.cacheImagePath, "jpg", 75); // cropped.image.saveToFile(this.cacheImagePath, "jpg", 75);
this.recipeContent.imageSrc = this.cacheImagePath; // this.recipeContent.imageSrc = this.cacheImagePath;
}); // });
}); // });
}); // });
}, },
// INPUT FIELD HANDLERS // INPUT FIELD HANDLERS
splitTags() { splitTags() {

View file

@ -50,7 +50,7 @@ import {
} from "@nativescript/core"; } from "@nativescript/core";
import * as Permissions from "@nativescript-community/perms"; import * as Permissions from "@nativescript-community/perms";
import { Zip } from "@nativescript/zip"; import { Zip } from "@nativescript/zip";
import * as Filepicker from "nativescript-plugin-filepicker"; // import * as Filepicker from "nativescript-plugin-filepicker";
import { localize } from "@nativescript/localize"; import { localize } from "@nativescript/localize";
import ConfirmDialog from "../modal/ConfirmDialog.vue"; import ConfirmDialog from "../modal/ConfirmDialog.vue";
import { mapState, mapActions } from "vuex"; import { mapState, mapActions } from "vuex";
@ -215,16 +215,16 @@ export default {
); );
}, },
openFilePicker() { openFilePicker() {
Filepicker.create({ // Filepicker.create({
mode: "single", // mode: "single",
extensions: ["zip"], // extensions: ["zip"],
}) // })
.present() // .present()
.then((selection) => { // .then((selection) => {
// Toast.makeText(localize("vrfy") + "...").show(); // // Toast.makeText(localize("vrfy") + "...").show();
let zipPath = selection[0]; // let zipPath = selection[0];
this.validateZipContent(zipPath); // this.validateZipContent(zipPath);
}); // });
}, },
importDataToDB(data, db, zipPath) { importDataToDB(data, db, zipPath) {
switch (db) { switch (db) {

View file

@ -1,7 +0,0 @@
module.exports = function (api) {
api.cache(true)
return {
presets: [['@babel/env', { targets: { esmodules: true } }]],
}
}

9
jsconfig.json Normal file
View file

@ -0,0 +1,9 @@
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"~/*": ["app/*"]
}
},
"include": ["app/**/*"]
}

1078
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,6 @@
{ {
"name": "enrecipes", "name": "enrecipes",
"main": "./app/main.js",
"version": "1.0.0", "version": "1.0.0",
"description": "A native application built with NativeScript-Vue", "description": "A native application built with NativeScript-Vue",
"homepage": "https://enrecipes.vercel.app/", "homepage": "https://enrecipes.vercel.app/",
@ -12,7 +13,10 @@
}, },
"license": "GPL", "license": "GPL",
"author": "Vishnu Raghav <apps@vishnuraghav.com>", "author": "Vishnu Raghav <apps@vishnuraghav.com>",
"main": "app/main.js", "publishConfig": {
"access": "public"
},
"private": "true",
"dependencies": { "dependencies": {
"@nativescript-community/perms": "^2.1.5", "@nativescript-community/perms": "^2.1.5",
"@nativescript-community/ui-collectionview": "^4.0.29", "@nativescript-community/ui-collectionview": "^4.0.29",
@ -24,7 +28,6 @@
"@triniwiz/nativescript-couchbase": "^1.2.2", "@triniwiz/nativescript-couchbase": "^1.2.2",
"nativescript-imagecropper": "^4.0.1", "nativescript-imagecropper": "^4.0.1",
"nativescript-intl": "^4.0.2", "nativescript-intl": "^4.0.2",
"nativescript-plugin-filepicker": "^1.0.0",
"nativescript-vue": "^2.8.4", "nativescript-vue": "^2.8.4",
"vuex": "^3.6.2" "vuex": "^3.6.2"
}, },
@ -35,7 +38,6 @@
"@nativescript/webpack": "5.0.0-beta.0", "@nativescript/webpack": "5.0.0-beta.0",
"babel-loader": "~8.0.0", "babel-loader": "~8.0.0",
"nativescript-vue-template-compiler": "^2.8.4", "nativescript-vue-template-compiler": "^2.8.4",
"sass": "^1.32.8", "sass": "^1.32.8"
"vue-loader": "~15.9.6"
} }
} }