@blokkli/editor 2.0.0-alpha.23 → 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.
Files changed (115) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +62 -66
  3. package/dist/runtime/blokkliPlugins/ContextMenu/index.vue +1 -1
  4. package/dist/runtime/blokkliPlugins/Sidebar/index.vue.d.ts +1 -1
  5. package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue +5 -1
  6. package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue.d.ts +2 -0
  7. package/dist/runtime/blokkliPlugins/TourItem/index.vue +22 -13
  8. package/dist/runtime/blokkliPlugins/TourItem/index.vue.d.ts +1 -0
  9. package/dist/runtime/blokkliPlugins/index.d.ts +1 -3
  10. package/dist/runtime/blokkliPlugins/index.js +0 -4
  11. package/dist/runtime/components/BlokkliProvider.vue.d.ts +1 -1
  12. package/dist/runtime/components/Edit/Actions/ItemDropdown.vue +1 -1
  13. package/dist/runtime/components/Edit/Actions/index.vue +77 -72
  14. package/dist/runtime/components/Edit/AddListItem/index.vue +8 -29
  15. package/dist/runtime/components/Edit/AddListItem/index.vue.d.ts +2 -3
  16. package/dist/runtime/components/Edit/AppMenu/MenuButton.vue +39 -0
  17. package/dist/runtime/{blokkliPlugins/MenuButton/index.vue.d.ts → components/Edit/AppMenu/MenuButton.vue.d.ts} +0 -4
  18. package/dist/runtime/components/Edit/AppMenu/index.vue +62 -40
  19. package/dist/runtime/components/Edit/Dialog/index.vue +26 -5
  20. package/dist/runtime/components/Edit/Dialog/index.vue.d.ts +2 -0
  21. package/dist/runtime/components/Edit/EditProvider.vue +48 -31
  22. package/dist/runtime/components/Edit/EditProvider.vue.d.ts +1 -1
  23. package/dist/runtime/components/Edit/Features/AddList/Actions/Action.vue +52 -0
  24. package/dist/runtime/components/Edit/Features/AddList/Actions/Action.vue.d.ts +7 -0
  25. package/dist/runtime/components/Edit/Features/AddList/Actions/index.vue +41 -0
  26. package/dist/runtime/components/Edit/Features/AddList/Actions/index.vue.d.ts +5 -0
  27. package/dist/runtime/components/Edit/Features/AddList/Blocks/index.vue +11 -47
  28. package/dist/runtime/components/Edit/Features/AddList/Blocks/index.vue.d.ts +5 -0
  29. package/dist/runtime/components/Edit/Features/AddList/index.vue +68 -123
  30. package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue +41 -20
  31. package/dist/runtime/components/Edit/Features/Artboard/Scrollbar/index.vue +3 -2
  32. package/dist/runtime/components/Edit/Features/Assistant/Overlay/index.vue +2 -28
  33. package/dist/runtime/components/Edit/Features/Assistant/index.vue +18 -14
  34. package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/index.vue +1 -0
  35. package/dist/runtime/components/Edit/Features/BlockScheduler/index.vue +2 -2
  36. package/dist/runtime/components/Edit/Features/Clipboard/List/index.vue +1 -1
  37. package/dist/runtime/components/Edit/Features/Clipboard/index.vue +52 -18
  38. package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Item/index.vue +0 -2
  39. package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Item/index.vue.d.ts +6 -4
  40. package/dist/runtime/components/Edit/Features/CommandPalette/Palette/index.vue +77 -27
  41. package/dist/runtime/components/Edit/Features/CommandPalette/index.vue +7 -4
  42. package/dist/runtime/components/Edit/Features/Comments/index.vue +2 -2
  43. package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/DragItem.vue +113 -0
  44. package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/DragItem.vue.d.ts +25 -0
  45. package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/index.vue +8 -97
  46. package/dist/runtime/components/Edit/Features/DraggingOverlay/Renderer/fragment.glsl +2 -5
  47. package/dist/runtime/components/Edit/Features/DraggingOverlay/Renderer/index.vue +38 -5
  48. package/dist/runtime/components/Edit/Features/DraggingOverlay/Renderer/vertex.glsl +10 -1
  49. package/dist/runtime/components/Edit/Features/DraggingOverlay/index.vue +1 -2
  50. package/dist/runtime/components/Edit/Features/EditForm/index.vue +2 -2
  51. package/dist/runtime/components/Edit/Features/EditableField/index.vue +2 -2
  52. package/dist/runtime/components/Edit/Features/Exit/index.vue +12 -9
  53. package/dist/runtime/components/Edit/Features/Fragments/index.vue +27 -31
  54. package/dist/runtime/components/Edit/Features/ImportExisting/Dialog/index.vue +1 -0
  55. package/dist/runtime/components/Edit/Features/ImportExisting/index.vue +25 -24
  56. package/dist/runtime/components/Edit/Features/Library/EditReusable/index.vue +2 -2
  57. package/dist/runtime/components/Edit/Features/Library/ReusableDialog/index.vue +1 -0
  58. package/dist/runtime/components/Edit/Features/Library/index.vue +26 -24
  59. package/dist/runtime/components/Edit/Features/MultiSelect/Renderer/index.vue +1 -3
  60. package/dist/runtime/components/Edit/Features/PreviewGrant/index.vue +2 -1
  61. package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue +1 -0
  62. package/dist/runtime/components/Edit/Features/Publish/index.vue +17 -15
  63. package/dist/runtime/components/Edit/Features/Revert/index.vue +24 -18
  64. package/dist/runtime/components/Edit/Features/Search/index.vue +1 -1
  65. package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue +21 -17
  66. package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue.d.ts +6 -6
  67. package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue +3 -6
  68. package/dist/runtime/components/Edit/Features/Settings/Dialog/index.vue +1 -0
  69. package/dist/runtime/components/Edit/Features/Settings/index.vue +25 -17
  70. package/dist/runtime/components/Edit/Features/TouchActionBar/index.vue +2 -2
  71. package/dist/runtime/components/Edit/Features/Tour/Overlay/index.vue +1 -1
  72. package/dist/runtime/components/Edit/Features/Tour/Popup/index.vue +2 -2
  73. package/dist/runtime/components/Edit/Features/Tour/index.vue +12 -10
  74. package/dist/runtime/components/Edit/Features/Transform/index.vue +1 -1
  75. package/dist/runtime/components/Edit/Features/Translations/index.vue +18 -17
  76. package/dist/runtime/components/Edit/FormOverlay/index.vue +13 -4
  77. package/dist/runtime/components/Edit/ItemIconBox/index.vue +41 -0
  78. package/dist/runtime/components/Edit/{AddListItemIcon → ItemIconBox}/index.vue.d.ts +5 -5
  79. package/dist/runtime/components/Edit/Konami/Game/index.vue +0 -1
  80. package/dist/runtime/components/Edit/Konami/index.vue +3 -5
  81. package/dist/runtime/components/Edit/Messages/Item/index.vue +11 -2
  82. package/dist/runtime/components/Edit/Messages/index.vue +6 -1
  83. package/dist/runtime/components/Edit/Overlay/index.vue +66 -0
  84. package/dist/runtime/components/Edit/Overlay/index.vue.d.ts +2 -0
  85. package/dist/runtime/components/Edit/SystemRequirements/index.vue +36 -36
  86. package/dist/runtime/components/Edit/Toolbar/index.vue +47 -48
  87. package/dist/runtime/components/Edit/index.d.ts +2 -2
  88. package/dist/runtime/components/Edit/index.js +2 -2
  89. package/dist/runtime/css/output.css +1 -1
  90. package/dist/runtime/helpers/composables/defineAddAction.d.ts +2 -0
  91. package/dist/runtime/helpers/composables/defineAddAction.js +10 -0
  92. package/dist/runtime/helpers/composables/defineItemDropdownAction.js +2 -2
  93. package/dist/runtime/helpers/composables/defineMenuButton.d.ts +2 -0
  94. package/dist/runtime/helpers/composables/defineMenuButton.js +10 -0
  95. package/dist/runtime/helpers/composables/useDialog.d.ts +3 -0
  96. package/dist/runtime/helpers/composables/useDialog.js +16 -0
  97. package/dist/runtime/helpers/defineElementStyle.d.ts +2 -0
  98. package/dist/runtime/helpers/defineElementStyle.js +33 -0
  99. package/dist/runtime/helpers/domProvider.d.ts +1 -0
  100. package/dist/runtime/helpers/domProvider.js +7 -2
  101. package/dist/runtime/helpers/dropTargets/index.d.ts +1 -1
  102. package/dist/runtime/helpers/dropTargets/index.js +17 -3
  103. package/dist/runtime/helpers/pluginProvider.d.ts +25 -6
  104. package/dist/runtime/helpers/pluginProvider.js +48 -46
  105. package/dist/runtime/helpers/providers/blocks.js +10 -0
  106. package/dist/runtime/helpers/providers/fields.d.ts +9 -1
  107. package/dist/runtime/helpers/uiProvider.d.ts +9 -12
  108. package/dist/runtime/helpers/uiProvider.js +85 -83
  109. package/dist/runtime/icons/click.svg +1 -0
  110. package/dist/runtime/types/index.d.ts +12 -5
  111. package/package.json +1 -1
  112. package/dist/runtime/blokkliPlugins/AddAction/index.vue +0 -96
  113. package/dist/runtime/blokkliPlugins/AddAction/index.vue.d.ts +0 -26
  114. package/dist/runtime/blokkliPlugins/MenuButton/index.vue +0 -68
  115. package/dist/runtime/components/Edit/AddListItemIcon/index.vue +0 -19
