@blokkli/editor 2.0.0-alpha.23 → 2.0.0-alpha.25
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.json +1 -1
- package/dist/module.mjs +252 -92
- package/dist/runtime/blokkliPlugins/BlockIndicator/index.vue.d.ts +38 -0
- package/dist/runtime/blokkliPlugins/ContextMenu/index.vue +1 -1
- package/dist/runtime/blokkliPlugins/ContextMenu/index.vue.d.ts +15 -0
- package/dist/runtime/blokkliPlugins/DebugOverlay/index.vue.d.ts +6 -0
- package/dist/runtime/blokkliPlugins/ItemAction/index.vue.d.ts +28 -3
- package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue +6 -4
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue +11 -3
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue.d.ts +138 -3
- package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue +5 -1
- package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue.d.ts +116 -0
- package/dist/runtime/blokkliPlugins/TourItem/index.vue +22 -13
- package/dist/runtime/blokkliPlugins/TourItem/index.vue.d.ts +22 -0
- package/dist/runtime/blokkliPlugins/ViewOption/index.vue.d.ts +98 -0
- package/dist/runtime/blokkliPlugins/index.d.ts +1 -3
- package/dist/runtime/blokkliPlugins/index.js +0 -4
- package/dist/runtime/components/Blocks/NotImplemented/index.vue +24 -0
- package/dist/runtime/components/Blocks/NotImplemented/index.vue.d.ts +6 -0
- package/dist/runtime/components/BlokkliEditable.vue.d.ts +11 -0
- package/dist/runtime/components/BlokkliItem.vue +16 -3
- package/dist/runtime/components/BlokkliItem.vue.d.ts +2 -0
- package/dist/runtime/components/BlokkliProvider.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Actions/ItemDropdown.vue +1 -1
- package/dist/runtime/components/Edit/Actions/index.vue +78 -73
- package/dist/runtime/components/Edit/AddListItem/index.vue +9 -35
- package/dist/runtime/components/Edit/AddListItem/index.vue.d.ts +6 -15
- package/dist/runtime/components/Edit/AppMenu/MenuButton.vue +39 -0
- package/dist/runtime/{blokkliPlugins/MenuButton/index.vue.d.ts → components/Edit/AppMenu/MenuButton.vue.d.ts} +0 -4
- package/dist/runtime/components/Edit/AppMenu/index.vue +62 -40
- package/dist/runtime/components/Edit/ArtboardTooltip/index.vue +6 -0
- package/dist/runtime/components/Edit/BlockProxy/index.vue +2 -2
- package/dist/runtime/components/Edit/BlokkliErrorBoundary.vue +3 -0
- package/dist/runtime/components/Edit/BlokkliRootErrorBoundary.vue +4 -1
- package/dist/runtime/components/Edit/Dialog/index.vue +33 -47
- package/dist/runtime/components/Edit/Dialog/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/DraggableList.vue +12 -9
- package/dist/runtime/components/Edit/EditIndicator.vue +11 -4
- package/dist/runtime/components/Edit/EditProvider.vue +75 -55
- package/dist/runtime/components/Edit/EditProvider.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Features/AddList/Actions/Action.vue +53 -0
- package/dist/runtime/components/Edit/Features/AddList/Actions/Action.vue.d.ts +7 -0
- package/dist/runtime/components/Edit/Features/AddList/Actions/index.vue +41 -0
- package/dist/runtime/components/Edit/Features/AddList/Actions/index.vue.d.ts +5 -0
- package/dist/runtime/components/Edit/Features/AddList/Blocks/index.vue +13 -50
- package/dist/runtime/components/Edit/Features/AddList/Blocks/index.vue.d.ts +5 -0
- package/dist/runtime/components/Edit/Features/AddList/index.vue +76 -119
- package/dist/runtime/components/Edit/Features/Analyze/Icon.vue +85 -0
- package/dist/runtime/components/Edit/Features/Analyze/Icon.vue.d.ts +5 -0
- package/dist/runtime/components/Edit/Features/Analyze/Main.vue +288 -59
- package/dist/runtime/components/Edit/Features/Analyze/Main.vue.d.ts +8 -1
- package/dist/runtime/components/Edit/Features/Analyze/Renderer/fragment.glsl +25 -13
- package/dist/runtime/components/Edit/Features/Analyze/Renderer/index.vue +114 -52
- package/dist/runtime/components/Edit/Features/Analyze/Renderer/index.vue.d.ts +16 -2
- package/dist/runtime/components/Edit/Features/Analyze/Renderer/vertex.glsl +31 -11
- package/dist/runtime/components/Edit/Features/Analyze/Results/Results.vue +2 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/Results.vue.d.ts +8 -1
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItem.vue +4 -4
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItem.vue.d.ts +20 -2
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodes.vue +11 -18
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodes.vue.d.ts +10 -3
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue +46 -40
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue.d.ts +10 -4
- package/dist/runtime/components/Edit/Features/Analyze/Summary/Chart.vue +8 -4
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/axe.js +1 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/Context.d.ts +4 -3
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/Context.js +2 -1
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/readability.js +61 -20
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/types.d.ts +15 -1
- package/dist/runtime/components/Edit/Features/Analyze/index.vue +23 -2
- package/dist/runtime/components/Edit/Features/Artboard/Overview/index.vue +22 -8
- package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue +42 -21
- package/dist/runtime/components/Edit/Features/Artboard/Scrollbar/index.vue +10 -4
- package/dist/runtime/components/Edit/Features/Assistant/Overlay/index.vue +2 -28
- package/dist/runtime/components/Edit/Features/Assistant/index.vue +18 -14
- package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/index.vue +11 -1
- package/dist/runtime/components/Edit/Features/BlockScheduler/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Clipboard/List/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Clipboard/index.vue +52 -18
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Item/index.vue +0 -2
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Item/index.vue.d.ts +6 -4
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/index.vue +77 -27
- package/dist/runtime/components/Edit/Features/CommandPalette/index.vue +7 -4
- package/dist/runtime/components/Edit/Features/Comments/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Debug/Main.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Features/Debug/Rects/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Debug/Section/Logging.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/DragItem.vue +113 -0
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/DragItem.vue.d.ts +25 -0
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/index.vue +8 -97
- package/dist/runtime/components/Edit/Features/DraggingOverlay/Renderer/fragment.glsl +2 -5
- package/dist/runtime/components/Edit/Features/DraggingOverlay/Renderer/index.vue +38 -5
- package/dist/runtime/components/Edit/Features/DraggingOverlay/Renderer/vertex.glsl +10 -1
- package/dist/runtime/components/Edit/Features/DraggingOverlay/index.vue +1 -2
- package/dist/runtime/components/Edit/Features/EditForm/Frame/index.vue +8 -2
- package/dist/runtime/components/Edit/Features/EditForm/index.vue +3 -9
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/Plaintext/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/index.vue +4 -3
- package/dist/runtime/components/Edit/Features/EditableField/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/EditableMask/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/EntityTitle/index.vue +7 -2
- package/dist/runtime/components/Edit/Features/Exit/index.vue +12 -9
- package/dist/runtime/components/Edit/Features/Fragments/index.vue +27 -31
- package/dist/runtime/components/Edit/Features/ImportExisting/Dialog/index.vue +1 -0
- package/dist/runtime/components/Edit/Features/ImportExisting/index.vue +25 -24
- package/dist/runtime/components/Edit/Features/Library/EditReusable/index.vue +4 -4
- package/dist/runtime/components/Edit/Features/Library/LibraryDialog/index.vue +9 -2
- package/dist/runtime/components/Edit/Features/Library/ReusableDialog/index.vue +13 -3
- package/dist/runtime/components/Edit/Features/Library/index.vue +26 -24
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/MultiSelect/Renderer/index.vue +1 -3
- package/dist/runtime/components/Edit/Features/Options/Form/Item.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Features/PreviewGrant/index.vue +3 -1
- package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue +10 -0
- package/dist/runtime/components/Edit/Features/Publish/index.vue +17 -15
- package/dist/runtime/components/Edit/Features/ResponsivePreview/Frame/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/ResponsivePreview/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/Revert/index.vue +24 -18
- package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Content/index.vue +8 -2
- package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Page/index.vue +12 -2
- package/dist/runtime/components/Edit/Features/Search/Overlay/index.vue +11 -3
- package/dist/runtime/components/Edit/Features/Search/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue +128 -31
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue.d.ts +6 -6
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue +3 -6
- package/dist/runtime/components/Edit/Features/Selection/Renderer/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Settings/Dialog/index.vue +1 -0
- package/dist/runtime/components/Edit/Features/Settings/index.vue +26 -18
- package/dist/runtime/components/Edit/Features/Structure/List/Field/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/TouchActionBar/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Tour/Overlay/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/Tour/Popup/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Tour/index.vue +12 -10
- package/dist/runtime/components/Edit/Features/Transform/Dialog/index.vue +7 -1
- package/dist/runtime/components/Edit/Features/Transform/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Translations/index.vue +18 -17
- package/dist/runtime/components/Edit/Form/Textarea/index.vue +1 -1
- package/dist/runtime/components/Edit/FormOverlay/index.vue +13 -4
- package/dist/runtime/components/Edit/Indicators/index.vue +1 -1
- package/dist/runtime/components/Edit/InfoBox/index.vue +3 -2
- package/dist/runtime/components/Edit/InfoBox/index.vue.d.ts +6 -1
- package/dist/runtime/components/Edit/ItemIconBox/index.vue +41 -0
- package/dist/runtime/components/Edit/{AddListItemIcon → ItemIconBox}/index.vue.d.ts +5 -5
- package/dist/runtime/components/Edit/Konami/Game/index.vue +0 -1
- package/dist/runtime/components/Edit/Konami/index.vue +3 -5
- package/dist/runtime/components/Edit/Messages/Item/index.vue +11 -2
- package/dist/runtime/components/Edit/Messages/index.vue +6 -1
- package/dist/runtime/components/Edit/Overlay/index.vue +70 -0
- package/dist/runtime/components/Edit/Overlay/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/PreviewProvider.vue +3 -3
- package/dist/runtime/components/Edit/ScaleToFit/index.vue +4 -4
- package/dist/runtime/components/Edit/SystemRequirements/index.vue +36 -36
- package/dist/runtime/components/Edit/Toolbar/index.vue +47 -48
- package/dist/runtime/components/Edit/index.d.ts +2 -2
- package/dist/runtime/components/Edit/index.js +2 -2
- package/dist/runtime/composables/defineBlokkliFeature.d.ts +1 -1
- package/dist/runtime/composables/useBlokkli.d.ts +6 -1
- package/dist/runtime/composables/useBlokkli.js +4 -1
- package/dist/runtime/css/output.css +1 -1
- package/dist/runtime/helpers/composables/defineAddAction.d.ts +2 -0
- package/dist/runtime/helpers/composables/defineAddAction.js +10 -0
- package/dist/runtime/helpers/composables/defineElementStyle.d.ts +2 -0
- package/dist/runtime/helpers/composables/defineElementStyle.js +33 -0
- package/dist/runtime/helpers/composables/defineItemDropdownAction.d.ts +1 -1
- package/dist/runtime/helpers/composables/defineItemDropdownAction.js +2 -2
- package/dist/runtime/helpers/composables/defineMenuButton.d.ts +2 -0
- package/dist/runtime/helpers/composables/defineMenuButton.js +10 -0
- package/dist/runtime/helpers/composables/defineRenderer.d.ts +1 -1
- package/dist/runtime/helpers/composables/onBroadcastEvent.d.ts +1 -1
- package/dist/runtime/helpers/composables/useBlockRegistration.d.ts +1 -1
- package/dist/runtime/helpers/composables/useBlockRegistration.js +12 -1
- package/dist/runtime/helpers/composables/useDebugLogger.d.ts +1 -1
- package/dist/runtime/helpers/composables/useDialog.d.ts +3 -0
- package/dist/runtime/helpers/composables/useDialog.js +16 -0
- package/dist/runtime/helpers/composables/useFocusTrap.d.ts +52 -0
- package/dist/runtime/helpers/composables/useFocusTrap.js +59 -0
- package/dist/runtime/helpers/composables/useGlobalBlokkliObject.d.ts +1 -1
- package/dist/runtime/helpers/{useTransitionedValue.js → composables/useTransitionedValue.js} +1 -1
- package/dist/runtime/helpers/dropTargets/index.d.ts +1 -1
- package/dist/runtime/helpers/dropTargets/index.js +17 -3
- package/dist/runtime/helpers/imports/index.d.ts +2 -1
- package/dist/runtime/helpers/imports/index.js +10 -1
- package/dist/runtime/helpers/{animationProvider.d.ts → providers/animation.d.ts} +100 -7
- package/dist/runtime/helpers/{animationProvider.js → providers/animation.js} +21 -11
- package/dist/runtime/helpers/providers/blocks.d.ts +25 -3
- package/dist/runtime/helpers/providers/blocks.js +19 -0
- package/dist/runtime/helpers/providers/commands.d.ts +41 -0
- package/dist/runtime/helpers/{commandsProvider.js → providers/commands.js} +1 -1
- package/dist/runtime/helpers/providers/debug.d.ts +125 -0
- package/dist/runtime/helpers/{debugProvider.js → providers/debug.js} +2 -2
- package/dist/runtime/helpers/providers/definition.d.ts +87 -0
- package/dist/runtime/helpers/providers/directive.d.ts +88 -2
- package/dist/runtime/helpers/providers/directive.js +18 -2
- package/dist/runtime/helpers/providers/dom.d.ts +225 -0
- package/dist/runtime/helpers/{domProvider.js → providers/dom.js} +34 -76
- package/dist/runtime/helpers/providers/dropArea.d.ts +47 -0
- package/dist/runtime/helpers/{dropAreaProvider.js → providers/dropArea.js} +1 -1
- package/dist/runtime/helpers/providers/element.d.ts +58 -1
- package/dist/runtime/helpers/providers/features.d.ts +56 -0
- package/dist/runtime/helpers/{featuresProvider.js → providers/features.js} +1 -1
- package/dist/runtime/helpers/providers/fields.d.ts +19 -4
- package/dist/runtime/helpers/providers/fields.js +1 -1
- package/dist/runtime/helpers/providers/indicators.d.ts +44 -0
- package/dist/runtime/helpers/providers/keyboard.d.ts +76 -0
- package/dist/runtime/helpers/{keyboardProvider.js → providers/keyboard.js} +1 -8
- package/dist/runtime/helpers/providers/plugin.d.ts +81 -0
- package/dist/runtime/helpers/providers/plugin.js +64 -0
- package/dist/runtime/helpers/{selectionProvider.d.ts → providers/selection.d.ts} +4 -1
- package/dist/runtime/helpers/{selectionProvider.js → providers/selection.js} +1 -1
- package/dist/runtime/helpers/providers/state.d.ts +227 -0
- package/dist/runtime/helpers/{stateProvider.js → providers/state.js} +3 -3
- package/dist/runtime/helpers/providers/storage.d.ts +64 -0
- package/dist/runtime/helpers/{textProvider.d.ts → providers/texts.d.ts} +1 -1
- package/dist/runtime/helpers/providers/theme.d.ts +119 -0
- package/dist/runtime/helpers/{themeProvider.js → providers/theme.js} +3 -3
- package/dist/runtime/helpers/providers/tour.d.ts +49 -0
- package/dist/runtime/helpers/{tourProvider.js → providers/tour.js} +1 -1
- package/dist/runtime/helpers/providers/types.d.ts +170 -0
- package/dist/runtime/helpers/{typesProvider.js → providers/types.js} +45 -1
- package/dist/runtime/helpers/providers/ui.d.ts +339 -0
- package/dist/runtime/helpers/{uiProvider.js → providers/ui.js} +94 -86
- package/dist/runtime/helpers/runtimeHelpers/index.d.ts +1 -1
- package/dist/runtime/helpers/symbols.d.ts +1 -0
- package/dist/runtime/helpers/symbols.js +3 -0
- package/dist/runtime/icons/click.svg +1 -0
- package/dist/runtime/types/blockOptions.d.ts +349 -0
- package/dist/runtime/types/index.d.ts +34 -31
- package/package.json +2 -2
- package/dist/runtime/blokkliPlugins/AddAction/index.vue +0 -96
- package/dist/runtime/blokkliPlugins/AddAction/index.vue.d.ts +0 -26
- package/dist/runtime/blokkliPlugins/MenuButton/index.vue +0 -68
- package/dist/runtime/components/Edit/AddListItemIcon/index.vue +0 -19
- package/dist/runtime/helpers/commandsProvider.d.ts +0 -9
- package/dist/runtime/helpers/debugProvider.d.ts +0 -33
- package/dist/runtime/helpers/definitionProvider.d.ts +0 -19
- package/dist/runtime/helpers/domProvider.d.ts +0 -90
- package/dist/runtime/helpers/dropAreaProvider.d.ts +0 -9
- package/dist/runtime/helpers/featuresProvider.d.ts +0 -17
- package/dist/runtime/helpers/indicatorsProvider.d.ts +0 -10
- package/dist/runtime/helpers/keyboardProvider.d.ts +0 -20
- package/dist/runtime/helpers/pluginProvider.d.ts +0 -26
- package/dist/runtime/helpers/pluginProvider.js +0 -62
- package/dist/runtime/helpers/stateProvider.d.ts +0 -47
- package/dist/runtime/helpers/storageProvider.d.ts +0 -17
- package/dist/runtime/helpers/themeProvider.d.ts +0 -30
- package/dist/runtime/helpers/tourProvider.d.ts +0 -11
- package/dist/runtime/helpers/typesProvider.d.ts +0 -36
- package/dist/runtime/helpers/uiProvider.d.ts +0 -60
- package/dist/runtime/types/blokkOptions.d.ts +0 -100
- /package/dist/runtime/helpers/{addElementClasses.d.ts → composables/addElementClasses.d.ts} +0 -0
- /package/dist/runtime/helpers/{addElementClasses.js → composables/addElementClasses.js} +0 -0
- /package/dist/runtime/helpers/{useTransitionedValue.d.ts → composables/useTransitionedValue.d.ts} +0 -0
- /package/dist/runtime/helpers/{broadcastProvider.d.ts → providers/broadcast.d.ts} +0 -0
- /package/dist/runtime/helpers/{broadcastProvider.js → providers/broadcast.js} +0 -0
- /package/dist/runtime/helpers/{definitionProvider.js → providers/definition.js} +0 -0
- /package/dist/runtime/helpers/{indicatorsProvider.js → providers/indicators.js} +0 -0
- /package/dist/runtime/helpers/{storageProvider.js → providers/storage.js} +0 -0
- /package/dist/runtime/helpers/{textProvider.js → providers/texts.js} +0 -0
- /package/dist/runtime/types/{blokkOptions.js → blockOptions.js} +0 -0
|
@@ -1,43 +1,29 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
v-if="isSidebar && shouldRender"
|
|
4
|
-
id="add_list"
|
|
5
|
-
:title="sidebarTitle"
|
|
6
|
-
:tour-text="tourText"
|
|
7
|
-
render-always
|
|
8
|
-
icon="plus"
|
|
9
|
-
weight="-10"
|
|
10
|
-
@updated="eventBus.emit('add-list:change')"
|
|
11
|
-
>
|
|
12
|
-
<div>
|
|
13
|
-
<div id="blokkli-add-list-sidebar-before" />
|
|
14
|
-
<div class="bk bk-list-sidebar">
|
|
15
|
-
<AddListBlocks />
|
|
16
|
-
<Sortli id="blokkli-add-list-actions" :build-item="buildItemAction" />
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
|
-
</PluginSidebar>
|
|
20
|
-
<Teleport v-else-if="shouldRender" to="body">
|
|
2
|
+
<Teleport v-if="shouldRender" :to="ui.mainLayoutElement.value">
|
|
21
3
|
<div
|
|
22
4
|
ref="wrapper"
|
|
23
5
|
class="bk bk-add-list bk-control"
|
|
24
|
-
:class="[
|
|
25
|
-
{ 'bk-is-active': isActive || hasContextMenuOpen },
|
|
26
|
-
'bk-is-' + ui.addListOrientation.value
|
|
27
|
-
]"
|
|
28
|
-
:style="style"
|
|
29
6
|
@wheel.capture.passive="onWheel"
|
|
30
7
|
@mouseenter="onMouseEnter"
|
|
31
8
|
@mouseleave="onMouseLeave"
|
|
32
9
|
>
|
|
33
|
-
<div
|
|
34
|
-
|
|
35
|
-
|
|
10
|
+
<div
|
|
11
|
+
class="bk-add-list-inner"
|
|
12
|
+
:class="{
|
|
13
|
+
'bk-is-active': isActive
|
|
14
|
+
}"
|
|
15
|
+
>
|
|
16
|
+
<AddListBlocks
|
|
17
|
+
:selectable-bundles
|
|
18
|
+
:generally-available-bundles
|
|
19
|
+
:hide-disabled-blocks="settings.hideDisabledBlocks"
|
|
20
|
+
/>
|
|
21
|
+
<AddListActions :selectable-bundles />
|
|
36
22
|
</div>
|
|
37
23
|
</div>
|
|
38
24
|
<PluginTourItem
|
|
39
25
|
id="add-blocks"
|
|
40
|
-
|
|
26
|
+
:element="wrapper"
|
|
41
27
|
:title="sidebarTitle"
|
|
42
28
|
:text="tourText"
|
|
43
29
|
/>
|
|
@@ -46,44 +32,23 @@
|
|
|
46
32
|
|
|
47
33
|
<script setup>
|
|
48
34
|
import {
|
|
49
|
-
watch,
|
|
50
35
|
ref,
|
|
51
36
|
computed,
|
|
52
37
|
useBlokkli,
|
|
53
|
-
|
|
54
|
-
|
|
38
|
+
defineBlokkliFeature,
|
|
39
|
+
useTemplateRef
|
|
55
40
|
} from "#imports";
|
|
56
|
-
import {
|
|
57
|
-
import { PluginSidebar, PluginTourItem } from "#blokkli/plugins";
|
|
58
|
-
import { addElementClasses } from "#blokkli/helpers/addElementClasses";
|
|
41
|
+
import { PluginTourItem } from "#blokkli/plugins";
|
|
59
42
|
import AddListBlocks from "./Blocks/index.vue";
|
|
43
|
+
import AddListActions from "./Actions/index.vue";
|
|
44
|
+
import { itemEntityType } from "#blokkli-build/config";
|
|
45
|
+
import { onlyUnique } from "#blokkli/helpers";
|
|
60
46
|
const { settings } = defineBlokkliFeature({
|
|
61
47
|
id: "add-list",
|
|
62
48
|
icon: "plus",
|
|
63
49
|
label: "Add List",
|
|
64
50
|
description: "Provides the container to render a list of blocks to add or add actions.",
|
|
65
51
|
settings: {
|
|
66
|
-
orientation: {
|
|
67
|
-
type: "radios",
|
|
68
|
-
label: "Add List",
|
|
69
|
-
default: "vertical",
|
|
70
|
-
group: "appearance",
|
|
71
|
-
viewports: ["desktop"],
|
|
72
|
-
options: {
|
|
73
|
-
vertical: {
|
|
74
|
-
label: "Vertical",
|
|
75
|
-
icon: "ui-list-vertical"
|
|
76
|
-
},
|
|
77
|
-
horizontal: {
|
|
78
|
-
label: "Horizontal",
|
|
79
|
-
icon: "ui-list-horizontal"
|
|
80
|
-
},
|
|
81
|
-
sidebar: {
|
|
82
|
-
label: "Sidebar",
|
|
83
|
-
icon: "ui-list-sidebar"
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
52
|
hideDisabledBlocks: {
|
|
88
53
|
type: "checkbox",
|
|
89
54
|
label: "Hide blocks that can't be added",
|
|
@@ -94,71 +59,77 @@ const { settings } = defineBlokkliFeature({
|
|
|
94
59
|
},
|
|
95
60
|
screenshot: "feature-add-list.jpg"
|
|
96
61
|
});
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
if (
|
|
100
|
-
return;
|
|
62
|
+
const { $t, ui, selection, state, tour, types, context, dom } = useBlokkli();
|
|
63
|
+
const getAllowedTypesForSelected = (p) => {
|
|
64
|
+
if (types.itemBundlesWithNested.includes(p.bundle)) {
|
|
65
|
+
return types.fieldConfig.forEntityTypeAndBundle(itemEntityType, p.bundle).flatMap((v) => v.allowedBundles).filter(Boolean);
|
|
101
66
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
67
|
+
if (p.host.type === itemEntityType) {
|
|
68
|
+
return types.fieldConfig.forEntityTypeAndBundle(itemEntityType, p.host.bundle).flatMap((v) => v.allowedBundles).filter(Boolean);
|
|
69
|
+
} else {
|
|
70
|
+
return types.getFieldConfig(
|
|
71
|
+
context.value.entityType,
|
|
72
|
+
context.value.entityBundle,
|
|
73
|
+
p.host.fieldName
|
|
74
|
+
)?.allowedBundles || [];
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const bundlesForRenderedFields = computed(() => {
|
|
78
|
+
return dom.registeredFieldTypes.value.flatMap((field) => {
|
|
79
|
+
return types.getFieldConfig(
|
|
80
|
+
field.entityType,
|
|
81
|
+
field.entityBundle,
|
|
82
|
+
field.fieldName
|
|
83
|
+
)?.allowedBundles || [];
|
|
84
|
+
}).filter(onlyUnique);
|
|
85
|
+
});
|
|
86
|
+
const generallyAvailableBundles = computed(
|
|
87
|
+
() => types.generallyAvailableBundles.filter(
|
|
88
|
+
(v) => (
|
|
89
|
+
// Exclude bundles for which no field is currently being rendered.
|
|
90
|
+
bundlesForRenderedFields.value.includes(v.id)
|
|
91
|
+
)
|
|
92
|
+
)
|
|
113
93
|
);
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
});
|
|
94
|
+
const selectableBundles = computed(() => {
|
|
95
|
+
if (selection.items.value.length) {
|
|
96
|
+
return selection.items.value.flatMap((v) => getAllowedTypesForSelected(v));
|
|
97
|
+
}
|
|
98
|
+
return generallyAvailableBundles.value.map((v) => v.id || "");
|
|
120
99
|
});
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
const
|
|
100
|
+
const shouldRender = computed(
|
|
101
|
+
() => state.canEdit.value && state.editMode.value === "editing"
|
|
102
|
+
);
|
|
103
|
+
const hasContextMenuOpen = computed(
|
|
104
|
+
() => ui.openContextMenu.value.startsWith("add_list_item_add-list-blocks")
|
|
105
|
+
);
|
|
106
|
+
const wrapper = useTemplateRef("wrapper");
|
|
107
|
+
const isHovered = ref(false);
|
|
125
108
|
let mouseTimeout = null;
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
const widths = element.queryAll(
|
|
129
|
-
wrapper.value,
|
|
130
|
-
".bk-list-item-label span",
|
|
131
|
-
"AddList vertical sidebar style",
|
|
132
|
-
(el) => el.offsetWidth
|
|
133
|
-
);
|
|
134
|
-
const largestWidth = Math.max(...widths);
|
|
135
|
-
return {
|
|
136
|
-
"--bk-add-list-width": largestWidth + 90
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
return void 0;
|
|
109
|
+
const isActive = computed(() => {
|
|
110
|
+
return (isHovered.value || hasContextMenuOpen.value || tour.isTouring.value) && !selection.isDragging.value;
|
|
140
111
|
});
|
|
141
112
|
function onMouseEnter() {
|
|
142
|
-
|
|
113
|
+
if (mouseTimeout) {
|
|
114
|
+
clearTimeout(mouseTimeout);
|
|
115
|
+
isHovered.value = true;
|
|
116
|
+
mouseTimeout = null;
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
143
119
|
mouseTimeout = setTimeout(() => {
|
|
144
|
-
|
|
145
|
-
|
|
120
|
+
isHovered.value = true;
|
|
121
|
+
mouseTimeout = null;
|
|
122
|
+
}, 300);
|
|
146
123
|
}
|
|
147
124
|
function onMouseLeave() {
|
|
148
125
|
clearTimeout(mouseTimeout);
|
|
149
|
-
|
|
126
|
+
isHovered.value = false;
|
|
150
127
|
}
|
|
151
128
|
const onWheel = (e) => {
|
|
152
129
|
if (e.ctrlKey || e.metaKey) {
|
|
153
130
|
return;
|
|
154
131
|
}
|
|
155
|
-
|
|
156
|
-
e.stopPropagation();
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
if (ui.addListOrientation.value === "vertical" && e.deltaY) {
|
|
160
|
-
e.stopPropagation();
|
|
161
|
-
}
|
|
132
|
+
e.stopPropagation();
|
|
162
133
|
};
|
|
163
134
|
const sidebarTitle = computed(() => $t("addListSidebarTitle", "Add blocks"));
|
|
164
135
|
const tourText = computed(
|
|
@@ -167,20 +138,6 @@ const tourText = computed(
|
|
|
167
138
|
"<p>This shows the list of available blocks that can be placed. Add a block by dragging the icon into the page.</p><p>When an existing block is selected, some blocks may be greyed out. This indicates which blocks can be placed inside or after the selected block.</p>"
|
|
168
139
|
)
|
|
169
140
|
);
|
|
170
|
-
addElementClasses(
|
|
171
|
-
document.documentElement,
|
|
172
|
-
CLASS_BOTTOM,
|
|
173
|
-
computed(
|
|
174
|
-
() => ui.addListOrientation.value === "horizontal" && shouldRender.value
|
|
175
|
-
)
|
|
176
|
-
);
|
|
177
|
-
addElementClasses(
|
|
178
|
-
document.documentElement,
|
|
179
|
-
CLASS_LEFT,
|
|
180
|
-
computed(
|
|
181
|
-
() => ui.addListOrientation.value === "vertical" && shouldRender.value
|
|
182
|
-
)
|
|
183
|
-
);
|
|
184
141
|
</script>
|
|
185
142
|
|
|
186
143
|
<script>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg
|
|
3
|
+
ref="svgElement"
|
|
4
|
+
viewBox="0 0 24 24"
|
|
5
|
+
fill="none"
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
>
|
|
8
|
+
<defs>
|
|
9
|
+
<mask id="needleMask">
|
|
10
|
+
<rect width="24" height="24" fill="white" />
|
|
11
|
+
<path
|
|
12
|
+
d="M12 1C12 1 15 11 15 13C15 14.6569 13.6569 16 12 16C10.3432 16 9 14.6568 9 13C9 11.0005 11.9984 1.00521 12 1Z"
|
|
13
|
+
fill="black"
|
|
14
|
+
stroke="black"
|
|
15
|
+
stroke-width="3"
|
|
16
|
+
transform="rotate(-100 12 13)"
|
|
17
|
+
>
|
|
18
|
+
<animateTransform
|
|
19
|
+
attributeName="transform"
|
|
20
|
+
type="rotate"
|
|
21
|
+
keyTimes="0; 0.5; 1"
|
|
22
|
+
values="-100 12 13; 100 12 13; -100 12 13"
|
|
23
|
+
dur="2s"
|
|
24
|
+
repeatCount="indefinite"
|
|
25
|
+
calcMode="spline"
|
|
26
|
+
keySplines="0.42 0 0.58 1; 0.42 0 0.58 1"
|
|
27
|
+
/>
|
|
28
|
+
</path>
|
|
29
|
+
</mask>
|
|
30
|
+
</defs>
|
|
31
|
+
|
|
32
|
+
<path
|
|
33
|
+
d="M18.293 19.4316C19.9626 17.7978 21 15.5206 21 13C21 8.02944 16.9706 4 12 4C7.02944 4 3 8.02944 3 13C3 15.522 4.03862 17.8005 5.70996 19.4346"
|
|
34
|
+
stroke="currentColor"
|
|
35
|
+
stroke-width="2"
|
|
36
|
+
stroke-linecap="round"
|
|
37
|
+
mask="url(#needleMask)"
|
|
38
|
+
/>
|
|
39
|
+
<path
|
|
40
|
+
d="M12 1C12 1 15 11 15 13C15 14.6569 13.6569 16 12 16C10.3432 16 9 14.6568 9 13C9 11.0005 11.9984 1.00521 12 1Z"
|
|
41
|
+
fill="currentColor"
|
|
42
|
+
transform="rotate(-100 12 13)"
|
|
43
|
+
>
|
|
44
|
+
<animateTransform
|
|
45
|
+
attributeName="transform"
|
|
46
|
+
type="rotate"
|
|
47
|
+
keyTimes="0; 0.5; 1"
|
|
48
|
+
values="-100 12 13; 100 12 13; -100 12 13"
|
|
49
|
+
dur="2s"
|
|
50
|
+
repeatCount="indefinite"
|
|
51
|
+
calcMode="spline"
|
|
52
|
+
keySplines="0.42 0 0.58 1; 0.42 0 0.58 1"
|
|
53
|
+
/>
|
|
54
|
+
</path>
|
|
55
|
+
</svg>
|
|
56
|
+
</template>
|
|
57
|
+
|
|
58
|
+
<script setup>
|
|
59
|
+
import { useTemplateRef, watch, onMounted } from "#imports";
|
|
60
|
+
const props = defineProps({
|
|
61
|
+
isRunning: { type: Boolean, required: true }
|
|
62
|
+
});
|
|
63
|
+
const svgElement = useTemplateRef("svgElement");
|
|
64
|
+
onMounted(() => {
|
|
65
|
+
if (!svgElement.value) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (!props.isRunning) {
|
|
69
|
+
svgElement.value.pauseAnimations();
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
watch(
|
|
73
|
+
() => props.isRunning,
|
|
74
|
+
(isRunning) => {
|
|
75
|
+
if (!svgElement.value) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (isRunning) {
|
|
79
|
+
svgElement.value.unpauseAnimations();
|
|
80
|
+
} else {
|
|
81
|
+
svgElement.value.pauseAnimations();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
</script>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
isRunning: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
export default _default;
|