@blokkli/editor 2.0.0-alpha.53 → 2.0.0-alpha.55
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/global/constants/index.d.ts +1 -1
- package/dist/global/constants/index.js +1 -1
- package/dist/global/types/features.d.ts +5 -9
- package/dist/module.json +1 -1
- package/dist/module.mjs +28 -35
- package/dist/modules/agent/index.mjs +46 -29
- package/dist/modules/agent/runtime/app/composables/agentProvider.js +2 -1
- package/dist/modules/agent/runtime/app/features/agent/Container.d.vue.ts +19 -0
- package/dist/modules/agent/runtime/app/features/agent/Container.vue +195 -0
- package/dist/modules/agent/runtime/app/features/agent/Container.vue.d.ts +19 -0
- package/dist/modules/agent/runtime/app/features/agent/index.vue +18 -164
- package/dist/modules/agent/runtime/app/features/agent/types.d.ts +9 -0
- package/dist/modules/agent/runtime/app/helpers/index.d.ts +7 -3
- package/dist/modules/agent/runtime/app/helpers/index.js +9 -3
- package/dist/modules/agent/runtime/app/prompts/fixReadability.js +51 -44
- package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.js +2 -1
- package/dist/modules/agent/runtime/app/tools/check_readability/index.js +1 -0
- package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/Component.vue +1 -1
- package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/index.js +6 -1
- package/dist/modules/agent/runtime/app/tools/get_readability_issues/index.js +1 -0
- package/dist/modules/agent/runtime/app/types/index.d.ts +12 -0
- package/dist/modules/charts/runtime/components/ChartRenderer/index.vue +34 -18
- package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliEditState.graphql +7 -0
- package/dist/modules/drupal/graphql/features/droppable-field-items.graphql +22 -0
- package/dist/modules/drupal/graphql/features/import-existing.graphql +0 -25
- package/dist/modules/drupal/graphql/features/workspace.graphql +9 -2
- package/dist/modules/drupal/graphql/mutations/update_droppable_field.graphql +21 -0
- package/dist/modules/drupal/index.mjs +6 -2
- package/dist/modules/drupal/runtime/adapter/index.js +75 -39
- package/dist/modules/readability/index.d.mts +11 -0
- package/dist/modules/readability/index.mjs +17 -0
- package/dist/modules/readability/runtime/adapter-extension.d.ts +2 -0
- package/dist/modules/readability/runtime/adapter-extension.js +5 -0
- package/dist/modules/readability/runtime/analyzers/builtin.d.ts +10 -0
- package/dist/modules/readability/runtime/analyzers/builtin.js +340 -0
- package/dist/runtime/components/BlokkliEditable.vue +10 -90
- package/dist/runtime/components/BlokkliItem.vue +2 -2
- package/dist/runtime/components/BlokkliProvider.vue +11 -5
- package/dist/runtime/composables/defineBlokkli.js +3 -1
- package/dist/runtime/composables/defineBlokkliFeature.d.ts +2 -3
- package/dist/runtime/editor/components/Actions/index.vue +1 -1
- package/dist/runtime/editor/components/AnimationCanvas/index.vue +41 -6
- package/dist/runtime/editor/components/AppMenu/Inner.d.vue.ts +7 -0
- package/dist/runtime/editor/components/AppMenu/Inner.vue +83 -0
- package/dist/runtime/editor/components/AppMenu/Inner.vue.d.ts +7 -0
- package/dist/runtime/editor/components/AppMenu/index.vue +5 -79
- package/dist/runtime/editor/components/ArtboardTooltip/index.d.vue.ts +1 -0
- package/dist/runtime/editor/components/ArtboardTooltip/index.vue +9 -1
- package/dist/runtime/editor/components/ArtboardTooltip/index.vue.d.ts +1 -0
- package/dist/runtime/editor/components/BlockPreviewItem/index.vue +12 -6
- package/dist/runtime/editor/components/BlokkliEditableEdit.d.vue.ts +23 -0
- package/dist/runtime/editor/components/BlokkliEditableEdit.vue +95 -0
- package/dist/runtime/editor/components/BlokkliEditableEdit.vue.d.ts +23 -0
- package/dist/runtime/editor/components/BlokkliRootErrorBoundary.d.vue.ts +4 -1
- package/dist/runtime/editor/components/BlokkliRootErrorBoundary.vue +4 -1
- package/dist/runtime/editor/components/BlokkliRootErrorBoundary.vue.d.ts +4 -1
- package/dist/runtime/editor/components/BundleSelector/index.vue +10 -5
- package/dist/runtime/editor/components/Dialog/index.vue +0 -77
- package/dist/runtime/editor/components/EditIndicator.d.vue.ts +1 -0
- package/dist/runtime/editor/components/EditIndicator.vue +3 -2
- package/dist/runtime/editor/components/EditIndicator.vue.d.ts +1 -0
- package/dist/runtime/editor/components/EditProvider.d.vue.ts +3 -1
- package/dist/runtime/editor/components/EditProvider.vue +13 -4
- package/dist/runtime/editor/components/EditProvider.vue.d.ts +3 -1
- package/dist/runtime/editor/components/FeaturesRenderer/index.vue +1 -4
- package/dist/runtime/editor/components/Form/Text/index.d.vue.ts +5 -0
- package/dist/runtime/editor/components/Form/Text/index.vue +10 -4
- package/dist/runtime/editor/components/Form/Text/index.vue.d.ts +5 -0
- package/dist/runtime/editor/components/FormOverlay/index.vue +0 -24
- package/dist/runtime/editor/components/GrowOnly/index.d.vue.ts +10 -0
- package/dist/runtime/editor/components/GrowOnly/index.vue +34 -0
- package/dist/runtime/editor/components/GrowOnly/index.vue.d.ts +10 -0
- package/dist/runtime/editor/components/Konami/Game/index.vue +120 -0
- package/dist/runtime/editor/components/Konami/index.vue +7 -124
- package/dist/runtime/editor/components/Loading/index.vue +1 -1
- package/dist/runtime/editor/components/PluginConfigForm/Text/index.vue +1 -0
- package/dist/runtime/editor/components/PluginConfigForm/index.vue +1 -0
- package/dist/runtime/editor/components/PreviewProvider.d.vue.ts +3 -1
- package/dist/runtime/editor/components/PreviewProvider.vue +6 -1
- package/dist/runtime/editor/components/PreviewProvider.vue.d.ts +3 -1
- package/dist/runtime/editor/components/Toolbar/index.vue +1 -1
- package/dist/runtime/editor/components/index.d.ts +11 -10
- package/dist/runtime/editor/components/index.js +32 -10
- package/dist/runtime/editor/composables/defineRenderer.d.ts +2 -2
- package/dist/runtime/editor/composables/defineRenderer.js +8 -3
- package/dist/runtime/editor/css/output.css +1 -1
- package/dist/runtime/editor/events/index.d.ts +6 -0
- package/dist/runtime/editor/features/analyze/Main.d.vue.ts +1 -0
- package/dist/runtime/editor/features/analyze/Main.vue +9 -8
- package/dist/runtime/editor/features/analyze/Main.vue.d.ts +1 -0
- package/dist/runtime/editor/features/analyze/Results/ResultsItem.vue +7 -15
- package/dist/runtime/editor/features/analyze/Results/ResultsItemNodesTarget.vue +4 -2
- package/dist/runtime/editor/features/analyze/analyzers/axe.js +9 -9
- package/dist/runtime/editor/features/analyze/analyzers/readability.js +7 -7
- package/dist/runtime/editor/features/analyze/index.vue +26 -26
- package/dist/runtime/editor/features/analyze/readability/types.d.ts +18 -14
- package/dist/runtime/editor/features/anchors/index.vue +6 -2
- package/dist/runtime/editor/features/artboard/Renderer.vue +3 -2
- package/dist/runtime/editor/features/block-scheduler/Dialog/index.vue +78 -0
- package/dist/runtime/editor/features/block-scheduler/index.vue +34 -89
- package/dist/runtime/editor/features/breadcrumbs/index.vue +2 -2
- package/dist/runtime/editor/features/changelog/changelog.json +8 -0
- package/dist/runtime/editor/features/changelog/index.vue +10 -8
- package/dist/runtime/editor/features/clipboard/DropElement/index.vue +152 -0
- package/dist/runtime/editor/features/clipboard/index.vue +13 -159
- package/dist/runtime/editor/features/command-palette/Palette/Item/index.vue +0 -28
- package/dist/runtime/editor/features/command-palette/Palette/index.vue +17 -6
- package/dist/runtime/editor/features/command-palette/index.vue +7 -2
- package/dist/runtime/editor/features/comments/index.vue +6 -3
- package/dist/runtime/editor/features/debug/Main.vue +168 -0
- package/dist/runtime/editor/features/debug/Section/Features.vue +1 -2
- package/dist/runtime/editor/features/debug/index.vue +6 -170
- package/dist/runtime/editor/features/dev-mode/index.vue +2 -1
- package/dist/runtime/editor/features/diff/index.vue +6 -2
- package/dist/runtime/editor/features/dragging-overlay/Renderer/index.vue +15 -16
- package/dist/runtime/editor/features/dragging-overlay/index.vue +4 -3
- package/dist/runtime/editor/features/droppable-field-edit/Overlay/index.d.vue.ts +15 -0
- package/dist/runtime/editor/features/droppable-field-edit/Overlay/index.vue +547 -0
- package/dist/runtime/editor/features/droppable-field-edit/Overlay/index.vue.d.ts +15 -0
- package/dist/runtime/editor/features/droppable-field-edit/index.d.vue.ts +3 -0
- package/dist/runtime/editor/features/droppable-field-edit/index.vue +231 -0
- package/dist/runtime/editor/features/droppable-field-edit/index.vue.d.ts +3 -0
- package/dist/runtime/editor/features/droppable-field-edit/types.d.ts +70 -0
- package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.d.vue.ts +1 -0
- package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.vue +34 -21
- package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.vue.d.ts +1 -0
- package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.d.vue.ts +2 -2
- package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.vue.d.ts +2 -2
- package/dist/runtime/editor/features/editable-field/Overlay/ReadabilityIndicator/ChunkOverlay.vue +1 -1
- package/dist/runtime/editor/features/editable-field/Overlay/ReadabilityIndicator/index.vue +6 -13
- package/dist/runtime/editor/features/editable-field/Overlay/index.vue +4 -4
- package/dist/runtime/editor/features/fragments/index.vue +9 -4
- package/dist/runtime/editor/features/help/index.vue +7 -2
- package/dist/runtime/editor/features/highlights/Renderer/index.vue +11 -17
- package/dist/runtime/editor/features/history/index.vue +3 -2
- package/dist/runtime/editor/features/hover/Renderer/index.vue +87 -36
- package/dist/runtime/editor/features/hover/Renderer/vertex.glsl +5 -5
- package/dist/runtime/editor/features/hover/index.vue +1 -1
- package/dist/runtime/editor/features/import-existing/Dialog/Item.d.vue.ts +5 -0
- package/dist/runtime/editor/features/import-existing/Dialog/Item.vue +55 -0
- package/dist/runtime/editor/features/import-existing/Dialog/Item.vue.d.ts +5 -0
- package/dist/runtime/editor/features/import-existing/Dialog/index.d.vue.ts +7 -3
- package/dist/runtime/editor/features/import-existing/Dialog/index.vue +107 -65
- package/dist/runtime/editor/features/import-existing/Dialog/index.vue.d.ts +7 -3
- package/dist/runtime/editor/features/import-existing/index.vue +19 -6
- package/dist/runtime/editor/features/import-existing/types.d.ts +0 -11
- package/dist/runtime/editor/features/library/ReusableDialog/index.vue +7 -33
- package/dist/runtime/editor/features/library/index.vue +14 -5
- package/dist/runtime/editor/features/media-library/Library/index.vue +3 -1
- package/dist/runtime/editor/features/media-library/index.vue +9 -2
- package/dist/runtime/editor/features/media-library/types.d.ts +2 -0
- package/dist/runtime/editor/features/multi-select/Renderer/index.vue +16 -15
- package/dist/runtime/editor/features/multi-select/index.vue +9 -3
- package/dist/runtime/editor/features/options/Form/Radios/index.vue +4 -8
- package/dist/runtime/editor/features/options/index.vue +7 -2
- package/dist/runtime/editor/features/preview-grant/index.vue +8 -2
- package/dist/runtime/editor/features/publish/index.vue +3 -2
- package/dist/runtime/editor/features/referenced-entities/index.vue +7 -2
- package/dist/runtime/editor/features/responsive-preview/index.vue +13 -11
- package/dist/runtime/editor/features/search/index.vue +6 -2
- package/dist/runtime/editor/features/selection/AddButtons/Renderer/index.vue +6 -11
- package/dist/runtime/editor/features/selection/Renderer/index.vue +9 -14
- package/dist/runtime/editor/features/selection/index.vue +7 -4
- package/dist/runtime/editor/features/settings/index.vue +8 -3
- package/dist/runtime/editor/features/structure/index.vue +3 -2
- package/dist/runtime/editor/features/templates/CreateDialog/index.vue +1 -0
- package/dist/runtime/editor/features/templates/index.vue +14 -6
- package/dist/runtime/editor/features/theme/index.vue +2 -1
- package/dist/runtime/editor/features/tour/index.vue +6 -2
- package/dist/runtime/editor/features/translations/index.vue +7 -4
- package/dist/runtime/editor/features/workspace/Overlay/Item.d.vue.ts +3 -0
- package/dist/runtime/editor/features/workspace/Overlay/Item.vue +49 -0
- package/dist/runtime/editor/features/workspace/Overlay/Item.vue.d.ts +3 -0
- package/dist/runtime/editor/features/workspace/Overlay/index.vue +16 -104
- package/dist/runtime/editor/features/workspace/index.vue +6 -2
- package/dist/runtime/editor/helpers/webgl/index.d.ts +3 -2
- package/dist/runtime/editor/helpers/webgl/index.js +2 -3
- package/dist/runtime/editor/libraries/fzf.d.ts +3 -0
- package/dist/runtime/editor/libraries/fzf.js +7 -0
- package/dist/runtime/editor/libraries/twgl.d.ts +10 -0
- package/dist/runtime/editor/libraries/twgl.js +14 -0
- package/dist/runtime/editor/plugins/DebugOverlay/index.vue +3 -1
- package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue +39 -18
- package/dist/runtime/editor/plugins/Sidebar/index.d.vue.ts +2 -0
- package/dist/runtime/editor/plugins/Sidebar/index.vue +12 -4
- package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +2 -0
- package/dist/runtime/editor/providers/animation.d.ts +5 -10
- package/dist/runtime/editor/providers/animation.js +10 -8
- package/dist/runtime/editor/providers/directive.d.ts +11 -0
- package/dist/runtime/editor/providers/directive.js +16 -0
- package/dist/runtime/editor/providers/features.d.ts +3 -3
- package/dist/runtime/editor/providers/features.js +1 -1
- package/dist/runtime/editor/providers/fieldValue.d.ts +27 -0
- package/dist/runtime/editor/providers/fieldValue.js +21 -1
- package/dist/runtime/editor/providers/keyboard.js +6 -3
- package/dist/runtime/editor/providers/readability.d.ts +28 -4
- package/dist/runtime/editor/providers/readability.js +30 -46
- package/dist/runtime/editor/providers/selection.d.ts +8 -0
- package/dist/runtime/editor/providers/selection.js +6 -0
- package/dist/runtime/editor/providers/texts.d.ts +1 -3
- package/dist/runtime/editor/providers/texts.js +34 -37
- package/dist/runtime/editor/providers/workspaces.d.ts +93 -0
- package/dist/runtime/editor/providers/workspaces.js +76 -0
- package/dist/runtime/editor/translations/de.json +918 -3616
- package/dist/runtime/editor/translations/fr.json +250 -3616
- package/dist/runtime/editor/translations/gsw_CH.json +918 -3616
- package/dist/runtime/editor/translations/it.json +250 -3616
- package/dist/runtime/editor/types/app.d.ts +2 -0
- package/dist/runtime/editor/types/features.d.ts +1 -1
- package/dist/runtime/editor/types/state.d.ts +7 -0
- package/dist/runtime/helpers/injections.d.ts +6 -0
- package/dist/runtime/helpers/injections.js +3 -0
- package/dist/runtime/types/definitions.d.ts +4 -0
- package/package.json +14 -4
- package/dist/runtime/editor/features/analyze/readability/builtinAnalyzer.d.ts +0 -6
- package/dist/runtime/editor/features/analyze/readability/builtinAnalyzer.js +0 -216
- package/dist/runtime/editor/features/workspace/types.d.ts +0 -59
- /package/dist/runtime/editor/features/{workspace → droppable-field-edit}/types.js +0 -0
|
@@ -1,102 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<component
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
>
|
|
7
|
-
<slot :value="renderedValue" />
|
|
2
|
+
<component :is="EditComponent ?? tag" v-bind="editProps">
|
|
3
|
+
<template #default="slotProps">
|
|
4
|
+
<slot :value="slotProps?.value ?? value" />
|
|
5
|
+
</template>
|
|
8
6
|
</component>
|
|
9
7
|
</template>
|
|
10
8
|
|
|
11
9
|
<script setup>
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
computed,
|
|
15
|
-
inject,
|
|
16
|
-
onMounted,
|
|
17
|
-
onBeforeUnmount,
|
|
18
|
-
useTemplateRef,
|
|
19
|
-
watch
|
|
20
|
-
} from "#imports";
|
|
21
|
-
import {
|
|
22
|
-
INJECT_APP,
|
|
23
|
-
INJECT_EDIT_CONTEXT,
|
|
24
|
-
INJECT_ENTITY_CONTEXT,
|
|
25
|
-
INJECT_IS_EDITING,
|
|
26
|
-
INJECT_IS_IN_REUSABLE
|
|
27
|
-
} from "#blokkli/helpers/injections";
|
|
10
|
+
import { inject, computed } from "#imports";
|
|
11
|
+
import { INJECT_EDIT_EDITABLE_COMPONENT } from "#blokkli/helpers/injections";
|
|
28
12
|
const props = defineProps({
|
|
29
13
|
name: { type: [String, null], required: false, default: null },
|
|
30
14
|
value: { type: String, required: false, default: "" },
|
|
31
15
|
tag: { type: String, required: false, default: "div" }
|
|
32
16
|
});
|
|
33
17
|
defineSlots();
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
let getValueCallback = function() {
|
|
39
|
-
return props.value;
|
|
40
|
-
}, onStateReloaded = function() {
|
|
41
|
-
valueOverride.value = "";
|
|
42
|
-
}, registerDirective = function(name) {
|
|
43
|
-
if (!name || !app || !(root.value instanceof HTMLElement) || !entity) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
app.directive.registerDirectiveElement(
|
|
47
|
-
root.value,
|
|
48
|
-
name,
|
|
49
|
-
entity,
|
|
50
|
-
"editable",
|
|
51
|
-
true,
|
|
52
|
-
getValueCallback
|
|
53
|
-
);
|
|
54
|
-
}, unregisterDirective = function(name) {
|
|
55
|
-
if (!name || !app || !(root.value instanceof HTMLElement) || !entity) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
app.directive.unregisterDirectiveElement(
|
|
59
|
-
root.value,
|
|
60
|
-
name,
|
|
61
|
-
entity,
|
|
62
|
-
"editable"
|
|
63
|
-
);
|
|
64
|
-
};
|
|
65
|
-
const root = useTemplateRef("root");
|
|
66
|
-
const isEditing = inject(INJECT_IS_EDITING, false);
|
|
67
|
-
const entity = inject(INJECT_ENTITY_CONTEXT, null);
|
|
68
|
-
const editContext = inject(INJECT_EDIT_CONTEXT, null);
|
|
69
|
-
const app = inject(INJECT_APP, null);
|
|
70
|
-
const isInReusable = inject(INJECT_IS_IN_REUSABLE, false);
|
|
71
|
-
const onEditableUpdateValue = (e) => {
|
|
72
|
-
if (e.name === props.name && e.entityUuid === entity?.uuid) {
|
|
73
|
-
valueOverride.value = e.value;
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
onMounted(() => {
|
|
77
|
-
if (!isEditing || !editContext || !app || isInReusable) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
editContext.eventBus.on("editable:update", onEditableUpdateValue);
|
|
81
|
-
editContext.eventBus.on("state:reloaded", onStateReloaded);
|
|
82
|
-
registerDirective(props.name);
|
|
83
|
-
});
|
|
84
|
-
watch(
|
|
85
|
-
() => props.name,
|
|
86
|
-
(newName, oldName) => {
|
|
87
|
-
if (!isEditing || !app || !entity || isInReusable) {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
unregisterDirective(oldName);
|
|
91
|
-
registerDirective(newName);
|
|
92
|
-
}
|
|
93
|
-
);
|
|
94
|
-
onBeforeUnmount(() => {
|
|
95
|
-
if (editContext) {
|
|
96
|
-
editContext.eventBus.off("editable:update", onEditableUpdateValue);
|
|
97
|
-
editContext.eventBus.off("state:reloaded", onStateReloaded);
|
|
98
|
-
}
|
|
99
|
-
unregisterDirective(props.name);
|
|
100
|
-
});
|
|
101
|
-
}
|
|
18
|
+
const EditComponent = inject(INJECT_EDIT_EDITABLE_COMPONENT, null);
|
|
19
|
+
const editProps = computed(
|
|
20
|
+
() => EditComponent ? { name: props.name, value: props.value, tag: props.tag } : {}
|
|
21
|
+
);
|
|
102
22
|
</script>
|
|
@@ -82,7 +82,7 @@ const itemProps = computed(() => {
|
|
|
82
82
|
}
|
|
83
83
|
return componentProps.props;
|
|
84
84
|
});
|
|
85
|
-
const component = isProxyMode || isGlobalProxyMode?.value ? defineAsyncComponent(
|
|
85
|
+
const component = (isProxyMode || isGlobalProxyMode?.value) && isEditingComponent && import.meta.client ? defineAsyncComponent(
|
|
86
86
|
() => import("./../editor/components/BlockProxy/index.vue")
|
|
87
87
|
) : getComponent(
|
|
88
88
|
"block",
|
|
@@ -94,7 +94,7 @@ const component = isProxyMode || isGlobalProxyMode?.value ? defineAsyncComponent
|
|
|
94
94
|
},
|
|
95
95
|
allComponentsChunk
|
|
96
96
|
);
|
|
97
|
-
const blockNotImplemented = isEditingComponent ? defineAsyncComponent(() => import("./Blocks/NotImplemented/index.vue")) : null;
|
|
97
|
+
const blockNotImplemented = isEditingComponent && import.meta.client ? defineAsyncComponent(() => import("./Blocks/NotImplemented/index.vue")) : null;
|
|
98
98
|
const index = computed(() => componentProps.index);
|
|
99
99
|
const item = computed(() => ({
|
|
100
100
|
index,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<Component
|
|
3
|
+
:is="tag"
|
|
3
4
|
ref="providerEl"
|
|
4
5
|
:data-provider-uuid="entityUuid"
|
|
5
6
|
:data-provider-entity-type="entityType"
|
|
@@ -7,7 +8,7 @@
|
|
|
7
8
|
:data-blokkli-provider-active="isInEditor ? 'true' : 'false'"
|
|
8
9
|
>
|
|
9
10
|
<ClientOnly v-if="isInEditor">
|
|
10
|
-
<BlokkliRootErrorBoundary>
|
|
11
|
+
<BlokkliRootErrorBoundary :language>
|
|
11
12
|
<PreviewProvider
|
|
12
13
|
v-if="isPreviewing"
|
|
13
14
|
v-slot="{ mutatedEntity }"
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
:entity-bundle
|
|
18
19
|
:language
|
|
19
20
|
:provider-type
|
|
21
|
+
@ready="isReady = true"
|
|
20
22
|
>
|
|
21
23
|
<slot
|
|
22
24
|
:entity="mutatedEntity"
|
|
@@ -37,6 +39,7 @@
|
|
|
37
39
|
:isolate
|
|
38
40
|
:permissions
|
|
39
41
|
:provider-type
|
|
42
|
+
@ready="isReady = true"
|
|
40
43
|
>
|
|
41
44
|
<slot
|
|
42
45
|
:is-editing
|
|
@@ -46,6 +49,7 @@
|
|
|
46
49
|
/>
|
|
47
50
|
</EditProvider>
|
|
48
51
|
</BlokkliRootErrorBoundary>
|
|
52
|
+
<div v-if="!isReady" style="height: 100vh" />
|
|
49
53
|
</ClientOnly>
|
|
50
54
|
|
|
51
55
|
<slot
|
|
@@ -63,10 +67,11 @@
|
|
|
63
67
|
:entity-type
|
|
64
68
|
:edit-label
|
|
65
69
|
:permissions
|
|
70
|
+
:language
|
|
66
71
|
@edit="edit"
|
|
67
72
|
/>
|
|
68
73
|
</ClientOnly>
|
|
69
|
-
</
|
|
74
|
+
</Component>
|
|
70
75
|
</template>
|
|
71
76
|
|
|
72
77
|
<script setup>
|
|
@@ -110,13 +115,14 @@ const EditProvider = import.meta.client ? defineAsyncComponent(
|
|
|
110
115
|
) : null;
|
|
111
116
|
const BlokkliRootErrorBoundary = import.meta.client ? defineAsyncComponent(
|
|
112
117
|
() => import("./../editor/components/BlokkliRootErrorBoundary.vue")
|
|
113
|
-
) :
|
|
118
|
+
) : null;
|
|
114
119
|
const EditIndicator = import.meta.client ? defineAsyncComponent(
|
|
115
120
|
() => import("./../editor/components/EditIndicator.vue")
|
|
116
|
-
) :
|
|
121
|
+
) : null;
|
|
117
122
|
const route = useRoute();
|
|
118
123
|
const router = useRouter();
|
|
119
124
|
const shouldRender = ref(false);
|
|
125
|
+
const isReady = ref(false);
|
|
120
126
|
const isInEditor = computed(
|
|
121
127
|
() => isClient && !!props.entityUuid && !!props.entityType && !!props.entityBundle && (isPreviewing.value || isEditing.value)
|
|
122
128
|
);
|
|
@@ -96,6 +96,7 @@ export function defineBlokkli(arg) {
|
|
|
96
96
|
editContext.useBlockRegistration(editContext.dom, reusableUuid ?? uuid);
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
+
const isSelected = editContext ? computed(() => editContext.selectedUuids.value.includes(uuid)) : void 0;
|
|
99
100
|
return {
|
|
100
101
|
uuid,
|
|
101
102
|
index,
|
|
@@ -105,6 +106,7 @@ export function defineBlokkli(arg) {
|
|
|
105
106
|
fieldListType,
|
|
106
107
|
siblings,
|
|
107
108
|
rootBlocks,
|
|
108
|
-
provider
|
|
109
|
+
provider,
|
|
110
|
+
isSelected
|
|
109
111
|
};
|
|
110
112
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type ComputedRef } from '#imports';
|
|
2
2
|
import type { FullBlokkliAdapter, AdapterMethods } from '#blokkli/editor/adapter';
|
|
3
|
-
import type { ValidFeatureKey } from '#blokkli-build/features';
|
|
4
3
|
import type { DebugLogger } from '#blokkli/editor/providers/debug';
|
|
5
4
|
import type { AdaptersProvider } from '#blokkli/editor/providers/adapters';
|
|
6
5
|
import type { FeatureDefinition } from '#blokkli/editor/types/features';
|
|
@@ -17,11 +16,11 @@ type SettingsTypes<S> = {
|
|
|
17
16
|
[P in keyof S]: SettingType<S[P]>;
|
|
18
17
|
};
|
|
19
18
|
type RequireAdapterMethods<T extends FullBlokkliAdapter<any>, Methods extends readonly AdapterMethods[]> = Omit<T, Methods[number]> & Required<Pick<T, Methods[number] & keyof T>>;
|
|
20
|
-
type DefineBlokkliFeature<F extends FeatureDefinition<any
|
|
19
|
+
type DefineBlokkliFeature<F extends FeatureDefinition<any>> = {
|
|
21
20
|
adapter: F['requiredAdapterMethods'] extends readonly AdapterMethods[] ? RequireAdapterMethods<FullBlokkliAdapter<any>, F['requiredAdapterMethods']> : FullBlokkliAdapter<any>;
|
|
22
21
|
adapters: AdaptersProvider;
|
|
23
22
|
settings: ComputedRef<SettingsTypes<F['settings']>>;
|
|
24
23
|
logger: DebugLogger;
|
|
25
24
|
};
|
|
26
|
-
export declare function defineBlokkliFeature<const F extends FeatureDefinition<AdapterMethods[]
|
|
25
|
+
export declare function defineBlokkliFeature<const F extends FeatureDefinition<AdapterMethods[]>>(feature: F): DefineBlokkliFeature<F>;
|
|
27
26
|
export {};
|
|
@@ -202,7 +202,7 @@ const hasAnythingSelected = computed(
|
|
|
202
202
|
() => selection.hasHostSelected.value || !!selection.items.value.length
|
|
203
203
|
);
|
|
204
204
|
const isVisible = computed(() => {
|
|
205
|
-
return !selection.isDragging.value && !selection.
|
|
205
|
+
return !selection.isDragging.value && !selection.activeFieldLabel.value && !ui.isAnimating.value && !ui.hasTransformOverlayOpen.value && hasAnythingSelected.value && !ui.hasTooltipOpen.value && !ui.isApproving.value;
|
|
206
206
|
});
|
|
207
207
|
watch(selection.items, () => {
|
|
208
208
|
showDropdown.value = false;
|
|
@@ -47,7 +47,8 @@ const {
|
|
|
47
47
|
directive,
|
|
48
48
|
blocks,
|
|
49
49
|
fields,
|
|
50
|
-
permissions
|
|
50
|
+
permissions,
|
|
51
|
+
types
|
|
51
52
|
} = useBlokkli();
|
|
52
53
|
function onCanvasFocus() {
|
|
53
54
|
ui.setCanvasFocused(true);
|
|
@@ -113,7 +114,8 @@ function getInteractedElement(e) {
|
|
|
113
114
|
deepestUuid = uuid;
|
|
114
115
|
}
|
|
115
116
|
}
|
|
116
|
-
const
|
|
117
|
+
const skipFields = keyboard.isPressingControl.value;
|
|
118
|
+
const editableField = skipFields ? null : directive.getEditableAtPoint(x, y);
|
|
117
119
|
if (editableField) {
|
|
118
120
|
const editableUuid = editableField.type === itemEntityType ? editableField.uuid : void 0;
|
|
119
121
|
const canEdit = !editableUuid || permissions.checkBlockBundlePermission(editableField.bundle, "edit") && !permissions.blockHasRestrictedAncestor(editableUuid);
|
|
@@ -127,6 +129,27 @@ function getInteractedElement(e) {
|
|
|
127
129
|
};
|
|
128
130
|
}
|
|
129
131
|
}
|
|
132
|
+
const droppableField = skipFields ? null : directive.getDroppableAtPoint(x, y);
|
|
133
|
+
if (droppableField) {
|
|
134
|
+
const config = types.getDroppableFieldConfig(
|
|
135
|
+
droppableField.fieldName,
|
|
136
|
+
droppableField
|
|
137
|
+
);
|
|
138
|
+
if (config.type === "reference") {
|
|
139
|
+
const droppableUuid = droppableField.type === itemEntityType ? droppableField.uuid : void 0;
|
|
140
|
+
if (!droppableUuid || droppableUuid === deepestUuid) {
|
|
141
|
+
return {
|
|
142
|
+
droppableFieldName: droppableField.fieldName,
|
|
143
|
+
droppableEntityType: droppableField.type,
|
|
144
|
+
droppableEntityUuid: droppableField.uuid,
|
|
145
|
+
uuid: droppableUuid,
|
|
146
|
+
timestamp: Date.now(),
|
|
147
|
+
x,
|
|
148
|
+
y
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
130
153
|
if (deepestUuid) {
|
|
131
154
|
const restrictedAncestor = permissions.getRestrictedAncestor(deepestUuid);
|
|
132
155
|
return {
|
|
@@ -219,6 +242,9 @@ function onPointerDown(e) {
|
|
|
219
242
|
}
|
|
220
243
|
keyboard.setShortcutStateFromEvent(e);
|
|
221
244
|
canvasEl.value?.removeEventListener("pointermove", onPointerMove);
|
|
245
|
+
if (selection.activeFieldLabel.value) {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
222
248
|
if (ui.openTooltip.value) {
|
|
223
249
|
return;
|
|
224
250
|
}
|
|
@@ -267,7 +293,7 @@ function onPointerUp(e) {
|
|
|
267
293
|
e.preventDefault();
|
|
268
294
|
e.stopPropagation();
|
|
269
295
|
e.stopImmediatePropagation();
|
|
270
|
-
if (ui.openTooltip.value && !selection.
|
|
296
|
+
if (ui.openTooltip.value && !selection.activeFieldLabel.value) {
|
|
271
297
|
ui.openTooltip.value = "";
|
|
272
298
|
return;
|
|
273
299
|
}
|
|
@@ -296,7 +322,7 @@ function onPointerUp(e) {
|
|
|
296
322
|
if (keyboard.isPressingSpace.value) {
|
|
297
323
|
return;
|
|
298
324
|
}
|
|
299
|
-
if (selection.
|
|
325
|
+
if (selection.activeFieldLabel.value) {
|
|
300
326
|
if (pointerDownOnCanvas) {
|
|
301
327
|
eventBus.emit("window:clickAway");
|
|
302
328
|
lastInteractedElement = null;
|
|
@@ -308,7 +334,7 @@ function onPointerUp(e) {
|
|
|
308
334
|
return;
|
|
309
335
|
}
|
|
310
336
|
const clicked = getInteractedElement(e);
|
|
311
|
-
if (clicked && pointerUpTimestamp && lastInteractedElement && (clicked.uuid === lastInteractedElement.uuid || clicked.editableFieldName === lastInteractedElement.editableFieldName)) {
|
|
337
|
+
if (clicked && pointerUpTimestamp && lastInteractedElement && (clicked.uuid === lastInteractedElement.uuid || clicked.editableFieldName === lastInteractedElement.editableFieldName || clicked.droppableFieldName === lastInteractedElement.droppableFieldName)) {
|
|
312
338
|
const deltaTime = Date.now() - pointerUpTimestamp;
|
|
313
339
|
const deltaX = Math.abs(lastInteractedElement.x - e.clientX);
|
|
314
340
|
const deltaY = Math.abs(lastInteractedElement.y - e.clientY);
|
|
@@ -321,6 +347,15 @@ function onPointerUp(e) {
|
|
|
321
347
|
});
|
|
322
348
|
return;
|
|
323
349
|
}
|
|
350
|
+
if (clicked.droppableFieldName && clicked.droppableEntityUuid && clicked.droppableEntityType) {
|
|
351
|
+
pointerDownOnCanvas = false;
|
|
352
|
+
eventBus.emit("droppable:open", {
|
|
353
|
+
fieldName: clicked.droppableFieldName,
|
|
354
|
+
uuid: clicked.droppableEntityUuid,
|
|
355
|
+
entityType: clicked.droppableEntityType
|
|
356
|
+
});
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
324
359
|
if (lastInteractedElement.uuid) {
|
|
325
360
|
const block = blocks.getBlock(lastInteractedElement.uuid);
|
|
326
361
|
if (!block) {
|
|
@@ -471,7 +506,7 @@ function onClick(e) {
|
|
|
471
506
|
}
|
|
472
507
|
return;
|
|
473
508
|
}
|
|
474
|
-
if (canvasEl.value && !selection.
|
|
509
|
+
if (canvasEl.value && !selection.activeFieldLabel.value && !ui.hasTooltipOpen.value) {
|
|
475
510
|
canvasEl.value.focus();
|
|
476
511
|
}
|
|
477
512
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
2
|
+
close: () => any;
|
|
3
|
+
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
4
|
+
onClose?: (() => any) | undefined;
|
|
5
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="bk _bk_fixed _bk_inset-y-0 _bk_left-0 _bk_bg-white _bk_shadow-lg _bk_max-w-[480px] _bk_lg:min-w-[400px] _bk_flex _bk_flex-col _bk_pointer-events-auto _bk_z-menu _bk_w-[calc(100vw-40px)]"
|
|
4
|
+
@wheel.passive.stop
|
|
5
|
+
@touchstart.stop.passive
|
|
6
|
+
@touchmove.stop.passive
|
|
7
|
+
>
|
|
8
|
+
<button
|
|
9
|
+
class="_bk_h-40 _bk_md:h-50 _bk_flex _bk_items-center _bk_text-base _bk_font-bold _bk_pl-15 _bk_md:pl-25 _bk_bg-white _bk_text-mono-950"
|
|
10
|
+
@click="$emit('close')"
|
|
11
|
+
>
|
|
12
|
+
<Icon name="bk_mdi_close" class="_bk_size-20 _bk_md:size-30 _bk_mr-25" />
|
|
13
|
+
</button>
|
|
14
|
+
<div class="_bk_flex-1 _bk_overflow-auto _bk_flex _bk_flex-col">
|
|
15
|
+
<div id="bk-menu-primary" class="_bk_grid _bk_border-t _bk_border-t-mono-200">
|
|
16
|
+
<MenuButton
|
|
17
|
+
v-for="button in primaryButtons"
|
|
18
|
+
:id="button.id"
|
|
19
|
+
:key="button.id"
|
|
20
|
+
:title="button.title"
|
|
21
|
+
:description="button.description"
|
|
22
|
+
:icon="button.icon"
|
|
23
|
+
:type="button.type"
|
|
24
|
+
:disabled="button.disabled"
|
|
25
|
+
@click="onClick(button)"
|
|
26
|
+
/>
|
|
27
|
+
</div>
|
|
28
|
+
<div id="bk-menu-secondary" class="_bk_mt-auto">
|
|
29
|
+
<MenuButton
|
|
30
|
+
v-for="button in secondaryButtons"
|
|
31
|
+
:id="button.id"
|
|
32
|
+
:key="button.id"
|
|
33
|
+
:title="button.title"
|
|
34
|
+
:description="button.description"
|
|
35
|
+
:icon="button.icon"
|
|
36
|
+
:type="button.type"
|
|
37
|
+
:disabled="button.disabled"
|
|
38
|
+
@click="onClick(button)"
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
<aside
|
|
42
|
+
class="_bk_px-15 _bk_py-10 _bk_text-xs _bk_bg-mono-100 _bk_text-mono-600 _bk_items-center _bk_leading-none _bk_flex _bk_justify-between"
|
|
43
|
+
>
|
|
44
|
+
<div class="_bk_flex _bk_gap-5 _bk_items-center">
|
|
45
|
+
<Icon
|
|
46
|
+
name="logo"
|
|
47
|
+
class="_bk_bg-accent-700 _bk_size-20 _bk_flex _bk_items-center _bk_justify-center _bk_rounded _bk_text-white"
|
|
48
|
+
/>
|
|
49
|
+
<div><strong>@blokkli/editor</strong> {{ blokkliVersion }}</div>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<div>
|
|
53
|
+
<a
|
|
54
|
+
href="https://www.blokk.li"
|
|
55
|
+
target="_blank"
|
|
56
|
+
class="_bk_hover:text-accent-700 _bk_hover:underline"
|
|
57
|
+
>blokk.li</a
|
|
58
|
+
>
|
|
59
|
+
</div>
|
|
60
|
+
</aside>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</template>
|
|
64
|
+
|
|
65
|
+
<script setup>
|
|
66
|
+
import { computed, useBlokkli } from "#imports";
|
|
67
|
+
import { Icon } from "#blokkli/editor/components";
|
|
68
|
+
import { blokkliVersion } from "#blokkli-build/editor-config";
|
|
69
|
+
import MenuButton from "./MenuButton.vue";
|
|
70
|
+
const { plugins } = useBlokkli();
|
|
71
|
+
const emit = defineEmits(["close"]);
|
|
72
|
+
const allButtons = computed(() => plugins.get("menuButton"));
|
|
73
|
+
const primaryButtons = computed(() => {
|
|
74
|
+
return allButtons.value.filter((button) => !button.secondary).sort((a, b) => (a.weight || 0) - (b.weight || 0));
|
|
75
|
+
});
|
|
76
|
+
const secondaryButtons = computed(() => {
|
|
77
|
+
return allButtons.value.filter((button) => button.secondary).sort((a, b) => (a.weight || 0) - (b.weight || 0));
|
|
78
|
+
});
|
|
79
|
+
function onClick(button) {
|
|
80
|
+
button.callback();
|
|
81
|
+
emit("close");
|
|
82
|
+
}
|
|
83
|
+
</script>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
2
|
+
close: () => any;
|
|
3
|
+
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
4
|
+
onClose?: (() => any) | undefined;
|
|
5
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -1,95 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<BlokkliTransition name="menu">
|
|
3
|
-
<
|
|
4
|
-
v-if="menuOpen"
|
|
5
|
-
class="bk _bk_fixed _bk_inset-y-0 _bk_left-0 _bk_bg-white _bk_shadow-lg _bk_max-w-[480px] _bk_lg:min-w-[400px] _bk_flex _bk_flex-col _bk_pointer-events-auto _bk_z-menu _bk_w-[calc(100vw-40px)]"
|
|
6
|
-
@wheel.passive.stop
|
|
7
|
-
@touchstart.stop.passive
|
|
8
|
-
@touchmove.stop.passive
|
|
9
|
-
>
|
|
10
|
-
<button
|
|
11
|
-
:class="{ 'bk-is-active': menuOpen }"
|
|
12
|
-
class="_bk_h-40 _bk_md:h-50 _bk_flex _bk_items-center _bk_text-base _bk_font-bold _bk_pl-15 _bk_md:pl-25 _bk_bg-white _bk_text-mono-950"
|
|
13
|
-
@click="closeMenu"
|
|
14
|
-
>
|
|
15
|
-
<Icon name="bk_mdi_close" class="_bk_size-20 _bk_md:size-30 _bk_mr-25" />
|
|
16
|
-
</button>
|
|
17
|
-
<div class="_bk_flex-1 _bk_overflow-auto _bk_flex _bk_flex-col">
|
|
18
|
-
<div id="bk-menu-primary" class="_bk_grid _bk_border-t _bk_border-t-mono-200">
|
|
19
|
-
<MenuButton
|
|
20
|
-
v-for="button in primaryButtons"
|
|
21
|
-
:id="button.id"
|
|
22
|
-
:key="button.id"
|
|
23
|
-
:title="button.title"
|
|
24
|
-
:description="button.description"
|
|
25
|
-
:icon="button.icon"
|
|
26
|
-
:type="button.type"
|
|
27
|
-
:disabled="button.disabled"
|
|
28
|
-
@click="onClick(button)"
|
|
29
|
-
/>
|
|
30
|
-
</div>
|
|
31
|
-
<div id="bk-menu-secondary" class="_bk_mt-auto">
|
|
32
|
-
<MenuButton
|
|
33
|
-
v-for="button in secondaryButtons"
|
|
34
|
-
:id="button.id"
|
|
35
|
-
:key="button.id"
|
|
36
|
-
:title="button.title"
|
|
37
|
-
:description="button.description"
|
|
38
|
-
:icon="button.icon"
|
|
39
|
-
:type="button.type"
|
|
40
|
-
:disabled="button.disabled"
|
|
41
|
-
@click="onClick(button)"
|
|
42
|
-
/>
|
|
43
|
-
</div>
|
|
44
|
-
<aside
|
|
45
|
-
class="_bk_px-15 _bk_py-10 _bk_text-xs _bk_bg-mono-100 _bk_text-mono-600 _bk_items-center _bk_leading-none _bk_flex _bk_justify-between"
|
|
46
|
-
>
|
|
47
|
-
<div class="_bk_flex _bk_gap-5 _bk_items-center">
|
|
48
|
-
<Icon
|
|
49
|
-
name="logo"
|
|
50
|
-
class="_bk_bg-accent-700 _bk_size-20 _bk_flex _bk_items-center _bk_justify-center _bk_rounded _bk_text-white"
|
|
51
|
-
/>
|
|
52
|
-
<div><strong>@blokkli/editor</strong> {{ blokkliVersion }}</div>
|
|
53
|
-
</div>
|
|
54
|
-
|
|
55
|
-
<div>
|
|
56
|
-
<a
|
|
57
|
-
href="https://www.blokk.li"
|
|
58
|
-
target="_blank"
|
|
59
|
-
class="_bk_hover:text-accent-700 _bk_hover:underline"
|
|
60
|
-
>blokk.li</a
|
|
61
|
-
>
|
|
62
|
-
</div>
|
|
63
|
-
</aside>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
3
|
+
<AppMenuInner v-if="menuOpen" @close="closeMenu" />
|
|
66
4
|
</BlokkliTransition>
|
|
67
5
|
</template>
|
|
68
6
|
|
|
69
7
|
<script setup>
|
|
70
|
-
import { computed, useBlokkli } from "#imports";
|
|
71
|
-
import {
|
|
72
|
-
import { blokkliVersion } from "#blokkli-build/editor-config";
|
|
73
|
-
import MenuButton from "./MenuButton.vue";
|
|
8
|
+
import { computed, defineAsyncComponent, useBlokkli } from "#imports";
|
|
9
|
+
import { BlokkliTransition } from "#blokkli/editor/components";
|
|
74
10
|
import { onBlokkliEvent } from "#blokkli/editor/composables";
|
|
11
|
+
const AppMenuInner = defineAsyncComponent(() => import("./Inner.vue"));
|
|
75
12
|
const DIALOG_MENU = "menu";
|
|
76
|
-
const { ui
|
|
13
|
+
const { ui } = useBlokkli();
|
|
77
14
|
const menuOpen = computed(() => ui.currentDialog.value?.id === DIALOG_MENU);
|
|
78
15
|
function closeMenu() {
|
|
79
16
|
ui.closeDialog(DIALOG_MENU);
|
|
80
17
|
}
|
|
81
18
|
onBlokkliEvent("overlay:close", closeMenu);
|
|
82
|
-
const allButtons = computed(() => plugins.get("menuButton"));
|
|
83
|
-
const primaryButtons = computed(() => {
|
|
84
|
-
return allButtons.value.filter((button) => !button.secondary).sort((a, b) => (a.weight || 0) - (b.weight || 0));
|
|
85
|
-
});
|
|
86
|
-
const secondaryButtons = computed(() => {
|
|
87
|
-
return allButtons.value.filter((button) => button.secondary).sort((a, b) => (a.weight || 0) - (b.weight || 0));
|
|
88
|
-
});
|
|
89
|
-
function onClick(button) {
|
|
90
|
-
button.callback();
|
|
91
|
-
closeMenu();
|
|
92
|
-
}
|
|
93
19
|
</script>
|
|
94
20
|
|
|
95
21
|
<script>
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<div class="bk-artboard-tooltip-header">
|
|
17
17
|
<div class="_bk_mr-auto" v-html="title" />
|
|
18
18
|
<slot name="header" />
|
|
19
|
-
<button @click="$emit('close')">
|
|
19
|
+
<button :disabled="closeDisabled" @click="$emit('close')">
|
|
20
20
|
<Icon :name="closeIcon" />
|
|
21
21
|
<span v-if="buttonLabel">{{ buttonLabel }}</span>
|
|
22
22
|
</button>
|
|
@@ -48,6 +48,7 @@ const props = defineProps({
|
|
|
48
48
|
placementY: { type: String, required: false, default: "auto" },
|
|
49
49
|
placementX: { type: String, required: false, default: "center" },
|
|
50
50
|
closeIcon: { type: null, required: false, default: "bk_mdi_close" },
|
|
51
|
+
closeDisabled: { type: Boolean, required: false },
|
|
51
52
|
fullscreen: { type: Boolean, required: false }
|
|
52
53
|
});
|
|
53
54
|
const emit = defineEmits(["close"]);
|
|
@@ -282,10 +283,12 @@ onBeforeUnmount(() => {
|
|
|
282
283
|
.bk .bk-artboard-tooltip-info-button {
|
|
283
284
|
display: flex;
|
|
284
285
|
align-items: center;
|
|
286
|
+
gap: 5px;
|
|
285
287
|
font-size: 14px;
|
|
286
288
|
line-height: 20px;
|
|
287
289
|
--bk-tw-text-opacity: 1;
|
|
288
290
|
color: rgb(var(--bk-scheme-normal, var(--bk-theme-accent-600)) / var(--bk-tw-text-opacity, 1));
|
|
291
|
+
height: 32px;
|
|
289
292
|
padding-top: 6px;
|
|
290
293
|
padding-bottom: 6px;
|
|
291
294
|
padding-left: 10px;
|
|
@@ -307,4 +310,9 @@ onBeforeUnmount(() => {
|
|
|
307
310
|
--bk-tw-text-opacity: 1;
|
|
308
311
|
color: rgb(var(--bk-theme-mono-300) / var(--bk-tw-text-opacity, 1));
|
|
309
312
|
}
|
|
313
|
+
|
|
314
|
+
.bk .bk-artboard-tooltip-info-button svg {
|
|
315
|
+
width: 15px;
|
|
316
|
+
height: 15px;
|
|
317
|
+
}
|
|
310
318
|
</style>
|
|
@@ -40,6 +40,7 @@ import {
|
|
|
40
40
|
INJECT_IS_IN_REUSABLE,
|
|
41
41
|
INJECT_PROVIDER_BLOCKS
|
|
42
42
|
} from "#blokkli/helpers/injections";
|
|
43
|
+
import { fragmentBlockBundle } from "#blokkli-build/config";
|
|
43
44
|
const props = defineProps({
|
|
44
45
|
items: { type: [Array, Object], required: false, default: () => [] },
|
|
45
46
|
title: { type: String, required: true },
|
|
@@ -58,12 +59,17 @@ const normalizedItems = computed(() => {
|
|
|
58
59
|
const bundleLabel = computed(
|
|
59
60
|
() => props.bundle ? types.getBlockBundleDefinition(props.bundle)?.label || props.bundle : ""
|
|
60
61
|
);
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
const definition = computed(() => {
|
|
63
|
+
const item = normalizedItems.value[0];
|
|
64
|
+
const bundle = props.bundle || item?.bundle;
|
|
65
|
+
if (!bundle) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
if (bundle === fragmentBlockBundle && item?.props) {
|
|
69
|
+
return definitions.getFragmentDefinition(item.props.name);
|
|
70
|
+
}
|
|
71
|
+
return definitions.getDefaultDefinition(bundle);
|
|
72
|
+
});
|
|
67
73
|
const previewWidth = computed(
|
|
68
74
|
() => definition.value?.editor?.previewWidth || 400
|
|
69
75
|
);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
name?: string | null;
|
|
3
|
+
value?: string;
|
|
4
|
+
tag?: string;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_Slots = {
|
|
7
|
+
default(props: {
|
|
8
|
+
value: string;
|
|
9
|
+
}): any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
12
|
+
name: string | null;
|
|
13
|
+
value: string;
|
|
14
|
+
tag: string;
|
|
15
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
20
|
+
new (): {
|
|
21
|
+
$slots: S;
|
|
22
|
+
};
|
|
23
|
+
};
|