@blokkli/editor 2.0.0-alpha.16 → 2.0.0-alpha.18
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 +640 -137
- package/dist/modules/drupal/graphql/base/fragment.blokkliProps.graphql +1 -1
- package/dist/modules/drupal/graphql/base/fragment.paragraphsFieldItem.graphql +3 -1
- package/dist/modules/drupal/graphql/base/query.pbConfig.graphql +1 -10
- package/dist/modules/drupal/graphql/features/comments.graphql +11 -8
- package/dist/modules/drupal/graphql/mutations/set_paragraph_schedule.graphql +15 -0
- package/dist/modules/drupal/index.mjs +33 -0
- package/dist/modules/drupal/runtime/adapter/index.js +12 -4
- package/dist/runtime/adapter/index.d.ts +21 -0
- package/dist/runtime/blokkliPlugins/ContextMenu/Menu/index.vue +3 -0
- package/dist/runtime/blokkliPlugins/ItemAction/index.vue +23 -15
- package/dist/runtime/blokkliPlugins/ItemAction/index.vue.d.ts +20 -44
- package/dist/runtime/blokkliPlugins/TourItem/index.vue +10 -5
- package/dist/runtime/components/Blocks/FromLibrary/index.vue +4 -2
- package/dist/runtime/components/BlokkliEditable.vue +32 -14
- package/dist/runtime/components/BlokkliField.vue +3 -0
- package/dist/runtime/components/BlokkliField.vue.d.ts +3 -3
- package/dist/runtime/components/BlokkliItem.vue +1 -1
- package/dist/runtime/components/BlokkliItem.vue.d.ts +4 -2
- package/dist/runtime/components/BlokkliProvider.vue +41 -28
- package/dist/runtime/components/BlokkliProvider.vue.d.ts +2 -1
- package/dist/runtime/components/Edit/Actions/index.vue +36 -20
- package/dist/runtime/components/Edit/AnimationCanvas/index.vue +436 -25
- package/dist/runtime/components/Edit/ArtboardTooltip/index.vue +83 -0
- package/dist/runtime/components/Edit/ArtboardTooltip/index.vue.d.ts +32 -0
- package/dist/runtime/components/Edit/Banner/index.vue +51 -0
- package/dist/runtime/components/Edit/Banner/index.vue.d.ts +18 -0
- package/dist/runtime/components/Edit/Dialog/index.vue +6 -4
- package/dist/runtime/components/Edit/DraggableList.vue +15 -7
- package/dist/runtime/components/Edit/DraggableList.vue.d.ts +5 -5
- package/dist/runtime/components/Edit/EditIndicator.vue +118 -44
- package/dist/runtime/components/Edit/EditIndicator.vue.d.ts +3 -0
- package/dist/runtime/components/Edit/EditProvider.vue +101 -31
- package/dist/runtime/components/Edit/EditProvider.vue.d.ts +3 -0
- package/dist/runtime/components/Edit/Features/AddList/index.vue +9 -11
- package/dist/runtime/components/Edit/Features/Analyze/Overlay/index.vue +28 -26
- package/dist/runtime/components/Edit/Features/Analyze/Renderer.vue +1 -1
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue +15 -11
- package/dist/runtime/components/Edit/Features/Anchors/Renderer.vue +19 -102
- package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue +3 -0
- package/dist/runtime/components/Edit/Features/BlockAddList/index.vue +29 -53
- package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/ScheduleSection.vue +154 -0
- package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/ScheduleSection.vue.d.ts +27 -0
- package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/index.vue +222 -0
- package/dist/runtime/components/Edit/Features/{Selection/AddButtons/AddButtonsField.vue.d.ts → BlockScheduler/Dialog/index.vue.d.ts} +6 -9
- package/dist/runtime/components/Edit/Features/BlockScheduler/index.vue +96 -0
- package/dist/runtime/components/Edit/Features/Clipboard/index.vue +15 -16
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Item/index.vue +51 -0
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/{Group → Item}/index.vue.d.ts +9 -13
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/index.vue +46 -66
- package/dist/runtime/components/Edit/Features/CommandPalette/index.vue +2 -0
- package/dist/runtime/components/Edit/Features/Comments/AddForm/index.vue +35 -20
- package/dist/runtime/components/Edit/Features/Comments/AddForm/index.vue.d.ts +5 -3
- package/dist/runtime/components/Edit/Features/Comments/CommentInput/index.vue +29 -0
- package/dist/runtime/components/Edit/Features/{Publish/Dialog/ScheduleDate.vue.d.ts → Comments/CommentInput/index.vue.d.ts} +2 -2
- package/dist/runtime/components/Edit/Features/Comments/Overlay/Item/index.vue +22 -16
- package/dist/runtime/components/Edit/Features/Comments/Overlay/Item/index.vue.d.ts +1 -0
- package/dist/runtime/components/Edit/Features/Comments/Overlay/index.vue +15 -6
- package/dist/runtime/components/Edit/Features/Comments/index.vue +21 -9
- package/dist/runtime/components/Edit/Features/Conversions/index.vue +4 -7
- package/dist/runtime/components/Edit/Features/Debug/Rects/index.vue +26 -35
- package/dist/runtime/components/Edit/Features/Debug/Renderer.vue +240 -0
- package/dist/runtime/components/Edit/Features/Debug/Renderer.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Debug/index.vue +7 -165
- package/dist/runtime/components/Edit/Features/Delete/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/index.vue +14 -6
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/index.vue +55 -48
- package/dist/runtime/components/Edit/Features/DraggingOverlay/index.vue +30 -18
- package/dist/runtime/components/Edit/Features/Duplicate/index.vue +6 -8
- package/dist/runtime/components/Edit/Features/Edit/index.vue +16 -22
- package/dist/runtime/components/Edit/Features/EditForm/index.vue +7 -6
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/Frame/index.vue +69 -4
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/Frame/index.vue.d.ts +2 -2
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/Plaintext/index.vue +13 -9
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/index.vue +45 -87
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/index.vue.d.ts +2 -2
- package/dist/runtime/components/Edit/Features/EditableField/index.vue +41 -43
- package/dist/runtime/components/Edit/Features/Fragments/Dialog/index.vue +11 -9
- package/dist/runtime/components/Edit/Features/Fragments/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/History/index.vue +5 -2
- package/dist/runtime/components/Edit/Features/Hover/Overlay/fragment.glsl +139 -0
- package/dist/runtime/components/Edit/Features/Hover/Overlay/index.vue +261 -0
- package/dist/runtime/components/Edit/Features/Hover/Overlay/index.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Hover/Overlay/vertex.glsl +117 -0
- package/dist/runtime/components/Edit/Features/Hover/index.vue +25 -0
- package/dist/runtime/components/Edit/Features/Hover/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Library/EditReusable/index.vue +5 -7
- package/dist/runtime/components/Edit/Features/Library/LibraryDialog/index.vue +19 -27
- package/dist/runtime/components/Edit/Features/Library/ReusableDialog/index.vue +32 -28
- package/dist/runtime/components/Edit/Features/Library/index.vue +28 -23
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue +6 -3
- package/dist/runtime/components/Edit/Features/MediaLibrary/index.vue +15 -12
- package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/index.vue +36 -29
- package/dist/runtime/components/Edit/Features/MultiSelect/index.vue +2 -4
- package/dist/runtime/components/Edit/Features/Options/Form/Item.vue +6 -1
- package/dist/runtime/components/Edit/Features/Options/Form/index.vue +8 -6
- package/dist/runtime/components/Edit/Features/Options/index.vue +6 -6
- package/dist/runtime/components/Edit/Features/Ownership/Renderer.vue +35 -0
- package/dist/runtime/components/Edit/Features/Ownership/Renderer.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Ownership/index.vue +7 -25
- package/dist/runtime/components/Edit/Features/ProxyView/index.vue +5 -1
- package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue +68 -15
- package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Page/index.vue +15 -15
- package/dist/runtime/components/Edit/Features/Search/index.vue +4 -1
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue +39 -74
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue.d.ts +7 -5
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/fragment.glsl +106 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/index.vue +440 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/index.vue.d.ts +32 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/vertex.glsl +102 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue +53 -125
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue.d.ts +2 -2
- package/dist/runtime/components/Edit/Features/Selection/Overlay/index.vue +88 -29
- package/dist/runtime/components/Edit/Features/Selection/Overlay/index.vue.d.ts +5 -3
- package/dist/runtime/components/Edit/Features/Selection/Overlay/vertex.glsl +11 -2
- package/dist/runtime/components/Edit/Features/Selection/OverlayFallback/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Selection/index.vue +66 -39
- package/dist/runtime/components/Edit/Features/Structure/List/Field/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Structure/List/Item/index.vue +13 -6
- package/dist/runtime/components/Edit/Features/Tour/Overlay/index.vue +3 -0
- package/dist/runtime/components/Edit/Features/Transform/index.vue +2 -27
- package/dist/runtime/components/Edit/Features/Translations/Banner/index.vue +17 -11
- package/dist/runtime/components/Edit/Features/Translations/index.vue +20 -23
- package/dist/runtime/components/Edit/Features/Validations/SidebarItem/index.vue +5 -5
- package/dist/runtime/components/Edit/Features/index.vue +17 -7
- package/dist/runtime/components/Edit/Form/Text/index.vue +2 -1
- package/dist/runtime/components/Edit/Form/Text/index.vue.d.ts +1 -0
- package/dist/runtime/components/Edit/Form/Toggle/index.vue +4 -3
- package/dist/runtime/components/Edit/Form/Toggle/index.vue.d.ts +12 -2
- package/dist/runtime/components/Edit/Indicators/index.vue +1 -1
- package/dist/runtime/components/Edit/InfoBox/index.vue +6 -2
- package/dist/runtime/components/Edit/InfoBox/index.vue.d.ts +12 -2
- package/dist/runtime/components/Edit/Konami/Game/index.vue +5 -5
- package/dist/runtime/components/Edit/{Features/Publish/Dialog/ScheduleDate.vue → ScheduleDate/index.vue} +6 -58
- package/dist/runtime/components/Edit/ScheduleDate/index.vue.d.ts +23 -0
- package/dist/runtime/components/Edit/ShortcutIndicator/index.vue +3 -0
- package/dist/runtime/components/Edit/Transition/Height.vue +95 -0
- package/dist/runtime/components/Edit/Transition/Height.vue.d.ts +36 -0
- package/dist/runtime/components/Edit/index.d.ts +7 -3
- package/dist/runtime/components/Edit/index.js +12 -4
- package/dist/runtime/composables/defineBlokkli.js +4 -2
- package/dist/runtime/css/output.css +1 -1
- package/dist/runtime/helpers/animationProvider.d.ts +35 -1
- package/dist/runtime/helpers/animationProvider.js +179 -48
- package/dist/runtime/helpers/composables/defineRenderer.d.ts +8 -0
- package/dist/runtime/helpers/composables/defineRenderer.js +8 -0
- package/dist/runtime/helpers/composables/useStateBasedCache.d.ts +4 -0
- package/dist/runtime/helpers/composables/useStateBasedCache.js +13 -0
- package/dist/runtime/helpers/composables/useStickyToolbar.d.ts +4 -1
- package/dist/runtime/helpers/composables/useStickyToolbar.js +53 -35
- package/dist/runtime/helpers/definitionProvider.d.ts +1 -1
- package/dist/runtime/helpers/dom/index.d.ts +1 -0
- package/dist/runtime/helpers/domProvider.d.ts +54 -14
- package/dist/runtime/helpers/domProvider.js +168 -134
- package/dist/runtime/helpers/index.d.ts +1 -8
- package/dist/runtime/helpers/index.js +1 -84
- package/dist/runtime/helpers/providers/blocks.d.ts +10 -0
- package/dist/runtime/helpers/providers/blocks.js +91 -0
- package/dist/runtime/helpers/providers/directive.d.ts +24 -0
- package/dist/runtime/helpers/providers/directive.js +205 -0
- package/dist/runtime/helpers/providers/element.d.ts +6 -0
- package/dist/runtime/helpers/providers/element.js +35 -0
- package/dist/runtime/helpers/providers/fields.d.ts +8 -0
- package/dist/runtime/helpers/providers/fields.js +47 -0
- package/dist/runtime/helpers/selectionProvider.d.ts +11 -11
- package/dist/runtime/helpers/selectionProvider.js +38 -45
- package/dist/runtime/helpers/stateProvider.d.ts +7 -2
- package/dist/runtime/helpers/stateProvider.js +83 -14
- package/dist/runtime/helpers/storageProvider.d.ts +3 -2
- package/dist/runtime/helpers/storageProvider.js +6 -2
- package/dist/runtime/helpers/symbols.d.ts +1 -0
- package/dist/runtime/helpers/symbols.js +1 -0
- package/dist/runtime/helpers/themeProvider.d.ts +2 -1
- package/dist/runtime/helpers/themeProvider.js +24 -14
- package/dist/runtime/helpers/typesProvider.js +10 -26
- package/dist/runtime/helpers/uiProvider.d.ts +11 -3
- package/dist/runtime/helpers/uiProvider.js +45 -17
- package/dist/runtime/icons/calendar.svg +1 -0
- package/dist/runtime/icons/clock.svg +1 -0
- package/dist/runtime/icons/comment_add.svg +1 -5
- package/dist/runtime/icons/delete.svg +1 -8
- package/dist/runtime/icons/duplicate.svg +1 -12
- package/dist/runtime/icons/edit.svg +1 -8
- package/dist/runtime/icons/reusable.svg +1 -5
- package/dist/runtime/plugins/blokkliDirectives.js +96 -0
- package/dist/runtime/types/index.d.ts +66 -35
- package/package.json +1 -1
- package/dist/runtime/components/Edit/DragInteractions/index.vue +0 -401
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Group/index.vue +0 -63
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/AddButtonsField.vue +0 -54
- package/dist/runtime/plugins/blokkliEditable.js +0 -31
- /package/dist/runtime/components/Edit/{DragInteractions → Features/BlockScheduler}/index.vue.d.ts +0 -0
- /package/dist/runtime/plugins/{blokkliEditable.d.ts → blokkliDirectives.d.ts} +0 -0
|
@@ -113,7 +113,12 @@ const showLabel = computed(() => {
|
|
|
113
113
|
const label = computed(
|
|
114
114
|
() => $blokkliText(`blockOption_${props.property}_label`, props.option.label)
|
|
115
115
|
);
|
|
116
|
-
const description = computed(
|
|
116
|
+
const description = computed(
|
|
117
|
+
() => $blokkliText(
|
|
118
|
+
`blockOption_${props.property}_description`,
|
|
119
|
+
props.option.description
|
|
120
|
+
)
|
|
121
|
+
);
|
|
117
122
|
const checkboxOptions = computed(() => {
|
|
118
123
|
if (props.option.type !== "checkboxes") {
|
|
119
124
|
return [];
|
|
@@ -56,6 +56,7 @@ import {
|
|
|
56
56
|
BK_VISIBLE_LANGUAGES
|
|
57
57
|
} from "#blokkli/helpers/symbols";
|
|
58
58
|
import { BUNDLE_FROM_LIBRARY } from "#blokkli/constants";
|
|
59
|
+
import { itemEntityType } from "#blokkli-build/config";
|
|
59
60
|
if (import.meta.hot) {
|
|
60
61
|
import.meta.hot.accept("#blokkli/runtime-helpers", () => {
|
|
61
62
|
});
|
|
@@ -94,11 +95,11 @@ const {
|
|
|
94
95
|
eventBus,
|
|
95
96
|
state,
|
|
96
97
|
selection,
|
|
97
|
-
runtimeConfig,
|
|
98
98
|
dom,
|
|
99
99
|
theme,
|
|
100
100
|
context,
|
|
101
|
-
definitions
|
|
101
|
+
definitions,
|
|
102
|
+
blocks
|
|
102
103
|
} = useBlokkli();
|
|
103
104
|
const props = defineProps({
|
|
104
105
|
uuids: { type: [Array, String], required: true },
|
|
@@ -136,7 +137,7 @@ function stopChangingOptions() {
|
|
|
136
137
|
if (Array.isArray(props.uuids)) {
|
|
137
138
|
props.uuids.forEach((uuid) => {
|
|
138
139
|
dom.refreshBlockRect(uuid);
|
|
139
|
-
const block =
|
|
140
|
+
const block = blocks.getBlock(uuid);
|
|
140
141
|
if (block) {
|
|
141
142
|
const el = dom.getDragElement(block);
|
|
142
143
|
if (el) {
|
|
@@ -146,6 +147,7 @@ function stopChangingOptions() {
|
|
|
146
147
|
});
|
|
147
148
|
}
|
|
148
149
|
selection.isChangingOptions.value = false;
|
|
150
|
+
eventBus.emit("option:finish-change");
|
|
149
151
|
}
|
|
150
152
|
class OptionCollector {
|
|
151
153
|
options;
|
|
@@ -247,11 +249,11 @@ const visibleOptions = computed(() => {
|
|
|
247
249
|
}
|
|
248
250
|
const uuid = props.uuids[0];
|
|
249
251
|
const item = state.getFieldListItem(uuid);
|
|
250
|
-
const block = selection.
|
|
252
|
+
const block = selection.items.value.find((v) => v.uuid === uuid);
|
|
251
253
|
if (!item) {
|
|
252
254
|
return [];
|
|
253
255
|
}
|
|
254
|
-
const parentType = block?.
|
|
256
|
+
const parentType = block?.host.type === itemEntityType ? block.parentBlockBundle : void 0;
|
|
255
257
|
const ctxProps = item?.bundle === BUNDLE_FROM_LIBRARY ? item?.props?.libraryItem?.block?.props : item?.props;
|
|
256
258
|
const visibleKeys = (
|
|
257
259
|
// We have to cast to any here because the types are guaranteed to be correct.
|
|
@@ -260,7 +262,7 @@ const visibleOptions = computed(() => {
|
|
|
260
262
|
parentType,
|
|
261
263
|
props: ctxProps,
|
|
262
264
|
entity: context.value,
|
|
263
|
-
fieldListType: block?.
|
|
265
|
+
fieldListType: block?.fieldListType ?? "default"
|
|
264
266
|
})
|
|
265
267
|
);
|
|
266
268
|
return availableOptions.value.filter(
|
|
@@ -24,7 +24,7 @@ defineBlokkliFeature({
|
|
|
24
24
|
});
|
|
25
25
|
const { selection, state, ui, definitions, context } = useBlokkli();
|
|
26
26
|
const uuids = computed(() => {
|
|
27
|
-
const uuids2 = selection.
|
|
27
|
+
const uuids2 = selection.items.value.map((v) => v.uuid);
|
|
28
28
|
if (uuids2.length) {
|
|
29
29
|
return uuids2;
|
|
30
30
|
} else if (selection.hasHostSelected.value) {
|
|
@@ -47,14 +47,14 @@ const definition = computed(() => {
|
|
|
47
47
|
context.value.entityBundle
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
|
-
const bundles = selection.
|
|
50
|
+
const bundles = selection.items.value.map((v) => v.library?.reusableBundle || v.bundle).filter(onlyUnique);
|
|
51
51
|
if (bundles.length !== 1) {
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
const bundle = bundles[0];
|
|
55
55
|
if (bundle === "blokkli_fragment") {
|
|
56
|
-
const fragments = selection.
|
|
57
|
-
(v) => v.
|
|
56
|
+
const fragments = selection.items.value.filter(
|
|
57
|
+
(v) => v.bundle === "blokkli_fragment"
|
|
58
58
|
);
|
|
59
59
|
const fragmentNames = fragments.map((v) => {
|
|
60
60
|
const props = state.getFieldListItem(v.uuid)?.props;
|
|
@@ -67,10 +67,10 @@ const definition = computed(() => {
|
|
|
67
67
|
}
|
|
68
68
|
return definitions.getFragmentDefinition(fragmentNames[0]);
|
|
69
69
|
}
|
|
70
|
-
return selection.
|
|
70
|
+
return selection.items.value.map((block) => {
|
|
71
71
|
return definitions.getBlockDefinition(
|
|
72
72
|
bundle,
|
|
73
|
-
block.
|
|
73
|
+
block.fieldListType,
|
|
74
74
|
block.parentBlockBundle
|
|
75
75
|
);
|
|
76
76
|
}).filter(falsy).at(0);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Banner
|
|
3
|
+
id="ownership"
|
|
4
|
+
icon="user"
|
|
5
|
+
:text
|
|
6
|
+
:button="$t('ownershipTakeOwnership', 'Assign to me')"
|
|
7
|
+
@click="$emit('submit')"
|
|
8
|
+
/>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup>
|
|
12
|
+
import { computed, useBlokkli, onMounted, onBeforeUnmount } from "#imports";
|
|
13
|
+
import { Banner } from "#blokkli/components";
|
|
14
|
+
defineEmits(["submit"]);
|
|
15
|
+
const { state, $t, ui } = useBlokkli();
|
|
16
|
+
const name = computed(() => {
|
|
17
|
+
const v = state.owner.value?.name;
|
|
18
|
+
if (v) {
|
|
19
|
+
return `<strong>${v}</strong>`;
|
|
20
|
+
}
|
|
21
|
+
return "";
|
|
22
|
+
});
|
|
23
|
+
const text = computed(() => {
|
|
24
|
+
return $t(
|
|
25
|
+
"ownershipNote",
|
|
26
|
+
"This page is currently being edited by @name. Changes can only be made by one person at a time."
|
|
27
|
+
).replace("@name", name.value);
|
|
28
|
+
});
|
|
29
|
+
onMounted(() => {
|
|
30
|
+
ui.setSelectionColor("ownership", "mono");
|
|
31
|
+
});
|
|
32
|
+
onBeforeUnmount(() => {
|
|
33
|
+
ui.removeSelectionColor("ownership");
|
|
34
|
+
});
|
|
35
|
+
</script>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
2
|
+
submit: () => any;
|
|
3
|
+
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
4
|
+
onSubmit?: (() => any) | undefined;
|
|
5
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
export default _default;
|
|
@@ -1,26 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Teleport to="
|
|
3
|
-
<
|
|
4
|
-
v-if="!state.owner.value?.currentUserIsOwner"
|
|
5
|
-
class="bk-owner-indicator"
|
|
6
|
-
>
|
|
7
|
-
<p
|
|
8
|
-
v-html="
|
|
9
|
-
$t(
|
|
10
|
-
'ownershipNote',
|
|
11
|
-
'This page is currently being edited by @name. Changes can only be made by one person at a time.'
|
|
12
|
-
).replace('@name', name)
|
|
13
|
-
"
|
|
14
|
-
/>
|
|
15
|
-
<button class="bk-button bk-is-danger" @click="takeOwnership">
|
|
16
|
-
{{ $t("ownershipTakeOwnership", "Assign to me") }}
|
|
17
|
-
</button>
|
|
18
|
-
</div>
|
|
2
|
+
<Teleport to="#bk-banner-list">
|
|
3
|
+
<Renderer v-if="shouldRender" @submit="takeOwnership" />
|
|
19
4
|
</Teleport>
|
|
20
5
|
</template>
|
|
21
6
|
|
|
22
7
|
<script setup>
|
|
23
|
-
import {
|
|
8
|
+
import { useBlokkli, defineBlokkliFeature, computed } from "#imports";
|
|
9
|
+
import Renderer from "./Renderer.vue";
|
|
24
10
|
const { adapter } = defineBlokkliFeature({
|
|
25
11
|
id: "ownership",
|
|
26
12
|
icon: "user",
|
|
@@ -29,18 +15,14 @@ const { adapter } = defineBlokkliFeature({
|
|
|
29
15
|
description: "Renders a large button to take ownership of the current edit state."
|
|
30
16
|
});
|
|
31
17
|
const { state, $t } = useBlokkli();
|
|
18
|
+
const shouldRender = computed(
|
|
19
|
+
() => !state.owner.value?.currentUserIsOwner && state.permissions.value.includes("edit")
|
|
20
|
+
);
|
|
32
21
|
const takeOwnership = () => state.mutateWithLoadingState(
|
|
33
22
|
() => adapter.takeOwnership(),
|
|
34
23
|
$t("ownershipError", "Error in assigning"),
|
|
35
24
|
$t("ownershipSuccess", "You are now the owner.")
|
|
36
25
|
);
|
|
37
|
-
const name = computed(() => {
|
|
38
|
-
const v = state.owner.value?.name;
|
|
39
|
-
if (v) {
|
|
40
|
-
return `<strong>${v}</strong>`;
|
|
41
|
-
}
|
|
42
|
-
return "";
|
|
43
|
-
});
|
|
44
26
|
</script>
|
|
45
27
|
|
|
46
28
|
<script>
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"
|
|
14
14
|
key-code="P"
|
|
15
15
|
icon="tree"
|
|
16
|
+
@update:model-value="onToggleProxyMode"
|
|
16
17
|
/>
|
|
17
18
|
</template>
|
|
18
19
|
|
|
@@ -26,7 +27,10 @@ defineBlokkliFeature({
|
|
|
26
27
|
description: "Displays the blocks as a structure in the preview.",
|
|
27
28
|
viewports: ["desktop"]
|
|
28
29
|
});
|
|
29
|
-
const { $t, ui } = useBlokkli();
|
|
30
|
+
const { $t, ui, eventBus } = useBlokkli();
|
|
31
|
+
function onToggleProxyMode() {
|
|
32
|
+
eventBus.emit("state:reloaded");
|
|
33
|
+
}
|
|
30
34
|
</script>
|
|
31
35
|
|
|
32
36
|
<script>
|
|
@@ -37,23 +37,24 @@
|
|
|
37
37
|
</label>
|
|
38
38
|
<div class="bk-publish-schedule-date-wrapper">
|
|
39
39
|
<div v-if="isAlreadyScheduled" class="bk-publish-scheduled-display">
|
|
40
|
-
{{
|
|
41
|
-
ui.formatDate(scheduleDate, {
|
|
42
|
-
weekday: "long",
|
|
43
|
-
year: "numeric",
|
|
44
|
-
month: "2-digit",
|
|
45
|
-
day: "2-digit",
|
|
46
|
-
hour: "2-digit",
|
|
47
|
-
minute: "2-digit"
|
|
48
|
-
})
|
|
49
|
-
}}
|
|
40
|
+
{{ formatScheduleDate(scheduleDate) }}
|
|
50
41
|
</div>
|
|
51
42
|
<ScheduleDate
|
|
52
43
|
v-else
|
|
53
44
|
v-model="scheduleDate"
|
|
54
45
|
:disabled="isLoading"
|
|
55
46
|
:error="scheduleDateError"
|
|
56
|
-
|
|
47
|
+
>
|
|
48
|
+
<div
|
|
49
|
+
class="bk-schedule-date-info"
|
|
50
|
+
v-text="
|
|
51
|
+
$t(
|
|
52
|
+
'publishScheduledInfo',
|
|
53
|
+
'You can still make changes until the scheduled publication date.'
|
|
54
|
+
)
|
|
55
|
+
"
|
|
56
|
+
/>
|
|
57
|
+
</ScheduleDate>
|
|
57
58
|
<button
|
|
58
59
|
v-if="isAlreadyScheduled"
|
|
59
60
|
type="button"
|
|
@@ -90,6 +91,16 @@
|
|
|
90
91
|
/>
|
|
91
92
|
</FormItem>
|
|
92
93
|
|
|
94
|
+
<FormItem v-if="publishMode !== 'save' && scheduledBlocks.length">
|
|
95
|
+
<InfoBox>
|
|
96
|
+
<p
|
|
97
|
+
v-for="(text, index) in scheduledBlocks"
|
|
98
|
+
:key="'infobox' + index"
|
|
99
|
+
v-html="text"
|
|
100
|
+
/>
|
|
101
|
+
</InfoBox>
|
|
102
|
+
</FormItem>
|
|
103
|
+
|
|
93
104
|
<FormItem v-if="successItems.length && showTable">
|
|
94
105
|
<h2 class="bk-heading-2">
|
|
95
106
|
{{ $t("publishSuccessfullyPublished", "Successfully published") }}
|
|
@@ -171,14 +182,29 @@ import {
|
|
|
171
182
|
onMounted,
|
|
172
183
|
onUnmounted
|
|
173
184
|
} from "#imports";
|
|
174
|
-
import {
|
|
185
|
+
import {
|
|
186
|
+
DialogModal,
|
|
187
|
+
FormTextarea,
|
|
188
|
+
FormItem,
|
|
189
|
+
ScheduleDate,
|
|
190
|
+
InfoBox
|
|
191
|
+
} from "#blokkli/components";
|
|
175
192
|
import { emitMessage } from "#blokkli/helpers/eventBus";
|
|
176
193
|
import Item from "./Item.vue";
|
|
177
194
|
import PublishOption, {} from "./PublishOption.vue";
|
|
178
195
|
import Summary from "./Summary.vue";
|
|
179
|
-
import ScheduleDate from "./ScheduleDate.vue";
|
|
180
196
|
const showTable = false;
|
|
181
197
|
const { adapter, $t, state, context, ui } = useBlokkli();
|
|
198
|
+
const formatScheduleDate = (date) => {
|
|
199
|
+
return ui.formatDate(date, {
|
|
200
|
+
weekday: "long",
|
|
201
|
+
year: "numeric",
|
|
202
|
+
month: "long",
|
|
203
|
+
day: "numeric",
|
|
204
|
+
hour: "2-digit",
|
|
205
|
+
minute: "2-digit"
|
|
206
|
+
});
|
|
207
|
+
};
|
|
182
208
|
const isMutating = ref(false);
|
|
183
209
|
const mutationStatusItems = ref({});
|
|
184
210
|
const publishedIds = ref([]);
|
|
@@ -205,6 +231,33 @@ const {
|
|
|
205
231
|
} = await useAsyncData(() => {
|
|
206
232
|
return adapter.getPublishOptions();
|
|
207
233
|
});
|
|
234
|
+
const scheduledBlocks = computed(() => {
|
|
235
|
+
const referenceTimestamp = publishMode.value === "scheduled" && scheduleDate.value ? new Date(scheduleDate.value).getTime() : currentTimestamp.value;
|
|
236
|
+
const grouped = state.getAllUuids().reduce((acc, uuid) => {
|
|
237
|
+
const item = state.getFieldListItem(uuid);
|
|
238
|
+
if (!item?.editContext?.publishOn) {
|
|
239
|
+
return acc;
|
|
240
|
+
}
|
|
241
|
+
const publishDate = new Date(item.editContext.publishOn).getTime();
|
|
242
|
+
if (publishDate <= referenceTimestamp) {
|
|
243
|
+
return acc;
|
|
244
|
+
}
|
|
245
|
+
const dateKey = item.editContext.publishOn;
|
|
246
|
+
acc[dateKey] = (acc[dateKey] || 0) + 1;
|
|
247
|
+
return acc;
|
|
248
|
+
}, {});
|
|
249
|
+
return Object.entries(grouped).map(([date, count]) => {
|
|
250
|
+
const formattedDate = formatScheduleDate(date);
|
|
251
|
+
const message = count === 1 ? $t(
|
|
252
|
+
"publishScheduledBlockSingular",
|
|
253
|
+
"1 block is scheduled to be published on @date"
|
|
254
|
+
) : $t(
|
|
255
|
+
"publishScheduledBlockPlural",
|
|
256
|
+
"@count blocks are scheduled to be published on @date"
|
|
257
|
+
);
|
|
258
|
+
return message.replace("@count", count.toString()).replace("@date", `<strong>${formattedDate}</strong>`);
|
|
259
|
+
});
|
|
260
|
+
});
|
|
208
261
|
const canSchedule = computed(() => !!publishOptions.value?.canSchedule);
|
|
209
262
|
const publishOn = computed(
|
|
210
263
|
() => publishOptions.value?.publishOn ?? null
|
|
@@ -403,7 +456,7 @@ const resultStateLabel = computed(() => {
|
|
|
403
456
|
);
|
|
404
457
|
}
|
|
405
458
|
if (publishMode.value === "scheduled" && scheduleDate.value) {
|
|
406
|
-
const formattedDate =
|
|
459
|
+
const formattedDate = formatScheduleDate(scheduleDate.value);
|
|
407
460
|
if (isCurrentlyPublished.value) {
|
|
408
461
|
return $t(
|
|
409
462
|
"publishResultScheduledChanges",
|
|
@@ -500,7 +553,7 @@ async function onSubmit() {
|
|
|
500
553
|
return;
|
|
501
554
|
}
|
|
502
555
|
if (publishMode.value === "scheduled") {
|
|
503
|
-
const formattedDate =
|
|
556
|
+
const formattedDate = formatScheduleDate(scheduleDate.value);
|
|
504
557
|
const message = $t(
|
|
505
558
|
"publishScheduleSuccess",
|
|
506
559
|
"Publication scheduled for @date"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
@mouseenter="index = i"
|
|
11
11
|
>
|
|
12
12
|
<div class="bk-search-item-icon">
|
|
13
|
-
<ItemIcon :bundle="item.item.
|
|
13
|
+
<ItemIcon :bundle="item.item.bundle" />
|
|
14
14
|
</div>
|
|
15
15
|
<div class="bk-search-item-content">
|
|
16
16
|
<Highlight
|
|
@@ -49,7 +49,7 @@ const props = defineProps({
|
|
|
49
49
|
search: { type: String, required: true },
|
|
50
50
|
tab: { type: String, required: true }
|
|
51
51
|
});
|
|
52
|
-
const { eventBus, state, types, dom } = useBlokkli();
|
|
52
|
+
const { eventBus, state, types, dom, blocks, element } = useBlokkli();
|
|
53
53
|
const buildForKey = ref("");
|
|
54
54
|
const items = ref([]);
|
|
55
55
|
const index = ref(0);
|
|
@@ -92,28 +92,28 @@ const scrollItemIntoView = () => {
|
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
94
|
const buildSearchText = (el) => {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
text += " " + img.title;
|
|
95
|
+
if (!el) {
|
|
96
|
+
return "";
|
|
97
|
+
}
|
|
98
|
+
const altTexts = element.queryAll(el, "img", "buildSearchText", (el2) => {
|
|
99
|
+
if (el2 instanceof HTMLImageElement) {
|
|
100
|
+
return [el2.alt, el2.title].filter(Boolean).join("");
|
|
102
101
|
}
|
|
103
|
-
});
|
|
104
|
-
return
|
|
102
|
+
}).join(" ");
|
|
103
|
+
return (el.textContent ?? "") + altTexts;
|
|
105
104
|
};
|
|
106
105
|
const buildIndex = () => {
|
|
107
106
|
if (buildForKey.value === state.refreshKey.value) {
|
|
108
107
|
return;
|
|
109
108
|
}
|
|
110
|
-
const newItems =
|
|
111
|
-
const title = types.getBlockBundleDefinition(item.
|
|
109
|
+
const newItems = blocks.getAllBlocks().map((item) => {
|
|
110
|
+
const title = types.getBlockBundleDefinition(item.bundle)?.label || item.bundle;
|
|
111
|
+
const element2 = dom.getDragElement(item);
|
|
112
112
|
return {
|
|
113
113
|
item,
|
|
114
|
-
title
|
|
114
|
+
title,
|
|
115
115
|
context: title,
|
|
116
|
-
text: buildSearchText(
|
|
116
|
+
text: buildSearchText(element2)
|
|
117
117
|
};
|
|
118
118
|
}).filter(falsy);
|
|
119
119
|
items.value = newItems;
|
|
@@ -46,7 +46,7 @@ defineBlokkliFeature({
|
|
|
46
46
|
label: "Search",
|
|
47
47
|
description: "Provides an overlay with shortcut to search for blocks on the current page or existing content to add as blocks."
|
|
48
48
|
});
|
|
49
|
-
const { $t, selection } = useBlokkli();
|
|
49
|
+
const { $t, selection, ui } = useBlokkli();
|
|
50
50
|
const isRendered = ref(false);
|
|
51
51
|
const isVisible = ref(false);
|
|
52
52
|
const overlay = ref(null);
|
|
@@ -60,6 +60,9 @@ function onClick() {
|
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
onBlokkliEvent("keyPressed", (e) => {
|
|
63
|
+
if (ui.hasDialogOpen.value) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
63
66
|
if (e.code === "Escape") {
|
|
64
67
|
isVisible.value = false;
|
|
65
68
|
}
|
|
@@ -1,86 +1,57 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
:
|
|
6
|
-
:
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
<ArtboardTooltip
|
|
3
|
+
id="add-buttons"
|
|
4
|
+
:title="label"
|
|
5
|
+
:anchor-el
|
|
6
|
+
:anchor-coordinates
|
|
7
|
+
class="bk-selection-add-overlay"
|
|
8
|
+
@close="$emit('close')"
|
|
9
9
|
>
|
|
10
|
-
<div
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
@wheel="onWheel"
|
|
10
|
+
<div
|
|
11
|
+
ref="listEl"
|
|
12
|
+
class="bk-selection-add-overlay-list bk-scrollbar-dark"
|
|
13
|
+
@wheel="onWheel"
|
|
14
|
+
>
|
|
15
|
+
<button
|
|
16
|
+
v-for="item in items"
|
|
17
|
+
:key="item.bundle"
|
|
18
|
+
tabindex="-1"
|
|
19
|
+
@click.prevent="$emit('select', item.bundle)"
|
|
21
20
|
>
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
tabindex="-1"
|
|
38
|
-
@click.prevent="$emit('action', action.id)"
|
|
39
|
-
>
|
|
40
|
-
<AddListItemIcon :icon="action.icon" :color="action.color" />
|
|
41
|
-
<span>{{ action.title }}</span>
|
|
42
|
-
</button>
|
|
43
|
-
</div>
|
|
21
|
+
<AddListItemIcon
|
|
22
|
+
:bundle="item.bundle"
|
|
23
|
+
:color="item.isFavorite ? 'yellow' : 'default'"
|
|
24
|
+
/>
|
|
25
|
+
<span>{{ item.label }}</span>
|
|
26
|
+
</button>
|
|
27
|
+
<button
|
|
28
|
+
v-for="action in actions"
|
|
29
|
+
:key="'action:' + action.id"
|
|
30
|
+
tabindex="-1"
|
|
31
|
+
@click.prevent="$emit('action', action.id)"
|
|
32
|
+
>
|
|
33
|
+
<AddListItemIcon :icon="action.icon" :color="action.color" />
|
|
34
|
+
<span>{{ action.title }}</span>
|
|
35
|
+
</button>
|
|
44
36
|
</div>
|
|
45
|
-
</
|
|
37
|
+
</ArtboardTooltip>
|
|
46
38
|
</template>
|
|
47
39
|
|
|
48
40
|
<script setup>
|
|
49
|
-
import
|
|
50
|
-
import {
|
|
51
|
-
useTemplateRef,
|
|
52
|
-
useBlokkli,
|
|
53
|
-
computed,
|
|
54
|
-
onMounted,
|
|
55
|
-
onBeforeUnmount
|
|
56
|
-
} from "#imports";
|
|
57
|
-
import { Icon, AddListItemIcon } from "#blokkli/components";
|
|
41
|
+
import { useTemplateRef, useBlokkli, computed } from "#imports";
|
|
42
|
+
import { AddListItemIcon, ArtboardTooltip } from "#blokkli/components";
|
|
58
43
|
import { isInternalBundle } from "#blokkli/helpers/bundles";
|
|
59
44
|
const props = defineProps({
|
|
60
45
|
bundles: { type: Array, required: true },
|
|
61
|
-
anchorEl: { type: null, required:
|
|
62
|
-
|
|
46
|
+
anchorEl: { type: null, required: false },
|
|
47
|
+
anchorCoordinates: { type: Object, required: false },
|
|
48
|
+
label: { type: String, required: true }
|
|
63
49
|
});
|
|
64
50
|
defineEmits(["select", "action", "close"]);
|
|
65
|
-
const el = useTemplateRef("el");
|
|
66
51
|
const listEl = useTemplateRef("listEl");
|
|
67
52
|
let hasScrollbar = null;
|
|
68
|
-
const { types,
|
|
53
|
+
const { types, plugins, storage } = useBlokkli();
|
|
69
54
|
const favorites = storage.use("blockFavorites", []);
|
|
70
|
-
const { placementY, caretX } = useStickyToolbar(el, {
|
|
71
|
-
getAnchorElement() {
|
|
72
|
-
return props.anchorEl;
|
|
73
|
-
},
|
|
74
|
-
getPlacementY() {
|
|
75
|
-
return "auto";
|
|
76
|
-
},
|
|
77
|
-
getPlacementX() {
|
|
78
|
-
return "center";
|
|
79
|
-
},
|
|
80
|
-
getCaretWidth() {
|
|
81
|
-
return 30;
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
55
|
const items = computed(() => {
|
|
85
56
|
return props.bundles.filter((bundle) => !isInternalBundle(bundle)).map((bundle) => {
|
|
86
57
|
return {
|
|
@@ -111,10 +82,4 @@ const onWheel = (e) => {
|
|
|
111
82
|
e.stopPropagation();
|
|
112
83
|
}
|
|
113
84
|
};
|
|
114
|
-
onMounted(() => {
|
|
115
|
-
ui.hasAddTooltipOpen.value = true;
|
|
116
|
-
});
|
|
117
|
-
onBeforeUnmount(() => {
|
|
118
|
-
ui.hasAddTooltipOpen.value = false;
|
|
119
|
-
});
|
|
120
85
|
</script>
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
import type { Coord } from '#blokkli/types';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
bundles: string[];
|
|
3
|
-
anchorEl
|
|
4
|
-
|
|
4
|
+
anchorEl?: HTMLElement;
|
|
5
|
+
anchorCoordinates?: Coord;
|
|
6
|
+
label: string;
|
|
5
7
|
};
|
|
6
8
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
-
select: (id: string) => void;
|
|
8
9
|
action: (id: string) => void;
|
|
10
|
+
select: (id: string) => void;
|
|
9
11
|
close: () => void;
|
|
10
12
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
|
-
onClose?: (() => any) | undefined;
|
|
12
|
-
onSelect?: ((id: string) => any) | undefined;
|
|
13
13
|
onAction?: ((id: string) => any) | undefined;
|
|
14
|
+
onSelect?: ((id: string) => any) | undefined;
|
|
15
|
+
onClose?: (() => any) | undefined;
|
|
14
16
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
17
|
export default _default;
|