@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
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
:option="plugin.option"
|
|
13
13
|
:property="plugin.property"
|
|
14
14
|
:mutated-value="currentValues[plugin.property]"
|
|
15
|
-
:uuids="uuids"
|
|
16
15
|
class="bk-blokkli-item-options-item"
|
|
17
16
|
:class="{
|
|
18
17
|
'bk-is-disabled': isDisabled(plugin)
|
|
@@ -34,7 +33,6 @@
|
|
|
34
33
|
:option="plugin.option"
|
|
35
34
|
:property="plugin.property"
|
|
36
35
|
:mutated-value="currentValues[plugin.property]"
|
|
37
|
-
:uuids="uuids"
|
|
38
36
|
class="bk-blokkli-item-options-item"
|
|
39
37
|
:class="{
|
|
40
38
|
'bk-is-disabled': isDisabled(plugin)
|
|
@@ -57,6 +55,7 @@ import {
|
|
|
57
55
|
BK_HIDDEN_GLOBALLY,
|
|
58
56
|
BK_VISIBLE_LANGUAGES
|
|
59
57
|
} from "#blokkli/helpers/symbols";
|
|
58
|
+
import { BUNDLE_FROM_LIBRARY } from "#blokkli/constants";
|
|
60
59
|
if (import.meta.hot) {
|
|
61
60
|
import.meta.hot.accept("#blokkli/runtime-helpers", () => {
|
|
62
61
|
});
|
|
@@ -102,7 +101,7 @@ const {
|
|
|
102
101
|
definitions
|
|
103
102
|
} = useBlokkli();
|
|
104
103
|
const props = defineProps({
|
|
105
|
-
uuids: { type: Array, required: true },
|
|
104
|
+
uuids: { type: [Array, String], required: true },
|
|
106
105
|
definition: { type: null, required: true }
|
|
107
106
|
});
|
|
108
107
|
let pointerTimeout = null;
|
|
@@ -134,16 +133,18 @@ function stopChangingOptions() {
|
|
|
134
133
|
if (!selection.isChangingOptions.value) {
|
|
135
134
|
return;
|
|
136
135
|
}
|
|
137
|
-
props.uuids
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
136
|
+
if (Array.isArray(props.uuids)) {
|
|
137
|
+
props.uuids.forEach((uuid) => {
|
|
138
|
+
dom.refreshBlockRect(uuid);
|
|
139
|
+
const block = dom.findBlock(uuid);
|
|
140
|
+
if (block) {
|
|
141
|
+
const el = dom.getDragElement(block);
|
|
142
|
+
if (el) {
|
|
143
|
+
theme.invalidateCachedStyle(el);
|
|
144
|
+
}
|
|
144
145
|
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
147
148
|
selection.isChangingOptions.value = false;
|
|
148
149
|
}
|
|
149
150
|
class OptionCollector {
|
|
@@ -205,21 +206,28 @@ function getOptionValue(uuid, key, defaultValue) {
|
|
|
205
206
|
}
|
|
206
207
|
const currentValues = computed(() => {
|
|
207
208
|
return availableOptions.value.reduce((acc, v) => {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
if (Array.isArray(props.uuids)) {
|
|
210
|
+
const values = props.uuids.map((uuid) => {
|
|
211
|
+
return JSON.stringify(
|
|
212
|
+
getRuntimeOptionValue(
|
|
213
|
+
v.option,
|
|
214
|
+
getOptionValue(uuid, v.property, v.option.default)
|
|
215
|
+
)
|
|
216
|
+
);
|
|
217
|
+
}).filter(onlyUnique);
|
|
218
|
+
if (values.length === 1) {
|
|
219
|
+
acc[v.property] = getRuntimeOptionValue(
|
|
211
220
|
v.option,
|
|
212
|
-
getOptionValue(
|
|
213
|
-
)
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
221
|
+
getOptionValue(props.uuids[0], v.property, v.option.default)
|
|
222
|
+
);
|
|
223
|
+
} else {
|
|
224
|
+
acc[v.property] = "";
|
|
225
|
+
}
|
|
226
|
+
} else {
|
|
217
227
|
acc[v.property] = getRuntimeOptionValue(
|
|
218
228
|
v.option,
|
|
219
|
-
getOptionValue(
|
|
229
|
+
getOptionValue("HOST", v.property, v.option.default)
|
|
220
230
|
);
|
|
221
|
-
} else {
|
|
222
|
-
acc[v.property] = "";
|
|
223
231
|
}
|
|
224
232
|
return acc;
|
|
225
233
|
}, {});
|
|
@@ -234,7 +242,7 @@ function isInternalOption(property) {
|
|
|
234
242
|
return property === BK_VISIBLE_LANGUAGES || property === BK_HIDDEN_GLOBALLY;
|
|
235
243
|
}
|
|
236
244
|
const visibleOptions = computed(() => {
|
|
237
|
-
if (!props.definition.editor?.determineVisibleOptions) {
|
|
245
|
+
if (!("editor" in props.definition) || !props.definition.editor?.determineVisibleOptions) {
|
|
238
246
|
return availableOptions.value.filter(filterInternal);
|
|
239
247
|
}
|
|
240
248
|
const uuid = props.uuids[0];
|
|
@@ -244,7 +252,7 @@ const visibleOptions = computed(() => {
|
|
|
244
252
|
return [];
|
|
245
253
|
}
|
|
246
254
|
const parentType = block?.hostType === runtimeConfig.itemEntityType ? block.parentBlockBundle : void 0;
|
|
247
|
-
const ctxProps = item?.bundle ===
|
|
255
|
+
const ctxProps = item?.bundle === BUNDLE_FROM_LIBRARY ? item?.props?.libraryItem?.block?.props : item?.props;
|
|
248
256
|
const visibleKeys = (
|
|
249
257
|
// We have to cast to any here because the types are guaranteed to be correct.
|
|
250
258
|
props.definition.editor.determineVisibleOptions({
|
|
@@ -289,30 +297,53 @@ const optionGroups = computed(() => {
|
|
|
289
297
|
);
|
|
290
298
|
});
|
|
291
299
|
function setOptionValue(key, value) {
|
|
292
|
-
props.uuids
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
state.mutatedOptions[uuid]
|
|
300
|
+
if (Array.isArray(props.uuids)) {
|
|
301
|
+
props.uuids.forEach((uuid) => {
|
|
302
|
+
updated.set(uuid, key, value);
|
|
303
|
+
if (!state.mutatedOptions[uuid]) {
|
|
304
|
+
state.mutatedOptions[uuid] = {};
|
|
305
|
+
}
|
|
306
|
+
state.mutatedOptions[uuid][key] = value;
|
|
307
|
+
eventBus.emit("option:update", { uuid, key, value });
|
|
308
|
+
});
|
|
309
|
+
} else {
|
|
310
|
+
updated.set("HOST", key, value);
|
|
311
|
+
if (!state.mutatedOptions.HOST) {
|
|
312
|
+
state.mutatedOptions.HOST = {};
|
|
296
313
|
}
|
|
297
|
-
state.mutatedOptions[
|
|
298
|
-
|
|
299
|
-
});
|
|
314
|
+
state.mutatedOptions.HOST[key] = value;
|
|
315
|
+
}
|
|
300
316
|
}
|
|
301
317
|
onMounted(() => {
|
|
302
|
-
props.uuids
|
|
318
|
+
if (Array.isArray(props.uuids)) {
|
|
319
|
+
props.uuids.forEach((uuid) => {
|
|
320
|
+
availableOptions.value.forEach((option) => {
|
|
321
|
+
const currentValue = getOptionValue(
|
|
322
|
+
uuid,
|
|
323
|
+
option.property,
|
|
324
|
+
option.option.default
|
|
325
|
+
);
|
|
326
|
+
original.set(
|
|
327
|
+
uuid,
|
|
328
|
+
option.property,
|
|
329
|
+
optionValueToStorable(option.option, currentValue)
|
|
330
|
+
);
|
|
331
|
+
});
|
|
332
|
+
});
|
|
333
|
+
} else {
|
|
303
334
|
availableOptions.value.forEach((option) => {
|
|
304
335
|
const currentValue = getOptionValue(
|
|
305
|
-
|
|
336
|
+
"HOST",
|
|
306
337
|
option.property,
|
|
307
338
|
option.option.default
|
|
308
339
|
);
|
|
309
340
|
original.set(
|
|
310
|
-
|
|
341
|
+
"HOST",
|
|
311
342
|
option.property,
|
|
312
343
|
optionValueToStorable(option.option, currentValue)
|
|
313
344
|
);
|
|
314
345
|
});
|
|
315
|
-
}
|
|
346
|
+
}
|
|
316
347
|
});
|
|
317
348
|
onBeforeUnmount(() => {
|
|
318
349
|
selection.isChangingOptions.value = false;
|
|
@@ -326,7 +357,20 @@ onBeforeUnmount(() => {
|
|
|
326
357
|
if (!values.length) {
|
|
327
358
|
return;
|
|
328
359
|
}
|
|
329
|
-
|
|
360
|
+
if (Array.isArray(props.uuids)) {
|
|
361
|
+
state.mutateWithLoadingState(() => adapter.updateOptions(values));
|
|
362
|
+
} else {
|
|
363
|
+
state.mutateWithLoadingState(
|
|
364
|
+
() => adapter.updateHostOptions(
|
|
365
|
+
values.map((v) => {
|
|
366
|
+
return {
|
|
367
|
+
...v,
|
|
368
|
+
uuid: void 0
|
|
369
|
+
};
|
|
370
|
+
})
|
|
371
|
+
)
|
|
372
|
+
);
|
|
373
|
+
}
|
|
330
374
|
});
|
|
331
375
|
</script>
|
|
332
376
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { BlockDefinitionInput, FragmentDefinitionInput } from '#blokkli/types';
|
|
1
|
+
import type { BlockDefinitionInput, FragmentDefinitionInput, ProviderDefinitionInput } from '#blokkli/types';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<{
|
|
3
|
-
uuids: string[];
|
|
4
|
-
definition: BlockDefinitionInput | FragmentDefinitionInput;
|
|
3
|
+
uuids: string[] | "provider";
|
|
4
|
+
definition: BlockDefinitionInput | FragmentDefinitionInput | ProviderDefinitionInput;
|
|
5
5
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
6
|
-
uuids: string[];
|
|
7
|
-
definition: BlockDefinitionInput | FragmentDefinitionInput;
|
|
6
|
+
uuids: string[] | "provider";
|
|
7
|
+
definition: BlockDefinitionInput | FragmentDefinitionInput | ProviderDefinitionInput;
|
|
8
8
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
9
|
export default _default;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Teleport to="#bk-blokkli-item-actions-controls">
|
|
3
3
|
<OptionsForm
|
|
4
|
-
v-if="
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
:
|
|
4
|
+
v-if="
|
|
5
|
+
definition && !selection.isDragging.value && !ui.isAnimating.value && uuids
|
|
6
|
+
"
|
|
7
|
+
:key="key + state.refreshKey.value + ui.isAnimating.value"
|
|
8
|
+
:uuids
|
|
9
|
+
:definition
|
|
8
10
|
/>
|
|
9
11
|
</Teleport>
|
|
10
12
|
</template>
|
|
@@ -20,9 +22,31 @@ defineBlokkliFeature({
|
|
|
20
22
|
description: "Renders the options form for one or more blocks.",
|
|
21
23
|
requiredAdapterMethods: ["updateOptions"]
|
|
22
24
|
});
|
|
23
|
-
const { selection, state, ui, definitions } = useBlokkli();
|
|
24
|
-
const uuids = computed(() =>
|
|
25
|
+
const { selection, state, ui, definitions, context } = useBlokkli();
|
|
26
|
+
const uuids = computed(() => {
|
|
27
|
+
const uuids2 = selection.blocks.value.map((v) => v.uuid);
|
|
28
|
+
if (uuids2.length) {
|
|
29
|
+
return uuids2;
|
|
30
|
+
} else if (selection.hasHostSelected.value) {
|
|
31
|
+
return "provider";
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
});
|
|
35
|
+
const key = computed(() => {
|
|
36
|
+
if (typeof uuids.value === "string") {
|
|
37
|
+
return uuids.value;
|
|
38
|
+
} else if (uuids.value && typeof uuids.value === "object") {
|
|
39
|
+
return uuids.value.join("-");
|
|
40
|
+
}
|
|
41
|
+
return "none";
|
|
42
|
+
});
|
|
25
43
|
const definition = computed(() => {
|
|
44
|
+
if (uuids.value === "provider") {
|
|
45
|
+
return definitions.getProviderDefinition(
|
|
46
|
+
context.value.entityType,
|
|
47
|
+
context.value.entityBundle
|
|
48
|
+
);
|
|
49
|
+
}
|
|
26
50
|
const bundles = selection.blocks.value.map((v) => v.reusableBundle || v.itemBundle).filter(onlyUnique);
|
|
27
51
|
if (bundles.length !== 1) {
|
|
28
52
|
return;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
/>
|
|
17
17
|
|
|
18
18
|
<Teleport to="body">
|
|
19
|
-
<
|
|
19
|
+
<BlokkliTransition name="slide-up">
|
|
20
20
|
<DialogModal
|
|
21
21
|
v-if="qrCodeVisible"
|
|
22
22
|
:title="$t('previewDialogTitle', 'Preview with smartphone')"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
>
|
|
36
36
|
<QrCode v-if="previewGrantUrl" :url="previewGrantUrl" />
|
|
37
37
|
</DialogModal>
|
|
38
|
-
</
|
|
38
|
+
</BlokkliTransition>
|
|
39
39
|
</Teleport>
|
|
40
40
|
</template>
|
|
41
41
|
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
import { ref, watch, useBlokkli, defineBlokkliFeature } from "#imports";
|
|
44
44
|
import { PluginToolbarButton } from "#blokkli/plugins";
|
|
45
45
|
import QrCode from "./QrCode/index.vue";
|
|
46
|
-
import { DialogModal } from "#blokkli/components";
|
|
46
|
+
import { DialogModal, BlokkliTransition } from "#blokkli/components";
|
|
47
47
|
const { adapter } = defineBlokkliFeature({
|
|
48
48
|
id: "preview-grant",
|
|
49
49
|
label: "Preview Grant",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
<FormGroup title="Einstellungen" horizontal>
|
|
14
14
|
<FormItem v-if="publishOptions?.hasRevisionLogMessage">
|
|
15
15
|
<FormTextarea
|
|
16
|
+
id="revision-message"
|
|
16
17
|
v-model="revisionMessage"
|
|
17
18
|
label="Protokollnachricht der Revision"
|
|
18
19
|
description="Beschreiben Sie kurz die vorgenommenen Änderungen"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
@click="onMenuClick"
|
|
11
11
|
/>
|
|
12
12
|
<Teleport to="body">
|
|
13
|
-
<
|
|
13
|
+
<BlokkliTransition name="slide-up">
|
|
14
14
|
<PublishDialog
|
|
15
15
|
v-if="showDialog"
|
|
16
16
|
v-model:states="additionalEditStates"
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
@close="showDialog = false"
|
|
20
20
|
@submit="onSubmit"
|
|
21
21
|
/>
|
|
22
|
-
</
|
|
22
|
+
</BlokkliTransition>
|
|
23
23
|
</Teleport>
|
|
24
24
|
</template>
|
|
25
25
|
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
ref
|
|
33
33
|
} from "#imports";
|
|
34
34
|
import { PluginMenuButton } from "#blokkli/plugins";
|
|
35
|
+
import { BlokkliTransition } from "#blokkli/components";
|
|
35
36
|
import PublishDialog from "./Dialog/index.vue";
|
|
36
37
|
const { adapter, settings } = defineBlokkliFeature({
|
|
37
38
|
id: "publish",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
/>
|
|
14
14
|
|
|
15
15
|
<Teleport to="body">
|
|
16
|
-
<
|
|
16
|
+
<BlokkliTransition name="slide-up">
|
|
17
17
|
<DialogModal
|
|
18
18
|
v-if="showConfirm"
|
|
19
19
|
:title="$t('revertDialogTitle', 'Irrevocably discard changes')"
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
@submit="onSubmit"
|
|
29
29
|
@cancel="showConfirm = false"
|
|
30
30
|
/>
|
|
31
|
-
</
|
|
31
|
+
</BlokkliTransition>
|
|
32
32
|
</Teleport>
|
|
33
33
|
</template>
|
|
34
34
|
|
|
35
35
|
<script setup>
|
|
36
36
|
import { useBlokkli, ref, defineBlokkliFeature } from "#imports";
|
|
37
37
|
import { PluginMenuButton } from "#blokkli/plugins";
|
|
38
|
-
import { DialogModal } from "#blokkli/components";
|
|
38
|
+
import { DialogModal, BlokkliTransition } from "#blokkli/components";
|
|
39
39
|
const { adapter } = defineBlokkliFeature({
|
|
40
40
|
id: "revert",
|
|
41
41
|
icon: "revert",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Teleport to="body">
|
|
3
|
-
<
|
|
3
|
+
<BlokkliTransition name="search">
|
|
4
4
|
<div
|
|
5
5
|
v-if="isRendered"
|
|
6
6
|
v-show="isVisible"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
@close="isVisible = false"
|
|
16
16
|
/>
|
|
17
17
|
</div>
|
|
18
|
-
</
|
|
18
|
+
</BlokkliTransition>
|
|
19
19
|
</Teleport>
|
|
20
20
|
<PluginToolbarButton
|
|
21
21
|
id="search"
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
<script setup>
|
|
38
38
|
import { nextTick, ref, useBlokkli, defineBlokkliFeature } from "#imports";
|
|
39
39
|
import Overlay from "./Overlay/index.vue";
|
|
40
|
+
import { BlokkliTransition } from "#blokkli/components";
|
|
40
41
|
import { PluginToolbarButton } from "#blokkli/plugins";
|
|
41
42
|
import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
|
|
42
43
|
defineBlokkliFeature({
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button
|
|
3
|
+
ref="button"
|
|
4
|
+
class="bk-selection-add-button bk-is-field"
|
|
5
|
+
tabindex="-1"
|
|
6
|
+
:data-title="title"
|
|
7
|
+
:style="{
|
|
8
|
+
transform: `translate(${left}px, ${top}px)`,
|
|
9
|
+
visibility: isVisible ? 'visible' : 'hidden'
|
|
10
|
+
}"
|
|
11
|
+
@click="onClick"
|
|
12
|
+
>
|
|
13
|
+
<div>
|
|
14
|
+
<Icon name="plus" />
|
|
15
|
+
</div>
|
|
16
|
+
</button>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup>
|
|
20
|
+
import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
|
|
21
|
+
import { useBlokkli, ref, useTemplateRef } from "#imports";
|
|
22
|
+
import { Icon } from "#blokkli/components";
|
|
23
|
+
const props = defineProps({
|
|
24
|
+
fieldKey: { type: null, required: true },
|
|
25
|
+
containerRect: { type: [Object, null], required: true },
|
|
26
|
+
title: { type: String, required: true }
|
|
27
|
+
});
|
|
28
|
+
const emit = defineEmits(["click"]);
|
|
29
|
+
const { dom } = useBlokkli();
|
|
30
|
+
const button = useTemplateRef("button");
|
|
31
|
+
const left = ref(0);
|
|
32
|
+
const top = ref(0);
|
|
33
|
+
const isVisible = ref(false);
|
|
34
|
+
const BUTTON_SIZE = 30;
|
|
35
|
+
function onClick() {
|
|
36
|
+
if (button.value) {
|
|
37
|
+
emit("click", button.value);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
onBlokkliEvent("canvas:draw", () => {
|
|
41
|
+
if (!props.fieldKey || !props.containerRect) {
|
|
42
|
+
isVisible.value = false;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const fieldRect = dom.getFieldRect(props.fieldKey);
|
|
46
|
+
if (!fieldRect) {
|
|
47
|
+
isVisible.value = false;
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
left.value = Math.round(fieldRect.x + fieldRect.width / 2 - BUTTON_SIZE / 2);
|
|
51
|
+
top.value = Math.round(fieldRect.y + fieldRect.height / 2 - BUTTON_SIZE / 2);
|
|
52
|
+
isVisible.value = true;
|
|
53
|
+
});
|
|
54
|
+
</script>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
fieldKey: string | undefined;
|
|
3
|
+
containerRect: {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
} | null;
|
|
7
|
+
title: string;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
click: (element: HTMLElement) => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
onClick?: ((element: HTMLElement) => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref="el"
|
|
4
|
+
class="bk bk-selection-add-overlay"
|
|
5
|
+
:class="'bk-is-' + placementY"
|
|
6
|
+
:style="{
|
|
7
|
+
'--bk-caret-x': caretX
|
|
8
|
+
}"
|
|
9
|
+
>
|
|
10
|
+
<div class="bk bk-selection-add-overlay-inner bk-caret-tooltip-inner">
|
|
11
|
+
<div v-if="label" class="bk-selection-add-overlay-label">
|
|
12
|
+
<div v-html="label" />
|
|
13
|
+
<button @click="$emit('close')">
|
|
14
|
+
<Icon name="close" />
|
|
15
|
+
</button>
|
|
16
|
+
</div>
|
|
17
|
+
<div
|
|
18
|
+
ref="listEl"
|
|
19
|
+
class="bk-selection-add-overlay-list bk-scrollbar-dark"
|
|
20
|
+
@wheel="onWheel"
|
|
21
|
+
>
|
|
22
|
+
<button
|
|
23
|
+
v-for="item in items"
|
|
24
|
+
:key="item.bundle"
|
|
25
|
+
tabindex="-1"
|
|
26
|
+
@click.prevent="$emit('select', item.bundle)"
|
|
27
|
+
>
|
|
28
|
+
<AddListItemIcon
|
|
29
|
+
:bundle="item.bundle"
|
|
30
|
+
:color="item.isFavorite ? 'yellow' : 'default'"
|
|
31
|
+
/>
|
|
32
|
+
<span>{{ item.label }}</span>
|
|
33
|
+
</button>
|
|
34
|
+
<button
|
|
35
|
+
v-for="action in actions"
|
|
36
|
+
:key="'action:' + action.id"
|
|
37
|
+
tabindex="-1"
|
|
38
|
+
@click.prevent="$emit('action', action.id)"
|
|
39
|
+
>
|
|
40
|
+
<AddListItemIcon :icon="action.icon" :color="action.color" />
|
|
41
|
+
<span>{{ action.title }}</span>
|
|
42
|
+
</button>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script setup>
|
|
49
|
+
import useStickyToolbar from "#blokkli/helpers/composables/useStickyToolbar";
|
|
50
|
+
import {
|
|
51
|
+
useTemplateRef,
|
|
52
|
+
useBlokkli,
|
|
53
|
+
computed,
|
|
54
|
+
onMounted,
|
|
55
|
+
onBeforeUnmount
|
|
56
|
+
} from "#imports";
|
|
57
|
+
import { Icon, AddListItemIcon } from "#blokkli/components";
|
|
58
|
+
import { isInternalBundle } from "#blokkli/helpers/bundles";
|
|
59
|
+
const props = defineProps({
|
|
60
|
+
bundles: { type: Array, required: true },
|
|
61
|
+
anchorEl: { type: null, required: true },
|
|
62
|
+
label: { type: String, required: false }
|
|
63
|
+
});
|
|
64
|
+
defineEmits(["select", "action", "close"]);
|
|
65
|
+
const el = useTemplateRef("el");
|
|
66
|
+
const listEl = useTemplateRef("listEl");
|
|
67
|
+
let hasScrollbar = null;
|
|
68
|
+
const { types, ui, plugins, storage } = useBlokkli();
|
|
69
|
+
const favorites = storage.use("blockFavorites", []);
|
|
70
|
+
const { placementY, caretX } = useStickyToolbar(el, {
|
|
71
|
+
getAnchorElement() {
|
|
72
|
+
return props.anchorEl;
|
|
73
|
+
},
|
|
74
|
+
getPlacementY() {
|
|
75
|
+
return "auto";
|
|
76
|
+
},
|
|
77
|
+
getPlacementX() {
|
|
78
|
+
return "center";
|
|
79
|
+
},
|
|
80
|
+
getCaretWidth() {
|
|
81
|
+
return 30;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
const items = computed(() => {
|
|
85
|
+
return props.bundles.filter((bundle) => !isInternalBundle(bundle)).map((bundle) => {
|
|
86
|
+
return {
|
|
87
|
+
bundle,
|
|
88
|
+
label: types.getBlockBundleDefinition(bundle)?.label ?? bundle,
|
|
89
|
+
isFavorite: favorites.value.includes(bundle)
|
|
90
|
+
};
|
|
91
|
+
}).sort((a, b) => {
|
|
92
|
+
if (a.isFavorite && !b.isFavorite) return -1;
|
|
93
|
+
if (!a.isFavorite && b.isFavorite) return 1;
|
|
94
|
+
return a.label.localeCompare(b.label);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
const actions = computed(() => {
|
|
98
|
+
return plugins.getAddActions().filter((action) => {
|
|
99
|
+
if (!action.itemBundle) {
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
return props.bundles.includes(action.itemBundle);
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
const onWheel = (e) => {
|
|
106
|
+
if (hasScrollbar === null) {
|
|
107
|
+
const element = listEl.value;
|
|
108
|
+
hasScrollbar = element && element.scrollHeight > element.clientHeight;
|
|
109
|
+
}
|
|
110
|
+
if (hasScrollbar) {
|
|
111
|
+
e.stopPropagation();
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
onMounted(() => {
|
|
115
|
+
ui.hasAddTooltipOpen.value = true;
|
|
116
|
+
});
|
|
117
|
+
onBeforeUnmount(() => {
|
|
118
|
+
ui.hasAddTooltipOpen.value = false;
|
|
119
|
+
});
|
|
120
|
+
</script>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
bundles: string[];
|
|
3
|
+
anchorEl: HTMLElement;
|
|
4
|
+
label?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
select: (id: string) => void;
|
|
8
|
+
action: (id: string) => void;
|
|
9
|
+
close: () => void;
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
|
+
onClose?: (() => any) | undefined;
|
|
12
|
+
onSelect?: ((id: string) => any) | undefined;
|
|
13
|
+
onAction?: ((id: string) => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
export default _default;
|