From e30082b8b92399d40eee4da6911d4d77befeb2d3 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Fri, 20 Jul 2018 13:32:21 +0100 Subject: [PATCH 1/3] Packages: Extract the editor package --- core-blocks/test/full-content.js | 2 +- docs/tool/config.js | 4 +- lib/client-assets.php | 31 +++++-- package-lock.json | 49 +++++++++- package.json | 13 +-- packages/dom/package.json | 3 +- packages/editor/.npmrc | 1 + {editor => packages/editor}/README.md | 0 packages/editor/package.json | 71 ++++++++++++++ .../editor/src}/components/README.md | 0 .../components/alignment-toolbar/index.js | 0 .../test/__snapshots__/index.js.snap | 0 .../alignment-toolbar/test/index.js | 0 .../src}/components/autocomplete/README.md | 0 .../src}/components/autocomplete/index.js | 0 .../components/autocomplete/test/index.js | 0 .../src}/components/autocompleters/README.md | 0 .../src}/components/autocompleters/block.js | 1 - .../src}/components/autocompleters/index.js | 5 - .../src}/components/autocompleters/style.scss | 0 .../components/autocompleters/test/block.js | 0 .../src}/components/autocompleters/user.js | 0 .../src}/components/autosave-monitor/index.js | 0 .../components/autosave-monitor/test/index.js | 0 .../block-alignment-toolbar/index.js | 0 .../test/__snapshots__/index.js.snap | 0 .../block-alignment-toolbar/test/index.js | 0 .../src}/components/block-controls/index.js | 0 .../test/__snapshots__/index.js.snap | 0 .../components/block-controls/test/index.js | 0 .../src}/components/block-drop-zone/index.js | 5 - .../components/block-drop-zone/style.scss | 0 .../src}/components/block-edit/context.js | 0 .../editor/src}/components/block-edit/edit.js | 0 .../src}/components/block-edit/index.js | 0 .../src}/components/block-edit/test/edit.js | 0 .../components/block-format-controls/index.js | 0 .../src}/components/block-icon/index.js | 1 - .../src}/components/block-icon/style.scss | 0 .../src}/components/block-icon/test/index.js | 0 .../src}/components/block-inspector/index.js | 1 - .../components/block-inspector/style.scss | 0 .../block-list/block-contextual-toolbar.js | 0 .../block-list/block-crash-boundary.js | 0 .../block-list/block-crash-warning.js | 0 .../components/block-list/block-draggable.js | 0 .../src}/components/block-list/block-html.js | 0 .../block-list/block-invalid-warning.js | 0 .../block-list/block-mobile-toolbar.js | 0 .../src}/components/block-list/block.js | 0 .../src}/components/block-list/breadcrumb.js | 0 .../block-list/ignore-nested-events.js | 0 .../src}/components/block-list/index.js | 1 - .../components/block-list/insertion-point.js | 0 .../src}/components/block-list/layout.js | 1 - .../components/block-list/multi-controls.js | 0 .../src}/components/block-list/style.scss | 3 +- .../block-list/test/ignore-nested-events.js | 0 .../components/block-list/with-hover-areas.js | 0 .../src}/components/block-mover/arrows.js | 0 .../src}/components/block-mover/index.js | 1 - .../block-mover/mover-description.js | 0 .../src}/components/block-mover/style.scss | 0 .../src}/components/block-mover/test/index.js | 0 .../block-mover/test/mover-description.js | 0 .../src}/components/block-preview/index.js | 1 - .../src}/components/block-preview/style.scss | 0 .../block-selection-clearer/index.js | 0 .../block-convert-button.js | 0 .../block-duplicate-button.js | 0 .../block-html-convert-button.js | 0 .../block-settings-menu/block-mode-toggle.js | 0 .../block-remove-button.js | 0 .../block-settings-menu-first-item.js | 0 .../block-unknown-convert-button.js | 0 .../components/block-settings-menu/index.js | 1 - .../reusable-block-convert-button.js | 0 .../reusable-block-delete-button.js | 0 .../components/block-settings-menu/style.scss | 0 .../__snapshots__/block-remove-button.js.snap | 0 .../reusable-block-delete-button.js.snap | 0 .../test/block-mode-toggle.js | 0 .../test/block-remove-button.js | 0 .../test/reusable-block-convert-button.js | 0 .../test/reusable-block-delete-button.js | 0 .../src}/components/block-styles/index.js | 1 - .../src}/components/block-styles/style.scss | 0 .../components/block-styles/test/index.js | 0 .../src}/components/block-switcher/index.js | 1 - .../block-switcher/multi-blocks-switcher.js | 1 - .../src}/components/block-switcher/style.scss | 0 .../test/__snapshots__/index.js.snap | 0 .../multi-blocks-switcher.js.snap | 0 .../components/block-switcher/test/index.js | 41 ++++++++- .../test/multi-blocks-switcher.js | 0 .../src}/components/block-title/README.md | 0 .../src}/components/block-title/index.js | 0 .../src}/components/block-title/test/index.js | 0 .../src}/components/block-toolbar/index.js | 1 - .../src}/components/block-toolbar/style.scss | 0 .../src}/components/block-types-list/index.js | 1 - .../components/block-types-list/style.scss | 0 .../src}/components/color-palette/control.js | 1 - .../components/color-palette/control.scss | 0 .../src}/components/color-palette/index.js | 0 .../test/__snapshots__/control.js.snap | 0 .../components/color-palette/test/control.js | 0 .../color-palette/with-color-context.js | 0 .../editor/src}/components/colors/index.js | 0 .../editor/src}/components/colors/utils.js | 0 .../colors/with-colors-deprecated.js | 92 +++++++++++++++++++ .../src}/components/colors/with-colors.js | 0 .../src}/components/contrast-checker/index.js | 5 - .../components/contrast-checker/style.scss | 0 .../test/__snapshots__/index.js.snap | 0 .../components/contrast-checker/test/index.js | 0 .../src}/components/copy-handler/index.js | 0 .../default-block-appender/index.js | 1 - .../default-block-appender/style.scss | 0 .../test/__snapshots__/index.js.snap | 0 .../default-block-appender/test/index.js | 0 .../src}/components/document-outline/check.js | 0 .../src}/components/document-outline/index.js | 1 - .../src}/components/document-outline/item.js | 0 .../components/document-outline/style.scss | 0 .../test/__snapshots__/index.js.snap | 0 .../components/document-outline/test/index.js | 67 ++++++++++---- .../src}/components/document-title/index.js | 6 +- .../editor-global-keyboard-shortcuts/index.js | 0 .../src}/components/editor-history/redo.js | 0 .../src}/components/editor-history/undo.js | 0 .../src}/components/editor-notices/index.js | 0 .../src}/components/error-boundary/index.js | 0 .../editor/src}/components/index.js | 0 .../editor/src}/components/index.native.js | 0 .../src}/components/inner-blocks/README.md | 0 .../src}/components/inner-blocks/index.js | 1 - .../src}/components/inner-blocks/style.scss | 0 .../test/__snapshots__/index.js.snap | 0 .../components/inner-blocks/test/index.js | 0 .../inserter-with-shortcuts/index.js | 1 - .../inserter-with-shortcuts/style.scss | 0 .../src}/components/inserter/child-blocks.js | 1 - .../editor/src}/components/inserter/index.js | 0 .../editor/src}/components/inserter/menu.js | 1 - .../components/inserter/results-portal.js | 0 .../src}/components/inserter/style.scss | 0 .../src}/components/inserter/test/menu.js | 0 .../inspector-advanced-controls/index.js | 0 .../components/inspector-controls/index.js | 0 .../components/media-placeholder/index.js | 1 - .../components/media-placeholder/style.scss | 0 .../src}/components/media-upload/README.md | 0 .../src}/components/media-upload/index.js | 0 .../multi-select-scroll-into-view/index.js | 0 .../components/navigable-toolbar/index.js | 0 .../src}/components/observe-typing/README.md | 0 .../src}/components/observe-typing/index.js | 0 .../src}/components/page-attributes/check.js | 0 .../src}/components/page-attributes/order.js | 0 .../src}/components/page-attributes/parent.js | 0 .../components/page-attributes/style.scss | 0 .../components/page-attributes/template.js | 5 - .../components/page-attributes/test/check.js | 0 .../components/page-attributes/test/order.js | 0 .../components/panel-color-settings/index.js | 1 - .../panel-color-settings/style.scss | 0 .../test/__snapshots__/index.js.snap | 0 .../panel-color-settings/test/index.js | 0 .../src}/components/panel-color/index.js | 0 .../src}/components/plain-text/README.md | 0 .../src}/components/plain-text/index.js | 5 - .../components/plain-text/index.native.js | 0 .../components/plain-text/style.native.scss | 0 .../src}/components/plain-text/style.scss | 0 .../src}/components/post-author/check.js | 0 .../src}/components/post-author/index.js | 0 .../src}/components/post-author/test/check.js | 0 .../src}/components/post-author/test/index.js | 0 .../src}/components/post-comments/index.js | 0 .../src}/components/post-excerpt/check.js | 0 .../src}/components/post-excerpt/index.js | 5 - .../src}/components/post-excerpt/style.scss | 0 .../components/post-featured-image/README.md | 0 .../components/post-featured-image/check.js | 0 .../components/post-featured-image/index.js | 1 - .../components/post-featured-image/style.scss | 0 .../src}/components/post-format/check.js | 0 .../src}/components/post-format/index.js | 1 - .../src}/components/post-format/style.scss | 0 .../components/post-last-revision/check.js | 0 .../components/post-last-revision/index.js | 1 - .../components/post-last-revision/style.scss | 0 .../post-last-revision/test/check.js | 0 .../components/post-pending-status/check.js | 0 .../components/post-pending-status/index.js | 0 .../post-pending-status/test/check.js | 0 .../src}/components/post-permalink/editor.js | 5 - .../src}/components/post-permalink/index.js | 1 - .../src}/components/post-permalink/style.scss | 0 .../src}/components/post-pingbacks/index.js | 0 .../components/post-preview-button/index.js | 0 .../test/__snapshots__/index.js.snap | 0 .../post-preview-button/test/index.js | 2 +- .../components/post-publish-button/index.js | 0 .../components/post-publish-button/label.js | 0 .../post-publish-button/test/index.js | 2 +- .../post-publish-button/test/label.js | 0 .../components/post-publish-panel/index.js | 1 - .../post-publish-panel/postpublish.js | 0 .../post-publish-panel/prepublish.js | 0 .../components/post-publish-panel/style.scss | 0 .../post-publish-panel/test/toggle.js | 0 .../components/post-publish-panel/toggle.js | 0 .../src}/components/post-saved-state/index.js | 1 - .../components/post-saved-state/style.scss | 0 .../test/__snapshots__/index.js.snap | 0 .../components/post-saved-state/test/index.js | 0 .../src}/components/post-schedule/check.js | 0 .../src}/components/post-schedule/index.js | 0 .../src}/components/post-schedule/label.js | 0 .../components/post-schedule/test/check.js | 0 .../src}/components/post-sticky/check.js | 0 .../src}/components/post-sticky/index.js | 0 .../src}/components/post-sticky/test/index.js | 0 .../post-switch-to-draft-button/index.js | 0 .../src}/components/post-taxonomies/check.js | 0 .../post-taxonomies/flat-term-selector.js | 0 .../hierarchical-term-selector.js | 0 .../src}/components/post-taxonomies/index.js | 1 - .../components/post-taxonomies/style.scss | 0 .../components/post-taxonomies/test/index.js | 0 .../src}/components/post-text-editor/index.js | 5 - .../components/post-text-editor/style.scss | 0 .../src}/components/post-title/index.js | 1 - .../src}/components/post-title/style.scss | 0 .../src}/components/post-trash/check.js | 0 .../src}/components/post-trash/index.js | 5 - .../src}/components/post-trash/style.scss | 0 .../post-type-support-check/README.md | 0 .../post-type-support-check/index.js | 0 .../post-type-support-check/test/index.js | 0 .../src}/components/post-visibility/check.js | 0 .../src}/components/post-visibility/index.js | 0 .../src}/components/post-visibility/label.js | 0 .../components/post-visibility/test/check.js | 0 .../src}/components/post-visibility/utils.js | 0 .../preserve-scroll-in-reorder/index.js | 0 .../editor/src}/components/provider/index.js | 0 .../src}/components/rich-text/README.md | 0 .../editor/src}/components/rich-text/aria.js | 0 .../rich-text/core-tokens/image/index.js | 1 - .../rich-text/core-tokens/image/style.scss | 0 .../components/rich-text/core-tokens/index.js | 0 .../rich-text/format-toolbar/index.js | 1 - .../format-toolbar/positioned-at-selection.js | 0 .../rich-text/format-toolbar/style.scss | 0 .../src}/components/rich-text/format.js | 0 .../editor/src}/components/rich-text/index.js | 1 - .../src}/components/rich-text/patterns.js | 0 .../src}/components/rich-text/provider.js | 0 .../src}/components/rich-text/style.scss | 0 .../test/__snapshots__/format.js.snap | 0 .../src}/components/rich-text/test/format.js | 0 .../src}/components/rich-text/test/index.js | 0 .../src}/components/rich-text/tinymce.js | 0 .../src}/components/rich-text/tokens/index.js | 0 .../components/rich-text/tokens/ui/index.js | 1 - .../components/rich-text/tokens/ui/style.scss | 0 .../skip-to-selected-block/index.js | 1 - .../skip-to-selected-block/style.scss | 0 .../components/table-of-contents/index.js | 1 - .../components/table-of-contents/panel.js | 0 .../components/table-of-contents/style.scss | 0 .../template-validation-notice/index.js | 5 - .../template-validation-notice/style.scss | 0 .../components/theme-support-check/index.js | 0 .../theme-support-check/test/index.js | 0 .../unsaved-changes-warning/index.js | 0 .../src}/components/url-input/button.js | 1 - .../editor/src}/components/url-input/index.js | 0 .../src}/components/url-input/style.scss | 0 .../src}/components/url-input/test/button.js | 0 .../editor/src}/components/warning/index.js | 5 - .../editor/src}/components/warning/style.scss | 0 .../warning/test/__snapshots__/index.js.snap | 0 .../src}/components/warning/test/index.js | 0 .../with-deprecated-unique-id/index.js | 0 .../src}/components/word-count/index.js | 0 .../src}/components/writing-flow/index.js | 1 - .../src}/components/writing-flow/style.scss | 0 .../editor/src}/hooks/align.js | 0 .../editor/src}/hooks/anchor.js | 0 .../editor/src}/hooks/custom-class-name.js | 0 .../src}/hooks/custom-class-name.native.js | 0 .../src}/hooks/default-autocompleters.js | 0 .../editor/src}/hooks/generated-class-name.js | 0 .../editor/src}/hooks/index.js | 0 .../editor/src}/hooks/index.native.js | 0 .../editor/src}/hooks/layout.js | 0 .../editor/src}/hooks/test/align.js | 0 .../editor/src}/hooks/test/anchor.js | 0 .../src}/hooks/test/custom-class-name.js | 0 .../src}/hooks/test/default-autocompleters.js | 0 .../src}/hooks/test/generated-class-name.js | 0 .../editor/src}/hooks/test/layout.js | 0 {editor => packages/editor/src}/index.js | 0 .../editor/src}/store/actions.js | 0 .../editor/src}/store/array.js | 0 .../editor/src}/store/defaults.js | 0 .../editor/src}/store/effects.js | 0 .../editor/src}/store/effects/posts.js | 0 .../src}/store/effects/reusable-blocks.js | 0 .../store/effects/test/reusable-blocks.js | 0 .../editor/src}/store/effects/test/utils.js | 0 .../editor/src}/store/effects/utils.js | 0 .../editor/src}/store/index.js | 0 .../editor/src}/store/index.native.js | 0 .../editor/src}/store/middlewares.js | 0 .../editor/src}/store/reducer.js | 0 .../editor/src}/store/selectors.js | 0 .../editor/src}/store/test/actions.js | 0 .../editor/src}/store/test/array.js | 0 .../editor/src}/store/test/effects.js | 0 .../editor/src}/store/test/reducer.js | 5 - .../editor/src}/store/test/selectors.js | 0 packages/editor/src/style.scss | 44 +++++++++ {editor => packages/editor/src}/utils/dom.js | 0 .../editor/src}/utils/index.js | 0 .../editor/src}/utils/index.native.js | 0 .../editor/src}/utils/media-upload/index.js | 0 .../src}/utils/media-upload/media-upload.js | 0 .../utils/media-upload/test/media-upload.js | 0 .../editor/src}/utils/terms.js | 0 .../editor/src}/utils/test/dom.js | 0 .../editor/src}/utils/test/terms.js | 0 .../editor/src}/utils/test/url.js | 0 {editor => packages/editor/src}/utils/url.js | 0 .../utils/with-change-detection/README.md | 0 .../src}/utils/with-change-detection/index.js | 0 .../utils/with-change-detection/test/index.js | 0 .../editor/src}/utils/with-history/README.md | 0 .../editor/src}/utils/with-history/index.js | 0 .../src}/utils/with-history/test/index.js | 0 test/integration/blocks-raw-handling.spec.js | 2 +- test/integration/is-valid-block.spec.js | 2 +- test/unit/jest.config.json | 2 +- webpack.config.js | 4 +- 348 files changed, 382 insertions(+), 157 deletions(-) create mode 100644 packages/editor/.npmrc rename {editor => packages/editor}/README.md (100%) create mode 100644 packages/editor/package.json rename {editor => packages/editor/src}/components/README.md (100%) rename {editor => packages/editor/src}/components/alignment-toolbar/index.js (100%) rename {editor => packages/editor/src}/components/alignment-toolbar/test/__snapshots__/index.js.snap (100%) rename {editor => packages/editor/src}/components/alignment-toolbar/test/index.js (100%) rename {editor => packages/editor/src}/components/autocomplete/README.md (100%) rename {editor => packages/editor/src}/components/autocomplete/index.js (100%) rename {editor => packages/editor/src}/components/autocomplete/test/index.js (100%) rename {editor => packages/editor/src}/components/autocompleters/README.md (100%) rename {editor => packages/editor/src}/components/autocompleters/block.js (99%) rename {editor => packages/editor/src}/components/autocompleters/index.js (66%) rename {editor => packages/editor/src}/components/autocompleters/style.scss (100%) rename {editor => packages/editor/src}/components/autocompleters/test/block.js (100%) rename {editor => packages/editor/src}/components/autocompleters/user.js (100%) rename {editor => packages/editor/src}/components/autosave-monitor/index.js (100%) rename {editor => packages/editor/src}/components/autosave-monitor/test/index.js (100%) rename {editor => packages/editor/src}/components/block-alignment-toolbar/index.js (100%) rename {editor => packages/editor/src}/components/block-alignment-toolbar/test/__snapshots__/index.js.snap (100%) rename {editor => packages/editor/src}/components/block-alignment-toolbar/test/index.js (100%) rename {editor => packages/editor/src}/components/block-controls/index.js (100%) rename {editor => packages/editor/src}/components/block-controls/test/__snapshots__/index.js.snap (100%) rename {editor => packages/editor/src}/components/block-controls/test/index.js (100%) rename {editor => packages/editor/src}/components/block-drop-zone/index.js (98%) rename {editor => packages/editor/src}/components/block-drop-zone/style.scss (100%) rename {editor => packages/editor/src}/components/block-edit/context.js (100%) rename {editor => packages/editor/src}/components/block-edit/edit.js (100%) rename {editor => packages/editor/src}/components/block-edit/index.js (100%) rename {editor => packages/editor/src}/components/block-edit/test/edit.js (100%) rename {editor => packages/editor/src}/components/block-format-controls/index.js (100%) rename {editor => packages/editor/src}/components/block-icon/index.js (97%) rename {editor => packages/editor/src}/components/block-icon/style.scss (100%) rename {editor => packages/editor/src}/components/block-icon/test/index.js (100%) rename {editor => packages/editor/src}/components/block-inspector/index.js (98%) rename {editor => packages/editor/src}/components/block-inspector/style.scss (100%) rename {editor => packages/editor/src}/components/block-list/block-contextual-toolbar.js (100%) rename {editor => packages/editor/src}/components/block-list/block-crash-boundary.js (100%) rename {editor => packages/editor/src}/components/block-list/block-crash-warning.js (100%) rename {editor => packages/editor/src}/components/block-list/block-draggable.js (100%) rename {editor => packages/editor/src}/components/block-list/block-html.js (100%) rename {editor => packages/editor/src}/components/block-list/block-invalid-warning.js (100%) rename {editor => packages/editor/src}/components/block-list/block-mobile-toolbar.js (100%) rename {editor => packages/editor/src}/components/block-list/block.js (100%) rename {editor => packages/editor/src}/components/block-list/breadcrumb.js (100%) rename {editor => packages/editor/src}/components/block-list/ignore-nested-events.js (100%) rename {editor => packages/editor/src}/components/block-list/index.js (98%) rename {editor => packages/editor/src}/components/block-list/insertion-point.js (100%) rename {editor => packages/editor/src}/components/block-list/layout.js (99%) rename {editor => packages/editor/src}/components/block-list/multi-controls.js (100%) rename {editor => packages/editor/src}/components/block-list/style.scss (99%) rename {editor => packages/editor/src}/components/block-list/test/ignore-nested-events.js (100%) rename {editor => packages/editor/src}/components/block-list/with-hover-areas.js (100%) rename {editor => packages/editor/src}/components/block-mover/arrows.js (100%) rename {editor => packages/editor/src}/components/block-mover/index.js (99%) rename {editor => packages/editor/src}/components/block-mover/mover-description.js (100%) rename {editor => packages/editor/src}/components/block-mover/style.scss (100%) rename {editor => packages/editor/src}/components/block-mover/test/index.js (100%) rename {editor => packages/editor/src}/components/block-mover/test/mover-description.js (100%) rename {editor => packages/editor/src}/components/block-preview/index.js (97%) rename {editor => packages/editor/src}/components/block-preview/style.scss (100%) rename {editor => packages/editor/src}/components/block-selection-clearer/index.js (100%) rename {editor => packages/editor/src}/components/block-settings-menu/block-convert-button.js (100%) rename {editor => packages/editor/src}/components/block-settings-menu/block-duplicate-button.js (100%) rename {editor => packages/editor/src}/components/block-settings-menu/block-html-convert-button.js (100%) rename {editor => packages/editor/src}/components/block-settings-menu/block-mode-toggle.js (100%) rename {editor => packages/editor/src}/components/block-settings-menu/block-remove-button.js (100%) rename {editor => packages/editor/src}/components/block-settings-menu/block-settings-menu-first-item.js (100%) rename {editor => packages/editor/src}/components/block-settings-menu/block-unknown-convert-button.js (100%) rename {editor => packages/editor/src}/components/block-settings-menu/index.js (99%) rename {editor => packages/editor/src}/components/block-settings-menu/reusable-block-convert-button.js (100%) rename {editor => packages/editor/src}/components/block-settings-menu/reusable-block-delete-button.js (100%) rename {editor => packages/editor/src}/components/block-settings-menu/style.scss (100%) rename {editor => packages/editor/src}/components/block-settings-menu/test/__snapshots__/block-remove-button.js.snap (100%) rename {editor => packages/editor/src}/components/block-settings-menu/test/__snapshots__/reusable-block-delete-button.js.snap (100%) rename {editor => packages/editor/src}/components/block-settings-menu/test/block-mode-toggle.js (100%) rename {editor => packages/editor/src}/components/block-settings-menu/test/block-remove-button.js (100%) rename {editor => packages/editor/src}/components/block-settings-menu/test/reusable-block-convert-button.js (100%) rename {editor => packages/editor/src}/components/block-settings-menu/test/reusable-block-delete-button.js (100%) rename {editor => packages/editor/src}/components/block-styles/index.js (99%) rename {editor => packages/editor/src}/components/block-styles/style.scss (100%) rename {editor => packages/editor/src}/components/block-styles/test/index.js (100%) rename {editor => packages/editor/src}/components/block-switcher/index.js (99%) rename {editor => packages/editor/src}/components/block-switcher/multi-blocks-switcher.js (96%) rename {editor => packages/editor/src}/components/block-switcher/style.scss (100%) rename {editor => packages/editor/src}/components/block-switcher/test/__snapshots__/index.js.snap (100%) rename {editor => packages/editor/src}/components/block-switcher/test/__snapshots__/multi-blocks-switcher.js.snap (100%) rename {editor => packages/editor/src}/components/block-switcher/test/index.js (81%) rename {editor => packages/editor/src}/components/block-switcher/test/multi-blocks-switcher.js (100%) rename {editor => packages/editor/src}/components/block-title/README.md (100%) rename {editor => packages/editor/src}/components/block-title/index.js (100%) rename {editor => packages/editor/src}/components/block-title/test/index.js (100%) rename {editor => packages/editor/src}/components/block-toolbar/index.js (98%) rename {editor => packages/editor/src}/components/block-toolbar/style.scss (100%) rename {editor => packages/editor/src}/components/block-types-list/index.js (99%) rename {editor => packages/editor/src}/components/block-types-list/style.scss (100%) rename {editor => packages/editor/src}/components/color-palette/control.js (98%) rename {editor => packages/editor/src}/components/color-palette/control.scss (100%) rename {editor => packages/editor/src}/components/color-palette/index.js (100%) rename {editor => packages/editor/src}/components/color-palette/test/__snapshots__/control.js.snap (100%) rename {editor => packages/editor/src}/components/color-palette/test/control.js (100%) rename {editor => packages/editor/src}/components/color-palette/with-color-context.js (100%) rename {editor => packages/editor/src}/components/colors/index.js (100%) rename {editor => packages/editor/src}/components/colors/utils.js (100%) create mode 100644 packages/editor/src/components/colors/with-colors-deprecated.js rename {editor => packages/editor/src}/components/colors/with-colors.js (100%) rename {editor => packages/editor/src}/components/contrast-checker/index.js (96%) rename {editor => packages/editor/src}/components/contrast-checker/style.scss (100%) rename {editor => packages/editor/src}/components/contrast-checker/test/__snapshots__/index.js.snap (100%) rename {editor => packages/editor/src}/components/contrast-checker/test/index.js (100%) rename {editor => packages/editor/src}/components/copy-handler/index.js (100%) rename {editor => packages/editor/src}/components/default-block-appender/index.js (99%) rename {editor => packages/editor/src}/components/default-block-appender/style.scss (100%) rename {editor => packages/editor/src}/components/default-block-appender/test/__snapshots__/index.js.snap (100%) rename {editor => packages/editor/src}/components/default-block-appender/test/index.js (100%) rename {editor => packages/editor/src}/components/document-outline/check.js (100%) rename {editor => packages/editor/src}/components/document-outline/index.js (99%) rename {editor => packages/editor/src}/components/document-outline/item.js (100%) rename {editor => packages/editor/src}/components/document-outline/style.scss (100%) rename {editor => packages/editor/src}/components/document-outline/test/__snapshots__/index.js.snap (100%) rename {editor => packages/editor/src}/components/document-outline/test/index.js (72%) rename {editor => packages/editor/src}/components/document-title/index.js (91%) rename {editor => packages/editor/src}/components/editor-global-keyboard-shortcuts/index.js (100%) rename {editor => packages/editor/src}/components/editor-history/redo.js (100%) rename {editor => packages/editor/src}/components/editor-history/undo.js (100%) rename {editor => packages/editor/src}/components/editor-notices/index.js (100%) rename {editor => packages/editor/src}/components/error-boundary/index.js (100%) rename {editor => packages/editor/src}/components/index.js (100%) rename {editor => packages/editor/src}/components/index.native.js (100%) rename {editor => packages/editor/src}/components/inner-blocks/README.md (100%) rename {editor => packages/editor/src}/components/inner-blocks/index.js (99%) rename {editor => packages/editor/src}/components/inner-blocks/style.scss (100%) rename {editor => packages/editor/src}/components/inner-blocks/test/__snapshots__/index.js.snap (100%) rename {editor => packages/editor/src}/components/inner-blocks/test/index.js (100%) rename {editor => packages/editor/src}/components/inserter-with-shortcuts/index.js (98%) rename {editor => packages/editor/src}/components/inserter-with-shortcuts/style.scss (100%) rename {editor => packages/editor/src}/components/inserter/child-blocks.js (98%) rename {editor => packages/editor/src}/components/inserter/index.js (100%) rename {editor => packages/editor/src}/components/inserter/menu.js (99%) rename {editor => packages/editor/src}/components/inserter/results-portal.js (100%) rename {editor => packages/editor/src}/components/inserter/style.scss (100%) rename {editor => packages/editor/src}/components/inserter/test/menu.js (100%) rename {editor => packages/editor/src}/components/inspector-advanced-controls/index.js (100%) rename {editor => packages/editor/src}/components/inspector-controls/index.js (100%) rename {editor => packages/editor/src}/components/media-placeholder/index.js (99%) rename {editor => packages/editor/src}/components/media-placeholder/style.scss (100%) rename {editor => packages/editor/src}/components/media-upload/README.md (100%) rename {editor => packages/editor/src}/components/media-upload/index.js (100%) rename {editor => packages/editor/src}/components/multi-select-scroll-into-view/index.js (100%) rename {editor => packages/editor/src}/components/navigable-toolbar/index.js (100%) rename {editor => packages/editor/src}/components/observe-typing/README.md (100%) rename {editor => packages/editor/src}/components/observe-typing/index.js (100%) rename {editor => packages/editor/src}/components/page-attributes/check.js (100%) rename {editor => packages/editor/src}/components/page-attributes/order.js (100%) rename {editor => packages/editor/src}/components/page-attributes/parent.js (100%) rename {editor => packages/editor/src}/components/page-attributes/style.scss (100%) rename {editor => packages/editor/src}/components/page-attributes/template.js (96%) rename {editor => packages/editor/src}/components/page-attributes/test/check.js (100%) rename {editor => packages/editor/src}/components/page-attributes/test/order.js (100%) rename {editor => packages/editor/src}/components/panel-color-settings/index.js (98%) rename {editor => packages/editor/src}/components/panel-color-settings/style.scss (100%) rename {editor => packages/editor/src}/components/panel-color-settings/test/__snapshots__/index.js.snap (100%) rename {editor => packages/editor/src}/components/panel-color-settings/test/index.js (100%) rename {editor => packages/editor/src}/components/panel-color/index.js (100%) rename {editor => packages/editor/src}/components/plain-text/README.md (100%) rename {editor => packages/editor/src}/components/plain-text/index.js (87%) rename {editor => packages/editor/src}/components/plain-text/index.native.js (100%) rename {editor => packages/editor/src}/components/plain-text/style.native.scss (100%) rename {editor => packages/editor/src}/components/plain-text/style.scss (100%) rename {editor => packages/editor/src}/components/post-author/check.js (100%) rename {editor => packages/editor/src}/components/post-author/index.js (100%) rename {editor => packages/editor/src}/components/post-author/test/check.js (100%) rename {editor => packages/editor/src}/components/post-author/test/index.js (100%) rename {editor => packages/editor/src}/components/post-comments/index.js (100%) rename {editor => packages/editor/src}/components/post-excerpt/check.js (100%) rename {editor => packages/editor/src}/components/post-excerpt/index.js (94%) rename {editor => packages/editor/src}/components/post-excerpt/style.scss (100%) rename {editor => packages/editor/src}/components/post-featured-image/README.md (100%) rename {editor => packages/editor/src}/components/post-featured-image/check.js (100%) rename {editor => packages/editor/src}/components/post-featured-image/index.js (99%) rename {editor => packages/editor/src}/components/post-featured-image/style.scss (100%) rename {editor => packages/editor/src}/components/post-format/check.js (100%) rename {editor => packages/editor/src}/components/post-format/index.js (99%) rename {editor => packages/editor/src}/components/post-format/style.scss (100%) rename {editor => packages/editor/src}/components/post-last-revision/check.js (100%) rename {editor => packages/editor/src}/components/post-last-revision/index.js (97%) rename {editor => packages/editor/src}/components/post-last-revision/style.scss (100%) rename {editor => packages/editor/src}/components/post-last-revision/test/check.js (100%) rename {editor => packages/editor/src}/components/post-pending-status/check.js (100%) rename {editor => packages/editor/src}/components/post-pending-status/index.js (100%) rename {editor => packages/editor/src}/components/post-pending-status/test/check.js (100%) rename {editor => packages/editor/src}/components/post-permalink/editor.js (97%) rename {editor => packages/editor/src}/components/post-permalink/index.js (99%) rename {editor => packages/editor/src}/components/post-permalink/style.scss (100%) rename {editor => packages/editor/src}/components/post-pingbacks/index.js (100%) rename {editor => packages/editor/src}/components/post-preview-button/index.js (100%) rename {editor => packages/editor/src}/components/post-preview-button/test/__snapshots__/index.js.snap (100%) rename {editor => packages/editor/src}/components/post-preview-button/test/index.js (98%) rename {editor => packages/editor/src}/components/post-publish-button/index.js (100%) rename {editor => packages/editor/src}/components/post-publish-button/label.js (100%) rename {editor => packages/editor/src}/components/post-publish-button/test/index.js (98%) rename {editor => packages/editor/src}/components/post-publish-button/test/label.js (100%) rename {editor => packages/editor/src}/components/post-publish-panel/index.js (99%) rename {editor => packages/editor/src}/components/post-publish-panel/postpublish.js (100%) rename {editor => packages/editor/src}/components/post-publish-panel/prepublish.js (100%) rename {editor => packages/editor/src}/components/post-publish-panel/style.scss (100%) rename {editor => packages/editor/src}/components/post-publish-panel/test/toggle.js (100%) rename {editor => packages/editor/src}/components/post-publish-panel/toggle.js (100%) rename {editor => packages/editor/src}/components/post-saved-state/index.js (99%) rename {editor => packages/editor/src}/components/post-saved-state/style.scss (100%) rename {editor => packages/editor/src}/components/post-saved-state/test/__snapshots__/index.js.snap (100%) rename {editor => packages/editor/src}/components/post-saved-state/test/index.js (100%) rename {editor => packages/editor/src}/components/post-schedule/check.js (100%) rename {editor => packages/editor/src}/components/post-schedule/index.js (100%) rename {editor => packages/editor/src}/components/post-schedule/label.js (100%) rename {editor => packages/editor/src}/components/post-schedule/test/check.js (100%) rename {editor => packages/editor/src}/components/post-sticky/check.js (100%) rename {editor => packages/editor/src}/components/post-sticky/index.js (100%) rename {editor => packages/editor/src}/components/post-sticky/test/index.js (100%) rename {editor => packages/editor/src}/components/post-switch-to-draft-button/index.js (100%) rename {editor => packages/editor/src}/components/post-taxonomies/check.js (100%) rename {editor => packages/editor/src}/components/post-taxonomies/flat-term-selector.js (100%) rename {editor => packages/editor/src}/components/post-taxonomies/hierarchical-term-selector.js (100%) rename {editor => packages/editor/src}/components/post-taxonomies/index.js (98%) rename {editor => packages/editor/src}/components/post-taxonomies/style.scss (100%) rename {editor => packages/editor/src}/components/post-taxonomies/test/index.js (100%) rename {editor => packages/editor/src}/components/post-text-editor/index.js (98%) rename {editor => packages/editor/src}/components/post-text-editor/style.scss (100%) rename {editor => packages/editor/src}/components/post-title/index.js (99%) rename {editor => packages/editor/src}/components/post-title/style.scss (100%) rename {editor => packages/editor/src}/components/post-trash/check.js (100%) rename {editor => packages/editor/src}/components/post-trash/index.js (94%) rename {editor => packages/editor/src}/components/post-trash/style.scss (100%) rename {editor => packages/editor/src}/components/post-type-support-check/README.md (100%) rename {editor => packages/editor/src}/components/post-type-support-check/index.js (100%) rename {editor => packages/editor/src}/components/post-type-support-check/test/index.js (100%) rename {editor => packages/editor/src}/components/post-visibility/check.js (100%) rename {editor => packages/editor/src}/components/post-visibility/index.js (100%) rename {editor => packages/editor/src}/components/post-visibility/label.js (100%) rename {editor => packages/editor/src}/components/post-visibility/test/check.js (100%) rename {editor => packages/editor/src}/components/post-visibility/utils.js (100%) rename {editor => packages/editor/src}/components/preserve-scroll-in-reorder/index.js (100%) rename {editor => packages/editor/src}/components/provider/index.js (100%) rename {editor => packages/editor/src}/components/rich-text/README.md (100%) rename {editor => packages/editor/src}/components/rich-text/aria.js (100%) rename {editor => packages/editor/src}/components/rich-text/core-tokens/image/index.js (97%) rename editor/components/rich-text/core-tokens/image/editor.scss => packages/editor/src/components/rich-text/core-tokens/image/style.scss (100%) rename {editor => packages/editor/src}/components/rich-text/core-tokens/index.js (100%) rename {editor => packages/editor/src}/components/rich-text/format-toolbar/index.js (99%) rename {editor => packages/editor/src}/components/rich-text/format-toolbar/positioned-at-selection.js (100%) rename {editor => packages/editor/src}/components/rich-text/format-toolbar/style.scss (100%) rename {editor => packages/editor/src}/components/rich-text/format.js (100%) rename {editor => packages/editor/src}/components/rich-text/index.js (99%) rename {editor => packages/editor/src}/components/rich-text/patterns.js (100%) rename {editor => packages/editor/src}/components/rich-text/provider.js (100%) rename {editor => packages/editor/src}/components/rich-text/style.scss (100%) rename {editor => packages/editor/src}/components/rich-text/test/__snapshots__/format.js.snap (100%) rename {editor => packages/editor/src}/components/rich-text/test/format.js (100%) rename {editor => packages/editor/src}/components/rich-text/test/index.js (100%) rename {editor => packages/editor/src}/components/rich-text/tinymce.js (100%) rename {editor => packages/editor/src}/components/rich-text/tokens/index.js (100%) rename {editor => packages/editor/src}/components/rich-text/tokens/ui/index.js (98%) rename {editor => packages/editor/src}/components/rich-text/tokens/ui/style.scss (100%) rename {editor => packages/editor/src}/components/skip-to-selected-block/index.js (97%) rename {editor => packages/editor/src}/components/skip-to-selected-block/style.scss (100%) rename {editor => packages/editor/src}/components/table-of-contents/index.js (97%) rename {editor => packages/editor/src}/components/table-of-contents/panel.js (100%) rename {editor => packages/editor/src}/components/table-of-contents/style.scss (100%) rename {editor => packages/editor/src}/components/template-validation-notice/index.js (96%) rename {editor => packages/editor/src}/components/template-validation-notice/style.scss (100%) rename {editor => packages/editor/src}/components/theme-support-check/index.js (100%) rename {editor => packages/editor/src}/components/theme-support-check/test/index.js (100%) rename {editor => packages/editor/src}/components/unsaved-changes-warning/index.js (100%) rename {editor => packages/editor/src}/components/url-input/button.js (98%) rename {editor => packages/editor/src}/components/url-input/index.js (100%) rename {editor => packages/editor/src}/components/url-input/style.scss (100%) rename {editor => packages/editor/src}/components/url-input/test/button.js (100%) rename {editor => packages/editor/src}/components/warning/index.js (91%) rename {editor => packages/editor/src}/components/warning/style.scss (100%) rename {editor => packages/editor/src}/components/warning/test/__snapshots__/index.js.snap (100%) rename {editor => packages/editor/src}/components/warning/test/index.js (100%) rename {editor => packages/editor/src}/components/with-deprecated-unique-id/index.js (100%) rename {editor => packages/editor/src}/components/word-count/index.js (100%) rename {editor => packages/editor/src}/components/writing-flow/index.js (99%) rename {editor => packages/editor/src}/components/writing-flow/style.scss (100%) rename {editor => packages/editor/src}/hooks/align.js (100%) rename {editor => packages/editor/src}/hooks/anchor.js (100%) rename {editor => packages/editor/src}/hooks/custom-class-name.js (100%) rename {editor => packages/editor/src}/hooks/custom-class-name.native.js (100%) rename {editor => packages/editor/src}/hooks/default-autocompleters.js (100%) rename {editor => packages/editor/src}/hooks/generated-class-name.js (100%) rename {editor => packages/editor/src}/hooks/index.js (100%) rename {editor => packages/editor/src}/hooks/index.native.js (100%) rename {editor => packages/editor/src}/hooks/layout.js (100%) rename {editor => packages/editor/src}/hooks/test/align.js (100%) rename {editor => packages/editor/src}/hooks/test/anchor.js (100%) rename {editor => packages/editor/src}/hooks/test/custom-class-name.js (100%) rename {editor => packages/editor/src}/hooks/test/default-autocompleters.js (100%) rename {editor => packages/editor/src}/hooks/test/generated-class-name.js (100%) rename {editor => packages/editor/src}/hooks/test/layout.js (100%) rename {editor => packages/editor/src}/index.js (100%) rename {editor => packages/editor/src}/store/actions.js (100%) rename {editor => packages/editor/src}/store/array.js (100%) rename {editor => packages/editor/src}/store/defaults.js (100%) rename {editor => packages/editor/src}/store/effects.js (100%) rename {editor => packages/editor/src}/store/effects/posts.js (100%) rename {editor => packages/editor/src}/store/effects/reusable-blocks.js (100%) rename {editor => packages/editor/src}/store/effects/test/reusable-blocks.js (100%) rename {editor => packages/editor/src}/store/effects/test/utils.js (100%) rename {editor => packages/editor/src}/store/effects/utils.js (100%) rename {editor => packages/editor/src}/store/index.js (100%) rename {editor => packages/editor/src}/store/index.native.js (100%) rename {editor => packages/editor/src}/store/middlewares.js (100%) rename {editor => packages/editor/src}/store/reducer.js (100%) rename {editor => packages/editor/src}/store/selectors.js (100%) rename {editor => packages/editor/src}/store/test/actions.js (100%) rename {editor => packages/editor/src}/store/test/array.js (100%) rename {editor => packages/editor/src}/store/test/effects.js (100%) rename {editor => packages/editor/src}/store/test/reducer.js (99%) rename {editor => packages/editor/src}/store/test/selectors.js (100%) create mode 100644 packages/editor/src/style.scss rename {editor => packages/editor/src}/utils/dom.js (100%) rename {editor => packages/editor/src}/utils/index.js (100%) rename {editor => packages/editor/src}/utils/index.native.js (100%) rename {editor => packages/editor/src}/utils/media-upload/index.js (100%) rename {editor => packages/editor/src}/utils/media-upload/media-upload.js (100%) rename {editor => packages/editor/src}/utils/media-upload/test/media-upload.js (100%) rename {editor => packages/editor/src}/utils/terms.js (100%) rename {editor => packages/editor/src}/utils/test/dom.js (100%) rename {editor => packages/editor/src}/utils/test/terms.js (100%) rename {editor => packages/editor/src}/utils/test/url.js (100%) rename {editor => packages/editor/src}/utils/url.js (100%) rename {editor => packages/editor/src}/utils/with-change-detection/README.md (100%) rename {editor => packages/editor/src}/utils/with-change-detection/index.js (100%) rename {editor => packages/editor/src}/utils/with-change-detection/test/index.js (100%) rename {editor => packages/editor/src}/utils/with-history/README.md (100%) rename {editor => packages/editor/src}/utils/with-history/index.js (100%) rename {editor => packages/editor/src}/utils/with-history/test/index.js (100%) diff --git a/core-blocks/test/full-content.js b/core-blocks/test/full-content.js index 63687cbe62731..f1b79b1007c52 100644 --- a/core-blocks/test/full-content.js +++ b/core-blocks/test/full-content.js @@ -108,7 +108,7 @@ describe( 'full post content fixture', () => { unstable__bootstrapServerSideBlockDefinitions( require( './server-registered.json' ) ); // Load all hooks that modify blocks - require( 'editor/hooks' ); + require( '../../packages/editor/src/hooks' ); registerCoreBlocks(); } ); diff --git a/docs/tool/config.js b/docs/tool/config.js index e6c9bd9717207..a23566ce7494a 100644 --- a/docs/tool/config.js +++ b/docs/tool/config.js @@ -33,8 +33,8 @@ module.exports = { }, 'core/editor': { title: 'The Editor’s Data', - selectors: [ path.resolve( root, 'editor/store/selectors.js' ) ], - actions: [ path.resolve( root, 'editor/store/actions.js' ) ], + selectors: [ path.resolve( root, 'packages/editor/src/store/selectors.js' ) ], + actions: [ path.resolve( root, 'packages/editor/src/store/actions.js' ) ], }, 'core/edit-post': { title: 'The Editor’s UI Data', diff --git a/lib/client-assets.php b/lib/client-assets.php index 55b062639952e..2e36553bd3a24 100644 --- a/lib/client-assets.php +++ b/lib/client-assets.php @@ -78,6 +78,13 @@ function gutenberg_register_scripts_and_styles() { // WordPress packages. wp_register_script( 'wp-tinymce', includes_url( 'js/tinymce/' ) . 'wp-tinymce.php', array() ); + wp_register_script( + 'wp-url', + gutenberg_url( 'build/url/index.js' ), + array(), + filemtime( gutenberg_dir_path() . 'build/url/index.js' ), + true + ); wp_register_script( 'wp-autop', gutenberg_url( 'build/autop/index.js' ), @@ -85,6 +92,13 @@ function gutenberg_register_scripts_and_styles() { filemtime( gutenberg_dir_path() . 'build/autop/index.js' ), true ); + wp_register_script( + 'wp-wordcount', + gutenberg_url( 'build/wordcount/index.js' ), + array(), + filemtime( gutenberg_dir_path() . 'build/wordcount/index.js' ), + true + ); wp_register_script( 'wp-dom-ready', gutenberg_url( 'build/dom-ready/index.js' ), @@ -439,10 +453,6 @@ function gutenberg_register_scripts_and_styles() { 'wp-editor', gutenberg_url( 'build/editor/index.js' ), array( - 'editor', - 'jquery', - 'lodash', - 'postbox', 'wp-a11y', 'wp-api-fetch', 'wp-blob', @@ -454,16 +464,21 @@ function gutenberg_register_scripts_and_styles() { 'wp-date', 'wp-deprecated', 'wp-dom', + 'wp-element', + 'wp-hooks', + 'wp-html-entities', 'wp-i18n', + 'wp-is-shallow-equal', 'wp-keycodes', - 'wp-element', - 'wp-plugins', + 'wp-nux', + 'wp-url', 'wp-viewport', + 'wp-wordcount', + 'lodash', 'wp-tinymce', 'tinymce-latest-lists', 'tinymce-latest-paste', 'tinymce-latest-table', - 'wp-nux', ), filemtime( gutenberg_dir_path() . 'build/editor/index.js' ) ); @@ -474,9 +489,11 @@ function gutenberg_register_scripts_and_styles() { array( 'jquery', 'lodash', + 'postbox', 'media-models', 'media-views', 'wp-a11y', + 'wp-api', 'wp-api-fetch', 'wp-components', 'wp-compose', diff --git a/package-lock.json b/package-lock.json index 43b384a2f7f5b..7605e90d7e497 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3432,8 +3432,7 @@ "requires": { "@babel/runtime": "^7.0.0-beta.52", "element-closest": "^2.0.2", - "lodash": "^4.17.10", - "tinymce": "^4.7.2" + "lodash": "^4.17.10" } }, "@wordpress/dom-ready": { @@ -3442,6 +3441,49 @@ "@babel/runtime": "^7.0.0-beta.52" } }, + "@wordpress/editor": { + "version": "file:packages/editor", + "requires": { + "@babel/runtime": "^7.0.0-beta.52", + "@wordpress/a11y": "file:packages/a11y", + "@wordpress/api-fetch": "file:packages/api-fetch", + "@wordpress/blob": "file:packages/blob", + "@wordpress/blocks": "file:packages/blocks", + "@wordpress/components": "file:packages/components", + "@wordpress/compose": "file:packages/compose", + "@wordpress/core-data": "file:packages/core-data", + "@wordpress/data": "file:packages/data", + "@wordpress/date": "file:packages/date", + "@wordpress/deprecated": "file:packages/deprecated", + "@wordpress/dom": "file:packages/dom", + "@wordpress/element": "file:packages/element", + "@wordpress/hooks": "file:packages/hooks", + "@wordpress/html-entities": "file:packages/html-entities", + "@wordpress/i18n": "file:packages/i18n", + "@wordpress/is-shallow-equal": "file:packages/is-shallow-equal", + "@wordpress/keycodes": "file:packages/keycodes", + "@wordpress/nux": "file:packages/nux", + "@wordpress/url": "file:packages/url", + "@wordpress/viewport": "file:packages/viewport", + "@wordpress/wordcount": "file:packages/wordcount", + "classnames": "^2.2.5", + "dom-react": "^2.2.1", + "dom-scroll-into-view": "^1.2.1", + "element-closest": "^2.0.2", + "lodash": "^4.17.10", + "memize": "^1.0.5", + "querystring": "^0.2.0", + "querystringify": "^1.0.0", + "react-autosize-textarea": "^3.0.2", + "redux-multi": "^0.1.12", + "redux-optimist": "^1.0.0", + "refx": "^3.0.0", + "rememo": "^3.0.0", + "tinycolor2": "^1.4.1", + "tinymce": "^4.7.2", + "uuid": "^3.1.0" + } + }, "@wordpress/element": { "version": "file:packages/element", "requires": { @@ -16878,8 +16920,7 @@ "querystring": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "dev": true + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" }, "querystring-es3": { "version": "0.2.1", diff --git a/package.json b/package.json index 11fb7a0c1947c..00d8b579beea9 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "@wordpress/deprecated": "file:packages/deprecated", "@wordpress/dom": "file:packages/dom", "@wordpress/dom-ready": "file:packages/dom-ready", + "@wordpress/editor": "file:packages/editor", "@wordpress/element": "file:packages/element", "@wordpress/hooks": "file:packages/hooks", "@wordpress/html-entities": "file:packages/html-entities", @@ -42,9 +43,6 @@ "@wordpress/viewport": "file:packages/viewport", "@wordpress/wordcount": "file:packages/wordcount", "classnames": "2.2.5", - "dom-react": "2.2.1", - "dom-scroll-into-view": "1.2.1", - "element-closest": "2.0.2", "equivalent-key-map": "0.2.1", "eslint-plugin-wordpress": "git://github.com/WordPress-Coding-Standards/eslint-plugin-wordpress.git#1774343f6226052a46b081e01db3fca8793cc9f1", "jquery": "3.3.1", @@ -56,16 +54,10 @@ "querystringify": "1.0.0", "re-resizable": "4.4.8", "react": "16.4.1", - "react-autosize-textarea": "3.0.2", "react-dom": "16.4.1", "redux": "3.7.2", - "redux-multi": "0.1.12", - "redux-optimist": "1.0.0", "refx": "3.0.0", - "rememo": "3.0.0", - "tinycolor2": "1.4.1", - "tinymce": "4.7.2", - "uuid": "3.1.0" + "rememo": "3.0.0" }, "devDependencies": { "@babel/core": "7.0.0-beta.52", @@ -119,6 +111,7 @@ "sprintf-js": "1.1.1", "style-loader": "0.20.3", "symlink-or-copy": "1.2.0", + "uuid": "3.1.0", "webpack": "4.8.3", "webpack-cli": "2.1.3", "webpack-livereload-plugin": "2.1.1", diff --git a/packages/dom/package.json b/packages/dom/package.json index dcc7031dd2602..8b0c140dbdf30 100644 --- a/packages/dom/package.json +++ b/packages/dom/package.json @@ -22,8 +22,7 @@ "dependencies": { "@babel/runtime": "^7.0.0-beta.52", "element-closest": "^2.0.2", - "lodash": "^4.17.10", - "tinymce": "^4.7.2" + "lodash": "^4.17.10" }, "publishConfig": { "access": "public" diff --git a/packages/editor/.npmrc b/packages/editor/.npmrc new file mode 100644 index 0000000000000..43c97e719a5a8 --- /dev/null +++ b/packages/editor/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/editor/README.md b/packages/editor/README.md similarity index 100% rename from editor/README.md rename to packages/editor/README.md diff --git a/packages/editor/package.json b/packages/editor/package.json new file mode 100644 index 0000000000000..78f46d0f6f18d --- /dev/null +++ b/packages/editor/package.json @@ -0,0 +1,71 @@ +{ + "name": "@wordpress/editor", + "version": "1.0.0-alpha.1", + "description": "Building blocks for WordPress editors", + "author": "The WordPress Contributors", + "license": "GPL-2.0-or-later", + "keywords": [ + "wordpress", + "editor" + ], + "homepage": "https://github.com/WordPress/gutenberg/tree/master/packages/editor/README.md", + "repository": { + "type": "git", + "url": "https://github.com/WordPress/gutenberg.git" + }, + "bugs": { + "url": "https://github.com/WordPress/gutenberg/issues" + }, + "main": "build/index.js", + "module": "build-module/index.js", + "react-native": "src/index", + "dependencies": { + "@babel/runtime": "^7.0.0-beta.52", + "@wordpress/a11y": "file:../a11y", + "@wordpress/api-fetch": "file:../api-fetch", + "@wordpress/blob": "file:../blob", + "@wordpress/blocks": "file:../blocks", + "@wordpress/components": "file:../components", + "@wordpress/compose": "file:../compose", + "@wordpress/core-data": "file:../core-data", + "@wordpress/data": "file:../data", + "@wordpress/date": "file:../date", + "@wordpress/deprecated": "file:../deprecated", + "@wordpress/dom": "file:../dom", + "@wordpress/element": "file:../element", + "@wordpress/hooks": "file:../hooks", + "@wordpress/html-entities": "file:../html-entities", + "@wordpress/i18n": "file:../i18n", + "@wordpress/is-shallow-equal": "file:../is-shallow-equal", + "@wordpress/keycodes": "file:../keycodes", + "@wordpress/nux": "file:../nux", + "@wordpress/url": "file:../url", + "@wordpress/viewport": "file:../viewport", + "@wordpress/wordcount": "file:../wordcount", + "classnames": "^2.2.5", + "dom-react": "^2.2.1", + "dom-scroll-into-view": "^1.2.1", + "element-closest": "^2.0.2", + "lodash": "^4.17.10", + "memize": "^1.0.5", + "querystring": "^0.2.0", + "querystringify": "^1.0.0", + "react-autosize-textarea": "^3.0.2", + "redux-multi": "^0.1.12", + "redux-optimist": "^1.0.0", + "refx": "^3.0.0", + "rememo": "^3.0.0", + "tinycolor2": "^1.4.1", + "tinymce": "^4.7.2", + "uuid": "^3.1.0" + }, + "devDependencies": { + "deep-freeze": "^0.0.1", + "enzyme": "^3.3.0", + "react-dom": "^16.4.1", + "react-test-renderer": "^16.4.1" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/editor/components/README.md b/packages/editor/src/components/README.md similarity index 100% rename from editor/components/README.md rename to packages/editor/src/components/README.md diff --git a/editor/components/alignment-toolbar/index.js b/packages/editor/src/components/alignment-toolbar/index.js similarity index 100% rename from editor/components/alignment-toolbar/index.js rename to packages/editor/src/components/alignment-toolbar/index.js diff --git a/editor/components/alignment-toolbar/test/__snapshots__/index.js.snap b/packages/editor/src/components/alignment-toolbar/test/__snapshots__/index.js.snap similarity index 100% rename from editor/components/alignment-toolbar/test/__snapshots__/index.js.snap rename to packages/editor/src/components/alignment-toolbar/test/__snapshots__/index.js.snap diff --git a/editor/components/alignment-toolbar/test/index.js b/packages/editor/src/components/alignment-toolbar/test/index.js similarity index 100% rename from editor/components/alignment-toolbar/test/index.js rename to packages/editor/src/components/alignment-toolbar/test/index.js diff --git a/editor/components/autocomplete/README.md b/packages/editor/src/components/autocomplete/README.md similarity index 100% rename from editor/components/autocomplete/README.md rename to packages/editor/src/components/autocomplete/README.md diff --git a/editor/components/autocomplete/index.js b/packages/editor/src/components/autocomplete/index.js similarity index 100% rename from editor/components/autocomplete/index.js rename to packages/editor/src/components/autocomplete/index.js diff --git a/editor/components/autocomplete/test/index.js b/packages/editor/src/components/autocomplete/test/index.js similarity index 100% rename from editor/components/autocomplete/test/index.js rename to packages/editor/src/components/autocomplete/test/index.js diff --git a/editor/components/autocompleters/README.md b/packages/editor/src/components/autocompleters/README.md similarity index 100% rename from editor/components/autocompleters/README.md rename to packages/editor/src/components/autocompleters/README.md diff --git a/editor/components/autocompleters/block.js b/packages/editor/src/components/autocompleters/block.js similarity index 99% rename from editor/components/autocompleters/block.js rename to packages/editor/src/components/autocompleters/block.js index 963137e4eb40b..01b26951b08ce 100644 --- a/editor/components/autocompleters/block.js +++ b/packages/editor/src/components/autocompleters/block.js @@ -7,7 +7,6 @@ import { createBlock } from '@wordpress/blocks'; /** * Internal dependencies */ -import './style.scss'; import BlockIcon from '../block-icon'; /** diff --git a/editor/components/autocompleters/index.js b/packages/editor/src/components/autocompleters/index.js similarity index 66% rename from editor/components/autocompleters/index.js rename to packages/editor/src/components/autocompleters/index.js index e367e83c199f0..8b494925b94cc 100644 --- a/editor/components/autocompleters/index.js +++ b/packages/editor/src/components/autocompleters/index.js @@ -1,7 +1,2 @@ -/** - * Internal dependencies - */ -import './style.scss'; - export { default as blockAutocompleter } from './block'; export { default as userAutocompleter } from './user'; diff --git a/editor/components/autocompleters/style.scss b/packages/editor/src/components/autocompleters/style.scss similarity index 100% rename from editor/components/autocompleters/style.scss rename to packages/editor/src/components/autocompleters/style.scss diff --git a/editor/components/autocompleters/test/block.js b/packages/editor/src/components/autocompleters/test/block.js similarity index 100% rename from editor/components/autocompleters/test/block.js rename to packages/editor/src/components/autocompleters/test/block.js diff --git a/editor/components/autocompleters/user.js b/packages/editor/src/components/autocompleters/user.js similarity index 100% rename from editor/components/autocompleters/user.js rename to packages/editor/src/components/autocompleters/user.js diff --git a/editor/components/autosave-monitor/index.js b/packages/editor/src/components/autosave-monitor/index.js similarity index 100% rename from editor/components/autosave-monitor/index.js rename to packages/editor/src/components/autosave-monitor/index.js diff --git a/editor/components/autosave-monitor/test/index.js b/packages/editor/src/components/autosave-monitor/test/index.js similarity index 100% rename from editor/components/autosave-monitor/test/index.js rename to packages/editor/src/components/autosave-monitor/test/index.js diff --git a/editor/components/block-alignment-toolbar/index.js b/packages/editor/src/components/block-alignment-toolbar/index.js similarity index 100% rename from editor/components/block-alignment-toolbar/index.js rename to packages/editor/src/components/block-alignment-toolbar/index.js diff --git a/editor/components/block-alignment-toolbar/test/__snapshots__/index.js.snap b/packages/editor/src/components/block-alignment-toolbar/test/__snapshots__/index.js.snap similarity index 100% rename from editor/components/block-alignment-toolbar/test/__snapshots__/index.js.snap rename to packages/editor/src/components/block-alignment-toolbar/test/__snapshots__/index.js.snap diff --git a/editor/components/block-alignment-toolbar/test/index.js b/packages/editor/src/components/block-alignment-toolbar/test/index.js similarity index 100% rename from editor/components/block-alignment-toolbar/test/index.js rename to packages/editor/src/components/block-alignment-toolbar/test/index.js diff --git a/editor/components/block-controls/index.js b/packages/editor/src/components/block-controls/index.js similarity index 100% rename from editor/components/block-controls/index.js rename to packages/editor/src/components/block-controls/index.js diff --git a/editor/components/block-controls/test/__snapshots__/index.js.snap b/packages/editor/src/components/block-controls/test/__snapshots__/index.js.snap similarity index 100% rename from editor/components/block-controls/test/__snapshots__/index.js.snap rename to packages/editor/src/components/block-controls/test/__snapshots__/index.js.snap diff --git a/editor/components/block-controls/test/index.js b/packages/editor/src/components/block-controls/test/index.js similarity index 100% rename from editor/components/block-controls/test/index.js rename to packages/editor/src/components/block-controls/test/index.js diff --git a/editor/components/block-drop-zone/index.js b/packages/editor/src/components/block-drop-zone/index.js similarity index 98% rename from editor/components/block-drop-zone/index.js rename to packages/editor/src/components/block-drop-zone/index.js index 94b1108055b46..cf6b130343f13 100644 --- a/editor/components/block-drop-zone/index.js +++ b/packages/editor/src/components/block-drop-zone/index.js @@ -18,11 +18,6 @@ import { Component } from '@wordpress/element'; import { withDispatch, withSelect } from '@wordpress/data'; import { compose } from '@wordpress/compose'; -/** - * Internal dependencies - */ -import './style.scss'; - class BlockDropZone extends Component { constructor() { super( ...arguments ); diff --git a/editor/components/block-drop-zone/style.scss b/packages/editor/src/components/block-drop-zone/style.scss similarity index 100% rename from editor/components/block-drop-zone/style.scss rename to packages/editor/src/components/block-drop-zone/style.scss diff --git a/editor/components/block-edit/context.js b/packages/editor/src/components/block-edit/context.js similarity index 100% rename from editor/components/block-edit/context.js rename to packages/editor/src/components/block-edit/context.js diff --git a/editor/components/block-edit/edit.js b/packages/editor/src/components/block-edit/edit.js similarity index 100% rename from editor/components/block-edit/edit.js rename to packages/editor/src/components/block-edit/edit.js diff --git a/editor/components/block-edit/index.js b/packages/editor/src/components/block-edit/index.js similarity index 100% rename from editor/components/block-edit/index.js rename to packages/editor/src/components/block-edit/index.js diff --git a/editor/components/block-edit/test/edit.js b/packages/editor/src/components/block-edit/test/edit.js similarity index 100% rename from editor/components/block-edit/test/edit.js rename to packages/editor/src/components/block-edit/test/edit.js diff --git a/editor/components/block-format-controls/index.js b/packages/editor/src/components/block-format-controls/index.js similarity index 100% rename from editor/components/block-format-controls/index.js rename to packages/editor/src/components/block-format-controls/index.js diff --git a/editor/components/block-icon/index.js b/packages/editor/src/components/block-icon/index.js similarity index 97% rename from editor/components/block-icon/index.js rename to packages/editor/src/components/block-icon/index.js index 00b65d48c9784..99149d4425365 100644 --- a/editor/components/block-icon/index.js +++ b/packages/editor/src/components/block-icon/index.js @@ -6,7 +6,6 @@ import classnames from 'classnames'; /** * WordPress dependencies */ -import './style.scss'; import { Dashicon } from '@wordpress/components'; import { createElement, Component } from '@wordpress/element'; diff --git a/editor/components/block-icon/style.scss b/packages/editor/src/components/block-icon/style.scss similarity index 100% rename from editor/components/block-icon/style.scss rename to packages/editor/src/components/block-icon/style.scss diff --git a/editor/components/block-icon/test/index.js b/packages/editor/src/components/block-icon/test/index.js similarity index 100% rename from editor/components/block-icon/test/index.js rename to packages/editor/src/components/block-icon/test/index.js diff --git a/editor/components/block-inspector/index.js b/packages/editor/src/components/block-inspector/index.js similarity index 98% rename from editor/components/block-inspector/index.js rename to packages/editor/src/components/block-inspector/index.js index 8352078ac773f..cd6c3caf223ec 100644 --- a/editor/components/block-inspector/index.js +++ b/packages/editor/src/components/block-inspector/index.js @@ -14,7 +14,6 @@ import { withSelect } from '@wordpress/data'; /** * Internal Dependencies */ -import './style.scss'; import SkipToSelectedBlock from '../skip-to-selected-block'; import BlockIcon from '../block-icon'; import InspectorControls from '../inspector-controls'; diff --git a/editor/components/block-inspector/style.scss b/packages/editor/src/components/block-inspector/style.scss similarity index 100% rename from editor/components/block-inspector/style.scss rename to packages/editor/src/components/block-inspector/style.scss diff --git a/editor/components/block-list/block-contextual-toolbar.js b/packages/editor/src/components/block-list/block-contextual-toolbar.js similarity index 100% rename from editor/components/block-list/block-contextual-toolbar.js rename to packages/editor/src/components/block-list/block-contextual-toolbar.js diff --git a/editor/components/block-list/block-crash-boundary.js b/packages/editor/src/components/block-list/block-crash-boundary.js similarity index 100% rename from editor/components/block-list/block-crash-boundary.js rename to packages/editor/src/components/block-list/block-crash-boundary.js diff --git a/editor/components/block-list/block-crash-warning.js b/packages/editor/src/components/block-list/block-crash-warning.js similarity index 100% rename from editor/components/block-list/block-crash-warning.js rename to packages/editor/src/components/block-list/block-crash-warning.js diff --git a/editor/components/block-list/block-draggable.js b/packages/editor/src/components/block-list/block-draggable.js similarity index 100% rename from editor/components/block-list/block-draggable.js rename to packages/editor/src/components/block-list/block-draggable.js diff --git a/editor/components/block-list/block-html.js b/packages/editor/src/components/block-list/block-html.js similarity index 100% rename from editor/components/block-list/block-html.js rename to packages/editor/src/components/block-list/block-html.js diff --git a/editor/components/block-list/block-invalid-warning.js b/packages/editor/src/components/block-list/block-invalid-warning.js similarity index 100% rename from editor/components/block-list/block-invalid-warning.js rename to packages/editor/src/components/block-list/block-invalid-warning.js diff --git a/editor/components/block-list/block-mobile-toolbar.js b/packages/editor/src/components/block-list/block-mobile-toolbar.js similarity index 100% rename from editor/components/block-list/block-mobile-toolbar.js rename to packages/editor/src/components/block-list/block-mobile-toolbar.js diff --git a/editor/components/block-list/block.js b/packages/editor/src/components/block-list/block.js similarity index 100% rename from editor/components/block-list/block.js rename to packages/editor/src/components/block-list/block.js diff --git a/editor/components/block-list/breadcrumb.js b/packages/editor/src/components/block-list/breadcrumb.js similarity index 100% rename from editor/components/block-list/breadcrumb.js rename to packages/editor/src/components/block-list/breadcrumb.js diff --git a/editor/components/block-list/ignore-nested-events.js b/packages/editor/src/components/block-list/ignore-nested-events.js similarity index 100% rename from editor/components/block-list/ignore-nested-events.js rename to packages/editor/src/components/block-list/ignore-nested-events.js diff --git a/editor/components/block-list/index.js b/packages/editor/src/components/block-list/index.js similarity index 98% rename from editor/components/block-list/index.js rename to packages/editor/src/components/block-list/index.js index d7bc2aab3f80d..53f268ba871e1 100644 --- a/editor/components/block-list/index.js +++ b/packages/editor/src/components/block-list/index.js @@ -17,7 +17,6 @@ import deprecated from '@wordpress/deprecated'; /** * Internal dependencies */ -import './style.scss'; import BlockListLayout from './layout'; const UngroupedLayoutBlockList = withSelect( diff --git a/editor/components/block-list/insertion-point.js b/packages/editor/src/components/block-list/insertion-point.js similarity index 100% rename from editor/components/block-list/insertion-point.js rename to packages/editor/src/components/block-list/insertion-point.js diff --git a/editor/components/block-list/layout.js b/packages/editor/src/components/block-list/layout.js similarity index 99% rename from editor/components/block-list/layout.js rename to packages/editor/src/components/block-list/layout.js index 5f1706fe40e9b..e82b3c6f2602e 100644 --- a/editor/components/block-list/layout.js +++ b/packages/editor/src/components/block-list/layout.js @@ -24,7 +24,6 @@ import { compose } from '@wordpress/compose'; /** * Internal dependencies */ -import './style.scss'; import BlockListBlock from './block'; import IgnoreNestedEvents from './ignore-nested-events'; import DefaultBlockAppender from '../default-block-appender'; diff --git a/editor/components/block-list/multi-controls.js b/packages/editor/src/components/block-list/multi-controls.js similarity index 100% rename from editor/components/block-list/multi-controls.js rename to packages/editor/src/components/block-list/multi-controls.js diff --git a/editor/components/block-list/style.scss b/packages/editor/src/components/block-list/style.scss similarity index 99% rename from editor/components/block-list/style.scss rename to packages/editor/src/components/block-list/style.scss index 3f7a11c29771a..e26bf5839040e 100644 --- a/editor/components/block-list/style.scss +++ b/packages/editor/src/components/block-list/style.scss @@ -712,7 +712,8 @@ .editor-block-list__insertion-point-indicator { position: absolute; - top: calc( 50% - $border-width ); + // The 1px here should be $border-width but the SASS parser is not working properly. + top: calc( 50% - 1px ); height: 2px; left: 0; right: 0; diff --git a/editor/components/block-list/test/ignore-nested-events.js b/packages/editor/src/components/block-list/test/ignore-nested-events.js similarity index 100% rename from editor/components/block-list/test/ignore-nested-events.js rename to packages/editor/src/components/block-list/test/ignore-nested-events.js diff --git a/editor/components/block-list/with-hover-areas.js b/packages/editor/src/components/block-list/with-hover-areas.js similarity index 100% rename from editor/components/block-list/with-hover-areas.js rename to packages/editor/src/components/block-list/with-hover-areas.js diff --git a/editor/components/block-mover/arrows.js b/packages/editor/src/components/block-mover/arrows.js similarity index 100% rename from editor/components/block-mover/arrows.js rename to packages/editor/src/components/block-mover/arrows.js diff --git a/editor/components/block-mover/index.js b/packages/editor/src/components/block-mover/index.js similarity index 99% rename from editor/components/block-mover/index.js rename to packages/editor/src/components/block-mover/index.js index a76199f995ed7..93350f4233e3f 100644 --- a/editor/components/block-mover/index.js +++ b/packages/editor/src/components/block-mover/index.js @@ -17,7 +17,6 @@ import { withInstanceId, compose } from '@wordpress/compose'; /** * Internal dependencies */ -import './style.scss'; import { getBlockMoverDescription } from './mover-description'; import { upArrow, downArrow } from './arrows'; import withDeprecatedUniqueId from '../with-deprecated-unique-id'; diff --git a/editor/components/block-mover/mover-description.js b/packages/editor/src/components/block-mover/mover-description.js similarity index 100% rename from editor/components/block-mover/mover-description.js rename to packages/editor/src/components/block-mover/mover-description.js diff --git a/editor/components/block-mover/style.scss b/packages/editor/src/components/block-mover/style.scss similarity index 100% rename from editor/components/block-mover/style.scss rename to packages/editor/src/components/block-mover/style.scss diff --git a/editor/components/block-mover/test/index.js b/packages/editor/src/components/block-mover/test/index.js similarity index 100% rename from editor/components/block-mover/test/index.js rename to packages/editor/src/components/block-mover/test/index.js diff --git a/editor/components/block-mover/test/mover-description.js b/packages/editor/src/components/block-mover/test/mover-description.js similarity index 100% rename from editor/components/block-mover/test/mover-description.js rename to packages/editor/src/components/block-mover/test/mover-description.js diff --git a/editor/components/block-preview/index.js b/packages/editor/src/components/block-preview/index.js similarity index 97% rename from editor/components/block-preview/index.js rename to packages/editor/src/components/block-preview/index.js index a96a340569921..35063cab137b3 100644 --- a/editor/components/block-preview/index.js +++ b/packages/editor/src/components/block-preview/index.js @@ -14,7 +14,6 @@ import { Disabled } from '@wordpress/components'; * Internal dependencies */ import BlockEdit from '../block-edit'; -import './style.scss'; /** * Block Preview Component: It renders a preview given a block name and attributes. diff --git a/editor/components/block-preview/style.scss b/packages/editor/src/components/block-preview/style.scss similarity index 100% rename from editor/components/block-preview/style.scss rename to packages/editor/src/components/block-preview/style.scss diff --git a/editor/components/block-selection-clearer/index.js b/packages/editor/src/components/block-selection-clearer/index.js similarity index 100% rename from editor/components/block-selection-clearer/index.js rename to packages/editor/src/components/block-selection-clearer/index.js diff --git a/editor/components/block-settings-menu/block-convert-button.js b/packages/editor/src/components/block-settings-menu/block-convert-button.js similarity index 100% rename from editor/components/block-settings-menu/block-convert-button.js rename to packages/editor/src/components/block-settings-menu/block-convert-button.js diff --git a/editor/components/block-settings-menu/block-duplicate-button.js b/packages/editor/src/components/block-settings-menu/block-duplicate-button.js similarity index 100% rename from editor/components/block-settings-menu/block-duplicate-button.js rename to packages/editor/src/components/block-settings-menu/block-duplicate-button.js diff --git a/editor/components/block-settings-menu/block-html-convert-button.js b/packages/editor/src/components/block-settings-menu/block-html-convert-button.js similarity index 100% rename from editor/components/block-settings-menu/block-html-convert-button.js rename to packages/editor/src/components/block-settings-menu/block-html-convert-button.js diff --git a/editor/components/block-settings-menu/block-mode-toggle.js b/packages/editor/src/components/block-settings-menu/block-mode-toggle.js similarity index 100% rename from editor/components/block-settings-menu/block-mode-toggle.js rename to packages/editor/src/components/block-settings-menu/block-mode-toggle.js diff --git a/editor/components/block-settings-menu/block-remove-button.js b/packages/editor/src/components/block-settings-menu/block-remove-button.js similarity index 100% rename from editor/components/block-settings-menu/block-remove-button.js rename to packages/editor/src/components/block-settings-menu/block-remove-button.js diff --git a/editor/components/block-settings-menu/block-settings-menu-first-item.js b/packages/editor/src/components/block-settings-menu/block-settings-menu-first-item.js similarity index 100% rename from editor/components/block-settings-menu/block-settings-menu-first-item.js rename to packages/editor/src/components/block-settings-menu/block-settings-menu-first-item.js diff --git a/editor/components/block-settings-menu/block-unknown-convert-button.js b/packages/editor/src/components/block-settings-menu/block-unknown-convert-button.js similarity index 100% rename from editor/components/block-settings-menu/block-unknown-convert-button.js rename to packages/editor/src/components/block-settings-menu/block-unknown-convert-button.js diff --git a/editor/components/block-settings-menu/index.js b/packages/editor/src/components/block-settings-menu/index.js similarity index 99% rename from editor/components/block-settings-menu/index.js rename to packages/editor/src/components/block-settings-menu/index.js index 1610cba17f404..06c439ccc524d 100644 --- a/editor/components/block-settings-menu/index.js +++ b/packages/editor/src/components/block-settings-menu/index.js @@ -16,7 +16,6 @@ import { compose } from '@wordpress/compose'; /** * Internal dependencies */ -import './style.scss'; import BlockModeToggle from './block-mode-toggle'; import BlockDuplicateButton from './block-duplicate-button'; import BlockRemoveButton from './block-remove-button'; diff --git a/editor/components/block-settings-menu/reusable-block-convert-button.js b/packages/editor/src/components/block-settings-menu/reusable-block-convert-button.js similarity index 100% rename from editor/components/block-settings-menu/reusable-block-convert-button.js rename to packages/editor/src/components/block-settings-menu/reusable-block-convert-button.js diff --git a/editor/components/block-settings-menu/reusable-block-delete-button.js b/packages/editor/src/components/block-settings-menu/reusable-block-delete-button.js similarity index 100% rename from editor/components/block-settings-menu/reusable-block-delete-button.js rename to packages/editor/src/components/block-settings-menu/reusable-block-delete-button.js diff --git a/editor/components/block-settings-menu/style.scss b/packages/editor/src/components/block-settings-menu/style.scss similarity index 100% rename from editor/components/block-settings-menu/style.scss rename to packages/editor/src/components/block-settings-menu/style.scss diff --git a/editor/components/block-settings-menu/test/__snapshots__/block-remove-button.js.snap b/packages/editor/src/components/block-settings-menu/test/__snapshots__/block-remove-button.js.snap similarity index 100% rename from editor/components/block-settings-menu/test/__snapshots__/block-remove-button.js.snap rename to packages/editor/src/components/block-settings-menu/test/__snapshots__/block-remove-button.js.snap diff --git a/editor/components/block-settings-menu/test/__snapshots__/reusable-block-delete-button.js.snap b/packages/editor/src/components/block-settings-menu/test/__snapshots__/reusable-block-delete-button.js.snap similarity index 100% rename from editor/components/block-settings-menu/test/__snapshots__/reusable-block-delete-button.js.snap rename to packages/editor/src/components/block-settings-menu/test/__snapshots__/reusable-block-delete-button.js.snap diff --git a/editor/components/block-settings-menu/test/block-mode-toggle.js b/packages/editor/src/components/block-settings-menu/test/block-mode-toggle.js similarity index 100% rename from editor/components/block-settings-menu/test/block-mode-toggle.js rename to packages/editor/src/components/block-settings-menu/test/block-mode-toggle.js diff --git a/editor/components/block-settings-menu/test/block-remove-button.js b/packages/editor/src/components/block-settings-menu/test/block-remove-button.js similarity index 100% rename from editor/components/block-settings-menu/test/block-remove-button.js rename to packages/editor/src/components/block-settings-menu/test/block-remove-button.js diff --git a/editor/components/block-settings-menu/test/reusable-block-convert-button.js b/packages/editor/src/components/block-settings-menu/test/reusable-block-convert-button.js similarity index 100% rename from editor/components/block-settings-menu/test/reusable-block-convert-button.js rename to packages/editor/src/components/block-settings-menu/test/reusable-block-convert-button.js diff --git a/editor/components/block-settings-menu/test/reusable-block-delete-button.js b/packages/editor/src/components/block-settings-menu/test/reusable-block-delete-button.js similarity index 100% rename from editor/components/block-settings-menu/test/reusable-block-delete-button.js rename to packages/editor/src/components/block-settings-menu/test/reusable-block-delete-button.js diff --git a/editor/components/block-styles/index.js b/packages/editor/src/components/block-styles/index.js similarity index 99% rename from editor/components/block-styles/index.js rename to packages/editor/src/components/block-styles/index.js index 5a89fcd38cf71..4a08722389cb7 100644 --- a/editor/components/block-styles/index.js +++ b/packages/editor/src/components/block-styles/index.js @@ -15,7 +15,6 @@ import { __, sprintf } from '@wordpress/i18n'; /** * Internal dependencies */ -import './style.scss'; import { BlockPreviewContent } from '../block-preview'; /** diff --git a/editor/components/block-styles/style.scss b/packages/editor/src/components/block-styles/style.scss similarity index 100% rename from editor/components/block-styles/style.scss rename to packages/editor/src/components/block-styles/style.scss diff --git a/editor/components/block-styles/test/index.js b/packages/editor/src/components/block-styles/test/index.js similarity index 100% rename from editor/components/block-styles/test/index.js rename to packages/editor/src/components/block-styles/test/index.js diff --git a/editor/components/block-switcher/index.js b/packages/editor/src/components/block-switcher/index.js similarity index 99% rename from editor/components/block-switcher/index.js rename to packages/editor/src/components/block-switcher/index.js index 9c9fc1a4ee3e3..02f417a2f54bd 100644 --- a/editor/components/block-switcher/index.js +++ b/packages/editor/src/components/block-switcher/index.js @@ -17,7 +17,6 @@ import { compose } from '@wordpress/compose'; /** * Internal dependencies */ -import './style.scss'; import BlockIcon from '../block-icon'; import BlockStyles from '../block-styles'; import BlockPreview from '../block-preview'; diff --git a/editor/components/block-switcher/multi-blocks-switcher.js b/packages/editor/src/components/block-switcher/multi-blocks-switcher.js similarity index 96% rename from editor/components/block-switcher/multi-blocks-switcher.js rename to packages/editor/src/components/block-switcher/multi-blocks-switcher.js index eeb9da3a39b82..25d9e8c339e7a 100644 --- a/editor/components/block-switcher/multi-blocks-switcher.js +++ b/packages/editor/src/components/block-switcher/multi-blocks-switcher.js @@ -6,7 +6,6 @@ import { withSelect } from '@wordpress/data'; /** * Internal dependencies */ -import './style.scss'; import BlockSwitcher from './'; export function MultiBlocksSwitcher( { isMultiBlockSelection, selectedBlockClientIds } ) { diff --git a/editor/components/block-switcher/style.scss b/packages/editor/src/components/block-switcher/style.scss similarity index 100% rename from editor/components/block-switcher/style.scss rename to packages/editor/src/components/block-switcher/style.scss diff --git a/editor/components/block-switcher/test/__snapshots__/index.js.snap b/packages/editor/src/components/block-switcher/test/__snapshots__/index.js.snap similarity index 100% rename from editor/components/block-switcher/test/__snapshots__/index.js.snap rename to packages/editor/src/components/block-switcher/test/__snapshots__/index.js.snap diff --git a/editor/components/block-switcher/test/__snapshots__/multi-blocks-switcher.js.snap b/packages/editor/src/components/block-switcher/test/__snapshots__/multi-blocks-switcher.js.snap similarity index 100% rename from editor/components/block-switcher/test/__snapshots__/multi-blocks-switcher.js.snap rename to packages/editor/src/components/block-switcher/test/__snapshots__/multi-blocks-switcher.js.snap diff --git a/editor/components/block-switcher/test/index.js b/packages/editor/src/components/block-switcher/test/index.js similarity index 81% rename from editor/components/block-switcher/test/index.js rename to packages/editor/src/components/block-switcher/test/index.js index fc1487b948a3d..1d9734a0852c1 100644 --- a/editor/components/block-switcher/test/index.js +++ b/packages/editor/src/components/block-switcher/test/index.js @@ -6,7 +6,7 @@ import { shallow } from 'enzyme'; /** * WordPress dependencies */ -import { registerCoreBlocks } from '@wordpress/core-blocks'; +import { registerBlockType, unregisterBlockType } from '@wordpress/blocks'; import { DOWN } from '@wordpress/keycodes'; /** @@ -31,7 +31,7 @@ describe( 'BlockSwitcher', () => { content: [ 'I am great!' ], }, isValid: true, - name: 'core/text', + name: 'core/paragraph', originalContent: '

I am great!

', clientId: 'b1303fdb-3e60-43faf-a770-2e1ea656c5b8', }; @@ -42,13 +42,44 @@ describe( 'BlockSwitcher', () => { level: 3, }, isValid: true, - name: 'core/text', + name: 'core/paragraph', originalContent: '

I am the greatest!

', clientId: 'c2403fd2-4e63-5ffa-b71c-1e0ea656c5b0', }; beforeAll( () => { - registerCoreBlocks(); + registerBlockType( 'core/heading', { + category: 'common', + title: 'Heading', + edit: () => { }, + save: () => {}, + transforms: { + to: [ { + type: 'block', + blocks: [ 'core/paragraph' ], + transform: () => {}, + } ], + }, + } ); + + registerBlockType( 'core/paragraph', { + category: 'common', + title: 'Paragraph', + edit: () => { }, + save: () => {}, + transforms: { + to: [ { + type: 'block', + blocks: [ 'core/heading' ], + transform: () => {}, + } ], + }, + } ); + } ); + + afterAll( () => { + unregisterBlockType( 'core/heading' ); + unregisterBlockType( 'core/paragraph' ); } ); test( 'should not render block switcher without blocks', () => { @@ -137,7 +168,7 @@ describe( 'BlockSwitcher', () => { const onCloseStub = jest.fn(); const content = shallow(
{ getDropdown().props().renderContent( { onClose: onCloseStub } ) }
); const blockList = content.find( 'BlockTypesList' ); - expect( blockList.prop( 'items' ) ).toHaveLength( 3 ); + expect( blockList.prop( 'items' ) ).toHaveLength( 1 ); } ); } ); } ); diff --git a/editor/components/block-switcher/test/multi-blocks-switcher.js b/packages/editor/src/components/block-switcher/test/multi-blocks-switcher.js similarity index 100% rename from editor/components/block-switcher/test/multi-blocks-switcher.js rename to packages/editor/src/components/block-switcher/test/multi-blocks-switcher.js diff --git a/editor/components/block-title/README.md b/packages/editor/src/components/block-title/README.md similarity index 100% rename from editor/components/block-title/README.md rename to packages/editor/src/components/block-title/README.md diff --git a/editor/components/block-title/index.js b/packages/editor/src/components/block-title/index.js similarity index 100% rename from editor/components/block-title/index.js rename to packages/editor/src/components/block-title/index.js diff --git a/editor/components/block-title/test/index.js b/packages/editor/src/components/block-title/test/index.js similarity index 100% rename from editor/components/block-title/test/index.js rename to packages/editor/src/components/block-title/test/index.js diff --git a/editor/components/block-toolbar/index.js b/packages/editor/src/components/block-toolbar/index.js similarity index 98% rename from editor/components/block-toolbar/index.js rename to packages/editor/src/components/block-toolbar/index.js index 8d573ccdc3336..6b6cdb84431dd 100644 --- a/editor/components/block-toolbar/index.js +++ b/packages/editor/src/components/block-toolbar/index.js @@ -6,7 +6,6 @@ import { withSelect } from '@wordpress/data'; /** * Internal Dependencies */ -import './style.scss'; import BlockSwitcher from '../block-switcher'; import MultiBlocksSwitcher from '../block-switcher/multi-blocks-switcher'; import BlockControls from '../block-controls'; diff --git a/editor/components/block-toolbar/style.scss b/packages/editor/src/components/block-toolbar/style.scss similarity index 100% rename from editor/components/block-toolbar/style.scss rename to packages/editor/src/components/block-toolbar/style.scss diff --git a/editor/components/block-types-list/index.js b/packages/editor/src/components/block-types-list/index.js similarity index 99% rename from editor/components/block-types-list/index.js rename to packages/editor/src/components/block-types-list/index.js index 3b8bf02e9c770..71738b9b6e758 100644 --- a/editor/components/block-types-list/index.js +++ b/packages/editor/src/components/block-types-list/index.js @@ -13,7 +13,6 @@ import { getBlockMenuDefaultClassName } from '@wordpress/blocks'; /** * Internal dependencies */ -import './style.scss'; import BlockIcon from '../block-icon'; class BlockTypesList extends Component { diff --git a/editor/components/block-types-list/style.scss b/packages/editor/src/components/block-types-list/style.scss similarity index 100% rename from editor/components/block-types-list/style.scss rename to packages/editor/src/components/block-types-list/style.scss diff --git a/editor/components/color-palette/control.js b/packages/editor/src/components/color-palette/control.js similarity index 98% rename from editor/components/color-palette/control.js rename to packages/editor/src/components/color-palette/control.js index a7755eec4d25e..95002f5268334 100644 --- a/editor/components/color-palette/control.js +++ b/packages/editor/src/components/color-palette/control.js @@ -8,7 +8,6 @@ import { sprintf, __ } from '@wordpress/i18n'; /** * Internal dependencies */ -import './control.scss'; import ColorPalette from './'; import withColorContext from './with-color-context'; import { getColorName } from '../colors'; diff --git a/editor/components/color-palette/control.scss b/packages/editor/src/components/color-palette/control.scss similarity index 100% rename from editor/components/color-palette/control.scss rename to packages/editor/src/components/color-palette/control.scss diff --git a/editor/components/color-palette/index.js b/packages/editor/src/components/color-palette/index.js similarity index 100% rename from editor/components/color-palette/index.js rename to packages/editor/src/components/color-palette/index.js diff --git a/editor/components/color-palette/test/__snapshots__/control.js.snap b/packages/editor/src/components/color-palette/test/__snapshots__/control.js.snap similarity index 100% rename from editor/components/color-palette/test/__snapshots__/control.js.snap rename to packages/editor/src/components/color-palette/test/__snapshots__/control.js.snap diff --git a/editor/components/color-palette/test/control.js b/packages/editor/src/components/color-palette/test/control.js similarity index 100% rename from editor/components/color-palette/test/control.js rename to packages/editor/src/components/color-palette/test/control.js diff --git a/editor/components/color-palette/with-color-context.js b/packages/editor/src/components/color-palette/with-color-context.js similarity index 100% rename from editor/components/color-palette/with-color-context.js rename to packages/editor/src/components/color-palette/with-color-context.js diff --git a/editor/components/colors/index.js b/packages/editor/src/components/colors/index.js similarity index 100% rename from editor/components/colors/index.js rename to packages/editor/src/components/colors/index.js diff --git a/editor/components/colors/utils.js b/packages/editor/src/components/colors/utils.js similarity index 100% rename from editor/components/colors/utils.js rename to packages/editor/src/components/colors/utils.js diff --git a/packages/editor/src/components/colors/with-colors-deprecated.js b/packages/editor/src/components/colors/with-colors-deprecated.js new file mode 100644 index 0000000000000..83944442445e3 --- /dev/null +++ b/packages/editor/src/components/colors/with-colors-deprecated.js @@ -0,0 +1,92 @@ +/** + * External dependencies + */ +import memoize from 'memize'; +import { get } from 'lodash'; + +/** + * WordPress dependencies + */ +import { Component } from '@wordpress/element'; +import { withSelect } from '@wordpress/data'; +import { compose, createHigherOrderComponent } from '@wordpress/compose'; + +/** + * Internal dependencies + */ +import { getColorValue, getColorClass, setColorValue } from './utils'; + +const DEFAULT_COLORS = []; + +/** + * Higher-order component, which handles color logic for class generation + * color value, retrieval and color attribute setting. + * + * @param {Function} mapGetSetColorToProps Function that receives getColor, setColor, and props, + * and returns additional props to pass to the component. + * + * @return {Function} Higher-order component. + */ +export default ( mapGetSetColorToProps ) => createHigherOrderComponent( + compose( [ + withSelect( + ( select ) => { + const settings = select( 'core/editor' ).getEditorSettings(); + return { + colors: get( settings, [ 'colors' ], DEFAULT_COLORS ), + }; + } ), + ( WrappedComponent ) => { + return class extends Component { + constructor() { + super( ...arguments ); + /** + * Even though we don't expect setAttributes or colors to change memoizing it is essential. + * If setAttributes or colors are not memoized, each time memoizedGetColor/memoizedSetColor are called: + * a new function reference is returned (even if arguments have not changed). + * This would make our memoized chain useless. + */ + this.memoizedGetColor = memoize( this.memoizedGetColor, { maxSize: 1 } ); + this.memoizedSetColor = memoize( this.memoizedSetColor, { maxSize: 1 } ); + } + + memoizedGetColor( colors ) { + return memoize( + ( colorName, customColorValue, colorContext ) => { + return { + name: colorName, + class: getColorClass( colorContext, colorName ), + value: getColorValue( colors, colorName, customColorValue ), + }; + } + ); + } + + memoizedSetColor( setAttributes, colors ) { + return memoize( + ( colorNameAttribute, customColorAttribute ) => { + return setColorValue( colors, colorNameAttribute, customColorAttribute, setAttributes ); + } + ); + } + + render() { + return ( + + ); + } + }; + }, + ] ), + 'withColors' +); diff --git a/editor/components/colors/with-colors.js b/packages/editor/src/components/colors/with-colors.js similarity index 100% rename from editor/components/colors/with-colors.js rename to packages/editor/src/components/colors/with-colors.js diff --git a/editor/components/contrast-checker/index.js b/packages/editor/src/components/contrast-checker/index.js similarity index 96% rename from editor/components/contrast-checker/index.js rename to packages/editor/src/components/contrast-checker/index.js index ab051c7e86ae9..36cc0617e65fc 100644 --- a/editor/components/contrast-checker/index.js +++ b/packages/editor/src/components/contrast-checker/index.js @@ -9,11 +9,6 @@ import tinycolor from 'tinycolor2'; import { __ } from '@wordpress/i18n'; import { Notice } from '@wordpress/components'; -/** - * Internal dependencies - */ -import './style.scss'; - function ContrastChecker( { backgroundColor, fallbackBackgroundColor, diff --git a/editor/components/contrast-checker/style.scss b/packages/editor/src/components/contrast-checker/style.scss similarity index 100% rename from editor/components/contrast-checker/style.scss rename to packages/editor/src/components/contrast-checker/style.scss diff --git a/editor/components/contrast-checker/test/__snapshots__/index.js.snap b/packages/editor/src/components/contrast-checker/test/__snapshots__/index.js.snap similarity index 100% rename from editor/components/contrast-checker/test/__snapshots__/index.js.snap rename to packages/editor/src/components/contrast-checker/test/__snapshots__/index.js.snap diff --git a/editor/components/contrast-checker/test/index.js b/packages/editor/src/components/contrast-checker/test/index.js similarity index 100% rename from editor/components/contrast-checker/test/index.js rename to packages/editor/src/components/contrast-checker/test/index.js diff --git a/editor/components/copy-handler/index.js b/packages/editor/src/components/copy-handler/index.js similarity index 100% rename from editor/components/copy-handler/index.js rename to packages/editor/src/components/copy-handler/index.js diff --git a/editor/components/default-block-appender/index.js b/packages/editor/src/components/default-block-appender/index.js similarity index 99% rename from editor/components/default-block-appender/index.js rename to packages/editor/src/components/default-block-appender/index.js index 415c089b90962..e0eb031c72a3b 100644 --- a/editor/components/default-block-appender/index.js +++ b/packages/editor/src/components/default-block-appender/index.js @@ -17,7 +17,6 @@ import { DotTip } from '@wordpress/nux'; /** * Internal dependencies */ -import './style.scss'; import BlockDropZone from '../block-drop-zone'; import InserterWithShortcuts from '../inserter-with-shortcuts'; import Inserter from '../inserter'; diff --git a/editor/components/default-block-appender/style.scss b/packages/editor/src/components/default-block-appender/style.scss similarity index 100% rename from editor/components/default-block-appender/style.scss rename to packages/editor/src/components/default-block-appender/style.scss diff --git a/editor/components/default-block-appender/test/__snapshots__/index.js.snap b/packages/editor/src/components/default-block-appender/test/__snapshots__/index.js.snap similarity index 100% rename from editor/components/default-block-appender/test/__snapshots__/index.js.snap rename to packages/editor/src/components/default-block-appender/test/__snapshots__/index.js.snap diff --git a/editor/components/default-block-appender/test/index.js b/packages/editor/src/components/default-block-appender/test/index.js similarity index 100% rename from editor/components/default-block-appender/test/index.js rename to packages/editor/src/components/default-block-appender/test/index.js diff --git a/editor/components/document-outline/check.js b/packages/editor/src/components/document-outline/check.js similarity index 100% rename from editor/components/document-outline/check.js rename to packages/editor/src/components/document-outline/check.js diff --git a/editor/components/document-outline/index.js b/packages/editor/src/components/document-outline/index.js similarity index 99% rename from editor/components/document-outline/index.js rename to packages/editor/src/components/document-outline/index.js index 763fbb337e61c..c741bf0928bd0 100644 --- a/editor/components/document-outline/index.js +++ b/packages/editor/src/components/document-outline/index.js @@ -13,7 +13,6 @@ import { withSelect, withDispatch } from '@wordpress/data'; /** * Internal dependencies */ -import './style.scss'; import DocumentOutlineItem from './item'; import RichText from './../rich-text'; diff --git a/editor/components/document-outline/item.js b/packages/editor/src/components/document-outline/item.js similarity index 100% rename from editor/components/document-outline/item.js rename to packages/editor/src/components/document-outline/item.js diff --git a/editor/components/document-outline/style.scss b/packages/editor/src/components/document-outline/style.scss similarity index 100% rename from editor/components/document-outline/style.scss rename to packages/editor/src/components/document-outline/style.scss diff --git a/editor/components/document-outline/test/__snapshots__/index.js.snap b/packages/editor/src/components/document-outline/test/__snapshots__/index.js.snap similarity index 100% rename from editor/components/document-outline/test/__snapshots__/index.js.snap rename to packages/editor/src/components/document-outline/test/__snapshots__/index.js.snap diff --git a/editor/components/document-outline/test/index.js b/packages/editor/src/components/document-outline/test/index.js similarity index 72% rename from editor/components/document-outline/test/index.js rename to packages/editor/src/components/document-outline/test/index.js index 1dd6222612830..a3fe67f9eab94 100644 --- a/editor/components/document-outline/test/index.js +++ b/packages/editor/src/components/document-outline/test/index.js @@ -6,8 +6,7 @@ import { mount, shallow } from 'enzyme'; /** * WordPress dependencies */ -import { createBlock } from '@wordpress/blocks'; -import { registerCoreBlocks } from '@wordpress/core-blocks'; +import { createBlock, registerBlockType, unregisterBlockType } from '@wordpress/blocks'; /** * Internal dependencies @@ -17,23 +16,59 @@ import { DocumentOutline } from '../'; jest.mock( '../../block-title', () => () => 'Block Title' ); describe( 'DocumentOutline', () => { - registerCoreBlocks(); + let paragraph, headingH1, headingParent, headingChild, nestedHeading; + beforeAll( () => { + registerBlockType( 'core/heading', { + category: 'common', + title: 'Heading', + edit: () => { }, + save: () => { }, + attributes: { + level: { + type: 'number', + default: 2, + }, + content: { + type: 'string', + }, + }, + } ); - const paragraph = createBlock( 'core/paragraph' ); - const headingH1 = createBlock( 'core/heading', { - content: 'Heading 1', - level: 1, - } ); - const headingParent = createBlock( 'core/heading', { - content: 'Heading parent', - level: 2, - } ); - const headingChild = createBlock( 'core/heading', { - content: 'Heading child', - level: 3, + registerBlockType( 'core/paragraph', { + category: 'common', + title: 'Paragraph', + edit: () => { }, + save: () => {}, + } ); + + registerBlockType( 'core/columns', { + category: 'common', + title: 'Paragraph', + edit: () => { }, + save: () => {}, + } ); + + paragraph = createBlock( 'core/paragraph' ); + headingH1 = createBlock( 'core/heading', { + content: 'Heading 1', + level: 1, + } ); + headingParent = createBlock( 'core/heading', { + content: 'Heading parent', + level: 2, + } ); + headingChild = createBlock( 'core/heading', { + content: 'Heading child', + level: 3, + } ); + + nestedHeading = createBlock( 'core/columns', undefined, [ headingChild ] ); } ); - const nestedHeading = createBlock( 'core/columns', undefined, [ headingChild ] ); + afterAll( () => { + unregisterBlockType( 'core/heading' ); + unregisterBlockType( 'core/paragraph' ); + } ); describe( 'no header blocks present', () => { it( 'should not render when no blocks provided', () => { diff --git a/editor/components/document-title/index.js b/packages/editor/src/components/document-title/index.js similarity index 91% rename from editor/components/document-title/index.js rename to packages/editor/src/components/document-title/index.js index 1f4934060773b..f61328ab3f88b 100644 --- a/editor/components/document-title/index.js +++ b/packages/editor/src/components/document-title/index.js @@ -1,11 +1,7 @@ -/** - * External dependencies - */ -import { Component } from 'react'; - /** * WordPress dependencies */ +import { Component } from '@wordpress/element'; import { withSelect } from '@wordpress/data'; class DocumentTitle extends Component { diff --git a/editor/components/editor-global-keyboard-shortcuts/index.js b/packages/editor/src/components/editor-global-keyboard-shortcuts/index.js similarity index 100% rename from editor/components/editor-global-keyboard-shortcuts/index.js rename to packages/editor/src/components/editor-global-keyboard-shortcuts/index.js diff --git a/editor/components/editor-history/redo.js b/packages/editor/src/components/editor-history/redo.js similarity index 100% rename from editor/components/editor-history/redo.js rename to packages/editor/src/components/editor-history/redo.js diff --git a/editor/components/editor-history/undo.js b/packages/editor/src/components/editor-history/undo.js similarity index 100% rename from editor/components/editor-history/undo.js rename to packages/editor/src/components/editor-history/undo.js diff --git a/editor/components/editor-notices/index.js b/packages/editor/src/components/editor-notices/index.js similarity index 100% rename from editor/components/editor-notices/index.js rename to packages/editor/src/components/editor-notices/index.js diff --git a/editor/components/error-boundary/index.js b/packages/editor/src/components/error-boundary/index.js similarity index 100% rename from editor/components/error-boundary/index.js rename to packages/editor/src/components/error-boundary/index.js diff --git a/editor/components/index.js b/packages/editor/src/components/index.js similarity index 100% rename from editor/components/index.js rename to packages/editor/src/components/index.js diff --git a/editor/components/index.native.js b/packages/editor/src/components/index.native.js similarity index 100% rename from editor/components/index.native.js rename to packages/editor/src/components/index.native.js diff --git a/editor/components/inner-blocks/README.md b/packages/editor/src/components/inner-blocks/README.md similarity index 100% rename from editor/components/inner-blocks/README.md rename to packages/editor/src/components/inner-blocks/README.md diff --git a/editor/components/inner-blocks/index.js b/packages/editor/src/components/inner-blocks/index.js similarity index 99% rename from editor/components/inner-blocks/index.js rename to packages/editor/src/components/inner-blocks/index.js index 39e7d1ba9bd8e..ef0ff90942aef 100644 --- a/editor/components/inner-blocks/index.js +++ b/packages/editor/src/components/inner-blocks/index.js @@ -18,7 +18,6 @@ import { compose } from '@wordpress/compose'; /** * Internal dependencies */ -import './style.scss'; import BlockList from '../block-list'; import { withBlockEditContext } from '../block-edit/context'; diff --git a/editor/components/inner-blocks/style.scss b/packages/editor/src/components/inner-blocks/style.scss similarity index 100% rename from editor/components/inner-blocks/style.scss rename to packages/editor/src/components/inner-blocks/style.scss diff --git a/editor/components/inner-blocks/test/__snapshots__/index.js.snap b/packages/editor/src/components/inner-blocks/test/__snapshots__/index.js.snap similarity index 100% rename from editor/components/inner-blocks/test/__snapshots__/index.js.snap rename to packages/editor/src/components/inner-blocks/test/__snapshots__/index.js.snap diff --git a/editor/components/inner-blocks/test/index.js b/packages/editor/src/components/inner-blocks/test/index.js similarity index 100% rename from editor/components/inner-blocks/test/index.js rename to packages/editor/src/components/inner-blocks/test/index.js diff --git a/editor/components/inserter-with-shortcuts/index.js b/packages/editor/src/components/inserter-with-shortcuts/index.js similarity index 98% rename from editor/components/inserter-with-shortcuts/index.js rename to packages/editor/src/components/inserter-with-shortcuts/index.js index 5c99672d39751..2082eadffaaf5 100644 --- a/editor/components/inserter-with-shortcuts/index.js +++ b/packages/editor/src/components/inserter-with-shortcuts/index.js @@ -16,7 +16,6 @@ import { withDispatch, withSelect } from '@wordpress/data'; * Internal dependencies */ import BlockIcon from '../block-icon'; -import './style.scss'; function InserterWithShortcuts( { items, isLocked, onInsert } ) { if ( isLocked ) { diff --git a/editor/components/inserter-with-shortcuts/style.scss b/packages/editor/src/components/inserter-with-shortcuts/style.scss similarity index 100% rename from editor/components/inserter-with-shortcuts/style.scss rename to packages/editor/src/components/inserter-with-shortcuts/style.scss diff --git a/editor/components/inserter/child-blocks.js b/packages/editor/src/components/inserter/child-blocks.js similarity index 98% rename from editor/components/inserter/child-blocks.js rename to packages/editor/src/components/inserter/child-blocks.js index 4496144a83b99..312e2cc69ebe9 100644 --- a/editor/components/inserter/child-blocks.js +++ b/packages/editor/src/components/inserter/child-blocks.js @@ -7,7 +7,6 @@ import { ifCondition, compose } from '@wordpress/compose'; /** * Internal dependencies */ -import './style.scss'; import BlockTypesList from '../block-types-list'; import BlockIcon from '../block-icon'; diff --git a/editor/components/inserter/index.js b/packages/editor/src/components/inserter/index.js similarity index 100% rename from editor/components/inserter/index.js rename to packages/editor/src/components/inserter/index.js diff --git a/editor/components/inserter/menu.js b/packages/editor/src/components/inserter/menu.js similarity index 99% rename from editor/components/inserter/menu.js rename to packages/editor/src/components/inserter/menu.js index d132dd3f8fecf..9ac2018e15ec2 100644 --- a/editor/components/inserter/menu.js +++ b/packages/editor/src/components/inserter/menu.js @@ -32,7 +32,6 @@ import { withInstanceId, compose, withSafeTimeout } from '@wordpress/compose'; /** * Internal dependencies */ -import './style.scss'; import BlockPreview from '../block-preview'; import BlockTypesList from '../block-types-list'; import ChildBlocks from './child-blocks'; diff --git a/editor/components/inserter/results-portal.js b/packages/editor/src/components/inserter/results-portal.js similarity index 100% rename from editor/components/inserter/results-portal.js rename to packages/editor/src/components/inserter/results-portal.js diff --git a/editor/components/inserter/style.scss b/packages/editor/src/components/inserter/style.scss similarity index 100% rename from editor/components/inserter/style.scss rename to packages/editor/src/components/inserter/style.scss diff --git a/editor/components/inserter/test/menu.js b/packages/editor/src/components/inserter/test/menu.js similarity index 100% rename from editor/components/inserter/test/menu.js rename to packages/editor/src/components/inserter/test/menu.js diff --git a/editor/components/inspector-advanced-controls/index.js b/packages/editor/src/components/inspector-advanced-controls/index.js similarity index 100% rename from editor/components/inspector-advanced-controls/index.js rename to packages/editor/src/components/inspector-advanced-controls/index.js diff --git a/editor/components/inspector-controls/index.js b/packages/editor/src/components/inspector-controls/index.js similarity index 100% rename from editor/components/inspector-controls/index.js rename to packages/editor/src/components/inspector-controls/index.js diff --git a/editor/components/media-placeholder/index.js b/packages/editor/src/components/media-placeholder/index.js similarity index 99% rename from editor/components/media-placeholder/index.js rename to packages/editor/src/components/media-placeholder/index.js index 30ecc9c50e263..831280916abc6 100644 --- a/editor/components/media-placeholder/index.js +++ b/packages/editor/src/components/media-placeholder/index.js @@ -20,7 +20,6 @@ import deprecated from '@wordpress/deprecated'; /** * Internal dependencies */ -import './style.scss'; import MediaUpload from '../media-upload'; import { mediaUpload } from '../../utils/'; diff --git a/editor/components/media-placeholder/style.scss b/packages/editor/src/components/media-placeholder/style.scss similarity index 100% rename from editor/components/media-placeholder/style.scss rename to packages/editor/src/components/media-placeholder/style.scss diff --git a/editor/components/media-upload/README.md b/packages/editor/src/components/media-upload/README.md similarity index 100% rename from editor/components/media-upload/README.md rename to packages/editor/src/components/media-upload/README.md diff --git a/editor/components/media-upload/index.js b/packages/editor/src/components/media-upload/index.js similarity index 100% rename from editor/components/media-upload/index.js rename to packages/editor/src/components/media-upload/index.js diff --git a/editor/components/multi-select-scroll-into-view/index.js b/packages/editor/src/components/multi-select-scroll-into-view/index.js similarity index 100% rename from editor/components/multi-select-scroll-into-view/index.js rename to packages/editor/src/components/multi-select-scroll-into-view/index.js diff --git a/editor/components/navigable-toolbar/index.js b/packages/editor/src/components/navigable-toolbar/index.js similarity index 100% rename from editor/components/navigable-toolbar/index.js rename to packages/editor/src/components/navigable-toolbar/index.js diff --git a/editor/components/observe-typing/README.md b/packages/editor/src/components/observe-typing/README.md similarity index 100% rename from editor/components/observe-typing/README.md rename to packages/editor/src/components/observe-typing/README.md diff --git a/editor/components/observe-typing/index.js b/packages/editor/src/components/observe-typing/index.js similarity index 100% rename from editor/components/observe-typing/index.js rename to packages/editor/src/components/observe-typing/index.js diff --git a/editor/components/page-attributes/check.js b/packages/editor/src/components/page-attributes/check.js similarity index 100% rename from editor/components/page-attributes/check.js rename to packages/editor/src/components/page-attributes/check.js diff --git a/editor/components/page-attributes/order.js b/packages/editor/src/components/page-attributes/order.js similarity index 100% rename from editor/components/page-attributes/order.js rename to packages/editor/src/components/page-attributes/order.js diff --git a/editor/components/page-attributes/parent.js b/packages/editor/src/components/page-attributes/parent.js similarity index 100% rename from editor/components/page-attributes/parent.js rename to packages/editor/src/components/page-attributes/parent.js diff --git a/editor/components/page-attributes/style.scss b/packages/editor/src/components/page-attributes/style.scss similarity index 100% rename from editor/components/page-attributes/style.scss rename to packages/editor/src/components/page-attributes/style.scss diff --git a/editor/components/page-attributes/template.js b/packages/editor/src/components/page-attributes/template.js similarity index 96% rename from editor/components/page-attributes/template.js rename to packages/editor/src/components/page-attributes/template.js index c54366a71c183..53ea98b3ba6ef 100644 --- a/editor/components/page-attributes/template.js +++ b/packages/editor/src/components/page-attributes/template.js @@ -10,11 +10,6 @@ import { __ } from '@wordpress/i18n'; import { withInstanceId, compose } from '@wordpress/compose'; import { withSelect, withDispatch } from '@wordpress/data'; -/** - * Internal dependencies - */ -import './style.scss'; - export function PageTemplate( { availableTemplates, selectedTemplate, instanceId, onUpdate } ) { if ( isEmpty( availableTemplates ) ) { return null; diff --git a/editor/components/page-attributes/test/check.js b/packages/editor/src/components/page-attributes/test/check.js similarity index 100% rename from editor/components/page-attributes/test/check.js rename to packages/editor/src/components/page-attributes/test/check.js diff --git a/editor/components/page-attributes/test/order.js b/packages/editor/src/components/page-attributes/test/order.js similarity index 100% rename from editor/components/page-attributes/test/order.js rename to packages/editor/src/components/page-attributes/test/order.js diff --git a/editor/components/panel-color-settings/index.js b/packages/editor/src/components/panel-color-settings/index.js similarity index 98% rename from editor/components/panel-color-settings/index.js rename to packages/editor/src/components/panel-color-settings/index.js index 2cc1fd50a41e6..0e1d04ae9818b 100644 --- a/editor/components/panel-color-settings/index.js +++ b/packages/editor/src/components/panel-color-settings/index.js @@ -13,7 +13,6 @@ import { sprintf, __ } from '@wordpress/i18n'; /** * Internal dependencies */ -import './style.scss'; import ColorPaletteControl from '../color-palette/control'; import withColorContext from '../color-palette/with-color-context'; import { getColorName } from '../colors'; diff --git a/editor/components/panel-color-settings/style.scss b/packages/editor/src/components/panel-color-settings/style.scss similarity index 100% rename from editor/components/panel-color-settings/style.scss rename to packages/editor/src/components/panel-color-settings/style.scss diff --git a/editor/components/panel-color-settings/test/__snapshots__/index.js.snap b/packages/editor/src/components/panel-color-settings/test/__snapshots__/index.js.snap similarity index 100% rename from editor/components/panel-color-settings/test/__snapshots__/index.js.snap rename to packages/editor/src/components/panel-color-settings/test/__snapshots__/index.js.snap diff --git a/editor/components/panel-color-settings/test/index.js b/packages/editor/src/components/panel-color-settings/test/index.js similarity index 100% rename from editor/components/panel-color-settings/test/index.js rename to packages/editor/src/components/panel-color-settings/test/index.js diff --git a/editor/components/panel-color/index.js b/packages/editor/src/components/panel-color/index.js similarity index 100% rename from editor/components/panel-color/index.js rename to packages/editor/src/components/panel-color/index.js diff --git a/editor/components/plain-text/README.md b/packages/editor/src/components/plain-text/README.md similarity index 100% rename from editor/components/plain-text/README.md rename to packages/editor/src/components/plain-text/README.md diff --git a/editor/components/plain-text/index.js b/packages/editor/src/components/plain-text/index.js similarity index 87% rename from editor/components/plain-text/index.js rename to packages/editor/src/components/plain-text/index.js index 13da032771715..57b4f1e5d629a 100644 --- a/editor/components/plain-text/index.js +++ b/packages/editor/src/components/plain-text/index.js @@ -4,11 +4,6 @@ import TextareaAutosize from 'react-autosize-textarea'; import classnames from 'classnames'; -/** - * Internal dependencies - */ -import './style.scss'; - function PlainText( { onChange, className, ...props } ) { return ( diff --git a/editor/components/post-excerpt/style.scss b/packages/editor/src/components/post-excerpt/style.scss similarity index 100% rename from editor/components/post-excerpt/style.scss rename to packages/editor/src/components/post-excerpt/style.scss diff --git a/editor/components/post-featured-image/README.md b/packages/editor/src/components/post-featured-image/README.md similarity index 100% rename from editor/components/post-featured-image/README.md rename to packages/editor/src/components/post-featured-image/README.md diff --git a/editor/components/post-featured-image/check.js b/packages/editor/src/components/post-featured-image/check.js similarity index 100% rename from editor/components/post-featured-image/check.js rename to packages/editor/src/components/post-featured-image/check.js diff --git a/editor/components/post-featured-image/index.js b/packages/editor/src/components/post-featured-image/index.js similarity index 99% rename from editor/components/post-featured-image/index.js rename to packages/editor/src/components/post-featured-image/index.js index 70e984c740c47..849e49ec2d713 100644 --- a/editor/components/post-featured-image/index.js +++ b/packages/editor/src/components/post-featured-image/index.js @@ -15,7 +15,6 @@ import { withSelect, withDispatch } from '@wordpress/data'; /** * Internal dependencies */ -import './style.scss'; import PostFeaturedImageCheck from './check'; import MediaUpload from '../media-upload'; diff --git a/editor/components/post-featured-image/style.scss b/packages/editor/src/components/post-featured-image/style.scss similarity index 100% rename from editor/components/post-featured-image/style.scss rename to packages/editor/src/components/post-featured-image/style.scss diff --git a/editor/components/post-format/check.js b/packages/editor/src/components/post-format/check.js similarity index 100% rename from editor/components/post-format/check.js rename to packages/editor/src/components/post-format/check.js diff --git a/editor/components/post-format/index.js b/packages/editor/src/components/post-format/index.js similarity index 99% rename from editor/components/post-format/index.js rename to packages/editor/src/components/post-format/index.js index 3098523be1c49..baa86daeeb7d1 100644 --- a/editor/components/post-format/index.js +++ b/packages/editor/src/components/post-format/index.js @@ -14,7 +14,6 @@ import { withInstanceId, compose } from '@wordpress/compose'; /** * Internal dependencies */ -import './style.scss'; import PostFormatCheck from './check'; const POST_FORMATS = [ diff --git a/editor/components/post-format/style.scss b/packages/editor/src/components/post-format/style.scss similarity index 100% rename from editor/components/post-format/style.scss rename to packages/editor/src/components/post-format/style.scss diff --git a/editor/components/post-last-revision/check.js b/packages/editor/src/components/post-last-revision/check.js similarity index 100% rename from editor/components/post-last-revision/check.js rename to packages/editor/src/components/post-last-revision/check.js diff --git a/editor/components/post-last-revision/index.js b/packages/editor/src/components/post-last-revision/index.js similarity index 97% rename from editor/components/post-last-revision/index.js rename to packages/editor/src/components/post-last-revision/index.js index bf94c4c794203..03cb53a3583e7 100644 --- a/editor/components/post-last-revision/index.js +++ b/packages/editor/src/components/post-last-revision/index.js @@ -8,7 +8,6 @@ import { withSelect } from '@wordpress/data'; /** * Internal dependencies */ -import './style.scss'; import PostLastRevisionCheck from './check'; import { getWPAdminURL } from '../../utils/url'; diff --git a/editor/components/post-last-revision/style.scss b/packages/editor/src/components/post-last-revision/style.scss similarity index 100% rename from editor/components/post-last-revision/style.scss rename to packages/editor/src/components/post-last-revision/style.scss diff --git a/editor/components/post-last-revision/test/check.js b/packages/editor/src/components/post-last-revision/test/check.js similarity index 100% rename from editor/components/post-last-revision/test/check.js rename to packages/editor/src/components/post-last-revision/test/check.js diff --git a/editor/components/post-pending-status/check.js b/packages/editor/src/components/post-pending-status/check.js similarity index 100% rename from editor/components/post-pending-status/check.js rename to packages/editor/src/components/post-pending-status/check.js diff --git a/editor/components/post-pending-status/index.js b/packages/editor/src/components/post-pending-status/index.js similarity index 100% rename from editor/components/post-pending-status/index.js rename to packages/editor/src/components/post-pending-status/index.js diff --git a/editor/components/post-pending-status/test/check.js b/packages/editor/src/components/post-pending-status/test/check.js similarity index 100% rename from editor/components/post-pending-status/test/check.js rename to packages/editor/src/components/post-pending-status/test/check.js diff --git a/editor/components/post-permalink/editor.js b/packages/editor/src/components/post-permalink/editor.js similarity index 97% rename from editor/components/post-permalink/editor.js rename to packages/editor/src/components/post-permalink/editor.js index 70e1c751fd297..3185fd2abe6ea 100644 --- a/editor/components/post-permalink/editor.js +++ b/packages/editor/src/components/post-permalink/editor.js @@ -7,11 +7,6 @@ import { __ } from '@wordpress/i18n'; import { Button } from '@wordpress/components'; import { compose } from '@wordpress/compose'; -/** - * Internal Dependencies - */ -import './style.scss'; - class PostPermalinkEditor extends Component { constructor( { permalinkParts } ) { super( ...arguments ); diff --git a/editor/components/post-permalink/index.js b/packages/editor/src/components/post-permalink/index.js similarity index 99% rename from editor/components/post-permalink/index.js rename to packages/editor/src/components/post-permalink/index.js index ae389492cf19c..7df95475a0f6f 100644 --- a/editor/components/post-permalink/index.js +++ b/packages/editor/src/components/post-permalink/index.js @@ -15,7 +15,6 @@ import { ClipboardButton, Button, ExternalLink } from '@wordpress/components'; /** * Internal Dependencies */ -import './style.scss'; import PostPermalinkEditor from './editor.js'; import { getWPAdminURL } from '../../utils/url'; diff --git a/editor/components/post-permalink/style.scss b/packages/editor/src/components/post-permalink/style.scss similarity index 100% rename from editor/components/post-permalink/style.scss rename to packages/editor/src/components/post-permalink/style.scss diff --git a/editor/components/post-pingbacks/index.js b/packages/editor/src/components/post-pingbacks/index.js similarity index 100% rename from editor/components/post-pingbacks/index.js rename to packages/editor/src/components/post-pingbacks/index.js diff --git a/editor/components/post-preview-button/index.js b/packages/editor/src/components/post-preview-button/index.js similarity index 100% rename from editor/components/post-preview-button/index.js rename to packages/editor/src/components/post-preview-button/index.js diff --git a/editor/components/post-preview-button/test/__snapshots__/index.js.snap b/packages/editor/src/components/post-preview-button/test/__snapshots__/index.js.snap similarity index 100% rename from editor/components/post-preview-button/test/__snapshots__/index.js.snap rename to packages/editor/src/components/post-preview-button/test/__snapshots__/index.js.snap diff --git a/editor/components/post-preview-button/test/index.js b/packages/editor/src/components/post-preview-button/test/index.js similarity index 98% rename from editor/components/post-preview-button/test/index.js rename to packages/editor/src/components/post-preview-button/test/index.js index e0012dde0734a..7084654785317 100644 --- a/editor/components/post-preview-button/test/index.js +++ b/packages/editor/src/components/post-preview-button/test/index.js @@ -8,7 +8,7 @@ import { shallow } from 'enzyme'; */ import { PostPreviewButton } from '../'; -jest.mock( '../../../../packages/components/src/button' ); +jest.mock( '../../../../../../packages/components/src/button' ); describe( 'PostPreviewButton', () => { describe( 'setPreviewWindowLink()', () => { diff --git a/editor/components/post-publish-button/index.js b/packages/editor/src/components/post-publish-button/index.js similarity index 100% rename from editor/components/post-publish-button/index.js rename to packages/editor/src/components/post-publish-button/index.js diff --git a/editor/components/post-publish-button/label.js b/packages/editor/src/components/post-publish-button/label.js similarity index 100% rename from editor/components/post-publish-button/label.js rename to packages/editor/src/components/post-publish-button/label.js diff --git a/editor/components/post-publish-button/test/index.js b/packages/editor/src/components/post-publish-button/test/index.js similarity index 98% rename from editor/components/post-publish-button/test/index.js rename to packages/editor/src/components/post-publish-button/test/index.js index e44d81c73eb75..d977714ae3be1 100644 --- a/editor/components/post-publish-button/test/index.js +++ b/packages/editor/src/components/post-publish-button/test/index.js @@ -8,7 +8,7 @@ import { shallow } from 'enzyme'; */ import { PostPublishButton } from '../'; -jest.mock( '../../../../packages/components/src/button' ); +jest.mock( '../../../../../../packages/components/src/button' ); describe( 'PostPublishButton', () => { describe( 'disabled', () => { diff --git a/editor/components/post-publish-button/test/label.js b/packages/editor/src/components/post-publish-button/test/label.js similarity index 100% rename from editor/components/post-publish-button/test/label.js rename to packages/editor/src/components/post-publish-button/test/label.js diff --git a/editor/components/post-publish-panel/index.js b/packages/editor/src/components/post-publish-panel/index.js similarity index 99% rename from editor/components/post-publish-panel/index.js rename to packages/editor/src/components/post-publish-panel/index.js index 19c1fb231501a..8ca18bcddcf7d 100644 --- a/editor/components/post-publish-panel/index.js +++ b/packages/editor/src/components/post-publish-panel/index.js @@ -15,7 +15,6 @@ import { compose } from '@wordpress/compose'; /** * Internal Dependencies */ -import './style.scss'; import PostPublishButton from '../post-publish-button'; import PostPublishPanelPrepublish from './prepublish'; import PostPublishPanelPostpublish from './postpublish'; diff --git a/editor/components/post-publish-panel/postpublish.js b/packages/editor/src/components/post-publish-panel/postpublish.js similarity index 100% rename from editor/components/post-publish-panel/postpublish.js rename to packages/editor/src/components/post-publish-panel/postpublish.js diff --git a/editor/components/post-publish-panel/prepublish.js b/packages/editor/src/components/post-publish-panel/prepublish.js similarity index 100% rename from editor/components/post-publish-panel/prepublish.js rename to packages/editor/src/components/post-publish-panel/prepublish.js diff --git a/editor/components/post-publish-panel/style.scss b/packages/editor/src/components/post-publish-panel/style.scss similarity index 100% rename from editor/components/post-publish-panel/style.scss rename to packages/editor/src/components/post-publish-panel/style.scss diff --git a/editor/components/post-publish-panel/test/toggle.js b/packages/editor/src/components/post-publish-panel/test/toggle.js similarity index 100% rename from editor/components/post-publish-panel/test/toggle.js rename to packages/editor/src/components/post-publish-panel/test/toggle.js diff --git a/editor/components/post-publish-panel/toggle.js b/packages/editor/src/components/post-publish-panel/toggle.js similarity index 100% rename from editor/components/post-publish-panel/toggle.js rename to packages/editor/src/components/post-publish-panel/toggle.js diff --git a/editor/components/post-saved-state/index.js b/packages/editor/src/components/post-saved-state/index.js similarity index 99% rename from editor/components/post-saved-state/index.js rename to packages/editor/src/components/post-saved-state/index.js index 4bc8b75ed3ad1..d72c0def526bc 100644 --- a/editor/components/post-saved-state/index.js +++ b/packages/editor/src/components/post-saved-state/index.js @@ -16,7 +16,6 @@ import { withSafeTimeout, compose } from '@wordpress/compose'; /** * Internal dependencies */ -import './style.scss'; import PostSwitchToDraftButton from '../post-switch-to-draft-button'; /** diff --git a/editor/components/post-saved-state/style.scss b/packages/editor/src/components/post-saved-state/style.scss similarity index 100% rename from editor/components/post-saved-state/style.scss rename to packages/editor/src/components/post-saved-state/style.scss diff --git a/editor/components/post-saved-state/test/__snapshots__/index.js.snap b/packages/editor/src/components/post-saved-state/test/__snapshots__/index.js.snap similarity index 100% rename from editor/components/post-saved-state/test/__snapshots__/index.js.snap rename to packages/editor/src/components/post-saved-state/test/__snapshots__/index.js.snap diff --git a/editor/components/post-saved-state/test/index.js b/packages/editor/src/components/post-saved-state/test/index.js similarity index 100% rename from editor/components/post-saved-state/test/index.js rename to packages/editor/src/components/post-saved-state/test/index.js diff --git a/editor/components/post-schedule/check.js b/packages/editor/src/components/post-schedule/check.js similarity index 100% rename from editor/components/post-schedule/check.js rename to packages/editor/src/components/post-schedule/check.js diff --git a/editor/components/post-schedule/index.js b/packages/editor/src/components/post-schedule/index.js similarity index 100% rename from editor/components/post-schedule/index.js rename to packages/editor/src/components/post-schedule/index.js diff --git a/editor/components/post-schedule/label.js b/packages/editor/src/components/post-schedule/label.js similarity index 100% rename from editor/components/post-schedule/label.js rename to packages/editor/src/components/post-schedule/label.js diff --git a/editor/components/post-schedule/test/check.js b/packages/editor/src/components/post-schedule/test/check.js similarity index 100% rename from editor/components/post-schedule/test/check.js rename to packages/editor/src/components/post-schedule/test/check.js diff --git a/editor/components/post-sticky/check.js b/packages/editor/src/components/post-sticky/check.js similarity index 100% rename from editor/components/post-sticky/check.js rename to packages/editor/src/components/post-sticky/check.js diff --git a/editor/components/post-sticky/index.js b/packages/editor/src/components/post-sticky/index.js similarity index 100% rename from editor/components/post-sticky/index.js rename to packages/editor/src/components/post-sticky/index.js diff --git a/editor/components/post-sticky/test/index.js b/packages/editor/src/components/post-sticky/test/index.js similarity index 100% rename from editor/components/post-sticky/test/index.js rename to packages/editor/src/components/post-sticky/test/index.js diff --git a/editor/components/post-switch-to-draft-button/index.js b/packages/editor/src/components/post-switch-to-draft-button/index.js similarity index 100% rename from editor/components/post-switch-to-draft-button/index.js rename to packages/editor/src/components/post-switch-to-draft-button/index.js diff --git a/editor/components/post-taxonomies/check.js b/packages/editor/src/components/post-taxonomies/check.js similarity index 100% rename from editor/components/post-taxonomies/check.js rename to packages/editor/src/components/post-taxonomies/check.js diff --git a/editor/components/post-taxonomies/flat-term-selector.js b/packages/editor/src/components/post-taxonomies/flat-term-selector.js similarity index 100% rename from editor/components/post-taxonomies/flat-term-selector.js rename to packages/editor/src/components/post-taxonomies/flat-term-selector.js diff --git a/editor/components/post-taxonomies/hierarchical-term-selector.js b/packages/editor/src/components/post-taxonomies/hierarchical-term-selector.js similarity index 100% rename from editor/components/post-taxonomies/hierarchical-term-selector.js rename to packages/editor/src/components/post-taxonomies/hierarchical-term-selector.js diff --git a/editor/components/post-taxonomies/index.js b/packages/editor/src/components/post-taxonomies/index.js similarity index 98% rename from editor/components/post-taxonomies/index.js rename to packages/editor/src/components/post-taxonomies/index.js index a5697bc2b3bf4..f3968d6c046a7 100644 --- a/editor/components/post-taxonomies/index.js +++ b/packages/editor/src/components/post-taxonomies/index.js @@ -13,7 +13,6 @@ import { compose } from '@wordpress/compose'; /** * Internal dependencies */ -import './style.scss'; import HierarchicalTermSelector from './hierarchical-term-selector'; import FlatTermSelector from './flat-term-selector'; diff --git a/editor/components/post-taxonomies/style.scss b/packages/editor/src/components/post-taxonomies/style.scss similarity index 100% rename from editor/components/post-taxonomies/style.scss rename to packages/editor/src/components/post-taxonomies/style.scss diff --git a/editor/components/post-taxonomies/test/index.js b/packages/editor/src/components/post-taxonomies/test/index.js similarity index 100% rename from editor/components/post-taxonomies/test/index.js rename to packages/editor/src/components/post-taxonomies/test/index.js diff --git a/editor/components/post-text-editor/index.js b/packages/editor/src/components/post-text-editor/index.js similarity index 98% rename from editor/components/post-text-editor/index.js rename to packages/editor/src/components/post-text-editor/index.js index 4afadeae292ee..5a4121998a60c 100644 --- a/editor/components/post-text-editor/index.js +++ b/packages/editor/src/components/post-text-editor/index.js @@ -13,11 +13,6 @@ import { parse } from '@wordpress/blocks'; import { withSelect, withDispatch } from '@wordpress/data'; import { withInstanceId, compose } from '@wordpress/compose'; -/** - * Internal dependencies - */ -import './style.scss'; - /** * Returns the PostTextEditor state given a set of props. * diff --git a/editor/components/post-text-editor/style.scss b/packages/editor/src/components/post-text-editor/style.scss similarity index 100% rename from editor/components/post-text-editor/style.scss rename to packages/editor/src/components/post-text-editor/style.scss diff --git a/editor/components/post-title/index.js b/packages/editor/src/components/post-title/index.js similarity index 99% rename from editor/components/post-title/index.js rename to packages/editor/src/components/post-title/index.js index 9aabcacd5fafa..af836f6c89de3 100644 --- a/editor/components/post-title/index.js +++ b/packages/editor/src/components/post-title/index.js @@ -19,7 +19,6 @@ import { withInstanceId, compose } from '@wordpress/compose'; /** * Internal dependencies */ -import './style.scss'; import PostPermalink from '../post-permalink'; import PostTypeSupportCheck from '../post-type-support-check'; diff --git a/editor/components/post-title/style.scss b/packages/editor/src/components/post-title/style.scss similarity index 100% rename from editor/components/post-title/style.scss rename to packages/editor/src/components/post-title/style.scss diff --git a/editor/components/post-trash/check.js b/packages/editor/src/components/post-trash/check.js similarity index 100% rename from editor/components/post-trash/check.js rename to packages/editor/src/components/post-trash/check.js diff --git a/editor/components/post-trash/index.js b/packages/editor/src/components/post-trash/index.js similarity index 94% rename from editor/components/post-trash/index.js rename to packages/editor/src/components/post-trash/index.js index e55cba6c5ae88..70567566bd3f6 100644 --- a/editor/components/post-trash/index.js +++ b/packages/editor/src/components/post-trash/index.js @@ -6,11 +6,6 @@ import { Button, Dashicon } from '@wordpress/components'; import { withSelect, withDispatch } from '@wordpress/data'; import { compose } from '@wordpress/compose'; -/** - * Internal dependencies - */ -import './style.scss'; - function PostTrash( { isNew, postId, postType, ...props } ) { if ( isNew || ! postId ) { return null; diff --git a/editor/components/post-trash/style.scss b/packages/editor/src/components/post-trash/style.scss similarity index 100% rename from editor/components/post-trash/style.scss rename to packages/editor/src/components/post-trash/style.scss diff --git a/editor/components/post-type-support-check/README.md b/packages/editor/src/components/post-type-support-check/README.md similarity index 100% rename from editor/components/post-type-support-check/README.md rename to packages/editor/src/components/post-type-support-check/README.md diff --git a/editor/components/post-type-support-check/index.js b/packages/editor/src/components/post-type-support-check/index.js similarity index 100% rename from editor/components/post-type-support-check/index.js rename to packages/editor/src/components/post-type-support-check/index.js diff --git a/editor/components/post-type-support-check/test/index.js b/packages/editor/src/components/post-type-support-check/test/index.js similarity index 100% rename from editor/components/post-type-support-check/test/index.js rename to packages/editor/src/components/post-type-support-check/test/index.js diff --git a/editor/components/post-visibility/check.js b/packages/editor/src/components/post-visibility/check.js similarity index 100% rename from editor/components/post-visibility/check.js rename to packages/editor/src/components/post-visibility/check.js diff --git a/editor/components/post-visibility/index.js b/packages/editor/src/components/post-visibility/index.js similarity index 100% rename from editor/components/post-visibility/index.js rename to packages/editor/src/components/post-visibility/index.js diff --git a/editor/components/post-visibility/label.js b/packages/editor/src/components/post-visibility/label.js similarity index 100% rename from editor/components/post-visibility/label.js rename to packages/editor/src/components/post-visibility/label.js diff --git a/editor/components/post-visibility/test/check.js b/packages/editor/src/components/post-visibility/test/check.js similarity index 100% rename from editor/components/post-visibility/test/check.js rename to packages/editor/src/components/post-visibility/test/check.js diff --git a/editor/components/post-visibility/utils.js b/packages/editor/src/components/post-visibility/utils.js similarity index 100% rename from editor/components/post-visibility/utils.js rename to packages/editor/src/components/post-visibility/utils.js diff --git a/editor/components/preserve-scroll-in-reorder/index.js b/packages/editor/src/components/preserve-scroll-in-reorder/index.js similarity index 100% rename from editor/components/preserve-scroll-in-reorder/index.js rename to packages/editor/src/components/preserve-scroll-in-reorder/index.js diff --git a/editor/components/provider/index.js b/packages/editor/src/components/provider/index.js similarity index 100% rename from editor/components/provider/index.js rename to packages/editor/src/components/provider/index.js diff --git a/editor/components/rich-text/README.md b/packages/editor/src/components/rich-text/README.md similarity index 100% rename from editor/components/rich-text/README.md rename to packages/editor/src/components/rich-text/README.md diff --git a/editor/components/rich-text/aria.js b/packages/editor/src/components/rich-text/aria.js similarity index 100% rename from editor/components/rich-text/aria.js rename to packages/editor/src/components/rich-text/aria.js diff --git a/editor/components/rich-text/core-tokens/image/index.js b/packages/editor/src/components/rich-text/core-tokens/image/index.js similarity index 97% rename from editor/components/rich-text/core-tokens/image/index.js rename to packages/editor/src/components/rich-text/core-tokens/image/index.js index 870a04dfd2708..fbb715a872101 100644 --- a/editor/components/rich-text/core-tokens/image/index.js +++ b/packages/editor/src/components/rich-text/core-tokens/image/index.js @@ -6,7 +6,6 @@ import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ -import './editor.scss'; import MediaUpload from '../../../media-upload'; export const name = 'core/image'; diff --git a/editor/components/rich-text/core-tokens/image/editor.scss b/packages/editor/src/components/rich-text/core-tokens/image/style.scss similarity index 100% rename from editor/components/rich-text/core-tokens/image/editor.scss rename to packages/editor/src/components/rich-text/core-tokens/image/style.scss diff --git a/editor/components/rich-text/core-tokens/index.js b/packages/editor/src/components/rich-text/core-tokens/index.js similarity index 100% rename from editor/components/rich-text/core-tokens/index.js rename to packages/editor/src/components/rich-text/core-tokens/index.js diff --git a/editor/components/rich-text/format-toolbar/index.js b/packages/editor/src/components/rich-text/format-toolbar/index.js similarity index 99% rename from editor/components/rich-text/format-toolbar/index.js rename to packages/editor/src/components/rich-text/format-toolbar/index.js index 0f4825c9579a9..f588f18a30919 100644 --- a/editor/components/rich-text/format-toolbar/index.js +++ b/packages/editor/src/components/rich-text/format-toolbar/index.js @@ -18,7 +18,6 @@ import { prependHTTP } from '@wordpress/url'; /** * Internal dependencies */ -import './style.scss'; import PositionedAtSelection from './positioned-at-selection'; import URLInput from '../../url-input'; import { filterURLForDisplay } from '../../../utils/url'; diff --git a/editor/components/rich-text/format-toolbar/positioned-at-selection.js b/packages/editor/src/components/rich-text/format-toolbar/positioned-at-selection.js similarity index 100% rename from editor/components/rich-text/format-toolbar/positioned-at-selection.js rename to packages/editor/src/components/rich-text/format-toolbar/positioned-at-selection.js diff --git a/editor/components/rich-text/format-toolbar/style.scss b/packages/editor/src/components/rich-text/format-toolbar/style.scss similarity index 100% rename from editor/components/rich-text/format-toolbar/style.scss rename to packages/editor/src/components/rich-text/format-toolbar/style.scss diff --git a/editor/components/rich-text/format.js b/packages/editor/src/components/rich-text/format.js similarity index 100% rename from editor/components/rich-text/format.js rename to packages/editor/src/components/rich-text/format.js diff --git a/editor/components/rich-text/index.js b/packages/editor/src/components/rich-text/index.js similarity index 99% rename from editor/components/rich-text/index.js rename to packages/editor/src/components/rich-text/index.js index 2a65137ef3d04..06d954e775615 100644 --- a/editor/components/rich-text/index.js +++ b/packages/editor/src/components/rich-text/index.js @@ -33,7 +33,6 @@ import { withInstanceId, withSafeTimeout, compose } from '@wordpress/compose'; /** * Internal dependencies */ -import './style.scss'; import Autocomplete from '../autocomplete'; import BlockFormatControls from '../block-format-controls'; import FormatToolbar from './format-toolbar'; diff --git a/editor/components/rich-text/patterns.js b/packages/editor/src/components/rich-text/patterns.js similarity index 100% rename from editor/components/rich-text/patterns.js rename to packages/editor/src/components/rich-text/patterns.js diff --git a/editor/components/rich-text/provider.js b/packages/editor/src/components/rich-text/provider.js similarity index 100% rename from editor/components/rich-text/provider.js rename to packages/editor/src/components/rich-text/provider.js diff --git a/editor/components/rich-text/style.scss b/packages/editor/src/components/rich-text/style.scss similarity index 100% rename from editor/components/rich-text/style.scss rename to packages/editor/src/components/rich-text/style.scss diff --git a/editor/components/rich-text/test/__snapshots__/format.js.snap b/packages/editor/src/components/rich-text/test/__snapshots__/format.js.snap similarity index 100% rename from editor/components/rich-text/test/__snapshots__/format.js.snap rename to packages/editor/src/components/rich-text/test/__snapshots__/format.js.snap diff --git a/editor/components/rich-text/test/format.js b/packages/editor/src/components/rich-text/test/format.js similarity index 100% rename from editor/components/rich-text/test/format.js rename to packages/editor/src/components/rich-text/test/format.js diff --git a/editor/components/rich-text/test/index.js b/packages/editor/src/components/rich-text/test/index.js similarity index 100% rename from editor/components/rich-text/test/index.js rename to packages/editor/src/components/rich-text/test/index.js diff --git a/editor/components/rich-text/tinymce.js b/packages/editor/src/components/rich-text/tinymce.js similarity index 100% rename from editor/components/rich-text/tinymce.js rename to packages/editor/src/components/rich-text/tinymce.js diff --git a/editor/components/rich-text/tokens/index.js b/packages/editor/src/components/rich-text/tokens/index.js similarity index 100% rename from editor/components/rich-text/tokens/index.js rename to packages/editor/src/components/rich-text/tokens/index.js diff --git a/editor/components/rich-text/tokens/ui/index.js b/packages/editor/src/components/rich-text/tokens/ui/index.js similarity index 98% rename from editor/components/rich-text/tokens/ui/index.js rename to packages/editor/src/components/rich-text/tokens/ui/index.js index 0d0be6eb0fe4b..db14ce01664fa 100644 --- a/editor/components/rich-text/tokens/ui/index.js +++ b/packages/editor/src/components/rich-text/tokens/ui/index.js @@ -9,7 +9,6 @@ import { withSelect } from '@wordpress/data'; /** * Internal dependencies */ -import './style.scss'; import { InserterResultsPortal } from '../../../inserter'; class TokenUI extends Component { diff --git a/editor/components/rich-text/tokens/ui/style.scss b/packages/editor/src/components/rich-text/tokens/ui/style.scss similarity index 100% rename from editor/components/rich-text/tokens/ui/style.scss rename to packages/editor/src/components/rich-text/tokens/ui/style.scss diff --git a/editor/components/skip-to-selected-block/index.js b/packages/editor/src/components/skip-to-selected-block/index.js similarity index 97% rename from editor/components/skip-to-selected-block/index.js rename to packages/editor/src/components/skip-to-selected-block/index.js index cd29f73248b3f..d55f4b04bdd7c 100644 --- a/editor/components/skip-to-selected-block/index.js +++ b/packages/editor/src/components/skip-to-selected-block/index.js @@ -8,7 +8,6 @@ import { Button } from '@wordpress/components'; /** * Internal Dependencies */ -import './style.scss'; import { getBlockFocusableWrapper } from '../../utils/dom'; const SkipToSelectedBlock = ( { selectedBlockClientId } ) => { diff --git a/editor/components/skip-to-selected-block/style.scss b/packages/editor/src/components/skip-to-selected-block/style.scss similarity index 100% rename from editor/components/skip-to-selected-block/style.scss rename to packages/editor/src/components/skip-to-selected-block/style.scss diff --git a/editor/components/table-of-contents/index.js b/packages/editor/src/components/table-of-contents/index.js similarity index 97% rename from editor/components/table-of-contents/index.js rename to packages/editor/src/components/table-of-contents/index.js index 3fe86e5745a36..ea340e9000aaa 100644 --- a/editor/components/table-of-contents/index.js +++ b/packages/editor/src/components/table-of-contents/index.js @@ -8,7 +8,6 @@ import { withSelect } from '@wordpress/data'; /** * Internal dependencies */ -import './style.scss'; import TableOfContentsPanel from './panel'; function TableOfContents( { hasBlocks } ) { diff --git a/editor/components/table-of-contents/panel.js b/packages/editor/src/components/table-of-contents/panel.js similarity index 100% rename from editor/components/table-of-contents/panel.js rename to packages/editor/src/components/table-of-contents/panel.js diff --git a/editor/components/table-of-contents/style.scss b/packages/editor/src/components/table-of-contents/style.scss similarity index 100% rename from editor/components/table-of-contents/style.scss rename to packages/editor/src/components/table-of-contents/style.scss diff --git a/editor/components/template-validation-notice/index.js b/packages/editor/src/components/template-validation-notice/index.js similarity index 96% rename from editor/components/template-validation-notice/index.js rename to packages/editor/src/components/template-validation-notice/index.js index f1a8ccfd1bddd..f8ada453dc3f4 100644 --- a/editor/components/template-validation-notice/index.js +++ b/packages/editor/src/components/template-validation-notice/index.js @@ -6,11 +6,6 @@ import { __ } from '@wordpress/i18n'; import { withSelect, withDispatch } from '@wordpress/data'; import { compose } from '@wordpress/compose'; -/** - * Internal dependencies - */ -import './style.scss'; - function TemplateValidationNotice( { isValid, ...props } ) { if ( isValid ) { return null; diff --git a/editor/components/template-validation-notice/style.scss b/packages/editor/src/components/template-validation-notice/style.scss similarity index 100% rename from editor/components/template-validation-notice/style.scss rename to packages/editor/src/components/template-validation-notice/style.scss diff --git a/editor/components/theme-support-check/index.js b/packages/editor/src/components/theme-support-check/index.js similarity index 100% rename from editor/components/theme-support-check/index.js rename to packages/editor/src/components/theme-support-check/index.js diff --git a/editor/components/theme-support-check/test/index.js b/packages/editor/src/components/theme-support-check/test/index.js similarity index 100% rename from editor/components/theme-support-check/test/index.js rename to packages/editor/src/components/theme-support-check/test/index.js diff --git a/editor/components/unsaved-changes-warning/index.js b/packages/editor/src/components/unsaved-changes-warning/index.js similarity index 100% rename from editor/components/unsaved-changes-warning/index.js rename to packages/editor/src/components/unsaved-changes-warning/index.js diff --git a/editor/components/url-input/button.js b/packages/editor/src/components/url-input/button.js similarity index 98% rename from editor/components/url-input/button.js rename to packages/editor/src/components/url-input/button.js index 3fc0ac352fbc4..8c02238dcab2f 100644 --- a/editor/components/url-input/button.js +++ b/packages/editor/src/components/url-input/button.js @@ -6,7 +6,6 @@ import classnames from 'classnames'; /** * WordPress dependencies */ -import './style.scss'; import { __ } from '@wordpress/i18n'; import { Component } from '@wordpress/element'; import { IconButton } from '@wordpress/components'; diff --git a/editor/components/url-input/index.js b/packages/editor/src/components/url-input/index.js similarity index 100% rename from editor/components/url-input/index.js rename to packages/editor/src/components/url-input/index.js diff --git a/editor/components/url-input/style.scss b/packages/editor/src/components/url-input/style.scss similarity index 100% rename from editor/components/url-input/style.scss rename to packages/editor/src/components/url-input/style.scss diff --git a/editor/components/url-input/test/button.js b/packages/editor/src/components/url-input/test/button.js similarity index 100% rename from editor/components/url-input/test/button.js rename to packages/editor/src/components/url-input/test/button.js diff --git a/editor/components/warning/index.js b/packages/editor/src/components/warning/index.js similarity index 91% rename from editor/components/warning/index.js rename to packages/editor/src/components/warning/index.js index 6c7bc9e58f3d3..9000b723b9724 100644 --- a/editor/components/warning/index.js +++ b/packages/editor/src/components/warning/index.js @@ -3,11 +3,6 @@ */ import { Children } from '@wordpress/element'; -/** - * Internal dependencies - */ -import './style.scss'; - function Warning( { actions, children } ) { return (
diff --git a/editor/components/warning/style.scss b/packages/editor/src/components/warning/style.scss similarity index 100% rename from editor/components/warning/style.scss rename to packages/editor/src/components/warning/style.scss diff --git a/editor/components/warning/test/__snapshots__/index.js.snap b/packages/editor/src/components/warning/test/__snapshots__/index.js.snap similarity index 100% rename from editor/components/warning/test/__snapshots__/index.js.snap rename to packages/editor/src/components/warning/test/__snapshots__/index.js.snap diff --git a/editor/components/warning/test/index.js b/packages/editor/src/components/warning/test/index.js similarity index 100% rename from editor/components/warning/test/index.js rename to packages/editor/src/components/warning/test/index.js diff --git a/editor/components/with-deprecated-unique-id/index.js b/packages/editor/src/components/with-deprecated-unique-id/index.js similarity index 100% rename from editor/components/with-deprecated-unique-id/index.js rename to packages/editor/src/components/with-deprecated-unique-id/index.js diff --git a/editor/components/word-count/index.js b/packages/editor/src/components/word-count/index.js similarity index 100% rename from editor/components/word-count/index.js rename to packages/editor/src/components/word-count/index.js diff --git a/editor/components/writing-flow/index.js b/packages/editor/src/components/writing-flow/index.js similarity index 99% rename from editor/components/writing-flow/index.js rename to packages/editor/src/components/writing-flow/index.js index 64c68367ac901..e13b81eaf6dfd 100644 --- a/editor/components/writing-flow/index.js +++ b/packages/editor/src/components/writing-flow/index.js @@ -24,7 +24,6 @@ import { compose } from '@wordpress/compose'; /** * Internal dependencies */ -import './style.scss'; import { isBlockFocusStop, isInSameBlock, diff --git a/editor/components/writing-flow/style.scss b/packages/editor/src/components/writing-flow/style.scss similarity index 100% rename from editor/components/writing-flow/style.scss rename to packages/editor/src/components/writing-flow/style.scss diff --git a/editor/hooks/align.js b/packages/editor/src/hooks/align.js similarity index 100% rename from editor/hooks/align.js rename to packages/editor/src/hooks/align.js diff --git a/editor/hooks/anchor.js b/packages/editor/src/hooks/anchor.js similarity index 100% rename from editor/hooks/anchor.js rename to packages/editor/src/hooks/anchor.js diff --git a/editor/hooks/custom-class-name.js b/packages/editor/src/hooks/custom-class-name.js similarity index 100% rename from editor/hooks/custom-class-name.js rename to packages/editor/src/hooks/custom-class-name.js diff --git a/editor/hooks/custom-class-name.native.js b/packages/editor/src/hooks/custom-class-name.native.js similarity index 100% rename from editor/hooks/custom-class-name.native.js rename to packages/editor/src/hooks/custom-class-name.native.js diff --git a/editor/hooks/default-autocompleters.js b/packages/editor/src/hooks/default-autocompleters.js similarity index 100% rename from editor/hooks/default-autocompleters.js rename to packages/editor/src/hooks/default-autocompleters.js diff --git a/editor/hooks/generated-class-name.js b/packages/editor/src/hooks/generated-class-name.js similarity index 100% rename from editor/hooks/generated-class-name.js rename to packages/editor/src/hooks/generated-class-name.js diff --git a/editor/hooks/index.js b/packages/editor/src/hooks/index.js similarity index 100% rename from editor/hooks/index.js rename to packages/editor/src/hooks/index.js diff --git a/editor/hooks/index.native.js b/packages/editor/src/hooks/index.native.js similarity index 100% rename from editor/hooks/index.native.js rename to packages/editor/src/hooks/index.native.js diff --git a/editor/hooks/layout.js b/packages/editor/src/hooks/layout.js similarity index 100% rename from editor/hooks/layout.js rename to packages/editor/src/hooks/layout.js diff --git a/editor/hooks/test/align.js b/packages/editor/src/hooks/test/align.js similarity index 100% rename from editor/hooks/test/align.js rename to packages/editor/src/hooks/test/align.js diff --git a/editor/hooks/test/anchor.js b/packages/editor/src/hooks/test/anchor.js similarity index 100% rename from editor/hooks/test/anchor.js rename to packages/editor/src/hooks/test/anchor.js diff --git a/editor/hooks/test/custom-class-name.js b/packages/editor/src/hooks/test/custom-class-name.js similarity index 100% rename from editor/hooks/test/custom-class-name.js rename to packages/editor/src/hooks/test/custom-class-name.js diff --git a/editor/hooks/test/default-autocompleters.js b/packages/editor/src/hooks/test/default-autocompleters.js similarity index 100% rename from editor/hooks/test/default-autocompleters.js rename to packages/editor/src/hooks/test/default-autocompleters.js diff --git a/editor/hooks/test/generated-class-name.js b/packages/editor/src/hooks/test/generated-class-name.js similarity index 100% rename from editor/hooks/test/generated-class-name.js rename to packages/editor/src/hooks/test/generated-class-name.js diff --git a/editor/hooks/test/layout.js b/packages/editor/src/hooks/test/layout.js similarity index 100% rename from editor/hooks/test/layout.js rename to packages/editor/src/hooks/test/layout.js diff --git a/editor/index.js b/packages/editor/src/index.js similarity index 100% rename from editor/index.js rename to packages/editor/src/index.js diff --git a/editor/store/actions.js b/packages/editor/src/store/actions.js similarity index 100% rename from editor/store/actions.js rename to packages/editor/src/store/actions.js diff --git a/editor/store/array.js b/packages/editor/src/store/array.js similarity index 100% rename from editor/store/array.js rename to packages/editor/src/store/array.js diff --git a/editor/store/defaults.js b/packages/editor/src/store/defaults.js similarity index 100% rename from editor/store/defaults.js rename to packages/editor/src/store/defaults.js diff --git a/editor/store/effects.js b/packages/editor/src/store/effects.js similarity index 100% rename from editor/store/effects.js rename to packages/editor/src/store/effects.js diff --git a/editor/store/effects/posts.js b/packages/editor/src/store/effects/posts.js similarity index 100% rename from editor/store/effects/posts.js rename to packages/editor/src/store/effects/posts.js diff --git a/editor/store/effects/reusable-blocks.js b/packages/editor/src/store/effects/reusable-blocks.js similarity index 100% rename from editor/store/effects/reusable-blocks.js rename to packages/editor/src/store/effects/reusable-blocks.js diff --git a/editor/store/effects/test/reusable-blocks.js b/packages/editor/src/store/effects/test/reusable-blocks.js similarity index 100% rename from editor/store/effects/test/reusable-blocks.js rename to packages/editor/src/store/effects/test/reusable-blocks.js diff --git a/editor/store/effects/test/utils.js b/packages/editor/src/store/effects/test/utils.js similarity index 100% rename from editor/store/effects/test/utils.js rename to packages/editor/src/store/effects/test/utils.js diff --git a/editor/store/effects/utils.js b/packages/editor/src/store/effects/utils.js similarity index 100% rename from editor/store/effects/utils.js rename to packages/editor/src/store/effects/utils.js diff --git a/editor/store/index.js b/packages/editor/src/store/index.js similarity index 100% rename from editor/store/index.js rename to packages/editor/src/store/index.js diff --git a/editor/store/index.native.js b/packages/editor/src/store/index.native.js similarity index 100% rename from editor/store/index.native.js rename to packages/editor/src/store/index.native.js diff --git a/editor/store/middlewares.js b/packages/editor/src/store/middlewares.js similarity index 100% rename from editor/store/middlewares.js rename to packages/editor/src/store/middlewares.js diff --git a/editor/store/reducer.js b/packages/editor/src/store/reducer.js similarity index 100% rename from editor/store/reducer.js rename to packages/editor/src/store/reducer.js diff --git a/editor/store/selectors.js b/packages/editor/src/store/selectors.js similarity index 100% rename from editor/store/selectors.js rename to packages/editor/src/store/selectors.js diff --git a/editor/store/test/actions.js b/packages/editor/src/store/test/actions.js similarity index 100% rename from editor/store/test/actions.js rename to packages/editor/src/store/test/actions.js diff --git a/editor/store/test/array.js b/packages/editor/src/store/test/array.js similarity index 100% rename from editor/store/test/array.js rename to packages/editor/src/store/test/array.js diff --git a/editor/store/test/effects.js b/packages/editor/src/store/test/effects.js similarity index 100% rename from editor/store/test/effects.js rename to packages/editor/src/store/test/effects.js diff --git a/editor/store/test/reducer.js b/packages/editor/src/store/test/reducer.js similarity index 99% rename from editor/store/test/reducer.js rename to packages/editor/src/store/test/reducer.js index 22ef99aed5d15..525100fb88632 100644 --- a/editor/store/test/reducer.js +++ b/packages/editor/src/store/test/reducer.js @@ -12,7 +12,6 @@ import { unregisterBlockType, createBlock, } from '@wordpress/blocks'; -import { registerCoreBlocks } from '@wordpress/core-blocks'; /** * Internal dependencies @@ -1577,10 +1576,6 @@ describe( 'state', () => { } ); describe( 'preferences()', () => { - beforeAll( () => { - registerCoreBlocks(); - } ); - it( 'should apply all defaults', () => { const state = preferences( undefined, {} ); diff --git a/editor/store/test/selectors.js b/packages/editor/src/store/test/selectors.js similarity index 100% rename from editor/store/test/selectors.js rename to packages/editor/src/store/test/selectors.js diff --git a/packages/editor/src/style.scss b/packages/editor/src/style.scss new file mode 100644 index 0000000000000..840ded74e26f6 --- /dev/null +++ b/packages/editor/src/style.scss @@ -0,0 +1,44 @@ +@import './components/autocompleters/style.scss'; +@import './components/block-drop-zone/style.scss'; +@import './components/block-icon/style.scss'; +@import './components/block-inspector/style.scss'; +@import './components/block-list/style.scss'; +@import './components/block-mover/style.scss'; +@import './components/block-preview/style.scss'; +@import './components/block-settings-menu/style.scss'; +@import './components/block-styles/style.scss'; +@import './components/block-switcher/style.scss'; +@import './components/block-toolbar/style.scss'; +@import './components/block-types-list/style.scss'; +@import './components/color-palette/control.scss'; +@import './components/contrast-checker/style.scss'; +@import './components/default-block-appender/style.scss'; +@import './components/document-outline/style.scss'; +@import './components/inner-blocks/style.scss'; +@import './components/inserter-with-shortcuts/style.scss'; +@import './components/inserter/style.scss'; +@import './components/media-placeholder/style.scss'; +@import './components/page-attributes/style.scss'; +@import './components/panel-color-settings/style.scss'; +@import './components/plain-text/style.scss'; +@import './components/post-excerpt/style.scss'; +@import './components/post-featured-image/style.scss'; +@import './components/post-format/style.scss'; +@import './components/post-last-revision/style.scss'; +@import './components/post-permalink/style.scss'; +@import './components/post-publish-panel/style.scss'; +@import './components/post-saved-state/style.scss'; +@import './components/post-taxonomies/style.scss'; +@import './components/post-text-editor/style.scss'; +@import './components/post-title/style.scss'; +@import './components/post-trash/style.scss'; +@import './components/rich-text/core-tokens/image/style.scss'; +@import './components/rich-text/format-toolbar/style.scss'; +@import './components/rich-text/style.scss'; +@import './components/rich-text/tokens/ui/style.scss'; +@import './components/skip-to-selected-block/style.scss'; +@import './components/table-of-contents/style.scss'; +@import './components/template-validation-notice/style.scss'; +@import './components/url-input/style.scss'; +@import './components/warning/style.scss'; +@import './components/writing-flow/style.scss'; diff --git a/editor/utils/dom.js b/packages/editor/src/utils/dom.js similarity index 100% rename from editor/utils/dom.js rename to packages/editor/src/utils/dom.js diff --git a/editor/utils/index.js b/packages/editor/src/utils/index.js similarity index 100% rename from editor/utils/index.js rename to packages/editor/src/utils/index.js diff --git a/editor/utils/index.native.js b/packages/editor/src/utils/index.native.js similarity index 100% rename from editor/utils/index.native.js rename to packages/editor/src/utils/index.native.js diff --git a/editor/utils/media-upload/index.js b/packages/editor/src/utils/media-upload/index.js similarity index 100% rename from editor/utils/media-upload/index.js rename to packages/editor/src/utils/media-upload/index.js diff --git a/editor/utils/media-upload/media-upload.js b/packages/editor/src/utils/media-upload/media-upload.js similarity index 100% rename from editor/utils/media-upload/media-upload.js rename to packages/editor/src/utils/media-upload/media-upload.js diff --git a/editor/utils/media-upload/test/media-upload.js b/packages/editor/src/utils/media-upload/test/media-upload.js similarity index 100% rename from editor/utils/media-upload/test/media-upload.js rename to packages/editor/src/utils/media-upload/test/media-upload.js diff --git a/editor/utils/terms.js b/packages/editor/src/utils/terms.js similarity index 100% rename from editor/utils/terms.js rename to packages/editor/src/utils/terms.js diff --git a/editor/utils/test/dom.js b/packages/editor/src/utils/test/dom.js similarity index 100% rename from editor/utils/test/dom.js rename to packages/editor/src/utils/test/dom.js diff --git a/editor/utils/test/terms.js b/packages/editor/src/utils/test/terms.js similarity index 100% rename from editor/utils/test/terms.js rename to packages/editor/src/utils/test/terms.js diff --git a/editor/utils/test/url.js b/packages/editor/src/utils/test/url.js similarity index 100% rename from editor/utils/test/url.js rename to packages/editor/src/utils/test/url.js diff --git a/editor/utils/url.js b/packages/editor/src/utils/url.js similarity index 100% rename from editor/utils/url.js rename to packages/editor/src/utils/url.js diff --git a/editor/utils/with-change-detection/README.md b/packages/editor/src/utils/with-change-detection/README.md similarity index 100% rename from editor/utils/with-change-detection/README.md rename to packages/editor/src/utils/with-change-detection/README.md diff --git a/editor/utils/with-change-detection/index.js b/packages/editor/src/utils/with-change-detection/index.js similarity index 100% rename from editor/utils/with-change-detection/index.js rename to packages/editor/src/utils/with-change-detection/index.js diff --git a/editor/utils/with-change-detection/test/index.js b/packages/editor/src/utils/with-change-detection/test/index.js similarity index 100% rename from editor/utils/with-change-detection/test/index.js rename to packages/editor/src/utils/with-change-detection/test/index.js diff --git a/editor/utils/with-history/README.md b/packages/editor/src/utils/with-history/README.md similarity index 100% rename from editor/utils/with-history/README.md rename to packages/editor/src/utils/with-history/README.md diff --git a/editor/utils/with-history/index.js b/packages/editor/src/utils/with-history/index.js similarity index 100% rename from editor/utils/with-history/index.js rename to packages/editor/src/utils/with-history/index.js diff --git a/editor/utils/with-history/test/index.js b/packages/editor/src/utils/with-history/test/index.js similarity index 100% rename from editor/utils/with-history/test/index.js rename to packages/editor/src/utils/with-history/test/index.js diff --git a/test/integration/blocks-raw-handling.spec.js b/test/integration/blocks-raw-handling.spec.js index c2a9bc2a3cc39..363560408208b 100644 --- a/test/integration/blocks-raw-handling.spec.js +++ b/test/integration/blocks-raw-handling.spec.js @@ -17,7 +17,7 @@ import { registerCoreBlocks } from '@wordpress/core-blocks'; describe( 'Blocks raw handling', () => { beforeAll( () => { // Load all hooks that modify blocks - require( 'editor/hooks' ); + require( '../../packages/editor/src/hooks' ); registerCoreBlocks(); } ); diff --git a/test/integration/is-valid-block.spec.js b/test/integration/is-valid-block.spec.js index db647e0bbe387..8ed9ffae6dd20 100644 --- a/test/integration/is-valid-block.spec.js +++ b/test/integration/is-valid-block.spec.js @@ -7,7 +7,7 @@ import { createElement } from '@wordpress/element'; describe( 'isValidBlock', () => { beforeAll( () => { // Load all hooks that modify blocks - require( 'editor/hooks' ); + require( '../../packages/editor/src/hooks' ); } ); it( 'should use the namespace in the classname for non-core blocks', () => { diff --git a/test/unit/jest.config.json b/test/unit/jest.config.json index 916d349aa21c4..7d3046bdeee08 100644 --- a/test/unit/jest.config.json +++ b/test/unit/jest.config.json @@ -11,7 +11,7 @@ "/packages/.*/benchmark/" ], "moduleNameMapper": { - "@wordpress\\/(components|editor|edit-post|core-blocks)$": "$1", + "@wordpress\\/(components|edit-post|core-blocks)$": "$1", "@wordpress\\/(block-serialization-spec-parser|is-shallow-equal)$": "packages/$1", "@wordpress\\/([a-z0-9-]+)$": "packages/$1/src" }, diff --git a/webpack.config.js b/webpack.config.js index 8278bdd22d9fa..02cd4aed196d8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -77,7 +77,6 @@ function camelCaseDash( string ) { const entryPointNames = [ 'components', - 'editor', 'utils', 'edit-post', 'core-blocks', @@ -97,6 +96,7 @@ const gutenbergPackages = [ 'deprecated', 'dom', 'dom-ready', + 'editor', 'element', 'hooks', 'html-entities', @@ -106,7 +106,9 @@ const gutenbergPackages = [ 'nux', 'plugins', 'shortcode', + 'url', 'viewport', + 'wordcount', ]; const externals = { From 69e330d767747d18b801d6180290f1d0c7110111 Mon Sep 17 00:00:00 2001 From: Grzegorz Ziolkowski Date: Thu, 26 Jul 2018 21:56:49 +0200 Subject: [PATCH 2/3] Packages: Tweaks for the new editor package --- docs/data/README.md | 4 ++-- docs/data/data-core-edit-post.md | 2 +- docs/data/data-core-editor.md | 2 +- docs/manifest.json | 16 ++++++++-------- docs/tool/config.js | 1 - package-lock.json | 1 - packages/blocks/package.json | 1 - packages/editor/README.md | 5 ++--- packages/editor/package.json | 2 +- test/unit/jest.config.json | 2 +- 10 files changed, 16 insertions(+), 20 deletions(-) diff --git a/docs/data/README.md b/docs/data/README.md index 73488a7d33c55..61030721e3cd0 100644 --- a/docs/data/README.md +++ b/docs/data/README.md @@ -2,7 +2,7 @@ - [**core**: WordPress Core Data](../../docs/data/data-core.md) - [**core/blocks**: Block Types Data](../../docs/data/data-core-blocks.md) - - [**core/editor**: The Editor's Data](../../docs/data/data-core-editor.md) - - [**core/edit-post**: The Editor's UI Data](../../docs/data/data-core-edit-post.md) + - [**core/editor**: The Editor’s Data](../../docs/data/data-core-editor.md) + - [**core/edit-post**: The Editor’s UI Data](../../docs/data/data-core-edit-post.md) - [**core/nux**: The NUX (New User Experience) Data](../../docs/data/data-core-nux.md) - [**core/viewport**: The Viewport Data](../../docs/data/data-core-viewport.md) \ No newline at end of file diff --git a/docs/data/data-core-edit-post.md b/docs/data/data-core-edit-post.md index 06947353599fa..08cae65c0e3f4 100644 --- a/docs/data/data-core-edit-post.md +++ b/docs/data/data-core-edit-post.md @@ -1,4 +1,4 @@ -# **core/edit-post**: The Editor's UI Data +# **core/edit-post**: The Editor’s UI Data ## Selectors diff --git a/docs/data/data-core-editor.md b/docs/data/data-core-editor.md index 7d73db4bf5f80..299ebffa4e964 100644 --- a/docs/data/data-core-editor.md +++ b/docs/data/data-core-editor.md @@ -1,4 +1,4 @@ -# **core/editor**: The Editor's Data +# **core/editor**: The Editor’s Data ## Selectors diff --git a/docs/manifest.json b/docs/manifest.json index 9d6e81757ab6a..8fad33d7258b5 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -329,6 +329,12 @@ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/packages/dom/README.md", "parent": "packages" }, + { + "title": "@wordpress/editor", + "slug": "packages-editor", + "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/packages/editor/README.md", + "parent": "packages" + }, { "title": "@wordpress/element", "slug": "packages-element", @@ -449,12 +455,6 @@ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/edit-post/README.md", "parent": "packages" }, - { - "title": "@wordpress/editor", - "slug": "packages-editor", - "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/editor/README.md", - "parent": "packages" - }, { "title": "Data Package Reference", "slug": "data", @@ -474,13 +474,13 @@ "parent": "data" }, { - "title": "The Editor's Data", + "title": "The Editor’s Data", "slug": "data-core-editor", "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/data/data-core-editor.md", "parent": "data" }, { - "title": "The Editor's UI Data", + "title": "The Editor’s UI Data", "slug": "data-core-edit-post", "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/data/data-core-edit-post.md", "parent": "data" diff --git a/docs/tool/config.js b/docs/tool/config.js index a23566ce7494a..9b8f28d20b52b 100644 --- a/docs/tool/config.js +++ b/docs/tool/config.js @@ -15,7 +15,6 @@ const npmReadyPackages = glob( 'packages/*/package.json' ) const gutenbergPackages = [ 'core-blocks', 'edit-post', - 'editor', ]; module.exports = { diff --git a/package-lock.json b/package-lock.json index 7605e90d7e497..b632e135554bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3058,7 +3058,6 @@ "@wordpress/i18n": "file:packages/i18n", "@wordpress/is-shallow-equal": "file:packages/is-shallow-equal", "@wordpress/shortcode": "file:packages/shortcode", - "dom-react": "^2.2.1", "element-closest": "^2.0.2", "hpq": "^1.2.0", "lodash": "^4.17.10", diff --git a/packages/blocks/package.json b/packages/blocks/package.json index e81e49ef5fe45..9fefc5e951785 100644 --- a/packages/blocks/package.json +++ b/packages/blocks/package.json @@ -32,7 +32,6 @@ "@wordpress/i18n": "file:../i18n", "@wordpress/is-shallow-equal": "file:../is-shallow-equal", "@wordpress/shortcode": "file:../shortcode", - "dom-react": "^2.2.1", "element-closest": "^2.0.2", "hpq": "^1.2.0", "lodash": "^4.17.10", diff --git a/packages/editor/README.md b/packages/editor/README.md index 8e271dcc80fc0..f6b3fe0482267 100644 --- a/packages/editor/README.md +++ b/packages/editor/README.md @@ -1,5 +1,4 @@ -Editor: an overview -=================== +# Editor The logic flow concerning the editor includes: inferring a block representation of the post content (parsing); describing the state of a post (representation); rendering of the post to the DOM (rendering); attaching controls to manipulate the content a.k.a blocks (UI). @@ -122,4 +121,4 @@ Example: window.wp.editor, window.wp.element ); -``` \ No newline at end of file +``` diff --git a/packages/editor/package.json b/packages/editor/package.json index 78f46d0f6f18d..5c49033920d20 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -1,7 +1,7 @@ { "name": "@wordpress/editor", "version": "1.0.0-alpha.1", - "description": "Building blocks for WordPress editors", + "description": "Building blocks for WordPress editors.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", "keywords": [ diff --git a/test/unit/jest.config.json b/test/unit/jest.config.json index 7d3046bdeee08..d958f5ae96c78 100644 --- a/test/unit/jest.config.json +++ b/test/unit/jest.config.json @@ -1,7 +1,7 @@ { "rootDir": "../../", "collectCoverageFrom": [ - "(editor|edit-post|core-blocks)/**/*.js", + "(edit-post|core-blocks)/**/*.js", "packages/**/*.js" ], "coveragePathIgnorePatterns": [ From 75c68a8ceafd1a26d9d15ec3c9a071cb9b02f0dc Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Fri, 27 Jul 2018 10:41:59 +0100 Subject: [PATCH 3/3] Remove removed file from master with-colors-deprecated --- .../colors/with-colors-deprecated.js | 92 ------------------- 1 file changed, 92 deletions(-) delete mode 100644 packages/editor/src/components/colors/with-colors-deprecated.js diff --git a/packages/editor/src/components/colors/with-colors-deprecated.js b/packages/editor/src/components/colors/with-colors-deprecated.js deleted file mode 100644 index 83944442445e3..0000000000000 --- a/packages/editor/src/components/colors/with-colors-deprecated.js +++ /dev/null @@ -1,92 +0,0 @@ -/** - * External dependencies - */ -import memoize from 'memize'; -import { get } from 'lodash'; - -/** - * WordPress dependencies - */ -import { Component } from '@wordpress/element'; -import { withSelect } from '@wordpress/data'; -import { compose, createHigherOrderComponent } from '@wordpress/compose'; - -/** - * Internal dependencies - */ -import { getColorValue, getColorClass, setColorValue } from './utils'; - -const DEFAULT_COLORS = []; - -/** - * Higher-order component, which handles color logic for class generation - * color value, retrieval and color attribute setting. - * - * @param {Function} mapGetSetColorToProps Function that receives getColor, setColor, and props, - * and returns additional props to pass to the component. - * - * @return {Function} Higher-order component. - */ -export default ( mapGetSetColorToProps ) => createHigherOrderComponent( - compose( [ - withSelect( - ( select ) => { - const settings = select( 'core/editor' ).getEditorSettings(); - return { - colors: get( settings, [ 'colors' ], DEFAULT_COLORS ), - }; - } ), - ( WrappedComponent ) => { - return class extends Component { - constructor() { - super( ...arguments ); - /** - * Even though we don't expect setAttributes or colors to change memoizing it is essential. - * If setAttributes or colors are not memoized, each time memoizedGetColor/memoizedSetColor are called: - * a new function reference is returned (even if arguments have not changed). - * This would make our memoized chain useless. - */ - this.memoizedGetColor = memoize( this.memoizedGetColor, { maxSize: 1 } ); - this.memoizedSetColor = memoize( this.memoizedSetColor, { maxSize: 1 } ); - } - - memoizedGetColor( colors ) { - return memoize( - ( colorName, customColorValue, colorContext ) => { - return { - name: colorName, - class: getColorClass( colorContext, colorName ), - value: getColorValue( colors, colorName, customColorValue ), - }; - } - ); - } - - memoizedSetColor( setAttributes, colors ) { - return memoize( - ( colorNameAttribute, customColorAttribute ) => { - return setColorValue( colors, colorNameAttribute, customColorAttribute, setAttributes ); - } - ); - } - - render() { - return ( - - ); - } - }; - }, - ] ), - 'withColors' -);