@parhelia/core 0.1.10745
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/LICENSE +8 -0
- package/README.md +34 -0
- package/dev.css +3 -0
- package/dist/agents-view/AgentCard.d.ts +12 -0
- package/dist/agents-view/AgentCard.js +30 -0
- package/dist/agents-view/AgentCard.js.map +1 -0
- package/dist/agents-view/AgentsView.d.ts +5 -0
- package/dist/agents-view/AgentsView.js +255 -0
- package/dist/agents-view/AgentsView.js.map +1 -0
- package/dist/agents-view/ProfileAgentsGroup.d.ts +17 -0
- package/dist/agents-view/ProfileAgentsGroup.js +13 -0
- package/dist/agents-view/ProfileAgentsGroup.js.map +1 -0
- package/dist/client-components/api.d.ts +1 -0
- package/dist/client-components/api.js +4 -0
- package/dist/client-components/api.js.map +1 -0
- package/dist/client-components/index.d.ts +17 -0
- package/dist/client-components/index.js +18 -0
- package/dist/client-components/index.js.map +1 -0
- package/dist/components/ActionButton.d.ts +14 -0
- package/dist/components/ActionButton.js +6 -0
- package/dist/components/ActionButton.js.map +1 -0
- package/dist/components/Error.d.ts +9 -0
- package/dist/components/Error.js +24 -0
- package/dist/components/Error.js.map +1 -0
- package/dist/components/FilterInput.d.ts +22 -0
- package/dist/components/FilterInput.js +29 -0
- package/dist/components/FilterInput.js.map +1 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.js +5 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/ui/CardConnector.d.ts +4 -0
- package/dist/components/ui/CardConnector.js +6 -0
- package/dist/components/ui/CardConnector.js.map +1 -0
- package/dist/components/ui/LanguageSelector.d.ts +8 -0
- package/dist/components/ui/LanguageSelector.js +47 -0
- package/dist/components/ui/LanguageSelector.js.map +1 -0
- package/dist/components/ui/PlaceholderInput.d.ts +41 -0
- package/dist/components/ui/PlaceholderInput.js +160 -0
- package/dist/components/ui/PlaceholderInput.js.map +1 -0
- package/dist/components/ui/PlaceholderInputTypes.d.ts +41 -0
- package/dist/components/ui/PlaceholderInputTypes.js +48 -0
- package/dist/components/ui/PlaceholderInputTypes.js.map +1 -0
- package/dist/components/ui/PlaceholderItemSelector.d.ts +7 -0
- package/dist/components/ui/PlaceholderItemSelector.js +154 -0
- package/dist/components/ui/PlaceholderItemSelector.js.map +1 -0
- package/dist/components/ui/alert.d.ts +7 -0
- package/dist/components/ui/alert.js +21 -0
- package/dist/components/ui/alert.js.map +1 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/badge.js +23 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/button.d.ts +10 -0
- package/dist/components/ui/button.js +33 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/calendar.d.ts +7 -0
- package/dist/components/ui/calendar.js +58 -0
- package/dist/components/ui/calendar.js.map +1 -0
- package/dist/components/ui/card.d.ts +19 -0
- package/dist/components/ui/card.js +78 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/checkbox.js +10 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/command.d.ts +18 -0
- package/dist/components/ui/command.js +35 -0
- package/dist/components/ui/command.js.map +1 -0
- package/dist/components/ui/context-menu.d.ts +53 -0
- package/dist/components/ui/context-menu.js +290 -0
- package/dist/components/ui/context-menu.js.map +1 -0
- package/dist/components/ui/copy-button.d.ts +10 -0
- package/dist/components/ui/copy-button.js +61 -0
- package/dist/components/ui/copy-button.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +16 -0
- package/dist/components/ui/dialog.js +37 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +25 -0
- package/dist/components/ui/dropdown-menu.js +52 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/input.js +9 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/menubar.d.ts +26 -0
- package/dist/components/ui/menubar.js +55 -0
- package/dist/components/ui/menubar.js.map +1 -0
- package/dist/components/ui/paste-button.d.ts +14 -0
- package/dist/components/ui/paste-button.js +114 -0
- package/dist/components/ui/paste-button.js.map +1 -0
- package/dist/components/ui/popover.d.ts +11 -0
- package/dist/components/ui/popover.js +66 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/progress.d.ts +7 -0
- package/dist/components/ui/progress.js +9 -0
- package/dist/components/ui/progress.js.map +1 -0
- package/dist/components/ui/select.d.ts +18 -0
- package/dist/components/ui/select.js +34 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/sonner.d.ts +3 -0
- package/dist/components/ui/sonner.js +16 -0
- package/dist/components/ui/sonner.js.map +1 -0
- package/dist/components/ui/switch.d.ts +4 -0
- package/dist/components/ui/switch.js +9 -0
- package/dist/components/ui/switch.js.map +1 -0
- package/dist/components/ui/tabs.d.ts +17 -0
- package/dist/components/ui/tabs.js +27 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/textarea.js +11 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +9 -0
- package/dist/components/ui/tooltip.js +18 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/components/ui/upload-button.d.ts +15 -0
- package/dist/components/ui/upload-button.js +56 -0
- package/dist/components/ui/upload-button.js.map +1 -0
- package/dist/config/config.d.ts +24 -0
- package/dist/config/config.js +1087 -0
- package/dist/config/config.js.map +1 -0
- package/dist/config/types.d.ts +249 -0
- package/dist/config/types.js +2 -0
- package/dist/config/types.js.map +1 -0
- package/dist/editor/AspectRatioSelector.d.ts +13 -0
- package/dist/editor/AspectRatioSelector.js +71 -0
- package/dist/editor/AspectRatioSelector.js.map +1 -0
- package/dist/editor/ComponentInfo.d.ts +4 -0
- package/dist/editor/ComponentInfo.js +41 -0
- package/dist/editor/ComponentInfo.js.map +1 -0
- package/dist/editor/ConfirmationDialog.d.ts +19 -0
- package/dist/editor/ConfirmationDialog.js +31 -0
- package/dist/editor/ConfirmationDialog.js.map +1 -0
- package/dist/editor/ContentTree.d.ts +39 -0
- package/dist/editor/ContentTree.js +586 -0
- package/dist/editor/ContentTree.js.map +1 -0
- package/dist/editor/ContextMenu.d.ts +15 -0
- package/dist/editor/ContextMenu.js +239 -0
- package/dist/editor/ContextMenu.js.map +1 -0
- package/dist/editor/Editor.d.ts +12 -0
- package/dist/editor/Editor.js +59 -0
- package/dist/editor/Editor.js.map +1 -0
- package/dist/editor/EditorWarning.d.ts +5 -0
- package/dist/editor/EditorWarning.js +12 -0
- package/dist/editor/EditorWarning.js.map +1 -0
- package/dist/editor/EditorWarnings.d.ts +9 -0
- package/dist/editor/EditorWarnings.js +19 -0
- package/dist/editor/EditorWarnings.js.map +1 -0
- package/dist/editor/FieldActionsOverlay.d.ts +18 -0
- package/dist/editor/FieldActionsOverlay.js +201 -0
- package/dist/editor/FieldActionsOverlay.js.map +1 -0
- package/dist/editor/FieldEditorPopup.d.ts +10 -0
- package/dist/editor/FieldEditorPopup.js +23 -0
- package/dist/editor/FieldEditorPopup.js.map +1 -0
- package/dist/editor/FieldHistory.d.ts +7 -0
- package/dist/editor/FieldHistory.js +42 -0
- package/dist/editor/FieldHistory.js.map +1 -0
- package/dist/editor/FieldList.d.ts +19 -0
- package/dist/editor/FieldList.js +90 -0
- package/dist/editor/FieldList.js.map +1 -0
- package/dist/editor/FieldListField.d.ts +16 -0
- package/dist/editor/FieldListField.js +231 -0
- package/dist/editor/FieldListField.js.map +1 -0
- package/dist/editor/FieldListFieldWithFallbacks.d.ts +11 -0
- package/dist/editor/FieldListFieldWithFallbacks.js +120 -0
- package/dist/editor/FieldListFieldWithFallbacks.js.map +1 -0
- package/dist/editor/FloatingToolbar.d.ts +7 -0
- package/dist/editor/FloatingToolbar.js +91 -0
- package/dist/editor/FloatingToolbar.js.map +1 -0
- package/dist/editor/ImageEditButton.d.ts +27 -0
- package/dist/editor/ImageEditButton.js +22 -0
- package/dist/editor/ImageEditButton.js.map +1 -0
- package/dist/editor/ImageEditor.d.ts +5 -0
- package/dist/editor/ImageEditor.js +76 -0
- package/dist/editor/ImageEditor.js.map +1 -0
- package/dist/editor/ItemInfo.d.ts +4 -0
- package/dist/editor/ItemInfo.js +36 -0
- package/dist/editor/ItemInfo.js.map +1 -0
- package/dist/editor/LinkEditorDialog.d.ts +18 -0
- package/dist/editor/LinkEditorDialog.js +101 -0
- package/dist/editor/LinkEditorDialog.js.map +1 -0
- package/dist/editor/MainLayout.d.ts +12 -0
- package/dist/editor/MainLayout.js +55 -0
- package/dist/editor/MainLayout.js.map +1 -0
- package/dist/editor/MobileLayout.d.ts +2 -0
- package/dist/editor/MobileLayout.js +34 -0
- package/dist/editor/MobileLayout.js.map +1 -0
- package/dist/editor/NewEditorClient.d.ts +5 -0
- package/dist/editor/NewEditorClient.js +7 -0
- package/dist/editor/NewEditorClient.js.map +1 -0
- package/dist/editor/PictureCropper.d.ts +6 -0
- package/dist/editor/PictureCropper.js +722 -0
- package/dist/editor/PictureCropper.js.map +1 -0
- package/dist/editor/PictureEditor.d.ts +9 -0
- package/dist/editor/PictureEditor.js +180 -0
- package/dist/editor/PictureEditor.js.map +1 -0
- package/dist/editor/PictureEditorDialog.d.ts +8 -0
- package/dist/editor/PictureEditorDialog.js +195 -0
- package/dist/editor/PictureEditorDialog.js.map +1 -0
- package/dist/editor/QuickItemSwitcher.d.ts +9 -0
- package/dist/editor/QuickItemSwitcher.js +78 -0
- package/dist/editor/QuickItemSwitcher.js.map +1 -0
- package/dist/editor/ScrollingContentTree.d.ts +10 -0
- package/dist/editor/ScrollingContentTree.js +54 -0
- package/dist/editor/ScrollingContentTree.js.map +1 -0
- package/dist/editor/Titlebar.d.ts +1 -0
- package/dist/editor/Titlebar.js +46 -0
- package/dist/editor/Titlebar.js.map +1 -0
- package/dist/editor/ai/AgentCostDisplay.d.ts +32 -0
- package/dist/editor/ai/AgentCostDisplay.js +93 -0
- package/dist/editor/ai/AgentCostDisplay.js.map +1 -0
- package/dist/editor/ai/AgentHistory.d.ts +11 -0
- package/dist/editor/ai/AgentHistory.js +12 -0
- package/dist/editor/ai/AgentHistory.js.map +1 -0
- package/dist/editor/ai/AgentProfilesOverview.d.ts +9 -0
- package/dist/editor/ai/AgentProfilesOverview.js +16 -0
- package/dist/editor/ai/AgentProfilesOverview.js.map +1 -0
- package/dist/editor/ai/AgentStatusBadge.d.ts +26 -0
- package/dist/editor/ai/AgentStatusBadge.js +126 -0
- package/dist/editor/ai/AgentStatusBadge.js.map +1 -0
- package/dist/editor/ai/AgentTerminal.d.ts +14 -0
- package/dist/editor/ai/AgentTerminal.js +2634 -0
- package/dist/editor/ai/AgentTerminal.js.map +1 -0
- package/dist/editor/ai/Agents.d.ts +4 -0
- package/dist/editor/ai/Agents.js +813 -0
- package/dist/editor/ai/Agents.js.map +1 -0
- package/dist/editor/ai/AiResponseMessage.d.ts +18 -0
- package/dist/editor/ai/AiResponseMessage.js +684 -0
- package/dist/editor/ai/AiResponseMessage.js.map +1 -0
- package/dist/editor/ai/ContextInfoBar.d.ts +11 -0
- package/dist/editor/ai/ContextInfoBar.js +355 -0
- package/dist/editor/ai/ContextInfoBar.js.map +1 -0
- package/dist/editor/ai/DancingDots.d.ts +1 -0
- package/dist/editor/ai/DancingDots.js +6 -0
- package/dist/editor/ai/DancingDots.js.map +1 -0
- package/dist/editor/ai/MediaImage.d.ts +6 -0
- package/dist/editor/ai/MediaImage.js +38 -0
- package/dist/editor/ai/MediaImage.js.map +1 -0
- package/dist/editor/ai/ToolCallDisplay.d.ts +45 -0
- package/dist/editor/ai/ToolCallDisplay.js +292 -0
- package/dist/editor/ai/ToolCallDisplay.js.map +1 -0
- package/dist/editor/ai/aiPageModel.d.ts +24 -0
- package/dist/editor/ai/aiPageModel.js +97 -0
- package/dist/editor/ai/aiPageModel.js.map +1 -0
- package/dist/editor/ai/editorAiContext.d.ts +10 -0
- package/dist/editor/ai/editorAiContext.js +10 -0
- package/dist/editor/ai/editorAiContext.js.map +1 -0
- package/dist/editor/ai/types.d.ts +30 -0
- package/dist/editor/ai/types.js +2 -0
- package/dist/editor/ai/types.js.map +1 -0
- package/dist/editor/ai/useAgentStatus.d.ts +14 -0
- package/dist/editor/ai/useAgentStatus.js +203 -0
- package/dist/editor/ai/useAgentStatus.js.map +1 -0
- package/dist/editor/client/AboutDialog.d.ts +2 -0
- package/dist/editor/client/AboutDialog.js +23 -0
- package/dist/editor/client/AboutDialog.js.map +1 -0
- package/dist/editor/client/EditorShell.d.ts +37 -0
- package/dist/editor/client/EditorShell.js +2388 -0
- package/dist/editor/client/EditorShell.js.map +1 -0
- package/dist/editor/client/GenericDialog.d.ts +10 -0
- package/dist/editor/client/GenericDialog.js +25 -0
- package/dist/editor/client/GenericDialog.js.map +1 -0
- package/dist/editor/client/editContext.d.ts +260 -0
- package/dist/editor/client/editContext.js +29 -0
- package/dist/editor/client/editContext.js.map +1 -0
- package/dist/editor/client/fieldModificationStore.d.ts +25 -0
- package/dist/editor/client/fieldModificationStore.js +184 -0
- package/dist/editor/client/fieldModificationStore.js.map +1 -0
- package/dist/editor/client/helpers.d.ts +12 -0
- package/dist/editor/client/helpers.js +29 -0
- package/dist/editor/client/helpers.js.map +1 -0
- package/dist/editor/client/hooks/useEditorUrlSync.d.ts +18 -0
- package/dist/editor/client/hooks/useEditorUrlSync.js +56 -0
- package/dist/editor/client/hooks/useEditorUrlSync.js.map +1 -0
- package/dist/editor/client/hooks/useEditorWebSocket.d.ts +11 -0
- package/dist/editor/client/hooks/useEditorWebSocket.js +86 -0
- package/dist/editor/client/hooks/useEditorWebSocket.js.map +1 -0
- package/dist/editor/client/hooks/useGlobalEditorKeyDown.d.ts +1 -0
- package/dist/editor/client/hooks/useGlobalEditorKeyDown.js +12 -0
- package/dist/editor/client/hooks/useGlobalEditorKeyDown.js.map +1 -0
- package/dist/editor/client/hooks/useMediaQuery.d.ts +1 -0
- package/dist/editor/client/hooks/useMediaQuery.js +19 -0
- package/dist/editor/client/hooks/useMediaQuery.js.map +1 -0
- package/dist/editor/client/hooks/useMediaSelector.d.ts +12 -0
- package/dist/editor/client/hooks/useMediaSelector.js +30 -0
- package/dist/editor/client/hooks/useMediaSelector.js.map +1 -0
- package/dist/editor/client/hooks/useQuota.d.ts +29 -0
- package/dist/editor/client/hooks/useQuota.js +53 -0
- package/dist/editor/client/hooks/useQuota.js.map +1 -0
- package/dist/editor/client/hooks/useSocketMessageHandler.d.ts +35 -0
- package/dist/editor/client/hooks/useSocketMessageHandler.js +234 -0
- package/dist/editor/client/hooks/useSocketMessageHandler.js.map +1 -0
- package/dist/editor/client/hooks/useWorkbox.d.ts +9 -0
- package/dist/editor/client/hooks/useWorkbox.js +52 -0
- package/dist/editor/client/hooks/useWorkbox.js.map +1 -0
- package/dist/editor/client/itemsRepository.d.ts +38 -0
- package/dist/editor/client/itemsRepository.js +468 -0
- package/dist/editor/client/itemsRepository.js.map +1 -0
- package/dist/editor/client/operations.d.ts +69 -0
- package/dist/editor/client/operations.js +627 -0
- package/dist/editor/client/operations.js.map +1 -0
- package/dist/editor/client/pageModelBuilder.d.ts +6 -0
- package/dist/editor/client/pageModelBuilder.js +155 -0
- package/dist/editor/client/pageModelBuilder.js.map +1 -0
- package/dist/editor/client/ui/EditorChrome.d.ts +12 -0
- package/dist/editor/client/ui/EditorChrome.js +30 -0
- package/dist/editor/client/ui/EditorChrome.js.map +1 -0
- package/dist/editor/client/ui/FullscreenControls.d.ts +7 -0
- package/dist/editor/client/ui/FullscreenControls.js +21 -0
- package/dist/editor/client/ui/FullscreenControls.js.map +1 -0
- package/dist/editor/commands/agentCommands.d.ts +9 -0
- package/dist/editor/commands/agentCommands.js +30 -0
- package/dist/editor/commands/agentCommands.js.map +1 -0
- package/dist/editor/commands/commands.d.ts +19 -0
- package/dist/editor/commands/commands.js +2 -0
- package/dist/editor/commands/commands.js.map +1 -0
- package/dist/editor/commands/componentCommands.d.ts +12 -0
- package/dist/editor/commands/componentCommands.js +378 -0
- package/dist/editor/commands/componentCommands.js.map +1 -0
- package/dist/editor/commands/createVersionCommand.d.ts +4 -0
- package/dist/editor/commands/createVersionCommand.js +24 -0
- package/dist/editor/commands/createVersionCommand.js.map +1 -0
- package/dist/editor/commands/deleteVersionCommand.d.ts +4 -0
- package/dist/editor/commands/deleteVersionCommand.js +53 -0
- package/dist/editor/commands/deleteVersionCommand.js.map +1 -0
- package/dist/editor/commands/itemCommands.d.ts +29 -0
- package/dist/editor/commands/itemCommands.js +428 -0
- package/dist/editor/commands/itemCommands.js.map +1 -0
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.d.ts +8 -0
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.js +91 -0
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.js.map +1 -0
- package/dist/editor/commands/undo.d.ts +15 -0
- package/dist/editor/commands/undo.js +29 -0
- package/dist/editor/commands/undo.js.map +1 -0
- package/dist/editor/componentTreeHelper.d.ts +18 -0
- package/dist/editor/componentTreeHelper.js +123 -0
- package/dist/editor/componentTreeHelper.js.map +1 -0
- package/dist/editor/context-menu/CopyMoveMenu.d.ts +7 -0
- package/dist/editor/context-menu/CopyMoveMenu.js +58 -0
- package/dist/editor/context-menu/CopyMoveMenu.js.map +1 -0
- package/dist/editor/context-menu/InsertMenu.d.ts +9 -0
- package/dist/editor/context-menu/InsertMenu.js +229 -0
- package/dist/editor/context-menu/InsertMenu.js.map +1 -0
- package/dist/editor/control-center/About.d.ts +1 -0
- package/dist/editor/control-center/About.js +8 -0
- package/dist/editor/control-center/About.js.map +1 -0
- package/dist/editor/control-center/AllAgentsPanel.d.ts +5 -0
- package/dist/editor/control-center/AllAgentsPanel.js +126 -0
- package/dist/editor/control-center/AllAgentsPanel.js.map +1 -0
- package/dist/editor/control-center/ControlCenterMenu.d.ts +1 -0
- package/dist/editor/control-center/ControlCenterMenu.js +66 -0
- package/dist/editor/control-center/ControlCenterMenu.js.map +1 -0
- package/dist/editor/control-center/IndexOverview.d.ts +1 -0
- package/dist/editor/control-center/IndexOverview.js +323 -0
- package/dist/editor/control-center/IndexOverview.js.map +1 -0
- package/dist/editor/control-center/Info.d.ts +1 -0
- package/dist/editor/control-center/Info.js +10 -0
- package/dist/editor/control-center/Info.js.map +1 -0
- package/dist/editor/control-center/LatestFeedback.d.ts +1 -0
- package/dist/editor/control-center/LatestFeedback.js +136 -0
- package/dist/editor/control-center/LatestFeedback.js.map +1 -0
- package/dist/editor/control-center/QuotaInfo.d.ts +1 -0
- package/dist/editor/control-center/QuotaInfo.js +102 -0
- package/dist/editor/control-center/QuotaInfo.js.map +1 -0
- package/dist/editor/control-center/Setup.d.ts +1 -0
- package/dist/editor/control-center/Setup.js +18 -0
- package/dist/editor/control-center/Setup.js.map +1 -0
- package/dist/editor/control-center/Status.d.ts +1 -0
- package/dist/editor/control-center/Status.js +79 -0
- package/dist/editor/control-center/Status.js.map +1 -0
- package/dist/editor/control-center/WebSocketMessages.d.ts +1 -0
- package/dist/editor/control-center/WebSocketMessages.js +71 -0
- package/dist/editor/control-center/WebSocketMessages.js.map +1 -0
- package/dist/editor/control-center/parhelia-setup/Overview.d.ts +1 -0
- package/dist/editor/control-center/parhelia-setup/Overview.js +91 -0
- package/dist/editor/control-center/parhelia-setup/Overview.js.map +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/EmbeddingsModelSection.d.ts +2 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/EmbeddingsModelSection.js +195 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/EmbeddingsModelSection.js.map +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/index.d.ts +2 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/index.js +22 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/index.js.map +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/provider/ProviderSection.d.ts +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/provider/ProviderSection.js +233 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/provider/ProviderSection.js.map +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/required-containers/RequiredContainersList.d.ts +15 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/required-containers/RequiredContainersList.js +14 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/required-containers/RequiredContainersList.js.map +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/required-containers/RequiredContainersSection.d.ts +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/required-containers/RequiredContainersSection.js +94 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/required-containers/RequiredContainersSection.js.map +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/tools/GenerateToolsSection.d.ts +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/tools/GenerateToolsSection.js +367 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/tools/GenerateToolsSection.js.map +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/types.d.ts +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/types.js +2 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/types.js.map +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/utils.d.ts +4 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/utils.js +25 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/utils.js.map +1 -0
- package/dist/editor/control-center/setup-steps/DbSetupStep.d.ts +2 -0
- package/dist/editor/control-center/setup-steps/DbSetupStep.js +46 -0
- package/dist/editor/control-center/setup-steps/DbSetupStep.js.map +1 -0
- package/dist/editor/control-center/setup-steps/IndexSetupStep.d.ts +2 -0
- package/dist/editor/control-center/setup-steps/IndexSetupStep.js +36 -0
- package/dist/editor/control-center/setup-steps/IndexSetupStep.js.map +1 -0
- package/dist/editor/control-center/setup-steps/SettingsSetupStep.d.ts +2 -0
- package/dist/editor/control-center/setup-steps/SettingsSetupStep.js +107 -0
- package/dist/editor/control-center/setup-steps/SettingsSetupStep.js.map +1 -0
- package/dist/editor/editor-warnings/ItemLocked.d.ts +2 -0
- package/dist/editor/editor-warnings/ItemLocked.js +38 -0
- package/dist/editor/editor-warnings/ItemLocked.js.map +1 -0
- package/dist/editor/editor-warnings/NoLanguageWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoLanguageWriteAccess.js +14 -0
- package/dist/editor/editor-warnings/NoLanguageWriteAccess.js.map +1 -0
- package/dist/editor/editor-warnings/NoWorkflowWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoWorkflowWriteAccess.js +14 -0
- package/dist/editor/editor-warnings/NoWorkflowWriteAccess.js.map +1 -0
- package/dist/editor/editor-warnings/NoWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoWriteAccess.js +14 -0
- package/dist/editor/editor-warnings/NoWriteAccess.js.map +1 -0
- package/dist/editor/editor-warnings/ValidationErrors.d.ts +2 -0
- package/dist/editor/editor-warnings/ValidationErrors.js +28 -0
- package/dist/editor/editor-warnings/ValidationErrors.js.map +1 -0
- package/dist/editor/field-types/AttachmentEditor.d.ts +9 -0
- package/dist/editor/field-types/AttachmentEditor.js +73 -0
- package/dist/editor/field-types/AttachmentEditor.js.map +1 -0
- package/dist/editor/field-types/CheckboxEditor.d.ts +5 -0
- package/dist/editor/field-types/CheckboxEditor.js +30 -0
- package/dist/editor/field-types/CheckboxEditor.js.map +1 -0
- package/dist/editor/field-types/DateFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/DateFieldEditor.js +93 -0
- package/dist/editor/field-types/DateFieldEditor.js.map +1 -0
- package/dist/editor/field-types/DateTimeFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/DateTimeFieldEditor.js +151 -0
- package/dist/editor/field-types/DateTimeFieldEditor.js.map +1 -0
- package/dist/editor/field-types/DropLinkEditor.d.ts +5 -0
- package/dist/editor/field-types/DropLinkEditor.js +42 -0
- package/dist/editor/field-types/DropLinkEditor.js.map +1 -0
- package/dist/editor/field-types/DropListEditor.d.ts +5 -0
- package/dist/editor/field-types/DropListEditor.js +46 -0
- package/dist/editor/field-types/DropListEditor.js.map +1 -0
- package/dist/editor/field-types/ImageFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/ImageFieldEditor.js +34 -0
- package/dist/editor/field-types/ImageFieldEditor.js.map +1 -0
- package/dist/editor/field-types/InternalLinkFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/InternalLinkFieldEditor.js +120 -0
- package/dist/editor/field-types/InternalLinkFieldEditor.js.map +1 -0
- package/dist/editor/field-types/LinkFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/LinkFieldEditor.js +62 -0
- package/dist/editor/field-types/LinkFieldEditor.js.map +1 -0
- package/dist/editor/field-types/MultiLineText.d.ts +7 -0
- package/dist/editor/field-types/MultiLineText.js +48 -0
- package/dist/editor/field-types/MultiLineText.js.map +1 -0
- package/dist/editor/field-types/NameValueListEditor.d.ts +7 -0
- package/dist/editor/field-types/NameValueListEditor.js +101 -0
- package/dist/editor/field-types/NameValueListEditor.js.map +1 -0
- package/dist/editor/field-types/PictureFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/PictureFieldEditor.js +58 -0
- package/dist/editor/field-types/PictureFieldEditor.js.map +1 -0
- package/dist/editor/field-types/RawEditor.d.ts +6 -0
- package/dist/editor/field-types/RawEditor.js +31 -0
- package/dist/editor/field-types/RawEditor.js.map +1 -0
- package/dist/editor/field-types/ReactQuill.d.ts +125 -0
- package/dist/editor/field-types/ReactQuill.js +385 -0
- package/dist/editor/field-types/ReactQuill.js.map +1 -0
- package/dist/editor/field-types/RichTextEditor.d.ts +7 -0
- package/dist/editor/field-types/RichTextEditor.js +21 -0
- package/dist/editor/field-types/RichTextEditor.js.map +1 -0
- package/dist/editor/field-types/RichTextEditorComponent.d.ts +8 -0
- package/dist/editor/field-types/RichTextEditorComponent.js +74 -0
- package/dist/editor/field-types/RichTextEditorComponent.js.map +1 -0
- package/dist/editor/field-types/SingleLineText.d.ts +7 -0
- package/dist/editor/field-types/SingleLineText.js +113 -0
- package/dist/editor/field-types/SingleLineText.js.map +1 -0
- package/dist/editor/field-types/TreeListEditor.d.ts +5 -0
- package/dist/editor/field-types/TreeListEditor.js +316 -0
- package/dist/editor/field-types/TreeListEditor.js.map +1 -0
- package/dist/editor/field-types/richtext/components/EditorDropdown.d.ts +11 -0
- package/dist/editor/field-types/richtext/components/EditorDropdown.js +83 -0
- package/dist/editor/field-types/richtext/components/EditorDropdown.js.map +1 -0
- package/dist/editor/field-types/richtext/components/ReactSlate.d.ts +5 -0
- package/dist/editor/field-types/richtext/components/ReactSlate.js +607 -0
- package/dist/editor/field-types/richtext/components/ReactSlate.js.map +1 -0
- package/dist/editor/field-types/richtext/components/SimpleDropdown.d.ts +18 -0
- package/dist/editor/field-types/richtext/components/SimpleDropdown.js +71 -0
- package/dist/editor/field-types/richtext/components/SimpleDropdown.js.map +1 -0
- package/dist/editor/field-types/richtext/components/SimpleRichTextEditor.d.ts +5 -0
- package/dist/editor/field-types/richtext/components/SimpleRichTextEditor.js +359 -0
- package/dist/editor/field-types/richtext/components/SimpleRichTextEditor.js.map +1 -0
- package/dist/editor/field-types/richtext/components/SimpleToolbar.d.ts +16 -0
- package/dist/editor/field-types/richtext/components/SimpleToolbar.js +181 -0
- package/dist/editor/field-types/richtext/components/SimpleToolbar.js.map +1 -0
- package/dist/editor/field-types/richtext/components/SimpleToolbarButton.d.ts +9 -0
- package/dist/editor/field-types/richtext/components/SimpleToolbarButton.js +14 -0
- package/dist/editor/field-types/richtext/components/SimpleToolbarButton.js.map +1 -0
- package/dist/editor/field-types/richtext/components/ToolbarButton.d.ts +3 -0
- package/dist/editor/field-types/richtext/components/ToolbarButton.js +6 -0
- package/dist/editor/field-types/richtext/components/ToolbarButton.js.map +1 -0
- package/dist/editor/field-types/richtext/config/pluginFactory.d.ts +19 -0
- package/dist/editor/field-types/richtext/config/pluginFactory.js +17 -0
- package/dist/editor/field-types/richtext/config/pluginFactory.js.map +1 -0
- package/dist/editor/field-types/richtext/contextMenuFactory.d.ts +4 -0
- package/dist/editor/field-types/richtext/contextMenuFactory.js +201 -0
- package/dist/editor/field-types/richtext/contextMenuFactory.js.map +1 -0
- package/dist/editor/field-types/richtext/hooks/useProfileCache.d.ts +68 -0
- package/dist/editor/field-types/richtext/hooks/useProfileCache.js +214 -0
- package/dist/editor/field-types/richtext/hooks/useProfileCache.js.map +1 -0
- package/dist/editor/field-types/richtext/hooks/useRichTextProfile.d.ts +25 -0
- package/dist/editor/field-types/richtext/hooks/useRichTextProfile.js +64 -0
- package/dist/editor/field-types/richtext/hooks/useRichTextProfile.js.map +1 -0
- package/dist/editor/field-types/richtext/index.d.ts +6 -0
- package/dist/editor/field-types/richtext/index.js +7 -0
- package/dist/editor/field-types/richtext/index.js.map +1 -0
- package/dist/editor/field-types/richtext/types.d.ts +288 -0
- package/dist/editor/field-types/richtext/types.js +107 -0
- package/dist/editor/field-types/richtext/types.js.map +1 -0
- package/dist/editor/field-types/richtext/utils/conversion.d.ts +7 -0
- package/dist/editor/field-types/richtext/utils/conversion.js +762 -0
- package/dist/editor/field-types/richtext/utils/conversion.js.map +1 -0
- package/dist/editor/field-types/richtext/utils/plugins.d.ts +170 -0
- package/dist/editor/field-types/richtext/utils/plugins.js +490 -0
- package/dist/editor/field-types/richtext/utils/plugins.js.map +1 -0
- package/dist/editor/field-types/richtext/utils/profileMapper.d.ts +38 -0
- package/dist/editor/field-types/richtext/utils/profileMapper.js +386 -0
- package/dist/editor/field-types/richtext/utils/profileMapper.js.map +1 -0
- package/dist/editor/field-types/richtext/utils/profileServiceCache.d.ts +37 -0
- package/dist/editor/field-types/richtext/utils/profileServiceCache.js +119 -0
- package/dist/editor/field-types/richtext/utils/profileServiceCache.js.map +1 -0
- package/dist/editor/fieldTypes.d.ts +129 -0
- package/dist/editor/fieldTypes.js +2 -0
- package/dist/editor/fieldTypes.js.map +1 -0
- package/dist/editor/hooks/useEditorSettings.d.ts +17 -0
- package/dist/editor/hooks/useEditorSettings.js +61 -0
- package/dist/editor/hooks/useEditorSettings.js.map +1 -0
- package/dist/editor/media-selector/AiImageSearch.d.ts +4 -0
- package/dist/editor/media-selector/AiImageSearch.js +164 -0
- package/dist/editor/media-selector/AiImageSearch.js.map +1 -0
- package/dist/editor/media-selector/AiImageSearchPrompt.d.ts +3 -0
- package/dist/editor/media-selector/AiImageSearchPrompt.js +57 -0
- package/dist/editor/media-selector/AiImageSearchPrompt.js.map +1 -0
- package/dist/editor/media-selector/MediaFolderBrowser.d.ts +5 -0
- package/dist/editor/media-selector/MediaFolderBrowser.js +182 -0
- package/dist/editor/media-selector/MediaFolderBrowser.js.map +1 -0
- package/dist/editor/media-selector/MediaSelector.d.ts +9 -0
- package/dist/editor/media-selector/MediaSelector.js +8 -0
- package/dist/editor/media-selector/MediaSelector.js.map +1 -0
- package/dist/editor/media-selector/Preview.d.ts +4 -0
- package/dist/editor/media-selector/Preview.js +19 -0
- package/dist/editor/media-selector/Preview.js.map +1 -0
- package/dist/editor/media-selector/Thumbnails.d.ts +8 -0
- package/dist/editor/media-selector/Thumbnails.js +10 -0
- package/dist/editor/media-selector/Thumbnails.js.map +1 -0
- package/dist/editor/media-selector/TreeSelector.d.ts +7 -0
- package/dist/editor/media-selector/TreeSelector.js +183 -0
- package/dist/editor/media-selector/TreeSelector.js.map +1 -0
- package/dist/editor/media-selector/UploadZone.d.ts +4 -0
- package/dist/editor/media-selector/UploadZone.js +81 -0
- package/dist/editor/media-selector/UploadZone.js.map +1 -0
- package/dist/editor/media-selector/index.d.ts +8 -0
- package/dist/editor/media-selector/index.js +9 -0
- package/dist/editor/media-selector/index.js.map +1 -0
- package/dist/editor/menubar/ActiveUsers.d.ts +1 -0
- package/dist/editor/menubar/ActiveUsers.js +120 -0
- package/dist/editor/menubar/ActiveUsers.js.map +1 -0
- package/dist/editor/menubar/ApproveAndPublish.d.ts +1 -0
- package/dist/editor/menubar/ApproveAndPublish.js +13 -0
- package/dist/editor/menubar/ApproveAndPublish.js.map +1 -0
- package/dist/editor/menubar/FavoritesControls.d.ts +8 -0
- package/dist/editor/menubar/FavoritesControls.js +124 -0
- package/dist/editor/menubar/FavoritesControls.js.map +1 -0
- package/dist/editor/menubar/GenericToolbar.d.ts +11 -0
- package/dist/editor/menubar/GenericToolbar.js +10 -0
- package/dist/editor/menubar/GenericToolbar.js.map +1 -0
- package/dist/editor/menubar/ItemActionsMenu.d.ts +3 -0
- package/dist/editor/menubar/ItemActionsMenu.js +23 -0
- package/dist/editor/menubar/ItemActionsMenu.js.map +1 -0
- package/dist/editor/menubar/ItemLanguageVersion.d.ts +1 -0
- package/dist/editor/menubar/ItemLanguageVersion.js +54 -0
- package/dist/editor/menubar/ItemLanguageVersion.js.map +1 -0
- package/dist/editor/menubar/ItemToolbar.d.ts +1 -0
- package/dist/editor/menubar/ItemToolbar.js +11 -0
- package/dist/editor/menubar/ItemToolbar.js.map +1 -0
- package/dist/editor/menubar/NavButtons.d.ts +1 -0
- package/dist/editor/menubar/NavButtons.js +40 -0
- package/dist/editor/menubar/NavButtons.js.map +1 -0
- package/dist/editor/menubar/PageSelector.d.ts +4 -0
- package/dist/editor/menubar/PageSelector.js +149 -0
- package/dist/editor/menubar/PageSelector.js.map +1 -0
- package/dist/editor/menubar/Separator.d.ts +3 -0
- package/dist/editor/menubar/Separator.js +6 -0
- package/dist/editor/menubar/Separator.js.map +1 -0
- package/dist/editor/menubar/SiteInfo.d.ts +1 -0
- package/dist/editor/menubar/SiteInfo.js +24 -0
- package/dist/editor/menubar/SiteInfo.js.map +1 -0
- package/dist/editor/menubar/ToolbarFactory.d.ts +2 -0
- package/dist/editor/menubar/ToolbarFactory.js +55 -0
- package/dist/editor/menubar/ToolbarFactory.js.map +1 -0
- package/dist/editor/menubar/User.d.ts +4 -0
- package/dist/editor/menubar/User.js +18 -0
- package/dist/editor/menubar/User.js.map +1 -0
- package/dist/editor/menubar/VersionSelector.d.ts +10 -0
- package/dist/editor/menubar/VersionSelector.js +53 -0
- package/dist/editor/menubar/VersionSelector.js.map +1 -0
- package/dist/editor/menubar/WorkflowButton.d.ts +1 -0
- package/dist/editor/menubar/WorkflowButton.js +93 -0
- package/dist/editor/menubar/WorkflowButton.js.map +1 -0
- package/dist/editor/menubar/toolbar-sections/CompareControls.d.ts +1 -0
- package/dist/editor/menubar/toolbar-sections/CompareControls.js +11 -0
- package/dist/editor/menubar/toolbar-sections/CompareControls.js.map +1 -0
- package/dist/editor/menubar/toolbar-sections/EditControls.d.ts +7 -0
- package/dist/editor/menubar/toolbar-sections/EditControls.js +15 -0
- package/dist/editor/menubar/toolbar-sections/EditControls.js.map +1 -0
- package/dist/editor/menubar/toolbar-sections/InsertControls.d.ts +1 -0
- package/dist/editor/menubar/toolbar-sections/InsertControls.js +15 -0
- package/dist/editor/menubar/toolbar-sections/InsertControls.js.map +1 -0
- package/dist/editor/menubar/toolbar-sections/ReviewCommands.d.ts +1 -0
- package/dist/editor/menubar/toolbar-sections/ReviewCommands.js +41 -0
- package/dist/editor/menubar/toolbar-sections/ReviewCommands.js.map +1 -0
- package/dist/editor/menubar/toolbar-sections/UtilityControls.d.ts +1 -0
- package/dist/editor/menubar/toolbar-sections/UtilityControls.js +17 -0
- package/dist/editor/menubar/toolbar-sections/UtilityControls.js.map +1 -0
- package/dist/editor/menubar/toolbar-sections/ViewportControls.d.ts +1 -0
- package/dist/editor/menubar/toolbar-sections/ViewportControls.js +21 -0
- package/dist/editor/menubar/toolbar-sections/ViewportControls.js.map +1 -0
- package/dist/editor/menubar/toolbar-sections/index.d.ts +6 -0
- package/dist/editor/menubar/toolbar-sections/index.js +7 -0
- package/dist/editor/menubar/toolbar-sections/index.js.map +1 -0
- package/dist/editor/page-editor-chrome/CommentHighlighting.d.ts +6 -0
- package/dist/editor/page-editor-chrome/CommentHighlighting.js +270 -0
- package/dist/editor/page-editor-chrome/CommentHighlighting.js.map +1 -0
- package/dist/editor/page-editor-chrome/CommentHighlightings.d.ts +4 -0
- package/dist/editor/page-editor-chrome/CommentHighlightings.js +15 -0
- package/dist/editor/page-editor-chrome/CommentHighlightings.js.map +1 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicator.d.ts +4 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js +35 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js.map +1 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicators.d.ts +1 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicators.js +13 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicators.js.map +1 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.d.ts +8 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.js +26 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.js.map +1 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.d.ts +6 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.js +14 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.js.map +1 -0
- package/dist/editor/page-editor-chrome/FrameMenu.d.ts +7 -0
- package/dist/editor/page-editor-chrome/FrameMenu.js +346 -0
- package/dist/editor/page-editor-chrome/FrameMenu.js.map +1 -0
- package/dist/editor/page-editor-chrome/FrameMenus.d.ts +5 -0
- package/dist/editor/page-editor-chrome/FrameMenus.js +22 -0
- package/dist/editor/page-editor-chrome/FrameMenus.js.map +1 -0
- package/dist/editor/page-editor-chrome/InlineEditor.d.ts +5 -0
- package/dist/editor/page-editor-chrome/InlineEditor.js +704 -0
- package/dist/editor/page-editor-chrome/InlineEditor.js.map +1 -0
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.d.ts +1 -0
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.js +33 -0
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.js.map +1 -0
- package/dist/editor/page-editor-chrome/NoLayout.d.ts +1 -0
- package/dist/editor/page-editor-chrome/NoLayout.js +19 -0
- package/dist/editor/page-editor-chrome/NoLayout.js.map +1 -0
- package/dist/editor/page-editor-chrome/PageEditorChrome.d.ts +6 -0
- package/dist/editor/page-editor-chrome/PageEditorChrome.js +64 -0
- package/dist/editor/page-editor-chrome/PageEditorChrome.js.map +1 -0
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.d.ts +1 -0
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.js +152 -0
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.js.map +1 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.d.ts +18 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +122 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js.map +1 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.d.ts +5 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js +289 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js.map +1 -0
- package/dist/editor/page-editor-chrome/SuggestionHighlighting.d.ts +6 -0
- package/dist/editor/page-editor-chrome/SuggestionHighlighting.js +224 -0
- package/dist/editor/page-editor-chrome/SuggestionHighlighting.js.map +1 -0
- package/dist/editor/page-editor-chrome/SuggestionHighlightings.d.ts +4 -0
- package/dist/editor/page-editor-chrome/SuggestionHighlightings.js +16 -0
- package/dist/editor/page-editor-chrome/SuggestionHighlightings.js.map +1 -0
- package/dist/editor/page-editor-chrome/useInlineAICompletion.d.ts +7 -0
- package/dist/editor/page-editor-chrome/useInlineAICompletion.js +699 -0
- package/dist/editor/page-editor-chrome/useInlineAICompletion.js.map +1 -0
- package/dist/editor/page-viewer/DeviceToolbar.d.ts +6 -0
- package/dist/editor/page-viewer/DeviceToolbar.js +21 -0
- package/dist/editor/page-viewer/DeviceToolbar.js.map +1 -0
- package/dist/editor/page-viewer/EditorForm.d.ts +8 -0
- package/dist/editor/page-viewer/EditorForm.js +257 -0
- package/dist/editor/page-viewer/EditorForm.js.map +1 -0
- package/dist/editor/page-viewer/EditorFormPopup.d.ts +11 -0
- package/dist/editor/page-viewer/EditorFormPopup.js +41 -0
- package/dist/editor/page-viewer/EditorFormPopup.js.map +1 -0
- package/dist/editor/page-viewer/MiniMap.d.ts +9 -0
- package/dist/editor/page-viewer/MiniMap.js +233 -0
- package/dist/editor/page-viewer/MiniMap.js.map +1 -0
- package/dist/editor/page-viewer/PageViewer.d.ts +10 -0
- package/dist/editor/page-viewer/PageViewer.js +67 -0
- package/dist/editor/page-viewer/PageViewer.js.map +1 -0
- package/dist/editor/page-viewer/PageViewerFrame.d.ts +11 -0
- package/dist/editor/page-viewer/PageViewerFrame.js +857 -0
- package/dist/editor/page-viewer/PageViewerFrame.js.map +1 -0
- package/dist/editor/page-viewer/pageModelSkeletonBuilder.d.ts +3 -0
- package/dist/editor/page-viewer/pageModelSkeletonBuilder.js +339 -0
- package/dist/editor/page-viewer/pageModelSkeletonBuilder.js.map +1 -0
- package/dist/editor/page-viewer/pageViewContext.d.ts +40 -0
- package/dist/editor/page-viewer/pageViewContext.js +156 -0
- package/dist/editor/page-viewer/pageViewContext.js.map +1 -0
- package/dist/editor/pageModel.d.ts +222 -0
- package/dist/editor/pageModel.js +2 -0
- package/dist/editor/pageModel.js.map +1 -0
- package/dist/editor/picture-shared.d.ts +16 -0
- package/dist/editor/picture-shared.js +25 -0
- package/dist/editor/picture-shared.js.map +1 -0
- package/dist/editor/reviews/Comment.d.ts +8 -0
- package/dist/editor/reviews/Comment.js +162 -0
- package/dist/editor/reviews/Comment.js.map +1 -0
- package/dist/editor/reviews/CommentDisplayPopover.d.ts +9 -0
- package/dist/editor/reviews/CommentDisplayPopover.js +104 -0
- package/dist/editor/reviews/CommentDisplayPopover.js.map +1 -0
- package/dist/editor/reviews/CommentEditor.d.ts +20 -0
- package/dist/editor/reviews/CommentEditor.js +57 -0
- package/dist/editor/reviews/CommentEditor.js.map +1 -0
- package/dist/editor/reviews/CommentPopover.d.ts +22 -0
- package/dist/editor/reviews/CommentPopover.js +145 -0
- package/dist/editor/reviews/CommentPopover.js.map +1 -0
- package/dist/editor/reviews/CommentView.d.ts +21 -0
- package/dist/editor/reviews/CommentView.js +52 -0
- package/dist/editor/reviews/CommentView.js.map +1 -0
- package/dist/editor/reviews/Comments.d.ts +3 -0
- package/dist/editor/reviews/Comments.js +118 -0
- package/dist/editor/reviews/Comments.js.map +1 -0
- package/dist/editor/reviews/DiffView.d.ts +17 -0
- package/dist/editor/reviews/DiffView.js +57 -0
- package/dist/editor/reviews/DiffView.js.map +1 -0
- package/dist/editor/reviews/PreviewInfo.d.ts +1 -0
- package/dist/editor/reviews/PreviewInfo.js +12 -0
- package/dist/editor/reviews/PreviewInfo.js.map +1 -0
- package/dist/editor/reviews/Reviews.d.ts +1 -0
- package/dist/editor/reviews/Reviews.js +186 -0
- package/dist/editor/reviews/Reviews.js.map +1 -0
- package/dist/editor/reviews/SuggestedEdit.d.ts +4 -0
- package/dist/editor/reviews/SuggestedEdit.js +200 -0
- package/dist/editor/reviews/SuggestedEdit.js.map +1 -0
- package/dist/editor/reviews/SuggestionDisplayPopover.d.ts +9 -0
- package/dist/editor/reviews/SuggestionDisplayPopover.js +204 -0
- package/dist/editor/reviews/SuggestionDisplayPopover.js.map +1 -0
- package/dist/editor/reviews/commentAi.d.ts +7 -0
- package/dist/editor/reviews/commentAi.js +100 -0
- package/dist/editor/reviews/commentAi.js.map +1 -0
- package/dist/editor/reviews/reviewCommands.d.ts +3 -0
- package/dist/editor/reviews/reviewCommands.js +38 -0
- package/dist/editor/reviews/reviewCommands.js.map +1 -0
- package/dist/editor/reviews/useReviews.d.ts +12 -0
- package/dist/editor/reviews/useReviews.js +43 -0
- package/dist/editor/reviews/useReviews.js.map +1 -0
- package/dist/editor/services/agentService.d.ts +306 -0
- package/dist/editor/services/agentService.js +627 -0
- package/dist/editor/services/agentService.js.map +1 -0
- package/dist/editor/services/aiService.d.ts +106 -0
- package/dist/editor/services/aiService.js +294 -0
- package/dist/editor/services/aiService.js.map +1 -0
- package/dist/editor/services/componentDesignerService.d.ts +46 -0
- package/dist/editor/services/componentDesignerService.js +72 -0
- package/dist/editor/services/componentDesignerService.js.map +1 -0
- package/dist/editor/services/contentService.d.ts +79 -0
- package/dist/editor/services/contentService.js +119 -0
- package/dist/editor/services/contentService.js.map +1 -0
- package/dist/editor/services/contextService.d.ts +26 -0
- package/dist/editor/services/contextService.js +103 -0
- package/dist/editor/services/contextService.js.map +1 -0
- package/dist/editor/services/editService.d.ts +66 -0
- package/dist/editor/services/editService.js +325 -0
- package/dist/editor/services/editService.js.map +1 -0
- package/dist/editor/services/favouritesService.d.ts +33 -0
- package/dist/editor/services/favouritesService.js +22 -0
- package/dist/editor/services/favouritesService.js.map +1 -0
- package/dist/editor/services/indexService.d.ts +13 -0
- package/dist/editor/services/indexService.js +45 -0
- package/dist/editor/services/indexService.js.map +1 -0
- package/dist/editor/services/reviewsService.d.ts +18 -0
- package/dist/editor/services/reviewsService.js +60 -0
- package/dist/editor/services/reviewsService.js.map +1 -0
- package/dist/editor/services/searchService.d.ts +17 -0
- package/dist/editor/services/searchService.js +25 -0
- package/dist/editor/services/searchService.js.map +1 -0
- package/dist/editor/services/serviceHelper.d.ts +10 -0
- package/dist/editor/services/serviceHelper.js +118 -0
- package/dist/editor/services/serviceHelper.js.map +1 -0
- package/dist/editor/services/setupService.d.ts +21 -0
- package/dist/editor/services/setupService.js +10 -0
- package/dist/editor/services/setupService.js.map +1 -0
- package/dist/editor/services/suggestedEditsService.d.ts +18 -0
- package/dist/editor/services/suggestedEditsService.js +36 -0
- package/dist/editor/services/suggestedEditsService.js.map +1 -0
- package/dist/editor/services/systemService.d.ts +4 -0
- package/dist/editor/services/systemService.js +11 -0
- package/dist/editor/services/systemService.js.map +1 -0
- package/dist/editor/services-server/api.d.ts +19 -0
- package/dist/editor/services-server/api.js +111 -0
- package/dist/editor/services-server/api.js.map +1 -0
- package/dist/editor/services-server/graphQL.d.ts +29 -0
- package/dist/editor/services-server/graphQL.js +53 -0
- package/dist/editor/services-server/graphQL.js.map +1 -0
- package/dist/editor/sidebar/Completions.d.ts +1 -0
- package/dist/editor/sidebar/Completions.js +55 -0
- package/dist/editor/sidebar/Completions.js.map +1 -0
- package/dist/editor/sidebar/ComponentPalette.d.ts +1 -0
- package/dist/editor/sidebar/ComponentPalette.js +86 -0
- package/dist/editor/sidebar/ComponentPalette.js.map +1 -0
- package/dist/editor/sidebar/ComponentTree.d.ts +1 -0
- package/dist/editor/sidebar/ComponentTree.js +691 -0
- package/dist/editor/sidebar/ComponentTree.js.map +1 -0
- package/dist/editor/sidebar/Debug.d.ts +1 -0
- package/dist/editor/sidebar/Debug.js +71 -0
- package/dist/editor/sidebar/Debug.js.map +1 -0
- package/dist/editor/sidebar/DictionaryEditor.d.ts +1 -0
- package/dist/editor/sidebar/DictionaryEditor.js +158 -0
- package/dist/editor/sidebar/DictionaryEditor.js.map +1 -0
- package/dist/editor/sidebar/Divider.d.ts +6 -0
- package/dist/editor/sidebar/Divider.js +6 -0
- package/dist/editor/sidebar/Divider.js.map +1 -0
- package/dist/editor/sidebar/EditHistory.d.ts +1 -0
- package/dist/editor/sidebar/EditHistory.js +78 -0
- package/dist/editor/sidebar/EditHistory.js.map +1 -0
- package/dist/editor/sidebar/GraphQL.d.ts +2 -0
- package/dist/editor/sidebar/GraphQL.js +234 -0
- package/dist/editor/sidebar/GraphQL.js.map +1 -0
- package/dist/editor/sidebar/Insert.d.ts +1 -0
- package/dist/editor/sidebar/Insert.js +22 -0
- package/dist/editor/sidebar/Insert.js.map +1 -0
- package/dist/editor/sidebar/LeftToolbar.d.ts +1 -0
- package/dist/editor/sidebar/LeftToolbar.js +16 -0
- package/dist/editor/sidebar/LeftToolbar.js.map +1 -0
- package/dist/editor/sidebar/MainContentTree.d.ts +5 -0
- package/dist/editor/sidebar/MainContentTree.js +70 -0
- package/dist/editor/sidebar/MainContentTree.js.map +1 -0
- package/dist/editor/sidebar/Performance.d.ts +1 -0
- package/dist/editor/sidebar/Performance.js +32 -0
- package/dist/editor/sidebar/Performance.js.map +1 -0
- package/dist/editor/sidebar/SEOInfo.d.ts +1 -0
- package/dist/editor/sidebar/SEOInfo.js +158 -0
- package/dist/editor/sidebar/SEOInfo.js.map +1 -0
- package/dist/editor/sidebar/Sessions.d.ts +1 -0
- package/dist/editor/sidebar/Sessions.js +29 -0
- package/dist/editor/sidebar/Sessions.js.map +1 -0
- package/dist/editor/sidebar/Sidebar.d.ts +1 -0
- package/dist/editor/sidebar/Sidebar.js +13 -0
- package/dist/editor/sidebar/Sidebar.js.map +1 -0
- package/dist/editor/sidebar/SidebarView.d.ts +10 -0
- package/dist/editor/sidebar/SidebarView.js +40 -0
- package/dist/editor/sidebar/SidebarView.js.map +1 -0
- package/dist/editor/sidebar/Validation.d.ts +1 -0
- package/dist/editor/sidebar/Validation.js +51 -0
- package/dist/editor/sidebar/Validation.js.map +1 -0
- package/dist/editor/sidebar/ViewSelector.d.ts +4 -0
- package/dist/editor/sidebar/ViewSelector.js +191 -0
- package/dist/editor/sidebar/ViewSelector.js.map +1 -0
- package/dist/editor/sidebar/Workbox.d.ts +1 -0
- package/dist/editor/sidebar/Workbox.js +79 -0
- package/dist/editor/sidebar/Workbox.js.map +1 -0
- package/dist/editor/ui/CenteredMessage.d.ts +3 -0
- package/dist/editor/ui/CenteredMessage.js +5 -0
- package/dist/editor/ui/CenteredMessage.js.map +1 -0
- package/dist/editor/ui/CopyMoveTargetSelectorDialog.d.ts +10 -0
- package/dist/editor/ui/CopyMoveTargetSelectorDialog.js +38 -0
- package/dist/editor/ui/CopyMoveTargetSelectorDialog.js.map +1 -0
- package/dist/editor/ui/DialogButtons.d.ts +3 -0
- package/dist/editor/ui/DialogButtons.js +5 -0
- package/dist/editor/ui/DialogButtons.js.map +1 -0
- package/dist/editor/ui/DragPreview.d.ts +14 -0
- package/dist/editor/ui/DragPreview.js +33 -0
- package/dist/editor/ui/DragPreview.js.map +1 -0
- package/dist/editor/ui/Icons.d.ts +74 -0
- package/dist/editor/ui/Icons.js +106 -0
- package/dist/editor/ui/Icons.js.map +1 -0
- package/dist/editor/ui/ItemList.d.ts +16 -0
- package/dist/editor/ui/ItemList.js +19 -0
- package/dist/editor/ui/ItemList.js.map +1 -0
- package/dist/editor/ui/ItemNameDialogNew.d.ts +10 -0
- package/dist/editor/ui/ItemNameDialogNew.js +68 -0
- package/dist/editor/ui/ItemNameDialogNew.js.map +1 -0
- package/dist/editor/ui/ItemSearch.d.ts +25 -0
- package/dist/editor/ui/ItemSearch.js +92 -0
- package/dist/editor/ui/ItemSearch.js.map +1 -0
- package/dist/editor/ui/PerfectTree.d.ts +78 -0
- package/dist/editor/ui/PerfectTree.js +858 -0
- package/dist/editor/ui/PerfectTree.js.map +1 -0
- package/dist/editor/ui/Section.d.ts +4 -0
- package/dist/editor/ui/Section.js +12 -0
- package/dist/editor/ui/Section.js.map +1 -0
- package/dist/editor/ui/SimpleIconButton.d.ts +14 -0
- package/dist/editor/ui/SimpleIconButton.js +15 -0
- package/dist/editor/ui/SimpleIconButton.js.map +1 -0
- package/dist/editor/ui/SimpleMenu.d.ts +6 -0
- package/dist/editor/ui/SimpleMenu.js +7 -0
- package/dist/editor/ui/SimpleMenu.js.map +1 -0
- package/dist/editor/ui/SimpleTable.d.ts +14 -0
- package/dist/editor/ui/SimpleTable.js +9 -0
- package/dist/editor/ui/SimpleTable.js.map +1 -0
- package/dist/editor/ui/SimpleTabs.d.ts +15 -0
- package/dist/editor/ui/SimpleTabs.js +20 -0
- package/dist/editor/ui/SimpleTabs.js.map +1 -0
- package/dist/editor/ui/SimpleToolbar.d.ts +3 -0
- package/dist/editor/ui/SimpleToolbar.js +5 -0
- package/dist/editor/ui/SimpleToolbar.js.map +1 -0
- package/dist/editor/ui/Spinner.d.ts +4 -0
- package/dist/editor/ui/Spinner.js +18 -0
- package/dist/editor/ui/Spinner.js.map +1 -0
- package/dist/editor/ui/Splitter.d.ts +22 -0
- package/dist/editor/ui/Splitter.js +443 -0
- package/dist/editor/ui/Splitter.js.map +1 -0
- package/dist/editor/ui/TemplateSelectorDialog.d.ts +8 -0
- package/dist/editor/ui/TemplateSelectorDialog.js +61 -0
- package/dist/editor/ui/TemplateSelectorDialog.js.map +1 -0
- package/dist/editor/ui/Toolbar.d.ts +3 -0
- package/dist/editor/ui/Toolbar.js +5 -0
- package/dist/editor/ui/Toolbar.js.map +1 -0
- package/dist/editor/utils/id-helper.d.ts +1 -0
- package/dist/editor/utils/id-helper.js +5 -0
- package/dist/editor/utils/id-helper.js.map +1 -0
- package/dist/editor/utils/insertOptions.d.ts +3 -0
- package/dist/editor/utils/insertOptions.js +43 -0
- package/dist/editor/utils/insertOptions.js.map +1 -0
- package/dist/editor/utils/itemConverters.d.ts +3 -0
- package/dist/editor/utils/itemConverters.js +53 -0
- package/dist/editor/utils/itemConverters.js.map +1 -0
- package/dist/editor/utils/itemutils.d.ts +3 -0
- package/dist/editor/utils/itemutils.js +24 -0
- package/dist/editor/utils/itemutils.js.map +1 -0
- package/dist/editor/utils/jsonCleaner.d.ts +8 -0
- package/dist/editor/utils/jsonCleaner.js +76 -0
- package/dist/editor/utils/jsonCleaner.js.map +1 -0
- package/dist/editor/utils/keyboardNavigation.d.ts +34 -0
- package/dist/editor/utils/keyboardNavigation.js +237 -0
- package/dist/editor/utils/keyboardNavigation.js.map +1 -0
- package/dist/editor/utils/urlUtils.d.ts +9 -0
- package/dist/editor/utils/urlUtils.js +25 -0
- package/dist/editor/utils/urlUtils.js.map +1 -0
- package/dist/editor/utils/useMemoDebug.d.ts +1 -0
- package/dist/editor/utils/useMemoDebug.js +18 -0
- package/dist/editor/utils/useMemoDebug.js.map +1 -0
- package/dist/editor/utils.d.ts +65 -0
- package/dist/editor/utils.js +468 -0
- package/dist/editor/utils.js.map +1 -0
- package/dist/editor/views/CompareView.d.ts +1 -0
- package/dist/editor/views/CompareView.js +148 -0
- package/dist/editor/views/CompareView.js.map +1 -0
- package/dist/editor/views/EditView.d.ts +1 -0
- package/dist/editor/views/EditView.js +15 -0
- package/dist/editor/views/EditView.js.map +1 -0
- package/dist/editor/views/ItemEditor.d.ts +7 -0
- package/dist/editor/views/ItemEditor.js +29 -0
- package/dist/editor/views/ItemEditor.js.map +1 -0
- package/dist/editor/views/MediaFolderEditView.d.ts +4 -0
- package/dist/editor/views/MediaFolderEditView.js +40 -0
- package/dist/editor/views/MediaFolderEditView.js.map +1 -0
- package/dist/editor/views/ParheliaView.d.ts +5 -0
- package/dist/editor/views/ParheliaView.js +136 -0
- package/dist/editor/views/ParheliaView.js.map +1 -0
- package/dist/editor/views/SingleEditView.d.ts +9 -0
- package/dist/editor/views/SingleEditView.js +33 -0
- package/dist/editor/views/SingleEditView.js.map +1 -0
- package/dist/images/bg-shape-black.webp +0 -0
- package/dist/images/wizard-bg.png +0 -0
- package/dist/images/wizard-tour.png +0 -0
- package/dist/images/wizard.png +0 -0
- package/dist/index.d.ts +62 -0
- package/dist/index.js +53 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/safelist.d.ts +1 -0
- package/dist/lib/safelist.js +5 -0
- package/dist/lib/safelist.js.map +1 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +6 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/revision.d.ts +2 -0
- package/dist/revision.js +3 -0
- package/dist/revision.js.map +1 -0
- package/dist/splash-screen/ModernSplashScreen.d.ts +8 -0
- package/dist/splash-screen/ModernSplashScreen.js +92 -0
- package/dist/splash-screen/ModernSplashScreen.js.map +1 -0
- package/dist/splash-screen/NewPage.d.ts +3 -0
- package/dist/splash-screen/NewPage.js +145 -0
- package/dist/splash-screen/NewPage.js.map +1 -0
- package/dist/splash-screen/OpenPage.d.ts +1 -0
- package/dist/splash-screen/OpenPage.js +56 -0
- package/dist/splash-screen/OpenPage.js.map +1 -0
- package/dist/splash-screen/ParheliaAssistantChat.d.ts +8 -0
- package/dist/splash-screen/ParheliaAssistantChat.js +155 -0
- package/dist/splash-screen/ParheliaAssistantChat.js.map +1 -0
- package/dist/splash-screen/RecentAgents.d.ts +7 -0
- package/dist/splash-screen/RecentAgents.js +76 -0
- package/dist/splash-screen/RecentAgents.js.map +1 -0
- package/dist/splash-screen/RecentPages.d.ts +1 -0
- package/dist/splash-screen/RecentPages.js +47 -0
- package/dist/splash-screen/RecentPages.js.map +1 -0
- package/dist/splash-screen/SectionHeadline.d.ts +4 -0
- package/dist/splash-screen/SectionHeadline.js +7 -0
- package/dist/splash-screen/SectionHeadline.js.map +1 -0
- package/dist/styles.css +5914 -0
- package/dist/tour/Tour.d.ts +3 -0
- package/dist/tour/Tour.js +426 -0
- package/dist/tour/Tour.js.map +1 -0
- package/dist/tour/default-tour.d.ts +9 -0
- package/dist/tour/default-tour.js +302 -0
- package/dist/tour/default-tour.js.map +1 -0
- package/dist/tour/preview-tour.d.ts +2 -0
- package/dist/tour/preview-tour.js +93 -0
- package/dist/tour/preview-tour.js.map +1 -0
- package/dist/types.d.ts +396 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/images/bg-shape-black.webp +0 -0
- package/images/wizard-bg.png +0 -0
- package/images/wizard-tour.png +0 -0
- package/images/wizard.png +0 -0
- package/package.json +93 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { useEditContext, useFieldsEditContext } from "../client/editContext";
|
|
6
|
+
import { Popover, PopoverContent, PopoverTrigger, } from "../../components/ui/popover";
|
|
7
|
+
import { formatDate } from "../utils";
|
|
8
|
+
import { Button } from "../../components/ui/button";
|
|
9
|
+
import { deleteSuggestedEdit, createOrUpdateSuggestedEdit, } from "../services/suggestedEditsService";
|
|
10
|
+
import { cleanupPendingSuggestedEditOperations } from "../client/operations";
|
|
11
|
+
import { Check, Trash2, Brush, GalleryVertical, } from "lucide-react";
|
|
12
|
+
import { DiffView } from "./DiffView";
|
|
13
|
+
import { SimpleIconButton } from "../ui/SimpleIconButton";
|
|
14
|
+
import { createPatch, applyPatch } from "diff";
|
|
15
|
+
import { cn } from "../../lib/utils";
|
|
16
|
+
export function SuggestionDisplayPopover({ suggestion, children, onSuggestionUpdated, }) {
|
|
17
|
+
const editContext = useEditContext();
|
|
18
|
+
const fieldsContext = useFieldsEditContext();
|
|
19
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
20
|
+
const [deleteConfirm, setDeleteConfirm] = useState(false);
|
|
21
|
+
const [isApplying, setIsApplying] = useState(false);
|
|
22
|
+
const [item, setItem] = useState(null);
|
|
23
|
+
const [patchPossible, setPatchPossible] = useState(true);
|
|
24
|
+
const [patchWarning, setPatchWarning] = useState("");
|
|
25
|
+
const [ignoreFormatting, setIgnoreFormatting] = useState(true);
|
|
26
|
+
const [clipUnchanged, setClipUnchanged] = useState(true);
|
|
27
|
+
const canDelete = suggestion.author === editContext?.user?.name &&
|
|
28
|
+
suggestion.status !== "applied";
|
|
29
|
+
const canApply = editContext?.mode === "edit" &&
|
|
30
|
+
suggestion.status !== "applied" &&
|
|
31
|
+
!editContext?.readonly;
|
|
32
|
+
// Load the full item when popover opens
|
|
33
|
+
React.useEffect(() => {
|
|
34
|
+
if (isOpen && editContext?.itemsRepository && suggestion.itemId) {
|
|
35
|
+
editContext.itemsRepository
|
|
36
|
+
.getItem({
|
|
37
|
+
id: suggestion.itemId,
|
|
38
|
+
language: suggestion.mainItemLanguage,
|
|
39
|
+
version: suggestion.mainItemVersion,
|
|
40
|
+
})
|
|
41
|
+
.then((loadedItem) => {
|
|
42
|
+
setItem(loadedItem);
|
|
43
|
+
checkAndComputePatch(loadedItem);
|
|
44
|
+
})
|
|
45
|
+
.catch((err) => {
|
|
46
|
+
console.error("Error loading item:", err);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}, [isOpen, suggestion, editContext?.itemsRepository]);
|
|
50
|
+
// Check if the patch can be applied cleanly
|
|
51
|
+
const checkAndComputePatch = async (loadedItem) => {
|
|
52
|
+
const field = loadedItem?.fields?.find((f) => f.id === suggestion.fieldId);
|
|
53
|
+
if (!field)
|
|
54
|
+
return;
|
|
55
|
+
const currentValue = field.rawValue || "";
|
|
56
|
+
const patch = createPatch("field", suggestion.oldValue, suggestion.newValue);
|
|
57
|
+
const patchedCandidate = applyPatch(currentValue, patch);
|
|
58
|
+
if (patchedCandidate === false || typeof patchedCandidate !== "string") {
|
|
59
|
+
setPatchPossible(false);
|
|
60
|
+
setPatchWarning("Patch cannot be applied cleanly to current field value.");
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
setPatchPossible(true);
|
|
64
|
+
setPatchWarning("");
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const handleDelete = async () => {
|
|
68
|
+
if (!deleteConfirm) {
|
|
69
|
+
setDeleteConfirm(true);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
await deleteSuggestedEdit(suggestion);
|
|
74
|
+
// Clean up pending operations to prevent race conditions
|
|
75
|
+
cleanupPendingSuggestedEditOperations(suggestion, editContext?.user);
|
|
76
|
+
// Immediately update local state to reflect deletion
|
|
77
|
+
if (editContext?.setSuggestedEdits && editContext?.suggestedEdits) {
|
|
78
|
+
const updatedEdits = editContext.suggestedEdits.filter((e) => e.id !== suggestion.id);
|
|
79
|
+
editContext.setSuggestedEdits(updatedEdits);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
console.error("Failed to delete suggested edit:", error);
|
|
84
|
+
}
|
|
85
|
+
finally {
|
|
86
|
+
setIsOpen(false);
|
|
87
|
+
onSuggestionUpdated?.();
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
const handleApplyPatch = async () => {
|
|
91
|
+
if (!patchPossible || !editContext || isApplying)
|
|
92
|
+
return;
|
|
93
|
+
setIsApplying(true);
|
|
94
|
+
try {
|
|
95
|
+
// Recalculate the patch immediately before applying
|
|
96
|
+
const field = item?.fields?.find((f) => f.id === suggestion.fieldId);
|
|
97
|
+
if (!field)
|
|
98
|
+
return;
|
|
99
|
+
const currentValue = field.rawValue || "";
|
|
100
|
+
const patch = createPatch("field", suggestion.oldValue, suggestion.newValue);
|
|
101
|
+
const patchedCandidate = applyPatch(currentValue, patch);
|
|
102
|
+
if (patchedCandidate === false || typeof patchedCandidate !== "string") {
|
|
103
|
+
setPatchWarning("Patch cannot be applied cleanly to current field value.");
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
await editContext.operations.editField({
|
|
107
|
+
field: {
|
|
108
|
+
fieldId: suggestion.fieldId,
|
|
109
|
+
item: {
|
|
110
|
+
id: suggestion.itemId,
|
|
111
|
+
language: suggestion.mainItemLanguage,
|
|
112
|
+
version: suggestion.mainItemVersion,
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
value: patchedCandidate,
|
|
116
|
+
rawValue: patchedCandidate,
|
|
117
|
+
refresh: "immediate",
|
|
118
|
+
});
|
|
119
|
+
// Update the suggestion status to "applied"
|
|
120
|
+
const updatedSuggestion = { ...suggestion, status: "applied" };
|
|
121
|
+
await createOrUpdateSuggestedEdit(updatedSuggestion);
|
|
122
|
+
onSuggestionUpdated?.();
|
|
123
|
+
setIsOpen(false);
|
|
124
|
+
}
|
|
125
|
+
finally {
|
|
126
|
+
setIsApplying(false);
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
const handleReplaceCompletely = async () => {
|
|
130
|
+
if (!editContext || isApplying)
|
|
131
|
+
return;
|
|
132
|
+
setIsApplying(true);
|
|
133
|
+
try {
|
|
134
|
+
await editContext.operations.editField({
|
|
135
|
+
field: {
|
|
136
|
+
fieldId: suggestion.fieldId,
|
|
137
|
+
item: {
|
|
138
|
+
id: suggestion.itemId,
|
|
139
|
+
language: suggestion.mainItemLanguage,
|
|
140
|
+
version: suggestion.mainItemVersion,
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
value: suggestion.newValue,
|
|
144
|
+
rawValue: suggestion.newValue,
|
|
145
|
+
refresh: "immediate",
|
|
146
|
+
});
|
|
147
|
+
const updatedSuggestion = { ...suggestion, status: "applied" };
|
|
148
|
+
await createOrUpdateSuggestedEdit(updatedSuggestion);
|
|
149
|
+
onSuggestionUpdated?.();
|
|
150
|
+
setIsOpen(false);
|
|
151
|
+
}
|
|
152
|
+
finally {
|
|
153
|
+
setIsApplying(false);
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
const renderContextInfo = () => {
|
|
157
|
+
const pageName = editContext?.currentItemDescriptor?.name;
|
|
158
|
+
const itemName = item ? item.name : undefined;
|
|
159
|
+
const fieldName = item && item.fields
|
|
160
|
+
? item.fields.find((f) => f.id === suggestion.fieldId)?.name || undefined
|
|
161
|
+
: undefined;
|
|
162
|
+
const segments = [pageName, itemName, fieldName].filter((x) => !!x && x.length > 0);
|
|
163
|
+
if (segments.length === 0)
|
|
164
|
+
return null;
|
|
165
|
+
return (_jsx("div", { className: "mt-3 flex items-center border-t pt-3 text-xs", children: segments.map((seg, idx) => (_jsxs(React.Fragment, { children: [idx > 0 && _jsx("div", { className: "mx-2 text-xs text-gray-500", children: ">" }), _jsx("div", { className: "text-xs text-gray-500", children: seg })] }, idx))) }));
|
|
166
|
+
};
|
|
167
|
+
const renderDiffToggleButtons = () => {
|
|
168
|
+
return (_jsxs("div", { className: "mb-2 flex gap-2", children: [_jsx(SimpleIconButton, { icon: _jsx(Brush, { size: 14, className: "p-0.5", strokeWidth: 1 }), label: "Ignore Formatting", onClick: () => setIgnoreFormatting((prev) => !prev), className: cn("text-gray-500", ignoreFormatting ? "bg-gray-200" : "") }), _jsx(SimpleIconButton, { icon: _jsx(GalleryVertical, { size: 14, className: "p-0.5", strokeWidth: 1 }), label: "Clip", onClick: () => setClipUnchanged((prev) => !prev), className: cn("text-gray-500", clipUnchanged ? "bg-gray-200" : "") })] }));
|
|
169
|
+
};
|
|
170
|
+
return (_jsxs(Popover, { open: isOpen, onOpenChange: (open) => {
|
|
171
|
+
setIsOpen(open);
|
|
172
|
+
if (!open) {
|
|
173
|
+
setDeleteConfirm(false);
|
|
174
|
+
setPatchWarning("");
|
|
175
|
+
}
|
|
176
|
+
}, enableIframeClickDetection: true, children: [_jsx(PopoverTrigger, { asChild: true, children: children }), _jsx(PopoverContent, { className: "w-96 p-4", side: "bottom", align: "start", children: _jsxs("div", { className: "space-y-3", children: [_jsxs("div", { className: "flex items-start justify-between", children: [_jsxs("div", { children: [_jsx("div", { className: "text-sm font-semibold text-gray-900", children: suggestion.authorDisplayName || suggestion.author }), _jsx("div", { className: "text-xs text-gray-500", children: suggestion.created
|
|
177
|
+
? formatDate(new Date(suggestion.created))
|
|
178
|
+
: "" })] }), _jsxs("div", { className: "flex items-center gap-1", children: [canApply && patchPossible && suggestion.status !== "applied" && (_jsx(Button, { variant: "ghost", size: "sm", onClick: handleApplyPatch, disabled: isApplying, className: "h-8 w-8 p-0 text-green-600", children: _jsx(Check, { size: 14, strokeWidth: 1 }) })), suggestion.status === "applied" && (_jsx("div", { className: "flex h-8 w-8 items-center justify-center", children: _jsx(Check, { size: 14, strokeWidth: 1, className: "text-green-500" }) })), canDelete && (_jsx(Button, { variant: "ghost", size: "sm", onClick: handleDelete, className: `h-8 w-8 p-0 ${deleteConfirm ? "text-red-500" : "text-gray-400"}`, children: _jsx(Trash2, { size: 14, strokeWidth: 1 }) }))] })] }), suggestion.status === "applied" && (_jsxs("div", { className: "text-xs font-medium text-green-600", children: ["\u2713 Applied", " ", suggestion.updatedBy ? `by ${suggestion.updatedBy}` : "", suggestion.updated
|
|
179
|
+
? ` on ${formatDate(new Date(suggestion.updated))}`
|
|
180
|
+
: ""] })), renderDiffToggleButtons(), _jsxs("div", { className: "text-sm", children: [_jsx(DiffView, { oldText: suggestion.oldValue, newText: suggestion.newValue, ignoreFormatting: ignoreFormatting, clipUnchanged: clipUnchanged, clipThreshold: 50, clipContext: 10 }), canApply && patchWarning && (_jsxs("div", { className: "mt-2 text-xs text-red-500", children: [patchWarning, _jsx("button", { className: "ml-2 cursor-pointer underline hover:text-red-700", onClick: handleReplaceCompletely, disabled: isApplying, children: "Click here to replace the field content completely." })] }))] }), renderContextInfo(), deleteConfirm && (_jsxs("div", { className: "border-t pt-3", children: [_jsx("div", { className: "mb-2 text-sm text-red-600", children: "Are you sure you want to delete this suggestion?" }), _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { variant: "outline", size: "sm", onClick: () => setDeleteConfirm(false), children: "Cancel" }), _jsx(Button, { variant: "destructive", size: "sm", onClick: handleDelete, children: "Delete" })] })] })), canApply && !patchPossible && suggestion.status !== "applied" && (_jsx("div", { className: "border-t pt-3", children: _jsx(Button, { size: "sm", onClick: handleReplaceCompletely, disabled: isApplying, className: "w-full", children: isApplying ? "Applying..." : "Replace Field Content" }) })), !deleteConfirm && !editContext?.configuration?.forceFullscreen && (_jsx("div", { className: "border-t pt-3", children: _jsx(Button, { variant: "outline", size: "sm", onClick: () => {
|
|
181
|
+
setIsOpen(false);
|
|
182
|
+
// Exit fullscreen mode if active
|
|
183
|
+
if (editContext?.pageView?.fullscreen) {
|
|
184
|
+
editContext.pageView.setFullscreen(false);
|
|
185
|
+
}
|
|
186
|
+
// Focus on the field and select the item
|
|
187
|
+
if (suggestion.fieldId) {
|
|
188
|
+
fieldsContext?.setFocusedField({
|
|
189
|
+
fieldId: suggestion.fieldId,
|
|
190
|
+
item: {
|
|
191
|
+
id: suggestion.itemId,
|
|
192
|
+
language: suggestion.mainItemLanguage,
|
|
193
|
+
version: suggestion.mainItemVersion,
|
|
194
|
+
},
|
|
195
|
+
}, false);
|
|
196
|
+
editContext?.select?.([suggestion.itemId]);
|
|
197
|
+
}
|
|
198
|
+
// Switch to comments view
|
|
199
|
+
if (editContext?.switchView) {
|
|
200
|
+
editContext.switchView("comments");
|
|
201
|
+
}
|
|
202
|
+
}, className: "w-full", children: "View in Comments Panel" }) }))] }) })] }));
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=SuggestionDisplayPopover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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/editContext";
|
|
3
|
+
/**
|
|
4
|
+
* Opens the Agents panel and seeds it with context from a review comment.
|
|
5
|
+
* Safe to call with an undefined editContext; it will no-op.
|
|
6
|
+
*/
|
|
7
|
+
export declare function openAiAgentForComment(comment: CommentType, editContext?: EditContextType): void;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opens the Agents panel and seeds it with context from a review comment.
|
|
3
|
+
* Safe to call with an undefined editContext; it will no-op.
|
|
4
|
+
*/
|
|
5
|
+
export function openAiAgentForComment(comment, editContext) {
|
|
6
|
+
if (!editContext)
|
|
7
|
+
return;
|
|
8
|
+
// Respect quota if available
|
|
9
|
+
if (editContext.isQuotaExceeded) {
|
|
10
|
+
editContext.showToast?.("AI quota exceeded. Please try again later or adjust settings.");
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const selectedText = (() => {
|
|
14
|
+
if (typeof comment.rangeStart === "number" &&
|
|
15
|
+
typeof comment.rangeEnd === "number" &&
|
|
16
|
+
comment.fieldValue) {
|
|
17
|
+
try {
|
|
18
|
+
return comment.fieldValue.substring(Math.max(0, comment.rangeStart), Math.max(comment.rangeStart, comment.rangeEnd));
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return undefined;
|
|
25
|
+
})();
|
|
26
|
+
const promptParts = [];
|
|
27
|
+
const text = (comment.text || "").trim();
|
|
28
|
+
if (text)
|
|
29
|
+
promptParts.push(`Comment: "${text}"`);
|
|
30
|
+
if (selectedText)
|
|
31
|
+
promptParts.push(`Selected text: "${selectedText}"`);
|
|
32
|
+
const initialPrompt = promptParts.length > 0
|
|
33
|
+
? `Please help resolve this review comment. ${promptParts.join(" | ")}`
|
|
34
|
+
: "Please help resolve this review comment.";
|
|
35
|
+
try {
|
|
36
|
+
editContext.setShowAgentsPanel(true);
|
|
37
|
+
const initialMetadata = {
|
|
38
|
+
items: [
|
|
39
|
+
{
|
|
40
|
+
id: comment.mainItemId ||
|
|
41
|
+
editContext.currentItemDescriptor?.id,
|
|
42
|
+
language: comment.language,
|
|
43
|
+
version: comment.version,
|
|
44
|
+
name: editContext.contentEditorItem?.name,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
components: editContext.selection && editContext.selection.length
|
|
48
|
+
? editContext.selection.map((componentId) => ({
|
|
49
|
+
componentId,
|
|
50
|
+
pageItem: {
|
|
51
|
+
id: comment.mainItemId ||
|
|
52
|
+
editContext.currentItemDescriptor?.id,
|
|
53
|
+
language: comment.language,
|
|
54
|
+
version: comment.version,
|
|
55
|
+
name: editContext.contentEditorItem?.name,
|
|
56
|
+
},
|
|
57
|
+
}))
|
|
58
|
+
: undefined,
|
|
59
|
+
field: comment.fieldId && comment.itemId
|
|
60
|
+
? {
|
|
61
|
+
fieldId: comment.fieldId,
|
|
62
|
+
fieldName: comment.fieldName,
|
|
63
|
+
item: {
|
|
64
|
+
id: comment.itemId,
|
|
65
|
+
language: comment.language,
|
|
66
|
+
version: comment.version,
|
|
67
|
+
name: comment.itemName,
|
|
68
|
+
},
|
|
69
|
+
}
|
|
70
|
+
: undefined,
|
|
71
|
+
comment: {
|
|
72
|
+
id: comment.id,
|
|
73
|
+
text: comment.text,
|
|
74
|
+
fieldName: comment.fieldName,
|
|
75
|
+
itemName: comment.itemName,
|
|
76
|
+
author: comment.author,
|
|
77
|
+
selectedText: selectedText,
|
|
78
|
+
rangeStart: comment.rangeStart,
|
|
79
|
+
rangeEnd: comment.rangeEnd,
|
|
80
|
+
},
|
|
81
|
+
additionalData: {
|
|
82
|
+
initialPrompt,
|
|
83
|
+
profileId: editContext.editorSettings?.commentResolveProfileId || undefined,
|
|
84
|
+
profileName: editContext.editorSettings?.commentResolveProfileName || undefined,
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
// Ask Agents UI to open a new terminal seeded with this metadata
|
|
88
|
+
try {
|
|
89
|
+
window.dispatchEvent(new CustomEvent("editor:addNewAgent", {
|
|
90
|
+
detail: { metadata: initialMetadata },
|
|
91
|
+
}));
|
|
92
|
+
}
|
|
93
|
+
catch { }
|
|
94
|
+
}
|
|
95
|
+
catch (e) {
|
|
96
|
+
console.error("Failed to start agent for comment:", e);
|
|
97
|
+
editContext.showToast?.("Failed to start AI agent for this comment.");
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=commentAi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commentAi.js","sourceRoot":"","sources":["../../../src/editor/reviews/commentAi.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACnC,OAAoB,EACpB,WAA6B;IAE7B,IAAI,CAAC,WAAW;QAAE,OAAO;IAEzB,6BAA6B;IAC7B,IAAI,WAAW,CAAC,eAAe,EAAE,CAAC;QAChC,WAAW,CAAC,SAAS,EAAE,CACrB,+DAA+D,CAChE,CAAC;QACF,OAAO;IACT,CAAC;IAED,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE;QACzB,IACE,OAAO,OAAO,CAAC,UAAU,KAAK,QAAQ;YACtC,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ;YACpC,OAAO,CAAC,UAAU,EAClB,CAAC;YACD,IAAI,CAAC;gBACH,OAAO,OAAO,CAAC,UAAU,CAAC,SAAS,CACjC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,EAC/B,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,QAAQ,CAAC,CAC/C,CAAC;YACJ,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC,EAAE,CAAC;IAEL,MAAM,WAAW,GAAa,EAAE,CAAC;IACjC,MAAM,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,EA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{ approveReview, rejectReview } from "../services/reviewsService";
|
|
3
|
+
import { Check, X } from "lucide-react";
|
|
4
|
+
import { toast } from "sonner";
|
|
5
|
+
export const approveReviewCommand = {
|
|
6
|
+
id: "approveReview",
|
|
7
|
+
label: "Approve Page",
|
|
8
|
+
icon: _jsx(Check, { strokeWidth: 1, className: "text-green-500" }),
|
|
9
|
+
execute: async (context) => {
|
|
10
|
+
if (!context.editContext.currentItemDescriptor) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
await approveReview(context.editContext.currentItemDescriptor);
|
|
14
|
+
toast.success("Page/item approved");
|
|
15
|
+
},
|
|
16
|
+
disabled: (context) => {
|
|
17
|
+
return !isReviewer(context);
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export const rejectReviewCommand = {
|
|
21
|
+
id: "rejectReview",
|
|
22
|
+
label: "Reject Page",
|
|
23
|
+
icon: _jsx(X, { strokeWidth: 1, className: "text-red-500" }),
|
|
24
|
+
execute: async (context) => {
|
|
25
|
+
if (!context.editContext.currentItemDescriptor) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
await rejectReview(context.editContext.currentItemDescriptor);
|
|
29
|
+
toast.error("Page/item rejected");
|
|
30
|
+
},
|
|
31
|
+
disabled: (context) => {
|
|
32
|
+
return !isReviewer(context);
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
function isReviewer(context) {
|
|
36
|
+
return (context.editContext.reviews.reviews.find((x) => x.reviewerEmail === context.editContext.user?.email) !== undefined);
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=reviewCommands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reviewCommands.js","sourceRoot":"","sources":["../../../src/editor/reviews/reviewCommands.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,cAAc,CA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AC,OAAO,CAAC,OAAO,CAAC,IAAI,CACtC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,KAAK,OAAO,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAC3D,KAAK,SAAS,CAChB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Review } from "../../types";
|
|
2
|
+
import { ItemDescriptor } from "../pageModel";
|
|
3
|
+
export declare function useReviews({ currentItemDescriptor, addSocketMessageListener, }: {
|
|
4
|
+
currentItemDescriptor?: ItemDescriptor;
|
|
5
|
+
addSocketMessageListener: (callback: (message: {
|
|
6
|
+
type: string;
|
|
7
|
+
payload: any;
|
|
8
|
+
}) => void) => void;
|
|
9
|
+
}): {
|
|
10
|
+
reviews: Review[];
|
|
11
|
+
loadReviews: () => Promise<void>;
|
|
12
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useEffect, useState, useMemo } from "react";
|
|
2
|
+
import { getReviewers, getReviews } from "../services/reviewsService";
|
|
3
|
+
import uuid from "react-uuid";
|
|
4
|
+
export function useReviews({ currentItemDescriptor, addSocketMessageListener, }) {
|
|
5
|
+
const [reviews, setReviews] = useState([]);
|
|
6
|
+
const loadReviews = async () => {
|
|
7
|
+
if (!currentItemDescriptor)
|
|
8
|
+
return;
|
|
9
|
+
const reviewers = await getReviewers(currentItemDescriptor.id, currentItemDescriptor.language);
|
|
10
|
+
const reviewsResult = await getReviews(currentItemDescriptor.id, currentItemDescriptor.language, currentItemDescriptor.version);
|
|
11
|
+
const reviews = reviewsResult.data;
|
|
12
|
+
if (!reviews)
|
|
13
|
+
return;
|
|
14
|
+
reviewers.data?.forEach((reviewer) => {
|
|
15
|
+
if (!currentItemDescriptor)
|
|
16
|
+
return;
|
|
17
|
+
const existingReview = reviews.find((r) => r.reviewerEmail === reviewer.email);
|
|
18
|
+
if (!existingReview) {
|
|
19
|
+
reviews.push({
|
|
20
|
+
id: uuid(),
|
|
21
|
+
itemId: currentItemDescriptor.id,
|
|
22
|
+
language: currentItemDescriptor.language,
|
|
23
|
+
version: currentItemDescriptor.version,
|
|
24
|
+
reviewerName: reviewer.name,
|
|
25
|
+
reviewerEmail: reviewer.email,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
setReviews(reviews);
|
|
30
|
+
};
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
loadReviews();
|
|
33
|
+
}, [currentItemDescriptor]);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
return addSocketMessageListener((message) => {
|
|
36
|
+
if (message.type === "reviews-updated") {
|
|
37
|
+
loadReviews();
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}, [currentItemDescriptor]);
|
|
41
|
+
return useMemo(() => ({ reviews, loadReviews }), [reviews]);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=useReviews.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useReviews.js","sourceRoot":"","sources":["../../../src/editor/reviews/useReviews.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAGtE,OAAO,IAAI,MAAM,YAAY,CAAC;AAG9B,MAAM,UAAU,UAAU,CAAC,EACzB,qBAAqB,EACrB,wBAAwB,GAMzB;IACC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAW,EAAE,CAAC,CAAC;IAErD,MAAM,WAAW,GAAG,KAAK,IAAI,EAAE;QAC7B,IAAI,CAAC,qBAAqB;YAAE,OAAO;QACnC,MAAM,SAAS,GAAG,MAAM,YAAY,CAClC,qBAAqB,CAAC,EAAE,EACxB,qBAAqB,CAAC,QAAQ,CAC/B,CAAC;QAEF,MAAM,aAAa,GAAG,MAAM,UAAU,CACpC,qBAAqB,C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