From 726152759f4b6413faefb3e0fe1ce3086cc0bdcc Mon Sep 17 00:00:00 2001 From: Keavon Chambers Date: Wed, 14 Jul 2021 14:31:09 -0700 Subject: [PATCH] Frontend refactor to move response handler, key input handling, and more into new utilities folder (#260) Part of #124 --- client/web/.eslintrc.js | 1 + client/web/src/components/panels/Document.vue | 44 ++---------------- .../web/src/components/panels/LayerTree.vue | 2 +- .../widgets/floating-menus/ColorPicker.vue | 3 +- .../widgets/inputs/SwatchPairInput.vue | 6 +-- client/web/src/components/workspace/Panel.vue | 2 +- .../src/components/workspace/Workspace.vue | 2 +- client/web/src/main.ts | 8 ++-- .../src/{lib/utils.ts => utilities/color.ts} | 4 -- client/web/src/utilities/input.ts | 45 +++++++++++++++++++ client/web/src/utilities/math.ts | 3 ++ .../src/utilities/response-handler-binding.ts | 4 ++ .../src/{ => utilities}/response-handler.ts | 20 ++++----- client/web/wasm/src/lib.rs | 2 +- 14 files changed, 80 insertions(+), 66 deletions(-) rename client/web/src/{lib/utils.ts => utilities/color.ts} (93%) create mode 100644 client/web/src/utilities/input.ts create mode 100644 client/web/src/utilities/math.ts create mode 100644 client/web/src/utilities/response-handler-binding.ts rename client/web/src/{ => utilities}/response-handler.ts (95%) diff --git a/client/web/.eslintrc.js b/client/web/.eslintrc.js index e4eb13e19..3182ebcf5 100644 --- a/client/web/.eslintrc.js +++ b/client/web/.eslintrc.js @@ -31,6 +31,7 @@ module.exports = { "no-console": process.env.NODE_ENV === "production" ? "warn" : "off", "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", "no-param-reassign": ["error", { props: false }], + "import/prefer-default-export": "off", "max-len": ["error", { code: 200, tabWidth: 4 }], "@typescript-eslint/camelcase": "off", "@typescript-eslint/no-use-before-define": "off", diff --git a/client/web/src/components/panels/Document.vue b/client/web/src/components/panels/Document.vue index a03193e46..6ac091a88 100644 --- a/client/web/src/components/panels/Document.vue +++ b/client/web/src/components/panels/Document.vue @@ -192,7 +192,8 @@