@blokkli/editor 1.0.0 → 1.0.2
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 +35 -3
- package/dist/runtime/adapter/drupal/graphqlMiddleware.js +9 -1
- package/dist/runtime/adapter/index.d.ts +4 -0
- package/dist/runtime/components/Blocks/FromLibrary/index.vue +2 -3
- package/dist/runtime/components/Edit/Dialog/index.vue +14 -1
- package/dist/runtime/components/Edit/DragInteractions/index.vue +1 -4
- package/dist/runtime/components/Edit/EditProvider.vue +1 -0
- package/dist/runtime/components/Edit/Features/BlockAddList/index.vue +33 -27
- package/dist/runtime/components/Edit/Features/Edit/index.vue +60 -14
- package/dist/runtime/components/Edit/Features/Exit/index.vue +2 -1
- package/dist/runtime/components/Edit/Features/Library/EditReusable/index.vue +206 -0
- package/dist/runtime/components/Edit/Features/Library/LibraryDialog/index.vue +7 -8
- package/dist/runtime/components/Edit/Features/Library/index.vue +25 -2
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue +11 -10
- package/dist/runtime/components/Edit/Features/MediaLibrary/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Publish/index.vue +4 -1
- package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Content/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Translations/index.vue +26 -1
- package/dist/runtime/css/output.css +1 -1
- package/dist/runtime/helpers/broadcastProvider.d.ts +10 -2
- package/dist/runtime/helpers/composables/onBroadcastEvent.d.ts +2 -0
- package/dist/runtime/helpers/composables/onBroadcastEvent.js +10 -0
- package/dist/runtime/helpers/featuresProvider.d.ts +2 -2
- package/dist/runtime/helpers/index.js +2 -2
- package/dist/runtime/types/index.d.ts +12 -2
- package/package.json +1 -1
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { type Emitter } from 'mitt';
|
|
2
|
-
type BroadcastEvents = {
|
|
2
|
+
export type BroadcastEvents = {
|
|
3
3
|
previewFocused: undefined;
|
|
4
|
+
published: {
|
|
5
|
+
uuid: string;
|
|
6
|
+
};
|
|
7
|
+
closeEditor: {
|
|
8
|
+
uuid: string;
|
|
9
|
+
};
|
|
10
|
+
editorLoaded: {
|
|
11
|
+
uuid: string;
|
|
12
|
+
};
|
|
4
13
|
};
|
|
5
14
|
export type BroadcastProvider = Emitter<BroadcastEvents>;
|
|
6
15
|
export default function (): BroadcastProvider;
|
|
7
|
-
export {};
|
|
@@ -8,11 +8,11 @@ export type FeaturesProvider = {
|
|
|
8
8
|
};
|
|
9
9
|
export default function (): {
|
|
10
10
|
features: ComputedRef<{
|
|
11
|
-
id:
|
|
11
|
+
id: ValidFeatureKey;
|
|
12
12
|
label?: string | undefined;
|
|
13
13
|
icon: import("../../../playground/.nuxt/blokkli/icons").BlokkliIcon;
|
|
14
14
|
description?: string | undefined;
|
|
15
|
-
dependencies?:
|
|
15
|
+
dependencies?: ValidFeatureKey[] | undefined;
|
|
16
16
|
viewports?: import("../constants").Viewport[] | undefined;
|
|
17
17
|
requiredAdapterMethods?: (keyof import("../adapter").BlokkliAdapter<any>)[] | undefined;
|
|
18
18
|
settings?: Record<string, import("#blokkli/types").FeatureDefinitionSetting> | undefined;
|
|
@@ -20,7 +20,7 @@ export function buildDraggableItem(element) {
|
|
|
20
20
|
const hostFieldName = dataset.hostFieldName;
|
|
21
21
|
const reusableBundle = dataset.reusableBundle;
|
|
22
22
|
const hostFieldListType = dataset.hostFieldListType;
|
|
23
|
-
const
|
|
23
|
+
const libraryItemUuid = dataset.bkLibraryItemUuid;
|
|
24
24
|
const isNew = dataset.isNew === "true";
|
|
25
25
|
const parentBlockBundle = hostType === itemEntityType ? hostBundle : void 0;
|
|
26
26
|
if (uuid && hostType && hostUuid && hostFieldName && itemBundle && hostBundle && entityType && hostFieldListType) {
|
|
@@ -44,7 +44,7 @@ export function buildDraggableItem(element) {
|
|
|
44
44
|
hostFieldName,
|
|
45
45
|
hostFieldListType,
|
|
46
46
|
reusableBundle,
|
|
47
|
-
|
|
47
|
+
libraryItemUuid,
|
|
48
48
|
editTitle: editTitle || void 0,
|
|
49
49
|
isNew,
|
|
50
50
|
parentBlockBundle
|
|
@@ -526,9 +526,9 @@ export interface DraggableExistingBlock {
|
|
|
526
526
|
*/
|
|
527
527
|
reusableBundle?: string;
|
|
528
528
|
/**
|
|
529
|
-
* The
|
|
529
|
+
* The UUID of the library item this block belongs to.
|
|
530
530
|
*/
|
|
531
|
-
|
|
531
|
+
libraryItemUuid?: string;
|
|
532
532
|
/**
|
|
533
533
|
* The title to use when displaying the block in lists during editing.
|
|
534
534
|
*/
|
|
@@ -802,6 +802,11 @@ export type DropClipboardItemEvent = {
|
|
|
802
802
|
host: DraggableHostData;
|
|
803
803
|
afterUuid?: string;
|
|
804
804
|
};
|
|
805
|
+
export type LibraryEditItemEvent = {
|
|
806
|
+
url: string;
|
|
807
|
+
uuid: string;
|
|
808
|
+
label?: string;
|
|
809
|
+
};
|
|
805
810
|
export type EventbusEvents = {
|
|
806
811
|
select: string | string[];
|
|
807
812
|
'item:edit': EditBlockEvent;
|
|
@@ -827,6 +832,7 @@ export type EventbusEvents = {
|
|
|
827
832
|
'select:next': undefined;
|
|
828
833
|
'item:dropped': undefined;
|
|
829
834
|
'block:append': BlockAppendEvent;
|
|
835
|
+
'item:doubleClick': DraggableExistingBlock;
|
|
830
836
|
scrollIntoView: ScrollIntoViewEvent;
|
|
831
837
|
'animationFrame:before': undefined;
|
|
832
838
|
'canvas:draw': CanvasDrawEvent;
|
|
@@ -853,6 +859,10 @@ export type EventbusEvents = {
|
|
|
853
859
|
* Emitted when publishing failed.
|
|
854
860
|
*/
|
|
855
861
|
'publish:failed': undefined;
|
|
862
|
+
/**
|
|
863
|
+
* Edit a library item.
|
|
864
|
+
*/
|
|
865
|
+
'library:edit-item': LibraryEditItemEvent;
|
|
856
866
|
};
|
|
857
867
|
export type Eventbus = Emitter<EventbusEvents>;
|
|
858
868
|
export type ItemEditContext = {
|