@pantheon-systems/puck-css 0.4.1 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/config.d.ts +3 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +5 -6
- package/dist/core/config.js.map +1 -1
- package/dist/core/featureConfig.d.ts +2 -0
- package/dist/core/featureConfig.d.ts.map +1 -1
- package/dist/core/featureConfig.js +4 -0
- package/dist/core/featureConfig.js.map +1 -1
- package/dist/core/types.d.ts +58 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/data/dal/index.d.ts +5 -1
- package/dist/data/dal/index.d.ts.map +1 -1
- package/dist/data/dal/index.js +22 -1
- package/dist/data/dal/index.js.map +1 -1
- package/dist/data/dal/init.d.ts.map +1 -1
- package/dist/data/dal/init.js +22 -14
- package/dist/data/dal/init.js.map +1 -1
- package/dist/data/dal/p1-store.d.ts +15 -1
- package/dist/data/dal/p1-store.d.ts.map +1 -1
- package/dist/data/dal/p1-store.js +51 -5
- package/dist/data/dal/p1-store.js.map +1 -1
- package/dist/data/dal/types.d.ts +13 -1
- package/dist/data/dal/types.d.ts.map +1 -1
- package/dist/data/page-store.d.ts +17 -2
- package/dist/data/page-store.d.ts.map +1 -1
- package/dist/data/page-store.js +47 -5
- package/dist/data/page-store.js.map +1 -1
- package/dist/editor/P1App.d.ts.map +1 -1
- package/dist/editor/P1App.js +1 -1
- package/dist/editor/P1App.js.map +1 -1
- package/dist/editor/P1PuckProvider.d.ts.map +1 -1
- package/dist/editor/P1PuckProvider.js +175 -66
- package/dist/editor/P1PuckProvider.js.map +1 -1
- package/dist/editor/plugin/P1Plugin.d.ts +22 -1
- package/dist/editor/plugin/P1Plugin.d.ts.map +1 -1
- package/dist/editor/plugin/P1Plugin.js +72 -21
- package/dist/editor/plugin/P1Plugin.js.map +1 -1
- package/dist/editor/plugin/createP1Overrides.d.ts.map +1 -1
- package/dist/editor/plugin/createP1Overrides.js +4 -1
- package/dist/editor/plugin/createP1Overrides.js.map +1 -1
- package/dist/editor/useDocuments.d.ts +4 -1
- package/dist/editor/useDocuments.d.ts.map +1 -1
- package/dist/editor/useDocuments.js +5 -2
- package/dist/editor/useDocuments.js.map +1 -1
- package/dist/editor/useP1Editor.d.ts +12 -0
- package/dist/editor/useP1Editor.d.ts.map +1 -1
- package/dist/editor/useP1Editor.js +40 -5
- package/dist/editor/useP1Editor.js.map +1 -1
- package/dist/editor/useP1Plugin.d.ts +5 -1
- package/dist/editor/useP1Plugin.d.ts.map +1 -1
- package/dist/editor/useP1Plugin.js +4 -0
- package/dist/editor/useP1Plugin.js.map +1 -1
- package/dist/editor/useRealtime.d.ts +9 -4
- package/dist/editor/useRealtime.d.ts.map +1 -1
- package/dist/editor/useRealtime.js +11 -6
- package/dist/editor/useRealtime.js.map +1 -1
- package/dist/features/content-type-templates/editor/useTemplateEditor.d.ts +20 -0
- package/dist/features/content-type-templates/editor/useTemplateEditor.d.ts.map +1 -0
- package/dist/features/content-type-templates/editor/useTemplateEditor.js +62 -0
- package/dist/features/content-type-templates/editor/useTemplateEditor.js.map +1 -0
- package/dist/features/content-type-templates/editor/useTemplatePermissions.d.ts +7 -0
- package/dist/features/content-type-templates/editor/useTemplatePermissions.d.ts.map +1 -0
- package/dist/features/content-type-templates/editor/useTemplatePermissions.js +12 -0
- package/dist/features/content-type-templates/editor/useTemplatePermissions.js.map +1 -0
- package/dist/features/content-type-templates/editor/useTemplateScaffold.d.ts +19 -0
- package/dist/features/content-type-templates/editor/useTemplateScaffold.d.ts.map +1 -0
- package/dist/features/content-type-templates/editor/useTemplateScaffold.js +37 -0
- package/dist/features/content-type-templates/editor/useTemplateScaffold.js.map +1 -0
- package/dist/features/content-type-templates/hooks/useTemplateList.d.ts +41 -0
- package/dist/features/content-type-templates/hooks/useTemplateList.d.ts.map +1 -0
- package/dist/features/content-type-templates/hooks/useTemplateList.js +72 -0
- package/dist/features/content-type-templates/hooks/useTemplateList.js.map +1 -0
- package/dist/features/content-type-templates/index.d.ts +18 -0
- package/dist/features/content-type-templates/index.d.ts.map +1 -0
- package/dist/features/content-type-templates/index.js +13 -0
- package/dist/features/content-type-templates/index.js.map +1 -0
- package/dist/features/content-type-templates/permissions/createPuckPermissions.d.ts +68 -0
- package/dist/features/content-type-templates/permissions/createPuckPermissions.d.ts.map +1 -0
- package/dist/features/content-type-templates/permissions/createPuckPermissions.js +90 -0
- package/dist/features/content-type-templates/permissions/createPuckPermissions.js.map +1 -0
- package/dist/features/content-type-templates/permissions/role-permissions.d.ts +49 -0
- package/dist/features/content-type-templates/permissions/role-permissions.d.ts.map +1 -0
- package/dist/features/content-type-templates/permissions/role-permissions.js +79 -0
- package/dist/features/content-type-templates/permissions/role-permissions.js.map +1 -0
- package/dist/features/content-type-templates/permissions/useContentRole.d.ts +37 -0
- package/dist/features/content-type-templates/permissions/useContentRole.d.ts.map +1 -0
- package/dist/features/content-type-templates/permissions/useContentRole.js +34 -0
- package/dist/features/content-type-templates/permissions/useContentRole.js.map +1 -0
- package/dist/features/content-type-templates/permissions/useResolveContentRole.d.ts +38 -0
- package/dist/features/content-type-templates/permissions/useResolveContentRole.d.ts.map +1 -0
- package/dist/features/content-type-templates/permissions/useResolveContentRole.js +83 -0
- package/dist/features/content-type-templates/permissions/useResolveContentRole.js.map +1 -0
- package/dist/features/content-type-templates/stores/index.d.ts +9 -0
- package/dist/features/content-type-templates/stores/index.d.ts.map +1 -0
- package/dist/features/content-type-templates/stores/index.js +8 -0
- package/dist/features/content-type-templates/stores/index.js.map +1 -0
- package/dist/features/content-type-templates/stores/template-store-api.d.ts +17 -0
- package/dist/features/content-type-templates/stores/template-store-api.d.ts.map +1 -0
- package/dist/features/content-type-templates/stores/template-store-api.js +56 -0
- package/dist/features/content-type-templates/stores/template-store-api.js.map +1 -0
- package/dist/features/content-type-templates/stores/template-store.d.ts +54 -0
- package/dist/features/content-type-templates/stores/template-store.d.ts.map +1 -0
- package/dist/features/content-type-templates/stores/template-store.js +80 -0
- package/dist/features/content-type-templates/stores/template-store.js.map +1 -0
- package/dist/features/content-type-templates/types.d.ts +114 -0
- package/dist/features/content-type-templates/types.d.ts.map +1 -0
- package/dist/features/content-type-templates/types.js +7 -0
- package/dist/features/content-type-templates/types.js.map +1 -0
- package/dist/features/content-type-templates/ui/ActionBarPinButton.d.ts +3 -0
- package/dist/features/content-type-templates/ui/ActionBarPinButton.d.ts.map +1 -0
- package/dist/features/content-type-templates/ui/ActionBarPinButton.js +77 -0
- package/dist/features/content-type-templates/ui/ActionBarPinButton.js.map +1 -0
- package/dist/features/content-type-templates/ui/TemplateManagerOverlay.d.ts +18 -0
- package/dist/features/content-type-templates/ui/TemplateManagerOverlay.d.ts.map +1 -0
- package/dist/features/content-type-templates/ui/TemplateManagerOverlay.js +167 -0
- package/dist/features/content-type-templates/ui/TemplateManagerOverlay.js.map +1 -0
- package/dist/features/content-type-templates/ui/TemplatePinPanel.d.ts +18 -0
- package/dist/features/content-type-templates/ui/TemplatePinPanel.d.ts.map +1 -0
- package/dist/features/content-type-templates/ui/TemplatePinPanel.js +11 -0
- package/dist/features/content-type-templates/ui/TemplatePinPanel.js.map +1 -0
- package/dist/features/content-type-templates/ui/TemplateSelector.d.ts +41 -0
- package/dist/features/content-type-templates/ui/TemplateSelector.d.ts.map +1 -0
- package/dist/features/content-type-templates/ui/TemplateSelector.js +32 -0
- package/dist/features/content-type-templates/ui/TemplateSelector.js.map +1 -0
- package/dist/features/content-type-templates/ui/dataToTemplate.d.ts +25 -0
- package/dist/features/content-type-templates/ui/dataToTemplate.d.ts.map +1 -0
- package/dist/features/content-type-templates/ui/dataToTemplate.js +37 -0
- package/dist/features/content-type-templates/ui/dataToTemplate.js.map +1 -0
- package/dist/features/content-type-templates/validation/structural-validation.d.ts +29 -0
- package/dist/features/content-type-templates/validation/structural-validation.d.ts.map +1 -0
- package/dist/features/content-type-templates/validation/structural-validation.js +69 -0
- package/dist/features/content-type-templates/validation/structural-validation.js.map +1 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/p1/editor/connect/connect-field-modal.d.ts.map +1 -1
- package/dist/p1/editor/connect/connect-field-modal.js +23 -1
- package/dist/p1/editor/connect/connect-field-modal.js.map +1 -1
- package/dist/p1/editor/connect/field-connect-plugin.d.ts.map +1 -1
- package/dist/p1/editor/connect/field-connect-plugin.js +2 -6
- package/dist/p1/editor/connect/field-connect-plugin.js.map +1 -1
- package/dist/p1/pages/conflict-resolution-panel.d.ts +17 -0
- package/dist/p1/pages/conflict-resolution-panel.d.ts.map +1 -0
- package/dist/p1/pages/conflict-resolution-panel.js +74 -0
- package/dist/p1/pages/conflict-resolution-panel.js.map +1 -0
- package/dist/p1/pages/content-type-template-list.d.ts +7 -0
- package/dist/p1/pages/content-type-template-list.d.ts.map +1 -0
- package/dist/p1/pages/content-type-template-list.js +108 -0
- package/dist/p1/pages/content-type-template-list.js.map +1 -0
- package/dist/p1/pages/create-content-type-form.d.ts +7 -0
- package/dist/p1/pages/create-content-type-form.d.ts.map +1 -0
- package/dist/p1/pages/create-content-type-form.js +102 -0
- package/dist/p1/pages/create-content-type-form.js.map +1 -0
- package/dist/p1/pages/create-page-form.d.ts +8 -1
- package/dist/p1/pages/create-page-form.d.ts.map +1 -1
- package/dist/p1/pages/create-page-form.js +67 -8
- package/dist/p1/pages/create-page-form.js.map +1 -1
- package/dist/p1/pages/create-template-form.d.ts +6 -1
- package/dist/p1/pages/create-template-form.d.ts.map +1 -1
- package/dist/p1/pages/create-template-form.js +61 -15
- package/dist/p1/pages/create-template-form.js.map +1 -1
- package/dist/p1/pages/hooks.d.ts +6 -1
- package/dist/p1/pages/hooks.d.ts.map +1 -1
- package/dist/p1/pages/hooks.js +13 -2
- package/dist/p1/pages/hooks.js.map +1 -1
- package/dist/p1/pages/index.d.ts +5 -0
- package/dist/p1/pages/index.d.ts.map +1 -1
- package/dist/p1/pages/index.js +5 -0
- package/dist/p1/pages/index.js.map +1 -1
- package/dist/p1/pages/migration-conflict-queue.d.ts +8 -0
- package/dist/p1/pages/migration-conflict-queue.d.ts.map +1 -0
- package/dist/p1/pages/migration-conflict-queue.js +62 -0
- package/dist/p1/pages/migration-conflict-queue.js.map +1 -0
- package/dist/p1/pages/migration-preview-panel.d.ts +12 -0
- package/dist/p1/pages/migration-preview-panel.d.ts.map +1 -0
- package/dist/p1/pages/migration-preview-panel.js +157 -0
- package/dist/p1/pages/migration-preview-panel.js.map +1 -0
- package/dist/p1/pages/migration-status-panel.d.ts +7 -0
- package/dist/p1/pages/migration-status-panel.d.ts.map +1 -0
- package/dist/p1/pages/migration-status-panel.js +198 -0
- package/dist/p1/pages/migration-status-panel.js.map +1 -0
- package/dist/p1/pages/structure-page.d.ts.map +1 -1
- package/dist/p1/pages/structure-page.js +75 -18
- package/dist/p1/pages/structure-page.js.map +1 -1
- package/dist/p1/pages/structure-tabs.d.ts +11 -0
- package/dist/p1/pages/structure-tabs.d.ts.map +1 -0
- package/dist/p1/pages/structure-tabs.js +45 -0
- package/dist/p1/pages/structure-tabs.js.map +1 -0
- package/dist/pds/components/P1EditorHeader.d.ts +8 -9
- package/dist/pds/components/P1EditorHeader.d.ts.map +1 -1
- package/dist/pds/components/P1EditorHeader.js +20 -52
- package/dist/pds/components/P1EditorHeader.js.map +1 -1
- package/dist/pds/components/P1EditorHeader.module.css +43 -17
- package/dist/pds/components/P1EditorSubheader.d.ts +10 -1
- package/dist/pds/components/P1EditorSubheader.d.ts.map +1 -1
- package/dist/pds/components/P1EditorSubheader.js +4 -3
- package/dist/pds/components/P1EditorSubheader.js.map +1 -1
- package/dist/pds/components/P1EditorSubheader.module.css +31 -2
- package/dist/pds/components/PageNavigator.d.ts +7 -2
- package/dist/pds/components/PageNavigator.d.ts.map +1 -1
- package/dist/pds/components/PageNavigator.js +28 -7
- package/dist/pds/components/PageNavigator.js.map +1 -1
- package/dist/pds/components/PageNavigator.module.css +70 -0
- package/dist/pds/components/PublishControl.d.ts +4 -1
- package/dist/pds/components/PublishControl.d.ts.map +1 -1
- package/dist/pds/components/PublishControl.js +27 -10
- package/dist/pds/components/PublishControl.js.map +1 -1
- package/dist/pds/components/WorkstreamSwitcher.d.ts.map +1 -1
- package/dist/pds/components/WorkstreamSwitcher.js +8 -3
- package/dist/pds/components/WorkstreamSwitcher.js.map +1 -1
- package/dist/pds/components/WorkstreamSwitcher.module.css +12 -2
- package/package.json +16 -16
- package/src/styles.css +364 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useEffect, useRef } from "react";
|
|
4
|
+
import { useP1Router } from "../router-context";
|
|
5
|
+
function getInitialTab(tabs) {
|
|
6
|
+
if (typeof window !== "undefined") {
|
|
7
|
+
const hash = window.location.hash.slice(1);
|
|
8
|
+
if (tabs.some((t) => t.id === hash))
|
|
9
|
+
return hash;
|
|
10
|
+
}
|
|
11
|
+
return tabs[0]?.id ?? "";
|
|
12
|
+
}
|
|
13
|
+
export function StructureTabs({ tabs }) {
|
|
14
|
+
const [activeTab, setActiveTab] = useState(() => getInitialTab(tabs));
|
|
15
|
+
const isInitialRender = useRef(true);
|
|
16
|
+
const router = useP1Router();
|
|
17
|
+
const routerRef = useRef(router);
|
|
18
|
+
routerRef.current = router;
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
window.location.hash = activeTab;
|
|
21
|
+
if (isInitialRender.current) {
|
|
22
|
+
isInitialRender.current = false;
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
routerRef.current.refresh();
|
|
26
|
+
window.dispatchEvent(new CustomEvent("p1:tab-activated", { detail: { tabId: activeTab } }));
|
|
27
|
+
}, [activeTab]);
|
|
28
|
+
return (_jsxs("div", { children: [_jsx("div", { style: {
|
|
29
|
+
display: "flex",
|
|
30
|
+
gap: 0,
|
|
31
|
+
borderBottom: "2px solid #e0e0e0",
|
|
32
|
+
marginBottom: 16,
|
|
33
|
+
}, children: tabs.map((tab) => (_jsx("button", { type: "button", onClick: () => setActiveTab(tab.id), style: {
|
|
34
|
+
padding: "10px 20px",
|
|
35
|
+
fontSize: 14,
|
|
36
|
+
fontWeight: activeTab === tab.id ? 600 : 400,
|
|
37
|
+
color: activeTab === tab.id ? "#111" : "#666",
|
|
38
|
+
background: "none",
|
|
39
|
+
border: "none",
|
|
40
|
+
borderBottom: activeTab === tab.id ? "2px solid #111" : "2px solid transparent",
|
|
41
|
+
marginBottom: -2,
|
|
42
|
+
cursor: "pointer",
|
|
43
|
+
}, children: tab.label }, tab.id))) }), tabs.map((tab) => (_jsx("div", { style: { display: activeTab === tab.id ? "block" : "none" }, children: tab.content }, tab.id)))] }));
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=structure-tabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structure-tabs.js","sourceRoot":"","sources":["../../../src/p1/pages/structure-tabs.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAkB,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAQhD,SAAS,aAAa,CAAC,IAAW;IAChC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC3C,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC;IACnD,CAAC;IACD,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,EAAE,IAAI,EAAmB;I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AAS,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;wBAC7C,UAAU,EAAE,MAAM;wBAClB,MAAM,EAAE,MAAM;wBACd,YAAY,EAAE,SAAS,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,uBAAuB;wBAC/E,YAAY,EAAE,CAAC,CAAC;wBAChB,MAAM,EAAE,SAAS;qBAClB,YAEA,GAAG,CAAC,KAAK,IAfL,GAAG,CAAC,EAAE,CAgBJ,CACV,CAAC,GACE,EACL,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACjB,cAAkB,KAAK,EAAE,EAAE,OAAO,EAAE,SAAS,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,YAC1E,GAAG,CAAC,OAAO,IADJ,GAAG,CAAC,EAAE,CAEV,CACP,CAAC,IACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* (non-main branches only).
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import type { Branch } from '@pantheon-systems/css-client';
|
|
11
10
|
import type { PageNavigatorDocument } from './PageNavigator.js';
|
|
11
|
+
import type { Template } from '../../features/content-type-templates/types.js';
|
|
12
12
|
export type { PageNavigatorDocument };
|
|
13
13
|
export interface CurrentUser {
|
|
14
14
|
id: string;
|
|
@@ -22,20 +22,19 @@ export interface SiteMenuItem {
|
|
|
22
22
|
callback: () => void;
|
|
23
23
|
}
|
|
24
24
|
export interface P1EditorHeaderProps {
|
|
25
|
-
branches: Branch[];
|
|
26
|
-
currentBranch: Branch | null;
|
|
27
25
|
documents: PageNavigatorDocument[];
|
|
28
26
|
currentDocument: PageNavigatorDocument | null;
|
|
29
27
|
selectedDocumentPath?: string | null;
|
|
30
28
|
currentUser?: CurrentUser;
|
|
31
29
|
siteName: string;
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
siteId?: string;
|
|
31
|
+
dashboardUrl?: string;
|
|
34
32
|
onSelectDocument: (doc: PageNavigatorDocument) => void;
|
|
35
|
-
onCreateDocument?: (path: string) => Promise<void>;
|
|
36
|
-
onCreateBranch?: (name: string) => Promise<void>;
|
|
37
|
-
onCompareWithLive: () => void;
|
|
33
|
+
onCreateDocument?: (path: string, template?: Template | null) => Promise<void>;
|
|
38
34
|
onLogout: () => void;
|
|
35
|
+
templates?: Template[];
|
|
36
|
+
templatesLoading?: boolean;
|
|
37
|
+
onManageTemplates?: () => void;
|
|
39
38
|
}
|
|
40
|
-
export declare function P1EditorHeader({
|
|
39
|
+
export declare function P1EditorHeader({ documents, currentDocument, selectedDocumentPath, currentUser, siteName, siteId, dashboardUrl, onSelectDocument, onCreateDocument, onLogout, templates, templatesLoading, onManageTemplates, }: P1EditorHeaderProps): React.ReactElement;
|
|
41
40
|
//# sourceMappingURL=P1EditorHeader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"P1EditorHeader.d.ts","sourceRoot":"","sources":["../../../src/pds/components/P1EditorHeader.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAmD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"P1EditorHeader.d.ts","sourceRoot":"","sources":["../../../src/pds/components/P1EditorHeader.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAmD,MAAM,OAAO,CAAC;AAKxE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAG/E,YAAY,EAAE,qBAAqB,EAAE,CAAC;AAEtC,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,qBAAqB,EAAE,CAAC;IACnC,eAAe,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAC9C,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,CAAC,GAAG,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACvD,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/E,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC;AAED,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,eAAe,EACf,oBAAoB,EACpB,WAAW,EACX,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,iBAAiB,GAClB,EAAE,mBAAmB,GAAG,KAAK,CAAC,YAAY,CAgR1C"}
|
|
@@ -7,27 +7,21 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
* user avatar with account menu, and the "Compare with Live" button
|
|
8
8
|
* (non-main branches only).
|
|
9
9
|
*/
|
|
10
|
-
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
10
|
+
import React, { useState, useRef, useCallback, useEffect } from 'react';
|
|
11
11
|
import { createPortal } from 'react-dom';
|
|
12
|
-
import { Icon,
|
|
12
|
+
import { Icon, Avatar, PantheonLogo } from '@pantheon-systems/pds-toolkit-react';
|
|
13
13
|
import { getAvatarStyleOverride } from '../../collaboration/utils/avatarColor.js';
|
|
14
|
-
import { WorkstreamSwitcher } from './WorkstreamSwitcher.js';
|
|
15
14
|
import { PageNavigator } from './PageNavigator.js';
|
|
16
15
|
import styles from './P1EditorHeader.module.css';
|
|
17
|
-
export function P1EditorHeader({
|
|
16
|
+
export function P1EditorHeader({ documents, currentDocument, selectedDocumentPath, currentUser, siteName, siteId, dashboardUrl, onSelectDocument, onCreateDocument, onLogout, templates, templatesLoading, onManageTemplates, }) {
|
|
18
17
|
const [pageNavigatorOpen, setPageNavigatorOpen] = useState(false);
|
|
19
18
|
const [navigatorPortalStyle, setNavigatorPortalStyle] = useState();
|
|
20
19
|
const pageSelectorRef = useRef(null);
|
|
21
|
-
const [siteMenuOpen, setSiteMenuOpen] = useState(false);
|
|
22
|
-
const [siteMenuStyle, setSiteMenuStyle] = useState({});
|
|
23
|
-
const siteMenuTriggerRef = useRef(null);
|
|
24
|
-
const siteMenuDropdownRef = useRef(null);
|
|
25
20
|
const [userMenuOpen, setUserMenuOpen] = useState(false);
|
|
26
21
|
const [userMenuStyle, setUserMenuStyle] = useState({});
|
|
27
22
|
const userMenuTriggerRef = useRef(null);
|
|
28
23
|
const userMenuRef = useRef(null);
|
|
29
24
|
const handlePageSelectorClick = useCallback(() => {
|
|
30
|
-
setSiteMenuOpen(false);
|
|
31
25
|
setUserMenuOpen(false);
|
|
32
26
|
if (!pageNavigatorOpen && pageSelectorRef.current) {
|
|
33
27
|
const rect = pageSelectorRef.current.getBoundingClientRect();
|
|
@@ -42,25 +36,8 @@ export function P1EditorHeader({ branches, currentBranch, documents, currentDocu
|
|
|
42
36
|
}
|
|
43
37
|
setPageNavigatorOpen((o) => !o);
|
|
44
38
|
}, [pageNavigatorOpen]);
|
|
45
|
-
const handleSiteMenuClick = useCallback(() => {
|
|
46
|
-
setPageNavigatorOpen(false);
|
|
47
|
-
setUserMenuOpen(false);
|
|
48
|
-
if (!siteMenuOpen && siteMenuTriggerRef.current) {
|
|
49
|
-
const rect = siteMenuTriggerRef.current.getBoundingClientRect();
|
|
50
|
-
const menuMaxW = Math.min(280, window.innerWidth - 16);
|
|
51
|
-
setSiteMenuStyle({
|
|
52
|
-
position: 'fixed',
|
|
53
|
-
top: rect.bottom + 6,
|
|
54
|
-
left: Math.min(rect.left, window.innerWidth - menuMaxW - 8),
|
|
55
|
-
maxWidth: menuMaxW,
|
|
56
|
-
zIndex: 9999,
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
setSiteMenuOpen((prev) => !prev);
|
|
60
|
-
}, [siteMenuOpen]);
|
|
61
39
|
const handleUserMenuClick = useCallback(() => {
|
|
62
40
|
setPageNavigatorOpen(false);
|
|
63
|
-
setSiteMenuOpen(false);
|
|
64
41
|
if (!userMenuOpen && userMenuTriggerRef.current) {
|
|
65
42
|
const rect = userMenuTriggerRef.current.getBoundingClientRect();
|
|
66
43
|
setUserMenuStyle({
|
|
@@ -88,20 +65,6 @@ export function P1EditorHeader({ branches, currentBranch, documents, currentDocu
|
|
|
88
65
|
document.addEventListener('pointerdown', handleClickOutside, { capture: true });
|
|
89
66
|
return () => document.removeEventListener('pointerdown', handleClickOutside, { capture: true });
|
|
90
67
|
}, [pageNavigatorOpen]);
|
|
91
|
-
useEffect(() => {
|
|
92
|
-
if (!siteMenuOpen)
|
|
93
|
-
return;
|
|
94
|
-
function handleClickOutside(e) {
|
|
95
|
-
const target = e.target;
|
|
96
|
-
if (siteMenuTriggerRef.current?.contains(target) ||
|
|
97
|
-
siteMenuDropdownRef.current?.contains(target)) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
setSiteMenuOpen(false);
|
|
101
|
-
}
|
|
102
|
-
document.addEventListener('pointerdown', handleClickOutside, { capture: true });
|
|
103
|
-
return () => document.removeEventListener('pointerdown', handleClickOutside, { capture: true });
|
|
104
|
-
}, [siteMenuOpen]);
|
|
105
68
|
useEffect(() => {
|
|
106
69
|
if (!userMenuOpen)
|
|
107
70
|
return;
|
|
@@ -115,22 +78,27 @@ export function P1EditorHeader({ branches, currentBranch, documents, currentDocu
|
|
|
115
78
|
document.addEventListener('pointerdown', handleClickOutside, { capture: true });
|
|
116
79
|
return () => document.removeEventListener('pointerdown', handleClickOutside, { capture: true });
|
|
117
80
|
}, [userMenuOpen]);
|
|
118
|
-
const isMain = currentBranch?.isMain ?? true;
|
|
119
81
|
function handleSelectDocument(doc) {
|
|
120
82
|
onSelectDocument(doc);
|
|
121
83
|
setPageNavigatorOpen(false);
|
|
122
84
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
85
|
+
// Build dashboard URL if siteId is provided
|
|
86
|
+
const dashboardHref = React.useMemo(() => {
|
|
87
|
+
if (!siteId)
|
|
88
|
+
return undefined;
|
|
89
|
+
const baseUrl = (dashboardUrl || 'https://content.pantheon.io').replace(/\/$/, '');
|
|
90
|
+
return `${baseUrl}/dashboard/sites/${siteId}`;
|
|
91
|
+
}, [siteId, dashboardUrl]);
|
|
92
|
+
return (_jsxs("header", { "data-testid": "p1-editor-header", className: styles.header, children: [dashboardHref ? (_jsx("a", { href: dashboardHref, className: styles.logoLink, title: "Go to P1 Dashboard", "data-testid": "p1-logo-link", target: "_blank", rel: "noopener noreferrer", children: _jsx(PantheonLogo, { "data-testid": "p1-logo", className: styles.logo, displayType: "sub-brand", subBrand: "P1", size: "s", linkContent: null }) })) : (_jsx(PantheonLogo, { "data-testid": "p1-logo", className: styles.logo, displayType: "sub-brand", subBrand: "P1", size: "s", linkContent: null })), _jsx("div", { "data-testid": "site-label", className: styles.siteLabel, children: _jsxs("span", { className: styles.labelText, children: ["Site: ", siteName] }) }), _jsxs("div", { className: styles.pageSelectorGroup, children: [_jsxs("button", { ref: pageSelectorRef, "data-testid": "page-selector", className: styles.pageSelector, onClick: handlePageSelectorClick, type: "button", "aria-haspopup": "true", "aria-expanded": pageNavigatorOpen, children: [_jsx(Icon, { iconName: "folderTree", iconSize: "s", "aria-hidden": "true" }), _jsxs("span", { className: styles.labelText, children: [currentDocument?.path || selectedDocumentPath || 'Select a page', _jsx(Icon, { iconName: "angleDown", iconSize: "s", "aria-hidden": "true" })] })] }), (() => {
|
|
93
|
+
const pagePath = currentDocument?.path || selectedDocumentPath;
|
|
94
|
+
// Show button if there's a path and it's not empty/root
|
|
95
|
+
const shouldShow = pagePath && pagePath !== '/' && pagePath !== '';
|
|
96
|
+
return shouldShow ? (_jsx("a", { href: pagePath, target: "_blank", rel: "noopener noreferrer", className: styles.externalLinkButton, title: "Open page in new tab", "data-testid": "open-external", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }), _jsx("polyline", { points: "15 3 21 3 21 9" }), _jsx("line", { x1: "10", x2: "21", y1: "14", y2: "3" })] }) })) : null;
|
|
97
|
+
})()] }), _jsx(PageNavigator, { open: pageNavigatorOpen, documents: documents, currentDocument: currentDocument, isMainBranch: true, onSelect: handleSelectDocument, onCreateDocument: onCreateDocument, templates: templates, templatesLoading: templatesLoading, onClose: () => setPageNavigatorOpen(false), portalStyle: navigatorPortalStyle }), _jsx("div", { className: styles.spacer }), _jsx("button", { ref: userMenuTriggerRef, "data-testid": "user-menu-trigger", type: "button", className: styles.userAvatar, onClick: handleUserMenuClick, "aria-haspopup": "menu", "aria-expanded": userMenuOpen, "aria-label": "Account menu", style: currentUser ? getAvatarStyleOverride(currentUser.id) : undefined, children: currentUser?.avatar ? (_jsx("div", { className: "pds-avatar pds-avatar--md pds-avatar--image", children: _jsx("span", { className: "pds-avatar__content", children: _jsx("img", { alt: "", className: "pds-avatar__image", src: currentUser.avatar, referrerPolicy: "no-referrer", crossOrigin: "anonymous" }) }) })) : (_jsx(Avatar, { uniqueId: currentUser?.id, hasUserFallback: true, size: "m" })) }), userMenuOpen &&
|
|
98
|
+
createPortal(_jsxs("div", { ref: userMenuRef, "data-testid": "user-menu", className: styles.dropdownMenu, role: "menu", style: userMenuStyle, children: [currentUser?.name && (_jsx("div", { className: styles.dropdownUserInfo, role: "presentation", children: currentUser.name })), onManageTemplates && (_jsxs("button", { type: "button", role: "menuitem", className: styles.dropdownMenuItem, onClick: () => {
|
|
99
|
+
setUserMenuOpen(false);
|
|
100
|
+
onManageTemplates();
|
|
101
|
+
}, children: [_jsx(Icon, { iconName: "grid", iconSize: "s", "aria-hidden": "true" }), "Manage Templates"] })), _jsxs("button", { type: "button", role: "menuitem", "data-testid": "user-menu-logout", className: styles.dropdownMenuItem, onClick: () => {
|
|
134
102
|
setUserMenuOpen(false);
|
|
135
103
|
onLogout();
|
|
136
104
|
}, children: [_jsx(Icon, { iconName: "bracketRight", iconSize: "s", "aria-hidden": "true" }), "Log out"] })] }), document.body)] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"P1EditorHeader.js","sourceRoot":"","sources":["../../../src/pds/components/P1EditorHeader.tsx"],"names":[],"mappings":";AAAA;;;;;;;GAOG;AAEH,
|
|
1
|
+
{"version":3,"file":"P1EditorHeader.js","sourceRoot":"","sources":["../../../src/pds/components/P1EditorHeader.tsx"],"names":[],"mappings":";AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE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f,IAAI,EAAC,GAAG,GACR,CACH,GACM,EAER,YAAY;gBACX,YAAY,CACV,eACE,GAAG,EAAE,WAAW,iBACJ,WAAW,EACvB,SAAS,EAAE,MAAM,CAAC,YAAY,EAC9B,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,aAAa,aAEnB,WAAW,EAAE,IAAI,IAAI,CACpB,cAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,EAAE,IAAI,EAAC,cAAc,YACzD,WAAW,CAAC,IAAI,GACb,CACP,EACA,iBAAiB,IAAI,CACpB,kBACE,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,UAAU,EACf,SAAS,EAAE,MAAM,CAAC,gBAAgB,EAClC,OAAO,EAAE,GAAG,EAAE;gCACZ,eAAe,CAAC,KAAK,CAAC,CAAC;gCACvB,iBAAiB,EAAE,CAAC;4BACtB,CAAC,aAED,KAAC,IAAI,IAAC,QAAQ,EAAC,MAAM,EAAC,QAAQ,EAAC,GAAG,iBAAa,MAAM,GAAG,wBAEjD,CACV,EACD,kBACE,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,UAAU,iBACH,kBAAkB,EAC9B,SAAS,EAAE,MAAM,CAAC,gBAAgB,EAClC,OAAO,EAAE,GAAG,EAAE;gCACZ,eAAe,CAAC,KAAK,CAAC,CAAC;gCACvB,QAAQ,EAAE,CAAC;4BACb,CAAC,aAED,KAAC,IAAI,IAAC,QAAQ,EAAC,cAAc,EAAC,QAAQ,EAAC,GAAG,iBAAa,MAAM,GAAG,eAEzD,IACL,EACN,QAAQ,CAAC,IAAI,CACd,IACI,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -35,6 +35,23 @@
|
|
|
35
35
|
The PDS component defaults to 3.052rem icon height; we scale it down
|
|
36
36
|
to fit the compact 52px editor header. */
|
|
37
37
|
|
|
38
|
+
.logoLink {
|
|
39
|
+
flex-shrink: 0;
|
|
40
|
+
text-decoration: none;
|
|
41
|
+
display: inline-flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
transition: opacity 0.2s cubic-bezier(0.2, 0, 0, 1);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.logoLink:hover {
|
|
48
|
+
opacity: 0.7;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.logoLink .logo {
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
}
|
|
54
|
+
|
|
38
55
|
.logo {
|
|
39
56
|
flex-shrink: 0;
|
|
40
57
|
user-select: none;
|
|
@@ -52,30 +69,21 @@
|
|
|
52
69
|
padding-inline-end: 0;
|
|
53
70
|
}
|
|
54
71
|
|
|
55
|
-
/* ── Site
|
|
72
|
+
/* ── Site label ───────────────────────────────────────────── */
|
|
56
73
|
|
|
57
|
-
.
|
|
74
|
+
.siteLabel {
|
|
58
75
|
display: inline-flex;
|
|
59
76
|
align-items: center;
|
|
60
|
-
gap: 0.41rem;
|
|
61
77
|
padding: 0.41rem 0.64rem;
|
|
62
|
-
background: transparent;
|
|
63
|
-
border: 1px solid var(--pds-color-border-default, oklch(0.9401 0 0));
|
|
64
|
-
border-radius: var(--pds-border-radius-default, 0.188rem);
|
|
65
78
|
font-family: var(--pds-typography-ff-default, 'Inter', sans-serif);
|
|
66
79
|
font-size: var(--pds-typography-size-s, 0.875rem);
|
|
80
|
+
font-weight: var(--pds-typography-fw-medium, 500);
|
|
67
81
|
color: var(--pds-color-fg-default, oklch(0.2046 0 0));
|
|
68
|
-
cursor: pointer;
|
|
69
82
|
white-space: nowrap;
|
|
70
83
|
line-height: 1;
|
|
71
84
|
flex-shrink: 0;
|
|
72
85
|
}
|
|
73
86
|
|
|
74
|
-
.siteSelector:hover {
|
|
75
|
-
background: var(--pds-color-button-secondary-background-hover, oklch(0.96 0 0));
|
|
76
|
-
border-color: var(--pds-color-button-secondary-border-hover, oklch(0.75 0 0));
|
|
77
|
-
}
|
|
78
|
-
|
|
79
87
|
/* ── Vertical divider between site selector and workstream switcher ── */
|
|
80
88
|
/* Prototype: <div style={{ width: 1, height: 20, background: c.borderSubtle }} /> */
|
|
81
89
|
|
|
@@ -95,6 +103,14 @@
|
|
|
95
103
|
position: relative;
|
|
96
104
|
}
|
|
97
105
|
|
|
106
|
+
/* ── Page selector button group ────────────────────────────────────────────── */
|
|
107
|
+
|
|
108
|
+
.pageSelectorGroup {
|
|
109
|
+
display: inline-flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
flex-shrink: 0;
|
|
112
|
+
}
|
|
113
|
+
|
|
98
114
|
/* ── Page selector button ────────────────────────────────────────────── */
|
|
99
115
|
/* Mirrors the WorkstreamSwitcher trigger styling */
|
|
100
116
|
|
|
@@ -105,8 +121,8 @@
|
|
|
105
121
|
height: 2rem;
|
|
106
122
|
padding: 0.5rem 0.64rem;
|
|
107
123
|
background: transparent;
|
|
108
|
-
border: 1px solid oklch(0.
|
|
109
|
-
border-radius: var(--pds-border-radius-
|
|
124
|
+
border: 1px solid var(--pds-color-border-input, oklch(0.8853 0 0));
|
|
125
|
+
border-radius: var(--pds-border-radius-button, 3.5rem);
|
|
110
126
|
font-family: var(--pds-typography-ff-default, 'Inter', sans-serif);
|
|
111
127
|
font-size: var(--pds-typography-size-s, 0.875rem);
|
|
112
128
|
font-weight: var(--pds-typography-fw-medium, 500);
|
|
@@ -128,6 +144,12 @@
|
|
|
128
144
|
border-color: oklch(0.75 0 0); /* borderStrong */
|
|
129
145
|
}
|
|
130
146
|
|
|
147
|
+
/* When external link button follows page selector, create button group */
|
|
148
|
+
.pageSelector:has(+ .externalLinkButton) {
|
|
149
|
+
border-top-right-radius: 0;
|
|
150
|
+
border-bottom-right-radius: 0;
|
|
151
|
+
}
|
|
152
|
+
|
|
131
153
|
/* ── External link button ──────────────────────────────────────────────── */
|
|
132
154
|
|
|
133
155
|
.externalLinkButton {
|
|
@@ -138,8 +160,10 @@
|
|
|
138
160
|
height: 2rem;
|
|
139
161
|
padding: 0.5rem;
|
|
140
162
|
background: transparent;
|
|
141
|
-
border: 1px solid oklch(0.
|
|
142
|
-
border-radius: var(--pds-border-radius-
|
|
163
|
+
border: 1px solid var(--pds-color-border-input, oklch(0.8853 0 0));
|
|
164
|
+
border-radius: var(--pds-border-radius-button, 3.5rem);
|
|
165
|
+
border-top-left-radius: 0;
|
|
166
|
+
border-bottom-left-radius: 0;
|
|
143
167
|
color: var(--pds-color-fg-default, oklch(0.2046 0 0));
|
|
144
168
|
cursor: pointer;
|
|
145
169
|
text-decoration: none;
|
|
@@ -147,12 +171,14 @@
|
|
|
147
171
|
background 0.2s cubic-bezier(0.2, 0, 0, 1),
|
|
148
172
|
border-color 0.2s cubic-bezier(0.2, 0, 0, 1);
|
|
149
173
|
flex-shrink: 0;
|
|
150
|
-
margin-left:
|
|
174
|
+
margin-left: -1px;
|
|
151
175
|
}
|
|
152
176
|
|
|
153
177
|
.externalLinkButton:hover {
|
|
154
178
|
background: oklch(0.96 0 0); /* bgSubtle */
|
|
155
179
|
border-color: oklch(0.75 0 0); /* borderStrong */
|
|
180
|
+
position: relative;
|
|
181
|
+
z-index: 1; /* Bring to front on hover so border is visible */
|
|
156
182
|
}
|
|
157
183
|
|
|
158
184
|
/* ── Spacer ──────────────────────────────────────────────────────────── */
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* bar (P1EditorHeader), shown only when not on the live workstream.
|
|
10
10
|
*/
|
|
11
11
|
import React from 'react';
|
|
12
|
+
import type { Branch } from '@pantheon-systems/css-client';
|
|
12
13
|
import type { DocState } from '../types.js';
|
|
13
14
|
export interface SubheaderActor {
|
|
14
15
|
id: string;
|
|
@@ -30,6 +31,7 @@ export interface P1EditorSubheaderProps {
|
|
|
30
31
|
onStopAgent: (id: string) => void;
|
|
31
32
|
onPublish?: () => Promise<void> | void;
|
|
32
33
|
onReviewAndPublish?: () => void;
|
|
34
|
+
onReviewWorkstream?: () => void;
|
|
33
35
|
onCreateWorkstream?: () => void;
|
|
34
36
|
onDeleteDocument?: () => Promise<void> | void;
|
|
35
37
|
hasPast: boolean;
|
|
@@ -38,8 +40,15 @@ export interface P1EditorSubheaderProps {
|
|
|
38
40
|
onRedo: () => void;
|
|
39
41
|
leftPanelVisible?: boolean;
|
|
40
42
|
rightPanelVisible?: boolean;
|
|
43
|
+
pluginRailVisible?: boolean;
|
|
41
44
|
onToggleLeftPanel?: () => void;
|
|
42
45
|
onToggleRightPanel?: () => void;
|
|
46
|
+
onTogglePluginRail?: () => void;
|
|
47
|
+
branches: Branch[];
|
|
48
|
+
currentBranch: Branch | null;
|
|
49
|
+
onSwitchBranch: (id: string) => void;
|
|
50
|
+
onCompareWithLive: () => void;
|
|
51
|
+
onCreateBranch?: (name: string) => Promise<void>;
|
|
43
52
|
}
|
|
44
|
-
export declare function P1EditorSubheader({ puckActions, docState, hasDrift, context, agents, humanActors, onStopAgent, onPublish, onReviewAndPublish, onCreateWorkstream, onDeleteDocument, hasPast, hasFuture, onUndo, onRedo, leftPanelVisible, rightPanelVisible, onToggleLeftPanel, onToggleRightPanel, }: P1EditorSubheaderProps): React.ReactElement;
|
|
53
|
+
export declare function P1EditorSubheader({ puckActions, docState, hasDrift, context, agents, humanActors, onStopAgent, onPublish, onReviewAndPublish, onReviewWorkstream, onCreateWorkstream, onDeleteDocument, hasPast, hasFuture, onUndo, onRedo, leftPanelVisible, rightPanelVisible, pluginRailVisible, onToggleLeftPanel, onToggleRightPanel, onTogglePluginRail, branches, currentBranch, onSwitchBranch, onCompareWithLive, onCreateBranch, }: P1EditorSubheaderProps): React.ReactElement;
|
|
45
54
|
//# sourceMappingURL=P1EditorSubheader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"P1EditorSubheader.d.ts","sourceRoot":"","sources":["../../../src/pds/components/P1EditorSubheader.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"P1EditorSubhe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AAE,MAAM,IAAI,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAEhC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAClD;AAED,wBAAgB,iBAAiB,CAAC,EAChC,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,MAAM,EACN,WAAW,EACX,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,OAAO,EACP,SAAS,EACT,MAAM,EACN,MAAM,EACN,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,QAAQ,EACR,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,cAAc,GACf,EAAE,sBAAsB,GAAG,KAAK,CAAC,YAAY,CA8I7C"}
|
|
@@ -3,9 +3,10 @@ import { IconButton } from '@pantheon-systems/pds-toolkit-react';
|
|
|
3
3
|
import { AgentChip } from './AgentChip.js';
|
|
4
4
|
import { PresenceStack } from './PresenceStack.js';
|
|
5
5
|
import { PublishControl } from './PublishControl.js';
|
|
6
|
+
import { WorkstreamSwitcher } from './WorkstreamSwitcher.js';
|
|
6
7
|
import styles from './P1EditorSubheader.module.css';
|
|
7
|
-
export function P1EditorSubheader({ puckActions, docState, hasDrift, context, agents, humanActors, onStopAgent, onPublish, onReviewAndPublish, onCreateWorkstream, onDeleteDocument, hasPast, hasFuture, onUndo, onRedo, leftPanelVisible, rightPanelVisible, onToggleLeftPanel, onToggleRightPanel, }) {
|
|
8
|
-
return (_jsxs("div", { "data-testid": "p1-editor-subheader", className: styles.subheader, children: [_jsxs("div", { "data-testid": "panel-toggles", className: styles.panelToggles, children: [_jsx(IconButton, { ariaLabel: "Toggle left panel", iconName: "tableRows", size: "s", hasTooltip: false, hasBorder: false, "aria-pressed": leftPanelVisible, onClick: onToggleLeftPanel }), _jsx(IconButton, { ariaLabel: "Toggle right panel", iconName: "
|
|
8
|
+
export function P1EditorSubheader({ puckActions, docState, hasDrift, context, agents, humanActors, onStopAgent, onPublish, onReviewAndPublish, onReviewWorkstream, onCreateWorkstream, onDeleteDocument, hasPast, hasFuture, onUndo, onRedo, leftPanelVisible, rightPanelVisible, pluginRailVisible, onToggleLeftPanel, onToggleRightPanel, onTogglePluginRail, branches, currentBranch, onSwitchBranch, onCompareWithLive, onCreateBranch, }) {
|
|
9
|
+
return (_jsxs("div", { "data-testid": "p1-editor-subheader", className: styles.subheader, children: [_jsxs("div", { "data-testid": "panel-toggles", className: styles.panelToggles, children: [_jsx(IconButton, { ariaLabel: "Toggle plugin rail", iconName: pluginRailVisible ? "angleRight" : "angleLeft", size: "s", hasTooltip: false, hasBorder: false, "aria-pressed": pluginRailVisible, onClick: onTogglePluginRail }), _jsx(IconButton, { ariaLabel: "Toggle left panel", iconName: "tableRows", size: "s", hasTooltip: false, hasBorder: false, "aria-pressed": leftPanelVisible, onClick: onToggleLeftPanel }), _jsx(IconButton, { ariaLabel: "Toggle right panel", iconName: "tableRows", size: "s", hasTooltip: false, hasBorder: false, "aria-pressed": rightPanelVisible, onClick: onToggleRightPanel, className: styles.rightPanelToggle })] }), puckActions, _jsxs("div", { "data-testid": "device-selector", className: styles.historyGroup, children: [_jsx(IconButton, { "data-testid": "undo-btn", ariaLabel: "Undo", iconName: "rotateLeft", size: "s", disabled: !hasPast, onClick: onUndo, hasTooltip: false, hasBorder: false }), _jsx(IconButton, { "data-testid": "redo-btn", ariaLabel: "Redo", iconName: "rotateRight", size: "s", disabled: !hasFuture, onClick: onRedo, hasTooltip: false, hasBorder: false })] }), _jsx("div", { className: styles.spacer }), _jsxs("div", { className: styles.actorsArea, children: [agents.map((actor) => (_jsx(AgentChip, { id: actor.id, agent: {
|
|
9
10
|
id: actor.id,
|
|
10
11
|
name: actor.name,
|
|
11
12
|
initials: actor.name[0] ?? '',
|
|
@@ -23,6 +24,6 @@ export function P1EditorSubheader({ puckActions, docState, hasDrift, context, ag
|
|
|
23
24
|
state: 'active',
|
|
24
25
|
lastActivityAt: new Date().toISOString(),
|
|
25
26
|
joinedAt: new Date().toISOString(),
|
|
26
|
-
})), maxVisible: 3 }))] }), _jsx("div", { className: styles.
|
|
27
|
+
})), maxVisible: 3 }))] }), _jsx(PublishControl, { docState: docState, hasDrift: hasDrift, context: context, onPublish: onPublish, onReviewAndPublish: onReviewAndPublish, onReviewWorkstream: onReviewWorkstream, onCreateWorkstream: onCreateWorkstream, onDeleteDocument: onDeleteDocument, renderBadgeOnly: true }), _jsxs("div", { className: styles.workstreamPublishGroup, children: [_jsx(WorkstreamSwitcher, { branches: branches, currentBranch: currentBranch, onSwitch: onSwitchBranch, onCompareWithLive: onCompareWithLive, hideCompareButton: true, onCreateBranch: onCreateBranch }), _jsx(PublishControl, { docState: docState, hasDrift: hasDrift, context: context, onPublish: onPublish, onReviewAndPublish: onReviewAndPublish, onReviewWorkstream: onReviewWorkstream, onCreateWorkstream: onCreateWorkstream, onDeleteDocument: onDeleteDocument, renderButtonOnly: true })] })] }));
|
|
27
28
|
}
|
|
28
29
|
//# sourceMappingURL=P1EditorSubheader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"P1EditorSubheader.js","sourceRoot":"","sources":["../../../src/pds/components/P1EditorSubheader.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"P1EditorSubheader.js","sourceRoot":"","sources":["../../../src/pds/components/P1EditorSubheader.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAGjE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,MAAM,MAAM,gCAAgC,CAAC;AA4CpD,MAAM,UAAU,iBAAiB,CAAC,EAChC,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,MAAM,EACN,WAAW,EACX,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,OAAO,EACP,SAAS,EACT,MAAM,EACN,MAAM,EACN,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,QAAQ,EACR,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,cAAc,GACS;IACvB,OAAO,CACL,8BAAiB,qBAAqB,EAAC,SAAS,EAAE,MAAM,CAAC,SAAS,aAEhE,8BAAiB,eAAe,EAAC,SAAS,EAAE,MAAM,CAAC,YAAY,aAC7D,KAAC,UAAU,IACT,SAAS,EAAC,oBAAoB,EAC9B,QAAQ,EAAE,iBAAiB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,EACxD,IAAI,EAAC,GAAG,EACR,UAAU,EAAE,KAAK,EACjB,SAAS,EAAE,KAAK,kBACF,iBAAiB,EAC/B,OAAO,EAAE,kBAAkB,GAC3B,EACF,KAAC,UAAU,IACT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,EAAE,cAAc,EACxB,iBAAiB,EAAE,iBAAiB,EACpC,iBAAiB,QACjB,cAAc,EAAE,cAAc,GAC9B,EAGF,KAAC,cAAc,IACb,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,kBAAkB,EACtC,kBAAkB,EAAE,kBAAkB,EACtC,kBAAkB,EAAE,kBAAkB,EACtC,gBAAgB,EAAE,gBAAgB,EAClC,gBAAgB,SAChB,IACE,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
.subheader {
|
|
4
4
|
height: 48px;
|
|
5
|
-
background: var(--pds-color-bg-default
|
|
6
|
-
border-
|
|
5
|
+
background: var(--pds-color-bg-default, oklch(1 0 0));
|
|
6
|
+
border-top: 1px solid oklch(0.96 0 0); /* borderSubtle */
|
|
7
|
+
border-bottom: 1px solid oklch(0.96 0 0); /* borderSubtle */
|
|
7
8
|
display: flex;
|
|
8
9
|
align-items: center;
|
|
9
10
|
padding: 0 var(--pds-spacing-m, 1rem);
|
|
@@ -67,6 +68,34 @@
|
|
|
67
68
|
display: none;
|
|
68
69
|
}
|
|
69
70
|
|
|
71
|
+
/* ── Right panel toggle rotation ─────────────────────────────────────── */
|
|
72
|
+
|
|
73
|
+
.rightPanelToggle :global(.pds-icon) {
|
|
74
|
+
transform: rotate(180deg);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* ── Workstream + Publish button group ────────────────────────────────── */
|
|
78
|
+
|
|
79
|
+
.workstreamPublishGroup {
|
|
80
|
+
display: inline-flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
flex-shrink: 0;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* Remove rounded corners and right border on workstream switcher when grouped */
|
|
86
|
+
.workstreamPublishGroup :global(.WorkstreamSwitcher-module__vbDGzq__trigger) {
|
|
87
|
+
border-top-right-radius: 0;
|
|
88
|
+
border-bottom-right-radius: 0;
|
|
89
|
+
border-right: none;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* Remove rounded corners on the left side of publish button when grouped */
|
|
93
|
+
.workstreamPublishGroup :global(.pds-split-button),
|
|
94
|
+
.workstreamPublishGroup :global(.pds-button) {
|
|
95
|
+
border-top-left-radius: 0;
|
|
96
|
+
border-bottom-left-radius: 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
70
99
|
/* ── Compact mobile layout (< 768px) ────────────────────────────────── */
|
|
71
100
|
|
|
72
101
|
@media (max-width: 767px) {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* flash where the portal appears at y=0 before being repositioned.
|
|
11
11
|
*/
|
|
12
12
|
import React from 'react';
|
|
13
|
+
import type { Template } from '../../features/content-type-templates/types.js';
|
|
13
14
|
export interface PageNavigatorDocument {
|
|
14
15
|
id: string;
|
|
15
16
|
path: string;
|
|
@@ -26,7 +27,11 @@ export interface PageNavigatorProps {
|
|
|
26
27
|
/** Whether the current branch is main/live. Inherited docs are dimmed when false. */
|
|
27
28
|
isMainBranch?: boolean;
|
|
28
29
|
/** Called when the user creates a new page. If omitted, the "+ New page" button has no effect. */
|
|
29
|
-
onCreateDocument?: (path: string) => Promise<void>;
|
|
30
|
+
onCreateDocument?: (path: string, template?: Template | null) => Promise<void>;
|
|
31
|
+
/** Available templates for document creation. When non-empty, a template selector step is shown. */
|
|
32
|
+
templates?: Template[];
|
|
33
|
+
/** Whether templates are still loading. */
|
|
34
|
+
templatesLoading?: boolean;
|
|
30
35
|
/**
|
|
31
36
|
* Pre-computed fixed positioning style. Caller must compute this
|
|
32
37
|
* synchronously (e.g. in the trigger's onClick) so it is available on the
|
|
@@ -34,5 +39,5 @@ export interface PageNavigatorProps {
|
|
|
34
39
|
*/
|
|
35
40
|
portalStyle?: React.CSSProperties;
|
|
36
41
|
}
|
|
37
|
-
export declare function PageNavigator({ documents, currentDocument, onSelect, onClose, open, isMainBranch, onCreateDocument, portalStyle, }: PageNavigatorProps): React.JSX.Element | null;
|
|
42
|
+
export declare function PageNavigator({ documents, currentDocument, onSelect, onClose, open, isMainBranch, onCreateDocument, templates, templatesLoading, portalStyle, }: PageNavigatorProps): React.JSX.Element | null;
|
|
38
43
|
//# sourceMappingURL=PageNavigator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageNavigator.d.ts","sourceRoot":"","sources":["../../../src/pds/components/PageNavigator.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAgC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PageNavigator.d.ts","sourceRoot":"","sources":["../../../src/pds/components/PageNavigator.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAgC,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAE/E,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,qBAAqB,EAAE,CAAC;IACnC,eAAe,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAC9C,QAAQ,EAAE,CAAC,GAAG,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAC/C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,qFAAqF;IACrF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kGAAkG;IAClG,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,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