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

View file

@ -50,7 +50,7 @@ import {
} from "@nativescript/core";
import * as Permissions from "@nativescript-community/perms";
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 ConfirmDialog from "../modal/ConfirmDialog.vue";
import { mapState, mapActions } from "vuex";
@ -215,16 +215,16 @@ export default {
);
},
openFilePicker() {
Filepicker.create({
mode: "single",
extensions: ["zip"],
})
.present()
.then((selection) => {
// Toast.makeText(localize("vrfy") + "...").show();
let zipPath = selection[0];
this.validateZipContent(zipPath);
});
// Filepicker.create({
// mode: "single",
// extensions: ["zip"],
// })
// .present()
// .then((selection) => {
// // Toast.makeText(localize("vrfy") + "...").show();
// let zipPath = selection[0];
// this.validateZipContent(zipPath);
// });
},
importDataToDB(data, db, zipPath) {
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",
"main": "./app/main.js",
"version": "1.0.0",
"description": "A native application built with NativeScript-Vue",
"homepage": "https://enrecipes.vercel.app/",
@ -12,7 +13,10 @@
},
"license": "GPL",
"author": "Vishnu Raghav <apps@vishnuraghav.com>",
"main": "app/main.js",
"publishConfig": {
"access": "public"
},
"private": "true",
"dependencies": {
"@nativescript-community/perms": "^2.1.5",
"@nativescript-community/ui-collectionview": "^4.0.29",
@ -24,7 +28,6 @@
"@triniwiz/nativescript-couchbase": "^1.2.2",
"nativescript-imagecropper": "^4.0.1",
"nativescript-intl": "^4.0.2",
"nativescript-plugin-filepicker": "^1.0.0",
"nativescript-vue": "^2.8.4",
"vuex": "^3.6.2"
},
@ -35,7 +38,6 @@
"@nativescript/webpack": "5.0.0-beta.0",
"babel-loader": "~8.0.0",
"nativescript-vue-template-compiler": "^2.8.4",
"sass": "^1.32.8",
"vue-loader": "~15.9.6"
"sass": "^1.32.8"
}
}