v-nuxt-ui 0.2.9 → 0.2.10

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
@@ -7,7 +7,7 @@
7
7
  "dependencies": [
8
8
  "@nuxt/ui"
9
9
  ],
10
- "version": "0.2.9",
10
+ "version": "0.2.10",
11
11
  "builder": {
12
12
  "@nuxt/module-builder": "1.0.2",
13
13
  "unbuild": "3.6.1"
@@ -27,13 +27,13 @@ type __VLS_Props = {
27
27
  fitViewPadding?: number;
28
28
  noFlowNodeBorder?: boolean;
29
29
  };
30
- declare var __VLS_21: {
30
+ declare var __VLS_22: {
31
31
  data: any;
32
- }, __VLS_62: {};
32
+ }, __VLS_63: {};
33
33
  type __VLS_Slots = {} & {
34
- node?: (props: typeof __VLS_21) => any;
34
+ node?: (props: typeof __VLS_22) => any;
35
35
  } & {
36
- default?: (props: typeof __VLS_62) => any;
36
+ default?: (props: typeof __VLS_63) => any;
37
37
  };
38
38
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
39
39
  "update:modelValue": (value: Flow) => any;
@@ -220,11 +220,33 @@ const defaultEdgeOptions = computed(() => {
220
220
  animated: false
221
221
  };
222
222
  });
223
+ const flowContainer = ref(null);
224
+ let resizeObserver = null;
225
+ let prevWidth = 0;
226
+ onMounted(() => {
227
+ const el = flowContainer.value?.$el ?? flowContainer.value;
228
+ if (!el) return;
229
+ prevWidth = el.clientWidth;
230
+ resizeObserver = new ResizeObserver((entries) => {
231
+ const entry = entries[0];
232
+ if (!entry) return;
233
+ const newWidth = entry.contentRect.width;
234
+ if (newWidth !== prevWidth) {
235
+ prevWidth = newWidth;
236
+ nextTick(() => vueFlowFitView({ padding: props.fitViewPadding }));
237
+ }
238
+ });
239
+ resizeObserver.observe(el);
240
+ });
241
+ onBeforeUnmount(() => {
242
+ resizeObserver?.disconnect();
243
+ });
223
244
  const isValidConnection = () => true;
224
245
  </script>
225
246
 
226
247
  <template>
227
248
  <VueFlow
249
+ ref="flowContainer"
228
250
  v-model:nodes="nodes"
229
251
  v-model:edges="edges"
230
252
  :default-zoom="defaultZoom"
@@ -27,13 +27,13 @@ type __VLS_Props = {
27
27
  fitViewPadding?: number;
28
28
  noFlowNodeBorder?: boolean;
29
29
  };
30
- declare var __VLS_21: {
30
+ declare var __VLS_22: {
31
31
  data: any;
32
- }, __VLS_62: {};
32
+ }, __VLS_63: {};
33
33
  type __VLS_Slots = {} & {
34
- node?: (props: typeof __VLS_21) => any;
34
+ node?: (props: typeof __VLS_22) => any;
35
35
  } & {
36
- default?: (props: typeof __VLS_62) => any;
36
+ default?: (props: typeof __VLS_63) => any;
37
37
  };
38
38
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
39
39
  "update:modelValue": (value: Flow) => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "v-nuxt-ui",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "description": "Veken UI Component Library - Reusable Nuxt UI components, composables, and utilities for enterprise applications",
5
5
  "type": "module",
6
6
  "style": "./dist/runtime/index.css",