Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Mar 25 10:59
    marijnh closed #1045
  • Mar 24 17:14
    alexeygolev commented #1045
  • Mar 24 16:42
    Ben-Davis1 edited #1045
  • Mar 24 16:41
    Ben-Davis1 edited #1045
  • Mar 24 16:40
    Ben-Davis1 edited #1045
  • Mar 24 16:40
    Ben-Davis1 edited #1045
  • Mar 24 16:39
    Ben-Davis1 opened #1045
  • Mar 23 09:37
    marijnh closed #1044
  • Mar 23 09:37
    marijnh commented #1044
  • Mar 23 09:07
    loreanvictor opened #1044
  • Mar 20 17:14
    RichieAHB commented #832
  • Mar 20 16:29
    marijnh closed #870
  • Mar 20 16:29
    marijnh commented #870
  • Mar 20 16:27
    marijnh commented #868
  • Mar 20 16:26
    marijnh closed #868
  • Mar 20 16:20
    marijnh commented #852
  • Mar 20 15:47
    marijnh closed #845
  • Mar 20 15:47
    marijnh commented #845
  • Mar 20 15:44
    marijnh closed #844
  • Mar 20 15:24
    marijnh commented #843
Gaetan SENELLE
@gaetansnl
So there is currently no way to help it compare ? By providing a function or something else
I was expecting update() to be called instead of destroying everything. And even if it's called, I still need to rerender everything with the new attrs... It kills the performances
Alid Lorenzo
@alidlo
during drag/drop, is there a way to differentiate the selected node from the dragged node? (so that both of them don't get drop cursor styles)
Alid Lorenzo
@alidlo
looks like i can just apply custom classes inside the nodeViews' stopEvent but wonder if there is a better way since Prosemirror already adds some classes itself (i just couldn't find any specific handling of this case in docs or code)
Marijn Haverbeke
@marijnh
stopEvent should not add classes, no—that's just a predicate function. I don't quite get your question—doesn't the dragged node become selected when starting to drag?
Alid Lorenzo
@alidlo
ezgif-1-809574b89f45.gif
@marijnh here's what i mean - if you notice there's two nodes receiving the .ProseMirror-selectednode class in a single drag event (the original node, and the node being dragged)
though based on your comment this doesn't seem to be the intended behavior so perhaps i'm not updating/rerendering the node view accordingly. going to explore that avenue now, since yea i dislike adding side effects to the predicate functions
Marijn Haverbeke
@marijnh
Oh, yes, that's definitely not intended behavior. If it happens without 3rd party code, do file an issue
Alid Lorenzo
@alidlo
yea, even w/ nodeViews problem remained - opened up issue here: ProseMirror/prosemirror#917
Alid Lorenzo
@alidlo
w/o*
Alid Lorenzo
@alidlo
is there a built in way to override copied content? i have a case where part of a node's content is hidden, and so it's not being included in the paste - so I'd like to fix that. (i've tried hooking up to custom serializers, but can't find a hook that captures this exact scenario, am I missing something?)
Alid Lorenzo
@alidlo
hmm based on similar forum question DOM serializer should work, so gonna see if there's something blocking serializeFragment from firing
Alid Lorenzo
@alidlo
^ yea seems like the nodeView was interfering, all is well now
Andrey Sitnik
@ai

Hi. Thanks for great tool and docs. But I didn’t find how does ProseMirror resolve conflicts and offline? Do it use something like CRDT or OT?

Do nodes use indexes? 1: a, 2: b, 3: c Will adding A after a change node indexes later? (1: a, 2: A, 3: b, 4: c)?

