From 983eb72892ebf2e00d739f3bdf2fdfb33517fd38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Farkas=20J=C3=B3zsef?= Date: Fri, 20 Jan 2017 02:03:27 +0100 Subject: [PATCH] Seperate electron and web target building --- .travis.yml | 1 - electron/README.md | 2 + electron/src/.gitignore | 1 + electron/src/app.module.ts | 166 ++ electron/src/components/keymap/edit/index.ts | 1 + .../keymap/edit/keymap-edit.component.ts | 38 +- electron/src/components/keymap/index.ts | 1 + .../src/components/keymap/keymap.routes.ts | 26 + {src => electron/src}/electron-main.ts | 2 +- {src => electron/src}/index.html | 0 {src => electron/src}/main-app/index.ts | 0 .../src}/main-app/main-app.component.ts | 4 +- .../src}/main-app/main-app.routes.ts | 6 +- electron/src/main.ts | 5 + .../src}/services/uhk-device.service.ts | 7 +- electron/src/tsconfig-electron-main.json | 22 + electron/src/tsconfig.json | 29 + .../src/webpack.config.electron-main.js | 6 +- electron/src/webpack.config.js | 94 + package.json | 19 +- {src => shared/src}/agent-config.json | 0 .../components/add-on/add-on.component.html | 0 .../components/add-on/add-on.component.scss | 0 .../components/add-on/add-on.component.ts | 0 .../src}/components/add-on/add-on.routes.ts | 0 .../src}/components/add-on/index.ts | 0 .../src}/components/keyboard/index.ts | 0 .../src}/components/keyboard/slider/index.ts | 0 .../slider/keyboard-slider.component.html | 0 .../slider/keyboard-slider.component.scss | 0 .../slider/keyboard-slider.component.ts | 0 .../keymap/add/keymap-add.component.html | 0 .../keymap/add/keymap-add.component.scss | 0 .../keymap/add/keymap-add.component.ts | 0 .../src}/components/keymap/edit/index.ts | 0 .../keymap/edit/keymap-edit-guard.service.ts | 0 .../keymap/edit/keymap-edit.component.html | 0 .../keymap/edit/keymap-edit.component.scss | 0 .../keymap/edit/keymap-edit.component.ts | 44 + .../header/keymap-header.component.html | 0 .../header/keymap-header.component.scss | 2 +- .../keymap/header/keymap-header.component.ts | 0 .../src}/components/keymap/index.ts | 1 - .../src}/components/layers/index.ts | 0 .../components/layers/layers.component.html | 0 .../components/layers/layers.component.scss | 0 .../components/layers/layers.component.ts | 0 .../components/macro/action-editor/index.ts | 0 .../macro-action-editor.component.html | 0 .../macro-action-editor.component.scss | 2 +- .../macro-action-editor.component.ts | 0 .../macro/action-editor/tab/delay/index.ts | 0 .../tab/delay/macro-delay.component.html | 0 .../tab/delay/macro-delay.component.scss | 0 .../tab/delay/macro-delay.component.ts | 0 .../macro/action-editor/tab/index.ts | 0 .../macro/action-editor/tab/key/index.ts | 0 .../tab/key/macro-key.component.html | 0 .../tab/key/macro-key.component.scss | 0 .../tab/key/macro-key.component.ts | 0 .../macro/action-editor/tab/mouse/index.ts | 0 .../tab/mouse/macro-mouse.component.html | 0 .../tab/mouse/macro-mouse.component.scss | 0 .../tab/mouse/macro-mouse.component.ts | 0 .../macro/action-editor/tab/text/index.ts | 0 .../tab/text/macro-text.component.html | 0 .../tab/text/macro-text.component.scss | 0 .../tab/text/macro-text.component.ts | 0 .../macro/edit/macro-edit.component.html | 0 .../macro/edit/macro-edit.component.scss | 0 .../macro/edit/macro-edit.component.ts | 0 .../macro/header/macro-header.component.html | 0 .../macro/header/macro-header.component.scss | 2 +- .../macro/header/macro-header.component.ts | 0 {src => shared/src}/components/macro/index.ts | 0 .../src}/components/macro/item/index.ts | 0 .../macro/item/macro-item.component.html | 0 .../macro/item/macro-item.component.scss | 2 +- .../macro/item/macro-item.component.ts | 0 .../macro/list/macro-list.component.html | 0 .../macro/list/macro-list.component.scss | 2 +- .../macro/list/macro-list.component.ts | 0 .../src}/components/macro/macro.routes.ts | 0 .../src}/components/macro/not-found/index.ts | 0 .../macro-not-found-guard.service.ts | 0 .../not-found/macro-not-found.component.html | 0 .../not-found/macro-not-found.component.scss | 0 .../not-found/macro-not-found.component.ts | 0 .../src}/components/notification/index.ts | 0 .../notification/notification.component.html | 0 .../notification/notification.component.scss | 0 .../notification/notification.component.ts | 0 .../src}/components/popover/index.ts | 0 .../components/popover/popover.component.html | 0 .../components/popover/popover.component.scss | 0 .../components/popover/popover.component.ts | 0 .../src}/components/popover/tab/index.ts | 0 .../components/popover/tab/keymap/index.ts | 0 .../tab/keymap/keymap-tab.component.html | 0 .../tab/keymap/keymap-tab.component.scss | 0 .../tab/keymap/keymap-tab.component.ts | 0 .../components/popover/tab/keypress/index.ts | 0 .../tab/keypress/keypress-tab.component.html | 0 .../tab/keypress/keypress-tab.component.scss | 0 .../tab/keypress/keypress-tab.component.ts | 0 .../popover/tab/keypress/longPress.json | 0 .../popover/tab/keypress/scancodes.json | 0 .../components/popover/tab/layer/index.ts | 0 .../tab/layer/layer-tab.component.html | 0 .../tab/layer/layer-tab.component.scss | 0 .../popover/tab/layer/layer-tab.component.ts | 0 .../components/popover/tab/macro/index.ts | 0 .../tab/macro/macro-tab.component.html | 0 .../tab/macro/macro-tab.component.scss | 0 .../popover/tab/macro/macro-tab.component.ts | 0 .../components/popover/tab/mouse/index.ts | 0 .../tab/mouse/mouse-tab.component.html | 0 .../tab/mouse/mouse-tab.component.scss | 2 +- .../popover/tab/mouse/mouse-tab.component.ts | 0 .../src}/components/popover/tab/none/index.ts | 0 .../popover/tab/none/none-tab.component.html | 0 .../popover/tab/none/none-tab.component.scss | 0 .../popover/tab/none/none-tab.component.ts | 0 .../src}/components/popover/tab/tab.ts | 0 .../capture-keystroke-button.component.html | 0 .../capture-keystroke-button.component.scss | 0 .../capture-keystroke-button.component.ts | 0 .../widgets/capture-keystroke/index.ts | 0 .../popover/widgets/icon/icon.component.html | 0 .../popover/widgets/icon/icon.component.scss | 2 +- .../popover/widgets/icon/icon.component.ts | 0 .../components/popover/widgets/icon/index.ts | 0 .../src}/components/settings/index.ts | 0 .../settings/settings.component.html | 0 .../settings/settings.component.scss | 0 .../components/settings/settings.component.ts | 0 .../components/settings/settings.routes.ts | 0 .../src}/components/side-menu/index.ts | 0 .../side-menu/side-menu.component.html | 0 .../side-menu/side-menu.component.scss | 0 .../side-menu/side-menu.component.ts | 0 .../src}/components/svg/keyboard/index.ts | 0 .../svg/keyboard/svg-keyboard.component.html | 0 .../svg/keyboard/svg-keyboard.component.scss | 0 .../svg/keyboard/svg-keyboard.component.ts | 2 +- .../src}/components/svg/keys/index.ts | 0 .../svg/keys/svg-icon-text-key/index.ts | 0 .../svg-icon-text-key.component.html | 0 .../svg-icon-text-key.component.ts | 0 .../svg/keys/svg-keyboard-key/index.ts | 0 .../svg-keyboard-key.component.html | 0 .../svg-keyboard-key.component.scss | 0 .../svg-keyboard-key.component.ts | 0 .../svg-keyboard-key.model.ts | 0 .../svg/keys/svg-keystroke-key/index.ts | 0 .../svg-keystroke-key.component.html | 0 .../svg-keystroke-key.component.scss | 0 .../svg-keystroke-key.component.ts | 0 .../svg/keys/svg-mouse-click-key/index.ts | 0 .../svg-mouse-click-key.html | 0 .../svg-mouse-click-key.ts | 0 .../svg/keys/svg-mouse-key/index.ts | 0 .../svg/keys/svg-mouse-key/svg-mouse-key.html | 0 .../svg/keys/svg-mouse-key/svg-mouse-key.ts | 0 .../svg/keys/svg-mouse-move-key/index.ts | 0 .../svg-mouse-move-key.html | 0 .../svg-mouse-move-key/svg-mouse-move-key.ts | 0 .../svg/keys/svg-mouse-scroll-key/index.ts | 0 .../svg-mouse-scroll-key.html | 0 .../svg-mouse-scroll-key.ts | 0 .../svg/keys/svg-mouse-speed-key/index.ts | 0 .../svg-mouse-speed-key.html | 0 .../svg-mouse-speed-key.ts | 0 .../svg/keys/svg-one-line-text-key/index.ts | 0 .../svg-one-line-text-key.component.html | 0 .../svg-one-line-text-key.component.ts | 0 .../svg/keys/svg-single-icon-key/index.ts | 0 .../svg-single-icon-key.component.html | 0 .../svg-single-icon-key.component.ts | 0 .../svg/keys/svg-switch-keymap-key/index.ts | 0 .../svg-switch-keymap-key.component.html | 0 .../svg-switch-keymap-key.component.ts | 0 .../svg/keys/svg-text-icon-key/index.ts | 0 .../svg-text-icon-key.component.html | 0 .../svg-text-icon-key.component.ts | 0 .../svg/keys/svg-two-line-text-key/index.ts | 0 .../svg-two-line-text-key.component.html | 0 .../svg-two-line-text-key.component.ts | 0 .../src}/components/svg/module/index.ts | 0 .../svg/module/svg-module.component.html | 0 .../svg/module/svg-module.component.scss | 0 .../svg/module/svg-module.component.ts | 0 .../components/svg/module/svg-module.model.ts | 0 .../src}/components/svg/wrap/index.ts | 0 .../svg/wrap/svg-keyboard-wrap.component.html | 0 .../svg/wrap/svg-keyboard-wrap.component.scss | 0 .../svg/wrap/svg-keyboard-wrap.component.ts | 0 .../src}/config-serializer/Function.d.ts | 0 .../src}/config-serializer/README.md | 0 .../src}/config-serializer/UhkBuffer.ts | 0 .../src}/config-serializer/assert.ts | 0 .../config-items/HardwareConfiguration.ts | 0 .../config-items/KeyModifiers.ts | 0 .../config-serializer/config-items/Keymap.ts | 0 .../config-serializer/config-items/Layer.ts | 0 .../config-items/LongPressAction.ts | 0 .../config-serializer/config-items/Macro.ts | 0 .../config-serializer/config-items/Module.ts | 0 .../config-items/ModuleConfiguration.ts | 0 .../config-items/UserConfiguration.ts | 0 .../config-items/key-action/KeyAction.ts | 0 .../key-action/KeystrokeAction.ts | 0 .../config-items/key-action/MouseAction.ts | 0 .../config-items/key-action/NoneAction.ts | 0 .../key-action/PlayMacroAction.ts | 0 .../key-action/SwitchKeymapAction.ts | 0 .../key-action/SwitchLayerAction.ts | 0 .../config-items/key-action/helper.ts | 0 .../config-items/key-action/index.ts | 0 .../macro-action/DelayMacroAction.ts | 0 .../macro-action/EditableMacroAction.ts | 0 .../macro-action/KeyMacroAction.ts | 0 .../config-items/macro-action/MacroAction.ts | 0 .../macro-action/MouseButtonMacroAction.ts | 0 .../macro-action/MoveMouseMacroAction.ts | 0 .../macro-action/ScrollMouseMacroAction.ts | 0 .../macro-action/TextMacroAction.ts | 0 .../config-items/macro-action/helper.ts | 0 .../config-items/macro-action/index.ts | 0 .../src}/config-serializer/config-schema.json | 0 .../config-serializer/hardware-config.json | 0 .../config-serializer/preset-keymaps.json | 0 .../src}/config-serializer/user-config.json | 0 .../cancelable/cancelable.directive.ts | 0 .../src}/directives/cancelable/index.ts | 0 {src => shared/src}/directives/index.ts | 0 .../src}/global-styles.scss | 0 .../src}/main-app/main-app.component.html | 0 .../src}/main-app/main-app.component.scss | 0 {src => shared/src}/polyfills.ts | 0 .../src}/services/capture.service.ts | 0 .../src}/services/mapper.service.ts | 2 +- {src => shared/src}/store/actions/index.ts | 0 {src => shared/src}/store/actions/keymap.ts | 0 {src => shared/src}/store/actions/macro.ts | 0 {src => shared/src}/store/effects/index.ts | 0 {src => shared/src}/store/effects/keymap.ts | 0 {src => shared/src}/store/effects/macro.ts | 0 {src => shared/src}/store/index.ts | 0 {src => shared/src}/store/reducers/index.ts | 0 {src => shared/src}/store/reducers/keymap.ts | 0 {src => shared/src}/store/reducers/macro.ts | 0 {src => shared/src}/store/reducers/preset.ts | 0 {src => shared/src}/store/storage/electron.ts | 0 {src => shared/src}/store/storage/index.ts | 0 {src => shared/src}/store/storage/local.ts | 0 {src => shared/src}/uhk-state.json | 0 {src => shared/src}/util/index.ts | 0 {src => shared/src}/vendor.ts | 0 test-serializer/test-serializer.ts | 6 +- test-serializer/user-config-serialized.bin | Bin 0 -> 1180 bytes test-serializer/user-config-serialized.json | 1550 +++++++++++++++++ test-serializer/user-config.bin | Bin 0 -> 1180 bytes tools/symlinker.js | 65 + web/README.md | 2 + web/src/.gitignore | 1 + {src => web/src}/app.module.ts | 52 +- web/src/components/keymap/index.ts | 1 + .../src}/components/keymap/keymap.routes.ts | 4 +- web/src/index.html | 30 + web/src/main-app/index.ts | 2 + web/src/main-app/main-app.component.ts | 9 + web/src/main-app/main-app.routes.ts | 18 + {src => web/src}/main.ts | 0 {src => web/src}/tsconfig.json | 6 +- {src => web/src}/webpack.config.js | 10 +- 276 files changed, 2154 insertions(+), 95 deletions(-) create mode 100644 electron/README.md create mode 100644 electron/src/.gitignore create mode 100644 electron/src/app.module.ts create mode 100644 electron/src/components/keymap/edit/index.ts rename {src => electron/src}/components/keymap/edit/keymap-edit.component.ts (71%) create mode 100644 electron/src/components/keymap/index.ts create mode 100644 electron/src/components/keymap/keymap.routes.ts rename {src => electron/src}/electron-main.ts (96%) rename {src => electron/src}/index.html (100%) rename {src => electron/src}/main-app/index.ts (100%) rename {src => electron/src}/main-app/main-app.component.ts (94%) rename {src => electron/src}/main-app/main-app.routes.ts (70%) create mode 100644 electron/src/main.ts rename {src => electron/src}/services/uhk-device.service.ts (96%) create mode 100644 electron/src/tsconfig-electron-main.json create mode 100644 electron/src/tsconfig.json rename src/webpack.config.electron.js => electron/src/webpack.config.electron-main.js (74%) create mode 100644 electron/src/webpack.config.js rename {src => shared/src}/agent-config.json (100%) rename {src => shared/src}/components/add-on/add-on.component.html (100%) rename {src => shared/src}/components/add-on/add-on.component.scss (100%) rename {src => shared/src}/components/add-on/add-on.component.ts (100%) rename {src => shared/src}/components/add-on/add-on.routes.ts (100%) rename {src => shared/src}/components/add-on/index.ts (100%) rename {src => shared/src}/components/keyboard/index.ts (100%) rename {src => shared/src}/components/keyboard/slider/index.ts (100%) rename {src => shared/src}/components/keyboard/slider/keyboard-slider.component.html (100%) rename {src => shared/src}/components/keyboard/slider/keyboard-slider.component.scss (100%) rename {src => shared/src}/components/keyboard/slider/keyboard-slider.component.ts (100%) rename {src => shared/src}/components/keymap/add/keymap-add.component.html (100%) rename {src => shared/src}/components/keymap/add/keymap-add.component.scss (100%) rename {src => shared/src}/components/keymap/add/keymap-add.component.ts (100%) rename {src => shared/src}/components/keymap/edit/index.ts (100%) rename {src => shared/src}/components/keymap/edit/keymap-edit-guard.service.ts (100%) rename {src => shared/src}/components/keymap/edit/keymap-edit.component.html (100%) rename {src => shared/src}/components/keymap/edit/keymap-edit.component.scss (100%) create mode 100644 shared/src/components/keymap/edit/keymap-edit.component.ts rename {src => shared/src}/components/keymap/header/keymap-header.component.html (100%) rename {src => shared/src}/components/keymap/header/keymap-header.component.scss (96%) rename {src => shared/src}/components/keymap/header/keymap-header.component.ts (100%) rename {src => shared/src}/components/keymap/index.ts (80%) rename {src => shared/src}/components/layers/index.ts (100%) rename {src => shared/src}/components/layers/layers.component.html (100%) rename {src => shared/src}/components/layers/layers.component.scss (100%) rename {src => shared/src}/components/layers/layers.component.ts (100%) rename {src => shared/src}/components/macro/action-editor/index.ts (100%) rename {src => shared/src}/components/macro/action-editor/macro-action-editor.component.html (100%) rename {src => shared/src}/components/macro/action-editor/macro-action-editor.component.scss (97%) rename {src => shared/src}/components/macro/action-editor/macro-action-editor.component.ts (100%) rename {src => shared/src}/components/macro/action-editor/tab/delay/index.ts (100%) rename {src => shared/src}/components/macro/action-editor/tab/delay/macro-delay.component.html (100%) rename {src => shared/src}/components/macro/action-editor/tab/delay/macro-delay.component.scss (100%) rename {src => shared/src}/components/macro/action-editor/tab/delay/macro-delay.component.ts (100%) rename {src => shared/src}/components/macro/action-editor/tab/index.ts (100%) rename {src => shared/src}/components/macro/action-editor/tab/key/index.ts (100%) rename {src => shared/src}/components/macro/action-editor/tab/key/macro-key.component.html (100%) rename {src => shared/src}/components/macro/action-editor/tab/key/macro-key.component.scss (100%) rename {src => shared/src}/components/macro/action-editor/tab/key/macro-key.component.ts (100%) rename {src => shared/src}/components/macro/action-editor/tab/mouse/index.ts (100%) rename {src => shared/src}/components/macro/action-editor/tab/mouse/macro-mouse.component.html (100%) rename {src => shared/src}/components/macro/action-editor/tab/mouse/macro-mouse.component.scss (100%) rename {src => shared/src}/components/macro/action-editor/tab/mouse/macro-mouse.component.ts (100%) rename {src => shared/src}/components/macro/action-editor/tab/text/index.ts (100%) rename {src => shared/src}/components/macro/action-editor/tab/text/macro-text.component.html (100%) rename {src => shared/src}/components/macro/action-editor/tab/text/macro-text.component.scss (100%) rename {src => shared/src}/components/macro/action-editor/tab/text/macro-text.component.ts (100%) rename {src => shared/src}/components/macro/edit/macro-edit.component.html (100%) rename {src => shared/src}/components/macro/edit/macro-edit.component.scss (100%) rename {src => shared/src}/components/macro/edit/macro-edit.component.ts (100%) rename {src => shared/src}/components/macro/header/macro-header.component.html (100%) rename {src => shared/src}/components/macro/header/macro-header.component.scss (94%) rename {src => shared/src}/components/macro/header/macro-header.component.ts (100%) rename {src => shared/src}/components/macro/index.ts (100%) rename {src => shared/src}/components/macro/item/index.ts (100%) rename {src => shared/src}/components/macro/item/macro-item.component.html (100%) rename {src => shared/src}/components/macro/item/macro-item.component.scss (96%) rename {src => shared/src}/components/macro/item/macro-item.component.ts (100%) rename {src => shared/src}/components/macro/list/macro-list.component.html (100%) rename {src => shared/src}/components/macro/list/macro-list.component.scss (98%) rename {src => shared/src}/components/macro/list/macro-list.component.ts (100%) rename {src => shared/src}/components/macro/macro.routes.ts (100%) rename {src => shared/src}/components/macro/not-found/index.ts (100%) rename {src => shared/src}/components/macro/not-found/macro-not-found-guard.service.ts (100%) rename {src => shared/src}/components/macro/not-found/macro-not-found.component.html (100%) rename {src => shared/src}/components/macro/not-found/macro-not-found.component.scss (100%) rename {src => shared/src}/components/macro/not-found/macro-not-found.component.ts (100%) rename {src => shared/src}/components/notification/index.ts (100%) rename {src => shared/src}/components/notification/notification.component.html (100%) rename {src => shared/src}/components/notification/notification.component.scss (100%) rename {src => shared/src}/components/notification/notification.component.ts (100%) rename {src => shared/src}/components/popover/index.ts (100%) rename {src => shared/src}/components/popover/popover.component.html (100%) rename {src => shared/src}/components/popover/popover.component.scss (100%) rename {src => shared/src}/components/popover/popover.component.ts (100%) rename {src => shared/src}/components/popover/tab/index.ts (100%) rename {src => shared/src}/components/popover/tab/keymap/index.ts (100%) rename {src => shared/src}/components/popover/tab/keymap/keymap-tab.component.html (100%) rename {src => shared/src}/components/popover/tab/keymap/keymap-tab.component.scss (100%) rename {src => shared/src}/components/popover/tab/keymap/keymap-tab.component.ts (100%) rename {src => shared/src}/components/popover/tab/keypress/index.ts (100%) rename {src => shared/src}/components/popover/tab/keypress/keypress-tab.component.html (100%) rename {src => shared/src}/components/popover/tab/keypress/keypress-tab.component.scss (100%) rename {src => shared/src}/components/popover/tab/keypress/keypress-tab.component.ts (100%) rename {src => shared/src}/components/popover/tab/keypress/longPress.json (100%) rename {src => shared/src}/components/popover/tab/keypress/scancodes.json (100%) rename {src => shared/src}/components/popover/tab/layer/index.ts (100%) rename {src => shared/src}/components/popover/tab/layer/layer-tab.component.html (100%) rename {src => shared/src}/components/popover/tab/layer/layer-tab.component.scss (100%) rename {src => shared/src}/components/popover/tab/layer/layer-tab.component.ts (100%) rename {src => shared/src}/components/popover/tab/macro/index.ts (100%) rename {src => shared/src}/components/popover/tab/macro/macro-tab.component.html (100%) rename {src => shared/src}/components/popover/tab/macro/macro-tab.component.scss (100%) rename {src => shared/src}/components/popover/tab/macro/macro-tab.component.ts (100%) rename {src => shared/src}/components/popover/tab/mouse/index.ts (100%) rename {src => shared/src}/components/popover/tab/mouse/mouse-tab.component.html (100%) rename {src => shared/src}/components/popover/tab/mouse/mouse-tab.component.scss (97%) rename {src => shared/src}/components/popover/tab/mouse/mouse-tab.component.ts (100%) rename {src => shared/src}/components/popover/tab/none/index.ts (100%) rename {src => shared/src}/components/popover/tab/none/none-tab.component.html (100%) rename {src => shared/src}/components/popover/tab/none/none-tab.component.scss (100%) rename {src => shared/src}/components/popover/tab/none/none-tab.component.ts (100%) rename {src => shared/src}/components/popover/tab/tab.ts (100%) rename {src => shared/src}/components/popover/widgets/capture-keystroke/capture-keystroke-button.component.html (100%) rename {src => shared/src}/components/popover/widgets/capture-keystroke/capture-keystroke-button.component.scss (100%) rename {src => shared/src}/components/popover/widgets/capture-keystroke/capture-keystroke-button.component.ts (100%) rename {src => shared/src}/components/popover/widgets/capture-keystroke/index.ts (100%) rename {src => shared/src}/components/popover/widgets/icon/icon.component.html (100%) rename {src => shared/src}/components/popover/widgets/icon/icon.component.scss (86%) rename {src => shared/src}/components/popover/widgets/icon/icon.component.ts (100%) rename {src => shared/src}/components/popover/widgets/icon/index.ts (100%) rename {src => shared/src}/components/settings/index.ts (100%) rename {src => shared/src}/components/settings/settings.component.html (100%) rename {src => shared/src}/components/settings/settings.component.scss (100%) rename {src => shared/src}/components/settings/settings.component.ts (100%) rename {src => shared/src}/components/settings/settings.routes.ts (100%) rename {src => shared/src}/components/side-menu/index.ts (100%) rename {src => shared/src}/components/side-menu/side-menu.component.html (100%) rename {src => shared/src}/components/side-menu/side-menu.component.scss (100%) rename {src => shared/src}/components/side-menu/side-menu.component.ts (100%) rename {src => shared/src}/components/svg/keyboard/index.ts (100%) rename {src => shared/src}/components/svg/keyboard/svg-keyboard.component.html (100%) rename {src => shared/src}/components/svg/keyboard/svg-keyboard.component.scss (100%) rename {src => shared/src}/components/svg/keyboard/svg-keyboard.component.ts (96%) rename {src => shared/src}/components/svg/keys/index.ts (100%) rename {src => shared/src}/components/svg/keys/svg-icon-text-key/index.ts (100%) rename {src => shared/src}/components/svg/keys/svg-icon-text-key/svg-icon-text-key.component.html (100%) rename {src => shared/src}/components/svg/keys/svg-icon-text-key/svg-icon-text-key.component.ts (100%) rename {src => shared/src}/components/svg/keys/svg-keyboard-key/index.ts (100%) rename {src => shared/src}/components/svg/keys/svg-keyboard-key/svg-keyboard-key.component.html (100%) rename {src => shared/src}/components/svg/keys/svg-keyboard-key/svg-keyboard-key.component.scss (100%) rename {src => shared/src}/components/svg/keys/svg-keyboard-key/svg-keyboard-key.component.ts (100%) rename {src => shared/src}/components/svg/keys/svg-keyboard-key/svg-keyboard-key.model.ts (100%) rename {src => shared/src}/components/svg/keys/svg-keystroke-key/index.ts (100%) rename {src => shared/src}/components/svg/keys/svg-keystroke-key/svg-keystroke-key.component.html (100%) rename {src => shared/src}/components/svg/keys/svg-keystroke-key/svg-keystroke-key.component.scss (100%) rename {src => shared/src}/components/svg/keys/svg-keystroke-key/svg-keystroke-key.component.ts (100%) rename {src => shared/src}/components/svg/keys/svg-mouse-click-key/index.ts (100%) rename {src => shared/src}/components/svg/keys/svg-mouse-click-key/svg-mouse-click-key.html (100%) rename {src => shared/src}/components/svg/keys/svg-mouse-click-key/svg-mouse-click-key.ts (100%) rename {src => shared/src}/components/svg/keys/svg-mouse-key/index.ts (100%) rename {src => shared/src}/components/svg/keys/svg-mouse-key/svg-mouse-key.html (100%) rename {src => shared/src}/components/svg/keys/svg-mouse-key/svg-mouse-key.ts (100%) rename {src => shared/src}/components/svg/keys/svg-mouse-move-key/index.ts (100%) rename {src => shared/src}/components/svg/keys/svg-mouse-move-key/svg-mouse-move-key.html (100%) rename {src => shared/src}/components/svg/keys/svg-mouse-move-key/svg-mouse-move-key.ts (100%) rename {src => shared/src}/components/svg/keys/svg-mouse-scroll-key/index.ts (100%) rename {src => shared/src}/components/svg/keys/svg-mouse-scroll-key/svg-mouse-scroll-key.html (100%) rename {src => shared/src}/components/svg/keys/svg-mouse-scroll-key/svg-mouse-scroll-key.ts (100%) rename {src => shared/src}/components/svg/keys/svg-mouse-speed-key/index.ts (100%) rename {src => shared/src}/components/svg/keys/svg-mouse-speed-key/svg-mouse-speed-key.html (100%) rename {src => shared/src}/components/svg/keys/svg-mouse-speed-key/svg-mouse-speed-key.ts (100%) rename {src => shared/src}/components/svg/keys/svg-one-line-text-key/index.ts (100%) rename {src => shared/src}/components/svg/keys/svg-one-line-text-key/svg-one-line-text-key.component.html (100%) rename {src => shared/src}/components/svg/keys/svg-one-line-text-key/svg-one-line-text-key.component.ts (100%) rename {src => shared/src}/components/svg/keys/svg-single-icon-key/index.ts (100%) rename {src => shared/src}/components/svg/keys/svg-single-icon-key/svg-single-icon-key.component.html (100%) rename {src => shared/src}/components/svg/keys/svg-single-icon-key/svg-single-icon-key.component.ts (100%) rename {src => shared/src}/components/svg/keys/svg-switch-keymap-key/index.ts (100%) rename {src => shared/src}/components/svg/keys/svg-switch-keymap-key/svg-switch-keymap-key.component.html (100%) rename {src => shared/src}/components/svg/keys/svg-switch-keymap-key/svg-switch-keymap-key.component.ts (100%) rename {src => shared/src}/components/svg/keys/svg-text-icon-key/index.ts (100%) rename {src => shared/src}/components/svg/keys/svg-text-icon-key/svg-text-icon-key.component.html (100%) rename {src => shared/src}/components/svg/keys/svg-text-icon-key/svg-text-icon-key.component.ts (100%) rename {src => shared/src}/components/svg/keys/svg-two-line-text-key/index.ts (100%) rename {src => shared/src}/components/svg/keys/svg-two-line-text-key/svg-two-line-text-key.component.html (100%) rename {src => shared/src}/components/svg/keys/svg-two-line-text-key/svg-two-line-text-key.component.ts (100%) rename {src => shared/src}/components/svg/module/index.ts (100%) rename {src => shared/src}/components/svg/module/svg-module.component.html (100%) rename {src => shared/src}/components/svg/module/svg-module.component.scss (100%) rename {src => shared/src}/components/svg/module/svg-module.component.ts (100%) rename {src => shared/src}/components/svg/module/svg-module.model.ts (100%) rename {src => shared/src}/components/svg/wrap/index.ts (100%) rename {src => shared/src}/components/svg/wrap/svg-keyboard-wrap.component.html (100%) rename {src => shared/src}/components/svg/wrap/svg-keyboard-wrap.component.scss (100%) rename {src => shared/src}/components/svg/wrap/svg-keyboard-wrap.component.ts (100%) rename {src => shared/src}/config-serializer/Function.d.ts (100%) rename {src => shared/src}/config-serializer/README.md (100%) rename {src => shared/src}/config-serializer/UhkBuffer.ts (100%) rename {src => shared/src}/config-serializer/assert.ts (100%) rename {src => shared/src}/config-serializer/config-items/HardwareConfiguration.ts (100%) rename {src => shared/src}/config-serializer/config-items/KeyModifiers.ts (100%) rename {src => shared/src}/config-serializer/config-items/Keymap.ts (100%) rename {src => shared/src}/config-serializer/config-items/Layer.ts (100%) rename {src => shared/src}/config-serializer/config-items/LongPressAction.ts (100%) rename {src => shared/src}/config-serializer/config-items/Macro.ts (100%) rename {src => shared/src}/config-serializer/config-items/Module.ts (100%) rename {src => shared/src}/config-serializer/config-items/ModuleConfiguration.ts (100%) rename {src => shared/src}/config-serializer/config-items/UserConfiguration.ts (100%) rename {src => shared/src}/config-serializer/config-items/key-action/KeyAction.ts (100%) rename {src => shared/src}/config-serializer/config-items/key-action/KeystrokeAction.ts (100%) rename {src => shared/src}/config-serializer/config-items/key-action/MouseAction.ts (100%) rename {src => shared/src}/config-serializer/config-items/key-action/NoneAction.ts (100%) rename {src => shared/src}/config-serializer/config-items/key-action/PlayMacroAction.ts (100%) rename {src => shared/src}/config-serializer/config-items/key-action/SwitchKeymapAction.ts (100%) rename {src => shared/src}/config-serializer/config-items/key-action/SwitchLayerAction.ts (100%) rename {src => shared/src}/config-serializer/config-items/key-action/helper.ts (100%) rename {src => shared/src}/config-serializer/config-items/key-action/index.ts (100%) rename {src => shared/src}/config-serializer/config-items/macro-action/DelayMacroAction.ts (100%) rename {src => shared/src}/config-serializer/config-items/macro-action/EditableMacroAction.ts (100%) rename {src => shared/src}/config-serializer/config-items/macro-action/KeyMacroAction.ts (100%) rename {src => shared/src}/config-serializer/config-items/macro-action/MacroAction.ts (100%) rename {src => shared/src}/config-serializer/config-items/macro-action/MouseButtonMacroAction.ts (100%) rename {src => shared/src}/config-serializer/config-items/macro-action/MoveMouseMacroAction.ts (100%) rename {src => shared/src}/config-serializer/config-items/macro-action/ScrollMouseMacroAction.ts (100%) rename {src => shared/src}/config-serializer/config-items/macro-action/TextMacroAction.ts (100%) rename {src => shared/src}/config-serializer/config-items/macro-action/helper.ts (100%) rename {src => shared/src}/config-serializer/config-items/macro-action/index.ts (100%) rename {src => shared/src}/config-serializer/config-schema.json (100%) rename {src => shared/src}/config-serializer/hardware-config.json (100%) rename {src => shared/src}/config-serializer/preset-keymaps.json (100%) rename {src => shared/src}/config-serializer/user-config.json (100%) rename {src => shared/src}/directives/cancelable/cancelable.directive.ts (100%) rename {src => shared/src}/directives/cancelable/index.ts (100%) rename {src => shared/src}/directives/index.ts (100%) rename {src/main-app => shared/src}/global-styles.scss (100%) rename {src => shared/src}/main-app/main-app.component.html (100%) rename {src => shared/src}/main-app/main-app.component.scss (100%) rename {src => shared/src}/polyfills.ts (100%) rename {src => shared/src}/services/capture.service.ts (100%) rename {src => shared/src}/services/mapper.service.ts (98%) rename {src => shared/src}/store/actions/index.ts (100%) rename {src => shared/src}/store/actions/keymap.ts (100%) rename {src => shared/src}/store/actions/macro.ts (100%) rename {src => shared/src}/store/effects/index.ts (100%) rename {src => shared/src}/store/effects/keymap.ts (100%) rename {src => shared/src}/store/effects/macro.ts (100%) rename {src => shared/src}/store/index.ts (100%) rename {src => shared/src}/store/reducers/index.ts (100%) rename {src => shared/src}/store/reducers/keymap.ts (100%) rename {src => shared/src}/store/reducers/macro.ts (100%) rename {src => shared/src}/store/reducers/preset.ts (100%) rename {src => shared/src}/store/storage/electron.ts (100%) rename {src => shared/src}/store/storage/index.ts (100%) rename {src => shared/src}/store/storage/local.ts (100%) rename {src => shared/src}/uhk-state.json (100%) rename {src => shared/src}/util/index.ts (100%) rename {src => shared/src}/vendor.ts (100%) create mode 100644 test-serializer/user-config-serialized.bin create mode 100644 test-serializer/user-config-serialized.json create mode 100644 test-serializer/user-config.bin create mode 100644 tools/symlinker.js create mode 100644 web/README.md create mode 100644 web/src/.gitignore rename {src => web/src}/app.module.ts (72%) create mode 100644 web/src/components/keymap/index.ts rename {src => web/src}/components/keymap/keymap.routes.ts (70%) create mode 100644 web/src/index.html create mode 100644 web/src/main-app/index.ts create mode 100644 web/src/main-app/main-app.component.ts create mode 100644 web/src/main-app/main-app.routes.ts rename {src => web/src}/main.ts (100%) rename {src => web/src}/tsconfig.json (85%) rename {src => web/src}/webpack.config.js (89%) diff --git a/.travis.yml b/.travis.yml index 91b9facc..e35cf2b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,6 @@ install: before_script: - npm run build - npm run build:test - - npm run build:electron - npm run lint script: diff --git a/electron/README.md b/electron/README.md new file mode 100644 index 00000000..1591e1e2 --- /dev/null +++ b/electron/README.md @@ -0,0 +1,2 @@ +### Before build: +Add symbolic link from shared/src to electron/src/shared with **npm run symlink -- -i** \ No newline at end of file diff --git a/electron/src/.gitignore b/electron/src/.gitignore new file mode 100644 index 00000000..26bcf9d8 --- /dev/null +++ b/electron/src/.gitignore @@ -0,0 +1 @@ +shared \ No newline at end of file diff --git a/electron/src/app.module.ts b/electron/src/app.module.ts new file mode 100644 index 00000000..ac05e53e --- /dev/null +++ b/electron/src/app.module.ts @@ -0,0 +1,166 @@ +import { NgModule, ReflectiveInjector } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { BrowserModule } from '@angular/platform-browser'; + +import { EffectsModule } from '@ngrx/effects'; +import { StoreModule } from '@ngrx/store'; +import { StoreDevtoolsModule } from '@ngrx/store-devtools'; +import { StoreLogMonitorModule, useLogMonitor } from '@ngrx/store-log-monitor'; + +import { DragulaModule } from 'ng2-dragula/ng2-dragula'; +import { Select2Module } from 'ng2-select2/ng2-select2'; + +import { AddOnComponent } from './shared/components/add-on'; +import { KeyboardSliderComponent } from './shared/components/keyboard/slider'; +import { KeymapAddComponent, KeymapHeaderComponent } from './shared/components/keymap'; +import { KeymapEditComponent } from './components/keymap/edit'; +import { LayersComponent } from './shared/components/layers'; +import { + MacroActionEditorComponent, + MacroDelayTabComponent, + MacroEditComponent, + MacroHeaderComponent, + MacroItemComponent, + MacroKeyTabComponent, + MacroListComponent, + MacroMouseTabComponent, + MacroNotFoundComponent, + MacroTextTabComponent +} from './shared/components/macro'; +import { NotificationComponent } from './shared/components/notification'; +import { PopoverComponent } from './shared/components/popover'; +import { + KeymapTabComponent, + KeypressTabComponent, + LayerTabComponent, + MacroTabComponent, + MouseTabComponent, + NoneTabComponent +} from './shared/components/popover/tab'; +import { CaptureKeystrokeButtonComponent } from './shared/components/popover/widgets/capture-keystroke'; +import { IconComponent } from './shared/components/popover/widgets/icon'; +import { SettingsComponent } from './shared/components/settings'; +import { SideMenuComponent } from './shared/components/side-menu'; +import { SvgKeyboardComponent } from './shared/components/svg/keyboard'; +import { + SvgIconTextKeyComponent, + SvgKeyboardKeyComponent, + SvgKeystrokeKeyComponent, + SvgMouseClickKeyComponent, + SvgMouseKeyComponent, + SvgMouseMoveKeyComponent, + SvgMouseScrollKeyComponent, + SvgMouseSpeedKeyComponent, + SvgOneLineTextKeyComponent, + SvgSingleIconKeyComponent, + SvgSwitchKeymapKeyComponent, + SvgTextIconKeyComponent, + SvgTwoLineTextKeyComponent +} from './shared/components/svg/keys'; +import { SvgModuleComponent } from './shared/components/svg/module'; +import { SvgKeyboardWrapComponent } from './shared/components/svg/wrap'; +import { MainAppComponent, appRoutingProviders, routing } from './main-app'; + +import { CancelableDirective } from './shared/directives'; + +import { CaptureService } from './shared/services/capture.service'; +import { MapperService } from './shared/services/mapper.service'; +import { UhkDeviceService } from './services/uhk-device.service'; + +import { KeymapEffects, MacroEffects } from './shared/store/effects'; +import { keymapReducer, macroReducer, presetReducer } from './shared/store/reducers'; +import { DataStorage } from './shared/store/storage'; + +import { KeymapEditGuard } from './shared/components/keymap/edit'; +import { MacroNotFoundGuard } from './shared/components/macro/not-found'; + +// Create DataStorage dependency injection +const storageProvider = ReflectiveInjector.resolve([DataStorage]); +const storageInjector = ReflectiveInjector.fromResolvedProviders(storageProvider); +const storageService: DataStorage = storageInjector.get(DataStorage); + +// All reducers that are used in application +const storeConfig = { + keymaps: storageService.saveState(keymapReducer), + macros: storageService.saveState(macroReducer), + presetKeymaps: presetReducer +}; + +@NgModule({ + declarations: [ + MainAppComponent, + KeymapEditComponent, + KeymapHeaderComponent, + NotificationComponent, + SvgIconTextKeyComponent, + SvgKeyboardKeyComponent, + SvgKeystrokeKeyComponent, + SvgMouseKeyComponent, + SvgMouseClickKeyComponent, + SvgMouseMoveKeyComponent, + SvgMouseScrollKeyComponent, + SvgMouseSpeedKeyComponent, + SvgOneLineTextKeyComponent, + SvgSingleIconKeyComponent, + SvgSwitchKeymapKeyComponent, + SvgTextIconKeyComponent, + SvgTwoLineTextKeyComponent, + SvgKeyboardKeyComponent, + SvgKeyboardWrapComponent, + SvgKeyboardComponent, + SvgModuleComponent, + LayersComponent, + PopoverComponent, + KeymapAddComponent, + SideMenuComponent, + KeypressTabComponent, + KeymapTabComponent, + LayerTabComponent, + MacroTabComponent, + MouseTabComponent, + NoneTabComponent, + CaptureKeystrokeButtonComponent, + IconComponent, + MacroEditComponent, + MacroListComponent, + MacroHeaderComponent, + MacroItemComponent, + MacroActionEditorComponent, + MacroDelayTabComponent, + MacroKeyTabComponent, + MacroMouseTabComponent, + MacroTextTabComponent, + MacroNotFoundComponent, + AddOnComponent, + SettingsComponent, + KeyboardSliderComponent, + CancelableDirective + ], + imports: [ + BrowserModule, + FormsModule, + DragulaModule, + routing, + StoreModule.provideStore(storeConfig, storageService.initialState()), + StoreDevtoolsModule.instrumentStore({ + monitor: useLogMonitor({ + visible: false, + position: 'right' + }) + }), + StoreLogMonitorModule, + Select2Module, + EffectsModule.runAfterBootstrap(KeymapEffects), + EffectsModule.runAfterBootstrap(MacroEffects) + ], + providers: [ + MapperService, + appRoutingProviders, + KeymapEditGuard, + MacroNotFoundGuard, + CaptureService, + UhkDeviceService + ], + bootstrap: [MainAppComponent] +}) +export class AppModule { } diff --git a/electron/src/components/keymap/edit/index.ts b/electron/src/components/keymap/edit/index.ts new file mode 100644 index 00000000..b1d0d213 --- /dev/null +++ b/electron/src/components/keymap/edit/index.ts @@ -0,0 +1 @@ +export { KeymapEditComponent } from './keymap-edit.component'; diff --git a/src/components/keymap/edit/keymap-edit.component.ts b/electron/src/components/keymap/edit/keymap-edit.component.ts similarity index 71% rename from src/components/keymap/edit/keymap-edit.component.ts rename to electron/src/components/keymap/edit/keymap-edit.component.ts index c559522e..343716c9 100644 --- a/src/components/keymap/edit/keymap-edit.component.ts +++ b/electron/src/components/keymap/edit/keymap-edit.component.ts @@ -4,49 +4,37 @@ import { ActivatedRoute } from '@angular/router'; import '@ngrx/core/add/operator/select'; import { Store } from '@ngrx/store'; +import 'rxjs/add/operator/do'; import 'rxjs/add/operator/first'; -import 'rxjs/add/operator/let'; -import 'rxjs/add/operator/publishReplay'; +import 'rxjs/add/operator/map'; import 'rxjs/add/operator/switchMap'; -import { Observable } from 'rxjs/Observable'; -import { Keymap } from '../../../config-serializer/config-items/Keymap'; -import { UhkBuffer } from '../../../config-serializer/UhkBuffer'; -import { AppState } from '../../../store'; -import { getKeymap, getKeymapEntities } from '../../../store/reducers/keymap'; -import { SvgKeyboardWrapComponent } from '../../svg/wrap'; +import { Keymap } from '../../../shared/config-serializer/config-items/Keymap'; +import { UhkBuffer } from '../../../shared/config-serializer/UhkBuffer'; +import { AppState } from '../../../shared/store'; +import { SvgKeyboardWrapComponent } from '../../../shared/components/svg/wrap'; +import { KeymapEditComponent as SharedKeymapEditComponent } from '../../../shared/components/keymap/edit'; import { UhkDeviceService } from '../../../services/uhk-device.service'; @Component({ selector: 'keymap-edit', - template: require('./keymap-edit.component.html'), - styles: [require('./keymap-edit.component.scss')], + template: require('../../../shared/components/keymap/edit/keymap-edit.component.html'), + styles: [require('../../../shared/components/keymap/edit/keymap-edit.component.scss')], host: { 'class': 'container-fluid' } }) -export class KeymapEditComponent { +export class KeymapEditComponent extends SharedKeymapEditComponent { @ViewChild(SvgKeyboardWrapComponent) wrap: SvgKeyboardWrapComponent; - private keymap$: Observable; - private deletable$: Observable; - constructor( - private store: Store, - private route: ActivatedRoute, + store: Store, + route: ActivatedRoute, private uhkDevice: UhkDeviceService ) { - this.keymap$ = route - .params - .select('abbr') - .switchMap((abbr: string) => store.let(getKeymap(abbr))) - .publishReplay(1) - .refCount(); - - this.deletable$ = store.let(getKeymapEntities()) - .map((keymaps: Keymap[]) => keymaps.length > 1); + super(store, route); } @HostListener('window:keydown.control.u', ['$event']) diff --git a/electron/src/components/keymap/index.ts b/electron/src/components/keymap/index.ts new file mode 100644 index 00000000..c26fb46f --- /dev/null +++ b/electron/src/components/keymap/index.ts @@ -0,0 +1 @@ +export * from './keymap.routes'; diff --git a/electron/src/components/keymap/keymap.routes.ts b/electron/src/components/keymap/keymap.routes.ts new file mode 100644 index 00000000..7df02708 --- /dev/null +++ b/electron/src/components/keymap/keymap.routes.ts @@ -0,0 +1,26 @@ +import { Routes } from '@angular/router'; + +import { KeymapAddComponent } from '../../shared/components/keymap/add/keymap-add.component'; +import { KeymapEditComponent } from './edit'; +import { KeymapEditGuard } from '../../shared/components/keymap/edit'; + +export const keymapRoutes: Routes = [ + { + path: '', + redirectTo: '/keymap', + pathMatch: 'full' + }, + { + path: 'keymap', + component: KeymapEditComponent, + canActivate: [KeymapEditGuard] + }, + { + path: 'keymap/add', + component: KeymapAddComponent + }, + { + path: 'keymap/:abbr', + component: KeymapEditComponent + } +]; diff --git a/src/electron-main.ts b/electron/src/electron-main.ts similarity index 96% rename from src/electron-main.ts rename to electron/src/electron-main.ts index 0faa81ef..5873942b 100644 --- a/src/electron-main.ts +++ b/electron/src/electron-main.ts @@ -16,7 +16,7 @@ function createWindow() { }); win.maximize(); - const indexPath = path.resolve(__dirname, 'index.html'); + const indexPath = path.resolve(__dirname, './index.html'); // and load the index.html of the app. win.loadURL(`file://${indexPath}`); diff --git a/src/index.html b/electron/src/index.html similarity index 100% rename from src/index.html rename to electron/src/index.html diff --git a/src/main-app/index.ts b/electron/src/main-app/index.ts similarity index 100% rename from src/main-app/index.ts rename to electron/src/main-app/index.ts diff --git a/src/main-app/main-app.component.ts b/electron/src/main-app/main-app.component.ts similarity index 94% rename from src/main-app/main-app.component.ts rename to electron/src/main-app/main-app.component.ts index 6111d433..f973ceb6 100644 --- a/src/main-app/main-app.component.ts +++ b/electron/src/main-app/main-app.component.ts @@ -14,8 +14,8 @@ import { Component, ViewEncapsulation, HostListener } from '@angular/core'; @Component({ selector: 'main-app', - template: require('./main-app.component.html'), - styles: [require('./main-app.component.scss')], + template: require('../shared/main-app/main-app.component.html'), + styles: [require('../shared/main-app/main-app.component.scss')], encapsulation: ViewEncapsulation.None }) export class MainAppComponent { diff --git a/src/main-app/main-app.routes.ts b/electron/src/main-app/main-app.routes.ts similarity index 70% rename from src/main-app/main-app.routes.ts rename to electron/src/main-app/main-app.routes.ts index a0804926..3decdd8b 100644 --- a/src/main-app/main-app.routes.ts +++ b/electron/src/main-app/main-app.routes.ts @@ -1,10 +1,10 @@ import { ModuleWithProviders } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; -import { addOnRoutes } from '../components/add-on'; +import { addOnRoutes } from '../shared/components/add-on'; import { keymapRoutes } from '../components/keymap'; -import { macroRoutes } from '../components/macro'; -import { settingsRoutes } from '../components/settings'; +import { macroRoutes } from '../shared/components/macro'; +import { settingsRoutes } from '../shared/components/settings'; const appRoutes: Routes = [ ...keymapRoutes, diff --git a/electron/src/main.ts b/electron/src/main.ts new file mode 100644 index 00000000..6af7a5b2 --- /dev/null +++ b/electron/src/main.ts @@ -0,0 +1,5 @@ +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + +import { AppModule } from './app.module'; + +platformBrowserDynamic().bootstrapModule(AppModule); diff --git a/src/services/uhk-device.service.ts b/electron/src/services/uhk-device.service.ts similarity index 96% rename from src/services/uhk-device.service.ts rename to electron/src/services/uhk-device.service.ts index b6cd9bc1..da996fc2 100644 --- a/src/services/uhk-device.service.ts +++ b/electron/src/services/uhk-device.service.ts @@ -16,8 +16,8 @@ import 'rxjs/add/operator/publish'; import { Device, Interface, InEndpoint, OutEndpoint, findByIds } from 'usb'; -import { Layer } from '../config-serializer/config-items/Layer'; -import { UhkBuffer } from '../config-serializer/UhkBuffer'; +import { Layer } from '../shared/config-serializer/config-items/Layer'; +import { UhkBuffer } from '../shared/config-serializer/UhkBuffer'; const vendorId = 0x16d3; const productId = 0x05ea; @@ -54,6 +54,9 @@ export class UhkDeviceService { return; } this.device = findByIds(vendorId, productId); + if (!this.device) { + throw new Error('UhkDevice not found.'); + } this.device.open(); const usbInterface: Interface = this.device.interface(0); diff --git a/electron/src/tsconfig-electron-main.json b/electron/src/tsconfig-electron-main.json new file mode 100644 index 00000000..46fa1b0f --- /dev/null +++ b/electron/src/tsconfig-electron-main.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "moduleResolution": "node", + "sourceMap": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "removeComments": false, + "noImplicitAny": true, + "suppressImplicitAnyIndexErrors": true, + "typeRoots": [ + "../../node_modules/@types" + ], + "types": [ + "electron" + ] + }, + "files": [ + "electron-main.ts" + ] +} \ No newline at end of file diff --git a/electron/src/tsconfig.json b/electron/src/tsconfig.json new file mode 100644 index 00000000..92b896e6 --- /dev/null +++ b/electron/src/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "sourceMap": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "removeComments": false, + "noImplicitAny": true, + "suppressImplicitAnyIndexErrors": true, + "typeRoots": [ + "../../node_modules/@types" + ], + "types": [ + "node", + "jquery", + "core-js", + "select2", + "electron", + "usb" + ] + }, + "exclude": [ + "../dist", + "electron-main.ts", + "webpack.config.*" + ] +} \ No newline at end of file diff --git a/src/webpack.config.electron.js b/electron/src/webpack.config.electron-main.js similarity index 74% rename from src/webpack.config.electron.js rename to electron/src/webpack.config.electron-main.js index b2e05df5..ee8596d0 100644 --- a/src/webpack.config.electron.js +++ b/electron/src/webpack.config.electron-main.js @@ -5,12 +5,12 @@ var path = require('path'); var rootDir = path.resolve(__dirname, '../'); module.exports = { - entry: ['./src/electron-main.ts'], + entry: [ path.resolve(rootDir, 'src/electron-main.ts')], output: { path: rootDir + "/dist", filename: "electron-main.js" }, - target: 'electron', + target: 'electron-main', devtool: 'source-map', resolve: { extensions: ['', '.webpack.js', '.web.js', '.ts', '.js'], @@ -18,7 +18,7 @@ module.exports = { }, module: { loaders: [ - { test: /\.ts$/, loader: 'ts-loader', exclude: /node_modules/ }, + { test: /\.ts$/, loader: 'ts-loader?' + JSON.stringify({ configFileName: 'tsconfig-electron-main.json' }), exclude: /node_modules/ }, ]}, plugins: [ // new webpack.optimize.UglifyJsPlugin({ minimize: true }) diff --git a/electron/src/webpack.config.js b/electron/src/webpack.config.js new file mode 100644 index 00000000..73d239fb --- /dev/null +++ b/electron/src/webpack.config.js @@ -0,0 +1,94 @@ +var webpack = require("webpack"); +var SvgStore = require('webpack-svgstore-plugin'); +var webpackFailPlugin = require('webpack-fail-plugin'); +var CopyWebpackPlugin = require('copy-webpack-plugin'); +var path = require('path'); +var CommonsChunkPlugin = require("webpack/lib/optimize/CommonsChunkPlugin"); + +var rootDir = path.resolve(__dirname, '../'); + +module.exports = { + entry: { + polyfills: path.resolve(rootDir, 'src/shared/polyfills.ts'), + vendor: path.resolve(rootDir, 'src/shared/vendor.ts'), + app: path.resolve(rootDir, 'src/main.ts') + }, + output: { + path: rootDir + "/dist", + filename: "[name].uhk.js" + }, + target: 'electron-renderer', + externals: { + usb: 'usb' + }, + devtool: 'source-map', + resolve: { + extensions: ['', '.webpack.js', '.web.js', '.ts', '.js'], + modules: [path.join(rootDir, "node_modules")], + alias: { + jquery: 'jquery/dist/jquery.min.js', + select2: 'select2/dist/js/select2.full.min.js' + } + }, + module: { + loaders: [ + { test: /\.ts$/, loader: 'ts-loader', exclude: /node_modules/ }, + { test: /\.html$/, loader: 'html-loader?attrs=false' }, + { + test: /\.scss$/, + exclude: /node_modules/, + loaders: ['raw-loader', 'sass-loader'] + }, + { test: /jquery/, loader: 'expose?$!expose?jQuery' }, + { test: require.resolve("usb"), loader: "expose?usb" } + ] + }, + plugins: [ + // new webpack.optimize.UglifyJsPlugin({ minimize: true }) + new SvgStore({ + svgoOptions: { + plugins: [ + { removeTitle: true } + ] + } + }), + webpackFailPlugin, + new CopyWebpackPlugin( + [ + { from: './electron/src/**/*.html', flatten: true }, + { from: './electron/src/**/*.js', flatten: true }, + { + from: 'node_modules/font-awesome/css/font-awesome.min.css', + to: 'vendor/font-awesome/css/font-awesome.min.css' + }, + { + from: 'node_modules/font-awesome/fonts', + to: 'vendor/font-awesome/fonts' + }, + { + from: 'node_modules/bootstrap/dist/', + to: 'vendor/bootstrap' + }, + { + from: 'images', + to: 'images' + }, + { + from: 'node_modules/usb', + to: 'vendor/usb' + } + ], + { + ignore: ['*.config.js'] + } + ), + new webpack.ProvidePlugin({ + $: "jquery", + jQuery: "jquery" + }), + new CommonsChunkPlugin({ + name: ['app', 'vendor', 'polyfills'] + }) + ] + +} diff --git a/package.json b/package.json index 31ccd65b..91dfd1ad 100644 --- a/package.json +++ b/package.json @@ -61,14 +61,19 @@ "zone.js": "0.7.6" }, "scripts": { - "postinstall": "electron-rebuild -w usb -p", - "tslint": "tslint \"src/**/*.ts\" \"test-serializer/**/*.ts\"", - "stylelint": "stylelint \"src/**/*.scss\" --syntax scss", + "postinstall": "run-p build:usb \"symlink -- -i\" ", + "tslint": "tslint \"electron/**/*.ts\" \"web/**/*.ts\" \"shared/**/*.ts\" \"test-serializer/**/*.ts\"", + "stylelint": "stylelint \"electron/**/*.scss\" \"web/**/*.scss\" \"shared/**/*.scss\" --syntax scss", "lint": "run-s -scn tslint stylelint", - "build": "webpack --config \"src/webpack.config.js\"", - "build:electron": "webpack --config \"src/webpack.config.electron.js\"", + "build": "run-p build:web build:electron", + "build:web": "webpack --config \"web/src/webpack.config.js\"", + "build:electron": "run-s -scn build:electron:main build:electron:app", + "build:electron:main": "webpack --config \"electron/src/webpack.config.electron-main.js\"", + "build:electron:app": "webpack --config \"electron/src/webpack.config.js\"", + "build:usb": "electron-rebuild -w usb -p", "build:test": "webpack --config \"test-serializer/webpack.config.js\"", - "dev": "webpack-dev-server --config \"src/webpack.config.js\" --content-base \"./dist\"", - "electron": "electron dist/electron-main.js" + "dev": "webpack-dev-server --config \"web/src/webpack.config.js\" --content-base \"./web/dist\"", + "electron": "electron electron/dist/electron-main.js", + "symlink": "node ./tools/symlinker" } } diff --git a/src/agent-config.json b/shared/src/agent-config.json similarity index 100% rename from src/agent-config.json rename to shared/src/agent-config.json diff --git a/src/components/add-on/add-on.component.html b/shared/src/components/add-on/add-on.component.html similarity index 100% rename from src/components/add-on/add-on.component.html rename to shared/src/components/add-on/add-on.component.html diff --git a/src/components/add-on/add-on.component.scss b/shared/src/components/add-on/add-on.component.scss similarity index 100% rename from src/components/add-on/add-on.component.scss rename to shared/src/components/add-on/add-on.component.scss diff --git a/src/components/add-on/add-on.component.ts b/shared/src/components/add-on/add-on.component.ts similarity index 100% rename from src/components/add-on/add-on.component.ts rename to shared/src/components/add-on/add-on.component.ts diff --git a/src/components/add-on/add-on.routes.ts b/shared/src/components/add-on/add-on.routes.ts similarity index 100% rename from src/components/add-on/add-on.routes.ts rename to shared/src/components/add-on/add-on.routes.ts diff --git a/src/components/add-on/index.ts b/shared/src/components/add-on/index.ts similarity index 100% rename from src/components/add-on/index.ts rename to shared/src/components/add-on/index.ts diff --git a/src/components/keyboard/index.ts b/shared/src/components/keyboard/index.ts similarity index 100% rename from src/components/keyboard/index.ts rename to shared/src/components/keyboard/index.ts diff --git a/src/components/keyboard/slider/index.ts b/shared/src/components/keyboard/slider/index.ts similarity index 100% rename from src/components/keyboard/slider/index.ts rename to shared/src/components/keyboard/slider/index.ts diff --git a/src/components/keyboard/slider/keyboard-slider.component.html b/shared/src/components/keyboard/slider/keyboard-slider.component.html similarity index 100% rename from src/components/keyboard/slider/keyboard-slider.component.html rename to shared/src/components/keyboard/slider/keyboard-slider.component.html diff --git a/src/components/keyboard/slider/keyboard-slider.component.scss b/shared/src/components/keyboard/slider/keyboard-slider.component.scss similarity index 100% rename from src/components/keyboard/slider/keyboard-slider.component.scss rename to shared/src/components/keyboard/slider/keyboard-slider.component.scss diff --git a/src/components/keyboard/slider/keyboard-slider.component.ts b/shared/src/components/keyboard/slider/keyboard-slider.component.ts similarity index 100% rename from src/components/keyboard/slider/keyboard-slider.component.ts rename to shared/src/components/keyboard/slider/keyboard-slider.component.ts diff --git a/src/components/keymap/add/keymap-add.component.html b/shared/src/components/keymap/add/keymap-add.component.html similarity index 100% rename from src/components/keymap/add/keymap-add.component.html rename to shared/src/components/keymap/add/keymap-add.component.html diff --git a/src/components/keymap/add/keymap-add.component.scss b/shared/src/components/keymap/add/keymap-add.component.scss similarity index 100% rename from src/components/keymap/add/keymap-add.component.scss rename to shared/src/components/keymap/add/keymap-add.component.scss diff --git a/src/components/keymap/add/keymap-add.component.ts b/shared/src/components/keymap/add/keymap-add.component.ts similarity index 100% rename from src/components/keymap/add/keymap-add.component.ts rename to shared/src/components/keymap/add/keymap-add.component.ts diff --git a/src/components/keymap/edit/index.ts b/shared/src/components/keymap/edit/index.ts similarity index 100% rename from src/components/keymap/edit/index.ts rename to shared/src/components/keymap/edit/index.ts diff --git a/src/components/keymap/edit/keymap-edit-guard.service.ts b/shared/src/components/keymap/edit/keymap-edit-guard.service.ts similarity index 100% rename from src/components/keymap/edit/keymap-edit-guard.service.ts rename to shared/src/components/keymap/edit/keymap-edit-guard.service.ts diff --git a/src/components/keymap/edit/keymap-edit.component.html b/shared/src/components/keymap/edit/keymap-edit.component.html similarity index 100% rename from src/components/keymap/edit/keymap-edit.component.html rename to shared/src/components/keymap/edit/keymap-edit.component.html diff --git a/src/components/keymap/edit/keymap-edit.component.scss b/shared/src/components/keymap/edit/keymap-edit.component.scss similarity index 100% rename from src/components/keymap/edit/keymap-edit.component.scss rename to shared/src/components/keymap/edit/keymap-edit.component.scss diff --git a/shared/src/components/keymap/edit/keymap-edit.component.ts b/shared/src/components/keymap/edit/keymap-edit.component.ts new file mode 100644 index 00000000..c895c13b --- /dev/null +++ b/shared/src/components/keymap/edit/keymap-edit.component.ts @@ -0,0 +1,44 @@ +import { Component } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; + +import '@ngrx/core/add/operator/select'; +import { Store } from '@ngrx/store'; + +import 'rxjs/add/operator/let'; +import 'rxjs/add/operator/publishReplay'; +import 'rxjs/add/operator/switchMap'; +import { Observable } from 'rxjs/Observable'; + +import { Keymap } from '../../../config-serializer/config-items/Keymap'; +import { AppState } from '../../../store'; +import { getKeymap, getKeymapEntities } from '../../../store/reducers/keymap'; + +@Component({ + selector: 'keymap-edit', + template: require('./keymap-edit.component.html'), + styles: [require('./keymap-edit.component.scss')], + host: { + 'class': 'container-fluid' + } +}) +export class KeymapEditComponent { + + protected keymap$: Observable; + private deletable$: Observable; + + constructor( + private store: Store, + private route: ActivatedRoute + ) { + this.keymap$ = route + .params + .select('abbr') + .switchMap((abbr: string) => store.let(getKeymap(abbr))) + .publishReplay(1) + .refCount(); + + this.deletable$ = store.let(getKeymapEntities()) + .map((keymaps: Keymap[]) => keymaps.length > 1); + } + +} diff --git a/src/components/keymap/header/keymap-header.component.html b/shared/src/components/keymap/header/keymap-header.component.html similarity index 100% rename from src/components/keymap/header/keymap-header.component.html rename to shared/src/components/keymap/header/keymap-header.component.html diff --git a/src/components/keymap/header/keymap-header.component.scss b/shared/src/components/keymap/header/keymap-header.component.scss similarity index 96% rename from src/components/keymap/header/keymap-header.component.scss rename to shared/src/components/keymap/header/keymap-header.component.scss index 8e33c95a..ce3eda58 100644 --- a/src/components/keymap/header/keymap-header.component.scss +++ b/shared/src/components/keymap/header/keymap-header.component.scss @@ -1,4 +1,4 @@ -@import '../../../main-app/global-styles'; +@import '../../../global-styles'; :host { display: block; diff --git a/src/components/keymap/header/keymap-header.component.ts b/shared/src/components/keymap/header/keymap-header.component.ts similarity index 100% rename from src/components/keymap/header/keymap-header.component.ts rename to shared/src/components/keymap/header/keymap-header.component.ts diff --git a/src/components/keymap/index.ts b/shared/src/components/keymap/index.ts similarity index 80% rename from src/components/keymap/index.ts rename to shared/src/components/keymap/index.ts index 8e041179..59089152 100644 --- a/src/components/keymap/index.ts +++ b/shared/src/components/keymap/index.ts @@ -1,4 +1,3 @@ -export * from './keymap.routes'; export * from './add/keymap-add.component'; export * from './edit/keymap-edit.component'; export * from './header/keymap-header.component'; diff --git a/src/components/layers/index.ts b/shared/src/components/layers/index.ts similarity index 100% rename from src/components/layers/index.ts rename to shared/src/components/layers/index.ts diff --git a/src/components/layers/layers.component.html b/shared/src/components/layers/layers.component.html similarity index 100% rename from src/components/layers/layers.component.html rename to shared/src/components/layers/layers.component.html diff --git a/src/components/layers/layers.component.scss b/shared/src/components/layers/layers.component.scss similarity index 100% rename from src/components/layers/layers.component.scss rename to shared/src/components/layers/layers.component.scss diff --git a/src/components/layers/layers.component.ts b/shared/src/components/layers/layers.component.ts similarity index 100% rename from src/components/layers/layers.component.ts rename to shared/src/components/layers/layers.component.ts diff --git a/src/components/macro/action-editor/index.ts b/shared/src/components/macro/action-editor/index.ts similarity index 100% rename from src/components/macro/action-editor/index.ts rename to shared/src/components/macro/action-editor/index.ts diff --git a/src/components/macro/action-editor/macro-action-editor.component.html b/shared/src/components/macro/action-editor/macro-action-editor.component.html similarity index 100% rename from src/components/macro/action-editor/macro-action-editor.component.html rename to shared/src/components/macro/action-editor/macro-action-editor.component.html diff --git a/src/components/macro/action-editor/macro-action-editor.component.scss b/shared/src/components/macro/action-editor/macro-action-editor.component.scss similarity index 97% rename from src/components/macro/action-editor/macro-action-editor.component.scss rename to shared/src/components/macro/action-editor/macro-action-editor.component.scss index a953cc0b..9bd46e5c 100644 --- a/src/components/macro/action-editor/macro-action-editor.component.scss +++ b/shared/src/components/macro/action-editor/macro-action-editor.component.scss @@ -1,4 +1,4 @@ -@import '../../../main-app/global-styles'; +@import '../../../global-styles'; :host { display: block; diff --git a/src/components/macro/action-editor/macro-action-editor.component.ts b/shared/src/components/macro/action-editor/macro-action-editor.component.ts similarity index 100% rename from src/components/macro/action-editor/macro-action-editor.component.ts rename to shared/src/components/macro/action-editor/macro-action-editor.component.ts diff --git a/src/components/macro/action-editor/tab/delay/index.ts b/shared/src/components/macro/action-editor/tab/delay/index.ts similarity index 100% rename from src/components/macro/action-editor/tab/delay/index.ts rename to shared/src/components/macro/action-editor/tab/delay/index.ts diff --git a/src/components/macro/action-editor/tab/delay/macro-delay.component.html b/shared/src/components/macro/action-editor/tab/delay/macro-delay.component.html similarity index 100% rename from src/components/macro/action-editor/tab/delay/macro-delay.component.html rename to shared/src/components/macro/action-editor/tab/delay/macro-delay.component.html diff --git a/src/components/macro/action-editor/tab/delay/macro-delay.component.scss b/shared/src/components/macro/action-editor/tab/delay/macro-delay.component.scss similarity index 100% rename from src/components/macro/action-editor/tab/delay/macro-delay.component.scss rename to shared/src/components/macro/action-editor/tab/delay/macro-delay.component.scss diff --git a/src/components/macro/action-editor/tab/delay/macro-delay.component.ts b/shared/src/components/macro/action-editor/tab/delay/macro-delay.component.ts similarity index 100% rename from src/components/macro/action-editor/tab/delay/macro-delay.component.ts rename to shared/src/components/macro/action-editor/tab/delay/macro-delay.component.ts diff --git a/src/components/macro/action-editor/tab/index.ts b/shared/src/components/macro/action-editor/tab/index.ts similarity index 100% rename from src/components/macro/action-editor/tab/index.ts rename to shared/src/components/macro/action-editor/tab/index.ts diff --git a/src/components/macro/action-editor/tab/key/index.ts b/shared/src/components/macro/action-editor/tab/key/index.ts similarity index 100% rename from src/components/macro/action-editor/tab/key/index.ts rename to shared/src/components/macro/action-editor/tab/key/index.ts diff --git a/src/components/macro/action-editor/tab/key/macro-key.component.html b/shared/src/components/macro/action-editor/tab/key/macro-key.component.html similarity index 100% rename from src/components/macro/action-editor/tab/key/macro-key.component.html rename to shared/src/components/macro/action-editor/tab/key/macro-key.component.html diff --git a/src/components/macro/action-editor/tab/key/macro-key.component.scss b/shared/src/components/macro/action-editor/tab/key/macro-key.component.scss similarity index 100% rename from src/components/macro/action-editor/tab/key/macro-key.component.scss rename to shared/src/components/macro/action-editor/tab/key/macro-key.component.scss diff --git a/src/components/macro/action-editor/tab/key/macro-key.component.ts b/shared/src/components/macro/action-editor/tab/key/macro-key.component.ts similarity index 100% rename from src/components/macro/action-editor/tab/key/macro-key.component.ts rename to shared/src/components/macro/action-editor/tab/key/macro-key.component.ts diff --git a/src/components/macro/action-editor/tab/mouse/index.ts b/shared/src/components/macro/action-editor/tab/mouse/index.ts similarity index 100% rename from src/components/macro/action-editor/tab/mouse/index.ts rename to shared/src/components/macro/action-editor/tab/mouse/index.ts diff --git a/src/components/macro/action-editor/tab/mouse/macro-mouse.component.html b/shared/src/components/macro/action-editor/tab/mouse/macro-mouse.component.html similarity index 100% rename from src/components/macro/action-editor/tab/mouse/macro-mouse.component.html rename to shared/src/components/macro/action-editor/tab/mouse/macro-mouse.component.html diff --git a/src/components/macro/action-editor/tab/mouse/macro-mouse.component.scss b/shared/src/components/macro/action-editor/tab/mouse/macro-mouse.component.scss similarity index 100% rename from src/components/macro/action-editor/tab/mouse/macro-mouse.component.scss rename to shared/src/components/macro/action-editor/tab/mouse/macro-mouse.component.scss diff --git a/src/components/macro/action-editor/tab/mouse/macro-mouse.component.ts b/shared/src/components/macro/action-editor/tab/mouse/macro-mouse.component.ts similarity index 100% rename from src/components/macro/action-editor/tab/mouse/macro-mouse.component.ts rename to shared/src/components/macro/action-editor/tab/mouse/macro-mouse.component.ts diff --git a/src/components/macro/action-editor/tab/text/index.ts b/shared/src/components/macro/action-editor/tab/text/index.ts similarity index 100% rename from src/components/macro/action-editor/tab/text/index.ts rename to shared/src/components/macro/action-editor/tab/text/index.ts diff --git a/src/components/macro/action-editor/tab/text/macro-text.component.html b/shared/src/components/macro/action-editor/tab/text/macro-text.component.html similarity index 100% rename from src/components/macro/action-editor/tab/text/macro-text.component.html rename to shared/src/components/macro/action-editor/tab/text/macro-text.component.html diff --git a/src/components/macro/action-editor/tab/text/macro-text.component.scss b/shared/src/components/macro/action-editor/tab/text/macro-text.component.scss similarity index 100% rename from src/components/macro/action-editor/tab/text/macro-text.component.scss rename to shared/src/components/macro/action-editor/tab/text/macro-text.component.scss diff --git a/src/components/macro/action-editor/tab/text/macro-text.component.ts b/shared/src/components/macro/action-editor/tab/text/macro-text.component.ts similarity index 100% rename from src/components/macro/action-editor/tab/text/macro-text.component.ts rename to shared/src/components/macro/action-editor/tab/text/macro-text.component.ts diff --git a/src/components/macro/edit/macro-edit.component.html b/shared/src/components/macro/edit/macro-edit.component.html similarity index 100% rename from src/components/macro/edit/macro-edit.component.html rename to shared/src/components/macro/edit/macro-edit.component.html diff --git a/src/components/macro/edit/macro-edit.component.scss b/shared/src/components/macro/edit/macro-edit.component.scss similarity index 100% rename from src/components/macro/edit/macro-edit.component.scss rename to shared/src/components/macro/edit/macro-edit.component.scss diff --git a/src/components/macro/edit/macro-edit.component.ts b/shared/src/components/macro/edit/macro-edit.component.ts similarity index 100% rename from src/components/macro/edit/macro-edit.component.ts rename to shared/src/components/macro/edit/macro-edit.component.ts diff --git a/src/components/macro/header/macro-header.component.html b/shared/src/components/macro/header/macro-header.component.html similarity index 100% rename from src/components/macro/header/macro-header.component.html rename to shared/src/components/macro/header/macro-header.component.html diff --git a/src/components/macro/header/macro-header.component.scss b/shared/src/components/macro/header/macro-header.component.scss similarity index 94% rename from src/components/macro/header/macro-header.component.scss rename to shared/src/components/macro/header/macro-header.component.scss index c10c2192..5d610f8e 100644 --- a/src/components/macro/header/macro-header.component.scss +++ b/shared/src/components/macro/header/macro-header.component.scss @@ -1,4 +1,4 @@ -@import '../../../main-app/global-styles'; +@import '../../../global-styles'; .macro { &__remove { diff --git a/src/components/macro/header/macro-header.component.ts b/shared/src/components/macro/header/macro-header.component.ts similarity index 100% rename from src/components/macro/header/macro-header.component.ts rename to shared/src/components/macro/header/macro-header.component.ts diff --git a/src/components/macro/index.ts b/shared/src/components/macro/index.ts similarity index 100% rename from src/components/macro/index.ts rename to shared/src/components/macro/index.ts diff --git a/src/components/macro/item/index.ts b/shared/src/components/macro/item/index.ts similarity index 100% rename from src/components/macro/item/index.ts rename to shared/src/components/macro/item/index.ts diff --git a/src/components/macro/item/macro-item.component.html b/shared/src/components/macro/item/macro-item.component.html similarity index 100% rename from src/components/macro/item/macro-item.component.html rename to shared/src/components/macro/item/macro-item.component.html diff --git a/src/components/macro/item/macro-item.component.scss b/shared/src/components/macro/item/macro-item.component.scss similarity index 96% rename from src/components/macro/item/macro-item.component.scss rename to shared/src/components/macro/item/macro-item.component.scss index 5170dcab..34c2870b 100644 --- a/src/components/macro/item/macro-item.component.scss +++ b/shared/src/components/macro/item/macro-item.component.scss @@ -1,4 +1,4 @@ -@import '../../../main-app/global-styles'; +@import '../../../global-styles'; :host { overflow: hidden; diff --git a/src/components/macro/item/macro-item.component.ts b/shared/src/components/macro/item/macro-item.component.ts similarity index 100% rename from src/components/macro/item/macro-item.component.ts rename to shared/src/components/macro/item/macro-item.component.ts diff --git a/src/components/macro/list/macro-list.component.html b/shared/src/components/macro/list/macro-list.component.html similarity index 100% rename from src/components/macro/list/macro-list.component.html rename to shared/src/components/macro/list/macro-list.component.html diff --git a/src/components/macro/list/macro-list.component.scss b/shared/src/components/macro/list/macro-list.component.scss similarity index 98% rename from src/components/macro/list/macro-list.component.scss rename to shared/src/components/macro/list/macro-list.component.scss index b587f218..766588eb 100644 --- a/src/components/macro/list/macro-list.component.scss +++ b/shared/src/components/macro/list/macro-list.component.scss @@ -1,4 +1,4 @@ -@import '../../../main-app/global-styles'; +@import '../../../global-styles'; :host { display: flex; diff --git a/src/components/macro/list/macro-list.component.ts b/shared/src/components/macro/list/macro-list.component.ts similarity index 100% rename from src/components/macro/list/macro-list.component.ts rename to shared/src/components/macro/list/macro-list.component.ts diff --git a/src/components/macro/macro.routes.ts b/shared/src/components/macro/macro.routes.ts similarity index 100% rename from src/components/macro/macro.routes.ts rename to shared/src/components/macro/macro.routes.ts diff --git a/src/components/macro/not-found/index.ts b/shared/src/components/macro/not-found/index.ts similarity index 100% rename from src/components/macro/not-found/index.ts rename to shared/src/components/macro/not-found/index.ts diff --git a/src/components/macro/not-found/macro-not-found-guard.service.ts b/shared/src/components/macro/not-found/macro-not-found-guard.service.ts similarity index 100% rename from src/components/macro/not-found/macro-not-found-guard.service.ts rename to shared/src/components/macro/not-found/macro-not-found-guard.service.ts diff --git a/src/components/macro/not-found/macro-not-found.component.html b/shared/src/components/macro/not-found/macro-not-found.component.html similarity index 100% rename from src/components/macro/not-found/macro-not-found.component.html rename to shared/src/components/macro/not-found/macro-not-found.component.html diff --git a/src/components/macro/not-found/macro-not-found.component.scss b/shared/src/components/macro/not-found/macro-not-found.component.scss similarity index 100% rename from src/components/macro/not-found/macro-not-found.component.scss rename to shared/src/components/macro/not-found/macro-not-found.component.scss diff --git a/src/components/macro/not-found/macro-not-found.component.ts b/shared/src/components/macro/not-found/macro-not-found.component.ts similarity index 100% rename from src/components/macro/not-found/macro-not-found.component.ts rename to shared/src/components/macro/not-found/macro-not-found.component.ts diff --git a/src/components/notification/index.ts b/shared/src/components/notification/index.ts similarity index 100% rename from src/components/notification/index.ts rename to shared/src/components/notification/index.ts diff --git a/src/components/notification/notification.component.html b/shared/src/components/notification/notification.component.html similarity index 100% rename from src/components/notification/notification.component.html rename to shared/src/components/notification/notification.component.html diff --git a/src/components/notification/notification.component.scss b/shared/src/components/notification/notification.component.scss similarity index 100% rename from src/components/notification/notification.component.scss rename to shared/src/components/notification/notification.component.scss diff --git a/src/components/notification/notification.component.ts b/shared/src/components/notification/notification.component.ts similarity index 100% rename from src/components/notification/notification.component.ts rename to shared/src/components/notification/notification.component.ts diff --git a/src/components/popover/index.ts b/shared/src/components/popover/index.ts similarity index 100% rename from src/components/popover/index.ts rename to shared/src/components/popover/index.ts diff --git a/src/components/popover/popover.component.html b/shared/src/components/popover/popover.component.html similarity index 100% rename from src/components/popover/popover.component.html rename to shared/src/components/popover/popover.component.html diff --git a/src/components/popover/popover.component.scss b/shared/src/components/popover/popover.component.scss similarity index 100% rename from src/components/popover/popover.component.scss rename to shared/src/components/popover/popover.component.scss diff --git a/src/components/popover/popover.component.ts b/shared/src/components/popover/popover.component.ts similarity index 100% rename from src/components/popover/popover.component.ts rename to shared/src/components/popover/popover.component.ts diff --git a/src/components/popover/tab/index.ts b/shared/src/components/popover/tab/index.ts similarity index 100% rename from src/components/popover/tab/index.ts rename to shared/src/components/popover/tab/index.ts diff --git a/src/components/popover/tab/keymap/index.ts b/shared/src/components/popover/tab/keymap/index.ts similarity index 100% rename from src/components/popover/tab/keymap/index.ts rename to shared/src/components/popover/tab/keymap/index.ts diff --git a/src/components/popover/tab/keymap/keymap-tab.component.html b/shared/src/components/popover/tab/keymap/keymap-tab.component.html similarity index 100% rename from src/components/popover/tab/keymap/keymap-tab.component.html rename to shared/src/components/popover/tab/keymap/keymap-tab.component.html diff --git a/src/components/popover/tab/keymap/keymap-tab.component.scss b/shared/src/components/popover/tab/keymap/keymap-tab.component.scss similarity index 100% rename from src/components/popover/tab/keymap/keymap-tab.component.scss rename to shared/src/components/popover/tab/keymap/keymap-tab.component.scss diff --git a/src/components/popover/tab/keymap/keymap-tab.component.ts b/shared/src/components/popover/tab/keymap/keymap-tab.component.ts similarity index 100% rename from src/components/popover/tab/keymap/keymap-tab.component.ts rename to shared/src/components/popover/tab/keymap/keymap-tab.component.ts diff --git a/src/components/popover/tab/keypress/index.ts b/shared/src/components/popover/tab/keypress/index.ts similarity index 100% rename from src/components/popover/tab/keypress/index.ts rename to shared/src/components/popover/tab/keypress/index.ts diff --git a/src/components/popover/tab/keypress/keypress-tab.component.html b/shared/src/components/popover/tab/keypress/keypress-tab.component.html similarity index 100% rename from src/components/popover/tab/keypress/keypress-tab.component.html rename to shared/src/components/popover/tab/keypress/keypress-tab.component.html diff --git a/src/components/popover/tab/keypress/keypress-tab.component.scss b/shared/src/components/popover/tab/keypress/keypress-tab.component.scss similarity index 100% rename from src/components/popover/tab/keypress/keypress-tab.component.scss rename to shared/src/components/popover/tab/keypress/keypress-tab.component.scss diff --git a/src/components/popover/tab/keypress/keypress-tab.component.ts b/shared/src/components/popover/tab/keypress/keypress-tab.component.ts similarity index 100% rename from src/components/popover/tab/keypress/keypress-tab.component.ts rename to shared/src/components/popover/tab/keypress/keypress-tab.component.ts diff --git a/src/components/popover/tab/keypress/longPress.json b/shared/src/components/popover/tab/keypress/longPress.json similarity index 100% rename from src/components/popover/tab/keypress/longPress.json rename to shared/src/components/popover/tab/keypress/longPress.json diff --git a/src/components/popover/tab/keypress/scancodes.json b/shared/src/components/popover/tab/keypress/scancodes.json similarity index 100% rename from src/components/popover/tab/keypress/scancodes.json rename to shared/src/components/popover/tab/keypress/scancodes.json diff --git a/src/components/popover/tab/layer/index.ts b/shared/src/components/popover/tab/layer/index.ts similarity index 100% rename from src/components/popover/tab/layer/index.ts rename to shared/src/components/popover/tab/layer/index.ts diff --git a/src/components/popover/tab/layer/layer-tab.component.html b/shared/src/components/popover/tab/layer/layer-tab.component.html similarity index 100% rename from src/components/popover/tab/layer/layer-tab.component.html rename to shared/src/components/popover/tab/layer/layer-tab.component.html diff --git a/src/components/popover/tab/layer/layer-tab.component.scss b/shared/src/components/popover/tab/layer/layer-tab.component.scss similarity index 100% rename from src/components/popover/tab/layer/layer-tab.component.scss rename to shared/src/components/popover/tab/layer/layer-tab.component.scss diff --git a/src/components/popover/tab/layer/layer-tab.component.ts b/shared/src/components/popover/tab/layer/layer-tab.component.ts similarity index 100% rename from src/components/popover/tab/layer/layer-tab.component.ts rename to shared/src/components/popover/tab/layer/layer-tab.component.ts diff --git a/src/components/popover/tab/macro/index.ts b/shared/src/components/popover/tab/macro/index.ts similarity index 100% rename from src/components/popover/tab/macro/index.ts rename to shared/src/components/popover/tab/macro/index.ts diff --git a/src/components/popover/tab/macro/macro-tab.component.html b/shared/src/components/popover/tab/macro/macro-tab.component.html similarity index 100% rename from src/components/popover/tab/macro/macro-tab.component.html rename to shared/src/components/popover/tab/macro/macro-tab.component.html diff --git a/src/components/popover/tab/macro/macro-tab.component.scss b/shared/src/components/popover/tab/macro/macro-tab.component.scss similarity index 100% rename from src/components/popover/tab/macro/macro-tab.component.scss rename to shared/src/components/popover/tab/macro/macro-tab.component.scss diff --git a/src/components/popover/tab/macro/macro-tab.component.ts b/shared/src/components/popover/tab/macro/macro-tab.component.ts similarity index 100% rename from src/components/popover/tab/macro/macro-tab.component.ts rename to shared/src/components/popover/tab/macro/macro-tab.component.ts diff --git a/src/components/popover/tab/mouse/index.ts b/shared/src/components/popover/tab/mouse/index.ts similarity index 100% rename from src/components/popover/tab/mouse/index.ts rename to shared/src/components/popover/tab/mouse/index.ts diff --git a/src/components/popover/tab/mouse/mouse-tab.component.html b/shared/src/components/popover/tab/mouse/mouse-tab.component.html similarity index 100% rename from src/components/popover/tab/mouse/mouse-tab.component.html rename to shared/src/components/popover/tab/mouse/mouse-tab.component.html diff --git a/src/components/popover/tab/mouse/mouse-tab.component.scss b/shared/src/components/popover/tab/mouse/mouse-tab.component.scss similarity index 97% rename from src/components/popover/tab/mouse/mouse-tab.component.scss rename to shared/src/components/popover/tab/mouse/mouse-tab.component.scss index 6bd7727b..deeb085c 100644 --- a/src/components/popover/tab/mouse/mouse-tab.component.scss +++ b/shared/src/components/popover/tab/mouse/mouse-tab.component.scss @@ -1,4 +1,4 @@ -@import '../../../../main-app/global-styles'; +@import '../../../../global-styles'; :host { display: flex; diff --git a/src/components/popover/tab/mouse/mouse-tab.component.ts b/shared/src/components/popover/tab/mouse/mouse-tab.component.ts similarity index 100% rename from src/components/popover/tab/mouse/mouse-tab.component.ts rename to shared/src/components/popover/tab/mouse/mouse-tab.component.ts diff --git a/src/components/popover/tab/none/index.ts b/shared/src/components/popover/tab/none/index.ts similarity index 100% rename from src/components/popover/tab/none/index.ts rename to shared/src/components/popover/tab/none/index.ts diff --git a/src/components/popover/tab/none/none-tab.component.html b/shared/src/components/popover/tab/none/none-tab.component.html similarity index 100% rename from src/components/popover/tab/none/none-tab.component.html rename to shared/src/components/popover/tab/none/none-tab.component.html diff --git a/src/components/popover/tab/none/none-tab.component.scss b/shared/src/components/popover/tab/none/none-tab.component.scss similarity index 100% rename from src/components/popover/tab/none/none-tab.component.scss rename to shared/src/components/popover/tab/none/none-tab.component.scss diff --git a/src/components/popover/tab/none/none-tab.component.ts b/shared/src/components/popover/tab/none/none-tab.component.ts similarity index 100% rename from src/components/popover/tab/none/none-tab.component.ts rename to shared/src/components/popover/tab/none/none-tab.component.ts diff --git a/src/components/popover/tab/tab.ts b/shared/src/components/popover/tab/tab.ts similarity index 100% rename from src/components/popover/tab/tab.ts rename to shared/src/components/popover/tab/tab.ts diff --git a/src/components/popover/widgets/capture-keystroke/capture-keystroke-button.component.html b/shared/src/components/popover/widgets/capture-keystroke/capture-keystroke-button.component.html similarity index 100% rename from src/components/popover/widgets/capture-keystroke/capture-keystroke-button.component.html rename to shared/src/components/popover/widgets/capture-keystroke/capture-keystroke-button.component.html diff --git a/src/components/popover/widgets/capture-keystroke/capture-keystroke-button.component.scss b/shared/src/components/popover/widgets/capture-keystroke/capture-keystroke-button.component.scss similarity index 100% rename from src/components/popover/widgets/capture-keystroke/capture-keystroke-button.component.scss rename to shared/src/components/popover/widgets/capture-keystroke/capture-keystroke-button.component.scss diff --git a/src/components/popover/widgets/capture-keystroke/capture-keystroke-button.component.ts b/shared/src/components/popover/widgets/capture-keystroke/capture-keystroke-button.component.ts similarity index 100% rename from src/components/popover/widgets/capture-keystroke/capture-keystroke-button.component.ts rename to shared/src/components/popover/widgets/capture-keystroke/capture-keystroke-button.component.ts diff --git a/src/components/popover/widgets/capture-keystroke/index.ts b/shared/src/components/popover/widgets/capture-keystroke/index.ts similarity index 100% rename from src/components/popover/widgets/capture-keystroke/index.ts rename to shared/src/components/popover/widgets/capture-keystroke/index.ts diff --git a/src/components/popover/widgets/icon/icon.component.html b/shared/src/components/popover/widgets/icon/icon.component.html similarity index 100% rename from src/components/popover/widgets/icon/icon.component.html rename to shared/src/components/popover/widgets/icon/icon.component.html diff --git a/src/components/popover/widgets/icon/icon.component.scss b/shared/src/components/popover/widgets/icon/icon.component.scss similarity index 86% rename from src/components/popover/widgets/icon/icon.component.scss rename to shared/src/components/popover/widgets/icon/icon.component.scss index 0a084a3d..fb1ee0a0 100644 --- a/src/components/popover/widgets/icon/icon.component.scss +++ b/shared/src/components/popover/widgets/icon/icon.component.scss @@ -1,4 +1,4 @@ -@import '../../../../main-app/global-styles'; +@import '../../../../global-styles'; :host { display: flex; diff --git a/src/components/popover/widgets/icon/icon.component.ts b/shared/src/components/popover/widgets/icon/icon.component.ts similarity index 100% rename from src/components/popover/widgets/icon/icon.component.ts rename to shared/src/components/popover/widgets/icon/icon.component.ts diff --git a/src/components/popover/widgets/icon/index.ts b/shared/src/components/popover/widgets/icon/index.ts similarity index 100% rename from src/components/popover/widgets/icon/index.ts rename to shared/src/components/popover/widgets/icon/index.ts diff --git a/src/components/settings/index.ts b/shared/src/components/settings/index.ts similarity index 100% rename from src/components/settings/index.ts rename to shared/src/components/settings/index.ts diff --git a/src/components/settings/settings.component.html b/shared/src/components/settings/settings.component.html similarity index 100% rename from src/components/settings/settings.component.html rename to shared/src/components/settings/settings.component.html diff --git a/src/components/settings/settings.component.scss b/shared/src/components/settings/settings.component.scss similarity index 100% rename from src/components/settings/settings.component.scss rename to shared/src/components/settings/settings.component.scss diff --git a/src/components/settings/settings.component.ts b/shared/src/components/settings/settings.component.ts similarity index 100% rename from src/components/settings/settings.component.ts rename to shared/src/components/settings/settings.component.ts diff --git a/src/components/settings/settings.routes.ts b/shared/src/components/settings/settings.routes.ts similarity index 100% rename from src/components/settings/settings.routes.ts rename to shared/src/components/settings/settings.routes.ts diff --git a/src/components/side-menu/index.ts b/shared/src/components/side-menu/index.ts similarity index 100% rename from src/components/side-menu/index.ts rename to shared/src/components/side-menu/index.ts diff --git a/src/components/side-menu/side-menu.component.html b/shared/src/components/side-menu/side-menu.component.html similarity index 100% rename from src/components/side-menu/side-menu.component.html rename to shared/src/components/side-menu/side-menu.component.html diff --git a/src/components/side-menu/side-menu.component.scss b/shared/src/components/side-menu/side-menu.component.scss similarity index 100% rename from src/components/side-menu/side-menu.component.scss rename to shared/src/components/side-menu/side-menu.component.scss diff --git a/src/components/side-menu/side-menu.component.ts b/shared/src/components/side-menu/side-menu.component.ts similarity index 100% rename from src/components/side-menu/side-menu.component.ts rename to shared/src/components/side-menu/side-menu.component.ts diff --git a/src/components/svg/keyboard/index.ts b/shared/src/components/svg/keyboard/index.ts similarity index 100% rename from src/components/svg/keyboard/index.ts rename to shared/src/components/svg/keyboard/index.ts diff --git a/src/components/svg/keyboard/svg-keyboard.component.html b/shared/src/components/svg/keyboard/svg-keyboard.component.html similarity index 100% rename from src/components/svg/keyboard/svg-keyboard.component.html rename to shared/src/components/svg/keyboard/svg-keyboard.component.html diff --git a/src/components/svg/keyboard/svg-keyboard.component.scss b/shared/src/components/svg/keyboard/svg-keyboard.component.scss similarity index 100% rename from src/components/svg/keyboard/svg-keyboard.component.scss rename to shared/src/components/svg/keyboard/svg-keyboard.component.scss diff --git a/src/components/svg/keyboard/svg-keyboard.component.ts b/shared/src/components/svg/keyboard/svg-keyboard.component.ts similarity index 96% rename from src/components/svg/keyboard/svg-keyboard.component.ts rename to shared/src/components/svg/keyboard/svg-keyboard.component.ts index 86164038..27c60bd1 100644 --- a/src/components/svg/keyboard/svg-keyboard.component.ts +++ b/shared/src/components/svg/keyboard/svg-keyboard.component.ts @@ -68,7 +68,7 @@ export class SvgKeyboardComponent implements OnInit { } private getBaseLayer(): any { - return require('xml!../../../../images/base-layer.svg').svg; + return require('xml!../../../../../images/base-layer.svg').svg; } } diff --git a/src/components/svg/keys/index.ts b/shared/src/components/svg/keys/index.ts similarity index 100% rename from src/components/svg/keys/index.ts rename to shared/src/components/svg/keys/index.ts diff --git a/src/components/svg/keys/svg-icon-text-key/index.ts b/shared/src/components/svg/keys/svg-icon-text-key/index.ts similarity index 100% rename from src/components/svg/keys/svg-icon-text-key/index.ts rename to shared/src/components/svg/keys/svg-icon-text-key/index.ts diff --git a/src/components/svg/keys/svg-icon-text-key/svg-icon-text-key.component.html b/shared/src/components/svg/keys/svg-icon-text-key/svg-icon-text-key.component.html similarity index 100% rename from src/components/svg/keys/svg-icon-text-key/svg-icon-text-key.component.html rename to shared/src/components/svg/keys/svg-icon-text-key/svg-icon-text-key.component.html diff --git a/src/components/svg/keys/svg-icon-text-key/svg-icon-text-key.component.ts b/shared/src/components/svg/keys/svg-icon-text-key/svg-icon-text-key.component.ts similarity index 100% rename from src/components/svg/keys/svg-icon-text-key/svg-icon-text-key.component.ts rename to shared/src/components/svg/keys/svg-icon-text-key/svg-icon-text-key.component.ts diff --git a/src/components/svg/keys/svg-keyboard-key/index.ts b/shared/src/components/svg/keys/svg-keyboard-key/index.ts similarity index 100% rename from src/components/svg/keys/svg-keyboard-key/index.ts rename to shared/src/components/svg/keys/svg-keyboard-key/index.ts diff --git a/src/components/svg/keys/svg-keyboard-key/svg-keyboard-key.component.html b/shared/src/components/svg/keys/svg-keyboard-key/svg-keyboard-key.component.html similarity index 100% rename from src/components/svg/keys/svg-keyboard-key/svg-keyboard-key.component.html rename to shared/src/components/svg/keys/svg-keyboard-key/svg-keyboard-key.component.html diff --git a/src/components/svg/keys/svg-keyboard-key/svg-keyboard-key.component.scss b/shared/src/components/svg/keys/svg-keyboard-key/svg-keyboard-key.component.scss similarity index 100% rename from src/components/svg/keys/svg-keyboard-key/svg-keyboard-key.component.scss rename to shared/src/components/svg/keys/svg-keyboard-key/svg-keyboard-key.component.scss diff --git a/src/components/svg/keys/svg-keyboard-key/svg-keyboard-key.component.ts b/shared/src/components/svg/keys/svg-keyboard-key/svg-keyboard-key.component.ts similarity index 100% rename from src/components/svg/keys/svg-keyboard-key/svg-keyboard-key.component.ts rename to shared/src/components/svg/keys/svg-keyboard-key/svg-keyboard-key.component.ts diff --git a/src/components/svg/keys/svg-keyboard-key/svg-keyboard-key.model.ts b/shared/src/components/svg/keys/svg-keyboard-key/svg-keyboard-key.model.ts similarity index 100% rename from src/components/svg/keys/svg-keyboard-key/svg-keyboard-key.model.ts rename to shared/src/components/svg/keys/svg-keyboard-key/svg-keyboard-key.model.ts diff --git a/src/components/svg/keys/svg-keystroke-key/index.ts b/shared/src/components/svg/keys/svg-keystroke-key/index.ts similarity index 100% rename from src/components/svg/keys/svg-keystroke-key/index.ts rename to shared/src/components/svg/keys/svg-keystroke-key/index.ts diff --git a/src/components/svg/keys/svg-keystroke-key/svg-keystroke-key.component.html b/shared/src/components/svg/keys/svg-keystroke-key/svg-keystroke-key.component.html similarity index 100% rename from src/components/svg/keys/svg-keystroke-key/svg-keystroke-key.component.html rename to shared/src/components/svg/keys/svg-keystroke-key/svg-keystroke-key.component.html diff --git a/src/components/svg/keys/svg-keystroke-key/svg-keystroke-key.component.scss b/shared/src/components/svg/keys/svg-keystroke-key/svg-keystroke-key.component.scss similarity index 100% rename from src/components/svg/keys/svg-keystroke-key/svg-keystroke-key.component.scss rename to shared/src/components/svg/keys/svg-keystroke-key/svg-keystroke-key.component.scss diff --git a/src/components/svg/keys/svg-keystroke-key/svg-keystroke-key.component.ts b/shared/src/components/svg/keys/svg-keystroke-key/svg-keystroke-key.component.ts similarity index 100% rename from src/components/svg/keys/svg-keystroke-key/svg-keystroke-key.component.ts rename to shared/src/components/svg/keys/svg-keystroke-key/svg-keystroke-key.component.ts diff --git a/src/components/svg/keys/svg-mouse-click-key/index.ts b/shared/src/components/svg/keys/svg-mouse-click-key/index.ts similarity index 100% rename from src/components/svg/keys/svg-mouse-click-key/index.ts rename to shared/src/components/svg/keys/svg-mouse-click-key/index.ts diff --git a/src/components/svg/keys/svg-mouse-click-key/svg-mouse-click-key.html b/shared/src/components/svg/keys/svg-mouse-click-key/svg-mouse-click-key.html similarity index 100% rename from src/components/svg/keys/svg-mouse-click-key/svg-mouse-click-key.html rename to shared/src/components/svg/keys/svg-mouse-click-key/svg-mouse-click-key.html diff --git a/src/components/svg/keys/svg-mouse-click-key/svg-mouse-click-key.ts b/shared/src/components/svg/keys/svg-mouse-click-key/svg-mouse-click-key.ts similarity index 100% rename from src/components/svg/keys/svg-mouse-click-key/svg-mouse-click-key.ts rename to shared/src/components/svg/keys/svg-mouse-click-key/svg-mouse-click-key.ts diff --git a/src/components/svg/keys/svg-mouse-key/index.ts b/shared/src/components/svg/keys/svg-mouse-key/index.ts similarity index 100% rename from src/components/svg/keys/svg-mouse-key/index.ts rename to shared/src/components/svg/keys/svg-mouse-key/index.ts diff --git a/src/components/svg/keys/svg-mouse-key/svg-mouse-key.html b/shared/src/components/svg/keys/svg-mouse-key/svg-mouse-key.html similarity index 100% rename from src/components/svg/keys/svg-mouse-key/svg-mouse-key.html rename to shared/src/components/svg/keys/svg-mouse-key/svg-mouse-key.html diff --git a/src/components/svg/keys/svg-mouse-key/svg-mouse-key.ts b/shared/src/components/svg/keys/svg-mouse-key/svg-mouse-key.ts similarity index 100% rename from src/components/svg/keys/svg-mouse-key/svg-mouse-key.ts rename to shared/src/components/svg/keys/svg-mouse-key/svg-mouse-key.ts diff --git a/src/components/svg/keys/svg-mouse-move-key/index.ts b/shared/src/components/svg/keys/svg-mouse-move-key/index.ts similarity index 100% rename from src/components/svg/keys/svg-mouse-move-key/index.ts rename to shared/src/components/svg/keys/svg-mouse-move-key/index.ts diff --git a/src/components/svg/keys/svg-mouse-move-key/svg-mouse-move-key.html b/shared/src/components/svg/keys/svg-mouse-move-key/svg-mouse-move-key.html similarity index 100% rename from src/components/svg/keys/svg-mouse-move-key/svg-mouse-move-key.html rename to shared/src/components/svg/keys/svg-mouse-move-key/svg-mouse-move-key.html diff --git a/src/components/svg/keys/svg-mouse-move-key/svg-mouse-move-key.ts b/shared/src/components/svg/keys/svg-mouse-move-key/svg-mouse-move-key.ts similarity index 100% rename from src/components/svg/keys/svg-mouse-move-key/svg-mouse-move-key.ts rename to shared/src/components/svg/keys/svg-mouse-move-key/svg-mouse-move-key.ts diff --git a/src/components/svg/keys/svg-mouse-scroll-key/index.ts b/shared/src/components/svg/keys/svg-mouse-scroll-key/index.ts similarity index 100% rename from src/components/svg/keys/svg-mouse-scroll-key/index.ts rename to shared/src/components/svg/keys/svg-mouse-scroll-key/index.ts diff --git a/src/components/svg/keys/svg-mouse-scroll-key/svg-mouse-scroll-key.html b/shared/src/components/svg/keys/svg-mouse-scroll-key/svg-mouse-scroll-key.html similarity index 100% rename from src/components/svg/keys/svg-mouse-scroll-key/svg-mouse-scroll-key.html rename to shared/src/components/svg/keys/svg-mouse-scroll-key/svg-mouse-scroll-key.html diff --git a/src/components/svg/keys/svg-mouse-scroll-key/svg-mouse-scroll-key.ts b/shared/src/components/svg/keys/svg-mouse-scroll-key/svg-mouse-scroll-key.ts similarity index 100% rename from src/components/svg/keys/svg-mouse-scroll-key/svg-mouse-scroll-key.ts rename to shared/src/components/svg/keys/svg-mouse-scroll-key/svg-mouse-scroll-key.ts diff --git a/src/components/svg/keys/svg-mouse-speed-key/index.ts b/shared/src/components/svg/keys/svg-mouse-speed-key/index.ts similarity index 100% rename from src/components/svg/keys/svg-mouse-speed-key/index.ts rename to shared/src/components/svg/keys/svg-mouse-speed-key/index.ts diff --git a/src/components/svg/keys/svg-mouse-speed-key/svg-mouse-speed-key.html b/shared/src/components/svg/keys/svg-mouse-speed-key/svg-mouse-speed-key.html similarity index 100% rename from src/components/svg/keys/svg-mouse-speed-key/svg-mouse-speed-key.html rename to shared/src/components/svg/keys/svg-mouse-speed-key/svg-mouse-speed-key.html diff --git a/src/components/svg/keys/svg-mouse-speed-key/svg-mouse-speed-key.ts b/shared/src/components/svg/keys/svg-mouse-speed-key/svg-mouse-speed-key.ts similarity index 100% rename from src/components/svg/keys/svg-mouse-speed-key/svg-mouse-speed-key.ts rename to shared/src/components/svg/keys/svg-mouse-speed-key/svg-mouse-speed-key.ts diff --git a/src/components/svg/keys/svg-one-line-text-key/index.ts b/shared/src/components/svg/keys/svg-one-line-text-key/index.ts similarity index 100% rename from src/components/svg/keys/svg-one-line-text-key/index.ts rename to shared/src/components/svg/keys/svg-one-line-text-key/index.ts diff --git a/src/components/svg/keys/svg-one-line-text-key/svg-one-line-text-key.component.html b/shared/src/components/svg/keys/svg-one-line-text-key/svg-one-line-text-key.component.html similarity index 100% rename from src/components/svg/keys/svg-one-line-text-key/svg-one-line-text-key.component.html rename to shared/src/components/svg/keys/svg-one-line-text-key/svg-one-line-text-key.component.html diff --git a/src/components/svg/keys/svg-one-line-text-key/svg-one-line-text-key.component.ts b/shared/src/components/svg/keys/svg-one-line-text-key/svg-one-line-text-key.component.ts similarity index 100% rename from src/components/svg/keys/svg-one-line-text-key/svg-one-line-text-key.component.ts rename to shared/src/components/svg/keys/svg-one-line-text-key/svg-one-line-text-key.component.ts diff --git a/src/components/svg/keys/svg-single-icon-key/index.ts b/shared/src/components/svg/keys/svg-single-icon-key/index.ts similarity index 100% rename from src/components/svg/keys/svg-single-icon-key/index.ts rename to shared/src/components/svg/keys/svg-single-icon-key/index.ts diff --git a/src/components/svg/keys/svg-single-icon-key/svg-single-icon-key.component.html b/shared/src/components/svg/keys/svg-single-icon-key/svg-single-icon-key.component.html similarity index 100% rename from src/components/svg/keys/svg-single-icon-key/svg-single-icon-key.component.html rename to shared/src/components/svg/keys/svg-single-icon-key/svg-single-icon-key.component.html diff --git a/src/components/svg/keys/svg-single-icon-key/svg-single-icon-key.component.ts b/shared/src/components/svg/keys/svg-single-icon-key/svg-single-icon-key.component.ts similarity index 100% rename from src/components/svg/keys/svg-single-icon-key/svg-single-icon-key.component.ts rename to shared/src/components/svg/keys/svg-single-icon-key/svg-single-icon-key.component.ts diff --git a/src/components/svg/keys/svg-switch-keymap-key/index.ts b/shared/src/components/svg/keys/svg-switch-keymap-key/index.ts similarity index 100% rename from src/components/svg/keys/svg-switch-keymap-key/index.ts rename to shared/src/components/svg/keys/svg-switch-keymap-key/index.ts diff --git a/src/components/svg/keys/svg-switch-keymap-key/svg-switch-keymap-key.component.html b/shared/src/components/svg/keys/svg-switch-keymap-key/svg-switch-keymap-key.component.html similarity index 100% rename from src/components/svg/keys/svg-switch-keymap-key/svg-switch-keymap-key.component.html rename to shared/src/components/svg/keys/svg-switch-keymap-key/svg-switch-keymap-key.component.html diff --git a/src/components/svg/keys/svg-switch-keymap-key/svg-switch-keymap-key.component.ts b/shared/src/components/svg/keys/svg-switch-keymap-key/svg-switch-keymap-key.component.ts similarity index 100% rename from src/components/svg/keys/svg-switch-keymap-key/svg-switch-keymap-key.component.ts rename to shared/src/components/svg/keys/svg-switch-keymap-key/svg-switch-keymap-key.component.ts diff --git a/src/components/svg/keys/svg-text-icon-key/index.ts b/shared/src/components/svg/keys/svg-text-icon-key/index.ts similarity index 100% rename from src/components/svg/keys/svg-text-icon-key/index.ts rename to shared/src/components/svg/keys/svg-text-icon-key/index.ts diff --git a/src/components/svg/keys/svg-text-icon-key/svg-text-icon-key.component.html b/shared/src/components/svg/keys/svg-text-icon-key/svg-text-icon-key.component.html similarity index 100% rename from src/components/svg/keys/svg-text-icon-key/svg-text-icon-key.component.html rename to shared/src/components/svg/keys/svg-text-icon-key/svg-text-icon-key.component.html diff --git a/src/components/svg/keys/svg-text-icon-key/svg-text-icon-key.component.ts b/shared/src/components/svg/keys/svg-text-icon-key/svg-text-icon-key.component.ts similarity index 100% rename from src/components/svg/keys/svg-text-icon-key/svg-text-icon-key.component.ts rename to shared/src/components/svg/keys/svg-text-icon-key/svg-text-icon-key.component.ts diff --git a/src/components/svg/keys/svg-two-line-text-key/index.ts b/shared/src/components/svg/keys/svg-two-line-text-key/index.ts similarity index 100% rename from src/components/svg/keys/svg-two-line-text-key/index.ts rename to shared/src/components/svg/keys/svg-two-line-text-key/index.ts diff --git a/src/components/svg/keys/svg-two-line-text-key/svg-two-line-text-key.component.html b/shared/src/components/svg/keys/svg-two-line-text-key/svg-two-line-text-key.component.html similarity index 100% rename from src/components/svg/keys/svg-two-line-text-key/svg-two-line-text-key.component.html rename to shared/src/components/svg/keys/svg-two-line-text-key/svg-two-line-text-key.component.html diff --git a/src/components/svg/keys/svg-two-line-text-key/svg-two-line-text-key.component.ts b/shared/src/components/svg/keys/svg-two-line-text-key/svg-two-line-text-key.component.ts similarity index 100% rename from src/components/svg/keys/svg-two-line-text-key/svg-two-line-text-key.component.ts rename to shared/src/components/svg/keys/svg-two-line-text-key/svg-two-line-text-key.component.ts diff --git a/src/components/svg/module/index.ts b/shared/src/components/svg/module/index.ts similarity index 100% rename from src/components/svg/module/index.ts rename to shared/src/components/svg/module/index.ts diff --git a/src/components/svg/module/svg-module.component.html b/shared/src/components/svg/module/svg-module.component.html similarity index 100% rename from src/components/svg/module/svg-module.component.html rename to shared/src/components/svg/module/svg-module.component.html diff --git a/src/components/svg/module/svg-module.component.scss b/shared/src/components/svg/module/svg-module.component.scss similarity index 100% rename from src/components/svg/module/svg-module.component.scss rename to shared/src/components/svg/module/svg-module.component.scss diff --git a/src/components/svg/module/svg-module.component.ts b/shared/src/components/svg/module/svg-module.component.ts similarity index 100% rename from src/components/svg/module/svg-module.component.ts rename to shared/src/components/svg/module/svg-module.component.ts diff --git a/src/components/svg/module/svg-module.model.ts b/shared/src/components/svg/module/svg-module.model.ts similarity index 100% rename from src/components/svg/module/svg-module.model.ts rename to shared/src/components/svg/module/svg-module.model.ts diff --git a/src/components/svg/wrap/index.ts b/shared/src/components/svg/wrap/index.ts similarity index 100% rename from src/components/svg/wrap/index.ts rename to shared/src/components/svg/wrap/index.ts diff --git a/src/components/svg/wrap/svg-keyboard-wrap.component.html b/shared/src/components/svg/wrap/svg-keyboard-wrap.component.html similarity index 100% rename from src/components/svg/wrap/svg-keyboard-wrap.component.html rename to shared/src/components/svg/wrap/svg-keyboard-wrap.component.html diff --git a/src/components/svg/wrap/svg-keyboard-wrap.component.scss b/shared/src/components/svg/wrap/svg-keyboard-wrap.component.scss similarity index 100% rename from src/components/svg/wrap/svg-keyboard-wrap.component.scss rename to shared/src/components/svg/wrap/svg-keyboard-wrap.component.scss diff --git a/src/components/svg/wrap/svg-keyboard-wrap.component.ts b/shared/src/components/svg/wrap/svg-keyboard-wrap.component.ts similarity index 100% rename from src/components/svg/wrap/svg-keyboard-wrap.component.ts rename to shared/src/components/svg/wrap/svg-keyboard-wrap.component.ts diff --git a/src/config-serializer/Function.d.ts b/shared/src/config-serializer/Function.d.ts similarity index 100% rename from src/config-serializer/Function.d.ts rename to shared/src/config-serializer/Function.d.ts diff --git a/src/config-serializer/README.md b/shared/src/config-serializer/README.md similarity index 100% rename from src/config-serializer/README.md rename to shared/src/config-serializer/README.md diff --git a/src/config-serializer/UhkBuffer.ts b/shared/src/config-serializer/UhkBuffer.ts similarity index 100% rename from src/config-serializer/UhkBuffer.ts rename to shared/src/config-serializer/UhkBuffer.ts diff --git a/src/config-serializer/assert.ts b/shared/src/config-serializer/assert.ts similarity index 100% rename from src/config-serializer/assert.ts rename to shared/src/config-serializer/assert.ts diff --git a/src/config-serializer/config-items/HardwareConfiguration.ts b/shared/src/config-serializer/config-items/HardwareConfiguration.ts similarity index 100% rename from src/config-serializer/config-items/HardwareConfiguration.ts rename to shared/src/config-serializer/config-items/HardwareConfiguration.ts diff --git a/src/config-serializer/config-items/KeyModifiers.ts b/shared/src/config-serializer/config-items/KeyModifiers.ts similarity index 100% rename from src/config-serializer/config-items/KeyModifiers.ts rename to shared/src/config-serializer/config-items/KeyModifiers.ts diff --git a/src/config-serializer/config-items/Keymap.ts b/shared/src/config-serializer/config-items/Keymap.ts similarity index 100% rename from src/config-serializer/config-items/Keymap.ts rename to shared/src/config-serializer/config-items/Keymap.ts diff --git a/src/config-serializer/config-items/Layer.ts b/shared/src/config-serializer/config-items/Layer.ts similarity index 100% rename from src/config-serializer/config-items/Layer.ts rename to shared/src/config-serializer/config-items/Layer.ts diff --git a/src/config-serializer/config-items/LongPressAction.ts b/shared/src/config-serializer/config-items/LongPressAction.ts similarity index 100% rename from src/config-serializer/config-items/LongPressAction.ts rename to shared/src/config-serializer/config-items/LongPressAction.ts diff --git a/src/config-serializer/config-items/Macro.ts b/shared/src/config-serializer/config-items/Macro.ts similarity index 100% rename from src/config-serializer/config-items/Macro.ts rename to shared/src/config-serializer/config-items/Macro.ts diff --git a/src/config-serializer/config-items/Module.ts b/shared/src/config-serializer/config-items/Module.ts similarity index 100% rename from src/config-serializer/config-items/Module.ts rename to shared/src/config-serializer/config-items/Module.ts diff --git a/src/config-serializer/config-items/ModuleConfiguration.ts b/shared/src/config-serializer/config-items/ModuleConfiguration.ts similarity index 100% rename from src/config-serializer/config-items/ModuleConfiguration.ts rename to shared/src/config-serializer/config-items/ModuleConfiguration.ts diff --git a/src/config-serializer/config-items/UserConfiguration.ts b/shared/src/config-serializer/config-items/UserConfiguration.ts similarity index 100% rename from src/config-serializer/config-items/UserConfiguration.ts rename to shared/src/config-serializer/config-items/UserConfiguration.ts diff --git a/src/config-serializer/config-items/key-action/KeyAction.ts b/shared/src/config-serializer/config-items/key-action/KeyAction.ts similarity index 100% rename from src/config-serializer/config-items/key-action/KeyAction.ts rename to shared/src/config-serializer/config-items/key-action/KeyAction.ts diff --git a/src/config-serializer/config-items/key-action/KeystrokeAction.ts b/shared/src/config-serializer/config-items/key-action/KeystrokeAction.ts similarity index 100% rename from src/config-serializer/config-items/key-action/KeystrokeAction.ts rename to shared/src/config-serializer/config-items/key-action/KeystrokeAction.ts diff --git a/src/config-serializer/config-items/key-action/MouseAction.ts b/shared/src/config-serializer/config-items/key-action/MouseAction.ts similarity index 100% rename from src/config-serializer/config-items/key-action/MouseAction.ts rename to shared/src/config-serializer/config-items/key-action/MouseAction.ts diff --git a/src/config-serializer/config-items/key-action/NoneAction.ts b/shared/src/config-serializer/config-items/key-action/NoneAction.ts similarity index 100% rename from src/config-serializer/config-items/key-action/NoneAction.ts rename to shared/src/config-serializer/config-items/key-action/NoneAction.ts diff --git a/src/config-serializer/config-items/key-action/PlayMacroAction.ts b/shared/src/config-serializer/config-items/key-action/PlayMacroAction.ts similarity index 100% rename from src/config-serializer/config-items/key-action/PlayMacroAction.ts rename to shared/src/config-serializer/config-items/key-action/PlayMacroAction.ts diff --git a/src/config-serializer/config-items/key-action/SwitchKeymapAction.ts b/shared/src/config-serializer/config-items/key-action/SwitchKeymapAction.ts similarity index 100% rename from src/config-serializer/config-items/key-action/SwitchKeymapAction.ts rename to shared/src/config-serializer/config-items/key-action/SwitchKeymapAction.ts diff --git a/src/config-serializer/config-items/key-action/SwitchLayerAction.ts b/shared/src/config-serializer/config-items/key-action/SwitchLayerAction.ts similarity index 100% rename from src/config-serializer/config-items/key-action/SwitchLayerAction.ts rename to shared/src/config-serializer/config-items/key-action/SwitchLayerAction.ts diff --git a/src/config-serializer/config-items/key-action/helper.ts b/shared/src/config-serializer/config-items/key-action/helper.ts similarity index 100% rename from src/config-serializer/config-items/key-action/helper.ts rename to shared/src/config-serializer/config-items/key-action/helper.ts diff --git a/src/config-serializer/config-items/key-action/index.ts b/shared/src/config-serializer/config-items/key-action/index.ts similarity index 100% rename from src/config-serializer/config-items/key-action/index.ts rename to shared/src/config-serializer/config-items/key-action/index.ts diff --git a/src/config-serializer/config-items/macro-action/DelayMacroAction.ts b/shared/src/config-serializer/config-items/macro-action/DelayMacroAction.ts similarity index 100% rename from src/config-serializer/config-items/macro-action/DelayMacroAction.ts rename to shared/src/config-serializer/config-items/macro-action/DelayMacroAction.ts diff --git a/src/config-serializer/config-items/macro-action/EditableMacroAction.ts b/shared/src/config-serializer/config-items/macro-action/EditableMacroAction.ts similarity index 100% rename from src/config-serializer/config-items/macro-action/EditableMacroAction.ts rename to shared/src/config-serializer/config-items/macro-action/EditableMacroAction.ts diff --git a/src/config-serializer/config-items/macro-action/KeyMacroAction.ts b/shared/src/config-serializer/config-items/macro-action/KeyMacroAction.ts similarity index 100% rename from src/config-serializer/config-items/macro-action/KeyMacroAction.ts rename to shared/src/config-serializer/config-items/macro-action/KeyMacroAction.ts diff --git a/src/config-serializer/config-items/macro-action/MacroAction.ts b/shared/src/config-serializer/config-items/macro-action/MacroAction.ts similarity index 100% rename from src/config-serializer/config-items/macro-action/MacroAction.ts rename to shared/src/config-serializer/config-items/macro-action/MacroAction.ts diff --git a/src/config-serializer/config-items/macro-action/MouseButtonMacroAction.ts b/shared/src/config-serializer/config-items/macro-action/MouseButtonMacroAction.ts similarity index 100% rename from src/config-serializer/config-items/macro-action/MouseButtonMacroAction.ts rename to shared/src/config-serializer/config-items/macro-action/MouseButtonMacroAction.ts diff --git a/src/config-serializer/config-items/macro-action/MoveMouseMacroAction.ts b/shared/src/config-serializer/config-items/macro-action/MoveMouseMacroAction.ts similarity index 100% rename from src/config-serializer/config-items/macro-action/MoveMouseMacroAction.ts rename to shared/src/config-serializer/config-items/macro-action/MoveMouseMacroAction.ts diff --git a/src/config-serializer/config-items/macro-action/ScrollMouseMacroAction.ts b/shared/src/config-serializer/config-items/macro-action/ScrollMouseMacroAction.ts similarity index 100% rename from src/config-serializer/config-items/macro-action/ScrollMouseMacroAction.ts rename to shared/src/config-serializer/config-items/macro-action/ScrollMouseMacroAction.ts diff --git a/src/config-serializer/config-items/macro-action/TextMacroAction.ts b/shared/src/config-serializer/config-items/macro-action/TextMacroAction.ts similarity index 100% rename from src/config-serializer/config-items/macro-action/TextMacroAction.ts rename to shared/src/config-serializer/config-items/macro-action/TextMacroAction.ts diff --git a/src/config-serializer/config-items/macro-action/helper.ts b/shared/src/config-serializer/config-items/macro-action/helper.ts similarity index 100% rename from src/config-serializer/config-items/macro-action/helper.ts rename to shared/src/config-serializer/config-items/macro-action/helper.ts diff --git a/src/config-serializer/config-items/macro-action/index.ts b/shared/src/config-serializer/config-items/macro-action/index.ts similarity index 100% rename from src/config-serializer/config-items/macro-action/index.ts rename to shared/src/config-serializer/config-items/macro-action/index.ts diff --git a/src/config-serializer/config-schema.json b/shared/src/config-serializer/config-schema.json similarity index 100% rename from src/config-serializer/config-schema.json rename to shared/src/config-serializer/config-schema.json diff --git a/src/config-serializer/hardware-config.json b/shared/src/config-serializer/hardware-config.json similarity index 100% rename from src/config-serializer/hardware-config.json rename to shared/src/config-serializer/hardware-config.json diff --git a/src/config-serializer/preset-keymaps.json b/shared/src/config-serializer/preset-keymaps.json similarity index 100% rename from src/config-serializer/preset-keymaps.json rename to shared/src/config-serializer/preset-keymaps.json diff --git a/src/config-serializer/user-config.json b/shared/src/config-serializer/user-config.json similarity index 100% rename from src/config-serializer/user-config.json rename to shared/src/config-serializer/user-config.json diff --git a/src/directives/cancelable/cancelable.directive.ts b/shared/src/directives/cancelable/cancelable.directive.ts similarity index 100% rename from src/directives/cancelable/cancelable.directive.ts rename to shared/src/directives/cancelable/cancelable.directive.ts diff --git a/src/directives/cancelable/index.ts b/shared/src/directives/cancelable/index.ts similarity index 100% rename from src/directives/cancelable/index.ts rename to shared/src/directives/cancelable/index.ts diff --git a/src/directives/index.ts b/shared/src/directives/index.ts similarity index 100% rename from src/directives/index.ts rename to shared/src/directives/index.ts diff --git a/src/main-app/global-styles.scss b/shared/src/global-styles.scss similarity index 100% rename from src/main-app/global-styles.scss rename to shared/src/global-styles.scss diff --git a/src/main-app/main-app.component.html b/shared/src/main-app/main-app.component.html similarity index 100% rename from src/main-app/main-app.component.html rename to shared/src/main-app/main-app.component.html diff --git a/src/main-app/main-app.component.scss b/shared/src/main-app/main-app.component.scss similarity index 100% rename from src/main-app/main-app.component.scss rename to shared/src/main-app/main-app.component.scss diff --git a/src/polyfills.ts b/shared/src/polyfills.ts similarity index 100% rename from src/polyfills.ts rename to shared/src/polyfills.ts diff --git a/src/services/capture.service.ts b/shared/src/services/capture.service.ts similarity index 100% rename from src/services/capture.service.ts rename to shared/src/services/capture.service.ts diff --git a/src/services/mapper.service.ts b/shared/src/services/mapper.service.ts similarity index 98% rename from src/services/mapper.service.ts rename to shared/src/services/mapper.service.ts index 60ccff6a..7ffd7089 100644 --- a/src/services/mapper.service.ts +++ b/shared/src/services/mapper.service.ts @@ -1,5 +1,5 @@ /* tslint:disable:variable-name */ -const __svg__ = { path: '../../images/icons/**/*.svg', name: 'assets/compiled_sprite.svg' }; +const __svg__ = { path: '../../../images/icons/**/*.svg', name: 'assets/compiled_sprite.svg' }; /* tslint:enable:variable-name */ import { Injectable } from '@angular/core'; diff --git a/src/store/actions/index.ts b/shared/src/store/actions/index.ts similarity index 100% rename from src/store/actions/index.ts rename to shared/src/store/actions/index.ts diff --git a/src/store/actions/keymap.ts b/shared/src/store/actions/keymap.ts similarity index 100% rename from src/store/actions/keymap.ts rename to shared/src/store/actions/keymap.ts diff --git a/src/store/actions/macro.ts b/shared/src/store/actions/macro.ts similarity index 100% rename from src/store/actions/macro.ts rename to shared/src/store/actions/macro.ts diff --git a/src/store/effects/index.ts b/shared/src/store/effects/index.ts similarity index 100% rename from src/store/effects/index.ts rename to shared/src/store/effects/index.ts diff --git a/src/store/effects/keymap.ts b/shared/src/store/effects/keymap.ts similarity index 100% rename from src/store/effects/keymap.ts rename to shared/src/store/effects/keymap.ts diff --git a/src/store/effects/macro.ts b/shared/src/store/effects/macro.ts similarity index 100% rename from src/store/effects/macro.ts rename to shared/src/store/effects/macro.ts diff --git a/src/store/index.ts b/shared/src/store/index.ts similarity index 100% rename from src/store/index.ts rename to shared/src/store/index.ts diff --git a/src/store/reducers/index.ts b/shared/src/store/reducers/index.ts similarity index 100% rename from src/store/reducers/index.ts rename to shared/src/store/reducers/index.ts diff --git a/src/store/reducers/keymap.ts b/shared/src/store/reducers/keymap.ts similarity index 100% rename from src/store/reducers/keymap.ts rename to shared/src/store/reducers/keymap.ts diff --git a/src/store/reducers/macro.ts b/shared/src/store/reducers/macro.ts similarity index 100% rename from src/store/reducers/macro.ts rename to shared/src/store/reducers/macro.ts diff --git a/src/store/reducers/preset.ts b/shared/src/store/reducers/preset.ts similarity index 100% rename from src/store/reducers/preset.ts rename to shared/src/store/reducers/preset.ts diff --git a/src/store/storage/electron.ts b/shared/src/store/storage/electron.ts similarity index 100% rename from src/store/storage/electron.ts rename to shared/src/store/storage/electron.ts diff --git a/src/store/storage/index.ts b/shared/src/store/storage/index.ts similarity index 100% rename from src/store/storage/index.ts rename to shared/src/store/storage/index.ts diff --git a/src/store/storage/local.ts b/shared/src/store/storage/local.ts similarity index 100% rename from src/store/storage/local.ts rename to shared/src/store/storage/local.ts diff --git a/src/uhk-state.json b/shared/src/uhk-state.json similarity index 100% rename from src/uhk-state.json rename to shared/src/uhk-state.json diff --git a/src/util/index.ts b/shared/src/util/index.ts similarity index 100% rename from src/util/index.ts rename to shared/src/util/index.ts diff --git a/src/vendor.ts b/shared/src/vendor.ts similarity index 100% rename from src/vendor.ts rename to shared/src/vendor.ts diff --git a/test-serializer/test-serializer.ts b/test-serializer/test-serializer.ts index 851ccaf4..54893795 100644 --- a/test-serializer/test-serializer.ts +++ b/test-serializer/test-serializer.ts @@ -1,10 +1,10 @@ -import { UserConfiguration } from '../src/config-serializer/config-items/UserConfiguration'; -import { UhkBuffer } from '../src/config-serializer/UhkBuffer'; +import { UserConfiguration } from '../shared/src/config-serializer/config-items/UserConfiguration'; +import { UhkBuffer } from '../shared/src/config-serializer/UhkBuffer'; let assert = require('assert'); let fs = require('fs'); -let userConfig = JSON.parse(fs.readFileSync('../src/config-serializer/user-config.json')); +let userConfig = JSON.parse(fs.readFileSync('../shared/src/config-serializer/user-config.json')); let config1Js = userConfig; let config1Ts: UserConfiguration = new UserConfiguration().fromJsonObject(config1Js); diff --git a/test-serializer/user-config-serialized.bin b/test-serializer/user-config-serialized.bin new file mode 100644 index 0000000000000000000000000000000000000000..00d907aa7dd41e81664ef5a3b15b704c20593e02 GIT binary patch literal 1180 zcmds#$!-%t5QeM19@{-VwiEUp55p=5n^=z#f&(BY*hE1&a4?D`BOw`K3&AZH-h!9l zEqDkH99aZhInvWJBRMF(BTA!M|E|BQYmBIB?IWVD`!*eHZoV2$CM_A8$Mu)`G#WPE z#j$H9qvqD{Ptp=eSK7<(7uwU&^GWKzK{_42nX0z$ycmqqpq_cJCgWt}(Vsu$XqTr7 zF{Zb+q4nOAd;PTyiHvB*DNb{Svs~m7=Q+wjn(Sr|m$|}K5?Zub;2PIC$1WDR$t`Z1 zlqIWTmd%z~wBo1eaD(G?NI5~qNiMLL!&vrlz#>HKr$LM}aEv3=IYiBId@{jTuZq_XV>(kTv>+LHz`g`K7HG@4n}63G{S@HGT{ z<0sz>_m{|a3RMaUi&`m9dw&j%2AYz?HN=_VJL_sLa`m#1o8lGoH=Id| R*PhM(y_MNo;s39F{s5%SK&=1( literal 0 HcmV?d00001 diff --git a/test-serializer/user-config-serialized.json b/test-serializer/user-config-serialized.json new file mode 100644 index 00000000..eae6292e --- /dev/null +++ b/test-serializer/user-config-serialized.json @@ -0,0 +1,1550 @@ +{ + "dataModelVersion": 3, + "moduleConfigurations": [ + { + "id": 1, + "initialPointerSpeed": 1, + "pointerAcceleration": 5, + "maxPointerSpeed": 200 + } + ], + "keymaps": [ + { + "isDefault": true, + "abbreviation": "QTY", + "name": "QWERTY", + "description": "", + "layers": [ + { + "modules": [ + { + "id": 0, + "pointerRole": "move", + "keyActions": [ + { + "keyActionType": "keystroke", + "scancode": 36 + }, + { + "keyActionType": "keystroke", + "scancode": 37 + }, + { + "keyActionType": "keystroke", + "scancode": 38 + }, + { + "keyActionType": "keystroke", + "scancode": 39 + }, + { + "keyActionType": "keystroke", + "scancode": 45 + }, + { + "keyActionType": "keystroke", + "scancode": 46 + }, + { + "keyActionType": "keystroke", + "scancode": 42 + }, + { + "keyActionType": "keystroke", + "scancode": 28 + }, + { + "keyActionType": "keystroke", + "scancode": 24 + }, + { + "keyActionType": "keystroke", + "scancode": 12 + }, + { + "keyActionType": "keystroke", + "scancode": 18 + }, + { + "keyActionType": "keystroke", + "scancode": 19 + }, + { + "keyActionType": "keystroke", + "scancode": 47 + }, + { + "keyActionType": "keystroke", + "scancode": 48 + }, + { + "keyActionType": "keystroke", + "scancode": 49 + }, + { + "keyActionType": "keystroke", + "scancode": 11 + }, + { + "keyActionType": "keystroke", + "scancode": 13 + }, + { + "keyActionType": "keystroke", + "scancode": 14 + }, + { + "keyActionType": "keystroke", + "scancode": 15 + }, + { + "keyActionType": "keystroke", + "scancode": 51 + }, + { + "keyActionType": "keystroke", + "scancode": 52 + }, + { + "keyActionType": "keystroke", + "scancode": 40 + }, + { + "keyActionType": "keystroke", + "scancode": 17 + }, + { + "keyActionType": "keystroke", + "scancode": 16 + }, + { + "keyActionType": "keystroke", + "scancode": 54 + }, + { + "keyActionType": "keystroke", + "scancode": 55 + }, + { + "keyActionType": "keystroke", + "scancode": 56 + }, + { + "keyActionType": "keystroke", + "modifierMask": 32 + }, + { + "keyActionType": "keystroke", + "scancode": 44 + }, + { + "keyActionType": "switchLayer", + "layer": "fn", + "toggle": false + }, + { + "keyActionType": "keystroke", + "modifierMask": 64 + }, + { + "keyActionType": "keystroke", + "modifierMask": 128 + }, + { + "keyActionType": "keystroke", + "modifierMask": 16 + }, + { + "keyActionType": "switchLayer", + "layer": "mod", + "toggle": false + } + ] + }, + { + "id": 1, + "pointerRole": "move", + "keyActions": [ + { + "keyActionType": "keystroke", + "scancode": 53 + }, + { + "keyActionType": "keystroke", + "scancode": 30 + }, + { + "keyActionType": "keystroke", + "scancode": 31 + }, + { + "keyActionType": "keystroke", + "scancode": 32 + }, + { + "keyActionType": "keystroke", + "scancode": 33 + }, + { + "keyActionType": "keystroke", + "scancode": 34 + }, + { + "keyActionType": "keystroke", + "scancode": 35 + }, + { + "keyActionType": "keystroke", + "scancode": 43 + }, + { + "keyActionType": "keystroke", + "scancode": 20 + }, + { + "keyActionType": "keystroke", + "scancode": 26 + }, + { + "keyActionType": "keystroke", + "scancode": 8 + }, + { + "keyActionType": "keystroke", + "scancode": 21 + }, + { + "keyActionType": "keystroke", + "scancode": 23 + }, + { + "keyActionType": "switchLayer", + "layer": "mouse", + "toggle": false + }, + { + "keyActionType": "keystroke", + "scancode": 4 + }, + { + "keyActionType": "keystroke", + "scancode": 22 + }, + { + "keyActionType": "keystroke", + "scancode": 7 + }, + { + "keyActionType": "keystroke", + "scancode": 9 + }, + { + "keyActionType": "keystroke", + "scancode": 10 + }, + { + "keyActionType": "keystroke", + "modifierMask": 2 + }, + { + "keyActionType": "keystroke", + "scancode": 29 + }, + { + "keyActionType": "keystroke", + "scancode": 27 + }, + { + "keyActionType": "keystroke", + "scancode": 6 + }, + { + "keyActionType": "keystroke", + "scancode": 25 + }, + { + "keyActionType": "keystroke", + "scancode": 5 + }, + { + "keyActionType": "keystroke", + "modifierMask": 1 + }, + { + "keyActionType": "keystroke", + "modifierMask": 8 + }, + { + "keyActionType": "keystroke", + "modifierMask": 4 + }, + { + "keyActionType": "switchLayer", + "layer": "fn", + "toggle": false + }, + { + "keyActionType": "switchLayer", + "layer": "mod", + "toggle": false + }, + { + "keyActionType": "keystroke", + "scancode": 44 + } + ] + }, + { + "id": 2, + "pointerRole": "scroll", + "keyActions": [] + } + ] + }, + { + "modules": [ + { + "id": 0, + "pointerRole": "none", + "keyActions": [ + null, + null, + null, + null, + null, + null, + null, + { + "keyActionType": "keystroke", + "scancode": 75 + }, + { + "keyActionType": "keystroke", + "scancode": 74 + }, + { + "keyActionType": "keystroke", + "scancode": 82 + }, + { + "keyActionType": "keystroke", + "scancode": 77 + }, + null, + null, + null, + null, + { + "keyActionType": "keystroke", + "scancode": 78 + }, + { + "keyActionType": "keystroke", + "scancode": 80 + }, + { + "keyActionType": "keystroke", + "scancode": 81 + }, + { + "keyActionType": "keystroke", + "scancode": 79 + }, + null, + null, + null, + null, + null, + { + "keyActionType": "switchKeymap", + "keymapAbbreviation": "VIM" + }, + null, + { + "keyActionType": "keystroke", + "scancode": 118 + }, + { + "keyActionType": "keystroke", + "modifierMask": 32 + }, + null, + { + "keyActionType": "switchLayer", + "layer": "fn", + "toggle": false + }, + { + "keyActionType": "keystroke", + "modifierMask": 64 + }, + { + "keyActionType": "keystroke", + "modifierMask": 128 + }, + { + "keyActionType": "keystroke", + "modifierMask": 16 + }, + { + "keyActionType": "switchLayer", + "layer": "mod", + "toggle": false + } + ] + }, + { + "id": 1, + "pointerRole": "none", + "keyActions": [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + { + "keyActionType": "switchLayer", + "layer": "mouse", + "toggle": false + }, + null, + null, + null, + null, + null, + { + "keyActionType": "keystroke", + "modifierMask": 2 + }, + null, + null, + null, + null, + null, + { + "keyActionType": "keystroke", + "modifierMask": 1 + }, + { + "keyActionType": "keystroke", + "modifierMask": 8 + }, + { + "keyActionType": "keystroke", + "modifierMask": 4 + }, + { + "keyActionType": "switchLayer", + "layer": "fn", + "toggle": false + }, + { + "keyActionType": "switchLayer", + "layer": "mod", + "toggle": false + }, + null + ] + } + ] + }, + { + "modules": [ + { + "id": 0, + "pointerRole": "move", + "keyActions": [ + { + "keyActionType": "switchLayer", + "layer": "fn", + "toggle": true + }, + null, + null, + null, + null, + null, + null, + null, + { + "keyActionType": "keystroke", + "scancode": 232 + }, + { + "keyActionType": "keystroke", + "scancode": 237 + }, + { + "keyActionType": "keystroke", + "scancode": 233 + }, + null, + null, + null, + null, + null, + { + "keyActionType": "keystroke", + "scancode": 234 + }, + { + "keyActionType": "keystroke", + "scancode": 238 + }, + { + "keyActionType": "keystroke", + "scancode": 235 + }, + null, + null, + null, + null, + null, + { + "keyActionType": "keystroke", + "scancode": 239 + }, + null, + null, + { + "keyActionType": "keystroke", + "modifierMask": 32 + }, + null, + { + "keyActionType": "switchLayer", + "layer": "fn", + "toggle": false + }, + { + "keyActionType": "keystroke", + "modifierMask": 64 + }, + { + "keyActionType": "keystroke", + "modifierMask": 128 + }, + { + "keyActionType": "keystroke", + "modifierMask": 16 + }, + { + "keyActionType": "switchLayer", + "layer": "mod", + "toggle": true + } + ] + }, + { + "id": 1, + "pointerRole": "scroll", + "keyActions": [ + null, + null, + null, + null, + null, + { + "keyActionType": "switchLayer", + "layer": "mouse", + "toggle": true + }, + { + "keyActionType": "switchLayer", + "layer": "mod", + "toggle": true + }, + null, + null, + null, + null, + null, + null, + { + "keyActionType": "switchLayer", + "layer": "mouse", + "toggle": true + }, + null, + null, + null, + null, + null, + { + "keyActionType": "keystroke", + "modifierMask": 2 + }, + null, + null, + null, + null, + null, + { + "keyActionType": "keystroke", + "modifierMask": 1 + }, + { + "keyActionType": "keystroke", + "modifierMask": 8 + }, + { + "keyActionType": "keystroke", + "modifierMask": 4 + }, + { + "keyActionType": "switchLayer", + "layer": "fn", + "toggle": false + }, + { + "keyActionType": "switchLayer", + "layer": "mod", + "toggle": true + }, + null + ] + } + ] + }, + { + "modules": [ + { + "id": 0, + "pointerRole": "move", + "keyActions": [ + null, + null, + null, + null, + null, + null, + null, + { + "keyActionType": "mouse", + "mouseAction": "scrollUp" + }, + null, + { + "keyActionType": "mouse", + "mouseAction": "moveUp" + }, + null, + null, + null, + null, + null, + { + "keyActionType": "mouse", + "mouseAction": "scrollDown" + }, + { + "keyActionType": "mouse", + "mouseAction": "moveLeft" + }, + { + "keyActionType": "mouse", + "mouseAction": "moveDown" + }, + { + "keyActionType": "mouse", + "mouseAction": "moveRight" + }, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + { + "keyActionType": "keystroke", + "modifierMask": 64 + }, + { + "keyActionType": "keystroke", + "modifierMask": 128 + }, + { + "keyActionType": "keystroke", + "modifierMask": 16 + }, + null + ] + }, + { + "id": 1, + "pointerRole": "move", + "keyActions": [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + { + "keyActionType": "switchLayer", + "layer": "mouse", + "toggle": false + }, + null, + { + "keyActionType": "mouse", + "mouseAction": "rightClick" + }, + { + "keyActionType": "mouse", + "mouseAction": "middleClick" + }, + { + "keyActionType": "mouse", + "mouseAction": "leftClick" + }, + null, + null, + null, + null, + null, + null, + null, + { + "keyActionType": "keystroke", + "modifierMask": 1 + }, + { + "keyActionType": "keystroke", + "modifierMask": 8 + }, + { + "keyActionType": "keystroke", + "modifierMask": 4 + }, + null, + { + "keyActionType": "mouse", + "mouseAction": "accelerate" + }, + { + "keyActionType": "mouse", + "mouseAction": "decelerate" + } + ] + } + ] + } + ] + }, + { + "isDefault": false, + "abbreviation": "VIM", + "name": "VIM", + "description": "", + "layers": [ + { + "modules": [ + { + "id": 0, + "pointerRole": "move", + "keyActions": [ + { + "keyActionType": "mouse", + "mouseAction": "scrollDown" + }, + { + "keyActionType": "playMacro", + "macroIndex": 0 + }, + { + "keyActionType": "switchKeymap", + "keymapAbbreviation": "QTY" + }, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ] + }, + { + "id": 1, + "pointerRole": "scroll", + "keyActions": [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ] + }, + { + "id": 2, + "pointerRole": "move", + "keyActions": [ + { + "keyActionType": "keystroke", + "scancode": 111 + } + ] + } + ] + }, + { + "modules": [ + { + "id": 0, + "pointerRole": "scroll", + "keyActions": [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ] + }, + { + "id": 1, + "pointerRole": "move", + "keyActions": [ + { + "keyActionType": "keystroke", + "scancode": 111 + }, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ] + } + ] + }, + { + "modules": [ + { + "id": 0, + "pointerRole": "scroll", + "keyActions": [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ] + }, + { + "id": 1, + "pointerRole": "move", + "keyActions": [ + { + "keyActionType": "keystroke", + "scancode": 111 + }, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ] + } + ] + }, + { + "modules": [ + { + "id": 0, + "pointerRole": "scroll", + "keyActions": [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ] + }, + { + "id": 1, + "pointerRole": "move", + "keyActions": [ + { + "keyActionType": "keystroke", + "scancode": 111 + }, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ] + } + ] + } + ] + }, + { + "isDefault": false, + "abbreviation": "DVR", + "name": "DVR", + "description": "", + "layers": [ + { + "modules": [ + { + "id": 0, + "pointerRole": "move", + "keyActions": [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ] + }, + { + "id": 1, + "pointerRole": "move", + "keyActions": [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ] + } + ] + }, + { + "modules": [ + { + "id": 0, + "pointerRole": "move", + "keyActions": [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ] + }, + { + "id": 1, + "pointerRole": "move", + "keyActions": [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ] + } + ] + }, + { + "modules": [ + { + "id": 0, + "pointerRole": "move", + "keyActions": [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ] + }, + { + "id": 1, + "pointerRole": "move", + "keyActions": [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ] + } + ] + }, + { + "modules": [ + { + "id": 0, + "pointerRole": "move", + "keyActions": [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ] + }, + { + "id": 1, + "pointerRole": "move", + "keyActions": [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ] + } + ] + } + ] + } + ], + "macros": [ + { + "isLooped": false, + "isPrivate": true, + "name": "My address", + "macroActions": [ + { + "macroActionType": "key", + "action": "press", + "scancode": 111 + }, + { + "macroActionType": "key", + "action": "hold", + "scancode": 83 + }, + { + "macroActionType": "key", + "action": "release", + "scancode": 112 + }, + { + "macroActionType": "key", + "action": "press", + "modifierMask": 93 + }, + { + "macroActionType": "key", + "action": "hold", + "modifierMask": 101 + }, + { + "macroActionType": "key", + "action": "release", + "modifierMask": 133 + }, + { + "macroActionType": "mouseButton", + "action": "press", + "mouseButtonsMask": 9 + }, + { + "macroActionType": "mouseButton", + "action": "hold", + "mouseButtonsMask": 12 + }, + { + "macroActionType": "mouseButton", + "action": "release", + "mouseButtonsMask": 104 + }, + { + "macroActionType": "moveMouse", + "x": -1920, + "y": 220 + }, + { + "macroActionType": "scrollMouse", + "x": 0, + "y": 20000 + }, + { + "macroActionType": "delay", + "delay": 40000 + }, + { + "macroActionType": "text", + "text": "this is a text" + } + ] + }, + { + "isLooped": true, + "isPrivate": true, + "name": "Blah Blah blah", + "macroActions": [ + { + "macroActionType": "key", + "action": "press", + "scancode": 111 + }, + { + "macroActionType": "mouseButton", + "action": "release", + "mouseButtonsMask": 104 + }, + { + "macroActionType": "scrollMouse", + "x": 0, + "y": -20000 + }, + { + "macroActionType": "delay", + "delay": 40000 + }, + { + "macroActionType": "text", + "text": "blahhhhhhh" + } + ] + } + ] +} \ No newline at end of file diff --git a/test-serializer/user-config.bin b/test-serializer/user-config.bin new file mode 100644 index 0000000000000000000000000000000000000000..00d907aa7dd41e81664ef5a3b15b704c20593e02 GIT binary patch literal 1180 zcmds#$!-%t5QeM19@{-VwiEUp55p=5n^=z#f&(BY*hE1&a4?D`BOw`K3&AZH-h!9l zEqDkH99aZhInvWJBRMF(BTA!M|E|BQYmBIB?IWVD`!*eHZoV2$CM_A8$Mu)`G#WPE z#j$H9qvqD{Ptp=eSK7<(7uwU&^GWKzK{_42nX0z$ycmqqpq_cJCgWt}(Vsu$XqTr7 zF{Zb+q4nOAd;PTyiHvB*DNb{Svs~m7=Q+wjn(Sr|m$|}K5?Zub;2PIC$1WDR$t`Z1 zlqIWTmd%z~wBo1eaD(G?NI5~qNiMLL!&vrlz#>HKr$LM}aEv3=IYiBId@{jTuZq_XV>(kTv>+LHz`g`K7HG@4n}63G{S@HGT{ z<0sz>_m{|a3RMaUi&`m9dw&j%2AYz?HN=_VJL_sLa`m#1o8lGoH=Id| R*PhM(y_MNo;s39F{s5%SK&=1( literal 0 HcmV?d00001 diff --git a/tools/symlinker.js b/tools/symlinker.js new file mode 100644 index 00000000..103a22cb --- /dev/null +++ b/tools/symlinker.js @@ -0,0 +1,65 @@ +"use strict"; + +var fs = require('fs'); +var path = require('path'); + + +var webSharedPath = path.resolve(__dirname, '../web/src/shared/'); +var electronSharedPath = path.resolve(__dirname, '../electron/src/shared/'); +var sharedPath = path.resolve(__dirname, '../shared/src/'); + +var destPaths = [webSharedPath, electronSharedPath]; + +function createSymlinks() { + destPaths.forEach(function (destPath) { + if (!fs.existsSync(destPath)) { + fs.symlinkSync(sharedPath, destPath, 'junction'); + } + }); + console.log('Symbolic links have been created.'); +} + +function removeSymlinks() { + destPaths.forEach(function (destPath) { + if (fs.existsSync(destPath)) { + fs.unlinkSync(destPath); + } + }); + console.log('Symbolic links have been removed.'); +} + +var commands = ['i', 'r', 'h']; + +function printUsage() { + console.log('Usage: symlinker \n') + console.log('where is one of:') + console.log(commands.join(', ') + '\n'); + console.log('node symlinker -i\tCreate symlinks'); + console.log('node symlinker -r\tRemove symlinks'); + console.log('node symlinker -h\tShow usage'); +} + +console.log(process.argv[2]); + +if (process.argv.length >= 4 || process.argv.length <= 2) { + if (process.argv.length >= 4) { + console.log('Too many arguments.'); + } + printUsage(); + return 0; +} + + +switch (process.argv[2].slice(1)) { + case 'i': + createSymlinks(); + break; + case 'r': + removeSymlinks(); + break; + case 'h': + printUsage(); + break; + default: + console.log('Invalid option: ', process.argv[i]); +} diff --git a/web/README.md b/web/README.md new file mode 100644 index 00000000..bbeb82bc --- /dev/null +++ b/web/README.md @@ -0,0 +1,2 @@ +### Before build: +Add symbolic link from shared/src to web/src/shared with **npm run symlink -- -i** \ No newline at end of file diff --git a/web/src/.gitignore b/web/src/.gitignore new file mode 100644 index 00000000..26bcf9d8 --- /dev/null +++ b/web/src/.gitignore @@ -0,0 +1 @@ +shared \ No newline at end of file diff --git a/src/app.module.ts b/web/src/app.module.ts similarity index 72% rename from src/app.module.ts rename to web/src/app.module.ts index 57b8d676..b1e1ab34 100644 --- a/src/app.module.ts +++ b/web/src/app.module.ts @@ -10,10 +10,10 @@ import { StoreLogMonitorModule, useLogMonitor } from '@ngrx/store-log-monitor'; import { DragulaModule } from 'ng2-dragula/ng2-dragula'; import { Select2Module } from 'ng2-select2/ng2-select2'; -import { AddOnComponent } from './components/add-on'; -import { KeyboardSliderComponent } from './components/keyboard/slider'; -import { KeymapAddComponent, KeymapEditComponent, KeymapHeaderComponent } from './components/keymap'; -import { LayersComponent } from './components/layers'; +import { AddOnComponent } from './shared/components/add-on'; +import { KeyboardSliderComponent } from './shared/components/keyboard/slider'; +import { KeymapAddComponent, KeymapEditComponent, KeymapHeaderComponent } from './shared/components/keymap'; +import { LayersComponent } from './shared/components/layers'; import { MacroActionEditorComponent, MacroDelayTabComponent, @@ -25,9 +25,9 @@ import { MacroMouseTabComponent, MacroNotFoundComponent, MacroTextTabComponent -} from './components/macro'; -import { NotificationComponent } from './components/notification'; -import { PopoverComponent } from './components/popover'; +} from './shared/components/macro'; +import { NotificationComponent } from './shared/components/notification'; +import { PopoverComponent } from './shared/components/popover'; import { KeymapTabComponent, KeypressTabComponent, @@ -35,12 +35,12 @@ import { MacroTabComponent, MouseTabComponent, NoneTabComponent -} from './components/popover/tab'; -import { CaptureKeystrokeButtonComponent } from './components/popover/widgets/capture-keystroke'; -import { IconComponent } from './components/popover/widgets/icon'; -import { SettingsComponent } from './components/settings'; -import { SideMenuComponent } from './components/side-menu'; -import { SvgKeyboardComponent } from './components/svg/keyboard'; +} from './shared/components/popover/tab'; +import { CaptureKeystrokeButtonComponent } from './shared/components/popover/widgets/capture-keystroke'; +import { IconComponent } from './shared/components/popover/widgets/icon'; +import { SettingsComponent } from './shared/components/settings'; +import { SideMenuComponent } from './shared/components/side-menu'; +import { SvgKeyboardComponent } from './shared/components/svg/keyboard'; import { SvgIconTextKeyComponent, SvgKeyboardKeyComponent, @@ -55,23 +55,22 @@ import { SvgSwitchKeymapKeyComponent, SvgTextIconKeyComponent, SvgTwoLineTextKeyComponent -} from './components/svg/keys'; -import { SvgModuleComponent } from './components/svg/module'; -import { SvgKeyboardWrapComponent } from './components/svg/wrap'; +} from './shared/components/svg/keys'; +import { SvgModuleComponent } from './shared/components/svg/module'; +import { SvgKeyboardWrapComponent } from './shared/components/svg/wrap'; import { MainAppComponent, appRoutingProviders, routing } from './main-app'; -import { CancelableDirective } from './directives'; +import { CancelableDirective } from './shared/directives'; -import { CaptureService } from './services/capture.service'; -import { MapperService } from './services/mapper.service'; -import { UhkDeviceService } from './services/uhk-device.service'; +import { CaptureService } from './shared/services/capture.service'; +import { MapperService } from './shared/services/mapper.service'; -import { KeymapEffects, MacroEffects } from './store/effects'; -import { keymapReducer, macroReducer, presetReducer } from './store/reducers'; -import { DataStorage } from './store/storage'; +import { KeymapEffects, MacroEffects } from './shared/store/effects'; +import { keymapReducer, macroReducer, presetReducer } from './shared/store/reducers'; +import { DataStorage } from './shared/store/storage'; -import { KeymapEditGuard } from './components/keymap/edit'; -import { MacroNotFoundGuard } from './components/macro/not-found'; +import { KeymapEditGuard } from './shared/components/keymap/edit'; +import { MacroNotFoundGuard } from './shared/components/macro/not-found'; // Create DataStorage dependency injection const storageProvider = ReflectiveInjector.resolve([DataStorage]); @@ -157,8 +156,7 @@ const storeConfig = { appRoutingProviders, KeymapEditGuard, MacroNotFoundGuard, - CaptureService, - UhkDeviceService + CaptureService ], bootstrap: [MainAppComponent] }) diff --git a/web/src/components/keymap/index.ts b/web/src/components/keymap/index.ts new file mode 100644 index 00000000..c26fb46f --- /dev/null +++ b/web/src/components/keymap/index.ts @@ -0,0 +1 @@ +export * from './keymap.routes'; diff --git a/src/components/keymap/keymap.routes.ts b/web/src/components/keymap/keymap.routes.ts similarity index 70% rename from src/components/keymap/keymap.routes.ts rename to web/src/components/keymap/keymap.routes.ts index ae341834..85b0fd90 100644 --- a/src/components/keymap/keymap.routes.ts +++ b/web/src/components/keymap/keymap.routes.ts @@ -1,7 +1,7 @@ import { Routes } from '@angular/router'; -import { KeymapAddComponent } from './add/keymap-add.component'; -import { KeymapEditComponent, KeymapEditGuard } from './edit'; +import { KeymapAddComponent } from '../../shared/components/keymap/add/keymap-add.component'; +import { KeymapEditComponent, KeymapEditGuard } from '../../shared/components/keymap/edit'; export const keymapRoutes: Routes = [ { diff --git a/web/src/index.html b/web/src/index.html new file mode 100644 index 00000000..265a9d2e --- /dev/null +++ b/web/src/index.html @@ -0,0 +1,30 @@ + + + + + Ultimate Hacking Keyboard Configurator + + + + + + + + + + + + + + + + + diff --git a/web/src/main-app/index.ts b/web/src/main-app/index.ts new file mode 100644 index 00000000..65b504ef --- /dev/null +++ b/web/src/main-app/index.ts @@ -0,0 +1,2 @@ +export * from './main-app.component'; +export * from './main-app.routes'; diff --git a/web/src/main-app/main-app.component.ts b/web/src/main-app/main-app.component.ts new file mode 100644 index 00000000..795ba321 --- /dev/null +++ b/web/src/main-app/main-app.component.ts @@ -0,0 +1,9 @@ +import { Component, ViewEncapsulation } from '@angular/core'; + +@Component({ + selector: 'main-app', + template: require('../shared/main-app/main-app.component.html'), + styles: [require('../shared/main-app/main-app.component.scss')], + encapsulation: ViewEncapsulation.None +}) +export class MainAppComponent { } diff --git a/web/src/main-app/main-app.routes.ts b/web/src/main-app/main-app.routes.ts new file mode 100644 index 00000000..3decdd8b --- /dev/null +++ b/web/src/main-app/main-app.routes.ts @@ -0,0 +1,18 @@ +import { ModuleWithProviders } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; + +import { addOnRoutes } from '../shared/components/add-on'; +import { keymapRoutes } from '../components/keymap'; +import { macroRoutes } from '../shared/components/macro'; +import { settingsRoutes } from '../shared/components/settings'; + +const appRoutes: Routes = [ + ...keymapRoutes, + ...macroRoutes, + ...addOnRoutes, + ...settingsRoutes +]; + +export const appRoutingProviders: any[] = [ ]; + +export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes, { useHash: true }); diff --git a/src/main.ts b/web/src/main.ts similarity index 100% rename from src/main.ts rename to web/src/main.ts diff --git a/src/tsconfig.json b/web/src/tsconfig.json similarity index 85% rename from src/tsconfig.json rename to web/src/tsconfig.json index 5a04149d..ce2ea70b 100644 --- a/src/tsconfig.json +++ b/web/src/tsconfig.json @@ -10,15 +10,13 @@ "noImplicitAny": true, "suppressImplicitAnyIndexErrors": true, "typeRoots": [ - "../node_modules/@types" + "../../node_modules/@types" ], "types": [ "node", "jquery", "core-js", - "select2", - "electron", - "usb" + "select2" ] }, "exclude": [ diff --git a/src/webpack.config.js b/web/src/webpack.config.js similarity index 89% rename from src/webpack.config.js rename to web/src/webpack.config.js index 76ae7ac8..ecaa758a 100644 --- a/src/webpack.config.js +++ b/web/src/webpack.config.js @@ -6,12 +6,13 @@ var path = require('path'); var CommonsChunkPlugin = require("webpack/lib/optimize/CommonsChunkPlugin"); var rootDir = path.resolve(__dirname, '../'); +console.log(rootDir, __dirname); module.exports = { entry: { - polyfills: './src/polyfills.ts', - vendor: './src/vendor.ts', - app: './src/main.ts' + polyfills: path.resolve(rootDir, 'src/shared/polyfills.ts'), + vendor: path.resolve(rootDir, 'src/shared/vendor.ts'), + app: path.resolve(rootDir, 'src/main.ts') }, output: { path: rootDir + "/dist", @@ -50,8 +51,7 @@ module.exports = { webpackFailPlugin, new CopyWebpackPlugin( [ - { from: './src/*.html', flatten: true }, - { from: './src/*.js', flatten: true }, + { from: './web/src/index.html', flatten: true }, { from: 'node_modules/font-awesome/css/font-awesome.min.css', to: 'vendor/font-awesome/css/font-awesome.min.css'