Code Monkey home page Code Monkey logo

prosemirror-dev-tools's Introduction

prosemirror-dev-tools

NPM Version License Github Issues Travis Status Commitizen Friendly

Table of Content

Quick Start

NPM Way

Install prosemirror-dev-tools package from npm:

npm install --save-dev prosemirror-dev-tools

Wrap EditorView instance in applyDevTools method:

import applyDevTools from "prosemirror-dev-tools";

const view = new EditorView /*...*/();

applyDevTools(view);

Features

State

  • Inspect document – all nodes and marks
  • Inspect selection – position, head, anchor and etc.
  • Inspect active marks
  • See document stats – size, child count

prosemirror-dev-tools state tab

History

  • Inspect document changes over time
  • Time travel between states
  • See selection content for particular state in time
  • See selection diff

prosemirror-dev-tools history tab

Plugins

Inspect state of each plugin inside prosemirror.

prosemirror-dev-tools plugins tab

Schema

Inspect current document schema with nodes and marks.

prosemirror-dev-tools schema tab

Structure

Visual representation of current document tree with positions at the beginning and the end of every node.

prosemirror-dev-tools structure tab

Snapshots

Snapshots allow you to save current editor state and restore it later. State is stored in local storage.

prosemirror-dev-tools snapshots tab

Demo

Contributing

Contributions are highly welcome! This repo is commitizen friendly — please read about it here.

License

prosemirror-dev-tools's People

Contributors

d4rkr00t avatar lostfictions avatar marionebl avatar mwonng avatar ocavue avatar optimistiks avatar pocke avatar torifat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

prosemirror-dev-tools's Issues

More groups in history

Shall we add few more groups in history:

  • Only selection changed (we have it now)
  • Not empty selection changed
  • Document changed

Fix logging attributes

Now logging for attributes doesn't work even though they have the log button next to them

CI and CD

  • Semantic release
  • TravisCI
  • Commitizen
  • Linters
  • Prittier for changed files

Snapshots – Save/Restore state

Add ability to save/restore state.

What needs to be done for MVP:

  • Save state to local storage (ability to define a name for state snapshot)
  • Restore state from local storage
  • UI For interacting with saved state – basically list of saved states

Next iteration

  • Empty state for snapshots

Next iteration

  • Save/Restore selection

Next iteration

  • Exporting state to file
  • Importing state from file

Next iteration

  • Renaming snapshots

Next iteration

  • History (?)

Log document

There aren't any way now to log whole document only its content:
prosemirror-dev-tools 2017-04-26 12-24-40

Collapse history states where only selection changed

Changing selection generates a whole lot of events and they are mostly useless because document stays the same:

prosemirror-dev-tools 2017-04-26 12-26-21

We need a way to collapse this events, but with ability to get them when needed (e.g. when i want to jump back to some selection).

Probably we could even make other visual representation for selection changes.

Docs

Add more information into readme:

  • Example how dev tools look like
  • Documentation how to use them
  • Example on codepen.io
  • Logo
  • Contributing.md
  • License

Cannot install v2.0.0

When I try to install this package 'the npm way' I am not able to install v2.0.0. I already tried removing ~/.npm and local node_modules, but it always errors with

14 http fetch GET 200 https://registry.npmjs.org/prosemirror-dev-tools 141ms
15 silly registry:manifest no matching version for prosemirror-dev-tools@^2.0.0 in the cache. Forcing revalidation
16 http fetch GET 304 https://registry.npmjs.org/prosemirror-dev-tools 27ms (from cache)
17 silly fetchPackageMetaData error for prosemirror-dev-tools@^2.0.0 No matching version found for prosemirror-dev-tools@^2.0.0
18 silly registry:manifest no matching version for prosemirror-dev-tools@^2.0.0 in the cache. Forcing revalidation
19 http fetch GET 304 https://registry.npmjs.org/prosemirror-dev-tools 20ms (from cache)
20 silly fetchPackageMetaData error for prosemirror-dev-tools@^2.0.0 No matching version found for prosemirror-dev-tools@^2.0.0

in the log. When I run

$ npm install --save-dev prosemirror-dev-tools

npm installs v1.4.0. However, when navigating to the registry page, I get a JSON string back, which clearly states that the latest version is 2.0.0.

Doesn't work with React 16!

Looks like this module (or one of its dependencies) is using React context without declaring context types? Not sure why it wouldn't have been showing a warning before, but it probably got upgraded to an error for React 16.

Here's a minimal repro case -- I just took the example CodeSandbox setup and updated react and react-dom to 16.0.0. https://codesandbox.io/s/jnlljqm3nw

Scrollable tabs panel

It's currently impossible due to react-tabs. Probably need to change it to another package.

Dev Tools no longer work in ProseMirror v0.23+

After bumping my PM version to 0.23 I get the follow error:

ERROR in /~/prosemirror-dev-tools/dist/cjs/state/modules/editor/index.js
Module not found: Error: Cannot resolve module 'prosemirror-model/dist/to_dom' in /node_modules/prosemirror-dev-tools/dist/cjs/state/modules/editor
 @ /~/prosemirror-dev-tools/dist/cjs/state/modules/editor/index.js 24:14-54

It appears to be as a result of:

import { DOMSerializer } from "prosemirror-model/dist/to_dom";

In PM v0.23, you should be able to import DOMSerializer directly via 'prosemirror-model'. I'm not sure if that will be backwards compatible with previous PM versions? Was there a reason for importing directly from to_dom in the first place?

Keyboard navigation in lists

  • Up and Down to move between items
  • Enter to select – the same as click
  • Shift enter – the same as double click

TypeError when opening devtools

invariant.js:44 Uncaught Error: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).
    at invariant (invariant.js:44)
    at Object.addComponentAsRefTo (ReactOwner.js:68)
    at attachRef (ReactRef.js:23)
    at Object.ReactRef.attachRefs (ReactRef.js:42)
    at ReactCompositeComponentWrapper.attachRefs (ReactReconciler.js:23)
    at CallbackQueue.notifyAll (CallbackQueue.js:76)
    at ReactReconcileTransaction.close (ReactReconcileTransaction.js:80)
    at ReactReconcileTransaction.closeAll (Transaction.js:209)
    at ReactReconcileTransaction.perform (Transaction.js:156)
    at ReactUpdatesFlushTransaction.perform (Transaction.js:143)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.