Skip to content

Commit

Permalink
Refactor and clean up repository (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
hjiangsu authored Apr 11, 2024
1 parent 24f0004 commit 59ac76b
Show file tree
Hide file tree
Showing 116 changed files with 4,424 additions and 1,532 deletions.
73 changes: 65 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Miscellaneous
*.class
*.lock
*.log
*.pyc
*.swp
Expand All @@ -15,29 +16,61 @@
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Visual Studio Code related
.classpath
.project
.settings/
.vscode/*

# Flutter repo-specific
/bin/cache/
/bin/internal/bootstrap.bat
/bin/internal/bootstrap.sh
/bin/mingit/
/dev/benchmarks/mega_gallery/
/dev/bots/.recipe_deps
/dev/bots/android_tools/
/dev/devicelab/ABresults*.json
/dev/docs/doc/
/dev/docs/api_docs.zip
/dev/docs/flutter.docs.zip
/dev/docs/lib/
/dev/docs/pubspec.yaml
/dev/integration_tests/**/xcuserdata
/dev/integration_tests/**/Pods
/packages/flutter/coverage/
version
analysis_benchmark.json

# packages file containing multi-root paths
.packages.generated

# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
**/generated_plugin_registrant.dart
.packages
.pub-preload-cache/
.pub-cache/
.pub/
build/
flutter_*.png
linked_*.ds
unlinked.ds
unlinked_spec.ds

# Android related
**/android/**/gradle-wrapper.jar
**/android/.gradle
.gradle/
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java
**/android/key.properties
*.jks

# iOS/XCode related
**/ios/**/*.mode1v3
Expand All @@ -56,23 +89,47 @@ build/
**/ios/**/profile
**/ios/**/xcuserdata
**/ios/.generated/
**/ios/Flutter/.last_build_id
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Flutter.podspec
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/ephemeral
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/Flutter/flutter_export_environment.sh
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*

# macOS
**/Flutter/ephemeral/
**/Pods/
**/macos/Flutter/GeneratedPluginRegistrant.swift
**/macos/Flutter/ephemeral
**/xcuserdata/

# Windows
**/windows/flutter/generated_plugin_registrant.cc
**/windows/flutter/generated_plugin_registrant.h
**/windows/flutter/generated_plugins.cmake

# Linux
**/linux/flutter/generated_plugin_registrant.cc
**/linux/flutter/generated_plugin_registrant.h
**/linux/flutter/generated_plugins.cmake

# Coverage
coverage/

# Symbols
app.*.symbols

# Exceptions to above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
coverage

pubspec.lock
!/dev/ci/**/Gemfile.lock
!.vscode/settings.json
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

13 changes: 13 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"dart.lineLength": 200,
"[dart]": {
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.rulers": [
200
],
"editor.codeActionsOnSave": {
"source.fixAll": "always",
}
},
}
55 changes: 2 additions & 53 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,3 @@
## [2.2.0] - 2023/01/02
## [0.1.0] - 2024/04/10

* Change the way of adding links to the input. Now, you need to select the text you want to be the label, then click the link button.
A dialog will show where you can enter the link.

## [2.1.0] - 2022/11/17

* Add textStyle property

## [2.0.4] - 2022/10/28

* Do not dispose controller when it is passed as an argument
* Fix RTL selection
* Update library dependencies
* Bind textStyle of the TextField to the bodyText1 ThemeData

## [2.0.3] - 2022/10/19

* Add a node to request focus and get back to field on any action click.
* Add possibility to pass validator as null.

## [2.0.2] - 2021/10/26

* Add a controller parameter

## [2.0.1] - 2021/07/30

* Add support for strikethrough, code, blockquote, separator and images.
* Custom actions supported by the input.

## [2.0.0] - 2021/04/01

* Migrate to null-safety.

## [1.0.2] - 2021/02/11

* Reposition cursor if style applied while no text were selected

## [1.0.1] - 2020/08/13

