@parhelia/core 0.3.12832 → 0.3.12833
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/components/emoji/EmojiPicker.d.ts +18 -0
- package/dist/components/emoji/EmojiPicker.js +102 -0
- package/dist/components/emoji/EmojiPicker.js.map +1 -0
- package/dist/components/emoji/EmojiText.d.ts +19 -0
- package/dist/components/emoji/EmojiText.js +30 -0
- package/dist/components/emoji/EmojiText.js.map +1 -0
- package/dist/components/emoji/emojiData.generated.d.ts +2 -0
- package/dist/components/emoji/emojiData.generated.js +1878 -0
- package/dist/components/emoji/emojiData.generated.js.map +1 -0
- package/dist/components/emoji/emojiIndex.d.ts +46 -0
- package/dist/components/emoji/emojiIndex.js +173 -0
- package/dist/components/emoji/emojiIndex.js.map +1 -0
- package/dist/components/emoji/emoticons.d.ts +21 -0
- package/dist/components/emoji/emoticons.js +167 -0
- package/dist/components/emoji/emoticons.js.map +1 -0
- package/dist/components/emoji/textareaInsert.d.ts +19 -0
- package/dist/components/emoji/textareaInsert.js +29 -0
- package/dist/components/emoji/textareaInsert.js.map +1 -0
- package/dist/components/emoji/twemoji.d.ts +30 -0
- package/dist/components/emoji/twemoji.js +84 -0
- package/dist/components/emoji/twemoji.js.map +1 -0
- package/dist/editor/agent-changes/agentChangeTargets.js +6 -0
- package/dist/editor/agent-changes/agentChangeTargets.js.map +1 -1
- package/dist/editor/agent-changes/agentChangeTextHighlight.d.ts +48 -4
- package/dist/editor/agent-changes/agentChangeTextHighlight.js +67 -9
- package/dist/editor/agent-changes/agentChangeTextHighlight.js.map +1 -1
- package/dist/editor/ai/AgentImagePreview.d.ts +13 -0
- package/dist/editor/ai/AgentImagePreview.js +41 -0
- package/dist/editor/ai/AgentImagePreview.js.map +1 -0
- package/dist/editor/ai/terminal/components/CreateItemToolCallContent.js +1 -1
- package/dist/editor/ai/terminal/components/CreateItemToolCallContent.js.map +1 -1
- package/dist/editor/ai/terminal/components/ResponseTurnDuration.js +1 -2
- package/dist/editor/ai/terminal/components/ResponseTurnDuration.js.map +1 -1
- package/dist/editor/ai/terminal/components/ToolCallDiagnosticsPanel.d.ts +6 -0
- package/dist/editor/ai/terminal/components/ToolCallDiagnosticsPanel.js +61 -0
- package/dist/editor/ai/terminal/components/ToolCallDiagnosticsPanel.js.map +1 -0
- package/dist/editor/ai/terminal/toolCallDiagnostics.d.ts +34 -0
- package/dist/editor/ai/terminal/toolCallDiagnostics.js +218 -0
- package/dist/editor/ai/terminal/toolCallDiagnostics.js.map +1 -0
- package/dist/editor/bridge/linkDownload.d.ts +3 -0
- package/dist/editor/bridge/linkDownload.js +52 -0
- package/dist/editor/bridge/linkDownload.js.map +1 -0
- package/dist/editor/client/clipboardStorage.d.ts +10 -0
- package/dist/editor/client/clipboardStorage.js +57 -0
- package/dist/editor/client/clipboardStorage.js.map +1 -0
- package/dist/editor/client/hooks/useRepositoryItemRefresh.d.ts +4 -0
- package/dist/editor/client/hooks/useRepositoryItemRefresh.js +62 -0
- package/dist/editor/client/hooks/useRepositoryItemRefresh.js.map +1 -0
- package/dist/editor/client/liveEditState.d.ts +16 -0
- package/dist/editor/client/liveEditState.js +25 -0
- package/dist/editor/client/liveEditState.js.map +1 -0
- package/dist/editor/client/liveSessionState.d.ts +6 -0
- package/dist/editor/client/liveSessionState.js +20 -0
- package/dist/editor/client/liveSessionState.js.map +1 -0
- package/dist/editor/client/valueStore.d.ts +22 -0
- package/dist/editor/client/valueStore.js +29 -0
- package/dist/editor/client/valueStore.js.map +1 -0
- package/dist/editor/commands/componentClipboardCommands.d.ts +35 -0
- package/dist/editor/commands/componentClipboardCommands.js +271 -0
- package/dist/editor/commands/componentClipboardCommands.js.map +1 -0
- package/dist/editor/commands/componentMenuGroups.d.ts +2 -0
- package/dist/editor/commands/componentMenuGroups.js +43 -0
- package/dist/editor/commands/componentMenuGroups.js.map +1 -0
- package/dist/editor/component-conversion/ComponentTypePickerDialog.d.ts +12 -0
- package/dist/editor/component-conversion/ComponentTypePickerDialog.js +40 -0
- package/dist/editor/component-conversion/ComponentTypePickerDialog.js.map +1 -0
- package/dist/editor/component-conversion/ConversionAiDebugButton.d.ts +17 -0
- package/dist/editor/component-conversion/ConversionAiDebugButton.js +80 -0
- package/dist/editor/component-conversion/ConversionAiDebugButton.js.map +1 -0
- package/dist/editor/component-conversion/ConvertComponentDialog.d.ts +28 -0
- package/dist/editor/component-conversion/ConvertComponentDialog.js +633 -0
- package/dist/editor/component-conversion/ConvertComponentDialog.js.map +1 -0
- package/dist/editor/component-conversion/conversionModel.d.ts +109 -0
- package/dist/editor/component-conversion/conversionModel.js +519 -0
- package/dist/editor/component-conversion/conversionModel.js.map +1 -0
- package/dist/editor/component-conversion/conversionService.d.ts +12 -0
- package/dist/editor/component-conversion/conversionService.js +16 -0
- package/dist/editor/component-conversion/conversionService.js.map +1 -0
- package/dist/editor/component-conversion/conversionTypes.d.ts +214 -0
- package/dist/editor/component-conversion/conversionTypes.js +2 -0
- package/dist/editor/component-conversion/conversionTypes.js.map +1 -0
- package/dist/editor/component-conversion/convertComponentsCommand.d.ts +25 -0
- package/dist/editor/component-conversion/convertComponentsCommand.js +196 -0
- package/dist/editor/component-conversion/convertComponentsCommand.js.map +1 -0
- package/dist/editor/field-types/FieldHistoryBoundary.js +28 -7
- package/dist/editor/field-types/FieldHistoryBoundary.js.map +1 -1
- package/dist/editor/field-types/fieldStyles.d.ts +21 -0
- package/dist/editor/field-types/fieldStyles.js +22 -0
- package/dist/editor/field-types/fieldStyles.js.map +1 -0
- package/dist/editor/field-types/richtext/utils/changeHighlight.d.ts +14 -0
- package/dist/editor/field-types/richtext/utils/changeHighlight.js +12 -1
- package/dist/editor/field-types/richtext/utils/changeHighlight.js.map +1 -1
- package/dist/editor/field-types/richtext/utils/spellCheckText.d.ts +31 -0
- package/dist/editor/field-types/richtext/utils/spellCheckText.js +82 -0
- package/dist/editor/field-types/richtext/utils/spellCheckText.js.map +1 -0
- package/dist/editor/field-types/useFocusedFieldInput.d.ts +13 -0
- package/dist/editor/field-types/useFocusedFieldInput.js +50 -0
- package/dist/editor/field-types/useFocusedFieldInput.js.map +1 -0
- package/dist/editor/field-types/useFormFieldSelectionRange.d.ts +43 -0
- package/dist/editor/field-types/useFormFieldSelectionRange.js +149 -0
- package/dist/editor/field-types/useFormFieldSelectionRange.js.map +1 -0
- package/dist/editor/find-replace/FindReplacePanel.d.ts +11 -0
- package/dist/editor/find-replace/FindReplacePanel.js +311 -0
- package/dist/editor/find-replace/FindReplacePanel.js.map +1 -0
- package/dist/editor/find-replace/findReplaceCommand.d.ts +8 -0
- package/dist/editor/find-replace/findReplaceCommand.js +25 -0
- package/dist/editor/find-replace/findReplaceCommand.js.map +1 -0
- package/dist/editor/find-replace/findReplaceMatches.d.ts +42 -0
- package/dist/editor/find-replace/findReplaceMatches.js +66 -0
- package/dist/editor/find-replace/findReplaceMatches.js.map +1 -0
- package/dist/editor/find-replace/findReplaceStore.d.ts +30 -0
- package/dist/editor/find-replace/findReplaceStore.js +61 -0
- package/dist/editor/find-replace/findReplaceStore.js.map +1 -0
- package/dist/editor/find-replace/findReplaceTargets.d.ts +51 -0
- package/dist/editor/find-replace/findReplaceTargets.js +110 -0
- package/dist/editor/find-replace/findReplaceTargets.js.map +1 -0
- package/dist/editor/find-replace/findReplaceText.d.ts +50 -0
- package/dist/editor/find-replace/findReplaceText.js +189 -0
- package/dist/editor/find-replace/findReplaceText.js.map +1 -0
- package/dist/editor/itemContextMenuGroups.js +10 -1
- package/dist/editor/itemContextMenuGroups.js.map +1 -1
- package/dist/editor/media-selector/MediaDetailsView.d.ts +14 -0
- package/dist/editor/media-selector/MediaDetailsView.js +152 -0
- package/dist/editor/media-selector/MediaDetailsView.js.map +1 -0
- package/dist/editor/media-selector/useMediaFolderDrag.d.ts +26 -0
- package/dist/editor/media-selector/useMediaFolderDrag.js +153 -0
- package/dist/editor/media-selector/useMediaFolderDrag.js.map +1 -0
- package/dist/editor/menubar/toolbar-sections/CommentsToggleControl.d.ts +11 -0
- package/dist/editor/menubar/toolbar-sections/CommentsToggleControl.js +65 -0
- package/dist/editor/menubar/toolbar-sections/CommentsToggleControl.js.map +1 -0
- package/dist/editor/menubar/toolbar-sections/FindReplaceControls.d.ts +6 -0
- package/dist/editor/menubar/toolbar-sections/FindReplaceControls.js +31 -0
- package/dist/editor/menubar/toolbar-sections/FindReplaceControls.js.map +1 -0
- package/dist/editor/menubar/toolbar-sections/SpellCheckToggleControl.d.ts +5 -0
- package/dist/editor/menubar/toolbar-sections/SpellCheckToggleControl.js +16 -0
- package/dist/editor/menubar/toolbar-sections/SpellCheckToggleControl.js.map +1 -0
- package/dist/editor/mobileBottomPanel.d.ts +40 -0
- package/dist/editor/mobileBottomPanel.js +63 -0
- package/dist/editor/mobileBottomPanel.js.map +1 -0
- package/dist/editor/page-editor-chrome/AgentChangeHighlightings.d.ts +3 -6
- package/dist/editor/page-editor-chrome/AgentChangeHighlightings.js +8 -6
- package/dist/editor/page-editor-chrome/AgentChangeHighlightings.js.map +1 -1
- package/dist/editor/page-editor-chrome/BridgePasteCleanupOverlay.d.ts +6 -0
- package/dist/editor/page-editor-chrome/BridgePasteCleanupOverlay.js +100 -0
- package/dist/editor/page-editor-chrome/BridgePasteCleanupOverlay.js.map +1 -0
- package/dist/editor/page-editor-chrome/CanvasOverviewRulerBinding.d.ts +9 -0
- package/dist/editor/page-editor-chrome/CanvasOverviewRulerBinding.js +32 -0
- package/dist/editor/page-editor-chrome/CanvasOverviewRulerBinding.js.map +1 -0
- package/dist/editor/page-editor-chrome/CommentTargetPickerCanvasLayer.d.ts +14 -0
- package/dist/editor/page-editor-chrome/CommentTargetPickerCanvasLayer.js +110 -0
- package/dist/editor/page-editor-chrome/CommentTargetPickerCanvasLayer.js.map +1 -0
- package/dist/editor/page-editor-chrome/ConversionIndicators.d.ts +8 -0
- package/dist/editor/page-editor-chrome/ConversionIndicators.js +75 -0
- package/dist/editor/page-editor-chrome/ConversionIndicators.js.map +1 -0
- package/dist/editor/page-editor-chrome/DiffHighlightOverlay.d.ts +9 -13
- package/dist/editor/page-editor-chrome/DiffHighlightOverlay.js +25 -20
- package/dist/editor/page-editor-chrome/DiffHighlightOverlay.js.map +1 -1
- package/dist/editor/page-editor-chrome/FeedbackLeaderCanvasSegment.d.ts +15 -0
- package/dist/editor/page-editor-chrome/FeedbackLeaderCanvasSegment.js +31 -0
- package/dist/editor/page-editor-chrome/FeedbackLeaderCanvasSegment.js.map +1 -0
- package/dist/editor/page-editor-chrome/FindReplaceHighlightings.d.ts +11 -0
- package/dist/editor/page-editor-chrome/FindReplaceHighlightings.js +120 -0
- package/dist/editor/page-editor-chrome/FindReplaceHighlightings.js.map +1 -0
- package/dist/editor/page-editor-chrome/SpellCheckHighlightings.d.ts +12 -0
- package/dist/editor/page-editor-chrome/SpellCheckHighlightings.js +197 -0
- package/dist/editor/page-editor-chrome/SpellCheckHighlightings.js.map +1 -0
- package/dist/editor/page-editor-chrome/ValidationRulerMarks.d.ts +11 -0
- package/dist/editor/page-editor-chrome/ValidationRulerMarks.js +56 -0
- package/dist/editor/page-editor-chrome/ValidationRulerMarks.js.map +1 -0
- package/dist/editor/page-editor-chrome/overlay/feedbackAnchorMeasurements.d.ts +44 -0
- package/dist/editor/page-editor-chrome/overlay/feedbackAnchorMeasurements.js +89 -0
- package/dist/editor/page-editor-chrome/overlay/feedbackAnchorMeasurements.js.map +1 -0
- package/dist/editor/page-editor-chrome/overlay/feedbackAnchorStore.d.ts +17 -0
- package/dist/editor/page-editor-chrome/overlay/feedbackAnchorStore.js +53 -0
- package/dist/editor/page-editor-chrome/overlay/feedbackAnchorStore.js.map +1 -0
- package/dist/editor/page-editor-chrome/overlay/useBridgeTextRangeRequest.d.ts +11 -0
- package/dist/editor/page-editor-chrome/overlay/useBridgeTextRangeRequest.js +84 -0
- package/dist/editor/page-editor-chrome/overlay/useBridgeTextRangeRequest.js.map +1 -0
- package/dist/editor/page-editor-chrome/overlay/useCommentAnchorMeasurements.d.ts +34 -0
- package/dist/editor/page-editor-chrome/overlay/useCommentAnchorMeasurements.js +229 -0
- package/dist/editor/page-editor-chrome/overlay/useCommentAnchorMeasurements.js.map +1 -0
- package/dist/editor/page-editor-chrome/overlay/useOverlayViewportRight.d.ts +9 -0
- package/dist/editor/page-editor-chrome/overlay/useOverlayViewportRight.js +34 -0
- package/dist/editor/page-editor-chrome/overlay/useOverlayViewportRight.js.map +1 -0
- package/dist/editor/page-editor-chrome/overlay/useSuggestionAnchorMeasurements.d.ts +49 -0
- package/dist/editor/page-editor-chrome/overlay/useSuggestionAnchorMeasurements.js +241 -0
- package/dist/editor/page-editor-chrome/overlay/useSuggestionAnchorMeasurements.js.map +1 -0
- package/dist/editor/page-viewer/CanvasOverviewRuler.d.ts +11 -0
- package/dist/editor/page-viewer/CanvasOverviewRuler.js +65 -0
- package/dist/editor/page-viewer/CanvasOverviewRuler.js.map +1 -0
- package/dist/editor/page-viewer/DynamicRenderingsBar.d.ts +23 -0
- package/dist/editor/page-viewer/DynamicRenderingsBar.js +28 -0
- package/dist/editor/page-viewer/DynamicRenderingsBar.js.map +1 -0
- package/dist/editor/page-viewer/DynamicRenderingsStrip.d.ts +18 -0
- package/dist/editor/page-viewer/DynamicRenderingsStrip.js +29 -0
- package/dist/editor/page-viewer/DynamicRenderingsStrip.js.map +1 -0
- package/dist/editor/page-viewer/FeedbackMargin.d.ts +57 -0
- package/dist/editor/page-viewer/FeedbackMargin.js +377 -0
- package/dist/editor/page-viewer/FeedbackMargin.js.map +1 -0
- package/dist/editor/page-viewer/FeedbackMarginController.d.ts +76 -0
- package/dist/editor/page-viewer/FeedbackMarginController.js +241 -0
- package/dist/editor/page-viewer/FeedbackMarginController.js.map +1 -0
- package/dist/editor/page-viewer/FeedbackMarginMarker.d.ts +16 -0
- package/dist/editor/page-viewer/FeedbackMarginMarker.js +24 -0
- package/dist/editor/page-viewer/FeedbackMarginMarker.js.map +1 -0
- package/dist/editor/page-viewer/FeedbackMarginResizeHandle.d.ts +23 -0
- package/dist/editor/page-viewer/FeedbackMarginResizeHandle.js +105 -0
- package/dist/editor/page-viewer/FeedbackMarginResizeHandle.js.map +1 -0
- package/dist/editor/page-viewer/InteractivePreviewBar.d.ts +24 -0
- package/dist/editor/page-viewer/InteractivePreviewBar.js +31 -0
- package/dist/editor/page-viewer/InteractivePreviewBar.js.map +1 -0
- package/dist/editor/page-viewer/MobileCommentsPanel.d.ts +16 -0
- package/dist/editor/page-viewer/MobileCommentsPanel.js +112 -0
- package/dist/editor/page-viewer/MobileCommentsPanel.js.map +1 -0
- package/dist/editor/page-viewer/RenderingAiCheck.d.ts +18 -0
- package/dist/editor/page-viewer/RenderingAiCheck.js +45 -0
- package/dist/editor/page-viewer/RenderingAiCheck.js.map +1 -0
- package/dist/editor/page-viewer/RenderingApprovalDialog.d.ts +32 -0
- package/dist/editor/page-viewer/RenderingApprovalDialog.js +191 -0
- package/dist/editor/page-viewer/RenderingApprovalDialog.js.map +1 -0
- package/dist/editor/page-viewer/SealedClientCodePreview.d.ts +17 -0
- package/dist/editor/page-viewer/SealedClientCodePreview.js +38 -0
- package/dist/editor/page-viewer/SealedClientCodePreview.js.map +1 -0
- package/dist/editor/page-viewer/canvasFrameNavigation.d.ts +18 -0
- package/dist/editor/page-viewer/canvasFrameNavigation.js +36 -0
- package/dist/editor/page-viewer/canvasFrameNavigation.js.map +1 -0
- package/dist/editor/page-viewer/canvasLoadSettling.d.ts +42 -0
- package/dist/editor/page-viewer/canvasLoadSettling.js +46 -0
- package/dist/editor/page-viewer/canvasLoadSettling.js.map +1 -0
- package/dist/editor/page-viewer/canvasScrollHandoff.d.ts +34 -0
- package/dist/editor/page-viewer/canvasScrollHandoff.js +55 -0
- package/dist/editor/page-viewer/canvasScrollHandoff.js.map +1 -0
- package/dist/editor/page-viewer/compareFrameWidth.d.ts +8 -0
- package/dist/editor/page-viewer/compareFrameWidth.js +25 -0
- package/dist/editor/page-viewer/compareFrameWidth.js.map +1 -0
- package/dist/editor/page-viewer/feedbackMarginLayout.d.ts +119 -0
- package/dist/editor/page-viewer/feedbackMarginLayout.js +155 -0
- package/dist/editor/page-viewer/feedbackMarginLayout.js.map +1 -0
- package/dist/editor/page-viewer/feedbackMarginSources.d.ts +36 -0
- package/dist/editor/page-viewer/feedbackMarginSources.js +196 -0
- package/dist/editor/page-viewer/feedbackMarginSources.js.map +1 -0
- package/dist/editor/page-viewer/feedbackMarginWidth.d.ts +43 -0
- package/dist/editor/page-viewer/feedbackMarginWidth.js +107 -0
- package/dist/editor/page-viewer/feedbackMarginWidth.js.map +1 -0
- package/dist/editor/page-viewer/interactivePreview.d.ts +168 -0
- package/dist/editor/page-viewer/interactivePreview.js +344 -0
- package/dist/editor/page-viewer/interactivePreview.js.map +1 -0
- package/dist/editor/page-viewer/minimapViewport.d.ts +2 -0
- package/dist/editor/page-viewer/minimapViewport.js +34 -0
- package/dist/editor/page-viewer/minimapViewport.js.map +1 -0
- package/dist/editor/page-viewer/openPageItems.d.ts +29 -0
- package/dist/editor/page-viewer/openPageItems.js +73 -0
- package/dist/editor/page-viewer/openPageItems.js.map +1 -0
- package/dist/editor/page-viewer/overviewRuler.d.ts +128 -0
- package/dist/editor/page-viewer/overviewRuler.js +226 -0
- package/dist/editor/page-viewer/overviewRuler.js.map +1 -0
- package/dist/editor/page-viewer/renderingApproval.d.ts +59 -0
- package/dist/editor/page-viewer/renderingApproval.js +186 -0
- package/dist/editor/page-viewer/renderingApproval.js.map +1 -0
- package/dist/editor/page-viewer/renderingChanges.d.ts +29 -0
- package/dist/editor/page-viewer/renderingChanges.js +40 -0
- package/dist/editor/page-viewer/renderingChanges.js.map +1 -0
- package/dist/editor/page-viewer/scrollIntoViewTextRanges.d.ts +23 -0
- package/dist/editor/page-viewer/scrollIntoViewTextRanges.js +26 -0
- package/dist/editor/page-viewer/scrollIntoViewTextRanges.js.map +1 -0
- package/dist/editor/page-viewer/useInteractivePreview.d.ts +77 -0
- package/dist/editor/page-viewer/useInteractivePreview.js +210 -0
- package/dist/editor/page-viewer/useInteractivePreview.js.map +1 -0
- package/dist/editor/reviews/CollapsibleText.d.ts +13 -0
- package/dist/editor/reviews/CollapsibleText.js +41 -0
- package/dist/editor/reviews/CollapsibleText.js.map +1 -0
- package/dist/editor/reviews/CommentImageAttachments.d.ts +12 -0
- package/dist/editor/reviews/CommentImageAttachments.js +19 -0
- package/dist/editor/reviews/CommentImageAttachments.js.map +1 -0
- package/dist/editor/reviews/CommentQuote.d.ts +13 -0
- package/dist/editor/reviews/CommentQuote.js +35 -0
- package/dist/editor/reviews/CommentQuote.js.map +1 -0
- package/dist/editor/reviews/CommentTargetOutline.d.ts +13 -0
- package/dist/editor/reviews/CommentTargetOutline.js +21 -0
- package/dist/editor/reviews/CommentTargetOutline.js.map +1 -0
- package/dist/editor/reviews/CommentTargetPickerDomLayer.d.ts +7 -0
- package/dist/editor/reviews/CommentTargetPickerDomLayer.js +117 -0
- package/dist/editor/reviews/CommentTargetPickerDomLayer.js.map +1 -0
- package/dist/editor/reviews/CommentThreadAgentLink.d.ts +28 -0
- package/dist/editor/reviews/CommentThreadAgentLink.js +37 -0
- package/dist/editor/reviews/CommentThreadAgentLink.js.map +1 -0
- package/dist/editor/reviews/CommentThreadCard.d.ts +34 -0
- package/dist/editor/reviews/CommentThreadCard.js +156 -0
- package/dist/editor/reviews/CommentThreadCard.js.map +1 -0
- package/dist/editor/reviews/SuggestionThreadCard.d.ts +19 -0
- package/dist/editor/reviews/SuggestionThreadCard.js +25 -0
- package/dist/editor/reviews/SuggestionThreadCard.js.map +1 -0
- package/dist/editor/reviews/addCommentOnTarget.d.ts +22 -0
- package/dist/editor/reviews/addCommentOnTarget.js +32 -0
- package/dist/editor/reviews/addCommentOnTarget.js.map +1 -0
- package/dist/editor/reviews/balloonLayout.d.ts +51 -0
- package/dist/editor/reviews/balloonLayout.js +101 -0
- package/dist/editor/reviews/balloonLayout.js.map +1 -0
- package/dist/editor/reviews/commentAgentAttachments.d.ts +5 -0
- package/dist/editor/reviews/commentAgentAttachments.js +51 -0
- package/dist/editor/reviews/commentAgentAttachments.js.map +1 -0
- package/dist/editor/reviews/commentImages.d.ts +48 -0
- package/dist/editor/reviews/commentImages.js +128 -0
- package/dist/editor/reviews/commentImages.js.map +1 -0
- package/dist/editor/reviews/commentTargetPicker.d.ts +114 -0
- package/dist/editor/reviews/commentTargetPicker.js +153 -0
- package/dist/editor/reviews/commentTargetPicker.js.map +1 -0
- package/dist/editor/reviews/feedbackBalloonDate.d.ts +8 -0
- package/dist/editor/reviews/feedbackBalloonDate.js +22 -0
- package/dist/editor/reviews/feedbackBalloonDate.js.map +1 -0
- package/dist/editor/reviews/feedbackDrafts.d.ts +49 -0
- package/dist/editor/reviews/feedbackDrafts.js +74 -0
- package/dist/editor/reviews/feedbackDrafts.js.map +1 -0
- package/dist/editor/reviews/feedbackHoverState.d.ts +18 -0
- package/dist/editor/reviews/feedbackHoverState.js +35 -0
- package/dist/editor/reviews/feedbackHoverState.js.map +1 -0
- package/dist/editor/reviews/feedbackPersonFilter.d.ts +3 -0
- package/dist/editor/reviews/feedbackPersonFilter.js +32 -0
- package/dist/editor/reviews/feedbackPersonFilter.js.map +1 -0
- package/dist/editor/reviews/feedbackThreadSelection.d.ts +10 -0
- package/dist/editor/reviews/feedbackThreadSelection.js +31 -0
- package/dist/editor/reviews/feedbackThreadSelection.js.map +1 -0
- package/dist/editor/reviews/feedbackThreads.d.ts +50 -0
- package/dist/editor/reviews/feedbackThreads.js +135 -0
- package/dist/editor/reviews/feedbackThreads.js.map +1 -0
- package/dist/editor/reviews/feedbackWheelForwarding.d.ts +34 -0
- package/dist/editor/reviews/feedbackWheelForwarding.js +108 -0
- package/dist/editor/reviews/feedbackWheelForwarding.js.map +1 -0
- package/dist/editor/reviews/reviewUrlScope.d.ts +23 -0
- package/dist/editor/reviews/reviewUrlScope.js +86 -0
- package/dist/editor/reviews/reviewUrlScope.js.map +1 -0
- package/dist/editor/reviews/scrollWithin.d.ts +29 -0
- package/dist/editor/reviews/scrollWithin.js +87 -0
- package/dist/editor/reviews/scrollWithin.js.map +1 -0
- package/dist/editor/reviews/subtreeFeedback.d.ts +57 -0
- package/dist/editor/reviews/subtreeFeedback.js +137 -0
- package/dist/editor/reviews/subtreeFeedback.js.map +1 -0
- package/dist/editor/reviews/useCommentImagePaste.d.ts +80 -0
- package/dist/editor/reviews/useCommentImagePaste.js +252 -0
- package/dist/editor/reviews/useCommentImagePaste.js.map +1 -0
- package/dist/editor/reviews/useFeedbackThreads.d.ts +35 -0
- package/dist/editor/reviews/useFeedbackThreads.js +137 -0
- package/dist/editor/reviews/useFeedbackThreads.js.map +1 -0
- package/dist/editor/reviews/useMeasuredHeights.d.ts +25 -0
- package/dist/editor/reviews/useMeasuredHeights.js +176 -0
- package/dist/editor/reviews/useMeasuredHeights.js.map +1 -0
- package/dist/editor/reviews/usePendingFeedbackFocus.d.ts +7 -0
- package/dist/editor/reviews/usePendingFeedbackFocus.js +42 -0
- package/dist/editor/reviews/usePendingFeedbackFocus.js.map +1 -0
- package/dist/editor/services/mcpAccessService.d.ts +93 -0
- package/dist/editor/services/mcpAccessService.js +41 -0
- package/dist/editor/services/mcpAccessService.js.map +1 -0
- package/dist/editor/services/previewTokenService.d.ts +14 -0
- package/dist/editor/services/previewTokenService.js +34 -0
- package/dist/editor/services/previewTokenService.js.map +1 -0
- package/dist/editor/services/renderingsService.d.ts +117 -0
- package/dist/editor/services/renderingsService.js +245 -0
- package/dist/editor/services/renderingsService.js.map +1 -0
- package/dist/editor/services/spellCheckService.d.ts +13 -0
- package/dist/editor/services/spellCheckService.js +33 -0
- package/dist/editor/services/spellCheckService.js.map +1 -0
- package/dist/editor/settings/panels/McpAccessPanel.d.ts +7 -0
- package/dist/editor/settings/panels/McpAccessPanel.js +95 -0
- package/dist/editor/settings/panels/McpAccessPanel.js.map +1 -0
- package/dist/editor/settings/panels/McpAccessSettingsView.d.ts +8 -0
- package/dist/editor/settings/panels/McpAccessSettingsView.js +221 -0
- package/dist/editor/settings/panels/McpAccessSettingsView.js.map +1 -0
- package/dist/editor/settings/panels/SpellCheckPanel.d.ts +8 -0
- package/dist/editor/settings/panels/SpellCheckPanel.js +253 -0
- package/dist/editor/settings/panels/SpellCheckPanel.js.map +1 -0
- package/dist/editor/sidebar/FeedbackSidebar.d.ts +7 -0
- package/dist/editor/sidebar/FeedbackSidebar.js +300 -0
- package/dist/editor/sidebar/FeedbackSidebar.js.map +1 -0
- package/dist/editor/sidebar/OperationDetailsContent.js +50 -0
- package/dist/editor/sidebar/OperationDetailsContent.js.map +1 -1
- package/dist/editor/sidebar/liveComponentThumbnails.d.ts +19 -6
- package/dist/editor/sidebar/liveComponentThumbnails.js +39 -18
- package/dist/editor/sidebar/liveComponentThumbnails.js.map +1 -1
- package/dist/editor/spellcheck/canvasSpellCheckContextMenu.d.ts +30 -0
- package/dist/editor/spellcheck/canvasSpellCheckContextMenu.js +69 -0
- package/dist/editor/spellcheck/canvasSpellCheckContextMenu.js.map +1 -0
- package/dist/editor/spellcheck/htmlSpellDocument.d.ts +60 -0
- package/dist/editor/spellcheck/htmlSpellDocument.js +181 -0
- package/dist/editor/spellcheck/htmlSpellDocument.js.map +1 -0
- package/dist/editor/spellcheck/htmlSpellTokenizer.d.ts +45 -0
- package/dist/editor/spellcheck/htmlSpellTokenizer.js +277 -0
- package/dist/editor/spellcheck/htmlSpellTokenizer.js.map +1 -0
- package/dist/editor/spellcheck/replacementGuard.d.ts +27 -0
- package/dist/editor/spellcheck/replacementGuard.js +29 -0
- package/dist/editor/spellcheck/replacementGuard.js.map +1 -0
- package/dist/editor/spellcheck/spellCheckCanvasStore.d.ts +17 -0
- package/dist/editor/spellcheck/spellCheckCanvasStore.js +37 -0
- package/dist/editor/spellcheck/spellCheckCanvasStore.js.map +1 -0
- package/dist/editor/spellcheck/spellCheckCanvasTargets.d.ts +71 -0
- package/dist/editor/spellcheck/spellCheckCanvasTargets.js +126 -0
- package/dist/editor/spellcheck/spellCheckCanvasTargets.js.map +1 -0
- package/dist/editor/spellcheck/spellCheckClient.d.ts +66 -0
- package/dist/editor/spellcheck/spellCheckClient.js +0 -0
- package/dist/editor/spellcheck/spellCheckClient.js.map +1 -0
- package/dist/editor/spellcheck/spellCheckContextMenu.d.ts +52 -0
- package/dist/editor/spellcheck/spellCheckContextMenu.js +120 -0
- package/dist/editor/spellcheck/spellCheckContextMenu.js.map +1 -0
- package/dist/editor/spellcheck/spellCheckReplace.d.ts +8 -0
- package/dist/editor/spellcheck/spellCheckReplace.js +20 -0
- package/dist/editor/spellcheck/spellCheckReplace.js.map +1 -0
- package/dist/editor/spellcheck/spellCheckStyles.d.ts +11 -0
- package/dist/editor/spellcheck/spellCheckStyles.js +12 -0
- package/dist/editor/spellcheck/spellCheckStyles.js.map +1 -0
- package/dist/editor/spellcheck/spellCheckTypes.d.ts +94 -0
- package/dist/editor/spellcheck/spellCheckTypes.js +2 -0
- package/dist/editor/spellcheck/spellCheckTypes.js.map +1 -0
- package/dist/editor/spellcheck/textMarkHitTest.d.ts +14 -0
- package/dist/editor/spellcheck/textMarkHitTest.js +39 -0
- package/dist/editor/spellcheck/textMarkHitTest.js.map +1 -0
- package/dist/editor/spellcheck/useSpellCheck.d.ts +16 -0
- package/dist/editor/spellcheck/useSpellCheck.js +57 -0
- package/dist/editor/spellcheck/useSpellCheck.js.map +1 -0
- package/dist/editor/ui/DynamicRenderingsPublishWarning.d.ts +14 -0
- package/dist/editor/ui/DynamicRenderingsPublishWarning.js +40 -0
- package/dist/editor/ui/DynamicRenderingsPublishWarning.js.map +1 -0
- package/dist/editor/ui/ParheliaMark.d.ts +15 -0
- package/dist/editor/ui/ParheliaMark.js +12 -0
- package/dist/editor/ui/ParheliaMark.js.map +1 -0
- package/dist/editor/ui/RootItemPicker.d.ts +18 -0
- package/dist/editor/ui/RootItemPicker.js +112 -0
- package/dist/editor/ui/RootItemPicker.js.map +1 -0
- package/dist/editor/undoEligibility.d.ts +2 -0
- package/dist/editor/undoEligibility.js +8 -0
- package/dist/editor/undoEligibility.js.map +1 -0
- package/dist/editor/utils/dataTransferImages.d.ts +7 -0
- package/dist/editor/utils/dataTransferImages.js +43 -0
- package/dist/editor/utils/dataTransferImages.js.map +1 -0
- package/dist/editor/validation/navigateToValidationIssue.d.ts +2 -2
- package/dist/editor/validation/navigateToValidationIssue.js +1 -1
- package/dist/editor/validation/navigateToValidationIssue.js.map +1 -1
- package/dist/editor/validation/validationRulerIssues.d.ts +17 -0
- package/dist/editor/validation/validationRulerIssues.js +44 -0
- package/dist/editor/validation/validationRulerIssues.js.map +1 -0
- package/dist/revision.d.ts +2 -2
- package/dist/revision.js +2 -2
- package/dist/task-board/components/AttentionPromptDialog.d.ts +13 -0
- package/dist/task-board/components/AttentionPromptDialog.js +45 -0
- package/dist/task-board/components/AttentionPromptDialog.js.map +1 -0
- package/dist/task-board/components/GoalFindingsTable.d.ts +43 -0
- package/dist/task-board/components/GoalFindingsTable.js +160 -0
- package/dist/task-board/components/GoalFindingsTable.js.map +1 -0
- package/dist/task-board/components/IssuePanel.d.ts +31 -0
- package/dist/task-board/components/IssuePanel.js +268 -0
- package/dist/task-board/components/IssuePanel.js.map +1 -0
- package/dist/task-board/components/SubgoalFindings.d.ts +40 -0
- package/dist/task-board/components/SubgoalFindings.js +88 -0
- package/dist/task-board/components/SubgoalFindings.js.map +1 -0
- package/dist/task-board/services/issueService.d.ts +193 -0
- package/dist/task-board/services/issueService.js +97 -0
- package/dist/task-board/services/issueService.js.map +1 -0
- package/dist/task-board/taskBlockers.d.ts +10 -0
- package/dist/task-board/taskBlockers.js +66 -0
- package/dist/task-board/taskBlockers.js.map +1 -0
- package/dist/task-board/utils/projectDashboardModel.js +14 -0
- package/dist/task-board/utils/projectDashboardModel.js.map +1 -1
- package/dist/task-board/views/ProjectDashboardView.js +5 -13
- package/dist/task-board/views/ProjectDashboardView.js.map +1 -1
- package/dist/tour/sandbox-tour-copy.d.ts +8 -0
- package/dist/tour/sandbox-tour-copy.js +8 -0
- package/dist/tour/sandbox-tour-copy.js.map +1 -1
- package/dist/tour/sandbox-tour.d.ts +3 -0
- package/dist/tour/sandbox-tour.js +107 -3
- package/dist/tour/sandbox-tour.js.map +1 -1
- package/package.json +1 -1
- package/dist/editor/page-editor-chrome/bridgeLinkValue.d.ts +0 -10
- package/dist/editor/page-editor-chrome/bridgeLinkValue.js +0 -55
- package/dist/editor/page-editor-chrome/bridgeLinkValue.js.map +0 -1
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
2
|
+
import { getFeedbackAnchor, } from "../page-editor-chrome/overlay/feedbackAnchorMeasurements";
|
|
3
|
+
import { useFeedbackAnchors } from "../page-editor-chrome/overlay/feedbackAnchorStore";
|
|
4
|
+
import { useOverlayMeasurement } from "../page-editor-chrome/overlay/useOverlayMeasurement";
|
|
5
|
+
import { resolveMarginAnchors, } from "./feedbackMarginLayout";
|
|
6
|
+
import { usePageViewState } from "./pageViewContext";
|
|
7
|
+
/**
|
|
8
|
+
* Remembered anchors are shared by every surface of one page: the margin
|
|
9
|
+
* and the mobile panel are never mounted together, and a thread that lost
|
|
10
|
+
* its measurement in one keeps its place when the other takes over.
|
|
11
|
+
*/
|
|
12
|
+
const rememberedAnchors = new Map();
|
|
13
|
+
/**
|
|
14
|
+
* The anchor of every listed thread, with a short memory: a thread that
|
|
15
|
+
* loses its canvas measurement while it is still listed (a suggestion that
|
|
16
|
+
* was just applied or rejected no longer marks the canvas, a page re-render
|
|
17
|
+
* briefly drops a target) keeps its last known anchor, so its card stays
|
|
18
|
+
* beside its text instead of jumping into the "content not shown" footer.
|
|
19
|
+
* Only for a moment, though: text that is really gone (component deleted or
|
|
20
|
+
* hidden) sends its card to the footer once the memory expires.
|
|
21
|
+
*/
|
|
22
|
+
export function useRememberedMarginAnchors(threads, measure) {
|
|
23
|
+
const [anchorExpiryEpoch, setAnchorExpiryEpoch] = useState(0);
|
|
24
|
+
const { anchors, nextExpiry } = useMemo(() => resolveMarginAnchors(threads, measure, rememberedAnchors, Date.now()),
|
|
25
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- the epoch re-runs the expiry
|
|
26
|
+
[threads, measure, anchorExpiryEpoch]);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (nextExpiry === undefined)
|
|
29
|
+
return;
|
|
30
|
+
const timer = window.setTimeout(() => setAnchorExpiryEpoch((epoch) => epoch + 1), Math.max(0, nextExpiry - Date.now()) + 1);
|
|
31
|
+
return () => window.clearTimeout(timer);
|
|
32
|
+
}, [nextExpiry, anchorExpiryEpoch]);
|
|
33
|
+
return anchors;
|
|
34
|
+
}
|
|
35
|
+
function layerMetricsEqual(a, b) {
|
|
36
|
+
return a.layerHeight === b.layerHeight && a.scrollTop === b.scrollTop;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The canvas as the margin's surface. Anchors come from the canvas overlay's
|
|
40
|
+
* own measurements (published by the highlight components), so a card can
|
|
41
|
+
* only ever sit where its highlight is; the margin does not measure on its
|
|
42
|
+
* own. Must run inside the margin's `IframeOverlayProvider`.
|
|
43
|
+
*/
|
|
44
|
+
export function useCanvasMarginSource(pageViewContext) {
|
|
45
|
+
const editorIframe = usePageViewState(pageViewContext, (state) => state.editorIframe);
|
|
46
|
+
const { comments, suggestions } = useFeedbackAnchors(editorIframe);
|
|
47
|
+
const layerMetrics = useOverlayMeasurement((metrics) => {
|
|
48
|
+
const scale = metrics.scrollScale * metrics.visualScale;
|
|
49
|
+
return {
|
|
50
|
+
layerHeight: Math.max(metrics.scrollHeight * scale, metrics.viewportHeight),
|
|
51
|
+
scrollTop: metrics.scrollTop * scale,
|
|
52
|
+
};
|
|
53
|
+
}, [], {
|
|
54
|
+
initialValue: { layerHeight: 0, scrollTop: 0 },
|
|
55
|
+
equals: layerMetricsEqual,
|
|
56
|
+
interests: ["viewport", "layout"],
|
|
57
|
+
});
|
|
58
|
+
const measure = useCallback((thread) => getFeedbackAnchor(thread.kind === "comment"
|
|
59
|
+
? comments[thread.id]
|
|
60
|
+
: suggestions[thread.id]) ?? undefined, [comments, suggestions]);
|
|
61
|
+
return { measure, layerMetrics };
|
|
62
|
+
}
|
|
63
|
+
const normalizeId = (id) => (id ?? "").replace(/[{}-]/g, "").toLowerCase();
|
|
64
|
+
function getThreadTarget(thread) {
|
|
65
|
+
const target = thread.kind === "comment" ? thread.root : thread.suggestion;
|
|
66
|
+
return { itemId: target.itemId, fieldId: target.fieldId };
|
|
67
|
+
}
|
|
68
|
+
/** Where the label line of a form field sits below the field's top edge. */
|
|
69
|
+
const FORM_FIELD_LEADER_OFFSET = 10;
|
|
70
|
+
/**
|
|
71
|
+
* Anchors every thread to its field in the item form (`[data-field-id]`
|
|
72
|
+
* elements under `form`), in coordinates relative to the form's top. A thread
|
|
73
|
+
* without a field is about the item itself and anchors to the top of the
|
|
74
|
+
* form. Threads whose field is not rendered (a field of another item, a
|
|
75
|
+
* collapsed or hidden section) get no anchor and end up in the margin's
|
|
76
|
+
* footer.
|
|
77
|
+
*/
|
|
78
|
+
export function measureFormAnchors(form, threads) {
|
|
79
|
+
const origin = form.getBoundingClientRect();
|
|
80
|
+
const fields = Array.from(form.querySelectorAll("[data-field-id]")).map((element) => ({
|
|
81
|
+
element,
|
|
82
|
+
fieldId: normalizeId(element.getAttribute("data-field-id")),
|
|
83
|
+
itemId: normalizeId(element.getAttribute("data-itemid")),
|
|
84
|
+
}));
|
|
85
|
+
const anchors = {};
|
|
86
|
+
for (const thread of threads) {
|
|
87
|
+
const target = getThreadTarget(thread);
|
|
88
|
+
const itemId = normalizeId(target.itemId);
|
|
89
|
+
if (!target.fieldId) {
|
|
90
|
+
// Every listed thread belongs to the item this form edits, so a thread
|
|
91
|
+
// without a field is about the item as a whole. Its `itemId` is not
|
|
92
|
+
// checked: older comments carry whatever was selected back then.
|
|
93
|
+
anchors[thread.id] = {
|
|
94
|
+
y: 0,
|
|
95
|
+
lineMidY: FORM_FIELD_LEADER_OFFSET,
|
|
96
|
+
xStart: 0,
|
|
97
|
+
xEnd: origin.width,
|
|
98
|
+
height: 0,
|
|
99
|
+
};
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
const fieldId = normalizeId(target.fieldId);
|
|
103
|
+
const field = fields.find((candidate) => candidate.fieldId === fieldId && candidate.itemId === itemId);
|
|
104
|
+
if (!field)
|
|
105
|
+
continue;
|
|
106
|
+
const rect = field.element.getBoundingClientRect();
|
|
107
|
+
// A field inside a collapsed section is in the DOM without a box.
|
|
108
|
+
if (rect.height <= 0 && rect.width <= 0)
|
|
109
|
+
continue;
|
|
110
|
+
const y = rect.top - origin.top;
|
|
111
|
+
anchors[thread.id] = {
|
|
112
|
+
y,
|
|
113
|
+
lineMidY: y + Math.min(FORM_FIELD_LEADER_OFFSET, rect.height / 2),
|
|
114
|
+
xStart: rect.left - origin.left,
|
|
115
|
+
xEnd: rect.right - origin.left,
|
|
116
|
+
height: rect.height,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
return anchors;
|
|
120
|
+
}
|
|
121
|
+
function anchorsEqual(a, b) {
|
|
122
|
+
const keys = Object.keys(a);
|
|
123
|
+
if (keys.length !== Object.keys(b).length)
|
|
124
|
+
return false;
|
|
125
|
+
return keys.every((key) => {
|
|
126
|
+
const left = a[key];
|
|
127
|
+
const right = b[key];
|
|
128
|
+
return (!!right &&
|
|
129
|
+
Math.abs(left.y - right.y) < 0.5 &&
|
|
130
|
+
Math.abs(left.height - right.height) < 0.5 &&
|
|
131
|
+
Math.abs(left.xEnd - right.xEnd) < 0.5);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* The item form as the margin's surface. The column scrolls natively with the
|
|
136
|
+
* form (both live in `scroller`), so anchors are plain offsets from the top
|
|
137
|
+
* of `form`, re-measured whenever the form changes size or structure.
|
|
138
|
+
*/
|
|
139
|
+
export function useFormMarginSource(scroller, form, threads) {
|
|
140
|
+
const [anchors, setAnchors] = useState({});
|
|
141
|
+
const [layerMetrics, setLayerMetrics] = useState({
|
|
142
|
+
layerHeight: 0,
|
|
143
|
+
scrollTop: 0,
|
|
144
|
+
});
|
|
145
|
+
const threadsRef = useRef(threads);
|
|
146
|
+
threadsRef.current = threads;
|
|
147
|
+
const measureNow = useCallback(() => {
|
|
148
|
+
if (!scroller || !form)
|
|
149
|
+
return;
|
|
150
|
+
const nextAnchors = measureFormAnchors(form, threadsRef.current);
|
|
151
|
+
setAnchors((current) => anchorsEqual(current, nextAnchors) ? current : nextAnchors);
|
|
152
|
+
const nextMetrics = {
|
|
153
|
+
layerHeight: Math.max(form.offsetHeight, scroller.clientHeight),
|
|
154
|
+
scrollTop: scroller.scrollTop,
|
|
155
|
+
};
|
|
156
|
+
setLayerMetrics((current) => layerMetricsEqual(current, nextMetrics) ? current : nextMetrics);
|
|
157
|
+
}, [scroller, form]);
|
|
158
|
+
useEffect(() => {
|
|
159
|
+
if (!scroller || !form)
|
|
160
|
+
return;
|
|
161
|
+
let frame = null;
|
|
162
|
+
const schedule = () => {
|
|
163
|
+
if (frame != null)
|
|
164
|
+
return;
|
|
165
|
+
frame = window.requestAnimationFrame(() => {
|
|
166
|
+
frame = null;
|
|
167
|
+
measureNow();
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
measureNow();
|
|
171
|
+
const resizeObserver = typeof ResizeObserver === "undefined"
|
|
172
|
+
? null
|
|
173
|
+
: new ResizeObserver(schedule);
|
|
174
|
+
resizeObserver?.observe(form);
|
|
175
|
+
resizeObserver?.observe(scroller);
|
|
176
|
+
const mutationObserver = typeof MutationObserver === "undefined"
|
|
177
|
+
? null
|
|
178
|
+
: new MutationObserver(schedule);
|
|
179
|
+
mutationObserver?.observe(form, { childList: true, subtree: true });
|
|
180
|
+
scroller.addEventListener("scroll", schedule, { passive: true });
|
|
181
|
+
return () => {
|
|
182
|
+
resizeObserver?.disconnect();
|
|
183
|
+
mutationObserver?.disconnect();
|
|
184
|
+
scroller.removeEventListener("scroll", schedule);
|
|
185
|
+
if (frame != null)
|
|
186
|
+
window.cancelAnimationFrame(frame);
|
|
187
|
+
};
|
|
188
|
+
}, [scroller, form, measureNow]);
|
|
189
|
+
// New or filtered threads need their anchors right away.
|
|
190
|
+
useEffect(() => {
|
|
191
|
+
measureNow();
|
|
192
|
+
}, [threads, measureNow]);
|
|
193
|
+
const measure = useCallback((thread) => anchors[thread.id], [anchors]);
|
|
194
|
+
return { measure, layerMetrics };
|
|
195
|
+
}
|
|
196
|
+
//# sourceMappingURL=feedbackMarginSources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedbackMarginSources.js","sourceRoot":"","sources":["../../../src/editor/page-viewer/feedbackMarginSources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EAEL,iBAAiB,GAClB,MAAM,0DAA0D,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAM5F,OAAO,EAEL,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAwB,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE3E;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAA4B,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,UAAU,0BAA0B,CACxC,OAAkC,EAClC,OAA+D;IAE/D,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC9D,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,OAAO,CACrC,GAAG,EAAE,CAAC,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC;IAC3E,uFAAuF;IACvF,CAAC,OAAO,EAAE,OAAO,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AO,GAAG,WAAW,CACzB,CAAC,MAAsB,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,EAC9C,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** Width of the full column unless the user resized it. */
|
|
2
|
+
export declare const FEEDBACK_MARGIN_DEFAULT_WIDTH = 320;
|
|
3
|
+
/** The full column narrows down to this before it collapses into the rail. */
|
|
4
|
+
export declare const FEEDBACK_MARGIN_MIN_WIDTH = 200;
|
|
5
|
+
/** The widest the user can drag the column. */
|
|
6
|
+
export declare const FEEDBACK_MARGIN_MAX_WIDTH = 640;
|
|
7
|
+
/** Width of the rail of markers the column collapses into. */
|
|
8
|
+
export declare const FEEDBACK_MARGIN_RAIL_WIDTH = 40;
|
|
9
|
+
/**
|
|
10
|
+
* Dragging the column's edge below this collapses it into the rail, and
|
|
11
|
+
* dragging the rail's edge past it opens the column again. Halfway between
|
|
12
|
+
* the two, so a drag holds the column at its minimum before it snaps.
|
|
13
|
+
*/
|
|
14
|
+
export declare const FEEDBACK_MARGIN_COLLAPSE_WIDTH: number;
|
|
15
|
+
/** Arrow keys on the resize handle move the edge by this much. */
|
|
16
|
+
export declare const FEEDBACK_MARGIN_RESIZE_STEP = 16;
|
|
17
|
+
export declare function clampFeedbackMarginWidth(width: number, limit?: number): number;
|
|
18
|
+
export declare function getFeedbackMarginPreferredWidth(): number;
|
|
19
|
+
/**
|
|
20
|
+
* The width the user gave the comment margin, shared by the canvas and the
|
|
21
|
+
* form margin and kept per browser. It is a preference: a pane without room
|
|
22
|
+
* for it still narrows the column or shows the rail.
|
|
23
|
+
*/
|
|
24
|
+
export declare function useFeedbackMarginPreferredWidth(): number;
|
|
25
|
+
/**
|
|
26
|
+
* Whether the user collapsed the canvas margin into its rail by dragging its
|
|
27
|
+
* edge past the minimum; kept per browser. The preferred width is kept for
|
|
28
|
+
* when the column opens again.
|
|
29
|
+
*/
|
|
30
|
+
export declare function useFeedbackMarginCollapsed(): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* `persist: false` while dragging (every pointer move re-renders the column);
|
|
33
|
+
* the drag's end stores the final width.
|
|
34
|
+
*/
|
|
35
|
+
export declare function setFeedbackMarginPreferredWidth(width: number, { persist }?: {
|
|
36
|
+
persist?: boolean;
|
|
37
|
+
}): void;
|
|
38
|
+
/** `persist` as for setFeedbackMarginPreferredWidth. */
|
|
39
|
+
export declare function setFeedbackMarginCollapsed(next: boolean, { persist }?: {
|
|
40
|
+
persist?: boolean;
|
|
41
|
+
}): void;
|
|
42
|
+
/** Test hook: forget the cached state so the next read hits storage again. */
|
|
43
|
+
export declare function resetFeedbackMarginPreferredWidthForTests(): void;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { useSyncExternalStore } from "react";
|
|
2
|
+
import { localStorageService } from "../services/localStorageService";
|
|
3
|
+
/** Width of the full column unless the user resized it. */
|
|
4
|
+
export const FEEDBACK_MARGIN_DEFAULT_WIDTH = 320;
|
|
5
|
+
/** The full column narrows down to this before it collapses into the rail. */
|
|
6
|
+
export const FEEDBACK_MARGIN_MIN_WIDTH = 200;
|
|
7
|
+
/** The widest the user can drag the column. */
|
|
8
|
+
export const FEEDBACK_MARGIN_MAX_WIDTH = 640;
|
|
9
|
+
/** Width of the rail of markers the column collapses into. */
|
|
10
|
+
export const FEEDBACK_MARGIN_RAIL_WIDTH = 40;
|
|
11
|
+
/**
|
|
12
|
+
* Dragging the column's edge below this collapses it into the rail, and
|
|
13
|
+
* dragging the rail's edge past it opens the column again. Halfway between
|
|
14
|
+
* the two, so a drag holds the column at its minimum before it snaps.
|
|
15
|
+
*/
|
|
16
|
+
export const FEEDBACK_MARGIN_COLLAPSE_WIDTH = (FEEDBACK_MARGIN_MIN_WIDTH + FEEDBACK_MARGIN_RAIL_WIDTH) / 2;
|
|
17
|
+
/** Arrow keys on the resize handle move the edge by this much. */
|
|
18
|
+
export const FEEDBACK_MARGIN_RESIZE_STEP = 16;
|
|
19
|
+
const STORAGE_KEY = "editor.feedbackMargin.width";
|
|
20
|
+
const COLLAPSED_STORAGE_KEY = "editor.feedbackMargin.collapsed";
|
|
21
|
+
export function clampFeedbackMarginWidth(width, limit) {
|
|
22
|
+
const max = limit === undefined || !Number.isFinite(limit)
|
|
23
|
+
? FEEDBACK_MARGIN_MAX_WIDTH
|
|
24
|
+
: Math.min(FEEDBACK_MARGIN_MAX_WIDTH, Math.floor(limit));
|
|
25
|
+
// The minimum wins over a pane too narrow for it; that pane shows the rail.
|
|
26
|
+
return Math.max(FEEDBACK_MARGIN_MIN_WIDTH, Math.min(max, Math.round(width)));
|
|
27
|
+
}
|
|
28
|
+
function readStoredWidth() {
|
|
29
|
+
const stored = localStorageService.getItem(STORAGE_KEY);
|
|
30
|
+
return typeof stored === "number" && Number.isFinite(stored)
|
|
31
|
+
? clampFeedbackMarginWidth(stored)
|
|
32
|
+
: FEEDBACK_MARGIN_DEFAULT_WIDTH;
|
|
33
|
+
}
|
|
34
|
+
let preferredWidth;
|
|
35
|
+
let collapsed;
|
|
36
|
+
const listeners = new Set();
|
|
37
|
+
export function getFeedbackMarginPreferredWidth() {
|
|
38
|
+
preferredWidth ??= readStoredWidth();
|
|
39
|
+
return preferredWidth;
|
|
40
|
+
}
|
|
41
|
+
function getCollapsed() {
|
|
42
|
+
collapsed ??=
|
|
43
|
+
localStorageService.getItem(COLLAPSED_STORAGE_KEY) === true;
|
|
44
|
+
return collapsed;
|
|
45
|
+
}
|
|
46
|
+
function subscribe(listener) {
|
|
47
|
+
listeners.add(listener);
|
|
48
|
+
return () => {
|
|
49
|
+
listeners.delete(listener);
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The width the user gave the comment margin, shared by the canvas and the
|
|
54
|
+
* form margin and kept per browser. It is a preference: a pane without room
|
|
55
|
+
* for it still narrows the column or shows the rail.
|
|
56
|
+
*/
|
|
57
|
+
export function useFeedbackMarginPreferredWidth() {
|
|
58
|
+
return useSyncExternalStore(subscribe, getFeedbackMarginPreferredWidth, getFeedbackMarginPreferredWidth);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Whether the user collapsed the canvas margin into its rail by dragging its
|
|
62
|
+
* edge past the minimum; kept per browser. The preferred width is kept for
|
|
63
|
+
* when the column opens again.
|
|
64
|
+
*/
|
|
65
|
+
export function useFeedbackMarginCollapsed() {
|
|
66
|
+
return useSyncExternalStore(subscribe, getCollapsed, getCollapsed);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* `persist: false` while dragging (every pointer move re-renders the column);
|
|
70
|
+
* the drag's end stores the final width.
|
|
71
|
+
*/
|
|
72
|
+
export function setFeedbackMarginPreferredWidth(width, { persist = true } = {}) {
|
|
73
|
+
const next = clampFeedbackMarginWidth(width);
|
|
74
|
+
if (persist) {
|
|
75
|
+
if (next === FEEDBACK_MARGIN_DEFAULT_WIDTH) {
|
|
76
|
+
localStorageService.removeItem(STORAGE_KEY);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
localStorageService.setItem(STORAGE_KEY, next);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (next === preferredWidth)
|
|
83
|
+
return;
|
|
84
|
+
preferredWidth = next;
|
|
85
|
+
listeners.forEach((listener) => listener());
|
|
86
|
+
}
|
|
87
|
+
/** `persist` as for setFeedbackMarginPreferredWidth. */
|
|
88
|
+
export function setFeedbackMarginCollapsed(next, { persist = true } = {}) {
|
|
89
|
+
if (persist) {
|
|
90
|
+
if (next) {
|
|
91
|
+
localStorageService.setItem(COLLAPSED_STORAGE_KEY, true);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
localStorageService.removeItem(COLLAPSED_STORAGE_KEY);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (next === getCollapsed())
|
|
98
|
+
return;
|
|
99
|
+
collapsed = next;
|
|
100
|
+
listeners.forEach((listener) => listener());
|
|
101
|
+
}
|
|
102
|
+
/** Test hook: forget the cached state so the next read hits storage again. */
|
|
103
|
+
export function resetFeedbackMarginPreferredWidthForTests() {
|
|
104
|
+
preferredWidth = undefined;
|
|
105
|
+
collapsed = undefined;
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=feedbackMarginWidth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedbackMarginWidth.js","sourceRoot":"","sources":["../../../src/editor/page-viewer/feedbackMarginWidth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,2DAA2D;AAC3D,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,CAAC;AACjD,8EAA8E;AAC9E,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAC7C,+CAA+C;AAC/C,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAC7C,8DAA8D;AAC9D,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAC7C;;;;GAIG;AACH,MAAM,CAAC,MAAM,8BAA8B,GACzC,CAAC,yBAAyB,GAAG,0BAA0B,CAAC,GAAG,CAAC,CAAC;AAC/D,kEAAkE;AAClE,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAE9C,MAAM,WAAW,GAAG,6BAA6B,CAAC;AAClD,MAAM,qBAAqB,GAAG,iCAAiC,CAAC;AAEhE,MAAM,UAAU,wBAAwB,CAAC,KAAa,EAAE,KAAc;IACpE,MAAM,GAAG,GACP,KAAK,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAC5C,CAAC,CAAC,yBAAyB;QAC3B,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,yBAAyB,EAAE,IAA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
* Interactive preview: running the client code of dynamic renderings safely,
|
|
3
|
+
* and finding the page's dynamic renderings for the preview strip.
|
|
4
|
+
*
|
|
5
|
+
* The client code of a rendering runs in the edit and preview canvas only once
|
|
6
|
+
* an administrator approved it: the canvas lives on the CM origin with the
|
|
7
|
+
* user's session. The rendering host wraps every
|
|
8
|
+
* dynamic rendering in `<div data-parhelia-rendering="<renderingId>">` and, in
|
|
9
|
+
* preview mode, marks a page that has client code with
|
|
10
|
+
* `<script data-parhelia-has-client-code="<renderingId>,...">`. To try client
|
|
11
|
+
* code that is not approved, the review dialog mints a short-lived preview
|
|
12
|
+
* token and shows a fresh iframe with `sandbox="allow-scripts"` only (an opaque
|
|
13
|
+
* origin: no cookies, no access to the editor) that loads the page through the
|
|
14
|
+
* token's capability URL, where all client code runs. The canvas itself is
|
|
15
|
+
* never replaced.
|
|
16
|
+
*
|
|
17
|
+
* This module holds the pure parts: reading the canvas, building the URLs, the
|
|
18
|
+
* token refresh rule and the session state.
|
|
19
|
+
*/
|
|
20
|
+
export declare const CLIENT_CODE_HINT_ATTRIBUTE = "data-parhelia-has-client-code";
|
|
21
|
+
export declare const CLIENT_CODE_HINT_SELECTOR = "script[data-parhelia-has-client-code]";
|
|
22
|
+
/** The wrapper the rendering host puts around every dynamic rendering. */
|
|
23
|
+
export declare const DYNAMIC_RENDERING_ATTRIBUTE = "data-parhelia-rendering";
|
|
24
|
+
export declare const DYNAMIC_RENDERING_SELECTOR = "[data-parhelia-rendering]";
|
|
25
|
+
/** The only sandbox flags the interactive frame gets. */
|
|
26
|
+
export declare const INTERACTIVE_PREVIEW_SANDBOX = "allow-scripts";
|
|
27
|
+
export declare const PREVIEW_TOKEN_ENDPOINT = "/parhelia/renderings/previewToken";
|
|
28
|
+
export declare const INTERACTIVE_PREVIEW_PATH_PREFIX = "/parhelia/preview/";
|
|
29
|
+
/** A token is renewed before a reload once it is this close to expiring. */
|
|
30
|
+
export declare const PREVIEW_TOKEN_REFRESH_MARGIN_SECONDS = 120;
|
|
31
|
+
export type InteractivePreviewPage = {
|
|
32
|
+
id: string;
|
|
33
|
+
language: string;
|
|
34
|
+
version: number;
|
|
35
|
+
};
|
|
36
|
+
export type PreviewTokenResponse = {
|
|
37
|
+
token: string;
|
|
38
|
+
prefix: string;
|
|
39
|
+
expiresInSeconds: number;
|
|
40
|
+
};
|
|
41
|
+
export type InteractivePreviewSession = {
|
|
42
|
+
/** The token's capability path, validated, without a trailing slash. */
|
|
43
|
+
prefix: string;
|
|
44
|
+
expiresInSeconds: number;
|
|
45
|
+
/** Epoch milliseconds at which the token was minted. */
|
|
46
|
+
mintedAt: number;
|
|
47
|
+
};
|
|
48
|
+
/** A GUID in lower-case "D" format, or undefined when the value is none. */
|
|
49
|
+
export declare function normalizeRenderingId(value: string | null | undefined): string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Rendering ids from one or more attribute values: comma-separated, limited to
|
|
52
|
+
* well-formed GUIDs, normalized and de-duplicated in order of appearance.
|
|
53
|
+
*/
|
|
54
|
+
export declare function parseRenderingIds(values: ReadonlyArray<string | null | undefined>): string[];
|
|
55
|
+
export type CanvasRenderings = {
|
|
56
|
+
/** Every dynamic rendering on the page (wrappers and the hint). */
|
|
57
|
+
renderingIds: string[];
|
|
58
|
+
/** The renderings the host marked as having client code. */
|
|
59
|
+
clientCodeIds: string[];
|
|
60
|
+
};
|
|
61
|
+
export declare const NO_CANVAS_RENDERINGS: CanvasRenderings;
|
|
62
|
+
/**
|
|
63
|
+
* The dynamic renderings in the canvas document. The canvas is normally
|
|
64
|
+
* same-origin with the editor; any other frame (cross-origin, opaque,
|
|
65
|
+
* detached) yields none.
|
|
66
|
+
*/
|
|
67
|
+
export declare function readCanvasRenderings(iframe: HTMLIFrameElement | null | undefined): CanvasRenderings;
|
|
68
|
+
export declare function sameRenderingIds(left: readonly string[], right: readonly string[]): boolean;
|
|
69
|
+
export declare function buildPreviewTokenUrl(page: InteractivePreviewPage): string;
|
|
70
|
+
/**
|
|
71
|
+
* The token's prefix as a same-origin preview path without a trailing slash,
|
|
72
|
+
* or undefined for anything else.
|
|
73
|
+
*/
|
|
74
|
+
export declare function normalizePreviewPrefix(prefix: unknown, origin?: string): string | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* The interactive frame's URL: the token prefix, then exactly "/" and the
|
|
77
|
+
* query the preview canvas uses, without the editor's own markers. IIS
|
|
78
|
+
* rejects paths longer than 260 characters and the token alone takes about
|
|
79
|
+
* half of that, so the page's route path is never appended: the host resolves
|
|
80
|
+
* the page by its item id (the `route` parameter rides along when the canvas
|
|
81
|
+
* has one). The page context always names the version the token was minted
|
|
82
|
+
* for. Returns undefined for a prefix that is not a same-origin preview path.
|
|
83
|
+
*/
|
|
84
|
+
export declare function buildInteractivePreviewFrameUrl(prefix: string, page: InteractivePreviewPage, canvasUrl?: string, origin?: string): string | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Whether a token must be renewed before the frame is (re)loaded: once it is
|
|
87
|
+
* older than its lifetime minus the refresh margin. Time alone never reloads
|
|
88
|
+
* the frame; this is only consulted when the editor reloads it anyway.
|
|
89
|
+
*/
|
|
90
|
+
export declare function isPreviewTokenDue(session: Pick<InteractivePreviewSession, "mintedAt" | "expiresInSeconds">, now: number): boolean;
|
|
91
|
+
export declare function isPreviewTokenResponse(value: unknown): value is PreviewTokenResponse;
|
|
92
|
+
export declare function createInteractivePreviewSession(response: PreviewTokenResponse, mintedAt: number, origin?: string): InteractivePreviewSession | undefined;
|
|
93
|
+
export declare function getInteractivePreviewPageKey(page: InteractivePreviewPage | undefined): string | undefined;
|
|
94
|
+
export type InteractivePreviewStatus = "off" | "starting" | "on";
|
|
95
|
+
export type CanvasRenderingsHint = CanvasRenderings & {
|
|
96
|
+
/** The page whose canvas document the renderings were read from. */
|
|
97
|
+
pageKey?: string;
|
|
98
|
+
};
|
|
99
|
+
export type InteractivePreviewState = {
|
|
100
|
+
status: InteractivePreviewStatus;
|
|
101
|
+
/** The page (see getInteractivePreviewPageKey) the session belongs to. */
|
|
102
|
+
pageKey?: string;
|
|
103
|
+
session?: InteractivePreviewSession;
|
|
104
|
+
/**
|
|
105
|
+
* The preview canvas URL whose query the interactive frame uses. It only
|
|
106
|
+
* changes together with the frame key, so a running frame never navigates.
|
|
107
|
+
*/
|
|
108
|
+
canvasUrl?: string;
|
|
109
|
+
/**
|
|
110
|
+
* React key of the interactive iframe. It changes on every (re)load: a
|
|
111
|
+
* sandbox attribute only applies to a fresh iframe element, and a fresh
|
|
112
|
+
* element is also the simplest way to reload an opaque-origin frame.
|
|
113
|
+
*/
|
|
114
|
+
frameKey: number;
|
|
115
|
+
/** The token request whose response is awaited, if any. */
|
|
116
|
+
pendingRequestId?: number;
|
|
117
|
+
/** The renderings last read from the normal preview canvas. */
|
|
118
|
+
hint: CanvasRenderingsHint;
|
|
119
|
+
};
|
|
120
|
+
export type InteractivePreviewAction = {
|
|
121
|
+
type: "start";
|
|
122
|
+
pageKey: string;
|
|
123
|
+
requestId: number;
|
|
124
|
+
} | {
|
|
125
|
+
type: "refreshStarted";
|
|
126
|
+
requestId: number;
|
|
127
|
+
} | {
|
|
128
|
+
type: "minted";
|
|
129
|
+
requestId: number;
|
|
130
|
+
session: InteractivePreviewSession;
|
|
131
|
+
canvasUrl?: string;
|
|
132
|
+
} | {
|
|
133
|
+
type: "mintFailed";
|
|
134
|
+
requestId: number;
|
|
135
|
+
} | {
|
|
136
|
+
type: "remount";
|
|
137
|
+
canvasUrl?: string;
|
|
138
|
+
} | {
|
|
139
|
+
type: "stop";
|
|
140
|
+
} | {
|
|
141
|
+
type: "hint";
|
|
142
|
+
pageKey: string | undefined;
|
|
143
|
+
renderings: CanvasRenderings;
|
|
144
|
+
};
|
|
145
|
+
export declare const INITIAL_INTERACTIVE_PREVIEW_STATE: InteractivePreviewState;
|
|
146
|
+
export declare function interactivePreviewReducer(state: InteractivePreviewState, action: InteractivePreviewAction): InteractivePreviewState;
|
|
147
|
+
export type InteractivePreviewContext = {
|
|
148
|
+
mode: string | undefined;
|
|
149
|
+
pageKey: string | undefined;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Whether the interactive frame replaces the canvas right now. Derived rather
|
|
153
|
+
* than stored so that leaving preview mode or opening another page returns to
|
|
154
|
+
* the normal canvas in the same render, before any cleanup has run.
|
|
155
|
+
*/
|
|
156
|
+
export declare function isInteractivePreviewActive(state: InteractivePreviewState, context: InteractivePreviewContext): boolean;
|
|
157
|
+
/** A running or starting session that no longer matches the canvas ends. */
|
|
158
|
+
export declare function shouldStopInteractivePreview(state: InteractivePreviewState, context: InteractivePreviewContext): boolean;
|
|
159
|
+
/**
|
|
160
|
+
* The rendering ids "Run client code" is offered for: only in preview mode,
|
|
161
|
+
* and only those read from the canvas of the page that is open now.
|
|
162
|
+
*/
|
|
163
|
+
export declare function getOfferedClientCodeRenderings(state: InteractivePreviewState, context: InteractivePreviewContext): string[];
|
|
164
|
+
/**
|
|
165
|
+
* The page's dynamic renderings the preview strip lists, under the same
|
|
166
|
+
* conditions as getOfferedClientCodeRenderings.
|
|
167
|
+
*/
|
|
168
|
+
export declare function getPreviewRenderingIds(state: InteractivePreviewState, context: InteractivePreviewContext): string[];
|