diff --git a/CHANGELOG.md b/CHANGELOG.md index 63fc69d9d96b..967e56382817 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,30 @@ # Changelog - + + +## 2.0.0-beta.14 (2023-11-04) + +* Add cursor to path eraser +* Add scrollbar to recent files +* Add recent colors to color picker +* Add version to web +* Add eye dropper +* Add copy on click for versions in settings dialog ([#519](https://github.com/LinwoodDev/Butterfly/issues/519)) +* Add scaling to markdown and text renderers ([#520](https://github.com/LinwoodDev/Butterfly/issues/520)) +* Show remote on hover in recent files +* Improve action buttons in add dialog +* Improve color picker dialog +* Fix invalidation of selection when transforming ([#517](https://github.com/LinwoodDev/Butterfly/issues/517)) +* Fix folder creation ([#513](https://github.com/LinwoodDev/Butterfly/issues/513)) +* Fix locale spacing +* Fix pack updating +* Fix pdf operations on web +* Fix exporting whole directory ([#523](https://github.com/LinwoodDev/Butterfly/issues/523)) +* Set full screen tool to action tool +* Fix saving files in local external directory +* Fixing missing saving of pdf quality and platform theme settings + +View all changes in the blog: https://linwood.dev/butterfly/2.0.0-beta.14 ## 2.0.0-beta.13 (2023-10-29) diff --git a/api/pubspec.yaml b/api/pubspec.yaml index 7beb7c02f1a7..8ef6b2e4a0d8 100644 --- a/api/pubspec.yaml +++ b/api/pubspec.yaml @@ -1,6 +1,6 @@ name: butterfly_api description: The Linwood Butterfly API -version: 2.0.0-beta.14 +version: 2.0.0-beta.15 environment: sdk: '>=3.0.0 <4.0.0' diff --git a/app/AppImageBuilder.yml b/app/AppImageBuilder.yml index 45556cbfb086..5f291b7e9800 100644 --- a/app/AppImageBuilder.yml +++ b/app/AppImageBuilder.yml @@ -11,7 +11,7 @@ AppDir: id: dev.linwood.butterfly name: Linwood Butterfly icon: dev.linwood.butterfly - version: 2.0.0-beta.14 + version: 2.0.0-beta.15 exec: butterfly exec_args: $@ apt: diff --git a/app/lib/actions/new.dart b/app/lib/actions/new.dart index 50c978badf3e..f3e865419cb2 100644 --- a/app/lib/actions/new.dart +++ b/app/lib/actions/new.dart @@ -1,14 +1,11 @@ import 'package:butterfly/bloc/document_bloc.dart'; import 'package:butterfly/cubits/settings.dart'; -import 'package:butterfly/cubits/transform.dart'; import 'package:butterfly_api/butterfly_api.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; -import '../cubits/current_index.dart'; import '../dialogs/template.dart'; -import '../models/defaults.dart'; class NewIntent extends Intent { final BuildContext context; @@ -26,42 +23,32 @@ class NewAction extends Action { final bloc = context.read(); final settingsCubit = context.read(); final settings = settingsCubit.state; - final transformCubit = context.read(); - final currentIndexCubit = context.read(); - final router = GoRouter.of(context); - var path = ''; - var document = DocumentDefaults.createDocument(); - NoteData? template; if (intent.fromTemplate && context.mounted) { - var state = bloc.state; - if (state is DocumentLoadSuccess) document = state.data; - template = await showDialog( - context: context, - builder: (context) => MultiBlocProvider( - providers: [ - BlocProvider.value(value: bloc), - BlocProvider.value(value: transformCubit), - BlocProvider.value(value: currentIndexCubit), - ], - child: TemplateDialog( - currentDocument: document, - ), - )); - if (template == null) return; - } else { - final templateSystem = settings.getDefaultTemplateFileSystem(); - template = await templateSystem.getDefaultTemplate( - templateSystem.remote?.defaultTemplate ?? settings.defaultTemplate, + await showDialog( + context: context, + builder: (context) => TemplateDialog(bloc: bloc), ); + return; } - if (template != null) { - document = template.createDocument(); - final metadata = document.getMetadata(); - if (metadata != null) { - path = metadata.directory; - } + final templateSystem = settings.getDefaultTemplateFileSystem(); + final template = await templateSystem.getDefaultTemplate( + templateSystem.remote?.defaultTemplate ?? settings.defaultTemplate, + ); + openNewDocument(context, template); + } +} + +void openNewDocument(BuildContext context, + [NoteData? template, String? remote]) { + NoteData? document; + String? path; + if (template != null) { + document = template.createDocument(); + final metadata = document.getMetadata(); + if (metadata != null) { + path = metadata.directory; } - router.pushReplacementNamed('new', - queryParameters: {'path': path}, extra: document); } + GoRouter.of(context).pushReplacementNamed('new', + queryParameters: {'path': path, 'remote': remote}, extra: document); } diff --git a/app/lib/dialogs/template.dart b/app/lib/dialogs/template.dart index 7647176bfdae..c3a91012547a 100644 --- a/app/lib/dialogs/template.dart +++ b/app/lib/dialogs/template.dart @@ -1,3 +1,4 @@ +import 'package:butterfly/actions/new.dart'; import 'package:butterfly/cubits/settings.dart'; import 'package:butterfly/widgets/remote_button.dart'; import 'package:butterfly_api/butterfly_api.dart'; @@ -13,8 +14,8 @@ import '../widgets/editable_list_tile.dart'; import 'delete.dart'; class TemplateDialog extends StatefulWidget { - final NoteData? currentDocument; - const TemplateDialog({super.key, required this.currentDocument}); + final DocumentBloc? bloc; + const TemplateDialog({super.key, this.bloc}); @override State createState() => _TemplateDialogState(); @@ -113,12 +114,11 @@ class _TemplateDialogState extends State { ); }, ), - ...widget.currentDocument == null + ...widget.bloc == null ? [] : [ IconButton( - onPressed: () => - _showCreateDialog(widget.currentDocument!), + onPressed: () => _showCreateDialog(widget.bloc!), tooltip: AppLocalizations.of(context).create, icon: const PhosphorIcon(PhosphorIconsLight.plus), ) @@ -175,7 +175,7 @@ class _TemplateDialogState extends State { ))); } - Future _showCreateDialog(NoteData document) { + Future _showCreateDialog(DocumentBloc bloc) { final directoryController = TextEditingController(); return showDialog( context: context, @@ -207,10 +207,10 @@ class _TemplateDialogState extends State { ElevatedButton( child: Text(AppLocalizations.of(context).create), onPressed: () async { - this.context.read().add(TemplateCreated( - directoryController.text, - _fileSystem.remote?.identifier, - )); + bloc.add(TemplateCreated( + directoryController.text, + _fileSystem.remote?.identifier, + )); Navigator.of(context).pop(); load(); setState(() {}); @@ -293,7 +293,8 @@ class _TemplateItem extends StatelessWidget { }, ), ], - onTap: () => Navigator.of(context).pop(template), + onTap: () => + openNewDocument(context, template, fileSystem.remote?.identifier), ); } } diff --git a/app/lib/main.dart b/app/lib/main.dart index 4dc4e9256114..721583cb599b 100644 --- a/app/lib/main.dart +++ b/app/lib/main.dart @@ -231,7 +231,8 @@ class ButterflyApp extends StatelessWidget { return ProjectPage( data: state.extra, location: AssetLocation( - remote: defaultRemote, + remote: state.uri.queryParameters['remote'] ?? + defaultRemote, path: state.uri.queryParameters['path'] ?? '', ), ); diff --git a/app/lib/settings/data.dart b/app/lib/settings/data.dart index 812b1762a059..078d49c9d77d 100644 --- a/app/lib/settings/data.dart +++ b/app/lib/settings/data.dart @@ -3,6 +3,7 @@ import 'package:butterfly/api/file_system/file_system_io.dart'; import 'package:butterfly/api/save_data.dart'; import 'package:butterfly/bloc/document_bloc.dart'; import 'package:butterfly/cubits/settings.dart'; +import 'package:butterfly/dialogs/template.dart'; import 'package:butterfly/widgets/window.dart'; import 'package:file_picker/file_picker.dart'; import 'package:flutter/foundation.dart'; @@ -85,27 +86,33 @@ class _DataSettingsPageState extends State { ) : null, ), + ListTile( + title: Text(AppLocalizations.of(context).templates), + leading: const PhosphorIcon(PhosphorIconsLight.file), + onTap: () => showDialog( + context: context, + builder: (ctx) => const TemplateDialog(), + ), + ), ListTile( title: Text(AppLocalizations.of(context).packs), leading: const PhosphorIcon(PhosphorIconsLight.package), - onTap: () { - showDialog( - context: context, - builder: (ctx) => MultiBlocProvider( - providers: [ - BlocProvider.value( - value: context.read()), - BlocProvider( - lazy: false, - create: (ctx) => DocumentBloc.placeholder( - context.read()), - ), - ], - child: const PacksDialog(globalOnly: true), - ), - ); - }, + onTap: () => showDialog( + context: context, + builder: (ctx) => MultiBlocProvider( + providers: [ + BlocProvider.value( + value: context.read()), + BlocProvider( + lazy: false, + create: (ctx) => DocumentBloc.placeholder( + context.read()), + ), + ], + child: const PacksDialog(globalOnly: true), + ), + ), ), ListTile( title: Text(AppLocalizations.of(context).export), diff --git a/app/lib/views/home.dart b/app/lib/views/home.dart index 3e206630f26d..ed1be872037b 100644 --- a/app/lib/views/home.dart +++ b/app/lib/views/home.dart @@ -1,3 +1,4 @@ +import 'package:butterfly/actions/new.dart'; import 'package:butterfly/actions/settings.dart'; import 'package:butterfly/api/file_system/file_system.dart'; import 'package:butterfly/api/open.dart'; @@ -8,7 +9,6 @@ import 'package:butterfly_api/butterfly_api.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:go_router/go_router.dart'; import 'package:phosphor_flutter/phosphor_flutter.dart'; import '../api/open_release_notes.dart'; @@ -510,9 +510,8 @@ class _QuickstartHomeViewState extends State<_QuickstartHomeView> { metadata: metadata, thumbnail: thumbnail, onTap: () async { - GoRouter.of(context).pushReplacementNamed('new', - queryParameters: {'path': metadata.directory}, - extra: e.createDocument().save()); + openNewDocument( + context, e, widget.remote?.identifier); }, ); }, diff --git a/app/linux/debian/DEBIAN/control b/app/linux/debian/DEBIAN/control index bb8d9278e034..9ca733b9dd2f 100644 --- a/app/linux/debian/DEBIAN/control +++ b/app/linux/debian/DEBIAN/control @@ -1,5 +1,5 @@ Package: linwood-butterfly -Version: 2.0.0-beta.14 +Version: 2.0.0-beta.15 Section: base Priority: optional Homepage: https://github.com/LinwoodDev/butterfly diff --git a/app/pubspec.lock b/app/pubspec.lock index fd747bf0b86a..6c72b1fe6d60 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -159,7 +159,7 @@ packages: path: "../api" relative: true source: path - version: "2.0.0-beta.14" + version: "2.0.0-beta.15" camera: dependency: "direct main" description: diff --git a/app/pubspec.yaml b/app/pubspec.yaml index 54f9f572b430..83a33d6690bb 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -13,7 +13,7 @@ publish_to: none # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 2.0.0-beta.14+78 +version: 2.0.0-beta.15+79 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/fastlane/metadata/android/en-US/changelogs/79.txt b/fastlane/metadata/android/en-US/changelogs/79.txt new file mode 100644 index 000000000000..f027a4866586 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/79.txt @@ -0,0 +1,3 @@ +* Add templates to data settings + +View all changes in the blog: https://linwood.dev/butterfly/2.0.0-beta.15 \ No newline at end of file