@alpaca-editor/core 1.0.3938 → 1.0.3941
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/ActionButton.d.ts +1 -0
- package/dist/components/ActionButton.js +2 -2
- package/dist/components/ActionButton.js.map +1 -1
- package/dist/editor/ContentTree.js +12 -8
- package/dist/editor/ContentTree.js.map +1 -1
- package/dist/editor/ContextMenu.d.ts +1 -1
- package/dist/editor/ContextMenu.js +17 -3
- package/dist/editor/ContextMenu.js.map +1 -1
- package/dist/editor/FieldActionsOverlay.d.ts +18 -0
- package/dist/editor/FieldActionsOverlay.js +139 -0
- package/dist/editor/FieldActionsOverlay.js.map +1 -0
- package/dist/editor/FieldHistory.d.ts +2 -1
- package/dist/editor/FieldHistory.js +11 -8
- package/dist/editor/FieldHistory.js.map +1 -1
- package/dist/editor/FieldListField.js +14 -17
- package/dist/editor/FieldListField.js.map +1 -1
- package/dist/editor/PictureCropper.js +65 -23
- package/dist/editor/PictureCropper.js.map +1 -1
- package/dist/editor/PictureEditor.js +43 -3
- package/dist/editor/PictureEditor.js.map +1 -1
- package/dist/editor/Titlebar.js +19 -10
- package/dist/editor/Titlebar.js.map +1 -1
- package/dist/editor/ai/AiTerminal.js +27 -41
- package/dist/editor/ai/AiTerminal.js.map +1 -1
- package/dist/editor/ai/GhostWriter.js +21 -2
- package/dist/editor/ai/GhostWriter.js.map +1 -1
- package/dist/editor/client/EditorClient.js +48 -18
- package/dist/editor/client/EditorClient.js.map +1 -1
- package/dist/editor/client/editContext.d.ts +1 -1
- package/dist/editor/client/editContext.js.map +1 -1
- package/dist/editor/client/itemsRepository.js +126 -90
- package/dist/editor/client/itemsRepository.js.map +1 -1
- package/dist/editor/commands/componentCommands.js +7 -3
- package/dist/editor/commands/componentCommands.js.map +1 -1
- package/dist/editor/media-selector/MediaFolderBrowser.d.ts +5 -0
- package/dist/editor/media-selector/MediaFolderBrowser.js +77 -0
- package/dist/editor/media-selector/MediaFolderBrowser.js.map +1 -0
- package/dist/editor/media-selector/MediaSelector.js +1 -1
- package/dist/editor/media-selector/MediaSelector.js.map +1 -1
- package/dist/editor/media-selector/Thumbnails.js +2 -2
- 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/BrowseHistory.js +3 -4
- package/dist/editor/menubar/BrowseHistory.js.map +1 -1
- package/dist/editor/menubar/PageSelector.js +62 -10
- package/dist/editor/menubar/PageSelector.js.map +1 -1
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js +1 -1
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js.map +1 -1
- package/dist/editor/page-editor-chrome/useInlineAICompletion.js +37 -11
- package/dist/editor/page-editor-chrome/useInlineAICompletion.js.map +1 -1
- package/dist/editor/page-viewer/PageViewerFrame.js +98 -2
- package/dist/editor/page-viewer/PageViewerFrame.js.map +1 -1
- package/dist/editor/pageModel.d.ts +14 -0
- package/dist/editor/reviews/Comment.js +3 -2
- package/dist/editor/reviews/Comment.js.map +1 -1
- package/dist/editor/services/aiService.js +0 -1
- package/dist/editor/services/aiService.js.map +1 -1
- package/dist/editor/services/editService.d.ts +1 -1
- package/dist/editor/services/editService.js +2 -1
- package/dist/editor/services/editService.js.map +1 -1
- package/dist/editor/sidebar/ComponentTree.js +3 -4
- package/dist/editor/sidebar/ComponentTree.js.map +1 -1
- package/dist/editor/ui/Icons.js +1 -1
- package/dist/editor/ui/Icons.js.map +1 -1
- 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/ItemSearch.js +2 -12
- package/dist/editor/ui/ItemSearch.js.map +1 -1
- package/dist/editor/ui/SimpleTabs.d.ts +1 -0
- package/dist/editor/ui/SimpleTabs.js +3 -3
- package/dist/editor/ui/SimpleTabs.js.map +1 -1
- package/dist/editor/ui/Splitter.js +61 -6
- package/dist/editor/ui/Splitter.js.map +1 -1
- 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/SingleEditView.js +9 -1
- package/dist/editor/views/SingleEditView.js.map +1 -1
- package/dist/revision.d.ts +2 -2
- package/dist/revision.js +2 -2
- package/dist/styles.css +64 -13
- package/package.json +8 -2
- package/.prettierrc +0 -3
- package/build.css +0 -3
- package/components.json +0 -21
- package/eslint.config.mjs +0 -4
- 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/src/client-components/api.ts +0 -6
- package/src/client-components/index.ts +0 -19
- package/src/components/ActionButton.tsx +0 -41
- package/src/components/Error.tsx +0 -57
- package/src/components/ui/CardConnector.tsx +0 -56
- package/src/components/ui/button.tsx +0 -62
- package/src/components/ui/card.tsx +0 -372
- package/src/components/ui/context-menu.tsx +0 -250
- package/src/config/config.tsx +0 -917
- package/src/config/types.ts +0 -286
- package/src/editor/ComponentInfo.tsx +0 -90
- package/src/editor/ConfirmationDialog.tsx +0 -103
- package/src/editor/ContentTree.tsx +0 -727
- package/src/editor/ContextMenu.tsx +0 -212
- package/src/editor/Editor.tsx +0 -90
- package/src/editor/EditorWarning.tsx +0 -34
- package/src/editor/EditorWarnings.tsx +0 -33
- package/src/editor/FieldEditorPopup.tsx +0 -65
- package/src/editor/FieldHistory.tsx +0 -74
- package/src/editor/FieldList.tsx +0 -190
- package/src/editor/FieldListField.tsx +0 -391
- package/src/editor/FieldListFieldWithFallbacks.tsx +0 -217
- package/src/editor/FloatingToolbar.tsx +0 -163
- package/src/editor/ImageEditor.tsx +0 -128
- package/src/editor/ItemInfo.tsx +0 -90
- package/src/editor/LinkEditorDialog.tsx +0 -196
- package/src/editor/MainLayout.tsx +0 -95
- package/src/editor/MobileLayout.tsx +0 -68
- package/src/editor/NewEditorClient.tsx +0 -11
- package/src/editor/PictureCropper.tsx +0 -503
- package/src/editor/PictureEditor.tsx +0 -212
- package/src/editor/PictureEditorDialog.tsx +0 -381
- package/src/editor/PublishDialog.ignore +0 -74
- package/src/editor/ScrollingContentTree.tsx +0 -67
- package/src/editor/Terminal.tsx +0 -227
- package/src/editor/Titlebar.tsx +0 -93
- package/src/editor/ai/AiPopup.tsx +0 -59
- package/src/editor/ai/AiResponseMessage.tsx +0 -106
- package/src/editor/ai/AiTerminal.tsx +0 -514
- package/src/editor/ai/AiToolCall.tsx +0 -61
- package/src/editor/ai/EditorAiTerminal.tsx +0 -20
- package/src/editor/ai/GhostWriter.tsx +0 -432
- package/src/editor/ai/aiPageModel.ts +0 -108
- package/src/editor/ai/editorAiContext.ts +0 -18
- package/src/editor/client/AboutDialog.tsx +0 -44
- package/src/editor/client/EditorClient.tsx +0 -2197
- package/src/editor/client/GenericDialog.tsx +0 -50
- package/src/editor/client/editContext.ts +0 -412
- package/src/editor/client/helpers.ts +0 -44
- package/src/editor/client/itemsRepository.ts +0 -538
- package/src/editor/client/operations.ts +0 -768
- package/src/editor/client/pageModelBuilder.ts +0 -219
- package/src/editor/commands/commands.ts +0 -22
- package/src/editor/commands/componentCommands.tsx +0 -424
- package/src/editor/commands/createVersionCommand.ts +0 -33
- package/src/editor/commands/deleteVersionCommand.ts +0 -71
- package/src/editor/commands/itemCommands.tsx +0 -351
- package/src/editor/commands/localizeItem/LocalizeItemDialog.tsx +0 -201
- package/src/editor/commands/localizeItem/LocalizeItemUtils.ts +0 -27
- package/src/editor/commands/undo.ts +0 -39
- package/src/editor/component-designer/ComponentDesigner.tsx +0 -70
- package/src/editor/component-designer/ComponentDesignerAiTerminal.tsx +0 -11
- package/src/editor/component-designer/ComponentDesignerMenu.tsx +0 -91
- package/src/editor/component-designer/ComponentEditor.tsx +0 -97
- package/src/editor/component-designer/ComponentRenderingCodeEditor.tsx +0 -31
- package/src/editor/component-designer/ComponentRenderingEditor.tsx +0 -104
- package/src/editor/component-designer/ComponentsDropdown.tsx +0 -39
- package/src/editor/component-designer/PlaceholdersEditor.tsx +0 -179
- package/src/editor/component-designer/RenderingsDropdown.tsx +0 -36
- package/src/editor/component-designer/TemplateEditor.tsx +0 -236
- package/src/editor/component-designer/aiContext.ts +0 -23
- package/src/editor/componentTreeHelper.tsx +0 -116
- package/src/editor/context-menu/CopyMoveMenu.tsx +0 -103
- package/src/editor/context-menu/InsertMenu.tsx +0 -347
- package/src/editor/control-center/About.tsx +0 -342
- package/src/editor/control-center/ControlCenterMenu.tsx +0 -76
- package/src/editor/control-center/IndexOverview.tsx +0 -50
- package/src/editor/control-center/IndexSettings.tsx +0 -266
- package/src/editor/control-center/Info.tsx +0 -104
- package/src/editor/control-center/QuotaInfo.tsx +0 -301
- package/src/editor/control-center/Status.tsx +0 -113
- package/src/editor/control-center/WebSocketMessages.tsx +0 -155
- package/src/editor/editor-warnings/ItemLocked.tsx +0 -63
- package/src/editor/editor-warnings/NoLanguageWriteAccess.tsx +0 -22
- package/src/editor/editor-warnings/NoWorkflowWriteAccess.tsx +0 -23
- package/src/editor/editor-warnings/NoWriteAccess.tsx +0 -16
- package/src/editor/editor-warnings/ValidationErrors.tsx +0 -54
- package/src/editor/field-types/AttachmentEditor.tsx +0 -9
- package/src/editor/field-types/CheckboxEditor.tsx +0 -47
- package/src/editor/field-types/DropLinkEditor.tsx +0 -80
- package/src/editor/field-types/DropListEditor.tsx +0 -84
- package/src/editor/field-types/ImageFieldEditor.tsx +0 -65
- package/src/editor/field-types/InternalLinkFieldEditor.tsx +0 -117
- package/src/editor/field-types/LinkFieldEditor.tsx +0 -85
- package/src/editor/field-types/MultiLineText.tsx +0 -82
- package/src/editor/field-types/PictureFieldEditor.tsx +0 -121
- package/src/editor/field-types/RawEditor.tsx +0 -53
- package/src/editor/field-types/ReactQuill.tsx +0 -580
- package/src/editor/field-types/RichTextEditor.tsx +0 -22
- package/src/editor/field-types/RichTextEditorComponent.tsx +0 -127
- package/src/editor/field-types/SingleLineText.tsx +0 -174
- package/src/editor/field-types/TreeListEditor.tsx +0 -261
- package/src/editor/fieldTypes.ts +0 -140
- package/src/editor/media-selector/AiImageSearch.tsx +0 -185
- package/src/editor/media-selector/AiImageSearchPrompt.tsx +0 -94
- package/src/editor/media-selector/MediaSelector.tsx +0 -42
- package/src/editor/media-selector/Preview.tsx +0 -14
- package/src/editor/media-selector/Thumbnails.tsx +0 -48
- package/src/editor/media-selector/TreeSelector.tsx +0 -292
- package/src/editor/media-selector/UploadZone.tsx +0 -137
- package/src/editor/menubar/ActionsMenu.tsx +0 -94
- package/src/editor/menubar/ActiveUsers.tsx +0 -17
- package/src/editor/menubar/ApproveAndPublish.tsx +0 -18
- package/src/editor/menubar/BrowseHistory.tsx +0 -37
- package/src/editor/menubar/ItemLanguageVersion.tsx +0 -76
- package/src/editor/menubar/LanguageSelector.tsx +0 -226
- package/src/editor/menubar/Menu.tsx +0 -83
- package/src/editor/menubar/NavButtons.tsx +0 -74
- package/src/editor/menubar/PageSelector.tsx +0 -141
- package/src/editor/menubar/PageViewerControls.tsx +0 -120
- package/src/editor/menubar/PreviewSecondaryControls.tsx +0 -18
- package/src/editor/menubar/SecondaryControls.tsx +0 -45
- package/src/editor/menubar/Separator.tsx +0 -12
- package/src/editor/menubar/SiteInfo.tsx +0 -53
- package/src/editor/menubar/User.tsx +0 -27
- package/src/editor/menubar/VersionSelector.tsx +0 -142
- package/src/editor/page-editor-chrome/CommentHighlighting.tsx +0 -307
- package/src/editor/page-editor-chrome/CommentHighlightings.tsx +0 -35
- package/src/editor/page-editor-chrome/FieldActionIndicator.tsx +0 -59
- package/src/editor/page-editor-chrome/FieldActionIndicators.tsx +0 -23
- package/src/editor/page-editor-chrome/FieldEditedIndicator.tsx +0 -64
- package/src/editor/page-editor-chrome/FieldEditedIndicators.tsx +0 -35
- package/src/editor/page-editor-chrome/FrameMenu.tsx +0 -338
- package/src/editor/page-editor-chrome/FrameMenus.tsx +0 -48
- package/src/editor/page-editor-chrome/InlineEditor.tsx +0 -765
- package/src/editor/page-editor-chrome/LockedFieldIndicator.tsx +0 -61
- package/src/editor/page-editor-chrome/NoLayout.tsx +0 -36
- package/src/editor/page-editor-chrome/PageEditorChrome.tsx +0 -122
- package/src/editor/page-editor-chrome/PictureEditorOverlay.tsx +0 -161
- package/src/editor/page-editor-chrome/PlaceholderDropZone.tsx +0 -169
- package/src/editor/page-editor-chrome/PlaceholderDropZones.tsx +0 -315
- package/src/editor/page-editor-chrome/SuggestionHighlighting.tsx +0 -300
- package/src/editor/page-editor-chrome/SuggestionHighlightings.tsx +0 -40
- package/src/editor/page-editor-chrome/useInlineAICompletion.tsx +0 -791
- package/src/editor/page-viewer/DeviceToolbar.tsx +0 -70
- package/src/editor/page-viewer/EditorForm.tsx +0 -258
- package/src/editor/page-viewer/MiniMap.tsx +0 -362
- package/src/editor/page-viewer/PageViewer.tsx +0 -169
- package/src/editor/page-viewer/PageViewerFrame.tsx +0 -879
- package/src/editor/page-viewer/pageModelSkeletonBuilder.ts +0 -412
- package/src/editor/page-viewer/pageViewContext.ts +0 -186
- package/src/editor/pageModel.ts +0 -208
- package/src/editor/picture-shared.tsx +0 -53
- package/src/editor/reviews/Comment.tsx +0 -308
- package/src/editor/reviews/Comments.tsx +0 -125
- package/src/editor/reviews/DiffView.tsx +0 -109
- package/src/editor/reviews/PreviewInfo.tsx +0 -35
- package/src/editor/reviews/Reviews.tsx +0 -280
- package/src/editor/reviews/SuggestedEdit.tsx +0 -316
- package/src/editor/reviews/reviewCommands.tsx +0 -47
- package/src/editor/reviews/useReviews.tsx +0 -70
- package/src/editor/services/aiService.ts +0 -174
- package/src/editor/services/componentDesignerService.ts +0 -151
- package/src/editor/services/contentService.ts +0 -180
- package/src/editor/services/editService.ts +0 -486
- package/src/editor/services/indexService.ts +0 -24
- package/src/editor/services/reviewsService.ts +0 -53
- package/src/editor/services/serviceHelper.ts +0 -95
- package/src/editor/services/suggestedEditsService.ts +0 -39
- package/src/editor/services/systemService.ts +0 -5
- package/src/editor/services/translationService.ts +0 -21
- package/src/editor/services-server/api.ts +0 -150
- package/src/editor/services-server/graphQL.ts +0 -106
- package/src/editor/sidebar/ComponentPalette.tsx +0 -161
- package/src/editor/sidebar/ComponentTree.tsx +0 -548
- package/src/editor/sidebar/ComponentTree2.tsxx +0 -490
- package/src/editor/sidebar/Debug.tsx +0 -111
- package/src/editor/sidebar/DictionaryEditor.tsx +0 -261
- package/src/editor/sidebar/EditHistory.tsx +0 -134
- package/src/editor/sidebar/GraphQL.tsx +0 -164
- package/src/editor/sidebar/Insert.tsx +0 -35
- package/src/editor/sidebar/MainContentTree.tsx +0 -102
- package/src/editor/sidebar/Performance.tsx +0 -53
- package/src/editor/sidebar/Sessions.tsx +0 -35
- package/src/editor/sidebar/Sidebar.tsx +0 -20
- package/src/editor/sidebar/SidebarView.tsx +0 -152
- package/src/editor/sidebar/Translations.tsx +0 -295
- package/src/editor/sidebar/Validation.tsx +0 -102
- package/src/editor/sidebar/ViewSelector.tsx +0 -60
- package/src/editor/sidebar/Workbox.tsx +0 -209
- package/src/editor/ui/CenteredMessage.tsx +0 -7
- package/src/editor/ui/CopyMoveTargetSelectorDialog.tsx +0 -81
- package/src/editor/ui/CopyToClipboardButton.tsx +0 -24
- package/src/editor/ui/DialogButtons.tsx +0 -11
- package/src/editor/ui/Icons.tsx +0 -708
- package/src/editor/ui/ItemNameDialogNew.tsx +0 -118
- package/src/editor/ui/ItemSearch.tsx +0 -190
- package/src/editor/ui/PerfectTree.tsx +0 -571
- package/src/editor/ui/Section.tsx +0 -35
- package/src/editor/ui/SimpleIconButton.tsx +0 -54
- package/src/editor/ui/SimpleMenu.tsx +0 -40
- package/src/editor/ui/SimpleTable.tsx +0 -60
- package/src/editor/ui/SimpleTabs.tsx +0 -55
- package/src/editor/ui/SimpleToolbar.tsx +0 -7
- package/src/editor/ui/Spinner.tsx +0 -9
- package/src/editor/ui/Splitter.tsx +0 -314
- package/src/editor/ui/StackedPanels.tsx +0 -134
- package/src/editor/ui/Toolbar.tsx +0 -7
- package/src/editor/utils/id-helper.ts +0 -3
- package/src/editor/utils/insertOptions.ts +0 -69
- package/src/editor/utils/itemutils.ts +0 -29
- package/src/editor/utils/useMemoDebug.ts +0 -28
- package/src/editor/utils.ts +0 -486
- package/src/editor/views/CompareView.tsx +0 -245
- package/src/editor/views/EditView.tsx +0 -27
- package/src/editor/views/ItemEditor.tsx +0 -58
- package/src/editor/views/SingleEditView.tsx +0 -46
- package/src/fonts/Geist-Black.woff2 +0 -0
- package/src/fonts/Geist-Bold.woff2 +0 -0
- package/src/fonts/Geist-ExtraBold.woff2 +0 -0
- package/src/fonts/Geist-ExtraLight.woff2 +0 -0
- package/src/fonts/Geist-Light.woff2 +0 -0
- package/src/fonts/Geist-Medium.woff2 +0 -0
- package/src/fonts/Geist-Regular.woff2 +0 -0
- package/src/fonts/Geist-SemiBold.woff2 +0 -0
- package/src/fonts/Geist-Thin.woff2 +0 -0
- package/src/fonts/Geist[wght].woff2 +0 -0
- package/src/fonts/index.ts +0 -10
- package/src/index.ts +0 -23
- package/src/lib/safelist.tsx +0 -16
- package/src/lib/utils.ts +0 -6
- package/src/page-wizard/PageWizard.tsx +0 -139
- package/src/page-wizard/WizardBox.tsx +0 -4
- package/src/page-wizard/WizardBoxConnector.tsx +0 -56
- package/src/page-wizard/WizardSteps.tsx +0 -458
- package/src/page-wizard/service.ts +0 -35
- package/src/page-wizard/startPageWizardCommand.ts +0 -26
- package/src/page-wizard/steps/BuildPageStep.tsx +0 -259
- package/src/page-wizard/steps/CollectStep.tsx +0 -296
- package/src/page-wizard/steps/ComponentTypesSelector.tsx +0 -454
- package/src/page-wizard/steps/Components.tsx +0 -193
- package/src/page-wizard/steps/ContentStep.tsx +0 -890
- package/src/page-wizard/steps/EditButton.tsx +0 -34
- package/src/page-wizard/steps/FieldEditor.tsx +0 -102
- package/src/page-wizard/steps/Generate.tsx +0 -60
- package/src/page-wizard/steps/ImagesStep.tsx +0 -382
- package/src/page-wizard/steps/LayoutStep.tsx +0 -227
- package/src/page-wizard/steps/MetaDataStep.tsx +0 -173
- package/src/page-wizard/steps/SelectStep.tsx +0 -281
- package/src/page-wizard/steps/schema.ts +0 -180
- package/src/page-wizard/steps/usePageCreator.ts +0 -325
- package/src/page-wizard/usePageWizard.ts +0 -79
- package/src/revision.ts +0 -2
- package/src/splash-screen/NewPage.tsx +0 -294
- package/src/splash-screen/OpenPage.tsx +0 -113
- package/src/splash-screen/RecentPages.tsx +0 -123
- package/src/splash-screen/SectionHeadline.tsx +0 -21
- package/src/splash-screen/SplashScreen.tsx +0 -195
- package/src/tour/Tour.tsx +0 -566
- package/src/tour/default-tour.tsx +0 -301
- package/src/tour/preview-tour.tsx +0 -128
- package/src/types.ts +0 -335
- package/styles.css +0 -765
- package/tsconfig.build.json +0 -31
- package/tsconfig.json +0 -14
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { classNames } from "primereact/utils";
|
|
3
|
-
|
|
4
|
-
import { useEditContext } from "../client/editContext";
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
|
|
7
|
-
export function ViewSelector() {
|
|
8
|
-
const editContext = useEditContext();
|
|
9
|
-
const userViews = editContext?.userInfo.views;
|
|
10
|
-
|
|
11
|
-
const views =
|
|
12
|
-
editContext?.configuration.editor.views
|
|
13
|
-
.filter(
|
|
14
|
-
(x) =>
|
|
15
|
-
(x.visible && x.visible(editContext)) || (!x.visible && !x.hidden),
|
|
16
|
-
)
|
|
17
|
-
.filter(
|
|
18
|
-
(x) =>
|
|
19
|
-
!userViews || userViews.map((view) => view.name).includes(x.name),
|
|
20
|
-
) ?? [];
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<div
|
|
24
|
-
className={cn(
|
|
25
|
-
"z-10 flex items-center gap-3 bg-neutral-200 p-2 shadow-md",
|
|
26
|
-
editContext?.isMobile
|
|
27
|
-
? "scrollbar-hide flex-row overflow-x-auto"
|
|
28
|
-
: "max-w-11 flex-col",
|
|
29
|
-
)}
|
|
30
|
-
>
|
|
31
|
-
{views
|
|
32
|
-
.filter((x) => x.icon)
|
|
33
|
-
.map((x, i) => (
|
|
34
|
-
<div
|
|
35
|
-
title={x.title}
|
|
36
|
-
key={i}
|
|
37
|
-
className={classNames(
|
|
38
|
-
editContext?.viewName == x.name
|
|
39
|
-
? "active bg-neutral-350 rounded-sm text-neutral-800"
|
|
40
|
-
: "text-neutral-500 hover:text-gray-900",
|
|
41
|
-
"cursor-pointer p-1.5",
|
|
42
|
-
editContext?.isMobile ? "flex-shrink-0" : "",
|
|
43
|
-
)}
|
|
44
|
-
data-sidebarview-name={x.name}
|
|
45
|
-
onClick={() => {
|
|
46
|
-
if (x.name !== editContext?.viewName) {
|
|
47
|
-
editContext?.switchView(x.name);
|
|
48
|
-
}
|
|
49
|
-
}}
|
|
50
|
-
>
|
|
51
|
-
{x.icon &&
|
|
52
|
-
React.isValidElement(x.icon) &&
|
|
53
|
-
React.cloneElement(x.icon as React.ReactElement<any>, {
|
|
54
|
-
className: "w-5 h-5",
|
|
55
|
-
})}
|
|
56
|
-
</div>
|
|
57
|
-
))}
|
|
58
|
-
</div>
|
|
59
|
-
);
|
|
60
|
-
}
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
import { useEditContext } from "../client/editContext";
|
|
2
|
-
import { Tooltip } from "primereact/tooltip";
|
|
3
|
-
import { Button } from "primereact/button";
|
|
4
|
-
import { useRef, useState } from "react";
|
|
5
|
-
|
|
6
|
-
import { OverlayPanel } from "primereact/overlaypanel";
|
|
7
|
-
import { classNames } from "primereact/utils";
|
|
8
|
-
|
|
9
|
-
import { SimpleTable } from "../ui/SimpleTable";
|
|
10
|
-
import { WorkboxItem } from "../../types";
|
|
11
|
-
|
|
12
|
-
export function Workbox() {
|
|
13
|
-
const [validationOverlayItem, setValidationOverlayItem] =
|
|
14
|
-
useState<WorkboxItem>();
|
|
15
|
-
|
|
16
|
-
const editContext = useEditContext();
|
|
17
|
-
|
|
18
|
-
const validationResult = editContext?.validationResult;
|
|
19
|
-
|
|
20
|
-
if (!editContext) return null;
|
|
21
|
-
|
|
22
|
-
const validationOverlay = useRef<OverlayPanel>(null);
|
|
23
|
-
|
|
24
|
-
const nameBodyTemplate = (wbItem: WorkboxItem) => {
|
|
25
|
-
const id = wbItem.item.id + wbItem.item.language + wbItem.item.version;
|
|
26
|
-
return (
|
|
27
|
-
<div className="flex gap-2 items-center">
|
|
28
|
-
{/* {(wbItem.lockedBy || wbItem.hasLock) && (
|
|
29
|
-
<>
|
|
30
|
-
<i
|
|
31
|
-
className={
|
|
32
|
-
`lock-tooltip-${id} ` +
|
|
33
|
-
"text-xs pi pi-lock cursor-pointer " +
|
|
34
|
-
(wbItem.hasLock ? "text-green-600" : "text-red-600")
|
|
35
|
-
}
|
|
36
|
-
onClick={() => {
|
|
37
|
-
unlockItems([wbItem.item]);
|
|
38
|
-
}}
|
|
39
|
-
/>
|
|
40
|
-
<Tooltip
|
|
41
|
-
target={`.a-lock-tooltip-${id}`}
|
|
42
|
-
content={wbItem.lockedBy}
|
|
43
|
-
/>
|
|
44
|
-
</>
|
|
45
|
-
)}
|
|
46
|
-
{!wbItem.lockedBy && !wbItem.hasLock && (
|
|
47
|
-
<i
|
|
48
|
-
className="text-xs pi pi-lock-open cursor-pointer"
|
|
49
|
-
onClick={() => {
|
|
50
|
-
lockItems([wbItem.item]);
|
|
51
|
-
}}
|
|
52
|
-
/>
|
|
53
|
-
)} */}
|
|
54
|
-
|
|
55
|
-
<span
|
|
56
|
-
className={`name-tooltip-${id} break-all`}
|
|
57
|
-
style={{ position: "relative" }}
|
|
58
|
-
>
|
|
59
|
-
{wbItem.name}{" "}
|
|
60
|
-
<span className="text-gray-500">
|
|
61
|
-
({wbItem.item.language}, {wbItem.item.version})
|
|
62
|
-
</span>
|
|
63
|
-
<Tooltip target={`.a-name-tooltip-${id}`} content={wbItem.path} />
|
|
64
|
-
</span>
|
|
65
|
-
</div>
|
|
66
|
-
);
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const stateBodyTemplate = (item: WorkboxItem) => {
|
|
70
|
-
if (item.isPublishable) {
|
|
71
|
-
const targets = Object.keys(item.publishStatus);
|
|
72
|
-
return targets.map((x) => (
|
|
73
|
-
<div key={x}>
|
|
74
|
-
{targets.length > 1 && (
|
|
75
|
-
<>
|
|
76
|
-
<b>{x}</b>:
|
|
77
|
-
</>
|
|
78
|
-
)}
|
|
79
|
-
{item.publishStatus[x]}
|
|
80
|
-
</div>
|
|
81
|
-
));
|
|
82
|
-
} else return item.workflowState;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
const actionsBodyTemplate = (item: WorkboxItem) => {
|
|
86
|
-
return (
|
|
87
|
-
<div className="flex flex-wrap gap-1">
|
|
88
|
-
{!item.isFinalState &&
|
|
89
|
-
item.workflowCommands?.map((action) => {
|
|
90
|
-
return (
|
|
91
|
-
<Button
|
|
92
|
-
key={action.id}
|
|
93
|
-
label={action.name}
|
|
94
|
-
className="text-xs p-1"
|
|
95
|
-
onClick={() =>
|
|
96
|
-
editContext.operations.executeWorkflowCommand(
|
|
97
|
-
item.item,
|
|
98
|
-
action.id
|
|
99
|
-
)
|
|
100
|
-
}
|
|
101
|
-
size="small"
|
|
102
|
-
/>
|
|
103
|
-
);
|
|
104
|
-
})}
|
|
105
|
-
</div>
|
|
106
|
-
);
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
const validationTemplate = (item: WorkboxItem) => {
|
|
110
|
-
const validator = validationResult?.find(
|
|
111
|
-
(x) =>
|
|
112
|
-
x.item.id === item.item.id &&
|
|
113
|
-
x.item.language === item.item.language &&
|
|
114
|
-
x.item.version === item.item.version
|
|
115
|
-
);
|
|
116
|
-
if (!validator || !validator.results.length) return null;
|
|
117
|
-
return (
|
|
118
|
-
<div
|
|
119
|
-
className={classNames(
|
|
120
|
-
"cursor-pointer",
|
|
121
|
-
getValidationErrorLevelClass(
|
|
122
|
-
validator.results.reduce(
|
|
123
|
-
(prev, curr) => Math.max(prev, curr.result),
|
|
124
|
-
0
|
|
125
|
-
)
|
|
126
|
-
)
|
|
127
|
-
)}
|
|
128
|
-
onClick={(ev) => {
|
|
129
|
-
setValidationOverlayItem(item);
|
|
130
|
-
validationOverlay.current?.toggle(ev);
|
|
131
|
-
}}
|
|
132
|
-
>
|
|
133
|
-
{validator.results.length}
|
|
134
|
-
</div>
|
|
135
|
-
);
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
if (!editContext.workboxItems) return null;
|
|
139
|
-
|
|
140
|
-
const overlayResult = validationResult?.find(
|
|
141
|
-
(x) =>
|
|
142
|
-
x.item.id === validationOverlayItem?.item.id &&
|
|
143
|
-
x.item.language === validationOverlayItem?.item.language &&
|
|
144
|
-
x.item.version === validationOverlayItem?.item.version
|
|
145
|
-
);
|
|
146
|
-
|
|
147
|
-
const getValidationErrorLevelClass = (level: number) => {
|
|
148
|
-
switch (level) {
|
|
149
|
-
case 0:
|
|
150
|
-
return "text-green-600";
|
|
151
|
-
case 1:
|
|
152
|
-
return "text-blue-600";
|
|
153
|
-
case 2:
|
|
154
|
-
return "text-yellow-600";
|
|
155
|
-
case 3:
|
|
156
|
-
return "text-orange-600";
|
|
157
|
-
case 4:
|
|
158
|
-
case 5:
|
|
159
|
-
return "text-red-600";
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
const columns = [
|
|
164
|
-
{ body: nameBodyTemplate, header: "Item" },
|
|
165
|
-
{ body: stateBodyTemplate, header: "State" },
|
|
166
|
-
{ body: actionsBodyTemplate, header: "Actions" },
|
|
167
|
-
{
|
|
168
|
-
body: validationTemplate,
|
|
169
|
-
align: "center",
|
|
170
|
-
header: <i className="pi pi-check" />,
|
|
171
|
-
},
|
|
172
|
-
];
|
|
173
|
-
|
|
174
|
-
return (
|
|
175
|
-
<>
|
|
176
|
-
<SimpleTable items={editContext.workboxItems} columns={columns} />
|
|
177
|
-
<OverlayPanel ref={validationOverlay}>
|
|
178
|
-
<table className="text-xs border-spacing-1 border-separate m-3">
|
|
179
|
-
<thead>
|
|
180
|
-
<tr>
|
|
181
|
-
<th className="text-left">Item</th>
|
|
182
|
-
<th className="text-left">Field</th>
|
|
183
|
-
<th className="text-left">Validator</th>
|
|
184
|
-
<th className="text-left">Message</th>
|
|
185
|
-
</tr>
|
|
186
|
-
</thead>
|
|
187
|
-
<tbody>
|
|
188
|
-
{overlayResult &&
|
|
189
|
-
overlayResult.results.map((x) => (
|
|
190
|
-
<tr key={x.fieldId + x.itemId}>
|
|
191
|
-
<td>{x.itemName}</td>
|
|
192
|
-
<td>{x.fieldName}</td>
|
|
193
|
-
<td>{x.validator}</td>
|
|
194
|
-
<td
|
|
195
|
-
className={classNames(
|
|
196
|
-
"text-xs break-all max-w-48",
|
|
197
|
-
getValidationErrorLevelClass(x.result)
|
|
198
|
-
)}
|
|
199
|
-
>
|
|
200
|
-
{x.message}
|
|
201
|
-
</td>
|
|
202
|
-
</tr>
|
|
203
|
-
))}
|
|
204
|
-
</tbody>
|
|
205
|
-
</table>
|
|
206
|
-
</OverlayPanel>
|
|
207
|
-
</>
|
|
208
|
-
);
|
|
209
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { Button } from "primereact/button";
|
|
2
|
-
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
|
|
5
|
-
import { FullItem, ItemDescriptor } from "../pageModel";
|
|
6
|
-
import { Dialog } from "primereact/dialog";
|
|
7
|
-
import DialogButtons from "./DialogButtons";
|
|
8
|
-
import { DialogProps } from "../client/editContext";
|
|
9
|
-
import { ScrollingContentTree } from "../ScrollingContentTree";
|
|
10
|
-
import { EditContextType } from "../client/editContext";
|
|
11
|
-
import { rootItemId } from "../../config/config";
|
|
12
|
-
|
|
13
|
-
export type CopyMoveTargetSelectorDialogProps = {
|
|
14
|
-
items: FullItem[];
|
|
15
|
-
editContext: EditContextType;
|
|
16
|
-
label: string;
|
|
17
|
-
header: string;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export function CopyMoveTargetSelectorDialog(
|
|
21
|
-
props: CopyMoveTargetSelectorDialogProps & DialogProps<ItemDescriptor>,
|
|
22
|
-
) {
|
|
23
|
-
if (!props) return null;
|
|
24
|
-
|
|
25
|
-
const [selectedItem, setSelectedItem] = useState<
|
|
26
|
-
(ItemDescriptor & { canCreate: boolean }) | null
|
|
27
|
-
>();
|
|
28
|
-
|
|
29
|
-
const handleOk = () => {
|
|
30
|
-
props.onClose?.(selectedItem ?? null);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const handleCancel = () => {
|
|
34
|
-
props.onClose?.(null);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<Dialog
|
|
39
|
-
visible={true}
|
|
40
|
-
style={{ width: "70vw", height: "90vh" }}
|
|
41
|
-
onHide={() => {
|
|
42
|
-
props.onClose?.(null);
|
|
43
|
-
}}
|
|
44
|
-
onShow={() => {}}
|
|
45
|
-
header={props.header}
|
|
46
|
-
>
|
|
47
|
-
<div className="flex h-full flex-1 flex-col">
|
|
48
|
-
<div className="relative flex-1 py-3">
|
|
49
|
-
<ScrollingContentTree
|
|
50
|
-
selectedItemId={selectedItem?.id}
|
|
51
|
-
expandedItemId={props.items[0]?.id}
|
|
52
|
-
rootItemId={rootItemId}
|
|
53
|
-
onSelectionChange={async (node) => {
|
|
54
|
-
if (!props.items[0]) return;
|
|
55
|
-
if (!node[0]) setSelectedItem(null);
|
|
56
|
-
else {
|
|
57
|
-
const item = await props.editContext.itemsRepository.getItem(
|
|
58
|
-
node[0],
|
|
59
|
-
);
|
|
60
|
-
setSelectedItem({
|
|
61
|
-
id: node[0].id,
|
|
62
|
-
version: 0,
|
|
63
|
-
language: props.items[0].language,
|
|
64
|
-
canCreate: item?.canCreate ?? false,
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
}}
|
|
68
|
-
/>
|
|
69
|
-
</div>
|
|
70
|
-
<DialogButtons>
|
|
71
|
-
<Button
|
|
72
|
-
onClick={handleOk}
|
|
73
|
-
label={props.label}
|
|
74
|
-
disabled={!selectedItem || !selectedItem.canCreate}
|
|
75
|
-
/>
|
|
76
|
-
<Button onClick={handleCancel} label="Cancel" />
|
|
77
|
-
</DialogButtons>
|
|
78
|
-
</div>
|
|
79
|
-
</Dialog>
|
|
80
|
-
);
|
|
81
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Copy } from "lucide-react";
|
|
4
|
-
import { useEditContext } from "../client/editContext";
|
|
5
|
-
|
|
6
|
-
export function CopyToClipboardButton({ text }: { text: string }) {
|
|
7
|
-
const editContext = useEditContext();
|
|
8
|
-
const handleCopyToClipboard = (text: string) => {
|
|
9
|
-
navigator.clipboard.writeText(text);
|
|
10
|
-
editContext!.showToast({
|
|
11
|
-
summary: "Copied to clipboard",
|
|
12
|
-
severity: "success",
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<span
|
|
18
|
-
className="ml-1 cursor-pointer"
|
|
19
|
-
onClick={() => handleCopyToClipboard(text)}
|
|
20
|
-
>
|
|
21
|
-
<Copy size={14} />
|
|
22
|
-
</span>
|
|
23
|
-
);
|
|
24
|
-
}
|