@vue-flow/background
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -10,3 +10,3 @@ import type { BackgroundVariant } from './types' | ||
variant: { | ||
type: import('vue').PropType<BackgroundVariant | 'lines' | 'dots'> | ||
type: import('vue').PropType<'lines' | 'dots' | BackgroundVariant> | ||
} | ||
@@ -44,3 +44,3 @@ gap: { | ||
offset: { | ||
type: import('vue').PropType<number> | ||
type: import('vue').PropType<number | [number, number]> | ||
} | ||
@@ -63,3 +63,3 @@ }, | ||
variant: { | ||
type: import('vue').PropType<BackgroundVariant | 'lines' | 'dots'> | ||
type: import('vue').PropType<'lines' | 'dots' | BackgroundVariant> | ||
} | ||
@@ -97,3 +97,3 @@ gap: { | ||
offset: { | ||
type: import('vue').PropType<number> | ||
type: import('vue').PropType<number | [number, number]> | ||
} | ||
@@ -100,0 +100,0 @@ }> |
@@ -39,3 +39,3 @@ /** | ||
/** Background offset */ | ||
offset?: number | ||
offset?: number | [number, number] | ||
} |
@@ -61,6 +61,10 @@ var VueFlowBackground = function(exports, vue, core) { | ||
const scaledSize = __props.size * viewport.value.zoom; | ||
const patternOffset = __props.variant === BackgroundVariant.Dots ? [scaledSize / __props.offset, scaledSize / __props.offset] : [scaledGap[0] / __props.offset, scaledGap[1] / __props.offset]; | ||
const [offsetX, offsetY] = Array.isArray(__props.offset) ? __props.offset : [__props.offset, __props.offset]; | ||
const scaledOffset = [ | ||
offsetX * viewport.value.zoom || 1 + scaledGap[0] / 2, | ||
offsetY * viewport.value.zoom || 1 + scaledGap[1] / 2 | ||
]; | ||
return { | ||
scaledGap, | ||
offset: patternOffset, | ||
offset: scaledOffset, | ||
size: scaledSize | ||
@@ -98,3 +102,3 @@ }; | ||
color: patternColor.value, | ||
radius: background.value.size / _ctx.offset | ||
radius: background.value.size / 2 | ||
}, null, 8, ["color", "radius"])) : vue.createCommentVNode("", true), | ||
@@ -101,0 +105,0 @@ _ctx.bgColor ? (vue.openBlock(), vue.createElementBlock("svg", _hoisted_2, [ |
@@ -63,6 +63,10 @@ "use strict"; | ||
const scaledSize = __props.size * viewport.value.zoom; | ||
const patternOffset = __props.variant === BackgroundVariant.Dots ? [scaledSize / __props.offset, scaledSize / __props.offset] : [scaledGap[0] / __props.offset, scaledGap[1] / __props.offset]; | ||
const [offsetX, offsetY] = Array.isArray(__props.offset) ? __props.offset : [__props.offset, __props.offset]; | ||
const scaledOffset = [ | ||
offsetX * viewport.value.zoom || 1 + scaledGap[0] / 2, | ||
offsetY * viewport.value.zoom || 1 + scaledGap[1] / 2 | ||
]; | ||
return { | ||
scaledGap, | ||
offset: patternOffset, | ||
offset: scaledOffset, | ||
size: scaledSize | ||
@@ -100,3 +104,3 @@ }; | ||
color: patternColor.value, | ||
radius: background.value.size / _ctx.offset | ||
radius: background.value.size / 2 | ||
}, null, 8, ["color", "radius"])) : vue.createCommentVNode("", true), | ||
@@ -103,0 +107,0 @@ _ctx.bgColor ? (vue.openBlock(), vue.createElementBlock("svg", _hoisted_2, [ |
{ | ||
"name": "@vue-flow/background", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"private": false, | ||
@@ -54,6 +54,6 @@ "license": "MIT", | ||
"vue-tsc": "^1.8.16", | ||
"@tooling/vite-config": "0.0.0", | ||
"@tooling/eslint-config": "0.0.0", | ||
"@tooling/tsconfig": "0.0.0", | ||
"@vue-flow/core": "1.32.0" | ||
"@tooling/vite-config": "0.0.0", | ||
"@vue-flow/core": "1.41.3" | ||
}, | ||
@@ -60,0 +60,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
23652
557
0