-
Notifications
You must be signed in to change notification settings - Fork 4
Implement web #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SifAa
wants to merge
29
commits into
Notalib:main
Choose a base branch
from
SifAa:add-web
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Implement web #15
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
c2fae0e
feat: Initialize flutter_readium_web package with core functionality
SifAa b4ac129
feat(example): add scroll controller to BookshelfPage
SifAa ddef257
feat(flutter_readium): add web as a supported platform
SifAa 842485b
feat: implement getPublication method in FlutterReadium and FlutterRe…
SifAa 1f221c0
chor: format example pubspec
SifAa 95435fc
chore: update web pubspec.yaml with homepage, repository, and publish…
SifAa 4d452da
feat(web): enhance publication handling by adding pubId to openPublic…
SifAa 6848d89
Refactor preferences handling in ReadiumReader
SifAa b5b8604
chore: update @readium/navigator and @readium/navigator-html-injectab…
SifAa 65b0c67
feat(web): implement EPUB preferences handling in JsPublicationChanne…
SifAa 97929be
feat(example): add web to example app
SifAa 2b11bba
fix(locator): ensure href only contains path in Locator object
SifAa 927a1ed
fix(example): correct indentation for webManifestList asset in pubspec
SifAa 8f19c82
fix(web): preferences handling has correct vertical scroll conversion…
SifAa 100a345
feat(web): store default EPUB preferences in setEPUBPreferences method
SifAa 3675147
feat: add pageMargins to EPUB preferences handling
SifAa 13336e2
chore: clean up comments
SifAa dbcd9de
feat: implement setDefaultPreferences method for EPUB preferences han…
SifAa b06b16a
refactor: simplify widget return structure in ReadiumReaderWidget for…
SifAa 1b08afa
feat(web): scroll up and down using keyboard
SifAa cca6b1c
feat: add build and installation scripts
SifAa 987d98e
refactor(web): extract helper functions for fetching manifest and ini…
SifAa bb1484e
chor(example): additional publication manifest URL
SifAa bb0769c
chor(test): mock methods match FlutterReadiumPlatform
SifAa 4af5b27
refactor: move web from own package into flutter_readium package
SifAa 03a9b9e
Merge branch 'main' into add-web
SifAa 6eb281b
chore(web): update @readium dependencies to latest versions
SifAa 163df5f
chore(web): update readium dependencies to latest non beta versions
SifAa 9894311
review follow up
SifAa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Build for flutter_readium web | ||
echo "Building flutter_readium web" | ||
cd ./flutter_readium/ | ||
npm i | ||
npm run build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
cd ./flutter_readium_platform_interface; dart run build_runner build --delete-conflicting-outputs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
if [ "x$1" == "x" ] | ||
then | ||
echo "Possible usage:" | ||
echo " $0 dart pub outdated" | ||
echo " $0 dart pub upgrade" | ||
exit 1 | ||
fi | ||
|
||
dir=( | ||
"./flutter_readium" | ||
"./flutter_readium_platform_interface" | ||
"./flutter_readium_web" | ||
) | ||
for i in "${dir[@]}"; do | ||
echo -e "\033[35;1m=== $@ $i ===\033[0m" | ||
(cd "$i" || exit; $@) | ||
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
./bin/forAll flutter pub get | ||
|
||
# this is not working as expected | ||
if [ "$(uname)" == "Darwin" ]; then | ||
(cd ./flutter_readium/example/ios; pod install --repo-update) | ||
fi | ||
|
||
|
||
./bin/build_js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// ignore_for_file: avoid_print | ||
|
||
import 'dart:io'; | ||
import 'dart:isolate'; | ||
|
||
void main(List<String> args) async { | ||
if (args.isEmpty) { | ||
print('Usage: dart run flutter_readium:copy_js_file <destination_directory>'); | ||
return; | ||
} | ||
|
||
final destinationDir = args[0]; | ||
final packageUri = Uri.parse('package:flutter_readium/helpers/readiumReader.js'); | ||
final resolvedUri = await Isolate.resolvePackageUri(packageUri); | ||
|
||
if (resolvedUri == null) { | ||
print('Error: Could not resolve package URI'); | ||
return; | ||
} | ||
|
||
final sourcePath = resolvedUri.toFilePath(); | ||
final sourceFile = File(sourcePath); | ||
|
||
if (!sourceFile.existsSync()) { | ||
print('Error: Source file not found: $sourcePath'); | ||
return; | ||
} | ||
|
||
final destinationPath = '$destinationDir/readiumReader.js'; | ||
// final destinationFile = File(destinationPath); | ||
|
||
try { | ||
// Ensure the destination directory exists | ||
Directory(destinationDir).createSync(recursive: true); | ||
|
||
// Copy the file | ||
sourceFile.copySync(destinationPath); | ||
print('File copied to $destinationPath'); | ||
} catch (e) { | ||
print('Error copying file: $e'); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[ | ||
"https://merkur.live.dbb.dk/opds2/publication/free/merkur:libraryid:37881/manifest.json", | ||
"https://publication-server.readium.org/bW9ieS1kaWNrLmVwdWI/manifest.json" | ||
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could generalize this, so all platforms use the same function here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What @ddfreiling has written for native uses openPublication, but that is not possible with ts-toolkit. We need to make another PR with implements getPublication in native and then we can generalize it. Until then this should stay