Giter Club home page Giter Club logo

wax-prosemirror's Introduction

Wax Editor

MIT license

This library is being developed by [Cabbage Tree Labs] (https://www.cabbagetreelabs.org). Wax Editor is built on top of the Prosemirror library. Check Prosemirror website and GitHub repo for more information.

Get up and running

Run a local version of the demos

  1. yarn with node >= 14

  2. yarn build

  3. yarn start Will bring up a demos of different ediitors

Documentation

Documentation can be found here.

wax-prosemirror's People

Contributors

christos8333 avatar jkopanas avatar joshgay avatar jure avatar yannisbarlas 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

Watchers

 avatar  avatar  avatar  avatar  avatar

wax-prosemirror's Issues

Text Align Feature

Hi,
Recently I tried building the text-align feature in the Wax editor but there were some problems with my implementation.

The main problem with my approach is that the contents get aligned by wrapping it with a div element with a style attribute. But it would be a lot better if I could just update or add a style attribute to the current node.

Is there a way to resolve this issue?

This is how I implemented the service:

//rightAlignService.js

import { Service } from 'wax-prosemirror-core';
import rightAlignNode from '../schema/rightAlignNode';
import RightAlign from './RightAlign';

class RightAlignService extends Service {
register() {
this.container.bind('RightAlign').to(RightAlign);
const createNode = this.container.get('CreateNode');
createNode(
{
rightAlign: rightAlignNode,
},
);
}
}

export default RightAlignService;

//rightAlignNode.js

const rightAlignNode = {
content: 'block*',
group: 'block',
code: true,
defining: true,
// marks: 'comment insertion deletion',
attrs: { params: { default: '' } },
parseDOM: [
{
tag: 'div',
preserveWhitespace: 'full',
getAttrs(dom) {
return {
params: dom.dataset.params,
};
},
},
],
toDOM(node) {
return ['div', { 'style': 'text-align: right' }, 0];
},
};

export default rightAlignNode;

//RightAlign.js

import { injectable } from 'inversify';
import { wrapIn } from 'prosemirror-commands';
import { Tools } from 'wax-prosemirror-core';

@Injectable()
export default class RightAlign extends Tools {
title = 'Right Align';
icon = 'rightAlign';
name = 'rightAlign';

get run() {
return (state, dispatch) => {
wrapIn(state.config.schema.nodes.rightAlign)(state, dispatch);
};
}

select = (state, activeViewId, activeView) => {
const { disallowedTools } = activeView.props;
if (disallowedTools.includes('rightAlign')) return false;
return true;
};

get enable() {
return state => {
return wrapIn(state.config.schema.nodes.rightAlign)(state);
};
}
}

Unable to add nested comment

Unable to add nested comments.
For example. I want to add comment on whole paragraph and want to add comment to particular word inside the same paragraph. Right now there is no option available.

yarn build failed

Hi,
yarn build command fail and return errors:

\wax-prosemirror> yarn build
yarn run v1.22.10
$ lerna run build
lerna notice cli v3.22.1
lerna info Executing command in 8 packages: "yarn run build"
lerna WARN ECYCLE Dependency cycles detected, you should fix these!
lerna WARN ECYCLE wax-prosemirror-components -> wax-prosemirror-core -> wax-prosemirror-services -> wax-prosemirror-plugins -> wax-prosemirror-layouts -> wax-prosemirror-components
lerna ERR! yarn run build exited 1 in 'wax-prosemirror-themes'
lerna ERR! yarn run build stdout:
$ BABEL_ENV=production rollup -c
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

lerna ERR! yarn run build stderr:
'BABEL_ENV' n'est pas reconnu en tant que commande interne
ou externe, un programme ex�cutable ou un fichier de commandes.
error Command failed with exit code 1.

lerna ERR! yarn run build exited 1 in 'wax-prosemirror-themes'
lerna WARN complete Waiting for 1 child process to exit. CTRL-C to exit immediately.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

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.