@blokkli/editor 1.4.0-alpha.0 → 1.4.0-alpha.1
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 +71 -2
- package/dist/module.d.ts +71 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +293 -115
- package/dist/runtime/blokkliPlugins/AddAction/index.vue +1 -1
- package/dist/runtime/blokkliPlugins/DroppableEdit/index.vue +1 -1
- package/dist/runtime/blokkliPlugins/ItemAction/index.vue +1 -1
- package/dist/runtime/blokkliPlugins/MenuButton/index.vue +1 -1
- package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue +1 -1
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue +1 -1
- package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue +1 -1
- package/dist/runtime/blokkliPlugins/ViewOption/index.vue +1 -1
- package/dist/runtime/components/Blocks/Fragment/index.vue +7 -4
- package/dist/runtime/components/Blocks/FromLibrary/index.vue +8 -5
- package/dist/runtime/components/BlokkliField.vue +2 -2
- package/dist/runtime/components/BlokkliItem.vue +2 -2
- package/dist/runtime/components/Edit/Actions/index.vue +1 -1
- package/dist/runtime/components/Edit/AddListItem/index.vue +1 -1
- package/dist/runtime/components/Edit/AppMenu/index.vue +1 -1
- package/dist/runtime/components/Edit/BlockProxy/index.vue +3 -5
- package/dist/runtime/components/Edit/Dialog/index.vue +1 -1
- package/dist/runtime/components/Edit/DraggableList.vue +2 -2
- package/dist/runtime/components/Edit/EditIndicator.vue +2 -2
- package/dist/runtime/components/Edit/EditProvider.vue +3 -4
- package/dist/runtime/components/Edit/Features/Artboard/index.vue +9 -8
- package/dist/runtime/components/Edit/Features/BlockAddList/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Debug/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Diff/DiffView/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/DraggingOverlay/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Edit/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/EditForm/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Fragments/Dialog/Item/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Fragments/Dialog/index.vue +38 -32
- package/dist/runtime/components/Edit/Features/Library/LibraryDialog/Item/index.vue +13 -6
- package/dist/runtime/components/Edit/Features/Library/LibraryDialog/index.vue +65 -67
- package/dist/runtime/components/Edit/Features/Library/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/Item.vue +1 -1
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue +3 -11
- package/dist/runtime/components/Edit/Features/MediaLibrary/types.d.ts +1 -1
- package/dist/runtime/components/Edit/Features/Options/Form/index.vue +28 -3
- package/dist/runtime/components/Edit/Features/Options/index.vue +4 -1
- package/dist/runtime/components/Edit/Features/Publish/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/ResponsivePreview/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Settings/Dialog/FeatureSetting/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Settings/Dialog/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/Theme/Color/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Theme/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Translations/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/index.vue +1 -1
- package/dist/runtime/components/Edit/FormOverlay/Header/index.vue +1 -1
- package/dist/runtime/components/Edit/FormOverlay/index.vue +1 -1
- package/dist/runtime/components/Edit/Icon/index.vue +2 -2
- package/dist/runtime/components/Edit/ItemIcon/index.vue +1 -1
- package/dist/runtime/components/Edit/Pagination/index.vue +21 -0
- package/dist/runtime/components/Edit/PreviewProvider.vue +2 -2
- package/dist/runtime/components/Edit/ScaleToFit/index.vue +37 -6
- package/dist/runtime/components/Edit/index.d.ts +2 -1
- package/dist/runtime/components/Edit/index.js +3 -1
- package/dist/runtime/composables/defineBlokkli.d.ts +2 -2
- package/dist/runtime/composables/defineBlokkli.js +17 -22
- package/dist/runtime/composables/defineBlokkliFeature.d.ts +1 -1
- package/dist/runtime/composables/defineBlokkliFeature.js +1 -1
- package/dist/runtime/composables/defineBlokkliFragment.d.ts +1 -1
- package/dist/runtime/composables/defineBlokkliFragment.js +1 -1
- package/dist/runtime/css/output.css +1 -1
- package/dist/runtime/helpers/domProvider.js +1 -1
- package/dist/runtime/helpers/featuresProvider.d.ts +1 -1
- package/dist/runtime/helpers/featuresProvider.js +1 -1
- package/dist/runtime/helpers/index.d.ts +1 -0
- package/dist/runtime/helpers/index.js +7 -1
- package/dist/runtime/helpers/runtimeHelpers/index.d.ts +23 -2
- package/dist/runtime/helpers/runtimeHelpers/index.js +83 -10
- package/dist/runtime/helpers/storageProvider.js +1 -1
- package/dist/runtime/helpers/textProvider.js +2 -2
- package/dist/runtime/helpers/themeProvider.js +1 -1
- package/dist/runtime/types/index.d.ts +7 -4
- package/package.json +2 -2
- package/dist/runtime/helpers/options.d.ts +0 -2
- package/dist/runtime/helpers/options.js +0 -21
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
<script lang="ts" setup>
|
|
32
32
|
import { computed, ref, useBlokkli } from '#imports'
|
|
33
33
|
|
|
34
|
-
import type { BlokkliIcon } from '#blokkli/icons'
|
|
34
|
+
import type { BlokkliIcon } from '#blokkli-build/icons'
|
|
35
35
|
import { Icon, ShortcutIndicator } from '#blokkli/components'
|
|
36
36
|
import type { DraggableExistingBlock } from '#blokkli/types'
|
|
37
37
|
import defineCommands from '#blokkli/helpers/composables/defineCommands'
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
<script lang="ts" setup>
|
|
23
23
|
import { computed, useBlokkli } from '#imports'
|
|
24
|
-
import type { BlokkliIcon } from '#blokkli/icons'
|
|
24
|
+
import type { BlokkliIcon } from '#blokkli-build/icons'
|
|
25
25
|
import { Icon } from '#blokkli/components'
|
|
26
26
|
import defineCommands from '#blokkli/helpers/composables/defineCommands'
|
|
27
27
|
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
useState,
|
|
65
65
|
} from '#imports'
|
|
66
66
|
import { Icon, ViewportBlockingRect, ScrollBoundary } from '#blokkli/components'
|
|
67
|
-
import type { BlokkliIcon } from '#blokkli/icons'
|
|
67
|
+
import type { BlokkliIcon } from '#blokkli-build/icons'
|
|
68
68
|
import onBlokkliEvent from '#blokkli/helpers/composables/onBlokkliEvent'
|
|
69
69
|
|
|
70
70
|
const props = withDefaults(
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
|
|
101
101
|
<script setup lang="ts">
|
|
102
102
|
import { computed, watch, ref, useBlokkli } from '#imports'
|
|
103
|
-
import type { BlokkliIcon } from '#blokkli/icons'
|
|
103
|
+
import type { BlokkliIcon } from '#blokkli-build/icons'
|
|
104
104
|
import { Icon, ShortcutIndicator, ScrollBoundary } from '#blokkli/components'
|
|
105
105
|
import SidebarDetached from './Detached/index.vue'
|
|
106
106
|
import defineCommands from '#blokkli/helpers/composables/defineCommands'
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
<script setup lang="ts">
|
|
31
31
|
import { ShortcutIndicator, Icon } from '#blokkli/components'
|
|
32
|
-
import type { BlokkliIcon } from '#blokkli/icons'
|
|
32
|
+
import type { BlokkliIcon } from '#blokkli-build/icons'
|
|
33
33
|
import { ref } from '#imports'
|
|
34
34
|
import defineCommands from '#blokkli/helpers/composables/defineCommands'
|
|
35
35
|
import defineTourItem from '#blokkli/helpers/composables/defineTourItem'
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<script setup lang="ts">
|
|
33
33
|
import { useBlokkli, computed, ref } from '#imports'
|
|
34
34
|
import { ShortcutIndicator, Icon } from '#blokkli/components'
|
|
35
|
-
import type { BlokkliIcon } from '#blokkli/icons'
|
|
35
|
+
import type { BlokkliIcon } from '#blokkli-build/icons'
|
|
36
36
|
import defineCommands from '#blokkli/helpers/composables/defineCommands'
|
|
37
37
|
import defineTourItem from '#blokkli/helpers/composables/defineTourItem'
|
|
38
38
|
|
|
@@ -3,13 +3,16 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script lang="ts" setup>
|
|
6
|
-
import { getBlokkliFragmentComponent } from '#blokkli/imports'
|
|
6
|
+
import { getBlokkliFragmentComponent } from '#blokkli-build/imports'
|
|
7
7
|
import { provide, defineBlokkli } from '#imports'
|
|
8
8
|
import { INJECT_FRAGMENT_CONTEXT } from '#blokkli/helpers/symbols'
|
|
9
|
+
import type { BlokkliFragmentName } from '#blokkli-build/definitions'
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
name:
|
|
12
|
-
}
|
|
11
|
+
export type Props = {
|
|
12
|
+
name: BlokkliFragmentName
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const componentProps = defineProps<Props>()
|
|
13
16
|
|
|
14
17
|
const ctx = defineBlokkli({
|
|
15
18
|
bundle: 'blokkli_fragment',
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
v-if="item"
|
|
4
4
|
:key="item.uuid"
|
|
5
5
|
v-bind="item"
|
|
6
|
-
:index
|
|
6
|
+
:index
|
|
7
7
|
:data-reusable-bundle="item.bundle"
|
|
8
8
|
:data-reusable-uuid="item.uuid"
|
|
9
9
|
:data-bk-library-label="libraryItem?.label"
|
|
10
10
|
:data-bk-library-item-uuid="libraryItem?.uuid"
|
|
11
11
|
data-blokkli-is-reusable="true"
|
|
12
|
-
:parent-type
|
|
12
|
+
:parent-type
|
|
13
|
+
:is-editing
|
|
13
14
|
/>
|
|
14
15
|
</template>
|
|
15
16
|
|
|
@@ -21,11 +22,13 @@ import {
|
|
|
21
22
|
} from '#blokkli/helpers/symbols'
|
|
22
23
|
import type { LibraryItemProps } from '#blokkli/types'
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
export type Props = {
|
|
25
26
|
libraryItem?: LibraryItemProps
|
|
26
|
-
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const props = defineProps<Props>()
|
|
27
30
|
|
|
28
|
-
const { index, options, parentType } = defineBlokkli({
|
|
31
|
+
const { index, options, parentType, isEditing } = defineBlokkli({
|
|
29
32
|
bundle: 'from_library',
|
|
30
33
|
})
|
|
31
34
|
|
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
ref,
|
|
57
57
|
type ComputedRef,
|
|
58
58
|
} from '#imports'
|
|
59
|
-
import type { BlokkliFragmentName } from '#blokkli/definitions'
|
|
59
|
+
import type { BlokkliFragmentName } from '#blokkli-build/definitions'
|
|
60
60
|
import { isVisibleByOptions } from '#blokkli/helpers/runtimeHelpers'
|
|
61
61
|
import BlokkliItem from './BlokkliItem.vue'
|
|
62
62
|
|
|
@@ -70,7 +70,7 @@ import type {
|
|
|
70
70
|
import type {
|
|
71
71
|
ValidFieldListTypes,
|
|
72
72
|
FieldListItemTyped,
|
|
73
|
-
} from '#blokkli/generated-types'
|
|
73
|
+
} from '#blokkli-build/generated-types'
|
|
74
74
|
import {
|
|
75
75
|
INJECT_ENTITY_CONTEXT,
|
|
76
76
|
INJECT_FIELD_LIST_TYPE,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
type ComputedRef,
|
|
28
28
|
} from '#imports'
|
|
29
29
|
import type { InjectedBlokkliItem } from '#blokkli/types'
|
|
30
|
-
import { getBlokkliItemComponent } from '#blokkli/imports'
|
|
30
|
+
import { getBlokkliItemComponent } from '#blokkli-build/imports'
|
|
31
31
|
import {
|
|
32
32
|
INJECT_BLOCK_ITEM,
|
|
33
33
|
INJECT_ENTITY_CONTEXT,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
import type {
|
|
40
40
|
BlockBundleWithNested,
|
|
41
41
|
ValidFieldListTypes,
|
|
42
|
-
} from '#blokkli/generated-types'
|
|
42
|
+
} from '#blokkli-build/generated-types'
|
|
43
43
|
|
|
44
44
|
const itemEntityType = useRuntimeConfig().public.blokkli.itemEntityType
|
|
45
45
|
|
|
@@ -79,7 +79,7 @@ import { onlyUnique, findIdealRectPosition, falsy } from '#blokkli/helpers'
|
|
|
79
79
|
import type { Rectangle, PluginMountEvent } from '#blokkli/types'
|
|
80
80
|
import { ItemIcon, Icon } from '#blokkli/components'
|
|
81
81
|
import onBlokkliEvent from '#blokkli/helpers/composables/onBlokkliEvent'
|
|
82
|
-
import { getFragmentDefinition } from '#blokkli/definitions'
|
|
82
|
+
import { getFragmentDefinition } from '#blokkli-build/definitions'
|
|
83
83
|
|
|
84
84
|
const { selection, $t, types, state, ui, dom } = useBlokkli()
|
|
85
85
|
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
</template>
|
|
45
45
|
|
|
46
46
|
<script lang="ts" setup>
|
|
47
|
-
import type { BlokkliIcon } from '#blokkli/icons'
|
|
47
|
+
import type { BlokkliIcon } from '#blokkli-build/icons'
|
|
48
48
|
import type { AddListOrientation, ContextMenu } from '#blokkli/types'
|
|
49
49
|
import { useBlokkli, computed, ref } from '#imports'
|
|
50
50
|
import { ItemIcon, Icon } from '#blokkli/components'
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
<script setup lang="ts">
|
|
42
42
|
import { computed, useBlokkli } from '#imports'
|
|
43
43
|
import { Icon } from '#blokkli/components'
|
|
44
|
-
import { blokkliVersion } from '#blokkli/config'
|
|
44
|
+
import { blokkliVersion } from '#blokkli-build/config'
|
|
45
45
|
|
|
46
46
|
const { ui, eventBus } = useBlokkli()
|
|
47
47
|
|
|
@@ -33,12 +33,10 @@
|
|
|
33
33
|
import type {
|
|
34
34
|
BlockBundleWithNested,
|
|
35
35
|
ValidFieldListTypes,
|
|
36
|
-
} from '#blokkli/generated-types'
|
|
36
|
+
} from '#blokkli-build/generated-types'
|
|
37
37
|
import { computed, useBlokkli, ref } from '#imports'
|
|
38
|
-
import {
|
|
39
|
-
|
|
40
|
-
getBlokkliItemProxyComponent,
|
|
41
|
-
} from '#blokkli/definitions'
|
|
38
|
+
import { getDefinition } from '#blokkli-build/definitions'
|
|
39
|
+
import { getBlokkliItemProxyComponent } from '#blokkli-build/edit-components'
|
|
42
40
|
|
|
43
41
|
import { ItemIcon } from '#blokkli/components'
|
|
44
42
|
import type { FieldConfig, LibraryItemProps } from '#blokkli/types'
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
|
|
52
52
|
<script lang="ts" setup>
|
|
53
53
|
import { useBlokkli, onMounted, computed, ref } from '#imports'
|
|
54
|
-
import type { BlokkliIcon } from '#blokkli/icons'
|
|
54
|
+
import type { BlokkliIcon } from '#blokkli-build/icons'
|
|
55
55
|
import { Icon } from '#blokkli/components'
|
|
56
56
|
import { modulo } from '#blokkli/helpers'
|
|
57
57
|
|
|
@@ -91,14 +91,14 @@ import {
|
|
|
91
91
|
watch,
|
|
92
92
|
} from '#imports'
|
|
93
93
|
import type { FieldListItem, EntityContext, FieldConfig } from '#blokkli/types'
|
|
94
|
-
import type { BlokkliFragmentName } from '#blokkli/definitions'
|
|
94
|
+
import type { BlokkliFragmentName } from '#blokkli-build/definitions'
|
|
95
95
|
import BlokkliItem from './../BlokkliItem.vue'
|
|
96
96
|
import { isVisibleByOptions } from '#blokkli/helpers/runtimeHelpers'
|
|
97
97
|
import {
|
|
98
98
|
INJECT_FIELD_PROXY_MODE,
|
|
99
99
|
INJECT_IS_EDITING,
|
|
100
100
|
} from '#blokkli/helpers/symbols'
|
|
101
|
-
import type { FieldListItemTyped } from '#blokkli/generated-types'
|
|
101
|
+
import type { FieldListItemTyped } from '#blokkli-build/generated-types'
|
|
102
102
|
|
|
103
103
|
const { dom, types, runtimeConfig, selection } = useBlokkli()
|
|
104
104
|
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
<script lang="ts" setup>
|
|
26
26
|
import textProvider from '#blokkli/helpers/textProvider'
|
|
27
27
|
import { ref, computed } from '#imports'
|
|
28
|
-
import '#blokkli/theme'
|
|
29
|
-
import '#blokkli/styles'
|
|
28
|
+
import '#blokkli-build/theme'
|
|
29
|
+
import '#blokkli-build/styles'
|
|
30
30
|
import useAnimationFrame from '#blokkli/helpers/composables/useAnimationFrame'
|
|
31
31
|
|
|
32
32
|
const props = defineProps<{
|
|
@@ -48,7 +48,6 @@ import {
|
|
|
48
48
|
provide,
|
|
49
49
|
onMounted,
|
|
50
50
|
onBeforeUnmount,
|
|
51
|
-
nextTick,
|
|
52
51
|
useRoute,
|
|
53
52
|
useRuntimeConfig,
|
|
54
53
|
} from '#imports'
|
|
@@ -80,9 +79,9 @@ import tourProvider from './../../helpers/tourProvider'
|
|
|
80
79
|
import debugProvider from './../../helpers/debugProvider'
|
|
81
80
|
import dropAreasProvider from './../../helpers/dropAreaProvider'
|
|
82
81
|
import { eventBus } from '#blokkli/helpers/eventBus'
|
|
83
|
-
import '#blokkli/theme'
|
|
84
|
-
import '#blokkli/styles'
|
|
85
|
-
import getAdapter from '#blokkli/compiled-edit-adapter'
|
|
82
|
+
import '#blokkli-build/theme'
|
|
83
|
+
import '#blokkli-build/styles'
|
|
84
|
+
import getAdapter from '#blokkli-build/compiled-edit-adapter'
|
|
86
85
|
import {
|
|
87
86
|
INJECT_APP,
|
|
88
87
|
INJECT_EDIT_CONTEXT,
|
|
@@ -56,6 +56,7 @@ import {
|
|
|
56
56
|
} from '#imports'
|
|
57
57
|
import type { Coord } from '#blokkli/types'
|
|
58
58
|
import { PluginToolbarButton, PluginViewOption } from '#blokkli/plugins'
|
|
59
|
+
import { asValidNumber } from '#blokkli/helpers'
|
|
59
60
|
import Overview from './Overview/index.vue'
|
|
60
61
|
import Scrollbar from './Scrollbar/index.vue'
|
|
61
62
|
import onBlokkliEvent from '#blokkli/helpers/composables/onBlokkliEvent'
|
|
@@ -71,6 +72,7 @@ import {
|
|
|
71
72
|
mouse,
|
|
72
73
|
dom as domPlugin,
|
|
73
74
|
} from 'artboard-deluxe'
|
|
75
|
+
|
|
74
76
|
const { settings } = defineBlokkliFeature({
|
|
75
77
|
id: 'artboard',
|
|
76
78
|
label: 'Artboard',
|
|
@@ -189,8 +191,7 @@ function getArtboard(): Artboard {
|
|
|
189
191
|
pluginWheel,
|
|
190
192
|
domPlugin({
|
|
191
193
|
element: ui.artboardElement(),
|
|
192
|
-
|
|
193
|
-
precision: 0.1,
|
|
194
|
+
precision: 1,
|
|
194
195
|
restoreStyles: true,
|
|
195
196
|
}),
|
|
196
197
|
],
|
|
@@ -198,9 +199,9 @@ function getArtboard(): Artboard {
|
|
|
198
199
|
initTransform:
|
|
199
200
|
savedState.value && settings.value.persist
|
|
200
201
|
? {
|
|
201
|
-
x: savedState.value.offset.x,
|
|
202
|
-
y: savedState.value.offset.y,
|
|
203
|
-
scale: savedState.value?.scale
|
|
202
|
+
x: asValidNumber(savedState.value.offset.x, 0),
|
|
203
|
+
y: asValidNumber(savedState.value.offset.y, 0),
|
|
204
|
+
scale: asValidNumber(savedState.value?.scale, 1),
|
|
204
205
|
}
|
|
205
206
|
: undefined,
|
|
206
207
|
...options.value,
|
|
@@ -226,9 +227,9 @@ onBlokkliEvent('animationFrame:before', (time) => {
|
|
|
226
227
|
|
|
227
228
|
// We don't need much precision here, so we can round it.
|
|
228
229
|
// This also prevents updating rects in WebGL buffers for small changes.
|
|
229
|
-
ui.artboardOffset.value.x = Math.ceil(offset.x)
|
|
230
|
-
ui.artboardOffset.value.y = Math.ceil(offset.y)
|
|
231
|
-
ui.artboardScale.value = artboard.getScale()
|
|
230
|
+
ui.artboardOffset.value.x = asValidNumber(Math.ceil(offset.x), 0)
|
|
231
|
+
ui.artboardOffset.value.y = asValidNumber(Math.ceil(offset.y), 0)
|
|
232
|
+
ui.artboardScale.value = asValidNumber(artboard.getScale(), 1)
|
|
232
233
|
animation.requestDraw()
|
|
233
234
|
})
|
|
234
235
|
|
|
@@ -65,7 +65,7 @@ import type {
|
|
|
65
65
|
DraggableExistingBlock,
|
|
66
66
|
FieldConfig,
|
|
67
67
|
} from '#blokkli/types'
|
|
68
|
-
import { getDefaultDefinition } from '#blokkli/definitions'
|
|
68
|
+
import { getDefaultDefinition } from '#blokkli-build/definitions'
|
|
69
69
|
import defineCommands from '#blokkli/helpers/composables/defineCommands'
|
|
70
70
|
import onBlokkliEvent from '#blokkli/helpers/composables/onBlokkliEvent'
|
|
71
71
|
import { PluginTourItem } from '#blokkli/plugins'
|
|
@@ -125,8 +125,8 @@ import {
|
|
|
125
125
|
} from '#imports'
|
|
126
126
|
import { PluginSidebar, PluginDebugOverlay } from '#blokkli/plugins'
|
|
127
127
|
import { Icon } from '#blokkli/components'
|
|
128
|
-
import { icons, type BlokkliIcon } from '#blokkli/icons'
|
|
129
|
-
import { featureComponents } from '#blokkli-
|
|
128
|
+
import { icons, type BlokkliIcon } from '#blokkli-build/icons'
|
|
129
|
+
import { featureComponents } from '#blokkli-build/features'
|
|
130
130
|
import onBlokkliEvent from '#blokkli/helpers/composables/onBlokkliEvent'
|
|
131
131
|
import DebugViewport from './Viewport/index.vue'
|
|
132
132
|
import DebugRects from './Rects/index.vue'
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
import { computed, useBlokkli } from '#imports'
|
|
84
84
|
import type { FieldListItem, MutatedField } from '#blokkli/types'
|
|
85
85
|
import { ItemIcon } from '#blokkli/components'
|
|
86
|
-
import { getDefaultDefinition } from '#blokkli/definitions'
|
|
86
|
+
import { getDefaultDefinition } from '#blokkli-build/definitions'
|
|
87
87
|
import diff from 'html-diff-ts'
|
|
88
88
|
|
|
89
89
|
function getProps(bundle: string, props: any): Record<string, string> {
|
|
@@ -48,7 +48,7 @@ import type {
|
|
|
48
48
|
Rectangle,
|
|
49
49
|
DraggableExistingStructureBlock,
|
|
50
50
|
} from '#blokkli/types'
|
|
51
|
-
import { getDefinition } from '#blokkli/definitions'
|
|
51
|
+
import { getDefinition } from '#blokkli-build/definitions'
|
|
52
52
|
import onBlokkliEvent from '#blokkli/helpers/composables/onBlokkliEvent'
|
|
53
53
|
|
|
54
54
|
const { adapter } = defineBlokkliFeature({
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import { computed, useBlokkli, defineBlokkliFeature } from '#imports'
|
|
17
17
|
import type { DraggableExistingBlock } from '#blokkli/types'
|
|
18
18
|
import { PluginItemAction } from '#blokkli/plugins'
|
|
19
|
-
import { getDefinition } from '#blokkli/definitions'
|
|
19
|
+
import { getDefinition } from '#blokkli-build/definitions'
|
|
20
20
|
import onBlokkliEvent from '#blokkli/helpers/composables/onBlokkliEvent'
|
|
21
21
|
|
|
22
22
|
defineBlokkliFeature({
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<script lang="ts" setup>
|
|
23
23
|
import { ref, computed, useBlokkli, defineBlokkliFeature } from '#imports'
|
|
24
24
|
import { FormOverlay } from '#blokkli/components'
|
|
25
|
-
import { getDefinition } from '#blokkli/definitions'
|
|
25
|
+
import { getDefinition } from '#blokkli-build/definitions'
|
|
26
26
|
import FormFrame from './Frame/index.vue'
|
|
27
27
|
import type { AdapterFormFrameBuilder } from '#blokkli/adapter'
|
|
28
28
|
import onBlokkliEvent from '#blokkli/helpers/composables/onBlokkliEvent'
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
class="bk-library-list-item-inner"
|
|
10
10
|
:class="backgroundClass"
|
|
11
11
|
>
|
|
12
|
-
<ScaleToFit :width="previewWidth">
|
|
12
|
+
<ScaleToFit :width="previewWidth" :max-height="500">
|
|
13
13
|
<BlokkliItem
|
|
14
14
|
v-bind="item"
|
|
15
15
|
parent-type="nested"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
<script setup lang="ts">
|
|
24
24
|
import { computed, provide } from '#imports'
|
|
25
|
-
import { getFragmentDefinition } from '#blokkli/definitions'
|
|
25
|
+
import { getFragmentDefinition } from '#blokkli-build/definitions'
|
|
26
26
|
import { ScaleToFit } from '#blokkli/components'
|
|
27
27
|
import {
|
|
28
28
|
INJECT_FIELD_LIST_BLOCKS,
|
|
@@ -15,38 +15,44 @@
|
|
|
15
15
|
}}
|
|
16
16
|
</p>
|
|
17
17
|
<div class="bk">
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
<div class="bk-form-group">
|
|
19
|
+
<div>
|
|
20
|
+
<label class="bk-form-label" for="library_search">
|
|
21
|
+
{{ $t('fragmentsPlaceDialogSearchLabel', 'Filter fragments') }}
|
|
22
|
+
</label>
|
|
23
|
+
<input
|
|
24
|
+
id="fragments_search"
|
|
25
|
+
v-model="searchText"
|
|
26
|
+
type="text"
|
|
27
|
+
class="bk-form-input"
|
|
28
|
+
:placeholder="
|
|
29
|
+
$t('fragmentsPlaceDialogSearchPlaceholder', 'Search fragments')
|
|
30
|
+
"
|
|
31
|
+
required
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="bk-library-dialog-content">
|
|
37
|
+
<ul class="bk-library-dialog-list">
|
|
38
|
+
<li
|
|
39
|
+
v-for="(item, index) in fragments"
|
|
40
|
+
:key="item.name"
|
|
41
|
+
:class="{
|
|
42
|
+
'bk-is-selected': selectedItem === item.name,
|
|
43
|
+
}"
|
|
44
|
+
@click="selectedItem = item.name"
|
|
45
|
+
>
|
|
46
|
+
<FragmentItem
|
|
47
|
+
v-show="visible === null || visible.includes(item.name)"
|
|
48
|
+
:name="item.name"
|
|
49
|
+
:label="item.label"
|
|
50
|
+
:description="item.description"
|
|
51
|
+
:index="index"
|
|
52
|
+
/>
|
|
53
|
+
</li>
|
|
54
|
+
</ul>
|
|
31
55
|
</div>
|
|
32
|
-
<ul class="bk-library-dialog-list">
|
|
33
|
-
<li
|
|
34
|
-
v-for="(item, index) in fragments"
|
|
35
|
-
:key="item.name"
|
|
36
|
-
:class="{
|
|
37
|
-
'bk-is-selected': selectedItem === item.name,
|
|
38
|
-
}"
|
|
39
|
-
@click="selectedItem = item.name"
|
|
40
|
-
>
|
|
41
|
-
<FragmentItem
|
|
42
|
-
v-show="visible === null || visible.includes(item.name)"
|
|
43
|
-
:name="item.name"
|
|
44
|
-
:label="item.label"
|
|
45
|
-
:description="item.description"
|
|
46
|
-
:index="index"
|
|
47
|
-
/>
|
|
48
|
-
</li>
|
|
49
|
-
</ul>
|
|
50
56
|
</div>
|
|
51
57
|
<template #footer>
|
|
52
58
|
<button class="bk-button bk-is-primary" @click="onSubmit">
|
|
@@ -58,7 +64,7 @@
|
|
|
58
64
|
|
|
59
65
|
<script setup lang="ts">
|
|
60
66
|
import { FormOverlay } from '#blokkli/components'
|
|
61
|
-
import { fragmentDefinitions } from '#blokkli/definitions'
|
|
67
|
+
import { fragmentDefinitions } from '#blokkli-build/definitions'
|
|
62
68
|
import { falsy } from '#blokkli/helpers'
|
|
63
69
|
import type { BlokkliFieldElement } from '#blokkli/types'
|
|
64
70
|
import { ref, useBlokkli, computed, watch } from '#imports'
|
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
:data-library-item-uuid="uuid"
|
|
6
6
|
:data-label="label"
|
|
7
7
|
:class="backgroundClass"
|
|
8
|
+
class="bk-library-list-item"
|
|
8
9
|
>
|
|
9
10
|
<div class="bk bk-library-list-item-header">
|
|
10
11
|
<div class="bk-blokkli-item-label">
|
|
11
12
|
<div class="bk-blokkli-item-label-icon">
|
|
12
13
|
<ItemIcon :bundle="bundle" />
|
|
13
14
|
</div>
|
|
14
|
-
<span>{{ label }}</span>
|
|
15
|
+
<span>{{ bundleLabel }}: {{ label }}</span>
|
|
15
16
|
</div>
|
|
16
17
|
</div>
|
|
17
18
|
<div
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
class="bk-library-list-item-inner"
|
|
20
21
|
:class="backgroundClass"
|
|
21
22
|
>
|
|
22
|
-
<ScaleToFit :width="previewWidth">
|
|
23
|
+
<ScaleToFit :width="previewWidth" :max-height="400">
|
|
23
24
|
<BlokkliItem
|
|
24
25
|
v-bind="item"
|
|
25
26
|
parent-type="nested"
|
|
@@ -31,9 +32,9 @@
|
|
|
31
32
|
</template>
|
|
32
33
|
|
|
33
34
|
<script setup lang="ts">
|
|
34
|
-
import { computed, provide } from '#imports'
|
|
35
|
+
import { computed, provide, useBlokkli } from '#imports'
|
|
35
36
|
|
|
36
|
-
import { getDefaultDefinition } from '#blokkli/definitions'
|
|
37
|
+
import { getDefaultDefinition } from '#blokkli-build/definitions'
|
|
37
38
|
import type { FieldListItem } from '#blokkli/types'
|
|
38
39
|
import { ItemIcon, ScaleToFit } from '#blokkli/components'
|
|
39
40
|
import {
|
|
@@ -44,14 +45,20 @@ import {
|
|
|
44
45
|
INJECT_PROVIDER_BLOCKS,
|
|
45
46
|
} from '#blokkli/helpers/symbols'
|
|
46
47
|
|
|
47
|
-
const
|
|
48
|
+
const props = defineProps<{
|
|
48
49
|
uuid: string
|
|
49
50
|
label?: string
|
|
50
51
|
bundle: string
|
|
51
52
|
item: FieldListItem
|
|
52
53
|
}>()
|
|
53
54
|
|
|
54
|
-
const
|
|
55
|
+
const { types } = useBlokkli()
|
|
56
|
+
|
|
57
|
+
const bundleLabel = computed(
|
|
58
|
+
() => types.getBlockBundleDefinition(props.bundle)?.label || props.bundle,
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
const definition = computed(() => getDefaultDefinition(props.bundle))
|
|
55
62
|
|
|
56
63
|
const previewWidth = computed(() => definition.value?.editor?.previewWidth)
|
|
57
64
|
const renderPreview = computed(
|