Skip to content

Commit 07d18b5

Browse files
committed
Add export button
1 parent e81a4b3 commit 07d18b5

File tree

6 files changed

+98
-78
lines changed

6 files changed

+98
-78
lines changed

app/android/Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ GEM
1010
artifactory (3.0.17)
1111
atomos (0.1.3)
1212
aws-eventstream (1.3.0)
13-
aws-partitions (1.1034.0)
14-
aws-sdk-core (3.214.1)
13+
aws-partitions (1.1035.0)
14+
aws-sdk-core (3.215.0)
1515
aws-eventstream (~> 1, >= 1.3.0)
1616
aws-partitions (~> 1, >= 1.992.0)
1717
aws-sigv4 (~> 1.9)
@@ -23,7 +23,7 @@ GEM
2323
aws-sdk-core (~> 3, >= 3.210.0)
2424
aws-sdk-kms (~> 1)
2525
aws-sigv4 (~> 1.5)
26-
aws-sigv4 (1.10.1)
26+
aws-sigv4 (1.11.0)
2727
aws-eventstream (~> 1, >= 1.0.2)
2828
babosa (1.0.4)
2929
base64 (0.2.0)

app/lib/pages/packs/dialog.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'package:lw_file_system/lw_file_system.dart';
77
import 'package:material_leap/material_leap.dart';
88
import 'package:phosphor_flutter/phosphor_flutter.dart';
99
import 'package:setonix/api/open.dart';
10+
import 'package:setonix/api/save.dart';
1011
import 'package:setonix/bloc/world/bloc.dart';
1112
import 'package:setonix/bloc/world/state.dart';
1213
import 'package:setonix/services/file_system.dart';

app/lib/pages/packs/editor.dart

Lines changed: 58 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -50,45 +50,64 @@ class _EditorPacksViewState extends State<_EditorPacksView> {
5050
final file = files[index];
5151
final data = file.data!;
5252
final metadata = data.getMetadataOrDefault();
53-
return ListTile(
54-
title: Text(metadata.name),
55-
subtitle: Text(file.identifier),
56-
onTap: () =>
57-
GoRouter.of(context).goNamed('editor', pathParameters: {
58-
'name': file.identifier,
59-
}),
60-
trailing: IconButton(
61-
icon: const Icon(PhosphorIconsLight.trash),
62-
onPressed: () async {
63-
final result = await showDialog<bool>(
64-
context: context,
65-
builder: (context) => AlertDialog(
66-
title:
67-
Text(AppLocalizations.of(context).removePack),
68-
content: Text(AppLocalizations.of(context)
69-
.removePackMessage(file.identifier)),
70-
actions: [
71-
TextButton(
72-
onPressed: () =>
73-
Navigator.of(context).pop(false),
74-
child:
75-
Text(AppLocalizations.of(context).cancel),
76-
),
77-
TextButton(
78-
onPressed: () =>
79-
Navigator.of(context).pop(true),
80-
child:
81-
Text(AppLocalizations.of(context).remove),
82-
),
83-
],
84-
),
85-
);
86-
if (!(result ?? false)) return;
87-
await _fileSystem.editorSystem
88-
.deleteFile(file.identifier);
89-
_reloadPacks();
90-
},
91-
),
53+
return ContextRegion(
54+
builder: (context, widget, controller) {
55+
return ListTile(
56+
title: Text(metadata.name),
57+
subtitle: Text(file.identifier),
58+
onTap: () => GoRouter.of(context)
59+
.goNamed('editor', pathParameters: {
60+
'name': file.identifier,
61+
}),
62+
trailing: widget,
63+
);
64+
},
65+
menuChildren: [
66+
MenuItemButton(
67+
leadingIcon: const Icon(PhosphorIconsLight.export),
68+
child: Text(AppLocalizations.of(context).export),
69+
onPressed: () async {
70+
exportData(
71+
context,
72+
data,
73+
metadata.name,
74+
);
75+
},
76+
),
77+
MenuItemButton(
78+
leadingIcon: const Icon(PhosphorIconsLight.trash),
79+
child: Text(AppLocalizations.of(context).delete),
80+
onPressed: () async {
81+
final result = await showDialog<bool>(
82+
context: context,
83+
builder: (context) => AlertDialog(
84+
title:
85+
Text(AppLocalizations.of(context).removePack),
86+
content: Text(AppLocalizations.of(context)
87+
.removePackMessage(file.identifier)),
88+
actions: [
89+
TextButton(
90+
onPressed: () =>
91+
Navigator.of(context).pop(false),
92+
child:
93+
Text(AppLocalizations.of(context).cancel),
94+
),
95+
TextButton(
96+
onPressed: () =>
97+
Navigator.of(context).pop(true),
98+
child:
99+
Text(AppLocalizations.of(context).remove),
100+
),
101+
],
102+
),
103+
);
104+
if (!(result ?? false)) return;
105+
await _fileSystem.editorSystem
106+
.deleteFile(file.identifier);
107+
_reloadPacks();
108+
},
109+
),
110+
],
92111
);
93112
},
94113
);