* Add web support

## [1.0.0] - 2020/07/07

* Add RTL support

## [0.0.2] - 2020/02/19

* Remove unused dependency
* Add more docs

## [0.0.1] - 2020/02/18

* Initialize project
* Removed [MarkdownTextInput] and separated [MarkdownTextInput] into [MarkdownTextInputField] and [MarkdownButtons] widgets.
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Copyright 2020 Playmoweb
Copyright 2024 Thunder

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Expand Down
72 changes: 28 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,28 @@
[![Build Status](https://travis-ci.org/playmoweb/markdown-editable-textinput.svg?branch=master)](https://travis-ci.org/playmoweb/markdown-editable-textinput)
[![pub package](https://img.shields.io/pub/v/markdown_editable_textinput.svg)](https://pub.dev/packages/markdown_editable_textinput)
[![codecov](https://codecov.io/gh/playmoweb/markdown-editable-textinput/branch/master/graph/badge.svg)](https://codecov.io/gh/playmoweb/markdown-editable-textinput)

# markdown_editable_textinput

MarkdownEditableTextInput is a TextField Widget that allow you to convert easily what's in the TextField to Markdown.

## Features
- [x] Convert to Bold, Italic, Strikethrough
- [x] Convert to Code, Quote, Links
- [x] Convert to Heading (H1, H2, H3, H4, H5, H6) and Links
- [x] Support text direction

## Demo
![](pictures/test_edition.gif)

### Link by Dialog demo
![](pictures/link_demo.gif)

## Usage
The color of the MarkdownTextInput is defined by the color set in your Theme :
- primaryColor: Cursor's color
- colorScheme.secondary: MarkdownTextInput's borders
- cardColor: Background color of MarkdownTextInput

### Attributes
| Attributes | Example Value | Description |
|:--------------------------------:|:----------------------------------------:|:--------------------------------------------------------------------:|
| Function onTextChanged | | Callback used to retrieve the text in parent's Widget |
| String initialValue | "Lorem Ipsum" | Display an initial value in MarkdownTextInput's field |
| Function validators | | Add validators to the MarkdownTextInput |
| String label | "Description" | Display a label in MarkdownTextInput |
| TextDirection textDirection | TextDirection.rtl | Change text direction |
| int maxLines | 3 | The maximum of lines that can be display in the input |
| List<MarkdownType> actions | [MarkdownType.bold, MarkdownType.italic] | Actions the editor will handle |
| TextEditingController controller | TextEditingController() | Pass your own controller. Can be used to clear the input for example |
| TextStyle textStyle | Theme.of(context).textTheme.bodyText2 | Overrides input text style |
| bool insertLinksByDialog; | true | Choose to use dialog or not to insert link |

### Example
You can see an example of how to use this package [here](https://github.com/playmoweb/markdown-editable-textinput/tree/master/example)


# Markdown Editor

A set of utility widgets that convert Text to Markdown. Extended to support custom Lemmy syntax.

Provides `MarkdownToolbar` and `MarkdownTextInputField` widgets.

## Markdown Support
The following markdown syntax is supported by this package:
- Bold: `MarkdownType.bold`
- Italics: `MarkdownType.italic`
- Strikethrough: `MarkdownType.strikethrough`
- Links: `MarkdownType.link`
- Headings: `MarkdownType.title`
- Lists: `MarkdownType.list`
- Code: `MarkdownType.code`
- Block quotes: `MarkdownType.blockquote`
- Dividers: `MarkdownType.separator`
- Images: `MarkdownType.image`

### Custom Markdown
Custom markdown actions have been added to handle Lemmy specific syntax. This includes
- User format `@[email protected]`
- Community format `[email protected]`
- Spoiler tags

## Acknowledgements

Original implementation by [Playmoweb](https://github.com/playmoweb/markdown-editable-textinput).
Loading

0 comments on commit 59ac76b

Please sign in to comment.