Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Commit c2b951d

Browse files
committed
Merge branch 'release/v3.0.0-rc'
2 parents 38b8974 + 53eefec commit c2b951d

43 files changed

Lines changed: 2017 additions & 2076 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
],
3030
"settings": {
3131
"react": {
32-
"pragma": "React"
32+
"pragma": "React",
33+
"version": "16.0"
3334
}
3435
},
3536
"rules": {

README.md

Lines changed: 58 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# gutenberg-js
22

3+
![gutenberg-js](gutenberg_js_logo.svg?sanitize=true "gutenberg-js")
4+
35
We made [Gutenberg](https://github.com/Wordpress/gutenberg) editor a little more **customizable**!
46

57
Gutenberg editor can **be easly included in your apps** with this [package](https://github.com/front/gutenberg-js). Also you can customize blocks menu panels, blocks categories, document panels and more!
68

7-
This package is based on [Gutenberg v3.9.0](https://github.com/WordPress/gutenberg/releases/tag/v3.9.0).
9+
This package is based on [Gutenberg v4.2.0-rc.1](https://github.com/WordPress/gutenberg/releases/tag/v4.2.0-rc.1).
810

911
## Table of contents
1012

@@ -16,10 +18,10 @@ This package is based on [Gutenberg v3.9.0](https://github.com/WordPress/gutenbe
1618
* [Wp block](#wp-block)
1719
* [Posts and Pages](#posts-and-pages)
1820
* [Categories](#categories)
19-
* [Index](#index)
2021
* [Media](#media)
2122
* [Taxonomies](#taxonomies)
2223
* [Blocks](#blocks)
24+
* [Themes](#themes)
2325
* [url](#url)
2426
* [Usage](#usage)
2527
* [Gutenberg Stores](#gutenberg-stores)
@@ -30,13 +32,14 @@ This package is based on [Gutenberg v3.9.0](https://github.com/WordPress/gutenbe
3032
* [Custom blocks](#custom-blocks)
3133
* [Creating and Registering](#creating-and-registering)
3234
* [Sharing](#sharing)
35+
* [Development](#development)
3336

3437
## Installation
3538

3639
**gutenberg-js** is available through npm.
3740

3841
```sh
39-
npm install @frontkom/gutenberg-js
42+
$ npm install @frontkom/gutenberg-js
4043
```
4144

4245
[↑ Go up to Table of contents](#table-of-contents)
@@ -62,6 +65,17 @@ module.exports = {
6265
}
6366
```
6467

68+
GutenbergJS expects to find React (v16.4.1), ReactDOM (v16.4.1), moment (v2.22.1), jQuery (v1.12.4) and lodash (v4.17.5) libraries in the environment it runs. Maybe you would add the following lines to your pages.
69+
70+
```html
71+
<script src="https://unpkg.com/react@16.4.1/umd/react.production.min.js"></script>
72+
<script src="https://unpkg.com/react-dom@16.4.1/umd/react-dom.production.min.js"></script>
73+
<script src="https://unpkg.com/moment@2.22.1/min/moment.min.js"></script>
74+
<script src="https://unpkg.com/lodash@4.17.5/lodash.min.js"></script>
75+
<script>window.lodash = _.noConflict();</script>
76+
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
77+
```
78+
6579
[↑ Go up to Table of contents](#table-of-contents)
6680

6781
## Global variables
@@ -159,23 +173,6 @@ Check the WordPress API documentation for [Categories](https://developer.wordpre
159173

160174
[↑ Go up to Table of contents](#table-of-contents)
161175

162-
#### Index
163-
164-
Gutenberg will ask for the [theme features](https://codex.wordpress.org/Theme_Features) through the index request (`/`). The response should be the following object.
165-
166-
```js
167-
{
168-
...,
169-
theme_supports: {
170-
formats: [ 'standard', 'aside', 'image', 'video', 'quote', 'link', 'gallery', 'audio' ],
171-
'post-thumbnails': true,
172-
},
173-
...,
174-
}
175-
```
176-
177-
[↑ Go up to Table of contents](#table-of-contents)
178-
179176
#### Taxonomies
180177

181178
Taxonomies and Categories are requested to fill Categories panel in Document sidebar. Check the WordPress API documentation for [Taxonomies](https://developer.wordpress.org/rest-api/reference/taxonomies/).
@@ -214,6 +211,25 @@ There is no documentation for `/wp/v2/wp_blocks` or `/wp/v2/blocks` request yet,
214211

215212
Gutenberg editor allows us to create, edit, list, get one and delete one block operations, so make sure you expect GET, POST, PUT and DELETE requests.
216213

214+
[↑ Go up to Table of contents](#table-of-contents)
215+
216+
#### Themes
217+
218+
Gutenberg will ask for the [theme features](https://codex.wordpress.org/Theme_Features) through the index request (`/wp/v2/themes`). The response should be the following object.
219+
220+
```js
221+
{
222+
...,
223+
theme_supports: {
224+
formats: [ 'standard', 'aside', 'image', 'video', 'quote', 'link', 'gallery', 'audio' ],
225+
'post-thumbnails': true,
226+
},
227+
...,
228+
}
229+
```
230+
231+
[↑ Go up to Table of contents](#table-of-contents)
232+
217233
### url
218234

219235
***url*** should has a function called `addQueryArgs( url, args )` that handles with `url` and `args` and returns the final url to different actions. The original implementation is the following, feel free to keep it or change it according to your needs.
@@ -257,11 +273,6 @@ import { editPost } from '@frontkom/gutenberg-js';
257273

258274
// Don't forget to import the style
259275
import '@frontkom/gutenberg-js/build/css/block-library/style.css';
260-
import '@frontkom/gutenberg-js/build/css/components/style.css';
261-
import '@frontkom/gutenberg-js/build/css/nux/style.css';
262-
import '@frontkom/gutenberg-js/build/css/editor/style.css';
263-
import '@frontkom/gutenberg-js/build/css/block-library/theme.css';
264-
import '@frontkom/gutenberg-js/build/css/block-library/edit-blocks.css';
265276
import '@frontkom/gutenberg-js/build/css/style.css';
266277

267278
// DOM element id where editor will be displayed
@@ -277,11 +288,16 @@ const settings = {
277288
availableTemplates: [],
278289
allowedBlockTypes: true,
279290
disableCustomColors: false,
291+
disableCustomFontSizes: false,
280292
disablePostFormats: false,
281293
titlePlaceholder: "Add title",
282294
bodyPlaceholder: "Write your story",
283295
isRTL: false,
284296
autosaveInterval: 10,
297+
styles: [],
298+
postLock: {
299+
isLocked: false,
300+
},
285301
...
286302
// @frontkom/gutenberg-js settings
287303
canAutosave: false, // to disable the Editor Autosave feature (default: true)
@@ -564,3 +580,20 @@ An easy way to share a custom block is to publish the block as a npm package.
564580
Here is an example of a custom block npm package, the [Hero Section](https://github.com/front/g-hero-section).
565581

566582
[↑ Go up to Table of contents](#table-of-contents)
583+
584+
## Development
585+
586+
### Upgrading
587+
588+
* Update Gutenberg version in `scripts/install.sh`
589+
* Check `gutenbergPackages` list in `webpack.config.js`
590+
* Check modules list in `index.js`
591+
* Check `gutenberg-overrides` one by one
592+
593+
### Publising
594+
595+
```sh
596+
$ npm run deploy
597+
```
598+
599+
[↑ Go up to Table of contents](#table-of-contents)

gutenberg_js_logo.svg

Lines changed: 12 additions & 0 deletions
Loading

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@frontkom/gutenberg-js",
3-
"version": "2.6.1",
3+
"version": "3.0.0-rc",
44
"description": "gutenberg-js - An extension of the Wordpress Gutenberg editor",
55
"main": "build/js/gutenberg-js.js",
66
"repository": {
@@ -13,7 +13,8 @@
1313
"dev": "NODE_ENV=development webpack",
1414
"lint": "eslint .",
1515
"lint:fix": "eslint . --fix",
16-
"postinstall": "./scripts/install.sh"
16+
"postinstall": "./scripts/install.sh",
17+
"deploy": "npm run lint && npm publish --access public"
1718
},
1819
"homepage": "https://github.com/front/gutenberg-js#readme",
1920
"bugs": {
@@ -32,6 +33,7 @@
3233
"WYSIWYG"
3334
],
3435
"dependencies": {
36+
"react-dates": "^18.1.1",
3537
"tinymce": "4.8.0"
3638
},
3739
"devDependencies": {
@@ -60,9 +62,7 @@
6062
"raw-loader": "0.5.1",
6163
"sass-loader": "6.0.7",
6264
"webpack": "4.8.3",
63-
"webpack-cli": "2.1.3",
64-
"webpack-livereload-plugin": "2.1.1",
65-
"webpack-rtl-plugin": "github:yoavf/webpack-rtl-plugin#develop"
65+
"webpack-cli": "2.1.3"
6666
},
6767
"private": false
6868
}

scripts/install.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ git clone https://github.com/WordPress/gutenberg.git
1313
cd gutenberg
1414

1515
# checkout to version we want
16-
git checkout tags/v3.9.0
16+
git checkout tags/v4.2.0-rc.1
1717

1818
# remove git references
19-
rm -rf .git
19+
# GUTENBERG HAS A SUBMODULE NOW
20+
# rm -rf .git
2021

2122
# install gutenberg dependencies
2223
npm i

src/js/api-fetch-init.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import apiFetch from 'gutenberg/packages/api-fetch/build-module';
2+
3+
if (window.wp.apiFetch) {
4+
const props = Object.keys(apiFetch);
5+
6+
props.forEach(prop => {
7+
window.wp.apiFetch[prop] = window.wp.apiFetch[prop] || apiFetch[prop];
8+
});
9+
}
10+
else {
11+
window.wp.apiFetch = apiFetch;
12+
}

src/js/gutenberg-overrides/edit-post/CHANGELOG.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/js/gutenberg-overrides/edit-post/components/header/more-menu/index.js

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)