@blokkli/editor 2.0.0-alpha.13 → 2.0.0-alpha.15
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 +4873 -1167
- 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 +5 -0
- package/dist/modules/drupal/graphql/base/query.pbEntityConfig.graphql +5 -0
- package/dist/modules/drupal/graphql/features/publishNew.graphql +1 -4
- package/dist/modules/drupal/graphql/features/scheduler.graphql +31 -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 +37 -7
- package/dist/modules/drupal/runtime/adapter/index.js +140 -5
- package/dist/runtime/adapter/index.d.ts +90 -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/MenuButton/index.vue.d.ts +2 -2
- 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/EntityTitle/index.vue +33 -1
- 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/Item.vue +41 -14
- package/dist/runtime/components/Edit/Features/Publish/Dialog/Item.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Publish/Dialog/PublishOption.vue +47 -0
- package/dist/runtime/components/Edit/Features/Publish/Dialog/PublishOption.vue.d.ts +19 -0
- package/dist/runtime/components/Edit/Features/Publish/Dialog/ScheduleDate.vue +183 -0
- package/dist/runtime/components/Edit/Features/Publish/Dialog/ScheduleDate.vue.d.ts +13 -0
- package/dist/runtime/components/Edit/Features/Publish/Dialog/Summary.vue +83 -0
- package/dist/runtime/components/Edit/Features/Publish/Dialog/Summary.vue.d.ts +9 -0
- package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue +381 -128
- package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue.d.ts +3 -14
- package/dist/runtime/components/Edit/Features/Publish/index.vue +37 -22
- 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/Datepicker/index.vue +198 -0
- package/dist/runtime/components/Edit/Form/Datepicker/index.vue.d.ts +15 -0
- 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 +752 -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 +24 -15
- package/dist/runtime/components/Edit/index.js +46 -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 +7 -2
- package/dist/runtime/helpers/stateProvider.js +89 -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 +9 -2
- package/dist/runtime/helpers/uiProvider.js +72 -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/calendar-clock.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-off.svg +1 -0
- 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 +172 -6
- 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
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<PluginSidebar
|
|
3
|
+
id="analyze"
|
|
4
|
+
:title="$t('analyzeSidebarTitle', 'Analyze')"
|
|
5
|
+
:tour-text="$t('analyzeTourText', 'Analyze the content of your page')"
|
|
6
|
+
icon="speedometer"
|
|
7
|
+
>
|
|
8
|
+
<Renderer :langcode="context.language" :analyzers />
|
|
9
|
+
</PluginSidebar>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup>
|
|
13
|
+
import { useBlokkli, defineBlokkliFeature } from "#imports";
|
|
14
|
+
import { PluginSidebar } from "#blokkli/plugins";
|
|
15
|
+
import Renderer from "./Renderer.vue";
|
|
16
|
+
const { adapter } = defineBlokkliFeature({
|
|
17
|
+
id: "analyze",
|
|
18
|
+
label: "Analyze",
|
|
19
|
+
icon: "speedometer",
|
|
20
|
+
requiredAdapterMethods: ["getAnalyzers"],
|
|
21
|
+
description: "Analyze blocks and page for SEO, accessibility, etc.",
|
|
22
|
+
viewports: []
|
|
23
|
+
});
|
|
24
|
+
function getAdapterAnalyzers() {
|
|
25
|
+
const result = adapter.getAnalyzers();
|
|
26
|
+
if (Array.isArray(result)) {
|
|
27
|
+
return Promise.resolve(result);
|
|
28
|
+
}
|
|
29
|
+
return Promise.resolve(result).then((result2) => {
|
|
30
|
+
if (Array.isArray(result2)) {
|
|
31
|
+
return result2;
|
|
32
|
+
}
|
|
33
|
+
return [result2];
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const analyzers = await getAdapterAnalyzers();
|
|
37
|
+
const { $t, context } = useBlokkli();
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<script>
|
|
41
|
+
export default {
|
|
42
|
+
name: "Analyze"
|
|
43
|
+
};
|
|
44
|
+
</script>
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<PluginBlockIndicator
|
|
3
|
+
v-for="item in items"
|
|
4
|
+
id="anchor"
|
|
5
|
+
:key="item.uuid"
|
|
6
|
+
:uuid="item.uuid"
|
|
7
|
+
:label="'#' + item.id"
|
|
8
|
+
icon="anchor"
|
|
9
|
+
@click="onClick(item)"
|
|
10
|
+
/>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup>
|
|
14
|
+
import { useBlokkli, ref, onMounted, onBeforeUnmount, useRoute } from "#imports";
|
|
15
|
+
import { PluginBlockIndicator } from "#blokkli/plugins";
|
|
16
|
+
import { emitMessage } from "#blokkli/helpers/eventBus";
|
|
17
|
+
const route = useRoute();
|
|
18
|
+
const { ui, $t, adapter } = useBlokkli();
|
|
19
|
+
const rootElement = ui.providerElement();
|
|
20
|
+
function getLinkForClipboard(item) {
|
|
21
|
+
if (adapter.buildAnchorLink) {
|
|
22
|
+
return adapter.buildAnchorLink(item.id, item.uuid);
|
|
23
|
+
}
|
|
24
|
+
return route.path + "#" + item.id;
|
|
25
|
+
}
|
|
26
|
+
function onClick(item) {
|
|
27
|
+
if (navigator.clipboard?.writeText) {
|
|
28
|
+
const link = getLinkForClipboard(item);
|
|
29
|
+
navigator.clipboard.writeText(link);
|
|
30
|
+
const message = $t(
|
|
31
|
+
"copiedToClipboardMessage",
|
|
32
|
+
'"@text" has been copied to your clipboard'
|
|
33
|
+
).replace("@text", link);
|
|
34
|
+
emitMessage(message, "success", void 0, true);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const items = ref([]);
|
|
38
|
+
const trackedElements = /* @__PURE__ */ new Map();
|
|
39
|
+
let observer = null;
|
|
40
|
+
const getAnchorData = (el) => {
|
|
41
|
+
const uuid = el.getAttribute("data-uuid");
|
|
42
|
+
const id = el.getAttribute("id");
|
|
43
|
+
return uuid && id ? { uuid, id } : null;
|
|
44
|
+
};
|
|
45
|
+
const syncItems = () => {
|
|
46
|
+
const newItems = Array.from(trackedElements.values());
|
|
47
|
+
items.value = newItems;
|
|
48
|
+
};
|
|
49
|
+
const checkElement = (el) => {
|
|
50
|
+
const data = getAnchorData(el);
|
|
51
|
+
const isTracked = trackedElements.has(el);
|
|
52
|
+
if (data && !isTracked) {
|
|
53
|
+
trackedElements.set(el, data);
|
|
54
|
+
return true;
|
|
55
|
+
} else if (!data && isTracked) {
|
|
56
|
+
trackedElements.delete(el);
|
|
57
|
+
return true;
|
|
58
|
+
} else if (data && isTracked) {
|
|
59
|
+
const existing = trackedElements.get(el);
|
|
60
|
+
if (existing.uuid !== data.uuid || existing.id !== data.id) {
|
|
61
|
+
trackedElements.set(el, data);
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return false;
|
|
66
|
+
};
|
|
67
|
+
const processAddedNode = (node) => {
|
|
68
|
+
if (node.nodeType !== Node.ELEMENT_NODE) return false;
|
|
69
|
+
let changed = false;
|
|
70
|
+
const el = node;
|
|
71
|
+
if (el.hasAttribute("data-uuid") && el.hasAttribute("id")) {
|
|
72
|
+
changed = checkElement(el) || changed;
|
|
73
|
+
}
|
|
74
|
+
return changed;
|
|
75
|
+
};
|
|
76
|
+
const processRemovedNode = (node) => {
|
|
77
|
+
if (node.nodeType !== Node.ELEMENT_NODE) return false;
|
|
78
|
+
let changed = false;
|
|
79
|
+
const el = node;
|
|
80
|
+
if (!el.id) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
if (trackedElements.delete(el)) {
|
|
84
|
+
changed = true;
|
|
85
|
+
}
|
|
86
|
+
const toRemove = [];
|
|
87
|
+
for (const [trackedEl] of trackedElements) {
|
|
88
|
+
if (node.contains(trackedEl)) {
|
|
89
|
+
toRemove.push(trackedEl);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
for (const el2 of toRemove) {
|
|
93
|
+
trackedElements.delete(el2);
|
|
94
|
+
changed = true;
|
|
95
|
+
}
|
|
96
|
+
return changed;
|
|
97
|
+
};
|
|
98
|
+
onMounted(() => {
|
|
99
|
+
const elements = rootElement.querySelectorAll("[data-uuid][id]");
|
|
100
|
+
for (const el of elements) {
|
|
101
|
+
const data = getAnchorData(el);
|
|
102
|
+
if (data) {
|
|
103
|
+
trackedElements.set(el, data);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
syncItems();
|
|
107
|
+
observer = new MutationObserver((mutations) => {
|
|
108
|
+
let changed = false;
|
|
109
|
+
for (const mutation of mutations) {
|
|
110
|
+
if (mutation.type === "childList") {
|
|
111
|
+
for (const node of mutation.addedNodes) {
|
|
112
|
+
changed = processAddedNode(node) || changed;
|
|
113
|
+
}
|
|
114
|
+
for (const node of mutation.removedNodes) {
|
|
115
|
+
changed = processRemovedNode(node) || changed;
|
|
116
|
+
}
|
|
117
|
+
} else if (mutation.type === "attributes") {
|
|
118
|
+
const target = mutation.target;
|
|
119
|
+
changed = checkElement(target) || changed;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (changed) {
|
|
123
|
+
syncItems();
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
observer.observe(rootElement, {
|
|
127
|
+
childList: true,
|
|
128
|
+
subtree: true,
|
|
129
|
+
attributes: true,
|
|
130
|
+
attributeFilter: ["data-uuid", "id"]
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
onBeforeUnmount(() => {
|
|
134
|
+
observer?.disconnect();
|
|
135
|
+
});
|
|
136
|
+
</script>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<PluginViewOption
|
|
3
|
+
id="anchor"
|
|
4
|
+
v-slot="{ isActive }"
|
|
5
|
+
:label="$t('anchorToggle', 'Toggle anchor links')"
|
|
6
|
+
:title-on="$t('anchorShow', 'Show anchor links')"
|
|
7
|
+
:title-off="$t('anchorHide', 'Hide anchor links')"
|
|
8
|
+
icon="anchor"
|
|
9
|
+
>
|
|
10
|
+
<AnchorRenderer v-if="isActive" />
|
|
11
|
+
</PluginViewOption>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup>
|
|
15
|
+
import { useBlokkli, defineBlokkliFeature } from "#imports";
|
|
16
|
+
import { PluginViewOption } from "#blokkli/plugins";
|
|
17
|
+
import AnchorRenderer from "./Renderer.vue";
|
|
18
|
+
defineBlokkliFeature({
|
|
19
|
+
id: "anchors",
|
|
20
|
+
label: "Anchors",
|
|
21
|
+
icon: "anchor",
|
|
22
|
+
description: "Displays indicators for blocks with anchor IDs",
|
|
23
|
+
viewports: ["desktop"]
|
|
24
|
+
});
|
|
25
|
+
const { $t } = useBlokkli();
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
export default {
|
|
30
|
+
name: "Anchors"
|
|
31
|
+
};
|
|
32
|
+
</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;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<ViewportBlockingRect
|
|
3
|
+
id="artboard-overview"
|
|
3
4
|
ref="overviewEl"
|
|
4
5
|
class="bk bk-artboard-overview"
|
|
5
6
|
@touchstart.stop
|
|
@@ -13,12 +14,20 @@
|
|
|
13
14
|
<div class="bk-artboard-overview-visible">
|
|
14
15
|
<button ref="overviewVisibleEl" />
|
|
15
16
|
</div>
|
|
16
|
-
</
|
|
17
|
+
</ViewportBlockingRect>
|
|
17
18
|
</template>
|
|
18
19
|
|
|
19
20
|
<script setup>
|
|
20
21
|
import { overview } from "artboard-deluxe";
|
|
21
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
onBeforeUnmount,
|
|
24
|
+
onMounted,
|
|
25
|
+
ref,
|
|
26
|
+
useBlokkli,
|
|
27
|
+
computed,
|
|
28
|
+
useTemplateRef
|
|
29
|
+
} from "#imports";
|
|
30
|
+
import { ViewportBlockingRect } from "#blokkli/components";
|
|
22
31
|
import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
|
|
23
32
|
const props = defineProps({
|
|
24
33
|
artboard: { type: Object, required: true }
|
|
@@ -30,7 +39,7 @@ const overviewFillColor = computed(() => {
|
|
|
30
39
|
const selectedColor = computed(() => {
|
|
31
40
|
return theme.getColorString("accent", "700", 1);
|
|
32
41
|
});
|
|
33
|
-
const overviewEl =
|
|
42
|
+
const overviewEl = useTemplateRef("overviewEl");
|
|
34
43
|
const overviewArtboardEl = ref();
|
|
35
44
|
const overviewVisibleEl = ref();
|
|
36
45
|
const canvas = ref();
|
|
@@ -71,15 +80,18 @@ function updateCanvas() {
|
|
|
71
80
|
onBlokkliEvent("animationFrame", updateCanvas);
|
|
72
81
|
onMounted(() => {
|
|
73
82
|
if (overviewEl.value && overviewArtboardEl.value && overviewVisibleEl.value) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
const el = overviewEl.value.$el;
|
|
84
|
+
if (el) {
|
|
85
|
+
pluginOverview = props.artboard.addPlugin(
|
|
86
|
+
overview({
|
|
87
|
+
element: el,
|
|
88
|
+
artboardElement: overviewArtboardEl.value,
|
|
89
|
+
visibleAreaElement: overviewVisibleEl.value,
|
|
90
|
+
padding: 20,
|
|
91
|
+
autoHeight: true
|
|
92
|
+
})
|
|
93
|
+
);
|
|
94
|
+
}
|
|
83
95
|
}
|
|
84
96
|
});
|
|
85
97
|
onBeforeUnmount(() => {
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Scrollbar :artboard="artboard" orientation="y" />
|
|
3
|
+
<PluginToolbarButton
|
|
4
|
+
id="artboard_reset_zoom"
|
|
5
|
+
:title="$t('artboardResetZoom', 'Reset zoom')"
|
|
6
|
+
:shortcut-group="$t('artboard', 'Artboard')"
|
|
7
|
+
:tour-text="
|
|
8
|
+
$t(
|
|
9
|
+
'artboardToolbarButtonTourText',
|
|
10
|
+
'Shows the current zoom factor. Click on it to reset the zoom back to 100%.'
|
|
11
|
+
)
|
|
12
|
+
"
|
|
13
|
+
icon="magnifier"
|
|
14
|
+
meta
|
|
15
|
+
key-code="0"
|
|
16
|
+
region="view-options"
|
|
17
|
+
weight="100"
|
|
18
|
+
@click="resetZoom"
|
|
19
|
+
>
|
|
20
|
+
<div class="bk-feature-canvas-button">
|
|
21
|
+
<span>{{ zoomLevel }}</span>
|
|
22
|
+
</div>
|
|
23
|
+
</PluginToolbarButton>
|
|
24
|
+
|
|
25
|
+
<PluginViewOption
|
|
26
|
+
id="artboardOverview"
|
|
27
|
+
v-slot="{ isActive }"
|
|
28
|
+
:label="$t('artboardOverviewToggle', 'Toggle overview')"
|
|
29
|
+
:title-on="$t('artboardOverviewShow', 'Show overview')"
|
|
30
|
+
:title-off="$t('artboardOverviewHide', 'Hide overview')"
|
|
31
|
+
:tour-text="
|
|
32
|
+
$t(
|
|
33
|
+
'artboardOverviewTourText',
|
|
34
|
+
`Displays a top level overview of your content.`
|
|
35
|
+
)
|
|
36
|
+
"
|
|
37
|
+
icon="eye"
|
|
38
|
+
key-code="O"
|
|
39
|
+
weight="90"
|
|
40
|
+
>
|
|
41
|
+
<Teleport v-if="isActive && dom.isReady.value" to="body">
|
|
42
|
+
<Overview :artboard="artboard" />
|
|
43
|
+
</Teleport>
|
|
44
|
+
</PluginViewOption>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script setup>
|
|
48
|
+
import {
|
|
49
|
+
watch,
|
|
50
|
+
computed,
|
|
51
|
+
useBlokkli,
|
|
52
|
+
onMounted,
|
|
53
|
+
onBeforeUnmount
|
|
54
|
+
} from "#imports";
|
|
55
|
+
import {
|
|
56
|
+
asValidNumber,
|
|
57
|
+
isInsideRect,
|
|
58
|
+
subtractRectFromViewport
|
|
59
|
+
} from "#blokkli/helpers";
|
|
60
|
+
import { PluginToolbarButton, PluginViewOption } from "#blokkli/plugins";
|
|
61
|
+
import Overview from "./Overview/index.vue";
|
|
62
|
+
import Scrollbar from "./Scrollbar/index.vue";
|
|
63
|
+
import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
|
|
64
|
+
import {
|
|
65
|
+
createArtboard,
|
|
66
|
+
touch,
|
|
67
|
+
wheel,
|
|
68
|
+
mouse,
|
|
69
|
+
dom as domPlugin
|
|
70
|
+
} from "artboard-deluxe";
|
|
71
|
+
import { addElementClasses } from "#blokkli/helpers/addElementClasses";
|
|
72
|
+
const props = defineProps({
|
|
73
|
+
persist: { type: Boolean, required: true },
|
|
74
|
+
momentum: { type: Boolean, required: true },
|
|
75
|
+
scrollSpeed: { type: Number, required: true }
|
|
76
|
+
});
|
|
77
|
+
addElementClasses(document.documentElement, "bk-is-artboard");
|
|
78
|
+
const { context, storage, ui, animation, $t, dom, selection } = useBlokkli();
|
|
79
|
+
const artboardElement = ui.artboardElement();
|
|
80
|
+
const zoomLevel = computed(() => Math.round(ui.artboardScale.value * 100) + "%");
|
|
81
|
+
const PADDING = 50;
|
|
82
|
+
const options = computed(() => {
|
|
83
|
+
return {
|
|
84
|
+
maxScale: ui.isMobile.value ? 1 : 3,
|
|
85
|
+
direction: ui.isMobile.value ? "vertical" : "both",
|
|
86
|
+
minScale: 0.1,
|
|
87
|
+
overscrollBounds: {
|
|
88
|
+
top: ui.visibleViewport.value.y + PADDING,
|
|
89
|
+
left: ui.visibleViewport.value.x + PADDING,
|
|
90
|
+
right: ui.viewport.value.width - ui.visibleViewport.value.width - ui.visibleViewport.value.x + PADDING,
|
|
91
|
+
bottom: PADDING
|
|
92
|
+
},
|
|
93
|
+
getBlockingRects: () => {
|
|
94
|
+
const toolbarRects = subtractRectFromViewport(
|
|
95
|
+
ui.viewport.value,
|
|
96
|
+
ui.visibleViewport.value
|
|
97
|
+
);
|
|
98
|
+
return [...toolbarRects, ...ui.viewportBlockingRects.value];
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
});
|
|
102
|
+
watch(options, function(newOptions) {
|
|
103
|
+
artboard.setOptions(newOptions);
|
|
104
|
+
});
|
|
105
|
+
const storageKey = computed(
|
|
106
|
+
() => "artboard:" + context.value.entityUuid + (ui.isMobile.value ? "mobile" : "desktop")
|
|
107
|
+
);
|
|
108
|
+
const savedState = storage.use(storageKey, null);
|
|
109
|
+
const saveState = () => {
|
|
110
|
+
if (!props.persist) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
savedState.value = {
|
|
114
|
+
offset: artboard.getOffset(),
|
|
115
|
+
scale: artboard.getScale()
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
let pluginWheel = null;
|
|
119
|
+
const wheelOptions = computed(() => {
|
|
120
|
+
return {
|
|
121
|
+
useMomentumZoom: props.momentum,
|
|
122
|
+
useMomentumScroll: props.momentum,
|
|
123
|
+
interceptWheel: true,
|
|
124
|
+
scrollSpeed: props.scrollSpeed,
|
|
125
|
+
wheelZoomFactor: props.scrollSpeed
|
|
126
|
+
};
|
|
127
|
+
});
|
|
128
|
+
watch(wheelOptions, function(newOptions) {
|
|
129
|
+
if (pluginWheel) {
|
|
130
|
+
pluginWheel.options.setAll(newOptions);
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
watch(selection.uuids, function() {
|
|
134
|
+
if (artboard.getMomentum()) {
|
|
135
|
+
artboard.cancelAnimation();
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
function getArtboard() {
|
|
139
|
+
pluginWheel = wheel(wheelOptions.value);
|
|
140
|
+
return createArtboard(
|
|
141
|
+
ui.rootElement(),
|
|
142
|
+
[
|
|
143
|
+
mouse(),
|
|
144
|
+
touch(),
|
|
145
|
+
pluginWheel,
|
|
146
|
+
domPlugin({
|
|
147
|
+
element: artboardElement,
|
|
148
|
+
precision: 1,
|
|
149
|
+
restoreStyles: true
|
|
150
|
+
})
|
|
151
|
+
],
|
|
152
|
+
{
|
|
153
|
+
initTransform: savedState.value && props.persist ? {
|
|
154
|
+
x: asValidNumber(savedState.value.offset.x, 0),
|
|
155
|
+
y: asValidNumber(savedState.value.offset.y, 0),
|
|
156
|
+
scale: asValidNumber(savedState.value?.scale, 1)
|
|
157
|
+
} : void 0,
|
|
158
|
+
...options.value
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
const artboard = getArtboard();
|
|
163
|
+
watch(options, function(newOptions) {
|
|
164
|
+
artboard.setOptions(newOptions);
|
|
165
|
+
});
|
|
166
|
+
const AUTOSCROLL_EDGE_ZONE = 130;
|
|
167
|
+
const AUTOSCROLL_SPEED = 12;
|
|
168
|
+
let autoScrollSpeed = 1;
|
|
169
|
+
function edgeStep(distance) {
|
|
170
|
+
const ratio = distance / AUTOSCROLL_EDGE_ZONE;
|
|
171
|
+
return Math.pow(ratio, 3) * AUTOSCROLL_SPEED;
|
|
172
|
+
}
|
|
173
|
+
let hasLeftAddList = false;
|
|
174
|
+
onBlokkliEvent("dragging:end", () => {
|
|
175
|
+
hasLeftAddList = false;
|
|
176
|
+
});
|
|
177
|
+
onBlokkliEvent("animationFrame:before", ({ time, mouseY, mouseX }) => {
|
|
178
|
+
if (selection.isDragging.value) {
|
|
179
|
+
if (ui.addListOrientation.value === "horizontal") {
|
|
180
|
+
if (!hasLeftAddList) {
|
|
181
|
+
if (isInsideRect(mouseX, mouseY, ui.visibleViewportPadded.value)) {
|
|
182
|
+
hasLeftAddList = true;
|
|
183
|
+
} else {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
const viewportHeight = ui.viewport.value.height;
|
|
189
|
+
const currentOffset = artboard.getOffset();
|
|
190
|
+
const y = Math.min(Math.max(mouseY, 0), viewportHeight);
|
|
191
|
+
let dy = 0;
|
|
192
|
+
if (y < AUTOSCROLL_EDGE_ZONE) {
|
|
193
|
+
const dist = AUTOSCROLL_EDGE_ZONE - y;
|
|
194
|
+
dy = edgeStep(dist);
|
|
195
|
+
} else if (y > viewportHeight - AUTOSCROLL_EDGE_ZONE) {
|
|
196
|
+
const dist = y - (viewportHeight - AUTOSCROLL_EDGE_ZONE);
|
|
197
|
+
dy = -edgeStep(dist);
|
|
198
|
+
} else {
|
|
199
|
+
autoScrollSpeed = 1;
|
|
200
|
+
}
|
|
201
|
+
if (dy !== 0) {
|
|
202
|
+
artboard.setOffset(null, currentOffset.y + dy * autoScrollSpeed);
|
|
203
|
+
autoScrollSpeed = Math.min(autoScrollSpeed * 1.01, 2.25);
|
|
204
|
+
}
|
|
205
|
+
} else {
|
|
206
|
+
autoScrollSpeed = 1;
|
|
207
|
+
}
|
|
208
|
+
artboard.loop(time);
|
|
209
|
+
const artboardSize = artboard.getArtboardSize();
|
|
210
|
+
if (artboardSize) {
|
|
211
|
+
ui.artboardSize.value.height = artboardSize.height;
|
|
212
|
+
ui.artboardSize.value.width = artboardSize.width;
|
|
213
|
+
}
|
|
214
|
+
const offset = artboard.getOffset();
|
|
215
|
+
ui.artboardOffset.value.x = asValidNumber(Math.ceil(offset.x), 0);
|
|
216
|
+
ui.artboardOffset.value.y = asValidNumber(Math.ceil(offset.y), 0);
|
|
217
|
+
ui.artboardScale.value = asValidNumber(artboard.getScale(), 1);
|
|
218
|
+
animation.requestDraw();
|
|
219
|
+
});
|
|
220
|
+
onMounted(() => {
|
|
221
|
+
window.addEventListener("beforeunload", saveState);
|
|
222
|
+
});
|
|
223
|
+
onBeforeUnmount(() => {
|
|
224
|
+
saveState();
|
|
225
|
+
artboard.destroy();
|
|
226
|
+
window.removeEventListener("beforeunload", saveState);
|
|
227
|
+
});
|
|
228
|
+
const resetZoom = () => {
|
|
229
|
+
artboard.resetZoom({
|
|
230
|
+
duration: 500
|
|
231
|
+
});
|
|
232
|
+
animation.requestDraw();
|
|
233
|
+
};
|
|
234
|
+
onBlokkliEvent("keyPressed", (e) => {
|
|
235
|
+
if (e.code === "Home") {
|
|
236
|
+
e.originalEvent.preventDefault();
|
|
237
|
+
artboard.scrollToTop();
|
|
238
|
+
animation.requestDraw();
|
|
239
|
+
} else if (e.code === "End") {
|
|
240
|
+
e.originalEvent.preventDefault();
|
|
241
|
+
artboard.scrollToEnd();
|
|
242
|
+
animation.requestDraw();
|
|
243
|
+
} else if (e.code === "PageUp") {
|
|
244
|
+
e.originalEvent.preventDefault();
|
|
245
|
+
artboard.scrollPageUp();
|
|
246
|
+
animation.requestDraw();
|
|
247
|
+
} else if (e.code === "PageDown") {
|
|
248
|
+
e.originalEvent.preventDefault();
|
|
249
|
+
artboard.scrollPageDown();
|
|
250
|
+
animation.requestDraw();
|
|
251
|
+
} else if (e.code === "ArrowUp") {
|
|
252
|
+
e.originalEvent.preventDefault();
|
|
253
|
+
artboard.scrollUp();
|
|
254
|
+
animation.requestDraw();
|
|
255
|
+
} else if (e.code === "ArrowDown") {
|
|
256
|
+
e.originalEvent.preventDefault();
|
|
257
|
+
artboard.scrollDown();
|
|
258
|
+
animation.requestDraw();
|
|
259
|
+
} else if (e.code === "0" && e.meta) {
|
|
260
|
+
e.originalEvent.preventDefault();
|
|
261
|
+
resetZoom();
|
|
262
|
+
} else if (e.code === "1" && e.meta) {
|
|
263
|
+
e.originalEvent.preventDefault();
|
|
264
|
+
artboard.scaleToFit();
|
|
265
|
+
animation.requestDraw();
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
onBlokkliEvent("scrollIntoView", (e) => {
|
|
269
|
+
if ("uuid" in e) {
|
|
270
|
+
const rect = dom.getBlockRect(e.uuid);
|
|
271
|
+
if (!rect) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
if (dom.isBlockVisible(e.uuid)) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
artboard.scrollIntoView(rect, {
|
|
278
|
+
scale: "none",
|
|
279
|
+
axis: "y",
|
|
280
|
+
behavior: e.immediate ? "instant" : "auto"
|
|
281
|
+
});
|
|
282
|
+
} else {
|
|
283
|
+
if (artboardElement.contains(e.element)) {
|
|
284
|
+
artboard.scrollElementIntoView(e.element, {
|
|
285
|
+
scale: "none",
|
|
286
|
+
axis: "y",
|
|
287
|
+
behavior: e.immediate ? "instant" : "auto"
|
|
288
|
+
});
|
|
289
|
+
} else {
|
|
290
|
+
artboard.scrollToTop({
|
|
291
|
+
duration: 0
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
</script>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
persist: boolean;
|
|
3
|
+
momentum: boolean;
|
|
4
|
+
scrollSpeed: number;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
export default _default;
|