@blokkli/editor 2.0.0-alpha.22 → 2.0.0-alpha.24
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 +150 -226
- package/dist/runtime/blokkliPlugins/ContextMenu/index.vue +1 -1
- package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue +20 -14
- package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue.d.ts +8 -4
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue +55 -25
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue.d.ts +5 -4
- package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue +9 -2
- package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue.d.ts +2 -0
- package/dist/runtime/blokkliPlugins/TourItem/index.vue +22 -13
- package/dist/runtime/blokkliPlugins/TourItem/index.vue.d.ts +1 -0
- package/dist/runtime/blokkliPlugins/ViewOption/index.vue +3 -1
- package/dist/runtime/blokkliPlugins/index.d.ts +1 -5
- package/dist/runtime/blokkliPlugins/index.js +0 -8
- package/dist/runtime/components/Blocks/FromLibrary/index.vue +0 -5
- package/dist/runtime/components/BlokkliEditable.vue +6 -1
- package/dist/runtime/components/BlokkliField.vue +1 -1
- package/dist/runtime/components/BlokkliProvider.vue +4 -4
- package/dist/runtime/components/BlokkliProvider.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Actions/ItemDropdown.vue +66 -0
- package/dist/runtime/components/Edit/Actions/ItemDropdown.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Actions/index.vue +80 -117
- package/dist/runtime/components/Edit/AddListItem/index.vue +8 -29
- package/dist/runtime/components/Edit/AddListItem/index.vue.d.ts +2 -3
- package/dist/runtime/components/Edit/AnimationCanvas/index.vue +23 -68
- 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/BlockProxy/index.vue +2 -8
- package/dist/runtime/components/Edit/BlokkliErrorBoundary.vue +33 -49
- package/dist/runtime/components/Edit/BlokkliErrorBoundary.vue.d.ts +14 -1
- package/dist/runtime/components/Edit/BlokkliRootErrorBoundary.vue +93 -0
- package/dist/runtime/components/Edit/BlokkliRootErrorBoundary.vue.d.ts +12 -0
- package/dist/runtime/components/Edit/Dialog/index.vue +26 -5
- package/dist/runtime/components/Edit/Dialog/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/DraggableList.vue +5 -25
- package/dist/runtime/components/Edit/EditProvider.vue +71 -41
- package/dist/runtime/components/Edit/EditProvider.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Features/AddList/Actions/Action.vue +52 -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/{Selection/OverlayFallback → AddList/Actions}/index.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Features/{BlockAddList → AddList/Blocks}/index.vue +36 -108
- package/dist/runtime/components/Edit/Features/{Hover/Overlay → AddList/Blocks}/index.vue.d.ts +7 -2
- package/dist/runtime/components/Edit/Features/AddList/index.vue +76 -110
- package/dist/runtime/components/Edit/Features/Analyze/{Renderer.vue → Main.vue} +4 -8
- package/dist/runtime/components/Edit/Features/Analyze/{Overlay → Renderer}/fragment.glsl +10 -6
- package/dist/runtime/components/Edit/Features/Analyze/{Overlay → Renderer}/index.vue +43 -15
- package/dist/runtime/components/Edit/Features/Analyze/{Overlay → Renderer}/index.vue.d.ts +0 -2
- package/dist/runtime/components/Edit/Features/Analyze/{Overlay → Renderer}/vertex.glsl +11 -9
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue +15 -3
- package/dist/runtime/components/Edit/Features/Analyze/index.vue +7 -3
- package/dist/runtime/components/Edit/Features/Anchors/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue +41 -20
- package/dist/runtime/components/Edit/Features/Artboard/Scrollbar/index.vue +3 -2
- 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 +1 -0
- package/dist/runtime/components/Edit/Features/BlockScheduler/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Clipboard/List/index.vue +22 -11
- package/dist/runtime/components/Edit/Features/Clipboard/index.vue +70 -29
- 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/Conversions/index.vue +16 -9
- package/dist/runtime/components/Edit/Features/Debug/DebugSection.vue +24 -0
- package/dist/runtime/components/Edit/Features/Debug/DebugSection.vue.d.ts +16 -0
- package/dist/runtime/components/Edit/Features/Debug/Main.vue +80 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Features.vue +34 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Icons.vue +15 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Icons.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Keyboard.vue +17 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Keyboard.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Logging.vue +66 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Logging.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Rendering.vue +96 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Rendering.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Selection.vue +25 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Selection.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Debug/index.vue +2 -2
- 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 +23 -119
- package/dist/runtime/components/Edit/Features/DraggingOverlay/Renderer/fragment.glsl +77 -0
- package/dist/runtime/components/Edit/Features/DraggingOverlay/{DropTargets → Renderer}/index.vue +138 -92
- package/dist/runtime/components/Edit/Features/DraggingOverlay/{DropTargets → Renderer}/vertex.glsl +60 -8
- package/dist/runtime/components/Edit/Features/DraggingOverlay/index.vue +4 -5
- package/dist/runtime/components/Edit/Features/EditForm/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/index.vue +0 -6
- package/dist/runtime/components/Edit/Features/EditableField/index.vue +8 -4
- package/dist/runtime/components/Edit/Features/Exit/index.vue +12 -9
- package/dist/runtime/components/Edit/Features/Fragments/Dialog/Item/index.vue +1 -5
- package/dist/runtime/components/Edit/Features/Fragments/index.vue +27 -31
- package/dist/runtime/components/Edit/Features/Hover/Renderer/fragment.glsl +141 -0
- package/dist/runtime/components/Edit/Features/Hover/{Overlay → Renderer}/index.vue +225 -38
- package/dist/runtime/components/Edit/Features/Hover/Renderer/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Hover/{Overlay → Renderer}/vertex.glsl +49 -11
- package/dist/runtime/components/Edit/Features/Hover/index.vue +9 -6
- 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 +2 -2
- package/dist/runtime/components/Edit/Features/Library/LibraryDialog/Item/index.vue +1 -5
- package/dist/runtime/components/Edit/Features/Library/ReusableDialog/index.vue +1 -0
- package/dist/runtime/components/Edit/Features/Library/index.vue +50 -36
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/Item.vue +1 -1
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue +26 -13
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue.d.ts +0 -1
- package/dist/runtime/components/Edit/Features/MediaLibrary/index.vue +3 -47
- package/dist/runtime/components/Edit/Features/MultiSelect/{Overlay → Renderer}/fragment.glsl +13 -26
- package/dist/runtime/components/Edit/Features/MultiSelect/{Overlay → Renderer}/index.vue +131 -75
- package/dist/runtime/components/Edit/Features/MultiSelect/{Overlay → Renderer}/index.vue.d.ts +0 -1
- package/dist/runtime/components/Edit/Features/MultiSelect/{Overlay → Renderer}/vertex.glsl +27 -2
- package/dist/runtime/components/Edit/Features/MultiSelect/index.vue +25 -12
- package/dist/runtime/components/Edit/Features/Ownership/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/PreviewGrant/index.vue +2 -1
- package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue +1 -0
- package/dist/runtime/components/Edit/Features/Publish/index.vue +17 -15
- package/dist/runtime/components/Edit/Features/ResponsivePreview/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Revert/index.vue +24 -18
- package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Content/index.vue +23 -6
- package/dist/runtime/components/Edit/Features/Search/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue +21 -17
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue.d.ts +6 -6
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/fragment.glsl +19 -17
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/index.vue +242 -131
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/vertex.glsl +29 -12
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue +15 -10
- package/dist/runtime/components/Edit/Features/Selection/{Overlay → Renderer}/fragment.glsl +23 -14
- package/dist/runtime/components/Edit/Features/Selection/{Overlay → Renderer}/index.vue +121 -28
- package/dist/runtime/components/Edit/Features/Selection/{Overlay → Renderer}/index.vue.d.ts +0 -2
- package/dist/runtime/components/Edit/Features/Selection/{Overlay → Renderer}/vertex.glsl +23 -14
- package/dist/runtime/components/Edit/Features/Selection/index.vue +46 -59
- package/dist/runtime/components/Edit/Features/Settings/Dialog/index.vue +1 -0
- package/dist/runtime/components/Edit/Features/Settings/index.vue +25 -17
- package/dist/runtime/components/Edit/Features/TouchActionBar/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Tour/Overlay/index.vue +1 -1
- 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 +5 -5
- package/dist/runtime/components/Edit/Features/Transform/index.vue +30 -23
- package/dist/runtime/components/Edit/Features/Translations/index.vue +18 -17
- package/dist/runtime/components/Edit/Form/Checkboxes/index.vue +43 -0
- package/dist/runtime/components/Edit/Form/Checkboxes/index.vue.d.ts +20 -0
- package/dist/runtime/components/Edit/FormOverlay/index.vue +13 -4
- 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/Item/index.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Messages/index.vue +6 -1
- package/dist/runtime/components/Edit/Overlay/index.vue +66 -0
- package/dist/runtime/components/Edit/Overlay/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/PreviewProvider.vue +1 -1
- package/dist/runtime/components/Edit/Sortli/index.vue +5 -8
- package/dist/runtime/components/Edit/Sortli/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/SystemRequirements/index.vue +36 -36
- package/dist/runtime/components/Edit/Toolbar/index.vue +47 -51
- package/dist/runtime/components/Edit/ViewportBlockingRect/index.vue +9 -2
- package/dist/runtime/components/Edit/ViewportBlockingRect/index.vue.d.ts +4 -1
- package/dist/runtime/components/Edit/index.d.ts +7 -5
- package/dist/runtime/components/Edit/index.js +13 -9
- package/dist/runtime/css/output.css +1 -1
- package/dist/runtime/helpers/animationProvider.d.ts +58 -9
- package/dist/runtime/helpers/animationProvider.js +318 -75
- package/dist/runtime/helpers/composables/defineAddAction.d.ts +2 -0
- package/dist/runtime/helpers/composables/defineAddAction.js +10 -0
- package/dist/runtime/helpers/composables/defineItemDropdownAction.d.ts +2 -0
- package/dist/runtime/helpers/composables/defineItemDropdownAction.js +10 -0
- 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 +5 -2
- package/dist/runtime/helpers/composables/defineRenderer.js +3 -2
- package/dist/runtime/helpers/composables/useDialog.d.ts +3 -0
- package/dist/runtime/helpers/composables/useDialog.js +16 -0
- package/dist/runtime/helpers/composables/useGlobalBlokkliObject.d.ts +16 -0
- package/dist/runtime/helpers/composables/useGlobalBlokkliObject.js +36 -0
- package/dist/runtime/helpers/debugProvider.d.ts +13 -3
- package/dist/runtime/helpers/debugProvider.js +80 -12
- package/dist/runtime/helpers/defineElementStyle.d.ts +2 -0
- package/dist/runtime/helpers/defineElementStyle.js +33 -0
- package/dist/runtime/helpers/domProvider.d.ts +1 -0
- package/dist/runtime/helpers/domProvider.js +51 -32
- package/dist/runtime/helpers/dropTargets/index.d.ts +1 -1
- package/dist/runtime/helpers/dropTargets/index.js +18 -4
- package/dist/runtime/helpers/eventBus.d.ts +1 -1
- package/dist/runtime/helpers/index.d.ts +1 -6
- package/dist/runtime/helpers/index.js +0 -81
- package/dist/runtime/helpers/pluginProvider.d.ts +38 -3
- package/dist/runtime/helpers/pluginProvider.js +49 -18
- package/dist/runtime/helpers/providers/blocks.js +10 -0
- package/dist/runtime/helpers/providers/directive.d.ts +4 -1
- package/dist/runtime/helpers/providers/directive.js +9 -2
- package/dist/runtime/helpers/providers/fields.d.ts +9 -1
- package/dist/runtime/helpers/stateProvider.js +1 -0
- package/dist/runtime/helpers/uiProvider.d.ts +13 -12
- package/dist/runtime/helpers/uiProvider.js +117 -81
- package/dist/runtime/helpers/webgl/index.d.ts +2 -3
- package/dist/runtime/helpers/webgl/index.js +9 -14
- package/dist/runtime/icons/click.svg +1 -0
- package/dist/runtime/icons/dock-left.svg +1 -0
- package/dist/runtime/icons/dock-right.svg +1 -0
- package/dist/runtime/icons/dock-window.svg +1 -0
- package/dist/runtime/plugins/blokkliDirectives.js +1 -1
- package/dist/runtime/types/index.d.ts +16 -26
- package/package.json +1 -1
- package/dist/runtime/blokkliPlugins/AddAction/index.vue +0 -96
- package/dist/runtime/blokkliPlugins/AddAction/index.vue.d.ts +0 -26
- package/dist/runtime/blokkliPlugins/DroppableEdit/index.vue +0 -56
- package/dist/runtime/blokkliPlugins/DroppableEdit/index.vue.d.ts +0 -24
- package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue +0 -76
- package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue.d.ts +0 -31
- package/dist/runtime/blokkliPlugins/MenuButton/index.vue +0 -66
- package/dist/runtime/components/Edit/AddListItemIcon/index.vue +0 -19
- package/dist/runtime/components/Edit/Features/BlockAddList/docs.md +0 -15
- package/dist/runtime/components/Edit/Features/Debug/Renderer.vue +0 -240
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/fragment.glsl +0 -96
- package/dist/runtime/components/Edit/Features/Hover/Overlay/fragment.glsl +0 -139
- package/dist/runtime/components/Edit/Features/Selection/OverlayFallback/index.vue +0 -42
- /package/dist/runtime/components/Edit/Features/Analyze/{Renderer.vue.d.ts → Main.vue.d.ts} +0 -0
- /package/dist/runtime/components/Edit/Features/Anchors/{Renderer.vue → Overlay/index.vue} +0 -0
- /package/dist/runtime/components/Edit/Features/{BlockAddList → Anchors/Overlay}/index.vue.d.ts +0 -0
- /package/dist/runtime/components/Edit/Features/Debug/{Renderer.vue.d.ts → Main.vue.d.ts} +0 -0
- /package/dist/runtime/components/Edit/Features/{Anchors/Renderer.vue.d.ts → Debug/Section/Features.vue.d.ts} +0 -0
- /package/dist/runtime/components/Edit/Features/DraggingOverlay/{DropTargets → Renderer}/index.vue.d.ts +0 -0
- /package/dist/runtime/components/Edit/Features/Ownership/{Renderer.vue → Banner/index.vue} +0 -0
- /package/dist/runtime/components/Edit/Features/Ownership/{Renderer.vue.d.ts → Banner/index.vue.d.ts} +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<AddListItem
|
|
3
|
+
:id="action.id"
|
|
4
|
+
ref="item"
|
|
5
|
+
:key="action.id"
|
|
6
|
+
context="add-list-actions"
|
|
7
|
+
:label="action.title"
|
|
8
|
+
:bundle="action.itemBundle"
|
|
9
|
+
:icon="action.icon"
|
|
10
|
+
:color="action.color"
|
|
11
|
+
:disabled
|
|
12
|
+
no-context-menu
|
|
13
|
+
/>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup>
|
|
17
|
+
import { AddListItem } from "#blokkli/components";
|
|
18
|
+
import defineTourItem from "#blokkli/helpers/composables/defineTourItem";
|
|
19
|
+
import { computed, useTemplateRef, useBlokkli } from "#imports";
|
|
20
|
+
const props = defineProps({
|
|
21
|
+
action: { type: Object, required: true },
|
|
22
|
+
selectableBundles: { type: Array, required: true }
|
|
23
|
+
});
|
|
24
|
+
const { selection } = useBlokkli();
|
|
25
|
+
const item = useTemplateRef("item");
|
|
26
|
+
const bundleDisabled = computed(() => {
|
|
27
|
+
if (props.action.itemBundle) {
|
|
28
|
+
return !props.selectableBundles.includes(props.action.itemBundle);
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
});
|
|
32
|
+
const disabled = computed(() => {
|
|
33
|
+
if (bundleDisabled.value) {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
if (props.action.enabled && selection.item.value) {
|
|
37
|
+
return !props.action.enabled(selection.item.value);
|
|
38
|
+
}
|
|
39
|
+
return false;
|
|
40
|
+
});
|
|
41
|
+
defineTourItem(() => {
|
|
42
|
+
if (!props.action.description) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
id: "plugin:add_action:" + props.action.id,
|
|
47
|
+
title: props.action.title,
|
|
48
|
+
text: props.action.description,
|
|
49
|
+
element: () => item.value?.getElement()
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
</script>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AddAction } from '#blokkli/types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
action: AddAction;
|
|
4
|
+
selectableBundles: string[];
|
|
5
|
+
};
|
|
6
|
+
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>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Sortli id="blokkli-add-list-actions" :build-item="buildItemAction">
|
|
3
|
+
<ActionButton
|
|
4
|
+
v-for="action in actions"
|
|
5
|
+
:key="action.id"
|
|
6
|
+
:action="action"
|
|
7
|
+
:selectable-bundles
|
|
8
|
+
/>
|
|
9
|
+
</Sortli>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup>
|
|
13
|
+
import { computed, useBlokkli } from "#imports";
|
|
14
|
+
import { Sortli } from "#blokkli/components";
|
|
15
|
+
import ActionButton from "./Action.vue";
|
|
16
|
+
defineProps({
|
|
17
|
+
selectableBundles: { type: Array, required: true }
|
|
18
|
+
});
|
|
19
|
+
const { plugins } = useBlokkli();
|
|
20
|
+
const actions = computed(() => {
|
|
21
|
+
return plugins.get("addAction");
|
|
22
|
+
});
|
|
23
|
+
function buildItemAction(element) {
|
|
24
|
+
const actionType = element.dataset.sortliId;
|
|
25
|
+
if (!actionType) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const itemBundle = element.dataset.itemBundle;
|
|
29
|
+
const action = actions.value.find((v) => v.id === actionType);
|
|
30
|
+
if (!action) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
itemType: "action",
|
|
35
|
+
action,
|
|
36
|
+
actionType,
|
|
37
|
+
itemBundle,
|
|
38
|
+
element: () => element
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
|
-
|
|
2
|
+
selectableBundles: string[];
|
|
3
3
|
};
|
|
4
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
5
|
export default _default;
|
|
@@ -1,142 +1,75 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
v-if="selectableBundles.length && shouldRender"
|
|
4
|
-
:key="renderKey"
|
|
5
|
-
to="#blokkli-add-list-blocks"
|
|
6
|
-
>
|
|
2
|
+
<Sortli v-if="shouldRender" id="blokkli-add-list-blocks" :build-item>
|
|
7
3
|
<AddListItem
|
|
8
4
|
v-for="(type, i) in sortedList"
|
|
9
5
|
v-show="type.isVisible"
|
|
10
6
|
:id="type.id"
|
|
11
7
|
:key="i + (type.id || 'undefined') + renderKey"
|
|
8
|
+
context="add-list-blocks"
|
|
12
9
|
:label="type.label"
|
|
13
10
|
:bundle="type.id"
|
|
14
|
-
:orientation="ui.addListOrientation.value"
|
|
15
11
|
:disabled="type.isDisabled"
|
|
16
12
|
:color="type.isFavorite ? 'yellow' : 'default'"
|
|
17
13
|
data-element-type="new"
|
|
18
14
|
:data-item-bundle="type.id"
|
|
19
15
|
/>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
</Sortli>
|
|
17
|
+
|
|
18
|
+
<PluginTourItem
|
|
19
|
+
v-if="shouldRender"
|
|
20
|
+
id="block-add-list"
|
|
21
|
+
:title="$t('blockAddListTourTitle', 'Favorite blocks')"
|
|
22
|
+
:text="
|
|
24
23
|
$t(
|
|
25
24
|
'blockAddListTourText',
|
|
26
25
|
'Right-click on a block to add or remove them from your favorites. Favorites are highlighted and always displayed at the top of the list.'
|
|
27
26
|
)
|
|
28
27
|
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
</Teleport>
|
|
32
|
-
<Teleport
|
|
33
|
-
v-if="
|
|
34
|
-
ui.addListOrientation.value === 'sidebar' && types.generallyAvailableBundles.length > 10 && shouldRender
|
|
35
|
-
"
|
|
36
|
-
:key="renderKey"
|
|
37
|
-
to="#blokkli-add-list-sidebar-before"
|
|
38
|
-
>
|
|
39
|
-
<div class="bk bk-list-sidebar-form">
|
|
40
|
-
<input
|
|
41
|
-
id="add_block_search"
|
|
42
|
-
v-model="searchText"
|
|
43
|
-
type="search"
|
|
44
|
-
class="bk-form-input"
|
|
45
|
-
:placeholder="$t('addListInputPlaceholder', 'Search available blocks')"
|
|
46
|
-
required
|
|
47
|
-
/>
|
|
48
|
-
</div>
|
|
49
|
-
</Teleport>
|
|
28
|
+
selector="#blokkli-add-list-blocks"
|
|
29
|
+
/>
|
|
50
30
|
</template>
|
|
51
31
|
|
|
52
32
|
<script setup>
|
|
53
|
-
import {
|
|
54
|
-
|
|
55
|
-
computed,
|
|
56
|
-
useBlokkli,
|
|
57
|
-
defineBlokkliFeature,
|
|
58
|
-
nextTick
|
|
59
|
-
} from "#imports";
|
|
60
|
-
import { AddListItem } from "#blokkli/components";
|
|
33
|
+
import { ref, computed, useBlokkli } from "#imports";
|
|
34
|
+
import { AddListItem, Sortli } from "#blokkli/components";
|
|
61
35
|
import defineCommands from "#blokkli/helpers/composables/defineCommands";
|
|
62
|
-
import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
|
|
63
36
|
import { isInternalBundle } from "#blokkli/helpers/bundles";
|
|
64
37
|
import { PluginTourItem } from "#blokkli/plugins";
|
|
65
|
-
import { getFieldKey
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
dependencies: ["add-list"],
|
|
72
|
-
screnshot: "feature-block-add-list.jpg",
|
|
73
|
-
settings: {
|
|
74
|
-
hideDisabledBlocks: {
|
|
75
|
-
type: "checkbox",
|
|
76
|
-
label: "Hide blocks that can't be added",
|
|
77
|
-
description: `Hides blocks from the "Add List" if they can't be added to anywhere.`,
|
|
78
|
-
group: "appearance",
|
|
79
|
-
default: false
|
|
80
|
-
}
|
|
81
|
-
}
|
|
38
|
+
import { getFieldKey } from "#blokkli/helpers";
|
|
39
|
+
import { itemEntityType } from "#blokkli-build/config";
|
|
40
|
+
const props = defineProps({
|
|
41
|
+
hideDisabledBlocks: { type: Boolean, required: false },
|
|
42
|
+
selectableBundles: { type: Array, required: true },
|
|
43
|
+
generallyAvailableBundles: { type: Array, required: true }
|
|
82
44
|
});
|
|
83
45
|
const {
|
|
84
46
|
selection,
|
|
85
47
|
storage,
|
|
86
48
|
types,
|
|
87
49
|
context,
|
|
88
|
-
runtimeConfig,
|
|
89
50
|
ui,
|
|
90
51
|
eventBus,
|
|
91
52
|
$t,
|
|
92
53
|
state,
|
|
93
|
-
dom,
|
|
94
54
|
definitions,
|
|
95
55
|
blocks
|
|
96
56
|
} = useBlokkli();
|
|
57
|
+
function buildItem(element) {
|
|
58
|
+
const itemBundle = element.dataset.sortliId;
|
|
59
|
+
if (!itemBundle) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
itemType: "new",
|
|
64
|
+
itemBundle,
|
|
65
|
+
element: () => element
|
|
66
|
+
};
|
|
67
|
+
}
|
|
97
68
|
const shouldRender = computed(() => state.editMode.value === "editing");
|
|
98
69
|
const searchText = ref("");
|
|
99
|
-
const itemEntityType = runtimeConfig.itemEntityType;
|
|
100
70
|
const favorites = storage.use("blockFavorites", []);
|
|
101
|
-
const getAllowedTypesForSelected = (p) => {
|
|
102
|
-
if (types.itemBundlesWithNested.includes(p.bundle)) {
|
|
103
|
-
return types.fieldConfig.forEntityTypeAndBundle(itemEntityType, p.bundle).flatMap((v) => v.allowedBundles).filter(Boolean);
|
|
104
|
-
}
|
|
105
|
-
if (p.host.type === itemEntityType) {
|
|
106
|
-
return types.fieldConfig.forEntityTypeAndBundle(itemEntityType, p.host.bundle).flatMap((v) => v.allowedBundles).filter(Boolean);
|
|
107
|
-
} else {
|
|
108
|
-
return types.getFieldConfig(
|
|
109
|
-
context.value.entityType,
|
|
110
|
-
context.value.entityBundle,
|
|
111
|
-
p.host.fieldName
|
|
112
|
-
)?.allowedBundles || [];
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
const bundlesForRenderedFields = computed(() => {
|
|
116
|
-
return dom.registeredFieldTypes.value.flatMap((field) => {
|
|
117
|
-
return types.getFieldConfig(
|
|
118
|
-
field.entityType,
|
|
119
|
-
field.entityBundle,
|
|
120
|
-
field.fieldName
|
|
121
|
-
)?.allowedBundles || [];
|
|
122
|
-
}).filter(onlyUnique);
|
|
123
|
-
});
|
|
124
|
-
const generallyAvailableBundles = computed(
|
|
125
|
-
() => types.generallyAvailableBundles.filter(
|
|
126
|
-
(v) => (
|
|
127
|
-
// Exclude bundles for which no field is currently being rendered.
|
|
128
|
-
bundlesForRenderedFields.value.includes(v.id)
|
|
129
|
-
)
|
|
130
|
-
)
|
|
131
|
-
);
|
|
132
|
-
const selectableBundles = computed(() => {
|
|
133
|
-
if (selection.items.value.length) {
|
|
134
|
-
return selection.items.value.flatMap((v) => getAllowedTypesForSelected(v));
|
|
135
|
-
}
|
|
136
|
-
return generallyAvailableBundles.value.map((v) => v.id || "");
|
|
137
|
-
});
|
|
138
71
|
function determineVisibility(bundle, label) {
|
|
139
|
-
if (ui.isMobile.value && !selectableBundles.
|
|
72
|
+
if (ui.isMobile.value && !props.selectableBundles.includes(bundle)) {
|
|
140
73
|
return false;
|
|
141
74
|
}
|
|
142
75
|
if (searchText.value && !label.toLowerCase().includes(searchText.value.toLowerCase())) {
|
|
@@ -150,13 +83,13 @@ function determineVisibility(bundle, label) {
|
|
|
150
83
|
return true;
|
|
151
84
|
}
|
|
152
85
|
const sortedList = computed(() => {
|
|
153
|
-
return [...generallyAvailableBundles
|
|
86
|
+
return [...props.generallyAvailableBundles].filter((v) => !isInternalBundle(v.id)).map((v) => {
|
|
154
87
|
const isVisible = determineVisibility(v.id, v.label);
|
|
155
|
-
const isDisabled = !v.id || !selectableBundles.
|
|
88
|
+
const isDisabled = !v.id || !props.selectableBundles.includes(v.id);
|
|
156
89
|
return {
|
|
157
90
|
...v,
|
|
158
91
|
isDisabled,
|
|
159
|
-
isVisible: isVisible && (!
|
|
92
|
+
isVisible: isVisible && (!props.hideDisabledBlocks || !isDisabled),
|
|
160
93
|
isFavorite: favorites.value.includes(v.id)
|
|
161
94
|
};
|
|
162
95
|
}).sort((a, b) => {
|
|
@@ -283,7 +216,7 @@ const getInsertCommands = (block) => {
|
|
|
283
216
|
});
|
|
284
217
|
}
|
|
285
218
|
);
|
|
286
|
-
if (block.host.type ===
|
|
219
|
+
if (block.host.type === itemEntityType) {
|
|
287
220
|
const parentBlock = blocks.getBlock(block.host.uuid);
|
|
288
221
|
if (parentBlock) {
|
|
289
222
|
getInsertCommands(parentBlock).forEach((parentCommand) => {
|
|
@@ -333,15 +266,10 @@ defineCommands(() => {
|
|
|
333
266
|
...getAppendEndCommands()
|
|
334
267
|
];
|
|
335
268
|
});
|
|
336
|
-
onBlokkliEvent("add-list:change", () => {
|
|
337
|
-
nextTick(() => {
|
|
338
|
-
renderKey.value = Math.round(Math.random() * 1e9).toString();
|
|
339
|
-
});
|
|
340
|
-
});
|
|
341
269
|
</script>
|
|
342
270
|
|
|
343
271
|
<script>
|
|
344
272
|
export default {
|
|
345
|
-
name: "
|
|
273
|
+
name: "AddListBlocks"
|
|
346
274
|
};
|
|
347
275
|
</script>
|
package/dist/runtime/components/Edit/Features/{Hover/Overlay → AddList/Blocks}/index.vue.d.ts
RENAMED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import type { BlockBundleDefinition } from '#blokkli/types';
|
|
1
2
|
declare const _default: import("vue").DefineComponent<{
|
|
2
|
-
|
|
3
|
+
hideDisabledBlocks?: boolean;
|
|
4
|
+
selectableBundles: string[];
|
|
5
|
+
generallyAvailableBundles: BlockBundleDefinition[];
|
|
3
6
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
4
|
-
|
|
7
|
+
hideDisabledBlocks?: boolean;
|
|
8
|
+
selectableBundles: string[];
|
|
9
|
+
generallyAvailableBundles: BlockBundleDefinition[];
|
|
5
10
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
11
|
export default _default;
|
|
@@ -1,43 +1,25 @@
|
|
|
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
|
-
<Sortli class="bk bk-list-sidebar">
|
|
15
|
-
<div id="blokkli-add-list-blocks" />
|
|
16
|
-
<div id="blokkli-add-list-actions" />
|
|
17
|
-
</Sortli>
|
|
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
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
10
|
+
<div
|
|
11
|
+
class="bk-add-list-inner"
|
|
12
|
+
:class="{
|
|
13
|
+
'bk-is-active': isActive
|
|
14
|
+
}"
|
|
15
|
+
>
|
|
16
|
+
<AddListBlocks :selectable-bundles :generally-available-bundles />
|
|
17
|
+
<AddListActions :selectable-bundles />
|
|
18
|
+
</div>
|
|
37
19
|
</div>
|
|
38
20
|
<PluginTourItem
|
|
39
21
|
id="add-blocks"
|
|
40
|
-
|
|
22
|
+
:element="wrapper"
|
|
41
23
|
:title="sidebarTitle"
|
|
42
24
|
:text="tourText"
|
|
43
25
|
/>
|
|
@@ -45,99 +27,97 @@
|
|
|
45
27
|
</template>
|
|
46
28
|
|
|
47
29
|
<script setup>
|
|
48
|
-
import {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
} from "#imports";
|
|
56
|
-
import { Sortli } from "#blokkli/components";
|
|
57
|
-
import { PluginSidebar, PluginTourItem } from "#blokkli/plugins";
|
|
58
|
-
import { addElementClasses } from "#blokkli/helpers/addElementClasses";
|
|
59
|
-
const { settings } = defineBlokkliFeature({
|
|
30
|
+
import { ref, computed, useBlokkli, defineBlokkliFeature } from "#imports";
|
|
31
|
+
import { PluginTourItem } from "#blokkli/plugins";
|
|
32
|
+
import AddListBlocks from "./Blocks/index.vue";
|
|
33
|
+
import AddListActions from "./Actions/index.vue";
|
|
34
|
+
import { itemEntityType } from "#blokkli-build/config";
|
|
35
|
+
import { onlyUnique } from "#blokkli/helpers";
|
|
36
|
+
defineBlokkliFeature({
|
|
60
37
|
id: "add-list",
|
|
61
38
|
icon: "plus",
|
|
62
39
|
label: "Add List",
|
|
63
40
|
description: "Provides the container to render a list of blocks to add or add actions.",
|
|
64
41
|
settings: {
|
|
65
|
-
|
|
66
|
-
type: "
|
|
67
|
-
label: "
|
|
68
|
-
|
|
42
|
+
hideDisabledBlocks: {
|
|
43
|
+
type: "checkbox",
|
|
44
|
+
label: "Hide blocks that can't be added",
|
|
45
|
+
description: `Hides blocks from the "Add List" if they can't be added to anywhere.`,
|
|
69
46
|
group: "appearance",
|
|
70
|
-
|
|
71
|
-
options: {
|
|
72
|
-
vertical: {
|
|
73
|
-
label: "Vertical",
|
|
74
|
-
icon: "ui-list-vertical"
|
|
75
|
-
},
|
|
76
|
-
horizontal: {
|
|
77
|
-
label: "Horizontal",
|
|
78
|
-
icon: "ui-list-horizontal"
|
|
79
|
-
},
|
|
80
|
-
sidebar: {
|
|
81
|
-
label: "Sidebar",
|
|
82
|
-
icon: "ui-list-sidebar"
|
|
83
|
-
}
|
|
84
|
-
}
|
|
47
|
+
default: false
|
|
85
48
|
}
|
|
86
49
|
},
|
|
87
50
|
screenshot: "feature-add-list.jpg"
|
|
88
51
|
});
|
|
89
|
-
const { state,
|
|
90
|
-
const
|
|
91
|
-
(
|
|
52
|
+
const { $t, ui, selection, state, tour, types, context, dom } = useBlokkli();
|
|
53
|
+
const getAllowedTypesForSelected = (p) => {
|
|
54
|
+
if (types.itemBundlesWithNested.includes(p.bundle)) {
|
|
55
|
+
return types.fieldConfig.forEntityTypeAndBundle(itemEntityType, p.bundle).flatMap((v) => v.allowedBundles).filter(Boolean);
|
|
56
|
+
}
|
|
57
|
+
if (p.host.type === itemEntityType) {
|
|
58
|
+
return types.fieldConfig.forEntityTypeAndBundle(itemEntityType, p.host.bundle).flatMap((v) => v.allowedBundles).filter(Boolean);
|
|
59
|
+
} else {
|
|
60
|
+
return types.getFieldConfig(
|
|
61
|
+
context.value.entityType,
|
|
62
|
+
context.value.entityBundle,
|
|
63
|
+
p.host.fieldName
|
|
64
|
+
)?.allowedBundles || [];
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const bundlesForRenderedFields = computed(() => {
|
|
68
|
+
return dom.registeredFieldTypes.value.flatMap((field) => {
|
|
69
|
+
return types.getFieldConfig(
|
|
70
|
+
field.entityType,
|
|
71
|
+
field.entityBundle,
|
|
72
|
+
field.fieldName
|
|
73
|
+
)?.allowedBundles || [];
|
|
74
|
+
}).filter(onlyUnique);
|
|
75
|
+
});
|
|
76
|
+
const generallyAvailableBundles = computed(
|
|
77
|
+
() => types.generallyAvailableBundles.filter(
|
|
78
|
+
(v) => (
|
|
79
|
+
// Exclude bundles for which no field is currently being rendered.
|
|
80
|
+
bundlesForRenderedFields.value.includes(v.id)
|
|
81
|
+
)
|
|
82
|
+
)
|
|
92
83
|
);
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
});
|
|
84
|
+
const selectableBundles = computed(() => {
|
|
85
|
+
if (selection.items.value.length) {
|
|
86
|
+
return selection.items.value.flatMap((v) => getAllowedTypesForSelected(v));
|
|
87
|
+
}
|
|
88
|
+
return generallyAvailableBundles.value.map((v) => v.id || "");
|
|
99
89
|
});
|
|
100
|
-
const
|
|
101
|
-
|
|
90
|
+
const shouldRender = computed(
|
|
91
|
+
() => state.canEdit.value && state.editMode.value === "editing"
|
|
92
|
+
);
|
|
93
|
+
const hasContextMenuOpen = computed(
|
|
94
|
+
() => ui.openContextMenu.value.startsWith("add_list_item_add-list-blocks")
|
|
95
|
+
);
|
|
102
96
|
const wrapper = ref(null);
|
|
103
|
-
const
|
|
97
|
+
const isHovered = ref(false);
|
|
104
98
|
let mouseTimeout = null;
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
const widths = element.queryAll(
|
|
108
|
-
wrapper.value,
|
|
109
|
-
".bk-list-item-label span",
|
|
110
|
-
"AddList vertical sidebar style",
|
|
111
|
-
(el) => el.offsetWidth
|
|
112
|
-
);
|
|
113
|
-
const largestWidth = Math.max(...widths);
|
|
114
|
-
return {
|
|
115
|
-
"--bk-add-list-width": largestWidth + 90
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
return void 0;
|
|
99
|
+
const isActive = computed(() => {
|
|
100
|
+
return (isHovered.value || hasContextMenuOpen.value || tour.isTouring.value) && !selection.isDragging.value;
|
|
119
101
|
});
|
|
120
102
|
function onMouseEnter() {
|
|
121
|
-
|
|
103
|
+
if (mouseTimeout) {
|
|
104
|
+
clearTimeout(mouseTimeout);
|
|
105
|
+
isHovered.value = true;
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
122
108
|
mouseTimeout = setTimeout(() => {
|
|
123
|
-
|
|
109
|
+
isHovered.value = true;
|
|
124
110
|
}, 200);
|
|
125
111
|
}
|
|
126
112
|
function onMouseLeave() {
|
|
127
113
|
clearTimeout(mouseTimeout);
|
|
128
|
-
|
|
114
|
+
isHovered.value = false;
|
|
129
115
|
}
|
|
130
116
|
const onWheel = (e) => {
|
|
131
117
|
if (e.ctrlKey || e.metaKey) {
|
|
132
118
|
return;
|
|
133
119
|
}
|
|
134
|
-
|
|
135
|
-
e.stopPropagation();
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
if (ui.addListOrientation.value === "vertical" && e.deltaY) {
|
|
139
|
-
e.stopPropagation();
|
|
140
|
-
}
|
|
120
|
+
e.stopPropagation();
|
|
141
121
|
};
|
|
142
122
|
const sidebarTitle = computed(() => $t("addListSidebarTitle", "Add blocks"));
|
|
143
123
|
const tourText = computed(
|
|
@@ -146,20 +126,6 @@ const tourText = computed(
|
|
|
146
126
|
"<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>"
|
|
147
127
|
)
|
|
148
128
|
);
|
|
149
|
-
addElementClasses(
|
|
150
|
-
document.documentElement,
|
|
151
|
-
CLASS_BOTTOM,
|
|
152
|
-
computed(
|
|
153
|
-
() => ui.addListOrientation.value === "horizontal" && shouldRender.value
|
|
154
|
-
)
|
|
155
|
-
);
|
|
156
|
-
addElementClasses(
|
|
157
|
-
document.documentElement,
|
|
158
|
-
CLASS_LEFT,
|
|
159
|
-
computed(
|
|
160
|
-
() => ui.addListOrientation.value === "vertical" && shouldRender.value
|
|
161
|
-
)
|
|
162
|
-
);
|
|
163
129
|
</script>
|
|
164
130
|
|
|
165
131
|
<script>
|
|
@@ -39,12 +39,9 @@
|
|
|
39
39
|
<Results :results="resultsFiltered" />
|
|
40
40
|
</div>
|
|
41
41
|
</div>
|
|
42
|
-
<
|
|
43
|
-
v-if="
|
|
44
|
-
resultsFiltered.length && gl && animation.webglEnabled.value && !isStale
|
|
45
|
-
"
|
|
42
|
+
<Renderer
|
|
43
|
+
v-if="resultsFiltered.length && !isStale"
|
|
46
44
|
:results="resultsFiltered"
|
|
47
|
-
:gl="gl"
|
|
48
45
|
/>
|
|
49
46
|
</template>
|
|
50
47
|
|
|
@@ -52,7 +49,7 @@
|
|
|
52
49
|
import { computed, useBlokkli, useState, ref } from "#imports";
|
|
53
50
|
import Results from "./Results/Results.vue";
|
|
54
51
|
import AnalyzeSummary from "./Summary/index.vue";
|
|
55
|
-
import
|
|
52
|
+
import Renderer from "./Renderer/index.vue";
|
|
56
53
|
import { useAnalyzeHelper } from "./helper";
|
|
57
54
|
import { FormSelect, RelativeTime } from "#blokkli/components";
|
|
58
55
|
import { AnalyzerContext } from "./analyzers/helpers/Context";
|
|
@@ -64,9 +61,8 @@ const props = defineProps({
|
|
|
64
61
|
analyzers: { type: Array, required: true }
|
|
65
62
|
});
|
|
66
63
|
const ALL = "ALL";
|
|
67
|
-
const { $t, ui, state
|
|
64
|
+
const { $t, ui, state } = useBlokkli();
|
|
68
65
|
const { getCategoryLabel } = useAnalyzeHelper();
|
|
69
|
-
const gl = animation.gl();
|
|
70
66
|
const currentPlugin = ref("readability");
|
|
71
67
|
const hasRunOnce = useState(() => false);
|
|
72
68
|
const results = useState("blokkli:analyze", () => []);
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
#version 300 es
|
|
2
|
+
|
|
1
3
|
precision highp float;
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
in vec4 v_quad;
|
|
6
|
+
in float v_rect_type;
|
|
7
|
+
in vec3 v_color;
|
|
8
|
+
in vec2 v_rect_size;
|
|
9
|
+
in vec2 v_rect_center;
|
|
10
|
+
|
|
11
|
+
out vec4 fragColor;
|
|
8
12
|
|
|
9
13
|
uniform float u_dpi;
|
|
10
14
|
|
|
@@ -54,5 +58,5 @@ void main() {
|
|
|
54
58
|
// Mix with border
|
|
55
59
|
vec4 finalColor = mix(res_with_fill, border, borderAlpha * border.a);
|
|
56
60
|
|
|
57
|
-
|
|
61
|
+
fragColor = finalColor;
|
|
58
62
|
}
|