@parhelia/core 0.3.12827 → 0.3.12832
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/agent-changes/agentChangeTargets.d.ts +58 -0
- package/dist/editor/agent-changes/agentChangeTargets.js +174 -0
- package/dist/editor/agent-changes/agentChangeTargets.js.map +1 -0
- package/dist/editor/agent-changes/agentChangeTextHighlight.d.ts +57 -0
- package/dist/editor/agent-changes/agentChangeTextHighlight.js +109 -0
- package/dist/editor/agent-changes/agentChangeTextHighlight.js.map +1 -0
- package/dist/editor/ai/activityRowNavigation.d.ts +28 -0
- package/dist/editor/ai/activityRowNavigation.js +53 -0
- package/dist/editor/ai/activityRowNavigation.js.map +1 -0
- package/dist/editor/ai/terminal/activeReasoningModel.d.ts +9 -0
- package/dist/editor/ai/terminal/activeReasoningModel.js +20 -0
- package/dist/editor/ai/terminal/activeReasoningModel.js.map +1 -0
- package/dist/editor/ai/terminal/agentDurations.d.ts +27 -0
- package/dist/editor/ai/terminal/agentDurations.js +89 -0
- package/dist/editor/ai/terminal/agentDurations.js.map +1 -0
- package/dist/editor/ai/terminal/agentTurnTiming.d.ts +35 -0
- package/dist/editor/ai/terminal/agentTurnTiming.js +128 -0
- package/dist/editor/ai/terminal/agentTurnTiming.js.map +1 -0
- package/dist/editor/ai/terminal/components/AgentMemorySettingsSection.d.ts +9 -0
- package/dist/editor/ai/terminal/components/AgentMemorySettingsSection.js +75 -0
- package/dist/editor/ai/terminal/components/AgentMemorySettingsSection.js.map +1 -0
- package/dist/editor/ai/terminal/components/AgentProfileRecovery.d.ts +10 -0
- package/dist/editor/ai/terminal/components/AgentProfileRecovery.js +12 -0
- package/dist/editor/ai/terminal/components/AgentProfileRecovery.js.map +1 -0
- package/dist/editor/ai/terminal/components/CreateItemToolCallContent.d.ts +3 -0
- package/dist/editor/ai/terminal/components/CreateItemToolCallContent.js +47 -0
- package/dist/editor/ai/terminal/components/CreateItemToolCallContent.js.map +1 -0
- package/dist/editor/ai/terminal/components/ResponseTurnDuration.d.ts +15 -0
- package/dist/editor/ai/terminal/components/ResponseTurnDuration.js +63 -0
- package/dist/editor/ai/terminal/components/ResponseTurnDuration.js.map +1 -0
- package/dist/editor/ai/terminal/components/toolCallResultJson.d.ts +1 -0
- package/dist/editor/ai/terminal/components/toolCallResultJson.js +46 -0
- package/dist/editor/ai/terminal/components/toolCallResultJson.js.map +1 -0
- package/dist/editor/ai/terminal/reasoningEffortLevels.d.ts +8 -0
- package/dist/editor/ai/terminal/reasoningEffortLevels.js +54 -0
- package/dist/editor/ai/terminal/reasoningEffortLevels.js.map +1 -0
- package/dist/editor/ai/terminal/requestUsage.d.ts +3 -0
- package/dist/editor/ai/terminal/requestUsage.js +22 -0
- package/dist/editor/ai/terminal/requestUsage.js.map +1 -0
- package/dist/editor/ai/terminal/useAgentProviderWait.d.ts +18 -0
- package/dist/editor/ai/terminal/useAgentProviderWait.js +23 -0
- package/dist/editor/ai/terminal/useAgentProviderWait.js.map +1 -0
- package/dist/editor/ai/terminal/useAgentReasoningEffortState.d.ts +5 -0
- package/dist/editor/ai/terminal/useAgentReasoningEffortState.js +10 -0
- package/dist/editor/ai/terminal/useAgentReasoningEffortState.js.map +1 -0
- package/dist/editor/bridge/bridgeKeys.d.ts +5 -0
- package/dist/editor/bridge/bridgeKeys.js +8 -0
- package/dist/editor/bridge/bridgeKeys.js.map +1 -0
- package/dist/editor/client/SessionsDialog.d.ts +2 -0
- package/dist/editor/client/SessionsDialog.js +27 -0
- package/dist/editor/client/SessionsDialog.js.map +1 -0
- package/dist/editor/client/agentLoadItemPolicy.d.ts +22 -0
- package/dist/editor/client/agentLoadItemPolicy.js +60 -0
- package/dist/editor/client/agentLoadItemPolicy.js.map +1 -0
- package/dist/editor/client/localUserEditActivity.d.ts +3 -0
- package/dist/editor/client/localUserEditActivity.js +12 -0
- package/dist/editor/client/localUserEditActivity.js.map +1 -0
- package/dist/editor/commands/mediaCommands.d.ts +5 -0
- package/dist/editor/commands/mediaCommands.js +59 -0
- package/dist/editor/commands/mediaCommands.js.map +1 -0
- package/dist/editor/componentVisualMode.d.ts +14 -0
- package/dist/editor/componentVisualMode.js +43 -0
- package/dist/editor/componentVisualMode.js.map +1 -0
- package/dist/editor/field-types/FieldHistoryBoundary.d.ts +7 -0
- package/dist/editor/field-types/FieldHistoryBoundary.js +19 -0
- package/dist/editor/field-types/FieldHistoryBoundary.js.map +1 -0
- package/dist/editor/field-types/richtext/utils/changeHighlight.d.ts +18 -0
- package/dist/editor/field-types/richtext/utils/changeHighlight.js +57 -0
- package/dist/editor/field-types/richtext/utils/changeHighlight.js.map +1 -0
- package/dist/editor/itemContextMenuGroups.d.ts +16 -0
- package/dist/editor/itemContextMenuGroups.js +48 -0
- package/dist/editor/itemContextMenuGroups.js.map +1 -0
- package/dist/editor/media-selector/UploadMediaFileDialog.d.ts +5 -0
- package/dist/editor/media-selector/UploadMediaFileDialog.js +14 -0
- package/dist/editor/media-selector/UploadMediaFileDialog.js.map +1 -0
- package/dist/editor/menubar/OpenPublishedPageButton.d.ts +1 -0
- package/dist/editor/menubar/OpenPublishedPageButton.js +22 -0
- package/dist/editor/menubar/OpenPublishedPageButton.js.map +1 -0
- package/dist/editor/page-editor-chrome/AgentChangeHighlightings.d.ts +20 -0
- package/dist/editor/page-editor-chrome/AgentChangeHighlightings.js +31 -0
- package/dist/editor/page-editor-chrome/AgentChangeHighlightings.js.map +1 -0
- package/dist/editor/page-editor-chrome/DiffHighlightOverlay.d.ts +33 -0
- package/dist/editor/page-editor-chrome/DiffHighlightOverlay.js +290 -0
- package/dist/editor/page-editor-chrome/DiffHighlightOverlay.js.map +1 -0
- package/dist/editor/page-editor-chrome/diffRulerSegments.d.ts +18 -0
- package/dist/editor/page-editor-chrome/diffRulerSegments.js +37 -0
- package/dist/editor/page-editor-chrome/diffRulerSegments.js.map +1 -0
- package/dist/editor/page-viewer/PreviewModeNotice.d.ts +7 -0
- package/dist/editor/page-viewer/PreviewModeNotice.js +19 -0
- package/dist/editor/page-viewer/PreviewModeNotice.js.map +1 -0
- package/dist/editor/page-viewer/previewEditAttempt.d.ts +31 -0
- package/dist/editor/page-viewer/previewEditAttempt.js +68 -0
- package/dist/editor/page-viewer/previewEditAttempt.js.map +1 -0
- package/dist/editor/services/migrationService.d.ts +31 -0
- package/dist/editor/services/migrationService.js +22 -0
- package/dist/editor/services/migrationService.js.map +1 -0
- package/dist/editor/services/publicSiteService.d.ts +40 -0
- package/dist/editor/services/publicSiteService.js +5 -0
- package/dist/editor/services/publicSiteService.js.map +1 -0
- package/dist/editor/settings/MigrationJournalCard.d.ts +12 -0
- package/dist/editor/settings/MigrationJournalCard.js +114 -0
- package/dist/editor/settings/MigrationJournalCard.js.map +1 -0
- package/dist/editor/settings/panels/PublicSiteEntryDialog.d.ts +8 -0
- package/dist/editor/settings/panels/PublicSiteEntryDialog.js +113 -0
- package/dist/editor/settings/panels/PublicSiteEntryDialog.js.map +1 -0
- package/dist/editor/settings/panels/PublicSitesPanel.d.ts +1 -0
- package/dist/editor/settings/panels/PublicSitesPanel.js +153 -0
- package/dist/editor/settings/panels/PublicSitesPanel.js.map +1 -0
- package/dist/editor/settings/panels/publicSiteHelpers.d.ts +6 -0
- package/dist/editor/settings/panels/publicSiteHelpers.js +30 -0
- package/dist/editor/settings/panels/publicSiteHelpers.js.map +1 -0
- package/dist/editor/sidebar/OperationDetailsContent.d.ts +14 -0
- package/dist/editor/sidebar/OperationDetailsContent.js +521 -0
- package/dist/editor/sidebar/OperationDetailsContent.js.map +1 -0
- package/dist/editor/sidebar/liveComponentThumbnails.d.ts +53 -0
- package/dist/editor/sidebar/liveComponentThumbnails.js +204 -0
- package/dist/editor/sidebar/liveComponentThumbnails.js.map +1 -0
- package/dist/editor/ui/PublishReadinessSummary.d.ts +12 -0
- package/dist/editor/ui/PublishReadinessSummary.js +34 -0
- package/dist/editor/ui/PublishReadinessSummary.js.map +1 -0
- package/dist/editor/ui/publishReadiness.d.ts +98 -0
- package/dist/editor/ui/publishReadiness.js +307 -0
- package/dist/editor/ui/publishReadiness.js.map +1 -0
- package/dist/editor/ui/usePublishingItem.d.ts +8 -0
- package/dist/editor/ui/usePublishingItem.js +47 -0
- package/dist/editor/ui/usePublishingItem.js.map +1 -0
- package/dist/editor/utils/linkDisplay.d.ts +12 -0
- package/dist/editor/utils/linkDisplay.js +23 -0
- package/dist/editor/utils/linkDisplay.js.map +1 -0
- package/dist/editor/validation/ValidationIssuesPopover.d.ts +39 -0
- package/dist/editor/validation/ValidationIssuesPopover.js +51 -0
- package/dist/editor/validation/ValidationIssuesPopover.js.map +1 -0
- package/dist/editor/validation/navigateToValidationIssue.d.ts +13 -0
- package/dist/editor/validation/navigateToValidationIssue.js +43 -0
- package/dist/editor/validation/navigateToValidationIssue.js.map +1 -0
- package/dist/editor/validation/validationFixAgent.d.ts +26 -0
- package/dist/editor/validation/validationFixAgent.js +124 -0
- package/dist/editor/validation/validationFixAgent.js.map +1 -0
- package/dist/editor/validation/validationSeverity.d.ts +15 -0
- package/dist/editor/validation/validationSeverity.js +47 -0
- package/dist/editor/validation/validationSeverity.js.map +1 -0
- package/dist/lib/viewportClip.d.ts +18 -0
- package/dist/lib/viewportClip.js +22 -0
- package/dist/lib/viewportClip.js.map +1 -0
- package/dist/revision.d.ts +2 -2
- package/dist/revision.js +2 -2
- package/dist/task-board/components/ProjectProgressIndicator.d.ts +8 -0
- package/dist/task-board/components/ProjectProgressIndicator.js +17 -0
- package/dist/task-board/components/ProjectProgressIndicator.js.map +1 -0
- package/dist/task-board/components/commentAuthor.d.ts +14 -0
- package/dist/task-board/components/commentAuthor.js +25 -0
- package/dist/task-board/components/commentAuthor.js.map +1 -0
- package/dist/task-board/utils/projectDashboardModel.d.ts +68 -0
- package/dist/task-board/utils/projectDashboardModel.js +355 -0
- package/dist/task-board/utils/projectDashboardModel.js.map +1 -0
- package/dist/task-board/views/ProjectDashboardView.d.ts +28 -0
- package/dist/task-board/views/ProjectDashboardView.js +316 -0
- package/dist/task-board/views/ProjectDashboardView.js.map +1 -0
- package/dist/tour/TourInputBoundary.d.ts +6 -0
- package/dist/tour/TourInputBoundary.js +82 -0
- package/dist/tour/TourInputBoundary.js.map +1 -0
- package/dist/tour/sandbox-tour-copy.d.ts +48 -0
- package/dist/tour/sandbox-tour-copy.js +48 -0
- package/dist/tour/sandbox-tour-copy.js.map +1 -0
- package/dist/tour/sandbox-tour.d.ts +3 -0
- package/dist/tour/sandbox-tour.js +212 -0
- package/dist/tour/sandbox-tour.js.map +1 -0
- package/dist/tour/tour-utils.d.ts +32 -0
- package/dist/tour/tour-utils.js +148 -0
- package/dist/tour/tour-utils.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from "react";
|
|
2
|
+
import { normalizeBridgeKey } from "../bridge/bridgeKeys";
|
|
3
|
+
import { BRIDGE_DOM_UPDATED_EVENT } from "../page-viewer/MiniMap";
|
|
4
|
+
/** Quiet time after the last host DOM mutation before the page is recaptured. */
|
|
5
|
+
export const LIVE_THUMBNAIL_DEBOUNCE_MS = 1200;
|
|
6
|
+
/** Delay for the first capture after thumbnails are switched on. */
|
|
7
|
+
export const LIVE_THUMBNAIL_INITIAL_DELAY_MS = 300;
|
|
8
|
+
/** Longest canvas side the host renders; thumbnails never need more. */
|
|
9
|
+
export const LIVE_THUMBNAIL_MAX_DIMENSION = 3000;
|
|
10
|
+
export function buildThumbnailSheet(payload, imageUrl) {
|
|
11
|
+
const rects = new Map();
|
|
12
|
+
for (const component of payload.components ?? []) {
|
|
13
|
+
const id = normalizeBridgeKey(component.componentId || component.key);
|
|
14
|
+
if (!id || rects.has(id))
|
|
15
|
+
continue;
|
|
16
|
+
if (component.width <= 0 || component.height <= 0)
|
|
17
|
+
continue;
|
|
18
|
+
rects.set(id, {
|
|
19
|
+
x: component.x,
|
|
20
|
+
y: component.y,
|
|
21
|
+
width: component.width,
|
|
22
|
+
height: component.height,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
imageUrl,
|
|
27
|
+
width: Math.max(1, payload.width ?? 1),
|
|
28
|
+
height: Math.max(1, payload.height ?? 1),
|
|
29
|
+
rects,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export function findThumbnailRect(sheet, componentId) {
|
|
33
|
+
return sheet.rects.get(normalizeBridgeKey(componentId)) ?? null;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* CSS that shows exactly one component's crop of the sheet inside a box of the
|
|
37
|
+
* given size. Always fits the entire component, including tall modules in a
|
|
38
|
+
* narrow viewport. Clip the shared page image to the component's bounds so
|
|
39
|
+
* neighboring components cannot show through the unused space.
|
|
40
|
+
*/
|
|
41
|
+
export function getThumbnailBackgroundStyle(sheet, rect, box) {
|
|
42
|
+
const scale = Math.min(box.width / rect.width, box.height / rect.height, 1);
|
|
43
|
+
const insetX = Math.max(0, (box.width - rect.width * scale) / 2);
|
|
44
|
+
const insetY = Math.max(0, (box.height - rect.height * scale) / 2);
|
|
45
|
+
const offsetX = insetX - rect.x * scale;
|
|
46
|
+
const offsetY = insetY - rect.y * scale;
|
|
47
|
+
return {
|
|
48
|
+
backgroundImage: `url("${sheet.imageUrl}")`,
|
|
49
|
+
backgroundRepeat: "no-repeat",
|
|
50
|
+
backgroundSize: `${round(sheet.width * scale)}px ${round(sheet.height * scale)}px`,
|
|
51
|
+
backgroundPosition: `${round(offsetX)}px ${round(offsetY)}px`,
|
|
52
|
+
clipPath: `inset(${round(insetY)}px ${round(insetX)}px)`,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function round(value) {
|
|
56
|
+
return Math.round(value * 100) / 100;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Turns the host's data URL into an object URL so thirty rows reference one
|
|
60
|
+
* short blob URL instead of each inlining a megabyte of base64 into their
|
|
61
|
+
* style attribute. Falls back to the data URL where object URLs are missing.
|
|
62
|
+
*/
|
|
63
|
+
export function toThumbnailImageUrl(dataUrl) {
|
|
64
|
+
if (typeof URL === "undefined" ||
|
|
65
|
+
typeof URL.createObjectURL !== "function" ||
|
|
66
|
+
typeof Blob === "undefined") {
|
|
67
|
+
return dataUrl;
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
const comma = dataUrl.indexOf(",");
|
|
71
|
+
const header = dataUrl.slice(0, comma);
|
|
72
|
+
const body = dataUrl.slice(comma + 1);
|
|
73
|
+
const mimeMatch = /^data:([^;,]+)/.exec(header);
|
|
74
|
+
const mime = mimeMatch?.[1] ?? "image/png";
|
|
75
|
+
if (!/;base64$/i.test(header)) {
|
|
76
|
+
return dataUrl;
|
|
77
|
+
}
|
|
78
|
+
const binary = atob(body);
|
|
79
|
+
const bytes = new Uint8Array(binary.length);
|
|
80
|
+
for (let i = 0; i < binary.length; i++) {
|
|
81
|
+
bytes[i] = binary.charCodeAt(i);
|
|
82
|
+
}
|
|
83
|
+
return URL.createObjectURL(new Blob([bytes], { type: mime }));
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
return dataUrl;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function revokeThumbnailImageUrl(url) {
|
|
90
|
+
if (!url || !url.startsWith("blob:"))
|
|
91
|
+
return;
|
|
92
|
+
try {
|
|
93
|
+
URL.revokeObjectURL(url);
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
// Already revoked or unsupported - nothing to release.
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Keeps a fresh page sheet while `enabled`: captures shortly after switching
|
|
101
|
+
* on, then again a little after every burst of host DOM mutations (typing,
|
|
102
|
+
* inserts, reorders, refreshes). Only one capture runs at a time; changes that
|
|
103
|
+
* arrive mid-capture queue exactly one follow-up. Returns null until the first
|
|
104
|
+
* capture lands, or when the bridge is unavailable.
|
|
105
|
+
*/
|
|
106
|
+
export function useLiveComponentThumbnails(pageViewContext, enabled) {
|
|
107
|
+
const [sheet, setSheet] = useState(null);
|
|
108
|
+
const sheetRef = useRef(null);
|
|
109
|
+
const timerRef = useRef(null);
|
|
110
|
+
const inFlightRef = useRef(false);
|
|
111
|
+
const dirtyRef = useRef(false);
|
|
112
|
+
const disposedRef = useRef(false);
|
|
113
|
+
const contextRef = useRef(pageViewContext);
|
|
114
|
+
contextRef.current = pageViewContext;
|
|
115
|
+
const bridgeReady = !!pageViewContext?.bridgeReady;
|
|
116
|
+
const requestPageSnapshot = pageViewContext?.requestBridgePageSnapshot;
|
|
117
|
+
const bridgeStructure = pageViewContext?.bridgeStructure;
|
|
118
|
+
const active = enabled && bridgeReady && !!requestPageSnapshot;
|
|
119
|
+
useEffect(() => {
|
|
120
|
+
disposedRef.current = false;
|
|
121
|
+
return () => {
|
|
122
|
+
disposedRef.current = true;
|
|
123
|
+
if (timerRef.current !== null) {
|
|
124
|
+
window.clearTimeout(timerRef.current);
|
|
125
|
+
timerRef.current = null;
|
|
126
|
+
}
|
|
127
|
+
revokeThumbnailImageUrl(sheetRef.current?.imageUrl);
|
|
128
|
+
sheetRef.current = null;
|
|
129
|
+
};
|
|
130
|
+
}, []);
|
|
131
|
+
useEffect(() => {
|
|
132
|
+
if (!active) {
|
|
133
|
+
if (timerRef.current !== null) {
|
|
134
|
+
window.clearTimeout(timerRef.current);
|
|
135
|
+
timerRef.current = null;
|
|
136
|
+
}
|
|
137
|
+
dirtyRef.current = false;
|
|
138
|
+
if (sheetRef.current) {
|
|
139
|
+
revokeThumbnailImageUrl(sheetRef.current.imageUrl);
|
|
140
|
+
sheetRef.current = null;
|
|
141
|
+
setSheet(null);
|
|
142
|
+
}
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const capture = async () => {
|
|
146
|
+
timerRef.current = null;
|
|
147
|
+
const request = contextRef.current?.requestBridgePageSnapshot;
|
|
148
|
+
if (!request || !contextRef.current?.bridgeReady)
|
|
149
|
+
return;
|
|
150
|
+
if (inFlightRef.current) {
|
|
151
|
+
dirtyRef.current = true;
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
inFlightRef.current = true;
|
|
155
|
+
dirtyRef.current = false;
|
|
156
|
+
try {
|
|
157
|
+
const payload = await request({
|
|
158
|
+
maxDimension: LIVE_THUMBNAIL_MAX_DIMENSION,
|
|
159
|
+
});
|
|
160
|
+
if (disposedRef.current)
|
|
161
|
+
return;
|
|
162
|
+
if (payload.dataUrl && !payload.error) {
|
|
163
|
+
const next = buildThumbnailSheet(payload, toThumbnailImageUrl(payload.dataUrl));
|
|
164
|
+
revokeThumbnailImageUrl(sheetRef.current?.imageUrl);
|
|
165
|
+
sheetRef.current = next;
|
|
166
|
+
setSheet(next);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
// Keep the previous sheet; the next DOM change retries.
|
|
171
|
+
}
|
|
172
|
+
finally {
|
|
173
|
+
inFlightRef.current = false;
|
|
174
|
+
if (dirtyRef.current && !disposedRef.current) {
|
|
175
|
+
schedule(LIVE_THUMBNAIL_DEBOUNCE_MS);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
const schedule = (delay) => {
|
|
180
|
+
if (timerRef.current !== null) {
|
|
181
|
+
window.clearTimeout(timerRef.current);
|
|
182
|
+
}
|
|
183
|
+
timerRef.current = window.setTimeout(() => {
|
|
184
|
+
void capture();
|
|
185
|
+
}, delay);
|
|
186
|
+
};
|
|
187
|
+
const onDomUpdated = () => schedule(LIVE_THUMBNAIL_DEBOUNCE_MS);
|
|
188
|
+
window.addEventListener(BRIDGE_DOM_UPDATED_EVENT, onDomUpdated);
|
|
189
|
+
schedule(sheetRef.current
|
|
190
|
+
? LIVE_THUMBNAIL_DEBOUNCE_MS
|
|
191
|
+
: LIVE_THUMBNAIL_INITIAL_DELAY_MS);
|
|
192
|
+
return () => {
|
|
193
|
+
window.removeEventListener(BRIDGE_DOM_UPDATED_EVENT, onDomUpdated);
|
|
194
|
+
if (timerRef.current !== null) {
|
|
195
|
+
window.clearTimeout(timerRef.current);
|
|
196
|
+
timerRef.current = null;
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
// A new structure means components were added, removed or reordered; the
|
|
200
|
+
// effect re-runs and schedules a debounced recapture.
|
|
201
|
+
}, [active, requestPageSnapshot, bridgeStructure]);
|
|
202
|
+
return sheet;
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=liveComponentThumbnails.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liveComponentThumbnails.js","sourceRoot":"","sources":["../../../src/editor/sidebar/liveComponentThumbnails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAsB,MAAM,OAAO,CAAC;AAExE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAuBlE,iFAAiF;AACjF,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC;AAC/C,oEAAoE;AACpE,MAAM,CAAC,MAAM,+BAA+B,GAAG,GAAG,CAAC;AACnD,wEAAwE;AACxE,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC;AAEjD,MAAM,UAAU,mBAAmB,CACjC,OAAuC,EACvC,QAAgB;IAEhB,MAAM,KAAK,GAAG,IAAI,GAAG,EAAyB,CAAC;IAC/C,KAAK,MAAM,SAAS,IAAI,OAAO,CAAC,UAAU,IAAI,EAAE,EAAE,CAAC;QACjD,MAAM,EAAE,GAAG,kBAAkB,CAAC,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC;QACtE,IAAI,CAAC,EAAE,IAAI,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YAAE,SAAS;QACnC,IAAI,SAAS,CAAC,KAAK,IAAI,CAAC,IAAI,SAAS,CAAC,MAAM,IAAI,CAAC;YAAE,SAAS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E,CAAC;oBAC7C,QAAQ,CAAC,0BAA0B,CAAC,CAAC;gBACvC,CAAC;YACH,CAAC;QACH,CAAC,CAAC;QAEF,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAE,EAAE;YACjC,IAAI,QAAQ,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;gBAC9B,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACxC,CAAC;YACD,QAAQ,CAAC,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;gBACxC,KAAK,OAAO,EAAE,CAAC;YACjB,CAAC,EAAE,KAAK,CAAC,CAAC;QACZ,CAAC,CAAC;QAEF,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC,CAAC;QAChE,MAAM,CAAC,gBAAgB,CAAC,wBAAwB,EAAE,YAAY,CAAC,CAAC;QAChE,QAAQ,CACN,QAAQ,CAAC,OAAO;YACd,CAAC,CAAC,0BAA0B;YAC5B,CAAC,CAAC,+BAA+B,CACpC,CAAC;QAEF,OAAO,GAAG,EAAE;YACV,MAAM,CAAC,mBAAmB,CAAC,wBAAwB,EAAE,YAAY,CAAC,CAAC;YACnE,IAAI,QAAQ,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;gBAC9B,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;gBACtC,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC;YAC1B,CAAC;QACH,CAAC,CAAC;QACF,yEAAyE;QACzE,sDAAsD;IACxD,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,EAAE,eAAe,CAAC,CAAC,CAAC;IAEnD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type PublishReadiness } from "./publishReadiness";
|
|
2
|
+
/**
|
|
3
|
+
* Explains, above the publish table, which items stay behind and why. Each
|
|
4
|
+
* item gets an identity line (icon, name, language and version) and a muted
|
|
5
|
+
* detail line (reason, then what visitors will see) so the banner reads as a
|
|
6
|
+
* short list instead of one long sentence per item.
|
|
7
|
+
*/
|
|
8
|
+
export declare function PublishReadinessSummary({ readiness, compact, className, }: {
|
|
9
|
+
readiness: PublishReadiness;
|
|
10
|
+
compact?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AlertTriangle } from "lucide-react";
|
|
3
|
+
import { Alert, AlertTitle, AlertDescription } from "../../components/ui/alert";
|
|
4
|
+
import { cn } from "../../lib/utils";
|
|
5
|
+
import { getAbsoluteIconUrl } from "../utils";
|
|
6
|
+
import { getPublishReadinessHeadline, getPublishReasonText, getPublishImpactText, } from "./publishReadiness";
|
|
7
|
+
/**
|
|
8
|
+
* Explains, above the publish table, which items stay behind and why. Each
|
|
9
|
+
* item gets an identity line (icon, name, language and version) and a muted
|
|
10
|
+
* detail line (reason, then what visitors will see) so the banner reads as a
|
|
11
|
+
* short list instead of one long sentence per item.
|
|
12
|
+
*/
|
|
13
|
+
export function PublishReadinessSummary({ readiness, compact = false, className, }) {
|
|
14
|
+
const headline = getPublishReadinessHeadline(readiness);
|
|
15
|
+
if (!headline)
|
|
16
|
+
return null;
|
|
17
|
+
const page = readiness.currentPage;
|
|
18
|
+
return (_jsxs(Alert, { variant: page?.blockedByWorkflow ? "destructive" : "warning", "data-testid": "publish-readiness-summary", className: cn(compact && "px-3 py-2 text-xs [&>svg]:top-3 [&>svg]:left-3", className), children: [_jsx(AlertTriangle, { strokeWidth: 1.5, className: "h-4 w-4" }), _jsx(AlertTitle, { "data-testid": "publish-readiness-headline", className: "leading-snug", children: headline }), _jsx(AlertDescription, { className: cn(compact && "text-xs"), children: _jsxs("ul", { className: cn("mt-2 space-y-2", compact && "mt-1 space-y-1.5"), children: [page?.reason && (_jsx(SummaryRow, { testId: "publish-readiness-page", compact: compact, icon: page.item.icon, label: "This page", identity: [page.item.name, identityText(page.item)]
|
|
19
|
+
.filter(Boolean)
|
|
20
|
+
.join(" · "), reason: getPublishReasonText(page.reason, page.affectedTargets, page.targetCount), impact: page.blockedByWorkflow
|
|
21
|
+
? "Move it to a final workflow state before publishing."
|
|
22
|
+
: getPublishImpactText(page.impact, page.validVersion) })), readiness.leftBehind.map((entry) => (_jsx(SummaryRow, { testId: "publish-readiness-item", "data-item-id": entry.item.item.id, "data-category": entry.category, compact: compact, icon: entry.item.icon, label: entry.item.name, identity: identityText(entry.item), reason: entry.reason
|
|
23
|
+
? getPublishReasonText(entry.reason, entry.affectedTargets, entry.targetCount)
|
|
24
|
+
: undefined, impact: getPublishImpactText(entry.impact, entry.validVersion) }, entry.key)))] }) })] }));
|
|
25
|
+
}
|
|
26
|
+
function identityText(item) {
|
|
27
|
+
return [item.item.language, item.item.version ? `v${item.item.version}` : ""]
|
|
28
|
+
.filter(Boolean)
|
|
29
|
+
.join(" · ");
|
|
30
|
+
}
|
|
31
|
+
function SummaryRow({ testId, compact, icon, label, identity, reason, impact, ...dataAttributes }) {
|
|
32
|
+
return (_jsxs("li", { "data-testid": testId, ...dataAttributes, className: cn("flex items-start gap-2", compact && "gap-1.5"), children: [!compact && (_jsx("span", { className: "flex h-5 w-4 shrink-0 items-center justify-center", children: icon && (_jsx("img", { src: getAbsoluteIconUrl(icon, 16), alt: "", className: "h-4 w-4" })) })), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsxs("span", { className: "text-neutral-grey-100 block leading-5 font-medium", children: [label, identity && (_jsx("span", { className: cn("text-neutral-grey-50 ml-1.5 font-normal", compact ? "text-2xs" : "text-xs"), "data-testid": `${testId}-identity`, children: identity }))] }), _jsx("span", { className: cn("text-neutral-grey-50 block leading-snug", compact ? "text-2xs" : "text-xs"), "data-testid": `${testId}-details`, children: [reason, impact].filter(Boolean).join(" ") })] })] }));
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=PublishReadinessSummary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PublishReadinessSummary.js","sourceRoot":"","sources":["../../../src/editor/ui/PublishReadinessSummary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAChF,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAEL,2BAA2B,EAC3B,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAE5B;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,EACtC,SAAS,EACT,OAAO,GAAG,KAAK,EACf,SAAS,GAKV;IACC,MAAM,QAAQ,GAAG,2BAA2B,CAAC,SAAS,CAAC,CAAC;IACxD,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3B,MAAM,IAAI,GAAG,SAAS,CAAC,WAAW,CAAC;IACnC,OAAO,CACL,MAAC,KAAK,IACJ,OAAO,EAAE,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,iBAChD,2BAA2B,EACvC,SAAS,EAAE,EAAE,CACX,OAAO,IAAI,gDAAgD,EAC3D,SAAS,CACV,aAED,KAAC,aAAa,IAAC,WAAW,EAAE,GAAG,EAAE,SAAS,EAAC,SAAS,GAAG,EACvD,KAAC,UAAU,mBACG,4BAA4B,EACxC,SAAS,EAAC,cAAc,YAEvB,QAAQ,GACE,EACb,KAAC,gBAAgB,IAAC,SAAS,EAAE,EAAE,CAAC,OAAO,IAAI,SAAS,CAAC,YACnD,cAAI,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,OAAO,IAAI,kBAAkB,CAAC,aA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CAAC,IAAI,CAAC,GAAG,CAAC,GACtC,IACF,IACJ,CACN,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { ItemDescriptor, ValidationResult, WorkboxItem } from "../../types";
|
|
2
|
+
export type PublishStatusOutcome = "published" | "pending" | "will-not-publish" | "unknown";
|
|
3
|
+
export type PublishImpact = "none" | "never-published" | "stale" | "other-version" | "unknown";
|
|
4
|
+
export type PublishBlockReason = {
|
|
5
|
+
kind: "workflow";
|
|
6
|
+
workflowState: string;
|
|
7
|
+
} | {
|
|
8
|
+
kind: "no-valid-version";
|
|
9
|
+
} | {
|
|
10
|
+
kind: "not-valid-version";
|
|
11
|
+
validVersion?: number;
|
|
12
|
+
};
|
|
13
|
+
export type PublishReadinessCategory = "will-publish" | "already-published" | "covered-by-subitems" | "blocked-by-workflow" | "will-not-publish";
|
|
14
|
+
export type PublishReadinessEntry = {
|
|
15
|
+
item: WorkboxItem;
|
|
16
|
+
key: string;
|
|
17
|
+
category: PublishReadinessCategory;
|
|
18
|
+
inBatch: boolean;
|
|
19
|
+
reason?: PublishBlockReason;
|
|
20
|
+
impact: PublishImpact;
|
|
21
|
+
affectedTargets: string[];
|
|
22
|
+
targetCount: number;
|
|
23
|
+
validVersion?: number;
|
|
24
|
+
};
|
|
25
|
+
export type CurrentPageReadiness = {
|
|
26
|
+
item: WorkboxItem;
|
|
27
|
+
blockedByWorkflow: boolean;
|
|
28
|
+
reason?: PublishBlockReason;
|
|
29
|
+
impact: PublishImpact;
|
|
30
|
+
affectedTargets: string[];
|
|
31
|
+
targetCount: number;
|
|
32
|
+
validVersion?: number;
|
|
33
|
+
};
|
|
34
|
+
export type PublishReadiness = {
|
|
35
|
+
currentPage?: CurrentPageReadiness;
|
|
36
|
+
entries: PublishReadinessEntry[];
|
|
37
|
+
batchDescriptors: ItemDescriptor[];
|
|
38
|
+
leftBehind: PublishReadinessEntry[];
|
|
39
|
+
};
|
|
40
|
+
export declare function isReadyToPublish(item: WorkboxItem): boolean;
|
|
41
|
+
export declare function classifyPublishStatus(status: string): {
|
|
42
|
+
outcome: PublishStatusOutcome;
|
|
43
|
+
impact: PublishImpact;
|
|
44
|
+
validVersion?: number;
|
|
45
|
+
};
|
|
46
|
+
export type PublishStatusDescription = {
|
|
47
|
+
/** Short badge text, e.g. "Not yet published". */
|
|
48
|
+
label: string;
|
|
49
|
+
/** Optional explanation for a tooltip: published version, revision, name or valid version. */
|
|
50
|
+
detail?: string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Turns a canonical Sitecore publish status into a short badge label plus an
|
|
54
|
+
* optional detail line, so the table stays scannable and the specifics
|
|
55
|
+
* (published revision, currently published version, valid version, published
|
|
56
|
+
* name) move into a tooltip. Unknown statuses are shown verbatim.
|
|
57
|
+
*/
|
|
58
|
+
export declare function describePublishStatus(status: string): PublishStatusDescription;
|
|
59
|
+
/**
|
|
60
|
+
* Compares descriptors the way the workbox does: ids without braces and
|
|
61
|
+
* case-insensitive, languages case-insensitive. A version of 0/undefined means
|
|
62
|
+
* "latest" (the editor keeps the *requested* descriptor when an item is opened
|
|
63
|
+
* from the tree) and matches any concrete version of that item.
|
|
64
|
+
*/
|
|
65
|
+
export declare function isSameDescriptor(a: ItemDescriptor, b: ItemDescriptor): boolean;
|
|
66
|
+
/** The workbox row for the item currently open in the editor, if listed. */
|
|
67
|
+
export declare function findCurrentWorkboxItem(workboxItems: WorkboxItem[], currentItem: ItemDescriptor | undefined): WorkboxItem | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* Display order for the Publish dialog: the current item stays first, then the
|
|
70
|
+
* related items grouped by template name and ordered by item path, so media,
|
|
71
|
+
* layouts and datasources cluster together instead of following the link
|
|
72
|
+
* database's order. Returns a new array; the input is left untouched.
|
|
73
|
+
*/
|
|
74
|
+
export declare function sortWorkboxItemsForPublish(workboxItems: WorkboxItem[], currentItem: ItemDescriptor | undefined): WorkboxItem[];
|
|
75
|
+
export type PublishValidationSummary = {
|
|
76
|
+
/** Listed workbox items that carry at least one validation result. */
|
|
77
|
+
itemCount: number;
|
|
78
|
+
/** All validation results across those items. */
|
|
79
|
+
issueCount: number;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Counts the validation issues that affect the listed workbox items. The
|
|
83
|
+
* server only reports failing validators, so every result is an issue; a
|
|
84
|
+
* page's entry also carries results for its embedded components, which are
|
|
85
|
+
* counted with the page.
|
|
86
|
+
*/
|
|
87
|
+
export declare function getPublishValidationSummary(workboxItems: WorkboxItem[], validationResults: ValidationResult[] | undefined): PublishValidationSummary;
|
|
88
|
+
/** True when `path` lies strictly below `rootPath` (Sitecore paths are case-insensitive). */
|
|
89
|
+
export declare function isDescendantPath(path?: string, rootPath?: string): boolean;
|
|
90
|
+
export declare function getPublishReadiness({ workboxItems, currentItem, pagePath, includeSubitems, }: {
|
|
91
|
+
workboxItems: WorkboxItem[];
|
|
92
|
+
currentItem: ItemDescriptor | undefined;
|
|
93
|
+
pagePath: string | undefined;
|
|
94
|
+
includeSubitems: boolean;
|
|
95
|
+
}): PublishReadiness;
|
|
96
|
+
export declare function getPublishReasonText(reason: PublishBlockReason, affectedTargets: string[], targetCount: number): string;
|
|
97
|
+
export declare function getPublishImpactText(impact: PublishImpact, validVersion?: number): string | undefined;
|
|
98
|
+
export declare function getPublishReadinessHeadline(readiness: PublishReadiness): string | undefined;
|