+ {
+ if (
+ e.altKey &&
+ e.ctrlKey &&
+ toolbar.current &&
+ !toolbar.current.classList.contains('__dev_on')
+ ) {
+ toolbar.current.classList.add('__dev_on');
+ }
+ }}
+ onMouseLeave={(e) => {
+ if (
+ toolbar.current &&
+ toolbar.current.classList.contains('__dev_on')
+ ) {
+ toolbar.current.classList.remove('__dev_on');
+ }
+ }}
+ onFocus={() => {}}
+ >
+
+
+
+
+ );
+};
+
+export default compose(
+ connect(
+ (state, props) => ({
+ content: state.content.data,
+ updateRequest: state.content.update,
+ pathname: props.location.pathname,
+ }),
+ {
+ updateContent,
+ },
+ ),
+)(CopyPaste);
diff --git a/src/components/theme/AppExtras/CopyPaste/index.js b/src/components/theme/AppExtras/CopyPaste/index.js
new file mode 100644
index 0000000..4b4d44fb
--- /dev/null
+++ b/src/components/theme/AppExtras/CopyPaste/index.js
@@ -0,0 +1,3 @@
+import CopyPaste from './CopyPaste';
+
+export default CopyPaste;
diff --git a/src/components/theme/AppExtras/CopyPaste/style.less b/src/components/theme/AppExtras/CopyPaste/style.less
new file mode 100644
index 0000000..965e963
--- /dev/null
+++ b/src/components/theme/AppExtras/CopyPaste/style.less
@@ -0,0 +1,18 @@
+#__developer_tools {
+ .ui.button {
+ color: #007eb1;
+ opacity: 0;
+ pointer-events: none;
+
+ &.disabled {
+ opacity: 0 !important;
+ }
+ }
+
+ &.__dev_on {
+ .ui.button {
+ opacity: 1;
+ pointer-events: all;
+ }
+ }
+}
diff --git a/src/components/theme/AppExtras/index.js b/src/components/theme/AppExtras/index.js
new file mode 100644
index 0000000..c049e45
--- /dev/null
+++ b/src/components/theme/AppExtras/index.js
@@ -0,0 +1,13 @@
+import CopyPaste from './CopyPaste';
+
+export default (config) => {
+ config.settings.appExtras = [
+ ...(config.settings.appExtras || []),
+ {
+ match: '/**/edit',
+ component: CopyPaste,
+ },
+ ];
+
+ return config;
+};
diff --git a/src/index.js b/src/index.js
index b5b04c4..6121174 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,6 +1,7 @@
import Forbidden from '@plone/volto/components/theme/Forbidden/Forbidden';
import Unauthorized from '@plone/volto/components/theme/Unauthorized/Unauthorized';
+import installAppExtras from '@eeacms/volto-forests-theme/components/theme/AppExtras';
import { installBlocks } from '@eeacms/volto-plotlycharts';
import { applyConfig as installFiseFrontend } from './localconfig';
@@ -11,7 +12,7 @@ import './slate-styles.css';
export default function applyConfig(config) {
// Add here your project's configuration here by modifying `config` accordingly
- config = [installBlocks, installFiseFrontend].reduce(
+ config = [installBlocks, installAppExtras, installFiseFrontend].reduce(
(acc, apply) => apply(acc),
config,
);