From ff33991ea4f9349eac01a92d1599ed2fd17850b2 Mon Sep 17 00:00:00 2001 From: trickypr <23250792+trickypr@users.noreply.github.com> Date: Thu, 14 Dec 2023 18:29:23 +1100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Support=20match=20arguments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 6 +- pnpm-lock.yaml | 58 +++++----- scripts/setup.ts | 2 +- src/content/browser/Browser.svelte | 4 +- .../customizableUI/BrowserView.svelte | 4 +- .../components/customizableUI/Tabs.svelte | 4 +- .../browser/components/omnibox/Omnibox.svelte | 4 +- .../components/omnibox/PageAction.svelte | 4 + .../lib/modules/EPageActionsBindings.ts | 7 +- src/content/browser/lib/window/tabs.ts | 12 +-- src/link.d.ts | 100 +++++++++++++++++- src/modules/EPageActions.ts | 20 ++-- static/extensions/parent/ext-pageAction.js | 4 +- 13 files changed, 169 insertions(+), 60 deletions(-) diff --git a/package.json b/package.json index c649c59..ccadc0f 100644 --- a/package.json +++ b/package.json @@ -55,9 +55,9 @@ "prettier-plugin-organize-imports": "^3.2.3", "prettier-plugin-svelte": "^3.0.3", "style-loader": "^3.3.3", - "svelte": "^4.2.1", + "svelte": "^4.2.8", "svelte-loader": "^3.1.9", - "svelte-preprocess": "^5.0.4", + "svelte-preprocess": "^5.1.2", "svelte-sequential-preprocessor": "^2.0.1", "ts-loader": "^9.5.0", "typescript": "^5.2.2", @@ -78,7 +78,7 @@ }, "pnpm": { "patchedDependencies": { - "svelte@4.2.1": "patches/svelte@4.2.1.patch", + "svelte@4.2.8": "patches/svelte@4.2.1.patch", "webpack-license-plugin@4.4.2": "patches/webpack-license-plugin@4.4.2.patch", "@melt-ui/svelte@0.64.5": "patches/@melt-ui__svelte@0.64.5.patch" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index adb1029..c063666 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,7 +8,7 @@ patchedDependencies: '@melt-ui/svelte@0.64.5': hash: aeypykqddydgtdgxoo44wxfeey path: patches/@melt-ui__svelte@0.64.5.patch - svelte@4.2.1: + svelte@4.2.8: hash: cm43hmf4gczhssi3isoosy53r4 path: patches/svelte@4.2.1.patch webpack-license-plugin@4.4.2: @@ -38,10 +38,10 @@ dependencies: devDependencies: '@melt-ui/pp': specifier: ^0.1.4 - version: 0.1.4(@melt-ui/svelte@0.64.5)(svelte@4.2.1) + version: 0.1.4(@melt-ui/svelte@0.64.5)(svelte@4.2.8) '@melt-ui/svelte': specifier: ^0.64.0 - version: 0.64.5(patch_hash=aeypykqddydgtdgxoo44wxfeey)(svelte@4.2.1) + version: 0.64.5(patch_hash=aeypykqddydgtdgxoo44wxfeey)(svelte@4.2.8) '@tinyhttp/app': specifier: ^2.2.1 version: 2.2.1 @@ -107,19 +107,19 @@ devDependencies: version: 3.2.3(prettier@3.0.3)(typescript@5.2.2) prettier-plugin-svelte: specifier: ^3.0.3 - version: 3.0.3(prettier@3.0.3)(svelte@4.2.1) + version: 3.0.3(prettier@3.0.3)(svelte@4.2.8) style-loader: specifier: ^3.3.3 version: 3.3.3(webpack@5.89.0) svelte: - specifier: ^4.2.1 - version: 4.2.1(patch_hash=cm43hmf4gczhssi3isoosy53r4) + specifier: ^4.2.8 + version: 4.2.8(patch_hash=cm43hmf4gczhssi3isoosy53r4) svelte-loader: specifier: ^3.1.9 - version: 3.1.9(svelte@4.2.1) + version: 3.1.9(svelte@4.2.8) svelte-preprocess: - specifier: ^5.0.4 - version: 5.0.4(postcss@8.4.31)(svelte@4.2.1)(typescript@5.2.2) + specifier: ^5.1.2 + version: 5.1.2(postcss@8.4.31)(svelte@4.2.8)(typescript@5.2.2) svelte-sequential-preprocessor: specifier: ^2.0.1 version: 2.0.1 @@ -425,19 +425,19 @@ packages: resolution: {integrity: sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==} dev: true - /@melt-ui/pp@0.1.4(@melt-ui/svelte@0.64.5)(svelte@4.2.1): + /@melt-ui/pp@0.1.4(@melt-ui/svelte@0.64.5)(svelte@4.2.8): resolution: {integrity: sha512-zR+Kl3CZJPJBHW8V7YcdQCMI/dVcnW9Ct3yGbVaIywYVStVRS7F9uEDOea3xLLT2WTGodQePzPlUn53yKFu87g==} engines: {pnpm: '>=8.6.3'} peerDependencies: '@melt-ui/svelte': '>= 0.29.0' svelte: ^3.55.0 || ^4.0.0 || ^5.0.0-next.1 dependencies: - '@melt-ui/svelte': 0.64.5(patch_hash=aeypykqddydgtdgxoo44wxfeey)(svelte@4.2.1) + '@melt-ui/svelte': 0.64.5(patch_hash=aeypykqddydgtdgxoo44wxfeey)(svelte@4.2.8) estree-walker: 3.0.3 - svelte: 4.2.1(patch_hash=cm43hmf4gczhssi3isoosy53r4) + svelte: 4.2.8(patch_hash=cm43hmf4gczhssi3isoosy53r4) dev: true - /@melt-ui/svelte@0.64.5(patch_hash=aeypykqddydgtdgxoo44wxfeey)(svelte@4.2.1): + /@melt-ui/svelte@0.64.5(patch_hash=aeypykqddydgtdgxoo44wxfeey)(svelte@4.2.8): resolution: {integrity: sha512-nPQA2guLuLitpZ6A968eWyGMC2riTKLq4R26hPRLdzP/JHCpd9yvddgMwil8JKbUKjT2dC3i358vUqeUOGxknA==} peerDependencies: svelte: '>=3 <5' @@ -448,7 +448,7 @@ packages: dequal: 2.0.3 focus-trap: 7.5.4 nanoid: 4.0.2 - svelte: 4.2.1(patch_hash=cm43hmf4gczhssi3isoosy53r4) + svelte: 4.2.8(patch_hash=cm43hmf4gczhssi3isoosy53r4) dev: true patched: true @@ -3368,14 +3368,14 @@ packages: typescript: 5.2.2 dev: true - /prettier-plugin-svelte@3.0.3(prettier@3.0.3)(svelte@4.2.1): + /prettier-plugin-svelte@3.0.3(prettier@3.0.3)(svelte@4.2.8): resolution: {integrity: sha512-dLhieh4obJEK1hnZ6koxF+tMUrZbV5YGvRpf2+OADyanjya5j0z1Llo8iGwiHmFWZVG/hLEw/AJD5chXd9r3XA==} peerDependencies: prettier: ^3.0.0 svelte: ^3.2.0 || ^4.0.0-next.0 dependencies: prettier: 3.0.3 - svelte: 4.2.1(patch_hash=cm43hmf4gczhssi3isoosy53r4) + svelte: 4.2.8(patch_hash=cm43hmf4gczhssi3isoosy53r4) dev: true /prettier@3.0.3: @@ -3968,28 +3968,28 @@ packages: resolution: {integrity: sha512-oU+Xv7Dl4kRU2kdFjsoPLfJfnt5hUhsFUZtuzI3Ku/f2iAFZqBoEuXOqK3N9ngD4dxQOmN4OKWPHVi3NeAeAfQ==} dev: true - /svelte-hmr@0.14.12(svelte@4.2.1): + /svelte-hmr@0.14.12(svelte@4.2.8): resolution: {integrity: sha512-4QSW/VvXuqVcFZ+RhxiR8/newmwOCTlbYIezvkeN6302YFRE8cXy0naamHcjz8Y9Ce3ITTZtrHrIL0AGfyo61w==} engines: {node: ^12.20 || ^14.13.1 || >= 16} peerDependencies: svelte: '>=3.19.0' dependencies: - svelte: 4.2.1(patch_hash=cm43hmf4gczhssi3isoosy53r4) + svelte: 4.2.8(patch_hash=cm43hmf4gczhssi3isoosy53r4) dev: true - /svelte-loader@3.1.9(svelte@4.2.1): + /svelte-loader@3.1.9(svelte@4.2.8): resolution: {integrity: sha512-RITPqze3TppOhaZF8SEFTDTwFHov17k3UkOjpxyL/No/YVrvckKmXWOEj7QEpsZZZSNQPb28tMZbHEI2xLhJMQ==} peerDependencies: svelte: ^3.0.0 || ^4.0.0-next.0 dependencies: loader-utils: 2.0.4 - svelte: 4.2.1(patch_hash=cm43hmf4gczhssi3isoosy53r4) + svelte: 4.2.8(patch_hash=cm43hmf4gczhssi3isoosy53r4) svelte-dev-helper: 1.1.9 - svelte-hmr: 0.14.12(svelte@4.2.1) + svelte-hmr: 0.14.12(svelte@4.2.8) dev: true - /svelte-preprocess@5.0.4(postcss@8.4.31)(svelte@4.2.1)(typescript@5.2.2): - resolution: {integrity: sha512-ABia2QegosxOGsVlsSBJvoWeXy1wUKSfF7SWJdTjLAbx/Y3SrVevvvbFNQqrSJw89+lNSsM58SipmZJ5SRi5iw==} + /svelte-preprocess@5.1.2(postcss@8.4.31)(svelte@4.2.8)(typescript@5.2.2): + resolution: {integrity: sha512-XF0aliMAcYnP4hLETvB6HRAMnaL09ASYT1Z2I1Gwu0nz6xbdg/dSgAEthtFZJA4AKrNhFDFdmUDO+H9d/6xg5g==} engines: {node: '>= 14.10.0'} requiresBuild: true peerDependencies: @@ -3997,12 +3997,12 @@ packages: coffeescript: ^2.5.1 less: ^3.11.3 || ^4.0.0 postcss: ^7 || ^8 - postcss-load-config: ^2.1.0 || ^3.0.0 || ^4.0.0 + postcss-load-config: ^2.1.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 pug: ^3.0.0 sass: ^1.26.8 stylus: ^0.55.0 sugarss: ^2.0.0 || ^3.0.0 || ^4.0.0 - svelte: ^3.23.0 || ^4.0.0-next.0 || ^4.0.0 + svelte: ^3.23.0 || ^4.0.0-next.0 || ^4.0.0 || ^5.0.0-next.0 typescript: '>=3.9.5 || ^4.0.0 || ^5.0.0' peerDependenciesMeta: '@babel/core': @@ -4032,7 +4032,7 @@ packages: postcss: 8.4.31 sorcery: 0.11.0 strip-indent: 3.0.0 - svelte: 4.2.1(patch_hash=cm43hmf4gczhssi3isoosy53r4) + svelte: 4.2.8(patch_hash=cm43hmf4gczhssi3isoosy53r4) typescript: 5.2.2 dev: true @@ -4040,12 +4040,12 @@ packages: resolution: {integrity: sha512-N5JqlBni6BzElxmuFrOPxOJnjsxh1cFDACLEVKs8OHBcx8ZNRO1p5SxuQex1m3qbLzAC8G99EHeWcxGkjyKjLQ==} engines: {node: '>=16'} dependencies: - svelte: 4.2.1(patch_hash=cm43hmf4gczhssi3isoosy53r4) + svelte: 4.2.8(patch_hash=cm43hmf4gczhssi3isoosy53r4) tslib: 2.6.2 dev: true - /svelte@4.2.1(patch_hash=cm43hmf4gczhssi3isoosy53r4): - resolution: {integrity: sha512-LpLqY2Jr7cRxkrTc796/AaaoMLF/1ax7cto8Ot76wrvKQhrPmZ0JgajiWPmg9mTSDqO16SSLiD17r9MsvAPTmw==} + /svelte@4.2.8(patch_hash=cm43hmf4gczhssi3isoosy53r4): + resolution: {integrity: sha512-hU6dh1MPl8gh6klQZwK/n73GiAHiR95IkFsesLPbMeEZi36ydaXL/ZAb4g9sayT0MXzpxyZjR28yderJHxcmYA==} engines: {node: '>=16'} dependencies: '@ampproject/remapping': 2.2.1 diff --git a/scripts/setup.ts b/scripts/setup.ts index 63fb603..07fd20f 100644 --- a/scripts/setup.ts +++ b/scripts/setup.ts @@ -21,7 +21,7 @@ import { getSrcFile, } from './lib/constants.js' import { setupFiles } from './lib/files.js' -import { linkFolder, linkStaticFolder, linkTscFolder } from './lib/linker.js' +import { linkStaticFolder, linkTscFolder } from './lib/linker.js' import { failure, info } from './lib/logging.js' import { downloadReleaseAsset, getLatestRelease } from './lib/releases.js' diff --git a/src/content/browser/Browser.svelte b/src/content/browser/Browser.svelte index 6ddcc5e..2018fbc 100644 --- a/src/content/browser/Browser.svelte +++ b/src/content/browser/Browser.svelte @@ -8,10 +8,10 @@ import CustomizableUi from './components/customizableUI/CustomizableUI.svelte' import { BrowserContextMenu, HamburgerMenu } from './components/menus' import Keybindings from './components/keybindings/Keybindings.svelte' - import { tabs, selectedTab } from './lib/window/tabs' + import { tabs, selectedTabId } from './lib/window/tabs' let component = customizableUIDynamicPref('browser.uiCustomization.state') - $: currentTab = $tabs.find((tab) => tab.getId() == $selectedTab) + $: currentTab = $tabs.find((tab) => tab.getId() == $selectedTabId) {#if currentTab} diff --git a/src/content/browser/components/customizableUI/BrowserView.svelte b/src/content/browser/components/customizableUI/BrowserView.svelte index f1c29c9..4448e5c 100644 --- a/src/content/browser/components/customizableUI/BrowserView.svelte +++ b/src/content/browser/components/customizableUI/BrowserView.svelte @@ -10,7 +10,7 @@ } from '@shared/customizableUI' import UiItemBase from './UIItemBase.svelte' import Browser from '../Browser.svelte' - import { selectedTab, tabs } from '@browser/lib/window/tabs' + import { selectedTabId, tabs } from '@browser/lib/window/tabs' export let component: ComponentId & BrowserComponent export let root: Component @@ -24,6 +24,6 @@ {#each sortedBrowers as tab (tab.getId())} - + {/each} diff --git a/src/content/browser/components/customizableUI/Tabs.svelte b/src/content/browser/components/customizableUI/Tabs.svelte index 47f20e5..b066bcd 100644 --- a/src/content/browser/components/customizableUI/Tabs.svelte +++ b/src/content/browser/components/customizableUI/Tabs.svelte @@ -11,7 +11,7 @@ import Tab from '@browser/components/tabs/Tab.svelte' import UiItemBase from './UIItemBase.svelte' - import { selectedTab, tabs } from '@browser/lib/window/tabs' + import { selectedTabId, tabs } from '@browser/lib/window/tabs' export let component: ComponentId & TabsComponent export let root: Component @@ -19,7 +19,7 @@ e.preventDefault()}> {#each $tabs as tab (tab.getId())} - + {/each} diff --git a/src/content/browser/components/omnibox/Omnibox.svelte b/src/content/browser/components/omnibox/Omnibox.svelte index dfe28e1..872daea 100644 --- a/src/content/browser/components/omnibox/Omnibox.svelte +++ b/src/content/browser/components/omnibox/Omnibox.svelte @@ -90,7 +90,9 @@ /> {#each $pageActions as [_extId, pageAction]} - + {#if pageAction.shouldShow($uri.asciiSpec)} + + {/if} {/each} diff --git a/src/content/browser/components/omnibox/PageAction.svelte b/src/content/browser/components/omnibox/PageAction.svelte index 50d0863..520a12d 100644 --- a/src/content/browser/components/omnibox/PageAction.svelte +++ b/src/content/browser/components/omnibox/PageAction.svelte @@ -1,3 +1,7 @@ + +