From cae18405062c7c32f7905c45d0437251edb5407f Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Fri, 24 Feb 2023 13:20:12 +0530 Subject: [PATCH] refactor: update hopp-ui to be independent (#2927) Co-authored-by: Anwarul Islam --- packages/hoppscotch-common/package.json | 2 +- packages/hoppscotch-common/src/App.vue | 2 +- .../hoppscotch-common/src/components.d.ts | 38 +- .../src/components/app/DeveloperOptions.vue | 6 +- .../src/components/app/Footer.vue | 42 +- .../src/components/app/Header.vue | 18 +- .../src/components/app/Interceptor.vue | 9 +- .../src/components/app/Options.vue | 28 +- .../src/components/app/PowerSearch.vue | 4 +- .../src/components/app/Share.vue | 4 +- .../src/components/app/Shortcuts.vue | 4 +- .../src/components/app/ShortcutsPrompt.vue | 2 +- .../src/components/app/Sidenav.vue | 4 +- .../src/components/app/Support.vue | 18 +- .../src/components/collections/Add.vue | 8 +- .../src/components/collections/AddFolder.vue | 8 +- .../src/components/collections/AddRequest.vue | 8 +- .../src/components/collections/Collection.vue | 16 +- .../src/components/collections/Edit.vue | 8 +- .../src/components/collections/EditFolder.vue | 8 +- .../components/collections/EditRequest.vue | 8 +- .../components/collections/ImportExport.vue | 18 +- .../components/collections/MyCollections.vue | 10 +- .../src/components/collections/Request.vue | 10 +- .../components/collections/SaveRequest.vue | 8 +- .../collections/TeamCollections.vue | 16 +- .../src/components/collections/TeamSelect.vue | 16 +- .../components/collections/graphql/Add.vue | 8 +- .../collections/graphql/AddFolder.vue | 12 +- .../collections/graphql/AddRequest.vue | 12 +- .../collections/graphql/Collection.vue | 18 +- .../components/collections/graphql/Edit.vue | 8 +- .../collections/graphql/EditFolder.vue | 8 +- .../collections/graphql/EditRequest.vue | 8 +- .../components/collections/graphql/Folder.vue | 16 +- .../collections/graphql/ImportExport.vue | 14 +- .../collections/graphql/Request.vue | 12 +- .../components/collections/graphql/index.vue | 8 +- .../src/components/collections/index.vue | 14 +- .../components/environments/ChooseType.vue | 20 +- .../components/environments/ImportExport.vue | 16 +- .../src/components/environments/index.vue | 18 +- .../components/environments/my/Details.vue | 16 +- .../environments/my/Environment.vue | 18 +- .../src/components/environments/my/index.vue | 8 +- .../components/environments/teams/Details.vue | 18 +- .../environments/teams/Environment.vue | 18 +- .../components/environments/teams/index.vue | 16 +- .../src/components/firebase/Login.vue | 24 +- .../src/components/firebase/Logout.vue | 4 +- .../src/components/graphql/Authorization.vue | 37 +- .../src/components/graphql/Request.vue | 2 +- .../src/components/graphql/RequestOptions.vue | 66 +- .../src/components/graphql/Response.vue | 8 +- .../src/components/graphql/Sidebar.vue | 54 +- .../src/components/history/graphql/Card.vue | 6 +- .../src/components/history/index.vue | 16 +- .../src/components/history/rest/Card.vue | 4 +- .../src/components/http/Authorization.vue | 37 +- .../src/components/http/Body.vue | 10 +- .../src/components/http/BodyParameters.vue | 20 +- .../src/components/http/CodegenModal.vue | 18 +- .../src/components/http/Headers.vue | 30 +- .../src/components/http/ImportCurl.vue | 18 +- .../components/http/OAuth2Authorization.vue | 2 +- .../src/components/http/Parameters.vue | 20 +- .../src/components/http/PreRequestScript.vue | 8 +- .../src/components/http/RawBody.vue | 10 +- .../components/http/ReqChangeConfirmModal.vue | 10 +- .../src/components/http/Request.vue | 22 +- .../src/components/http/RequestOptions.vue | 28 +- .../src/components/http/ResponseMeta.vue | 2 +- .../src/components/http/Sidebar.vue | 20 +- .../src/components/http/TestResult.vue | 8 +- .../src/components/http/TestResultReport.vue | 2 +- .../src/components/http/Tests.vue | 8 +- .../src/components/http/URLEncodedParams.vue | 20 +- .../src/components/lenses/HeadersRenderer.vue | 2 +- .../lenses/HeadersRendererEntry.vue | 2 +- .../lenses/ResponseBodyRenderer.vue | 16 +- .../lenses/renderers/HTMLLensRenderer.vue | 8 +- .../lenses/renderers/ImageLensRenderer.vue | 2 +- .../lenses/renderers/JSONLensRenderer.vue | 18 +- .../lenses/renderers/PDFLensRenderer.vue | 2 +- .../lenses/renderers/RawLensRenderer.vue | 6 +- .../lenses/renderers/XMLLensRenderer.vue | 6 +- .../src/components/profile/Shortcode.vue | 6 +- .../src/components/profile/Shortcodes.vue | 8 +- .../src/components/profile/UserDelete.vue | 12 +- .../src/components/realtime/Communication.vue | 20 +- .../components/realtime/ConnectionConfig.vue | 12 +- .../src/components/realtime/Log.vue | 8 +- .../src/components/realtime/LogEntry.vue | 26 +- .../src/components/realtime/Subscription.vue | 12 +- .../src/components/smart/AccentModePicker.vue | 2 +- .../src/components/smart/ChangeLanguage.vue | 8 +- .../src/components/smart/ColorModePicker.vue | 2 +- .../src/components/smart/FontSizePicker.vue | 4 +- .../src/components/smart/Tree.vue | 2 +- .../src/components/smart/TreeBranch.vue | 2 +- .../src/components/tab/Primary.vue | 4 +- .../src/components/tab/Secondary.vue | 4 +- .../src/components/teams/Add.vue | 8 +- .../src/components/teams/Edit.vue | 22 +- .../src/components/teams/Invite.vue | 39 +- .../src/components/teams/Modal.vue | 4 +- .../src/components/teams/Team.vue | 16 +- .../src/components/teams/index.vue | 6 +- packages/hoppscotch-common/src/modules/ui.ts | 5 +- packages/hoppscotch-common/src/pages/_.vue | 9 +- .../hoppscotch-common/src/pages/enter.vue | 2 +- .../hoppscotch-common/src/pages/join-team.vue | 12 +- .../hoppscotch-common/src/pages/profile.vue | 36 +- .../hoppscotch-common/src/pages/r/_id.vue | 6 +- .../hoppscotch-common/src/pages/realtime.vue | 8 +- .../src/pages/realtime/mqtt.vue | 18 +- .../src/pages/realtime/socketio.vue | 37 +- .../src/pages/realtime/sse.vue | 2 +- .../src/pages/realtime/websocket.vue | 26 +- .../hoppscotch-common/src/pages/settings.vue | 42 +- packages/hoppscotch-common/tsconfig.json | 2 +- packages/hoppscotch-ui/README.md | 2 +- packages/hoppscotch-ui/package.json | 25 +- .../hoppscotch-ui/src/assets/scss/styles.scss | 440 ------ packages/hoppscotch-ui/src/components.d.ts | 37 - .../src/components/button/Primary.vue | 47 +- .../src/components/button/Secondary.vue | 42 +- .../src/components/button/index.ts | 2 + .../hoppscotch-ui/src/components/index.ts | 49 +- .../src/components/smart/Anchor.vue | 24 +- .../src/components/smart/AutoComplete.vue | 39 +- .../src/components/smart/ConfirmModal.vue | 32 +- .../src/components/smart/Expand.vue | 28 +- .../src/components/smart/Item.vue | 59 +- .../src/components/smart/Link.vue | 27 +- .../src/components/smart/Modal.vue | 2 +- .../src/components/smart/Radio.vue | 11 +- .../src/components/smart/RadioGroup.vue | 12 +- .../src/components/smart/SlideOver.vue | 25 +- .../src/components/smart/Spinner.vue | 8 +- .../src/components/smart/Windows.vue | 110 +- .../src/components/smart/index.ts | 20 + packages/hoppscotch-ui/src/index.ts | 35 +- packages/hoppscotch-ui/src/plugin.ts | 30 + .../src/stories/Anchor.story.vue | 19 +- .../src/stories/AutoComplete.story.vue | 27 +- .../src/stories/Button.story.vue | 8 +- .../src/stories/Checkbox.story.vue | 4 +- .../src/stories/ConfirmModal.story.vue | 9 +- .../src/stories/Expand.story.vue | 20 + .../hoppscotch-ui/src/stories/Item.story.vue | 6 +- .../hoppscotch-ui/src/stories/Link.story.vue | 10 +- .../hoppscotch-ui/src/stories/Modal.story.vue | 8 +- .../src/stories/ProgressRing.story.vue | 9 +- .../hoppscotch-ui/src/stories/Radio.story.vue | 5 +- .../src/stories/SlideOver.story.vue | 7 +- .../src/stories/Spinner.story.vue | 6 +- .../hoppscotch-ui/src/stories/Tab.story.vue | 13 +- .../src/stories/Toggle.story.vue | 3 +- .../src/stories/Window.story.vue | 23 +- packages/hoppscotch-ui/tsconfig.json | 41 +- packages/hoppscotch-ui/vite.config.ts | 48 +- packages/hoppscotch-web/package.json | 1 + packages/hoppscotch-web/vite.config.ts | 10 +- pnpm-lock.yaml | 1203 +++++++++++++---- 165 files changed, 2134 insertions(+), 2069 deletions(-) delete mode 100644 packages/hoppscotch-ui/src/components.d.ts create mode 100644 packages/hoppscotch-ui/src/components/button/index.ts create mode 100644 packages/hoppscotch-ui/src/components/smart/index.ts create mode 100644 packages/hoppscotch-ui/src/plugin.ts create mode 100644 packages/hoppscotch-ui/src/stories/Expand.story.vue diff --git a/packages/hoppscotch-common/package.json b/packages/hoppscotch-common/package.json index 34c92fb88..57e35b399 100644 --- a/packages/hoppscotch-common/package.json +++ b/packages/hoppscotch-common/package.json @@ -90,7 +90,7 @@ "vue-pdf-embed": "^1.1.4", "vue-router": "^4.0.16", "vue-tippy": "6.0.0-alpha.58", - "vuedraggable": "^4.1.0", + "vuedraggable-es": "^4.1.1", "wonka": "^4.0.15", "workbox-window": "^6.5.4", "yargs-parser": "^21.1.1" diff --git a/packages/hoppscotch-common/src/App.vue b/packages/hoppscotch-common/src/App.vue index de03b4aa4..8cf3e8e26 100644 --- a/packages/hoppscotch-common/src/App.vue +++ b/packages/hoppscotch-common/src/App.vue @@ -4,7 +4,7 @@ v-if="isLoadingInitialRoute" class="flex flex-col items-center justify-center min-h-screen" > - + diff --git a/packages/hoppscotch-common/src/components.d.ts b/packages/hoppscotch-common/src/components.d.ts index 3b7ae649d..72ac2df75 100644 --- a/packages/hoppscotch-common/src/components.d.ts +++ b/packages/hoppscotch-common/src/components.d.ts @@ -26,8 +26,6 @@ declare module '@vue/runtime-core' { AppShortcutsPrompt: typeof import('./components/app/ShortcutsPrompt.vue')['default'] AppSidenav: typeof import('./components/app/Sidenav.vue')['default'] AppSupport: typeof import('./components/app/Support.vue')['default'] - ButtonPrimary: typeof import('./../../hoppscotch-ui/src/components/button/Primary.vue')['default'] - ButtonSecondary: typeof import('./../../hoppscotch-ui/src/components/button/Secondary.vue')['default'] Collections: typeof import('./components/collections/index.vue')['default'] CollectionsAdd: typeof import('./components/collections/Add.vue')['default'] CollectionsAddFolder: typeof import('./components/collections/AddFolder.vue')['default'] @@ -75,6 +73,16 @@ declare module '@vue/runtime-core' { History: typeof import('./components/history/index.vue')['default'] HistoryGraphqlCard: typeof import('./components/history/graphql/Card.vue')['default'] HistoryRestCard: typeof import('./components/history/rest/Card.vue')['default'] + HoppButtonPrimary: typeof import('@hoppscotch/ui')['HoppButtonPrimary'] + HoppButtonSecondary: typeof import('@hoppscotch/ui')['HoppButtonSecondary'] + HoppSmartAnchor: typeof import('@hoppscotch/ui')['HoppSmartAnchor'] + HoppSmartConfirmModal: typeof import('@hoppscotch/ui')['HoppSmartConfirmModal'] + HoppSmartItem: typeof import('@hoppscotch/ui')['HoppSmartItem'] + HoppSmartLink: typeof import('@hoppscotch/ui')['HoppSmartLink'] + HoppSmartModal: typeof import('@hoppscotch/ui')['HoppSmartModal'] + HoppSmartRadioGroup: typeof import('@hoppscotch/ui')['HoppSmartRadioGroup'] + HoppSmartSlideOver: typeof import('@hoppscotch/ui')['HoppSmartSlideOver'] + HoppSmartSpinner: typeof import('@hoppscotch/ui')['HoppSmartSpinner'] HttpAuthorization: typeof import('./components/http/Authorization.vue')['default'] HttpBody: typeof import('./components/http/Body.vue')['default'] HttpBodyParameters: typeof import('./components/http/BodyParameters.vue')['default'] @@ -97,15 +105,9 @@ declare module '@vue/runtime-core' { HttpTestResultReport: typeof import('./components/http/TestResultReport.vue')['default'] HttpTests: typeof import('./components/http/Tests.vue')['default'] HttpURLEncodedParams: typeof import('./components/http/URLEncodedParams.vue')['default'] - IconLucideArrowLeft: typeof import('~icons/lucide/arrow-left')['default'] - IconLucideCheckCircle: typeof import('~icons/lucide/check-circle')['default'] IconLucideChevronRight: typeof import('~icons/lucide/chevron-right')['default'] - IconLucideGlobe: typeof import('~icons/lucide/globe')['default'] IconLucideInbox: typeof import('~icons/lucide/inbox')['default'] IconLucideInfo: typeof import('~icons/lucide/info')['default'] - IconLucideLayers: typeof import('~icons/lucide/layers')['default'] - IconLucideLoader: typeof import('~icons/lucide/loader')['default'] - IconLucideMinus: typeof import('~icons/lucide/minus')['default'] IconLucideSearch: typeof import('~icons/lucide/search')['default'] IconLucideUser: typeof import('~icons/lucide/user')['default'] IconLucideUsers: typeof import('~icons/lucide/users')['default'] @@ -128,32 +130,12 @@ declare module '@vue/runtime-core' { RealtimeLogEntry: typeof import('./components/realtime/LogEntry.vue')['default'] RealtimeSubscription: typeof import('./components/realtime/Subscription.vue')['default'] SmartAccentModePicker: typeof import('./components/smart/AccentModePicker.vue')['default'] - SmartAnchor: typeof import('./../../hoppscotch-ui/src/components/smart/Anchor.vue')['default'] - SmartAutoComplete: typeof import('./../../hoppscotch-ui/src/components/smart/AutoComplete.vue')['default'] SmartChangeLanguage: typeof import('./components/smart/ChangeLanguage.vue')['default'] - SmartCheckbox: typeof import('./../../hoppscotch-ui/src/components/smart/Checkbox.vue')['default'] SmartColorModePicker: typeof import('./components/smart/ColorModePicker.vue')['default'] - SmartConfirmModal: typeof import('./../../hoppscotch-ui/src/components/smart/ConfirmModal.vue')['default'] SmartEnvInput: typeof import('./components/smart/EnvInput.vue')['default'] - SmartExpand: typeof import('./../../hoppscotch-ui/src/components/smart/Expand.vue')['default'] - SmartFileChip: typeof import('./../../hoppscotch-ui/src/components/smart/FileChip.vue')['default'] SmartFontSizePicker: typeof import('./components/smart/FontSizePicker.vue')['default'] - SmartIntersection: typeof import('./../../hoppscotch-ui/src/components/smart/Intersection.vue')['default'] - SmartItem: typeof import('./../../hoppscotch-ui/src/components/smart/Item.vue')['default'] - SmartLink: typeof import('./../../hoppscotch-ui/src/components/smart/Link.vue')['default'] - SmartModal: typeof import('./../../hoppscotch-ui/src/components/smart/Modal.vue')['default'] - SmartProgressRing: typeof import('./../../hoppscotch-ui/src/components/smart/ProgressRing.vue')['default'] - SmartRadio: typeof import('./../../hoppscotch-ui/src/components/smart/Radio.vue')['default'] - SmartRadioGroup: typeof import('./../../hoppscotch-ui/src/components/smart/RadioGroup.vue')['default'] - SmartSlideOver: typeof import('./../../hoppscotch-ui/src/components/smart/SlideOver.vue')['default'] - SmartSpinner: typeof import('./../../hoppscotch-ui/src/components/smart/Spinner.vue')['default'] - SmartTab: typeof import('./../../hoppscotch-ui/src/components/smart/Tab.vue')['default'] - SmartTabs: typeof import('./../../hoppscotch-ui/src/components/smart/Tabs.vue')['default'] - SmartToggle: typeof import('./../../hoppscotch-ui/src/components/smart/Toggle.vue')['default'] SmartTree: typeof import('./components/smart/Tree.vue')['default'] SmartTreeBranch: typeof import('./components/smart/TreeBranch.vue')['default'] - SmartWindow: typeof import('./../../hoppscotch-ui/src/components/smart/Window.vue')['default'] - SmartWindows: typeof import('./../../hoppscotch-ui/src/components/smart/Windows.vue')['default'] TabPrimary: typeof import('./components/tab/Primary.vue')['default'] TabSecondary: typeof import('./components/tab/Secondary.vue')['default'] Teams: typeof import('./components/teams/index.vue')['default'] diff --git a/packages/hoppscotch-common/src/components/app/DeveloperOptions.vue b/packages/hoppscotch-common/src/components/app/DeveloperOptions.vue index f2f63346f..a94977acf 100644 --- a/packages/hoppscotch-common/src/components/app/DeveloperOptions.vue +++ b/packages/hoppscotch-common/src/components/app/DeveloperOptions.vue @@ -1,5 +1,5 @@ - + diff --git a/packages/hoppscotch-common/src/components/app/Header.vue b/packages/hoppscotch-common/src/components/app/Header.vue index f20e619cc..539d994c3 100644 --- a/packages/hoppscotch-common/src/components/app/Header.vue +++ b/packages/hoppscotch-common/src/components/app/Header.vue @@ -10,7 +10,7 @@ paddingLeft: platform.ui?.appHeader?.paddingLeft?.value, }" > -
- - - -
- +
- - - {{ t("layout.name") }} - - {{ t("support.title") }} - - - - {{ t("settings.follow") }} - - - - - - - + diff --git a/packages/hoppscotch-ui/src/components/smart/Windows.vue b/packages/hoppscotch-ui/src/components/smart/Windows.vue index 9b142a554..5f7746219 100644 --- a/packages/hoppscotch-ui/src/components/smart/Windows.vue +++ b/packages/hoppscotch-ui/src/components/smart/Windows.vue @@ -1,71 +1,37 @@ + diff --git a/packages/hoppscotch-ui/src/stories/AutoComplete.story.vue b/packages/hoppscotch-ui/src/stories/AutoComplete.story.vue index 61be821fa..e4ee06227 100644 --- a/packages/hoppscotch-ui/src/stories/AutoComplete.story.vue +++ b/packages/hoppscotch-ui/src/stories/AutoComplete.story.vue @@ -1,28 +1,21 @@ diff --git a/packages/hoppscotch-ui/src/stories/Checkbox.story.vue b/packages/hoppscotch-ui/src/stories/Checkbox.story.vue index bfc1c37fa..77c7a898d 100644 --- a/packages/hoppscotch-ui/src/stories/Checkbox.story.vue +++ b/packages/hoppscotch-ui/src/stories/Checkbox.story.vue @@ -1,12 +1,14 @@ diff --git a/packages/hoppscotch-ui/src/stories/Item.story.vue b/packages/hoppscotch-ui/src/stories/Item.story.vue index 875f460ef..1af65a19c 100644 --- a/packages/hoppscotch-ui/src/stories/Item.story.vue +++ b/packages/hoppscotch-ui/src/stories/Item.story.vue @@ -1,7 +1,11 @@ + + diff --git a/packages/hoppscotch-ui/src/stories/Link.story.vue b/packages/hoppscotch-ui/src/stories/Link.story.vue index 2c6af58db..e83d6feec 100644 --- a/packages/hoppscotch-ui/src/stories/Link.story.vue +++ b/packages/hoppscotch-ui/src/stories/Link.story.vue @@ -1,17 +1,19 @@ diff --git a/packages/hoppscotch-ui/src/stories/Radio.story.vue b/packages/hoppscotch-ui/src/stories/Radio.story.vue index 778065843..1d9af6978 100644 --- a/packages/hoppscotch-ui/src/stories/Radio.story.vue +++ b/packages/hoppscotch-ui/src/stories/Radio.story.vue @@ -1,16 +1,17 @@ diff --git a/packages/hoppscotch-ui/src/stories/Tab.story.vue b/packages/hoppscotch-ui/src/stories/Tab.story.vue index 28415baec..dd0484073 100644 --- a/packages/hoppscotch-ui/src/stories/Tab.story.vue +++ b/packages/hoppscotch-ui/src/stories/Tab.story.vue @@ -1,19 +1,20 @@