@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
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BlokkliFieldElement } from '#blokkli/types';
|
|
2
|
+
export type Orientation = 'horizontal' | 'vertical';
|
|
3
|
+
export declare const MIN_GAP = 20;
|
|
4
|
+
export declare function getGapSize(orientation: Orientation, element: HTMLElement): number;
|
|
5
|
+
export declare function getChildrenOrientation(element: HTMLElement): Orientation;
|
|
6
|
+
export declare function determineCanAddChildren(field: BlokkliFieldElement, children: HTMLElement[], uuids: string[], currentCount: number, itemsToAdd: number, draggingBundles?: string[]): boolean;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export const MIN_GAP = 20;
|
|
2
|
+
export function getGapSize(orientation, element) {
|
|
3
|
+
const computedStyle = window.getComputedStyle(element);
|
|
4
|
+
if (computedStyle.display.includes("grid") || computedStyle.display.includes("flex")) {
|
|
5
|
+
const gap = orientation === "vertical" ? computedStyle.columnGap || computedStyle.gridColumnGap : computedStyle.rowGap || computedStyle.gridRowGap;
|
|
6
|
+
if (gap) {
|
|
7
|
+
const gapParts = gap.split(" ");
|
|
8
|
+
const gapValue = gapParts[0];
|
|
9
|
+
if (gapValue?.endsWith("px")) {
|
|
10
|
+
return Number.parseFloat(gapValue);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return MIN_GAP;
|
|
15
|
+
}
|
|
16
|
+
export function getChildrenOrientation(element) {
|
|
17
|
+
const computedStyle = window.getComputedStyle(element);
|
|
18
|
+
if (computedStyle.display.includes("flex")) {
|
|
19
|
+
if (computedStyle.flexDirection === "row" || computedStyle.flexDirection === "row-reverse") {
|
|
20
|
+
return "horizontal";
|
|
21
|
+
} else {
|
|
22
|
+
return "vertical";
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (computedStyle.display.includes("grid")) {
|
|
26
|
+
if (computedStyle.gridTemplateColumns.split(" ").length > 1) {
|
|
27
|
+
return "horizontal";
|
|
28
|
+
} else {
|
|
29
|
+
return "vertical";
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return "vertical";
|
|
33
|
+
}
|
|
34
|
+
export function determineCanAddChildren(field, children, uuids, currentCount, itemsToAdd, draggingBundles) {
|
|
35
|
+
if (field.cardinality !== -1) {
|
|
36
|
+
const childrenThatAreSelection = children.filter((child) => {
|
|
37
|
+
const uuid = child.dataset.uuid;
|
|
38
|
+
if (!uuid) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
return uuids.includes(uuid);
|
|
42
|
+
}).length;
|
|
43
|
+
const countAfter = currentCount - childrenThatAreSelection + itemsToAdd;
|
|
44
|
+
if (countAfter > field.cardinality) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return !draggingBundles?.length || draggingBundles.every((bundle) => field.allowedBundles.includes(bundle));
|
|
49
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { EventbusEvents } from '#blokkli/types';
|
|
2
2
|
export declare const eventBus: import("mitt").Emitter<EventbusEvents>;
|
|
3
|
-
export declare const emitMessage: (message: string, type?: "success" | "error", additional?: string | Error | unknown) => void;
|
|
3
|
+
export declare const emitMessage: (message: string, type?: "success" | "error", additional?: string | Error | unknown, replace?: boolean) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import mitt from "mitt";
|
|
2
2
|
export const eventBus = mitt();
|
|
3
|
-
export const emitMessage = (message, type = "success", additional) => {
|
|
4
|
-
eventBus.emit("message", { type, message, additional });
|
|
3
|
+
export const emitMessage = (message, type = "success", additional, replace) => {
|
|
4
|
+
eventBus.emit("message", { type, message, additional, replace });
|
|
5
5
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DraggableItem, Rectangle,
|
|
1
|
+
import type { DraggableItem, Rectangle, Coord, LibraryItemProps, Size } from '#blokkli/types';
|
|
2
2
|
import type { RGB } from '#blokkli/types/theme';
|
|
3
3
|
/**
|
|
4
4
|
* Type check for falsy values.
|
|
@@ -11,7 +11,6 @@ export declare function falsy<T>(value: T): value is NonNullable<T>;
|
|
|
11
11
|
* Maps a HTML element that is draggable to a draggable item data object.
|
|
12
12
|
*/
|
|
13
13
|
export declare function buildDraggableItem(element: Element | EventTarget): DraggableItem | undefined;
|
|
14
|
-
export declare function findElement(uuid: string): HTMLElement | undefined;
|
|
15
14
|
export declare function onlyUnique(value: string, index: number, self: Array<string>): boolean;
|
|
16
15
|
/**
|
|
17
16
|
* Convert a date to a relative time string, such as
|
|
@@ -39,6 +38,15 @@ export declare function distanceToRectangle(x: number, y: number, rect: Rectangl
|
|
|
39
38
|
* Return the distance from the given coordinates to the center of the rectangle.
|
|
40
39
|
*/
|
|
41
40
|
export declare function distanceToClosestRectangleEdge(x: number, y: number, rect: Rectangle): number;
|
|
41
|
+
/**
|
|
42
|
+
* Subtracts a rectangle from a viewport and returns the remaining area as rectangles.
|
|
43
|
+
* The viewport is assumed to have x=0 and y=0.
|
|
44
|
+
*
|
|
45
|
+
* @param viewport - The size of the viewport to subtract from
|
|
46
|
+
* @param rect - The rectangle to subtract
|
|
47
|
+
* @returns An array of 0 to 4 rectangles representing the area outside of rect
|
|
48
|
+
*/
|
|
49
|
+
export declare function subtractRectFromViewport(viewport: Size, rect: Rectangle): Rectangle[];
|
|
42
50
|
export declare function getDistance(a: Coord, b: Coord): number;
|
|
43
51
|
export declare const parseColorString: (color: string) => RGB | undefined;
|
|
44
52
|
/**
|
|
@@ -68,18 +76,6 @@ export declare function findIdealRectPosition(blockingRects: Rectangle[], rectTo
|
|
|
68
76
|
x: number;
|
|
69
77
|
y: number;
|
|
70
78
|
};
|
|
71
|
-
export declare const findClosestBlock: (el: Element | EventTarget) => DraggableExistingBlock | undefined;
|
|
72
|
-
/**
|
|
73
|
-
* Find the closest entity context from a BlokkliProvider.
|
|
74
|
-
*/
|
|
75
|
-
export declare const findClosestEntityContext: (el: HTMLElement) => EntityContext | undefined;
|
|
76
|
-
export declare const findParentContext: (el: HTMLElement) => EntityContext | DraggableExistingBlock | undefined;
|
|
77
|
-
/**
|
|
78
|
-
* Maps a HTMLElement to a DroppableEntityField.
|
|
79
|
-
*/
|
|
80
|
-
export declare const mapDroppableField: (el: Element) => DroppableEntityField;
|
|
81
|
-
export declare const originatesFromEditable: (e: MouseEvent | TouchEvent) => HTMLElement | undefined;
|
|
82
|
-
export declare const getOriginatingDroppableElement: (e: MouseEvent | TouchEvent) => HTMLElement | undefined;
|
|
83
79
|
export declare const originatesFromTextInput: (e: Event) => boolean;
|
|
84
80
|
export declare function getFieldKey(uuid: string, fieldName: string): string;
|
|
85
81
|
export declare function getInteractionCoordinates(e: MouseEvent | TouchEvent): Coord;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { easeOutSine } from "./easing.js";
|
|
2
|
-
import { useRuntimeConfig } from "#imports";
|
|
3
2
|
export function falsy(value) {
|
|
4
3
|
return value !== null && value !== void 0;
|
|
5
4
|
}
|
|
@@ -7,44 +6,8 @@ export function buildDraggableItem(element) {
|
|
|
7
6
|
if (!(element instanceof HTMLElement)) {
|
|
8
7
|
return;
|
|
9
8
|
}
|
|
10
|
-
const itemEntityType = useRuntimeConfig().public.blokkli.itemEntityType;
|
|
11
9
|
const dataset = element.dataset;
|
|
12
|
-
if (dataset.elementType === "
|
|
13
|
-
const uuid = dataset.uuid;
|
|
14
|
-
const itemBundle = dataset.itemBundle;
|
|
15
|
-
const entityType = dataset.entityType;
|
|
16
|
-
const hostType = dataset.hostType;
|
|
17
|
-
const hostUuid = dataset.hostUuid;
|
|
18
|
-
const hostBundle = dataset.hostBundle;
|
|
19
|
-
const hostFieldName = dataset.hostFieldName;
|
|
20
|
-
const reusableBundle = dataset.reusableBundle;
|
|
21
|
-
const hostFieldListType = dataset.hostFieldListType;
|
|
22
|
-
const libraryItemUuid = dataset.bkLibraryItemUuid;
|
|
23
|
-
const isNew = dataset.isNew === "true";
|
|
24
|
-
const parentBlockBundle = hostType === itemEntityType ? hostBundle : void 0;
|
|
25
|
-
if (uuid && hostType && hostUuid && hostFieldName && itemBundle && hostBundle && entityType && hostFieldListType) {
|
|
26
|
-
const libraryLabel = dataset.bkLibraryLabel;
|
|
27
|
-
const editTitle = libraryLabel || "";
|
|
28
|
-
return {
|
|
29
|
-
itemType: "existing",
|
|
30
|
-
element: () => document.querySelector(`[data-uuid="${uuid}"]`),
|
|
31
|
-
itemBundle,
|
|
32
|
-
entityType,
|
|
33
|
-
isNested: hostType === itemEntityType,
|
|
34
|
-
uuid,
|
|
35
|
-
hostType,
|
|
36
|
-
hostBundle,
|
|
37
|
-
hostUuid,
|
|
38
|
-
hostFieldName,
|
|
39
|
-
hostFieldListType,
|
|
40
|
-
reusableBundle,
|
|
41
|
-
libraryItemUuid,
|
|
42
|
-
editTitle: editTitle || void 0,
|
|
43
|
-
isNew,
|
|
44
|
-
parentBlockBundle
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
} else if (dataset.elementType === "new") {
|
|
10
|
+
if (dataset.elementType === "new") {
|
|
48
11
|
const itemBundle = dataset.itemBundle;
|
|
49
12
|
if (itemBundle) {
|
|
50
13
|
return {
|
|
@@ -111,14 +74,6 @@ export function buildDraggableItem(element) {
|
|
|
111
74
|
}
|
|
112
75
|
}
|
|
113
76
|
}
|
|
114
|
-
export function findElement(uuid) {
|
|
115
|
-
const el = document.querySelector(
|
|
116
|
-
`[data-uuid="${uuid}"]:not(.bk-sortli-leave-from)`
|
|
117
|
-
);
|
|
118
|
-
if (el instanceof HTMLElement) {
|
|
119
|
-
return el;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
77
|
export function onlyUnique(value, index, self) {
|
|
123
78
|
return self.indexOf(value) === index;
|
|
124
79
|
}
|
|
@@ -234,6 +189,63 @@ export function distanceToClosestRectangleEdge(x, y, rect) {
|
|
|
234
189
|
const dy = Math.max(minY - y, 0, y - maxY);
|
|
235
190
|
return Math.sqrt(dx * dx + dy * dy);
|
|
236
191
|
}
|
|
192
|
+
export function subtractRectFromViewport(viewport, rect) {
|
|
193
|
+
const viewportLeft = 0;
|
|
194
|
+
const viewportTop = 0;
|
|
195
|
+
const viewportRight = viewport.width;
|
|
196
|
+
const viewportBottom = viewport.height;
|
|
197
|
+
const intersectLeft = Math.max(viewportLeft, rect.x);
|
|
198
|
+
const intersectTop = Math.max(viewportTop, rect.y);
|
|
199
|
+
const intersectRight = Math.min(viewportRight, rect.x + rect.width);
|
|
200
|
+
const intersectBottom = Math.min(viewportBottom, rect.y + rect.height);
|
|
201
|
+
if (intersectLeft >= intersectRight || intersectTop >= intersectBottom) {
|
|
202
|
+
return [
|
|
203
|
+
{
|
|
204
|
+
x: 0,
|
|
205
|
+
y: 0,
|
|
206
|
+
width: viewport.width,
|
|
207
|
+
height: viewport.height
|
|
208
|
+
}
|
|
209
|
+
];
|
|
210
|
+
}
|
|
211
|
+
if (intersectLeft <= viewportLeft && intersectTop <= viewportTop && intersectRight >= viewportRight && intersectBottom >= viewportBottom) {
|
|
212
|
+
return [];
|
|
213
|
+
}
|
|
214
|
+
const result = [];
|
|
215
|
+
if (intersectTop > viewportTop) {
|
|
216
|
+
result.push({
|
|
217
|
+
x: viewportLeft,
|
|
218
|
+
y: viewportTop,
|
|
219
|
+
width: viewport.width,
|
|
220
|
+
height: intersectTop - viewportTop
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
if (intersectBottom < viewportBottom) {
|
|
224
|
+
result.push({
|
|
225
|
+
x: viewportLeft,
|
|
226
|
+
y: intersectBottom,
|
|
227
|
+
width: viewport.width,
|
|
228
|
+
height: viewportBottom - intersectBottom
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
if (intersectLeft > viewportLeft) {
|
|
232
|
+
result.push({
|
|
233
|
+
x: viewportLeft,
|
|
234
|
+
y: intersectTop,
|
|
235
|
+
width: intersectLeft - viewportLeft,
|
|
236
|
+
height: intersectBottom - intersectTop
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
if (intersectRight < viewportRight) {
|
|
240
|
+
result.push({
|
|
241
|
+
x: intersectRight,
|
|
242
|
+
y: intersectTop,
|
|
243
|
+
width: viewportRight - intersectRight,
|
|
244
|
+
height: intersectBottom - intersectTop
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
return result;
|
|
248
|
+
}
|
|
237
249
|
export function getDistance(a, b) {
|
|
238
250
|
const dx = a.x - b.x;
|
|
239
251
|
const dy = a.y - b.y;
|
|
@@ -349,81 +361,6 @@ export function findIdealRectPosition(blockingRects, rectToPlace, viewport, maxO
|
|
|
349
361
|
)
|
|
350
362
|
};
|
|
351
363
|
}
|
|
352
|
-
export const findClosestBlock = (el) => {
|
|
353
|
-
if (!(el instanceof Element)) {
|
|
354
|
-
return;
|
|
355
|
-
}
|
|
356
|
-
const closest = el.closest('[data-element-type="existing"]');
|
|
357
|
-
if (!closest) {
|
|
358
|
-
return;
|
|
359
|
-
}
|
|
360
|
-
const item = buildDraggableItem(closest);
|
|
361
|
-
if (item?.itemType !== "existing") {
|
|
362
|
-
return;
|
|
363
|
-
}
|
|
364
|
-
return item;
|
|
365
|
-
};
|
|
366
|
-
export const findClosestEntityContext = (el) => {
|
|
367
|
-
const provider = el.closest('[data-blokkli-provider-active="true"]');
|
|
368
|
-
if (!(provider instanceof HTMLElement)) {
|
|
369
|
-
return;
|
|
370
|
-
}
|
|
371
|
-
const uuid = provider.dataset.providerUuid;
|
|
372
|
-
const type = provider.dataset.providerEntityType;
|
|
373
|
-
const bundle = provider.dataset.providerEntityBundle;
|
|
374
|
-
if (uuid && type && bundle) {
|
|
375
|
-
return {
|
|
376
|
-
uuid,
|
|
377
|
-
type,
|
|
378
|
-
bundle
|
|
379
|
-
};
|
|
380
|
-
}
|
|
381
|
-
};
|
|
382
|
-
export const findParentContext = (el) => {
|
|
383
|
-
const block = findClosestBlock(el);
|
|
384
|
-
if (block) {
|
|
385
|
-
return block;
|
|
386
|
-
}
|
|
387
|
-
return findClosestEntityContext(el);
|
|
388
|
-
};
|
|
389
|
-
export const mapDroppableField = (el) => {
|
|
390
|
-
if (!(el instanceof HTMLElement)) {
|
|
391
|
-
throw new TypeError(
|
|
392
|
-
`v-blokkli-droppable directive is only allowed on elements of type HTMLElement.`
|
|
393
|
-
);
|
|
394
|
-
}
|
|
395
|
-
const fieldName = el.dataset.blokkliDroppableField;
|
|
396
|
-
if (!fieldName) {
|
|
397
|
-
throw new Error(`Missing field name in v-blokkli-droppable directive.`);
|
|
398
|
-
}
|
|
399
|
-
const host = findParentContext(el);
|
|
400
|
-
if (!host) {
|
|
401
|
-
throw new Error(
|
|
402
|
-
`Failed to locate parent context for v-blokkli-droppable field with name "${fieldName}". Make sure the element is always rendered inside a block component or inside a <BlokkliProvider>.`
|
|
403
|
-
);
|
|
404
|
-
}
|
|
405
|
-
return {
|
|
406
|
-
element: el,
|
|
407
|
-
host,
|
|
408
|
-
fieldName
|
|
409
|
-
};
|
|
410
|
-
};
|
|
411
|
-
export const originatesFromEditable = (e) => {
|
|
412
|
-
if (e.target instanceof HTMLElement) {
|
|
413
|
-
const el = e.target.closest("[data-blokkli-editable-field]");
|
|
414
|
-
if (el instanceof HTMLElement) {
|
|
415
|
-
return el;
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
};
|
|
419
|
-
export const getOriginatingDroppableElement = (e) => {
|
|
420
|
-
if (e.target instanceof HTMLElement) {
|
|
421
|
-
const el = e.target.closest("[data-blokkli-droppable-field]");
|
|
422
|
-
if (el instanceof HTMLElement) {
|
|
423
|
-
return el;
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
};
|
|
427
364
|
export const originatesFromTextInput = (e) => e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement;
|
|
428
365
|
export function getFieldKey(uuid, fieldName) {
|
|
429
366
|
return uuid + ":" + fieldName;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import type { BlockIndicator } from '../types/index.js';
|
|
3
|
+
export type IndicatorsProvider = {
|
|
4
|
+
indicators: Ref<BlockIndicator[]>;
|
|
5
|
+
hovered: Ref<string>;
|
|
6
|
+
addIndicator: (indicator: BlockIndicator) => void;
|
|
7
|
+
removeIndicator: (id: string, uuid: string) => void;
|
|
8
|
+
setHovered: (uuid?: string | null) => void;
|
|
9
|
+
};
|
|
10
|
+
export default function (): IndicatorsProvider;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ref } from "vue";
|
|
2
|
+
export default function() {
|
|
3
|
+
const indicators = ref([]);
|
|
4
|
+
const hovered = ref("");
|
|
5
|
+
function addIndicator(indicator) {
|
|
6
|
+
indicators.value.push(indicator);
|
|
7
|
+
}
|
|
8
|
+
function removeIndicator(id, uuid) {
|
|
9
|
+
indicators.value = indicators.value.filter(
|
|
10
|
+
(v) => v.id !== id || v.uuid !== uuid
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
function setHovered(uuid) {
|
|
14
|
+
hovered.value = uuid ?? "";
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
indicators,
|
|
18
|
+
hovered,
|
|
19
|
+
addIndicator,
|
|
20
|
+
removeIndicator,
|
|
21
|
+
setHovered
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -13,6 +13,8 @@ export type KeyboardProvider = {
|
|
|
13
13
|
shortcuts: ComputedRef<RegisteredShortcut[]>;
|
|
14
14
|
registerShortcut: (shortcut: KeyboardShortcut) => void;
|
|
15
15
|
unregisterShortcut: (shortcut: KeyboardShortcut) => void;
|
|
16
|
+
lockKeyboardEvents: (id: string) => void;
|
|
17
|
+
unlockKeyboardEvents: (id: string) => void;
|
|
16
18
|
};
|
|
17
19
|
export default function (animationProvider: AnimationProvider): KeyboardProvider;
|
|
18
20
|
export {};
|
|
@@ -18,6 +18,8 @@ export default function(animationProvider) {
|
|
|
18
18
|
const isPressingSpace = ref(false);
|
|
19
19
|
const isPressingShift = ref(false);
|
|
20
20
|
const registeredShortcuts = ref([]);
|
|
21
|
+
const keyboardLocks = ref([]);
|
|
22
|
+
const keyboardLocked = computed(() => !!keyboardLocks.value.length);
|
|
21
23
|
const onKeyUp = (e) => {
|
|
22
24
|
isPressingControl.value = e.getModifierState("Control") || e.getModifierState("Meta");
|
|
23
25
|
isPressingShift.value = e.getModifierState("Shift");
|
|
@@ -29,6 +31,9 @@ export default function(animationProvider) {
|
|
|
29
31
|
}
|
|
30
32
|
};
|
|
31
33
|
const onKeyDown = (e) => {
|
|
34
|
+
if (keyboardLocked.value) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
32
37
|
isPressingControl.value = getControlState(e);
|
|
33
38
|
isPressingShift.value = e.getModifierState("Shift");
|
|
34
39
|
if (!isPressingSpace.value) {
|
|
@@ -78,6 +83,15 @@ export default function(animationProvider) {
|
|
|
78
83
|
isPressingControl.value = getControlState(e);
|
|
79
84
|
isPressingShift.value = !!e.shiftKey;
|
|
80
85
|
}
|
|
86
|
+
function lockKeyboardEvents(id) {
|
|
87
|
+
if (keyboardLocks.value.includes(id)) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
keyboardLocks.value.push(id);
|
|
91
|
+
}
|
|
92
|
+
function unlockKeyboardEvents(id) {
|
|
93
|
+
keyboardLocks.value = keyboardLocks.value.filter((v) => v !== id);
|
|
94
|
+
}
|
|
81
95
|
return {
|
|
82
96
|
isPressingSpace: readonly(isPressingSpace),
|
|
83
97
|
isPressingControl: readonly(isPressingControl),
|
|
@@ -85,6 +99,8 @@ export default function(animationProvider) {
|
|
|
85
99
|
shortcuts,
|
|
86
100
|
registerShortcut,
|
|
87
101
|
unregisterShortcut,
|
|
88
|
-
setShortcutStateFromEvent
|
|
102
|
+
setShortcutStateFromEvent,
|
|
103
|
+
lockKeyboardEvents,
|
|
104
|
+
unlockKeyboardEvents
|
|
89
105
|
};
|
|
90
106
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AddAction } from '#blokkli/types';
|
|
2
|
+
type PluginAddFunction<T> = () => T | T[] | undefined;
|
|
3
|
+
type AddActionFunction = PluginAddFunction<AddAction>;
|
|
4
|
+
export type PluginProvider = {
|
|
5
|
+
addAddAction: (fn: AddActionFunction) => void;
|
|
6
|
+
removeAddAction: (fn: AddActionFunction) => void;
|
|
7
|
+
getAddActions: () => AddAction[];
|
|
8
|
+
};
|
|
9
|
+
export default function (): PluginProvider;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export default function() {
|
|
2
|
+
let addActions = [];
|
|
3
|
+
function addAddAction(fn) {
|
|
4
|
+
addActions.push(fn);
|
|
5
|
+
}
|
|
6
|
+
function removeAddAction(fn) {
|
|
7
|
+
addActions = addActions.filter((v) => v !== fn);
|
|
8
|
+
}
|
|
9
|
+
function getAddActions() {
|
|
10
|
+
const actions = [];
|
|
11
|
+
for (let i = 0; i < addActions.length; i++) {
|
|
12
|
+
const callback = addActions[i];
|
|
13
|
+
if (!callback) {
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
const result = callback();
|
|
17
|
+
if (!result) {
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
if (Array.isArray(result)) {
|
|
21
|
+
actions.push(...result);
|
|
22
|
+
} else {
|
|
23
|
+
actions.push(result);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return actions;
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
addAddAction,
|
|
30
|
+
removeAddAction,
|
|
31
|
+
getAddActions
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RenderedFieldListItem } from '#blokkli/types';
|
|
2
|
+
import type { DomProvider } from '../domProvider.js';
|
|
3
|
+
import type { StateProvider } from '../stateProvider.js';
|
|
4
|
+
import type { AdapterContext } from '#blokkli/adapter';
|
|
5
|
+
import type { ComputedRef } from 'vue';
|
|
6
|
+
export type BlocksProvider = {
|
|
7
|
+
getBlock: (uuid: string) => RenderedFieldListItem | undefined;
|
|
8
|
+
getAllBlocks: () => RenderedFieldListItem[];
|
|
9
|
+
};
|
|
10
|
+
export default function (state: StateProvider, dom: DomProvider, context: ComputedRef<AdapterContext>): BlocksProvider;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { itemEntityType } from "#blokkli-build/config";
|
|
2
|
+
import onBlokkliEvent from "../composables/onBlokkliEvent.js";
|
|
3
|
+
export default function(state, dom, context) {
|
|
4
|
+
const renderedFieldListItemCache = /* @__PURE__ */ new Map();
|
|
5
|
+
function getParentBlockBundle(field) {
|
|
6
|
+
if (field.entityType !== itemEntityType) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
const block = state.getFieldListItem(field.entityUuid);
|
|
10
|
+
if (!block) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
return block.bundle;
|
|
14
|
+
}
|
|
15
|
+
function getLibraryData(item) {
|
|
16
|
+
if (item.bundle === "from_library" && item.props.libraryItem) {
|
|
17
|
+
const uuid = item.props.libraryItem.uuid;
|
|
18
|
+
const bundle = item.props.libraryItem.block?.bundle;
|
|
19
|
+
if (uuid && bundle) {
|
|
20
|
+
return {
|
|
21
|
+
label: item.props.libraryItem.label ?? "",
|
|
22
|
+
libraryItemUuid: uuid,
|
|
23
|
+
reusableBundle: bundle
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
function getBlock(uuid) {
|
|
30
|
+
const cached = renderedFieldListItemCache.get(uuid);
|
|
31
|
+
if (cached) {
|
|
32
|
+
return cached;
|
|
33
|
+
}
|
|
34
|
+
const item = state.getFieldListItem(uuid);
|
|
35
|
+
if (!item) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (!item.editContext) {
|
|
39
|
+
throw new Error("Missing editContext on block with UUID: " + item.uuid);
|
|
40
|
+
}
|
|
41
|
+
const fieldList = state.getFieldListForBlock(item.uuid);
|
|
42
|
+
if (!fieldList) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const field = dom.getRegisteredField(fieldList.entityUuid, fieldList.name);
|
|
46
|
+
const parentBlockBundle = getParentBlockBundle(fieldList);
|
|
47
|
+
const renderedItem = {
|
|
48
|
+
uuid: item.uuid,
|
|
49
|
+
bundle: item.bundle,
|
|
50
|
+
isNew: item.editContext.isNew,
|
|
51
|
+
isPublished: item.editContext.isPublished,
|
|
52
|
+
publishOn: item.editContext.publishOn,
|
|
53
|
+
unpublishOn: item.editContext.unpublishOn,
|
|
54
|
+
isNested: fieldList.entityType === itemEntityType,
|
|
55
|
+
fieldListType: field?.fieldListType ?? "default",
|
|
56
|
+
library: getLibraryData(item),
|
|
57
|
+
parentBlockBundle,
|
|
58
|
+
host: {
|
|
59
|
+
type: fieldList.entityType,
|
|
60
|
+
uuid: fieldList.entityUuid,
|
|
61
|
+
fieldName: fieldList.name,
|
|
62
|
+
bundle: parentBlockBundle ?? context.value.entityBundle
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
renderedFieldListItemCache.set(item.uuid, renderedItem);
|
|
66
|
+
return renderedItem;
|
|
67
|
+
}
|
|
68
|
+
function getAllBlocks() {
|
|
69
|
+
const blocks = [];
|
|
70
|
+
const uuids = state.getAllUuids();
|
|
71
|
+
for (let i = 0; i < uuids.length; i++) {
|
|
72
|
+
const uuid = uuids[i];
|
|
73
|
+
if (!uuid) {
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
const block = getBlock(uuid);
|
|
77
|
+
if (!block) {
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
blocks.push(block);
|
|
81
|
+
}
|
|
82
|
+
return blocks;
|
|
83
|
+
}
|
|
84
|
+
onBlokkliEvent("state:reloaded", () => {
|
|
85
|
+
renderedFieldListItemCache.clear();
|
|
86
|
+
});
|
|
87
|
+
return {
|
|
88
|
+
getBlock,
|
|
89
|
+
getAllBlocks
|
|
90
|
+
};
|
|
91
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { BlokkliDirectiveType, EntityContext, Rectangle } from '#blokkli/types';
|
|
2
|
+
import type { UiProvider } from './../uiProvider.js';
|
|
3
|
+
import { type ComputedRef } from '#imports';
|
|
4
|
+
import type { DebugProvider } from '../debugProvider.js';
|
|
5
|
+
type EditableFieldData = EntityContext & {
|
|
6
|
+
key: string;
|
|
7
|
+
fieldName: string;
|
|
8
|
+
directiveType: BlokkliDirectiveType;
|
|
9
|
+
};
|
|
10
|
+
type DroppableFieldElementData = EditableFieldData & {
|
|
11
|
+
element: HTMLElement;
|
|
12
|
+
};
|
|
13
|
+
export type DirectiveProvider = {
|
|
14
|
+
init: () => void;
|
|
15
|
+
registerDirectiveElement: (el: HTMLElement, fieldName: string, entity: EntityContext, type: BlokkliDirectiveType) => void;
|
|
16
|
+
unregisterDirectiveElement: (el: HTMLElement, fieldName: string, entity: EntityContext, type: BlokkliDirectiveType) => void;
|
|
17
|
+
getVisible: (directiveType: BlokkliDirectiveType) => Rectangle[];
|
|
18
|
+
getEditableAtPoint: (x: number, y: number) => EditableFieldData | undefined;
|
|
19
|
+
getEditablesForBlock: (uuid: string) => EditableFieldData[];
|
|
20
|
+
getDroppableElements: () => DroppableFieldElementData[];
|
|
21
|
+
findEditableElement: (fieldName: string, host: EntityContext) => HTMLElement | undefined;
|
|
22
|
+
isReady: ComputedRef<boolean>;
|
|
23
|
+
};
|
|
24
|
+
export default function (debug: DebugProvider, ui: UiProvider): DirectiveProvider;
|
|
25
|
+
export {};
|