Skip to content

Commit

Permalink
Drop inline panel starter brick (#8723)
Browse files Browse the repository at this point in the history
  • Loading branch information
twschiller authored Jun 28, 2024
1 parent 591261d commit 149f2ad
Show file tree
Hide file tree
Showing 32 changed files with 190 additions and 1,562 deletions.
1 change: 0 additions & 1 deletion eslint-local-rules/persistBackgroundData.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@
./src/sidebar/RendererComponent.tsx
./src/starterBricks/contextMenu.ts
./src/starterBricks/contextMenuReader.ts
./src/starterBricks/dom.tsx
./src/starterBricks/factory.ts
./src/starterBricks/helpers.ts
./src/starterBricks/menuItemExtension.ts
Expand Down
2 changes: 1 addition & 1 deletion src/bricks/PipelineVisitor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ test("should invoke the callback for the Document button pipeline", () => {
}
const visitor = new Visitor();
visitor.visitRootPipeline(pipeline, {
extensionPointType: StarterBrickTypes.INLINE_PANEL,
extensionPointType: StarterBrickTypes.SIDEBAR_PANEL,
});

expect(visitBlock).toHaveBeenCalledTimes(2); // One Document brick and one brick in the pipeline
Expand Down
66 changes: 0 additions & 66 deletions src/bricks/renderers/common.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/components/BrickIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import {
import { TriggerStarterBrickABC } from "@/starterBricks/trigger/triggerStarterBrick";
import { ButtonStarterBrickABC } from "@/starterBricks/button/buttonStarterBrick";
import { ContextMenuStarterBrickABC } from "@/starterBricks/contextMenu/contextMenuStarterBrick";
import { PanelStarterBrickABC } from "@/starterBricks/panel/panelStarterBrick";
import { SidebarStarterBrickABC } from "@/starterBricks/sidebar/sidebarStarterBrick";
import getType from "@/runtime/getType";
import { type BrickType } from "@/runtime/runtimeTypes";
Expand Down Expand Up @@ -83,10 +82,6 @@ function getDefaultBrickIcon<T extends Metadata>(
return faBars;
}

if (brick instanceof PanelStarterBrickABC) {
return faWindowMaximize;
}

if (brick instanceof SidebarStarterBrickABC) {
return faColumns;
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/contentScript/messenger/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export const reloadMarketplaceEnhancements = getMethod(
export const getAttributeExamples = getMethod("GET_ATTRIBUTE_EXAMPLES");
export const selectElement = getMethod("SELECT_ELEMENT");

export const insertPanel = getMethod("INSERT_PANEL");
export const insertButton = getMethod("INSERT_BUTTON");
export const enableOverlay = getMethod("ENABLE_OVERLAY");
export const disableOverlay = getMethod("DISABLE_OVERLAY");
Expand Down
3 changes: 0 additions & 3 deletions src/contentScript/messenger/registration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ import { cancelSelect } from "@/contentScript/pageEditor/elementPicker";
import { reloadActivationEnhancements } from "@/contentScript/loadActivationEnhancementsCore";
import { getAttributeExamples } from "@/contentScript/pageEditor/elementInformation";
import selectElement from "@/contentScript/pageEditor/selectElement";
import { insertPanel } from "@/contentScript/pageEditor/insertPanel";
import { insertButton } from "@/contentScript/pageEditor/insertButton";
import {
disableOverlay,
Expand Down Expand Up @@ -105,7 +104,6 @@ declare global {
RELOAD_MARKETPLACE_ENHANCEMENTS: typeof reloadActivationEnhancements;
GET_ATTRIBUTE_EXAMPLES: typeof getAttributeExamples;
SELECT_ELEMENT: typeof selectElement;
INSERT_PANEL: typeof insertPanel;
INSERT_BUTTON: typeof insertButton;
ENABLE_OVERLAY: typeof enableOverlay;
DISABLE_OVERLAY: typeof disableOverlay;
Expand Down Expand Up @@ -159,7 +157,6 @@ export default function registerMessenger(): void {
RELOAD_MARKETPLACE_ENHANCEMENTS: reloadActivationEnhancements,
GET_ATTRIBUTE_EXAMPLES: getAttributeExamples,
SELECT_ELEMENT: selectElement,
INSERT_PANEL: insertPanel,
INSERT_BUTTON: insertButton,
ENABLE_OVERLAY: enableOverlay,
DISABLE_OVERLAY: disableOverlay,
Expand Down
61 changes: 0 additions & 61 deletions src/contentScript/pageEditor/insertPanel.tsx

This file was deleted.

13 changes: 0 additions & 13 deletions src/contentScript/pageEditor/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ import {
} from "@/starterBricks/types";
import { type StarterBrickType } from "@/types/starterBrickTypes";
import { type Except } from "type-fest";
import {
type PanelConfig,
type PanelDefinition,
} from "@/starterBricks/panel/panelStarterBrickTypes";
import {
type ButtonDefinition,
type ButtonStarterBrickConfig,
Expand All @@ -46,15 +42,6 @@ export interface DraftModComponent<
}

export type SelectMode = "element" | "container";
export type PanelSelectionResult = {
uuid: UUID;
foundation: Except<
PanelDefinition,
"defaultOptions" | "isAvailable" | "reader"
>;
panel: Except<PanelConfig, "body">;
containerInfo: ElementInfo;
};
export type DraftButtonModComponent = DraftModComponent<
ButtonDefinition,
ButtonStarterBrickConfig
Expand Down
8 changes: 5 additions & 3 deletions src/pageEditor/PanelContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,17 @@ import { shouldAutoRun } from "@/pageEditor/toolbar/ReloadToolbar";
import ReduxPersistenceContext, {
type ReduxPersistenceContextType,
} from "@/store/ReduxPersistenceContext";
import type { StarterBrickType } from "@/types/starterBrickTypes";
import {
type StarterBrickType,
StarterBrickTypes,
} from "@/types/starterBrickTypes";
import type { EditorState } from "@/pageEditor/pageEditorTypes";
import DimensionGate from "@/pageEditor/components/DimensionGate";
import { allFramesInInspectedTab } from "@/pageEditor/context/connection";
import DatabaseUnresponsiveBanner from "@/components/DatabaseUnresponsiveBanner";

const STARTER_BRICKS_TO_EXCLUDE_FROM_CLEANUP: StarterBrickType[] = [
"actionPanel",
"panel",
StarterBrickTypes.SIDEBAR_PANEL,
];

// When selecting a starter brick in the Page Editor, remove any existing starter bricks
Expand Down
5 changes: 5 additions & 0 deletions src/pageEditor/panes/EditorPane.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ async function addABlock(addButton: Element, blockName: string) {
}

describe("renders", () => {
beforeEach(() => {
// :barf: these Jest snapshot contains sequence UUIDs
formStateFactory.resetSequence();
});

test("the first selected node", async () => {
const formState = getPlainFormState();
const { instanceId } = formState.extension.blockPipeline[0];
Expand Down
Loading

0 comments on commit 149f2ad

Please sign in to comment.