@parhelia/core 0.3.12831 → 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.d.ts +58 -0
- package/dist/editor/agent-changes/agentChangeTargets.js +180 -0
- package/dist/editor/agent-changes/agentChangeTargets.js.map +1 -0
- package/dist/editor/agent-changes/agentChangeTextHighlight.d.ts +101 -0
- package/dist/editor/agent-changes/agentChangeTextHighlight.js +167 -0
- package/dist/editor/agent-changes/agentChangeTextHighlight.js.map +1 -0
- 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/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 +62 -0
- package/dist/editor/ai/terminal/components/ResponseTurnDuration.js.map +1 -0
- 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/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/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/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/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/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/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/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/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/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/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/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 +40 -0
- package/dist/editor/field-types/FieldHistoryBoundary.js.map +1 -0
- 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 +32 -0
- package/dist/editor/field-types/richtext/utils/changeHighlight.js +68 -0
- package/dist/editor/field-types/richtext/utils/changeHighlight.js.map +1 -0
- 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.d.ts +16 -0
- package/dist/editor/itemContextMenuGroups.js +57 -0
- package/dist/editor/itemContextMenuGroups.js.map +1 -0
- 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/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/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/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/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 +17 -0
- package/dist/editor/page-editor-chrome/AgentChangeHighlightings.js +33 -0
- package/dist/editor/page-editor-chrome/AgentChangeHighlightings.js.map +1 -0
- 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 +29 -0
- package/dist/editor/page-editor-chrome/DiffHighlightOverlay.js +295 -0
- package/dist/editor/page-editor-chrome/DiffHighlightOverlay.js.map +1 -0
- 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/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-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/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/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/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/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/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/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/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/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/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/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/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/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/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/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.d.ts +14 -0
- package/dist/editor/sidebar/OperationDetailsContent.js +571 -0
- package/dist/editor/sidebar/OperationDetailsContent.js.map +1 -0
- package/dist/editor/sidebar/liveComponentThumbnails.d.ts +66 -0
- package/dist/editor/sidebar/liveComponentThumbnails.js +225 -0
- package/dist/editor/sidebar/liveComponentThumbnails.js.map +1 -0
- 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/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/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/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/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/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/validationRulerIssues.d.ts +17 -0
- package/dist/editor/validation/validationRulerIssues.js +44 -0
- package/dist/editor/validation/validationRulerIssues.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/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/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/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/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/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.d.ts +68 -0
- package/dist/task-board/utils/projectDashboardModel.js +369 -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 +308 -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 +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 +112 -6
- package/dist/tour/sandbox-tour.js.map +1 -1
- package/dist/tour/tour-utils.d.ts +6 -0
- package/dist/tour/tour-utils.js +10 -0
- package/dist/tour/tour-utils.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,344 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 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 const CLIENT_CODE_HINT_ATTRIBUTE = "data-parhelia-has-client-code";
|
|
21
|
+
export const CLIENT_CODE_HINT_SELECTOR = `script[${CLIENT_CODE_HINT_ATTRIBUTE}]`;
|
|
22
|
+
/** The wrapper the rendering host puts around every dynamic rendering. */
|
|
23
|
+
export const DYNAMIC_RENDERING_ATTRIBUTE = "data-parhelia-rendering";
|
|
24
|
+
export const DYNAMIC_RENDERING_SELECTOR = `[${DYNAMIC_RENDERING_ATTRIBUTE}]`;
|
|
25
|
+
/** The only sandbox flags the interactive frame gets. */
|
|
26
|
+
export const INTERACTIVE_PREVIEW_SANDBOX = "allow-scripts";
|
|
27
|
+
export const PREVIEW_TOKEN_ENDPOINT = "/parhelia/renderings/previewToken";
|
|
28
|
+
export const INTERACTIVE_PREVIEW_PATH_PREFIX = "/parhelia/preview/";
|
|
29
|
+
/** A token is renewed before a reload once it is this close to expiring. */
|
|
30
|
+
export const PREVIEW_TOKEN_REFRESH_MARGIN_SECONDS = 120;
|
|
31
|
+
// At most this many rendering ids are read from a page and sent to the server.
|
|
32
|
+
const MAX_RENDERING_IDS = 100;
|
|
33
|
+
const RENDERING_ID_PATTERN = /^\{?([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})\}?$/i;
|
|
34
|
+
/** A GUID in lower-case "D" format, or undefined when the value is none. */
|
|
35
|
+
export function normalizeRenderingId(value) {
|
|
36
|
+
const match = RENDERING_ID_PATTERN.exec((value ?? "").trim());
|
|
37
|
+
return match ? match.slice(1, 6).join("-").toLowerCase() : undefined;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Rendering ids from one or more attribute values: comma-separated, limited to
|
|
41
|
+
* well-formed GUIDs, normalized and de-duplicated in order of appearance.
|
|
42
|
+
*/
|
|
43
|
+
export function parseRenderingIds(values) {
|
|
44
|
+
const ids = [];
|
|
45
|
+
const seen = new Set();
|
|
46
|
+
for (const value of values) {
|
|
47
|
+
for (const raw of (value ?? "").split(",")) {
|
|
48
|
+
const id = normalizeRenderingId(raw);
|
|
49
|
+
if (!id || seen.has(id))
|
|
50
|
+
continue;
|
|
51
|
+
seen.add(id);
|
|
52
|
+
ids.push(id);
|
|
53
|
+
if (ids.length >= MAX_RENDERING_IDS)
|
|
54
|
+
return ids;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return ids;
|
|
58
|
+
}
|
|
59
|
+
const NO_RENDERING_IDS = [];
|
|
60
|
+
export const NO_CANVAS_RENDERINGS = {
|
|
61
|
+
renderingIds: NO_RENDERING_IDS,
|
|
62
|
+
clientCodeIds: NO_RENDERING_IDS,
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* The dynamic renderings in the canvas document. The canvas is normally
|
|
66
|
+
* same-origin with the editor; any other frame (cross-origin, opaque,
|
|
67
|
+
* detached) yields none.
|
|
68
|
+
*/
|
|
69
|
+
export function readCanvasRenderings(iframe) {
|
|
70
|
+
try {
|
|
71
|
+
const doc = iframe?.contentDocument;
|
|
72
|
+
if (!doc)
|
|
73
|
+
return NO_CANVAS_RENDERINGS;
|
|
74
|
+
const clientCodeIds = parseRenderingIds(Array.from(doc.querySelectorAll(CLIENT_CODE_HINT_SELECTOR), (script) => script.getAttribute(CLIENT_CODE_HINT_ATTRIBUTE)));
|
|
75
|
+
const renderingIds = parseRenderingIds([
|
|
76
|
+
...Array.from(doc.querySelectorAll(DYNAMIC_RENDERING_SELECTOR), (node) => node.getAttribute(DYNAMIC_RENDERING_ATTRIBUTE)),
|
|
77
|
+
...clientCodeIds,
|
|
78
|
+
]);
|
|
79
|
+
if (renderingIds.length === 0)
|
|
80
|
+
return NO_CANVAS_RENDERINGS;
|
|
81
|
+
return { renderingIds, clientCodeIds };
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
return NO_CANVAS_RENDERINGS;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
export function sameRenderingIds(left, right) {
|
|
88
|
+
return (left.length === right.length &&
|
|
89
|
+
left.every((id, index) => id === right[index]));
|
|
90
|
+
}
|
|
91
|
+
export function buildPreviewTokenUrl(page) {
|
|
92
|
+
const params = new URLSearchParams({
|
|
93
|
+
item: page.id,
|
|
94
|
+
language: page.language,
|
|
95
|
+
version: String(page.version),
|
|
96
|
+
});
|
|
97
|
+
return `${PREVIEW_TOKEN_ENDPOINT}?${params.toString()}`;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The token's prefix as a same-origin preview path without a trailing slash,
|
|
101
|
+
* or undefined for anything else.
|
|
102
|
+
*/
|
|
103
|
+
export function normalizePreviewPrefix(prefix, origin = window.location.origin) {
|
|
104
|
+
if (typeof prefix !== "string" ||
|
|
105
|
+
!prefix.startsWith(INTERACTIVE_PREVIEW_PATH_PREFIX) ||
|
|
106
|
+
/[?#\\]/.test(prefix) ||
|
|
107
|
+
prefix.split("/").some((segment) => segment === "." || segment === "..")) {
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
let url;
|
|
111
|
+
try {
|
|
112
|
+
url = new URL(`${prefix.replace(/\/+$/, "")}/`, origin);
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
// Encoded dot segments are resolved by the URL parser; what is left must
|
|
118
|
+
// still be a preview path on the editor's origin.
|
|
119
|
+
if (url.origin !== new URL(origin).origin ||
|
|
120
|
+
!url.pathname.startsWith(INTERACTIVE_PREVIEW_PATH_PREFIX)) {
|
|
121
|
+
return undefined;
|
|
122
|
+
}
|
|
123
|
+
return url.pathname.replace(/\/+$/, "");
|
|
124
|
+
}
|
|
125
|
+
// Editor-only parameters of the canvas URL: the sealed frame gets no editing
|
|
126
|
+
// bridge, no editing session and no Sitecore site switch.
|
|
127
|
+
const CANVAS_ONLY_PARAMS = new Set([
|
|
128
|
+
"edit_rev",
|
|
129
|
+
"parhelia",
|
|
130
|
+
"parhelia_session",
|
|
131
|
+
"parhelia_layout",
|
|
132
|
+
"sc_site",
|
|
133
|
+
]);
|
|
134
|
+
// The preview proxy runs through Sitecore's request pipeline like the canvas
|
|
135
|
+
// proxy, so the page context travels in the plain parameters the host reads
|
|
136
|
+
// (see applyParheliaRenderContext).
|
|
137
|
+
const PLAIN_CONTEXT_PARAMS = new Map([
|
|
138
|
+
["sc_itemid", "itemid"],
|
|
139
|
+
["sc_lang", "lang"],
|
|
140
|
+
["sc_version", "version"],
|
|
141
|
+
]);
|
|
142
|
+
function getSearchParams(url, origin) {
|
|
143
|
+
try {
|
|
144
|
+
return url ? new URL(url, origin).searchParams : new URLSearchParams();
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
return new URLSearchParams();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* The interactive frame's URL: the token prefix, then exactly "/" and the
|
|
152
|
+
* query the preview canvas uses, without the editor's own markers. IIS
|
|
153
|
+
* rejects paths longer than 260 characters and the token alone takes about
|
|
154
|
+
* half of that, so the page's route path is never appended: the host resolves
|
|
155
|
+
* the page by its item id (the `route` parameter rides along when the canvas
|
|
156
|
+
* has one). The page context always names the version the token was minted
|
|
157
|
+
* for. Returns undefined for a prefix that is not a same-origin preview path.
|
|
158
|
+
*/
|
|
159
|
+
export function buildInteractivePreviewFrameUrl(prefix, page, canvasUrl, origin = window.location.origin) {
|
|
160
|
+
const path = normalizePreviewPrefix(prefix, origin);
|
|
161
|
+
if (!path)
|
|
162
|
+
return undefined;
|
|
163
|
+
const url = new URL(`${path}/`, origin);
|
|
164
|
+
const canvasParams = getSearchParams(canvasUrl, origin);
|
|
165
|
+
canvasParams.forEach((value, name) => {
|
|
166
|
+
const key = name.toLowerCase();
|
|
167
|
+
if (CANVAS_ONLY_PARAMS.has(key))
|
|
168
|
+
return;
|
|
169
|
+
const target = PLAIN_CONTEXT_PARAMS.get(key);
|
|
170
|
+
if (target && canvasParams.has(target))
|
|
171
|
+
return;
|
|
172
|
+
url.searchParams.append(target ?? name, value);
|
|
173
|
+
});
|
|
174
|
+
url.searchParams.set("itemid", page.id);
|
|
175
|
+
url.searchParams.set("lang", page.language);
|
|
176
|
+
url.searchParams.set("version", String(page.version));
|
|
177
|
+
return url.toString();
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Whether a token must be renewed before the frame is (re)loaded: once it is
|
|
181
|
+
* older than its lifetime minus the refresh margin. Time alone never reloads
|
|
182
|
+
* the frame; this is only consulted when the editor reloads it anyway.
|
|
183
|
+
*/
|
|
184
|
+
export function isPreviewTokenDue(session, now) {
|
|
185
|
+
const renewAfterMs = (session.expiresInSeconds - PREVIEW_TOKEN_REFRESH_MARGIN_SECONDS) * 1000;
|
|
186
|
+
return now - session.mintedAt >= renewAfterMs;
|
|
187
|
+
}
|
|
188
|
+
export function isPreviewTokenResponse(value) {
|
|
189
|
+
if (!value || typeof value !== "object")
|
|
190
|
+
return false;
|
|
191
|
+
const candidate = value;
|
|
192
|
+
return (typeof candidate.token === "string" &&
|
|
193
|
+
candidate.token.length > 0 &&
|
|
194
|
+
typeof candidate.prefix === "string" &&
|
|
195
|
+
typeof candidate.expiresInSeconds === "number" &&
|
|
196
|
+
Number.isFinite(candidate.expiresInSeconds) &&
|
|
197
|
+
candidate.expiresInSeconds > 0);
|
|
198
|
+
}
|
|
199
|
+
export function createInteractivePreviewSession(response, mintedAt, origin = window.location.origin) {
|
|
200
|
+
const prefix = normalizePreviewPrefix(response.prefix, origin);
|
|
201
|
+
if (!prefix)
|
|
202
|
+
return undefined;
|
|
203
|
+
return {
|
|
204
|
+
prefix,
|
|
205
|
+
expiresInSeconds: response.expiresInSeconds,
|
|
206
|
+
mintedAt,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
export function getInteractivePreviewPageKey(page) {
|
|
210
|
+
if (!page?.id || !page.language)
|
|
211
|
+
return undefined;
|
|
212
|
+
return [
|
|
213
|
+
page.id.replace(/[{}-]/g, "").toLowerCase(),
|
|
214
|
+
page.language.toLowerCase(),
|
|
215
|
+
page.version,
|
|
216
|
+
].join("|");
|
|
217
|
+
}
|
|
218
|
+
const NO_HINT = NO_CANVAS_RENDERINGS;
|
|
219
|
+
export const INITIAL_INTERACTIVE_PREVIEW_STATE = {
|
|
220
|
+
status: "off",
|
|
221
|
+
frameKey: 0,
|
|
222
|
+
hint: NO_HINT,
|
|
223
|
+
};
|
|
224
|
+
function offState(state) {
|
|
225
|
+
if (state.status === "off" && !state.session && !state.pendingRequestId) {
|
|
226
|
+
return state;
|
|
227
|
+
}
|
|
228
|
+
return {
|
|
229
|
+
...INITIAL_INTERACTIVE_PREVIEW_STATE,
|
|
230
|
+
frameKey: state.frameKey,
|
|
231
|
+
hint: state.hint,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
export function interactivePreviewReducer(state, action) {
|
|
235
|
+
switch (action.type) {
|
|
236
|
+
case "hint": {
|
|
237
|
+
const pageKey = action.renderings.renderingIds.length
|
|
238
|
+
? action.pageKey
|
|
239
|
+
: undefined;
|
|
240
|
+
if (state.hint.pageKey === pageKey &&
|
|
241
|
+
sameRenderingIds(state.hint.renderingIds, action.renderings.renderingIds) &&
|
|
242
|
+
sameRenderingIds(state.hint.clientCodeIds, action.renderings.clientCodeIds)) {
|
|
243
|
+
return state;
|
|
244
|
+
}
|
|
245
|
+
return {
|
|
246
|
+
...state,
|
|
247
|
+
hint: pageKey
|
|
248
|
+
? {
|
|
249
|
+
pageKey,
|
|
250
|
+
renderingIds: [...action.renderings.renderingIds],
|
|
251
|
+
clientCodeIds: [...action.renderings.clientCodeIds],
|
|
252
|
+
}
|
|
253
|
+
: NO_HINT,
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
case "start":
|
|
257
|
+
// Only a page whose canvas has client code can run it.
|
|
258
|
+
if (state.status !== "off" ||
|
|
259
|
+
state.hint.pageKey !== action.pageKey ||
|
|
260
|
+
state.hint.clientCodeIds.length === 0) {
|
|
261
|
+
return state;
|
|
262
|
+
}
|
|
263
|
+
return {
|
|
264
|
+
status: "starting",
|
|
265
|
+
pageKey: action.pageKey,
|
|
266
|
+
frameKey: state.frameKey,
|
|
267
|
+
pendingRequestId: action.requestId,
|
|
268
|
+
hint: state.hint,
|
|
269
|
+
};
|
|
270
|
+
case "refreshStarted":
|
|
271
|
+
if (state.status !== "on")
|
|
272
|
+
return state;
|
|
273
|
+
return { ...state, pendingRequestId: action.requestId };
|
|
274
|
+
case "minted":
|
|
275
|
+
if (state.status === "off" ||
|
|
276
|
+
state.pendingRequestId !== action.requestId) {
|
|
277
|
+
return state;
|
|
278
|
+
}
|
|
279
|
+
return {
|
|
280
|
+
...state,
|
|
281
|
+
status: "on",
|
|
282
|
+
session: action.session,
|
|
283
|
+
canvasUrl: action.canvasUrl ?? state.canvasUrl,
|
|
284
|
+
pendingRequestId: undefined,
|
|
285
|
+
frameKey: state.frameKey + 1,
|
|
286
|
+
};
|
|
287
|
+
case "mintFailed":
|
|
288
|
+
if (state.pendingRequestId !== action.requestId)
|
|
289
|
+
return state;
|
|
290
|
+
return offState(state);
|
|
291
|
+
case "remount":
|
|
292
|
+
if (state.status !== "on")
|
|
293
|
+
return state;
|
|
294
|
+
return {
|
|
295
|
+
...state,
|
|
296
|
+
canvasUrl: action.canvasUrl ?? state.canvasUrl,
|
|
297
|
+
frameKey: state.frameKey + 1,
|
|
298
|
+
};
|
|
299
|
+
case "stop":
|
|
300
|
+
return offState(state);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Whether the interactive frame replaces the canvas right now. Derived rather
|
|
305
|
+
* than stored so that leaving preview mode or opening another page returns to
|
|
306
|
+
* the normal canvas in the same render, before any cleanup has run.
|
|
307
|
+
*/
|
|
308
|
+
export function isInteractivePreviewActive(state, context) {
|
|
309
|
+
return (state.status === "on" &&
|
|
310
|
+
!!state.session &&
|
|
311
|
+
context.mode === "preview" &&
|
|
312
|
+
!!context.pageKey &&
|
|
313
|
+
state.pageKey === context.pageKey);
|
|
314
|
+
}
|
|
315
|
+
/** A running or starting session that no longer matches the canvas ends. */
|
|
316
|
+
export function shouldStopInteractivePreview(state, context) {
|
|
317
|
+
return (state.status !== "off" &&
|
|
318
|
+
(context.mode !== "preview" ||
|
|
319
|
+
!context.pageKey ||
|
|
320
|
+
state.pageKey !== context.pageKey));
|
|
321
|
+
}
|
|
322
|
+
function getHintForContext(state, context) {
|
|
323
|
+
if (context.mode !== "preview" ||
|
|
324
|
+
!context.pageKey ||
|
|
325
|
+
state.hint.pageKey !== context.pageKey) {
|
|
326
|
+
return NO_CANVAS_RENDERINGS;
|
|
327
|
+
}
|
|
328
|
+
return state.hint;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* The rendering ids "Run client code" is offered for: only in preview mode,
|
|
332
|
+
* and only those read from the canvas of the page that is open now.
|
|
333
|
+
*/
|
|
334
|
+
export function getOfferedClientCodeRenderings(state, context) {
|
|
335
|
+
return getHintForContext(state, context).clientCodeIds;
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* The page's dynamic renderings the preview strip lists, under the same
|
|
339
|
+
* conditions as getOfferedClientCodeRenderings.
|
|
340
|
+
*/
|
|
341
|
+
export function getPreviewRenderingIds(state, context) {
|
|
342
|
+
return getHintForContext(state, context).renderingIds;
|
|
343
|
+
}
|
|
344
|
+
//# sourceMappingURL=interactivePreview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactivePreview.js","sourceRoot":"","sources":["../../../src/editor/page-viewer/interactivePreview.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,+BAA+B,CAAC;AAC1E,MAAM,CAAC,MAAM,yBAAyB,GAAG,UAAU,0BAA0B,GAAG,CAAC;AACjF,0EAA0E;AAC1E,MAAM,CAAC,MAAM,2BAA2B,GAAG,yBAAyB,CAAC;AACrE,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,2BAA2B,GAAG,CAAC;AAE7E,yDAAyD;AACzD,MAAM,CAAC,MAAM,2BAA2B,GAAG,eAAe,CAAC;AAE3D,MAAM,CAAC,MAAM,sBAAsB,GAAG,mCAAmC,CAAC;AAC1E,MAAM,CAAC,MAAM,+BAA+B,GAAG,oBAAoB,CAAC;AAEpE,4EAA4E;AAC5E,MAAM,CAAC,MAAM,oCAAoC,GAAG,GAAG,CAAC;AAExD,+EAA+E;AAC/E,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAC9B,MAAM,oBAAoB,GACxB,qFAAqF,CAAC;AAsBxF,4EAA4E;AAC5E,MAAM,UAA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zB,CAAC,OAAO,CAAC,OAAO;YAChB,KAAK,CAAC,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CACrC,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CACxB,KAA8B,EAC9B,OAAkC;IAElC,IACE,OAAO,CAAC,IAAI,KAAK,SAAS;QAC1B,CAAC,OAAO,CAAC,OAAO;QAChB,KAAK,CAAC,IAAI,CAAC,OAAO,KAAK,OAAO,CAAC,OAAO,EACtC,CAAC;QACD,OAAO,oBAAoB,CAAC;IAC9B,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,8BAA8B,CAC5C,KAA8B,EAC9B,OAAkC;IAElC,OAAO,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,aAAa,CAAC;AACzD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CACpC,KAA8B,EAC9B,OAAkC;IAElC,OAAO,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,YAAY,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// A minimap iframe is as tall as the whole page. Resolve viewport units before
|
|
2
|
+
// loading it so nested cards, spacing and backgrounds retain the live layout.
|
|
3
|
+
export function resolveMinimapViewportUnits(css, width, height) {
|
|
4
|
+
// Consume strings, comments, URLs and identifiers intact, including escaped
|
|
5
|
+
// Tailwind selectors. Only CSS dimension tokens should be rewritten.
|
|
6
|
+
return css.replace(/\/\*[\s\S]*?\*\/|"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|url\((?:\\[\s\S]|[^)\\])*\)|[+-]?(?:\d*\.\d+|\d+\.?\d*)(?:e[+-]?\d+)?(?:[a-zA-Z_\u0080-\uFFFF]|\\[^\r\n])(?:[\w\u0080-\uFFFF-]|\\[^\r\n])*|(?:[a-zA-Z_\u0080-\uFFFF-]|\\[^\r\n])(?:[\w\u0080-\uFFFF-]|\\[^\r\n])*/gi, (token) => {
|
|
7
|
+
const dimension = token.match(/^([+-]?(?:\d*\.\d+|\d+\.?\d*)(?:e[+-]?\d+)?)([dls]?v[wh]|[dls]?vmin|[dls]?vmax)$/i);
|
|
8
|
+
if (!dimension)
|
|
9
|
+
return token;
|
|
10
|
+
const [, amount, unitToken] = dimension;
|
|
11
|
+
if (amount === undefined || unitToken === undefined)
|
|
12
|
+
return token;
|
|
13
|
+
const unit = unitToken.toLowerCase();
|
|
14
|
+
const size = unit.endsWith("min")
|
|
15
|
+
? Math.min(width, height)
|
|
16
|
+
: unit.endsWith("max")
|
|
17
|
+
? Math.max(width, height)
|
|
18
|
+
: unit.endsWith("h")
|
|
19
|
+
? height
|
|
20
|
+
: width;
|
|
21
|
+
if (!Number.isFinite(size) || size <= 0)
|
|
22
|
+
return token;
|
|
23
|
+
return `${Math.round(((Number(amount) * size) / 100) * 1000) / 1000}px`;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
export function preserveMinimapViewport(doc, width, height) {
|
|
27
|
+
doc.querySelectorAll("style").forEach((style) => {
|
|
28
|
+
style.textContent = resolveMinimapViewportUnits(style.textContent || "", width, height);
|
|
29
|
+
});
|
|
30
|
+
doc.querySelectorAll("[style]").forEach((element) => {
|
|
31
|
+
element.setAttribute("style", resolveMinimapViewportUnits(element.getAttribute("style") || "", width, height));
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=minimapViewport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minimapViewport.js","sourceRoot":"","sources":["../../../src/editor/page-viewer/minimapViewport.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,8EAA8E;AAC9E,MAAM,UAAU,2BAA2B,CACzC,GAAW,EACX,KAAa,EACb,MAAc;IAEd,4EAA4E;IAC5E,qEAAqE;IACrE,OAAO,GAAG,CAAC,OAAO,CAChB,oRAAoR,EACpR,CAAC,KAAK,EAAE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AAC;IACJ,CAAC,CAAC,CAAC;IACH,GAAG,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAClD,OAAO,CAAC,YAAY,CAClB,OAAO,EACP,2BAA2B,CACzB,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,EACnC,KAAK,EACL,MAAM,CACP,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ItemDescriptor, Page } from "../pageModel";
|
|
2
|
+
/**
|
|
3
|
+
* Which items belong to the page the editor has open, according to the
|
|
4
|
+
* editor's own loaded page model: the page item itself plus every datasource
|
|
5
|
+
* and rendered item of its components. Bridge payloads name the item they
|
|
6
|
+
* write to; anything outside this set is not part of the open page and must
|
|
7
|
+
* not be edited through the canvas.
|
|
8
|
+
*/
|
|
9
|
+
export type OpenPageModel = {
|
|
10
|
+
page?: Page;
|
|
11
|
+
pageItemDescriptor?: ItemDescriptor;
|
|
12
|
+
};
|
|
13
|
+
type ItemIdentity = {
|
|
14
|
+
id?: string | null;
|
|
15
|
+
language?: string | null;
|
|
16
|
+
version?: number | null;
|
|
17
|
+
};
|
|
18
|
+
type OpenPageItemEntry = {
|
|
19
|
+
language: string;
|
|
20
|
+
version: number;
|
|
21
|
+
};
|
|
22
|
+
export declare function collectOpenPageItems(page: Page): ReadonlyMap<string, readonly OpenPageItemEntry[]>;
|
|
23
|
+
/**
|
|
24
|
+
* True when the item (id, language and version) belongs to the open page: it
|
|
25
|
+
* is the page item or an item the loaded page model knows as part of the page.
|
|
26
|
+
* Without a loaded page nothing but the page item itself qualifies.
|
|
27
|
+
*/
|
|
28
|
+
export declare function isItemPartOfOpenPage(item: ItemIdentity | null | undefined, model: OpenPageModel | null | undefined): boolean;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
function normalizeItemId(id) {
|
|
2
|
+
return (id ?? "").replace(/[{}-]/g, "").trim().toLowerCase();
|
|
3
|
+
}
|
|
4
|
+
function normalizeLanguage(language) {
|
|
5
|
+
return (language ?? "").trim().toLowerCase();
|
|
6
|
+
}
|
|
7
|
+
function addItem(items, item) {
|
|
8
|
+
const id = normalizeItemId(item?.id);
|
|
9
|
+
if (!id)
|
|
10
|
+
return;
|
|
11
|
+
const version = typeof item?.version === "number" && Number.isFinite(item.version)
|
|
12
|
+
? item.version
|
|
13
|
+
: 0;
|
|
14
|
+
const entries = items.get(id) ?? [];
|
|
15
|
+
entries.push({ language: normalizeLanguage(item?.language), version });
|
|
16
|
+
items.set(id, entries);
|
|
17
|
+
}
|
|
18
|
+
// Not cached: the model is small and this runs once per canvas edit event.
|
|
19
|
+
export function collectOpenPageItems(page) {
|
|
20
|
+
const items = new Map();
|
|
21
|
+
addItem(items, page.item);
|
|
22
|
+
const visited = new Set();
|
|
23
|
+
const visit = (component) => {
|
|
24
|
+
if (!component || visited.has(component))
|
|
25
|
+
return;
|
|
26
|
+
visited.add(component);
|
|
27
|
+
addItem(items, component.datasourceItem);
|
|
28
|
+
component.items?.forEach((item) => addItem(items, item));
|
|
29
|
+
component.placeholders?.forEach((placeholder) => placeholder.components?.forEach(visit));
|
|
30
|
+
};
|
|
31
|
+
visit(page.rootComponent);
|
|
32
|
+
return items;
|
|
33
|
+
}
|
|
34
|
+
function entryMatches(entry, language, version) {
|
|
35
|
+
if (entry.language && entry.language !== language)
|
|
36
|
+
return false;
|
|
37
|
+
// Version 0 stands for "latest" on either side, as everywhere else in the
|
|
38
|
+
// editor's item matching.
|
|
39
|
+
return entry.version === 0 || version === 0 || entry.version === version;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* True when the item (id, language and version) belongs to the open page: it
|
|
43
|
+
* is the page item or an item the loaded page model knows as part of the page.
|
|
44
|
+
* Without a loaded page nothing but the page item itself qualifies.
|
|
45
|
+
*/
|
|
46
|
+
export function isItemPartOfOpenPage(item, model) {
|
|
47
|
+
const id = normalizeItemId(item?.id);
|
|
48
|
+
const language = normalizeLanguage(item?.language);
|
|
49
|
+
const version = item?.version;
|
|
50
|
+
if (!id ||
|
|
51
|
+
!language ||
|
|
52
|
+
typeof version !== "number" ||
|
|
53
|
+
!Number.isFinite(version) ||
|
|
54
|
+
version < 0) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
const pageItem = model?.pageItemDescriptor;
|
|
58
|
+
if (pageItem &&
|
|
59
|
+
normalizeItemId(pageItem.id) === id &&
|
|
60
|
+
entryMatches({
|
|
61
|
+
language: normalizeLanguage(pageItem.language),
|
|
62
|
+
version: pageItem.version ?? 0,
|
|
63
|
+
}, language, version)) {
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
const page = model?.page;
|
|
67
|
+
if (!page)
|
|
68
|
+
return false;
|
|
69
|
+
return (collectOpenPageItems(page)
|
|
70
|
+
.get(id)
|
|
71
|
+
?.some((entry) => entryMatches(entry, language, version)) ?? false);
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=openPageItems.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openPageItems.js","sourceRoot":"","sources":["../../../src/editor/page-viewer/openPageItems.ts"],"names":[],"mappings":"AAyBA,SAAS,eAAe,CAAC,EAA6B;IACpD,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAC/D,CAAC;AAED,SAAS,iBAAiB,CAAC,QAAmC;IAC5D,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAC/C,CAAC;AAED,SAAS,OAAO,CACd,KAAuC,EACvC,IAAqC;IAErC,MAAM,EAAE,GAAG,eAAe,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACrC,IAAI,CAAC,EAAE;QAAE,O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CAAC;SACvB,GAAG,CAAC,EAAE,CAAC;QACR,EAAE,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,KAAK,CACrE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { OverlayRect } from "../page-editor-chrome/overlay/geometry";
|
|
2
|
+
/**
|
|
3
|
+
* The canvas overview ruler: one narrow strip on the canvas's right edge that
|
|
4
|
+
* maps the whole page onto the visible height, like an editor's scrollbar
|
|
5
|
+
* map. Comments, suggestions, an agent's changes, spelling mistakes and
|
|
6
|
+
* validation issues share the strip and differ by colour. Each highlighting publishes its marks as a source, in overlay
|
|
7
|
+
* (document) pixels; the page's extent in the same pixels scales them. A
|
|
8
|
+
* click on a mark scrolls the canvas to it, unless its source takes the click
|
|
9
|
+
* itself (e.g. to open the comment thread).
|
|
10
|
+
*/
|
|
11
|
+
export type OverviewRulerSource = "comments" | "suggestions" | "agent-changes" | "spelling" | "validation";
|
|
12
|
+
export type OverviewRulerTone = "comment" | "comment-resolved" | "suggestion" | "added" | "removed" | "spelling" | "validation-error" | "validation-warning" | "validation-suggestion";
|
|
13
|
+
export type OverviewRulerMark = {
|
|
14
|
+
top: number;
|
|
15
|
+
height: number;
|
|
16
|
+
tone: OverviewRulerTone;
|
|
17
|
+
/** What the dash stands for (e.g. thread ids), topmost first. */
|
|
18
|
+
ids?: readonly string[];
|
|
19
|
+
/** Tooltip lines (e.g. validation messages), topmost first. */
|
|
20
|
+
details?: readonly string[];
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Paint order where marks overlap: later tones draw over earlier ones, so an
|
|
24
|
+
* open comment or a validation error stays visible on top of the text it is
|
|
25
|
+
* about, and the many small spelling marks never hide anything.
|
|
26
|
+
*/
|
|
27
|
+
export declare const OVERVIEW_RULER_TONE_PAINT_ORDER: readonly OverviewRulerTone[];
|
|
28
|
+
export declare const OVERVIEW_RULER_WIDTH = 10;
|
|
29
|
+
/**
|
|
30
|
+
* Every mark is a line of this height in ruler pixels, at the top of what it
|
|
31
|
+
* marks, however long the marked text is: the ruler shows where, not how much.
|
|
32
|
+
*/
|
|
33
|
+
export declare const OVERVIEW_RULER_MARK_HEIGHT = 3;
|
|
34
|
+
/**
|
|
35
|
+
* Collapses highlight rects into ruler dashes: one dash per run of marks, so a
|
|
36
|
+
* paragraph of highlights reads as a single mark instead of a stack of
|
|
37
|
+
* overlapping slivers. Each tone is merged on its own, in paint order; a
|
|
38
|
+
* merged dash keeps the ids and details of everything it covers.
|
|
39
|
+
*/
|
|
40
|
+
export declare function buildOverviewRulerMarks(highlights: ReadonlyArray<{
|
|
41
|
+
tone: OverviewRulerTone;
|
|
42
|
+
rects: OverlayRect[];
|
|
43
|
+
ids?: readonly string[];
|
|
44
|
+
details?: readonly string[];
|
|
45
|
+
}>): OverviewRulerMark[];
|
|
46
|
+
export type OverviewRulerSources = Partial<Record<OverviewRulerSource, OverviewRulerMark[]>>;
|
|
47
|
+
export type OverviewRulerSnapshot = {
|
|
48
|
+
sources: OverviewRulerSources;
|
|
49
|
+
/** Page height in the marks' pixels; 0 while unknown. */
|
|
50
|
+
extent: number;
|
|
51
|
+
};
|
|
52
|
+
/** A mark placed on the ruler, as a fraction (0–1) of the ruler's height. */
|
|
53
|
+
export type OverviewRulerPlacedMark = {
|
|
54
|
+
top: number;
|
|
55
|
+
tone: OverviewRulerTone;
|
|
56
|
+
source: OverviewRulerSource;
|
|
57
|
+
/** The published mark, handed back to its source on a click. */
|
|
58
|
+
mark: OverviewRulerMark;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Every published mark in paint order, scaled from page pixels to fractions of
|
|
62
|
+
* the ruler. Null while no source is published or the page extent is unknown.
|
|
63
|
+
*/
|
|
64
|
+
export declare function layoutOverviewRuler({ sources, extent, }: OverviewRulerSnapshot): OverviewRulerPlacedMark[] | null;
|
|
65
|
+
/** For measurements producing marks: `null` means "no marks to publish". */
|
|
66
|
+
export declare function overviewRulerMarksEqual(a: OverviewRulerMark[] | null, b: OverviewRulerMark[] | null): boolean;
|
|
67
|
+
/** `scrollToMark` is the ruler's own click action, for handlers adding to it. */
|
|
68
|
+
export type OverviewRulerActivate = (mark: OverviewRulerMark, scrollToMark: () => void) => void;
|
|
69
|
+
/** How the canvas scrolls a mark into view. */
|
|
70
|
+
export type OverviewRulerScroller = (mark: OverviewRulerMark) => void;
|
|
71
|
+
export type OverviewRulerStore = ReturnType<typeof createOverviewRulerStore>;
|
|
72
|
+
export declare function createOverviewRulerStore(): {
|
|
73
|
+
getSnapshot: () => OverviewRulerSnapshot;
|
|
74
|
+
subscribe(listener: () => void): () => void;
|
|
75
|
+
/**
|
|
76
|
+
* `null` withdraws the source; an empty array keeps the source published
|
|
77
|
+
* with nothing marked.
|
|
78
|
+
*/
|
|
79
|
+
publish(source: OverviewRulerSource, marks: OverviewRulerMark[] | null): void;
|
|
80
|
+
setExtent(extent: number): void;
|
|
81
|
+
/** Scrolls the canvas to a mark: what a click does by default. */
|
|
82
|
+
setScroller(next: OverviewRulerScroller | null): void;
|
|
83
|
+
/** What a click on the source's marks does; not part of the snapshot. */
|
|
84
|
+
setActivateHandler(source: OverviewRulerSource, handler: OverviewRulerActivate | null): void;
|
|
85
|
+
activate(source: OverviewRulerSource, mark: OverviewRulerMark): void;
|
|
86
|
+
};
|
|
87
|
+
export declare const OverviewRulerContext: import("react").Context<{
|
|
88
|
+
getSnapshot: () => OverviewRulerSnapshot;
|
|
89
|
+
subscribe(listener: () => void): () => void;
|
|
90
|
+
/**
|
|
91
|
+
* `null` withdraws the source; an empty array keeps the source published
|
|
92
|
+
* with nothing marked.
|
|
93
|
+
*/
|
|
94
|
+
publish(source: OverviewRulerSource, marks: OverviewRulerMark[] | null): void;
|
|
95
|
+
setExtent(extent: number): void;
|
|
96
|
+
/** Scrolls the canvas to a mark: what a click does by default. */
|
|
97
|
+
setScroller(next: OverviewRulerScroller | null): void;
|
|
98
|
+
/** What a click on the source's marks does; not part of the snapshot. */
|
|
99
|
+
setActivateHandler(source: OverviewRulerSource, handler: OverviewRulerActivate | null): void;
|
|
100
|
+
activate(source: OverviewRulerSource, mark: OverviewRulerMark): void;
|
|
101
|
+
} | null>;
|
|
102
|
+
export declare function useOverviewRulerStore(): {
|
|
103
|
+
getSnapshot: () => OverviewRulerSnapshot;
|
|
104
|
+
subscribe(listener: () => void): () => void;
|
|
105
|
+
/**
|
|
106
|
+
* `null` withdraws the source; an empty array keeps the source published
|
|
107
|
+
* with nothing marked.
|
|
108
|
+
*/
|
|
109
|
+
publish(source: OverviewRulerSource, marks: OverviewRulerMark[] | null): void;
|
|
110
|
+
setExtent(extent: number): void;
|
|
111
|
+
/** Scrolls the canvas to a mark: what a click does by default. */
|
|
112
|
+
setScroller(next: OverviewRulerScroller | null): void;
|
|
113
|
+
/** What a click on the source's marks does; not part of the snapshot. */
|
|
114
|
+
setActivateHandler(source: OverviewRulerSource, handler: OverviewRulerActivate | null): void;
|
|
115
|
+
activate(source: OverviewRulerSource, mark: OverviewRulerMark): void;
|
|
116
|
+
} | null;
|
|
117
|
+
export declare function useOverviewRulerSnapshot(): OverviewRulerSnapshot;
|
|
118
|
+
/**
|
|
119
|
+
* Publishes marks into the surrounding ruler (a no-op outside one, e.g. on
|
|
120
|
+
* the minimap, or without a `source`). Pass memoized marks; `null` keeps the
|
|
121
|
+
* source out of the ruler. `onActivate` replaces scrolling to a clicked mark.
|
|
122
|
+
*/
|
|
123
|
+
export declare function usePublishOverviewRulerMarks(source: OverviewRulerSource | undefined, marks: OverviewRulerMark[] | null, onActivate?: OverviewRulerActivate): void;
|
|
124
|
+
/**
|
|
125
|
+
* Connects the ruler to its canvas: the page height the marks are scaled
|
|
126
|
+
* against (0 = unknown) and how to scroll the canvas to a mark.
|
|
127
|
+
*/
|
|
128
|
+
export declare function usePublishOverviewRulerCanvas(extent: number, scrollToMark: OverviewRulerScroller): void;
|