@blokkli/editor 2.0.0-alpha.12 → 2.0.0-alpha.14
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.d.mts +1 -1
- package/dist/module.json +5 -5
- package/dist/module.mjs +4006 -1164
- package/dist/modules/drupal/graphql/base/fragment.ParagraphsBlokkliConfigInput.graphql +31 -0
- package/dist/modules/drupal/graphql/base/fragment.blokkliProps.graphql +1 -0
- package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliEditState.graphql +1 -0
- package/dist/modules/drupal/graphql/base/query.pbEntityConfig.graphql +5 -0
- package/dist/modules/drupal/graphql/features/transform.graphql +9 -1
- package/dist/modules/drupal/graphql/features/transform_host.graphql +38 -0
- package/dist/modules/drupal/graphql/mutations/update_host_options.graphql +15 -0
- package/dist/modules/drupal/index.d.mts +1 -1
- package/dist/modules/drupal/index.mjs +20 -7
- package/dist/modules/drupal/runtime/adapter/index.js +109 -4
- package/dist/runtime/adapter/index.d.ts +54 -1
- package/dist/runtime/blokkliPlugins/AddAction/index.vue +27 -3
- package/dist/runtime/blokkliPlugins/BlockIndicator/index.vue +65 -0
- package/dist/runtime/blokkliPlugins/BlockIndicator/index.vue.d.ts +26 -0
- package/dist/runtime/blokkliPlugins/ContextMenu/Menu/index.vue +3 -0
- package/dist/runtime/blokkliPlugins/ContextMenu/index.vue +3 -2
- package/dist/runtime/blokkliPlugins/DroppableEdit/index.vue +3 -3
- package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue +49 -11
- package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue.d.ts +29 -15
- package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue +6 -7
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue +2 -9
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue.d.ts +4 -4
- package/dist/runtime/blokkliPlugins/ViewOption/index.vue +6 -3
- package/dist/runtime/blokkliPlugins/index.d.ts +8 -7
- package/dist/runtime/blokkliPlugins/index.js +15 -13
- package/dist/runtime/components/Blocks/Fragment/icon.svg +1 -1
- package/dist/runtime/components/BlokkliProvider.vue +1 -0
- package/dist/runtime/components/BlokkliProvider.vue.d.ts +1 -0
- package/dist/runtime/components/Edit/Actions/index.vue +39 -67
- package/dist/runtime/components/Edit/AddListItem/index.vue +2 -5
- package/dist/runtime/components/Edit/AddListItem/index.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/AddListItemIcon/index.vue +19 -0
- package/dist/runtime/components/Edit/AddListItemIcon/index.vue.d.ts +15 -0
- package/dist/runtime/components/Edit/AppMenu/index.vue +5 -5
- package/dist/runtime/components/Edit/Dialog/index.vue +5 -1
- package/dist/runtime/components/Edit/Dialog/index.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/DiffViewer/State.vue +276 -0
- package/dist/runtime/components/Edit/DiffViewer/State.vue.d.ts +16 -0
- package/dist/runtime/components/Edit/DragInteractions/index.vue +45 -8
- package/dist/runtime/components/Edit/EditProvider.vue +46 -35
- package/dist/runtime/components/Edit/Features/AddList/index.vue +15 -25
- package/dist/runtime/components/Edit/Features/Analyze/Overlay/fragment.glsl +58 -0
- package/dist/runtime/components/Edit/Features/Analyze/Overlay/index.vue +168 -0
- package/dist/runtime/components/Edit/Features/Analyze/Overlay/index.vue.d.ts +9 -0
- package/dist/runtime/components/Edit/Features/Analyze/Overlay/vertex.glsl +72 -0
- package/dist/runtime/components/Edit/Features/Analyze/Renderer.vue +159 -0
- package/dist/runtime/components/Edit/Features/Analyze/Renderer.vue.d.ts +7 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/Results.vue +100 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/Results.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItem.vue +56 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItem.vue.d.ts +3 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodes.vue +87 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodes.vue.d.ts +7 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue +101 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue.d.ts +8 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/Status.vue +18 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/Status.vue.d.ts +8 -0
- package/dist/runtime/components/Edit/Features/Analyze/Summary/Chart.vue +92 -0
- package/dist/runtime/components/Edit/Features/Analyze/Summary/Chart.vue.d.ts +17 -0
- package/dist/runtime/components/Edit/Features/Analyze/Summary/index.vue +77 -0
- package/dist/runtime/components/Edit/Features/Analyze/Summary/index.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/axe.d.ts +12 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/axe.js +75 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/defineAnalyzer.d.ts +4 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/defineAnalyzer.js +5 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/Context.d.ts +32 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/Context.js +45 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/collectTextElements.d.ts +5 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/collectTextElements.js +95 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/normalizeArray.d.ts +3 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/normalizeArray.js +13 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/index.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/index.js +2 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/readability.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/readability.js +165 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/types.d.ts +44 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/types.js +0 -0
- package/dist/runtime/components/Edit/Features/Analyze/helper.d.ts +5 -0
- package/dist/runtime/components/Edit/Features/Analyze/helper.js +28 -0
- package/dist/runtime/components/Edit/Features/Analyze/index.vue +44 -0
- package/dist/runtime/components/Edit/Features/Anchors/Renderer.vue +136 -0
- package/dist/runtime/components/Edit/Features/Anchors/index.vue +32 -0
- package/dist/runtime/components/Edit/Features/Anchors/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Artboard/Overview/index.vue +25 -13
- package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue +296 -0
- package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue.d.ts +7 -0
- package/dist/runtime/components/Edit/Features/Artboard/index.vue +10 -245
- package/dist/runtime/components/Edit/Features/Assistant/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/BlockAddList/index.vue +4 -4
- package/dist/runtime/components/Edit/Features/Clipboard/index.vue +161 -28
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Group/index.vue +16 -4
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Group/index.vue.d.ts +0 -1
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/index.vue +4 -53
- package/dist/runtime/components/Edit/Features/CommandPalette/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/Conversions/index.vue +12 -14
- package/dist/runtime/components/Edit/Features/Debug/Viewport/index.vue +14 -0
- package/dist/runtime/components/Edit/Features/Debug/index.vue +27 -24
- package/dist/runtime/components/Edit/Features/Diff/DiffView/index.vue +13 -190
- package/dist/runtime/components/Edit/Features/Diff/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/index.vue +4 -4
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/fragment.glsl +1 -1
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/index.vue +35 -71
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/vertex.glsl +1 -1
- package/dist/runtime/components/Edit/Features/DraggingOverlay/index.vue +62 -48
- package/dist/runtime/components/Edit/Features/EditForm/Frame/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/EditForm/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/EditableField/index.vue +6 -2
- package/dist/runtime/components/Edit/Features/EditableMask/index.vue +3 -20
- package/dist/runtime/components/Edit/Features/Fragments/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/History/index.vue +35 -12
- package/dist/runtime/components/Edit/Features/ImportExisting/Dialog/index.vue +6 -2
- package/dist/runtime/components/Edit/Features/ImportExisting/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/Library/index.vue +11 -9
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue +5 -8
- package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/fragment.glsl +1 -1
- package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/index.vue +9 -4
- package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/vertex.glsl +1 -1
- package/dist/runtime/components/Edit/Features/MultiSelect/index.vue +8 -14
- package/dist/runtime/components/Edit/Features/Options/Form/Checkbox/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/Options/Form/Checkbox/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Options/Form/Item.vue +9 -3
- package/dist/runtime/components/Edit/Features/Options/Form/Item.vue.d.ts +0 -1
- package/dist/runtime/components/Edit/Features/Options/Form/Radios/index.vue +37 -19
- package/dist/runtime/components/Edit/Features/Options/Form/Radios/index.vue.d.ts +8 -2
- package/dist/runtime/components/Edit/Features/Options/Form/index.vue +81 -37
- package/dist/runtime/components/Edit/Features/Options/Form/index.vue.d.ts +5 -5
- package/dist/runtime/components/Edit/Features/Options/index.vue +30 -6
- package/dist/runtime/components/Edit/Features/PreviewGrant/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue +1 -0
- package/dist/runtime/components/Edit/Features/Publish/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/Revert/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/Search/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/AddButtonsField.vue +54 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/AddButtonsField.vue.d.ts +14 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue +120 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue.d.ts +15 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue +459 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Selection/Overlay/fragment.glsl +15 -10
- package/dist/runtime/components/Edit/Features/Selection/Overlay/index.vue +32 -11
- package/dist/runtime/components/Edit/Features/Selection/Overlay/vertex.glsl +1 -1
- package/dist/runtime/components/Edit/Features/Selection/index.vue +76 -7
- package/dist/runtime/components/Edit/Features/Settings/Dialog/FeatureSetting/index.vue +12 -17
- package/dist/runtime/components/Edit/Features/Settings/index.vue +11 -25
- package/dist/runtime/components/Edit/Features/Theme/Color/index.vue +5 -1
- package/dist/runtime/components/Edit/Features/Theme/index.vue +2 -1
- package/dist/runtime/components/Edit/Features/TouchActionBar/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/Transform/Dialog/index.vue +198 -0
- package/dist/runtime/components/Edit/Features/Transform/Dialog/index.vue.d.ts +13 -0
- package/dist/runtime/components/Edit/Features/Transform/index.vue +155 -44
- package/dist/runtime/components/Edit/Form/Radio/index.vue +33 -0
- package/dist/runtime/components/Edit/Form/Radio/index.vue.d.ts +20 -0
- package/dist/runtime/components/Edit/Form/RadioTabs/index.vue +37 -0
- package/dist/runtime/components/Edit/Form/RadioTabs/index.vue.d.ts +22 -0
- package/dist/runtime/components/Edit/Form/Select/index.vue +29 -0
- package/dist/runtime/components/Edit/Form/Select/index.vue.d.ts +20 -0
- package/dist/runtime/components/Edit/Form/Text/index.vue +33 -0
- package/dist/runtime/components/Edit/Form/Text/index.vue.d.ts +19 -0
- package/dist/runtime/components/Edit/Form/Textarea/index.vue +13 -6
- package/dist/runtime/components/Edit/Form/Textarea/index.vue.d.ts +4 -0
- package/dist/runtime/components/Edit/FormOverlay/index.vue +1 -1
- package/dist/runtime/components/Edit/Indicators/index.vue +123 -0
- package/dist/runtime/components/Edit/Indicators/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/ItemIcon/index.vue +2 -1
- package/dist/runtime/components/Edit/Konami/Game/PixelGrid.vue +66 -0
- package/dist/runtime/components/Edit/Konami/Game/PixelGrid.vue.d.ts +7 -0
- package/dist/runtime/components/Edit/Konami/Game/blokkli.png +0 -0
- package/dist/runtime/components/Edit/Konami/Game/charmap.d.ts +2 -0
- package/dist/runtime/components/Edit/Konami/Game/charmap.js +168 -0
- package/dist/runtime/components/Edit/Konami/Game/index.vue +745 -0
- package/dist/runtime/components/Edit/Konami/Game/index.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Konami/Game/textRendering.d.ts +8 -0
- package/dist/runtime/components/Edit/Konami/Game/textRendering.js +138 -0
- package/dist/runtime/components/Edit/Konami/Game/useIconRendering.d.ts +9 -0
- package/dist/runtime/components/Edit/Konami/Game/useIconRendering.js +130 -0
- package/dist/runtime/components/Edit/Konami/index.vue +44 -0
- package/dist/runtime/components/Edit/Konami/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Loading/index.vue +6 -2
- package/dist/runtime/components/Edit/Loading/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Messages/index.vue +8 -3
- package/dist/runtime/components/Edit/PluginConfigForm/Checkbox/index.vue +17 -0
- package/dist/runtime/components/Edit/PluginConfigForm/Checkbox/index.vue.d.ts +11 -0
- package/dist/runtime/components/Edit/PluginConfigForm/Options/index.vue +37 -0
- package/dist/runtime/components/Edit/PluginConfigForm/Options/index.vue.d.ts +11 -0
- package/dist/runtime/components/Edit/PluginConfigForm/Text/index.vue +43 -0
- package/dist/runtime/components/Edit/PluginConfigForm/Text/index.vue.d.ts +11 -0
- package/dist/runtime/components/Edit/PluginConfigForm/index.vue +57 -0
- package/dist/runtime/components/Edit/PluginConfigForm/index.vue.d.ts +16 -0
- package/dist/runtime/components/Edit/PreviewProvider.vue +3 -4
- package/dist/runtime/components/Edit/RelativeTime/index.vue +3 -2
- package/dist/runtime/components/Edit/ShortcutIndicator/index.vue +8 -3
- package/dist/runtime/components/Edit/SystemRequirements/index.vue +3 -3
- package/dist/runtime/components/Edit/Toolbar/index.vue +3 -2
- package/dist/runtime/components/Edit/Transition/index.vue +41 -0
- package/dist/runtime/components/Edit/Transition/index.vue.d.ts +19 -0
- package/dist/runtime/components/Edit/index.d.ts +23 -15
- package/dist/runtime/components/Edit/index.js +44 -28
- package/dist/runtime/composables/defineBlokkli.js +7 -3
- package/dist/runtime/composables/defineBlokkliFeature.d.ts +4 -7
- package/dist/runtime/composables/defineBlokkliProvider.d.ts +11 -0
- package/dist/runtime/composables/defineBlokkliProvider.js +46 -0
- package/dist/runtime/composables/useBlokkliHelper.js +1 -1
- package/dist/runtime/constants/index.d.ts +3 -0
- package/dist/runtime/constants/index.js +3 -0
- package/dist/runtime/css/output.css +1 -1
- package/dist/runtime/helpers/addElementClasses.d.ts +2 -0
- package/dist/runtime/helpers/addElementClasses.js +24 -0
- package/dist/runtime/helpers/animationProvider.d.ts +4 -2
- package/dist/runtime/helpers/animationProvider.js +7 -2
- package/dist/runtime/helpers/bundles/index.d.ts +1 -0
- package/dist/runtime/helpers/bundles/index.js +4 -0
- package/dist/runtime/helpers/composables/useStickyToolbar.d.ts +20 -0
- package/dist/runtime/helpers/composables/useStickyToolbar.js +215 -0
- package/dist/runtime/helpers/definitionProvider.d.ts +2 -1
- package/dist/runtime/helpers/definitionProvider.js +17 -0
- package/dist/runtime/helpers/dom/index.d.ts +59 -0
- package/dist/runtime/helpers/dom/index.js +48 -0
- package/dist/runtime/helpers/domProvider.d.ts +2 -1
- package/dist/runtime/helpers/domProvider.js +89 -43
- package/dist/runtime/helpers/dropTargets/index.d.ts +6 -0
- package/dist/runtime/helpers/dropTargets/index.js +49 -0
- package/dist/runtime/helpers/eventBus.d.ts +1 -1
- package/dist/runtime/helpers/eventBus.js +2 -2
- package/dist/runtime/helpers/index.d.ts +10 -1
- package/dist/runtime/helpers/index.js +57 -0
- package/dist/runtime/helpers/indicatorsProvider.d.ts +10 -0
- package/dist/runtime/helpers/indicatorsProvider.js +23 -0
- package/dist/runtime/helpers/keyboardProvider.d.ts +2 -0
- package/dist/runtime/helpers/keyboardProvider.js +17 -1
- package/dist/runtime/helpers/pluginProvider.d.ts +10 -0
- package/dist/runtime/helpers/pluginProvider.js +33 -0
- package/dist/runtime/helpers/renderCycle.d.ts +1 -0
- package/dist/runtime/helpers/renderCycle.js +10 -0
- package/dist/runtime/helpers/runtimeHelpers/index.js +14 -11
- package/dist/runtime/helpers/selectionProvider.d.ts +16 -0
- package/dist/runtime/helpers/selectionProvider.js +47 -35
- package/dist/runtime/helpers/stateProvider.d.ts +6 -2
- package/dist/runtime/helpers/stateProvider.js +58 -14
- package/dist/runtime/helpers/storageProvider.d.ts +4 -3
- package/dist/runtime/helpers/storageProvider.js +56 -3
- package/dist/runtime/helpers/symbols.d.ts +1 -0
- package/dist/runtime/helpers/symbols.js +1 -0
- package/dist/runtime/helpers/textProvider.js +6 -0
- package/dist/runtime/helpers/themeProvider.d.ts +2 -0
- package/dist/runtime/helpers/themeProvider.js +4 -1
- package/dist/runtime/helpers/transform.js +1 -3
- package/dist/runtime/helpers/uiProvider.d.ts +7 -2
- package/dist/runtime/helpers/uiProvider.js +49 -47
- package/dist/runtime/helpers/useTransitionedValue.d.ts +18 -0
- package/dist/runtime/helpers/useTransitionedValue.js +57 -0
- package/dist/runtime/icons/anchor.svg +1 -0
- package/dist/runtime/icons/arrow-left.svg +1 -1
- package/dist/runtime/icons/arrow-right.svg +1 -1
- package/dist/runtime/icons/arrow-top-right.svg +1 -0
- package/dist/runtime/icons/chart.svg +1 -0
- package/dist/runtime/icons/copy.svg +1 -0
- package/dist/runtime/icons/cursor-move.svg +1 -1
- package/dist/runtime/icons/diff.svg +1 -1
- package/dist/runtime/icons/eye.svg +1 -1
- package/dist/runtime/icons/info.svg +1 -1
- package/dist/runtime/icons/link.svg +1 -0
- package/dist/runtime/icons/speedometer.svg +1 -0
- package/dist/runtime/types/blokkOptions.d.ts +8 -0
- package/dist/runtime/types/index.d.ts +163 -5
- package/dist/runtime/types/theme.d.ts +2 -1
- package/dist/shared/{editor.gz_ac6uT.d.mts → editor.CKsrTpc1.d.mts} +1 -1
- package/package.json +55 -38
- package/dist/runtime/components/Edit/Features/FieldAreas/Overlay/index.vue +0 -22
- package/dist/runtime/components/Edit/Features/FieldAreas/index.vue +0 -41
- /package/dist/runtime/components/Edit/Features/{FieldAreas/Overlay → Analyze}/index.vue.d.ts +0 -0
- /package/dist/runtime/components/Edit/Features/{FieldAreas/index.vue.d.ts → Anchors/Renderer.vue.d.ts} +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
fragment paragraphsBlokkliConfigInput on ParagraphsBlokkliConfigInput {
|
|
2
|
+
__typename
|
|
3
|
+
name
|
|
4
|
+
label
|
|
5
|
+
description
|
|
6
|
+
required
|
|
7
|
+
|
|
8
|
+
... on ParagraphsBlokkliConfigInputText {
|
|
9
|
+
defaultValueText: defaultValue
|
|
10
|
+
minLength
|
|
11
|
+
maxLength
|
|
12
|
+
placeholder
|
|
13
|
+
pattern
|
|
14
|
+
multiline
|
|
15
|
+
rows
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
... on ParagraphsBlokkliConfigInputCheckbox {
|
|
19
|
+
checkboxLabel
|
|
20
|
+
defaultValueCheckbox: defaultValue
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
... on ParagraphsBlokkliConfigInputOptions {
|
|
24
|
+
defaultValueOptions: defaultValue
|
|
25
|
+
variant
|
|
26
|
+
options {
|
|
27
|
+
value
|
|
28
|
+
label
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -10,10 +10,15 @@ query pbGetTransformPlugins(
|
|
|
10
10
|
) {
|
|
11
11
|
id
|
|
12
12
|
label
|
|
13
|
+
description
|
|
13
14
|
bundles
|
|
14
15
|
targetBundles
|
|
15
16
|
min
|
|
16
17
|
max
|
|
18
|
+
allowPreview
|
|
19
|
+
configInputs {
|
|
20
|
+
...paragraphsBlokkliConfigInput
|
|
21
|
+
}
|
|
17
22
|
}
|
|
18
23
|
}
|
|
19
24
|
|
|
@@ -23,12 +28,15 @@ mutation pbApplyTransformPlugin(
|
|
|
23
28
|
$langcode: String
|
|
24
29
|
$pluginId: String!
|
|
25
30
|
$uuids: [String]!
|
|
31
|
+
$config: [ParagraphsBlokkliUserConfigInput]
|
|
32
|
+
$preview: Boolean
|
|
26
33
|
) {
|
|
27
34
|
state: paragraphsEditMutationState(
|
|
28
35
|
entityType: $entityType
|
|
29
36
|
entityUuid: $entityUuid
|
|
37
|
+
preview: $preview
|
|
30
38
|
) {
|
|
31
|
-
action: transform(pluginId: $pluginId, uuids: $uuids) {
|
|
39
|
+
action: transform(pluginId: $pluginId, uuids: $uuids, userConfig: $config) {
|
|
32
40
|
...paragraphsBlokkliMutationResult
|
|
33
41
|
}
|
|
34
42
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
query pbGetHostTransformPlugins(
|
|
2
|
+
$entityType: EntityType!
|
|
3
|
+
$entityUuid: String!
|
|
4
|
+
$langcode: String!
|
|
5
|
+
) {
|
|
6
|
+
paragraphsBlokkliGetHostTransformPlugins(
|
|
7
|
+
entityType: $entityType
|
|
8
|
+
entityUuid: $entityUuid
|
|
9
|
+
langcode: $langcode
|
|
10
|
+
) {
|
|
11
|
+
id
|
|
12
|
+
label
|
|
13
|
+
description
|
|
14
|
+
allowPreview
|
|
15
|
+
configInputs {
|
|
16
|
+
...paragraphsBlokkliConfigInput
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
mutation pbApplyHostTransformPlugin(
|
|
22
|
+
$entityType: EntityType!
|
|
23
|
+
$entityUuid: String!
|
|
24
|
+
$langcode: String
|
|
25
|
+
$pluginId: String!
|
|
26
|
+
$config: [ParagraphsBlokkliUserConfigInput]
|
|
27
|
+
$preview: Boolean
|
|
28
|
+
) {
|
|
29
|
+
state: paragraphsEditMutationState(
|
|
30
|
+
entityType: $entityType
|
|
31
|
+
entityUuid: $entityUuid
|
|
32
|
+
preview: $preview
|
|
33
|
+
) {
|
|
34
|
+
action: host_transform(pluginId: $pluginId, userConfig: $config) {
|
|
35
|
+
...paragraphsBlokkliMutationResult
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
mutation pbUpdateHostOptions(
|
|
2
|
+
$entityType: EntityType!
|
|
3
|
+
$entityUuid: String!
|
|
4
|
+
$langcode: String
|
|
5
|
+
$items: [ParagraphsBlokkliUpdateHostOptionsInput]!
|
|
6
|
+
) {
|
|
7
|
+
state: paragraphsEditMutationState(
|
|
8
|
+
entityType: $entityType
|
|
9
|
+
entityUuid: $entityUuid
|
|
10
|
+
) {
|
|
11
|
+
action: update_host_options(items: $items) {
|
|
12
|
+
...paragraphsBlokkliMutationResult
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -21,20 +21,26 @@ function toPascalCase(text) {
|
|
|
21
21
|
function clearAndUpper(text) {
|
|
22
22
|
return text.replace(/_/, "").toUpperCase();
|
|
23
23
|
}
|
|
24
|
+
function getDrupalAdapterPath() {
|
|
25
|
+
const resolver = createResolver(fileURLToPath(new URL("./", import.meta.url)));
|
|
26
|
+
return resolver.resolve("./runtime/adapter/index.js");
|
|
27
|
+
}
|
|
24
28
|
const index = defineBlokkliModule({
|
|
25
29
|
alterOptions(options) {
|
|
26
30
|
if (!options.itemEntityType) {
|
|
27
31
|
options.itemEntityType = "paragraph";
|
|
28
32
|
}
|
|
29
33
|
if (!options.pattern) {
|
|
30
|
-
options.pattern = [
|
|
34
|
+
options.pattern = [
|
|
35
|
+
"~/components/Paragraph/**/*.vue",
|
|
36
|
+
"~/components/Node/**/*.vue",
|
|
37
|
+
"~/components/TaxonomyTerm/**/*.vue",
|
|
38
|
+
"~/components/CommerceProduct/**/*.vue",
|
|
39
|
+
"~/components/Storage/**/*.vue"
|
|
40
|
+
];
|
|
31
41
|
}
|
|
32
42
|
if (!options.editAdapterPath) {
|
|
33
|
-
|
|
34
|
-
fileURLToPath(new URL("./", import.meta.url))
|
|
35
|
-
);
|
|
36
|
-
const filePath = resolver.resolve("./runtime/adapter/index.js");
|
|
37
|
-
options.editAdapterPath = filePath;
|
|
43
|
+
options.editAdapterPath = getDrupalAdapterPath();
|
|
38
44
|
}
|
|
39
45
|
if (!options.getBundlePropsType) {
|
|
40
46
|
options.getBundlePropsType = function(bundle) {
|
|
@@ -45,7 +51,8 @@ const index = defineBlokkliModule({
|
|
|
45
51
|
};
|
|
46
52
|
}
|
|
47
53
|
},
|
|
48
|
-
setup({ context }) {
|
|
54
|
+
setup({ context, helper }) {
|
|
55
|
+
helper.addAlias("#blokkli/drupal-adapter", getDrupalAdapterPath());
|
|
49
56
|
if (!useGraphqlModuleContext({ nullOnMissing: true })) {
|
|
50
57
|
logger.box(
|
|
51
58
|
'Failed to load nuxt-graphql-middleware module context. Make sure that "nuxt-graphql-middleware" is placed before "@blokkli/editor" in your "modules" config in nuxt.config.ts.'
|
|
@@ -89,9 +96,11 @@ const index = defineBlokkliModule({
|
|
|
89
96
|
"fragment.paragraphsBlokkliMutationItem.graphql",
|
|
90
97
|
"fragment.paragraphsBlokkliMutationResult.graphql",
|
|
91
98
|
"fragment.paragraphsBlokkliViolation.graphql",
|
|
99
|
+
"fragment.ParagraphsBlokkliConfigInput.graphql",
|
|
92
100
|
"fragment.blokkliProps.graphql",
|
|
93
101
|
"fragment.paragraphsFieldItem.graphql",
|
|
94
102
|
"query.pbConfig.graphql",
|
|
103
|
+
"query.pbEntityConfig.graphql",
|
|
95
104
|
"query.pbEditState.graphql"
|
|
96
105
|
];
|
|
97
106
|
base.forEach((fileName) => {
|
|
@@ -121,6 +130,7 @@ const index = defineBlokkliModule({
|
|
|
121
130
|
addMutation("update_behavior_setting");
|
|
122
131
|
addMutation("update_field_value");
|
|
123
132
|
addMutation("update_host_entity_field_value");
|
|
133
|
+
addMutation("update_host_options");
|
|
124
134
|
if (graphql.schemaHasType("CommentBlokkliNode")) {
|
|
125
135
|
addGraphqlDocument("features/comments.graphql");
|
|
126
136
|
} else {
|
|
@@ -136,6 +146,9 @@ const index = defineBlokkliModule({
|
|
|
136
146
|
} else {
|
|
137
147
|
context.features.disableFeature("transform");
|
|
138
148
|
}
|
|
149
|
+
if (graphql.schemaHasType("ParagraphsBlokkliHostTransformPlugin")) {
|
|
150
|
+
addGraphqlDocument("features/transform_host.graphql");
|
|
151
|
+
}
|
|
139
152
|
if (graphql.schemaHasType("ParagraphFromLibrary")) {
|
|
140
153
|
addGraphqlDocument("features/library.graphql");
|
|
141
154
|
} else {
|
|
@@ -10,8 +10,61 @@ import {
|
|
|
10
10
|
useRouter
|
|
11
11
|
} from "#imports";
|
|
12
12
|
import { ParagraphsBlokkliRemoteVideoProvider } from "#graphql-operations";
|
|
13
|
+
function mapPluginConfigInputs(inputs) {
|
|
14
|
+
return inputs.map((input) => {
|
|
15
|
+
if (input.__typename === "ParagraphsBlokkliConfigInputText") {
|
|
16
|
+
return {
|
|
17
|
+
type: "text",
|
|
18
|
+
name: input.name,
|
|
19
|
+
label: input.label,
|
|
20
|
+
description: input.description,
|
|
21
|
+
required: input.required,
|
|
22
|
+
defaultValue: input.defaultValueText,
|
|
23
|
+
minLength: input.minLength,
|
|
24
|
+
maxLength: input.maxLength,
|
|
25
|
+
placeholder: input.placeholder,
|
|
26
|
+
pattern: input.pattern,
|
|
27
|
+
multiline: input.multiline,
|
|
28
|
+
rows: input.rows
|
|
29
|
+
};
|
|
30
|
+
} else if (input.__typename === "ParagraphsBlokkliConfigInputCheckbox") {
|
|
31
|
+
return {
|
|
32
|
+
type: "checkbox",
|
|
33
|
+
name: input.name,
|
|
34
|
+
label: input.label,
|
|
35
|
+
description: input.description,
|
|
36
|
+
required: input.required,
|
|
37
|
+
defaultValue: input.defaultValueCheckbox ?? false,
|
|
38
|
+
checkboxLabel: input.checkboxLabel
|
|
39
|
+
};
|
|
40
|
+
} else if (input.__typename === "ParagraphsBlokkliConfigInputOptions") {
|
|
41
|
+
return {
|
|
42
|
+
type: "options",
|
|
43
|
+
name: input.name,
|
|
44
|
+
label: input.label,
|
|
45
|
+
description: input.description,
|
|
46
|
+
required: input.required,
|
|
47
|
+
defaultValue: input.defaultValueOptions ?? "",
|
|
48
|
+
variant: input.variant,
|
|
49
|
+
options: input.options
|
|
50
|
+
};
|
|
51
|
+
} else if (input.__typename === "ParagraphsBlokkliConfigInputSeed") {
|
|
52
|
+
return {
|
|
53
|
+
type: "seed",
|
|
54
|
+
name: input.name,
|
|
55
|
+
label: input.label,
|
|
56
|
+
description: input.description,
|
|
57
|
+
required: input.required
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}).filter(falsy);
|
|
62
|
+
}
|
|
13
63
|
export default defineBlokkliEditAdapter(
|
|
14
64
|
async (providedContext) => {
|
|
65
|
+
if (import.meta.dev) {
|
|
66
|
+
console.log("initialise Drupal bl\xF6kkli adapter");
|
|
67
|
+
}
|
|
15
68
|
const availableFeatureIds = new Set(availableFeaturesAtBuild);
|
|
16
69
|
const availableGraphqlOperations = new Set(Object.keys(operationSources));
|
|
17
70
|
function hasQuery(name) {
|
|
@@ -52,6 +105,14 @@ export default defineBlokkliEditAdapter(
|
|
|
52
105
|
)
|
|
53
106
|
};
|
|
54
107
|
});
|
|
108
|
+
const entityConfig = await useGraphqlQuery("pbEntityConfig", {
|
|
109
|
+
entityType: providedContext.value.entityType,
|
|
110
|
+
entityUuid: providedContext.value.entityUuid
|
|
111
|
+
}).then((v) => {
|
|
112
|
+
return {
|
|
113
|
+
linkPath: v.data.config?.linkPath ?? ""
|
|
114
|
+
};
|
|
115
|
+
});
|
|
55
116
|
const loadState = async () => {
|
|
56
117
|
const state = await useGraphqlQuery("pbEditState", {
|
|
57
118
|
...ctx.value
|
|
@@ -101,6 +162,7 @@ export default defineBlokkliEditAdapter(
|
|
|
101
162
|
return null;
|
|
102
163
|
}).filter(falsy)
|
|
103
164
|
};
|
|
165
|
+
const mutatedHostOptions = state.mutatedState?.hostOptions || {};
|
|
104
166
|
return {
|
|
105
167
|
currentIndex,
|
|
106
168
|
mutations,
|
|
@@ -109,7 +171,9 @@ export default defineBlokkliEditAdapter(
|
|
|
109
171
|
mutatedState: {
|
|
110
172
|
fields,
|
|
111
173
|
violations,
|
|
112
|
-
mutatedOptions
|
|
174
|
+
mutatedOptions,
|
|
175
|
+
// PHP and its arrays...
|
|
176
|
+
mutatedHostOptions: Array.isArray(mutatedHostOptions) ? {} : mutatedHostOptions
|
|
113
177
|
},
|
|
114
178
|
entity,
|
|
115
179
|
mutatedEntity: state.mutatedEntity,
|
|
@@ -233,6 +297,9 @@ export default defineBlokkliEditAdapter(
|
|
|
233
297
|
const getLastChanged = () => $fetch(
|
|
234
298
|
`/paragraphs_blokkli/${ctx.value.entityType}/${ctx.value.entityUuid}/last_changed`
|
|
235
299
|
).then((v) => v.changed);
|
|
300
|
+
const buildAnchorLink = (id, _uuid) => {
|
|
301
|
+
return `${entityConfig.linkPath}#${id}`;
|
|
302
|
+
};
|
|
236
303
|
const adapter = {
|
|
237
304
|
addNewBlock,
|
|
238
305
|
buildEditableFrameUrl,
|
|
@@ -248,7 +315,8 @@ export default defineBlokkliEditAdapter(
|
|
|
248
315
|
loadStateAtIndex,
|
|
249
316
|
mapState,
|
|
250
317
|
moveBlock,
|
|
251
|
-
moveMultipleBlocks
|
|
318
|
+
moveMultipleBlocks,
|
|
319
|
+
buildAnchorLink
|
|
252
320
|
};
|
|
253
321
|
if (hasQuery("pbPublishOptions")) {
|
|
254
322
|
adapter.getPublishOptions = () => useGraphqlQuery("pbPublishOptions", ctx.value).then((v) => {
|
|
@@ -286,6 +354,12 @@ export default defineBlokkliEditAdapter(
|
|
|
286
354
|
if (hasMutation("pbTakeOwnership")) {
|
|
287
355
|
adapter.takeOwnership = () => useGraphqlMutation("pbTakeOwnership", ctx.value).then(mapMutation);
|
|
288
356
|
}
|
|
357
|
+
if (hasMutation("pbUpdateHostOptions")) {
|
|
358
|
+
adapter.updateHostOptions = (items) => useGraphqlMutation("pbUpdateHostOptions", {
|
|
359
|
+
...ctx.value,
|
|
360
|
+
items
|
|
361
|
+
}).then(mapMutation);
|
|
362
|
+
}
|
|
289
363
|
if (hasMutation("pbSetHistoryIndex")) {
|
|
290
364
|
adapter.setHistoryIndex = (index) => useGraphqlMutation("pbSetHistoryIndex", {
|
|
291
365
|
...ctx.value,
|
|
@@ -304,7 +378,6 @@ export default defineBlokkliEditAdapter(
|
|
|
304
378
|
entityType: options.hostEntityType.toUpperCase(),
|
|
305
379
|
entityUuid: options.hostEntityUuid,
|
|
306
380
|
createNewState: !options.closeAfterPublish,
|
|
307
|
-
// @ts-expect-error Might not exist.
|
|
308
381
|
publishIfUnpublished: options.publishIfUnpublished,
|
|
309
382
|
revisionLogMessage: options.revisionLogMessage
|
|
310
383
|
}).then(mapMutation);
|
|
@@ -487,10 +560,26 @@ export default defineBlokkliEditAdapter(
|
|
|
487
560
|
return {
|
|
488
561
|
id: plugin.id,
|
|
489
562
|
label: plugin.label,
|
|
563
|
+
description: plugin.description,
|
|
490
564
|
bundles: plugin.bundles,
|
|
491
565
|
targetBundles: plugin.targetBundles,
|
|
492
566
|
min: plugin.min,
|
|
493
|
-
max: plugin.max
|
|
567
|
+
max: plugin.max,
|
|
568
|
+
configInputs: mapPluginConfigInputs(plugin.configInputs),
|
|
569
|
+
preview: plugin.allowPreview
|
|
570
|
+
};
|
|
571
|
+
})
|
|
572
|
+
);
|
|
573
|
+
}
|
|
574
|
+
if (hasQuery("pbGetHostTransformPlugins")) {
|
|
575
|
+
adapter.getHostTransformPlugins = () => useGraphqlQuery("pbGetHostTransformPlugins", ctx.value).then((v) => v.data.paragraphsBlokkliGetHostTransformPlugins || []).then(
|
|
576
|
+
(plugins) => plugins.map((plugin) => {
|
|
577
|
+
return {
|
|
578
|
+
id: plugin.id,
|
|
579
|
+
label: plugin.label,
|
|
580
|
+
description: plugin.description,
|
|
581
|
+
configInputs: mapPluginConfigInputs(plugin.configInputs),
|
|
582
|
+
preview: plugin.allowPreview
|
|
494
583
|
};
|
|
495
584
|
})
|
|
496
585
|
);
|
|
@@ -500,6 +589,22 @@ export default defineBlokkliEditAdapter(
|
|
|
500
589
|
...ctx.value,
|
|
501
590
|
...e
|
|
502
591
|
}).then(mapMutation);
|
|
592
|
+
adapter.previewTransformPlugin = (e) => useGraphqlMutation("pbApplyTransformPlugin", {
|
|
593
|
+
...ctx.value,
|
|
594
|
+
...e,
|
|
595
|
+
preview: true
|
|
596
|
+
}).then(mapMutation);
|
|
597
|
+
}
|
|
598
|
+
if (hasMutation("pbApplyHostTransformPlugin")) {
|
|
599
|
+
adapter.applyHostTransformPlugin = (e) => useGraphqlMutation("pbApplyHostTransformPlugin", {
|
|
600
|
+
...ctx.value,
|
|
601
|
+
...e
|
|
602
|
+
}).then(mapMutation);
|
|
603
|
+
adapter.previewHostTransformPlugin = (e) => useGraphqlMutation("pbApplyHostTransformPlugin", {
|
|
604
|
+
...ctx.value,
|
|
605
|
+
...e,
|
|
606
|
+
preview: true
|
|
607
|
+
}).then(mapMutation);
|
|
503
608
|
}
|
|
504
609
|
const buildFormUrl = (parts, langcode) => {
|
|
505
610
|
const prefix = config.urlPrefixes[langcode];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ComputedRef } from 'vue';
|
|
2
|
-
import type { CommentItem, ConversionItem, MappedState, ImportItem, LibraryItem, BlockBundleDefinition, EntityTranslation, SearchContentItem, AddClipboardItemEvent, AddNewBlockEvent, AddReusableItemEvent, ImportFromExistingEvent, MakeReusableEvent, MoveMultipleBlocksEvent, MoveBlockEvent, UpdateBlockOptionEvent, AddContentSearchItemEvent, TransformPlugin, EditBlockEvent, PasteExistingBlocksEvent, UpdateFieldValueEvent, AssistantResult, DraggableHostData, DetachReusableBlockEvent, FieldConfig, EditableFieldConfig, DraggableMediaLibraryItem, DroppableFieldConfig, PublishOptions, GetEditStatesItem } from './../types/index.js';
|
|
2
|
+
import type { CommentItem, ConversionItem, MappedState, ImportItem, LibraryItem, BlockBundleDefinition, EntityTranslation, SearchContentItem, AddClipboardItemEvent, AddNewBlockEvent, AddReusableItemEvent, ImportFromExistingEvent, MakeReusableEvent, MoveMultipleBlocksEvent, MoveBlockEvent, UpdateBlockOptionEvent, AddContentSearchItemEvent, TransformPlugin, EditBlockEvent, PasteExistingBlocksEvent, UpdateFieldValueEvent, AssistantResult, DraggableHostData, DetachReusableBlockEvent, FieldConfig, EditableFieldConfig, DraggableMediaLibraryItem, DroppableFieldConfig, PublishOptions, GetEditStatesItem, UpdateHostOptionEvent, HostTransformPlugin, PluginConfigInputItem } from './../types/index.js';
|
|
3
3
|
import type getVideoId from 'get-video-id';
|
|
4
4
|
import type { GetMediaLibraryFunction } from './../components/Edit/Features/MediaLibrary/types.js';
|
|
5
|
+
import type { Analyzer } from '#blokkli/analyzer/types';
|
|
5
6
|
export type { GetMediaLibraryFunction };
|
|
6
7
|
export interface MutationResponseLike<T> {
|
|
7
8
|
success: boolean;
|
|
@@ -11,6 +12,11 @@ export interface MutationResponseLike<T> {
|
|
|
11
12
|
type AdapterApplyTransformPlugin = {
|
|
12
13
|
pluginId: string;
|
|
13
14
|
uuids: string[];
|
|
15
|
+
config?: PluginConfigInputItem[];
|
|
16
|
+
};
|
|
17
|
+
type AdapterApplyHostTransformPlugin = {
|
|
18
|
+
pluginId: string;
|
|
19
|
+
config?: PluginConfigInputItem[];
|
|
14
20
|
};
|
|
15
21
|
export type UpdateEntityFieldValueEvent = {
|
|
16
22
|
fieldName: string;
|
|
@@ -203,10 +209,38 @@ export interface BlokkliAdapter<T> {
|
|
|
203
209
|
* Get all possible transform plugins.
|
|
204
210
|
*/
|
|
205
211
|
getTransformPlugins?: () => Promise<TransformPlugin[]>;
|
|
212
|
+
/**
|
|
213
|
+
* Get all possible host transform plugins.
|
|
214
|
+
*/
|
|
215
|
+
getHostTransformPlugins?: () => Promise<HostTransformPlugin[]>;
|
|
206
216
|
/**
|
|
207
217
|
* Apply a transform plugin.
|
|
208
218
|
*/
|
|
209
219
|
applyTransformPlugin?: (e: AdapterApplyTransformPlugin) => Promise<MutationResponseLike<T>>;
|
|
220
|
+
/**
|
|
221
|
+
* Preview the output of a transform plugin.
|
|
222
|
+
*
|
|
223
|
+
* The transform plugin is expected to apply its transform without actually
|
|
224
|
+
* persisting it and not creating any side effects.
|
|
225
|
+
*
|
|
226
|
+
* It must produce the same result when called for the "final"
|
|
227
|
+
* transformation that is added to the edit state.
|
|
228
|
+
*/
|
|
229
|
+
previewTransformPlugin?: (e: AdapterApplyTransformPlugin) => Promise<MutationResponseLike<T>>;
|
|
230
|
+
/**
|
|
231
|
+
* Apply a host transform plugin.
|
|
232
|
+
*/
|
|
233
|
+
applyHostTransformPlugin?: (e: AdapterApplyHostTransformPlugin) => Promise<MutationResponseLike<T>>;
|
|
234
|
+
/**
|
|
235
|
+
* Preview the output of a host transform plugin.
|
|
236
|
+
*
|
|
237
|
+
* The transform plugin is expected to apply its transform without actually
|
|
238
|
+
* persisting it and not creating any side effects.
|
|
239
|
+
*
|
|
240
|
+
* It must produce the same result when called for the "final"
|
|
241
|
+
* transformation that is added to the edit state.
|
|
242
|
+
*/
|
|
243
|
+
previewHostTransformPlugin?: (e: AdapterApplyHostTransformPlugin) => Promise<MutationResponseLike<T>>;
|
|
210
244
|
/**
|
|
211
245
|
* Add a new block.
|
|
212
246
|
*/
|
|
@@ -215,6 +249,10 @@ export interface BlokkliAdapter<T> {
|
|
|
215
249
|
* Update multiple options.
|
|
216
250
|
*/
|
|
217
251
|
updateOptions?: (options: UpdateBlockOptionEvent[]) => Promise<MutationResponseLike<T>>;
|
|
252
|
+
/**
|
|
253
|
+
* Update multiple host options.
|
|
254
|
+
*/
|
|
255
|
+
updateHostOptions?: (options: UpdateHostOptionEvent[]) => Promise<MutationResponseLike<T>>;
|
|
218
256
|
/**
|
|
219
257
|
* Determine the block bundle for the given clipboard item.
|
|
220
258
|
*/
|
|
@@ -400,6 +438,21 @@ export interface BlokkliAdapter<T> {
|
|
|
400
438
|
* Add a fragment block.
|
|
401
439
|
*/
|
|
402
440
|
fragmentsAddBlock?: (e: AdapterFragmentsAddBlock) => Promise<MutationResponseLike<T>> | undefined;
|
|
441
|
+
/**
|
|
442
|
+
* Build the link that is copied to the clipboard when clicking on an "anchor link" indicator.
|
|
443
|
+
*/
|
|
444
|
+
buildAnchorLink?: (id: string, uuid: string) => string;
|
|
445
|
+
getAnalyzers?: () => Analyzer | Analyzer[] | Promise<Analyzer> | Promise<Analyzer[]>;
|
|
446
|
+
userSettings?: {
|
|
447
|
+
/**
|
|
448
|
+
* Load user settings.
|
|
449
|
+
*/
|
|
450
|
+
load: () => Promise<string | Record<string, any>>;
|
|
451
|
+
/**
|
|
452
|
+
* Persist user settings.
|
|
453
|
+
*/
|
|
454
|
+
persist: (settings: string) => Promise<undefined>;
|
|
455
|
+
};
|
|
403
456
|
}
|
|
404
457
|
export type BlokkliAdapterFactory<T> = (ctx: ComputedRef<AdapterContext>) => Promise<BlokkliAdapter<T>> | BlokkliAdapter<T>;
|
|
405
458
|
export type AdapterMethods = keyof BlokkliAdapter<any>;
|
|
@@ -17,7 +17,14 @@
|
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
19
|
<script setup>
|
|
20
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
computed,
|
|
22
|
+
useBlokkli,
|
|
23
|
+
nextTick,
|
|
24
|
+
ref,
|
|
25
|
+
onMounted,
|
|
26
|
+
onBeforeUnmount
|
|
27
|
+
} from "#imports";
|
|
21
28
|
import { AddListItem } from "#blokkli/components";
|
|
22
29
|
import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
|
|
23
30
|
import defineTourItem from "#blokkli/helpers/composables/defineTourItem";
|
|
@@ -33,7 +40,7 @@ const props = defineProps({
|
|
|
33
40
|
});
|
|
34
41
|
const item = ref(null);
|
|
35
42
|
const emit = defineEmits(["placed"]);
|
|
36
|
-
const { ui, state, features } = useBlokkli();
|
|
43
|
+
const { ui, state, features, plugins } = useBlokkli();
|
|
37
44
|
const addListAvailable = computed(
|
|
38
45
|
() => !!features.mountedFeatures.value.find((v) => v.id === "add-list")
|
|
39
46
|
);
|
|
@@ -47,7 +54,7 @@ onBlokkliEvent("add-list:change", () => {
|
|
|
47
54
|
});
|
|
48
55
|
});
|
|
49
56
|
onBlokkliEvent("action:placed", (e) => {
|
|
50
|
-
if (e.
|
|
57
|
+
if (e.id !== props.type) {
|
|
51
58
|
return;
|
|
52
59
|
}
|
|
53
60
|
emit("placed", e);
|
|
@@ -63,6 +70,23 @@ defineTourItem(() => {
|
|
|
63
70
|
element: () => item.value?.getElement()
|
|
64
71
|
};
|
|
65
72
|
});
|
|
73
|
+
function addActionFunction() {
|
|
74
|
+
return {
|
|
75
|
+
id: props.type,
|
|
76
|
+
icon: props.icon,
|
|
77
|
+
color: props.color,
|
|
78
|
+
itemBundle: props.itemBundle,
|
|
79
|
+
title: props.title,
|
|
80
|
+
description: props.description,
|
|
81
|
+
enabled: !props.disabled
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
onMounted(() => {
|
|
85
|
+
plugins.addAddAction(addActionFunction);
|
|
86
|
+
});
|
|
87
|
+
onBeforeUnmount(() => {
|
|
88
|
+
plugins.removeAddAction(addActionFunction);
|
|
89
|
+
});
|
|
66
90
|
</script>
|
|
67
91
|
|
|
68
92
|
<script>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Teleport to="#bk-indicators-left">
|
|
3
|
+
<div
|
|
4
|
+
ref="el"
|
|
5
|
+
class="bk-indicator-item"
|
|
6
|
+
@click.prevent="$emit('click')"
|
|
7
|
+
@mouseenter="onMouseEnter"
|
|
8
|
+
@mouseleave="onMouseLeave"
|
|
9
|
+
>
|
|
10
|
+
<slot>
|
|
11
|
+
<div class="bk-indicator-item-inner">
|
|
12
|
+
<div v-if="label">{{ label }}</div>
|
|
13
|
+
<div v-if="icon">
|
|
14
|
+
<Icon :name="icon" />
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</slot>
|
|
18
|
+
</div>
|
|
19
|
+
</Teleport>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script setup>
|
|
23
|
+
import {
|
|
24
|
+
useBlokkli,
|
|
25
|
+
onMounted,
|
|
26
|
+
useTemplateRef,
|
|
27
|
+
onBeforeUnmount
|
|
28
|
+
} from "#imports";
|
|
29
|
+
import { Icon } from "#blokkli/components";
|
|
30
|
+
const props = defineProps({
|
|
31
|
+
id: { type: String, required: true },
|
|
32
|
+
uuid: { type: String, required: true },
|
|
33
|
+
label: { type: String, required: false },
|
|
34
|
+
position: { type: String, required: false },
|
|
35
|
+
icon: { type: null, required: false }
|
|
36
|
+
});
|
|
37
|
+
defineEmits(["click"]);
|
|
38
|
+
const { indicators } = useBlokkli();
|
|
39
|
+
const el = useTemplateRef("el");
|
|
40
|
+
function onMouseEnter() {
|
|
41
|
+
indicators.setHovered(props.uuid);
|
|
42
|
+
}
|
|
43
|
+
function onMouseLeave() {
|
|
44
|
+
indicators.setHovered();
|
|
45
|
+
}
|
|
46
|
+
onMounted(() => {
|
|
47
|
+
if (el.value) {
|
|
48
|
+
indicators.addIndicator({
|
|
49
|
+
id: props.id,
|
|
50
|
+
uuid: props.uuid,
|
|
51
|
+
position: props.position ?? "left",
|
|
52
|
+
element: el.value
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
onBeforeUnmount(() => {
|
|
57
|
+
indicators.removeIndicator(props.id, props.uuid);
|
|
58
|
+
});
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<script>
|
|
62
|
+
export default {
|
|
63
|
+
name: "PluginBlockIndicator"
|
|
64
|
+
};
|
|
65
|
+
</script>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { BlokkliIcon } from '#blokkli-build/icons';
|
|
2
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
3
|
+
id: string;
|
|
4
|
+
uuid: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
position?: "left" | "right";
|
|
7
|
+
icon?: BlokkliIcon;
|
|
8
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
9
|
+
click: () => any;
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<{
|
|
11
|
+
id: string;
|
|
12
|
+
uuid: string;
|
|
13
|
+
label?: string;
|
|
14
|
+
position?: "left" | "right";
|
|
15
|
+
icon?: BlokkliIcon;
|
|
16
|
+
}> & Readonly<{
|
|
17
|
+
onClick?: (() => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
19
|
+
default?: (props: {}) => any;
|
|
20
|
+
}>;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<Component :is="tag" @contextmenu.stop.prevent="onContextMenu">
|
|
3
3
|
<slot />
|
|
4
4
|
<Teleport to="body">
|
|
5
|
-
<
|
|
5
|
+
<BlokkliTransition name="context-menu">
|
|
6
6
|
<ContextMenuMenu
|
|
7
7
|
v-if="isVisible"
|
|
8
8
|
:menu="menu"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
:y="y"
|
|
11
11
|
@close="ui.openContextMenu.value = ''"
|
|
12
12
|
/>
|
|
13
|
-
</
|
|
13
|
+
</BlokkliTransition>
|
|
14
14
|
</Teleport>
|
|
15
15
|
</Component>
|
|
16
16
|
</template>
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
<script setup>
|
|
19
19
|
import { ref, computed, useBlokkli } from "#imports";
|
|
20
20
|
import ContextMenuMenu from "./Menu/index.vue";
|
|
21
|
+
import { BlokkliTransition } from "#blokkli/components";
|
|
21
22
|
const props = defineProps({
|
|
22
23
|
id: { type: String, required: true },
|
|
23
24
|
menu: { type: Array, required: true },
|