From fae4037a652a71131c56e9631ff22b2a148d5895 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 27 Oct 2020 09:10:20 +0000 Subject: [PATCH] Remove bunch of unused components and tidy up unused references --- .../components/backend/DataTable/Table.svelte | 11 +- .../popovers/CreateEditColumnPopover.svelte | 26 +-- .../src/components/common/ActionButton.svelte | 70 ------- .../src/components/common/Button.svelte | 171 ------------------ .../src/components/common/ButtonGroup.svelte | 15 -- .../src/components/common/Dropzone.svelte | 11 +- .../src/components/common/NumberBox.svelte | 36 ---- .../src/components/common/Switcher.svelte | 76 -------- .../builder/src/components/common/core.js | 3 - .../src/components/common/eventHandlers.js | 13 -- .../AppPreview/CurrentItemPreview.svelte | 6 +- .../userInterface/ComponentsHierarchy.svelte | 2 +- .../ComponentsHierarchyChildren.svelte | 2 +- .../EventsEditor/EventEditorModal.svelte | 19 +- .../EventsEditor/StateBindingCascader.svelte | 9 +- .../pagesParsing/searchComponents.js | 16 +- .../pagesParsing/splitRootComponentName.js | 4 +- packages/builder/src/helpers.js | 19 +- .../pages/[application]/design/_layout.svelte | 5 - packages/builder/src/pages/index.svelte | 4 - .../src/attachments/Dropzone.svelte | 7 +- 21 files changed, 51 insertions(+), 474 deletions(-) delete mode 100644 packages/builder/src/components/common/ActionButton.svelte delete mode 100644 packages/builder/src/components/common/Button.svelte delete mode 100644 packages/builder/src/components/common/ButtonGroup.svelte delete mode 100644 packages/builder/src/components/common/NumberBox.svelte delete mode 100644 packages/builder/src/components/common/Switcher.svelte delete mode 100644 packages/builder/src/components/common/core.js delete mode 100644 packages/builder/src/components/common/eventHandlers.js diff --git a/packages/builder/src/components/backend/DataTable/Table.svelte b/packages/builder/src/components/backend/DataTable/Table.svelte index e26b68d537..38ef221e86 100644 --- a/packages/builder/src/components/backend/DataTable/Table.svelte +++ b/packages/builder/src/components/backend/DataTable/Table.svelte @@ -1,22 +1,13 @@ - - - - diff --git a/packages/builder/src/components/common/Button.svelte b/packages/builder/src/components/common/Button.svelte deleted file mode 100644 index a5fe3752a2..0000000000 --- a/packages/builder/src/components/common/Button.svelte +++ /dev/null @@ -1,171 +0,0 @@ - - - - - diff --git a/packages/builder/src/components/common/ButtonGroup.svelte b/packages/builder/src/components/common/ButtonGroup.svelte deleted file mode 100644 index 7b57ea34cc..0000000000 --- a/packages/builder/src/components/common/ButtonGroup.svelte +++ /dev/null @@ -1,15 +0,0 @@ - - -
- -
- - diff --git a/packages/builder/src/components/common/Dropzone.svelte b/packages/builder/src/components/common/Dropzone.svelte index 53cd606143..0a040f8873 100644 --- a/packages/builder/src/components/common/Dropzone.svelte +++ b/packages/builder/src/components/common/Dropzone.svelte @@ -1,14 +1,17 @@ - -
- - -
- - diff --git a/packages/builder/src/components/common/Switcher.svelte b/packages/builder/src/components/common/Switcher.svelte deleted file mode 100644 index 707bbfcc64..0000000000 --- a/packages/builder/src/components/common/Switcher.svelte +++ /dev/null @@ -1,76 +0,0 @@ - - -
-
- {#each tabs as tab} - - {/each} -
- -
- {#if selectedIndex === 0} - - {:else if selectedIndex === 1} - - {:else if selectedIndex === 2} - - {:else if selectedIndex === 3} - - {/if} -
-
- - diff --git a/packages/builder/src/components/common/core.js b/packages/builder/src/components/common/core.js deleted file mode 100644 index 19a3c9afed..0000000000 --- a/packages/builder/src/components/common/core.js +++ /dev/null @@ -1,3 +0,0 @@ -import { flow } from "lodash/fp" - -export const pipe = (arg, funcs) => flow(funcs)(arg) diff --git a/packages/builder/src/components/common/eventHandlers.js b/packages/builder/src/components/common/eventHandlers.js deleted file mode 100644 index 2e7a62ac3e..0000000000 --- a/packages/builder/src/components/common/eventHandlers.js +++ /dev/null @@ -1,13 +0,0 @@ -import { eventHandlers } from "../../../../client/src/state/eventHandlers" -export { EVENT_TYPE_MEMBER_NAME } from "../../../../client/src/state/eventHandlers" - -export const allHandlers = () => { - const handlersObj = eventHandlers() - - const handlers = Object.keys(handlersObj).map(name => ({ - name, - ...handlersObj[name], - })) - - return handlers -} diff --git a/packages/builder/src/components/userInterface/AppPreview/CurrentItemPreview.svelte b/packages/builder/src/components/userInterface/AppPreview/CurrentItemPreview.svelte index 85c50711ae..a565a925e4 100644 --- a/packages/builder/src/components/userInterface/AppPreview/CurrentItemPreview.svelte +++ b/packages/builder/src/components/userInterface/AppPreview/CurrentItemPreview.svelte @@ -2,7 +2,7 @@ import { store, backendUiStore } from "builderStore" import { map, join } from "lodash/fp" import iframeTemplate from "./iframeTemplate" - import { pipe } from "components/common/core" + import { pipe } from "../../../helpers" let iframe let styles = "" @@ -16,7 +16,7 @@ return props } - const getComponentTypeName = component => { + const getComponentTypeName = (component) => { let [componentName] = component._component.match(/[a-z]*$/) return componentName || "element" } @@ -144,7 +144,7 @@ } $: stylesheetLinks = pipe($store.pages.stylesheets, [ - map(s => ``), + map((s) => ``), join("\n"), ]) diff --git a/packages/builder/src/components/userInterface/ComponentsHierarchy.svelte b/packages/builder/src/components/userInterface/ComponentsHierarchy.svelte index dae80cf1e7..0911a80558 100644 --- a/packages/builder/src/components/userInterface/ComponentsHierarchy.svelte +++ b/packages/builder/src/components/userInterface/ComponentsHierarchy.svelte @@ -2,7 +2,7 @@ import { goto } from "@sveltech/routify" import ComponentsHierarchyChildren from "./ComponentsHierarchyChildren.svelte" import { trimCharsStart, trimChars } from "lodash/fp" - import { pipe } from "components/common/core" + import { pipe } from "../../helpers" import { store } from "builderStore" import ScreenDropdownMenu from "./ScreenDropdownMenu.svelte" import { writable } from "svelte/store" diff --git a/packages/builder/src/components/userInterface/ComponentsHierarchyChildren.svelte b/packages/builder/src/components/userInterface/ComponentsHierarchyChildren.svelte index fce8b26512..193ec7e49f 100644 --- a/packages/builder/src/components/userInterface/ComponentsHierarchyChildren.svelte +++ b/packages/builder/src/components/userInterface/ComponentsHierarchyChildren.svelte @@ -2,7 +2,7 @@ import { goto } from "@sveltech/routify" import { store } from "builderStore" import { last } from "lodash/fp" - import { pipe } from "components/common/core" + import { pipe } from "../../helpers" import ComponentDropdownMenu from "./ComponentDropdownMenu.svelte" import NavItem from "components/common/NavItem.svelte" import { getComponentDefinition } from "builderStore/storeUtils" diff --git a/packages/builder/src/components/userInterface/EventsEditor/EventEditorModal.svelte b/packages/builder/src/components/userInterface/EventsEditor/EventEditorModal.svelte index 0e45f2fcac..e3cc645eb0 100644 --- a/packages/builder/src/components/userInterface/EventsEditor/EventEditorModal.svelte +++ b/packages/builder/src/components/userInterface/EventsEditor/EventEditorModal.svelte @@ -1,14 +1,7 @@