@macrulez/visual-linker-nuxt 0.4.5 → 0.4.6

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
@@ -15,7 +15,7 @@ monorepo.
15
15
 
16
16
  ## Features
17
17
 
18
- - **Auto-imports `<VisualLinker>` and `useVisualLinker`** — registered/imported from `@macrulez/visual-linker-vue`, no explicit `import` anywhere in your app
18
+ - **Auto-imports `<VisualLinker>`, `useVisualLinker` and `useVisualLinkerConnect`** — registered/imported from `@macrulez/visual-linker-vue`, no explicit `import` anywhere in your app
19
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
20
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`, `performance`), applied to every diagram
21
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)
@@ -75,7 +75,7 @@ for the full component/composable API.
75
75
 
76
76
  #### What the module does
77
77
 
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.
78
+ 1. **Auto-imports** `<VisualLinker>` as a global component and `useVisualLinker` / `useVisualLinkerConnect` as auto-imports, all sourced from `@macrulez/visual-linker-vue` — no explicit `import` needed in your components.
79
79
  2. **Forwards module options** into `runtimeConfig.public.visualLinker`.
80
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.
81
81
 
package/dist/module.js CHANGED
@@ -9,6 +9,7 @@ var visualLinkerModule = defineNuxtModule({
9
9
  const resolver = createResolver(import.meta.url);
10
10
  addComponent({ name: "VisualLinker", export: "VisualLinker", filePath: "@macrulez/visual-linker-vue" });
11
11
  addImports({ name: "useVisualLinker", from: "@macrulez/visual-linker-vue" });
12
+ addImports({ name: "useVisualLinkerConnect", from: "@macrulez/visual-linker-vue" });
12
13
  const connect = options?.interaction?.connect;
13
14
  if (typeof connect?.validate === "function") {
14
15
  console.warn(
@@ -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 { ConnectConfig, InteractionConfig, VisualLinkerConfig } from '@macrulez/visual-linker-vue'\n\nexport type SerializableConnectConfig = Omit<ConnectConfig, 'validate'>\n\nexport type SerializableInteractionConfig = Omit<InteractionConfig, 'connect'> & {\n connect?: SerializableConnectConfig\n}\n\nexport type ModuleOptions = Omit<VisualLinkerConfig, 'interaction'> & {\n interaction?: SerializableInteractionConfig\n}\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 const connect = (options as { interaction?: { connect?: { validate?: unknown } } } | undefined)?.interaction\n ?.connect\n if (typeof connect?.validate === 'function') {\n console.warn(\n '[visual-linker] interaction.connect.validate cannot be set in the Nuxt module options (runtimeConfig is JSON only) and was dropped — pass it in the config of <VisualLinker> instead.',\n )\n }\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;AActF,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,UAAM,UAAW,SAAgF,aAC7F;AACJ,QAAI,OAAO,SAAS,aAAa,YAAY;AAC3C,cAAQ;AAAA,QACN;AAAA,MACF;AAAA,IACF;AAEA,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
+ {"version":3,"sources":["../src/module.ts"],"sourcesContent":["import { addComponent, addImports, addPlugin, createResolver, defineNuxtModule } from '@nuxt/kit'\nimport type { NuxtModule } from '@nuxt/schema'\nimport type { ConnectConfig, InteractionConfig, VisualLinkerConfig } from '@macrulez/visual-linker-vue'\n\nexport type SerializableConnectConfig = Omit<ConnectConfig, 'validate'>\n\nexport type SerializableInteractionConfig = Omit<InteractionConfig, 'connect'> & {\n connect?: SerializableConnectConfig\n}\n\nexport type ModuleOptions = Omit<VisualLinkerConfig, 'interaction'> & {\n interaction?: SerializableInteractionConfig\n}\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 addImports({ name: 'useVisualLinkerConnect', from: '@macrulez/visual-linker-vue' })\n\n const connect = (options as { interaction?: { connect?: { validate?: unknown } } } | undefined)?.interaction\n ?.connect\n if (typeof connect?.validate === 'function') {\n console.warn(\n '[visual-linker] interaction.connect.validate cannot be set in the Nuxt module options (runtimeConfig is JSON only) and was dropped — pass it in the config of <VisualLinker> instead.',\n )\n }\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;AActF,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;AAC3E,eAAW,EAAE,MAAM,0BAA0B,MAAM,8BAA8B,CAAC;AAElF,UAAM,UAAW,SAAgF,aAC7F;AACJ,QAAI,OAAO,SAAS,aAAa,YAAY;AAC3C,cAAQ;AAAA,QACN;AAAA,MACF;AAAA,IACF;AAEA,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":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@macrulez/visual-linker-nuxt",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
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.4.5"
28
+ "@macrulez/visual-linker-vue": "0.4.6"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@nuxt/schema": "^4.5.2",