From 2b0d4da50efdd719e3d0ebfd862c96a263074feb Mon Sep 17 00:00:00 2001 From: Thomas Beverley Date: Tue, 12 Nov 2024 09:09:37 +0000 Subject: [PATCH] Rename the ui components of the extension to be prefixed with ui --- src/extension/background/BrowserAction.ts | 8 ++++---- src/extension/crx-manifest.json | 2 +- src/extension/moz-manifest.json | 2 +- .../index.html | 0 .../index.less | 0 .../index.ts | 0 src/extension/{options => ui-options}/index.html | 0 src/extension/{options => ui-options}/index.less | 0 src/extension/{options => ui-options}/index.ts | 0 src/extension/{options => ui-options}/ui.ts | 0 .../{permission-popup => ui-permission-popup}/index.html | 0 .../{permission-popup => ui-permission-popup}/index.less | 0 .../{permission-popup => ui-permission-popup}/index.ts | 0 src/extension/webpack.config.cjs | 2 +- 14 files changed, 7 insertions(+), 7 deletions(-) rename src/extension/{model-install-popup => ui-model-install-popup}/index.html (100%) rename src/extension/{model-install-popup => ui-model-install-popup}/index.less (100%) rename src/extension/{model-install-popup => ui-model-install-popup}/index.ts (100%) rename src/extension/{options => ui-options}/index.html (100%) rename src/extension/{options => ui-options}/index.less (100%) rename src/extension/{options => ui-options}/index.ts (100%) rename src/extension/{options => ui-options}/ui.ts (100%) rename src/extension/{permission-popup => ui-permission-popup}/index.html (100%) rename src/extension/{permission-popup => ui-permission-popup}/index.less (100%) rename src/extension/{permission-popup => ui-permission-popup}/index.ts (100%) diff --git a/src/extension/background/BrowserAction.ts b/src/extension/background/BrowserAction.ts index 953c6bd..f40a981 100644 --- a/src/extension/background/BrowserAction.ts +++ b/src/extension/background/BrowserAction.ts @@ -44,7 +44,7 @@ class BrowserAction { const window = await chrome.windows.getLastFocused() await this.#openPopupWithoutUserInteraction( window.id, - 'model-install-popup.html', + 'ui-model-install-popup.html', { width: 448, height: 220 } ) } @@ -66,7 +66,7 @@ class BrowserAction { const tab = await chrome.tabs.get(addedTabId) await this.#openPopupWithoutUserInteraction( tab.windowId, - `permission-popup.html?${new URLSearchParams({ tabId: `${addedTabId}` }).toString()}`, + `ui-permission-popup.html?${new URLSearchParams({ tabId: `${addedTabId}` }).toString()}`, { width: 448, height: 200 } ) } @@ -83,9 +83,9 @@ class BrowserAction { if (await System.isNativeInstalled() !== AIHelperInstalledState.Responded) { NativeInstallHelper.show(NativeInstallHelperShowReason.UserInteraction) } else if (this.#permissionRequestTabs.includes(tabId)) { - await this.#openPopupWithUserInteraction(windowId, tabId, `permission-popup.html?${new URLSearchParams({ tabId: `${tabId}` }).toString()}`) + await this.#openPopupWithUserInteraction(windowId, tabId, `ui-permission-popup.html?${new URLSearchParams({ tabId: `${tabId}` }).toString()}`) } else if (this.#installTask?.running && this.#installTask?.type === AIModelManagerTaskType.Install) { - await this.#openPopupWithUserInteraction(windowId, tabId, 'model-install-popup.html') + await this.#openPopupWithUserInteraction(windowId, tabId, 'ui-model-install-popup.html') } else { const url = chrome.runtime.getURL(chrome.runtime.getManifest().options_page) const contexts = await chrome.runtime.getContexts({ contextTypes: [chrome.runtime.ContextType.TAB] }) diff --git a/src/extension/crx-manifest.json b/src/extension/crx-manifest.json index 4a4c401..4a400ba 100644 --- a/src/extension/crx-manifest.json +++ b/src/extension/crx-manifest.json @@ -6,7 +6,7 @@ "background": { "service_worker": "background.js" }, - "options_page": "options.html", + "options_page": "ui-options.html", "icons": { "16": "icons/16.png", "32": "icons/32.png", diff --git a/src/extension/moz-manifest.json b/src/extension/moz-manifest.json index 8078b74..c070e5e 100644 --- a/src/extension/moz-manifest.json +++ b/src/extension/moz-manifest.json @@ -10,7 +10,7 @@ "strict_min_version": "128.0" } }, - "options_page": "options.html", + "options_page": "ui-options.html", "icons": { "16": "icons/16.png", "32": "icons/32.png", diff --git a/src/extension/model-install-popup/index.html b/src/extension/ui-model-install-popup/index.html similarity index 100% rename from src/extension/model-install-popup/index.html rename to src/extension/ui-model-install-popup/index.html diff --git a/src/extension/model-install-popup/index.less b/src/extension/ui-model-install-popup/index.less similarity index 100% rename from src/extension/model-install-popup/index.less rename to src/extension/ui-model-install-popup/index.less diff --git a/src/extension/model-install-popup/index.ts b/src/extension/ui-model-install-popup/index.ts similarity index 100% rename from src/extension/model-install-popup/index.ts rename to src/extension/ui-model-install-popup/index.ts diff --git a/src/extension/options/index.html b/src/extension/ui-options/index.html similarity index 100% rename from src/extension/options/index.html rename to src/extension/ui-options/index.html diff --git a/src/extension/options/index.less b/src/extension/ui-options/index.less similarity index 100% rename from src/extension/options/index.less rename to src/extension/ui-options/index.less diff --git a/src/extension/options/index.ts b/src/extension/ui-options/index.ts similarity index 100% rename from src/extension/options/index.ts rename to src/extension/ui-options/index.ts diff --git a/src/extension/options/ui.ts b/src/extension/ui-options/ui.ts similarity index 100% rename from src/extension/options/ui.ts rename to src/extension/ui-options/ui.ts diff --git a/src/extension/permission-popup/index.html b/src/extension/ui-permission-popup/index.html similarity index 100% rename from src/extension/permission-popup/index.html rename to src/extension/ui-permission-popup/index.html diff --git a/src/extension/permission-popup/index.less b/src/extension/ui-permission-popup/index.less similarity index 100% rename from src/extension/permission-popup/index.less rename to src/extension/ui-permission-popup/index.less diff --git a/src/extension/permission-popup/index.ts b/src/extension/ui-permission-popup/index.ts similarity index 100% rename from src/extension/permission-popup/index.ts rename to src/extension/ui-permission-popup/index.ts diff --git a/src/extension/webpack.config.cjs b/src/extension/webpack.config.cjs index f4f4ba8..697719c 100644 --- a/src/extension/webpack.config.cjs +++ b/src/extension/webpack.config.cjs @@ -47,7 +47,7 @@ module.exports = function ({ outDir, nodeModulesDir, pkg, config }, { mode }) { plugins = [] break default: { - const uiEntryPoints = ['permission-popup', 'model-install-popup', 'options'] + const uiEntryPoints = ['ui-permission-popup', 'ui-model-install-popup', 'ui-options'] entry = { background: path.join(srcDir, 'background/index.ts'), 'contentscript-isolated': path.join(srcDir, 'contentscript-isolated/index.ts'),