@parhelia/core 0.1.12565 → 0.1.12572
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/editor/ai/AgentTerminal.js +18 -0
- package/dist/editor/ai/AgentTerminal.js.map +1 -1
- package/dist/editor/ai/ToolCallDisplay.js +134 -111
- package/dist/editor/ai/ToolCallDisplay.js.map +1 -1
- package/dist/editor/client/EditorShell.js +74 -23
- package/dist/editor/client/EditorShell.js.map +1 -1
- package/dist/editor/services/agentService.d.ts +11 -0
- package/dist/editor/services/agentService.js +7 -0
- package/dist/editor/services/agentService.js.map +1 -1
- package/dist/editor/settings/IndexOverview.js +3 -1
- package/dist/editor/settings/IndexOverview.js.map +1 -1
- package/dist/editor/settings/index/CollectionWarningsDisplay.d.ts +10 -0
- package/dist/editor/settings/index/CollectionWarningsDisplay.js +16 -0
- package/dist/editor/settings/index/CollectionWarningsDisplay.js.map +1 -0
- package/dist/editor/settings/index/useIndexStatus.js +3 -0
- package/dist/editor/settings/index/useIndexStatus.js.map +1 -1
- package/dist/editor/settings/panels/SearchConfigPanel.js +64 -3
- package/dist/editor/settings/panels/SearchConfigPanel.js.map +1 -1
- package/dist/editor/settings/panels/StatusPanel.js +7 -2
- package/dist/editor/settings/panels/StatusPanel.js.map +1 -1
- package/dist/editor/template-wizard/TemplateStructureInlineEditor.js +3 -2
- package/dist/editor/template-wizard/TemplateStructureInlineEditor.js.map +1 -1
- package/dist/revision.d.ts +2 -2
- package/dist/revision.js +2 -2
- package/dist/setup/services/setupWizardService.d.ts +9 -0
- package/dist/setup/services/setupWizardService.js +20 -0
- package/dist/setup/services/setupWizardService.js.map +1 -1
- package/dist/types.d.ts +6 -0
- package/package.json +1 -1
|
@@ -396,10 +396,15 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
396
396
|
// When switchWorkspace already pushed a URL entry, the follow-up URL sync
|
|
397
397
|
// effect should only *replace* that entry (not push a second one).
|
|
398
398
|
const switchWorkspacePushedRef = useRef(false);
|
|
399
|
-
// Ref to track the last known URL for the popstate handler
|
|
400
|
-
//
|
|
401
|
-
//
|
|
402
|
-
const lastUrlRef = useRef(typeof window !== "undefined"
|
|
399
|
+
// Ref to track the last known URL for the popstate handler.
|
|
400
|
+
// Uses pathname+search (not full href) so comparisons are consistent with the
|
|
401
|
+
// relative URLs produced by the URL sync effect and updateUrl.
|
|
402
|
+
const lastUrlRef = useRef(typeof window !== "undefined"
|
|
403
|
+
? `${window.location.pathname}${window.location.search}`
|
|
404
|
+
: "");
|
|
405
|
+
// The very first URL sync after initial load should replaceState (not pushState)
|
|
406
|
+
// so the initial bare URL isn't left as a dead-end history entry.
|
|
407
|
+
const isFirstUrlSyncRef = useRef(true);
|
|
403
408
|
const [inlineEditingFieldElement, setInlineEditingFieldElement] = useState();
|
|
404
409
|
const [lockedField, setLockedField] = useState();
|
|
405
410
|
const [itemLanguages, setItemLanguages] = useState([]);
|
|
@@ -828,6 +833,39 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
828
833
|
}
|
|
829
834
|
return window.history.state;
|
|
830
835
|
}, []);
|
|
836
|
+
useEffect(() => {
|
|
837
|
+
if (isInitialLoad) {
|
|
838
|
+
return;
|
|
839
|
+
}
|
|
840
|
+
const itemid = searchParams.get("itemid");
|
|
841
|
+
const language = searchParams.get("lang") ?? searchParams.get("language");
|
|
842
|
+
const versionParam = searchParams.get("version");
|
|
843
|
+
const version = versionParam ? parseInt(versionParam, 10) : 0;
|
|
844
|
+
const itemId = cleanId(itemid ?? undefined);
|
|
845
|
+
if (!itemId || !language) {
|
|
846
|
+
return;
|
|
847
|
+
}
|
|
848
|
+
const currentDescriptor = currentItemDescriptorRef.current;
|
|
849
|
+
const matchesCurrentDescriptor = currentDescriptor?.id === itemId &&
|
|
850
|
+
currentDescriptor?.language === language &&
|
|
851
|
+
(!version || currentDescriptor?.version === version);
|
|
852
|
+
if (matchesCurrentDescriptor) {
|
|
853
|
+
return;
|
|
854
|
+
}
|
|
855
|
+
isHandlingPopStateRef.current = true;
|
|
856
|
+
loadItemRef
|
|
857
|
+
.current({
|
|
858
|
+
id: itemId,
|
|
859
|
+
language,
|
|
860
|
+
version,
|
|
861
|
+
}, {
|
|
862
|
+
addToBrowseHistory: false,
|
|
863
|
+
skipViewChange: true,
|
|
864
|
+
})
|
|
865
|
+
.finally(() => {
|
|
866
|
+
isHandlingPopStateRef.current = false;
|
|
867
|
+
});
|
|
868
|
+
}, [isInitialLoad, searchParams]);
|
|
831
869
|
const startTour = useCallback(() => {
|
|
832
870
|
setIsTourActive(true);
|
|
833
871
|
// Persist tour state to URL so it survives navigation/remounts
|
|
@@ -1097,7 +1135,7 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
1097
1135
|
};
|
|
1098
1136
|
// Listen for browser navigation events (back/forward buttons)
|
|
1099
1137
|
const handlePopState = (event) => {
|
|
1100
|
-
const newUrl = window.location.
|
|
1138
|
+
const newUrl = `${window.location.pathname}${window.location.search}`;
|
|
1101
1139
|
if (newUrl !== lastUrlRef.current) {
|
|
1102
1140
|
lastUrlRef.current = newUrl;
|
|
1103
1141
|
// Mark that we're handling a popstate to prevent URL sync from pushing to history
|
|
@@ -1108,20 +1146,18 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
1108
1146
|
if (urlWorkspace && urlWorkspace !== workspaceIdRef.current) {
|
|
1109
1147
|
setWorkspaceId(urlWorkspace);
|
|
1110
1148
|
}
|
|
1111
|
-
// Handle sidebar changes
|
|
1149
|
+
// Handle sidebar changes — clear when absent so state matches the URL
|
|
1112
1150
|
const sidebarParam = urlParams.get("sidebar");
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1151
|
+
const newSidebars = sidebarParam
|
|
1152
|
+
? sidebarParam.split(",").filter(Boolean)
|
|
1153
|
+
: [];
|
|
1154
|
+
setOpenSidebars(newSidebars);
|
|
1117
1155
|
// Handle wizard ID changes
|
|
1118
1156
|
const wizardId = urlParams.get("wizardid");
|
|
1119
1157
|
setCurrentWizardId(wizardId);
|
|
1120
|
-
// Handle compare mode changes
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
setCompareMode(compareValue);
|
|
1124
|
-
}
|
|
1158
|
+
// Handle compare mode changes — always set to avoid stale-closure mismatch
|
|
1159
|
+
// (React skips re-render when the value is unchanged)
|
|
1160
|
+
setCompareMode(urlParams.get("compare") === "true");
|
|
1125
1161
|
// Handle help panel changes
|
|
1126
1162
|
const helpParam = urlParams.get("help");
|
|
1127
1163
|
if (helpParam) {
|
|
@@ -1134,9 +1170,9 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
1134
1170
|
else {
|
|
1135
1171
|
handleSetShowHelpTerminal(false);
|
|
1136
1172
|
}
|
|
1137
|
-
// Handle mode changes
|
|
1173
|
+
// Handle mode changes — always set to avoid stale-closure mismatch
|
|
1138
1174
|
const urlMode = urlParams.get("mode");
|
|
1139
|
-
if (urlMode
|
|
1175
|
+
if (urlMode) {
|
|
1140
1176
|
setMode(urlMode);
|
|
1141
1177
|
}
|
|
1142
1178
|
// Handle fullscreen changes (shell-level state)
|
|
@@ -2003,8 +2039,11 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
2003
2039
|
return;
|
|
2004
2040
|
}
|
|
2005
2041
|
if (newUrl !== oldUrl) {
|
|
2006
|
-
if (
|
|
2042
|
+
if (isFirstUrlSyncRef.current ||
|
|
2043
|
+
switchWorkspacePushedRef.current ||
|
|
2044
|
+
isRestoringLastSyncedUrl) {
|
|
2007
2045
|
window.history.replaceState(getCurrentHistoryState(), "", newUrl);
|
|
2046
|
+
isFirstUrlSyncRef.current = false;
|
|
2008
2047
|
switchWorkspacePushedRef.current = false;
|
|
2009
2048
|
}
|
|
2010
2049
|
else {
|
|
@@ -2012,11 +2051,22 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
2012
2051
|
}
|
|
2013
2052
|
lastUrlRef.current = newUrl;
|
|
2014
2053
|
}
|
|
2015
|
-
else
|
|
2016
|
-
//
|
|
2017
|
-
//
|
|
2018
|
-
//
|
|
2019
|
-
|
|
2054
|
+
else {
|
|
2055
|
+
// Even when the first sync is a no-op (URL already matches state), consume
|
|
2056
|
+
// the first-sync flag. Otherwise the *next* real change (e.g. user selecting
|
|
2057
|
+
// a different item) would hit the replaceState branch and overwrite the
|
|
2058
|
+
// landing history entry — eating the "back" target and making browser back
|
|
2059
|
+
// skip past the initial page.
|
|
2060
|
+
if (isFirstUrlSyncRef.current) {
|
|
2061
|
+
isFirstUrlSyncRef.current = false;
|
|
2062
|
+
lastUrlRef.current = newUrl;
|
|
2063
|
+
}
|
|
2064
|
+
if (switchWorkspacePushedRef.current) {
|
|
2065
|
+
// A workspace change may already have pushed the exact target URL. If we leave
|
|
2066
|
+
// this flag set, the next unrelated item navigation will incorrectly replace
|
|
2067
|
+
// history instead of pushing a new entry, which breaks browser back/forward.
|
|
2068
|
+
switchWorkspacePushedRef.current = false;
|
|
2069
|
+
}
|
|
2020
2070
|
}
|
|
2021
2071
|
}, [
|
|
2022
2072
|
currentItemDescriptor,
|
|
@@ -2642,6 +2692,7 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
|
|
|
2642
2692
|
: browserPathname;
|
|
2643
2693
|
if (typeof window !== "undefined") {
|
|
2644
2694
|
window.history.pushState(getCurrentHistoryState(), "", newUrl);
|
|
2695
|
+
lastUrlRef.current = newUrl;
|
|
2645
2696
|
}
|
|
2646
2697
|
else {
|
|
2647
2698
|
router.push(newUrl, { scroll: false });
|