@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
|
@@ -7,7 +7,7 @@ query pbConfig($entityType: String!, $entityBundle: String!) {
|
|
|
7
7
|
}
|
|
8
8
|
allTypes: entityQuery(entityType: PARAGRAPHS_TYPE, limit: 999) {
|
|
9
9
|
items {
|
|
10
|
-
...
|
|
10
|
+
...blokkliParagraphsType
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -85,12 +85,3 @@ fragment paragraphsBlokkliSupportedClipboard on ParagraphsBlokkliSupportedClipbo
|
|
|
85
85
|
videoProviders
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
|
|
89
|
-
fragment paragraphsType on ParagraphsType {
|
|
90
|
-
id
|
|
91
|
-
label
|
|
92
|
-
icon: iconDefault
|
|
93
|
-
description
|
|
94
|
-
allowReusable
|
|
95
|
-
isTranslatable
|
|
96
|
-
}
|
|
@@ -32,30 +32,33 @@ query pbComments(
|
|
|
32
32
|
mutation pbAddComment(
|
|
33
33
|
$entityType: EntityType!
|
|
34
34
|
$entityUuid: String!
|
|
35
|
+
$langcode: String!
|
|
35
36
|
$blockUuids: [String]!
|
|
36
37
|
$body: String!
|
|
37
38
|
) {
|
|
38
|
-
|
|
39
|
+
action: paragraphsBlokkliAddComment(
|
|
39
40
|
entityType: $entityType
|
|
40
41
|
entityUuid: $entityUuid
|
|
42
|
+
langcode: $langcode
|
|
43
|
+
body: $body
|
|
44
|
+
paragraphUuids: $blockUuids
|
|
41
45
|
) {
|
|
42
|
-
|
|
43
|
-
...paragraphsBlokkliComment
|
|
44
|
-
}
|
|
46
|
+
...paragraphsBlokkliComment
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
mutation pbResolveComment(
|
|
49
51
|
$entityType: EntityType!
|
|
50
52
|
$entityUuid: String!
|
|
53
|
+
$langcode: String!
|
|
51
54
|
$uuid: String!
|
|
52
55
|
) {
|
|
53
|
-
|
|
56
|
+
action: paragraphsBlokkliResolveComment(
|
|
54
57
|
entityType: $entityType
|
|
55
58
|
entityUuid: $entityUuid
|
|
59
|
+
langcode: $langcode
|
|
60
|
+
uuid: $uuid
|
|
56
61
|
) {
|
|
57
|
-
|
|
58
|
-
...paragraphsBlokkliComment
|
|
59
|
-
}
|
|
62
|
+
...paragraphsBlokkliComment
|
|
60
63
|
}
|
|
61
64
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
mutation pbSetParagraphSchedule(
|
|
2
|
+
$entityType: EntityType!
|
|
3
|
+
$entityUuid: String!
|
|
4
|
+
$langcode: String
|
|
5
|
+
$items: [ParagraphsBlokkliSetParagraphScheduleInput]!
|
|
6
|
+
) {
|
|
7
|
+
state: paragraphsEditMutationState(
|
|
8
|
+
entityType: $entityType
|
|
9
|
+
entityUuid: $entityUuid
|
|
10
|
+
) {
|
|
11
|
+
action: set_paragraph_schedule(items: $items) {
|
|
12
|
+
...paragraphsBlokkliMutationResult
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -201,6 +201,39 @@ fragment paragraphsBlokkliPublishOptions on ParagraphsBlokkliPublishOptions {
|
|
|
201
201
|
} else {
|
|
202
202
|
addGraphqlDocument("features/publish.graphql");
|
|
203
203
|
}
|
|
204
|
+
const paragraphsBlokkliEditContextFields = [
|
|
205
|
+
...getTypeFields("ParagraphsBlokkliParagraphEditContext").keys()
|
|
206
|
+
];
|
|
207
|
+
graphql.addDocument(
|
|
208
|
+
"blokkli:paragraphsBlokkliParagraphEditContext",
|
|
209
|
+
`
|
|
210
|
+
fragment paragraphsBlokkliParagraphEditContext on ParagraphsBlokkliParagraphEditContext {
|
|
211
|
+
${paragraphsBlokkliEditContextFields.join("\n ")}
|
|
212
|
+
}
|
|
213
|
+
`
|
|
214
|
+
);
|
|
215
|
+
addMutation("set_paragraph_schedule", "block-scheduler");
|
|
216
|
+
const paragraphsTypeFields = [
|
|
217
|
+
...getTypeFields("ParagraphsType").keys()
|
|
218
|
+
].filter((field) => {
|
|
219
|
+
return [
|
|
220
|
+
"id",
|
|
221
|
+
"label",
|
|
222
|
+
"description",
|
|
223
|
+
"allowReusable",
|
|
224
|
+
"isTranslatable",
|
|
225
|
+
"hasPublishOn",
|
|
226
|
+
"hasUnpublishOn"
|
|
227
|
+
].includes(field);
|
|
228
|
+
});
|
|
229
|
+
graphql.addDocument(
|
|
230
|
+
"blokkli:paragraphsType",
|
|
231
|
+
`
|
|
232
|
+
fragment blokkliParagraphsType on ParagraphsType {
|
|
233
|
+
${paragraphsTypeFields.join("\n ")}
|
|
234
|
+
}
|
|
235
|
+
`
|
|
236
|
+
);
|
|
204
237
|
}
|
|
205
238
|
});
|
|
206
239
|
|
|
@@ -100,7 +100,7 @@ export default defineBlokkliEditAdapter(
|
|
|
100
100
|
clipboard: v.data.clipboards || [],
|
|
101
101
|
availableFeatures: v.data.features,
|
|
102
102
|
allTypes: (v.data.allTypes.items || []).filter(
|
|
103
|
-
(v2) => v2 && "
|
|
103
|
+
(v2) => v2 && "id" in v2
|
|
104
104
|
),
|
|
105
105
|
fieldConfig: v.data.fieldConfig || [],
|
|
106
106
|
editableFieldConfig: v.data.editableFieldConfig || [],
|
|
@@ -206,7 +206,7 @@ export default defineBlokkliEditAdapter(
|
|
|
206
206
|
}).then(mapMutation);
|
|
207
207
|
const moveBlock = (e) => useGraphqlMutation("pbMoveParagraph", {
|
|
208
208
|
...ctx.value,
|
|
209
|
-
uuid: e.item.uuid,
|
|
209
|
+
uuid: e.item.block.uuid,
|
|
210
210
|
hostType: e.host.type,
|
|
211
211
|
hostUuid: e.host.uuid,
|
|
212
212
|
hostFieldName: e.host.fieldName,
|
|
@@ -527,13 +527,13 @@ export default defineBlokkliEditAdapter(
|
|
|
527
527
|
...ctx.value,
|
|
528
528
|
blockUuids,
|
|
529
529
|
body
|
|
530
|
-
}).then((v) => mapComments(v.data.
|
|
530
|
+
}).then((v) => mapComments(v.data.action || []));
|
|
531
531
|
}
|
|
532
532
|
if (hasMutation("pbResolveComment")) {
|
|
533
533
|
adapter.resolveComment = (uuid) => useGraphqlMutation("pbResolveComment", {
|
|
534
534
|
...ctx.value,
|
|
535
535
|
uuid
|
|
536
|
-
}).then((v) => mapComments(v.data.
|
|
536
|
+
}).then((v) => mapComments(v.data.action || []));
|
|
537
537
|
}
|
|
538
538
|
if (hasQuery("pbLibraryItems")) {
|
|
539
539
|
adapter.getLibraryItems = (data) => {
|
|
@@ -895,6 +895,14 @@ export default defineBlokkliEditAdapter(
|
|
|
895
895
|
revisionLogMessage: options.revisionLogMessage
|
|
896
896
|
}).then(mapMutation);
|
|
897
897
|
}
|
|
898
|
+
if (hasMutation("pbSetParagraphSchedule")) {
|
|
899
|
+
adapter.setBlockScheduleDate = (blocks) => useGraphqlMutation("pbSetParagraphSchedule", {
|
|
900
|
+
entityType: ctx.value.entityType,
|
|
901
|
+
entityUuid: ctx.value.entityUuid,
|
|
902
|
+
langcode: ctx.value.langcode,
|
|
903
|
+
items: blocks
|
|
904
|
+
}).then(mapMutation);
|
|
905
|
+
}
|
|
898
906
|
return adapter;
|
|
899
907
|
}
|
|
900
908
|
);
|
|
@@ -179,6 +179,23 @@ export type BlokkliAdapterScheduleOptions = {
|
|
|
179
179
|
*/
|
|
180
180
|
date: string;
|
|
181
181
|
};
|
|
182
|
+
export type BlokkliAdapterSetBlockScheduleOptions = {
|
|
183
|
+
/**
|
|
184
|
+
* The UUID of the block.
|
|
185
|
+
*/
|
|
186
|
+
uuid: string;
|
|
187
|
+
/**
|
|
188
|
+
* The schedule type.
|
|
189
|
+
*/
|
|
190
|
+
type: 'publish' | 'unpublish';
|
|
191
|
+
/**
|
|
192
|
+
* The date. If empty, remove the schedule date.
|
|
193
|
+
*/
|
|
194
|
+
date?: string;
|
|
195
|
+
};
|
|
196
|
+
export type BlokkliAdapterUnscheduleBlockOptions = {
|
|
197
|
+
uuid: string;
|
|
198
|
+
};
|
|
182
199
|
export type BlokkliAdapterUnscheduleOptions = {
|
|
183
200
|
/**
|
|
184
201
|
* The host entity type.
|
|
@@ -344,6 +361,10 @@ export interface BlokkliAdapter<T> {
|
|
|
344
361
|
* Unschedule an already scheduled edit state.
|
|
345
362
|
*/
|
|
346
363
|
unscheduleEditState?: (options: BlokkliAdapterUnscheduleOptions) => Promise<MutationResponseLike<T | undefined | null>>;
|
|
364
|
+
/**
|
|
365
|
+
* Schedule a block.
|
|
366
|
+
*/
|
|
367
|
+
setBlockScheduleDate?: (blocks: BlokkliAdapterSetBlockScheduleOptions[]) => Promise<MutationResponseLike<T | undefined | null>>;
|
|
347
368
|
/**
|
|
348
369
|
* Set a specific history index.
|
|
349
370
|
*/
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Teleport to="#bk-blokkli-item-actions">
|
|
3
3
|
<button
|
|
4
|
+
v-if="shouldRender"
|
|
4
5
|
ref="el"
|
|
5
6
|
:disabled="isDisabled"
|
|
6
|
-
|
|
7
|
+
class="bk-item-action"
|
|
8
|
+
:class="[
|
|
9
|
+
{ 'bk-is-active': active, 'bk-is-last': weight === 'last' },
|
|
10
|
+
$attrs.class
|
|
11
|
+
]"
|
|
7
12
|
:style="weight !== 'last' ? { order: weight || 0 } : void 0"
|
|
8
13
|
@click.prevent.stop="onClick"
|
|
9
14
|
>
|
|
10
15
|
<slot name="icon">
|
|
11
|
-
<Icon v-if="icon" :name="icon" />
|
|
16
|
+
<Icon v-if="icon" :name="icon" class="bk-item-action-icon" />
|
|
12
17
|
</slot>
|
|
13
18
|
<div class="bk-tooltip">
|
|
14
19
|
<span>{{ title }}</span>
|
|
@@ -23,9 +28,7 @@
|
|
|
23
28
|
</div>
|
|
24
29
|
</button>
|
|
25
30
|
</Teleport>
|
|
26
|
-
<
|
|
27
|
-
<slot :items="selection.blocks.value" :uuids="uuids" />
|
|
28
|
-
</Teleport>
|
|
31
|
+
<slot :items="selection.items.value" :uuids="uuids" />
|
|
29
32
|
</template>
|
|
30
33
|
|
|
31
34
|
<script setup>
|
|
@@ -33,7 +36,7 @@ import { computed, ref, useBlokkli } from "#imports";
|
|
|
33
36
|
import { Icon, ShortcutIndicator } from "#blokkli/components";
|
|
34
37
|
import defineCommands from "#blokkli/helpers/composables/defineCommands";
|
|
35
38
|
import defineTourItem from "#blokkli/helpers/composables/defineTourItem";
|
|
36
|
-
const { selection } = useBlokkli();
|
|
39
|
+
const { selection, state } = useBlokkli();
|
|
37
40
|
const el = ref(null);
|
|
38
41
|
const uuids = computed(() => selection.uuids.value);
|
|
39
42
|
const props = defineProps({
|
|
@@ -44,26 +47,33 @@ const props = defineProps({
|
|
|
44
47
|
keyCode: { type: String, required: false },
|
|
45
48
|
meta: { type: Boolean, required: false },
|
|
46
49
|
multiple: { type: Boolean, required: false },
|
|
50
|
+
editOnly: { type: Boolean, required: false },
|
|
47
51
|
weight: { type: [Number, String], required: false },
|
|
48
52
|
icon: { type: null, required: false },
|
|
49
53
|
tourText: { type: String, required: false }
|
|
50
54
|
});
|
|
51
55
|
const isDisabled = computed(
|
|
52
|
-
() => props.disabled || !props.multiple && selection.
|
|
56
|
+
() => props.disabled || !props.multiple && selection.items.value.length > 1
|
|
53
57
|
);
|
|
58
|
+
const shouldRender = computed(() => {
|
|
59
|
+
if (props.editOnly) {
|
|
60
|
+
return state.editMode.value === "editing";
|
|
61
|
+
}
|
|
62
|
+
return true;
|
|
63
|
+
});
|
|
54
64
|
const emit = defineEmits(["click"]);
|
|
55
65
|
const onClick = () => {
|
|
56
66
|
if (isDisabled.value || !uuids.value.length) {
|
|
57
67
|
return;
|
|
58
68
|
}
|
|
59
|
-
emit("click", selection.
|
|
69
|
+
emit("click", selection.items.value);
|
|
60
70
|
};
|
|
61
71
|
defineCommands(() => ({
|
|
62
72
|
id: "plugin:item_action:" + props.id,
|
|
63
73
|
group: "selection",
|
|
64
74
|
label: props.title,
|
|
65
75
|
icon: props.icon,
|
|
66
|
-
disabled: props.disabled || !selection.
|
|
76
|
+
disabled: props.disabled || !selection.items.value.length,
|
|
67
77
|
callback: onClick
|
|
68
78
|
}));
|
|
69
79
|
defineTourItem(() => {
|
|
@@ -77,10 +87,8 @@ defineTourItem(() => {
|
|
|
77
87
|
element: () => el.value
|
|
78
88
|
};
|
|
79
89
|
});
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
name: "PluginItemAction"
|
|
85
|
-
};
|
|
90
|
+
defineOptions({
|
|
91
|
+
name: "PluginItemAction",
|
|
92
|
+
inheritAttrs: false
|
|
93
|
+
});
|
|
86
94
|
</script>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BlokkliIcon } from '#blokkli-build/icons';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
2
|
+
import type { RenderedFieldListItem } from '#blokkli/types';
|
|
3
|
+
type __VLS_Props = {
|
|
4
4
|
id: string;
|
|
5
5
|
/**
|
|
6
6
|
* The title of the action.
|
|
@@ -27,55 +27,31 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
27
27
|
*/
|
|
28
28
|
multiple?: boolean;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
31
|
-
*/
|
|
32
|
-
weight?: number | string | "last";
|
|
33
|
-
icon?: BlokkliIcon;
|
|
34
|
-
tourText?: string;
|
|
35
|
-
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
36
|
-
click: (items: DraggableExistingBlock[]) => any;
|
|
37
|
-
}, string, import("vue").PublicProps, Readonly<{
|
|
38
|
-
id: string;
|
|
39
|
-
/**
|
|
40
|
-
* The title of the action.
|
|
41
|
-
*/
|
|
42
|
-
title: string;
|
|
43
|
-
/**
|
|
44
|
-
* Whether the action is disabled.
|
|
45
|
-
*/
|
|
46
|
-
disabled?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Whether the button should be displayed in an active state (e.g. when it's a dropdown).
|
|
30
|
+
* Whether the action is only available in edit mode.
|
|
49
31
|
*/
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* The key code to use for the shortcut.
|
|
53
|
-
*/
|
|
54
|
-
keyCode?: string;
|
|
55
|
-
/**
|
|
56
|
-
* Wheter the shortcut needs the meta modifier key.
|
|
57
|
-
*/
|
|
58
|
-
meta?: boolean;
|
|
59
|
-
/**
|
|
60
|
-
* Whether the action supports multiple items.
|
|
61
|
-
*/
|
|
62
|
-
multiple?: boolean;
|
|
32
|
+
editOnly?: boolean;
|
|
63
33
|
/**
|
|
64
34
|
* The weight, used for positioning the button.
|
|
65
35
|
*/
|
|
66
|
-
weight?: number | string |
|
|
36
|
+
weight?: number | string | 'last';
|
|
67
37
|
icon?: BlokkliIcon;
|
|
68
38
|
tourText?: string;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
39
|
+
};
|
|
40
|
+
declare var __VLS_5: {}, __VLS_19: {
|
|
41
|
+
items: RenderedFieldListItem[];
|
|
42
|
+
uuids: string[];
|
|
43
|
+
};
|
|
44
|
+
type __VLS_Slots = {} & {
|
|
45
|
+
icon?: (props: typeof __VLS_5) => any;
|
|
73
46
|
} & {
|
|
74
|
-
default?: (props:
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
47
|
+
default?: (props: typeof __VLS_19) => any;
|
|
48
|
+
};
|
|
49
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
50
|
+
click: (items: RenderedFieldListItem[]) => any;
|
|
51
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
52
|
+
onClick?: ((items: RenderedFieldListItem[]) => any) | undefined;
|
|
53
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
54
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
79
55
|
export default _default;
|
|
80
56
|
type __VLS_WithSlots<T, S> = T & {
|
|
81
57
|
new (): {
|
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import defineTourItem from "#blokkli/helpers/composables/defineTourItem";
|
|
7
|
-
import { getCurrentInstance } from "#imports";
|
|
7
|
+
import { getCurrentInstance, useBlokkli } from "#imports";
|
|
8
8
|
const props = defineProps({
|
|
9
9
|
id: { type: String, required: true },
|
|
10
10
|
title: { type: String, required: true },
|
|
11
11
|
text: { type: String, required: true },
|
|
12
12
|
selector: { type: String, required: false }
|
|
13
13
|
});
|
|
14
|
+
const { element } = useBlokkli();
|
|
14
15
|
const findElement = (el) => {
|
|
15
16
|
if (el instanceof Text) {
|
|
16
17
|
return findElement(el.nextElementSibling);
|
|
@@ -25,10 +26,14 @@ defineTourItem(() => {
|
|
|
25
26
|
title: props.title,
|
|
26
27
|
text: props.text,
|
|
27
28
|
element: () => {
|
|
28
|
-
const provided = props.selector ?
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
const provided = props.selector ? element.query(
|
|
30
|
+
document.documentElement,
|
|
31
|
+
props.selector,
|
|
32
|
+
`TourItem Plugin: ${props.id}`
|
|
33
|
+
) : void 0;
|
|
34
|
+
const el = provided || findElement(instance?.vnode.el);
|
|
35
|
+
if (el instanceof HTMLElement) {
|
|
36
|
+
return el;
|
|
32
37
|
}
|
|
33
38
|
}
|
|
34
39
|
};
|
|
@@ -18,16 +18,18 @@
|
|
|
18
18
|
import { computed, provide, defineBlokkli } from "#imports";
|
|
19
19
|
import {
|
|
20
20
|
INJECT_IS_IN_REUSABLE,
|
|
21
|
-
INJECT_REUSABLE_OPTIONS
|
|
21
|
+
INJECT_REUSABLE_OPTIONS,
|
|
22
|
+
INJECT_REUSABLE_UUID
|
|
22
23
|
} from "#blokkli/helpers/symbols";
|
|
23
24
|
const props = defineProps({
|
|
24
25
|
libraryItem: { type: Object, required: false }
|
|
25
26
|
});
|
|
26
|
-
const { index, options, parentType, isEditing } = defineBlokkli({
|
|
27
|
+
const { index, options, parentType, isEditing, uuid } = defineBlokkli({
|
|
27
28
|
bundle: "from_library"
|
|
28
29
|
});
|
|
29
30
|
provide(INJECT_REUSABLE_OPTIONS, options);
|
|
30
31
|
provide(INJECT_IS_IN_REUSABLE, true);
|
|
32
|
+
provide(INJECT_REUSABLE_UUID, uuid);
|
|
31
33
|
const item = computed(() => {
|
|
32
34
|
const v = props.libraryItem?.block;
|
|
33
35
|
if (v && "uuid" in v) {
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<component :is="tag"
|
|
2
|
+
<component :is="tag" ref="root">
|
|
3
3
|
<slot :value="renderedValue" />
|
|
4
4
|
</component>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script setup>
|
|
8
|
-
import { ref, computed, inject, onMounted, onBeforeUnmount } from "#imports";
|
|
9
8
|
import {
|
|
9
|
+
ref,
|
|
10
|
+
computed,
|
|
11
|
+
inject,
|
|
12
|
+
onMounted,
|
|
13
|
+
onBeforeUnmount,
|
|
14
|
+
useTemplateRef
|
|
15
|
+
} from "#imports";
|
|
16
|
+
import {
|
|
17
|
+
INJECT_APP,
|
|
10
18
|
INJECT_EDIT_CONTEXT,
|
|
11
19
|
INJECT_ENTITY_CONTEXT,
|
|
12
|
-
INJECT_IS_EDITING
|
|
20
|
+
INJECT_IS_EDITING,
|
|
21
|
+
INJECT_IS_IN_REUSABLE
|
|
13
22
|
} from "#blokkli/helpers/symbols";
|
|
14
23
|
const props = defineProps({
|
|
15
24
|
name: { type: String, required: true },
|
|
@@ -17,38 +26,47 @@ const props = defineProps({
|
|
|
17
26
|
tag: { type: String, required: false, default: "div" }
|
|
18
27
|
});
|
|
19
28
|
defineSlots();
|
|
29
|
+
const root = useTemplateRef("root");
|
|
20
30
|
const valueOverride = ref("");
|
|
21
31
|
const isEditing = inject(INJECT_IS_EDITING, false);
|
|
22
32
|
const entity = inject(INJECT_ENTITY_CONTEXT);
|
|
23
33
|
const editContext = inject(INJECT_EDIT_CONTEXT, null);
|
|
34
|
+
const app = inject(INJECT_APP, null);
|
|
35
|
+
const isInReusable = inject(INJECT_IS_IN_REUSABLE, false);
|
|
24
36
|
if (!entity) {
|
|
25
37
|
throw new Error("Missing entity context.");
|
|
26
38
|
}
|
|
27
39
|
const renderedValue = computed(() => valueOverride.value || props.value);
|
|
28
|
-
const attrs = computed(() => {
|
|
29
|
-
if (isEditing && props.name) {
|
|
30
|
-
return {
|
|
31
|
-
"data-blokkli-editable-field": props.name,
|
|
32
|
-
"data-blokkli-editable-component": "true",
|
|
33
|
-
"data-blokkli-editable-value": props.value
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
return void 0;
|
|
37
|
-
});
|
|
38
40
|
const onEditableUpdateValue = (e) => {
|
|
39
41
|
if (e.name === props.name && e.entityUuid === entity.uuid) {
|
|
40
42
|
valueOverride.value = e.value;
|
|
41
43
|
}
|
|
42
44
|
};
|
|
43
45
|
onMounted(() => {
|
|
44
|
-
if (!isEditing || !editContext) {
|
|
46
|
+
if (!isEditing || !editContext || !app || isInReusable) {
|
|
45
47
|
return;
|
|
46
48
|
}
|
|
47
49
|
editContext.eventBus.on("editable:update", onEditableUpdateValue);
|
|
50
|
+
if (root.value instanceof HTMLElement && entity) {
|
|
51
|
+
app.directive.registerDirectiveElement(
|
|
52
|
+
root.value,
|
|
53
|
+
props.name,
|
|
54
|
+
entity,
|
|
55
|
+
"editable"
|
|
56
|
+
);
|
|
57
|
+
}
|
|
48
58
|
});
|
|
49
59
|
onBeforeUnmount(() => {
|
|
50
60
|
if (editContext) {
|
|
51
61
|
editContext.eventBus.off("editable:update", onEditableUpdateValue);
|
|
52
62
|
}
|
|
63
|
+
if (app && root.value instanceof HTMLElement && entity) {
|
|
64
|
+
app.directive.unregisterDirectiveElement(
|
|
65
|
+
root.value,
|
|
66
|
+
props.name,
|
|
67
|
+
entity,
|
|
68
|
+
"editable"
|
|
69
|
+
);
|
|
70
|
+
}
|
|
53
71
|
});
|
|
54
72
|
</script>
|
|
@@ -145,6 +145,9 @@ function filterVisible(item) {
|
|
|
145
145
|
if (isEditing) {
|
|
146
146
|
return true;
|
|
147
147
|
}
|
|
148
|
+
if (!item.editContext?.isPublished) {
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
148
151
|
const isVisible = isVisibleByOptions(item, providerEntity.value.language);
|
|
149
152
|
const isVisibleCustom = props.shouldRenderItem ? props.shouldRenderItem(item) : true;
|
|
150
153
|
return isVisible && isVisibleCustom;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BlokkliFragmentName } from '#blokkli-build/definitions';
|
|
2
|
-
import type { FieldListItem } from '#blokkli/types';
|
|
2
|
+
import type { FieldListItem, FieldDropAlignment } from '#blokkli/types';
|
|
3
3
|
import type { ValidFieldListTypes, FieldListItemTyped } from '#blokkli-build/generated-types';
|
|
4
4
|
type __VLS_Slots = {
|
|
5
5
|
default(props: {
|
|
@@ -19,7 +19,7 @@ type __VLS_Props = {
|
|
|
19
19
|
editClass?: string;
|
|
20
20
|
nonEmptyClass?: string;
|
|
21
21
|
allowedFragments?: BlokkliFragmentName[];
|
|
22
|
-
dropAlignment?:
|
|
22
|
+
dropAlignment?: FieldDropAlignment;
|
|
23
23
|
/**
|
|
24
24
|
* Renders proxy blocks during editing.
|
|
25
25
|
*/
|
|
@@ -33,8 +33,8 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}
|
|
|
33
33
|
list: Array<FieldListItem | null | undefined> | FieldListItem | null;
|
|
34
34
|
fieldListType: ValidFieldListTypes;
|
|
35
35
|
allowedFragments: BlokkliFragmentName[];
|
|
36
|
+
dropAlignment: FieldDropAlignment;
|
|
36
37
|
tag: string;
|
|
37
|
-
dropAlignment: "vertical" | "horizontal";
|
|
38
38
|
shouldRenderItem: (item: FieldListItem | FieldListItemTyped) => boolean;
|
|
39
39
|
listClass: string;
|
|
40
40
|
editClass: string;
|
|
@@ -38,10 +38,10 @@ const itemEntityType = useRuntimeConfig().public.blokkli.itemEntityType;
|
|
|
38
38
|
const componentProps = defineProps({
|
|
39
39
|
uuid: { type: String, required: true },
|
|
40
40
|
bundle: { type: String, required: true },
|
|
41
|
-
isNew: { type: Boolean, required: false },
|
|
42
41
|
options: { type: null, required: false, default: () => ({}) },
|
|
43
42
|
props: { type: null, required: false, default: () => ({}) },
|
|
44
43
|
index: { type: Number, required: false, default: 0 },
|
|
44
|
+
editContext: { type: Object, required: false, default: void 0 },
|
|
45
45
|
parentType: { type: String, required: false, default: "" },
|
|
46
46
|
isEditing: { type: Boolean, required: false, default: false }
|
|
47
47
|
});
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
+
import type { BlockEditContext } from '#blokkli/types';
|
|
1
2
|
declare const _default: import("vue").DefineComponent<{
|
|
2
3
|
uuid: string;
|
|
3
4
|
bundle: string;
|
|
4
|
-
isNew?: boolean;
|
|
5
5
|
options?: any;
|
|
6
6
|
props?: any;
|
|
7
7
|
index?: number;
|
|
8
|
+
editContext?: BlockEditContext;
|
|
8
9
|
parentType?: string;
|
|
9
10
|
isEditing?: boolean;
|
|
10
11
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
11
12
|
uuid: string;
|
|
12
13
|
bundle: string;
|
|
13
|
-
isNew?: boolean;
|
|
14
14
|
options?: any;
|
|
15
15
|
props?: any;
|
|
16
16
|
index?: number;
|
|
17
|
+
editContext?: BlockEditContext;
|
|
17
18
|
parentType?: string;
|
|
18
19
|
isEditing?: boolean;
|
|
19
20
|
}> & Readonly<{}>, {
|
|
@@ -21,6 +22,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
21
22
|
options: any;
|
|
22
23
|
parentType: string;
|
|
23
24
|
isEditing: boolean;
|
|
25
|
+
editContext: BlockEditContext;
|
|
24
26
|
props: any;
|
|
25
27
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
28
|
export default _default;
|