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

[pull] master from afry:master #2

Open
wants to merge 90 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
704a1bf
Adds: fixed positioning, disabled items, loading indicator, and progr…
cgross Sep 1, 2020
8364681
v3.0.0
MadSpindel Sep 1, 2020
c14dec9
bugfix: allow pasting text to filter mention menu appropriately (#180)
cgross Mar 4, 2021
f7a6446
v3.0.1
MadSpindel Mar 4, 2021
9a1b628
Added selectKeys method for choosing which key codes will trigger the…
peregraum Mar 4, 2021
b3da304
v3.0.2
MadSpindel Mar 4, 2021
db64d98
feat: mention-click (#195)
Apr 23, 2021
dc69542
Adding aria tags for screen reader accessibility (#196)
cgross Apr 23, 2021
3872677
v3.0.3
MadSpindel Apr 23, 2021
ba8fbf5
optimize: mention node auto remove click event (#211)
shooterRao Jul 13, 2021
46aafb7
Update package-lock.json
MadSpindel Jul 13, 2021
02379fe
Update packages
MadSpindel Jul 13, 2021
074dcc2
v3.0.4
MadSpindel Jul 13, 2021
93b1ba9
fix: fix repeat binding of the mention click event (#217)
shooterRao Nov 23, 2021
6a9af65
v3.0.5
MadSpindel Nov 23, 2021
036661d
Update rollup.config.js
MadSpindel Nov 25, 2021
98a2726
v3.0.6
MadSpindel Nov 25, 2021
483a0ae
update: dependencies' versions (#224)
grg-kvl Nov 25, 2021
308bfd6
Update package-lock.json
MadSpindel Nov 25, 2021
5b3ac28
prevent rendering list on empty content (#185)
fortranlee Nov 25, 2021
38c1b36
v3.0.7
MadSpindel Nov 25, 2021
312704e
Feature/hover callback (#227)
grg-kvl Dec 1, 2021
58b4f78
v3.0.8
MadSpindel Dec 1, 2021
c640f1b
Update README.md
MadSpindel Dec 26, 2021
08fd8c9
feat: add onBeforeClose callback (#230)
OldDream Dec 26, 2021
19a8245
Create CNAME
MadSpindel Dec 26, 2021
2396ff3
v3.0.9
MadSpindel Dec 26, 2021
0aa9847
v3.1.0
MadSpindel Dec 26, 2021
6b50437
Update quill.mention.js
TimDirks Jun 20, 2022
69dd501
Update index.js
TimDirks Jun 20, 2022
851f192
Update README.md
TimDirks Jun 20, 2022
126537a
Update quill.mention.js
TimDirks Jun 20, 2022
a588df8
Update index.js
TimDirks Jun 20, 2022
8135360
Bind all option-functions so they have a reasonable context (#277)
angelaki May 4, 2023
975228d
v3.2.0
MadSpindel May 4, 2023
109328c
automagically --> automatically (#274)
0xJaskeerat May 4, 2023
8c5dae7
use optionally overridden options in custom onSelect
pal-alex Jun 14, 2023
b7ecaff
return inserted delta
pal-alex Jun 20, 2023
84223d5
clean up function signatures
pal-alex Jul 5, 2023
bc121d5
update insertItem description
pal-alex Jul 5, 2023
4f27634
restore wrong changes
pal-alex Jul 5, 2023
af6c4ba
Merge pull request #279 from pal-alex/master
pal-alex Jul 18, 2023
225e772
v3.3.0
MadSpindel Jul 18, 2023
f09ab4a
Update packages
MadSpindel Jul 18, 2023
75b4211
Upgrade ava
MadSpindel Jul 18, 2023
4e02596
Merge pull request #251 from TimDirks/hotfix/inline-mention-range-bug
TimDirks Jul 24, 2023
5000cff
Merge pull request #252 from TimDirks/feature/allow-mention-char-inline
TimDirks Jul 24, 2023
dc1a78c
v3.4.0
MadSpindel Jul 25, 2023
b5bdf9e
run npm audit fix --force
oliviasculley Sep 6, 2023
46e78cd
bump patch version
oliviasculley Sep 6, 2023
125636a
Merge pull request #340 from SimplyBinary/npm-audit-fix
oliviasculley Sep 7, 2023
893c9ca
support custom HTML blot and item rendering
oliviasculley Sep 8, 2023
880e11f
bump version to 4.0.0
oliviasculley Sep 6, 2023
39cf8f7
run npm build
oliviasculley Sep 6, 2023
6972655
update documentation
oliviasculley Sep 7, 2023
6e04010
add custom blot styling to advanced demo
oliviasculley Sep 8, 2023
e85262d
Merge pull request #341 from SimplyBinary/fix-inner-html
oliviasculley Sep 11, 2023
4aef829
added a few files to gitignore
artknight Sep 30, 2023
fe21f9a
build the project
artknight Sep 30, 2023
01e4984
fixed quill-mention to work with Quill v2
artknight Oct 1, 2023
b533527
quick build
artknight Oct 1, 2023
b1f216a
exposing /dist directory
artknight Oct 2, 2023
c8ce0a8
add lint script and add prettier to tests
oliviasculley Oct 4, 2023
12f4922
npm run lint and build
oliviasculley Oct 4, 2023
65f6c32
bump version
oliviasculley Oct 4, 2023
56adc27
add github actions for ci
oliviasculley Oct 4, 2023
ce38aea
Merge pull request #345 from quill-mention/prettier
oliviasculley Oct 5, 2023
73956be
Use native scrollIntoView method so it correctly accounts for padding…
StefKors Nov 1, 2023
dd8bd6b
npm install
StefKors Nov 2, 2023
294de12
lint
StefKors Nov 2, 2023
3d39ec6
4.1.0
StefKors Nov 2, 2023
f2801f2
Merge pull request #351 from StefKors/native-scrollInfoView
oliviasculley Nov 2, 2023
6f563c1
cleanup
artknight Apr 30, 2024
1f5efe2
Merge remote-tracking branch 'quill-mention/master'
artknight Apr 30, 2024
a5d354d
ran prettier
artknight Apr 30, 2024
f2dda63
Merge pull request #376 from artknight/master
artknight May 3, 2024
e9ee456
Revert "Fixes for Quill 2.0" (#377)
MadSpindel May 3, 2024
2f684e9
Artknight changes (#375)
dan-bartlettroofs May 3, 2024
1fe6f07
v5.0.0
MadSpindel May 3, 2024
88e4019
Restore min.js build step (#379)
BreizHell May 6, 2024
11d94e1
Use Quill 2.0.1 in demo
MadSpindel May 6, 2024
78d8533
v5.0.1
MadSpindel May 6, 2024
0cb9fe4
Rewrite module with typescript (#369)
jeromeheissler May 14, 2024
b6d371f
Update package-lock.json
MadSpindel May 14, 2024
46d9d24
v6.0.0
MadSpindel May 14, 2024
010ee4d
Remove cjs build because Quill 2 is now an ESM package (#386)
jeromeheissler Jun 13, 2024
a581268
v6.0.1
MadSpindel Jun 13, 2024
3711434
Github Actions npm deploy script (#414)
oliviasculley Oct 29, 2024
c7dcbcd
add default to exports in package json (#402)
premdas26 Oct 31, 2024
dd5e67c
v6.0.2
MadSpindel Oct 31, 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
8 changes: 0 additions & 8 deletions .babelrc

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Run CI

on:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v4

- name: Install npm
uses: actions/setup-node@v3
with:
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Test
run: npm run test
45 changes: 45 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout project
uses: actions/checkout@v4

- name: Install npm
uses: actions/setup-node@v4
with:
cache-dependency-path: package-lock.json
cache: "npm"
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'

- uses: actions/cache@v3
id: npm-cache
with:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci

- name: Build
run: npm run build

- name: Publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: |
npm config set init-author-name "quill-mention"
npm config set init-author-email "[email protected]"
npm config set init-author-url "https://quill-mention.com"
npm publish --provenance --access public
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,6 @@ dist

# TernJS port file
.tern-port

# tsimp compiler cache
.tsimp
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"files.eol": "\n",
"files.insertFinalNewline": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
"editor.formatOnSave": false
}
132 changes: 101 additions & 31 deletions README.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
quill-mention.com
196 changes: 183 additions & 13 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
<meta charset="utf-8" />
<title>Quill Mention</title>
<meta name="description" content="Quill Mention Demo" />
<link
href="https://cdn.quilljs.com/1.3.6/quill.snow.css"
rel="stylesheet"
/>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/quill.snow.css" rel="stylesheet" />
<link href="quill.mention.min.css" rel="stylesheet" />
<style>
body {
Expand Down Expand Up @@ -44,39 +41,109 @@ <h1>Quill Mention</h1>
for the Quill rich text editor.
</p>

<h2>Demo</h2>
<h2>Simple Demo</h2>
<!-- Create the editor container -->
<div id="editor"></div>

<br />
<h2>Advanced Demo</h2>
<p>
Asynchronous retrieval, disabled items (i.e. group headers), loading
message, programmatic methods, and custom blot rendering
</p>
<div id="editor2"></div>
<div style="margin-top: 5px">
<button onclick="showMenu()">Show @ Menu</button>
<button onclick="addMention()">Add Mention Programmatically</button>
</div>

<h2>License</h2>
<p>This project is licensed under the MIT License</p>
<p><a href="https://github.com/afry/quill-mention">View on GitHub</a></p>

<!-- Include the Quill library -->
<script src="https://cdn.quilljs.com/1.3.6/quill.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/quill.js"></script>
<script src="quill.mention.min.js"></script>

<!-- Initialize Quill editor -->
<script>
const atValues = [
{ id: "515fd775-cb54-41f3-b921-56163871e2cf", value: "Mickey Dooley" },
{
id: "3f0b7933-57b8-4d9d-b238-f8af62b2e945",
value: "Desmond Waterstone"
value: "Desmond Waterstone",
},
{ id: "711f68ab-ca20-4011-ab0f-d98c8fac4c05", value: "Jeralee Fryd" },
{ id: "775e05fc-72bc-48a1-9508-5c61674734f1", value: "Eddie Hucquart" },
{ id: "e8701885-105e-4a21-b200-98e559776655", value: "Nathalia Whear" }
{ id: "e8701885-105e-4a21-b200-98e559776655", value: "Nathalia Whear" },
];

const hashValues = [
{ id: "0075256a-19c2-4a2d-b549-627000bcc3bc", value: "Accounting" },
{
id: "91e8901b-e3bf-4158-8ddf-7f5d9e8cbb7f",
value: "Product Management"
value: "Product Management",
},
{ id: "c3373e89-7ab8-4a45-8b69-0b0cc49d89a9", value: "Marketing" },
{ id: "fa22f1d2-16c8-4bea-b869-8acad16e187a", value: "Engineering" },
{ id: "fe681168-f315-42f0-b78b-b1ea787fa1fd", value: "Accounting" }
{ id: "fe681168-f315-42f0-b78b-b1ea787fa1fd", value: "Accounting" },
];

const advancedValues = [
{
id: "1",
value: "Manuel Neuer",
team: "Bayern Munich",
color: "green",
},
{
id: "2",
value: "Robert Lewandowski",
team: "Bayern Munich",
color: "blue",
},
{
id: "3",
value: "Thomas Muller",
team: "Bayern Munich",
color: "red",
},
{
id: "4",
value: "Roman Burki",
team: "Borussia Dortmund",
color: "orange",
},
{
id: "5",
value: "Jadon Sancho",
team: "Borussia Dortmund",
color: "black",
},
{
id: "6",
value: "Marco Reus",
team: "Borussia Dortmund",
color: "yellow",
},
{
id: "7",
value: "Alexander Nubel",
team: "Schalke 04",
color: "purple",
},
{
id: "8",
value: "Bastian Oczipka",
team: "Schalke 04",
color: "indigo",
},
{
id: "9",
value: "Weston McKennie",
team: "Schalke 04",
color: "violet",
},
];

var quill = new Quill("#editor", {
Expand All @@ -85,7 +152,7 @@ <h2>License</h2>
mention: {
allowedChars: /^[A-Za-z\sÅÄÖåäö]*$/,
mentionDenotationChars: ["@", "#"],
source: function(searchTerm, renderList, mentionChar) {
source: function (searchTerm, renderList, mentionChar) {
let values;

if (mentionChar === "@") {
Expand All @@ -107,9 +174,112 @@ <h2>License</h2>
matches.push(values[i]);
renderList(matches, searchTerm);
}
}
}
},
},
},
});

const MentionBlot = Quill.import("blots/mention");

class StyledMentionBlot extends MentionBlot {
static render(data) {
const element = document.createElement("span");
element.innerText = data.value;
element.style.color = data.color;
return element;
}
}
StyledMentionBlot.blotName = "styled-mention";

Quill.register(StyledMentionBlot);

var quill2 = new Quill("#editor2", {
placeholder: "Start by typing @ for mentions",
modules: {
mention: {
allowedChars: /^[A-Za-z\sÅÄÖåäö]*$/,
mentionDenotationChars: ["@"],
positioningStrategy: "fixed",
renderItem: (data) => {
if (data.disabled) {
const div = document.createElement("div");
div.style =
"height:10px;line-height:10px;font-size:10px;background-color:#ccc;margin:0 -20px;padding:4px";
div.innerText = data.value;
return div;
}
return data.value;
},
renderLoading: () => {
return "Loading...";
},
source: function (searchTerm, renderList, mentionChar) {
var matches = [];

if (searchTerm.length === 0) {
matches = advancedValues;
} else {
for (i = 0; i < advancedValues.length; i++)
if (
~advancedValues[i].value
.toLowerCase()
.indexOf(searchTerm.toLowerCase())
)
matches.push(advancedValues[i]);
}

//create group header items
var matchesWithGroupHeaders = [];
var currentTeam;
for (i = 0; i < matches.length; i++) {
var match = matches[i];
if (currentTeam !== match.team) {
matchesWithGroupHeaders.push({
id: match.team,
value: match.team,
disabled: true,
});
currentTeam = match.team;
}
matchesWithGroupHeaders.push(match);
}
matches = matchesWithGroupHeaders;

window.setTimeout(() => {
renderList(matches, searchTerm);
}, 1000);
},
dataAttributes: [
"id",
"value",
"denotationChar",
"link",
"target",
"disabled",
"color",
],
blotName: "styled-mention",
},
},
});

function showMenu() {
quill2.getModule("mention").openMenu("@");
}

function addMention() {
quill2.getModule("mention").insertItem(
{
denotationChar: "@",
id: "123abc",
value: "Hello World",
},
true
);
}

window.addEventListener("mention-clicked", function (event) {
console.log(event);
});
</script>
</body>
Expand Down
1 change: 1 addition & 0 deletions docs/quill.mention.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading