@macrulez/visual-linker-nuxt 0.3.0 → 0.4.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/README.md CHANGED
@@ -4,10 +4,9 @@
4
4
 
5
5
  Nuxt module wrapping
6
6
  [`@macrulez/visual-linker-vue`](https://www.npmjs.com/package/@macrulez/visual-linker-vue):
7
- auto-imported `<VisualLinker>`/`useVisualLinker`, and a client-only plugin
8
- that seeds their shared option defaults from your `nuxt.config.ts` — no
9
- manual `<ClientOnly>` wrapping needed, both are already SSR-safe on their
10
- own.
7
+ auto-imported `<VisualLinker>`/`useVisualLinker`, and a shared configuration
8
+ of every diagram taken from your `nuxt.config.ts` — no manual `<ClientOnly>`
9
+ wrapping needed, both are already SSR-safe on their own.
11
10
 
12
11
  Part of the [visual-linker](https://github.com/macrulezru/visual-linker)
13
12
  monorepo.
@@ -18,9 +17,9 @@ monorepo.
18
17
 
19
18
  - **Auto-imports `<VisualLinker>` and `useVisualLinker`** — registered/imported from `@macrulez/visual-linker-vue`, no explicit `import` anywhere in your app
20
19
  - **Registers `v-vl-block` / `v-vl-port` globally** — on the server too, so the `data-vl-*` discovery attributes are already in the server-rendered HTML
21
- - **Module options forwarded through `runtimeConfig`** — `defaultCurve`, `showPorts`, curve-geometry and port/marker-size knobs, `dragGridSize` — set once in `nuxt.config.ts`, applied everywhere
22
- - **A client-only plugin seeds those defaults** — reads the runtime config and calls `setVisualLinkerDefaults(...)` once, on the client
23
- - **Nothing needs `<ClientOnly>`** — the component/composable are SSR-safe on their own; this module's client-only-ness is only about _when_ the defaults get applied
20
+ - **The whole configuration, set once** — `visualLinker` in `nuxt.config.ts` takes the same structure as the engine (`theme`, `lines`, `markers`, `ports`, `labels`, `blocks`, `interaction`), applied to every diagram
21
+ - **The configuration is shared through Vue's `provide`** — one reactive object per app, which `useVisualLinkerConfig()` exposes for runtime changes (a theme switch re-styles every diagram)
22
+ - **Nothing needs `<ClientOnly>`** — the component/composable are SSR-safe on their own
24
23
 
25
24
  ---
26
25
 
@@ -28,10 +27,10 @@ monorepo.
28
27
 
29
28
  You're already on Nuxt and want `<VisualLinker>`/`useVisualLinker` wired
30
29
  up with zero manual setup — auto-imports, and one place to configure
31
- curve/port defaults instead of passing the same `options` at every call
32
- site.
30
+ style, theme and behavior in one structured config instead of passing the
31
+ same `config` at every call site.
33
32
 
34
- - **Passing the same `options` to every `<VisualLinker>` on the page gets old** — Set `defaultCurve`/`showPorts`/etc. once in `nuxt.config.ts` and every instance that doesn't override them picks up your project's defaults automatically.
33
+ - **Passing the same `config` to every `<VisualLinker>` on the page gets old** — Set `lines`/`ports`/`theme`/etc. once in `nuxt.config.ts` and every instance that doesn't override them picks up your project's defaults automatically.
35
34
  - **You'd rather not remember to import the component in every page** — Auto-imports mean `<VisualLinker>`/`useVisualLinker()` are just available, the same way Nuxt's own built-ins are.
36
35
  - **A team member reaches for `<ClientOnly>` out of habit** — There's nothing to wrap. Both already render an SSR-safe no-op and pick up the real diagram after hydration on their own.
37
36
 
@@ -48,8 +47,8 @@ npm install @macrulez/visual-linker-nuxt
48
47
  export default defineNuxtConfig({
49
48
  modules: ['@macrulez/visual-linker-nuxt'],
50
49
  visualLinker: {
51
- defaultCurve: 'smoothstep',
52
- showPorts: true,
50
+ lines: { curve: 'smoothstep' },
51
+ ports: { show: true },
53
52
  },
54
53
  })
55
54
  ```
@@ -78,8 +77,7 @@ for the full component/composable API.
78
77
 
79
78
  1. **Auto-imports** `<VisualLinker>` as a global component and `useVisualLinker` as an auto-import, both sourced from `@macrulez/visual-linker-vue` — no explicit `import` needed in your components.
80
79
  2. **Forwards module options** into `runtimeConfig.public.visualLinker`.
81
- 3. **Registers the `v-vl-block` / `v-vl-port` directives** in a universal plugin (`runtime/plugin.ts`) — on the server too, so the `data-vl-*` attributes are already in the SSR markup.
82
- 4. **Registers a client-only plugin** (`runtime/plugin.client.ts`) that reads that runtime config and calls `setVisualLinkerDefaults(...)` — so every `<VisualLinker>`/`useVisualLinker()` use that doesn't pass its own `options` picks up your configured defaults.
80
+ 3. **Registers one universal plugin** (`runtime/plugin.ts`): the `v-vl-block` / `v-vl-port` directives — on the server too, so the `data-vl-*` attributes are already in the SSR markup — and the app-wide shared config, taken from that runtime config. Every `<VisualLinker>`/`useVisualLinker()` merges it under its own `config`, and `useVisualLinkerConfig()` (from `@macrulez/visual-linker-vue`) hands you the same reactive object to change at runtime, e.g. to switch the theme.
83
81
 
84
82
  No `defaults` are hardcoded in the module itself — a field left unset in
85
83
  `nuxt.config.ts` falls all the way through to
@@ -88,40 +86,44 @@ to core's default is never silently shadowed by this module.
88
86
 
89
87
  #### Module options
90
88
 
91
- | Option | Mirrors | |
92
- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------- | ------------------------------------------------ |
93
- | `defaultCurve` | `VisualLinkerOptions.defaultCurve` | `'bezier' \| 'straight' \| 'smoothstep'` |
94
- | `showPorts` | `VisualLinkerOptions.showPorts` | |
95
- | `curvature` / `curveMinReach` / `curveMaxReach` / `curveAngleBlend` / `curveAngleMaxOffset` | matching `defaultCurveXxx` fields | bezier geometry |
96
- | `dragGridSize` | `VisualLinkerOptions.dragGridSize` | |
97
- | `portRadius` / `portColor` / `portStrokeColor` / `portStrokeWidth` | matching `defaultPortXxx` fields | built-in port dot look |
98
- | `circleMarkerSize` / `squareMarkerSize` / `diamondMarkerSize` / `arrowMarkerSize` | matching `defaultXxxMarkerSize` fields | |
99
- | `portSpread` | `VisualLinkerOptions.defaultPortSpread` | `true` or `{ gap, padding }` |
100
- | `jumps` | `VisualLinkerOptions.jumps` | `true` or `{ radius }` — hop over crossing lines |
101
- | `avoidObstacles` / `obstaclePadding` | `VisualLinkerOptions.avoidObstacles` / `obstaclePadding` | route `smoothstep` around other blocks |
102
- | `animated` | `VisualLinkerOptions.defaultAnimated` | `true` or a `ConnectionFlow` object |
103
- | `clipToScrollParents` | `VisualLinkerOptions.clipToScrollParents` | `true` / `'pin'` / `'hide'` / `false` |
104
-
105
- **Not covered by module options** (set these directly on
106
- `<VisualLinker :options="...">`/`useVisualLinker()` instead):
107
- `defaultCornerRadius`, `defaultMaxTrunkReach`, `draggable`, `dragBounds`.
108
-
109
- #### Setting an app-wide curve default
89
+ The `visualLinker` key is a `VisualLinkerConfig` — exactly the object
90
+ `createVisualLinker()` and `<VisualLinker :config>` take, so there is no
91
+ separate list of module-only names to learn:
92
+
93
+ | Group | What it configures |
94
+ | ------------- | ------------------------------------------------------------------------------------------------------------- |
95
+ | `theme` | color tokens, written as CSS variables — `lightTheme`/`darkTheme` or your own |
96
+ | `lines` | curve, color/width/dashed, `hover`/`selected`/`focus`, `bezier`, `smoothstep`, `routing`, `jumps`, `animated` |
97
+ | `markers` | `start`/`end` markers (with their own states) and per-shape `sizes` |
98
+ | `ports` | the built-in dot (`show`, `radius`, `fill`, `stroke`, states), default `side`/`offset`, `spread` |
99
+ | `labels` | the look of library-drawn connection labels, with states |
100
+ | `blocks` | `draggable`, `drag: { grid, bounds }` (values must be plain data — `'container'` or an inset object) |
101
+ | `interaction` | `selectable`, `clipToScrollParents` |
102
+
103
+ Everything is optional and nothing is hardcoded in the module: a field left
104
+ out falls through to `@macrulez/visual-linker-core`'s own built-in default.
105
+ The options travel through `runtimeConfig.public.visualLinker`, so they must
106
+ be JSON-serializable (no `HTMLElement` for `drag.bounds`).
107
+
108
+ #### An app-wide look
110
109
 
111
110
  ```ts
112
111
  // nuxt.config.ts
113
112
  export default defineNuxtConfig({
114
113
  modules: ['@macrulez/visual-linker-nuxt'],
115
114
  visualLinker: {
116
- defaultCurve: 'smoothstep',
117
- dragGridSize: 20,
115
+ theme: { line: '#6366f1', lineHover: '#312e81' },
116
+ lines: { curve: 'smoothstep', smoothstep: { cornerRadius: 10 }, jumps: true },
117
+ markers: { end: { shape: 'arrow', hover: { size: 10 } } },
118
+ blocks: { draggable: true, drag: { grid: 20 } },
118
119
  },
119
120
  })
120
121
  ```
121
122
 
122
- Every `<VisualLinker>`/`useVisualLinker()` call in the app now defaults
123
- to orthogonal routing and a 20px drag grid, unless a call site passes its
124
- own `options.defaultCurve`/`dragGridSize` to override it.
123
+ Every `<VisualLinker>`/`useVisualLinker()` call in the app starts from this,
124
+ and a call site's own `config` overrides it field by field. The values are
125
+ also reactive at runtime: `useVisualLinkerConfig().theme = darkTheme`
126
+ (from `@macrulez/visual-linker-vue`) re-themes every diagram on the page.
125
127
 
126
128
  ---
127
129
 
package/dist/module.d.ts CHANGED
@@ -1,46 +1,7 @@
1
1
  import { NuxtModule } from '@nuxt/schema';
2
- import { ConnectionCurve, ConnectionFlow } from '@macrulez/visual-linker-vue';
2
+ import { VisualLinkerConfig } from '@macrulez/visual-linker-vue';
3
3
 
4
- interface ModuleOptions {
5
- /** Falls through to @macrulez/visual-linker-core's own default (VLConnectionCurveEnum.BEZIER) when unset. */
6
- defaultCurve?: ConnectionCurve;
7
- /** Falls through to @macrulez/visual-linker-core's own default (true) when unset. */
8
- showPorts?: boolean;
9
- curvature?: number;
10
- curveMinReach?: number;
11
- curveMaxReach?: number;
12
- curveAngleBlend?: number;
13
- curveAngleMaxOffset?: number;
14
- /** Snaps every draggable block to this px grid while dragging. Falls through to no snapping when unset. */
15
- dragGridSize?: number;
16
- /** Instance-wide look for the built-in port dot — falls through to @macrulez/visual-linker-core's own defaults (params.ts) when unset. */
17
- portRadius?: number;
18
- portColor?: string;
19
- portStrokeColor?: string;
20
- portStrokeWidth?: number;
21
- /** Instance-wide default marker size per built-in shape — falls through to @macrulez/visual-linker-core's own defaults (params.ts) when unset. */
22
- circleMarkerSize?: number;
23
- squareMarkerSize?: number;
24
- diamondMarkerSize?: number;
25
- arrowMarkerSize?: number;
26
- /** Spreads connections sharing a port side into separate virtual ports — `true`, `{ gap, padding }`, or unset (off). */
27
- portSpread?: boolean | {
28
- gap?: number;
29
- padding?: number;
30
- };
31
- /** What to do with a connection end scrolled out of a clipping ancestor: `'pin'` (`true`, default) to the visible edge, `'hide'` the connection, `false` ignore. */
32
- clipToScrollParents?: boolean | 'pin' | 'hide';
33
- /** Animated flow along every connection by default — `true` or a `ConnectionFlow` object; a connection can opt out with `animated: false`. */
34
- animated?: boolean | ConnectionFlow;
35
- /** Route `smoothstep` connections around the other blocks instead of through them. */
36
- avoidObstacles?: boolean;
37
- /** Clearance kept between a routed line and every other block, px. */
38
- obstaclePadding?: number;
39
- /** Hop over crossing lines (`smoothstep`): `true` or `{ radius }`. */
40
- jumps?: boolean | {
41
- radius?: number;
42
- };
43
- }
4
+ type ModuleOptions = VisualLinkerConfig;
44
5
  declare const visualLinkerModule: NuxtModule<ModuleOptions>;
45
6
 
46
7
  export { type ModuleOptions, visualLinkerModule as default };
package/dist/module.js CHANGED
@@ -5,41 +5,12 @@ var visualLinkerModule = defineNuxtModule({
5
5
  name: "@macrulez/visual-linker-nuxt",
6
6
  configKey: "visualLinker"
7
7
  },
8
- // No `defaults` here on purpose: an option the user didn't set in
9
- // nuxt.config.ts must stay `undefined` all the way through to
10
- // @macrulez/visual-linker-core's own defaults (params.ts) — hardcoding one
11
- // here would silently shadow it, making a change to core's default look
12
- // like it does nothing for a Nuxt consumer.
13
8
  setup(options, nuxt) {
14
9
  const resolver = createResolver(import.meta.url);
15
10
  addComponent({ name: "VisualLinker", export: "VisualLinker", filePath: "@macrulez/visual-linker-vue" });
16
11
  addImports({ name: "useVisualLinker", from: "@macrulez/visual-linker-vue" });
17
- nuxt.options.runtimeConfig.public.visualLinker = {
18
- defaultCurve: options.defaultCurve,
19
- showPorts: options.showPorts,
20
- defaultCurvature: options.curvature,
21
- defaultCurveMinReach: options.curveMinReach,
22
- defaultCurveMaxReach: options.curveMaxReach,
23
- defaultCurveAngleBlend: options.curveAngleBlend,
24
- defaultCurveAngleMaxOffset: options.curveAngleMaxOffset,
25
- dragGridSize: options.dragGridSize,
26
- defaultPortRadius: options.portRadius,
27
- defaultPortColor: options.portColor,
28
- defaultPortStrokeColor: options.portStrokeColor,
29
- defaultPortStrokeWidth: options.portStrokeWidth,
30
- defaultCircleMarkerSize: options.circleMarkerSize,
31
- defaultSquareMarkerSize: options.squareMarkerSize,
32
- defaultDiamondMarkerSize: options.diamondMarkerSize,
33
- defaultArrowMarkerSize: options.arrowMarkerSize,
34
- defaultPortSpread: options.portSpread,
35
- clipToScrollParents: options.clipToScrollParents,
36
- defaultAnimated: options.animated,
37
- avoidObstacles: options.avoidObstacles,
38
- obstaclePadding: options.obstaclePadding,
39
- jumps: options.jumps
40
- };
12
+ nuxt.options.runtimeConfig.public.visualLinker = JSON.parse(JSON.stringify(options ?? {}));
41
13
  addPlugin(resolver.resolve("./runtime/plugin"));
42
- addPlugin(resolver.resolve("./runtime/plugin.client"));
43
14
  }
44
15
  });
45
16
  var module_default = visualLinkerModule;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/module.ts"],"sourcesContent":["import { addComponent, addImports, addPlugin, createResolver, defineNuxtModule } from '@nuxt/kit'\nimport type { NuxtModule } from '@nuxt/schema'\nimport type { ConnectionCurve, ConnectionFlow } from '@macrulez/visual-linker-vue'\n\nexport interface ModuleOptions {\n /** Falls through to @macrulez/visual-linker-core's own default (VLConnectionCurveEnum.BEZIER) when unset. */\n defaultCurve?: ConnectionCurve\n /** Falls through to @macrulez/visual-linker-core's own default (true) when unset. */\n showPorts?: boolean\n curvature?: number\n curveMinReach?: number\n curveMaxReach?: number\n curveAngleBlend?: number\n curveAngleMaxOffset?: number\n /** Snaps every draggable block to this px grid while dragging. Falls through to no snapping when unset. */\n dragGridSize?: number\n /** Instance-wide look for the built-in port dot — falls through to @macrulez/visual-linker-core's own defaults (params.ts) when unset. */\n portRadius?: number\n portColor?: string\n portStrokeColor?: string\n portStrokeWidth?: number\n /** Instance-wide default marker size per built-in shape — falls through to @macrulez/visual-linker-core's own defaults (params.ts) when unset. */\n circleMarkerSize?: number\n squareMarkerSize?: number\n diamondMarkerSize?: number\n arrowMarkerSize?: number\n /** Spreads connections sharing a port side into separate virtual ports — `true`, `{ gap, padding }`, or unset (off). */\n portSpread?: boolean | { gap?: number; padding?: number }\n /** What to do with a connection end scrolled out of a clipping ancestor: `'pin'` (`true`, default) to the visible edge, `'hide'` the connection, `false` ignore. */\n clipToScrollParents?: boolean | 'pin' | 'hide'\n /** Animated flow along every connection by default — `true` or a `ConnectionFlow` object; a connection can opt out with `animated: false`. */\n animated?: boolean | ConnectionFlow\n /** Route `smoothstep` connections around the other blocks instead of through them. */\n avoidObstacles?: boolean\n /** Clearance kept between a routed line and every other block, px. */\n obstaclePadding?: number\n /** Hop over crossing lines (`smoothstep`): `true` or `{ radius }`. */\n jumps?: boolean | { radius?: number }\n}\n\nconst visualLinkerModule: NuxtModule<ModuleOptions> = defineNuxtModule<ModuleOptions>({\n meta: {\n name: '@macrulez/visual-linker-nuxt',\n configKey: 'visualLinker',\n },\n // No `defaults` here on purpose: an option the user didn't set in\n // nuxt.config.ts must stay `undefined` all the way through to\n // @macrulez/visual-linker-core's own defaults (params.ts) — hardcoding one\n // here would silently shadow it, making a change to core's default look\n // like it does nothing for a Nuxt consumer.\n setup(options, nuxt) {\n const resolver = createResolver(import.meta.url)\n\n addComponent({ name: 'VisualLinker', export: 'VisualLinker', filePath: '@macrulez/visual-linker-vue' })\n addImports({ name: 'useVisualLinker', from: '@macrulez/visual-linker-vue' })\n\n nuxt.options.runtimeConfig.public.visualLinker = {\n defaultCurve: options.defaultCurve,\n showPorts: options.showPorts,\n defaultCurvature: options.curvature,\n defaultCurveMinReach: options.curveMinReach,\n defaultCurveMaxReach: options.curveMaxReach,\n defaultCurveAngleBlend: options.curveAngleBlend,\n defaultCurveAngleMaxOffset: options.curveAngleMaxOffset,\n dragGridSize: options.dragGridSize,\n defaultPortRadius: options.portRadius,\n defaultPortColor: options.portColor,\n defaultPortStrokeColor: options.portStrokeColor,\n defaultPortStrokeWidth: options.portStrokeWidth,\n defaultCircleMarkerSize: options.circleMarkerSize,\n defaultSquareMarkerSize: options.squareMarkerSize,\n defaultDiamondMarkerSize: options.diamondMarkerSize,\n defaultArrowMarkerSize: options.arrowMarkerSize,\n defaultPortSpread: options.portSpread,\n clipToScrollParents: options.clipToScrollParents,\n defaultAnimated: options.animated,\n avoidObstacles: options.avoidObstacles,\n obstaclePadding: options.obstaclePadding,\n jumps: options.jumps,\n }\n\n // Registers v-vl-block / v-vl-port on both server and client.\n addPlugin(resolver.resolve('./runtime/plugin'))\n // Applies module options on the client only — <VisualLinker>/useVisualLinker\n // are already SSR-safe no-ops, this just seeds their shared client-side defaults.\n addPlugin(resolver.resolve('./runtime/plugin.client'))\n },\n})\n\nexport default visualLinkerModule\n"],"mappings":";AAAA,SAAS,cAAc,YAAY,WAAW,gBAAgB,wBAAwB;AAwCtF,IAAM,qBAAgD,iBAAgC;AAAA,EACpF,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,WAAW;AAAA,EACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,SAAS,MAAM;AACnB,UAAM,WAAW,eAAe,YAAY,GAAG;AAE/C,iBAAa,EAAE,MAAM,gBAAgB,QAAQ,gBAAgB,UAAU,8BAA8B,CAAC;AACtG,eAAW,EAAE,MAAM,mBAAmB,MAAM,8BAA8B,CAAC;AAE3E,SAAK,QAAQ,cAAc,OAAO,eAAe;AAAA,MAC/C,cAAc,QAAQ;AAAA,MACtB,WAAW,QAAQ;AAAA,MACnB,kBAAkB,QAAQ;AAAA,MAC1B,sBAAsB,QAAQ;AAAA,MAC9B,sBAAsB,QAAQ;AAAA,MAC9B,wBAAwB,QAAQ;AAAA,MAChC,4BAA4B,QAAQ;AAAA,MACpC,cAAc,QAAQ;AAAA,MACtB,mBAAmB,QAAQ;AAAA,MAC3B,kBAAkB,QAAQ;AAAA,MAC1B,wBAAwB,QAAQ;AAAA,MAChC,wBAAwB,QAAQ;AAAA,MAChC,yBAAyB,QAAQ;AAAA,MACjC,yBAAyB,QAAQ;AAAA,MACjC,0BAA0B,QAAQ;AAAA,MAClC,wBAAwB,QAAQ;AAAA,MAChC,mBAAmB,QAAQ;AAAA,MAC3B,qBAAqB,QAAQ;AAAA,MAC7B,iBAAiB,QAAQ;AAAA,MACzB,gBAAgB,QAAQ;AAAA,MACxB,iBAAiB,QAAQ;AAAA,MACzB,OAAO,QAAQ;AAAA,IACjB;AAGA,cAAU,SAAS,QAAQ,kBAAkB,CAAC;AAG9C,cAAU,SAAS,QAAQ,yBAAyB,CAAC;AAAA,EACvD;AACF,CAAC;AAED,IAAO,iBAAQ;","names":[]}
1
+ {"version":3,"sources":["../src/module.ts"],"sourcesContent":["import { addComponent, addImports, addPlugin, createResolver, defineNuxtModule } from '@nuxt/kit'\nimport type { NuxtModule } from '@nuxt/schema'\nimport type { VisualLinkerConfig } from '@macrulez/visual-linker-vue'\n\nexport type ModuleOptions = VisualLinkerConfig\n\nconst visualLinkerModule: NuxtModule<ModuleOptions> = defineNuxtModule<ModuleOptions>({\n meta: {\n name: '@macrulez/visual-linker-nuxt',\n configKey: 'visualLinker',\n },\n setup(options, nuxt) {\n const resolver = createResolver(import.meta.url)\n\n addComponent({ name: 'VisualLinker', export: 'VisualLinker', filePath: '@macrulez/visual-linker-vue' })\n addImports({ name: 'useVisualLinker', from: '@macrulez/visual-linker-vue' })\n\n nuxt.options.runtimeConfig.public.visualLinker = JSON.parse(JSON.stringify(options ?? {}))\n\n addPlugin(resolver.resolve('./runtime/plugin'))\n },\n})\n\nexport default visualLinkerModule\n"],"mappings":";AAAA,SAAS,cAAc,YAAY,WAAW,gBAAgB,wBAAwB;AAMtF,IAAM,qBAAgD,iBAAgC;AAAA,EACpF,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,WAAW;AAAA,EACb;AAAA,EACA,MAAM,SAAS,MAAM;AACnB,UAAM,WAAW,eAAe,YAAY,GAAG;AAE/C,iBAAa,EAAE,MAAM,gBAAgB,QAAQ,gBAAgB,UAAU,8BAA8B,CAAC;AACtG,eAAW,EAAE,MAAM,mBAAmB,MAAM,8BAA8B,CAAC;AAE3E,SAAK,QAAQ,cAAc,OAAO,eAAe,KAAK,MAAM,KAAK,UAAU,WAAW,CAAC,CAAC,CAAC;AAEzF,cAAU,SAAS,QAAQ,kBAAkB,CAAC;AAAA,EAChD;AACF,CAAC;AAED,IAAO,iBAAQ;","names":[]}
@@ -1,9 +1,11 @@
1
1
  // src/runtime/plugin.ts
2
- import { vVlBlock, vVlPort } from "@macrulez/visual-linker-vue";
3
- import { defineNuxtPlugin } from "nuxt/app";
2
+ import { installVisualLinkerConfig, vVlBlock, vVlPort } from "@macrulez/visual-linker-vue";
3
+ import { defineNuxtPlugin, useRuntimeConfig } from "nuxt/app";
4
4
  var plugin_default = defineNuxtPlugin((nuxtApp) => {
5
5
  nuxtApp.vueApp.directive("vl-block", vVlBlock);
6
6
  nuxtApp.vueApp.directive("vl-port", vVlPort);
7
+ const config = useRuntimeConfig().public.visualLinker;
8
+ installVisualLinkerConfig(nuxtApp.vueApp, config);
7
9
  });
8
10
  export {
9
11
  plugin_default as default
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/runtime/plugin.ts"],"sourcesContent":["import { vVlBlock, vVlPort } from '@macrulez/visual-linker-vue'\nimport { defineNuxtPlugin } from 'nuxt/app'\n\n// Universal (not client-only): the directives' getSSRProps put the\n// data-vl-* discovery attributes straight into server-rendered markup.\nexport default defineNuxtPlugin((nuxtApp) => {\n nuxtApp.vueApp.directive('vl-block', vVlBlock)\n nuxtApp.vueApp.directive('vl-port', vVlPort)\n})\n"],"mappings":";AAAA,SAAS,UAAU,eAAe;AAClC,SAAS,wBAAwB;AAIjC,IAAO,iBAAQ,iBAAiB,CAAC,YAAY;AAC3C,UAAQ,OAAO,UAAU,YAAY,QAAQ;AAC7C,UAAQ,OAAO,UAAU,WAAW,OAAO;AAC7C,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../src/runtime/plugin.ts"],"sourcesContent":["import { installVisualLinkerConfig, vVlBlock, vVlPort, type VisualLinkerConfig } from '@macrulez/visual-linker-vue'\nimport { defineNuxtPlugin, useRuntimeConfig } from 'nuxt/app'\n\nexport default defineNuxtPlugin((nuxtApp) => {\n nuxtApp.vueApp.directive('vl-block', vVlBlock)\n nuxtApp.vueApp.directive('vl-port', vVlPort)\n const config = useRuntimeConfig().public.visualLinker as VisualLinkerConfig | undefined\n installVisualLinkerConfig(nuxtApp.vueApp, config)\n})\n"],"mappings":";AAAA,SAAS,2BAA2B,UAAU,eAAwC;AACtF,SAAS,kBAAkB,wBAAwB;AAEnD,IAAO,iBAAQ,iBAAiB,CAAC,YAAY;AAC3C,UAAQ,OAAO,UAAU,YAAY,QAAQ;AAC7C,UAAQ,OAAO,UAAU,WAAW,OAAO;AAC3C,QAAM,SAAS,iBAAiB,EAAE,OAAO;AACzC,4BAA0B,QAAQ,QAAQ,MAAM;AAClD,CAAC;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@macrulez/visual-linker-nuxt",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "Nuxt module wrapping @macrulez/visual-linker-vue: auto-imported <VisualLinker> and useVisualLinker, module options for default curve/port rendering",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@nuxt/kit": "^4.5.2",
28
- "@macrulez/visual-linker-vue": "0.3.0"
28
+ "@macrulez/visual-linker-vue": "0.4.1"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@nuxt/schema": "^4.5.2",
@@ -1,5 +0,0 @@
1
- import * as nuxt_app from 'nuxt/app';
2
-
3
- declare const _default: nuxt_app.Plugin<Record<string, unknown>> & nuxt_app.ObjectPlugin<Record<string, unknown>>;
4
-
5
- export { _default as default };
@@ -1,11 +0,0 @@
1
- // src/runtime/plugin.client.ts
2
- import { setVisualLinkerDefaults } from "@macrulez/visual-linker-vue";
3
- import { defineNuxtPlugin, useRuntimeConfig } from "nuxt/app";
4
- var plugin_client_default = defineNuxtPlugin(() => {
5
- const config = useRuntimeConfig().public.visualLinker;
6
- if (config) setVisualLinkerDefaults(config);
7
- });
8
- export {
9
- plugin_client_default as default
10
- };
11
- //# sourceMappingURL=plugin.client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/runtime/plugin.client.ts"],"sourcesContent":["import { setVisualLinkerDefaults, type VisualLinkerDefaults } from '@macrulez/visual-linker-vue'\nimport { defineNuxtPlugin, useRuntimeConfig } from 'nuxt/app'\n\nexport default defineNuxtPlugin(() => {\n const config = useRuntimeConfig().public.visualLinker as VisualLinkerDefaults | undefined\n if (config) setVisualLinkerDefaults(config)\n})\n"],"mappings":";AAAA,SAAS,+BAA0D;AACnE,SAAS,kBAAkB,wBAAwB;AAEnD,IAAO,wBAAQ,iBAAiB,MAAM;AACpC,QAAM,SAAS,iBAAiB,EAAE,OAAO;AACzC,MAAI,OAAQ,yBAAwB,MAAM;AAC5C,CAAC;","names":[]}