Skip to content

Commit

Permalink
Merge pull request #62 from Sebobo/task/update-8-3
Browse files Browse the repository at this point in the history
TASK: Update build, bump minimum Neos version and resolve plow-js deprecation warning
  • Loading branch information
Sebobo committed Apr 30, 2023
2 parents 2f3f738 + 46826d5 commit 6c945af
Show file tree
Hide file tree
Showing 12 changed files with 1,350 additions and 4,641 deletions.
15 changes: 0 additions & 15 deletions .eslintrc

This file was deleted.

25 changes: 25 additions & 0 deletions .eslintrc.js
@@ -0,0 +1,25 @@
module.exports = {
root: true,
parserOptions: {
sourceType: "module",
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:prettier/recommended",
],
plugins: ["prettier", "react"],
settings: {
react: {
version: "detect",
},
},
env: {
node: true,
es6: true,
},
rules: {
"react/prop-types": "off",
"prettier/prettier": ["error"],
},
};
2 changes: 1 addition & 1 deletion .gitattributes
Expand Up @@ -7,7 +7,7 @@ Plugin.css binary
/.yarn export-ignore
/Resources/Private/Scripts export-ignore
/.editorconfig export-ignore
/.eslintrc export-ignore
/.eslintrc.js export-ignore
/.nvmrc export-ignore
/.yarnrc.yml export-ignore
/package.json export-ignore
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
@@ -1 +1 @@
14
16
30 changes: 14 additions & 16 deletions Resources/Private/Scripts/HyphensEditor/package.json
@@ -1,18 +1,16 @@
{
"name": "hyphens-editor",
"version": "1.0.0",
"scripts": {
"build": "NODE_ENV=production neos-react-scripts build",
"watch": "neos-react-scripts watch"
},
"devDependencies": {
"@ckeditor/ckeditor5-engine": "^13.1.1",
"@ckeditor/ckeditor5-widget": "^10.3.1",
"@neos-project/eslint-config-neos": "^2.6.1",
"@neos-project/neos-ui-extensibility": "^4.0.0",
"@neos-project/react-ui-components": "^4.0.0"
},
"neos": {
"buildTargetDirectory": "../../../Public/HyphensEditor"
}
"name": "hyphens-editor",
"version": "1.0.0",
"scripts": {
"build": "NODE_ENV=production neos-react-scripts build",
"watch": "neos-react-scripts watch"
},
"devDependencies": {
"@neos-project/neos-ui-extensibility": "^8.3.0",
"@neos-project/neos-ui-extensibility-webpack-adapter": "^8.3.0",
"@neos-project/react-ui-components": "^8.3.0"
},
"neos": {
"buildTargetDirectory": "../../../Public/HyphensEditor"
}
}
14 changes: 6 additions & 8 deletions Resources/Private/Scripts/HyphensEditor/src/manifest.config.js
@@ -1,20 +1,18 @@
import {$add, $get} from 'plow-js';
import HyphensFactory from "./plugins/hyphens";

import HyphensFactory from './plugins/hyphens';

