@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div ref="root" class="bk-block-proxy"
|
|
2
|
+
<div ref="root" class="bk-block-proxy">
|
|
3
3
|
<div class="bk-block-proxy-header">
|
|
4
4
|
<ItemIcon :bundle="bundle" />
|
|
5
5
|
{{ type?.label }}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
import { computed, useBlokkli, ref } from "#imports";
|
|
34
34
|
import { getBlokkliItemProxyComponent } from "#blokkli/helpers/editComponents";
|
|
35
35
|
import { ItemIcon } from "#blokkli/components";
|
|
36
|
-
import {
|
|
36
|
+
import { falsy } from "#blokkli/helpers";
|
|
37
37
|
import { useBlockRegistration } from "#blokkli/helpers/composables/useBlockRegistration";
|
|
38
38
|
const props = defineProps({
|
|
39
39
|
uuid: { type: String, required: true },
|
|
@@ -55,12 +55,6 @@ const proxyComponentProps = computed(() => {
|
|
|
55
55
|
}
|
|
56
56
|
return props.itemProps;
|
|
57
57
|
});
|
|
58
|
-
const rootProps = computed(() => {
|
|
59
|
-
if (libraryItemProps.value) {
|
|
60
|
-
return buildAttributesForLibraryItem(libraryItemProps.value);
|
|
61
|
-
}
|
|
62
|
-
return {};
|
|
63
|
-
});
|
|
64
58
|
const proxyBundle = computed(
|
|
65
59
|
() => libraryItemProps.value?.block?.bundle || props.bundle
|
|
66
60
|
);
|
|
@@ -1,60 +1,44 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<slot />
|
|
3
|
-
|
|
4
|
-
<Teleport to="body">
|
|
5
|
-
<Transition name="bk-fade">
|
|
6
|
-
<div
|
|
7
|
-
v-if="errors.length"
|
|
8
|
-
class="bk bk-fatal-error-overlay"
|
|
9
|
-
@wheel.capture.passive.stop
|
|
10
|
-
@click.stop
|
|
11
|
-
@mousedown.stop
|
|
12
|
-
@touchstart.passive.stop
|
|
13
|
-
@mousemove.stop
|
|
14
|
-
>
|
|
15
|
-
<div class="bk-fatal-error-overlay-info">
|
|
16
|
-
<Icon name="sad" />
|
|
17
|
-
<div>
|
|
18
|
-
<h2>{{ $t("fatalErrorTitle", "bl\xF6kkli has stopped working") }}</h2>
|
|
19
|
-
<p>
|
|
20
|
-
{{
|
|
21
|
-
$t(
|
|
22
|
-
"fatalErrorText",
|
|
23
|
-
"Unfortunately bl\xF6kkli has encountered a fatal error which prevents it from working normally. You may be able to continue using it, but things may not work as expected."
|
|
24
|
-
)
|
|
25
|
-
}}
|
|
26
|
-
</p>
|
|
27
|
-
<button class="bk-button bk-is-danger" @click="errors = []">
|
|
28
|
-
{{ $t("fatalErrorButton", "Continue anyway...") }}
|
|
29
|
-
</button>
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
<div class="bk-fatal-error-overlay-list">
|
|
33
|
-
<div v-for="(e, i) in unique" :key="i">
|
|
34
|
-
<h3>{{ e.name }}: {{ e.message }}</h3>
|
|
35
|
-
<code>
|
|
36
|
-
<pre>{{ e.stack }}</pre>
|
|
37
|
-
</code>
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
</Transition>
|
|
42
|
-
</Teleport>
|
|
43
3
|
</template>
|
|
44
4
|
|
|
45
5
|
<script setup>
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import
|
|
6
|
+
import { emitMessage } from "#blokkli/helpers/eventBus";
|
|
7
|
+
import { ref, onErrorCaptured, useBlokkli } from "#imports";
|
|
8
|
+
import { useGlobalBlokkliObject } from "#blokkli/helpers/composables/useGlobalBlokkliObject";
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
label: { type: String, required: true }
|
|
11
|
+
});
|
|
12
|
+
const { $t } = useBlokkli();
|
|
13
|
+
const globalBlokkli = useGlobalBlokkliObject();
|
|
49
14
|
const errors = ref([]);
|
|
50
|
-
const
|
|
15
|
+
const isLocked = defineModel({ type: Boolean, ...{ default: false } });
|
|
16
|
+
const emit = defineEmits(["error"]);
|
|
51
17
|
onErrorCaptured((err) => {
|
|
52
18
|
errors.value.push(err);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
19
|
+
emit("error", err);
|
|
20
|
+
globalBlokkli.pushMessage({
|
|
21
|
+
type: "error",
|
|
22
|
+
name: "ErrorBoundary",
|
|
23
|
+
date: (/* @__PURE__ */ new Date()).toISOString(),
|
|
24
|
+
message: `[${props.label}] ${err.message}`,
|
|
25
|
+
context: err.stack || ""
|
|
58
26
|
});
|
|
27
|
+
const willBeLocked = errors.value.length >= 3;
|
|
28
|
+
if (willBeLocked) {
|
|
29
|
+
const message = $t(
|
|
30
|
+
"errorCapturedMessageDisabled",
|
|
31
|
+
'"@label" has errored more than 3 times. The feature will be disabled.'
|
|
32
|
+
).replace("@label", props.label).replace("@errorMessage", err.message);
|
|
33
|
+
emitMessage(message, "error", true);
|
|
34
|
+
} else {
|
|
35
|
+
const message = $t(
|
|
36
|
+
"errorCapturedMessage",
|
|
37
|
+
'Error in "@label": @errorMessage'
|
|
38
|
+
).replace("@label", props.label).replace("@errorMessage", err.message);
|
|
39
|
+
emitMessage(message, "warning");
|
|
40
|
+
}
|
|
41
|
+
isLocked.value = willBeLocked;
|
|
42
|
+
return false;
|
|
59
43
|
});
|
|
60
44
|
</script>
|
|
@@ -1,8 +1,21 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label: string;
|
|
3
|
+
};
|
|
4
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
5
|
+
modelValue?: boolean;
|
|
6
|
+
};
|
|
1
7
|
declare var __VLS_1: {};
|
|
2
8
|
type __VLS_Slots = {} & {
|
|
3
9
|
default?: (props: typeof __VLS_1) => any;
|
|
4
10
|
};
|
|
5
|
-
declare const __VLS_component: import("vue").DefineComponent<
|
|
11
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
"update:modelValue": (value: boolean) => any;
|
|
13
|
+
} & {
|
|
14
|
+
error: (error: Error) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
16
|
+
onError?: ((error: Error) => any) | undefined;
|
|
17
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
19
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
20
|
export default _default;
|
|
8
21
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<slot />
|
|
3
|
+
|
|
4
|
+
<Teleport to="body">
|
|
5
|
+
<Transition name="bk-fade">
|
|
6
|
+
<div
|
|
7
|
+
v-if="errors.length"
|
|
8
|
+
class="bk bk-fatal-error-overlay"
|
|
9
|
+
@wheel.capture.passive.stop
|
|
10
|
+
@click.stop
|
|
11
|
+
@mousedown.stop
|
|
12
|
+
@touchstart.passive.stop
|
|
13
|
+
@mousemove.stop
|
|
14
|
+
>
|
|
15
|
+
<div class="bk-fatal-error-overlay-info">
|
|
16
|
+
<Icon name="sad" />
|
|
17
|
+
<div>
|
|
18
|
+
<h2>{{ $t("fatalErrorTitle", "bl\xF6kkli has stopped working") }}</h2>
|
|
19
|
+
<p>
|
|
20
|
+
{{
|
|
21
|
+
$t(
|
|
22
|
+
"fatalErrorText",
|
|
23
|
+
"Unfortunately bl\xF6kkli has encountered a fatal error which prevents it from working normally. You may be able to continue using it, but things may not work as expected."
|
|
24
|
+
)
|
|
25
|
+
}}
|
|
26
|
+
</p>
|
|
27
|
+
<div class="bk-fatal-error-buttons">
|
|
28
|
+
<button class="bk-button bk-is-danger" @click="errors = []">
|
|
29
|
+
{{ $t("fatalErrorButton", "Continue anyway...") }}
|
|
30
|
+
</button>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="bk-fatal-error-overlay-list">
|
|
35
|
+
<h3>{{ title }}</h3>
|
|
36
|
+
<button class="bk-button" @click="downloadLogs">
|
|
37
|
+
{{ $t("downloadLogsButton", "Download Logs") }}
|
|
38
|
+
</button>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</Transition>
|
|
42
|
+
</Teleport>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script setup>
|
|
46
|
+
import { computed, ref, onErrorCaptured } from "#imports";
|
|
47
|
+
import { Icon } from "#blokkli/components";
|
|
48
|
+
import textProvider from "#blokkli/helpers/textProvider";
|
|
49
|
+
import { useGlobalBlokkliObject } from "#blokkli/helpers/composables/useGlobalBlokkliObject";
|
|
50
|
+
const errors = ref([]);
|
|
51
|
+
const $t = textProvider();
|
|
52
|
+
const globalBlokkli = useGlobalBlokkliObject();
|
|
53
|
+
onErrorCaptured((err) => {
|
|
54
|
+
errors.value.push(err);
|
|
55
|
+
globalBlokkli.pushMessage({
|
|
56
|
+
type: "error",
|
|
57
|
+
name: "RootErrorBoundary",
|
|
58
|
+
date: (/* @__PURE__ */ new Date()).toISOString(),
|
|
59
|
+
message: err.message,
|
|
60
|
+
context: err.stack || ""
|
|
61
|
+
});
|
|
62
|
+
return false;
|
|
63
|
+
});
|
|
64
|
+
const title = computed(() => {
|
|
65
|
+
return errors.value.filter((value, index, self) => {
|
|
66
|
+
return self.findIndex((v) => v.name === value.name) === index;
|
|
67
|
+
}).map((v) => {
|
|
68
|
+
return v.name + " " + v.message;
|
|
69
|
+
}).join("");
|
|
70
|
+
});
|
|
71
|
+
function downloadLogs() {
|
|
72
|
+
const messages = globalBlokkli.getMessages();
|
|
73
|
+
const header = "Type,Logger,Timestamp,Message,Context\n";
|
|
74
|
+
const rows = messages.map((msg) => {
|
|
75
|
+
const escapeCsv = (str) => `"${str.replace(/"/g, '""')}"`;
|
|
76
|
+
return [
|
|
77
|
+
escapeCsv(msg.type),
|
|
78
|
+
escapeCsv(msg.name),
|
|
79
|
+
escapeCsv(msg.date),
|
|
80
|
+
escapeCsv(msg.message),
|
|
81
|
+
escapeCsv(msg.context ?? "")
|
|
82
|
+
].join(",");
|
|
83
|
+
}).join("\n");
|
|
84
|
+
const csv = header + rows;
|
|
85
|
+
const blob = new Blob([csv], { type: "text/csv;charset=utf-8;" });
|
|
86
|
+
const url = URL.createObjectURL(blob);
|
|
87
|
+
const link = document.createElement("a");
|
|
88
|
+
link.href = url;
|
|
89
|
+
link.download = `blokkli-logs-${(/* @__PURE__ */ new Date()).toISOString()}.csv`;
|
|
90
|
+
link.click();
|
|
91
|
+
URL.revokeObjectURL(url);
|
|
92
|
+
}
|
|
93
|
+
</script>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
@touchmove.stop
|
|
10
10
|
@touchend.stop
|
|
11
11
|
>
|
|
12
|
-
<div class="bk-dialog-
|
|
13
|
-
<div class="bk-dialog-inner" :style="style">
|
|
12
|
+
<div class="bk-dialog-inner" :style>
|
|
14
13
|
<div class="bk bk-overlay-header">
|
|
15
14
|
<Icon v-if="icon" :name="icon" />
|
|
16
15
|
<h3>{{ title }}</h3>
|
|
@@ -53,13 +52,22 @@
|
|
|
53
52
|
</template>
|
|
54
53
|
|
|
55
54
|
<script setup>
|
|
56
|
-
import {
|
|
55
|
+
import {
|
|
56
|
+
useBlokkli,
|
|
57
|
+
onMounted,
|
|
58
|
+
computed,
|
|
59
|
+
ref,
|
|
60
|
+
onBeforeUnmount,
|
|
61
|
+
watch
|
|
62
|
+
} from "#imports";
|
|
57
63
|
import { Icon } from "#blokkli/components";
|
|
58
64
|
import { modulo } from "#blokkli/helpers";
|
|
65
|
+
import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
|
|
59
66
|
const { ui, element } = useBlokkli();
|
|
60
67
|
const emit = defineEmits(["submit", "cancel"]);
|
|
61
68
|
const rootEl = ref(null);
|
|
62
69
|
const props = defineProps({
|
|
70
|
+
id: { type: String, required: true },
|
|
63
71
|
title: { type: String, required: true },
|
|
64
72
|
lead: { type: String, required: false, default: "" },
|
|
65
73
|
width: { type: [Number, String], required: false, default: 600 },
|
|
@@ -71,6 +79,11 @@ const props = defineProps({
|
|
|
71
79
|
icon: { type: null, required: false, default: void 0 },
|
|
72
80
|
fullScreen: { type: Boolean, required: false }
|
|
73
81
|
});
|
|
82
|
+
watch(ui.currentDialog, (dialog) => {
|
|
83
|
+
if (dialog?.id !== props.id) {
|
|
84
|
+
emit("cancel");
|
|
85
|
+
}
|
|
86
|
+
});
|
|
74
87
|
const style = computed(() => {
|
|
75
88
|
if (ui.isMobile.value) {
|
|
76
89
|
return {};
|
|
@@ -100,6 +113,14 @@ const getFocusableElements = () => {
|
|
|
100
113
|
`Dialog "${props.title}" getFocusableElements`
|
|
101
114
|
);
|
|
102
115
|
};
|
|
116
|
+
onBlokkliEvent("keyPressed", (e) => {
|
|
117
|
+
if (e.code === "Escape") {
|
|
118
|
+
emit("cancel");
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
onBlokkliEvent("overlay:close", () => {
|
|
122
|
+
emit("cancel");
|
|
123
|
+
});
|
|
103
124
|
const onKeyDown = (e) => {
|
|
104
125
|
if (e.code === "Escape") {
|
|
105
126
|
e.preventDefault();
|
|
@@ -129,8 +150,8 @@ const onKeyDown = (e) => {
|
|
|
129
150
|
e.preventDefault();
|
|
130
151
|
}
|
|
131
152
|
};
|
|
153
|
+
ui.openDialog({ id: props.id, alignment: "center" });
|
|
132
154
|
onMounted(() => {
|
|
133
|
-
ui.hasDialogOpen.value = true;
|
|
134
155
|
const focusableElements = getFocusableElements();
|
|
135
156
|
const bestMatch = focusableElements.find((el) => !(el instanceof HTMLButtonElement)) || focusableElements[0];
|
|
136
157
|
if (bestMatch) {
|
|
@@ -138,7 +159,7 @@ onMounted(() => {
|
|
|
138
159
|
}
|
|
139
160
|
});
|
|
140
161
|
onBeforeUnmount(() => {
|
|
141
|
-
ui.
|
|
162
|
+
ui.closeDialog(props.id);
|
|
142
163
|
});
|
|
143
164
|
</script>
|
|
144
165
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BlokkliIcon } from '#blokkli-build/icons';
|
|
2
2
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
3
|
+
id: string;
|
|
3
4
|
title: string;
|
|
4
5
|
lead?: string;
|
|
5
6
|
width?: number | string;
|
|
@@ -14,6 +15,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
14
15
|
cancel: (...args: any[]) => void;
|
|
15
16
|
submit: (...args: any[]) => void;
|
|
16
17
|
}, string, import("vue").PublicProps, Readonly<{
|
|
18
|
+
id: string;
|
|
17
19
|
title: string;
|
|
18
20
|
lead?: string;
|
|
19
21
|
width?: number | string;
|
|
@@ -16,25 +16,15 @@
|
|
|
16
16
|
<BlokkliItem
|
|
17
17
|
v-for="(item, i) in list"
|
|
18
18
|
:key="item.uuid + fieldListType + definitions.renderKey.value"
|
|
19
|
+
class="bk-field-list-item"
|
|
19
20
|
:uuid="item.uuid"
|
|
20
21
|
:bundle="item.bundle"
|
|
21
22
|
:options="item.options"
|
|
22
23
|
:props="item.props"
|
|
23
24
|
is-editing
|
|
24
25
|
:index="i"
|
|
26
|
+
:data-bk-uuid="item.uuid"
|
|
25
27
|
:parent-type="isNested ? entity.bundle : ''"
|
|
26
|
-
data-editing="true"
|
|
27
|
-
data-element-type="existing"
|
|
28
|
-
:data-sortli-id="item.uuid"
|
|
29
|
-
:data-uuid="item.uuid"
|
|
30
|
-
:data-host-type="entity.type"
|
|
31
|
-
:data-host-bundle="entity.bundle"
|
|
32
|
-
:data-host-uuid="entity.uuid"
|
|
33
|
-
:data-item-bundle="item.bundle"
|
|
34
|
-
:data-host-field-name="name"
|
|
35
|
-
:data-host-field-list-type="fieldListType"
|
|
36
|
-
:data-is-nested="isNested"
|
|
37
|
-
:data-entity-type="runtimeConfig.itemEntityType"
|
|
38
28
|
:data-bk-is-muted="isMuted(item)"
|
|
39
29
|
/>
|
|
40
30
|
</div>
|
|
@@ -48,6 +38,7 @@
|
|
|
48
38
|
<BlokkliItem
|
|
49
39
|
v-for="(item, i) in list"
|
|
50
40
|
:key="item.uuid + fieldListType"
|
|
41
|
+
class="bk-field-list-item"
|
|
51
42
|
:uuid="item.uuid"
|
|
52
43
|
:bundle="item.bundle"
|
|
53
44
|
:options="item.options"
|
|
@@ -55,18 +46,7 @@
|
|
|
55
46
|
is-editing
|
|
56
47
|
:index="i"
|
|
57
48
|
:parent-type="isNested ? entity.bundle : ''"
|
|
58
|
-
data-
|
|
59
|
-
data-element-type="existing"
|
|
60
|
-
:data-sortli-id="item.uuid"
|
|
61
|
-
:data-uuid="item.uuid"
|
|
62
|
-
:data-host-type="entity.type"
|
|
63
|
-
:data-host-bundle="entity.bundle"
|
|
64
|
-
:data-host-uuid="entity.uuid"
|
|
65
|
-
:data-item-bundle="item.bundle"
|
|
66
|
-
:data-host-field-name="name"
|
|
67
|
-
:data-host-field-list-type="fieldListType"
|
|
68
|
-
:data-is-nested="isNested"
|
|
69
|
-
:data-entity-type="runtimeConfig.itemEntityType"
|
|
49
|
+
:data-bk-uuid="item.uuid"
|
|
70
50
|
:data-bk-is-muted="isMuted(item)"
|
|
71
51
|
/>
|
|
72
52
|
</Component>
|
|
@@ -89,7 +69,7 @@ import {
|
|
|
89
69
|
INJECT_FIELD_PROXY_MODE,
|
|
90
70
|
INJECT_IS_EDITING
|
|
91
71
|
} from "#blokkli/helpers/symbols";
|
|
92
|
-
const { dom,
|
|
72
|
+
const { dom, selection, definitions } = useBlokkli();
|
|
93
73
|
const root = ref(null);
|
|
94
74
|
const props = defineProps({
|
|
95
75
|
name: { type: String, required: true },
|
|
@@ -1,35 +1,43 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<Teleport to="#nuxt-root">
|
|
3
|
+
<div id="bk-canvas-overlay" class="bk bk-canvas-overlay" />
|
|
4
|
+
</Teleport>
|
|
5
|
+
|
|
2
6
|
<Teleport to="body">
|
|
3
7
|
<Transition :name="ui.useAnimations.value ? 'bk-loading' : void 0">
|
|
4
8
|
<Loading v-if="showLoading" screen />
|
|
5
9
|
</Transition>
|
|
6
10
|
|
|
7
|
-
<div
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
id="state-unavailable"
|
|
12
|
-
icon="sad"
|
|
13
|
-
scheme="red"
|
|
14
|
-
:text="stateNotAvailableText"
|
|
15
|
-
/>
|
|
16
|
-
<Banner
|
|
17
|
-
v-if="viewOnlyBanner"
|
|
18
|
-
id="view-only"
|
|
19
|
-
:icon="viewOnlyBanner.icon"
|
|
20
|
-
scheme="yellow"
|
|
21
|
-
:text="viewOnlyBanner.text"
|
|
22
|
-
/>
|
|
11
|
+
<div ref="mainLayoutElement" class="bk-main-layout">
|
|
12
|
+
<Toolbar @loaded="toolbarLoaded = true" />
|
|
13
|
+
<div ref="viewportElement" class="bk bk-viewport">
|
|
14
|
+
<Messages />
|
|
23
15
|
</div>
|
|
24
|
-
<
|
|
16
|
+
<Actions v-if="!isInitializing" />
|
|
17
|
+
<div id="bk-banner-container" class="bk">
|
|
18
|
+
<div id="bk-banner-list">
|
|
19
|
+
<Banner
|
|
20
|
+
v-if="!state.stateAvailable.value"
|
|
21
|
+
id="state-unavailable"
|
|
22
|
+
icon="sad"
|
|
23
|
+
scheme="red"
|
|
24
|
+
:text="stateNotAvailableText"
|
|
25
|
+
/>
|
|
26
|
+
<Banner
|
|
27
|
+
v-if="viewOnlyBanner"
|
|
28
|
+
id="view-only"
|
|
29
|
+
:icon="viewOnlyBanner.icon"
|
|
30
|
+
scheme="yellow"
|
|
31
|
+
:text="viewOnlyBanner.text"
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
<Konami />
|
|
36
|
+
<SystemRequirements />
|
|
37
|
+
<Overlay />
|
|
25
38
|
</div>
|
|
26
39
|
</Teleport>
|
|
27
|
-
|
|
28
|
-
<div id="bk-canvas-overlay" class="bk bk-canvas-overlay" />
|
|
29
|
-
</Teleport>
|
|
30
|
-
<Actions v-if="!isInitializing" />
|
|
31
|
-
<Toolbar @loaded="toolbarLoaded = true" />
|
|
32
|
-
<AppMenu v-if="toolbarLoaded" />
|
|
40
|
+
|
|
33
41
|
<Indicators />
|
|
34
42
|
<Features
|
|
35
43
|
v-if="isReady"
|
|
@@ -37,12 +45,10 @@
|
|
|
37
45
|
@loaded="featuresLoaded = true"
|
|
38
46
|
/>
|
|
39
47
|
<AnimationCanvas v-if="!isInitializing" />
|
|
40
|
-
<Konami />
|
|
41
|
-
<SystemRequirements />
|
|
42
48
|
<slot
|
|
43
49
|
v-if="!isInitializing"
|
|
44
50
|
:key="definitions.renderKey.value"
|
|
45
|
-
:mutated-entity
|
|
51
|
+
:mutated-entity
|
|
46
52
|
/>
|
|
47
53
|
</template>
|
|
48
54
|
|
|
@@ -57,7 +63,9 @@ import {
|
|
|
57
63
|
useRuntimeConfig,
|
|
58
64
|
nextTick,
|
|
59
65
|
inject,
|
|
60
|
-
onUnmounted
|
|
66
|
+
onUnmounted,
|
|
67
|
+
watch,
|
|
68
|
+
useTemplateRef
|
|
61
69
|
} from "#imports";
|
|
62
70
|
import Toolbar from "./Toolbar/index.vue";
|
|
63
71
|
import Actions from "./Actions/index.vue";
|
|
@@ -65,10 +73,10 @@ import Loading from "./Loading/index.vue";
|
|
|
65
73
|
import Messages from "./Messages/index.vue";
|
|
66
74
|
import Features from "./Features/index.vue";
|
|
67
75
|
import Indicators from "./Indicators/index.vue";
|
|
68
|
-
import AppMenu from "./AppMenu/index.vue";
|
|
69
76
|
import DraggableList from "./DraggableList.vue";
|
|
70
77
|
import AnimationCanvas from "./AnimationCanvas/index.vue";
|
|
71
78
|
import SystemRequirements from "./SystemRequirements/index.vue";
|
|
79
|
+
import Overlay from "./Overlay/index.vue";
|
|
72
80
|
import Konami from "./Konami/index.vue";
|
|
73
81
|
import Banner from "./Banner/index.vue";
|
|
74
82
|
import animationProvider from "./../../helpers/animationProvider";
|
|
@@ -109,6 +117,7 @@ import {
|
|
|
109
117
|
} from "#blokkli/helpers/symbols";
|
|
110
118
|
import { useBlockRegistration } from "#blokkli/helpers/composables/useBlockRegistration";
|
|
111
119
|
import { addElementClasses } from "#blokkli/helpers/addElementClasses";
|
|
120
|
+
import { falsy } from "#blokkli/helpers";
|
|
112
121
|
const props = defineProps({
|
|
113
122
|
entity: { type: null, required: false, default: void 0 },
|
|
114
123
|
entityType: { type: String, required: true },
|
|
@@ -120,6 +129,8 @@ const props = defineProps({
|
|
|
120
129
|
providerEl: { type: null, required: true }
|
|
121
130
|
});
|
|
122
131
|
defineSlots();
|
|
132
|
+
const mainLayoutElement = useTemplateRef("mainLayoutElement");
|
|
133
|
+
const viewportElement = useTemplateRef("viewportElement");
|
|
123
134
|
const entityContext = computed(() => {
|
|
124
135
|
return {
|
|
125
136
|
uuid: props.entityUuid,
|
|
@@ -149,26 +160,35 @@ const state = await editStateProvider(
|
|
|
149
160
|
context,
|
|
150
161
|
$t,
|
|
151
162
|
providerKey,
|
|
152
|
-
props.permissions
|
|
163
|
+
props.permissions.filter(falsy)
|
|
153
164
|
);
|
|
154
165
|
const storage = await storageProvider(adapter, context);
|
|
166
|
+
const plugins = pluginProvider();
|
|
155
167
|
const debug = debugProvider(storage);
|
|
168
|
+
const baseLogger = debug.createLogger("EditProvider");
|
|
169
|
+
baseLogger.log("Entity: ", context.value);
|
|
156
170
|
const element = elementProvider(debug);
|
|
157
171
|
const features = featuresProvider(storage);
|
|
158
172
|
const commands = commandsProvider();
|
|
159
173
|
const tour = tourProvider();
|
|
160
174
|
const dropAreas = dropAreasProvider();
|
|
161
175
|
const broadcast = broadcastProvider();
|
|
162
|
-
const ui = uiProvider(
|
|
176
|
+
const ui = uiProvider(
|
|
177
|
+
props.providerEl,
|
|
178
|
+
storage,
|
|
179
|
+
context,
|
|
180
|
+
element,
|
|
181
|
+
mainLayoutElement,
|
|
182
|
+
viewportElement
|
|
183
|
+
);
|
|
163
184
|
const dom = domProvider(ui, debug, definitions, state, element);
|
|
164
185
|
const theme = themeProvider(element);
|
|
165
186
|
const blocks = blocksProvider(state, dom, context);
|
|
166
187
|
const selection = selectionProvider(blocks);
|
|
167
|
-
const animation = animationProvider(ui, storage, selection,
|
|
188
|
+
const animation = animationProvider(ui, storage, selection, debug);
|
|
168
189
|
const keyboard = keyboardProvider(animation);
|
|
169
190
|
const types = await typesProvider(adapter, selection, context);
|
|
170
191
|
const indicators = indicatorsProvider();
|
|
171
|
-
const plugins = pluginProvider();
|
|
172
192
|
const directive = directiveProvider(debug, ui);
|
|
173
193
|
const fields = fieldsProvider(state, dom, types);
|
|
174
194
|
const mutatedEntity = computed(() => {
|
|
@@ -178,8 +198,13 @@ const mutatedEntity = computed(() => {
|
|
|
178
198
|
};
|
|
179
199
|
});
|
|
180
200
|
const isReady = computed(
|
|
181
|
-
() => !isInitializing.value && dom.isReady.value && directive.isReady.value && toolbarLoaded.value
|
|
201
|
+
() => !isInitializing.value && dom.isReady.value && directive.isReady.value && toolbarLoaded.value && mainLayoutElement.value
|
|
182
202
|
);
|
|
203
|
+
watch(isReady, (v) => {
|
|
204
|
+
if (v) {
|
|
205
|
+
baseLogger.log("is ready");
|
|
206
|
+
}
|
|
207
|
+
});
|
|
183
208
|
const showLoading = computed(() => {
|
|
184
209
|
return !isReady.value || !featuresLoaded.value;
|
|
185
210
|
});
|
|
@@ -206,7 +231,6 @@ addElementClasses(
|
|
|
206
231
|
"bk-isolate-provider",
|
|
207
232
|
shouldIsolate
|
|
208
233
|
);
|
|
209
|
-
const baseLogger = debug.createLogger("EditProvider");
|
|
210
234
|
function setElementSymbolProperty(el, symbol, value) {
|
|
211
235
|
el[symbol] = value;
|
|
212
236
|
}
|
|
@@ -296,7 +320,17 @@ const viewOnlyBanner = computed(
|
|
|
296
320
|
const isProxyMode = computed(() => ui.isProxyMode.value);
|
|
297
321
|
provide(INJECT_GLOBAL_PROXY_MODE, isProxyMode);
|
|
298
322
|
if (import.meta.hot) {
|
|
299
|
-
|
|
323
|
+
import.meta.hot.accept("#blokkli/runtime-helpers", () => {
|
|
324
|
+
});
|
|
325
|
+
import.meta.hot.accept("#blokkli/helpers/runtimeHelpers", () => {
|
|
326
|
+
});
|
|
327
|
+
import.meta.hot.on("vite:afterUpdate", (payload) => {
|
|
328
|
+
const hasUpdatedRenderer = payload.updates.find(
|
|
329
|
+
(v) => v.path.includes("/Renderer/")
|
|
330
|
+
);
|
|
331
|
+
if (hasUpdatedRenderer) {
|
|
332
|
+
animation.reset();
|
|
333
|
+
}
|
|
300
334
|
try {
|
|
301
335
|
eventBus.emit("state:reloaded");
|
|
302
336
|
dom.updateVisibleRects();
|
|
@@ -311,14 +345,10 @@ if (import.meta.hot) {
|
|
|
311
345
|
});
|
|
312
346
|
} catch {
|
|
313
347
|
}
|
|
314
|
-
};
|
|
315
|
-
import.meta.hot.accept("#blokkli/runtime-helpers", () => {
|
|
316
|
-
});
|
|
317
|
-
import.meta.hot.accept("#blokkli/helpers/runtimeHelpers", () => {
|
|
318
348
|
});
|
|
319
|
-
import.meta.hot.on("vite:afterUpdate", onAfterUpdate);
|
|
320
349
|
}
|
|
321
350
|
onMounted(async () => {
|
|
351
|
+
baseLogger.log("onMounted - START");
|
|
322
352
|
setElementSymbolProperty(props.providerEl, INJECT_APP, app);
|
|
323
353
|
setElementSymbolProperty(
|
|
324
354
|
props.providerEl,
|
|
@@ -328,12 +358,12 @@ onMounted(async () => {
|
|
|
328
358
|
window.addEventListener("contextmenu", onContextMenu);
|
|
329
359
|
document.documentElement.addEventListener("touchmove", onTouchMove);
|
|
330
360
|
document.documentElement.addEventListener("touchstart", onTouchStart);
|
|
331
|
-
baseLogger.log("EditProvider mounted");
|
|
332
361
|
dom.init();
|
|
333
362
|
directive.init();
|
|
334
363
|
await nextTick();
|
|
335
364
|
isInitializing.value = false;
|
|
336
365
|
broadcast.emit("editorLoaded", { uuid: props.entityUuid });
|
|
366
|
+
baseLogger.log("onMounted - END");
|
|
337
367
|
});
|
|
338
368
|
onBeforeUnmount(() => {
|
|
339
369
|
window.removeEventListener("contextmenu", onContextMenu);
|
|
@@ -8,7 +8,7 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
|
|
|
8
8
|
entityBundle: string;
|
|
9
9
|
language?: string;
|
|
10
10
|
isolate?: boolean;
|
|
11
|
-
permissions: EditPermission
|
|
11
|
+
permissions: Array<EditPermission | null>;
|
|
12
12
|
providerEl: HTMLElement;
|
|
13
13
|
} & Partial<{}>> & import("vue").PublicProps;
|
|
14
14
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|