1
0
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:
Cesar Gonzalez
2024-05-03 11:13:32 -05:00
parent e4750b2757
commit 85e71bc297
38 changed files with 45 additions and 43 deletions

View File

@@ -2,7 +2,7 @@ import { mock, MockProxy } from "jest-mock-extended";
import AutofillPageDetails from "../models/autofill-page-details";
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 { flushPromises, sendMockExtensionMessage } from "../spec/testing-utils";

View File

@@ -1,7 +1,7 @@
import { EVENTS } from "@bitwarden/common/autofill/constants";
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 CollectAutofillContentService from "../services/collect-autofill-content.service";
import DomElementVisibilityService from "../services/dom-element-visibility.service";

View File

@@ -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 { setupAutofillInitDisconnectAction } from "../utils";

View File

@@ -1,4 +1,4 @@
import { AutofillExtensionMessageParam } from "../../content/abstractions/autofill-init";
import { AutofillExtensionMessageParam } from "../../../content/abstractions/autofill-init";
export type InlineMenuExtensionMessageHandlers = {
[key: string]: CallableFunction;

View File

@@ -1,6 +1,6 @@
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 };

View File

@@ -1,6 +1,6 @@
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 = {
command: string;

View File

@@ -1,10 +1,10 @@
import { AutofillExtensionMessage } from "../../content/abstractions/autofill-init";
import { AutofillOverlayElement } from "../../enums/autofill-overlay.enum";
import { AutofillExtensionMessage } from "../../../content/abstractions/autofill-init";
import { AutofillOverlayElement } from "../../../enums/autofill-overlay.enum";
import {
sendExtensionMessage,
generateRandomCustomElementName,
setElementStyles,
} from "../../utils";
} from "../../../utils";
import {
InlineMenuExtensionMessageHandlers,
AutofillOverlayInlineMenuElements as InlineMenuElementsInterface,

View File

@@ -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";

View File

@@ -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 AutofillOverlayIframeService from "./autofill-overlay-iframe.service";

View File

@@ -3,13 +3,13 @@ import { mock } from "jest-mock-extended";
import { EVENTS } from "@bitwarden/common/autofill/constants";
import { ThemeType } from "@bitwarden/common/platform/enums";
import { AutofillOverlayPort } from "../../enums/autofill-overlay.enum";
import { createPortSpyMock } from "../../spec/autofill-mocks";
import { AutofillOverlayPort } from "../../../enums/autofill-overlay.enum";
import { createPortSpyMock } from "../../../spec/autofill-mocks";
import {
flushPromises,
sendPortMessage,
triggerPortOnDisconnectEvent,
} from "../../spec/testing-utils";
} from "../../../spec/testing-utils";
import AutofillOverlayIframeService from "./autofill-overlay-iframe.service";

View File

