diff --git a/Resources/Private/Translations/en/Main.xlf b/Resources/Private/Translations/en/Main.xlf index bb33ed1b50..0db6995fa5 100644 --- a/Resources/Private/Translations/en/Main.xlf +++ b/Resources/Private/Translations/en/Main.xlf @@ -11,6 +11,9 @@ Please select the position at which you want {source} inserted relative to {target}. + + Add + Insert diff --git a/Resources/Private/Translations/es/Main.xlf b/Resources/Private/Translations/es/Main.xlf index 1d3b41fc42..03b24dc7ad 100644 --- a/Resources/Private/Translations/es/Main.xlf +++ b/Resources/Private/Translations/es/Main.xlf @@ -534,6 +534,10 @@ Format options Opciones del formato + + Add + AƱadir + diff --git a/Resources/Private/Translations/nl/Main.xlf b/Resources/Private/Translations/nl/Main.xlf index f06c28a1fc..4f20479d44 100644 --- a/Resources/Private/Translations/nl/Main.xlf +++ b/Resources/Private/Translations/nl/Main.xlf @@ -519,6 +519,10 @@ Format options Opmaakopties + + Add + Voeg toe + diff --git a/Tests/IntegrationTests/utils.js b/Tests/IntegrationTests/utils.js index 86f3289b9e..6c65655709 100644 --- a/Tests/IntegrationTests/utils.js +++ b/Tests/IntegrationTests/utils.js @@ -39,10 +39,6 @@ export async function checkPropTypes() { if (error[0] && error[0].search('Warning: Unsafe legacy lifecycles') >= 0) { delete error[0]; } - // Quick fix to be able to use node 16 with testcafe @see https://github.com/DevExpress/testcafe/issues/7097 - if (error[0] && error[0].search('hammerhead.js') >= 0) { - delete error[0]; - } if (error[0]) { console.log('These console errors were the cause of the failed test:', error); } diff --git a/package.json b/package.json index 3eaab989d6..6c18551057 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "bugs": "https://github.com/neos/neos-ui/issues", "homepage": "https://github.com/neos/neos-ui/blob/master/README.md", "license": "GNU GPLv3", - "version": "8.3.2", + "version": "8.3.4", "private": true, "resolutions": { "moment": "^2.20.1", diff --git a/packages/debug-reason-for-rendering/package.json b/packages/debug-reason-for-rendering/package.json index 39bacba7f5..d2f110a7e7 100644 --- a/packages/debug-reason-for-rendering/package.json +++ b/packages/debug-reason-for-rendering/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/debug-reason-for-rendering", - "version": "8.3.2", + "version": "8.3.4", "description": "React Performance Optimization Utility - Why does a component re-render?", "repository": "neos/neos-ui", "bugs": "https://github.com/neos/neos-ui/issues", diff --git a/packages/jest-preset-neos-ui/package.json b/packages/jest-preset-neos-ui/package.json index 2bc4720e2f..2388681ee4 100644 --- a/packages/jest-preset-neos-ui/package.json +++ b/packages/jest-preset-neos-ui/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/jest-preset-neos-ui", - "version": "8.3.2", + "version": "8.3.4", "description": "The jest preset for all packages of the neos-ui mono-repo.", "main": "jest-preset.json", "private": true, diff --git a/packages/neos-ts-interfaces/package.json b/packages/neos-ts-interfaces/package.json index 3f2db5459f..c3f0c72c88 100644 --- a/packages/neos-ts-interfaces/package.json +++ b/packages/neos-ts-interfaces/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/neos-ts-interfaces", - "version": "8.3.2", + "version": "8.3.4", "description": "Neos domain-related TypeScript interfaces", "private": true, "main": "src/index.ts", diff --git a/packages/neos-ui-backend-connector/package.json b/packages/neos-ui-backend-connector/package.json index 2c360e1bbc..13c30d9e43 100644 --- a/packages/neos-ui-backend-connector/package.json +++ b/packages/neos-ui-backend-connector/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/neos-ui-backend-connector", - "version": "8.3.2", + "version": "8.3.4", "description": "Endoints and fetch cals to the Neos CMS backend", "private": true, "main": "./src/index.ts", diff --git a/packages/neos-ui-build/package.json b/packages/neos-ui-build/package.json index 34b2054888..f586002fdc 100644 --- a/packages/neos-ui-build/package.json +++ b/packages/neos-ui-build/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/neos-ui-build", - "version": "8.3.2", + "version": "8.3.4", "description": "Bob der Baumeister", "private": true } diff --git a/packages/neos-ui-ckeditor5-bindings/package.json b/packages/neos-ui-ckeditor5-bindings/package.json index ac7d75d455..8ee6deb1fe 100644 --- a/packages/neos-ui-ckeditor5-bindings/package.json +++ b/packages/neos-ui-ckeditor5-bindings/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/neos-ui-ckeditor5-bindings", - "version": "8.3.2", + "version": "8.3.4", "description": "Prepare CKEditor5 for the Neos CMS UI", "private": true, "main": "./src/manifest.js", diff --git a/packages/neos-ui-constants/package.json b/packages/neos-ui-constants/package.json index ebdd93ee7a..482dc85a0e 100644 --- a/packages/neos-ui-constants/package.json +++ b/packages/neos-ui-constants/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/neos-ui-constants", - "version": "8.3.2", + "version": "8.3.4", "description": "Container package to store Neos CMS UI constants", "private": true, "main": "./src/index.js", diff --git a/packages/neos-ui-containers/package.json b/packages/neos-ui-containers/package.json index ff491474a3..c073cff79d 100644 --- a/packages/neos-ui-containers/package.json +++ b/packages/neos-ui-containers/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/neos-ui-containers", - "version": "8.3.2", + "version": "8.3.4", "description": "Smart components for Neos CMS UI.", "private": true, "main": "./src/index.js", diff --git a/packages/neos-ui-contentrepository/package.json b/packages/neos-ui-contentrepository/package.json index 2f03b777d1..6d6470bd8f 100644 --- a/packages/neos-ui-contentrepository/package.json +++ b/packages/neos-ui-contentrepository/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/neos-ui-contentrepository", - "version": "8.3.2", + "version": "8.3.4", "description": "Bindings for the Neos ContentRepository", "private": true, "main": "./src/manifest.js", diff --git a/packages/neos-ui-decorators/package.json b/packages/neos-ui-decorators/package.json index 3ee20560e8..c46f5f96ca 100644 --- a/packages/neos-ui-decorators/package.json +++ b/packages/neos-ui-decorators/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/neos-ui-decorators", - "version": "8.3.2", + "version": "8.3.4", "description": "Decorators for Neos CMS UI.", "private": true, "main": "./src/index.ts", diff --git a/packages/neos-ui-editors/package.json b/packages/neos-ui-editors/package.json index 89cca2a648..490d32442f 100644 --- a/packages/neos-ui-editors/package.json +++ b/packages/neos-ui-editors/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/neos-ui-editors", - "version": "8.3.2", + "version": "8.3.4", "description": "Neos CMS UI Editors for use in the inspector.", "main": "src/manifest.js", "private": true, diff --git a/packages/neos-ui-editors/src/SecondaryEditors/ImageCropper/index.js b/packages/neos-ui-editors/src/SecondaryEditors/ImageCropper/index.js index 7c10da750e..2aedba50a7 100644 --- a/packages/neos-ui-editors/src/SecondaryEditors/ImageCropper/index.js +++ b/packages/neos-ui-editors/src/SecondaryEditors/ImageCropper/index.js @@ -93,11 +93,14 @@ export default class ImageCropper extends PureComponent { componentDidMount() { // // Calculate and set maximum height for the cropped image - const containerHeight = this.containerNode.parentElement.clientHeight; + // The upper toolbars (the publish tool bar and ckeditor bar) are each 41px + const upperToolbarHeights = 41 + 41; + const secondaryEditorHeight = window.innerHeight - upperToolbarHeights; const toolbarStyles = getComputedStyle(this.toolbarNode); const toolbarFullHeight = parseInt(toolbarStyles.height, 10) + parseInt(toolbarStyles['margin-top'], 10) + parseInt(toolbarStyles['margin-bottom'], 10); const spacing = 32; - const height = (containerHeight - toolbarFullHeight - spacing) + 'px'; + const height = (secondaryEditorHeight - toolbarFullHeight - spacing) + 'px'; + const imageNode = this.containerNode.querySelector('.ReactCrop__image'); const imageCopyNode = this.containerNode.querySelector('.ReactCrop__image-copy'); imageNode.style.maxHeight = height; diff --git a/packages/neos-ui-extensibility-webpack-adapter/package.json b/packages/neos-ui-extensibility-webpack-adapter/package.json index 11b1c17a26..28ad74adca 100644 --- a/packages/neos-ui-extensibility-webpack-adapter/package.json +++ b/packages/neos-ui-extensibility-webpack-adapter/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/neos-ui-extensibility-webpack-adapter", - "version": "8.3.2", + "version": "8.3.4", "description": "Minimal configuration, highly opinionated Webpack 4 + Babel plugin build stack for the Neos CMS UI", "repository": "neos/neos-ui", "bugs": "https://github.com/neos/neos-ui/issues", diff --git a/packages/neos-ui-extensibility/package.json b/packages/neos-ui-extensibility/package.json index 367cf59766..9af380ef96 100644 --- a/packages/neos-ui-extensibility/package.json +++ b/packages/neos-ui-extensibility/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/neos-ui-extensibility", - "version": "8.3.2", + "version": "8.3.4", "description": "Core of the extensibility mechanisms for the Neos UI", "repository": "neos/neos-ui", "bugs": "https://github.com/neos/neos-ui/issues", diff --git a/packages/neos-ui-guest-frame/package.json b/packages/neos-ui-guest-frame/package.json index cbfdd20266..7980490de1 100644 --- a/packages/neos-ui-guest-frame/package.json +++ b/packages/neos-ui-guest-frame/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/neos-ui-guest-frame", - "version": "8.3.2", + "version": "8.3.4", "description": "Guest frame initialization bindings", "private": true, "main": "./src/manifest.js", diff --git a/packages/neos-ui-i18n/package.json b/packages/neos-ui-i18n/package.json index fadbe22e5a..2f14a04980 100644 --- a/packages/neos-ui-i18n/package.json +++ b/packages/neos-ui-i18n/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/neos-ui-i18n", - "version": "8.3.2", + "version": "8.3.4", "description": "I18n utilities and components for Neos CMS UI.", "private": true, "main": "./src/index.tsx", diff --git a/packages/neos-ui-inspector/package.json b/packages/neos-ui-inspector/package.json index afc12c5ecc..3e165105b5 100644 --- a/packages/neos-ui-inspector/package.json +++ b/packages/neos-ui-inspector/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/neos-ui-inspector", - "version": "8.3.2", + "version": "8.3.4", "description": "Components for integrating views and editors into the Neos CMS UI inspector.", "private": true, "main": "./src/index.js", diff --git a/packages/neos-ui-redux-store/package.json b/packages/neos-ui-redux-store/package.json index 0e91025c62..88e8a07850 100644 --- a/packages/neos-ui-redux-store/package.json +++ b/packages/neos-ui-redux-store/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/neos-ui-redux-store", - "version": "8.3.2", + "version": "8.3.4", "description": "Redux store implementation for the Neos CMS UI", "private": true, "main": "./src/index.ts", diff --git a/packages/neos-ui-sagas/package.json b/packages/neos-ui-sagas/package.json index ca94be98ba..b719b11116 100644 --- a/packages/neos-ui-sagas/package.json +++ b/packages/neos-ui-sagas/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/neos-ui-sagas", - "version": "8.3.2", + "version": "8.3.4", "description": "Redux Sagas implementation for the Neos CMS UI", "private": true, "main": "src/index.js", diff --git a/packages/neos-ui-validators/package.json b/packages/neos-ui-validators/package.json index b2e336f7b6..3b9c64be65 100644 --- a/packages/neos-ui-validators/package.json +++ b/packages/neos-ui-validators/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/neos-ui-validators", - "version": "8.3.2", + "version": "8.3.4", "description": "Validators for Neos CMS UI.", "private": true, "main": "./src/index.ts", diff --git a/packages/neos-ui-views/package.json b/packages/neos-ui-views/package.json index bf999e6d7f..269104bff9 100644 --- a/packages/neos-ui-views/package.json +++ b/packages/neos-ui-views/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/neos-ui-views", - "version": "8.3.2", + "version": "8.3.4", "description": "Neos CMS UI Views for use in the inspector.", "main": "./src/index.js", "private": true, diff --git a/packages/neos-ui/package.json b/packages/neos-ui/package.json index e886227687..661b1d07ad 100644 --- a/packages/neos-ui/package.json +++ b/packages/neos-ui/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/neos-ui", - "version": "8.3.2", + "version": "8.3.4", "description": "Neos CMS UI written in ReactJS and a ton of other fun technology.", "private": true, "devDependencies": { diff --git a/packages/neos-ui/src/deprecated-plow.js b/packages/neos-ui/src/deprecated-plow.js index 92f3d93094..597950258c 100644 --- a/packages/neos-ui/src/deprecated-plow.js +++ b/packages/neos-ui/src/deprecated-plow.js @@ -1,10 +1,27 @@ /* eslint-disable */ // IDGAF import * as plowOriginal from 'plow-js'; +const MAX_WARNINGS = 20; + +let warningCount = 0; + +let isDev = undefined; + function augmentAndDeprecatedFunction(functionName, functionImplementation) { return function() { - if (window?.neos?.systemEnv?.startsWith('Development')) { - console.warn(`Plow.js "${functionName}" is deprecated! See: https://github.com/neos/neos-ui/issues/3425`); + if (isDev === undefined && window?.neos?.systemEnv) { + // if we are called before `window.neos` is set, we are in super early boot stage - in the manifest of a plugin + isDev = window.neos.systemEnv.startsWith('Development'); + } + if (isDev) { + if (warningCount < MAX_WARNINGS) { + ++warningCount; + console.error(`Warning: Plow.js "${functionName}" is deprecated! See: https://github.com/neos/neos-ui/issues/3425`); + } + if (warningCount === MAX_WARNINGS) { + ++warningCount; + console.error(`Warning: Further Plow.js deprecations will be ignored.`) + } } return functionImplementation.apply(this, arguments); }; diff --git a/packages/neos-ui/src/manifest.js b/packages/neos-ui/src/manifest.js index 87fcd05f64..7668d68c2c 100644 --- a/packages/neos-ui/src/manifest.js +++ b/packages/neos-ui/src/manifest.js @@ -20,6 +20,7 @@ import { import initializeContentDomNode from '@neos-project/neos-ui-guest-frame/src/initializeContentDomNode'; import style from '@neos-project/neos-ui-guest-frame/src/style.module.css'; +import backend from '@neos-project/neos-ui-backend-connector'; manifest('main', {}, globalRegistry => { // @@ -513,7 +514,7 @@ manifest('main', {}, globalRegistry => { // When the server advices to replace a node (e.g. on property change), put the delivered html to the // correct place inside the DOM // - serverFeedbackHandlers.set('Neos.Neos.Ui:ReloadContentOutOfBand/Main', (feedbackPayload, {store, globalRegistry}) => { + serverFeedbackHandlers.set('Neos.Neos.Ui:ReloadContentOutOfBand/Main', async (feedbackPayload, {store, globalRegistry}) => { const {contextPath, renderedContent, nodeDomAddress} = feedbackPayload; const domNode = nodeDomAddress && findNodeInGuestFrame( nodeDomAddress.contextPath, @@ -543,6 +544,27 @@ manifest('main', {}, globalRegistry => { const children = findAllChildNodes(contentElement); + // in case there are foreign referenced nodes, we need to put them into the store: + const uninitializedReferencedNodes = []; + for (const el of children) { + const contextPath = el.getAttribute('data-__neos-node-contextpath'); + if (!selectors.CR.Nodes.byContextPathSelector(contextPath)(store.getState())) { + uninitializedReferencedNodes.push(contextPath); + } + } + if (uninitializedReferencedNodes.length) { + const {q} = backend.get(); + const additionalNodes = await q(uninitializedReferencedNodes).get(); + if (additionalNodes.length) { + store.dispatch(actions.CR.Nodes.merge( + additionalNodes.reduce((carry, node) => { + carry[node.contextPath] = node; + return carry; + }, {}) + )); + } + } + const nodes = Object.assign( {[contextPath]: selectors.CR.Nodes.byContextPathSelector(contextPath)(store.getState())}, ...children.map(el => { diff --git a/packages/positional-array-sorter/package.json b/packages/positional-array-sorter/package.json index f6bf7d59ae..320363e5d7 100644 --- a/packages/positional-array-sorter/package.json +++ b/packages/positional-array-sorter/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/positional-array-sorter", - "version": "8.3.2", + "version": "8.3.4", "description": "Flexible array sorter that sorts an array according to a 'position' meta data.", "repository": "neos/neos-ui", "bugs": "https://github.com/neos/neos-ui/issues", diff --git a/packages/react-proptypes/package.json b/packages/react-proptypes/package.json index 0c82958dc0..1c1c2cf16a 100644 --- a/packages/react-proptypes/package.json +++ b/packages/react-proptypes/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/react-proptypes", - "version": "8.3.2", + "version": "8.3.4", "description": "Neos CMS specific proptypes for react", "private": true, "main": "./src/index.js", diff --git a/packages/react-ui-components/package.json b/packages/react-ui-components/package.json index e6b544b07a..811545dbcb 100644 --- a/packages/react-ui-components/package.json +++ b/packages/react-ui-components/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/react-ui-components", - "version": "8.3.2", + "version": "8.3.4", "description": "The UI components which power the Neos backend application.", "repository": "neos/neos-ui", "bugs": "https://github.com/neos/neos-ui/issues", diff --git a/packages/react-ui-components/src/DateInput/dateInput.tsx b/packages/react-ui-components/src/DateInput/dateInput.tsx index cfaf9d3ae6..9416d91dea 100644 --- a/packages/react-ui-components/src/DateInput/dateInput.tsx +++ b/packages/react-ui-components/src/DateInput/dateInput.tsx @@ -10,6 +10,9 @@ import {PickDefaultProps} from '../utils-typescript'; import Button from '../Button'; import Icon from '../Icon'; +// WHY: Because momentJs locales are not bundled automatically, we have to explicitly add them. +import 'moment/locale/de'; + export interface DateInputProps { /** * The Date instance which represents the selected value. diff --git a/packages/react-ui-components/src/Dialog/dialog.tsx b/packages/react-ui-components/src/Dialog/dialog.tsx index 144d810c0d..09c79c1db2 100644 --- a/packages/react-ui-components/src/Dialog/dialog.tsx +++ b/packages/react-ui-components/src/Dialog/dialog.tsx @@ -30,9 +30,9 @@ export interface DialogProps { readonly isOpen: boolean; /** - * The handler which gets called once the user clicks on the close symbol in the top right corner of the Dialog. + * An optional handler, which gets called once the user clicks on the close symbol in the top right corner of the Dialog. */ - readonly onRequestClose: () => void; + readonly onRequestClose?: () => void; /** * An optional boolean flag to keep the user in the dialog. @@ -99,7 +99,9 @@ class DialogWithOverlay extends PureComponent { this.startShaking(); return false; } - this.props.onRequestClose(); + if (this.props.onRequestClose) { + this.props.onRequestClose(); + } return true; } }; @@ -191,6 +193,7 @@ class DialogWithOverlay extends PureComponent { actions, theme, type, + preventClosing, onRequestClose, ...rest } = this.props; diff --git a/packages/utils-helpers/package.json b/packages/utils-helpers/package.json index 4c0421a233..7553008d7d 100644 --- a/packages/utils-helpers/package.json +++ b/packages/utils-helpers/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/utils-helpers", - "version": "8.3.2", + "version": "8.3.4", "description": "Helper functions for Neos CMS UI.", "private": true, "main": "./src/index.ts", diff --git a/packages/utils-logger/package.json b/packages/utils-logger/package.json index a5d485990f..9a812f3d29 100644 --- a/packages/utils-logger/package.json +++ b/packages/utils-logger/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/utils-logger", - "version": "8.3.2", + "version": "8.3.4", "description": "Logger implementation for Neos CMS UI.", "private": true, "main": "./src/index.ts", diff --git a/packages/utils-redux/package.json b/packages/utils-redux/package.json index c3f25e5fff..f057146f59 100644 --- a/packages/utils-redux/package.json +++ b/packages/utils-redux/package.json @@ -1,6 +1,6 @@ { "name": "@neos-project/utils-redux", - "version": "8.3.2", + "version": "8.3.4", "description": "Neos CMS UI Redux Helper utilitites", "private": true, "main": "./src/index.ts",