@onderwijsin/nuxt-loops-renderer 0.2.2 → 0.2.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/README.md CHANGED
@@ -115,11 +115,11 @@ export default defineNuxtConfig({
115
115
 
116
116
  Available module options are:
117
117
 
118
- | Option | Default | Description |
119
- | ------------------- | --------- | -------------------------------------------------------------- |
120
- | `enabled` | `true` | Set to `false` to skip runtime registration. |
121
- | `applyInlineStyles` | `true` | Apply validated LMX presentation attributes as inline styles. |
122
- | `evaluate` | See above | Fallbacks for missing variables and invalid conditional rules. |
118
+ | Option | Default | Description |
119
+ | ------------------- | --------- | -------------------------------------------------------------------- |
120
+ | `enabled` | `true` | Set to `false` to skip runtime registration and module dependencies. |
121
+ | `applyInlineStyles` | `true` | Apply validated LMX presentation attributes as inline styles. |
122
+ | `evaluate` | See above | Fallbacks for missing variables and invalid conditional rules. |
123
123
 
124
124
  The same `applyInlineStyles` and `evaluate` options can be overridden for an individual
125
125
  `LoopsRenderer` with its `config` prop. `debug` is a per-renderer option and is intended for
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@onderwijsin/nuxt-loops-renderer",
3
3
  "configKey": "loopsRenderer",
4
- "version": "0.2.2",
4
+ "version": "0.2.4",
5
5
  "compatibility": {
6
6
  "nuxt": "^4.0.0"
7
7
  },
package/dist/module.mjs CHANGED
@@ -1,78 +1,7 @@
1
1
  import { defineNuxtModule, useLogger, createResolver, addComponentsDir } from '@nuxt/kit';
2
- import { z } from 'zod';
2
+ import { resolveModuleName, resolveLoggerScope, moduleSetup, transpileRuntime } from '@onderwijsin/nuxt-module-utils/shared';
3
3
 
4
- var NUMBER_CHAR_RE = /\d/;
5
- var STR_SPLITTERS = ["-", "_", "/", "."];
6
- function isUppercase(char = "") {
7
- if (NUMBER_CHAR_RE.test(char)) {
8
- return void 0;
9
- }
10
- return char !== char.toLowerCase();
11
- }
12
- function splitByCase(str, separators) {
13
- const splitters = STR_SPLITTERS;
14
- const parts = [];
15
- let buff = "";
16
- let previousUpper;
17
- let previousSplitter;
18
- for (const char of str) {
19
- const isSplitter = splitters.includes(char);
20
- if (isSplitter === true) {
21
- parts.push(buff);
22
- buff = "";
23
- previousUpper = void 0;
24
- continue;
25
- }
26
- const isUpper = isUppercase(char);
27
- if (previousSplitter === false) {
28
- if (previousUpper === false && isUpper === true) {
29
- parts.push(buff);
30
- buff = char;
31
- previousUpper = isUpper;
32
- continue;
33
- }
34
- if (previousUpper === true && isUpper === false && buff.length > 1) {
35
- const lastChar = buff.at(-1);
36
- parts.push(buff.slice(0, Math.max(0, buff.length - 1)));
37
- buff = lastChar + char;
38
- previousUpper = isUpper;
39
- continue;
40
- }
41
- }
42
- buff += char;
43
- previousUpper = isUpper;
44
- previousSplitter = isSplitter;
45
- }
46
- parts.push(buff);
47
- return parts;
48
- }
49
- function kebabCase(str, joiner) {
50
- return str ? (Array.isArray(str) ? str : splitByCase(str)).map((p) => p.toLowerCase()).join("-") : "";
51
- }
52
- z.boolean().default(true);
53
- function resolveModuleName(moduleKey) {
54
- return `@onderwijsin/nuxt-${kebabCase(moduleKey)}`;
55
- }
56
- function resolveLoggerScope(moduleKey) {
57
- return kebabCase(moduleKey);
58
- }
59
- function transpileRuntime(nuxt, runtimeDir) {
60
- nuxt.options.build.transpile.push(runtimeDir);
61
- }
62
- function moduleSetup(MODULE_NAME, options, log) {
63
- const start = () => log.start(`Loading module ${MODULE_NAME}`);
64
- const end = () => log.success(`Module ${MODULE_NAME} Loaded`);
65
- const isEnabled = () => {
66
- if ("enabled" in options && options.enabled === false) {
67
- log.info(`Module ${MODULE_NAME} is disabled. Skipping setup...`);
68
- return false;
69
- }
70
- return true;
71
- };
72
- return { start, end, isEnabled };
73
- }
74
-
75
- const version = "0.2.2";
4
+ const version = "0.2.4";
76
5
 
77
6
  const MODULE_KEY = "loopsRenderer";
78
7
  const MODULE_NAME = resolveModuleName(MODULE_KEY);
@@ -88,7 +17,7 @@ const module$1 = defineNuxtModule({
88
17
  defaults: {
89
18
  // applyInlineStyles: true
90
19
  },
91
- moduleDependencies: {
20
+ moduleDependencies: (nuxt) => nuxt.options.loopsRenderer === false || nuxt.options.loopsRenderer?.enabled === false ? {} : {
92
21
  "@nuxt/ui": {
93
22
  version: ">=4.0.0"
94
23
  }
package/package.json CHANGED
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "name": "@onderwijsin/nuxt-loops-renderer",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Nuxt module for rendering Loops LMX email content.",
5
5
  "homepage": "https://github.com/onderwijsin/nuxt-modules#readme",
6
6
  "bugs": {
7
7
  "url": "https://github.com/onderwijsin/nuxt-modules/issues"
8
8
  },
9
9
  "license": "MIT",
10
+ "author": {
11
+ "name": "Remi Huigen",
12
+ "email": "remihuigen@proton.me"
13
+ },
10
14
  "repository": {
11
15
  "type": "git",
12
16
  "url": "git+https://github.com/onderwijsin/nuxt-modules.git",
@@ -38,14 +42,14 @@
38
42
  "defu": "6.1.7",
39
43
  "simple-icons": "16.28.0",
40
44
  "tailwindcss": "4.3.3",
41
- "zod": "4.4.3"
45
+ "zod": "4.4.3",
46
+ "@onderwijsin/nuxt-module-utils": "^0.1.0"
42
47
  },
43
48
  "devDependencies": {
44
49
  "@nuxt/module-builder": "1.0.3",
45
50
  "nuxt": "4.5.2",
46
51
  "typescript": "5.9.3",
47
- "unbuild": "3.6.1",
48
- "module-utils": "0.0.0"
52
+ "unbuild": "3.6.1"
49
53
  },
50
54
  "engines": {
51
55
  "node": ">=22"
@@ -53,7 +57,7 @@
53
57
  "scripts": {
54
58
  "build": "nuxt-module-build build",
55
59
  "typecheck": "tsc --noEmit --project tsconfig.json",
56
- "dev": "npm run dev:prepare && nuxt dev playground",
60
+ "dev": "pnpm run dev:prepare && nuxt dev playground",
57
61
  "dev:build": "nuxt build playground",
58
62
  "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playground"
59
63
  }