const addPlugin = (Plugin, isEnabled) => (ckEditorConfiguration, options) => {
if (!isEnabled || isEnabled(options.editorOptions, options)) {
const addPlugin = (Plugin) => (ckEditorConfiguration, options) => {
if (options.editorOptions.nbsp || options.editorOptions.hyphens) {
ckEditorConfiguration.plugins = ckEditorConfiguration.plugins || [];
return $add('plugins', Plugin, ckEditorConfiguration);
ckEditorConfiguration.plugins.push(Plugin);
}
return ckEditorConfiguration;
};

export default (ckEditorRegistry, editorConfig) => {
const config = ckEditorRegistry.get('config');
const config = ckEditorRegistry.get("config");

const HyphensPlugin = HyphensFactory(editorConfig);
config.set('hyphens', addPlugin(HyphensPlugin, $get('hyphens') || $get('nbsp')));
config.set("hyphens", addPlugin(HyphensPlugin));

return config;
};
@@ -1,11 +1,11 @@
import React, {PureComponent} from 'react';
import PropTypes from 'prop-types';
import {$get} from 'plow-js';
import {Button} from '@neos-project/react-ui-components';
import {neos} from '@neos-project/neos-ui-decorators';
import buttonTheme from './hyphensButtonTheme.css';
import {themr} from '@friendsofreactjs/react-css-themr';

import buttonTheme from './hyphensButtonTheme.css';

const BUTTON_PROPS = ['formattingRule', 'inlineEditorOptions', 'i18nRegistry', 'tooltip', 'isActive', 'label'];

@neos(globalRegistry => ({
Expand All @@ -27,9 +27,9 @@ class HyphenButtonComponent extends PureComponent {
<Button {...finalProps} isActive={Boolean(this.props.isActive)} className={buttonTheme['btn--no-padding']}
title={this.props.i18nRegistry.translate(this.props.tooltip)}>
<svg xmlns="http://www.w3.org/2000/svg" width="18.109" height="9.697" viewBox="0, 0, 18.109, 9.697">
<g stroke="currentColor" stroke-miterlimit="3.864" fill="none">
<path d="M2.596 1a5.44 5.44 0 0 0 0 7.697m12.918 0a5.44 5.44 0 0 0 0-7.697" stroke-width=".907"/>
<path d="M4.52 4.848h9.07" stroke-width="1.814"/>
<g stroke="currentColor" strokeMiterlimit="3.864" fill="none">
<path d="M2.596 1a5.44 5.44 0 0 0 0 7.697m12.918 0a5.44 5.44 0 0 0 0-7.697" strokeWidth=".907"/>
<path d="M4.52 4.848h9.07" strokeWidth="1.814"/>
</g>
</svg>
</Button>
Expand Down Expand Up @@ -57,8 +57,8 @@ class NbspButtonComponent extends PureComponent {
<Button {...finalProps} isActive={Boolean(this.props.isActive)} className={buttonTheme['btn--no-padding']}
title={this.props.i18nRegistry.translate(this.props.tooltip)}>
<svg width="18px" height="9px" viewBox="0 0 18 9" version="1.1" xmlns="http://www.w3.org/2000/svg">
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="square">
<path d="M16.3846154,2.61538462 L16.3846154,7.53846154 M16.3846154,7.53846154 L1.61538462,7.53846154 M1.61538462,2.61538462 L1.61538462,7.53846154" id="Combined-Shape" stroke="#FFFFFF" stroke-width="1.8"></path>
<g stroke="none" strokeWidth="1" fill="none" fillRule="evenodd" strokeLinecap="square">
<path d="M16.3846154,2.61538462 L16.3846154,7.53846154 M16.3846154,7.53846154 L1.61538462,7.53846154 M1.61538462,2.61538462 L1.61538462,7.53846154" id="Combined-Shape" stroke="#FFFFFF" strokeWidth="1.8"></path>
</g>
</svg>
</Button>
Expand All @@ -80,8 +80,8 @@ export default ckEditorRegistry => {
style: 'transparent',
hoverStyle: 'brand',
tooltip: 'Shel.Neos.Hyphens:Main:ckeditor__toolbar__shy',
isVisible: $get('hyphens'),
isActive: $get('shy')
isVisible: (config, bar, foo) => config.hyphens,
isActive: (config) => config.hyphens,
});

richtextToolbar.set('nbsp', {
Expand All @@ -92,8 +92,8 @@ export default ckEditorRegistry => {
style: 'transparent',
hoverStyle: 'brand',
tooltip: 'Shel.Neos.Hyphens:Main:ckeditor__toolbar__nbsp',
isVisible: $get('nbsp'),
isActive: $get('nbsp'),
isVisible: (config) => config.nbsp,
isActive: (config) => config.nbsp,
});

return richtextToolbar;
Expand Down
2 changes: 0 additions & 2 deletions Resources/Public/HyphensEditor/Plugin.css
Expand Up @@ -45,5 +45,3 @@
border-right: 0.2ch solid currentColor;
}


/*# sourceMappingURL=Plugin.css.map*/
17 changes: 1 addition & 16 deletions Resources/Public/HyphensEditor/Plugin.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -20,8 +20,8 @@
}
],
"require": {
"neos/neos": "^4.3 || ^5.0 || ^7.0 || ^8.0 || dev-master",
"neos/neos-ui": "^4.0 || ^5.0 || ^7.0 || ^8.0 || dev-master"
"neos/neos": "^7.3 || ^8.0",
"neos/neos-ui": "^7.3 || ^8.0"
},
"extra": {
"neos": {
Expand Down
43 changes: 28 additions & 15 deletions package.json
@@ -1,17 +1,30 @@
{
"description": "Shel.Neos:HyphensEditor",
"license": "GPL-3.0-or-later",
"version": "1.0.0",
"private": true,
"engines": {
"node": ">=14"
},
"scripts": {
"build": "yarn workspace hyphens-editor run build",
"watch": "yarn workspace hyphens-editor run watch"
},
"workspaces": [
"Resources/Private/Scripts/*"
],
"packageManager": "yarn@3.3.0"
"description": "Shel.Neos:HyphensEditor",
"license": "GPL-3.0-or-later",
"version": "1.0.0",
"private": true,
"engines": {
"node": ">=16"
},
"scripts": {
"build": "yarn workspace hyphens-editor run build",
"watch": "yarn workspace hyphens-editor run watch"
},
"workspaces": [
"Resources/Private/Scripts/*"
],
"devDependencies": {
"eslint": "^7.32.0",
"eslint-config-prettier": "^7.2.0",
"eslint-plugin-prettier": "^3.4.1",
"eslint-plugin-react": "^7.31.10",
"prettier": "^2.7.1"
},
"packageManager": "yarn@3.3.0",
"prettier": {
"printWidth": 120,
"semi": true,
"singleQuote": true,
"tabWidth": 4
}
}

0 comments on commit 6c945af

Please sign in to comment.