mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 16:53:34 +00:00
[PM-5189] Reworking project structure to ensure we can better differentiate the inline menu feature from other features
This commit is contained in:
@@ -2,7 +2,7 @@ import { mock, MockProxy } from "jest-mock-extended";
|
|||||||
|
|
||||||
import AutofillPageDetails from "../models/autofill-page-details";
|
import AutofillPageDetails from "../models/autofill-page-details";
|
||||||
import AutofillScript from "../models/autofill-script";
|
import AutofillScript from "../models/autofill-script";
|
||||||
import { AutofillOverlayInlineMenuElements } from "../overlay/content/autofill-overlay-inline-menu-elements";
|
import { AutofillOverlayInlineMenuElements } from "../overlay/inline-menu/content/autofill-overlay-inline-menu-elements";
|
||||||
import AutofillOverlayContentService from "../services/autofill-overlay-content.service";
|
import AutofillOverlayContentService from "../services/autofill-overlay-content.service";
|
||||||
import { flushPromises, sendMockExtensionMessage } from "../spec/testing-utils";
|
import { flushPromises, sendMockExtensionMessage } from "../spec/testing-utils";
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { EVENTS } from "@bitwarden/common/autofill/constants";
|
import { EVENTS } from "@bitwarden/common/autofill/constants";
|
||||||
|
|
||||||
import AutofillPageDetails from "../models/autofill-page-details";
|
import AutofillPageDetails from "../models/autofill-page-details";
|
||||||
import { AutofillOverlayInlineMenuElements } from "../overlay/abstractions/autofill-overlay-inline-menu-elements";
|
import { AutofillOverlayInlineMenuElements } from "../overlay/inline-menu/abstractions/autofill-overlay-inline-menu-elements";
|
||||||
import { AutofillOverlayContentService } from "../services/abstractions/autofill-overlay-content.service";
|
import { AutofillOverlayContentService } from "../services/abstractions/autofill-overlay-content.service";
|
||||||
import CollectAutofillContentService from "../services/collect-autofill-content.service";
|
import CollectAutofillContentService from "../services/collect-autofill-content.service";
|
||||||
import DomElementVisibilityService from "../services/dom-element-visibility.service";
|
import DomElementVisibilityService from "../services/dom-element-visibility.service";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AutofillOverlayInlineMenuElements } from "../overlay/content/autofill-overlay-inline-menu-elements";
|
import { AutofillOverlayInlineMenuElements } from "../overlay/inline-menu/content/autofill-overlay-inline-menu-elements";
|
||||||
import AutofillOverlayContentService from "../services/autofill-overlay-content.service";
|
import AutofillOverlayContentService from "../services/autofill-overlay-content.service";
|
||||||
import { setupAutofillInitDisconnectAction } from "../utils";
|
import { setupAutofillInitDisconnectAction } from "../utils";
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AutofillExtensionMessageParam } from "../../content/abstractions/autofill-init";
|
import { AutofillExtensionMessageParam } from "../../../content/abstractions/autofill-init";
|
||||||
|
|
||||||
export type InlineMenuExtensionMessageHandlers = {
|
export type InlineMenuExtensionMessageHandlers = {
|
||||||
[key: string]: CallableFunction;
|
[key: string]: CallableFunction;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
|
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
|
||||||
|
|
||||||
import { OverlayCipherData } from "../../background/abstractions/overlay.background";
|
import { OverlayCipherData } from "../../../background/abstractions/overlay.background";
|
||||||
|
|
||||||
type OverlayListMessage = { command: string };
|
type OverlayListMessage = { command: string };
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
|
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
|
||||||
|
|
||||||
import { OverlayCipherData } from "../../background/abstractions/overlay.background";
|
import { OverlayCipherData } from "../../../background/abstractions/overlay.background";
|
||||||
|
|
||||||
type AutofillOverlayMenuContainerMessage = {
|
type AutofillOverlayMenuContainerMessage = {
|
||||||
command: string;
|
command: string;
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
import { AutofillExtensionMessage } from "../../content/abstractions/autofill-init";
|
import { AutofillExtensionMessage } from "../../../content/abstractions/autofill-init";
|
||||||
import { AutofillOverlayElement } from "../../enums/autofill-overlay.enum";
|
import { AutofillOverlayElement } from "../../../enums/autofill-overlay.enum";
|
||||||
import {
|
import {
|
||||||
sendExtensionMessage,
|
sendExtensionMessage,
|
||||||
generateRandomCustomElementName,
|
generateRandomCustomElementName,
|
||||||
setElementStyles,
|
setElementStyles,
|
||||||
} from "../../utils";
|
} from "../../../utils";
|
||||||
import {
|
import {
|
||||||
InlineMenuExtensionMessageHandlers,
|
InlineMenuExtensionMessageHandlers,
|
||||||
AutofillOverlayInlineMenuElements as InlineMenuElementsInterface,
|
AutofillOverlayInlineMenuElements as InlineMenuElementsInterface,
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AutofillOverlayPort } from "../../enums/autofill-overlay.enum";
|
import { AutofillOverlayPort } from "../../../enums/autofill-overlay.enum";
|
||||||
|
|
||||||
import AutofillOverlayIframeElement from "./autofill-overlay-iframe-element";
|
import AutofillOverlayIframeElement from "./autofill-overlay-iframe-element";
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AutofillOverlayPort } from "../../enums/autofill-overlay.enum";
|
import { AutofillOverlayPort } from "../../../enums/autofill-overlay.enum";
|
||||||
|
|
||||||
import AutofillOverlayIframeElement from "./autofill-overlay-iframe-element";
|
import AutofillOverlayIframeElement from "./autofill-overlay-iframe-element";
|
||||||
import AutofillOverlayIframeService from "./autofill-overlay-iframe.service";
|
import AutofillOverlayIframeService from "./autofill-overlay-iframe.service";
|
||||||
@@ -3,13 +3,13 @@ import { mock } from "jest-mock-extended";
|
|||||||
import { EVENTS } from "@bitwarden/common/autofill/constants";
|
import { EVENTS } from "@bitwarden/common/autofill/constants";
|
||||||
import { ThemeType } from "@bitwarden/common/platform/enums";
|
import { ThemeType } from "@bitwarden/common/platform/enums";
|
||||||
|
|
||||||
import { AutofillOverlayPort } from "../../enums/autofill-overlay.enum";
|
import { AutofillOverlayPort } from "../../../enums/autofill-overlay.enum";
|
||||||
import { createPortSpyMock } from "../../spec/autofill-mocks";
|
import { createPortSpyMock } from "../../../spec/autofill-mocks";
|
||||||
import {
|
import {
|
||||||
flushPromises,
|
flushPromises,
|
||||||
sendPortMessage,
|
sendPortMessage,
|
||||||
triggerPortOnDisconnectEvent,
|
triggerPortOnDisconnectEvent,
|
||||||
} from "../../spec/testing-utils";
|
} from "../../../spec/testing-utils";
|
||||||
|
|
||||||
import AutofillOverlayIframeService from "./autofill-overlay-iframe.service";
|
import AutofillOverlayIframeService from "./autofill-overlay-iframe.service";
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { EVENTS } from "@bitwarden/common/autofill/constants";
|
import { EVENTS } from "@bitwarden/common/autofill/constants";
|
||||||
import { ThemeType } from "@bitwarden/common/platform/enums";
|
import { ThemeType } from "@bitwarden/common/platform/enums";
|
||||||
|
|
||||||
import { sendExtensionMessage, setElementStyles } from "../../utils";
|
import { sendExtensionMessage, setElementStyles } from "../../../utils";
|
||||||
import {
|
import {
|
||||||
BackgroundPortMessageHandlers,
|
BackgroundPortMessageHandlers,
|
||||||
AutofillOverlayIframeService as AutofillOverlayIframeServiceInterface,
|
AutofillOverlayIframeService as AutofillOverlayIframeServiceInterface,
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AutofillOverlayPort } from "../../enums/autofill-overlay.enum";
|
import { AutofillOverlayPort } from "../../../enums/autofill-overlay.enum";
|
||||||
|
|
||||||
import AutofillOverlayIframeElement from "./autofill-overlay-iframe-element";
|
import AutofillOverlayIframeElement from "./autofill-overlay-iframe-element";
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
|
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
|
||||||
|
|
||||||
import { createInitAutofillOverlayButtonMessageMock } from "../../../spec/autofill-mocks";
|
import { createInitAutofillOverlayButtonMessageMock } from "../../../../spec/autofill-mocks";
|
||||||
import { flushPromises, postWindowMessage } from "../../../spec/testing-utils";
|
import { flushPromises, postWindowMessage } from "../../../../spec/testing-utils";
|
||||||
|
|
||||||
import AutofillOverlayButton from "./autofill-overlay-button";
|
import AutofillOverlayButton from "./autofill-overlay-button";
|
||||||
|
|
||||||
@@ -3,8 +3,8 @@ import "lit/polyfill-support.js";
|
|||||||
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
|
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
|
||||||
import { EVENTS } from "@bitwarden/common/autofill/constants";
|
import { EVENTS } from "@bitwarden/common/autofill/constants";
|
||||||
|
|
||||||
import { buildSvgDomElement } from "../../../utils";
|
import { buildSvgDomElement } from "../../../../utils";
|
||||||
import { logoIcon, logoLockedIcon } from "../../../utils/svg-icons";
|
import { logoIcon, logoLockedIcon } from "../../../../utils/svg-icons";
|
||||||
import {
|
import {
|
||||||
InitAutofillOverlayButtonMessage,
|
InitAutofillOverlayButtonMessage,
|
||||||
OverlayButtonMessage,
|
OverlayButtonMessage,
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AutofillOverlayElement } from "../../../enums/autofill-overlay.enum";
|
import { AutofillOverlayElement } from "../../../../enums/autofill-overlay.enum";
|
||||||
|
|
||||||
import AutofillOverlayButton from "./autofill-overlay-button";
|
import AutofillOverlayButton from "./autofill-overlay-button";
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@import "../../../shared/styles/variables";
|
@import "../../../../shared/styles/variables";
|
||||||
|
|
||||||
* {
|
* {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
@@ -2,8 +2,8 @@ import { mock } from "jest-mock-extended";
|
|||||||
|
|
||||||
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
|
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
|
||||||
|
|
||||||
import { createInitAutofillOverlayListMessageMock } from "../../../spec/autofill-mocks";
|
import { createInitAutofillOverlayListMessageMock } from "../../../../spec/autofill-mocks";
|
||||||
import { flushPromises, postWindowMessage } from "../../../spec/testing-utils";
|
import { flushPromises, postWindowMessage } from "../../../../spec/testing-utils";
|
||||||
|
|
||||||
import AutofillOverlayList from "./autofill-overlay-list";
|
import AutofillOverlayList from "./autofill-overlay-list";
|
||||||
|
|
||||||
@@ -3,9 +3,9 @@ import "lit/polyfill-support.js";
|
|||||||
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
|
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
|
||||||
import { EVENTS } from "@bitwarden/common/autofill/constants";
|
import { EVENTS } from "@bitwarden/common/autofill/constants";
|
||||||
|
|
||||||
import { OverlayCipherData } from "../../../background/abstractions/overlay.background";
|
import { OverlayCipherData } from "../../../../background/abstractions/overlay.background";
|
||||||
import { buildSvgDomElement } from "../../../utils";
|
import { buildSvgDomElement } from "../../../../utils";
|
||||||
import { globeIcon, lockIcon, plusIcon, viewCipherIcon } from "../../../utils/svg-icons";
|
import { globeIcon, lockIcon, plusIcon, viewCipherIcon } from "../../../../utils/svg-icons";
|
||||||
import {
|
import {
|
||||||
InitAutofillOverlayListMessage,
|
InitAutofillOverlayListMessage,
|
||||||
OverlayListWindowMessageHandlers,
|
OverlayListWindowMessageHandlers,
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AutofillOverlayElement } from "../../../enums/autofill-overlay.enum";
|
import { AutofillOverlayElement } from "../../../../enums/autofill-overlay.enum";
|
||||||
|
|
||||||
import AutofillOverlayList from "./autofill-overlay-list";
|
import AutofillOverlayList from "./autofill-overlay-list";
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
@import "../../../../../../../libs/angular/src/scss/webfonts.css";
|
@import "../../../../../../../../libs/angular/src/scss/webfonts.css";
|
||||||
@import "../../../../../../../libs/angular/src/scss/bwicons/styles/style";
|
@import "../../../../../../../../libs/angular/src/scss/bwicons/styles/style";
|
||||||
@import "../../../shared/styles/variables";
|
@import "../../../../shared/styles/variables";
|
||||||
@import "../../../../../../../libs/angular/src/scss/icons";
|
@import "../../../../../../../../libs/angular/src/scss/icons";
|
||||||
|
|
||||||
* {
|
* {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { EVENTS } from "@bitwarden/common/autofill/constants";
|
import { EVENTS } from "@bitwarden/common/autofill/constants";
|
||||||
|
|
||||||
import { setElementStyles } from "../../../utils";
|
import { setElementStyles } from "../../../../utils";
|
||||||
import {
|
import {
|
||||||
InitOverlayElementMessage,
|
InitOverlayElementMessage,
|
||||||
AutofillOverlayMenuContainerWindowMessageHandlers,
|
AutofillOverlayMenuContainerWindowMessageHandlers,
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { EVENTS } from "@bitwarden/common/autofill/constants";
|
import { EVENTS } from "@bitwarden/common/autofill/constants";
|
||||||
|
|
||||||
import { RedirectFocusDirection } from "../../../enums/autofill-overlay.enum";
|
import { RedirectFocusDirection } from "../../../../enums/autofill-overlay.enum";
|
||||||
import {
|
import {
|
||||||
AutofillOverlayPageElementWindowMessage,
|
AutofillOverlayPageElementWindowMessage,
|
||||||
AutofillOverlayPageElementWindowMessageHandlers,
|
AutofillOverlayPageElementWindowMessageHandlers,
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AutofillOverlayInlineMenuElements } from "../overlay/abstractions/autofill-overlay-inline-menu-elements";
|
import { AutofillOverlayInlineMenuElements } from "../overlay/inline-menu/abstractions/autofill-overlay-inline-menu-elements";
|
||||||
import { FillableFormFieldElement, FormFieldElement } from "../types";
|
import { FillableFormFieldElement, FormFieldElement } from "../types";
|
||||||
|
|
||||||
import { DomElementVisibilityService as domElementVisibilityServiceInterface } from "./abstractions/dom-element-visibility.service";
|
import { DomElementVisibilityService as domElementVisibilityServiceInterface } from "./abstractions/dom-element-visibility.service";
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ import AutofillField from "../models/autofill-field";
|
|||||||
import AutofillForm from "../models/autofill-form";
|
import AutofillForm from "../models/autofill-form";
|
||||||
import AutofillPageDetails from "../models/autofill-page-details";
|
import AutofillPageDetails from "../models/autofill-page-details";
|
||||||
import AutofillScript, { FillScript } from "../models/autofill-script";
|
import AutofillScript, { FillScript } from "../models/autofill-script";
|
||||||
import { InitAutofillOverlayButtonMessage } from "../overlay/abstractions/autofill-overlay-button";
|
import { InitAutofillOverlayButtonMessage } from "../overlay/inline-menu/abstractions/autofill-overlay-button";
|
||||||
import { InitAutofillOverlayListMessage } from "../overlay/abstractions/autofill-overlay-list";
|
import { InitAutofillOverlayListMessage } from "../overlay/inline-menu/abstractions/autofill-overlay-list";
|
||||||
import { GenerateFillScriptOptions, PageDetail } from "../services/abstractions/autofill.service";
|
import { GenerateFillScriptOptions, PageDetail } from "../services/abstractions/autofill.service";
|
||||||
|
|
||||||
function createAutofillFormMock(customFields = {}): AutofillForm {
|
function createAutofillFormMock(customFields = {}): AutofillForm {
|
||||||
|
|||||||
@@ -107,17 +107,17 @@ const plugins = [
|
|||||||
chunks: ["notification/bar"],
|
chunks: ["notification/bar"],
|
||||||
}),
|
}),
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
template: "./src/autofill/overlay/pages/button/button.html",
|
template: "./src/autofill/overlay/inline-menu/pages/button/button.html",
|
||||||
filename: "overlay/button.html",
|
filename: "overlay/button.html",
|
||||||
chunks: ["overlay/button"],
|
chunks: ["overlay/button"],
|
||||||
}),
|
}),
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
template: "./src/autofill/overlay/pages/list/list.html",
|
template: "./src/autofill/overlay/inline-menu/pages/list/list.html",
|
||||||
filename: "overlay/list.html",
|
filename: "overlay/list.html",
|
||||||
chunks: ["overlay/list"],
|
chunks: ["overlay/list"],
|
||||||
}),
|
}),
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
template: "./src/autofill/overlay/pages/menu/menu.html",
|
template: "./src/autofill/overlay/inline-menu/pages/menu/menu.html",
|
||||||
filename: "overlay/menu.html",
|
filename: "overlay/menu.html",
|
||||||
chunks: ["overlay/menu"],
|
chunks: ["overlay/menu"],
|
||||||
}),
|
}),
|
||||||
@@ -174,10 +174,12 @@ const mainConfig = {
|
|||||||
"content/fido2/content-script": "./src/vault/fido2/content/content-script.ts",
|
"content/fido2/content-script": "./src/vault/fido2/content/content-script.ts",
|
||||||
"content/fido2/page-script": "./src/vault/fido2/content/page-script.ts",
|
"content/fido2/page-script": "./src/vault/fido2/content/page-script.ts",
|
||||||
"notification/bar": "./src/autofill/notification/bar.ts",
|
"notification/bar": "./src/autofill/notification/bar.ts",
|
||||||
"overlay/button": "./src/autofill/overlay/pages/button/bootstrap-autofill-overlay-button.ts",
|
"overlay/button":
|
||||||
"overlay/list": "./src/autofill/overlay/pages/list/bootstrap-autofill-overlay-list.ts",
|
"./src/autofill/overlay/inline-menu/pages/button/bootstrap-autofill-overlay-button.ts",
|
||||||
|
"overlay/list":
|
||||||
|
"./src/autofill/overlay/inline-menu/pages/list/bootstrap-autofill-overlay-list.ts",
|
||||||
"overlay/menu":
|
"overlay/menu":
|
||||||
"./src/autofill/overlay/pages/menu/bootstrap-autofill-overlay-menu-container.ts",
|
"./src/autofill/overlay/inline-menu/pages/menu/bootstrap-autofill-overlay-menu-container.ts",
|
||||||
"encrypt-worker": "../../libs/common/src/platform/services/cryptography/encrypt.worker.ts",
|
"encrypt-worker": "../../libs/common/src/platform/services/cryptography/encrypt.worker.ts",
|
||||||
"content/lp-fileless-importer": "./src/tools/content/lp-fileless-importer.ts",
|
"content/lp-fileless-importer": "./src/tools/content/lp-fileless-importer.ts",
|
||||||
"content/send-on-installed-message": "./src/vault/content/send-on-installed-message.ts",
|
"content/send-on-installed-message": "./src/vault/content/send-on-installed-message.ts",
|
||||||
|
|||||||
Reference in New Issue
Block a user