@@ -1,40 +1,22 @@
1
1
  <template>
2
2
  <PluginContextMenu
3
- :id="'add_list_item_' + id"
3
+ :id="'add_list_item_' + context + id"
4
4
  ref="el"
5
5
  tag="button"
6
- class="bk-list-item"
7
- data-element-type="action"
6
+ class="bk-add-item"
8
7
  :menu="menu"
9
8
  :data-sortli-id="id"
10
9
  :class="[
11
10
  {
12
11
  'bk-is-disabled': disabled
13
12
  },
14
- 'bk-is-' + orientation,
15
13
  'bk-is-' + color
16
14
  ]"
17
15
  >
18
- <div class="bk-list-item-inner">
19
- <AddListItemIcon :orientation :color :bundle :icon />
20
- <div
21
- class="bk-list-item-label"
22
- :class="{
23
- 'bk-tooltip': orientation === 'horizontal' && !ui.isMobile.value
24
- }"
25
- >
26
- <span>{{ label }}</span>
27
- </div>
16
+ <div class="bk-add-item-icon">
17
+ <ItemIconBox :color :bundle :icon />
28
18
  </div>
29
-
30
- <div
31
- class="bk-add-list-drop bk-drop-element"
32
- :class="['bk-is-' + color, { 'bk-is-dark': isDark }]"
33
- >
34
- <div class="bk-add-list-drop-icon">
35
- <ItemIcon v-if="bundle" :bundle="bundle" />
36
- <Icon v-else-if="icon" :name="icon" />
37
- </div>
19
+ <div class="bk-add-item-label">
38
20
  <span>{{ label }}</span>
