Skip to content

Commit

Permalink
🎉 Release v1.3.3+79 🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
Cierra-Runis committed Jun 26, 2023
1 parent 47e262b commit 3b3e4b0
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 43 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/Releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
- uses: ncipollo/release-action@v1
with:
artifacts: ".release_tool/app-arm64-v8a-release.apk,.release_tool/Mercurius for Windows.zip"
name: "🎉 Release v1.3.2+78 🎉"
tag: "v1.3.2+78"
name: "🎉 Release v1.3.3+79 🎉"
tag: "v1.3.3+79"
bodyFile: ".release_tool/body.md"
skipIfReleaseExists: true
token: ${{ secrets.WAREHOUSE_TOKEN }}
Binary file modified .release_tool/Mercurius for Windows.zip
Binary file not shown.
Binary file modified .release_tool/app-arm64-v8a-release.apk
Binary file not shown.
41 changes: 19 additions & 22 deletions .release_tool/body.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,57 @@
### **Latest Version - 最新版本 - 最新バージョン**

[1.3.2+78](https://github.com/Cierra-Runis/mercurius/releases/tag/v1.3.2+78)
[1.3.3+79](https://github.com/Cierra-Runis/mercurius/releases/tag/v1.3.3+79)

### **What's Updated - 更新内容 - 更新内容**

> Revise📖
> Revise📖 & Breaking Changes⚠️
>
> 1. 📖Added `pausable_timer` package for enable `auto save` by user
> 2. 📖Make gallery page has `cacheExtent`
> 3. 📖Enable dragging window at `Windows` platform
> 4. 📖Switch to new system-level photo picker
> 5. 📖Show all draft diaries instead newest one
> 1. ⚠️Modified the picture reading method, please re-insert in the diary, the image in the gallery will not disappear
> 2. 📖Modified the image card size of the image gallery
> 修改📖
> 修改📖 & 破坏性更新⚠️
>
> 1. 📖添加 `pausable_timer` 包以供用户启用 `自动保存`
> 2. 📖让图库页面有 `cacheExtent`
> 3. 📖在 `Windows` 平台启用拖动窗口
> 4. 📖切换到新的系统级照片选择器
> 5. 📖显示所有草稿日记而不是最新的草稿日记
> 1. ⚠️修改了图片读取方式,请在日记内重新插入,图片库内的图片不会消失
> 2. 📖修改了图片库的图片卡片大小
> 修正📖
> 修正📖 & 破壊的更新⚠️
>
> 1. 📖ユーザーによる `自動保存` を有効にするための `pausable_timer` パッケージを追加しました
> 2. 📖ギャラリーページに `cacheExtent` を追加する
> 3. 📖`Windows` プラットフォームでウィンドウのドラッグを有効にする
> 4. 📖新しいシステムレベルのフォトピッカーに切り替えます
> 5. 📖最新の下書き日記ではなくすべての下書き日記を表示
> 1. ⚠️画像の読み込み方法を修正しました。日記に再挿入してください。画廊の画像は消えません。
> 2. 📖画廊の画像カードサイズを変更しました
### **Changelog - 历史更新 - 更新歴史**

> [Compare To Previous Version](https://github.com/Cierra-Runis/mercurius/compare/v1.3.1+77...v1.3.2+78)
> [Compare To Previous Version](https://github.com/Cierra-Runis/mercurius/compare/v1.3.2+78...v1.3.3+79)
> For further changelog, check the [Github Releases Page](https://github.com/Cierra-Runis/mercurius/releases)
> [和前一版本比较](https://github.com/Cierra-Runis/mercurius/compare/v1.3.1+77...v1.3.2+78)
> [和前一版本比较](https://github.com/Cierra-Runis/mercurius/compare/v1.3.2+78...v1.3.3+79)
> 有关先前的更新见 [Github Releases 页面](https://github.com/Cierra-Runis/mercurius/releases)
> [前バージョンとの比較](https://github.com/Cierra-Runis/mercurius/compare/v1.3.1+77...v1.3.2+78)
> [前バージョンとの比較](https://github.com/Cierra-Runis/mercurius/compare/v1.3.2+78...v1.3.3+79)
> 以前の更新については [Github リリースページ](https://github.com/Cierra-Runis/mercurius/releases) を参照してください
### **Breaking Changes - 破坏性更新 - 破壊的更新**

> - [v1.3.3+79](https://github.com/Cierra-Runis/mercurius/releases/tag/v1.3.3+79)
> - Modified the picture reading method, please re-insert in the diary, the image in the gallery will not disappear
> - [v0.5.0+65](https://github.com/Cierra-Runis/mercurius/releases/tag/v0.5.0+65)
> - The storage location of the isar database is modified, and the diaries needs to be re-imported using the export function
>
> - [v0.3.0+59](https://github.com/Cierra-Runis/mercurius/releases/tag/v0.3.0+59)
> - Use enumerated types to standardize diary mood, weather and Sudoku difficulty types
> - All data will be lost, please move data manually
> - [v1.3.3+79](https://github.com/Cierra-Runis/mercurius/releases/tag/v1.3.3+79)
> - 修改了图片读取方式,请在日记内重新插入,图片库内的图片不会消失
> - [v0.5.0+65](https://github.com/Cierra-Runis/mercurius/releases/tag/v0.5.0+65)
> - isar 数据库存放位置修改,需要使用导出功能重新导入日记
>
> - [v0.3.0+59](https://github.com/Cierra-Runis/mercurius/releases/tag/v0.3.0+59)
> - 使用枚举类型规范日记心情、天气及数独难度的类型
> - 会失去所有数据,请手动移动数据
> - [v1.3.3+79](https://github.com/Cierra-Runis/mercurius/releases/tag/v1.3.3+79)
> - 画像の読み込み方法を修正しました。日記に再挿入してください。画廊の画像は消えません
> - [v0.5.0+65](https://github.com/Cierra-Runis/mercurius/releases/tag/v0.5.0+65)
> - isar データベースの保存場所が変更され、エクスポート機能を使用してログを再インポートする必要があります
> - [v0.3.0+59](https://github.com/Cierra-Runis/mercurius/releases/tag/v0.3.0+59)
Expand Down
2 changes: 2 additions & 0 deletions lib/pages/mercurius/mercurius_gallery_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class MercuriusGalleryPage extends ConsumerWidget {
}

List<FileSystemEntity> fileSystemEntities = snapshot.data!;
final height = MediaQuery.sizeOf(context).width / 2;

return WaterfallFlow.builder(
cacheExtent: 1000,
Expand All @@ -40,6 +41,7 @@ class MercuriusGalleryPage extends ConsumerWidget {
itemCount: fileSystemEntities.length,
itemBuilder: (context, index) => MercuriusGalleryCardWidget(
readOnly: readOnly,
height: height,
fileSystemEntity: fileSystemEntities[index],
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,21 @@ class DiaryEditorToolbarImageButtonWidget extends QuillIconButton {
if (Platform.isAndroid) {
await File(sourceFilePath).delete();
}
_insertImage(controller, targetFilePath);
_insertImage(controller, pickedFile.name);
}
break;
case false:
if (context.mounted) {
String? targetFilePath = await Navigator.push(
String? filename = await Navigator.push(
context,
CupertinoPageRoute(
builder: (context) => const MercuriusGalleryPage(
readOnly: true,
),
),
);
if (targetFilePath != null) {
_insertImage(controller, targetFilePath);
if (filename != null) {
_insertImage(controller, filename);
}
}
break;
Expand All @@ -86,8 +86,8 @@ class DiaryEditorToolbarImageButtonWidget extends QuillIconButton {
}
}

static void _insertImage(QuillController controller, String targetFilePath) {
Mercurius.printLog(targetFilePath);
static void _insertImage(QuillController controller, String filename) {
Mercurius.printLog(filename);

controller.document.insert(controller.selection.extentOffset, '\n');
controller.updateSelection(
Expand All @@ -99,7 +99,7 @@ class DiaryEditorToolbarImageButtonWidget extends QuillIconButton {

controller.document.insert(
controller.selection.extentOffset,
DiaryImageBlockEmbed(targetFilePath),
DiaryImageBlockEmbed(filename),
);

controller.updateSelection(
Expand Down
33 changes: 26 additions & 7 deletions lib/widgets/diary/image/diary_image_block_embed_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,33 @@ class DiaryImageEmbedBuilderWidget extends EmbedBuilder {
}
}

File file = File(node.value.data);
Future<File> getImageFile(String filename) async {
Directory? directory;

return Material(
child: InkWell(
borderRadius: BorderRadius.circular(16.0),
onTap: () => onInkWellTap(file, readOnly),
child: getInkWellChild(file),
),
if (Platform.isAndroid) {
directory = await getExternalStorageDirectory();
} else if (Platform.isWindows) {
directory = await getApplicationSupportDirectory();
} else {
throw Exception('不支持的平台');
}
return File('${directory!.path}/image/${node.value.data}');
}

return FutureBuilder<File>(
future: getImageFile(node.value.data),
builder: (context, snapshot) {
if (snapshot.hasData) {
return Material(
child: InkWell(
borderRadius: BorderRadius.circular(16.0),
onTap: () => onInkWellTap(snapshot.data!, readOnly),
child: getInkWellChild(snapshot.data!),
),
);
}
return Container();
},
);
}
}
11 changes: 7 additions & 4 deletions lib/widgets/mercurius/mercurius_gallery_card_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ class MercuriusGalleryCardWidget extends StatelessWidget {
const MercuriusGalleryCardWidget({
super.key,
required this.fileSystemEntity,
required this.height,
this.readOnly = false,
});

final FileSystemEntity fileSystemEntity;
final bool readOnly;
final double height;

@override
Widget build(BuildContext context) {
Expand All @@ -18,10 +20,10 @@ class MercuriusGalleryCardWidget extends StatelessWidget {
clipBehavior: Clip.antiAlias,
child: InkWell(
onTap: readOnly
? () {
Navigator.of(context).pop(fileSystemEntity.path);
}
: () async => await showDialog(
? () => Navigator.of(context).pop(
fileSystemEntity.path.split('/').last,
)
: () => showDialog(
context: context,
builder: (context) => DiaryImageViewWidget(
imageUrl: fileSystemEntity.path,
Expand All @@ -31,6 +33,7 @@ class MercuriusGalleryCardWidget extends StatelessWidget {
children: [
Image.file(
File(fileSystemEntity.path),
height: height,
errorBuilder: (context, error, stackTrace) {
return MercuriusFadeShimmerWidget(
radius: 16,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: For mercurius.

publish_to: "none"

version: 1.3.2+78
version: 1.3.3+79

environment:
sdk: ">=3.0.0 <4.0.0"
Expand Down

0 comments on commit 3b3e4b0

Please sign in to comment.