Giter VIP home page Giter VIP logo

nib's Issues

Please add support to class names

Having default classes and allowing us to config the class names will be great as it provides more customization towards styling.

Issue with select all

Steps:

  1. create only an ordered list in editor
  2. select-a
  3. change list type to un-ordered

It does not works.

"hardBreak" is producing broken html

I wrote a visitor that replaces these nodes:

{ type: "paragraph" }

With:

{ type: "hardBreak" }

(because I need to preserve newlines)

But this is what convertToHTML produces: <brundefined></br>

Adding options make module crash "inline block link list image history"

<Editor config={{ plugins: { options: "inline block link list image history", image: { uploadCallback } }, toolbar: { options: "top", top: { block: { grouped }, options: "inline block link list image history" /* link */ } } }} onChange={this.handleChange2} defaultValue={defaultValue} styleConfig={{ editor: () => ({ height: "400px" }) }} />

image

WAI ARIA Compliance

To comply with WIA-ARIA rules I plan to implement following:

  1. All clickable sections should be focuseable.
  2. Add following role attribute to tag as applicable:
    1. button - An input that allows for user-triggered actions when clicked or pressed.
    aria-disabled, aria-label, aria-haspopup
    2. cell - A cell in a tabular container.
    3. columnheader - A cell containing header information for a column.
    3. dialog - A dialog is a descendant window of the primary window of a web application. For HTML pages, the primary application window is the entire web document, i.e., the body element.
    aria-label, Authors SHOULD focus an element in the modal dialog when it is displayed, and authors SHOULD manage focus of modal dialogs., aria-modal
    4. heading - A heading for a section of the page.
    aria-level
    5. img - A container for a collection of elements that form an image.
    aria-label
    6. textbox - A generic type of widget that allows user input.
    aria-placeholder, aria-required, aria-label, aria-labelledby, aria-disabled,
    7. link - An interactive reference to an internal or external resource that, when activated, causes the user agent to navigate to that resource.
    aria-disabled, aria-label
    8. list - A section containing listitem elements. See related listbox.
    9. listitem - A single item in a list or directory.
    10. option - A selectable item in a select list.
    11. grid - A composite widget containing a collection of one or more rows with one or more cells where some or all cells in the grid are focusable by using methods of two-dimensional navigation, such as directional arrow keys.
    aria-label
    12. listbox - A widget that allows the user to select one or more items from a list of choices.
    13. row - A row of cells in a tabular container.
    14. rowheader - A cell containing header information for a row in a grid.
    15. separator - A divider that separates and distinguishes sections of content or groups of menuitems.
    16. table - A section containing data arranged in rows and columns.
    18. toolbar - A collection of commonly used function buttons or controls represented in compact visual form.
    Authors MUST supply a label on each toolbar when the application contains more than one toolbar.
    19. tooltip - A contextual popup that displays a description for an element.
    Authors SHOULD ensure that elements with the role tooltip are referenced through the use of aria-describedby before or at the time the tooltip is displayed.

aria-readonly, aria-required, aria-label, aria-labelledby, aria-disabled, aria-hidden, aria-keyshortcuts

  1. Menu items should all be focuseable.

Ref: https://www.w3.org/TR/wai-aria-1.1/#introduction

Image uploading doesn't work

Image uploading doesn't appear to work on Windows OS in Chrome Browser, and on iOS in Safari Browser. I tried using the example from the docs website.

How to integrate with Formik?

Hi,

I'm trying to integrate your great editor with Formik in React.

My code:

import React, { useState } from 'react';
import { Input, Textarea, ErrrorMessage } from '../forms/Input';
import { Formik, Form } from 'formik';
import { ButtonFullWidth } from '../forms/Button';
import { Spinner } from '../common/Icons';
import Editor from "nib-core";


interface IProps {
	value: string;
	cardContentAction?: any;
}

const ComplexityEdit: React.FC<IProps> = ({ value, cardContentAction }) => {
	const [data, setData] = useState({ analysing: null });

	let onSubmit = (values) => {
		cardContentAction(values['complexity'])
	};

	const initialValue = {
		complexity: value,
	};
	const MyEditor = () => <Editor />;

	return (
		<div>
			<Formik
				onSubmit={onSubmit}
				initialValues={initialValue}
				render={({ errors, status, touched, isSubmitting}) => (
					<Form>
						<Input name='complexity' component={MyEditor} />
						<ButtonFullWidth type='submit'>Opslaan {isSubmitting && <Spinner />}</ButtonFullWidth>
					</Form>
				)}
			/>
		</div>
	);
};

export default ComplexityEdit;

This is a functional component that gets it's data from value and sends it back via cardContentAction. It works fine with an input or textarea but I can't figure out how to use initialValues or send the data back when I press submit.

Input is just a simple styled-component Field from Formik

Demo not working?

Please find the attached screenshot, geting 'Applying a mismatched transaction' error!

Screenshot 2019-09-09 at 8 45 45 PM

Number of line breaks is growing

Somehow this:

<p ><br></p><p >

Turns into this:

<p ><br ><br></br></p><p >

By doing something as simple as focusing away from the editor and back.

Rick

Layout fixes in the editor

[] overflow should scroll properly
[] it should be possible to set height and default height should also work well

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.