Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fork slate #18

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ You can use `slate-hyperprint` as a library to:

See the [online demo](https://soreine.github.io/slate-hyperprint), that converts a Slate JSON representation to a Slate hyperscript representation.

> ⚠️ This repository is now using GitBook's fork of [ianstormtaylor/slate](https://github.com/ianstormtaylor/slate).
> Previous versions are still [available on NPM](https://www.npmjs.com/package/slate-hyperprint)
> All the versions using GitBook's fork of slate are now published under the `@gitbook` NPM scope.
> To learn more about why we forked Slate, read [our manifest](https://github.com/GitbookIO/slate/blob/master/Readme.md)

# Setup

```
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "slate-hyperprint",
"name": "@gitbook/slate-hyperprint",
"description": "A Slate plugin to print Slate models to their slate-hyperscript representation.",
"version": "2.3.0",
"license": "Apache-2.0",
Expand All @@ -17,7 +17,7 @@
"stringify-object": "^3.2.2"
},
"peerDependencies": {
"slate": "*"
"@gitbook/slate": "*"
},
"devDependencies": {
"babel-cli": "^6.26.0",
Expand All @@ -41,9 +41,9 @@
"mocha": "^3.0.1",
"react": "^15.6.1",
"react-dom": "^15.6.1",
"slate": "^0.34.7",
"slate-hyperscript": "^0.5.9",
"slate-react": "^0.12.3"
"@gitbook/slate": "^0.34.7",
"@gitbook/slate-hyperscript": "^0.5.22",
"@gitbook/slate-react": "^0.13.4"
},
"scripts": {
"build": "babel ./src --out-dir ./dist",
Expand Down
2 changes: 1 addition & 1 deletion src/bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import fs from 'fs';
import path from 'path';
import yaml from 'js-yaml';
import Slate from 'slate';
import Slate from '@gitbook/slate';
import meow from 'meow';
import hyperprint from '../';

Expand Down
9 changes: 8 additions & 1 deletion src/types.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
/* @flow */

import type { Value, Document, Block, Inline, Text, Range } from 'slate';
import type {
Value,
Document,
Block,
Inline,
Text,
Range
} from '@gitbook/slate';

export type SlateModel = Value | Document | Block | Inline | Text | Range;
2 changes: 1 addition & 1 deletion tests/all.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from 'assert';
import fs from 'fs';
import { basename, extname, resolve } from 'path';
import { resetKeyGenerator } from 'slate';
import { resetKeyGenerator } from '@gitbook/slate';
import hyperprint from '../src';

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/sort-attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const input = (

const output = `
<value>
<document key="5">
<document key="4">
<image a="b" data1 data2="2" key="key1" />
<image key="key2" src="image.png" />
</document>
Expand Down
2 changes: 1 addition & 1 deletion tests/h.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createHyperscript } from 'slate-hyperscript';
import { createHyperscript } from '@gitbook/slate-hyperscript';

const h = createHyperscript({
blocks: {
Expand Down
2 changes: 1 addition & 1 deletion website/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* eslint-disable import/no-extraneous-dependencies */
import React from 'react';
import ReactDOM from 'react-dom';
import Slate from 'slate';
import Slate from '@gitbook/slate';
import hyperprint from '../dist/';

import INITIAL_VALUE from './value';
Expand Down
2 changes: 1 addition & 1 deletion website/value.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsx h */
// eslint-disable-next-line import/no-extraneous-dependencies
import { createHyperscript } from 'slate-hyperscript';
import { createHyperscript } from '@gitbook/slate-hyperscript';

const h = createHyperscript({
blocks: {
Expand Down
151 changes: 82 additions & 69 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,87 @@
lodash "^4.2.0"
to-fast-properties "^2.0.0"

"@gitbook/slate-base64-serializer@^0.2.41":
version "0.2.41"
resolved "https://registry.yarnpkg.com/@gitbook/slate-base64-serializer/-/slate-base64-serializer-0.2.41.tgz#a391b62c8d87083137e3cd667ac604829103942f"
dependencies:
isomorphic-base64 "^1.0.2"

"@gitbook/slate-dev-environment@^0.1.2":
version "0.1.2"
resolved "https://registry.yarnpkg.com/@gitbook/slate-dev-environment/-/slate-dev-environment-0.1.2.tgz#db3e0bc21a8c2e2833911ea6be010480d39feae4"
dependencies:
is-in-browser "^1.1.3"

"@gitbook/slate-dev-logger@^0.1.39":
version "0.1.39"
resolved "https://registry.yarnpkg.com/@gitbook/slate-dev-logger/-/slate-dev-logger-0.1.39.tgz#86cb39b8c535a480d31ab3636007911b6f7a3742"

"@gitbook/slate-hotkeys@^0.1.2":
version "0.1.2"
resolved "https://registry.yarnpkg.com/@gitbook/slate-hotkeys/-/slate-hotkeys-0.1.2.tgz#6ef554b925f84e72f99734196d42f7c6679c772b"
dependencies:
"@gitbook/slate-dev-environment" "^0.1.2"
is-hotkey "^0.1.1"

"@gitbook/slate-hyperscript@^0.5.22":
version "0.5.22"
resolved "https://registry.yarnpkg.com/@gitbook/slate-hyperscript/-/slate-hyperscript-0.5.22.tgz#b7fb270296852d961408840dd605cc0cdd156e19"
dependencies:
"@gitbook/slate-dev-logger" "^0.1.39"
is-empty "^1.0.0"
is-plain-object "^2.0.4"

"@gitbook/slate-plain-serializer@^0.5.22":
version "0.5.22"
resolved "https://registry.yarnpkg.com/@gitbook/slate-plain-serializer/-/slate-plain-serializer-0.5.22.tgz#68f2dc82443ae6b326d17d379d44cdfb418dcebc"
dependencies:
"@gitbook/slate-dev-logger" "^0.1.39"

"@gitbook/slate-prop-types@^0.4.39":
version "0.4.39"
resolved "https://registry.yarnpkg.com/@gitbook/slate-prop-types/-/slate-prop-types-0.4.39.tgz#267cfc25c860b8feb73af733c0d8a524a8801cea"
dependencies:
"@gitbook/slate-dev-logger" "^0.1.39"

"@gitbook/slate-react@^0.13.4":
version "0.13.4"
resolved "https://registry.yarnpkg.com/@gitbook/slate-react/-/slate-react-0.13.4.tgz#d07f4ecc384900d20284d19e27b8eb9e1982cdd8"
dependencies:
"@gitbook/slate-base64-serializer" "^0.2.41"
"@gitbook/slate-dev-environment" "^0.1.2"
"@gitbook/slate-dev-logger" "^0.1.39"
"@gitbook/slate-hotkeys" "^0.1.2"
"@gitbook/slate-plain-serializer" "^0.5.22"
"@gitbook/slate-prop-types" "^0.4.39"
debug "^3.1.0"
get-window "^1.1.1"
is-window "^1.0.2"
keycode "^2.1.2"
lodash "^4.1.1"
prop-types "^15.5.8"
react-immutable-proptypes "^2.1.0"
react-portal "^3.1.0"
selection-is-backward "^1.0.0"

"@gitbook/slate-schema-violations@^0.1.20":
version "0.1.20"
resolved "https://registry.yarnpkg.com/@gitbook/slate-schema-violations/-/slate-schema-violations-0.1.20.tgz#1e799757b79472a15938f05cd90923ea6750388b"

"@gitbook/slate@^0.34.7":
version "0.34.7"
resolved "https://registry.yarnpkg.com/@gitbook/slate/-/slate-0.34.7.tgz#ecc0ddeac9d5e8380fb4b93e1b47306d139504ba"
dependencies:
"@gitbook/slate-dev-logger" "^0.1.39"
"@gitbook/slate-schema-violations" "^0.1.20"
debug "^3.1.0"
direction "^0.1.5"
esrever "^0.2.0"
is-empty "^1.0.0"
is-plain-object "^2.0.4"
lodash "^4.17.4"
type-of "^2.0.1"

JSONStream@^1.0.3:
version "1.3.1"
resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.1.tgz#707f761e01dae9e16f1bcf93703b78c70966579a"
Expand Down Expand Up @@ -1481,7 +1562,7 @@ [email protected]:
dependencies:
ms "2.0.0"

debug@^2.2.0, debug@^2.3.2, debug@^2.6.8:
debug@^2.2.0, debug@^2.6.8:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
dependencies:
Expand Down Expand Up @@ -3826,74 +3907,6 @@ slash@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55"

slate-base64-serializer@^0.2.28:
version "0.2.28"
resolved "https://registry.yarnpkg.com/slate-base64-serializer/-/slate-base64-serializer-0.2.28.tgz#141a93654b58203e82ee24c4068107a67b72aff8"
dependencies:
isomorphic-base64 "^1.0.2"

slate-dev-logger@^0.1.39:
version "0.1.39"
resolved "https://registry.yarnpkg.com/slate-dev-logger/-/slate-dev-logger-0.1.39.tgz#744a69b85034244713e6de51483af5713c345af4"

slate-hyperscript@^0.5.9:
version "0.5.9"
resolved "https://registry.yarnpkg.com/slate-hyperscript/-/slate-hyperscript-0.5.9.tgz#b0b8ed64ea93be2d2b5c1aa480e8a0bcda9c399e"
dependencies:
is-empty "^1.0.0"
is-plain-object "^2.0.4"
slate-dev-logger "^0.1.39"

slate-plain-serializer@^0.5.9:
version "0.5.9"
resolved "https://registry.yarnpkg.com/slate-plain-serializer/-/slate-plain-serializer-0.5.9.tgz#dc6ac5d10c46cac1bfa8d9af36f5e76d766fd57e"
dependencies:
slate-dev-logger "^0.1.39"

slate-prop-types@^0.4.26:
version "0.4.26"
resolved "https://registry.yarnpkg.com/slate-prop-types/-/slate-prop-types-0.4.26.tgz#72ef2b6fded5893a2a0a273f679b92c4eee99e73"
dependencies:
slate-dev-logger "^0.1.39"

slate-react@^0.12.3:
version "0.12.3"
resolved "https://registry.yarnpkg.com/slate-react/-/slate-react-0.12.3.tgz#3d0739af6930ae2a178fa90da480d5106ba1c504"
dependencies:
debug "^2.3.2"
get-window "^1.1.1"
is-hotkey "^0.1.1"
is-in-browser "^1.1.3"
is-window "^1.0.2"
keycode "^2.1.2"
lodash "^4.1.1"
prop-types "^15.5.8"
react-immutable-proptypes "^2.1.0"
react-portal "^3.1.0"
selection-is-backward "^1.0.0"
slate-base64-serializer "^0.2.28"
slate-dev-logger "^0.1.39"
slate-plain-serializer "^0.5.9"
slate-prop-types "^0.4.26"

slate-schema-violations@^0.1.20:
version "0.1.39"
resolved "https://registry.yarnpkg.com/slate-schema-violations/-/slate-schema-violations-0.1.39.tgz#854ab5624136419cef4c803b1823acabe11f1c15"

slate@^0.34.7:
version "0.34.7"
resolved "https://registry.yarnpkg.com/slate/-/slate-0.34.7.tgz#5908e1d0fc092a2212488beca65671f01e0eb80a"
dependencies:
debug "^3.1.0"
direction "^0.1.5"
esrever "^0.2.0"
is-empty "^1.0.0"
is-plain-object "^2.0.4"
lodash "^4.17.4"
slate-dev-logger "^0.1.39"
slate-schema-violations "^0.1.20"
type-of "^2.0.1"

[email protected]:
version "1.0.0"
resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d"
Expand Down