@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
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
toShaderColor
|
|
15
15
|
} from "#blokkli/helpers";
|
|
16
16
|
import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
|
|
17
|
+
import defineRenderer from "#blokkli/helpers/composables/defineRenderer";
|
|
17
18
|
import { ref, computed, useBlokkli, onBeforeUnmount } from "#imports";
|
|
18
19
|
import {
|
|
19
20
|
setBuffersAndAttributes,
|
|
@@ -23,6 +24,12 @@ import {
|
|
|
23
24
|
import vs from "./vertex.glsl?raw";
|
|
24
25
|
import fs from "./fragment.glsl?raw";
|
|
25
26
|
import { RectangleBufferCollector } from "#blokkli/helpers/webgl";
|
|
27
|
+
import {
|
|
28
|
+
determineCanAddChildren,
|
|
29
|
+
getChildrenOrientation,
|
|
30
|
+
getGapSize,
|
|
31
|
+
MIN_GAP
|
|
32
|
+
} from "#blokkli/helpers/dropTargets";
|
|
26
33
|
const props = defineProps({
|
|
27
34
|
items: { type: Array, required: true },
|
|
28
35
|
box: { type: Object, required: true },
|
|
@@ -30,7 +37,6 @@ const props = defineProps({
|
|
|
30
37
|
mouseY: { type: Number, required: true },
|
|
31
38
|
isTouch: { type: Boolean, required: true }
|
|
32
39
|
});
|
|
33
|
-
const MIN_GAP = 20;
|
|
34
40
|
var RectRenderType = /* @__PURE__ */ ((RectRenderType2) => {
|
|
35
41
|
RectRenderType2[RectRenderType2["DROP_AREA"] = 0] = "DROP_AREA";
|
|
36
42
|
RectRenderType2[RectRenderType2["FIELD_1"] = 1] = "FIELD_1";
|
|
@@ -55,7 +61,8 @@ const {
|
|
|
55
61
|
animation,
|
|
56
62
|
state,
|
|
57
63
|
runtimeConfig,
|
|
58
|
-
types
|
|
64
|
+
types,
|
|
65
|
+
fields
|
|
59
66
|
} = useBlokkli();
|
|
60
67
|
const gl = animation.gl();
|
|
61
68
|
const canvas = animation.getCanvasElement();
|
|
@@ -115,7 +122,7 @@ const emitDrop = async () => {
|
|
|
115
122
|
if (!hostUuid || !fieldName) {
|
|
116
123
|
return;
|
|
117
124
|
}
|
|
118
|
-
const field =
|
|
125
|
+
const field = fields.find(hostUuid, fieldName);
|
|
119
126
|
if (!field) {
|
|
120
127
|
return;
|
|
121
128
|
}
|
|
@@ -139,59 +146,28 @@ const emitDrop = async () => {
|
|
|
139
146
|
}
|
|
140
147
|
}
|
|
141
148
|
eventBus.emit("dragging:end");
|
|
142
|
-
eventBus.emit("item:dropped");
|
|
143
149
|
};
|
|
144
|
-
function getChildrenOrientation(element) {
|
|
145
|
-
const computedStyle = window.getComputedStyle(element);
|
|
146
|
-
if (computedStyle.display.includes("flex")) {
|
|
147
|
-
if (computedStyle.flexDirection === "row" || computedStyle.flexDirection === "row-reverse") {
|
|
148
|
-
return "horizontal";
|
|
149
|
-
} else {
|
|
150
|
-
return "vertical";
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
if (computedStyle.display.includes("grid")) {
|
|
154
|
-
if (computedStyle.gridTemplateColumns.split(" ").length > 1) {
|
|
155
|
-
return "horizontal";
|
|
156
|
-
} else {
|
|
157
|
-
return "vertical";
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
return "vertical";
|
|
161
|
-
}
|
|
162
150
|
const draggingBundles = computed(
|
|
163
151
|
() => props.items.flatMap((item) => {
|
|
164
152
|
const bundles = [];
|
|
165
|
-
if ("
|
|
153
|
+
if (item.itemType === "existing" || item.itemType === "existing_structure") {
|
|
154
|
+
bundles.push(item.block.bundle);
|
|
155
|
+
if (item.block.library?.reusableBundle) {
|
|
156
|
+
bundles.push(item.block.library.reusableBundle);
|
|
157
|
+
}
|
|
158
|
+
} else if (item.itemBundle) {
|
|
166
159
|
bundles.push(item.itemBundle);
|
|
167
160
|
}
|
|
168
|
-
if ("reusableBundle" in item && item.reusableBundle) {
|
|
169
|
-
bundles.push(item.reusableBundle);
|
|
170
|
-
}
|
|
171
161
|
return bundles;
|
|
172
162
|
}).filter(falsy)
|
|
173
163
|
);
|
|
174
164
|
const selectionUuids = computed(
|
|
175
165
|
() => props.items.map((item) => {
|
|
176
166
|
if (item.itemType === "existing") {
|
|
177
|
-
return item.uuid;
|
|
167
|
+
return item.block.uuid;
|
|
178
168
|
}
|
|
179
169
|
}).filter(falsy)
|
|
180
170
|
);
|
|
181
|
-
function getGapSize(orientation, element) {
|
|
182
|
-
const computedStyle = window.getComputedStyle(element);
|
|
183
|
-
if (computedStyle.display.includes("grid") || computedStyle.display.includes("flex")) {
|
|
184
|
-
const gap = orientation === "vertical" ? computedStyle.columnGap || computedStyle.gridColumnGap : computedStyle.rowGap || computedStyle.gridRowGap;
|
|
185
|
-
if (gap) {
|
|
186
|
-
const gapParts = gap.split(" ");
|
|
187
|
-
const gapValue = gapParts[0];
|
|
188
|
-
if (gapValue?.endsWith("px")) {
|
|
189
|
-
return Number.parseFloat(gapValue);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
return MIN_GAP;
|
|
194
|
-
}
|
|
195
171
|
const fieldChildCache = {};
|
|
196
172
|
const buildChildId = (field, preceedingUuid, type, uuid) => {
|
|
197
173
|
return `${field.key}:${preceedingUuid || ""}:${type || ""}:${uuid || ""}`;
|
|
@@ -300,25 +276,6 @@ function getInsertText(field) {
|
|
|
300
276
|
const bundleLabel = getBundleLabel(field);
|
|
301
277
|
return `${bundleLabel} \xBB <strong>${field.label}</strong>`;
|
|
302
278
|
}
|
|
303
|
-
const determineCanAddChildren = (field, children) => {
|
|
304
|
-
if (field.cardinality !== -1) {
|
|
305
|
-
const count = state.getFieldBlockCount(field.key);
|
|
306
|
-
const childrenThatAreSelection = children.filter((child) => {
|
|
307
|
-
const uuid = child.dataset.uuid;
|
|
308
|
-
if (!uuid) {
|
|
309
|
-
return false;
|
|
310
|
-
}
|
|
311
|
-
return selectionUuids.value.includes(uuid);
|
|
312
|
-
}).length;
|
|
313
|
-
const countAfter = count - childrenThatAreSelection + props.items.length;
|
|
314
|
-
if (countAfter > field.cardinality) {
|
|
315
|
-
return false;
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
return !draggingBundles.value.length || draggingBundles.value.every(
|
|
319
|
-
(bundle) => field.allowedBundles.includes(bundle)
|
|
320
|
-
);
|
|
321
|
-
};
|
|
322
279
|
const buildEmptyChild = (field, children, orientation, fieldWidth, fieldHeight) => {
|
|
323
280
|
if (children.length === 0) {
|
|
324
281
|
const id = buildChildId(field, null, "empty");
|
|
@@ -351,12 +308,20 @@ const buildFieldRect = (key) => {
|
|
|
351
308
|
if (!uuid || !name) {
|
|
352
309
|
return;
|
|
353
310
|
}
|
|
354
|
-
const field =
|
|
311
|
+
const field = fields.find(uuid, name);
|
|
355
312
|
if (!field) {
|
|
356
313
|
return;
|
|
357
314
|
}
|
|
358
315
|
const childElements = [...field.element.children];
|
|
359
|
-
const
|
|
316
|
+
const currentCount = state.getFieldBlockCount(field.key);
|
|
317
|
+
const canAddChildren = determineCanAddChildren(
|
|
318
|
+
field,
|
|
319
|
+
childElements,
|
|
320
|
+
selectionUuids.value,
|
|
321
|
+
currentCount,
|
|
322
|
+
props.items.length,
|
|
323
|
+
draggingBundles.value
|
|
324
|
+
);
|
|
360
325
|
const orientation = field.dropAlignment || getChildrenOrientation(field.element);
|
|
361
326
|
const rect = dom.getFieldRect(field.key);
|
|
362
327
|
if (!rect) {
|
|
@@ -406,10 +371,11 @@ const buildDropAreaRect = (area) => {
|
|
|
406
371
|
cachedDropAreaRects[area.id] = dropAreaRect;
|
|
407
372
|
return dropAreaRect;
|
|
408
373
|
};
|
|
374
|
+
const alphaBase = gl ? 0.7 : 0.3;
|
|
409
375
|
const colorTeal = rgbaToString(theme.teal.value.normal);
|
|
410
|
-
const colorTealAlpha = rgbaToString(theme.teal.value.normal,
|
|
376
|
+
const colorTealAlpha = rgbaToString(theme.teal.value.normal, alphaBase);
|
|
411
377
|
const colorAccent = rgbaToString(theme.accent.value[800]);
|
|
412
|
-
const colorAccentAlpha = rgbaToString(theme.accent.value[800],
|
|
378
|
+
const colorAccentAlpha = rgbaToString(theme.accent.value[800], alphaBase);
|
|
413
379
|
function getRectType(field) {
|
|
414
380
|
if (field.nestingLevel >= 3) {
|
|
415
381
|
return 4 /* FIELD_4 */;
|
|
@@ -482,6 +448,7 @@ class DropTargetRectangleBufferCollector extends RectangleBufferCollector {
|
|
|
482
448
|
false
|
|
483
449
|
);
|
|
484
450
|
}
|
|
451
|
+
this.processPendingRects();
|
|
485
452
|
const hasChanged = lengthBefore !== this.positions.length;
|
|
486
453
|
if (hasChanged) {
|
|
487
454
|
this.bufferInfo = this.createBufferInfo();
|
|
@@ -521,22 +488,26 @@ class DropTargetRectangleBufferCollector extends RectangleBufferCollector {
|
|
|
521
488
|
return null;
|
|
522
489
|
}
|
|
523
490
|
}
|
|
524
|
-
const collector = new DropTargetRectangleBufferCollector(gl
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
491
|
+
const collector = new DropTargetRectangleBufferCollector(gl, {
|
|
492
|
+
deferredMode: true
|
|
493
|
+
});
|
|
494
|
+
if (gl) {
|
|
495
|
+
collector.addRectangle(
|
|
496
|
+
{
|
|
497
|
+
id: "active-hover-rect",
|
|
498
|
+
type: "active-area",
|
|
499
|
+
label: "Field Area",
|
|
500
|
+
color: "red",
|
|
501
|
+
colorAlpha: "red",
|
|
502
|
+
x: 0,
|
|
503
|
+
y: 0,
|
|
504
|
+
width: ui.artboardSize.value.width,
|
|
505
|
+
height: ui.artboardSize.value.height
|
|
506
|
+
},
|
|
507
|
+
5 /* ACTIVE_AREA */,
|
|
508
|
+
false
|
|
509
|
+
);
|
|
510
|
+
}
|
|
540
511
|
const fieldColors = computed(() => {
|
|
541
512
|
return {
|
|
542
513
|
"0": theme.accent.value[900],
|
|
@@ -577,6 +548,18 @@ const activeHoverRect = computed(() => {
|
|
|
577
548
|
return [0, 0, 0, 0];
|
|
578
549
|
}
|
|
579
550
|
const outset = activeHoverField.value.field.nestingLevel === 0 ? 0 : 20;
|
|
551
|
+
if (activeHoverField.value.emptyChild) {
|
|
552
|
+
const emptyChildId = activeHoverField.value.emptyChild.id;
|
|
553
|
+
const adjustedRect = collector.rects[emptyChildId];
|
|
554
|
+
if (adjustedRect) {
|
|
555
|
+
return [
|
|
556
|
+
adjustedRect.x - outset,
|
|
557
|
+
adjustedRect.y - outset,
|
|
558
|
+
adjustedRect.width + 2 * outset,
|
|
559
|
+
adjustedRect.height + 2 * outset
|
|
560
|
+
];
|
|
561
|
+
}
|
|
562
|
+
}
|
|
580
563
|
return [
|
|
581
564
|
activeHoverField.value.x - outset,
|
|
582
565
|
activeHoverField.value.y - outset,
|
|
@@ -587,6 +570,9 @@ const activeHoverRect = computed(() => {
|
|
|
587
570
|
const activeHoverColor = computed(() => {
|
|
588
571
|
return getColorForField(activeHoverField.value);
|
|
589
572
|
});
|
|
573
|
+
const activeHoverFieldNestingLevel = computed(() => {
|
|
574
|
+
return activeHoverField.value?.field.nestingLevel ?? 0;
|
|
575
|
+
});
|
|
590
576
|
const uniforms = computed(() => {
|
|
591
577
|
const index = active.value?.index;
|
|
592
578
|
return {
|
|
@@ -597,7 +583,8 @@ const uniforms = computed(() => {
|
|
|
597
583
|
u_color_hover_area: toShaderColor(activeHoverColor.value),
|
|
598
584
|
u_color_area: toShaderColor(theme.teal.value.normal),
|
|
599
585
|
u_active_rect_id: index === void 0 ? -1 : index,
|
|
600
|
-
u_active_hover_rect: activeHoverRect.value
|
|
586
|
+
u_active_hover_rect: activeHoverRect.value,
|
|
587
|
+
u_active_hover_nesting_level: activeHoverFieldNestingLevel.value
|
|
601
588
|
};
|
|
602
589
|
});
|
|
603
590
|
const dragBox = ref({
|
|
@@ -621,11 +608,11 @@ function setHoveredFieldArea(box, mouse) {
|
|
|
621
608
|
}
|
|
622
609
|
return;
|
|
623
610
|
}
|
|
624
|
-
const
|
|
611
|
+
const fields2 = Object.values(fieldCache);
|
|
625
612
|
let highestNestingLevel = 0;
|
|
626
613
|
let candidate = null;
|
|
627
|
-
for (let i = 0; i <
|
|
628
|
-
const field =
|
|
614
|
+
for (let i = 0; i < fields2.length; i++) {
|
|
615
|
+
const field = fields2[i];
|
|
629
616
|
if (!field.canAddChildren) {
|
|
630
617
|
continue;
|
|
631
618
|
}
|
|
@@ -643,6 +630,8 @@ function setHoveredFieldArea(box, mouse) {
|
|
|
643
630
|
activeHoverField.value = candidate;
|
|
644
631
|
}
|
|
645
632
|
}
|
|
633
|
+
let bufferInfo = null;
|
|
634
|
+
let bufferChanged = false;
|
|
646
635
|
onBlokkliEvent("canvas:draw", () => {
|
|
647
636
|
const scale = ui.artboardScale.value;
|
|
648
637
|
const offset = { ...ui.artboardOffset.value };
|
|
@@ -653,10 +642,9 @@ onBlokkliEvent("canvas:draw", () => {
|
|
|
653
642
|
height: props.box.height / scale
|
|
654
643
|
};
|
|
655
644
|
const mouseAbsolute = toCanvasSpaceCoordinates(props.mouseX, props.mouseY);
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
}
|
|
645
|
+
const result = collector.getBufferInfo();
|
|
646
|
+
bufferInfo = result.info;
|
|
647
|
+
bufferChanged = result.hasChanged;
|
|
660
648
|
if (!props.isTouch) {
|
|
661
649
|
if (cursorIsInsideClipped()) {
|
|
662
650
|
const closest = collector.getClosestIntersectingRect(
|
|
@@ -668,44 +656,46 @@ onBlokkliEvent("canvas:draw", () => {
|
|
|
668
656
|
active.value = null;
|
|
669
657
|
}
|
|
670
658
|
}
|
|
671
|
-
|
|
672
|
-
if (
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
659
|
+
setHoveredFieldArea(dragBox.value, mouseAbsolute);
|
|
660
|
+
if (!gl && ctx) {
|
|
661
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
662
|
+
const rects = Object.values(collector.rects);
|
|
663
|
+
for (let i = 0; i < rects.length; i++) {
|
|
664
|
+
const rect = rects[i];
|
|
665
|
+
if (active.value?.id === rect.id) {
|
|
666
|
+
ctx.fillStyle = rect.color;
|
|
667
|
+
} else {
|
|
668
|
+
ctx.fillStyle = rect.colorAlpha;
|
|
681
669
|
}
|
|
670
|
+
ctx.fillRect(
|
|
671
|
+
(rect.x * scale + offset.x) * animation.dpi.value,
|
|
672
|
+
(rect.y * scale + offset.y) * animation.dpi.value,
|
|
673
|
+
rect.width * animation.dpi.value * scale,
|
|
674
|
+
rect.height * animation.dpi.value * scale
|
|
675
|
+
);
|
|
682
676
|
}
|
|
683
|
-
return;
|
|
684
|
-
}
|
|
685
|
-
if (!ctx) {
|
|
686
|
-
return;
|
|
687
|
-
}
|
|
688
|
-
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
689
|
-
const rects = Object.values(collector.rects);
|
|
690
|
-
for (let i = 0; i < rects.length; i++) {
|
|
691
|
-
const rect = rects[i];
|
|
692
|
-
if (active.value?.id === rect.id) {
|
|
693
|
-
ctx.fillStyle = rect.color;
|
|
694
|
-
} else {
|
|
695
|
-
ctx.fillStyle = rect.colorAlpha;
|
|
696
|
-
}
|
|
697
|
-
ctx.fillRect(
|
|
698
|
-
(rect.x * scale + offset.x) * animation.dpi.value,
|
|
699
|
-
(rect.y * scale + offset.y) * animation.dpi.value,
|
|
700
|
-
rect.width * animation.dpi.value * scale,
|
|
701
|
-
rect.height * animation.dpi.value * scale
|
|
702
|
-
);
|
|
703
677
|
}
|
|
704
678
|
});
|
|
679
|
+
if (gl && programInfo) {
|
|
680
|
+
defineRenderer("drop-targets", {
|
|
681
|
+
zIndex: 400,
|
|
682
|
+
only: true,
|
|
683
|
+
cursor: () => "grabbing",
|
|
684
|
+
render: () => {
|
|
685
|
+
gl.useProgram(programInfo.program);
|
|
686
|
+
animation.setSharedUniforms(gl, programInfo);
|
|
687
|
+
setUniforms(programInfo, uniforms.value);
|
|
688
|
+
if (!bufferInfo) {
|
|
689
|
+
return;
|
|
690
|
+
}
|
|
691
|
+
if (bufferChanged) {
|
|
692
|
+
setBuffersAndAttributes(gl, programInfo, bufferInfo);
|
|
693
|
+
}
|
|
694
|
+
drawBufferInfo(gl, bufferInfo, gl.TRIANGLES);
|
|
695
|
+
}
|
|
696
|
+
});
|
|
697
|
+
}
|
|
705
698
|
onBeforeUnmount(() => {
|
|
706
|
-
if (gl) {
|
|
707
|
-
gl.clear(gl.COLOR_BUFFER_BIT);
|
|
708
|
-
}
|
|
709
699
|
if (ctx) {
|
|
710
700
|
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
711
701
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DropTargetEvent,
|
|
1
|
+
import type { DropTargetEvent, DraggableItem, Rectangle } from '#blokkli/types';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
items: DraggableItem[];
|
|
4
4
|
box: Rectangle;
|
|
@@ -6,142 +6,13 @@ type __VLS_Props = {
|
|
|
6
6
|
mouseY: number;
|
|
7
7
|
isTouch: boolean;
|
|
8
8
|
};
|
|
9
|
-
type Orientation = 'horizontal' | 'vertical';
|
|
10
|
-
type FieldRectChild = Rectangle & {
|
|
11
|
-
id: string;
|
|
12
|
-
label: string;
|
|
13
|
-
};
|
|
14
|
-
type FieldRect = Rectangle & {
|
|
15
|
-
key: string;
|
|
16
|
-
field: BlokkliFieldElement;
|
|
17
|
-
label: string;
|
|
18
|
-
canAddChildren: boolean;
|
|
19
|
-
emptyChild?: FieldRectChild;
|
|
20
|
-
orientation: Orientation;
|
|
21
|
-
gap: number;
|
|
22
|
-
childrenElements: HTMLElement[];
|
|
23
|
-
};
|
|
24
|
-
type DrawnRect = Rectangle & {
|
|
25
|
-
id: string;
|
|
26
|
-
type: 'field' | 'drop-area' | 'active-area';
|
|
27
|
-
label: string;
|
|
28
|
-
color: string;
|
|
29
|
-
colorAlpha: string;
|
|
30
|
-
field?: FieldRect;
|
|
31
|
-
index: number;
|
|
32
|
-
};
|
|
33
|
-
declare const active: import("vue").Ref<{
|
|
34
|
-
width: number;
|
|
35
|
-
height: number;
|
|
36
|
-
x: number;
|
|
37
|
-
y: number;
|
|
38
|
-
id: string;
|
|
39
|
-
type: "field" | "drop-area" | "active-area";
|
|
40
|
-
label: string;
|
|
41
|
-
color: string;
|
|
42
|
-
colorAlpha: string;
|
|
43
|
-
field?: {
|
|
44
|
-
width: number;
|
|
45
|
-
height: number;
|
|
46
|
-
x: number;
|
|
47
|
-
y: number;
|
|
48
|
-
key: string;
|
|
49
|
-
field: {
|
|
50
|
-
key: string;
|
|
51
|
-
name: string;
|
|
52
|
-
label: string;
|
|
53
|
-
isNested: boolean;
|
|
54
|
-
nestingLevel: number;
|
|
55
|
-
fieldListType: import("#blokkli-build/generated-types").ValidFieldListTypes;
|
|
56
|
-
hostEntityType: string;
|
|
57
|
-
hostEntityBundle: string;
|
|
58
|
-
hostEntityUuid: string;
|
|
59
|
-
allowedBundles: string[];
|
|
60
|
-
allowedFragments: string[];
|
|
61
|
-
cardinality: number;
|
|
62
|
-
element: HTMLElement;
|
|
63
|
-
dropAlignment?: "vertical" | "horizontal" | undefined;
|
|
64
|
-
};
|
|
65
|
-
label: string;
|
|
66
|
-
canAddChildren: boolean;
|
|
67
|
-
emptyChild?: {
|
|
68
|
-
width: number;
|
|
69
|
-
height: number;
|
|
70
|
-
x: number;
|
|
71
|
-
y: number;
|
|
72
|
-
id: string;
|
|
73
|
-
label: string;
|
|
74
|
-
} | undefined;
|
|
75
|
-
orientation: Orientation;
|
|
76
|
-
gap: number;
|
|
77
|
-
childrenElements: HTMLElement[];
|
|
78
|
-
} | undefined;
|
|
79
|
-
index: number;
|
|
80
|
-
} | null, DrawnRect | {
|
|
81
|
-
width: number;
|
|
82
|
-
height: number;
|
|
83
|
-
x: number;
|
|
84
|
-
y: number;
|
|
85
|
-
id: string;
|
|
86
|
-
type: "field" | "drop-area" | "active-area";
|
|
87
|
-
label: string;
|
|
88
|
-
color: string;
|
|
89
|
-
colorAlpha: string;
|
|
90
|
-
field?: {
|
|
91
|
-
width: number;
|
|
92
|
-
height: number;
|
|
93
|
-
x: number;
|
|
94
|
-
y: number;
|
|
95
|
-
key: string;
|
|
96
|
-
field: {
|
|
97
|
-
key: string;
|
|
98
|
-
name: string;
|
|
99
|
-
label: string;
|
|
100
|
-
isNested: boolean;
|
|
101
|
-
nestingLevel: number;
|
|
102
|
-
fieldListType: import("#blokkli-build/generated-types").ValidFieldListTypes;
|
|
103
|
-
hostEntityType: string;
|
|
104
|
-
hostEntityBundle: string;
|
|
105
|
-
hostEntityUuid: string;
|
|
106
|
-
allowedBundles: string[];
|
|
107
|
-
allowedFragments: string[];
|
|
108
|
-
cardinality: number;
|
|
109
|
-
element: HTMLElement;
|
|
110
|
-
dropAlignment?: "vertical" | "horizontal" | undefined;
|
|
111
|
-
};
|
|
112
|
-
label: string;
|
|
113
|
-
canAddChildren: boolean;
|
|
114
|
-
emptyChild?: {
|
|
115
|
-
width: number;
|
|
116
|
-
height: number;
|
|
117
|
-
x: number;
|
|
118
|
-
y: number;
|
|
119
|
-
id: string;
|
|
120
|
-
label: string;
|
|
121
|
-
} | undefined;
|
|
122
|
-
orientation: Orientation;
|
|
123
|
-
gap: number;
|
|
124
|
-
childrenElements: HTMLElement[];
|
|
125
|
-
} | undefined;
|
|
126
|
-
index: number;
|
|
127
|
-
} | null>;
|
|
128
|
-
declare const activeColorHex: import("vue").ComputedRef<string>;
|
|
129
|
-
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
130
9
|
declare var __VLS_5: {
|
|
131
10
|
color: string;
|
|
132
11
|
label: string | undefined;
|
|
133
12
|
};
|
|
134
|
-
type __VLS_Slots =
|
|
13
|
+
type __VLS_Slots = {} & {
|
|
135
14
|
default?: (props: typeof __VLS_5) => any;
|
|
136
|
-
}
|
|
137
|
-
declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
|
|
138
|
-
active: typeof active;
|
|
139
|
-
activeColorHex: typeof activeColorHex;
|
|
140
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
141
|
-
drop: (data: DropTargetEvent) => any;
|
|
142
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
143
|
-
onDrop?: ((data: DropTargetEvent) => any) | undefined;
|
|
144
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
};
|
|
145
16
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
146
17
|
drop: (data: DropTargetEvent) => any;
|
|
147
18
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
precision
|
|
1
|
+
precision highp float;
|
|
2
2
|
|
|
3
3
|
attribute vec2 a_position;
|
|
4
4
|
attribute vec4 a_quad;
|
|
@@ -17,6 +17,7 @@ uniform vec3 u_color_field_3;
|
|
|
17
17
|
uniform vec3 u_color_area;
|
|
18
18
|
uniform vec3 u_color_hover_area;
|
|
19
19
|
uniform vec4 u_active_hover_rect;
|
|
20
|
+
uniform float u_active_hover_nesting_level;
|
|
20
21
|
uniform float u_dpi;
|
|
21
22
|
|
|
22
23
|
varying vec4 v_quad;
|