question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Docs do not describe the actual model.

See original GitHub issue

Hi there, awesome project first of all!

I found that the docs do not describe the actual model for Value and Decoration.

Value

See: https://github.com/ianstormtaylor/slate/blob/master/docs/reference/slate/value.md and https://github.com/ianstormtaylor/slate/blob/master/packages/slate/src/models/value.js

The docs says the properties are:

Value({
  document: Document,
  selection: Selection,
  data: Data,
  decorations: List<Decoration>,
})

but the default properties are

const DEFAULTS = {
  annotations: undefined,
  data: undefined,
  document: undefined,
  selection: undefined,
}

Decoration

See https://github.com/ianstormtaylor/slate/blob/master/docs/reference/slate/decoration.md and https://github.com/ianstormtaylor/slate/blob/master/packages/slate/src/models/decoration.js

The docs says the properties are:

Decoration({
  anchor: Point,
  focus: Point,
  mark: Mark,
})

but the default properties are

const DEFAULTS = {
  type: undefined,
  data: undefined,
  anchor: undefined,
  focus: undefined,
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
eselkincommented, Sep 14, 2019

I think Decoration became Annotation and that’s why it has the data and type.

0reactions
ianstormtaylorcommented, Nov 28, 2019

I believe that this may be fixed by https://github.com/ianstormtaylor/slate/pull/3093, which has changed a lot of the logic in Slate and slate-react especially. I’m going to close this out, but as always, feel free to open a new issue if it persists for you. Thanks for understanding.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the Document Object Model? - W3C
The Document Object Model (DOM) is a programming API for HTML and XML documents. It defines the logical structure of documents and the...
Read more >
Set rules for your form - Google Docs Editors Help
Set up rules for a question · Open a form in Google Forms. · Add one of the following types of questions: Short...
Read more >
Introduction to the DOM - Web APIs - MDN Web Docs
The Document Object Model (DOM) is the data representation of the ... The idea is not to describe what these APIs do here...
Read more >
How to Write Doc Comments for the Javadoc Tool - Oracle
Our documentation comments define the official Java Platform API Specification. ... It does not describe implementation details, such as whether the method ...
Read more >
About documentation - dbt Developer Hub
Good documentation for your dbt models will help downstream ... To see documentation for all columns and not just columns described in your ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found