Skip to content

Commit

Permalink
Merge pull request #155 from kommitters/v2.0
Browse files Browse the repository at this point in the history
Release v2.0.9
  • Loading branch information
miguelnietoa authored Sep 13, 2022
2 parents ecf8168 + c1040ee commit 72bb08f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 18 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
# Only the default branch is supported.
branch_protection_rule:
schedule:
- cron: '29 12 * * 3'
- cron: '0 0 * * 0'
push:
branches: [ "main" ]

Expand All @@ -17,20 +17,17 @@ jobs:
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Used to receive a badge. (Upcoming feature)
# Used to receive a badge.
id-token: write
# Needs for private repositories.
contents: read
actions: read


steps:
- name: "Checkout code"
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@3e15ea8318eee9b333819ec77a36aca8d39df13e # v1.1.1
uses: ossf/scorecard-action@68bf5b3327e4fd443d2add8ab122280547b4a16d # v2.0.2
with:
results_file: results.sarif
results_format: sarif
Expand All @@ -41,22 +38,22 @@ jobs:
# repo_token: ${{ secrets.SCORECARD_READ_TOKEN }}

# Publish the results for public repositories to enable scorecard badges. For more details, see
# https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories, `publish_results` will automatically be set to `false`, regardless
# https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories, `publish_results` will automatically be set to `false`, regardless
# of the value entered here.
publish_results: true

# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@5f532563584d71fdef14ee64d17bafb34f751ce5 # v1.0.26
uses: github/codeql-action/upload-sarif@c7f292ea4f542c473194b33813ccd4c207a6c725 # v2.1.21
with:
sarif_file: results.sarif
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 2.0.9 (13.09.2022)

- Add OpenSSF BestPractices & Scorecard badges
- Add CDN version documentation

## 2.0.8 (08.08.2022)

- Add scorecards actions
Expand Down
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
![](https://badgen.net/badge/Editor.js/v2.0/blue)

# EditorJS Undo Plugin
![](https://badgen.net/badge/Editor.js/v2.0/blue)
[![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/6471/badge)](https://bestpractices.coreinfrastructure.org/projects/6471)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/kommitters/editorjs-undo/badge)](https://api.securityscorecards.dev/projects/github.com/kommitters/editorjs-undo)

Undo/Redo feature for [Editor.js](https://editorjs.io).

Expand All @@ -16,7 +17,7 @@ This new version introduces breaking changes. Remember that it is still in beta
Please, report bugs or behavior issues :).

#### What's new?
* Overall plugin performance is improved, especially with large documents.
* Overall plugin performance is improved, especially with large documents.
* Undo/Redo lifecycle is managed through block updates instead of a full document render.
* Solves issues in documents with several images, for example the blink with undo/redo.
* Sets the caret in the respective position when the user is typing inside an existing text.
Expand Down Expand Up @@ -45,6 +46,16 @@ Include module in your application
import Undo from 'editorjs-undo';
```

### Load from CDN

You can load a specific version of the package from [jsDelivr CDN](https://www.jsdelivr.com/package/npm/editorjs-undo).

Require this script on a page with Editor.js.

```html
<script src="https://cdn.jsdelivr.net/npm/editorjs-undo"></script>
```

## Usage

```javascript
Expand All @@ -59,7 +70,7 @@ On the editor, use <kbd>Ctrl</kbd> + <kbd>Z</kbd> or <kbd>⌘</kbd> + <kbd>Z</kb

### Usage with [react-editor-js](https://github.com/Jungwoo-An/react-editor-js).

If you are using [react-editor-js](https://github.com/Jungwoo-An/react-editor-js), you could create a function to handle the onReady property, the function will store the undo instance and the respective configuration or initialize method if you want to use them (they will be explained below). Then, you must call the function in onReady in the editorJS instance.
If you are using [react-editor-js](https://github.com/Jungwoo-An/react-editor-js), you could create a function to handle the onReady property, the function will store the undo instance and the respective configuration or initialize method if you want to use them (they will be explained below). Then, you must call the function in onReady in the editorJS instance.

```javascript
const handleReady = (editor) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "editorjs-undo",
"version": "2.0.8",
"version": "2.0.9",
"keywords": [
"undo",
"redo",
Expand Down

0 comments on commit 72bb08f

Please sign in to comment.