diff --git a/docker-compose.snapshots.update.yml b/docker-compose.snapshots.update.yml
index 1f975791..c84bea7d 100644
--- a/docker-compose.snapshots.update.yml
+++ b/docker-compose.snapshots.update.yml
@@ -3,7 +3,7 @@ services:
e2e:
image: cypress/included:8.4.1
container_name: wisemapping-integration-tests
- entrypoint: '/bin/sh -c "yarn install && yarn bootstrap && yarn test:integration"'
+ entrypoint: '/bin/sh -c "yarn bootstrap && yarn test:integration"'
working_dir: /e2e
environment:
- CYPRESS_imageSnaphots=true
diff --git a/docker-compose.snapshots.yml b/docker-compose.snapshots.yml
index 7e8517c6..e34927de 100644
--- a/docker-compose.snapshots.yml
+++ b/docker-compose.snapshots.yml
@@ -3,7 +3,7 @@ services:
e2e:
image: cypress/included:8.4.1
container_name: wisemapping-integration-tests
- entrypoint: '/bin/sh -c "yarn install && yarn bootstrap && yarn test:integration"'
+ entrypoint: '/bin/sh -c "yarn bootstrap && yarn test:integration"'
working_dir: /e2e
environment:
- CYPRESS_imageSnaphots=true
diff --git a/packages/editor/.babelrc b/packages/editor/.babelrc
new file mode 100644
index 00000000..fbd6da0e
--- /dev/null
+++ b/packages/editor/.babelrc
@@ -0,0 +1,6 @@
+{
+ "presets": [
+ "@babel/preset-env",
+ "@babel/preset-react"
+ ]
+}
\ No newline at end of file
diff --git a/packages/editor/.gitignore b/packages/editor/.gitignore
new file mode 100644
index 00000000..c96f2fe9
--- /dev/null
+++ b/packages/editor/.gitignore
@@ -0,0 +1,4 @@
+cypress/screenshots
+cypress/videos
+cypress/downloads
+cypress/snapshots/*/__diff_output__
\ No newline at end of file
diff --git a/packages/editor/cypress.json b/packages/editor/cypress.json
new file mode 100644
index 00000000..eb4dad54
--- /dev/null
+++ b/packages/editor/cypress.json
@@ -0,0 +1,6 @@
+{
+ "video": false,
+ "videoUploadOnPasses": false,
+ "baseUrl": "http://localhost:8081"
+ }
+
\ No newline at end of file
diff --git a/packages/editor/cypress/integration/playground.test.js b/packages/editor/cypress/integration/playground.test.js
new file mode 100644
index 00000000..34e19eb8
--- /dev/null
+++ b/packages/editor/cypress/integration/playground.test.js
@@ -0,0 +1,22 @@
+context('Playground', () => {
+ it('viewmode page should match its snapshot', () => {
+ ['welcome', 'sample1', 'sample2', 'sample3', 'sample4', 'sample5', 'sample6', 'complex', 'img-support', 'icon-sample'].forEach((mapId) => {
+ cy.visit(`/viewmode.html?id=${mapId}`);
+ cy.get('#mindplot.ready').should('exist');
+ cy.matchImageSnapshot(`viewmode-${mapId}`);
+ });
+ });
+ it('the playground container.html page should match its snapshot', () => {
+ cy.visit('/container.html');
+ cy.getIframeBody()
+ .find('#mindplot.ready')
+ .should('exist');
+ cy.matchImageSnapshot('container');
+ });
+ it('the playground editor.html page should match its snapshot', () => {
+ cy.visit('/editor.html');
+ cy.get('#mindplot.ready').should('exist');
+ // TODO: why is the editor appearing twice in the snapshot?
+ cy.matchImageSnapshot('editor');
+ });
+});
diff --git a/packages/editor/cypress/plugins/index.js b/packages/editor/cypress/plugins/index.js
new file mode 100644
index 00000000..8a0fa140
--- /dev/null
+++ b/packages/editor/cypress/plugins/index.js
@@ -0,0 +1,24 @@
+///
+// ***********************************************************
+// This example plugins/index.js can be used to load plugins
+//
+// You can change the location of this file or turn off loading
+// the plugins file with the 'pluginsFile' configuration option.
+//
+// You can read more here:
+// https://on.cypress.io/plugins-guide
+// ***********************************************************
+
+// This function is called when a project is opened or re-opened (e.g. due to
+// the project's config changing)
+
+const { addMatchImageSnapshotPlugin } = require('cypress-image-snapshot/plugin');
+
+/**
+ * @type {Cypress.PluginConfig}
+ */
+module.exports = (on, config) => {
+ // `on` is used to hook into various events Cypress emits
+ // `config` is the resolved Cypress config
+ addMatchImageSnapshotPlugin(on, config);
+};
diff --git a/packages/mindplot/cypress/snapshots/playground.test.js/container.snap.png b/packages/editor/cypress/snapshots/playground.test.js/container.snap.png
similarity index 60%
rename from packages/mindplot/cypress/snapshots/playground.test.js/container.snap.png
rename to packages/editor/cypress/snapshots/playground.test.js/container.snap.png
index 872ba950..61be91e5 100644
Binary files a/packages/mindplot/cypress/snapshots/playground.test.js/container.snap.png and b/packages/editor/cypress/snapshots/playground.test.js/container.snap.png differ
diff --git a/packages/mindplot/cypress/snapshots/playground.test.js/editor.snap.png b/packages/editor/cypress/snapshots/playground.test.js/editor.snap.png
similarity index 100%
rename from packages/mindplot/cypress/snapshots/playground.test.js/editor.snap.png
rename to packages/editor/cypress/snapshots/playground.test.js/editor.snap.png
diff --git a/packages/editor/cypress/snapshots/playground.test.js/viewmode-complex.snap.png b/packages/editor/cypress/snapshots/playground.test.js/viewmode-complex.snap.png
new file mode 100644
index 00000000..9a065ecc
Binary files /dev/null and b/packages/editor/cypress/snapshots/playground.test.js/viewmode-complex.snap.png differ
diff --git a/packages/editor/cypress/snapshots/playground.test.js/viewmode-icon-sample.snap.png b/packages/editor/cypress/snapshots/playground.test.js/viewmode-icon-sample.snap.png
new file mode 100644
index 00000000..dbb9e087
Binary files /dev/null and b/packages/editor/cypress/snapshots/playground.test.js/viewmode-icon-sample.snap.png differ
diff --git a/packages/editor/cypress/snapshots/playground.test.js/viewmode-img-support.snap.png b/packages/editor/cypress/snapshots/playground.test.js/viewmode-img-support.snap.png
new file mode 100644
index 00000000..ae923ab2
Binary files /dev/null and b/packages/editor/cypress/snapshots/playground.test.js/viewmode-img-support.snap.png differ
diff --git a/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample1.snap.png b/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample1.snap.png
new file mode 100644
index 00000000..dc297a0e
Binary files /dev/null and b/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample1.snap.png differ
diff --git a/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample2.snap.png b/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample2.snap.png
new file mode 100644
index 00000000..a9b5c353
Binary files /dev/null and b/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample2.snap.png differ
diff --git a/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample3.snap.png b/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample3.snap.png
new file mode 100644
index 00000000..9bd2609d
Binary files /dev/null and b/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample3.snap.png differ
diff --git a/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample4.snap.png b/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample4.snap.png
new file mode 100644
index 00000000..42e2cfb3
Binary files /dev/null and b/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample4.snap.png differ
diff --git a/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample5.snap.png b/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample5.snap.png
new file mode 100644
index 00000000..d018fefd
Binary files /dev/null and b/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample5.snap.png differ
diff --git a/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample6.snap.png b/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample6.snap.png
new file mode 100644
index 00000000..b4fdfcc7
Binary files /dev/null and b/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample6.snap.png differ
diff --git a/packages/editor/cypress/snapshots/playground.test.js/viewmode-welcome.snap.png b/packages/editor/cypress/snapshots/playground.test.js/viewmode-welcome.snap.png
new file mode 100644
index 00000000..d927782c
Binary files /dev/null and b/packages/editor/cypress/snapshots/playground.test.js/viewmode-welcome.snap.png differ
diff --git a/packages/editor/cypress/support/commands.js b/packages/editor/cypress/support/commands.js
new file mode 100644
index 00000000..85cef3a6
--- /dev/null
+++ b/packages/editor/cypress/support/commands.js
@@ -0,0 +1,24 @@
+import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command';
+
+// make matchImageSnapshot() call the real implementation only if CYPRESS_imageSnaphots is set
+// otherwise it calls a noop
+if (Cypress.env('imageSnaphots')) {
+ addMatchImageSnapshotCommand({
+ failureThreshold: 0.001,
+ failureThresholdType: 'percent',
+ });
+} else {
+ Cypress.Commands.add(
+ 'matchImageSnapshot',
+ {
+ prevSubject: ['optional', 'element', 'window', 'document'],
+ },
+ () => Promise.resolve(),
+ );
+}
+
+// https://www.cypress.io/blog/2020/02/12/working-with-iframes-in-cypress/
+Cypress.Commands.add('getIframeBody', () => cy
+ .get('iframe')
+ .its('0.contentDocument.body').should('not.be.empty')
+ .then(cy.wrap));
diff --git a/packages/editor/cypress/support/index.js b/packages/editor/cypress/support/index.js
new file mode 100644
index 00000000..37a498fb
--- /dev/null
+++ b/packages/editor/cypress/support/index.js
@@ -0,0 +1,20 @@
+// ***********************************************************
+// This example support/index.js is processed and
+// loaded automatically before your test files.
+//
+// This is a great place to put global configuration and
+// behavior that modifies Cypress.
+//
+// You can change the location of this file or turn off
+// automatically serving support files with the
+// 'supportFile' configuration option.
+//
+// You can read more here:
+// https://on.cypress.io/configuration
+// ***********************************************************
+
+// Import commands.js using ES2015 syntax:
+import './commands';
+
+// Alternatively you can use CommonJS syntax:
+// require('./commands')
diff --git a/packages/mindplot/test/playground/map-render/images/account.svg b/packages/editor/images/account.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/account.svg
rename to packages/editor/images/account.svg
diff --git a/packages/mindplot/test/playground/map-render/images/add.svg b/packages/editor/images/add.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/add.svg
rename to packages/editor/images/add.svg
diff --git a/packages/mindplot/test/playground/map-render/images/ajax-loader.gif b/packages/editor/images/ajax-loader.gif
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/ajax-loader.gif
rename to packages/editor/images/ajax-loader.gif
diff --git a/packages/mindplot/test/playground/map-render/images/back-icon.svg b/packages/editor/images/back-icon.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/back-icon.svg
rename to packages/editor/images/back-icon.svg
diff --git a/packages/mindplot/test/playground/map-render/images/center_focus.svg b/packages/editor/images/center_focus.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/center_focus.svg
rename to packages/editor/images/center_focus.svg
diff --git a/packages/mindplot/test/playground/map-render/images/discard.svg b/packages/editor/images/discard.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/discard.svg
rename to packages/editor/images/discard.svg
diff --git a/packages/mindplot/test/playground/map-render/images/export.svg b/packages/editor/images/export.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/export.svg
rename to packages/editor/images/export.svg
diff --git a/packages/mindplot/test/playground/map-render/images/favicon.ico b/packages/editor/images/favicon.ico
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/favicon.ico
rename to packages/editor/images/favicon.ico
diff --git a/packages/mindplot/test/playground/map-render/images/favicon.png b/packages/editor/images/favicon.png
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/favicon.png
rename to packages/editor/images/favicon.png
diff --git a/packages/mindplot/test/playground/map-render/images/font-bold.svg b/packages/editor/images/font-bold.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/font-bold.svg
rename to packages/editor/images/font-bold.svg
diff --git a/packages/mindplot/test/playground/map-render/images/font-color.svg b/packages/editor/images/font-color.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/font-color.svg
rename to packages/editor/images/font-color.svg
diff --git a/packages/mindplot/test/playground/map-render/images/font-italic.svg b/packages/editor/images/font-italic.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/font-italic.svg
rename to packages/editor/images/font-italic.svg
diff --git a/packages/mindplot/test/playground/map-render/images/font-size.svg b/packages/editor/images/font-size.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/font-size.svg
rename to packages/editor/images/font-size.svg
diff --git a/packages/mindplot/test/playground/map-render/images/font-type.svg b/packages/editor/images/font-type.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/font-type.svg
rename to packages/editor/images/font-type.svg
diff --git a/packages/mindplot/test/playground/map-render/images/history.svg b/packages/editor/images/history.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/history.svg
rename to packages/editor/images/history.svg
diff --git a/packages/mindplot/test/playground/map-render/images/keyboard.svg b/packages/editor/images/keyboard.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/keyboard.svg
rename to packages/editor/images/keyboard.svg
diff --git a/packages/mindplot/test/playground/map-render/images/logo-small.svg b/packages/editor/images/logo-small.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/logo-small.svg
rename to packages/editor/images/logo-small.svg
diff --git a/packages/mindplot/test/playground/map-render/images/logo-text-black.svg b/packages/editor/images/logo-text-black.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/logo-text-black.svg
rename to packages/editor/images/logo-text-black.svg
diff --git a/packages/mindplot/test/playground/map-render/images/minus.svg b/packages/editor/images/minus.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/minus.svg
rename to packages/editor/images/minus.svg
diff --git a/packages/mindplot/test/playground/map-render/images/note-add.svg b/packages/editor/images/note-add.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/note-add.svg
rename to packages/editor/images/note-add.svg
diff --git a/packages/mindplot/test/playground/map-render/images/print.svg b/packages/editor/images/print.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/print.svg
rename to packages/editor/images/print.svg
diff --git a/packages/editor/images/public.svg b/packages/editor/images/public.svg
new file mode 100644
index 00000000..ddcd5677
--- /dev/null
+++ b/packages/editor/images/public.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/packages/mindplot/test/playground/map-render/images/pwrdby-white.svg b/packages/editor/images/pwrdby-white.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/pwrdby-white.svg
rename to packages/editor/images/pwrdby-white.svg
diff --git a/packages/mindplot/test/playground/map-render/images/redo.svg b/packages/editor/images/redo.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/redo.svg
rename to packages/editor/images/redo.svg
diff --git a/packages/mindplot/test/playground/map-render/images/save.svg b/packages/editor/images/save.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/save.svg
rename to packages/editor/images/save.svg
diff --git a/packages/mindplot/test/playground/map-render/images/topic-add.svg b/packages/editor/images/topic-add.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/topic-add.svg
rename to packages/editor/images/topic-add.svg
diff --git a/packages/mindplot/test/playground/map-render/images/topic-border.svg b/packages/editor/images/topic-border.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/topic-border.svg
rename to packages/editor/images/topic-border.svg
diff --git a/packages/mindplot/test/playground/map-render/images/topic-color.svg b/packages/editor/images/topic-color.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/topic-color.svg
rename to packages/editor/images/topic-color.svg
diff --git a/packages/mindplot/test/playground/map-render/images/topic-delete.svg b/packages/editor/images/topic-delete.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/topic-delete.svg
rename to packages/editor/images/topic-delete.svg
diff --git a/packages/mindplot/test/playground/map-render/images/topic-icon.svg b/packages/editor/images/topic-icon.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/topic-icon.svg
rename to packages/editor/images/topic-icon.svg
diff --git a/packages/mindplot/test/playground/map-render/images/topic-link.svg b/packages/editor/images/topic-link.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/topic-link.svg
rename to packages/editor/images/topic-link.svg
diff --git a/packages/mindplot/test/playground/map-render/images/topic-note.svg b/packages/editor/images/topic-note.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/topic-note.svg
rename to packages/editor/images/topic-note.svg
diff --git a/packages/mindplot/test/playground/map-render/images/topic-notes.svg b/packages/editor/images/topic-notes.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/topic-notes.svg
rename to packages/editor/images/topic-notes.svg
diff --git a/packages/mindplot/test/playground/map-render/images/topic-relation.svg b/packages/editor/images/topic-relation.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/topic-relation.svg
rename to packages/editor/images/topic-relation.svg
diff --git a/packages/mindplot/test/playground/map-render/images/topic-shape.svg b/packages/editor/images/topic-shape.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/topic-shape.svg
rename to packages/editor/images/topic-shape.svg
diff --git a/packages/mindplot/test/playground/map-render/images/undo.svg b/packages/editor/images/undo.svg
similarity index 100%
rename from packages/mindplot/test/playground/map-render/images/undo.svg
rename to packages/editor/images/undo.svg
diff --git a/packages/editor/index.html b/packages/editor/index.html
deleted file mode 100644
index 453c01d8..00000000
--- a/packages/editor/index.html
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-