diff --git a/.gitignore b/.gitignore index fdc0c4a..d2e1429 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,5 @@ -*.iml -.gradle -/local.properties -/.idea/caches -/.idea/libraries -/.idea/modules.xml -/.idea/workspace.xml -/.idea/navEditor.xml -/.idea/assetWizardSettings.xml -.DS_Store -/build -/captures -.externalNativeBuild -/entry/.preview -.cxx /node_modules +/local.properties +/.idea +**/build +/signature diff --git a/settings.gradle b/AppScope/app.json5 similarity index 65% rename from settings.gradle rename to AppScope/app.json5 index 24624c5..0a0494f 100644 --- a/settings.gradle +++ b/AppScope/app.json5 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,9 +12,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -include ':phone', ':tablet', ':pc',':common:utils', ':common:component' - -project(':tablet').projectDir = new File('./product/tablet') -project(':phone').projectDir = new File('./product/phone') -project(':pc').projectDir = new File('./product/pc') +{ + "app": { + "bundleName": "com.ohos.note", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name", + "distributedNotificationEnabled": true + } +} diff --git a/AppScope/resources/base/element/string.json b/AppScope/resources/base/element/string.json new file mode 100644 index 0000000..ff36e7c --- /dev/null +++ b/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohos_note" + } + ] +} diff --git a/product/phone/src/main/resources/base/media/note.png b/AppScope/resources/base/media/app_icon.png similarity index 100% rename from product/phone/src/main/resources/base/media/note.png rename to AppScope/resources/base/media/app_icon.png diff --git a/LICENSE b/LICENSE index d0381d6..b9b9d2a 100644 --- a/LICENSE +++ b/LICENSE @@ -173,4 +173,4 @@ Apache License incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - END OF TERMS AND CONDITIONS + END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/build-profile.json5 b/build-profile.json5 new file mode 100644 index 0000000..df83ecd --- /dev/null +++ b/build-profile.json5 @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "app": { + "compileSdkVersion": 9, + "compatibleSdkVersion": 9, + "products": [ + { + "name": "default", + } + ] + }, + "modules": [ + { + "name": "phone", + "srcPath": "./product/phone", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + }, + { + "name": "tablet", + "srcPath": "./product/tablet", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + }, + { + "name": "utils", + "srcPath": "./common/utils" + }, + { + "name": "component", + "srcPath": "./common/component" + }, + { + "name": "resources", + "srcPath": "./common/resources" + } + ] +} \ No newline at end of file diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 6355c70..0000000 --- a/build.gradle +++ /dev/null @@ -1,38 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. -apply plugin: 'com.huawei.ohos.app' - -//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 -ohos { - compileSdkVersion 8 - supportSystem "standard" -} - -buildscript { - repositories { - maven { - url 'http://repo.ark.tools.huawei.com/artifactory/maven-public/' - allowInsecureProtocol = true - } - maven { - url 'http://mirrors.tools.huawei.com/maven/' - allowInsecureProtocol = true - } - } - dependencies { - classpath 'com.huawei.ohos:hap:3.0.6.4' - classpath 'com.huawei.ohos:decctest:1.2.7.2' - } -} - -allprojects { - repositories { - maven { - url 'http://repo.ark.tools.huawei.com/artifactory/maven-public/' - allowInsecureProtocol = true - } - maven { - url 'http://mirrors.tools.huawei.com/maven/' - allowInsecureProtocol = true - } - } -} diff --git a/common/component/.gitignore b/common/component/.gitignore new file mode 100644 index 0000000..4f9a973 --- /dev/null +++ b/common/component/.gitignore @@ -0,0 +1,3 @@ +/node_modules +/.preview +/build \ No newline at end of file diff --git a/common/component/build-profile.json5 b/common/component/build-profile.json5 new file mode 100644 index 0000000..c6e5a1e --- /dev/null +++ b/common/component/build-profile.json5 @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "apiType": "stageMode", + "buildOption": { + } +} diff --git a/common/component/build.gradle b/common/component/build.gradle deleted file mode 100644 index 17f0e43..0000000 --- a/common/component/build.gradle +++ /dev/null @@ -1,20 +0,0 @@ -apply plugin: 'com.huawei.ohos.library' -//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 -ohos { - compileSdkVersion 8 - defaultConfig { - compatibleSdkVersion 8 - } - - buildTypes { - release { - proguardOpt { - proguardEnabled false - rulesFiles 'proguard-rules.pro' - } - } - } -} - -dependencies { -} diff --git a/common/component/hvigorfile.js b/common/component/hvigorfile.js new file mode 100644 index 0000000..42ed4b4 --- /dev/null +++ b/common/component/hvigorfile.js @@ -0,0 +1,3 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +module.exports = require('@ohos/hvigor-ohos-plugin').harTasks + diff --git a/common/component/index.ets b/common/component/index.ets new file mode 100644 index 0000000..1c1e0b7 --- /dev/null +++ b/common/component/index.ets @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './src/main/ets/components/CusDialogComp'; +export * from './src/main/ets/components/FolderListComp'; +export * from './src/main/ets/components/NoteContent'; +export { ToolBarComp, NoteContentComp, NoteContentOverViewComp } from './src/main/ets/components/NoteContentComp'; +export { NoteContentCompPortrait } from './src/main/ets/components/NoteContentCompPortrait'; +export * from './src/main/ets/components/NoteListComp'; \ No newline at end of file diff --git a/common/component/package-lock.json b/common/component/package-lock.json new file mode 100644 index 0000000..db5fde3 --- /dev/null +++ b/common/component/package-lock.json @@ -0,0 +1,22 @@ +{ + "name": "@ohos/component", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@ohos/source": { + "version": "file:../resources" + }, + "@ohos/utils": { + "version": "file:../utils", + "requires": { + "@ohos/source": "file:../resources" + }, + "dependencies": { + "@ohos/source": { + "version": "file:../resources" + } + } + } + } +} diff --git a/common/component/package.json b/common/component/package.json new file mode 100644 index 0000000..a378052 --- /dev/null +++ b/common/component/package.json @@ -0,0 +1,17 @@ +{ + "license":"ISC", + "types":"", + "devDependencies":{}, + "name":"@ohos/component", + "description":"a npm package which contains arkUI2.0 page", + "ohos":{ + "org":"" + }, + "main":"index.ets", + "repository":{}, + "version":"1.0.0", + "dependencies":{ + "@ohos/utils":"file:../utils", + "@ohos/source":"file:../resources" + } +} \ No newline at end of file diff --git a/common/component/proguard-rules.pro b/common/component/proguard-rules.pro deleted file mode 100644 index f7666e4..0000000 --- a/common/component/proguard-rules.pro +++ /dev/null @@ -1 +0,0 @@ -# config module specific ProGuard rules here. \ No newline at end of file diff --git a/common/component/src/main/config.json b/common/component/src/main/config.json deleted file mode 100644 index fa515b0..0000000 --- a/common/component/src/main/config.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.note", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.note.common", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "component", - "moduleType": "har" - } - } -} \ No newline at end of file diff --git a/common/component/src/main/ets/default/CusDialogComp.ets b/common/component/src/main/ets/components/CusDialogComp.ets similarity index 90% rename from common/component/src/main/ets/default/CusDialogComp.ets rename to common/component/src/main/ets/components/CusDialogComp.ets index 563ac53..82e011f 100644 --- a/common/component/src/main/ets/default/CusDialogComp.ets +++ b/common/component/src/main/ets/components/CusDialogComp.ets @@ -13,14 +13,14 @@ * limitations under the License. */ -import FolderData from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/FolderData.ets' -import NoteData from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/NoteData.ets' -import {circleColorArray, fontColorArray} from '../../../../../../common/utils/src/main/ets/default/model/NoteBaseData.ets' -import {SysDefFolderUuid, DeleteFileType, FolderType} from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/EnumData.ets' -import GlobalResourceManager from '../../../../../../common/utils/src/main/ets/default/baseUtil/GlobalResourceManager.ets' -import FolderUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/FolderUtil.ets' -import NoteUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/NoteUtil.ets' -import {LogUtil} from '../../../../../../common/utils/src/main/ets/default/baseUtil/LogUtil.ets' +import GlobalResourceManager from '@ohos/utils/src/main/ets/default/baseUtil/GlobalResourceManager' +import FolderData from '@ohos/utils/src/main/ets/default/model/databaseModel/FolderData' +import FolderUtil from '@ohos/utils/src/main/ets/default/baseUtil/FolderUtil' +import NoteData from '@ohos/utils/src/main/ets/default/model/databaseModel/NoteData' +import NoteUtil from '@ohos/utils/src/main/ets/default/baseUtil/NoteUtil' +import { circleColorArray, fontColorArray, SysDefFolderUuid, DeleteFileType, FolderType, LogUtil } from '@ohos/utils' + +const TAG = "CusDialogComp" const TAG = "CusDialogComp" @CustomDialog @@ -51,16 +51,17 @@ export struct NewOrEditFolderDialog { // folder name input Flex({ wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceBetween }) { Image($r("app.media.folder")) + .objectFit(ImageFit.Fill) .width(24) .height(24) - .objectFit(ImageFit.ScaleDown) + .flexShrink(0) .fillColor(this.selectedColor) TextInput({ text: this.inputName, placeholder: $r("app.string.input_placeholder") }) .placeholderFont({ size: 18 }) .maxLength(20) .borderRadius(15) .backgroundColor($r("app.color.New_folder_input_box_color")) - .width('90%') + .width('100%') .onChange((value: string) => { this.inputName = value FolderUtil.duplicateDetection(this.inputName, this.AllFolderArray).then(result => { @@ -69,15 +70,17 @@ export struct NewOrEditFolderDialog { }) }.margin({ bottom: 4, left: 24, right: 24 }) - Text($r("app.string.category_already_exist")) - .fontSize(10) - .margin({ left: 64 }) - .fontColor($r("app.color.category_already_exist_font_color")) - .visibility((this.isExisted && this.inputName != this.oriInputName) ? Visibility.Visible : Visibility.None) Divider() .height(1) .margin({ left: 64, right: 24 }) - .color($r("app.color.divider_color_182431")) + .color((this.isExisted && this.inputName != this.oriInputName) ? $r("app.color.category_already_exist_divider_color") : $r("app.color.divider_color_182431")) + + Text($r("app.string.category_already_exist")) + .fontSize(10) + .margin({ left: 64, top: 4 }) + .fontColor($r("app.color.category_already_exist_font_color")) + .visibility((this.isExisted && this.inputName != this.oriInputName) ? Visibility.Visible : Visibility.None) + // button group Flex({ wrap: FlexWrap.Wrap, justifyContent: FlexAlign.SpaceBetween }) { Text($r("app.string.cancel")) @@ -253,14 +256,16 @@ struct NoteDataMoveItemComp { @StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = [] @StorageLink('AllFolderArray') AllFolderArray: FolderData[] = [] private folderItem: FolderData + dividerShow: boolean = true build() { Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap }) { Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap }) { Image(FolderUtil.getFolderIcon(this.folderItem.uuid)) - .objectFit(ImageFit.ScaleDown) + .objectFit(ImageFit.Fill) .width(24) .height(24) + .flexShrink(0) .fillColor(FolderUtil.getFolderIconColor(this.AllFolderArray, this.folderItem.uuid, false)) } .width(24) @@ -273,18 +278,23 @@ struct NoteDataMoveItemComp { .maxLines(1) .textOverflow({ overflow: TextOverflow.Ellipsis }) .flexShrink(1) + .fontWeight(FontWeight.Medium) Image((FolderUtil.getCommonFolder(this.AllFolderArray, this.CheckedNoteArray) == null || FolderUtil.getCommonFolder(this.AllFolderArray, this.CheckedNoteArray) != this.folderItem) ? $r("app.media.foldMove_unselect") : $r("app.media.foldMove_select")) - .objectFit(ImageFit.ScaleDown) + .objectFit(ImageFit.Fill) .width(24) .height(24) + .flexShrink(0) } .width(248) .height(55) - Divider() - .color($r("app.color.divider_color_e4e4e4")) - .strokeWidth(1) + if (this.dividerShow) { + Divider() + .color($r("app.color.divider_color_e4e4e4")) + .strokeWidth(1) + } + } .padding({ left: 16 }) } @@ -298,18 +308,26 @@ struct NoteDataMoveItemComp { export struct NoteDataMoveDialog { noteDataMoveDialogCtl: CustomDialogController onConfirm: (folderUuid: string) => void + NoteDataMoveArray: FolderData[] @StorageLink('AllFolderArray') AllFolderArray: FolderData[] = [] + aboutToAppear() { + this.NoteDataMoveArray = this.AllFolderArray.slice(2, this.AllFolderArray.length); + this.NoteDataMoveArray.push(this.AllFolderArray[1]); + } + build() { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap }) { Flex({ alignItems: ItemAlign.Center }) { Text($r("app.string.chooseFolder")) .fontSize(20) + .fontWeight(600) + .fontWeight(FontWeight.Medium) }.height(56) .width(288) List() { - ForEach(this.AllFolderArray, (item) => { + ForEach(this.NoteDataMoveArray.slice(0, this.NoteDataMoveArray.length - 1), (item) => { ListItem() { NoteDataMoveItemComp({ folderItem: item }) } @@ -318,6 +336,13 @@ export struct NoteDataMoveDialog { this.onConfirm(item.uuid) }) }, noteItem => noteItem.uuid) + ListItem() { + NoteDataMoveItemComp({ folderItem: this.NoteDataMoveArray[this.NoteDataMoveArray.length - 1], dividerShow: false }) + } + .onClick(() => { + this.noteDataMoveDialogCtl.close() + this.onConfirm(this.NoteDataMoveArray[this.NoteDataMoveArray.length - 1].uuid) + }) }.listDirection(Axis.Vertical) .edgeEffect(EdgeEffect.Spring) .height(this.AllFolderArray.length > 12 ? 504 : (this.AllFolderArray.length - 3) * 56) @@ -325,7 +350,7 @@ export struct NoteDataMoveDialog { Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Text($r("app.string.cancel")) .fontSize(16) - .fontColor($r("app.color.text_color_3f97e9")) + .fontColor($r("app.color.button_color_f86d05")) .onClick(() => { this.noteDataMoveDialogCtl.close() }) @@ -341,15 +366,18 @@ export struct NoteDataMoveDialog { } } +let inSetValue = AppStorage.Link('inSetValue') @CustomDialog export struct EditContentDialog { editContentDialogCtl: CustomDialogController confirm: (excuteJs: string) => void - @Consume('SelectedColor') selectedColor: string - @State inSetValue: number = 20 + @State selectFontColor: string = fontColorArray[0] + @StorageLink("inSetValue") inSetValue: number = 4 private circleColor: string private fontSize: number - + aboutToAppear(){ + this.confirm("javascript:RICH_EDITOR.getFontSizes()") + } build() { Row() { Column() { @@ -451,6 +479,7 @@ export struct EditContentDialog { Image($r('app.media.suojin_back')) .height(24) .width(24) + .responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 }) .onClick(() => { this.confirm("javascript:RICH_EDITOR.setOutdent()") }) @@ -541,10 +570,10 @@ export struct EditContentDialog { .fill(colorStr) Circle({ width: 12, height: 12 }) .fill($r("app.color.color_ffffff")) - .visibility(colorStr == this.selectedColor ? Visibility.Visible : Visibility.None) + .visibility(colorStr == this.selectFontColor ? Visibility.Visible : Visibility.None) }.onClick(() => { - this.selectedColor = colorStr - this.confirm("javascript:RICH_EDITOR.setTextColor('" + this.selectedColor + "')") + this.selectFontColor = colorStr + this.confirm("javascript:RICH_EDITOR.setTextColor('" + this.selectFontColor + "')") }) }, colorStr => colorStr) }.padding({ bottom: 11 }) @@ -564,8 +593,8 @@ export struct EditContentDialog { Slider({ value: this.inSetValue, min: 0, - max: 60, - step: 10, + max: 16, + step: 4, style: SliderStyle.InSet }) .blockColor($r("app.color.color_ffffff")) @@ -574,8 +603,8 @@ export struct EditContentDialog { .showSteps(false) .showTips(false) .onChange((value: number, mode: SliderChangeMode) => { - this.inSetValue = value - this.fontSize = value + 20 + AppStorage.Set('inSetValue', value) + this.fontSize = value + 12 this.confirm("javascript:RICH_EDITOR.execFontSize('" + this.fontSize + "')") LogUtil.info(TAG, 'value:' + value + 'mode:' + mode.toString()) }) @@ -668,13 +697,11 @@ export struct EditTitleDialog { export struct EditContentDialogPortrait { editContentDialogCtl: CustomDialogController; confirm: (excuteJs: string) => void - @Consume('SelectedColor') selectedColor: string; + @State selectFontColor: string = fontColorArray[0] @State inSetValue: number = 20 private circleColor: string private fontSize: number - - build() { Column() { Flex({ direction: FlexDirection.Row, wrap: FlexWrap.NoWrap, @@ -682,7 +709,7 @@ export struct EditContentDialogPortrait { Text($r("app.string.style")).margin({ top: 8 }) .fontSize(14).fontColor($r("app.color.font_stylecolor_AD182431")) - Image($r('app.media.cross')).height(16).width(16).margin({ top: 8 }) + Image($r('app.media.cross')).height(16).width(16).margin({ top: 8 }).fillColor($r("app.color.font_stylecolor_AD182431")) .onClick(() => { this.editContentDialogCtl.close() }) @@ -786,6 +813,7 @@ export struct EditContentDialogPortrait { Image($r('app.media.suojin_back')) .height(24) .width(24) + .responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 }) .onClick(() => { this.confirm("javascript:RICH_EDITOR.setOutdent()") }) @@ -852,10 +880,10 @@ export struct EditContentDialogPortrait { Stack({ alignContent: Alignment.Center }) { Circle({ width: 24, height: 24 }).fill(colorStr) Circle({ width: 12, height: 12 }).fill($r("app.color.color_ffffff")) - .visibility(colorStr == this.selectedColor ? Visibility.Visible : Visibility.None) + .visibility(colorStr == this.selectFontColor ? Visibility.Visible : Visibility.None) }.onClick(() => { - this.selectedColor = colorStr - this.confirm("javascript:RICH_EDITOR.setTextColor('" + this.selectedColor + "')") + this.selectFontColor = colorStr + this.confirm("javascript:RICH_EDITOR.setTextColor('" + this.selectFontColor + "')") }) }, colorStr => colorStr) } @@ -870,8 +898,8 @@ export struct EditContentDialogPortrait { Slider({ value: this.inSetValue, min: 0, - max: 60, - step: 10, + max: 16, + step: 4, style: SliderStyle.InSet }) .blockColor($r("app.color.color_ffffff")) @@ -881,7 +909,7 @@ export struct EditContentDialogPortrait { .showTips(false) .onChange((value: number, mode: SliderChangeMode) => { this.inSetValue = value - this.fontSize = value + 20 + this.fontSize = value + 12 this.confirm("javascript:RICH_EDITOR.execFontSize('" + this.fontSize + "')") LogUtil.info(TAG, 'value:' + value + 'mode:' + mode.toString()) }) diff --git a/common/component/src/main/ets/default/FolderListComp.ets b/common/component/src/main/ets/components/FolderListComp.ets similarity index 83% rename from common/component/src/main/ets/default/FolderListComp.ets rename to common/component/src/main/ets/components/FolderListComp.ets index 56199f6..52062cf 100644 --- a/common/component/src/main/ets/default/FolderListComp.ets +++ b/common/component/src/main/ets/components/FolderListComp.ets @@ -13,15 +13,15 @@ * limitations under the License. */ -import FolderData from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/FolderData.ets' -import NoteData from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/NoteData.ets' -import {SysDefFolderUuid, TableName, FolderType, FolderTableColumn, NoteTableColumn, Delete, DeleteFileType} from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/EnumData.ets' -import {NewOrEditFolderDialog, DeleteDialog} from './CusDialogComp.ets' -import StyleConstants from '../../../../../../common/utils/src/main/ets/default/constants/StyleConstants.ets' -import RdbStoreUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/RdbStoreUtil.ets' -import FolderUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/FolderUtil.ets' -import NoteUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/NoteUtil.ets' -import {LogUtil} from '../../../../../../common/utils/src/main/ets/default/baseUtil/LogUtil.ets' +import FolderData from '@ohos/utils/src/main/ets/default/model/databaseModel/FolderData' +import NoteData from '@ohos/utils/src/main/ets/default/model/databaseModel/NoteData' +import {SysDefFolderUuid, TableName, FolderType, FolderTableColumn, NoteTableColumn, Delete, DeleteFileType} from '@ohos/utils/src/main/ets/default/model/databaseModel/EnumData' +import {NewOrEditFolderDialog, DeleteDialog} from './CusDialogComp' +import StyleConstants from '@ohos/utils/src/main/ets/default/constants/StyleConstants' +import RdbStoreUtil from '@ohos/utils/src/main/ets/default/baseUtil/RdbStoreUtil' +import FolderUtil from '@ohos/utils/src/main/ets/default/baseUtil/FolderUtil' +import NoteUtil from '@ohos/utils/src/main/ets/default/baseUtil/NoteUtil' +import {LogUtil} from '@ohos/utils/src/main/ets/default/baseUtil/LogUtil' // Folder list component @Component @@ -33,41 +33,43 @@ export struct FolderListComp { TAG = "FolderListComp" build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center }) { + Flex({direction: FlexDirection.Column, justifyContent: FlexAlign.SpaceBetween}) { Column() { - Image($r("app.media.suojin")) - .height(24) - .width(24) - .onClick(() => { - if (this.sectionStatus == 1) { - this.expandStatus = !this.expandStatus - AppStorage.SetOrCreate('ContinueExpand', this.expandStatus) - } else { - this.sectionStatus = (this.sectionStatus == 3 ? 2 : 3) - // 迁移 - LogUtil.info(this.TAG, "FolderListComp, set continue section") - AppStorage.SetOrCreate('ContinueSection', this.sectionStatus) - LogUtil.info(this.TAG, "FolderListComp, set continue section success") - } - }) - }.alignItems(HorizontalAlign.Start) - .width("100%") - .margin({ top: 28 }) - .padding({ left: 24 }) + Column() { + Image($r("app.media.suojin")) + .height(24) + .width(24) + .responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 }) + .onClick(() => { + if (this.sectionStatus == 1) { + this.expandStatus = !this.expandStatus + } else { + this.sectionStatus = (this.sectionStatus == 3 ? 2 : 3) + // save continue data + AppStorage.SetOrCreate('ContinueSection', this.sectionStatus) + LogUtil.info(this.TAG, "FolderListComp, set continue section success") + } + }) + }.alignItems(HorizontalAlign.Start) + .width("100%") + .margin({ top: 28 }) + .padding({ left: 24 }) NoteAndCreateComp() // center - List() { - ForEach(this.AllFolderArray, (folderItem: FolderData) => { - ListItem() { - if (!FolderUtil.isBottomFixedFolder(folderItem)) { - FolderItemComp({ folderItem: folderItem, controllerShow: this.controllerShow }) + List() { + ForEach(this.AllFolderArray, (folderItem: FolderData) => { + ListItem() { + if (!FolderUtil.isBottomFixedFolder(folderItem)) { + FolderItemComp({ folderItem: folderItem, controllerShow: this.controllerShow }) + } } - } - }, folderItem => folderItem.name.toString()) - }.width('100%') - .padding({ left: 12, right: 12 }) - Blank() + }, folderItem => folderItem.name.toString()) + }.width('100%') + .padding({ left: 12, right: 12 }) + } + + Column() { FolderItemComp({ folderItem: FolderUtil.getFolderData(AppStorage.Get('AllFolderArray'), SysDefFolderUuid.MyFavorites), @@ -81,7 +83,7 @@ export struct FolderListComp { .width("100%") .padding({ left: 12, right: 12 }) } - .padding({ bottom: 48 }) + .padding({ bottom: 24 }) .height("100%") } @@ -92,7 +94,6 @@ export struct FolderListComp { aboutToDisappear(): void{ LogUtil.info(this.TAG, "aboutToDisappear") } - } @Component @@ -326,12 +327,13 @@ struct FolderItemComp { Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceBetween }) { Row() { Image(FolderUtil.getFolderIcon(this.folderItem.uuid)) - .objectFit(ImageFit.ScaleDown) + .objectFit(ImageFit.Fill) .width(24) .height(24) .fillColor(FolderUtil.getFolderIconColor(this.AllFolderArray, this.folderItem.uuid, this.selectedFolderData.uuid == this.folderItem.uuid)) .margin({ right: 16 }) Text(FolderUtil.getFolderText(this.folderItem)) + .fontWeight(FontWeight.Medium) .fontSize(16) .textAlign(TextAlign.Center) .maxLines(1) @@ -343,6 +345,7 @@ struct FolderItemComp { }.width(118) Text(FolderUtil.getNoteCount(AppStorage.Get('AllNoteArray'), this.folderItem.uuid).toString()) + .fontWeight(FontWeight.Regular) .fontSize(14) .textAlign(TextAlign.Center) } @@ -351,7 +354,7 @@ struct FolderItemComp { .height(56) .padding({ left: 12, right: 12 }) .backgroundColor(this.isLongPress ? $r("app.color.folder_color_19182431") : this.selectedFolderData.uuid == this.folderItem.uuid - ? $r("app.color.folder_color_ffffff") : $r("app.color.folder_color_19ffffff")) + ? $r("app.color.folder_color_ffffff") : "") .bindContextMenu(this.menuBuilder, ResponseType.LongPress) .bindContextMenu(this.menuBuilder, ResponseType.RightClick) .onClick(() => { @@ -362,7 +365,11 @@ struct FolderItemComp { this.selectedFolderData = this.folderItem this.selectedNoteData = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), this.folderItem.uuid) // 刷新web界面 - this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')" }) + if (this.portraitModel == false) { + this.controllerShow.runJavaScript({ + script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')" + }) + } // save continue data let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) AppStorage.SetOrCreate('ContinueNote', continueNote) @@ -387,4 +394,21 @@ struct FolderItemComp { ) ) } +} + + +@Component +export struct FolderListBackGround { + build() { + Column() { } + .shadow({ + radius: 54, + offsetY: 24 + }) + .width("100%") + .height("100%") + .backgroundColor($r('app.color.folder_color_d6d6d6')) + .opacity(0.4) + .blur(60) + } } \ No newline at end of file diff --git a/common/component/src/main/ets/components/NoteContent.ets b/common/component/src/main/ets/components/NoteContent.ets new file mode 100644 index 0000000..2a4c95f --- /dev/null +++ b/common/component/src/main/ets/components/NoteContent.ets @@ -0,0 +1,449 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import DateUtil from '@ohos/utils/src/main/ets/default/baseUtil/DateUtil' +import RdbStoreUtil from '@ohos/utils/src/main/ets/default/baseUtil/RdbStoreUtil' +import FolderData from '@ohos/utils/src/main/ets/default/model/databaseModel/FolderData' +import NoteData from '@ohos/utils/src/main/ets/default/model/databaseModel/NoteData' +import {TableName, NoteTableColumn, SysDefFolderUuid, Favorite, Delete +} from '@ohos/utils/src/main/ets/default/model/databaseModel/EnumData' +import StyleConstants from '@ohos/utils/src/main/ets/default/constants/StyleConstants' +import {EditContentDialog, DeleteDialog, EditTitleDialog} from './CusDialogComp' +import FolderUtil from '@ohos/utils/src/main/ets/default/baseUtil/FolderUtil' +import NoteUtil from '@ohos/utils/src/main/ets/default/baseUtil/NoteUtil' +import prompt from '@system.prompt' +import featureAbility from '@ohos.ability.featureAbility' +import {LogUtil} from '@ohos/utils/src/main/ets/default/baseUtil/LogUtil' +import OperationUtils from '@ohos/utils/src/main/ets/default/baseUtil/OperationUtils' +import mediaquery from '@ohos.mediaquery' +import router from '@system.router'; +import inputMethod from '@ohos.inputmethod'; + +const TAG = "NoteContent" + +var timeID: number + +@Component +export struct NoteContent { + @Provide('SelectedNoteData') selectedNoteData: NoteData = AppStorage.Get('NewNote') + @StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray') + @Provide('Issave') issave: number = 0 + @Provide('EditModel') editModel: boolean = false + controllerShow: WebController + private editContentFlag = false + + noteContent = { + callbackhtml: (html) => { + LogUtil.info(TAG, 'note uuid is:' + this.selectedNoteData.uuid) + this.selectedNoteData.content_text = html + this.selectedNoteData.modified_time = new Date().getTime() + // updata note image + this.selectedNoteData.content_img = RdbStoreUtil.updataNoteImage(this.selectedNoteData) + let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) + predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) + RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) + LogUtil.info(TAG, 'update note success:' + this.selectedNoteData.uuid) + AppStorage.SetOrCreate('NewNote', this.selectedNoteData) + AppStorage.SetOrCreate('needRefresh',true) + // save continue data + let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) + AppStorage.SetOrCreate('ContinueNote', continueNote) + LogUtil.info(TAG, "callbackhtml, set continue note success") + }, + + callbackScheduledSave: (html) => { + LogUtil.info(TAG, 'callbackScheduledSave') + this.selectedNoteData.content_text = html + this.selectedNoteData.modified_time = new Date().getTime() + // updata note image + this.selectedNoteData.content_img = RdbStoreUtil.updataNoteImage(this.selectedNoteData) + let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) + predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) + RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) + LogUtil.info(TAG, 'callbackScheduledSave, update note success:' + this.selectedNoteData.uuid) + // save continue data + let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) + LogUtil.info(TAG, 'continueNote content', continueNote) + AppStorage.SetOrCreate('ContinueNote', continueNote) + LogUtil.info(TAG, 'callbackScheduledSave, set continue note success') + } + } + + build() { + Stack({ alignContent: Alignment.Bottom }) { + Flex({ direction: FlexDirection.Column, wrap: FlexWrap.NoWrap, + alignItems: ItemAlign.Start, alignContent: FlexAlign.SpaceAround }) { + Column() { + ToolBarComp({ controllerShow: this.controllerShow }) + }.margin({ left: 24, right: 24 }) + + Column() { + NoteContentOverViewComp() + + Web({ src: $rawfile('editor.html'), controller: this.controllerShow }) + .javaScriptAccess(true) + .onPageEnd((e) => { + if (this.editContentFlag == false) { + this.controllerShow.registerJavaScriptProxy({ + object: this.noteContent, + name: "callBackToApp", // html--> name.method + methodList: ["callbackhtml", "callbackScheduledSave"], + }) + LogUtil.info(TAG, "finish register") + this.controllerShow.refresh() + this.editContentFlag = true + } + LogUtil.info(TAG, "finish loadurl") + this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')" }) + }) + .zoomAccess(false) + .height('70%') + .width('100%') + } + .margin({ left: 12, right: 24, top: 16 }) + .width(StyleConstants.PERCENTAGE_100) + .onClick(() => { + // 添加定时器:3s自动保存 + timeID = setInterval(() => { + this.controllerShow.runJavaScript({ script: "scheduled_save_content()" }) + }, 3000) + LogUtil.info(TAG, "setInterval timeID : " + timeID) + this.issave = 0 + this.editModel = true + }) + } + .height(StyleConstants.PERCENTAGE_100) + } + .height(StyleConstants.PERCENTAGE_100) + .width(StyleConstants.PERCENTAGE_100) + } + + aboutToAppear(): void{ + LogUtil.info(TAG, "aboutToAppear") + } + + aboutToDisappear(): void{ + LogUtil.info(TAG, "aboutToDisappear") + } +} + +@Component +export struct ToolBarComp { + @Consume('SelectedNoteData') selectedNoteData: NoteData + @StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray') + @Consume('Issave') issave: number + @Consume('EditModel') editModel: boolean + controllerShow: WebController + + editContentDialogCtl: CustomDialogController = new CustomDialogController({ + builder: EditContentDialog({ confirm: this.confirm.bind(this) }), + alignment: DialogAlignment.Bottom, + autoCancel: true, + customStyle: true, + }) + + confirm(excuteJs: string) { + this.controllerShow.runJavaScript({ script: excuteJs }) + } + + build() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.NoWrap, + justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { + Image($r('app.media.narrow')) + .height(24) + .width(24) + .onClick(() => { + this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setInputEnabled(false)" }) + this.controllerShow.runJavaScript({ script: "get_html_content()" }) + // 清除定时器 + if (timeID != undefined) { + LogUtil.info(TAG, "zoom, clearInterval timeID : " + timeID) + clearInterval(timeID) + } + router.back() + }) + .visibility(this.selectedNoteData.is_deleted == Delete.Yes ? Visibility.None : Visibility.Visible) + + if (this.editModel == false) { + Row({ space: StyleConstants.SPACE_24 }) { + Image(this.selectedNoteData.is_favorite == Favorite.Yes ? $r('app.media.favorite') : $r('app.media.favorite_cancel')) + .height(24).width(24) + .onClick(() => { + this.selectedNoteData.is_favorite = (this.selectedNoteData.is_favorite == Favorite.Yes ? Favorite.No : Favorite.Yes) + // update note to db + let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) + predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) + RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) + // save continue data + let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) + AppStorage.SetOrCreate('ContinueNote', continueNote) + LogUtil.info(TAG, 'ToolBarComp, set continue note success') + }) + }.width(36) + .visibility(this.selectedNoteData.is_deleted == Delete.Yes ? Visibility.None : Visibility.Visible) + } else { + Row({ space: StyleConstants.SPACE_6 }) { + Button({ type: ButtonType.Normal, stateEffect: true }) { + Image($r('app.media.circle_tick1')) + .height(24) + .width(24) + .onClick(() => { + // 退出键盘 + inputMethod.getInputMethodController().stopInput(); + // 清单 + this.controllerShow.runJavaScript({ script: "javascript:RICH_EDITOR.setTodo()" }) + }) + }.width(42) + .height(42) + .borderRadius(8) + .backgroundColor($r('app.color.color_ffffff')) + + Button({ type: ButtonType.Normal, stateEffect: true }) { + Image($r('app.media.font_style')) + .height(24) + .width(24) + .onClick(() => { + // 退出键盘 + inputMethod.getInputMethodController().stopInput(); + LogUtil.info(TAG, 'editContentDialogCtl start') + this.editContentDialogCtl.open() + }) + }.width(42) + .height(42) + .borderRadius(8) + .backgroundColor($r('app.color.color_ffffff')) + + Button({ type: ButtonType.Normal, stateEffect: true }) { + Image($r('app.media.picture_white')).height(24).width(24) + .onClick(async () => { + // 退出键盘 + inputMethod.getInputMethodController().stopInput(); + LogUtil.info(TAG, 'startAbility start') + await globalThis.noteContext.startAbilityForResult({ + parameters: { uri: "singleselect" }, + bundleName: "com.ohos.photos", + abilityName: "com.ohos.photos.MainAbility", + }) + .then(v => { + let want = v['want']; + if (want != null && want != undefined) { + let param = want['parameters']; + let imageUri = "" + if (param != null && param != undefined) { + let uri = param['select-item-list']; + imageUri = uri; + } + // 拷贝 + if(imageUri != null && imageUri != "") { + OperationUtils.copy(imageUri).then((uriPath) => { + var path = "file://" + uriPath + LogUtil.info(TAG, 'image uri is:' + path) + this.controllerShow.runJavaScript({script:"javascript:RICH_EDITOR.insertImage('" + path + "')"}) + }) + } + } + }); + }) + }.width(42) + .height(42) + .borderRadius(8) + .backgroundColor($r('app.color.color_ffffff')) + + + Button({ type: ButtonType.Normal, stateEffect: true }) { + Image($r('app.media.undo')) + .height(24) + .width(24) + .onClick(() => { + // 退出键盘 + inputMethod.getInputMethodController().stopInput(); + this.controllerShow.runJavaScript({ script: "RICH_EDITOR.undo()" }) + }) + }.width(42) + .height(42) + .borderRadius(8) + .backgroundColor($r('app.color.color_ffffff')) + + Button({ type: ButtonType.Normal, stateEffect: true }) { + Image($r('app.media.todo')) + .height(24) + .width(24) + .onClick(() => { + // 退出键盘 + inputMethod.getInputMethodController().stopInput(); + this.controllerShow.runJavaScript({ script: "RICH_EDITOR.redo()" }) + }) + }.width(42) + .height(42) + .borderRadius(8) + .backgroundColor($r('app.color.color_ffffff')) + + + Button({ type: ButtonType.Normal, stateEffect: true }) { + Image($r('app.media.tick_thick')) + .height(24) + .width(24) + .fillColor(this.issave == 0 ? Color.Black : Color.Grey) + .onClick(() => { + this.issave = 1 + // 保存笔记信息到数据库 + this.controllerShow.runJavaScript({ script: "get_html_content()" }) + }) + }.width(42) + .height(42) + .borderRadius(8) + .backgroundColor($r('app.color.color_ffffff')) + }.width(274) + } + } + .width(StyleConstants.PERCENTAGE_100) + .height(80) + } +} + +@Component +export struct NoteContentOverViewComp { + @Consume('SelectedNoteData') selectedNoteData: NoteData + @StorageLink('AllFolderArray') AllFolderArray: FolderData[] = [] + @StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = [] + editTitleDialogCtl: CustomDialogController = new CustomDialogController({ + builder: EditTitleDialog({ confirm: this.confirm.bind(this) }), + alignment: DialogAlignment.Center, + autoCancel: false, + customStyle: true, + }) + + confirm(newTitle: string) { + this.selectedNoteData.title = newTitle + this.selectedNoteData.modified_time = new Date().getTime() + let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) + predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) + RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) + // save continue data + let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) + AppStorage.SetOrCreate('ContinueNote', continueNote) + LogUtil.info(TAG, "NoteContentOverViewComp confirm, set continue note success") + } + + @Builder MenuBuilder() { + Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { + List() { + ForEach(this.AllFolderArray, (item) => { + ListItem() { + NoteDataMoveItemComp({ folderItem: item }) + } + .onClick(() => { + this.selectedNoteData.folder_uuid = item.uuid + let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) + predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) + RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) + // save continue data + let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) + AppStorage.SetOrCreate('ContinueNote', continueNote) + LogUtil.info(TAG, "NoteContentOverViewComp MenuBuilder, set continue note success") + }) + }, noteItem => noteItem.uuid) + }.listDirection(Axis.Vertical) + .edgeEffect(EdgeEffect.Spring) + .height(this.AllFolderArray.length > 12 ? 504 : (this.AllFolderArray.length - 3) * 56) + } + .width(148) + .backgroundColor($r("app.color.color_fffffB")) + .padding({ left: 24, right: 24 }) + } + + build() { + Flex({ direction: FlexDirection.Column, wrap: FlexWrap.NoWrap, + justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { + Row() { + Text(this.selectedNoteData.title) + .fontSize(30) + .margin({ left: 12, right: 24 }) + .onClick(() => { + this.editTitleDialogCtl.open() + }) + }.height(40) + .width(StyleConstants.PERCENTAGE_100) + + Row() { + Text(DateUtil.formateDateForNoteContent(new Date(this.selectedNoteData.modified_time))) + .fontSize(12) + .padding({ top: 4, bottom: 4 }) + .fontColor($r("app.color.modified_time_font_color")) + .margin({ left: 12 }) + Row() { + Text(FolderUtil.getFolderText(FolderUtil.getFolderData(AppStorage.Get('AllFolderArray'), this.selectedNoteData.folder_uuid))) + .fontSize(12) + .fontColor($r("app.color.list_modified_time_font_color")) + Image($r('app.media.triangle')) + .width(6) + .height(12) + .margin({ left: 4 }) + } + .padding({ left: 8, right: 8, top: 4, bottom: 4 }) + .margin({ left: 8 }) + .borderRadius(16) + .backgroundColor(NoteUtil.getNoteBgColor(AppStorage.Get('AllFolderArray'), this.selectedNoteData.folder_uuid, SysDefFolderUuid.AllNotes, false)) + .bindMenu(this.MenuBuilder) + }.alignItems(VerticalAlign.Top).height(40).width(StyleConstants.PERCENTAGE_100) + } + .opacity(this.selectedNoteData.is_deleted == Delete.Yes ? 0.4 : 1) + .width(StyleConstants.PERCENTAGE_100) + .height(80) + } +} + +@Component +struct NoteDataMoveItemComp { + @StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = [] + @StorageLink('AllFolderArray') AllFolderArray: FolderData[] = [] + private folderItem: FolderData + + build() { + Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.Center }) { + Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap }) { + Image(FolderUtil.getFolderIcon(this.folderItem.uuid)) + .objectFit(ImageFit.Fill) + .width(24) + .height(24) + .flexShrink(0) + .fillColor(FolderUtil.getFolderIconColor(this.AllFolderArray, this.folderItem.uuid, false)) + } + .width(24) + + Column() { + Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceBetween }) { + Text(FolderUtil.getFolderText(this.folderItem)) + .fontSize(16) + .fontColor(FolderUtil.getFolderIconColor(this.AllFolderArray, this.folderItem.uuid, false)) + .textAlign(TextAlign.Center) + .maxLines(1) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .flexShrink(1) + } + .width('100%') + .height(55) + + Divider() + .color($r("app.color.divider_color_e4e4e4")) + .strokeWidth(1) + } + .padding({ left: 16 }) + } + .width('100%') + .height(56) + .visibility(FolderUtil.isFolderMoveIn(this.folderItem) ? Visibility.Visible : Visibility.None) + } +} \ No newline at end of file diff --git a/common/component/src/main/ets/components/NoteContentComp.ets b/common/component/src/main/ets/components/NoteContentComp.ets new file mode 100644 index 0000000..9ded13e --- /dev/null +++ b/common/component/src/main/ets/components/NoteContentComp.ets @@ -0,0 +1,620 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import DateUtil from '@ohos/utils/src/main/ets/default/baseUtil/DateUtil' +import RdbStoreUtil from '@ohos/utils/src/main/ets/default/baseUtil/RdbStoreUtil' +import FolderData from '@ohos/utils/src/main/ets/default/model/databaseModel/FolderData' +import NoteData from '@ohos/utils/src/main/ets/default/model/databaseModel/NoteData' +import {TableName, NoteTableColumn, SysDefFolderUuid, Favorite, Delete} from '@ohos/utils/src/main/ets/default/model/databaseModel/EnumData' +import StyleConstants from '@ohos/utils/src/main/ets/default/constants/StyleConstants' +import {EditContentDialog, DeleteDialog, EditTitleDialog} from './CusDialogComp' +import FolderUtil from '@ohos/utils/src/main/ets/default/baseUtil/FolderUtil' +import NoteUtil from '@ohos/utils/src/main/ets/default/baseUtil/NoteUtil' +import prompt from '@system.prompt' +import featureAbility from '@ohos.ability.featureAbility' +import {LogUtil} from '@ohos/utils/src/main/ets/default/baseUtil/LogUtil' +import OperationUtils from '@ohos/utils/src/main/ets/default/baseUtil/OperationUtils' +import mediaquery from '@ohos.mediaquery' +import inputMethod from '@ohos.inputmethod'; + +const TAG = "NoteContentComp" + +var timeId : number + +// Note content component +let inSetValue = AppStorage.Link('inSetValue') +@Component +export struct NoteContentComp { + @Consume('SelectedNoteData') selectedNoteData: NoteData + @StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray') + @Consume('SelectedFolderData') selectedFolderData: FolderData + @Consume('RefreshFlag') refreshFlag: number + @Consume('EditModel') editModel: boolean + @Consume('SectionStatus') sectionStatus: number + @Consume('LastSectionStatus') lastSectionStatus: number + @Consume('Issave') issave: number + controllerShow: WebController + private editContentFlag = false + @State uri1: string = "" + private context = getContext(this) + noteContent = { + callbackhtml: (html) => { + LogUtil.info(TAG, 'note uuid is:' + this.selectedNoteData.uuid) + this.selectedNoteData.content_text = html + this.selectedNoteData.modified_time = new Date().getTime() + // updata note image + this.selectedNoteData.content_img = RdbStoreUtil.updataNoteImage(this.selectedNoteData) + let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) + predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) + RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) + LogUtil.info(TAG, 'update note success:' + this.selectedNoteData.uuid) + // save continue data + let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) + AppStorage.SetOrCreate('ContinueNote', continueNote) + LogUtil.info(TAG, "callbackhtml, set continue note success") + return "AceString" + }, + + callbackhtmlSave: (html) => { + LogUtil.info(TAG, 'note uuid is:' + this.selectedNoteData.uuid) + this.selectedNoteData.content_text = html + this.selectedNoteData.modified_time = new Date().getTime() + // updata note image + this.selectedNoteData.content_img = RdbStoreUtil.updataNoteImage(this.selectedNoteData) + let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) + predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) + RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) + LogUtil.info(TAG, 'update note success:' + this.selectedNoteData.uuid) + this.sectionStatus = this.lastSectionStatus + this.sectionStatus = mediaquery.matchMediaSync('(width < 2000)').matches ? 2 : 3 + // save continue data + let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) + AppStorage.SetOrCreate('ContinueNote', continueNote) + AppStorage.SetOrCreate('ContinueSection', this.sectionStatus) + LogUtil.info(TAG, "callbackhtmlSave, set continue note and section success") + return "AceString" + }, + + callbackScheduledSave: (html) => { + LogUtil.info(TAG, 'callbackScheduledSave') + this.selectedNoteData.content_text = html + this.selectedNoteData.modified_time = new Date().getTime() + // updata note image + this.selectedNoteData.content_img = RdbStoreUtil.updataNoteImage(this.selectedNoteData) + let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) + predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) + RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) + LogUtil.info(TAG, 'callbackScheduledSave, update note success:' + this.selectedNoteData.uuid) + // save continue data + let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) + AppStorage.SetOrCreate('ContinueNote', continueNote) + LogUtil.info(TAG, 'callbackScheduledSave, set continue note success') + }, + + callbackGetSize: (size) => { + if(size) { + AppStorage.Set('inSetValue', parseInt(size.slice(0,-2)) - 12) + } + } + } + + build() { + Stack({ alignContent: Alignment.Bottom }) { + Flex({ direction: FlexDirection.Column, wrap: FlexWrap.NoWrap, + alignItems: ItemAlign.Start, alignContent: FlexAlign.SpaceAround }) { + Column() { + ToolBarComp({ controllerShow: this.controllerShow }) + } + .margin({ left: 24, right: 24 }) + + Column() { + NoteContentOverViewComp({ controllerShow: this.controllerShow }) + Text(this.refreshFlag.toString()).visibility(Visibility.None) + Text(this.AllNoteArray.length.toString()).visibility(Visibility.None) // 用于强制刷新使用 + + Web({ src: $rawfile('editor.html'), controller: this.controllerShow }) + .javaScriptAccess(true) + .onPageEnd((e) => { + if (this.editContentFlag == false) { + this.controllerShow.registerJavaScriptProxy({ + object: this.noteContent, + name: "callBackToApp", // html--> name.method + methodList: ["callbackhtml", "callbackhtmlSave", "callbackScheduledSave", "callbackGetSize"], + }) + LogUtil.info(TAG, "finish register") + this.controllerShow.refresh() + this.editContentFlag = true + } + LogUtil.info(TAG, "finish loadurl") + this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')" }) + // 初次加载为为小屏预览模式 + if (this.sectionStatus != 1) { + this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setInputEnabled(false)" }) + } + }) + .zoomAccess(false) + .height('70%') + .width('100%') + } + .margin({ left: 12, right: 24, top: 16 }) + .width(StyleConstants.PERCENTAGE_100) + .enabled(this.selectedNoteData && this.selectedNoteData.is_deleted == Delete.Yes ? false : true) + .onClick(() => { + this.issave = 0 + LogUtil.info(TAG, "editModel : " + this.editModel + ", sectionStatus : " + this.sectionStatus) + let isContinue = AppStorage.Get('IsContinue') + LogUtil.info(TAG, "isContinue : " + isContinue) + // 点击第三屏进入全屏编辑模式 + if (this.sectionStatus != 1 || isContinue) { + this.lastSectionStatus = this.sectionStatus + this.sectionStatus = 1 + this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setInputEnabled(true)" }) + // 添加定时器:3s自动保存 + timeId = setInterval(() => { + this.controllerShow.runJavaScript({ script: "scheduled_save_content()" }) + }, 3000) + LogUtil.info(TAG, "setInterval timeId : " + timeId) + // save continue data + AppStorage.SetOrCreate('ContinueSection', this.sectionStatus) + LogUtil.info(TAG, "set continue section success") + this.editModel = !this.editModel + AppStorage.SetOrCreate('IsContinue', false) + } + }) + } + .height(StyleConstants.PERCENTAGE_100) + .visibility(FolderUtil.getNoteCount(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid) == 0 ? Visibility.Hidden : Visibility.Visible) + } + .height(StyleConstants.PERCENTAGE_100) + .width(StyleConstants.PERCENTAGE_100) + } + + aboutToAppear(): void{ + LogUtil.info(TAG, "aboutToAppear") + } + + aboutToDisappear(): void{ + LogUtil.info(TAG, "aboutToDisappear") + } + +} + +@Component +export struct NoteContentOverViewComp { + @Consume('SelectedNoteData') selectedNoteData: NoteData + @StorageLink('AllFolderArray') AllFolderArray: FolderData[] = [] + @StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = [] + @StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray') + @Consume('SelectedFolderData') selectedFolderData: FolderData + @Consume('EditModel') editModel: boolean + @Consume('SectionStatus') sectionStatus: number + @Consume('RefreshFlag') refreshFlag: number + controllerShow: WebController + editTitleDialogCtl: CustomDialogController = new CustomDialogController({ + builder: EditTitleDialog({ confirm: this.confirm.bind(this) }), + alignment: DialogAlignment.Center, + autoCancel: false, + customStyle: true, + }) + + confirm(newTitle: string) { + this.selectedNoteData.title = newTitle + this.selectedNoteData.modified_time = new Date().getTime() + let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) + predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) + RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) + } + + @Builder MenuBuilder() { + Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { + List() { + ForEach(this.AllFolderArray, (item) => { + ListItem() { + NoteDataMoveItemComp({ folderItem: item }) + } + .onClick(() => { + this.selectedNoteData.folder_uuid = item.uuid + let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) + predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) + RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) + if(this.sectionStatus != 1) { + this.selectedNoteData = NoteUtil.getFirstNoteData(this.AllNoteArray, this.selectedFolderData.uuid) + this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')" }) + this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0) + } else { + this.selectedFolderData = FolderUtil.getFolderData(AppStorage.Get('AllFolderArray'), item.uuid) + } + // save continue data + let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) + AppStorage.SetOrCreate('ContinueNote', continueNote) + LogUtil.info(TAG, "NoteContentOverViewComp, MenuBuilder, set continue note success") + }) + }, noteItem => noteItem.uuid) + }.listDirection(Axis.Vertical) + .edgeEffect(EdgeEffect.Spring) + .height(this.AllFolderArray.length > 12 ? 504 : (this.AllFolderArray.length - 3) * 56) + } + .width(148) + .backgroundColor($r("app.color.color_fffffB")) + .padding({ left: 24, right: 24 }) + } + + build() { + Flex({ direction: FlexDirection.Column, wrap: FlexWrap.NoWrap, + justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { + Row() { + Text(this.selectedNoteData.title) + .fontSize(30) + .margin({ left: 12, right: 24 }) + .onClick(() => { + this.editModel = true + this.sectionStatus = 1 + this.editTitleDialogCtl.open() + // save continue data + AppStorage.SetOrCreate('ContinueSection', this.sectionStatus) + LogUtil.info(TAG, "NoteContentComp, set continue section success") + }) + }.height(40) + .width(StyleConstants.PERCENTAGE_100) + + Row() { + Text(DateUtil.formateDateForNoteContent(new Date(this.selectedNoteData.modified_time))) + .fontSize(12) + .padding({ top: 4, bottom: 4 }) + .fontColor($r("app.color.modified_time_font_color")) + .margin({ left: 12 }) + Row() { + Text(FolderUtil.getFolderText(FolderUtil.getFolderData(AppStorage.Get('AllFolderArray'), this.selectedNoteData.folder_uuid))) + .fontSize(12) + .fontColor($r("app.color.list_modified_time_font_color")) + Image($r('app.media.triangle')) + .width(6) + .height(12) + .margin({ left: 4 }) + } + .padding({ left: 8, right: 8, top: 4, bottom: 4 }) + .margin({ left: 8 }) + .borderRadius(16) + .backgroundColor(NoteUtil.getNoteBgColor(AppStorage.Get('AllFolderArray'), this.selectedNoteData.folder_uuid, SysDefFolderUuid.AllNotes, false)) + .bindMenu(this.MenuBuilder) + }.alignItems(VerticalAlign.Top).height(40).width(StyleConstants.PERCENTAGE_100) + } + .opacity(this.selectedNoteData.is_deleted == Delete.Yes ? 0.4 : 1) + .width(StyleConstants.PERCENTAGE_100) + .height(80) + } +} + +@Component +export struct ToolBarComp { + @Consume('SelectedNoteData') selectedNoteData: NoteData + @Consume('RefreshFlag') refreshFlag: number + @Consume('SectionStatus') sectionStatus: number + @Consume('LastSectionStatus') lastSectionStatus: number + @Consume('SelectedFolderData') selectedFolderData: FolderData + @Consume('ChooseNote') chooseNote: boolean + @Consume('PortraitModel') portraitModel: boolean + @StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray') + @Consume('EditModel') editModel: boolean + @Consume('Issave') issave: number + controllerShow: WebController + private context = getContext(this) + + noteDataDeleteDialogCtl: CustomDialogController = new CustomDialogController({ + builder: DeleteDialog({ onConfirm: this.onDeleteConfirm.bind(this) }), + alignment: DialogAlignment.Center, + autoCancel: false, + customStyle: true, + }) + + onDeleteConfirm() { + if (this.selectedFolderData.uuid != SysDefFolderUuid.RecentDeletes) { + this.selectedNoteData.is_deleted = Delete.Yes + this.selectedNoteData.deleted_time = new Date().getTime() + // update note to db + let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) + predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) + RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) + } else { + NoteUtil.removeNoteData(this.AllNoteArray, this.selectedNoteData.uuid) + // delete note from db + let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) + predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) + RdbStoreUtil.delete(predicates_note, null) + } + this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0) + this.selectedNoteData = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid) + this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')" }) + this.chooseNote = false + // save continue data + let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) + AppStorage.SetOrCreate('ContinueNote', continueNote) + LogUtil.info(TAG, "NoteContentOverViewComp, set continue note success") + } + + editContentDialogCtl: CustomDialogController = new CustomDialogController({ + builder: EditContentDialog({ confirm: this.confirm.bind(this) }), + alignment: DialogAlignment.Bottom, + autoCancel: true, + customStyle: true, + }) + + confirm(excuteJs: string) { + this.controllerShow.runJavaScript({ script: excuteJs }) + } + + build() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.NoWrap, + justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { + Image(this.sectionStatus == 1 ? $r('app.media.narrow') : $r('app.media.zoom')) + .height(24) + .width(24) + .onClick(() => { + if (this.sectionStatus != 1) { + this.lastSectionStatus = this.sectionStatus + this.sectionStatus = 1 + this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setInputEnabled(true)" }) + } else { + if (this.lastSectionStatus != undefined) { + // 切换为小屏预览模式 + this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setInputEnabled(false)" }) + this.sectionStatus = this.lastSectionStatus + // 退出全屏时存库 + LogUtil.info(TAG, "close note" + this.selectedNoteData.uuid) + this.controllerShow.runJavaScript({ script: "save_html_content()" }) + //退出键盘 + inputMethod.getInputMethodController().stopInput(); + // 清除定时器 + if (timeId != undefined) { + LogUtil.info(TAG, "zoom, clearInterval timeId : " + timeId) + clearInterval(timeId) + } + } else { + this.sectionStatus = 3 + } + } + this.editModel = !this.editModel + // save continue data + AppStorage.SetOrCreate('ContinueSection', this.sectionStatus) + LogUtil.info(TAG, "ToolBarComp, set continue section success") + }) + .visibility(!this.selectedNoteData ? Visibility.None : this.selectedNoteData.is_deleted == Delete.Yes ? Visibility.None : Visibility.Visible) + + if (this.selectedNoteData) { + if (this.selectedNoteData.is_deleted == Delete.Yes) { + Row({ space: StyleConstants.SPACE_24 }) { + Image($r('app.media.delete')) + .height(24) + .width(24) + .onClick(() => { + this.noteDataDeleteDialogCtl.open() + }) + Image($r('app.media.recover')) + .height(24) + .width(24) + .onClick(() => { + this.selectedNoteData.is_deleted = Delete.No + this.selectedNoteData.deleted_time = 0 + prompt.showToast({ message: "已恢复", duration: 2000 }) + this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0) + this.chooseNote = false + // update note to db + let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) + predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) + RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) + + this.selectedNoteData = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid) + this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')" }) + // save continue data + let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) + AppStorage.SetOrCreate('ContinueNote', continueNote) + LogUtil.info(TAG, "recover, set continue note success") + }) + }.width(72) + } else if (this.editModel == true) { + Row({ space: StyleConstants.SPACE_6 }) { + Button({ type: ButtonType.Normal, stateEffect: true }) { + Image($r('app.media.circle_tick1')) + .height(24) + .width(24) + .onClick(() => { + // 清单 + this.controllerShow.runJavaScript({ script: "javascript:RICH_EDITOR.setTodo()" }) + // 退出键盘 + inputMethod.getInputMethodController().stopInput(); + }) + }.width(42) + .height(42) + .borderRadius(8) + .backgroundColor($r('app.color.color_ffffff')) + + Button({ type: ButtonType.Normal, stateEffect: true }) { + Image($r('app.media.styles')) + .height(24) + .width(24) + .onClick(() => { + // 退出键盘 + inputMethod.getInputMethodController().stopInput(); + this.editContentDialogCtl.open() + }) + }.width(42) + .height(42) + .borderRadius(8) + .backgroundColor($r('app.color.color_ffffff')) + + Button({ type: ButtonType.Normal, stateEffect: true }) { + Image($r('app.media.picture_white')) + .height(24) + .width(24) + .onClick(async () => { + // 退出键盘 + inputMethod.getInputMethodController().stopInput(); + LogUtil.info(TAG, 'startAbility start') + await globalThis.noteContext.startAbilityForResult({ + parameters: { uri: "singleselect" }, + bundleName: "com.ohos.photos", + abilityName: "com.ohos.photos.MainAbility", + }) + .then(v => { + let want = v['want']; + if (want != null && want != undefined) { + let param = want['parameters']; + let imageUri = "" + if (param != null && param != undefined) { + let uri = param['select-item-list']; + imageUri = uri; + } + // 拷贝 + if(imageUri != null && imageUri != "") { + OperationUtils.copy(imageUri).then((uriPath) => { + var path = "file://" + uriPath + LogUtil.info(TAG, 'image uri is:' + path) + this.controllerShow.runJavaScript({script:"javascript:RICH_EDITOR.insertImage('" + path + "')"}) + }) + } + } + }); + }) + }.width(42) + .height(42) + .borderRadius(8) + .backgroundColor($r('app.color.color_ffffff')) + + + Button({ type: ButtonType.Normal, stateEffect: true }) { + Image($r('app.media.undo')) + .height(24) + .width(24) + .onClick(() => { + // 退出键盘 + inputMethod.getInputMethodController().stopInput(); + this.controllerShow.runJavaScript({ script: "RICH_EDITOR.undo()" }) + }) + }.width(42) + .height(42) + .borderRadius(8) + .backgroundColor($r('app.color.color_ffffff')) + + Button({ type: ButtonType.Normal, stateEffect: true }) { + Image($r('app.media.todo')) + .height(24) + .width(24) + .onClick(() => { + // 退出键盘 + inputMethod.getInputMethodController().stopInput(); + this.controllerShow.runJavaScript({ script: "RICH_EDITOR.redo()" }) + }) + }.width(42) + .height(42) + .borderRadius(8) + .backgroundColor($r('app.color.color_ffffff')) + + + Button({ type: ButtonType.Normal, stateEffect: true }) { + Image($r('app.media.tick_thick')) + .height(24) + .width(24) + .fillColor(this.issave == 0 ? Color.Black : Color.Grey) + .onClick(() => { + // 保存笔记信息到数据库 + this.controllerShow.runJavaScript({ script: "get_html_content()" }) + if (this.selectedNoteData.title == "标题" && this.selectedNoteData.content_text == "") { + LogUtil.info(TAG, "note is empty,save note failed") + } + this.issave = 1 + }) + }.width(42) + .height(42) + .borderRadius(8) + .backgroundColor($r('app.color.color_ffffff')) + }.width(274) + } else { + Row({ space: StyleConstants.SPACE_24 }) { + Image(this.selectedNoteData.is_favorite == Favorite.Yes ? $r('app.media.favorite') : $r('app.media.favorite_cancel')) + .height(24) + .width(24) + .onClick(() => { + this.selectedNoteData.is_favorite = (this.selectedNoteData.is_favorite == Favorite.Yes ? Favorite.No : Favorite.Yes) + this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0) + // update note to db + let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) + predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) + RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) + if (this.selectedFolderData.uuid === SysDefFolderUuid.MyFavorites) { + this.selectedNoteData = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), SysDefFolderUuid.MyFavorites) + this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')" }) + // save continue data + let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) + AppStorage.SetOrCreate('ContinueNote', continueNote) + LogUtil.info(TAG, "ToolBarComp, set continue note success") + } + }) + Image($r('app.media.delete')) + .height(24) + .width(24) + .onClick(() => { + this.noteDataDeleteDialogCtl.open() + }) + }.width(72) + } + } + } + .width(StyleConstants.PERCENTAGE_100) + .height(80) + } +} + +@Component +struct NoteDataMoveItemComp { + @StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = [] + @StorageLink('AllFolderArray') AllFolderArray: FolderData[] = [] + private folderItem: FolderData + + build() { + Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.Center }) { + Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap }) { + Image(FolderUtil.getFolderIcon(this.folderItem.uuid)) + .objectFit(ImageFit.Fill) + .width(24) + .height(24) + .flexShrink(0) + .fillColor(FolderUtil.getFolderIconColor(this.AllFolderArray, this.folderItem.uuid, false)) + } + .width(24) + + Column() { + Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceBetween }) { + Text(FolderUtil.getFolderText(this.folderItem)) + .fontSize(16) + .fontColor(FolderUtil.getFolderIconColor(this.AllFolderArray, this.folderItem.uuid, false)) + .textAlign(TextAlign.Center) + .maxLines(1) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .flexShrink(1) + } + .width('100%') + .height(55) + + Divider() + .color($r("app.color.divider_color_e4e4e4")) + .strokeWidth(1) + } + .padding({ left: 16 }) + } + .width('100%') + .height(56) + .visibility(FolderUtil.isFolderMoveIn(this.folderItem) ? Visibility.Visible : Visibility.None) + } +} diff --git a/common/component/src/main/ets/default/NoteContentCompPortrait.ets b/common/component/src/main/ets/components/NoteContentCompPortrait.ets similarity index 66% rename from common/component/src/main/ets/default/NoteContentCompPortrait.ets rename to common/component/src/main/ets/components/NoteContentCompPortrait.ets index 22aaa56..0666b23 100644 --- a/common/component/src/main/ets/default/NoteContentCompPortrait.ets +++ b/common/component/src/main/ets/components/NoteContentCompPortrait.ets @@ -13,45 +13,43 @@ * limitations under the License. */ -import DateUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/DateUtil.ets' -import RdbStoreUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/RdbStoreUtil.ets' -import FolderData from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/FolderData.ets' -import NoteData from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/NoteData.ets' -import {TableName, NoteTableColumn, SysDefFolderUuid, Favorite, Delete} from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/EnumData.ets' -import StyleConstants from '../../../../../../common/utils/src/main/ets/default/constants/StyleConstants.ets' -import {EditContentDialogPortrait, DeleteDialog, EditTitleDialog} from './CusDialogComp.ets' -import FolderUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/FolderUtil.ets' -import NoteUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/NoteUtil.ets' +import DateUtil from '@ohos/utils/src/main/ets/default/baseUtil/DateUtil' +import RdbStoreUtil from '@ohos/utils/src/main/ets/default/baseUtil/RdbStoreUtil' +import FolderData from '@ohos/utils/src/main/ets/default/model/databaseModel/FolderData' +import NoteData from '@ohos/utils/src/main/ets/default/model/databaseModel/NoteData' +import { TableName, NoteTableColumn, SysDefFolderUuid, Favorite, Delete +} from '@ohos/utils/src/main/ets/default/model/databaseModel/EnumData' +import StyleConstants from '@ohos/utils/src/main/ets/default/constants/StyleConstants' +import { EditContentDialogPortrait, DeleteDialog, EditTitleDialog } from './CusDialogComp' +import FolderUtil from '@ohos/utils/src/main/ets/default/baseUtil/FolderUtil' +import NoteUtil from '@ohos/utils/src/main/ets/default/baseUtil/NoteUtil' import prompt from '@system.prompt' import featureAbility from '@ohos.ability.featureAbility'; -import {LogUtil} from '../../../../../../common/utils/src/main/ets/default/baseUtil/LogUtil.ets' -import OperationUtils from '../../../../../../common/utils/src/main/ets/default/baseUtil/OperationUtils.ets' +import { LogUtil } from '@ohos/utils/src/main/ets/default/baseUtil/LogUtil' +import OperationUtils from '@ohos/utils/src/main/ets/default/baseUtil/OperationUtils' +import router from '@system.router' +import inputMethod from '@ohos.inputmethod'; -var timeId : number +var time_id: number const TAG = "NoteContentCompPortrait" // Note content component @Component export struct NoteContentCompPortrait { - @Consume('SelectedNoteData') selectedNoteData: NoteData; + @Provide('SelectedNoteData') selectedNoteData: NoteData = AppStorage.Get('NewNote') + @Provide('SelectedFolderData') selectedFolderData: FolderData = AppStorage.Get("NewFolder") @StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray') - @Consume('SelectedFolderData') selectedFolderData: FolderData - @Consume('RefreshFlag') refreshFlag: number - @Consume('SectionStatus') sectionStatus: number - @Consume('ChooseNote') chooseNote: boolean - @Consume('EditModel') editModel: boolean - private controllerShow: WebController = new WebController() + @Provide('EditModel') editModel: boolean = false + controllerShow: WebController private editContentFlag = false - @State uri1: string = ""; - private context = getContext(this) noteContent = { callbackhtml: (html) => { LogUtil.info(TAG, 'note uuid is:' + this.selectedNoteData.uuid) this.selectedNoteData.content_text = html this.selectedNoteData.modified_time = new Date().getTime() // updata note image - this.selectedNoteData.content_img = RdbStoreUtil.updataNoteImage(this.selectedNoteData.content_text) + this.selectedNoteData.content_img = RdbStoreUtil.updataNoteImage(this.selectedNoteData) let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) @@ -60,7 +58,6 @@ export struct NoteContentCompPortrait { let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) AppStorage.SetOrCreate('ContinueNote', continueNote) LogUtil.info(TAG, "callbackhtml, set continue note success") - return "AceString" }, callbackScheduledSave: (html) => { @@ -68,7 +65,7 @@ export struct NoteContentCompPortrait { this.selectedNoteData.content_text = html this.selectedNoteData.modified_time = new Date().getTime() // updata note image - this.selectedNoteData.content_img = RdbStoreUtil.updataNoteImage(this.selectedNoteData.content_text) + this.selectedNoteData.content_img = RdbStoreUtil.updataNoteImage(this.selectedNoteData) let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) @@ -82,18 +79,15 @@ export struct NoteContentCompPortrait { } build() { - Stack({ alignContent: Alignment.Bottom }) { - Flex({ direction: FlexDirection.Column, wrap: FlexWrap.Wrap, + Column() { + Flex({ direction: FlexDirection.Column, wrap: FlexWrap.NoWrap, alignItems: ItemAlign.Start, alignContent: FlexAlign.SpaceAround }) { Column() { ToolBarComp({ controllerShow: this.controllerShow }) + NoteContentOverViewComp() } Column() { - NoteContentOverViewComp() - Text(this.refreshFlag.toString()).visibility(Visibility.None) - Text(this.AllNoteArray.length.toString()).visibility(Visibility.None) // 用于强制刷新使用 - Web({ src: $rawfile('editor.html'), controller: this.controllerShow }) .javaScriptAccess(true) .onPageEnd((e) => { @@ -101,29 +95,28 @@ export struct NoteContentCompPortrait { this.controllerShow.registerJavaScriptProxy({ object: this.noteContent, name: "callBackToApp", // html--> name.method - methodList: ["callbackhtml","callbackScheduledSave"], - }); + methodList: ["callbackhtml", "callbackScheduledSave"], + }) LogUtil.info(TAG, "finish register") this.controllerShow.refresh() this.editContentFlag = true } LogUtil.info(TAG, "finish loadurl") - // 初次进入预览模式 - this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setInputEnabled(false)" }) this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')" }) }) .zoomAccess(false) - .height(450) + .height('70%') .width('100%') } - .margin({ top: 16 }) - .width(StyleConstants.PERCENTAGE_100) - .opacity(this.selectedNoteData.is_deleted == Delete.Yes ? 0.4 : 1) - .enabled(this.selectedNoteData.is_deleted == Delete.Yes ? false : true) + .flexShrink(1) .onClick(() => { - this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setInputEnabled(true)" }) + // 添加定时器:3s自动保存 + time_id = setInterval(() => { + this.controllerShow.runJavaScript({ script: "scheduled_save_content()" }) + }, 3000) + LogUtil.info(TAG, "setInterval time_id : " + time_id) this.editModel = true // 添加定时器:3s自动保存 timeId = setInterval(() => { @@ -131,10 +124,11 @@ export struct NoteContentCompPortrait { }, 3000) LogUtil.info(TAG, "NoteContentCompPortrait, setInterval timeId : " + timeId) }) + .margin({ top: 16 }) + .width(StyleConstants.PERCENTAGE_100) } - .height(StyleConstants.PERCENTAGE_100) + .flexShrink(1) .margin({ left: 24, right: 24 }) - .visibility(FolderUtil.getNoteCount(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid) == 0 ? Visibility.Hidden : Visibility.Visible) EditNoteCompForPortrait({ controllerShow: this.controllerShow }) DeleteNoteComp() @@ -142,64 +136,99 @@ export struct NoteContentCompPortrait { .height(StyleConstants.PERCENTAGE_100) .width(StyleConstants.PERCENTAGE_100) } + + aboutToAppear(): void{ + LogUtil.info(TAG, "aboutToAppear") + } + + aboutToDisappear(): void{ + LogUtil.info(TAG, "aboutToDisappear") + } } @Component export struct NoteContentOverViewComp { - @Consume('SelectedNoteData') selectedNoteData: NoteData; + @Consume('SelectedNoteData') selectedNoteData: NoteData @StorageLink('AllFolderArray') AllFolderArray: FolderData[] = [] @StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = [] - @Consume('SectionStatus') sectionStatus: number + NoteDataMoveArray: FolderData[] editTitleDialogCtl: CustomDialogController = new CustomDialogController({ - builder: EditTitleDialog({ confirm: this.confirm.bind(this), dialogType: 0 }), + builder: EditTitleDialog({ confirm: this.confirm.bind(this) }), alignment: DialogAlignment.Center, autoCancel: false, customStyle: true, }) + aboutToAppear() { + this.NoteDataMoveArray = this.AllFolderArray.slice(2, this.AllFolderArray.length); + this.NoteDataMoveArray.push(this.AllFolderArray[1]); + } + confirm(newTitle: string) { this.selectedNoteData.title = newTitle this.selectedNoteData.modified_time = new Date().getTime() let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) + // save continue data + let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) + AppStorage.SetOrCreate('ContinueNote', continueNote) + LogUtil.info(TAG, 'NoteContentOverViewComp, MenuBuilder, set continue note success') } @Builder MenuBuilder() { - Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { - List() { - ForEach(this.AllFolderArray, (item) => { - ListItem() { - NoteDataMoveItemComp({ folderItem: item }) - } - .onClick(() => { - this.selectedNoteData.folder_uuid = item.uuid - }) - }, noteItem => noteItem.uuid) - }.listDirection(Axis.Vertical) - .edgeEffect(EdgeEffect.Spring) - .height(this.AllFolderArray.length > 12 ? 504 : (this.AllFolderArray.length - 3) * 56) + Column() { + Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { + List() { + ForEach(this.NoteDataMoveArray, (item) => { + ListItem() { + NoteDataMoveItemCompMenu({ folderItem: item, uuid: this.selectedNoteData.folder_uuid }) + } + .onClick(() => { + this.selectedNoteData.folder_uuid = item.uuid + let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) + predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) + RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) + // save continue data + let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) + AppStorage.SetOrCreate('ContinueNote', continueNote) + LogUtil.info(TAG, 'MenuBuilder, set continue note success') + }) + }, noteItem => noteItem.uuid) + } + .margin({ top: 4, bottom: 4 }) + .listDirection(Axis.Vertical) + .edgeEffect(EdgeEffect.Spring) + .height(this.AllFolderArray.length > 12 ? 504 : (this.AllFolderArray.length - 3) * 56) + } + .margin({ top: 24, bottom: 24, left: 24, right: 24 }) + .borderRadius(16) + .backgroundColor($r('app.color.folder_color_ffffff')) + .shadow({ color: "#0a000000", offsetX: 0, offsetY: 2, radius: 30 }) + .width(148) + .padding({ left: 24, right: 24 }) } - .width(148) - .backgroundColor($r("app.color.color_fffffB")) - .padding({ left: 24, right: 24 }) } build() { Flex({ direction: FlexDirection.Column, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { Row() { - Text(this.selectedNoteData.title).fontSize(30) + Text(this.selectedNoteData.title).fontSize(30).fontWeight(FontWeight.Medium) .onClick(() => { this.editTitleDialogCtl.open() }) - }.height(40).width(StyleConstants.PERCENTAGE_100) + }.height(40) + .width(StyleConstants.PERCENTAGE_100) Row() { - Text(DateUtil.formateDateForNoteContent(new Date(this.selectedNoteData.modified_time))).fontSize(12) + Text(DateUtil.formateDateForNoteContent(new Date(this.selectedNoteData.modified_time))) + .fontSize(12) .padding({ top: 4, bottom: 4 }) + .fontColor($r("app.color.modified_time_font_color")) Row() { Text(FolderUtil.getFolderText(FolderUtil.getFolderData(AppStorage.Get('AllFolderArray'), this.selectedNoteData.folder_uuid))) + .fontColor($r('app.color.folder_color_99182431')) .fontSize(12) Image($r('app.media.triangle')) .width(6) @@ -213,43 +242,36 @@ export struct NoteContentOverViewComp { .bindMenu(this.MenuBuilder) }.alignItems(VerticalAlign.Top).height(40).width(StyleConstants.PERCENTAGE_100) } + .opacity(this.selectedNoteData.is_deleted == Delete.Yes ? 0.4 : 1) .width(StyleConstants.PERCENTAGE_100) - .height(80) + .height(82) } } @Component export struct ToolBarComp { - @Consume('SelectedNoteData') selectedNoteData: NoteData; - @Consume('RefreshFlag') refreshFlag: number - @Consume('SectionStatus') sectionStatus: number + @Consume('SelectedNoteData') selectedNoteData: NoteData @Consume('SelectedFolderData') selectedFolderData: FolderData - @Consume('ChooseNote') chooseNote: boolean - @Consume('PortraitModel') portraitModel: boolean - @StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray') @Consume('EditModel') editModel: boolean + @StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray') controllerShow: WebController build() { Flex({ direction: FlexDirection.Row, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { - Image($r('app.media.back')).height(24).width(24) + Image($r('app.media.back')) + .height(24) + .width(24) + .responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 }) .onClick(() => { - // 退出全屏时存库 this.controllerShow.runJavaScript({ script: "get_html_content()" }) - // 删除空白笔记 - NoteUtil.deleteEmptyNote(this.selectedNoteData, this.AllNoteArray, this.controllerShow) - this.chooseNote = false - // 进入预览模式 - this.controllerShow.runJavaScript({ script: "RE.setInputEnabled(false)" }) - this.editModel = false - AppStorage.SetOrCreate('ContinueChoose', this.chooseNote) // 清除定时器 - if (timeId != undefined) { - LogUtil.info(TAG, "back, clearInterval timeId : " + timeId) - clearInterval(timeId) + if (time_id != undefined) { + LogUtil.info(TAG, "back, clearInterval time_id : " + time_id) + clearInterval(time_id) } + router.back() }) if (this.editModel == false) { @@ -258,19 +280,17 @@ export struct ToolBarComp { .height(24).width(24) .onClick(() => { this.selectedNoteData.is_favorite = (this.selectedNoteData.is_favorite == Favorite.Yes ? Favorite.No : Favorite.Yes) - this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0) // update note to db let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) if (this.selectedFolderData.uuid === SysDefFolderUuid.MyFavorites) { this.selectedNoteData = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), SysDefFolderUuid.MyFavorites) - // 迁移 - LogUtil.info(TAG, "ToolBarComp, set continue note") - let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) - AppStorage.SetOrCreate('ContinueNote', continueNote) - LogUtil.info(TAG, "ToolBarComp, set continue note success") } + // save continue data + let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) + AppStorage.SetOrCreate('ContinueNote', continueNote) + LogUtil.info(TAG, 'ToolBarComp, set continue note success') }) }.width(36) .visibility(this.selectedNoteData.is_deleted == Delete.Yes ? Visibility.None : Visibility.Visible) @@ -279,6 +299,8 @@ export struct ToolBarComp { Button({ type: ButtonType.Normal, stateEffect: true }) { Image($r('app.media.undo')).height(24).width(24) .onClick(() => { + // 退出键盘 + inputMethod.getInputMethodController().stopInput(); this.controllerShow.runJavaScript({ script: "javascript:RICH_EDITOR.undo()" }) }) }.width(42) @@ -289,6 +311,8 @@ export struct ToolBarComp { Button({ type: ButtonType.Normal, stateEffect: true }) { Image($r('app.media.todo')).height(24).width(24) .onClick(() => { + // 退出键盘 + inputMethod.getInputMethodController().stopInput(); this.controllerShow.runJavaScript({ script: "javascript:RICH_EDITOR.redo()" }) }) }.width(42) @@ -301,17 +325,7 @@ export struct ToolBarComp { .onClick(() => { // 保存笔记信息到数据库 this.controllerShow.runJavaScript({ script: "get_html_content()" }) - if (this.selectedNoteData.title == "标题" && this.selectedNoteData.content_text == "") { - LogUtil.info(TAG, "note is empty,save note failed") - } - // 进入预览模式 - this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setInputEnabled(false)" }) this.editModel = false - // 清除定时器 - if (timeId != undefined) { - LogUtil.info(TAG, "tick_thin, clearInterval timeId : " + timeId) - clearInterval(timeId) - } }) }.width(42) .height(42) @@ -323,7 +337,7 @@ export struct ToolBarComp { } } .width(StyleConstants.PERCENTAGE_100) - .height(80) + .height(40) } } @@ -334,8 +348,6 @@ export struct DeleteNoteComp { @Consume('SelectedFolderData') selectedFolderData: FolderData @Consume('RefreshFlag') refreshFlag: number @Consume('SelectedNoteData') selectedNoteData: NoteData; - @Consume('PortraitModel') portraitModel: boolean - @Consume('ChooseNote') chooseNote: boolean noteDataDeleteDialogCtlBottom: CustomDialogController = new CustomDialogController({ builder: DeleteDialog({ onConfirm: this.onDeleteConfirm.bind(this), multiSelect: true }), alignment: DialogAlignment.Bottom, @@ -358,10 +370,6 @@ export struct DeleteNoteComp { predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) RdbStoreUtil.delete(predicates_note, null) } - this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0) - this.selectedNoteData = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid) - this.chooseNote = false - AppStorage.SetOrCreate('ContinueChoose', this.chooseNote) } build() { @@ -370,6 +378,7 @@ export struct DeleteNoteComp { Image($r('app.media.delete')) .width(24) .height(24) + .responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 }) .onClick(() => { this.noteDataDeleteDialogCtlBottom.open() }) @@ -378,19 +387,21 @@ export struct DeleteNoteComp { .fontColor($r('app.color.delete_font_color')) .padding({ top: 5 }) } + .height("100%") + .width(180) + .justifyContent(FlexAlign.Center) .alignItems(HorizontalAlign.Center) Column() { Image($r('app.media.recover')) .width(24) .height(24) + .responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 }) .onClick(() => { this.selectedNoteData.is_deleted = Delete.No this.selectedNoteData.deleted_time = 0 - prompt.showToast({ message: $r('app.string.restore'), duration: 2000 }) + prompt.showToast({ message: $r('app.string.restore').toString(), duration: 2000 }) this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0) - this.chooseNote = false - AppStorage.SetOrCreate('ContinueChoose', this.chooseNote) // update note to db let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) @@ -401,11 +412,14 @@ export struct DeleteNoteComp { .fontColor($r('app.color.recover_font_color')) .padding({ top: 5 }) } + .height("100%") + .width(180) + .justifyContent(FlexAlign.Center) .alignItems(HorizontalAlign.Center) } .width(360) .height(56) - .visibility(this.selectedNoteData.is_deleted == Delete.Yes && this.portraitModel == true ? + .visibility(this.selectedNoteData.is_deleted == Delete.Yes ? Visibility.Visible : Visibility.None) } } @@ -415,14 +429,11 @@ export struct EditNoteCompForPortrait { @StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = [] @StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray') @Consume('SelectedFolderData') selectedFolderData: FolderData - @Consume('RefreshFlag') refreshFlag: number @Consume('SelectedNoteData') selectedNoteData: NoteData; - @Consume('PortraitModel') portraitModel: boolean - @Consume('ChooseNote') chooseNote: boolean @Consume('EditModel') editModel: boolean controllerShow: WebController editContentDialogCtl: CustomDialogController = new CustomDialogController({ - builder: EditContentDialogPortrait({ confirm: this.confirm.bind(this), dialogType: 0 }), + builder: EditContentDialogPortrait({ confirm: this.confirm.bind(this) }), alignment: DialogAlignment.Bottom, autoCancel: true, customStyle: true, @@ -433,11 +444,12 @@ export struct EditNoteCompForPortrait { } build() { - Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap, justifyContent: FlexAlign.SpaceBetween }) { + Row() { Column() { - Image($r('app.media.circle_tick')) + Image($r('app.media.circle_tick1')) .width(24) .height(24) + .responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 }) .onClick(() => { // 清单 this.controllerShow.runJavaScript({ script: "javascript:RICH_EDITOR.setTodo()" }) @@ -447,12 +459,16 @@ export struct EditNoteCompForPortrait { .fontColor($r('app.color.list_font_color')) .padding({ top: 5 }) } + .height("100%") + .width(120) + .justifyContent(FlexAlign.Center) .alignItems(HorizontalAlign.Center) Column() { Image($r('app.media.font_style')) .width(24) .height(24) + .responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 }) .onClick(() => { this.editContentDialogCtl.open() }) @@ -461,18 +477,52 @@ export struct EditNoteCompForPortrait { .fontColor($r('app.color.style_font_color')) .padding({ top: 5 }) } + .height("100%") + .width(120) + .justifyContent(FlexAlign.Center) .alignItems(HorizontalAlign.Center) Column() { Image($r('app.media.picture_white')) .width(24) .height(24) + .responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 }) + .onClick(async () => { + LogUtil.info(TAG, 'startAbility start') + await globalThis.noteContext.startAbilityForResult({ + parameters: { uri: "singleselect" }, + bundleName: "com.ohos.photos", + abilityName: "com.ohos.photos.MainAbility", + }).then(v => { + let want = v['want']; + if (want != null && want != undefined) { + let param = want['parameters']; + let imageUri = "" + if (param != null && param != undefined) { + let uri = param['select-item-list']; + imageUri = uri; + } + LogUtil.info(TAG, "image url" + imageUri) + // 拷贝 + if (imageUri != null && imageUri != "") { + OperationUtils.copy(imageUri).then((uriPath) => { + var path = "file://" + uriPath + LogUtil.info(TAG, 'image uri is:' + path) + this.controllerShow.runJavaScript({ script: "javascript:RICH_EDITOR.insertImage('" + path + "')" }) + }) + } + } + }); + }) Text($r("app.string.photo")) .fontSize(10) .fontColor($r('app.color.photo_font_color')) .padding({ top: 5 }) } + .height("100%") + .width(120) + .justifyContent(FlexAlign.Center) .alignItems(HorizontalAlign.Center) } .width(360) @@ -483,19 +533,21 @@ export struct EditNoteCompForPortrait { } @Component -struct NoteDataMoveItemComp { +struct NoteDataMoveItemCompMenu { @StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = [] @StorageLink('AllFolderArray') AllFolderArray: FolderData[] = [] - private folderItem: FolderData + folderItem: FolderData + uuid: String build() { Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.Center }) { Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap }) { Image(FolderUtil.getFolderIcon(this.folderItem.uuid)) - .objectFit(ImageFit.ScaleDown) + .objectFit(ImageFit.Fill) .width(24) .height(24) - .fillColor(FolderUtil.getFolderIconColor(this.AllFolderArray, this.folderItem.uuid, false)) + .flexShrink(0) + .fillColor(FolderUtil.getFolderIconColor(this.AllFolderArray, this.folderItem.uuid, this.folderItem.uuid == this.uuid)) } .width(24) @@ -503,7 +555,7 @@ struct NoteDataMoveItemComp { Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceBetween }) { Text(FolderUtil.getFolderText(this.folderItem)) .fontSize(16) - .fontColor(FolderUtil.getFolderIconColor(this.AllFolderArray, this.folderItem.uuid, false)) + .fontColor(FolderUtil.getFolderIconColor(this.AllFolderArray, this.folderItem.uuid == this.uuid ? this.folderItem.uuid : '', this.folderItem.uuid == this.uuid)) .textAlign(TextAlign.Center) .maxLines(1) .textOverflow({ overflow: TextOverflow.Ellipsis }) @@ -512,7 +564,12 @@ struct NoteDataMoveItemComp { .width('100%') .height(55) - Divider().color($r("app.color.divider_color_e4e4e4")).strokeWidth(1) + if (this.folderItem.uuid != SysDefFolderUuid.UnClassified) { + Divider() + .color($r("app.color.divider_color_e4e4e4")) + .strokeWidth(1) + } + } .padding({ left: 16 }) } @@ -520,4 +577,4 @@ struct NoteDataMoveItemComp { .height(56) .visibility(FolderUtil.isFolderMoveIn(this.folderItem) ? Visibility.Visible : Visibility.None) } -} +} \ No newline at end of file diff --git a/common/component/src/main/ets/default/NoteListComp.ets b/common/component/src/main/ets/components/NoteListComp.ets similarity index 72% rename from common/component/src/main/ets/default/NoteListComp.ets rename to common/component/src/main/ets/components/NoteListComp.ets index 6a8d73e..15478a1 100644 --- a/common/component/src/main/ets/default/NoteListComp.ets +++ b/common/component/src/main/ets/components/NoteListComp.ets @@ -13,21 +13,34 @@ * limitations under the License. */ -import DateUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/DateUtil.ets' -import FolderData from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/FolderData.ets' -import NoteData from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/NoteData.ets' -import {TableName, NoteTableColumn, SysDefFolderUuid, Favorite, Delete, Top, NoteType} from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/EnumData.ets' -import {NoteDataMoveDialog, DeleteDialog} from './CusDialogComp.ets' -import RdbStoreUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/RdbStoreUtil.ets' +import DateUtil from '@ohos/utils/src/main/ets/default/baseUtil/DateUtil' +import FolderData from '@ohos/utils/src/main/ets/default/model/databaseModel/FolderData' +import NoteData from '@ohos/utils/src/main/ets/default/model/databaseModel/NoteData' +import { TableName, NoteTableColumn, SysDefFolderUuid, Favorite, Delete, Top, NoteType +} from '@ohos/utils/src/main/ets/default/model/databaseModel/EnumData' +import { NoteDataMoveDialog, DeleteDialog } from './CusDialogComp' +import RdbStoreUtil from '@ohos/utils/src/main/ets/default/baseUtil/RdbStoreUtil' import prompt from '@system.prompt' -import NoteUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/NoteUtil.ets' -import FolderUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/FolderUtil.ets' -import StyleConstants from '../../../../../../common/utils/src/main/ets/default/constants/StyleConstants.ets' -import SearchModel from '../../../../../../common/utils/src/main/ets/default/model/searchModel/SearchModel.ets' -import {LogUtil} from '../../../../../../common/utils/src/main/ets/default/baseUtil/LogUtil.ets' +import NoteUtil from '@ohos/utils/src/main/ets/default/baseUtil/NoteUtil' +import FolderUtil from '@ohos/utils/src/main/ets/default/baseUtil/FolderUtil' +import StyleConstants from '@ohos/utils/src/main/ets/default/constants/StyleConstants' +import SearchModel from '@ohos/utils/src/main/ets/default/model/searchModel/SearchModel' +import { LogUtil } from '@ohos/utils/src/main/ets/default/baseUtil/LogUtil' +import router from '@system.router'; const TAG = "NoteListComp" +async function routePage() { + let options = { + uri: 'pages/NoteContentHome' + } + try { + await router.push(options) + } catch (err) { + LogUtil.info(TAG, "fail callback") + } +} + // Note list component @Component export struct NoteListComp { @@ -37,18 +50,28 @@ export struct NoteListComp { controllerShow: WebController build() { - Stack({ alignContent: Alignment.Bottom }) { + Flex({ direction: FlexDirection.Column }) { Flex({ direction: FlexDirection.Column }) { NoteOverViewComp({ controllerShow: this.controllerShow }) + Column() { + } + .backgroundColor($r('app.color.notelist_bgcolor_f1f3f5')) + .height(this.search ? 15 : 0) + NoteItemListComp({ controllerShow: this.controllerShow }) } - .padding({ top: this.search ? 15 : 0 }) + .backgroundColor($r('app.color.notelist_bgcolor_f1f3f5')) .width('100%') - .height('100%') + .flexShrink(1) - OperateNoteCompForPortrait() + Column() { + OperateNoteCompForPortrait() + } + .flexShrink(0) + .backgroundColor($r('app.color.notelist_bgcolor_f1f3f5')) } + .backgroundColor($r('app.color.notelist_bgcolor_f1f3f5')) .height('100%') .width('100%') } @@ -60,7 +83,6 @@ export struct NoteListComp { aboutToDisappear(): void{ LogUtil.info(TAG, "aboutToDisappear") } - } @Component @@ -82,21 +104,21 @@ struct NoteOverViewComp { Image($r("app.media.suojin_back")) .height(24) .width(24) + .responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 }) .margin({ right: this.sectionStatus != 3 ? 24 : 0 }) // 两分栏时缩进图片与右边有个24的间距 .visibility(this.sectionStatus != 3 ? Visibility.Visible : Visibility.None) .onClick(() => { if (this.sectionStatus == 1) { this.expandStatus = !this.expandStatus - AppStorage.SetOrCreate('ContinueExpand', this.expandStatus) } else { this.sectionStatus = (this.sectionStatus == 3 ? 2 : 3) - // 迁移 - LogUtil.info(TAG, "NoteOverViewComp, set continue section") + // save continue data AppStorage.SetOrCreate('ContinueSection', this.sectionStatus) LogUtil.info(TAG, "NoteOverViewComp, set continue section success") } }) }.alignItems(HorizontalAlign.Center) + Flex({ direction: FlexDirection.Column, wrap: FlexWrap.Wrap, @@ -124,6 +146,7 @@ struct NoteOverViewComp { Image($r("app.media.cross")) .height(24) .width(24) + .responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 }) .onClick(() => { this.longpress = false this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0) @@ -134,6 +157,7 @@ struct NoteOverViewComp { .fontColor($r("app.color.note_selected_font_color")) .margin({ left: 16 }) .textOverflow({ overflow: TextOverflow.Ellipsis }) + .fontWeight(FontWeight.Medium) }.alignItems(VerticalAlign.Center) .visibility(this.longpress ? Visibility.Visible : Visibility.None) }.padding({ top: 8, bottom: 8 }) @@ -143,7 +167,9 @@ struct NoteOverViewComp { OperateNoteComp({ controllerShow: this.controllerShow }) Text(this.refreshFlag.toString()).visibility(Visibility.None) } - .width('100%').height(82) + .backgroundColor($r('app.color.notelist_bgcolor_f1f3f5')) + .width('100%') + .height(82) .padding({ left: this.sectionStatus == 2 ? 24 : 36, right: 24 }) // 两分栏时缩进图标与左侧不需要间距 .visibility(this.search ? Visibility.None : Visibility.Visible) } @@ -163,7 +189,7 @@ export struct NoteItemComp { @Consume('RefreshFlag') refreshFlag: number @Consume('Search') search: boolean @Consume('selectedAll') selectedAll: boolean - @Consume('PortraitModel') portraitModel:boolean + @Consume('PortraitModel') portraitModel: boolean build() { Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { @@ -181,9 +207,15 @@ export struct NoteItemComp { }), item => { if (item.data.type == 0) { - Span(item.data.text).fontColor($r("app.color.note_title_font_color")).fontSize(16).fontWeight(FontWeight.Medium) + Span(item.data.text) + .fontColor($r("app.color.note_title_font_color")) + .fontSize(16) + .fontWeight(FontWeight.Medium) } else if (item.data.type == 1) { - Span(item.data.text).fontColor($r("app.color.note_title_font_color_blue")).fontSize(16).fontWeight(FontWeight.Medium) + Span(item.data.text) + .fontColor($r("app.color.note_title_font_color_blue")) + .fontSize(16) + .fontWeight(FontWeight.Medium) } }, item => item.index) @@ -207,17 +239,18 @@ export struct NoteItemComp { } .padding({ left: 12 }) }.alignItems(HorizontalAlign.Start) - }.width(240) + }.flexShrink(1) Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { Stack({ alignContent: Alignment.Center }) { Image(this.noteItem.content_img) - .height(48) - .width(48) + .height(47) + .width(47) .borderRadius(12) .border({ width: 0.5, color: '#19182431' }) .visibility(this.noteItem.content_img ? Visibility.Visible : Visibility.None) } + Stack({ alignContent: Alignment.Center }) { Image($r("app.media.unChecked")) .height(24) @@ -229,7 +262,9 @@ export struct NoteItemComp { }.width(24) .height(24) .visibility(this.longpress ? Visibility.Visible : Visibility.None) - }.height(48) + } + .flexShrink(0) + .height(48) .width(this.longpress ? 80 : 48) } .width('100%') @@ -253,6 +288,7 @@ export struct NoteItemComp { NoteUtil.setNoteChecked(this.CheckedNoteArray, this.noteItem) this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0) } + return; } else { this.selectedNoteData = this.noteItem this.chooseNote = true @@ -262,8 +298,15 @@ export struct NoteItemComp { AppStorage.SetOrCreate('ContinueNote', continueNote) LogUtil.info(TAG, "NoteItemComp, set continue note success") } - if(this.portraitModel == false) { - this.controllerShow.runJavaScript({script:"RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')" }) + if (this.portraitModel == false) { + this.controllerShow.runJavaScript({ + script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')" + }) + } + if (this.portraitModel == true) { + AppStorage.SetOrCreate('NewNote', this.selectedNoteData) + AppStorage.SetOrCreate('NewFolder', this.selectedFolderData) + routePage() } this.selectedAll = this.CheckedNoteArray.length == NoteUtil.getNoteDataArray(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid).length @@ -295,6 +338,7 @@ export struct NoteItemListComp { @Consume @Watch('doSearch') inputKeyword: string @Consume('SearchResultList') searchResultList: NoteData[] @Consume('SelectedNoteData') selectedNoteData: NoteData + @Consume('PortraitModel') portraitModel: boolean controllerShow: WebController doSearch() { @@ -307,7 +351,11 @@ export struct NoteItemListComp { } else { this.selectedNoteData = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid) } - this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')" }) + if (this.portraitModel == false) { + this.controllerShow.runJavaScript({ + script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')" + }) + } // save continue data let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) AppStorage.SetOrCreate('ContinueNote', continueNote) @@ -317,57 +365,88 @@ export struct NoteItemListComp { } build() { - Column() { + Flex({ direction: FlexDirection.Column }) { Text(this.refreshFlag.toString()).visibility(Visibility.None) Flex() { SearchComp() - }.margin({ left: 24, right: 24, bottom: 12 }) + } + .width("100%") + .padding({ left: 24, right: 24, bottom: 12 }) + .backgroundColor($r("app.color.notelist_bgcolor_f1f3f5")) .visibility((FolderUtil.getNoteCount(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid) == 0) ? Visibility.None : Visibility.Visible) - Flex({ justifyContent: FlexAlign.Center }) { - Text($r("app.string.permanently_delete_tips")) - .fontSize(12) - .fontColor($r("app.color.Recently_delete_prompt_font_color")) - } - .margin({ bottom: this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? 12 : 0 }) - .width('100%') - .visibility(this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? Visibility.Visible : Visibility.None) - - Column() { - List({ initialIndex: 0 }) { - ListItem() { - Column({ space: 8 }) { - Image($r('app.media.emptyPage')) - .width(120) - .height(120) - Text($r("app.string.Empty_page")) - .fontSize(12) - .fontColor($r("app.color.Empty_page_font_color")) - } + Stack() { + Flex({direction: FlexDirection.Column}) { + Flex({ justifyContent: FlexAlign.Center }) { + Text($r("app.string.permanently_delete_tips")) + .fontSize(12) + .fontColor($r("app.color.Recently_delete_prompt_font_color")) } + .padding({ bottom: this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? 12 : 0 }) + .backgroundColor($r("app.color.notelist_bgcolor_f1f3f5")) .width('100%') - .height('100%') - .padding({ bottom: 120 }) - .visibility((FolderUtil.getNoteCount(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid) == 0) ? Visibility.Visible : Visibility.None) + .visibility(this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? Visibility.Visible : Visibility.None) - ForEach(this.inputKeyword.length == 0 ? - NoteUtil.getNoteDataArray(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid) : this.searchResultList, (noteItem) => { - ListItem() { - NoteItemComp({ - noteItem: noteItem, - spans: SearchModel.splitToHighlightText(noteItem.title, this.inputKeyword), - controllerShow: this.controllerShow - }) - }.margin({ left: 24, right: 24, bottom: 12 }) - }, noteItem => noteItem.uuid.toString()) - }.listDirection(Axis.Vertical) - .edgeEffect(EdgeEffect.Spring) + Column() { + List({ initialIndex: 0 }) { + ListItem() { + Column({ space: 8 }) { + Image($r('app.media.emptyPage')) + .width(120) + .height(120) + Text($r("app.string.Empty_page")) + .fontSize(12) + .fontColor($r("app.color.Empty_page_font_color")) + } + } + .backgroundColor($r("app.color.notelist_bgcolor_f1f3f5")) + .width('100%') + .height('100%') + .padding({ bottom: 120 }) + .visibility((FolderUtil.getNoteCount(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid) == 0) ? Visibility.Visible : Visibility.None) + + ForEach(this.inputKeyword.length == 0 ? + NoteUtil.getNoteDataArray(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid) : this.searchResultList, (noteItem) => { + ListItem() { + Column() { + NoteItemComp({ + noteItem: noteItem, + spans: SearchModel.splitToHighlightText(noteItem.title, this.inputKeyword), + controllerShow: this.controllerShow + }) + } + .padding({ left: 24, right: 24, bottom: 12 }) + } + .backgroundColor($r("app.color.notelist_bgcolor_f1f3f5")) + }, noteItem => noteItem.uuid.toString()) + } + .layoutWeight(1) + .backgroundColor($r("app.color.notelist_bgcolor_f1f3f5")) + .listDirection(Axis.Vertical) + .edgeEffect(EdgeEffect.Spring) + } + .layoutWeight(1) + .backgroundColor($r("app.color.notelist_bgcolor_f1f3f5")) + .height("100%") + .margin({ top: this.search ? 8 : 0 }) + } + .height("100%") + .width("100%") + + // search input mask + Column() { + } + .height("100%") + .width("100%") + .backgroundColor("#18181A") + .opacity(0.1) + .visibility(this.search ? Visibility.Visible : Visibility.Hidden) } .backgroundColor($r("app.color.notelist_bgcolor_f1f3f5")) - .height('100%') + .flexShrink(1) } - .height('80%') - .padding({ bottom: 1 }) + .backgroundColor($r("app.color.notelist_bgcolor_f1f3f5")) + .flexShrink(1) .onClick(() => { this.search = false }) @@ -401,6 +480,13 @@ export struct OperateNoteComp { RdbStoreUtil.update(noteItem.toNoteObject(), predicates_note, null) }) this.selectedNoteData = NoteUtil.getFirstNoteData(this.AllNoteArray, this.selectedFolderData.uuid) + // save continue data + let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) + AppStorage.SetOrCreate('ContinueNote', continueNote) + LogUtil.info(TAG, "onMoveConfirm, set continue note success") + if (this.portraitModel == false) { + this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')" }) + } this.longpress = false this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0) NoteUtil.unsetAllNotesChecked(this.CheckedNoteArray) @@ -436,8 +522,8 @@ export struct OperateNoteComp { this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0) this.longpress = false this.selectedNoteData = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid) - if(this.portraitModel == false) { - this.controllerShow.runJavaScript({script:"RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')" }) + if (this.portraitModel == false) { + this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')" }) } // save continue data let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) @@ -542,6 +628,7 @@ export struct AddNoteComp { .width(24) .height(24) .margin({ right: 12 }) + .responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 }) .onClick(() => { let noteData if (this.selectedFolderData.uuid == SysDefFolderUuid.AllNotes) { @@ -555,24 +642,22 @@ export struct AddNoteComp { LogUtil.info(TAG, 'insert new note is:' + noteData.uuid) this.selectedNoteData = noteData - if (this.sectionStatus != 1) { - this.lastSectionStatus = this.sectionStatus - this.sectionStatus = 1 - this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setInputEnabled(true)" }) - } else { - this.sectionStatus = this.lastSectionStatus + AppStorage.SetOrCreate('NewNote', noteData) + if (this.portraitModel == false) { + this.controllerShow.runJavaScript({ + script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')" + }) } - if(this.portraitModel == false) { - this.controllerShow.runJavaScript({script:"RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')" }) + if (this.portraitModel == true) { + this.editModel = true } - this.editModel = true this.chooseNote = true AppStorage.SetOrCreate('ContinueChoose', this.chooseNote) // save continue data let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) AppStorage.SetOrCreate('ContinueNote', continueNote) - AppStorage.SetOrCreate('ContinueSection', this.sectionStatus) - LogUtil.info(TAG, "addNote, set continue note and section success") + LogUtil.info(TAG, "addNote, set continue note success") + routePage() }) .visibility(this.longpress || this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? Visibility.None : Visibility.Visible) } @@ -582,12 +667,14 @@ export struct AddNoteComp { export struct SearchComp { @Consume('Search') search: boolean @Consume('InputKeyword') inputKeyword: string + @Consume('Longpress') longpress: boolean build() { Row() { Image($r('app.media.back')) .width(24) .height(24) + .responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 }) .margin({ right: this.search ? 16 : 0 }) .visibility(this.search ? Visibility.Visible : Visibility.None) .onClick(() => { @@ -597,23 +684,36 @@ export struct SearchComp { Flex({ justifyContent: FlexAlign.Start }) { Image($r('app.media.search')).width(18).height(18) TextInput({ placeholder: $r('app.string.searchNote') }) - .backgroundColor($r("app.color.color_ffffff")) + .backgroundColor(this.longpress ? $r("app.color.search_longpress_bgcolor_f7f8f9") : $r("app.color.color_ffffff")) .caretColor($r("app.color.search_note_caret_color")) + .enabled(this.longpress ? false : true) + .padding({left:6}) + .onEditChange((isEditing: boolean) => { + this.search = isEditing + }) .onChange((value: string) => { - LogUtil.info(TAG, "Search value: " + value) - this.inputKeyword = value + if (!this.longpress) { + LogUtil.info(TAG, "Search value: " + value) + this.inputKeyword = value + } }) .onClick(() => { - this.search = true + if (this.longpress) { + this.search = false + } else { + this.search = true + } }) } + .backgroundColor(this.longpress ? $r("app.color.search_longpress_bgcolor_f7f8f9") : $r("app.color.color_ffffff")) .height(40) + .opacity(this.longpress ? 0.4 : 1) .padding({ left: 6, right: 12, top: 9, bottom: 9 }) .borderRadius(20) - .backgroundColor($r("app.color.color_ffffff")) .border({ width: 1.5, color: $r("app.color.divider_color_e4e4e4") }) .margin({ right: this.search ? 40 : 0 }) } + .backgroundColor($r('app.color.notelist_bgcolor_f1f3f5')) } } @@ -623,9 +723,10 @@ export struct OperateNoteCompForPortrait { @StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = [] @StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray') @Consume('SelectedFolderData') selectedFolderData: FolderData - @Consume('RefreshFlag') refreshFlag: number + @Consume('RefreshFlag') @Watch('opacityChange') refreshFlag: number @Consume('SelectedNoteData') selectedNoteData: NoteData @Consume('PortraitModel') portraitModel: boolean + @State greyOpacity: boolean = false noteDataMoveDialogCtlBottom: CustomDialogController = new CustomDialogController({ builder: NoteDataMoveDialog({ onConfirm: this.onMoveConfirm.bind(this) }), alignment: DialogAlignment.Bottom, @@ -633,6 +734,16 @@ export struct OperateNoteCompForPortrait { customStyle: true, }) + opacityChange() { + if (this.CheckedNoteArray.length == 0) { + this.greyOpacity = true + LogUtil.info(TAG, "none checked array") + } else { + this.greyOpacity = false + LogUtil.info(TAG, this.CheckedNoteArray.length.toString()) + } + } + onMoveConfirm(folderUuid: string) { this.CheckedNoteArray.forEach((noteItem) => { noteItem.folder_uuid = folderUuid @@ -642,6 +753,10 @@ export struct OperateNoteCompForPortrait { RdbStoreUtil.update(noteItem.toNoteObject(), predicates_note, null) }) this.selectedNoteData = NoteUtil.getFirstNoteData(this.AllNoteArray, this.selectedFolderData.uuid) + // save continue data + let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) + AppStorage.SetOrCreate('ContinueNote', continueNote) + LogUtil.info(TAG, "onMoveConfirm, set continue note success") this.longpress = false this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0) NoteUtil.unsetAllNotesChecked(this.CheckedNoteArray) @@ -684,12 +799,14 @@ export struct OperateNoteCompForPortrait { } build() { - Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap, justifyContent: FlexAlign.SpaceBetween }) { + Row() { if (this.selectedFolderData.uuid != SysDefFolderUuid.RecentDeletes) { Column() { Image($r("app.media.set_top")) + .opacity(this.greyOpacity ? 0.4 : 1) .width(24) .height(24) + .responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 }) .onClick(() => { this.CheckedNoteArray.forEach((noteItem) => { noteItem.is_top = (noteItem.is_top == Top.Yes) ? Top.No : Top.Yes @@ -702,47 +819,66 @@ export struct OperateNoteCompForPortrait { NoteUtil.unsetAllNotesChecked(this.CheckedNoteArray) }) Text($r("app.string.set_top")) + .opacity(this.greyOpacity ? 0.4 : 1) .fontSize(10) .fontColor($r("app.color.set_top_font_color")) .padding({ top: 5 }) } - .opacity(this.CheckedNoteArray.length == 0 ? 0.4 : 1) - .enabled(this.CheckedNoteArray.length == 0 ? false : true) + .backgroundColor($r('app.color.notelist_bgcolor_f1f3f5')) + .width("25%") + .height("100%") + .opacity(this.greyOpacity ? 0.4 : 1) + .enabled(this.greyOpacity ? false : true) .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) } Column() { Image($r('app.media.delete')) + .opacity(this.greyOpacity ? 0.4 : 1) .width(24) .height(24) + .responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 }) .onClick(() => { this.noteDataDeleteDialogCtlBottom.open() }) Text($r("app.string.delete")) + .opacity(this.greyOpacity ? 0.4 : 1) .fontSize(10) .fontColor($r("app.color.delete_font_color")) .padding({ top: 5 }) } - .opacity(this.CheckedNoteArray.length == 0 ? 0.4 : 1) - .enabled(this.CheckedNoteArray.length == 0 ? false : true) + .backgroundColor($r('app.color.notelist_bgcolor_f1f3f5')) + .width(this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes? 120 :"25%") + .height("100%") + .opacity(this.greyOpacity ? 0.4 : 1) + .enabled(this.greyOpacity ? false : true) .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) if (this.selectedFolderData.uuid != SysDefFolderUuid.RecentDeletes) { Column() { Image($r('app.media.move')) + .opacity(this.greyOpacity ? 0.4 : 1) .width(24) .height(24) + .responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 }) .onClick(() => { this.noteDataMoveDialogCtlBottom.open() }) Text($r("app.string.move")) + .opacity(this.greyOpacity ? 0.4 : 1) .fontSize(10) .fontColor($r("app.color.move_font_color")) .padding({ top: 5 }) } - .opacity(this.CheckedNoteArray.length == 0 ? 0.4 : 1) - .enabled(this.CheckedNoteArray.length == 0 ? false : true) + .backgroundColor($r('app.color.notelist_bgcolor_f1f3f5')) + .width("25%") + .height("100%") + .opacity(this.greyOpacity ? 0.4 : 1) + .enabled(this.greyOpacity ? false : true) .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) } @@ -751,11 +887,12 @@ export struct OperateNoteCompForPortrait { Image($r('app.media.recover')) .width(24) .height(24) + .responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 }) .onClick(() => { this.CheckedNoteArray.forEach((noteItem) => { noteItem.is_deleted = Delete.No noteItem.deleted_time = 0 - prompt.showToast({ message: $r('app.string.restore'), duration: 2000 }) + prompt.showToast({ message: $r('app.string.restore').toString(), duration: 2000 }) // update note to db let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) predicates_note.equalTo(NoteTableColumn.Uuid, noteItem.uuid) @@ -770,15 +907,20 @@ export struct OperateNoteCompForPortrait { .fontColor($r("app.color.recover_font_color")) .padding({ top: 5 }) } - .opacity(this.CheckedNoteArray.length == 0 ? 0.4 : 1) - .enabled(this.CheckedNoteArray.length == 0 ? false : true) + .backgroundColor($r('app.color.notelist_bgcolor_f1f3f5')) + .width(this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes? 120 :"25%") + .height("100%") + .opacity(this.greyOpacity ? 0.4 : 1) + .enabled(this.greyOpacity ? false : true) .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) } Column() { Image($r('app.media.check_all')) .width(24) .height(24) + .responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 }) .onClick(() => { if (this.CheckedNoteArray.length < NoteUtil.getNoteDataArray(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid) @@ -794,9 +936,13 @@ export struct OperateNoteCompForPortrait { .fontColor($r("app.color.check_all_font_color")) .padding({ top: 5 }) } + .backgroundColor($r('app.color.notelist_bgcolor_f1f3f5')) + .width(this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes? 120 :"25%") + .height("100%") .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) } - .width(360) + .width("100%") .height(56) .visibility(this.longpress && this.portraitModel == true ? Visibility.Visible : Visibility.None) } diff --git a/common/component/src/main/module.json5 b/common/component/src/main/module.json5 new file mode 100644 index 0000000..b6442a2 --- /dev/null +++ b/common/component/src/main/module.json5 @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "module": { + "name": "component", + "type": "har", + "deviceTypes": [ + "phone", + "tablet" + ], + "uiSyntax": "ets" + } +} diff --git a/common/resources/.gitignore b/common/resources/.gitignore new file mode 100644 index 0000000..4f9a973 --- /dev/null +++ b/common/resources/.gitignore @@ -0,0 +1,3 @@ +/node_modules +/.preview +/build \ No newline at end of file diff --git a/common/resources/build-profile.json5 b/common/resources/build-profile.json5 new file mode 100644 index 0000000..c6e5a1e --- /dev/null +++ b/common/resources/build-profile.json5 @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "apiType": "stageMode", + "buildOption": { + } +} diff --git a/common/resources/hvigorfile.js b/common/resources/hvigorfile.js new file mode 100644 index 0000000..42ed4b4 --- /dev/null +++ b/common/resources/hvigorfile.js @@ -0,0 +1,3 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +module.exports = require('@ohos/hvigor-ohos-plugin').harTasks + diff --git a/common/resources/index.ets b/common/resources/index.ets new file mode 100644 index 0000000..73d578c --- /dev/null +++ b/common/resources/index.ets @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { MainPage } from './src/main/ets/components/MainPage/MainPage' diff --git a/common/resources/package-lock.json b/common/resources/package-lock.json new file mode 100644 index 0000000..e254bc2 --- /dev/null +++ b/common/resources/package-lock.json @@ -0,0 +1,5 @@ +{ + "name": "@ohos/resources", + "version": "1.0.0", + "lockfileVersion": 1 +} diff --git a/common/resources/package.json b/common/resources/package.json new file mode 100644 index 0000000..e91259f --- /dev/null +++ b/common/resources/package.json @@ -0,0 +1,14 @@ +{ + "license":"ISC", + "types":"", + "devDependencies":{}, + "name":"@ohos/resources", + "description":"a npm package which contains arkUI2.0 page", + "ohos":{ + "org":"" + }, + "main":"index.ets", + "repository":{}, + "version":"1.0.0", + "dependencies":{} +} \ No newline at end of file diff --git a/product/pc/src/main/ets/MainAbility/pages/index.ets b/common/resources/src/main/ets/components/MainPage/MainPage.ets similarity index 75% rename from product/pc/src/main/ets/MainAbility/pages/index.ets rename to common/resources/src/main/ets/components/MainPage/MainPage.ets index 3b95ec9..2365629 100644 --- a/product/pc/src/main/ets/MainAbility/pages/index.ets +++ b/common/resources/src/main/ets/components/MainPage/MainPage.ets @@ -15,11 +15,18 @@ @Entry @Component -struct Index { +export struct MainPage { + @State message: string = 'Hello World' + build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') } - .width('100%') .height('100%') } -} \ No newline at end of file +} diff --git a/common/resources/src/main/module.json5 b/common/resources/src/main/module.json5 new file mode 100644 index 0000000..ed81e03 --- /dev/null +++ b/common/resources/src/main/module.json5 @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "module": { + "name": "resources", + "type": "har", + "deviceTypes": [ + "phone", + "tablet" + ], + "uiSyntax": "ets" + } +} diff --git a/common/resources/src/main/resources/base/element/color.json b/common/resources/src/main/resources/base/element/color.json new file mode 100644 index 0000000..416d7d4 --- /dev/null +++ b/common/resources/src/main/resources/base/element/color.json @@ -0,0 +1,216 @@ +{ + "color": [ + { + "name": "color_ffffff", + "value": "#ffffff" + }, + { + "name": "color_fffffB", + "value": "#FFFBFBFB" + }, + { + "name": "delete_color_fa2a2d", + "value": "#fa2a2d" + }, + { + "name": "cancel_color_4fb4e3", + "value": "#4fb4e3" + }, + { + "name": "divider_color_e4e4e4", + "value": "#cce4e4e4" + }, + { + "name": "divider_color_182431", + "value": "#182431" + }, + { + "name": "button_color_419fff", + "value": "#419fff" + }, + { + "name": "button_color_fb4447", + "value": "#fb4447" + }, + { + "name": "text_color_3f97e9", + "value": "#3f97e9" + }, + { + "name": "text_color_f86d05", + "value": "#f86d05" + }, + { + "name": "folder_color_182431", + "value": "#182431" + }, + { + "name": "folder_color_99182431", + "value": "#99182431" + }, + { + "name": "folder_color_f86d05", + "value": "#f86d05" + }, + { + "name": "folder_color_ffffff", + "value": "#ffffff" + }, + { + "name": "folder_color_19ffffff", + "value": "#19ffffff" + }, + { + "name": "folder_color_d6d6d6", + "value": "#d6d6d6" + }, + { + "name": "folder_color_19182431", + "value": "#19182431" + }, + { + "name": "notecontent_color_ffffff", + "value": "#ffffff" + }, + { + "name": "notecontent_color_000000", + "value": "#000000" + }, + { + "name": "folderlist_bgcolor_f1f3f5", + "value": "#f1f3f5" + }, + { + "name": "search_longpress_bgcolor_f7f8f9", + "value": "#f7f8f9" + }, + { + "name": "notelist_bgcolor_f1f3f5", + "value": "#f1f3f5" + }, + { + "name": "notelist_bgcolor_000000", + "value": "#000000" + }, + { + "name": "image_bordercolor_19182431", + "value": "#19182431" + }, + { + "name": "button_color_f86d05", + "value": "#f86d05" + }, + { + "name": "font_stylecolor_AD182431", + "value": "#AD182431" + }, + { + "name": "New_folder_input_box_color", + "value": "#FFFFFF" + }, + { + "name": "category_already_exist_font_color", + "value": "#FA2A2D" + }, + { + "name": "category_already_exist_divider_color", + "value": "#FA2A2D" + }, + { + "name": "create_folder_bg_color", + "value": "#FFFFFF" + }, + { + "name": "delete_note_bg_color", + "value": "#FFFFFF" + }, + { + "name": "choose_folder_bg_color", + "value": "#FFFFFF" + }, + { + "name": "title_input_bg_color", + "value": "#FFFFFF" + }, + { + "name": "Edit_title_bg_color", + "value": "#FFFFFF" + }, + { + "name": "press_folder_bg_color", + "value": "#FFFFFF" + }, + { + "name": "modified_time_font_color", + "value": "#A3A7AD" + }, + { + "name": "delete_font_color", + "value": "#182431" + }, + { + "name": "recover_font_color", + "value": "#182431" + }, + { + "name": "list_font_color", + "value": "#182431" + }, + { + "name": "style_font_color", + "value": "#182431" + }, + { + "name": "photo_font_color", + "value": "#182431" + }, + { + "name": "all_notes_font_color", + "value": "#182431" + }, + { + "name": "num_of_notes_font_color", + "value": "#A3A7AD" + }, + { + "name": "note_selected_font_color", + "value": "#182431" + }, + { + "name": "note_title_font_color", + "value": "#182431" + }, + { + "name": "note_title_font_color_blue", + "value": "#0000ff" + }, + { + "name": "list_modified_time_font_color", + "value": "#99182431" + }, + { + "name": "Recently_delete_prompt_font_color", + "value": "#99182431" + }, + { + "name": "Empty_page_font_color", + "value": "#A3A7AD" + }, + { + "name": "search_note_caret_color", + "value": "#F86D05" + }, + { + "name": "set_top_font_color", + "value": "#182431" + }, + { + "name": "move_font_color", + "value": "#182431" + }, + { + "name": "check_all_font_color", + "value": "#182431" + } + ] +} \ No newline at end of file diff --git a/product/pc/src/main/resources/base/element/float.json b/common/resources/src/main/resources/base/element/float.json similarity index 100% rename from product/pc/src/main/resources/base/element/float.json rename to common/resources/src/main/resources/base/element/float.json diff --git a/product/tablet/src/main/resources/base/element/string.json b/common/resources/src/main/resources/base/element/string.json similarity index 100% rename from product/tablet/src/main/resources/base/element/string.json rename to common/resources/src/main/resources/base/element/string.json diff --git a/product/phone/src/main/resources/base/media/action_bold.svg b/common/resources/src/main/resources/base/media/action_bold.svg similarity index 100% rename from product/phone/src/main/resources/base/media/action_bold.svg rename to common/resources/src/main/resources/base/media/action_bold.svg diff --git a/product/phone/src/main/resources/base/media/addNote.svg b/common/resources/src/main/resources/base/media/addNote.svg similarity index 100% rename from product/phone/src/main/resources/base/media/addNote.svg rename to common/resources/src/main/resources/base/media/addNote.svg diff --git a/product/phone/src/main/resources/base/media/allNotes.svg b/common/resources/src/main/resources/base/media/allNotes.svg similarity index 100% rename from product/phone/src/main/resources/base/media/allNotes.svg rename to common/resources/src/main/resources/base/media/allNotes.svg diff --git a/product/phone/src/main/resources/base/media/back.svg b/common/resources/src/main/resources/base/media/back.svg similarity index 100% rename from product/phone/src/main/resources/base/media/back.svg rename to common/resources/src/main/resources/base/media/back.svg diff --git a/product/phone/src/main/resources/base/media/back_1.svg b/common/resources/src/main/resources/base/media/back_1.svg similarity index 100% rename from product/phone/src/main/resources/base/media/back_1.svg rename to common/resources/src/main/resources/base/media/back_1.svg diff --git a/product/phone/src/main/resources/base/media/camera.svg b/common/resources/src/main/resources/base/media/camera.svg similarity index 100% rename from product/phone/src/main/resources/base/media/camera.svg rename to common/resources/src/main/resources/base/media/camera.svg diff --git a/product/phone/src/main/resources/base/media/check_all.svg b/common/resources/src/main/resources/base/media/check_all.svg similarity index 100% rename from product/phone/src/main/resources/base/media/check_all.svg rename to common/resources/src/main/resources/base/media/check_all.svg diff --git a/product/phone/src/main/resources/base/media/check_all1.svg b/common/resources/src/main/resources/base/media/check_all1.svg similarity index 100% rename from product/phone/src/main/resources/base/media/check_all1.svg rename to common/resources/src/main/resources/base/media/check_all1.svg diff --git a/product/phone/src/main/resources/base/media/checked.svg b/common/resources/src/main/resources/base/media/checked.svg similarity index 100% rename from product/phone/src/main/resources/base/media/checked.svg rename to common/resources/src/main/resources/base/media/checked.svg diff --git a/product/phone/src/main/resources/base/media/choose_all.svg b/common/resources/src/main/resources/base/media/choose_all.svg similarity index 100% rename from product/phone/src/main/resources/base/media/choose_all.svg rename to common/resources/src/main/resources/base/media/choose_all.svg diff --git a/product/phone/src/main/resources/base/media/circle_tick.svg b/common/resources/src/main/resources/base/media/circle_tick.svg similarity index 100% rename from product/phone/src/main/resources/base/media/circle_tick.svg rename to common/resources/src/main/resources/base/media/circle_tick.svg diff --git a/common/resources/src/main/resources/base/media/circle_tick1.svg b/common/resources/src/main/resources/base/media/circle_tick1.svg new file mode 100644 index 0000000..44d44b4 --- /dev/null +++ b/common/resources/src/main/resources/base/media/circle_tick1.svg @@ -0,0 +1,13 @@ + + + + +画板 + + diff --git a/product/phone/src/main/resources/base/media/cross.svg b/common/resources/src/main/resources/base/media/cross.svg similarity index 100% rename from product/phone/src/main/resources/base/media/cross.svg rename to common/resources/src/main/resources/base/media/cross.svg diff --git a/product/phone/src/main/resources/base/media/cross_thick.svg b/common/resources/src/main/resources/base/media/cross_thick.svg similarity index 100% rename from product/phone/src/main/resources/base/media/cross_thick.svg rename to common/resources/src/main/resources/base/media/cross_thick.svg diff --git a/product/phone/src/main/resources/base/media/cross_thin.svg b/common/resources/src/main/resources/base/media/cross_thin.svg similarity index 100% rename from product/phone/src/main/resources/base/media/cross_thin.svg rename to common/resources/src/main/resources/base/media/cross_thin.svg diff --git a/product/phone/src/main/resources/base/media/cycle_thin1.svg b/common/resources/src/main/resources/base/media/cycle_thin1.svg similarity index 100% rename from product/phone/src/main/resources/base/media/cycle_thin1.svg rename to common/resources/src/main/resources/base/media/cycle_thin1.svg diff --git a/common/resources/src/main/resources/base/media/delete.svg b/common/resources/src/main/resources/base/media/delete.svg new file mode 100644 index 0000000..c547c40 --- /dev/null +++ b/common/resources/src/main/resources/base/media/delete.svg @@ -0,0 +1,13 @@ + + + 删除 + + + + + + + + + + \ No newline at end of file diff --git a/product/phone/src/main/resources/base/media/delete1.svg b/common/resources/src/main/resources/base/media/delete1.svg similarity index 100% rename from product/phone/src/main/resources/base/media/delete1.svg rename to common/resources/src/main/resources/base/media/delete1.svg diff --git a/product/phone/src/main/resources/base/media/delete2.svg b/common/resources/src/main/resources/base/media/delete2.svg similarity index 100% rename from product/phone/src/main/resources/base/media/delete2.svg rename to common/resources/src/main/resources/base/media/delete2.svg diff --git a/product/phone/src/main/resources/base/media/emptyPage.svg b/common/resources/src/main/resources/base/media/emptyPage.svg similarity index 100% rename from product/phone/src/main/resources/base/media/emptyPage.svg rename to common/resources/src/main/resources/base/media/emptyPage.svg diff --git a/product/phone/src/main/resources/base/media/favorite.svg b/common/resources/src/main/resources/base/media/favorite.svg similarity index 100% rename from product/phone/src/main/resources/base/media/favorite.svg rename to common/resources/src/main/resources/base/media/favorite.svg diff --git a/common/resources/src/main/resources/base/media/favorite_cancel.svg b/common/resources/src/main/resources/base/media/favorite_cancel.svg new file mode 100644 index 0000000..5d0e0a1 --- /dev/null +++ b/common/resources/src/main/resources/base/media/favorite_cancel.svg @@ -0,0 +1,13 @@ + + + 收藏 + + + + + + + + + + \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/foldMove_select.svg b/common/resources/src/main/resources/base/media/foldMove_select.svg similarity index 78% rename from product/tablet/src/main/resources/base/media/foldMove_select.svg rename to common/resources/src/main/resources/base/media/foldMove_select.svg index 6b7b9d1..d9a4f73 100644 --- a/product/tablet/src/main/resources/base/media/foldMove_select.svg +++ b/common/resources/src/main/resources/base/media/foldMove_select.svg @@ -3,7 +3,7 @@ diff --git a/product/phone/src/main/resources/base/media/foldMove_unselect.svg b/common/resources/src/main/resources/base/media/foldMove_unselect.svg similarity index 100% rename from product/phone/src/main/resources/base/media/foldMove_unselect.svg rename to common/resources/src/main/resources/base/media/foldMove_unselect.svg diff --git a/product/phone/src/main/resources/base/media/folder.svg b/common/resources/src/main/resources/base/media/folder.svg similarity index 100% rename from product/phone/src/main/resources/base/media/folder.svg rename to common/resources/src/main/resources/base/media/folder.svg diff --git a/product/phone/src/main/resources/base/media/font_color.svg b/common/resources/src/main/resources/base/media/font_color.svg similarity index 100% rename from product/phone/src/main/resources/base/media/font_color.svg rename to common/resources/src/main/resources/base/media/font_color.svg diff --git a/product/phone/src/main/resources/base/media/font_large.svg b/common/resources/src/main/resources/base/media/font_large.svg similarity index 100% rename from product/phone/src/main/resources/base/media/font_large.svg rename to common/resources/src/main/resources/base/media/font_large.svg diff --git a/product/phone/src/main/resources/base/media/font_size.svg b/common/resources/src/main/resources/base/media/font_size.svg similarity index 100% rename from product/phone/src/main/resources/base/media/font_size.svg rename to common/resources/src/main/resources/base/media/font_size.svg diff --git a/product/phone/src/main/resources/base/media/font_small.svg b/common/resources/src/main/resources/base/media/font_small.svg similarity index 100% rename from product/phone/src/main/resources/base/media/font_small.svg rename to common/resources/src/main/resources/base/media/font_small.svg diff --git a/product/phone/src/main/resources/base/media/font_style.svg b/common/resources/src/main/resources/base/media/font_style.svg similarity index 100% rename from product/phone/src/main/resources/base/media/font_style.svg rename to common/resources/src/main/resources/base/media/font_style.svg diff --git a/product/phone/src/main/resources/base/media/format_italic.svg b/common/resources/src/main/resources/base/media/format_italic.svg similarity index 100% rename from product/phone/src/main/resources/base/media/format_italic.svg rename to common/resources/src/main/resources/base/media/format_italic.svg diff --git a/product/phone/src/main/resources/base/media/format_menubullte1.svg b/common/resources/src/main/resources/base/media/format_menubullte1.svg similarity index 100% rename from product/phone/src/main/resources/base/media/format_menubullte1.svg rename to common/resources/src/main/resources/base/media/format_menubullte1.svg diff --git a/product/phone/src/main/resources/base/media/format_menubullte2.svg b/common/resources/src/main/resources/base/media/format_menubullte2.svg similarity index 100% rename from product/phone/src/main/resources/base/media/format_menubullte2.svg rename to common/resources/src/main/resources/base/media/format_menubullte2.svg diff --git a/product/phone/src/main/resources/base/media/format_menulist_alphabet.svg b/common/resources/src/main/resources/base/media/format_menulist_alphabet.svg similarity index 100% rename from product/phone/src/main/resources/base/media/format_menulist_alphabet.svg rename to common/resources/src/main/resources/base/media/format_menulist_alphabet.svg diff --git a/product/phone/src/main/resources/base/media/format_menulist_number.svg b/common/resources/src/main/resources/base/media/format_menulist_number.svg similarity index 100% rename from product/phone/src/main/resources/base/media/format_menulist_number.svg rename to common/resources/src/main/resources/base/media/format_menulist_number.svg diff --git a/product/phone/src/main/resources/base/media/huaweishare1.svg b/common/resources/src/main/resources/base/media/huaweishare1.svg similarity index 100% rename from product/phone/src/main/resources/base/media/huaweishare1.svg rename to common/resources/src/main/resources/base/media/huaweishare1.svg diff --git a/product/phone/src/main/resources/base/media/icon.png b/common/resources/src/main/resources/base/media/icon.png similarity index 100% rename from product/phone/src/main/resources/base/media/icon.png rename to common/resources/src/main/resources/base/media/icon.png diff --git a/product/phone/src/main/resources/base/media/left_justify.svg b/common/resources/src/main/resources/base/media/left_justify.svg similarity index 100% rename from product/phone/src/main/resources/base/media/left_justify.svg rename to common/resources/src/main/resources/base/media/left_justify.svg diff --git a/product/phone/src/main/resources/base/media/location_notify.svg b/common/resources/src/main/resources/base/media/location_notify.svg similarity index 100% rename from product/phone/src/main/resources/base/media/location_notify.svg rename to common/resources/src/main/resources/base/media/location_notify.svg diff --git a/product/phone/src/main/resources/base/media/mid_justify.svg b/common/resources/src/main/resources/base/media/mid_justify.svg similarity index 100% rename from product/phone/src/main/resources/base/media/mid_justify.svg rename to common/resources/src/main/resources/base/media/mid_justify.svg diff --git a/product/phone/src/main/resources/base/media/minus.svg b/common/resources/src/main/resources/base/media/minus.svg similarity index 100% rename from product/phone/src/main/resources/base/media/minus.svg rename to common/resources/src/main/resources/base/media/minus.svg diff --git a/product/phone/src/main/resources/base/media/more_1.svg b/common/resources/src/main/resources/base/media/more_1.svg similarity index 100% rename from product/phone/src/main/resources/base/media/more_1.svg rename to common/resources/src/main/resources/base/media/more_1.svg diff --git a/product/phone/src/main/resources/base/media/more_list1.svg b/common/resources/src/main/resources/base/media/more_list1.svg similarity index 100% rename from product/phone/src/main/resources/base/media/more_list1.svg rename to common/resources/src/main/resources/base/media/more_list1.svg diff --git a/product/phone/src/main/resources/base/media/move.svg b/common/resources/src/main/resources/base/media/move.svg similarity index 100% rename from product/phone/src/main/resources/base/media/move.svg rename to common/resources/src/main/resources/base/media/move.svg diff --git a/product/phone/src/main/resources/base/media/multi_choose.svg b/common/resources/src/main/resources/base/media/multi_choose.svg similarity index 100% rename from product/phone/src/main/resources/base/media/multi_choose.svg rename to common/resources/src/main/resources/base/media/multi_choose.svg diff --git a/common/resources/src/main/resources/base/media/narrow.svg b/common/resources/src/main/resources/base/media/narrow.svg new file mode 100644 index 0000000..fccbe1f --- /dev/null +++ b/common/resources/src/main/resources/base/media/narrow.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_reduce + + + + + + + + + + \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/note.png b/common/resources/src/main/resources/base/media/note.png similarity index 100% rename from product/tablet/src/main/resources/base/media/note.png rename to common/resources/src/main/resources/base/media/note.png diff --git a/product/phone/src/main/resources/base/media/pic_choose.svg b/common/resources/src/main/resources/base/media/pic_choose.svg similarity index 100% rename from product/phone/src/main/resources/base/media/pic_choose.svg rename to common/resources/src/main/resources/base/media/pic_choose.svg diff --git a/product/phone/src/main/resources/base/media/picture_dark.svg b/common/resources/src/main/resources/base/media/picture_dark.svg similarity index 100% rename from product/phone/src/main/resources/base/media/picture_dark.svg rename to common/resources/src/main/resources/base/media/picture_dark.svg diff --git a/product/phone/src/main/resources/base/media/picture_white.svg b/common/resources/src/main/resources/base/media/picture_white.svg similarity index 100% rename from product/phone/src/main/resources/base/media/picture_white.svg rename to common/resources/src/main/resources/base/media/picture_white.svg diff --git a/product/phone/src/main/resources/base/media/recover.svg b/common/resources/src/main/resources/base/media/recover.svg similarity index 100% rename from product/phone/src/main/resources/base/media/recover.svg rename to common/resources/src/main/resources/base/media/recover.svg diff --git a/product/phone/src/main/resources/base/media/refresh.svg b/common/resources/src/main/resources/base/media/refresh.svg similarity index 100% rename from product/phone/src/main/resources/base/media/refresh.svg rename to common/resources/src/main/resources/base/media/refresh.svg diff --git a/product/phone/src/main/resources/base/media/right_justify.svg b/common/resources/src/main/resources/base/media/right_justify.svg similarity index 100% rename from product/phone/src/main/resources/base/media/right_justify.svg rename to common/resources/src/main/resources/base/media/right_justify.svg diff --git a/product/phone/src/main/resources/base/media/save.svg b/common/resources/src/main/resources/base/media/save.svg similarity index 100% rename from product/phone/src/main/resources/base/media/save.svg rename to common/resources/src/main/resources/base/media/save.svg diff --git a/product/phone/src/main/resources/base/media/search.svg b/common/resources/src/main/resources/base/media/search.svg similarity index 100% rename from product/phone/src/main/resources/base/media/search.svg rename to common/resources/src/main/resources/base/media/search.svg diff --git a/product/phone/src/main/resources/base/media/search_note.svg b/common/resources/src/main/resources/base/media/search_note.svg similarity index 100% rename from product/phone/src/main/resources/base/media/search_note.svg rename to common/resources/src/main/resources/base/media/search_note.svg diff --git a/product/phone/src/main/resources/base/media/set_top.svg b/common/resources/src/main/resources/base/media/set_top.svg similarity index 100% rename from product/phone/src/main/resources/base/media/set_top.svg rename to common/resources/src/main/resources/base/media/set_top.svg diff --git a/product/phone/src/main/resources/base/media/share.svg b/common/resources/src/main/resources/base/media/share.svg similarity index 100% rename from product/phone/src/main/resources/base/media/share.svg rename to common/resources/src/main/resources/base/media/share.svg diff --git a/product/phone/src/main/resources/base/media/styles.svg b/common/resources/src/main/resources/base/media/styles.svg similarity index 100% rename from product/phone/src/main/resources/base/media/styles.svg rename to common/resources/src/main/resources/base/media/styles.svg diff --git a/product/phone/src/main/resources/base/media/suojin.svg b/common/resources/src/main/resources/base/media/suojin.svg similarity index 100% rename from product/phone/src/main/resources/base/media/suojin.svg rename to common/resources/src/main/resources/base/media/suojin.svg diff --git a/product/phone/src/main/resources/base/media/suojin_back.svg b/common/resources/src/main/resources/base/media/suojin_back.svg similarity index 100% rename from product/phone/src/main/resources/base/media/suojin_back.svg rename to common/resources/src/main/resources/base/media/suojin_back.svg diff --git a/product/phone/src/main/resources/base/media/take_picture.svg b/common/resources/src/main/resources/base/media/take_picture.svg similarity index 100% rename from product/phone/src/main/resources/base/media/take_picture.svg rename to common/resources/src/main/resources/base/media/take_picture.svg diff --git a/product/phone/src/main/resources/base/media/tick_thick.svg b/common/resources/src/main/resources/base/media/tick_thick.svg similarity index 100% rename from product/phone/src/main/resources/base/media/tick_thick.svg rename to common/resources/src/main/resources/base/media/tick_thick.svg diff --git a/product/phone/src/main/resources/base/media/tick_thin.svg b/common/resources/src/main/resources/base/media/tick_thin.svg similarity index 100% rename from product/phone/src/main/resources/base/media/tick_thin.svg rename to common/resources/src/main/resources/base/media/tick_thin.svg diff --git a/product/phone/src/main/resources/base/media/todo.svg b/common/resources/src/main/resources/base/media/todo.svg similarity index 100% rename from product/phone/src/main/resources/base/media/todo.svg rename to common/resources/src/main/resources/base/media/todo.svg diff --git a/product/phone/src/main/resources/base/media/todo1.svg b/common/resources/src/main/resources/base/media/todo1.svg similarity index 100% rename from product/phone/src/main/resources/base/media/todo1.svg rename to common/resources/src/main/resources/base/media/todo1.svg diff --git a/product/phone/src/main/resources/base/media/todo_1.svg b/common/resources/src/main/resources/base/media/todo_1.svg similarity index 100% rename from product/phone/src/main/resources/base/media/todo_1.svg rename to common/resources/src/main/resources/base/media/todo_1.svg diff --git a/product/phone/src/main/resources/base/media/topped.svg b/common/resources/src/main/resources/base/media/topped.svg similarity index 100% rename from product/phone/src/main/resources/base/media/topped.svg rename to common/resources/src/main/resources/base/media/topped.svg diff --git a/product/phone/src/main/resources/base/media/triangle.svg b/common/resources/src/main/resources/base/media/triangle.svg similarity index 100% rename from product/phone/src/main/resources/base/media/triangle.svg rename to common/resources/src/main/resources/base/media/triangle.svg diff --git a/product/phone/src/main/resources/base/media/tudo2_1.svg b/common/resources/src/main/resources/base/media/tudo2_1.svg similarity index 100% rename from product/phone/src/main/resources/base/media/tudo2_1.svg rename to common/resources/src/main/resources/base/media/tudo2_1.svg diff --git a/product/phone/src/main/resources/base/media/unChecked.svg b/common/resources/src/main/resources/base/media/unChecked.svg similarity index 100% rename from product/phone/src/main/resources/base/media/unChecked.svg rename to common/resources/src/main/resources/base/media/unChecked.svg diff --git a/common/resources/src/main/resources/base/media/unClassified.svg b/common/resources/src/main/resources/base/media/unClassified.svg new file mode 100644 index 0000000..10be823 --- /dev/null +++ b/common/resources/src/main/resources/base/media/unClassified.svg @@ -0,0 +1,7 @@ + + + 未分类图标 + + + + \ No newline at end of file diff --git a/product/phone/src/main/resources/base/media/underline.svg b/common/resources/src/main/resources/base/media/underline.svg similarity index 100% rename from product/phone/src/main/resources/base/media/underline.svg rename to common/resources/src/main/resources/base/media/underline.svg diff --git a/product/phone/src/main/resources/base/media/undo.svg b/common/resources/src/main/resources/base/media/undo.svg similarity index 100% rename from product/phone/src/main/resources/base/media/undo.svg rename to common/resources/src/main/resources/base/media/undo.svg diff --git a/product/phone/src/main/resources/base/media/unlock.svg b/common/resources/src/main/resources/base/media/unlock.svg similarity index 100% rename from product/phone/src/main/resources/base/media/unlock.svg rename to common/resources/src/main/resources/base/media/unlock.svg diff --git a/product/phone/src/main/resources/base/media/verticalBar.svg b/common/resources/src/main/resources/base/media/verticalBar.svg similarity index 100% rename from product/phone/src/main/resources/base/media/verticalBar.svg rename to common/resources/src/main/resources/base/media/verticalBar.svg diff --git a/product/phone/src/main/resources/base/media/zoom.svg b/common/resources/src/main/resources/base/media/zoom.svg similarity index 100% rename from product/phone/src/main/resources/base/media/zoom.svg rename to common/resources/src/main/resources/base/media/zoom.svg diff --git a/common/resources/src/main/resources/en_US/element/string.json b/common/resources/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000..8529f1b --- /dev/null +++ b/common/resources/src/main/resources/en_US/element/string.json @@ -0,0 +1,164 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "Notepad" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + }, + { + "name": "note", + "value": "Notes" + }, + { + "name": "allNotes", + "value": "All notes" + }, + { + "name": "unClassified", + "value": "No category" + }, + { + "name": "recentDeletes", + "value": "Recently deleted" + }, + { + "name": "myFavorites", + "value": "My favourites" + }, + { + "name": "create", + "value": "NEW" + }, + { + "name": "createFolder", + "value": "New Folder" + }, + { + "name": "editFolder", + "value": "Edit Folder" + }, + { + "name": "deleteFolder", + "value": "Delete Folder" + }, + { + "name": "createNote", + "value": "New note" + }, + { + "name": "cancel", + "value": "CANCEL" + }, + { + "name": "save", + "value": "SAVE" + }, + { + "name": "delete", + "value": "DELETE" + }, + { + "name": "delete_tips", + "value": "Do you want to delete this folder and its contents?" + }, + { + "name": "deleteNote", + "value": "Delete this note?" + }, + { + "name": "deleteNoteComplete", + "value": "Permanently delete this note?" + }, + { + "name": "deleteAllNote", + "value": "Delete all note?" + }, + { + "name": "deletePartNote", + "value": "Delete %d notes?" + }, + { + "name": "selected", + "value": "%d item selected" + }, + { + "name": "none_selected", + "value": "None selected" + }, + { + "name": "noteslist", + "value": "notes" + }, + { + "name": "Empty_page", + "value": "No notes" + }, + { + "name": "searchNote", + "value": "Search notes" + }, + { + "name": "chooseFolder", + "value": "Select folder" + }, + { + "name": "category_already_exist", + "value": "The folder name already exists." + }, + { + "name": "input_placeholder", + "value": "Name" + }, + { + "name": "permanently_delete_tips", + "value": "notes will be permanently deleted after the number of days shown (up to 30 days)." + }, + { + "name": "set_top", + "value": "Top" + }, + { + "name": "move", + "value": "Move" + }, + { + "name": "recover", + "value": "Restore" + }, + { + "name": "check_all", + "value": "Select all" + }, + { + "name": "editNoteTitle", + "value": "Modify the title" + }, + { + "name": "list", + "value": "Checklist" + }, + { + "name": "style", + "value": "Style" + }, + { + "name": "photo", + "value": "Gallery" + }, + { + "name": "title", + "value": "Title" + }, + { + "name": "empty_note", + "value": "The note content is empty." + }, + { + "name": "restore", + "value": "Note Restored" + } + ] +} \ No newline at end of file diff --git a/product/phone/src/main/ets/MainAbility/res/cake.png b/common/resources/src/main/resources/rawfile/cake.png similarity index 100% rename from product/phone/src/main/ets/MainAbility/res/cake.png rename to common/resources/src/main/resources/rawfile/cake.png diff --git a/common/resources/src/main/resources/rawfile/editor.html b/common/resources/src/main/resources/rawfile/editor.html new file mode 100644 index 0000000..2f8ff4d --- /dev/null +++ b/common/resources/src/main/resources/rawfile/editor.html @@ -0,0 +1,24 @@ + + + + + "editorJs" + + + + + +
+
+ + + diff --git a/product/phone/src/main/resources/rawfile/editor_style.css b/common/resources/src/main/resources/rawfile/editor_style.css similarity index 79% rename from product/phone/src/main/resources/rawfile/editor_style.css rename to common/resources/src/main/resources/rawfile/editor_style.css index abf650a..234d8f2 100644 --- a/product/phone/src/main/resources/rawfile/editor_style.css +++ b/common/resources/src/main/resources/rawfile/editor_style.css @@ -24,7 +24,7 @@ body { display: table; table-layout: fixed; width: 100%; - min-height:100%; + min-height: 100%; color: #333333; margin: 0; } @@ -32,19 +32,19 @@ body { #editorjs { padding-left: 24px; padding-right: 24px; - width:100%; + width: 100%; display: table-cell; outline: 0px solid transparent; background-repeat: no-repeat; background-position: center; background-size: cover; color: #333333; - font-size:40px; + font-size: 16px; } #editorjs[placeholder]:empty:not(:focus):before { content: attr(placeholder); - font-size:40px; + font-size: 16px; color: #9b9b9b; } @@ -52,38 +52,38 @@ body { background: #F88805; border: 2px solid #F88805; outline: none; - margin-left:0px; - margin-right:0px; + margin-left: 0px; + margin-right: 0px; opacity: 1; } .note-checkbox { - width: 23px; - height: 23px; + width: 20px; + height: 20px; background-color: #ffffff; border: 2px solid #555555; --webkit-border-radius: 50%; --webkit-appearance: none; --webkit-user-select: none; + -webkit-border-radius: 50%; + -webkit-appearance: none; + -webkit-user-select: none; border-radius: 50%; font-size: 0.8rem; - margin-left:0px; - margin-top:10px; - margin-right:0px; - margin-bottom:0px; + margin-left: 0px; + margin-top: 0px; + margin-right: 4px; + margin-bottom: 9px; outline: none; padding: 0; position: relative; display: inline-block; --webkit-transition: background-color ease 0.1s; + -webkit-transition: background-color ease 0.1s; transition: background-color ease 0.1s; vertical-align: top; cursor: default; user-select: none; } -.note-checkbox:checked+span{ +.note-checkbox:checked+span { text-decoration: line-through; - color:#F88805; + color: #F88805; opacity: 0.4; } diff --git a/product/tablet/src/main/resources/rawfile/rich_editor.js b/common/resources/src/main/resources/rawfile/rich_editor.js similarity index 76% rename from product/tablet/src/main/resources/rawfile/rich_editor.js rename to common/resources/src/main/resources/rawfile/rich_editor.js index c30a8dd..2dc3e95 100644 --- a/product/tablet/src/main/resources/rawfile/rich_editor.js +++ b/common/resources/src/main/resources/rawfile/rich_editor.js @@ -18,7 +18,7 @@ var RICH_EDITOR = {}; RICH_EDITOR.editor = document.getElementById('editorjs'); RICH_EDITOR.setHtml = function(contents) { - RICH_EDITOR.editor.innerHTML = decodeURIComponent(contents.replace(/\+/g, '%20')); + RICH_EDITOR.editor.innerHTML = contents.replace(/%20/g, '+'); } RICH_EDITOR.getHtml = function() { @@ -57,7 +57,42 @@ RICH_EDITOR.setUnderline = function() { document.execCommand('underline', false, null); } +RICH_EDITOR.getListStyle = function () { + var selection, type; + if (window.getSelection) { + selection = getSelection(); + } + if (selection) { + var range = selection.getRangeAt ? selection.getRangeAt(0) : selection.createRange(); + try { + var child = range.commonAncestorContainer.parentNode; + for (var i = 0; i < 10; i++) { + if (child.nodeName == "OL") { + console.info('insertOrderedList') + document.execCommand('insertOrderedList', false, null); + return child.style["list-style"] + } + if (child.nodeName == "UL") { + console.info('insertUnorderedList') + document.execCommand('insertUnorderedList', false, null); + return child.style["list-style"] + } + if (child.parentNode) { + child = child.parentNode + } + } + } catch (err) { + console.error(err) + } + } + +} + RICH_EDITOR.setNumbers = function () { + let listStyle = RICH_EDITOR.getListStyle() + if(listStyle == "decimal") { + return + } document.execCommand('insertOrderedList', false, null); var selection, type; if (window.getSelection) { @@ -77,12 +112,16 @@ RICH_EDITOR.setNumbers = function () { } } } catch (err) { - + console.error(err) } } } RICH_EDITOR.setABC = function () { + let listStyle = RICH_EDITOR.getListStyle() + if(listStyle == "lower-alpha") { + return + } document.execCommand('insertOrderedList', false, null); var selection, type; if (window.getSelection) { @@ -102,12 +141,16 @@ RICH_EDITOR.setABC = function () { } } } catch (err) { - + console.error(err) } } } RICH_EDITOR.setBullets = function () { + let listStyle = RICH_EDITOR.getListStyle() + if(listStyle == "disc") { + return + } document.execCommand('insertUnorderedList', false, null); var selection, type; if (window.getSelection) { @@ -127,12 +170,16 @@ RICH_EDITOR.setBullets = function () { } } } catch (err) { - + console.error(err) } } } RICH_EDITOR.setSquare = function () { + let listStyle = RICH_EDITOR.getListStyle() + if(listStyle == "square") { + return + } document.execCommand('insertUnorderedList', false, null); var selection, type; if (window.getSelection) { @@ -152,7 +199,7 @@ RICH_EDITOR.setSquare = function () { } } } catch (err) { - + console.error(err) } } } @@ -172,12 +219,23 @@ RICH_EDITOR.execFontSize = function (size, unit) { fontElements.style.fontSize = size + 'px' }; +var pad = 24 RICH_EDITOR.setIndent = function() { - document.execCommand('indent', false, null); + var parents = document.getElementById('editorjs') + parents.removeAttribute('padding-left'); + pad = pad + 24 + parents.style.paddingLeft = pad + 'px' } RICH_EDITOR.setOutdent = function() { - document.execCommand('outdent', false, null); + var parents = document.getElementById('editorjs') + parents.removeAttribute('padding-left'); + if (pad == 24) { + parents.style.paddingLeft = 24 + 'px' + } else { + pad = pad - 24 + parents.style.paddingLeft = pad + 'px' + } } RICH_EDITOR.setJustifyLeft = function() { @@ -263,21 +321,28 @@ RICH_EDITOR.getSelectedAnchorNode=function(){ function get_html_content() { console.log('get_html_content'); - var htmlString = encodeURI(RICH_EDITOR.getHtml()) + var htmlString = RICH_EDITOR.getHtml() var str = callBackToApp.callbackhtml(htmlString) console.log('get_html_content end'); } function save_html_content() { console.log('save_html_content'); - var htmlString = encodeURI(RICH_EDITOR.getHtml()) - var str = callBackToApp.callbackhtmlSave(htmlString) + var htmlString = RICH_EDITOR.getHtml() + var str = callBackToApp.callbackhtmlSave(htmlString.replace(/\+/g, '%20')) console.log('save_html_content end'); } function scheduled_save_content() { console.info('scheduled_save_content') - var htmlString = encodeURI(RICH_EDITOR.getHtml()) + var htmlString = RICH_EDITOR.getHtml() var str = callBackToApp.callbackScheduledSave(htmlString) console.info('scheduled_save_content end') +} + +RICH_EDITOR.getFontSizes = function(){ + document.execCommand("fontSize", false, null); + var fontElements = window.getSelection().anchorNode.parentNode + var getSize = fontElements.style.fontSize + var str = callBackToApp.callbackGetSize(getSize) } \ No newline at end of file diff --git a/product/phone/src/main/ets/MainAbility/res/shuxue.png b/common/resources/src/main/resources/rawfile/shuxue.png similarity index 100% rename from product/phone/src/main/ets/MainAbility/res/shuxue.png rename to common/resources/src/main/resources/rawfile/shuxue.png diff --git a/product/phone/src/main/resources/base/element/string.json b/common/resources/src/main/resources/zh_CN/element/string.json similarity index 100% rename from product/phone/src/main/resources/base/element/string.json rename to common/resources/src/main/resources/zh_CN/element/string.json diff --git a/common/utils/.gitignore b/common/utils/.gitignore new file mode 100644 index 0000000..4f9a973 --- /dev/null +++ b/common/utils/.gitignore @@ -0,0 +1,3 @@ +/node_modules +/.preview +/build \ No newline at end of file diff --git a/common/utils/build-profile.json5 b/common/utils/build-profile.json5 new file mode 100644 index 0000000..c6e5a1e --- /dev/null +++ b/common/utils/build-profile.json5 @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "apiType": "stageMode", + "buildOption": { + } +} diff --git a/common/utils/build.gradle b/common/utils/build.gradle deleted file mode 100644 index 17f0e43..0000000 --- a/common/utils/build.gradle +++ /dev/null @@ -1,20 +0,0 @@ -apply plugin: 'com.huawei.ohos.library' -//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 -ohos { - compileSdkVersion 8 - defaultConfig { - compatibleSdkVersion 8 - } - - buildTypes { - release { - proguardOpt { - proguardEnabled false - rulesFiles 'proguard-rules.pro' - } - } - } -} - -dependencies { -} diff --git a/common/utils/hvigorfile.js b/common/utils/hvigorfile.js new file mode 100644 index 0000000..42ed4b4 --- /dev/null +++ b/common/utils/hvigorfile.js @@ -0,0 +1,3 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +module.exports = require('@ohos/hvigor-ohos-plugin').harTasks + diff --git a/common/utils/index.ets b/common/utils/index.ets new file mode 100644 index 0000000..835b75f --- /dev/null +++ b/common/utils/index.ets @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './src/main/ets/default/access/MediaLibraryAccess'; +export * from './src/main/ets/default/baseUtil/DateUtil'; +export * from './src/main/ets/default/baseUtil/FolderUtil'; +export * from './src/main/ets/default/baseUtil/GlobalResourceManager'; +export * from './src/main/ets/default/baseUtil/LayoutUtil'; +export * from './src/main/ets/default/baseUtil/LogUtil'; +export * from './src/main/ets/default/baseUtil/NoteUtil'; +export * from './src/main/ets/default/baseUtil/OperationUtils'; +export * from './src/main/ets/default/baseUtil/RdbStoreUtil'; +export * from './src/main/ets/default/constants/StyleConstants'; +export * from './src/main/ets/default/model/databaseModel/AttachmentData'; +export * from './src/main/ets/default/model/databaseModel/EnumData'; +export * from './src/main/ets/default/model/databaseModel/FolderData'; +export * from './src/main/ets/default/model/databaseModel/NoteData'; +export * from './src/main/ets/default/model/databaseModel/SysDefData'; +export * from './src/main/ets/default/model/NoteBaseData'; +export * from './src/main/ets/default/model/searchModel/SearchModel'; + diff --git a/common/utils/package-lock.json b/common/utils/package-lock.json new file mode 100644 index 0000000..1da89db --- /dev/null +++ b/common/utils/package-lock.json @@ -0,0 +1,11 @@ +{ + "name": "@ohos/utils", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@ohos/source": { + "version": "file:../resources" + } + } +} diff --git a/common/utils/package.json b/common/utils/package.json new file mode 100644 index 0000000..acf594b --- /dev/null +++ b/common/utils/package.json @@ -0,0 +1,16 @@ +{ + "license":"ISC", + "types":"", + "devDependencies":{}, + "name":"@ohos/utils", + "description":"a npm package which contains arkUI2.0 page", + "ohos":{ + "org":"" + }, + "main":"index.ets", + "repository":{}, + "version":"1.0.0", + "dependencies":{ + "@ohos/source":"file:../resources" + } +} \ No newline at end of file diff --git a/common/utils/proguard-rules.pro b/common/utils/proguard-rules.pro deleted file mode 100644 index f7666e4..0000000 --- a/common/utils/proguard-rules.pro +++ /dev/null @@ -1 +0,0 @@ -# config module specific ProGuard rules here. \ No newline at end of file diff --git a/common/utils/src/main/config.json b/common/utils/src/main/config.json deleted file mode 100644 index 69ee57b..0000000 --- a/common/utils/src/main/config.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.note", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.note.common", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "utils", - "moduleType": "har" - } - } -} \ No newline at end of file diff --git a/common/utils/src/main/ets/default/access/MediaLibraryAccess.ets b/common/utils/src/main/ets/default/access/MediaLibraryAccess.ets index 6022ad5..8028896 100644 --- a/common/utils/src/main/ets/default/access/MediaLibraryAccess.ets +++ b/common/utils/src/main/ets/default/access/MediaLibraryAccess.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import {LogUtil} from '../baseUtil/LogUtil.ets' +import {LogUtil} from '../baseUtil/LogUtil' import MediaLib from '@ohos.multimedia.mediaLibrary'; const TAG = "MediaLibraryAccess" diff --git a/common/utils/src/main/ets/default/baseUtil/DateUtil.ets b/common/utils/src/main/ets/default/baseUtil/DateUtil.ets index 4e68264..3d97ea6 100644 --- a/common/utils/src/main/ets/default/baseUtil/DateUtil.ets +++ b/common/utils/src/main/ets/default/baseUtil/DateUtil.ets @@ -13,8 +13,8 @@ * limitations under the License. */ -import {LogUtil} from './LogUtil.ets' -import GlobalResourceManager from './GlobalResourceManager.ets' +import {LogUtil} from './LogUtil' +import GlobalResourceManager from './GlobalResourceManager' const TAG = "DateUtil" diff --git a/common/utils/src/main/ets/default/baseUtil/FolderUtil.ets b/common/utils/src/main/ets/default/baseUtil/FolderUtil.ets index 460be37..44ce63d 100644 --- a/common/utils/src/main/ets/default/baseUtil/FolderUtil.ets +++ b/common/utils/src/main/ets/default/baseUtil/FolderUtil.ets @@ -13,13 +13,13 @@ * limitations under the License. */ -import {folderIconMap, folderTextMap} from '../model/NoteBaseData.ets' -import FolderData from '../model/databaseModel/FolderData.ets' -import NoteData from '../model/databaseModel/NoteData.ets' -import {SysDefFolderUuid, FolderType, Favorite, Delete} from '../model/databaseModel/EnumData.ets' -import GlobalResourceManager from './GlobalResourceManager.ets' -import StyleConstants from '../constants/StyleConstants.ets' -import {LogUtil} from './LogUtil.ets' +import {folderIconMap, folderTextMap} from '../model/NoteBaseData' +import FolderData from '../model/databaseModel/FolderData' +import NoteData from '../model/databaseModel/NoteData' +import {SysDefFolderUuid, FolderType, Favorite, Delete} from '../model/databaseModel/EnumData' +import GlobalResourceManager from './GlobalResourceManager' +import StyleConstants from '../constants/StyleConstants' +import {LogUtil} from './LogUtil' const TAG = "FolderUtil" @@ -72,7 +72,7 @@ export class FolderUtil { } LogUtil.info(TAG, "folderData uuid " + folderData.uuid + " isSelected " + isSelected) if (folderData.folder_type == FolderType.SysDef || folderData.folder_type == FolderType.FeatureDef) { - return isSelected ? $r("app.color.folder_color_f86d05") : $r("app.color.folder_color_182431") + return isSelected ? $r("app.color.folder_color_f86d05") : $r("app.color.folder_color_99182431") } return folderData.color } diff --git a/common/utils/src/main/ets/default/baseUtil/GlobalResourceManager.ets b/common/utils/src/main/ets/default/baseUtil/GlobalResourceManager.ets index 9ceac31..1676f3f 100644 --- a/common/utils/src/main/ets/default/baseUtil/GlobalResourceManager.ets +++ b/common/utils/src/main/ets/default/baseUtil/GlobalResourceManager.ets @@ -14,7 +14,7 @@ */ import Rsm from '@ohos.resourceManager'; -import {LogUtil} from './LogUtil.ets' +import {LogUtil} from './LogUtil' const TAG = "Note_GlobalResourceManager" @@ -49,5 +49,4 @@ export class GlobalResourceManager { let mGlobalResourceManager = new GlobalResourceManager(); -export default mGlobalResourceManager as GlobalResourceManager -; +export default mGlobalResourceManager as GlobalResourceManager; diff --git a/common/utils/src/main/ets/default/baseUtil/LayoutUtil.ets b/common/utils/src/main/ets/default/baseUtil/LayoutUtil.ets index 0e867fa..872aac9 100644 --- a/common/utils/src/main/ets/default/baseUtil/LayoutUtil.ets +++ b/common/utils/src/main/ets/default/baseUtil/LayoutUtil.ets @@ -13,15 +13,15 @@ * limitations under the License. */ -import {WidthWeightMessage, unSelectedNoteBgColorMap, selectedNoteBgColorMap, folderTextMap, widthWeightMessageMap} from '../model/NoteBaseData.ets' -import FolderData from '../model/databaseModel/FolderData.ets' -import NoteData from '../model/databaseModel/NoteData.ets' -import {SysDefFolderUuid, FolderType, Favorite, Delete} from '../model/databaseModel/EnumData.ets' -import GlobalResourceManager from './GlobalResourceManager.ets' -import StyleConstants from '../constants/StyleConstants.ets' -import {LogUtil} from './LogUtil.ets' -import FolderUtil from './FolderUtil.ets' -import NoteUtil from './NoteUtil.ets' +import {WidthWeightMessage, unSelectedNoteBgColorMap, selectedNoteBgColorMap, folderTextMap, widthWeightMessageMap} from '../model/NoteBaseData' +import FolderData from '../model/databaseModel/FolderData' +import NoteData from '../model/databaseModel/NoteData' +import {SysDefFolderUuid, FolderType, Favorite, Delete} from '../model/databaseModel/EnumData' +import GlobalResourceManager from './GlobalResourceManager' +import StyleConstants from '../constants/StyleConstants' +import {LogUtil} from './LogUtil' +import FolderUtil from './FolderUtil' +import NoteUtil from './NoteUtil' const TAG = "LayoutUtil" diff --git a/common/utils/src/main/ets/default/baseUtil/LogUtil.ets b/common/utils/src/main/ets/default/baseUtil/LogUtil.ets index 0f5a561..637a0cb 100644 --- a/common/utils/src/main/ets/default/baseUtil/LogUtil.ets +++ b/common/utils/src/main/ets/default/baseUtil/LogUtil.ets @@ -16,20 +16,36 @@ /** * Log Util */ + export class LogUtil { - static debug(tag: string, msg: string) { - console.debug(tag + ', ' + msg) + private static readonly IS_DEBUG_ON: boolean = false; + private static readonly CONTACTS_DOMAIN: string = "00902"; + private static readonly SLASH: string = "/"; + private static readonly COLON: string = ": "; + constructor() { } - static info(tag: string, msg: string) { - console.info(tag + ', ' + msg) + private static prefix(tag: string) { + return this.CONTACTS_DOMAIN + this.SLASH + tag + this.COLON; } - static warn(tag: string, msg: string) { - console.warn(tag + ', ' + msg) + static debug(tag: string, msg: string, ...args: any[]) { + if (this.IS_DEBUG_ON) { + console.info(this.prefix(tag) + msg, args); + } else { + console.debug(this.prefix(tag) + msg, args); + } } - static error(tag: string, msg: string) { - console.error(tag + ', ' + msg) + static info(tag: string, msg: string, ...args: any[]) { + console.info(this.prefix(tag) + msg, args); + } + + static warn(tag: string, msg: string, ...args: any[]) { + console.warn(this.prefix(tag) + msg, args); + } + + static error(tag: string, msg: string, ...args: any[]) { + console.error(this.prefix(tag) + msg, args); } } \ No newline at end of file diff --git a/common/utils/src/main/ets/default/baseUtil/NoteUtil.ets b/common/utils/src/main/ets/default/baseUtil/NoteUtil.ets index 73d66dd..898922e 100644 --- a/common/utils/src/main/ets/default/baseUtil/NoteUtil.ets +++ b/common/utils/src/main/ets/default/baseUtil/NoteUtil.ets @@ -14,16 +14,16 @@ */ import {WidthWeightMessage, unSelectedNoteBgColorMap, selectedNoteBgColorMap, folderTextMap, widthWeightMessageMap -} from '../model/NoteBaseData.ets' -import FolderData from '../model/databaseModel/FolderData.ets' -import NoteData from '../model/databaseModel/NoteData.ets' +} from '../model/NoteBaseData' +import FolderData from '../model/databaseModel/FolderData' +import NoteData from '../model/databaseModel/NoteData' import {SysDefFolderUuid, FolderType, Favorite, Delete, TableName, NoteTableColumn, -} from '../model/databaseModel/EnumData.ets' -import GlobalResourceManager from './GlobalResourceManager.ets' -import StyleConstants from '../constants/StyleConstants.ets' -import {LogUtil} from './LogUtil.ets' -import FolderUtil from './FolderUtil.ets' -import RdbStoreUtil from './RdbStoreUtil.ets' +} from '../model/databaseModel/EnumData' +import GlobalResourceManager from './GlobalResourceManager' +import StyleConstants from '../constants/StyleConstants' +import {LogUtil} from './LogUtil' +import FolderUtil from './FolderUtil' +import RdbStoreUtil from './RdbStoreUtil' import prompt from '@system.prompt' const TAG = "NoteUtil" @@ -235,6 +235,10 @@ export class NoteUtil { getFirstNoteData(allNoteDataArray: NoteData[], folderUuid: string): NoteData { let noteDataArray: NoteData[] = this.getNoteDataArray(allNoteDataArray, folderUuid); LogUtil.info(TAG, "get noteDataArray size " + noteDataArray.length.toString()) + if (noteDataArray.length == 0) { + LogUtil.info(TAG, "get noteDataArray empty") + return undefined; + } return noteDataArray == undefined ? null : noteDataArray[0] } diff --git a/common/utils/src/main/ets/default/baseUtil/OperationUtils.ets b/common/utils/src/main/ets/default/baseUtil/OperationUtils.ets index eb3a43c..99ff038 100644 --- a/common/utils/src/main/ets/default/baseUtil/OperationUtils.ets +++ b/common/utils/src/main/ets/default/baseUtil/OperationUtils.ets @@ -13,8 +13,8 @@ * limitations under the License. */ -import {LogUtil} from './LogUtil.ets' -import {MediaLibraryAccess} from '../access/MediaLibraryAccess.ets'; +import {LogUtil} from './LogUtil' +import {MediaLibraryAccess} from '../access/MediaLibraryAccess'; import fileio from '@ohos.fileio'; const TAG = "OperationUtils" @@ -43,7 +43,7 @@ export class OperationUtils { var dir = context.filesDir // 2、生成本地文件名 var time = new Date().getTime() - var imagePath = dir + "/" + time.toString().substr(5) + "_note" + numId + ".jpg" + var imagePath = dir + "/" + time.toString() + "_note" + ".jpg" // 3、拷贝 await fileio.copyFile(fd, imagePath) // 4、关闭安fd,Asset @@ -67,7 +67,7 @@ export class OperationUtils { } async getFileAssetById(id,context){ - LogUtil.info(TAG, 'getFileAssetById'); + LogUtil.info(TAG, 'getFileAssetById', id); let fetchOpt = { selections : 'file_id =?', selectionArgs : [`${id}`], diff --git a/common/utils/src/main/ets/default/baseUtil/RdbStoreUtil.ets b/common/utils/src/main/ets/default/baseUtil/RdbStoreUtil.ets index 736ae52..8b2f934 100644 --- a/common/utils/src/main/ets/default/baseUtil/RdbStoreUtil.ets +++ b/common/utils/src/main/ets/default/baseUtil/RdbStoreUtil.ets @@ -15,16 +15,18 @@ import ohosDataRdb from '@ohos.data.rdb' import fileio from '@ohos.fileio' -import {LogUtil} from './LogUtil.ets' -import FolderUtil from './FolderUtil.ets' -import NoteUtil from './NoteUtil.ets' -import SysDefData from '../model/databaseModel/SysDefData.ets' -import FolderData from '../model/databaseModel/FolderData.ets' -import NoteData from '../model/databaseModel/NoteData.ets' -import {TableSql, TableName, FolderTableColumn, NoteTableColumn, SysDefFolderUuid} from '../model/databaseModel/EnumData.ets' +import {LogUtil} from './LogUtil' +import FolderUtil from './FolderUtil' +import NoteUtil from './NoteUtil' +import SysDefData from '../model/databaseModel/SysDefData' +import FolderData from '../model/databaseModel/FolderData' +import NoteData from '../model/databaseModel/NoteData' +import {TableSql, TableName, FolderTableColumn, NoteTableColumn, SysDefFolderUuid} from '../model/databaseModel/EnumData' const TAG = "RdbStoreUtil" +const FileMaxSize: number = 20 * 1024 * 1024 + /** * db instance */ @@ -95,7 +97,6 @@ export default { if (isContinue) { let continueNote: string = AppStorage.Get('ContinueNote') let continueSection = AppStorage.Get('ContinueSection') - let noteObj = JSON.parse(continueNote) let noteData = new NoteData(noteObj.uuid, noteObj.title, noteObj.uuid, noteObj.folder_uuid, noteObj.content_text, noteObj.content_img, noteObj.note_type, noteObj.is_top, noteObj.is_favorite, @@ -103,16 +104,10 @@ export default { // save img to FileDir LogUtil.info(TAG, "createRdbStore, save img to FileDir") - let srcArray = this.getSrcFromHtml(decodeURI(noteObj.content_text)) - srcArray.forEach((src: string) => { - let lastIndex = src.lastIndexOf('/') - LogUtil.info(TAG, " createRdbStore, lastIndex : " + lastIndex) - if (lastIndex != -1) { - let imgName = src.substring(lastIndex + 1) - this.writeToFileDir(context, imgName) - } + let imgNameArray = this.getImgNameFromHtml(noteData) + imgNameArray.forEach((imgName: string) => { + this.writeToFileDir(imgName) }) - LogUtil.info(TAG, "createRdbStore, save img to FileDir success") // if not exit this note let exist = false @@ -147,13 +142,17 @@ export default { AppStorage.SetOrCreate('Folder', FolderUtil.getFolderData(folderDataArray, folderUuid)) } AppStorage.SetOrCreate('Note', noteData) + AppStorage.SetOrCreate('ContinueNote', JSON.stringify(noteData.toNoteObject())) AppStorage.SetOrCreate('Section', continueSection) + AppStorage.SetOrCreate('NewNote', noteData) } else { LogUtil.info(TAG, "createRdbStore, IsContinue false") AppStorage.SetOrCreate('Folder', AppStorage.Get('AllFolderArray')[0]) let note = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), SysDefFolderUuid.AllNotes) AppStorage.SetOrCreate('Note', note) - AppStorage.SetOrCreate('ContinueNote', JSON.stringify(note.toNoteObject())) + if (note) { + AppStorage.SetOrCreate('ContinueNote', JSON.stringify(note.toNoteObject())) + } AppStorage.SetOrCreate('Section', 3) } AppStorage.SetOrCreate('DBQueryFinished', 1) @@ -218,7 +217,7 @@ export default { AppStorage.SetOrCreate('AllNoteArray', noteDataArray) LogUtil.info(TAG, "AppStorage[query] set AllFolderArray and AllNoteArray success") - // 迁移 + // save continue data let isContinue = AppStorage.Get('IsContinue'); LogUtil.info(TAG, "initAppStorage, isContinue is " + isContinue) if (isContinue) { @@ -232,16 +231,10 @@ export default { // save img to FileDir LogUtil.info(TAG, "initAppStorage, save img to FileDir") - let srcArray = this.getSrcFromHtml(decodeURI(noteObj.content_text)) - srcArray.forEach((src: string) => { - let lastIndex = src.lastIndexOf('/') - LogUtil.info(TAG, " initAppStorage, lastIndex : " + lastIndex) - if (lastIndex != -1) { - let imgName = src.substring(lastIndex + 1) - this.writeToFileDir(context, imgName) - } + let imgNameArray = this.getImgNameFromHtml(noteData) + imgNameArray.forEach((imgName: string) => { + this.writeToFileDir(imgName) }) - LogUtil.info(TAG, "initAppStorage, save img to FileDir success") // if not exit this note let exist = false @@ -276,13 +269,17 @@ export default { AppStorage.SetOrCreate('Folder', FolderUtil.getFolderData(folderDataArray, folderUuid)) } AppStorage.SetOrCreate('Note', noteData) + AppStorage.SetOrCreate('ContinueNote', JSON.stringify(noteData.toNoteObject())) AppStorage.SetOrCreate('Section', continueSection) + AppStorage.SetOrCreate('NewNote', noteData) } else { - LogUtil.info(TAG, "RdbStoreUtil initAppStorage, IsContinue false") + LogUtil.info(TAG, "initAppStorage, IsContinue false") AppStorage.SetOrCreate('Folder', AppStorage.Get('AllFolderArray')[0]) let note = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), SysDefFolderUuid.AllNotes) AppStorage.SetOrCreate('Note', note) - AppStorage.SetOrCreate('ContinueNote', JSON.stringify(note.toNoteObject())) + if (note) { + AppStorage.SetOrCreate('ContinueNote', JSON.stringify(note.toNoteObject())) + } AppStorage.SetOrCreate('Section', 3) } AppStorage.SetOrCreate('DBQueryFinished', 1) @@ -293,45 +290,87 @@ export default { }) }, - getSrcFromHtml(html: string): any{ - LogUtil.info(TAG, "getSrcFromHtml, html : " + html) + getImgNameFromHtml(noteData: NoteData): any{ + let newModuleName = "file://" + globalThis.noteContext.filesDir + let imgNameArray = [] + let html = noteData.content_text + if (html == undefined || html == null || html == "") { + return imgNameArray + } let imgReg = /]+>/g let srcReg = /src=[\'\"]?([^\'\"]*)[\'\"]?/i let imgArray = html.match(imgReg) - let srcArray = [] if (imgArray != null) { + let hasFirstImg: boolean = false for (let i = 0; i < imgArray.length; i++) { let src = imgArray[i].match(srcReg) - LogUtil.info(TAG, "getSrcFromHtml, src[1] : " + src[1]) - srcArray.push(src[1]) + if (src != null && src.length > 1) { + LogUtil.info(TAG, "getImgNameFromHtml, src[1] : " + src[1]) + let lastIndex = src[1].lastIndexOf('/') + if (lastIndex != -1) { + let oldModuleName = src[1].substring(0, lastIndex) + let imgName = src[1].substring(lastIndex + 1) + noteData.content_text = noteData.content_text.replace(oldModuleName, newModuleName) + if (!hasFirstImg) { + noteData.content_img = newModuleName + "/" + imgName + hasFirstImg = true + } + imgNameArray.push(imgName) + } + } } } - LogUtil.info(TAG, "getSrcFromHtml, srcArray : " + srcArray) - return srcArray + return imgNameArray }, - writeToFileDir(context, fileName: string) { + writeToFileDir(fileName: string) { LogUtil.info(TAG, "writeToFileDir fileName : " + fileName) - let distributedFilesDir = context.distributedFilesDir - let srcPath = distributedFilesDir + "/" + fileName + let desPath = globalThis.noteContext.filesDir + "/" + fileName + LogUtil.info(TAG, "desPath : " + desPath) + try { + fileio.accessSync(desPath) + LogUtil.info(TAG, "desPath has existed, return") + return + } catch (err) { + LogUtil.warn(TAG, "desPath has not existed, need to write") + } + + let srcPath = globalThis.noteContext.distributedFilesDir + "/" + fileName + LogUtil.info(TAG, "srcPath : " + srcPath) + let size = fileio.statSync(srcPath).size + LogUtil.info(TAG, "srcPath size : " + size) + if (size > FileMaxSize) { + LogUtil.warn(TAG, "srcPath size more then FileMaxSize, return") + return + } let srcFd try { - srcFd = fileio.openSync(srcPath, 0o2, 0o666) + srcFd = fileio.openSync(srcPath, 0o0) LogUtil.info(TAG, "open srcPath success : " + srcFd) } catch (err) { LogUtil.warn(TAG, "open srcPath failed : " + err) + return } - let filesDir = context.filesDir - let desPath = filesDir + "/" + fileName - + let desFd try { - fileio.copyFileSync(srcFd, desPath) - LogUtil.info(TAG, "writeToFileDir, copyFile successfully") + desFd = fileio.openSync(desPath, 0o2 | 0o100, 0o400 | 0o200 | 0o040 | 0o020) + LogUtil.info(TAG, "open desPath success : " + srcFd) } catch (err) { - LogUtil.warn(TAG, "writeToFileDir, copyFile failed : " + err) + LogUtil.warn(TAG, "open desPath failed : " + err) + return + } + + let buf = new ArrayBuffer(size) + try { + let readNum = fileio.readSync(srcFd, buf) + LogUtil.info(TAG, "readNum : " + readNum) + let writeNum = fileio.writeSync(desFd, buf) + LogUtil.info(TAG, "writeNum : " + writeNum) + } catch (err) { + LogUtil.warn(TAG, "read or write error : " + err) } }, @@ -375,6 +414,9 @@ export default { * @param callback */ update(valueBucket, predicates, callback) { + if (!rdbStore) { + return; + } rdbStore.update(valueBucket, predicates).then((affectedRowCount) => { LogUtil.info(TAG, "update success, affectedRowCount is " + affectedRowCount) if (callback != null) { @@ -410,21 +452,18 @@ export default { return new ohosDataRdb.RdbPredicates(tableName) }, - updataNoteImage(content):string { - let srcArray = this.getSrcFromHtml(decodeURI(content)) - LogUtil.info(TAG, "getSrcFromHtml, srcArray : " + srcArray) - if(srcArray.length == 0) { - return "" + updataNoteImage(noteData: NoteData): string { + let content_img = "" + let imgNameArray = this.getImgNameFromHtml(noteData) + if (imgNameArray.length == 0) { + return content_img } - if(srcArray[0] == './shuxue.png' || srcArray[0] == './lvyou.png' || srcArray[0] == './cake.png') { - let lastIndex = srcArray[0].lastIndexOf('/') - LogUtil.info(TAG, "lastIndex : " + lastIndex) - let imgName = "" - if (lastIndex != -1) { - imgName = srcArray[0].substring(lastIndex + 1) - } - return "/res/" + imgName + if (imgNameArray[0] == 'shuxue.png' || imgNameArray[0] == 'cake.png') { + content_img = "/res/" + imgNameArray[0] + } else { + content_img = noteData.content_img } - return srcArray[0] + LogUtil.info(TAG, "updataNoteImage, content_img : " + content_img) + return content_img } } \ No newline at end of file diff --git a/common/utils/src/main/ets/default/model/NoteBaseData.ets b/common/utils/src/main/ets/default/model/NoteBaseData.ets index c887364..b5a09b7 100644 --- a/common/utils/src/main/ets/default/model/NoteBaseData.ets +++ b/common/utils/src/main/ets/default/model/NoteBaseData.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import NoteData from '../model/databaseModel/NoteData.ets' +import NoteData from '../model/databaseModel/NoteData' export const circleColorArray: string[] = [ "#e84026", // 深红 diff --git a/common/utils/src/main/ets/default/model/databaseModel/FolderData.ets b/common/utils/src/main/ets/default/model/databaseModel/FolderData.ets index 1801997..fdf5ad4 100644 --- a/common/utils/src/main/ets/default/model/databaseModel/FolderData.ets +++ b/common/utils/src/main/ets/default/model/databaseModel/FolderData.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import {FolderType, Delete} from './EnumData.ets' +import {FolderType, Delete} from './EnumData' /** * 文件夹类 diff --git a/common/utils/src/main/ets/default/model/databaseModel/NoteData.ets b/common/utils/src/main/ets/default/model/databaseModel/NoteData.ets index d65c6c5..a02df35 100644 --- a/common/utils/src/main/ets/default/model/databaseModel/NoteData.ets +++ b/common/utils/src/main/ets/default/model/databaseModel/NoteData.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import {NoteType, Favorite, Delete, Top} from './EnumData.ets' +import {NoteType, Favorite, Delete, Top} from './EnumData' /** * 笔记类 diff --git a/common/utils/src/main/ets/default/model/databaseModel/SysDefData.ets b/common/utils/src/main/ets/default/model/databaseModel/SysDefData.ets index 92e6d1b..78fd18e 100644 --- a/common/utils/src/main/ets/default/model/databaseModel/SysDefData.ets +++ b/common/utils/src/main/ets/default/model/databaseModel/SysDefData.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import {SysDefFolder, SysDefFolderUuid, FolderType, NoteType, Favorite, Top, Delete} from './EnumData.ets' +import {SysDefFolder, SysDefFolderUuid, FolderType, NoteType, Favorite, Top, Delete} from './EnumData' export default { /** @@ -114,8 +114,8 @@ export default { "title": "数学公式", "uuid": "note1_uuid", "folder_uuid": SysDefFolderUuid.UnClassified, - "content_text": '

好好学习,天天向上



', - "content_img": "/res/shuxue.png", + "content_text": '好好学习,天天向上', + "content_img": "", "note_type": NoteType.SysDef, "is_top": Top.Yes, "is_favorite": Favorite.Yes, @@ -130,7 +130,7 @@ export default { "title": "UX会议纪要", "uuid": "note2_uuid", "folder_uuid": SysDefFolderUuid.Work, - "content_text": "UX会议纪要", + "content_text": "", "content_img": "", "note_type": NoteType.SysDef, "is_top": Top.Yes, @@ -146,8 +146,8 @@ export default { "title": "旅游心得", "uuid": "note3_uuid", "folder_uuid": SysDefFolderUuid.Work, - "content_text": '

旅游心得



', - "content_img": "/res/lvyou.png", + "content_text": '
要想整个旅程无遗憾,关键是心态,首先要对即将到的目的地有一个正确的认识和恰当的期望。
', + "content_img": "", "note_type": NoteType.SysDef, "is_top": Top.No, "is_favorite": Favorite.No, @@ -162,8 +162,15 @@ export default { "title": "蛋糕做法", "uuid": "note4_uuid", "folder_uuid": SysDefFolderUuid.Life, - "content_text": '

蛋糕做法



', - "content_img": "/res/cake.png", + "content_text": '
' + + '' + + '  糖60g
' + + '' + + '  玉米油40g
' + + '
    1. 添加鸡蛋、盐、糖、蛋糕粉
' + + '    2. 加入玉米油、牛奶,烤箱预热15分钟
' + + '    3. 加入葡萄干、核桃仁,烤箱定时40分钟

', + "content_img": "", "note_type": NoteType.CusDef, "is_top": Top.No, "is_favorite": Favorite.Yes, diff --git a/common/utils/src/main/ets/default/model/searchModel/SearchModel.ets b/common/utils/src/main/ets/default/model/searchModel/SearchModel.ets index d855f85..2609432 100644 --- a/common/utils/src/main/ets/default/model/searchModel/SearchModel.ets +++ b/common/utils/src/main/ets/default/model/searchModel/SearchModel.ets @@ -13,13 +13,13 @@ * limitations under the License. */ -import {LogUtil} from '../../baseUtil/LogUtil.ets' -import NoteData from '../../model/databaseModel/NoteData.ets' +import {LogUtil} from '../../baseUtil/LogUtil' +import NoteData from '../../model/databaseModel/NoteData' import ohosDataRdb from '@ohos.data.rdb'; -import {TableName, NoteTableColumn} from '../../model/databaseModel/EnumData.ets' -import NoteUtil from '../../baseUtil/NoteUtil.ets' -import RdbStoreUtil from '../../baseUtil/RdbStoreUtil.ets' -import SysDefData from '../../model/databaseModel/SysDefData.ets' +import {TableName, NoteTableColumn} from '../../model/databaseModel/EnumData' +import NoteUtil from '../../baseUtil/NoteUtil' +import RdbStoreUtil from '../../baseUtil/RdbStoreUtil' +import SysDefData from '../../model/databaseModel/SysDefData' const TAG = "SearchModel" @@ -42,7 +42,7 @@ export class SearchModel { } let searchData: NoteData[] = []; noteDataArray.forEach((noteData) => { - if (decodeURI(noteData.content_text).replace(/<[^>]+>/g,"").toLowerCase().indexOf(query.toLowerCase()) != -1 + if (noteData.content_text.replace(/<[^>]+>/g,"").toLowerCase().indexOf(query.toLowerCase()) != -1 || noteData.title.toLowerCase().indexOf(query.toLowerCase()) != -1) { LogUtil.info(TAG, "uuid " + noteData.uuid) searchData.push(noteData); diff --git a/common/utils/src/main/module.json5 b/common/utils/src/main/module.json5 new file mode 100644 index 0000000..93ca104 --- /dev/null +++ b/common/utils/src/main/module.json5 @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "module": { + "name": "utils", + "type": "har", + "deviceTypes": [ + "phone", + "tablet" + ], + "uiSyntax": "ets" + } +} diff --git a/common/utils/src/main/resources/base/element/string.json b/common/utils/src/main/resources/base/element/string.json deleted file mode 100644 index bc31173..0000000 --- a/common/utils/src/main/resources/base/element/string.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "string": [ - ] -} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties deleted file mode 100644 index be49249..0000000 --- a/gradle.properties +++ /dev/null @@ -1,13 +0,0 @@ -# Project-wide Gradle settings. -# IDE (e.g. DevEco Studio) users: -# Gradle settings configured through the IDE *will override* -# any settings specified in this file. -# For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -# If the Chinese output is garbled, please configure the following parameter. -# This function is enabled by default when the DevEco Studio builds the hap/app,if you need disable gradle parallel,you should set org.gradle.parallel false. -# more information see https://docs.gradle.org/current/userguide/performance.html -# org.gradle.parallel=false -# org.gradle.jvmargs=-Dfile.encoding=GBK \ No newline at end of file diff --git a/gradlew b/gradlew deleted file mode 100644 index 2fe81a7..0000000 --- a/gradlew +++ /dev/null @@ -1,183 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=`expr $i + 1` - done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat deleted file mode 100644 index 62bd9b9..0000000 --- a/gradlew.bat +++ /dev/null @@ -1,103 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/hvigorfile.js b/hvigorfile.js new file mode 100644 index 0000000..5f2735e --- /dev/null +++ b/hvigorfile.js @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +module.exports = require('@ohos/hvigor-ohos-plugin').appTasks \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..9e5cc8a --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1652 @@ +{ + "name": "ohos_note", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@ohos/hvigor": { + "version": "1.0.6", + "resolved": "https://repo.harmonyos.com/npm/@ohos/hvigor/-/@ohos/hvigor-1.0.6.tgz", + "integrity": "sha512-jjp7vpvUOMW1Nf7TdyhOtonwWHoSyBJLUiZTQqIx/GJV4UJyIqsiURUOqFwncQ4L7PDdeHuWly4uEelknYeWhg==", + "requires": { + "@ohos/hvigor-base": "1.0.6", + "interpret": "1.4.0", + "liftoff": "4.0.0", + "mute-stdout": "1.0.0", + "pretty-hrtime": "1.0.0", + "v8flags": "3.2.0", + "yargs": "7.1.0" + } + }, + "@ohos/hvigor-base": { + "version": "1.0.6", + "resolved": "https://repo.harmonyos.com/npm/@ohos/hvigor-base/-/@ohos/hvigor-base-1.0.6.tgz", + "integrity": "sha512-cRDnWICTxmpNiFb9clIioqP5Oik1seLCICztXVhZqultrHuxwTheCRUZrHwlpyWdkSB2Al+FFBqmSwzIgZX4IQ==", + "requires": { + "json5": "2.2.0", + "log4js": "6.4.1", + "undertaker": "1.2.1" + } + }, + "@ohos/hvigor-ohos-plugin": { + "version": "1.0.6", + "resolved": "https://repo.harmonyos.com/npm/@ohos/hvigor-ohos-plugin/-/@ohos/hvigor-ohos-plugin-1.0.6.tgz", + "integrity": "sha512-MAAi8uJxMzODUoSSNfBr+fU4HQ20dfQtkje9I+X4asc7qY2kAplW/q9f5XS8IOvv8zhC8OcSgsAXOAJuLMstOQ==", + "requires": { + "@ohos/hvigor-base": "1.0.6", + "@ohos/sdkmanager-common": "1.1.3", + "ajv": "8.10.0", + "archiver": "5.3.0", + "execa": "5.1.1", + "fs-extra": "10.0.0", + "glob": "7.2.0", + "iconv-lite": "0.6.3", + "json5": "2.2.0", + "lodash": "4.17.21", + "pretty-hrtime": "1.0.3", + "resolve-package-path": "4.0.3" + }, + "dependencies": { + "fs-extra": { + "version": "10.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/fs-extra/-/fs-extra-10.0.0.tgz", + "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + }, + "pretty-hrtime": { + "version": "1.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", + "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=" + } + } + }, + "@ohos/sdkmanager-common": { + "version": "1.1.3", + "resolved": "https://repo.harmonyos.com/npm/@ohos/sdkmanager-common/-/@ohos/sdkmanager-common-1.1.3.tgz", + "integrity": "sha512-d2uhVauDDJZIUvyyaWWoavG4N/jLyfF5IH5kEXKV6R8HNf3606H1zDQzA+UZtOfwwJFXhD9djRjnVFNB8xc7aw==" + }, + "ajv": { + "version": "8.10.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/ajv/-/ajv-8.10.0.tgz", + "integrity": "sha512-bzqAEZOjkrUMl2afH8dknrq5KEk2SrwdBROR+vH1EKVQTqaUbJVPdc/gEdggTMM0Se+s+Ja4ju4TlNcStKl2Hw==", + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "archiver": { + "version": "5.3.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/archiver/-/archiver-5.3.0.tgz", + "integrity": "sha512-iUw+oDwK0fgNpvveEsdQ0Ase6IIKztBJU2U0E9MzszMfmVVUyv1QJhS2ITW9ZCqx8dktAxVAjWWkKehuZE8OPg==", + "requires": { + "archiver-utils": "^2.1.0", + "async": "^3.2.0", + "buffer-crc32": "^0.2.1", + "readable-stream": "^3.6.0", + "readdir-glob": "^1.0.0", + "tar-stream": "^2.2.0", + "zip-stream": "^4.1.0" + } + }, + "archiver-utils": { + "version": "2.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/archiver-utils/-/archiver-utils-2.1.0.tgz", + "integrity": "sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==", + "requires": { + "glob": "^7.1.4", + "graceful-fs": "^4.2.0", + "lazystream": "^1.0.0", + "lodash.defaults": "^4.2.0", + "lodash.difference": "^4.5.0", + "lodash.flatten": "^4.4.0", + "lodash.isplainobject": "^4.0.6", + "lodash.union": "^4.6.0", + "normalize-path": "^3.0.0", + "readable-stream": "^2.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://repo.huaweicloud.com/repository/npm/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + } + } + }, + "arr-filter": { + "version": "1.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/arr-filter/-/arr-filter-1.1.2.tgz", + "integrity": "sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4=", + "requires": { + "make-iterator": "^1.0.0" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" + }, + "arr-map": { + "version": "2.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/arr-map/-/arr-map-2.0.2.tgz", + "integrity": "sha1-Onc0X/wc814qkYJWAfnljy4kysQ=", + "requires": { + "make-iterator": "^1.0.0" + } + }, + "array-each": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/array-each/-/array-each-1.0.1.tgz", + "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=" + }, + "array-initial": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/array-initial/-/array-initial-1.1.0.tgz", + "integrity": "sha1-L6dLJnOTccOUe9enrcc74zSz15U=", + "requires": { + "array-slice": "^1.0.0", + "is-number": "^4.0.0" + } + }, + "array-last": { + "version": "1.3.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/array-last/-/array-last-1.3.0.tgz", + "integrity": "sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==", + "requires": { + "is-number": "^4.0.0" + } + }, + "array-slice": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/array-slice/-/array-slice-1.1.0.tgz", + "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==" + }, + "async": { + "version": "3.2.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/async/-/async-3.2.3.tgz", + "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==" + }, + "async-done": { + "version": "1.3.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/async-done/-/async-done-1.3.2.tgz", + "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.2", + "process-nextick-args": "^2.0.0", + "stream-exhaust": "^1.0.1" + } + }, + "async-settle": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/async-settle/-/async-settle-1.0.0.tgz", + "integrity": "sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs=", + "requires": { + "async-done": "^1.2.2" + } + }, + "bach": { + "version": "1.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/bach/-/bach-1.2.0.tgz", + "integrity": "sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA=", + "requires": { + "arr-filter": "^1.1.1", + "arr-flatten": "^1.0.1", + "arr-map": "^2.0.0", + "array-each": "^1.0.0", + "array-initial": "^1.0.0", + "array-last": "^1.1.1", + "async-done": "^1.2.2", + "async-settle": "^1.0.0", + "now-and-later": "^2.0.0" + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, + "bl": { + "version": "4.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "requires": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://repo.huaweicloud.com/repository/npm/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "requires": { + "fill-range": "^7.0.1" + } + }, + "buffer": { + "version": "5.7.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "buffer-crc32": { + "version": "0.2.13", + "resolved": "https://repo.huaweicloud.com/repository/npm/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=" + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "camelcase": { + "version": "3.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, + "collection-map": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/collection-map/-/collection-map-1.0.0.tgz", + "integrity": "sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw=", + "requires": { + "arr-map": "^2.0.2", + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + } + }, + "compress-commons": { + "version": "4.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/compress-commons/-/compress-commons-4.1.1.tgz", + "integrity": "sha512-QLdDLCKNV2dtoTorqgxngQCMA+gWXkM/Nwu7FpeBhk/RdkzimqC3jueb/FDmaZeXh+uby1jkBqE3xArsLBE5wQ==", + "requires": { + "buffer-crc32": "^0.2.13", + "crc32-stream": "^4.0.2", + "normalize-path": "^3.0.0", + "readable-stream": "^3.6.0" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "core-util-is": { + "version": "1.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, + "crc-32": { + "version": "1.2.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==" + }, + "crc32-stream": { + "version": "4.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/crc32-stream/-/crc32-stream-4.0.2.tgz", + "integrity": "sha512-DxFZ/Hk473b/muq1VJ///PMNLj0ZMnzye9thBpmjpJKCc5eMgB95aK8zCGrGfQ90cWo561Te6HK9D+j4KPdM6w==", + "requires": { + "crc-32": "^1.2.0", + "readable-stream": "^3.4.0" + } + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "dependencies": { + "which": { + "version": "2.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "d": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "requires": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, + "date-format": { + "version": "4.0.7", + "resolved": "https://repo.huaweicloud.com/repository/npm/date-format/-/date-format-4.0.7.tgz", + "integrity": "sha512-k5xqlzDGIfv2N/DHR/BR8Kc4N9CRy9ReuDkmdxeX/jNfit94QXd36emWMm40ZOEDKNm/c91yV9EO3uGPkR7wWQ==" + }, + "debug": { + "version": "4.3.4", + "resolved": "https://repo.huaweicloud.com/repository/npm/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "default-resolution": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/default-resolution/-/default-resolution-2.0.0.tgz", + "integrity": "sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ=" + }, + "define-properties": { + "version": "1.1.4", + "resolved": "https://repo.huaweicloud.com/repository/npm/define-properties/-/define-properties-1.1.4.tgz", + "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "requires": { + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + } + }, + "detect-file": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=" + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://repo.huaweicloud.com/repository/npm/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "requires": { + "once": "^1.4.0" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es5-ext": { + "version": "0.10.60", + "resolved": "https://repo.huaweicloud.com/repository/npm/es5-ext/-/es5-ext-0.10.60.tgz", + "integrity": "sha512-jpKNXIt60htYG59/9FGf2PYT3pwMpnEbNKysU+k/4FGwyGtMotOvcZOuW+EmXXYASRqYSXQfGL5cVIthOTgbkg==", + "requires": { + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.3", + "next-tick": "^1.1.0" + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "es6-symbol": { + "version": "3.1.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "requires": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, + "es6-weak-map": { + "version": "2.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/es6-weak-map/-/es6-weak-map-2.0.3.tgz", + "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", + "requires": { + "d": "1", + "es5-ext": "^0.10.46", + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.1" + } + }, + "execa": { + "version": "5.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "requires": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + } + }, + "expand-tilde": { + "version": "2.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "ext": { + "version": "1.6.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/ext/-/ext-1.6.0.tgz", + "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==", + "requires": { + "type": "^2.5.0" + }, + "dependencies": { + "type": { + "version": "2.6.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/type/-/type-2.6.0.tgz", + "integrity": "sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ==" + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "findup-sync": { + "version": "5.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/findup-sync/-/findup-sync-5.0.0.tgz", + "integrity": "sha512-MzwXju70AuyflbgeOhzvQWAvvQdo1XL0A9bVvlXsYcFEBM87WR4OakL4OfZq+QRmr+duJubio+UtNQCPsVESzQ==", + "requires": { + "detect-file": "^1.0.0", + "is-glob": "^4.0.3", + "micromatch": "^4.0.4", + "resolve-dir": "^1.0.1" + } + }, + "fined": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/fined/-/fined-2.0.0.tgz", + "integrity": "sha512-OFRzsL6ZMHz5s0JrsEr+TpdGNCtrVtnuG3x1yzGNiQHT0yaDnXAj8V/lWcpJVrnoDpcwXcASxAZYbuXda2Y82A==", + "requires": { + "expand-tilde": "^2.0.2", + "is-plain-object": "^5.0.0", + "object.defaults": "^1.1.0", + "object.pick": "^1.3.0", + "parse-filepath": "^1.0.2" + } + }, + "flagged-respawn": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/flagged-respawn/-/flagged-respawn-2.0.0.tgz", + "integrity": "sha512-Gq/a6YCi8zexmGHMuJwahTGzXlAZAOsbCVKduWXC6TlLCjjFRlExMJc4GC2NYPYZ0r/brw9P7CpRgQmlPVeOoA==" + }, + "flatted": { + "version": "3.2.5", + "resolved": "https://repo.huaweicloud.com/repository/npm/flatted/-/flatted-3.2.5.tgz", + "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==" + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" + }, + "for-own": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "requires": { + "for-in": "^1.0.1" + } + }, + "fs-constants": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" + }, + "fs-extra": { + "version": "10.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" + }, + "get-intrinsic": { + "version": "1.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, + "get-stream": { + "version": "6.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==" + }, + "glob": { + "version": "7.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "global-modules": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "requires": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + } + }, + "global-prefix": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "requires": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + } + }, + "graceful-fs": { + "version": "4.2.10", + "resolved": "https://repo.huaweicloud.com/repository/npm/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" + }, + "has": { + "version": "1.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "requires": { + "get-intrinsic": "^1.1.1" + } + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + }, + "homedir-polyfill": { + "version": "1.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "requires": { + "parse-passwd": "^1.0.0" + } + }, + "hosted-git-info": { + "version": "2.8.9", + "resolved": "https://repo.huaweicloud.com/repository/npm/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" + }, + "human-signals": { + "version": "2.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==" + }, + "hypium": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/hypium/-/hypium-1.0.0.tgz", + "integrity": "sha512-nl+RQVv2AU/5FvFRhsXyWO5wh+2huhdqRZ3bszBWZzW+kpNI3AT4ydvVRYIfaQbYwV4UlX/rSc7BtFjLAezhow==" + }, + "iconv-lite": { + "version": "0.6.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://repo.huaweicloud.com/repository/npm/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://repo.huaweicloud.com/repository/npm/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "ini": { + "version": "1.3.8", + "resolved": "https://repo.huaweicloud.com/repository/npm/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, + "interpret": { + "version": "1.4.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==" + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" + }, + "is-absolute": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "requires": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + }, + "is-core-module": { + "version": "2.9.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-core-module/-/is-core-module-2.9.0.tgz", + "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "requires": { + "has": "^1.0.3" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "4.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==" + }, + "is-plain-object": { + "version": "5.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==" + }, + "is-relative": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "requires": { + "is-unc-path": "^1.0.0" + } + }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" + }, + "is-unc-path": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "requires": { + "unc-path-regex": "^0.1.2" + } + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "json5": { + "version": "2.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "requires": { + "minimist": "^1.2.5" + } + }, + "jsonfile": { + "version": "6.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "requires": { + "graceful-fs": "^4.1.6", + "universalify": "^2.0.0" + } + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" + }, + "last-run": { + "version": "1.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/last-run/-/last-run-1.1.1.tgz", + "integrity": "sha1-RblpQsF7HHnHchmCWbqUO+v4yls=", + "requires": { + "default-resolution": "^2.0.0", + "es6-weak-map": "^2.0.1" + } + }, + "lazystream": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/lazystream/-/lazystream-1.0.1.tgz", + "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", + "requires": { + "readable-stream": "^2.0.5" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://repo.huaweicloud.com/repository/npm/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + } + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "requires": { + "invert-kv": "^1.0.0" + } + }, + "liftoff": { + "version": "4.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/liftoff/-/liftoff-4.0.0.tgz", + "integrity": "sha512-rMGwYF8q7g2XhG2ulBmmJgWv25qBsqRbDn5gH0+wnuyeFt7QBJlHJmtg5qEdn4pN6WVAUMgXnIxytMFRX9c1aA==", + "requires": { + "extend": "^3.0.2", + "findup-sync": "^5.0.0", + "fined": "^2.0.0", + "flagged-respawn": "^2.0.0", + "is-plain-object": "^5.0.0", + "object.map": "^1.0.1", + "rechoir": "^0.8.0", + "resolve": "^1.20.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://repo.huaweicloud.com/repository/npm/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "lodash.defaults": { + "version": "4.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/lodash.defaults/-/lodash.defaults-4.2.0.tgz", + "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=" + }, + "lodash.difference": { + "version": "4.5.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/lodash.difference/-/lodash.difference-4.5.0.tgz", + "integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=" + }, + "lodash.flatten": { + "version": "4.4.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/lodash.flatten/-/lodash.flatten-4.4.0.tgz", + "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=" + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://repo.huaweicloud.com/repository/npm/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" + }, + "lodash.union": { + "version": "4.6.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/lodash.union/-/lodash.union-4.6.0.tgz", + "integrity": "sha1-SLtQiECfFvGCFmZkHETdGqrjzYg=" + }, + "log4js": { + "version": "6.4.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/log4js/-/log4js-6.4.1.tgz", + "integrity": "sha512-iUiYnXqAmNKiIZ1XSAitQ4TmNs8CdZYTAWINARF3LjnsLN8tY5m0vRwd6uuWj/yNY0YHxeZodnbmxKFUOM2rMg==", + "requires": { + "date-format": "^4.0.3", + "debug": "^4.3.3", + "flatted": "^3.2.4", + "rfdc": "^1.3.0", + "streamroller": "^3.0.2" + } + }, + "make-iterator": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/make-iterator/-/make-iterator-1.0.1.tgz", + "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", + "requires": { + "kind-of": "^6.0.2" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" + }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://repo.huaweicloud.com/repository/npm/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.6", + "resolved": "https://repo.huaweicloud.com/repository/npm/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + }, + "ms": { + "version": "2.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "mute-stdout": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/mute-stdout/-/mute-stdout-1.0.0.tgz", + "integrity": "sha1-WzLqB+tDyd7WEwQ0z5JvRrKn/U0=" + }, + "next-tick": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + }, + "now-and-later": { + "version": "2.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/now-and-later/-/now-and-later-2.0.1.tgz", + "integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==", + "requires": { + "once": "^1.3.2" + } + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "requires": { + "path-key": "^3.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + }, + "object.defaults": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/object.defaults/-/object.defaults-1.1.0.tgz", + "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", + "requires": { + "array-each": "^1.0.1", + "array-slice": "^1.0.0", + "for-own": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "object.map": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/object.map/-/object.map-1.0.1.tgz", + "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", + "requires": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "requires": { + "isobject": "^3.0.1" + } + }, + "object.reduce": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/object.reduce/-/object.reduce-1.0.1.tgz", + "integrity": "sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60=", + "requires": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "requires": { + "lcid": "^1.0.0" + } + }, + "parse-filepath": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/parse-filepath/-/parse-filepath-1.0.2.tgz", + "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", + "requires": { + "is-absolute": "^1.0.0", + "map-cache": "^0.2.0", + "path-root": "^0.1.1" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "requires": { + "error-ex": "^1.2.0" + } + }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=" + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://repo.huaweicloud.com/repository/npm/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "path-root": { + "version": "0.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/path-root/-/path-root-0.1.1.tgz", + "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", + "requires": { + "path-root-regex": "^0.1.0" + } + }, + "path-root-regex": { + "version": "0.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/path-root-regex/-/path-root-regex-0.1.2.tgz", + "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=" + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + }, + "pify": { + "version": "2.3.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://repo.huaweicloud.com/repository/npm/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "requires": { + "pinkie": "^2.0.0" + } + }, + "pretty-hrtime": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/pretty-hrtime/-/pretty-hrtime-1.0.0.tgz", + "integrity": "sha1-9ualItPmBwRSK/Db5oVu0g515Nw=" + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "readdir-glob": { + "version": "1.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/readdir-glob/-/readdir-glob-1.1.1.tgz", + "integrity": "sha512-91/k1EzZwDx6HbERR+zucygRFfiPl2zkIYZtv3Jjr6Mn7SkKcVct8aVO+sSRiGMc6fLf72du3d92/uY63YPdEA==", + "requires": { + "minimatch": "^3.0.4" + } + }, + "rechoir": { + "version": "0.8.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/rechoir/-/rechoir-0.8.0.tgz", + "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==", + "requires": { + "resolve": "^1.20.0" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" + }, + "resolve": { + "version": "1.22.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/resolve/-/resolve-1.22.0.tgz", + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", + "requires": { + "is-core-module": "^2.8.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "resolve-dir": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "requires": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + } + }, + "resolve-package-path": { + "version": "4.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/resolve-package-path/-/resolve-package-path-4.0.3.tgz", + "integrity": "sha512-SRpNAPW4kewOaNUt8VPqhJ0UMxawMwzJD8V7m1cJfdSTK9ieZwS6K7Dabsm4bmLFM96Z5Y/UznrpG5kt1im8yA==", + "requires": { + "path-root": "^0.1.1" + } + }, + "rfdc": { + "version": "1.3.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/rfdc/-/rfdc-1.3.0.tgz", + "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==" + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "semver": { + "version": "5.7.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + }, + "signal-exit": { + "version": "3.0.7", + "resolved": "https://repo.huaweicloud.com/repository/npm/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.11", + "resolved": "https://repo.huaweicloud.com/repository/npm/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", + "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==" + }, + "stream-exhaust": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/stream-exhaust/-/stream-exhaust-1.0.2.tgz", + "integrity": "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==" + }, + "streamroller": { + "version": "3.0.7", + "resolved": "https://repo.huaweicloud.com/repository/npm/streamroller/-/streamroller-3.0.7.tgz", + "integrity": "sha512-kh68kwiDGuIPiPDWwRbEC5us+kfARP1e9AsQiaLaSqGrctOvMn0mtL8iNY3r4/o5nIoYi3gPI1jexguZsXDlxw==", + "requires": { + "date-format": "^4.0.7", + "debug": "^4.3.4", + "fs-extra": "^10.0.1" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "requires": { + "is-utf8": "^0.2.0" + } + }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" + }, + "tar-stream": { + "version": "2.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "requires": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + }, + "dependencies": { + "is-number": { + "version": "7.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + } + } + }, + "type": { + "version": "1.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" + }, + "unc-path-regex": { + "version": "0.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=" + }, + "undertaker": { + "version": "1.2.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/undertaker/-/undertaker-1.2.1.tgz", + "integrity": "sha512-71WxIzDkgYk9ZS+spIB8iZXchFhAdEo2YU8xYqBYJ39DIUIqziK78ftm26eecoIY49X0J2MLhG4hr18Yp6/CMA==", + "requires": { + "arr-flatten": "^1.0.1", + "arr-map": "^2.0.0", + "bach": "^1.0.0", + "collection-map": "^1.0.0", + "es6-weak-map": "^2.0.1", + "last-run": "^1.1.0", + "object.defaults": "^1.0.0", + "object.reduce": "^1.0.0", + "undertaker-registry": "^1.0.0" + } + }, + "undertaker-registry": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/undertaker-registry/-/undertaker-registry-1.0.1.tgz", + "integrity": "sha1-XkvaMI5KiirlhPm5pDWaSZglzFA=" + }, + "universalify": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "requires": { + "punycode": "^2.1.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "v8flags": { + "version": "3.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/v8flags/-/v8flags-3.2.0.tgz", + "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==", + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://repo.huaweicloud.com/repository/npm/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "y18n": { + "version": "3.2.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/y18n/-/y18n-3.2.2.tgz", + "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==" + }, + "yargs": { + "version": "7.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/yargs/-/yargs-7.1.0.tgz", + "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", + "requires": { + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^5.0.0" + } + }, + "yargs-parser": { + "version": "5.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/yargs-parser/-/yargs-parser-5.0.1.tgz", + "integrity": "sha512-wpav5XYiddjXxirPoCTUPbqM0PXvJ9hiBMvuJgInvo4/lAOTZzUprArw17q2O1P2+GHhbBr18/iQwjL5Z9BqfA==", + "requires": { + "camelcase": "^3.0.0", + "object.assign": "^4.1.0" + } + }, + "zip-stream": { + "version": "4.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/zip-stream/-/zip-stream-4.1.0.tgz", + "integrity": "sha512-zshzwQW7gG7hjpBlgeQP9RuyPGNxvJdzR8SUM3QhxCnLjWN2E7j3dOvpeDcQoETfHx0urRS7EtmVToql7YpU4A==", + "requires": { + "archiver-utils": "^2.1.0", + "compress-commons": "^4.1.0", + "readable-stream": "^3.6.0" + } + } + } +} diff --git a/package.json b/package.json index 0967ef4..af7a3cd 100644 --- a/package.json +++ b/package.json @@ -1 +1,18 @@ -{} +{ + "license":"ISC", + "devDependencies":{}, + "name":"ohos_note", + "ohos":{ + "org":"huawei", + "directoryLevel":"project", + "buildTool":"hvigor" + }, + "description":"example description", + "repository":{}, + "version":"1.0.0", + "dependencies":{ + "@ohos/hvigor-ohos-plugin":"1.0.6", + "hypium":"^1.0.0", + "@ohos/hvigor":"1.0.6" + } +} \ No newline at end of file diff --git a/product/pc/build.gradle b/product/pc/build.gradle deleted file mode 100644 index 3f68c19..0000000 --- a/product/pc/build.gradle +++ /dev/null @@ -1,20 +0,0 @@ -apply plugin: 'com.huawei.ohos.hap' -//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 -ohos { - compileSdkVersion 8 - defaultConfig { - compatibleSdkVersion 8 - } - - buildTypes { - release { - proguardOpt { - proguardEnabled false - rulesFiles 'proguard-rules.pro' - } - } - } -} - -dependencies { -} diff --git a/product/pc/src/main/config.json b/product/pc/src/main/config.json deleted file mode 100644 index 31502bc..0000000 --- a/product/pc/src/main/config.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.note", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.note", - "name": ".MyApplication", - "mainAbility": "com.ohos.note.MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "pc", - "moduleType": "entry", - "installationFree": true - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": "com.ohos.note.MainAbility", - "icon": "$media:note", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard", - "srcPath": "MainAbility", - "srcLanguage": "ets", - "metaData": { - "customizeData": [ - { - "name": "hwc-theme" - } - ] - } - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": "MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/product/pc/src/main/resources/base/media/note.png b/product/pc/src/main/resources/base/media/note.png deleted file mode 100644 index 9bbc1bb..0000000 Binary files a/product/pc/src/main/resources/base/media/note.png and /dev/null differ diff --git a/product/phone/.gitignore b/product/phone/.gitignore new file mode 100644 index 0000000..4f9a973 --- /dev/null +++ b/product/phone/.gitignore @@ -0,0 +1,3 @@ +/node_modules +/.preview +/build \ No newline at end of file diff --git a/product/pc/src/main/ets/MainAbility/app.ets b/product/phone/build-profile.json5 similarity index 69% rename from product/pc/src/main/ets/MainAbility/app.ets rename to product/phone/build-profile.json5 index 5f980b7..a011ff8 100644 --- a/product/pc/src/main/ets/MainAbility/app.ets +++ b/product/phone/build-profile.json5 @@ -13,15 +13,13 @@ * limitations under the License. */ -import {LogUtil} from '../../../../../../common/utils/src/main/ets/default/baseUtil/LogUtil.ets' - -const TAG = "app" - -export default { - onCreate() { - LogUtil.info(TAG, 'Application onCreate') +{ + "apiType": 'stageMode', + "buildOption": { }, - onDestroy() { - LogUtil.info(TAG, 'Application onDestroy') - }, -} + "targets": [ + { + "name": "default", + } + ] +} \ No newline at end of file diff --git a/product/phone/build.gradle b/product/phone/build.gradle deleted file mode 100644 index 3f68c19..0000000 --- a/product/phone/build.gradle +++ /dev/null @@ -1,20 +0,0 @@ -apply plugin: 'com.huawei.ohos.hap' -//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 -ohos { - compileSdkVersion 8 - defaultConfig { - compatibleSdkVersion 8 - } - - buildTypes { - release { - proguardOpt { - proguardEnabled false - rulesFiles 'proguard-rules.pro' - } - } - } -} - -dependencies { -} diff --git a/product/phone/hvigorfile.js b/product/phone/hvigorfile.js new file mode 100644 index 0000000..d7720ee --- /dev/null +++ b/product/phone/hvigorfile.js @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks diff --git a/product/phone/package-lock.json b/product/phone/package-lock.json new file mode 100644 index 0000000..e0a40e9 --- /dev/null +++ b/product/phone/package-lock.json @@ -0,0 +1,45 @@ +{ + "name": "phone", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@ohos/component": { + "version": "file:../../common/component", + "requires": { + "@ohos/source": "file:../../common/resources", + "@ohos/utils": "file:../../common/utils" + }, + "dependencies": { + "@ohos/source": { + "version": "file:../../common/resources" + }, + "@ohos/utils": { + "version": "file:../../common/utils", + "requires": { + "@ohos/source": "file:../../common/resources" + }, + "dependencies": { + "@ohos/source": { + "version": "file:../../common/resources" + } + } + } + } + }, + "@ohos/source": { + "version": "file:../../common/resources" + }, + "@ohos/utils": { + "version": "file:../../common/utils", + "requires": { + "@ohos/source": "file:../../common/resources" + }, + "dependencies": { + "@ohos/source": { + "version": "file:../../common/resources" + } + } + } + } +} diff --git a/product/phone/package.json b/product/phone/package.json new file mode 100644 index 0000000..e161814 --- /dev/null +++ b/product/phone/package.json @@ -0,0 +1,18 @@ +{ + "license":"ISC", + "devDependencies":{}, + "name":"phone", + "ohos":{ + "org":"huawei", + "directoryLevel":"module", + "buildTool":"hvigor" + }, + "description":"example description", + "repository":{}, + "version":"1.0.0", + "dependencies":{ + "@ohos/utils":"file:../../common/utils", + "@ohos/component":"file:../../common/component", + "@ohos/source":"file:../../common/resources" + } +} \ No newline at end of file diff --git a/product/phone/proguard-rules.pro b/product/phone/proguard-rules.pro deleted file mode 100644 index f7666e4..0000000 --- a/product/phone/proguard-rules.pro +++ /dev/null @@ -1 +0,0 @@ -# config module specific ProGuard rules here. \ No newline at end of file diff --git a/product/phone/src/main/ets/AbilityStage.ts b/product/phone/src/main/ets/Application/AbilityStage.ts similarity index 72% rename from product/phone/src/main/ets/AbilityStage.ts rename to product/phone/src/main/ets/Application/AbilityStage.ts index 9eb7993..32dfe93 100644 --- a/product/phone/src/main/ets/AbilityStage.ts +++ b/product/phone/src/main/ets/Application/AbilityStage.ts @@ -2,6 +2,6 @@ import AbilityStage from "@ohos.application.AbilityStage" export default class MyAbilityStage extends AbilityStage { onCreate() { - console.log("MyAbilityStage onCreate") + console.log("[Demo] MyAbilityStage onCreate") } } \ No newline at end of file diff --git a/product/phone/src/main/ets/MainAbility/MainAbility.ts b/product/phone/src/main/ets/MainAbility/MainAbility.ts index 7052fc1..a950d37 100644 --- a/product/phone/src/main/ets/MainAbility/MainAbility.ts +++ b/product/phone/src/main/ets/MainAbility/MainAbility.ts @@ -14,44 +14,33 @@ */ import Ability from '@ohos.application.Ability' -import {WebViewUtil} from './WebViewUtil.ets' +import AbilityConstant from '@ohos.application.AbilityConstant' import fileio from '@ohos.fileio' +import inputMethod from '@ohos.inputmethod' export default class MainAbility extends Ability { - private Tag = "Phone_Note_MainAbility" + private Tag = "MainAbility_Phone" onCreate(want, launchParam) { console.info(this.Tag + " onCreate, launchReason is " + launchParam.launchReason) - // 折叠状态 AppStorage.SetOrCreate('Expand', false) - AppStorage.SetOrCreate('Choose', false) + AppStorage.SetOrCreate('Choose', true) if (launchParam.launchReason == 3) { - // 获取对端的迁移数据 - let continueNote: string = want.parameters["ContinueNote"] - let continueSection: number = want.parameters["ContinueSection"] - console.info(this.Tag + " continueSection : " + continueSection) - AppStorage.SetOrCreate('ContinueNote', continueNote) - AppStorage.SetOrCreate('ContinueSection', continueSection) - // 折叠状态 - let continueExpand: boolean = want.parameters["ContinueExpand"] - let continueChoose: boolean = want.parameters["ContinueChoose"] - console.info(this.Tag + " continueExpand : " + continueExpand + " , continueChoose : " + continueChoose) - AppStorage.SetOrCreate('Expand', continueExpand) - AppStorage.SetOrCreate('Choose', continueChoose) // 设置迁移标记 AppStorage.SetOrCreate('IsContinue', true) - - // 来自平板的迁移 - if (continueExpand == undefined && continueChoose == undefined) { - console.info(this.Tag + " from tablet") - AppStorage.SetOrCreate('Choose', true) - AppStorage.SetOrCreate('ContinueChoose', true) + // 获取对端的迁移数据 + let continueNote: string = want.parameters["ContinueNote"] + AppStorage.SetOrCreate('ContinueNote', continueNote) + // 来自手机的迁移 + let continueChoose: boolean = want.parameters["ContinueChoose"] + if (continueChoose) { + console.info(this.Tag + " continue from phone") + }else{ + AppStorage.SetOrCreate('ContinueFromTablet', true) + console.info(this.Tag + " continue from tablet") } - this.context.restoreWindowStage(null) } - AppStorage.SetOrCreate('openPhoto', 0) - AppStorage.SetOrCreate('openPerm', 0) globalThis.noteContext = this.context } @@ -74,14 +63,68 @@ export default class MainAbility extends Ability { onBackground() { console.info(this.Tag + " onBackground") - let controllerShow = WebViewUtil.getWebController() - if (controllerShow == undefined || controllerShow == null) { - console.info("MainAbility onBackground, controllerShow is error") + // 退出键盘 + inputMethod.getInputMethodController().stopInput(); + } + + onContinue(wantParam: { [key: string]: any }) { + console.info(this.Tag + " onContinue") + // 获取本端的迁移数据 + let continueNote = AppStorage.Get('ContinueNote') + if (continueNote == undefined || continueNote == null) { + console.info(this.Tag + " onContinue, continueNote is error, default [0]") + continueNote = JSON.stringify(AppStorage.Get('AllNoteArray')[0].toNoteObject()) } - console.info(this.Tag + " controllerShow : " + controllerShow) - controllerShow.runJavaScript({ - script: "get_html_content()" + + // 保存本端的迁移数据 + wantParam["ContinueNote"] = continueNote + wantParam["ContinueChoose"] = true + + // save img to DisFileDir + console.info(this.Tag + " onContinue, save img to DisFileDir") + let continueNoteObj = JSON.parse(continueNote) + let srcArray = this.getSrcFromHtml(continueNoteObj.content_text) + srcArray.forEach((src: string) => { + let lastIndex = src.lastIndexOf('/') + if (lastIndex != -1) { + let imgName = src.substring(lastIndex + 1) + this.writeToDisFileDir(imgName) + } }) - console.info(this.Tag + " controllerShow end") + console.info(this.Tag + " onContinue end") + return AbilityConstant.OnContinueResult.AGREE; + } + + getSrcFromHtml(html: string): any{ + let srcArray = [] + if (html == undefined || html == null || html == "") { + return srcArray + } + let imgReg = /]+>/g + let srcReg = /src=[\'\"]?([^\'\"]*)[\'\"]?/i + let imgArray = html.match(imgReg) + if (imgArray != null) { + for (let i = 0; i < imgArray.length; i++) { + let src = imgArray[i].match(srcReg) + if (src != null && src.length > 1) { + srcArray.push(src[1]) + } + } + } + return srcArray + } + + writeToDisFileDir(fileName: string) { + console.info(this.Tag + " writeToDisFileDir, fileName : " + fileName) + let filesDir = this.context.filesDir + let srcPath = filesDir + "/" + fileName + let distributedFilesDir = this.context.distributedFilesDir + let desPath = distributedFilesDir + "/" + fileName + try { + fileio.copyFileSync(srcPath, desPath) + console.info(this.Tag + " onContinue, writeToDisFileDir, copyFile successfully") + } catch (err) { + console.warn(this.Tag + " onContinue, writeToDisFileDir, copyFile failed : " + err) + } } } \ No newline at end of file diff --git a/product/phone/src/main/ets/MainAbility/res/lvyou.png b/product/phone/src/main/ets/MainAbility/res/lvyou.png deleted file mode 100644 index 5a4c05f..0000000 Binary files a/product/phone/src/main/ets/MainAbility/res/lvyou.png and /dev/null differ diff --git a/product/phone/src/main/ets/pages/MyNoteHome.ets b/product/phone/src/main/ets/pages/MyNoteHome.ets new file mode 100644 index 0000000..65aca00 --- /dev/null +++ b/product/phone/src/main/ets/pages/MyNoteHome.ets @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import fileio from '@ohos.fileio' +import bundle from '@ohos.bundle' +import abilityAccessCtrl from '@ohos.abilityAccessCtrl' +import {NoteHomePortraitComp} from './NoteHomePortrait' +import {LogUtil} from '@ohos/utils/src/main/ets/default/baseUtil/LogUtil' +import RdbStoreUtil from '@ohos/utils/src/main/ets/default/baseUtil/RdbStoreUtil' +import inputMethod from '@ohos.inputmethod' +import router from '@system.router' + +@Entry +@Component +export struct MyNoteHomeComp { + @StorageLink('DBQueryFinished') dBQueryFinished: number = 0 + @Provide('PortraitModel') portraitModel: boolean = true + @Provide('RefreshFlag') refreshFlag: number = 0 + private context = getContext(this) + TAG = "MyNoteHomeComp_Phone" + + build() { + Flex() { + if (this.dBQueryFinished == 1) { + NoteHomePortraitComp() + } + } + .width('100%').height('100%') + } + + aboutToAppear(): void{ + LogUtil.info(this.TAG, "aboutToAppear") + + if (this.context == undefined || this.context == null) { + LogUtil.warn(this.TAG, "context is error") + return + } + + let permissionList: Array = [ + "ohos.permission.READ_MEDIA", + "ohos.permission.WRITE_MEDIA", + "ohos.permission.MEDIA_LOCATION", + "ohos.permission.DISTRIBUTED_DATASYNC" + ] + LogUtil.info(this.TAG, 'permissions need to require from user') + this.context.requestPermissionsFromUser(permissionList).then((data) => { + LogUtil.info(this.TAG, 'data permissions : ' + data.permissions) + LogUtil.info(this.TAG, 'data result: ' + data.authResults) + let sum = 0 + for (let i = 0; i < data.authResults.length; i++) { + sum += data.authResults[i] + } + LogUtil.info(this.TAG, 'request permissions sum: ' + sum) + }, (err) => { + LogUtil.warn(this.TAG, 'failed to requestPermissionsFromUser : ' + err.code); + }) + + let dbPath = this.context.databaseDir + "/db/note.db" + try { + fileio.accessSync(dbPath) + LogUtil.info(this.TAG, "db has created") + RdbStoreUtil.initAppStorage(this.context) + } catch (err) { + LogUtil.info(this.TAG, "db has not created, start to create db") + RdbStoreUtil.createRdbStore(this.context) + } + } + + aboutToDisappear(): void{ + LogUtil.info(this.TAG, "aboutToDisappear") + } + + onPageShow(): void{ + LogUtil.info(this.TAG, "onPageShow") + this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0) + // continue from tablet + let continueFromTablet = AppStorage.Get('ContinueFromTablet') + LogUtil.info(this.TAG, "onPageShow, continueFromTablet : " + continueFromTablet) + let noteContentHomeExist = AppStorage.Get('NoteContentHomeExist') + LogUtil.info(this.TAG, "onPageShow, noteContentHomeExist : " + noteContentHomeExist) + if (continueFromTablet && !noteContentHomeExist) { + router.push({ uri: 'pages/NoteContentHome' }) + AppStorage.SetOrCreate('ContinueFromTablet', false) + } + } + + onBackPress():void{ + LogUtil.info(this.TAG, "onBackPress") + // 退出键盘 + inputMethod.getInputMethodController().stopInput(); + } +} \ No newline at end of file diff --git a/product/phone/src/main/ets/pages/NoteContentHome.ets b/product/phone/src/main/ets/pages/NoteContentHome.ets new file mode 100644 index 0000000..89a4853 --- /dev/null +++ b/product/phone/src/main/ets/pages/NoteContentHome.ets @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {NoteContentCompPortrait} from '@ohos/component/src/main/ets/components/NoteContentCompPortrait' +import {LogUtil} from '@ohos/utils/src/main/ets/default/baseUtil/LogUtil' +import RdbStoreUtil from '@ohos/utils/src/main/ets/default/baseUtil/RdbStoreUtil' + +@Entry +@Component +struct NoteContentHome { + @Provide('RefreshFlag') refreshFlag: number = 0 + private controllerShow: WebController = new WebController() + @StorageLink('DBQueryFinished') dBQueryFinished: number = 0 + TAG = "NoteContentHome_Phone" + + build() { + // Note content display area + Flex({ direction: FlexDirection.Column, wrap: FlexWrap.Wrap, justifyContent: FlexAlign.Start }) { + if (this.dBQueryFinished == 1) { + NoteContentCompPortrait({ controllerShow: this.controllerShow }) + } + } + .backgroundColor($r("app.color.notecontent_color_ffffff")) + .width('100%') + .height('100%') + } + + onBackPress():void{ + LogUtil.info(this.TAG, "onBackPress") + this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setInputEnabled(false)" }) + this.controllerShow.runJavaScript({ script: "get_html_content()" }) + } + + aboutToAppear(): void{ + LogUtil.info(this.TAG, "aboutToAppear") + let isContinue = AppStorage.Get('IsContinue') + LogUtil.info(this.TAG, "aboutToAppear, isContinue : " + isContinue) + if (isContinue) { + RdbStoreUtil.initAppStorage(globalThis.noteContext) + } + AppStorage.SetOrCreate('NoteContentHomeExist', true) + } + +} \ No newline at end of file diff --git a/product/phone/src/main/ets/MainAbility/pages/NoteHomePortrait.ets b/product/phone/src/main/ets/pages/NoteHomePortrait.ets similarity index 60% rename from product/phone/src/main/ets/MainAbility/pages/NoteHomePortrait.ets rename to product/phone/src/main/ets/pages/NoteHomePortrait.ets index 44cd0f6..cb63418 100644 --- a/product/phone/src/main/ets/MainAbility/pages/NoteHomePortrait.ets +++ b/product/phone/src/main/ets/pages/NoteHomePortrait.ets @@ -13,27 +13,25 @@ * limitations under the License. */ -import {FolderListComp} from '../../../../../../../common/component/src/main/ets/default/FolderListComp.ets' -import {NoteListComp} from '../../../../../../../common/component/src/main/ets/default/NoteListComp.ets' -import {NoteContentCompPortrait} from '../../../../../../../common/component/src/main/ets/default/NoteContentCompPortrait.ets' -import StyleConstants from '../../../../../../../common/utils/src/main/ets/default/constants/StyleConstants.ets' -import {LogUtil} from '../../../../../../../common/utils/src/main/ets/default/baseUtil/LogUtil.ets' -import {circleColorArray} from '../../../../../../../common/utils/src/main/ets/default/model/NoteBaseData.ets' -import FolderData from '../../../../../../../common/utils/src/main/ets/default/model/databaseModel/FolderData.ets' -import NoteData from '../../../../../../../common/utils/src/main/ets/default/model/databaseModel/NoteData.ets' -import {SysDefFolderUuid} from '../../../../../../../common/utils/src/main/ets/default/model/databaseModel/EnumData.ets' -import LayoutUtil from '../../../../../../../common/utils/src/main/ets/default/baseUtil/LayoutUtil.ets' -import NoteUtil from '../../../../../../../common/utils/src/main/ets/default/baseUtil/NoteUtil.ets' +import {FolderListComp, FolderListBackGround} from '@ohos/component/src/main/ets/components/FolderListComp' +import {NoteListComp} from '@ohos/component/src/main/ets/components/NoteListComp' +import {NoteContentCompPortrait} from '@ohos/component/src/main/ets/components/NoteContentCompPortrait' +import StyleConstants from '@ohos/utils/src/main/ets/default/constants/StyleConstants' +import {LogUtil} from '@ohos/utils/src/main/ets/default/baseUtil/LogUtil' +import {circleColorArray} from '@ohos/utils/src/main/ets/default/model/NoteBaseData' +import FolderData from '@ohos/utils/src/main/ets/default/model/databaseModel/FolderData' +import NoteData from '@ohos/utils/src/main/ets/default/model/databaseModel/NoteData' +import {SysDefFolderUuid} from '@ohos/utils/src/main/ets/default/model/databaseModel/EnumData' +import LayoutUtil from '@ohos/utils/src/main/ets/default/baseUtil/LayoutUtil' +import NoteUtil from '@ohos/utils/src/main/ets/default/baseUtil/NoteUtil' @Entry @Component export struct NoteHomePortraitComp { - @Provide('RefreshFlag') refreshFlag: number = 0 @StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray') @StorageLink('AllFolderArray') AllFolderArray: FolderData[] = AppStorage.Link('AllFolderArray') @StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = [] - // 当前文件夹、笔记、分栏 @Provide('SelectedFolderData') selectedFolderData: FolderData = AppStorage.Get('Folder') @Provide('SelectedNoteData') selectedNoteData: NoteData = AppStorage.Get('Note') @@ -52,7 +50,7 @@ export struct NoteHomePortraitComp { @Provide('SelectedAll') selectedAll:boolean = false; @Provide('EditModel') editModel: boolean = false - TAG = "NoteHomeComp" + TAG = "NoteHomePortraitComp_Phone" build() { Stack({ alignContent: Alignment.Start }) { @@ -66,24 +64,13 @@ export struct NoteHomePortraitComp { .enabled(this.expandStatus ? false : true) //Folder list display area - Flex({ direction: FlexDirection.Column, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.Center }) { + Stack() { + FolderListBackGround() FolderListComp() } - .backgroundColor($r("app.color.folderlist_bgcolor_f1f3f5")) - .width(StyleConstants.PERCENTAGE_60) + .width(200) .height(StyleConstants.PERCENTAGE_100) .visibility(this.expandStatus == false ? Visibility.None : Visibility.Visible) - - - // Note content display area - if(this.chooseNote == true ) { - Flex({ direction: FlexDirection.Column, wrap: FlexWrap.Wrap, justifyContent: FlexAlign.Start }) { - NoteContentCompPortrait() - } - .backgroundColor($r("app.color.notecontent_color_ffffff")) - .width(StyleConstants.PERCENTAGE_100) - .height(StyleConstants.PERCENTAGE_100) - } } .width(StyleConstants.PERCENTAGE_100).height(StyleConstants.PERCENTAGE_100) } diff --git a/product/phone/src/main/module.json5 b/product/phone/src/main/module.json5 new file mode 100644 index 0000000..6794925 --- /dev/null +++ b/product/phone/src/main/module.json5 @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "module": { + "name": "phone", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:entry_MainAbility", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone", + ], + "requestPermissions": [ + { + "name": "ohos.permission.READ_MEDIA" + }, + { + "name": "ohos.permission.WRITE_MEDIA" + }, + { + "name": "ohos.permission.MEDIA_LOCATION" + }, + { + "name": "ohos.permission.DISTRIBUTED_DATASYNC" + }, + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "uiSyntax": "ets", + "abilities": [ + { + "name": "MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:entry_MainAbility", + "icon": "$media:note", + "label": "$string:entry_MainAbility", + "visible": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/product/phone/src/main/resources/base/element/float.json b/product/phone/src/main/resources/base/element/float.json deleted file mode 100644 index fe803f0..0000000 --- a/product/phone/src/main/resources/base/element/float.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "float": [ - { - "name": "wh_value_1", - "value": "1" - }, - { - "name": "wh_value_4", - "value": "4" - }, - { - "name": "wh_value_5", - "value": "5" - }, - { - "name": "wh_value_8", - "value": "8" - }, - { - "name": "wh_value_10", - "value": "10" - }, - { - "name": "wh_value_14", - "value": "14" - }, - { - "name": "wh_value_16", - "value": "16" - }, - { - "name": "wh_value_20", - "value": "20" - }, - { - "name": "wh_value_24", - "value": "24" - }, - { - "name": "wh_value_30", - "value": "30" - }, - { - "name": "wh_value_40", - "value": "40" - }, - { - "name": "wh_value_50", - "value": "50" - }, - { - "name": "wh_value_60", - "value": "60" - }, - { - "name": "wh_value_65", - "value": "65" - }, - { - "name": "wh_value_70", - "value": "70" - }, - { - "name": "wh_value_80", - "value": "80" - }, - { - "name": "wh_value_100", - "value": "100" - }, - { - "name": "wh_value_120", - "value": "120" - }, - { - "name": "wh_value_130", - "value": "1300" - }, - { - "name": "wh_value_160", - "value": "160" - }, - { - "name": "wh_value_230", - "value": "230" - }, - { - "name": "wh_value_280", - "value": "280" - }, - { - "name": "wh_value_390", - "value": "390" - }, - { - "name": "wh_value_400", - "value": "400" - }, - { - "name": "font_35", - "value": "35" - }, - { - "name": "font_15", - "value": "15" - }, - { - "name": "font_20", - "value": "20" - }, - { - "name": "font_25", - "value": "25" - }, - { - "name": "font_28", - "value": "28" - }, - { - "name": "font_50", - "value": "50" - }, - { - "name": "control_common_font_size", - "value": "20" - }, - { - "name": "slider_text_padding_left", - "value": "5" - }, - { - "name": "volume_border_radius", - "value": "15" - } - ] -} \ No newline at end of file diff --git a/product/phone/src/main/resources/base/media/circle_tick1.svg b/product/phone/src/main/resources/base/media/circle_tick1.svg deleted file mode 100644 index 295c58c..0000000 --- a/product/phone/src/main/resources/base/media/circle_tick1.svg +++ /dev/null @@ -1 +0,0 @@ -文档扫描 \ No newline at end of file diff --git a/product/phone/src/main/resources/base/media/delete.svg b/product/phone/src/main/resources/base/media/delete.svg deleted file mode 100644 index 2f1c1fb..0000000 --- a/product/phone/src/main/resources/base/media/delete.svg +++ /dev/null @@ -1 +0,0 @@ -删除 \ No newline at end of file diff --git a/product/phone/src/main/resources/base/media/favorite_cancel.svg b/product/phone/src/main/resources/base/media/favorite_cancel.svg deleted file mode 100644 index c7d09d6..0000000 --- a/product/phone/src/main/resources/base/media/favorite_cancel.svg +++ /dev/null @@ -1,30 +0,0 @@ - - - - -收藏(线性) - - diff --git a/product/phone/src/main/resources/base/media/foldMove_select.svg b/product/phone/src/main/resources/base/media/foldMove_select.svg deleted file mode 100644 index 6b7b9d1..0000000 --- a/product/phone/src/main/resources/base/media/foldMove_select.svg +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - -选中 - - - - - - - - - - - diff --git a/product/phone/src/main/resources/base/media/unClassified.svg b/product/phone/src/main/resources/base/media/unClassified.svg deleted file mode 100644 index 2174ec8..0000000 --- a/product/phone/src/main/resources/base/media/unClassified.svg +++ /dev/null @@ -1 +0,0 @@ -笔记本 \ No newline at end of file diff --git a/product/phone/src/main/resources/base/profile/main_pages.json b/product/phone/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000..3ed4365 --- /dev/null +++ b/product/phone/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,7 @@ +{ + "src": [ + "pages/MyNoteHome", + "pages/NoteContentHome", + "pages/NoteHomePortrait" + ] +} \ No newline at end of file diff --git a/product/phone/src/main/resources/rawfile/cake.png b/product/phone/src/main/resources/rawfile/cake.png deleted file mode 100644 index 35a79e9..0000000 Binary files a/product/phone/src/main/resources/rawfile/cake.png and /dev/null differ diff --git a/product/phone/src/main/resources/rawfile/editor.html b/product/phone/src/main/resources/rawfile/editor.html deleted file mode 100644 index 5daf07b..0000000 --- a/product/phone/src/main/resources/rawfile/editor.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - "editorJs" - - - - - - -
-
- - - diff --git a/product/phone/src/main/resources/rawfile/lvyou.png b/product/phone/src/main/resources/rawfile/lvyou.png deleted file mode 100644 index 5a4c05f..0000000 Binary files a/product/phone/src/main/resources/rawfile/lvyou.png and /dev/null differ diff --git a/product/phone/src/main/resources/rawfile/shuxue.png b/product/phone/src/main/resources/rawfile/shuxue.png deleted file mode 100644 index 8af342a..0000000 Binary files a/product/phone/src/main/resources/rawfile/shuxue.png and /dev/null differ diff --git a/product/tablet/.gitignore b/product/tablet/.gitignore new file mode 100644 index 0000000..4f9a973 --- /dev/null +++ b/product/tablet/.gitignore @@ -0,0 +1,3 @@ +/node_modules +/.preview +/build \ No newline at end of file diff --git a/common/utils/src/main/ets/default/baseUtil/WebViewUtil.ets b/product/tablet/build-profile.json5 similarity index 60% rename from common/utils/src/main/ets/default/baseUtil/WebViewUtil.ets rename to product/tablet/build-profile.json5 index 4443def..a011ff8 100644 --- a/common/utils/src/main/ets/default/baseUtil/WebViewUtil.ets +++ b/product/tablet/build-profile.json5 @@ -13,23 +13,13 @@ * limitations under the License. */ -/** - * WebView Util - */ -export class WebViewUtil { - private static controllerShow: WebController - - private constructor() { - - } - - public static getWebController(): WebController{ - console.info('WebViewUtil, getWebController') - if (!this.controllerShow) { - console.info('WebViewUtil, controllerShow is null') - this.controllerShow = new WebController() +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", } - return this.controllerShow - } - + ] } \ No newline at end of file diff --git a/product/tablet/build.gradle b/product/tablet/build.gradle deleted file mode 100644 index 3f68c19..0000000 --- a/product/tablet/build.gradle +++ /dev/null @@ -1,20 +0,0 @@ -apply plugin: 'com.huawei.ohos.hap' -//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 -ohos { - compileSdkVersion 8 - defaultConfig { - compatibleSdkVersion 8 - } - - buildTypes { - release { - proguardOpt { - proguardEnabled false - rulesFiles 'proguard-rules.pro' - } - } - } -} - -dependencies { -} diff --git a/product/tablet/hvigorfile.js b/product/tablet/hvigorfile.js new file mode 100644 index 0000000..d7720ee --- /dev/null +++ b/product/tablet/hvigorfile.js @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks diff --git a/product/tablet/package-lock.json b/product/tablet/package-lock.json new file mode 100644 index 0000000..ea624c2 --- /dev/null +++ b/product/tablet/package-lock.json @@ -0,0 +1,45 @@ +{ + "name": "tablet", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@ohos/component": { + "version": "file:../../common/component", + "requires": { + "@ohos/source": "file:../../common/resources", + "@ohos/utils": "file:../../common/utils" + }, + "dependencies": { + "@ohos/source": { + "version": "file:../../common/resources" + }, + "@ohos/utils": { + "version": "file:../../common/utils", + "requires": { + "@ohos/source": "file:../../common/resources" + }, + "dependencies": { + "@ohos/source": { + "version": "file:../../common/resources" + } + } + } + } + }, + "@ohos/source": { + "version": "file:../../common/resources" + }, + "@ohos/utils": { + "version": "file:../../common/utils", + "requires": { + "@ohos/source": "file:../../common/resources" + }, + "dependencies": { + "@ohos/source": { + "version": "file:../../common/resources" + } + } + } + } +} diff --git a/product/tablet/package.json b/product/tablet/package.json new file mode 100644 index 0000000..4cfedc4 --- /dev/null +++ b/product/tablet/package.json @@ -0,0 +1,18 @@ +{ + "license":"ISC", + "devDependencies":{}, + "name":"tablet", + "ohos":{ + "org":"huawei", + "directoryLevel":"module", + "buildTool":"hvigor" + }, + "description":"example description", + "repository":{}, + "version":"1.0.0", + "dependencies":{ + "@ohos/utils":"file:../../common/utils", + "@ohos/component":"file:../../common/component", + "@ohos/source":"file:../../common/resources" + } +} \ No newline at end of file diff --git a/product/tablet/src/main/ets/AbilityStage.ts b/product/tablet/src/main/ets/Application/AbilityStage.ts similarity index 72% rename from product/tablet/src/main/ets/AbilityStage.ts rename to product/tablet/src/main/ets/Application/AbilityStage.ts index 9eb7993..32dfe93 100644 --- a/product/tablet/src/main/ets/AbilityStage.ts +++ b/product/tablet/src/main/ets/Application/AbilityStage.ts @@ -2,6 +2,6 @@ import AbilityStage from "@ohos.application.AbilityStage" export default class MyAbilityStage extends AbilityStage { onCreate() { - console.log("MyAbilityStage onCreate") + console.log("[Demo] MyAbilityStage onCreate") } } \ No newline at end of file diff --git a/product/tablet/src/main/ets/MainAbility/MainAbility.ts b/product/tablet/src/main/ets/MainAbility/MainAbility.ts index c39b761..746b8cf 100644 --- a/product/tablet/src/main/ets/MainAbility/MainAbility.ts +++ b/product/tablet/src/main/ets/MainAbility/MainAbility.ts @@ -14,32 +14,32 @@ */ import Ability from '@ohos.application.Ability' -import {WebViewUtil} from './WebViewUtil.ets' +import AbilityConstant from '@ohos.application.AbilityConstant' import fileio from '@ohos.fileio' +import inputMethod from '@ohos.inputmethod'; export default class MainAbility extends Ability { - private Tag = "Tablet_Note_MainAbility" + private Tag = "MainAbility_Tablet" onCreate(want, launchParam) { console.info(this.Tag + " onCreate, launchReason is " + launchParam.launchReason) - if (launchParam.launchReason == 3) { + if (launchParam.launchReason == AbilityConstant.LaunchReason.CONTINUATION) { + // 设置迁移标记 + AppStorage.SetOrCreate('IsContinue', true) // 获取对端的迁移数据 let continueNote: string = want.parameters["ContinueNote"] let continueSection: number = want.parameters["ContinueSection"] console.info(this.Tag + " continueSection : " + continueSection) AppStorage.SetOrCreate('ContinueNote', continueNote) AppStorage.SetOrCreate('ContinueSection', continueSection) - // 设置迁移标记 - AppStorage.SetOrCreate('IsContinue', true) - // 来自手机的迁移 - let isChoose: boolean = want.parameters["ContinueChoose"] - console.info(this.Tag + " from phone, isChoose : " + isChoose) - AppStorage.SetOrCreate('IsChoose', isChoose) + let continueChoose: boolean = want.parameters["ContinueChoose"] + if (continueChoose) { + console.info(this.Tag + " continue from phone") + AppStorage.SetOrCreate('ContinueFromPhone', true) + } this.context.restoreWindowStage(null) } - AppStorage.SetOrCreate('openPhoto', 0) - AppStorage.SetOrCreate('openPerm', 0) globalThis.noteContext = this.context } @@ -62,14 +62,76 @@ export default class MainAbility extends Ability { onBackground() { console.info(this.Tag + " onBackground") - let controllerShow = WebViewUtil.getWebController() - if (controllerShow == undefined || controllerShow == null) { - console.info("MainAbility onBackground, controllerShow is error") + // 退出键盘 + inputMethod.getInputMethodController().stopInput(); + } + + onContinue(wantParam: { [key: string]: any }) { + console.info(this.Tag + " onContinue") + // 获取本端的迁移数据 + let continueNote = AppStorage.Get('ContinueNote') + if (continueNote == undefined || continueNote == null) { + console.info(this.Tag + " onContinue, continueNote is error, default [0]") + continueNote = JSON.stringify(AppStorage.Get('AllNoteArray')[0].toNoteObject()) } - console.info(this.Tag + " controllerShow : " + controllerShow) - controllerShow.runJavaScript({ - script: "get_html_content()" + + let continueSection = AppStorage.Get('ContinueSection') + if (continueSection == undefined || continueSection == null) { + console.info(this.Tag + " onContinue, continueSection is error, default 3") + continueSection = 3 + } + console.info(this.Tag + " onContinue, continueSection : " + continueSection) + + // 保存本端的迁移数据 + wantParam["ContinueNote"] = continueNote + wantParam["ContinueSection"] = continueSection + + // save img to DisFileDir + console.info(this.Tag + " onContinue, save img to DisFileDir") + let continueNoteObj = JSON.parse(continueNote) + let srcArray = this.getSrcFromHtml(continueNoteObj.content_text) + srcArray.forEach((src: string) => { + let lastIndex = src.lastIndexOf('/') + if (lastIndex != -1) { + let imgName = src.substring(lastIndex + 1) + this.writeToDisFileDir(imgName) + } }) - console.info(this.Tag + " controllerShow end") + console.info(this.Tag + " onContinue end") + return AbilityConstant.OnContinueResult.AGREE + } + + getSrcFromHtml(html: string): any{ + let srcArray = [] + if (html == undefined || html == null || html == "") { + return srcArray + } + let imgReg = /]+>/g + let srcReg = /src=[\'\"]?([^\'\"]*)[\'\"]?/i + let imgArray = html.match(imgReg) + if (imgArray != null) { + for (let i = 0; i < imgArray.length; i++) { + let src = imgArray[i].match(srcReg) + if (src != null && src.length > 1) { + console.info(this.Tag + " getSrcFromHtml, src[1] : " + src[1]) + srcArray.push(src[1]) + } + } + } + return srcArray + } + + writeToDisFileDir(fileName: string) { + console.info(this.Tag + " writeToDisFileDir, fileName : " + fileName) + let filesDir = this.context.filesDir + let srcPath = filesDir + "/" + fileName + let distributedFilesDir = this.context.distributedFilesDir + let desPath = distributedFilesDir + "/" + fileName + try { + fileio.copyFileSync(srcPath, desPath) + console.info(this.Tag + " onContinue, writeToDisFileDir, copyFile successfully") + } catch (err) { + console.warn(this.Tag + " onContinue, writeToDisFileDir, copyFile failed : " + err) + } } } \ No newline at end of file diff --git a/product/tablet/src/main/ets/MainAbility/res/cake.png b/product/tablet/src/main/ets/MainAbility/res/cake.png deleted file mode 100644 index 35a79e9..0000000 Binary files a/product/tablet/src/main/ets/MainAbility/res/cake.png and /dev/null differ diff --git a/product/tablet/src/main/ets/MainAbility/res/lvyou.png b/product/tablet/src/main/ets/MainAbility/res/lvyou.png deleted file mode 100644 index 5a4c05f..0000000 Binary files a/product/tablet/src/main/ets/MainAbility/res/lvyou.png and /dev/null differ diff --git a/product/tablet/src/main/ets/MainAbility/res/shuxue.png b/product/tablet/src/main/ets/MainAbility/res/shuxue.png deleted file mode 100644 index 8af342a..0000000 Binary files a/product/tablet/src/main/ets/MainAbility/res/shuxue.png and /dev/null differ diff --git a/product/tablet/src/main/ets/pages/MyNoteHome.ets b/product/tablet/src/main/ets/pages/MyNoteHome.ets new file mode 100644 index 0000000..954459c --- /dev/null +++ b/product/tablet/src/main/ets/pages/MyNoteHome.ets @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import fileio from '@ohos.fileio' +import bundle from '@ohos.bundle' +import abilityAccessCtrl from '@ohos.abilityAccessCtrl' +import {NoteHomeComp} from './NoteHome' +import {LogUtil} from '@ohos/utils/src/main/ets/default/baseUtil/LogUtil' +import RdbStoreUtil from '@ohos/utils/src/main/ets/default/baseUtil/RdbStoreUtil' +import NoteData from '@ohos/utils/src/main/ets/default/model/databaseModel/NoteData' +import inputMethod from '@ohos.inputmethod'; + +@Entry +@Component +export struct MyNoteHomeComp { + @StorageLink('DBQueryFinished') dBQueryFinished: number = 0 + @Provide('PortraitModel') portraitModel: boolean = false + @Provide('RefreshFlag') refreshFlag: number = 0 + private controllerShow: WebController = new WebController() + private context = getContext(this) + TAG = "MyNoteHomeComp_Tablet" + + build() { + Row() { + if (this.dBQueryFinished == 1) { + NoteHomeComp({ controllerShow: this.controllerShow }) + } + } + .width('100%') + .height('100%') + } + + aboutToAppear(): void{ + LogUtil.info(this.TAG, "aboutToAppear") + + if (this.context == undefined || this.context == null) { + LogUtil.warn(this.TAG, "context is error") + return + } + + let permissionList: Array = [ + "ohos.permission.READ_MEDIA", + "ohos.permission.DISTRIBUTED_DATASYNC" + ] + LogUtil.info(this.TAG, 'permissions need to require from user') + this.context.requestPermissionsFromUser(permissionList).then((data) => { + LogUtil.info(this.TAG, 'data permissions : ' + data.permissions) + LogUtil.info(this.TAG, 'data result: ' + data.authResults) + let sum = 0 + for (let i = 0; i < data.authResults.length; i++) { + sum += data.authResults[i] + } + LogUtil.info(this.TAG, 'request permissions sum: ' + sum) + }, (err) => { + LogUtil.warn(this.TAG, 'failed to requestPermissionsFromUser : ' + err.code); + }) + + let dbPath = this.context.databaseDir + "/db/note.db" + try { + fileio.accessSync(dbPath) + LogUtil.info(this.TAG, "db has created") + RdbStoreUtil.initAppStorage(this.context) + } catch (err) { + LogUtil.info(this.TAG, "db has not created, start to create db") + RdbStoreUtil.createRdbStore(this.context) + } + } + + aboutToDisappear(): void{ + LogUtil.info(this.TAG, "aboutToDisappear") + } + + onPageShow(): void{ + LogUtil.info(this.TAG, "onPageShow") + let currentNote = AppStorage.Get('NewNote') + let needRefesh = AppStorage.Get('needRefresh') + if (currentNote != null && needRefesh == true) { + this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setHtml('" + currentNote.content_text + "')" }) + AppStorage.SetOrCreate('needRefresh',false) + } + this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0) + } + + onBackPress() { + LogUtil.info(this.TAG, "onBackPress") + // 退出键盘 + inputMethod.getInputMethodController().stopInput(); + } +} \ No newline at end of file diff --git a/product/tablet/src/main/ets/pages/NoteContentHome.ets b/product/tablet/src/main/ets/pages/NoteContentHome.ets new file mode 100644 index 0000000..2dc3305 --- /dev/null +++ b/product/tablet/src/main/ets/pages/NoteContentHome.ets @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {NoteContent} from '@ohos/component/src/main/ets/components/NoteContent' +import {LogUtil} from '@ohos/utils/src/main/ets/default/baseUtil/LogUtil' +import RdbStoreUtil from '@ohos/utils/src/main/ets/default/baseUtil/RdbStoreUtil' +import inputMethod from '@ohos.inputmethod' + +@Entry +@Component +struct NoteContentHome { + private controllerShow: WebController = new WebController() + @StorageLink('DBQueryFinished') dBQueryFinished: number = 0 + TAG = "NoteContentHome_Tablet" + + build() { + // Note content display area + Flex({ direction: FlexDirection.Column, wrap: FlexWrap.Wrap, justifyContent: FlexAlign.Start }) { + if (this.dBQueryFinished == 1) { + NoteContent({ controllerShow: this.controllerShow }) + } + } + .backgroundColor($r("app.color.notecontent_color_ffffff")) + .width('100%') + .height('100%') + } + + onBackPress():void{ + LogUtil.info(this.TAG, "onBackPress") + this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setInputEnabled(false)" }) + this.controllerShow.runJavaScript({ script: "get_html_content()" }) + inputMethod.getInputMethodController().stopInput() + } + + aboutToAppear(): void{ + LogUtil.info(this.TAG, "aboutToAppear") + let isContinue = AppStorage.Get('IsContinue') + LogUtil.info(this.TAG, "aboutToAppear, isContinue : " + isContinue) + if (isContinue) { + RdbStoreUtil.initAppStorage(globalThis.noteContext) + } + } + +} \ No newline at end of file diff --git a/product/tablet/src/main/ets/MainAbility/pages/NoteHome.ets b/product/tablet/src/main/ets/pages/NoteHome.ets similarity index 72% rename from product/tablet/src/main/ets/MainAbility/pages/NoteHome.ets rename to product/tablet/src/main/ets/pages/NoteHome.ets index 7c45829..1e086b5 100644 --- a/product/tablet/src/main/ets/MainAbility/pages/NoteHome.ets +++ b/product/tablet/src/main/ets/pages/NoteHome.ets @@ -13,24 +13,22 @@ * limitations under the License. */ -import {FolderListComp} from '../../../../../../../common/component/src/main/ets/default/FolderListComp.ets' -import {NoteListComp} from '../../../../../../../common/component/src/main/ets/default/NoteListComp.ets' -import {NoteContentComp} from '../../../../../../../common/component/src/main/ets/default/NoteContentComp' -import StyleConstants from '../../../../../../../common/utils/src/main/ets/default/constants/StyleConstants.ets' -import {LogUtil} from '../../../../../../../common/utils/src/main/ets/default/baseUtil/LogUtil.ets' -import {circleColorArray} from '../../../../../../../common/utils/src/main/ets/default/model/NoteBaseData.ets' -import FolderData from '../../../../../../../common/utils/src/main/ets/default/model/databaseModel/FolderData.ets' -import NoteData from '../../../../../../../common/utils/src/main/ets/default/model/databaseModel/NoteData.ets' -import {SysDefFolderUuid} from '../../../../../../../common/utils/src/main/ets/default/model/databaseModel/EnumData.ets' -import LayoutUtil from '../../../../../../../common/utils/src/main/ets/default/baseUtil/LayoutUtil.ets' -import NoteUtil from '../../../../../../../common/utils/src/main/ets/default/baseUtil/NoteUtil.ets' -import {WebViewUtil} from '../../../../../../../common/utils/src/main/ets/default/baseUtil/WebViewUtil.ets' +import {FolderListComp} from '@ohos/component/src/main/ets/components/FolderListComp' +import {NoteListComp} from '@ohos/component/src/main/ets/components/NoteListComp' +import {NoteContentComp} from '@ohos/component/src/main/ets/components/NoteContentComp' +import StyleConstants from '@ohos/utils/src/main/ets/default/constants/StyleConstants' +import {LogUtil} from '@ohos/utils/src/main/ets/default/baseUtil/LogUtil' +import {circleColorArray} from '@ohos/utils/src/main/ets/default/model/NoteBaseData' +import FolderData from '@ohos/utils/src/main/ets/default/model/databaseModel/FolderData' +import NoteData from '@ohos/utils/src/main/ets/default/model/databaseModel/NoteData' +import {SysDefFolderUuid} from '@ohos/utils/src/main/ets/default/model/databaseModel/EnumData' +import LayoutUtil from '@ohos/utils/src/main/ets/default/baseUtil/LayoutUtil' +import NoteUtil from '@ohos/utils/src/main/ets/default/baseUtil/NoteUtil' import mediaquery from '@ohos.mediaquery' @Entry @Component export struct NoteHomeComp { - @Provide('RefreshFlag') refreshFlag: number = 0 @StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray') @StorageLink('AllFolderArray') AllFolderArray: FolderData[] = AppStorage.Link('AllFolderArray') @StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = [] @@ -49,9 +47,20 @@ export struct NoteHomeComp { @Provide('InputKeyword') inputKeyword: string = '' // 搜索的字串 @Provide('SelectedAll') selectedAll: boolean = false @Provide('EditModel') editModel: boolean = false //编辑模式:临时方案 - private controllerShow: WebController = WebViewUtil.getWebController() //第三栏展示 + @Provide('Issave') issave: number = 0 + controllerShow: WebController - TAG = "NoteHomeComp" + TAG = "NoteHomeComp_Tablet" + + narrowWinListener = mediaquery.matchMediaSync('(width < 2000)') + onWinSizeChange(mediaQueryResult) { + if (this.sectionStatus != 1) { + this.sectionStatus = (mediaQueryResult.matches) ? 2 : 3 + // save continue data + AppStorage.SetOrCreate('ContinueSection', this.sectionStatus) + LogUtil.info(this.TAG, "onWinSizeChange, set continue section success") + } + } narrowWinListener = mediaquery.matchMediaSync('(width < 2000)') onWinSizeChange(mediaQueryResult) { @@ -85,7 +94,7 @@ export struct NoteHomeComp { .opacity(StyleConstants.OPACITY_10) NoteListComp({ controllerShow: this.controllerShow }) } - .flexShrink(0) + .flexShrink(1) .backgroundColor($r("app.color.notelist_bgcolor_f1f3f5")) .layoutWeight(2) .height(StyleConstants.PERCENTAGE_100) @@ -122,11 +131,14 @@ export struct NoteHomeComp { this.sectionStatus = AppStorage.Get('Section') } // continue from phone - let isChoose = AppStorage.Get('IsChoose') - LogUtil.info(this.TAG, "aboutToAppear, isChoose : " + isChoose) - if (isChoose) { - this.sectionStatus = 1 + let continueFromPhone = AppStorage.Get('ContinueFromPhone') + LogUtil.info(this.TAG, "aboutToAppear, continueFromPhone : " + continueFromPhone) + if (continueFromPhone) { + this.sectionStatus = 3 } + // save continue data + AppStorage.SetOrCreate('ContinueSection', this.sectionStatus) + LogUtil.info(this.TAG, "aboutToAppear, set continue section success") } aboutToDisappear(): void{ diff --git a/product/tablet/src/main/module.json5 b/product/tablet/src/main/module.json5 new file mode 100644 index 0000000..4199e51 --- /dev/null +++ b/product/tablet/src/main/module.json5 @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "module": { + "name": "tablet", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:entry_MainAbility", + "mainElement": "MainAbility", + "deviceTypes": [ + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "uiSyntax": "ets", + "abilities": [ + { + "name": "MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:entry_MainAbility", + "icon": "$media:note", + "label": "$string:entry_MainAbility", + "visible": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/element/float.json b/product/tablet/src/main/resources/base/element/float.json deleted file mode 100644 index fe803f0..0000000 --- a/product/tablet/src/main/resources/base/element/float.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "float": [ - { - "name": "wh_value_1", - "value": "1" - }, - { - "name": "wh_value_4", - "value": "4" - }, - { - "name": "wh_value_5", - "value": "5" - }, - { - "name": "wh_value_8", - "value": "8" - }, - { - "name": "wh_value_10", - "value": "10" - }, - { - "name": "wh_value_14", - "value": "14" - }, - { - "name": "wh_value_16", - "value": "16" - }, - { - "name": "wh_value_20", - "value": "20" - }, - { - "name": "wh_value_24", - "value": "24" - }, - { - "name": "wh_value_30", - "value": "30" - }, - { - "name": "wh_value_40", - "value": "40" - }, - { - "name": "wh_value_50", - "value": "50" - }, - { - "name": "wh_value_60", - "value": "60" - }, - { - "name": "wh_value_65", - "value": "65" - }, - { - "name": "wh_value_70", - "value": "70" - }, - { - "name": "wh_value_80", - "value": "80" - }, - { - "name": "wh_value_100", - "value": "100" - }, - { - "name": "wh_value_120", - "value": "120" - }, - { - "name": "wh_value_130", - "value": "1300" - }, - { - "name": "wh_value_160", - "value": "160" - }, - { - "name": "wh_value_230", - "value": "230" - }, - { - "name": "wh_value_280", - "value": "280" - }, - { - "name": "wh_value_390", - "value": "390" - }, - { - "name": "wh_value_400", - "value": "400" - }, - { - "name": "font_35", - "value": "35" - }, - { - "name": "font_15", - "value": "15" - }, - { - "name": "font_20", - "value": "20" - }, - { - "name": "font_25", - "value": "25" - }, - { - "name": "font_28", - "value": "28" - }, - { - "name": "font_50", - "value": "50" - }, - { - "name": "control_common_font_size", - "value": "20" - }, - { - "name": "slider_text_padding_left", - "value": "5" - }, - { - "name": "volume_border_radius", - "value": "15" - } - ] -} \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/action_bold.svg b/product/tablet/src/main/resources/base/media/action_bold.svg deleted file mode 100644 index 5dd179b..0000000 --- a/product/tablet/src/main/resources/base/media/action_bold.svg +++ /dev/null @@ -1 +0,0 @@ -文本粗细 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/addNote.svg b/product/tablet/src/main/resources/base/media/addNote.svg deleted file mode 100644 index 0cbab4e..0000000 --- a/product/tablet/src/main/resources/base/media/addNote.svg +++ /dev/null @@ -1 +0,0 @@ -加-细 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/allNotes.svg b/product/tablet/src/main/resources/base/media/allNotes.svg deleted file mode 100644 index 0bd2d8c..0000000 --- a/product/tablet/src/main/resources/base/media/allNotes.svg +++ /dev/null @@ -1 +0,0 @@ -笔记 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/back.svg b/product/tablet/src/main/resources/base/media/back.svg deleted file mode 100644 index 95e1f5d..0000000 --- a/product/tablet/src/main/resources/base/media/back.svg +++ /dev/null @@ -1 +0,0 @@ -back \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/back_1.svg b/product/tablet/src/main/resources/base/media/back_1.svg deleted file mode 100644 index 95e1f5d..0000000 --- a/product/tablet/src/main/resources/base/media/back_1.svg +++ /dev/null @@ -1 +0,0 @@ -back \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/camera.svg b/product/tablet/src/main/resources/base/media/camera.svg deleted file mode 100644 index cd8fa1b..0000000 --- a/product/tablet/src/main/resources/base/media/camera.svg +++ /dev/null @@ -1 +0,0 @@ -相机 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/check_all.svg b/product/tablet/src/main/resources/base/media/check_all.svg deleted file mode 100644 index 64922fd..0000000 --- a/product/tablet/src/main/resources/base/media/check_all.svg +++ /dev/null @@ -1 +0,0 @@ -全选 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/check_all1.svg b/product/tablet/src/main/resources/base/media/check_all1.svg deleted file mode 100644 index 34d884f..0000000 --- a/product/tablet/src/main/resources/base/media/check_all1.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - 全选 - - \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/checked.svg b/product/tablet/src/main/resources/base/media/checked.svg deleted file mode 100644 index 32708c9..0000000 --- a/product/tablet/src/main/resources/base/media/checked.svg +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - -选中后 - - - - - - - - - - - diff --git a/product/tablet/src/main/resources/base/media/choose_all.svg b/product/tablet/src/main/resources/base/media/choose_all.svg deleted file mode 100644 index 64922fd..0000000 --- a/product/tablet/src/main/resources/base/media/choose_all.svg +++ /dev/null @@ -1 +0,0 @@ -全选 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/circle_tick.svg b/product/tablet/src/main/resources/base/media/circle_tick.svg deleted file mode 100644 index 10eba81..0000000 --- a/product/tablet/src/main/resources/base/media/circle_tick.svg +++ /dev/null @@ -1 +0,0 @@ -文本扫描 对勾 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/circle_tick1.svg b/product/tablet/src/main/resources/base/media/circle_tick1.svg deleted file mode 100644 index 295c58c..0000000 --- a/product/tablet/src/main/resources/base/media/circle_tick1.svg +++ /dev/null @@ -1 +0,0 @@ -文档扫描 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/cross.svg b/product/tablet/src/main/resources/base/media/cross.svg deleted file mode 100644 index c4a4e0f..0000000 --- a/product/tablet/src/main/resources/base/media/cross.svg +++ /dev/null @@ -1 +0,0 @@ -叉-粗 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/cross_thick.svg b/product/tablet/src/main/resources/base/media/cross_thick.svg deleted file mode 100644 index c4a4e0f..0000000 --- a/product/tablet/src/main/resources/base/media/cross_thick.svg +++ /dev/null @@ -1 +0,0 @@ -叉-粗 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/cross_thin.svg b/product/tablet/src/main/resources/base/media/cross_thin.svg deleted file mode 100644 index 6373a78..0000000 --- a/product/tablet/src/main/resources/base/media/cross_thin.svg +++ /dev/null @@ -1 +0,0 @@ -叉-细 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/cycle_thin1.svg b/product/tablet/src/main/resources/base/media/cycle_thin1.svg deleted file mode 100644 index 1fc2cba..0000000 --- a/product/tablet/src/main/resources/base/media/cycle_thin1.svg +++ /dev/null @@ -1 +0,0 @@ -cycle-细 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/delete.svg b/product/tablet/src/main/resources/base/media/delete.svg deleted file mode 100644 index 2f1c1fb..0000000 --- a/product/tablet/src/main/resources/base/media/delete.svg +++ /dev/null @@ -1 +0,0 @@ -删除 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/delete1.svg b/product/tablet/src/main/resources/base/media/delete1.svg deleted file mode 100644 index c97adea..0000000 --- a/product/tablet/src/main/resources/base/media/delete1.svg +++ /dev/null @@ -1 +0,0 @@ -删除-实心 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/delete2.svg b/product/tablet/src/main/resources/base/media/delete2.svg deleted file mode 100644 index 2f1c1fb..0000000 --- a/product/tablet/src/main/resources/base/media/delete2.svg +++ /dev/null @@ -1 +0,0 @@ -删除 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/emptyPage.svg b/product/tablet/src/main/resources/base/media/emptyPage.svg deleted file mode 100644 index a0e85dd..0000000 --- a/product/tablet/src/main/resources/base/media/emptyPage.svg +++ /dev/null @@ -1,47 +0,0 @@ - - - - -笔记空页面 - - - - - - - - - - - - - diff --git a/product/tablet/src/main/resources/base/media/favorite.svg b/product/tablet/src/main/resources/base/media/favorite.svg deleted file mode 100644 index b3d1e16..0000000 --- a/product/tablet/src/main/resources/base/media/favorite.svg +++ /dev/null @@ -1 +0,0 @@ -收藏-实心 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/favorite_cancel.svg b/product/tablet/src/main/resources/base/media/favorite_cancel.svg deleted file mode 100644 index c7d09d6..0000000 --- a/product/tablet/src/main/resources/base/media/favorite_cancel.svg +++ /dev/null @@ -1,30 +0,0 @@ - - - - -收藏(线性) - - diff --git a/product/tablet/src/main/resources/base/media/foldMove_unselect.svg b/product/tablet/src/main/resources/base/media/foldMove_unselect.svg deleted file mode 100644 index 3b9a209..0000000 --- a/product/tablet/src/main/resources/base/media/foldMove_unselect.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - -未选中 - - - - - - - diff --git a/product/tablet/src/main/resources/base/media/folder.svg b/product/tablet/src/main/resources/base/media/folder.svg deleted file mode 100644 index f5c0bc0..0000000 --- a/product/tablet/src/main/resources/base/media/folder.svg +++ /dev/null @@ -1 +0,0 @@ -文件夹 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/font_color.svg b/product/tablet/src/main/resources/base/media/font_color.svg deleted file mode 100644 index 70ee9ed..0000000 --- a/product/tablet/src/main/resources/base/media/font_color.svg +++ /dev/null @@ -1 +0,0 @@ -文本颜色 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/font_large.svg b/product/tablet/src/main/resources/base/media/font_large.svg deleted file mode 100644 index 82436a9..0000000 --- a/product/tablet/src/main/resources/base/media/font_large.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - -字体大小备份 2 - - diff --git a/product/tablet/src/main/resources/base/media/font_size.svg b/product/tablet/src/main/resources/base/media/font_size.svg deleted file mode 100644 index 90b068c..0000000 --- a/product/tablet/src/main/resources/base/media/font_size.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - -字体大小 - - diff --git a/product/tablet/src/main/resources/base/media/font_small.svg b/product/tablet/src/main/resources/base/media/font_small.svg deleted file mode 100644 index 1a77926..0000000 --- a/product/tablet/src/main/resources/base/media/font_small.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - -字体大小备份 - - diff --git a/product/tablet/src/main/resources/base/media/font_style.svg b/product/tablet/src/main/resources/base/media/font_style.svg deleted file mode 100644 index 1b57f3f..0000000 --- a/product/tablet/src/main/resources/base/media/font_style.svg +++ /dev/null @@ -1 +0,0 @@ -文本样式 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/format_italic.svg b/product/tablet/src/main/resources/base/media/format_italic.svg deleted file mode 100644 index 7695394..0000000 --- a/product/tablet/src/main/resources/base/media/format_italic.svg +++ /dev/null @@ -1 +0,0 @@ -文本倾斜 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/format_menubullte1.svg b/product/tablet/src/main/resources/base/media/format_menubullte1.svg deleted file mode 100644 index 26b7cc4..0000000 --- a/product/tablet/src/main/resources/base/media/format_menubullte1.svg +++ /dev/null @@ -1 +0,0 @@ -符号标注2 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/format_menubullte2.svg b/product/tablet/src/main/resources/base/media/format_menubullte2.svg deleted file mode 100644 index ebf9a2a..0000000 --- a/product/tablet/src/main/resources/base/media/format_menubullte2.svg +++ /dev/null @@ -1 +0,0 @@ -符号标注3 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/format_menulist_alphabet.svg b/product/tablet/src/main/resources/base/media/format_menulist_alphabet.svg deleted file mode 100644 index efc97ae..0000000 --- a/product/tablet/src/main/resources/base/media/format_menulist_alphabet.svg +++ /dev/null @@ -1 +0,0 @@ -英文符号 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/format_menulist_number.svg b/product/tablet/src/main/resources/base/media/format_menulist_number.svg deleted file mode 100644 index 6e778c0..0000000 --- a/product/tablet/src/main/resources/base/media/format_menulist_number.svg +++ /dev/null @@ -1 +0,0 @@ -数字符号 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/huaweishare1.svg b/product/tablet/src/main/resources/base/media/huaweishare1.svg deleted file mode 100644 index a587963..0000000 --- a/product/tablet/src/main/resources/base/media/huaweishare1.svg +++ /dev/null @@ -1 +0,0 @@ -huaweishare \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/icon.png b/product/tablet/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8..0000000 Binary files a/product/tablet/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/product/tablet/src/main/resources/base/media/left_justify.svg b/product/tablet/src/main/resources/base/media/left_justify.svg deleted file mode 100644 index 93e982c..0000000 --- a/product/tablet/src/main/resources/base/media/left_justify.svg +++ /dev/null @@ -1 +0,0 @@ -左对齐 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/location_notify.svg b/product/tablet/src/main/resources/base/media/location_notify.svg deleted file mode 100644 index 44a24c0..0000000 --- a/product/tablet/src/main/resources/base/media/location_notify.svg +++ /dev/null @@ -1 +0,0 @@ -位置提醒 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/mid_justify.svg b/product/tablet/src/main/resources/base/media/mid_justify.svg deleted file mode 100644 index 499b42c..0000000 --- a/product/tablet/src/main/resources/base/media/mid_justify.svg +++ /dev/null @@ -1 +0,0 @@ -居中 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/minus.svg b/product/tablet/src/main/resources/base/media/minus.svg deleted file mode 100644 index fd73046..0000000 --- a/product/tablet/src/main/resources/base/media/minus.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/more_1.svg b/product/tablet/src/main/resources/base/media/more_1.svg deleted file mode 100644 index 76b19e9..0000000 --- a/product/tablet/src/main/resources/base/media/more_1.svg +++ /dev/null @@ -1 +0,0 @@ -more \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/more_list1.svg b/product/tablet/src/main/resources/base/media/more_list1.svg deleted file mode 100644 index beaecc5..0000000 --- a/product/tablet/src/main/resources/base/media/more_list1.svg +++ /dev/null @@ -1 +0,0 @@ -more-list \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/move.svg b/product/tablet/src/main/resources/base/media/move.svg deleted file mode 100644 index 510e493..0000000 --- a/product/tablet/src/main/resources/base/media/move.svg +++ /dev/null @@ -1 +0,0 @@ -移动 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/multi_choose.svg b/product/tablet/src/main/resources/base/media/multi_choose.svg deleted file mode 100644 index 5a6c758..0000000 --- a/product/tablet/src/main/resources/base/media/multi_choose.svg +++ /dev/null @@ -1 +0,0 @@ -多选 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/pic_choose.svg b/product/tablet/src/main/resources/base/media/pic_choose.svg deleted file mode 100644 index ceb230f..0000000 --- a/product/tablet/src/main/resources/base/media/pic_choose.svg +++ /dev/null @@ -1 +0,0 @@ -复制图片 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/picture_dark.svg b/product/tablet/src/main/resources/base/media/picture_dark.svg deleted file mode 100644 index 3f97504..0000000 --- a/product/tablet/src/main/resources/base/media/picture_dark.svg +++ /dev/null @@ -1 +0,0 @@ -图片-实心 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/picture_white.svg b/product/tablet/src/main/resources/base/media/picture_white.svg deleted file mode 100644 index 1def639..0000000 --- a/product/tablet/src/main/resources/base/media/picture_white.svg +++ /dev/null @@ -1 +0,0 @@ -图片 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/recover.svg b/product/tablet/src/main/resources/base/media/recover.svg deleted file mode 100644 index c0ce26a..0000000 --- a/product/tablet/src/main/resources/base/media/recover.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - -恢复 - - diff --git a/product/tablet/src/main/resources/base/media/refresh.svg b/product/tablet/src/main/resources/base/media/refresh.svg deleted file mode 100644 index 1382336..0000000 --- a/product/tablet/src/main/resources/base/media/refresh.svg +++ /dev/null @@ -1 +0,0 @@ -刷新 细 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/right_justify.svg b/product/tablet/src/main/resources/base/media/right_justify.svg deleted file mode 100644 index e433282..0000000 --- a/product/tablet/src/main/resources/base/media/right_justify.svg +++ /dev/null @@ -1 +0,0 @@ -右对齐 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/save.svg b/product/tablet/src/main/resources/base/media/save.svg deleted file mode 100644 index 78d5245..0000000 --- a/product/tablet/src/main/resources/base/media/save.svg +++ /dev/null @@ -1 +0,0 @@ -储存 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/search_note.svg b/product/tablet/src/main/resources/base/media/search_note.svg deleted file mode 100644 index 550d831..0000000 --- a/product/tablet/src/main/resources/base/media/search_note.svg +++ /dev/null @@ -1 +0,0 @@ -搜索 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/set_top.svg b/product/tablet/src/main/resources/base/media/set_top.svg deleted file mode 100644 index f79d2d7..0000000 --- a/product/tablet/src/main/resources/base/media/set_top.svg +++ /dev/null @@ -1 +0,0 @@ -置顶 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/share.svg b/product/tablet/src/main/resources/base/media/share.svg deleted file mode 100644 index e767312..0000000 --- a/product/tablet/src/main/resources/base/media/share.svg +++ /dev/null @@ -1 +0,0 @@ -分享 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/styles.svg b/product/tablet/src/main/resources/base/media/styles.svg deleted file mode 100644 index 4fb5bb6..0000000 --- a/product/tablet/src/main/resources/base/media/styles.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - -样式 - - diff --git a/product/tablet/src/main/resources/base/media/suojin.svg b/product/tablet/src/main/resources/base/media/suojin.svg deleted file mode 100644 index 6dca6e1..0000000 --- a/product/tablet/src/main/resources/base/media/suojin.svg +++ /dev/null @@ -1 +0,0 @@ -缩进 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/suojin_back.svg b/product/tablet/src/main/resources/base/media/suojin_back.svg deleted file mode 100644 index b0c3bb7..0000000 --- a/product/tablet/src/main/resources/base/media/suojin_back.svg +++ /dev/null @@ -1 +0,0 @@ -缩进2 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/take_picture.svg b/product/tablet/src/main/resources/base/media/take_picture.svg deleted file mode 100644 index 48d8ce5..0000000 --- a/product/tablet/src/main/resources/base/media/take_picture.svg +++ /dev/null @@ -1 +0,0 @@ -拍照-实心 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/tick_thick.svg b/product/tablet/src/main/resources/base/media/tick_thick.svg deleted file mode 100644 index ca03aef..0000000 --- a/product/tablet/src/main/resources/base/media/tick_thick.svg +++ /dev/null @@ -1 +0,0 @@ -勾 粗 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/tick_thin.svg b/product/tablet/src/main/resources/base/media/tick_thin.svg deleted file mode 100644 index cd56ace..0000000 --- a/product/tablet/src/main/resources/base/media/tick_thin.svg +++ /dev/null @@ -1 +0,0 @@ -勾 细 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/todo.svg b/product/tablet/src/main/resources/base/media/todo.svg deleted file mode 100644 index 5eddff1..0000000 --- a/product/tablet/src/main/resources/base/media/todo.svg +++ /dev/null @@ -1 +0,0 @@ -下一步 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/todo1.svg b/product/tablet/src/main/resources/base/media/todo1.svg deleted file mode 100644 index 7778298..0000000 --- a/product/tablet/src/main/resources/base/media/todo1.svg +++ /dev/null @@ -1 +0,0 @@ -todo \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/todo_1.svg b/product/tablet/src/main/resources/base/media/todo_1.svg deleted file mode 100644 index b1c784c..0000000 --- a/product/tablet/src/main/resources/base/media/todo_1.svg +++ /dev/null @@ -1 +0,0 @@ -todo-实心 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/topped.svg b/product/tablet/src/main/resources/base/media/topped.svg deleted file mode 100644 index 7a9093a..0000000 --- a/product/tablet/src/main/resources/base/media/topped.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - 置顶-实心 - - \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/triangle.svg b/product/tablet/src/main/resources/base/media/triangle.svg deleted file mode 100644 index 6bd84c7..0000000 --- a/product/tablet/src/main/resources/base/media/triangle.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - -下拉三角 - - diff --git a/product/tablet/src/main/resources/base/media/tudo2_1.svg b/product/tablet/src/main/resources/base/media/tudo2_1.svg deleted file mode 100644 index be9ec5a..0000000 --- a/product/tablet/src/main/resources/base/media/tudo2_1.svg +++ /dev/null @@ -1 +0,0 @@ -tudo2 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/unChecked.svg b/product/tablet/src/main/resources/base/media/unChecked.svg deleted file mode 100644 index fada73a..0000000 --- a/product/tablet/src/main/resources/base/media/unChecked.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - -选中前 - - - - - diff --git a/product/tablet/src/main/resources/base/media/unClassified.svg b/product/tablet/src/main/resources/base/media/unClassified.svg deleted file mode 100644 index 2174ec8..0000000 --- a/product/tablet/src/main/resources/base/media/unClassified.svg +++ /dev/null @@ -1 +0,0 @@ -笔记本 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/underline.svg b/product/tablet/src/main/resources/base/media/underline.svg deleted file mode 100644 index 85d31b3..0000000 --- a/product/tablet/src/main/resources/base/media/underline.svg +++ /dev/null @@ -1 +0,0 @@ -下划线 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/undo.svg b/product/tablet/src/main/resources/base/media/undo.svg deleted file mode 100644 index d322c11..0000000 --- a/product/tablet/src/main/resources/base/media/undo.svg +++ /dev/null @@ -1 +0,0 @@ -上一步 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/unlock.svg b/product/tablet/src/main/resources/base/media/unlock.svg deleted file mode 100644 index 8b24ba9..0000000 --- a/product/tablet/src/main/resources/base/media/unlock.svg +++ /dev/null @@ -1 +0,0 @@ -解锁 \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/verticalBar.svg b/product/tablet/src/main/resources/base/media/verticalBar.svg deleted file mode 100644 index 1531d9e..0000000 --- a/product/tablet/src/main/resources/base/media/verticalBar.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - -画板 - - diff --git a/product/tablet/src/main/resources/base/media/zoom.svg b/product/tablet/src/main/resources/base/media/zoom.svg deleted file mode 100644 index ac8e444..0000000 --- a/product/tablet/src/main/resources/base/media/zoom.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - -画板 - - - - - - - diff --git a/product/tablet/src/main/resources/base/profile/main_pages.json b/product/tablet/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000..78dd7be --- /dev/null +++ b/product/tablet/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,7 @@ +{ + "src": [ + "pages/MyNoteHome", + "pages/NoteContentHome", + "pages/NoteHome" + ] +} \ No newline at end of file diff --git a/product/tablet/src/main/resources/rawfile/cake.png b/product/tablet/src/main/resources/rawfile/cake.png deleted file mode 100644 index 35a79e9..0000000 Binary files a/product/tablet/src/main/resources/rawfile/cake.png and /dev/null differ diff --git a/product/tablet/src/main/resources/rawfile/editor.html b/product/tablet/src/main/resources/rawfile/editor.html deleted file mode 100644 index 5daf07b..0000000 --- a/product/tablet/src/main/resources/rawfile/editor.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - "editorJs" - - - - - - -
-
- - - diff --git a/product/tablet/src/main/resources/rawfile/lvyou.png b/product/tablet/src/main/resources/rawfile/lvyou.png deleted file mode 100644 index 5a4c05f..0000000 Binary files a/product/tablet/src/main/resources/rawfile/lvyou.png and /dev/null differ diff --git a/product/tablet/src/main/resources/rawfile/shuxue.png b/product/tablet/src/main/resources/rawfile/shuxue.png deleted file mode 100644 index 8af342a..0000000 Binary files a/product/tablet/src/main/resources/rawfile/shuxue.png and /dev/null differ