@blokkli/editor 2.0.0-alpha.13 → 2.0.0-alpha.14
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 +1 -1
- package/dist/module.mjs +4003 -1162
- package/dist/modules/drupal/graphql/base/fragment.ParagraphsBlokkliConfigInput.graphql +31 -0
- package/dist/modules/drupal/graphql/base/fragment.blokkliProps.graphql +1 -0
- package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliEditState.graphql +1 -0
- package/dist/modules/drupal/graphql/base/query.pbEntityConfig.graphql +5 -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/update_host_options.graphql +15 -0
- package/dist/modules/drupal/index.d.mts +1 -1
- package/dist/modules/drupal/index.mjs +20 -7
- package/dist/modules/drupal/runtime/adapter/index.js +109 -4
- package/dist/runtime/adapter/index.d.ts +54 -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 +3 -0
- package/dist/runtime/blokkliPlugins/ContextMenu/index.vue +3 -2
- package/dist/runtime/blokkliPlugins/DroppableEdit/index.vue +3 -3
- package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue +49 -11
- package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue.d.ts +29 -15
- package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue +6 -7
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue +2 -9
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue.d.ts +1 -1
- package/dist/runtime/blokkliPlugins/ViewOption/index.vue +6 -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/BlokkliProvider.vue +1 -0
- package/dist/runtime/components/BlokkliProvider.vue.d.ts +1 -0
- package/dist/runtime/components/Edit/Actions/index.vue +39 -67
- 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/AppMenu/index.vue +5 -5
- package/dist/runtime/components/Edit/Dialog/index.vue +5 -1
- package/dist/runtime/components/Edit/Dialog/index.vue.d.ts +1 -1
- 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/DragInteractions/index.vue +35 -6
- package/dist/runtime/components/Edit/EditProvider.vue +46 -35
- package/dist/runtime/components/Edit/Features/AddList/index.vue +15 -25
- package/dist/runtime/components/Edit/Features/Analyze/Overlay/fragment.glsl +58 -0
- package/dist/runtime/components/Edit/Features/Analyze/Overlay/index.vue +168 -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 +101 -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 +136 -0
- package/dist/runtime/components/Edit/Features/Anchors/index.vue +32 -0
- package/dist/runtime/components/Edit/Features/Anchors/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Artboard/Overview/index.vue +25 -13
- package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue +296 -0
- package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue.d.ts +7 -0
- package/dist/runtime/components/Edit/Features/Artboard/index.vue +10 -245
- package/dist/runtime/components/Edit/Features/Assistant/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/BlockAddList/index.vue +4 -4
- package/dist/runtime/components/Edit/Features/Clipboard/index.vue +161 -28
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Group/index.vue +16 -4
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Group/index.vue.d.ts +0 -1
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/index.vue +4 -53
- package/dist/runtime/components/Edit/Features/CommandPalette/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/Conversions/index.vue +12 -14
- package/dist/runtime/components/Edit/Features/Debug/Viewport/index.vue +14 -0
- package/dist/runtime/components/Edit/Features/Debug/index.vue +27 -24
- 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 +4 -4
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/fragment.glsl +1 -1
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/index.vue +35 -71
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/vertex.glsl +1 -1
- package/dist/runtime/components/Edit/Features/DraggingOverlay/index.vue +62 -48
- package/dist/runtime/components/Edit/Features/EditForm/Frame/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/EditForm/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/EditableField/index.vue +6 -2
- package/dist/runtime/components/Edit/Features/EditableMask/index.vue +3 -20
- package/dist/runtime/components/Edit/Features/Fragments/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/History/index.vue +35 -12
- 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/index.vue +11 -9
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue +5 -8
- package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/fragment.glsl +1 -1
- package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/index.vue +9 -4
- package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/vertex.glsl +1 -1
- package/dist/runtime/components/Edit/Features/MultiSelect/index.vue +8 -14
- 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/Item.vue +9 -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 +81 -37
- package/dist/runtime/components/Edit/Features/Options/Form/index.vue.d.ts +5 -5
- package/dist/runtime/components/Edit/Features/Options/index.vue +30 -6
- package/dist/runtime/components/Edit/Features/PreviewGrant/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue +1 -0
- package/dist/runtime/components/Edit/Features/Publish/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/Revert/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/Search/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/AddButtonsField.vue +54 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/AddButtonsField.vue.d.ts +14 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue +120 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue.d.ts +15 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue +459 -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 +14 -9
- package/dist/runtime/components/Edit/Features/Selection/Overlay/index.vue +32 -11
- package/dist/runtime/components/Edit/Features/Selection/Overlay/vertex.glsl +1 -1
- package/dist/runtime/components/Edit/Features/Selection/index.vue +76 -7
- 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/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/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 +155 -44
- 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 +33 -0
- package/dist/runtime/components/Edit/Form/Text/index.vue.d.ts +19 -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/FormOverlay/index.vue +1 -1
- 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/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 +745 -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/ShortcutIndicator/index.vue +8 -3
- 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/index.vue +41 -0
- package/dist/runtime/components/Edit/Transition/index.vue.d.ts +19 -0
- package/dist/runtime/components/Edit/index.d.ts +23 -15
- package/dist/runtime/components/Edit/index.js +44 -28
- package/dist/runtime/composables/defineBlokkli.js +7 -3
- package/dist/runtime/composables/defineBlokkliFeature.d.ts +4 -7
- package/dist/runtime/composables/defineBlokkliProvider.d.ts +11 -0
- package/dist/runtime/composables/defineBlokkliProvider.js +46 -0
- package/dist/runtime/composables/useBlokkliHelper.js +1 -1
- 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 +4 -2
- package/dist/runtime/helpers/animationProvider.js +7 -2
- package/dist/runtime/helpers/bundles/index.d.ts +1 -0
- package/dist/runtime/helpers/bundles/index.js +4 -0
- package/dist/runtime/helpers/composables/useStickyToolbar.d.ts +20 -0
- package/dist/runtime/helpers/composables/useStickyToolbar.js +215 -0
- package/dist/runtime/helpers/definitionProvider.d.ts +2 -1
- package/dist/runtime/helpers/definitionProvider.js +17 -0
- package/dist/runtime/helpers/domProvider.d.ts +2 -1
- package/dist/runtime/helpers/domProvider.js +89 -43
- 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 -1
- package/dist/runtime/helpers/index.js +57 -0
- 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/renderCycle.d.ts +1 -0
- package/dist/runtime/helpers/renderCycle.js +10 -0
- package/dist/runtime/helpers/runtimeHelpers/index.js +14 -11
- package/dist/runtime/helpers/selectionProvider.d.ts +16 -0
- package/dist/runtime/helpers/selectionProvider.js +47 -35
- package/dist/runtime/helpers/stateProvider.d.ts +6 -2
- package/dist/runtime/helpers/stateProvider.js +58 -14
- package/dist/runtime/helpers/storageProvider.d.ts +4 -3
- package/dist/runtime/helpers/storageProvider.js +56 -3
- package/dist/runtime/helpers/symbols.d.ts +1 -0
- package/dist/runtime/helpers/symbols.js +1 -0
- package/dist/runtime/helpers/textProvider.js +6 -0
- package/dist/runtime/helpers/themeProvider.d.ts +2 -0
- package/dist/runtime/helpers/themeProvider.js +4 -1
- package/dist/runtime/helpers/transform.js +1 -3
- package/dist/runtime/helpers/uiProvider.d.ts +7 -2
- package/dist/runtime/helpers/uiProvider.js +49 -47
- package/dist/runtime/helpers/useTransitionedValue.d.ts +18 -0
- package/dist/runtime/helpers/useTransitionedValue.js +57 -0
- 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/chart.svg +1 -0
- package/dist/runtime/icons/copy.svg +1 -0
- package/dist/runtime/icons/cursor-move.svg +1 -1
- package/dist/runtime/icons/diff.svg +1 -1
- 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/speedometer.svg +1 -0
- package/dist/runtime/types/blokkOptions.d.ts +8 -0
- package/dist/runtime/types/index.d.ts +163 -5
- 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 +20 -5
- 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/components/Edit/Features/{FieldAreas/Overlay → Analyze}/index.vue.d.ts +0 -0
- /package/dist/runtime/components/Edit/Features/{FieldAreas/index.vue.d.ts → Anchors/Renderer.vue.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Teleport to="body">
|
|
3
|
-
<
|
|
3
|
+
<BlokkliTransition name="slide-in">
|
|
4
4
|
<FormOverlay
|
|
5
5
|
v-if="isVisible"
|
|
6
6
|
:id="id"
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
</button>
|
|
16
16
|
</template>
|
|
17
17
|
</FormOverlay>
|
|
18
|
-
</
|
|
18
|
+
</BlokkliTransition>
|
|
19
19
|
</Teleport>
|
|
20
20
|
</template>
|
|
21
21
|
|
|
22
22
|
<script setup>
|
|
23
|
-
import { FormOverlay } from "#blokkli/components";
|
|
23
|
+
import { FormOverlay, BlokkliTransition } from "#blokkli/components";
|
|
24
24
|
import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
|
|
25
25
|
import { ref, useBlokkli } from "#imports";
|
|
26
26
|
const props = defineProps({
|
|
@@ -1,21 +1,65 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Teleport v-if="enabled" to="#bk-blokkli-item-actions-dropdown">
|
|
3
|
-
<div
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<div
|
|
4
|
+
v-show="items.length"
|
|
5
|
+
:style="{
|
|
6
|
+
order: weight
|
|
7
|
+
}"
|
|
8
|
+
>
|
|
9
|
+
<ol>
|
|
10
|
+
<li v-for="item in itemsMapped" :key="item.id">
|
|
11
|
+
<button
|
|
12
|
+
class="bk-blokkli-item-actions-type-dropdown-button"
|
|
13
|
+
:disabled="!item.enabled"
|
|
14
|
+
@click.prevent="onClick(item)"
|
|
15
|
+
>
|
|
16
|
+
<div class="bk-blokkli-item-actions-type-dropdown-icon">
|
|
17
|
+
<Icon v-if="item.icon" :name="item.icon" />
|
|
18
|
+
<ItemIcon v-else-if="item.bundle" :bundle="item.bundle" />
|
|
19
|
+
</div>
|
|
20
|
+
<div>
|
|
21
|
+
<div>{{ item.label }}</div>
|
|
22
|
+
</div>
|
|
23
|
+
<div v-if="item.description" class="bk-tooltip">
|
|
24
|
+
{{ item.description }}
|
|
25
|
+
</div>
|
|
26
|
+
</button>
|
|
27
|
+
</li>
|
|
28
|
+
</ol>
|
|
6
29
|
</div>
|
|
7
30
|
</Teleport>
|
|
8
31
|
</template>
|
|
9
32
|
|
|
10
|
-
<script
|
|
33
|
+
<script>
|
|
34
|
+
import { Icon, ItemIcon } from "#blokkli/components";
|
|
11
35
|
import { computed, useBlokkli, onMounted, onBeforeUnmount } from "#imports";
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<script setup>
|
|
12
39
|
const props = defineProps({
|
|
13
40
|
id: { type: String, required: true },
|
|
14
41
|
title: { type: String, required: true },
|
|
15
|
-
enabled: { type: Boolean, required: true }
|
|
42
|
+
enabled: { type: Boolean, required: true },
|
|
43
|
+
items: { type: Array, required: true },
|
|
44
|
+
icon: { type: null, required: false },
|
|
45
|
+
weight: { type: [String, Number], required: false }
|
|
46
|
+
});
|
|
47
|
+
const emit = defineEmits(["select"]);
|
|
48
|
+
const itemsMapped = computed(() => {
|
|
49
|
+
return props.items.map((item) => {
|
|
50
|
+
return {
|
|
51
|
+
...item,
|
|
52
|
+
icon: item.icon ?? props.icon,
|
|
53
|
+
enabled: item.enabled !== false
|
|
54
|
+
};
|
|
55
|
+
});
|
|
16
56
|
});
|
|
17
57
|
const { eventBus } = useBlokkli();
|
|
18
58
|
const isRendering = computed(() => props.enabled);
|
|
59
|
+
function onClick(item) {
|
|
60
|
+
emit("select", item);
|
|
61
|
+
eventBus.emit("action:selected");
|
|
62
|
+
}
|
|
19
63
|
onMounted(() => {
|
|
20
64
|
eventBus.emit("plugin:mount", {
|
|
21
65
|
type: "ItemDropdown",
|
|
@@ -30,9 +74,3 @@ onBeforeUnmount(() => {
|
|
|
30
74
|
});
|
|
31
75
|
});
|
|
32
76
|
</script>
|
|
33
|
-
|
|
34
|
-
<script>
|
|
35
|
-
export default {
|
|
36
|
-
name: "PluginItemDropdown"
|
|
37
|
-
};
|
|
38
|
-
</script>
|
|
@@ -1,17 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
import type { BlokkliIcon } from '#blokkli-build/icons';
|
|
2
|
+
type Item = {
|
|
2
3
|
id: string;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
enabled: boolean;
|
|
9
|
-
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
10
|
-
default?: (props: {}) => any;
|
|
11
|
-
}>;
|
|
12
|
-
export default _default;
|
|
13
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
14
|
-
new (): {
|
|
15
|
-
$slots: S;
|
|
16
|
-
};
|
|
4
|
+
label: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
icon?: BlokkliIcon;
|
|
8
|
+
bundle?: string;
|
|
17
9
|
};
|
|
10
|
+
declare const _default: <T extends Item>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
11
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
12
|
+
readonly onSelect?: ((item: T) => any) | undefined;
|
|
13
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onSelect"> & {
|
|
14
|
+
id: string;
|
|
15
|
+
title: string;
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
items: T[];
|
|
18
|
+
icon?: BlokkliIcon;
|
|
19
|
+
weight?: string | number;
|
|
20
|
+
} & Partial<{}>> & import("vue").PublicProps;
|
|
21
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
22
|
+
attrs: any;
|
|
23
|
+
slots: {};
|
|
24
|
+
emit: (e: "select", item: T) => void;
|
|
25
|
+
}>) => import("vue").VNode & {
|
|
26
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
27
|
+
};
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_PrettifyLocal<T> = {
|
|
30
|
+
[K in keyof T]: T[K];
|
|
31
|
+
} & {};
|
|
@@ -69,6 +69,7 @@ import {
|
|
|
69
69
|
} from "#imports";
|
|
70
70
|
import { Icon, ViewportBlockingRect, ScrollBoundary } from "#blokkli/components";
|
|
71
71
|
import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
|
|
72
|
+
import { addElementClasses } from "#blokkli/helpers/addElementClasses";
|
|
72
73
|
const props = defineProps({
|
|
73
74
|
id: { type: String, required: true },
|
|
74
75
|
title: { type: String, required: true },
|
|
@@ -147,13 +148,11 @@ const rootCursor = computed(() => {
|
|
|
147
148
|
watch(rootCursor, (cursor) => {
|
|
148
149
|
document.documentElement.style.cursor = cursor;
|
|
149
150
|
});
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
});
|
|
151
|
+
addElementClasses(
|
|
152
|
+
document.documentElement,
|
|
153
|
+
"bk-is-sidebar-interacting",
|
|
154
|
+
mouseMode
|
|
155
|
+
);
|
|
157
156
|
const updateStored = () => {
|
|
158
157
|
storedData.value = {
|
|
159
158
|
x: x.value,
|
|
@@ -130,11 +130,11 @@ const { storage, state, ui, $t } = useBlokkli();
|
|
|
130
130
|
const tourElement = ref(null);
|
|
131
131
|
const detachedKey = computed(() => "sidebar:detached:" + props.id);
|
|
132
132
|
const storageKey = computed(() => "sidebar:active:" + props.region);
|
|
133
|
-
const isDetached = storage.use(detachedKey, false);
|
|
133
|
+
const isDetached = storage.use(detachedKey, false, true);
|
|
134
134
|
const isDisabled = computed(
|
|
135
135
|
() => props.editOnly && state.editMode.value !== "editing" && !props.disabled
|
|
136
136
|
);
|
|
137
|
-
const activeSidebar = storage.use(storageKey, "");
|
|
137
|
+
const activeSidebar = storage.use(storageKey, "", true);
|
|
138
138
|
const isRenderedDetached = computed(
|
|
139
139
|
() => isDetached.value && !ui.isMobile.value
|
|
140
140
|
);
|
|
@@ -166,13 +166,6 @@ const showSidebar = () => {
|
|
|
166
166
|
}
|
|
167
167
|
activeSidebar.value = props.id;
|
|
168
168
|
};
|
|
169
|
-
watch(activeSidebar, (active) => {
|
|
170
|
-
if (active) {
|
|
171
|
-
document.documentElement.classList.add("bk-has-sidebar-" + props.region);
|
|
172
|
-
} else {
|
|
173
|
-
document.documentElement.classList.remove("bk-has-sidebar-" + props.region);
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
169
|
const sidebarContent = ref(null);
|
|
177
170
|
const scrolledToEnd = ref(false);
|
|
178
171
|
const isOverflowing = ref(false);
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
</template>
|
|
31
31
|
|
|
32
32
|
<script setup>
|
|
33
|
-
import { useBlokkli, computed, ref } from "#imports";
|
|
33
|
+
import { useBlokkli, computed, ref, watch } from "#imports";
|
|
34
34
|
import { ShortcutIndicator, Icon } from "#blokkli/components";
|
|
35
35
|
import defineCommands from "#blokkli/helpers/composables/defineCommands";
|
|
36
36
|
import defineTourItem from "#blokkli/helpers/composables/defineTourItem";
|
|
37
|
-
const { storage, ui } = useBlokkli();
|
|
37
|
+
const { storage, ui, eventBus } = useBlokkli();
|
|
38
38
|
const props = defineProps({
|
|
39
39
|
id: { type: String, required: true },
|
|
40
40
|
label: { type: String, required: true },
|
|
@@ -50,7 +50,7 @@ const props = defineProps({
|
|
|
50
50
|
const emit = defineEmits(["update:modelValue"]);
|
|
51
51
|
const storageKey = "view_option_" + props.id;
|
|
52
52
|
const button = ref(null);
|
|
53
|
-
const isActiveStorage = storage.use(storageKey, false);
|
|
53
|
+
const isActiveStorage = storage.use(storageKey, false, true);
|
|
54
54
|
const isActive = computed({
|
|
55
55
|
get() {
|
|
56
56
|
return isActiveStorage.value;
|
|
@@ -60,6 +60,9 @@ const isActive = computed({
|
|
|
60
60
|
emit("update:modelValue", v);
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
|
+
watch(isActive, () => {
|
|
64
|
+
eventBus.emit("view-option:toggle", { id: props.id });
|
|
65
|
+
});
|
|
63
66
|
emit("update:modelValue", isActiveStorage.value);
|
|
64
67
|
const title = computed(() => isActive.value ? props.titleOff : props.titleOn);
|
|
65
68
|
const onClick = () => {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import PluginAddAction from './AddAction/index.vue.js';
|
|
2
|
+
import PluginBlockIndicator from './BlockIndicator/index.vue.js';
|
|
3
|
+
import PluginContextMenu from './ContextMenu/index.vue.js';
|
|
4
|
+
import PluginDebugOverlay from './DebugOverlay/index.vue.js';
|
|
5
|
+
import PluginDroppableEdit from './DroppableEdit/index.vue.js';
|
|
2
6
|
import PluginItemAction from './ItemAction/index.vue.js';
|
|
3
7
|
import PluginItemDropdown from './ItemDropdown/index.vue.js';
|
|
8
|
+
import PluginMenuButton from './MenuButton/index.vue.js';
|
|
4
9
|
import PluginSidebar from './Sidebar/index.vue.js';
|
|
5
10
|
import PluginToolbarButton from './ToolbarButton/index.vue.js';
|
|
6
|
-
import PluginViewOption from './ViewOption/index.vue.js';
|
|
7
|
-
import PluginAddAction from './AddAction/index.vue.js';
|
|
8
|
-
import PluginContextMenu from './ContextMenu/index.vue.js';
|
|
9
11
|
import PluginTourItem from './TourItem/index.vue.js';
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
export { PluginMenuButton, PluginItemAction, PluginSidebar, PluginToolbarButton, PluginViewOption, PluginItemDropdown, PluginAddAction, PluginContextMenu, PluginTourItem, PluginDroppableEdit, PluginDebugOverlay, };
|
|
12
|
+
import PluginViewOption from './ViewOption/index.vue.js';
|
|
13
|
+
export { PluginAddAction, PluginBlockIndicator, PluginContextMenu, PluginDebugOverlay, PluginDroppableEdit, PluginItemAction, PluginItemDropdown, PluginMenuButton, PluginSidebar, PluginToolbarButton, PluginTourItem, PluginViewOption, };
|
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import
|
|
1
|
+
import PluginAddAction from "./AddAction/index.vue";
|
|
2
|
+
import PluginBlockIndicator from "./BlockIndicator/index.vue";
|
|
3
|
+
import PluginContextMenu from "./ContextMenu/index.vue";
|
|
4
|
+
import PluginDebugOverlay from "./DebugOverlay/index.vue";
|
|
5
|
+
import PluginDroppableEdit from "./DroppableEdit/index.vue";
|
|
2
6
|
import PluginItemAction from "./ItemAction/index.vue";
|
|
3
7
|
import PluginItemDropdown from "./ItemDropdown/index.vue";
|
|
8
|
+
import PluginMenuButton from "./MenuButton/index.vue";
|
|
4
9
|
import PluginSidebar from "./Sidebar/index.vue";
|
|
5
10
|
import PluginToolbarButton from "./ToolbarButton/index.vue";
|
|
6
|
-
import PluginViewOption from "./ViewOption/index.vue";
|
|
7
|
-
import PluginAddAction from "./AddAction/index.vue";
|
|
8
|
-
import PluginContextMenu from "./ContextMenu/index.vue";
|
|
9
11
|
import PluginTourItem from "./TourItem/index.vue";
|
|
10
|
-
import
|
|
11
|
-
import PluginDebugOverlay from "./DebugOverlay/index.vue";
|
|
12
|
+
import PluginViewOption from "./ViewOption/index.vue";
|
|
12
13
|
export {
|
|
13
|
-
|
|
14
|
+
PluginAddAction,
|
|
15
|
+
PluginBlockIndicator,
|
|
16
|
+
PluginContextMenu,
|
|
17
|
+
PluginDebugOverlay,
|
|
18
|
+
PluginDroppableEdit,
|
|
14
19
|
PluginItemAction,
|
|
20
|
+
PluginItemDropdown,
|
|
21
|
+
PluginMenuButton,
|
|
15
22
|
PluginSidebar,
|
|
16
23
|
PluginToolbarButton,
|
|
17
|
-
PluginViewOption,
|
|
18
|
-
PluginItemDropdown,
|
|
19
|
-
PluginAddAction,
|
|
20
|
-
PluginContextMenu,
|
|
21
24
|
PluginTourItem,
|
|
22
|
-
|
|
23
|
-
PluginDebugOverlay
|
|
25
|
+
PluginViewOption
|
|
24
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20,11H4V8H20M20,15H13V13H20M20,19H13V17H20M11,19H4V13H11M20.33,4.67L18.67,3L17,4.67L15.33,3L13.67,4.67L12,3L10.33,4.67L8.67,3L7,4.67L5.33,3L3.67,4.67L2,3V19A2,2 0 0,0 4,21H20A2,2 0 0,0 22,19V3L20.33,4.67Z" /></svg>
|
|
@@ -97,6 +97,7 @@ const props = defineProps({
|
|
|
97
97
|
language: { type: String, required: false, default: "" },
|
|
98
98
|
editLabel: { type: String, required: false, default: "" },
|
|
99
99
|
editPath: { type: String, required: false, default: void 0 },
|
|
100
|
+
hostOptions: { type: null, required: false, default: void 0 },
|
|
100
101
|
isolate: { type: Boolean, required: false }
|
|
101
102
|
});
|
|
102
103
|
const shouldRender = ref(false);
|
|
@@ -9,6 +9,7 @@ declare const _default: <T extends object>(__VLS_props: NonNullable<Awaited<type
|
|
|
9
9
|
language?: string;
|
|
10
10
|
editLabel?: string;
|
|
11
11
|
editPath?: string;
|
|
12
|
+
hostOptions?: any;
|
|
12
13
|
/**
|
|
13
14
|
* When set to true, during editing, everything except the provider element will be hidden.
|
|
14
15
|
*/
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<div class="bk bk-blokkli-item-actions bk-control" @click.stop>
|
|
4
4
|
<div
|
|
5
5
|
v-show="
|
|
6
|
-
selection.
|
|
6
|
+
!selection.isDragging.value && !selection.editableActive.value && !ui.isAnimating.value && !ui.hasTransformOverlayOpen.value && hasAnythingSelected && shouldRender && !ui.hasAddTooltipOpen.value
|
|
7
7
|
"
|
|
8
8
|
ref="el"
|
|
9
9
|
class="bk-blokkli-item-actions-inner"
|
|
@@ -29,7 +29,13 @@
|
|
|
29
29
|
}"
|
|
30
30
|
@click.prevent="showDropdown = !showDropdown"
|
|
31
31
|
>
|
|
32
|
-
<div class="bk-
|
|
32
|
+
<div v-if="shouldRenderButton" class="bk-tooltip">
|
|
33
|
+
{{ $t("actionsDropdownToolip", "Further actions") }}
|
|
34
|
+
</div>
|
|
35
|
+
<div
|
|
36
|
+
v-show="!hasSelectedHost"
|
|
37
|
+
class="bk-blokkli-item-actions-title-icon"
|
|
38
|
+
>
|
|
33
39
|
<Icon v-if="ui.isTransforming.value" name="loader" />
|
|
34
40
|
<ItemIcon v-else-if="bundleIcon" :bundle="bundleIcon" />
|
|
35
41
|
<Icon v-else name="selection" />
|
|
@@ -54,6 +60,7 @@
|
|
|
54
60
|
<div id="bk-blokkli-item-actions-after" />
|
|
55
61
|
|
|
56
62
|
<div
|
|
63
|
+
v-show="selection.blocks.value.length"
|
|
57
64
|
id="bk-blokkli-item-actions"
|
|
58
65
|
class="bk-blokkli-item-actions-buttons"
|
|
59
66
|
/>
|
|
@@ -70,23 +77,39 @@ import {
|
|
|
70
77
|
computed,
|
|
71
78
|
useBlokkli,
|
|
72
79
|
onMounted,
|
|
73
|
-
onBeforeUnmount
|
|
80
|
+
onBeforeUnmount,
|
|
81
|
+
useTemplateRef
|
|
74
82
|
} from "#imports";
|
|
75
|
-
import { onlyUnique,
|
|
83
|
+
import { onlyUnique, falsy } from "#blokkli/helpers";
|
|
76
84
|
import { ItemIcon, Icon } from "#blokkli/components";
|
|
77
85
|
import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
|
|
78
|
-
|
|
86
|
+
import useStickyToolbar from "#blokkli/helpers/composables/useStickyToolbar";
|
|
87
|
+
const { selection, $t, types, state, ui, definitions, debug } = useBlokkli();
|
|
79
88
|
const editingEnabled = computed(
|
|
80
89
|
() => state.editMode.value === "editing" || state.editMode.value === "translating"
|
|
81
90
|
);
|
|
82
91
|
const ACTIONS_HEIGHT = 52;
|
|
83
|
-
|
|
92
|
+
let scrollWidth = 0;
|
|
93
|
+
const el = useTemplateRef("el");
|
|
94
|
+
const { shouldRender } = useStickyToolbar(el, {
|
|
95
|
+
getPlacementY: () => "top",
|
|
96
|
+
shouldUpdate: () => !selection.isChangingOptions.value,
|
|
97
|
+
getHeight: () => ACTIONS_HEIGHT,
|
|
98
|
+
getWidth: () => scrollWidth,
|
|
99
|
+
getMargin: () => 20
|
|
100
|
+
});
|
|
84
101
|
const controlsEl = ref(null);
|
|
85
102
|
const mountedPlugins = ref([]);
|
|
86
103
|
const showDropdown = ref(false);
|
|
104
|
+
const hasAnythingSelected = computed(
|
|
105
|
+
() => selection.hasHostSelected.value || !!selection.blocks.value.length
|
|
106
|
+
);
|
|
87
107
|
watch(selection.blocks, () => {
|
|
88
108
|
showDropdown.value = false;
|
|
89
109
|
});
|
|
110
|
+
watch(selection.hasHostSelected, () => {
|
|
111
|
+
showDropdown.value = false;
|
|
112
|
+
});
|
|
90
113
|
const bundleIcon = computed(() => {
|
|
91
114
|
if (itemBundle.value?.id === "from_library") {
|
|
92
115
|
const reusableBundle = selection.blocks.value[0]?.reusableBundle;
|
|
@@ -96,14 +119,15 @@ const bundleIcon = computed(() => {
|
|
|
96
119
|
}
|
|
97
120
|
return itemBundle.value?.id;
|
|
98
121
|
});
|
|
122
|
+
const hasSelectedHost = computed(() => {
|
|
123
|
+
return selection.blocks.value.length === 0;
|
|
124
|
+
});
|
|
99
125
|
const title = computed(() => {
|
|
100
126
|
if (ui.transformLabel.value) {
|
|
101
127
|
return ui.transformLabel.value;
|
|
102
|
-
}
|
|
103
|
-
if (debug.isEnabled.value && selection.uuids.value.length === 1) {
|
|
128
|
+
} else if (debug.isEnabled.value && selection.uuids.value.length === 1) {
|
|
104
129
|
return selection.uuids.value[0];
|
|
105
|
-
}
|
|
106
|
-
if (itemBundle.value) {
|
|
130
|
+
} else if (itemBundle.value) {
|
|
107
131
|
if (itemBundle.value.id === "blokkli_fragment") {
|
|
108
132
|
const fragments = selection.uuids.value.map((uuid) => {
|
|
109
133
|
const item = state.getFieldListItem(uuid);
|
|
@@ -127,6 +151,8 @@ const title = computed(() => {
|
|
|
127
151
|
}
|
|
128
152
|
}
|
|
129
153
|
return itemBundle.value.label;
|
|
154
|
+
} else if (!selection.blocks.value.length) {
|
|
155
|
+
return state.entity.value.label;
|
|
130
156
|
}
|
|
131
157
|
return $t("multipleItemsLabel", "Items");
|
|
132
158
|
});
|
|
@@ -140,21 +166,6 @@ const itemBundle = computed(() => {
|
|
|
140
166
|
const bundle = itemBundleIds.value[0];
|
|
141
167
|
return types.getBlockBundleDefinition(bundle);
|
|
142
168
|
});
|
|
143
|
-
const limitPlacedRect = (rect, padding) => {
|
|
144
|
-
return {
|
|
145
|
-
width: rect.width,
|
|
146
|
-
height: rect.height,
|
|
147
|
-
x: Math.min(
|
|
148
|
-
Math.max(rect.x, padding.x),
|
|
149
|
-
padding.x + padding.width - rect.width
|
|
150
|
-
),
|
|
151
|
-
y: Math.min(
|
|
152
|
-
Math.max(padding.y, rect.y),
|
|
153
|
-
padding.height + padding.y - rect.height
|
|
154
|
-
)
|
|
155
|
-
};
|
|
156
|
-
};
|
|
157
|
-
let scrollWidth = 0;
|
|
158
169
|
const observer = new ResizeObserver((entries) => {
|
|
159
170
|
const size = entries[0]?.contentBoxSize?.[0];
|
|
160
171
|
if (!size) {
|
|
@@ -173,48 +184,6 @@ onBeforeUnmount(() => {
|
|
|
173
184
|
observer.disconnect();
|
|
174
185
|
}
|
|
175
186
|
});
|
|
176
|
-
onBlokkliEvent("canvas:draw", () => {
|
|
177
|
-
if (!selection.blocks.value.length || ui.isMobile.value || selection.isChangingOptions.value) {
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
let minX = 0;
|
|
181
|
-
let minY = 0;
|
|
182
|
-
const rects = selection.uuids.value.map((uuid) => dom.getBlockRect(uuid)).filter(falsy);
|
|
183
|
-
if (!rects.length) {
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
const offset = ui.artboardOffset.value;
|
|
187
|
-
const scale = ui.artboardScale.value;
|
|
188
|
-
for (let i = 0; i < rects.length; i++) {
|
|
189
|
-
const { x, y } = rects[i];
|
|
190
|
-
const rectX = (x + offset.x / scale) * scale;
|
|
191
|
-
const rectY = (y + offset.y / scale) * scale;
|
|
192
|
-
if (i === 0 || rectX < minX) {
|
|
193
|
-
minX = rectX;
|
|
194
|
-
}
|
|
195
|
-
if (i === 0 || rectY < minY) {
|
|
196
|
-
minY = rectY;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
const padding = ui.visibleViewportPadded.value;
|
|
200
|
-
const rect = limitPlacedRect(
|
|
201
|
-
{
|
|
202
|
-
x: minX - 5 * Math.min(scale, 1),
|
|
203
|
-
y: minY - ACTIONS_HEIGHT - 15 * Math.min(scale, 1),
|
|
204
|
-
width: scrollWidth,
|
|
205
|
-
height: ACTIONS_HEIGHT
|
|
206
|
-
},
|
|
207
|
-
padding
|
|
208
|
-
);
|
|
209
|
-
const ideal = findIdealRectPosition(
|
|
210
|
-
ui.viewportBlockingRects.value,
|
|
211
|
-
rect,
|
|
212
|
-
padding
|
|
213
|
-
);
|
|
214
|
-
if (el.value) {
|
|
215
|
-
el.value.style.transform = ui.isMobile.value ? "" : `translate3d(${ideal.x}px, ${ideal.y}px, 0)`;
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
187
|
const shouldRenderButton = computed(
|
|
219
188
|
() => mountedPlugins.value.some((v) => v.isRendering)
|
|
220
189
|
);
|
|
@@ -230,6 +199,9 @@ onBlokkliEvent("plugin:unmount", (e) => {
|
|
|
230
199
|
}
|
|
231
200
|
mountedPlugins.value = mountedPlugins.value.filter((v) => v.type !== e.id);
|
|
232
201
|
});
|
|
202
|
+
onBlokkliEvent("action:selected", () => {
|
|
203
|
+
showDropdown.value = false;
|
|
204
|
+
});
|
|
233
205
|
watch(ui.isTransforming, function(isTransforming) {
|
|
234
206
|
if (isTransforming) {
|
|
235
207
|
showDropdown.value = false;
|
|
@@ -16,10 +16,7 @@
|
|
|
16
16
|
]"
|
|
17
17
|
>
|
|
18
18
|
<div class="bk-list-item-inner">
|
|
19
|
-
<
|
|
20
|
-
<Icon v-if="icon" :name="icon" />
|
|
21
|
-
<ItemIcon v-else-if="bundle" :bundle="bundle" />
|
|
22
|
-
</div>
|
|
19
|
+
<AddListItemIcon :orientation :color :bundle :icon />
|
|
23
20
|
<div
|
|
24
21
|
class="bk-list-item-label"
|
|
25
22
|
:class="{
|
|
@@ -45,7 +42,7 @@
|
|
|
45
42
|
|
|
46
43
|
<script setup>
|
|
47
44
|
import { useBlokkli, computed, ref } from "#imports";
|
|
48
|
-
import { ItemIcon, Icon } from "#blokkli/components";
|
|
45
|
+
import { ItemIcon, Icon, AddListItemIcon } from "#blokkli/components";
|
|
49
46
|
import { PluginContextMenu } from "#blokkli/plugins";
|
|
50
47
|
const { ui, storage, $t } = useBlokkli();
|
|
51
48
|
const props = defineProps({
|
|
@@ -22,7 +22,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
22
22
|
noContextMenu?: boolean;
|
|
23
23
|
}> & Readonly<{}>, {
|
|
24
24
|
bundle: string;
|
|
25
|
-
color: "rose" | "lime" | "default" | "yellow" | "accent";
|
|
26
25
|
icon: BlokkliIcon;
|
|
26
|
+
color: "rose" | "lime" | "default" | "yellow" | "accent";
|
|
27
27
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
28
28
|
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="bk-list-item-icon"
|
|
4
|
+
:class="['bk-is-' + color, 'bk-is-' + orientation]"
|
|
5
|
+
>
|
|
6
|
+
<Icon v-if="icon" :name="icon" />
|
|
7
|
+
<ItemIcon v-else-if="bundle" :bundle="bundle" />
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup>
|
|
12
|
+
import { ItemIcon, Icon } from "#blokkli/components";
|
|
13
|
+
defineProps({
|
|
14
|
+
icon: { type: null, required: false, default: void 0 },
|
|
15
|
+
bundle: { type: String, required: false, default: void 0 },
|
|
16
|
+
color: { type: String, required: false, default: "default" },
|
|
17
|
+
orientation: { type: String, required: false, default: "horizontal" }
|
|
18
|
+
});
|
|
19
|
+
</script>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { BlokkliIcon } from '#blokkli-build/icons';
|
|
2
|
+
import type { AddListOrientation } from '#blokkli/types';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
icon?: BlokkliIcon;
|
|
5
|
+
bundle?: string;
|
|
6
|
+
color?: 'rose' | 'lime' | 'default' | 'yellow' | 'accent';
|
|
7
|
+
orientation?: AddListOrientation;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
10
|
+
bundle: string;
|
|
11
|
+
icon: BlokkliIcon;
|
|
12
|
+
color: "rose" | "lime" | "default" | "yellow" | "accent";
|
|
13
|
+
orientation: AddListOrientation;
|
|
14
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
export default _default;
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
</div>
|
|
8
8
|
</Teleport>
|
|
9
9
|
<Teleport to="body">
|
|
10
|
-
<
|
|
10
|
+
<BlokkliTransition name="fade">
|
|
11
11
|
<div
|
|
12
12
|
v-if="menuOpen"
|
|
13
13
|
class="bk bk-menu-overlay bk-overlay"
|
|
14
14
|
@click="ui.menu.close()"
|
|
15
15
|
/>
|
|
16
|
-
</
|
|
17
|
-
<
|
|
16
|
+
</BlokkliTransition>
|
|
17
|
+
<BlokkliTransition name="menu">
|
|
18
18
|
<div v-show="menuOpen" class="bk bk-menu-list">
|
|
19
19
|
<button :class="{ 'bk-is-active': menuOpen }" @click="ui.menu.close">
|
|
20
20
|
<Icon name="close" />
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
</aside>
|
|
35
35
|
</div>
|
|
36
36
|
</div>
|
|
37
|
-
</
|
|
37
|
+
</BlokkliTransition>
|
|
38
38
|
</Teleport>
|
|
39
39
|
</template>
|
|
40
40
|
|
|
41
41
|
<script setup>
|
|
42
42
|
import { computed, useBlokkli } from "#imports";
|
|
43
|
-
import { Icon } from "#blokkli/components";
|
|
43
|
+
import { Icon, BlokkliTransition } from "#blokkli/components";
|
|
44
44
|
import { blokkliVersion } from "#blokkli-build/config";
|
|
45
45
|
const { ui, eventBus } = useBlokkli();
|
|
46
46
|
const menuOpen = computed(() => ui.menu.isOpen.value);
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
</template>
|
|
51
51
|
|
|
52
52
|
<script setup>
|
|
53
|
-
import { useBlokkli, onMounted, computed, ref } from "#imports";
|
|
53
|
+
import { useBlokkli, onMounted, computed, ref, onBeforeUnmount } from "#imports";
|
|
54
54
|
import { Icon } from "#blokkli/components";
|
|
55
55
|
import { modulo } from "#blokkli/helpers";
|
|
56
56
|
const { ui } = useBlokkli();
|
|
@@ -125,12 +125,16 @@ const onKeyDown = (e) => {
|
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
127
|
onMounted(() => {
|
|
128
|
+
ui.hasDialogOpen.value = true;
|
|
128
129
|
const focusableElements = getFocusableElements();
|
|
129
130
|
const bestMatch = focusableElements.find((el) => !(el instanceof HTMLButtonElement)) || focusableElements[0];
|
|
130
131
|
if (bestMatch) {
|
|
131
132
|
bestMatch.focus();
|
|
132
133
|
}
|
|
133
134
|
});
|
|
135
|
+
onBeforeUnmount(() => {
|
|
136
|
+
ui.hasDialogOpen.value = false;
|
|
137
|
+
});
|
|
134
138
|
</script>
|
|
135
139
|
|
|
136
140
|
<script>
|
|
@@ -28,8 +28,8 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
28
28
|
onCancel?: ((...args: any[]) => any) | undefined;
|
|
29
29
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
30
30
|
}>, {
|
|
31
|
-
width: number | string;
|
|
32
31
|
icon: BlokkliIcon;
|
|
32
|
+
width: number | string;
|
|
33
33
|
lead: string;
|
|
34
34
|
submitLabel: string;
|
|
35
35
|
canSubmit: boolean;
|