@blokkli/editor 1.3.3 → 1.3.4

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.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "blokkli",
3
3
  "configKey": "blokkli",
4
- "version": "1.3.3",
4
+ "version": "1.3.4",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.12.0"
7
7
  },
package/dist/module.mjs CHANGED
@@ -7,7 +7,7 @@ import MagicString from 'magic-string';
7
7
  import { walk } from 'estree-walker-ts';
8
8
  import { BK_VISIBLE_LANGUAGES, BK_HIDDEN_GLOBALLY } from '../dist/runtime/helpers/symbols.js';
9
9
 
10
- const version = "1.3.3";
10
+ const version = "1.3.4";
11
11
 
12
12
  function sortObjectKeys(obj) {
13
13
  if (Array.isArray(obj)) {
@@ -6999,7 +6999,10 @@ const module = defineNuxtModule({
6999
6999
  moduleOptions.alterFeatures(featuresContext)
7000
7000
  );
7001
7001
  }
7002
- const allFeatureIds = extractedFeatures.map((v) => v.id);
7002
+ const allFeatureIds = [
7003
+ ...extractedFeatures.map((v) => v.id),
7004
+ ...featuresContext.features.map((v) => v.id)
7005
+ ].filter(onlyUnique);
7003
7006
  const featureComponents = addTemplate({
7004
7007
  write: true,
7005
7008
  filename: "blokkli/features.ts",
@@ -17,7 +17,7 @@
17
17
  </template>
18
18
 
19
19
  <script setup lang="ts">
20
- import { type Artboard, type ArtboardPlugin, overview } from 'artboard-deluxe'
20
+ import { type Artboard, type PluginOverview, overview } from 'artboard-deluxe'
21
21
  import { onBeforeUnmount, onMounted, ref, useBlokkli, computed } from '#imports'
22
22
  import onBlokkliEvent from '#blokkli/helpers/composables/onBlokkliEvent'
23
23
 
@@ -40,7 +40,7 @@ const overviewArtboardEl = ref<HTMLDivElement>()
40
40
  const overviewVisibleEl = ref<HTMLDivElement>()
41
41
  const canvas = ref<HTMLCanvasElement>()
42
42
 
43
- let pluginOverview: ArtboardPlugin | null = null
43
+ let pluginOverview: PluginOverview | null = null
44
44
 
45
45
  function updateCanvas() {
46
46
  const ctx = canvas.value?.getContext('2d')
@@ -12,7 +12,7 @@
12
12
  </template>
13
13
 
14
14
  <script setup lang="ts">
15
- import { type Artboard, type ArtboardPlugin, scrollbar } from 'artboard-deluxe'
15
+ import { type Artboard, type PluginScrollbar, scrollbar } from 'artboard-deluxe'
16
16
  import { onBeforeUnmount, onMounted, ref } from '#imports'
17
17
 
18
18
  const props = defineProps<{
@@ -22,7 +22,7 @@ const props = defineProps<{
22
22
 
23
23
  const el = ref<HTMLDivElement>()
24
24
  const thumb = ref<HTMLButtonElement>()
25
- let scrollbarPlugin: ArtboardPlugin | null = null
25
+ let scrollbarPlugin: PluginScrollbar | null = null
26
26
 
27
27
  onMounted(() => {
28
28
  if (el.value && thumb.value) {
@@ -65,11 +65,11 @@ import {
65
65
  type ArtboardOptions,
66
66
  type Artboard,
67
67
  type PluginWheelOptions,
68
+ type PluginWheelFactory,
68
69
  touch,
69
70
  wheel,
70
71
  mouse,
71
72
  dom as domPlugin,
72
- type PluginWheel,
73
73
  } from 'artboard-deluxe'
74
74
  const { settings } = defineBlokkliFeature({
75
75
  id: 'artboard',
@@ -155,7 +155,7 @@ const saveState = () => {
155
155
  }
156
156
  }
157
157
 
158
- let pluginWheel: PluginWheel | null = null
158
+ let pluginWheel: PluginWheelFactory | null = null
159
159
 
160
160
  const wheelOptions = computed<PluginWheelOptions>(() => {
161
161
  return {
@@ -115,7 +115,7 @@ const groups = computed<GroupedSettings[]>(() => {
115
115
  }
116
116
 
117
117
  acc[group].settings.push({
118
- featureId: feature.id,
118
+ featureId: feature.id as ValidFeatureKey,
119
119
  settingsKey,
120
120
  setting,
121
121
  })
@@ -1,5 +1,11 @@
1
1
  import { INJECT_APP } from "../helpers/symbols.js";
2
2
  import { inject } from "#imports";
3
3
  export function useBlokkli() {
4
- return inject(INJECT_APP);
4
+ const app = inject(INJECT_APP);
5
+ if (!app) {
6
+ throw new Error(
7
+ "The useBlokkli composable was called while not in edit mode."
8
+ );
9
+ }
10
+ return app;
5
11
  }