Marijn Haverbeke
@marijnh
See http://www.marijnhaverbeke.nl/blog/collaborative-editing.html . Real-time collab system are usually not a good fit for merging changes made offline.
Andrey Sitnik
@ai
@marijnh thanks :) so ProseMirror uses OT?
in generally speaking, OT with some additional changes?
so we need to have the single server to all users working with this document? This server will be one source of true (changing indexes in operations)
am I right?
Marijn Haverbeke
@marijnh
Yes, that sounds right
Sanyam Jain
@xerosanyam
hello guys, I would like to modify caret thickness and if possible, provide a toolbar on caret
any pointers on what I should start with ?
also, I know browser only allows setting caret-color property. But thickness and toolbar are essential for what I want to build
Thanks
Marijn Haverbeke
@marijnh
You can't really do that. The only way I can think of to approximate it would be to overlay an element at the cursor position, and hide the default caret by setting its color to transparent.
Sanyam Jain
@xerosanyam
Hi, I would like to insert a menu before each paragraph. state of menu buttons will depend on some attributes of paragraph. What's the best way to achieve this. can't find a way to insert menu for each paragraph
Sanyam Jain
@xerosanyam
@marijnh can you please suggest some ideas to implement this
Marijn Haverbeke
@marijnh
@xerosanyam Either a node view that includes the buttons, or a plugin that adds widget decorations for each paragraph (and updates them on changes) would work.
Nelson Pecora
@nelsonpecora
Hi folks! This might be a silly question, but I can't find any answers in the forum or documentation: I'm storing prosemirror docs as json, and I want to serialize them server-side (in nodejs). It looks like the DOMSerializer in prosemirror-model relies on the actual dom (which makes sense), so I was wondering if people had figured out best practices around this? Separate client/server schemas? Shared schema with extra serializer methods?
For reference, I'm mainly concerned with serializing to html strings and to plaintext. Here's my (extremely janky) first pass (without any kind of schema awareness in the serializer): https://gist.github.com/nelsonpecora/708b962cc849d77b87e5460c8ce8a6ed
Marijn Haverbeke
@marijnh
Hi @nelsonpecora, you could go through jsdom (see the tests for the serializer in prosemirror-model/src/test-dom.js), or you could write your own serializer functions
Nelson Pecora
@nelsonpecora
Oh cool, thanks! I figured jsdom might be the way to go, glad to see there's some prior art there
Nelson Pecora
@nelsonpecora
Weird question, but is there a straightforward way (when doing schema.nodeFromJSON()) to fail gracefully and disregard marks/nodes that aren't in the schema?
I haven't seen that pattern anywhere (in the prosemirror source or in libraries that implement it)
Similarly to how prosemirror ignores pasted stuff that isn't specified in the schema, I guess.
Dmitry Minkovsky
@dminkovsky
Hi everyone. I'm wondering anyone knows how to manipulate the formatting options that are available in the in the iOS tooltip that appears on selection. or what that tooltip is called, how to google about it, etc
Marijn Haverbeke
@marijnh
@nelsonpecora No, the fromJSON stuff expects something serialized (from the same schema) with toJSON, and considers invalid JSON an error. You'd have to write your own cleanup function for that.
@dminkovsky Last time I checked, iOS didn't provide any way to control that tooltip, but that was years ago, so something may have changed
Dmitry Minkovsky
@dminkovsky
@marijnh thanks!
Sanyam Jain
@xerosanyam
any way to clear history? I mean reset undo/redo stored
chris chang
@sworddish_twitter
@marijnh any update related to this issue ProseMirror/prosemirror#935 ? Safari starting composition over and over on CJK languages IME
chris chang
@sworddish_twitter
ProseMirror/prosemirror#944 proposed a solution but raised a reversed issue instead
ousado
@ousado
Hi! I'm looking into using prosemirror with Haxe. Ideally I'd like to automate the generation of external type definitions as far as possible. Is there any existing generator for the docs or TypeScript, or anything else?
Jack Pope
@jackpope
Hi folks, wondering if anyone has experience using prosemirror-changeset to display decoration diffs between documents. I've ran into trouble getting a changeset to have insertions and deletions within the same range (highlight a word and start typing over it). Sometimes only the deletion is added to the change and sometimes only the addition is added to the change but with the range length missing the length of the deletion. I've pulled down the repo and tried adding tests for my use case but they are passing however things get messed up after the computeDiff step in my application.
Here is the issue in github. Any ideas on further debugging? ProseMirror/prosemirror-changeset#10
Jack Pope
@jackpope
@ousado most of the types are available from @types/prosemirror-<module-name>
Carl Block
@carlblock
Anyone have any idea on how to toggle the case(A/a) on selected text?
Denny Luan
@dennyluan_twitter
Has anyone implemented prosemirror-collab using websockets/actioncable?
Marijn Haverbeke
@marijnh
Quite some people are doing collab editing over websockets. I don't know about actioncable.
Andrew Milich
@amilich
Hi! I'm looking for a really basic collab editing demo. I've tried to pair down the website example, but it has been really difficult to cut out the markdown parsing, the demo instance saving, etc. - is there a simpler place to start?
Marijn Haverbeke
@marijnh
Yes, the guide has a more minimal example.
Andrew Milich
@amilich
Thank you!