mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-14 01:50:39 +09:00
Add globalToolbarButton slot type and update related documentation
This commit is contained in:
parent
2dbb31ef3c
commit
811e2b9909
7 changed files with 39 additions and 10 deletions
|
|
@ -14,6 +14,7 @@ import {
|
|||
} from "@/components/ui/breadcrumb";
|
||||
import { Fragment, useMemo } from "react";
|
||||
import { PluginSlotOutlet } from "@/plugins/slots";
|
||||
import { PluginLauncherOutlet } from "@/plugins/launchers";
|
||||
|
||||
export function BreadcrumbBar() {
|
||||
const { breadcrumbs } = useBreadcrumbs();
|
||||
|
|
@ -29,11 +30,18 @@ export function BreadcrumbBar() {
|
|||
);
|
||||
|
||||
const globalToolbarSlots = (
|
||||
<PluginSlotOutlet
|
||||
slotTypes={["toolbarButton"]}
|
||||
context={globalToolbarSlotContext}
|
||||
className="flex items-center gap-1 ml-auto shrink-0 pl-2"
|
||||
/>
|
||||
<div className="flex items-center gap-1 ml-auto shrink-0 pl-2">
|
||||
<PluginSlotOutlet
|
||||
slotTypes={["globalToolbarButton"]}
|
||||
context={globalToolbarSlotContext}
|
||||
className="flex items-center gap-1"
|
||||
/>
|
||||
<PluginLauncherOutlet
|
||||
placementZones={["globalToolbarButton"]}
|
||||
context={globalToolbarSlotContext}
|
||||
className="flex items-center gap-1"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
if (breadcrumbs.length === 0) {
|
||||
|
|
|
|||
|
|
@ -110,6 +110,7 @@ const entityScopedZones = new Set<PluginLauncherPlacementZone>([
|
|||
"commentAnnotation",
|
||||
"commentContextMenuItem",
|
||||
"projectSidebarItem",
|
||||
"toolbarButton",
|
||||
]);
|
||||
const focusableElementSelector = [
|
||||
"button:not([disabled])",
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ function buildRegistryKey(pluginKey: string, exportName: string): string {
|
|||
}
|
||||
|
||||
function requiresEntityType(slotType: PluginUiSlotType): boolean {
|
||||
return slotType === "detailTab" || slotType === "taskDetailView" || slotType === "contextMenuItem" || slotType === "commentAnnotation" || slotType === "commentContextMenuItem" || slotType === "projectSidebarItem";
|
||||
return slotType === "detailTab" || slotType === "taskDetailView" || slotType === "contextMenuItem" || slotType === "commentAnnotation" || slotType === "commentContextMenuItem" || slotType === "projectSidebarItem" || slotType === "toolbarButton";
|
||||
}
|
||||
|
||||
function getErrorMessage(error: unknown): string {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue