From 4b6111fd48368d603aa0263c214d0cf42856640d Mon Sep 17 00:00:00 2001 From: CodeDoctorDE Date: Mon, 6 Jan 2025 12:19:09 +0100 Subject: [PATCH 1/6] Fix default stroke width, closes #779 --- app/lib/selections/properties/path.dart | 2 +- app/lib/selections/tools/laser.dart | 2 +- metadata/en-US/changelogs/127.txt | 27 +++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 metadata/en-US/changelogs/127.txt diff --git a/app/lib/selections/properties/path.dart b/app/lib/selections/properties/path.dart index 0a993c29785a..dcad23b3d400 100644 --- a/app/lib/selections/properties/path.dart +++ b/app/lib/selections/properties/path.dart @@ -13,7 +13,7 @@ mixin PathPropertySelection on PropertySelection { value: property.strokeWidth, min: 0.1, max: 70, - defaultValue: 25, + defaultValue: 5, onChangeEnd: (value) => onChanged( (property as dynamic).copyWith(strokeWidth: value) as T)), ExactSlider( diff --git a/app/lib/selections/tools/laser.dart b/app/lib/selections/tools/laser.dart index 86086ee088df..7086c3b9a794 100644 --- a/app/lib/selections/tools/laser.dart +++ b/app/lib/selections/tools/laser.dart @@ -12,7 +12,7 @@ class LaserToolSelection extends ToolSelection { value: selected.first.strokeWidth, min: 0, max: 70, - defaultValue: 25, + defaultValue: 5, onChangeEnd: (value) => update( context, selected.map((e) => e.copyWith(strokeWidth: value)).toList(), diff --git a/metadata/en-US/changelogs/127.txt b/metadata/en-US/changelogs/127.txt new file mode 100644 index 000000000000..626e0b490457 --- /dev/null +++ b/metadata/en-US/changelogs/127.txt @@ -0,0 +1,27 @@ +* Redesign mobile home page + * Use tabs for easier navigation + * Dedicated files view + * Move settings into a tab +* Add toggleable tools +* Add palette name and pack to color picker dialog +* Add stroke width slider to pattern texture +* Move ruler into own tool + * Add color property + * Add size property +* Move grid into own tool + * Add offset property +* Move background button from project settings to top corner button +* Add password protected notes ([#771](https://github.com/LinwoodDev/Butterfly/issues/771)) +* Add option to import svg as text ([#596](https://github.com/LinwoodDev/Butterfly/issues/596)) +* Improve grid files view +* Improve slider and double input list tiles +* Change aspect ratio to use 3 fraction digits for area +* Fix undo/redo tools not showing status correctly +* Fix grid not working correctly +* Fix capture thumbnail uses wrong position +* Fix zoom slider is not centered +* Fix shape detection list tile not clickable +* Fix svg export shows wrong initial preset +* Fix default stroke width ([#779](https://github.com/LinwoodDev/Butterfly/issues/779)) + +Read more here: https://linwood.dev/butterfly/2.3.0-beta.0 \ No newline at end of file From ca5628482666a94727fec02ee160853dd367316d Mon Sep 17 00:00:00 2001 From: CodeDoctorDE Date: Sat, 4 Jan 2025 15:56:33 +0100 Subject: [PATCH 2/6] Fix shape detection list tile not clickable --- app/lib/dialogs/background/dialog.dart | 2 +- app/lib/dialogs/constraints.dart | 4 +--- app/lib/dialogs/sync.dart | 1 + app/lib/selections/tools/pen.dart | 1 + 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/lib/dialogs/background/dialog.dart b/app/lib/dialogs/background/dialog.dart index 186b05a347ec..32dc27b032d2 100644 --- a/app/lib/dialogs/background/dialog.dart +++ b/app/lib/dialogs/background/dialog.dart @@ -104,7 +104,7 @@ class BackgroundDialog extends StatelessWidget { onPressed: () => Navigator.of(context).pop(), ), ElevatedButton( - child: Text(AppLocalizations.of(context).ok), + child: Text(AppLocalizations.of(context).save), onPressed: () { context.read().add(DocumentBackgroundsChanged( [if (background != null) background!])); diff --git a/app/lib/dialogs/constraints.dart b/app/lib/dialogs/constraints.dart index 86c2c9996578..1facb32815d8 100644 --- a/app/lib/dialogs/constraints.dart +++ b/app/lib/dialogs/constraints.dart @@ -67,14 +67,12 @@ class _ConstraintsViewState extends State { children: [ ExpansionPanel( isExpanded: opened, + canTapOnHeader: true, headerBuilder: (context, isExpanded) => Wrap( children: [ ListTile( title: Text(AppLocalizations.of(context).constraints), leading: const PhosphorIcon(PhosphorIconsLight.selection), - onTap: () => setState(() { - opened = !isExpanded; - }), trailing: DropdownMenu( dropdownMenuEntries: all.entries .map((e) => DropdownMenuEntry( diff --git a/app/lib/dialogs/sync.dart b/app/lib/dialogs/sync.dart index ae2a7608d0c4..5adc83d65192 100644 --- a/app/lib/dialogs/sync.dart +++ b/app/lib/dialogs/sync.dart @@ -61,6 +61,7 @@ class _SyncDialogState extends State { children: [ ...service.syncs.asMap().entries.map((entry) => ExpansionPanel( + canTapOnHeader: true, isExpanded: _openedPanels.contains(entry.key), headerBuilder: (context, isExpanded) => ListTile( diff --git a/app/lib/selections/tools/pen.dart b/app/lib/selections/tools/pen.dart index 8efe4e266f57..cada4649385a 100644 --- a/app/lib/selections/tools/pen.dart +++ b/app/lib/selections/tools/pen.dart @@ -54,6 +54,7 @@ class __ShapeDetectionViewState extends State<_ShapeDetectionView> { }, children: [ ExpansionPanel( + canTapOnHeader: true, headerBuilder: (BuildContext context, bool isExpanded) { return ListTile( title: Text(AppLocalizations.of(context).shapeDetection), From ac4c2872d3e94ecd525f3ebb14abc27961771b62 Mon Sep 17 00:00:00 2001 From: CodeDoctorDE Date: Thu, 2 Jan 2025 18:26:42 +0100 Subject: [PATCH 3/6] Fix zoom slider is not centered --- app/lib/cubits/current_index.dart | 1 + app/lib/models/viewport.dart | 14 +++- app/lib/selections/utilities.dart | 18 ++-- app/lib/views/zoom.dart | 6 +- app/pubspec.lock | 4 +- docs/package.json | 2 +- docs/pnpm-lock.yaml | 131 +++++++++++++++++------------- 7 files changed, 102 insertions(+), 74 deletions(-) diff --git a/app/lib/cubits/current_index.dart b/app/lib/cubits/current_index.dart index a5b198f13c29..d842fb7567a1 100644 --- a/app/lib/cubits/current_index.dart +++ b/app/lib/cubits/current_index.dart @@ -649,6 +649,7 @@ class CurrentIndexCubit extends Cubit { height: size.height.ceil(), width: size.width.ceil(), pixelRatio: ratio, + resolution: resolution, scale: transform.size, x: renderTransform.position.dx, y: renderTransform.position.dy, diff --git a/app/lib/models/viewport.dart b/app/lib/models/viewport.dart index 06ab26f6bccd..4d111075b134 100644 --- a/app/lib/models/viewport.dart +++ b/app/lib/models/viewport.dart @@ -1,6 +1,7 @@ import 'dart:math'; import 'dart:ui' as ui; +import 'package:butterfly/cubits/settings.dart'; import 'package:butterfly/renderers/renderer.dart'; import 'package:butterfly_api/butterfly_api.dart'; import 'package:equatable/equatable.dart'; @@ -18,6 +19,7 @@ class CameraViewport extends Equatable { final double pixelRatio; final double scale; final double x, y; + final RenderResolution resolution; const CameraViewport.unbaked(this.utilities, [this.backgrounds = const [], @@ -33,7 +35,8 @@ class CameraViewport extends Equatable { pixelRatio = 1, x = 0, y = 0, - visibleElements = visibleElements ?? unbakedElements; + visibleElements = visibleElements ?? unbakedElements, + resolution = RenderResolution.performance; const CameraViewport.baked(this.utilities, {this.backgrounds = const [], @@ -48,6 +51,7 @@ class CameraViewport extends Equatable { required this.visibleElements, this.scale = 1, this.x = 0, + required this.resolution, this.y = 0}); get center => null; @@ -62,6 +66,8 @@ class CameraViewport extends Equatable { ui.Rect toRect() => toOffset() & toSize(true); + ui.Size toRealSize() => toSize() / resolution.multiplier; + Area toArea() => Area( name: '', position: toPoint(), @@ -95,6 +101,7 @@ class CameraViewport extends Equatable { y: y, aboveLayerImage: aboveLayerImage, belowLayerImage: belowLayerImage, + resolution: resolution, ); CameraViewport unbake({ @@ -127,6 +134,7 @@ class CameraViewport extends Equatable { double scale = 1, double x = 0, double y = 0, + required RenderResolution resolution, }) => CameraViewport.baked( utilities, @@ -143,6 +151,7 @@ class CameraViewport extends Equatable { visibleElements: visibleElements, aboveLayerImage: aboveLayerImage, belowLayerImage: belowLayerImage, + resolution: resolution, ); CameraViewport withoutLayers() => CameraViewport.baked( @@ -160,6 +169,7 @@ class CameraViewport extends Equatable { visibleElements: visibleElements, aboveLayerImage: null, belowLayerImage: null, + resolution: resolution, ); CameraViewport withBackgrounds(List> backgrounds) => @@ -196,6 +206,7 @@ class CameraViewport extends Equatable { visibleElements: visibleElements, aboveLayerImage: aboveLayerImage, belowLayerImage: belowLayerImage, + resolution: resolution, ); @override @@ -214,5 +225,6 @@ class CameraViewport extends Equatable { utilities, aboveLayerImage, belowLayerImage, + resolution, ]; } diff --git a/app/lib/selections/utilities.dart b/app/lib/selections/utilities.dart index 68d3bc4b86d6..23b87cf71985 100644 --- a/app/lib/selections/utilities.dart +++ b/app/lib/selections/utilities.dart @@ -144,25 +144,23 @@ class _UtilitiesViewState extends State<_UtilitiesView> onPressed: () async { final viewport = state.currentIndexCubit.state.cameraViewport; - final width = viewport.width?.toDouble() ?? - kThumbnailWidth.toDouble(); - final realHeight = viewport.height?.toDouble() ?? - kThumbnailHeight.toDouble(); + final size = viewport.toRealSize(); final height = - width * kThumbnailHeight / kThumbnailWidth; - final heightOffset = (height - realHeight) / 2; - final quality = kThumbnailWidth / width; + size.width * kThumbnailHeight / kThumbnailWidth; + final heightOffset = (size.height - height) / 2; + final quality = kThumbnailWidth / size.width; final thumbnail = await state.currentIndexCubit.render( state.data, state.page, state.info, ImageExportOptions( - width: width, + width: size.width, height: height, quality: quality, scale: viewport.scale, - x: viewport.x, - y: viewport.y + heightOffset, + x: viewport.x + size.width / viewport.scale, + y: viewport.y + + (heightOffset + size.height) / viewport.scale, ), ); if (thumbnail == null) return; diff --git a/app/lib/views/zoom.dart b/app/lib/views/zoom.dart index 24b9b9da11c9..b633c3c0b1f0 100644 --- a/app/lib/views/zoom.dart +++ b/app/lib/views/zoom.dart @@ -86,10 +86,10 @@ class _ZoomViewState extends State with TickerProviderStateMixin { if (state is! DocumentLoaded) { return; } - final viewport = currentIndex.cameraViewport; + final size = currentIndex.cameraViewport.toRealSize(); final center = Offset( - (viewport.width ?? 0) / 2, - (viewport.height ?? 0) / 2, + size.width / 2, + size.height / 2, ); currentIndex.transformCubit.size(value, center); if (bake) { diff --git a/app/pubspec.lock b/app/pubspec.lock index b20bbd249bc0..1bc7bd5fa724 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -1225,10 +1225,10 @@ packages: dependency: "direct main" description: name: shared_preferences - sha256: "3c7e73920c694a436afaf65ab60ce3453d91f84208d761fbd83fc21182134d93" + sha256: a752ce92ea7540fc35a0d19722816e04d0e72828a4200e83a98cf1a1eb524c9a url: "https://pub.dev" source: hosted - version: "2.3.4" + version: "2.3.5" shared_preferences_android: dependency: transitive description: diff --git a/docs/package.json b/docs/package.json index bf9d8582306a..eac0406acb4c 100644 --- a/docs/package.json +++ b/docs/package.json @@ -16,7 +16,7 @@ "@phosphor-icons/react": "^2.1.7", "@types/react": "^19.0.2", "@types/react-dom": "^19.0.2", - "astro": "^5.1.1", + "astro": "^5.1.2", "react": "^19.0.0", "react-dom": "^19.0.0", "remark-gemoji": "^8.0.0", diff --git a/docs/pnpm-lock.yaml b/docs/pnpm-lock.yaml index 6bd9750c648e..22cecae8a7ae 100644 --- a/docs/pnpm-lock.yaml +++ b/docs/pnpm-lock.yaml @@ -16,7 +16,7 @@ importers: version: 4.1.2(@types/react-dom@19.0.2(@types/react@19.0.2))(@types/react@19.0.2)(jiti@2.4.2)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0)(terser@5.37.0)(yaml@2.6.1) '@astrojs/starlight': specifier: ^0.30.3 - version: 0.30.3(astro@5.1.1(jiti@2.4.2)(rollup@4.29.1)(sass@1.83.0)(terser@5.37.0)(typescript@5.7.2)(yaml@2.6.1)) + version: 0.30.3(astro@5.1.2(jiti@2.4.2)(rollup@4.29.1)(sass@1.83.0)(terser@5.37.0)(typescript@5.7.2)(yaml@2.6.1)) '@phosphor-icons/react': specifier: ^2.1.7 version: 2.1.7(react-dom@19.0.0(react@19.0.0))(react@19.0.0) @@ -27,8 +27,8 @@ importers: specifier: ^19.0.2 version: 19.0.2(@types/react@19.0.2) astro: - specifier: ^5.1.1 - version: 5.1.1(jiti@2.4.2)(rollup@4.29.1)(sass@1.83.0)(terser@5.37.0)(typescript@5.7.2)(yaml@2.6.1) + specifier: ^5.1.2 + version: 5.1.2(jiti@2.4.2)(rollup@4.29.1)(sass@1.83.0)(terser@5.37.0)(typescript@5.7.2)(yaml@2.6.1) react: specifier: ^19.0.0 version: 19.0.0 @@ -895,17 +895,23 @@ packages: cpu: [x64] os: [win32] - '@shikijs/core@1.24.4': - resolution: {integrity: sha512-jjLsld+xEEGYlxAXDyGwWsKJ1sw5Pc1pnp4ai2ORpjx2UX08YYTC0NNqQYO1PaghYaR+PvgMOGuvzw2he9sk0Q==} + '@shikijs/core@1.25.1': + resolution: {integrity: sha512-0j5k3ZkLTQViOuNzPVyWGoW1zgH3kiFdUT/JOCkTm7TU74mz+dF+NID+YoiCBzHQxgsDpcGYPjKDJRcuVLSt4A==} - '@shikijs/engine-javascript@1.24.4': - resolution: {integrity: sha512-TClaQOLvo9WEMJv6GoUsykQ6QdynuKszuORFWCke8qvi6PeLm7FcD9+7y45UenysxEWYpDL5KJaVXTngTE+2BA==} + '@shikijs/engine-javascript@1.25.1': + resolution: {integrity: sha512-zQ7UWKnRCfD/Q1M+XOSyjsbhpE0qv8LUnmn82HYCeOsgAHgUZGEDIQ63bbuK3kU5sQg+2CtI+dPfOqD/mjSY9w==} - '@shikijs/engine-oniguruma@1.24.4': - resolution: {integrity: sha512-Do2ry6flp2HWdvpj2XOwwa0ljZBRy15HKZITzPcNIBOGSeprnA8gOooA/bLsSPuy8aJBa+Q/r34dMmC3KNL/zw==} + '@shikijs/engine-oniguruma@1.25.1': + resolution: {integrity: sha512-iKPMh3H+0USHtWfZ1irfMTH6tGmIUFSnqt3E2K8BgI1VEsqiPh0RYkG2WTwzNiM1/WHN4FzYx/nrKR7PDHiRyw==} - '@shikijs/types@1.24.4': - resolution: {integrity: sha512-0r0XU7Eaow0PuDxuWC1bVqmWCgm3XqizIaT7SM42K03vc69LGooT0U8ccSR44xP/hGlNx4FKhtYpV+BU6aaKAA==} + '@shikijs/langs@1.25.1': + resolution: {integrity: sha512-hdYjq9aRJplAzGe2qF51PR9IDgEoyGb4IkXvr3Ts6lEdg4Z8M/kdknKRo2EIuv3IR/aKkJXTlBQRM+wr3t20Ew==} + + '@shikijs/themes@1.25.1': + resolution: {integrity: sha512-JO0lDn4LgGqg5QKvgich5ScUmC2okK+LxM9a3iLUH7YMeI2c8UGXThuJv6sZduS7pdJbYQHPrvWq9t/V4GhpbQ==} + + '@shikijs/types@1.25.1': + resolution: {integrity: sha512-dceqFUoO95eY4tpOj3OGq8wE8EgJ4ey6Me1HQEu5UbwIYszFndEll/bjlB8Kp9wl4fx3uM7n4+y9XCYuDBmcXA==} '@shikijs/vscode-textmate@9.3.1': resolution: {integrity: sha512-79QfK1393x9Ho60QFyLti+QfdJzRQCVLFb97kOIV7Eo9vQU/roINgk7m24uv0a7AUvN//RDH36FLjjK48v0s9g==} @@ -1071,8 +1077,8 @@ packages: peerDependencies: astro: ^4.0.0-beta || ^5.0.0-beta || ^3.3.0 - astro@5.1.1: - resolution: {integrity: sha512-prpWC2PRs4P3FKQg6gZaU+VNMqbZi5pDvORGB2nrjfRjkrvF6/l4BqhvkJ6YQ0Ohm5rIMVz8ljgaRI77mLHbwg==} + astro@5.1.2: + resolution: {integrity: sha512-+U5lXPEJZ6cQx0botGbPhzN6XGWRgDtXgy/RUkpTmUj18LW6pbzYo0O0k3hFWOazlI039bZ+4P2e/oSNlKzm0Q==} engines: {node: ^18.17.1 || ^20.3.0 || >=22.0.0, npm: '>=9.6.5', pnpm: '>=7.1.0'} hasBin: true @@ -1935,8 +1941,8 @@ packages: resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} engines: {node: '>=12'} - oniguruma-to-es@0.8.1: - resolution: {integrity: sha512-dekySTEvCxCj0IgKcA2uUCO/e4ArsqpucDPcX26w9ajx+DvMWLc5eZeJaRQkd7oC/+rwif5gnT900tA34uN9Zw==} + oniguruma-to-es@0.10.0: + resolution: {integrity: sha512-zapyOUOCJxt+xhiNRPPMtfJkHGsZ98HHB9qJEkdT8BGytO/+kpe4m1Ngf0MzbzTmhacn11w9yGeDP6tzDhnCdg==} p-limit@2.3.0: resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} @@ -2091,14 +2097,14 @@ packages: regenerator-runtime@0.14.1: resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} - regex-recursion@5.0.0: - resolution: {integrity: sha512-UwyOqeobrCCqTXPcsSqH4gDhOjD5cI/b8kjngWgSZbxYh5yVjAwTjO5+hAuPRNiuR70+5RlWSs+U9PVcVcW9Lw==} + regex-recursion@5.1.1: + resolution: {integrity: sha512-ae7SBCbzVNrIjgSbh7wMznPcQel1DNlDtzensnFxpiNpXt1U2ju/bHugH422r+4LAVS1FpW1YCwilmnNsjum9w==} regex-utilities@2.3.0: resolution: {integrity: sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng==} - regex@5.0.2: - resolution: {integrity: sha512-/pczGbKIQgfTMRV0XjABvc5RzLqQmwqxLHdQao2RTXPk+pmTXB2P0IaUHYdYyk412YLwUIkaeMd5T+RzVgTqnQ==} + regex@5.1.1: + resolution: {integrity: sha512-dN5I359AVGPnwzJm2jN1k0W9LPZ+ePvoOeVMMfqIMFz53sSwXkxaJoxr50ptnsC771lK95BnTrVSZxq0b9yCGw==} rehype-expressive-code@0.38.3: resolution: {integrity: sha512-RYSSDkMBikoTbycZPkcWp6ELneANT4eTpND1DSRJ6nI2eVFUwTBDCvE2vO6jOOTaavwnPiydi4i/87NRyjpdOA==} @@ -2220,8 +2226,8 @@ packages: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} - shiki@1.24.4: - resolution: {integrity: sha512-aVGSFAOAr1v26Hh/+GBIsRVDWJ583XYV7CuNURKRWh9gpGv4OdbisZGq96B9arMYTZhTQkmRF5BrShOSTvNqhw==} + shiki@1.25.1: + resolution: {integrity: sha512-/1boRvNYwRW3GLG9Y6dXdnZ/Ha+J5T/5y3hV7TGQUcDSBM185D3FCbXlz2eTGNKG2iWCbWqo+P0yhGKZ4/CUrw==} signal-exit@4.1.0: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} @@ -2526,8 +2532,8 @@ packages: yaml: optional: true - vitefu@1.0.4: - resolution: {integrity: sha512-y6zEE3PQf6uu/Mt6DTJ9ih+kyJLr4XcSgHR2zUkM8SWDhuixEJxfJ6CZGMHh1Ec3vPLoEA0IHU5oWzVqw8ulow==} + vitefu@1.0.5: + resolution: {integrity: sha512-h4Vflt9gxODPFNGPwp4zAMZRpZR7eslzwH2c5hn5kNZ5rhnKyRJ50U+yGCdc2IRaBs8O4haIgLNGrV5CrpMsCA==} peerDependencies: vite: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 peerDependenciesMeta: @@ -2788,7 +2794,7 @@ snapshots: remark-parse: 11.0.0 remark-rehype: 11.1.1 remark-smartypants: 3.0.2 - shiki: 1.24.4 + shiki: 1.25.1 unified: 11.0.5 unist-util-remove-position: 5.0.0 unist-util-visit: 5.0.0 @@ -2797,12 +2803,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@astrojs/mdx@4.0.3(astro@5.1.1(jiti@2.4.2)(rollup@4.29.1)(sass@1.83.0)(terser@5.37.0)(typescript@5.7.2)(yaml@2.6.1))': + '@astrojs/mdx@4.0.3(astro@5.1.2(jiti@2.4.2)(rollup@4.29.1)(sass@1.83.0)(terser@5.37.0)(typescript@5.7.2)(yaml@2.6.1))': dependencies: '@astrojs/markdown-remark': 6.0.1 '@mdx-js/mdx': 3.1.0(acorn@8.14.0) acorn: 8.14.0 - astro: 5.1.1(jiti@2.4.2)(rollup@4.29.1)(sass@1.83.0)(terser@5.37.0)(typescript@5.7.2)(yaml@2.6.1) + astro: 5.1.2(jiti@2.4.2)(rollup@4.29.1)(sass@1.83.0)(terser@5.37.0)(typescript@5.7.2)(yaml@2.6.1) es-module-lexer: 1.5.4 estree-util-visit: 2.0.0 hast-util-to-html: 9.0.4 @@ -2849,16 +2855,16 @@ snapshots: stream-replace-string: 2.0.0 zod: 3.24.1 - '@astrojs/starlight@0.30.3(astro@5.1.1(jiti@2.4.2)(rollup@4.29.1)(sass@1.83.0)(terser@5.37.0)(typescript@5.7.2)(yaml@2.6.1))': + '@astrojs/starlight@0.30.3(astro@5.1.2(jiti@2.4.2)(rollup@4.29.1)(sass@1.83.0)(terser@5.37.0)(typescript@5.7.2)(yaml@2.6.1))': dependencies: - '@astrojs/mdx': 4.0.3(astro@5.1.1(jiti@2.4.2)(rollup@4.29.1)(sass@1.83.0)(terser@5.37.0)(typescript@5.7.2)(yaml@2.6.1)) + '@astrojs/mdx': 4.0.3(astro@5.1.2(jiti@2.4.2)(rollup@4.29.1)(sass@1.83.0)(terser@5.37.0)(typescript@5.7.2)(yaml@2.6.1)) '@astrojs/sitemap': 3.2.1 '@pagefind/default-ui': 1.3.0 '@types/hast': 3.0.4 '@types/js-yaml': 4.0.9 '@types/mdast': 4.0.4 - astro: 5.1.1(jiti@2.4.2)(rollup@4.29.1)(sass@1.83.0)(terser@5.37.0)(typescript@5.7.2)(yaml@2.6.1) - astro-expressive-code: 0.38.3(astro@5.1.1(jiti@2.4.2)(rollup@4.29.1)(sass@1.83.0)(terser@5.37.0)(typescript@5.7.2)(yaml@2.6.1)) + astro: 5.1.2(jiti@2.4.2)(rollup@4.29.1)(sass@1.83.0)(terser@5.37.0)(typescript@5.7.2)(yaml@2.6.1) + astro-expressive-code: 0.38.3(astro@5.1.2(jiti@2.4.2)(rollup@4.29.1)(sass@1.83.0)(terser@5.37.0)(typescript@5.7.2)(yaml@2.6.1)) bcp-47: 2.1.0 hast-util-from-html: 2.0.3 hast-util-select: 6.0.3 @@ -3199,7 +3205,7 @@ snapshots: '@expressive-code/plugin-shiki@0.38.3': dependencies: '@expressive-code/core': 0.38.3 - shiki: 1.24.4 + shiki: 1.25.1 '@expressive-code/plugin-text-markers@0.38.3': dependencies: @@ -3499,27 +3505,35 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.29.1': optional: true - '@shikijs/core@1.24.4': + '@shikijs/core@1.25.1': dependencies: - '@shikijs/engine-javascript': 1.24.4 - '@shikijs/engine-oniguruma': 1.24.4 - '@shikijs/types': 1.24.4 + '@shikijs/engine-javascript': 1.25.1 + '@shikijs/engine-oniguruma': 1.25.1 + '@shikijs/types': 1.25.1 '@shikijs/vscode-textmate': 9.3.1 '@types/hast': 3.0.4 hast-util-to-html: 9.0.4 - '@shikijs/engine-javascript@1.24.4': + '@shikijs/engine-javascript@1.25.1': dependencies: - '@shikijs/types': 1.24.4 + '@shikijs/types': 1.25.1 '@shikijs/vscode-textmate': 9.3.1 - oniguruma-to-es: 0.8.1 + oniguruma-to-es: 0.10.0 - '@shikijs/engine-oniguruma@1.24.4': + '@shikijs/engine-oniguruma@1.25.1': dependencies: - '@shikijs/types': 1.24.4 + '@shikijs/types': 1.25.1 '@shikijs/vscode-textmate': 9.3.1 - '@shikijs/types@1.24.4': + '@shikijs/langs@1.25.1': + dependencies: + '@shikijs/types': 1.25.1 + + '@shikijs/themes@1.25.1': + dependencies: + '@shikijs/types': 1.25.1 + + '@shikijs/types@1.25.1': dependencies: '@shikijs/vscode-textmate': 9.3.1 '@types/hast': 3.0.4 @@ -3708,12 +3722,12 @@ snapshots: astring@1.9.0: {} - astro-expressive-code@0.38.3(astro@5.1.1(jiti@2.4.2)(rollup@4.29.1)(sass@1.83.0)(terser@5.37.0)(typescript@5.7.2)(yaml@2.6.1)): + astro-expressive-code@0.38.3(astro@5.1.2(jiti@2.4.2)(rollup@4.29.1)(sass@1.83.0)(terser@5.37.0)(typescript@5.7.2)(yaml@2.6.1)): dependencies: - astro: 5.1.1(jiti@2.4.2)(rollup@4.29.1)(sass@1.83.0)(terser@5.37.0)(typescript@5.7.2)(yaml@2.6.1) + astro: 5.1.2(jiti@2.4.2)(rollup@4.29.1)(sass@1.83.0)(terser@5.37.0)(typescript@5.7.2)(yaml@2.6.1) rehype-expressive-code: 0.38.3 - astro@5.1.1(jiti@2.4.2)(rollup@4.29.1)(sass@1.83.0)(terser@5.37.0)(typescript@5.7.2)(yaml@2.6.1): + astro@5.1.2(jiti@2.4.2)(rollup@4.29.1)(sass@1.83.0)(terser@5.37.0)(typescript@5.7.2)(yaml@2.6.1): dependencies: '@astrojs/compiler': 2.10.3 '@astrojs/internal-helpers': 0.4.2 @@ -3758,7 +3772,7 @@ snapshots: prompts: 2.4.2 rehype: 13.0.2 semver: 7.6.3 - shiki: 1.24.4 + shiki: 1.25.1 tinyexec: 0.3.1 tsconfck: 3.1.4(typescript@5.7.2) ultrahtml: 1.5.3 @@ -3766,7 +3780,7 @@ snapshots: unstorage: 1.14.1 vfile: 6.0.3 vite: 6.0.5(jiti@2.4.2)(sass@1.83.0)(terser@5.37.0)(yaml@2.6.1) - vitefu: 1.0.4(vite@6.0.5(jiti@2.4.2)(sass@1.83.0)(terser@5.37.0)(yaml@2.6.1)) + vitefu: 1.0.5(vite@6.0.5(jiti@2.4.2)(sass@1.83.0)(terser@5.37.0)(yaml@2.6.1)) which-pm: 3.0.0 xxhash-wasm: 1.1.0 yargs-parser: 21.1.1 @@ -5081,11 +5095,11 @@ snapshots: dependencies: mimic-fn: 4.0.0 - oniguruma-to-es@0.8.1: + oniguruma-to-es@0.10.0: dependencies: emoji-regex-xs: 1.0.0 - regex: 5.0.2 - regex-recursion: 5.0.0 + regex: 5.1.1 + regex-recursion: 5.1.1 p-limit@2.3.0: dependencies: @@ -5252,13 +5266,14 @@ snapshots: regenerator-runtime@0.14.1: {} - regex-recursion@5.0.0: + regex-recursion@5.1.1: dependencies: + regex: 5.1.1 regex-utilities: 2.3.0 regex-utilities@2.3.0: {} - regex@5.0.2: + regex@5.1.1: dependencies: regex-utilities: 2.3.0 @@ -5484,12 +5499,14 @@ snapshots: shebang-regex@3.0.0: {} - shiki@1.24.4: + shiki@1.25.1: dependencies: - '@shikijs/core': 1.24.4 - '@shikijs/engine-javascript': 1.24.4 - '@shikijs/engine-oniguruma': 1.24.4 - '@shikijs/types': 1.24.4 + '@shikijs/core': 1.25.1 + '@shikijs/engine-javascript': 1.25.1 + '@shikijs/engine-oniguruma': 1.25.1 + '@shikijs/langs': 1.25.1 + '@shikijs/themes': 1.25.1 + '@shikijs/types': 1.25.1 '@shikijs/vscode-textmate': 9.3.1 '@types/hast': 3.0.4 @@ -5739,7 +5756,7 @@ snapshots: terser: 5.37.0 yaml: 2.6.1 - vitefu@1.0.4(vite@6.0.5(jiti@2.4.2)(sass@1.83.0)(terser@5.37.0)(yaml@2.6.1)): + vitefu@1.0.5(vite@6.0.5(jiti@2.4.2)(sass@1.83.0)(terser@5.37.0)(yaml@2.6.1)): optionalDependencies: vite: 6.0.5(jiti@2.4.2)(sass@1.83.0)(terser@5.37.0)(yaml@2.6.1) From fa1a6c09c346c8fab755dbfa7eb10561436541f4 Mon Sep 17 00:00:00 2001 From: CodeDoctorDE Date: Tue, 7 Jan 2025 11:00:58 +0100 Subject: [PATCH 4/6] Add changelog for cherry pick release, closes #777 --- api/pubspec.yaml | 2 +- app/lib/actions/svg_export.dart | 2 +- app/lib/models/viewport.dart | 1 + app/pubspec.lock | 8 ++++---- app/pubspec.yaml | 2 +- metadata/en-US/changelogs/128.txt | 10 ++++++++++ 6 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 metadata/en-US/changelogs/128.txt diff --git a/api/pubspec.yaml b/api/pubspec.yaml index dc3e904eb3c7..2715e84d32e7 100644 --- a/api/pubspec.yaml +++ b/api/pubspec.yaml @@ -19,7 +19,7 @@ dependencies: git: url: https://github.com/LinwoodDev/dart_pkgs path: packages/lw_file_system_api - ref: b9d6c6173bf75247ce5a4d47fab0e48b730a9696 + ref: 5ab1b96bea6ef0e0c07629ff4e7152b4437cf8ee dev_dependencies: test: ^1.25.3 diff --git a/app/lib/actions/svg_export.dart b/app/lib/actions/svg_export.dart index e3c8401fe6e9..b0fa27e36ca1 100644 --- a/app/lib/actions/svg_export.dart +++ b/app/lib/actions/svg_export.dart @@ -22,7 +22,7 @@ class SvgExportAction extends Action { builder: (context) => BlocProvider.value( value: bloc, child: GeneralExportDialog( - preset: ExportTransformPreset.page, + preset: ExportTransformPreset.view, options: getDefaultSvgExportOptions( context, transform: transform, diff --git a/app/lib/models/viewport.dart b/app/lib/models/viewport.dart index 4d111075b134..a8a345975d01 100644 --- a/app/lib/models/viewport.dart +++ b/app/lib/models/viewport.dart @@ -188,6 +188,7 @@ class CameraViewport extends Equatable { visibleElements: visibleElements, aboveLayerImage: aboveLayerImage, belowLayerImage: belowLayerImage, + resolution: resolution, ); CameraViewport withUtilities(UtilitiesRenderer utilities) => diff --git a/app/pubspec.lock b/app/pubspec.lock index 1bc7bd5fa724..1e152dec0e85 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -782,8 +782,8 @@ packages: dependency: "direct main" description: path: "packages/lw_file_system" - ref: f29b1ae0e338ec155e1c5b0a204c399232904540 - resolved-ref: f29b1ae0e338ec155e1c5b0a204c399232904540 + ref: "54f7ac141410938babff9539dca190f5d130a0db" + resolved-ref: "54f7ac141410938babff9539dca190f5d130a0db" url: "https://github.com/LinwoodDev/dart_pkgs" source: git version: "1.0.0" @@ -791,8 +791,8 @@ packages: dependency: transitive description: path: "packages/lw_file_system_api" - ref: b9d6c6173bf75247ce5a4d47fab0e48b730a9696 - resolved-ref: b9d6c6173bf75247ce5a4d47fab0e48b730a9696 + ref: "5ab1b96bea6ef0e0c07629ff4e7152b4437cf8ee" + resolved-ref: "5ab1b96bea6ef0e0c07629ff4e7152b4437cf8ee" url: "https://github.com/LinwoodDev/dart_pkgs" source: git version: "1.0.0" diff --git a/app/pubspec.yaml b/app/pubspec.yaml index e3dcfb6e1f6c..9fa4ff4d6cd6 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -99,7 +99,7 @@ dependencies: lw_file_system: git: url: https://github.com/LinwoodDev/dart_pkgs - ref: f29b1ae0e338ec155e1c5b0a204c399232904540 + ref: 54f7ac141410938babff9539dca190f5d130a0db path: packages/lw_file_system flutter_localized_locales: ^2.0.5 dynamic_color: ^1.7.0 diff --git a/metadata/en-US/changelogs/128.txt b/metadata/en-US/changelogs/128.txt new file mode 100644 index 000000000000..a73574888b57 --- /dev/null +++ b/metadata/en-US/changelogs/128.txt @@ -0,0 +1,10 @@ +This is a hotfix update, cherry picking some important fixes from the last 2.3.0-beta.0 nightly release. + +* Fix default stroke width ([#779](https://github.com/LinwoodDev/Butterfly/issues/779)) +* Fix svg export shows wrong initial preset +* Fix capture thumbnail uses wrong position +* Fix zoom slider is not centered +* Fix shape detection list tile not clickable +* Fix corrupting files when saving ([#777](https://github.com/LinwoodDev/Butterfly/issues/777)) + +Read more here: https://linwood.dev/butterfly/2.2.4 \ No newline at end of file From 3ec81c911520b10d11ba145b1d4a2bb0cddb95b9 Mon Sep 17 00:00:00 2001 From: CodeDoctorDE Date: Tue, 7 Jan 2025 11:08:38 +0100 Subject: [PATCH 5/6] Upgrade dependencies --- api/pubspec.lock | 32 ++++++++++----------- api/pubspec.yaml | 4 +-- app/pubspec.lock | 72 ++++++++++++++++++++++++------------------------ 3 files changed, 54 insertions(+), 54 deletions(-) diff --git a/api/pubspec.lock b/api/pubspec.lock index 15e17c050075..92b39ab49b22 100644 --- a/api/pubspec.lock +++ b/api/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab" + sha256: "88399e291da5f7e889359681a8f64b18c5123e03576b01f32a6a276611e511c3" url: "https://pub.dev" source: hosted - version: "76.0.0" + version: "78.0.0" _macros: dependency: transitive description: dart @@ -18,10 +18,10 @@ packages: dependency: "direct dev" description: name: analyzer - sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e" + sha256: "62899ef43d0b962b056ed2ebac6b47ec76ffd003d5f7c4e4dc870afe63188e33" url: "https://pub.dev" source: hosted - version: "6.11.0" + version: "7.1.0" archive: dependency: "direct main" description: @@ -186,10 +186,10 @@ packages: dependency: transitive description: name: dart_style - sha256: "7856d364b589d1f08986e140938578ed36ed948581fbc3bc9aef1805039ac5ab" + sha256: "27eb0ae77836989a3bc541ce55595e8ceee0992807f14511552a898ddd0d88ac" url: "https://pub.dev" source: hosted - version: "2.3.7" + version: "3.0.1" ffi: dependency: transitive description: @@ -218,10 +218,10 @@ packages: dependency: "direct dev" description: name: freezed - sha256: "44c19278dd9d89292cf46e97dc0c1e52ce03275f40a97c5a348e802a924bf40e" + sha256: "59a584c24b3acdc5250bb856d0d3e9c0b798ed14a4af1ddb7dc1c7b41df91c9c" url: "https://pub.dev" source: hosted - version: "2.5.7" + version: "2.5.8" freezed_annotation: dependency: "direct main" description: @@ -266,10 +266,10 @@ packages: dependency: transitive description: name: http_parser - sha256: "76d306a1c3afb33fe82e2bbacad62a61f409b5634c915fceb0d799de1a913360" + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" url: "https://pub.dev" source: hosted - version: "4.1.1" + version: "4.1.2" io: dependency: transitive description: @@ -298,10 +298,10 @@ packages: dependency: "direct dev" description: name: json_serializable - sha256: c2fcb3920cf2b6ae6845954186420fca40bc0a8abcc84903b7801f17d7050d7c + sha256: "8f52361c07497a7f2c16c13aac159f9be6fb12b1d67719eac98a21d9a205d571" url: "https://pub.dev" source: hosted - version: "6.9.0" + version: "6.9.2" lints: dependency: "direct dev" description: @@ -322,8 +322,8 @@ packages: dependency: "direct main" description: path: "packages/lw_file_system_api" - ref: b9d6c6173bf75247ce5a4d47fab0e48b730a9696 - resolved-ref: b9d6c6173bf75247ce5a4d47fab0e48b730a9696 + ref: "5ab1b96bea6ef0e0c07629ff4e7152b4437cf8ee" + resolved-ref: "5ab1b96bea6ef0e0c07629ff4e7152b4437cf8ee" url: "https://github.com/LinwoodDev/dart_pkgs" source: git version: "1.0.0" @@ -475,10 +475,10 @@ packages: dependency: transitive description: name: source_gen - sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832" + sha256: "35c8150ece9e8c8d263337a265153c3329667640850b9304861faea59fc98f6b" url: "https://pub.dev" source: hosted - version: "1.5.0" + version: "2.0.0" source_helper: dependency: transitive description: diff --git a/api/pubspec.yaml b/api/pubspec.yaml index 2715e84d32e7..0a7398c1cbcf 100644 --- a/api/pubspec.yaml +++ b/api/pubspec.yaml @@ -25,6 +25,6 @@ dev_dependencies: test: ^1.25.3 json_serializable: ^6.7.1 build_runner: ^2.4.9 - freezed: ^2.5.2 + freezed: ^2.5.8 lints: ^5.0.0 - analyzer: ^6.3.0 + analyzer: ^7.0.0 diff --git a/app/pubspec.lock b/app/pubspec.lock index 1e152dec0e85..e8f61e17070b 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab" + sha256: "88399e291da5f7e889359681a8f64b18c5123e03576b01f32a6a276611e511c3" url: "https://pub.dev" source: hosted - version: "76.0.0" + version: "78.0.0" _macros: dependency: transitive description: dart @@ -18,10 +18,10 @@ packages: dependency: transitive description: name: analyzer - sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e" + sha256: "62899ef43d0b962b056ed2ebac6b47ec76ffd003d5f7c4e4dc870afe63188e33" url: "https://pub.dev" source: hosted - version: "6.11.0" + version: "7.1.0" animations: dependency: "direct main" description: @@ -185,10 +185,10 @@ packages: dependency: transitive description: name: camera_avfoundation - sha256: "2e4c568f70e406ccb87376bc06b53d2f5bebaab71e2fbcc1a950e31449381bcf" + sha256: c3038e6e72e284b14ad246a419f26908c08f8886d114cb8a2e351988439bfa68 url: "https://pub.dev" source: hosted - version: "0.9.17+5" + version: "0.9.17+6" camera_platform_interface: dependency: transitive description: @@ -314,10 +314,10 @@ packages: dependency: transitive description: name: dart_style - sha256: "7856d364b589d1f08986e140938578ed36ed948581fbc3bc9aef1805039ac5ab" + sha256: "27eb0ae77836989a3bc541ce55595e8ceee0992807f14511552a898ddd0d88ac" url: "https://pub.dev" source: hosted - version: "2.3.7" + version: "3.0.1" dbus: dependency: transitive description: @@ -458,18 +458,18 @@ packages: dependency: "direct main" description: name: flex_color_scheme - sha256: "90f4fe67b9561ae8a4af117df65a8ce9988624025667c54e6d304e65cff77d52" + sha256: "09bea5d776f694c5a67f2229f2aa500cc7cce369322dc6500ab01cf9ad1b4e1a" url: "https://pub.dev" source: hosted - version: "8.0.2" + version: "8.1.0" flex_seed_scheme: dependency: transitive description: name: flex_seed_scheme - sha256: "7639d2c86268eff84a909026eb169f008064af0fb3696a651b24b0fa24a40334" + sha256: d3ba3c5c92d2d79d45e94b4c6c71d01fac3c15017da1545880c53864da5dfeb0 url: "https://pub.dev" source: hosted - version: "3.4.1" + version: "3.5.0" flutter: dependency: "direct main" description: flutter @@ -521,26 +521,26 @@ packages: dependency: "direct main" description: name: flutter_secure_storage - sha256: "165164745e6afb5c0e3e3fcc72a012fb9e58496fb26ffb92cf22e16a821e85d0" + sha256: "1913841ac4c7bf57cd2e05b717e1fbff7841b542962feff827b16525a781b3e4" url: "https://pub.dev" source: hosted - version: "9.2.2" + version: "9.2.3" flutter_secure_storage_linux: dependency: transitive description: name: flutter_secure_storage_linux - sha256: "4d91bfc23047422cbcd73ac684bc169859ee766482517c22172c86596bf1464b" + sha256: bf7404619d7ab5c0a1151d7c4e802edad8f33535abfbeff2f9e1fe1274e2d705 url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.2" flutter_secure_storage_macos: dependency: transitive description: name: flutter_secure_storage_macos - sha256: "1693ab11121a5f925bbea0be725abfcfbbcf36c1e29e571f84a0c0f436147a81" + sha256: "6c0a2795a2d1de26ae202a0d78527d163f4acbb11cde4c75c670f3a0fc064247" url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.1.3" flutter_secure_storage_platform_interface: dependency: transitive description: @@ -588,10 +588,10 @@ packages: dependency: "direct dev" description: name: freezed - sha256: "44c19278dd9d89292cf46e97dc0c1e52ce03275f40a97c5a348e802a924bf40e" + sha256: "59a584c24b3acdc5250bb856d0d3e9c0b798ed14a4af1ddb7dc1c7b41df91c9c" url: "https://pub.dev" source: hosted - version: "2.5.7" + version: "2.5.8" freezed_annotation: dependency: transitive description: @@ -625,10 +625,10 @@ packages: dependency: "direct main" description: name: go_router - sha256: "2fd11229f59e23e967b0775df8d5948a519cd7e1e8b6e849729e010587b46539" + sha256: "7c2d40b59890a929824f30d442e810116caf5088482629c894b9e4478c67472d" url: "https://pub.dev" source: hosted - version: "14.6.2" + version: "14.6.3" graphs: dependency: transitive description: @@ -657,10 +657,10 @@ packages: dependency: transitive description: name: http_parser - sha256: "76d306a1c3afb33fe82e2bbacad62a61f409b5634c915fceb0d799de1a913360" + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" url: "https://pub.dev" source: hosted - version: "4.1.1" + version: "4.1.2" idb_shim: dependency: "direct main" description: @@ -734,10 +734,10 @@ packages: dependency: "direct dev" description: name: json_serializable - sha256: c2fcb3920cf2b6ae6845954186420fca40bc0a8abcc84903b7801f17d7050d7c + sha256: "8f52361c07497a7f2c16c13aac159f9be6fb12b1d67719eac98a21d9a205d571" url: "https://pub.dev" source: hosted - version: "6.9.0" + version: "6.9.2" leak_tracker: dependency: transitive description: @@ -1201,10 +1201,10 @@ packages: dependency: transitive description: name: sembast - sha256: f45edc5e34ed53d6e3d70df664b182e9abcf9c784f48184e5be4c079d2b865d6 + sha256: b3dde17154b2233d039fe3c386871d2ccddb4f31e058502c4036b03858e2ff5f url: "https://pub.dev" source: hosted - version: "3.8.0+1" + version: "3.8.1+1" share_plus: dependency: "direct main" description: @@ -1302,10 +1302,10 @@ packages: dependency: transitive description: name: source_gen - sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832" + sha256: "35c8150ece9e8c8d263337a265153c3329667640850b9304861faea59fc98f6b" url: "https://pub.dev" source: hosted - version: "1.5.0" + version: "2.0.0" source_helper: dependency: transitive description: @@ -1366,18 +1366,18 @@ packages: dependency: "direct main" description: name: super_clipboard - sha256: "687ef5d4ceb2cb1e0e36a4af37683936609f424f0767b46fee5fc312b0aeb595" + sha256: "5203c881d24033c3e6154c2ae01afd94e7f0a3201280373f28e540f1defa3f40" url: "https://pub.dev" source: hosted - version: "0.9.0-dev.5" + version: "0.9.0-dev.6" super_native_extensions: dependency: transitive description: name: super_native_extensions - sha256: "1cb6baecf529300ae7f59974bdc33a53b947ecc4ce374c00126df064c10e4e51" + sha256: "09ccc40c475e6f91770eaeb2553bf4803812d7beadc3759aa57d643370619c86" url: "https://pub.dev" source: hosted - version: "0.9.0-dev.5" + version: "0.9.0-dev.6" sync_http: dependency: transitive description: @@ -1590,10 +1590,10 @@ packages: dependency: transitive description: name: win32 - sha256: "8b338d4486ab3fbc0ba0db9f9b4f5239b6697fcee427939a40e720cbb9ee0a69" + sha256: "154360849a56b7b67331c21f09a386562d88903f90a1099c5987afc1912e1f29" url: "https://pub.dev" source: hosted - version: "5.9.0" + version: "5.10.0" win32_registry: dependency: transitive description: From d5fea35bb76b9cc7df43798601ece9be65f2d698 Mon Sep 17 00:00:00 2001 From: CodeDoctorDE Date: Tue, 7 Jan 2025 13:05:40 +0100 Subject: [PATCH 6/6] Fix export button in data settings not working --- app/lib/settings/data.dart | 27 +++++++++++++++++++++++++-- metadata/en-US/changelogs/128.txt | 1 + 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/app/lib/settings/data.dart b/app/lib/settings/data.dart index d0505f48f700..5b0725529c0e 100644 --- a/app/lib/settings/data.dart +++ b/app/lib/settings/data.dart @@ -127,9 +127,9 @@ class _DataSettingsPageState extends State { leading: const PhosphorIcon(PhosphorIconsLight.export), onTap: () async { - final directory = await _documentSystem + final directory = await _documentSystem.fileSystem .getRootDirectory(listLevel: allListLevel); - final archive = exportDirectory(directory); + final archive = _exportDirectory(directory); final encoder = ZipEncoder(); final bytes = encoder.encode(archive); exportZip(context, bytes); @@ -143,6 +143,29 @@ class _DataSettingsPageState extends State { })); } + Archive _exportDirectory(FileSystemDirectory directory, {int? lastModTime}) { + final archive = Archive(); + void addToArchive(FileSystemEntity asset) { + final path = asset.pathWithoutLeadingSlash; + if (asset is FileSystemFile) { + final data = asset.data; + if (data == null) return; + final file = ArchiveFile.bytes(path, data); + if (lastModTime != null) file.lastModTime = lastModTime; + archive.addFile(file); + } else if (asset is FileSystemDirectory) { + archive.addFile(ArchiveFile.directory(path)); + var assets = asset.assets; + for (var current in assets) { + addToArchive(current); + } + } + } + + addToArchive(directory); + return archive; + } + Future _changeDataDirectory() async { try { final settingsCubit = context.read(); diff --git a/metadata/en-US/changelogs/128.txt b/metadata/en-US/changelogs/128.txt index a73574888b57..a75be6143d98 100644 --- a/metadata/en-US/changelogs/128.txt +++ b/metadata/en-US/changelogs/128.txt @@ -6,5 +6,6 @@ This is a hotfix update, cherry picking some important fixes from the last 2.3.0 * Fix zoom slider is not centered * Fix shape detection list tile not clickable * Fix corrupting files when saving ([#777](https://github.com/LinwoodDev/Butterfly/issues/777)) +* Fix export button in data settings not working Read more here: https://linwood.dev/butterfly/2.2.4 \ No newline at end of file