Skip to content
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

Test PR #455

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
57f2e92
Good checkpoint for adding new curly brace insertion plugin.
vincentsheffer Sep 9, 2022
e72b278
Curly brace plugin now triggered by {{.
vincentsheffer Sep 9, 2022
b50efa0
Removed some debugging print statements that are no longer needed.
vincentsheffer Sep 12, 2022
8cb2982
Added IntelliJ/Android Studio related files to ignore.
vincentsheffer Sep 12, 2022
78e8544
Curly brace insertion v1 working now.
vincentsheffer Sep 12, 2022
11e5548
Removed all added debug print statements.
vincentsheffer Sep 12, 2022
3347726
Initial commit.
vincentsheffer Sep 14, 2022
8f97341
Added common.js as an asset.
vincentsheffer Sep 14, 2022
33cdbe9
Moved SelectionPreserver to common.js.
vincentsheffer Sep 14, 2022
d8f4f35
Update README.md
vsheffer Sep 14, 2022
6136c28
Removed more debugging console messages.
vincentsheffer Sep 14, 2022
a519c8c
Merge branch 'master' of github.com:vsheffer/html-editor-enhanced
vincentsheffer Sep 14, 2022
9d8ae36
Removed the commented out trimStart().
vincentsheffer Sep 29, 2022
dbd335b
Snapshot testing branches and pubspec.yaml.
vincentsheffer May 1, 2023
bdc33b7
Merge pull request #2 from vsheffer/test2
vsheffer May 1, 2023
1d12280
Upgraded file_picker version for device_info_plus in other projects.
hparicha Sep 27, 2023
abc59d9
Upgraded file_picker version for device_info_plus in other projects.
hparicha Sep 27, 2023
3e7894e
Merge pull request #3 from vsheffer/hp-upgrade-file-picker
hparicha Sep 28, 2023
75fe12d
Added the Calibri font.
vincebluemvmt Mar 13, 2024
1c9726b
Fixed breaking changes with upgrade to 3.19.
vincebluemvmt Mar 15, 2024
72c4804
Added more fonts and font sizes.
vincebluemvmt Mar 19, 2024
084ecb7
Upped numberpicker version.
vincebluemvmt Mar 21, 2024
0bc37b1
Merged with the origin repo.
vincebluemvmt Apr 24, 2024
a34e321
Removed Bodoni and Roboto fonts.
vincebluemvmt Apr 24, 2024
e2d54c1
Removed (again) Bodoni and Roboto.
vincebluemvmt Apr 24, 2024
c489990
Upped version of flutter inappwebview to ^6.0.0.
vincentsheffer May 1, 2024
659a50c
Snapshot before making changes.
vincentsheffer May 13, 2024
4e78696
Updated versions of JS modules.
vincentsheffer May 20, 2024
5258c23
Added summernot-no-plugins-bs.html file to list of assets.
vincentsheffer May 20, 2024
5ad0868
Added some new options.
vincentsheffer May 20, 2024
ef276f4
Reformatted files.
vincentsheffer May 21, 2024
1a640b6
Default line-height is not 1.2.
vincentsheffer May 21, 2024
a35c995
Fixed issues found by 'flutter analyze'.
vincentsheffer May 22, 2024
5bd25b0
Merge pull request #4 from vsheffer/feature/update-summernote
vsheffer May 22, 2024
ec16dd4
Added page break to InsertButtons class.
vincentsheffer Jun 5, 2024
79102a1
Added Insert Page Break to example app.
vincentsheffer Jun 5, 2024
6f45fd8
Merge pull request #5 from vsheffer/feature/add-page-break
vsheffer Jun 5, 2024
63c56fa
Removed print statement.
vincentsheffer Jul 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@
.pub/

build/

*.iml
.idea/

.flutter-plugins
.flutter-plugins-dependencies
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [2.5.1] = 2023-01-25
* Fix build issues on Flutter 3.4.0+ due to assets directory
* Update dependencies

## [2.5.0] - 2022-06-04
* Support Flutter 3.0 (remove warnings) (@Cteq3132)
* [BREAKING] Support modifying `foreColorSelected` and `backColorSelected` when using a custom dialog for font coloring
Expand Down
29 changes: 17 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Flutter Html Editor - Enhanced

# Objective of this Fork

The main objective of this fork is to add plugins supporting Jinja2 syntax for autocompletion. The only supported Jinja2 syntax thus far is for the **{{...}}** substitution. It will also work with **Jinja2** macros. The configuration of the plugin works exactly like the existing **SummernoteAtMention** plugin in that you specify a list of possible values. The only advancement is to support a 2 character trigger of the selection/autocomplete list.

[![pub package](https://img.shields.io/pub/v/html_editor_enhanced.svg)](https://pub.dev/packages/html_editor_enhanced)

Flutter HTML Editor Enhanced is a text editor for Android, iOS, and Web to help write WYSIWYG HTML code with the Summernote JavaScript wrapper.
Expand Down Expand Up @@ -164,21 +169,21 @@ Below, you will find brief descriptions of the parameters the `HtmlEditor` widge

### Parameters - `HtmlEditor`

Parameter | Type | Default | Description
------------ | ------------- | ------------- | -------------
**controller** | `HtmlEditorController` | empty | Required param. Create a controller instance and pass it to the widget. This ensures that any methods called work only on their `HtmlEditor` instance, allowing you to use multiple HTML widgets on one page.
**callbacks** | `Callbacks` | empty | Customize the callbacks for various events
**options** | `HtmlEditorOptions` | `HtmlEditorOptions()` | Class to set various options. See [below](#parameters---htmleditoroptions) for more details.
**plugins** | `List<Plugins>` | empty | Customize what plugins are activated. See [below](#plugins) for more details.
**toolbar** | `List<Toolbar>` | See the widget's constructor | Customize what buttons are shown on the toolbar, and in which order. See [below](#toolbar) for more details.
| Parameter | Type | Default | Description |
|----------------|------------------------|------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **controller** | `HtmlEditorController` | empty | Required param. Create a controller instance and pass it to the widget. This ensures that any methods called work only on their `HtmlEditor` instance, allowing you to use multiple HTML widgets on one page. |
| **callbacks** | `Callbacks` | empty | Customize the callbacks for various events |
| **options** | `HtmlEditorOptions` | `HtmlEditorOptions()` | Class to set various options. See [below](#parameters---htmleditoroptions) for more details. |
| **plugins** | `List<Plugins>` | empty | Customize what plugins are activated. See [below](#plugins) for more details. |
| **toolbar** | `List<Toolbar>` | See the widget's constructor | Customize what buttons are shown on the toolbar, and in which order. See [below](#toolbar) for more details. |

### Parameters - `HtmlEditorController`

Parameter | Type | Default | Description
------------ | ------------- | ------------- | -------------
**processInputHtml** | `bool` | `true` | Determines whether processing occurs on any input HTML (e.g. escape quotes, apostrophes, and remove `/n`s)
**processNewLineAsBr** | `bool` | `false` | Determines whether a new line (`\n`) becomes a `<br/>` in any *input* HTML
**processOutputHtml** | `bool` | `true` | Determines whether processing occurs on any output HTML (e.g. `<p><br/><p>` becomes `""`)
| Parameter | Type | Default | Description |
|------------------------|--------|---------|------------------------------------------------------------------------------------------------------------|
| **processInputHtml** | `bool` | `true` | Determines whether processing occurs on any input HTML (e.g. escape quotes, apostrophes, and remove `/n`s) |
| **processNewLineAsBr** | `bool` | `false` | Determines whether a new line (`\n`) becomes a `<br/>` in any *input* HTML |
| **processOutputHtml** | `bool` | `true` | Determines whether processing occurs on any output HTML (e.g. `<p><br/><p>` becomes `""`) |

### Parameters - `HtmlEditorOptions`

Expand Down
1 change: 0 additions & 1 deletion example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
/build/

# Web related
lib/generated_plugin_registrant.dart

# Symbolication related
app.*.symbols
Expand Down
24 changes: 22 additions & 2 deletions example/.metadata
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
# This file should be version controlled.

version:
revision: a29104a69b102a7485cd00d358eaeab219d258ab
revision: 8c1149878bbb8f062aecfab4d825e5b87bdb4487
channel: beta

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 8c1149878bbb8f062aecfab4d825e5b87bdb4487
base_revision: 8c1149878bbb8f062aecfab4d825e5b87bdb4487
- platform: macos
create_revision: 8c1149878bbb8f062aecfab4d825e5b87bdb4487
base_revision: 8c1149878bbb8f062aecfab4d825e5b87bdb4487

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
4 changes: 2 additions & 2 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 31
compileSdkVersion 33

aaptOptions {
noCompress 'html', 'txt'
Expand All @@ -40,7 +40,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.tanayneotia.html_editor_enhanced_example"
minSdkVersion 21
targetSdkVersion 30
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand Down
3 changes: 2 additions & 1 deletion example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize"
android:exported="true">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
<string>9.0</string>
</dict>
</plist>
60 changes: 58 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,38 @@
PODS:
- DKImagePickerController/Core (4.3.4):
- DKImagePickerController/ImageDataManager
- DKImagePickerController/Resource
- DKImagePickerController/ImageDataManager (4.3.4)
- DKImagePickerController/PhotoGallery (4.3.4):
- DKImagePickerController/Core
- DKPhotoGallery
- DKImagePickerController/Resource (4.3.4)
- DKPhotoGallery (0.0.17):
- DKPhotoGallery/Core (= 0.0.17)
- DKPhotoGallery/Model (= 0.0.17)
- DKPhotoGallery/Preview (= 0.0.17)
- DKPhotoGallery/Resource (= 0.0.17)
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Core (0.0.17):
- DKPhotoGallery/Model
- DKPhotoGallery/Preview
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Model (0.0.17):
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Preview (0.0.17):
- DKPhotoGallery/Model
- DKPhotoGallery/Resource
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Resource (0.0.17):
- SDWebImage
- SwiftyGif
- file_picker (0.0.1):
- DKImagePickerController/PhotoGallery
- Flutter
- Flutter (1.0.0)
- flutter_inappwebview (0.0.1):
- Flutter
Expand All @@ -7,27 +41,49 @@ PODS:
- flutter_inappwebview/Core (0.0.1):
- Flutter
- OrderedSet (~> 5.0)
- flutter_keyboard_visibility (0.0.1):
- Flutter
- OrderedSet (5.0.0)
- SDWebImage (5.13.2):
- SDWebImage/Core (= 5.13.2)
- SDWebImage/Core (5.13.2)
- SwiftyGif (5.4.3)

DEPENDENCIES:
- file_picker (from `.symlinks/plugins/file_picker/ios`)
- Flutter (from `Flutter`)
- flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`)
- flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`)

SPEC REPOS:
trunk:
- DKImagePickerController
- DKPhotoGallery
- OrderedSet
- SDWebImage
- SwiftyGif

EXTERNAL SOURCES:
file_picker:
:path: ".symlinks/plugins/file_picker/ios"
Flutter:
:path: Flutter
flutter_inappwebview:
:path: ".symlinks/plugins/flutter_inappwebview/ios"
flutter_keyboard_visibility:
:path: ".symlinks/plugins/flutter_keyboard_visibility/ios"

SPEC CHECKSUMS:
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
file_picker: 817ab1d8cd2da9d2da412a417162deee3500fc95
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
flutter_inappwebview: bfd58618f49dc62f2676de690fc6dcda1d6c3721
flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c
SDWebImage: 72f86271a6f3139cc7e4a89220946489d4b9a866
SwiftyGif: 6c3eafd0ce693cad58bb63d2b2fb9bacb8552780

PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c

COCOAPODS: 1.10.0.beta.2
COCOAPODS: 1.11.3
4 changes: 2 additions & 2 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 50;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -156,7 +156,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 2 additions & 0 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,7 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
</dict>
</plist>
42 changes: 36 additions & 6 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:file_picker/file_picker.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:html_editor_enhanced/html_editor.dart';
import 'package:file_picker/file_picker.dart';

void main() => runApp(HtmlEditorExampleApp());

Expand Down Expand Up @@ -79,13 +79,12 @@ class _HtmlEditorExampleState extends State<HtmlEditorExample> {
onButtonPressed:
(ButtonType type, bool? status, Function? updateStatus) {
print(
"button '${describeEnum(type)}' pressed, the current selected status is $status");
"button '${type.name}' pressed, the current selected status is $status");
return true;
},
onDropdownChanged: (DropdownType type, dynamic changed,
Function(dynamic)? updateSelectedItem) {
print(
"dropdown '${describeEnum(type)}' changed to $changed");
print("dropdown '${type.name}' changed to $changed");
return true;
},
mediaLinkInsertInterceptor:
Expand Down Expand Up @@ -136,7 +135,7 @@ class _HtmlEditorExampleState extends State<HtmlEditorExample> {
},*/
onImageUploadError: (FileUpload? file, String? base64Str,
UploadError error) {
print(describeEnum(error));
print(error.name);
print(base64Str ?? '');
if (file != null) {
print(file.name);
Expand Down Expand Up @@ -164,12 +163,33 @@ class _HtmlEditorExampleState extends State<HtmlEditorExample> {
plugins: [
SummernoteAtMention(
getSuggestionsMobile: (String value) {
var mentions = <String>[
'test1',
'test2',
'test3',
'taste1'
];
return mentions
.where((element) => element.contains(value))
.toList();
},
mentionsWeb: ['test1', 'test2', 'test3', 'taste1'],
onSelect: (String value) {
print(value);
}),
SummernoteCurlyBraceInsertion(
getVariablesMobile: (String value) {
var mentions = <String>['test1', 'test2', 'test3'];
return mentions
.where((element) => element.contains(value))
.toList();
},
mentionsWeb: ['test1', 'test2', 'test3'],
variablesWeb: [
' test1 }}',
' test2 }}',
' test3 }}',
' toast1 }}'
],
onSelect: (String value) {
print(value);
}),
Expand Down Expand Up @@ -296,6 +316,16 @@ class _HtmlEditorExampleState extends State<HtmlEditorExample> {
SizedBox(
width: 16,
),
TextButton(
style: TextButton.styleFrom(
backgroundColor:
Theme.of(context).colorScheme.secondary),
onPressed: () {
controller.insertHtml(
'''<p style="page-break-after:always;"></p>''');
},
child: Text('Insert Page Break',
style: TextStyle(color: Colors.white))),
TextButton(
style: TextButton.styleFrom(
backgroundColor:
Expand Down
Loading