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

Commit

Permalink
Merge branch 'release/v3.0.0-rc1'
Browse files Browse the repository at this point in the history
  • Loading branch information
SofiaSousa committed Nov 5, 2018
2 parents c2b951d + 2623128 commit 6cf5282
Show file tree
Hide file tree
Showing 33 changed files with 119 additions and 135 deletions.
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
"document": true,
"localStorage": true,
"sessionStorage": true,
"XMLHttpRequest": true
"XMLHttpRequest": true,
"React": true,
"moment": true,
"jQuery": true
},
"plugins": [
"react",
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# gutenberg-js

![gutenberg-js](gutenberg_js_logo.svg?sanitize=true "gutenberg-js")

# gutenberg-js

We made [Gutenberg](https://github.com/Wordpress/gutenberg) editor a little more **customizable**!

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!
Expand Down
40 changes: 35 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@frontkom/gutenberg-js",
"version": "3.0.0-rc",
"version": "3.0.0-rc1",
"description": "gutenberg-js - An extension of the Wordpress Gutenberg editor",
"main": "build/js/gutenberg-js.js",
"repository": {
Expand All @@ -13,7 +13,6 @@
"dev": "NODE_ENV=development webpack",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"postinstall": "./scripts/install.sh",
"deploy": "npm run lint && npm publish --access public"
},
"homepage": "https://github.com/front/gutenberg-js#readme",
Expand All @@ -33,12 +32,43 @@
"WYSIWYG"
],
"dependencies": {
"react-dates": "^18.1.1",
"@wordpress/a11y": "^2.0.2",
"@wordpress/api-fetch": "^2.2.1",
"@wordpress/autop": "^2.0.2",
"@wordpress/blob": "^2.1.0",
"@wordpress/block-library": "^2.1.7",
"@wordpress/block-serialization-default-parser": "^1.0.1",
"@wordpress/blocks": "^5.1.1",
"@wordpress/components": "^5.0.1",
"@wordpress/core-data": "^2.0.8",
"@wordpress/data": "^3.0.1",
"@wordpress/date": "^2.1.0",
"@wordpress/deprecated": "^2.0.3",
"@wordpress/dom": "^2.0.4",
"@wordpress/dom-ready": "^2.0.2",
"@wordpress/edit-post": "^2.0.2",
"@wordpress/editor": "^6.1.0",
"@wordpress/element": "^2.1.5",
"@wordpress/escape-html": "^1.0.1",
"@wordpress/hooks": "^2.0.3",
"@wordpress/html-entities": "^2.0.2",
"@wordpress/i18n": "^3.0.1",
"@wordpress/is-shallow-equal": "^1.1.4",
"@wordpress/keycodes": "^2.0.3",
"@wordpress/nux": "^2.0.8",
"@wordpress/plugins": "^2.0.6",
"@wordpress/redux-routine": "^3.0.3",
"@wordpress/rich-text": "^2.0.1",
"@wordpress/shortcode": "^2.0.2",
"@wordpress/token-list": "^1.0.2",
"@wordpress/url": "^2.2.0",
"@wordpress/viewport": "^2.0.7",
"@wordpress/wordcount": "^2.0.3",
"tinymce": "4.8.0"
},
"devDependencies": {
"@wordpress/babel-plugin-makepot": "1.0.1",
"@wordpress/scripts": "1.2.0",
"@wordpress/babel-plugin-makepot": "^1.0.1",
"@wordpress/scripts": "^1.2.0",
"babel-core": "^6.26.3",
"babel-eslint": "7.2.3",
"babel-jest": "20.0.3",
Expand Down
23 changes: 0 additions & 23 deletions scripts/install.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* External dependencies
*/
import React from 'react';
import classnames from 'classnames';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* External Dependencies
*/
import React from 'react';
import { filter, pick } from 'lodash';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* External Dependencies
*/
import React from 'react';
import classnames from 'classnames';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* External dependencies
*/
import React from 'react';
import { filter, every } from 'lodash';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* External dependencies
*/
import React from 'react';
import classnames from 'classnames';
import {
get,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* External dependencies
*/
import React from 'react';
import classnames from 'classnames';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
* External dependencies
*/
import { get, kebabCase, map, mapKeys, castArray } from 'lodash';
import jQuery from 'jquery';

import def, * as others from 'gutenberg/packages/blocks/build-module/api/parser?source=node_modules';
import def, * as others from '@wordpress/blocks/build-module/api/parser?source=node_modules';

const { parseWithAttributeSchema, isOfTypes } = others;

Expand Down Expand Up @@ -90,4 +89,4 @@ others.getBlockAttribute = (attributeKey, attributeSchema, innerHTML, commentAtt
};

export default def;
export * from 'gutenberg/packages/blocks/build-module/api/parser?source=node_modules';
export * from '@wordpress/blocks/build-module/api/parser?source=node_modules';
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import React, { Component, Fragment } from 'react';
import { Component, Fragment } from 'react';
import { get } from 'lodash';

/**
Expand All @@ -21,11 +21,24 @@ class MediaContainer extends Component {
onImageClick (img) {
const { onSelect, closePopover, gallery = false, multiple = false } = this.props;

const imgObject = {
alt: img.alt_text,
caption: img.caption.raw,
id: img.id,
link: img.link,
mime: img.mime_type,
sizes: img.media_details.sizes,
subtype: img.mime_type.split('/')[1],
type: img.mime_type.split('/')[0],
url: img.source_url,
data: img.data,
};

if (gallery || multiple) {
onSelect([{ ...img, url: img.source_url }]);
onSelect([imgObject]);
}
else {
onSelect({ ...img, url: img.source_url });
onSelect(imgObject);
}

closePopover();
Expand Down Expand Up @@ -77,7 +90,6 @@ class MediaUpload extends Component {
return false;
}


const { isVisible } = this.state;

return <Fragment>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* WordPress dependencies
*/
import React from 'react';
import { MenuItem } from '@wordpress/components';
import { Fragment } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { get } from 'lodash';
import def from 'gutenberg/packages/edit-post/build-module/store/effects?source=node_modules';
import def from '@wordpress/edit-post/build-module/store/effects?source=node_modules';

def.OPEN_GENERAL_SIDEBAR = (action, store) => {
if (get(window, [ 'customGutenberg', 'events', 'OPEN_GENERAL_SIDEBAR' ])) {
Expand All @@ -17,4 +17,4 @@ def.CLOSE_GENERAL_SIDEBAR = (action, store) => {
};

export default def;
export * from 'gutenberg/packages/edit-post/build-module/store/effects?source=node_modules';
export * from '@wordpress/edit-post/build-module/store/effects?source=node_modules';
Original file line number Diff line number Diff line change
@@ -1,12 +1,41 @@
/**
* WordPress dependencies
*/
import { Component } from '@wordpress/element';
import { compose, ifCondition } from '@wordpress/compose';
import { withSelect, withDispatch } from '@wordpress/data';

import * as others from 'gutenberg/packages/editor/build-module/components/autosave-monitor?source=node_modules';
export class AutosaveMonitor extends Component {
componentDidUpdate (prevProps) {
const { isDirty, isAutosaveable } = this.props;

const { AutosaveMonitor } = others;
if (
prevProps.isDirty !== isDirty ||
prevProps.isAutosaveable !== isAutosaveable
) {
this.toggleTimer(isDirty && isAutosaveable);
}
}

componentWillUnmount () {
this.toggleTimer(false);
}

toggleTimer (isPendingSave) {
clearTimeout(this.pendingSave);
const { autosaveInterval } = this.props;
if (isPendingSave) {
this.pendingSave = setTimeout(
() => this.props.autosave(),
autosaveInterval * 1000
);
}
}

render () {
return null;
}
}

export default compose([
withSelect(select => {
Expand All @@ -15,9 +44,7 @@ export default compose([
isEditedPostAutosaveable,
getEditorSettings,
} = select('core/editor');

const { autosaveInterval, canSave, canAutosave } = getEditorSettings();

return {
isDirty: isEditedPostDirty(),
isAutosaveable: isEditedPostAutosaveable(),
Expand All @@ -35,5 +62,3 @@ export default compose([
// the autoave feature according 'canSave' and 'canAutosave' settings
ifCondition(({ canSave, canAutosave }) => canSave && canAutosave),
])(AutosaveMonitor);

export * from 'gutenberg/packages/editor/build-module/components/autosave-monitor?source=node_modules';
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* External dependencies
*/
import React from 'react';
import {
filter,
find,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* External dependencies
*/
import React from 'react';

/**
* WordPress Dependencies
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* External dependencies
*/
import React from 'react';
import classnames from 'classnames';
import { get } from 'lodash';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as others from 'gutenberg/packages/editor/build-module/store/defaults?source=node_modules';
import * as others from '@wordpress/editor/build-module/store/defaults?source=node_modules';

// Properties to handle with save and publish features
others.EDITOR_SETTINGS_DEFAULTS.canPublish = true;
Expand All @@ -8,4 +8,4 @@ others.EDITOR_SETTINGS_DEFAULTS.canAutosave = true;
// Property to show/hide media library option
others.EDITOR_SETTINGS_DEFAULTS.mediaLibrary = true;

export * from 'gutenberg/packages/editor/build-module/store/defaults?source=node_modules';
export * from '@wordpress/editor/build-module/store/defaults?source=node_modules';
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as others from 'gutenberg/packages/editor/build-module/store/selectors?source=node_modules';
import * as others from '@wordpress/editor/build-module/store/selectors?source=node_modules';

// no utility level => no Most Used blocks section
others.INSERTER_UTILITY_HIGH = others.INSERTER_UTILITY_NONE;
others.INSERTER_UTILITY_MEDIUM = others.INSERTER_UTILITY_NONE;
others.INSERTER_UTILITY_LOW = others.INSERTER_UTILITY_NONE;

export * from 'gutenberg/packages/editor/build-module/store/selectors?source=node_modules';
export * from '@wordpress/editor/build-module/store/selectors?source=node_modules';
Loading

0 comments on commit 6cf5282

Please sign in to comment.