@@ -1,7 +1,7 @@
import { EVENTS } from "@bitwarden/common/autofill/constants";
import { ThemeType } from "@bitwarden/common/platform/enums";
import { sendExtensionMessage, setElementStyles } from "../../utils";
import { sendExtensionMessage, setElementStyles } from "../../../utils";
import {
BackgroundPortMessageHandlers,
AutofillOverlayIframeService as AutofillOverlayIframeServiceInterface,

View File

@@ -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";

View File

@@ -1,7 +1,7 @@
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
import { createInitAutofillOverlayButtonMessageMock } from "../../../spec/autofill-mocks";
import { flushPromises, postWindowMessage } from "../../../spec/testing-utils";
import { createInitAutofillOverlayButtonMessageMock } from "../../../../spec/autofill-mocks";
import { flushPromises, postWindowMessage } from "../../../../spec/testing-utils";
import AutofillOverlayButton from "./autofill-overlay-button";

View File

@@ -3,8 +3,8 @@ import "lit/polyfill-support.js";
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
import { EVENTS } from "@bitwarden/common/autofill/constants";
import { buildSvgDomElement } from "../../../utils";
import { logoIcon, logoLockedIcon } from "../../../utils/svg-icons";
import { buildSvgDomElement } from "../../../../utils";
import { logoIcon, logoLockedIcon } from "../../../../utils/svg-icons";
import {
InitAutofillOverlayButtonMessage,
OverlayButtonMessage,

View File

@@ -1,4 +1,4 @@
import { AutofillOverlayElement } from "../../../enums/autofill-overlay.enum";
import { AutofillOverlayElement } from "../../../../enums/autofill-overlay.enum";
import AutofillOverlayButton from "./autofill-overlay-button";

View File

@@ -1,4 +1,4 @@
@import "../../../shared/styles/variables";
@import "../../../../shared/styles/variables";
* {
box-sizing: border-box;

View File

@@ -2,8 +2,8 @@ import { mock } from "jest-mock-extended";
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
import { createInitAutofillOverlayListMessageMock } from "../../../spec/autofill-mocks";
import { flushPromises, postWindowMessage } from "../../../spec/testing-utils";
import { createInitAutofillOverlayListMessageMock } from "../../../../spec/autofill-mocks";
import { flushPromises, postWindowMessage } from "../../../../spec/testing-utils";
import AutofillOverlayList from "./autofill-overlay-list";

View File

@@ -3,9 +3,9 @@ import "lit/polyfill-support.js";
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
import { EVENTS } from "@bitwarden/common/autofill/constants";
import { OverlayCipherData } from "../../../background/abstractions/overlay.background";
import { buildSvgDomElement } from "../../../utils";
import { globeIcon, lockIcon, plusIcon, viewCipherIcon } from "../../../utils/svg-icons";
import { OverlayCipherData } from "../../../../background/abstractions/overlay.background";
import { buildSvgDomElement } from "../../../../utils";
import { globeIcon, lockIcon, plusIcon, viewCipherIcon } from "../../../../utils/svg-icons";
import {
InitAutofillOverlayListMessage,
OverlayListWindowMessageHandlers,

View File

@@ -1,4 +1,4 @@
import { AutofillOverlayElement } from "../../../enums/autofill-overlay.enum";
import { AutofillOverlayElement } from "../../../../enums/autofill-overlay.enum";
import AutofillOverlayList from "./autofill-overlay-list";

View File

@@ -1,7 +1,7 @@
@import "../../../../../../../libs/angular/src/scss/webfonts.css";
@import "../../../../../../../libs/angular/src/scss/bwicons/styles/style";
@import "../../../shared/styles/variables";
@import "../../../../../../../libs/angular/src/scss/icons";
@import "../../../../../../../../libs/angular/src/scss/webfonts.css";
@import "../../../../../../../../libs/angular/src/scss/bwicons/styles/style";
@import "../../../../shared/styles/variables";
@import "../../../../../../../../libs/angular/src/scss/icons";
* {
box-sizing: border-box;

View File

@@ -1,6 +1,6 @@
import { EVENTS } from "@bitwarden/common/autofill/constants";
import { setElementStyles } from "../../../utils";
import { setElementStyles } from "../../../../utils";
import {
InitOverlayElementMessage,
AutofillOverlayMenuContainerWindowMessageHandlers,

View File

@@ -1,6 +1,6 @@
import { EVENTS } from "@bitwarden/common/autofill/constants";
import { RedirectFocusDirection } from "../../../enums/autofill-overlay.enum";
import { RedirectFocusDirection } from "../../../../enums/autofill-overlay.enum";
import {
AutofillOverlayPageElementWindowMessage,
AutofillOverlayPageElementWindowMessageHandlers,

View File

@@ -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 { DomElementVisibilityService as domElementVisibilityServiceInterface } from "./abstractions/dom-element-visibility.service";

View File

@@ -12,8 +12,8 @@ import AutofillField from "../models/autofill-field";
import AutofillForm from "../models/autofill-form";
import AutofillPageDetails from "../models/autofill-page-details";
import AutofillScript, { FillScript } from "../models/autofill-script";
import { InitAutofillOverlayButtonMessage } from "../overlay/abstractions/autofill-overlay-button";
import { InitAutofillOverlayListMessage } from "../overlay/abstractions/autofill-overlay-list";
import { InitAutofillOverlayButtonMessage } from "../overlay/inline-menu/abstractions/autofill-overlay-button";
import { InitAutofillOverlayListMessage } from "../overlay/inline-menu/abstractions/autofill-overlay-list";
import { GenerateFillScriptOptions, PageDetail } from "../services/abstractions/autofill.service";
function createAutofillFormMock(customFields = {}): AutofillForm {

View File

@@ -107,17 +107,17 @@ const plugins = [
chunks: ["notification/bar"],
}),
new HtmlWebpackPlugin({
template: "./src/autofill/overlay/pages/button/button.html",
template: "./src/autofill/overlay/inline-menu/pages/button/button.html",
filename: "overlay/button.html",
chunks: ["overlay/button"],
}),
new HtmlWebpackPlugin({
template: "./src/autofill/overlay/pages/list/list.html",
template: "./src/autofill/overlay/inline-menu/pages/list/list.html",
filename: "overlay/list.html",
chunks: ["overlay/list"],
}),
new HtmlWebpackPlugin({
template: "./src/autofill/overlay/pages/menu/menu.html",
template: "./src/autofill/overlay/inline-menu/pages/menu/menu.html",
filename: "overlay/menu.html",
chunks: ["overlay/menu"],
}),
@@ -174,10 +174,12 @@ const mainConfig = {
"content/fido2/content-script": "./src/vault/fido2/content/content-script.ts",
"content/fido2/page-script": "./src/vault/fido2/content/page-script.ts",
"notification/bar": "./src/autofill/notification/bar.ts",
"overlay/button": "./src/autofill/overlay/pages/button/bootstrap-autofill-overlay-button.ts",
"overlay/list": "./src/autofill/overlay/pages/list/bootstrap-autofill-overlay-list.ts",
"overlay/button":
"./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":
"./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",
"content/lp-fileless-importer": "./src/tools/content/lp-fileless-importer.ts",
"content/send-on-installed-message": "./src/vault/content/send-on-installed-message.ts",