@parhelia/core 0.1.12534 → 0.1.12554
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/agents-view/AgentCard.js +9 -9
- package/dist/agents-view/AgentCard.js.map +1 -1
- package/dist/agents-view/AgentsView.js +6 -6
- package/dist/agents-view/AgentsView.js.map +1 -1
- package/dist/config/config.d.ts +2 -0
- package/dist/config/config.js +35 -0
- package/dist/config/config.js.map +1 -1
- package/dist/config/types.d.ts +5 -0
- package/dist/config/types.js.map +1 -1
- package/dist/editor/Editor.js +17 -6
- package/dist/editor/Editor.js.map +1 -1
- package/dist/editor/ImageEditor.js +5 -2
- package/dist/editor/ImageEditor.js.map +1 -1
- package/dist/editor/ItemInfo.js +1 -1
- package/dist/editor/ItemInfo.js.map +1 -1
- package/dist/editor/MainLayout.js +61 -3
- package/dist/editor/MainLayout.js.map +1 -1
- package/dist/editor/PictureEditor.js +5 -2
- package/dist/editor/PictureEditor.js.map +1 -1
- package/dist/editor/ai/AgentTerminal.js +30 -4
- package/dist/editor/ai/AgentTerminal.js.map +1 -1
- package/dist/editor/ai/Agents.js +59 -12
- package/dist/editor/ai/Agents.js.map +1 -1
- package/dist/editor/ai/useAgentStatus.d.ts +1 -1
- package/dist/editor/ai/useAgentStatus.js +8 -4
- package/dist/editor/ai/useAgentStatus.js.map +1 -1
- package/dist/editor/client/EditorShell.d.ts +4 -1
- package/dist/editor/client/EditorShell.js +155 -24
- package/dist/editor/client/EditorShell.js.map +1 -1
- package/dist/editor/client/editContext.d.ts +5 -0
- package/dist/editor/client/editContext.js.map +1 -1
- package/dist/editor/client/navigation.d.ts +21 -0
- package/dist/editor/client/navigation.js +98 -0
- package/dist/editor/client/navigation.js.map +1 -0
- package/dist/editor/client/ui/DevModeIndicator.js +2 -2
- package/dist/editor/client/ui/DevModeIndicator.js.map +1 -1
- package/dist/editor/commands/handlers/uiActionHandlers.js +3 -4
- package/dist/editor/commands/handlers/uiActionHandlers.js.map +1 -1
- package/dist/editor/field-types/RichTextEditor.js +10 -4
- package/dist/editor/field-types/RichTextEditor.js.map +1 -1
- package/dist/editor/field-types/richtext/contextMenuFactory.js +5 -3
- package/dist/editor/field-types/richtext/contextMenuFactory.js.map +1 -1
- package/dist/editor/field-types/textContextMenuFactory.js +3 -2
- package/dist/editor/field-types/textContextMenuFactory.js.map +1 -1
- package/dist/editor/media-selector/AiImageSearchPrompt.js +4 -2
- package/dist/editor/media-selector/AiImageSearchPrompt.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/CustomCommandsToolbar.js +9 -2
- package/dist/editor/menubar/toolbar-sections/CustomCommandsToolbar.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/ManualBrowser.js +101 -5
- package/dist/editor/menubar/toolbar-sections/ManualBrowser.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/UtilityControls.js +4 -2
- package/dist/editor/menubar/toolbar-sections/UtilityControls.js.map +1 -1
- package/dist/editor/page-editor-chrome/useInlineAICompletion.js +19 -4
- package/dist/editor/page-editor-chrome/useInlineAICompletion.js.map +1 -1
- package/dist/editor/page-viewer/DeviceToolbar.js +1 -1
- package/dist/editor/page-viewer/DeviceToolbar.js.map +1 -1
- package/dist/editor/page-viewer/PageViewerFrame.js +56 -6
- package/dist/editor/page-viewer/PageViewerFrame.js.map +1 -1
- package/dist/editor/page-viewer/RenderingParametersSection.js +3 -2
- package/dist/editor/page-viewer/RenderingParametersSection.js.map +1 -1
- package/dist/editor/reviews/Comment.js +3 -1
- package/dist/editor/reviews/Comment.js.map +1 -1
- package/dist/editor/reviews/CommentDisplayPopover.js +3 -1
- package/dist/editor/reviews/CommentDisplayPopover.js.map +1 -1
- package/dist/editor/reviews/commentAi.js +4 -0
- package/dist/editor/reviews/commentAi.js.map +1 -1
- package/dist/editor/services/editService.d.ts +2 -0
- package/dist/editor/services/editService.js +3 -0
- package/dist/editor/services/editService.js.map +1 -1
- package/dist/editor/services-server/api.d.ts +1 -2
- package/dist/editor/services-server/api.js +11 -6
- package/dist/editor/services-server/api.js.map +1 -1
- package/dist/editor/settings/About.js +1 -1
- package/dist/editor/settings/About.js.map +1 -1
- package/dist/editor/settings/SettingsView.js +2 -2
- package/dist/editor/settings/SettingsView.js.map +1 -1
- package/dist/editor/settings/Status.js +2 -2
- package/dist/editor/settings/Status.js.map +1 -1
- package/dist/editor/settings/panels/AgentsPanel.js +1 -1
- package/dist/editor/settings/panels/AgentsPanel.js.map +1 -1
- package/dist/editor/settings/panels/ModelsPanel.js +1 -1
- package/dist/editor/settings/panels/ModelsPanel.js.map +1 -1
- package/dist/editor/settings/panels/ProjectTemplatesPanel.js +1 -1
- package/dist/editor/settings/panels/ProjectTemplatesPanel.js.map +1 -1
- package/dist/editor/settings/panels/ProvidersPanel.js +1 -1
- package/dist/editor/settings/panels/ProvidersPanel.js.map +1 -1
- package/dist/editor/sidebar/EditHistory.js +17 -2
- package/dist/editor/sidebar/EditHistory.js.map +1 -1
- package/dist/editor/sidebar/NavigationPanelItem.js +1 -1
- package/dist/editor/sidebar/NavigationPanelItem.js.map +1 -1
- package/dist/editor/sidebar/OperationItem.js +1 -1
- package/dist/editor/sidebar/OperationItem.js.map +1 -1
- package/dist/editor/sidebar/SidebarPanel.d.ts +3 -1
- package/dist/editor/sidebar/SidebarPanel.js +15 -6
- package/dist/editor/sidebar/SidebarPanel.js.map +1 -1
- package/dist/editor/sidebar/SidebarStack.d.ts +2 -1
- package/dist/editor/sidebar/SidebarStack.js +3 -3
- package/dist/editor/sidebar/SidebarStack.js.map +1 -1
- package/dist/editor/template-wizard/TemplateStructureInlineEditor.js +10 -3
- package/dist/editor/template-wizard/TemplateStructureInlineEditor.js.map +1 -1
- package/dist/editor/utils/keyboardNavigation.js +1 -2
- package/dist/editor/utils/keyboardNavigation.js.map +1 -1
- package/dist/editor/views/CompareView.js +1 -1
- package/dist/editor/views/CompareView.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/licensing/LicenseContext.d.ts +3 -1
- package/dist/licensing/LicenseContext.js +55 -38
- package/dist/licensing/LicenseContext.js.map +1 -1
- package/dist/revision.d.ts +2 -2
- package/dist/revision.js +2 -2
- package/dist/splash-screen/ModernSplashScreen.js +4 -2
- package/dist/splash-screen/ModernSplashScreen.js.map +1 -1
- package/dist/task-board/TaskBoardWorkspace.js +34 -6
- package/dist/task-board/TaskBoardWorkspace.js.map +1 -1
- package/dist/task-board/components/AssignAgentDialog.js +13 -1
- package/dist/task-board/components/AssignAgentDialog.js.map +1 -1
- package/dist/task-board/components/TaskAgentPanel.js +11 -1
- package/dist/task-board/components/TaskAgentPanel.js.map +1 -1
- package/dist/task-board/components/TaskAssigneePicker.js +14 -4
- package/dist/task-board/components/TaskAssigneePicker.js.map +1 -1
- package/dist/task-board/components/WizardCommunicationCenter.js +18 -9
- package/dist/task-board/components/WizardCommunicationCenter.js.map +1 -1
- package/package.json +4 -4
|
@@ -4,7 +4,7 @@ import React, { useState, useEffect, useRef, useCallback, useSyncExternalStore,
|
|
|
4
4
|
import { toast } from "sonner";
|
|
5
5
|
import { EditContextProvider, FieldsEditContextProvider, OperationsContextProvider, useEditContext, } from "./editContext";
|
|
6
6
|
import { fieldModificationStore } from "./fieldModificationStore";
|
|
7
|
-
import { useRouter, useSearchParams, usePathname } from "
|
|
7
|
+
import { useRouter, useSearchParams, usePathname } from "./navigation";
|
|
8
8
|
import { findComponent, getComponentById } from "../componentTreeHelper";
|
|
9
9
|
import { getOperationsContext } from "./operations";
|
|
10
10
|
import { handleErrorResult } from "./helpers";
|
|
@@ -53,7 +53,7 @@ import { useWorkbox } from "./hooks/useWorkbox";
|
|
|
53
53
|
import { useMediaSelector } from "./hooks/useMediaSelector";
|
|
54
54
|
import { useGlobalEditorKeyDown } from "./hooks/useGlobalEditorKeyDown";
|
|
55
55
|
import { useStartupChecks } from "../settings/status/index";
|
|
56
|
-
import { LicenseProvider, LicenseOverlay } from "../../licensing";
|
|
56
|
+
import { FeatureGate, LicenseFeatures, LicenseProvider, LicenseOverlay, } from "../../licensing";
|
|
57
57
|
function AgentsSlotContextBridge({ slot }) {
|
|
58
58
|
const editContext = useEditContext();
|
|
59
59
|
const slotContext = useEditorSlotContext({
|
|
@@ -79,7 +79,7 @@ function AgentsSlotContextBridge({ slot }) {
|
|
|
79
79
|
function AgentsSlotContextBridgeHost({ slots }) {
|
|
80
80
|
return (_jsx(_Fragment, { children: slots.map((slot) => (_jsx(AgentsSlotContextBridge, { slot: slot }, `agents-slot-bridge-${slot.slotId}`))) }));
|
|
81
81
|
}
|
|
82
|
-
export function EditorShell({ configuration, className, item: loadItemDescriptor, sessionId, userInfo, userPreferences, parheliaSettings, setUserPreferences, children, }) {
|
|
82
|
+
export function EditorShell({ configuration, className, item: loadItemDescriptor, sessionId, userInfo, userPreferences, initialLicenseStatus, initialLicenseStatusLoaded, parheliaSettings, setUserPreferences, children, }) {
|
|
83
83
|
const router = useRouter();
|
|
84
84
|
const pathname = usePathname();
|
|
85
85
|
const searchParams = useSearchParams();
|
|
@@ -127,6 +127,7 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
127
127
|
const [historyMode, setHistoryMode] = useState("global");
|
|
128
128
|
const [showOnlyMyChanges, setShowOnlyMyChanges] = useState(true);
|
|
129
129
|
const [filterByCurrentLanguage, setFilterByCurrentLanguage] = useState(true);
|
|
130
|
+
const [historySearchQuery, setHistorySearchQuery] = useState("");
|
|
130
131
|
const [recentEdits, setRecentEdits] = useState([]);
|
|
131
132
|
const addRecentEdit = useCallback((edit) => {
|
|
132
133
|
setRecentEdits((prevEditedFields) => {
|
|
@@ -1552,6 +1553,8 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
1552
1553
|
const shouldFilterByLanguage = filterByLanguage !== undefined
|
|
1553
1554
|
? filterByLanguage
|
|
1554
1555
|
: filterByCurrentLanguage;
|
|
1556
|
+
const trimmedHistoryQuery = historySearchQuery.trim();
|
|
1557
|
+
const historyQuery = trimmedHistoryQuery.length > 0 ? trimmedHistoryQuery : undefined;
|
|
1555
1558
|
if (currentMode === "global") {
|
|
1556
1559
|
// Global mode: optionally filter by session and/or language
|
|
1557
1560
|
const currentLanguage = item?.descriptor?.language || currentItemDescriptor?.language;
|
|
@@ -1561,6 +1564,7 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
1561
1564
|
language: shouldFilterByLanguage && currentLanguage
|
|
1562
1565
|
? currentLanguage
|
|
1563
1566
|
: undefined,
|
|
1567
|
+
query: historyQuery,
|
|
1564
1568
|
});
|
|
1565
1569
|
if (handleErrorResult(result, ui, state)) {
|
|
1566
1570
|
console.error("[EditorShell] Failed to load history:", result);
|
|
@@ -1578,8 +1582,12 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
1578
1582
|
};
|
|
1579
1583
|
if (!prev.length)
|
|
1580
1584
|
return sortEditHistoryByDateDesc(next.filter((op) => matchesHistoryScope(op, scope)));
|
|
1581
|
-
if (!next.length)
|
|
1585
|
+
if (!next.length) {
|
|
1586
|
+
// When searching, respect the empty result — don't fall back to previous items
|
|
1587
|
+
if (historyQuery)
|
|
1588
|
+
return [];
|
|
1582
1589
|
return sortEditHistoryByDateDesc(prev.filter((op) => matchesHistoryScope(op, scope)));
|
|
1590
|
+
}
|
|
1583
1591
|
const prevById = new Map(prev.map((x) => [x.id, x]));
|
|
1584
1592
|
const nextById = new Set(next.map((x) => x.id));
|
|
1585
1593
|
const merged = next
|
|
@@ -1615,9 +1623,12 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
1615
1623
|
return mergedOp;
|
|
1616
1624
|
});
|
|
1617
1625
|
// Preserve operations that arrived via WebSocket during the fetch window
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1626
|
+
// but not when filtering by search query — search results are authoritative
|
|
1627
|
+
if (!historyQuery) {
|
|
1628
|
+
for (const [id, priorOp] of prevById) {
|
|
1629
|
+
if (!nextById.has(id) && matchesHistoryScope(priorOp, scope)) {
|
|
1630
|
+
merged.push(priorOp);
|
|
1631
|
+
}
|
|
1621
1632
|
}
|
|
1622
1633
|
}
|
|
1623
1634
|
return sortEditHistoryByDateDesc(merged);
|
|
@@ -1640,6 +1651,7 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
1640
1651
|
const result = await getEditHistory({
|
|
1641
1652
|
item: itemFilter,
|
|
1642
1653
|
sessionId: shouldFilterBySession ? sessionId : undefined,
|
|
1654
|
+
query: historyQuery,
|
|
1643
1655
|
});
|
|
1644
1656
|
if (handleErrorResult(result, ui, state)) {
|
|
1645
1657
|
console.error("[EditorShell] Failed to load item history:", result);
|
|
@@ -1668,8 +1680,11 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
1668
1680
|
};
|
|
1669
1681
|
if (!prev.length)
|
|
1670
1682
|
return sortEditHistoryByDateDesc(operations.filter((op) => matchesHistoryScope(op, scope)));
|
|
1671
|
-
if (!operations.length)
|
|
1683
|
+
if (!operations.length) {
|
|
1684
|
+
if (historyQuery)
|
|
1685
|
+
return [];
|
|
1672
1686
|
return sortEditHistoryByDateDesc(prev.filter((op) => matchesHistoryScope(op, scope)));
|
|
1687
|
+
}
|
|
1673
1688
|
const prevById = new Map(prev.map((x) => [x.id, x]));
|
|
1674
1689
|
const nextById = new Set(operations.map((x) => x.id));
|
|
1675
1690
|
const merged = operations
|
|
@@ -1705,9 +1720,12 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
1705
1720
|
return mergedOp;
|
|
1706
1721
|
});
|
|
1707
1722
|
// Preserve operations that arrived via WebSocket during the fetch window
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1723
|
+
// but not when filtering by search query — search results are authoritative
|
|
1724
|
+
if (!historyQuery) {
|
|
1725
|
+
for (const [id, priorOp] of prevById) {
|
|
1726
|
+
if (!nextById.has(id) && matchesHistoryScope(priorOp, scope)) {
|
|
1727
|
+
merged.push(priorOp);
|
|
1728
|
+
}
|
|
1711
1729
|
}
|
|
1712
1730
|
}
|
|
1713
1731
|
return sortEditHistoryByDateDesc(merged);
|
|
@@ -1718,6 +1736,7 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
1718
1736
|
historyMode,
|
|
1719
1737
|
showOnlyMyChanges,
|
|
1720
1738
|
filterByCurrentLanguage,
|
|
1739
|
+
historySearchQuery,
|
|
1721
1740
|
item,
|
|
1722
1741
|
currentItemDescriptor,
|
|
1723
1742
|
matchesHistoryScope,
|
|
@@ -1807,6 +1826,7 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
1807
1826
|
historyMode,
|
|
1808
1827
|
showOnlyMyChanges,
|
|
1809
1828
|
filterByCurrentLanguage,
|
|
1829
|
+
historySearchQuery,
|
|
1810
1830
|
currentItemDescriptor?.id,
|
|
1811
1831
|
currentItemDescriptor?.language,
|
|
1812
1832
|
currentItemDescriptor?.version,
|
|
@@ -1871,6 +1891,9 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
1871
1891
|
if (isInitialLoad)
|
|
1872
1892
|
return;
|
|
1873
1893
|
const current = new URLSearchParams(window.location.search);
|
|
1894
|
+
const urlWorkspace = current.get("workspace");
|
|
1895
|
+
const urlView = current.get("view");
|
|
1896
|
+
const isWorkspaceTransitioning = !!urlWorkspace && urlWorkspace !== viewName;
|
|
1874
1897
|
// Sync item-related parameters only when an item is selected
|
|
1875
1898
|
if (currentItemDescriptor) {
|
|
1876
1899
|
if (current.get("itemid") !== currentItemDescriptor.id) {
|
|
@@ -1901,7 +1924,7 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
1901
1924
|
// If reviewId or urlItemId exists, preserve itemid/lang/version from URL
|
|
1902
1925
|
}
|
|
1903
1926
|
// Always sync workspace-related parameters regardless of item selection
|
|
1904
|
-
if (current.get("workspace") !== viewName) {
|
|
1927
|
+
if (!isWorkspaceTransitioning && current.get("workspace") !== viewName) {
|
|
1905
1928
|
current.set("workspace", viewName);
|
|
1906
1929
|
}
|
|
1907
1930
|
// Sync sidebar state
|
|
@@ -1945,8 +1968,12 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
1945
1968
|
else {
|
|
1946
1969
|
current.delete("wizardid");
|
|
1947
1970
|
}
|
|
1948
|
-
//
|
|
1949
|
-
|
|
1971
|
+
// Preserve settings-specific parameters while transitioning into Settings too.
|
|
1972
|
+
// Some callers update the URL first and switch the workspace state a moment later.
|
|
1973
|
+
const isSettingsNavigation = viewName === "settings" ||
|
|
1974
|
+
urlWorkspace === "settings" ||
|
|
1975
|
+
urlView === "settings";
|
|
1976
|
+
if (!isSettingsNavigation) {
|
|
1950
1977
|
current.delete("ccpanel");
|
|
1951
1978
|
current.delete("providerId");
|
|
1952
1979
|
current.delete("modelId");
|
|
@@ -2609,7 +2636,10 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
2609
2636
|
// Mark that we're pushing from switchWorkspace so the URL sync effect
|
|
2610
2637
|
// will replaceState instead of pushing a second history entry.
|
|
2611
2638
|
switchWorkspacePushedRef.current = true;
|
|
2612
|
-
updateUrl({
|
|
2639
|
+
updateUrl({
|
|
2640
|
+
workspace: targetWorkspaceId,
|
|
2641
|
+
...options?.urlParams,
|
|
2642
|
+
});
|
|
2613
2643
|
if (typeof document.startViewTransition === "function") {
|
|
2614
2644
|
document.startViewTransition(() => {
|
|
2615
2645
|
flushSync(() => {
|
|
@@ -2795,6 +2825,38 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
2795
2825
|
return normalizeSidebarStacks(openIds, next);
|
|
2796
2826
|
});
|
|
2797
2827
|
}, [normalizeSidebarStacks]);
|
|
2828
|
+
const moveSidebarToColumn = useCallback((sidebarId, targetSidebarId, position = "after") => {
|
|
2829
|
+
if (!sidebarId || !targetSidebarId || sidebarId === targetSidebarId) {
|
|
2830
|
+
return;
|
|
2831
|
+
}
|
|
2832
|
+
const currentOpen = openSidebarsRef.current;
|
|
2833
|
+
const baseOpen = currentOpen.filter((id) => id !== sidebarId);
|
|
2834
|
+
const targetIndex = baseOpen.indexOf(targetSidebarId);
|
|
2835
|
+
if (targetIndex === -1) {
|
|
2836
|
+
return;
|
|
2837
|
+
}
|
|
2838
|
+
const insertIndex = position === "before" ? targetIndex : targetIndex + 1;
|
|
2839
|
+
const nextOpen = [...baseOpen];
|
|
2840
|
+
nextOpen.splice(insertIndex, 0, sidebarId);
|
|
2841
|
+
openSidebarsRef.current = nextOpen;
|
|
2842
|
+
setOpenSidebars(nextOpen);
|
|
2843
|
+
startTransition(() => {
|
|
2844
|
+
updateUrl({ sidebar: nextOpen.join(",") || undefined });
|
|
2845
|
+
});
|
|
2846
|
+
setSidebarStacks((prev) => {
|
|
2847
|
+
const normalized = normalizeSidebarStacks(nextOpen, prev);
|
|
2848
|
+
const next = normalized
|
|
2849
|
+
.map((stack) => stack.filter((id) => id !== sidebarId))
|
|
2850
|
+
.filter((stack) => stack.length > 0);
|
|
2851
|
+
const targetStackIndex = next.findIndex((stack) => stack.includes(targetSidebarId));
|
|
2852
|
+
if (targetStackIndex === -1) {
|
|
2853
|
+
next.push([sidebarId]);
|
|
2854
|
+
return normalizeSidebarStacks(nextOpen, next);
|
|
2855
|
+
}
|
|
2856
|
+
next.splice(position === "before" ? targetStackIndex : targetStackIndex + 1, 0, [sidebarId]);
|
|
2857
|
+
return normalizeSidebarStacks(nextOpen, next);
|
|
2858
|
+
});
|
|
2859
|
+
}, [normalizeSidebarStacks, updateUrl]);
|
|
2798
2860
|
const unstackSidebar = useCallback((sidebarId) => {
|
|
2799
2861
|
setSidebarStacks((prev) => {
|
|
2800
2862
|
const openIds = openSidebarsRef.current;
|
|
@@ -3123,9 +3185,45 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
3123
3185
|
}
|
|
3124
3186
|
return true;
|
|
3125
3187
|
}, [operations, ignoreBlur, sessionId]);
|
|
3188
|
+
const quickSwitcherEntries = useMemo(() => {
|
|
3189
|
+
const entries = [];
|
|
3190
|
+
const seen = new Set();
|
|
3191
|
+
const pushEntry = (entry) => {
|
|
3192
|
+
const key = entry.item
|
|
3193
|
+
? `${entry.workspaceId}:${entry.item.id}:${entry.item.language}:${entry.item.version}`
|
|
3194
|
+
: `${entry.workspaceId}:no-item`;
|
|
3195
|
+
if (seen.has(key))
|
|
3196
|
+
return;
|
|
3197
|
+
seen.add(key);
|
|
3198
|
+
entries.push(entry);
|
|
3199
|
+
};
|
|
3200
|
+
for (const entry of navigationHistory) {
|
|
3201
|
+
pushEntry(entry);
|
|
3202
|
+
}
|
|
3203
|
+
for (const entry of browseHistory) {
|
|
3204
|
+
if (!entry.id || !entry.language)
|
|
3205
|
+
continue;
|
|
3206
|
+
pushEntry({
|
|
3207
|
+
workspaceId,
|
|
3208
|
+
item: {
|
|
3209
|
+
id: entry.id,
|
|
3210
|
+
language: entry.language,
|
|
3211
|
+
version: entry.version ?? 0,
|
|
3212
|
+
},
|
|
3213
|
+
timestamp: entry.visitedAt
|
|
3214
|
+
? new Date(entry.visitedAt).getTime()
|
|
3215
|
+
: Date.now(),
|
|
3216
|
+
displayName: entry.name || workspaceId,
|
|
3217
|
+
itemName: entry.name,
|
|
3218
|
+
itemPath: entry.path,
|
|
3219
|
+
itemIcon: entry.icon,
|
|
3220
|
+
});
|
|
3221
|
+
}
|
|
3222
|
+
return entries.slice(0, 25);
|
|
3223
|
+
}, [navigationHistory, browseHistory, workspaceId]);
|
|
3126
3224
|
// Quick switcher handlers
|
|
3127
3225
|
const showQuickSwitcher = useCallback((show) => {
|
|
3128
|
-
if (show &&
|
|
3226
|
+
if (show && quickSwitcherEntries.length > 1) {
|
|
3129
3227
|
setQuickSwitcherVisible(true);
|
|
3130
3228
|
// Start with index 1 (second entry - previous entry) for quick switching
|
|
3131
3229
|
setQuickSwitcherSelectedIndex(1);
|
|
@@ -3133,11 +3231,11 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
3133
3231
|
else {
|
|
3134
3232
|
setQuickSwitcherVisible(false);
|
|
3135
3233
|
}
|
|
3136
|
-
}, [
|
|
3234
|
+
}, [quickSwitcherEntries]);
|
|
3137
3235
|
const cycleQuickSwitcher = useCallback((direction) => {
|
|
3138
3236
|
if (!quickSwitcherVisible)
|
|
3139
3237
|
return;
|
|
3140
|
-
const maxItems = Math.min(5,
|
|
3238
|
+
const maxItems = Math.min(5, quickSwitcherEntries.length);
|
|
3141
3239
|
setQuickSwitcherSelectedIndex((current) => {
|
|
3142
3240
|
let newIndex = current;
|
|
3143
3241
|
// Determine grid layout (responsive columns)
|
|
@@ -3182,9 +3280,9 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
3182
3280
|
}
|
|
3183
3281
|
return newIndex;
|
|
3184
3282
|
});
|
|
3185
|
-
}, [quickSwitcherVisible,
|
|
3283
|
+
}, [quickSwitcherVisible, quickSwitcherEntries]);
|
|
3186
3284
|
const handleQuickSwitcherSelect = useCallback((index) => {
|
|
3187
|
-
const selectedEntry =
|
|
3285
|
+
const selectedEntry = quickSwitcherEntries[index];
|
|
3188
3286
|
if (selectedEntry) {
|
|
3189
3287
|
// Determine target workspace: entries with items should go to "editor" workspace
|
|
3190
3288
|
// (fixes issue where browse history entries initialized with wrong workspaceId)
|
|
@@ -3236,13 +3334,43 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
3236
3334
|
}
|
|
3237
3335
|
setQuickSwitcherVisible(false);
|
|
3238
3336
|
}, [
|
|
3239
|
-
|
|
3337
|
+
quickSwitcherEntries,
|
|
3240
3338
|
loadItem,
|
|
3241
3339
|
switchWorkspace,
|
|
3242
3340
|
workspaceId,
|
|
3243
3341
|
item,
|
|
3244
3342
|
setNavigationHistory,
|
|
3245
3343
|
]);
|
|
3344
|
+
useEffect(() => {
|
|
3345
|
+
if (typeof window === "undefined" ||
|
|
3346
|
+
process.env.PARHELIA_DEV_MODE !== "true") {
|
|
3347
|
+
return;
|
|
3348
|
+
}
|
|
3349
|
+
window.__parheliaQuickSwitcherTestApi = {
|
|
3350
|
+
open: () => showQuickSwitcher(true),
|
|
3351
|
+
cycle: (direction = "next") => cycleQuickSwitcher(direction),
|
|
3352
|
+
closeWithoutSelection: () => setQuickSwitcherVisible(false),
|
|
3353
|
+
selectCurrent: () => handleQuickSwitcherSelect(quickSwitcherSelectedIndex),
|
|
3354
|
+
getState: () => ({
|
|
3355
|
+
visible: quickSwitcherVisible,
|
|
3356
|
+
selectedIndex: quickSwitcherSelectedIndex,
|
|
3357
|
+
entryCount: quickSwitcherEntries.length,
|
|
3358
|
+
entries: quickSwitcherEntries.map((entry) => ({
|
|
3359
|
+
workspaceId: entry.workspaceId,
|
|
3360
|
+
itemId: entry.item?.id,
|
|
3361
|
+
displayName: entry.displayName,
|
|
3362
|
+
})),
|
|
3363
|
+
}),
|
|
3364
|
+
};
|
|
3365
|
+
return () => {
|
|
3366
|
+
delete window.__parheliaQuickSwitcherTestApi;
|
|
3367
|
+
};
|
|
3368
|
+
}, [
|
|
3369
|
+
showQuickSwitcher,
|
|
3370
|
+
cycleQuickSwitcher,
|
|
3371
|
+
handleQuickSwitcherSelect,
|
|
3372
|
+
quickSwitcherSelectedIndex,
|
|
3373
|
+
]);
|
|
3246
3374
|
const { handleKeyDown } = useKeyboardNavigation({
|
|
3247
3375
|
editContextRef,
|
|
3248
3376
|
keyboardCommands: activeKeyboardCommands,
|
|
@@ -3833,6 +3961,8 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
3833
3961
|
setShowOnlyMyChanges,
|
|
3834
3962
|
filterByCurrentLanguage,
|
|
3835
3963
|
setFilterByCurrentLanguage,
|
|
3964
|
+
historySearchQuery,
|
|
3965
|
+
setHistorySearchQuery,
|
|
3836
3966
|
refreshHistory,
|
|
3837
3967
|
isRefreshing,
|
|
3838
3968
|
activeSessions,
|
|
@@ -3881,6 +4011,7 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
3881
4011
|
toggleSidebarPin,
|
|
3882
4012
|
toggleSidebarLock,
|
|
3883
4013
|
stackSidebar,
|
|
4014
|
+
moveSidebarToColumn,
|
|
3884
4015
|
unstackSidebar,
|
|
3885
4016
|
reorderSidebarInStack,
|
|
3886
4017
|
reorderPinnedSidebars,
|
|
@@ -4483,13 +4614,13 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
4483
4614
|
? `${window.location.pathname}?${queryString}`
|
|
4484
4615
|
: window.location.pathname;
|
|
4485
4616
|
window.history.replaceState(null, "", newUrl);
|
|
4486
|
-
}, configuration: configuration, restoredFromUrl: tourRestoredRef.current })), _jsx(GuidanceOverlay, {}), _jsx(AgentDialogHandler, {})] }));
|
|
4487
|
-
return (_jsx(LicenseProvider, { children: _jsx("div", { className: `editor h-full w-full`, children: _jsx(OperationsContextProvider, { value: operationsContext.context, children: _jsx(FieldsEditContextProvider, { value: fieldsEditContext, children: _jsxs(EditContextProvider, { value: editContext, children: [_jsx(DevModeIndicator, {}), startupChecks.state === "loading" && (_jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-white/70 backdrop-blur-[1px]", children: _jsx("div", { className: "flex items-center gap-3 rounded-md border border-gray-200 bg-white px-4 py-3 text-gray-700 shadow-sm", children: _jsx(Spinner, { size: "xl" }) }) })), editContext.isRefreshing && (_jsx("div", { className: "pointer-events-none fixed right-0 bottom-0 flex h-24 w-24 items-center justify-center text-gray-600 opacity-50 select-none", children: _jsx(Spinner, {}) })), (currentWorkspace.id === "agents" ||
|
|
4617
|
+
}, configuration: configuration, restoredFromUrl: tourRestoredRef.current })), _jsx(FeatureGate, { feature: LicenseFeatures.AI, children: _jsx(GuidanceOverlay, {}) }), _jsx(FeatureGate, { feature: LicenseFeatures.AI, children: _jsx(AgentDialogHandler, {}) })] }));
|
|
4618
|
+
return (_jsx(LicenseProvider, { initialLicenseStatus: initialLicenseStatus, initialStatusLoaded: initialLicenseStatusLoaded, children: _jsx("div", { className: `editor h-full w-full`, children: _jsx(OperationsContextProvider, { value: operationsContext.context, children: _jsx(FieldsEditContextProvider, { value: fieldsEditContext, children: _jsxs(EditContextProvider, { value: editContext, children: [_jsx(DevModeIndicator, {}), startupChecks.state === "loading" && (_jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-white/70 backdrop-blur-[1px]", children: _jsx("div", { className: "flex items-center gap-3 rounded-md border border-gray-200 bg-white px-4 py-3 text-gray-700 shadow-sm", children: _jsx(Spinner, { size: "xl" }) }) })), editContext.isRefreshing && (_jsx("div", { className: "pointer-events-none fixed right-0 bottom-0 flex h-24 w-24 items-center justify-center text-gray-600 opacity-50 select-none", children: _jsx(Spinner, {}) })), (currentWorkspace.id === "agents" ||
|
|
4488
4619
|
currentWorkspace.id === "taskboard") &&
|
|
4489
4620
|
showAgentsWorkspaceEditor && (_jsx(AgentsSlotContextBridgeHost, { slots: editorSlots })), startupChecks.state !== "loading" && (children || editorUi), startupChecks.state !== "loading" && dialog, _jsx(Toaster, { position: "top-center" }), " ", _jsx(ConfirmationDialog, { ref: confirmationDialogRef }), _jsx(ConcurrentUserLimitDialog, { open: concurrentUserLimitError !== null, onOpenChange: (open) => {
|
|
4490
4621
|
if (!open) {
|
|
4491
4622
|
setConcurrentUserLimitError(null);
|
|
4492
4623
|
}
|
|
4493
|
-
}, sessionId: sessionId, currentUsers: concurrentUserLimitError?.currentUsers ?? 0, maxUsers: concurrentUserLimitError?.maxUsers ?? 0, message: concurrentUserLimitError?.message ?? "", onRetry: handleRetryConnection, isAdministrator: userInfo.user.isAdministrator === true }), _jsx(QuickItemSwitcher, { visible: quickSwitcherVisible, entries:
|
|
4624
|
+
}, sessionId: sessionId, currentUsers: concurrentUserLimitError?.currentUsers ?? 0, maxUsers: concurrentUserLimitError?.maxUsers ?? 0, message: concurrentUserLimitError?.message ?? "", onRetry: handleRetryConnection, isAdministrator: userInfo.user.isAdministrator === true }), _jsx(QuickItemSwitcher, { visible: quickSwitcherVisible, entries: quickSwitcherEntries.slice(0, 5), selectedIndex: quickSwitcherSelectedIndex, onSelect: handleQuickSwitcherSelect, onClose: () => setQuickSwitcherVisible(false) }), _jsx(EditContextMenu, { ref: contextMenuRef }), _jsx(FeatureGate, { feature: LicenseFeatures.AI, children: _jsx(InlineAiTrigger, {}) }), media.mediaSelectorVisible && (_jsx(MediaSelector, { language: editContext.currentItemDescriptor.language, visible: media.mediaSelectorVisible, onHide: media.handleHide, onMediaSelected: media.onMediaSelect, selectedIdPath: media.selectedMediaIdPath, mode: media.mediaSelectorMode, initialSearchTerm: media.initialSearchTerm })), _jsx(FieldEditorPopup, { ref: fieldEditorPopupRef }), _jsx(LicenseOverlay, {})] }) }) }) }) }));
|
|
4494
4625
|
}
|
|
4495
4626
|
//# sourceMappingURL=EditorShell.js.map
|