@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
|
@@ -1,34 +1,53 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<PluginItemDropdown
|
|
3
3
|
id="transform"
|
|
4
|
-
:title="$t('transformTo', '
|
|
4
|
+
:title="$t('transformTo', 'Actions')"
|
|
5
5
|
:enabled="!!(itemBundleIds.length && possibleTransforms.length)"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
:items="possibleTransforms"
|
|
7
|
+
icon="script"
|
|
8
|
+
weight="100"
|
|
9
|
+
@select="onSelectBlockTransformPlugin($event, selection.uuids.value)"
|
|
10
|
+
/>
|
|
11
|
+
|
|
12
|
+
<PluginItemDropdown
|
|
13
|
+
v-if="hostPlugins.length"
|
|
14
|
+
id="transform-host"
|
|
15
|
+
:title="$t('transformTo', 'Actions')"
|
|
16
|
+
:enabled="selection.hasHostSelected.value"
|
|
17
|
+
:items="hostPlugins"
|
|
18
|
+
icon="script"
|
|
19
|
+
weight="100"
|
|
20
|
+
@select="onSelectHostTransformPlugin($event)"
|
|
21
|
+
/>
|
|
22
|
+
|
|
23
|
+
<Teleport to="body">
|
|
24
|
+
<BlokkliTransition name="transform-overlay">
|
|
25
|
+
<TransformDialog
|
|
26
|
+
v-if="openPluginDefinition"
|
|
27
|
+
:plugin="openPluginDefinition"
|
|
28
|
+
:uuids="selectedUuids"
|
|
29
|
+
@cancel="cancelTransform"
|
|
30
|
+
@submit="onSubmitDialog"
|
|
31
|
+
/>
|
|
32
|
+
</BlokkliTransition>
|
|
33
|
+
</Teleport>
|
|
17
34
|
</template>
|
|
18
35
|
|
|
19
36
|
<script setup>
|
|
20
37
|
import {
|
|
21
38
|
computed,
|
|
22
39
|
watch,
|
|
40
|
+
ref,
|
|
23
41
|
useBlokkli,
|
|
24
42
|
defineBlokkliFeature,
|
|
25
43
|
useLazyAsyncData
|
|
26
44
|
} from "#imports";
|
|
27
45
|
import { PluginItemDropdown } from "#blokkli/plugins";
|
|
28
46
|
import { onlyUnique } from "#blokkli/helpers";
|
|
47
|
+
import { BlokkliTransition } from "#blokkli/components";
|
|
29
48
|
import { filterTransforms } from "#blokkli/helpers/transform";
|
|
30
49
|
import defineCommands from "#blokkli/helpers/composables/defineCommands";
|
|
31
|
-
import
|
|
50
|
+
import TransformDialog from "./Dialog/index.vue";
|
|
32
51
|
const { adapter } = defineBlokkliFeature({
|
|
33
52
|
id: "transform",
|
|
34
53
|
icon: "script",
|
|
@@ -37,7 +56,9 @@ const { adapter } = defineBlokkliFeature({
|
|
|
37
56
|
description: "Provides integration for block transform plugins.",
|
|
38
57
|
screenshot: "feature-transform.jpg"
|
|
39
58
|
});
|
|
40
|
-
const { types, selection, state, $t,
|
|
59
|
+
const { types, selection, state, $t, ui } = useBlokkli();
|
|
60
|
+
const openPlugin = ref(null);
|
|
61
|
+
const selectedUuids = ref([]);
|
|
41
62
|
const {
|
|
42
63
|
data: plugins,
|
|
43
64
|
execute,
|
|
@@ -46,19 +67,131 @@ const {
|
|
|
46
67
|
() => {
|
|
47
68
|
return adapter.getTransformPlugins();
|
|
48
69
|
},
|
|
49
|
-
{
|
|
70
|
+
{
|
|
71
|
+
immediate: false,
|
|
72
|
+
default: () => [],
|
|
73
|
+
transform: function(plugins2) {
|
|
74
|
+
return plugins2.map((plugin) => {
|
|
75
|
+
return {
|
|
76
|
+
...plugin,
|
|
77
|
+
label: getPluginLabel(plugin)
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
const {
|
|
84
|
+
data: hostPlugins,
|
|
85
|
+
status: statusHostPlugins,
|
|
86
|
+
execute: executeHostPlugins
|
|
87
|
+
} = await useLazyAsyncData(
|
|
88
|
+
() => {
|
|
89
|
+
if (adapter.getHostTransformPlugins) {
|
|
90
|
+
return adapter.getHostTransformPlugins();
|
|
91
|
+
}
|
|
92
|
+
return Promise.resolve([]);
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
immediate: !openPlugin.value,
|
|
96
|
+
default: () => [],
|
|
97
|
+
transform: function(plugins2) {
|
|
98
|
+
return plugins2.map((plugin) => {
|
|
99
|
+
return {
|
|
100
|
+
...plugin,
|
|
101
|
+
label: getPluginLabel(plugin)
|
|
102
|
+
};
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
50
106
|
);
|
|
107
|
+
const openPluginDefinition = computed(() => {
|
|
108
|
+
if (openPlugin.value) {
|
|
109
|
+
if (openPlugin.value.type === "block") {
|
|
110
|
+
return plugins.value.find((v) => v.id === openPlugin.value?.id) ?? null;
|
|
111
|
+
} else if (openPlugin.value.type === "host") {
|
|
112
|
+
return hostPlugins.value.find((v) => v.id === openPlugin.value?.id) ?? null;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return null;
|
|
116
|
+
});
|
|
117
|
+
function getPluginLabel(plugin) {
|
|
118
|
+
if (plugin.configInputs?.length) {
|
|
119
|
+
return plugin.label + "...";
|
|
120
|
+
}
|
|
121
|
+
return plugin.label;
|
|
122
|
+
}
|
|
123
|
+
function cancelTransform() {
|
|
124
|
+
openPlugin.value = null;
|
|
125
|
+
selectedUuids.value = [];
|
|
126
|
+
state.clearOverrideState();
|
|
127
|
+
}
|
|
51
128
|
watch(selection.uuids, async () => {
|
|
52
129
|
if (status.value === "idle") {
|
|
53
130
|
execute();
|
|
54
131
|
}
|
|
55
132
|
});
|
|
56
|
-
|
|
133
|
+
watch(selection.hasHostSelected, () => {
|
|
134
|
+
if (statusHostPlugins.value === "idle") {
|
|
135
|
+
executeHostPlugins();
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
function onSelectBlockTransformPlugin(plugin, uuids) {
|
|
139
|
+
if (plugin.configInputs?.length) {
|
|
140
|
+
openPlugin.value = {
|
|
141
|
+
type: "block",
|
|
142
|
+
id: plugin.id
|
|
143
|
+
};
|
|
144
|
+
selectedUuids.value = [...selection.uuids.value];
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
onTransformBlock(plugin, uuids, []);
|
|
148
|
+
}
|
|
149
|
+
function onSelectHostTransformPlugin(plugin) {
|
|
150
|
+
if (plugin.configInputs?.length) {
|
|
151
|
+
openPlugin.value = {
|
|
152
|
+
type: "host",
|
|
153
|
+
id: plugin.id
|
|
154
|
+
};
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
onTransformHost(plugin, []);
|
|
158
|
+
}
|
|
159
|
+
async function onTransformBlock(plugin, uuids, values) {
|
|
57
160
|
ui.setTransform(plugin.label);
|
|
161
|
+
openPlugin.value = null;
|
|
58
162
|
await state.mutateWithLoadingState(
|
|
59
163
|
() => adapter.applyTransformPlugin({
|
|
60
164
|
uuids,
|
|
61
|
-
pluginId: plugin.id
|
|
165
|
+
pluginId: plugin.id,
|
|
166
|
+
config: values
|
|
167
|
+
}),
|
|
168
|
+
$t(
|
|
169
|
+
"failedToTransform",
|
|
170
|
+
'The action "@name" could not be executed.'
|
|
171
|
+
).replace("@name", plugin.label)
|
|
172
|
+
);
|
|
173
|
+
ui.setTransform();
|
|
174
|
+
}
|
|
175
|
+
function onSubmitDialog(values) {
|
|
176
|
+
if (!openPluginDefinition.value) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
if ("bundles" in openPluginDefinition.value) {
|
|
180
|
+
onTransformBlock(openPluginDefinition.value, selection.uuids.value, values);
|
|
181
|
+
} else {
|
|
182
|
+
onTransformHost(openPluginDefinition.value, values);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
async function onTransformHost(plugin, values) {
|
|
186
|
+
if (!adapter.applyHostTransformPlugin) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
ui.setTransform(plugin.label);
|
|
190
|
+
openPlugin.value = null;
|
|
191
|
+
await state.mutateWithLoadingState(
|
|
192
|
+
() => adapter.applyHostTransformPlugin({
|
|
193
|
+
pluginId: plugin.id,
|
|
194
|
+
config: values
|
|
62
195
|
}),
|
|
63
196
|
$t(
|
|
64
197
|
"failedToTransform",
|
|
@@ -81,10 +214,12 @@ const possibleTransforms = computed(
|
|
|
81
214
|
defineCommands(
|
|
82
215
|
() => possibleTransforms.value.map((transform) => ({
|
|
83
216
|
id: "transform:" + transform.id,
|
|
84
|
-
label: transform
|
|
217
|
+
label: getPluginLabel(transform),
|
|
85
218
|
group: "selection",
|
|
86
219
|
icon: "script",
|
|
87
|
-
callback: () =>
|
|
220
|
+
callback: () => {
|
|
221
|
+
onSelectBlockTransformPlugin(transform, selection.uuids.value);
|
|
222
|
+
}
|
|
88
223
|
}))
|
|
89
224
|
);
|
|
90
225
|
const getPossibleDropTransforms = (plugins2, allBlocks, dragItems) => {
|
|
@@ -98,7 +233,7 @@ const getPossibleDropTransforms = (plugins2, allBlocks, dragItems) => {
|
|
|
98
233
|
const possibleTransforms2 = [];
|
|
99
234
|
validPlugins.forEach((plugin) => {
|
|
100
235
|
notDraggedBlocks.forEach((block) => {
|
|
101
|
-
if (plugin.targetBundles.includes(block.itemBundle)) {
|
|
236
|
+
if (!plugin.targetBundles || plugin.targetBundles.includes(block.itemBundle)) {
|
|
102
237
|
possibleTransforms2.push({
|
|
103
238
|
plugin,
|
|
104
239
|
block
|
|
@@ -108,30 +243,6 @@ const getPossibleDropTransforms = (plugins2, allBlocks, dragItems) => {
|
|
|
108
243
|
});
|
|
109
244
|
return possibleTransforms2;
|
|
110
245
|
};
|
|
111
|
-
defineDropAreas((dragItems) => {
|
|
112
|
-
const existing = dragItems.filter(
|
|
113
|
-
(v) => v.itemType === "existing"
|
|
114
|
-
);
|
|
115
|
-
if (!existing.length) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
const uuids = existing.map((v) => v.uuid);
|
|
119
|
-
return getPossibleDropTransforms(
|
|
120
|
-
plugins.value,
|
|
121
|
-
dom.getAllBlocks(),
|
|
122
|
-
existing
|
|
123
|
-
).map((v) => {
|
|
124
|
-
return {
|
|
125
|
-
id: `transform:${v.plugin.id}:${v.block.uuid}`,
|
|
126
|
-
label: v.plugin.label,
|
|
127
|
-
element: v.block.element(),
|
|
128
|
-
onDrop: () => {
|
|
129
|
-
const transformUuids = [v.block.uuid, ...uuids];
|
|
130
|
-
return onTransform(v.plugin, transformUuids);
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
246
|
</script>
|
|
136
247
|
|
|
137
248
|
<script>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div class="bk-form-label">
|
|
4
|
+
{{ label }}<span v-if="required" class="bk-required-indicator">*</span>
|
|
5
|
+
</div>
|
|
6
|
+
<div>
|
|
7
|
+
<label v-for="option in options" :key="option.value" class="bk-radio">
|
|
8
|
+
<input
|
|
9
|
+
v-model="value"
|
|
10
|
+
type="radio"
|
|
11
|
+
:value="option.value"
|
|
12
|
+
:required
|
|
13
|
+
:name="id"
|
|
14
|
+
:disabled
|
|
15
|
+
/>
|
|
16
|
+
<span>{{ option.label }}</span>
|
|
17
|
+
</label>
|
|
18
|
+
</div>
|
|
19
|
+
<div v-if="description" class="bk-form-description">{{ description }}</div>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script setup>
|
|
24
|
+
defineProps({
|
|
25
|
+
id: { type: String, required: true },
|
|
26
|
+
label: { type: String, required: true },
|
|
27
|
+
options: { type: Array, required: true },
|
|
28
|
+
required: { type: Boolean, required: false },
|
|
29
|
+
disabled: { type: Boolean, required: false },
|
|
30
|
+
description: { type: String, required: false }
|
|
31
|
+
});
|
|
32
|
+
const value = defineModel({ type: String });
|
|
33
|
+
</script>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
options: {
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
}[];
|
|
8
|
+
required?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
description?: string;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
13
|
+
modelValue?: string;
|
|
14
|
+
};
|
|
15
|
+
declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
17
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
18
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
19
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div class="bk-form-label">
|
|
4
|
+
{{ label }}<span v-if="required" class="bk-required-indicator">*</span>
|
|
5
|
+
</div>
|
|
6
|
+
<div
|
|
7
|
+
class="bk-radio-tabs"
|
|
8
|
+
:class="scheme ? 'bk-scheme-' + scheme : void 0"
|
|
9
|
+
>
|
|
10
|
+
<label v-for="option in options" :key="option.value">
|
|
11
|
+
<input
|
|
12
|
+
v-model="value"
|
|
13
|
+
type="radio"
|
|
14
|
+
:value="option.value"
|
|
15
|
+
:required
|
|
16
|
+
:name="id"
|
|
17
|
+
:disabled
|
|
18
|
+
/>
|
|
19
|
+
<span>{{ option.label }}</span>
|
|
20
|
+
</label>
|
|
21
|
+
</div>
|
|
22
|
+
<div v-if="description" class="bk-form-description">{{ description }}</div>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script setup>
|
|
27
|
+
defineProps({
|
|
28
|
+
id: { type: String, required: true },
|
|
29
|
+
label: { type: String, required: true },
|
|
30
|
+
options: { type: Array, required: true },
|
|
31
|
+
required: { type: Boolean, required: false },
|
|
32
|
+
disabled: { type: Boolean, required: false },
|
|
33
|
+
description: { type: String, required: false },
|
|
34
|
+
scheme: { type: String, required: false }
|
|
35
|
+
});
|
|
36
|
+
const value = defineModel({ type: String });
|
|
37
|
+
</script>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ThemeColorName } from '#blokkli/types/theme';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
options: {
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}[];
|
|
9
|
+
required?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
description?: string;
|
|
12
|
+
scheme?: ThemeColorName;
|
|
13
|
+
};
|
|
14
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
15
|
+
modelValue?: string;
|
|
16
|
+
};
|
|
17
|
+
declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
19
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
20
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
21
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<label class="bk-form-label" :for="id">
|
|
4
|
+
{{ label }}<span v-if="required" class="bk-required-indicator">*</span>
|
|
5
|
+
</label>
|
|
6
|
+
<select :id v-model="value" class="bk-form-input" :required :disabled>
|
|
7
|
+
<option
|
|
8
|
+
v-for="option in options"
|
|
9
|
+
:key="option.value"
|
|
10
|
+
:value="option.value"
|
|
11
|
+
>
|
|
12
|
+
{{ option.label }}
|
|
13
|
+
</option>
|
|
14
|
+
</select>
|
|
15
|
+
<div v-if="description" class="bk-form-description">{{ description }}</div>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup>
|
|
20
|
+
defineProps({
|
|
21
|
+
id: { type: String, required: true },
|
|
22
|
+
label: { type: String, required: true },
|
|
23
|
+
options: { type: Array, required: true },
|
|
24
|
+
required: { type: Boolean, required: false },
|
|
25
|
+
disabled: { type: Boolean, required: false },
|
|
26
|
+
description: { type: String, required: false }
|
|
27
|
+
});
|
|
28
|
+
const value = defineModel({ type: String });
|
|
29
|
+
</script>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
options: {
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
}[];
|
|
8
|
+
required?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
description?: string;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
13
|
+
modelValue?: string;
|
|
14
|
+
};
|
|
15
|
+
declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
17
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
18
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
19
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<label class="bk-form-label" :for="id">
|
|
4
|
+
{{ label }}<span v-if="required" class="bk-required-indicator">*</span>
|
|
5
|
+
</label>
|
|
6
|
+
<input
|
|
7
|
+
:id
|
|
8
|
+
v-model.lazy="value"
|
|
9
|
+
type="text"
|
|
10
|
+
class="bk-form-input"
|
|
11
|
+
:placeholder
|
|
12
|
+
:required
|
|
13
|
+
:disabled
|
|
14
|
+
:minlength
|
|
15
|
+
:maxlength
|
|
16
|
+
/>
|
|
17
|
+
<div v-if="description" class="bk-form-description">{{ description }}</div>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script setup>
|
|
22
|
+
defineProps({
|
|
23
|
+
id: { type: String, required: true },
|
|
24
|
+
label: { type: String, required: true },
|
|
25
|
+
description: { type: String, required: false },
|
|
26
|
+
placeholder: { type: String, required: false },
|
|
27
|
+
required: { type: Boolean, required: false },
|
|
28
|
+
disabled: { type: Boolean, required: false },
|
|
29
|
+
minlength: { type: [String, Number], required: false },
|
|
30
|
+
maxlength: { type: [String, Number], required: false }
|
|
31
|
+
});
|
|
32
|
+
const value = defineModel({ type: String });
|
|
33
|
+
</script>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
minlength?: string | number;
|
|
9
|
+
maxlength?: string | number;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
12
|
+
modelValue?: string;
|
|
13
|
+
};
|
|
14
|
+
declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
17
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
export default _default;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<label class="bk-form-label">
|
|
4
|
-
{{ label }}
|
|
3
|
+
<label class="bk-form-label" :for="id">
|
|
4
|
+
{{ label }}<span v-if="required" class="bk-required-indicator">*</span>
|
|
5
5
|
</label>
|
|
6
6
|
<textarea
|
|
7
|
-
|
|
7
|
+
:id
|
|
8
|
+
v-model.lazy="value"
|
|
8
9
|
class="bk-form-input"
|
|
9
|
-
:placeholder
|
|
10
|
+
:placeholder
|
|
10
11
|
:required
|
|
11
12
|
:disabled
|
|
12
|
-
rows="5"
|
|
13
|
+
:rows="rows ?? 5"
|
|
14
|
+
:minlength
|
|
15
|
+
:maxlength
|
|
13
16
|
/>
|
|
14
17
|
<div v-if="description" class="bk-form-description">{{ description }}</div>
|
|
15
18
|
</div>
|
|
@@ -17,11 +20,15 @@
|
|
|
17
20
|
|
|
18
21
|
<script setup>
|
|
19
22
|
defineProps({
|
|
23
|
+
id: { type: String, required: true },
|
|
20
24
|
label: { type: String, required: true },
|
|
21
25
|
description: { type: String, required: false },
|
|
22
26
|
placeholder: { type: String, required: false },
|
|
23
27
|
required: { type: Boolean, required: false },
|
|
24
|
-
disabled: { type: Boolean, required: false }
|
|
28
|
+
disabled: { type: Boolean, required: false },
|
|
29
|
+
minlength: { type: [String, Number], required: false },
|
|
30
|
+
maxlength: { type: [String, Number], required: false },
|
|
31
|
+
rows: { type: [String, Number], required: false }
|
|
25
32
|
});
|
|
26
33
|
const value = defineModel({ type: String });
|
|
27
34
|
</script>
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
|
+
id: string;
|
|
2
3
|
label: string;
|
|
3
4
|
description?: string;
|
|
4
5
|
placeholder?: string;
|
|
5
6
|
required?: boolean;
|
|
6
7
|
disabled?: boolean;
|
|
8
|
+
minlength?: string | number;
|
|
9
|
+
maxlength?: string | number;
|
|
10
|
+
rows?: string | number;
|
|
7
11
|
};
|
|
8
12
|
type __VLS_PublicProps = __VLS_Props & {
|
|
9
13
|
modelValue?: string;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Teleport to="body">
|
|
3
|
+
<div id="bk-indicators" class="bk bk-indicators" :style>
|
|
4
|
+
<div id="bk-indicators-left" />
|
|
5
|
+
<div id="bk-indicators-right" />
|
|
6
|
+
<div class="bk-indicators-hovered" :style="hoveredStyle" />
|
|
7
|
+
<div class="bk-indicators-highlighted" :style="highlightedStyle" />
|
|
8
|
+
</div>
|
|
9
|
+
</Teleport>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup>
|
|
13
|
+
import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
|
|
14
|
+
import { computed, useBlokkli, watch, ref } from "#imports";
|
|
15
|
+
const { ui, dom, indicators, selection } = useBlokkli();
|
|
16
|
+
const artboardElement = ui.artboardElement();
|
|
17
|
+
const highlighted = ref(null);
|
|
18
|
+
const hasIndicators = computed(
|
|
19
|
+
() => !!indicators.indicators.value.length || !!highlighted.value
|
|
20
|
+
);
|
|
21
|
+
const style = computed(() => {
|
|
22
|
+
const offset = ui.artboardOffset.value;
|
|
23
|
+
return {
|
|
24
|
+
width: ui.artboardSize.value.width + "px",
|
|
25
|
+
height: ui.artboardSize.value.height + "px",
|
|
26
|
+
transform: `translate(${offset.x}px, ${offset.y}px) scale(${ui.artboardScale.value})`
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
const hoveredStyle = computed(() => {
|
|
30
|
+
if (indicators.hovered.value && hasIndicators.value) {
|
|
31
|
+
const rect = dom.getBlockRect(indicators.hovered.value, true);
|
|
32
|
+
if (rect) {
|
|
33
|
+
return {
|
|
34
|
+
width: rect.width.toString() + "px",
|
|
35
|
+
height: rect.height.toString() + "px",
|
|
36
|
+
transform: `translate(${rect.x}px, ${rect.y}px)`
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
visibility: "hidden"
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
const highlightedStyle = computed(() => {
|
|
45
|
+
if (highlighted.value) {
|
|
46
|
+
return {
|
|
47
|
+
width: highlighted.value.width.toString() + "px",
|
|
48
|
+
height: highlighted.value.height.toString() + "px",
|
|
49
|
+
transform: `translate(${highlighted.value.x}px, ${highlighted.value.y}px)`
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
visibility: "hidden"
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
const HEIGHT = 30;
|
|
57
|
+
function snapToAnchorGrid(y) {
|
|
58
|
+
return Math.ceil(y / HEIGHT) * HEIGHT;
|
|
59
|
+
}
|
|
60
|
+
const prevRects = /* @__PURE__ */ new Map();
|
|
61
|
+
let lastFullUpdate = 0;
|
|
62
|
+
onBlokkliEvent("animationFrame", function(ctx) {
|
|
63
|
+
if (!hasIndicators.value) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const items = indicators.indicators.value;
|
|
67
|
+
const taken = /* @__PURE__ */ new Set();
|
|
68
|
+
const forceRefresh = ctx.time - lastFullUpdate > 1e3;
|
|
69
|
+
for (let i = 0; i < items.length; i++) {
|
|
70
|
+
const item = items[i];
|
|
71
|
+
if (!item) {
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
const rect = dom.getBlockRect(item.uuid, forceRefresh);
|
|
75
|
+
if (!rect) {
|
|
76
|
+
prevRects.delete(item.uuid);
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
let y = snapToAnchorGrid(Math.round(rect.y));
|
|
80
|
+
while (taken.has(y)) {
|
|
81
|
+
y += HEIGHT;
|
|
82
|
+
}
|
|
83
|
+
taken.add(y);
|
|
84
|
+
const style2 = `translateY(${y}px)`;
|
|
85
|
+
if (prevRects.get(item.uuid) !== y) {
|
|
86
|
+
prevRects.set(item.uuid, y);
|
|
87
|
+
item.element.style.transform = style2;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (forceRefresh) {
|
|
91
|
+
lastFullUpdate = ctx.time;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
onBlokkliEvent("view-option:toggle", () => {
|
|
95
|
+
prevRects.clear();
|
|
96
|
+
});
|
|
97
|
+
onBlokkliEvent("state:reloaded", () => {
|
|
98
|
+
prevRects.clear();
|
|
99
|
+
});
|
|
100
|
+
onBlokkliEvent("scrollIntoView", (e) => {
|
|
101
|
+
if ("element" in e) {
|
|
102
|
+
if (artboardElement.contains(e.element)) {
|
|
103
|
+
highlighted.value = ui.getAbsoluteElementRect(e.element);
|
|
104
|
+
} else {
|
|
105
|
+
highlighted.value = {
|
|
106
|
+
x: 0,
|
|
107
|
+
y: 0,
|
|
108
|
+
width: ui.artboardSize.value.width,
|
|
109
|
+
height: ui.artboardSize.value.height
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
onBlokkliEvent("window:clickAway", function() {
|
|
115
|
+
highlighted.value = null;
|
|
116
|
+
});
|
|
117
|
+
watch(indicators.indicators, function() {
|
|
118
|
+
prevRects.clear();
|
|
119
|
+
});
|
|
120
|
+
watch(selection.uuids, function() {
|
|
121
|
+
highlighted.value = null;
|
|
122
|
+
});
|
|
123
|
+
</script>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|