@blokkli/editor 2.0.0-alpha.24 → 2.0.0-alpha.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/dist/module.mjs +191 -27
- package/dist/runtime/blokkliPlugins/BlockIndicator/index.vue.d.ts +38 -0
- package/dist/runtime/blokkliPlugins/ContextMenu/index.vue.d.ts +15 -0
- package/dist/runtime/blokkliPlugins/DebugOverlay/index.vue.d.ts +6 -0
- package/dist/runtime/blokkliPlugins/ItemAction/index.vue.d.ts +28 -3
- package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue +6 -4
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue +11 -3
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue.d.ts +138 -3
- package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue.d.ts +114 -0
- package/dist/runtime/blokkliPlugins/TourItem/index.vue.d.ts +21 -0
- package/dist/runtime/blokkliPlugins/ViewOption/index.vue.d.ts +98 -0
- package/dist/runtime/components/Blocks/NotImplemented/index.vue +24 -0
- package/dist/runtime/components/Blocks/NotImplemented/index.vue.d.ts +6 -0
- package/dist/runtime/components/BlokkliEditable.vue.d.ts +11 -0
- package/dist/runtime/components/BlokkliItem.vue +16 -3
- package/dist/runtime/components/BlokkliItem.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Actions/index.vue +1 -1
- package/dist/runtime/components/Edit/AddListItem/index.vue +1 -6
- package/dist/runtime/components/Edit/AddListItem/index.vue.d.ts +5 -13
- package/dist/runtime/components/Edit/ArtboardTooltip/index.vue +6 -0
- package/dist/runtime/components/Edit/BlockProxy/index.vue +2 -2
- package/dist/runtime/components/Edit/BlokkliErrorBoundary.vue +3 -0
- package/dist/runtime/components/Edit/BlokkliRootErrorBoundary.vue +4 -1
- package/dist/runtime/components/Edit/Dialog/index.vue +15 -50
- package/dist/runtime/components/Edit/DraggableList.vue +12 -9
- package/dist/runtime/components/Edit/EditIndicator.vue +11 -4
- package/dist/runtime/components/Edit/EditProvider.vue +27 -24
- package/dist/runtime/components/Edit/Features/AddList/Actions/Action.vue +1 -0
- package/dist/runtime/components/Edit/Features/AddList/Blocks/index.vue +2 -3
- package/dist/runtime/components/Edit/Features/AddList/index.vue +17 -5
- package/dist/runtime/components/Edit/Features/Analyze/Icon.vue +85 -0
- package/dist/runtime/components/Edit/Features/Analyze/Icon.vue.d.ts +5 -0
- package/dist/runtime/components/Edit/Features/Analyze/Main.vue +288 -59
- package/dist/runtime/components/Edit/Features/Analyze/Main.vue.d.ts +8 -1
- package/dist/runtime/components/Edit/Features/Analyze/Renderer/fragment.glsl +25 -13
- package/dist/runtime/components/Edit/Features/Analyze/Renderer/index.vue +114 -52
- package/dist/runtime/components/Edit/Features/Analyze/Renderer/index.vue.d.ts +16 -2
- package/dist/runtime/components/Edit/Features/Analyze/Renderer/vertex.glsl +31 -11
- package/dist/runtime/components/Edit/Features/Analyze/Results/Results.vue +2 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/Results.vue.d.ts +8 -1
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItem.vue +4 -4
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItem.vue.d.ts +20 -2
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodes.vue +11 -18
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodes.vue.d.ts +10 -3
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue +46 -40
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue.d.ts +10 -4
- package/dist/runtime/components/Edit/Features/Analyze/Summary/Chart.vue +8 -4
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/axe.js +1 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/Context.d.ts +4 -3
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/Context.js +2 -1
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/readability.js +61 -20
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/types.d.ts +15 -1
- package/dist/runtime/components/Edit/Features/Analyze/index.vue +23 -2
- package/dist/runtime/components/Edit/Features/Artboard/Overview/index.vue +22 -8
- package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue +1 -1
- package/dist/runtime/components/Edit/Features/Artboard/Scrollbar/index.vue +8 -3
- package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/index.vue +10 -1
- package/dist/runtime/components/Edit/Features/Debug/Main.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Features/Debug/Rects/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Debug/Section/Logging.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Features/EditForm/Frame/index.vue +8 -2
- package/dist/runtime/components/Edit/Features/EditForm/index.vue +1 -7
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/Plaintext/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/index.vue +4 -3
- package/dist/runtime/components/Edit/Features/EditableMask/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/EntityTitle/index.vue +7 -2
- package/dist/runtime/components/Edit/Features/Library/EditReusable/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Library/LibraryDialog/index.vue +9 -2
- package/dist/runtime/components/Edit/Features/Library/ReusableDialog/index.vue +12 -3
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/Options/Form/Item.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Features/PreviewGrant/index.vue +1 -0
- package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue +9 -0
- package/dist/runtime/components/Edit/Features/ResponsivePreview/Frame/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/ResponsivePreview/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Content/index.vue +8 -2
- package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Page/index.vue +12 -2
- package/dist/runtime/components/Edit/Features/Search/Overlay/index.vue +11 -3
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue +126 -33
- package/dist/runtime/components/Edit/Features/Selection/Renderer/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Settings/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Structure/List/Field/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/Tour/Overlay/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Transform/Dialog/index.vue +7 -1
- package/dist/runtime/components/Edit/Form/Textarea/index.vue +1 -1
- package/dist/runtime/components/Edit/FormOverlay/index.vue +1 -1
- package/dist/runtime/components/Edit/Indicators/index.vue +1 -1
- package/dist/runtime/components/Edit/InfoBox/index.vue +3 -2
- package/dist/runtime/components/Edit/InfoBox/index.vue.d.ts +6 -1
- package/dist/runtime/components/Edit/Overlay/index.vue +4 -0
- package/dist/runtime/components/Edit/PreviewProvider.vue +3 -3
- package/dist/runtime/components/Edit/ScaleToFit/index.vue +4 -4
- package/dist/runtime/composables/defineBlokkliFeature.d.ts +1 -1
- package/dist/runtime/composables/useBlokkli.d.ts +6 -1
- package/dist/runtime/composables/useBlokkli.js +4 -1
- package/dist/runtime/css/output.css +1 -1
- package/dist/runtime/helpers/composables/defineItemDropdownAction.d.ts +1 -1
- package/dist/runtime/helpers/composables/defineMenuButton.d.ts +1 -1
- package/dist/runtime/helpers/composables/defineRenderer.d.ts +1 -1
- package/dist/runtime/helpers/composables/onBroadcastEvent.d.ts +1 -1
- package/dist/runtime/helpers/composables/useBlockRegistration.d.ts +1 -1
- package/dist/runtime/helpers/composables/useBlockRegistration.js +12 -1
- package/dist/runtime/helpers/composables/useDebugLogger.d.ts +1 -1
- package/dist/runtime/helpers/composables/useFocusTrap.d.ts +52 -0
- package/dist/runtime/helpers/composables/useFocusTrap.js +59 -0
- package/dist/runtime/helpers/composables/useGlobalBlokkliObject.d.ts +1 -1
- package/dist/runtime/helpers/{useTransitionedValue.js → composables/useTransitionedValue.js} +1 -1
- package/dist/runtime/helpers/imports/index.d.ts +2 -1
- package/dist/runtime/helpers/imports/index.js +10 -1
- package/dist/runtime/helpers/{animationProvider.d.ts → providers/animation.d.ts} +100 -7
- package/dist/runtime/helpers/{animationProvider.js → providers/animation.js} +21 -11
- package/dist/runtime/helpers/providers/blocks.d.ts +25 -3
- package/dist/runtime/helpers/providers/blocks.js +9 -0
- package/dist/runtime/helpers/providers/commands.d.ts +41 -0
- package/dist/runtime/helpers/{commandsProvider.js → providers/commands.js} +1 -1
- package/dist/runtime/helpers/providers/debug.d.ts +125 -0
- package/dist/runtime/helpers/{debugProvider.js → providers/debug.js} +2 -2
- package/dist/runtime/helpers/providers/definition.d.ts +87 -0
- package/dist/runtime/helpers/providers/directive.d.ts +88 -2
- package/dist/runtime/helpers/providers/directive.js +18 -2
- package/dist/runtime/helpers/providers/dom.d.ts +225 -0
- package/dist/runtime/helpers/{domProvider.js → providers/dom.js} +27 -74
- package/dist/runtime/helpers/providers/dropArea.d.ts +47 -0
- package/dist/runtime/helpers/{dropAreaProvider.js → providers/dropArea.js} +1 -1
- package/dist/runtime/helpers/providers/element.d.ts +58 -1
- package/dist/runtime/helpers/providers/features.d.ts +56 -0
- package/dist/runtime/helpers/{featuresProvider.js → providers/features.js} +1 -1
- package/dist/runtime/helpers/providers/fields.d.ts +18 -11
- package/dist/runtime/helpers/providers/fields.js +1 -1
- package/dist/runtime/helpers/providers/indicators.d.ts +44 -0
- package/dist/runtime/helpers/providers/keyboard.d.ts +76 -0
- package/dist/runtime/helpers/{keyboardProvider.js → providers/keyboard.js} +1 -8
- package/dist/runtime/helpers/{pluginProvider.d.ts → providers/plugin.d.ts} +36 -0
- package/dist/runtime/helpers/{selectionProvider.d.ts → providers/selection.d.ts} +4 -1
- package/dist/runtime/helpers/{selectionProvider.js → providers/selection.js} +1 -1
- package/dist/runtime/helpers/providers/state.d.ts +227 -0
- package/dist/runtime/helpers/{stateProvider.js → providers/state.js} +3 -3
- package/dist/runtime/helpers/providers/storage.d.ts +64 -0
- package/dist/runtime/helpers/{textProvider.d.ts → providers/texts.d.ts} +1 -1
- package/dist/runtime/helpers/providers/theme.d.ts +119 -0
- package/dist/runtime/helpers/{themeProvider.js → providers/theme.js} +3 -3
- package/dist/runtime/helpers/providers/tour.d.ts +49 -0
- package/dist/runtime/helpers/{tourProvider.js → providers/tour.js} +1 -1
- package/dist/runtime/helpers/providers/types.d.ts +170 -0
- package/dist/runtime/helpers/{typesProvider.js → providers/types.js} +45 -1
- package/dist/runtime/helpers/providers/ui.d.ts +339 -0
- package/dist/runtime/helpers/{uiProvider.js → providers/ui.js} +11 -5
- package/dist/runtime/helpers/runtimeHelpers/index.d.ts +1 -1
- package/dist/runtime/helpers/symbols.d.ts +1 -0
- package/dist/runtime/helpers/symbols.js +3 -0
- package/dist/runtime/types/blockOptions.d.ts +349 -0
- package/dist/runtime/types/index.d.ts +22 -26
- package/package.json +2 -2
- package/dist/runtime/helpers/commandsProvider.d.ts +0 -9
- package/dist/runtime/helpers/debugProvider.d.ts +0 -33
- package/dist/runtime/helpers/definitionProvider.d.ts +0 -19
- package/dist/runtime/helpers/domProvider.d.ts +0 -91
- package/dist/runtime/helpers/dropAreaProvider.d.ts +0 -9
- package/dist/runtime/helpers/featuresProvider.d.ts +0 -17
- package/dist/runtime/helpers/indicatorsProvider.d.ts +0 -10
- package/dist/runtime/helpers/keyboardProvider.d.ts +0 -20
- package/dist/runtime/helpers/stateProvider.d.ts +0 -47
- package/dist/runtime/helpers/storageProvider.d.ts +0 -17
- package/dist/runtime/helpers/themeProvider.d.ts +0 -30
- package/dist/runtime/helpers/tourProvider.d.ts +0 -11
- package/dist/runtime/helpers/typesProvider.d.ts +0 -36
- package/dist/runtime/helpers/uiProvider.d.ts +0 -57
- package/dist/runtime/types/blokkOptions.d.ts +0 -100
- /package/dist/runtime/helpers/{addElementClasses.d.ts → composables/addElementClasses.d.ts} +0 -0
- /package/dist/runtime/helpers/{addElementClasses.js → composables/addElementClasses.js} +0 -0
- /package/dist/runtime/helpers/{defineElementStyle.d.ts → composables/defineElementStyle.d.ts} +0 -0
- /package/dist/runtime/helpers/{defineElementStyle.js → composables/defineElementStyle.js} +0 -0
- /package/dist/runtime/helpers/{useTransitionedValue.d.ts → composables/useTransitionedValue.d.ts} +0 -0
- /package/dist/runtime/helpers/{broadcastProvider.d.ts → providers/broadcast.d.ts} +0 -0
- /package/dist/runtime/helpers/{broadcastProvider.js → providers/broadcast.js} +0 -0
- /package/dist/runtime/helpers/{definitionProvider.js → providers/definition.js} +0 -0
- /package/dist/runtime/helpers/{indicatorsProvider.js → providers/indicators.js} +0 -0
- /package/dist/runtime/helpers/{pluginProvider.js → providers/plugin.js} +0 -0
- /package/dist/runtime/helpers/{storageProvider.js → providers/storage.js} +0 -0
- /package/dist/runtime/helpers/{textProvider.js → providers/texts.js} +0 -0
- /package/dist/runtime/types/{blokkOptions.js → blockOptions.js} +0 -0
|
@@ -56,19 +56,28 @@
|
|
|
56
56
|
</template>
|
|
57
57
|
|
|
58
58
|
<script setup>
|
|
59
|
-
import { ref, useBlokkli, onMounted } from "#imports";
|
|
59
|
+
import { ref, useBlokkli, onMounted, useTemplateRef, watch } from "#imports";
|
|
60
60
|
import { DialogModal, InfoBox, FormText, FormItem } from "#blokkli/components";
|
|
61
61
|
import { realBackgroundColor } from "#blokkli/helpers";
|
|
62
62
|
defineEmits(["confirm", "cancel"]);
|
|
63
|
-
const { dom, $t, blocks } = useBlokkli();
|
|
63
|
+
const { dom, $t, blocks, ui } = useBlokkli();
|
|
64
64
|
const props = defineProps({
|
|
65
65
|
uuid: { type: String, required: true },
|
|
66
66
|
backgroundClass: { type: String, required: false }
|
|
67
67
|
});
|
|
68
68
|
const label = ref("");
|
|
69
69
|
const width = ref(450);
|
|
70
|
-
const previewEl =
|
|
70
|
+
const previewEl = useTemplateRef("previewEl");
|
|
71
71
|
const backgroundColor = ref("");
|
|
72
|
+
watch(
|
|
73
|
+
label,
|
|
74
|
+
() => {
|
|
75
|
+
ui.requireDialogCloseConfirm();
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
once: true
|
|
79
|
+
}
|
|
80
|
+
);
|
|
72
81
|
onMounted(() => {
|
|
73
82
|
if (previewEl.value) {
|
|
74
83
|
const item = blocks.getBlock(props.uuid);
|
|
@@ -75,7 +75,8 @@ import {
|
|
|
75
75
|
useLazyAsyncData,
|
|
76
76
|
useBlokkli,
|
|
77
77
|
watch,
|
|
78
|
-
nextTick
|
|
78
|
+
nextTick,
|
|
79
|
+
useTemplateRef
|
|
79
80
|
} from "#imports";
|
|
80
81
|
import { Sortli, Icon, Pagination, FormToggle } from "#blokkli/components";
|
|
81
82
|
import Item from "./Item.vue";
|
|
@@ -86,7 +87,7 @@ defineProps({
|
|
|
86
87
|
});
|
|
87
88
|
const { adapter, storage, $t, element } = useBlokkli();
|
|
88
89
|
const selected = ref([]);
|
|
89
|
-
const listEl =
|
|
90
|
+
const listEl = useTemplateRef("listEl");
|
|
90
91
|
const page = ref(0);
|
|
91
92
|
const key = computed(() => Object.values(filterValues.value).join(","));
|
|
92
93
|
function getDragItems(activeItem) {
|
|
@@ -565,4 +565,13 @@ async function onSubmit() {
|
|
|
565
565
|
emit("submit");
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
|
+
watch(
|
|
569
|
+
() => [revisionMessage.value, publishMode.value, isMutating.value],
|
|
570
|
+
() => {
|
|
571
|
+
ui.requireDialogCloseConfirm();
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
once: true
|
|
575
|
+
}
|
|
576
|
+
);
|
|
568
577
|
</script>
|
|
@@ -25,7 +25,8 @@ import {
|
|
|
25
25
|
onMounted,
|
|
26
26
|
onBeforeUnmount,
|
|
27
27
|
useRoute,
|
|
28
|
-
watch
|
|
28
|
+
watch,
|
|
29
|
+
useTemplateRef
|
|
29
30
|
} from "#imports";
|
|
30
31
|
import { Icon } from "#blokkli/components";
|
|
31
32
|
import { frameEventBus } from "./../../../../../helpers/frameEventBus";
|
|
@@ -40,7 +41,7 @@ watch(selection.uuids, (selectedUuids) => {
|
|
|
40
41
|
frameEventBus.emit("selectItems", selectedUuids);
|
|
41
42
|
});
|
|
42
43
|
const isLoading = ref(true);
|
|
43
|
-
const iframe =
|
|
44
|
+
const iframe = useTemplateRef("iframe");
|
|
44
45
|
const src = computed(
|
|
45
46
|
() => route.fullPath.replace("blokkliEditing", "blokkliPreview")
|
|
46
47
|
);
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
id="mobile-preview"
|
|
4
4
|
v-slot="{ width, height, isDetached, isResizing }"
|
|
5
5
|
:title="$t('responsivePreviewTitle', 'Responsive Preview')"
|
|
6
|
-
:tour-text
|
|
6
|
+
:tour-text
|
|
7
|
+
weight="10"
|
|
7
8
|
:disabled="!state.canEdit.value"
|
|
8
9
|
:min-width="375"
|
|
9
10
|
:min-height="375"
|
|
10
|
-
:size
|
|
11
|
+
:size
|
|
11
12
|
icon="preview"
|
|
12
13
|
region="left"
|
|
13
14
|
>
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
</template>
|
|
53
53
|
|
|
54
54
|
<script setup>
|
|
55
|
-
import {
|
|
55
|
+
import { ref, watch, useBlokkli, onMounted, useTemplateRef } from "#imports";
|
|
56
56
|
import { ItemIcon, Icon, Sortli } from "#blokkli/components";
|
|
57
57
|
import { modulo } from "#blokkli/helpers";
|
|
58
|
-
const listItems =
|
|
58
|
+
const listItems = useTemplateRef("listItems");
|
|
59
59
|
const props = defineProps({
|
|
60
60
|
visible: { type: Boolean, required: true },
|
|
61
61
|
search: { type: String, required: true },
|
|
@@ -123,6 +123,9 @@ const setIndex = (newIndex) => {
|
|
|
123
123
|
scrollItemIntoView();
|
|
124
124
|
};
|
|
125
125
|
const clickItem = () => {
|
|
126
|
+
if (!listItems.value) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
126
129
|
const element = listItems.value[index.value];
|
|
127
130
|
if (!element) {
|
|
128
131
|
return;
|
|
@@ -143,6 +146,9 @@ const clickItem = () => {
|
|
|
143
146
|
emit("close");
|
|
144
147
|
};
|
|
145
148
|
const scrollItemIntoView = () => {
|
|
149
|
+
if (!listItems.value) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
146
152
|
const item = listItems.value[index.value];
|
|
147
153
|
if (item) {
|
|
148
154
|
item.scrollIntoView({ block: "nearest", inline: "nearest" });
|
|
@@ -38,10 +38,17 @@
|
|
|
38
38
|
</template>
|
|
39
39
|
|
|
40
40
|
<script setup>
|
|
41
|
-
import {
|
|
41
|
+
import {
|
|
42
|
+
ref,
|
|
43
|
+
computed,
|
|
44
|
+
useBlokkli,
|
|
45
|
+
onMounted,
|
|
46
|
+
watch,
|
|
47
|
+
useTemplateRef
|
|
48
|
+
} from "#imports";
|
|
42
49
|
import { ItemIcon, Highlight } from "#blokkli/components";
|
|
43
50
|
import { falsy, modulo } from "#blokkli/helpers";
|
|
44
|
-
const listItems =
|
|
51
|
+
const listItems = useTemplateRef("listItems");
|
|
45
52
|
const emit = defineEmits(["close"]);
|
|
46
53
|
const props = defineProps({
|
|
47
54
|
visible: { type: Boolean, required: true },
|
|
@@ -86,6 +93,9 @@ const clickItem = () => {
|
|
|
86
93
|
emit("close");
|
|
87
94
|
};
|
|
88
95
|
const scrollItemIntoView = () => {
|
|
96
|
+
if (!listItems.value) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
89
99
|
const item = listItems.value[index.value];
|
|
90
100
|
if (item) {
|
|
91
101
|
item.scrollIntoView({ block: "nearest", inline: "nearest" });
|
|
@@ -66,7 +66,15 @@
|
|
|
66
66
|
</template>
|
|
67
67
|
|
|
68
68
|
<script setup>
|
|
69
|
-
import {
|
|
69
|
+
import {
|
|
70
|
+
watch,
|
|
71
|
+
ref,
|
|
72
|
+
computed,
|
|
73
|
+
useBlokkli,
|
|
74
|
+
onMounted,
|
|
75
|
+
nextTick,
|
|
76
|
+
useTemplateRef
|
|
77
|
+
} from "#imports";
|
|
70
78
|
import { Icon, ScrollBoundary } from "#blokkli/components";
|
|
71
79
|
import { modulo } from "#blokkli/helpers";
|
|
72
80
|
import ResultsPage from "./Results/Page/index.vue";
|
|
@@ -105,8 +113,8 @@ const tabs = computed(() => Object.keys(tabsMap.value));
|
|
|
105
113
|
const tabIndex = ref(0);
|
|
106
114
|
const tab = computed(() => tabs.value[tabIndex.value]);
|
|
107
115
|
const search = ref("");
|
|
108
|
-
const input =
|
|
109
|
-
const resultsEl =
|
|
116
|
+
const input = useTemplateRef("input");
|
|
117
|
+
const resultsEl = useTemplateRef("resultsEl");
|
|
110
118
|
watch(search, () => {
|
|
111
119
|
const component = getResultsComponent();
|
|
112
120
|
if (component) {
|
|
@@ -8,40 +8,60 @@
|
|
|
8
8
|
@close="$emit('close')"
|
|
9
9
|
>
|
|
10
10
|
<div
|
|
11
|
-
ref="
|
|
12
|
-
class="bk-selection-add-overlay-
|
|
13
|
-
@wheel="onWheel"
|
|
11
|
+
ref="scrollEl"
|
|
12
|
+
class="bk-selection-add-overlay-wrapper bk-scrollbar-dark"
|
|
14
13
|
>
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
14
|
+
<div
|
|
15
|
+
class="bk-selection-add-overlay-form"
|
|
16
|
+
@pointerdown.stop
|
|
17
|
+
@keydown.capture.stop
|
|
18
|
+
@keyup.capture.stop
|
|
19
|
+
>
|
|
20
|
+
<form
|
|
21
|
+
class="bk-selection-add-overlay-form-input"
|
|
22
|
+
@submit.prevent.stop="onSubmitForm"
|
|
23
|
+
>
|
|
24
|
+
<Icon name="search" />
|
|
25
|
+
<input
|
|
26
|
+
ref="inputEl"
|
|
27
|
+
v-model="searchText"
|
|
28
|
+
type="text"
|
|
29
|
+
:placeholder="$t('searchBoxPlaceholder', 'Enter search term')"
|
|
30
|
+
/>
|
|
31
|
+
<button
|
|
32
|
+
v-if="searchText"
|
|
33
|
+
type="button"
|
|
34
|
+
tabindex="-1"
|
|
35
|
+
@click.prevent="onClearSearchText"
|
|
36
|
+
>
|
|
37
|
+
<Icon name="close" />
|
|
38
|
+
</button>
|
|
39
|
+
</form>
|
|
40
|
+
</div>
|
|
41
|
+
<div
|
|
42
|
+
ref="wrapperEl"
|
|
43
|
+
:style="{
|
|
44
|
+
width,
|
|
45
|
+
height
|
|
46
|
+
}"
|
|
47
|
+
>
|
|
48
|
+
<div class="bk-selection-add-overlay-list" @wheel="onWheel">
|
|
49
|
+
<AddListItem
|
|
50
|
+
v-for="item in items"
|
|
51
|
+
v-show="isVisible(item)"
|
|
52
|
+
:key="item.props.id"
|
|
53
|
+
v-bind="item.props"
|
|
54
|
+
@click.prevent="onClick(item)"
|
|
55
|
+
/>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
38
58
|
</div>
|
|
39
59
|
</ArtboardTooltip>
|
|
40
60
|
</template>
|
|
41
61
|
|
|
42
62
|
<script setup>
|
|
43
|
-
import { useTemplateRef, useBlokkli, computed } from "#imports";
|
|
44
|
-
import { ArtboardTooltip, AddListItem } from "#blokkli/components";
|
|
63
|
+
import { useTemplateRef, useBlokkli, computed, ref, watch } from "#imports";
|
|
64
|
+
import { ArtboardTooltip, AddListItem, Icon } from "#blokkli/components";
|
|
45
65
|
import { isInternalBundle } from "#blokkli/helpers/bundles";
|
|
46
66
|
const props = defineProps({
|
|
47
67
|
bundles: { type: Array, required: true },
|
|
@@ -49,12 +69,36 @@ const props = defineProps({
|
|
|
49
69
|
anchorCoordinates: { type: Object, required: false },
|
|
50
70
|
label: { type: String, required: true }
|
|
51
71
|
});
|
|
52
|
-
defineEmits(["select", "action", "close"]);
|
|
53
|
-
const
|
|
72
|
+
const emit = defineEmits(["select", "action", "close"]);
|
|
73
|
+
const searchText = ref("");
|
|
74
|
+
const width = ref("auto");
|
|
75
|
+
const height = ref("auto");
|
|
76
|
+
const wrapperEl = useTemplateRef("wrapperEl");
|
|
77
|
+
const scrollEl = useTemplateRef("scrollEl");
|
|
78
|
+
const inputEl = useTemplateRef("inputEl");
|
|
54
79
|
let hasScrollbar = null;
|
|
55
|
-
|
|
80
|
+
watch(
|
|
81
|
+
searchText,
|
|
82
|
+
() => {
|
|
83
|
+
if (wrapperEl.value) {
|
|
84
|
+
const rect = wrapperEl.value.getBoundingClientRect();
|
|
85
|
+
width.value = rect.width + "px";
|
|
86
|
+
height.value = rect.height + "px";
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
once: true
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
function onClearSearchText() {
|
|
94
|
+
if (inputEl.value) {
|
|
95
|
+
inputEl.value.focus();
|
|
96
|
+
}
|
|
97
|
+
searchText.value = "";
|
|
98
|
+
}
|
|
99
|
+
const { types, plugins, storage, $t } = useBlokkli();
|
|
56
100
|
const favorites = storage.use("blockFavorites", []);
|
|
57
|
-
const
|
|
101
|
+
const blocks = computed(() => {
|
|
58
102
|
return props.bundles.filter((bundle) => !isInternalBundle(bundle)).map((bundle) => {
|
|
59
103
|
return {
|
|
60
104
|
bundle,
|
|
@@ -65,6 +109,19 @@ const items = computed(() => {
|
|
|
65
109
|
if (a.isFavorite && !b.isFavorite) return -1;
|
|
66
110
|
if (!a.isFavorite && b.isFavorite) return 1;
|
|
67
111
|
return a.label.localeCompare(b.label);
|
|
112
|
+
}).map((block) => {
|
|
113
|
+
return {
|
|
114
|
+
type: "block",
|
|
115
|
+
bundle: block.bundle,
|
|
116
|
+
searchText: block.label.toLowerCase(),
|
|
117
|
+
props: {
|
|
118
|
+
id: block.bundle,
|
|
119
|
+
label: block.label,
|
|
120
|
+
bundle: block.bundle,
|
|
121
|
+
color: block.isFavorite ? "yellow" : void 0,
|
|
122
|
+
context: "selection-add-buttons"
|
|
123
|
+
}
|
|
124
|
+
};
|
|
68
125
|
});
|
|
69
126
|
});
|
|
70
127
|
const actions = computed(() => {
|
|
@@ -73,11 +130,34 @@ const actions = computed(() => {
|
|
|
73
130
|
return true;
|
|
74
131
|
}
|
|
75
132
|
return props.bundles.includes(action.itemBundle);
|
|
133
|
+
}).map((action) => {
|
|
134
|
+
return {
|
|
135
|
+
type: "action",
|
|
136
|
+
action,
|
|
137
|
+
searchText: action.title + " " + (action.description ?? ""),
|
|
138
|
+
props: {
|
|
139
|
+
id: action.id,
|
|
140
|
+
label: action.title,
|
|
141
|
+
color: action.color,
|
|
142
|
+
context: "selection-add-buttons",
|
|
143
|
+
icon: action.icon,
|
|
144
|
+
noContextMenu: true
|
|
145
|
+
}
|
|
146
|
+
};
|
|
76
147
|
});
|
|
77
148
|
});
|
|
149
|
+
const items = computed(() => {
|
|
150
|
+
return [...blocks.value, ...actions.value];
|
|
151
|
+
});
|
|
152
|
+
function isVisible(item) {
|
|
153
|
+
if (!searchText.value) {
|
|
154
|
+
return true;
|
|
155
|
+
}
|
|
156
|
+
return item.searchText.includes(searchText.value);
|
|
157
|
+
}
|
|
78
158
|
const onWheel = (e) => {
|
|
79
159
|
if (hasScrollbar === null) {
|
|
80
|
-
const element =
|
|
160
|
+
const element = scrollEl.value;
|
|
81
161
|
hasScrollbar = element && element.scrollHeight > element.clientHeight;
|
|
82
162
|
}
|
|
83
163
|
if (hasScrollbar) {
|
|
@@ -86,4 +166,17 @@ const onWheel = (e) => {
|
|
|
86
166
|
}
|
|
87
167
|
}
|
|
88
168
|
};
|
|
169
|
+
function onClick(item) {
|
|
170
|
+
if (item.type === "block") {
|
|
171
|
+
emit("select", item.bundle);
|
|
172
|
+
} else if (item.type === "action") {
|
|
173
|
+
emit("action", item.action);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
function onSubmitForm() {
|
|
177
|
+
const firstResult = items.value.find((item) => isVisible(item));
|
|
178
|
+
if (firstResult) {
|
|
179
|
+
onClick(firstResult);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
89
182
|
</script>
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import vs from "./vertex.glsl?raw";
|
|
15
15
|
import fs from "./fragment.glsl?raw";
|
|
16
16
|
import { RectangleBufferCollector } from "#blokkli/helpers/webgl";
|
|
17
|
-
import { useTransitionedValue } from "#blokkli/helpers/useTransitionedValue";
|
|
17
|
+
import { useTransitionedValue } from "#blokkli/helpers/composables/useTransitionedValue";
|
|
18
18
|
import { toShaderColor } from "#blokkli/helpers";
|
|
19
19
|
const props = defineProps({
|
|
20
20
|
blocks: { type: Array, required: true },
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<script setup>
|
|
10
10
|
import { useBlokkli, defineBlokkliFeature, computed } from "#imports";
|
|
11
11
|
import SettingsDialog from "./Dialog/index.vue";
|
|
12
|
-
import { addElementClasses } from "#blokkli/helpers/addElementClasses";
|
|
12
|
+
import { addElementClasses } from "#blokkli/helpers/composables/addElementClasses";
|
|
13
13
|
import { BlokkliTransition } from "#blokkli/components";
|
|
14
14
|
import defineMenuButton from "#blokkli/helpers/composables/defineMenuButton";
|
|
15
15
|
const { ui, $t } = useBlokkli();
|
|
@@ -50,13 +50,13 @@
|
|
|
50
50
|
|
|
51
51
|
<script setup>
|
|
52
52
|
import {
|
|
53
|
-
ref,
|
|
54
53
|
useBlokkli,
|
|
55
54
|
computed,
|
|
56
55
|
inject,
|
|
57
56
|
onMounted,
|
|
58
57
|
onBeforeUnmount,
|
|
59
|
-
nextTick
|
|
58
|
+
nextTick,
|
|
59
|
+
useTemplateRef
|
|
60
60
|
} from "#imports";
|
|
61
61
|
import Item from "./../Item/index.vue";
|
|
62
62
|
const props = defineProps({
|
|
@@ -109,7 +109,7 @@ function onClickFieldLabel() {
|
|
|
109
109
|
list.value.map((v) => v.uuid)
|
|
110
110
|
);
|
|
111
111
|
}
|
|
112
|
-
const el =
|
|
112
|
+
const el = useTemplateRef("el");
|
|
113
113
|
const observer = inject("bk_structure_observer");
|
|
114
114
|
const isVisible = computed(() => !!props.visibleFieldKeys[key.value]);
|
|
115
115
|
const bundlesAllowed = computed(
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
</template>
|
|
52
52
|
|
|
53
53
|
<script setup>
|
|
54
|
-
import { useBlokkli, computed, ref } from "#imports";
|
|
54
|
+
import { useBlokkli, computed, ref, useTemplateRef } from "#imports";
|
|
55
55
|
import { falsy, modulo } from "#blokkli/helpers";
|
|
56
56
|
import { Icon, ShortcutIndicator } from "#blokkli/components";
|
|
57
57
|
import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
|
|
@@ -86,7 +86,7 @@ const tooltipStyle = computed(() => {
|
|
|
86
86
|
});
|
|
87
87
|
const { tour, ui, $t } = useBlokkli();
|
|
88
88
|
const activeIndex = ref(0);
|
|
89
|
-
const contentEl =
|
|
89
|
+
const contentEl = useTemplateRef("contentEl");
|
|
90
90
|
const tooltipHeight = ref(100);
|
|
91
91
|
const tooltipWidth = computed(() => {
|
|
92
92
|
return ui.isMobile.value ? Math.min(window.innerWidth - 20, 400) : 400;
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
}"
|
|
39
39
|
@click.prevent="onClickPreview"
|
|
40
40
|
>
|
|
41
|
-
{{
|
|
41
|
+
{{ previewButtonLabel }}
|
|
42
42
|
</button>
|
|
43
43
|
<button
|
|
44
44
|
class="bk-button bk-is-orange"
|
|
@@ -94,6 +94,12 @@ function mapValues(values) {
|
|
|
94
94
|
const hasSeedInput = computed(
|
|
95
95
|
() => !!props.plugin.configInputs?.find((v) => v.type === "seed")
|
|
96
96
|
);
|
|
97
|
+
const previewButtonLabel = computed(() => {
|
|
98
|
+
if (hasSeedInput.value) {
|
|
99
|
+
return $t("transformDialogButtonNewSuggestion", "New suggestion");
|
|
100
|
+
}
|
|
101
|
+
return $t("transformDialogButtonPreview", "Preview");
|
|
102
|
+
});
|
|
97
103
|
const isLocked = ref(false);
|
|
98
104
|
const hasChanged = ref(false);
|
|
99
105
|
const isPreviewing = ref(false);
|
|
@@ -41,7 +41,7 @@ function onClose() {
|
|
|
41
41
|
}
|
|
42
42
|
onBlokkliEvent("overlay:close", onClose);
|
|
43
43
|
onMounted(() => {
|
|
44
|
-
ui.openDialog({ id: props.id, alignment: "right" });
|
|
44
|
+
ui.openDialog({ id: props.id, alignment: "right", confirmClose: true });
|
|
45
45
|
});
|
|
46
46
|
onBeforeUnmount(() => {
|
|
47
47
|
ui.closeDialog(props.id);
|
|
@@ -98,7 +98,7 @@ onBlokkliEvent("state:reloaded", () => {
|
|
|
98
98
|
prevRects.clear();
|
|
99
99
|
});
|
|
100
100
|
onBlokkliEvent("scrollIntoView", (e) => {
|
|
101
|
-
if ("element" in e) {
|
|
101
|
+
if ("element" in e && e.highlight) {
|
|
102
102
|
if (artboardElement.contains(e.element)) {
|
|
103
103
|
highlighted.value = ui.getAbsoluteElementRect(e.element);
|
|
104
104
|
} else {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="bk-info-box">
|
|
3
|
-
<Icon name="
|
|
3
|
+
<Icon :name="icon" />
|
|
4
4
|
<div>
|
|
5
5
|
<slot>
|
|
6
6
|
<p v-html="text" />
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
<script setup>
|
|
13
13
|
import { Icon } from "#blokkli/components";
|
|
14
14
|
defineProps({
|
|
15
|
-
text: { type: String, required: false }
|
|
15
|
+
text: { type: String, required: false, default: void 0 },
|
|
16
|
+
icon: { type: null, required: false, default: "info" }
|
|
16
17
|
});
|
|
17
18
|
</script>
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
import type { BlokkliIcon } from '#blokkli-build/icons';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
text?: string;
|
|
4
|
+
icon?: BlokkliIcon;
|
|
3
5
|
};
|
|
4
6
|
declare var __VLS_5: {};
|
|
5
7
|
type __VLS_Slots = {} & {
|
|
6
8
|
default?: (props: typeof __VLS_5) => any;
|
|
7
9
|
};
|
|
8
|
-
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
10
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
11
|
+
text: string;
|
|
12
|
+
icon: BlokkliIcon;
|
|
13
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
14
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
10
15
|
export default _default;
|
|
11
16
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -21,11 +21,11 @@ import {
|
|
|
21
21
|
INJECT_MUTATED_FIELDS_MAP
|
|
22
22
|
} from "#blokkli/helpers/symbols";
|
|
23
23
|
import { frameEventBus } from "#blokkli/helpers/frameEventBus";
|
|
24
|
-
import broadcastProvider from "#blokkli/helpers/
|
|
24
|
+
import broadcastProvider from "#blokkli/helpers/providers/broadcast";
|
|
25
25
|
import { getFieldKey, intersects } from "#blokkli/helpers";
|
|
26
26
|
import { eventBus } from "#blokkli/helpers/eventBus";
|
|
27
|
-
import definitionProvider from "../../helpers/
|
|
28
|
-
import { addElementClasses } from "#blokkli/helpers/addElementClasses";
|
|
27
|
+
import definitionProvider from "../../helpers/providers/definition";
|
|
28
|
+
import { addElementClasses } from "#blokkli/helpers/composables/addElementClasses";
|
|
29
29
|
const props = defineProps({
|
|
30
30
|
entity: { type: null, required: false },
|
|
31
31
|
entityType: { type: String, required: true },
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
<script setup>
|
|
12
12
|
import useAnimationFrame from "#blokkli/helpers/composables/useAnimationFrame";
|
|
13
|
-
import { ref, computed } from "#imports";
|
|
13
|
+
import { ref, computed, useTemplateRef } from "#imports";
|
|
14
14
|
const props = defineProps({
|
|
15
15
|
width: { type: Number, required: false },
|
|
16
16
|
maxHeight: { type: Number, required: false }
|
|
17
17
|
});
|
|
18
|
-
const rootEl =
|
|
19
|
-
const inner =
|
|
20
|
-
const wrapper =
|
|
18
|
+
const rootEl = useTemplateRef("rootEl");
|
|
19
|
+
const inner = useTemplateRef("inner");
|
|
20
|
+
const wrapper = useTemplateRef("wrapper");
|
|
21
21
|
const rootWidth = ref(260);
|
|
22
22
|
const nativeWidth = ref(0);
|
|
23
23
|
const nativeHeight = ref(0);
|
|
@@ -2,7 +2,7 @@ import { type ComputedRef } from '#imports';
|
|
|
2
2
|
import type { BlokkliAdapter, AdapterMethods } from '#blokkli/adapter';
|
|
3
3
|
import type { FeatureDefinition } from '#blokkli/types';
|
|
4
4
|
import type { ValidFeatureKey } from '#blokkli-build/features';
|
|
5
|
-
import type { DebugLogger } from '#blokkli/helpers/
|
|
5
|
+
import type { DebugLogger } from '#blokkli/helpers/providers/debug';
|
|
6
6
|
type SettingType<S> = S extends {
|
|
7
7
|
type: 'checkbox';
|
|
8
8
|
} ? boolean : S extends {
|
|
@@ -4,5 +4,10 @@ import type { BlokkliApp } from '#blokkli/types';
|
|
|
4
4
|
*
|
|
5
5
|
* The app is only available when the editor is mounted. Calling this
|
|
6
6
|
* composable in normal rendering does not work.
|
|
7
|
+
*
|
|
8
|
+
* @param optional - If true, returns undefined instead of throwing when not in edit mode
|
|
9
|
+
* @returns The blokkli app, or undefined if optional is true and not in edit mode
|
|
10
|
+
* @throws Error if not in edit mode and optional is false/undefined
|
|
7
11
|
*/
|
|
8
|
-
export declare function useBlokkli(): BlokkliApp;
|
|
12
|
+
export declare function useBlokkli(optional: true): BlokkliApp | undefined;
|
|
13
|
+
export declare function useBlokkli(optional?: false): BlokkliApp;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { INJECT_APP } from "../helpers/symbols.js";
|
|
2
2
|
import { inject } from "#imports";
|
|
3
|
-
export function useBlokkli() {
|
|
3
|
+
export function useBlokkli(optional) {
|
|
4
4
|
const app = inject(INJECT_APP);
|
|
5
5
|
if (!app) {
|
|
6
|
+
if (optional) {
|
|
7
|
+
return void 0;
|
|
8
|
+
}
|
|
6
9
|
throw new Error(
|
|
7
10
|
"The useBlokkli composable was called while not in edit mode."
|
|
8
11
|
);
|