@parhelia/core 0.2.12783 → 0.2.12786

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.
Files changed (114) hide show
  1. package/dist/editor/ai/AgentImageCopyButton.d.ts +6 -0
  2. package/dist/editor/ai/AgentImageCopyButton.js +93 -0
  3. package/dist/editor/ai/AgentImageCopyButton.js.map +1 -0
  4. package/dist/editor/ai/terminal/components/EditFieldToolCallContent.d.ts +24 -0
  5. package/dist/editor/ai/terminal/components/EditFieldToolCallContent.js +97 -0
  6. package/dist/editor/ai/terminal/components/EditFieldToolCallContent.js.map +1 -0
  7. package/dist/editor/ai/terminal/components/ValueDiff.d.ts +15 -0
  8. package/dist/editor/ai/terminal/components/ValueDiff.js +21 -0
  9. package/dist/editor/ai/terminal/components/ValueDiff.js.map +1 -0
  10. package/dist/editor/ai/terminal/components/agentThinkingStyles.d.ts +1 -0
  11. package/dist/editor/ai/terminal/components/agentThinkingStyles.js +2 -0
  12. package/dist/editor/ai/terminal/components/agentThinkingStyles.js.map +1 -0
  13. package/dist/editor/ai/terminal/components/toolCallContentRenderers.d.ts +15 -0
  14. package/dist/editor/ai/terminal/components/toolCallContentRenderers.js +12 -0
  15. package/dist/editor/ai/terminal/components/toolCallContentRenderers.js.map +1 -0
  16. package/dist/editor/client/hooks/activeSessionSnapshots.d.ts +2 -0
  17. package/dist/editor/client/hooks/activeSessionSnapshots.js +43 -0
  18. package/dist/editor/client/hooks/activeSessionSnapshots.js.map +1 -0
  19. package/dist/editor/client/hooks/operationRefreshDeduplication.d.ts +22 -0
  20. package/dist/editor/client/hooks/operationRefreshDeduplication.js +45 -0
  21. package/dist/editor/client/hooks/operationRefreshDeduplication.js.map +1 -0
  22. package/dist/editor/client/hooks/socketMessageRetention.d.ts +7 -0
  23. package/dist/editor/client/hooks/socketMessageRetention.js +11 -0
  24. package/dist/editor/client/hooks/socketMessageRetention.js.map +1 -0
  25. package/dist/editor/client/hooks/useClientInfoRegistration.d.ts +13 -0
  26. package/dist/editor/client/hooks/useClientInfoRegistration.js +38 -0
  27. package/dist/editor/client/hooks/useClientInfoRegistration.js.map +1 -0
  28. package/dist/editor/client/undoTargetResolution.d.ts +28 -0
  29. package/dist/editor/client/undoTargetResolution.js +69 -0
  30. package/dist/editor/client/undoTargetResolution.js.map +1 -0
  31. package/dist/editor/field-types/singleLineTextValue.d.ts +3 -0
  32. package/dist/editor/field-types/singleLineTextValue.js +9 -0
  33. package/dist/editor/field-types/singleLineTextValue.js.map +1 -0
  34. package/dist/editor/insertOptionCompatibility.d.ts +7 -0
  35. package/dist/editor/insertOptionCompatibility.js +15 -0
  36. package/dist/editor/insertOptionCompatibility.js.map +1 -0
  37. package/dist/editor/media-selector/mediaItemDrag.d.ts +28 -0
  38. package/dist/editor/media-selector/mediaItemDrag.js +42 -0
  39. package/dist/editor/media-selector/mediaItemDrag.js.map +1 -0
  40. package/dist/editor/menubar/toolbar-sections/PreviewModeControl.d.ts +1 -0
  41. package/dist/editor/menubar/toolbar-sections/PreviewModeControl.js +14 -0
  42. package/dist/editor/menubar/toolbar-sections/PreviewModeControl.js.map +1 -0
  43. package/dist/editor/menubar/toolbar-sections/RefreshPageControl.d.ts +7 -0
  44. package/dist/editor/menubar/toolbar-sections/RefreshPageControl.js +44 -0
  45. package/dist/editor/menubar/toolbar-sections/RefreshPageControl.js.map +1 -0
  46. package/dist/editor/page-editor-chrome/InlineFieldHistoryButton.d.ts +58 -0
  47. package/dist/editor/page-editor-chrome/InlineFieldHistoryButton.js +731 -0
  48. package/dist/editor/page-editor-chrome/InlineFieldHistoryButton.js.map +1 -0
  49. package/dist/editor/page-viewer/bridgeInlineAiSelection.d.ts +17 -0
  50. package/dist/editor/page-viewer/bridgeInlineAiSelection.js +80 -0
  51. package/dist/editor/page-viewer/bridgeInlineAiSelection.js.map +1 -0
  52. package/dist/editor/page-viewer/bridgeInlineEditCommit.d.ts +18 -0
  53. package/dist/editor/page-viewer/bridgeInlineEditCommit.js +24 -0
  54. package/dist/editor/page-viewer/bridgeInlineEditCommit.js.map +1 -0
  55. package/dist/editor/page-viewer/bridgeItemChangeTarget.d.ts +9 -0
  56. package/dist/editor/page-viewer/bridgeItemChangeTarget.js +38 -0
  57. package/dist/editor/page-viewer/bridgeItemChangeTarget.js.map +1 -0
  58. package/dist/editor/page-viewer/bridgePointerDragRelease.d.ts +31 -0
  59. package/dist/editor/page-viewer/bridgePointerDragRelease.js +32 -0
  60. package/dist/editor/page-viewer/bridgePointerDragRelease.js.map +1 -0
  61. package/dist/editor/page-viewer/fullscreenPagePath.d.ts +1 -0
  62. package/dist/editor/page-viewer/fullscreenPagePath.js +11 -0
  63. package/dist/editor/page-viewer/fullscreenPagePath.js.map +1 -0
  64. package/dist/editor/page-viewer/internalLinkNavigation.d.ts +9 -0
  65. package/dist/editor/page-viewer/internalLinkNavigation.js +104 -0
  66. package/dist/editor/page-viewer/internalLinkNavigation.js.map +1 -0
  67. package/dist/editor/reviews/FeedbackFilters.d.ts +16 -0
  68. package/dist/editor/reviews/FeedbackFilters.js +45 -0
  69. package/dist/editor/reviews/FeedbackFilters.js.map +1 -0
  70. package/dist/editor/reviews/commentState.d.ts +4 -0
  71. package/dist/editor/reviews/commentState.js +15 -0
  72. package/dist/editor/reviews/commentState.js.map +1 -0
  73. package/dist/editor/settings/index/IndexGenerationsSection.d.ts +8 -0
  74. package/dist/editor/settings/index/IndexGenerationsSection.js +93 -0
  75. package/dist/editor/settings/index/IndexGenerationsSection.js.map +1 -0
  76. package/dist/editor/settings/panels/MemoriesPanel.d.ts +16 -0
  77. package/dist/editor/settings/panels/MemoriesPanel.js +292 -0
  78. package/dist/editor/settings/panels/MemoriesPanel.js.map +1 -0
  79. package/dist/editor/settings/panels/MemoryEntryDialog.d.ts +45 -0
  80. package/dist/editor/settings/panels/MemoryEntryDialog.js +167 -0
  81. package/dist/editor/settings/panels/MemoryEntryDialog.js.map +1 -0
  82. package/dist/editor/settings/panels/RenderingHostsPanel.d.ts +2 -0
  83. package/dist/editor/settings/panels/RenderingHostsPanel.js +63 -0
  84. package/dist/editor/settings/panels/RenderingHostsPanel.js.map +1 -0
  85. package/dist/editor/settings/panels/projectTemplateDuplication.d.ts +5 -0
  86. package/dist/editor/settings/panels/projectTemplateDuplication.js +57 -0
  87. package/dist/editor/settings/panels/projectTemplateDuplication.js.map +1 -0
  88. package/dist/editor/sidebar/WorkboxFilters.d.ts +11 -0
  89. package/dist/editor/sidebar/WorkboxFilters.js +61 -0
  90. package/dist/editor/sidebar/WorkboxFilters.js.map +1 -0
  91. package/dist/editor/version-diff/versionDiffGeometryKeys.d.ts +10 -0
  92. package/dist/editor/version-diff/versionDiffGeometryKeys.js +16 -0
  93. package/dist/editor/version-diff/versionDiffGeometryKeys.js.map +1 -0
  94. package/dist/revision.d.ts +2 -2
  95. package/dist/revision.js +2 -2
  96. package/package.json +1 -1
  97. package/dist/editor/ai/terminal/components/AgentEditHistoryButton.d.ts +0 -5
  98. package/dist/editor/ai/terminal/components/AgentEditHistoryButton.js +0 -12
  99. package/dist/editor/ai/terminal/components/AgentEditHistoryButton.js.map +0 -1
  100. package/dist/editor/ai/terminal/components/AgentThinkingDots.d.ts +0 -5
  101. package/dist/editor/ai/terminal/components/AgentThinkingDots.js +0 -9
  102. package/dist/editor/ai/terminal/components/AgentThinkingDots.js.map +0 -1
  103. package/dist/editor/reviews/CommentsAndFeedback.d.ts +0 -8
  104. package/dist/editor/reviews/CommentsAndFeedback.js +0 -17
  105. package/dist/editor/reviews/CommentsAndFeedback.js.map +0 -1
  106. package/dist/editor/reviews/CreateReviewDetailsStep.d.ts +0 -53
  107. package/dist/editor/reviews/CreateReviewDetailsStep.js +0 -77
  108. package/dist/editor/reviews/CreateReviewDetailsStep.js.map +0 -1
  109. package/dist/splash-screen/ParheliaAssistantChat.d.ts +0 -8
  110. package/dist/splash-screen/ParheliaAssistantChat.js +0 -507
  111. package/dist/splash-screen/ParheliaAssistantChat.js.map +0 -1
  112. package/dist/splash-screen/SplashScreenAgentContext.d.ts +0 -28
  113. package/dist/splash-screen/SplashScreenAgentContext.js +0 -51
  114. package/dist/splash-screen/SplashScreenAgentContext.js.map +0 -1
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Resolves the operation the toolbar/keyboard undo gesture should target.
3
+ *
4
+ * The toolbar derives its "next undoable operation" from the date-sorted
5
+ * history state. Inline-typing saves commit to the server asynchronously and
6
+ * their operation reaches that state via save-ack/websocket merges, so a
7
+ * click shortly after a save can carry a stale target — an older operation
8
+ * that was top of the history before the save. The operations context tracks
9
+ * the most recent locally executed undoable operation; when the requested
10
+ * target is older than (or unaware of) it, the local operation is what the
11
+ * user expects the undo gesture to revert.
12
+ *
13
+ * A requested target that is genuinely newer than the local operation
14
+ * (another tab or user acting after the local save) stays authoritative, as
15
+ * does any explicit per-operation undo — those go through undoOperations and
16
+ * never pass through this resolution.
17
+ */
18
+ export function preferLatestLocalUndoTarget({ requestedOperationId, latestLocalOperation, editHistory, recentlyUndoneIds, historyMode, currentItem, }) {
19
+ if (!latestLocalOperation)
20
+ return requestedOperationId;
21
+ if (latestLocalOperation.id === requestedOperationId) {
22
+ return requestedOperationId;
23
+ }
24
+ if (recentlyUndoneIds.has(latestLocalOperation.id)) {
25
+ return requestedOperationId;
26
+ }
27
+ // Prefer the history's copy when present — it carries later updates the
28
+ // tracked snapshot missed (e.g. the operation was undone in another tab).
29
+ const latestOp = editHistory.find((x) => x.id === latestLocalOperation.id) ??
30
+ latestLocalOperation;
31
+ if (latestOp.undone || !latestOp.canUndo)
32
+ return requestedOperationId;
33
+ // Mirror the scope the toolbar's own selection applies (see
34
+ // UndoRedoControls/undo fallback filters) so the guard never widens what a
35
+ // scoped history view would undo.
36
+ if ((historyMode === "page-centric" || historyMode === "current-version") &&
37
+ currentItem) {
38
+ if (!latestOp.mainItem ||
39
+ latestOp.mainItem.id !== currentItem.id ||
40
+ latestOp.mainItem.language !== currentItem.language) {
41
+ return requestedOperationId;
42
+ }
43
+ if (historyMode === "current-version" &&
44
+ latestOp.mainItem.version !== currentItem.version) {
45
+ return requestedOperationId;
46
+ }
47
+ }
48
+ if (!requestedOperationId)
49
+ return latestOp.id;
50
+ const requestedOp = editHistory.find((x) => x.id === requestedOperationId);
51
+ // The caller resolved a target this client has never executed and that is
52
+ // not in the local history either — the tracked local operation is the only
53
+ // target we can vouch for.
54
+ if (!requestedOp)
55
+ return latestOp.id;
56
+ // Editor operations are UTC-stamped server-side, so a strictly newer date
57
+ // means someone acted after the local save; keep that as the target. Equal
58
+ // or older means the caller picked it from history state that predates the
59
+ // local save.
60
+ const requestedTime = Date.parse(requestedOp.date ?? "");
61
+ const latestTime = Date.parse(latestOp.date ?? "");
62
+ if (Number.isFinite(requestedTime) &&
63
+ Number.isFinite(latestTime) &&
64
+ requestedTime > latestTime) {
65
+ return requestedOperationId;
66
+ }
67
+ return latestOp.id;
68
+ }
69
+ //# sourceMappingURL=undoTargetResolution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"undoTargetResolution.js","sourceRoot":"","sources":["../../../src/editor/client/undoTargetResolution.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,2BAA2B,CAAC,EAC1C,oBAAoB,EACpB,oBAAoB,EACpB,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,WAAW,GAQZ;IACC,IAAI,CAAC,oBAAoB;QAAE,OAAO,oBAAoB,CAAC;IACvD,IAAI,oBAAoB,CAAC,EAAE,KAAK,oBAAoB,EAAE,CAAC;QACrD,OAAO,oBAAoB,CAAC;IAC9B,CAAC;IACD,IAAI,iBAAiB,CAAC,GAAG,CAAC,oBAAoB,CAAC,EAAE,CAAC,EAAE,CAAC;QACnD,OAAO,oBAAoB,CAAC;IAC9B,CAAC;IAED,wEAAwE;IACxE,0EAA0E;IAC1E,MAAM,QAAQ,GACZ,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,oBAAoB,C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C,QAAQ,CAAC,UAAU,CAAC;QAC3B,aAAa,GAAG,UAAU,EAC1B,CAAC;QACD,OAAO,oBAAoB,CAAC;IAC9B,CAAC;IAED,OAAO,QAAQ,CAAC,EAAE,CAAC;AACrB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare function resolveSingleLineTextValue(fieldValue: unknown, isHistoric: boolean, modifiedField: {
2
+ value?: unknown;
3
+ } | undefined): string;
@@ -0,0 +1,9 @@
1
+ export function resolveSingleLineTextValue(fieldValue, isHistoric, modifiedField) {
2
+ const effectiveValue = !isHistoric && modifiedField !== undefined
3
+ ? modifiedField.value
4
+ : fieldValue;
5
+ // null is a deliberate field reset in the edit pipeline. It must remain an
6
+ // explicit empty value instead of falling through to the pre-edit field value.
7
+ return effectiveValue == null ? "" : String(effectiveValue);
8
+ }
9
+ //# sourceMappingURL=singleLineTextValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"singleLineTextValue.js","sourceRoot":"","sources":["../../../src/editor/field-types/singleLineTextValue.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,0BAA0B,CACxC,UAAmB,EACnB,UAAmB,EACnB,aAA8C;IAE9C,MAAM,cAAc,GAClB,CAAC,UAAU,IAAI,aAAa,KAAK,SAAS;QACxC,CAAC,CAAC,aAAa,CAAC,KAAK;QACrB,CAAC,CAAC,UAAU,CAAC;IAEjB,2EAA2E;IAC3E,+EAA+E;IAC/E,OAAO,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;AAC9D,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { InsertOption } from "../types";
2
+ import type { DragObject } from "./client/editContext";
3
+ /**
4
+ * A rendering drag always falls back to its rendering type. Datasource template
5
+ * compatibility is an additional match only when the drag object carries one.
6
+ */
7
+ export declare function insertOptionAcceptsDragObject(insertOption: InsertOption, dragObject: DragObject): boolean;
@@ -0,0 +1,15 @@
1
+ function insertOptionMatchesId(insertOption, id) {
2
+ if (!id)
3
+ return false;
4
+ return (insertOption.typeId === id ||
5
+ insertOption.compatibleTypeIds?.includes(id) === true);
6
+ }
7
+ /**
8
+ * A rendering drag always falls back to its rendering type. Datasource template
9
+ * compatibility is an additional match only when the drag object carries one.
10
+ */
11
+ export function insertOptionAcceptsDragObject(insertOption, dragObject) {
12
+ return (insertOptionMatchesId(insertOption, dragObject.typeId) ||
13
+ insertOptionMatchesId(insertOption, dragObject.templateId));
14
+ }
15
+ //# sourceMappingURL=insertOptionCompatibility.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insertOptionCompatibility.js","sourceRoot":"","sources":["../../src/editor/insertOptionCompatibility.ts"],"names":[],"mappings":"AAGA,SAAS,qBAAqB,CAC5B,YAA0B,EAC1B,EAAsB;IAEtB,IAAI,CAAC,EAAE;QAAE,OAAO,KAAK,CAAC;IAEtB,OAAO,CACL,YAAY,CAAC,MAAM,KAAK,EAAE;QAC1B,YAAY,CAAC,iBAAiB,EAAE,QAAQ,CAAC,EAAE,CAAC,KAAK,IAAI,CACtD,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,6BAA6B,CAC3C,YAA0B,EAC1B,UAAsB;IAEtB,OAAO,CACL,qBAAqB,CAAC,YAAY,EAAE,UAAU,CAAC,MAAM,CAAC;QACtD,qBAAqB,CAAC,YAAY,EAAE,UAAU,CAAC,UAAU,CAAC,CAC3D,CAAC;AACJ,CAAC"}
@@ -0,0 +1,28 @@
1
+ import type { DragEvent as ReactDragEvent } from "react";
2
+ import type { EditContextType } from "../client/editContext";
3
+ import type { ItemDescriptor } from "../pageModel";
4
+ import type { Thumbnail } from "../services/contentService";
5
+ /**
6
+ * Payload marker so a media drag can be told apart from a file drag. The real
7
+ * payload travels through `editContext.dragObject` (same as the content tree);
8
+ * the data transfer entry only exists because Firefox refuses to start a drag
9
+ * without one.
10
+ */
11
+ export declare const MEDIA_ITEM_DRAG_MIME = "application/x-parhelia-media-items";
12
+ type DraggedMediaItem = Thumbnail & {
13
+ language?: string;
14
+ version?: number;
15
+ };
16
+ export declare function toMediaItemDescriptor(item: DraggedMediaItem, fallbackLanguage: string): ItemDescriptor;
17
+ /**
18
+ * Starts dragging media items out of a thumbnail grid. Mirrors the content
19
+ * tree's drag start so the tree's existing drop zones light up and can move the
20
+ * items into another folder.
21
+ */
22
+ export declare function startMediaItemDrag({ event, editContext, items, language, }: {
23
+ event: ReactDragEvent<HTMLElement>;
24
+ editContext: EditContextType | undefined;
25
+ items: DraggedMediaItem[];
26
+ language: string;
27
+ }): void;
28
+ export {};
@@ -0,0 +1,42 @@
1
+ import { setContentTreeItemDragImage, setMultiDragImage, } from "../ui/DragPreview";
2
+ /**
3
+ * Payload marker so a media drag can be told apart from a file drag. The real
4
+ * payload travels through `editContext.dragObject` (same as the content tree);
5
+ * the data transfer entry only exists because Firefox refuses to start a drag
6
+ * without one.
7
+ */
8
+ export const MEDIA_ITEM_DRAG_MIME = "application/x-parhelia-media-items";
9
+ export function toMediaItemDescriptor(item, fallbackLanguage) {
10
+ return {
11
+ id: item.id,
12
+ language: item.language || fallbackLanguage,
13
+ version: item.version ?? 0,
14
+ name: item.name,
15
+ };
16
+ }
17
+ /**
18
+ * Starts dragging media items out of a thumbnail grid. Mirrors the content
19
+ * tree's drag start so the tree's existing drop zones light up and can move the
20
+ * items into another folder.
21
+ */
22
+ export function startMediaItemDrag({ event, editContext, items, language, }) {
23
+ if (!editContext || items.length === 0)
24
+ return;
25
+ try {
26
+ event.dataTransfer.effectAllowed = "move";
27
+ event.dataTransfer.setData(MEDIA_ITEM_DRAG_MIME, items.map((item) => item.id).join(","));
28
+ }
29
+ catch { }
30
+ if (items.length > 1) {
31
+ setMultiDragImage(event, items.length, "media items");
32
+ }
33
+ else {
34
+ setContentTreeItemDragImage(event, items[0].name);
35
+ }
36
+ editContext.dragStart({
37
+ type: "items",
38
+ typeId: items[0]?.templateId ?? "",
39
+ items: items.map((item) => toMediaItemDescriptor(item, language)),
40
+ });
41
+ }
42
+ //# sourceMappingURL=mediaItemDrag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mediaItemDrag.js","sourceRoot":"","sources":["../../../src/editor/media-selector/mediaItemDrag.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAE3B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,oCAAoC,CAAC;AAIzE,MAAM,UAAU,qBAAqB,CACnC,IAAsB,EACtB,gBAAwB;IAExB,OAAO;QACL,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,gBAAgB;QAC3C,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,CAAC;QAC1B,IAAI,EAAE,IAAI,CAAC,IAAI;KAChB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,EACjC,KAAK,EACL,WAAW,EACX,KAAK,EACL,QAAQ,GAMT;IACC,IAAI,CAAC,WAAW,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAE/C,IAAI,CAAC;QACH,KAAK,CAAC,YAAY,CAAC,aAAa,GAAG,MAAM,CAAC;QAC1C,KAAK,CAAC,YAAY,CAAC,OAAO,CACxB,oBAAoB,EACpB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CACvC,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IAEV,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrB,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACxD,CAAC;SAAM,CAAC;QACN,2BAA2B,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAE,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;IAED,WAAW,CAAC,SAAS,CAAC;QACpB,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,IAAI,EAAE;QAClC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,qBAAqB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;KAClE,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function PreviewModeControl(): import("react").JSX.Element | null;
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { EyeIcon } from "lucide-react";
3
+ import { useEditContext } from "../../client/editContext";
4
+ import { SimpleIconButton } from "../../ui/SimpleIconButton";
5
+ export function PreviewModeControl() {
6
+ const editContext = useEditContext();
7
+ if (!editContext)
8
+ return null;
9
+ const isPreview = editContext.mode === "preview";
10
+ return (_jsx(SimpleIconButton, { icon: _jsx(EyeIcon, { className: "h-6 w-6 p-1", strokeWidth: 1 }), label: "Preview", showTooltip: false, size: "large", "data-testid": "preview-mode-button", selected: isPreview, onClick: () => void editContext.changeMode(isPreview ? "edit" : "preview", {
11
+ reason: "toolbar",
12
+ }) }));
13
+ }
14
+ //# sourceMappingURL=PreviewModeControl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PreviewModeControl.js","sourceRoot":"","sources":["../../../../src/editor/menubar/toolbar-sections/PreviewModeControl.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,MAAM,UAAU,kBAAkB;IAChC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IAErC,IAAI,CAAC,WAAW;QAAE,OAAO,IAAI,CAAC;IAE9B,MAAM,SAAS,GAAG,WAAW,CAAC,IAAI,KAAK,SAAS,CAAC;IAEjD,OAAO,CACL,KAAC,gBAAgB,IACf,IAAI,EAAE,KAAC,OAAO,IAAC,SAAS,EAAC,aAAa,EAAC,WAAW,EAAE,CAAC,GAAI,EACzD,KAAK,EAAC,SAAS,EACf,WAAW,EAAE,KAAK,EAClB,IAAI,EAAC,OAAO,iBACA,qBAAqB,EACjC,QAAQ,EAAE,SAAS,EACnB,OAAO,EAAE,GAAG,EAAE,CACZ,KAAK,WAAW,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAAE;YAC1D,MAAM,EAAE,SAAS;SAClB,CAAC,GAEJ,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Manual canvas refresh. A plain click re-renders through whatever path is
3
+ * cheapest — normally the incremental bridge patch, which keeps scroll and
4
+ * caret. Shift-click forces the full iframe reload, for when the incremental
5
+ * patch is itself what produced the wrong DOM.
6
+ */
7
+ export declare function RefreshPageControl(): import("react").JSX.Element | null;
@@ -0,0 +1,44 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { RotateCw } from "lucide-react";
3
+ import { useEffect, useRef, useState } from "react";
4
+ import { useEditContext } from "../../client/editContext";
5
+ import { SimpleIconButton } from "../../ui/SimpleIconButton";
6
+ import { CANVAS_REFRESH_COMPLETED_EVENT } from "../../page-viewer/pageViewContext";
7
+ import { cn } from "../../../lib/utils";
8
+ // The canvas reports completion through CANVAS_REFRESH_COMPLETED_EVENT, but a
9
+ // host without a bridge — or a load that fails outright — may never report at
10
+ // all. Release the button on a timer so it can't stay stuck mid-spin.
11
+ const REFRESH_SPINNER_MAX_MS = 15000;
12
+ /**
13
+ * Manual canvas refresh. A plain click re-renders through whatever path is
14
+ * cheapest — normally the incremental bridge patch, which keeps scroll and
15
+ * caret. Shift-click forces the full iframe reload, for when the incremental
16
+ * patch is itself what produced the wrong DOM.
17
+ */
18
+ export function RefreshPageControl() {
19
+ const editContext = useEditContext();
20
+ const [refreshing, setRefreshing] = useState(false);
21
+ const releaseTimerRef = useRef(undefined);
22
+ useEffect(() => {
23
+ const release = () => {
24
+ if (releaseTimerRef.current)
25
+ clearTimeout(releaseTimerRef.current);
26
+ releaseTimerRef.current = undefined;
27
+ setRefreshing(false);
28
+ };
29
+ window.addEventListener(CANVAS_REFRESH_COMPLETED_EVENT, release);
30
+ return () => {
31
+ window.removeEventListener(CANVAS_REFRESH_COMPLETED_EVENT, release);
32
+ if (releaseTimerRef.current)
33
+ clearTimeout(releaseTimerRef.current);
34
+ };
35
+ }, []);
36
+ if (!editContext)
37
+ return null;
38
+ return (_jsx(SimpleIconButton, { icon: _jsx(RotateCw, { className: cn("h-5 w-5", refreshing && "animate-spin"), strokeWidth: 1 }), label: "Refresh page (shift-click to reload completely)", size: "large", "data-testid": "refresh-canvas-button", disabled: refreshing, onClick: (ev) => {
39
+ setRefreshing(true);
40
+ releaseTimerRef.current = setTimeout(() => setRefreshing(false), REFRESH_SPINNER_MAX_MS);
41
+ editContext.requestRefresh(ev.shiftKey ? "hard" : "immediate");
42
+ } }));
43
+ }
44
+ //# sourceMappingURL=RefreshPageControl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RefreshPageControl.js","sourceRoot":"","sources":["../../../../src/editor/menubar/toolbar-sections/RefreshPageControl.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,8BAA8B,EAAE,MAAM,mCAAmC,CAAC;AACnF,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC,8EAA8E;AAC9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E,CAAC,aAAa,CAAC,KAAK,CAAC,EAC1B,sBAAsB,CACvB,CAAC;YACF,WAAW,CAAC,cAAc,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;QACjE,CAAC,GACD,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,58 @@
1
+ import type { Field, FieldDescriptor } from "../pageModel";
2
+ import type { FieldHistoryItem } from "../../types";
3
+ import type { PageViewContext } from "../page-viewer/pageViewContext";
4
+ import { type OverlayRect } from "./overlay/geometry";
5
+ export declare const INLINE_FIELD_HISTORY_BUTTON_GAP = 6;
6
+ export declare const INLINE_FIELD_HISTORY_BUTTON_SIZE = 24;
7
+ /** The pill stays out of the way until the caret has been still this long. */
8
+ export declare const INLINE_FIELD_HISTORY_IDLE_DELAY_MS = 1000;
9
+ /**
10
+ * The step position survives the pill unmounting (clicking away and back) for
11
+ * {@link QUICK_HISTORY_SESSION_TTL_MS}. Tests reset it so one case cannot leave
12
+ * the next one mid-history.
13
+ */
14
+ export declare function clearInlineFieldHistoryQuickSessions(): void;
15
+ /**
16
+ * Places the pill for a text field above the start of the field's block,
17
+ * left-aligned with it. The block's top-left corner does not move as values
18
+ * change, so stepping through history never relocates the buttons under the
19
+ * pointer (a caret- or line-relative anchor did exactly that). When the block
20
+ * is at the very top of the visible canvas the pill flips under the block —
21
+ * still outside the text. Media fields anchor to the same top-left corner but
22
+ * sit just inside their bounds: the picture chrome owns the space above the
23
+ * image, and the corner keeps the trigger in the same fixed spot as on text
24
+ * fields.
25
+ *
26
+ * The overlay is clipped by the panel hosting the canvas, so a pill that would
27
+ * reach past the visible width drops its label rather than disappearing.
28
+ */
29
+ export declare function calculateInlineFieldHistoryButtonPosition(anchorRect: OverlayRect, options?: {
30
+ anchor?: "block" | "corner";
31
+ controlsWidth?: number;
32
+ labelWidth?: number;
33
+ viewportLeft?: number;
34
+ viewportTop?: number;
35
+ viewportWidth?: number;
36
+ viewportHeight?: number;
37
+ margin?: number;
38
+ }): {
39
+ left: number;
40
+ top: number;
41
+ showLabel: boolean;
42
+ placement: "corner";
43
+ } | {
44
+ left: number;
45
+ top: number;
46
+ showLabel: boolean;
47
+ placement: "above" | "below";
48
+ };
49
+ export declare function formatInlineHistoryEntryLabel(entry: FieldHistoryItem | undefined, index: number, total: number, now?: number): string;
50
+ export declare function resolveInlineFieldDescriptor(pageViewContext: PageViewContext, focusedField?: FieldDescriptor): FieldDescriptor | undefined;
51
+ export declare function InlineFieldHistoryButton({ pageViewContext, field, fieldRect: suppliedFieldRect, testId, onOpenChange, onPointerPresenceChange, }: {
52
+ pageViewContext: PageViewContext;
53
+ field?: Field;
54
+ fieldRect?: OverlayRect;
55
+ testId?: string;
56
+ onOpenChange?: (open: boolean) => void;
57
+ onPointerPresenceChange?: (present: boolean) => void;
58
+ }): import("react").JSX.Element | null;