Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
EchoEllet committed Sep 27, 2024
0 parents commit db8a4ed
Show file tree
Hide file tree
Showing 13 changed files with 2,449 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: 🧪 Run Tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
tests:
name: Check lints and tests
runs-on: ubuntu-latest

steps:
- name: 📦 Checkout repository
uses: actions/checkout@v4

- name: 🛠️ Set up Dart
uses: dart-lang/setup-dart@v1

- name: 🔍 Verify Dart installation
run: dart --version

- name: 📥 Install dependencies
run: dart pub get

- name: 🔍 Run Dart analysis
run: dart analyze

- name: 🧹 Check Dart code formatting
run: dart format --output=none --set-exit-if-changed .

- name: 🔍 Preview Dart proposed changes
run: dart fix --dry-run

- name: 📦 Check if package is ready for publishing
run: dart pub publish --dry-run

- name: 🧪 Run dart tests
run: dart test

7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://dart.dev/guides/libraries/private-files
# Created by `dart pub`
.dart_tool/

# Avoid committing pubspec.lock for library packages; see
# https://dart.dev/guides/libraries/private-files#pubspeclock.
pubspec.lock
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog

All notable changes to this project will be documented in this file.

## 10.8.1

* Seperate [dart_quill_delta](https://pub.dev/packages/dart_quill_delta) version from [flutter_quill](https://pub.dev/packages/flutter_quill). Discussed in [Flutter Quill #2259](https://github.com/singerdmx/flutter-quill/issues/2259)
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Flutter Quill project and open source contributors.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 📜 Dart Quill Delta

An unofficial Dart port of [quill-js-delta](https://github.com/quilljs/delta/), originally written in TypeScript.

This package provides a Dart implementation of the [Quill Delta](https://www.npmjs.com/package/quill-delta) format, which is a JSON-based data structure used to describe rich-text documents. For more details, refer to the official [Quill Delta documentation](https://quilljs.com/docs/delta/).

## 📖 Background

Previously, this package was part of the [flutter_quill](https://pub.dev/packages/flutter_quill) package, but it has since been separated into its own package. It maintains the same versioning as `flutter_quill`. The [Flutter Quill](http://github.com/singerdmx/flutter-quill) project forked this package from [quill_delta](https://pub.dev/packages/quill_delta).

## ⚠️ Future Plans

While this package is currently stable and does not have any significant issues, there have been discussions about introducing a **breaking change** release. This would enhance type safety and enforce the use of standard Quill Delta attributes, unless custom attributes are explicitly included. Currently, we have no plans to implement this change, but if introduced, it may be released as a separate package.

## 🛠️ Supported Projects

The following projects support or use this package:

- [flutter_quill_to_pdf](https://pub.dev/packages/flutter_quill_to_pdf)
- [flutter_quill_delta_from_html](https://pub.dev/packages/flutter_quill_delta_from_html)
- [flutter_quill_delta_easy_parser](https://pub.dev/packages/flutter_quill_delta_easy_parser)
- [flutter_quill](https://pub.dev/packages/flutter_quill)
- [markdown_quill](https://pub.dev/packages/markdown_quill)
- [quill_markdown](https://pub.dev/packages/quill_markdown)
- [delta_markdown](https://pub.dev/packages/delta_markdown)
- [super_editor_quill](https://pub.dev/packages/super_editor_quill)

## 📚 Documentation

For detailed usage and API references, refer to the official [Quill Delta documentation](https://quilljs.com/docs/delta/).

## 📜 Acknowledgments

* The original package [quill_delta](https://pub.dev/packages/quill_delta)
* [Delta Delta](https://github.com/slab/delta)
1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: package:lints/recommended.yaml
27 changes: 27 additions & 0 deletions example/dart_quill_delta_example.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import 'package:dart_quill_delta/dart_quill_delta.dart';

void main() {
var doc = Delta()..insert('Hello world', {'h': '1'});
var change = Delta()
..retain(6)
..delete(5)
..insert('Earth');
var result = doc.compose(change);
print('Original document:\n$doc\n');
print('Change:\n$change\n');
print('Updated document:\n$result\n');

/// Prints:
///
/// Original document:
/// ins⟨Hello world⟩ + {h: 1}
///
/// Change:
/// ret⟨6⟩
/// ins⟨Earth⟩
/// del⟨5⟩
///
/// Updated document:
/// ins⟨Hello ⟩ + {h: 1}
/// ins⟨Earth⟩
}
5 changes: 5 additions & 0 deletions lib/dart_quill_delta.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
library;

export './src/delta/delta.dart';
export './src/delta/delta_iterator.dart';
export './src/operation/operation.dart';
Loading

0 comments on commit db8a4ed

Please sign in to comment.