docs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
"dependencies": {
1313
"@astrojs/check": "^0.9.4",
1414
"@astrojs/react": "^4.1.3",
15-
"@astrojs/starlight": "^0.30.5",
15+
"@astrojs/starlight": "^0.30.6",
1616
"@phosphor-icons/react": "^2.1.7",
17-
"@types/react": "^19.0.4",
18-
"@types/react-dom": "^19.0.2",
17+
"@types/react": "^19.0.5",
18+
"@types/react-dom": "^19.0.3",
1919
"astro": "^5.1.5",
2020
"react": "^19.0.0",
2121
"react-dom": "^19.0.0",

docs/pnpm-lock.yaml

Lines changed: 25 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/pubspec.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,10 @@ packages:
292292
dependency: transitive
293293
description:
294294
name: http_parser
295-
sha256: "76d306a1c3afb33fe82e2bbacad62a61f409b5634c915fceb0d799de1a913360"
295+
sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571"
296296
url: "https://pub.dev"
297297
source: hosted
298-
version: "4.1.1"
298+
version: "4.1.2"
299299
io:
300300
dependency: transitive
301301
description:
@@ -340,8 +340,8 @@ packages:
340340
dependency: transitive
341341
description:
342342
path: "packages/lw_file_system_api"
343-
ref: "5ab1b96bea6ef0e0c07629ff4e7152b4437cf8ee"
344-
resolved-ref: "5ab1b96bea6ef0e0c07629ff4e7152b4437cf8ee"
343+
ref: e4c17cb5e3a53c0cd02d4127458c2215f7c6e7d4
344+
resolved-ref: e4c17cb5e3a53c0cd02d4127458c2215f7c6e7d4
345345
url: "https://github.com/LinwoodDev/dart_pkgs"
346346
source: git
347347
version: "1.0.0"
@@ -447,10 +447,10 @@ packages:
447447
dependency: transitive
448448
description:
449449
name: pubspec_parse
450-
sha256: "81876843eb50dc2e1e5b151792c9a985c5ed2536914115ed04e9c8528f6647b0"
450+
sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082"
451451
url: "https://pub.dev"
452452
source: hosted
453-
version: "1.4.0"
453+
version: "1.5.0"
454454
setonix_api:
455455
dependency: "direct main"
456456
description:
@@ -534,10 +534,10 @@ packages:
534534
dependency: transitive
535535
description:
536536
name: stream_channel
537-
sha256: "4ac0537115a24d772c408a2520ecd0abb99bca2ea9c4e634ccbdbfae64fe17ec"
537+
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
538538
url: "https://pub.dev"
539539
source: hosted
540-
version: "2.1.3"
540+
version: "2.1.4"
541541
stream_transform:
542542
dependency: transitive
543543
description:

0 commit comments

Comments
 (0)