@blokkli/editor 2.0.0-alpha.2 → 2.0.0-alpha.21
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/module.d.mts +1 -1
- package/dist/module.json +5 -5
- package/dist/module.mjs +5549 -1269
- package/dist/modules/drupal/graphql/base/fragment.ParagraphsBlokkliConfigInput.graphql +31 -0
- package/dist/modules/drupal/graphql/base/fragment.blokkliProps.graphql +9 -0
- package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliEditState.graphql +5 -0
- package/dist/modules/drupal/graphql/base/fragment.paragraphsFieldItem.graphql +9 -0
- package/dist/modules/drupal/graphql/base/query.pbConfig.graphql +1 -10
- package/dist/modules/drupal/graphql/base/query.pbEntityConfig.graphql +5 -0
- package/dist/modules/drupal/graphql/features/comments.graphql +11 -8
- package/dist/modules/drupal/graphql/features/publishNew.graphql +1 -4
- package/dist/modules/drupal/graphql/features/scheduler.graphql +31 -0
- package/dist/modules/drupal/graphql/features/transform.graphql +9 -1
- package/dist/modules/drupal/graphql/features/transform_host.graphql +38 -0
- package/dist/modules/drupal/graphql/mutations/set_paragraph_schedule.graphql +15 -0
- package/dist/modules/drupal/graphql/mutations/update_host_options.graphql +15 -0
- package/dist/modules/drupal/index.d.mts +1 -1
- package/dist/modules/drupal/index.mjs +79 -9
- package/dist/modules/drupal/runtime/adapter/index.d.ts +3 -0
- package/dist/modules/drupal/{adapter/index.mjs → runtime/adapter/index.js} +166 -20
- package/dist/runtime/adapter/index.d.ts +111 -1
- package/dist/runtime/blokkliPlugins/AddAction/index.vue +27 -3
- package/dist/runtime/blokkliPlugins/BlockIndicator/index.vue +65 -0
- package/dist/runtime/blokkliPlugins/BlockIndicator/index.vue.d.ts +26 -0
- package/dist/runtime/blokkliPlugins/ContextMenu/Menu/index.vue +6 -0
- package/dist/runtime/blokkliPlugins/ContextMenu/index.vue +3 -2
- package/dist/runtime/blokkliPlugins/ContextMenu/index.vue.d.ts +2 -19
- package/dist/runtime/blokkliPlugins/DebugOverlay/index.vue.d.ts +2 -7
- package/dist/runtime/blokkliPlugins/DroppableEdit/index.vue +3 -3
- package/dist/runtime/blokkliPlugins/DroppableEdit/index.vue.d.ts +2 -19
- package/dist/runtime/blokkliPlugins/ItemAction/index.vue +23 -15
- package/dist/runtime/blokkliPlugins/ItemAction/index.vue.d.ts +21 -44
- package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue +49 -11
- package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue.d.ts +29 -15
- package/dist/runtime/blokkliPlugins/MenuButton/index.vue.d.ts +3 -3
- package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue +6 -7
- package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue.d.ts +2 -51
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue +2 -9
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue.d.ts +15 -9
- package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue.d.ts +1 -1
- package/dist/runtime/blokkliPlugins/TourItem/index.vue +10 -5
- package/dist/runtime/blokkliPlugins/TourItem/index.vue.d.ts +2 -4
- package/dist/runtime/blokkliPlugins/ViewOption/index.vue +6 -3
- package/dist/runtime/blokkliPlugins/ViewOption/index.vue.d.ts +4 -3
- package/dist/runtime/blokkliPlugins/index.d.ts +8 -7
- package/dist/runtime/blokkliPlugins/index.js +15 -13
- package/dist/runtime/components/Blocks/Fragment/icon.svg +1 -1
- package/dist/runtime/components/Blocks/FromLibrary/index.vue +4 -2
- package/dist/runtime/components/BlokkliEditable.vue +34 -16
- package/dist/runtime/components/BlokkliEditable.vue.d.ts +2 -1
- package/dist/runtime/components/BlokkliField.vue +31 -27
- package/dist/runtime/components/BlokkliField.vue.d.ts +61 -17
- package/dist/runtime/components/BlokkliItem.vue +2 -2
- package/dist/runtime/components/BlokkliItem.vue.d.ts +4 -2
- package/dist/runtime/components/BlokkliProvider.vue +60 -45
- package/dist/runtime/components/BlokkliProvider.vue.d.ts +45 -7
- package/dist/runtime/components/Edit/Actions/index.vue +69 -78
- package/dist/runtime/components/Edit/AddListItem/index.vue +2 -5
- package/dist/runtime/components/Edit/AddListItem/index.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/AddListItemIcon/index.vue +19 -0
- package/dist/runtime/components/Edit/AddListItemIcon/index.vue.d.ts +15 -0
- package/dist/runtime/components/Edit/AnimationCanvas/index.vue +436 -25
- package/dist/runtime/components/Edit/AppMenu/index.vue +5 -5
- package/dist/runtime/components/Edit/ArtboardTooltip/index.vue +83 -0
- package/dist/runtime/components/Edit/ArtboardTooltip/index.vue.d.ts +32 -0
- package/dist/runtime/components/Edit/Banner/index.vue +51 -0
- package/dist/runtime/components/Edit/Banner/index.vue.d.ts +18 -0
- package/dist/runtime/components/Edit/BlockProxy/index.vue +3 -1
- package/dist/runtime/components/Edit/BlokkliErrorBoundary.vue.d.ts +2 -13
- package/dist/runtime/components/Edit/Dialog/index.vue +14 -5
- package/dist/runtime/components/Edit/Dialog/index.vue.d.ts +4 -2
- package/dist/runtime/components/Edit/DiffViewer/State.vue +276 -0
- package/dist/runtime/components/Edit/DiffViewer/State.vue.d.ts +16 -0
- package/dist/runtime/components/Edit/DraggableList.vue +20 -50
- package/dist/runtime/components/Edit/DraggableList.vue.d.ts +7 -7
- package/dist/runtime/components/Edit/EditIndicator.vue +118 -44
- package/dist/runtime/components/Edit/EditIndicator.vue.d.ts +3 -0
- package/dist/runtime/components/Edit/EditProvider.vue +192 -80
- package/dist/runtime/components/Edit/EditProvider.vue.d.ts +3 -0
- package/dist/runtime/components/Edit/Features/AddList/index.vue +24 -36
- package/dist/runtime/components/Edit/Features/Analyze/Overlay/fragment.glsl +58 -0
- package/dist/runtime/components/Edit/Features/Analyze/Overlay/index.vue +170 -0
- package/dist/runtime/components/Edit/Features/Analyze/Overlay/index.vue.d.ts +9 -0
- package/dist/runtime/components/Edit/Features/Analyze/Overlay/vertex.glsl +72 -0
- package/dist/runtime/components/Edit/Features/Analyze/Renderer.vue +159 -0
- package/dist/runtime/components/Edit/Features/Analyze/Renderer.vue.d.ts +7 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/Results.vue +100 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/Results.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItem.vue +56 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItem.vue.d.ts +3 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodes.vue +87 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodes.vue.d.ts +7 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue +105 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue.d.ts +8 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/Status.vue +18 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/Status.vue.d.ts +8 -0
- package/dist/runtime/components/Edit/Features/Analyze/Summary/Chart.vue +92 -0
- package/dist/runtime/components/Edit/Features/Analyze/Summary/Chart.vue.d.ts +17 -0
- package/dist/runtime/components/Edit/Features/Analyze/Summary/index.vue +77 -0
- package/dist/runtime/components/Edit/Features/Analyze/Summary/index.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/axe.d.ts +12 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/axe.js +75 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/defineAnalyzer.d.ts +4 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/defineAnalyzer.js +5 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/Context.d.ts +32 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/Context.js +45 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/collectTextElements.d.ts +5 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/collectTextElements.js +95 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/normalizeArray.d.ts +3 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/normalizeArray.js +13 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/index.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/index.js +2 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/readability.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/readability.js +165 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/types.d.ts +44 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/types.js +0 -0
- package/dist/runtime/components/Edit/Features/Analyze/helper.d.ts +5 -0
- package/dist/runtime/components/Edit/Features/Analyze/helper.js +28 -0
- package/dist/runtime/components/Edit/Features/Analyze/index.vue +44 -0
- package/dist/runtime/components/Edit/Features/Anchors/Renderer.vue +53 -0
- package/dist/runtime/components/Edit/Features/Anchors/index.vue +32 -0
- package/dist/runtime/components/Edit/Features/Artboard/Overview/index.vue +25 -13
- package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue +299 -0
- package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue.d.ts +7 -0
- package/dist/runtime/components/Edit/Features/Artboard/index.vue +10 -217
- package/dist/runtime/components/Edit/Features/Assistant/index.vue +5 -3
- package/dist/runtime/components/Edit/Features/BlockAddList/index.vue +33 -57
- package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/ScheduleSection.vue +154 -0
- package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/ScheduleSection.vue.d.ts +27 -0
- package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/index.vue +222 -0
- package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/index.vue.d.ts +11 -0
- package/dist/runtime/components/Edit/Features/BlockScheduler/index.vue +96 -0
- package/dist/runtime/components/Edit/Features/BlockScheduler/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Clipboard/index.vue +177 -46
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Item/index.vue +51 -0
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Item/index.vue.d.ts +17 -0
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/index.vue +48 -117
- package/dist/runtime/components/Edit/Features/CommandPalette/index.vue +5 -2
- package/dist/runtime/components/Edit/Features/Comments/AddForm/index.vue +35 -20
- package/dist/runtime/components/Edit/Features/Comments/AddForm/index.vue.d.ts +5 -3
- package/dist/runtime/components/Edit/Features/Comments/CommentInput/index.vue +29 -0
- package/dist/runtime/components/Edit/Features/Comments/CommentInput/index.vue.d.ts +13 -0
- package/dist/runtime/components/Edit/Features/Comments/Overlay/Item/index.vue +22 -16
- package/dist/runtime/components/Edit/Features/Comments/Overlay/Item/index.vue.d.ts +1 -0
- package/dist/runtime/components/Edit/Features/Comments/Overlay/index.vue +15 -6
- package/dist/runtime/components/Edit/Features/Comments/index.vue +21 -9
- package/dist/runtime/components/Edit/Features/Conversions/index.vue +16 -21
- package/dist/runtime/components/Edit/Features/Debug/Rects/index.vue +26 -35
- package/dist/runtime/components/Edit/Features/Debug/Renderer.vue +240 -0
- package/dist/runtime/components/Edit/Features/Debug/Renderer.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Debug/Viewport/index.vue +14 -0
- package/dist/runtime/components/Edit/Features/Debug/index.vue +7 -162
- package/dist/runtime/components/Edit/Features/Delete/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Diff/DiffView/index.vue +13 -190
- package/dist/runtime/components/Edit/Features/Diff/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/index.vue +18 -10
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/fragment.glsl +8 -2
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/index.vue +111 -121
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/index.vue.d.ts +3 -132
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/vertex.glsl +2 -1
- package/dist/runtime/components/Edit/Features/DraggingOverlay/index.vue +87 -61
- package/dist/runtime/components/Edit/Features/Duplicate/index.vue +6 -8
- package/dist/runtime/components/Edit/Features/Edit/index.vue +16 -22
- package/dist/runtime/components/Edit/Features/EditForm/Frame/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/EditForm/index.vue +10 -9
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/Frame/index.vue +69 -4
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/Frame/index.vue.d.ts +2 -2
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/Plaintext/index.vue +13 -9
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/index.vue +45 -87
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/index.vue.d.ts +2 -2
- package/dist/runtime/components/Edit/Features/EditableField/index.vue +45 -43
- package/dist/runtime/components/Edit/Features/EditableMask/index.vue +3 -20
- package/dist/runtime/components/Edit/Features/EntityTitle/index.vue +33 -1
- package/dist/runtime/components/Edit/Features/Fragments/Dialog/index.vue +11 -9
- package/dist/runtime/components/Edit/Features/Fragments/index.vue +8 -6
- package/dist/runtime/components/Edit/Features/History/index.vue +39 -13
- package/dist/runtime/components/Edit/Features/Hover/Overlay/fragment.glsl +139 -0
- package/dist/runtime/components/Edit/Features/Hover/Overlay/index.vue +261 -0
- package/dist/runtime/components/Edit/Features/Hover/Overlay/index.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Hover/Overlay/vertex.glsl +117 -0
- package/dist/runtime/components/Edit/Features/Hover/index.vue +25 -0
- package/dist/runtime/components/Edit/Features/Hover/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/ImportExisting/Dialog/index.vue +6 -2
- package/dist/runtime/components/Edit/Features/ImportExisting/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/Library/EditReusable/index.vue +5 -7
- package/dist/runtime/components/Edit/Features/Library/LibraryDialog/index.vue +19 -27
- package/dist/runtime/components/Edit/Features/Library/ReusableDialog/index.vue +32 -28
- package/dist/runtime/components/Edit/Features/Library/index.vue +40 -32
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue +11 -11
- package/dist/runtime/components/Edit/Features/MediaLibrary/index.vue +15 -12
- package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/fragment.glsl +1 -1
- package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/index.vue +44 -32
- package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/vertex.glsl +1 -1
- package/dist/runtime/components/Edit/Features/MultiSelect/index.vue +10 -18
- package/dist/runtime/components/Edit/Features/Options/Form/Checkbox/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/Options/Form/Checkbox/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Options/Form/Group.vue.d.ts +2 -11
- package/dist/runtime/components/Edit/Features/Options/Form/Item.vue +14 -3
- package/dist/runtime/components/Edit/Features/Options/Form/Item.vue.d.ts +0 -1
- package/dist/runtime/components/Edit/Features/Options/Form/Radios/index.vue +37 -19
- package/dist/runtime/components/Edit/Features/Options/Form/Radios/index.vue.d.ts +8 -2
- package/dist/runtime/components/Edit/Features/Options/Form/index.vue +88 -42
- package/dist/runtime/components/Edit/Features/Options/Form/index.vue.d.ts +5 -5
- package/dist/runtime/components/Edit/Features/Options/index.vue +35 -11
- package/dist/runtime/components/Edit/Features/Ownership/Renderer.vue +35 -0
- package/dist/runtime/components/Edit/Features/Ownership/Renderer.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Ownership/index.vue +7 -25
- package/dist/runtime/components/Edit/Features/PreviewGrant/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/ProxyView/index.vue +5 -1
- package/dist/runtime/components/Edit/Features/Publish/Dialog/Item.vue +41 -14
- package/dist/runtime/components/Edit/Features/Publish/Dialog/Item.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Publish/Dialog/PublishOption.vue +47 -0
- package/dist/runtime/components/Edit/Features/Publish/Dialog/PublishOption.vue.d.ts +19 -0
- package/dist/runtime/components/Edit/Features/Publish/Dialog/Summary.vue +83 -0
- package/dist/runtime/components/Edit/Features/Publish/Dialog/Summary.vue.d.ts +9 -0
- package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue +439 -123
- package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue.d.ts +3 -14
- package/dist/runtime/components/Edit/Features/Publish/index.vue +57 -24
- package/dist/runtime/components/Edit/Features/ResponsivePreview/Frame/index.vue.d.ts +2 -13
- package/dist/runtime/components/Edit/Features/Revert/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Page/index.vue +15 -15
- package/dist/runtime/components/Edit/Features/Search/index.vue +7 -3
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue +85 -0
- package/dist/runtime/components/Edit/Features/{CommandPalette/Palette/Group → Selection/AddButtons/Overlay}/index.vue.d.ts +8 -13
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/fragment.glsl +106 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/index.vue +440 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/index.vue.d.ts +32 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/vertex.glsl +102 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue +387 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Selection/Overlay/fragment.glsl +15 -10
- package/dist/runtime/components/Edit/Features/Selection/Overlay/index.vue +105 -25
- package/dist/runtime/components/Edit/Features/Selection/Overlay/index.vue.d.ts +5 -3
- package/dist/runtime/components/Edit/Features/Selection/Overlay/vertex.glsl +12 -3
- package/dist/runtime/components/Edit/Features/Selection/OverlayFallback/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Selection/index.vue +135 -25
- package/dist/runtime/components/Edit/Features/Settings/Dialog/FeatureSetting/index.vue +12 -17
- package/dist/runtime/components/Edit/Features/Settings/index.vue +11 -25
- package/dist/runtime/components/Edit/Features/Structure/List/Field/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Structure/List/Item/index.vue +13 -6
- package/dist/runtime/components/Edit/Features/Theme/Color/index.vue +5 -1
- package/dist/runtime/components/Edit/Features/Theme/index.vue +2 -1
- package/dist/runtime/components/Edit/Features/TouchActionBar/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/Tour/Overlay/index.vue +3 -0
- package/dist/runtime/components/Edit/Features/Transform/Dialog/index.vue +198 -0
- package/dist/runtime/components/Edit/Features/Transform/Dialog/index.vue.d.ts +13 -0
- package/dist/runtime/components/Edit/Features/Transform/index.vue +156 -70
- package/dist/runtime/components/Edit/Features/Translations/Banner/index.vue +17 -11
- package/dist/runtime/components/Edit/Features/Translations/index.vue +20 -23
- package/dist/runtime/components/Edit/Features/Validations/SidebarItem/index.vue +5 -5
- package/dist/runtime/components/Edit/Features/index.vue +17 -7
- package/dist/runtime/components/Edit/Form/Datepicker/index.vue +198 -0
- package/dist/runtime/components/Edit/Form/Datepicker/index.vue.d.ts +15 -0
- package/dist/runtime/components/Edit/Form/Group/index.vue.d.ts +2 -4
- package/dist/runtime/components/Edit/Form/Item/index.vue.d.ts +2 -4
- package/dist/runtime/components/Edit/Form/Radio/index.vue +33 -0
- package/dist/runtime/components/Edit/Form/Radio/index.vue.d.ts +20 -0
- package/dist/runtime/components/Edit/Form/RadioTabs/index.vue +37 -0
- package/dist/runtime/components/Edit/Form/RadioTabs/index.vue.d.ts +22 -0
- package/dist/runtime/components/Edit/Form/Select/index.vue +29 -0
- package/dist/runtime/components/Edit/Form/Select/index.vue.d.ts +20 -0
- package/dist/runtime/components/Edit/Form/Text/index.vue +34 -0
- package/dist/runtime/components/Edit/Form/Text/index.vue.d.ts +20 -0
- package/dist/runtime/components/Edit/Form/Textarea/index.vue +13 -6
- package/dist/runtime/components/Edit/Form/Textarea/index.vue.d.ts +4 -0
- package/dist/runtime/components/Edit/Form/Toggle/index.vue +4 -3
- package/dist/runtime/components/Edit/Form/Toggle/index.vue.d.ts +12 -2
- package/dist/runtime/components/Edit/FormOverlay/index.vue +1 -1
- package/dist/runtime/components/Edit/FormOverlay/index.vue.d.ts +3 -2
- package/dist/runtime/components/Edit/Indicators/index.vue +123 -0
- package/dist/runtime/components/Edit/Indicators/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/InfoBox/index.vue +6 -2
- package/dist/runtime/components/Edit/InfoBox/index.vue.d.ts +12 -2
- package/dist/runtime/components/Edit/ItemIcon/index.vue +2 -1
- package/dist/runtime/components/Edit/Konami/Game/PixelGrid.vue +66 -0
- package/dist/runtime/components/Edit/Konami/Game/PixelGrid.vue.d.ts +7 -0
- package/dist/runtime/components/Edit/Konami/Game/blokkli.png +0 -0
- package/dist/runtime/components/Edit/Konami/Game/charmap.d.ts +2 -0
- package/dist/runtime/components/Edit/Konami/Game/charmap.js +168 -0
- package/dist/runtime/components/Edit/Konami/Game/index.vue +752 -0
- package/dist/runtime/components/Edit/Konami/Game/index.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Konami/Game/textRendering.d.ts +8 -0
- package/dist/runtime/components/Edit/Konami/Game/textRendering.js +138 -0
- package/dist/runtime/components/Edit/Konami/Game/useIconRendering.d.ts +9 -0
- package/dist/runtime/components/Edit/Konami/Game/useIconRendering.js +130 -0
- package/dist/runtime/components/Edit/Konami/index.vue +44 -0
- package/dist/runtime/components/Edit/Konami/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Loading/index.vue +6 -2
- package/dist/runtime/components/Edit/Loading/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Messages/index.vue +8 -3
- package/dist/runtime/components/Edit/PluginConfigForm/Checkbox/index.vue +17 -0
- package/dist/runtime/components/Edit/PluginConfigForm/Checkbox/index.vue.d.ts +11 -0
- package/dist/runtime/components/Edit/PluginConfigForm/Options/index.vue +37 -0
- package/dist/runtime/components/Edit/PluginConfigForm/Options/index.vue.d.ts +11 -0
- package/dist/runtime/components/Edit/PluginConfigForm/Text/index.vue +43 -0
- package/dist/runtime/components/Edit/PluginConfigForm/Text/index.vue.d.ts +11 -0
- package/dist/runtime/components/Edit/PluginConfigForm/index.vue +57 -0
- package/dist/runtime/components/Edit/PluginConfigForm/index.vue.d.ts +16 -0
- package/dist/runtime/components/Edit/PreviewProvider.vue +3 -4
- package/dist/runtime/components/Edit/RelativeTime/index.vue +3 -2
- package/dist/runtime/components/Edit/RelativeTime/index.vue.d.ts +2 -2
- package/dist/runtime/components/Edit/Resizable/index.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/ScaleToFit/index.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/ScheduleDate/index.vue +131 -0
- package/dist/runtime/components/Edit/ScheduleDate/index.vue.d.ts +23 -0
- package/dist/runtime/components/Edit/ScrollBoundary/index.vue.d.ts +2 -7
- package/dist/runtime/components/Edit/ShortcutIndicator/index.vue +11 -3
- package/dist/runtime/components/Edit/Sortli/index.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/SystemRequirements/index.vue +3 -3
- package/dist/runtime/components/Edit/Toolbar/index.vue +3 -2
- package/dist/runtime/components/Edit/Transition/Height.vue +95 -0
- package/dist/runtime/components/Edit/Transition/Height.vue.d.ts +36 -0
- package/dist/runtime/components/Edit/Transition/index.vue +41 -0
- package/dist/runtime/components/Edit/Transition/index.vue.d.ts +19 -0
- package/dist/runtime/components/Edit/ViewportBlockingRect/index.vue.d.ts +2 -7
- package/dist/runtime/components/Edit/index.d.ts +28 -15
- package/dist/runtime/components/Edit/index.js +54 -28
- package/dist/runtime/composables/defineBlokkli.js +16 -3
- package/dist/runtime/composables/defineBlokkliFeature.d.ts +4 -7
- package/dist/runtime/composables/defineBlokkliFragment.js +8 -1
- package/dist/runtime/composables/defineBlokkliProvider.d.ts +11 -0
- package/dist/runtime/composables/defineBlokkliProvider.js +46 -0
- package/dist/runtime/composables/useBlokkliHelper.d.ts +19 -0
- package/dist/runtime/composables/useBlokkliHelper.js +95 -0
- package/dist/runtime/constants/index.d.ts +3 -0
- package/dist/runtime/constants/index.js +3 -0
- package/dist/runtime/css/output.css +1 -1
- package/dist/runtime/helpers/addElementClasses.d.ts +2 -0
- package/dist/runtime/helpers/addElementClasses.js +24 -0
- package/dist/runtime/helpers/animationProvider.d.ts +38 -2
- package/dist/runtime/helpers/animationProvider.js +188 -47
- package/dist/runtime/helpers/bundles/index.d.ts +1 -0
- package/dist/runtime/helpers/bundles/index.js +4 -0
- package/dist/runtime/helpers/composables/defineRenderer.d.ts +8 -0
- package/dist/runtime/helpers/composables/defineRenderer.js +8 -0
- package/dist/runtime/helpers/composables/useBlockRegistration.d.ts +5 -0
- package/dist/runtime/helpers/composables/useBlockRegistration.js +23 -0
- package/dist/runtime/helpers/composables/useDelayedIntersectionObserver.d.ts +1 -1
- package/dist/runtime/helpers/composables/useDelayedIntersectionObserver.js +3 -2
- package/dist/runtime/helpers/composables/useStateBasedCache.d.ts +4 -0
- package/dist/runtime/helpers/composables/useStateBasedCache.js +13 -0
- package/dist/runtime/helpers/composables/useStickyToolbar.d.ts +23 -0
- package/dist/runtime/helpers/composables/useStickyToolbar.js +233 -0
- package/dist/runtime/helpers/definitionProvider.d.ts +3 -2
- package/dist/runtime/helpers/definitionProvider.js +17 -0
- package/dist/runtime/helpers/dom/index.d.ts +60 -0
- package/dist/runtime/helpers/dom/index.js +48 -0
- package/dist/runtime/helpers/domProvider.d.ts +58 -17
- package/dist/runtime/helpers/domProvider.js +320 -245
- package/dist/runtime/helpers/dropTargets/index.d.ts +6 -0
- package/dist/runtime/helpers/dropTargets/index.js +49 -0
- package/dist/runtime/helpers/eventBus.d.ts +1 -1
- package/dist/runtime/helpers/eventBus.js +2 -2
- package/dist/runtime/helpers/index.d.ts +10 -14
- package/dist/runtime/helpers/index.js +58 -121
- package/dist/runtime/helpers/indicatorsProvider.d.ts +10 -0
- package/dist/runtime/helpers/indicatorsProvider.js +23 -0
- package/dist/runtime/helpers/keyboardProvider.d.ts +2 -0
- package/dist/runtime/helpers/keyboardProvider.js +17 -1
- package/dist/runtime/helpers/pluginProvider.d.ts +10 -0
- package/dist/runtime/helpers/pluginProvider.js +33 -0
- package/dist/runtime/helpers/providers/blocks.d.ts +10 -0
- package/dist/runtime/helpers/providers/blocks.js +91 -0
- package/dist/runtime/helpers/providers/directive.d.ts +25 -0
- package/dist/runtime/helpers/providers/directive.js +208 -0
- package/dist/runtime/helpers/providers/element.d.ts +6 -0
- package/dist/runtime/helpers/providers/element.js +35 -0
- package/dist/runtime/helpers/providers/fields.d.ts +8 -0
- package/dist/runtime/helpers/providers/fields.js +47 -0
- package/dist/runtime/helpers/renderCycle.d.ts +1 -0
- package/dist/runtime/helpers/renderCycle.js +10 -0
- package/dist/runtime/helpers/runtimeHelpers/index.js +15 -12
- package/dist/runtime/helpers/selectionProvider.d.ts +27 -11
- package/dist/runtime/helpers/selectionProvider.js +79 -74
- package/dist/runtime/helpers/stateProvider.d.ts +12 -2
- package/dist/runtime/helpers/stateProvider.js +164 -20
- package/dist/runtime/helpers/storageProvider.d.ts +5 -3
- package/dist/runtime/helpers/storageProvider.js +61 -4
- package/dist/runtime/helpers/symbols.d.ts +2 -0
- package/dist/runtime/helpers/symbols.js +2 -0
- package/dist/runtime/helpers/textProvider.js +6 -0
- package/dist/runtime/helpers/themeProvider.d.ts +4 -1
- package/dist/runtime/helpers/themeProvider.js +28 -15
- package/dist/runtime/helpers/transform.js +1 -3
- package/dist/runtime/helpers/typesProvider.js +10 -26
- package/dist/runtime/helpers/uiProvider.d.ts +18 -3
- package/dist/runtime/helpers/uiProvider.js +114 -61
- package/dist/runtime/helpers/useTransitionedValue.d.ts +18 -0
- package/dist/runtime/helpers/useTransitionedValue.js +57 -0
- package/dist/runtime/helpers/webgl/index.d.ts +11 -2
- package/dist/runtime/helpers/webgl/index.js +162 -7
- package/dist/runtime/icons/anchor.svg +1 -0
- package/dist/runtime/icons/arrow-left.svg +1 -1
- package/dist/runtime/icons/arrow-right.svg +1 -1
- package/dist/runtime/icons/arrow-top-right.svg +1 -0
- package/dist/runtime/icons/calendar-clock.svg +1 -0
- package/dist/runtime/icons/calendar.svg +1 -0
- package/dist/runtime/icons/chart.svg +1 -0
- package/dist/runtime/icons/clock.svg +1 -0
- package/dist/runtime/icons/comment_add.svg +1 -5
- package/dist/runtime/icons/copy.svg +1 -0
- package/dist/runtime/icons/cursor-move.svg +1 -1
- package/dist/runtime/icons/delete.svg +1 -8
- package/dist/runtime/icons/diff.svg +1 -1
- package/dist/runtime/icons/duplicate.svg +1 -12
- package/dist/runtime/icons/edit.svg +1 -8
- package/dist/runtime/icons/eye-off.svg +1 -0
- package/dist/runtime/icons/eye.svg +1 -1
- package/dist/runtime/icons/info.svg +1 -1
- package/dist/runtime/icons/link.svg +1 -0
- package/dist/runtime/icons/reusable.svg +1 -5
- package/dist/runtime/icons/speedometer.svg +1 -0
- package/dist/runtime/plugins/blokkliDirectives.js +109 -0
- package/dist/runtime/types/blokkOptions.d.ts +8 -0
- package/dist/runtime/types/index.d.ts +278 -42
- package/dist/runtime/types/theme.d.ts +2 -1
- package/dist/shared/{editor.gz_ac6uT.d.mts → editor.CKsrTpc1.d.mts} +1 -1
- package/package.json +55 -38
- package/dist/modules/drupal/adapter/index.d.mts +0 -6
- package/dist/runtime/components/Edit/DragInteractions/index.vue +0 -364
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Group/index.vue +0 -51
- package/dist/runtime/components/Edit/Features/FieldAreas/Overlay/index.vue +0 -22
- package/dist/runtime/components/Edit/Features/FieldAreas/index.vue +0 -41
- package/dist/runtime/plugins/blokkliEditable.js +0 -31
- /package/dist/runtime/components/Edit/{DragInteractions → Features/Analyze}/index.vue.d.ts +0 -0
- /package/dist/runtime/components/Edit/Features/{FieldAreas/Overlay/index.vue.d.ts → Anchors/Renderer.vue.d.ts} +0 -0
- /package/dist/runtime/components/Edit/Features/{FieldAreas → Anchors}/index.vue.d.ts +0 -0
- /package/dist/runtime/plugins/{blokkliEditable.d.ts → blokkliDirectives.d.ts} +0 -0
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Teleport to="body">
|
|
3
|
-
<div
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
</button>
|
|
14
|
-
</div>
|
|
3
|
+
<div class="bk">
|
|
4
|
+
<button
|
|
5
|
+
ref="button"
|
|
6
|
+
class="bk-edit-indicator bk-button bk-is-primary"
|
|
7
|
+
@mouseenter="isHovering = true"
|
|
8
|
+
@mouseleave="isHovering = false"
|
|
9
|
+
@click="$emit('edit')"
|
|
10
|
+
>
|
|
11
|
+
{{ label }}
|
|
12
|
+
</button>
|
|
15
13
|
|
|
16
14
|
<div
|
|
17
|
-
v-
|
|
18
|
-
|
|
15
|
+
v-show="isHovering"
|
|
16
|
+
ref="overlay"
|
|
19
17
|
class="bk-edit-indicator-overlay"
|
|
20
18
|
/>
|
|
21
19
|
</div>
|
|
@@ -24,47 +22,123 @@
|
|
|
24
22
|
|
|
25
23
|
<script setup>
|
|
26
24
|
import textProvider from "#blokkli/helpers/textProvider";
|
|
27
|
-
import { ref, computed } from "#imports";
|
|
25
|
+
import { ref, onMounted, onBeforeUnmount, useState, computed } from "#imports";
|
|
28
26
|
import "#blokkli-build/styles.css";
|
|
29
27
|
import useAnimationFrame from "#blokkli/helpers/composables/useAnimationFrame";
|
|
30
28
|
const props = defineProps({
|
|
31
29
|
uuid: { type: String, required: true },
|
|
32
|
-
|
|
30
|
+
entityType: { type: String, required: true },
|
|
31
|
+
editLabel: { type: String, required: false },
|
|
32
|
+
permissions: { type: Array, required: true }
|
|
33
33
|
});
|
|
34
|
+
const key = computed(() => props.entityType + ":" + props.uuid);
|
|
34
35
|
const $t = textProvider();
|
|
35
|
-
const label = computed(
|
|
36
|
-
(
|
|
37
|
-
|
|
36
|
+
const label = computed(() => {
|
|
37
|
+
if (props.editLabel) {
|
|
38
|
+
return props.editLabel;
|
|
39
|
+
} else if (props.permissions.includes("edit")) {
|
|
40
|
+
return $t("editIndicatorLabel", "Edit blocks");
|
|
41
|
+
} else if (props.permissions.includes("review")) {
|
|
42
|
+
return $t("editIndicatorLabelReview", "Review changes");
|
|
43
|
+
} else if (props.permissions.includes("view")) {
|
|
44
|
+
return $t("editIndicatorLabelView", "View changes");
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
});
|
|
38
48
|
defineEmits(["edit"]);
|
|
39
49
|
const isHovering = ref(false);
|
|
40
|
-
const style = ref({});
|
|
41
50
|
const button = ref(null);
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return
|
|
51
|
+
const overlay = ref(null);
|
|
52
|
+
const targetElement = ref(null);
|
|
53
|
+
const indicatorRegistry = useState(
|
|
54
|
+
"blokkliEditIndicators",
|
|
55
|
+
() => []
|
|
56
|
+
);
|
|
57
|
+
const isManager = computed(() => {
|
|
58
|
+
return indicatorRegistry.value[0]?.key === key.value;
|
|
59
|
+
});
|
|
60
|
+
function calculateIdealYPosition(buttonHeight, bounds, gap) {
|
|
61
|
+
const elementHeight = bounds.bottom - bounds.top;
|
|
62
|
+
let position;
|
|
63
|
+
if (elementHeight < 100) {
|
|
64
|
+
position = bounds.top + elementHeight / 2 - buttonHeight / 2;
|
|
65
|
+
} else {
|
|
66
|
+
position = bounds.top + gap;
|
|
67
|
+
}
|
|
68
|
+
position = Math.max(position, gap);
|
|
69
|
+
return Math.min(position, bounds.bottom - buttonHeight - gap);
|
|
50
70
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
71
|
+
const GAP = 15;
|
|
72
|
+
const indicators = computed(() => {
|
|
73
|
+
const indicators2 = [...indicatorRegistry.value];
|
|
74
|
+
return indicators2.sort((a, b) => {
|
|
75
|
+
const position = a.targetElement.compareDocumentPosition(b.targetElement);
|
|
76
|
+
if (position & Node.DOCUMENT_POSITION_FOLLOWING) {
|
|
77
|
+
return -1;
|
|
78
|
+
}
|
|
79
|
+
if (position & Node.DOCUMENT_POSITION_PRECEDING) {
|
|
80
|
+
return 1;
|
|
81
|
+
}
|
|
82
|
+
return 0;
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
function updateAllIndicatorPositions() {
|
|
86
|
+
const positions = [];
|
|
87
|
+
const heights = [];
|
|
88
|
+
for (let i = 0; i < indicators.value.length; i++) {
|
|
89
|
+
const data = indicators.value[i];
|
|
90
|
+
const rect = data.targetElement.getBoundingClientRect();
|
|
91
|
+
const buttonHeight = data.buttonElement.offsetHeight;
|
|
92
|
+
let idealY = calculateIdealYPosition(buttonHeight, rect, GAP);
|
|
93
|
+
for (let j = 0; j < i; j++) {
|
|
94
|
+
const prevRect = indicators.value[j].targetElement.getBoundingClientRect();
|
|
95
|
+
const prevElementTop = prevRect.top;
|
|
96
|
+
const prevElementHeight = prevRect.height;
|
|
97
|
+
const collisionPosition = prevElementTop + prevElementHeight + GAP;
|
|
98
|
+
if (idealY < collisionPosition) {
|
|
99
|
+
idealY = collisionPosition;
|
|
100
|
+
}
|
|
67
101
|
}
|
|
102
|
+
const elementBottom = rect.bottom - buttonHeight - GAP;
|
|
103
|
+
if (elementBottom < idealY) {
|
|
104
|
+
idealY = elementBottom;
|
|
105
|
+
}
|
|
106
|
+
idealY = Math.round(idealY);
|
|
107
|
+
positions.push(idealY);
|
|
108
|
+
heights.push(buttonHeight);
|
|
109
|
+
data.buttonElement.style.transform = `translateY(${idealY}px)`;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
onMounted(() => {
|
|
113
|
+
const el = document.querySelector(`[data-provider-uuid="${props.uuid}"]`);
|
|
114
|
+
if (el && el instanceof HTMLElement) {
|
|
115
|
+
targetElement.value = el;
|
|
116
|
+
}
|
|
117
|
+
if (button.value && targetElement.value) {
|
|
118
|
+
indicatorRegistry.value.push({
|
|
119
|
+
key: key.value,
|
|
120
|
+
targetElement: targetElement.value,
|
|
121
|
+
buttonElement: button.value
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
onBeforeUnmount(() => {
|
|
126
|
+
indicatorRegistry.value = indicatorRegistry.value.filter(
|
|
127
|
+
(i) => i.key !== key.value
|
|
128
|
+
);
|
|
129
|
+
});
|
|
130
|
+
useAnimationFrame(() => {
|
|
131
|
+
if (!button.value || !targetElement.value) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (isManager.value) {
|
|
135
|
+
updateAllIndicatorPositions();
|
|
136
|
+
}
|
|
137
|
+
if (isHovering.value && overlay.value) {
|
|
138
|
+
const rect = targetElement.value.getBoundingClientRect();
|
|
139
|
+
overlay.value.style.width = rect.width + "px";
|
|
140
|
+
overlay.value.style.height = rect.height + "px";
|
|
141
|
+
overlay.value.style.transform = `translate(${rect.x}px, ${rect.y}px)`;
|
|
68
142
|
}
|
|
69
143
|
});
|
|
70
144
|
</script>
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import '#blokkli-build/styles.css';
|
|
2
|
+
import type { EditPermission } from '#blokkli/types';
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
uuid: string;
|
|
5
|
+
entityType: string;
|
|
4
6
|
editLabel?: string;
|
|
7
|
+
permissions: EditPermission[];
|
|
5
8
|
};
|
|
6
9
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
10
|
edit: (...args: any[]) => void;
|
|
@@ -1,41 +1,43 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Teleport to="body">
|
|
3
|
-
<Transition name="bk-loading">
|
|
4
|
-
<Loading
|
|
5
|
-
v-if="isInitializing || !toolbarLoaded || !featuresLoaded"
|
|
6
|
-
screen
|
|
7
|
-
/>
|
|
3
|
+
<Transition :name="ui.useAnimations.value ? 'bk-loading' : void 0">
|
|
4
|
+
<Loading v-if="showLoading" screen />
|
|
8
5
|
</Transition>
|
|
9
6
|
|
|
10
7
|
<div id="bk-banner-container">
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
<div id="bk-banner-list" class="bk">
|
|
9
|
+
<Banner
|
|
10
|
+
v-if="!state.stateAvailable.value"
|
|
11
|
+
id="state-unavailable"
|
|
12
|
+
icon="sad"
|
|
13
|
+
scheme="red"
|
|
14
|
+
:text="stateNotAvailableText"
|
|
15
|
+
/>
|
|
16
|
+
<Banner
|
|
17
|
+
v-if="viewOnlyBanner"
|
|
18
|
+
id="view-only"
|
|
19
|
+
:icon="viewOnlyBanner.icon"
|
|
20
|
+
scheme="yellow"
|
|
21
|
+
:text="viewOnlyBanner.text"
|
|
22
|
+
/>
|
|
26
23
|
</div>
|
|
24
|
+
<Messages />
|
|
27
25
|
</div>
|
|
28
26
|
</Teleport>
|
|
27
|
+
<Teleport to="#nuxt-root">
|
|
28
|
+
<div id="bk-canvas-overlay" class="bk bk-canvas-overlay" />
|
|
29
|
+
</Teleport>
|
|
29
30
|
<Actions v-if="!isInitializing" />
|
|
30
31
|
<Toolbar @loaded="toolbarLoaded = true" />
|
|
31
32
|
<AppMenu v-if="toolbarLoaded" />
|
|
33
|
+
<Indicators />
|
|
32
34
|
<Features
|
|
33
|
-
v-if="
|
|
35
|
+
v-if="isReady"
|
|
34
36
|
:key="route.fullPath"
|
|
35
37
|
@loaded="featuresLoaded = true"
|
|
36
38
|
/>
|
|
37
|
-
<DragInteractions v-if="!isInitializing" />
|
|
38
39
|
<AnimationCanvas v-if="!isInitializing" />
|
|
40
|
+
<Konami />
|
|
39
41
|
<SystemRequirements />
|
|
40
42
|
<slot
|
|
41
43
|
v-if="!isInitializing"
|
|
@@ -46,7 +48,6 @@
|
|
|
46
48
|
|
|
47
49
|
<script setup>
|
|
48
50
|
import {
|
|
49
|
-
watch,
|
|
50
51
|
ref,
|
|
51
52
|
computed,
|
|
52
53
|
provide,
|
|
@@ -54,23 +55,28 @@ import {
|
|
|
54
55
|
onBeforeUnmount,
|
|
55
56
|
useRoute,
|
|
56
57
|
useRuntimeConfig,
|
|
57
|
-
nextTick
|
|
58
|
+
nextTick,
|
|
59
|
+
inject,
|
|
60
|
+
onUnmounted
|
|
58
61
|
} from "#imports";
|
|
59
62
|
import Toolbar from "./Toolbar/index.vue";
|
|
60
63
|
import Actions from "./Actions/index.vue";
|
|
61
64
|
import Loading from "./Loading/index.vue";
|
|
62
65
|
import Messages from "./Messages/index.vue";
|
|
63
66
|
import Features from "./Features/index.vue";
|
|
67
|
+
import Indicators from "./Indicators/index.vue";
|
|
64
68
|
import AppMenu from "./AppMenu/index.vue";
|
|
65
69
|
import DraggableList from "./DraggableList.vue";
|
|
66
|
-
import DragInteractions from "./DragInteractions/index.vue";
|
|
67
70
|
import AnimationCanvas from "./AnimationCanvas/index.vue";
|
|
68
71
|
import SystemRequirements from "./SystemRequirements/index.vue";
|
|
72
|
+
import Konami from "./Konami/index.vue";
|
|
73
|
+
import Banner from "./Banner/index.vue";
|
|
69
74
|
import animationProvider from "./../../helpers/animationProvider";
|
|
70
75
|
import keyboardProvider from "./../../helpers/keyboardProvider";
|
|
71
76
|
import selectionProvider from "./../../helpers/selectionProvider";
|
|
72
77
|
import editStateProvider from "./../../helpers/stateProvider";
|
|
73
78
|
import typesProvider from "./../../helpers/typesProvider";
|
|
79
|
+
import elementProvider from "./../../helpers/providers/element";
|
|
74
80
|
import domProvider from "./../../helpers/domProvider";
|
|
75
81
|
import textProvider from "./../../helpers/textProvider";
|
|
76
82
|
import storageProvider from "./../../helpers/storageProvider";
|
|
@@ -83,6 +89,11 @@ import tourProvider from "./../../helpers/tourProvider";
|
|
|
83
89
|
import debugProvider from "./../../helpers/debugProvider";
|
|
84
90
|
import definitionProvider from "./../../helpers/definitionProvider";
|
|
85
91
|
import dropAreasProvider from "./../../helpers/dropAreaProvider";
|
|
92
|
+
import blocksProvider from "./../../helpers/providers/blocks";
|
|
93
|
+
import indicatorsProvider from "./../../helpers/indicatorsProvider";
|
|
94
|
+
import pluginProvider from "./../../helpers/pluginProvider";
|
|
95
|
+
import directiveProvider from "./../../helpers/providers/directive";
|
|
96
|
+
import fieldsProvider from "./../../helpers/providers/fields";
|
|
86
97
|
import { eventBus } from "#blokkli/helpers/eventBus";
|
|
87
98
|
import "#blokkli-build/styles.css";
|
|
88
99
|
import getAdapter from "#blokkli-build/edit-adapter";
|
|
@@ -91,18 +102,31 @@ import {
|
|
|
91
102
|
INJECT_EDIT_CONTEXT,
|
|
92
103
|
INJECT_EDIT_FIELD_LIST_COMPONENT,
|
|
93
104
|
INJECT_EDIT_LOGGER,
|
|
105
|
+
INJECT_ENTITY_CONTEXT,
|
|
94
106
|
INJECT_GLOBAL_PROXY_MODE,
|
|
95
|
-
INJECT_IS_EDITING
|
|
107
|
+
INJECT_IS_EDITING,
|
|
108
|
+
INJECT_PROVIDER_KEY
|
|
96
109
|
} from "#blokkli/helpers/symbols";
|
|
110
|
+
import { useBlockRegistration } from "#blokkli/helpers/composables/useBlockRegistration";
|
|
111
|
+
import { addElementClasses } from "#blokkli/helpers/addElementClasses";
|
|
97
112
|
const props = defineProps({
|
|
98
113
|
entity: { type: null, required: false, default: void 0 },
|
|
99
114
|
entityType: { type: String, required: true },
|
|
100
115
|
entityUuid: { type: String, required: true },
|
|
101
116
|
entityBundle: { type: String, required: true },
|
|
102
117
|
language: { type: String, required: false, default: "en" },
|
|
103
|
-
isolate: { type: Boolean, required: false }
|
|
118
|
+
isolate: { type: Boolean, required: false },
|
|
119
|
+
permissions: { type: Array, required: true },
|
|
120
|
+
providerEl: { type: null, required: true }
|
|
104
121
|
});
|
|
105
122
|
defineSlots();
|
|
123
|
+
const entityContext = computed(() => {
|
|
124
|
+
return {
|
|
125
|
+
uuid: props.entityUuid,
|
|
126
|
+
type: props.entityType,
|
|
127
|
+
bundle: props.entityBundle
|
|
128
|
+
};
|
|
129
|
+
});
|
|
106
130
|
const context = computed(() => {
|
|
107
131
|
return {
|
|
108
132
|
entityType: props.entityType,
|
|
@@ -112,6 +136,7 @@ const context = computed(() => {
|
|
|
112
136
|
};
|
|
113
137
|
});
|
|
114
138
|
const adapter = await getAdapter(context);
|
|
139
|
+
const providerKey = inject(INJECT_PROVIDER_KEY, "");
|
|
115
140
|
const route = useRoute();
|
|
116
141
|
const runtimeConfig = useRuntimeConfig().public.blokkli;
|
|
117
142
|
const toolbarLoaded = ref(false);
|
|
@@ -119,22 +144,45 @@ const featuresLoaded = ref(false);
|
|
|
119
144
|
const isInitializing = ref(true);
|
|
120
145
|
const definitions = definitionProvider();
|
|
121
146
|
const $t = textProvider(context);
|
|
122
|
-
const state = await editStateProvider(
|
|
123
|
-
|
|
147
|
+
const state = await editStateProvider(
|
|
148
|
+
adapter,
|
|
149
|
+
context,
|
|
150
|
+
$t,
|
|
151
|
+
providerKey,
|
|
152
|
+
props.permissions
|
|
153
|
+
);
|
|
154
|
+
const storage = await storageProvider(adapter, context);
|
|
124
155
|
const debug = debugProvider(storage);
|
|
156
|
+
const element = elementProvider(debug);
|
|
125
157
|
const features = featuresProvider(storage);
|
|
126
|
-
const theme = themeProvider();
|
|
127
158
|
const commands = commandsProvider();
|
|
128
159
|
const tour = tourProvider();
|
|
129
160
|
const dropAreas = dropAreasProvider();
|
|
130
161
|
const broadcast = broadcastProvider();
|
|
131
|
-
const ui = uiProvider(storage, state);
|
|
132
|
-
const dom = domProvider(ui, debug, definitions);
|
|
133
|
-
const
|
|
162
|
+
const ui = uiProvider(props.providerEl, storage, state, context, element);
|
|
163
|
+
const dom = domProvider(ui, debug, definitions, state, element);
|
|
164
|
+
const theme = themeProvider(element);
|
|
165
|
+
const blocks = blocksProvider(state, dom, context);
|
|
166
|
+
const selection = selectionProvider(blocks);
|
|
167
|
+
const animation = animationProvider(ui, storage, selection, element);
|
|
134
168
|
const keyboard = keyboardProvider(animation);
|
|
135
|
-
const selection = selectionProvider(dom);
|
|
136
169
|
const types = await typesProvider(adapter, selection, context);
|
|
137
|
-
const
|
|
170
|
+
const indicators = indicatorsProvider();
|
|
171
|
+
const plugins = pluginProvider();
|
|
172
|
+
const directive = directiveProvider(debug, ui);
|
|
173
|
+
const fields = fieldsProvider(state, dom, types);
|
|
174
|
+
const mutatedEntity = computed(() => {
|
|
175
|
+
return {
|
|
176
|
+
...props.entity ?? {},
|
|
177
|
+
...state.mutatedEntity.value ?? {}
|
|
178
|
+
};
|
|
179
|
+
});
|
|
180
|
+
const isReady = computed(
|
|
181
|
+
() => !isInitializing.value && dom.isReady.value && directive.isReady.value && toolbarLoaded.value
|
|
182
|
+
);
|
|
183
|
+
const showLoading = computed(() => {
|
|
184
|
+
return !isReady.value || !featuresLoaded.value;
|
|
185
|
+
});
|
|
138
186
|
const onContextMenu = (e) => {
|
|
139
187
|
e.preventDefault();
|
|
140
188
|
e.stopPropagation();
|
|
@@ -147,36 +195,21 @@ function onTouchStart(e) {
|
|
|
147
195
|
e.preventDefault();
|
|
148
196
|
}
|
|
149
197
|
}
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
198
|
+
const shouldIsolate = computed(() => props.isolate);
|
|
199
|
+
addElementClasses(
|
|
200
|
+
document.documentElement,
|
|
201
|
+
"bk-use-animations",
|
|
202
|
+
ui.useAnimations
|
|
203
|
+
);
|
|
204
|
+
addElementClasses(
|
|
205
|
+
document.documentElement,
|
|
206
|
+
"bk-isolate-provider",
|
|
207
|
+
shouldIsolate
|
|
208
|
+
);
|
|
157
209
|
const baseLogger = debug.createLogger("EditProvider");
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
document.documentElement.classList.add("bk-isolate-provider");
|
|
162
|
-
}
|
|
163
|
-
document.documentElement.addEventListener("touchmove", onTouchMove);
|
|
164
|
-
document.documentElement.addEventListener("touchstart", onTouchStart);
|
|
165
|
-
setRootClasses();
|
|
166
|
-
baseLogger.log("EditProvider mounted");
|
|
167
|
-
dom.init();
|
|
168
|
-
isInitializing.value = false;
|
|
169
|
-
broadcast.emit("editorLoaded", { uuid: props.entityUuid });
|
|
170
|
-
});
|
|
171
|
-
onBeforeUnmount(() => {
|
|
172
|
-
window.removeEventListener("contextmenu", onContextMenu);
|
|
173
|
-
isInitializing.value = true;
|
|
174
|
-
toolbarLoaded.value = false;
|
|
175
|
-
document.documentElement.classList.remove("bk-isolate-provider");
|
|
176
|
-
document.documentElement.removeEventListener("touchmove", onTouchMove);
|
|
177
|
-
document.documentElement.removeEventListener("touchstart", onTouchStart);
|
|
178
|
-
setRootClasses(true);
|
|
179
|
-
});
|
|
210
|
+
function setElementSymbolProperty(el, symbol, value) {
|
|
211
|
+
el[symbol] = value;
|
|
212
|
+
}
|
|
180
213
|
provide(INJECT_EDIT_LOGGER, baseLogger);
|
|
181
214
|
provide(INJECT_EDIT_FIELD_LIST_COMPONENT, DraggableList);
|
|
182
215
|
provide(INJECT_IS_EDITING, true);
|
|
@@ -184,31 +217,82 @@ provide(INJECT_EDIT_CONTEXT, {
|
|
|
184
217
|
eventBus,
|
|
185
218
|
mutatedOptions: state.mutatedOptions,
|
|
186
219
|
dom,
|
|
187
|
-
definitions
|
|
220
|
+
definitions,
|
|
221
|
+
useBlockRegistration
|
|
188
222
|
});
|
|
189
|
-
|
|
223
|
+
const app = {
|
|
224
|
+
$t,
|
|
190
225
|
adapter,
|
|
226
|
+
animation,
|
|
227
|
+
broadcast,
|
|
228
|
+
commands,
|
|
229
|
+
context,
|
|
230
|
+
debug,
|
|
231
|
+
definitions,
|
|
232
|
+
dom,
|
|
233
|
+
dropAreas,
|
|
234
|
+
element,
|
|
191
235
|
eventBus,
|
|
236
|
+
directive,
|
|
237
|
+
features,
|
|
238
|
+
indicators,
|
|
239
|
+
keyboard,
|
|
240
|
+
plugins,
|
|
192
241
|
runtimeConfig,
|
|
242
|
+
selection,
|
|
243
|
+
blocks,
|
|
193
244
|
state,
|
|
194
|
-
dom,
|
|
195
245
|
storage,
|
|
196
|
-
types,
|
|
197
|
-
selection,
|
|
198
|
-
keyboard,
|
|
199
|
-
ui,
|
|
200
|
-
animation,
|
|
201
|
-
context,
|
|
202
|
-
$t,
|
|
203
|
-
broadcast,
|
|
204
|
-
features,
|
|
205
246
|
theme,
|
|
206
|
-
commands,
|
|
207
247
|
tour,
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
248
|
+
types,
|
|
249
|
+
ui,
|
|
250
|
+
fields
|
|
251
|
+
};
|
|
252
|
+
provide(INJECT_APP, app);
|
|
253
|
+
function textWithHighlight(title, text) {
|
|
254
|
+
return `<strong>${title}</strong> ${text}`;
|
|
255
|
+
}
|
|
256
|
+
const stateNotAvailableText = computed(() => {
|
|
257
|
+
return textWithHighlight(
|
|
258
|
+
$t("stateUnavailableTitle", "The edit state could not be loaded."),
|
|
259
|
+
$t(
|
|
260
|
+
"stateUnavailableText",
|
|
261
|
+
"This could be due to missing permissions or a temporary problem. Please try again later."
|
|
262
|
+
)
|
|
263
|
+
);
|
|
211
264
|
});
|
|
265
|
+
const viewOnlyBanner = computed(
|
|
266
|
+
() => {
|
|
267
|
+
if (props.permissions.includes("edit")) {
|
|
268
|
+
return null;
|
|
269
|
+
}
|
|
270
|
+
if (props.permissions.includes("review")) {
|
|
271
|
+
return {
|
|
272
|
+
text: textWithHighlight(
|
|
273
|
+
$t("viewBannerReviewTitle", "You are in review mode."),
|
|
274
|
+
$t(
|
|
275
|
+
"viewBannerReviewText",
|
|
276
|
+
"You can view and add comments but cannot edit content."
|
|
277
|
+
)
|
|
278
|
+
),
|
|
279
|
+
icon: "comment"
|
|
280
|
+
};
|
|
281
|
+
} else if (props.permissions.includes("view")) {
|
|
282
|
+
return {
|
|
283
|
+
text: textWithHighlight(
|
|
284
|
+
$t("viewBannerViewTitle", "You are in view-only mode."),
|
|
285
|
+
$t(
|
|
286
|
+
"viewBannerViewText",
|
|
287
|
+
"You can view comments but cannot edit content."
|
|
288
|
+
)
|
|
289
|
+
),
|
|
290
|
+
icon: "eye"
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
return null;
|
|
294
|
+
}
|
|
295
|
+
);
|
|
212
296
|
const isProxyMode = computed(() => ui.isProxyMode.value);
|
|
213
297
|
provide(INJECT_GLOBAL_PROXY_MODE, isProxyMode);
|
|
214
298
|
if (import.meta.hot) {
|
|
@@ -234,4 +318,32 @@ if (import.meta.hot) {
|
|
|
234
318
|
});
|
|
235
319
|
import.meta.hot.on("vite:afterUpdate", onAfterUpdate);
|
|
236
320
|
}
|
|
321
|
+
onMounted(async () => {
|
|
322
|
+
setElementSymbolProperty(props.providerEl, INJECT_APP, app);
|
|
323
|
+
setElementSymbolProperty(
|
|
324
|
+
props.providerEl,
|
|
325
|
+
INJECT_ENTITY_CONTEXT,
|
|
326
|
+
entityContext.value
|
|
327
|
+
);
|
|
328
|
+
window.addEventListener("contextmenu", onContextMenu);
|
|
329
|
+
document.documentElement.addEventListener("touchmove", onTouchMove);
|
|
330
|
+
document.documentElement.addEventListener("touchstart", onTouchStart);
|
|
331
|
+
baseLogger.log("EditProvider mounted");
|
|
332
|
+
dom.init();
|
|
333
|
+
directive.init();
|
|
334
|
+
await nextTick();
|
|
335
|
+
isInitializing.value = false;
|
|
336
|
+
broadcast.emit("editorLoaded", { uuid: props.entityUuid });
|
|
337
|
+
});
|
|
338
|
+
onBeforeUnmount(() => {
|
|
339
|
+
window.removeEventListener("contextmenu", onContextMenu);
|
|
340
|
+
isInitializing.value = true;
|
|
341
|
+
toolbarLoaded.value = false;
|
|
342
|
+
document.documentElement.removeEventListener("touchmove", onTouchMove);
|
|
343
|
+
document.documentElement.removeEventListener("touchstart", onTouchStart);
|
|
344
|
+
});
|
|
345
|
+
onUnmounted(() => {
|
|
346
|
+
setElementSymbolProperty(props.providerEl, INJECT_APP);
|
|
347
|
+
setElementSymbolProperty(props.providerEl, INJECT_ENTITY_CONTEXT);
|
|
348
|
+
});
|
|
237
349
|
</script>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EditPermission } from '#blokkli/types';
|
|
1
2
|
import '#blokkli-build/styles.css';
|
|
2
3
|
declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
4
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & {
|
|
@@ -7,6 +8,8 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
|
|
|
7
8
|
entityBundle: string;
|
|
8
9
|
language?: string;
|
|
9
10
|
isolate?: boolean;
|
|
11
|
+
permissions: EditPermission[];
|
|
12
|
+
providerEl: HTMLElement;
|
|
10
13
|
} & Partial<{}>> & import("vue").PublicProps;
|
|
11
14
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
12
15
|
attrs: any;
|