slab / parchment Goto Github PK
View Code? Open in Web Editor NEWGeneralized state model for rich-text editors to interface with browser DOM
License: BSD 3-Clause "New" or "Revised" License
Generalized state model for rich-text editors to interface with browser DOM
License: BSD 3-Clause "New" or "Revised" License
The structure of the default exported value for 'parchment' has significantly changed. As a result it is impossible to use custom Blots and/or Attributors implemented for Quill 1 without modifying them. Was this change intentional?
Old structure:
let Parchment = {
Scope: Registry.Scope,
create: Registry.create,
find: Registry.find,
query: Registry.query,
register: Registry.register,
Parent: ParentBlot,
Container: ContainerBlot,
Leaf: LeafBlot,
Embed: EmbedBlot,
Scroll: ScrollBlot,
Block: BlockBlot,
Inline: InlineBlot,
Text: TextBlot,
Attributor: {
Attribute: Attributor,
Class: ClassAttributor,
Style: StyleAttributor,
Store: AttributorStore,
}
}
New structure:
export {
Registry as default,
ParentBlot,
ContainerBlot,
LeafBlot,
EmbedBlot,
ScrollBlot,
BlockBlot,
InlineBlot,
TextBlot,
Attributor,
ClassAttributor,
StyleAttributor,
AttributorStore,
};
How is it supposed to work?
I see in registry.ts
file lines of code where we create WeakMap
and check has
and get
. But I can't find any line of code where we add elements to the WeakMap
?? Where we set
blots?
https://github.com/quilljs/parchment/blob/2.0/src/registry.ts#L23
I want to allow SVG tags in the Quill editor. However, I do not know why, but it will not work. Should it be possible?
ScrollBlot
extends ContainerBlot
and its optimize method has type:
ScrollBlot.optimize(mutations: MutationRecord[] = [], context: {[key: string]: any} = {}): void
ContainerBlot
's optimize
has type:
ContainerBlot.optimize(context: {[key: string]: any})
Because of the order of the parameters, the first is not a supertype of the second as it should be.
// Useful search functions for descendant(s), should not modify
descendant(type: BlotClass, index: number, inclusive): Blot
descendents(type: BlotClass, index: number, length: number): Blot[];
Should be descendants - a tiny change
Thank you
The latest parchment supports having a UI element at the start of a blot (eg for list items). Would it be acceptable to submit a pull request that adds support for these elements at the end of a blot? Our particular use case is adding a newline character to the end of a Block
. At the moment we fudge this manually, but manipulating the DOM outside of Quill can be a little hairy, and it would be nicer if we could work with Quill rather than against it.
I noticed that the insertBefore method for ShadowBlot passes an incorrect parameter to the underlying domNode.insertBefore method. The second argument is passed as undefined instead of null when refDomNode is not set.
MDN specifies that it should be passed null as behavior is inconsistent across browsers when it is passed other (invalid) values.
I have fixed this and am making a pull request shortly.
See https://developer.mozilla.org/en-US/docs/Web/API/Node/insertBefore
node_modules/parchment/dist/src/parchment has no exported member 'Parchment'.
1.6.0
Hello,
I am trying to figure out how to force ScrollBlot to be a table>tbody and only allow first level children to be Blots represented by tr
and td
tag ( e.g. smallest block level Blot is single cell table row).
I understand I need to define my block blot with tag tr
and override some methods on the blot class.
How do I approach ScrollBlot ?
Is it possible to create a single blot that acts as an inline, block and embed blot?
I use indent in quill editor , it generate only indent class not inline style. I face the problem. Its not render in the html page. what I see in the editor
In the class and options interface for Attributor the whitelist type is string[] | undefined but in the class constructor and canAdd functions whitelist is compared with null. Wouldn't this cause the comparison to always return false?
I have made a InlineBlot implementation, i want to be aware when it is delete for some purpose but when i implement the deleteAt function
it either :
deleteAt(index, length) {
console.log('DELETE');
}
Uncaught TypeError: Cannot read property 'call' of undefined
:deleteAt(index, length) {
console.log('DELETE');
super.deletAt(index.length);
// Parchment.Container.proptype.deleteAt.call(this, index, length);
}
How could i do that without having this error, or is there another way to get notified when my blot will be removed ?
Current Situation
ShadowBlot of Parchement does not allow falsey attribute values like 0
or false
. This leads to unexpected behavior, since it may be legitim to store values like 0
or false
in an attribute value.
Problem
This piece of code is responsible for the behavior:
The if statement in Line 81 checks value
.
If it is falsey, the blot is not created.
Solution Proposal
The if condition should be changed to something like:
if (Registry.query(name, Registry.Scope.BLOT) != null && (value !== undefined || value !== null ))
Remark
I'm really new to Parchment. I don't know why value
is checked at all and I don't know the implications of the proposed change.
Any comment on this is welcome, thx!
I was checking out yarn
today (new package manager to replace npm client), and it complained on a project I have that uses Quill, with:
$ yarn
yarn install v0.15.1
info No lockfile found.
[1/4] 🔍 Resolving packages...
[...]
[2/4] 🚚 Fetching packages...
error [email protected]: The engine "node" is incompatible with this module. Expected version "^5.3".
error Found incompatible module
info Visit http://yarnpkg.com/en/docs/cli/install for documentation about this command.
lola:~/src/participedia/frontend on master*
FYI:
$ node --version
v6.4.0
Which makes me think that it may make sense to make the engine line in package.json
be more generous, maybe using >=
instead of ^
.
I'm no package.json versioning expert though.
I'm getting a weird error when trying to find a descendant
of a certain blot-class on pasted-in content. If I have e.g.
var contents = {"ops":[{"attributes":{"color":"#565657"},"insert":"abc "},
{"insert":"def "},
{"attributes":{"color":"#565657"},"insert":"xyz"}]};
quill.setContents(contents);
and I have defined a class MyBlot extends Inline with tagName span,
then quill.scroll.descendant claims the third insertion is an instanceof MyBlot.
Full example at:
https://jsfiddle.net/fjg11pg6/1/
Also, if I have actual MyBlot's inside one of these colour spans, the answer from descendant(MyBlot, …)
will be the text following the MyBlot.
I was reading through the Parchment source code, and this line looked odd:
https://github.com/quilljs/parchment/blob/master/src/registry.ts#L81
Shouldn't that be a test for equality, rather than an assignment? i.e.
if (match === classes[names[i]]) ...
Apologies if I've misunderstood the intent of the code, or if there's some javascript cleverness here I'm missing. Thanks for all your hard work on Quill and Parchment!
I'd like to propose adding an editorconfig to the repo so that people using different IDE's can easily use a consistent code style (in this case 2 spaces) with the project.
I wrote a custom blot that extends blot/container to wrap several lines into a collapsible element (something that can e.g. be toggled via the bootstrap collapse functionality). I can create such a container and place any other blots inside, embeds, inlines and blocks alike. Copy & paste also causes no problems.
The issue I have occurs when I try to select multiple lines and turn those into a collapsible section. Inline-blots like bold and italic remain unchanged, however any block blot gets completely replaced by the blot type I have set as defaultChild in my class. I assume that the problem here is that I have to set the scope as Parchment.Scope.BLOCK_BLOT for it to work. I have traced the issue to this line in the FormatBlot class, where it replaces one block element with another (probably to prevent nesting of certain block elements that shouldn't allow it?)
So I was wondering if it might be a good idea to add another If there, checking whether the new blot is an instance of Container, and if so use this.wrap instead of this.replaceWith. Would it be easily possible to add a check like that, or might that break other parts of the editor?
I am trying to maintain TypeScript definitions for Quill at the DefinitelyTyped repo.
After using it for a while I realized just having the public APIs declared in the documentations doesn't quite complete the definitions. Because as soon as I try to extend using custom Blots and Formats I run into missing type definitions.
While I can continue to build the TypeScript definitions to add all the formats and blots that Quill supports, fact that most of them inherit from Parchement got me thinking. Since Parchment is written in TS, generating definitions for it should be trivial. I tried it and I had to make a few minor changes in the tsconfig and two other classes to be able to generate TS definitions for Parchments. It will need more work to include it as a part of the webpack build process.
Coming to the questions
I believe we have traces of this problem happening in a lot of places, and it should be kind of easy to fix, but maybe not really to understand:
#14
slab/quill#2312
area17/twill#458
slab/quill#889
This error is occurring in Quill when the list of nodes are, somehow, problematic.
This is a simple console.log()
of blot.domNode
:
As you can see the error occurs while processing a <br>
, on line 121:
Because that line is compiled to
if (blot.domNode[Registry.DATA_KEY].mutations == null) ...
But it could be prevented by just:
if (blot.domNode[Registry.DATA_KEY] && blot.domNode[Registry.DATA_KEY].mutations == null) ...
Because what happens is that this particular node doesn't exists, so a mutation property is, of course, undefined.
I think that this project's code is quite beautiful and elegant (for example, Blot ). I find it striking, however, that there is no in-code documentation that describes the API.
I'm just busy learning Parchment, and good documentation in your code would have really helped me understand the intent behind many of the methods.
I've been trying to improve the type definitions for Quill and have been running into this issue lately. There are quite a few places where something is typed as being Blot
(from the interface) or BlotConstructor
(an interface with new(): Blot
). The largest issue with the Blot/BlotConstructor interface is that it requires defining static and instance properties/methods in different places. Instead you should be able to use the base Blot class ShadowBlot
as a class, and where you need its constructor use typeof ShadowBlot
.
Hi,
I try to develop a bulma message integration for Quill.
Message are defined like this:
<article class="message is-danger">
<section class="message-body">
<div class="media">
<div class="media-left">
<span class="icon is-large is-danger">
<i class="fas fa-exclamation-circle fa-3x"></i>
</span>
</div>
<div class="media-content">My message, the content what I want to edit.</b></div>
</div>
</section>
</article>
The content can ben whatever (text, list, another bulma message, etc.).
I have experiment this, but the content are not editable:
let Embed = Quill.import('blots/embed');
let Container = Quill.import('blots/container');
class Message extends Container {
static create(value) {
return super.create(value);
}
}
class MessageDanger extends Embed {
static register() {
Quill.register(Message);
}
static create(value) {
let node = super.create(value);
console.log("create");
return node;
}
constructor(domNode) {
super(domNode);
console.log("constructor");
let node = domNode;
node.setAttribute("class", "message is-danger");
let section = document.createElement("section");
section.setAttribute("class", "message-body");
let divMedia = document.createElement("div");
divMedia.setAttribute("class", "media");
let divMediaLeft = document.createElement("div");
divMediaLeft.setAttribute("class", "media-left");
divMediaLeft.setAttribute("contenteditable", "false");
let spanIcon = document.createElement("span");
spanIcon.setAttribute("class", "icon is-large is-danger");
let iIcon = document.createElement("i");
iIcon.setAttribute("class", "fas fa-exclamation-circle fa-w-16 fa-3x");
spanIcon.appendChild(iIcon);
divMediaLeft.appendChild(spanIcon);
let divMediaContent = document.createElement("div");
divMediaContent.setAttribute("class", "media-content");
divMedia.appendChild(divMediaLeft);
divMedia.appendChild(divMediaContent);
section.appendChild(divMedia);
console.log("lenght: ", node.childList);
while (node.hasChildNodes()) {
console.log("remove child");
node.removeChild(node.lastChild);
}
console.log("node: ", node);
node.appendChild(section);
}
}
MessageDanger.blotName = 'message-danger';
MessageDanger.className = 'message-danger';
MessageDanger.tagName = 'ARTICLE';
Quill.register(MessageDanger, true);
Quill.register(Message, true);
Message.blotName = 'message';
Message.className = 'message-container';
Message.tagName = 'SECTION';
Message.allowedChildren = [MessageDanger];
MessageDanger.requiredContainer = Message;
How can I do that ? I don't know if it is the correct way to do, according to what I want.
Hello,
I'm using quill and I try to write a custom ColorClass attributor. Indeed, the one given in quill replace as expected full letters color styles by classes, but also rgb color styles by classes with hexadecimal notation. My issue is that I'm migrating from a previous editor and the old content could contain any kind of rgb values. I cannot create a class for each rgb values possibles (256^3 values). Thus, I need my attributor to convert styles to classes only for plain text colors and ignore rgb colors.
How this could be done ? I'm searching a way of accomplishing this for more than 2 hours now, and I can't afford spending more time on this since it's something that I think can or should be done very quickly.
Thanks for your time.
EDIT :
I found a workaround, but I think it's not the way to do it, because surprisingly it works for everything but em, s, u and strong tags.
class ColorClassAttributor extends Parchment.Attributor.Class {
add(domNode, value) {
if (value[0] != '#')
return super.add(domNode, value);
domNode.style[this.attrName] = value;
return true;
}
}
Now that I've implemented some Custom blots for our companies project, I'm planning to document some of the things I've learned for future maintainers of our project. I'd prefer for that documentation to be public and not in our internal documentation. Some of the topics include:
blot.domNode
and domNode.__blot
).static create() -> constructor() -> attach()
update()
optimize()
remove() -> detach()
@jhchen I'd mainly like to know where you would prefer this information to live? Would a docs folder at the top level of the repo do? I'd write it all as markdown, so it would be easy enough to pull pieces out and into the quill documentation if you'd like things to live there eventually.
slab/quill#1028 tracks this on the Quill side, but opening this since it seems to manifest in the parchment.
Steps to reproduce the problem:
Actual behavior: After 2nd redo, the whole paragraph disappears and "Cannot read property 'mutations' of undefined" throws at
Platforms: IE 11.0.9600.18450 windows 10, 8 or 2012 R2
Include browser, operating system and respective versions
Version: 1.0.6
Note: This isn't limited to just Ctrl + Z/Backspace and is non-deterministic. I am able to reproduce while performing simple edit operations.
The problem seems to be that the TextBlot is getting corrupted, with its domNode not attached to a __blot. This results in a null reference when trying to access the mutations in the blot's domNode when trying to update the ScrollBlot, This puts the parchment in a weird state resulting in exceptions in followup keydown events (where the scroll lines are no longer defined, ranges are inconsistent etc.). This continues until the new ContainerBlot is created on Enter.
The TextBlot in question:
The error is coming from here:
node_modules/parchment/src/collection/linked-list.ts(9,5)
Any thoughts on why this issue is present? Is it simply a type problem?
In the example of the Blots section
format(name, value) {
if (name === 'link' && value) {
this.domNode.setAttribute('href'); // <- typo here
} else {
super.format(name, value);
}
}
It should be
this.domNode.setAttribute('href', value);
The docs only cover these three blots: Block, Inline and Embed. However, if we look at how the List
blot is built it inherits from the Container
blot.
What exactly does a Container blot do and when it should be used?
Hi,
Just recently noticed that Class Attributors variations cannot contain hyphens and if they do Parchment is not able to find the proper blot to process.
So I would suggest to add this info into the documentation regarding the expected pattern for the end classes:
[class-attributor-name]
[-]
[variation_name_without_any_hyphens]
Using quill-color as an example, if i define a color with a class called "light-brown":
[ql-color]
[-]
[light-brown]
Class Attributor would actually end up looking for the attributor with the keyName ql-color-light
which normally wouldn't exist.
Another suggestion would be to use/expect another character to separate the keyName from the variation less common than -
but that would probably break functionality for a lot of people.
Please let me know if there's any other info I'd need to provide.
I'm testing the custom attributor, I created a style attributor:
let CustomStyle = new Parchment.Attributor.Attribute('style', 'style');
Parchment.register(CustomStyle);
after this I initialized a new Quill
var quill = new Quill('#editor', options);
This would cause a TypeError, the stack call is:
at History.record (quill.js:6528)
at Emitter.<anonymous> (quill.js:6487)
at Emitter.emit (quill.js:8605)
at Emitter.emit (quill.js:1895)
at Quill.modify (quill.js:1626)
at Quill.setContents (quill.js:1457)
at new Quill (quill.js:1129)
I couldn't figure out why this happened and when I move the customStyle after the initialize of Quill, the error doesn't appear anymore.
However the error didn't appear either when I tried to implement the style attributors before the initialize of Quill
let colors = new Parchment.Attributor.Style('background-color', 'background-color');
Parchment.register(colors);
...
var quill = new Quill('#editor', options);
I know I supposed to implement the style attributor when I'm trying to apply certain style to the domNode, I just couldn't figure out why create the custom attributor before the initialization of Quill would cause such an error.
Any enlightenment would be really appreciated!!
Hi!
My use case calls to add multiple classes to a custom inline blot:
class Note extends Inline {};
Note.blotName = 'note';
Note.tagName = 'spann';
Note.className = `selection ${styles.selection} ${styles[`selection--note`]}`;
Quill.register(Note);
With the current code, I get an error when trying to use this:
Uncaught DOMException: Failed to execute 'add' on 'DOMTokenList': The token provided ('selection selection--1LM1N selection--note--2E3D2') contains HTML space characters, which are not valid in tokens.
It seems this line does not support multiple classes. It seems trivial to split the string by spaces then potentially add multiple. I'd be happy to contribute a PR but I wanted to make sure there wasn't a reason why this support does not already exist.
Thanks
when i read source code, i want to know where it assign domNode
property to blot instance
, i can not find the assignment。
i am very curious about that
I am trying to implement mentions. When the value is displayed in the editor I want it to look like @john Doe but when it submits to the server I would like it to be %%john-doe%%. What is a good way to implement this? Is there a way to do a transform on the value, before it hits the onChange event or is there a better way to do this using Blots (display value vs actual value)?
At the branch 2.0
When I do npm install
I got a error below:
ERROR in /Users/xiexing/personal/parchment/src/blot/abstract/parent.ts
[tsl] ERROR in /Users/xiexing/personal/parchment/src/blot/abstract/parent.ts(317,43)
TS2345: Argument of type 'NodeList' is not assignable to parameter of type 'Node[]'.
Type 'NodeList' is missing the following properties from type 'Node[]': pop, push, concat, join, and 19 more.
ERROR in /Users/xiexing/personal/parchment/src/blot/abstract/parent.ts
[tsl] ERROR in /Users/xiexing/personal/parchment/src/blot/abstract/parent.ts(318,47)
TS2345: Argument of type 'NodeList' is not assignable to parameter of type 'Node[]'.
Not everybody is using es6 or babel.
Let's say I have a special LinkBlot AtomicBlot that is similar to the default LinkBlot example with the following differences. When the curser/selection is somewhere inside that AtomicBlot's text and I delete at least one character then the whole AtomicBlot is removed. Similarly, I must not be able to add characters to AtomicBlot.
My idea was to make AtomicBlot extend from the inline Embed blot. In that case the whole AtomicBlot is deleted when the cursor is right to it's last character and backspace is pressed. But when the cursor is at some other position it does only remove one character and not the whole AtomicBlot. I assume I need to override some of the Blot methods to achieve the correct behavior but I am a bit at a loss.
I was not sure whether to put this question here or on the Quill project. In any case, any advice would be appreciated.
Hello,
After a lot of searching I couldn't find an example of referencing the editor from a custom blot. The examples I saw tackle this by working with a global quill instance, e.g.:
var quill = ....
Is it possible to access the current quill instance where the blot is inserted and if not - is it difficult to implement?
Much appreciated for the great library!
Hello,
I'm trying to use Quill Editor in Aurelia and Webpack, which has parchment as a dependency.
The build is successful with transpileOnly as true, but due to which i lose the Typescript capabilities. When i donot defin ethe transpileOnly for ts-loader,
{
test: /\.ts?$/,
use: [
"babel-loader",
{
loader: "ts-loader",
}
]
},
I get the following Error,
ERROR in ./node_modules/parchment/src/attributor/attributor.ts
Module build failed: Error: Typescript emitted no output for C:\Users\project\node_modules\parchment\src\attributor\attributor.ts.
You should not need to recompile .ts files in node_modules.
Please contact the package author to advise them to use --declaration --outDir.
More https://github.com/Microsoft/TypeScript/issues/12358
at successLoader (C:\Users\project\node_modules\ts-loader\dist\index.js:39:15)
at Object.loader (C:\Users\project\node_modules\ts-loader\dist\index.js:21:12)
@ ./node_modules/parchment/src/parchment.ts 10:0-49 30:15-25
@ ./node_modules/quill/core.js
@ ./node_modules/quill/quill.js
@ ./src/resources/custom-elements/quill-editor/quill-editor.ts
@ ./src/resources/index.ts
@ ./src/main.ts
@ ./node_modules/aurelia-webpack-plugin/runtime/empty-entry.js
@ multi aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-loader-entry (webpack)-dev-server/client?http://localhost:3333 @babel/polyfill aurelia-bootstrapper
ERROR in ./node_modules/parchment/src/attributor/class.ts
Module build failed: Error: Typescript emitted no output for C:\Users\project\node_modules\parchment\src\attributor\class.ts.
You should not need to recompile .ts files in node_modules.
Please contact the package author to advise them to use --declaration --outDir.
More https://github.com/Microsoft/TypeScript/issues/12358
at successLoader (C:\Users\project\node_modules\ts-loader\dist\index.js:39:15)
at Object.loader (C:\Users\project\node_modules\ts-loader\dist\index.js:21:12)
@ ./node_modules/parchment/src/parchment.ts 11:0-49 31:11-26
@ ./node_modules/quill/core.js
@ ./node_modules/quill/quill.js
@ ./src/resources/custom-elements/quill-editor/quill-editor.ts
@ ./src/resources/index.ts
@ ./src/main.ts
@ ./node_modules/aurelia-webpack-plugin/runtime/empty-entry.js
@ multi aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-loader-entry (webpack)-dev-server/client?http://localhost:3333 @babel/polyfill aurelia-bootstrapper
ERROR in ./node_modules/parchment/src/attributor/store.ts
Module build failed: Error: Typescript emitted no output for C:\Users\project\node_modules\parchment\src\attributor\store.ts.
You should not need to recompile .ts files in node_modules.
Please contact the package author to advise them to use --declaration --outDir.
More https://github.com/Microsoft/TypeScript/issues/12358
at successLoader (C:\Users\project\node_modules\ts-loader\dist\index.js:39:15)
at Object.loader (C:\Users\project\node_modules\ts-loader\dist\index.js:21:12)
@ ./node_modules/parchment/src/parchment.ts 13:0-49 33:11-26
@ ./node_modules/quill/core.js
@ ./node_modules/quill/quill.js
@ ./src/resources/custom-elements/quill-editor/quill-editor.ts
@ ./src/resources/index.ts
@ ./src/main.ts
@ ./node_modules/aurelia-webpack-plugin/runtime/empty-entry.js
@ multi aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-loader-entry (webpack)-dev-server/client?http://localhost:3333 @babel/polyfill aurelia-bootstrapper
ERROR in ./node_modules/parchment/src/attributor/style.ts
Module build failed: Error: Typescript emitted no output for C:\Users\project\node_modules\parchment\src\attributor\style.ts.
You should not need to recompile .ts files in node_modules.
Please contact the package author to advise them to use --declaration --outDir.
More https://github.com/Microsoft/TypeScript/issues/12358
at successLoader (C:\Users\project\node_modules\ts-loader\dist\index.js:39:15)
at Object.loader (C:\Users\project\node_modules\ts-loader\dist\index.js:21:12)
@ ./node_modules/parchment/src/parchment.ts 12:0-49 32:11-26
@ ./node_modules/quill/core.js
@ ./node_modules/quill/quill.js
@ ./src/resources/custom-elements/quill-editor/quill-editor.ts
@ ./src/resources/index.ts
@ ./src/main.ts
@ ./node_modules/aurelia-webpack-plugin/runtime/empty-entry.js
@ multi aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-loader-entry (webpack)-dev-server/client?http://localhost:3333 @babel/polyfill aurelia-bootstrapper
ERROR in ./node_modules/parchment/src/blot/abstract/container.ts
Module build failed: Error: Typescript emitted no output for C:\Users\project\node_modules\parchment\src\blot\abstract\container.ts.
You should not need to recompile .ts files in node_modules.
Please contact the package author to advise them to use --declaration --outDir.
More https://github.com/Microsoft/TypeScript/issues/12358
at successLoader (C:\Users\project\node_modules\ts-loader\dist\index.js:39:15)
at Object.loader (C:\Users\project\node_modules\ts-loader\dist\index.js:21:12)
@ ./node_modules/parchment/src/parchment.ts 2:0-54 21:13-26
@ ./node_modules/quill/core.js
@ ./node_modules/quill/quill.js
@ ./src/resources/custom-elements/quill-editor/quill-editor.ts
@ ./src/resources/index.ts
@ ./src/main.ts
@ ./node_modules/aurelia-webpack-plugin/runtime/empty-entry.js
@ multi aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-loader-entry (webpack)-dev-server/client?http://localhost:3333 @babel/polyfill aurelia-bootstrapper
ERROR in ./node_modules/parchment/src/blot/abstract/format.ts
Module build failed: Error: Typescript emitted no output for C:\Users\project\node_modules\parchment\src\blot\abstract\format.ts.
You should not need to recompile .ts files in node_modules.
Please contact the package author to advise them to use --declaration --outDir.
More https://github.com/Microsoft/TypeScript/issues/12358
at successLoader (C:\Users\project\node_modules\ts-loader\dist\index.js:39:15)
at Object.loader (C:\Users\project\node_modules\ts-loader\dist\index.js:21:12)
@ ./node_modules/parchment/src/parchment.ts 3:0-48 22:10-20
@ ./node_modules/quill/core.js
@ ./node_modules/quill/quill.js
@ ./src/resources/custom-elements/quill-editor/quill-editor.ts
@ ./src/resources/index.ts
@ ./src/main.ts
@ ./node_modules/aurelia-webpack-plugin/runtime/empty-entry.js
@ multi aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-loader-entry (webpack)-dev-server/client?http://localhost:3333 @babel/polyfill aurelia-bootstrapper
ERROR in ./node_modules/parchment/src/blot/abstract/leaf.ts
Module build failed: Error: Typescript emitted no output for C:\Users\project\node_modules\parchment\src\blot\abstract\leaf.ts.
You should not need to recompile .ts files in node_modules.
Please contact the package author to advise them to use --declaration --outDir.
More https://github.com/Microsoft/TypeScript/issues/12358
at successLoader (C:\Users\project\node_modules\ts-loader\dist\index.js:39:15)
at Object.loader (C:\Users\project\node_modules\ts-loader\dist\index.js:21:12)
@ ./node_modules/parchment/src/parchment.ts 4:0-44 23:8-16
@ ./node_modules/quill/core.js
@ ./node_modules/quill/quill.js
@ ./src/resources/custom-elements/quill-editor/quill-editor.ts
@ ./src/resources/index.ts
@ ./src/main.ts
@ ./node_modules/aurelia-webpack-plugin/runtime/empty-entry.js
@ multi aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-loader-entry (webpack)-dev-server/client?http://localhost:3333 @babel/polyfill aurelia-bootstrapper
ERROR in ./node_modules/parchment/src/blot/block.ts
Module build failed: Error: Typescript emitted no output for C:\Users\project\node_modules\parchment\src\blot\block.ts.
You should not need to recompile .ts files in node_modules.
Please contact the package author to advise them to use --declaration --outDir.
More https://github.com/Microsoft/TypeScript/issues/12358
at successLoader (C:\Users\project\node_modules\ts-loader\dist\index.js:39:15)
at Object.loader (C:\Users\project\node_modules\ts-loader\dist\index.js:21:12)
@ ./node_modules/parchment/src/parchment.ts 7:0-37 26:9-18
@ ./node_modules/quill/core.js
@ ./node_modules/quill/quill.js
@ ./src/resources/custom-elements/quill-editor/quill-editor.ts
@ ./src/resources/index.ts
@ ./src/main.ts
@ ./node_modules/aurelia-webpack-plugin/runtime/empty-entry.js
@ multi aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-loader-entry (webpack)-dev-server/client?http://localhost:3333 @babel/polyfill aurelia-bootstrapper
ERROR in ./node_modules/parchment/src/blot/embed.ts
Module build failed: Error: Typescript emitted no output for C:\Users\project\node_modules\parchment\src\blot\embed.ts.
You should not need to recompile .ts files in node_modules.
Please contact the package author to advise them to use --declaration --outDir.
More https://github.com/Microsoft/TypeScript/issues/12358
at successLoader (C:\Users\project\node_modules\ts-loader\dist\index.js:39:15)
at Object.loader (C:\Users\project\node_modules\ts-loader\dist\index.js:21:12)
@ ./node_modules/parchment/src/parchment.ts 8:0-37 24:9-18
@ ./node_modules/quill/core.js
@ ./node_modules/quill/quill.js
@ ./src/resources/custom-elements/quill-editor/quill-editor.ts
@ ./src/resources/index.ts
@ ./src/main.ts
@ ./node_modules/aurelia-webpack-plugin/runtime/empty-entry.js
@ multi aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-loader-entry (webpack)-dev-server/client?http://localhost:3333 @babel/polyfill aurelia-bootstrapper
ERROR in ./node_modules/parchment/src/blot/inline.ts
Module build failed: Error: Typescript emitted no output for C:\Users\project\node_modules\parchment\src\blot\inline.ts.
You should not need to recompile .ts files in node_modules.
Please contact the package author to advise them to use --declaration --outDir.
More https://github.com/Microsoft/TypeScript/issues/12358
at successLoader (C:\Users\project\node_modules\ts-loader\dist\index.js:39:15)
at Object.loader (C:\Users\project\node_modules\ts-loader\dist\index.js:21:12)
@ ./node_modules/parchment/src/parchment.ts 6:0-39 27:10-20
@ ./node_modules/quill/core.js
@ ./node_modules/quill/quill.js
@ ./src/resources/custom-elements/quill-editor/quill-editor.ts
@ ./src/resources/index.ts
@ ./src/main.ts
@ ./node_modules/aurelia-webpack-plugin/runtime/empty-entry.js
@ multi aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-loader-entry (webpack)-dev-server/client?http://localhost:3333 @babel/polyfill aurelia-bootstrapper
ERROR in ./node_modules/parchment/src/blot/scroll.ts
Module build failed: Error: Typescript emitted no output for C:\Users\project\node_modules\parchment\src\blot\scroll.ts.
You should not need to recompile .ts files in node_modules.
Please contact the package author to advise them to use --declaration --outDir.
More https://github.com/Microsoft/TypeScript/issues/12358
at successLoader (C:\Users\project\node_modules\ts-loader\dist\index.js:39:15)
at Object.loader (C:\Users\project\node_modules\ts-loader\dist\index.js:21:12)
@ ./node_modules/parchment/src/parchment.ts 5:0-39 25:10-20
@ ./node_modules/quill/core.js
@ ./node_modules/quill/quill.js
@ ./src/resources/custom-elements/quill-editor/quill-editor.ts
@ ./src/resources/index.ts
@ ./src/main.ts
@ ./node_modules/aurelia-webpack-plugin/runtime/empty-entry.js
@ multi aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-loader-entry (webpack)-dev-server/client?http://localhost:3333 @babel/polyfill aurelia-bootstrapper
ERROR in ./node_modules/parchment/src/blot/text.ts
Module build failed: Error: Typescript emitted no output for C:\Users\project\node_modules\parchment\src\blot\text.ts.
You should not need to recompile .ts files in node_modules.
Please contact the package author to advise them to use --declaration --outDir.
More https://github.com/Microsoft/TypeScript/issues/12358
at successLoader (C:\Users\project\node_modules\ts-loader\dist\index.js:39:15)
at Object.loader (C:\Users\project\node_modules\ts-loader\dist\index.js:21:12)
@ ./node_modules/parchment/src/parchment.ts 9:0-35 28:8-16
@ ./node_modules/quill/core.js
@ ./node_modules/quill/quill.js
@ ./src/resources/custom-elements/quill-editor/quill-editor.ts
@ ./src/resources/index.ts
@ ./src/main.ts
@ ./node_modules/aurelia-webpack-plugin/runtime/empty-entry.js
@ multi aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-loader-entry (webpack)-dev-server/client?http://localhost:3333 @babel/polyfill aurelia-bootstrapper
ERROR in ./node_modules/parchment/src/registry.ts
Module build failed: Error: Typescript emitted no output for C:\Users\project\node_modules\parchment\src\registry.ts.
You should not need to recompile .ts files in node_modules.
Please contact the package author to advise them to use --declaration --outDir.
More https://github.com/Microsoft/TypeScript/issues/12358
at successLoader (C:\Users\project\node_modules\ts-loader\dist\index.js:39:15)
at Object.loader (C:\Users\project\node_modules\ts-loader\dist\index.js:21:12)
@ ./node_modules/parchment/src/parchment.ts 14:0-39 16:9-23 17:10-25 18:8-21 19:9-23 20:12-29
@ ./node_modules/quill/core.js
@ ./node_modules/quill/quill.js
@ ./src/resources/custom-elements/quill-editor/quill-editor.ts
@ ./src/resources/index.ts
@ ./src/main.ts
@ ./node_modules/aurelia-webpack-plugin/runtime/empty-entry.js
@ multi aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-loader-entry (webpack)-dev-server/client?http://localhost:3333 @babel/polyfill aurelia-bootstrapper
Please help me out in resolving the same.
TypeScript declarations were disabled in this 2.0 commit: 42ad424
What was the reason for that? We have TypeScript classes that extend from Parchment classes, and it would be nice to have the TS definitions available, please!
Why does the following return undefined?
I feel like this is the problem I am facing with implementing a custom format depending on the EmbedBlot
. quill.getFormat()
only returns an empty object for me.
It would be helpful if the more of the functions in this library had comments. It would be even more helpful if the comments were inserted into the generated d.ts files.
I'm trying to gain a better understanding of parchment so I'm willing to a most of the work in this documentation. Expect a PR shortly.
error [email protected]: The engine "node" is incompatible with this module. Expected version "^5.3".
error Found incompatible module
How can i customize a new Blot that:
What I want to do is build different customized Blot to extend the editor.
Stemming from an issue mentioned in Quill's repository issue list, there has been some discussion around adding support for multiple registries in Parchment. After the new year, the discussion trailed off. The hope here is to support multiple registries so that a webpage can load a view with multiple editors, and each editor can have separate configurations for formats/blots/attributors, etc. This fork creates a solution that will allow, for example, one editor that supports bold and italic text, and one that does not. Even the content generated by copy/pasting bold and italic text will be reflected differently in each editor. The same concept is true for custom blots. The intended outcome is to create a Parchment 2.0 branch that can be used to develop toward a branch that supports a future Quill 2.0 branch supporting multiple editor registries.
Here is a fork that demonstrates proposed code changes
https://github.com/zdizzle6717/parchment/tree/feature/scope-registry-to-quill-instance
Here is the Quill issue that stemmed the conversation
slab/quill#1101
Here is a near complete Quill 2.0 branch that applies the Parchment, multiple registry solution
https://github.com/zdizzle6717/quill/tree/scope-registry-to-quill-instance
please read it all and clearfully:
detail problments: slab/quill#896
For an empty line, I found that the method 'domNode.insertBefore(childNode, refNode)' [https://developer.mozilla.org/en-US/docs/Web/API/Node/insertBefore], for the older webbrowsers, range object will not change, so the 'getNativeRange' method return corrent result. However, it changes for the latest webbrowsers(safari[10.1], chrome[59_dev]), and in result 'getNativeRange' return wrong result.
I think that the source code hasn't checked whether the parentNode already contains the childNode. And I tried to do so in my forked branch, than the problem fixed. But I want to make sure if it is proper to do so? If it is, i will try to merge to the original master branch.
I will be appreciate if you can answer the question. Let's make it good! @jhchen
Hello. There is issue with global Quill.registry.
When you are creating a two instances of Quill where every instance uses custom modules. Then they are shared because Quill#register is for global registering.
Would be great to have ability to register modules per instance or a way to unregister modules from Registry or from the specific instance.
There is simple workaround and it is to check the instance id in the constructor of custom module. If this instance has allowed this module and do stuffs with it. But it is an issue with overwriten modules. E.g.: I want use for one Quill custom keyboard and for second one the default keyboard.
I can do another workaround and that is calling super methods in overwriten methods. But it makes a mess in our code.
I will prefer a method in Parchment what can unregister existing things.
Thank you.
Pretty simple question.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.