39
21
  </div>
40
22
  </PluginContextMenu>
@@ -42,13 +24,13 @@
42
24
 
43
25
  <script setup>
44
26
  import { useBlokkli, computed, ref } from "#imports";
45
- import { ItemIcon, Icon, AddListItemIcon } from "#blokkli/components";
27
+ import { ItemIconBox } from "#blokkli/components";
46
28
  import { PluginContextMenu } from "#blokkli/plugins";
47
- const { ui, storage, $t } = useBlokkli();
29
+ const { storage, $t } = useBlokkli();
48
30
  const props = defineProps({
49
31
  id: { type: String, required: true },
32
+ context: { type: String, required: true },
50
33
  label: { type: String, required: true },
51
- orientation: { type: String, required: true },
52
34
  color: { type: String, required: false, default: "default" },
53
35
  bundle: { type: String, required: false, default: "" },
54
36
  icon: { type: null, required: false, default: void 0 },
@@ -58,9 +40,6 @@ const props = defineProps({
58
40
  const el = ref(null);
59
41
  const favorites = storage.use("blockFavorites", []);
60
42
  const isFavorite = computed(() => favorites.value.includes(props.id));
61
- const isDark = computed(
62
- () => props.orientation !== "sidebar" && props.color === "default"
63
- );
64
43
  const toggleFavorite = () => {
65
44
  if (favorites.value.includes(props.id)) {
66
45
  favorites.value = favorites.value.filter((v) => v !== props.id);
@@ -1,9 +1,8 @@
1
1
  import type { BlokkliIcon } from '#blokkli-build/icons';
2
- import type { AddListOrientation } from '#blokkli/types';
3
2
  declare const _default: import("vue").DefineComponent<{
4
3
  id: string;
4
+ context: string;
5
5
  label: string;
6
- orientation: AddListOrientation;
7
6
  color?: "rose" | "lime" | "default" | "yellow" | "accent";
8
7
  bundle?: string;
9
8
  icon?: BlokkliIcon;
@@ -13,8 +12,8 @@ declare const _default: import("vue").DefineComponent<{
13
12
  getElement: () => HTMLElement | null;
14
13
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
15
14
  id: string;
15
+ context: string;
16
16
  label: string;
17
- orientation: AddListOrientation;
18
17
  color?: "rose" | "lime" | "default" | "yellow" | "accent";
19
18
  bundle?: string;
20
19
  icon?: BlokkliIcon;
@@ -0,0 +1,39 @@
1
+ <template>
2
+ <button
3
+ :id="'bk-menu-list-button-' + id"
4
+ class="bk-menu-list-button"
5
+ :disabled="disabled"
6
+ :class="type ? 'bk-is-' + type : ''"
7
+ @click.prevent.stop="onClick"
8
+ >
9
+ <div class="bk-menu-list-icon">
10
+ <slot>
11
+ <Icon v-if="icon" :name="icon" />
12
+ </slot>
13
+ </div>
14
+ <strong>{{ title }}</strong>
15
+ <span>{{ description }}</span>
16
+ </button>
17
+ </template>
18
+
19
+ <script setup>
20
+ import { Icon } from "#blokkli/components";
21
+ defineProps({
22
+ id: { type: String, required: true },
23
+ title: { type: String, required: true },
24
+ description: { type: String, required: true },
25
+ disabled: { type: Boolean, required: false },
26
+ icon: { type: null, required: false },
27
+ type: { type: String, required: false }
28
+ });
29
+ const emit = defineEmits(["click"]);
30
+ function onClick() {
31
+ emit("click");
32
+ }
33
+ </script>
34
+
35
+ <script>
36
+ export default {
37
+ name: "MenuButton"
38
+ };
39
+ </script>
@@ -6,8 +6,6 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
6
6
  disabled?: boolean;
7
7
  icon?: BlokkliIcon;
8
8
  type?: "success" | "danger" | "yellow";
9
- weight?: number;
10
- secondary?: boolean;
11
9
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
10
  click: (...args: any[]) => void;
13
11
  }, string, import("vue").PublicProps, Readonly<{
@@ -17,8 +15,6 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
17
15
  disabled?: boolean;
18
16
  icon?: BlokkliIcon;
19
17
  type?: "success" | "danger" | "yellow";
20
- weight?: number;
21
- secondary?: boolean;
22
18
  }> & Readonly<{
23
19
  onClick?: ((...args: any[]) => any) | undefined;
24
20
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
@@ -1,53 +1,75 @@
1
1
  <template>
2
- <Teleport to="#bk-toolbar-menu">
3
- <div class="bk-toolbar-menu">
4
- <button class="bk-toolbar-menu-button" @click.prevent.stop="onClick">
5
- <Icon name="menu" />
2
+ <BlokkliTransition name="menu">
3
+ <div v-if="menuOpen" class="bk bk-menu-list">
4
+ <button :class="{ 'bk-is-active': menuOpen }" @click="closeMenu">
5
+ <Icon name="close" />
6
6
  </button>
7
- </div>
8
- </Teleport>
9
- <Teleport to="body">
10
- <BlokkliTransition name="fade">
11
- <div
12
- v-if="menuOpen"
13
- class="bk bk-menu-overlay bk-overlay"
14
- @click="ui.menu.close()"
15
- />
16
- </BlokkliTransition>
17
- <BlokkliTransition name="menu">
18
- <div v-show="menuOpen" class="bk bk-menu-list">
19
- <button :class="{ 'bk-is-active': menuOpen }" @click="ui.menu.close">
20
- <Icon name="close" />
21
- </button>
22
- <div class="bk-menu-list-inner">
23
- <div id="bk-menu-primary" />
24
- <div id="bk-menu-secondary" />
25
- <aside class="bk-menu-meta">
26
- <div class="bk-menu-meta-logo">
27
- <Icon name="logo" />
28
- <div><strong>@blokkli/editor</strong> {{ blokkliVersion }}</div>
29
- </div>
30
-
31
- <div>
32
- <a href="https://www.blokk.li" target="_blank">blokk.li</a>
33
- </div>
34
- </aside>
7
+ <div class="bk-menu-list-inner">
8
+ <div id="bk-menu-primary">
9
+ <MenuButton
10
+ v-for="button in primaryButtons"
11
+ :id="button.id"
12
+ :key="button.id"
13
+ :title="button.title"
14
+ :description="button.description"
15
+ :icon="button.icon"
16
+ :type="button.type"
17
+ :disabled="button.disabled"
18
+ @click="onClick(button)"
19
+ />
20
+ </div>
21
+ <div id="bk-menu-secondary">
22
+ <MenuButton
23
+ v-for="button in secondaryButtons"
24
+ :id="button.id"
25
+ :key="button.id"
26
+ :title="button.title"
27
+ :description="button.description"
28
+ :icon="button.icon"
29
+ :type="button.type"
30
+ :disabled="button.disabled"
31
+ @click="onClick(button)"
32
+ />
35
33
  </div>
34
+ <aside class="bk-menu-meta">
35
+ <div class="bk-menu-meta-logo">
36
+ <Icon name="logo" />
37
+ <div><strong>@blokkli/editor</strong> {{ blokkliVersion }}</div>
38
+ </div>
39
+
40
+ <div>
41
+ <a href="https://www.blokk.li" target="_blank">blokk.li</a>
42
+ </div>
43
+ </aside>
36
44
  </div>
37
- </BlokkliTransition>
38
- </Teleport>
45
+ </div>
46
+ </BlokkliTransition>
39
47
  </template>
40
48
 
41
49
  <script setup>
42
50
  import { computed, useBlokkli } from "#imports";
43
51
  import { Icon, BlokkliTransition } from "#blokkli/components";
44
52
  import { blokkliVersion } from "#blokkli-build/config";
45
- const { ui, eventBus } = useBlokkli();
46
- const menuOpen = computed(() => ui.menu.isOpen.value);
47
- const onClick = () => {
48
- eventBus.emit("select", "");
49
- ui.menu.open();
50
- };
53
+ import MenuButton from "./MenuButton.vue";
54
+ import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
55
+ const DIALOG_MENU = "menu";
56
+ const { ui, plugins } = useBlokkli();
57
+ const menuOpen = computed(() => ui.currentDialog.value?.id === DIALOG_MENU);
58
+ function closeMenu() {
59
+ ui.closeDialog(DIALOG_MENU);
60
+ }
61
+ onBlokkliEvent("overlay:close", closeMenu);
62
+ const allButtons = computed(() => plugins.get("menuButton"));
63
+ const primaryButtons = computed(() => {
64
+ return allButtons.value.filter((button) => !button.secondary).sort((a, b) => (a.weight || 0) - (b.weight || 0));
65
+ });
66
+ const secondaryButtons = computed(() => {
67
+ return allButtons.value.filter((button) => button.secondary).sort((a, b) => (a.weight || 0) - (b.weight || 0));
68
+ });
69
+ function onClick(button) {
70
+ button.callback();
71
+ closeMenu();
72
+ }
51
73
  </script>
52
74
 
53
75
  <script>
@@ -9,8 +9,7 @@
9
9
  @touchmove.stop
10
10
  @touchend.stop
11
11
  >
12
- <div class="bk-dialog-background" @click="$emit('cancel')" />
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 { useBlokkli, onMounted, computed, ref, onBeforeUnmount } from "#imports";
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.hasDialogOpen.value = false;
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;
@@ -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 id="bk-banner-container">
8
- <div id="bk-banner-list" class="bk">
9
- <Banner
10
- v-if="!state.stateAvailable.value"
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
- <Messages />
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
- <Teleport to="#nuxt-root">
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="mutatedEntity"
51
+ :mutated-entity
46
52
  />
47
53
  </template>
48
54
 
@@ -58,7 +64,8 @@ import {
58
64
  nextTick,
59
65
  inject,
60
66
  onUnmounted,
61
- watch
67
+ watch,
68
+ useTemplateRef
62
69
  } from "#imports";
63
70
  import Toolbar from "./Toolbar/index.vue";
64
71
  import Actions from "./Actions/index.vue";
@@ -66,10 +73,10 @@ import Loading from "./Loading/index.vue";
66
73
  import Messages from "./Messages/index.vue";
67
74
  import Features from "./Features/index.vue";
68
75
  import Indicators from "./Indicators/index.vue";
69
- import AppMenu from "./AppMenu/index.vue";
70
76
  import DraggableList from "./DraggableList.vue";
71
77
  import AnimationCanvas from "./AnimationCanvas/index.vue";
72
78
  import SystemRequirements from "./SystemRequirements/index.vue";
79
+ import Overlay from "./Overlay/index.vue";
73
80
  import Konami from "./Konami/index.vue";
74
81
  import Banner from "./Banner/index.vue";
75
82
  import animationProvider from "./../../helpers/animationProvider";
@@ -110,6 +117,7 @@ import {
110
117
  } from "#blokkli/helpers/symbols";
111
118
  import { useBlockRegistration } from "#blokkli/helpers/composables/useBlockRegistration";
112
119
  import { addElementClasses } from "#blokkli/helpers/addElementClasses";
120
+ import { falsy } from "#blokkli/helpers";
113
121
  const props = defineProps({
114
122
  entity: { type: null, required: false, default: void 0 },
115
123
  entityType: { type: String, required: true },
@@ -121,6 +129,8 @@ const props = defineProps({
121
129
  providerEl: { type: null, required: true }
122
130
  });
123
131
  defineSlots();
132
+ const mainLayoutElement = useTemplateRef("mainLayoutElement");
133
+ const viewportElement = useTemplateRef("viewportElement");
124
134
  const entityContext = computed(() => {
125
135
  return {
126
136
  uuid: props.entityUuid,
@@ -150,7 +160,7 @@ const state = await editStateProvider(
150
160
  context,
151
161
  $t,
152
162
  providerKey,
153
- props.permissions
163
+ props.permissions.filter(falsy)
154
164
  );
155
165
  const storage = await storageProvider(adapter, context);
156
166
  const plugins = pluginProvider();
@@ -163,7 +173,14 @@ const commands = commandsProvider();
163
173
  const tour = tourProvider();
164
174
  const dropAreas = dropAreasProvider();
165
175
  const broadcast = broadcastProvider();
166
- const ui = uiProvider(props.providerEl, storage, state, context, element);
176
+ const ui = uiProvider(
177
+ props.providerEl,
178
+ storage,
179
+ context,
180
+ element,
181
+ mainLayoutElement,
182
+ viewportElement
183
+ );
167
184
  const dom = domProvider(ui, debug, definitions, state, element);
168
185
  const theme = themeProvider(element);
169
186
  const blocks = blocksProvider(state, dom, context);
@@ -181,7 +198,7 @@ const mutatedEntity = computed(() => {
181
198
  };
182
199
  });
183
200
  const isReady = computed(
184
- () => !isInitializing.value && dom.isReady.value && directive.isReady.value && toolbarLoaded.value
201
+ () => !isInitializing.value && dom.isReady.value && directive.isReady.value && toolbarLoaded.value && mainLayoutElement.value
185
202
  );
186
203
  watch(isReady, (v) => {
187
204
  if (v) {
@@ -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;
@@ -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>
@@ -0,0 +1,5 @@
1
+ type __VLS_Props = {
2
+ selectableBundles: string[];
3
+ };
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
+ export default _default;