@blokkli/editor 2.0.0-alpha.13 → 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 +1 -1
- package/dist/module.mjs +4003 -1162
- 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 +1 -1
- 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 +35 -6
- 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 +14 -9
- 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/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 +20 -5
- 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
|
@@ -17,16 +17,9 @@
|
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
19
|
<script setup>
|
|
20
|
-
import {
|
|
21
|
-
useBlokkli,
|
|
22
|
-
defineBlokkliFeature,
|
|
23
|
-
ref,
|
|
24
|
-
watch,
|
|
25
|
-
onMounted,
|
|
26
|
-
onBeforeUnmount
|
|
27
|
-
} from "#imports";
|
|
20
|
+
import { useBlokkli, defineBlokkliFeature, ref } from "#imports";
|
|
28
21
|
import { PluginViewOption } from "#blokkli/plugins";
|
|
29
|
-
|
|
22
|
+
import { addElementClasses } from "#blokkli/helpers/addElementClasses";
|
|
30
23
|
defineBlokkliFeature({
|
|
31
24
|
id: "editable-mask",
|
|
32
25
|
icon: "texturebox",
|
|
@@ -36,17 +29,7 @@ defineBlokkliFeature({
|
|
|
36
29
|
});
|
|
37
30
|
const { $t } = useBlokkli();
|
|
38
31
|
const isActive = ref(false);
|
|
39
|
-
|
|
40
|
-
document.documentElement.classList.remove(HIDE_CLASS);
|
|
41
|
-
if (isActive.value) {
|
|
42
|
-
document.documentElement.classList.add(HIDE_CLASS);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
watch(isActive, setRootClass);
|
|
46
|
-
onMounted(setRootClass);
|
|
47
|
-
onBeforeUnmount(() => {
|
|
48
|
-
document.documentElement.classList.remove(HIDE_CLASS);
|
|
49
|
-
});
|
|
32
|
+
addElementClasses(document.documentElement, "bk-hide-non-editable", isActive);
|
|
50
33
|
</script>
|
|
51
34
|
|
|
52
35
|
<script>
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
/>
|
|
20
20
|
|
|
21
21
|
<Teleport to="body">
|
|
22
|
-
<
|
|
22
|
+
<BlokkliTransition name="slide-in">
|
|
23
23
|
<FragmentsDialog
|
|
24
24
|
v-if="placedAction && adapter.getLibraryItems"
|
|
25
25
|
:field="placedAction.field"
|
|
26
26
|
@close="placedAction = null"
|
|
27
27
|
@submit="onAddFragment"
|
|
28
28
|
/>
|
|
29
|
-
</
|
|
29
|
+
</BlokkliTransition>
|
|
30
30
|
</Teleport>
|
|
31
31
|
</template>
|
|
32
32
|
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
import { ref, useBlokkli, defineBlokkliFeature, computed } from "#imports";
|
|
35
35
|
import { PluginAddAction } from "#blokkli/plugins";
|
|
36
36
|
import FragmentsDialog from "./Dialog/index.vue";
|
|
37
|
+
import { BlokkliTransition } from "#blokkli/components";
|
|
37
38
|
const { adapter } = defineBlokkliFeature({
|
|
38
39
|
id: "fragments",
|
|
39
40
|
icon: "fragment",
|
|
@@ -52,6 +52,7 @@ import {
|
|
|
52
52
|
} from "#imports";
|
|
53
53
|
import { PluginSidebar, PluginToolbarButton } from "#blokkli/plugins";
|
|
54
54
|
import HistoryList from "./List/index.vue";
|
|
55
|
+
import { MOUSE_BUTTON } from "#blokkli/helpers/dom";
|
|
55
56
|
const { adapter, settings } = defineBlokkliFeature({
|
|
56
57
|
id: "history",
|
|
57
58
|
icon: "history",
|
|
@@ -69,31 +70,45 @@ const { adapter, settings } = defineBlokkliFeature({
|
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
});
|
|
72
|
-
const { state, $t, ui } = useBlokkli();
|
|
73
|
+
const { state, $t, ui, selection, eventBus } = useBlokkli();
|
|
73
74
|
const { mutations, currentMutationIndex, mutateWithLoadingState } = state;
|
|
75
|
+
const mutationsCount = computed(() => mutations.value.length);
|
|
74
76
|
const useMouseForHistory = computed(() => settings.value.useMouseButtons);
|
|
75
77
|
const canUndo = computed(() => currentMutationIndex.value >= 0);
|
|
76
78
|
const canRedo = computed(
|
|
77
|
-
() => currentMutationIndex.value <
|
|
79
|
+
() => currentMutationIndex.value < mutationsCount.value - 1
|
|
78
80
|
);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
const selectionAtHistoryIndex = /* @__PURE__ */ new Map();
|
|
82
|
+
function updateCurrentHistorySelection() {
|
|
83
|
+
selectionAtHistoryIndex.set(currentMutationIndex.value, [
|
|
84
|
+
...selection.uuids.value
|
|
85
|
+
]);
|
|
83
86
|
}
|
|
84
|
-
function
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
function setSelectionFromHistoryIndex(index) {
|
|
88
|
+
const selection2 = selectionAtHistoryIndex.get(index);
|
|
89
|
+
if (selection2) {
|
|
90
|
+
eventBus.emit("select", selection2);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
async function setHistoryIndex(newIndex) {
|
|
94
|
+
updateCurrentHistorySelection();
|
|
95
|
+
await mutateWithLoadingState(() => adapter.setHistoryIndex(newIndex));
|
|
96
|
+
setSelectionFromHistoryIndex(newIndex);
|
|
97
|
+
}
|
|
98
|
+
async function undo() {
|
|
99
|
+
await setHistoryIndex(currentMutationIndex.value - 1);
|
|
100
|
+
}
|
|
101
|
+
async function redo() {
|
|
102
|
+
await setHistoryIndex(currentMutationIndex.value + 1);
|
|
88
103
|
}
|
|
89
104
|
const onMouseUp = (e) => {
|
|
90
|
-
if (e.button ===
|
|
105
|
+
if (e.button === MOUSE_BUTTON.FOURTH) {
|
|
91
106
|
e.preventDefault();
|
|
92
107
|
e.stopPropagation();
|
|
93
108
|
if (canUndo.value) {
|
|
94
109
|
undo();
|
|
95
110
|
}
|
|
96
|
-
} else if (e.button ===
|
|
111
|
+
} else if (e.button === MOUSE_BUTTON.FIFTH) {
|
|
97
112
|
e.preventDefault();
|
|
98
113
|
e.stopPropagation();
|
|
99
114
|
if (canRedo.value) {
|
|
@@ -108,6 +123,14 @@ const setupMouseListeners = () => {
|
|
|
108
123
|
}
|
|
109
124
|
};
|
|
110
125
|
watch(useMouseForHistory, setupMouseListeners);
|
|
126
|
+
watch(selection.uuids, updateCurrentHistorySelection);
|
|
127
|
+
watch(mutationsCount, (count) => {
|
|
128
|
+
for (const [index] of selectionAtHistoryIndex) {
|
|
129
|
+
if (index >= count) {
|
|
130
|
+
selectionAtHistoryIndex.delete(index);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
});
|
|
111
134
|
onMounted(() => {
|
|
112
135
|
setupMouseListeners();
|
|
113
136
|
});
|
|
@@ -51,8 +51,12 @@
|
|
|
51
51
|
}}
|
|
52
52
|
</div>
|
|
53
53
|
<div
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
:style="{
|
|
55
|
+
opacity: searchTerm !== resultsSearchTerm ? 0.5 : 1,
|
|
56
|
+
height: '420px',
|
|
57
|
+
overflow: 'auto',
|
|
58
|
+
marginTop: '10px'
|
|
59
|
+
}"
|
|
56
60
|
>
|
|
57
61
|
<label v-for="entity in entities" :key="entity.uuid" class="bk-radio">
|
|
58
62
|
<input
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
/>
|
|
14
14
|
|
|
15
15
|
<Teleport to="body">
|
|
16
|
-
<
|
|
16
|
+
<BlokkliTransition name="slide-up">
|
|
17
17
|
<ExistingDialog
|
|
18
18
|
v-if="showModal"
|
|
19
19
|
@confirm="onSubmit($event.sourceUuid, $event.fields)"
|
|
20
20
|
@cancel="showModal = false"
|
|
21
21
|
/>
|
|
22
|
-
</
|
|
22
|
+
</BlokkliTransition>
|
|
23
23
|
</Teleport>
|
|
24
24
|
</template>
|
|
25
25
|
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
defineBlokkliFeature
|
|
33
33
|
} from "#imports";
|
|
34
34
|
import { PluginMenuButton } from "#blokkli/plugins";
|
|
35
|
+
import { BlokkliTransition } from "#blokkli/components";
|
|
35
36
|
import ExistingDialog from "./Dialog/index.vue";
|
|
36
37
|
const { adapter, settings } = defineBlokkliFeature({
|
|
37
38
|
id: "import-existing",
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"
|
|
33
33
|
icon="reusable"
|
|
34
34
|
color="lime"
|
|
35
|
-
item-bundle="
|
|
35
|
+
:item-bundle="BUNDLE_FROM_LIBRARY"
|
|
36
36
|
:disabled="!fromLibraryAllowedInList"
|
|
37
37
|
@placed="placedAction = $event"
|
|
38
38
|
/>
|
|
39
39
|
|
|
40
40
|
<Teleport to="body">
|
|
41
|
-
<
|
|
41
|
+
<BlokkliTransition name="slide-up">
|
|
42
42
|
<ReusableDialog
|
|
43
43
|
v-if="showReusableDialog && selectedItem"
|
|
44
44
|
:uuid="selectedItem.uuid"
|
|
@@ -46,18 +46,18 @@
|
|
|
46
46
|
@confirm="onMakeReusable"
|
|
47
47
|
@cancel="showReusableDialog = false"
|
|
48
48
|
/>
|
|
49
|
-
</
|
|
49
|
+
</BlokkliTransition>
|
|
50
50
|
</Teleport>
|
|
51
51
|
|
|
52
52
|
<Teleport to="body">
|
|
53
|
-
<
|
|
53
|
+
<BlokkliTransition name="slide-in">
|
|
54
54
|
<LibraryDialog
|
|
55
55
|
v-if="placedAction && adapter.getLibraryItems"
|
|
56
56
|
:field="placedAction.field"
|
|
57
57
|
@close="placedAction = null"
|
|
58
58
|
@submit="onAddLibraryItem"
|
|
59
59
|
/>
|
|
60
|
-
</
|
|
60
|
+
</BlokkliTransition>
|
|
61
61
|
</Teleport>
|
|
62
62
|
<EditReusable
|
|
63
63
|
v-if="editingLibraryItem"
|
|
@@ -73,7 +73,9 @@ import { PluginItemAction, PluginAddAction } from "#blokkli/plugins";
|
|
|
73
73
|
import ReusableDialog from "./ReusableDialog/index.vue";
|
|
74
74
|
import LibraryDialog from "./LibraryDialog/index.vue";
|
|
75
75
|
import EditReusable from "./EditReusable/index.vue";
|
|
76
|
+
import { BlokkliTransition } from "#blokkli/components";
|
|
76
77
|
import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
|
|
78
|
+
import { BUNDLE_FROM_LIBRARY } from "#blokkli/constants";
|
|
77
79
|
const { adapter } = defineBlokkliFeature({
|
|
78
80
|
id: "library",
|
|
79
81
|
icon: "reusable",
|
|
@@ -126,7 +128,7 @@ const itemBundle = computed(
|
|
|
126
128
|
() => selectedItem?.value ? types.getBlockBundleDefinition(selectedItem.value.itemBundle) : null
|
|
127
129
|
);
|
|
128
130
|
const isReusable = computed(
|
|
129
|
-
() => selection.blocks.value.length && selection.blocks.value.every((v) => v.itemBundle ===
|
|
131
|
+
() => selection.blocks.value.length && selection.blocks.value.every((v) => v.itemBundle === BUNDLE_FROM_LIBRARY)
|
|
130
132
|
);
|
|
131
133
|
async function onMakeReusable(label) {
|
|
132
134
|
showReusableDialog.value = false;
|
|
@@ -143,15 +145,15 @@ async function onMakeReusable(label) {
|
|
|
143
145
|
eventBus.emit("select:end");
|
|
144
146
|
}
|
|
145
147
|
const isSupportedOnEntity = computed(
|
|
146
|
-
() => types.generallyAvailableBundles.find((v) => v.id ===
|
|
148
|
+
() => types.generallyAvailableBundles.find((v) => v.id === BUNDLE_FROM_LIBRARY)
|
|
147
149
|
);
|
|
148
150
|
const fromLibraryAllowedInList = computed(() => {
|
|
149
151
|
if (!selection.uuids.value.length) {
|
|
150
152
|
return !!types.generallyAvailableBundles.find(
|
|
151
|
-
(v) => v.id ===
|
|
153
|
+
(v) => v.id === BUNDLE_FROM_LIBRARY
|
|
152
154
|
);
|
|
153
155
|
}
|
|
154
|
-
return types.allowedTypesInList.value.includes(
|
|
156
|
+
return types.allowedTypesInList.value.includes(BUNDLE_FROM_LIBRARY);
|
|
155
157
|
});
|
|
156
158
|
const canMakeReusable = computed(
|
|
157
159
|
() => !isReusable.value && itemBundle?.value?.allowReusable && fromLibraryAllowedInList.value
|
|
@@ -35,14 +35,11 @@
|
|
|
35
35
|
</option>
|
|
36
36
|
</select>
|
|
37
37
|
</label>
|
|
38
|
-
<
|
|
38
|
+
<FormToggle
|
|
39
39
|
v-else-if="filter.filter.type === 'checkbox'"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
<div />
|
|
44
|
-
<span>{{ filter.filter.label }}</span>
|
|
45
|
-
</label>
|
|
40
|
+
v-model="filterValues[filter.key]"
|
|
41
|
+
:label="filter.filter.label"
|
|
42
|
+
/>
|
|
46
43
|
</div>
|
|
47
44
|
</div>
|
|
48
45
|
<div
|
|
@@ -83,7 +80,7 @@ import {
|
|
|
83
80
|
watch,
|
|
84
81
|
nextTick
|
|
85
82
|
} from "#imports";
|
|
86
|
-
import { Sortli, Icon, Pagination } from "#blokkli/components";
|
|
83
|
+
import { Sortli, Icon, Pagination, FormToggle } from "#blokkli/components";
|
|
87
84
|
import Item from "./Item.vue";
|
|
88
85
|
import { buildDraggableItem, falsy } from "#blokkli/helpers";
|
|
89
86
|
import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
|
|
@@ -25,6 +25,7 @@ const props = defineProps({
|
|
|
25
25
|
isPressingControl: { type: Boolean, required: true },
|
|
26
26
|
gl: { type: null, required: true }
|
|
27
27
|
});
|
|
28
|
+
const startTimestamp = Date.now();
|
|
28
29
|
defineEmits(["select"]);
|
|
29
30
|
class MultiSelectRectangleBufferCollector extends RectangleBufferCollector {
|
|
30
31
|
getBufferInfo(offset, scale) {
|
|
@@ -95,7 +96,7 @@ class MultiSelectRectangleBufferCollector extends RectangleBufferCollector {
|
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
98
|
const collector = new MultiSelectRectangleBufferCollector(props.gl);
|
|
98
|
-
const thick =
|
|
99
|
+
const thick = 300;
|
|
99
100
|
collector.addRectangle(
|
|
100
101
|
{
|
|
101
102
|
width: 1e3,
|
|
@@ -180,7 +181,6 @@ function getSelectRect(offset, scale) {
|
|
|
180
181
|
};
|
|
181
182
|
return { shader, check };
|
|
182
183
|
}
|
|
183
|
-
const now = Date.now();
|
|
184
184
|
onBlokkliEvent("canvas:draw", (e) => {
|
|
185
185
|
mouseX = e.mouseX;
|
|
186
186
|
mouseY = e.mouseY;
|
|
@@ -188,7 +188,7 @@ onBlokkliEvent("canvas:draw", (e) => {
|
|
|
188
188
|
const { nested } = collector.getSelectedUuids(check);
|
|
189
189
|
const shouldSelectAll = props.isPressingControl || !nested.length;
|
|
190
190
|
props.gl.useProgram(programInfo.program);
|
|
191
|
-
const time = (Date.now() -
|
|
191
|
+
const time = (Date.now() - startTimestamp) / 1e3;
|
|
192
192
|
setUniforms(programInfo, uniforms);
|
|
193
193
|
setUniforms(programInfo, {
|
|
194
194
|
u_select_all: shouldSelectAll ? 1 : 0,
|
|
@@ -223,7 +223,12 @@ function getUuidsToSelect() {
|
|
|
223
223
|
}
|
|
224
224
|
onBeforeUnmount(() => {
|
|
225
225
|
props.gl.clear(props.gl.COLOR_BUFFER_BIT);
|
|
226
|
-
|
|
226
|
+
const diff = Date.now() - startTimestamp;
|
|
227
|
+
if (diff > 175) {
|
|
228
|
+
eventBus.emit("select:end", getUuidsToSelect());
|
|
229
|
+
} else {
|
|
230
|
+
eventBus.emit("select:end");
|
|
231
|
+
}
|
|
227
232
|
logger.log("MultiSelectOverlay unmounted");
|
|
228
233
|
});
|
|
229
234
|
</script>
|
|
@@ -32,24 +32,18 @@ const onSelect = (uuids) => {
|
|
|
32
32
|
shouldRender.value = false;
|
|
33
33
|
eventBus.emit("select:end", uuids);
|
|
34
34
|
};
|
|
35
|
-
|
|
36
|
-
onBlokkliEvent("
|
|
37
|
-
if (!enabled.value
|
|
35
|
+
const startTimeout = null;
|
|
36
|
+
onBlokkliEvent("multi-select:start", (e) => {
|
|
37
|
+
if (!enabled.value) {
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
if (keyboard.isPressingSpace.value || keyboard.isPressingControl.value) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
clearTimeout(startTimeout);
|
|
44
40
|
downX.value = e.x;
|
|
45
41
|
downY.value = e.y;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
shouldRender.value = true;
|
|
52
|
-
}, 70);
|
|
42
|
+
eventBus.emit("select:start", {
|
|
43
|
+
uuids: [],
|
|
44
|
+
mode: "mouse"
|
|
45
|
+
});
|
|
46
|
+
shouldRender.value = true;
|
|
53
47
|
});
|
|
54
48
|
onBlokkliEvent("mouse:up", () => {
|
|
55
49
|
shouldRender.value = false;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<label class="bk-blokkli-item-options-checkbox">
|
|
3
|
-
<input v-model="checked" type="checkbox" class="peer" />
|
|
3
|
+
<input v-model="checked" type="checkbox" class="peer" :required />
|
|
4
4
|
<div />
|
|
5
5
|
<span>{{ label }}</span>
|
|
6
6
|
</label>
|
|
@@ -13,7 +13,8 @@ const { $t, state } = useBlokkli();
|
|
|
13
13
|
const props = defineProps({
|
|
14
14
|
label: { type: String, required: true },
|
|
15
15
|
property: { type: String, required: true },
|
|
16
|
-
modelValue: { type: String, required: false }
|
|
16
|
+
modelValue: { type: String, required: false },
|
|
17
|
+
required: { type: Boolean, required: false }
|
|
17
18
|
});
|
|
18
19
|
const emit = defineEmits(["update:modelValue"]);
|
|
19
20
|
const checked = computed({
|
|
@@ -2,12 +2,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2
2
|
label: string;
|
|
3
3
|
property: string;
|
|
4
4
|
modelValue?: string;
|
|
5
|
+
required?: boolean;
|
|
5
6
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
7
|
"update:modelValue": (...args: any[]) => void;
|
|
7
8
|
}, string, import("vue").PublicProps, Readonly<{
|
|
8
9
|
label: string;
|
|
9
10
|
property: string;
|
|
10
11
|
modelValue?: string;
|
|
12
|
+
required?: boolean;
|
|
11
13
|
}> & Readonly<{
|
|
12
14
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
13
15
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
v-if="showLabel"
|
|
5
5
|
:class="isGrouped ? 'bk-blokkli-item-options-item-label' : 'bk-tooltip'"
|
|
6
6
|
>
|
|
7
|
-
<
|
|
7
|
+
<div class="bk-is-label">
|
|
8
|
+
<span>{{ label }}</span>
|
|
9
|
+
<span v-if="hoveredOption">: {{ hoveredOption }}</span>
|
|
10
|
+
</div>
|
|
11
|
+
<span v-if="description">{{ description }}</span>
|
|
8
12
|
</div>
|
|
9
13
|
<div
|
|
10
14
|
class="bk-blokkli-item-options-item-content"
|
|
@@ -15,6 +19,7 @@
|
|
|
15
19
|
<OptionRadios
|
|
16
20
|
v-if="option.type === 'radios'"
|
|
17
21
|
v-model="value"
|
|
22
|
+
v-model:hovered="hoveredOption"
|
|
18
23
|
:label="label"
|
|
19
24
|
:options="option.options"
|
|
20
25
|
:property="property"
|
|
@@ -74,7 +79,7 @@
|
|
|
74
79
|
</template>
|
|
75
80
|
|
|
76
81
|
<script setup>
|
|
77
|
-
import { computed, useBlokkli } from "#imports";
|
|
82
|
+
import { ref, computed, useBlokkli } from "#imports";
|
|
78
83
|
import OptionRadios from "./Radios/index.vue";
|
|
79
84
|
import OptionCheckbox from "./Checkbox/index.vue";
|
|
80
85
|
import OptionCheckboxes from "./Checkboxes/index.vue";
|
|
@@ -94,9 +99,9 @@ const props = defineProps({
|
|
|
94
99
|
option: { type: Object, required: true },
|
|
95
100
|
property: { type: String, required: true },
|
|
96
101
|
mutatedValue: { type: null, required: true },
|
|
97
|
-
uuids: { type: Array, required: true },
|
|
98
102
|
isGrouped: { type: Boolean, required: false }
|
|
99
103
|
});
|
|
104
|
+
const hoveredOption = ref("");
|
|
100
105
|
const showLabel = computed(() => {
|
|
101
106
|
if (props.isGrouped) {
|
|
102
107
|
if (props.option.type === "checkbox") {
|
|
@@ -108,6 +113,7 @@ const showLabel = computed(() => {
|
|
|
108
113
|
const label = computed(
|
|
109
114
|
() => $blokkliText(`blockOption_${props.property}_label`, props.option.label)
|
|
110
115
|
);
|
|
116
|
+
const description = computed(() => props.option.description);
|
|
111
117
|
const checkboxOptions = computed(() => {
|
|
112
118
|
if (props.option.type !== "checkboxes") {
|
|
113
119
|
return [];
|
|
@@ -3,7 +3,6 @@ type __VLS_Props = {
|
|
|
3
3
|
option: BlockOptionDefinition;
|
|
4
4
|
property: string;
|
|
5
5
|
mutatedValue: any;
|
|
6
|
-
uuids: string[];
|
|
7
6
|
isGrouped?: boolean;
|
|
8
7
|
};
|
|
9
8
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
@@ -6,8 +6,13 @@
|
|
|
6
6
|
'bk-is-grid': displayAs === 'grid',
|
|
7
7
|
'bk-is-icons': displayAs === 'icons'
|
|
8
8
|
}"
|
|
9
|
+
@mouseleave="onMouseLeave"
|
|
9
10
|
>
|
|
10
|
-
<label
|
|
11
|
+
<label
|
|
12
|
+
v-for="option in mappedOptions"
|
|
13
|
+
:key="option.key"
|
|
14
|
+
@mouseenter="active = option.label"
|
|
15
|
+
>
|
|
11
16
|
<div v-bind="getInputWrapperAttributes(option.value)">
|
|
12
17
|
<input
|
|
13
18
|
:id="option.key"
|
|
@@ -15,7 +20,7 @@
|
|
|
15
20
|
:name="property"
|
|
16
21
|
:value="option.key"
|
|
17
22
|
:checked="modelValue === option.key"
|
|
18
|
-
@change="
|
|
23
|
+
@change="value = option.key"
|
|
19
24
|
/>
|
|
20
25
|
<div
|
|
21
26
|
v-if="
|
|
@@ -51,7 +56,7 @@
|
|
|
51
56
|
</template>
|
|
52
57
|
|
|
53
58
|
<script setup>
|
|
54
|
-
import { computed, useBlokkli } from "#imports";
|
|
59
|
+
import { computed, useBlokkli, onMounted } from "#imports";
|
|
55
60
|
import { Icon } from "#blokkli/components";
|
|
56
61
|
import defineCommands from "#blokkli/helpers/composables/defineCommands";
|
|
57
62
|
const { $t, state } = useBlokkli();
|
|
@@ -59,37 +64,45 @@ const props = defineProps({
|
|
|
59
64
|
label: { type: String, required: true },
|
|
60
65
|
property: { type: String, required: true },
|
|
61
66
|
displayAs: { type: String, required: false },
|
|
62
|
-
options: { type: Object, required: true }
|
|
63
|
-
modelValue: { type: String, required: false }
|
|
67
|
+
options: { type: Object, required: true }
|
|
64
68
|
});
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
const value = defineModel({ type: String, ...{
|
|
70
|
+
default: ""
|
|
71
|
+
} });
|
|
72
|
+
const active = defineModel("hovered", { type: String, ...{
|
|
73
|
+
default: ""
|
|
74
|
+
} });
|
|
75
|
+
function getInputWrapperAttributes(value2) {
|
|
76
|
+
if (props.displayAs === "colors" && typeof value2 !== "string") {
|
|
77
|
+
if (value2.hex && value2.hex.indexOf("#") === 0) {
|
|
69
78
|
return {
|
|
70
|
-
style: "background-color: " +
|
|
79
|
+
style: "background-color: " + value2.hex
|
|
71
80
|
};
|
|
72
|
-
} else if (
|
|
81
|
+
} else if (value2.class) {
|
|
73
82
|
return {
|
|
74
|
-
class:
|
|
83
|
+
class: value2.class
|
|
75
84
|
};
|
|
76
85
|
}
|
|
77
86
|
}
|
|
78
87
|
return {};
|
|
79
88
|
}
|
|
80
89
|
const mappedOptions = computed(() => {
|
|
81
|
-
return Object.entries(props.options).map(([key,
|
|
82
|
-
|
|
90
|
+
return Object.entries(props.options).map(([key, value2]) => {
|
|
91
|
+
const label = typeof value2 === "string" ? value2 : value2.label;
|
|
92
|
+
return { key, value: value2, label };
|
|
83
93
|
});
|
|
84
94
|
});
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
};
|
|
95
|
+
const selectedLabel = computed(() => {
|
|
96
|
+
return mappedOptions.value.find((v) => v.key === value.value)?.label;
|
|
97
|
+
});
|
|
98
|
+
function onMouseLeave() {
|
|
99
|
+
active.value = selectedLabel.value ?? "";
|
|
100
|
+
}
|
|
88
101
|
defineCommands(() => {
|
|
89
102
|
if (state.editMode.value !== "editing") {
|
|
90
103
|
return;
|
|
91
104
|
}
|
|
92
|
-
return mappedOptions.value.filter((v) => v.key !==
|
|
105
|
+
return mappedOptions.value.filter((v) => v.key !== value.value).map((option) => {
|
|
93
106
|
return {
|
|
94
107
|
id: "options:" + props.property + option.key,
|
|
95
108
|
label: $t(
|
|
@@ -98,10 +111,15 @@ defineCommands(() => {
|
|
|
98
111
|
).replace("@option", props.label).replace("@value", option.key),
|
|
99
112
|
group: "selection",
|
|
100
113
|
icon: "form",
|
|
101
|
-
callback: () =>
|
|
114
|
+
callback: () => {
|
|
115
|
+
value.value = option.key;
|
|
116
|
+
}
|
|
102
117
|
};
|
|
103
118
|
});
|
|
104
119
|
});
|
|
120
|
+
onMounted(() => {
|
|
121
|
+
active.value = selectedLabel.value ?? "";
|
|
122
|
+
});
|
|
105
123
|
</script>
|
|
106
124
|
|
|
107
125
|
<script>
|
|
@@ -9,9 +9,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
9
9
|
icon?: string;
|
|
10
10
|
label: string;
|
|
11
11
|
}>;
|
|
12
|
+
} & {
|
|
12
13
|
modelValue?: string;
|
|
14
|
+
hovered?: string;
|
|
13
15
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
-
"update:modelValue": (
|
|
16
|
+
"update:modelValue": (value: string) => any;
|
|
17
|
+
"update:hovered": (value: string) => any;
|
|
15
18
|
}, string, import("vue").PublicProps, Readonly<{
|
|
16
19
|
label: string;
|
|
17
20
|
property: string;
|
|
@@ -23,8 +26,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
23
26
|
icon?: string;
|
|
24
27
|
label: string;
|
|
25
28
|
}>;
|
|
29
|
+
} & {
|
|
26
30
|
modelValue?: string;
|
|
31
|
+
hovered?: string;
|
|
27
32
|
}> & Readonly<{
|
|
28
|
-
"onUpdate:modelValue"?: ((
|
|
33
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
34
|
+
"onUpdate:hovered"?: ((value: string) => any) | undefined;
|
|
29
35
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
30
36
|
export default _default;
|