@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
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="bk bk-diff-view">
|
|
3
|
+
<div class="bk-diff-mode-selector">
|
|
4
|
+
<FormRadioTabs
|
|
5
|
+
id="diff-viewer-state-display"
|
|
6
|
+
v-model="diffMode"
|
|
7
|
+
:options="diffModeOptions"
|
|
8
|
+
:label="$t('diffModeLabel', 'Display')"
|
|
9
|
+
:scheme
|
|
10
|
+
/>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="bk-diff-table" :data-diff-mode="diffMode">
|
|
13
|
+
<button
|
|
14
|
+
v-for="item in diffItems"
|
|
15
|
+
:key="item.uuid"
|
|
16
|
+
class="bk-diff-item"
|
|
17
|
+
:class="{
|
|
18
|
+
'bk-is-muted': showSelect && !selected?.includes(item.uuid)
|
|
19
|
+
}"
|
|
20
|
+
@click.prevent="onClick(item.uuid)"
|
|
21
|
+
>
|
|
22
|
+
<div
|
|
23
|
+
class="bk-diff-item-header"
|
|
24
|
+
:disabled="item.status === 'removed' && !showSelect"
|
|
25
|
+
:class="{
|
|
26
|
+
'bk-is-selected': showSelect && selected?.includes(item.uuid)
|
|
27
|
+
}"
|
|
28
|
+
>
|
|
29
|
+
<div class="bk-blokkli-item-label">
|
|
30
|
+
<div class="bk-blokkli-item-label-icon">
|
|
31
|
+
<ItemIcon :bundle="item.bundle" />
|
|
32
|
+
</div>
|
|
33
|
+
<span>{{ getLabel(item.bundle) }}</span>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="bk-diff-status">
|
|
36
|
+
<div
|
|
37
|
+
v-if="item.status === 'added'"
|
|
38
|
+
class="bk-diff-status-label bk-is-added"
|
|
39
|
+
>
|
|
40
|
+
{{ $t("diffStatusAdded", "Added") }}
|
|
41
|
+
</div>
|
|
42
|
+
<div
|
|
43
|
+
v-else-if="item.status === 'removed'"
|
|
44
|
+
class="bk-diff-status-label bk-is-removed"
|
|
45
|
+
>
|
|
46
|
+
{{ $t("diffStatusDeleted", "Deleted") }}
|
|
47
|
+
</div>
|
|
48
|
+
<div
|
|
49
|
+
v-else-if="item.status === 'unchanged'"
|
|
50
|
+
class="bk-diff-status-label"
|
|
51
|
+
>
|
|
52
|
+
{{ $t("diffStatusUnchanged", "Unchanged") }}
|
|
53
|
+
</div>
|
|
54
|
+
<div v-else class="bk-diff-status-label">
|
|
55
|
+
{{ $t("diffStatusEdited", "Edited") }}
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
<div class="bk-diff-item-diffs">
|
|
60
|
+
<div
|
|
61
|
+
v-for="prop in item.props"
|
|
62
|
+
:key="prop.key"
|
|
63
|
+
class="bk-diff-prop-row"
|
|
64
|
+
>
|
|
65
|
+
<h3>{{ prop.key }}</h3>
|
|
66
|
+
<div class="bk-diff-monospace">
|
|
67
|
+
<div
|
|
68
|
+
v-if="diffMode === 'inline'"
|
|
69
|
+
class="bk-diff-prop-diff"
|
|
70
|
+
v-html="prop.diff"
|
|
71
|
+
/>
|
|
72
|
+
<div
|
|
73
|
+
v-else-if="diffMode === 'side_by_side'"
|
|
74
|
+
class="bk-diff-prop-side-by-side"
|
|
75
|
+
>
|
|
76
|
+
<div class="bk-diff-prop-before">
|
|
77
|
+
<div class="bk-diff-prop-label">
|
|
78
|
+
{{ $t("diffBefore", "Before") }}
|
|
79
|
+
</div>
|
|
80
|
+
<div class="bk-diff-prop-content" v-html="prop.before" />
|
|
81
|
+
</div>
|
|
82
|
+
<div class="bk-diff-prop-after">
|
|
83
|
+
<div class="bk-diff-prop-label">
|
|
84
|
+
{{ $t("diffAfter", "After") }}
|
|
85
|
+
</div>
|
|
86
|
+
<div class="bk-diff-prop-content" v-html="prop.after" />
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
<div
|
|
90
|
+
v-else-if="diffMode === 'after'"
|
|
91
|
+
class="bk-diff-prop-after-only"
|
|
92
|
+
>
|
|
93
|
+
<div class="bk-diff-prop-content" v-html="prop.after" />
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
</button>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
</template>
|
|
102
|
+
|
|
103
|
+
<script setup>
|
|
104
|
+
import { computed, useBlokkli } from "#imports";
|
|
105
|
+
import { ItemIcon, FormRadioTabs } from "#blokkli/components";
|
|
106
|
+
import diff from "html-diff-ts";
|
|
107
|
+
const props = defineProps({
|
|
108
|
+
stateBefore: { type: Object, required: true },
|
|
109
|
+
stateAfter: { type: Object, required: true },
|
|
110
|
+
showSelect: { type: Boolean, required: false },
|
|
111
|
+
includeUuids: { type: Array, required: false },
|
|
112
|
+
selected: { type: Array, required: false },
|
|
113
|
+
scheme: { type: String, required: false }
|
|
114
|
+
});
|
|
115
|
+
const { types, $t, eventBus, dom, definitions, storage } = useBlokkli();
|
|
116
|
+
const diffMode = storage.use(
|
|
117
|
+
"diffMode",
|
|
118
|
+
"inline"
|
|
119
|
+
);
|
|
120
|
+
const diffModeOptions = computed(() => [
|
|
121
|
+
{
|
|
122
|
+
value: "inline",
|
|
123
|
+
label: $t("diffModeInline", "Inline")
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
value: "side_by_side",
|
|
127
|
+
label: $t("diffModeSideBySide", "Both")
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
value: "after",
|
|
131
|
+
label: $t("diffModeAfter", "After")
|
|
132
|
+
}
|
|
133
|
+
]);
|
|
134
|
+
const emit = defineEmits(["toggle"]);
|
|
135
|
+
function getProps(bundle, props2) {
|
|
136
|
+
const definition = definitions.getDefaultDefinition(bundle);
|
|
137
|
+
if (definition?.editor?.mapDiffProps) {
|
|
138
|
+
return definition.editor.mapDiffProps(props2);
|
|
139
|
+
}
|
|
140
|
+
if (typeof props2 === "object") {
|
|
141
|
+
return Object.entries(props2).reduce(
|
|
142
|
+
(acc, [key, value]) => {
|
|
143
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
144
|
+
acc[key] = value.toString();
|
|
145
|
+
} else if (typeof value === "object") {
|
|
146
|
+
try {
|
|
147
|
+
const json = JSON.stringify(value, null, 2);
|
|
148
|
+
acc[key] = `<pre>${json}</pre>`;
|
|
149
|
+
} catch {
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return acc;
|
|
153
|
+
},
|
|
154
|
+
{}
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
return {};
|
|
158
|
+
}
|
|
159
|
+
function buildDiffItems(fields) {
|
|
160
|
+
const items = (fields || []).flatMap((v) => v.list);
|
|
161
|
+
return items;
|
|
162
|
+
}
|
|
163
|
+
const itemsBefore = computed(
|
|
164
|
+
() => buildDiffItems(props.stateBefore.mutatedState?.fields)
|
|
165
|
+
);
|
|
166
|
+
const itemsAfter = computed(
|
|
167
|
+
() => buildDiffItems(props.stateAfter.mutatedState?.fields)
|
|
168
|
+
);
|
|
169
|
+
function toString(v) {
|
|
170
|
+
if (typeof v === "string") {
|
|
171
|
+
return v;
|
|
172
|
+
} else if (typeof v === "number") {
|
|
173
|
+
return v.toString();
|
|
174
|
+
}
|
|
175
|
+
return "";
|
|
176
|
+
}
|
|
177
|
+
const diffItems = computed(() => {
|
|
178
|
+
const diffMap = /* @__PURE__ */ new Map();
|
|
179
|
+
itemsBefore.value.forEach((beforeItem) => {
|
|
180
|
+
if (props.includeUuids && !props.includeUuids.includes(beforeItem.uuid)) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
const afterItem = itemsAfter.value.find(
|
|
184
|
+
(item) => item.uuid === beforeItem.uuid
|
|
185
|
+
);
|
|
186
|
+
const beforeProps = getProps(beforeItem.bundle, beforeItem.props);
|
|
187
|
+
if (!afterItem) {
|
|
188
|
+
diffMap.set(beforeItem.uuid, {
|
|
189
|
+
uuid: beforeItem.uuid,
|
|
190
|
+
bundle: beforeItem.bundle,
|
|
191
|
+
status: "removed",
|
|
192
|
+
props: Object.entries(beforeProps).map(([key, value]) => ({
|
|
193
|
+
key,
|
|
194
|
+
diff: diff(toString(value), ""),
|
|
195
|
+
before: toString(value),
|
|
196
|
+
after: ""
|
|
197
|
+
}))
|
|
198
|
+
});
|
|
199
|
+
} else {
|
|
200
|
+
const afterProps = getProps(afterItem.bundle, afterItem.props);
|
|
201
|
+
const changedProps = [];
|
|
202
|
+
Object.entries(beforeProps).forEach(([key, beforeValue]) => {
|
|
203
|
+
const afterValue = afterProps[key];
|
|
204
|
+
if (beforeValue !== afterValue) {
|
|
205
|
+
changedProps.push({
|
|
206
|
+
key,
|
|
207
|
+
diff: diff(toString(beforeValue), toString(afterValue)),
|
|
208
|
+
before: toString(beforeValue),
|
|
209
|
+
after: toString(afterValue)
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
Object.keys(afterProps).forEach((key) => {
|
|
214
|
+
if (!(key in beforeProps)) {
|
|
215
|
+
changedProps.push({
|
|
216
|
+
key,
|
|
217
|
+
diff: diff("", toString(afterProps[key])),
|
|
218
|
+
before: "",
|
|
219
|
+
after: toString(afterProps[key])
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
if (changedProps.length > 0) {
|
|
224
|
+
diffMap.set(beforeItem.uuid, {
|
|
225
|
+
uuid: beforeItem.uuid,
|
|
226
|
+
bundle: beforeItem.bundle,
|
|
227
|
+
status: "changed",
|
|
228
|
+
props: changedProps
|
|
229
|
+
});
|
|
230
|
+
} else if (props.includeUuids) {
|
|
231
|
+
diffMap.set(beforeItem.uuid, {
|
|
232
|
+
uuid: beforeItem.uuid,
|
|
233
|
+
bundle: beforeItem.bundle,
|
|
234
|
+
status: "unchanged",
|
|
235
|
+
props: []
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
itemsAfter.value.forEach((afterItem) => {
|
|
241
|
+
if (!itemsBefore.value.some((item) => item.uuid === afterItem.uuid)) {
|
|
242
|
+
const afterProps = getProps(afterItem.bundle, afterItem.props);
|
|
243
|
+
diffMap.set(afterItem.uuid, {
|
|
244
|
+
uuid: afterItem.uuid,
|
|
245
|
+
bundle: afterItem.bundle,
|
|
246
|
+
status: "added",
|
|
247
|
+
props: Object.entries(afterProps).map(([key, value]) => ({
|
|
248
|
+
key,
|
|
249
|
+
diff: diff("", toString(value)),
|
|
250
|
+
before: "",
|
|
251
|
+
after: toString(value)
|
|
252
|
+
}))
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
return Array.from(diffMap.values()).sort((a, b) => {
|
|
257
|
+
const aY = dom.getBlockRect(a.uuid)?.y || 0;
|
|
258
|
+
const bY = dom.getBlockRect(b.uuid)?.y || 0;
|
|
259
|
+
return aY - bY;
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
function onClick(uuid) {
|
|
263
|
+
if (props.showSelect) {
|
|
264
|
+
emit("toggle", uuid);
|
|
265
|
+
} else {
|
|
266
|
+
scrollToBlock(uuid);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
function getLabel(bundle) {
|
|
270
|
+
return types.getBlockBundleDefinition(bundle)?.label || bundle;
|
|
271
|
+
}
|
|
272
|
+
function scrollToBlock(uuid) {
|
|
273
|
+
eventBus.emit("scrollIntoView", { uuid, center: true });
|
|
274
|
+
eventBus.emit("select", uuid);
|
|
275
|
+
}
|
|
276
|
+
</script>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { MappedState } from '#blokkli/types';
|
|
2
|
+
import type { ThemeColorName } from '#blokkli/types/theme';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
stateBefore: MappedState;
|
|
5
|
+
stateAfter: MappedState;
|
|
6
|
+
showSelect?: boolean;
|
|
7
|
+
includeUuids?: string[];
|
|
8
|
+
selected?: string[];
|
|
9
|
+
scheme?: ThemeColorName;
|
|
10
|
+
};
|
|
11
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
12
|
+
toggle: (uuid: string) => any;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
|
+
onToggle?: ((uuid: string) => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
export default _default;
|
|
@@ -29,6 +29,8 @@ watch(dom.isReady, buildRects);
|
|
|
29
29
|
let lastInteractedElement = null;
|
|
30
30
|
let pointerDownElement = null;
|
|
31
31
|
let mouseStartCoordinates = null;
|
|
32
|
+
let pointerDownTimestamp = 0;
|
|
33
|
+
let pointerUpTimestamp = 0;
|
|
32
34
|
function getInteractedElement(e) {
|
|
33
35
|
const { x, y } = getInteractionCoordinates(e);
|
|
34
36
|
const elements = document.elementsFromPoint(x, y);
|
|
@@ -95,14 +97,26 @@ function onPointerMove(e) {
|
|
|
95
97
|
if (e.pointerType === "touch") {
|
|
96
98
|
return onTouchMove(e);
|
|
97
99
|
}
|
|
98
|
-
if (e.buttons !==
|
|
100
|
+
if (e.buttons !== MOUSE_BUTTONS.PRIMARY) {
|
|
99
101
|
return;
|
|
100
102
|
}
|
|
101
|
-
if (!
|
|
103
|
+
if (!mouseStartCoordinates || selection.isMultiSelecting.value || selection.isDragging.value || keyboard.isPressingSpace.value) {
|
|
102
104
|
return;
|
|
103
105
|
}
|
|
104
106
|
const diffX = Math.abs(mouseStartCoordinates.x - e.clientX);
|
|
105
107
|
const diffY = Math.abs(mouseStartCoordinates.y - e.clientY);
|
|
108
|
+
if (!pointerDownElement) {
|
|
109
|
+
const timeDelta = Date.now() - pointerDownTimestamp;
|
|
110
|
+
const maxMovement = Math.max(diffX, diffY);
|
|
111
|
+
if (maxMovement > 6 && timeDelta > 150 || maxMovement > 20) {
|
|
112
|
+
rootEl.removeEventListener("pointermove", onPointerMove);
|
|
113
|
+
eventBus.emit("multi-select:start", {
|
|
114
|
+
x: e.clientX,
|
|
115
|
+
y: e.clientY
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
106
120
|
if (diffX < 6 && diffY < 6) {
|
|
107
121
|
return;
|
|
108
122
|
}
|
|
@@ -124,10 +138,9 @@ function onPointerMove(e) {
|
|
|
124
138
|
});
|
|
125
139
|
}
|
|
126
140
|
}
|
|
141
|
+
rootEl.removeEventListener("pointermove", onPointerMove);
|
|
127
142
|
}
|
|
128
143
|
}
|
|
129
|
-
let pointerDownTimestamp = 0;
|
|
130
|
-
let pointerUpTimestamp = 0;
|
|
131
144
|
function onPointerDown(e) {
|
|
132
145
|
if (e.buttons === MOUSE_BUTTONS.AUXILIARY) {
|
|
133
146
|
return;
|
|
@@ -149,10 +162,10 @@ function onPointerDown(e) {
|
|
|
149
162
|
if (selection.isDragging.value) {
|
|
150
163
|
return;
|
|
151
164
|
}
|
|
165
|
+
pointerDownTimestamp = Date.now();
|
|
152
166
|
const coords = { x: e.clientX, y: e.clientY };
|
|
167
|
+
mouseStartCoordinates = coords;
|
|
153
168
|
if (!e.shiftKey && e.buttons === MOUSE_BUTTONS.PRIMARY) {
|
|
154
|
-
pointerDownTimestamp = Date.now();
|
|
155
|
-
mouseStartCoordinates = coords;
|
|
156
169
|
const interacted = getInteractedElement(e);
|
|
157
170
|
pointerDownElement = interacted;
|
|
158
171
|
if (interacted) {
|
|
@@ -161,6 +174,17 @@ function onPointerDown(e) {
|
|
|
161
174
|
}
|
|
162
175
|
eventBus.emit("mouse:down", { ...coords, type: "mouse", distance: 0 });
|
|
163
176
|
}
|
|
177
|
+
function isClickInArtboard(coords) {
|
|
178
|
+
const size = ui.artboardSize.value;
|
|
179
|
+
const scale = ui.artboardScale.value;
|
|
180
|
+
const rect = {
|
|
181
|
+
x: ui.artboardOffset.value.x,
|
|
182
|
+
y: ui.artboardOffset.value.y,
|
|
183
|
+
width: size.width * scale,
|
|
184
|
+
height: size.height * scale
|
|
185
|
+
};
|
|
186
|
+
return isInsideRect(coords.x, coords.y, rect);
|
|
187
|
+
}
|
|
164
188
|
function onPointerUp(e) {
|
|
165
189
|
rootEl.removeEventListener("pointermove", onPointerMove);
|
|
166
190
|
if (e.button === MOUSE_BUTTON.AUXILIARY) {
|
|
@@ -236,6 +260,11 @@ function onPointerUp(e) {
|
|
|
236
260
|
return;
|
|
237
261
|
}
|
|
238
262
|
eventBus.emit("window:clickAway");
|
|
263
|
+
if (isClickInArtboard(coords)) {
|
|
264
|
+
eventBus.emit("select:host");
|
|
265
|
+
} else {
|
|
266
|
+
eventBus.emit("select:host:unselect");
|
|
267
|
+
}
|
|
239
268
|
}
|
|
240
269
|
let longPressTimeout = null;
|
|
241
270
|
let touchStartInteraction = null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Teleport to="body">
|
|
3
|
-
<Transition name="bk-loading">
|
|
3
|
+
<Transition :name="ui.useAnimations.value ? 'bk-loading' : void 0">
|
|
4
4
|
<Loading
|
|
5
5
|
v-if="isInitializing || !toolbarLoaded || !featuresLoaded"
|
|
6
6
|
screen
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
<Actions v-if="!isInitializing" />
|
|
30
30
|
<Toolbar @loaded="toolbarLoaded = true" />
|
|
31
31
|
<AppMenu v-if="toolbarLoaded" />
|
|
32
|
+
<Indicators />
|
|
32
33
|
<Features
|
|
33
34
|
v-if="!isInitializing && toolbarLoaded"
|
|
34
35
|
:key="route.fullPath"
|
|
@@ -36,6 +37,7 @@
|
|
|
36
37
|
/>
|
|
37
38
|
<DragInteractions v-if="!isInitializing" />
|
|
38
39
|
<AnimationCanvas v-if="!isInitializing" />
|
|
40
|
+
<Konami />
|
|
39
41
|
<SystemRequirements />
|
|
40
42
|
<slot
|
|
41
43
|
v-if="!isInitializing"
|
|
@@ -46,7 +48,6 @@
|
|
|
46
48
|
|
|
47
49
|
<script setup>
|
|
48
50
|
import {
|
|
49
|
-
watch,
|
|
50
51
|
ref,
|
|
51
52
|
computed,
|
|
52
53
|
provide,
|
|
@@ -54,18 +55,21 @@ import {
|
|
|
54
55
|
onBeforeUnmount,
|
|
55
56
|
useRoute,
|
|
56
57
|
useRuntimeConfig,
|
|
57
|
-
nextTick
|
|
58
|
+
nextTick,
|
|
59
|
+
inject
|
|
58
60
|
} from "#imports";
|
|
59
61
|
import Toolbar from "./Toolbar/index.vue";
|
|
60
62
|
import Actions from "./Actions/index.vue";
|
|
61
63
|
import Loading from "./Loading/index.vue";
|
|
62
64
|
import Messages from "./Messages/index.vue";
|
|
63
65
|
import Features from "./Features/index.vue";
|
|
66
|
+
import Indicators from "./Indicators/index.vue";
|
|
64
67
|
import AppMenu from "./AppMenu/index.vue";
|
|
65
68
|
import DraggableList from "./DraggableList.vue";
|
|
66
69
|
import DragInteractions from "./DragInteractions/index.vue";
|
|
67
70
|
import AnimationCanvas from "./AnimationCanvas/index.vue";
|
|
68
71
|
import SystemRequirements from "./SystemRequirements/index.vue";
|
|
72
|
+
import Konami from "./Konami/index.vue";
|
|
69
73
|
import animationProvider from "./../../helpers/animationProvider";
|
|
70
74
|
import keyboardProvider from "./../../helpers/keyboardProvider";
|
|
71
75
|
import selectionProvider from "./../../helpers/selectionProvider";
|
|
@@ -83,6 +87,8 @@ import tourProvider from "./../../helpers/tourProvider";
|
|
|
83
87
|
import debugProvider from "./../../helpers/debugProvider";
|
|
84
88
|
import definitionProvider from "./../../helpers/definitionProvider";
|
|
85
89
|
import dropAreasProvider from "./../../helpers/dropAreaProvider";
|
|
90
|
+
import indicatorsProvider from "./../../helpers/indicatorsProvider";
|
|
91
|
+
import pluginProvider from "./../../helpers/pluginProvider";
|
|
86
92
|
import { eventBus } from "#blokkli/helpers/eventBus";
|
|
87
93
|
import "#blokkli-build/styles.css";
|
|
88
94
|
import getAdapter from "#blokkli-build/edit-adapter";
|
|
@@ -92,9 +98,11 @@ import {
|
|
|
92
98
|
INJECT_EDIT_FIELD_LIST_COMPONENT,
|
|
93
99
|
INJECT_EDIT_LOGGER,
|
|
94
100
|
INJECT_GLOBAL_PROXY_MODE,
|
|
95
|
-
INJECT_IS_EDITING
|
|
101
|
+
INJECT_IS_EDITING,
|
|
102
|
+
INJECT_PROVIDER_KEY
|
|
96
103
|
} from "#blokkli/helpers/symbols";
|
|
97
104
|
import { useBlockRegistration } from "#blokkli/helpers/composables/useBlockRegistration";
|
|
105
|
+
import { addElementClasses } from "#blokkli/helpers/addElementClasses";
|
|
98
106
|
const props = defineProps({
|
|
99
107
|
entity: { type: null, required: false, default: void 0 },
|
|
100
108
|
entityType: { type: String, required: true },
|
|
@@ -113,6 +121,7 @@ const context = computed(() => {
|
|
|
113
121
|
};
|
|
114
122
|
});
|
|
115
123
|
const adapter = await getAdapter(context);
|
|
124
|
+
const providerKey = inject(INJECT_PROVIDER_KEY, "");
|
|
116
125
|
const route = useRoute();
|
|
117
126
|
const runtimeConfig = useRuntimeConfig().public.blokkli;
|
|
118
127
|
const toolbarLoaded = ref(false);
|
|
@@ -120,8 +129,8 @@ const featuresLoaded = ref(false);
|
|
|
120
129
|
const isInitializing = ref(true);
|
|
121
130
|
const definitions = definitionProvider();
|
|
122
131
|
const $t = textProvider(context);
|
|
123
|
-
const state = await editStateProvider(adapter, context, $t);
|
|
124
|
-
const storage = storageProvider();
|
|
132
|
+
const state = await editStateProvider(adapter, context, $t, providerKey);
|
|
133
|
+
const storage = await storageProvider(adapter);
|
|
125
134
|
const debug = debugProvider(storage);
|
|
126
135
|
const features = featuresProvider(storage);
|
|
127
136
|
const theme = themeProvider();
|
|
@@ -129,12 +138,14 @@ const commands = commandsProvider();
|
|
|
129
138
|
const tour = tourProvider();
|
|
130
139
|
const dropAreas = dropAreasProvider();
|
|
131
140
|
const broadcast = broadcastProvider();
|
|
132
|
-
const ui = uiProvider(storage, state);
|
|
141
|
+
const ui = uiProvider(storage, state, context);
|
|
133
142
|
const dom = domProvider(ui, debug, definitions);
|
|
134
|
-
const animation = animationProvider(ui);
|
|
143
|
+
const animation = animationProvider(ui, storage);
|
|
135
144
|
const keyboard = keyboardProvider(animation);
|
|
136
145
|
const selection = selectionProvider(dom);
|
|
137
146
|
const types = await typesProvider(adapter, selection, context);
|
|
147
|
+
const indicators = indicatorsProvider();
|
|
148
|
+
const plugins = pluginProvider();
|
|
138
149
|
const mutatedEntity = computed(() => state.mutatedEntity.value || props.entity);
|
|
139
150
|
const onContextMenu = (e) => {
|
|
140
151
|
e.preventDefault();
|
|
@@ -148,22 +159,22 @@ function onTouchStart(e) {
|
|
|
148
159
|
e.preventDefault();
|
|
149
160
|
}
|
|
150
161
|
}
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
162
|
+
const shouldIsolate = computed(() => props.isolate);
|
|
163
|
+
addElementClasses(
|
|
164
|
+
document.documentElement,
|
|
165
|
+
"bk-use-animations",
|
|
166
|
+
ui.useAnimations
|
|
167
|
+
);
|
|
168
|
+
addElementClasses(
|
|
169
|
+
document.documentElement,
|
|
170
|
+
"bk-isolate-provider",
|
|
171
|
+
shouldIsolate
|
|
172
|
+
);
|
|
158
173
|
const baseLogger = debug.createLogger("EditProvider");
|
|
159
174
|
onMounted(() => {
|
|
160
175
|
window.addEventListener("contextmenu", onContextMenu);
|
|
161
|
-
if (props.isolate) {
|
|
162
|
-
document.documentElement.classList.add("bk-isolate-provider");
|
|
163
|
-
}
|
|
164
176
|
document.documentElement.addEventListener("touchmove", onTouchMove);
|
|
165
177
|
document.documentElement.addEventListener("touchstart", onTouchStart);
|
|
166
|
-
setRootClasses();
|
|
167
178
|
baseLogger.log("EditProvider mounted");
|
|
168
179
|
dom.init();
|
|
169
180
|
isInitializing.value = false;
|
|
@@ -173,10 +184,8 @@ onBeforeUnmount(() => {
|
|
|
173
184
|
window.removeEventListener("contextmenu", onContextMenu);
|
|
174
185
|
isInitializing.value = true;
|
|
175
186
|
toolbarLoaded.value = false;
|
|
176
|
-
document.documentElement.classList.remove("bk-isolate-provider");
|
|
177
187
|
document.documentElement.removeEventListener("touchmove", onTouchMove);
|
|
178
188
|
document.documentElement.removeEventListener("touchstart", onTouchStart);
|
|
179
|
-
setRootClasses(true);
|
|
180
189
|
});
|
|
181
190
|
provide(INJECT_EDIT_LOGGER, baseLogger);
|
|
182
191
|
provide(INJECT_EDIT_FIELD_LIST_COMPONENT, DraggableList);
|
|
@@ -189,27 +198,29 @@ provide(INJECT_EDIT_CONTEXT, {
|
|
|
189
198
|
useBlockRegistration
|
|
190
199
|
});
|
|
191
200
|
provide(INJECT_APP, {
|
|
201
|
+
$t,
|
|
192
202
|
adapter,
|
|
203
|
+
animation,
|
|
204
|
+
broadcast,
|
|
205
|
+
commands,
|
|
206
|
+
context,
|
|
207
|
+
debug,
|
|
208
|
+
definitions,
|
|
209
|
+
dom,
|
|
210
|
+
dropAreas,
|
|
193
211
|
eventBus,
|
|
212
|
+
features,
|
|
213
|
+
indicators,
|
|
214
|
+
keyboard,
|
|
215
|
+
plugins,
|
|
194
216
|
runtimeConfig,
|
|
217
|
+
selection,
|
|
195
218
|
state,
|
|
196
|
-
dom,
|
|
197
219
|
storage,
|
|
198
|
-
types,
|
|
199
|
-
selection,
|
|
200
|
-
keyboard,
|
|
201
|
-
ui,
|
|
202
|
-
animation,
|
|
203
|
-
context,
|
|
204
|
-
$t,
|
|
205
|
-
broadcast,
|
|
206
|
-
features,
|
|
207
220
|
theme,
|
|
208
|
-
commands,
|
|
209
221
|
tour,
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
definitions
|
|
222
|
+
types,
|
|
223
|
+
ui
|
|
213
224
|
});
|
|
214
225
|
const isProxyMode = computed(() => ui.isProxyMode.value);
|
|
215
226
|
provide(INJECT_GLOBAL_PROXY_MODE, isProxyMode);
|
|
@@ -50,13 +50,12 @@ import {
|
|
|
50
50
|
ref,
|
|
51
51
|
computed,
|
|
52
52
|
useBlokkli,
|
|
53
|
-
onMounted,
|
|
54
|
-
onBeforeUnmount,
|
|
55
53
|
nextTick,
|
|
56
54
|
defineBlokkliFeature
|
|
57
55
|
} from "#imports";
|
|
58
56
|
import { Sortli } from "#blokkli/components";
|
|
59
57
|
import { PluginSidebar, PluginTourItem } from "#blokkli/plugins";
|
|
58
|
+
import { addElementClasses } from "#blokkli/helpers/addElementClasses";
|
|
60
59
|
const { settings } = defineBlokkliFeature({
|
|
61
60
|
id: "add-list",
|
|
62
61
|
icon: "plus",
|
|
@@ -94,14 +93,10 @@ const hasContextMenuOpen = computed(
|
|
|
94
93
|
const isSidebar = computed(() => ui.addListOrientation.value === "sidebar");
|
|
95
94
|
const shouldRender = computed(() => state.editMode.value === "editing");
|
|
96
95
|
watch(ui.addListOrientation, () => {
|
|
97
|
-
setRootClasses();
|
|
98
96
|
nextTick(() => {
|
|
99
97
|
eventBus.emit("add-list:change");
|
|
100
98
|
});
|
|
101
99
|
});
|
|
102
|
-
watch(shouldRender, () => {
|
|
103
|
-
setRootClasses();
|
|
104
|
-
});
|
|
105
100
|
const CLASS_LEFT = "bk-has-add-list-left";
|
|
106
101
|
const CLASS_BOTTOM = "bk-has-add-list-bottom";
|
|
107
102
|
const wrapper = ref(null);
|
|
@@ -146,18 +141,6 @@ const onWheel = (e) => {
|
|
|
146
141
|
e.stopPropagation();
|
|
147
142
|
}
|
|
148
143
|
};
|
|
149
|
-
function setRootClasses() {
|
|
150
|
-
document.documentElement.classList.remove(CLASS_BOTTOM);
|
|
151
|
-
document.documentElement.classList.remove(CLASS_LEFT);
|
|
152
|
-
if (!shouldRender.value) {
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
if (ui.addListOrientation.value === "horizontal") {
|
|
156
|
-
document.documentElement.classList.add(CLASS_BOTTOM);
|
|
157
|
-
} else if (ui.addListOrientation.value === "vertical") {
|
|
158
|
-
document.documentElement.classList.add(CLASS_LEFT);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
144
|
const sidebarTitle = computed(() => $t("addListSidebarTitle", "Add blocks"));
|
|
162
145
|
const tourText = computed(
|
|
163
146
|
() => $t(
|
|
@@ -165,13 +148,20 @@ const tourText = computed(
|
|
|
165
148
|
"<p>This shows the list of available blocks that can be placed. Add a block by dragging the icon into the page.</p><p>When an existing block is selected, some blocks may be greyed out. This indicates which blocks can be placed inside or after the selected block.</p>"
|
|
166
149
|
)
|
|
167
150
|
);
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
151
|
+
addElementClasses(
|
|
152
|
+
document.documentElement,
|
|
153
|
+
CLASS_BOTTOM,
|
|
154
|
+
computed(
|
|
155
|
+
() => ui.addListOrientation.value === "horizontal" && shouldRender.value
|
|
156
|
+
)
|
|
157
|
+
);
|
|
158
|
+
addElementClasses(
|
|
159
|
+
document.documentElement,
|
|
160
|
+
CLASS_LEFT,
|
|
161
|
+
computed(
|
|
162
|
+
() => ui.addListOrientation.value === "vertical" && shouldRender.value
|
|
163
|
+
)
|
|
164
|
+
);
|
|
175
165
|
</script>
|
|
176
166
|
|
|
177
167
|
<script>
|